@visulima/vis 0.0.1 → 1.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +360 -0
  2. package/LICENSE.md +91 -0
  3. package/README.md +364 -29
  4. package/dist/bin.js +2 -0
  5. package/dist/errors/index.d.ts +26 -0
  6. package/dist/errors/index.js +1 -0
  7. package/dist/generate/index.d.ts +157 -0
  8. package/dist/generate/index.js +1 -0
  9. package/dist/packem_chunks/bin.js +87 -0
  10. package/dist/packem_chunks/config.js +2 -0
  11. package/dist/packem_chunks/fix.js +53 -0
  12. package/dist/packem_chunks/handler.js +1 -0
  13. package/dist/packem_chunks/handler10.js +1 -0
  14. package/dist/packem_chunks/handler11.js +1 -0
  15. package/dist/packem_chunks/handler12.js +2 -0
  16. package/dist/packem_chunks/handler13.js +1 -0
  17. package/dist/packem_chunks/handler14.js +5 -0
  18. package/dist/packem_chunks/handler15.js +1 -0
  19. package/dist/packem_chunks/handler16.js +20 -0
  20. package/dist/packem_chunks/handler17.js +1 -0
  21. package/dist/packem_chunks/handler18.js +1 -0
  22. package/dist/packem_chunks/handler19.js +1 -0
  23. package/dist/packem_chunks/handler2.js +1 -0
  24. package/dist/packem_chunks/handler20.js +1 -0
  25. package/dist/packem_chunks/handler21.js +1 -0
  26. package/dist/packem_chunks/handler22.js +5 -0
  27. package/dist/packem_chunks/handler23.js +1 -0
  28. package/dist/packem_chunks/handler24.js +1 -0
  29. package/dist/packem_chunks/handler25.js +5 -0
  30. package/dist/packem_chunks/handler26.js +1 -0
  31. package/dist/packem_chunks/handler27.js +3 -0
  32. package/dist/packem_chunks/handler28.js +1 -0
  33. package/dist/packem_chunks/handler29.js +7 -0
  34. package/dist/packem_chunks/handler3.js +2 -0
  35. package/dist/packem_chunks/handler30.js +23 -0
  36. package/dist/packem_chunks/handler31.js +3 -0
  37. package/dist/packem_chunks/handler32.js +2 -0
  38. package/dist/packem_chunks/handler33.js +24 -0
  39. package/dist/packem_chunks/handler34.js +2 -0
  40. package/dist/packem_chunks/handler35.js +19 -0
  41. package/dist/packem_chunks/handler36.js +428 -0
  42. package/dist/packem_chunks/handler37.js +22 -0
  43. package/dist/packem_chunks/handler38.js +22 -0
  44. package/dist/packem_chunks/handler39.js +22 -0
  45. package/dist/packem_chunks/handler4.js +4 -0
  46. package/dist/packem_chunks/handler40.js +3 -0
  47. package/dist/packem_chunks/handler41.js +10 -0
  48. package/dist/packem_chunks/handler42.js +153 -0
  49. package/dist/packem_chunks/handler43.js +42 -0
  50. package/dist/packem_chunks/handler44.js +3 -0
  51. package/dist/packem_chunks/handler45.js +27 -0
  52. package/dist/packem_chunks/handler5.js +2 -0
  53. package/dist/packem_chunks/handler6.js +13 -0
  54. package/dist/packem_chunks/handler7.js +8 -0
  55. package/dist/packem_chunks/handler8.js +1 -0
  56. package/dist/packem_chunks/handler9.js +1 -0
  57. package/dist/packem_chunks/index.js +7 -0
  58. package/dist/packem_chunks/loader.js +1 -0
  59. package/dist/packem_shared/VisConfigCycleError-CAYNC7d-.js +1 -0
  60. package/dist/packem_shared/VisConfigError-B5LP1zRf.js +1 -0
  61. package/dist/packem_shared/VisConfigLoadError-CeqBSd2Z.js +2 -0
  62. package/dist/packem_shared/VisConfigNotFoundError-DZ9KC527.js +5 -0
  63. package/dist/packem_shared/VisUpdateApp-D-L4_-Iu.js +1 -0
  64. package/dist/packem_shared/_commonjsHelpers-D6W6KoPK.js +1 -0
  65. package/dist/packem_shared/ai-analysis-CGuy7dfE.js +67 -0
  66. package/dist/packem_shared/ai-cache-Bynt6Y9x.js +1 -0
  67. package/dist/packem_shared/cache-directory-D72ZEag2.js +1 -0
  68. package/dist/packem_shared/catalog-BVPerCwG.js +12 -0
  69. package/dist/packem_shared/dependency-scan-Du0tBu64.js +2 -0
  70. package/dist/packem_shared/docker-BcfqH4Av.js +2 -0
  71. package/dist/packem_shared/failure-log-DqYen0LC.js +2 -0
  72. package/dist/packem_shared/flakiness-DSIHZGBT.js +1 -0
  73. package/dist/packem_shared/run-summary-utils-C24Aaf9E.js +1 -0
  74. package/dist/packem_shared/runtime-check-CGHal8SO.js +1 -0
  75. package/dist/packem_shared/selectors-CfH9ZY08.js +3 -0
  76. package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
  77. package/dist/packem_shared/target-merge-DNa-6eWu.js +1 -0
  78. package/dist/packem_shared/toolchain-DQfTQY8E.js +5 -0
  79. package/dist/packem_shared/typosquats-DOR8izpX.js +1 -0
  80. package/dist/packem_shared/use-measured-height-DjYgUOKk.js +1 -0
  81. package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
  82. package/dist/packem_shared/xxh3-DrAUNq4n.js +1 -0
  83. package/index.js +601 -0
  84. package/package.json +124 -7
  85. package/schemas/project.schema.json +422 -0
  86. package/schemas/vis-config.schema.json +377 -0
@@ -0,0 +1,3 @@
1
+ var Ve=Object.defineProperty;var y=(n,e)=>Ve(n,"name",{value:e,configurable:!0});import{createRequire as He}from"node:module";import{Box as c,Text as r,TextInput as he,ScrollBar as Oe,ScrollView as Ye,useApp as Ke,useWindowSize as Qe,useInput as H,Dialog as Ze,Tabs as et,Tab as tt,render as rt}from"@visulima/tui";import{M as ot,c as nt,d as it}from"./bin.js";import ct,{useMemo as q,useSyncExternalStore as st,useState as C,useRef as Z,useEffect as le,useCallback as lt}from"react";import{isAccessibleSync as dt,readFileSync as ut,ensureDirSync as ht}from"@visulima/fs";import{stripJsonComments as mt}from"@visulima/fs/utils";import{join as de,dirname as gt}from"@visulima/path";import{jsxs as i,jsx as t}from"react/jsx-runtime";const Je=He(import.meta.url),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qe=y(n=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[e,s]=V.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return V.getBuiltinModule(n)}return Je(n)},"__cjs_getBuiltinModule"),{writeFileSync:at}=qe("node:fs"),z=[{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode"]}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{}},forwardPorts:[3e3],image:"mcr.microsoft.com/devcontainers/javascript-node:22",name:"Node.js",postCreateCommand:"npm install"},description:"Node.js 22 with Git and GitHub CLI",id:"node",name:"Node.js"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode"]}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{}},forwardPorts:[3e3],image:"mcr.microsoft.com/devcontainers/javascript-node:22",mounts:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-pnpm-store",target:"/home/node/.local/share/pnpm/store",type:"volume"}],name:"Node.js + pnpm Monorepo",postCreateCommand:"corepack enable && pnpm install",remoteUser:"node",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}"},description:"Node.js 22 with pnpm, corepack, and optimized volume mounts",id:"node-pnpm",name:"Node.js + pnpm"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode","ms-azuretools.vscode-docker"]}},dockerComposeFile:"docker-compose.yml",forwardPorts:[3e3,5432],name:"Node.js + PostgreSQL",postCreateCommand:"npm install",service:"app",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}"},description:"Node.js with PostgreSQL via Docker Compose",id:"node-postgres",name:"Node.js + PostgreSQL"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode","ms-azuretools.vscode-docker"]}},features:{"ghcr.io/devcontainers/features/docker-in-docker:2":{},"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{}},forwardPorts:[3e3],image:"mcr.microsoft.com/devcontainers/javascript-node:22",name:"Node.js + Docker",postCreateCommand:"npm install"},description:"Node.js 22 with Docker-in-Docker for container workflows",id:"node-dind",name:"Node.js + Docker-in-Docker"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode","ms-azuretools.vscode-docker"]}},dockerComposeFile:"docker-compose.yml",features:{"ghcr.io/devcontainers/features/docker-in-docker:2":{}},forwardPorts:[3e3,5432,6379],name:"Full Stack",postCreateCommand:"npm install",service:"app",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}"},description:"Node.js + PostgreSQL + Redis + Docker via Compose",id:"fullstack",name:"Full Stack"},{config:{customizations:{vscode:{extensions:["ms-python.python","ms-python.vscode-pylance"],settings:{"editor.formatOnSave":!0,"python.defaultInterpreterPath":"/usr/local/bin/python"}}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{},"ghcr.io/devcontainers/features/python:1":{version:"3.12"}},forwardPorts:[8e3],image:"mcr.microsoft.com/devcontainers/python:3.12",name:"Python",postCreateCommand:"pip install -r requirements.txt || true"},description:"Python 3.12 with pip and venv",id:"python",name:"Python"},{config:{customizations:{vscode:{extensions:["golang.go"],settings:{"editor.formatOnSave":!0,"go.toolsManagement.autoUpdate":!0}}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/go:1":{version:"1.22"}},forwardPorts:[8080],image:"mcr.microsoft.com/devcontainers/go:1.22",name:"Go",postCreateCommand:"go mod download || true"},description:"Go 1.22 development environment",id:"go",name:"Go"},{config:{customizations:{vscode:{extensions:["rust-lang.rust-analyzer","tamasfe.even-better-toml"],settings:{"editor.formatOnSave":!0}}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/rust:1":{}},image:"mcr.microsoft.com/devcontainers/rust:latest",name:"Rust",postCreateCommand:"cargo build || true"},description:"Rust development with cargo and rust-analyzer",id:"rust",name:"Rust"},{config:{customizations:{vscode:{extensions:["vscjava.vscode-java-pack","vscjava.vscode-maven"]}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/java:1":{version:"17"}},forwardPorts:[8080],image:"mcr.microsoft.com/devcontainers/java:17",name:"Java",postCreateCommand:"./mvnw install || ./gradlew build || true"},description:"Java 17 with Maven/Gradle support",id:"java",name:"Java"},{config:{customizations:{vscode:{extensions:["ms-azuretools.vscode-docker","ms-kubernetes-tools.vscode-kubernetes-tools","hashicorp.terraform"]}},features:{"ghcr.io/devcontainers/features/aws-cli:1":{},"ghcr.io/devcontainers/features/azure-cli:1":{},"ghcr.io/devcontainers/features/docker-in-docker:2":{},"ghcr.io/devcontainers/features/kubectl-helm-minikube:1":{},"ghcr.io/devcontainers/features/terraform:1":{}},image:"mcr.microsoft.com/devcontainers/base:ubuntu",name:"DevOps"},description:"Docker, Kubernetes, Terraform, AWS & Azure CLIs",id:"devops",name:"DevOps"},{config:{features:{"ghcr.io/devcontainers/features/common-utils:2":{}},image:"mcr.microsoft.com/devcontainers/base:ubuntu",name:"Minimal",remoteUser:"vscode"},description:"Bare Ubuntu with common utilities",id:"minimal",name:"Minimal"},{config:{image:"mcr.microsoft.com/devcontainers/base:ubuntu",name:"Custom"},description:"Minimal Ubuntu base - configure from scratch",id:"custom",name:"Custom (Blank)"}];var ft=Object.defineProperty,Fe=y((n,e)=>ft(n,"name",{value:e,configurable:!0}),"s$5");const pt=Fe(n=>{const e=de(n,".devcontainer","devcontainer.json");if(!dt(e))return null;const s=ut(e),a=mt(s),l=a!==s;let o;try{o=JSON.parse(a)}catch(d){const g=d instanceof Error?d.message:String(d);throw new Error(`Failed to parse ${e}: ${g}`)}return{config:o,hadComments:l}},"readDevcontainerJson"),vt=Fe((n,e,s)=>{const a=s?gt(s):de(n,".devcontainer"),l=s??de(a,"devcontainer.json");ht(a),at(l,`${JSON.stringify(e,null,2)}
2
+ `,"utf8")},"writeDevcontainerJson");var yt=Object.defineProperty,bt=y((n,e)=>yt(n,"name",{value:e,configurable:!0}),"s$4");const wt={bun:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-bun-cache",target:"/home/node/.bun/install/cache",type:"volume"}],npm:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-npm-cache",target:"/home/node/.npm",type:"volume"}],pnpm:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-pnpm-store",target:"/home/node/.local/share/pnpm/store",type:"volume"}],yarn:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-yarn-cache",target:"/home/node/.yarn/cache",type:"volume"}]},xt=[{featureMatch:"docker-in-docker",mounts:[]},{featureMatch:"docker-outside-of-docker",mounts:[{source:"/var/run/docker.sock",target:"/var/run/docker.sock",type:"bind"}]},{featureMatch:"/features/git:",mounts:[{source:"${localWorkspaceFolderBasename}-git-config",target:"/home/node/.gitconfig",type:"volume"}]}],xe=bt((n,e,s)=>{const a=[],l=new Set(s.map(d=>typeof d=="string"?d:d.target));if(n)for(const d of wt[n])l.has(d.target)||a.push(d);const o=Object.keys(e);for(const{featureMatch:d,mounts:g}of xt)if(o.some(f=>f.includes(d)))for(const f of g)l.has(f.target)||a.push(f);return a},"getSuggestedMounts"),A=["general","features","ports","lifecycle","extensions","environment","mounts","compose"];var Ct=Object.defineProperty,ee=y((n,e)=>Ct(n,"name",{value:e,configurable:!0}),"c$1");const J=ee(n=>structuredClone(n),"deepClone");class kt{static{y(this,"DevcontainerStore")}static{ee(this,"DevcontainerStore")}#o=new Set;#e;constructor(e,s,a=null){const l=e===null,o=e??{name:""},d=J(o);this.#e={config:d,detectedPm:a,extensionSearch:"",featureSearch:"",fieldEditing:!1,fieldIndex:0,hadComments:s,isDirty:!1,mode:l?"create":"edit",originalConfig:l?null:J(o),section:"general",showTemplateSelector:l,suggestedMounts:xe(a,d.features??{},d.mounts??[]),templateIndex:0}}getSnapshot=ee(()=>this.#e,"getSnapshot");subscribe=ee(e=>(this.#o.add(e),()=>{this.#o.delete(e)}),"subscribe");setSection(e){e!==this.#e.section&&this.#t({...this.#e,fieldEditing:!1,fieldIndex:0,section:e})}nextSection(){const e=(A.indexOf(this.#e.section)+1)%A.length;this.setSection(A[e])}previousSection(){const e=(A.indexOf(this.#e.section)-1+A.length)%A.length;this.setSection(A[e])}setFieldIndex(e){e!==this.#e.fieldIndex&&this.#t({...this.#e,fieldIndex:Math.max(0,e)})}setFieldEditing(e){e!==this.#e.fieldEditing&&this.#t({...this.#e,fieldEditing:e})}setTemplateIndex(e){const s=Math.max(0,Math.min(e,z.length-1));s!==this.#e.templateIndex&&this.#t({...this.#e,templateIndex:s})}applyTemplate(e){const s=z.find(a=>a.id===e);s&&this.#t(this.#r({...this.#e,config:J(s.config),isDirty:!0,showTemplateSelector:!1}))}dismissTemplateSelector(){this.#t({...this.#e,showTemplateSelector:!1})}updateConfig(e){this.#t({...this.#e,config:{...this.#e.config,...e},isDirty:!0})}toggleFeature(e){const s={...this.#e.config.features};s[e]===void 0?s[e]={}:delete s[e],this.#t(this.#r({...this.#e,config:{...this.#e.config,features:s},isDirty:!0}))}setFeatureSearch(e){this.#t({...this.#e,featureSearch:e,fieldIndex:0})}addPort(e){const s=this.#e.config.forwardPorts??[];if(s.includes(e))return;const a=[...s,e];this.#t({...this.#e,config:{...this.#e.config,forwardPorts:a},isDirty:!0})}removePort(e){const s=[...this.#e.config.forwardPorts??[]];s.splice(e,1),this.#t({...this.#e,config:{...this.#e.config,forwardPorts:s.length>0?s:void 0},isDirty:!0})}toggleExtension(e){const s={...this.#e.config.customizations},a={...s.vscode},l=[...a.extensions??[]],o=l.indexOf(e);o===-1?l.push(e):l.splice(o,1),a.extensions=l.length>0?l:void 0,s.vscode=a.extensions||a.settings?a:void 0,this.#t({...this.#e,config:{...this.#e.config,customizations:s.vscode||s.jetbrains?s:void 0},isDirty:!0})}setExtensionSearch(e){this.#t({...this.#e,extensionSearch:e,fieldIndex:0})}addEnvVar(e,s,a){const l=e==="container"?"containerEnv":"remoteEnv",o={...this.#e.config[l],[s]:a};this.#t({...this.#e,config:{...this.#e.config,[l]:o},isDirty:!0})}removeEnvVar(e,s){const a=e==="container"?"containerEnv":"remoteEnv",l={...this.#e.config[a]};delete l[s],this.#t({...this.#e,config:{...this.#e.config,[a]:Object.keys(l).length>0?l:void 0},isDirty:!0})}addMount(e){const s=[...this.#e.config.mounts??[],e];this.#t(this.#r({...this.#e,config:{...this.#e.config,mounts:s},isDirty:!0}))}removeMount(e){const s=[...this.#e.config.mounts??[]];s.splice(e,1),this.#t(this.#r({...this.#e,config:{...this.#e.config,mounts:s.length>0?s:void 0},isDirty:!0}))}applySuggestedMounts(){if(this.#e.suggestedMounts.length===0)return;const e=[...this.#e.config.mounts??[],...this.#e.suggestedMounts];this.#t(this.#r({...this.#e,config:{...this.#e.config,mounts:e},isDirty:!0}))}setLifecycleCommand(e,s){this.#t({...this.#e,config:{...this.#e.config,[e]:s||void 0},isDirty:!0})}markClean(){this.#t({...this.#e,isDirty:!1,originalConfig:J(this.#e.config)})}getJsonPreview(){return JSON.stringify(this.#n(),null,2)}cleanConfig(){return this.#n()}#n(){const e=J(this.#e.config);for(const[s,a]of Object.entries(e))(a===""||a===void 0)&&delete e[s];return e.build&&(e.build.dockerfile===""&&delete e.build.dockerfile,e.build.context===""&&delete e.build.context,e.build.args&&Object.keys(e.build.args).length===0&&delete e.build.args,Object.keys(e.build).length===0&&delete e.build),e.forwardPorts?.length===0&&delete e.forwardPorts,e.mounts?.length===0&&delete e.mounts,e.runServices?.length===0&&delete e.runServices,e.capAdd?.length===0&&delete e.capAdd,e.securityOpt?.length===0&&delete e.securityOpt,e.features&&Object.keys(e.features).length===0&&delete e.features,e.customizations?.vscode?.extensions?.length===0&&delete e.customizations.vscode.extensions,e.customizations?.vscode&&Object.keys(e.customizations.vscode).length===0&&delete e.customizations.vscode,e.customizations&&Object.keys(e.customizations).length===0&&delete e.customizations,e.containerEnv&&Object.keys(e.containerEnv).length===0&&delete e.containerEnv,e.remoteEnv&&Object.keys(e.remoteEnv).length===0&&delete e.remoteEnv,e}#r(e){return{...e,suggestedMounts:xe(e.detectedPm,e.config.features??{},e.config.mounts??[])}}#t(e){this.#e=e;for(const s of this.#o)try{s()}catch{}}}const Ce=[{category:"linting",description:"Integrates ESLint into the editor",id:"dbaeumer.vscode-eslint",name:"ESLint"},{category:"linting",description:"Stylelint CSS/SCSS linting",id:"stylelint.vscode-stylelint",name:"Stylelint"},{category:"formatting",description:"Opinionated code formatter",id:"esbenp.prettier-vscode",name:"Prettier"},{category:"formatting",description:"EditorConfig file support",id:"editorconfig.editorconfig",name:"EditorConfig"},{category:"formatting",description:"Fast Rust-based formatter and linter",id:"biomejs.biome",name:"Biome"},{category:"language",description:"Rich TypeScript and JavaScript support",id:"ms-vscode.vscode-typescript-next",name:"TypeScript Nightly"},{category:"language",description:"Tailwind CSS IntelliSense",id:"bradlc.vscode-tailwindcss",name:"Tailwind CSS"},{category:"language",description:"YAML language support with schemas",id:"redhat.vscode-yaml",name:"YAML"},{category:"language",description:"TOML language support",id:"tamasfe.even-better-toml",name:"TOML"},{category:"language",description:"Dockerfile and Docker Compose support",id:"ms-azuretools.vscode-docker",name:"Docker"},{category:"language",description:"Python language support with Pylance",id:"ms-python.python",name:"Python"},{category:"language",description:"Go language support",id:"golang.go",name:"Go"},{category:"language",description:"Rust language support via rust-analyzer",id:"rust-lang.rust-analyzer",name:"rust-analyzer"},{category:"git",description:"Git supercharged: blame, history, stash, etc.",id:"eamodio.gitlens",name:"GitLens"},{category:"git",description:"GitHub Pull Requests and Issues",id:"github.vscode-pull-request-github",name:"GitHub PR"},{category:"testing",description:"Vitest test explorer integration",id:"vitest.explorer",name:"Vitest Explorer"},{category:"testing",description:"Jest test runner and assertions",id:"orta.vscode-jest",name:"Jest"},{category:"debugging",description:"REST client for testing APIs",id:"humao.rest-client",name:"REST Client"},{category:"debugging",description:"Error Lens: inline error highlighting",id:"usernamehw.errorlens",name:"Error Lens"},{category:"other",description:"Intelligent code completion with AI",id:"github.copilot",name:"GitHub Copilot"},{category:"other",description:"Path autocompletion for imports",id:"christian-kohler.path-intellisense",name:"Path Intellisense"},{category:"other",description:"Import cost display in editor",id:"wix.vscode-import-cost",name:"Import Cost"},{category:"other",description:"Todo Tree: highlight and list TODOs",id:"gruntfuggly.todo-tree",name:"Todo Tree"}],ke=[{category:"language",description:"Node.js runtime via nvm with optional pnpm/yarn",id:"ghcr.io/devcontainers/features/node:1",name:"Node.js"},{category:"language",description:"Python runtime with pip and optional tools",id:"ghcr.io/devcontainers/features/python:1",name:"Python"},{category:"language",description:"Go compiler and tools",id:"ghcr.io/devcontainers/features/go:1",name:"Go"},{category:"language",description:"Rust toolchain via rustup",id:"ghcr.io/devcontainers/features/rust:1",name:"Rust"},{category:"language",description:"Java runtime and JDK via SDKMAN",id:"ghcr.io/devcontainers/features/java:1",name:"Java"},{category:"language",description:".NET SDK and runtime",id:"ghcr.io/devcontainers/features/dotnet:2",name:".NET"},{category:"tool",description:"Common utilities: zsh, Oh My Zsh, git, curl, etc.",id:"ghcr.io/devcontainers/features/common-utils:2",name:"Common Utilities"},{category:"tool",description:"Git version control",id:"ghcr.io/devcontainers/features/git:1",name:"Git"},{category:"tool",description:"Git Large File Storage support",id:"ghcr.io/devcontainers/features/git-lfs:1",name:"Git LFS"},{category:"tool",description:"GitHub CLI for repository management",id:"ghcr.io/devcontainers/features/github-cli:1",name:"GitHub CLI"},{category:"tool",description:"Run Docker containers inside the dev container",id:"ghcr.io/devcontainers/features/docker-in-docker:2",name:"Docker-in-Docker"},{category:"tool",description:"Access host Docker daemon from inside the container",id:"ghcr.io/devcontainers/features/docker-outside-of-docker:1",name:"Docker-from-Docker"},{category:"tool",description:"kubectl, Helm, and Minikube for Kubernetes",id:"ghcr.io/devcontainers/features/kubectl-helm-minikube:1",name:"Kubernetes Tools"},{category:"tool",description:"Infrastructure as code with Terraform",id:"ghcr.io/devcontainers/features/terraform:1",name:"Terraform"},{category:"tool",description:"Nix package manager",id:"ghcr.io/devcontainers/features/nix:1",name:"Nix"},{category:"tool",description:"SSH server for remote connections to the container",id:"ghcr.io/devcontainers/features/sshd:1",name:"SSH Server"},{category:"cloud",description:"Amazon Web Services CLI v2",id:"ghcr.io/devcontainers/features/aws-cli:1",name:"AWS CLI"},{category:"cloud",description:"Microsoft Azure CLI",id:"ghcr.io/devcontainers/features/azure-cli:1",name:"Azure CLI"},{category:"cloud",description:"Google Cloud Platform CLI",id:"ghcr.io/devcontainers/features/gcloud:1",name:"Google Cloud CLI"},{category:"database",description:"PostgreSQL client tools",id:"ghcr.io/devcontainers-extra/features/postgres-client:1",name:"PostgreSQL Client"},{category:"database",description:"Redis client tools",id:"ghcr.io/devcontainers-extra/features/redis-client:1",name:"Redis Client"}];var St=Object.defineProperty,Ae=y((n,e)=>St(n,"name",{value:e,configurable:!0}),"r$1");const me=Ae(n=>{if(!n)return ke;const e=n.toLowerCase();return ke.filter(s=>s.name.toLowerCase().includes(e)||s.id.toLowerCase().includes(e)||s.description.toLowerCase().includes(e))},"filterFeatures"),ge=Ae(n=>{if(!n)return Ce;const e=n.toLowerCase();return Ce.filter(s=>s.name.toLowerCase().includes(e)||s.id.toLowerCase().includes(e)||s.description.toLowerCase().includes(e))},"filterExtensions");var Et=Object.defineProperty,It=y((n,e)=>Et(n,"name",{value:e,configurable:!0}),"l$1");const Le=["dockerComposeFile","service"],Tt={dockerComposeFile:"Compose File",service:"Service"},Se={dockerComposeFile:"docker-compose.yml",service:"app"},Dt={dockerComposeFile:"Path to Docker Compose file (relative to .devcontainer/)",service:"Which service in the compose file to connect the IDE to"},Pt=It(({config:n,fieldEditing:e,fieldIndex:s,onUpdate:a})=>{const l=!!n.dockerComposeFile,o=!!(n.image||n.build);return i(c,{flexDirection:"column",paddingX:1,children:[t(c,{marginBottom:1,children:t(r,{bold:!0,color:"cyan",children:"Docker Compose Integration"})}),o&&l&&t(c,{marginBottom:1,children:t(r,{color:"yellow",children:"Note: When using Docker Compose, the image/build settings in General are ignored."})}),Le.map((d,g)=>{const f=g===s,p=n[d]??"",x=Array.isArray(n[d])?n[d].join(", "):p;return i(c,{flexDirection:"column",marginBottom:1,children:[i(c,{children:[t(c,{width:20,children:i(r,{bold:f,color:f?"cyan":"white",children:[f?"❯ ":" ",Tt[d],":"]})}),t(c,{flexGrow:1,children:f&&e?t(he,{defaultValue:x,onChange:y(v=>{a({[d]:v||void 0})},"onChange"),placeholder:Se[d]}):t(r,{color:x?"white":"gray",children:x||Se[d]})})]}),t(c,{paddingLeft:4,children:t(r,{dimColor:!0,children:Dt[d]})})]},d)}),t(c,{marginTop:1,children:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"Enter"})," ","edit field"," ",t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",t(r,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]})},"DockerComposeSection"),jt=Le.length;var Ot=Object.defineProperty,Me=y((n,e)=>Ot(n,"name",{value:e,configurable:!0}),"h$3");const Ft=Me(({config:n,fieldIndex:e})=>{const s=n.containerEnv??{},a=n.remoteEnv??{},l=Object.keys(s),o=Object.keys(a),d=l.length,g=l.length+1,f=g+o.length,p=e<=d,x=e>d;return i(c,{flexDirection:"column",paddingX:1,children:[i(c,{borderColor:p?"cyan":"gray",borderStyle:"single",flexDirection:"column",paddingX:1,paddingY:0,children:[i(c,{flexShrink:0,marginBottom:l.length>0?1:0,children:[t(r,{bold:!0,color:p?"cyan":"white",children:"containerEnv"}),t(r,{dimColor:!0,children:" — baked into the container image"})]}),l.map((v,w)=>{const k=w===e;return t(c,{flexShrink:0,children:i(r,{color:k?"cyan":void 0,inverse:k,wrap:"truncate",children:[k?" ❯ ":" ",t(r,{bold:!0,children:v}),t(r,{dimColor:!0,children:" = "}),t(r,{children:s[v]})]})},v)}),t(c,{flexShrink:0,marginTop:l.length>0?1:0,children:i(r,{color:e===d?"cyan":"gray",inverse:e===d,children:[" ","+ Add variable..."]})})]}),i(c,{borderColor:x?"cyan":"gray",borderStyle:"single",flexDirection:"column",marginTop:1,paddingX:1,paddingY:0,children:[i(c,{flexShrink:0,marginBottom:o.length>0?1:0,children:[t(r,{bold:!0,color:x?"cyan":"white",children:"remoteEnv"}),t(r,{dimColor:!0,children:" — set at runtime by the IDE"})]}),o.map((v,w)=>{const k=g+w===e;return t(c,{flexShrink:0,children:i(r,{color:k?"cyan":void 0,inverse:k,wrap:"truncate",children:[k?" ❯ ":" ",t(r,{bold:!0,children:v}),t(r,{dimColor:!0,children:" = "}),t(r,{children:a[v]})]})},v)}),t(c,{flexShrink:0,marginTop:o.length>0?1:0,children:i(r,{color:e===f?"cyan":"gray",inverse:e===f,children:[" ","+ Add variable..."]})})]}),t(c,{flexShrink:0,marginTop:1,children:i(r,{dimColor:!0,wrap:"truncate",children:[t(r,{bold:!0,color:"white",children:"a"}),"/",t(r,{bold:!0,color:"white",children:"Enter"})," ","add on + row"," ",t(r,{bold:!0,color:"white",children:"d"})," ","remove"," ",t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"]})})]})},"EnvironmentSection"),At=Me(n=>{const e=Object.keys(n.containerEnv??{}).length,s=Object.keys(n.remoteEnv??{}).length;return e+1+s+1},"getEnvFieldCount");var Lt=Object.defineProperty,Mt=y((n,e)=>Lt(n,"name",{value:e,configurable:!0}),"h$2");const Bt=Mt(({config:n,fieldIndex:e,scrollOffset:s,searchText:a,viewportHeight:l})=>{const o=q(()=>new Set(n.customizations?.vscode?.extensions),[n.customizations?.vscode?.extensions]),d=q(()=>ge(a),[a]),g=d.length,f=g>l&&l>0;return i(c,{flexDirection:"column",flexGrow:1,children:[i(c,{flexShrink:0,gap:1,paddingX:1,children:[i(r,{bold:!0,color:"cyan",children:[o.size," ","selected"]}),a&&i(r,{dimColor:!0,children:["— filter:"," ",t(r,{color:"yellow",children:a})," ","(",d.length," ","results)"]})]}),i(c,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[t(c,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:t(c,{flexDirection:"column",marginTop:-s,children:d.map((p,x)=>{const v=x===e,w=o.has(p.id);return i(c,{flexShrink:0,height:1,children:[t(r,{children:v?">":" "}),i(r,{color:w?"white":"gray",children:[" ",w?"☑":"☐"," "]}),t(c,{flexGrow:1,children:i(r,{bold:v,inverse:v,wrap:"truncate",children:[p.name,i(r,{dimColor:!0,children:[" ","-",p.id]})]})})]},p.id)})})}),f&&t(c,{flexShrink:0,marginLeft:1,marginRight:1,children:t(Oe,{contentHeight:g,placement:"inset",scrollOffset:s,style:"block",viewportHeight:l})})]}),d.length===0&&t(c,{paddingX:1,children:t(r,{dimColor:!0,children:"No extensions match the search."})})]})},"ExtensionsSection");var Nt=Object.defineProperty,zt=y((n,e)=>Nt(n,"name",{value:e,configurable:!0}),"p$1");const Gt=zt(({config:n,fieldIndex:e,scrollOffset:s,searchText:a,viewportHeight:l})=>{const o=q(()=>new Set(Object.keys(n.features??{})),[n.features]),d=q(()=>me(a),[a]),g=d.length,f=g>l&&l>0;return i(c,{flexDirection:"column",flexGrow:1,children:[i(c,{flexShrink:0,gap:1,paddingX:1,children:[i(r,{bold:!0,color:"cyan",children:[o.size," ","selected"]}),a&&i(r,{dimColor:!0,children:["— filter:"," ",t(r,{color:"yellow",children:a})," ","(",d.length," ","results)"]})]}),i(c,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[t(c,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:t(c,{flexDirection:"column",marginTop:-s,children:d.map((p,x)=>{const v=x===e,w=o.has(p.id);return i(c,{flexShrink:0,height:1,children:[t(r,{children:v?">":" "}),i(r,{color:w?"white":"gray",children:[" ",w?"☑":"☐"," "]}),t(c,{flexGrow:1,children:i(r,{bold:v,inverse:v,wrap:"truncate",children:[p.name,i(r,{dimColor:!0,children:[" ","-",p.description]})]})})]},p.id)})})}),f&&t(c,{flexShrink:0,marginLeft:1,marginRight:1,children:t(Oe,{contentHeight:g,placement:"inset",scrollOffset:s,style:"block",viewportHeight:l})})]}),d.length===0&&t(c,{paddingX:1,children:t(r,{dimColor:!0,children:"No features match the search."})})]})},"FeaturesSection");var Rt=Object.defineProperty,_t=y((n,e)=>Rt(n,"name",{value:e,configurable:!0}),"u$1");const ue=["name","image","workspaceFolder","workspaceMount","remoteUser","containerUser","shutdownAction"],$t={containerUser:"Container User",image:"Image",name:"Name",remoteUser:"Remote User",shutdownAction:"Shutdown Action",workspaceFolder:"Workspace Folder",workspaceMount:"Workspace Mount"},Ee={containerUser:"root",image:"mcr.microsoft.com/devcontainers/javascript-node:22",name:"My Dev Container",remoteUser:"node",shutdownAction:"none | stopContainer",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}",workspaceMount:"source=${localWorkspaceFolder},target=...,type=bind"},te=["privileged","overrideCommand"],Ut={overrideCommand:"Override Command",privileged:"Privileged"},Wt=ue.length+te.length,Xt=_t(({config:n,fieldEditing:e,fieldIndex:s,onUpdate:a})=>i(c,{flexDirection:"column",paddingX:1,children:[t(c,{marginBottom:1,children:t(r,{bold:!0,color:"cyan",children:"General Configuration"})}),ue.map((l,o)=>{const d=o===s,g=n[l]??"";return i(c,{marginBottom:1,children:[t(c,{width:20,children:i(r,{bold:d,color:d?"cyan":"white",children:[d?"❯ ":" ",$t[l],":"]})}),t(c,{flexGrow:1,children:d&&e?t(he,{defaultValue:g,onChange:y(f=>{a({[l]:f})},"onChange"),placeholder:Ee[l]}):t(r,{color:g?"white":"gray",children:g||Ee[l]})})]},l)}),te.map((l,o)=>{const d=ue.length+o===s,g=n[l]??!1;return i(c,{marginBottom:o<te.length-1?1:0,children:[t(c,{width:20,children:i(r,{bold:d,color:d?"cyan":"white",children:[d?"❯ ":" ",Ut[l],":"]})}),t(c,{flexGrow:1,children:i(r,{color:g?"green":"gray",children:[g?"yes":"no",d&&t(r,{dimColor:!0,children:" (Space to toggle)"})]})})]},l)}),t(c,{marginTop:1,children:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"Enter"})," ","edit field"," ",t(r,{bold:!0,color:"white",children:"Space"})," ","toggle"," ",t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",t(r,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]}),"GeneralSection"),Be=Wt,ae=te;var Vt=Object.defineProperty,Ht=y((n,e)=>Vt(n,"name",{value:e,configurable:!0}),"s$2");const Ne=["postCreateCommand","postStartCommand","postAttachCommand","onCreateCommand"],Jt={onCreateCommand:"On Create",postAttachCommand:"Post Attach",postCreateCommand:"Post Create",postStartCommand:"Post Start"},qt={onCreateCommand:"Runs once when the container is first created",postAttachCommand:"Runs each time the IDE attaches",postCreateCommand:"Runs after the container is created and workspace mounted",postStartCommand:"Runs each time the container starts"},Yt=Ht(({config:n,fieldEditing:e,fieldIndex:s,onSetCommand:a})=>i(c,{flexDirection:"column",paddingX:1,children:[t(c,{marginBottom:1,children:t(r,{bold:!0,color:"cyan",children:"Lifecycle Commands"})}),Ne.map((l,o)=>{const d=o===s,g=n[l],f=Array.isArray(g)?g.join(" && "):g??"";return i(c,{flexDirection:"column",marginBottom:1,children:[t(c,{children:i(r,{bold:d,color:d?"cyan":"white",children:[d?"❯ ":" ",Jt[l]]})}),t(c,{paddingLeft:4,children:t(r,{dimColor:!0,children:qt[l]})}),t(c,{paddingLeft:4,children:d&&e?t(he,{defaultValue:f,onChange:y(p=>{a(l,p)},"onChange"),placeholder:"e.g. npm install"}):t(r,{color:f?"green":"gray",children:f||"(not set)"})})]},l)}),t(c,{marginTop:1,children:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"Enter"})," ","edit command"," ",t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",t(r,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]}),"LifecycleSection"),Kt=Ne.length;var Qt=Object.defineProperty,ze=y((n,e)=>Qt(n,"name",{value:e,configurable:!0}),"s$1");const Ie=ze(n=>typeof n=="string"?n:`[${n.type}] ${n.source} → ${n.target}`,"formatMount"),Zt=ze(({addingMount:n,config:e,detectedPm:s,fieldIndex:a,mountPhase:l,mountSource:o,mountTarget:d,mountType:g,suggestedMounts:f})=>{const p=e.mounts??[];return i(c,{flexDirection:"column",paddingX:1,children:[i(c,{flexShrink:0,gap:1,paddingX:1,children:[i(r,{bold:!0,color:"cyan",children:[p.length," ","mounts"]}),s&&i(r,{dimColor:!0,children:["— detected:"," ",t(r,{color:"white",children:s})]})]}),f.length>0&&!n&&i(c,{borderColor:"yellow",borderStyle:"single",flexDirection:"column",marginBottom:1,marginTop:1,paddingX:1,children:[i(c,{flexShrink:0,children:[t(r,{bold:!0,color:"yellow",children:"Suggested mounts"}),i(r,{dimColor:!0,children:[" ","— press"," ",t(r,{bold:!0,color:"white",children:"A"})," ","to add all"]})]}),f.map((x,v)=>t(c,{flexShrink:0,children:i(r,{dimColor:!0,wrap:"truncate",children:[" + ",Ie(x)]})},`suggestion-${String(v)}`))]}),p.length>0&&t(c,{flexDirection:"column",marginBottom:1,children:p.map((x,v)=>{const w=v===a;return i(c,{flexShrink:0,height:1,children:[t(r,{children:w?">":" "}),t(c,{flexGrow:1,children:i(r,{bold:w,inverse:w,wrap:"truncate",children:[" ",Ie(x)]})})]},`mount-${String(v)}`)})}),!n&&t(c,{flexShrink:0,children:i(r,{color:a===p.length?"cyan":"gray",inverse:a===p.length,children:[" ","+ Add mount..."]})}),n&&i(c,{borderColor:"cyan",borderStyle:"single",flexDirection:"column",marginTop:1,paddingX:1,children:[t(c,{flexShrink:0,marginBottom:1,children:t(r,{bold:!0,color:"cyan",children:"New Mount"})}),i(c,{flexShrink:0,children:[t(c,{width:12,children:i(r,{bold:l==="source",color:l==="source"?"cyan":"white",children:[l==="source"?"❯ ":" ","Source:"]})}),t(r,{color:o?"yellow":"gray",children:o||(l==="source"?"_":"(type source, Enter to continue)")})]}),i(c,{flexShrink:0,children:[t(c,{width:12,children:i(r,{bold:l==="target",color:l==="target"?"cyan":"white",children:[l==="target"?"❯ ":" ","Target:"]})}),t(r,{color:d?"yellow":"gray",children:d||(l==="target"?"_":"/container/path")})]}),i(c,{flexShrink:0,children:[t(c,{width:12,children:i(r,{bold:l==="type",color:l==="type"?"cyan":"white",children:[l==="type"?"❯ ":" ","Type:"]})}),l==="type"?i(r,{children:[t(r,{bold:g==="volume",color:g==="volume"?"cyan":"gray",children:"[1] volume"})," ",t(r,{bold:g==="bind",color:g==="bind"?"cyan":"gray",children:"[2] bind"})," ",t(r,{bold:g==="tmpfs",color:g==="tmpfs"?"cyan":"gray",children:"[3] tmpfs"})]}):t(r,{color:"gray",children:g})]}),t(c,{flexShrink:0,marginTop:1,children:t(r,{dimColor:!0,wrap:"truncate",children:l==="type"?"1/2/3 select type, Enter confirm, Esc cancel":"Type text, Enter next step, Esc cancel"})})]}),p.length===0&&!n&&f.length===0&&t(c,{marginTop:1,children:t(r,{dimColor:!0,children:"Tip: Use volume mounts for node_modules and caches to improve performance."})})]})},"MountsSection");var er=Object.defineProperty,tr=y((n,e)=>er(n,"name",{value:e,configurable:!0}),"m$1");const rr=tr(({addingPort:n,addPortValue:e,config:s,fieldIndex:a})=>{const l=s.forwardPorts??[],o=a===l.length;return i(c,{flexDirection:"column",paddingX:1,children:[i(c,{marginBottom:1,children:[t(r,{bold:!0,color:"cyan",children:"Forwarded Ports"}),i(r,{dimColor:!0,children:[" ","(",l.length," ","ports)"]})]}),l.map((d,g)=>{const f=g===a;return t(c,{children:i(r,{color:f?"cyan":void 0,inverse:f,children:[" ",String(d)]})},`port-${String(d)}`)}),t(c,{marginTop:l.length>0?1:0,children:i(r,{color:o?"cyan":"gray",inverse:o,children:[" ",o&&n?i(r,{children:["Enter port:"," ",t(r,{color:"yellow",children:e||"_"})]}):"+ Add port..."]})}),t(c,{marginTop:1,children:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"Enter"})," ",o?"type port number, Enter to confirm":"select"," ",t(r,{bold:!0,color:"white",children:"d"})," ","remove selected"," ",t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"]})})]})},"PortsSection");var or=Object.defineProperty,nr=y((n,e)=>or(n,"name",{value:e,configurable:!0}),"a");const ir=nr(({focused:n,hadComments:e,jsonPreview:s,mode:a,scrollRef:l})=>i(c,{borderColor:n?"cyan":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,children:[i(c,{flexShrink:0,paddingX:1,children:[t(r,{bold:!0,color:n?"cyan":"white",children:"Preview"}),i(r,{dimColor:!0,children:[" ","(",a==="create"?"new":"edit",")"]})]}),e&&a==="edit"&&t(c,{flexShrink:0,paddingX:1,children:t(r,{color:"yellow",children:"Comments will not be preserved."})}),t(Ye,{flexGrow:1,ref:l,scrollbar:!0,scrollbarColor:"gray",children:s.split(`
3
+ `).map((o,d)=>t(r,{color:"green",children:o},`line-${String(d)}`))})]}),"PreviewPanel");var cr=Object.defineProperty,sr=y((n,e)=>cr(n,"name",{value:e,configurable:!0}),"r");const lr=sr(n=>{const e=[],s=[],a=[];if(!n.image&&!n.build&&!n.dockerComposeFile&&e.push({field:"image",message:'One of "image", "build", or "dockerComposeFile" is required'}),n.build&&(n.image&&s.push({field:"image",message:'Both "image" and "build" are set; "build" takes precedence'}),n.build.dockerfile||e.push({field:"build.dockerfile",message:'"build" requires a "dockerfile" path'})),n.dockerComposeFile&&!n.service&&e.push({field:"service",message:'"service" is required when using "dockerComposeFile"'}),n.features!==void 0&&(typeof n.features!="object"||Array.isArray(n.features))&&e.push({field:"features",message:'"features" must be an object mapping feature IDs to options'}),n.forwardPorts)if(Array.isArray(n.forwardPorts))for(const[l,o]of n.forwardPorts.entries())typeof o=="number"&&(o<1||o>65535)&&e.push({field:"forwardPorts",message:`Invalid port ${String(o)} at index ${String(l)}`});else e.push({field:"forwardPorts",message:'"forwardPorts" must be an array'});return n.customizations?.vscode?.extensions&&!Array.isArray(n.customizations.vscode.extensions)&&e.push({field:"customizations.vscode.extensions",message:"Extensions must be an array"}),n.customizations?.vscode?.settings&&typeof n.customizations.vscode.settings!="object"&&e.push({field:"customizations.vscode.settings",message:"Settings must be an object"}),n.name||a.push({field:"name",message:"Consider adding a name for better identification"}),(!n.features||Object.keys(n.features).length===0)&&a.push({field:"features",message:"Consider adding features for common tools"}),(!n.customizations?.vscode?.extensions||n.customizations.vscode.extensions.length===0)&&a.push({field:"extensions",message:"Consider adding VS Code extensions for your stack"}),n.privileged&&s.push({field:"privileged",message:"Running in privileged mode is a security risk"}),{errors:e,suggestions:a,valid:e.length===0,warnings:s}},"validateConfig");var ar=Object.defineProperty,Ge=y((n,e)=>ar(n,"name",{value:e,configurable:!0}),"$");const Te=80,De=15,dr=120,Pe=[{description:"Container name, base image, workspace folder, and user",id:"general",label:"General"},{description:"Installable tools and runtimes (Node, Python, Docker, etc.)",id:"features",label:"Features"},{description:"Ports to forward from the container to your host",id:"ports",label:"Ports"},{description:"Commands to run at different stages of the container lifecycle",id:"lifecycle",label:"Lifecycle"},{description:"VS Code extensions to auto-install in the container",id:"extensions",label:"Extensions"},{description:"Environment variables for the container and IDE",id:"environment",label:"Env"},{description:"Volume and bind mounts for persistent data and caches",id:"mounts",label:"Mounts"},{description:"Docker Compose integration for multi-container setups",id:"compose",label:"Compose"}],ur=Ge((n,e,s,a)=>{switch(n){case"compose":return jt;case"environment":return At(e);case"extensions":return ge(a).length;case"features":return me(s).length;case"general":return Be;case"lifecycle":return Kt;case"mounts":return(e.mounts?.length??0)+1;case"ports":return(e.forwardPorts?.length??0)+1;default:return 0}},"getFieldCount"),hr=Ge(({onSave:n,store:e})=>{const{exit:s}=Ke(),{columns:a,rows:l}=Qe(),o=st(e.subscribe,e.getSnapshot),[d,g]=C(!1),[f,p]=C(!1),[x,v]=C(!1),[w,k]=C(null),[S,P]=C("editor"),[Y,fe]=C(0),[re,oe]=C(!1),[pe,G]=C(""),[R,_]=C(null),[$,j]=C(""),[ve,O]=C(""),[U,L]=C("key"),[ne,K]=C(!1),[ie,M]=C(""),[ce,B]=C(""),[ye,W]=C("volume"),[I,N]=C("source"),se=Z(null),F=Z(null),D=Z(null),Q=Z(!0);le(()=>(Q.current=!0,()=>{Q.current=!1,D.current&&clearTimeout(D.current)}),[]);const be=ur(o.section,o.config,o.featureSearch,o.extensionSearch),X=Math.max(1,l-9);le(()=>{o.section!=="features"&&o.section!=="extensions"||fe(h=>o.fieldIndex>=h+X?o.fieldIndex-X+1:o.fieldIndex<h?o.fieldIndex:h)},[o.fieldIndex,o.section,X]),le(()=>{fe(0)},[o.section,o.featureSearch,o.extensionSearch]);const Re=lt(()=>{const h=e.cleanConfig(),m=lr(h);if(!m.valid){const b=m.errors[0];k(b?`Error: ${b.message}`:"Validation failed"),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{Q.current&&k(null)},3e3);return}n(h),e.markClean();const u=m.warnings.length;k(u>0?`Saved! (${String(u)} warning${u>1?"s":""})`:"Saved!"),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{Q.current&&k(null)},2e3)},[n,e]);H((h,m)=>{if(m.downArrow||h==="j")e.setTemplateIndex(o.templateIndex+1);else if(m.upArrow||h==="k")e.setTemplateIndex(o.templateIndex-1);else if(m.return){const u=z[o.templateIndex];u&&e.applyTemplate(u.id)}else m.escape&&e.dismissTemplateSelector()},{isActive:o.showTemplateSelector}),H((h,m)=>{if(m.escape){oe(!1),G("");return}if(m.return){const u=Number.parseInt(pe,10);!Number.isNaN(u)&&u>0&&u<=65535&&e.addPort(u),oe(!1),G("");return}if(m.backspace){G(u=>u.slice(0,-1));return}h&&/^\d$/u.test(h)&&G(u=>u+h)},{isActive:re}),H((h,m)=>{if(m.escape){_(null),j(""),O(""),L("key");return}if(m.return){if(U==="key"&&$){L("value");return}if(U==="value"&&$){e.addEnvVar(R,$,ve),_(null),j(""),O(""),L("key");return}}if(m.backspace){U==="key"?j(u=>u.slice(0,-1)):O(u=>u.slice(0,-1));return}h&&!m.ctrl&&!m.meta&&(U==="key"?j(u=>u+h):O(u=>u+h))},{isActive:R!==null}),H((h,m)=>{if(m.escape){K(!1),M(""),B(""),N("source");return}if(m.return){if(I==="source"&&ie){N("target");return}if(I==="target"&&ce){N("type");return}if(I==="type"){e.addMount({source:ie,target:ce,type:ye}),K(!1),M(""),B(""),N("source");return}}if(I==="type"){switch(h){case"1":{W("volume");break}case"2":{W("bind");break}case"3":{W("tmpfs");break}}return}if(m.backspace){I==="source"?M(u=>u.slice(0,-1)):I==="target"&&B(u=>u.slice(0,-1));return}h&&!m.ctrl&&!m.meta&&(I==="source"?M(u=>u+h):I==="target"&&B(u=>u+h))},{isActive:ne}),H((h,m)=>{if(h==="c"&&m.ctrl){s();return}if(!f){if(d){m.escape||h==="?"?g(!1):m.downArrow||h==="j"?se.current?.scrollBy(1):m.upArrow||h==="k"?se.current?.scrollBy(-1):h==="q"&&(g(!1),p(!0));return}if(x){if(m.escape){v(!1),o.section==="features"?e.setFeatureSearch(""):e.setExtensionSearch("");return}if(m.return){v(!1);return}if(m.backspace){o.section==="features"?e.setFeatureSearch(o.featureSearch.slice(0,-1)):e.setExtensionSearch(o.extensionSearch.slice(0,-1));return}if(h&&!m.ctrl&&!m.meta){o.section==="features"?e.setFeatureSearch(o.featureSearch+h):e.setExtensionSearch(o.extensionSearch+h);return}return}if(o.fieldEditing){if(m.escape){e.setFieldEditing(!1);return}if(m.return){e.setFieldEditing(!1);return}return}if(h==="?"){g(!0);return}if(h==="q"){o.isDirty?p(!0):s();return}if(h==="s"){Re();return}if(m.tab){P(u=>u==="editor"?"preview":"editor");return}if(S==="preview"){if(m.downArrow||h==="j"){F.current?.scrollBy(1);return}if(m.upArrow||h==="k"){F.current?.scrollBy(-1);return}if(m.pageDown){F.current?.scrollBy(10);return}if(m.pageUp){F.current?.scrollBy(-10);return}if(m.home){F.current?.scrollToTop();return}if(m.end){F.current?.scrollToBottom();return}m.escape&&P("editor");return}if(m.downArrow||h==="j"){be>0&&e.setFieldIndex(Math.min(o.fieldIndex+1,be-1));return}if(m.upArrow||h==="k"){e.setFieldIndex(Math.max(o.fieldIndex-1,0));return}if(m.return){switch(o.section){case"compose":case"general":case"lifecycle":{e.setFieldEditing(!0);break}case"environment":{const u=Object.keys(o.config.containerEnv??{}).length,b=u,T=u+1+Object.keys(o.config.remoteEnv??{}).length;o.fieldIndex===b?(_("container"),j(""),O(""),L("key")):o.fieldIndex===T&&(_("remote"),j(""),O(""),L("key"));break}case"mounts":{const u=o.config.mounts??[];o.fieldIndex===u.length&&(K(!0),M(""),B(""),W("volume"),N("source"));break}case"ports":{const u=o.config.forwardPorts??[];o.fieldIndex===u.length&&(oe(!0),G(""));break}}return}if(h===" "){switch(o.section){case"extensions":{const u=ge(o.extensionSearch)[o.fieldIndex];u&&e.toggleExtension(u.id);break}case"features":{const u=me(o.featureSearch)[o.fieldIndex];u&&e.toggleFeature(u.id);break}case"general":{const u=Be-ae.length,b=o.fieldIndex-u;if(b>=0&&b<ae.length){const T=ae[b];e.updateConfig({[T]:!o.config[T]})}break}}return}if(h==="/"){(o.section==="features"||o.section==="extensions")&&v(!0);return}if(h==="A"&&o.section==="mounts"){e.applySuggestedMounts();return}if(h==="a"){if(o.section==="environment"){const u=Object.keys(o.config.containerEnv??{}).length,b=o.fieldIndex<=u?"container":"remote";_(b),j(""),O(""),L("key")}else o.section==="mounts"&&(K(!0),M(""),B(""),W("volume"),N("source"));return}if(h==="d")switch(o.section){case"environment":{const u=Object.keys(o.config.containerEnv??{}),b=Object.keys(o.config.remoteEnv??{});if(o.fieldIndex<u.length)e.removeEnvVar("container",u[o.fieldIndex]),u.length===1||o.fieldIndex>=u.length-1&&e.setFieldIndex(u.length-2);else{const T=o.fieldIndex-u.length-1;T>=0&&T<b.length&&(e.removeEnvVar("remote",b[T]),b.length===1||T>=b.length-1&&e.setFieldIndex(o.fieldIndex-1))}break}case"mounts":{const u=o.config.mounts??[];if(o.fieldIndex<u.length){e.removeMount(o.fieldIndex);const b=u.length-1;o.fieldIndex>=b&&b>0&&e.setFieldIndex(b-1)}break}case"ports":{const u=o.config.forwardPorts??[];if(o.fieldIndex<u.length){e.removePort(o.fieldIndex);const b=u.length-1;o.fieldIndex>=b&&b>0&&e.setFieldIndex(b-1)}break}}}},{isActive:!o.showTemplateSelector&&!re&&R===null&&!ne});const _e=q(()=>e.getJsonPreview(),[o.config]);if(a<Te||l<De)return t(c,{alignItems:"center",height:l,justifyContent:"center",width:a,children:i(r,{color:"yellow",children:["Terminal too small (",a,"x",l,"), need"," ",Te,"x",De]})});if(o.showTemplateSelector)return t(c,{alignItems:"center",flexDirection:"column",height:l,justifyContent:"center",width:a,children:i(c,{borderColor:"cyan",borderStyle:"round",flexDirection:"column",paddingX:2,paddingY:1,width:60,children:[t(c,{justifyContent:"center",marginBottom:1,children:t(r,{bold:!0,color:"cyan",children:"Select a Template"})}),z.map((h,m)=>{const u=m===o.templateIndex;return t(c,{children:i(r,{color:u?"cyan":void 0,inverse:u,children:[u?" ❯ ":" ",t(r,{bold:u,children:h.name}),i(r,{dimColor:!0,children:[" ","-",h.description]})]})},h.id)}),t(c,{justifyContent:"center",marginTop:1,children:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",t(r,{bold:!0,color:"white",children:"Enter"})," ","select"," ",t(r,{bold:!0,color:"white",children:"Esc"})," ","blank"]})})]})});let E;switch(o.section){case"compose":{E=t(Pt,{config:o.config,fieldEditing:o.fieldEditing,fieldIndex:o.fieldIndex,onUpdate:y(h=>{e.updateConfig(h)},"onUpdate")});break}case"environment":{E=i(c,{flexDirection:"column",children:[t(Ft,{config:o.config,fieldIndex:o.fieldIndex}),R!==null&&t(c,{marginTop:1,paddingX:1,children:i(r,{color:"cyan",children:["Add"," ",R," ","env:"," ",U==="key"?i(r,{children:["key=",t(r,{color:"yellow",children:$||"_"})," ","(Enter to set value)"]}):i(r,{children:[$,"=",t(r,{color:"yellow",children:ve||"_"})," ","(Enter to confirm, Esc to cancel)"]})]})})]});break}case"extensions":{E=t(Bt,{config:o.config,fieldIndex:o.fieldIndex,scrollOffset:Y,searchText:o.extensionSearch,viewportHeight:X});break}case"features":{E=t(Gt,{config:o.config,fieldIndex:o.fieldIndex,scrollOffset:Y,searchText:o.featureSearch,viewportHeight:X});break}case"general":{E=t(Xt,{config:o.config,fieldEditing:o.fieldEditing,fieldIndex:o.fieldIndex,onUpdate:y(h=>{e.updateConfig(h)},"onUpdate")});break}case"lifecycle":{E=t(Yt,{config:o.config,fieldEditing:o.fieldEditing,fieldIndex:o.fieldIndex,onSetCommand:y((h,m)=>{e.setLifecycleCommand(h,m)},"onSetCommand")});break}case"mounts":{E=t(Zt,{addingMount:ne,config:o.config,detectedPm:o.detectedPm,fieldIndex:o.fieldIndex,mountPhase:I,mountSource:ie,mountTarget:ce,mountType:ye,suggestedMounts:o.suggestedMounts});break}case"ports":{E=t(rr,{addingPort:re,addPortValue:pe,config:o.config,fieldIndex:o.fieldIndex});break}default:E=t(r,{children:"Unknown section"})}const $e=i(c,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:[i(c,{flexGrow:1,flexWrap:"wrap",gap:2,paddingX:1,children:[i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"q"}),t(r,{dimColor:!0,children:"QUIT"})]}),i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"?"}),t(r,{dimColor:!0,children:"HELP"})]}),i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"↑↓"}),t(r,{dimColor:!0,children:"NAV"})]}),(o.section==="features"||o.section==="extensions")&&i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"Space"}),t(r,{dimColor:!0,children:"CHECK"})]}),i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"←→"}),t(r,{dimColor:!0,children:"TABS"})]}),i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"Tab"}),t(r,{dimColor:!0,children:"PANEL"})]}),(o.section==="features"||o.section==="extensions")&&i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"/"}),t(r,{dimColor:!0,children:"FILTER"})]}),i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"s"}),t(r,{dimColor:!0,children:"SAVE"})]})]}),i(c,{paddingX:1,children:[w&&i(r,{color:w.startsWith("Error")?"red":"green",children:[w," "]}),o.isDirty&&t(r,{color:"yellow",children:"[modified]"}),!o.isDirty&&!w&&t(r,{dimColor:!0,children:"[saved]"})]})]}),Ue=i(Ze,{footer:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",t(r,{bold:!0,color:"white",children:"?"}),"/",t(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:se,title:"KEYBOARD SHORTCUTS",visible:d,width:56,children:[i(c,{flexDirection:"column",marginBottom:1,children:[i(c,{marginBottom:1,children:[t(r,{dimColor:!0,children:"── "}),t(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"←→"}),t(r,{dimColor:!0,children:" Switch tabs"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"↑↓"}),"/",t(r,{bold:!0,color:"white",children:"j/k"}),t(r,{dimColor:!0,children:" Navigate within section"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"Tab"}),t(r,{dimColor:!0,children:" Switch editor/preview panel"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"Enter"}),t(r,{dimColor:!0,children:" Edit selected field"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"Esc"}),t(r,{dimColor:!0,children:" Stop editing / cancel"})]})]}),i(c,{flexDirection:"column",marginBottom:1,children:[i(c,{marginBottom:1,children:[t(r,{dimColor:!0,children:"── "}),t(r,{bold:!0,color:"white",children:"FEATURES / EXTENSIONS"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"Space"}),t(r,{dimColor:!0,children:" Toggle selection"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"/"}),t(r,{dimColor:!0,children:" Search / filter"})]})]}),i(c,{flexDirection:"column",marginBottom:1,children:[i(c,{marginBottom:1,children:[t(r,{dimColor:!0,children:"── "}),t(r,{bold:!0,color:"white",children:"LISTS (Ports, Mounts, Env)"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"a"}),t(r,{dimColor:!0,children:" Add new entry"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"d"}),t(r,{dimColor:!0,children:" Delete selected entry"})]})]}),i(c,{flexDirection:"column",children:[i(c,{marginBottom:1,children:[t(r,{dimColor:!0,children:"── "}),t(r,{bold:!0,color:"white",children:"ACTIONS"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"s"}),t(r,{dimColor:!0,children:" Save configuration"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"q"}),t(r,{dimColor:!0,children:" Quit"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"?"}),t(r,{dimColor:!0,children:" Toggle help"})]})]})]}),We=t(ir,{focused:S==="preview",hadComments:o.hadComments,jsonPreview:_e,mode:o.mode,scrollRef:F}),we=a>=dr,Xe=we?Math.floor(a*.38):0;return i(c,{flexDirection:"column",height:l,width:a,children:[i(c,{flexShrink:0,gap:1,paddingX:1,children:[t(r,{bold:!0,inverse:!0,children:" VIS "}),i(r,{wrap:"truncate",children:[o.mode==="create"?"Create":"Edit"," ","devcontainer"]})]}),t(c,{flexShrink:0,paddingX:1,paddingY:1,children:t(et,{defaultValue:o.section,keyMap:{useNumbers:!1,useTab:!1},onChange:y(h=>{e.setSection(h),P("editor")},"onChange"),showIndex:!1,children:Pe.map(({id:h,label:m})=>t(tt,{name:h,children:m},h))})}),t(c,{flexShrink:0,paddingRight:2,children:t(r,{dimColor:!0,wrap:"truncate",children:Pe.find(h=>h.id===o.section)?.description??""})}),i(c,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[t(c,{borderColor:S==="editor"?"white":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,overflow:"hidden",children:E}),we&&t(c,{flexShrink:0,width:Xe,children:We})]}),$e,t(ot,{autoExitSeconds:3,onCancel:y(()=>{p(!1)},"onCancel"),visible:f}),Ue]})},"VisDevcontainerApp");var mr=Object.defineProperty,je=y((n,e)=>mr(n,"name",{value:e,configurable:!0}),"c");const kr=je(async({logger:n,options:e,workspaceRoot:s})=>{if(!s)throw new Error("Could not determine workspace root. Run this command inside a monorepo or project directory.");const a=s,l=e.template,o=e.output,d=!!process.stdout.isTTY&&!it;let g=null;try{g=nt(a).name}catch{}const f=pt(a);let p=f?.config??null;const x=f?.hadComments??!1;if(l&&!f){const S=z.find(P=>P.id===l);if(!S){const P=z.map(Y=>Y.id).join(", ");throw new Error(`Unknown template "${l}". Valid templates: ${P}`)}p=S.config}if(!d){p?n.info(JSON.stringify(p,null,2)):(n.error("No existing devcontainer.json found. Use --template to generate one in non-TTY mode."),process.exitCode=1);return}process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume());const v=setInterval(()=>{},1e3),w=new kt(p,x,g);l&&!f&&w.dismissTemplateSelector();let k=null;if(await rt(ct.createElement(hr,{onSave:je(S=>{vt(a,S,o),k=S},"onSave"),store:w}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),clearInterval(v),k){const S=o??".devcontainer/devcontainer.json";n.info(`DevContainer config saved to ${S}`)}},"execute");export{kr as default};
@@ -0,0 +1,27 @@
1
+ var Ee=Object.defineProperty;var f=(e,t)=>Ee(e,"name",{value:t,configurable:!0});import{createRequire as Ae}from"node:module";import{isAccessibleSync as re,isFsCaseSensitive as je}from"@visulima/fs";import{isAbsolute as Fe,join as X,relative as D,basename as ve}from"@visulima/path";import{execa as ye}from"execa";import ke from"zeptomatch";import{jsx as k,jsxs as x}from"react/jsx-runtime";import{Spinner as Ne,Text as S,Box as A,render as Ge}from"@visulima/tui";import{C as be,D as B,T as Te}from"../packem_shared/symbols-CQmER5MT.js";import{dim as C,green as _e,yellow as se,cyan as K,red as Y}from"@visulima/colorize";const Me=Ae(import.meta.url),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,we=f(e=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[t,r]=F.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return F.getBuiltinModule(e)}return Me(e)},"__cjs_getBuiltinModule"),{readFileSync:Oe,writeFileSync:Pe,unlinkSync:Re}=we("node:fs"),{availableParallelism:ne}=we("node:os");var De=Object.defineProperty,He=f((e,t)=>De(e,"name",{value:t,configurable:!0}),"s$4");class O extends Error{static{f(this,"StagedError")}static{He(this,"StagedError")}constructor(t,r){super(t,r),this.name=this.constructor.name}}var Le=Object.defineProperty,Be=f((e,t)=>Le(e,"name",{value:t,configurable:!0}),"o$6");class Ue extends O{static{f(this,"ApplyEmptyCommitError")}static{Be(this,"ApplyEmptyCommitError")}}var qe=Object.defineProperty,Ve=f((e,t)=>qe(e,"name",{value:t,configurable:!0}),"o$5");class b extends O{static{f(this,"ConfigError")}static{Ve(this,"ConfigError")}}var ze=Object.defineProperty,We=f((e,t)=>ze(e,"name",{value:t,configurable:!0}),"t$1");class ae extends O{static{f(this,"GetBackupStashError")}static{We(this,"GetBackupStashError")}}var Ke=Object.defineProperty,Ye=f((e,t)=>Ke(e,"name",{value:t,configurable:!0}),"s$3");class _ extends O{static{f(this,"GitError")}static{Ye(this,"GitError")}stderr;constructor(t,r,n){super(t,n),this.stderr=r}}var Je=Object.defineProperty,Qe=f((e,t)=>Je(e,"name",{value:t,configurable:!0}),"e");class ie extends O{static{f(this,"RestoreOriginalStateError")}static{Qe(this,"RestoreOriginalStateError")}}var Xe=Object.defineProperty,Ze=f((e,t)=>Xe(e,"name",{value:t,configurable:!0}),"o$2");class M extends O{static{f(this,"TaskError")}static{Ze(this,"TaskError")}commandTitle;constructor(t,r,n){super(r,n),this.commandTitle=t}}var et=Object.defineProperty,q=f((e,t)=>et(e,"name",{value:t,configurable:!0}),"i");const tt=q(async e=>{if(e.config!==void 0)return e.config;throw new b(`No staged config provided. Add \`staged\` to your vis.config.ts:
2
+
3
+ import { defineConfig } from "@visulima/vis/config";
4
+
5
+ export default defineConfig({
6
+ staged: { "*.ts": "eslint --fix" },
7
+ });
8
+
9
+ Coming from lint-staged or nano-staged? Run \`vis migrate lint-staged\` (or \`vis migrate nano-staged\`) to move the config in and remove the legacy files.`)},"resolveConfig"),oe=q(e=>{if(typeof e!="object"||e===null)throw new b("Staged config must be an object mapping glob patterns to tasks.");const t=Object.entries(e);if(t.length===0)throw new b("Staged config is empty — at least one glob pattern is required.");for(const[r,n]of t){if(!r||r.trim()==="")throw new b("Staged config keys must be non-empty glob patterns.");Se(r,n)}return e},"validateConfig"),Se=q((e,t)=>{if(typeof t=="string"){if(t.trim()==="")throw new b(`Task for "${e}" is an empty string.`);return}if(Array.isArray(t)){if(t.length===0)throw new b(`Task array for "${e}" is empty.`);for(const r of t)Se(e,r);return}if(typeof t!="function"&&!rt(t))throw new b(`Invalid task for "${e}" — expected string, string[], function, or { title, task } object.`)},"validateTask"),rt=q(e=>typeof e=="object"&&e!==null&&typeof e.title=="string"&&typeof e.task=="function","isCustomTask");var st=Object.defineProperty,$=f((e,t)=>st(e,"name",{value:t,configurable:!0}),"n$1");const ce=2048,g=$(async(e,t)=>{const r=await ye("git",[...e],{cwd:t.cwd,env:t.env?{...process.env,...t.env}:void 0,input:t.input,reject:!1,stderr:"pipe",stdin:t.input===void 0?"ignore":"pipe",stdout:"pipe"}),n=typeof r.exitCode=="number"?r.exitCode:1;if(n!==0&&!t.lenient){const s=typeof r.stderr=="string"?r.stderr:"",i=s.length>ce?`${s.slice(0,ce)}…`:s;throw new _(`git ${e.join(" ")} failed with exit code ${n}: ${i.trim()}`,s)}return{exitCode:n,stderr:typeof r.stderr=="string"?r.stderr:"",stdout:typeof r.stdout=="string"?r.stdout:""}},"git"),R=$(async(e,t)=>{const{stdout:r}=await g(e,t);return r.trim()},"gitOut"),nt=$(async e=>{const t=await g(["rev-parse","--is-inside-work-tree"],{cwd:e,lenient:!0});return t.exitCode===0&&t.stdout.trim()==="true"},"isGitRepo"),at=$(async e=>R(["rev-parse","--absolute-git-dir"],{cwd:e}),"getGitDirectory"),$e=$(async e=>R(["rev-parse","--show-toplevel"],{cwd:e}),"getWorkTree"),de=$(async e=>R(["write-tree"],{cwd:e}),"writeIndexTree"),it=$(async e=>{const t=await g(["rev-parse","HEAD^{tree}"],{cwd:e,lenient:!0});return t.exitCode===0?t.stdout.trim():""},"headTreeSha"),N={major:2,minor:32},ot=$(e=>{const t=/git version (\d+)\.(\d+)/.exec(e);if(!t)return null;const r=Number.parseInt(t[1]??"",10),n=Number.parseInt(t[2]??"",10);return Number.isNaN(r)||Number.isNaN(n)?null:{major:r,minor:n}},"parseGitVersion"),ct=$(async e=>{const t=ot(await R(["--version"],{cwd:e}));if(t!==null&&(t.major<N.major||t.major===N.major&&t.minor<N.minor))throw new _(`Git ${N.major}.${N.minor} or newer is required; found ${t.major}.${t.minor}.`)},"assertGitVersion");var dt=Object.defineProperty,I=f((e,t)=>dt(e,"name",{value:t,configurable:!0}),"a$2");const lt="ACMR",le=500,ut=I(async e=>{const{stdout:t}=await g(["diff-files","--raw","-z"],{cwd:e}),r=t.split("\0").filter(s=>s.length>0),n=[];for(let s=0;s<r.length;s+=1){const i=r[s];if(!i?.startsWith(":"))continue;const o=i.slice(1).split(" "),a=o[3],c=o[4],l=r[s+1];s+=1,c==="A"&&a!==void 0&&/^0+$/.test(a)&&l!==void 0&&n.push(l)}return n},"getIntentToAddPaths"),ue=I(async e=>{const{stdout:t}=await g(["ls-files","--others","--exclude-standard","-z"],{cwd:e});return t.split("\0").filter(r=>r.length>0)},"getUntrackedFiles"),ft=I(async(e,t)=>{if(e.length===0)return;const r=`${e.join("\0")}\0`;await g(["rm","--cached","--quiet","--pathspec-from-file=-","--pathspec-file-nul","--"],{cwd:t.cwd,input:r})},"removeFromIndex"),ht=I(async e=>{const t=e.diffFilter??lt,r=e.diff===void 0?["diff","--name-only","-z",`--diff-filter=${t}`,"--staged"]:["diff","--name-only","-z",`--diff-filter=${t}`,...e.diff.split(/\s+/).filter(Boolean)],{stdout:n}=await g(r,{cwd:e.cwd}),s=n.split("\0").filter(o=>o.length>0);if(s.length===0)return[];const i=e.workTree??await $e(e.cwd);return s.map(o=>Fe(o)?o:X(i,o))},"getFiles"),pt=I(async(e,t)=>{if(e.length===0)return null;const r=[];for(let i=0;i<e.length;i+=le){const o=e.slice(i,i+le),{stdout:a}=await g(["diff","--binary","--unified=0","--no-color","--no-ext-diff","--src-prefix=a/","--dst-prefix=b/","--patch","--submodule=short","--",...o],{cwd:t.cwd});a.length>0&&r.push(a)}if(r.length===0)return null;const n=r.join(""),s=n.endsWith(`
10
+ `)?n:`${n}
11
+ `;return Buffer.from(s,"utf8")},"capturePatch"),gt=I(async e=>{const{stdout:t}=await g(["status","--porcelain=v1","-z"],{cwd:e}),r=t.split("\0"),n=[];for(let s=0;s<r.length;s+=1){const i=r[s];if(i===void 0||i.length<4)continue;const o=i.charAt(0),a=i.charAt(1),c=i.slice(3),l=o==="R"||o==="C"||a==="R"||a==="C";o!==" "&&o!=="?"&&a!==" "&&a!=="?"&&n.push(c),l&&(s+=1)}return n},"getPartiallyStagedFiles"),mt=I(async(e,t)=>{if(e.length===0)return;const r=`${e.join("\0")}\0`;await g(["checkout","--force","--pathspec-from-file=-","--pathspec-file-nul","--"],{cwd:t.cwd,input:r})},"checkoutPaths"),wt=I(async(e,t)=>{if(await g(["update-index","--again"],{cwd:t.cwd,lenient:!0}),e.length===0)return;const r=`${e.join("\0")}\0`;await g(["add","-u","--pathspec-from-file=-","--pathspec-file-nul","--"],{cwd:t.cwd,input:r})},"updateIndexAgain");var vt=Object.defineProperty,P=f((e,t)=>vt(e,"name",{value:t,configurable:!0}),"r$1");const yt="vis_staged_automatic_backup",xe=P(()=>`${yt}-${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,"buildMessage"),kt=P(async e=>{const t=await R(["stash","create"],{cwd:e});return t.length===0?null:(await g(["stash","store","-m",xe(),t],{cwd:e}),t)},"createBackupStash"),bt=P(async e=>{const t=xe(),{exitCode:r,stdout:n}=await g(["stash","push","--keep-index","--include-untracked","--quiet","-m",t],{cwd:e,lenient:!0});if(r!==0)return null;const s=n.trim();return s.length>0&&/no local changes/i.test(s)?null:R(["rev-parse","stash@{0}"],{cwd:e})},"createHideAllStash"),ee=P(async(e,t)=>{const{exitCode:r,stdout:n}=await g(["reflog","--format=%H %gd","refs/stash"],{cwd:e,lenient:!0});if(r!==0)return null;for(const s of n.split(/\r?\n/)){const[i,o]=s.split(/\s+/,2);if(i===t&&o!==void 0)return o}return null},"findStashRefBySha"),fe=P(async(e,t)=>{if(t===null)return;const r=await ee(e,t);r!==null&&await g(["stash","drop","--quiet",r],{cwd:e})},"dropBackupStash"),Tt=P(async(e,t)=>{if(t===null)throw new ae("Backup stash was not found — can't revert working tree.");const r=await ee(e,t);if(r===null)throw new ae(`Backup stash ${t} is no longer reachable — can't revert working tree.`);await g(["reset","--hard","HEAD"],{cwd:e}),await g(["stash","apply","--index","--quiet",r],{cwd:e})},"applyBackupStash"),St=P(async(e,t)=>{if(t===null)return;const r=await ee(e,t);r!==null&&await g(["stash","pop","--quiet",r],{cwd:e})},"popHideAllStash");var $t=Object.defineProperty,xt=f((e,t)=>$t(e,"name",{value:t,configurable:!0}),"l");class Ct{static{f(this,"GitWorkflow")}static{xt(this,"GitWorkflow")}stagedFiles=[];partiallyStaged=[];workTree="";gitDir="";preTaskIndexTree="";postTaskIndexTree="";headTree="";revertApplied=!1;warnings=[];cwd;options;patch=null;backupStashSha=null;merge=[];shouldStash;shouldHidePartial;shouldHideUnstaged;shouldHideAll;hideAllStashSha=null;intentToAddPaths=[];preTaskUntracked=new Set;constructor(t){this.cwd=t.cwd??process.cwd(),this.options=t,this.shouldStash=t.stash!==!1&&t.diff===void 0,this.shouldHidePartial=t.hidePartiallyStaged!==!1,this.shouldHideUnstaged=t.hideUnstaged===!0,this.shouldHideAll=t.hideAll===!0}async prepare(){if(!await nt(this.cwd))throw new _(`Not a git repository: ${this.cwd}`);await ct(this.cwd),this.workTree=await $e(this.cwd),this.gitDir=await at(this.cwd),this.stagedFiles=await ht({cwd:this.cwd,diff:this.options.diff,diffFilter:this.options.diffFilter,workTree:this.workTree}),this.partiallyStaged=this.stagedFiles.length===0?[]:await gt(this.cwd),this.snapshotMergeState(),this.intentToAddPaths=await ut(this.workTree),this.intentToAddPaths.length>0&&await ft(this.intentToAddPaths,{cwd:this.workTree}),this.shouldStash?this.backupStashSha=await kt(this.workTree):this.partiallyStaged.length>0&&this.warnings.push("Running with --no-stash on partially-staged files — unstaged deltas will be captured to a patch, but if re-applying the patch fails after tasks run the changes cannot be recovered."),this.shouldHideAll?this.hideAllStashSha=await bt(this.workTree):await this.hideUnstagedChanges(),this.preTaskIndexTree=this.stagedFiles.length===0?"":await de(this.workTree),this.postTaskIndexTree=this.preTaskIndexTree,this.headTree=await it(this.workTree),this.preTaskUntracked=new Set(await ue(this.workTree))}async applyModifications({autoStage:t=!1}={}){if(this.stagedFiles.length===0)return;const r=this.stagedFiles.map(n=>D(this.workTree,n));if(await wt(r,{cwd:this.workTree}),t){const n=(await ue(this.workTree)).filter(s=>!this.preTaskUntracked.has(s));if(n.length>0){const s=`${n.join("\0")}\0`;await g(["add","--pathspec-from-file=-","--pathspec-file-nul","--"],{cwd:this.workTree,input:s})}}if(this.intentToAddPaths.length>0)try{await g(["add","--intent-to-add","--",...this.intentToAddPaths],{cwd:this.workTree})}catch{}this.postTaskIndexTree=await de(this.workTree)}indexTreeChanged(){return this.preTaskIndexTree.length>0&&this.postTaskIndexTree.length>0&&this.preTaskIndexTree!==this.postTaskIndexTree}postTaskIndexMatchesHead(){return this.postTaskIndexTree.length>0&&this.headTree.length>0&&this.postTaskIndexTree===this.headTree}async restoreUnstagedChanges(){if(this.revertApplied||this.patch===null||this.shouldHideAll)return;const t=["apply","--whitespace=nowarn","--recount","--unidiff-zero"];let r;try{await g(t,{cwd:this.workTree,input:this.patch});return}catch(n){r=n instanceof _?n.stderr:String(n)}try{await g([...t,"--3way"],{cwd:this.workTree,input:this.patch})}catch(n){const s=n instanceof _&&n.stderr?n.stderr:String(n);throw new ie(`Failed to re-apply unstaged changes after running tasks. Original changes remain in the backup stash — recover with \`git stash list\` and \`git stash apply\`.
12
+ First attempt: ${r??"(no stderr)"}
13
+ Second attempt: ${s}`,{cause:n})}}async revert(){if(this.backupStashSha!==null){try{await Tt(this.workTree,this.backupStashSha)}catch(t){throw new ie("Revert failed while restoring the backup stash. Use `git stash list` to recover manually.",{cause:t})}if(await fe(this.workTree,this.backupStashSha),this.intentToAddPaths.length>0)try{await g(["add","--intent-to-add","--",...this.intentToAddPaths],{cwd:this.workTree})}catch{}this.revertApplied=!0}}async cleanup(t){if(this.restoreMergeState(),this.hideAllStashSha!==null)try{await St(this.workTree,this.hideAllStashSha)}catch{}t&&this.backupStashSha!==null&&!this.revertApplied&&await fe(this.workTree,this.backupStashSha)}recoveryHint(){return this.backupStashSha===null?null:`Backup stash is preserved (sha ${this.backupStashSha.slice(0,7)}) — restore with: git stash apply --index ${this.backupStashSha}`}async hideUnstagedChanges(){const t=new Set(this.stagedFiles.map(n=>D(this.workTree,n))),r=this.shouldHideUnstaged?[...t]:this.shouldHidePartial?this.partiallyStaged.filter(n=>t.has(n)):[];r.length!==0&&(this.patch=await pt(r,{cwd:this.workTree}),this.patch!==null&&await mt(r,{cwd:this.workTree}))}snapshotMergeState(){this.gitDir.length!==0&&(this.merge=["MERGE_HEAD","MERGE_MODE","MERGE_MSG"].map(t=>{const r=X(this.gitDir,t);return re(r)?{body:Oe(r),existed:!0,name:t}:{body:null,existed:!1,name:t}}))}restoreMergeState(){if(!(this.gitDir.length===0||this.merge.length===0))for(const t of this.merge){const r=X(this.gitDir,t.name);try{t.existed&&t.body!==null?Pe(r,t.body):re(r)&&Re(r)}catch{}}}}var It=Object.defineProperty,V=f((e,t)=>It(e,"name",{value:t,configurable:!0}),"r");const Ce=V(e=>e.includes("/"),"isPathStyle"),U=V((e,t)=>t?e.toLowerCase():e,"normalizeForMatch"),Et=V((e,t,r,n={})=>{const s=Ce(e),i=n.caseInsensitive===!0,o=U(e,i),a=[];for(const c of t){const l=s?D(r,c):ve(c);ke(o,U(l,i))&&a.push(c)}return a},"matchFiles"),At=V((e,t,r,n={})=>{if(!t||t.length===0)return[...e];const s=n.caseInsensitive===!0;return e.filter(i=>{for(const o of t){const a=Ce(o)?D(r,i):ve(i),c=U(o,s);if(ke(c,U(a,s)))return!1}return!0})},"applyIgnore");var Mt=Object.defineProperty,H=f((e,t)=>Mt(e,"name",{value:t,configurable:!0}),"g");const jt=H(e=>{switch(e){case"failed":return"red";case"running":return"cyan";case"skipped":return"yellow";case"success":return"green";default:return"gray"}},"colorForStatus"),he=H(e=>{if(e==="running")return k(Ne,{type:"dots"});const t=e==="failed"?be:e==="skipped"?B:e==="success"?Te:B;return k(S,{color:jt(e),children:t})},"iconForStatus"),pe=H(({state:e,tick:t,verbose:r})=>x(A,{flexDirection:"column",children:[[...e.patterns.values()].map(n=>x(A,{flexDirection:"column",children:[x(A,{children:[he(n.status),x(S,{children:[" ",n.title]})]}),[...n.commands.values()].map(s=>x(A,{flexDirection:"column",marginLeft:2,children:[x(A,{children:[he(s.status),x(S,{children:[" ",s.title," "]}),s.status!=="pending"&&s.status!=="running"?x(S,{color:"gray",children:["(",s.durationMs,"ms)"]}):null]}),r&&s.output?k(A,{flexDirection:"column",marginLeft:2,children:s.output.split(/\r?\n/).slice(0,20).map((i,o)=>k(S,{color:"gray",children:i},`${s.id}-line-${o}`))}):null,s.status==="failed"&&s.error?k(A,{marginLeft:2,children:k(S,{color:"red",children:s.error.message})}):null]},s.id))]},n.id)),e.infoMessages.map((n,s)=>k(S,{color:"gray",children:n},`info-${s}`)),e.warnMessages.map((n,s)=>k(S,{color:"yellow",children:n},`warn-${s}`)),e.errorMessages.map(({message:n},s)=>k(S,{color:"red",children:n},`err-${s}`))]}),"App"),Ot=H((e={})=>{const t=e.verbose===!0,r={errorMessages:[],infoMessages:[],patterns:new Map,started:!1,warnMessages:[]};let n=0;const s=Ge(k(pe,{state:r,tick:n,verbose:t}),{exitOnCtrlC:!1,stdout:process.stderr}),i=H(()=>{n+=1,s.rerender(k(pe,{state:r,tick:n,verbose:t}))},"refresh");return{commandEnd({commandId:o,durationMs:a,error:c,output:l,patternId:u,status:d}){const p=r.patterns.get(u)?.commands.get(o);p&&(p.status=d,p.durationMs=a,p.output=l,p.error=c,i())},commandStart({commandId:o,patternId:a}){const c=r.patterns.get(a)?.commands.get(o);c&&(c.status="running",i())},error({error:o,message:a}){r.errorMessages.push({error:o,message:a}),i()},info({message:o}){r.infoMessages.push(o),i()},patternEnd({patternId:o,status:a}){const c=r.patterns.get(o);c&&(c.status=a,i())},patternStart({patternId:o}){const a=r.patterns.get(o);a&&(a.status="running",i())},start({patterns:o}){r.started=!0;for(const a of o){const c=new Map;for(const l of a.commands)c.set(l.id,{durationMs:0,id:l.id,status:"pending",title:l.title});r.patterns.set(a.id,{commands:c,id:a.id,status:"pending",title:a.title})}i()},async stop(){s.unmount(),await s.waitUntilExit()},warn({message:o}){r.warnMessages.push(o),i()}}},"createInkRenderer");var Pt=Object.defineProperty,J=f((e,t)=>Pt(e,"name",{value:t,configurable:!0}),"a$1");const ge=J((e={})=>{const{quiet:t=!1,verbose:r=!1}=e,n=new Map,s=new Map,i=J(a=>{t||process.stderr.write(`${a}
14
+ `)},"print"),o=J(a=>{switch(a){case"failed":return Y(be);case"running":return K(">");case"skipped":return se(B);case"success":return _e(Te);default:return C(B)}},"iconFor");return{commandEnd({commandId:a,durationMs:c,error:l,output:u,status:d}){const p=s.get(a)??a,w=C(`(${c}ms)`);if(i(` ${o(d)} ${p} ${w}`),d==="failed"&&l&&i(C(l.message)),(d==="failed"||r)&&u&&u.trim().length>0)for(const h of u.split(/\r?\n/))i(` ${C(h)}`)},commandStart({commandId:a}){if(!r)return;const c=s.get(a)??a;i(` ${C("…")} ${c}`)},error({error:a,message:c}){t?process.stderr.write(`${Y(c)}
15
+ `):i(Y(c)),a?.stack&&(r||!t)&&process.stderr.write(`${C(a.stack)}
16
+ `)},info({message:a}){i(C(a))},patternEnd({patternId:a,status:c}){const l=n.get(a)??a;i(`${o(c)} ${l}`)},patternStart({patternId:a}){const c=n.get(a)??a;i(`${K(">")} ${c}`)},start({patterns:a}){if(a.length===0){i(C("No staged files matched any pattern."));return}const c=new Set(a.flatMap(l=>l.files)).size;i(`${K(">")} Running staged tasks on ${c} file${c===1?"":"s"} across ${a.length} pattern${a.length===1?"":"s"}`);for(const l of a){n.set(l.id,l.title);for(const u of l.commands)s.set(u.id,u.title)}},stop(){},warn({message:a}){i(se(a))}}},"createPlainRenderer");var Rt=Object.defineProperty,Ft=f((e,t)=>Rt(e,"name",{value:t,configurable:!0}),"t");const Nt=Ft(async e=>{const{env:t}=process;if(e.debug===!0||e.quiet===!0||t.NODE_ENV==="test"||t.TERM==="dumb"||t.CI!==void 0||!process.stderr.isTTY)return ge({quiet:e.quiet,verbose:e.verbose});try{return Ot({verbose:e.verbose})}catch{return ge({quiet:e.quiet,verbose:e.verbose})}},"pickRenderer");var Gt=Object.defineProperty,G=f((e,t)=>Gt(e,"name",{value:t,configurable:!0}),"a");const Q=G(e=>typeof e=="object"&&e!==null&&typeof e.title=="string"&&typeof e.task=="function","isCustomTask"),_t=G(async e=>{let t=0,r=0;const n=G(()=>(t+=1,`pattern-${t}`),"nextPatternId"),s=G(()=>(r+=1,`cmd-${r}`),"nextCommandId"),i=G(async(a,c,l)=>{if(typeof a=="string"){l.push({command:a,files:c,id:s(),source:"string",title:a});return}if(Array.isArray(a)){for(const u of a)await i(u,c,l);return}if(typeof a=="function"){const u=await a([...c]);if(typeof u=="string"){l.push({command:u,files:c,id:s(),source:"function",title:u});return}if(Array.isArray(u)){for(const d of u)if(typeof d=="string")l.push({command:d,files:c,id:s(),source:"function",title:d});else if(Q(d))l.push({files:c,id:s(),run:d.task,source:"custom",title:d.title});else throw new b("Task function returned an array with an unsupported entry — expected strings or { title, task }.");return}if(Q(u)){l.push({files:c,id:s(),run:u.task,source:"custom",title:u.title});return}throw new b("Task function returned an unsupported value — expected string, string[], or { title, task }.")}if(Q(a)){l.push({files:c,id:s(),run:a.task,source:"custom",title:a.title});return}throw new b("Unsupported task value — expected string, string[], function, or { title, task }.")},"expandTask"),o=[];for(const[a,c]of Object.entries(e.config)){const l=Et(a,e.files,e.cwd,{caseInsensitive:e.caseInsensitive===!0});if(l.length===0)continue;const u=e.relative?l.map(p=>D(e.cwd,p)):l,d=[];await i(c,u,d),d.length!==0&&o.push({commands:d,files:u,id:n(),pattern:a,title:`${a} — ${l.length} file${l.length===1?"":"s"}`})}return o},"buildTaskGraph");var Dt=Object.defineProperty,z=f((e,t)=>Dt(e,"name",{value:t,configurable:!0}),"d$1");const Ht=z(e=>{const t=[];let r="",n=!1,s=!1;for(let i=0;i<e.length;i+=1){const o=e[i];if(o===void 0)break;if(o==="\\"&&!n&&i+1<e.length){const a=e[i+1];if(a!==void 0){s&&a!=='"'&&a!=="\\"&&(r+=o),r+=a,i+=1;continue}}if(o==='"'&&!n){s=!s;continue}if(o==="'"&&!s){n=!n;continue}if(!n&&!s&&/\s/.test(o)){r.length>0&&(t.push(r),r="");continue}r+=o}if(n||s)throw new b(`Unterminated ${n?"single":"double"} quote in command: ${e}`);return r.length>0&&t.push(r),t},"parseCommandString"),Ie=process.platform==="win32"?28e3:131072,Lt=z((e,t,r)=>{const n=[];let s=[],i=t;const o=r<=0?Ie:r;for(const a of e){const c=Buffer.byteLength(a)+1;s.length>0&&i+c>o&&(n.push(s),s=[],i=t),s.push(a),i+=c}return s.length>0&&n.push(s),n},"chunkFiles"),Bt=z(async(e,t,r)=>{const n=Ht(e);if(n.length===0)throw new M(e,"Empty command for staged task.");const[s,...i]=n;if(s===void 0)throw new M(e,"Empty command for staged task.");const o=Buffer.byteLength(s)+i.reduce((u,d)=>u+Buffer.byteLength(d)+1,0),a=Lt(t,o,r.maxArgLength??Ie),c=Date.now(),l=[];for(const u of a){if(r.signal?.aborted===!0)throw new M(e,"Task aborted by earlier failure.");const d=await ye(s,[...i,...u],{cancelSignal:r.signal,cwd:r.cwd,env:Ut(r.env),killSignal:r.killSignal??"SIGTERM",reject:!1,stderr:"pipe",stdout:"pipe"}),p=typeof d.stdout=="string"?d.stdout:"",w=typeof d.stderr=="string"?d.stderr:"",h=[p,w].filter(m=>m.length>0).join(`
17
+ `);if(h.length>0&&l.push(h),d.isCanceled||d.isTerminated||typeof d.exitCode!="number"){const m=d.isCanceled?"Task aborted by earlier failure.":d.isTerminated?`Task killed by signal ${d.signal??"(unknown)"}.`:h.trim()||"Task exited without a numeric status code.";throw new M(e,m)}if(d.exitCode!==0)throw new M(e,h.trim()||`Exit code ${d.exitCode} from ${s}`)}return{durationMs:Date.now()-c,output:l.join(`
18
+ `)}},"execCommand"),Ut=z(e=>{const t={...process.env};return process.stderr.isTTY&&t.FORCE_COLOR===void 0&&t.NO_COLOR===void 0&&(t.FORCE_COLOR="1"),e?{...t,...e}:t},"buildTaskEnv");var qt=Object.defineProperty,j=f((e,t)=>qt(e,"name",{value:t,configurable:!0}),"o");const Vt=j(async(e,t,r)=>{const n=Wt(r.concurrent,e.length),s=[],i=new AbortController;let o=!1,a=0;const c=j(()=>{o||(o=!0,r.continueOnError||i.abort())},"cancel");r.externalSignal&&(r.externalSignal.aborted?c():r.externalSignal.addEventListener("abort",()=>{c()},{once:!0}));const l=j(h=>{for(const m of h.commands)t.commandEnd({commandId:m.id,durationMs:0,patternId:h.id,status:"skipped"})},"emitSkippedCommands"),u=j(async h=>{if(o){l(h),t.patternEnd({patternId:h.id,status:"skipped"});return}t.patternStart({patternId:h.id});let m="success";for(const v of h.commands){if(o){t.commandEnd({commandId:v.id,durationMs:0,patternId:h.id,status:"skipped"}),m=m==="success"?"skipped":m;continue}t.commandStart({commandId:v.id,patternId:h.id});const y=await zt(v,r,i.signal),T=y.status==="failed"&&i.signal.aborted?{...y,status:"skipped"}:y;if(t.commandEnd({commandId:v.id,durationMs:T.durationMs,error:T.error,output:T.output,patternId:h.id,status:T.status}),T.status==="failed"){s.push(v.title),m="failed",c();break}if(T.status==="skipped"){m=m==="success"?"skipped":m;break}}t.patternEnd({patternId:h.id,status:m})},"runOne"),d=j(async()=>{for(;a<e.length;){const h=e[a];a+=1,h&&await u(h)}},"pickNext"),p=[];for(let h=0;h<Math.min(n,e.length);h+=1)p.push(d());await Promise.all(p);const w=r.externalSignal?.aborted===!0;return{failedCommands:s,success:s.length===0&&!w}},"runTasks"),zt=j(async(e,t,r)=>{const n=Date.now();try{if(e.source==="custom"&&e.run)return await e.run([...e.files]),{durationMs:Date.now()-n,status:"success"};if(e.command){const s=await Bt(e.command,e.files,{cwd:t.cwd,killSignal:t.killSignal,maxArgLength:t.maxArgLength,signal:r});return{durationMs:s.durationMs,output:t.verbose?s.output:void 0,status:"success"}}return{durationMs:Date.now()-n,error:new M(e.title,"Command has no invocation target."),status:"failed"}}catch(s){const i=s instanceof Error?s:new Error(String(s));return{durationMs:Date.now()-n,error:i,output:i instanceof M?i.message:void 0,status:"failed"}}},"runCommand"),Wt=j((e,t)=>{if(e===!1)return 1;if(e===!0){const n=Math.max(1,typeof ne=="function"?ne():4);return Math.min(Math.max(1,t),n)}const r=Math.floor(e);return r>0?r:1},"concurrencyLimit");var Kt=Object.defineProperty,Z=f((e,t)=>Kt(e,"name",{value:t,configurable:!0}),"u");const Yt=!0,Jt=Z(e=>{try{return!je(e)}catch{return!1}},"detectCaseInsensitive"),Qt=Z(async(e={})=>{const t=e.cwd??process.cwd(),r=await Nt(e),n=await tt(e);typeof n!="function"&&oe(n);const s=new Ct({...e,cwd:t}),i=new AbortController;let o=!1;const a=Z(d=>{if(o){process.removeListener("SIGINT",a),process.removeListener("SIGTERM",a),process.kill(process.pid,d);return}o=!0,r.warn({message:`Received ${d} — cancelling staged tasks and restoring state. Press Ctrl+C again to abort.`}),i.abort()},"onInterrupt");process.on("SIGINT",a),process.on("SIGTERM",a);let c={failedCommands:[],ranTasks:!1,success:!0},l=!1,u=!1;try{await s.prepare(),l=!0;for(const y of s.warnings)r.warn({message:y});if(s.stagedFiles.length===0)return e.allowEmpty!==!0&&r.info({message:"No staged files found."}),u=!0,{failedCommands:[],ranTasks:!1,success:!0};const d=Jt(t),p=At(s.stagedFiles,e.ignore,t,{caseInsensitive:d});if(p.length===0&&s.stagedFiles.length>0)return r.info({message:"Every staged file was excluded by the `ignore` list."}),u=!0,{failedCommands:[],ranTasks:!1,success:!0};const w=typeof n=="function"?oe(await n([...p])):n,h=await _t({caseInsensitive:d,config:w,cwd:t,files:p,relative:e.relative});if(r.start({patterns:h}),h.length===0)return r.info({message:"No staged files matched any pattern."}),u=!0,{failedCommands:[],ranTasks:!1,success:!0};const{failedCommands:m,success:v}=await Vt(h,r,{concurrent:e.concurrent??Yt,continueOnError:e.continueOnError===!0,cwd:t,externalSignal:i.signal,killSignal:e.killSignal,maxArgLength:e.maxArgLength,verbose:e.verbose});if(c={failedCommands:m,ranTasks:!0,success:v},v){if(e.diff===void 0&&(await s.applyModifications({autoStage:e.autoStage===!0}),e.failOnChanges===!0&&s.indexTreeChanged()&&(r.warn({message:"Tasks modified staged content — failing because --fail-on-changes is set."}),c={failedCommands:[...m],ranTasks:!0,success:!1}),e.allowEmpty!==!0&&s.postTaskIndexMatchesHead()))throw new Ue("All staged changes were reverted by tasks. Re-stage changes or rerun with --allow-empty.")}else if(e.revert===!0)r.info({message:"Reverting working tree from backup stash."}),await s.revert();else{const y=s.recoveryHint();y&&r.warn({message:y})}return await s.restoreUnstagedChanges(),u=c.success,c}catch(d){const p=d instanceof Error?d.message:String(d),w=d instanceof Error?d:new Error(p);if(r.error({error:w,message:p}),d instanceof O)return{failedCommands:c.failedCommands,ranTasks:c.ranTasks,success:!1};throw d}finally{if(process.removeListener("SIGINT",a),process.removeListener("SIGTERM",a),l)try{await s.cleanup(u)}catch(d){r.error({error:d,message:"Cleanup failed."})}await r.stop()}},"runStaged");var Xt=Object.defineProperty,Zt=f((e,t)=>Xt(e,"name",{value:t,configurable:!0}),"n");const er="VIS_STAGED_CONCURRENT",me=Zt(e=>{const t=e.trim();if(t==="true"||t==="")return!0;if(t==="false")return!1;const r=Number(t);return Number.isNaN(r)?!0:r},"parseConcurrent");var tr=Object.defineProperty,L=f((e,t)=>tr(e,"name",{value:t,configurable:!0}),"d");const rr=L((e,t)=>{const r={};t!==void 0&&(r.config=t);const n=L(E=>e[E]===void 0?void 0:!!e[E],"readBool"),s=L(E=>{const W=e[E];return typeof W=="string"&&W.length>0?W:void 0},"readString"),i=n("allow-empty");i!==void 0&&(r.allowEmpty=i);const o=n("auto-stage");o!==void 0&&(r.autoStage=o);const a=n("continue-on-error");a!==void 0&&(r.continueOnError=a);const c=n("debug");c!==void 0&&(r.debug=c);const l=n("fail-on-changes");l!==void 0&&(r.failOnChanges=l);const u=n("hide-partially-staged");u!==void 0&&(r.hidePartiallyStaged=u);const d=n("hide-unstaged");d!==void 0&&(r.hideUnstaged=d);const p=n("quiet");p!==void 0&&(r.quiet=p);const w=n("relative");w!==void 0&&(r.relative=w);const h=n("revert");h!==void 0&&(r.revert=h);const m=n("stash");m!==void 0&&(r.stash=m);const v=n("verbose");v!==void 0&&(r.verbose=v);const y=s("cwd");y!==void 0&&(r.cwd=y);const T=s("diff");T!==void 0&&(r.diff=T);const te=s("diff-filter");if(te!==void 0&&(r.diffFilter=te),n("force-kill")===!0&&(r.killSignal="SIGKILL"),e.concurrent===void 0){const E=process.env[er];E!==void 0&&(r.concurrent=me(E.trim()))}else r.concurrent=me(String(e.concurrent));return r},"buildRunOptions"),hr=L(async({options:e,visConfig:t})=>{const r=(t??{}).staged;if(!r)throw new Error(`No "staged" config found in vis.config.ts. Add one:
19
+
20
+ // vis.config.ts
21
+ import { defineConfig } from "@visulima/vis/config";
22
+
23
+ export default defineConfig({
24
+ staged: { '*': 'vis check --fix' },
25
+ });
26
+
27
+ Migrating from lint-staged or nano-staged? Run \`vis migrate lint-staged\` (or \`vis migrate nano-staged\`) to move the config in and remove the legacy files.`);(await Qt(rr(e,r))).success||(process.exitCode=1)},"execute");export{rr as buildRunOptions,hr as default};
@@ -0,0 +1,2 @@
1
+ var d=Object.defineProperty;var l=(s,t)=>d(s,"name",{value:t,configurable:!0});import{createRequire as f}from"node:module";import{c as y,p as e,I as w,T as h}from"./bin.js";const m=f(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=l(s=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[t,r]=c.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return c.getBuiltinModule(s)}return m(s)},"__cjs_getBuiltinModule"),{spawnSync:v}=g("node:child_process");var b=Object.defineProperty,_=l((s,t)=>b(s,"name",{value:t,configurable:!0}),"p");const $=_(async({options:s,visConfig:t,workspaceRoot:r})=>{const p=r??process.cwd(),a=y(p);if(a.name==="pnpm"&&!s.scan){e.info("Delegating to pnpm approve-builds...");const i=["approve-builds"];s.all&&i.push("--all");const o=v("pnpm",i,{cwd:p,stdio:"inherit"});if(o.error)throw new Error(`Failed to run pnpm approve-builds: ${o.error.message}`);if(o.status!==0&&o.status!==null&&(e.error(`pnpm approve-builds exited with code ${o.status}`),process.exitCode=o.status),!s.syncNative){e.notice(""),e.notice("Tip: vis.config.ts security.allowBuilds may now be out of sync with pnpm-workspace.yaml."),e.notice("Run 'vis check --security-config' to compare, or copy the new entries into vis.config.ts.");return}}else{const i=t?.security?.allowBuilds??{},o=w(p,i);if(o.length===0)e.success("No unapproved build scripts found.");else{e.warn(`Found ${o.length} package${o.length===1?"":"s"} with unapproved build scripts:
2
+ `);for(const n of o)e.info(` ${n}`);e.notice(""),e.notice("To approve these packages, add them to vis.config.ts:"),e.notice(""),e.notice(" security: {"),e.notice(" allowBuilds: {");for(const n of o){const u=n.split(" (")[0];e.notice(` "${u}": true,`)}e.notice(" },"),e.notice(" },"),a.name==="pnpm"&&(e.notice(""),e.notice("Or run 'pnpm approve-builds' to update pnpm-workspace.yaml directly."))}}if(s.syncNative){const i=t?.security?.allowBuilds??{};if(Object.keys(i).length===0)e.warn("No security.allowBuilds configured in vis.config.ts. Nothing to sync.");else{const o=h(a.name,p,i);e.info("");for(const n of o)e.success(n)}}},"execute");export{$ as default};
@@ -0,0 +1,13 @@
1
+ var F=Object.defineProperty;var C=(e,r)=>F(e,"name",{value:r,configurable:!0});import{createRequire as q}from"node:module";import{isAccessibleSync as v}from"@visulima/fs";import{formatBytes as g}from"@visulima/humanizer";import{join as L}from"@visulima/path";import{Cache as M,parseCacheSize as K,readLastRunSummary as T,getLastRunSummaryPath as Q}from"@visulima/task-runner";import{B as G,J as D}from"../packem_shared/ai-cache-Bynt6Y9x.js";import{_ as V,E as N}from"../packem_shared/cache-directory-D72ZEag2.js";import{p as n,H as X,a as E}from"./bin.js";import{r as J,f as I,a as Z,d as ee}from"../packem_shared/run-summary-utils-C24Aaf9E.js";const U=q(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=C(e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[r,t]=k.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return k.getBuiltinModule(e)}return U(e)},"__cjs_getBuiltinModule"),{readdir:j,stat:A,realpath:z,rm:O}=b("node:fs/promises"),{createInterface:Y}=b("node:readline");var te=Object.defineProperty,h=C((e,r)=>te(e,"name",{value:r,configurable:!0}),"f");const W=h(async e=>{let r=0;try{const t=await j(e,{withFileTypes:!0});for(const o of t){const s=L(e,o.name);if(o.isDirectory())r+=await W(s);else if(o.isFile()){const a=await A(s);r+=a.size}}}catch{}return r},"sumDirectorySize"),w=h(async e=>{const r=[];let t;try{t=await j(e)}catch{return[]}for(const o of t){if(o.startsWith("."))continue;const s=L(e,o);try{const a=await A(s);if(!a.isDirectory())continue;const c=await W(s);r.push({hash:o,mtimeMs:a.mtimeMs,path:s,sizeBytes:c})}catch{}}return r.sort((o,s)=>s.mtimeMs-o.mtimeMs),r},"collectCacheEntries"),se=h((e,r=Date.now())=>{const t=Math.floor((r-e)/1e3);return t<60?`${String(t)}s`:t<3600?`${String(Math.floor(t/60))}m`:t<86400?`${String(Math.floor(t/3600))}h`:`${String(Math.floor(t/86400))}d`},"formatAge"),re=h(e=>new Promise(r=>{const t=Y({input:process.stdin,output:process.stderr});t.question(`${e} (y/N) `,o=>{t.close();const s=o.trim().toLowerCase();r(s==="y"||s==="yes")})}),"confirmPrompt"),oe=h(async(e,r,t)=>{if(!v(e)){if(r==="json"){process.stdout.write(`${JSON.stringify({directory:e,entries:[],totalBytes:0,totalCount:0},void 0,2)}
2
+ `);return}n.info(`No cache directory found at ${e}`);return}const o=await w(e);if(o.length===0){if(r==="json"){process.stdout.write(`${JSON.stringify({directory:e,entries:[],totalBytes:0,totalCount:0},void 0,2)}
3
+ `);return}n.info(`Cache directory is empty: ${e}`);return}const s=o.reduce((i,d)=>i+d.sizeBytes,0);if(r==="json"){const i=Date.now();process.stdout.write(`${JSON.stringify({directory:e,entries:o.map(d=>({ageMs:i-d.mtimeMs,hash:d.hash,mtimeIso:new Date(d.mtimeMs).toISOString(),sizeBytes:d.sizeBytes})),totalBytes:s,totalCount:o.length},void 0,2)}
4
+ `);return}n.info(`Cache directory: ${e}`),n.info(`Entries: ${String(o.length)} (${g(s,{decimals:1,space:!1})})`),t.info("");const a=Date.now(),c=o.map(i=>({age:se(i.mtimeMs,a),hash:i.hash.slice(0,12),size:g(i.sizeBytes,{decimals:1,space:!1})})),u=Math.max(4,...c.map(i=>i.hash.length)),f=Math.max(4,...c.map(i=>i.size.length)),l=Math.max(3,...c.map(i=>i.age.length));t.info(` ${"hash".padEnd(u)} ${"size".padEnd(f)} ${"age".padEnd(l)}`),t.info(` ${"-".repeat(u)} ${"-".repeat(f)} ${"-".repeat(l)}`);for(const i of c)t.info(` ${i.hash.padEnd(u)} ${i.size.padEnd(f)} ${i.age.padEnd(l)}`)},"runList"),ae=h(()=>{try{const e=G();e>0&&n.info(`Cleared ${String(e)} cached AI response${e===1?"":"s"}.`)}catch(e){n.warn(`Failed to clear AI response cache: ${e instanceof Error?e.message:String(e)}`)}},"clearAiCacheSafe"),ne=h(()=>{try{const e=X();e>0&&n.info(`Cleared ${String(e)} cached Socket.dev report${e===1?"":"s"}.`)}catch(e){n.warn(`Failed to clear Socket.dev cache: ${e instanceof Error?e.message:String(e)}`)}},"clearSocketCacheSafe"),ie=h(async(e,r,t)=>{if(!v(e)){n.info(`No cache directory to clean at ${e}`);return}if(t.dryRun){const s=await w(e),a=s.reduce((c,u)=>c+u.sizeBytes,0);n.info(`Would remove ${String(s.length)} cache entr${s.length===1?"y":"ies"} (${g(a,{decimals:1,space:!1})}) from ${e}`);return}const o=V(e,r);try{const s=await z(e),a=await z(r);if(s===a){n.error("Refusing to delete the workspace root. The cache directory resolved to the same path as the workspace."),process.exitCode=1;return}}catch{}if(!o&&!t.force){if(n.warn(`Cache directory is outside the workspace root: ${e}`),n.warn("This will recursively delete the entire directory, including anything stored there by other tools."),!process.stdin.isTTY){n.error("Refusing to clean an out-of-workspace cache without --force (stdin is not a TTY)."),process.exitCode=1;return}if(!await re(" Continue?")){n.info("Aborted.");return}}o?await new M({cacheDirectory:e,workspaceRoot:r}).clear():await O(e,{force:!0,recursive:!0}),n.success(`Cleared cache: ${e}`)},"runClean"),ce=h(async(e,r,t)=>{if(!v(e)){n.info(`No cache directory to prune at ${e}`);return}if(t.maxCacheAgeDays!==void 0&&(!Number.isFinite(t.maxCacheAgeDays)||t.maxCacheAgeDays<0)){n.error(`Invalid --max-age-days value: expected a finite number >= 0, got ${String(t.maxCacheAgeDays)}`),process.exitCode=1;return}if(t.keepLast!==void 0&&(!Number.isFinite(t.keepLast)||t.keepLast<0||!Number.isInteger(t.keepLast))){n.error(`Invalid --keep-last value: expected a non-negative integer, got ${String(t.keepLast)}`),process.exitCode=1;return}if(t.maxCacheSize!==void 0){let i;try{i=K(t.maxCacheSize)}catch(d){n.error(`Invalid --max-size value: ${d instanceof Error?d.message:String(d)}`),process.exitCode=1;return}if(!Number.isFinite(i)||i<=0){n.error(`Invalid --max-size value: expected a positive size, got "${t.maxCacheSize}" (${String(i)} bytes)`),process.exitCode=1;return}}const o=t.maxCacheAgeDays===void 0?void 0:t.maxCacheAgeDays*24*60*60*1e3,s=await w(e),a=s.reduce((i,d)=>i+d.sizeBytes,0);if(t.keepLast!==void 0&&s.length>t.keepLast){const i=s.slice(t.keepLast);await Promise.all(i.map(d=>O(d.path,{force:!0,recursive:!0})))}await new M({cacheDirectory:e,maxCacheAge:o,maxCacheSize:t.maxCacheSize,workspaceRoot:r}).removeOldEntries();const c=await w(e),u=c.reduce((i,d)=>i+d.sizeBytes,0),f=s.length-c.length,l=a-u;if(f<=0){n.info("Nothing to prune — all entries are within the configured limits.");return}n.success(`Pruned ${String(f)} entr${f===1?"y":"ies"}, freed ${g(l,{decimals:1,space:!1})}.`)},"runPrune"),R=16,P=h(e=>e.length>R?`${e.slice(0,R)}…`:e,"truncateHash"),x=h((e,r,t)=>{const o=Object.entries(r??{});if(o.length!==0){t.info(` ${e}:`),o.sort(([s],[a])=>s.localeCompare(a));for(const[s,a]of o)t.info(` ${s.padEnd(40)} ${P(a)}`)}},"renderHashDetailsBucket"),ue=h(async(e,r,t)=>{const{format:o,runId:s,workspaceRoot:a}=r,c=s===void 0?await T(a):await J(a,s);if(!c){if(o==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:s??null,taskId:e},void 0,2)}
5
+ `),process.exitCode=1;return}s===void 0?n.error("No previous run summary found. Run a task first to populate `.task-runner/last-summary.json`."):n.error(`Run summary "${s}" not found in .task-runner/runs/.`),process.exitCode=1;return}const u=I(c,e);if(!u){if(o==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:c.id,taskId:e},void 0,2)}
6
+ `),process.exitCode=1;return}n.error(`Task "${e}" was not part of run ${c.id}.`),n.info(`Tasks in this run: ${c.tasks.map(d=>d.taskId).join(", ")||"(none)"}`),process.exitCode=1;return}const f=await Z(a,c.id),l=f?I(f,e):void 0,i=ee(u.hashDetails,l?.hashDetails);if(o==="json"){process.stdout.write(`${JSON.stringify({diff:i,previousRunId:f?.id??null,previousTask:l?{cacheStatus:l.cacheStatus,hash:l.hash??null,hashDetails:l.hashDetails??null}:null,runId:c.id,task:{cacheStatus:u.cacheStatus,hash:u.hash??null,hashDetails:u.hashDetails??null,taskId:u.taskId}},void 0,2)}
7
+ `);return}if(n.info(`Why ${e}? (run ${c.id})`),t.info(""),t.info(` status: ${u.cacheStatus}`),t.info(` hash: ${u.hash??"(none)"}`),l?t.info(` prev: ${l.hash??"(none)"} [run ${f?.id??"?"}]`):t.info(" prev: (no prior run found)"),t.info(""),!l){n.info("No previous run to diff against — first time this task was recorded.");return}if(!i.commandChanged&&i.nodes.added.length===0&&i.nodes.changed.length===0&&i.nodes.removed.length===0&&i.runtime.added.length===0&&i.runtime.changed.length===0&&i.runtime.removed.length===0&&i.implicitDeps.added.length===0&&i.implicitDeps.changed.length===0&&i.implicitDeps.removed.length===0){n.success("No hash inputs changed since the previous run.");return}t.info("Hash inputs that changed since the previous run:"),t.info(""),i.commandChanged&&t.info(" command: changed");for(const d of["nodes","runtime","implicitDeps"]){const m=i[d];if(!(m.added.length===0&&m.changed.length===0&&m.removed.length===0)){t.info(` ${d}:`);for(const $ of m.added)t.info(` + ${$}`);for(const $ of m.changed)t.info(` ~ ${$}`);for(const $ of m.removed)t.info(` - ${$}`)}}t.info(""),n.info(`Last summary file: ${Q(a)}`)},"runWhy"),de=h(async(e,r,t)=>{const{format:o,runId:s,workspaceRoot:a}=r,c=s===void 0?await T(a):await J(a,s);if(!c){if(o==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:s??null,taskId:e},void 0,2)}
8
+ `),process.exitCode=1;return}s===void 0?n.error("No previous run summary found. Run a task first to populate `.task-runner/last-summary.json`."):n.error(`Run summary "${s}" not found in .task-runner/runs/.`),process.exitCode=1;return}const u=I(c,e);if(!u){if(o==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:c.id,taskId:e},void 0,2)}
9
+ `),process.exitCode=1;return}n.error(`Task "${e}" was not part of run ${c.id}.`),process.exitCode=1;return}if(o==="json"){process.stdout.write(`${JSON.stringify({cacheStatus:u.cacheStatus,hash:u.hash??null,hashDetails:u.hashDetails??null,runId:c.id,taskId:u.taskId},void 0,2)}
10
+ `);return}n.info(`Hash for ${e} (run ${c.id})`),t.info(""),t.info(` status: ${u.cacheStatus}`),t.info(` hash: ${u.hash??"(none)"}`),u.hashDetails?(t.info(""),t.info(` command: ${P(u.hashDetails.command)}`),x("nodes",u.hashDetails.nodes,t),x("runtime",u.hashDetails.runtime,t),x("implicitDeps",u.hashDetails.implicitDeps,t)):(t.info(""),n.info("No hash details recorded for this task."))},"runHash"),he=h(async(e,r)=>{if(!v(e)){if(r==="json"){process.stdout.write(`${JSON.stringify({directory:e,exists:!1,totalBytes:0,totalCount:0})}
11
+ `);return}n.info(`No cache directory at ${e}`);return}const t=await w(e),o=t.reduce((s,a)=>s+a.sizeBytes,0);if(r==="json"){process.stdout.write(`${JSON.stringify({directory:e,exists:!0,totalBytes:o,totalCount:t.length})}
12
+ `);return}n.info(`Cache directory: ${e}`),n.info(`Entries: ${String(t.length)}`),n.info(`Total size: ${g(o,{decimals:1,space:!1})}`)},"runSize"),_=h(e=>e==="task"||e==="ai"||e==="socket"||e==="all"?e:(e&&e.length>0&&n.warn(`Unknown --type value '${e}'; falling back to 'all'.`),"all"),"parseCacheTarget"),p=h((e,r)=>e==="all"||e===r,"includesTarget"),y=h(e=>e===void 0?null:new Date(e).toISOString(),"isoOrNull"),B=h((e,r)=>{n.info(`${e}:`),n.info(` Entries: ${String(r.entries)}`),n.info(` Total size: ${g(r.totalSizeBytes,{decimals:1,space:!1})}`),n.info(` Oldest: ${r.oldestEntry?new Date(r.oldestEntry).toISOString():"N/A"}`),n.info(` Newest: ${r.newestEntry?new Date(r.newestEntry).toISOString():"N/A"}`)},"printAuxStatsBlock"),le=h(e=>e==="worktree"||e==="shared"||e==="all"?e:(e&&e.length>0&&n.warn(`Unknown --scope value '${e}'; falling back to 'shared'.`),"shared"),"parseScope"),S=h((e,r,t)=>{const o=e??process.cwd(),s=t??{},a=s.taskRunnerOptions??{},c=le(r.scope),u=r.cacheDir,f=N(o,u,a.cacheDirectory,!1),l=N(o,u,a.cacheDirectory,s.sharedWorktreeCache);let i,d;switch(c){case"all":{i=l,d=l===f?[l]:[l,f];break}case"worktree":{i=f,d=[f];break}default:i=l,d=[l]}return{cacheDirectories:d,cacheDirectory:i,scope:c,sharedWorktreeCache:s.sharedWorktreeCache,workspaceRoot:o}},"resolveCacheDirectoryFromContext"),Ce=h(async({logger:e,options:r,visConfig:t,workspaceRoot:o})=>{const{cacheDirectories:s}=S(o,r,t),a=r.format??"table";for(const c of s)s.length>1&&n.info(`# ${c}`),await oe(c,a,e)},"cacheListExecute"),xe=h(async({options:e,visConfig:r,workspaceRoot:t})=>{const o=_(e.type),s=!!e.dryRun;if(p(o,"task")){const{cacheDirectory:a,workspaceRoot:c}=S(t,e,r);await ie(a,c,{dryRun:s,force:!!e.force})}if(p(o,"ai"))if(s){const a=D();n.info(`Would clear ${String(a.entries)} cached AI response${a.entries===1?"":"s"}.`)}else ae();if(p(o,"socket"))if(s){const a=E();n.info(`Would clear ${String(a.entries)} cached Socket.dev report${a.entries===1?"":"s"}.`)}else ne()},"cacheCleanExecute"),De=h(async({options:e,visConfig:r,workspaceRoot:t})=>{const{cacheDirectories:o,workspaceRoot:s}=S(t,e,r);for(const a of o)o.length>1&&n.info(`# ${a}`),await ce(a,s,{keepLast:typeof e.keepLast=="number"?e.keepLast:void 0,maxCacheAgeDays:typeof e.maxAgeDays=="number"?e.maxAgeDays:void 0,maxCacheSize:e.maxSize})},"cachePruneExecute"),H=h(e=>e??process.cwd(),"resolveWorkspaceRoot"),Ee=h(async({argument:e,logger:r,options:t,workspaceRoot:o})=>{const s=e[0];if(!s){n.error("No task ID specified. Usage: vis cache why <project>:<target>"),process.exitCode=1;return}await ue(s,{format:t.format??"table",runId:t.run,workspaceRoot:H(o)},r)},"cacheWhyExecute"),Ie=h(async({argument:e,logger:r,options:t,workspaceRoot:o})=>{const s=e[0];if(!s){n.error("No task ID specified. Usage: vis cache hash <project>:<target>"),process.exitCode=1;return}await de(s,{format:t.format??"table",runId:t.run,workspaceRoot:H(o)},r)},"cacheHashExecute"),ze=h(async({options:e,visConfig:r,workspaceRoot:t})=>{const o=_(e.type);if((e.format??"table")==="json"){const s={};if(p(o,"task")){const{cacheDirectories:a}=S(t,e,r);s.task=await Promise.all(a.map(async c=>{const u=v(c),f=u?await w(c):[],l=f.reduce((i,d)=>i+d.sizeBytes,0);return{directory:c,entries:f.length,exists:u,newestEntry:y(f[0]?.mtimeMs),oldestEntry:y(f.at(-1)?.mtimeMs),totalBytes:l}}))}if(p(o,"ai")){const a=D();s.ai={entries:a.entries,newestEntry:y(a.newestEntry),oldestEntry:y(a.oldestEntry),totalBytes:a.totalSizeBytes}}if(p(o,"socket")){const a=E();s.socket={entries:a.entries,newestEntry:y(a.newestEntry),oldestEntry:y(a.oldestEntry),totalBytes:a.totalSizeBytes}}process.stdout.write(`${JSON.stringify(s,void 0,2)}
13
+ `);return}if(p(o,"task")){const{cacheDirectories:s}=S(t,e,r);for(const a of s)s.length>1&&n.info(`# ${a}`),await he(a,"table")}p(o,"ai")&&B("AI response cache",D()),p(o,"socket")&&B("Socket.dev report cache",E())},"cacheSizeExecute");export{xe as cacheCleanExecute,Ie as cacheHashExecute,Ce as cacheListExecute,De as cachePruneExecute,ze as cacheSizeExecute,Ee as cacheWhyExecute,ae as clearAiCacheSafe,ne as clearSocketCacheSafe,w as collectCacheEntries,se as formatAge,ie as runClean,de as runHash,oe as runList,ce as runPrune,he as runSize,ue as runWhy};
@@ -0,0 +1,8 @@
1
+ var I=Object.defineProperty;var S=(c,o)=>I(c,"name",{value:o,configurable:!0});import{findPackageManagerSync as J}from"@visulima/package";import{render as b,renderToString as V,Text as y}from"@visulima/tui";import{c as W,O as Z,W as q,p as f,V as G,B as H,d as K}from"./bin.js";import a from"react";import{z as Q,e as X,Z as _}from"../packem_shared/ai-analysis-CGuy7dfE.js";import{U as ee,B as te,f as j}from"../packem_shared/VisUpdateApp-D-L4_-Iu.js";import{o as oe,a as re,N as m,w as ne,v as N,O as se,T as ie}from"../packem_shared/catalog-BVPerCwG.js";var ae=Object.defineProperty,ce=S((c,o)=>ae(c,"name",{value:o,configurable:!0}),"$");const we=ce(async({argument:c,logger:o,options:e,visConfig:i,workspaceRoot:C})=>{if(!C)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const d=C;if(e.securityConfig){const t=W(d);if(Z(i??{},t.name),e.sync&&t.name==="pnpm"){const r=q(i??{});if(r.length>0){f.info(`
2
+ Settings that would sync to pnpm-workspace.yaml:`);for(const x of r)f.success(` ${x}`)}else f.info("No security settings to sync.")}else e.sync&&t.name!=="pnpm"&&(f.info(`--sync is only available for pnpm projects. Your project uses ${t.name}.`),f.info("vis enforces security settings at the vis layer for non-pnpm projects."));if(!e.security&&!c?.length)return}const{packageManager:O}=J(d),U=oe(d),l=i?.update??{},w=re(d,O,{dev:e.dev,prod:e.prod});if(w.size===0){o.info("No catalogs found.");return}const v=e.target??l.target??"latest";if(!["latest","minor","patch"].includes(v))throw new Error(`Invalid target "${v}". Use: latest, minor, or patch.`);const z={exclude:[...m(e.exclude),...m(l.exclude)],ignore:m(l.ignore),include:[...m(e.include),...m(l.include),...c],includeLocked:!!e.includeLocked,includePrerelease:e.prerelease||l.prerelease||!1,security:!e.noSecurity,target:v};let E=0;for(const t of w.values())E+=t.size;const h=!!process.stdout.isTTY&&!K;let u;const B=h?(t,r)=>{u?u.rerender(a.createElement(j,{current:t,total:r})):u=b(a.createElement(j,{current:t,total:r}),{interactive:!0,patchConsole:!1})}:(t,r)=>{o.info(`Checking ${String(t)}/${String(r)} dependencies...`)};h||o.info(`Checking ${String(E)} catalog dependencies against npm registry...
3
+ `);const M=G(i?.security?.socket),{failed:$,outdated:s}=await ne(w,z,U,B,d,M,i?.security?.socket?.acceptedRisks);if(u&&(u.clear(),u.unmount()),$.length>0&&o.warn(`Failed to fetch: ${$.join(", ")}`),s.length===0){o.info("All catalog dependencies are up to date.");return}const k=e.format??l.format??"table",P=Q(e.aiType??"impact"),p=e.ai?await X(s,o,i?.ai,P):void 0;if(h&&k==="table"){const t=new ee(s,p??null),r=i?.tui?.autoExit??!1,x=r===!0?3:typeof r=="number"?r:0;await b(a.createElement(te,{autoExitSeconds:x,isDryRun:!0,store:t}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit();const L=process.stdout.columns||80;process.stdout.write(`
4
+ `);for(const n of s){const Y=n.vulnerabilities?.length||n.socketReport&&n.socketReport.alerts.length>0,T=!!n.acceptedRisk,A=Y?T?"✓":"⚠":"✓",D=T?"gray":n.updateType==="major"?"red":n.updateType==="minor"?"yellow":"green",g=n.socketReport?.score.overall,F=g===void 0?"":` [${String(Math.round(g*100))}%]`,R=g===void 0?void 0:H(g);process.stdout.write(`${V(a.createElement(y,null," ",a.createElement(y,{color:D},A),` ${n.packageName} ${n.currentRange} → ${n.newRange}`,a.createElement(y,{dimColor:!0},` ${n.updateType}`),R?a.createElement(y,{color:R},F):null),{columns:L})}
5
+ `)}process.stdout.write(`
6
+ `),o.info(N(s))}else if(k==="json"){const t={failed:$,outdated:s};p&&(t.aiAnalysis=p),process.stdout.write(`${JSON.stringify(t,void 0,2)}
7
+ `)}else k==="minimal"?process.stdout.write(`${se(s)}
8
+ `):(ie(s,o),o.info(N(s)),p&&(o.info(""),o.info(_(p))));e.exitCode&&s.length>0&&(process.exitCode=1)},"execute");export{we as default};
@@ -0,0 +1 @@
1
+ var m=Object.defineProperty;var f=(r,n)=>m(r,"name",{value:n,configurable:!0});import{r as u}from"../packem_shared/toolchain-DQfTQY8E.js";var _=Object.defineProperty,a=f((r,n)=>_(r,"name",{value:n,configurable:!0}),"n");const C=a(()=>process.env.GITHUB_BASE_REF?{base:`origin/${process.env.GITHUB_BASE_REF}`,head:process.env.GITHUB_SHA??"HEAD"}:process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME?{base:`origin/${process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME}`,head:process.env.CI_COMMIT_SHA??"HEAD"}:process.env.CIRCLE_BRANCH&&process.env.CIRCLE_SHA1?{base:"origin/main",head:process.env.CIRCLE_SHA1}:{base:"origin/main",head:"HEAD"},"detectCiRefs"),w=a(async({argument:r,logger:n,options:e,runtime:t,visConfig:d,workspaceRoot:s})=>{const l=r[0];if(!l)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");const p=l.split(",").map(o=>o.trim()).filter(Boolean);if(p.length===0)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");if(!s)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const{base:E,head:h}=C(),c=e.base??E,g=e.head??h;e.skipToolchain||n.info("▸ Toolchain pre-flight"),await u(s,d?.toolchain,{error:a(o=>{n.error(o)},"error"),info:a(o=>{n.info(o)},"info"),warn:a(o=>{n.warn(o)},"warn")},!!e.skipToolchain),e.install===!1?n.info("▸ Skipping install (--no-install)"):(n.info("▸ Installing dependencies"),await t.runCommand("install",{argv:["--frozen-lockfile"]}));for(const o of p){n.info(`▸ Running affected ${o} (base=${c}, head=${g})`);const i=[o,`--base=${c}`,`--head=${g}`,`--upstream=${String(e.upstream??"none")}`,`--downstream=${String(e.downstream??"deep")}`];e.parallel!==void 0&&i.push(`--parallel=${String(e.parallel)}`),e.partition&&i.push(`--partition=${String(e.partition)}`),e.query&&i.push(`--query=${String(e.query)}`),await t.runCommand("affected",{argv:i})}n.info("▸ CI pipeline complete")},"execute");export{w as default};
@@ -0,0 +1 @@
1
+ var a=Object.defineProperty;var d=(s,o)=>a(s,"name",{value:o,configurable:!0});import{createRequire as p}from"node:module";import{isAccessibleSync as k}from"@visulima/fs";import{join as m}from"@visulima/path";import{cleanWorkspace as b}from"#native";import{p as c}from"./bin.js";import{f as R}from"../packem_shared/utils-DrNg0XTR.js";const g=p(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(s=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[o,n]=f.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return f.getBuiltinModule(s)}return g(s)},"__cjs_getBuiltinModule"),{readdirSync:v,lstatSync:y,unlinkSync:_}=h("node:fs");var $=Object.defineProperty,u=d((s,o)=>$(s,"name",{value:o,configurable:!0}),"f");const j=u(s=>{const o=[],n=[s];for(;n.length>0;){const t=n.pop();let i;try{i=v(t)}catch{continue}for(const r of i){const e=m(t,r);try{const l=y(e);if(l.isSymbolicLink()||!l.isDirectory())continue}catch{continue}r==="node_modules"?o.push(e):r!==".git"&&r!==".hg"&&n.push(e)}}return o},"findNodeModulesDirectories"),S=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"],x=u((s,o,n)=>{let t=0,i=!1;for(const r of S){const e=m(s,r);if(k(e)){if(o){n.info(` ${e}`),t++;continue}try{_(e),c.success(`Removed ${e}`),t++}catch(l){c.error(`${e}: ${R(l)}`),i=!0}}}return{hadError:i,removed:t}},"removeLockfiles"),D=u(async({logger:s,options:o,workspaceRoot:n})=>{const t=n??process.cwd(),i=o.lockfile||!1;if(o.dryRun){const e=j(t);if(e.length>0){c.info("Would remove:");for(const l of e)s.info(` ${l}`)}else c.info("No node_modules directories found.");i&&x(t,!0,s);return}const r=b(t,i);for(const e of r.removed)c.success(`Removed ${e}`);for(const e of r.lockfilesRemoved)c.success(`Removed ${e}`);for(const e of r.errors)c.error(e);r.removed.length===0&&r.lockfilesRemoved.length===0?c.info("No node_modules directories found."):c.info(`Cleaned ${r.removed.length} node_modules director${r.removed.length===1?"y":"ies"}`),r.errors.length>0&&(process.exitCode=1)},"execute");export{D as default};
@@ -0,0 +1,7 @@
1
+ var H=Object.defineProperty;var v=(e,t)=>H(e,"name",{value:t,configurable:!0});import{walkSync as J,readFileSync as k}from"@visulima/fs";import{readYamlSync as X}from"@visulima/fs/yaml";import{relative as M,join as R}from"@visulima/path";import{parse as Z}from"yaml";import{constantCase as ee,trainCase as te,snakeCase as ne,pascalCase as re,kebabCase as ie,camelCase as se}from"@visulima/string/case";var ae=Object.defineProperty,d=v((e,t)=>ae(e,"name",{value:t,configurable:!0}),"e");const h=d(e=>e==null?"":typeof e=="string"?e:String(e),"stringify"),S={camel_case:d(e=>se(h(e)),"camel_case"),kebab_case:d(e=>ie(h(e)),"kebab_case"),lower_case:d(e=>h(e).toLowerCase(),"lower_case"),pascal_case:d(e=>re(h(e)),"pascal_case"),path_join:d((e,...t)=>{const r=[h(e),...t.map(h)];return R(...r)},"path_join"),path_relative:d((e,t)=>M(h(t),h(e)),"path_relative"),snake_case:d(e=>ne(h(e)),"snake_case"),upper_case:d(e=>h(e).toUpperCase(),"upper_case"),upper_kebab_case:d(e=>te(h(e)),"upper_kebab_case"),upper_snake_case:d(e=>ee(h(e)),"upper_snake_case")};d(e=>Object.hasOwn(S,e),"isKnownFilter");const I=d((e,t,r=[])=>{const n=S[e];if(!n)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(S).sort().join(", ")}.`);return n(t,...r)},"applyFilter");var oe=Object.defineProperty,N=v((e,t)=>oe(e,"name",{value:t,configurable:!0}),"d$1");const L=N(e=>{const t=[];let r=0,n=0,i,s=-1;for(const a of e){if(s+=1,i){a===i&&(i=void 0);continue}if(a==='"'||a==="'"){i=a;continue}a==="("?r+=1:a===")"?r-=1:a===","&&r===0&&(t.push(e.slice(n,s)),n=s+1)}return t.push(e.slice(n)),t},"splitCommaOutsideQuotes"),le=N(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes");var ce=Object.defineProperty,$=v((e,t)=>ce(e,"name",{value:t,configurable:!0}),"i$1");const fe=/\[([^\]]+)\]/g,ue=$(e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),i=t.slice(r+1,-1).trim();return i===""?{args:[],name:n}:{args:L(i).map(s=>{const a=s.trim();return le(a)??a}),name:n}},"parseFilterCall"),pe=$(e=>{const t=e.split("|").map(n=>n.trim()),r=t[0]??"";if(!r)throw new Error(`Empty variable name in expression "${e}"`);return{filters:t.slice(1).map(ue),name:r}},"parsePipe"),me=$(e=>e==null?"":typeof e=="string"?e:String(e),"stringify"),de=$((e,t)=>{const r=e.replaceAll(fe,(n,i)=>{const{filters:s,name:a}=pe(i);if(!Object.hasOwn(t,a))throw new Error(`Variable "${a}" used in filename "${e}" but not defined`);let o=t[a];for(const l of s)o=I(l.name,o,l.args);return me(o)});return q(r)},"interpolateFilename"),q=$(e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),"stripTeraSuffix"),he=$(e=>e.endsWith(".raw")?e.slice(0,-4):e,"stripRawSuffix"),ye=$(e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},"isPartialPath");var ge=Object.defineProperty,be=v((e,t)=>ge(e,"name",{value:t,configurable:!0}),"i");const we=be((e,t)=>{if(!e.startsWith(`---
2
+ `)&&!e.startsWith(`---\r
3
+ `))return{body:e};const r=e.indexOf(`
4
+ ---`,3);if(r===-1)return{body:e};let n=r+1+3;e[n]==="\r"&&(n+=1),e[n]===`
5
+ `&&(n+=1);const i=e.startsWith(`---\r
6
+ `)?5:4,s=e.slice(i,r).replaceAll("\r","");let a;try{a=t(s)}catch(o){const l=o instanceof Error?o.message:String(o);throw new Error(`Failed to parse frontmatter YAML: ${l}`)}if(a==null)return{body:e.slice(n)};if(typeof a!="object"||Array.isArray(a))throw new TypeError(`Frontmatter must be a YAML mapping, got ${Array.isArray(a)?"array":typeof a}`);return{body:e.slice(n),frontmatter:a}},"splitFrontmatter");var ve=Object.defineProperty,f=v((e,t)=>ve(e,"name",{value:t,configurable:!0}),"c");const $e=/\{\{-?(.+?)-?\}\}|\{%-?(.+?)-?%\}/gs,U=f(e=>{const t=[];let r=0,n=1;const i=f(s=>{for(const a of s)a===`
7
+ `&&(n+=1)},"advanceLine");for(const s of e.matchAll($e)){const a=s.index??0;if(a>r){const c=e.slice(r,a);t.push({line:n,type:"text",value:c}),i(c)}const o=n,l=s[0];l.startsWith("{{")?t.push({line:o,type:"expr",value:(s[1]??"").trim()}):t.push({line:o,type:"stmt",value:(s[2]??"").trim()}),i(l),r=a+l.length}if(r<e.length){const s=e.slice(r);t.push({line:n,type:"text",value:s})}return t},"tokenize"),xe=new Set(["block","endblock","endfilter","endmacro","extends","filter","import","macro","set"]),G=f((e,t)=>{let r=0;const n=f((s,a)=>{throw new Error(`${t}:${s}: ${a}`)},"error"),i=f(s=>{const a=[];for(;r<e.length;){const o=e[r];if(o.type==="text"){a.push({type:"text",value:o.value}),r+=1;continue}if(o.type==="expr"){a.push({expression:o.value,line:o.line,type:"expr"}),r+=1;continue}const l=o.value.split(/\s+/)[0]??"";if(s.includes(l))return a;if(xe.has(l)&&n(o.line,`Tera feature "{% ${l} %}" is not supported. Supported: if/else/endif, for/endfor, include. Rewrite the template to avoid macros, set, extends, block, and import.`),l==="if"){r+=1;const c=o.value.slice(2).trim(),m=i(["else","endif"]);let u;r<e.length&&e[r].type==="stmt"&&e[r].value.split(/\s+/)[0]==="else"&&(r+=1,u=i(["endif"])),(r>=e.length||e[r].type!=="stmt"||e[r].value.split(/\s+/)[0]!=="endif")&&n(o.line,"Unterminated {% if %} — missing {% endif %}"),r+=1,a.push({alternate:u,condition:c,consequent:m,line:o.line,type:"if"});continue}if(l==="for"){r+=1;const c=o.value.slice(3).trim(),m=c.indexOf(" in ");m===-1&&n(o.line,"Malformed {% for %} — expected `for <name> in <collection>`");const u=c.slice(0,m).trim(),g=c.slice(m+4).trim();(!u||!g)&&n(o.line,"Malformed {% for %} — missing binding or collection");const p=i(["endfor"]);(r>=e.length||e[r].type!=="stmt"||e[r].value.split(/\s+/)[0]!=="endfor")&&n(o.line,"Unterminated {% for %} — missing {% endfor %}"),r+=1,a.push({binding:u,body:p,collection:g,line:o.line,type:"for"});continue}if(l==="include"){r+=1;const c=o.value.slice(7).trim(),m=Q(c);m===void 0&&n(o.line,"Malformed {% include %} — expected a quoted partial name"),a.push({line:o.line,name:m,type:"include"});continue}n(o.line,`Unknown tag "{% ${l} %}". Supported: if, for, include.`)}return a},"parseBlock");return i([])},"parse"),Q=f(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes"),Ee=f(e=>e==null?"":typeof e=="boolean"||typeof e=="number"?String(e):typeof e=="string"?e:JSON.stringify(e),"stringify"),Oe=f(e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:!0,"isTruthy"),V=f((e,t,r,n,i=!0)=>{const s=e.split(".");if(i&&s.length>0&&!Object.hasOwn(t,s[0]))throw new Error(`${n}:${r}: Variable "${e}" is not defined`);let a=t;for(const o of s){if(a==null)return;if(typeof a!="object")throw new TypeError(`${n}:${r}: Cannot read "${o}" on non-object value`);a=a[o]}return a},"lookupVariable"),ke=f(e=>{const t=[];let r=0,n=0,i;for(let s=0;s<e.length;s+=1){const a=e[s];if(i){a===i&&(i=void 0);continue}if(a==='"'||a==="'"){i=a;continue}a==="("?r+=1:a===")"?r-=1:a==="|"&&r===0&&(t.push(e.slice(n,s)),n=s+1)}return t.push(e.slice(n)),t},"splitFilterPipe"),je=f(e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),i=t.slice(r+1,-1).trim();return i?{args:L(i).map(s=>s.trim()),name:n}:{args:[],name:n}},"parseFilterCall"),j=f((e,t,r,n,i=!0)=>{const s=e.trim();if(s==="true")return!0;if(s==="false")return!1;if(s==="null"||s==="none")return null;const a=Q(s);return a!==void 0?a:/^-?\d+(\.\d+)?$/.test(s)?Number(s):V(s,t,r,n,i)},"evaluatePrimary"),B=f((e,t,r,n,i=!0)=>{const s=ke(e),a=s[0].trim();let o=j(a,t,r,n,i);for(let l=1;l<s.length;l+=1){const c=s[l].trim(),{args:m,name:u}=je(c),g=m.map(p=>j(p,t,r,n,i));try{o=I(u,o,g)}catch(p){const w=p instanceof Error?p.message:String(p);throw new Error(`${n}:${r}: ${w}`)}}return o},"evaluateExpression"),D=f((e,t)=>{let r,n=0;for(let i=0;i<=e.length-t.length;i+=1){const s=e[i];if(r){s===r&&(r=void 0);continue}if(s==='"'||s==="'"){r=s;continue}if(s==="("){n+=1;continue}if(s===")"){n-=1;continue}if(n===0&&e.slice(i,i+t.length)===t)return i}return-1},"findOperatorOutsideQuotes"),A=f((e,t)=>{const r=[];let n=0,i=0;for(;i<=e.length-t.length;){const s=D(e.slice(i),t);if(s===-1)break;r.push(e.slice(n,i+s)),i+=s+t.length,n=i}return r.push(e.slice(n)),r},"splitLogical"),x=f((e,t,r,n)=>{const i=e.trim();if(i==="")return!1;if(i.startsWith("(")&&i.endsWith(")")&&Se(i)===i.length-1)return x(i.slice(1,-1),t,r,n);const s=A(i," or ");if(s.length>1)return s.some(o=>x(o,t,r,n));const a=A(i," and ");if(a.length>1)return a.every(o=>x(o,t,r,n));if(i.startsWith("not "))return!x(i.slice(4),t,r,n);for(const o of["==","!="]){const l=D(i,o);if(l!==-1){const c=j(i.slice(0,l),t,n,r,!1),m=j(i.slice(l+o.length),t,n,r,!1),u=c===m;return o==="=="?u:!u}}return Oe(B(i,t,n,r,!1))},"evaluateConditionExpression"),Se=f(e=>{if(e[0]!=="(")return-1;let t=0,r,n=-1;for(const i of e){if(n+=1,r){i===r&&(r=void 0);continue}if(i==='"'||i==="'"){r=i;continue}if(i==="(")t+=1;else if(i===")"&&(t-=1,t===0))return n}return-1},"matchingParen"),E=f((e,t)=>{let r="";for(const n of e){if(n.type==="text"){r+=n.value;continue}if(n.type==="expr"){r+=Ee(B(n.expression,t.scope,n.line,t.filename));continue}if(n.type==="if"){const i=x(n.condition,t.scope,t.filename,n.line)?n.consequent:n.alternate??[];r+=E(i,t);continue}if(n.type==="for"){const i=V(n.collection,t.scope,n.line,t.filename,!1);if(i==null)continue;if(!Array.isArray(i))throw new TypeError(`${t.filename}:${n.line}: {% for %} expected an array, got ${typeof i}`);for(const s of i){const a={...t.scope,[n.binding]:s};r+=E(n.body,{...t,scope:a})}continue}if(n.type==="include"){const i=t.partials?.get(n.name);if(!i)throw new Error(`${t.filename}:${n.line}: Partial "${n.name}" not found. Available: ${[...t.partials?.keys()??[]].join(", ")||"(none)"}`);const s=t.includeStack??new Set;if(s.has(n.name)){const a=[...s,n.name].join(" → ");throw new Error(`${t.filename}:${n.line}: Circular partial include detected: ${a}`)}s.add(n.name);try{r+=E(i,{...t,filename:`<partial:${n.name}>`,includeStack:s})}finally{s.delete(n.name)}}}return r},"renderNodes"),_e=f((e,t)=>G(U(e),t),"parseTemplate");f((e,t)=>E(e,t),"renderAst");const _=f((e,t)=>E(G(U(e),t.filename),t),"renderTemplate");var Ce=Object.defineProperty,y=v((e,t)=>Ce(e,"name",{value:t,configurable:!0}),"s");const P="template.yml",Te=".raw",We=new Set([".cjs",".css",".env",".gitattributes",".gitignore",".graphql",".html",".ini",".js",".json",".json5",".jsonc",".jsx",".lock",".md",".mdx",".mjs",".prettierrc",".raw",".rs",".scss",".sh",".sql",".svg",".tera",".toml",".ts",".tsx",".twig",".txt",".vue",".xml",".yaml",".yml"]),Ae=new Set(["Brewfile","CHANGELOG","CODEOWNERS","CONTRIBUTING","COPYING","Dockerfile","Gemfile","LICENCE","LICENSE","Makefile","NOTICE","Procfile","Rakefile","README","VERSION"]),Pe=y(e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),r=t===-1?e:e.slice(t+1),n=r.lastIndexOf(".");return n===-1||n===0?"":r.slice(n).toLowerCase()},"lastDot"),Y=y(e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?e:e.slice(t+1)},"basename"),Fe=y(e=>{const t=Pe(e);if(t!=="")return We.has(t);const r=Y(e);return!!Ae.has(r)},"isLikelyText"),Me=y(e=>{const t={default:e.default,internal:e.internal,order:e.order,prompt:e.prompt,required:e.required};switch(e.type){case"array":return{...t,type:"array"};case"boolean":return{...t,default:typeof t.default=="boolean"?t.default:void 0,type:"boolean"};case"enum":return{...t,multiple:e.multiple,type:"enum",values:e.values??[]};case"number":return{...t,type:"number"};case"string":return{...t,type:"string"};default:throw new Error(`Unsupported variable type "${String(e.type)}"`)}},"yamlVariableToVariable"),Re=y(e=>e.replaceAll("\\","/").replace(/^\.\//,"").replaceAll(/\/+/g,"/"),"normalizeDestinationPath"),Ie=y((e,t,r)=>{const n=t.split("/").filter(Boolean);if(n.length===0)throw new Error("Empty destination path for value");let i=e;for(let s=0;s<n.length-1;s+=1){const a=n[s],o=i[a];if(o===void 0){const l={};i[a]=l,i=l}else if(typeof o=="object"&&!Buffer.isBuffer(o))i=o;else throw new TypeError(`Path conflict: "${n.slice(0,s+1).join("/")}" is both a file and a directory`)}i[n.at(-1)]=r},"flattenFiles"),F=y((e,t,r)=>{if(typeof e!="string")return Ne(e);const n=e.includes("{{")||e.includes("{%")?_(e,{filename:`${r}#frontmatter`,scope:t}):e;return x(n,t,`${r}#frontmatter`,1)},"evaluateGate"),Ne=y(e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:typeof e=="string"?e!=="false"&&e!=="0":!0,"truthyValue"),De=y((e,t)=>{const r=R(e,P),n=X(r);if(!n||typeof n!="object")throw new Error(`${r}: must contain a YAML mapping`);const i={};if(n.variables)for(const[l,c]of Object.entries(n.variables))i[l]=Me(c);const s=new Map,a=[];for(const l of J(e,{includeDirs:!1,includeSymlinks:!1})){if(l.path===r)continue;const c=M(e,l.path).replaceAll("\\","/");if(c===P)continue;if(ye(c)){const u=k(l.path),g=_e(u,c);for(const p of Le(c))s.has(p)&&s.get(p)!==g&&console.warn(`warn: partial name "${p}" is declared by multiple files — last one wins. Use distinct names or fully-qualified includes.`),s.set(p,g);continue}if(c.endsWith(Te)){const u=k(l.path);a.push({binary:null,isRaw:!0,rawText:u,relativePath:c});continue}if(Fe(c)){const u=k(l.path);a.push({binary:null,isRaw:!1,rawText:u,relativePath:c});continue}const m=k(l.path,{buffer:!0});a.push({binary:m,isRaw:!1,rawText:null,relativePath:c})}const o=y(l=>{const c={...l.builtins,...l.options},m={},u={};for(const p of a){const w=p.relativePath;let O,C,T=!1;if(p.binary)O=p.binary;else if(p.isRaw)O=p.rawText??"";else{const K=p.rawText??"",b=we(K,z=>Z(z));if(b.frontmatter){if(b.frontmatter.skip!==void 0&&F(b.frontmatter.skip,c,w)||b.frontmatter.if!==void 0&&!F(b.frontmatter.if,c,w))continue;typeof b.frontmatter.to=="string"&&(C=_(b.frontmatter.to,{filename:`${w}#frontmatter.to`,partials:s,scope:c})),b.frontmatter.force===!0&&(T=!0)}O=_(b.body,{filename:w,partials:s,scope:c})}const W=Re(C??de(he(w),c));Ie(m,W,O),T&&(u[W]={force:!0})}const g={files:m};return Object.keys(u).length>0&&(g.filesMeta=u),g},"produce");return{about:{description:n.description??`Moon-format template at ${e}`,name:n.title??t},destination:n.destination,options:i,produce:o}},"loadMoonTemplate"),Le=y(e=>{const t=q(e),r=new Set;r.add(t);const n=Y(t);if(r.add(n),n.startsWith("_")){r.add(n.replace(/^_+/,""));const i=t.slice(0,t.length-n.length);r.add(`${i}${n.replace(/^_+/,"")}`)}return[...r]},"partialKeys");export{De as loadMoonTemplate};
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var o=(t,e)=>n(t,"name",{value:e,configurable:!0});import{dirname as u}from"@visulima/path";import{createJiti as l}from"jiti";var i=Object.defineProperty,a=o((t,e)=>i(t,"name",{value:e,configurable:!0}),"r");const p=a((t,e)=>{if(!e||typeof e!="object")throw new TypeError(`${t}: default export must be an object (got ${e===null?"null":typeof e}). Use createTemplate({ ... }).`);const r=e;if(typeof r.about!="object"||r.about===null)throw new TypeError(`${t}: default export missing required "about" object`);if(typeof r.produce!="function")throw new TypeError(`${t}: default export missing required "produce" function`);return e},"validateTemplateExport"),d=a(async t=>{const e=await l(u(t),{fsCache:!1,moduleCache:!1}).import(t,{default:!0,try:!0})??null;return p(t,e)},"loadNativeTemplate");export{d as loadNativeTemplate};
@@ -0,0 +1 @@
1
+ var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});import{VisConfigError as c}from"./VisConfigError-B5LP1zRf.js";var s=Object.defineProperty,a=o((e,r)=>s(e,"name",{value:r,configurable:!0}),"e");class C extends c{static{o(this,"VisConfigCycleError")}static{a(this,"VisConfigCycleError")}constructor(r,i){const n=[...i,`${r} (re-enters)`].join(" → ");super(`Config cycle: ${n}`,i)}}export{C as VisConfigCycleError};
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var e=(t,r)=>n(t,"name",{value:r,configurable:!0});var o=Object.defineProperty,a=e((t,r)=>o(t,"name",{value:r,configurable:!0}),"s");class h extends Error{static{e(this,"VisConfigError")}static{a(this,"VisConfigError")}chain;constructor(r,s,i){super(r,i),this.name=this.constructor.name,this.chain=s}}export{h as VisConfigError};
@@ -0,0 +1,2 @@
1
+ var n=Object.defineProperty;var t=(o,r)=>n(o,"name",{value:r,configurable:!0});import{VisConfigError as c}from"./VisConfigError-B5LP1zRf.js";var g=Object.defineProperty,f=t((o,r)=>g(o,"name",{value:r,configurable:!0}),"t");class u extends c{static{t(this,"VisConfigLoadError")}static{f(this,"VisConfigLoadError")}constructor(r,i,e){const a=e instanceof Error?e.message:String(e),s=i.length>0?`
2
+ Chain: ${i.join(" → ")}`:"";super(`Failed to load ${r}: ${a}${s}`,i,{cause:e})}}export{u as VisConfigLoadError};
@@ -0,0 +1,5 @@
1
+ var c=Object.defineProperty;var n=(o,r)=>c(o,"name",{value:r,configurable:!0});import{VisConfigError as f}from"./VisConfigError-B5LP1zRf.js";var g=Object.defineProperty,i=n((o,r)=>g(o,"name",{value:r,configurable:!0}),"t");const l=i(o=>o.join(" → "),"formatChain");class h extends f{static{n(this,"VisConfigNotFoundError")}static{i(this,"VisConfigNotFoundError")}constructor(r,t,e){const s=t.length>0?t[t.length-1]:"<unknown>",a=e.length>0?`
2
+ Tried:
3
+ ${e.join(`
4
+ `)}`:"";super(`Cannot resolve "${r}" extended from ${s}.${a}
5
+ Chain: ${l(t)}`,t)}}export{h as VisConfigNotFoundError};
@@ -0,0 +1 @@
1
+ var fe=Object.defineProperty;var k=(s,l)=>fe(s,"name",{value:l,configurable:!0});import{jsxs as t,jsx as r,Fragment as Z}from"react/jsx-runtime";import{useWindowSize as ae,Box as i,Spinner as me,Text as e,ScrollView as we,Tabs as ye,Tab as be,ScrollBar as Ce,useApp as ke,useInput as xe,Dialog as ee}from"@visulima/tui";import{useSyncExternalStore as Te,useState as L,useRef as W,useMemo as Se,useCallback as de,useEffect as ve}from"react";import{B as se,M as he}from"../packem_chunks/bin.js";import{u as Ae}from"./use-measured-height-DjYgUOKk.js";var Re=Object.defineProperty,Ee=k((s,l)=>Re(s,"name",{value:l,configurable:!0}),"a$1");function Ie({current:s,total:l}){const{columns:h}=ae(),c=h||80,p=l>0?s/l:0,a=`${String(Math.round(p*100))}%`,m=Math.max(10,c-4),b=Math.round(m*p),f=m-b;return t(i,{flexDirection:"column",paddingX:1,children:[t(i,{children:[r(me,{type:"dots"}),t(e,{children:["Checking ",String(l)," catalog dependencies"]}),t(e,{dimColor:!0,children:[String(s),"/",String(l)]})]}),t(i,{children:[r(e,{color:"cyan",children:"━".repeat(b)}),r(e,{dimColor:!0,children:"─".repeat(f)}),t(e,{children:[" ",a]})]})]})}k(Ie,"f$2");Ee(Ie,"CheckProgressApp");var De=Object.defineProperty,G=k((s,l)=>De(s,"name",{value:l,configurable:!0}),"r");const Q=G(s=>{const l=new Map;for(const h of s){const c=l.get(h.catalogName);c?c.push(h):l.set(h.catalogName,[h])}return l},"groupByCatalog"),_=G((s,l,h)=>{let c=s;if(l!=="all"&&(c=l==="security"?c.filter(p=>p.vulnerabilities&&p.vulnerabilities.length>0||p.socketReport&&p.socketReport.alerts.length>0):c.filter(p=>p.updateType===l)),h){const p=h.toLowerCase();c=c.filter(a=>a.packageName.toLowerCase().includes(p))}return c},"filterEntries");class lr{static{k(this,"UpdateStore")}static{G(this,"UpdateStore")}#e;#l=new Set;#t;#i=null;constructor(l,h=null){this.#t=l,h&&(this.#i=new Map(h.recommendations.map(c=>[c.package,c]))),this.#e={aiResult:h,allChecked:!0,applyProgress:null,checkedEntries:new Set(l.map(c=>c.packageName)),entries:l,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",groupedByCatalog:Q(l),phase:"browsing",selectedIndex:0}}getSnapshot=G(()=>this.#e,"getSnapshot");subscribe=G(l=>(this.#l.add(l),()=>{this.#l.delete(l)}),"subscribe");getFilteredEntries(){return _(this.#t,this.#e.filterType,this.#e.filterText)}getRecommendation(l){return this.#i?.get(l)}getCheckedEntries(){return this.#t.filter(l=>this.#e.checkedEntries.has(l.packageName))}setSelectedIndex(l){const h=this.getFilteredEntries(),c=Math.max(0,Math.min(l,h.length-1));c!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:c})}setFocusedPanel(l){l!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:l})}setFilterType(l){if(l!==this.#e.filterType){const h=_(this.#t,l,this.#e.filterText);this.#r({...this.#e,entries:h,filterType:l,groupedByCatalog:Q(h),selectedIndex:0})}}setFilter(l){const h=_(this.#t,this.#e.filterType,l);this.#r({...this.#e,entries:h,filterText:l,groupedByCatalog:Q(h),selectedIndex:0})}setFilterActive(l){if(l!==this.#e.filterActive)if(l)this.#r({...this.#e,filterActive:!0});else{const h=_(this.#t,this.#e.filterType,"");this.#r({...this.#e,entries:h,filterActive:!1,filterText:"",groupedByCatalog:Q(h),selectedIndex:0})}}toggleCheck(l){const h=new Set(this.#e.checkedEntries);h.has(l)?h.delete(l):h.add(l),this.#r({...this.#e,allChecked:h.size===this.#t.length,checkedEntries:h})}checkAll(){this.#r({...this.#e,allChecked:!0,checkedEntries:new Set(this.#t.map(l=>l.packageName))})}uncheckAll(){this.#r({...this.#e,allChecked:!1,checkedEntries:new Set})}toggleAll(){this.#e.allChecked?this.uncheckAll():this.checkAll()}startApply(){const l=this.getCheckedEntries();this.#r({...this.#e,applyProgress:{current:0,total:l.length},phase:"applying"})}updateApplyProgress(l){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:l}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(l){this.#r({...this.#e,error:l,phase:"error"})}#r(l){this.#e=l;for(const h of this.#l)try{h()}catch{}}}var Be=Object.defineProperty,Ne=k((s,l)=>Be(s,"name",{value:l,configurable:!0}),"d");const Pe={major:"red",minor:"yellow",patch:"green"},Le={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},Me={critical:"red",high:"red",low:"gray",medium:"yellow"},je={critical:"red",high:"red",low:"green",medium:"yellow"},Fe={defer:"gray",review:"yellow",skip:"red",update:"green"},Oe=Ne(({changelogUrl:s,entry:l,focused:h,recommendation:c,scrollRef:p})=>{const a=h?"white":"gray";if(!l)return r(i,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:r(e,{dimColor:!0,children:"No package selected"})});const m=Pe[l.updateType]??"white",b=l.vulnerabilities&&l.vulnerabilities.length>0,f=l.socketReport?.score.overall??0,w=l.socketReport?se(f):"gray";return t(i,{borderColor:a,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[r(i,{flexShrink:0,paddingTop:1,paddingX:2,children:r(e,{bold:!0,color:"white",children:l.packageName})}),t(we,{flexGrow:1,flexShrink:1,paddingX:2,ref:p,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[r(e,{}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Current:"})}),r(e,{children:l.currentRange})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Target:"})}),r(e,{children:l.newRange}),t(e,{bold:!0,color:m,children:[" ","(",l.updateType,")"]})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Version:"})}),r(e,{children:l.targetVersion})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Catalog:"})}),r(e,{children:l.catalogName})]}),l.acceptedRisk&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{color:"gray",children:"── "}),r(e,{bold:!0,color:"gray",children:"ACKNOWLEDGED RISK"}),t(i,{flexDirection:"column",paddingLeft:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Reason: "}),r(e,{children:l.acceptedRisk.reason})]}),t(i,{children:[r(e,{dimColor:!0,children:"Accepted: "}),r(e,{children:l.acceptedRisk.acceptedAt.slice(0,10)})]})]})]}),b&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"red",children:"SECURITY"}),r(e,{}),l.vulnerabilities.map(o=>t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{gap:1,children:[t(e,{bold:!0,color:Le[o.severity]??"gray",children:["⚠"," ",o.severity]}),r(e,{bold:!0,children:o.id})]}),r(i,{paddingLeft:2,children:r(e,{children:o.summary})}),t(i,{gap:2,paddingLeft:2,children:[o.cvssScore!==void 0&&t(e,{dimColor:!0,children:["CVSS:",String(o.cvssScore)]}),o.fixedVersions.length>0&&t(e,{dimColor:!0,children:["Fixed in:",o.fixedVersions.join(", ")]})]})]},o.id))]}),l.socketReport&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"cyan",children:"SOCKET.DEV"}),r(e,{}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Overall: "}),t(e,{bold:!0,color:w,children:[String(Math.round(f*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Supply Chain: "}),t(e,{children:[String(Math.round(l.socketReport.score.supplyChain*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Quality: "}),t(e,{children:[String(Math.round(l.socketReport.score.quality*100)),"%"]})]})]}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Maintenance: "}),t(e,{children:[String(Math.round(l.socketReport.score.maintenance*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Vulnerability: "}),t(e,{children:[String(Math.round(l.socketReport.score.vulnerability*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"License: "}),t(e,{children:[l.socketReport.license||"unknown"," ","(",String(Math.round(l.socketReport.score.license*100)),"%)"]})]})]}),l.socketReport.alerts.length>0&&t(i,{flexDirection:"column",marginTop:1,children:[t(e,{bold:!0,color:"yellow",children:["⚠"," ",String(l.socketReport.alerts.length)," ","alert",l.socketReport.alerts.length===1?"":"s",":"]}),l.socketReport.alerts.map(o=>t(i,{gap:1,paddingLeft:2,children:[t(e,{bold:!0,color:Me[o.severity]??"gray",children:["[",o.severity.toUpperCase(),"]"]}),r(e,{children:o.type}),t(e,{dimColor:!0,children:["(",o.category,")"]})]},o.key))]})]}),c&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"AI ANALYSIS"}),r(e,{}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Action: "}),r(e,{bold:!0,color:Fe[c.action]??"white",children:c.action})]}),t(i,{children:[r(e,{dimColor:!0,children:"Risk: "}),r(e,{bold:!0,color:je[c.riskLevel]??"white",children:c.riskLevel})]}),t(i,{children:[r(e,{dimColor:!0,children:"Effort: "}),r(e,{bold:!0,children:c.effort})]})]}),c.reason&&r(i,{marginTop:1,paddingLeft:2,children:r(e,{children:c.reason})}),c.breakingChanges.length>0&&t(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[r(e,{bold:!0,color:"yellow",children:"Breaking changes:"}),c.breakingChanges.map((o,I)=>t(e,{children:[" ","•"," ",o]},String(I)))]})]}),s&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"CHANGELOG"}),r(i,{marginTop:1,paddingLeft:2,children:r(e,{color:"cyan",underline:!0,children:s})})]}),t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"LINKS"}),r(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:t(e,{color:"cyan",underline:!0,children:["https://npmx.dev/",l.packageName]})})]}),!c&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"GUIDANCE"}),t(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[l.updateType==="major"&&t(Z,{children:[t(e,{color:"red",children:["⚠"," ","Major update — likely contains breaking changes."]}),r(e,{dimColor:!0,children:" Review the changelog before updating."}),r(e,{dimColor:!0,children:" Use --changelog to fetch release URLs."})]}),l.updateType==="minor"&&t(Z,{children:[t(e,{color:"yellow",children:["ℹ"," ","Minor update — new features, backward compatible."]}),r(e,{dimColor:!0,children:" Generally safe to update."})]}),l.updateType==="patch"&&t(Z,{children:[t(e,{color:"green",children:["✓"," ","Patch update — bug fixes only."]}),r(e,{dimColor:!0,children:" Safe to update."})]}),!c&&r(e,{dimColor:!0,children:" Use --ai to get AI-powered analysis."})]})]})]})]})},"PackageDetailPanel");var $e=Object.defineProperty,re=k((s,l)=>$e(s,"name",{value:l,configurable:!0}),"f");const Ue={major:"red",minor:"yellow",patch:"green"},Ge=[{id:"all",label:"All"},{id:"major",label:"Major"},{id:"minor",label:"Minor"},{id:"patch",label:"Patch"},{id:"security",label:"Security"}],He=re(({checked:s,entry:l,isSelected:h})=>{const c=Ue[l.updateType]??"white",p=l.vulnerabilities&&l.vulnerabilities.length>0,a=l.socketReport&&l.socketReport.alerts.length>0,m=!!l.acceptedRisk,b=s?"☑":"☐",f=l.socketReport?`${String(Math.round(l.socketReport.score.overall*100))}%`:"",w=l.socketReport?se(l.socketReport.score.overall):"gray";return t(i,{flexShrink:0,height:1,children:[r(e,{children:h?">":" "}),t(e,{color:s?"white":"gray",children:[" ",b," "]}),p||a?r(e,{color:m?"gray":"red",children:m?"✓ ":"⚠ "}):r(e,{children:" "}),r(i,{flexGrow:1,children:t(e,{bold:h,inverse:h,wrap:"truncate",children:[l.packageName,m?" [ack]":""]})}),f&&t(e,{color:w,children:[" ",f]}),t(e,{dimColor:!0,children:[" ",l.currentRange]}),t(e,{dimColor:!0,children:[" ","→"," "]}),t(e,{children:[l.newRange," "]}),r(e,{bold:!0,color:c,children:l.updateType})]})},"PackageRow"),Ve=re(({count:s,name:l})=>t(i,{flexShrink:0,height:1,marginTop:1,children:[t(e,{dimColor:!0,children:["▼"," "]}),r(e,{bold:!0,color:"white",children:l.toUpperCase()}),t(e,{dimColor:!0,children:[" ","(",s,")"]})]}),"CatalogHeader"),qe=re(({checkedEntries:s,entries:l,filterActive:h,filteredOutCount:c,filterText:p,filterType:a,focused:m,groupedByCatalog:b,isDryRun:f,onViewportHeightChange:w,scrollOffset:o,selectedIndex:I,totalCatalogEntries:D,totalChecked:v,totalEntries:H,viewportHeight:M})=>{const j=m?"white":"gray",{measuredHeight:y,ref:A}=Ae(M,w);let F=0,S=0,B=0,R=0;for(const g of l)g.updateType==="major"?F++:g.updateType==="minor"?S++:B++,(g.vulnerabilities&&g.vulnerabilities.length>0||g.socketReport&&g.socketReport.alerts.length>0)&&R++;const x=[];F>0&&x.push(`${F} major`),S>0&&x.push(`${S} minor`),B>0&&x.push(`${B} patch`),R>0&&x.push(`${R} vulnerable`);const N=x.length>0?` (${x.join(", ")})`:"";let T=0;for(const g of l)s.has(g.packageName)&&T++;const C=[];let V=0;for(const[g,E]of b){C.push(r(Ve,{count:E.length,name:g},`hdr-${g}`));for(const $ of E){const P=V;C.push(r(He,{checked:s.has($.packageName),entry:$,isSelected:P===I},$.packageName)),V++}}let O=0;for(const[,g]of b)O+=2+g.length;const q=O>y&&y>0;return t(i,{borderColor:j,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[t(i,{flexShrink:0,gap:1,paddingX:1,children:[r(e,{bold:!0,inverse:!0,children:" VIS "}),t(e,{wrap:"truncate",children:[H,v>0?`/${v}`:""," ","outdated",N,D>v?` · ${D-v} dupes`:""]}),!f&&T>0&&t(e,{dimColor:!0,children:[" ","—",T," ","selected"]})]}),r(i,{flexShrink:0,paddingX:1,paddingY:1,children:r(ye,{isFocused:m,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:k(()=>{},"onChange"),showIndex:!1,value:a,children:Ge.map(({id:g,label:E})=>r(be,{name:g,children:E},g))})}),h&&t(i,{flexShrink:0,paddingX:1,children:[r(e,{bold:!0,color:"white",children:"/ "}),r(e,{children:p}),r(e,{inverse:!0,children:" "})]}),c>0&&r(i,{flexShrink:0,paddingX:1,children:t(e,{color:"yellow",children:["⚠"," ",c," ","package",c===1?"":"s"," ","filtered out by target constraint — press"," ",r(e,{bold:!0,color:"white",children:"f"})," ","to view"]})}),t(i,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:A,children:[r(i,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:r(i,{flexDirection:"column",marginTop:-o,children:C})}),q&&r(i,{flexShrink:0,marginLeft:1,marginRight:1,children:r(Ce,{contentHeight:O,placement:"inset",scrollOffset:o,style:"block",viewportHeight:y})})]},`list-${a}-${p}`)]})},"PackageListPanel");var Ke=Object.defineProperty,Xe=k((s,l)=>Ke(s,"name",{value:l,configurable:!0}),"K");const Ye=100,ze=40,We=10,Qe=[],ir=Xe(({autoExitSeconds:s=0,changelogUrls:l,checkedCount:h=0,filteredOutEntries:c=Qe,isDryRun:p,store:a,totalCatalogEntries:m=0})=>{const{exit:b}=ke(),{columns:f,rows:w}=ae(),o=Te(a.subscribe,a.getSnapshot),[I,D]=L(!1),[v,H]=L(!1),M=W(null),j=W(null),y=W(null),A=W(null),[F,S]=L(0),[B,R]=L(!1),[x,N]=L(!1),T=Se(()=>a.getFilteredEntries(),[o.entries,o.filterType,o.filterText]),C=T[o.selectedIndex]??null,V=C?a.getRecommendation(C.packageName):void 0,O=C&&l?l.get(C.packageName):void 0,q=de(n=>{let d=0,u=0;for(const[,Y]of o.groupedByCatalog){d+=2;for(let z=0;z<Y.length;z++){if(u===n)return d;d+=1,u++}}return d},[o.groupedByCatalog]),g=Math.max(1,w-8-(o.filterActive?1:0)),[E,$]=L(g),P=E>0?E:g,U=de(n=>{const d=q(n);S(u=>d>u+P-2?Math.max(0,d-P+2):d<u+1?Math.max(0,d-1):u)},[q,P]);if(ve(()=>{y.current?.scrollToTop()},[C?.packageName]),xe((n,d)=>{if(n==="c"&&d.ctrl){b();return}if(!x){if(v){d.escape||n==="f"||n==="q"?H(!1):d.downArrow||n==="j"?j.current?.scrollBy(1):(d.upArrow||n==="k")&&j.current?.scrollBy(-1);return}if(B){n==="u"||d.return?(R(!1),a.startApply(),b(a.getCheckedEntries())):d.escape||n==="q"?R(!1):d.downArrow||n==="j"?A.current?.scrollBy(1):d.upArrow||n==="k"?A.current?.scrollBy(-1):d.pageDown?A.current?.scrollBy(5):d.pageUp&&A.current?.scrollBy(-5);return}if(I){d.escape||n==="?"?D(!1):n==="q"?(D(!1),N(!0)):d.downArrow||n==="j"?M.current?.scrollBy(1):(d.upArrow||n==="k")&&M.current?.scrollBy(-1);return}if(n==="?"){D(!0);return}if(n==="q"){N(!0);return}if(d.tab){a.setFocusedPanel(o.focusedPanel==="list"?"detail":"list");return}if(o.focusedPanel==="list"&&(d.leftArrow||d.rightArrow)){const u=["all","major","minor","patch","security"],Y=u.indexOf(o.filterType),z=d.rightArrow?(Y+1)%u.length:(Y-1+u.length)%u.length;S(0),y.current?.scrollToTop(),a.setFilterType(u[z]);return}if(n==="f"&&c.length>0){H(u=>!u);return}if(o.filterActive){if(d.escape){a.setFilterActive(!1);return}if(d.return){a.setFilterActive(!1);return}if(d.backspace){S(0),a.setFilter(o.filterText.slice(0,-1));return}if(n&&!d.ctrl&&!d.meta){S(0),a.setFilter(o.filterText+n);return}return}if(o.focusedPanel==="list"){if(d.downArrow||n==="j"){const u=Math.min(o.selectedIndex+1,T.length-1);a.setSelectedIndex(u),U(u);return}if(d.upArrow||n==="k"){const u=Math.max(o.selectedIndex-1,0);a.setSelectedIndex(u),U(u);return}if(d.pageDown){const u=Math.min(o.selectedIndex+10,T.length-1);a.setSelectedIndex(u),U(u);return}if(d.pageUp){const u=Math.max(o.selectedIndex-10,0);a.setSelectedIndex(u),U(u);return}if(d.home){a.setSelectedIndex(0),S(0);return}if(d.end){const u=T.length-1;a.setSelectedIndex(u),U(u);return}if(n===" "||d.return){C&&a.toggleCheck(C.packageName);return}if(n==="a"){a.toggleAll();return}if(n==="/"){a.setFilterActive(!0);return}if(n==="u"&&!p&&o.checkedEntries.size>0){R(!0);return}if(d.rightArrow){a.setFocusedPanel("detail");return}return}if(o.focusedPanel==="detail"){if(d.escape||d.leftArrow){a.setFocusedPanel("list");return}if(d.downArrow||n==="j"){y.current?.scrollBy(1);return}if(d.upArrow||n==="k"){y.current?.scrollBy(-1);return}if(d.pageDown){y.current?.scrollBy(10);return}if(d.pageUp){y.current?.scrollBy(-10);return}if(d.home){y.current?.scrollToTop();return}d.end&&y.current?.scrollToBottom()}}},{isActive:!0}),f<ze||w<We)return r(i,{alignItems:"center",height:w,justifyContent:"center",width:f,children:t(e,{color:"yellow",children:["Terminal too small (",f,"x",w,")"]})});const ue=f>=Ye,K=[t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"q"}),r(e,{dimColor:!0,children:"QUIT"})]},"q"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"?"}),r(e,{dimColor:!0,children:"HELP"})]},"?"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"↑↓"}),r(e,{dimColor:!0,children:"NAV"})]},"nav"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"Space"}),r(e,{dimColor:!0,children:"CHECK"})]},"sp"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"a"}),r(e,{dimColor:!0,children:"ALL"})]},"a")];!p&&o.checkedEntries.size>0&&K.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"green",children:"u"}),r(e,{dimColor:!0,children:"APPLY"})]},"u")),c.length>0&&K.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"yellow",children:"f"}),t(e,{dimColor:!0,children:["FILTERED (",c.length,")"]})]},"fo")),K.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"←→"}),r(e,{dimColor:!0,children:"FILTER"})]},"lr"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"/"}),r(e,{dimColor:!0,children:"SEARCH"})]},"f"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"Tab"}),r(e,{dimColor:!0,children:"PANEL"})]},"t"));const te=r(i,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:r(i,{flexWrap:"wrap",gap:2,paddingX:1,children:K})}),le=t(ee,{footer:t(e,{dimColor:!0,children:[r(e,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",r(e,{bold:!0,color:"white",children:"?"}),"/",r(e,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:M,title:"KEYBOARD SHORTCUTS",visible:I,width:52,children:[t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"NAVIGATION"})]}),t(i,{children:[r(i,{width:24,children:t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","↑","/k"]}),r(e,{dimColor:!0,children:" Move up"})]})}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","↓","/j"]}),r(e,{dimColor:!0,children:" Move down"})]})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","Tab"]}),r(e,{dimColor:!0,children:" Switch panel"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","→","/","←"]}),r(e,{dimColor:!0,children:" Focus detail/list"})]})]}),t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"SELECTION"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","Space"]}),r(e,{dimColor:!0,children:" Toggle check on package"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","a"]}),r(e,{dimColor:!0,children:" Toggle check all"})]})]}),t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"FILTERS"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","←→"]}),r(e,{dimColor:!0,children:" Switch filter tab"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","/"]}),r(e,{dimColor:!0,children:" Text filter"})]}),c.length>0&&t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","f"]}),r(e,{dimColor:!0,children:" View filtered-out packages"})]})]}),t(i,{flexDirection:"column",children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"ACTIONS"})]}),!p&&t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","u"]}),r(e,{dimColor:!0,children:" Apply selected updates"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","q"]}),r(e,{dimColor:!0,children:" Quit"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","?"]}),r(e,{dimColor:!0,children:" Toggle help"})]})]})]}),X=a.getCheckedEntries(),J=X.filter(n=>n.updateType==="major").length,pe=t(i,{alignItems:"center",flexDirection:"column",children:[J>0&&r(i,{marginBottom:1,marginTop:1,children:t(e,{color:"yellow",children:["⚠"," ",J," ","major update",J===1?"":"s"," ","— review breaking changes"]})}),t(e,{dimColor:!0,children:["Press"," ",r(e,{bold:!0,color:"white",children:"u"})," ","or"," ",r(e,{bold:!0,color:"white",children:"Enter"})," ","to confirm,"," ",r(e,{bold:!0,color:"white",children:"Esc"})," ","to cancel"]})]}),ie=r(ee,{footer:pe,scrollRef:A,title:`Apply ${X.length} update${X.length===1?"":"s"}?`,visible:B,width:70,children:X.map(n=>t(i,{gap:1,children:[t(e,{children:[" ",n.packageName]}),t(e,{dimColor:!0,children:[n.currentRange," ","→"," ",n.newRange]}),r(e,{bold:!0,color:n.updateType==="major"?"red":n.updateType==="minor"?"yellow":"green",children:n.updateType})]},n.packageName))}),oe=c.length>0?r(ee,{footer:t(e,{dimColor:!0,children:[r(e,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",r(e,{bold:!0,color:"white",children:"f"}),"/",r(e,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:j,title:`${c.length} PACKAGE${c.length===1?"":"S"} FILTERED BY TARGET`,visible:v,width:70,children:t(i,{flexDirection:"column",children:[r(i,{marginBottom:1,children:t(e,{dimColor:!0,children:["These packages have newer versions available but are excluded by the current target constraint. Use"," ",r(e,{bold:!0,color:"white",children:"--target latest"})," ","to include them."]})}),c.map(n=>t(i,{gap:1,children:[t(e,{children:[" ",n.packageName]}),t(e,{dimColor:!0,children:[n.currentRange," ","→"," ",n.newRange]}),r(e,{bold:!0,color:n.updateType==="major"?"red":n.updateType==="minor"?"yellow":"green",children:n.updateType})]},n.packageName))]})}):null,ne=r(qe,{checkedEntries:o.checkedEntries,entries:T,filterActive:o.filterActive,filteredOutCount:c.length,filterText:o.filterText,filterType:o.filterType,focused:o.focusedPanel==="list",groupedByCatalog:o.groupedByCatalog,isDryRun:p,onViewportHeightChange:$,scrollOffset:F,selectedIndex:o.selectedIndex,totalCatalogEntries:m,totalChecked:h,totalEntries:T.length,viewportHeight:P}),ce=r(Oe,{changelogUrl:O,entry:C,focused:o.focusedPanel==="detail",recommendation:V,scrollRef:y});if(ue){const n=Math.floor(f*.35);return t(i,{flexDirection:"column",height:w,width:f,children:[t(i,{flexDirection:"row",flexGrow:1,children:[r(i,{flexGrow:1,children:ne}),r(i,{width:n,children:ce})]}),te,ie,oe,r(he,{autoExitSeconds:s||3,onCancel:k(()=>{N(!1)},"onCancel"),visible:x}),le]})}const ge=Math.floor(w*.55);return t(i,{flexDirection:"column",height:w,width:f,children:[r(i,{height:ge,children:ne}),r(i,{flexGrow:1,children:ce}),te,ie,oe,r(he,{autoExitSeconds:s||3,onCancel:k(()=>{N(!1)},"onCancel"),visible:x}),le]})},"VisUpdateApp");export{ir as B,lr as U,Ie as f};
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var r=(t,e)=>c(t,"name",{value:e,configurable:!0});var p=Object.defineProperty,a=r((t,e)=>p(t,"name",{value:e,configurable:!0}),"t");function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}r(f,"getDefaultExportFromCjs");a(f,"getDefaultExportFromCjs");function l(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}r(l,"getDefaultExportFromNamespaceIfPresent");a(l,"getDefaultExportFromNamespaceIfPresent");function s(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")&&Object.keys(t).length===1?t.default:t}r(s,"getDefaultExportFromNamespaceIfNotNamed");a(s,"getDefaultExportFromNamespaceIfNotNamed");function m(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var o=a(r(function n(){var u=!1;try{u=this instanceof n}catch{}return u?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)},"a"),"a");o.prototype=e.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var u=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:a(function(){return t[n]},"get")})}),o}r(m,"getAugmentedNamespace");a(m,"getAugmentedNamespace");export{f as g};