@flisk-sh/flisk 1.3.189 → 1.3.190

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.
@@ -51,7 +51,7 @@ export function classifyRunningInstall(execPath, scriptPath, platformName = proc
51
51
  /** @internal Exported for unit tests only; not part of the package API. */
52
52
  export function windowsNpmUpgradeMessage(platformName, installInfo) {
53
53
  return platformName === "win32" && installInfo.method === "npm"
54
- ? "use npm install -g flisk@latest"
54
+ ? "use npm install -g @flisk-sh/flisk@latest"
55
55
  : null;
56
56
  }
57
57
  /** @internal Exported for unit tests only; not part of the package API. */
@@ -333,7 +333,7 @@ export async function getLatestVersion() {
333
333
  try {
334
334
  let result;
335
335
  if (isWindows()) {
336
- const response = await fetch("https://registry.npmjs.org/flisk/latest", {
336
+ const response = await fetch("https://registry.npmjs.org/@flisk-sh%2fflisk/latest", {
337
337
  signal: AbortSignal.timeout(10_000),
338
338
  });
339
339
  if (!response.ok)
@@ -344,7 +344,7 @@ export async function getLatestVersion() {
344
344
  throw new Error("npm registry response did not include a version");
345
345
  }
346
346
  else {
347
- result = execSync("npm view flisk version", {
347
+ result = execSync("npm view @flisk-sh/flisk version", {
348
348
  encoding: "utf-8",
349
349
  timeout: 10000,
350
350
  }).trim();
@@ -356,8 +356,8 @@ export async function getLatestVersion() {
356
356
  logVerbose("npm registry check failed", err);
357
357
  spinner.warn("Could not check the npm registry");
358
358
  console.log(chalk.yellow("\nInstall the latest published release manually:"));
359
- console.log(chalk.cyan(" npm install -g flisk@latest"));
360
- console.log(chalk.cyan(" bun install -g flisk@latest"));
359
+ console.log(chalk.cyan(" npm install -g @flisk-sh/flisk@latest"));
360
+ console.log(chalk.cyan(" bun install -g @flisk-sh/flisk@latest"));
361
361
  return null;
362
362
  }
363
363
  }
@@ -365,7 +365,7 @@ export async function getLatestVersion() {
365
365
  export async function upgradeViaNpm() {
366
366
  const spinner = startSpinner("Upgrading via npm...");
367
367
  try {
368
- execSync("npm install -g flisk@latest", {
368
+ execSync("npm install -g @flisk-sh/flisk@latest", {
369
369
  stdio: ["inherit", "inherit", "pipe"],
370
370
  timeout: 120000,
371
371
  });
@@ -381,7 +381,7 @@ export async function upgradeViaNpm() {
381
381
  logVerbose("npm upgrade error", err);
382
382
  spinner.fail(`npm upgrade failed: ${getErrorMessage(err)}`);
383
383
  console.log(chalk.yellow("\nTo retry manually, install the latest published npm release:"));
384
- console.log(chalk.cyan(" npm install -g flisk@latest"));
384
+ console.log(chalk.cyan(" npm install -g @flisk-sh/flisk@latest"));
385
385
  const errorCode = err && typeof err === "object" && "code" in err
386
386
  ? String(err.code ?? "")
387
387
  : "";
@@ -399,7 +399,7 @@ export async function upgradeViaNpm() {
399
399
  export async function upgradeViaBun() {
400
400
  const spinner = startSpinner("Upgrading via bun...");
401
401
  try {
402
- execFileSync(findOnPath("bun") ?? "bun", ["install", "-g", "flisk@latest"], {
402
+ execFileSync(findOnPath("bun") ?? "bun", ["install", "-g", "@flisk-sh/flisk@latest"], {
403
403
  stdio: "inherit",
404
404
  timeout: 120000,
405
405
  });
@@ -410,7 +410,7 @@ export async function upgradeViaBun() {
410
410
  logVerbose("bun upgrade error", err);
411
411
  spinner.fail(`Bun upgrade failed: ${getErrorMessage(err)}`);
412
412
  console.log(chalk.yellow("\nTo retry manually, install the latest published Bun release:"));
413
- console.log(chalk.cyan(" bun install -g flisk@latest"));
413
+ console.log(chalk.cyan(" bun install -g @flisk-sh/flisk@latest"));
414
414
  return false;
415
415
  }
416
416
  }
@@ -624,8 +624,8 @@ export function createUpgradeCommand() {
624
624
  if (installInfo.method === "unknown") {
625
625
  console.error(chalk.red("Could not detect installation method"));
626
626
  console.log(chalk.yellow("\nManual upgrade using a published package:"));
627
- console.log(chalk.cyan(" npm install -g flisk@latest"));
628
- console.log(chalk.cyan(" bun install -g flisk@latest"));
627
+ console.log(chalk.cyan(" npm install -g @flisk-sh/flisk@latest"));
628
+ console.log(chalk.cyan(" bun install -g @flisk-sh/flisk@latest"));
629
629
  console.log(chalk.cyan(" git: cd /path/to/tdk-cli && git pull && bun link --force"));
630
630
  process.exit(1);
631
631
  }
@@ -32,7 +32,7 @@ function getPackageInfo() {
32
32
  }
33
33
  const packageInfo = parsed;
34
34
  packageCache = {
35
- name: String(packageInfo.name ?? "flisk"),
35
+ name: String(packageInfo.name ?? "@flisk-sh/flisk"),
36
36
  version: String(packageInfo.version ?? "0.0.0"),
37
37
  fullPackage: packageInfo,
38
38
  };
@@ -17,7 +17,7 @@ import{c as et,e as yn}from"./chunk-BZ4H7MM4.js";import{a as Dt}from"./chunk-6EA
17
17
  `)}function Ca(e){let t=e.match(/^[a-z][a-z0-9+.-]*:\/\/[^:/@\s]+:([^@\s]*)@/i);if(!(!t||t[1].includes("$")))return t[1]}function Vn(e){let t=Yt(e,".env"),r={missing:[],invalid:[],warnings:[]};if(!zt(t))return{missing:ye.filter(i=>i.required).map(i=>i.name),invalid:[],warnings:[".env file not found - will be auto-generated"]};let n=Se(Mn(t,"utf-8"));for(let i of ye)i.required&&!n.has(i.name)&&r.missing.push(i.name),n.has(i.name)&&!(n.get(i.name)??"").trim()&&r.invalid.push(`${i.name} is set but empty`);let s=n.get("DATABASE_URL"),o=n.get("DB_PASSWORD");if(s&&o){let i=Ca(s);i!==void 0&&i!==o&&r.warnings.push("DATABASE_URL carries a different password than DB_PASSWORD; the database container uses DB_PASSWORD")}return r}function Da(e,t,r){if(!Se(e).has(t))return e;let s=e.indexOf("=");if(s<0)return e;let o=e.slice(s+1),i=o.search(/\s#/),a=i<0?"":o.slice(i);return e.slice(0,s+1)+r+a}function df(e){let t=Yt(e,".env");if(!zt(t))return Un(t,Gn(),{mode:384}),ye.map(d=>d.name);let r=Mn(t,"utf-8"),n=Se(r),s=ye.filter(d=>d.complete?n.has(d.name)?!(n.get(d.name)??"").trim():!0:!1);if(s.length===0)return[];let o=s.filter(d=>!n.has(d.name)),i=s.filter(d=>n.has(d.name)),a=n.get("DB_PASSWORD"),c=a?.trim()?a:Bn(),l=r.split(/(\r\n|\n|\r)/);for(let d of i){let p=-1;for(let g=0;g<l.length;g+=2)Se(l[g]).has(d.name)&&(p=g);if(p<0)throw new Error(`Could not locate empty .env assignment for ${d.name}`);l[p]=Da(l[p],d.name,qt(d.name,c))}let u=l.join("");if(o.length>0){let d=["","# Added by Flisk: keys this version expects. Existing values above were not changed.",""];for(let g of o)d.push(...Hn(g)),d.push(`${g.name}=${qt(g.name,c)}`),d.push("");let p=u.endsWith(`
18
18
  `)||u.endsWith("\r")?"":`
19
19
  `;u+=p+d.join(`
20
- `)}return Ie(t,u),s.map(d=>d.name)}function pf(e){let t=Yt(e,".env");return zt(t)?!1:(Un(t,Gn(),{mode:384}),!0)}var La="[REDACTED]",Le=class extends Error{path;constructor(t,r){super(`Could not read ${t}: ${r}`),this.path=t,this.name="EnvUnreadableError"}},Ma=8;function ct(e){let t=Fa(e,".env");if(!ja(t))return[];let r;try{r=Ia(t,"utf-8")}catch(s){throw new Le(t,s instanceof Error?s.message:String(s))}let n=[...Se(r).values()].filter(s=>s.length>=Ma);return[...new Set(n)].sort((s,o)=>o.length-s.length)}function be(e,t){let r=e;for(let n of t)r=r.split(n).join(La);return r}function at(e,t){return t.length===0?e:typeof e=="string"?be(e,t):Array.isArray(e)?e.map(r=>at(r,t)):e!==null&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([r,n])=>[r,at(n,t)])):e}function Wn(e){let t;try{t=ct(e)}catch(r){return()=>{throw r}}return r=>be(r,t)}import{readFileSync as Ka}from"node:fs";import{join as Ja}from"node:path";import{existsSync as Ba}from"node:fs";import{dirname as Ha,join as Ga,resolve as Jn}from"node:path";import{cwd as Va}from"node:process";var Kn={name:"tdk-cli-internal",private:!0,version:"1.3.189",description:"Flisk CLI \u2014 start services on your machine.",keywords:["flisk","tilt","cli","local-dev","microservices"],homepage:"https://github.com/flisk-sh/flisk#readme",bugs:{url:"https://github.com/flisk-sh/flisk/issues"},repository:{type:"git",url:"git+https://github.com/flisk-sh/flisk.git",directory:"cli"},license:"MIT",author:"Flisk Team",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",bin:{flisk:"bin/flisk.js",tdk:"bin/flisk.js","tdk-cli":"bin/flisk.js"},files:["dist","dist-bundle","bin","templates","README.md","Tiltfile","engine","discovery","specs","ext","!ext/ide-components/code_executor","shared-platform-engineering/docker-templates"],scripts:{build:"tsc && node scripts/bundle.mjs","build:watch":"tsc --watch","check:dist":"npm run build && ../scripts/check-cli-dist.sh",lint:"biome check .","lint:fix":"biome check . --write",typecheck:"tsc --project tsconfig.typecheck.json",clean:"rm -rf dist",dev:"bun run build:watch",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage --coverage.reportOnFailure --coverage.reporter=text --coverage.reporter=html --coverage.reporter=json-summary --coverage.reporter=json --coverage.reportsDirectory=coverage --reporter=default --reporter=json --outputFile.json=test-results/vitest.json",prepack:"../scripts/stage-npm-engine.sh && npm run build"},dependencies:{commander:"^15.0.0",handlebars:"^4.7.8"},devDependencies:{"@biomejs/biome":"^2.5.13","@types/node":"^22.0.0","@types/react":"^19.3.0","@vitest/coverage-v8":"^5.0.2",ajv:"^8.17.1",chalk:"^6.0.1",esbuild:"^0.28.2",ink:"^8.0.0",knip:"^6.38.0",react:"^19.3.0","react-devtools-core":"^8.0.0",typescript:"^7.0.2",vite:"^8.3.3",vitest:"^5.0.0"},engines:{node:">=22.12.0"}};function k(e=Va()){let t=Jn(e),r=Jn("/");for(;t!==r;){if(Ba(Ga(t,".tdk",A)))return t;let n=Ha(t);if(n===t)break;t=n}return null}var lt=null;function Wa(){if(lt)return lt;let e=Kn;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return lt={name:String(t.name??"flisk"),version:String(t.version??"0.0.0"),fullPackage:t},lt}function qn(){return Wa().version}function Te(){let e=k();if(e)try{let t=Ka(Ja(e,".tdk",A),"utf-8"),r=JSON.parse(t);if(r?.project?.name)return r.project.name}catch{}return"tdk-project"}function Xt(e){let t=Te(),r=process.env.TDK_SERVICE_BASE_URL??`http://${t}.localhost${e?`:${e}`:""}`;try{let n=new URL(r.includes("://")?r:`http://${r}`),s=n.hostname,o=n.protocol==="https:"?"443":"80",i=n.port||(e?String(e):""),a=i===o?"":i;if(s==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(s))return{appBase:`${n.protocol}//${s}${a?`:${a}`:""}`,apiBase:`${n.protocol}//${s}${a?`:${a}`:""}`};let c=s.replace(/^(app|api)\./,"");return{appBase:`${n.protocol}//app.${c}${a?`:${a}`:""}`,apiBase:`${n.protocol}//api.${c}${a?`:${a}`:""}`}}catch{return{appBase:`http://app.${t}.localhost`,apiBase:`http://api.${t}.localhost`}}}function qa(e){return`${e.replace(/\/+$/,"")}/health`}function Qt(e){if(M(e.config?.appType)){let t=e.name.replace(/-api$/,"");return e.config?.apiPath??`/api/${t}`}return e.config?.basePath??`/${e.name}`}function Zt(e,t){return Yn(e,t,r=>qa(r))}function zn(e,t){return Yn(e,t,r=>r)}function Yn(e,t,r){let{appBase:n,apiBase:s}=Xt(t);return e.filter(o=>o.config?.appType==="frontend"||M(o.config?.appType)).map(o=>{let i=M(o.config.appType)?s:n;return{name:o.name,appType:o.config.appType,url:`${i}${r(Qt(o))}`}})}async function za(e,t){try{let r=await fetch(e.url,{method:"GET",redirect:"manual",signal:AbortSignal.timeout(t)});return{...e,ok:r.ok,status:r.status}}catch(r){let n=r instanceof Error&&r.name==="TimeoutError"?`no response within ${t}ms`:r instanceof Error?r.message:String(r);return{...e,ok:!1,error:n}}}async function ut(e,t){return Promise.all(e.map(r=>za(r,t)))}var os=60,es=1e3,ts=1e4,rs=200,ns=64*1024,ss=new Set([404,502,503,504]),Xa=new Set(["ECONNREFUSED","ENOTFOUND","EAI_AGAIN","EHOSTUNREACH","ENETUNREACH"]),Qa=new Set(["GET","HEAD","OPTIONS"]);function se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Za(e,t){if(Qa.has(t))return!0;if(!se(e))return!1;let r=se(e.cause)?e.cause:void 0,n=e.code??r?.code;return typeof n=="string"&&Xa.has(n)}function tr(e){if(!se(e))return['smoke: must be an object with "via" and "steps"'];let t=[];return e.via!=="proxy"&&t.push('smoke.via: only "proxy" is supported (the check must go through the public URL)'),e.timeoutSeconds!==void 0&&!(typeof e.timeoutSeconds=="number"&&e.timeoutSeconds>0)&&t.push("smoke.timeoutSeconds: must be a number greater than 0"),!Array.isArray(e.steps)||e.steps.length===0?(t.push("smoke.steps: needs at least one step"),t):(e.steps.forEach((r,n)=>{let s=`smoke.steps[${n}]`;if(!se(r)){t.push(`${s}: must be an object`);return}let o=r.path;(typeof o!="string"||!o.startsWith("/")||o.startsWith("//"))&&t.push(`${s}.path: must start with "/" and is appended to the public URL; a full URL or relative path would skip the proxy`),r.expect!==void 0&&!(typeof r.expect=="number"&&Number.isInteger(r.expect)&&r.expect>=100&&r.expect<=599)&&t.push(`${s}.expect: must be an HTTP status between 100 and 599`),r.bodyContains!==void 0&&typeof r.bodyContains!="string"&&t.push(`${s}.bodyContains: must be a string`),r.save!==void 0&&(se(r.save)&&Object.values(r.save).every(a=>typeof a=="string"&&a.startsWith("$."))||t.push(`${s}.save: must map names to paths such as "$.id"`))}),t)}function is(e,t){let{appBase:r,apiBase:n}=Xt(t),s=[];for(let o of e){let i=o.config;if(!i?.smoke)continue;let a=i.appType,c=M(a)||a===Y;if(!c&&a!=="frontend"||i.exposeViaProxy===!1)continue;let l=c?n:r,u=i.healthCheckPath||(c&&a!==Y?"/health":void 0);s.push({name:o.name,baseUrl:`${l}${Qt(o).replace(/\/+$/,"")}`,...u?.startsWith("/")?{readyPath:u}:{},smoke:i.smoke})}return s}var ec=10;function as(e,t={}){let r=t.timeoutSeconds??ec;return e.flatMap(n=>{let s=n.smoke.steps.filter(i=>(i.method??"GET").toUpperCase()==="GET"&&i.body===void 0&&!i.path.includes("{{")).map(i=>({...i,bodyContains:void 0}));if(s.length===0)return[];let o=Math.min(n.smoke.timeoutSeconds??os,r);return[{name:n.name,baseUrl:n.baseUrl,smoke:{via:n.smoke.via,timeoutSeconds:o,steps:s}}]})}function tc(e,t){let r=t.replace(/^\$\.?/,"").match(/[^.[\]]+/g)??[],n=e;for(let s of r){if(n==null||s==="__proto__"||s==="constructor"||s==="prototype"||!Object.hasOwn(n,s))return;let o=Object.getOwnPropertyDescriptor(n,s);if(!o||!("value"in o))return;n=o.value}return n}function cs(e,t){return e.replace(/\{\{(\w+)\}\}/g,(r,n)=>t[n]??r)}function er(e,t){return typeof e=="string"?cs(e,t):Array.isArray(e)?e.map(r=>er(r,t)):se(e)?Object.fromEntries(Object.entries(e).map(([r,n])=>[r,er(n,t)])):e}function dt(e){let t=e.replace(/\s+/g," ").trim();return t.length>rs?`${t.slice(0,rs)}...`:t}function ls(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"step"}function rc(e,t){let r=ls(t),n=(e.get(r)??0)+1;return e.set(r,n),n===1?r:`${r}-${n}`}function nc(e,t,r,n,s){try{let o=xe(e,ls(r.service),t);Ya(o,{recursive:!0});let i=xe(o,"latest.json"),a=xe(o,"body.txt");return n===void 0?Qn(a,{force:!0}):Zn(a,n),Zn(i,`${JSON.stringify({...r,bodyPath:n===void 0?null:"body.txt"},null,2)}
20
+ `)}return Ie(t,u),s.map(d=>d.name)}function pf(e){let t=Yt(e,".env");return zt(t)?!1:(Un(t,Gn(),{mode:384}),!0)}var La="[REDACTED]",Le=class extends Error{path;constructor(t,r){super(`Could not read ${t}: ${r}`),this.path=t,this.name="EnvUnreadableError"}},Ma=8;function ct(e){let t=Fa(e,".env");if(!ja(t))return[];let r;try{r=Ia(t,"utf-8")}catch(s){throw new Le(t,s instanceof Error?s.message:String(s))}let n=[...Se(r).values()].filter(s=>s.length>=Ma);return[...new Set(n)].sort((s,o)=>o.length-s.length)}function be(e,t){let r=e;for(let n of t)r=r.split(n).join(La);return r}function at(e,t){return t.length===0?e:typeof e=="string"?be(e,t):Array.isArray(e)?e.map(r=>at(r,t)):e!==null&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([r,n])=>[r,at(n,t)])):e}function Wn(e){let t;try{t=ct(e)}catch(r){return()=>{throw r}}return r=>be(r,t)}import{readFileSync as Ka}from"node:fs";import{join as Ja}from"node:path";import{existsSync as Ba}from"node:fs";import{dirname as Ha,join as Ga,resolve as Jn}from"node:path";import{cwd as Va}from"node:process";var Kn={name:"tdk-cli-internal",private:!0,version:"1.3.190",description:"Flisk CLI \u2014 start services on your machine.",keywords:["flisk","tilt","cli","local-dev","microservices"],homepage:"https://github.com/flisk-sh/flisk#readme",bugs:{url:"https://github.com/flisk-sh/flisk/issues"},repository:{type:"git",url:"git+https://github.com/flisk-sh/flisk.git",directory:"cli"},license:"MIT",author:"Flisk Team",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",bin:{flisk:"bin/flisk.js",tdk:"bin/flisk.js","tdk-cli":"bin/flisk.js"},files:["dist","dist-bundle","bin","templates","README.md","Tiltfile","engine","discovery","specs","ext","!ext/ide-components/code_executor","shared-platform-engineering/docker-templates"],scripts:{build:"tsc && node scripts/bundle.mjs","build:watch":"tsc --watch","check:dist":"npm run build && ../scripts/check-cli-dist.sh",lint:"biome check .","lint:fix":"biome check . --write",typecheck:"tsc --project tsconfig.typecheck.json",clean:"rm -rf dist",dev:"bun run build:watch",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage --coverage.reportOnFailure --coverage.reporter=text --coverage.reporter=html --coverage.reporter=json-summary --coverage.reporter=json --coverage.reportsDirectory=coverage --reporter=default --reporter=json --outputFile.json=test-results/vitest.json",prepack:"../scripts/stage-npm-engine.sh && npm run build"},dependencies:{commander:"^15.0.0",handlebars:"^4.7.8"},devDependencies:{"@biomejs/biome":"^2.5.13","@types/node":"^22.0.0","@types/react":"^19.3.0","@vitest/coverage-v8":"^5.0.2",ajv:"^8.17.1",chalk:"^6.0.1",esbuild:"^0.28.2",ink:"^8.0.0",knip:"^6.38.0",react:"^19.3.0","react-devtools-core":"^8.0.0",typescript:"^7.0.2",vite:"^8.3.3",vitest:"^5.0.0"},engines:{node:">=22.12.0"}};function k(e=Va()){let t=Jn(e),r=Jn("/");for(;t!==r;){if(Ba(Ga(t,".tdk",A)))return t;let n=Ha(t);if(n===t)break;t=n}return null}var lt=null;function Wa(){if(lt)return lt;let e=Kn;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return lt={name:String(t.name??"@flisk-sh/flisk"),version:String(t.version??"0.0.0"),fullPackage:t},lt}function qn(){return Wa().version}function Te(){let e=k();if(e)try{let t=Ka(Ja(e,".tdk",A),"utf-8"),r=JSON.parse(t);if(r?.project?.name)return r.project.name}catch{}return"tdk-project"}function Xt(e){let t=Te(),r=process.env.TDK_SERVICE_BASE_URL??`http://${t}.localhost${e?`:${e}`:""}`;try{let n=new URL(r.includes("://")?r:`http://${r}`),s=n.hostname,o=n.protocol==="https:"?"443":"80",i=n.port||(e?String(e):""),a=i===o?"":i;if(s==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(s))return{appBase:`${n.protocol}//${s}${a?`:${a}`:""}`,apiBase:`${n.protocol}//${s}${a?`:${a}`:""}`};let c=s.replace(/^(app|api)\./,"");return{appBase:`${n.protocol}//app.${c}${a?`:${a}`:""}`,apiBase:`${n.protocol}//api.${c}${a?`:${a}`:""}`}}catch{return{appBase:`http://app.${t}.localhost`,apiBase:`http://api.${t}.localhost`}}}function qa(e){return`${e.replace(/\/+$/,"")}/health`}function Qt(e){if(M(e.config?.appType)){let t=e.name.replace(/-api$/,"");return e.config?.apiPath??`/api/${t}`}return e.config?.basePath??`/${e.name}`}function Zt(e,t){return Yn(e,t,r=>qa(r))}function zn(e,t){return Yn(e,t,r=>r)}function Yn(e,t,r){let{appBase:n,apiBase:s}=Xt(t);return e.filter(o=>o.config?.appType==="frontend"||M(o.config?.appType)).map(o=>{let i=M(o.config.appType)?s:n;return{name:o.name,appType:o.config.appType,url:`${i}${r(Qt(o))}`}})}async function za(e,t){try{let r=await fetch(e.url,{method:"GET",redirect:"manual",signal:AbortSignal.timeout(t)});return{...e,ok:r.ok,status:r.status}}catch(r){let n=r instanceof Error&&r.name==="TimeoutError"?`no response within ${t}ms`:r instanceof Error?r.message:String(r);return{...e,ok:!1,error:n}}}async function ut(e,t){return Promise.all(e.map(r=>za(r,t)))}var os=60,es=1e3,ts=1e4,rs=200,ns=64*1024,ss=new Set([404,502,503,504]),Xa=new Set(["ECONNREFUSED","ENOTFOUND","EAI_AGAIN","EHOSTUNREACH","ENETUNREACH"]),Qa=new Set(["GET","HEAD","OPTIONS"]);function se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Za(e,t){if(Qa.has(t))return!0;if(!se(e))return!1;let r=se(e.cause)?e.cause:void 0,n=e.code??r?.code;return typeof n=="string"&&Xa.has(n)}function tr(e){if(!se(e))return['smoke: must be an object with "via" and "steps"'];let t=[];return e.via!=="proxy"&&t.push('smoke.via: only "proxy" is supported (the check must go through the public URL)'),e.timeoutSeconds!==void 0&&!(typeof e.timeoutSeconds=="number"&&e.timeoutSeconds>0)&&t.push("smoke.timeoutSeconds: must be a number greater than 0"),!Array.isArray(e.steps)||e.steps.length===0?(t.push("smoke.steps: needs at least one step"),t):(e.steps.forEach((r,n)=>{let s=`smoke.steps[${n}]`;if(!se(r)){t.push(`${s}: must be an object`);return}let o=r.path;(typeof o!="string"||!o.startsWith("/")||o.startsWith("//"))&&t.push(`${s}.path: must start with "/" and is appended to the public URL; a full URL or relative path would skip the proxy`),r.expect!==void 0&&!(typeof r.expect=="number"&&Number.isInteger(r.expect)&&r.expect>=100&&r.expect<=599)&&t.push(`${s}.expect: must be an HTTP status between 100 and 599`),r.bodyContains!==void 0&&typeof r.bodyContains!="string"&&t.push(`${s}.bodyContains: must be a string`),r.save!==void 0&&(se(r.save)&&Object.values(r.save).every(a=>typeof a=="string"&&a.startsWith("$."))||t.push(`${s}.save: must map names to paths such as "$.id"`))}),t)}function is(e,t){let{appBase:r,apiBase:n}=Xt(t),s=[];for(let o of e){let i=o.config;if(!i?.smoke)continue;let a=i.appType,c=M(a)||a===Y;if(!c&&a!=="frontend"||i.exposeViaProxy===!1)continue;let l=c?n:r,u=i.healthCheckPath||(c&&a!==Y?"/health":void 0);s.push({name:o.name,baseUrl:`${l}${Qt(o).replace(/\/+$/,"")}`,...u?.startsWith("/")?{readyPath:u}:{},smoke:i.smoke})}return s}var ec=10;function as(e,t={}){let r=t.timeoutSeconds??ec;return e.flatMap(n=>{let s=n.smoke.steps.filter(i=>(i.method??"GET").toUpperCase()==="GET"&&i.body===void 0&&!i.path.includes("{{")).map(i=>({...i,bodyContains:void 0}));if(s.length===0)return[];let o=Math.min(n.smoke.timeoutSeconds??os,r);return[{name:n.name,baseUrl:n.baseUrl,smoke:{via:n.smoke.via,timeoutSeconds:o,steps:s}}]})}function tc(e,t){let r=t.replace(/^\$\.?/,"").match(/[^.[\]]+/g)??[],n=e;for(let s of r){if(n==null||s==="__proto__"||s==="constructor"||s==="prototype"||!Object.hasOwn(n,s))return;let o=Object.getOwnPropertyDescriptor(n,s);if(!o||!("value"in o))return;n=o.value}return n}function cs(e,t){return e.replace(/\{\{(\w+)\}\}/g,(r,n)=>t[n]??r)}function er(e,t){return typeof e=="string"?cs(e,t):Array.isArray(e)?e.map(r=>er(r,t)):se(e)?Object.fromEntries(Object.entries(e).map(([r,n])=>[r,er(n,t)])):e}function dt(e){let t=e.replace(/\s+/g," ").trim();return t.length>rs?`${t.slice(0,rs)}...`:t}function ls(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"step"}function rc(e,t){let r=ls(t),n=(e.get(r)??0)+1;return e.set(r,n),n===1?r:`${r}-${n}`}function nc(e,t,r,n,s){try{let o=xe(e,ls(r.service),t);Ya(o,{recursive:!0});let i=xe(o,"latest.json"),a=xe(o,"body.txt");return n===void 0?Qn(a,{force:!0}):Zn(a,n),Zn(i,`${JSON.stringify({...r,bodyPath:n===void 0?null:"body.txt"},null,2)}
21
21
  `),s&&(Xn(i,xe(o,"last-success.json")),n===void 0?Qn(xe(o,"last-success-body.txt"),{force:!0}):Xn(a,xe(o,"last-success-body.txt"))),i}catch{return}}function sc(e){let t=Buffer.from(e,"utf8");if(t.length<=ns)return{body:e,truncated:!1,bytes:t.length};let r=t.subarray(0,ns).toString("utf8").replace(/\uFFFD$/,"");return{body:r,truncated:!0,bytes:Buffer.byteLength(r,"utf8")}}async function oc(e,t={}){let r=t.fetch??((u,d)=>fetch(u,d)),n=t.now??Date.now,s=t.sleep??(u=>new Promise(d=>setTimeout(d,u))),o=(e.smoke.timeoutSeconds??os)*1e3,i=n()+o,a={},c=tr(e.smoke);if(c.length>0)return{name:e.name,ok:!1,failure:`${e.name}: invalid smoke block: ${c.join("; ")}`};if(e.readyPath){let u=`${e.baseUrl}${e.readyPath}`;for(;;){try{let d=await r(u,{method:"GET",signal:AbortSignal.timeout(ts)});if(await d.text(),!ss.has(d.status)&&d.status<500)break}catch{}if(n()>=i)break;await s(es)}}i=n()+o;let l=new Map;for(let[u,d]of e.smoke.steps.entries()){let p=d.name??`step ${u+1}`,g=(d.method??"GET").toUpperCase(),y=`${e.baseUrl}${cs(d.path,a)}`,S=d.expect??200,m=d.body!==void 0,$,W="",U,he;for(;;){U=void 0,he=void 0,$=void 0;let B=!1;try{let j=await r(y,{method:g,headers:m?{"content-type":"application/json"}:void 0,body:m?JSON.stringify(er(d.body,a)):void 0,signal:AbortSignal.timeout(ts)});$=j.status,W=await j.text()}catch(j){B=Za(j,g),U=j instanceof Error?j.message:String(j);let ue=se(j)?j.code??(se(j.cause)?j.cause.code:void 0):void 0;he=typeof ue=="string"?ue:void 0}if(!(U!==void 0&&B||$!==void 0&&$!==S&&ss.has($))||n()>=i)break;await s(es)}let b=!1,R=B=>{if(!b){if(!t.redact)return B;try{return t.redact(B)}catch(re){b=!0;let j=re instanceof Error?re.message:String(re);t.warn?.(`${e.name}: ${p}: the response text was neither shown nor stored: ${j}`);return}}},le=R(y),P=$===void 0?void 0:R(W),Qe=U===void 0?void 0:R(U),Ze=U===void 0?void 0:he??Qe,q=`${e.name}: ${p}: ${g} ${le??"(url withheld)"}`,ge;if(t.recordDir){let B=P===void 0?void 0:sc(P),re=U===void 0&&$===S&&(d.bodyContains===void 0||W.includes(d.bodyContains));ge=nc(t.recordDir,rc(l,p),{service:e.name,step:p,method:g,...le===void 0?{}:{url:le},expectedStatus:S,status:$??null,...Ze===void 0?{}:{error:Ze},truncated:B?.truncated??!1,bodyBytes:B?.bytes??0},B?.body,re)}let te=B=>({name:e.name,ok:!1,failure:B,recordPath:ge});if(U!==void 0)return te(`${q} never answered (${Qe??"the error was withheld"})`);if($!==S)return te(`${q} returned ${$}, expected ${S}${P?`: ${dt(P)}`:""}`);if(d.bodyContains!==void 0&&!W.includes(d.bodyContains))return te(`${q} returned ${$} but the body does not contain "${d.bodyContains}"${P?`: ${dt(P)}`:""}`);if(d.save){let B;try{B=JSON.parse(W)}catch{return te(`${q} returned a body that is not JSON, cannot save${P?`: ${dt(P)}`:""}`)}for(let[re,j]of Object.entries(d.save)){let ue=tc(B,j);if(ue==null||typeof ue=="object")return te(`${q} response has no ${j} to save as {{${re}}}${P?`: ${dt(P)}`:""}`);a[re]=String(ue)}}}return{name:e.name,ok:!0}}function Ff(e){return`Smoke check failed: ${e.failure}${e.recordPath?` (record: ${e.recordPath})`:""}`}function us(e,t){return{redact:Wn(e),...t?{warn:t}:{}}}async function ds(e,t={}){return Promise.all(e.map(r=>oc(r,t)))}var Me=1,Bf="https://tdk-landscape.github.io/schema.service.json",ic={dependencies:"deprecated, use dependsOn (still read for now)",envVars:"deprecated, use params (still read when params is absent)",jwtSecret:"ignored. A secret must not be committed: remove it and set JWT_SECRET in the project .env"},ac=new Set(["$schema","agent","apiBasePath","apiPath","appName","appType","backendName","basePath","build","buildContext","databaseName","dependencies","dev","dependsOn","dockerfile","enabled","exposeViaProxy","featuresEnabled","framework","healthCheckPath","image","language","name","nats","params","playwright","port","replicas","restart","runtime","sablier","schemaVersion","secrets","smoke","stack","syncs","traefik","type"]),cc=[{path:["healthCheckPath"],pattern:/^\/[a-z0-9/-]*$/,expected:"a path such as /health"},{path:["traefik","host"],pattern:/^[A-Za-z0-9.-]+$/,expected:"a hostname such as shop.backend.myproject.local"},{path:["traefik","pathPrefix"],pattern:/^\/[a-z0-9/-]*$/,expected:"a path such as /api/v1/shop-management"},{path:["traefik","healthCheck"],pattern:/^\/[a-z0-9/-]*$/,expected:"a path such as /health"},{path:["nats","queueGroup"],pattern:/^[A-Za-z0-9_.-]+$/,expected:"letters, digits, '_', '.' or '-'"},{path:["databaseName"],pattern:/^[A-Za-z0-9_-]+$/,expected:"letters, digits, '_' or '-'"},{path:["stack"],pattern:/^[A-Za-z0-9_-]+$/,expected:"letters, digits, '_' or '-'"},{path:["image"],pattern:/^[A-Za-z0-9._/:@-]+$/,expected:"an image reference such as ghcr.io/acme/app:1.0"}];function pt(e,t){let r=[],n=new Set;for(let{path:s,pattern:o,expected:i}of cc){let a=e;for(let l of s)a=a&&typeof a=="object"&&!Array.isArray(a)?a[l]:void 0;if(a==null||a==="")continue;let c=`${t}.${s.join(".")}`;(typeof a!="string"||!o.test(a))&&n.add(c),typeof a!="string"?r.push(`${c}: expected a string`):o.test(a)||r.push(`${c}: must be ${i} (no spaces, line breaks or YAML syntax)`)}for(let[s,o]of lc(e,t))n.has(s)||r.push(`${s}: ${o}`);return r}function rr(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<32||r===127||r===133||r===8232||r===8233)return!0}return!1}function lc(e,t){let r=[],n=Object.entries(e).filter(([s])=>s!=="smoke").map(([s,o])=>[o,`${t}.${s}`]);for(let s of Object.keys(e))rr(s)&&r.push([t,"a key contains a line break"]);for(;n.length>0;){let[s,o]=n.pop();if(typeof s=="string")rr(s)&&r.push([o,"must not contain line breaks or control characters"]);else if(Array.isArray(s))for(let[i,a]of s.entries())n.push([a,`${o}[${i}]`]);else if(s&&typeof s=="object")for(let[i,a]of Object.entries(s))rr(i)?r.push([o,"a key contains a line break"]):n.push([a,`${o}.${i}`])}return r.sort(([s],[o])=>s.localeCompare(o))}var uc=["apiPath","basePath"];function nr(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e;return uc.filter(r=>r in t&&typeof t[r]!="string")}function sr(e,t){if(!e||typeof e!="object"||Array.isArray(e))return{errors:[`${t}: expected a JSON object`],warnings:[]};let r=e,n=[];for(let a of["appName","appType","stack","schemaVersion"])a in r||n.push(`${t}.${a}: required field is missing`);for(let a of["appName","appType","stack"])a in r&&typeof r[a]!="string"&&n.push(`${t}.${a}: expected a string`);"schemaVersion"in r&&r.schemaVersion!==Me&&n.push(`${t}.schemaVersion: unsupported version ${String(r.schemaVersion)} (supported: ${Me})`);for(let a of nr(r))n.push(`${t}.${a}: expected a string`);let s=r.dev,o=s&&typeof s=="object"&&!Array.isArray(s)?s.liveReload:void 0;if(o!==void 0&&typeof o!="boolean"&&n.push(`${t}.dev.liveReload: expected true or false`),n.push(...pt(r,t)),"smoke"in r)for(let a of tr(r.smoke))n.push(`${t}.${a}`);let i=Object.keys(r).flatMap(a=>{let c=ic[a];return c?[`${t}.${a}: ${c}`]:ac.has(a)?[]:[`${t}.${a}: unknown field is preserved`]});return o===!0&&r.language!=="go"&&i.push(`${t}.dev.liveReload: only applies to Go services (language "go"); it is ignored here`),{errors:n,warnings:i,manifest:r}}function ms(e,t){if(!ps(e))return[];try{let r=JSON.parse(fs(e,"utf-8"));return!r||typeof r!="object"||Array.isArray(r)?[]:pt(r,t)}catch{return[]}}function hs(e,t){if(!ps(e))return{errors:[`${t}: file is missing`],warnings:[]};try{let r=JSON.parse(fs(e,"utf-8"));return sr(r,t)}catch(r){let n=r instanceof Error?r.message:String(r);return{errors:[`${t}: invalid JSON (${n})`],warnings:[]}}}import Cs,{existsSync as Ee,readdirSync as Nc,readFileSync as Cc,statSync as mr}from"node:fs";import{dirname as Dc,join as ie}from"node:path";var Ue=class{data;options;constructor(t){this.data=new Map,this.options=t}has(t){let r=this.data.get(t);return r?Date.now()-r.timestamp>this.options.ttlMs?(this.data.delete(t),!1):!0:!1}get(t){if(this.has(t))return this.data.get(t)?.value}set(t,r){this.data.set(t,{value:r,timestamp:Date.now()})}delete(t){this.data.delete(t)}clear(){this.data.clear()}keys(){let t=[];for(let r of this.data.keys())this.has(r)&&t.push(r);return t}size(){return this.keys().length}};function gs(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}import{execFileSync as hc,execSync as gc}from"node:child_process";import{existsSync as Ss}from"node:fs";import{delimiter as bs,extname as Ts,join as xs}from"node:path";import{delimiter as Wf,extname as dc}from"node:path";function we(){return process.platform==="win32"}function pc(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function fc(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function mc(e,t){let r=pc(e),n=fc(t);if(!r||!n||r==="windows"&&n!=="amd64")return null;let s=`flisk-${r}-${n}`;return r==="windows"?`${s}.exe`:s}function Kf(){return mc(process.platform,process.arch)}function ks(){return we()?"flisk.exe":"flisk"}function ys(){return we()?"tdk.exe":"tdk"}function or(e,t=we()){return t?dc(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function N(e){let t=process.env.PATH??process.env.Path??"",r=we(),n=or(e,r);if(r&&!Ts(e))for(let s of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let o=s.toLowerCase();o&&!n.includes(`${e}${o}`)&&n.push(`${e}${o}`)}for(let s of t.split(bs))if(s)for(let o of n){let i=xs(s,o);if(Ss(i))return i}return null}function ir(e){let t=process.env.PATH??process.env.Path??"",r=we(),n=or(e,r);if(r&&!Ts(e))for(let i of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let a=i.toLowerCase();a&&!n.includes(`${e}${a}`)&&n.push(`${e}${a}`)}let s=[],o=new Set;for(let i of t.split(bs))if(i)for(let a of n){let c=xs(i,a);if(!Ss(c))continue;let l=r?c.toLowerCase():c;o.has(l)||(o.add(l),s.push(c))}return s}var ws=1e4;function Es(){let e=!1;if(process.platform==="win32")try{return hc(N("docker")??"docker",["ps"],{stdio:"ignore",timeout:ws,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return gc(t,{stdio:"ignore",timeout:ws}),"running"}catch(r){r.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function ft(e,t){return e[t]??0}function kc(e,t){let r=Array.from({length:t.length+1},(n,s)=>s);for(let n=1;n<=e.length;n++){let s=[n];for(let o=1;o<=t.length;o++){let i=e[n-1]===t[o-1]?0:1;s[o]=Math.min(ft(s,o-1)+1,ft(r,o)+1,ft(r,o-1)+i)}r=s}return ft(r,t.length)}function yc(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length-1;r++)if(e[r]!==t[r]&&e[r]===t[r+1]&&e[r+1]===t[r]&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+2)===t.slice(r+2))return!0;return!1}function vs(e,t){if(e.length<2||t.length===0||t.includes(e))return;let r=e.toLowerCase(),n,s=Number.POSITIVE_INFINITY;for(let o of t){if(o.length===0)continue;let i=o.toLowerCase(),a=yc(r,i)?1:kc(r,i),c=Math.max(1,Math.min(2,Math.floor(Math.max(r.length,i.length)/3)));a>c||(a<s||a===s&&(n===void 0||o<n))&&(n=o,s=a)}return n}import{spawn as Sc}from"node:child_process";import{join as bc}from"node:path";function Tc(e,t=[],r={}){return new Promise((n,s)=>{let o=[e,...t];r.verbose&&console.log(`Executing: tilt ${o.join(" ")}`);let i=Sc(N("tilt")??"tilt",o,{stdio:r.inheritStdio?"inherit":"pipe",shell:!1,windowsHide:process.platform==="win32",timeout:r.timeoutMs}),a="",c="";r.inheritStdio||(i.stdout?.on("data",l=>{a+=l.toString()}),i.stderr?.on("data",l=>{c+=l.toString()})),i.on("close",l=>{n({exitCode:l??1,stdout:a,stderr:c})}),i.on("error",l=>{s(new Error(`Failed to spawn tilt: ${l.message}`))})})}async function Ps(){try{return(await Tc("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function xc(){let e=k();if(!e)throw ne.notInProject();return bc(e,".tdk",".tdk-out","Tiltfile")}function $s(e){let t=xc();e.push("-f",t)}function am(e,t={}){let r=[];return $s(r),t.focusTargets&&t.focusTargets.length>0&&r.push("--",`--focus=${t.focusTargets.join(",")}`),r.push(...e),t.verbose&&!t.quiet&&r.push("--verbose"),t.watch&&r.push("--watch"),r}function cm(e={}){let t=[];return $s(t),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function _s(e){return e instanceof Error?e.message:String(e)}function gm(e,t){if(process.env.TDK_VERBOSE){let r=t!==void 0?`: ${_s(t)}`:"";console.warn(f.gray(`${e}${r}`))}}var D=class extends Error{suggestions;exitCode;constructor(t,r=[],n=1){super(t),this.name="TdkError",this.suggestions=r,this.exitCode=n}display(){lr(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}},cr=class extends Error{code;constructor(t=1){super(`process.exit(${t})`),this.name="ProcessExitError",this.code=t}};function ar(e,t,r=!1){let n=new Set;for(let s of e){let o=vs(s,t);o&&n.add(r?`Did you mean "${o}" for "${s}"?`:`Did you mean "${o}"?`)}return[...n]}var ne={tiltNotInstalled:()=>new D("Tilt CLI is not installed",["Install Tilt: `brew install tilt` (macOS)","Or download from: https://docs.tilt.dev/install.html","Verify with: `tilt version`",`Setup guide: ${Wt}`]),dockerNotAvailable:()=>new D("Docker (or a compatible container runtime) is not running",["Start Docker Desktop, then verify with: `docker ps`","Or start Colima: `colima start`","Or start the Docker service on Linux: `sudo systemctl start docker`",`Setup guide: ${Wt}`]),dockerNotResponding:()=>new D("Docker is running but not responding (`docker ps` hung for 10s)",["Quit and reopen Docker Desktop, or run `colima restart`","Then verify with: `docker ps`"]),stackNotFound:(e,t=[])=>new D(`Stack "${e}" not found`,[...ar([e],t),"Run `flisk stacks` to see available stacks","Run `flisk stack` to assign resources to a stack"]),resourceNotFound:(e,t=[])=>new D(`Resource "${e}" not found`,[...ar([e],t),"Run `flisk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let r=ar(e,t,e.length>1);return new D(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,r,2)},directoryExists:e=>new D(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new D(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new D("Could not find project root (no .tdk/project.json found)",["Run this from within a Flisk project","Run `flisk project --yes` to initialize a new project"])};function km(){let e=k();return e||ne.notInProject().exit()}function wc(e){e instanceof D&&e.exit(),lr(_s(e)),process.exit(1)}async function Ec(e,t){try{return await e()}catch(r){if(r instanceof cr)throw r;return t?.verbose&&r instanceof Error&&r.stack&&console.error(f.gray(r.stack)),wc(r)}}async function ym(e,t){let r=[],n=Es();return n==="unresponsive"?r.push(ne.dockerNotResponding()):n==="missing"&&r.push(ne.dockerNotAvailable()),await Ps()||r.push(ne.tiltNotInstalled()),r.length>0&&(console.error(f.red(`
22
22
  Flisk can't start - missing prerequisites:
23
23
  `)),r.forEach((s,o)=>{o>0&&console.error(""),s.display()}),console.error(f.gray("\nRun `flisk doctor` for a full environment check.")),process.exit(1)),Ec(e,t)}function Sm(e,t=1,r){lr(e,void 0,r),process.exit(t)}function lr(e,t,r){if(console.error(f.red(`\u274C ${e}`)),t&&console.error(f.gray(` ${t}`)),r&&r.length>0){console.error(f.yellow(`
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
3
- import{$ as fi,$a as uS,A as UR,Aa as ym,Ab as N2,B as MR,Ba as WR,Bb as w2,C as _R,Ca as ey,Cb as b2,D as Vf,Da as ty,Db as x2,E as ui,Ea as e2,Eb as O2,F as Et,Fa as t2,Fb as U2,G as Wt,Ga as n2,Gb as M2,H as Aa,Ha as Qm,Hb as _2,I as Bn,Ia as Sm,Ib as Ay,J as qI,Ja as o2,Jb as ry,K as ra,Ka as Xc,Kb as ed,L as LA,La as a2,Lb as H2,M as VI,Ma as i2,Mb as sy,N as Vn,Na as l2,Nb as G2,O as HR,Oa as Ts,Ob as k2,P as GR,Pa as cS,Pb as L2,Q as bh,Qa as vm,Qb as td,R as Bm,Ra as A2,Rb as cy,S as kR,Sa as r2,Sb as j2,T as xh,Ta as s2,Tb as dS,U as Xf,Ua as c2,Ub as z2,V as Zf,Va as u2,Vb as J2,W as XI,Wa as ny,Wb as F2,X as ZI,Xa as f2,Xb as Y2,Y as aS,Ya as d2,Z as LR,Za as Dm,_ as Im,_a as hn,a as RR,aa as di,ab as xo,b as D,ba as Xe,bb as Mh,bc as K2,c as YI,ca as jR,cb as g2,cc as q2,d as iA,da as zR,db as Rm,e as Kf,ea as jA,eb as m2,f as qf,fa as JR,fb as oy,g as Nh,ga as Oh,gb as ay,h as TR,ha as iS,hb as Zc,i as NR,ia as FR,ib as C2,j as qc,ja as YR,jb as fS,k as hm,ka as lS,kb as B2,l as kA,la as AS,lb as I2,m as wh,ma as PI,mb as y2,n as KI,na as rS,nb as Q2,o as xl,oa as $I,ob as AA,p as wR,pa as sS,pb as Pf,q as gn,qa as KR,qb as S2,r as Ol,ra as qR,rb as v2,s as Rs,sa as VR,sb as iy,t as bR,ta as XR,tb as Tr,u as Cm,ua as Ml,ub as $f,v as xR,va as Uh,vb as ly,w as lA,wa as ZR,wb as Wf,x as OR,xa as PR,xb as D2,y as Ul,ya as $R,yb as R2,z as Vc,za as WI,zb as T2}from"./chunk-QWYXYAX6.js";import{a as p2,c as E2,d as h2}from"./chunk-BZ4H7MM4.js";import{a as oS,b as Ko,c as YU,d as ut}from"./chunk-6EA4DGCY.js";var _N=Ko(wy=>{"use strict";var kH=Symbol.for("react.transitional.element"),LH=Symbol.for("react.fragment");function MN(n,i,A){var c=null;if(A!==void 0&&(c=""+A),i.key!==void 0&&(c=""+i.key),"key"in i){A={};for(var f in i)f!=="key"&&(A[f]=i[f])}else A=i;return i=A.ref,{$$typeof:kH,type:n,key:c,ref:i!==void 0?i:null,props:A}}wy.Fragment=LH;wy.jsx=MN;wy.jsxs=MN});var XN=Ko(bt=>{"use strict";var kS=Symbol.for("react.transitional.element"),jH=Symbol.for("react.portal"),zH=Symbol.for("react.fragment"),JH=Symbol.for("react.strict_mode"),FH=Symbol.for("react.profiler"),YH=Symbol.for("react.consumer"),KH=Symbol.for("react.context"),qH=Symbol.for("react.forward_ref"),VH=Symbol.for("react.suspense"),XH=Symbol.for("react.memo"),jN=Symbol.for("react.lazy"),ZH=Symbol.for("react.activity"),PH=Symbol.for("react.view_transition"),HN=Symbol.iterator;function $H(n){return n===null||typeof n!="object"?null:(n=HN&&n[HN]||n["@@iterator"],typeof n=="function"?n:null)}var zN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},JN=Object.assign,FN={};function Gm(n,i,A){this.props=n,this.context=i,this.refs=FN,this.updater=A||zN}Gm.prototype.isReactComponent={};Gm.prototype.setState=function(n,i){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,i,"setState")};Gm.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function YN(){}YN.prototype=Gm.prototype;function LS(n,i,A){this.props=n,this.context=i,this.refs=FN,this.updater=A||zN}var jS=LS.prototype=new YN;jS.constructor=LS;JN(jS,Gm.prototype);jS.isPureReactComponent=!0;var GN=Array.isArray;function GS(){}var Wn={H:null,A:null,T:null,S:null},KN=Object.prototype.hasOwnProperty;function zS(n,i,A){var c=A.ref;return{$$typeof:kS,type:n,key:i,ref:c!==void 0?c:null,props:A}}function WH(n,i){return zS(n.type,i,n.props)}function JS(n){return typeof n=="object"&&n!==null&&n.$$typeof===kS}function e4(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(A){return i[A]})}var kN=/\/+/g;function HS(n,i){return typeof n=="object"&&n!==null&&n.key!=null?e4(""+n.key):i.toString(36)}function t4(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(GS,GS):(n.status="pending",n.then(function(i){n.status==="pending"&&(n.status="fulfilled",n.value=i)},function(i){n.status==="pending"&&(n.status="rejected",n.reason=i)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Hm(n,i,A,c,f){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var E=!1;if(n===null)E=!0;else switch(p){case"bigint":case"string":case"number":E=!0;break;case"object":switch(n.$$typeof){case kS:case jH:E=!0;break;case jN:return E=n._init,Hm(E(n._payload),i,A,c,f)}}if(E)return f=f(n),E=c===""?"."+HS(n,0):c,GN(f)?(A="",E!=null&&(A=E.replace(kN,"$&/")+"/"),Hm(f,i,A,"",function(Q){return Q})):f!=null&&(JS(f)&&(f=WH(f,A+(f.key==null||n&&n.key===f.key?"":(""+f.key).replace(kN,"$&/")+"/")+E)),i.push(f)),1;E=0;var C=c===""?".":c+":";if(GN(n))for(var I=0;I<n.length;I++)c=n[I],p=C+HS(c,I),E+=Hm(c,i,A,p,f);else if(I=$H(n),typeof I=="function")for(n=I.call(n),I=0;!(c=n.next()).done;)c=c.value,p=C+HS(c,I++),E+=Hm(c,i,A,p,f);else if(p==="object"){if(typeof n.then=="function")return Hm(t4(n),i,A,c,f);throw i=String(n),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return E}function by(n,i,A){if(n==null)return n;var c=[],f=0;return Hm(n,c,"","",function(p){return i.call(A,p,f++)}),c}function n4(n){if(n._status===-1){var i=n._result,A=i();A.then(function(c){(n._status===0||n._status===-1)&&(n._status=1,n._result=c,A.status===void 0&&(A.status="fulfilled",A.value=c))},function(c){(n._status===0||n._status===-1)&&(n._status=2,n._result=c,A.status===void 0&&(A.status="rejected",A.reason=c))}),n._status===-1&&(n._status=0,n._result=A)}if(n._status===1)return n._result.default;throw n._result}var LN=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function qN(n){var i=Wn.T,A={};A.types=i!==null?i.types:null,Wn.T=A;try{var c=n(),f=Wn.S;f!==null&&f(A,c),typeof c=="object"&&c!==null&&typeof c.then=="function"&&c.then(GS,LN)}catch(p){LN(p)}finally{i!==null&&A.types!==null&&(i.types=A.types),Wn.T=i}}function VN(n){var i=Wn.T;if(i!==null){var A=i.types;A===null?i.types=[n]:A.indexOf(n)===-1&&A.push(n)}else qN(VN.bind(null,n))}var o4={map:by,forEach:function(n,i,A){by(n,function(){i.apply(this,arguments)},A)},count:function(n){var i=0;return by(n,function(){i++}),i},toArray:function(n){return by(n,function(i){return i})||[]},only:function(n){if(!JS(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};bt.Activity=ZH;bt.Children=o4;bt.Component=Gm;bt.Fragment=zH;bt.Profiler=FH;bt.PureComponent=LS;bt.StrictMode=JH;bt.Suspense=VH;bt.ViewTransition=PH;bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Wn;bt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Wn.H.useMemoCache(n)}};bt.addTransitionType=VN;bt.cache=function(n){return function(){return n.apply(null,arguments)}};bt.cacheSignal=function(){return null};bt.cloneElement=function(n,i,A){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var c=JN({},n.props),f=n.key;if(i!=null)for(p in i.key!==void 0&&(f=""+i.key),i)!KN.call(i,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&i.ref===void 0||(c[p]=i[p]);var p=arguments.length-2;if(p===1)c.children=A;else if(1<p){for(var E=Array(p),C=0;C<p;C++)E[C]=arguments[C+2];c.children=E}return zS(n.type,f,c)};bt.createContext=function(n){return n={$$typeof:KH,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:YH,_context:n},n};bt.createElement=function(n,i,A){var c,f={},p=null;if(i!=null)for(c in i.key!==void 0&&(p=""+i.key),i)KN.call(i,c)&&c!=="key"&&c!=="__self"&&c!=="__source"&&(f[c]=i[c]);var E=arguments.length-2;if(E===1)f.children=A;else if(1<E){for(var C=Array(E),I=0;I<E;I++)C[I]=arguments[I+2];f.children=C}if(n&&n.defaultProps)for(c in E=n.defaultProps,E)f[c]===void 0&&(f[c]=E[c]);return zS(n,p,f)};bt.createRef=function(){return{current:null}};bt.forwardRef=function(n){return{$$typeof:qH,render:n}};bt.isValidElement=JS;bt.lazy=function(n){return{$$typeof:jN,_payload:{_status:-1,_result:n},_init:n4}};bt.memo=function(n,i){return{$$typeof:XH,type:n,compare:i===void 0?null:i}};bt.startTransition=qN;bt.unstable_useCacheRefresh=function(){return Wn.H.useCacheRefresh()};bt.use=function(n){return Wn.H.use(n)};bt.useActionState=function(n,i,A){return Wn.H.useActionState(n,i,A)};bt.useCallback=function(n,i){return Wn.H.useCallback(n,i)};bt.useContext=function(n){return Wn.H.useContext(n)};bt.useDebugValue=function(){};bt.useDeferredValue=function(n,i){return Wn.H.useDeferredValue(n,i)};bt.useEffect=function(n,i){return Wn.H.useEffect(n,i)};bt.useEffectEvent=function(n){return Wn.H.useEffectEvent(n)};bt.useId=function(){return Wn.H.useId()};bt.useImperativeHandle=function(n,i,A){return Wn.H.useImperativeHandle(n,i,A)};bt.useInsertionEffect=function(n,i){return Wn.H.useInsertionEffect(n,i)};bt.useLayoutEffect=function(n,i){return Wn.H.useLayoutEffect(n,i)};bt.useMemo=function(n,i){return Wn.H.useMemo(n,i)};bt.useOptimistic=function(n,i){return Wn.H.useOptimistic(n,i)};bt.useReducer=function(n,i,A){return Wn.H.useReducer(n,i,A)};bt.useRef=function(n){return Wn.H.useRef(n)};bt.useState=function(n){return Wn.H.useState(n)};bt.useSyncExternalStore=function(n,i,A){return Wn.H.useSyncExternalStore(n,i,A)};bt.useTransition=function(){return Wn.H.useTransition()};bt.version="19.3.0"});var ZN=Ko((Dt,xy)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(R,Y){Object.defineProperty(c.prototype,R,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",Y[0],Y[1])}})}function i(R){return R===null||typeof R!="object"?null:(R=An&&R[An]||R["@@iterator"],typeof R=="function"?R:null)}function A(R,Y){R=(R=R.constructor)&&(R.displayName||R.name)||"ReactClass";var he=R+"."+Y;ft[he]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Y,R),ft[he]=!0)}function c(R,Y,he){this.props=R,this.context=Y,this.refs=Fn,this.updater=he||rn}function f(){}function p(R,Y,he){this.props=R,this.context=Y,this.refs=Fn,this.updater=he||rn}function E(){}function C(R){return""+R}function I(R){try{C(R);var Y=!1}catch{Y=!0}if(Y){Y=console;var he=Y.error,H=typeof Symbol=="function"&&Symbol.toStringTag&&R[Symbol.toStringTag]||R.constructor.name||"Object";return he.call(Y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),C(R)}}function Q(R){if(R==null)return null;if(typeof R=="function")return R.$$typeof===Ht?null:R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case lt:return"Fragment";case Ie:return"Profiler";case X:return"StrictMode";case De:return"Suspense";case nt:return"SuspenseList";case Ge:return"Activity";case Qt:return"ViewTransition"}if(typeof R=="object")switch(typeof R.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case ze:return"Portal";case tt:return R.displayName||"Context";case st:return(R._context.displayName||"Context")+".Consumer";case en:var Y=R.render;return R=R.displayName,R||(R=Y.displayName||Y.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case be:return Y=R.displayName||null,Y!==null?Y:Q(R.type)||"Memo";case Jt:Y=R._payload,R=R._init;try{return Q(R(Y))}catch{}}return null}function w(R){if(R===lt)return"<>";if(typeof R=="object"&&R!==null&&R.$$typeof===Jt)return"<...>";try{var Y=Q(R);return Y?"<"+Y+">":"<...>"}catch{return"<...>"}}function U(){var R=Ve.A;return R===null?null:R.getOwner()}function S(){return Error("react-stack-top-frame")}function x(R){if(Gn.call(R,"key")){var Y=Object.getOwnPropertyDescriptor(R,"key").get;if(Y&&Y.isReactWarning)return!1}return R.key!==void 0}function O(R,Y){function he(){co||(co=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Y))}he.isReactWarning=!0,Object.defineProperty(R,"key",{get:he,configurable:!0})}function k(){var R=Q(this.type);return mt[R]||(mt[R]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),R=this.props.ref,R!==void 0?R:null}function L(R,Y,he,H,te,et){var Te=he.ref;return R={$$typeof:it,type:R,key:Y,props:he,_owner:H},(Te!==void 0?Te:null)!==null?Object.defineProperty(R,"ref",{enumerable:!1,get:k}):Object.defineProperty(R,"ref",{enumerable:!1,value:null}),R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(R,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(R,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(R,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:et}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R}function j(R,Y){return Y=L(R.type,Y,R.props,R._owner,R._debugStack,R._debugTask),R._store&&(Y._store.validated=R._store.validated),Y}function ge(R){ue(R)?R._store&&(R._store.validated=1):typeof R=="object"&&R!==null&&R.$$typeof===Jt&&(R._payload.status==="fulfilled"?ue(R._payload.value)&&R._payload.value._store&&(R._payload.value._store.validated=1):R._store&&(R._store.validated=1))}function ue(R){return typeof R=="object"&&R!==null&&R.$$typeof===it}function ke(R){var Y={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(he){return Y[he]})}function we(R,Y){return typeof R=="object"&&R!==null&&R.key!=null?(I(R.key),ke(""+R.key)):Y.toString(36)}function He(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(E,E):(R.status="pending",R.then(function(Y){R.status==="pending"&&(R.status="fulfilled",R.value=Y)},function(Y){R.status==="pending"&&(R.status="rejected",R.reason=Y)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function Ze(R,Y,he,H,te){var et=typeof R;(et==="undefined"||et==="boolean")&&(R=null);var Te=!1;if(R===null)Te=!0;else switch(et){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(R.$$typeof){case it:case ze:Te=!0;break;case Jt:return Te=R._init,Ze(Te(R._payload),Y,he,H,te)}}if(Te){Te=R,te=te(Te);var ye=H===""?"."+we(Te,0):H;return Ft(te)?(he="",ye!=null&&(he=ye.replace(qo,"$&/")+"/"),Ze(te,Y,he,"",function(kn){return kn})):te!=null&&(ue(te)&&(te.key!=null&&(Te&&Te.key===te.key||I(te.key)),he=j(te,he+(te.key==null||Te&&Te.key===te.key?"":(""+te.key).replace(qo,"$&/")+"/")+ye),H!==""&&Te!=null&&ue(Te)&&Te.key==null&&Te._store&&!Te._store.validated&&(he._store.validated=2),te=he),Y.push(te)),1}if(Te=0,ye=H===""?".":H+":",Ft(R))for(var Je=0;Je<R.length;Je++)H=R[Je],et=ye+we(H,Je),Te+=Ze(H,Y,he,et,te);else if(Je=i(R),typeof Je=="function")for(Je===R.entries&&(ca||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ca=!0),R=Je.call(R),Je=0;!(H=R.next()).done;)H=H.value,et=ye+we(H,Je++),Te+=Ze(H,Y,he,et,te);else if(et==="object"){if(typeof R.then=="function")return Ze(He(R),Y,he,H,te);throw Y=String(R),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return Te}function Oe(R,Y,he){if(R==null)return R;var H=[],te=0;return Ze(R,H,"","",function(et){return Y.call(he,et,te++)}),H}function pe(R){if(R._status===-1){var Y=null,he=null,H=R._ioInfo;H!=null&&(H.start=H.end=performance.now(),H.value=new Promise(function(Te,ye){Y=Te,he=ye})),H=R._result;var te=H();if(te.then(function(Te){if(R._status===0||R._status===-1){R._status=1,R._result=Te;var ye=R._ioInfo;if(ye!=null){ye.end=performance.now();var Je=Te?.default;Y(Je),ye.value.status="fulfilled",ye.value.value=Je}te.status===void 0&&(te.status="fulfilled",te.value=Te)}},function(Te){if(R._status===0||R._status===-1){R._status=2,R._result=Te;var ye=R._ioInfo;ye!=null&&(ye.end=performance.now(),ye.value.then(E,E),he(Te),ye.value.status="rejected",ye.value.reason=Te),te.status===void 0&&(te.status="rejected",te.reason=Te)}}),H=R._ioInfo,H!=null){var et=te.displayName;typeof et=="string"&&(H.name=et)}R._status===-1&&(R._status=0,R._result=te)}if(R._status===1)return H=R._result,H===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
3
+ import{$ as fi,$a as uS,A as UR,Aa as ym,Ab as N2,B as MR,Ba as WR,Bb as w2,C as _R,Ca as ey,Cb as b2,D as Vf,Da as ty,Db as x2,E as ui,Ea as e2,Eb as O2,F as Et,Fa as t2,Fb as U2,G as Wt,Ga as n2,Gb as M2,H as Aa,Ha as Qm,Hb as _2,I as Bn,Ia as Sm,Ib as Ay,J as qI,Ja as o2,Jb as ry,K as ra,Ka as Xc,Kb as ed,L as LA,La as a2,Lb as H2,M as VI,Ma as i2,Mb as sy,N as Vn,Na as l2,Nb as G2,O as HR,Oa as Ts,Ob as k2,P as GR,Pa as cS,Pb as L2,Q as bh,Qa as vm,Qb as td,R as Bm,Ra as A2,Rb as cy,S as kR,Sa as r2,Sb as j2,T as xh,Ta as s2,Tb as dS,U as Xf,Ua as c2,Ub as z2,V as Zf,Va as u2,Vb as J2,W as XI,Wa as ny,Wb as F2,X as ZI,Xa as f2,Xb as Y2,Y as aS,Ya as d2,Z as LR,Za as Dm,_ as Im,_a as hn,a as RR,aa as di,ab as xo,b as D,ba as Xe,bb as Mh,bc as K2,c as YI,ca as jR,cb as g2,cc as q2,d as iA,da as zR,db as Rm,e as Kf,ea as jA,eb as m2,f as qf,fa as JR,fb as oy,g as Nh,ga as Oh,gb as ay,h as TR,ha as iS,hb as Zc,i as NR,ia as FR,ib as C2,j as qc,ja as YR,jb as fS,k as hm,ka as lS,kb as B2,l as kA,la as AS,lb as I2,m as wh,ma as PI,mb as y2,n as KI,na as rS,nb as Q2,o as xl,oa as $I,ob as AA,p as wR,pa as sS,pb as Pf,q as gn,qa as KR,qb as S2,r as Ol,ra as qR,rb as v2,s as Rs,sa as VR,sb as iy,t as bR,ta as XR,tb as Tr,u as Cm,ua as Ml,ub as $f,v as xR,va as Uh,vb as ly,w as lA,wa as ZR,wb as Wf,x as OR,xa as PR,xb as D2,y as Ul,ya as $R,yb as R2,z as Vc,za as WI,zb as T2}from"./chunk-CLCUIDBH.js";import{a as p2,c as E2,d as h2}from"./chunk-BZ4H7MM4.js";import{a as oS,b as Ko,c as YU,d as ut}from"./chunk-6EA4DGCY.js";var _N=Ko(wy=>{"use strict";var kH=Symbol.for("react.transitional.element"),LH=Symbol.for("react.fragment");function MN(n,i,A){var c=null;if(A!==void 0&&(c=""+A),i.key!==void 0&&(c=""+i.key),"key"in i){A={};for(var f in i)f!=="key"&&(A[f]=i[f])}else A=i;return i=A.ref,{$$typeof:kH,type:n,key:c,ref:i!==void 0?i:null,props:A}}wy.Fragment=LH;wy.jsx=MN;wy.jsxs=MN});var XN=Ko(bt=>{"use strict";var kS=Symbol.for("react.transitional.element"),jH=Symbol.for("react.portal"),zH=Symbol.for("react.fragment"),JH=Symbol.for("react.strict_mode"),FH=Symbol.for("react.profiler"),YH=Symbol.for("react.consumer"),KH=Symbol.for("react.context"),qH=Symbol.for("react.forward_ref"),VH=Symbol.for("react.suspense"),XH=Symbol.for("react.memo"),jN=Symbol.for("react.lazy"),ZH=Symbol.for("react.activity"),PH=Symbol.for("react.view_transition"),HN=Symbol.iterator;function $H(n){return n===null||typeof n!="object"?null:(n=HN&&n[HN]||n["@@iterator"],typeof n=="function"?n:null)}var zN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},JN=Object.assign,FN={};function Gm(n,i,A){this.props=n,this.context=i,this.refs=FN,this.updater=A||zN}Gm.prototype.isReactComponent={};Gm.prototype.setState=function(n,i){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,i,"setState")};Gm.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function YN(){}YN.prototype=Gm.prototype;function LS(n,i,A){this.props=n,this.context=i,this.refs=FN,this.updater=A||zN}var jS=LS.prototype=new YN;jS.constructor=LS;JN(jS,Gm.prototype);jS.isPureReactComponent=!0;var GN=Array.isArray;function GS(){}var Wn={H:null,A:null,T:null,S:null},KN=Object.prototype.hasOwnProperty;function zS(n,i,A){var c=A.ref;return{$$typeof:kS,type:n,key:i,ref:c!==void 0?c:null,props:A}}function WH(n,i){return zS(n.type,i,n.props)}function JS(n){return typeof n=="object"&&n!==null&&n.$$typeof===kS}function e4(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(A){return i[A]})}var kN=/\/+/g;function HS(n,i){return typeof n=="object"&&n!==null&&n.key!=null?e4(""+n.key):i.toString(36)}function t4(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(GS,GS):(n.status="pending",n.then(function(i){n.status==="pending"&&(n.status="fulfilled",n.value=i)},function(i){n.status==="pending"&&(n.status="rejected",n.reason=i)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Hm(n,i,A,c,f){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var E=!1;if(n===null)E=!0;else switch(p){case"bigint":case"string":case"number":E=!0;break;case"object":switch(n.$$typeof){case kS:case jH:E=!0;break;case jN:return E=n._init,Hm(E(n._payload),i,A,c,f)}}if(E)return f=f(n),E=c===""?"."+HS(n,0):c,GN(f)?(A="",E!=null&&(A=E.replace(kN,"$&/")+"/"),Hm(f,i,A,"",function(Q){return Q})):f!=null&&(JS(f)&&(f=WH(f,A+(f.key==null||n&&n.key===f.key?"":(""+f.key).replace(kN,"$&/")+"/")+E)),i.push(f)),1;E=0;var C=c===""?".":c+":";if(GN(n))for(var I=0;I<n.length;I++)c=n[I],p=C+HS(c,I),E+=Hm(c,i,A,p,f);else if(I=$H(n),typeof I=="function")for(n=I.call(n),I=0;!(c=n.next()).done;)c=c.value,p=C+HS(c,I++),E+=Hm(c,i,A,p,f);else if(p==="object"){if(typeof n.then=="function")return Hm(t4(n),i,A,c,f);throw i=String(n),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return E}function by(n,i,A){if(n==null)return n;var c=[],f=0;return Hm(n,c,"","",function(p){return i.call(A,p,f++)}),c}function n4(n){if(n._status===-1){var i=n._result,A=i();A.then(function(c){(n._status===0||n._status===-1)&&(n._status=1,n._result=c,A.status===void 0&&(A.status="fulfilled",A.value=c))},function(c){(n._status===0||n._status===-1)&&(n._status=2,n._result=c,A.status===void 0&&(A.status="rejected",A.reason=c))}),n._status===-1&&(n._status=0,n._result=A)}if(n._status===1)return n._result.default;throw n._result}var LN=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function qN(n){var i=Wn.T,A={};A.types=i!==null?i.types:null,Wn.T=A;try{var c=n(),f=Wn.S;f!==null&&f(A,c),typeof c=="object"&&c!==null&&typeof c.then=="function"&&c.then(GS,LN)}catch(p){LN(p)}finally{i!==null&&A.types!==null&&(i.types=A.types),Wn.T=i}}function VN(n){var i=Wn.T;if(i!==null){var A=i.types;A===null?i.types=[n]:A.indexOf(n)===-1&&A.push(n)}else qN(VN.bind(null,n))}var o4={map:by,forEach:function(n,i,A){by(n,function(){i.apply(this,arguments)},A)},count:function(n){var i=0;return by(n,function(){i++}),i},toArray:function(n){return by(n,function(i){return i})||[]},only:function(n){if(!JS(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};bt.Activity=ZH;bt.Children=o4;bt.Component=Gm;bt.Fragment=zH;bt.Profiler=FH;bt.PureComponent=LS;bt.StrictMode=JH;bt.Suspense=VH;bt.ViewTransition=PH;bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Wn;bt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Wn.H.useMemoCache(n)}};bt.addTransitionType=VN;bt.cache=function(n){return function(){return n.apply(null,arguments)}};bt.cacheSignal=function(){return null};bt.cloneElement=function(n,i,A){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var c=JN({},n.props),f=n.key;if(i!=null)for(p in i.key!==void 0&&(f=""+i.key),i)!KN.call(i,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&i.ref===void 0||(c[p]=i[p]);var p=arguments.length-2;if(p===1)c.children=A;else if(1<p){for(var E=Array(p),C=0;C<p;C++)E[C]=arguments[C+2];c.children=E}return zS(n.type,f,c)};bt.createContext=function(n){return n={$$typeof:KH,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:YH,_context:n},n};bt.createElement=function(n,i,A){var c,f={},p=null;if(i!=null)for(c in i.key!==void 0&&(p=""+i.key),i)KN.call(i,c)&&c!=="key"&&c!=="__self"&&c!=="__source"&&(f[c]=i[c]);var E=arguments.length-2;if(E===1)f.children=A;else if(1<E){for(var C=Array(E),I=0;I<E;I++)C[I]=arguments[I+2];f.children=C}if(n&&n.defaultProps)for(c in E=n.defaultProps,E)f[c]===void 0&&(f[c]=E[c]);return zS(n,p,f)};bt.createRef=function(){return{current:null}};bt.forwardRef=function(n){return{$$typeof:qH,render:n}};bt.isValidElement=JS;bt.lazy=function(n){return{$$typeof:jN,_payload:{_status:-1,_result:n},_init:n4}};bt.memo=function(n,i){return{$$typeof:XH,type:n,compare:i===void 0?null:i}};bt.startTransition=qN;bt.unstable_useCacheRefresh=function(){return Wn.H.useCacheRefresh()};bt.use=function(n){return Wn.H.use(n)};bt.useActionState=function(n,i,A){return Wn.H.useActionState(n,i,A)};bt.useCallback=function(n,i){return Wn.H.useCallback(n,i)};bt.useContext=function(n){return Wn.H.useContext(n)};bt.useDebugValue=function(){};bt.useDeferredValue=function(n,i){return Wn.H.useDeferredValue(n,i)};bt.useEffect=function(n,i){return Wn.H.useEffect(n,i)};bt.useEffectEvent=function(n){return Wn.H.useEffectEvent(n)};bt.useId=function(){return Wn.H.useId()};bt.useImperativeHandle=function(n,i,A){return Wn.H.useImperativeHandle(n,i,A)};bt.useInsertionEffect=function(n,i){return Wn.H.useInsertionEffect(n,i)};bt.useLayoutEffect=function(n,i){return Wn.H.useLayoutEffect(n,i)};bt.useMemo=function(n,i){return Wn.H.useMemo(n,i)};bt.useOptimistic=function(n,i){return Wn.H.useOptimistic(n,i)};bt.useReducer=function(n,i,A){return Wn.H.useReducer(n,i,A)};bt.useRef=function(n){return Wn.H.useRef(n)};bt.useState=function(n){return Wn.H.useState(n)};bt.useSyncExternalStore=function(n,i,A){return Wn.H.useSyncExternalStore(n,i,A)};bt.useTransition=function(){return Wn.H.useTransition()};bt.version="19.3.0"});var ZN=Ko((Dt,xy)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(R,Y){Object.defineProperty(c.prototype,R,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",Y[0],Y[1])}})}function i(R){return R===null||typeof R!="object"?null:(R=An&&R[An]||R["@@iterator"],typeof R=="function"?R:null)}function A(R,Y){R=(R=R.constructor)&&(R.displayName||R.name)||"ReactClass";var he=R+"."+Y;ft[he]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Y,R),ft[he]=!0)}function c(R,Y,he){this.props=R,this.context=Y,this.refs=Fn,this.updater=he||rn}function f(){}function p(R,Y,he){this.props=R,this.context=Y,this.refs=Fn,this.updater=he||rn}function E(){}function C(R){return""+R}function I(R){try{C(R);var Y=!1}catch{Y=!0}if(Y){Y=console;var he=Y.error,H=typeof Symbol=="function"&&Symbol.toStringTag&&R[Symbol.toStringTag]||R.constructor.name||"Object";return he.call(Y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),C(R)}}function Q(R){if(R==null)return null;if(typeof R=="function")return R.$$typeof===Ht?null:R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case lt:return"Fragment";case Ie:return"Profiler";case X:return"StrictMode";case De:return"Suspense";case nt:return"SuspenseList";case Ge:return"Activity";case Qt:return"ViewTransition"}if(typeof R=="object")switch(typeof R.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case ze:return"Portal";case tt:return R.displayName||"Context";case st:return(R._context.displayName||"Context")+".Consumer";case en:var Y=R.render;return R=R.displayName,R||(R=Y.displayName||Y.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case be:return Y=R.displayName||null,Y!==null?Y:Q(R.type)||"Memo";case Jt:Y=R._payload,R=R._init;try{return Q(R(Y))}catch{}}return null}function w(R){if(R===lt)return"<>";if(typeof R=="object"&&R!==null&&R.$$typeof===Jt)return"<...>";try{var Y=Q(R);return Y?"<"+Y+">":"<...>"}catch{return"<...>"}}function U(){var R=Ve.A;return R===null?null:R.getOwner()}function S(){return Error("react-stack-top-frame")}function x(R){if(Gn.call(R,"key")){var Y=Object.getOwnPropertyDescriptor(R,"key").get;if(Y&&Y.isReactWarning)return!1}return R.key!==void 0}function O(R,Y){function he(){co||(co=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Y))}he.isReactWarning=!0,Object.defineProperty(R,"key",{get:he,configurable:!0})}function k(){var R=Q(this.type);return mt[R]||(mt[R]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),R=this.props.ref,R!==void 0?R:null}function L(R,Y,he,H,te,et){var Te=he.ref;return R={$$typeof:it,type:R,key:Y,props:he,_owner:H},(Te!==void 0?Te:null)!==null?Object.defineProperty(R,"ref",{enumerable:!1,get:k}):Object.defineProperty(R,"ref",{enumerable:!1,value:null}),R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(R,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(R,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(R,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:et}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R}function j(R,Y){return Y=L(R.type,Y,R.props,R._owner,R._debugStack,R._debugTask),R._store&&(Y._store.validated=R._store.validated),Y}function ge(R){ue(R)?R._store&&(R._store.validated=1):typeof R=="object"&&R!==null&&R.$$typeof===Jt&&(R._payload.status==="fulfilled"?ue(R._payload.value)&&R._payload.value._store&&(R._payload.value._store.validated=1):R._store&&(R._store.validated=1))}function ue(R){return typeof R=="object"&&R!==null&&R.$$typeof===it}function ke(R){var Y={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(he){return Y[he]})}function we(R,Y){return typeof R=="object"&&R!==null&&R.key!=null?(I(R.key),ke(""+R.key)):Y.toString(36)}function He(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(E,E):(R.status="pending",R.then(function(Y){R.status==="pending"&&(R.status="fulfilled",R.value=Y)},function(Y){R.status==="pending"&&(R.status="rejected",R.reason=Y)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function Ze(R,Y,he,H,te){var et=typeof R;(et==="undefined"||et==="boolean")&&(R=null);var Te=!1;if(R===null)Te=!0;else switch(et){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(R.$$typeof){case it:case ze:Te=!0;break;case Jt:return Te=R._init,Ze(Te(R._payload),Y,he,H,te)}}if(Te){Te=R,te=te(Te);var ye=H===""?"."+we(Te,0):H;return Ft(te)?(he="",ye!=null&&(he=ye.replace(qo,"$&/")+"/"),Ze(te,Y,he,"",function(kn){return kn})):te!=null&&(ue(te)&&(te.key!=null&&(Te&&Te.key===te.key||I(te.key)),he=j(te,he+(te.key==null||Te&&Te.key===te.key?"":(""+te.key).replace(qo,"$&/")+"/")+ye),H!==""&&Te!=null&&ue(Te)&&Te.key==null&&Te._store&&!Te._store.validated&&(he._store.validated=2),te=he),Y.push(te)),1}if(Te=0,ye=H===""?".":H+":",Ft(R))for(var Je=0;Je<R.length;Je++)H=R[Je],et=ye+we(H,Je),Te+=Ze(H,Y,he,et,te);else if(Je=i(R),typeof Je=="function")for(Je===R.entries&&(ca||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ca=!0),R=Je.call(R),Je=0;!(H=R.next()).done;)H=H.value,et=ye+we(H,Je++),Te+=Ze(H,Y,he,et,te);else if(et==="object"){if(typeof R.then=="function")return Ze(He(R),Y,he,H,te);throw Y=String(R),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return Te}function Oe(R,Y,he){if(R==null)return R;var H=[],te=0;return Ze(R,H,"","",function(et){return Y.call(he,et,te++)}),H}function pe(R){if(R._status===-1){var Y=null,he=null,H=R._ioInfo;H!=null&&(H.start=H.end=performance.now(),H.value=new Promise(function(Te,ye){Y=Te,he=ye})),H=R._result;var te=H();if(te.then(function(Te){if(R._status===0||R._status===-1){R._status=1,R._result=Te;var ye=R._ioInfo;if(ye!=null){ye.end=performance.now();var Je=Te?.default;Y(Je),ye.value.status="fulfilled",ye.value.value=Je}te.status===void 0&&(te.status="fulfilled",te.value=Te)}},function(Te){if(R._status===0||R._status===-1){R._status=2,R._result=Te;var ye=R._ioInfo;ye!=null&&(ye.end=performance.now(),ye.value.then(E,E),he(Te),ye.value.status="rejected",ye.value.reason=Te),te.status===void 0&&(te.status="rejected",te.reason=Te)}}),H=R._ioInfo,H!=null){var et=te.displayName;typeof et=="string"&&(H.name=et)}R._status===-1&&(R._status=0,R._result=te)}if(R._status===1)return H=R._result,H===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
4
4
 
5
5
  Your code should look like:
6
6
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -1588,7 +1588,7 @@ Available templates:`));for(let[E,C]of Object.entries(vy))console.log(` ${D.cya
1588
1588
  `,0);try{if(c.bundledPath){let E=Dy($_(W_(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");V_(Dy(E,c.bundledPath),p,{recursive:!0});let C=P_(p).replace(/-/g,"_");for(let I of["services/platform/messaging/docker-compose.yml","services/shop/orders-api/service.json","services/shop/orders-api/src/index.ts","services/shop/orders-worker/service.json","services/shop/orders-worker/src/index.ts"]){let Q=_m(p,I),w=vS(Q,"utf-8");Z_(Q,w.replaceAll("tdk_example",C))}}else q_("git",["clone",c.repo,p],{stdio:"inherit"})}catch{ra(c.bundledPath?"Bundled example copy failed. Reinstall the Flisk CLI package and try again.":"git clone failed. Check you have git installed and network access.")}Nr(),console.log(D.green(`
1589
1589
  \u2705 Cloned "${n}" into ${f}/`)),Xe(`
1590
1590
  Next steps:`,0),Xe(`1. cd ${f}`),Xe("2. flisk doctor # check Docker/Tilt are ready"),Xe("3. flisk up # start the stack"),Xe(`
1591
- Runtime readiness:`,0);for(let E of A)Xe(E,0)}var Yh={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:nH()},alpha:{name:"Alpha",description:"Essential business services",enabledStacks:[]},beta:{name:"Beta",description:"Extended features",enabledStacks:[]},out_of_scope:{name:"Out of Scope",description:"Future releases",enabledStacks:[]}},optional_infra:{monitoring:!1,elk:!1,debezium:!1,golden_image:!0,verdaccio:!1},discovery:{paths:["services/*/*"]},overrides:{}},AN=ol(new eH("project")).description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(vy).join(", ")})`).option("--path <dir>","Directory to clone the template into (default: the template's repo name)").option("--check","Check if master configs exist and are in sync").option("--force","Overwrite existing configuration (dangerous)").option("--config-file <path>","Load project config from existing JSON file").action(async(n,i)=>{let{assertMachineReadyOrExit:A,detectRuntimePrerequisites:c,formatRuntimeNextSteps:f}=await import("./cold-preflight-MM46GFQA.js");await A({scope:"scaffold"});let p=f(c());if(n){await Bn(async()=>oH(n,i.path,p));return}await Bn(async()=>{let E=gn();E||(E=iN(),di(`\u{1F680} Initializing new Flisk project...
1591
+ Runtime readiness:`,0);for(let E of A)Xe(E,0)}var Yh={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:nH()},alpha:{name:"Alpha",description:"Essential business services",enabledStacks:[]},beta:{name:"Beta",description:"Extended features",enabledStacks:[]},out_of_scope:{name:"Out of Scope",description:"Future releases",enabledStacks:[]}},optional_infra:{monitoring:!1,elk:!1,debezium:!1,golden_image:!0,verdaccio:!1},discovery:{paths:["services/*/*"]},overrides:{}},AN=ol(new eH("project")).description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(vy).join(", ")})`).option("--path <dir>","Directory to clone the template into (default: the template's repo name)").option("--check","Check if master configs exist and are in sync").option("--force","Overwrite existing configuration (dangerous)").option("--config-file <path>","Load project config from existing JSON file").action(async(n,i)=>{let{assertMachineReadyOrExit:A,detectRuntimePrerequisites:c,formatRuntimeNextSteps:f}=await import("./cold-preflight-SY26O2IG.js");await A({scope:"scaffold"});let p=f(c());if(n){await Bn(async()=>oH(n,i.path,p));return}await Bn(async()=>{let E=gn();E||(E=iN(),di(`\u{1F680} Initializing new Flisk project...
1592
1592
  `),Xe(`Location: ${E}
1593
1593
  `,0));let C=_m(E,".tdk"),I=_m(C,qc);if(i.check){let L=kA.every(ge=>Pc(_m(E,".tdk",".tdk-out",ge))),j=Pc(I);if(L&&j){let ge=AA(E);fi("Project configuration is valid"),Xe(`Project: ${ge.project.name}`,3),Xe(`Phases: ${Object.keys(ge.phases).join(", ")}`,3),process.exit(0)}else{if(console.log(D.yellow("\u26A0\uFE0F Project configuration incomplete:")),j||Xe(".tdk/project.json (not found)",3),!L)for(let ge of kA.filter(ue=>!Pc(_m(E,".tdk/.tdk-out",ue))))Xe(`.tdk/.tdk-out/${ge} (not found)`,3);Xe("Run `flisk project` to create them."),process.exit(1)}}Zf("Project Configuration"),Xe(`Project root: ${E}
1594
1594
  `,0),Pc(C)||(C2(C),fi("Created: .tdk/ directory"));let Q=Pc(I);if(Q&&!i.force){fi(".tdk/project.json exists");let L=JSON.parse(vS(I,"utf-8")),j=AA(E),ge=DS(E),ue=RS(j,ge);if((ue.length>0||!L.phases)&&Zc(I,j),ue.length>0&&Xe(`Auto-enabled discovered service stacks: ${ue.join(", ")}`,0),di(`
@@ -1862,7 +1862,7 @@ Fix: ${C}`),console.error(D.red(`\u2717 ${E}`)),console.error(D.gray(` Fix: ${C
1862
1862
  `)),LA(c.join(`
1863
1863
  `)),A(lL))}function sL(n,i,A=Ol(),c=process.exit){if(i.ignoreVersion){console.warn(D.yellow("Warning: --ignore-version set; minTdkVersion was not checked."));return}let f=F2(n,A);f.status==="none"||f.status==="ok"||(i.onFail?.(`${f.message}
1864
1864
  ${f.fix}`),LA(`${f.message}
1865
- ${f.fix}`),c(1))}var oU=Symbol("startup-failed");async function cL(n,i,A=process.exit){let c=await Promise.race([n,i.then(()=>oU)]);return c===oU&&A(1),c}function uL(n,i=3e4){return new Promise(A=>{let c=Date.now()+i,f=()=>{let p=tL({host:"127.0.0.1",port:n}),E=!1,C=I=>{E||(E=!0,p.destroy(),I||Date.now()>=c?A(I):setTimeout(f,250))};p.once("connect",()=>C(!0)),p.once("error",()=>C(!1))};f()})}var aU=new nL("up").description("Start all services (optionally filtered by stack)").alias("deploy").argument("[stack-name]","Name of the stack to start (optional - runs all if omitted)").option("-v, --verbose","Enable verbose output",!1).option("-q, --quiet","Suppress non-essential output",!1).option("--dry-run","Show what would be started without starting",!1).option("-f, --force","Kill existing Tilt process before starting",!1).option("--ignore-drift","Start even if generated files differ from service.json",!1).option("--ignore-version","Start even if this flisk is older than minTdkVersion in .tdk/project.json",!1).option("--only <services...>","Start only these services plus what the Tiltfile enables for them (their dependsOn services and shared infrastructure). With a stack, names must belong to that stack; dependencies may cross stacks").option("--json","Print one JSON object on stdout when the stack is ready or the command fails; implies --quiet",!1).action(async(n,i)=>{let A=i.json?Iy("UP_FAILED","flisk up"):void 0;i.json&&(i.quiet=!0);let c=_S(process.env.TILT_PORT);c.ok||(A?.({ok:!1},[{code:"INVALID_TILT_PORT",message:c.message}]),ra(c.message));let f=c.port,p=gn();p&&sL(p,{ignoreVersion:i.ignoreVersion,onFail:U=>A?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:U}])});let E=i.dryRun?null:await aL();E&&(A?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),ra(E));let C=oL(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);C&&ra(C);let I=gn(),Q;if(I){try{Q=Qm(I),Sm(Q.problems)}catch{}Q&&XO(I,{resources:Q.resources,onInvalid:U=>A?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:U}])})}if(!i.dryRun){let{assertMachineReadyOrExit:U}=await import("./cold-preflight-MM46GFQA.js");await U()}let w=async()=>{let U=i.dryRun?Aa():gn(),S=U??process.cwd(),x=a2(U&&U===I?Q:void 0),O,k=[];if((!i.only||n)&&(O=Ts(x),k=O.map(De=>De.name)),i.only){if(n&&!vm(n,x)){let be=Wt.stackNotFound(n,k);A?.({ok:!1},[uS(be).error]),be.exit()}let De=n?cS(n,x):x,nt=WO(i.only,De);if(nt.length>0){let be=De.map(Ge=>Ge.name),Jt=Wt.unknownServices(nt,be);A?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:Jt.message,...Jt.suggestions.length>0?{suggestions:Jt.suggestions}:{}}]),Jt.exit()}}U&&rL(U,{ignoreDrift:i.ignoreDrift,resources:x,onDrift:De=>A?.({ok:!1},[{code:"DRIFT_DETECTED",message:De}])}),U&&J2(U,{resources:x,onInvalid:De=>A?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:De}])}),U&&!A&&!i.quiet&&z2(U,x);let L=await Dm(S,{inspectDocker:!i.dryRun});if(!i.dryRun){if(U){let be=Oh(S);be.length>0&&!i.quiet&&console.log(D.gray(`Added ${be.join(", ")} to .env (generated; existing values unchanged)`))}U&&!eL(tU(S,".tdk",".tdk-out","Tiltfile"))&&(i.quiet||console.log(D.gray("No generated Tiltfile yet; generating .tdk/.tdk-out/ ...")),await Pf(S,{quiet:i.quiet}));let De=v2(S);De.length>0&&i.verbose&&!i.quiet&&console.log(D.gray(`Refreshed runtime assets: ${De.join(", ")}`));let nt=lN(S,x);nt.length>0&&!i.quiet&&console.log(D.gray(`Added ${nt.join(", ")} to the pre_alpha phase in .tdk/project.json`))}let j,ge,ue=[];if(n){if(j=cS(n,x),j.length===0){let De=Wt.stackNotFound(n,k);A?.({ok:!1},[uS(De).error]),De.exit()}ue=j.map(De=>De.name),ge=`stack "${n}"`}else{j=x;let De=O??Ts(x);ge=`all stacks (${Vn(De.length,"stack")}, ${Vn(j.length,"service")})`}let ke=[];if(i.only){let De=eU(i.only,x);j=De.selected,ke=De.dependencies,ue=j.map(nt=>nt.name),ge=`${Vn(i.only.length,"requested service")}${ke.length>0?` plus ${ke.join(", ")}`:""}`}i.verbose&&!i.quiet&&console.log(D.gray(`Found ${Vn(j.length,"service")} in ${ge}`));let we=j.map(De=>De.name);if(!i.quiet){console.log(D.blue(`${i.dryRun?"Would start":"Starting"} ${Vn(we.length,"service")} from ${ge}...`));for(let Ge of we)console.log(D.gray(` - ${Ge}`));let{appBase:De,apiBase:nt}=PI(L.ingressHttp),be=j.filter(Ge=>Ge.config?.appType==="frontend"),Jt=j.filter(Ge=>jA(Ge.config?.appType));if(be.length>0){console.log(D.blue(`
1865
+ ${f.fix}`),c(1))}var oU=Symbol("startup-failed");async function cL(n,i,A=process.exit){let c=await Promise.race([n,i.then(()=>oU)]);return c===oU&&A(1),c}function uL(n,i=3e4){return new Promise(A=>{let c=Date.now()+i,f=()=>{let p=tL({host:"127.0.0.1",port:n}),E=!1,C=I=>{E||(E=!0,p.destroy(),I||Date.now()>=c?A(I):setTimeout(f,250))};p.once("connect",()=>C(!0)),p.once("error",()=>C(!1))};f()})}var aU=new nL("up").description("Start all services (optionally filtered by stack)").alias("deploy").argument("[stack-name]","Name of the stack to start (optional - runs all if omitted)").option("-v, --verbose","Enable verbose output",!1).option("-q, --quiet","Suppress non-essential output",!1).option("--dry-run","Show what would be started without starting",!1).option("-f, --force","Kill existing Tilt process before starting",!1).option("--ignore-drift","Start even if generated files differ from service.json",!1).option("--ignore-version","Start even if this flisk is older than minTdkVersion in .tdk/project.json",!1).option("--only <services...>","Start only these services plus what the Tiltfile enables for them (their dependsOn services and shared infrastructure). With a stack, names must belong to that stack; dependencies may cross stacks").option("--json","Print one JSON object on stdout when the stack is ready or the command fails; implies --quiet",!1).action(async(n,i)=>{let A=i.json?Iy("UP_FAILED","flisk up"):void 0;i.json&&(i.quiet=!0);let c=_S(process.env.TILT_PORT);c.ok||(A?.({ok:!1},[{code:"INVALID_TILT_PORT",message:c.message}]),ra(c.message));let f=c.port,p=gn();p&&sL(p,{ignoreVersion:i.ignoreVersion,onFail:U=>A?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:U}])});let E=i.dryRun?null:await aL();E&&(A?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),ra(E));let C=oL(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);C&&ra(C);let I=gn(),Q;if(I){try{Q=Qm(I),Sm(Q.problems)}catch{}Q&&XO(I,{resources:Q.resources,onInvalid:U=>A?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:U}])})}if(!i.dryRun){let{assertMachineReadyOrExit:U}=await import("./cold-preflight-SY26O2IG.js");await U()}let w=async()=>{let U=i.dryRun?Aa():gn(),S=U??process.cwd(),x=a2(U&&U===I?Q:void 0),O,k=[];if((!i.only||n)&&(O=Ts(x),k=O.map(De=>De.name)),i.only){if(n&&!vm(n,x)){let be=Wt.stackNotFound(n,k);A?.({ok:!1},[uS(be).error]),be.exit()}let De=n?cS(n,x):x,nt=WO(i.only,De);if(nt.length>0){let be=De.map(Ge=>Ge.name),Jt=Wt.unknownServices(nt,be);A?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:Jt.message,...Jt.suggestions.length>0?{suggestions:Jt.suggestions}:{}}]),Jt.exit()}}U&&rL(U,{ignoreDrift:i.ignoreDrift,resources:x,onDrift:De=>A?.({ok:!1},[{code:"DRIFT_DETECTED",message:De}])}),U&&J2(U,{resources:x,onInvalid:De=>A?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:De}])}),U&&!A&&!i.quiet&&z2(U,x);let L=await Dm(S,{inspectDocker:!i.dryRun});if(!i.dryRun){if(U){let be=Oh(S);be.length>0&&!i.quiet&&console.log(D.gray(`Added ${be.join(", ")} to .env (generated; existing values unchanged)`))}U&&!eL(tU(S,".tdk",".tdk-out","Tiltfile"))&&(i.quiet||console.log(D.gray("No generated Tiltfile yet; generating .tdk/.tdk-out/ ...")),await Pf(S,{quiet:i.quiet}));let De=v2(S);De.length>0&&i.verbose&&!i.quiet&&console.log(D.gray(`Refreshed runtime assets: ${De.join(", ")}`));let nt=lN(S,x);nt.length>0&&!i.quiet&&console.log(D.gray(`Added ${nt.join(", ")} to the pre_alpha phase in .tdk/project.json`))}let j,ge,ue=[];if(n){if(j=cS(n,x),j.length===0){let De=Wt.stackNotFound(n,k);A?.({ok:!1},[uS(De).error]),De.exit()}ue=j.map(De=>De.name),ge=`stack "${n}"`}else{j=x;let De=O??Ts(x);ge=`all stacks (${Vn(De.length,"stack")}, ${Vn(j.length,"service")})`}let ke=[];if(i.only){let De=eU(i.only,x);j=De.selected,ke=De.dependencies,ue=j.map(nt=>nt.name),ge=`${Vn(i.only.length,"requested service")}${ke.length>0?` plus ${ke.join(", ")}`:""}`}i.verbose&&!i.quiet&&console.log(D.gray(`Found ${Vn(j.length,"service")} in ${ge}`));let we=j.map(De=>De.name);if(!i.quiet){console.log(D.blue(`${i.dryRun?"Would start":"Starting"} ${Vn(we.length,"service")} from ${ge}...`));for(let Ge of we)console.log(D.gray(` - ${Ge}`));let{appBase:De,apiBase:nt}=PI(L.ingressHttp),be=j.filter(Ge=>Ge.config?.appType==="frontend"),Jt=j.filter(Ge=>jA(Ge.config?.appType));if(be.length>0){console.log(D.blue(`
1866
1866
  \u{1F30D} Frontend URLs:`));for(let Ge of be){let Qt=Ge.config?.basePath??`/${Ge.name}`;console.log(D.gray(` - ${Ge.name}: ${De}${D.cyan(rS(Qt))}`))}}if(Jt.length>0){console.log(D.blue(`
1867
1867
  \u{1F527} Backend API URLs:`));for(let Ge of Jt){let Qt=Ge.name.replace(/-api$/,""),An=Ge.config?.apiPath??`/api/${Qt}`,ft=Ge.config?.sablier,rn=ft?.enable&&ft?.deferStart?D.dim(" (deferred \u2014 starts on first request)"):"";console.log(D.gray(` - ${Ge.name}: ${nt}${D.cyan(rS(An))}${rn}`))}}}let He=i.only??(n?[n]:void 0),Ze=MR(ue,{verbose:i.verbose,quiet:i.quiet,force:i.force,focusTargets:He}),Oe=He?`tilt up ${Ze.join(" ")}`:"tilt up";if(!i.quiet){console.log(D.blue(u2(L)));for(let De of VO(L))console.log(D.yellow(De));console.log(D.gray("Override with TDK_HTTP_PORT, TDK_HTTPS_PORT, or TDK_POSTGRES_PORT."))}if(A&&i.dryRun){A({ok:!0,dryRun:!0,stack:n??null,services:we,...i.only?{requested:i.only,declaredDependencies:ke}:{},command:Oe});return}if(br(i,"not starting services",Oe))return;d2(L),f2(S,L);let pe=xl.tiltUi,Be=f??pe,Bt=i.only?[...new Set([pe,Be])]:[Be],{running:We,foreign:Rt}=await PO(Bt,S,async De=>await td(De)!==null);if(Rt.length>0&&f!==void 0){let De=Rt[0],nt=`TILT_PORT=${De?.port} is used by another project's Tilt (${De?.root}). Choose a free port, or run flisk down in that project.`;A?.({ok:!1},[{code:"TILT_PORT_IN_USE",message:nt}]),ra(nt)}if(!i.quiet)for(let De of Rt)console.log(D.yellow(`\u26A0\uFE0F Tilt on port ${De.port} belongs to another project (${De.root}); this project will use another port.`));let It=i.force&&Rt.length===0,fe=bN({runningPorts:We,force:It,only:!!i.only});if(fe.action==="already-running"){let De=`Environment is already running on port ${fe.ports.join(", ")}.`;A?.({ok:!0,alreadyRunning:!0,tiltUrl:`http://localhost:${fe.ports[0]}`}),i.quiet||console.log(D.green(De));return}if(fe.action==="only-blocked"){let De=`A Tilt is already running on port ${fe.ports.join(", ")}. --only cannot change a running stack's services: run \`flisk down\` first, or pass --force to replace it.`;A?.({ok:!1},[{code:"TILT_ALREADY_RUNNING",message:De}]),ra(De)}if(i.only)for(let De of We)H0(De);let Me=await xN({configuredPort:f,force:It,basePort:pe,findAvailablePort:tN}),Ue=Me.port;Me.autoSwitched&&!i.quiet&&(console.log(D.yellow(`\u26A0\uFE0F Port ${pe} is already in use`)),console.log(D.blue(`\u{1F504} Auto-switching to port ${Ue}
1868
1868
  `))),process.env.TILT_PORT=Ue.toString(),await ON({force:It,quiet:i.quiet,port:Ue},{stop:H0,log:De=>console.log(D.yellow(De)),wait:De=>new Promise(nt=>setTimeout(nt,De))}),i.quiet||(console.log(D.gray(`
@@ -1870,14 +1870,14 @@ Running tilt up...`)),console.log(D.gray("Using Tiltfile: .tdk/.tdk-out/Tiltfile
1870
1870
  `))}}if(De&&!i.quiet&&!X){for(let Ge of nU(Ue))console.log(D.blue(Ge));lt=!0}if(De&&it.length>0&&(A?nt:!X)){i.quiet||console.log(D.gray(`Smoke check: ${it.map(An=>An.name).join(", ")}`));let Ge=B2(S);Ge&&console.warn(D.yellow(Ge));let Qt=await XR(it,{recordDir:tU(S,".tdk","smoke"),...VR(S,An=>console.warn(D.yellow(An)))});for(let An of Qt)An.ok?i.quiet||console.log(D.green(`Smoke check passed: ${An.name}`)):(ze=!0,LA(qR(An)));ze&&(H0(Ue),A?.({ok:!1},[{code:"UP_SMOKE_FAILED",message:"A smoke check failed; Tilt was stopped"}]))}De&&nt&&!ze&&A?.({ok:!0,stack:n??null,services:be,...i.only?{requested:i.only,dependencies:Jt}:{},tiltUrl:`http://localhost:${Ue}`}),X&&Ie()})(),en=await cL(je,st);if(await tt,ze&&process.exit(1),en.exitCode!==0&&VI("up",en.exitCode),X&&en.exitCode===0&&process.exit(1),!i.quiet&&en.exitCode===0&&!lt)for(let De of nU(Ue))console.log(D.blue(De))};i.dryRun?await Bn(w):await qI(w)});import{execFileSync as ya,execSync as sU}from"node:child_process";import{createHash as fL}from"node:crypto";import{accessSync as dL,chmodSync as gL,constants as mL,existsSync as Hs,mkdirSync as lU,readFileSync as pL,realpathSync as F1,renameSync as Cd,rmSync as G0,writeFileSync as AU}from"node:fs";import{basename as cU,dirname as Y1,join as Oi,resolve as z1,win32 as EL}from"node:path";import{fileURLToPath as hL}from"node:url";import{Command as CL}from"commander";var iU=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function hd(n){let i=process.stderr,A=i.isTTY===!0,c=0,f=n,p,E=()=>i.write(`\r\x1B[2K${D.cyan(iU[c])} ${f}`);A?(E(),p=setInterval(()=>{c=(c+1)%iU.length,E()},80)):i.write(`- ${f}
1871
1871
  `);let C=(I,Q)=>{p&&clearInterval(p),i.write(`${A?"\r\x1B[2K":""}${I} ${Q??f}
1872
1872
  `)};return{get text(){return f},set text(I){f=I,A||i.write(`- ${f}
1873
- `)},succeed:I=>C(D.green("\u2714"),I),fail:I=>C(D.red("\u2716"),I),warn:I=>C(D.yellow("\u26A0"),I)}}function uU(n){if(Rs()&&n.toLowerCase().endsWith(".exe"))return!0;try{let i=ya("file",["-b",n],{encoding:"utf-8"});return/Mach-O|ELF/.test(i)}catch(i){return ui("Binary detection (file command) error",i),!1}}function BL(n,i,A=process.platform){let c=(A==="win32"?EL.basename(n):cU(n)).toLowerCase();if(c==="flisk"||c==="flisk.exe"||c==="tdk"||c==="tdk.exe")return{method:"binary",path:n};if(c==="node"||c==="node.exe"){let p=i.toLowerCase();if(p.includes("node_modules")||p.includes(".npm"))return{method:"npm",path:i}}return null}function IL(n,i){return n==="win32"&&i.method==="npm"?"use npm install -g flisk@latest":null}function fU(){let n=process.execPath,i=BL(n,process.argv[1]??"");if(i)return i;try{let A=lA(Cm())??lA(xR());if(!A)return{method:"unknown"};let c=F1(A);if(c.includes("tdk-cli")){let p=z1(c,"..","..","..");if(Hs(Oi(p,".git")))return{method:"git",path:p}}if(A.includes("node_modules")||A.includes(".npm")||A.includes(".bun"))return A.includes(".bun")?{method:"bun",path:A}:{method:"npm",path:A};let f=z1(Y1(hL(new URL("../dist/commands/upgrade.js",import.meta.url).href)),"..","..","..");return Hs(Oi(f,".git"))?{method:"git",path:f}:uU(c)?{method:"binary",path:c}:{method:"unknown",path:A}}catch(A){return console.warn(D.yellow("\u26A0\uFE0F Could not detect installation method")),ui("Installation detection error",A),{method:"unknown"}}}function yL(n){try{let i=F1(n);if(i.includes("tdk-cli")){let A=z1(i,"..","..","..");if(Hs(Oi(A,".git")))return{method:"git",path:A}}if(n.includes("node_modules")||n.includes(".npm")||n.includes(".bun"))return{method:n.includes(".bun")?"bun":"npm",path:n};if(uU(i))return{method:"binary",path:i}}catch(i){ui(`Installation detection failed for ${n}`,i)}return{method:"unknown",path:n}}function dU(){let n=OR(Cm()).map(yL),i=fU();i.method!=="unknown"&&n.unshift(i);let A=new Map;for(let c of n){if(c.method==="unknown"||!c.path)continue;let f=c.path;try{c.method==="binary"&&(f=F1(c.path))}catch{}A.set(`${c.method}:${f}`,c)}return[...A.values()]}var k0="flisk-sh/tdk-cli-releases",gU="flisk-cli-engine.tar.gz",J1="checksums.txt";function QL(n){let i=new Map;for(let A of n.split(`
1873
+ `)},succeed:I=>C(D.green("\u2714"),I),fail:I=>C(D.red("\u2716"),I),warn:I=>C(D.yellow("\u26A0"),I)}}function uU(n){if(Rs()&&n.toLowerCase().endsWith(".exe"))return!0;try{let i=ya("file",["-b",n],{encoding:"utf-8"});return/Mach-O|ELF/.test(i)}catch(i){return ui("Binary detection (file command) error",i),!1}}function BL(n,i,A=process.platform){let c=(A==="win32"?EL.basename(n):cU(n)).toLowerCase();if(c==="flisk"||c==="flisk.exe"||c==="tdk"||c==="tdk.exe")return{method:"binary",path:n};if(c==="node"||c==="node.exe"){let p=i.toLowerCase();if(p.includes("node_modules")||p.includes(".npm"))return{method:"npm",path:i}}return null}function IL(n,i){return n==="win32"&&i.method==="npm"?"use npm install -g @flisk-sh/flisk@latest":null}function fU(){let n=process.execPath,i=BL(n,process.argv[1]??"");if(i)return i;try{let A=lA(Cm())??lA(xR());if(!A)return{method:"unknown"};let c=F1(A);if(c.includes("tdk-cli")){let p=z1(c,"..","..","..");if(Hs(Oi(p,".git")))return{method:"git",path:p}}if(A.includes("node_modules")||A.includes(".npm")||A.includes(".bun"))return A.includes(".bun")?{method:"bun",path:A}:{method:"npm",path:A};let f=z1(Y1(hL(new URL("../dist/commands/upgrade.js",import.meta.url).href)),"..","..","..");return Hs(Oi(f,".git"))?{method:"git",path:f}:uU(c)?{method:"binary",path:c}:{method:"unknown",path:A}}catch(A){return console.warn(D.yellow("\u26A0\uFE0F Could not detect installation method")),ui("Installation detection error",A),{method:"unknown"}}}function yL(n){try{let i=F1(n);if(i.includes("tdk-cli")){let A=z1(i,"..","..","..");if(Hs(Oi(A,".git")))return{method:"git",path:A}}if(n.includes("node_modules")||n.includes(".npm")||n.includes(".bun"))return{method:n.includes(".bun")?"bun":"npm",path:n};if(uU(i))return{method:"binary",path:i}}catch(i){ui(`Installation detection failed for ${n}`,i)}return{method:"unknown",path:n}}function dU(){let n=OR(Cm()).map(yL),i=fU();i.method!=="unknown"&&n.unshift(i);let A=new Map;for(let c of n){if(c.method==="unknown"||!c.path)continue;let f=c.path;try{c.method==="binary"&&(f=F1(c.path))}catch{}A.set(`${c.method}:${f}`,c)}return[...A.values()]}var k0="flisk-sh/tdk-cli-releases",gU="flisk-cli-engine.tar.gz",J1="checksums.txt";function QL(n){let i=new Map;for(let A of n.split(`
1874
1874
  `)){let c=A.trim().match(/^([0-9a-f]{64})\s+\*?(.+)$/i);c&&i.set(c[2].trim(),c[1].toLowerCase())}return i}function rU(n,i,A,c){let f=A.get(i);if(!f){if(c)throw new Error(`${J1} has no entry for ${i}`);ui(`${J1} has no entry for ${i}; skipping verification`);return}let p=fL("sha256").update(pL(n)).digest("hex");if(p!==f)throw new Error(`${Rs()?"checksum mismatch":"Checksum mismatch"} for ${i} (expected ${f}, got ${p})`)}async function mU(){let n=bR();if(!n)return null;try{let i=await fetch(`https://api.github.com/repos/${k0}/releases/latest`,{signal:AbortSignal.timeout(1e4)});if(!i.ok)return null;let A=await i.json();return A.tag_name?{tag:A.tag_name,assetName:n,downloadUrl:`https://github.com/${k0}/releases/download/${A.tag_name}/${n}`,engineDownloadUrl:`https://github.com/${k0}/releases/download/${A.tag_name}/${gU}`,checksumsUrl:`https://github.com/${k0}/releases/download/${A.tag_name}/${J1}`}:null}catch(i){return ui("Binary release lookup error",i),null}}function SL(n){let i=n?.code;return i==="EACCES"||i==="EPERM"}function vL(n){try{return dL(n,mL.W_OK),!0}catch{return!1}}async function pU(n,i){let A=Y1(n);if(!vL(A))return console.log(D.yellow(`
1875
1875
  \u{1F512} ${A} isn't writable by your user.`)),console.log(D.yellow("\u{1F4A1} Upgrade manually instead:")),Rs()?console.log(D.cyan(" Install Flisk in a user-writable directory, then retry the upgrade.")):(console.log(D.cyan(` curl -fsSL -o ${n} ${i.downloadUrl}`)),console.log(D.cyan(` chmod +x ${n}`))),!1;let c=hd(`Downloading ${i.assetName} (${i.tag})...`),f=Oi(A,`.tdk-upgrade-${process.pid}-${Date.now()}`),p=Oi(f,i.assetName),E=Oi(f,"engine.tar.gz"),C=Oi(A,"tdk-cli"),I=Oi(f,"tdk-cli"),Q=Oi(f,`${cU(n)}.previous`),w=Oi(f,"tdk-cli.previous");try{lU(f,{recursive:!0});let U=await fetch(i.downloadUrl,{signal:AbortSignal.timeout(12e4)});if(!U.ok)throw new Error(`Download failed (${U.status})`);AU(p,Buffer.from(await U.arrayBuffer())),c.text=`Downloading bundled engine (${i.tag})...`;let S=await fetch(i.engineDownloadUrl,{signal:AbortSignal.timeout(12e4)});if(!S.ok)throw new Error(`Engine download failed (${S.status})`);let x=Buffer.from(await S.arrayBuffer());AU(E,x),c.text=`Verifying checksums (${i.tag})...`;let O=await fetch(i.checksumsUrl,{signal:AbortSignal.timeout(3e4)});if(!O.ok)throw new Error(`Checksum download failed (${O.status})`);let k=QL(await O.text());rU(p,i.assetName,k,!0),rU(E,gU,k,!1),Rs()||gL(p,493),lU(I,{recursive:!0}),p2(x,I),Hs(n)&&Cd(n,Q);try{Cd(p,n)}catch(L){throw Hs(Q)&&Cd(Q,n),L}Hs(C)&&Cd(C,w);try{Cd(I,C)}catch(L){throw Hs(w)&&Cd(w,C),Hs(Q)&&(G0(n,{force:!0}),Cd(Q,n)),L}return G0(Q,{force:!0}),G0(w,{recursive:!0,force:!0}),c.succeed(`Upgraded to ${i.tag}`),!0}catch(U){return c.fail(`Binary upgrade failed: ${Vf(U)}`),ui("Binary upgrade error",U),console.log(D.yellow(`
1876
- \u{1F4A1} If this failed due to permissions, use the platform installer or install command.`)),!1}finally{G0(f,{recursive:!0,force:!0})}}function DL(){try{return Ol()}catch(n){return ui("Version detection error",n),"unknown"}}async function RL(){let n=hd("Checking for latest version...");try{let i;if(Rs()){let A=await fetch("https://registry.npmjs.org/flisk/latest",{signal:AbortSignal.timeout(1e4)});if(!A.ok)throw new Error(`npm registry returned ${A.status}`);if(i=(await A.json()).version??"",!i)throw new Error("npm registry response did not include a version")}else i=sU("npm view flisk version",{encoding:"utf-8",timeout:1e4}).trim();return n.succeed(`Latest version: ${D.green(i)}`),i}catch(i){return ui("npm registry check failed",i),n.warn("Could not check the npm registry"),console.log(D.yellow(`
1877
- Install the latest published release manually:`)),console.log(D.cyan(" npm install -g flisk@latest")),console.log(D.cyan(" bun install -g flisk@latest")),null}}async function EU(){let n=hd("Upgrading via npm...");try{return sU("npm install -g flisk@latest",{stdio:["inherit","inherit","pipe"],timeout:12e4}),n.succeed("Upgraded successfully via npm"),!0}catch(i){let A=i&&typeof i=="object"&&"stderr"in i?String(i.stderr??""):"";A&&process.stderr.write(A),ui("npm upgrade error",i),n.fail(`npm upgrade failed: ${Vf(i)}`),console.log(D.yellow(`
1878
- To retry manually, install the latest published npm release:`)),console.log(D.cyan(" npm install -g flisk@latest"));let c=i&&typeof i=="object"&&"code"in i?String(i.code??""):"";return/EACCES|EPERM|permission denied/i.test(`${c} ${Vf(i)} ${A}`)&&(console.log(D.gray(`
1879
- For EACCES or EPERM, fix npm's global prefix or use the binary installer:`)),console.log(D.cyan(" https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally/")),console.log(D.cyan(Rs()?" irm https://tdk-landscape.github.io/install.ps1 | iex":" curl -fsSL https://tdk-landscape.github.io/install.sh | sh"))),!1}}async function hU(){let n=hd("Upgrading via bun...");try{return ya(lA("bun")??"bun",["install","-g","flisk@latest"],{stdio:"inherit",timeout:12e4}),n.succeed("Upgraded successfully via bun"),!0}catch(i){return ui("bun upgrade error",i),n.fail(`Bun upgrade failed: ${Vf(i)}`),console.log(D.yellow(`
1880
- To retry manually, install the latest published Bun release:`)),console.log(D.cyan(" bun install -g flisk@latest")),!1}}async function TL(n){let i=dU();if(!i.length)return console.error(D.red("Could not find any Flisk installations on PATH.")),!1;console.log(D.blue(`Found ${i.length} Flisk installation${i.length===1?"":"s"}:`));for(let E of i)console.log(D.gray(` ${E.method}: ${E.path}`));if(n)return console.log(D.yellow(`
1876
+ \u{1F4A1} If this failed due to permissions, use the platform installer or install command.`)),!1}finally{G0(f,{recursive:!0,force:!0})}}function DL(){try{return Ol()}catch(n){return ui("Version detection error",n),"unknown"}}async function RL(){let n=hd("Checking for latest version...");try{let i;if(Rs()){let A=await fetch("https://registry.npmjs.org/@flisk-sh%2fflisk/latest",{signal:AbortSignal.timeout(1e4)});if(!A.ok)throw new Error(`npm registry returned ${A.status}`);if(i=(await A.json()).version??"",!i)throw new Error("npm registry response did not include a version")}else i=sU("npm view @flisk-sh/flisk version",{encoding:"utf-8",timeout:1e4}).trim();return n.succeed(`Latest version: ${D.green(i)}`),i}catch(i){return ui("npm registry check failed",i),n.warn("Could not check the npm registry"),console.log(D.yellow(`
1877
+ Install the latest published release manually:`)),console.log(D.cyan(" npm install -g @flisk-sh/flisk@latest")),console.log(D.cyan(" bun install -g @flisk-sh/flisk@latest")),null}}async function EU(){let n=hd("Upgrading via npm...");try{return sU("npm install -g @flisk-sh/flisk@latest",{stdio:["inherit","inherit","pipe"],timeout:12e4}),n.succeed("Upgraded successfully via npm"),!0}catch(i){let A=i&&typeof i=="object"&&"stderr"in i?String(i.stderr??""):"";A&&process.stderr.write(A),ui("npm upgrade error",i),n.fail(`npm upgrade failed: ${Vf(i)}`),console.log(D.yellow(`
1878
+ To retry manually, install the latest published npm release:`)),console.log(D.cyan(" npm install -g @flisk-sh/flisk@latest"));let c=i&&typeof i=="object"&&"code"in i?String(i.code??""):"";return/EACCES|EPERM|permission denied/i.test(`${c} ${Vf(i)} ${A}`)&&(console.log(D.gray(`
1879
+ For EACCES or EPERM, fix npm's global prefix or use the binary installer:`)),console.log(D.cyan(" https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally/")),console.log(D.cyan(Rs()?" irm https://tdk-landscape.github.io/install.ps1 | iex":" curl -fsSL https://tdk-landscape.github.io/install.sh | sh"))),!1}}async function hU(){let n=hd("Upgrading via bun...");try{return ya(lA("bun")??"bun",["install","-g","@flisk-sh/flisk@latest"],{stdio:"inherit",timeout:12e4}),n.succeed("Upgraded successfully via bun"),!0}catch(i){return ui("bun upgrade error",i),n.fail(`Bun upgrade failed: ${Vf(i)}`),console.log(D.yellow(`
1880
+ To retry manually, install the latest published Bun release:`)),console.log(D.cyan(" bun install -g @flisk-sh/flisk@latest")),!1}}async function TL(n){let i=dU();if(!i.length)return console.error(D.red("Could not find any Flisk installations on PATH.")),!1;console.log(D.blue(`Found ${i.length} Flisk installation${i.length===1?"":"s"}:`));for(let E of i)console.log(D.gray(` ${E.method}: ${E.path}`));if(n)return console.log(D.yellow(`
1881
1881
  Dry run: no installations were changed.`)),!0;let A=i.filter(E=>E.method==="binary"&&E.path),c=A.length?await mU():null;if(A.length&&!c)return console.error(D.red("Could not find a compatible Flisk binary release for this platform.")),!1;let f=!0,p=new Set;for(let E of i){let C=E.method==="npm"||E.method==="bun"?E.method:`${E.method}:${E.path}`;if(!p.has(C))if(p.add(C),E.method==="git"&&E.path)console.log(D.cyan(`
1882
1882
  Updating git install at ${E.path}`)),f=await CU(E.path)&&f;else if(E.method==="binary"&&E.path&&c){let I=c.tag.replace(/^v/,"").split("-")[0],Q="";try{Q=ya(E.path,["version"],{encoding:"utf-8",timeout:1e4}).trim()}catch{}Q===I?console.log(D.green(`
1883
1883
  ${E.path} is already current (${Q}).`)):(console.log(D.cyan(`
@@ -1887,7 +1887,7 @@ Updating the Bun installation...`)),f=await hU()&&f)}return f?console.log(D.gree
1887
1887
  All Flisk installations on PATH are up to date.`)):console.error(D.red(`
1888
1888
  At least one Flisk installation could not be updated.`)),f}async function CU(n){let i=hd("Updating the git installation from the default branch..."),A=!1;try{if(ya("git",["rev-parse","--git-dir"],{cwd:n,stdio:"pipe"}),i.text="Fetching from origin...",ya("git",["fetch","origin"],{cwd:n,stdio:"pipe",timeout:3e4}),ya("git",["status","--porcelain"],{cwd:n,encoding:"utf-8"}).trim())throw new Error("The Flisk source checkout has local changes. Commit or stash them, then run `flisk upgrade` again.");let f=ya("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:n,encoding:"utf-8"}).trim(),p="";try{p=ya("git",["symbolic-ref","--quiet","--short","refs/remotes/origin/HEAD"],{cwd:n,encoding:"utf-8",stdio:"pipe"}).trim()}catch{for(let C of["origin/main","origin/master"])try{ya("git",["rev-parse","--verify",C],{cwd:n,stdio:"pipe"}),p=C;break}catch{}}if(!p?.startsWith("origin/"))throw new Error("Could not find the default branch for origin (expected origin/HEAD, origin/main, or origin/master).");let E=p.slice(7);return f===E?(i.text=`Fast-forwarding ${f} from origin/${E}...`,ya("git",["pull","--ff-only","origin",E],{cwd:n,stdio:"pipe",timeout:3e4})):(i.text=`Rebasing ${f} onto origin/${E}...`,A=!0,ya("git",["rebase",p],{cwd:n,stdio:"pipe",timeout:6e4}),A=!1),Hs(Oi(n,"cli",hm))&&(i.text="Rebuilding CLI...",ya(lA("bun")??"bun",["install"],{cwd:Oi(n,"cli"),stdio:"pipe",timeout:6e4}),ya(lA("bun")??"bun",["run","build"],{cwd:Oi(n,"cli"),stdio:"pipe",timeout:6e4})),i.text="Re-linking CLI...",ya(lA("bun")??"bun",["link","--force"],{cwd:Oi(n,"cli"),stdio:"pipe",timeout:3e4}),i.succeed(`Upgraded successfully from origin/${E}`),!0}catch(c){if(A)try{ya("git",["rebase","--abort"],{cwd:n,stdio:"pipe"})}catch{}return i.fail(`Git upgrade failed: ${Vf(c)}`),!1}}function NL(){return ol(new CL("upgrade")).alias("update").description("Upgrade Flisk CLI to the latest version").option("-f, --force","Upgrade even if already on the latest version",!1).option("--all","Upgrade every Flisk installation found on PATH",!1).option("--dry-run","Show what would be upgraded without actually doing it",!1).action(async n=>{console.log(D.cyan(`\u{1F680} Flisk CLI Upgrade
1889
1889
  `));let i=DL();console.log(D.gray(`Current version: ${i}`));let A=fU();if(console.log(D.gray(`Installation method: ${A.method}`)),console.log(),n.all){let I=dU();I.length||(console.error(D.red("Could not find any Flisk installations on PATH.")),process.exit(1)),!n.dryRun&&!n.yes&&(await $f({message:`Upgrade all ${I.length} Flisk installations on PATH?`,initial:!0})||(Xf(),process.exit(0))),await TL(n.dryRun)||process.exit(1);return}let c=IL(process.platform,A);if(c){console.log(c);return}A.method==="unknown"&&(console.error(D.red("Could not detect installation method")),console.log(D.yellow(`
1890
- Manual upgrade using a published package:`)),console.log(D.cyan(" npm install -g flisk@latest")),console.log(D.cyan(" bun install -g flisk@latest")),console.log(D.cyan(" git: cd /path/to/tdk-cli && git pull && bun link --force")),process.exit(1));let f=null,p=null;if(A.method==="binary"&&A.path)console.log(D.blue("\u{1F4E6} Standalone binary installation detected")),p=await mU(),p||(process.platform==="win32"&&process.arch==="arm64"&&ra("Flisk Windows v1 supports AMD64 only. Use WSL2 Ubuntu or a 64-bit Intel/AMD PC."),process.platform==="win32"&&ra("No Windows AMD64 binary in this Flisk release. Need asset flisk-windows-amd64.exe."),ra(`Unsupported OS: Flisk does not support this OS: ${process.platform}. Supported: linux, darwin, win32.`)),f=p.tag.replace(/^v/,"").split("-")[0],f===i&&!n.force&&(console.log(D.green(`
1890
+ Manual upgrade using a published package:`)),console.log(D.cyan(" npm install -g @flisk-sh/flisk@latest")),console.log(D.cyan(" bun install -g @flisk-sh/flisk@latest")),console.log(D.cyan(" git: cd /path/to/tdk-cli && git pull && bun link --force")),process.exit(1));let f=null,p=null;if(A.method==="binary"&&A.path)console.log(D.blue("\u{1F4E6} Standalone binary installation detected")),p=await mU(),p||(process.platform==="win32"&&process.arch==="arm64"&&ra("Flisk Windows v1 supports AMD64 only. Use WSL2 Ubuntu or a 64-bit Intel/AMD PC."),process.platform==="win32"&&ra("No Windows AMD64 binary in this Flisk release. Need asset flisk-windows-amd64.exe."),ra(`Unsupported OS: Flisk does not support this OS: ${process.platform}. Supported: linux, darwin, win32.`)),f=p.tag.replace(/^v/,"").split("-")[0],f===i&&!n.force&&(console.log(D.green(`
1891
1891
  \u2705 You are already on the latest version!`)),console.log(D.gray(` ${i} (current) = ${f} (latest)`)),process.exit(0)),f!==i?console.log(D.yellow(`
1892
1892
  \u2B06\uFE0F Upgrade available: ${i} \u2192 ${f}`)):n.force&&console.log(D.yellow(`
1893
1893
  \u{1F504} Force upgrade requested (currently ${i})`));else if(A.method==="git"&&A.path){console.log(D.blue("\u{1F4E6} Git installation detected - will update from origin's default branch"));try{ya("git",["fetch","origin"],{cwd:A.path,stdio:"pipe"});let I=ya("git",["rev-parse","HEAD"],{cwd:A.path,encoding:"utf-8"}).trim(),Q=ya("git",["rev-parse","origin/main"],{cwd:A.path,encoding:"utf-8"}).trim();I===Q&&!n.force&&(console.log(D.green(`
@@ -1,2 +1,2 @@
1
1
  import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
- import{$b as d,Yb as a,Zb as b,_b as c,ac as e,bc as f,cc as g,dc as h,ec as i,fc as j}from"./chunk-QWYXYAX6.js";import"./chunk-BZ4H7MM4.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};
2
+ import{$b as d,Yb as a,Zb as b,_b as c,ac as e,bc as f,cc as g,dc as h,ec as i,fc as j}from"./chunk-CLCUIDBH.js";import"./chunk-BZ4H7MM4.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};
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.189",
4
+ "version": "1.3.190",
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.189",
3
+ "version": "1.3.190",
4
4
  "description": "Flisk — start services on your machine.",
5
5
  "homepage": "https://github.com/flisk-sh/flisk#readme",
6
6
  "repository": {