@tdk-landscape/tdk-cli-core 1.3.167 → 1.3.168

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.
@@ -12,7 +12,7 @@ import{c as Ke,e as rr}from"./chunk-42IVF3YT.js";import{a as wt}from"./chunk-6EA
12
12
  `:`# TDK (generated files and secrets)
13
13
  `}${s.join(`
14
14
  `)}
15
- `),s}import{existsSync as ra,lstatSync as sa}from"node:fs";import{isAbsolute as xr,normalize as ze,relative as oa,sep as wr}from"node:path";var xp=[`${N}/**`,".tdk/.tdk-out/**","Tiltfile","TILT_*.star",q,`${A} (create only)`,"shared-platform-engineering/docker-templates/**","services/platform/database-management/docker-compose.yml","product_autogenerated_resource_manifests/**","product_autogenerated_services_list/**"];function ia(e){let t=ze(e).split(wr).join("/");return xr(e)||t===".."||t.startsWith("../")?!1:t.split("/").includes(N)||t.startsWith(".tdk/.tdk-out/")||t==="shared-platform-engineering/docker-templates"||t.startsWith("shared-platform-engineering/docker-templates/")||t.startsWith("product_autogenerated_resource_manifests/")||t.startsWith("product_autogenerated_services_list/")?!0:t==="Tiltfile"||/^TILT_[^/]+\.star$/.test(t)||t===q||t===A||t==="services/platform/database-management/docker-compose.yml"}function oe(e,t){let n=xr(t)?ze(t):ze(`${e}/${t}`),r=oa(e,n).split(wr).join("/");if(!ia(r))throw new Error(`Refusing to write outside TDK's generated-file allowlist: ${r}`);let s=e;for(let o of r.split("/"))if(s=ze(`${s}/${o}`),ra(s)&&sa(s).isSymbolicLink())throw new Error(`Refusing to write through a symbolic link in generated path: ${r}`);return n}var _e=[C,"proxy"];import{existsSync as Kr,readFileSync as Gr}from"node:fs";import{copyFileSync as Rr,mkdirSync as ka,rmSync as Ar,writeFileSync as Dr}from"node:fs";import{join as de}from"node:path";function j(e){return e==="backend"||e==="mcp"}import{readFileSync as fa}from"node:fs";import{join as ma}from"node:path";import{existsSync as ca}from"node:fs";import{dirname as ua,join as la,resolve as vr}from"node:path";import{cwd as da}from"node:process";var Er={name:"tdk-cli-internal",private:!0,version:"1.3.167",description:"TDK CLI \u2014 start services on your machine.",keywords:["tdk","tilt","cli","local-dev","microservices"],homepage:"https://github.com/tdk-landscape/tdk-cli-core#readme",bugs:{url:"https://github.com/tdk-landscape/tdk-cli-core/issues"},repository:{type:"git",url:"git+https://github.com/tdk-landscape/tdk-cli-core.git",directory:"cli"},license:"MIT",author:"TDK Team",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",bin:{tdk:"bin/tdk.js","tdk-cli":"bin/tdk.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",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",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",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.1",vitest:"^5.0.0"},engines:{node:">=22.12.0"}};function y(e=da()){let t=vr(e),n=vr("/");for(;t!==n;){if(ca(la(t,".tdk",_)))return t;let r=ua(t);if(r===t)break;t=r}return null}var Ye=null;function pa(){if(Ye)return Ye;let e=Er;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return Ye={name:String(t.name??"@tdk-landscape/tdk-cli-core"),version:String(t.version??"0.0.0"),fullPackage:t},Ye}function Pr(){return pa().version}function le(){let e=y();if(e)try{let t=fa(ma(e,".tdk",_),"utf-8"),n=JSON.parse(t);if(n?.project?.name)return n.project.name}catch{}return"tdk-project"}function Ft(e){let t=le(),n=process.env.TDK_SERVICE_BASE_URL??`http://${t}.localhost${e?`:${e}`:""}`;try{let r=new URL(n.includes("://")?n:`http://${n}`),s=r.hostname,o=r.protocol==="https:"?"443":"80",i=r.port||(e?String(e):""),a=i===o?"":i;if(s==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(s))return{appBase:`${r.protocol}//${s}${a?`:${a}`:""}`,apiBase:`${r.protocol}//${s}${a?`:${a}`:""}`};let c=s.replace(/^(app|api)\./,"");return{appBase:`${r.protocol}//app.${c}${a?`:${a}`:""}`,apiBase:`${r.protocol}//api.${c}${a?`:${a}`:""}`}}catch{return{appBase:`http://app.${t}.localhost`,apiBase:`http://api.${t}.localhost`}}}function ha(e){return`${e.replace(/\/+$/,"")}/health`}function Lt(e){if(j(e.config?.appType)){let t=e.name.replace(/-api$/,"");return e.config?.apiPath??`/api/${t}`}return e.config?.basePath??`/${e.name}`}function Mt(e,t){return _r(e,t,n=>ha(n))}function $r(e,t){return _r(e,t,n=>n)}function _r(e,t,n){let{appBase:r,apiBase:s}=Ft(t);return e.filter(o=>o.config?.appType==="frontend"||j(o.config?.appType)).map(o=>{let i=j(o.config.appType)?s:r;return{name:o.name,appType:o.config.appType,url:`${i}${n(Lt(o))}`}})}async function ga(e,t){try{let n=await fetch(e.url,{method:"GET",redirect:"manual",signal:AbortSignal.timeout(t)});return{...e,ok:n.ok,status:n.status}}catch(n){let r=n instanceof Error&&n.name==="TimeoutError"?`no response within ${t}ms`:n instanceof Error?n.message:String(n);return{...e,ok:!1,error:r}}}async function Xe(e,t){return Promise.all(e.map(n=>ga(n,t)))}var Fr=60,Or=1e3,Nr=1e4,Cr=200,jr=64*1024,Ir=new Set([404,502,503,504]),ya=new Set(["ECONNREFUSED","ENOTFOUND","EAI_AGAIN","EHOSTUNREACH","ENETUNREACH"]),Sa=new Set(["GET","HEAD","OPTIONS"]);function X(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ba(e,t){if(Sa.has(t))return!0;if(!X(e))return!1;let n=X(e.cause)?e.cause:void 0,r=e.code??n?.code;return typeof r=="string"&&ya.has(r)}function Bt(e){if(!X(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((n,r)=>{let s=`smoke.steps[${r}]`;if(!X(n)){t.push(`${s}: must be an object`);return}let o=n.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`),n.expect!==void 0&&!(typeof n.expect=="number"&&Number.isInteger(n.expect)&&n.expect>=100&&n.expect<=599)&&t.push(`${s}.expect: must be an HTTP status between 100 and 599`),n.bodyContains!==void 0&&typeof n.bodyContains!="string"&&t.push(`${s}.bodyContains: must be a string`),n.save!==void 0&&(X(n.save)&&Object.values(n.save).every(a=>typeof a=="string"&&a.startsWith("$."))||t.push(`${s}.save: must map names to paths such as "$.id"`))}),t)}function Lr(e,t){let{appBase:n,apiBase:r}=Ft(t),s=[];for(let o of e){let i=o.config;if(!i?.smoke)continue;let a=i.appType,c=j(a)||a===J;if(!c&&a!=="frontend"||i.exposeViaProxy===!1)continue;let u=c?r:n,d=i.healthCheckPath||(c&&a!==J?"/health":void 0);s.push({name:o.name,baseUrl:`${u}${Lt(o).replace(/\/+$/,"")}`,...d?.startsWith("/")?{readyPath:d}:{},smoke:i.smoke})}return s}var Ta=10;function Mr(e,t={}){let n=t.timeoutSeconds??Ta;return e.flatMap(r=>{let s=r.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(r.smoke.timeoutSeconds??Fr,n);return[{name:r.name,baseUrl:r.baseUrl,smoke:{via:r.smoke.via,timeoutSeconds:o,steps:s}}]})}function xa(e,t){let n=t.replace(/^\$\.?/,"").match(/[^.[\]]+/g)??[],r=e;for(let s of n){if(r==null||s==="__proto__"||s==="constructor"||s==="prototype"||!Object.hasOwn(r,s))return;let o=Object.getOwnPropertyDescriptor(r,s);if(!o||!("value"in o))return;r=o.value}return r}function Ur(e,t){return e.replace(/\{\{(\w+)\}\}/g,(n,r)=>t[r]??n)}function Ut(e,t){return typeof e=="string"?Ur(e,t):Array.isArray(e)?e.map(n=>Ut(n,t)):X(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,Ut(r,t)])):e}function Qe(e){let t=e.replace(/\s+/g," ").trim();return t.length>Cr?`${t.slice(0,Cr)}...`:t}function Br(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"step"}function wa(e,t){let n=Br(t),r=(e.get(n)??0)+1;return e.set(n,r),r===1?n:`${n}-${r}`}function Ea(e,t,n,r,s){try{let o=de(e,Br(n.service),t);ka(o,{recursive:!0});let i=de(o,"latest.json"),a=de(o,"body.txt");return r===void 0?Ar(a,{force:!0}):Dr(a,r),Dr(i,`${JSON.stringify({...n,bodyPath:r===void 0?null:"body.txt"},null,2)}
15
+ `),s}import{existsSync as ra,lstatSync as sa}from"node:fs";import{isAbsolute as xr,normalize as ze,relative as oa,sep as wr}from"node:path";var xp=[`${N}/**`,".tdk/.tdk-out/**","Tiltfile","TILT_*.star",q,`${A} (create only)`,"shared-platform-engineering/docker-templates/**","services/platform/database-management/docker-compose.yml","product_autogenerated_resource_manifests/**","product_autogenerated_services_list/**"];function ia(e){let t=ze(e).split(wr).join("/");return xr(e)||t===".."||t.startsWith("../")?!1:t.split("/").includes(N)||t.startsWith(".tdk/.tdk-out/")||t==="shared-platform-engineering/docker-templates"||t.startsWith("shared-platform-engineering/docker-templates/")||t.startsWith("product_autogenerated_resource_manifests/")||t.startsWith("product_autogenerated_services_list/")?!0:t==="Tiltfile"||/^TILT_[^/]+\.star$/.test(t)||t===q||t===A||t==="services/platform/database-management/docker-compose.yml"}function oe(e,t){let n=xr(t)?ze(t):ze(`${e}/${t}`),r=oa(e,n).split(wr).join("/");if(!ia(r))throw new Error(`Refusing to write outside TDK's generated-file allowlist: ${r}`);let s=e;for(let o of r.split("/"))if(s=ze(`${s}/${o}`),ra(s)&&sa(s).isSymbolicLink())throw new Error(`Refusing to write through a symbolic link in generated path: ${r}`);return n}var _e=[C,"proxy"];import{existsSync as Kr,readFileSync as Gr}from"node:fs";import{copyFileSync as Rr,mkdirSync as ka,rmSync as Ar,writeFileSync as Dr}from"node:fs";import{join as de}from"node:path";function j(e){return e==="backend"||e==="mcp"}import{readFileSync as fa}from"node:fs";import{join as ma}from"node:path";import{existsSync as ca}from"node:fs";import{dirname as ua,join as la,resolve as vr}from"node:path";import{cwd as da}from"node:process";var Er={name:"tdk-cli-internal",private:!0,version:"1.3.168",description:"TDK CLI \u2014 start services on your machine.",keywords:["tdk","tilt","cli","local-dev","microservices"],homepage:"https://github.com/tdk-landscape/tdk-cli-core#readme",bugs:{url:"https://github.com/tdk-landscape/tdk-cli-core/issues"},repository:{type:"git",url:"git+https://github.com/tdk-landscape/tdk-cli-core.git",directory:"cli"},license:"MIT",author:"TDK Team",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",bin:{tdk:"bin/tdk.js","tdk-cli":"bin/tdk.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",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",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",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.1",vitest:"^5.0.0"},engines:{node:">=22.12.0"}};function y(e=da()){let t=vr(e),n=vr("/");for(;t!==n;){if(ca(la(t,".tdk",_)))return t;let r=ua(t);if(r===t)break;t=r}return null}var Ye=null;function pa(){if(Ye)return Ye;let e=Er;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return Ye={name:String(t.name??"@tdk-landscape/tdk-cli-core"),version:String(t.version??"0.0.0"),fullPackage:t},Ye}function Pr(){return pa().version}function le(){let e=y();if(e)try{let t=fa(ma(e,".tdk",_),"utf-8"),n=JSON.parse(t);if(n?.project?.name)return n.project.name}catch{}return"tdk-project"}function Ft(e){let t=le(),n=process.env.TDK_SERVICE_BASE_URL??`http://${t}.localhost${e?`:${e}`:""}`;try{let r=new URL(n.includes("://")?n:`http://${n}`),s=r.hostname,o=r.protocol==="https:"?"443":"80",i=r.port||(e?String(e):""),a=i===o?"":i;if(s==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(s))return{appBase:`${r.protocol}//${s}${a?`:${a}`:""}`,apiBase:`${r.protocol}//${s}${a?`:${a}`:""}`};let c=s.replace(/^(app|api)\./,"");return{appBase:`${r.protocol}//app.${c}${a?`:${a}`:""}`,apiBase:`${r.protocol}//api.${c}${a?`:${a}`:""}`}}catch{return{appBase:`http://app.${t}.localhost`,apiBase:`http://api.${t}.localhost`}}}function ha(e){return`${e.replace(/\/+$/,"")}/health`}function Lt(e){if(j(e.config?.appType)){let t=e.name.replace(/-api$/,"");return e.config?.apiPath??`/api/${t}`}return e.config?.basePath??`/${e.name}`}function Mt(e,t){return _r(e,t,n=>ha(n))}function $r(e,t){return _r(e,t,n=>n)}function _r(e,t,n){let{appBase:r,apiBase:s}=Ft(t);return e.filter(o=>o.config?.appType==="frontend"||j(o.config?.appType)).map(o=>{let i=j(o.config.appType)?s:r;return{name:o.name,appType:o.config.appType,url:`${i}${n(Lt(o))}`}})}async function ga(e,t){try{let n=await fetch(e.url,{method:"GET",redirect:"manual",signal:AbortSignal.timeout(t)});return{...e,ok:n.ok,status:n.status}}catch(n){let r=n instanceof Error&&n.name==="TimeoutError"?`no response within ${t}ms`:n instanceof Error?n.message:String(n);return{...e,ok:!1,error:r}}}async function Xe(e,t){return Promise.all(e.map(n=>ga(n,t)))}var Fr=60,Or=1e3,Nr=1e4,Cr=200,jr=64*1024,Ir=new Set([404,502,503,504]),ya=new Set(["ECONNREFUSED","ENOTFOUND","EAI_AGAIN","EHOSTUNREACH","ENETUNREACH"]),Sa=new Set(["GET","HEAD","OPTIONS"]);function X(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ba(e,t){if(Sa.has(t))return!0;if(!X(e))return!1;let n=X(e.cause)?e.cause:void 0,r=e.code??n?.code;return typeof r=="string"&&ya.has(r)}function Bt(e){if(!X(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((n,r)=>{let s=`smoke.steps[${r}]`;if(!X(n)){t.push(`${s}: must be an object`);return}let o=n.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`),n.expect!==void 0&&!(typeof n.expect=="number"&&Number.isInteger(n.expect)&&n.expect>=100&&n.expect<=599)&&t.push(`${s}.expect: must be an HTTP status between 100 and 599`),n.bodyContains!==void 0&&typeof n.bodyContains!="string"&&t.push(`${s}.bodyContains: must be a string`),n.save!==void 0&&(X(n.save)&&Object.values(n.save).every(a=>typeof a=="string"&&a.startsWith("$."))||t.push(`${s}.save: must map names to paths such as "$.id"`))}),t)}function Lr(e,t){let{appBase:n,apiBase:r}=Ft(t),s=[];for(let o of e){let i=o.config;if(!i?.smoke)continue;let a=i.appType,c=j(a)||a===J;if(!c&&a!=="frontend"||i.exposeViaProxy===!1)continue;let u=c?r:n,d=i.healthCheckPath||(c&&a!==J?"/health":void 0);s.push({name:o.name,baseUrl:`${u}${Lt(o).replace(/\/+$/,"")}`,...d?.startsWith("/")?{readyPath:d}:{},smoke:i.smoke})}return s}var Ta=10;function Mr(e,t={}){let n=t.timeoutSeconds??Ta;return e.flatMap(r=>{let s=r.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(r.smoke.timeoutSeconds??Fr,n);return[{name:r.name,baseUrl:r.baseUrl,smoke:{via:r.smoke.via,timeoutSeconds:o,steps:s}}]})}function xa(e,t){let n=t.replace(/^\$\.?/,"").match(/[^.[\]]+/g)??[],r=e;for(let s of n){if(r==null||s==="__proto__"||s==="constructor"||s==="prototype"||!Object.hasOwn(r,s))return;let o=Object.getOwnPropertyDescriptor(r,s);if(!o||!("value"in o))return;r=o.value}return r}function Ur(e,t){return e.replace(/\{\{(\w+)\}\}/g,(n,r)=>t[r]??n)}function Ut(e,t){return typeof e=="string"?Ur(e,t):Array.isArray(e)?e.map(n=>Ut(n,t)):X(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,Ut(r,t)])):e}function Qe(e){let t=e.replace(/\s+/g," ").trim();return t.length>Cr?`${t.slice(0,Cr)}...`:t}function Br(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"step"}function wa(e,t){let n=Br(t),r=(e.get(n)??0)+1;return e.set(n,r),r===1?n:`${n}-${r}`}function Ea(e,t,n,r,s){try{let o=de(e,Br(n.service),t);ka(o,{recursive:!0});let i=de(o,"latest.json"),a=de(o,"body.txt");return r===void 0?Ar(a,{force:!0}):Dr(a,r),Dr(i,`${JSON.stringify({...n,bodyPath:r===void 0?null:"body.txt"},null,2)}
16
16
  `),s&&(Rr(i,de(o,"last-success.json")),r===void 0?Ar(de(o,"last-success-body.txt"),{force:!0}):Rr(a,de(o,"last-success-body.txt"))),i}catch{return}}function va(e){let t=Buffer.from(e,"utf8");if(t.length<=jr)return{body:e,truncated:!1,bytes:t.length};let n=t.subarray(0,jr).toString("utf8").replace(/\uFFFD$/,"");return{body:n,truncated:!0,bytes:Buffer.byteLength(n,"utf8")}}async function Pa(e,t={}){let n=t.fetch??((d,l)=>fetch(d,l)),r=t.now??Date.now,s=t.sleep??(d=>new Promise(l=>setTimeout(l,d))),o=(e.smoke.timeoutSeconds??Fr)*1e3,i=r()+o,a={},c=Bt(e.smoke);if(c.length>0)return{name:e.name,ok:!1,failure:`${e.name}: invalid smoke block: ${c.join("; ")}`};if(e.readyPath){let d=`${e.baseUrl}${e.readyPath}`;for(;;){try{let l=await n(d,{method:"GET",signal:AbortSignal.timeout(Nr)});if(await l.text(),!Ir.has(l.status)&&l.status<500)break}catch{}if(r()>=i)break;await s(Or)}}i=r()+o;let u=new Map;for(let[d,l]of e.smoke.steps.entries()){let p=l.name??`step ${d+1}`,h=(l.method??"GET").toUpperCase(),f=`${e.baseUrl}${Ur(l.path,a)}`,b=l.expect??200,w=l.body!==void 0,$,U="",g,R;for(;;){g=void 0,R=void 0,$=void 0;let G=!1;try{let F=await n(f,{method:h,headers:w?{"content-type":"application/json"}:void 0,body:w?JSON.stringify(Ut(l.body,a)):void 0,signal:AbortSignal.timeout(Nr)});$=F.status,U=await F.text()}catch(F){G=ba(F,h),g=F instanceof Error?F.message:String(F);let re=X(F)?F.code??(X(F.cause)?F.cause.code:void 0):void 0;R=typeof re=="string"?re:void 0}if(!(g!==void 0&&G||$!==void 0&&$!==b&&Ir.has($))||r()>=i)break;await s(Or)}let ne=`${e.name}: ${p}: ${h} ${f}`,ue;if(t.recordDir){let G=$===void 0?void 0:va(U),Te=g===void 0&&$===b&&(l.bodyContains===void 0||U.includes(l.bodyContains));ue=Ea(t.recordDir,wa(u,p),{service:e.name,step:p,method:h,url:f,expectedStatus:b,status:$??null,...g===void 0?{}:{error:R??g},truncated:G?.truncated??!1,bodyBytes:G?.bytes??0},G?.body,Te)}let be=G=>({name:e.name,ok:!1,failure:G,recordPath:ue});if(g!==void 0)return be(`${ne} never answered (${g})`);if($!==b)return be(`${ne} returned ${$}, expected ${b}${U?`: ${Qe(U)}`:""}`);if(l.bodyContains!==void 0&&!U.includes(l.bodyContains))return be(`${ne} returned ${$} but the body does not contain "${l.bodyContains}": ${Qe(U)}`);if(l.save){let G;try{G=JSON.parse(U)}catch{return be(`${ne} returned a body that is not JSON, cannot save: ${Qe(U)}`)}for(let[Te,F]of Object.entries(l.save)){let re=xa(G,F);if(re==null||typeof re=="object")return be(`${ne} response has no ${F} to save as {{${Te}}}: ${Qe(U)}`);a[Te]=String(re)}}}return{name:e.name,ok:!0}}function Vp(e){return`Smoke check failed: ${e.failure}${e.recordPath?` (record: ${e.recordPath})`:""}`}async function Hr(e,t={}){return Promise.all(e.map(n=>Pa(n,t)))}var Re=1,zp="https://tdk-landscape.github.io/schema.service.json",$a={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"},_a=new Set(["$schema","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"]),Ra=[{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 Ze(e,t){let n=[],r=new Set;for(let{path:s,pattern:o,expected:i}of Ra){let a=e;for(let u of s)a=a&&typeof a=="object"&&!Array.isArray(a)?a[u]:void 0;if(a==null||a==="")continue;let c=`${t}.${s.join(".")}`;(typeof a!="string"||!o.test(a))&&r.add(c),typeof a!="string"?n.push(`${c}: expected a string`):o.test(a)||n.push(`${c}: must be ${i} (no spaces, line breaks or YAML syntax)`)}for(let[s,o]of Aa(e,t))r.has(s)||n.push(`${s}: ${o}`);return n}function Ht(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127||n===133||n===8232||n===8233)return!0}return!1}function Aa(e,t){let n=[],r=Object.entries(e).filter(([s])=>s!=="smoke").map(([s,o])=>[o,`${t}.${s}`]);for(let s of Object.keys(e))Ht(s)&&n.push([t,"a key contains a line break"]);for(;r.length>0;){let[s,o]=r.pop();if(typeof s=="string")Ht(s)&&n.push([o,"must not contain line breaks or control characters"]);else if(Array.isArray(s))for(let[i,a]of s.entries())r.push([a,`${o}[${i}]`]);else if(s&&typeof s=="object")for(let[i,a]of Object.entries(s))Ht(i)?n.push([o,"a key contains a line break"]):r.push([a,`${o}.${i}`])}return n.sort(([s],[o])=>s.localeCompare(o))}var Da=["apiPath","basePath"];function Kt(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e;return Da.filter(n=>n in t&&typeof t[n]!="string")}function Gt(e,t){if(!e||typeof e!="object"||Array.isArray(e))return{errors:[`${t}: expected a JSON object`],warnings:[]};let n=e,r=[];for(let a of["appName","appType","stack","schemaVersion"])a in n||r.push(`${t}.${a}: required field is missing`);for(let a of["appName","appType","stack"])a in n&&typeof n[a]!="string"&&r.push(`${t}.${a}: expected a string`);"schemaVersion"in n&&n.schemaVersion!==Re&&r.push(`${t}.schemaVersion: unsupported version ${String(n.schemaVersion)} (supported: ${Re})`);for(let a of Kt(n))r.push(`${t}.${a}: expected a string`);let s=n.dev,o=s&&typeof s=="object"&&!Array.isArray(s)?s.liveReload:void 0;if(o!==void 0&&typeof o!="boolean"&&r.push(`${t}.dev.liveReload: expected true or false`),r.push(...Ze(n,t)),"smoke"in n)for(let a of Bt(n.smoke))r.push(`${t}.${a}`);let i=Object.keys(n).flatMap(a=>{let c=$a[a];return c?[`${t}.${a}: ${c}`]:_a.has(a)?[]:[`${t}.${a}: unknown field is preserved`]});return o===!0&&n.language!=="go"&&i.push(`${t}.dev.liveReload: only applies to Go services (language "go"); it is ignored here`),{errors:r,warnings:i,manifest:n}}function Vr(e,t){if(!Kr(e))return[];try{let n=JSON.parse(Gr(e,"utf-8"));return!n||typeof n!="object"||Array.isArray(n)?[]:Ze(n,t)}catch{return[]}}function Wr(e,t){if(!Kr(e))return{errors:[`${t}: file is missing`],warnings:[]};try{let n=JSON.parse(Gr(e,"utf-8"));return Gt(n,t)}catch(n){let r=n instanceof Error?n.message:String(n);return{errors:[`${t}: invalid JSON (${r})`],warnings:[]}}}import{existsSync as pe,readdirSync as us,readFileSync as ls,statSync as Xt}from"node:fs";import{dirname as ec,join as Z}from"node:path";var Ae=class{data;options;constructor(t){this.data=new Map,this.options=t}has(t){let n=this.data.get(t);return n?Date.now()-n.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,n){this.data.set(t,{value:n,timestamp:Date.now()})}delete(t){this.data.delete(t)}clear(){this.data.clear()}keys(){let t=[];for(let n of this.data.keys())this.has(n)&&t.push(n);return t}size(){return this.keys().length}};function Jr(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}import{execFileSync as Ia,execSync as Fa}from"node:child_process";import{existsSync as qr}from"node:fs";import{delimiter as zr,extname as Yr,join as Xr}from"node:path";import{delimiter as Zp,extname as Oa}from"node:path";function De(){return process.platform==="win32"}function Na(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Ca(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function ja(e,t){let n=Na(e),r=Ca(t);if(!n||!r||n==="windows"&&r!=="amd64")return null;let s=`tdk-${n}-${r}`;return n==="windows"?`${s}.exe`:s}function ef(){return ja(process.platform,process.arch)}function tf(){return De()?"tdk.exe":"tdk"}function Vt(e,t=De()){return t?Oa(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function O(e){let t=process.env.PATH??process.env.Path??"",n=De(),r=Vt(e,n);if(n&&!Yr(e))for(let s of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let o=s.toLowerCase();o&&!r.includes(`${e}${o}`)&&r.push(`${e}${o}`)}for(let s of t.split(zr))if(s)for(let o of r){let i=Xr(s,o);if(qr(i))return i}return null}function Qr(e){let t=process.env.PATH??process.env.Path??"",n=De(),r=Vt(e,n);if(n&&!Yr(e))for(let i of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let a=i.toLowerCase();a&&!r.includes(`${e}${a}`)&&r.push(`${e}${a}`)}let s=[],o=new Set;for(let i of t.split(zr))if(i)for(let a of r){let c=Xr(i,a);if(!qr(c))continue;let u=n?c.toLowerCase():c;o.has(u)||(o.add(u),s.push(c))}return s}var Zr=1e4;function es(){let e=!1;if(process.platform==="win32")try{return Ia(O("docker")??"docker",["ps"],{stdio:"ignore",timeout:Zr,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return Fa(t,{stdio:"ignore",timeout:Zr}),"running"}catch(n){n.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function et(e,t){return e[t]??0}function La(e,t){let n=Array.from({length:t.length+1},(r,s)=>s);for(let r=1;r<=e.length;r++){let s=[r];for(let o=1;o<=t.length;o++){let i=e[r-1]===t[o-1]?0:1;s[o]=Math.min(et(s,o-1)+1,et(n,o)+1,et(n,o-1)+i)}n=s}return et(n,t.length)}function Ma(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length-1;n++)if(e[n]!==t[n]&&e[n]===t[n+1]&&e[n+1]===t[n]&&e.slice(0,n)===t.slice(0,n)&&e.slice(n+2)===t.slice(n+2))return!0;return!1}function ts(e,t){if(e.length<2||t.length===0||t.includes(e))return;let n=e.toLowerCase(),r,s=Number.POSITIVE_INFINITY;for(let o of t){if(o.length===0)continue;let i=o.toLowerCase(),a=Ma(n,i)?1:La(n,i),c=Math.max(1,Math.min(2,Math.floor(Math.max(n.length,i.length)/3)));a>c||(a<s||a===s&&(r===void 0||o<r))&&(r=o,s=a)}return r}import{spawn as Ua}from"node:child_process";import{join as Ba}from"node:path";function Ha(e,t=[],n={}){return new Promise((r,s)=>{let o=[e,...t];n.verbose&&console.log(`Executing: tilt ${o.join(" ")}`);let i=Ua(O("tilt")??"tilt",o,{stdio:n.inheritStdio?"inherit":"pipe",shell:!1,windowsHide:process.platform==="win32",timeout:n.timeoutMs}),a="",c="";n.inheritStdio||(i.stdout?.on("data",u=>{a+=u.toString()}),i.stderr?.on("data",u=>{c+=u.toString()})),i.on("close",u=>{r({exitCode:u??1,stdout:a,stderr:c})}),i.on("error",u=>{s(new Error(`Failed to spawn tilt: ${u.message}`))})})}async function ns(){try{return(await Ha("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function Ka(){let e=y();if(!e)throw Y.notInProject();return Ba(e,".tdk",".tdk-out","Tiltfile")}function rs(e){let t=Ka();e.push("-f",t)}function kf(e,t={}){let n=[];return rs(n),t.focusTargets&&t.focusTargets.length>0&&n.push("--",`--focus=${t.focusTargets.join(",")}`),n.push(...e),t.verbose&&!t.quiet&&n.push("--verbose"),t.watch&&n.push("--watch"),n}function yf(e={}){let t=[];return rs(t),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function ss(e){return e instanceof Error?e.message:String(e)}function Pf(e,t){if(process.env.TDK_VERBOSE){let n=t!==void 0?`: ${ss(t)}`:"";console.warn(m.gray(`${e}${n}`))}}var I=class extends Error{suggestions;exitCode;constructor(t,n=[],r=1){super(t),this.name="TdkError",this.suggestions=n,this.exitCode=r}display(){Wa(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}};function Wt(e,t,n=!1){let r=new Set;for(let s of e){let o=ts(s,t);o&&r.add(n?`Did you mean "${o}" for "${s}"?`:`Did you mean "${o}"?`)}return[...r]}var Y={tiltNotInstalled:()=>new I("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: ${Ct}`]),dockerNotAvailable:()=>new I("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: ${Ct}`]),dockerNotResponding:()=>new I("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 I(`Stack "${e}" not found`,[...Wt([e],t),"Run `tdk stacks` to see available stacks","Run `tdk stack` to assign resources to a stack"]),resourceNotFound:(e,t=[])=>new I(`Resource "${e}" not found`,[...Wt([e],t),"Run `tdk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let n=Wt(e,t,e.length>1);return new I(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,n,2)},directoryExists:e=>new I(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new I(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new I("Could not find project root (no .tdk/project.json found)",["Run this from within a TDK project","Run `tdk project --yes` to initialize a new project"])};function $f(){let e=y();return e||Y.notInProject().exit()}function Ga(e){e instanceof I&&e.exit(),console.error(m.red(`Error: ${ss(e)}`)),process.exit(1)}async function Va(e,t){try{return await e()}catch(n){return t?.verbose&&n instanceof Error&&n.stack&&console.error(m.gray(n.stack)),Ga(n)}}async function _f(e,t){let n=[],r=es();return r==="unresponsive"?n.push(Y.dockerNotResponding()):r==="missing"&&n.push(Y.dockerNotAvailable()),await ns()||n.push(Y.tiltNotInstalled()),n.length>0&&(console.error(m.red(`
17
17
  TDK can't start - missing prerequisites:
18
18
  `)),n.forEach((s,o)=>{o>0&&console.error(""),s.display()}),console.error(m.gray("\nRun `tdk doctor` for a full environment check.")),process.exit(1)),Va(e,t)}function Rf(e,t=1){console.error(m.red(`Error: ${e}`)),process.exit(t)}function Wa(e,t,n){if(console.error(m.red(`\u274C ${e}`)),t&&console.error(m.gray(` ${t}`)),n&&n.length>0){console.error(m.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 pR,$a as jR,A as iR,Aa as RR,Ab as JI,B as AR,Ba as NR,Bb as i2,C as rR,Ca as TR,Cb as LQ,D as Ni,Da as wR,Db as A2,E as mh,Ea as $i,Eb as r2,F as sR,Fa as bR,Fb as s2,G as uR,Ga as xR,Gb as u2,H as Is,Ha as UR,Hb as c2,I as cR,Ia as ys,Ib as KI,J as sm,Ja as gm,Jb as f2,K as MA,Ka as _R,Kb as d2,L as fR,La as MR,Lb as g2,M as HA,Ma as HR,Mb as m2,N as um,Na as OR,O as dR,Oa as GR,P as gR,Pa as kR,Pb as p2,Q as mR,Qa as eA,Qb as E2,R as Gf,Ra as zf,S as ul,Sa as LR,T as mn,Ta as zR,U as un,Ua as GI,V as $o,Va as Sr,W as kn,Wa as jf,X as bI,Xa as MQ,Y as Ua,Ya as Jf,Z as xI,Za as kI,_ as qn,_a as HQ,a as WD,aa as ER,ab as JR,b as S,ba as ph,bb as KR,c as DI,ca as cm,cb as YR,d as Wi,da as hR,db as FR,e as Hf,ea as Eh,eb as qR,f as Of,fa as kf,fb as VR,g as gh,ga as Lf,gb as XR,h as nR,ha as UI,hb as ZR,i as oR,ia as _I,ib as PR,j as ku,ja as _Q,jb as WR,k as rm,ka as CR,kb as LI,l as UA,la as fm,lb as zI,m as bQ,ma as cl,mb as Kf,n as RI,na as fl,nb as $R,o as _A,oa as at,ob as jI,p as aR,pa as BR,pb as e2,q as NI,qa as IR,qb as hh,r as Lu,ra as yR,rb as OQ,s as lR,sa as QR,sb as t2,t as xQ,ta as MI,tb as n2,u as zu,ua as dm,ub as GQ,v as Qn,va as SR,vb as kQ,w as Qr,wa as HI,wb as o2,x as TI,xa as OI,xb as a2,y as UQ,ya as vR,yb as l2,z as wI,za as DR,zb as Yf}from"./chunk-53KZOYBE.js";import{a as $D,c as eR,d as tR}from"./chunk-42IVF3YT.js";import{a as wQ,b as jo,c as $U,d as rt}from"./chunk-6EA4DGCY.js";var ZN=jo(oy=>{"use strict";var cH=Symbol.for("react.transitional.element"),fH=Symbol.for("react.fragment");function XN(n,i,A){var u=null;if(A!==void 0&&(u=""+A),i.key!==void 0&&(u=""+i.key),"key"in i){A={};for(var d in i)d!=="key"&&(A[d]=i[d])}else A=i;return i=A.ref,{$$typeof:cH,type:n,key:u,ref:i!==void 0?i:null,props:A}}oy.Fragment=fH;oy.jsx=XN;oy.jsxs=XN});var sT=jo(Tt=>{"use strict";var cS=Symbol.for("react.transitional.element"),dH=Symbol.for("react.portal"),gH=Symbol.for("react.fragment"),mH=Symbol.for("react.strict_mode"),pH=Symbol.for("react.profiler"),EH=Symbol.for("react.consumer"),hH=Symbol.for("react.context"),CH=Symbol.for("react.forward_ref"),BH=Symbol.for("react.suspense"),IH=Symbol.for("react.memo"),tT=Symbol.for("react.lazy"),yH=Symbol.for("react.activity"),QH=Symbol.for("react.view_transition"),PN=Symbol.iterator;function SH(n){return n===null||typeof n!="object"?null:(n=PN&&n[PN]||n["@@iterator"],typeof n=="function"?n:null)}var nT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},oT=Object.assign,aT={};function Qm(n,i,A){this.props=n,this.context=i,this.refs=aT,this.updater=A||nT}Qm.prototype.isReactComponent={};Qm.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")};Qm.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function lT(){}lT.prototype=Qm.prototype;function fS(n,i,A){this.props=n,this.context=i,this.refs=aT,this.updater=A||nT}var dS=fS.prototype=new lT;dS.constructor=fS;oT(dS,Qm.prototype);dS.isPureReactComponent=!0;var WN=Array.isArray;function uS(){}var Pn={H:null,A:null,T:null,S:null},iT=Object.prototype.hasOwnProperty;function gS(n,i,A){var u=A.ref;return{$$typeof:cS,type:n,key:i,ref:u!==void 0?u:null,props:A}}function vH(n,i){return gS(n.type,i,n.props)}function mS(n){return typeof n=="object"&&n!==null&&n.$$typeof===cS}function DH(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(A){return i[A]})}var $N=/\/+/g;function sS(n,i){return typeof n=="object"&&n!==null&&n.key!=null?DH(""+n.key):i.toString(36)}function RH(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(uS,uS):(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 ym(n,i,A,u,d){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var h=!1;if(n===null)h=!0;else switch(p){case"bigint":case"string":case"number":h=!0;break;case"object":switch(n.$$typeof){case cS:case dH:h=!0;break;case tT:return h=n._init,ym(h(n._payload),i,A,u,d)}}if(h)return d=d(n),h=u===""?"."+sS(n,0):u,WN(d)?(A="",h!=null&&(A=h.replace($N,"$&/")+"/"),ym(d,i,A,"",function(Q){return Q})):d!=null&&(mS(d)&&(d=vH(d,A+(d.key==null||n&&n.key===d.key?"":(""+d.key).replace($N,"$&/")+"/")+h)),i.push(d)),1;h=0;var B=u===""?".":u+":";if(WN(n))for(var I=0;I<n.length;I++)u=n[I],p=B+sS(u,I),h+=ym(u,i,A,p,d);else if(I=SH(n),typeof I=="function")for(n=I.call(n),I=0;!(u=n.next()).done;)u=u.value,p=B+sS(u,I++),h+=ym(u,i,A,p,d);else if(p==="object"){if(typeof n.then=="function")return ym(RH(n),i,A,u,d);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 h}function ay(n,i,A){if(n==null)return n;var u=[],d=0;return ym(n,u,"","",function(p){return i.call(A,p,d++)}),u}function NH(n){if(n._status===-1){var i=n._result,A=i();A.then(function(u){(n._status===0||n._status===-1)&&(n._status=1,n._result=u,A.status===void 0&&(A.status="fulfilled",A.value=u))},function(u){(n._status===0||n._status===-1)&&(n._status=2,n._result=u,A.status===void 0&&(A.status="rejected",A.reason=u))}),n._status===-1&&(n._status=0,n._result=A)}if(n._status===1)return n._result.default;throw n._result}var eT=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 AT(n){var i=Pn.T,A={};A.types=i!==null?i.types:null,Pn.T=A;try{var u=n(),d=Pn.S;d!==null&&d(A,u),typeof u=="object"&&u!==null&&typeof u.then=="function"&&u.then(uS,eT)}catch(p){eT(p)}finally{i!==null&&A.types!==null&&(i.types=A.types),Pn.T=i}}function rT(n){var i=Pn.T;if(i!==null){var A=i.types;A===null?i.types=[n]:A.indexOf(n)===-1&&A.push(n)}else AT(rT.bind(null,n))}var TH={map:ay,forEach:function(n,i,A){ay(n,function(){i.apply(this,arguments)},A)},count:function(n){var i=0;return ay(n,function(){i++}),i},toArray:function(n){return ay(n,function(i){return i})||[]},only:function(n){if(!mS(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Tt.Activity=yH;Tt.Children=TH;Tt.Component=Qm;Tt.Fragment=gH;Tt.Profiler=pH;Tt.PureComponent=fS;Tt.StrictMode=mH;Tt.Suspense=BH;Tt.ViewTransition=QH;Tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Pn;Tt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Pn.H.useMemoCache(n)}};Tt.addTransitionType=rT;Tt.cache=function(n){return function(){return n.apply(null,arguments)}};Tt.cacheSignal=function(){return null};Tt.cloneElement=function(n,i,A){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var u=oT({},n.props),d=n.key;if(i!=null)for(p in i.key!==void 0&&(d=""+i.key),i)!iT.call(i,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&i.ref===void 0||(u[p]=i[p]);var p=arguments.length-2;if(p===1)u.children=A;else if(1<p){for(var h=Array(p),B=0;B<p;B++)h[B]=arguments[B+2];u.children=h}return gS(n.type,d,u)};Tt.createContext=function(n){return n={$$typeof:hH,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:EH,_context:n},n};Tt.createElement=function(n,i,A){var u,d={},p=null;if(i!=null)for(u in i.key!==void 0&&(p=""+i.key),i)iT.call(i,u)&&u!=="key"&&u!=="__self"&&u!=="__source"&&(d[u]=i[u]);var h=arguments.length-2;if(h===1)d.children=A;else if(1<h){for(var B=Array(h),I=0;I<h;I++)B[I]=arguments[I+2];d.children=B}if(n&&n.defaultProps)for(u in h=n.defaultProps,h)d[u]===void 0&&(d[u]=h[u]);return gS(n,p,d)};Tt.createRef=function(){return{current:null}};Tt.forwardRef=function(n){return{$$typeof:CH,render:n}};Tt.isValidElement=mS;Tt.lazy=function(n){return{$$typeof:tT,_payload:{_status:-1,_result:n},_init:NH}};Tt.memo=function(n,i){return{$$typeof:IH,type:n,compare:i===void 0?null:i}};Tt.startTransition=AT;Tt.unstable_useCacheRefresh=function(){return Pn.H.useCacheRefresh()};Tt.use=function(n){return Pn.H.use(n)};Tt.useActionState=function(n,i,A){return Pn.H.useActionState(n,i,A)};Tt.useCallback=function(n,i){return Pn.H.useCallback(n,i)};Tt.useContext=function(n){return Pn.H.useContext(n)};Tt.useDebugValue=function(){};Tt.useDeferredValue=function(n,i){return Pn.H.useDeferredValue(n,i)};Tt.useEffect=function(n,i){return Pn.H.useEffect(n,i)};Tt.useEffectEvent=function(n){return Pn.H.useEffectEvent(n)};Tt.useId=function(){return Pn.H.useId()};Tt.useImperativeHandle=function(n,i,A){return Pn.H.useImperativeHandle(n,i,A)};Tt.useInsertionEffect=function(n,i){return Pn.H.useInsertionEffect(n,i)};Tt.useLayoutEffect=function(n,i){return Pn.H.useLayoutEffect(n,i)};Tt.useMemo=function(n,i){return Pn.H.useMemo(n,i)};Tt.useOptimistic=function(n,i){return Pn.H.useOptimistic(n,i)};Tt.useReducer=function(n,i,A){return Pn.H.useReducer(n,i,A)};Tt.useRef=function(n){return Pn.H.useRef(n)};Tt.useState=function(n){return Pn.H.useState(n)};Tt.useSyncExternalStore=function(n,i,A){return Pn.H.useSyncExternalStore(n,i,A)};Tt.useTransition=function(){return Pn.H.useTransition()};Tt.version="19.3.0"});var uT=jo((yt,ly)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(D,b){Object.defineProperty(u.prototype,D,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",b[0],b[1])}})}function i(D){return D===null||typeof D!="object"?null:(D=Mo&&D[Mo]||D["@@iterator"],typeof D=="function"?D:null)}function A(D,b){D=(D=D.constructor)&&(D.displayName||D.name)||"ReactClass";var $=D+"."+b;kt[$]||(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.",b,D),kt[$]=!0)}function u(D,b,$){this.props=D,this.context=b,this.refs=Ro,this.updater=$||zn}function d(){}function p(D,b,$){this.props=D,this.context=b,this.refs=Ro,this.updater=$||zn}function h(){}function B(D){return""+D}function I(D){try{B(D);var b=!1}catch{b=!0}if(b){b=console;var $=b.error,ce=typeof Symbol=="function"&&Symbol.toStringTag&&D[Symbol.toStringTag]||D.constructor.name||"Object";return $.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ce),B(D)}}function Q(D){if(D==null)return null;if(typeof D=="function")return D.$$typeof===jn?null:D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case ht:return"Fragment";case xe:return"Profiler";case ae:return"StrictMode";case Qt:return"Suspense";case Ye:return"SuspenseList";case tt:return"Activity";case Mt:return"ViewTransition"}if(typeof D=="object")switch(typeof D.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),D.$$typeof){case Jt:return"Portal";case Ke:return D.displayName||"Context";case ge:return(D._context.displayName||"Context")+".Consumer";case It:var b=D.render;return D=D.displayName,D||(D=b.displayName||b.name||"",D=D!==""?"ForwardRef("+D+")":"ForwardRef"),D;case De:return b=D.displayName||null,b!==null?b:Q(D.type)||"Memo";case Kt:b=D._payload,D=D._init;try{return Q(D(b))}catch{}}return null}function x(D){if(D===ht)return"<>";if(typeof D=="object"&&D!==null&&D.$$typeof===Kt)return"<...>";try{var b=Q(D);return b?"<"+b+">":"<...>"}catch{return"<...>"}}function M(){var D=Fe.A;return D===null?null:D.getOwner()}function T(){return Error("react-stack-top-frame")}function U(D){if(Jn.call(D,"key")){var b=Object.getOwnPropertyDescriptor(D,"key").get;if(b&&b.isReactWarning)return!1}return D.key!==void 0}function G(D,b){function $(){No||(No=!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)",b))}$.isReactWarning=!0,Object.defineProperty(D,"key",{get:$,configurable:!0})}function L(){var D=Q(this.type);return ct[D]||(ct[D]=!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.")),D=this.props.ref,D!==void 0?D:null}function j(D,b,$,ce,pe,Me){var Ue=$.ref;return D={$$typeof:_e,type:D,key:b,props:$,_owner:ce},(Ue!==void 0?Ue:null)!==null?Object.defineProperty(D,"ref",{enumerable:!1,get:L}):Object.defineProperty(D,"ref",{enumerable:!1,value:null}),D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(D,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(D,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:pe}),Object.defineProperty(D,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Me}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D}function Z(D,b){return b=j(D.type,b,D.props,D._owner,D._debugStack,D._debugTask),D._store&&(b._store.validated=D._store.validated),b}function Qe(D){ve(D)?D._store&&(D._store.validated=1):typeof D=="object"&&D!==null&&D.$$typeof===Kt&&(D._payload.status==="fulfilled"?ve(D._payload.value)&&D._payload.value._store&&(D._payload.value._store.validated=1):D._store&&(D._store.validated=1))}function ve(D){return typeof D=="object"&&D!==null&&D.$$typeof===_e}function Ge(D){var b={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function($){return b[$]})}function Oe(D,b){return typeof D=="object"&&D!==null&&D.key!=null?(I(D.key),Ge(""+D.key)):b.toString(36)}function je(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(h,h):(D.status="pending",D.then(function(b){D.status==="pending"&&(D.status="fulfilled",D.value=b)},function(b){D.status==="pending"&&(D.status="rejected",D.reason=b)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function Te(D,b,$,ce,pe){var Me=typeof D;(Me==="undefined"||Me==="boolean")&&(D=null);var Ue=!1;if(D===null)Ue=!0;else switch(Me){case"bigint":case"string":case"number":Ue=!0;break;case"object":switch(D.$$typeof){case _e:case Jt:Ue=!0;break;case Kt:return Ue=D._init,Te(Ue(D._payload),b,$,ce,pe)}}if(Ue){Ue=D,pe=pe(Ue);var lt=ce===""?"."+Oe(Ue,0):ce;return vt(pe)?($="",lt!=null&&($=lt.replace(Pt,"$&/")+"/"),Te(pe,b,$,"",function(Ca){return Ca})):pe!=null&&(ve(pe)&&(pe.key!=null&&(Ue&&Ue.key===pe.key||I(pe.key)),$=Z(pe,$+(pe.key==null||Ue&&Ue.key===pe.key?"":(""+pe.key).replace(Pt,"$&/")+"/")+lt),ce!==""&&Ue!=null&&ve(Ue)&&Ue.key==null&&Ue._store&&!Ue._store.validated&&($._store.validated=2),pe=$),b.push(pe)),1}if(Ue=0,lt=ce===""?".":ce+":",vt(D))for(var St=0;St<D.length;St++)ce=D[St],Me=lt+Oe(ce,St),Ue+=Te(ce,b,$,Me,pe);else if(St=i(D),typeof St=="function")for(St===D.entries&&(Ea||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Ea=!0),D=St.call(D),St=0;!(ce=D.next()).done;)ce=ce.value,Me=lt+Oe(ce,St++),Ue+=Te(ce,b,$,Me,pe);else if(Me==="object"){if(typeof D.then=="function")return Te(je(D),b,$,ce,pe);throw b=String(D),Error("Objects are not valid as a React child (found: "+(b==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.")}return Ue}function we(D,b,$){if(D==null)return D;var ce=[],pe=0;return Te(D,ce,"","",function(Me){return b.call($,Me,pe++)}),ce}function Ie(D){if(D._status===-1){var b=null,$=null,ce=D._ioInfo;ce!=null&&(ce.start=ce.end=performance.now(),ce.value=new Promise(function(Ue,lt){b=Ue,$=lt})),ce=D._result;var pe=ce();if(pe.then(function(Ue){if(D._status===0||D._status===-1){D._status=1,D._result=Ue;var lt=D._ioInfo;if(lt!=null){lt.end=performance.now();var St=Ue?.default;b(St),lt.value.status="fulfilled",lt.value.value=St}pe.status===void 0&&(pe.status="fulfilled",pe.value=Ue)}},function(Ue){if(D._status===0||D._status===-1){D._status=2,D._result=Ue;var lt=D._ioInfo;lt!=null&&(lt.end=performance.now(),lt.value.then(h,h),$(Ue),lt.value.status="rejected",lt.value.reason=Ue),pe.status===void 0&&(pe.status="rejected",pe.reason=Ue)}}),ce=D._ioInfo,ce!=null){var Me=pe.displayName;typeof Me=="string"&&(ce.name=Me)}D._status===-1&&(D._status=0,D._result=pe)}if(D._status===1)return ce=D._result,ce===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
3
+ import{$ as pR,$a as jR,A as iR,Aa as RR,Ab as JI,B as AR,Ba as NR,Bb as i2,C as rR,Ca as TR,Cb as LQ,D as Ni,Da as wR,Db as A2,E as mh,Ea as $i,Eb as r2,F as sR,Fa as bR,Fb as s2,G as uR,Ga as xR,Gb as u2,H as Is,Ha as UR,Hb as c2,I as cR,Ia as ys,Ib as KI,J as sm,Ja as gm,Jb as f2,K as MA,Ka as _R,Kb as d2,L as fR,La as MR,Lb as g2,M as HA,Ma as HR,Mb as m2,N as um,Na as OR,O as dR,Oa as GR,P as gR,Pa as kR,Pb as p2,Q as mR,Qa as eA,Qb as E2,R as Gf,Ra as zf,S as ul,Sa as LR,T as mn,Ta as zR,U as un,Ua as GI,V as $o,Va as Sr,W as kn,Wa as jf,X as bI,Xa as MQ,Y as Ua,Ya as Jf,Z as xI,Za as kI,_ as qn,_a as HQ,a as WD,aa as ER,ab as JR,b as S,ba as ph,bb as KR,c as DI,ca as cm,cb as YR,d as Wi,da as hR,db as FR,e as Hf,ea as Eh,eb as qR,f as Of,fa as kf,fb as VR,g as gh,ga as Lf,gb as XR,h as nR,ha as UI,hb as ZR,i as oR,ia as _I,ib as PR,j as ku,ja as _Q,jb as WR,k as rm,ka as CR,kb as LI,l as UA,la as fm,lb as zI,m as bQ,ma as cl,mb as Kf,n as RI,na as fl,nb as $R,o as _A,oa as at,ob as jI,p as aR,pa as BR,pb as e2,q as NI,qa as IR,qb as hh,r as Lu,ra as yR,rb as OQ,s as lR,sa as QR,sb as t2,t as xQ,ta as MI,tb as n2,u as zu,ua as dm,ub as GQ,v as Qn,va as SR,vb as kQ,w as Qr,wa as HI,wb as o2,x as TI,xa as OI,xb as a2,y as UQ,ya as vR,yb as l2,z as wI,za as DR,zb as Yf}from"./chunk-G6434AM5.js";import{a as $D,c as eR,d as tR}from"./chunk-42IVF3YT.js";import{a as wQ,b as jo,c as $U,d as rt}from"./chunk-6EA4DGCY.js";var ZN=jo(oy=>{"use strict";var cH=Symbol.for("react.transitional.element"),fH=Symbol.for("react.fragment");function XN(n,i,A){var u=null;if(A!==void 0&&(u=""+A),i.key!==void 0&&(u=""+i.key),"key"in i){A={};for(var d in i)d!=="key"&&(A[d]=i[d])}else A=i;return i=A.ref,{$$typeof:cH,type:n,key:u,ref:i!==void 0?i:null,props:A}}oy.Fragment=fH;oy.jsx=XN;oy.jsxs=XN});var sT=jo(Tt=>{"use strict";var cS=Symbol.for("react.transitional.element"),dH=Symbol.for("react.portal"),gH=Symbol.for("react.fragment"),mH=Symbol.for("react.strict_mode"),pH=Symbol.for("react.profiler"),EH=Symbol.for("react.consumer"),hH=Symbol.for("react.context"),CH=Symbol.for("react.forward_ref"),BH=Symbol.for("react.suspense"),IH=Symbol.for("react.memo"),tT=Symbol.for("react.lazy"),yH=Symbol.for("react.activity"),QH=Symbol.for("react.view_transition"),PN=Symbol.iterator;function SH(n){return n===null||typeof n!="object"?null:(n=PN&&n[PN]||n["@@iterator"],typeof n=="function"?n:null)}var nT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},oT=Object.assign,aT={};function Qm(n,i,A){this.props=n,this.context=i,this.refs=aT,this.updater=A||nT}Qm.prototype.isReactComponent={};Qm.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")};Qm.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function lT(){}lT.prototype=Qm.prototype;function fS(n,i,A){this.props=n,this.context=i,this.refs=aT,this.updater=A||nT}var dS=fS.prototype=new lT;dS.constructor=fS;oT(dS,Qm.prototype);dS.isPureReactComponent=!0;var WN=Array.isArray;function uS(){}var Pn={H:null,A:null,T:null,S:null},iT=Object.prototype.hasOwnProperty;function gS(n,i,A){var u=A.ref;return{$$typeof:cS,type:n,key:i,ref:u!==void 0?u:null,props:A}}function vH(n,i){return gS(n.type,i,n.props)}function mS(n){return typeof n=="object"&&n!==null&&n.$$typeof===cS}function DH(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(A){return i[A]})}var $N=/\/+/g;function sS(n,i){return typeof n=="object"&&n!==null&&n.key!=null?DH(""+n.key):i.toString(36)}function RH(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(uS,uS):(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 ym(n,i,A,u,d){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var h=!1;if(n===null)h=!0;else switch(p){case"bigint":case"string":case"number":h=!0;break;case"object":switch(n.$$typeof){case cS:case dH:h=!0;break;case tT:return h=n._init,ym(h(n._payload),i,A,u,d)}}if(h)return d=d(n),h=u===""?"."+sS(n,0):u,WN(d)?(A="",h!=null&&(A=h.replace($N,"$&/")+"/"),ym(d,i,A,"",function(Q){return Q})):d!=null&&(mS(d)&&(d=vH(d,A+(d.key==null||n&&n.key===d.key?"":(""+d.key).replace($N,"$&/")+"/")+h)),i.push(d)),1;h=0;var B=u===""?".":u+":";if(WN(n))for(var I=0;I<n.length;I++)u=n[I],p=B+sS(u,I),h+=ym(u,i,A,p,d);else if(I=SH(n),typeof I=="function")for(n=I.call(n),I=0;!(u=n.next()).done;)u=u.value,p=B+sS(u,I++),h+=ym(u,i,A,p,d);else if(p==="object"){if(typeof n.then=="function")return ym(RH(n),i,A,u,d);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 h}function ay(n,i,A){if(n==null)return n;var u=[],d=0;return ym(n,u,"","",function(p){return i.call(A,p,d++)}),u}function NH(n){if(n._status===-1){var i=n._result,A=i();A.then(function(u){(n._status===0||n._status===-1)&&(n._status=1,n._result=u,A.status===void 0&&(A.status="fulfilled",A.value=u))},function(u){(n._status===0||n._status===-1)&&(n._status=2,n._result=u,A.status===void 0&&(A.status="rejected",A.reason=u))}),n._status===-1&&(n._status=0,n._result=A)}if(n._status===1)return n._result.default;throw n._result}var eT=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 AT(n){var i=Pn.T,A={};A.types=i!==null?i.types:null,Pn.T=A;try{var u=n(),d=Pn.S;d!==null&&d(A,u),typeof u=="object"&&u!==null&&typeof u.then=="function"&&u.then(uS,eT)}catch(p){eT(p)}finally{i!==null&&A.types!==null&&(i.types=A.types),Pn.T=i}}function rT(n){var i=Pn.T;if(i!==null){var A=i.types;A===null?i.types=[n]:A.indexOf(n)===-1&&A.push(n)}else AT(rT.bind(null,n))}var TH={map:ay,forEach:function(n,i,A){ay(n,function(){i.apply(this,arguments)},A)},count:function(n){var i=0;return ay(n,function(){i++}),i},toArray:function(n){return ay(n,function(i){return i})||[]},only:function(n){if(!mS(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Tt.Activity=yH;Tt.Children=TH;Tt.Component=Qm;Tt.Fragment=gH;Tt.Profiler=pH;Tt.PureComponent=fS;Tt.StrictMode=mH;Tt.Suspense=BH;Tt.ViewTransition=QH;Tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Pn;Tt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Pn.H.useMemoCache(n)}};Tt.addTransitionType=rT;Tt.cache=function(n){return function(){return n.apply(null,arguments)}};Tt.cacheSignal=function(){return null};Tt.cloneElement=function(n,i,A){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var u=oT({},n.props),d=n.key;if(i!=null)for(p in i.key!==void 0&&(d=""+i.key),i)!iT.call(i,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&i.ref===void 0||(u[p]=i[p]);var p=arguments.length-2;if(p===1)u.children=A;else if(1<p){for(var h=Array(p),B=0;B<p;B++)h[B]=arguments[B+2];u.children=h}return gS(n.type,d,u)};Tt.createContext=function(n){return n={$$typeof:hH,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:EH,_context:n},n};Tt.createElement=function(n,i,A){var u,d={},p=null;if(i!=null)for(u in i.key!==void 0&&(p=""+i.key),i)iT.call(i,u)&&u!=="key"&&u!=="__self"&&u!=="__source"&&(d[u]=i[u]);var h=arguments.length-2;if(h===1)d.children=A;else if(1<h){for(var B=Array(h),I=0;I<h;I++)B[I]=arguments[I+2];d.children=B}if(n&&n.defaultProps)for(u in h=n.defaultProps,h)d[u]===void 0&&(d[u]=h[u]);return gS(n,p,d)};Tt.createRef=function(){return{current:null}};Tt.forwardRef=function(n){return{$$typeof:CH,render:n}};Tt.isValidElement=mS;Tt.lazy=function(n){return{$$typeof:tT,_payload:{_status:-1,_result:n},_init:NH}};Tt.memo=function(n,i){return{$$typeof:IH,type:n,compare:i===void 0?null:i}};Tt.startTransition=AT;Tt.unstable_useCacheRefresh=function(){return Pn.H.useCacheRefresh()};Tt.use=function(n){return Pn.H.use(n)};Tt.useActionState=function(n,i,A){return Pn.H.useActionState(n,i,A)};Tt.useCallback=function(n,i){return Pn.H.useCallback(n,i)};Tt.useContext=function(n){return Pn.H.useContext(n)};Tt.useDebugValue=function(){};Tt.useDeferredValue=function(n,i){return Pn.H.useDeferredValue(n,i)};Tt.useEffect=function(n,i){return Pn.H.useEffect(n,i)};Tt.useEffectEvent=function(n){return Pn.H.useEffectEvent(n)};Tt.useId=function(){return Pn.H.useId()};Tt.useImperativeHandle=function(n,i,A){return Pn.H.useImperativeHandle(n,i,A)};Tt.useInsertionEffect=function(n,i){return Pn.H.useInsertionEffect(n,i)};Tt.useLayoutEffect=function(n,i){return Pn.H.useLayoutEffect(n,i)};Tt.useMemo=function(n,i){return Pn.H.useMemo(n,i)};Tt.useOptimistic=function(n,i){return Pn.H.useOptimistic(n,i)};Tt.useReducer=function(n,i,A){return Pn.H.useReducer(n,i,A)};Tt.useRef=function(n){return Pn.H.useRef(n)};Tt.useState=function(n){return Pn.H.useState(n)};Tt.useSyncExternalStore=function(n,i,A){return Pn.H.useSyncExternalStore(n,i,A)};Tt.useTransition=function(){return Pn.H.useTransition()};Tt.version="19.3.0"});var uT=jo((yt,ly)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(D,b){Object.defineProperty(u.prototype,D,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",b[0],b[1])}})}function i(D){return D===null||typeof D!="object"?null:(D=Mo&&D[Mo]||D["@@iterator"],typeof D=="function"?D:null)}function A(D,b){D=(D=D.constructor)&&(D.displayName||D.name)||"ReactClass";var $=D+"."+b;kt[$]||(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.",b,D),kt[$]=!0)}function u(D,b,$){this.props=D,this.context=b,this.refs=Ro,this.updater=$||zn}function d(){}function p(D,b,$){this.props=D,this.context=b,this.refs=Ro,this.updater=$||zn}function h(){}function B(D){return""+D}function I(D){try{B(D);var b=!1}catch{b=!0}if(b){b=console;var $=b.error,ce=typeof Symbol=="function"&&Symbol.toStringTag&&D[Symbol.toStringTag]||D.constructor.name||"Object";return $.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ce),B(D)}}function Q(D){if(D==null)return null;if(typeof D=="function")return D.$$typeof===jn?null:D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case ht:return"Fragment";case xe:return"Profiler";case ae:return"StrictMode";case Qt:return"Suspense";case Ye:return"SuspenseList";case tt:return"Activity";case Mt:return"ViewTransition"}if(typeof D=="object")switch(typeof D.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),D.$$typeof){case Jt:return"Portal";case Ke:return D.displayName||"Context";case ge:return(D._context.displayName||"Context")+".Consumer";case It:var b=D.render;return D=D.displayName,D||(D=b.displayName||b.name||"",D=D!==""?"ForwardRef("+D+")":"ForwardRef"),D;case De:return b=D.displayName||null,b!==null?b:Q(D.type)||"Memo";case Kt:b=D._payload,D=D._init;try{return Q(D(b))}catch{}}return null}function x(D){if(D===ht)return"<>";if(typeof D=="object"&&D!==null&&D.$$typeof===Kt)return"<...>";try{var b=Q(D);return b?"<"+b+">":"<...>"}catch{return"<...>"}}function M(){var D=Fe.A;return D===null?null:D.getOwner()}function T(){return Error("react-stack-top-frame")}function U(D){if(Jn.call(D,"key")){var b=Object.getOwnPropertyDescriptor(D,"key").get;if(b&&b.isReactWarning)return!1}return D.key!==void 0}function G(D,b){function $(){No||(No=!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)",b))}$.isReactWarning=!0,Object.defineProperty(D,"key",{get:$,configurable:!0})}function L(){var D=Q(this.type);return ct[D]||(ct[D]=!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.")),D=this.props.ref,D!==void 0?D:null}function j(D,b,$,ce,pe,Me){var Ue=$.ref;return D={$$typeof:_e,type:D,key:b,props:$,_owner:ce},(Ue!==void 0?Ue:null)!==null?Object.defineProperty(D,"ref",{enumerable:!1,get:L}):Object.defineProperty(D,"ref",{enumerable:!1,value:null}),D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(D,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(D,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:pe}),Object.defineProperty(D,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Me}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D}function Z(D,b){return b=j(D.type,b,D.props,D._owner,D._debugStack,D._debugTask),D._store&&(b._store.validated=D._store.validated),b}function Qe(D){ve(D)?D._store&&(D._store.validated=1):typeof D=="object"&&D!==null&&D.$$typeof===Kt&&(D._payload.status==="fulfilled"?ve(D._payload.value)&&D._payload.value._store&&(D._payload.value._store.validated=1):D._store&&(D._store.validated=1))}function ve(D){return typeof D=="object"&&D!==null&&D.$$typeof===_e}function Ge(D){var b={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function($){return b[$]})}function Oe(D,b){return typeof D=="object"&&D!==null&&D.key!=null?(I(D.key),Ge(""+D.key)):b.toString(36)}function je(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(h,h):(D.status="pending",D.then(function(b){D.status==="pending"&&(D.status="fulfilled",D.value=b)},function(b){D.status==="pending"&&(D.status="rejected",D.reason=b)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function Te(D,b,$,ce,pe){var Me=typeof D;(Me==="undefined"||Me==="boolean")&&(D=null);var Ue=!1;if(D===null)Ue=!0;else switch(Me){case"bigint":case"string":case"number":Ue=!0;break;case"object":switch(D.$$typeof){case _e:case Jt:Ue=!0;break;case Kt:return Ue=D._init,Te(Ue(D._payload),b,$,ce,pe)}}if(Ue){Ue=D,pe=pe(Ue);var lt=ce===""?"."+Oe(Ue,0):ce;return vt(pe)?($="",lt!=null&&($=lt.replace(Pt,"$&/")+"/"),Te(pe,b,$,"",function(Ca){return Ca})):pe!=null&&(ve(pe)&&(pe.key!=null&&(Ue&&Ue.key===pe.key||I(pe.key)),$=Z(pe,$+(pe.key==null||Ue&&Ue.key===pe.key?"":(""+pe.key).replace(Pt,"$&/")+"/")+lt),ce!==""&&Ue!=null&&ve(Ue)&&Ue.key==null&&Ue._store&&!Ue._store.validated&&($._store.validated=2),pe=$),b.push(pe)),1}if(Ue=0,lt=ce===""?".":ce+":",vt(D))for(var St=0;St<D.length;St++)ce=D[St],Me=lt+Oe(ce,St),Ue+=Te(ce,b,$,Me,pe);else if(St=i(D),typeof St=="function")for(St===D.entries&&(Ea||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Ea=!0),D=St.call(D),St=0;!(ce=D.next()).done;)ce=ce.value,Me=lt+Oe(ce,St++),Ue+=Te(ce,b,$,Me,pe);else if(Me==="object"){if(typeof D.then=="function")return Te(je(D),b,$,ce,pe);throw b=String(D),Error("Objects are not valid as a React child (found: "+(b==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.")}return Ue}function we(D,b,$){if(D==null)return D;var ce=[],pe=0;return Te(D,ce,"","",function(Me){return b.call($,Me,pe++)}),ce}function Ie(D){if(D._status===-1){var b=null,$=null,ce=D._ioInfo;ce!=null&&(ce.start=ce.end=performance.now(),ce.value=new Promise(function(Ue,lt){b=Ue,$=lt})),ce=D._result;var pe=ce();if(pe.then(function(Ue){if(D._status===0||D._status===-1){D._status=1,D._result=Ue;var lt=D._ioInfo;if(lt!=null){lt.end=performance.now();var St=Ue?.default;b(St),lt.value.status="fulfilled",lt.value.value=St}pe.status===void 0&&(pe.status="fulfilled",pe.value=Ue)}},function(Ue){if(D._status===0||D._status===-1){D._status=2,D._result=Ue;var lt=D._ioInfo;lt!=null&&(lt.end=performance.now(),lt.value.then(h,h),$(Ue),lt.value.status="rejected",lt.value.reason=Ue),pe.status===void 0&&(pe.status="rejected",pe.reason=Ue)}}),ce=D._ioInfo,ce!=null){var Me=pe.displayName;typeof Me=="string"&&(ce.name=Me)}D._status===-1&&(D._status=0,D._result=pe)}if(D._status===1)return ce=D._result,ce===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'))
@@ -562,7 +562,7 @@ Available templates:`));for(let[p,h]of Object.entries(PI))console.log(` ${S.cya
562
562
  `,0),at(`Source: ${A.bundledPath?"bundled TDK example":A.repo}`,0),at(`Destination: ${d}
563
563
  `,0);try{if(A.bundledPath){let p=WI(BM(IM(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");pM(WI(p,A.bundledPath),d,{recursive:!0});let h=CM(d).replace(/-/g,"_");for(let B 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 I=Im(d,B),Q=XQ(I,"utf-8");hM(I,Q.replaceAll("tdk_example",h))}}else mM("git",["clone",A.repo,d],{stdio:"inherit"})}catch{Ua(A.bundledPath?"Bundled example copy failed. Reinstall the TDK CLI package and try again.":"git clone failed. Check you have git installed and network access.")}console.log(S.green(`
564
564
  \u2705 Cloned "${n}" into ${u}/`)),at(`
565
- Next steps:`,0),at(`1. cd ${u}`),at("2. tdk doctor # check Docker/Tilt are ready"),at("3. tdk up # start the stack")}var Qh={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:SM()},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:{}},lN=new yM("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(PI).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("--yes","Non-interactive mode (use defaults)").option("--config-file <path>","Load project config from existing JSON file").action(async(n,i)=>{let{assertMachineReadyOrExit:A}=await import("./cold-preflight-SOZW5ILE.js");if(await A(),n){await kn(async()=>vM(n,i.path));return}await kn(async()=>{let u=Qn();u||(u=oN(),fl(`\u{1F680} Initializing new TDK project...
565
+ Next steps:`,0),at(`1. cd ${u}`),at("2. tdk doctor # check Docker/Tilt are ready"),at("3. tdk up # start the stack")}var Qh={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:SM()},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:{}},lN=new yM("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(PI).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("--yes","Non-interactive mode (use defaults)").option("--config-file <path>","Load project config from existing JSON file").action(async(n,i)=>{let{assertMachineReadyOrExit:A}=await import("./cold-preflight-AXO5EV6V.js");if(await A(),n){await kn(async()=>vM(n,i.path));return}await kn(async()=>{let u=Qn();u||(u=oN(),fl(`\u{1F680} Initializing new TDK project...
566
566
  `),at(`Location: ${u}
567
567
  `,0));let d=Im(u,".tdk"),p=Im(d,ku);if(i.check){let U=UA.every(L=>ju(Im(u,".tdk",".tdk-out",L))),G=ju(p);if(U&&G){let L=eA(u);cl("Project configuration is valid"),at(`Project: ${L.project.name}`,3),at(`Phases: ${Object.keys(L.phases).join(", ")}`,3),process.exit(0)}else{if(console.log(S.yellow("\u26A0\uFE0F Project configuration incomplete:")),G||at(".tdk/project.json (not found)",3),!U)for(let L of UA.filter(j=>!ju(Im(u,".tdk/.tdk-out",j))))at(`.tdk/.tdk-out/${L} (not found)`,3);at("Run `tdk project` to create them."),process.exit(1)}}Lf("Project Configuration"),at(`Project root: ${u}
568
568
  `,0),ju(d)||(lR(d),cl("Created: .tdk/ directory"));let h=ju(p);if(h&&!i.force){cl(".tdk/project.json exists");let U=JSON.parse(XQ(p,"utf-8")),G=eA(u),L=ZQ(u),j=PQ(G,L);if((j.length>0||!U.phases)&&Lu(p,G),j.length>0&&at(`Auto-enabled discovered service stacks: ${j.join(", ")}`,0),fl(`
@@ -1373,7 +1373,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
1373
1373
  `)}`,B="Upgrade tdk to a version that supports these files. Changing schemaVersion by hand is not a fix";i.onInvalid?.(`${h}
1374
1374
  Fix: ${B}`),console.error(S.red(`\u2717 ${h}`)),console.error(S.gray(` Fix: ${B}`)),A(1)}import{execFileSync as Ek}from"node:child_process";import{realpathSync as hk}from"node:fs";import{resolve as Ck}from"node:path";var Bk=(n,i)=>Ek(n,i,{encoding:"utf-8",stdio:"pipe",timeout:5e3,windowsHide:!0});function Ik(n,i=process.platform,A=Bk){if(i==="win32")return null;try{let u=A("lsof",["-nP",`-iTCP:${n}`,"-sTCP:LISTEN","-t"]).split(/\r?\n/).map(d=>d.trim()).filter(Boolean);for(let d of u){let p=A("ps",["-p",d,"-o","command="]).trim(),[h]=YR(`${d} ${p}`);if(h)return h}}catch{}return null}function AU(n){try{return hk(n)}catch{return Ck(n)}}function yk(n,i){return n!==null&&AU(n.root)!==AU(i)}async function rU(n,i,A,u=Ik){let d={running:[],foreign:[]};for(let p of n){if(!await A(p))continue;let h=u(p);h&&yk(h,i)?d.foreign.push({port:p,root:h.root}):d.running.push(p)}return d}import{execFileSync as Qk}from"node:child_process";var sU=(n,i)=>Qk(n,i,{encoding:"utf-8",stdio:"pipe",windowsHide:!0});function Sk(n,i=process.platform,A=sU){if(!Number.isInteger(n)||n<1||n>65535)return[];if(i==="win32"){let d=`$port=${n}; Get-NetTCPConnection -LocalPort $port -State Listen -ErrorAction SilentlyContinue | ForEach-Object { $p=Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue; if ($p -and $p.ProcessName -eq 'tilt') { $_.OwningProcess } } | Sort-Object -Unique`;try{return A("powershell.exe",["-NoProfile","-Command",d]).split(/\s+/).map(Number).filter(p=>Number.isInteger(p)&&p>0)}catch{throw new Error(`Unable to inspect Tilt listeners on port ${n} with PowerShell.`)}}let u;try{u=A("lsof",["-nP","-t",`-iTCP:${n}`,"-sTCP:LISTEN"]).split(/\s+/).map(Number).filter(d=>Number.isInteger(d)&&d>0)}catch(d){let p=d,h=p.stderr?.toString().trim();if(p?.status===1&&!h)return[];throw new Error(`Unable to inspect listeners on port ${n}. Install lsof or resolve the lsof error before using --force.`,{cause:p})}return u.filter(d=>{try{return A("ps",["-p",String(d),"-o","comm="]).trim().split(/[\\/]/).at(-1)==="tilt"}catch(p){throw new Error(`Unable to identify the process listening on port ${n}.`,{cause:p})}})}function u0(n,i=process.platform,A=sU){let u=Sk(n,i,A);for(let d of u)i==="win32"?A("taskkill.exe",["/PID",String(d),"/F"]):A("kill",["-TERM",String(d)]);return u}function uU(n,i){let A=new Set(i.map(u=>u.name));return n.filter(u=>!A.has(u))}function cU(n,i){let A=new Map(i.map(p=>[p.name,p])),u=new Set,d=p=>{if(!(u.has(p)||!A.has(p))){u.add(p);for(let h of A.get(p)?.config?.dependsOn??[])d(h)}};for(let p of n)d(p);return{selected:i.filter(p=>u.has(p.name)),dependencies:i.map(p=>p.name).filter(p=>u.has(p)&&!n.includes(p))}}function dU(n,i=[]){return["TDK is up.",`Tilt UI: http://localhost:${n}`,"App URLs:",...i.length>0?i.slice(0,5).map(A=>` ${A}`):[" run: tdk networks"],"Stop: tdk down"]}function Nk(n,i){return n!=="win32"||i==="1"?null:"Landscape startup needs Ubuntu on WSL2. Native Windows is inspect-only."}async function Tk(n=VR(),i=wk){return n.kind==="webcontainer"?FR:XR(n.kind)&&!await i()?qR:null}async function wk(){let{execFile:n}=await import("node:child_process");return new Promise(i=>{n("docker",["ps"],{timeout:1e4},A=>i(!A))})}var bk=2;function xk(n){let i;try{({handEdited:i}=GI(n))}catch(A){if(A instanceof kR)return null;throw A}return i.length===0?null:["Generated files were edited by hand and no longer match service.json:",...i.map(A=>` ${A}`),"Run `tdk config regenerate` to discard the edits, or bypass with `tdk up --ignore-drift`."]}function Uk(n,i,A=process.exit){if(i.ignoreDrift){console.warn(S.yellow("Warning: --ignore-drift set; generated files were not checked."));return}let u=xk(n);if(u){i.onDrift?.(u.join(`
1375
1375
  `));for(let d of u)console.error(S.red(d));A(bk)}}function _k(n,i,A=Qr(),u=process.exit){if(i.ignoreVersion){console.warn(S.yellow("Warning: --ignore-version set; minTdkVersion was not checked."));return}let d=g2(n,A);d.status==="none"||d.status==="ok"||(i.onFail?.(`${d.message}
1376
- ${d.fix}`),console.error(S.red(d.message)),console.error(S.red(d.fix)),u(1))}function Mk(n,i=3e4){return new Promise(A=>{let u=Date.now()+i,d=()=>{let p=Dk({host:"127.0.0.1",port:n}),h=!1,B=I=>{h||(h=!0,p.destroy(),I||Date.now()>=u?A(I):setTimeout(d,250))};p.once("connect",()=>B(!0)),p.once("error",()=>B(!1))};d()})}var gU=new Rk("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 tdk 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?ZI("UP_FAILED","tdk up"):void 0;i.json&&(i.quiet=!0);let u=rS(process.env.TILT_PORT);u.ok||(A?.({ok:!1},[{code:"INVALID_TILT_PORT",message:u.message}]),Ua(u.message));let d=u.port,p=Qn();p&&_k(p,{ignoreVersion:i.ignoreVersion,onFail:x=>A?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:x}])});let h=i.dryRun?null:await Tk();h&&(A?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:h}]),Ua(h));let B=Nk(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Ua(B);let I=Qn();if(I&&iU(I,{onInvalid:x=>A?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:x}])}),!i.dryRun){let{assertMachineReadyOrExit:x}=await import("./cold-preflight-SOZW5ILE.js");await x()}let Q=async()=>{let x=i.dryRun?$o():Qn(),M=x??process.cwd(),T=bR(),U,G=[];if((!i.only||n)&&(U=ys(T),G=U.map(ge=>ge.name)),i.only){if(n&&!gm(n)){let It=un.stackNotFound(n,G);A?.({ok:!1},[VI(It).error]),It.exit()}let ge=n?T.filter(It=>It.stack===n):T,Ke=uU(i.only,ge);if(Ke.length>0){let It=ge.map(Ye=>Ye.name),Qt=un.unknownServices(Ke,It);A?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:Qt.message,...Qt.suggestions.length>0?{suggestions:Qt.suggestions}:{}}]),Qt.exit()}}x&&Uk(x,{ignoreDrift:i.ignoreDrift,onDrift:ge=>A?.({ok:!1},[{code:"DRIFT_DETECTED",message:ge}])}),x&&d2(x,{onInvalid:ge=>A?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:ge}])}),x&&!A&&!i.quiet&&f2(x);let L=await KI(M,{inspectDocker:!i.dryRun});if(!i.dryRun){if(x){let It=hh(M);It.length>0&&!i.quiet&&console.log(S.gray(`Added ${It.join(", ")} to .env (generated; existing values unchanged)`))}x&&!vk(fU(M,".tdk",".tdk-out","Tiltfile"))&&(i.quiet||console.log(S.gray("No generated Tiltfile yet; generating .tdk/.tdk-out/ ...")),await zf(M,{quiet:i.quiet}));let ge=zR(M);ge.length>0&&i.verbose&&!i.quiet&&console.log(S.gray(`Refreshed runtime assets: ${ge.join(", ")}`));let Ke=aN(M);Ke.length>0&&!i.quiet&&console.log(S.gray(`Added ${Ke.join(", ")} to the pre_alpha phase in .tdk/project.json`))}let j,Z,Qe=[];if(n){if(j=T.filter(ge=>ge.stack===n),j.length===0){let ge=un.stackNotFound(n,G);A?.({ok:!1},[VI(ge).error]),ge.exit()}Qe=j.map(ge=>ge.name),Z=`stack "${n}"`}else{j=T;let ge=U??ys(T);Z=`all stacks (${qn(ge.length,"stack")}, ${qn(j.length,"service")})`}let ve=[];if(i.only){let ge=cU(i.only,$i());j=ge.selected,ve=ge.dependencies,Qe=j.map(Ke=>Ke.name),Z=`${qn(i.only.length,"requested service")}${ve.length>0?` plus ${ve.join(", ")}`:""}`}i.verbose&&!i.quiet&&console.log(S.gray(`Found ${qn(j.length,"service")} in ${Z}`));let Ge=j.map(ge=>ge.name);if(!i.quiet){console.log(S.blue(`${i.dryRun?"Would start":"Starting"} ${qn(Ge.length,"service")} from ${Z}...`));for(let Ye of Ge)console.log(S.gray(` - ${Ye}`));let{appBase:ge,apiBase:Ke}=TI(L.ingressHttp),It=j.filter(Ye=>Ye.config?.appType==="frontend"),Qt=j.filter(Ye=>zu(Ye.config?.appType));if(It.length>0){console.log(S.blue(`
1376
+ ${d.fix}`),console.error(S.red(d.message)),console.error(S.red(d.fix)),u(1))}function Mk(n,i=3e4){return new Promise(A=>{let u=Date.now()+i,d=()=>{let p=Dk({host:"127.0.0.1",port:n}),h=!1,B=I=>{h||(h=!0,p.destroy(),I||Date.now()>=u?A(I):setTimeout(d,250))};p.once("connect",()=>B(!0)),p.once("error",()=>B(!1))};d()})}var gU=new Rk("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 tdk 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?ZI("UP_FAILED","tdk up"):void 0;i.json&&(i.quiet=!0);let u=rS(process.env.TILT_PORT);u.ok||(A?.({ok:!1},[{code:"INVALID_TILT_PORT",message:u.message}]),Ua(u.message));let d=u.port,p=Qn();p&&_k(p,{ignoreVersion:i.ignoreVersion,onFail:x=>A?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:x}])});let h=i.dryRun?null:await Tk();h&&(A?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:h}]),Ua(h));let B=Nk(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Ua(B);let I=Qn();if(I&&iU(I,{onInvalid:x=>A?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:x}])}),!i.dryRun){let{assertMachineReadyOrExit:x}=await import("./cold-preflight-AXO5EV6V.js");await x()}let Q=async()=>{let x=i.dryRun?$o():Qn(),M=x??process.cwd(),T=bR(),U,G=[];if((!i.only||n)&&(U=ys(T),G=U.map(ge=>ge.name)),i.only){if(n&&!gm(n)){let It=un.stackNotFound(n,G);A?.({ok:!1},[VI(It).error]),It.exit()}let ge=n?T.filter(It=>It.stack===n):T,Ke=uU(i.only,ge);if(Ke.length>0){let It=ge.map(Ye=>Ye.name),Qt=un.unknownServices(Ke,It);A?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:Qt.message,...Qt.suggestions.length>0?{suggestions:Qt.suggestions}:{}}]),Qt.exit()}}x&&Uk(x,{ignoreDrift:i.ignoreDrift,onDrift:ge=>A?.({ok:!1},[{code:"DRIFT_DETECTED",message:ge}])}),x&&d2(x,{onInvalid:ge=>A?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:ge}])}),x&&!A&&!i.quiet&&f2(x);let L=await KI(M,{inspectDocker:!i.dryRun});if(!i.dryRun){if(x){let It=hh(M);It.length>0&&!i.quiet&&console.log(S.gray(`Added ${It.join(", ")} to .env (generated; existing values unchanged)`))}x&&!vk(fU(M,".tdk",".tdk-out","Tiltfile"))&&(i.quiet||console.log(S.gray("No generated Tiltfile yet; generating .tdk/.tdk-out/ ...")),await zf(M,{quiet:i.quiet}));let ge=zR(M);ge.length>0&&i.verbose&&!i.quiet&&console.log(S.gray(`Refreshed runtime assets: ${ge.join(", ")}`));let Ke=aN(M);Ke.length>0&&!i.quiet&&console.log(S.gray(`Added ${Ke.join(", ")} to the pre_alpha phase in .tdk/project.json`))}let j,Z,Qe=[];if(n){if(j=T.filter(ge=>ge.stack===n),j.length===0){let ge=un.stackNotFound(n,G);A?.({ok:!1},[VI(ge).error]),ge.exit()}Qe=j.map(ge=>ge.name),Z=`stack "${n}"`}else{j=T;let ge=U??ys(T);Z=`all stacks (${qn(ge.length,"stack")}, ${qn(j.length,"service")})`}let ve=[];if(i.only){let ge=cU(i.only,$i());j=ge.selected,ve=ge.dependencies,Qe=j.map(Ke=>Ke.name),Z=`${qn(i.only.length,"requested service")}${ve.length>0?` plus ${ve.join(", ")}`:""}`}i.verbose&&!i.quiet&&console.log(S.gray(`Found ${qn(j.length,"service")} in ${Z}`));let Ge=j.map(ge=>ge.name);if(!i.quiet){console.log(S.blue(`${i.dryRun?"Would start":"Starting"} ${qn(Ge.length,"service")} from ${Z}...`));for(let Ye of Ge)console.log(S.gray(` - ${Ye}`));let{appBase:ge,apiBase:Ke}=TI(L.ingressHttp),It=j.filter(Ye=>Ye.config?.appType==="frontend"),Qt=j.filter(Ye=>zu(Ye.config?.appType));if(It.length>0){console.log(S.blue(`
1377
1377
  \u{1F30D} Frontend URLs:`));for(let Ye of It){let De=Ye.config?.basePath??`/${Ye.name}`;console.log(S.gray(` - ${Ye.name}: ${ge}${S.cyan(UQ(De))}`))}}if(Qt.length>0){console.log(S.blue(`
1378
1378
  \u{1F527} Backend API URLs:`));for(let Ye of Qt){let De=Ye.name.replace(/-api$/,""),Kt=Ye.config?.apiPath??`/api/${De}`,tt=Ye.config?.sablier,Mt=tt?.enable&&tt?.deferStart?S.dim(" (deferred \u2014 starts on first request)"):"";console.log(S.gray(` - ${Ye.name}: ${Ke}${S.cyan(UQ(Kt))}${Mt}`))}}}let Oe=i.only??(n?[n]:void 0),je=gR(Qe,{verbose:i.verbose,quiet:i.quiet,force:i.force,focusTargets:Oe}),Te=Oe?`tilt up ${je.join(" ")}`:"tilt up";if(!i.quiet){console.log(S.blue(r2(L)));for(let ge of lU(L))console.log(S.yellow(ge));console.log(S.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:Ge,...i.only?{requested:i.only,declaredDependencies:ve}:{},command:Te});return}if(qI(i,"not starting services",Te))return;c2(L),u2(M,L);let we=_A.tiltUi,Ie=d??we,Xe=i.only?[...new Set([we,Ie])]:[Ie],{running:it,foreign:Ze}=await rU(Xe,M,async ge=>await Yf(ge)!==null);if(Ze.length>0&&d!==void 0){let ge=Ze[0],Ke=`TILT_PORT=${ge?.port} is used by another project's Tilt (${ge?.root}). Choose a free port, or run tdk down in that project.`;A?.({ok:!1},[{code:"TILT_PORT_IN_USE",message:Ke}]),Ua(Ke)}if(!i.quiet)for(let ge of Ze)console.log(S.yellow(`\u26A0\uFE0F Tilt on port ${ge.port} belongs to another project (${ge.root}); this project will use another port.`));let pt=i.force&&Ze.length===0,dt=YN({runningPorts:it,force:pt,only:!!i.only});if(dt.action==="already-running"){let ge=`Environment is already running on port ${dt.ports.join(", ")}.`;A?.({ok:!0,alreadyRunning:!0,tiltUrl:`http://localhost:${dt.ports[0]}`}),i.quiet||console.log(S.green(ge));return}if(dt.action==="only-blocked"){let ge=`A Tilt is already running on port ${dt.ports.join(", ")}. --only cannot change a running stack's services: run \`tdk down\` first, or pass --force to replace it.`;A?.({ok:!1},[{code:"TILT_ALREADY_RUNNING",message:ge}]),Ua(ge)}if(i.only)for(let ge of it)u0(ge);let me=await FN({configuredPort:d,force:pt,basePort:we,findAvailablePort:$2}),se=me.port;me.autoSwitched&&!i.quiet&&(console.log(S.yellow(`\u26A0\uFE0F Port ${we} is already in use`)),console.log(S.blue(`\u{1F504} Auto-switching to port ${se}
1379
1379
  `))),process.env.TILT_PORT=se.toString(),await qN({force:pt,quiet:i.quiet,port:se},{stop:u0,log:ge=>console.log(S.yellow(ge)),wait:ge=>new Promise(Ke=>setTimeout(Ke,ge))}),i.quiet||(console.log(S.gray(`
@@ -1,2 +1,2 @@
1
1
  import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
- import{Nb as a,Ob as b,Pb as c,Qb as d,Rb as e}from"./chunk-53KZOYBE.js";import"./chunk-42IVF3YT.js";import"./chunk-6EA4DGCY.js";export{e as assertMachineReadyOrExit,d as formatColdPreflight,a as nodeTooOld,b as requireVerifiedDockerVersions,c as runColdPreflight};
2
+ import{Nb as a,Ob as b,Pb as c,Qb as d,Rb as e}from"./chunk-G6434AM5.js";import"./chunk-42IVF3YT.js";import"./chunk-6EA4DGCY.js";export{e as assertMachineReadyOrExit,d as formatColdPreflight,a as nodeTooOld,b as requireVerifiedDockerVersions,c 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.167",
4
+ "version": "1.3.168",
5
5
  "description": "TDK CLI — start services on your machine.",
6
6
  "keywords": [
7
7
  "tdk",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tdk-landscape/tdk-cli-core",
3
- "version": "1.3.167",
3
+ "version": "1.3.168",
4
4
  "description": "TDK CLI — start services on your machine.",
5
5
  "homepage": "https://tdk-landscape.github.io/tdk-website",
6
6
  "repository": {