@flisk-sh/flisk 1.3.199 → 1.3.201

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 (34) hide show
  1. package/cli/dist/cli.js +39 -16
  2. package/cli/dist/commands/open.js +16 -3
  3. package/cli/dist/utils/one-command.js +34 -0
  4. package/cli/dist/utils/project-templates.js +14 -0
  5. package/cli/dist/utils/stack-progress.js +66 -0
  6. package/cli/dist/utils/up-readiness.js +9 -2
  7. package/cli/dist-bundle/chunk-5ZSZ4WCI.js +2 -0
  8. package/cli/dist-bundle/chunk-GCFNSFW7.js +52 -0
  9. package/cli/dist-bundle/chunk-GNNN2WCF.js +4 -0
  10. package/cli/dist-bundle/{chunk-3SPYAO2E.js → chunk-KXKBWLTE.js} +1 -1
  11. package/cli/dist-bundle/{chunk-GW7N23FV.js → chunk-LYOSHFYU.js} +1 -1
  12. package/cli/dist-bundle/chunk-M6S25PIS.js +366 -0
  13. package/cli/dist-bundle/chunk-NC6KOYDN.js +2 -0
  14. package/cli/dist-bundle/chunk-R67UHACQ.js +24 -0
  15. package/cli/dist-bundle/chunk-S5EXKK7H.js +34 -0
  16. package/cli/dist-bundle/cli.js +203 -203
  17. package/cli/dist-bundle/cold-preflight-6Z4RBFKV.js +2 -0
  18. package/cli/dist-bundle/one-command-YP6L6MMM.js +5 -0
  19. package/cli/dist-bundle/open-SMKISRHH.js +2 -0
  20. package/cli/dist-bundle/project-WEC2GSR7.js +2 -0
  21. package/cli/dist-bundle/stack-progress-UVREHNNB.js +2 -0
  22. package/cli/dist-bundle/tilt-port-owner-67UVQJTX.js +2 -0
  23. package/cli/package.json +1 -1
  24. package/package.json +1 -1
  25. package/cli/dist-bundle/chunk-6357RMGA.js +0 -4
  26. package/cli/dist-bundle/chunk-7IWOM6M2.js +0 -5
  27. package/cli/dist-bundle/chunk-HSNRMF4B.js +0 -435
  28. package/cli/dist-bundle/chunk-KGKKDD4K.js +0 -2
  29. package/cli/dist-bundle/chunk-WMK2PS63.js +0 -34
  30. package/cli/dist-bundle/cold-preflight-WR2M53Z6.js +0 -2
  31. package/cli/dist-bundle/one-command-7OW747ML.js +0 -4
  32. package/cli/dist-bundle/open-635MSZHV.js +0 -2
  33. package/cli/dist-bundle/project-R7P6QBF4.js +0 -2
  34. package/cli/dist-bundle/project-templates-BHURA3LT.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
+ import{A as d,B as e,C as f,D as g,E as h,F as i,G as j,x as a,y as b,z as c}from"./chunk-GCFNSFW7.js";import"./chunk-R67UHACQ.js";import"./chunk-KXKBWLTE.js";import"./chunk-42IVF3YT.js";import"./chunk-M6S25PIS.js";import"./chunk-5ZSZ4WCI.js";import"./chunk-LYOSHFYU.js";import"./chunk-CF46CD6R.js";import"./chunk-6EA4DGCY.js";export{c as MACHINE_CHECK_IDS,a as RUNTIME_CHECK_IDS,b as SCAFFOLD_CHECK_IDS,h as assertMachineReadyOrExit,i as detectRuntimePrerequisites,g as formatColdPreflight,j as formatRuntimeNextSteps,d as nodeTooOld,e as requireVerifiedDockerVersions,f as runColdPreflight};
@@ -0,0 +1,5 @@
1
+ import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
+ import"./chunk-6EA4DGCY.js";import{spawn as d}from"node:child_process";import{readdirSync as p}from"node:fs";import{join as l}from"node:path";var m="Frontend URLs";function g(r){let o=r.split(`
3
+ `),t=o.findIndex(e=>e.includes(m));if(t!==-1)for(let e of o.slice(t+1)){let n=e.match(/^\s*-\s+\S+:\s+(https?:\/\/\S+)/);if(n)return n[1];if(e.trim()===""||e.includes("URLs:"))break}}function j(r,o,t=process.env,e=d){return new Promise(n=>{let s=e(process.execPath,[r,"project","--yes"],{cwd:o,env:t,stdio:["inherit","inherit","pipe"]}),c="";s.stderr?.on("data",i=>{c+=String(i)}),s.on("error",i=>n({ok:!1,error:i.message})),s.on("close",i=>{if(i===0){n({ok:!0});return}let u=c.split(`
4
+ `).map(a=>a.trim()).filter(Boolean).pop();n({ok:!1,error:u??`the project setup failed (code ${i})`})})})}function h(r){for(let o of r.split(`
5
+ `)){let t=o.trim();if(t.startsWith("{"))try{let e=JSON.parse(t),s=(e.data??{}).ok===!0;return{ok:s,data:e.data??{},error:s?void 0:e.errors?.[0]?.message??"the stack did not come up",raw:r}}catch{}}}function P(r,o,t=process.env,e=d){return new Promise(n=>{let s=e(process.execPath,[r,"up","--json"],{cwd:o,env:t,stdio:["inherit","pipe","pipe"]}),c="",i=!1,u=a=>{i||(i=!0,s.unref?.(),n(a))};s.stdout?.on("data",a=>{c+=String(a);let f=h(c);f&&u(f)}),s.stderr?.on("data",a=>{c+=String(a)}),s.on("error",a=>u({ok:!1,error:a.message,raw:c})),s.on("close",a=>u({ok:!1,error:`the stack stopped before it was ready (code ${a})`,raw:c}))})}function R(r,o){if(!o(r))return r;for(let t=2;t<1e3;t+=1){let e=`${r}-${t}`;if(!o(e))return e}return r}function k(r,o=4){let t=[],e=(n,s)=>{if(s>o)return;let c;try{c=p(n,{withFileTypes:!0}).map(i=>i.name)}catch{return}c.includes("package.json")&&t.push(n);for(let i of p(n,{withFileTypes:!0}))!i.isDirectory()||i.name==="node_modules"||i.name.startsWith(".")||e(l(n,i.name),s+1)};return e(r,0),t}async function D(r,o=x){let t=[];for(let e of k(r)){let n=await o("bun",["install"],e);t.push({dir:e,ok:n===0})}return t}function x(r,o,t){return new Promise(e=>{let n=d(r,o,{cwd:t,stdio:"ignore"});n.on("error",()=>e(1)),n.on("close",s=>e(s??1))})}export{g as findFrontendUrl,k as findServiceDirs,j as initializeProject,D as installServiceDependencies,R as nextAvailableProjectDir,h as parseStackEnvelope,P as runStackQuiet};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
+ import{e as a,f as b,g as c,h as d,i as e,j as f}from"./chunk-GNNN2WCF.js";import"./chunk-DTIHDMED.js";import"./chunk-R67UHACQ.js";import"./chunk-5ZSZ4WCI.js";import"./chunk-LYOSHFYU.js";import"./chunk-CF46CD6R.js";import"./chunk-6EA4DGCY.js";export{d as findReadyFrontend,b as isFrontendReady,a as listFrontendTargets,f as openCommand,e as openFirstFrontend,c as pickReadyFrontend};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
+ import{h as a,i as b,j as c,k as d}from"./chunk-S5EXKK7H.js";import"./chunk-KXKBWLTE.js";import"./chunk-42IVF3YT.js";import"./chunk-LYOSHFYU.js";import"./chunk-CF46CD6R.js";import"./chunk-6EA4DGCY.js";export{c as cloneProjectTemplate,a as enableDiscoveredStacks,d as projectCommand,b as templateTargetDir};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
+ import"./chunk-6EA4DGCY.js";import{execFile as m}from"node:child_process";async function g(e,r="tilt"){let a=await new Promise(n=>{m(r,["get","uiresources","-o","json","--port",String(e)],{timeout:15e3,maxBuffer:16777216},(u,i)=>n(u?null:i))});if(!a)return;let o=[];try{o=JSON.parse(a).items??[]}catch{return}let t=[],d=[],l=0,c=0,f=0,p=0;for(let n of o){let u=n.metadata?.name??"unknown",i=n.status?.updateStatus??"",s=n.status?.runtimeStatus??"";if(i==="error"||s==="error"){p+=1,d.push({name:u,message:(n.status?.buildHistory?.[0]?.error??"the resource failed").replace(/\s+/g," ").slice(0,160)});continue}if(i==="ok"&&(s==="ok"||s==="not_applicable"||s==="")){l+=1;continue}if(i==="pending"||i===""){f+=1,t.push({name:u,state:s||"pending"});continue}c+=1,t.push({name:u,state:i})}return{ready:l,building:c,pending:f,failed:p,total:o.length,working:t,broken:d}}function $(e){let r=Math.floor(e.elapsed/60),a=Math.round(e.elapsed%60),o=r>0?`${r}m ${a}s`:`${a}s`,t=[`${e.ready}/${e.total} resources ready`,o];return e.building>0&&t.push(`${e.building} building`),e.pending>0&&t.push(`${e.pending} queued`),e.failed>0&&t.push(`${e.failed} failed`),t.join(" \xB7 ")}export{$ as formatProgress,g as readStackProgress};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
+ import{a,b,c}from"./chunk-NC6KOYDN.js";import"./chunk-M6S25PIS.js";import"./chunk-5ZSZ4WCI.js";import"./chunk-LYOSHFYU.js";import"./chunk-CF46CD6R.js";import"./chunk-6EA4DGCY.js";export{c as classifyTiltPorts,a as findTiltPortOwner,b as isForeignTilt};
package/cli/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tdk-cli-internal",
3
3
  "private": true,
4
- "version": "1.3.199",
4
+ "version": "1.3.201",
5
5
  "description": "Flisk CLI — start services on your machine.",
6
6
  "keywords": [
7
7
  "flisk",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flisk-sh/flisk",
3
- "version": "1.3.199",
3
+ "version": "1.3.201",
4
4
  "description": "Flisk CLI — start services on your machine.",
5
5
  "homepage": "https://flisk.sh",
6
6
  "repository": {
@@ -1,4 +0,0 @@
1
- import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
- import{a as x}from"./chunk-DTIHDMED.js";import{g as w,h as y}from"./chunk-7IWOM6M2.js";import{Ra as h,ba as d,ca as u,d as l,k as f,ra as m,s as p,ta as g}from"./chunk-GW7N23FV.js";import{b as a}from"./chunk-CF46CD6R.js";import{Command as O}from"commander";import{readFileSync as $}from"node:fs";import{join as j}from"node:path";function A(n){let e=n.config;return e?Array.isArray(e.featuresEnabled)&&e.featuresEnabled.includes(l)?!0:(Array.isArray(e.dependsOn)?e.dependsOn:[]).some(t=>y.includes(t)):!1}function H(n,e){let i=n.replace(/-/g,"_"),t=[];for(let o of[...e].sort((r,s)=>r.name.localeCompare(s.name))){let r=o.resources.filter(A).map(s=>s.name);r.length!==0&&t.push({name:`${i}_${o.name.replace(/-/g,"_")}`,stack:o.name,services:r.sort()})}return t.length===0?null:{name:"postgres",databases:t}}function k(n){try{let e=JSON.parse($(j(n,".tdk",f),"utf-8"));return typeof e?.project?.name=="string"?e.project.name:null}catch{return null}}import{spawn as P}from"node:child_process";function N(n){try{let e=new URL(n);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function S(n,e=process.platform,i=P){if(!N(n))return Promise.resolve(!1);let t,o;return e==="darwin"?(t="open",o=[n]):e==="win32"?(t="rundll32.exe",o=["url.dll,FileProtocolHandler",n]):(t="xdg-open",o=[n]),new Promise(r=>{try{let s=i(t,o,{stdio:"ignore",detached:!0,windowsHide:!0});s.once("error",()=>r(!1)),s.once("spawn",()=>{typeof s.unref=="function"&&s.unref(),r(!0)})}catch{r(!1)}})}function B(n,e=process.platform,i=P){return new Promise(t=>{let o,r;e==="darwin"?(o="pbcopy",r=[]):e==="win32"?(o="clip",r=[]):(o="xclip",r=["-selection","clipboard"]);try{let s=i(o,r,{stdio:["pipe","ignore","ignore"],windowsHide:!0});s.on("error",()=>{t(!1)}),s.on("close",c=>{t(c===0)}),s.stdin?(s.stdin.on("error",()=>{t(!1)}),s.stdin.write(n,"utf-8"),s.stdin.end()):t(!1)}catch{t(!1)}})}async function E(n){let{resources:e}=h(n),i=await w(n,{inspectDocker:!1}),{appBase:t}=m(i?.ingressHttp,n);return e.filter(o=>o.config?.appType==="frontend").map(o=>({name:o.name,url:`${t}${g(o)}`}))}async function b(n,e=2e3){try{return(await fetch(n,{signal:AbortSignal.timeout(e)})).status<500}catch{return!1}}async function T(n,e=3e4,i){if(n.length===0)return;let t=Date.now(),o=t+e;for(;;){for(let s of n)if(await b(s.url))return s;let r=Date.now()-t;if(r>=e)return;i?.(r),await new Promise(s=>setTimeout(s,2e3))}}async function Q(n,e=0,i){let t=await E(n);return T(t,e,i)}async function F(n){let e=n??p();if(!e)return console.log(a.yellow("Not in a Flisk project, so there is no frontend to open.")),console.log(a.gray("Run `flisk project --yes` first, or `flisk open` inside a project.")),null;let i=await E(e);if(i.length===0)return console.log(a.yellow("This project has no frontend service to open.")),console.log(a.gray("Start the stack with `flisk up` and add a frontend with `flisk resource`.")),null;let t=k(e);d(`Opening the first frontend of ${t??"this project"}`);for(let c of i)console.log(a.gray(` - ${c.name}: ${c.url}`));let o=x("Waiting for the frontend to answer..."),r=await T(i,12e4,c=>{o.text=`Waiting for the frontend to answer... ${Math.round(c/1e3)}s`});if(!r){o.fail("No frontend answered yet."),console.log(a.yellow("The stack is not serving the frontend yet.")),console.log(a.gray(" - Start the stack in another terminal: flisk up")),console.log(a.gray(" - Then run this again: flisk open"));for(let c of i)console.log(a.gray(` - ${c.name}: ${c.url}`));return null}o.succeed(`The frontend is up: ${r.name}`);let s=await S(r.url);return console.log(s?a.green(`
3
- Opened ${r.url}`):a.yellow(`
4
- Could not open a browser. Open ${r.url} yourself.`)),u("Run `flisk open` again to open the next frontend."),r.url}var X=new O("open").description("Open the first frontend of the project in your browser").action(async()=>{await F()});export{H as a,k as b,S as c,B as d,E as e,b as f,T as g,Q as h,F as i,X as j};
@@ -1,5 +0,0 @@
1
- import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
- import{Ta as w,cb as A,d as P,k as T}from"./chunk-GW7N23FV.js";import{execFileSync as x}from"node:child_process";import{existsSync as G,mkdirSync as W,readFileSync as D,realpathSync as Y,writeFileSync as q}from"node:fs";import{join as S,resolve as V,sep as X}from"node:path";import{createServer as U}from"node:net";import{connect as K}from"node:net";function N(e,s=500){return new Promise(t=>{let r=K({port:e,host:"127.0.0.1"}),o=n=>{r.destroy(),t(n)};r.setTimeout(s,()=>o(!1)),r.once("connect",()=>o(!0)),r.once("error",()=>o(!1))})}var J={ingressHttp:{start:8080,end:8180},ingressHttps:{start:8443,end:8543},postgres:{start:15432,end:15532}},E={ingressHttp:"TDK_HTTP_PORT",ingressHttps:"TDK_HTTPS_PORT",postgres:"TDK_POSTGRES_PORT"},H={ingressHttp:80,ingressHttps:443,postgres:5432},k={ingressHttp:H.ingressHttp,ingressHttps:H.ingressHttps};function j(e,s){return e==="EACCES"&&s==="darwin"}async function b(e){return await N(e)?!1:new Promise(s=>{let t=U();t.once("error",r=>{s(j(r.code,process.platform))}),t.listen(e,"127.0.0.1",()=>t.close(()=>s(!0)))})}function B(e,s){let t=Number(s);if(!Number.isInteger(t)||t<1||t>65535)throw new Error(`${e} must be an integer between 1 and 65535 (received ${JSON.stringify(s)})`);return t}async function O(e={}){let s=e.env??process.env,t=e.isAvailable??b,r={ingressHttp:!1,ingressHttps:!1,postgres:!1},o={ingressHttp:"",ingressHttps:"",postgres:""},n={explicit:r},c=new Set;for(let a of["ingressHttp","ingressHttps","postgres"]){let f=s[E[a]],i=f!==void 0&&f.trim()!=="",u=e.ranges?.[a]??J[a],p=k[a],h=i?[B(E[a],f)]:[...p===void 0?[]:[p],...Array.from({length:u.end-u.start+1},(g,_)=>u.start+_)],d;for(let g of h)if(!c.has(g)){if(await t(g)){d=g;break}if(i)throw new Error(`${E[a]}=${g} is already in use. Choose a free host port and retry.`)}if(d===void 0)throw new Error(`No available host port in ${u.start}-${u.end} for ${a}. Set ${E[a]} to a free port and retry.`);c.add(d),n[a]=d,r[a]=i,o[a]=i?"explicit override":d===p?"requested port is free":`selected from fallback range ${u.start}-${u.end}`}return{...n,requested:{...H},reason:o}}function ue(e){return`Host ports: HTTP ${e.ingressHttp}, HTTPS ${e.ingressHttps}, Postgres ${e.postgres}`}var R=S(".tdk",".tdk-out","host-ports.json");function Q(e,s,t){return e.split(`
3
- `).some(r=>{let[o="",n=""]=r.split("|"),c=o.toLowerCase(),a=s.toLowerCase();return(c.startsWith(`${a}_`)||c.startsWith(`${a}-`))&&n.includes(`:${t}->`)})}function F(e){let s=S(e,R);if(!G(s))return null;try{let t=JSON.parse(D(s,"utf-8"));if(!t||typeof t!="object")return null;let r=t;return!Number.isInteger(r.ingressHttp)||!Number.isInteger(r.ingressHttps)||!Number.isInteger(r.postgres)||!r.requested||!r.explicit||!r.reason?null:r}catch{return null}}function Se(e,s){let t=S(e,R);W(S(e,".tdk",".tdk-out"),{recursive:!0}),q(t,`${JSON.stringify(s,null,2)}
4
- `,{encoding:"utf-8",mode:384})}function _e(e){process.env.TDK_HTTP_PORT=String(e.ingressHttp),process.env.TDK_HTTPS_PORT=String(e.ingressHttps),process.env.TDK_POSTGRES_PORT=String(e.postgres)}var z="com.docker.compose.project.working_dir";function Z(e,s,t){let r=new Set([V(s)]);try{r.add(Y(s))}catch{}return e.split(`
5
- `).some(o=>{let[,n="",c=""]=o.split("|");return!c||!n.includes(`:${t}->`)?!1:[...r].some(a=>c===a||c.startsWith(`${a}${X}`))})}function Te(e,s,t=()=>x("docker",["ps","--format",`{{.Names}}|{{.Ports}}|{{.Label "${z}"}}`],{encoding:"utf-8",timeout:5e3})){let r=F(e);if(!r||r.ingressHttp===s)return s;try{if(Z(t(),e,r.ingressHttp))return r.ingressHttp}catch{}return s}async function Ee(e,s={}){let t=F(e),r=["TDK_HTTP_PORT","TDK_HTTPS_PORT","TDK_POSTGRES_PORT"].some(i=>process.env[i]);if(s.inspectDocker===!1&&t&&!r)return t;let o="";try{let i=JSON.parse(D(S(e,".tdk",T),"utf-8"));o=String(i?.project?.name??"tdk-project").replace(/-/g,"_").toLowerCase()}catch{o="tdk_project"}let n="";if(s.inspectDocker!==!1)try{n=x("docker",["ps","--format","{{.Names}}|{{.Ports}}"],{encoding:"utf-8",timeout:5e3})}catch{}let c=i=>Q(n,o,i),a=s.isPortFree??b,f=async i=>await a(i)||c(i);if(t&&!r){for(let i of[t.ingressHttp,t.ingressHttps,t.postgres])if(!await f(i))return O({isAvailable:f});for(let[i,u]of Object.entries(k)){let p=t[i];if(u!==void 0&&p!==u&&await f(u))return O({isAvailable:f})}return t}return O({isAvailable:f})}import{existsSync as ee,readFileSync as v}from"node:fs";import{join as l}from"node:path";var $=["postgres",P],L=["pre_alpha","alpha","beta","out_of_scope"];function te(e){return $.includes(e)}function C(e){try{return JSON.parse(v(l(e,".tdk",T),"utf-8"))}catch{return}}function m(e){try{return ee(e)?v(e,"utf-8"):void 0}catch{return}}function I(e,s){let t=o=>{let n=o;for(;n<e.length&&/\s/.test(e[n]);)n+=1;return n},r=0;for(;;){let o=e.indexOf(s,r);if(o===-1)return;let n=t(o+s.length);if(e[n]==="="&&(n=t(n+1),e[n]==="[")){let c=e.indexOf("]",n+1);return c===-1?void 0:[...e.slice(n+1,c).matchAll(/"([^"]+)"|'([^']+)'/g)].map(a=>a[1]??a[2]??"")}r=o+s.length}}function M(e){let s=l(e,".tdk",".tdk-out","Tiltfile"),t=m(s);if(t)return I(t,"ALWAYS_ENABLED_INFRA")}function se(e){let s=l(e,".tdk",".tdk-out","spec.master"),t=m(s);if(t!==void 0)return/"database-management"\s*:\s*True/.test(t)}function re(e){let s=l(e,".tdk",".tdk-out"),t=m(l(s,"Tiltfile")),r=m(l(s,"spec.master")),o=m(l(s,"tdk-cli-ext","discovery","config.star")),n=m(l(s,"tdk-cli-ext","engine","topologies","tilt","config","profiles.star"));if(!t||!r||!o||!n)return!1;let c=r.match(/PRE_ALPHA_RESOURCES\s*=\s*\{([^}]*)\}/)?.[1],a=I(o,"CORE_INFRA");return/FOCUS_MODE\s*,\s*FOCUS_ENABLED_ALL\s*,\s*FOCUS_ENABLED_RESOURCES\s*=\s*Config\.apply_focus\(cfg\)/.test(t)&&/if FOCUS_MODE and FOCUS_ENABLED_ALL\s*:/.test(t)&&/"[^"]+"\s*:\s*True|'[^']+'\s*:\s*True/.test(c??"")&&(a?.includes("postgres")??!1)&&/["']postgres["']\s*:\s*["']database-management["']/.test(o)&&/for infra in CORE_INFRA_EXPORT\s*:/.test(n)&&/needed\[INFRA_STACK_MAP_EXPORT\[infra\]\]\s*=\s*True/.test(n)}function ne(e){let s=C(e);if(!s)return!1;let t=s.phases??{};for(let o of L){let n=t[o]?.enabledStacks;if(Array.isArray(n)&&n.includes(P))return!0}let r=s.always_enabled_infra??A;return Array.isArray(r)&&r.includes(P)}function oe(e,s){let t=new Set;for(let n of $)t.add(n);for(let n of s)t.add(n.name),n.stack&&t.add(n.stack);let r=C(e);if(r){let n=r.phases??{};for(let a of L){let f=n[a]?.enabledStacks;if(Array.isArray(f))for(let i of f)t.add(i)}let c=r.always_enabled_infra??A;if(Array.isArray(c))for(let a of c)t.add(a)}let o=M(e);if(Array.isArray(o))for(let n of o)t.add(n);return t}function be(e,s=w(e)){let t=ne(e),r=M(e),o=Array.isArray(r)&&r.includes(P),n=se(e)===!0,c=t||o||n,a=!t&&re(e),f=oe(e,s),i=[],u=[];for(let d of s){let g=d.config?.dependsOn??[],_=!1;for(let y of g){if(te(y)){_=!0;continue}f.has(y)||u.push({resource:d.name,name:y})}_&&i.push(d.name)}let p=c||i.length>0,h=c?"feature":i.length>0?"dependsOn":"none";return{featureOn:c,featureOnFromProjectJson:t,featureOnFromTiltfile:o,featureOnFromSpecMaster:n,focusWouldEnableDatabaseManagement:a,dependsOnUsers:i,willStart:p,reason:h,unknownDependsOnNames:u}}export{O as a,ue as b,F as c,Se as d,_e as e,Te as f,Ee as g,$ as h,be as i};