@flisk-sh/flisk 1.4.5 → 1.4.7

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 (117) hide show
  1. package/README.md +37 -14
  2. package/cli/dist/agent-runtimes/custom.js +94 -13
  3. package/cli/dist/commands/agent.js +144 -123
  4. package/cli/dist/commands/doctor.js +62 -12
  5. package/cli/dist/commands/down.js +33 -1
  6. package/cli/dist/commands/logs.js +107 -3
  7. package/cli/dist/commands/project.js +27 -0
  8. package/cli/dist/commands/resource.js +3 -1
  9. package/cli/dist/commands/status.js +82 -34
  10. package/cli/dist/commands/ui.js +41 -2
  11. package/cli/dist/commands/up.js +173 -12
  12. package/cli/dist/commands/upgrade.js +2 -2
  13. package/cli/dist/components/DetailPanel.js +23 -3
  14. package/cli/dist/mcp/tools.js +9 -6
  15. package/cli/dist/types/index.js +0 -2
  16. package/cli/dist/utils/agent-format.js +18 -0
  17. package/cli/dist/utils/agent-sessions.js +122 -0
  18. package/cli/dist/utils/agent-skills.js +64 -0
  19. package/cli/dist/utils/bun-requirement.js +7 -4
  20. package/cli/dist/utils/cold-preflight.js +55 -32
  21. package/cli/dist/utils/doctor-fix-first.js +93 -0
  22. package/cli/dist/utils/doctor-native.js +96 -0
  23. package/cli/dist/utils/doctor-report.js +3 -0
  24. package/cli/dist/utils/native-project.js +41 -0
  25. package/cli/dist/utils/native-runtime.js +516 -0
  26. package/cli/dist/utils/native-service.js +95 -0
  27. package/cli/dist/utils/native-up.js +156 -0
  28. package/cli/dist/utils/platform.js +1 -1
  29. package/cli/dist/utils/project-templates.js +1 -1
  30. package/cli/dist/utils/service-manifest.js +10 -1
  31. package/cli/dist/utils/services.js +11 -1
  32. package/cli/dist/utils/startup-report.js +45 -3
  33. package/cli/dist/utils/status-groups.js +23 -0
  34. package/cli/dist/utils/tilt-logs.js +8 -0
  35. package/cli/dist/utils/up-hints.js +42 -0
  36. package/cli/dist/utils/up-progress.js +117 -0
  37. package/cli/dist/utils/up-readiness.js +5 -0
  38. package/cli/dist-bundle/{chunk-Z5QEE4SW.js → chunk-6OW2GVQV.js} +1 -1
  39. package/cli/dist-bundle/chunk-B2JOM3HN.js +35 -0
  40. package/cli/dist-bundle/{chunk-VMVTECCK.js → chunk-F2DLIM75.js} +1 -1
  41. package/cli/dist-bundle/chunk-L6O7TT3K.js +18 -0
  42. package/cli/dist-bundle/chunk-MFY7RZ76.js +130 -0
  43. package/cli/dist-bundle/{chunk-SFOFTVYM.js → chunk-MYAYJF4Q.js} +1 -1
  44. package/cli/dist-bundle/{chunk-LUUJ4JB7.js → chunk-P7GZ6NGM.js} +1 -1
  45. package/cli/dist-bundle/{chunk-BP2M4OJ4.js → chunk-QEBN6ZVQ.js} +1 -1
  46. package/cli/dist-bundle/{chunk-4J2FLFUA.js → chunk-T44DEEL6.js} +1 -1
  47. package/cli/dist-bundle/{chunk-U42XZWXB.js → chunk-TIPSERWO.js} +1 -1
  48. package/cli/dist-bundle/{chunk-V36PT2HF.js → chunk-VYPB7MY5.js} +1 -1
  49. package/cli/dist-bundle/{chunk-TIYTGN5R.js → chunk-XHENT4KO.js} +1 -1
  50. package/cli/dist-bundle/{chunk-CGTWXWBU.js → chunk-YTBTCAWY.js} +1 -1
  51. package/cli/dist-bundle/cli.js +486 -396
  52. package/cli/dist-bundle/cold-preflight-DQVJUGBB.js +2 -0
  53. package/cli/dist-bundle/{demo-stage-G4W23BXW.js → demo-stage-F4YA7UL2.js} +1 -1
  54. package/cli/dist-bundle/{open-HQFT6WDC.js → open-ZUSSVPD3.js} +1 -1
  55. package/cli/dist-bundle/project-JFCTPRP5.js +2 -0
  56. package/cli/dist-bundle/{project-templates-IMJ3OX5I.js → project-templates-2VQPUBSQ.js} +1 -1
  57. package/cli/dist-bundle/{services-GLFKZBBZ.js → services-DOHDHOCT.js} +1 -1
  58. package/cli/dist-bundle/{tilt-port-owner-PJN4MPYE.js → tilt-port-owner-XODQHXHX.js} +1 -1
  59. package/cli/package.json +1 -1
  60. package/cli/templates/agent-skills/flisk-agent-ops/SKILL.md +39 -0
  61. package/cli/templates/agent-skills/flisk-build/SKILL.md +85 -0
  62. package/cli/templates/agent-skills/flisk-doctor/SKILL.md +28 -0
  63. package/cli/templates/agent-skills/flisk-recipe-ai-agent/SKILL.md +45 -0
  64. package/cli/templates/agent-skills/flisk-recipe-blog/SKILL.md +36 -0
  65. package/cli/templates/agent-skills/flisk-recipe-saas/SKILL.md +39 -0
  66. package/cli/templates/agent-skills/flisk-recipe-shop/SKILL.md +41 -0
  67. package/cli/templates/agent-skills/flisk-recipe-starters/SKILL.md +46 -0
  68. package/cli/templates/agent-skills/flisk-resource/SKILL.md +27 -0
  69. package/cli/templates/agent-skills/flisk-status/SKILL.md +25 -0
  70. package/cli/templates/agent-skills/flisk-troubleshoot/SKILL.md +227 -0
  71. package/cli/templates/agent-skills/flisk-up/SKILL.md +37 -0
  72. package/examples/{tdk-example → flisk-example}/README.md +2 -2
  73. package/package.json +2 -2
  74. package/runtime/discovery/AGENTS.md +1 -1
  75. package/runtime/discovery/TILT_DISCOVERY.star +1 -1
  76. package/runtime/discovery/deterministic.star +1 -1
  77. package/runtime/engine/AGENTS.md +3 -3
  78. package/runtime/engine/README.md +1 -1
  79. package/runtime/engine/REFACTORING_MANIFEST_SYSTEM.md +1 -1
  80. package/runtime/engine/assets/docker/wake-gateway/decide.ts +1 -1
  81. package/runtime/engine/assets/docker/wake-gateway/server.ts +2 -2
  82. package/runtime/engine/assets/scripts/mac-m1-resource-monitor.sh +6 -6
  83. package/runtime/engine/schemas/service-schema.json +87 -21
  84. package/runtime/engine/scripts/debug-container.sh +1 -1
  85. package/runtime/engine/scripts/generate-manifest.sh +2 -2
  86. package/runtime/engine/topologies/platform/docker/compose/traefik_standalone.star +19 -4
  87. package/runtime/engine/topologies/platform/docker/constants.star +2 -2
  88. package/runtime/engine/topologies/platform/docker/networking/traefik_static_routes.star +2 -2
  89. package/runtime/engine/topologies/tilt/manifest/mapper.star +1 -1
  90. package/runtime/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +8 -2
  91. package/runtime/ext/ide-components/README.md +1 -1
  92. package/runtime/ext/ui-enhancements/extension.yaml +2 -2
  93. package/runtime/specs/specs/TILT_SERVICE_DEFAULTS.star +1 -1
  94. package/runtime/specs/specs/TILT_TECH_STACK.star +1 -1
  95. package/cli/dist-bundle/chunk-BMHPPX2Q.js +0 -35
  96. package/cli/dist-bundle/chunk-PEZQEZVV.js +0 -17
  97. package/cli/dist-bundle/chunk-ULMQVD7J.js +0 -122
  98. package/cli/dist-bundle/cold-preflight-3BNDOLGS.js +0 -2
  99. package/cli/dist-bundle/project-JZO2CPZZ.js +0 -2
  100. /package/examples/{tdk-example → flisk-example}/LICENSE +0 -0
  101. /package/examples/{tdk-example → flisk-example}/TILT_SERVICE_DEFAULTS.star +0 -0
  102. /package/examples/{tdk-example → flisk-example}/TILT_TECH_STACK.star +0 -0
  103. /package/examples/{tdk-example → flisk-example}/Tiltfile +0 -0
  104. /package/examples/{tdk-example → flisk-example}/services/platform/messaging/docker-compose.yml +0 -0
  105. /package/examples/{tdk-example → flisk-example}/services/shop/orders-api/package.json +0 -0
  106. /package/examples/{tdk-example → flisk-example}/services/shop/orders-api/service.json +0 -0
  107. /package/examples/{tdk-example → flisk-example}/services/shop/orders-api/src/index.ts +0 -0
  108. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/index.html +0 -0
  109. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/package.json +0 -0
  110. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/public/.gitkeep +0 -0
  111. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/service.json +0 -0
  112. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/src/main.tsx +0 -0
  113. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/src/orders.tsx +0 -0
  114. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/src/style.css +0 -0
  115. /package/examples/{tdk-example → flisk-example}/services/shop/orders-worker/package.json +0 -0
  116. /package/examples/{tdk-example → flisk-example}/services/shop/orders-worker/service.json +0 -0
  117. /package/examples/{tdk-example → flisk-example}/services/shop/orders-worker/src/index.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
2
- import{E as H,a as h,ha as D,ia as U,t as x}from"./chunk-PEZQEZVV.js";import{C as j,L as R,j as A,m as w,n as F,t as L,x as T}from"./chunk-U42XZWXB.js";import{execFileSync as K}from"node:child_process";import{existsSync as de,mkdirSync as fe,readFileSync as G,realpathSync as pe,writeFileSync as he}from"node:fs";import{join as $,resolve as me,sep as ge}from"node:path";import{createServer as ae}from"node:net";import{connect as ie}from"node:net";function B(e,t=500){return new Promise(r=>{let s=ie({port:e,host:"127.0.0.1"}),n=o=>{s.destroy(),r(o)};s.setTimeout(t,()=>n(!1)),s.once("connect",()=>n(!0)),s.once("error",()=>n(!1))})}var ce={ingressHttp:{start:8080,end:8180},ingressHttps:{start:8443,end:8543},postgres:{start:15432,end:15532}},b={ingressHttp:"FLISK_HTTP_PORT",ingressHttps:"FLISK_HTTPS_PORT",postgres:"FLISK_POSTGRES_PORT"},E={ingressHttp:80,ingressHttps:443,postgres:5432},O={ingressHttp:E.ingressHttp,ingressHttps:E.ingressHttps};function ue(e,t){return e==="EACCES"&&t==="darwin"}async function I(e){return await B(e)?!1:new Promise(t=>{let r=ae();r.once("error",s=>{t(ue(s.code,process.platform))}),r.listen(e,"127.0.0.1",()=>r.close(()=>t(!0)))})}function le(e,t){let r=Number(t);if(!Number.isInteger(r)||r<1||r>65535)throw new R(`${e} must be an integer between 1 and 65535 (received ${JSON.stringify(t)})`,["Provide a valid port number between 1 and 65535"],1);return r}async function _(e={}){let t=e.env??process.env,r=e.isAvailable??I,s={ingressHttp:!1,ingressHttps:!1,postgres:!1},n={ingressHttp:"",ingressHttps:"",postgres:""},o={explicit:s},c=new Set;for(let a of["ingressHttp","ingressHttps","postgres"]){let u=t[b[a]],i=u!==void 0&&u.trim()!=="",l=e.ranges?.[a]??ce[a],d=O[a],f=i?[le(b[a],u)]:[...d===void 0?[]:[d],...Array.from({length:l.end-l.start+1},(g,k)=>l.start+k)],m;for(let g of f)if(!c.has(g)){if(await r(g)){m=g;break}if(i)throw new R(`${b[a]}=${g} is already in use. Choose a free host port and retry.`,["Choose a different free host port or unset the environment variable to use fallback ranges"],1)}if(m===void 0)throw new R(`No available host port in ${l.start}-${l.end} for ${a}. Set ${b[a]} to a free port and retry.`,[`Free up port range ${l.start}-${l.end} or set ${b[a]} to an available port`],1);c.add(m),o[a]=m,s[a]=i,n[a]=i?"explicit override":m===d?"requested port is free":`selected from fallback range ${l.start}-${l.end}`}return{...o,requested:{...E},reason:n}}function Je(e){return`Host ports: HTTP ${e.ingressHttp}, HTTPS ${e.ingressHttps}, Postgres ${e.postgres}`}var V=$(".flisk",".flisk-out","host-ports.json");function ke(e,t,r){return e.split(`
2
+ import{J as H,a as h,ma as D,na as U,y as x}from"./chunk-L6O7TT3K.js";import{C as j,L as R,j as A,m as w,n as F,t as L,x as T}from"./chunk-TIPSERWO.js";import{execFileSync as K}from"node:child_process";import{existsSync as de,mkdirSync as fe,readFileSync as G,realpathSync as pe,writeFileSync as he}from"node:fs";import{join as $,resolve as me,sep as ge}from"node:path";import{createServer as ae}from"node:net";import{connect as ie}from"node:net";function B(e,t=500){return new Promise(r=>{let s=ie({port:e,host:"127.0.0.1"}),n=o=>{s.destroy(),r(o)};s.setTimeout(t,()=>n(!1)),s.once("connect",()=>n(!0)),s.once("error",()=>n(!1))})}var ce={ingressHttp:{start:8080,end:8180},ingressHttps:{start:8443,end:8543},postgres:{start:15432,end:15532}},b={ingressHttp:"FLISK_HTTP_PORT",ingressHttps:"FLISK_HTTPS_PORT",postgres:"FLISK_POSTGRES_PORT"},E={ingressHttp:80,ingressHttps:443,postgres:5432},O={ingressHttp:E.ingressHttp,ingressHttps:E.ingressHttps};function ue(e,t){return e==="EACCES"&&t==="darwin"}async function I(e){return await B(e)?!1:new Promise(t=>{let r=ae();r.once("error",s=>{t(ue(s.code,process.platform))}),r.listen(e,"127.0.0.1",()=>r.close(()=>t(!0)))})}function le(e,t){let r=Number(t);if(!Number.isInteger(r)||r<1||r>65535)throw new R(`${e} must be an integer between 1 and 65535 (received ${JSON.stringify(t)})`,["Provide a valid port number between 1 and 65535"],1);return r}async function _(e={}){let t=e.env??process.env,r=e.isAvailable??I,s={ingressHttp:!1,ingressHttps:!1,postgres:!1},n={ingressHttp:"",ingressHttps:"",postgres:""},o={explicit:s},c=new Set;for(let a of["ingressHttp","ingressHttps","postgres"]){let u=t[b[a]],i=u!==void 0&&u.trim()!=="",l=e.ranges?.[a]??ce[a],d=O[a],f=i?[le(b[a],u)]:[...d===void 0?[]:[d],...Array.from({length:l.end-l.start+1},(g,k)=>l.start+k)],m;for(let g of f)if(!c.has(g)){if(await r(g)){m=g;break}if(i)throw new R(`${b[a]}=${g} is already in use. Choose a free host port and retry.`,["Choose a different free host port or unset the environment variable to use fallback ranges"],1)}if(m===void 0)throw new R(`No available host port in ${l.start}-${l.end} for ${a}. Set ${b[a]} to a free port and retry.`,[`Free up port range ${l.start}-${l.end} or set ${b[a]} to an available port`],1);c.add(m),o[a]=m,s[a]=i,n[a]=i?"explicit override":m===d?"requested port is free":`selected from fallback range ${l.start}-${l.end}`}return{...o,requested:{...E},reason:n}}function Je(e){return`Host ports: HTTP ${e.ingressHttp}, HTTPS ${e.ingressHttps}, Postgres ${e.postgres}`}var V=$(".flisk",".flisk-out","host-ports.json");function ke(e,t,r){return e.split(`
3
3
  `).some(s=>{let[n="",o=""]=s.split("|"),c=n.toLowerCase(),a=t.toLowerCase();return(c.startsWith(`${a}_`)||c.startsWith(`${a}-`))&&o.includes(`:${r}->`)})}function W(e){let t=$(e,V);if(!de(t))return null;try{let r=JSON.parse(G(t,"utf-8"));if(!r||typeof r!="object")return null;let s=r;return!Number.isInteger(s.ingressHttp)||!Number.isInteger(s.ingressHttps)||!Number.isInteger(s.postgres)||!s.requested||!s.explicit||!s.reason?null:s}catch{return null}}function Xe(e,t){let r=$(e,V);fe($(e,".flisk",".flisk-out"),{recursive:!0}),he(r,`${JSON.stringify(t,null,2)}
4
4
  `,{encoding:"utf-8",mode:384})}function et(e){process.env.FLISK_HTTP_PORT=String(e.ingressHttp),process.env.FLISK_HTTPS_PORT=String(e.ingressHttps),process.env.FLISK_POSTGRES_PORT=String(e.postgres)}var Pe="com.docker.compose.project.working_dir";function Se(e,t,r){let s=new Set([me(t)]);try{s.add(pe(t))}catch{}return e.split(`
5
5
  `).some(n=>{let[,o="",c=""]=n.split("|");return!c||!o.includes(`:${r}->`)?!1:[...s].some(a=>c===a||c.startsWith(`${a}${ge}`))})}function tt(e,t,r=()=>K("docker",["ps","--format",`{{.Names}}|{{.Ports}}|{{.Label "${Pe}"}}`],{encoding:"utf-8",timeout:5e3})){let s=W(e);if(!s||s.ingressHttp===t)return t;try{if(Se(r(),e,s.ingressHttp))return s.ingressHttp}catch{}return t}async function rt(e,t={}){let r=W(e),s=["FLISK_HTTP_PORT","FLISK_HTTPS_PORT","FLISK_POSTGRES_PORT"].some(i=>process.env[i]);if(t.inspectDocker===!1&&r&&!s)return r;let n="";try{let i=JSON.parse(G($(e,".flisk",w),"utf-8"));n=String(i?.project?.name??"flisk-project").replace(/-/g,"_").toLowerCase()}catch{n="flisk_project"}let o="";if(t.inspectDocker!==!1)try{o=K("docker",["ps","--format","{{.Names}}|{{.Ports}}"],{encoding:"utf-8",timeout:5e3})}catch{}let c=i=>ke(o,n,i),a=t.isPortFree??I,u=async i=>await a(i)||c(i);if(r&&!s){for(let i of[r.ingressHttp,r.ingressHttps,r.postgres])if(!await u(i))return _({isAvailable:u});for(let[i,l]of Object.entries(O)){let d=r[i];if(l!==void 0&&d!==l&&await u(l))return _({isAvailable:u})}return r}return _({isAvailable:u})}import{execFileSync as X,execSync as S}from"node:child_process";import{existsSync as C,readdirSync as Te,readFileSync as N}from"node:fs";import{createServer as be}from"node:net";import{join as P}from"node:path";function J(e,t){return e==="pending"||e==="in_progress"||e==="none"||t==="pending"||t==="none"}var M="container is running, but its health check is failing";function z(e){let t=e?.runtimeStatus??"";if(t!=="ok")return t;let r=e?.composeResourceInfo?.healthStatus;return r==="unhealthy"?"error":r==="starting"?"pending":t}var y=1e4,q=3e3,$e="http://localhost:4873";function ee(e){return`'${e.replace(/'/g,"'\\''")}'`}function v(e,t,r,s,n){return process.platform==="win32"&&e===S?X(j(t)??t,r,{...n,windowsHide:!0}):e(s,n)}var ye=[80,443];function ve(e){return e.replace(/-/g,"_")}function we(e,t){let r=new Set(t),s=[];for(let n of e.split(`
@@ -1,2 +1,2 @@
1
1
  import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
2
- import{a as A}from"./chunk-CGTWXWBU.js";import{ha as _}from"./chunk-PEZQEZVV.js";import{f as u,m as S}from"./chunk-U42XZWXB.js";import{existsSync as w,readFileSync as h}from"node:fs";import{join as i}from"node:path";var O=["postgres",u],y=["pre_alpha","alpha","beta","out_of_scope"];function D(e){return O.includes(e)}function b(e){try{return JSON.parse(h(i(e,".flisk",S),"utf-8"))}catch{return}}function l(e){try{return w(e)?h(e,"utf-8"):void 0}catch{return}}function k(e,n){let s=r=>{let t=r;for(;t<e.length&&/\s/.test(e[t]);)t+=1;return t},a=0;for(;;){let r=e.indexOf(n,a);if(r===-1)return;let t=s(r+n.length);if(e[t]==="="&&(t=s(t+1),e[t]==="[")){let o=e.indexOf("]",t+1);return o===-1?void 0:[...e.slice(t+1,o).matchAll(/"([^"]+)"|'([^']+)'/g)].map(f=>f[1]??f[2]??"")}a=r+n.length}}function N(e){let n=i(e,".flisk",".flisk-out","Tiltfile"),s=l(n);if(s)return k(s,"ALWAYS_ENABLED_INFRA")}function M(e){let n=i(e,".flisk",".flisk-out","spec.master"),s=l(n);if(s!==void 0)return/"database-management"\s*:\s*True/.test(s)}function x(e){let n=i(e,".flisk",".flisk-out"),s=l(i(n,"Tiltfile")),a=l(i(n,"spec.master")),r=l(i(n,"flisk-cli-ext","discovery","config.star")),t=l(i(n,"flisk-cli-ext","engine","topologies","tilt","config","profiles.star"));if(!s||!a||!r||!t)return!1;let o=a.match(/PRE_ALPHA_RESOURCES\s*=\s*\{([^}]*)\}/)?.[1],f=k(r,"CORE_INFRA");return/FOCUS_MODE\s*,\s*FOCUS_ENABLED_ALL\s*,\s*FOCUS_ENABLED_RESOURCES\s*=\s*Config\.apply_focus\(cfg\)/.test(s)&&/if FOCUS_MODE and FOCUS_ENABLED_ALL\s*:/.test(s)&&/"[^"]+"\s*:\s*True|'[^']+'\s*:\s*True/.test(o??"")&&(f?.includes("postgres")??!1)&&/["']postgres["']\s*:\s*["']database-management["']/.test(r)&&/for infra in CORE_INFRA_EXPORT\s*:/.test(t)&&/needed\[INFRA_STACK_MAP_EXPORT\[infra\]\]\s*=\s*True/.test(t)}function C(e){let n=b(e);if(!n)return!1;let s=n.phases??{};for(let r of y){let t=s[r]?.enabledStacks;if(Array.isArray(t)&&t.includes(u))return!0}let a=n.always_enabled_infra??A;return Array.isArray(a)&&a.includes(u)}function L(e,n){let s=new Set;for(let t of O)s.add(t);for(let t of n)s.add(t.name),t.stack&&s.add(t.stack);let a=b(e);if(a){let t=a.phases??{};for(let f of y){let d=t[f]?.enabledStacks;if(Array.isArray(d))for(let c of d)s.add(c)}let o=a.always_enabled_infra??A;if(Array.isArray(o))for(let f of o)s.add(f)}let r=N(e);if(Array.isArray(r))for(let t of r)s.add(t);return s}function $(e,n=_(e)){let s=C(e),a=N(e),r=Array.isArray(a)&&a.includes(u),t=M(e)===!0,o=s||r||t,f=!s&&x(e),d=L(e,n),c=[],E=[];for(let p of n){let P=p.config?.dependsOn??[],g=!1;for(let m of P){if(D(m)){g=!0;continue}d.has(m)||E.push({resource:p.name,name:m})}g&&c.push(p.name)}let T=o||c.length>0,F=o?"feature":c.length>0?"dependsOn":"none";return{featureOn:o,featureOnFromProjectJson:s,featureOnFromTiltfile:r,featureOnFromSpecMaster:t,focusWouldEnableDatabaseManagement:f,dependsOnUsers:c,willStart:T,reason:F,unknownDependsOnNames:E}}export{O as a,$ as b};
2
+ import{a as A}from"./chunk-YTBTCAWY.js";import{ma as _}from"./chunk-L6O7TT3K.js";import{f as u,m as S}from"./chunk-TIPSERWO.js";import{existsSync as w,readFileSync as h}from"node:fs";import{join as i}from"node:path";var O=["postgres",u],y=["pre_alpha","alpha","beta","out_of_scope"];function D(e){return O.includes(e)}function b(e){try{return JSON.parse(h(i(e,".flisk",S),"utf-8"))}catch{return}}function l(e){try{return w(e)?h(e,"utf-8"):void 0}catch{return}}function k(e,n){let s=r=>{let t=r;for(;t<e.length&&/\s/.test(e[t]);)t+=1;return t},a=0;for(;;){let r=e.indexOf(n,a);if(r===-1)return;let t=s(r+n.length);if(e[t]==="="&&(t=s(t+1),e[t]==="[")){let o=e.indexOf("]",t+1);return o===-1?void 0:[...e.slice(t+1,o).matchAll(/"([^"]+)"|'([^']+)'/g)].map(f=>f[1]??f[2]??"")}a=r+n.length}}function N(e){let n=i(e,".flisk",".flisk-out","Tiltfile"),s=l(n);if(s)return k(s,"ALWAYS_ENABLED_INFRA")}function M(e){let n=i(e,".flisk",".flisk-out","spec.master"),s=l(n);if(s!==void 0)return/"database-management"\s*:\s*True/.test(s)}function x(e){let n=i(e,".flisk",".flisk-out"),s=l(i(n,"Tiltfile")),a=l(i(n,"spec.master")),r=l(i(n,"flisk-cli-ext","discovery","config.star")),t=l(i(n,"flisk-cli-ext","engine","topologies","tilt","config","profiles.star"));if(!s||!a||!r||!t)return!1;let o=a.match(/PRE_ALPHA_RESOURCES\s*=\s*\{([^}]*)\}/)?.[1],f=k(r,"CORE_INFRA");return/FOCUS_MODE\s*,\s*FOCUS_ENABLED_ALL\s*,\s*FOCUS_ENABLED_RESOURCES\s*=\s*Config\.apply_focus\(cfg\)/.test(s)&&/if FOCUS_MODE and FOCUS_ENABLED_ALL\s*:/.test(s)&&/"[^"]+"\s*:\s*True|'[^']+'\s*:\s*True/.test(o??"")&&(f?.includes("postgres")??!1)&&/["']postgres["']\s*:\s*["']database-management["']/.test(r)&&/for infra in CORE_INFRA_EXPORT\s*:/.test(t)&&/needed\[INFRA_STACK_MAP_EXPORT\[infra\]\]\s*=\s*True/.test(t)}function C(e){let n=b(e);if(!n)return!1;let s=n.phases??{};for(let r of y){let t=s[r]?.enabledStacks;if(Array.isArray(t)&&t.includes(u))return!0}let a=n.always_enabled_infra??A;return Array.isArray(a)&&a.includes(u)}function L(e,n){let s=new Set;for(let t of O)s.add(t);for(let t of n)s.add(t.name),t.stack&&s.add(t.stack);let a=b(e);if(a){let t=a.phases??{};for(let f of y){let d=t[f]?.enabledStacks;if(Array.isArray(d))for(let c of d)s.add(c)}let o=a.always_enabled_infra??A;if(Array.isArray(o))for(let f of o)s.add(f)}let r=N(e);if(Array.isArray(r))for(let t of r)s.add(t);return s}function $(e,n=_(e)){let s=C(e),a=N(e),r=Array.isArray(a)&&a.includes(u),t=M(e)===!0,o=s||r||t,f=!s&&x(e),d=L(e,n),c=[],E=[];for(let p of n){let P=p.config?.dependsOn??[],g=!1;for(let m of P){if(D(m)){g=!0;continue}d.has(m)||E.push({resource:p.name,name:m})}g&&c.push(p.name)}let T=o||c.length>0,F=o?"feature":c.length>0?"dependsOn":"none";return{featureOn:o,featureOnFromProjectJson:s,featureOnFromTiltfile:r,featureOnFromSpecMaster:t,focusWouldEnableDatabaseManagement:f,dependsOnUsers:c,willStart:T,reason:F,unknownDependsOnNames:E}}export{O as a,$ as b};
@@ -1,2 +1,2 @@
1
1
  import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
2
- import{f as A}from"./chunk-U42XZWXB.js";var o=[A,"proxy"];export{o as a};
2
+ import{f as A}from"./chunk-TIPSERWO.js";var o=[A,"proxy"];export{o as a};