@visulima/vis 3.0.1 → 3.0.3

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 (90) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE.md +33 -22
  3. package/dashboard/dist/index.html +12 -12
  4. package/dist/bin.js +1 -1
  5. package/dist/binx.js +1 -1
  6. package/dist/packem_chunks/CONFIG_FILES.js +1 -1
  7. package/dist/packem_chunks/bloom-status.js +1 -1
  8. package/dist/packem_chunks/bloom-sync.js +1 -1
  9. package/dist/packem_chunks/catalog.js +2 -2
  10. package/dist/packem_chunks/cli-exec.js +1 -1
  11. package/dist/packem_chunks/cli-main.js +168 -170
  12. package/dist/packem_chunks/doctor-probe.js +2 -2
  13. package/dist/packem_chunks/fix.js +5 -5
  14. package/dist/packem_chunks/handler13.js +1 -1
  15. package/dist/packem_chunks/handler14.js +1 -1
  16. package/dist/packem_chunks/handler15.js +1 -1
  17. package/dist/packem_chunks/handler19.js +1 -1
  18. package/dist/packem_chunks/handler2.js +1 -1
  19. package/dist/packem_chunks/handler20.js +1 -1
  20. package/dist/packem_chunks/handler21.js +1 -1
  21. package/dist/packem_chunks/handler23.js +1 -1
  22. package/dist/packem_chunks/handler24.js +1 -1
  23. package/dist/packem_chunks/handler26.js +1 -1
  24. package/dist/packem_chunks/handler28.js +1 -1
  25. package/dist/packem_chunks/handler3.js +1 -1
  26. package/dist/packem_chunks/handler50.js +4 -4
  27. package/dist/packem_chunks/handler53.js +1 -1
  28. package/dist/packem_chunks/handler54.js +1 -1
  29. package/dist/packem_chunks/handler55.js +1 -1
  30. package/dist/packem_chunks/handler58.js +1 -1
  31. package/dist/packem_chunks/handler59.js +1 -1
  32. package/dist/packem_chunks/handler6.js +5 -5
  33. package/dist/packem_chunks/handler60.js +1 -1
  34. package/dist/packem_chunks/handler61.js +7 -7
  35. package/dist/packem_chunks/handler62.js +1 -1
  36. package/dist/packem_chunks/handler63.js +1 -1
  37. package/dist/packem_chunks/handler64.js +2 -2
  38. package/dist/packem_chunks/handler65.js +2 -2
  39. package/dist/packem_chunks/handler66.js +1 -1
  40. package/dist/packem_chunks/handler67.js +25 -24
  41. package/dist/packem_chunks/handler68.js +153 -25
  42. package/dist/packem_chunks/handler69.js +10 -153
  43. package/dist/packem_chunks/handler70.js +22 -10
  44. package/dist/packem_chunks/handler71.js +4 -4
  45. package/dist/packem_chunks/handler72.js +3 -3
  46. package/dist/packem_chunks/handler73.js +6 -6
  47. package/dist/packem_chunks/handler74.js +1 -1
  48. package/dist/packem_chunks/handler75.js +1 -1
  49. package/dist/packem_chunks/handler76.js +1 -1
  50. package/dist/packem_chunks/handler77.js +40 -40
  51. package/dist/packem_chunks/handler78.js +20 -20
  52. package/dist/packem_chunks/heal.js +4 -4
  53. package/dist/packem_chunks/help-command.js +5 -5
  54. package/dist/packem_chunks/index4.js +6 -8
  55. package/dist/packem_chunks/index6.js +5 -5
  56. package/dist/packem_chunks/list.js +1 -1
  57. package/dist/packem_chunks/prompts.js +1 -1
  58. package/dist/packem_chunks/prune.js +1 -1
  59. package/dist/packem_chunks/run.js +1 -1
  60. package/dist/packem_chunks/shell-runner.js +1 -1
  61. package/dist/packem_chunks/status.js +1 -1
  62. package/dist/packem_chunks/sync.js +1 -1
  63. package/dist/packem_chunks/tar.js +3 -3
  64. package/dist/packem_shared/{advisories-CyDqzi5j.js → advisories-0ScpWAHV.js} +1 -1
  65. package/dist/packem_shared/{affected-selection-DPQR-Bd3.js → affected-selection-BMoQWuHl.js} +1 -1
  66. package/dist/packem_shared/{ai-fix-6nXZbecQ.js → ai-fix-CKN1JGRh.js} +1 -1
  67. package/dist/packem_shared/{bin-wafzkjaB.js → bin-CN4heKmb.js} +1 -1
  68. package/dist/packem_shared/{cyclonedx-C_ezHg8b.js → cyclonedx-B1vzerwP.js} +1 -1
  69. package/dist/packem_shared/{docker-Br_iFmI-.js → docker-Bex05Qcn.js} +16 -16
  70. package/dist/packem_shared/giget-D8Kwb0kD.js +2 -0
  71. package/dist/packem_shared/index.server-BAjDJSEu.js +2 -0
  72. package/dist/packem_shared/main-BP-w-K-6.js +1 -0
  73. package/dist/packem_shared/{osv-bloom-5wDAoZ1e.js → osv-bloom-JYIWcH3F.js} +1 -1
  74. package/dist/packem_shared/{package-version-BJkg7-6H.js → package-version-CJxZ_B7G.js} +3 -3
  75. package/dist/packem_shared/{project-name-filter-BeREbPMI.js → project-name-filter-DsrVo0MY.js} +1 -1
  76. package/dist/packem_shared/{resolve-explicit-COmP7eqr.js → resolve-explicit-DYaHAVDg.js} +1 -1
  77. package/dist/packem_shared/{s1ngularity-RZOHbGrE.js → s1ngularity-C8sva2SO.js} +1 -1
  78. package/dist/packem_shared/{scan-progress-C9nMDLis.js → scan-progress-5uTRdC1G.js} +2 -2
  79. package/dist/packem_shared/{spinner-CbJfWYwB.js → spinner-BM_0Bj6x.js} +1 -1
  80. package/dist/packem_shared/{tabs-BilwonkM.js → tabs-UDYQ3tqt.js} +1 -1
  81. package/dist/packem_shared/target-merge-B4No-LHM.js +4 -0
  82. package/dist/packem_shared/{typosquats-D8ppc5kr.js → typosquats-Cdsnf6aN.js} +1 -1
  83. package/dist/packem_shared/{vis-update-app-ngwL2mRv.js → vis-update-app-zqSa2clT.js} +1 -1
  84. package/dist/packem_shared/{vis-user-error-jhNwmkZp.js → vis-user-error-Dkc97rGY.js} +1 -1
  85. package/index.js +26 -26
  86. package/package.json +14 -14
  87. package/dist/packem_shared/giget-CVyyR7x8.js +0 -2
  88. package/dist/packem_shared/index.server-CwSgbeN7.js +0 -2
  89. package/dist/packem_shared/main-BjJN8kWj.js +0 -1
  90. package/dist/packem_shared/target-merge-D1xbylFw.js +0 -4
@@ -1,4 +1,4 @@
1
- import{createRequire as gt}from"node:module";import{J as qe,r as _,F as M,D as Ke,X as K,q as vt}from"../packem_shared/index.server-CwSgbeN7.js";import{e as L,z,v as wt,l as Se}from"../packem_shared/index-DHD8wb6Z.js";import{m as kt}from"./ts-loader.js";import{O as bt,an as Rt,c as me,C as Ce}from"./cli-main.js";import{L as X,G as Et,H as xt,I as At,l as St,r as Ct,c as Tt,k as It,J as Ot,K as ze,R as V,E as he,m as H,n as Ye,M as _t,t as F,N as Nt,O as jt,o as Dt,s as Ut}from"./catalog.js";import{i as le}from"../packem_shared/index-BjdW45xX.js";import{v as Bt,r as Lt,f as Te}from"../packem_shared/ai-analysis-DSQQDFU9.js";import{p as Pt,a as Vt,s as Je}from"../packem_shared/pm-runner-de-jCq8q.js";import{a as Mt,r as Ft}from"../packem_shared/command-runtime-CiLVo4ED.js";import{r as Gt,a as Ht,p as Wt}from"../packem_shared/resolve-explicit-COmP7eqr.js";import{s as qt}from"../packem_shared/min-release-age-ChzTC7_I.js";import{s as Kt}from"../packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js";import{r as zt,s as Yt}from"../packem_shared/typosquats-D8ppc5kr.js";import{U as Jt,V as Xt,C as Ie,e as Qt}from"../packem_shared/vis-update-app-ngwL2mRv.js";import{h as Xe,P as Qe}from"../packem_shared/peer-warnings-CmYSxvql.js";import{p as Ze}from"../packem_shared/utils-DQFHJn72.js";import{L as Zt}from"../packem_shared/index-BisalDCf.js";import{y as U}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{s as ne}from"../packem_shared/index-B4AjSxHU.js";import{r as nn,q as sn}from"../packem_shared/advisories-CyDqzi5j.js";import{U as rn}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";let yt;const $t=e=>(yt??=gt(import.meta.url))(e),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,He=e=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[t,n]=ee.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ee.getBuiltinModule(e)}return $t(e)},{createInterface:We}=He("node:readline"),{existsSync:en,realpathSync:tn}=He("node:fs"),on=e=>{const t=[];for(const n of e.filters)t.push("--filter",n);return e.workspaceRoot&&t.push("--filter","."),t.push("update"),e.latest&&t.push("--latest"),e.recursive&&t.push("--recursive"),e.interactive&&t.push("--interactive"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.noOptional&&t.push("--no-optional"),e.noSave&&t.push("--no-save"),t.push(...e.packages),{args:t,bin:"pnpm"}},an=e=>{const t=[];return e.filters.length>0&&t.push("workspace",e.filters[0]),t.push("upgrade"),e.latest&&t.push("--latest"),t.push(...e.packages),{args:t,bin:"yarn"}},cn=e=>{const t=[];if(e.filters.length>0||e.recursive){t.push("workspaces","foreach","--all");for(const n of e.filters)t.push("--include",n)}return t.push("up"),e.interactive&&t.push("--interactive"),t.push(...e.packages),{args:t,bin:"yarn"}},ln=(e,t)=>{const n=["update"];e.latest&&t.push("npm does not support --latest flag. Packages will be updated within their semver range."),e.interactive&&t.push("npm does not support --interactive mode.");for(const s of e.filters)n.push("--workspace",s);return e.recursive&&n.push("--workspaces"),e.workspaceRoot&&n.push("--include-workspace-root"),e.dev&&n.push("--dev"),e.prod&&n.push("--production"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"npm"}},dn=e=>{const t=["update"];e.latest&&t.push("--latest");for(const n of e.filters)t.push("--filter",n);return t.push(...e.packages),{args:t,bin:"bun"}},un=(e,t)=>{const n=["outdated","--update"];return e.latest&&n.push("--latest"),e.interactive&&n.push("--interactive"),e.filters.length>0&&t.push("deno outdated has no --filter flag; ignoring."),(e.dev||e.prod)&&t.push("deno outdated has no --dev / --prod flags; dev/prod is governed by deno.json."),e.noOptional&&t.push("deno outdated has no --no-optional flag; ignoring."),e.noSave&&t.push("deno outdated has no --no-save flag; ignoring."),n.push(...e.packages),{args:n,bin:"deno"}},fn=(e,t,n)=>{const s=[];if(n.global&&e!=="aube"&&e!=="deno")return{command:{args:["update","--global",...n.packages],bin:"npm"},warnings:s};let i;switch(e){case"aube":{const r=Pt(n);i={args:r.args,bin:r.bin},s.push(...r.warnings);break}case"bun":{i=dn(n);break}case"deno":{i=un(n,s);break}case"npm":{i=ln(n,s);break}case"pnpm":{i=on(n);break}case"yarn":{i=t.startsWith("1.")?an(n):cn(n);break}default:{const r=e;throw new Error(`Unsupported package manager: ${String(r)}`)}}return{command:i,warnings:s}},et=e=>{const t=e.indexOf("@");return t<=0?e:e.slice(0,t)},pn=e=>{switch(e){case"docker":case"docker-compose":return"docker";case"github-actions":return"actions";case"gitlab-ci":return"gitlab";default:return}},mn=(e,t)=>{const n=[".github/dependabot.yml",".github/dependabot.yaml"];for(const s of n){const i=L(e,s);if(!U(i))continue;let r;try{r=Zt(z(i))}catch{continue}if(r?.updates){for(const o of r.updates){const a=pn(o["package-ecosystem"]);if(!(!a||!Array.isArray(o.ignore)))for(const p of o.ignore){const c=p["dependency-name"];typeof c=="string"&&c.length>0&&t[a].add(et(c))}}return}}},hn=Object.freeze({"docker-compose":"docker",dockerfile:"docker","github-actions":"actions",gitlabci:"gitlab","gitlabci-include":"gitlab"}),gn=Object.freeze({docker:"docker","github-tags":"actions"}),ge=(e,t)=>{if(t)for(const n of t)typeof n=="string"&&n.length>0&&e.add(et(n))},yn=e=>{let t="",n=0;const{length:s}=e;let i=!1,r="";for(;n<s;){const o=e[n]??"";if(i){if(t+=o,o==="\\"&&n+1<s){t+=e[n+1]??"",n+=2;continue}o===r&&(i=!1),n+=1;continue}if(o==='"'||o==="'"){i=!0,r=o,t+=o,n+=1;continue}if(o==="/"&&e[n+1]==="/"){for(;n<s&&e[n]!==`
1
+ import{createRequire as gt}from"node:module";import{J as qe,b as _,F as M,q as Ke,X as K,j as vt}from"../packem_shared/index.server-BAjDJSEu.js";import{e as L,z,v as wt,l as Se}from"../packem_shared/index-DHD8wb6Z.js";import{m as kt}from"./ts-loader.js";import{O as bt,an as Rt,c as me,d as Ce}from"./cli-main.js";import{L as X,G as Et,H as xt,I as At,l as St,r as Ct,c as Tt,k as It,J as Ot,K as ze,R as V,E as he,m as H,n as Ye,M as _t,t as F,N as Nt,O as jt,o as Dt,s as Ut}from"./catalog.js";import{i as le}from"../packem_shared/index-BjdW45xX.js";import{v as Bt,r as Lt,f as Te}from"../packem_shared/ai-analysis-DSQQDFU9.js";import{p as Pt,a as Vt,s as Je}from"../packem_shared/pm-runner-de-jCq8q.js";import{a as Mt,r as Ft}from"../packem_shared/command-runtime-CiLVo4ED.js";import{r as Gt,a as Ht,p as Wt}from"../packem_shared/resolve-explicit-DYaHAVDg.js";import{s as qt}from"../packem_shared/min-release-age-ChzTC7_I.js";import{s as Kt}from"../packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js";import{r as zt,s as Yt}from"../packem_shared/typosquats-Cdsnf6aN.js";import{U as Jt,V as Xt,C as Ie,e as Qt}from"../packem_shared/vis-update-app-zqSa2clT.js";import{h as Xe,P as Qe}from"../packem_shared/peer-warnings-CmYSxvql.js";import{p as Ze}from"../packem_shared/utils-DQFHJn72.js";import{L as Zt}from"../packem_shared/index-BisalDCf.js";import{y as U}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{s as ne}from"../packem_shared/index-B4AjSxHU.js";import{r as nn,q as sn}from"../packem_shared/advisories-0ScpWAHV.js";import{U as rn}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";let yt;const $t=e=>(yt??=gt(import.meta.url))(e),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,He=e=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[t,n]=ee.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ee.getBuiltinModule(e)}return $t(e)},{createInterface:We}=He("node:readline"),{existsSync:en,realpathSync:tn}=He("node:fs"),on=e=>{const t=[];for(const n of e.filters)t.push("--filter",n);return e.workspaceRoot&&t.push("--filter","."),t.push("update"),e.latest&&t.push("--latest"),e.recursive&&t.push("--recursive"),e.interactive&&t.push("--interactive"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.noOptional&&t.push("--no-optional"),e.noSave&&t.push("--no-save"),t.push(...e.packages),{args:t,bin:"pnpm"}},an=e=>{const t=[];return e.filters.length>0&&t.push("workspace",e.filters[0]),t.push("upgrade"),e.latest&&t.push("--latest"),t.push(...e.packages),{args:t,bin:"yarn"}},cn=e=>{const t=[];if(e.filters.length>0||e.recursive){t.push("workspaces","foreach","--all");for(const n of e.filters)t.push("--include",n)}return t.push("up"),e.interactive&&t.push("--interactive"),t.push(...e.packages),{args:t,bin:"yarn"}},ln=(e,t)=>{const n=["update"];e.latest&&t.push("npm does not support --latest flag. Packages will be updated within their semver range."),e.interactive&&t.push("npm does not support --interactive mode.");for(const s of e.filters)n.push("--workspace",s);return e.recursive&&n.push("--workspaces"),e.workspaceRoot&&n.push("--include-workspace-root"),e.dev&&n.push("--dev"),e.prod&&n.push("--production"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"npm"}},dn=e=>{const t=["update"];e.latest&&t.push("--latest");for(const n of e.filters)t.push("--filter",n);return t.push(...e.packages),{args:t,bin:"bun"}},un=(e,t)=>{const n=["outdated","--update"];return e.latest&&n.push("--latest"),e.interactive&&n.push("--interactive"),e.filters.length>0&&t.push("deno outdated has no --filter flag; ignoring."),(e.dev||e.prod)&&t.push("deno outdated has no --dev / --prod flags; dev/prod is governed by deno.json."),e.noOptional&&t.push("deno outdated has no --no-optional flag; ignoring."),e.noSave&&t.push("deno outdated has no --no-save flag; ignoring."),n.push(...e.packages),{args:n,bin:"deno"}},fn=(e,t,n)=>{const s=[];if(n.global&&e!=="aube"&&e!=="deno")return{command:{args:["update","--global",...n.packages],bin:"npm"},warnings:s};let i;switch(e){case"aube":{const r=Pt(n);i={args:r.args,bin:r.bin},s.push(...r.warnings);break}case"bun":{i=dn(n);break}case"deno":{i=un(n,s);break}case"npm":{i=ln(n,s);break}case"pnpm":{i=on(n);break}case"yarn":{i=t.startsWith("1.")?an(n):cn(n);break}default:{const r=e;throw new Error(`Unsupported package manager: ${String(r)}`)}}return{command:i,warnings:s}},et=e=>{const t=e.indexOf("@");return t<=0?e:e.slice(0,t)},pn=e=>{switch(e){case"docker":case"docker-compose":return"docker";case"github-actions":return"actions";case"gitlab-ci":return"gitlab";default:return}},mn=(e,t)=>{const n=[".github/dependabot.yml",".github/dependabot.yaml"];for(const s of n){const i=L(e,s);if(!U(i))continue;let r;try{r=Zt(z(i))}catch{continue}if(r?.updates){for(const o of r.updates){const a=pn(o["package-ecosystem"]);if(!(!a||!Array.isArray(o.ignore)))for(const p of o.ignore){const c=p["dependency-name"];typeof c=="string"&&c.length>0&&t[a].add(et(c))}}return}}},hn=Object.freeze({"docker-compose":"docker",dockerfile:"docker","github-actions":"actions",gitlabci:"gitlab","gitlabci-include":"gitlab"}),gn=Object.freeze({docker:"docker","github-tags":"actions"}),ge=(e,t)=>{if(t)for(const n of t)typeof n=="string"&&n.length>0&&e.add(et(n))},yn=e=>{let t="",n=0;const{length:s}=e;let i=!1,r="";for(;n<s;){const o=e[n]??"";if(i){if(t+=o,o==="\\"&&n+1<s){t+=e[n+1]??"",n+=2;continue}o===r&&(i=!1),n+=1;continue}if(o==='"'||o==="'"){i=!0,r=o,t+=o,n+=1;continue}if(o==="/"&&e[n+1]==="/"){for(;n<s&&e[n]!==`
2
2
  `;)n+=1;continue}if(o==="/"&&e[n+1]==="*"){for(n+=2;n<s&&!(e[n]==="*"&&e[n+1]==="/");)n+=1;n+=2;continue}if(o===","){let a=n+1;for(;a<s&&/\s/.test(e[a]??"");)a+=1;const p=e[a];if(p==="}"||p==="]"){n+=1;continue}}t+=o,n+=1}return t},$n=(e,t)=>{const n=["renovate.json","renovate.json5",".renovaterc",".renovaterc.json"];for(const s of n){const i=L(e,s);if(!U(i))continue;let r;try{const a=z(i);r=JSON.parse(yn(a))}catch{continue}if(!r)continue;if(Array.isArray(r.ignoreDeps))for(const a of["actions","docker","gitlab"])ge(t[a],r.ignoreDeps);const o=[["github-actions","actions"],["dockerfile","docker"],["docker-compose","docker"],["gitlabci","gitlab"],["gitlabci-include","gitlab"]];for(const[a,p]of o){const c=r[a];ge(t[p],c?.ignoreDeps)}if(!Array.isArray(r.packageRules))return;for(const a of r.packageRules){if(a.enabled!==!1)continue;const p=new Set;for(const d of a.matchManagers??[]){const f=hn[d];f&&p.add(f)}for(const d of a.matchDatasources??[]){const f=gn[d];f&&p.add(f)}p.size===0&&(p.add("actions"),p.add("docker"),p.add("gitlab"));const c=[...a.matchPackageNames??[],...a.matchDepNames??[],...a.matchPackagePatterns??[]];for(const d of p)ge(t[d],c)}return}},vn=e=>{const t={actions:new Set,docker:new Set,gitlab:new Set};return mn(e,t),$n(e,t),t},ve=(e,t,n)=>{const s=n[t];if(s.size===0)return!1;if(s.has(e))return!0;for(const i of s)if(/[*?[\]/.+]/.test(i))try{const r=i.replaceAll(/[.+^${}()|]/g,String.raw`\$&`).replaceAll("*",".*").replaceAll("?",".");if(new RegExp(`^${r}$`).test(e))return!0}catch{}return!1},W=e=>{const t=e.trim();if(t==="")return;const n=t.startsWith("v")||t.startsWith("V")?t.slice(1):t,i=(ne.valid(n)?ne.parse(n):void 0)??ne.coerce(n,{includePrerelease:!0});if(i)return{major:i.major,minor:i.minor,normalized:`${String(i.major)}.${String(i.minor)}.${String(i.patch)}${i.prerelease.length>0?`-${i.prerelease.join(".")}`:""}`,patch:i.patch,prerelease:i.prerelease.length>0,raw:t}},wn=(e,t)=>ne.rcompare(e.normalized,t.normalized),we=(e,t,n,s)=>{if(!t&&n!=="latest")return;const i=e.filter(r=>r.prerelease?!1:t?n==="patch"&&(r.major!==t.major||r.minor!==t.minor)||n==="minor"&&r.major!==t.major?!1:ne.gt(r.normalized,t.normalized):!0);if(i.length!==0)return i.toSorted(wn)[0]},ke=(e,t)=>!e||!t?"unknown":t.major!==e.major?"major":t.minor!==e.minor?"minor":t.patch!==e.patch?"patch":"unknown",kn="GitHub Actions",Oe=(e,t)=>`${e}@${t}`,bn=e=>({fixedVersions:e.fixedVersions,id:e.id,severity:e.severity,summary:e.summary}),Rn=(e,t)=>{if(t.length===0)return t;const n=nn(e);if(!en(n))return t;const s=new Map;for(const r of t){const o=r.currentVersion??r.currentRef;o&&s.set(Oe(r.name,o),{name:r.name,version:o})}if(s.size===0)return t;const i=new Map;try{for(const[r,o]of s){const p=sn([o],{ecosystem:kn,workspaceRoot:e}).get(o.name);p&&p.length>0&&i.set(r,p)}}catch{return t}return i.size===0?t:t.map(r=>{const o=r.currentVersion??r.currentRef;if(!o)return r;const a=i.get(Oe(r.name,o));return a?{...r,advisories:a.map(p=>bn(p))}:r})},tt=e=>{if(!e)return{};const t={};for(const n of e.split(",")){const s=/^\s*<([^>]+)>\s*;\s*(.+)$/.exec(n);if(!s)continue;const i=s[1]??"",r=s[2]??"";switch(/rel\s*=\s*"?([^";\s]+)"?/i.exec(r)?.[1]?.toLowerCase()){case"first":{t.first=i;break}case"last":{t.last=i;break}case"next":{t.next=i;break}case"prev":case"previous":{t.previous=i;break}}}return t};class En{token;apiBase;fetchImpl;tagsCache=new Map;commitCache=new Map;constructor(t){this.token=t.token??process.env.GITHUB_TOKEN??process.env.GH_TOKEN,this.apiBase=t.apiBase??"https://api.github.com",this.fetchImpl=t.fetch??fetch}async listTags(t,n){const s=`${t}/${n}`,i=this.tagsCache.get(s);if(i)return i;const r=this.fetchTags(t,n);return this.tagsCache.set(s,r),r}async resolveRef(t,n,s){const i=`${t}/${n}@${s}`,r=this.commitCache.get(i);if(r)return r;const o=this.fetchCommit(t,n,s);return this.commitCache.set(i,o),o}buildHeaders(){const t={Accept:"application/vnd.github+json","User-Agent":"vis-update-actions","X-GitHub-Api-Version":"2022-11-28"};return this.token&&(t.Authorization=`Bearer ${this.token}`),t}async fetchTags(t,n){const s=`${this.apiBase}/repos/${encodeURIComponent(t)}/${encodeURIComponent(n)}/tags?per_page=100`,i={parsed:[],tags:[]},r=[];let o=s,a=0;for(;o&&a<5;){const c=o;let d;try{d=await this.fetchImpl(c,{headers:this.buildHeaders()})}catch{return i}if(!d.ok)return i;let f;try{f=await d.json()}catch{return i}if(!Array.isArray(f))return i;for(const m of f){const g=typeof m.name=="string"?m.name:"",h=typeof m.commit?.sha=="string"?m.commit.sha:"";g!==""&&h!==""&&r.push({name:g,sha:h})}o=tt(d.headers.get("link")).next,a+=1}const p=[];for(const c of r){const d=W(c.name);d&&p.push({...d,sha:c.sha})}return{parsed:p,tags:r}}async fetchCommit(t,n,s){const i=`${this.apiBase}/repos/${encodeURIComponent(t)}/${encodeURIComponent(n)}/commits/${encodeURIComponent(s)}`;try{const r=await this.fetchImpl(i,{headers:this.buildHeaders()});if(!r.ok)return;const o=await r.json();return typeof o.sha!="string"?void 0:{committedAt:o.commit?.committer?.date,sha:o.sha}}catch{return}}}const xn=".github/workflows",An=".github/actions",Sn=/^\s*-?\s*uses:\s*(['"]?)([^'"\s#]+)\1(?:\s*#\s*(.+))?\s*$/,Cn=/^[a-f0-9]{40}$/i,Tn=/actions-up-ignore-next-line(?::\s*(.+))?/i,In=/actions-up-ignore-start/i,On=/actions-up-ignore-end/i,_n=e=>{const t=e.split("/");if(t.length<2)return;const[n,s,...i]=t;if(!(!n||!s))return{owner:n,repo:s,subpath:i.length>0?i.join("/"):void 0}},Nn=(e,t)=>{const n=t.split(/\r?\n/),s=[];let i,r=!1;for(const[o,a]of n.entries()){const p=a??"";if(In.test(p)&&(r=!0),On.test(p)){r=!1;continue}const c=p.trim(),f=c===""||c.startsWith("#")?Tn.exec(p):void 0;if(f){i=f[1]??"actions-up-ignore-next-line";continue}const m=Sn.exec(p);if(!m){i=void 0;continue}const g=m[1]??"",h=g==="'"||g==='"'?g:"",b=m[2]??"",k=m[3]?.trim();if(b.startsWith("./")||b.startsWith("../")||b.startsWith("docker://")){i=void 0;continue}const y=b.lastIndexOf("@");if(y<=0){i=void 0;continue}const A=b.slice(0,y),w=b.slice(y+1),u=_n(A);if(!u){i=void 0;continue}let $=i??(r?"actions-up-ignore-block":void 0);if(k){const l=/^actions-up-ignore(?:-next-line)?(?::\s*(.+))?(?:\s|$)/i.exec(k);l&&($=$??l[1]??"actions-up-ignore")}i=void 0,s.push({file:e,ignoreReason:$,isSha:Cn.test(w),line:o+1,original:`${h}${b}${h}`,owner:u.owner,quote:h,ref:w,repo:u.repo,slug:A,subpath:u.subpath,trailingComment:k&&!$?k:void 0})}return s},_e=e=>e.endsWith(".yml")||e.endsWith(".yaml"),jn=(e,t=[])=>{const n=[],s=new Set,i=a=>{if(s.has(a))return;s.add(a);let p;try{p=z(a)}catch{return}const c=Nn(a,p);n.push(...c)},r=L(e,xn);if(U(r))for(const a of X(r,{includeDirs:!1,includeSymlinks:!1,maxDepth:1}))_e(a.name)&&i(a.path);const o=L(e,An);if(U(o))for(const a of X(o,{includeDirs:!1,includeSymlinks:!1,maxDepth:3}))(a.name==="action.yml"||a.name==="action.yaml")&&i(a.path);for(const a of["action.yml","action.yaml"]){const p=L(e,a);U(p)&&i(p)}for(const a of t){const p=wt(a)?a:L(e,a);if(U(p))for(const c of X(p,{includeDirs:!1,includeSymlinks:!1}))_e(c.name)&&i(c.path)}return n},Dn=40,Un=1440*60*1e3,Bn=new Set(["develop","edge","main","master","stable","trunk"]),Ln=e=>e.length===Dn&&/^[a-f0-9]{40}$/i.test(e)?!1:Bn.has(e.toLowerCase())?!0:W(e)===void 0,Ne=(e,t)=>{for(const n of t)try{if(new RegExp(n).test(e))return!0}catch{if(e.includes(n))return!0}return!1},Pn=(e,t,n,s)=>{const i=s==="sha"||e.isSha,{quote:r}=e;return i?`${r}${e.slug}@${t}${r} # ${n}`:`${r}${e.slug}@${n}${r}`},Vn=async(e,t)=>{const{ignoreRules:n,options:s,references:i,resolverOptions:r}=t,o=[],a=[],p=[];if(i.length===0)return{failed:p,ignored:a,updates:o};const c=new En({apiBase:r?.apiBase,fetch:r?.fetch,token:s.githubToken??r?.token}),d=new Map;for(const y of i){const A=`${y.owner}/${y.repo}`,w=d.get(A)??[];w.push(y),d.set(A,w)}const f=Math.max(1,s.maxConcurrentRequests),m=[...d.keys()];let g=0;const h=async y=>{const A=d.get(y)??[],[w,u]=y.split("/");if(!w||!u)return;let $;try{$=await c.listTags(w,u)}catch{for(const l of A)p.push({file:l.file,reason:`failed to list tags for ${y}`});return}for(const l of A){const S=l.slug;let v;if(l.ignoreReason?v=l.ignoreReason:Ne(S,s.exclude)?v="matched --exclude":s.include.length>0&&!Ne(S,s.include)?v="not matched by --include":s.respectDependabotConfig&&n&&ve(S,"actions",n)&&(v="ignored by dependabot/renovate config"),v){a.push({currentRef:l.ref,currentVersion:l.isSha?l.trailingComment?.replace(/^#\s*/,""):l.ref,ecosystem:"actions",file:l.file,ignored:!0,line:l.line,name:S,newRef:l.ref,newVersion:void 0,original:l.original,reason:v,replacement:l.original,updateType:"unknown"});continue}if(!s.includeBranches&&!l.isSha&&Ln(l.ref)){a.push({currentRef:l.ref,currentVersion:l.ref,ecosystem:"actions",file:l.file,ignored:!0,line:l.line,name:S,newRef:l.ref,newVersion:void 0,original:l.original,reason:"branch reference (use --include-branches)",replacement:l.original,updateType:"unknown"});continue}const C=l.isSha?l.trailingComment?.replace(/^#\s*/,"").split(/\s+/)[0]??"":l.ref,T=W(C);if(l.isSha&&!T&&s.mode!=="latest"){a.push({currentRef:l.ref,currentVersion:void 0,ecosystem:"actions",file:l.file,ignored:!0,line:l.line,name:S,newRef:l.ref,newVersion:void 0,original:l.original,reason:`SHA pin has no version-hint comment; cannot apply --target=${s.mode}`,replacement:l.original,updateType:"unknown"});continue}const E=we($.parsed,T,s.mode);if(!E)continue;if(s.minAgeDays!==void 0){const P=await c.resolveRef(w,u,E.sha),N=P?.committedAt?new Date(P.committedAt).getTime():void 0;if(N&&(Date.now()-N)/Un<s.minAgeDays){a.push({currentRef:l.ref,currentVersion:T?.raw,ecosystem:"actions",file:l.file,ignored:!0,line:l.line,name:S,newRef:l.ref,newVersion:E.raw,original:l.original,reason:`release younger than ${String(s.minAgeDays)} days`,replacement:l.original,updateType:"unknown"});continue}}const I=s.style==="sha"||l.isSha?E.sha:E.raw,O=Pn(l,E.sha,E.raw,s.style);o.push({currentRef:l.ref,currentVersion:T?.raw??l.trailingComment?.replace(/^#\s*/,""),ecosystem:"actions",file:l.file,line:l.line,name:S,newRef:I,newVersion:E.raw,original:l.original,replacement:O,updateType:ke(T,E),url:`https://github.com/${w}/${u}/releases/tag/${E.raw}`})}},b=[];for(let y=0;y<Math.min(f,m.length);y++)b.push((async()=>{for(;g<m.length;){const A=m[g];g+=1,A!==void 0&&await h(A)}})());await Promise.all(b);const k=Rn(e,o);return{failed:p,ignored:a,updates:k}},Mn=e=>e.toSorted((t,n)=>t.file!==n.file?t.file<n.file?-1:1:t.line-n.line),nt=e=>{const t=[],n=[];if(e.length===0)return{applied:t,skipped:n};const s=Mn(e),i=new Map;for(const r of s){const o=i.get(r.file)??[];o.push(r),i.set(r.file,o)}for(const[r,o]of i){let a;try{a=z(r)}catch(m){for(const g of o)n.push({reason:`read failed: ${m.message}`,update:g});continue}const p=a.includes(`\r
3
3
  `)?`\r
4
4
  `:`
@@ -1,4 +1,4 @@
1
- import{createRequire as wt}from"node:module";import{a as x,$ as it,U as yt,v as at,e as P,q as Tt}from"../packem_shared/index-DHD8wb6Z.js";import{y as m,X as E,m as b,v as vt,j as St}from"./catalog.js";import ot from"./index.js";import{R as ct}from"../packem_shared/main-BjJN8kWj.js";import{y as B}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{C as $t}from"./cli-main.js";import{l as At}from"../packem_shared/spinner-CbJfWYwB.js";import{C as dt,D as F,T as lt}from"../packem_shared/symbols-BXDZ_sKt.js";import{r as z,F as C,D,X as L,J as It}from"../packem_shared/index.server-CwSgbeN7.js";import{withEnhancedPath as Mt}from"@visulima/task-runner";let mt;const kt=t=>(mt??=wt(import.meta.url))(t),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,G=t=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,s]=M.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return M.getBuiltinModule(t)}return kt(t)},{readFileSync:bt,writeFileSync:xt,unlinkSync:Ct}=G("node:fs"),{randomBytes:Et}=G("node:crypto"),{availableParallelism:V}=G("node:os");class A extends Error{constructor(e,s){super(e,s),this.name=this.constructor.name}}class Rt extends A{}class T extends A{}class W extends A{}class j extends A{stderr;constructor(e,s,r){super(e,r),this.stderr=s}}class X extends A{}class $ extends A{commandTitle;constructor(e,s,r){super(s,r),this.commandTitle=e}}const ut=t=>t.includes("/"),N=(t,e)=>e?t.toLowerCase():t,jt=(t,e,s,r={})=>{const n=ut(t),a=r.caseInsensitive===!0,c=N(t,a),i=[];for(const o of e){const l=n?x(s,o):it(o);ot(c,N(l,a))&&i.push(o)}return i},_t=(t,e,s,r={})=>{if(!e||e.length===0)return[...t];const n=r.caseInsensitive===!0;return t.filter(a=>{for(const c of e){const i=ut(c)?x(s,a):it(a),o=N(c,n);if(ot(o,N(i,n)))return!1}return!0})},U=t=>typeof t=="object"&&t!==null&&typeof t.title=="string"&&typeof t.task=="function",_=t=>typeof t=="object"&&t!==null&&typeof t.command=="string"&&typeof t.task!="function",Pt=(t,e)=>{const s=x(t,e);return s===""||!s.startsWith("..")&&!at(s)},Ft=(t,e)=>{let s;for(const r of e)Pt(r,t)&&(s===void 0||r.length>s.length)&&(s=r);return s},Nt=async t=>{let e=0,s=0;const r=()=>(e+=1,`pattern-${e}`),n=()=>(s+=1,`cmd-${s}`),a=(o,l,f,d)=>{if(o.perPackage===!0){const u=t.workspacePackages??[],g=new Map;for(const h of f){const p=Ft(h,u)??t.cwd,k=g.get(p)??[];k.push(x(p,h)),g.set(p,k)}for(const h of[...g.keys()].sort()){const p=x(t.cwd,h)||".";d.push({command:o.command,cwd:h,files:g.get(h)??[],id:n(),source:"string",title:`${o.command} — ${p}`})}return}if(o.cwd!==void 0){const u=yt(t.cwd,o.cwd);d.push({command:o.command,cwd:u,files:f,id:n(),source:"string",title:`${o.command} — ${x(t.cwd,u)||"."}`});return}d.push({command:o.command,files:l,id:n(),source:"string",title:o.command})},c=async(o,l,f,d)=>{if(typeof o=="string"){d.push({command:o,files:l,id:n(),source:"string",title:o});return}if(Array.isArray(o)){for(const u of o)await c(u,l,f,d);return}if(_(o)){a(o,l,f,d);return}if(typeof o=="function"){const u=await o([...l]);if(typeof u=="string"){d.push({command:u,files:l,id:n(),source:"function",title:u});return}if(Array.isArray(u)){for(const g of u)if(typeof g=="string")d.push({command:g,files:l,id:n(),source:"function",title:g});else if(_(g))a(g,l,f,d);else if(U(g))d.push({files:l,id:n(),run:g.task,source:"custom",title:g.title});else throw new T("Task function returned an array with an unsupported entry — expected strings, { command, … }, or { title, task }.");return}if(_(u)){a(u,l,f,d);return}if(U(u)){d.push({files:l,id:n(),run:u.task,source:"custom",title:u.title});return}throw new T("Task function returned an unsupported value — expected string, string[], { command, … }, or { title, task }.")}if(U(o)){d.push({files:l,id:n(),run:o.task,source:"custom",title:o.title});return}throw new T("Unsupported task value — expected string, string[], function, { command, … }, or { title, task }.")},i=[];for(const[o,l]of Object.entries(t.config)){const f=jt(o,t.files,t.cwd,{caseInsensitive:t.caseInsensitive===!0});if(f.length===0)continue;const d=t.relative?f.map(g=>x(t.cwd,g)):f,u=[];await c(l,d,f,u),u.length!==0&&i.push({commands:u,files:d,id:r(),pattern:o,title:`${o} — ${f.length} file${f.length===1?"":"s"}`})}return i},Ot=async t=>{if(t.config!==void 0)return t.config;throw new T(`No staged config provided. Add \`staged\` to your vis.config.ts:
1
+ import{createRequire as wt}from"node:module";import{a as x,$ as it,U as yt,v as at,e as P,q as Tt}from"../packem_shared/index-DHD8wb6Z.js";import{y as m,X as E,m as b,v as vt,j as St}from"./catalog.js";import ot from"./index.js";import{x as ct}from"../packem_shared/main-BP-w-K-6.js";import{y as B}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{d as $t}from"./cli-main.js";import{l as At}from"../packem_shared/spinner-BM_0Bj6x.js";import{C as dt,D as F,T as lt}from"../packem_shared/symbols-BXDZ_sKt.js";import{b as z,F as C,q as D,X as L,J as It}from"../packem_shared/index.server-BAjDJSEu.js";import{withEnhancedPath as Mt}from"@visulima/task-runner";let mt;const kt=t=>(mt??=wt(import.meta.url))(t),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,G=t=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,s]=M.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return M.getBuiltinModule(t)}return kt(t)},{readFileSync:bt,writeFileSync:xt,unlinkSync:Ct}=G("node:fs"),{randomBytes:Et}=G("node:crypto"),{availableParallelism:V}=G("node:os");class A extends Error{constructor(e,s){super(e,s),this.name=this.constructor.name}}class Rt extends A{}class T extends A{}class W extends A{}class j extends A{stderr;constructor(e,s,r){super(e,r),this.stderr=s}}class X extends A{}class $ extends A{commandTitle;constructor(e,s,r){super(s,r),this.commandTitle=e}}const ut=t=>t.includes("/"),N=(t,e)=>e?t.toLowerCase():t,jt=(t,e,s,r={})=>{const n=ut(t),a=r.caseInsensitive===!0,c=N(t,a),i=[];for(const o of e){const l=n?x(s,o):it(o);ot(c,N(l,a))&&i.push(o)}return i},_t=(t,e,s,r={})=>{if(!e||e.length===0)return[...t];const n=r.caseInsensitive===!0;return t.filter(a=>{for(const c of e){const i=ut(c)?x(s,a):it(a),o=N(c,n);if(ot(o,N(i,n)))return!1}return!0})},U=t=>typeof t=="object"&&t!==null&&typeof t.title=="string"&&typeof t.task=="function",_=t=>typeof t=="object"&&t!==null&&typeof t.command=="string"&&typeof t.task!="function",Pt=(t,e)=>{const s=x(t,e);return s===""||!s.startsWith("..")&&!at(s)},Ft=(t,e)=>{let s;for(const r of e)Pt(r,t)&&(s===void 0||r.length>s.length)&&(s=r);return s},Nt=async t=>{let e=0,s=0;const r=()=>(e+=1,`pattern-${e}`),n=()=>(s+=1,`cmd-${s}`),a=(o,l,f,d)=>{if(o.perPackage===!0){const u=t.workspacePackages??[],g=new Map;for(const h of f){const p=Ft(h,u)??t.cwd,k=g.get(p)??[];k.push(x(p,h)),g.set(p,k)}for(const h of[...g.keys()].sort()){const p=x(t.cwd,h)||".";d.push({command:o.command,cwd:h,files:g.get(h)??[],id:n(),source:"string",title:`${o.command} — ${p}`})}return}if(o.cwd!==void 0){const u=yt(t.cwd,o.cwd);d.push({command:o.command,cwd:u,files:f,id:n(),source:"string",title:`${o.command} — ${x(t.cwd,u)||"."}`});return}d.push({command:o.command,files:l,id:n(),source:"string",title:o.command})},c=async(o,l,f,d)=>{if(typeof o=="string"){d.push({command:o,files:l,id:n(),source:"string",title:o});return}if(Array.isArray(o)){for(const u of o)await c(u,l,f,d);return}if(_(o)){a(o,l,f,d);return}if(typeof o=="function"){const u=await o([...l]);if(typeof u=="string"){d.push({command:u,files:l,id:n(),source:"function",title:u});return}if(Array.isArray(u)){for(const g of u)if(typeof g=="string")d.push({command:g,files:l,id:n(),source:"function",title:g});else if(_(g))a(g,l,f,d);else if(U(g))d.push({files:l,id:n(),run:g.task,source:"custom",title:g.title});else throw new T("Task function returned an array with an unsupported entry — expected strings, { command, … }, or { title, task }.");return}if(_(u)){a(u,l,f,d);return}if(U(u)){d.push({files:l,id:n(),run:u.task,source:"custom",title:u.title});return}throw new T("Task function returned an unsupported value — expected string, string[], { command, … }, or { title, task }.")}if(U(o)){d.push({files:l,id:n(),run:o.task,source:"custom",title:o.title});return}throw new T("Unsupported task value — expected string, string[], function, { command, … }, or { title, task }.")},i=[];for(const[o,l]of Object.entries(t.config)){const f=jt(o,t.files,t.cwd,{caseInsensitive:t.caseInsensitive===!0});if(f.length===0)continue;const d=t.relative?f.map(g=>x(t.cwd,g)):f,u=[];await c(l,d,f,u),u.length!==0&&i.push({commands:u,files:d,id:r(),pattern:o,title:`${o} — ${f.length} file${f.length===1?"":"s"}`})}return i},Ot=async t=>{if(t.config!==void 0)return t.config;throw new T(`No staged config provided. Add \`staged\` to your vis.config.ts:
2
2
 
3
3
  import { defineConfig } from "@visulima/vis/config";
4
4
 
@@ -1,3 +1,3 @@
1
- import{createRequire as Ne}from"node:module";import{u as W,V as Ce,U as ze,W as Ge,T as $e,X as We,Y as Ve,C as Ue}from"./cli-main.js";import{i as Xe}from"../packem_shared/index-BjdW45xX.js";import{u as p,y as e,X as s,m as o,R as He}from"./catalog.js";import{d as Ke}from"../packem_shared/pm-runner-de-jCq8q.js";import{i as qe,e as le,z as Ye,m as Qe}from"../packem_shared/index-DHD8wb6Z.js";import{y as Ze}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{h as et}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{n as tt,a as ot}from"../packem_shared/tabs-BilwonkM.js";let Re;const Be=i=>(Re??=Ne(import.meta.url))(i),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_e=i=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[t,n]=q.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return q.getBuiltinModule(i)}return Be(i)},{writeFileSync:Je}=_e("node:fs"),rt=(i,{whitespace:t=!0}={})=>i.replace(qe,n=>n.startsWith('"')||n[1]==="*"&&!n.endsWith("*/")?n:t?n.replaceAll(/\S/g," "):""),V=[{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)"}],nt=i=>{const t=le(i,".devcontainer","devcontainer.json");if(!Ze(t))return null;const n=Ye(t),c=rt(n),l=c!==n;let r;try{r=JSON.parse(c)}catch(a){const m=a instanceof Error?a.message:String(a);throw new Error(`Failed to parse ${t}: ${m}`,{cause:a})}return{config:r,hadComments:l}},it=(i,t,n)=>{const c=n?Qe(n):le(i,".devcontainer"),l=n??le(c,"devcontainer.json");et(c),Je(l,`${JSON.stringify(t,null,2)}
1
+ import{createRequire as Ne}from"node:module";import{v as W,V as Ce,U as ze,W as Ge,T as $e,X as We,Y as Ve,d as Ue}from"./cli-main.js";import{i as Xe}from"../packem_shared/index-BjdW45xX.js";import{u as p,y as e,X as s,m as o,R as He}from"./catalog.js";import{d as Ke}from"../packem_shared/pm-runner-de-jCq8q.js";import{i as qe,e as le,z as Ye,m as Qe}from"../packem_shared/index-DHD8wb6Z.js";import{y as Ze}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{h as et}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{n as tt,a as ot}from"../packem_shared/tabs-UDYQ3tqt.js";let Re;const Be=i=>(Re??=Ne(import.meta.url))(i),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_e=i=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[t,n]=q.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return q.getBuiltinModule(i)}return Be(i)},{writeFileSync:Je}=_e("node:fs"),rt=(i,{whitespace:t=!0}={})=>i.replace(qe,n=>n.startsWith('"')||n[1]==="*"&&!n.endsWith("*/")?n:t?n.replaceAll(/\S/g," "):""),V=[{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)"}],nt=i=>{const t=le(i,".devcontainer","devcontainer.json");if(!Ze(t))return null;const n=Ye(t),c=rt(n),l=c!==n;let r;try{r=JSON.parse(c)}catch(a){const m=a instanceof Error?a.message:String(a);throw new Error(`Failed to parse ${t}: ${m}`,{cause:a})}return{config:r,hadComments:l}},it=(i,t,n)=>{const c=n?Qe(n):le(i,".devcontainer"),l=n??le(c,"devcontainer.json");et(c),Je(l,`${JSON.stringify(t,null,2)}
2
2
  `,"utf8")},st={bun:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-bun-cache",target:"/home/node/.bun/install/cache",type:"volume"}],deno:[{source:"${localWorkspaceFolderBasename}-deno-cache",target:"/home/node/.cache/deno",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"}]},ct=[{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"}]}],pe=(i,t,n)=>{const c=[],l=new Set(n.map(a=>typeof a=="string"?a:a.target));if(i)for(const a of st[i])l.has(a.target)||c.push(a);const r=Object.keys(t);for(const{featureMatch:a,mounts:m}of ct)if(r.some(g=>g.includes(a)))for(const g of m)l.has(g.target)||c.push(g);return c},B=["general","features","ports","lifecycle","extensions","environment","mounts","compose"],Y=i=>structuredClone(i);class lt{#r=new Set;#e;constructor(t,n,c=null){const l=t===null,r=t??{name:""},a=Y(r);this.#e={config:a,detectedPm:c,extensionSearch:"",featureSearch:"",fieldEditing:!1,fieldIndex:0,hadComments:n,isDirty:!1,mode:l?"create":"edit",originalConfig:l?null:Y(r),section:"general",showTemplateSelector:l,suggestedMounts:pe(c,a.features??{},a.mounts??[]),templateIndex:0}}getSnapshot=()=>this.#e;subscribe=t=>(this.#r.add(t),()=>{this.#r.delete(t)});setSection(t){t!==this.#e.section&&this.#t({...this.#e,fieldEditing:!1,fieldIndex:0,section:t})}nextSection(){const n=(B.indexOf(this.#e.section)+1)%B.length;this.setSection(B[n])}previousSection(){const n=(B.indexOf(this.#e.section)-1+B.length)%B.length;this.setSection(B[n])}setFieldIndex(t){t!==this.#e.fieldIndex&&this.#t({...this.#e,fieldIndex:Math.max(0,t)})}setFieldEditing(t){t!==this.#e.fieldEditing&&this.#t({...this.#e,fieldEditing:t})}setTemplateIndex(t){const n=Math.max(0,Math.min(t,V.length-1));n!==this.#e.templateIndex&&this.#t({...this.#e,templateIndex:n})}applyTemplate(t){const n=V.find(c=>c.id===t);n&&this.#t(this.#o({...this.#e,config:Y(n.config),isDirty:!0,showTemplateSelector:!1}))}dismissTemplateSelector(){this.#t({...this.#e,showTemplateSelector:!1})}updateConfig(t){this.#t({...this.#e,config:{...this.#e.config,...t},isDirty:!0})}toggleFeature(t){const n={...this.#e.config.features};n[t]===void 0?n[t]={}:delete n[t],this.#t(this.#o({...this.#e,config:{...this.#e.config,features:n},isDirty:!0}))}setFeatureSearch(t){this.#t({...this.#e,featureSearch:t,fieldIndex:0})}addPort(t){const n=this.#e.config.forwardPorts??[];if(n.includes(t))return;const c=[...n,t];this.#t({...this.#e,config:{...this.#e.config,forwardPorts:c},isDirty:!0})}removePort(t){const n=[...this.#e.config.forwardPorts??[]];n.splice(t,1),this.#t({...this.#e,config:{...this.#e.config,forwardPorts:n.length>0?n:void 0},isDirty:!0})}toggleExtension(t){const n={...this.#e.config.customizations},c={...n.vscode},l=[...c.extensions??[]],r=l.indexOf(t);r===-1?l.push(t):l.splice(r,1),c.extensions=l.length>0?l:void 0,n.vscode=c.extensions||c.settings?c:void 0,this.#t({...this.#e,config:{...this.#e.config,customizations:n.vscode||n.jetbrains?n:void 0},isDirty:!0})}setExtensionSearch(t){this.#t({...this.#e,extensionSearch:t,fieldIndex:0})}addEnvVar(t,n,c){const l=t==="container"?"containerEnv":"remoteEnv",r={...this.#e.config[l],[n]:c};this.#t({...this.#e,config:{...this.#e.config,[l]:r},isDirty:!0})}removeEnvVar(t,n){const c=t==="container"?"containerEnv":"remoteEnv",l={...this.#e.config[c]};delete l[n],this.#t({...this.#e,config:{...this.#e.config,[c]:Object.keys(l).length>0?l:void 0},isDirty:!0})}addMount(t){const n=[...this.#e.config.mounts??[],t];this.#t(this.#o({...this.#e,config:{...this.#e.config,mounts:n},isDirty:!0}))}removeMount(t){const n=[...this.#e.config.mounts??[]];n.splice(t,1),this.#t(this.#o({...this.#e,config:{...this.#e.config,mounts:n.length>0?n:void 0},isDirty:!0}))}applySuggestedMounts(){if(this.#e.suggestedMounts.length===0)return;const t=[...this.#e.config.mounts??[],...this.#e.suggestedMounts];this.#t(this.#o({...this.#e,config:{...this.#e.config,mounts:t},isDirty:!0}))}setLifecycleCommand(t,n){this.#t({...this.#e,config:{...this.#e.config,[t]:n||void 0},isDirty:!0})}markClean(){this.#t({...this.#e,isDirty:!1,originalConfig:Y(this.#e.config)})}getJsonPreview(){return JSON.stringify(this.#n(),null,2)}cleanConfig(){return this.#n()}#n(){const t=Y(this.#e.config);for(const[n,c]of Object.entries(t))(c===""||c===void 0)&&delete t[n];return t.build&&(t.build.dockerfile===""&&delete t.build.dockerfile,t.build.context===""&&delete t.build.context,t.build.args&&Object.keys(t.build.args).length===0&&delete t.build.args,Object.keys(t.build).length===0&&delete t.build),t.forwardPorts?.length===0&&delete t.forwardPorts,t.mounts?.length===0&&delete t.mounts,t.runServices?.length===0&&delete t.runServices,t.capAdd?.length===0&&delete t.capAdd,t.securityOpt?.length===0&&delete t.securityOpt,t.features&&Object.keys(t.features).length===0&&delete t.features,t.customizations?.vscode?.extensions?.length===0&&delete t.customizations.vscode.extensions,t.customizations?.vscode&&Object.keys(t.customizations.vscode).length===0&&delete t.customizations.vscode,t.customizations&&Object.keys(t.customizations).length===0&&delete t.customizations,t.containerEnv&&Object.keys(t.containerEnv).length===0&&delete t.containerEnv,t.remoteEnv&&Object.keys(t.remoteEnv).length===0&&delete t.remoteEnv,t}#o(t){return{...t,suggestedMounts:pe(t.detectedPm,t.config.features??{},t.config.mounts??[])}}#t(t){this.#e=t;for(const n of this.#r)try{n()}catch{}}}const xe=[{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"}],je=[{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"}],de=i=>{if(!i)return je;const t=i.toLowerCase();return je.filter(n=>n.name.toLowerCase().includes(t)||n.id.toLowerCase().includes(t)||n.description.toLowerCase().includes(t))},ue=i=>{if(!i)return xe;const t=i.toLowerCase();return xe.filter(n=>n.name.toLowerCase().includes(t)||n.id.toLowerCase().includes(t)||n.description.toLowerCase().includes(t))},at=/^[a-z]$/i,dt=i=>{const t=i.codePointAt(0);return t!==void 0&&(t<32||t===127)},ut=(i,t)=>i.length===0||dt(i)?!1:t.ctrl&&t.meta?!at.test(i):!(t.ctrl||t.meta),ht=/\S+\s*$/,se=(i,t)=>i.length===0||!t?void 0:t.find(n=>n.startsWith(i))?.slice(i.length)??void 0,ke=-1,mt=(i,t,n,c)=>t.leftArrow?Math.max(0,n-1):t.home||t.ctrl&&i==="a"?0:t.end||t.ctrl&&i==="e"?c:ke,gt=(i,t,n,c)=>{if(t.backspace&&c>0)return[n.slice(0,c-1)+n.slice(c),c-1];if(t.delete&&c<n.length)return[n.slice(0,c)+n.slice(c+1),c];if(t.ctrl&&i==="u")return[n.slice(c),0];if(t.ctrl&&i==="k")return[n.slice(0,c),c];if(t.ctrl&&i==="w"){const l=n.slice(0,c).replace(ht,"");return[l+n.slice(c),l.length]}};function he({defaultValue:i="",isDisabled:t=!1,mask:n=!1,onChange:c,onSubmit:l,placeholder:r,suggestions:a}){const[m,f]=p.useState(i),[g,v]=p.useState(i.length),x=p.useRef(m);x.current=m;const b=p.useRef(g);b.current=g;const y=p.useRef(c);y.current=c;const D=p.useRef(l);D.current=l;const k=se(m,a),M=p.useCallback((T,I)=>{const{current:E}=b,S=x.current;if(I.return){const w=se(S,a),C=w?S+w:S;w&&(f(C),v(C.length),y.current?.(C)),D.current?.(C);return}if(I.escape)return;if(I.rightArrow){const w=se(S,a);if(E===S.length&&w){const C=S+w;f(C),v(C.length),y.current?.(C);return}v(Math.min(S.length,E+1));return}const A=mt(T,I,E,S.length);if(A!==ke){v(A);return}const H=gt(T,I,S,E);if(H){const[w,C]=H;f(w),v(C),y.current?.(w);return}if(ut(T,I)){const w=S.slice(0,E)+T+S.slice(E);f(w),v(E+T.length),y.current?.(w)}},[a]);W(M,{isActive:!t});const L=n?"*".repeat(m.length):m,U=L.slice(0,g),X=L[g],Q=L.slice(g+1);return t?e.jsx(s,{children:e.jsx(o,{dimColor:!0,children:L||r||""})}):m.length===0&&r?e.jsxs(s,{children:[e.jsx(o,{dimColor:!0,inverse:!0,children:r[0]}),e.jsx(o,{dimColor:!0,children:r.slice(1)})]}):e.jsxs(s,{children:[e.jsxs(o,{children:[U,e.jsx(o,{inverse:!0,children:X??" "}),Q]}),k?e.jsx(o,{dimColor:!0,children:k}):void 0]})}const Ee=["dockerComposeFile","service"],ft={dockerComposeFile:"Compose File",service:"Service"},ve={dockerComposeFile:"docker-compose.yml",service:"app"},pt={dockerComposeFile:"Path to Docker Compose file (relative to .devcontainer/)",service:"Which service in the compose file to connect the IDE to"},xt=({config:i,fieldEditing:t,fieldIndex:n,onUpdate:c})=>{const l=!!i.dockerComposeFile,r=!!(i.image||i.build);return e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsx(s,{marginBottom:1,children:e.jsx(o,{bold:!0,color:"cyan",children:"Docker Compose Integration"})}),r&&l&&e.jsx(s,{marginBottom:1,children:e.jsx(o,{color:"yellow",children:"Note: When using Docker Compose, the image/build settings in General are ignored."})}),Ee.map((a,m)=>{const f=m===n,g=i[a]??"",v=Array.isArray(i[a])?i[a].join(", "):g;return e.jsxs(s,{flexDirection:"column",marginBottom:1,children:[e.jsxs(s,{children:[e.jsx(s,{width:20,children:e.jsxs(o,{bold:f,color:f?"cyan":"white",children:[f?"❯ ":" ",ft[a],":"]})}),e.jsx(s,{flexGrow:1,children:f&&t?e.jsx(he,{defaultValue:v,onChange:x=>{c({[a]:x||void 0})},placeholder:ve[a]}):e.jsx(o,{color:v?"white":"gray",children:v||ve[a]})})]}),e.jsx(s,{paddingLeft:4,children:e.jsx(o,{dimColor:!0,children:pt[a]})})]},a)}),e.jsx(s,{marginTop:1,children:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ","edit field"," ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",e.jsx(o,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]})},jt=Ee.length,vt=({config:i,fieldIndex:t})=>{const n=i.containerEnv??{},c=i.remoteEnv??{},l=Object.keys(n),r=Object.keys(c),a=l.length,m=l.length+1,f=m+r.length,g=t<=a,v=t>a;return e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsxs(s,{borderColor:g?"cyan":"gray",borderStyle:"single",flexDirection:"column",paddingX:1,paddingY:0,children:[e.jsxs(s,{flexShrink:0,marginBottom:l.length>0?1:0,children:[e.jsx(o,{bold:!0,color:g?"cyan":"white",children:"containerEnv"}),e.jsx(o,{dimColor:!0,children:" — baked into the container image"})]}),l.map((x,b)=>{const y=b===t;return e.jsx(s,{flexShrink:0,children:e.jsxs(o,{color:y?"cyan":void 0,inverse:y,wrap:"truncate",children:[y?" ❯ ":" ",e.jsx(o,{bold:!0,children:x}),e.jsx(o,{dimColor:!0,children:" = "}),e.jsx(o,{children:n[x]})]})},x)}),e.jsx(s,{flexShrink:0,marginTop:l.length>0?1:0,children:e.jsxs(o,{color:t===a?"cyan":"gray",inverse:t===a,children:[" ","+ Add variable..."]})})]}),e.jsxs(s,{borderColor:v?"cyan":"gray",borderStyle:"single",flexDirection:"column",marginTop:1,paddingX:1,paddingY:0,children:[e.jsxs(s,{flexShrink:0,marginBottom:r.length>0?1:0,children:[e.jsx(o,{bold:!0,color:v?"cyan":"white",children:"remoteEnv"}),e.jsx(o,{dimColor:!0,children:" — set at runtime by the IDE"})]}),r.map((x,b)=>{const D=m+b===t;return e.jsx(s,{flexShrink:0,children:e.jsxs(o,{color:D?"cyan":void 0,inverse:D,wrap:"truncate",children:[D?" ❯ ":" ",e.jsx(o,{bold:!0,children:x}),e.jsx(o,{dimColor:!0,children:" = "}),e.jsx(o,{children:c[x]})]})},x)}),e.jsx(s,{flexShrink:0,marginTop:r.length>0?1:0,children:e.jsxs(o,{color:t===f?"cyan":"gray",inverse:t===f,children:[" ","+ Add variable..."]})})]}),e.jsx(s,{flexShrink:0,marginTop:1,children:e.jsxs(o,{dimColor:!0,wrap:"truncate",children:[e.jsx(o,{bold:!0,color:"white",children:"a"}),"/",e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ","add on + row"," ",e.jsx(o,{bold:!0,color:"white",children:"d"})," ","remove"," ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"]})})]})},bt=i=>{const t=Object.keys(i.containerEnv??{}).length,n=Object.keys(i.remoteEnv??{}).length;return t+1+n+1},wt=({config:i,fieldIndex:t,scrollOffset:n,searchText:c,viewportHeight:l})=>{const r=p.useMemo(()=>new Set(i.customizations?.vscode?.extensions),[i.customizations?.vscode?.extensions]),a=p.useMemo(()=>ue(c),[c]),m=a.length,f=m>l&&l>0;return e.jsxs(s,{flexDirection:"column",flexGrow:1,children:[e.jsxs(s,{flexShrink:0,gap:1,paddingX:1,children:[e.jsxs(o,{bold:!0,color:"cyan",children:[r.size," ","selected"]}),c&&e.jsxs(o,{dimColor:!0,children:["— filter:"," ",e.jsx(o,{color:"yellow",children:c})," ","(",a.length," ","results)"]})]}),e.jsxs(s,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[e.jsx(s,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:e.jsx(s,{flexDirection:"column",marginTop:-n,children:a.map((g,v)=>{const x=v===t,b=r.has(g.id);return e.jsxs(s,{flexShrink:0,height:1,children:[e.jsx(o,{children:x?">":" "}),e.jsxs(o,{color:b?"white":"gray",children:[" ",b?"☑":"☐"," "]}),e.jsx(s,{flexGrow:1,children:e.jsxs(o,{bold:x,inverse:x,wrap:"truncate",children:[g.name,e.jsxs(o,{dimColor:!0,children:[" ","-",g.id]})]})})]},g.id)})})}),f&&e.jsx(s,{flexShrink:0,marginLeft:1,marginRight:1,children:e.jsx(Ce,{contentHeight:m,placement:"inset",scrollOffset:n,style:"block",viewportHeight:l})})]}),a.length===0&&e.jsx(s,{paddingX:1,children:e.jsx(o,{dimColor:!0,children:"No extensions match the search."})})]})},yt=({config:i,fieldIndex:t,scrollOffset:n,searchText:c,viewportHeight:l})=>{const r=p.useMemo(()=>new Set(Object.keys(i.features??{})),[i.features]),a=p.useMemo(()=>de(c),[c]),m=a.length,f=m>l&&l>0;return e.jsxs(s,{flexDirection:"column",flexGrow:1,children:[e.jsxs(s,{flexShrink:0,gap:1,paddingX:1,children:[e.jsxs(o,{bold:!0,color:"cyan",children:[r.size," ","selected"]}),c&&e.jsxs(o,{dimColor:!0,children:["— filter:"," ",e.jsx(o,{color:"yellow",children:c})," ","(",a.length," ","results)"]})]}),e.jsxs(s,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[e.jsx(s,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:e.jsx(s,{flexDirection:"column",marginTop:-n,children:a.map((g,v)=>{const x=v===t,b=r.has(g.id);return e.jsxs(s,{flexShrink:0,height:1,children:[e.jsx(o,{children:x?">":" "}),e.jsxs(o,{color:b?"white":"gray",children:[" ",b?"☑":"☐"," "]}),e.jsx(s,{flexGrow:1,children:e.jsxs(o,{bold:x,inverse:x,wrap:"truncate",children:[g.name,e.jsxs(o,{dimColor:!0,children:[" ","-",g.description]})]})})]},g.id)})})}),f&&e.jsx(s,{flexShrink:0,marginLeft:1,marginRight:1,children:e.jsx(Ce,{contentHeight:m,placement:"inset",scrollOffset:n,style:"block",viewportHeight:l})})]}),a.length===0&&e.jsx(s,{paddingX:1,children:e.jsx(o,{dimColor:!0,children:"No features match the search."})})]})},ae=["name","image","workspaceFolder","workspaceMount","remoteUser","containerUser","shutdownAction"],St={containerUser:"Container User",image:"Image",name:"Name",remoteUser:"Remote User",shutdownAction:"Shutdown Action",workspaceFolder:"Workspace Folder",workspaceMount:"Workspace Mount"},be={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"],Ct={overrideCommand:"Override Command",privileged:"Privileged"},kt=ae.length+te.length,Et=({config:i,fieldEditing:t,fieldIndex:n,onUpdate:c})=>e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsx(s,{marginBottom:1,children:e.jsx(o,{bold:!0,color:"cyan",children:"General Configuration"})}),ae.map((l,r)=>{const a=r===n,m=i[l]??"";return e.jsxs(s,{marginBottom:1,children:[e.jsx(s,{width:20,children:e.jsxs(o,{bold:a,color:a?"cyan":"white",children:[a?"❯ ":" ",St[l],":"]})}),e.jsx(s,{flexGrow:1,children:a&&t?e.jsx(he,{defaultValue:m,onChange:f=>{c({[l]:f})},placeholder:be[l]}):e.jsx(o,{color:m?"white":"gray",children:m||be[l]})})]},l)}),te.map((l,r)=>{const m=ae.length+r===n,f=i[l]??!1;return e.jsxs(s,{marginBottom:r<te.length-1?1:0,children:[e.jsx(s,{width:20,children:e.jsxs(o,{bold:m,color:m?"cyan":"white",children:[m?"❯ ":" ",Ct[l],":"]})}),e.jsx(s,{flexGrow:1,children:e.jsxs(o,{color:f?"green":"gray",children:[f?"yes":"no",m&&e.jsx(o,{dimColor:!0,children:" (Space to toggle)"})]})})]},l)}),e.jsx(s,{marginTop:1,children:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ","edit field"," ",e.jsx(o,{bold:!0,color:"white",children:"Space"})," ","toggle"," ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",e.jsx(o,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]}),Ie=kt,ce=te,De=["postCreateCommand","postStartCommand","postAttachCommand","onCreateCommand"],It={onCreateCommand:"On Create",postAttachCommand:"Post Attach",postCreateCommand:"Post Create",postStartCommand:"Post Start"},Dt={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"},Tt=({config:i,fieldEditing:t,fieldIndex:n,onSetCommand:c})=>e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsx(s,{marginBottom:1,children:e.jsx(o,{bold:!0,color:"cyan",children:"Lifecycle Commands"})}),De.map((l,r)=>{const a=r===n,m=i[l],f=Array.isArray(m)?m.join(" && "):m??"";return e.jsxs(s,{flexDirection:"column",marginBottom:1,children:[e.jsx(s,{children:e.jsxs(o,{bold:a,color:a?"cyan":"white",children:[a?"❯ ":" ",It[l]]})}),e.jsx(s,{paddingLeft:4,children:e.jsx(o,{dimColor:!0,children:Dt[l]})}),e.jsx(s,{paddingLeft:4,children:a&&t?e.jsx(he,{defaultValue:f,onChange:g=>{c(l,g)},placeholder:"e.g. npm install"}):e.jsx(o,{color:f?"green":"gray",children:f||"(not set)"})})]},l)}),e.jsx(s,{marginTop:1,children:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ","edit command"," ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",e.jsx(o,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]}),At=De.length,we=i=>typeof i=="string"?i:`[${i.type}] ${i.source} → ${i.target}`,Ft=({addingMount:i,config:t,detectedPm:n,fieldIndex:c,mountPhase:l,mountSource:r,mountTarget:a,mountType:m,suggestedMounts:f})=>{const g=t.mounts??[];return e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsxs(s,{flexShrink:0,gap:1,paddingX:1,children:[e.jsxs(o,{bold:!0,color:"cyan",children:[g.length," ","mounts"]}),n&&e.jsxs(o,{dimColor:!0,children:["— detected:"," ",e.jsx(o,{color:"white",children:n})]})]}),f.length>0&&!i&&e.jsxs(s,{borderColor:"yellow",borderStyle:"single",flexDirection:"column",marginBottom:1,marginTop:1,paddingX:1,children:[e.jsxs(s,{flexShrink:0,children:[e.jsx(o,{bold:!0,color:"yellow",children:"Suggested mounts"}),e.jsxs(o,{dimColor:!0,children:[" ","— press"," ",e.jsx(o,{bold:!0,color:"white",children:"A"})," ","to add all"]})]}),f.map((v,x)=>e.jsx(s,{flexShrink:0,children:e.jsxs(o,{dimColor:!0,wrap:"truncate",children:[" + ",we(v)]})},`suggestion-${String(x)}`))]}),g.length>0&&e.jsx(s,{flexDirection:"column",marginBottom:1,children:g.map((v,x)=>{const b=x===c;return e.jsxs(s,{flexShrink:0,height:1,children:[e.jsx(o,{children:b?">":" "}),e.jsx(s,{flexGrow:1,children:e.jsxs(o,{bold:b,inverse:b,wrap:"truncate",children:[" ",we(v)]})})]},`mount-${String(x)}`)})}),!i&&e.jsx(s,{flexShrink:0,children:e.jsxs(o,{color:c===g.length?"cyan":"gray",inverse:c===g.length,children:[" ","+ Add mount..."]})}),i&&e.jsxs(s,{borderColor:"cyan",borderStyle:"single",flexDirection:"column",marginTop:1,paddingX:1,children:[e.jsx(s,{flexShrink:0,marginBottom:1,children:e.jsx(o,{bold:!0,color:"cyan",children:"New Mount"})}),e.jsxs(s,{flexShrink:0,children:[e.jsx(s,{width:12,children:e.jsxs(o,{bold:l==="source",color:l==="source"?"cyan":"white",children:[l==="source"?"❯ ":" ","Source:"]})}),e.jsx(o,{color:r?"yellow":"gray",children:r||(l==="source"?"_":"(type source, Enter to continue)")})]}),e.jsxs(s,{flexShrink:0,children:[e.jsx(s,{width:12,children:e.jsxs(o,{bold:l==="target",color:l==="target"?"cyan":"white",children:[l==="target"?"❯ ":" ","Target:"]})}),e.jsx(o,{color:a?"yellow":"gray",children:a||(l==="target"?"_":"/container/path")})]}),e.jsxs(s,{flexShrink:0,children:[e.jsx(s,{width:12,children:e.jsxs(o,{bold:l==="type",color:l==="type"?"cyan":"white",children:[l==="type"?"❯ ":" ","Type:"]})}),l==="type"?e.jsxs(o,{children:[e.jsx(o,{bold:m==="volume",color:m==="volume"?"cyan":"gray",children:"[1] volume"})," ",e.jsx(o,{bold:m==="bind",color:m==="bind"?"cyan":"gray",children:"[2] bind"})," ",e.jsx(o,{bold:m==="tmpfs",color:m==="tmpfs"?"cyan":"gray",children:"[3] tmpfs"})]}):e.jsx(o,{color:"gray",children:m})]}),e.jsx(s,{flexShrink:0,marginTop:1,children:e.jsx(o,{dimColor:!0,wrap:"truncate",children:l==="type"?"1/2/3 select type, Enter confirm, Esc cancel":"Type text, Enter next step, Esc cancel"})})]}),g.length===0&&!i&&f.length===0&&e.jsx(s,{marginTop:1,children:e.jsx(o,{dimColor:!0,children:"Tip: Use volume mounts for node_modules and caches to improve performance."})})]})},Lt=({addingPort:i,addPortValue:t,config:n,fieldIndex:c})=>{const l=n.forwardPorts??[],r=c===l.length;return e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsxs(s,{marginBottom:1,children:[e.jsx(o,{bold:!0,color:"cyan",children:"Forwarded Ports"}),e.jsxs(o,{dimColor:!0,children:[" ","(",l.length," ","ports)"]})]}),l.map((a,m)=>{const f=m===c;return e.jsx(s,{children:e.jsxs(o,{color:f?"cyan":void 0,inverse:f,children:[" ",String(a)]})},`port-${String(a)}`)}),e.jsx(s,{marginTop:l.length>0?1:0,children:e.jsxs(o,{color:r?"cyan":"gray",inverse:r,children:[" ",r&&i?e.jsxs(o,{children:["Enter port:"," ",e.jsx(o,{color:"yellow",children:t||"_"})]}):"+ Add port..."]})}),e.jsx(s,{marginTop:1,children:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ",r?"type port number, Enter to confirm":"select"," ",e.jsx(o,{bold:!0,color:"white",children:"d"})," ","remove selected"," ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"]})})]})},Ot=({focused:i,hadComments:t,jsonPreview:n,mode:c,scrollRef:l})=>e.jsxs(s,{borderColor:i?"cyan":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsxs(s,{flexShrink:0,paddingX:1,children:[e.jsx(o,{bold:!0,color:i?"cyan":"white",children:"Preview"}),e.jsxs(o,{dimColor:!0,children:[" ","(",c==="create"?"new":"edit",")"]})]}),t&&c==="edit"&&e.jsx(s,{flexShrink:0,paddingX:1,children:e.jsx(o,{color:"yellow",children:"Comments will not be preserved."})}),e.jsx(ze,{flexGrow:1,ref:l,scrollbar:!0,scrollbarColor:"gray",children:n.split(`
3
3
  `).map((r,a)=>e.jsx(o,{color:"green",children:r},`line-${String(a)}`))})]}),Pt=i=>{const t=[],n=[],c=[];if(!i.image&&!i.build&&!i.dockerComposeFile&&t.push({field:"image",message:'One of "image", "build", or "dockerComposeFile" is required'}),i.build&&(i.image&&n.push({field:"image",message:'Both "image" and "build" are set; "build" takes precedence'}),i.build.dockerfile||t.push({field:"build.dockerfile",message:'"build" requires a "dockerfile" path'})),i.dockerComposeFile&&!i.service&&t.push({field:"service",message:'"service" is required when using "dockerComposeFile"'}),i.features!==void 0&&(typeof i.features!="object"||Array.isArray(i.features))&&t.push({field:"features",message:'"features" must be an object mapping feature IDs to options'}),i.forwardPorts)if(Array.isArray(i.forwardPorts))for(const[l,r]of i.forwardPorts.entries())typeof r=="number"&&(r<1||r>65535)&&t.push({field:"forwardPorts",message:`Invalid port ${String(r)} at index ${String(l)}`});else t.push({field:"forwardPorts",message:'"forwardPorts" must be an array'});return i.customizations?.vscode?.extensions&&!Array.isArray(i.customizations.vscode.extensions)&&t.push({field:"customizations.vscode.extensions",message:"Extensions must be an array"}),i.customizations?.vscode?.settings&&typeof i.customizations.vscode.settings!="object"&&t.push({field:"customizations.vscode.settings",message:"Settings must be an object"}),i.name||c.push({field:"name",message:"Consider adding a name for better identification"}),(!i.features||Object.keys(i.features).length===0)&&c.push({field:"features",message:"Consider adding features for common tools"}),(!i.customizations?.vscode?.extensions||i.customizations.vscode.extensions.length===0)&&c.push({field:"extensions",message:"Consider adding VS Code extensions for your stack"}),i.privileged&&n.push({field:"privileged",message:"Running in privileged mode is a security risk"}),{errors:t,suggestions:c,valid:t.length===0,warnings:n}},ye=80,Se=15,Mt=120,Te=[{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"}],Nt=new Map(Te.map(i=>[i.id,i.description])),Rt=(i,t,n,c)=>{switch(i){case"compose":return jt;case"environment":return bt(t);case"extensions":return ue(c).length;case"features":return de(n).length;case"general":return Ie;case"lifecycle":return At;case"mounts":return(t.mounts?.length??0)+1;case"ports":return(t.forwardPorts?.length??0)+1;default:return 0}},Bt=({onSave:i,store:t})=>{const{exit:n}=Ge(),{columns:c,rows:l}=$e(),r=p.useSyncExternalStore(t.subscribe,t.getSnapshot),[a,m]=p.useState(!1),[f,g]=p.useState(!1),[v,x]=p.useState(!1),[b,y]=p.useState(null),[D,k]=p.useState("editor"),[M,L]=p.useState(0),[U,X]=p.useState(!1),[Q,T]=p.useState(""),[I,E]=p.useState(null),[S,A]=p.useState(""),[H,w]=p.useState(""),[C,_]=p.useState("key"),[oe,Z]=p.useState(!1),[re,z]=p.useState(""),[ne,G]=p.useState(""),[me,K]=p.useState("volume"),[O,$]=p.useState("source"),ie=p.useRef(null),R=p.useRef(null),N=p.useRef(null),ee=p.useRef(!0);p.useEffect(()=>(ee.current=!0,()=>{ee.current=!1,N.current&&clearTimeout(N.current)}),[]);const ge=Rt(r.section,r.config,r.featureSearch,r.extensionSearch),J=Math.max(1,l-9);p.useEffect(()=>{r.section!=="features"&&r.section!=="extensions"||L(u=>r.fieldIndex>=u+J?r.fieldIndex-J+1:r.fieldIndex<u?r.fieldIndex:u)},[r.fieldIndex,r.section,J]),p.useEffect(()=>{L(0)},[r.section,r.featureSearch,r.extensionSearch]);const Ae=p.useCallback(()=>{const u=t.cleanConfig(),h=Pt(u);if(!h.valid){const j=h.errors[0];y(j?`Error: ${j.message}`:"Validation failed"),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{ee.current&&y(null)},3e3);return}i(u),t.markClean();const d=h.warnings.length;y(d>0?`Saved! (${String(d)} warning${d>1?"s":""})`:"Saved!"),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{ee.current&&y(null)},2e3)},[i,t]);W((u,h)=>{if(h.downArrow||u==="j")t.setTemplateIndex(r.templateIndex+1);else if(h.upArrow||u==="k")t.setTemplateIndex(r.templateIndex-1);else if(h.return){const d=V[r.templateIndex];d&&t.applyTemplate(d.id)}else h.escape&&t.dismissTemplateSelector()},{isActive:r.showTemplateSelector}),W((u,h)=>{if(h.escape){X(!1),T("");return}if(h.return){const d=Number.parseInt(Q,10);!Number.isNaN(d)&&d>0&&d<=65535&&t.addPort(d),X(!1),T("");return}if(h.backspace){T(d=>d.slice(0,-1));return}u&&/^\d$/u.test(u)&&T(d=>d+u)},{isActive:U}),W((u,h)=>{if(h.escape){E(null),A(""),w(""),_("key");return}if(h.return){if(C==="key"&&S){_("value");return}if(C==="value"&&S){t.addEnvVar(I,S,H),E(null),A(""),w(""),_("key");return}}if(h.backspace){C==="key"?A(d=>d.slice(0,-1)):w(d=>d.slice(0,-1));return}u&&!h.ctrl&&!h.meta&&(C==="key"?A(d=>d+u):w(d=>d+u))},{isActive:I!==null}),W((u,h)=>{if(h.escape){Z(!1),z(""),G(""),$("source");return}if(h.return){if(O==="source"&&re){$("target");return}if(O==="target"&&ne){$("type");return}if(O==="type"){t.addMount({source:re,target:ne,type:me}),Z(!1),z(""),G(""),$("source");return}}if(O==="type"){switch(u){case"1":{K("volume");break}case"2":{K("bind");break}case"3":{K("tmpfs");break}}return}if(h.backspace){O==="source"?z(d=>d.slice(0,-1)):O==="target"&&G(d=>d.slice(0,-1));return}u&&!h.ctrl&&!h.meta&&(O==="source"?z(d=>d+u):O==="target"&&G(d=>d+u))},{isActive:oe}),W((u,h)=>{if(u==="c"&&h.ctrl){n();return}if(!f){if(a){h.escape||u==="?"?m(!1):h.downArrow||u==="j"?ie.current?.scrollBy(1):h.upArrow||u==="k"?ie.current?.scrollBy(-1):u==="q"&&(m(!1),g(!0));return}if(v){if(h.escape){x(!1),r.section==="features"?t.setFeatureSearch(""):t.setExtensionSearch("");return}if(h.return){x(!1);return}if(h.backspace){r.section==="features"?t.setFeatureSearch(r.featureSearch.slice(0,-1)):t.setExtensionSearch(r.extensionSearch.slice(0,-1));return}if(u&&!h.ctrl&&!h.meta){r.section==="features"?t.setFeatureSearch(r.featureSearch+u):t.setExtensionSearch(r.extensionSearch+u);return}return}if(r.fieldEditing){if(h.escape){t.setFieldEditing(!1);return}if(h.return){t.setFieldEditing(!1);return}return}if(u==="?"){m(!0);return}if(u==="q"){r.isDirty?g(!0):n();return}if(u==="s"){Ae();return}if(h.tab){k(d=>d==="editor"?"preview":"editor");return}if(D==="preview"){if(h.downArrow||u==="j"){R.current?.scrollBy(1);return}if(h.upArrow||u==="k"){R.current?.scrollBy(-1);return}if(h.pageDown){R.current?.scrollBy(10);return}if(h.pageUp){R.current?.scrollBy(-10);return}if(h.home){R.current?.scrollToTop();return}if(h.end){R.current?.scrollToBottom();return}h.escape&&k("editor");return}if(h.downArrow||u==="j"){ge>0&&t.setFieldIndex(Math.min(r.fieldIndex+1,ge-1));return}if(h.upArrow||u==="k"){t.setFieldIndex(Math.max(r.fieldIndex-1,0));return}if(h.return){switch(r.section){case"compose":case"general":case"lifecycle":{t.setFieldEditing(!0);break}case"environment":{const d=Object.keys(r.config.containerEnv??{}).length,j=d,P=d+1+Object.keys(r.config.remoteEnv??{}).length;r.fieldIndex===j?(E("container"),A(""),w(""),_("key")):r.fieldIndex===P&&(E("remote"),A(""),w(""),_("key"));break}case"mounts":{const d=r.config.mounts??[];r.fieldIndex===d.length&&(Z(!0),z(""),G(""),K("volume"),$("source"));break}case"ports":{const d=r.config.forwardPorts??[];r.fieldIndex===d.length&&(X(!0),T(""));break}}return}if(u===" "){switch(r.section){case"extensions":{const j=ue(r.extensionSearch)[r.fieldIndex];j&&t.toggleExtension(j.id);break}case"features":{const j=de(r.featureSearch)[r.fieldIndex];j&&t.toggleFeature(j.id);break}case"general":{const d=Ie-ce.length,j=r.fieldIndex-d;if(j>=0&&j<ce.length){const P=ce[j];t.updateConfig({[P]:!r.config[P]})}break}}return}if(u==="/"){(r.section==="features"||r.section==="extensions")&&x(!0);return}if(u==="A"&&r.section==="mounts"){t.applySuggestedMounts();return}if(u==="a"){if(r.section==="environment"){const d=Object.keys(r.config.containerEnv??{}).length,j=r.fieldIndex<=d?"container":"remote";E(j),A(""),w(""),_("key")}else r.section==="mounts"&&(Z(!0),z(""),G(""),K("volume"),$("source"));return}if(u==="d")switch(r.section){case"environment":{const d=Object.keys(r.config.containerEnv??{}),j=Object.keys(r.config.remoteEnv??{});if(r.fieldIndex<d.length)t.removeEnvVar("container",d[r.fieldIndex]),d.length===1||r.fieldIndex>=d.length-1&&t.setFieldIndex(d.length-2);else{const P=r.fieldIndex-d.length-1;P>=0&&P<j.length&&(t.removeEnvVar("remote",j[P]),j.length===1||P>=j.length-1&&t.setFieldIndex(r.fieldIndex-1))}break}case"mounts":{const d=r.config.mounts??[];if(r.fieldIndex<d.length){t.removeMount(r.fieldIndex);const j=d.length-1;r.fieldIndex>=j&&j>0&&t.setFieldIndex(j-1)}break}case"ports":{const d=r.config.forwardPorts??[];if(r.fieldIndex<d.length){t.removePort(r.fieldIndex);const j=d.length-1;r.fieldIndex>=j&&j>0&&t.setFieldIndex(j-1)}break}}}},{isActive:!r.showTemplateSelector&&!U&&I===null&&!oe});const Fe=p.useMemo(()=>t.getJsonPreview(),[r.config]);if(c<ye||l<Se)return e.jsx(s,{alignItems:"center",height:l,justifyContent:"center",width:c,children:e.jsxs(o,{color:"yellow",children:["Terminal too small (",c,"x",l,"), need"," ",ye,"x",Se]})});if(r.showTemplateSelector)return e.jsx(s,{alignItems:"center",flexDirection:"column",height:l,justifyContent:"center",width:c,children:e.jsxs(s,{borderColor:"cyan",borderStyle:"round",flexDirection:"column",paddingX:2,paddingY:1,width:60,children:[e.jsx(s,{justifyContent:"center",marginBottom:1,children:e.jsx(o,{bold:!0,color:"cyan",children:"Select a Template"})}),V.map((u,h)=>{const d=h===r.templateIndex;return e.jsx(s,{children:e.jsxs(o,{color:d?"cyan":void 0,inverse:d,children:[d?" ❯ ":" ",e.jsx(o,{bold:d,children:u.name}),e.jsxs(o,{dimColor:!0,children:[" ","-",u.description]})]})},u.id)}),e.jsx(s,{justifyContent:"center",marginTop:1,children:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ","select"," ",e.jsx(o,{bold:!0,color:"white",children:"Esc"})," ","blank"]})})]})});let F;switch(r.section){case"compose":{F=e.jsx(xt,{config:r.config,fieldEditing:r.fieldEditing,fieldIndex:r.fieldIndex,onUpdate:u=>{t.updateConfig(u)}});break}case"environment":{F=e.jsxs(s,{flexDirection:"column",children:[e.jsx(vt,{config:r.config,fieldIndex:r.fieldIndex}),I!==null&&e.jsx(s,{marginTop:1,paddingX:1,children:e.jsxs(o,{color:"cyan",children:["Add"," ",I," ","env:"," ",C==="key"?e.jsxs(o,{children:["key=",e.jsx(o,{color:"yellow",children:S||"_"})," ","(Enter to set value)"]}):e.jsxs(o,{children:[S,"=",e.jsx(o,{color:"yellow",children:H||"_"})," ","(Enter to confirm, Esc to cancel)"]})]})})]});break}case"extensions":{F=e.jsx(wt,{config:r.config,fieldIndex:r.fieldIndex,scrollOffset:M,searchText:r.extensionSearch,viewportHeight:J});break}case"features":{F=e.jsx(yt,{config:r.config,fieldIndex:r.fieldIndex,scrollOffset:M,searchText:r.featureSearch,viewportHeight:J});break}case"general":{F=e.jsx(Et,{config:r.config,fieldEditing:r.fieldEditing,fieldIndex:r.fieldIndex,onUpdate:u=>{t.updateConfig(u)}});break}case"lifecycle":{F=e.jsx(Tt,{config:r.config,fieldEditing:r.fieldEditing,fieldIndex:r.fieldIndex,onSetCommand:(u,h)=>{t.setLifecycleCommand(u,h)}});break}case"mounts":{F=e.jsx(Ft,{addingMount:oe,config:r.config,detectedPm:r.detectedPm,fieldIndex:r.fieldIndex,mountPhase:O,mountSource:re,mountTarget:ne,mountType:me,suggestedMounts:r.suggestedMounts});break}case"ports":{F=e.jsx(Lt,{addingPort:U,addPortValue:Q,config:r.config,fieldIndex:r.fieldIndex});break}default:F=e.jsx(o,{children:"Unknown section"})}const Le=e.jsxs(s,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:[e.jsxs(s,{flexGrow:1,flexWrap:"wrap",gap:2,paddingX:1,children:[e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"q"}),e.jsx(o,{dimColor:!0,children:"QUIT"})]}),e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"?"}),e.jsx(o,{dimColor:!0,children:"HELP"})]}),e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"↑↓"}),e.jsx(o,{dimColor:!0,children:"NAV"})]}),(r.section==="features"||r.section==="extensions")&&e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"Space"}),e.jsx(o,{dimColor:!0,children:"CHECK"})]}),e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"←→"}),e.jsx(o,{dimColor:!0,children:"TABS"})]}),e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"Tab"}),e.jsx(o,{dimColor:!0,children:"PANEL"})]}),(r.section==="features"||r.section==="extensions")&&e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"/"}),e.jsx(o,{dimColor:!0,children:"FILTER"})]}),e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"s"}),e.jsx(o,{dimColor:!0,children:"SAVE"})]})]}),e.jsxs(s,{paddingX:1,children:[b&&e.jsxs(o,{color:b.startsWith("Error")?"red":"green",children:[b," "]}),r.isDirty&&e.jsx(o,{color:"yellow",children:"[modified]"}),!r.isDirty&&!b&&e.jsx(o,{dimColor:!0,children:"[saved]"})]})]}),Oe=e.jsxs(We,{footer:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(o,{bold:!0,color:"white",children:"?"}),"/",e.jsx(o,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:ie,title:"KEYBOARD SHORTCUTS",visible:a,width:56,children:[e.jsxs(s,{flexDirection:"column",marginBottom:1,children:[e.jsxs(s,{marginBottom:1,children:[e.jsx(o,{dimColor:!0,children:"── "}),e.jsx(o,{bold:!0,color:"white",children:"NAVIGATION"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"←→"}),e.jsx(o,{dimColor:!0,children:" Switch tabs"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"}),"/",e.jsx(o,{bold:!0,color:"white",children:"j/k"}),e.jsx(o,{dimColor:!0,children:" Navigate within section"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"Tab"}),e.jsx(o,{dimColor:!0,children:" Switch editor/preview panel"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"Enter"}),e.jsx(o,{dimColor:!0,children:" Edit selected field"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"Esc"}),e.jsx(o,{dimColor:!0,children:" Stop editing / cancel"})]})]}),e.jsxs(s,{flexDirection:"column",marginBottom:1,children:[e.jsxs(s,{marginBottom:1,children:[e.jsx(o,{dimColor:!0,children:"── "}),e.jsx(o,{bold:!0,color:"white",children:"FEATURES / EXTENSIONS"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"Space"}),e.jsx(o,{dimColor:!0,children:" Toggle selection"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"/"}),e.jsx(o,{dimColor:!0,children:" Search / filter"})]})]}),e.jsxs(s,{flexDirection:"column",marginBottom:1,children:[e.jsxs(s,{marginBottom:1,children:[e.jsx(o,{dimColor:!0,children:"── "}),e.jsx(o,{bold:!0,color:"white",children:"LISTS (Ports, Mounts, Env)"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"a"}),e.jsx(o,{dimColor:!0,children:" Add new entry"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"d"}),e.jsx(o,{dimColor:!0,children:" Delete selected entry"})]})]}),e.jsxs(s,{flexDirection:"column",children:[e.jsxs(s,{marginBottom:1,children:[e.jsx(o,{dimColor:!0,children:"── "}),e.jsx(o,{bold:!0,color:"white",children:"ACTIONS"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"s"}),e.jsx(o,{dimColor:!0,children:" Save configuration"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"q"}),e.jsx(o,{dimColor:!0,children:" Quit"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"?"}),e.jsx(o,{dimColor:!0,children:" Toggle help"})]})]})]}),Pe=e.jsx(Ot,{focused:D==="preview",hadComments:r.hadComments,jsonPreview:Fe,mode:r.mode,scrollRef:R}),fe=c>=Mt,Me=fe?Math.floor(c*.38):0;return e.jsxs(s,{flexDirection:"column",height:l,width:c,children:[e.jsxs(s,{flexShrink:0,gap:1,paddingX:1,children:[e.jsx(o,{bold:!0,inverse:!0,children:" VIS "}),e.jsxs(o,{wrap:"truncate",children:[r.mode==="create"?"Create":"Edit"," ","devcontainer"]})]}),e.jsx(s,{flexShrink:0,paddingX:1,paddingY:1,children:e.jsx(tt,{defaultValue:r.section,keyMap:{useNumbers:!1,useTab:!1},onChange:u=>{t.setSection(u),k("editor")},showIndex:!1,children:Te.map(({id:u,label:h})=>e.jsx(ot,{name:u,children:h},u))})}),e.jsx(s,{flexShrink:0,paddingRight:2,children:e.jsx(o,{dimColor:!0,wrap:"truncate",children:Nt.get(r.section)??""})}),e.jsxs(s,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[e.jsx(s,{borderColor:D==="editor"?"white":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,overflow:"hidden",children:F}),fe&&e.jsx(s,{flexShrink:0,width:Me,children:Pe})]}),Le,e.jsx(Ve,{autoExitSeconds:3,onCancel:()=>{g(!1)},visible:f}),Oe]})},Kt=async({logger:i,options:t,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a monorepo or project directory.");const c=n,l=t.template,r=t.output,a=!!process.stdout.isTTY&&!Xe;let m=null;try{m=Ke(c).name}catch{}const f=nt(c);let g=f?.config??null;const v=f?.hadComments??!1;if(l&&!f){const k=V.find(M=>M.id===l);if(!k){const M=V.map(L=>L.id).join(", ");throw new Error(`Unknown template "${l}". Valid templates: ${M}`)}g=k.config}if(!a){g?i.info(JSON.stringify(g,null,2)):(i.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 x=setInterval(()=>{},1e3),b=new lt(g,v,m);l&&!f&&b.dismissTemplateSelector();let y=null;if(await Ue(He.createElement(Bt,{onSave:k=>{it(c,k,r),y=k},store:b}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),clearInterval(x),y){const k=r??".devcontainer/devcontainer.json";i.info(`DevContainer config saved to ${k}`)}};export{Kt as default};