@ripla/godd-mcp 1.0.8-canary.44 → 1.0.8-canary.45

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.
package/dist/godd.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const __goddBundleUrl = require("node:url").pathToFileURL(__filename).href;
2
- "use strict";var JA=Object.create;var Dp=Object.defineProperty;var YA=Object.getOwnPropertyDescriptor;var QA=Object.getOwnPropertyNames;var XA=Object.getPrototypeOf,eR=Object.prototype.hasOwnProperty;var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),tr=(e,t)=>{for(var r in t)Dp(e,r,{get:t[r],enumerable:!0})},tR=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of QA(t))!eR.call(e,o)&&o!==r&&Dp(e,o,{get:()=>t[o],enumerable:!(n=YA(t,o))||n.enumerable});return e};var yt=(e,t,r)=>(r=e!=null?JA(XA(e)):{},tR(t||!e||!e.__esModule?Dp(r,"default",{value:e,enumerable:!0}):r,e));function Nr(){return"1.0.8-canary.44"}function rr(e){let t=Op.exec(e);if(!(!t||t[0]!==e)&&!t[4]?.split(".").some(r=>/^\d+$/.test(r)&&r.length>1&&r.startsWith("0")))return{version:e,channel:t[4]?.split(".")[0]??"latest"}}function g_(e,t){if(!rr(e)||!rr(t))throw new Error("Invalid release version");let r=Op.exec(e),n=Op.exec(t);for(let s of[1,2,3]){let a=BigInt(r[s])-BigInt(n[s]);if(a!==0n)return a<0n?-1:1}if(!r[4]||!n[4])return r[4]===n[4]?0:r[4]?-1:1;let o=r[4].split("."),i=n[4].split(".");for(let s=0;s<Math.min(o.length,i.length);s++){if(o[s]===i[s])continue;let a=/^\d+$/.test(o[s]),c=/^\d+$/.test(i[s]);return a&&c?BigInt(o[s])<BigInt(i[s])?-1:1:a!==c?a?-1:1:o[s]<i[s]?-1:1}return Math.sign(o.length-i.length)}var h_,ls,m_,Op,ri=b(()=>{"use strict";h_=require("node:fs"),ls=require("node:path"),m_=require("node:url");Op=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/});function uc(e){try{return(0,Ve.realpathSync)(e).replaceAll("\\","/")}catch{return e.replaceAll("\\","/")}}function nR(e=process.argv[1]??"",t="pkg"in process,r={}){if(t)return"binary";let n=uc(e),o=r.platform??process.platform,i=r.env??process.env,s=p=>o==="win32"?p.toLowerCase().replaceAll("\\","/").replace(/\/+$/,""):p.replace(/\/+$/,"");if(!n.toLowerCase().includes("/node_modules/@ripla/godd-mcp/"))return"source";if(/\/pnpm(?:-cache)?\/dlx\//i.test(n))return"pnpm-dlx";if(/(?:^|\/)bunx-[^/]+\//i.test(n))return"bunx";if(/\/pnpm\/global\//i.test(n)||i.PNPM_HOME&&s(n).startsWith(s(uc(i.PNPM_HOME))+"/global/"))return"pnpm-global";if(/\/yarn\/(?:data\/)?global\//i.test(n))return"yarn-global";if(n.includes("/_npx/"))return"npx";let a=n.indexOf("/node_modules/");if(a<0)return"source";let c=n.slice(0,a),u=i.npm_config_prefix??i.NPM_CONFIG_PREFIX??(o==="win32"?i.APPDATA?i.APPDATA+"/npm":"":(0,st.dirname)((0,st.dirname)(r.execPath??process.execPath)));if(u&&s(c)===s(uc(u)+(o==="win32"?"":"/lib")))return"npm-global";try{let p=JSON.parse((0,Ve.readFileSync)((0,st.join)(c,"package.json"),"utf8")),l=p&&typeof p=="object"?p:{};if([l.dependencies,l.devDependencies].some(d=>d&&typeof d=="object"&&ps in d)){let d=[];return(0,Ve.existsSync)((0,st.join)(c,"pnpm-lock.yaml"))&&d.push("pnpm-project"),(0,Ve.existsSync)((0,st.join)(c,"yarn.lock"))&&d.push("yarn-project"),((0,Ve.existsSync)((0,st.join)(c,"package-lock.json"))||(0,Ve.existsSync)((0,st.join)(c,"npm-shrinkwrap.json")))&&d.push("npm-project"),d.length===1?d[0]:"unknown"}}catch{}return"unknown"}function y_(e,t,r=process.platform,n){if(!/^[a-z][a-z0-9-]*$/.test(t))throw new Error("Invalid release channel");let o=`${ps}@${t}`,i=n?"'"+n.replace(/'/g,r==="win32"?"''":"'\\''")+"'":void 0;switch(e){case"npm-global":return`npm install --global ${o}`;case"npm-project":return`npm ${i?`--prefix ${i} `:""}install ${o}`;case"pnpm-global":return`pnpm add --global ${o}`;case"pnpm-project":return`pnpm ${i?`--dir ${i} `:""}add ${o}`;case"yarn-project":return`yarn ${i?`--cwd ${i} `:""}add ${o}`;case"yarn-global":return`yarn global add ${o}`;case"npx":return`npx --yes ${o} version`;case"pnpm-dlx":return`pnpm dlx ${o} version`;case"bunx":return`bunx ${o} version`;case"binary":return r==="win32"?".\\godd.exe install":"./godd install";case"source":return"\u30BD\u30FC\u30B9\u3092\u53D6\u5F97\u3057\u305F\u65B9\u6CD5\u3067\u540C\u3058\u7CFB\u5217\u3092\u66F4\u65B0\u3057\u3066\u304F\u3060\u3055\u3044\u3002";case"unknown":return"\u5C0E\u5165\u65B9\u6CD5\u3068\u5C0E\u5165\u5148\u3092\u78BA\u8A8D\u3057\u3001\u540C\u3058\u7CFB\u5217\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u66F4\u65B0\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}async function __(e){let t=await e(`https://registry.npmjs.org/-/package/${ps}/dist-tags`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}});if(!t.ok)throw new Error("Package registry unavailable");return t.json()}function oR(e){return e.split(";").map(t=>t.trim().replace(/^"(.*)"$/,"$1")).filter(t=>st.win32.isAbsolute(t)&&(/^[A-Za-z]:[\\/]/.test(t)||/^\\\\[^\\]/.test(t)))}async function iR(e){let t="npm",r=[];if(process.platform==="win32"){let n=oR(process.env.PATH??""),o="pkg"in process?n.map(s=>(0,st.join)(s,"node.exe")).find(Ve.existsSync):process.execPath,i=[...o?[(0,st.dirname)(o)]:[],...n].map(s=>(0,st.join)(s,"node_modules","npm","bin","npm-cli.js")).find(Ve.existsSync);if(!o||!i)return __(e);t=o,r=[i]}try{let{stdout:n}=await(0,x_.promisify)(b_.execFile)(t,[...r,"view",ps,"dist-tags","--json"],{timeout:5e3,maxBuffer:65536,windowsHide:!0});return JSON.parse(n)}catch(n){if(!(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT"))throw n;return __(e)}}function lc(e={}){let t=e.version??Nr(),r=rr(t),n=uc(e.entry??process.argv[1]??""),o=e.kind??nR(n),i=e.projectRoot??(o.endsWith("-project")?n.split("/node_modules/")[0]:void 0),s=e.platform??process.platform,a=e.arch??process.arch,c=e.directory??(0,st.join)((0,w_.homedir)(),".cache","godd","updates"),u=e.now??Date.now,p=e.fetcher??fetch,l,d,f=(0,v_.createHash)("sha256").update(`${t}/${o}/${s}/${a}/${i??""}`).digest("hex"),h=(0,st.join)(c,f+".json");async function g(){if(!r||t==="0.0.0"||o==="source")return"";let y=u();if(!l)try{let x=JSON.parse((0,Ve.readFileSync)(h,"utf8"));x&&typeof x=="object"&&"checked"in x&&typeof x.checked=="number"&&Number.isFinite(x.checked)&&"notice"in x&&typeof x.notice=="string"&&x.notice.length<2e3&&!/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/.test(x.notice)&&(l={checked:x.checked,notice:x.notice})}catch{}if(l&&l.checked<=y&&y-l.checked<rR)return l.notice;let v="";try{let x=e.fetcher?await p(`https://registry.npmjs.org/-/package/${ps}/dist-tags`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}}):void 0;if(x&&!x.ok)throw new Error("Package registry unavailable");let k=x?await x.json():await iR(p);if(!k||typeof k!="object")throw new Error("Invalid package tags");let P=k[r.channel];if(P!==void 0&&(typeof P!="string"||rr(P)?.channel!==r.channel))throw new Error("The published tag points at another release series");if(typeof P=="string"&&g_(P,t)>0)if(v=`GoDD\u306E\u66F4\u65B0: ${t} \u2192 ${P}\uFF08${r.channel}\uFF09
2
+ "use strict";var JA=Object.create;var Dp=Object.defineProperty;var YA=Object.getOwnPropertyDescriptor;var QA=Object.getOwnPropertyNames;var XA=Object.getPrototypeOf,eR=Object.prototype.hasOwnProperty;var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),tr=(e,t)=>{for(var r in t)Dp(e,r,{get:t[r],enumerable:!0})},tR=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of QA(t))!eR.call(e,o)&&o!==r&&Dp(e,o,{get:()=>t[o],enumerable:!(n=YA(t,o))||n.enumerable});return e};var yt=(e,t,r)=>(r=e!=null?JA(XA(e)):{},tR(t||!e||!e.__esModule?Dp(r,"default",{value:e,enumerable:!0}):r,e));function Nr(){return"1.0.8-canary.45"}function rr(e){let t=Op.exec(e);if(!(!t||t[0]!==e)&&!t[4]?.split(".").some(r=>/^\d+$/.test(r)&&r.length>1&&r.startsWith("0")))return{version:e,channel:t[4]?.split(".")[0]??"latest"}}function g_(e,t){if(!rr(e)||!rr(t))throw new Error("Invalid release version");let r=Op.exec(e),n=Op.exec(t);for(let s of[1,2,3]){let a=BigInt(r[s])-BigInt(n[s]);if(a!==0n)return a<0n?-1:1}if(!r[4]||!n[4])return r[4]===n[4]?0:r[4]?-1:1;let o=r[4].split("."),i=n[4].split(".");for(let s=0;s<Math.min(o.length,i.length);s++){if(o[s]===i[s])continue;let a=/^\d+$/.test(o[s]),c=/^\d+$/.test(i[s]);return a&&c?BigInt(o[s])<BigInt(i[s])?-1:1:a!==c?a?-1:1:o[s]<i[s]?-1:1}return Math.sign(o.length-i.length)}var h_,ls,m_,Op,ri=b(()=>{"use strict";h_=require("node:fs"),ls=require("node:path"),m_=require("node:url");Op=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/});function uc(e){try{return(0,Ve.realpathSync)(e).replaceAll("\\","/")}catch{return e.replaceAll("\\","/")}}function nR(e=process.argv[1]??"",t="pkg"in process,r={}){if(t)return"binary";let n=uc(e),o=r.platform??process.platform,i=r.env??process.env,s=p=>o==="win32"?p.toLowerCase().replaceAll("\\","/").replace(/\/+$/,""):p.replace(/\/+$/,"");if(!n.toLowerCase().includes("/node_modules/@ripla/godd-mcp/"))return"source";if(/\/pnpm(?:-cache)?\/dlx\//i.test(n))return"pnpm-dlx";if(/(?:^|\/)bunx-[^/]+\//i.test(n))return"bunx";if(/\/pnpm\/global\//i.test(n)||i.PNPM_HOME&&s(n).startsWith(s(uc(i.PNPM_HOME))+"/global/"))return"pnpm-global";if(/\/yarn\/(?:data\/)?global\//i.test(n))return"yarn-global";if(n.includes("/_npx/"))return"npx";let a=n.indexOf("/node_modules/");if(a<0)return"source";let c=n.slice(0,a),u=i.npm_config_prefix??i.NPM_CONFIG_PREFIX??(o==="win32"?i.APPDATA?i.APPDATA+"/npm":"":(0,st.dirname)((0,st.dirname)(r.execPath??process.execPath)));if(u&&s(c)===s(uc(u)+(o==="win32"?"":"/lib")))return"npm-global";try{let p=JSON.parse((0,Ve.readFileSync)((0,st.join)(c,"package.json"),"utf8")),l=p&&typeof p=="object"?p:{};if([l.dependencies,l.devDependencies].some(d=>d&&typeof d=="object"&&ps in d)){let d=[];return(0,Ve.existsSync)((0,st.join)(c,"pnpm-lock.yaml"))&&d.push("pnpm-project"),(0,Ve.existsSync)((0,st.join)(c,"yarn.lock"))&&d.push("yarn-project"),((0,Ve.existsSync)((0,st.join)(c,"package-lock.json"))||(0,Ve.existsSync)((0,st.join)(c,"npm-shrinkwrap.json")))&&d.push("npm-project"),d.length===1?d[0]:"unknown"}}catch{}return"unknown"}function y_(e,t,r=process.platform,n){if(!/^[a-z][a-z0-9-]*$/.test(t))throw new Error("Invalid release channel");let o=`${ps}@${t}`,i=n?"'"+n.replace(/'/g,r==="win32"?"''":"'\\''")+"'":void 0;switch(e){case"npm-global":return`npm install --global ${o}`;case"npm-project":return`npm ${i?`--prefix ${i} `:""}install ${o}`;case"pnpm-global":return`pnpm add --global ${o}`;case"pnpm-project":return`pnpm ${i?`--dir ${i} `:""}add ${o}`;case"yarn-project":return`yarn ${i?`--cwd ${i} `:""}add ${o}`;case"yarn-global":return`yarn global add ${o}`;case"npx":return`npx --yes ${o} version`;case"pnpm-dlx":return`pnpm dlx ${o} version`;case"bunx":return`bunx ${o} version`;case"binary":return r==="win32"?".\\godd.exe install":"./godd install";case"source":return"\u30BD\u30FC\u30B9\u3092\u53D6\u5F97\u3057\u305F\u65B9\u6CD5\u3067\u540C\u3058\u7CFB\u5217\u3092\u66F4\u65B0\u3057\u3066\u304F\u3060\u3055\u3044\u3002";case"unknown":return"\u5C0E\u5165\u65B9\u6CD5\u3068\u5C0E\u5165\u5148\u3092\u78BA\u8A8D\u3057\u3001\u540C\u3058\u7CFB\u5217\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u66F4\u65B0\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}async function __(e){let t=await e(`https://registry.npmjs.org/-/package/${ps}/dist-tags`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}});if(!t.ok)throw new Error("Package registry unavailable");return t.json()}function oR(e){return e.split(";").map(t=>t.trim().replace(/^"(.*)"$/,"$1")).filter(t=>st.win32.isAbsolute(t)&&(/^[A-Za-z]:[\\/]/.test(t)||/^\\\\[^\\]/.test(t)))}async function iR(e){let t="npm",r=[];if(process.platform==="win32"){let n=oR(process.env.PATH??""),o="pkg"in process?n.map(s=>(0,st.join)(s,"node.exe")).find(Ve.existsSync):process.execPath,i=[...o?[(0,st.dirname)(o)]:[],...n].map(s=>(0,st.join)(s,"node_modules","npm","bin","npm-cli.js")).find(Ve.existsSync);if(!o||!i)return __(e);t=o,r=[i]}try{let{stdout:n}=await(0,x_.promisify)(b_.execFile)(t,[...r,"view",ps,"dist-tags","--json"],{timeout:5e3,maxBuffer:65536,windowsHide:!0});return JSON.parse(n)}catch(n){if(!(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT"))throw n;return __(e)}}function lc(e={}){let t=e.version??Nr(),r=rr(t),n=uc(e.entry??process.argv[1]??""),o=e.kind??nR(n),i=e.projectRoot??(o.endsWith("-project")?n.split("/node_modules/")[0]:void 0),s=e.platform??process.platform,a=e.arch??process.arch,c=e.directory??(0,st.join)((0,w_.homedir)(),".cache","godd","updates"),u=e.now??Date.now,p=e.fetcher??fetch,l,d,f=(0,v_.createHash)("sha256").update(`${t}/${o}/${s}/${a}/${i??""}`).digest("hex"),h=(0,st.join)(c,f+".json");async function g(){if(!r||t==="0.0.0"||o==="source")return"";let y=u();if(!l)try{let x=JSON.parse((0,Ve.readFileSync)(h,"utf8"));x&&typeof x=="object"&&"checked"in x&&typeof x.checked=="number"&&Number.isFinite(x.checked)&&"notice"in x&&typeof x.notice=="string"&&x.notice.length<2e3&&!/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/.test(x.notice)&&(l={checked:x.checked,notice:x.notice})}catch{}if(l&&l.checked<=y&&y-l.checked<rR)return l.notice;let v="";try{let x=e.fetcher?await p(`https://registry.npmjs.org/-/package/${ps}/dist-tags`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}}):void 0;if(x&&!x.ok)throw new Error("Package registry unavailable");let k=x?await x.json():await iR(p);if(!k||typeof k!="object")throw new Error("Invalid package tags");let P=k[r.channel];if(P!==void 0&&(typeof P!="string"||rr(P)?.channel!==r.channel))throw new Error("The published tag points at another release series");if(typeof P=="string"&&g_(P,t)>0)if(v=`GoDD\u306E\u66F4\u65B0: ${t} \u2192 ${P}\uFF08${r.channel}\uFF09
3
3
  `,o==="binary"){let L=`godd-mcp-server-${s==="win32"?"win":s==="darwin"?"macos":"linux"}-${a}.zip`,Ue=await p(`https://api.github.com/repos/ripla-inc/GoDD/releases/tags/v${P}`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/vnd.github+json"}}),we=Ue.ok?await Ue.json():void 0,qe=(we&&typeof we=="object"&&"assets"in we&&Array.isArray(we.assets)?we.assets:[]).find(Be=>Be&&typeof Be=="object"&&"name"in Be&&Be.name===L);qe&&typeof qe=="object"&&"browser_download_url"in qe&&typeof qe.browser_download_url=="string"&&qe.browser_download_url.startsWith(`https://github.com/ripla-inc/GoDD/releases/download/v${P}/`)?v+=`\u53D6\u5F97: ${qe.browser_download_url}
4
4
  \u5C55\u958B\u3057\u305F\u30D5\u30A9\u30EB\u30C0\u30FC\u3067\u66F4\u65B0: ${y_(o,r.channel,s)}`:v+="\u540C\u3058\u7248\u30FB\u7CFB\u5217\u306E\u30D0\u30A4\u30CA\u30EA\u914D\u5E03\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093\u3002\u73FE\u5728\u306E\u7248\u3092\u4FDD\u3061\u3001\u914D\u5E03\u5143\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}else v+=`\u66F4\u65B0${s==="win32"&&i?"\uFF08PowerShell\uFF09":""}: ${y_(o,r.channel,s,i)}`}catch{v="GoDD\u306E\u66F4\u65B0\u78BA\u8A8D\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u901A\u4FE1\u3068\u914D\u5E03\u5143\u3092\u78BA\u8A8D\u3057\u3001\u5F8C\u3067\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u73FE\u5728\u306E\u51E6\u7406\u306F\u7D99\u7D9A\u3057\u307E\u3059\u3002"}l={checked:y,notice:v};let w;try{(0,Ve.mkdirSync)((0,st.dirname)(h),{recursive:!0}),w=h+`.${process.pid}.tmp`,(0,Ve.writeFileSync)(w,JSON.stringify(l),{mode:384}),(0,Ve.renameSync)(w,h)}catch{if(w)try{(0,Ve.unlinkSync)(w)}catch{}}return v}return()=>(d??=g().finally(()=>{d=void 0}),d)}var v_,Ve,st,w_,b_,x_,ps,rR,Np=b(()=>{"use strict";v_=require("node:crypto"),Ve=require("node:fs"),st=require("node:path"),w_=require("node:os"),b_=require("node:child_process"),x_=require("node:util");ri();ps="@ripla/godd-mcp",rR=3600*1e3});function S(e,t,r){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(let p in s.prototype)p in a||Object.defineProperty(a,p,{value:s.prototype[p].bind(a)});a._zod.constr=s,a._zod.def=c}let o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var c;let u=r?.Parent?new i:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function Mt(e){return e&&Object.assign(pc,e),pc}var dc,k_,rn,pc,ni=b(()=>{dc=Object.freeze({status:"aborted"});k_=Symbol("zod_brand"),rn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},pc={}});var pe={};tr(pe,{BIGINT_FORMAT_RANGES:()=>$_,Class:()=>Mp,NUMBER_FORMAT_RANGES:()=>Bp,aborted:()=>lo,allowsEval:()=>qp,assert:()=>lR,assertEqual:()=>sR,assertIs:()=>cR,assertNever:()=>uR,assertNotEqual:()=>aR,assignProp:()=>Up,cached:()=>hs,captureStackTrace:()=>hc,cleanEnum:()=>kR,cleanRegex:()=>gs,clone:()=>nr,createTransparentProxy:()=>gR,defineLazy:()=>Se,esc:()=>uo,escapeRegex:()=>Cn,extend:()=>vR,finalizeIssue:()=>vr,floatSafeRemainder:()=>Zp,getElementAtPath:()=>pR,getEnumValues:()=>fs,getLengthableOrigin:()=>ys,getParsedType:()=>mR,getSizableOrigin:()=>P_,isObject:()=>oi,isPlainObject:()=>ii,issue:()=>Vp,joinValues:()=>fc,jsonStringifyReplacer:()=>Lp,merge:()=>wR,normalizeParams:()=>j,nullish:()=>ms,numKeys:()=>hR,omit:()=>_R,optionalKeys:()=>Gp,partial:()=>bR,pick:()=>yR,prefixIssues:()=>jr,primitiveTypes:()=>S_,promiseAllObject:()=>dR,propertyKeyTypes:()=>Fp,randomString:()=>fR,required:()=>xR,stringifyPrimitive:()=>mc,unwrapMessage:()=>ds});function sR(e){return e}function aR(e){return e}function cR(e){}function uR(e){throw new Error}function lR(e){}function fs(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function fc(e,t="|"){return e.map(r=>mc(r)).join(t)}function Lp(e,t){return typeof t=="bigint"?t.toString():t}function hs(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function ms(e){return e==null}function gs(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Zp(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Se(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Up(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function pR(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function dR(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function fR(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function uo(e){return JSON.stringify(e)}function oi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ii(e){if(oi(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(oi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function hR(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function Cn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function j(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function gR(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function mc(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Gp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function yR(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(r[o]=n.shape[o])}return nr(e,{...e._zod.def,shape:r,checks:[]})}function _R(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete r[o]}return nr(e,{...e._zod.def,shape:r,checks:[]})}function vR(e,t){if(!ii(t))throw new Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return Up(this,"shape",n),n},checks:[]};return nr(e,r)}function wR(e,t){return nr(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Up(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function bR(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in n))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=e?new e({type:"optional",innerType:n[i]}):n[i])}else for(let i in n)o[i]=e?new e({type:"optional",innerType:n[i]}):n[i];return nr(t,{...t._zod.def,shape:o,checks:[]})}function xR(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)o[i]=new e({type:"nonoptional",innerType:n[i]});return nr(t,{...t._zod.def,shape:o,checks:[]})}function lo(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function jr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ds(e){return typeof e=="string"?e:e?.message}function vr(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=ds(e.inst?._zod.def?.error?.(e))??ds(t?.error?.(e))??ds(r.customError?.(e))??ds(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function P_(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ys(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Vp(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function kR(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var hc,qp,mR,Fp,S_,Bp,$_,Mp,Mr=b(()=>{hc=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};qp=hs(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});mR=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Fp=new Set(["string","number","symbol"]),S_=new Set(["string","number","bigint","boolean","symbol","undefined"]);Bp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Mp=class{constructor(...t){}}});function yc(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function _c(e,t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(e),n}var E_,gc,Hp,Wp=b(()=>{ni();Mr();E_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Lp,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},gc=S("$ZodError",E_),Hp=S("$ZodError",E_,{Parent:Error})});var C_,T_,Kp,_s,Jp,vc,Yp=b(()=>{ni();Wp();Mr();C_=e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new rn;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>vr(c,i,Mt())));throw hc(a,o?.callee),a}return s.value},T_=e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>vr(c,i,Mt())));throw hc(a,o?.callee),a}return s.value},Kp=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new rn;return i.issues.length?{success:!1,error:new(e??gc)(i.issues.map(s=>vr(s,o,Mt())))}:{success:!0,data:i.value}},_s=Kp(Hp),Jp=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>vr(s,o,Mt())))}:{success:!0,data:i.value}},vc=Jp(Hp)});function L_(){return new RegExp($R,"u")}function K_(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function J_(e){return new RegExp(`^${K_(e)}$`)}function Y_(e){let t=K_({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${H_}T(?:${n})$`)}var A_,R_,I_,z_,D_,O_,N_,j_,Qp,M_,$R,Z_,U_,q_,F_,G_,Xp,B_,V_,H_,W_,Q_,X_,ev,tv,rv,nv,ov,iv,wc=b(()=>{A_=/^[cC][^\s-]{8,}$/,R_=/^[0-9a-z]+$/,I_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,z_=/^[0-9a-vA-V]{20}$/,D_=/^[A-Za-z0-9]{27}$/,O_=/^[a-zA-Z0-9_-]{21}$/,N_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,j_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qp=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,M_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$R="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Z_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,U_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,q_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,F_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,G_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xp=/^[A-Za-z0-9_-]*$/,B_=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,V_=/^\+(?:[0-9]){6,14}[0-9]$/,H_="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",W_=new RegExp(`^${H_}$`);Q_=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},X_=/^\d+n?$/,ev=/^\d+$/,tv=/^-?\d+(?:\.\d+)?/i,rv=/true|false/i,nv=/null/i,ov=/^[^A-Z]*$/,iv=/^[^a-z]*$/});var _t,sv,ed,td,av,cv,uv,lv,pv,ws,dv,fv,hv,mv,gv,yv,_v,bc=b(()=>{ni();wc();Mr();_t=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),sv={number:"number",bigint:"bigint",object:"date"},ed=S("$ZodCheckLessThan",(e,t)=>{_t.init(e,t);let r=sv[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),td=S("$ZodCheckGreaterThan",(e,t)=>{_t.init(e,t);let r=sv[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),av=S("$ZodCheckMultipleOf",(e,t)=>{_t.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Zp(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),cv=S("$ZodCheckNumberFormat",(e,t)=>{_t.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Bp[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=i,r&&(a.pattern=ev)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),uv=S("$ZodCheckMaxLength",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ms(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let s=ys(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),lv=S("$ZodCheckMinLength",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ms(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=ys(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),pv=S("$ZodCheckLengthEquals",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ms(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,i=o.length;if(i===t.length)return;let s=ys(o),a=i>t.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ws=S("$ZodCheckStringFormat",(e,t)=>{var r,n;_t.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),dv=S("$ZodCheckRegex",(e,t)=>{ws.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fv=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ov),ws.init(e,t)}),hv=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=iv),ws.init(e,t)}),mv=S("$ZodCheckIncludes",(e,t)=>{_t.init(e,t);let r=Cn(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),gv=S("$ZodCheckStartsWith",(e,t)=>{_t.init(e,t);let r=new RegExp(`^${Cn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),yv=S("$ZodCheckEndsWith",(e,t)=>{_t.init(e,t);let r=new RegExp(`.*${Cn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),_v=S("$ZodCheckOverwrite",(e,t)=>{_t.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var xc,rd=b(()=>{xc=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
5
5
  `).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,o.join(`
@@ -28,7 +28,7 @@ const __goddBundleUrl = require("node:url").pathToFileURL(__filename).href;
28
28
  path: iss.path ? [${uo(w)}, ...iss.path] : [${uo(w)}]
29
29
  })));`),d.write(`newResult[${uo(w)}] = ${x}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");let v=d.compile();return(w,x)=>v(l,w,x)},o,i=oi,s=!pc.jitless,c=s&&qp.value,u=t.catchall,p;e._zod.parse=(l,d)=>{p??(p=r.value);let f=l.value;if(!i(f))return l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l;let h=[];if(s&&c&&d?.async===!1&&d.jitless!==!0)o||(o=n(t.shape)),l=o(l,d);else{l.value={};let x=p.shape;for(let k of p.keys){let P=x[k],q=P._zod.run({value:f[k],issues:[]},d),L=P._zod.optin==="optional"&&P._zod.optout==="optional";q instanceof Promise?h.push(q.then(Ue=>L?xv(Ue,l,k,f):kc(Ue,l,k))):L?xv(q,l,k,f):kc(q,l,k)}}if(!u)return h.length?Promise.all(h).then(()=>l):l;let g=[],y=p.keySet,v=u._zod,w=v.def.type;for(let x of Object.keys(f)){if(y.has(x))continue;if(w==="never"){g.push(x);continue}let k=v.run({value:f[x],issues:[]},d);k instanceof Promise?h.push(k.then(P=>kc(P,l,x))):kc(k,l,x)}return g.length&&l.issues.push({code:"unrecognized_keys",keys:g,input:f,inst:e}),h.length?Promise.all(h).then(()=>l):l}});sd=S("$ZodUnion",(e,t)=>{he.init(e,t),Se(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Se(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Se(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Se(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>gs(n.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let o=!1,i=[];for(let s of t.options){let a=s._zod.run({value:r.value,issues:[]},n);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}return o?Promise.all(i).then(s=>kv(s,r,e,n)):kv(i,r,e,n)}}),lw=S("$ZodDiscriminatedUnion",(e,t)=>{sd.init(e,t);let r=e._zod.parse;Se(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,c]of Object.entries(s)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=hs(()=>{let o=t.options,i=new Map;for(let s of o){let a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!oi(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=n.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),o)}}),pw=S("$ZodIntersection",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>Sv(r,c,u)):Sv(r,i,s)}});dw=S("$ZodRecord",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!ii(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){let u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?i.push(u.then(p=>{p.issues.length&&r.issues.push(...jr(c,p.issues)),r.value[c]=p.value})):(u.issues.length&&r.issues.push(...jr(c,u.issues)),r.value[c]=u.value)}let a;for(let c in o)s.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(let s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let a=t.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>vr(u,n,Mt())),input:s,path:[s],inst:e}),r.value[a.value]=a.value;continue}let c=t.valueType._zod.run({value:o[s],issues:[]},n);c instanceof Promise?i.push(c.then(u=>{u.issues.length&&r.issues.push(...jr(s,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...jr(s,c.issues)),r.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}}),fw=S("$ZodEnum",(e,t)=>{he.init(e,t);let r=fs(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>Fp.has(typeof n)).map(n=>typeof n=="string"?Cn(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),hw=S("$ZodLiteral",(e,t)=>{he.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Cn(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),mw=S("$ZodTransform",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new rn;return r.value=o,r}}),gw=S("$ZodOptional",(e,t)=>{he.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Se(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${gs(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,n):r.value===void 0?r:t.innerType._zod.run(r,n)}),yw=S("$ZodNullable",(e,t)=>{he.init(e,t),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${gs(r.source)}|null)$`):void 0}),Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),_w=S("$ZodDefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>$v(i,t)):$v(o,t)}});vw=S("$ZodPrefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),ww=S("$ZodNonOptional",(e,t)=>{he.init(e,t),Se(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Pv(i,e)):Pv(o,e)}});bw=S("$ZodCatch",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>vr(s,n,Mt()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>vr(i,n,Mt()))},input:r.value}),r.issues=[]),r)}}),xw=S("$ZodPipe",(e,t)=>{he.init(e,t),Se(e._zod,"values",()=>t.in._zod.values),Se(e._zod,"optin",()=>t.in._zod.optin),Se(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Ev(i,t,n)):Ev(o,t,n)}});kw=S("$ZodReadonly",(e,t)=>{he.init(e,t),Se(e._zod,"propValues",()=>t.innerType._zod.propValues),Se(e._zod,"values",()=>t.innerType._zod.values),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Cv):Cv(o)}});Sw=S("$ZodCustom",(e,t)=>{_t.init(e,t),he.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Tv(i,r,n,e));Tv(o,r,n,e)}})});function Pw(){return{localeError:TR()}}var CR,TR,Ew=b(()=>{Mr();CR=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},TR=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${CR(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${mc(n.values[0])}`:`Invalid option: expected one of ${fc(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${fc(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});var $c=b(()=>{});function cd(){return new bs}var Cw,Tw,bs,nn,ud=b(()=>{Cw=Symbol("ZodOutput"),Tw=Symbol("ZodInput"),bs=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){let n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};nn=cd()});function Aw(e,t){return new e({type:"string",...j(t)})}function Rw(e,t){return new e({type:"string",coerce:!0,...j(t)})}function Iw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...j(t)})}function ld(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...j(t)})}function zw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...j(t)})}function Dw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(t)})}function Ow(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(t)})}function Nw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(t)})}function pd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...j(t)})}function jw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...j(t)})}function Mw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(t)})}function Lw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...j(t)})}function Zw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(t)})}function Uw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...j(t)})}function qw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...j(t)})}function Fw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(t)})}function Gw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(t)})}function Bw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(t)})}function Vw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(t)})}function Hw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(t)})}function Ww(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...j(t)})}function Kw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...j(t)})}function Jw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...j(t)})}function Yw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...j(t)})}function Qw(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(t)})}function Xw(e,t){return new e({type:"string",format:"date",check:"string_format",...j(t)})}function eb(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...j(t)})}function tb(e,t){return new e({type:"string",format:"duration",check:"string_format",...j(t)})}function rb(e,t){return new e({type:"number",checks:[],...j(t)})}function nb(e,t){return new e({type:"number",coerce:!0,checks:[],...j(t)})}function ob(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...j(t)})}function ib(e,t){return new e({type:"boolean",...j(t)})}function sb(e,t){return new e({type:"boolean",coerce:!0,...j(t)})}function ab(e,t){return new e({type:"bigint",coerce:!0,...j(t)})}function cb(e,t){return new e({type:"null",...j(t)})}function ub(e){return new e({type:"any"})}function lb(e){return new e({type:"unknown"})}function pb(e,t){return new e({type:"never",...j(t)})}function db(e,t){return new e({type:"date",coerce:!0,...j(t)})}function si(e,t){return new ed({check:"less_than",...j(t),value:e,inclusive:!1})}function on(e,t){return new ed({check:"less_than",...j(t),value:e,inclusive:!0})}function ai(e,t){return new td({check:"greater_than",...j(t),value:e,inclusive:!1})}function wr(e,t){return new td({check:"greater_than",...j(t),value:e,inclusive:!0})}function xs(e,t){return new av({check:"multiple_of",...j(t),value:e})}function Pc(e,t){return new uv({check:"max_length",...j(t),maximum:e})}function ci(e,t){return new lv({check:"min_length",...j(t),minimum:e})}function Ec(e,t){return new pv({check:"length_equals",...j(t),length:e})}function dd(e,t){return new dv({check:"string_format",format:"regex",...j(t),pattern:e})}function fd(e){return new fv({check:"string_format",format:"lowercase",...j(e)})}function hd(e){return new hv({check:"string_format",format:"uppercase",...j(e)})}function md(e,t){return new mv({check:"string_format",format:"includes",...j(t),includes:e})}function gd(e,t){return new gv({check:"string_format",format:"starts_with",...j(t),prefix:e})}function yd(e,t){return new yv({check:"string_format",format:"ends_with",...j(t),suffix:e})}function po(e){return new _v({check:"overwrite",tx:e})}function _d(e){return po(t=>t.normalize(e))}function vd(){return po(e=>e.trim())}function wd(){return po(e=>e.toLowerCase())}function bd(){return po(e=>e.toUpperCase())}function fb(e,t,r){return new e({type:"array",element:t,...j(r)})}function hb(e,t,r){let n=j(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function mb(e,t,r){return new e({type:"custom",check:"custom",fn:t,...j(r)})}var gb=b(()=>{bc();Mr()});var yb=b(()=>{});function Tc(e,t){if(e instanceof bs){let n=new Cc(t),o={};for(let a of e._idmap.entries()){let[c,u]=a;n.process(u)}let i={},s={registry:e,uri:t?.uri,defs:o};for(let a of e._idmap.entries()){let[c,u]=a;i[c]=n.emit(u,{...t,external:s})}if(Object.keys(o).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:o}}return{schemas:i}}let r=new Cc(t);return r.process(e),r.emit(e,t)}function Qe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Qe(o.element,r);case"object":{for(let i in o.shape)if(Qe(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(Qe(i,r))return!0;return!1}case"intersection":return Qe(o.left,r)||Qe(o.right,r);case"tuple":{for(let i of o.items)if(Qe(i,r))return!0;return!!(o.rest&&Qe(o.rest,r))}case"record":return Qe(o.keyType,r)||Qe(o.valueType,r);case"map":return Qe(o.keyType,r)||Qe(o.valueType,r);case"set":return Qe(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Qe(o.innerType,r);case"lazy":return Qe(o.getter(),r);case"default":return Qe(o.innerType,r);case"prefault":return Qe(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Qe(o.in,r)||Qe(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var Cc,_b=b(()=>{ud();Mr();Cc=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??nn,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(t,a);let c=t._zod.toJSONSchema?.();if(c)a.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path},d=t._zod.parent;if(d)a.ref=d,this.process(d,l),this.seen.get(d).isParent=!0;else{let f=a.schema;switch(o.type){case"string":{let h=f;h.type="string";let{minimum:g,maximum:y,format:v,patterns:w,contentEncoding:x}=t._zod.bag;if(typeof g=="number"&&(h.minLength=g),typeof y=="number"&&(h.maxLength=y),v&&(h.format=i[v]??v,h.format===""&&delete h.format),x&&(h.contentEncoding=x),w&&w.size>0){let k=[...w];k.length===1?h.pattern=k[0].source:k.length>1&&(a.schema.allOf=[...k.map(P=>({...this.target==="draft-7"?{type:"string"}:{},pattern:P.source}))])}break}case"number":{let h=f,{minimum:g,maximum:y,format:v,multipleOf:w,exclusiveMaximum:x,exclusiveMinimum:k}=t._zod.bag;typeof v=="string"&&v.includes("int")?h.type="integer":h.type="number",typeof k=="number"&&(h.exclusiveMinimum=k),typeof g=="number"&&(h.minimum=g,typeof k=="number"&&(k>=g?delete h.minimum:delete h.exclusiveMinimum)),typeof x=="number"&&(h.exclusiveMaximum=x),typeof y=="number"&&(h.maximum=y,typeof x=="number"&&(x<=y?delete h.maximum:delete h.exclusiveMaximum)),typeof w=="number"&&(h.multipleOf=w);break}case"boolean":{let h=f;h.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{f.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{f.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let h=f,{minimum:g,maximum:y}=t._zod.bag;typeof g=="number"&&(h.minItems=g),typeof y=="number"&&(h.maxItems=y),h.type="array",h.items=this.process(o.element,{...l,path:[...l.path,"items"]});break}case"object":{let h=f;h.type="object",h.properties={};let g=o.shape;for(let w in g)h.properties[w]=this.process(g[w],{...l,path:[...l.path,"properties",w]});let y=new Set(Object.keys(g)),v=new Set([...y].filter(w=>{let x=o.shape[w]._zod;return this.io==="input"?x.optin===void 0:x.optout===void 0}));v.size>0&&(h.required=Array.from(v)),o.catchall?._zod.def.type==="never"?h.additionalProperties=!1:o.catchall?o.catchall&&(h.additionalProperties=this.process(o.catchall,{...l,path:[...l.path,"additionalProperties"]})):this.io==="output"&&(h.additionalProperties=!1);break}case"union":{let h=f;h.anyOf=o.options.map((g,y)=>this.process(g,{...l,path:[...l.path,"anyOf",y]}));break}case"intersection":{let h=f,g=this.process(o.left,{...l,path:[...l.path,"allOf",0]}),y=this.process(o.right,{...l,path:[...l.path,"allOf",1]}),v=x=>"allOf"in x&&Object.keys(x).length===1,w=[...v(g)?g.allOf:[g],...v(y)?y.allOf:[y]];h.allOf=w;break}case"tuple":{let h=f;h.type="array";let g=o.items.map((w,x)=>this.process(w,{...l,path:[...l.path,"prefixItems",x]}));if(this.target==="draft-2020-12"?h.prefixItems=g:h.items=g,o.rest){let w=this.process(o.rest,{...l,path:[...l.path,"items"]});this.target==="draft-2020-12"?h.items=w:h.additionalItems=w}o.rest&&(h.items=this.process(o.rest,{...l,path:[...l.path,"items"]}));let{minimum:y,maximum:v}=t._zod.bag;typeof y=="number"&&(h.minItems=y),typeof v=="number"&&(h.maxItems=v);break}case"record":{let h=f;h.type="object",h.propertyNames=this.process(o.keyType,{...l,path:[...l.path,"propertyNames"]}),h.additionalProperties=this.process(o.valueType,{...l,path:[...l.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let h=f,g=fs(o.entries);g.every(y=>typeof y=="number")&&(h.type="number"),g.every(y=>typeof y=="string")&&(h.type="string"),h.enum=g;break}case"literal":{let h=f,g=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");g.push(Number(y))}else g.push(y);if(g.length!==0)if(g.length===1){let y=g[0];h.type=y===null?"null":typeof y,h.const=y}else g.every(y=>typeof y=="number")&&(h.type="number"),g.every(y=>typeof y=="string")&&(h.type="string"),g.every(y=>typeof y=="boolean")&&(h.type="string"),g.every(y=>y===null)&&(h.type="null"),h.enum=g;break}case"file":{let h=f,g={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:v,mime:w}=t._zod.bag;y!==void 0&&(g.minLength=y),v!==void 0&&(g.maxLength=v),w?w.length===1?(g.contentMediaType=w[0],Object.assign(h,g)):h.anyOf=w.map(x=>({...g,contentMediaType:x})):Object.assign(h,g);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let h=this.process(o.innerType,l);f.anyOf=[h,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,l),a.ref=o.innerType;break}case"success":{let h=f;h.type="boolean";break}case"default":{this.process(o.innerType,l),a.ref=o.innerType,f.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,l),a.ref=o.innerType,this.io==="input"&&(f._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,l),a.ref=o.innerType;let h;try{h=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}f.default=h;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let h=f,g=t._zod.pattern;if(!g)throw new Error("Pattern not found in template literal");h.type="string",h.pattern=g.source;break}case"pipe":{let h=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(h,l),a.ref=h;break}case"readonly":{this.process(o.innerType,l),a.ref=o.innerType,f.readOnly=!0;break}case"promise":{this.process(o.innerType,l),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,l),a.ref=o.innerType;break}case"lazy":{let h=t._zod.innerType;this.process(h,l),a.ref=h;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),this.io==="input"&&Qe(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=p=>{let l=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let g=n.external.registry.get(p[0])?.id,y=n.external.uri??(w=>w);if(g)return{ref:y(g)};let v=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=v,{defId:v,ref:`${y("__shared")}#/${l}/${v}`}}if(p[1]===o)return{ref:"#"};let f=`#/${l}/`,h=p[1].schema.id??`__schema${this.counter++}`;return{defId:h,ref:f+h}},s=p=>{if(p[1].schema.$ref)return;let l=p[1],{ref:d,defId:f}=i(p);l.def={...l.schema},f&&(l.defId=f);let h=l.schema;for(let g in h)delete h[g];h.$ref=d};if(n.cycles==="throw")for(let p of this.seen.entries()){let l=p[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
30
30
 
31
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let l=p[1];if(t===p[0]){s(p);continue}if(n.external){let f=n.external.registry.get(p[0])?.id;if(t!==p[0]&&f){s(p);continue}}if(this.metadataRegistry.get(p[0])?.id){s(p);continue}if(l.cycle){s(p);continue}if(l.count>1&&n.reused==="ref"){s(p);continue}}let a=(p,l)=>{let d=this.seen.get(p),f=d.def??d.schema,h={...f};if(d.ref===null)return;let g=d.ref;if(d.ref=null,g){a(g,l);let y=this.seen.get(g).schema;y.$ref&&l.target==="draft-7"?(f.allOf=f.allOf??[],f.allOf.push(y)):(Object.assign(f,y),Object.assign(f,h))}d.isParent||this.override({zodSchema:p,jsonSchema:f,path:d.path??[]})};for(let p of[...this.seen.entries()].reverse())a(p[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let p=n.external.registry.get(t)?.id;if(!p)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(p)}Object.assign(c,o.def);let u=n.external?.defs??{};for(let p of this.seen.entries()){let l=p[1];l.def&&l.defId&&(u[l.defId]=l.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}}});var vb=b(()=>{});var Tt=b(()=>{ni();Yp();Wp();$w();bc();nd();Mr();wc();$c();ud();rd();yb();gb();_b();vb()});var xd=b(()=>{Tt()});var ks={};tr(ks,{ZodISODate:()=>bb,ZodISODateTime:()=>wb,ZodISODuration:()=>kb,ZodISOTime:()=>xb,date:()=>Sd,datetime:()=>kd,duration:()=>Pd,time:()=>$d});function kd(e){return Qw(wb,e)}function Sd(e){return Xw(bb,e)}function $d(e){return eb(xb,e)}function Pd(e){return tb(kb,e)}var wb,bb,xb,kb,Ed=b(()=>{Tt();Ac();wb=S("ZodISODateTime",(e,t)=>{Uv.init(e,t),Ie.init(e,t)});bb=S("ZodISODate",(e,t)=>{qv.init(e,t),Ie.init(e,t)});xb=S("ZodISOTime",(e,t)=>{Fv.init(e,t),Ie.init(e,t)});kb=S("ZodISODuration",(e,t)=>{Gv.init(e,t),Ie.init(e,t)})});var $b,I7,Ss,Cd=b(()=>{Tt();Tt();$b=(e,t)=>{gc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>_c(e,r)},flatten:{value:r=>yc(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},I7=S("ZodError",$b),Ss=S("ZodError",$b,{Parent:Error})});var Pb,Eb,Cb,Tb,Td=b(()=>{Tt();Cd();Pb=C_(Ss),Eb=T_(Ss),Cb=Kp(Ss),Tb=Jp(Ss)});function _(e){return Aw(Id,e)}function Ob(e){return pd(Db,e)}function de(e){return rb(Ic,e)}function Rb(e){return ob(QR,e)}function be(e){return ib(zd,e)}function Dd(e){return cb(XR,e)}function jb(){return ub(eI)}function ze(){return lb(tI)}function nI(e){return pb(rI,e)}function T(e,t){return fb(oI,e,t)}function A(e,t){let r={type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},...pe.normalizeParams(t)};return new Lb(r)}function Xe(e,t){return new Lb({type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},catchall:ze(),...pe.normalizeParams(t)})}function Pe(e,t){return new Zb({type:"union",options:e,...pe.normalizeParams(t)})}function Od(e,t,r){return new iI({type:"union",options:t,discriminator:e,...pe.normalizeParams(r)})}function zc(e,t){return new sI({type:"intersection",left:e,right:t})}function De(e,t,r){return new aI({type:"record",keyType:e,valueType:t,...pe.normalizeParams(r)})}function Lt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ad({type:"enum",entries:r,...pe.normalizeParams(t)})}function O(e,t){return new cI({type:"literal",values:Array.isArray(e)?e:[e],...pe.normalizeParams(t)})}function Ub(e){return new uI({type:"transform",transform:e})}function Me(e){return new qb({type:"optional",innerType:e})}function Ib(e){return new lI({type:"nullable",innerType:e})}function dI(e,t){return new pI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function hI(e,t){return new fI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function mI(e,t){return new Fb({type:"nonoptional",innerType:e,...pe.normalizeParams(t)})}function yI(e,t){return new gI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function Rd(e,t){return new _I({type:"pipe",in:e,out:t})}function wI(e){return new vI({type:"readonly",innerType:e})}function bI(e){let t=new _t({check:"custom"});return t._zod.check=e,t}function Bb(e,t){return hb(Gb,e??(()=>!0),t)}function xI(e,t={}){return mb(Gb,e,t)}function kI(e){let t=bI(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(pe.issue(n,r.value,t._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(pe.issue(o))}},e(r.value,r)));return t}function Nd(e,t){return Rd(Ub(e),t)}var $e,zb,Id,Ie,NR,Ab,Rc,Db,jR,MR,LR,ZR,UR,qR,FR,GR,BR,VR,HR,WR,KR,JR,YR,Ic,QR,zd,Nb,XR,eI,tI,rI,Mb,oI,Lb,Zb,iI,sI,aI,Ad,cI,uI,qb,lI,pI,fI,Fb,gI,_I,vI,Gb,Ac=b(()=>{Tt();Tt();xd();Ed();Td();$e=S("ZodType",(e,t)=>(he.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>nr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Pb(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Cb(e,r,n),e.parseAsync=async(r,n)=>Eb(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Tb(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(xI(r,n)),e.superRefine=r=>e.check(kI(r)),e.overwrite=r=>e.check(po(r)),e.optional=()=>Me(e),e.nullable=()=>Ib(e),e.nullish=()=>Me(Ib(e)),e.nonoptional=r=>mI(e,r),e.array=()=>T(e),e.or=r=>Pe([e,r]),e.and=r=>zc(e,r),e.transform=r=>Rd(e,Ub(r)),e.default=r=>dI(e,r),e.prefault=r=>hI(e,r),e.catch=r=>yI(e,r),e.pipe=r=>Rd(e,r),e.readonly=()=>wI(e),e.describe=r=>{let n=e.clone();return nn.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return nn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return nn.get(e);let n=e.clone();return nn.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),zb=S("_ZodString",(e,t)=>{Sc.init(e,t),$e.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(dd(...n)),e.includes=(...n)=>e.check(md(...n)),e.startsWith=(...n)=>e.check(gd(...n)),e.endsWith=(...n)=>e.check(yd(...n)),e.min=(...n)=>e.check(ci(...n)),e.max=(...n)=>e.check(Pc(...n)),e.length=(...n)=>e.check(Ec(...n)),e.nonempty=(...n)=>e.check(ci(1,...n)),e.lowercase=n=>e.check(fd(n)),e.uppercase=n=>e.check(hd(n)),e.trim=()=>e.check(vd()),e.normalize=(...n)=>e.check(_d(...n)),e.toLowerCase=()=>e.check(wd()),e.toUpperCase=()=>e.check(bd())}),Id=S("ZodString",(e,t)=>{Sc.init(e,t),zb.init(e,t),e.email=r=>e.check(Iw(NR,r)),e.url=r=>e.check(pd(Db,r)),e.jwt=r=>e.check(Yw(YR,r)),e.emoji=r=>e.check(jw(jR,r)),e.guid=r=>e.check(ld(Ab,r)),e.uuid=r=>e.check(zw(Rc,r)),e.uuidv4=r=>e.check(Dw(Rc,r)),e.uuidv6=r=>e.check(Ow(Rc,r)),e.uuidv7=r=>e.check(Nw(Rc,r)),e.nanoid=r=>e.check(Mw(MR,r)),e.guid=r=>e.check(ld(Ab,r)),e.cuid=r=>e.check(Lw(LR,r)),e.cuid2=r=>e.check(Zw(ZR,r)),e.ulid=r=>e.check(Uw(UR,r)),e.base64=r=>e.check(Ww(WR,r)),e.base64url=r=>e.check(Kw(KR,r)),e.xid=r=>e.check(qw(qR,r)),e.ksuid=r=>e.check(Fw(FR,r)),e.ipv4=r=>e.check(Gw(GR,r)),e.ipv6=r=>e.check(Bw(BR,r)),e.cidrv4=r=>e.check(Vw(VR,r)),e.cidrv6=r=>e.check(Hw(HR,r)),e.e164=r=>e.check(Jw(JR,r)),e.datetime=r=>e.check(kd(r)),e.date=r=>e.check(Sd(r)),e.time=r=>e.check($d(r)),e.duration=r=>e.check(Pd(r))});Ie=S("ZodStringFormat",(e,t)=>{Ce.init(e,t),zb.init(e,t)}),NR=S("ZodEmail",(e,t)=>{Iv.init(e,t),Ie.init(e,t)}),Ab=S("ZodGUID",(e,t)=>{Av.init(e,t),Ie.init(e,t)}),Rc=S("ZodUUID",(e,t)=>{Rv.init(e,t),Ie.init(e,t)}),Db=S("ZodURL",(e,t)=>{zv.init(e,t),Ie.init(e,t)});jR=S("ZodEmoji",(e,t)=>{Dv.init(e,t),Ie.init(e,t)}),MR=S("ZodNanoID",(e,t)=>{Ov.init(e,t),Ie.init(e,t)}),LR=S("ZodCUID",(e,t)=>{Nv.init(e,t),Ie.init(e,t)}),ZR=S("ZodCUID2",(e,t)=>{jv.init(e,t),Ie.init(e,t)}),UR=S("ZodULID",(e,t)=>{Mv.init(e,t),Ie.init(e,t)}),qR=S("ZodXID",(e,t)=>{Lv.init(e,t),Ie.init(e,t)}),FR=S("ZodKSUID",(e,t)=>{Zv.init(e,t),Ie.init(e,t)}),GR=S("ZodIPv4",(e,t)=>{Bv.init(e,t),Ie.init(e,t)}),BR=S("ZodIPv6",(e,t)=>{Vv.init(e,t),Ie.init(e,t)}),VR=S("ZodCIDRv4",(e,t)=>{Hv.init(e,t),Ie.init(e,t)}),HR=S("ZodCIDRv6",(e,t)=>{Wv.init(e,t),Ie.init(e,t)}),WR=S("ZodBase64",(e,t)=>{Jv.init(e,t),Ie.init(e,t)}),KR=S("ZodBase64URL",(e,t)=>{Yv.init(e,t),Ie.init(e,t)}),JR=S("ZodE164",(e,t)=>{Qv.init(e,t),Ie.init(e,t)}),YR=S("ZodJWT",(e,t)=>{Xv.init(e,t),Ie.init(e,t)}),Ic=S("ZodNumber",(e,t)=>{id.init(e,t),$e.init(e,t),e.gt=(n,o)=>e.check(ai(n,o)),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.lt=(n,o)=>e.check(si(n,o)),e.lte=(n,o)=>e.check(on(n,o)),e.max=(n,o)=>e.check(on(n,o)),e.int=n=>e.check(Rb(n)),e.safe=n=>e.check(Rb(n)),e.positive=n=>e.check(ai(0,n)),e.nonnegative=n=>e.check(wr(0,n)),e.negative=n=>e.check(si(0,n)),e.nonpositive=n=>e.check(on(0,n)),e.multipleOf=(n,o)=>e.check(xs(n,o)),e.step=(n,o)=>e.check(xs(n,o)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});QR=S("ZodNumberFormat",(e,t)=>{ew.init(e,t),Ic.init(e,t)});zd=S("ZodBoolean",(e,t)=>{tw.init(e,t),$e.init(e,t)});Nb=S("ZodBigInt",(e,t)=>{rw.init(e,t),$e.init(e,t),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.gt=(n,o)=>e.check(ai(n,o)),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.lt=(n,o)=>e.check(si(n,o)),e.lte=(n,o)=>e.check(on(n,o)),e.max=(n,o)=>e.check(on(n,o)),e.positive=n=>e.check(ai(BigInt(0),n)),e.negative=n=>e.check(si(BigInt(0),n)),e.nonpositive=n=>e.check(on(BigInt(0),n)),e.nonnegative=n=>e.check(wr(BigInt(0),n)),e.multipleOf=(n,o)=>e.check(xs(n,o));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null}),XR=S("ZodNull",(e,t)=>{nw.init(e,t),$e.init(e,t)});eI=S("ZodAny",(e,t)=>{ow.init(e,t),$e.init(e,t)});tI=S("ZodUnknown",(e,t)=>{iw.init(e,t),$e.init(e,t)});rI=S("ZodNever",(e,t)=>{sw.init(e,t),$e.init(e,t)});Mb=S("ZodDate",(e,t)=>{aw.init(e,t),$e.init(e,t),e.min=(n,o)=>e.check(wr(n,o)),e.max=(n,o)=>e.check(on(n,o));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null}),oI=S("ZodArray",(e,t)=>{cw.init(e,t),$e.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ci(r,n)),e.nonempty=r=>e.check(ci(1,r)),e.max=(r,n)=>e.check(Pc(r,n)),e.length=(r,n)=>e.check(Ec(r,n)),e.unwrap=()=>e.element});Lb=S("ZodObject",(e,t)=>{uw.init(e,t),$e.init(e,t),pe.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Lt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ze()}),e.loose=()=>e.clone({...e._zod.def,catchall:ze()}),e.strict=()=>e.clone({...e._zod.def,catchall:nI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>pe.extend(e,r),e.merge=r=>pe.merge(e,r),e.pick=r=>pe.pick(e,r),e.omit=r=>pe.omit(e,r),e.partial=(...r)=>pe.partial(qb,e,r[0]),e.required=(...r)=>pe.required(Fb,e,r[0])});Zb=S("ZodUnion",(e,t)=>{sd.init(e,t),$e.init(e,t),e.options=t.options});iI=S("ZodDiscriminatedUnion",(e,t)=>{Zb.init(e,t),lw.init(e,t)});sI=S("ZodIntersection",(e,t)=>{pw.init(e,t),$e.init(e,t)});aI=S("ZodRecord",(e,t)=>{dw.init(e,t),$e.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});Ad=S("ZodEnum",(e,t)=>{fw.init(e,t),$e.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Ad({...t,checks:[],...pe.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Ad({...t,checks:[],...pe.normalizeParams(o),entries:i})}});cI=S("ZodLiteral",(e,t)=>{hw.init(e,t),$e.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});uI=S("ZodTransform",(e,t)=>{mw.init(e,t),$e.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(pe.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(pe.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});qb=S("ZodOptional",(e,t)=>{gw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});lI=S("ZodNullable",(e,t)=>{yw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});pI=S("ZodDefault",(e,t)=>{_w.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});fI=S("ZodPrefault",(e,t)=>{vw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});Fb=S("ZodNonOptional",(e,t)=>{ww.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});gI=S("ZodCatch",(e,t)=>{bw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});_I=S("ZodPipe",(e,t)=>{xw.init(e,t),$e.init(e,t),e.in=t.in,e.out=t.out});vI=S("ZodReadonly",(e,t)=>{kw.init(e,t),$e.init(e,t)});Gb=S("ZodCustom",(e,t)=>{Sw.init(e,t),$e.init(e,t)})});var Vb,Hb=b(()=>{Vb={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"}});var Dc={};tr(Dc,{bigint:()=>EI,boolean:()=>PI,date:()=>CI,number:()=>$I,string:()=>SI});function SI(e){return Rw(Id,e)}function $I(e){return nb(Ic,e)}function PI(e){return sb(zd,e)}function EI(e){return ab(Nb,e)}function CI(e){return db(Mb,e)}var Wb=b(()=>{Tt();Ac()});var Kb=b(()=>{Tt();Ac();xd();Cd();Td();Hb();Tt();Ew();Tt();$c();Ed();Wb();Mt(Pw())});var Jb=b(()=>{Kb()});var jd=b(()=>{Jb()});var li,Qb,Tn,Nc,at,Xb,e0,SB,zI,DI,Ld,Wt,$s,t0,ct,or,ir,ut,jc,r0,ho,n0,o0,Zd,mo,ee,Ud,i0,pi,$B,Mc,OI,Lc,NI,Ps,ui,s0,jI,MI,LI,ZI,UI,qI,qd,FI,GI,Zc,a0,Uc,BI,VI,qc,HI,Es,Cs,WI,Ts,di,KI,As,Fc,Gc,Bc,PB,Vc,Hc,Wc,c0,u0,l0,Fd,p0,Rs,fi,d0,JI,Gd,YI,QI,XI,Bd,ez,Vd,tz,rz,nz,oz,iz,sz,az,cz,uz,lz,Hd,pz,dz,Wd,Kd,Jd,Yd,fz,hz,mz,Qd,gz,yz,_z,vz,wz,f0,Xd,bz,Kc,EB,xz,Is,kz,CB,zs,Sz,ef,$z,Pz,Ez,Cz,Tz,Az,Rz,Oc,Iz,zz,Dz,tf,rf,Oz,Nz,jz,Mz,Lz,Zz,Uz,qz,Fz,Gz,Bz,Vz,Hz,Wz,Kz,Jz,Yz,Qz,Jc,Xz,eD,tD,rD,nD,oD,iD,nf,sD,TB,AB,RB,IB,zB,DB,V,Md,An=b(()=>{jd();li="2025-11-25",Qb=[li,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Tn="io.modelcontextprotocol/related-task",Nc="2.0",at=Bb(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Xb=Pe([_(),de().int()]),e0=_(),SB=Xe({ttl:Pe([de(),Dd()]).optional(),pollInterval:de().optional()}),zI=A({ttl:de().optional()}),DI=A({taskId:_()}),Ld=Xe({progressToken:Xb.optional(),[Tn]:DI.optional()}),Wt=A({_meta:Ld.optional()}),$s=Wt.extend({task:zI.optional()}),t0=e=>$s.safeParse(e).success,ct=A({method:_(),params:Wt.loose().optional()}),or=A({_meta:Ld.optional()}),ir=A({method:_(),params:or.loose().optional()}),ut=Xe({_meta:Ld.optional()}),jc=Pe([_(),de().int()]),r0=A({jsonrpc:O(Nc),id:jc,...ct.shape}).strict(),ho=e=>r0.safeParse(e).success,n0=A({jsonrpc:O(Nc),...ir.shape}).strict(),o0=e=>n0.safeParse(e).success,Zd=A({jsonrpc:O(Nc),id:jc,result:ut}).strict(),mo=e=>Zd.safeParse(e).success;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ee||(ee={}));Ud=A({jsonrpc:O(Nc),id:jc.optional(),error:A({code:de().int(),message:_(),data:ze().optional()})}).strict(),i0=e=>Ud.safeParse(e).success,pi=Pe([r0,n0,Zd,Ud]),$B=Pe([Zd,Ud]),Mc=ut.strict(),OI=or.extend({requestId:jc.optional(),reason:_().optional()}),Lc=ir.extend({method:O("notifications/cancelled"),params:OI}),NI=A({src:_(),mimeType:_().optional(),sizes:T(_()).optional(),theme:Lt(["light","dark"]).optional()}),Ps=A({icons:T(NI).optional()}),ui=A({name:_(),title:_().optional()}),s0=ui.extend({...ui.shape,...Ps.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),jI=zc(A({applyDefaults:be().optional()}),De(_(),ze())),MI=Nd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,zc(A({form:jI.optional(),url:at.optional()}),De(_(),ze()).optional())),LI=Xe({list:at.optional(),cancel:at.optional(),requests:Xe({sampling:Xe({createMessage:at.optional()}).optional(),elicitation:Xe({create:at.optional()}).optional()}).optional()}),ZI=Xe({list:at.optional(),cancel:at.optional(),requests:Xe({tools:Xe({call:at.optional()}).optional()}).optional()}),UI=A({experimental:De(_(),at).optional(),sampling:A({context:at.optional(),tools:at.optional()}).optional(),elicitation:MI.optional(),roots:A({listChanged:be().optional()}).optional(),tasks:LI.optional()}),qI=Wt.extend({protocolVersion:_(),capabilities:UI,clientInfo:s0}),qd=ct.extend({method:O("initialize"),params:qI}),FI=A({experimental:De(_(),at).optional(),logging:at.optional(),completions:at.optional(),prompts:A({listChanged:be().optional()}).optional(),resources:A({subscribe:be().optional(),listChanged:be().optional()}).optional(),tools:A({listChanged:be().optional()}).optional(),tasks:ZI.optional()}),GI=ut.extend({protocolVersion:_(),capabilities:FI,serverInfo:s0,instructions:_().optional()}),Zc=ir.extend({method:O("notifications/initialized"),params:or.optional()}),a0=e=>Zc.safeParse(e).success,Uc=ct.extend({method:O("ping"),params:Wt.optional()}),BI=A({progress:de(),total:Me(de()),message:Me(_())}),VI=A({...or.shape,...BI.shape,progressToken:Xb}),qc=ir.extend({method:O("notifications/progress"),params:VI}),HI=Wt.extend({cursor:e0.optional()}),Es=ct.extend({params:HI.optional()}),Cs=ut.extend({nextCursor:e0.optional()}),WI=Lt(["working","input_required","completed","failed","cancelled"]),Ts=A({taskId:_(),status:WI,ttl:Pe([de(),Dd()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:Me(de()),statusMessage:Me(_())}),di=ut.extend({task:Ts}),KI=or.merge(Ts),As=ir.extend({method:O("notifications/tasks/status"),params:KI}),Fc=ct.extend({method:O("tasks/get"),params:Wt.extend({taskId:_()})}),Gc=ut.merge(Ts),Bc=ct.extend({method:O("tasks/result"),params:Wt.extend({taskId:_()})}),PB=ut.loose(),Vc=Es.extend({method:O("tasks/list")}),Hc=Cs.extend({tasks:T(Ts)}),Wc=ct.extend({method:O("tasks/cancel"),params:Wt.extend({taskId:_()})}),c0=ut.merge(Ts),u0=A({uri:_(),mimeType:Me(_()),_meta:De(_(),ze()).optional()}),l0=u0.extend({text:_()}),Fd=_().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),p0=u0.extend({blob:Fd}),Rs=Lt(["user","assistant"]),fi=A({audience:T(Rs).optional(),priority:de().min(0).max(1).optional(),lastModified:ks.datetime({offset:!0}).optional()}),d0=A({...ui.shape,...Ps.shape,uri:_(),description:Me(_()),mimeType:Me(_()),annotations:fi.optional(),_meta:Me(Xe({}))}),JI=A({...ui.shape,...Ps.shape,uriTemplate:_(),description:Me(_()),mimeType:Me(_()),annotations:fi.optional(),_meta:Me(Xe({}))}),Gd=Es.extend({method:O("resources/list")}),YI=Cs.extend({resources:T(d0)}),QI=Es.extend({method:O("resources/templates/list")}),XI=Cs.extend({resourceTemplates:T(JI)}),Bd=Wt.extend({uri:_()}),ez=Bd,Vd=ct.extend({method:O("resources/read"),params:ez}),tz=ut.extend({contents:T(Pe([l0,p0]))}),rz=ir.extend({method:O("notifications/resources/list_changed"),params:or.optional()}),nz=Bd,oz=ct.extend({method:O("resources/subscribe"),params:nz}),iz=Bd,sz=ct.extend({method:O("resources/unsubscribe"),params:iz}),az=or.extend({uri:_()}),cz=ir.extend({method:O("notifications/resources/updated"),params:az}),uz=A({name:_(),description:Me(_()),required:Me(be())}),lz=A({...ui.shape,...Ps.shape,description:Me(_()),arguments:Me(T(uz)),_meta:Me(Xe({}))}),Hd=Es.extend({method:O("prompts/list")}),pz=Cs.extend({prompts:T(lz)}),dz=Wt.extend({name:_(),arguments:De(_(),_()).optional()}),Wd=ct.extend({method:O("prompts/get"),params:dz}),Kd=A({type:O("text"),text:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),Jd=A({type:O("image"),data:Fd,mimeType:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),Yd=A({type:O("audio"),data:Fd,mimeType:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),fz=A({type:O("tool_use"),name:_(),id:_(),input:De(_(),ze()),_meta:De(_(),ze()).optional()}),hz=A({type:O("resource"),resource:Pe([l0,p0]),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),mz=d0.extend({type:O("resource_link")}),Qd=Pe([Kd,Jd,Yd,mz,hz]),gz=A({role:Rs,content:Qd}),yz=ut.extend({description:_().optional(),messages:T(gz)}),_z=ir.extend({method:O("notifications/prompts/list_changed"),params:or.optional()}),vz=A({title:_().optional(),readOnlyHint:be().optional(),destructiveHint:be().optional(),idempotentHint:be().optional(),openWorldHint:be().optional()}),wz=A({taskSupport:Lt(["required","optional","forbidden"]).optional()}),f0=A({...ui.shape,...Ps.shape,description:_().optional(),inputSchema:A({type:O("object"),properties:De(_(),at).optional(),required:T(_()).optional()}).catchall(ze()),outputSchema:A({type:O("object"),properties:De(_(),at).optional(),required:T(_()).optional()}).catchall(ze()).optional(),annotations:vz.optional(),execution:wz.optional(),_meta:De(_(),ze()).optional()}),Xd=Es.extend({method:O("tools/list")}),bz=Cs.extend({tools:T(f0)}),Kc=ut.extend({content:T(Qd).default([]),structuredContent:De(_(),ze()).optional(),isError:be().optional()}),EB=Kc.or(ut.extend({toolResult:ze()})),xz=$s.extend({name:_(),arguments:De(_(),ze()).optional()}),Is=ct.extend({method:O("tools/call"),params:xz}),kz=ir.extend({method:O("notifications/tools/list_changed"),params:or.optional()}),CB=A({autoRefresh:be().default(!0),debounceMs:de().int().nonnegative().default(300)}),zs=Lt(["debug","info","notice","warning","error","critical","alert","emergency"]),Sz=Wt.extend({level:zs}),ef=ct.extend({method:O("logging/setLevel"),params:Sz}),$z=or.extend({level:zs,logger:_().optional(),data:ze()}),Pz=ir.extend({method:O("notifications/message"),params:$z}),Ez=A({name:_().optional()}),Cz=A({hints:T(Ez).optional(),costPriority:de().min(0).max(1).optional(),speedPriority:de().min(0).max(1).optional(),intelligencePriority:de().min(0).max(1).optional()}),Tz=A({mode:Lt(["auto","required","none"]).optional()}),Az=A({type:O("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:T(Qd).default([]),structuredContent:A({}).loose().optional(),isError:be().optional(),_meta:De(_(),ze()).optional()}),Rz=Od("type",[Kd,Jd,Yd]),Oc=Od("type",[Kd,Jd,Yd,fz,Az]),Iz=A({role:Rs,content:Pe([Oc,T(Oc)]),_meta:De(_(),ze()).optional()}),zz=$s.extend({messages:T(Iz),modelPreferences:Cz.optional(),systemPrompt:_().optional(),includeContext:Lt(["none","thisServer","allServers"]).optional(),temperature:de().optional(),maxTokens:de().int(),stopSequences:T(_()).optional(),metadata:at.optional(),tools:T(f0).optional(),toolChoice:Tz.optional()}),Dz=ct.extend({method:O("sampling/createMessage"),params:zz}),tf=ut.extend({model:_(),stopReason:Me(Lt(["endTurn","stopSequence","maxTokens"]).or(_())),role:Rs,content:Rz}),rf=ut.extend({model:_(),stopReason:Me(Lt(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:Rs,content:Pe([Oc,T(Oc)])}),Oz=A({type:O("boolean"),title:_().optional(),description:_().optional(),default:be().optional()}),Nz=A({type:O("string"),title:_().optional(),description:_().optional(),minLength:de().optional(),maxLength:de().optional(),format:Lt(["email","uri","date","date-time"]).optional(),default:_().optional()}),jz=A({type:Lt(["number","integer"]),title:_().optional(),description:_().optional(),minimum:de().optional(),maximum:de().optional(),default:de().optional()}),Mz=A({type:O("string"),title:_().optional(),description:_().optional(),enum:T(_()),default:_().optional()}),Lz=A({type:O("string"),title:_().optional(),description:_().optional(),oneOf:T(A({const:_(),title:_()})),default:_().optional()}),Zz=A({type:O("string"),title:_().optional(),description:_().optional(),enum:T(_()),enumNames:T(_()).optional(),default:_().optional()}),Uz=Pe([Mz,Lz]),qz=A({type:O("array"),title:_().optional(),description:_().optional(),minItems:de().optional(),maxItems:de().optional(),items:A({type:O("string"),enum:T(_())}),default:T(_()).optional()}),Fz=A({type:O("array"),title:_().optional(),description:_().optional(),minItems:de().optional(),maxItems:de().optional(),items:A({anyOf:T(A({const:_(),title:_()}))}),default:T(_()).optional()}),Gz=Pe([qz,Fz]),Bz=Pe([Zz,Uz,Gz]),Vz=Pe([Bz,Oz,Nz,jz]),Hz=$s.extend({mode:O("form").optional(),message:_(),requestedSchema:A({type:O("object"),properties:De(_(),Vz),required:T(_()).optional()})}),Wz=$s.extend({mode:O("url"),message:_(),elicitationId:_(),url:_().url()}),Kz=Pe([Hz,Wz]),Jz=ct.extend({method:O("elicitation/create"),params:Kz}),Yz=or.extend({elicitationId:_()}),Qz=ir.extend({method:O("notifications/elicitation/complete"),params:Yz}),Jc=ut.extend({action:Lt(["accept","decline","cancel"]),content:Nd(e=>e===null?void 0:e,De(_(),Pe([_(),de(),be(),T(_())])).optional())}),Xz=A({type:O("ref/resource"),uri:_()}),eD=A({type:O("ref/prompt"),name:_()}),tD=Wt.extend({ref:Pe([eD,Xz]),argument:A({name:_(),value:_()}),context:A({arguments:De(_(),_()).optional()}).optional()}),rD=ct.extend({method:O("completion/complete"),params:tD}),nD=ut.extend({completion:Xe({values:T(_()).max(100),total:Me(de().int()),hasMore:Me(be())})}),oD=A({uri:_().startsWith("file://"),name:_().optional(),_meta:De(_(),ze()).optional()}),iD=ct.extend({method:O("roots/list"),params:Wt.optional()}),nf=ut.extend({roots:T(oD)}),sD=ir.extend({method:O("notifications/roots/list_changed"),params:or.optional()}),TB=Pe([Uc,qd,rD,ef,Wd,Hd,Gd,QI,Vd,oz,sz,Is,Xd,Fc,Bc,Vc,Wc]),AB=Pe([Lc,qc,Zc,sD,As]),RB=Pe([Mc,tf,rf,Jc,nf,Gc,Hc,di]),IB=Pe([Uc,Dz,Jz,iD,Fc,Bc,Vc,Wc]),zB=Pe([Lc,qc,Pz,cz,rz,kz,_z,As,Qz]),DB=Pe([Mc,GI,nD,yz,pz,YI,XI,tz,Kc,bz,Gc,Hc,di]),V=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===ee.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Md(o.elicitations,r)}return new e(t,r,n)}},Md=class extends V{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(ee.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}});function aD(e){return pi.parse(JSON.parse(e))}function h0(e){return JSON.stringify(e)+`
31
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let l=p[1];if(t===p[0]){s(p);continue}if(n.external){let f=n.external.registry.get(p[0])?.id;if(t!==p[0]&&f){s(p);continue}}if(this.metadataRegistry.get(p[0])?.id){s(p);continue}if(l.cycle){s(p);continue}if(l.count>1&&n.reused==="ref"){s(p);continue}}let a=(p,l)=>{let d=this.seen.get(p),f=d.def??d.schema,h={...f};if(d.ref===null)return;let g=d.ref;if(d.ref=null,g){a(g,l);let y=this.seen.get(g).schema;y.$ref&&l.target==="draft-7"?(f.allOf=f.allOf??[],f.allOf.push(y)):(Object.assign(f,y),Object.assign(f,h))}d.isParent||this.override({zodSchema:p,jsonSchema:f,path:d.path??[]})};for(let p of[...this.seen.entries()].reverse())a(p[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let p=n.external.registry.get(t)?.id;if(!p)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(p)}Object.assign(c,o.def);let u=n.external?.defs??{};for(let p of this.seen.entries()){let l=p[1];l.def&&l.defId&&(u[l.defId]=l.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}}});var vb=b(()=>{});var Tt=b(()=>{ni();Yp();Wp();$w();bc();nd();Mr();wc();$c();ud();rd();yb();gb();_b();vb()});var xd=b(()=>{Tt()});var ks={};tr(ks,{ZodISODate:()=>bb,ZodISODateTime:()=>wb,ZodISODuration:()=>kb,ZodISOTime:()=>xb,date:()=>Sd,datetime:()=>kd,duration:()=>Pd,time:()=>$d});function kd(e){return Qw(wb,e)}function Sd(e){return Xw(bb,e)}function $d(e){return eb(xb,e)}function Pd(e){return tb(kb,e)}var wb,bb,xb,kb,Ed=b(()=>{Tt();Ac();wb=S("ZodISODateTime",(e,t)=>{Uv.init(e,t),Ie.init(e,t)});bb=S("ZodISODate",(e,t)=>{qv.init(e,t),Ie.init(e,t)});xb=S("ZodISOTime",(e,t)=>{Fv.init(e,t),Ie.init(e,t)});kb=S("ZodISODuration",(e,t)=>{Gv.init(e,t),Ie.init(e,t)})});var $b,D7,Ss,Cd=b(()=>{Tt();Tt();$b=(e,t)=>{gc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>_c(e,r)},flatten:{value:r=>yc(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},D7=S("ZodError",$b),Ss=S("ZodError",$b,{Parent:Error})});var Pb,Eb,Cb,Tb,Td=b(()=>{Tt();Cd();Pb=C_(Ss),Eb=T_(Ss),Cb=Kp(Ss),Tb=Jp(Ss)});function _(e){return Aw(Id,e)}function Ob(e){return pd(Db,e)}function de(e){return rb(Ic,e)}function Rb(e){return ob(QR,e)}function be(e){return ib(zd,e)}function Dd(e){return cb(XR,e)}function jb(){return ub(eI)}function ze(){return lb(tI)}function nI(e){return pb(rI,e)}function T(e,t){return fb(oI,e,t)}function A(e,t){let r={type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},...pe.normalizeParams(t)};return new Lb(r)}function Xe(e,t){return new Lb({type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},catchall:ze(),...pe.normalizeParams(t)})}function Pe(e,t){return new Zb({type:"union",options:e,...pe.normalizeParams(t)})}function Od(e,t,r){return new iI({type:"union",options:t,discriminator:e,...pe.normalizeParams(r)})}function zc(e,t){return new sI({type:"intersection",left:e,right:t})}function De(e,t,r){return new aI({type:"record",keyType:e,valueType:t,...pe.normalizeParams(r)})}function Lt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ad({type:"enum",entries:r,...pe.normalizeParams(t)})}function O(e,t){return new cI({type:"literal",values:Array.isArray(e)?e:[e],...pe.normalizeParams(t)})}function Ub(e){return new uI({type:"transform",transform:e})}function Me(e){return new qb({type:"optional",innerType:e})}function Ib(e){return new lI({type:"nullable",innerType:e})}function dI(e,t){return new pI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function hI(e,t){return new fI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function mI(e,t){return new Fb({type:"nonoptional",innerType:e,...pe.normalizeParams(t)})}function yI(e,t){return new gI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function Rd(e,t){return new _I({type:"pipe",in:e,out:t})}function wI(e){return new vI({type:"readonly",innerType:e})}function bI(e){let t=new _t({check:"custom"});return t._zod.check=e,t}function Bb(e,t){return hb(Gb,e??(()=>!0),t)}function xI(e,t={}){return mb(Gb,e,t)}function kI(e){let t=bI(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(pe.issue(n,r.value,t._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(pe.issue(o))}},e(r.value,r)));return t}function Nd(e,t){return Rd(Ub(e),t)}var $e,zb,Id,Ie,NR,Ab,Rc,Db,jR,MR,LR,ZR,UR,qR,FR,GR,BR,VR,HR,WR,KR,JR,YR,Ic,QR,zd,Nb,XR,eI,tI,rI,Mb,oI,Lb,Zb,iI,sI,aI,Ad,cI,uI,qb,lI,pI,fI,Fb,gI,_I,vI,Gb,Ac=b(()=>{Tt();Tt();xd();Ed();Td();$e=S("ZodType",(e,t)=>(he.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>nr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Pb(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Cb(e,r,n),e.parseAsync=async(r,n)=>Eb(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Tb(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(xI(r,n)),e.superRefine=r=>e.check(kI(r)),e.overwrite=r=>e.check(po(r)),e.optional=()=>Me(e),e.nullable=()=>Ib(e),e.nullish=()=>Me(Ib(e)),e.nonoptional=r=>mI(e,r),e.array=()=>T(e),e.or=r=>Pe([e,r]),e.and=r=>zc(e,r),e.transform=r=>Rd(e,Ub(r)),e.default=r=>dI(e,r),e.prefault=r=>hI(e,r),e.catch=r=>yI(e,r),e.pipe=r=>Rd(e,r),e.readonly=()=>wI(e),e.describe=r=>{let n=e.clone();return nn.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return nn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return nn.get(e);let n=e.clone();return nn.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),zb=S("_ZodString",(e,t)=>{Sc.init(e,t),$e.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(dd(...n)),e.includes=(...n)=>e.check(md(...n)),e.startsWith=(...n)=>e.check(gd(...n)),e.endsWith=(...n)=>e.check(yd(...n)),e.min=(...n)=>e.check(ci(...n)),e.max=(...n)=>e.check(Pc(...n)),e.length=(...n)=>e.check(Ec(...n)),e.nonempty=(...n)=>e.check(ci(1,...n)),e.lowercase=n=>e.check(fd(n)),e.uppercase=n=>e.check(hd(n)),e.trim=()=>e.check(vd()),e.normalize=(...n)=>e.check(_d(...n)),e.toLowerCase=()=>e.check(wd()),e.toUpperCase=()=>e.check(bd())}),Id=S("ZodString",(e,t)=>{Sc.init(e,t),zb.init(e,t),e.email=r=>e.check(Iw(NR,r)),e.url=r=>e.check(pd(Db,r)),e.jwt=r=>e.check(Yw(YR,r)),e.emoji=r=>e.check(jw(jR,r)),e.guid=r=>e.check(ld(Ab,r)),e.uuid=r=>e.check(zw(Rc,r)),e.uuidv4=r=>e.check(Dw(Rc,r)),e.uuidv6=r=>e.check(Ow(Rc,r)),e.uuidv7=r=>e.check(Nw(Rc,r)),e.nanoid=r=>e.check(Mw(MR,r)),e.guid=r=>e.check(ld(Ab,r)),e.cuid=r=>e.check(Lw(LR,r)),e.cuid2=r=>e.check(Zw(ZR,r)),e.ulid=r=>e.check(Uw(UR,r)),e.base64=r=>e.check(Ww(WR,r)),e.base64url=r=>e.check(Kw(KR,r)),e.xid=r=>e.check(qw(qR,r)),e.ksuid=r=>e.check(Fw(FR,r)),e.ipv4=r=>e.check(Gw(GR,r)),e.ipv6=r=>e.check(Bw(BR,r)),e.cidrv4=r=>e.check(Vw(VR,r)),e.cidrv6=r=>e.check(Hw(HR,r)),e.e164=r=>e.check(Jw(JR,r)),e.datetime=r=>e.check(kd(r)),e.date=r=>e.check(Sd(r)),e.time=r=>e.check($d(r)),e.duration=r=>e.check(Pd(r))});Ie=S("ZodStringFormat",(e,t)=>{Ce.init(e,t),zb.init(e,t)}),NR=S("ZodEmail",(e,t)=>{Iv.init(e,t),Ie.init(e,t)}),Ab=S("ZodGUID",(e,t)=>{Av.init(e,t),Ie.init(e,t)}),Rc=S("ZodUUID",(e,t)=>{Rv.init(e,t),Ie.init(e,t)}),Db=S("ZodURL",(e,t)=>{zv.init(e,t),Ie.init(e,t)});jR=S("ZodEmoji",(e,t)=>{Dv.init(e,t),Ie.init(e,t)}),MR=S("ZodNanoID",(e,t)=>{Ov.init(e,t),Ie.init(e,t)}),LR=S("ZodCUID",(e,t)=>{Nv.init(e,t),Ie.init(e,t)}),ZR=S("ZodCUID2",(e,t)=>{jv.init(e,t),Ie.init(e,t)}),UR=S("ZodULID",(e,t)=>{Mv.init(e,t),Ie.init(e,t)}),qR=S("ZodXID",(e,t)=>{Lv.init(e,t),Ie.init(e,t)}),FR=S("ZodKSUID",(e,t)=>{Zv.init(e,t),Ie.init(e,t)}),GR=S("ZodIPv4",(e,t)=>{Bv.init(e,t),Ie.init(e,t)}),BR=S("ZodIPv6",(e,t)=>{Vv.init(e,t),Ie.init(e,t)}),VR=S("ZodCIDRv4",(e,t)=>{Hv.init(e,t),Ie.init(e,t)}),HR=S("ZodCIDRv6",(e,t)=>{Wv.init(e,t),Ie.init(e,t)}),WR=S("ZodBase64",(e,t)=>{Jv.init(e,t),Ie.init(e,t)}),KR=S("ZodBase64URL",(e,t)=>{Yv.init(e,t),Ie.init(e,t)}),JR=S("ZodE164",(e,t)=>{Qv.init(e,t),Ie.init(e,t)}),YR=S("ZodJWT",(e,t)=>{Xv.init(e,t),Ie.init(e,t)}),Ic=S("ZodNumber",(e,t)=>{id.init(e,t),$e.init(e,t),e.gt=(n,o)=>e.check(ai(n,o)),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.lt=(n,o)=>e.check(si(n,o)),e.lte=(n,o)=>e.check(on(n,o)),e.max=(n,o)=>e.check(on(n,o)),e.int=n=>e.check(Rb(n)),e.safe=n=>e.check(Rb(n)),e.positive=n=>e.check(ai(0,n)),e.nonnegative=n=>e.check(wr(0,n)),e.negative=n=>e.check(si(0,n)),e.nonpositive=n=>e.check(on(0,n)),e.multipleOf=(n,o)=>e.check(xs(n,o)),e.step=(n,o)=>e.check(xs(n,o)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});QR=S("ZodNumberFormat",(e,t)=>{ew.init(e,t),Ic.init(e,t)});zd=S("ZodBoolean",(e,t)=>{tw.init(e,t),$e.init(e,t)});Nb=S("ZodBigInt",(e,t)=>{rw.init(e,t),$e.init(e,t),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.gt=(n,o)=>e.check(ai(n,o)),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.lt=(n,o)=>e.check(si(n,o)),e.lte=(n,o)=>e.check(on(n,o)),e.max=(n,o)=>e.check(on(n,o)),e.positive=n=>e.check(ai(BigInt(0),n)),e.negative=n=>e.check(si(BigInt(0),n)),e.nonpositive=n=>e.check(on(BigInt(0),n)),e.nonnegative=n=>e.check(wr(BigInt(0),n)),e.multipleOf=(n,o)=>e.check(xs(n,o));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null}),XR=S("ZodNull",(e,t)=>{nw.init(e,t),$e.init(e,t)});eI=S("ZodAny",(e,t)=>{ow.init(e,t),$e.init(e,t)});tI=S("ZodUnknown",(e,t)=>{iw.init(e,t),$e.init(e,t)});rI=S("ZodNever",(e,t)=>{sw.init(e,t),$e.init(e,t)});Mb=S("ZodDate",(e,t)=>{aw.init(e,t),$e.init(e,t),e.min=(n,o)=>e.check(wr(n,o)),e.max=(n,o)=>e.check(on(n,o));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null}),oI=S("ZodArray",(e,t)=>{cw.init(e,t),$e.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ci(r,n)),e.nonempty=r=>e.check(ci(1,r)),e.max=(r,n)=>e.check(Pc(r,n)),e.length=(r,n)=>e.check(Ec(r,n)),e.unwrap=()=>e.element});Lb=S("ZodObject",(e,t)=>{uw.init(e,t),$e.init(e,t),pe.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Lt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ze()}),e.loose=()=>e.clone({...e._zod.def,catchall:ze()}),e.strict=()=>e.clone({...e._zod.def,catchall:nI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>pe.extend(e,r),e.merge=r=>pe.merge(e,r),e.pick=r=>pe.pick(e,r),e.omit=r=>pe.omit(e,r),e.partial=(...r)=>pe.partial(qb,e,r[0]),e.required=(...r)=>pe.required(Fb,e,r[0])});Zb=S("ZodUnion",(e,t)=>{sd.init(e,t),$e.init(e,t),e.options=t.options});iI=S("ZodDiscriminatedUnion",(e,t)=>{Zb.init(e,t),lw.init(e,t)});sI=S("ZodIntersection",(e,t)=>{pw.init(e,t),$e.init(e,t)});aI=S("ZodRecord",(e,t)=>{dw.init(e,t),$e.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});Ad=S("ZodEnum",(e,t)=>{fw.init(e,t),$e.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Ad({...t,checks:[],...pe.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Ad({...t,checks:[],...pe.normalizeParams(o),entries:i})}});cI=S("ZodLiteral",(e,t)=>{hw.init(e,t),$e.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});uI=S("ZodTransform",(e,t)=>{mw.init(e,t),$e.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(pe.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(pe.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});qb=S("ZodOptional",(e,t)=>{gw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});lI=S("ZodNullable",(e,t)=>{yw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});pI=S("ZodDefault",(e,t)=>{_w.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});fI=S("ZodPrefault",(e,t)=>{vw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});Fb=S("ZodNonOptional",(e,t)=>{ww.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});gI=S("ZodCatch",(e,t)=>{bw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});_I=S("ZodPipe",(e,t)=>{xw.init(e,t),$e.init(e,t),e.in=t.in,e.out=t.out});vI=S("ZodReadonly",(e,t)=>{kw.init(e,t),$e.init(e,t)});Gb=S("ZodCustom",(e,t)=>{Sw.init(e,t),$e.init(e,t)})});var Vb,Hb=b(()=>{Vb={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"}});var Dc={};tr(Dc,{bigint:()=>EI,boolean:()=>PI,date:()=>CI,number:()=>$I,string:()=>SI});function SI(e){return Rw(Id,e)}function $I(e){return nb(Ic,e)}function PI(e){return sb(zd,e)}function EI(e){return ab(Nb,e)}function CI(e){return db(Mb,e)}var Wb=b(()=>{Tt();Ac()});var Kb=b(()=>{Tt();Ac();xd();Cd();Td();Hb();Tt();Ew();Tt();$c();Ed();Wb();Mt(Pw())});var Jb=b(()=>{Kb()});var jd=b(()=>{Jb()});var li,Qb,Tn,Nc,at,Xb,e0,PB,zI,DI,Ld,Wt,$s,t0,ct,or,ir,ut,jc,r0,ho,n0,o0,Zd,mo,ee,Ud,i0,pi,EB,Mc,OI,Lc,NI,Ps,ui,s0,jI,MI,LI,ZI,UI,qI,qd,FI,GI,Zc,a0,Uc,BI,VI,qc,HI,Es,Cs,WI,Ts,di,KI,As,Fc,Gc,Bc,CB,Vc,Hc,Wc,c0,u0,l0,Fd,p0,Rs,fi,d0,JI,Gd,YI,QI,XI,Bd,ez,Vd,tz,rz,nz,oz,iz,sz,az,cz,uz,lz,Hd,pz,dz,Wd,Kd,Jd,Yd,fz,hz,mz,Qd,gz,yz,_z,vz,wz,f0,Xd,bz,Kc,TB,xz,Is,kz,AB,zs,Sz,ef,$z,Pz,Ez,Cz,Tz,Az,Rz,Oc,Iz,zz,Dz,tf,rf,Oz,Nz,jz,Mz,Lz,Zz,Uz,qz,Fz,Gz,Bz,Vz,Hz,Wz,Kz,Jz,Yz,Qz,Jc,Xz,eD,tD,rD,nD,oD,iD,nf,sD,RB,IB,zB,DB,OB,NB,V,Md,An=b(()=>{jd();li="2025-11-25",Qb=[li,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Tn="io.modelcontextprotocol/related-task",Nc="2.0",at=Bb(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Xb=Pe([_(),de().int()]),e0=_(),PB=Xe({ttl:Pe([de(),Dd()]).optional(),pollInterval:de().optional()}),zI=A({ttl:de().optional()}),DI=A({taskId:_()}),Ld=Xe({progressToken:Xb.optional(),[Tn]:DI.optional()}),Wt=A({_meta:Ld.optional()}),$s=Wt.extend({task:zI.optional()}),t0=e=>$s.safeParse(e).success,ct=A({method:_(),params:Wt.loose().optional()}),or=A({_meta:Ld.optional()}),ir=A({method:_(),params:or.loose().optional()}),ut=Xe({_meta:Ld.optional()}),jc=Pe([_(),de().int()]),r0=A({jsonrpc:O(Nc),id:jc,...ct.shape}).strict(),ho=e=>r0.safeParse(e).success,n0=A({jsonrpc:O(Nc),...ir.shape}).strict(),o0=e=>n0.safeParse(e).success,Zd=A({jsonrpc:O(Nc),id:jc,result:ut}).strict(),mo=e=>Zd.safeParse(e).success;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ee||(ee={}));Ud=A({jsonrpc:O(Nc),id:jc.optional(),error:A({code:de().int(),message:_(),data:ze().optional()})}).strict(),i0=e=>Ud.safeParse(e).success,pi=Pe([r0,n0,Zd,Ud]),EB=Pe([Zd,Ud]),Mc=ut.strict(),OI=or.extend({requestId:jc.optional(),reason:_().optional()}),Lc=ir.extend({method:O("notifications/cancelled"),params:OI}),NI=A({src:_(),mimeType:_().optional(),sizes:T(_()).optional(),theme:Lt(["light","dark"]).optional()}),Ps=A({icons:T(NI).optional()}),ui=A({name:_(),title:_().optional()}),s0=ui.extend({...ui.shape,...Ps.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),jI=zc(A({applyDefaults:be().optional()}),De(_(),ze())),MI=Nd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,zc(A({form:jI.optional(),url:at.optional()}),De(_(),ze()).optional())),LI=Xe({list:at.optional(),cancel:at.optional(),requests:Xe({sampling:Xe({createMessage:at.optional()}).optional(),elicitation:Xe({create:at.optional()}).optional()}).optional()}),ZI=Xe({list:at.optional(),cancel:at.optional(),requests:Xe({tools:Xe({call:at.optional()}).optional()}).optional()}),UI=A({experimental:De(_(),at).optional(),sampling:A({context:at.optional(),tools:at.optional()}).optional(),elicitation:MI.optional(),roots:A({listChanged:be().optional()}).optional(),tasks:LI.optional()}),qI=Wt.extend({protocolVersion:_(),capabilities:UI,clientInfo:s0}),qd=ct.extend({method:O("initialize"),params:qI}),FI=A({experimental:De(_(),at).optional(),logging:at.optional(),completions:at.optional(),prompts:A({listChanged:be().optional()}).optional(),resources:A({subscribe:be().optional(),listChanged:be().optional()}).optional(),tools:A({listChanged:be().optional()}).optional(),tasks:ZI.optional()}),GI=ut.extend({protocolVersion:_(),capabilities:FI,serverInfo:s0,instructions:_().optional()}),Zc=ir.extend({method:O("notifications/initialized"),params:or.optional()}),a0=e=>Zc.safeParse(e).success,Uc=ct.extend({method:O("ping"),params:Wt.optional()}),BI=A({progress:de(),total:Me(de()),message:Me(_())}),VI=A({...or.shape,...BI.shape,progressToken:Xb}),qc=ir.extend({method:O("notifications/progress"),params:VI}),HI=Wt.extend({cursor:e0.optional()}),Es=ct.extend({params:HI.optional()}),Cs=ut.extend({nextCursor:e0.optional()}),WI=Lt(["working","input_required","completed","failed","cancelled"]),Ts=A({taskId:_(),status:WI,ttl:Pe([de(),Dd()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:Me(de()),statusMessage:Me(_())}),di=ut.extend({task:Ts}),KI=or.merge(Ts),As=ir.extend({method:O("notifications/tasks/status"),params:KI}),Fc=ct.extend({method:O("tasks/get"),params:Wt.extend({taskId:_()})}),Gc=ut.merge(Ts),Bc=ct.extend({method:O("tasks/result"),params:Wt.extend({taskId:_()})}),CB=ut.loose(),Vc=Es.extend({method:O("tasks/list")}),Hc=Cs.extend({tasks:T(Ts)}),Wc=ct.extend({method:O("tasks/cancel"),params:Wt.extend({taskId:_()})}),c0=ut.merge(Ts),u0=A({uri:_(),mimeType:Me(_()),_meta:De(_(),ze()).optional()}),l0=u0.extend({text:_()}),Fd=_().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),p0=u0.extend({blob:Fd}),Rs=Lt(["user","assistant"]),fi=A({audience:T(Rs).optional(),priority:de().min(0).max(1).optional(),lastModified:ks.datetime({offset:!0}).optional()}),d0=A({...ui.shape,...Ps.shape,uri:_(),description:Me(_()),mimeType:Me(_()),annotations:fi.optional(),_meta:Me(Xe({}))}),JI=A({...ui.shape,...Ps.shape,uriTemplate:_(),description:Me(_()),mimeType:Me(_()),annotations:fi.optional(),_meta:Me(Xe({}))}),Gd=Es.extend({method:O("resources/list")}),YI=Cs.extend({resources:T(d0)}),QI=Es.extend({method:O("resources/templates/list")}),XI=Cs.extend({resourceTemplates:T(JI)}),Bd=Wt.extend({uri:_()}),ez=Bd,Vd=ct.extend({method:O("resources/read"),params:ez}),tz=ut.extend({contents:T(Pe([l0,p0]))}),rz=ir.extend({method:O("notifications/resources/list_changed"),params:or.optional()}),nz=Bd,oz=ct.extend({method:O("resources/subscribe"),params:nz}),iz=Bd,sz=ct.extend({method:O("resources/unsubscribe"),params:iz}),az=or.extend({uri:_()}),cz=ir.extend({method:O("notifications/resources/updated"),params:az}),uz=A({name:_(),description:Me(_()),required:Me(be())}),lz=A({...ui.shape,...Ps.shape,description:Me(_()),arguments:Me(T(uz)),_meta:Me(Xe({}))}),Hd=Es.extend({method:O("prompts/list")}),pz=Cs.extend({prompts:T(lz)}),dz=Wt.extend({name:_(),arguments:De(_(),_()).optional()}),Wd=ct.extend({method:O("prompts/get"),params:dz}),Kd=A({type:O("text"),text:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),Jd=A({type:O("image"),data:Fd,mimeType:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),Yd=A({type:O("audio"),data:Fd,mimeType:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),fz=A({type:O("tool_use"),name:_(),id:_(),input:De(_(),ze()),_meta:De(_(),ze()).optional()}),hz=A({type:O("resource"),resource:Pe([l0,p0]),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),mz=d0.extend({type:O("resource_link")}),Qd=Pe([Kd,Jd,Yd,mz,hz]),gz=A({role:Rs,content:Qd}),yz=ut.extend({description:_().optional(),messages:T(gz)}),_z=ir.extend({method:O("notifications/prompts/list_changed"),params:or.optional()}),vz=A({title:_().optional(),readOnlyHint:be().optional(),destructiveHint:be().optional(),idempotentHint:be().optional(),openWorldHint:be().optional()}),wz=A({taskSupport:Lt(["required","optional","forbidden"]).optional()}),f0=A({...ui.shape,...Ps.shape,description:_().optional(),inputSchema:A({type:O("object"),properties:De(_(),at).optional(),required:T(_()).optional()}).catchall(ze()),outputSchema:A({type:O("object"),properties:De(_(),at).optional(),required:T(_()).optional()}).catchall(ze()).optional(),annotations:vz.optional(),execution:wz.optional(),_meta:De(_(),ze()).optional()}),Xd=Es.extend({method:O("tools/list")}),bz=Cs.extend({tools:T(f0)}),Kc=ut.extend({content:T(Qd).default([]),structuredContent:De(_(),ze()).optional(),isError:be().optional()}),TB=Kc.or(ut.extend({toolResult:ze()})),xz=$s.extend({name:_(),arguments:De(_(),ze()).optional()}),Is=ct.extend({method:O("tools/call"),params:xz}),kz=ir.extend({method:O("notifications/tools/list_changed"),params:or.optional()}),AB=A({autoRefresh:be().default(!0),debounceMs:de().int().nonnegative().default(300)}),zs=Lt(["debug","info","notice","warning","error","critical","alert","emergency"]),Sz=Wt.extend({level:zs}),ef=ct.extend({method:O("logging/setLevel"),params:Sz}),$z=or.extend({level:zs,logger:_().optional(),data:ze()}),Pz=ir.extend({method:O("notifications/message"),params:$z}),Ez=A({name:_().optional()}),Cz=A({hints:T(Ez).optional(),costPriority:de().min(0).max(1).optional(),speedPriority:de().min(0).max(1).optional(),intelligencePriority:de().min(0).max(1).optional()}),Tz=A({mode:Lt(["auto","required","none"]).optional()}),Az=A({type:O("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:T(Qd).default([]),structuredContent:A({}).loose().optional(),isError:be().optional(),_meta:De(_(),ze()).optional()}),Rz=Od("type",[Kd,Jd,Yd]),Oc=Od("type",[Kd,Jd,Yd,fz,Az]),Iz=A({role:Rs,content:Pe([Oc,T(Oc)]),_meta:De(_(),ze()).optional()}),zz=$s.extend({messages:T(Iz),modelPreferences:Cz.optional(),systemPrompt:_().optional(),includeContext:Lt(["none","thisServer","allServers"]).optional(),temperature:de().optional(),maxTokens:de().int(),stopSequences:T(_()).optional(),metadata:at.optional(),tools:T(f0).optional(),toolChoice:Tz.optional()}),Dz=ct.extend({method:O("sampling/createMessage"),params:zz}),tf=ut.extend({model:_(),stopReason:Me(Lt(["endTurn","stopSequence","maxTokens"]).or(_())),role:Rs,content:Rz}),rf=ut.extend({model:_(),stopReason:Me(Lt(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:Rs,content:Pe([Oc,T(Oc)])}),Oz=A({type:O("boolean"),title:_().optional(),description:_().optional(),default:be().optional()}),Nz=A({type:O("string"),title:_().optional(),description:_().optional(),minLength:de().optional(),maxLength:de().optional(),format:Lt(["email","uri","date","date-time"]).optional(),default:_().optional()}),jz=A({type:Lt(["number","integer"]),title:_().optional(),description:_().optional(),minimum:de().optional(),maximum:de().optional(),default:de().optional()}),Mz=A({type:O("string"),title:_().optional(),description:_().optional(),enum:T(_()),default:_().optional()}),Lz=A({type:O("string"),title:_().optional(),description:_().optional(),oneOf:T(A({const:_(),title:_()})),default:_().optional()}),Zz=A({type:O("string"),title:_().optional(),description:_().optional(),enum:T(_()),enumNames:T(_()).optional(),default:_().optional()}),Uz=Pe([Mz,Lz]),qz=A({type:O("array"),title:_().optional(),description:_().optional(),minItems:de().optional(),maxItems:de().optional(),items:A({type:O("string"),enum:T(_())}),default:T(_()).optional()}),Fz=A({type:O("array"),title:_().optional(),description:_().optional(),minItems:de().optional(),maxItems:de().optional(),items:A({anyOf:T(A({const:_(),title:_()}))}),default:T(_()).optional()}),Gz=Pe([qz,Fz]),Bz=Pe([Zz,Uz,Gz]),Vz=Pe([Bz,Oz,Nz,jz]),Hz=$s.extend({mode:O("form").optional(),message:_(),requestedSchema:A({type:O("object"),properties:De(_(),Vz),required:T(_()).optional()})}),Wz=$s.extend({mode:O("url"),message:_(),elicitationId:_(),url:_().url()}),Kz=Pe([Hz,Wz]),Jz=ct.extend({method:O("elicitation/create"),params:Kz}),Yz=or.extend({elicitationId:_()}),Qz=ir.extend({method:O("notifications/elicitation/complete"),params:Yz}),Jc=ut.extend({action:Lt(["accept","decline","cancel"]),content:Nd(e=>e===null?void 0:e,De(_(),Pe([_(),de(),be(),T(_())])).optional())}),Xz=A({type:O("ref/resource"),uri:_()}),eD=A({type:O("ref/prompt"),name:_()}),tD=Wt.extend({ref:Pe([eD,Xz]),argument:A({name:_(),value:_()}),context:A({arguments:De(_(),_()).optional()}).optional()}),rD=ct.extend({method:O("completion/complete"),params:tD}),nD=ut.extend({completion:Xe({values:T(_()).max(100),total:Me(de().int()),hasMore:Me(be())})}),oD=A({uri:_().startsWith("file://"),name:_().optional(),_meta:De(_(),ze()).optional()}),iD=ct.extend({method:O("roots/list"),params:Wt.optional()}),nf=ut.extend({roots:T(oD)}),sD=ir.extend({method:O("notifications/roots/list_changed"),params:or.optional()}),RB=Pe([Uc,qd,rD,ef,Wd,Hd,Gd,QI,Vd,oz,sz,Is,Xd,Fc,Bc,Vc,Wc]),IB=Pe([Lc,qc,Zc,sD,As]),zB=Pe([Mc,tf,rf,Jc,nf,Gc,Hc,di]),DB=Pe([Uc,Dz,Jz,iD,Fc,Bc,Vc,Wc]),OB=Pe([Lc,qc,Pz,cz,rz,kz,_z,As,Qz]),NB=Pe([Mc,GI,nD,yz,pz,YI,XI,tz,Kc,bz,Gc,Hc,di]),V=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===ee.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Md(o.elicitations,r)}return new e(t,r,n)}},Md=class extends V{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(ee.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}});function aD(e){return pi.parse(JSON.parse(e))}function h0(e){return JSON.stringify(e)+`
32
32
  `}var Yc,m0=b(()=>{An();Yc=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
33
33
  `);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),aD(r)}clear(){this._buffer=void 0}}});var of,hi,sf=b(()=>{of=yt(require("node:process"),1);m0();hi=class{constructor(t=of.default.stdin,r=of.default.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new Yc,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{let n=h0(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}}});function R0(e){return typeof e>"u"||e===null}function cD(e){return typeof e=="object"&&e!==null}function uD(e){return Array.isArray(e)?e:R0(e)?[]:[e]}function lD(e,t){var r,n,o,i;if(t)for(i=Object.keys(t),r=0,n=i.length;r<n;r+=1)o=i[r],e[o]=t[o];return e}function pD(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function dD(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}function I0(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
34
34
 
@@ -73,10 +73,10 @@ GODD_CONFIG \u74B0\u5883\u5909\u6570\u307E\u305F\u306F .cursor/mcp.json \u306E e
73
73
  `:""},this._extScope=t,this._scope=new Pr.Scope({parent:t}),this._nodes=[new Sh]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new _h(t,i,n)),i}const(t,r,n){return this._def(Pr.varKinds.const,t,r,n)}let(t,r,n){return this._def(Pr.varKinds.let,t,r,n)}var(t,r,n){return this._def(Pr.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new zu(t,r,n))}add(t,r){return this._leafNode(new vh(t,X.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ae.nil&&this._leafNode(new kh(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,ae.addCodeArg)(r,o));return r.push("}"),new ae._Code(r)}if(t,r,n){if(this._blockNode(new jo(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new jo(t))}else(){return this._elseNode(new Ti)}endIf(){return this._endBlockNode(jo,Ti)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new $h(t),r)}forRange(t,r,n,o,i=this.opts.es5?Pr.varKinds.var:Pr.varKinds.let){let s=this._scope.toName(t);return this._for(new Ph(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Pr.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof ae.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ae._)`${s}.length`,a=>{this.var(i,(0,ae._)`${s}[${a}]`),n(i)})}return this._for(new Du("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Pr.varKinds.var:Pr.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ae._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new Du("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Mo)}label(t){return this._leafNode(new wh(t))}break(t){return this._leafNode(new bh(t))}return(t){let r=new Js;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Js)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Eh;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Ys(i),r(i)}return n&&(this._currNode=o.finally=new Qs,this.code(n)),this._endBlockNode(Ys,Qs)}throw(t){return this._leafNode(new xh(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=ae.nil,n,o){return this._blockNode(new Ks(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Ks)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof jo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};X.CodeGen=Ch;function Lo(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Ou(e,t){return t instanceof ae._CodeOrName?Lo(e,t.names):e}function Ai(e,t,r){if(e instanceof ae.Name)return n(e);if(!o(e))return e;return new ae._Code(e._items.reduce((i,s)=>(s instanceof ae.Name&&(s=n(s)),s instanceof ae._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function o(i){return i instanceof ae._Code&&i._items.some(s=>s instanceof ae.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function m4(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Zk(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ae._)`!${Th(e)}`}X.not=Zk;var g4=Uk(X.operators.AND);function y4(...e){return e.reduce(g4)}X.and=y4;var _4=Uk(X.operators.OR);function v4(...e){return e.reduce(_4)}X.or=v4;function Uk(e){return(t,r)=>t===ae.nil?r:r===ae.nil?t:(0,ae._)`${Th(t)} ${e} ${Th(r)}`}function Th(e){return e instanceof ae.Name?e:(0,ae._)`(${e})`}});var le=$(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.checkStrictMode=te.getErrorPath=te.Type=te.useFunc=te.setEvaluated=te.evaluatedPropsToName=te.mergeEvaluated=te.eachItem=te.unescapeJsonPointer=te.escapeJsonPointer=te.escapeFragment=te.unescapeFragment=te.schemaRefOrVal=te.schemaHasRulesButRef=te.schemaHasRules=te.checkUnknownRules=te.alwaysValidSchema=te.toHash=void 0;var xe=Y(),w4=Hs();function b4(e){let t={};for(let r of e)t[r]=!0;return t}te.toHash=b4;function x4(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Gk(e,t),!Bk(t,e.self.RULES.all))}te.alwaysValidSchema=x4;function Gk(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||Wk(e,`unknown keyword: "${i}"`)}te.checkUnknownRules=Gk;function Bk(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}te.schemaHasRules=Bk;function k4(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}te.schemaHasRulesButRef=k4;function S4({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,xe._)`${r}`}return(0,xe._)`${e}${t}${(0,xe.getProperty)(n)}`}te.schemaRefOrVal=S4;function $4(e){return Vk(decodeURIComponent(e))}te.unescapeFragment=$4;function P4(e){return encodeURIComponent(Rh(e))}te.escapeFragment=P4;function Rh(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}te.escapeJsonPointer=Rh;function Vk(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}te.unescapeJsonPointer=Vk;function E4(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}te.eachItem=E4;function qk({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof xe.Name?(i instanceof xe.Name?e(o,i,s):t(o,i,s),s):i instanceof xe.Name?(t(o,s,i),i):r(i,s);return a===xe.Name&&!(c instanceof xe.Name)?n(o,c):c}}te.mergeEvaluated={props:qk({mergeNames:(e,t,r)=>e.if((0,xe._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,xe._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,xe._)`${r} || {}`).code((0,xe._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,xe._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,xe._)`${r} || {}`),Ih(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Hk}),items:qk({mergeNames:(e,t,r)=>e.if((0,xe._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,xe._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,xe._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,xe._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Hk(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,xe._)`{}`);return t!==void 0&&Ih(e,r,t),r}te.evaluatedPropsToName=Hk;function Ih(e,t,r){Object.keys(r).forEach(n=>e.assign((0,xe._)`${t}${(0,xe.getProperty)(n)}`,!0))}te.setEvaluated=Ih;var Fk={};function C4(e,t){return e.scopeValue("func",{ref:t,code:Fk[t.code]||(Fk[t.code]=new w4._Code(t.code))})}te.useFunc=C4;var Ah;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ah||(te.Type=Ah={}));function T4(e,t,r){if(e instanceof xe.Name){let n=t===Ah.Num;return r?n?(0,xe._)`"[" + ${e} + "]"`:(0,xe._)`"['" + ${e} + "']"`:n?(0,xe._)`"/" + ${e}`:(0,xe._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,xe.getProperty)(e).toString():"/"+Rh(e)}te.getErrorPath=T4;function Wk(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}te.checkStrictMode=Wk});var mn=$(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});var bt=Y(),A4={data:new bt.Name("data"),valCxt:new bt.Name("valCxt"),instancePath:new bt.Name("instancePath"),parentData:new bt.Name("parentData"),parentDataProperty:new bt.Name("parentDataProperty"),rootData:new bt.Name("rootData"),dynamicAnchors:new bt.Name("dynamicAnchors"),vErrors:new bt.Name("vErrors"),errors:new bt.Name("errors"),this:new bt.Name("this"),self:new bt.Name("self"),scope:new bt.Name("scope"),json:new bt.Name("json"),jsonPos:new bt.Name("jsonPos"),jsonLen:new bt.Name("jsonLen"),jsonPart:new bt.Name("jsonPart")};zh.default=A4});var Xs=$(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.extendErrors=xt.resetErrorsCount=xt.reportExtraError=xt.reportError=xt.keyword$DataError=xt.keywordError=void 0;var ce=Y(),ju=le(),It=mn();xt.keywordError={message:({keyword:e})=>(0,ce.str)`must pass "${e}" keyword validation`};xt.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ce.str)`"${e}" keyword must be ${t} ($data)`:(0,ce.str)`"${e}" keyword is invalid ($data)`};function R4(e,t=xt.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=Yk(e,t,r);n??(s||a)?Kk(i,c):Jk(o,(0,ce._)`[${c}]`)}xt.reportError=R4;function I4(e,t=xt.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=Yk(e,t,r);Kk(o,a),i||s||Jk(n,It.default.vErrors)}xt.reportExtraError=I4;function z4(e,t){e.assign(It.default.errors,t),e.if((0,ce._)`${It.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ce._)`${It.default.vErrors}.length`,t),()=>e.assign(It.default.vErrors,null)))}xt.resetErrorsCount=z4;function D4({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,It.default.errors,a=>{e.const(s,(0,ce._)`${It.default.vErrors}[${a}]`),e.if((0,ce._)`${s}.instancePath === undefined`,()=>e.assign((0,ce._)`${s}.instancePath`,(0,ce.strConcat)(It.default.instancePath,i.errorPath))),e.assign((0,ce._)`${s}.schemaPath`,(0,ce.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,ce._)`${s}.schema`,r),e.assign((0,ce._)`${s}.data`,n))})}xt.extendErrors=D4;function Kk(e,t){let r=e.const("err",t);e.if((0,ce._)`${It.default.vErrors} === null`,()=>e.assign(It.default.vErrors,(0,ce._)`[${r}]`),(0,ce._)`${It.default.vErrors}.push(${r})`),e.code((0,ce._)`${It.default.errors}++`)}function Jk(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,ce._)`new ${e.ValidationError}(${t})`):(r.assign((0,ce._)`${n}.errors`,t),r.return(!1))}var Zo={keyword:new ce.Name("keyword"),schemaPath:new ce.Name("schemaPath"),params:new ce.Name("params"),propertyName:new ce.Name("propertyName"),message:new ce.Name("message"),schema:new ce.Name("schema"),parentSchema:new ce.Name("parentSchema")};function Yk(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ce._)`{}`:O4(e,t,r)}function O4(e,t,r={}){let{gen:n,it:o}=e,i=[N4(o,r),j4(e,r)];return M4(e,t,i),n.object(...i)}function N4({errorPath:e},{instancePath:t}){let r=t?(0,ce.str)`${e}${(0,ju.getErrorPath)(t,ju.Type.Str)}`:e;return[It.default.instancePath,(0,ce.strConcat)(It.default.instancePath,r)]}function j4({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ce.str)`${t}/${e}`;return r&&(o=(0,ce.str)`${o}${(0,ju.getErrorPath)(r,ju.Type.Str)}`),[Zo.schemaPath,o]}function M4(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:c,propertyName:u,topSchemaRef:p,schemaPath:l}=a;n.push([Zo.keyword,o],[Zo.params,typeof t=="function"?t(e):t||(0,ce._)`{}`]),c.messages&&n.push([Zo.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Zo.schema,s],[Zo.parentSchema,(0,ce._)`${p}${l}`],[It.default.data,i]),u&&n.push([Zo.propertyName,u])}});var Xk=$(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.boolOrEmptySchema=Ri.topBoolOrEmptySchema=void 0;var L4=Xs(),Z4=Y(),U4=mn(),q4={message:"boolean schema is false"};function F4(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Qk(e,!1):typeof r=="object"&&r.$async===!0?t.return(U4.default.data):(t.assign((0,Z4._)`${n}.errors`,null),t.return(!0))}Ri.topBoolOrEmptySchema=F4;function G4(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Qk(e)):r.var(t,!0)}Ri.boolOrEmptySchema=G4;function Qk(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,L4.reportError)(o,q4,void 0,t)}});var Dh=$(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.getRules=Ii.isJSONType=void 0;var B4=["string","number","integer","boolean","null","object","array"],V4=new Set(B4);function H4(e){return typeof e=="string"&&V4.has(e)}Ii.isJSONType=H4;function W4(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Ii.getRules=W4});var Oh=$(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.shouldUseRule=Fn.shouldUseGroup=Fn.schemaHasRulesForType=void 0;function K4({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&eS(e,n)}Fn.schemaHasRulesForType=K4;function eS(e,t){return t.rules.some(r=>tS(e,r))}Fn.shouldUseGroup=eS;function tS(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Fn.shouldUseRule=tS});var ea=$(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.reportTypeError=kt.checkDataTypes=kt.checkDataType=kt.coerceAndCheckDataType=kt.getJSONTypes=kt.getSchemaTypes=kt.DataType=void 0;var J4=Dh(),Y4=Oh(),Q4=Xs(),H=Y(),rS=le(),zi;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(zi||(kt.DataType=zi={}));function X4(e){let t=nS(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}kt.getSchemaTypes=X4;function nS(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(J4.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}kt.getJSONTypes=nS;function eM(e,t){let{gen:r,data:n,opts:o}=e,i=tM(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,Y4.schemaHasRulesForType)(e,t[0]));if(s){let a=jh(t,n,o.strictNumbers,zi.Wrong);r.if(a,()=>{i.length?rM(e,t,i):Mh(e)})}return s}kt.coerceAndCheckDataType=eM;var oS=new Set(["string","number","integer","boolean","null"]);function tM(e,t){return t?e.filter(r=>oS.has(r)||t==="array"&&r==="array"):[]}function rM(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,H._)`typeof ${o}`),a=n.let("coerced",(0,H._)`undefined`);i.coerceTypes==="array"&&n.if((0,H._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,H._)`${o}[0]`).assign(s,(0,H._)`typeof ${o}`).if(jh(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,H._)`${a} !== undefined`);for(let u of r)(oS.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),Mh(e),n.endIf(),n.if((0,H._)`${a} !== undefined`,()=>{n.assign(o,a),nM(e,a)});function c(u){switch(u){case"string":n.elseIf((0,H._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,H._)`"" + ${o}`).elseIf((0,H._)`${o} === null`).assign(a,(0,H._)`""`);return;case"number":n.elseIf((0,H._)`${s} == "boolean" || ${o} === null
74
74
  || (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,H._)`+${o}`);return;case"integer":n.elseIf((0,H._)`${s} === "boolean" || ${o} === null
75
75
  || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,H._)`+${o}`);return;case"boolean":n.elseIf((0,H._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,H._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,H._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,H._)`${s} === "string" || ${s} === "number"
76
- || ${s} === "boolean" || ${o} === null`).assign(a,(0,H._)`[${o}]`)}}}function nM({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,H._)`${t} !== undefined`,()=>e.assign((0,H._)`${t}[${r}]`,n))}function Nh(e,t,r,n=zi.Correct){let o=n===zi.Correct?H.operators.EQ:H.operators.NEQ,i;switch(e){case"null":return(0,H._)`${t} ${o} null`;case"array":i=(0,H._)`Array.isArray(${t})`;break;case"object":i=(0,H._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,H._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,H._)`typeof ${t} ${o} ${e}`}return n===zi.Correct?i:(0,H.not)(i);function s(a=H.nil){return(0,H.and)((0,H._)`typeof ${t} == "number"`,a,r?(0,H._)`isFinite(${t})`:H.nil)}}kt.checkDataType=Nh;function jh(e,t,r,n){if(e.length===1)return Nh(e[0],t,r,n);let o,i=(0,rS.toHash)(e);if(i.array&&i.object){let s=(0,H._)`typeof ${t} != "object"`;o=i.null?s:(0,H._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=H.nil;i.number&&delete i.integer;for(let s in i)o=(0,H.and)(o,Nh(s,t,r,n));return o}kt.checkDataTypes=jh;var oM={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,H._)`{type: ${e}}`:(0,H._)`{type: ${t}}`};function Mh(e){let t=iM(e);(0,Q4.reportError)(t,oM)}kt.reportTypeError=Mh;function iM(e){let{gen:t,data:r,schema:n}=e,o=(0,rS.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var sS=$(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.assignDefaults=void 0;var Di=Y(),sM=le();function aM(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)iS(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>iS(e,i,o.default))}Mu.assignDefaults=aM;function iS(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Di._)`${i}${(0,Di.getProperty)(t)}`;if(o){(0,sM.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Di._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Di._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Di._)`${a} = ${(0,Di.stringify)(r)}`)}});var pr=$(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.validateUnion=ge.validateArray=ge.usePattern=ge.callValidateCode=ge.schemaProperties=ge.allSchemaProperties=ge.noPropertyInData=ge.propertyInData=ge.isOwnProperty=ge.hasPropFunc=ge.reportMissingProp=ge.checkMissingProp=ge.checkReportMissingProp=void 0;var Te=Y(),Lh=le(),Gn=mn(),cM=le();function uM(e,t){let{gen:r,data:n,it:o}=e;r.if(Uh(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Te._)`${t}`},!0),e.error()})}ge.checkReportMissingProp=uM;function lM({gen:e,data:t,it:{opts:r}},n,o){return(0,Te.or)(...n.map(i=>(0,Te.and)(Uh(e,t,i,r.ownProperties),(0,Te._)`${o} = ${i}`)))}ge.checkMissingProp=lM;function pM(e,t){e.setParams({missingProperty:t},!0),e.error()}ge.reportMissingProp=pM;function aS(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Te._)`Object.prototype.hasOwnProperty`})}ge.hasPropFunc=aS;function Zh(e,t,r){return(0,Te._)`${aS(e)}.call(${t}, ${r})`}ge.isOwnProperty=Zh;function dM(e,t,r,n){let o=(0,Te._)`${t}${(0,Te.getProperty)(r)} !== undefined`;return n?(0,Te._)`${o} && ${Zh(e,t,r)}`:o}ge.propertyInData=dM;function Uh(e,t,r,n){let o=(0,Te._)`${t}${(0,Te.getProperty)(r)} === undefined`;return n?(0,Te.or)(o,(0,Te.not)(Zh(e,t,r))):o}ge.noPropertyInData=Uh;function cS(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ge.allSchemaProperties=cS;function fM(e,t){return cS(t).filter(r=>!(0,Lh.alwaysValidSchema)(e,t[r]))}ge.schemaProperties=fM;function hM({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let p=u?(0,Te._)`${e}, ${t}, ${n}${o}`:t,l=[[Gn.default.instancePath,(0,Te.strConcat)(Gn.default.instancePath,i)],[Gn.default.parentData,s.parentData],[Gn.default.parentDataProperty,s.parentDataProperty],[Gn.default.rootData,Gn.default.rootData]];s.opts.dynamicRef&&l.push([Gn.default.dynamicAnchors,Gn.default.dynamicAnchors]);let d=(0,Te._)`${p}, ${r.object(...l)}`;return c!==Te.nil?(0,Te._)`${a}.call(${c}, ${d})`:(0,Te._)`${a}(${d})`}ge.callValidateCode=hM;var mM=(0,Te._)`new RegExp`;function gM({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Te._)`${o.code==="new RegExp"?mM:(0,cM.useFunc)(e,o)}(${r}, ${n})`})}ge.usePattern=gM;function yM(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let c=t.const("len",(0,Te._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Lh.Type.Num},i),t.if((0,Te.not)(i),a)})}}ge.validateArray=yM;function _M(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Lh.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let p=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,Te._)`${s} || ${a}`),e.mergeValidEvaluated(p,a)||t.if((0,Te.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ge.validateUnion=_M});var pS=$(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.validateKeywordUsage=Fr.validSchemaType=Fr.funcKeywordCode=Fr.macroKeywordCode=void 0;var zt=Y(),Uo=mn(),vM=pr(),wM=Xs();function bM(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=lS(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:zt.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Fr.macroKeywordCode=bM;function xM(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;SM(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,p=lS(n,o,u),l=n.let("valid");e.block$data(l,d),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function d(){if(t.errors===!1)g(),t.modifying&&uS(e),y(()=>e.error());else{let v=t.async?f():h();t.modifying&&uS(e),y(()=>kM(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>g((0,zt._)`await `),w=>n.assign(l,!1).if((0,zt._)`${w} instanceof ${c.ValidationError}`,()=>n.assign(v,(0,zt._)`${w}.errors`),()=>n.throw(w))),v}function h(){let v=(0,zt._)`${p}.errors`;return n.assign(v,null),g(zt.nil),v}function g(v=t.async?(0,zt._)`await `:zt.nil){let w=c.opts.passContext?Uo.default.this:Uo.default.self,x=!("compile"in t&&!a||t.schema===!1);n.assign(l,(0,zt._)`${v}${(0,vM.callValidateCode)(e,p,w,x)}`,t.modifying)}function y(v){var w;n.if((0,zt.not)((w=t.valid)!==null&&w!==void 0?w:l),v)}}Fr.funcKeywordCode=xM;function uS(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,zt._)`${n.parentData}[${n.parentDataProperty}]`))}function kM(e,t){let{gen:r}=e;r.if((0,zt._)`Array.isArray(${t})`,()=>{r.assign(Uo.default.vErrors,(0,zt._)`${Uo.default.vErrors} === null ? ${t} : ${Uo.default.vErrors}.concat(${t})`).assign(Uo.default.errors,(0,zt._)`${Uo.default.vErrors}.length`),(0,wM.extendErrors)(e)},()=>e.error())}function SM({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function lS(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,zt.stringify)(r)})}function $M(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Fr.validSchemaType=$M;function PM({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let s=o.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Fr.validateKeywordUsage=PM});var fS=$(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.extendSubschemaMode=Bn.extendSubschemaData=Bn.getSubschema=void 0;var Gr=Y(),dS=le();function EM(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,Gr._)`${e.schemaPath}${(0,Gr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,Gr._)`${e.schemaPath}${(0,Gr.getProperty)(t)}${(0,Gr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,dS.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Bn.getSubschema=EM;function CM(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:p,opts:l}=t,d=a.let("data",(0,Gr._)`${t.data}${(0,Gr.getProperty)(r)}`,!0);c(d),e.errorPath=(0,Gr.str)`${u}${(0,dS.getErrorPath)(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=(0,Gr._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(o!==void 0){let u=o instanceof Gr.Name?o:a.let("data",o,!0);c(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Bn.extendSubschemaData=CM;function TM(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Bn.extendSubschemaMode=TM});var qh=$((eJ,hS)=>{"use strict";hS.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var gS=$((tJ,mS)=>{"use strict";var Vn=mS.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Lu(t,n,o,e,"",e)};Vn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Vn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Vn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Vn.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Lu(e,t,r,n,o,i,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,u);for(var p in n){var l=n[p];if(Array.isArray(l)){if(p in Vn.arrayKeywords)for(var d=0;d<l.length;d++)Lu(e,t,r,l[d],o+"/"+p+"/"+d,i,o,p,n,d)}else if(p in Vn.propsKeywords){if(l&&typeof l=="object")for(var f in l)Lu(e,t,r,l[f],o+"/"+p+"/"+AM(f),i,o,p,n,f)}else(p in Vn.keywords||e.allKeys&&!(p in Vn.skipKeywords))&&Lu(e,t,r,l,o+"/"+p,i,o,p,n)}r(n,o,i,s,a,c,u)}}function AM(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var ta=$(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.getSchemaRefs=Bt.resolveUrl=Bt.normalizeId=Bt._getFullPath=Bt.getFullPath=Bt.inlineRef=void 0;var RM=le(),IM=qh(),zM=gS(),DM=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function OM(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Fh(e):t?yS(e)<=t:!1}Bt.inlineRef=OM;var NM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Fh(e){for(let t in e){if(NM.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Fh)||typeof r=="object"&&Fh(r))return!0}return!1}function yS(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!DM.has(r)&&(typeof e[r]=="object"&&(0,RM.eachItem)(e[r],n=>t+=yS(n)),t===1/0))return 1/0}return t}function _S(e,t="",r){r!==!1&&(t=Oi(t));let n=e.parse(t);return vS(e,n)}Bt.getFullPath=_S;function vS(e,t){return e.serialize(t).split("#")[0]+"#"}Bt._getFullPath=vS;var jM=/#\/?$/;function Oi(e){return e?e.replace(jM,""):""}Bt.normalizeId=Oi;function MM(e,t,r){return r=Oi(r),e.resolve(t,r)}Bt.resolveUrl=MM;var LM=/^[a-z_][-a-z0-9._]*$/i;function ZM(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Oi(e[r]||t),i={"":o},s=_S(n,o,!1),a={},c=new Set;return zM(e,{allKeys:!0},(l,d,f,h)=>{if(h===void 0)return;let g=s+d,y=i[h];typeof l[r]=="string"&&(y=v.call(this,l[r])),w.call(this,l.$anchor),w.call(this,l.$dynamicAnchor),i[d]=y;function v(x){let k=this.opts.uriResolver.resolve;if(x=Oi(y?k(y,x):x),c.has(x))throw p(x);c.add(x);let P=this.refs[x];return typeof P=="string"&&(P=this.refs[P]),typeof P=="object"?u(l,P.schema,x):x!==Oi(g)&&(x[0]==="#"?(u(l,a[x],x),a[x]=l):this.refs[x]=g),x}function w(x){if(typeof x=="string"){if(!LM.test(x))throw new Error(`invalid anchor "${x}"`);v.call(this,`#${x}`)}}}),a;function u(l,d,f){if(d!==void 0&&!IM(l,d))throw p(f)}function p(l){return new Error(`reference "${l}" resolves to more than one schema`)}}Bt.getSchemaRefs=ZM});var oa=$(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.getData=Hn.KeywordCxt=Hn.validateFunctionCode=void 0;var SS=Xk(),wS=ea(),Bh=Oh(),Zu=ea(),UM=sS(),na=pS(),Gh=fS(),N=Y(),F=mn(),qM=ta(),gn=le(),ra=Xs();function FM(e){if(ES(e)&&(CS(e),PS(e))){VM(e);return}$S(e,()=>(0,SS.topBoolOrEmptySchema)(e))}Hn.validateFunctionCode=FM;function $S({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,N._)`${F.default.data}, ${F.default.valCxt}`,n.$async,()=>{e.code((0,N._)`"use strict"; ${bS(r,o)}`),BM(e,o),e.code(i)}):e.func(t,(0,N._)`${F.default.data}, ${GM(o)}`,n.$async,()=>e.code(bS(r,o)).code(i))}function GM(e){return(0,N._)`{${F.default.instancePath}="", ${F.default.parentData}, ${F.default.parentDataProperty}, ${F.default.rootData}=${F.default.data}${e.dynamicRef?(0,N._)`, ${F.default.dynamicAnchors}={}`:N.nil}}={}`}function BM(e,t){e.if(F.default.valCxt,()=>{e.var(F.default.instancePath,(0,N._)`${F.default.valCxt}.${F.default.instancePath}`),e.var(F.default.parentData,(0,N._)`${F.default.valCxt}.${F.default.parentData}`),e.var(F.default.parentDataProperty,(0,N._)`${F.default.valCxt}.${F.default.parentDataProperty}`),e.var(F.default.rootData,(0,N._)`${F.default.valCxt}.${F.default.rootData}`),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`${F.default.valCxt}.${F.default.dynamicAnchors}`)},()=>{e.var(F.default.instancePath,(0,N._)`""`),e.var(F.default.parentData,(0,N._)`undefined`),e.var(F.default.parentDataProperty,(0,N._)`undefined`),e.var(F.default.rootData,F.default.data),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`{}`)})}function VM(e){let{schema:t,opts:r,gen:n}=e;$S(e,()=>{r.$comment&&t.$comment&&AS(e),YM(e),n.let(F.default.vErrors,null),n.let(F.default.errors,0),r.unevaluated&&HM(e),TS(e),eL(e)})}function HM(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,N._)`${r}.evaluated`),t.if((0,N._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,N._)`${e.evaluated}.props`,(0,N._)`undefined`)),t.if((0,N._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,N._)`${e.evaluated}.items`,(0,N._)`undefined`))}function bS(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,N._)`/*# sourceURL=${r} */`:N.nil}function WM(e,t){if(ES(e)&&(CS(e),PS(e))){KM(e,t);return}(0,SS.boolOrEmptySchema)(e,t)}function PS({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function ES(e){return typeof e.schema!="boolean"}function KM(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&AS(e),QM(e),XM(e);let i=n.const("_errs",F.default.errors);TS(e,i),n.var(t,(0,N._)`${i} === ${F.default.errors}`)}function CS(e){(0,gn.checkUnknownRules)(e),JM(e)}function TS(e,t){if(e.opts.jtd)return xS(e,[],!1,t);let r=(0,wS.getSchemaTypes)(e.schema),n=(0,wS.coerceAndCheckDataType)(e,r);xS(e,r,!n,t)}function JM(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,gn.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function YM(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,gn.checkStrictMode)(e,"default is ignored in the schema root")}function QM(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,qM.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function XM(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function AS({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,N._)`${F.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,N.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,N._)`${F.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function eL(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,N._)`${F.default.errors} === 0`,()=>t.return(F.default.data),()=>t.throw((0,N._)`new ${o}(${F.default.vErrors})`)):(t.assign((0,N._)`${n}.errors`,F.default.vErrors),i.unevaluated&&tL(e),t.return((0,N._)`${F.default.errors} === 0`))}function tL({gen:e,evaluated:t,props:r,items:n}){r instanceof N.Name&&e.assign((0,N._)`${t}.props`,r),n instanceof N.Name&&e.assign((0,N._)`${t}.items`,n)}function xS(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:c,self:u}=e,{RULES:p}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,gn.schemaHasRulesButRef)(i,p))){o.block(()=>IS(e,"$ref",p.all.$ref.definition));return}c.jtd||rL(e,t),o.block(()=>{for(let d of p.rules)l(d);l(p.post)});function l(d){(0,Bh.shouldUseGroup)(i,d)&&(d.type?(o.if((0,Zu.checkDataType)(d.type,s,c.strictNumbers)),kS(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,Zu.reportTypeError)(e)),o.endIf()):kS(e,d),a||o.if((0,N._)`${F.default.errors} === ${n||0}`))}}function kS(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,UM.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Bh.shouldUseRule)(n,i)&&IS(e,i.keyword,i.definition,t.type)})}function rL(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(nL(e,t),e.opts.allowUnionTypes||oL(e,t),iL(e,e.dataTypes))}function nL(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{RS(e.dataTypes,r)||Vh(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),aL(e,t)}}function oL(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Vh(e,"use allowUnionTypes to allow union type keyword")}function iL(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Bh.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>sL(t,s))&&Vh(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function sL(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function RS(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function aL(e,t){let r=[];for(let n of e.dataTypes)RS(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Vh(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,gn.checkStrictMode)(e,t,e.opts.strictTypes)}var Uu=class{constructor(t,r,n){if((0,na.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,gn.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",zS(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,na.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",F.default.errors))}result(t,r,n){this.failResult((0,N.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,N.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,N._)`${r} !== undefined && (${(0,N.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?ra.reportExtraError:ra.reportError)(this,this.def.error,r)}$dataError(){(0,ra.reportError)(this,this.def.$dataError||ra.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ra.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=N.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=N.nil,r=N.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,N.or)((0,N._)`${o} === undefined`,r)),t!==N.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==N.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,N.or)(s(),a());function s(){if(n.length){if(!(r instanceof N.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,N._)`${(0,Zu.checkDataTypes)(c,r,i.opts.strictNumbers,Zu.DataType.Wrong)}`}return N.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,N._)`!${c}(${r})`}return N.nil}}subschema(t,r){let n=(0,Gh.getSubschema)(this.it,t);(0,Gh.extendSubschemaData)(n,this.it,t),(0,Gh.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return WM(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=gn.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=gn.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,N.Name)),!0}};Hn.KeywordCxt=Uu;function IS(e,t,r,n){let o=new Uu(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,na.funcKeywordCode)(o,r):"macro"in r?(0,na.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,na.funcKeywordCode)(o,r)}var cL=/^\/(?:[^~]|~0|~1)*$/,uL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function zS(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return F.default.rootData;if(e[0]==="/"){if(!cL.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=F.default.rootData}else{let u=uL.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let p=+u[1];if(o=u[2],o==="#"){if(p>=t)throw new Error(c("property/index",p));return n[t-p]}if(p>t)throw new Error(c("data",p));if(i=r[t-p],!o)return i}let s=i,a=o.split("/");for(let u of a)u&&(i=(0,N._)`${i}${(0,N.getProperty)((0,gn.unescapeJsonPointer)(u))}`,s=(0,N._)`${s} && ${i}`);return s;function c(u,p){return`Cannot access ${u} ${p} levels up, current level is ${t}`}}Hn.getData=zS});var qu=$(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});var Hh=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Wh.default=Hh});var ia=$(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});var Kh=ta(),Jh=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Kh.resolveUrl)(t,r,n),this.missingSchema=(0,Kh.normalizeId)((0,Kh.getFullPath)(t,this.missingRef))}};Yh.default=Jh});var Gu=$(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.resolveSchema=dr.getCompilingSchema=dr.resolveRef=dr.compileSchema=dr.SchemaEnv=void 0;var Er=Y(),lL=qu(),qo=mn(),Cr=ta(),DS=le(),pL=oa(),Ni=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Cr.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};dr.SchemaEnv=Ni;function Xh(e){let t=OS.call(this,e);if(t)return t;let r=(0,Cr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Er.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:lL.default,code:(0,Er._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:qo.default.data,parentData:qo.default.parentData,parentDataProperty:qo.default.parentDataProperty,dataNames:[qo.default.data],dataPathArr:[Er.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Er.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Er.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Er._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(e),(0,pL.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let l=s.toString();p=`${s.scopeRefs(qo.default.scope)}return ${l}`,this.opts.code.process&&(p=this.opts.code.process(p,e));let f=new Function(`${qo.default.self}`,`${qo.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:l,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:g}=u;f.evaluated={props:h instanceof Er.Name?void 0:h,items:g instanceof Er.Name?void 0:g,dynamicProps:h instanceof Er.Name,dynamicItems:g instanceof Er.Name},f.source&&(f.source.evaluated=(0,Er.stringify)(f.evaluated))}return e.validate=f,e}catch(l){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),l}finally{this._compilations.delete(e)}}dr.compileSchema=Xh;function dL(e,t,r){var n;r=(0,Cr.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=mL.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(i=new Ni({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=fL.call(this,i)}dr.resolveRef=dL;function fL(e){return(0,Cr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Xh.call(this,e)}function OS(e){for(let t of this._compilations)if(hL(t,e))return t}dr.getCompilingSchema=OS;function hL(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function mL(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Fu.call(this,e,t)}function Fu(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Cr._getFullPath)(this.opts.uriResolver,r),o=(0,Cr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return Qh.call(this,r,e);let i=(0,Cr.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=Fu.call(this,e,s);return typeof a?.schema!="object"?void 0:Qh.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||Xh.call(this,s),i===(0,Cr.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,Cr.resolveUrl)(this.opts.uriResolver,o,u)),new Ni({schema:a,schemaId:c,root:e,baseId:o})}return Qh.call(this,r,s)}}dr.resolveSchema=Fu;var gL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qh(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,DS.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!gL.has(a)&&u&&(t=(0,Cr.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,DS.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Cr.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Fu.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new Ni({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var NS=$((aJ,yL)=>{yL.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var tm=$((cJ,ZS)=>{"use strict";var _L=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),MS=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function em(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var vL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function jS(e){return e.length=0,!0}function wL(e,t,r){if(e.length){let n=em(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function bL(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=wL;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(o,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=jS}else{o.push(u);continue}}return o.length&&(a===jS?r.zone=o.join(""):s?n.push(o.join("")):n.push(em(o))),r.address=n.join(""),r}function LS(e){if(xL(e,":")<2)return{host:e,isIPV6:!1};let t=bL(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function xL(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function kL(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(o===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function SL(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function $L(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!MS(r)){let n=LS(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}ZS.exports={nonSimpleDomain:vL,recomposeAuthority:$L,normalizeComponentEncoding:SL,removeDotSegments:kL,isIPv4:MS,isUUID:_L,normalizeIPv6:LS,stringArrayToHexStripped:em}});var BS=$((uJ,GS)=>{"use strict";var{isUUID:PL}=tm(),EL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,CL=["http","https","ws","wss","urn","urn:uuid"];function TL(e){return CL.indexOf(e)!==-1}function rm(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function US(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function qS(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function AL(e){return e.secure=rm(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function RL(e){if((e.port===(rm(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function IL(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(EL);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=nm(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function zL(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=nm(o);i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s}function DL(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!PL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function OL(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var FS={scheme:"http",domainHost:!0,parse:US,serialize:qS},NL={scheme:"https",domainHost:FS.domainHost,parse:US,serialize:qS},Bu={scheme:"ws",domainHost:!0,parse:AL,serialize:RL},jL={scheme:"wss",domainHost:Bu.domainHost,parse:Bu.parse,serialize:Bu.serialize},ML={scheme:"urn",parse:IL,serialize:zL,skipNormalize:!0},LL={scheme:"urn:uuid",parse:DL,serialize:OL,skipNormalize:!0},Vu={http:FS,https:NL,ws:Bu,wss:jL,urn:ML,"urn:uuid":LL};Object.setPrototypeOf(Vu,null);function nm(e){return e&&(Vu[e]||Vu[e.toLowerCase()])||void 0}GS.exports={wsIsSecure:rm,SCHEMES:Vu,isValidSchemeName:TL,getSchemeHandler:nm}});var WS=$((lJ,Wu)=>{"use strict";var{normalizeIPv6:ZL,removeDotSegments:sa,recomposeAuthority:UL,normalizeComponentEncoding:Hu,isIPv4:qL,nonSimpleDomain:FL}=tm(),{SCHEMES:GL,getSchemeHandler:VS}=BS();function BL(e,t){return typeof e=="string"?e=Br(yn(e,t),t):typeof e=="object"&&(e=yn(Br(e,t),t)),e}function VL(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=HS(yn(e,n),yn(t,n),n,!0);return n.skipEscape=!0,Br(o,n)}function HS(e,t,r,n){let o={};return n||(e=yn(Br(e,r),r),t=yn(Br(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=sa(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=sa(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=sa(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=sa(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function HL(e,t,r){return typeof e=="string"?(e=unescape(e),e=Br(Hu(yn(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Br(Hu(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Br(Hu(yn(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Br(Hu(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Br(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=VS(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let s=UL(r);if(s!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(s),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=sa(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var WL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yn(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let i=e.match(WL);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(qL(n.host)===!1){let c=ZL(n.host);n.host=c.host.toLowerCase(),o=c.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let s=VS(r.scheme||n.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&n.host&&(r.domainHost||s&&s.domainHost)&&o===!1&&FL(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),s&&s.parse&&s.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var om={SCHEMES:GL,normalize:BL,resolve:VL,resolveComponent:HS,equal:HL,serialize:Br,parse:yn};Wu.exports=om;Wu.exports.default=om;Wu.exports.fastUri=om});var JS=$(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var KS=WS();KS.code='require("ajv/dist/runtime/uri").default';im.default=KS});var o$=$(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.CodeGen=dt.Name=dt.nil=dt.stringify=dt.str=dt._=dt.KeywordCxt=void 0;var KL=oa();Object.defineProperty(dt,"KeywordCxt",{enumerable:!0,get:function(){return KL.KeywordCxt}});var ji=Y();Object.defineProperty(dt,"_",{enumerable:!0,get:function(){return ji._}});Object.defineProperty(dt,"str",{enumerable:!0,get:function(){return ji.str}});Object.defineProperty(dt,"stringify",{enumerable:!0,get:function(){return ji.stringify}});Object.defineProperty(dt,"nil",{enumerable:!0,get:function(){return ji.nil}});Object.defineProperty(dt,"Name",{enumerable:!0,get:function(){return ji.Name}});Object.defineProperty(dt,"CodeGen",{enumerable:!0,get:function(){return ji.CodeGen}});var JL=qu(),t$=ia(),YL=Dh(),aa=Gu(),QL=Y(),ca=ta(),Ku=ea(),am=le(),YS=NS(),XL=JS(),r$=(e,t)=>new RegExp(e,t);r$.code="new RegExp";var e3=["removeAdditional","useDefaults","coerceTypes"],t3=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),r3={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},n3={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},QS=200;function o3(e){var t,r,n,o,i,s,a,c,u,p,l,d,f,h,g,y,v,w,x,k,P,q,L,Ue,we;let Q=e.strict,qe=(t=e.code)===null||t===void 0?void 0:t.optimize,Be=qe===!0||qe===void 0?1:qe||0,En=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:r$,ao=(o=e.uriResolver)!==null&&o!==void 0?o:XL.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:Q)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:Q)!==null&&c!==void 0?c:!0,strictTypes:(p=(u=e.strictTypes)!==null&&u!==void 0?u:Q)!==null&&p!==void 0?p:"log",strictTuples:(d=(l=e.strictTuples)!==null&&l!==void 0?l:Q)!==null&&d!==void 0?d:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:Q)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Be,regExp:En}:{optimize:Be,regExp:En},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:QS,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:QS,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:(x=e.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(k=e.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(P=e.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(q=e.validateSchema)!==null&&q!==void 0?q:!0,validateFormats:(L=e.validateFormats)!==null&&L!==void 0?L:!0,unicodeRegExp:(Ue=e.unicodeRegExp)!==null&&Ue!==void 0?Ue:!0,int32range:(we=e.int32range)!==null&&we!==void 0?we:!0,uriResolver:ao}}var ua=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...o3(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new QL.ValueScope({scope:{},prefixes:t3,es5:r,lines:n}),this.logger=l3(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,YL.getRules)(),XS.call(this,r3,t,"NOT SUPPORTED"),XS.call(this,n3,t,"DEPRECATED","warn"),this._metaOpts=c3.call(this),t.formats&&s3.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&a3.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),i3.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=YS;n==="id"&&(o={...YS},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(p,l){await i.call(this,p.$schema);let d=this._addSchema(p,l);return d.validate||s.call(this,d)}async function i(p){p&&!this.getSchema(p)&&await o.call(this,{$ref:p},!0)}async function s(p){try{return this._compileSchemaEnv(p)}catch(l){if(!(l instanceof t$.default))throw l;return a.call(this,l),await c.call(this,l.missingSchema),s.call(this,p)}}function a({missingSchema:p,missingRef:l}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${l} cannot be resolved`)}async function c(p){let l=await u.call(this,p);this.refs[p]||await i.call(this,l.$schema),this.refs[p]||this.addSchema(l,p,r)}async function u(p){let l=this._loading[p];if(l)return l;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error(`schema ${s} must be string`)}return r=(0,ca.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=e$.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new aa.SchemaEnv({schema:{},schemaId:n});if(r=aa.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=e$.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,ca.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(d3.call(this,n,r),!r)return(0,am.eachItem)(n,i=>sm.call(this,i)),this;h3.call(this,r);let o={...r,type:(0,Ku.getJSONTypes)(r.type),schemaType:(0,Ku.getJSONTypes)(r.schemaType)};return(0,am.eachItem)(n,o.type.length===0?i=>sm.call(this,i,o):i=>o.type.forEach(s=>sm.call(this,i,o,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),s=t;for(let a of i)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,p=s[a];u&&p&&(s[a]=n$(p))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,ca.normalizeId)(s||n);let u=ca.getSchemaRefs.call(this,t,n);return c=new aa.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):aa.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{aa.compileSchema.call(this,t)}finally{this.opts=r}}};ua.ValidationError=JL.default;ua.MissingRefError=t$.default;dt.default=ua;function XS(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function e$(e){return e=(0,ca.normalizeId)(e),this.schemas[e]||this.refs[e]}function i3(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function s3(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function a3(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function c3(){let e={...this.opts};for(let t of e3)delete e[t];return e}var u3={log(){},warn(){},error(){}};function l3(e){if(e===!1)return u3;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var p3=/^[a-z_$][a-z0-9_$:-]*$/i;function d3(e,t){let{RULES:r}=this;if((0,am.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!p3.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function sm(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=o?i.post:i.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,Ku.getJSONTypes)(t.type),schemaType:(0,Ku.getJSONTypes)(t.schemaType)}};t.before?f3.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function f3(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function h3(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=n$(t)),e.validateSchema=this.compile(t,!0))}var m3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function n$(e){return{anyOf:[e,m3]}}});var i$=$(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var g3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};cm.default=g3});var u$=$(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.callRef=Fo.getValidate=void 0;var y3=ia(),s$=pr(),Vt=Y(),Mi=mn(),a$=Gu(),Ju=le(),_3={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return l();let p=a$.resolveRef.call(c,u,o,r);if(p===void 0)throw new y3.default(n.opts.uriResolver,o,r);if(p instanceof a$.SchemaEnv)return d(p);return f(p);function l(){if(i===u)return Yu(e,s,i,i.$async);let h=t.scopeValue("root",{ref:u});return Yu(e,(0,Vt._)`${h}.validate`,u,u.$async)}function d(h){let g=c$(e,h);Yu(e,g,h,h.$async)}function f(h){let g=t.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,Vt.stringify)(h)}:{ref:h}),y=t.name("valid"),v=e.subschema({schema:h,dataTypes:[],schemaPath:Vt.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function c$(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Vt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Fo.getValidate=c$;function Yu(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?Mi.default.this:Vt.nil;n?p():l();function p(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=o.let("valid");o.try(()=>{o.code((0,Vt._)`await ${(0,s$.callValidateCode)(e,t,u)}`),f(t),s||o.assign(h,!0)},g=>{o.if((0,Vt._)`!(${g} instanceof ${i.ValidationError})`,()=>o.throw(g)),d(g),s||o.assign(h,!1)}),e.ok(h)}function l(){e.result((0,s$.callValidateCode)(e,t,u),()=>f(t),()=>d(t))}function d(h){let g=(0,Vt._)`${h}.errors`;o.assign(Mi.default.vErrors,(0,Vt._)`${Mi.default.vErrors} === null ? ${g} : ${Mi.default.vErrors}.concat(${g})`),o.assign(Mi.default.errors,(0,Vt._)`${Mi.default.vErrors}.length`)}function f(h){var g;if(!i.opts.unevaluated)return;let y=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(i.props=Ju.mergeEvaluated.props(o,y.props,i.props));else{let v=o.var("props",(0,Vt._)`${h}.evaluated.props`);i.props=Ju.mergeEvaluated.props(o,v,i.props,Vt.Name)}if(i.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(i.items=Ju.mergeEvaluated.items(o,y.items,i.items));else{let v=o.var("items",(0,Vt._)`${h}.evaluated.items`);i.items=Ju.mergeEvaluated.items(o,v,i.items,Vt.Name)}}}Fo.callRef=Yu;Fo.default=_3});var l$=$(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var v3=i$(),w3=u$(),b3=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",v3.default,w3.default];um.default=b3});var p$=$(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var Qu=Y(),Wn=Qu.operators,Xu={maximum:{okStr:"<=",ok:Wn.LTE,fail:Wn.GT},minimum:{okStr:">=",ok:Wn.GTE,fail:Wn.LT},exclusiveMaximum:{okStr:"<",ok:Wn.LT,fail:Wn.GTE},exclusiveMinimum:{okStr:">",ok:Wn.GT,fail:Wn.LTE}},x3={message:({keyword:e,schemaCode:t})=>(0,Qu.str)`must be ${Xu[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Qu._)`{comparison: ${Xu[e].okStr}, limit: ${t}}`},k3={keyword:Object.keys(Xu),type:"number",schemaType:"number",$data:!0,error:x3,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Qu._)`${r} ${Xu[t].fail} ${n} || isNaN(${r})`)}};lm.default=k3});var d$=$(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var la=Y(),S3={message:({schemaCode:e})=>(0,la.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,la._)`{multipleOf: ${e}}`},$3={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:S3,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,la._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,la._)`${s} !== parseInt(${s})`;e.fail$data((0,la._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};pm.default=$3});var h$=$(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});function f$(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}dm.default=f$;f$.code='require("ajv/dist/runtime/ucs2length").default'});var m$=$(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var Go=Y(),P3=le(),E3=h$(),C3={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Go.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Go._)`{limit: ${e}}`},T3={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:C3,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?Go.operators.GT:Go.operators.LT,s=o.opts.unicode===!1?(0,Go._)`${r}.length`:(0,Go._)`${(0,P3.useFunc)(e.gen,E3.default)}(${r})`;e.fail$data((0,Go._)`${s} ${i} ${n}`)}};fm.default=T3});var g$=$(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});var A3=pr(),el=Y(),R3={message:({schemaCode:e})=>(0,el.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,el._)`{pattern: ${e}}`},I3={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:R3,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,el._)`(new RegExp(${o}, ${s}))`:(0,A3.usePattern)(e,n);e.fail$data((0,el._)`!${a}.test(${t})`)}};hm.default=I3});var y$=$(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});var pa=Y(),z3={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,pa.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,pa._)`{limit: ${e}}`},D3={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:z3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?pa.operators.GT:pa.operators.LT;e.fail$data((0,pa._)`Object.keys(${r}).length ${o} ${n}`)}};mm.default=D3});var _$=$(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});var da=pr(),fa=Y(),O3=le(),N3={message:({params:{missingProperty:e}})=>(0,fa.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,fa._)`{missingProperty: ${e}}`},j3={keyword:"required",type:"object",schemaType:"array",$data:!0,error:N3,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?u():p(),a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let g of r)if(f?.[g]===void 0&&!h.has(g)){let y=s.schemaEnv.baseId+s.errSchemaPath,v=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,O3.checkStrictMode)(s,v,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(fa.nil,l);else for(let f of r)(0,da.checkReportMissingProp)(e,f)}function p(){let f=t.let("missing");if(c||i){let h=t.let("valid",!0);e.block$data(h,()=>d(f,h)),e.ok(h)}else t.if((0,da.checkMissingProp)(e,r,f)),(0,da.reportMissingProp)(e,f),t.else()}function l(){t.forOf("prop",n,f=>{e.setParams({missingProperty:f}),t.if((0,da.noPropertyInData)(t,o,f,a.ownProperties),()=>e.error())})}function d(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,(0,da.propertyInData)(t,o,f,a.ownProperties)),t.if((0,fa.not)(h),()=>{e.error(),t.break()})},fa.nil)}}};gm.default=j3});var v$=$(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});var ha=Y(),M3={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,ha.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,ha._)`{limit: ${e}}`},L3={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:M3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?ha.operators.GT:ha.operators.LT;e.fail$data((0,ha._)`${r}.length ${o} ${n}`)}};ym.default=L3});var tl=$(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});var w$=qh();w$.code='require("ajv/dist/runtime/equal").default';_m.default=w$});var b$=$(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});var vm=ea(),ft=Y(),Z3=le(),U3=tl(),q3={message:({params:{i:e,j:t}})=>(0,ft.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,ft._)`{i: ${e}, j: ${t}}`},F3={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:q3,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let c=t.let("valid"),u=i.items?(0,vm.getSchemaTypes)(i.items):[];e.block$data(c,p,(0,ft._)`${s} === false`),e.ok(c);function p(){let h=t.let("i",(0,ft._)`${r}.length`),g=t.let("j");e.setParams({i:h,j:g}),t.assign(c,!0),t.if((0,ft._)`${h} > 1`,()=>(l()?d:f)(h,g))}function l(){return u.length>0&&!u.some(h=>h==="object"||h==="array")}function d(h,g){let y=t.name("item"),v=(0,vm.checkDataTypes)(u,y,a.opts.strictNumbers,vm.DataType.Wrong),w=t.const("indices",(0,ft._)`{}`);t.for((0,ft._)`;${h}--;`,()=>{t.let(y,(0,ft._)`${r}[${h}]`),t.if(v,(0,ft._)`continue`),u.length>1&&t.if((0,ft._)`typeof ${y} == "string"`,(0,ft._)`${y} += "_"`),t.if((0,ft._)`typeof ${w}[${y}] == "number"`,()=>{t.assign(g,(0,ft._)`${w}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,ft._)`${w}[${y}] = ${h}`)})}function f(h,g){let y=(0,Z3.useFunc)(t,U3.default),v=t.name("outer");t.label(v).for((0,ft._)`;${h}--;`,()=>t.for((0,ft._)`${g} = ${h}; ${g}--;`,()=>t.if((0,ft._)`${y}(${r}[${h}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};wm.default=F3});var x$=$(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var bm=Y(),G3=le(),B3=tl(),V3={message:"must be equal to constant",params:({schemaCode:e})=>(0,bm._)`{allowedValue: ${e}}`},H3={keyword:"const",$data:!0,error:V3,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,bm._)`!${(0,G3.useFunc)(t,B3.default)}(${r}, ${o})`):e.fail((0,bm._)`${i} !== ${r}`)}};xm.default=H3});var k$=$(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});var ma=Y(),W3=le(),K3=tl(),J3={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ma._)`{allowedValues: ${e}}`},Y3={keyword:"enum",schemaType:"array",$data:!0,error:J3,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,c,u=()=>c??(c=(0,W3.useFunc)(t,K3.default)),p;if(a||n)p=t.let("valid"),e.block$data(p,l);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let f=t.const("vSchema",i);p=(0,ma.or)(...o.map((h,g)=>d(f,g)))}e.pass(p);function l(){t.assign(p,!1),t.forOf("v",i,f=>t.if((0,ma._)`${u()}(${r}, ${f})`,()=>t.assign(p,!0).break()))}function d(f,h){let g=o[h];return typeof g=="object"&&g!==null?(0,ma._)`${u()}(${r}, ${f}[${h}])`:(0,ma._)`${r} === ${g}`}}};km.default=Y3});var S$=$(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var Q3=p$(),X3=d$(),e5=m$(),t5=g$(),r5=y$(),n5=_$(),o5=v$(),i5=b$(),s5=x$(),a5=k$(),c5=[Q3.default,X3.default,e5.default,t5.default,r5.default,n5.default,o5.default,i5.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},s5.default,a5.default];Sm.default=c5});var Pm=$(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.validateAdditionalItems=void 0;var Bo=Y(),$m=le(),u5={message:({params:{len:e}})=>(0,Bo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Bo._)`{limit: ${e}}`},l5={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:u5,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,$m.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}$$(e,n)}};function $$(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,Bo._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Bo._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,$m.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,Bo._)`${a} <= ${t.length}`);r.if((0,Bo.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,p=>{e.subschema({keyword:i,dataProp:p,dataPropType:$m.Type.Num},u),s.allErrors||r.if((0,Bo.not)(u),()=>r.break())})}}ga.validateAdditionalItems=$$;ga.default=l5});var Em=$(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.validateTuple=void 0;var P$=Y(),rl=le(),p5=pr(),d5={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return E$(e,"additionalItems",t);r.items=!0,!(0,rl.alwaysValidSchema)(r,t)&&e.ok((0,p5.validateArray)(e))}};function E$(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;p(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=rl.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,P$._)`${i}.length`);r.forEach((l,d)=>{(0,rl.alwaysValidSchema)(a,l)||(n.if((0,P$._)`${u} > ${d}`,()=>e.subschema({keyword:s,schemaProp:d,dataProp:d},c)),e.ok(c))});function p(l){let{opts:d,errSchemaPath:f}=a,h=r.length,g=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(d.strictTuples&&!g){let y=`"${s}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;(0,rl.checkStrictMode)(a,y,d.strictTuples)}}}ya.validateTuple=E$;ya.default=d5});var C$=$(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});var f5=Em(),h5={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,f5.validateTuple)(e,"items")};Cm.default=h5});var A$=$(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});var T$=Y(),m5=le(),g5=pr(),y5=Pm(),_5={message:({params:{len:e}})=>(0,T$.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,T$._)`{limit: ${e}}`},v5={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_5,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,m5.alwaysValidSchema)(n,t)&&(o?(0,y5.validateAdditionalItems)(e,o):e.ok((0,g5.validateArray)(e)))}};Tm.default=v5});var R$=$(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var fr=Y(),nl=le(),w5={message:({params:{min:e,max:t}})=>t===void 0?(0,fr.str)`must contain at least ${e} valid item(s)`:(0,fr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,fr._)`{minContains: ${e}}`:(0,fr._)`{minContains: ${e}, maxContains: ${t}}`},b5={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:w5,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:c,maxContains:u}=n;i.opts.next?(s=c===void 0?1:c,a=u):s=1;let p=t.const("len",(0,fr._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,nl.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,nl.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,nl.alwaysValidSchema)(i,r)){let g=(0,fr._)`${p} >= ${s}`;a!==void 0&&(g=(0,fr._)`${g} && ${p} <= ${a}`),e.pass(g);return}i.items=!0;let l=t.name("valid");a===void 0&&s===1?f(l,()=>t.if(l,()=>t.break())):s===0?(t.let(l,!0),a!==void 0&&t.if((0,fr._)`${o}.length > 0`,d)):(t.let(l,!1),d()),e.result(l,()=>e.reset());function d(){let g=t.name("_valid"),y=t.let("count",0);f(g,()=>t.if(g,()=>h(y)))}function f(g,y){t.forRange("i",0,p,v=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:nl.Type.Num,compositeRule:!0},g),y()})}function h(g){t.code((0,fr._)`${g}++`),a===void 0?t.if((0,fr._)`${g} >= ${s}`,()=>t.assign(l,!0).break()):(t.if((0,fr._)`${g} > ${a}`,()=>t.assign(l,!1).break()),s===1?t.assign(l,!0):t.if((0,fr._)`${g} >= ${s}`,()=>t.assign(l,!0)))}}};Am.default=b5});var D$=$(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.validateSchemaDeps=Vr.validatePropertyDeps=Vr.error=void 0;var Rm=Y(),x5=le(),_a=pr();Vr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Rm.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Rm._)`{property: ${e},
76
+ || ${s} === "boolean" || ${o} === null`).assign(a,(0,H._)`[${o}]`)}}}function nM({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,H._)`${t} !== undefined`,()=>e.assign((0,H._)`${t}[${r}]`,n))}function Nh(e,t,r,n=zi.Correct){let o=n===zi.Correct?H.operators.EQ:H.operators.NEQ,i;switch(e){case"null":return(0,H._)`${t} ${o} null`;case"array":i=(0,H._)`Array.isArray(${t})`;break;case"object":i=(0,H._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,H._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,H._)`typeof ${t} ${o} ${e}`}return n===zi.Correct?i:(0,H.not)(i);function s(a=H.nil){return(0,H.and)((0,H._)`typeof ${t} == "number"`,a,r?(0,H._)`isFinite(${t})`:H.nil)}}kt.checkDataType=Nh;function jh(e,t,r,n){if(e.length===1)return Nh(e[0],t,r,n);let o,i=(0,rS.toHash)(e);if(i.array&&i.object){let s=(0,H._)`typeof ${t} != "object"`;o=i.null?s:(0,H._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=H.nil;i.number&&delete i.integer;for(let s in i)o=(0,H.and)(o,Nh(s,t,r,n));return o}kt.checkDataTypes=jh;var oM={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,H._)`{type: ${e}}`:(0,H._)`{type: ${t}}`};function Mh(e){let t=iM(e);(0,Q4.reportError)(t,oM)}kt.reportTypeError=Mh;function iM(e){let{gen:t,data:r,schema:n}=e,o=(0,rS.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var sS=$(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.assignDefaults=void 0;var Di=Y(),sM=le();function aM(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)iS(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>iS(e,i,o.default))}Mu.assignDefaults=aM;function iS(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Di._)`${i}${(0,Di.getProperty)(t)}`;if(o){(0,sM.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Di._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Di._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Di._)`${a} = ${(0,Di.stringify)(r)}`)}});var pr=$(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.validateUnion=ge.validateArray=ge.usePattern=ge.callValidateCode=ge.schemaProperties=ge.allSchemaProperties=ge.noPropertyInData=ge.propertyInData=ge.isOwnProperty=ge.hasPropFunc=ge.reportMissingProp=ge.checkMissingProp=ge.checkReportMissingProp=void 0;var Te=Y(),Lh=le(),Gn=mn(),cM=le();function uM(e,t){let{gen:r,data:n,it:o}=e;r.if(Uh(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Te._)`${t}`},!0),e.error()})}ge.checkReportMissingProp=uM;function lM({gen:e,data:t,it:{opts:r}},n,o){return(0,Te.or)(...n.map(i=>(0,Te.and)(Uh(e,t,i,r.ownProperties),(0,Te._)`${o} = ${i}`)))}ge.checkMissingProp=lM;function pM(e,t){e.setParams({missingProperty:t},!0),e.error()}ge.reportMissingProp=pM;function aS(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Te._)`Object.prototype.hasOwnProperty`})}ge.hasPropFunc=aS;function Zh(e,t,r){return(0,Te._)`${aS(e)}.call(${t}, ${r})`}ge.isOwnProperty=Zh;function dM(e,t,r,n){let o=(0,Te._)`${t}${(0,Te.getProperty)(r)} !== undefined`;return n?(0,Te._)`${o} && ${Zh(e,t,r)}`:o}ge.propertyInData=dM;function Uh(e,t,r,n){let o=(0,Te._)`${t}${(0,Te.getProperty)(r)} === undefined`;return n?(0,Te.or)(o,(0,Te.not)(Zh(e,t,r))):o}ge.noPropertyInData=Uh;function cS(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ge.allSchemaProperties=cS;function fM(e,t){return cS(t).filter(r=>!(0,Lh.alwaysValidSchema)(e,t[r]))}ge.schemaProperties=fM;function hM({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let p=u?(0,Te._)`${e}, ${t}, ${n}${o}`:t,l=[[Gn.default.instancePath,(0,Te.strConcat)(Gn.default.instancePath,i)],[Gn.default.parentData,s.parentData],[Gn.default.parentDataProperty,s.parentDataProperty],[Gn.default.rootData,Gn.default.rootData]];s.opts.dynamicRef&&l.push([Gn.default.dynamicAnchors,Gn.default.dynamicAnchors]);let d=(0,Te._)`${p}, ${r.object(...l)}`;return c!==Te.nil?(0,Te._)`${a}.call(${c}, ${d})`:(0,Te._)`${a}(${d})`}ge.callValidateCode=hM;var mM=(0,Te._)`new RegExp`;function gM({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Te._)`${o.code==="new RegExp"?mM:(0,cM.useFunc)(e,o)}(${r}, ${n})`})}ge.usePattern=gM;function yM(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let c=t.const("len",(0,Te._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Lh.Type.Num},i),t.if((0,Te.not)(i),a)})}}ge.validateArray=yM;function _M(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Lh.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let p=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,Te._)`${s} || ${a}`),e.mergeValidEvaluated(p,a)||t.if((0,Te.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ge.validateUnion=_M});var pS=$(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.validateKeywordUsage=Fr.validSchemaType=Fr.funcKeywordCode=Fr.macroKeywordCode=void 0;var zt=Y(),Uo=mn(),vM=pr(),wM=Xs();function bM(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=lS(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:zt.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Fr.macroKeywordCode=bM;function xM(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;SM(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,p=lS(n,o,u),l=n.let("valid");e.block$data(l,d),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function d(){if(t.errors===!1)g(),t.modifying&&uS(e),y(()=>e.error());else{let v=t.async?f():h();t.modifying&&uS(e),y(()=>kM(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>g((0,zt._)`await `),w=>n.assign(l,!1).if((0,zt._)`${w} instanceof ${c.ValidationError}`,()=>n.assign(v,(0,zt._)`${w}.errors`),()=>n.throw(w))),v}function h(){let v=(0,zt._)`${p}.errors`;return n.assign(v,null),g(zt.nil),v}function g(v=t.async?(0,zt._)`await `:zt.nil){let w=c.opts.passContext?Uo.default.this:Uo.default.self,x=!("compile"in t&&!a||t.schema===!1);n.assign(l,(0,zt._)`${v}${(0,vM.callValidateCode)(e,p,w,x)}`,t.modifying)}function y(v){var w;n.if((0,zt.not)((w=t.valid)!==null&&w!==void 0?w:l),v)}}Fr.funcKeywordCode=xM;function uS(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,zt._)`${n.parentData}[${n.parentDataProperty}]`))}function kM(e,t){let{gen:r}=e;r.if((0,zt._)`Array.isArray(${t})`,()=>{r.assign(Uo.default.vErrors,(0,zt._)`${Uo.default.vErrors} === null ? ${t} : ${Uo.default.vErrors}.concat(${t})`).assign(Uo.default.errors,(0,zt._)`${Uo.default.vErrors}.length`),(0,wM.extendErrors)(e)},()=>e.error())}function SM({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function lS(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,zt.stringify)(r)})}function $M(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Fr.validSchemaType=$M;function PM({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let s=o.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Fr.validateKeywordUsage=PM});var fS=$(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.extendSubschemaMode=Bn.extendSubschemaData=Bn.getSubschema=void 0;var Gr=Y(),dS=le();function EM(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,Gr._)`${e.schemaPath}${(0,Gr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,Gr._)`${e.schemaPath}${(0,Gr.getProperty)(t)}${(0,Gr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,dS.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Bn.getSubschema=EM;function CM(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:p,opts:l}=t,d=a.let("data",(0,Gr._)`${t.data}${(0,Gr.getProperty)(r)}`,!0);c(d),e.errorPath=(0,Gr.str)`${u}${(0,dS.getErrorPath)(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=(0,Gr._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(o!==void 0){let u=o instanceof Gr.Name?o:a.let("data",o,!0);c(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Bn.extendSubschemaData=CM;function TM(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Bn.extendSubschemaMode=TM});var qh=$((rJ,hS)=>{"use strict";hS.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var gS=$((nJ,mS)=>{"use strict";var Vn=mS.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Lu(t,n,o,e,"",e)};Vn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Vn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Vn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Vn.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Lu(e,t,r,n,o,i,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,u);for(var p in n){var l=n[p];if(Array.isArray(l)){if(p in Vn.arrayKeywords)for(var d=0;d<l.length;d++)Lu(e,t,r,l[d],o+"/"+p+"/"+d,i,o,p,n,d)}else if(p in Vn.propsKeywords){if(l&&typeof l=="object")for(var f in l)Lu(e,t,r,l[f],o+"/"+p+"/"+AM(f),i,o,p,n,f)}else(p in Vn.keywords||e.allKeys&&!(p in Vn.skipKeywords))&&Lu(e,t,r,l,o+"/"+p,i,o,p,n)}r(n,o,i,s,a,c,u)}}function AM(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var ta=$(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.getSchemaRefs=Bt.resolveUrl=Bt.normalizeId=Bt._getFullPath=Bt.getFullPath=Bt.inlineRef=void 0;var RM=le(),IM=qh(),zM=gS(),DM=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function OM(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Fh(e):t?yS(e)<=t:!1}Bt.inlineRef=OM;var NM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Fh(e){for(let t in e){if(NM.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Fh)||typeof r=="object"&&Fh(r))return!0}return!1}function yS(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!DM.has(r)&&(typeof e[r]=="object"&&(0,RM.eachItem)(e[r],n=>t+=yS(n)),t===1/0))return 1/0}return t}function _S(e,t="",r){r!==!1&&(t=Oi(t));let n=e.parse(t);return vS(e,n)}Bt.getFullPath=_S;function vS(e,t){return e.serialize(t).split("#")[0]+"#"}Bt._getFullPath=vS;var jM=/#\/?$/;function Oi(e){return e?e.replace(jM,""):""}Bt.normalizeId=Oi;function MM(e,t,r){return r=Oi(r),e.resolve(t,r)}Bt.resolveUrl=MM;var LM=/^[a-z_][-a-z0-9._]*$/i;function ZM(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Oi(e[r]||t),i={"":o},s=_S(n,o,!1),a={},c=new Set;return zM(e,{allKeys:!0},(l,d,f,h)=>{if(h===void 0)return;let g=s+d,y=i[h];typeof l[r]=="string"&&(y=v.call(this,l[r])),w.call(this,l.$anchor),w.call(this,l.$dynamicAnchor),i[d]=y;function v(x){let k=this.opts.uriResolver.resolve;if(x=Oi(y?k(y,x):x),c.has(x))throw p(x);c.add(x);let P=this.refs[x];return typeof P=="string"&&(P=this.refs[P]),typeof P=="object"?u(l,P.schema,x):x!==Oi(g)&&(x[0]==="#"?(u(l,a[x],x),a[x]=l):this.refs[x]=g),x}function w(x){if(typeof x=="string"){if(!LM.test(x))throw new Error(`invalid anchor "${x}"`);v.call(this,`#${x}`)}}}),a;function u(l,d,f){if(d!==void 0&&!IM(l,d))throw p(f)}function p(l){return new Error(`reference "${l}" resolves to more than one schema`)}}Bt.getSchemaRefs=ZM});var oa=$(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.getData=Hn.KeywordCxt=Hn.validateFunctionCode=void 0;var SS=Xk(),wS=ea(),Bh=Oh(),Zu=ea(),UM=sS(),na=pS(),Gh=fS(),N=Y(),F=mn(),qM=ta(),gn=le(),ra=Xs();function FM(e){if(ES(e)&&(CS(e),PS(e))){VM(e);return}$S(e,()=>(0,SS.topBoolOrEmptySchema)(e))}Hn.validateFunctionCode=FM;function $S({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,N._)`${F.default.data}, ${F.default.valCxt}`,n.$async,()=>{e.code((0,N._)`"use strict"; ${bS(r,o)}`),BM(e,o),e.code(i)}):e.func(t,(0,N._)`${F.default.data}, ${GM(o)}`,n.$async,()=>e.code(bS(r,o)).code(i))}function GM(e){return(0,N._)`{${F.default.instancePath}="", ${F.default.parentData}, ${F.default.parentDataProperty}, ${F.default.rootData}=${F.default.data}${e.dynamicRef?(0,N._)`, ${F.default.dynamicAnchors}={}`:N.nil}}={}`}function BM(e,t){e.if(F.default.valCxt,()=>{e.var(F.default.instancePath,(0,N._)`${F.default.valCxt}.${F.default.instancePath}`),e.var(F.default.parentData,(0,N._)`${F.default.valCxt}.${F.default.parentData}`),e.var(F.default.parentDataProperty,(0,N._)`${F.default.valCxt}.${F.default.parentDataProperty}`),e.var(F.default.rootData,(0,N._)`${F.default.valCxt}.${F.default.rootData}`),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`${F.default.valCxt}.${F.default.dynamicAnchors}`)},()=>{e.var(F.default.instancePath,(0,N._)`""`),e.var(F.default.parentData,(0,N._)`undefined`),e.var(F.default.parentDataProperty,(0,N._)`undefined`),e.var(F.default.rootData,F.default.data),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`{}`)})}function VM(e){let{schema:t,opts:r,gen:n}=e;$S(e,()=>{r.$comment&&t.$comment&&AS(e),YM(e),n.let(F.default.vErrors,null),n.let(F.default.errors,0),r.unevaluated&&HM(e),TS(e),eL(e)})}function HM(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,N._)`${r}.evaluated`),t.if((0,N._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,N._)`${e.evaluated}.props`,(0,N._)`undefined`)),t.if((0,N._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,N._)`${e.evaluated}.items`,(0,N._)`undefined`))}function bS(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,N._)`/*# sourceURL=${r} */`:N.nil}function WM(e,t){if(ES(e)&&(CS(e),PS(e))){KM(e,t);return}(0,SS.boolOrEmptySchema)(e,t)}function PS({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function ES(e){return typeof e.schema!="boolean"}function KM(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&AS(e),QM(e),XM(e);let i=n.const("_errs",F.default.errors);TS(e,i),n.var(t,(0,N._)`${i} === ${F.default.errors}`)}function CS(e){(0,gn.checkUnknownRules)(e),JM(e)}function TS(e,t){if(e.opts.jtd)return xS(e,[],!1,t);let r=(0,wS.getSchemaTypes)(e.schema),n=(0,wS.coerceAndCheckDataType)(e,r);xS(e,r,!n,t)}function JM(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,gn.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function YM(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,gn.checkStrictMode)(e,"default is ignored in the schema root")}function QM(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,qM.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function XM(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function AS({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,N._)`${F.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,N.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,N._)`${F.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function eL(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,N._)`${F.default.errors} === 0`,()=>t.return(F.default.data),()=>t.throw((0,N._)`new ${o}(${F.default.vErrors})`)):(t.assign((0,N._)`${n}.errors`,F.default.vErrors),i.unevaluated&&tL(e),t.return((0,N._)`${F.default.errors} === 0`))}function tL({gen:e,evaluated:t,props:r,items:n}){r instanceof N.Name&&e.assign((0,N._)`${t}.props`,r),n instanceof N.Name&&e.assign((0,N._)`${t}.items`,n)}function xS(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:c,self:u}=e,{RULES:p}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,gn.schemaHasRulesButRef)(i,p))){o.block(()=>IS(e,"$ref",p.all.$ref.definition));return}c.jtd||rL(e,t),o.block(()=>{for(let d of p.rules)l(d);l(p.post)});function l(d){(0,Bh.shouldUseGroup)(i,d)&&(d.type?(o.if((0,Zu.checkDataType)(d.type,s,c.strictNumbers)),kS(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,Zu.reportTypeError)(e)),o.endIf()):kS(e,d),a||o.if((0,N._)`${F.default.errors} === ${n||0}`))}}function kS(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,UM.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Bh.shouldUseRule)(n,i)&&IS(e,i.keyword,i.definition,t.type)})}function rL(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(nL(e,t),e.opts.allowUnionTypes||oL(e,t),iL(e,e.dataTypes))}function nL(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{RS(e.dataTypes,r)||Vh(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),aL(e,t)}}function oL(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Vh(e,"use allowUnionTypes to allow union type keyword")}function iL(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Bh.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>sL(t,s))&&Vh(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function sL(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function RS(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function aL(e,t){let r=[];for(let n of e.dataTypes)RS(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Vh(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,gn.checkStrictMode)(e,t,e.opts.strictTypes)}var Uu=class{constructor(t,r,n){if((0,na.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,gn.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",zS(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,na.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",F.default.errors))}result(t,r,n){this.failResult((0,N.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,N.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,N._)`${r} !== undefined && (${(0,N.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?ra.reportExtraError:ra.reportError)(this,this.def.error,r)}$dataError(){(0,ra.reportError)(this,this.def.$dataError||ra.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ra.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=N.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=N.nil,r=N.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,N.or)((0,N._)`${o} === undefined`,r)),t!==N.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==N.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,N.or)(s(),a());function s(){if(n.length){if(!(r instanceof N.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,N._)`${(0,Zu.checkDataTypes)(c,r,i.opts.strictNumbers,Zu.DataType.Wrong)}`}return N.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,N._)`!${c}(${r})`}return N.nil}}subschema(t,r){let n=(0,Gh.getSubschema)(this.it,t);(0,Gh.extendSubschemaData)(n,this.it,t),(0,Gh.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return WM(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=gn.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=gn.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,N.Name)),!0}};Hn.KeywordCxt=Uu;function IS(e,t,r,n){let o=new Uu(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,na.funcKeywordCode)(o,r):"macro"in r?(0,na.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,na.funcKeywordCode)(o,r)}var cL=/^\/(?:[^~]|~0|~1)*$/,uL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function zS(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return F.default.rootData;if(e[0]==="/"){if(!cL.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=F.default.rootData}else{let u=uL.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let p=+u[1];if(o=u[2],o==="#"){if(p>=t)throw new Error(c("property/index",p));return n[t-p]}if(p>t)throw new Error(c("data",p));if(i=r[t-p],!o)return i}let s=i,a=o.split("/");for(let u of a)u&&(i=(0,N._)`${i}${(0,N.getProperty)((0,gn.unescapeJsonPointer)(u))}`,s=(0,N._)`${s} && ${i}`);return s;function c(u,p){return`Cannot access ${u} ${p} levels up, current level is ${t}`}}Hn.getData=zS});var qu=$(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});var Hh=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Wh.default=Hh});var ia=$(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});var Kh=ta(),Jh=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Kh.resolveUrl)(t,r,n),this.missingSchema=(0,Kh.normalizeId)((0,Kh.getFullPath)(t,this.missingRef))}};Yh.default=Jh});var Gu=$(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.resolveSchema=dr.getCompilingSchema=dr.resolveRef=dr.compileSchema=dr.SchemaEnv=void 0;var Er=Y(),lL=qu(),qo=mn(),Cr=ta(),DS=le(),pL=oa(),Ni=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Cr.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};dr.SchemaEnv=Ni;function Xh(e){let t=OS.call(this,e);if(t)return t;let r=(0,Cr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Er.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:lL.default,code:(0,Er._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:qo.default.data,parentData:qo.default.parentData,parentDataProperty:qo.default.parentDataProperty,dataNames:[qo.default.data],dataPathArr:[Er.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Er.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Er.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Er._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(e),(0,pL.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let l=s.toString();p=`${s.scopeRefs(qo.default.scope)}return ${l}`,this.opts.code.process&&(p=this.opts.code.process(p,e));let f=new Function(`${qo.default.self}`,`${qo.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:l,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:g}=u;f.evaluated={props:h instanceof Er.Name?void 0:h,items:g instanceof Er.Name?void 0:g,dynamicProps:h instanceof Er.Name,dynamicItems:g instanceof Er.Name},f.source&&(f.source.evaluated=(0,Er.stringify)(f.evaluated))}return e.validate=f,e}catch(l){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),l}finally{this._compilations.delete(e)}}dr.compileSchema=Xh;function dL(e,t,r){var n;r=(0,Cr.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=mL.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(i=new Ni({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=fL.call(this,i)}dr.resolveRef=dL;function fL(e){return(0,Cr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Xh.call(this,e)}function OS(e){for(let t of this._compilations)if(hL(t,e))return t}dr.getCompilingSchema=OS;function hL(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function mL(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Fu.call(this,e,t)}function Fu(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Cr._getFullPath)(this.opts.uriResolver,r),o=(0,Cr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return Qh.call(this,r,e);let i=(0,Cr.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=Fu.call(this,e,s);return typeof a?.schema!="object"?void 0:Qh.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||Xh.call(this,s),i===(0,Cr.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,Cr.resolveUrl)(this.opts.uriResolver,o,u)),new Ni({schema:a,schemaId:c,root:e,baseId:o})}return Qh.call(this,r,s)}}dr.resolveSchema=Fu;var gL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qh(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,DS.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!gL.has(a)&&u&&(t=(0,Cr.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,DS.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Cr.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Fu.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new Ni({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var NS=$((uJ,yL)=>{yL.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var tm=$((lJ,ZS)=>{"use strict";var _L=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),MS=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function em(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var vL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function jS(e){return e.length=0,!0}function wL(e,t,r){if(e.length){let n=em(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function bL(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=wL;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(o,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=jS}else{o.push(u);continue}}return o.length&&(a===jS?r.zone=o.join(""):s?n.push(o.join("")):n.push(em(o))),r.address=n.join(""),r}function LS(e){if(xL(e,":")<2)return{host:e,isIPV6:!1};let t=bL(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function xL(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function kL(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(o===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function SL(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function $L(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!MS(r)){let n=LS(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}ZS.exports={nonSimpleDomain:vL,recomposeAuthority:$L,normalizeComponentEncoding:SL,removeDotSegments:kL,isIPv4:MS,isUUID:_L,normalizeIPv6:LS,stringArrayToHexStripped:em}});var BS=$((pJ,GS)=>{"use strict";var{isUUID:PL}=tm(),EL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,CL=["http","https","ws","wss","urn","urn:uuid"];function TL(e){return CL.indexOf(e)!==-1}function rm(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function US(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function qS(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function AL(e){return e.secure=rm(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function RL(e){if((e.port===(rm(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function IL(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(EL);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=nm(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function zL(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=nm(o);i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s}function DL(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!PL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function OL(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var FS={scheme:"http",domainHost:!0,parse:US,serialize:qS},NL={scheme:"https",domainHost:FS.domainHost,parse:US,serialize:qS},Bu={scheme:"ws",domainHost:!0,parse:AL,serialize:RL},jL={scheme:"wss",domainHost:Bu.domainHost,parse:Bu.parse,serialize:Bu.serialize},ML={scheme:"urn",parse:IL,serialize:zL,skipNormalize:!0},LL={scheme:"urn:uuid",parse:DL,serialize:OL,skipNormalize:!0},Vu={http:FS,https:NL,ws:Bu,wss:jL,urn:ML,"urn:uuid":LL};Object.setPrototypeOf(Vu,null);function nm(e){return e&&(Vu[e]||Vu[e.toLowerCase()])||void 0}GS.exports={wsIsSecure:rm,SCHEMES:Vu,isValidSchemeName:TL,getSchemeHandler:nm}});var WS=$((dJ,Wu)=>{"use strict";var{normalizeIPv6:ZL,removeDotSegments:sa,recomposeAuthority:UL,normalizeComponentEncoding:Hu,isIPv4:qL,nonSimpleDomain:FL}=tm(),{SCHEMES:GL,getSchemeHandler:VS}=BS();function BL(e,t){return typeof e=="string"?e=Br(yn(e,t),t):typeof e=="object"&&(e=yn(Br(e,t),t)),e}function VL(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=HS(yn(e,n),yn(t,n),n,!0);return n.skipEscape=!0,Br(o,n)}function HS(e,t,r,n){let o={};return n||(e=yn(Br(e,r),r),t=yn(Br(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=sa(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=sa(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=sa(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=sa(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function HL(e,t,r){return typeof e=="string"?(e=unescape(e),e=Br(Hu(yn(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Br(Hu(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Br(Hu(yn(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Br(Hu(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Br(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=VS(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let s=UL(r);if(s!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(s),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=sa(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var WL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yn(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let i=e.match(WL);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(qL(n.host)===!1){let c=ZL(n.host);n.host=c.host.toLowerCase(),o=c.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let s=VS(r.scheme||n.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&n.host&&(r.domainHost||s&&s.domainHost)&&o===!1&&FL(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),s&&s.parse&&s.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var om={SCHEMES:GL,normalize:BL,resolve:VL,resolveComponent:HS,equal:HL,serialize:Br,parse:yn};Wu.exports=om;Wu.exports.default=om;Wu.exports.fastUri=om});var JS=$(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var KS=WS();KS.code='require("ajv/dist/runtime/uri").default';im.default=KS});var o$=$(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.CodeGen=dt.Name=dt.nil=dt.stringify=dt.str=dt._=dt.KeywordCxt=void 0;var KL=oa();Object.defineProperty(dt,"KeywordCxt",{enumerable:!0,get:function(){return KL.KeywordCxt}});var ji=Y();Object.defineProperty(dt,"_",{enumerable:!0,get:function(){return ji._}});Object.defineProperty(dt,"str",{enumerable:!0,get:function(){return ji.str}});Object.defineProperty(dt,"stringify",{enumerable:!0,get:function(){return ji.stringify}});Object.defineProperty(dt,"nil",{enumerable:!0,get:function(){return ji.nil}});Object.defineProperty(dt,"Name",{enumerable:!0,get:function(){return ji.Name}});Object.defineProperty(dt,"CodeGen",{enumerable:!0,get:function(){return ji.CodeGen}});var JL=qu(),t$=ia(),YL=Dh(),aa=Gu(),QL=Y(),ca=ta(),Ku=ea(),am=le(),YS=NS(),XL=JS(),r$=(e,t)=>new RegExp(e,t);r$.code="new RegExp";var e3=["removeAdditional","useDefaults","coerceTypes"],t3=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),r3={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},n3={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},QS=200;function o3(e){var t,r,n,o,i,s,a,c,u,p,l,d,f,h,g,y,v,w,x,k,P,q,L,Ue,we;let Q=e.strict,qe=(t=e.code)===null||t===void 0?void 0:t.optimize,Be=qe===!0||qe===void 0?1:qe||0,En=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:r$,ao=(o=e.uriResolver)!==null&&o!==void 0?o:XL.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:Q)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:Q)!==null&&c!==void 0?c:!0,strictTypes:(p=(u=e.strictTypes)!==null&&u!==void 0?u:Q)!==null&&p!==void 0?p:"log",strictTuples:(d=(l=e.strictTuples)!==null&&l!==void 0?l:Q)!==null&&d!==void 0?d:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:Q)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Be,regExp:En}:{optimize:Be,regExp:En},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:QS,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:QS,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:(x=e.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(k=e.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(P=e.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(q=e.validateSchema)!==null&&q!==void 0?q:!0,validateFormats:(L=e.validateFormats)!==null&&L!==void 0?L:!0,unicodeRegExp:(Ue=e.unicodeRegExp)!==null&&Ue!==void 0?Ue:!0,int32range:(we=e.int32range)!==null&&we!==void 0?we:!0,uriResolver:ao}}var ua=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...o3(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new QL.ValueScope({scope:{},prefixes:t3,es5:r,lines:n}),this.logger=l3(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,YL.getRules)(),XS.call(this,r3,t,"NOT SUPPORTED"),XS.call(this,n3,t,"DEPRECATED","warn"),this._metaOpts=c3.call(this),t.formats&&s3.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&a3.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),i3.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=YS;n==="id"&&(o={...YS},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(p,l){await i.call(this,p.$schema);let d=this._addSchema(p,l);return d.validate||s.call(this,d)}async function i(p){p&&!this.getSchema(p)&&await o.call(this,{$ref:p},!0)}async function s(p){try{return this._compileSchemaEnv(p)}catch(l){if(!(l instanceof t$.default))throw l;return a.call(this,l),await c.call(this,l.missingSchema),s.call(this,p)}}function a({missingSchema:p,missingRef:l}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${l} cannot be resolved`)}async function c(p){let l=await u.call(this,p);this.refs[p]||await i.call(this,l.$schema),this.refs[p]||this.addSchema(l,p,r)}async function u(p){let l=this._loading[p];if(l)return l;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error(`schema ${s} must be string`)}return r=(0,ca.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=e$.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new aa.SchemaEnv({schema:{},schemaId:n});if(r=aa.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=e$.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,ca.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(d3.call(this,n,r),!r)return(0,am.eachItem)(n,i=>sm.call(this,i)),this;h3.call(this,r);let o={...r,type:(0,Ku.getJSONTypes)(r.type),schemaType:(0,Ku.getJSONTypes)(r.schemaType)};return(0,am.eachItem)(n,o.type.length===0?i=>sm.call(this,i,o):i=>o.type.forEach(s=>sm.call(this,i,o,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),s=t;for(let a of i)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,p=s[a];u&&p&&(s[a]=n$(p))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,ca.normalizeId)(s||n);let u=ca.getSchemaRefs.call(this,t,n);return c=new aa.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):aa.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{aa.compileSchema.call(this,t)}finally{this.opts=r}}};ua.ValidationError=JL.default;ua.MissingRefError=t$.default;dt.default=ua;function XS(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function e$(e){return e=(0,ca.normalizeId)(e),this.schemas[e]||this.refs[e]}function i3(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function s3(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function a3(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function c3(){let e={...this.opts};for(let t of e3)delete e[t];return e}var u3={log(){},warn(){},error(){}};function l3(e){if(e===!1)return u3;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var p3=/^[a-z_$][a-z0-9_$:-]*$/i;function d3(e,t){let{RULES:r}=this;if((0,am.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!p3.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function sm(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=o?i.post:i.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,Ku.getJSONTypes)(t.type),schemaType:(0,Ku.getJSONTypes)(t.schemaType)}};t.before?f3.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function f3(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function h3(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=n$(t)),e.validateSchema=this.compile(t,!0))}var m3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function n$(e){return{anyOf:[e,m3]}}});var i$=$(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var g3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};cm.default=g3});var u$=$(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.callRef=Fo.getValidate=void 0;var y3=ia(),s$=pr(),Vt=Y(),Mi=mn(),a$=Gu(),Ju=le(),_3={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return l();let p=a$.resolveRef.call(c,u,o,r);if(p===void 0)throw new y3.default(n.opts.uriResolver,o,r);if(p instanceof a$.SchemaEnv)return d(p);return f(p);function l(){if(i===u)return Yu(e,s,i,i.$async);let h=t.scopeValue("root",{ref:u});return Yu(e,(0,Vt._)`${h}.validate`,u,u.$async)}function d(h){let g=c$(e,h);Yu(e,g,h,h.$async)}function f(h){let g=t.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,Vt.stringify)(h)}:{ref:h}),y=t.name("valid"),v=e.subschema({schema:h,dataTypes:[],schemaPath:Vt.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function c$(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Vt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Fo.getValidate=c$;function Yu(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?Mi.default.this:Vt.nil;n?p():l();function p(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=o.let("valid");o.try(()=>{o.code((0,Vt._)`await ${(0,s$.callValidateCode)(e,t,u)}`),f(t),s||o.assign(h,!0)},g=>{o.if((0,Vt._)`!(${g} instanceof ${i.ValidationError})`,()=>o.throw(g)),d(g),s||o.assign(h,!1)}),e.ok(h)}function l(){e.result((0,s$.callValidateCode)(e,t,u),()=>f(t),()=>d(t))}function d(h){let g=(0,Vt._)`${h}.errors`;o.assign(Mi.default.vErrors,(0,Vt._)`${Mi.default.vErrors} === null ? ${g} : ${Mi.default.vErrors}.concat(${g})`),o.assign(Mi.default.errors,(0,Vt._)`${Mi.default.vErrors}.length`)}function f(h){var g;if(!i.opts.unevaluated)return;let y=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(i.props=Ju.mergeEvaluated.props(o,y.props,i.props));else{let v=o.var("props",(0,Vt._)`${h}.evaluated.props`);i.props=Ju.mergeEvaluated.props(o,v,i.props,Vt.Name)}if(i.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(i.items=Ju.mergeEvaluated.items(o,y.items,i.items));else{let v=o.var("items",(0,Vt._)`${h}.evaluated.items`);i.items=Ju.mergeEvaluated.items(o,v,i.items,Vt.Name)}}}Fo.callRef=Yu;Fo.default=_3});var l$=$(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var v3=i$(),w3=u$(),b3=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",v3.default,w3.default];um.default=b3});var p$=$(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var Qu=Y(),Wn=Qu.operators,Xu={maximum:{okStr:"<=",ok:Wn.LTE,fail:Wn.GT},minimum:{okStr:">=",ok:Wn.GTE,fail:Wn.LT},exclusiveMaximum:{okStr:"<",ok:Wn.LT,fail:Wn.GTE},exclusiveMinimum:{okStr:">",ok:Wn.GT,fail:Wn.LTE}},x3={message:({keyword:e,schemaCode:t})=>(0,Qu.str)`must be ${Xu[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Qu._)`{comparison: ${Xu[e].okStr}, limit: ${t}}`},k3={keyword:Object.keys(Xu),type:"number",schemaType:"number",$data:!0,error:x3,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Qu._)`${r} ${Xu[t].fail} ${n} || isNaN(${r})`)}};lm.default=k3});var d$=$(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var la=Y(),S3={message:({schemaCode:e})=>(0,la.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,la._)`{multipleOf: ${e}}`},$3={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:S3,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,la._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,la._)`${s} !== parseInt(${s})`;e.fail$data((0,la._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};pm.default=$3});var h$=$(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});function f$(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}dm.default=f$;f$.code='require("ajv/dist/runtime/ucs2length").default'});var m$=$(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var Go=Y(),P3=le(),E3=h$(),C3={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Go.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Go._)`{limit: ${e}}`},T3={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:C3,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?Go.operators.GT:Go.operators.LT,s=o.opts.unicode===!1?(0,Go._)`${r}.length`:(0,Go._)`${(0,P3.useFunc)(e.gen,E3.default)}(${r})`;e.fail$data((0,Go._)`${s} ${i} ${n}`)}};fm.default=T3});var g$=$(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});var A3=pr(),el=Y(),R3={message:({schemaCode:e})=>(0,el.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,el._)`{pattern: ${e}}`},I3={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:R3,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,el._)`(new RegExp(${o}, ${s}))`:(0,A3.usePattern)(e,n);e.fail$data((0,el._)`!${a}.test(${t})`)}};hm.default=I3});var y$=$(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});var pa=Y(),z3={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,pa.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,pa._)`{limit: ${e}}`},D3={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:z3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?pa.operators.GT:pa.operators.LT;e.fail$data((0,pa._)`Object.keys(${r}).length ${o} ${n}`)}};mm.default=D3});var _$=$(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});var da=pr(),fa=Y(),O3=le(),N3={message:({params:{missingProperty:e}})=>(0,fa.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,fa._)`{missingProperty: ${e}}`},j3={keyword:"required",type:"object",schemaType:"array",$data:!0,error:N3,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?u():p(),a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let g of r)if(f?.[g]===void 0&&!h.has(g)){let y=s.schemaEnv.baseId+s.errSchemaPath,v=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,O3.checkStrictMode)(s,v,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(fa.nil,l);else for(let f of r)(0,da.checkReportMissingProp)(e,f)}function p(){let f=t.let("missing");if(c||i){let h=t.let("valid",!0);e.block$data(h,()=>d(f,h)),e.ok(h)}else t.if((0,da.checkMissingProp)(e,r,f)),(0,da.reportMissingProp)(e,f),t.else()}function l(){t.forOf("prop",n,f=>{e.setParams({missingProperty:f}),t.if((0,da.noPropertyInData)(t,o,f,a.ownProperties),()=>e.error())})}function d(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,(0,da.propertyInData)(t,o,f,a.ownProperties)),t.if((0,fa.not)(h),()=>{e.error(),t.break()})},fa.nil)}}};gm.default=j3});var v$=$(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});var ha=Y(),M3={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,ha.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,ha._)`{limit: ${e}}`},L3={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:M3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?ha.operators.GT:ha.operators.LT;e.fail$data((0,ha._)`${r}.length ${o} ${n}`)}};ym.default=L3});var tl=$(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});var w$=qh();w$.code='require("ajv/dist/runtime/equal").default';_m.default=w$});var b$=$(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});var vm=ea(),ft=Y(),Z3=le(),U3=tl(),q3={message:({params:{i:e,j:t}})=>(0,ft.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,ft._)`{i: ${e}, j: ${t}}`},F3={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:q3,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let c=t.let("valid"),u=i.items?(0,vm.getSchemaTypes)(i.items):[];e.block$data(c,p,(0,ft._)`${s} === false`),e.ok(c);function p(){let h=t.let("i",(0,ft._)`${r}.length`),g=t.let("j");e.setParams({i:h,j:g}),t.assign(c,!0),t.if((0,ft._)`${h} > 1`,()=>(l()?d:f)(h,g))}function l(){return u.length>0&&!u.some(h=>h==="object"||h==="array")}function d(h,g){let y=t.name("item"),v=(0,vm.checkDataTypes)(u,y,a.opts.strictNumbers,vm.DataType.Wrong),w=t.const("indices",(0,ft._)`{}`);t.for((0,ft._)`;${h}--;`,()=>{t.let(y,(0,ft._)`${r}[${h}]`),t.if(v,(0,ft._)`continue`),u.length>1&&t.if((0,ft._)`typeof ${y} == "string"`,(0,ft._)`${y} += "_"`),t.if((0,ft._)`typeof ${w}[${y}] == "number"`,()=>{t.assign(g,(0,ft._)`${w}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,ft._)`${w}[${y}] = ${h}`)})}function f(h,g){let y=(0,Z3.useFunc)(t,U3.default),v=t.name("outer");t.label(v).for((0,ft._)`;${h}--;`,()=>t.for((0,ft._)`${g} = ${h}; ${g}--;`,()=>t.if((0,ft._)`${y}(${r}[${h}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};wm.default=F3});var x$=$(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var bm=Y(),G3=le(),B3=tl(),V3={message:"must be equal to constant",params:({schemaCode:e})=>(0,bm._)`{allowedValue: ${e}}`},H3={keyword:"const",$data:!0,error:V3,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,bm._)`!${(0,G3.useFunc)(t,B3.default)}(${r}, ${o})`):e.fail((0,bm._)`${i} !== ${r}`)}};xm.default=H3});var k$=$(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});var ma=Y(),W3=le(),K3=tl(),J3={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ma._)`{allowedValues: ${e}}`},Y3={keyword:"enum",schemaType:"array",$data:!0,error:J3,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,c,u=()=>c??(c=(0,W3.useFunc)(t,K3.default)),p;if(a||n)p=t.let("valid"),e.block$data(p,l);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let f=t.const("vSchema",i);p=(0,ma.or)(...o.map((h,g)=>d(f,g)))}e.pass(p);function l(){t.assign(p,!1),t.forOf("v",i,f=>t.if((0,ma._)`${u()}(${r}, ${f})`,()=>t.assign(p,!0).break()))}function d(f,h){let g=o[h];return typeof g=="object"&&g!==null?(0,ma._)`${u()}(${r}, ${f}[${h}])`:(0,ma._)`${r} === ${g}`}}};km.default=Y3});var S$=$(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var Q3=p$(),X3=d$(),e5=m$(),t5=g$(),r5=y$(),n5=_$(),o5=v$(),i5=b$(),s5=x$(),a5=k$(),c5=[Q3.default,X3.default,e5.default,t5.default,r5.default,n5.default,o5.default,i5.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},s5.default,a5.default];Sm.default=c5});var Pm=$(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.validateAdditionalItems=void 0;var Bo=Y(),$m=le(),u5={message:({params:{len:e}})=>(0,Bo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Bo._)`{limit: ${e}}`},l5={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:u5,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,$m.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}$$(e,n)}};function $$(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,Bo._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Bo._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,$m.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,Bo._)`${a} <= ${t.length}`);r.if((0,Bo.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,p=>{e.subschema({keyword:i,dataProp:p,dataPropType:$m.Type.Num},u),s.allErrors||r.if((0,Bo.not)(u),()=>r.break())})}}ga.validateAdditionalItems=$$;ga.default=l5});var Em=$(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.validateTuple=void 0;var P$=Y(),rl=le(),p5=pr(),d5={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return E$(e,"additionalItems",t);r.items=!0,!(0,rl.alwaysValidSchema)(r,t)&&e.ok((0,p5.validateArray)(e))}};function E$(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;p(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=rl.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,P$._)`${i}.length`);r.forEach((l,d)=>{(0,rl.alwaysValidSchema)(a,l)||(n.if((0,P$._)`${u} > ${d}`,()=>e.subschema({keyword:s,schemaProp:d,dataProp:d},c)),e.ok(c))});function p(l){let{opts:d,errSchemaPath:f}=a,h=r.length,g=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(d.strictTuples&&!g){let y=`"${s}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;(0,rl.checkStrictMode)(a,y,d.strictTuples)}}}ya.validateTuple=E$;ya.default=d5});var C$=$(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});var f5=Em(),h5={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,f5.validateTuple)(e,"items")};Cm.default=h5});var A$=$(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});var T$=Y(),m5=le(),g5=pr(),y5=Pm(),_5={message:({params:{len:e}})=>(0,T$.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,T$._)`{limit: ${e}}`},v5={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_5,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,m5.alwaysValidSchema)(n,t)&&(o?(0,y5.validateAdditionalItems)(e,o):e.ok((0,g5.validateArray)(e)))}};Tm.default=v5});var R$=$(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var fr=Y(),nl=le(),w5={message:({params:{min:e,max:t}})=>t===void 0?(0,fr.str)`must contain at least ${e} valid item(s)`:(0,fr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,fr._)`{minContains: ${e}}`:(0,fr._)`{minContains: ${e}, maxContains: ${t}}`},b5={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:w5,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:c,maxContains:u}=n;i.opts.next?(s=c===void 0?1:c,a=u):s=1;let p=t.const("len",(0,fr._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,nl.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,nl.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,nl.alwaysValidSchema)(i,r)){let g=(0,fr._)`${p} >= ${s}`;a!==void 0&&(g=(0,fr._)`${g} && ${p} <= ${a}`),e.pass(g);return}i.items=!0;let l=t.name("valid");a===void 0&&s===1?f(l,()=>t.if(l,()=>t.break())):s===0?(t.let(l,!0),a!==void 0&&t.if((0,fr._)`${o}.length > 0`,d)):(t.let(l,!1),d()),e.result(l,()=>e.reset());function d(){let g=t.name("_valid"),y=t.let("count",0);f(g,()=>t.if(g,()=>h(y)))}function f(g,y){t.forRange("i",0,p,v=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:nl.Type.Num,compositeRule:!0},g),y()})}function h(g){t.code((0,fr._)`${g}++`),a===void 0?t.if((0,fr._)`${g} >= ${s}`,()=>t.assign(l,!0).break()):(t.if((0,fr._)`${g} > ${a}`,()=>t.assign(l,!1).break()),s===1?t.assign(l,!0):t.if((0,fr._)`${g} >= ${s}`,()=>t.assign(l,!0)))}}};Am.default=b5});var D$=$(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.validateSchemaDeps=Vr.validatePropertyDeps=Vr.error=void 0;var Rm=Y(),x5=le(),_a=pr();Vr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Rm.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Rm._)`{property: ${e},
77
77
  missingProperty: ${n},
78
78
  depsCount: ${t},
79
- deps: ${r}}`};var k5={keyword:"dependencies",type:"object",schemaType:"object",error:Vr.error,code(e){let[t,r]=S5(e);I$(e,t),z$(e,r)}};function S5({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function I$(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let c=(0,_a.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,_a.checkReportMissingProp)(e,u)}):(r.if((0,Rm._)`${c} && (${(0,_a.checkMissingProp)(e,a,i)})`),(0,_a.reportMissingProp)(e,i),r.else())}}Vr.validatePropertyDeps=I$;function z$(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,x5.alwaysValidSchema)(i,t[a])||(r.if((0,_a.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),e.ok(s))}Vr.validateSchemaDeps=z$;Vr.default=k5});var N$=$(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});var O$=Y(),$5=le(),P5={message:"property name must be valid",params:({params:e})=>(0,O$._)`{propertyName: ${e.propertyName}}`},E5={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:P5,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,$5.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,O$.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Im.default=E5});var Dm=$(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});var ol=pr(),Tr=Y(),C5=mn(),il=le(),T5={message:"must NOT have additional properties",params:({params:e})=>(0,Tr._)`{additionalProperty: ${e.additionalProperty}}`},A5={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:T5,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,il.alwaysValidSchema)(s,r))return;let u=(0,ol.allSchemaProperties)(n.properties),p=(0,ol.allSchemaProperties)(n.patternProperties);l(),e.ok((0,Tr._)`${i} === ${C5.default.errors}`);function l(){t.forIn("key",o,y=>{!u.length&&!p.length?h(y):t.if(d(y),()=>h(y))})}function d(y){let v;if(u.length>8){let w=(0,il.schemaRefOrVal)(s,n.properties,"properties");v=(0,ol.isOwnProperty)(t,w,y)}else u.length?v=(0,Tr.or)(...u.map(w=>(0,Tr._)`${y} === ${w}`)):v=Tr.nil;return p.length&&(v=(0,Tr.or)(v,...p.map(w=>(0,Tr._)`${(0,ol.usePattern)(e,w)}.test(${y})`))),(0,Tr.not)(v)}function f(y){t.code((0,Tr._)`delete ${o}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,il.alwaysValidSchema)(s,r)){let v=t.name("valid");c.removeAdditional==="failing"?(g(y,v,!1),t.if((0,Tr.not)(v),()=>{e.reset(),f(y)})):(g(y,v),a||t.if((0,Tr.not)(v),()=>t.break()))}}function g(y,v,w){let x={keyword:"additionalProperties",dataProp:y,dataPropType:il.Type.Str};w===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,v)}}};zm.default=A5});var L$=$(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});var R5=oa(),j$=pr(),Om=le(),M$=Dm(),I5={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&M$.default.code(new R5.KeywordCxt(i,M$.default,"additionalProperties"));let s=(0,j$.allSchemaProperties)(r);for(let l of s)i.definedProperties.add(l);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Om.mergeEvaluated.props(t,(0,Om.toHash)(s),i.props));let a=s.filter(l=>!(0,Om.alwaysValidSchema)(i,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a)u(l)?p(l):(t.if((0,j$.propertyInData)(t,o,l,i.opts.ownProperties)),p(l),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(l),e.ok(c);function u(l){return i.opts.useDefaults&&!i.compositeRule&&r[l].default!==void 0}function p(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};Nm.default=I5});var F$=$(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});var Z$=pr(),sl=Y(),U$=le(),q$=le(),z5={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,Z$.allSchemaProperties)(r),c=a.filter(g=>(0,U$.alwaysValidSchema)(i,r[g]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,p=t.name("valid");i.props!==!0&&!(i.props instanceof sl.Name)&&(i.props=(0,q$.evaluatedPropsToName)(t,i.props));let{props:l}=i;d();function d(){for(let g of a)u&&f(g),i.allErrors?h(g):(t.var(p,!0),h(g),t.if(p))}function f(g){for(let y in u)new RegExp(g).test(y)&&(0,U$.checkStrictMode)(i,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function h(g){t.forIn("key",n,y=>{t.if((0,sl._)`${(0,Z$.usePattern)(e,g)}.test(${y})`,()=>{let v=c.includes(g);v||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:q$.Type.Str},p),i.opts.unevaluated&&l!==!0?t.assign((0,sl._)`${l}[${y}]`,!0):!v&&!i.allErrors&&t.if((0,sl.not)(p),()=>t.break())})})}}};jm.default=z5});var G$=$(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var D5=le(),O5={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,D5.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Mm.default=O5});var B$=$(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var N5=pr(),j5={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:N5.validateUnion,error:{message:"must match a schema in anyOf"}};Lm.default=j5});var V$=$(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});var al=Y(),M5=le(),L5={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,al._)`{passingSchemas: ${e.passing}}`},Z5={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:L5,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((p,l)=>{let d;(0,M5.alwaysValidSchema)(o,p)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c),l>0&&t.if((0,al._)`${c} && ${s}`).assign(s,!1).assign(a,(0,al._)`[${a}, ${l}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,l),d&&e.mergeEvaluated(d,al.Name)})})}}};Zm.default=Z5});var H$=$(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});var U5=le(),q5={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,s)=>{if((0,U5.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Um.default=q5});var J$=$(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var cl=Y(),K$=le(),F5={message:({params:e})=>(0,cl.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,cl._)`{failingKeyword: ${e.ifClause}}`},G5={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:F5,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,K$.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=W$(n,"then"),i=W$(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&i){let p=t.let("ifClause");e.setParams({ifClause:p}),t.if(a,u("then",p),u("else",p))}else o?t.if(a,u("then")):t.if((0,cl.not)(a),u("else"));e.pass(s,()=>e.error(!0));function c(){let p=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(p)}function u(p,l){return()=>{let d=e.subschema({keyword:p},a);t.assign(s,a),e.mergeValidEvaluated(d,s),l?t.assign(l,(0,cl._)`${p}`):e.setParams({ifClause:p})}}}};function W$(e,t){let r=e.schema[t];return r!==void 0&&!(0,K$.alwaysValidSchema)(e,r)}qm.default=G5});var Y$=$(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});var B5=le(),V5={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,B5.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Fm.default=V5});var Q$=$(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});var H5=Pm(),W5=C$(),K5=Em(),J5=A$(),Y5=R$(),Q5=D$(),X5=N$(),e9=Dm(),t9=L$(),r9=F$(),n9=G$(),o9=B$(),i9=V$(),s9=H$(),a9=J$(),c9=Y$();function u9(e=!1){let t=[n9.default,o9.default,i9.default,s9.default,a9.default,c9.default,X5.default,e9.default,Q5.default,t9.default,r9.default];return e?t.push(W5.default,J5.default):t.push(H5.default,K5.default),t.push(Y5.default),t}Gm.default=u9});var X$=$(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});var Fe=Y(),l9={message:({schemaCode:e})=>(0,Fe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Fe._)`{format: ${e}}`},p9={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:l9,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:p,self:l}=a;if(!c.validateFormats)return;o?d():f();function d(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=r.const("fDef",(0,Fe._)`${h}[${s}]`),y=r.let("fType"),v=r.let("format");r.if((0,Fe._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,(0,Fe._)`${g}.type || "string"`).assign(v,(0,Fe._)`${g}.validate`),()=>r.assign(y,(0,Fe._)`"string"`).assign(v,g)),e.fail$data((0,Fe.or)(w(),x()));function w(){return c.strictSchema===!1?Fe.nil:(0,Fe._)`${s} && !${v}`}function x(){let k=p.$async?(0,Fe._)`(${g}.async ? await ${v}(${n}) : ${v}(${n}))`:(0,Fe._)`${v}(${n})`,P=(0,Fe._)`(typeof ${v} == "function" ? ${k} : ${v}.test(${n}))`;return(0,Fe._)`${v} && ${v} !== true && ${y} === ${t} && !${P}`}}function f(){let h=l.formats[i];if(!h){w();return}if(h===!0)return;let[g,y,v]=x(h);g===t&&e.pass(k());function w(){if(c.strictSchema===!1){l.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function x(P){let q=P instanceof RegExp?(0,Fe.regexpCode)(P):c.code.formats?(0,Fe._)`${c.code.formats}${(0,Fe.getProperty)(i)}`:void 0,L=r.scopeValue("formats",{key:i,ref:P,code:q});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,Fe._)`${L}.validate`]:["string",P,L]}function k(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Fe._)`await ${v}(${n})`}return typeof y=="function"?(0,Fe._)`${v}(${n})`:(0,Fe._)`${v}.test(${n})`}}}};Bm.default=p9});var e1=$(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var d9=X$(),f9=[d9.default];Vm.default=f9});var t1=$(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.contentVocabulary=Li.metadataVocabulary=void 0;Li.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Li.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var n1=$(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});var h9=l$(),m9=S$(),g9=Q$(),y9=e1(),r1=t1(),_9=[h9.default,m9.default,(0,g9.default)(),y9.default,r1.metadataVocabulary,r1.contentVocabulary];Hm.default=_9});var i1=$(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.DiscrError=void 0;var o1;(function(e){e.Tag="tag",e.Mapping="mapping"})(o1||(ul.DiscrError=o1={}))});var a1=$(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});var Zi=Y(),Wm=i1(),s1=Gu(),v9=ia(),w9=le(),b9={message:({params:{discrError:e,tagName:t}})=>e===Wm.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Zi._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},x9={keyword:"discriminator",type:"object",schemaType:"object",error:b9,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",(0,Zi._)`${r}${(0,Zi.getProperty)(a)}`);t.if((0,Zi._)`typeof ${u} == "string"`,()=>p(),()=>e.error(!1,{discrError:Wm.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function p(){let f=d();t.if(!1);for(let h in f)t.elseIf((0,Zi._)`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:Wm.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(g,Zi.Name),h}function d(){var f;let h={},g=v(o),y=!0;for(let k=0;k<s.length;k++){let P=s[k];if(P?.$ref&&!(0,w9.schemaHasRulesButRef)(P,i.self.RULES)){let L=P.$ref;if(P=s1.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,L),P instanceof s1.SchemaEnv&&(P=P.schema),P===void 0)throw new v9.default(i.opts.uriResolver,i.baseId,L)}let q=(f=P?.properties)===null||f===void 0?void 0:f[a];if(typeof q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||v(P)),w(q,k)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return h;function v({required:k}){return Array.isArray(k)&&k.includes(a)}function w(k,P){if(k.const)x(k.const,P);else if(k.enum)for(let q of k.enum)x(q,P);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(k,P){if(typeof k!="string"||k in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[k]=P}}}};Km.default=x9});var c1=$((QJ,k9)=>{k9.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Ym=$((Ae,Jm)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.MissingRefError=Ae.ValidationError=Ae.CodeGen=Ae.Name=Ae.nil=Ae.stringify=Ae.str=Ae._=Ae.KeywordCxt=Ae.Ajv=void 0;var S9=o$(),$9=n1(),P9=a1(),u1=c1(),E9=["/properties"],ll="http://json-schema.org/draft-07/schema",Ui=class extends S9.default{_addVocabularies(){super._addVocabularies(),$9.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(P9.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(u1,E9):u1;this.addMetaSchema(t,ll,!1),this.refs["http://json-schema.org/schema"]=ll}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ll)?ll:void 0)}};Ae.Ajv=Ui;Jm.exports=Ae=Ui;Jm.exports.Ajv=Ui;Object.defineProperty(Ae,"__esModule",{value:!0});Ae.default=Ui;var C9=oa();Object.defineProperty(Ae,"KeywordCxt",{enumerable:!0,get:function(){return C9.KeywordCxt}});var qi=Y();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return qi._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return qi.str}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return qi.stringify}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return qi.nil}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return qi.Name}});Object.defineProperty(Ae,"CodeGen",{enumerable:!0,get:function(){return qi.CodeGen}});var T9=qu();Object.defineProperty(Ae,"ValidationError",{enumerable:!0,get:function(){return T9.default}});var A9=ia();Object.defineProperty(Ae,"MissingRefError",{enumerable:!0,get:function(){return A9.default}})});var y1=$(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.formatNames=Wr.fastFormats=Wr.fullFormats=void 0;function Hr(e,t){return{validate:e,compare:t}}Wr.fullFormats={date:Hr(f1,tg),time:Hr(Xm(!0),rg),"date-time":Hr(l1(!0),m1),"iso-time":Hr(Xm(),h1),"iso-date-time":Hr(l1(),g1),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:N9,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F9,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:j9,int32:{type:"number",validate:Z9},int64:{type:"number",validate:U9},float:{type:"number",validate:d1},double:{type:"number",validate:d1},password:!0,binary:!0};Wr.fastFormats={...Wr.fullFormats,date:Hr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,tg),time:Hr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,rg),"date-time":Hr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,m1),"iso-time":Hr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h1),"iso-date-time":Hr(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g1),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Wr.formatNames=Object.keys(Wr.fullFormats);function R9(e){return e%4===0&&(e%100!==0||e%400===0)}var I9=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,z9=[0,31,28,31,30,31,30,31,31,30,31,30,31];function f1(e){let t=I9.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&R9(r)?29:z9[n])}function tg(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Qm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Xm(e){return function(r){let n=Qm.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),p=+(n[7]||0);if(u>23||p>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let l=i-p*c,d=o-u*c-(l<0?1:0);return(d===23||d===-1)&&(l===59||l===-1)&&s<61}}function rg(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function h1(e,t){if(!(e&&t))return;let r=Qm.exec(e),n=Qm.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var eg=/t|\s/i;function l1(e){let t=Xm(e);return function(n){let o=n.split(eg);return o.length===2&&f1(o[0])&&t(o[1])}}function m1(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function g1(e,t){if(!(e&&t))return;let[r,n]=e.split(eg),[o,i]=t.split(eg),s=tg(r,o);if(s!==void 0)return s||rg(n,i)}var D9=/\/|:/,O9=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function N9(e){return D9.test(e)&&O9.test(e)}var p1=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function j9(e){return p1.lastIndex=0,p1.test(e)}var M9=-(2**31),L9=2**31-1;function Z9(e){return Number.isInteger(e)&&e<=L9&&e>=M9}function U9(e){return Number.isInteger(e)}function d1(){return!0}var q9=/[^\\]\\Z/;function F9(e){if(q9.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var _1=$(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.formatLimitDefinition=void 0;var G9=Ym(),Ar=Y(),Kn=Ar.operators,pl={formatMaximum:{okStr:"<=",ok:Kn.LTE,fail:Kn.GT},formatMinimum:{okStr:">=",ok:Kn.GTE,fail:Kn.LT},formatExclusiveMaximum:{okStr:"<",ok:Kn.LT,fail:Kn.GTE},formatExclusiveMinimum:{okStr:">",ok:Kn.GT,fail:Kn.LTE}},B9={message:({keyword:e,schemaCode:t})=>(0,Ar.str)`should be ${pl[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ar._)`{comparison: ${pl[e].okStr}, limit: ${t}}`};Fi.formatLimitDefinition={keyword:Object.keys(pl),type:"string",schemaType:"string",$data:!0,error:B9,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new G9.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():p();function u(){let d=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),f=t.const("fmt",(0,Ar._)`${d}[${c.schemaCode}]`);e.fail$data((0,Ar.or)((0,Ar._)`typeof ${f} != "object"`,(0,Ar._)`${f} instanceof RegExp`,(0,Ar._)`typeof ${f}.compare != "function"`,l(f)))}function p(){let d=c.schema,f=a.formats[d];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${o}": format "${d}" does not define "compare" function`);let h=t.scopeValue("formats",{key:d,ref:f,code:s.code.formats?(0,Ar._)`${s.code.formats}${(0,Ar.getProperty)(d)}`:void 0});e.fail$data(l(h))}function l(d){return(0,Ar._)`${d}.compare(${r}, ${n}) ${pl[o].fail} 0`}},dependencies:["format"]};var V9=e=>(e.addKeyword(Fi.formatLimitDefinition),e);Fi.default=V9});var x1=$((va,b1)=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var Gi=y1(),H9=_1(),ng=Y(),v1=new ng.Name("fullFormats"),W9=new ng.Name("fastFormats"),og=(e,t={keywords:!0})=>{if(Array.isArray(t))return w1(e,t,Gi.fullFormats,v1),e;let[r,n]=t.mode==="fast"?[Gi.fastFormats,W9]:[Gi.fullFormats,v1],o=t.formats||Gi.formatNames;return w1(e,o,r,n),t.keywords&&(0,H9.default)(e),e};og.get=(e,t="full")=>{let n=(t==="fast"?Gi.fastFormats:Gi.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function w1(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,ng._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}b1.exports=va=og;Object.defineProperty(va,"__esModule",{value:!0});va.default=og});function K9(){let e=new k1.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,S1.default)(e),e}var k1,S1,Bi,ig=b(()=>{k1=yt(Ym(),1),S1=yt(x1(),1);Bi=class{constructor(t){this._ajv=t??K9()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var dl,$1=b(()=>{dl=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}}});function P1(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function E1(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var C1=b(()=>{});var fl,T1=b(()=>{jk();An();ig();_u();$1();C1();fl=class extends Tu{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(zs.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let i=this._loggingLevels.get(o);return i?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Bi,this.setRequestHandler(qd,n=>this._oninitialize(n)),this.setNotificationHandler(Zc,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(ef,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=zs.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new dl(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Nk(this._capabilities,t)}setRequestHandler(t,r){let o=yu(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(Oo(o)){let a=o;i=a._zod?.def?.value??a.value}else{let a=o;i=a._def?.value??a.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let a=async(c,u)=>{let p=Ln(Is,c);if(!p.success){let h=p.error instanceof Error?p.error.message:String(p.error);throw new V(ee.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:l}=p.data,d=await Promise.resolve(r(c,u));if(l.task){let h=Ln(di,d);if(!h.success){let g=h.error instanceof Error?h.error.message:String(h.error);throw new V(ee.InvalidParams,`Invalid task creation result: ${g}`)}return h.data}let f=Ln(Kc,d);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new V(ee.InvalidParams,`Invalid tools/call result: ${h}`)}return f.data};return super.setRequestHandler(t,a)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){E1(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&P1(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:Qb.includes(r)?r:li,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Mc)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],i=o.some(u=>u.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(u=>u.type==="tool_use");if(i){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(l=>l.type==="tool_use").map(l=>l.id)),p=new Set(o.filter(l=>l.type==="tool_result").map(l=>l.toolUseId));if(u.size!==p.size||![...u].every(l=>p.has(l)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},rf,r):this.request({method:"sampling/createMessage",params:t},tf,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=t;return this.request({method:"elicitation/create",params:o},Jc,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=t.mode==="form"?t:{...t,mode:"form"},i=await this.request({method:"elicitation/create",params:o},Jc,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new V(ee.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof V?s:new V(ee.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return i}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},nf,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function J9(){let e=process.env.GODD_CONFIG;if(!e)throw new Error(`GODD_CONFIG \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${Kt} \u306E\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return e}function Y9(e){let t;try{t=br.load(e)}catch{return e}if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let r=t;return typeof r.license_key=="string"&&r.license_key.length>0&&(r.license_key="****"),br.dump(r,{lineWidth:-1,quotingType:'"'})}return e}function R1(e){if(!(0,Jt.existsSync)(e))return{};let t={};try{let r=(0,Jt.readFileSync)(e,"utf-8");for(let n of r.split(`
79
+ deps: ${r}}`};var k5={keyword:"dependencies",type:"object",schemaType:"object",error:Vr.error,code(e){let[t,r]=S5(e);I$(e,t),z$(e,r)}};function S5({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function I$(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let c=(0,_a.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,_a.checkReportMissingProp)(e,u)}):(r.if((0,Rm._)`${c} && (${(0,_a.checkMissingProp)(e,a,i)})`),(0,_a.reportMissingProp)(e,i),r.else())}}Vr.validatePropertyDeps=I$;function z$(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,x5.alwaysValidSchema)(i,t[a])||(r.if((0,_a.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),e.ok(s))}Vr.validateSchemaDeps=z$;Vr.default=k5});var N$=$(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});var O$=Y(),$5=le(),P5={message:"property name must be valid",params:({params:e})=>(0,O$._)`{propertyName: ${e.propertyName}}`},E5={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:P5,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,$5.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,O$.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Im.default=E5});var Dm=$(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});var ol=pr(),Tr=Y(),C5=mn(),il=le(),T5={message:"must NOT have additional properties",params:({params:e})=>(0,Tr._)`{additionalProperty: ${e.additionalProperty}}`},A5={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:T5,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,il.alwaysValidSchema)(s,r))return;let u=(0,ol.allSchemaProperties)(n.properties),p=(0,ol.allSchemaProperties)(n.patternProperties);l(),e.ok((0,Tr._)`${i} === ${C5.default.errors}`);function l(){t.forIn("key",o,y=>{!u.length&&!p.length?h(y):t.if(d(y),()=>h(y))})}function d(y){let v;if(u.length>8){let w=(0,il.schemaRefOrVal)(s,n.properties,"properties");v=(0,ol.isOwnProperty)(t,w,y)}else u.length?v=(0,Tr.or)(...u.map(w=>(0,Tr._)`${y} === ${w}`)):v=Tr.nil;return p.length&&(v=(0,Tr.or)(v,...p.map(w=>(0,Tr._)`${(0,ol.usePattern)(e,w)}.test(${y})`))),(0,Tr.not)(v)}function f(y){t.code((0,Tr._)`delete ${o}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,il.alwaysValidSchema)(s,r)){let v=t.name("valid");c.removeAdditional==="failing"?(g(y,v,!1),t.if((0,Tr.not)(v),()=>{e.reset(),f(y)})):(g(y,v),a||t.if((0,Tr.not)(v),()=>t.break()))}}function g(y,v,w){let x={keyword:"additionalProperties",dataProp:y,dataPropType:il.Type.Str};w===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,v)}}};zm.default=A5});var L$=$(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});var R5=oa(),j$=pr(),Om=le(),M$=Dm(),I5={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&M$.default.code(new R5.KeywordCxt(i,M$.default,"additionalProperties"));let s=(0,j$.allSchemaProperties)(r);for(let l of s)i.definedProperties.add(l);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Om.mergeEvaluated.props(t,(0,Om.toHash)(s),i.props));let a=s.filter(l=>!(0,Om.alwaysValidSchema)(i,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a)u(l)?p(l):(t.if((0,j$.propertyInData)(t,o,l,i.opts.ownProperties)),p(l),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(l),e.ok(c);function u(l){return i.opts.useDefaults&&!i.compositeRule&&r[l].default!==void 0}function p(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};Nm.default=I5});var F$=$(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});var Z$=pr(),sl=Y(),U$=le(),q$=le(),z5={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,Z$.allSchemaProperties)(r),c=a.filter(g=>(0,U$.alwaysValidSchema)(i,r[g]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,p=t.name("valid");i.props!==!0&&!(i.props instanceof sl.Name)&&(i.props=(0,q$.evaluatedPropsToName)(t,i.props));let{props:l}=i;d();function d(){for(let g of a)u&&f(g),i.allErrors?h(g):(t.var(p,!0),h(g),t.if(p))}function f(g){for(let y in u)new RegExp(g).test(y)&&(0,U$.checkStrictMode)(i,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function h(g){t.forIn("key",n,y=>{t.if((0,sl._)`${(0,Z$.usePattern)(e,g)}.test(${y})`,()=>{let v=c.includes(g);v||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:q$.Type.Str},p),i.opts.unevaluated&&l!==!0?t.assign((0,sl._)`${l}[${y}]`,!0):!v&&!i.allErrors&&t.if((0,sl.not)(p),()=>t.break())})})}}};jm.default=z5});var G$=$(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var D5=le(),O5={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,D5.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Mm.default=O5});var B$=$(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var N5=pr(),j5={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:N5.validateUnion,error:{message:"must match a schema in anyOf"}};Lm.default=j5});var V$=$(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});var al=Y(),M5=le(),L5={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,al._)`{passingSchemas: ${e.passing}}`},Z5={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:L5,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((p,l)=>{let d;(0,M5.alwaysValidSchema)(o,p)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c),l>0&&t.if((0,al._)`${c} && ${s}`).assign(s,!1).assign(a,(0,al._)`[${a}, ${l}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,l),d&&e.mergeEvaluated(d,al.Name)})})}}};Zm.default=Z5});var H$=$(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});var U5=le(),q5={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,s)=>{if((0,U5.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Um.default=q5});var J$=$(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var cl=Y(),K$=le(),F5={message:({params:e})=>(0,cl.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,cl._)`{failingKeyword: ${e.ifClause}}`},G5={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:F5,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,K$.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=W$(n,"then"),i=W$(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&i){let p=t.let("ifClause");e.setParams({ifClause:p}),t.if(a,u("then",p),u("else",p))}else o?t.if(a,u("then")):t.if((0,cl.not)(a),u("else"));e.pass(s,()=>e.error(!0));function c(){let p=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(p)}function u(p,l){return()=>{let d=e.subschema({keyword:p},a);t.assign(s,a),e.mergeValidEvaluated(d,s),l?t.assign(l,(0,cl._)`${p}`):e.setParams({ifClause:p})}}}};function W$(e,t){let r=e.schema[t];return r!==void 0&&!(0,K$.alwaysValidSchema)(e,r)}qm.default=G5});var Y$=$(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});var B5=le(),V5={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,B5.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Fm.default=V5});var Q$=$(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});var H5=Pm(),W5=C$(),K5=Em(),J5=A$(),Y5=R$(),Q5=D$(),X5=N$(),e9=Dm(),t9=L$(),r9=F$(),n9=G$(),o9=B$(),i9=V$(),s9=H$(),a9=J$(),c9=Y$();function u9(e=!1){let t=[n9.default,o9.default,i9.default,s9.default,a9.default,c9.default,X5.default,e9.default,Q5.default,t9.default,r9.default];return e?t.push(W5.default,J5.default):t.push(H5.default,K5.default),t.push(Y5.default),t}Gm.default=u9});var X$=$(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});var Fe=Y(),l9={message:({schemaCode:e})=>(0,Fe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Fe._)`{format: ${e}}`},p9={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:l9,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:p,self:l}=a;if(!c.validateFormats)return;o?d():f();function d(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=r.const("fDef",(0,Fe._)`${h}[${s}]`),y=r.let("fType"),v=r.let("format");r.if((0,Fe._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,(0,Fe._)`${g}.type || "string"`).assign(v,(0,Fe._)`${g}.validate`),()=>r.assign(y,(0,Fe._)`"string"`).assign(v,g)),e.fail$data((0,Fe.or)(w(),x()));function w(){return c.strictSchema===!1?Fe.nil:(0,Fe._)`${s} && !${v}`}function x(){let k=p.$async?(0,Fe._)`(${g}.async ? await ${v}(${n}) : ${v}(${n}))`:(0,Fe._)`${v}(${n})`,P=(0,Fe._)`(typeof ${v} == "function" ? ${k} : ${v}.test(${n}))`;return(0,Fe._)`${v} && ${v} !== true && ${y} === ${t} && !${P}`}}function f(){let h=l.formats[i];if(!h){w();return}if(h===!0)return;let[g,y,v]=x(h);g===t&&e.pass(k());function w(){if(c.strictSchema===!1){l.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function x(P){let q=P instanceof RegExp?(0,Fe.regexpCode)(P):c.code.formats?(0,Fe._)`${c.code.formats}${(0,Fe.getProperty)(i)}`:void 0,L=r.scopeValue("formats",{key:i,ref:P,code:q});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,Fe._)`${L}.validate`]:["string",P,L]}function k(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Fe._)`await ${v}(${n})`}return typeof y=="function"?(0,Fe._)`${v}(${n})`:(0,Fe._)`${v}.test(${n})`}}}};Bm.default=p9});var e1=$(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var d9=X$(),f9=[d9.default];Vm.default=f9});var t1=$(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.contentVocabulary=Li.metadataVocabulary=void 0;Li.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Li.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var n1=$(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});var h9=l$(),m9=S$(),g9=Q$(),y9=e1(),r1=t1(),_9=[h9.default,m9.default,(0,g9.default)(),y9.default,r1.metadataVocabulary,r1.contentVocabulary];Hm.default=_9});var i1=$(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.DiscrError=void 0;var o1;(function(e){e.Tag="tag",e.Mapping="mapping"})(o1||(ul.DiscrError=o1={}))});var a1=$(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});var Zi=Y(),Wm=i1(),s1=Gu(),v9=ia(),w9=le(),b9={message:({params:{discrError:e,tagName:t}})=>e===Wm.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Zi._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},x9={keyword:"discriminator",type:"object",schemaType:"object",error:b9,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",(0,Zi._)`${r}${(0,Zi.getProperty)(a)}`);t.if((0,Zi._)`typeof ${u} == "string"`,()=>p(),()=>e.error(!1,{discrError:Wm.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function p(){let f=d();t.if(!1);for(let h in f)t.elseIf((0,Zi._)`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:Wm.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(g,Zi.Name),h}function d(){var f;let h={},g=v(o),y=!0;for(let k=0;k<s.length;k++){let P=s[k];if(P?.$ref&&!(0,w9.schemaHasRulesButRef)(P,i.self.RULES)){let L=P.$ref;if(P=s1.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,L),P instanceof s1.SchemaEnv&&(P=P.schema),P===void 0)throw new v9.default(i.opts.uriResolver,i.baseId,L)}let q=(f=P?.properties)===null||f===void 0?void 0:f[a];if(typeof q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||v(P)),w(q,k)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return h;function v({required:k}){return Array.isArray(k)&&k.includes(a)}function w(k,P){if(k.const)x(k.const,P);else if(k.enum)for(let q of k.enum)x(q,P);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(k,P){if(typeof k!="string"||k in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[k]=P}}}};Km.default=x9});var c1=$((eY,k9)=>{k9.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Ym=$((Ae,Jm)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.MissingRefError=Ae.ValidationError=Ae.CodeGen=Ae.Name=Ae.nil=Ae.stringify=Ae.str=Ae._=Ae.KeywordCxt=Ae.Ajv=void 0;var S9=o$(),$9=n1(),P9=a1(),u1=c1(),E9=["/properties"],ll="http://json-schema.org/draft-07/schema",Ui=class extends S9.default{_addVocabularies(){super._addVocabularies(),$9.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(P9.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(u1,E9):u1;this.addMetaSchema(t,ll,!1),this.refs["http://json-schema.org/schema"]=ll}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ll)?ll:void 0)}};Ae.Ajv=Ui;Jm.exports=Ae=Ui;Jm.exports.Ajv=Ui;Object.defineProperty(Ae,"__esModule",{value:!0});Ae.default=Ui;var C9=oa();Object.defineProperty(Ae,"KeywordCxt",{enumerable:!0,get:function(){return C9.KeywordCxt}});var qi=Y();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return qi._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return qi.str}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return qi.stringify}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return qi.nil}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return qi.Name}});Object.defineProperty(Ae,"CodeGen",{enumerable:!0,get:function(){return qi.CodeGen}});var T9=qu();Object.defineProperty(Ae,"ValidationError",{enumerable:!0,get:function(){return T9.default}});var A9=ia();Object.defineProperty(Ae,"MissingRefError",{enumerable:!0,get:function(){return A9.default}})});var y1=$(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.formatNames=Wr.fastFormats=Wr.fullFormats=void 0;function Hr(e,t){return{validate:e,compare:t}}Wr.fullFormats={date:Hr(f1,tg),time:Hr(Xm(!0),rg),"date-time":Hr(l1(!0),m1),"iso-time":Hr(Xm(),h1),"iso-date-time":Hr(l1(),g1),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:N9,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F9,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:j9,int32:{type:"number",validate:Z9},int64:{type:"number",validate:U9},float:{type:"number",validate:d1},double:{type:"number",validate:d1},password:!0,binary:!0};Wr.fastFormats={...Wr.fullFormats,date:Hr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,tg),time:Hr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,rg),"date-time":Hr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,m1),"iso-time":Hr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h1),"iso-date-time":Hr(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g1),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Wr.formatNames=Object.keys(Wr.fullFormats);function R9(e){return e%4===0&&(e%100!==0||e%400===0)}var I9=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,z9=[0,31,28,31,30,31,30,31,31,30,31,30,31];function f1(e){let t=I9.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&R9(r)?29:z9[n])}function tg(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Qm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Xm(e){return function(r){let n=Qm.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),p=+(n[7]||0);if(u>23||p>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let l=i-p*c,d=o-u*c-(l<0?1:0);return(d===23||d===-1)&&(l===59||l===-1)&&s<61}}function rg(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function h1(e,t){if(!(e&&t))return;let r=Qm.exec(e),n=Qm.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var eg=/t|\s/i;function l1(e){let t=Xm(e);return function(n){let o=n.split(eg);return o.length===2&&f1(o[0])&&t(o[1])}}function m1(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function g1(e,t){if(!(e&&t))return;let[r,n]=e.split(eg),[o,i]=t.split(eg),s=tg(r,o);if(s!==void 0)return s||rg(n,i)}var D9=/\/|:/,O9=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function N9(e){return D9.test(e)&&O9.test(e)}var p1=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function j9(e){return p1.lastIndex=0,p1.test(e)}var M9=-(2**31),L9=2**31-1;function Z9(e){return Number.isInteger(e)&&e<=L9&&e>=M9}function U9(e){return Number.isInteger(e)}function d1(){return!0}var q9=/[^\\]\\Z/;function F9(e){if(q9.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var _1=$(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.formatLimitDefinition=void 0;var G9=Ym(),Ar=Y(),Kn=Ar.operators,pl={formatMaximum:{okStr:"<=",ok:Kn.LTE,fail:Kn.GT},formatMinimum:{okStr:">=",ok:Kn.GTE,fail:Kn.LT},formatExclusiveMaximum:{okStr:"<",ok:Kn.LT,fail:Kn.GTE},formatExclusiveMinimum:{okStr:">",ok:Kn.GT,fail:Kn.LTE}},B9={message:({keyword:e,schemaCode:t})=>(0,Ar.str)`should be ${pl[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ar._)`{comparison: ${pl[e].okStr}, limit: ${t}}`};Fi.formatLimitDefinition={keyword:Object.keys(pl),type:"string",schemaType:"string",$data:!0,error:B9,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new G9.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():p();function u(){let d=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),f=t.const("fmt",(0,Ar._)`${d}[${c.schemaCode}]`);e.fail$data((0,Ar.or)((0,Ar._)`typeof ${f} != "object"`,(0,Ar._)`${f} instanceof RegExp`,(0,Ar._)`typeof ${f}.compare != "function"`,l(f)))}function p(){let d=c.schema,f=a.formats[d];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${o}": format "${d}" does not define "compare" function`);let h=t.scopeValue("formats",{key:d,ref:f,code:s.code.formats?(0,Ar._)`${s.code.formats}${(0,Ar.getProperty)(d)}`:void 0});e.fail$data(l(h))}function l(d){return(0,Ar._)`${d}.compare(${r}, ${n}) ${pl[o].fail} 0`}},dependencies:["format"]};var V9=e=>(e.addKeyword(Fi.formatLimitDefinition),e);Fi.default=V9});var x1=$((va,b1)=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var Gi=y1(),H9=_1(),ng=Y(),v1=new ng.Name("fullFormats"),W9=new ng.Name("fastFormats"),og=(e,t={keywords:!0})=>{if(Array.isArray(t))return w1(e,t,Gi.fullFormats,v1),e;let[r,n]=t.mode==="fast"?[Gi.fastFormats,W9]:[Gi.fullFormats,v1],o=t.formats||Gi.formatNames;return w1(e,o,r,n),t.keywords&&(0,H9.default)(e),e};og.get=(e,t="full")=>{let n=(t==="fast"?Gi.fastFormats:Gi.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function w1(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,ng._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}b1.exports=va=og;Object.defineProperty(va,"__esModule",{value:!0});va.default=og});function K9(){let e=new k1.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,S1.default)(e),e}var k1,S1,Bi,ig=b(()=>{k1=yt(Ym(),1),S1=yt(x1(),1);Bi=class{constructor(t){this._ajv=t??K9()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var dl,$1=b(()=>{dl=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}}});function P1(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function E1(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var C1=b(()=>{});var fl,T1=b(()=>{jk();An();ig();_u();$1();C1();fl=class extends Tu{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(zs.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let i=this._loggingLevels.get(o);return i?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Bi,this.setRequestHandler(qd,n=>this._oninitialize(n)),this.setNotificationHandler(Zc,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(ef,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=zs.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new dl(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Nk(this._capabilities,t)}setRequestHandler(t,r){let o=yu(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(Oo(o)){let a=o;i=a._zod?.def?.value??a.value}else{let a=o;i=a._def?.value??a.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let a=async(c,u)=>{let p=Ln(Is,c);if(!p.success){let h=p.error instanceof Error?p.error.message:String(p.error);throw new V(ee.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:l}=p.data,d=await Promise.resolve(r(c,u));if(l.task){let h=Ln(di,d);if(!h.success){let g=h.error instanceof Error?h.error.message:String(h.error);throw new V(ee.InvalidParams,`Invalid task creation result: ${g}`)}return h.data}let f=Ln(Kc,d);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new V(ee.InvalidParams,`Invalid tools/call result: ${h}`)}return f.data};return super.setRequestHandler(t,a)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){E1(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&P1(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:Qb.includes(r)?r:li,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Mc)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],i=o.some(u=>u.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(u=>u.type==="tool_use");if(i){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(l=>l.type==="tool_use").map(l=>l.id)),p=new Set(o.filter(l=>l.type==="tool_result").map(l=>l.toolUseId));if(u.size!==p.size||![...u].every(l=>p.has(l)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},rf,r):this.request({method:"sampling/createMessage",params:t},tf,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=t;return this.request({method:"elicitation/create",params:o},Jc,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=t.mode==="form"?t:{...t,mode:"form"},i=await this.request({method:"elicitation/create",params:o},Jc,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new V(ee.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof V?s:new V(ee.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return i}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},nf,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function J9(){let e=process.env.GODD_CONFIG;if(!e)throw new Error(`GODD_CONFIG \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${Kt} \u306E\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return e}function Y9(e){let t;try{t=br.load(e)}catch{return e}if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let r=t;return typeof r.license_key=="string"&&r.license_key.length>0&&(r.license_key="****"),br.dump(r,{lineWidth:-1,quotingType:'"'})}return e}function R1(e){if(!(0,Jt.existsSync)(e))return{};let t={};try{let r=(0,Jt.readFileSync)(e,"utf-8");for(let n of r.split(`
80
80
  `)){let o=n.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf("=");if(i===-1)continue;let s=o.slice(0,i).trim();if(!A1.has(s))continue;let a=o.slice(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),t[s]=a}}catch{}return t}function Q9(e,t){let r=[];if((0,Jt.existsSync)(e)){let a=(0,Jt.readFileSync)(e,"utf-8");for(let c of a.split(`
81
81
  `)){let u=c.trim(),p=u.indexOf("="),l=p>0?u.slice(0,p).trim():"";A1.has(l)||r.push(c)}for(;r.length>0&&r[r.length-1].trim()==="";)r.pop()}let o={...R1(e),...t},i=["","# GoDD MCP Server (managed by godd init)"];o.GODD_LICENSE_KEY&&i.push(`GODD_LICENSE_KEY="${o.GODD_LICENSE_KEY}"`),o.GODD_LANGUAGE&&i.push(`GODD_LANGUAGE="${o.GODD_LANGUAGE}"`),o.GODD_REGISTRY_URL&&i.push(`GODD_REGISTRY_URL="${o.GODD_REGISTRY_URL}"`),i.push("");let s=[...r,...i].join(`
82
82
  `);(0,Jt.writeFileSync)(e,s,"utf-8")}function I1(e){let t=J9(),r=(0,hl.join)((0,hl.dirname)(t),".env");if(e.action==="show"){let s=[`## GoDD \u8A2D\u5B9A
@@ -135,7 +135,7 @@ Expecting `+ao.join(", ")+", got '"+(this.terminals_[k]||k)+"'":ie="Parse error
135
135
  return undefined
136
136
  }
137
137
  `.trim()},blockValue:function(t){var r=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(t,0,n);var o=this.popStack();n.splice(1,0,o),this.push(this.source.functionCall(r,"call",n))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var n=this.topStack();r.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(t,"call",r),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,r,n,o){var i=0;!o&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(t[i++])):this.pushContext(),this.resolvePath("context",t,i,r,n)},lookupBlockParam:function(t,r){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",r,1)},lookupData:function(t,r,n){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,n)},resolvePath:function(t,r,n,o,i){var s=this;if(this.options.strict||this.options.assumeObjects){this.push(A6(this.options.strict&&i,this,r,n,t));return}for(var a=r.length;n<a;n++)this.replaceStack(function(c){var u=s.nameLookup(c,r[n],t);return o?[" && ",u]:[" != null ? ",u," : ",c]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(t,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof t=="string"?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function(t){this.pushStackLiteral(t)},pushProgram:function(t){t!=null?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function(t,r){var n=this.nameLookup("decorators",r,"decorator"),o=this.setupHelperArgs(r,t);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",o])," || fn;"])},invokeHelper:function(t,r,n){var o=this.popStack(),i=this.setupHelper(t,r),s=[];n&&s.push(i.name),s.push(o),this.options.strict||s.push(this.aliasable("container.hooks.helperMissing"));var a=["(",this.itemsSeparatedBy(s,"||"),")"],c=this.source.functionCall(a,"call",i.callParams);this.push(c)},itemsSeparatedBy:function(t,r){var n=[];n.push(t[0]);for(var o=1;o<t.length;o++)n.push(r,t[o]);return n},invokeKnownHelper:function(t,r){var n=this.setupHelper(t,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},invokeAmbiguous:function(t,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var o=this.setupHelper(0,t,r),i=this.lastHelper=this.nameLookup("helpers",t,"helper"),s=["(","(helper = ",i," || ",n,")"];this.options.strict||(s[0]="(helper = ",s.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",s,o.paramsInit?["),(",o.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",o.callParams)," : helper))"])},invokePartial:function(t,r,n){var o=[],i=this.setupParams(r,1,o);t&&(r=this.popStack(),delete i.name),n&&(i.indent=JSON.stringify(n)),i.helpers="helpers",i.partials="partials",i.decorators="container.decorators",t?o.unshift(r):o.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(i.depths="depths"),i=this.objectLiteral(i),o.push(i),this.push(this.source.functionCall("container.invokePartial","",o))},assignToHash:function(t){var r=this.popStack(),n=void 0,o=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(o=this.popStack(),n=this.popStack());var s=this.hash;n&&(s.contexts[t]=n),o&&(s.types[t]=o),i&&(s.ids[t]=i),s.values[t]=r},pushId:function(t,r,n){t==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):t==="PathExpression"?this.pushString(r):t==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:Xi,compileChildren:function(t,r){for(var n=t.children,o=void 0,i=void 0,s=0,a=n.length;s<a;s++){o=n[s],i=new this.compiler;var c=this.matchExistingProgram(o);if(c==null){this.context.programs.push("");var u=this.context.programs.length;o.index=u,o.name="program"+u,this.context.programs[u]=i.compile(o,r,this.context,!this.precompile),this.context.decorators[u]=i.decorators,this.context.environments[u]=o,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,o.useDepths=this.useDepths,o.useBlockParams=this.useBlockParams}else o.index=c.index,o.name="program"+c.index,this.useDepths=this.useDepths||c.useDepths,this.useBlockParams=this.useBlockParams||c.useBlockParams}},matchExistingProgram:function(t){for(var r=0,n=this.context.environments.length;r<n;r++){var o=this.context.environments[r];if(o&&o.equals(t))return o}},programExpression:function(t){var r=this.environment.children[t],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},useRegister:function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function(t){return t instanceof Qi||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new Qi(t))},pushSource:function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function(t){var r=["("],n=void 0,o=void 0,i=void 0;if(!this.isInline())throw new ey.default("replaceStack on non-inline");var s=this.popStack(!0);if(s instanceof Qi)n=[s.value],r=["(",n],i=!0;else{o=!0;var a=this.incrStack();r=["((",this.push(a)," = ",s,")"],n=this.topStack()}var c=t.call(this,n);i||this.popStack(),o&&this.stackSlot--,this.push(r.concat(c,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var r=0,n=t.length;r<n;r++){var o=t[r];if(o instanceof Qi)this.compileStack.push(o);else{var i=this.incrStack();this.pushSource([i," = ",o,";"]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var r=this.isInline(),n=(r?this.inlineStack:this.compileStack).pop();if(!t&&n instanceof Qi)return n.value;if(!r){if(!this.stackSlot)throw new ey.default("Invalid stack pop");this.stackSlot--}return n},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,r=t[t.length-1];return r instanceof Qi?r.value:r},contextName:function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function(t){return this.source.quotedString(t)},objectLiteral:function(t){return this.source.objectLiteral(t)},aliasable:function(t){var r=this.aliases[t];return r?(r.referenceCount++,r):(r=this.aliases[t]=this.source.wrap(t),r.aliasable=!0,r.referenceCount=1,r)},setupHelper:function(t,r,n){var o=[],i=this.setupHelperArgs(r,t,o,n),s=this.nameLookup("helpers",r,"helper"),a=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:o,paramsInit:i,name:s,callParams:[a].concat(o)}},setupParams:function(t,r,n){var o={},i=[],s=[],a=[],c=!n,u=void 0;c&&(n=[]),o.name=this.quotedString(t),o.hash=this.popStack(),this.trackIds&&(o.hashIds=this.popStack()),this.stringParams&&(o.hashTypes=this.popStack(),o.hashContexts=this.popStack());var p=this.popStack(),l=this.popStack();(l||p)&&(o.fn=l||"container.noop",o.inverse=p||"container.noop");for(var d=r;d--;)u=this.popStack(),n[d]=u,this.trackIds&&(a[d]=this.popStack()),this.stringParams&&(s[d]=this.popStack(),i[d]=this.popStack());return c&&(o.args=this.source.generateArray(n)),this.trackIds&&(o.ids=this.source.generateArray(a)),this.stringParams&&(o.types=this.source.generateArray(s),o.contexts=this.source.generateArray(i)),this.options.data&&(o.data="data"),this.useBlockParams&&(o.blockParams="blockParams"),o},setupHelperArgs:function(t,r,n,o){var i=this.setupParams(t,r,n);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),o?(this.useRegister("options"),n.push("options"),["options=",i]):n?(n.push(i),""):i}};(function(){for(var e="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),t=Xi.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();Xi.isValidJavaScriptVariableName=function(e){return!Xi.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function A6(e,t,r,n,o){var i=t.popStack(),s=r.length;for(e&&s--;n<s;n++)i=t.nameLookup(i,r[n],o);return e?[t.aliasable("container.strict"),"(",i,", ",t.quotedString(r[n]),", ",JSON.stringify(t.source.currentLocation)," )"]:i}Wl.default=Xi;k2.exports=Wl.default});var E2=$((Kl,P2)=>{"use strict";Kl.__esModule=!0;function za(e){return e&&e.__esModule?e:{default:e}}var R6=CP(),I6=za(R6),z6=Rg(),D6=za(z6),ty=UP(),ry=BP(),O6=S2(),N6=za(O6),j6=Ll(),M6=za(j6),L6=Eg(),Z6=za(L6),U6=I6.default.create;function $2(){var e=U6();return e.compile=function(t,r){return ry.compile(t,r,e)},e.precompile=function(t,r){return ry.precompile(t,r,e)},e.AST=D6.default,e.Compiler=ry.Compiler,e.JavaScriptCompiler=N6.default,e.Parser=ty.parser,e.parse=ty.parse,e.parseWithoutProcessing=ty.parseWithoutProcessing,e}var es=$2();es.create=$2;Z6.default(es);es.Visitor=M6.default;es.default=es;Kl.default=es;P2.exports=Kl.default});var C2=$(Jl=>{"use strict";Jl.__esModule=!0;Jl.print=B6;Jl.PrintVisitor=Ze;function q6(e){return e&&e.__esModule?e:{default:e}}var F6=Ll(),G6=q6(F6);function B6(e){return new Ze().accept(e)}function Ze(){this.padding=0}Ze.prototype=new G6.default;Ze.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
138
- `,t};Ze.prototype.Program=function(e){var t="",r=e.body,n=void 0,o=void 0;if(e.blockParams){var i="BLOCK PARAMS: [";for(n=0,o=e.blockParams.length;n<o;n++)i+=" "+e.blockParams[n];i+=" ]",t+=this.pad(i)}for(n=0,o=r.length;n<o;n++)t+=this.accept(r[n]);return this.padding--,t};Ze.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Ze.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Ze.prototype.BlockStatement=Ze.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};Ze.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};Ze.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};Ze.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Ze.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Ze.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,o=0,i=t.length;o<i;o++)r.push(this.accept(t[o]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};Ze.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Ze.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Ze.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Ze.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Ze.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Ze.prototype.NullLiteral=function(){return"NULL"};Ze.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,o=t.length;n<o;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};Ze.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Ql=$((FY,R2)=>{var Yl=E2().default,A2=C2();Yl.PrintVisitor=A2.PrintVisitor;Yl.print=A2.print;R2.exports=Yl;function T2(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Yl.compile(n)}typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=T2,require.extensions[".hbs"]=T2)});function V6(e,t){return{profile_name:e.name,stacks:e.stacks,frontend:e.frontend?{...e.frontend,mindset:""}:void 0,backend:e.backend?{...e.backend,mindset:""}:void 0,quality_gate:e.quality_gate,tools:e.tools??[],vendor:e.vendor??[],...t}}function I2(e,t){let r=D2.get(`mindset:${e}`);return r?r(t):`[Mindset '${e}' not found]`}function O2(e,t,r){let n=D2.get(`prompt:${e}`);if(!n)throw new Error(`\u30D7\u30ED\u30F3\u30D7\u30C8\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 '${e}' \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u914D\u4FE1\u30D0\u30F3\u30C9\u30EB\u306B\u542B\u307E\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002MCP \u30B5\u30FC\u30D0\u30FC\u3092\u518D\u8D77\u52D5\u3059\u308B\u3068 Registry \u304B\u3089\u518D\u30D5\u30A7\u30C3\u30C1\u3055\u308C\u307E\u3059\u3002\u89E3\u6D88\u3057\u306A\u3044\u5834\u5408\u306F Registry \u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u767B\u9332\uFF08seed\uFF09\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`);let o=V6(t,r);if(t.frontend?.mindset_template){let i=I2(t.frontend.mindset_template,o);o.frontend.mindset=i}if(t.backend?.mindset_template){let i=I2(t.backend.mindset_template,o);o.backend.mindset=i}return n(o)}var z2,D2,N2=b(()=>{"use strict";z2=yt(Ql(),1);z2.default.registerHelper("eq",function(e,t){return e===t});D2=new Map});var Xl,ny=b(()=>{"use strict";Xl="finish"});function L2(e){return M2.map(t=>({apiDir:(0,ke.join)(e,...t.api),appDir:(0,ke.join)(e,...t.app)}))}function Z2(){try{return(0,ke.dirname)((0,j2.fileURLToPath)(__goddBundleUrl))}catch{return(0,ke.dirname)(process.execPath)}}function H6(e,t){return(0,Ir.existsSync)((0,ke.join)(e,"app","main.py"))&&(0,Ir.existsSync)((0,ke.join)(t,"package.json"))&&(0,Ir.existsSync)((0,ke.join)(t,"src"))}function W6(e){for(let t of M2){let r=(0,ke.join)(e,...t.api),n=(0,ke.join)(e,...t.app);if((0,Ir.existsSync)(r)&&(0,Ir.existsSync)(n)&&H6(r,n))return{apiDir:r,appDir:n,projectRoot:e}}return null}function K6(e){let t=new Set,r=[];for(let n of e){let o=(0,ke.resolve)(n);t.has(o)||(t.add(o),r.push(o))}return r}function U2(e){let t=Z2(),r=(0,ke.dirname)(process.execPath),n=K6([...e?.preferredRoots??[],process.cwd(),(0,ke.resolve)(process.cwd(),".."),(0,ke.resolve)(t,".."),(0,ke.resolve)(t,"..",".."),t,r,(0,ke.resolve)(r,"..")]);for(let o of n){let i=W6(o);if(i)return i}return null}function ep(e){let t=U2(e);return t?{apiDir:t.apiDir,appDir:t.appDir}:null}function J6(e){let t=Z2();return[(0,ke.join)(e,"templates","notes-compose.yml"),(0,ke.join)((0,ke.resolve)(t,".."),"templates","notes-compose.yml")].find(n=>(0,Ir.existsSync)(n))??null}function q2(e){let t=U2(e);if(!t)return null;let r=J6(t.projectRoot);return r?{apiDir:t.apiDir,appDir:t.appDir,composeTemplate:r}:null}function oy(e){return(0,ke.isAbsolute)(e)||Y6.test(e)}function Q6(e,t){let r=(0,ke.resolve)(t);return typeof e!="string"||e===""?r:oy(e)?(0,Ir.existsSync)(e)?(0,ke.resolve)(e):(console.warn(` \u26A0 ${xn} \u306E outputDir \u304C\u3053\u306E\u30DE\u30B7\u30F3\u306B\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e} \u2192 ${r}`),r):(0,ke.resolve)(t,e)}function tp(e){let t=(0,ke.join)(e,xn);if(!(0,Ir.existsSync)(t))return null;try{let r=JSON.parse((0,Ir.readFileSync)(t,"utf-8"));return{...r,outputDir:Q6(r.outputDir,e)}}catch{return null}}function X6(e){return[`notes-api: ${e.apiDir}`,`notes-app: ${e.appDir}`]}function F2(e){console.log("--- \u30C7\u30D7\u30ED\u30A4\u5BFE\u8C61\u30BD\u30FC\u30B9 ---");for(let t of X6(e))console.log(` ${t}`);console.log()}var Ir,ke,j2,M2,xn,Y6,rp=b(()=>{"use strict";Ir=require("node:fs"),ke=require("node:path"),j2=require("node:url"),M2=[{api:["notes","api"],app:["notes","app"]},{api:["notes-api"],app:["notes-app"]}];xn=".godd-notes-infra.json",Y6=/^(?:[A-Za-z]:[\\/]|\\\\)/});function ts(e){try{return(0,ne.existsSync)(e)?JSON.parse((0,ne.readFileSync)(e,"utf-8")):null}catch{return null}}function kn(e,t=4096){try{return(0,ne.existsSync)(e)?(0,ne.readFileSync)(e).subarray(0,t).toString("utf-8"):""}catch{return""}}function tU(e){let t=(0,W.join)(e,"vendor");if(!(0,ne.existsSync)(t))return[];let r=[];try{for(let n of(0,ne.readdirSync)(t)){let o=(0,W.join)(t,n);if(!(0,ne.statSync)(o).isDirectory())continue;let i=eU[n];if(i)r.push({name:n,path:o,description:i.description,runtime:i.runtime,setupHint:i.setupHint});else{let s=(0,ne.existsSync)((0,W.join)(o,"pyproject.toml")),a=(0,ne.existsSync)((0,W.join)(o,"package.json")),c=s?"python":a?"node":"unknown";r.push({name:n,path:o,description:`vendor/${n}`,runtime:c,setupHint:c==="python"?"uv sync":"pnpm install"})}}}catch{}return r}function rU(e){let t=[],r=(0,W.join)(e,"backend","pyproject.toml"),n=(0,W.join)(e,"backend","requirements.txt");if((0,ne.existsSync)(r)){let y=kn(r);y.includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/pyproject.toml \u306B fastapi \u3092\u691C\u51FA"}),y.includes("django")&&t.push({id:"django",label:"Django",evidence:"backend/pyproject.toml \u306B django \u3092\u691C\u51FA"})}else(0,ne.existsSync)(n)&&kn(n).includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/requirements.txt \u306B fastapi \u3092\u691C\u51FA"});let o=ts((0,W.join)(e,"frontend","package.json")),i=ts((0,W.join)(e,"package.json")),s=ts((0,W.join)(e,"src","package.json"));for(let[y,v]of[["frontend/package.json",o],["package.json",i],["src/package.json",s]]){if(!v)continue;let w={...v.dependencies,...v.devDependencies};w.react&&t.push({id:"react",label:"React",evidence:`${y} \u306B react \u3092\u691C\u51FA`}),w.next&&t.push({id:"nextjs",label:"Next.js",evidence:`${y} \u306B next \u3092\u691C\u51FA`}),w.vue&&t.push({id:"vue",label:"Vue.js",evidence:`${y} \u306B vue \u3092\u691C\u51FA`}),w.svelte&&t.push({id:"svelte",label:"Svelte",evidence:`${y} \u306B svelte \u3092\u691C\u51FA`}),w.electron&&t.push({id:"electron",label:"Electron",evidence:`${y} \u306B electron \u3092\u691C\u51FA`})}let a=(0,W.join)(e,"pubspec.yaml");if((0,ne.existsSync)(a)){let y=kn(a);t.push({id:"dart",label:"Dart",evidence:"pubspec.yaml \u3092\u691C\u51FA"}),y.includes("flutter")&&t.push({id:"flutter",label:"Flutter",evidence:"pubspec.yaml \u306B flutter \u3092\u691C\u51FA"})}let c=(0,ne.existsSync)((0,W.join)(e,"Package.swift")),u=(0,W.join)(e,"ios"),p=(0,ne.existsSync)(u)&&(()=>{try{return(0,ne.readdirSync)(u).some(y=>y.endsWith(".xcodeproj")||y.endsWith(".xcworkspace"))}catch{return!1}})();(c||p)&&t.push({id:"swift",label:"Swift",evidence:c?"Package.swift \u3092\u691C\u51FA":"ios/*.xcodeproj \u3092\u691C\u51FA"});let l=(0,ne.existsSync)((0,W.join)(e,"build.gradle.kts")),d=(0,ne.existsSync)((0,W.join)(e,"build.gradle")),f=(0,W.join)(e,"android"),h=(0,ne.existsSync)((0,W.join)(f,"build.gradle.kts"))||(0,ne.existsSync)((0,W.join)(f,"build.gradle"));(l||d||h)&&t.push({id:"kotlin",label:"Kotlin",evidence:l?"build.gradle.kts \u3092\u691C\u51FA":d?"build.gradle \u3092\u691C\u51FA":"android/build.gradle \u3092\u691C\u51FA"});let g=kn((0,W.join)(e,"docker-compose.yml"));return g&&g.includes("postgres")&&t.push({id:"postgres",label:"Postgres",evidence:"docker-compose.yml \u306B postgres \u3092\u691C\u51FA"}),((0,ne.existsSync)((0,W.join)(e,"prisma","schema.prisma"))||(0,ne.existsSync)((0,W.join)(e,"backend","prisma","schema.prisma")))&&t.push({id:"prisma",label:"Prisma",evidence:"prisma/schema.prisma \u3092\u691C\u51FA"}),t}function oU(e){let t={},r=new Map,n=[(0,W.join)(e,"package.json"),(0,W.join)(e,"frontend","package.json"),(0,W.join)(e,"src","package.json")];for(let o of n){let i=ts(o);if(!i)continue;let s=o.replace(e,"").replace(/^[\\/]/,""),a=i.dependencies,c=i.devDependencies;for(let[u,p]of Object.entries({...a,...c}))t[u]=p,r.set(u,s)}return{deps:t,sources:r}}function iU(e){let t=new Set,r="";for(let n of[(0,W.join)(e,"backend"),e]){let o=(0,W.join)(n,"pyproject.toml");if((0,ne.existsSync)(o)){let a=kn(o,16384).matchAll(/["']([a-zA-Z][\w.-]*)(?:\[.*?\])?(?:>=|<=|==|~=|!=|<|>)?/g);for(let c of a)t.add(c[1].toLowerCase().replace(/[-_.]+/g,"-"));r=o.replace(e,"").replace(/^[\\/]/,"");break}let i=(0,W.join)(n,"requirements.txt");if((0,ne.existsSync)(i)){let s=kn(i,16384);for(let a of s.split(`
138
+ `,t};Ze.prototype.Program=function(e){var t="",r=e.body,n=void 0,o=void 0;if(e.blockParams){var i="BLOCK PARAMS: [";for(n=0,o=e.blockParams.length;n<o;n++)i+=" "+e.blockParams[n];i+=" ]",t+=this.pad(i)}for(n=0,o=r.length;n<o;n++)t+=this.accept(r[n]);return this.padding--,t};Ze.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Ze.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Ze.prototype.BlockStatement=Ze.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};Ze.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};Ze.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};Ze.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Ze.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Ze.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,o=0,i=t.length;o<i;o++)r.push(this.accept(t[o]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};Ze.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Ze.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Ze.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Ze.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Ze.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Ze.prototype.NullLiteral=function(){return"NULL"};Ze.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,o=t.length;n<o;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};Ze.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Ql=$((BY,R2)=>{var Yl=E2().default,A2=C2();Yl.PrintVisitor=A2.PrintVisitor;Yl.print=A2.print;R2.exports=Yl;function T2(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Yl.compile(n)}typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=T2,require.extensions[".hbs"]=T2)});function V6(e,t){return{profile_name:e.name,stacks:e.stacks,frontend:e.frontend?{...e.frontend,mindset:""}:void 0,backend:e.backend?{...e.backend,mindset:""}:void 0,quality_gate:e.quality_gate,tools:e.tools??[],vendor:e.vendor??[],...t}}function I2(e,t){let r=D2.get(`mindset:${e}`);return r?r(t):`[Mindset '${e}' not found]`}function O2(e,t,r){let n=D2.get(`prompt:${e}`);if(!n)throw new Error(`\u30D7\u30ED\u30F3\u30D7\u30C8\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 '${e}' \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u914D\u4FE1\u30D0\u30F3\u30C9\u30EB\u306B\u542B\u307E\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002MCP \u30B5\u30FC\u30D0\u30FC\u3092\u518D\u8D77\u52D5\u3059\u308B\u3068 Registry \u304B\u3089\u518D\u30D5\u30A7\u30C3\u30C1\u3055\u308C\u307E\u3059\u3002\u89E3\u6D88\u3057\u306A\u3044\u5834\u5408\u306F Registry \u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u767B\u9332\uFF08seed\uFF09\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`);let o=V6(t,r);if(t.frontend?.mindset_template){let i=I2(t.frontend.mindset_template,o);o.frontend.mindset=i}if(t.backend?.mindset_template){let i=I2(t.backend.mindset_template,o);o.backend.mindset=i}return n(o)}var z2,D2,N2=b(()=>{"use strict";z2=yt(Ql(),1);z2.default.registerHelper("eq",function(e,t){return e===t});D2=new Map});var Xl,ny=b(()=>{"use strict";Xl="finish"});function L2(e){return M2.map(t=>({apiDir:(0,ke.join)(e,...t.api),appDir:(0,ke.join)(e,...t.app)}))}function Z2(){try{return(0,ke.dirname)((0,j2.fileURLToPath)(__goddBundleUrl))}catch{return(0,ke.dirname)(process.execPath)}}function H6(e,t){return(0,Ir.existsSync)((0,ke.join)(e,"app","main.py"))&&(0,Ir.existsSync)((0,ke.join)(t,"package.json"))&&(0,Ir.existsSync)((0,ke.join)(t,"src"))}function W6(e){for(let t of M2){let r=(0,ke.join)(e,...t.api),n=(0,ke.join)(e,...t.app);if((0,Ir.existsSync)(r)&&(0,Ir.existsSync)(n)&&H6(r,n))return{apiDir:r,appDir:n,projectRoot:e}}return null}function K6(e){let t=new Set,r=[];for(let n of e){let o=(0,ke.resolve)(n);t.has(o)||(t.add(o),r.push(o))}return r}function U2(e){let t=Z2(),r=(0,ke.dirname)(process.execPath),n=K6([...e?.preferredRoots??[],process.cwd(),(0,ke.resolve)(process.cwd(),".."),(0,ke.resolve)(t,".."),(0,ke.resolve)(t,"..",".."),t,r,(0,ke.resolve)(r,"..")]);for(let o of n){let i=W6(o);if(i)return i}return null}function ep(e){let t=U2(e);return t?{apiDir:t.apiDir,appDir:t.appDir}:null}function J6(e){let t=Z2();return[(0,ke.join)(e,"templates","notes-compose.yml"),(0,ke.join)((0,ke.resolve)(t,".."),"templates","notes-compose.yml")].find(n=>(0,Ir.existsSync)(n))??null}function q2(e){let t=U2(e);if(!t)return null;let r=J6(t.projectRoot);return r?{apiDir:t.apiDir,appDir:t.appDir,composeTemplate:r}:null}function oy(e){return(0,ke.isAbsolute)(e)||Y6.test(e)}function Q6(e,t){let r=(0,ke.resolve)(t);return typeof e!="string"||e===""?r:oy(e)?(0,Ir.existsSync)(e)?(0,ke.resolve)(e):(console.warn(` \u26A0 ${xn} \u306E outputDir \u304C\u3053\u306E\u30DE\u30B7\u30F3\u306B\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e} \u2192 ${r}`),r):(0,ke.resolve)(t,e)}function tp(e){let t=(0,ke.join)(e,xn);if(!(0,Ir.existsSync)(t))return null;try{let r=JSON.parse((0,Ir.readFileSync)(t,"utf-8"));return{...r,outputDir:Q6(r.outputDir,e)}}catch{return null}}function X6(e){return[`notes-api: ${e.apiDir}`,`notes-app: ${e.appDir}`]}function F2(e){console.log("--- \u30C7\u30D7\u30ED\u30A4\u5BFE\u8C61\u30BD\u30FC\u30B9 ---");for(let t of X6(e))console.log(` ${t}`);console.log()}var Ir,ke,j2,M2,xn,Y6,rp=b(()=>{"use strict";Ir=require("node:fs"),ke=require("node:path"),j2=require("node:url"),M2=[{api:["notes","api"],app:["notes","app"]},{api:["notes-api"],app:["notes-app"]}];xn=".godd-notes-infra.json",Y6=/^(?:[A-Za-z]:[\\/]|\\\\)/});function ts(e){try{return(0,ne.existsSync)(e)?JSON.parse((0,ne.readFileSync)(e,"utf-8")):null}catch{return null}}function kn(e,t=4096){try{return(0,ne.existsSync)(e)?(0,ne.readFileSync)(e).subarray(0,t).toString("utf-8"):""}catch{return""}}function tU(e){let t=(0,W.join)(e,"vendor");if(!(0,ne.existsSync)(t))return[];let r=[];try{for(let n of(0,ne.readdirSync)(t)){let o=(0,W.join)(t,n);if(!(0,ne.statSync)(o).isDirectory())continue;let i=eU[n];if(i)r.push({name:n,path:o,description:i.description,runtime:i.runtime,setupHint:i.setupHint});else{let s=(0,ne.existsSync)((0,W.join)(o,"pyproject.toml")),a=(0,ne.existsSync)((0,W.join)(o,"package.json")),c=s?"python":a?"node":"unknown";r.push({name:n,path:o,description:`vendor/${n}`,runtime:c,setupHint:c==="python"?"uv sync":"pnpm install"})}}}catch{}return r}function rU(e){let t=[],r=(0,W.join)(e,"backend","pyproject.toml"),n=(0,W.join)(e,"backend","requirements.txt");if((0,ne.existsSync)(r)){let y=kn(r);y.includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/pyproject.toml \u306B fastapi \u3092\u691C\u51FA"}),y.includes("django")&&t.push({id:"django",label:"Django",evidence:"backend/pyproject.toml \u306B django \u3092\u691C\u51FA"})}else(0,ne.existsSync)(n)&&kn(n).includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/requirements.txt \u306B fastapi \u3092\u691C\u51FA"});let o=ts((0,W.join)(e,"frontend","package.json")),i=ts((0,W.join)(e,"package.json")),s=ts((0,W.join)(e,"src","package.json"));for(let[y,v]of[["frontend/package.json",o],["package.json",i],["src/package.json",s]]){if(!v)continue;let w={...v.dependencies,...v.devDependencies};w.react&&t.push({id:"react",label:"React",evidence:`${y} \u306B react \u3092\u691C\u51FA`}),w.next&&t.push({id:"nextjs",label:"Next.js",evidence:`${y} \u306B next \u3092\u691C\u51FA`}),w.vue&&t.push({id:"vue",label:"Vue.js",evidence:`${y} \u306B vue \u3092\u691C\u51FA`}),w.svelte&&t.push({id:"svelte",label:"Svelte",evidence:`${y} \u306B svelte \u3092\u691C\u51FA`}),w.electron&&t.push({id:"electron",label:"Electron",evidence:`${y} \u306B electron \u3092\u691C\u51FA`})}let a=(0,W.join)(e,"pubspec.yaml");if((0,ne.existsSync)(a)){let y=kn(a);t.push({id:"dart",label:"Dart",evidence:"pubspec.yaml \u3092\u691C\u51FA"}),y.includes("flutter")&&t.push({id:"flutter",label:"Flutter",evidence:"pubspec.yaml \u306B flutter \u3092\u691C\u51FA"})}let c=(0,ne.existsSync)((0,W.join)(e,"Package.swift")),u=(0,W.join)(e,"ios"),p=(0,ne.existsSync)(u)&&(()=>{try{return(0,ne.readdirSync)(u).some(y=>y.endsWith(".xcodeproj")||y.endsWith(".xcworkspace"))}catch{return!1}})();(c||p)&&t.push({id:"swift",label:"Swift",evidence:c?"Package.swift \u3092\u691C\u51FA":"ios/*.xcodeproj \u3092\u691C\u51FA"});let l=(0,ne.existsSync)((0,W.join)(e,"build.gradle.kts")),d=(0,ne.existsSync)((0,W.join)(e,"build.gradle")),f=(0,W.join)(e,"android"),h=(0,ne.existsSync)((0,W.join)(f,"build.gradle.kts"))||(0,ne.existsSync)((0,W.join)(f,"build.gradle"));(l||d||h)&&t.push({id:"kotlin",label:"Kotlin",evidence:l?"build.gradle.kts \u3092\u691C\u51FA":d?"build.gradle \u3092\u691C\u51FA":"android/build.gradle \u3092\u691C\u51FA"});let g=kn((0,W.join)(e,"docker-compose.yml"));return g&&g.includes("postgres")&&t.push({id:"postgres",label:"Postgres",evidence:"docker-compose.yml \u306B postgres \u3092\u691C\u51FA"}),((0,ne.existsSync)((0,W.join)(e,"prisma","schema.prisma"))||(0,ne.existsSync)((0,W.join)(e,"backend","prisma","schema.prisma")))&&t.push({id:"prisma",label:"Prisma",evidence:"prisma/schema.prisma \u3092\u691C\u51FA"}),t}function oU(e){let t={},r=new Map,n=[(0,W.join)(e,"package.json"),(0,W.join)(e,"frontend","package.json"),(0,W.join)(e,"src","package.json")];for(let o of n){let i=ts(o);if(!i)continue;let s=o.replace(e,"").replace(/^[\\/]/,""),a=i.dependencies,c=i.devDependencies;for(let[u,p]of Object.entries({...a,...c}))t[u]=p,r.set(u,s)}return{deps:t,sources:r}}function iU(e){let t=new Set,r="";for(let n of[(0,W.join)(e,"backend"),e]){let o=(0,W.join)(n,"pyproject.toml");if((0,ne.existsSync)(o)){let a=kn(o,16384).matchAll(/["']([a-zA-Z][\w.-]*)(?:\[.*?\])?(?:>=|<=|==|~=|!=|<|>)?/g);for(let c of a)t.add(c[1].toLowerCase().replace(/[-_.]+/g,"-"));r=o.replace(e,"").replace(/^[\\/]/,"");break}let i=(0,W.join)(n,"requirements.txt");if((0,ne.existsSync)(i)){let s=kn(i,16384);for(let a of s.split(`
139
139
  `)){let c=a.trim();if(!c||c.startsWith("#"))continue;let u=c.match(/^([a-zA-Z][\w.-]*)/);u&&t.add(u[1].toLowerCase().replace(/[-_.]+/g,"-"))}r=i.replace(e,"").replace(/^[\\/]/,"");break}}return{deps:t,source:r}}function sU(e){let t=[],r=new Set,{deps:n,sources:o}=oU(e),{deps:i,source:s}=iU(e),a="";for(let c of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]){let u=kn((0,W.join)(e,c));if(u){a=u;break}}for(let c of nU)if(!r.has(c.id)){if(c.npmPackage&&c.npmPackage in n){let u=o.get(c.npmPackage)??"package.json";r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${u} \u306B ${c.npmPackage} \u3092\u691C\u51FA`,version:n[c.npmPackage],url:c.url});continue}if(c.pyPackage&&i.has(c.pyPackage.toLowerCase().replace(/[-_.]+/g,"-"))){r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${s} \u306B ${c.pyPackage} \u3092\u691C\u51FA`,url:c.url});continue}if(c.configFiles){for(let u of c.configFiles)if((0,ne.existsSync)((0,W.join)(e,u))){r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${u} \u3092\u691C\u51FA`,url:c.url});break}if(r.has(c.id))continue}c.dockerPattern&&a.includes(c.dockerPattern)&&(r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`docker-compose.yml \u306B ${c.dockerPattern} \u3092\u691C\u51FA`,url:c.url}))}return t}function aU(e){let t;for(let i of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"])if(t=kn((0,W.join)(e,i)),t)break;if(!t)return[];let r=[],n=/^\s{2}(\w[\w-]*):\s*$/gm,o;for(;(o=n.exec(t))!==null;)r.push(o[1]);return r}function cU(e){let t=(0,W.join)(e,"docs"),r=L2(e),n=r.some(({appDir:c})=>(0,ne.existsSync)((0,W.join)(c,"package.json"))),o=r.some(({apiDir:c})=>(0,ne.existsSync)((0,W.join)(c,"pyproject.toml")));if(!(0,ne.existsSync)(t))return{exists:!1,sections:[],files:[],has_notes_app:n,has_notes_api:o};let i=[],s=[];function a(c,u){try{for(let p of(0,ne.readdirSync)(c)){if(p.startsWith("."))continue;let l=(0,W.join)(c,p),d=u?`${u}/${p}`:p;(0,ne.statSync)(l).isDirectory()?(u||i.push(p),a(l,d)):s.push(d)}}catch{}}return a(t,""),{exists:!0,sections:i,files:s,has_notes_app:n,has_notes_api:o}}function G2(e){let t=ts((0,W.join)(e,"package.json"))?.name||(0,W.basename)(e),r=[];try{for(let u of(0,ne.readdirSync)(e)){if(u.startsWith(".")||u==="node_modules")continue;let p=(0,W.join)(e,u);(0,ne.statSync)(p).isDirectory()&&r.push(u)}}catch{}let o=["package.json","pyproject.toml","docker-compose.yml","docker-compose.yaml","Dockerfile","tsconfig.json",".env.example","env.example","AGENTS.md","README.md","Makefile",".mise.toml","turbo.json","pnpm-workspace.yaml"].filter(u=>(0,ne.existsSync)((0,W.join)(e,u))),s=ts((0,W.join)(e,"package.json"))?.scripts??{},a=[];try{for(let u of(0,ne.readdirSync)(e))(u.match(/^env.*\.example$/)||u.match(/^\.env.*\.example$/))&&a.push(u)}catch{}let c=kn((0,W.join)(e,"README.md"),500);return{root:e,name:t,detected_stacks:rU(e),detected_tools:sU(e),vendor_items:tU(e),key_files:o,directories:r,scripts:s,docker_services:aU(e),env_templates:a,readme_excerpt:c,docs_structure:cU(e)}}var ne,W,eU,nU,B2=b(()=>{"use strict";ne=require("node:fs"),W=require("node:path");rp();eU={"browser-use":{description:"Python AI \u30D6\u30E9\u30A6\u30B6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8 \u2014 Web\u30D6\u30E9\u30A6\u30B6\u3092\u81EA\u52D5\u64CD\u4F5C",runtime:"python",setupHint:"uv sync && uv run browser-use install"},"android-use":{description:"Python Android AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8 \u2014 Android\u7AEF\u672B\u3092ADB\u3067\u81EA\u52D5\u64CD\u4F5C",runtime:"python",setupHint:"python -m venv .venv && pip install -r requirements.txt"},"react-grab":{description:"Node.js React \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B3\u30D4\u30FC\u30C4\u30FC\u30EB \u2014 React\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30C4\u30EA\u30FC\u3092\u62BD\u51FA",runtime:"node",setupHint:"pnpm install && pnpm build"}};nU=[{id:"orval",label:"Orval",category:"frontend",description:"OpenAPI \u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u30B3\u30FC\u30C9\u81EA\u52D5\u751F\u6210",url:"https://github.com/orval-labs/orval",npmPackage:"orval",configFiles:["orval.config.ts","orval.config.js","orval.config.cjs"]},{id:"tanstack-query",label:"TanStack Query",category:"frontend",description:"\u975E\u540C\u671F\u30C7\u30FC\u30BF\u30D5\u30A7\u30C3\u30C1\u30F3\u30B0/\u30AD\u30E3\u30C3\u30B7\u30E5\u7BA1\u7406",url:"https://github.com/TanStack/query",npmPackage:"@tanstack/react-query"},{id:"vite",label:"Vite",category:"frontend",description:"\u9AD8\u901F\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://vitejs.dev/",npmPackage:"vite",configFiles:["vite.config.ts","vite.config.js","vite.config.mts"]},{id:"biome",label:"Biome",category:"devtool",description:"\u9AD8\u901F Linter / Formatter\uFF08Rust\u88FD\uFF09",url:"https://biomejs.dev/",npmPackage:"@biomejs/biome",configFiles:["biome.json","biome.jsonc"]},{id:"storybook",label:"Storybook",category:"frontend",description:"UI\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u958B\u767A/\u30AB\u30BF\u30ED\u30B0\u30C4\u30FC\u30EB",url:"https://storybook.js.org/",npmPackage:"storybook",configFiles:[".storybook/main.ts",".storybook/main.js"]},{id:"ruff",label:"Ruff",category:"devtool",description:"\u8D85\u9AD8\u901F Python Linter / Formatter\uFF08Rust\u88FD\uFF09",url:"https://docs.astral.sh/ruff/",pyPackage:"ruff",configFiles:["ruff.toml",".ruff.toml"]},{id:"uv",label:"uv",category:"devtool",description:"\u9AD8\u901F Python \u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\uFF08Rust\u88FD\uFF09",url:"https://docs.astral.sh/uv/",configFiles:["uv.lock"]},{id:"sqlmodel",label:"SQLModel",category:"backend",description:"SQLAlchemy + Pydantic \u30D9\u30FC\u30B9\u306E Python ORM",url:"https://sqlmodel.tiangolo.com/",pyPackage:"sqlmodel"},{id:"alembic",label:"Alembic",category:"backend",description:"SQLAlchemy \u30D9\u30FC\u30B9\u306E DB \u30DE\u30A4\u30B0\u30EC\u30FC\u30B7\u30E7\u30F3\u30C4\u30FC\u30EB",url:"https://alembic.sqlalchemy.org/",pyPackage:"alembic",configFiles:["alembic.ini","backend/alembic.ini"]},{id:"fastapi-users",label:"FastAPI Users",category:"backend",description:"FastAPI \u5411\u3051\u8A8D\u8A3C/\u30E6\u30FC\u30B6\u30FC\u7BA1\u7406\u30E9\u30A4\u30D6\u30E9\u30EA",url:"https://fastapi-users.github.io/fastapi-users/",pyPackage:"fastapi-users"},{id:"pytest",label:"Pytest",category:"testing",description:"Python \u30C6\u30B9\u30C8\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF",url:"https://docs.pytest.org/",pyPackage:"pytest",configFiles:["pytest.ini","pyproject.toml"]},{id:"httpx",label:"HTTPX",category:"testing",description:"Python \u975E\u540C\u671F HTTP \u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF08\u30C6\u30B9\u30C8\u7528\uFF09",url:"https://www.python-httpx.org/",pyPackage:"httpx"},{id:"playwright",label:"Playwright",category:"testing",description:"\u30AF\u30ED\u30B9\u30D6\u30E9\u30A6\u30B6 E2E \u30C6\u30B9\u30C8\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF",url:"https://playwright.dev/",npmPackage:"@playwright/test",pyPackage:"playwright",configFiles:["playwright.config.ts","playwright.config.js"]},{id:"docker-compose",label:"Docker Compose",category:"infra",description:"\u30DE\u30EB\u30C1\u30B3\u30F3\u30C6\u30CA\u30AA\u30FC\u30B1\u30B9\u30C8\u30EC\u30FC\u30B7\u30E7\u30F3",url:"https://docs.docker.com/compose/",configFiles:["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]},{id:"caddy",label:"Caddy",category:"infra",description:"\u81EA\u52D5 HTTPS \u5BFE\u5FDC\u30EA\u30D0\u30FC\u30B9\u30D7\u30ED\u30AD\u30B7",url:"https://caddyserver.com/",configFiles:["Caddyfile"],dockerPattern:"caddy"},{id:"traefik",label:"Traefik",category:"infra",description:"\u30AF\u30E9\u30A6\u30C9\u30CD\u30A4\u30C6\u30A3\u30D6 \u30EA\u30D0\u30FC\u30B9\u30D7\u30ED\u30AD\u30B7 / \u30ED\u30FC\u30C9\u30D0\u30E9\u30F3\u30B5",url:"https://traefik.io/",configFiles:["traefik.yml","traefik.toml"],dockerPattern:"traefik"},{id:"flutter",label:"Flutter",category:"frontend",description:"\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\uFF08Dart\uFF09",url:"https://flutter.dev/",configFiles:["pubspec.yaml"]},{id:"cocoapods",label:"CocoaPods",category:"devtool",description:"iOS / macOS \u4F9D\u5B58\u7BA1\u7406\u30C4\u30FC\u30EB",url:"https://cocoapods.org/",configFiles:["Podfile","ios/Podfile"]},{id:"gradle",label:"Gradle",category:"devtool",description:"Android / JVM \u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://gradle.org/",configFiles:["build.gradle.kts","build.gradle","android/build.gradle.kts","android/build.gradle"]},{id:"swiftpm",label:"Swift Package Manager",category:"devtool",description:"Swift \u30D1\u30C3\u30B1\u30FC\u30B8\u7BA1\u7406\u30FB\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://www.swift.org/package-manager/",configFiles:["Package.swift"]},{id:"sentry",label:"Sentry",category:"monitoring",description:"\u30A8\u30E9\u30FC\u8FFD\u8DE1 / \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u76E3\u8996",url:"https://sentry.io/",npmPackage:"@sentry/react",pyPackage:"sentry-sdk",configFiles:["sentry.properties"]}]});function V2(e,t){let r=process.platform==="win32"?e.toLowerCase():e,n=process.platform==="win32"?t.toLowerCase():t,o=(0,Ot.relative)(r,n);return o===""||!(0,Ot.isAbsolute)(o)&&o!==".."&&!o.startsWith(`..${process.platform==="win32"?"\\":"/"}`)}function iy(e){let t=e,r=[];for(;;){try{(0,np.lstatSync)(t)}catch(n){if((n&&typeof n=="object"&&"code"in n?n.code:void 0)!=="ENOENT")throw new Error(Qn);let i=(0,Ot.dirname)(t);if(i===t)throw new Error(Qn);r.unshift((0,Ot.basename)(t)),t=i;continue}try{return(0,Ot.resolve)((0,np.realpathSync)(t),...r)}catch{throw new Error(Qn)}}}function uU(){let e=(0,Ot.resolve)(process.cwd()),t=process.env.GODD_PROJECT_ROOT;if(!t)return[e];if(process.platform!=="win32"&&H2.test(t))throw new Error(Qn);let r=process.platform==="win32"?t:t.replaceAll("\\","/"),n=(0,Ot.resolve)(e,r);return n===e?[e]:[e,n]}function W2(e){let t=uU(),r=(0,Ot.resolve)(process.cwd()),n=process.env.GODD_PROJECT_ROOT,o=n&&process.platform!=="win32"?n.replaceAll("\\","/"):n,i=o?(0,Ot.resolve)(r,o):r;if(e===void 0)return iy(i);if(process.platform!=="win32"&&H2.test(e))throw new Error(Qn);let s=process.platform==="win32"?e:e.replaceAll("\\","/");if(s.includes("\0"))throw new Error(Qn);let a=(0,Ot.resolve)(r,s);if(!t.some(l=>V2(l,a)))throw new Error(Qn);let u=iy(a);if(!t.some(l=>V2(iy(l),u)))throw new Error(Qn);return u}function K2(e){return W2(e)}function Nt(e,t){let r=W2(t);if(e.projectContext?.root===r)return e.projectContext;let n=G2(r);return e.projectContext=n,n}function Xn(e,t,r,n,o,i){let s=Nt(e,n),a=e.config.language??"en",c={project:s,language:a,...o},p=[...i?.prefixTemplates??[],t,...e.endsWithFinish?[Xl]:[]].map(d=>e.renderPrompt?e.renderPrompt(d,c):O2(d,e.profile,c)).join(`
140
140
 
141
141
  `);return`${a!=="en"?`> **Output Language**: Respond entirely in ${a}.
@@ -256,16 +256,16 @@ ${JSON.stringify(n,null,2)}${c?`
256
256
  ## \u540C\u68B1\u30D5\u30A1\u30A4\u30EB
257
257
 
258
258
  ${c}`:""}`}var WE,JE=b(()=>{"use strict";WE=yt(Ql(),1);yr();lp();ny()});function no(){return new me("data","\u914D\u4FE1\u3055\u308C\u305F\u96DB\u5F62\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u96DB\u5F62\u306E\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}function rq(e){return!e||e.length>400||e.startsWith("/")?!1:e.split("/").every(t=>t!=="."&&t!==".."&&eq.test(t))}function nq(e){let t=new Set;for(let r of e){let n=r.toLowerCase();if(t.has(n)||n===pp)return!1;t.add(n)}for(let r of t){let n=r.split("/");for(let o=1;o<n.length;o++)if(t.has(n.slice(0,o).join("/")))return!1}return!0}function oq(e){if(e.length>YU)throw no();let t;try{t=JSON.parse((0,XE.gunzipSync)(e,{maxOutputLength:QU}).toString("utf8"))}catch{throw no()}if(!t||typeof t!="object"||t.format!==JU)throw no();let r=t.files;if(!r||typeof r!="object"||Array.isArray(r))throw no();let n=Object.entries(r);if(n.length===0||n.length>XU||!nq(n.map(([i])=>i)))throw no();let o=new Map;for(let[i,s]of n){if(!rq(i)||typeof s!="string"||!tq.test(s))throw no();o.set(i,Buffer.from(s,"base64"))}return o}function iq(e,t){let r=(0,Je.relative)(e,t);return r!==""&&r!==".."&&!r.startsWith(`..${Je.sep}`)&&!(0,Je.isAbsolute)(r)}function YE(e){return`\u96DB\u5F62\u306F\u65E2\u306B\u7F6E\u304B\u308C\u3066\u3044\u307E\u3059\uFF08${e}\uFF09\u3002\u4E0A\u66F8\u304D\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u7D9A\u304D\u306F\u305D\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u9032\u3081\u3066\u304F\u3060\u3055\u3044\u3002`}async function eC(e,t,r){let n;try{n=K2(r)}catch{throw new me("input","\u96DB\u5F62\u306E\u7F6E\u304D\u5148\u306F\u3001\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\uFF08GoDD \u3092\u8A2D\u5B9A\u3057\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\uFF09\u306E\u4E2D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}if((0,Ne.existsSync)((0,Je.join)(n,pp)))return YE(n);if((0,Ne.existsSync)(n)&&(!(0,Ne.statSync)(n).isDirectory()||(0,Ne.readdirSync)(n).length>0))throw new me("input",`\u7F6E\u304D\u5148\uFF08${n}\uFF09\u306F\u7A7A\u3067\u306A\u3044\u304B\u3001\u30D5\u30A1\u30A4\u30EB\u3067\u3059\u3002\u5B58\u5728\u3057\u306A\u3044\u304B\u7A7A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let o=await HE(e,t),i=(0,QE.createHash)("sha256").update(o.data).digest("hex");if(!o.sha256||i!==o.sha256)throw new me("data","\u96DB\u5F62\u306E\u7167\u5408\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u6642\u9593\u3092\u304A\u3044\u3066\u547C\u3073\u76F4\u3057\u3001\u7D9A\u304F\u5834\u5408\u306F\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002");let s=oq(o.data);(0,Ne.mkdirSync)((0,Je.dirname)(n),{recursive:!0});let a=(0,Ne.mkdtempSync)((0,Je.join)((0,Je.dirname)(n),`.${(0,Je.basename)(n)}.godd-archive-`));try{for(let[c,u]of s){let p=(0,Je.resolve)(a,...c.split("/"));if(!iq(a,p))throw no();(0,Ne.mkdirSync)((0,Je.dirname)(p),{recursive:!0}),(0,Ne.writeFileSync)(p,u,{flag:"wx"})}(0,Ne.mkdirSync)((0,Je.join)(a,".godd"),{recursive:!0}),(0,Ne.writeFileSync)((0,Je.join)(a,pp),`${JSON.stringify({name:t,version:o.version,sha256:i},null,2)}
259
- `),(0,Ne.existsSync)(n)&&(0,Ne.rmdirSync)(n),(0,Ne.renameSync)(a,n)}catch(c){if((0,Ne.rmSync)(a,{recursive:!0,force:!0}),(0,Ne.existsSync)((0,Je.join)(n,pp)))return YE(n);throw c instanceof me?c:new me("input","\u96DB\u5F62\u3092\u66F8\u304D\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u7F6E\u304D\u5148\u306E\u7A7A\u304D\u5BB9\u91CF\u3068\u66F8\u304D\u8FBC\u307F\u6A29\u9650\u3092\u78BA\u304B\u3081\u3066\u3001\u547C\u3073\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return`\u96DB\u5F62\u3092\u7F6E\u304D\u307E\u3057\u305F\uFF08${n}\u3001${s.size} \u30D5\u30A1\u30A4\u30EB\u3001\u7248 ${o.version}\uFF09\u3002`}var QE,Ne,Je,XE,JU,YU,QU,XU,eq,tq,pp,tC=b(()=>{"use strict";QE=require("node:crypto"),Ne=require("node:fs"),Je=require("node:path"),XE=require("node:zlib");yr();lp();JU="godd-archive/1",YU=5*1024*1024,QU=20*1024*1024,XU=2e3,eq=/^[^\u0000-\u001f\u007f/\\:]+$/,tq=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,pp=".godd/archive.json"});var rC,sq,aq,cq,dp,nC=b(()=>{"use strict";rC=require("node:crypto"),sq=new Set(["godd-config","godd-working-record-save","godd-knowledge-projects"]),aq=new Set(["godd-knowledge-save"]),cq=["step","phase","mode"],dp=class{sessionId;saved=0;calls=[];finishing=!1;constructor(t=(0,rC.randomUUID)()){this.sessionId=t}record(t,r,n={},o=new Date){if(t==="godd-working-record-save"&&(this.finishing=!0),sq.has(t)||this.finishing&&aq.has(t))return;this.finishing=!1;let i=cq.map(s=>r[s]).filter(s=>typeof s=="string"&&s.length>0);this.calls.push({toolName:t,steps:i,...n,at:o})}recordFailure(t){t==="godd-working-record-save"&&(this.finishing=!0)}snapshot(){let t=new Map;for(let r of this.calls){let n=t.get(r.toolName)??{tool_name:r.toolName,steps:[],call_count:0};n.call_count+=1;for(let o of r.steps)n.steps.includes(o)||n.steps.push(o);r.definitionVersion!==void 0&&(n.definition_version=r.definitionVersion),r.promptVersions!==void 0&&(n.prompt_versions=r.promptVersions),t.set(r.toolName,n)}return{sessionId:this.sessionId,sequence:this.saved+1,startedAt:this.calls[0]?.at.toISOString(),tools:[...t.values()],covered:this.calls.length}}commit(t){t.sequence===this.saved+1&&(this.calls=this.calls.slice(t.covered),this.saved=t.sequence)}}});function oC(e,t,r){e={...e,client_version:t};let n=t==="0.0.0"?void 0:rr(t),o=r?.checkForUpdate??lc({version:t}),i="",s="",a;function c(){a??=o().then(k=>{i=k}).catch(()=>{i=""}).finally(()=>{a=void 0})}c();let u=new fl({name:"godd-mcp-server",version:t},{capabilities:{tools:{listChanged:!0},resources:{},prompts:{}}}),p={name:sg,description:ag,inputSchema:Dk(cg,{target:"jsonSchema7"})},l,d=!1,f=r?.session??new dp;function h(k,P,q){return{client:n??{version:t,channel:"unknown"},...k?{catalog_revision:k}:{},...P!==void 0?{definition_version:P}:{},...q?{prompt_versions:q}:{}}}async function g(){d||(d=!0,await u.notification({method:"notifications/tools/list_changed"}).catch(()=>{}))}async function y(k,P=!0){if(!k)return;let q=l!==void 0&&l!==k;l=k,q&&P&&await g()}async function v(k=!0){let P=await os(e,"",BE);return await y(P.revision,k),P}async function w(){try{await Z1(e.registry_url,e.license_key)}catch(k){throw up(k,e)}}async function x(k,P){if(k===sg)return{text:await I1(cg.parse(P))};if(e.components.length===0)throw new me("configuration","\u6280\u8853\u69CB\u6210\uFF08components\uFF09\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002godd init \u307E\u305F\u306F godd-config \u306E update \u3067\u69CB\u6210\u3092\u8A2D\u5B9A\u3057\u3001MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");if(!/^[a-z]{2}(-[A-Z]{2})?$/.test(e.language))throw new me("configuration","\u8A00\u8A9E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002godd-config \u3067 en\u3001ja \u306A\u3069\u306E\u8A00\u8A9E\u30B3\u30FC\u30C9\u3092\u8A2D\u5B9A\u3057\u3001MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");await w();let q=`/${encodeURIComponent(k)}`,L=await os(e,`${q}/prepare?${xy(e)}`,wy);await y(L.catalog_revision);let Ue={...L.execution?.defaults,...P};try{let qe=new Bi().getValidator(L.definition.inputSchema)(Ue);if(!qe.valid)throw new me("input",`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${qe.errorMessage??"\u5F15\u6570\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}`)}catch(Q){throw Q instanceof me?Q:new me("data","\u914D\u4FE1\u3055\u308C\u305F\u5F15\u6570\u5B9A\u7FA9\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}if(L.execution?.kind==="server"){let Q=await os(e,`${q}/execute?${xy(e)}`,wy,Ue);if(Q.result===void 0)throw new me("data","\u5B9F\u884C\u7D50\u679C\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002\u518D\u9001\u306E\u524D\u306B\u51E6\u7406\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");return{text:typeof Q.result=="string"?Q.result:JSON.stringify(Q.result),definitionVersion:Q.definition.version,revision:Q.catalog_revision}}let we={...L,arguments:Ue};if(L.execution?.kind==="prompt"){let Q=Ue.archive_target;return{text:(L.execution.archive&&typeof Q=="string"&&Q.trim()?`${await eC(e,k,Q)}
259
+ `),(0,Ne.existsSync)(n)&&(0,Ne.rmdirSync)(n),(0,Ne.renameSync)(a,n)}catch(c){if((0,Ne.rmSync)(a,{recursive:!0,force:!0}),(0,Ne.existsSync)((0,Je.join)(n,pp)))return YE(n);throw c instanceof me?c:new me("input","\u96DB\u5F62\u3092\u66F8\u304D\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u7F6E\u304D\u5148\u306E\u7A7A\u304D\u5BB9\u91CF\u3068\u66F8\u304D\u8FBC\u307F\u6A29\u9650\u3092\u78BA\u304B\u3081\u3066\u3001\u547C\u3073\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return`\u96DB\u5F62\u3092\u7F6E\u304D\u307E\u3057\u305F\uFF08${n}\u3001${s.size} \u30D5\u30A1\u30A4\u30EB\u3001\u7248 ${o.version}\uFF09\u3002`}var QE,Ne,Je,XE,JU,YU,QU,XU,eq,tq,pp,tC=b(()=>{"use strict";QE=require("node:crypto"),Ne=require("node:fs"),Je=require("node:path"),XE=require("node:zlib");yr();lp();JU="godd-archive/1",YU=5*1024*1024,QU=20*1024*1024,XU=2e3,eq=/^[^\u0000-\u001f\u007f/\\:]+$/,tq=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,pp=".godd/archive.json"});var rC,sq,aq,cq,dp,nC=b(()=>{"use strict";rC=require("node:crypto"),sq=new Set(["godd-config","godd-working-record-save","godd-knowledge-projects"]),aq=new Set(["godd-knowledge-save"]),cq=["step","phase","mode"],dp=class{sessionId;saved=0;calls=[];finishing=!1;constructor(t=(0,rC.randomUUID)()){this.sessionId=t}record(t,r,n={},o=new Date){if(t==="godd-working-record-save"&&(this.finishing=!0),sq.has(t)||this.finishing&&aq.has(t))return;this.finishing=!1;let i=cq.map(s=>r[s]).filter(s=>typeof s=="string"&&s.length>0);this.calls.push({toolName:t,steps:i,...n,at:o})}recordFailure(t){t==="godd-working-record-save"&&(this.finishing=!0)}snapshot(){let t=new Map;for(let r of this.calls){let n=t.get(r.toolName)??{tool_name:r.toolName,steps:[],call_count:0};n.call_count+=1;for(let o of r.steps)n.steps.includes(o)||n.steps.push(o);r.definitionVersion!==void 0&&(n.definition_version=r.definitionVersion),r.promptVersions!==void 0&&(n.prompt_versions=r.promptVersions),t.set(r.toolName,n)}return{sessionId:this.sessionId,sequence:this.saved+1,startedAt:this.calls[0]?.at.toISOString(),tools:[...t.values()],covered:this.calls.length}}commit(t){t.sequence===this.saved+1&&(this.calls=this.calls.slice(t.covered),this.saved=t.sequence)}}});function lq(e){return!uq.has(e.kind)||e.message.includes("\u53E4\u3044\u5185\u5BB9\u3067\u306F\u7D9A\u3051\u307E\u305B\u3093")?e.message:`${e.message}
260
+ \u53E4\u3044\u914D\u4FE1\u5185\u5BB9\u3067\u306F\u51E6\u7406\u3092\u7D9A\u3051\u307E\u305B\u3093\u3002`}function oC(e,t,r){e={...e,client_version:t};let n=t==="0.0.0"?void 0:rr(t),o=r?.checkForUpdate??lc({version:t}),i="",s="",a;function c(){a??=o().then(k=>{i=k}).catch(()=>{i=""}).finally(()=>{a=void 0})}c();let u=new fl({name:"godd-mcp-server",version:t},{capabilities:{tools:{listChanged:!0},resources:{},prompts:{}}}),p={name:sg,description:ag,inputSchema:Dk(cg,{target:"jsonSchema7"})},l,d=!1,f=r?.session??new dp;function h(k,P,q){return{client:n??{version:t,channel:"unknown"},...k?{catalog_revision:k}:{},...P!==void 0?{definition_version:P}:{},...q?{prompt_versions:q}:{}}}async function g(){d||(d=!0,await u.notification({method:"notifications/tools/list_changed"}).catch(()=>{}))}async function y(k,P=!0){if(!k)return;let q=l!==void 0&&l!==k;l=k,q&&P&&await g()}async function v(k=!0){let P=await os(e,"",BE);return await y(P.revision,k),P}async function w(){try{await Z1(e.registry_url,e.license_key)}catch(k){throw up(k,e)}}async function x(k,P){if(k===sg)return{text:await I1(cg.parse(P))};if(e.components.length===0)throw new me("configuration","\u6280\u8853\u69CB\u6210\uFF08components\uFF09\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002godd init \u307E\u305F\u306F godd-config \u306E update \u3067\u69CB\u6210\u3092\u8A2D\u5B9A\u3057\u3001MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");if(!/^[a-z]{2}(-[A-Z]{2})?$/.test(e.language))throw new me("configuration","\u8A00\u8A9E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002godd-config \u3067 en\u3001ja \u306A\u3069\u306E\u8A00\u8A9E\u30B3\u30FC\u30C9\u3092\u8A2D\u5B9A\u3057\u3001MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");await w();let q=`/${encodeURIComponent(k)}`,L=await os(e,`${q}/prepare?${xy(e)}`,wy);await y(L.catalog_revision);let Ue={...L.execution?.defaults,...P};try{let qe=new Bi().getValidator(L.definition.inputSchema)(Ue);if(!qe.valid)throw new me("input",`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${qe.errorMessage??"\u5F15\u6570\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}`)}catch(Q){throw Q instanceof me?Q:new me("data","\u914D\u4FE1\u3055\u308C\u305F\u5F15\u6570\u5B9A\u7FA9\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}if(L.execution?.kind==="server"){let Q=await os(e,`${q}/execute?${xy(e)}`,wy,Ue);if(Q.result===void 0)throw new me("execution_unknown","\u5B9F\u884C\u7D50\u679C\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002\u518D\u9001\u306E\u524D\u306B\u51E6\u7406\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");return{text:typeof Q.result=="string"?Q.result:JSON.stringify(Q.result),definitionVersion:Q.definition.version,revision:Q.catalog_revision}}let we={...L,arguments:Ue};if(L.execution?.kind==="prompt"){let Q=Ue.archive_target;return{text:(L.execution.archive&&typeof Q=="string"&&Q.trim()?`${await eC(e,k,Q)}
260
261
 
261
262
  `:"")+KE(e,we),definitionVersion:L.definition.version,revision:L.catalog_revision,promptVersions:L.prompt_versions}}if(L.execution?.kind==="public_client"){let Q=qE[L.execution.handler??""];if(Q)return{text:await Q(ky(e,we,f),Ue),definitionVersion:L.definition.version,revision:L.catalog_revision,promptVersions:L.prompt_versions}}throw new me("data","\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u767B\u9332\u72B6\u614B\u3068\u672C\u4F53\u3068\u306E\u5BFE\u5FDC\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}return u.setRequestHandler(Xd,async()=>{try{let k=await v(!1);return d=!1,{_meta:h(k.revision),tools:[p,...k.tools.map(P=>({name:P.name,description:P.description,inputSchema:P.inputSchema}))]}}catch(k){let P=up(k,e);return{tools:[{...p,description:`${ag}
262
- ${P.message}`}],_meta:{delivery_error:P.kind}}}}),u.setRequestHandler(Is,async({params:k})=>{try{let P=await x(k.name,k.arguments??{});f.record(k.name,k.arguments??{},{definitionVersion:P.definitionVersion,promptVersions:P.promptVersions}),c();let q=i!==s?i:"";return s=i,{_meta:h(P.revision,P.definitionVersion,P.promptVersions),content:[{type:"text",text:P.text},...q?[{type:"text",text:q}]:[]]}}catch(P){f.recordFailure(k.name);let q=up(P,e);return["missing","input","auth","compatibility"].includes(q.kind)&&await g(),{isError:!0,content:[{type:"text",text:`${q.message}
263
- \u53E4\u3044\u914D\u4FE1\u5185\u5BB9\u3067\u306F\u51E6\u7406\u3092\u7D9A\u3051\u307E\u305B\u3093\u3002`}]}}}),u.setRequestHandler(Gd,async()=>({resources:(await v()).tools.map(k=>({uri:k.guide_uri,name:k.name,description:k.description,mimeType:"text/markdown"}))})),u.setRequestHandler(Vd,async({params:k})=>{let P=/^godd:\/\/mcp-tools\/([^/?#]+)$/.exec(k.uri);if(!P)throw new Error("Resource not found");let q=await os(e,`/${encodeURIComponent(decodeURIComponent(P[1]))}/guide`,VE),L=q.guide,Ue=[`# ${q.name}`,`\u672C\u4F53: ${t} / ${n?.channel??"unknown"}\u3001\u914D\u4FE1: ${q.version}`,L.purpose,"## \u5FC5\u8981\u306A\u3082\u306E",...L.prerequisites.map(we=>`- ${we}`),"## \u624B\u9806",...L.steps.map((we,Q)=>`${Q+1}. ${we}`),"## \u6210\u529F\u3057\u305F\u72B6\u614B",L.success,"## \u3046\u307E\u304F\u3044\u304B\u306A\u3044\u3068\u304D",...L.failures.map(we=>`### ${we.message}
263
+ ${P.message}`}],_meta:{delivery_error:P.kind}}}}),u.setRequestHandler(Is,async({params:k})=>{try{let P=await x(k.name,k.arguments??{});f.record(k.name,k.arguments??{},{definitionVersion:P.definitionVersion,promptVersions:P.promptVersions}),c();let q=i!==s?i:"";return s=i,{_meta:h(P.revision,P.definitionVersion,P.promptVersions),content:[{type:"text",text:P.text},...q?[{type:"text",text:q}]:[]]}}catch(P){f.recordFailure(k.name);let q=up(P,e);return["missing","input","auth","compatibility"].includes(q.kind)&&await g(),{isError:!0,content:[{type:"text",text:lq(q)}]}}}),u.setRequestHandler(Gd,async()=>({resources:(await v()).tools.map(k=>({uri:k.guide_uri,name:k.name,description:k.description,mimeType:"text/markdown"}))})),u.setRequestHandler(Vd,async({params:k})=>{let P=/^godd:\/\/mcp-tools\/([^/?#]+)$/.exec(k.uri);if(!P)throw new Error("Resource not found");let q=await os(e,`/${encodeURIComponent(decodeURIComponent(P[1]))}/guide`,VE),L=q.guide,Ue=[`# ${q.name}`,`\u672C\u4F53: ${t} / ${n?.channel??"unknown"}\u3001\u914D\u4FE1: ${q.version}`,L.purpose,"## \u5FC5\u8981\u306A\u3082\u306E",...L.prerequisites.map(we=>`- ${we}`),"## \u624B\u9806",...L.steps.map((we,Q)=>`${Q+1}. ${we}`),"## \u6210\u529F\u3057\u305F\u72B6\u614B",L.success,"## \u3046\u307E\u304F\u3044\u304B\u306A\u3044\u3068\u304D",...L.failures.map(we=>`### ${we.message}
264
264
  ${we.action}`),"## \u95A2\u9023\u30AC\u30A4\u30C9",...q.related_tools.map(we=>`[${we}](godd://mcp-tools/${encodeURIComponent(we)})`)].join(`
265
265
 
266
266
  `);return{_meta:h(void 0,q.version),contents:[{uri:k.uri,text:Ue,mimeType:"text/markdown"}]}}),u.setRequestHandler(Hd,async()=>({prompts:(await v()).tools.map(k=>({name:k.name,description:k.description}))})),u.setRequestHandler(Wd,async({params:k})=>{await w();let P=await os(e,`/${encodeURIComponent(k.name)}`,cp);return{_meta:h(void 0,P.version),messages:[{role:"user",content:{type:"text",text:`${P.name} \u30C4\u30FC\u30EB\u3092\u3001\u6B21\u306E\u5165\u529B\u3092\u78BA\u8A8D\u3057\u3066\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002
267
267
  ${JSON.stringify(k.arguments??{},null,2)}
268
- \u8A73\u3057\u3044\u624B\u9806\u306F ${P.guide_uri} \u304B\u3089\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}}]}}),u}var iC=b(()=>{"use strict";T1();An();dh();ig();z1();U1();FE();lp();JE();tC();ri();Np();nC()});var aC={};tr(aC,{startServer:()=>sC});function uq(){try{return __goddBundleUrl}catch{return}}async function sC(){let e=Zx();await oC(e,Nr()).connect(new hi)}var cC=b(()=>{"use strict";sf();Mn();Tf();iC();ri();mu(process.env,process.argv[1],uq())&&sC().catch(e=>{let t=e instanceof Error?e.message.replace(/((?:GODD_LICENSE_KEY|license_key)\s*[:=]\s*)[^\s,]+/gi,"$1[\u8A8D\u8A3C\u60C5\u5831]").replace(/goddt-[A-Za-z0-9_-]+|godd-[0-9a-f-]{36}/gi,"[\u8A8D\u8A3C\u60C5\u5831]").split(`
268
+ \u8A73\u3057\u3044\u624B\u9806\u306F ${P.guide_uri} \u304B\u3089\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}}]}}),u}var uq,iC=b(()=>{"use strict";T1();An();dh();ig();z1();U1();FE();lp();JE();tC();ri();Np();nC();uq=new Set(["network","unavailable","timeout","auth","missing","compatibility","data"])});var aC={};tr(aC,{startServer:()=>sC});function pq(){try{return __goddBundleUrl}catch{return}}async function sC(){let e=Zx();await oC(e,Nr()).connect(new hi)}var cC=b(()=>{"use strict";sf();Mn();Tf();iC();ri();mu(process.env,process.argv[1],pq())&&sC().catch(e=>{let t=e instanceof Error?e.message.replace(/((?:GODD_LICENSE_KEY|license_key)\s*[:=]\s*)[^\s,]+/gi,"$1[\u8A8D\u8A3C\u60C5\u5831]").replace(/goddt-[A-Za-z0-9_-]+|godd-[0-9a-f-]{36}/gi,"[\u8A8D\u8A3C\u60C5\u5831]").split(`
269
269
  `).slice(0,4).join(`
270
270
  `).slice(0,1500):"\u63A5\u7D9A\u8A2D\u5B9A\u3068\u30ED\u30B0\u30A4\u30F3\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";console.error(`GoDD \u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093\u3002${t}`),process.exitCode=1})});function fp(e,t){let r=(0,uC.join)(e,".gitignore"),n=t.map(c=>c.trim()).filter(Boolean);if(n.length===0)return!1;let o=(0,is.existsSync)(r)?(0,is.readFileSync)(r,"utf-8"):"",i=new Set(o.split(/\r?\n/).map(c=>c.trim()).filter(Boolean)),s=n.filter(c=>!i.has(c));if(s.length===0)return!1;let a=o.length===0||o.endsWith(`
271
271
  `)||o.endsWith(`\r
@@ -273,14 +273,14 @@ ${JSON.stringify(k.arguments??{},null,2)}
273
273
  `;return(0,is.writeFileSync)(r,`${a}${s.join(`
274
274
  `)}
275
275
  `,"utf-8"),!0}var is,uC,Sy=b(()=>{"use strict";is=require("node:fs"),uC=require("node:path")});function mp(e){if(!(0,hp.existsSync)(e))return{};try{let t=(0,hp.readFileSync)(e,"utf-8"),r={};for(let n of t.split(`
276
- `)){let o=n.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf("=");if(i===-1)continue;let s=o.slice(0,i).trim(),a=o.slice(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),r[s]=a}return r}catch{return{}}}var hp,$y=b(()=>{"use strict";hp=require("node:fs")});function Py(e=process.env){let t=e.GODD_GOOGLE_MCP_URL?.trim();if(!t)return gp;try{let r=new URL(t),n=["localhost","127.0.0.1","[::1]"].includes(r.hostname);return r.protocol==="https:"||r.protocol==="http:"&&n?t:null}catch{return null}}function Ey(e=process.env){let t=e.GODD_GOOGLE_MCP?.trim().toLowerCase();if(t&&lq.has(t))return{enabled:!1,reason:"disabled"};let r=Py(e);return r?{enabled:!0,url:r}:{enabled:!1,reason:"invalid-url"}}var gp,lq,Cy=b(()=>{"use strict";gp="https://google-mcp.ripla.co.jp/mcp",lq=new Set(["off","0","false","no"])});function Ry(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function fq(){let e=Ry((0,Ua.randomBytes)(32));return{verifier:e,challenge:hq(e)}}function hq(e){return Ry((0,Ua.createHash)("sha256").update(e).digest())}function mq(){return Ry((0,Ua.randomBytes)(16))}function Xr(e){let t=ot(e),r;try{r=new URL(t)}catch{throw new Ye(`Registry \u306E URL \u304C\u4E0D\u6B63\u3067\u3059: ${t}`)}if(r.protocol==="https:"||r.protocol==="http:"&&gq.has(r.hostname))return t;throw new Ye(`Registry \u306E URL \u306F https:// \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08http:// \u306F 127.0.0.1 / localhost / [::1] \u306E\u307F\uFF09: ${t}`)}function yq(e,t){let r=new URL(`${Xr(e)}/v1/auth/google/start`);return r.searchParams.set("redirect_uri",t.redirectUri),r.searchParams.set("code_challenge",t.codeChallenge),r.searchParams.set("code_challenge_method","S256"),r.searchParams.set("state",t.state),r.searchParams.set("device_name",t.deviceName),t.drive&&r.searchParams.set("drive","true"),r.toString()}function vq(e,t){if(e.get("state")!==t)return{kind:"state_mismatch"};let r=e.get("error");if(r){let o=e.get("error_description")?.trim()||_q[r]||"";return{kind:"error",error:new Ye(`Google \u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${r}\uFF09${o?`: ${o}`:""}`)}}let n=e.get("code");return n?{kind:"code",code:n}:{kind:"error",error:new Ye("\u30ED\u30B0\u30A4\u30F3\u5FDC\u7B54\u306B\u30B3\u30FC\u30C9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}}function Iy(e){return`<!doctype html><html lang="ja"><meta charset="utf-8"><title>GoDD</title><body><p>${e}</p></body></html>`}function Za(e,t,r){e.writeHead(t,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),e.end(r)}async function xq(e,t,r=Ay){let n=null,o=new Promise((l,d)=>{n={resolve:l,reject:d}});o.catch(()=>{});let i=!1,s=!1,a=l=>{i||(i=!0,l())},c,u=(0,dC.createServer)((l,d)=>{let f=new URL(l.url??"/","http://127.0.0.1");if(f.pathname!==lC){d.writeHead(404).end();return}if(l.method!=="GET"){d.writeHead(405,{Allow:"GET"}).end();return}if(i||s){Za(d,409,Ty);return}let h=vq(f.searchParams,e);if(h.kind==="state_mismatch"){Za(d,400,bq);return}if(h.kind==="error"){Za(d,400,Ty),a(()=>n?.reject(h.error));return}s=!0,clearTimeout(c),t(h.code).then(g=>{Za(d,200,wq),a(()=>n?.resolve(g))},g=>{Za(d,502,Ty),a(()=>n?.reject(g instanceof Error?g:new Error(String(g))))})});await new Promise((l,d)=>{u.once("error",d),u.listen(0,"127.0.0.1",()=>l())}),c=setTimeout(()=>{a(()=>n?.reject(new Ye(`${Math.round(r/6e4)} \u5206\u4EE5\u5185\u306B\u30ED\u30B0\u30A4\u30F3\u304C\u5B8C\u4E86\u3057\u306A\u304B\u3063\u305F\u305F\u3081\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)))},r),c.unref?.();let{port:p}=u.address();return{redirectUri:`http://127.0.0.1:${p}${lC}`,result:o,close(){clearTimeout(c),a(()=>n?.reject(new Ye("\u30ED\u30B0\u30A4\u30F3\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002"))),u.closeAllConnections?.(),u.close()}}}function fC(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:r&&typeof r=="object"&&"message"in r?String(r.message):JSON.stringify(r)}}catch{}return e.slice(0,300)}async function Sq(e,t,r,n=fetch){let o=Xr(e),i,s;try{i=await n(`${o}/v1/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,code_verifier:r}),signal:AbortSignal.timeout(pq)}),s=await i.text()}catch(u){throw new Ye(`Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\uFF08${e}\uFF09: ${u instanceof Error?u.message:String(u)}`)}if(!i.ok)throw i.status===503?new Ye("\u3053\u306E Registry \u3067\u306F Google \u30ED\u30B0\u30A4\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3059\u308B\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002"):new Ye(`\u30ED\u30B0\u30A4\u30F3\u30B3\u30FC\u30C9\u306E\u4EA4\u63DB\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${i.status}\uFF09: ${fC(s)}\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let a;try{a=JSON.parse(s)}catch{throw new Ye(`Registry API \u306E\u5FDC\u7B54\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=kq.safeParse(a);if(!c.success)throw new Ye(`Registry API \u306E\u5FDC\u7B54\u304C\u60F3\u5B9A\u3068\u7570\u306A\u308A\u307E\u3059: ${c.error.message}`);return c.data}async function zy(e,t,r=fetch){let n=await r(`${Xr(e)}/v1/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(1e4)});if(!n.ok){let o=await n.text().catch(()=>"");throw new Error(`${n.status} ${fC(o)}`.trim())}}function $q(e){let t="";try{t=new URL(e).protocol}catch{}if(t!=="https:"&&t!=="http:")return Promise.resolve(!1);let[r,n]=process.platform==="darwin"?["open",[e]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];return new Promise(o=>{try{let i=(0,pC.spawn)(r,n,{stdio:"ignore",detached:!0});i.once("error",()=>o(!1)),i.once("spawn",()=>{i.unref(),o(!0)})}catch{o(!1)}})}function Dy(e){return((e??"").trim()||"unknown device").slice(0,dq)}async function hC(e,t={}){let r=t.log??(c=>console.log(c)),n=t.openBrowser??$q,o=Xr(e.registryUrl),i=fq(),s=mq(),a=await xq(s,c=>Sq(o,c,i.verifier,t.fetch),t.timeoutMs??Ay);try{let c=yq(o,{redirectUri:a.redirectUri,codeChallenge:i.challenge,state:s,deviceName:Dy(e.deviceName),drive:e.drive});return(e.noBrowser?!1:await n(c))?(r("\u30D6\u30E9\u30A6\u30B6\u3067 Google \u30ED\u30B0\u30A4\u30F3\u306E\u753B\u9762\u3092\u958B\u304D\u307E\u3057\u305F\u3002\u30ED\u30B0\u30A4\u30F3\u3092\u5B8C\u4E86\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),r("\u30D6\u30E9\u30A6\u30B6\u304C\u958B\u304B\u306A\u3044\u5834\u5408\u306F\u3001\u6B21\u306E URL \u3092\u958B\u3044\u3066\u304F\u3060\u3055\u3044:")):r("\u6B21\u306E URL \u3092\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304D\u3001Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\u306E\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304F\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09:"),r(c),r(""),r(`\u5F85\u6A5F\u4E2D...\uFF08${Math.round((t.timeoutMs??Ay)/6e4)} \u5206\u3067\u6642\u9593\u5207\u308C\u306B\u306A\u308A\u307E\u3059\uFF09`),await a.result}finally{a.close()}}var pC,Ua,dC,Ay,pq,lC,dq,Ye,gq,_q,wq,Ty,bq,kq,yp=b(()=>{"use strict";pC=require("node:child_process"),Ua=require("node:crypto"),dC=require("node:http");tt();Ci();Ay=300*1e3,pq=15e3,lC="/callback",dq=200,Ye=class extends Error{constructor(t){super(t),this.name="LoginError"}};gq=new Set(["127.0.0.1","localhost","[::1]"]);_q={access_denied:"Google \u306E\u753B\u9762\u3067\u30ED\u30B0\u30A4\u30F3\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F\u3002",not_allowed:"\u3053\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306B\u7D10\u3065\u304F\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",suspended:"\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u505C\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",expired:"\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",account_mismatch:"\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u306F\u5225\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u7D10\u3065\u3044\u3066\u3044\u307E\u3059\u3002\u7D10\u3065\u3044\u305F\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002",google_error:"Google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"};wq=Iy("\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306B\u623B\u3063\u3066\u304F\u3060\u3055\u3044\u3002"),Ty=Iy("\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306E\u8868\u793A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),bq=Iy("\u3053\u306E\u30ED\u30B0\u30A4\u30F3\u64CD\u4F5C\u306E\u5FDC\u7B54\u3067\u306F\u306A\u3044\u305F\u3081\u7121\u8996\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u3067\u5B9F\u884C\u4E2D\u306E godd login \u306E\u753B\u9762\u304B\u3089\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002");kq=m.object({access_token:m.string().min(1),token_type:m.string().optional(),expires_at:m.string().nullable().optional().default(null),license_id:m.string().nullable().optional().default(null),email:m.string().nullable().optional().default(null),user:m.string().nullable().optional(),drive_authorized:m.boolean().optional().default(!1),drive_error:m.string().nullable().optional().default(null)})});var Ny={};tr(Ny,{formatLoginSummary:()=>xC,loginAndSave:()=>_p,parseLoginArgs:()=>_C,parseLogoutArgs:()=>vC,resolveLoginRegistryUrl:()=>qa,runLogin:()=>Pq,runLogout:()=>Eq});function _C(e){let t={drive:!1,noBrowser:!1};for(let r=0;r<e.length;r+=1){let n=e[r],[o,i]=n.includes("=")?[n.slice(0,n.indexOf("=")),n.slice(n.indexOf("=")+1)]:[n,void 0],s=()=>{if(i!==void 0)return i;let a=e[r+1];if(a===void 0||a.startsWith("--"))throw new Ye(`${o} \u306B\u306F\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002`);return r+=1,a};switch(o){case"--drive":t.drive=!0;break;case"--no-browser":t.noBrowser=!0;break;case"--device-name":t.deviceName=s();break;case"--registry-url":t.registryUrl=s();break;default:throw new Ye(`\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: ${n}
276
+ `)){let o=n.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf("=");if(i===-1)continue;let s=o.slice(0,i).trim(),a=o.slice(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),r[s]=a}return r}catch{return{}}}var hp,$y=b(()=>{"use strict";hp=require("node:fs")});function Py(e=process.env){let t=e.GODD_GOOGLE_MCP_URL?.trim();if(!t)return gp;try{let r=new URL(t),n=["localhost","127.0.0.1","[::1]"].includes(r.hostname);return r.protocol==="https:"||r.protocol==="http:"&&n?t:null}catch{return null}}function Ey(e=process.env){let t=e.GODD_GOOGLE_MCP?.trim().toLowerCase();if(t&&dq.has(t))return{enabled:!1,reason:"disabled"};let r=Py(e);return r?{enabled:!0,url:r}:{enabled:!1,reason:"invalid-url"}}var gp,dq,Cy=b(()=>{"use strict";gp="https://google-mcp.ripla.co.jp/mcp",dq=new Set(["off","0","false","no"])});function Ry(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function mq(){let e=Ry((0,Ua.randomBytes)(32));return{verifier:e,challenge:gq(e)}}function gq(e){return Ry((0,Ua.createHash)("sha256").update(e).digest())}function yq(){return Ry((0,Ua.randomBytes)(16))}function Xr(e){let t=ot(e),r;try{r=new URL(t)}catch{throw new Ye(`Registry \u306E URL \u304C\u4E0D\u6B63\u3067\u3059: ${t}`)}if(r.protocol==="https:"||r.protocol==="http:"&&_q.has(r.hostname))return t;throw new Ye(`Registry \u306E URL \u306F https:// \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08http:// \u306F 127.0.0.1 / localhost / [::1] \u306E\u307F\uFF09: ${t}`)}function vq(e,t){let r=new URL(`${Xr(e)}/v1/auth/google/start`);return r.searchParams.set("redirect_uri",t.redirectUri),r.searchParams.set("code_challenge",t.codeChallenge),r.searchParams.set("code_challenge_method","S256"),r.searchParams.set("state",t.state),r.searchParams.set("device_name",t.deviceName),t.drive&&r.searchParams.set("drive","true"),r.toString()}function bq(e,t){if(e.get("state")!==t)return{kind:"state_mismatch"};let r=e.get("error");if(r){let o=e.get("error_description")?.trim()||wq[r]||"";return{kind:"error",error:new Ye(`Google \u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${r}\uFF09${o?`: ${o}`:""}`)}}let n=e.get("code");return n?{kind:"code",code:n}:{kind:"error",error:new Ye("\u30ED\u30B0\u30A4\u30F3\u5FDC\u7B54\u306B\u30B3\u30FC\u30C9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}}function Iy(e){return`<!doctype html><html lang="ja"><meta charset="utf-8"><title>GoDD</title><body><p>${e}</p></body></html>`}function Za(e,t,r){e.writeHead(t,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),e.end(r)}async function Sq(e,t,r=Ay){let n=null,o=new Promise((l,d)=>{n={resolve:l,reject:d}});o.catch(()=>{});let i=!1,s=!1,a=l=>{i||(i=!0,l())},c,u=(0,dC.createServer)((l,d)=>{let f=new URL(l.url??"/","http://127.0.0.1");if(f.pathname!==lC){d.writeHead(404).end();return}if(l.method!=="GET"){d.writeHead(405,{Allow:"GET"}).end();return}if(i||s){Za(d,409,Ty);return}let h=bq(f.searchParams,e);if(h.kind==="state_mismatch"){Za(d,400,kq);return}if(h.kind==="error"){Za(d,400,Ty),a(()=>n?.reject(h.error));return}s=!0,clearTimeout(c),t(h.code).then(g=>{Za(d,200,xq),a(()=>n?.resolve(g))},g=>{Za(d,502,Ty),a(()=>n?.reject(g instanceof Error?g:new Error(String(g))))})});await new Promise((l,d)=>{u.once("error",d),u.listen(0,"127.0.0.1",()=>l())}),c=setTimeout(()=>{a(()=>n?.reject(new Ye(`${Math.round(r/6e4)} \u5206\u4EE5\u5185\u306B\u30ED\u30B0\u30A4\u30F3\u304C\u5B8C\u4E86\u3057\u306A\u304B\u3063\u305F\u305F\u3081\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)))},r),c.unref?.();let{port:p}=u.address();return{redirectUri:`http://127.0.0.1:${p}${lC}`,result:o,close(){clearTimeout(c),a(()=>n?.reject(new Ye("\u30ED\u30B0\u30A4\u30F3\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002"))),u.closeAllConnections?.(),u.close()}}}function fC(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:r&&typeof r=="object"&&"message"in r?String(r.message):JSON.stringify(r)}}catch{}return e.slice(0,300)}async function Pq(e,t,r,n=fetch){let o=Xr(e),i,s;try{i=await n(`${o}/v1/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,code_verifier:r}),signal:AbortSignal.timeout(fq)}),s=await i.text()}catch(u){throw new Ye(`Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\uFF08${e}\uFF09: ${u instanceof Error?u.message:String(u)}`)}if(!i.ok)throw i.status===503?new Ye("\u3053\u306E Registry \u3067\u306F Google \u30ED\u30B0\u30A4\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3059\u308B\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002"):new Ye(`\u30ED\u30B0\u30A4\u30F3\u30B3\u30FC\u30C9\u306E\u4EA4\u63DB\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${i.status}\uFF09: ${fC(s)}\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let a;try{a=JSON.parse(s)}catch{throw new Ye(`Registry API \u306E\u5FDC\u7B54\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=$q.safeParse(a);if(!c.success)throw new Ye(`Registry API \u306E\u5FDC\u7B54\u304C\u60F3\u5B9A\u3068\u7570\u306A\u308A\u307E\u3059: ${c.error.message}`);return c.data}async function zy(e,t,r=fetch){let n=await r(`${Xr(e)}/v1/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(1e4)});if(!n.ok){let o=await n.text().catch(()=>"");throw new Error(`${n.status} ${fC(o)}`.trim())}}function Eq(e){let t="";try{t=new URL(e).protocol}catch{}if(t!=="https:"&&t!=="http:")return Promise.resolve(!1);let[r,n]=process.platform==="darwin"?["open",[e]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];return new Promise(o=>{try{let i=(0,pC.spawn)(r,n,{stdio:"ignore",detached:!0});i.once("error",()=>o(!1)),i.once("spawn",()=>{i.unref(),o(!0)})}catch{o(!1)}})}function Dy(e){return((e??"").trim()||"unknown device").slice(0,hq)}async function hC(e,t={}){let r=t.log??(c=>console.log(c)),n=t.openBrowser??Eq,o=Xr(e.registryUrl),i=mq(),s=yq(),a=await Sq(s,c=>Pq(o,c,i.verifier,t.fetch),t.timeoutMs??Ay);try{let c=vq(o,{redirectUri:a.redirectUri,codeChallenge:i.challenge,state:s,deviceName:Dy(e.deviceName),drive:e.drive});return(e.noBrowser?!1:await n(c))?(r("\u30D6\u30E9\u30A6\u30B6\u3067 Google \u30ED\u30B0\u30A4\u30F3\u306E\u753B\u9762\u3092\u958B\u304D\u307E\u3057\u305F\u3002\u30ED\u30B0\u30A4\u30F3\u3092\u5B8C\u4E86\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),r("\u30D6\u30E9\u30A6\u30B6\u304C\u958B\u304B\u306A\u3044\u5834\u5408\u306F\u3001\u6B21\u306E URL \u3092\u958B\u3044\u3066\u304F\u3060\u3055\u3044:")):r("\u6B21\u306E URL \u3092\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304D\u3001Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\u306E\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304F\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09:"),r(c),r(""),r(`\u5F85\u6A5F\u4E2D...\uFF08${Math.round((t.timeoutMs??Ay)/6e4)} \u5206\u3067\u6642\u9593\u5207\u308C\u306B\u306A\u308A\u307E\u3059\uFF09`),await a.result}finally{a.close()}}var pC,Ua,dC,Ay,fq,lC,hq,Ye,_q,wq,xq,Ty,kq,$q,yp=b(()=>{"use strict";pC=require("node:child_process"),Ua=require("node:crypto"),dC=require("node:http");tt();Ci();Ay=300*1e3,fq=15e3,lC="/callback",hq=200,Ye=class extends Error{constructor(t){super(t),this.name="LoginError"}};_q=new Set(["127.0.0.1","localhost","[::1]"]);wq={access_denied:"Google \u306E\u753B\u9762\u3067\u30ED\u30B0\u30A4\u30F3\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F\u3002",not_allowed:"\u3053\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306B\u7D10\u3065\u304F\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",suspended:"\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u505C\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",expired:"\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",account_mismatch:"\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u306F\u5225\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u7D10\u3065\u3044\u3066\u3044\u307E\u3059\u3002\u7D10\u3065\u3044\u305F\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002",google_error:"Google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"};xq=Iy("\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306B\u623B\u3063\u3066\u304F\u3060\u3055\u3044\u3002"),Ty=Iy("\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306E\u8868\u793A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),kq=Iy("\u3053\u306E\u30ED\u30B0\u30A4\u30F3\u64CD\u4F5C\u306E\u5FDC\u7B54\u3067\u306F\u306A\u3044\u305F\u3081\u7121\u8996\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u3067\u5B9F\u884C\u4E2D\u306E godd login \u306E\u753B\u9762\u304B\u3089\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002");$q=m.object({access_token:m.string().min(1),token_type:m.string().optional(),expires_at:m.string().nullable().optional().default(null),license_id:m.string().nullable().optional().default(null),email:m.string().nullable().optional().default(null),user:m.string().nullable().optional(),drive_authorized:m.boolean().optional().default(!1),drive_error:m.string().nullable().optional().default(null)})});var Ny={};tr(Ny,{formatLoginSummary:()=>xC,loginAndSave:()=>_p,parseLoginArgs:()=>_C,parseLogoutArgs:()=>vC,resolveLoginRegistryUrl:()=>qa,runLogin:()=>Cq,runLogout:()=>Tq});function _C(e){let t={drive:!1,noBrowser:!1};for(let r=0;r<e.length;r+=1){let n=e[r],[o,i]=n.includes("=")?[n.slice(0,n.indexOf("=")),n.slice(n.indexOf("=")+1)]:[n,void 0],s=()=>{if(i!==void 0)return i;let a=e[r+1];if(a===void 0||a.startsWith("--"))throw new Ye(`${o} \u306B\u306F\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002`);return r+=1,a};switch(o){case"--drive":t.drive=!0;break;case"--no-browser":t.noBrowser=!0;break;case"--device-name":t.deviceName=s();break;case"--registry-url":t.registryUrl=s();break;default:throw new Ye(`\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: ${n}
277
277
  \u4F7F\u3044\u65B9: godd login [--drive] [--device-name <\u540D\u524D>] [--no-browser] [--registry-url <url>]`)}}return t}function vC(e){let t="\u4F7F\u3044\u65B9: godd logout [--registry-url <url>]",r={};for(let n=0;n<e.length;n+=1){let o=e[n];if(o==="--registry-url"||o.startsWith("--registry-url=")){let i=o.includes("=")?o.slice(o.indexOf("=")+1):e[n+1];if(i===void 0||i.startsWith("--"))throw new Ye(`--registry-url \u306B\u306F\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002
278
278
  ${t}`);o.includes("=")||(n+=1),r.registryUrl=i;continue}throw new Ye(`\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: ${o}
279
- ${t}`)}return r}function qa(e,t={}){let r=t.env??process.env,n=mp((0,yC.join)(t.cwd??process.cwd(),".env")).GODD_REGISTRY_URL,o=t.savedRegistries??[],i=e?.trim()||r.GODD_REGISTRY_URL?.trim()||n?.trim()||(o.length===1?o[0]:void 0)||dn;return Xr(i)}function wC(e){let t=new Map;for(let r of e){let n=[];try{n=pn([r])}catch{}for(let o of n){let i=ot(o.registry_url);t.has(i)||t.set(i,o)}}return[...t.values()]}function bC(e,t){for(let r of t)try{let n=Do(e,[r]);if(n)return n}catch{}return null}function Oy(e){return e.credentialsPath?[e.credentialsPath]:kr(e.env)}async function _p(e,t={}){let r=t.log??(u=>console.log(u)),n=t.credentialsPath??jn(t.env),o=Xr(e.registryUrl),i=bC(o,Oy(t)),s=Dy(e.deviceName??(t.defaultDeviceName??gC.hostname)()),a=await hC({registryUrl:o,deviceName:s,drive:e.drive,noBrowser:e.noBrowser},t),c={registry_url:o,access_token:a.access_token,expires_at:a.expires_at,email:a.email,license_id:a.license_id,device_name:s,drive_authorized:a.drive_authorized,saved_at:(t.now??(()=>new Date))().toISOString()};if(Lx(c,n),i&&i.credentials.access_token!==c.access_token){if(i.path!==n)try{Ef(o,i.path)}catch{}await zy(o,i.credentials.access_token,t.fetch).catch(()=>{r(" \uFF08\u524D\u56DE\u306E\u7AEF\u672B\u30C8\u30FC\u30AF\u30F3\u306E\u5931\u52B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u671F\u9650\u304C\u6765\u308B\u304B\u7BA1\u7406\u753B\u9762\u3067\u5931\u52B9\u3055\u308C\u308B\u307E\u3067\u6709\u52B9\u3067\u3059\uFF09")})}return{credentials:c,driveError:a.drive_error}}function xC(e,t,r,n=null){let o=[`\u2713 \u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F: ${e.email??"\uFF08\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E\uFF09"}`,` \u30E9\u30A4\u30BB\u30F3\u30B9: ${e.license_id??"\uFF08\u4E0D\u660E\uFF09"}`,` \u7AEF\u672B\u540D: ${e.device_name}`,` \u6709\u52B9\u671F\u9650: ${e.expires_at??"\u306A\u3057\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u671F\u9650\u306B\u5F93\u3044\u307E\u3059\uFF09"}`,` Registry: ${e.registry_url}`,` \u4FDD\u5B58\u5148: ${t}`];return e.drive_authorized?o.push(" Drive: \u672C\u4EBA\u306E\u6A29\u9650\u3067\u306E\u8AAD\u307F\u53D6\u308A\u3092\u8A31\u53EF\u3057\u307E\u3057\u305F\uFF08Google \u306E\u540C\u610F\u753B\u9762\u304C\u30C6\u30B9\u30C8\u4E2D\u306E\u9593\u306F 7 \u65E5\u3067\u30ED\u30B0\u30A4\u30F3\u304C\u5207\u308C\u307E\u3059\u3002\u5207\u308C\u305F\u3089 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF09"):n==="not_granted"?o.push(" \u26A0 Drive \u306E\u8AAD\u307F\u53D6\u308A\u304C\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u540C\u610F\u753B\u9762\u3067 Google \u30C9\u30E9\u30A4\u30D6\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5165\u308C\u3066 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"):n==="not_configured"?o.push(" \u26A0 Registry \u5074\u3067 Drive \u306E\u8A31\u53EF\u3092\u4FDD\u5B58\u3059\u308B\u8A2D\u5B9A\u304C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3084\u308A\u76F4\u3057\u3066\u3082\u76F4\u308A\u307E\u305B\u3093\uFF09\u3002"):r&&o.push(" \u26A0 Drive \u306E\u8AAD\u307F\u53D6\u308A\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002Google \u306E\u753B\u9762\u3067 Drive \u3078\u306E\u30A2\u30AF\u30BB\u30B9\u3092\u8A31\u53EF\u3057\u3066 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),o.push(""),o.push("\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u8A2D\u5B9A\u3057\u3066\u3044\u306A\u3044\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u3001\u3053\u306E\u30ED\u30B0\u30A4\u30F3\u304C\u4F7F\u308F\u308C\u307E\u3059\u3002"),o.push("IDE / Claude Code / Codex \u306E MCP \u30B5\u30FC\u30D0\u30FC\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u518D\u8D77\u52D5\u3059\u308B\u307E\u3067\u306F\u524D\u306E\u30ED\u30B0\u30A4\u30F3\u306E\u307E\u307E\u3067\u3059\uFF09\u3002"),o}async function Pq(e,t={}){let r=t.log??(o=>console.log(o)),n=t.credentialsPath??jn(t.env);try{let o=_C(e),i=wC(Oy(t)).map(u=>u.registry_url),s=qa(o.registryUrl,{env:t.env,cwd:t.cwd,savedRegistries:i});r(`GoDD \u306B Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\uFF08Registry: ${s}\uFF09`),o.drive&&r("Drive \u306E\u8AAD\u307F\u53D6\u308A\uFF08\u672C\u4EBA\u306E\u6A29\u9650\uFF09\u3082\u8A31\u53EF\u3092\u6C42\u3081\u307E\u3059\u3002");let{credentials:a,driveError:c}=await _p({...o,registryUrl:s},{...t,credentialsPath:n});for(let u of xC(a,n,o.drive,c))r(u)}catch(o){console.error(`\u30A8\u30E9\u30FC: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1}}async function Eq(e,t={}){let r=t.log??(c=>console.log(c)),n=Oy(t),o,i;try{let c=vC(e);i=wC(n),o=c.registryUrl?ot(c.registryUrl):i.length===1?ot(i[0].registry_url):qa(void 0,{env:t.env,cwd:t.cwd})}catch(c){console.error(`\u30A8\u30E9\u30FC: ${c instanceof Error?c.message:String(c)}`),process.exitCode=1;return}let s=bC(o,n);if(s)try{await zy(o,s.credentials.access_token,t.fetch),r("\u2713 Registry \u3067\u3053\u306E\u7AEF\u672B\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u5931\u52B9\u3057\u307E\u3057\u305F")}catch(c){r(`\u26A0 Registry \u3067\u306E\u5931\u52B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${c instanceof Error?c.message:String(c)}\uFF09\u3002\u30ED\u30FC\u30AB\u30EB\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306F\u524A\u9664\u3057\u307E\u3059\u3002\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u753B\u9762\u3067\u7AEF\u672B\u30C8\u30FC\u30AF\u30F3\u3092\u5931\u52B9\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}let a=!1;for(let c of n)try{Ef(o,c)&&(a=!0,r(`\u2713 \u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u3092\u524A\u9664\u3057\u307E\u3057\u305F\uFF08Registry: ${o}\uFF09: ${c}`))}catch{(0,mC.rmSync)(c,{force:!0}),a=!0,r(`\u2713 \u8AAD\u307F\u8FBC\u3081\u306A\u3044\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664\u3057\u307E\u3057\u305F: ${c}`)}if(!a){r(`\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u307E\u305B\u3093\uFF08Registry: ${o} \u306E\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002`);let c=i.filter(u=>ot(u.registry_url)!==o);c.length>0&&r(` \u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3: ${c.map(u=>u.registry_url).join(", ")}\uFF08godd logout --registry-url <url> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`)}}var mC,gC,yC,Fa=b(()=>{"use strict";mC=require("node:fs"),gC=require("node:os"),yC=require("node:path");Ci();yp();Mn();$y()});var dT={};tr(dT,{BUILTIN_COMPONENTS:()=>jy,CATEGORY_LABELS:()=>My,DEFAULT_GOOGLE_MCP_URL:()=>gp,GOOGLE_ACCESS_TIMEOUT_MS:()=>JC,GOOGLE_MCP_SERVER_NAME:()=>jt,buildAgentBrowserMcpServerEntry:()=>WC,buildGoddMcpEnv:()=>lT,buildGoogleMcpServerEntry:()=>QC,buildHeadroomMcpServerEntry:()=>VC,buildLicenseKeyPrompt:()=>aT,buildMcpServerEntry:()=>Ly,buildMcpTargets:()=>oT,buildProjectUrlPrompt:()=>RC,buildTypeUiMcpServerEntry:()=>KC,ensureInitGitignoreEntries:()=>DC,fetchGoogleAccess:()=>YC,findSavedLogin:()=>cT,formatGoogleMcpMessage:()=>tT,getCategoryShortLabel:()=>LC,getHeadroomInstallNote:()=>HC,getProjectUrlDefaultMessage:()=>zC,groupByCategory:()=>MC,isGoogleRelayServerEntry:()=>XC,loadExistingConfigSafe:()=>UC,mergeMcpServers:()=>rT,resolveGoogleMcp:()=>eT,resolveGoogleMcpSettings:()=>Ey,resolveInitAuthChoice:()=>sT,resolveInitDeviceLogin:()=>uT,resolveProjectUrl:()=>IC,runInit:()=>pT,toClaudeCodeMcpServers:()=>nT,writeCodexMcpConfigFile:()=>jC,writeEnvFile:()=>GC,writeGoddDevCommandFiles:()=>OC,writeGoddDevSkillFile:()=>NC,writeMcpJsonFile:()=>iT});function Dr(e){return new Promise(t=>{AC.question(e,r=>t(r.trim()))})}function RC(e,t){return`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8URL\uFF08GoDD Admin Console \u3068\u9023\u643A\u3057\u3066\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u53D6\u5F97\u3059\u308B Registry API \u306E\u63A5\u7D9A\u5148\u3002Enter \u3067${t?"\u65E2\u5B58\u5024\u3092\u4FDD\u6301":"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u3092\u4F7F\u7528"}: ${e}\uFF09: `}function IC(e,t){let r=e.trim();return r?{url:Xr(r),usedDefault:!1}:{url:Xr(t),usedDefault:!0}}function zC(e,t){return` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8URL\u306F${t?"\u65E2\u5B58\u306E\u8A2D\u5B9A\u5024":"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024"}\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e}`}function DC(e){return fp(e,Cq)}function OC(e){let t=[];for(let r of Rq){let n=(0,fe.join)(e,r);(!(0,_e.existsSync)(n)||(0,_e.readFileSync)(n,"utf-8").includes(CC))&&((0,_e.mkdirSync)((0,fe.dirname)(n),{recursive:!0}),(0,_e.writeFileSync)(n,Tq,"utf-8"),t.push(n))}return t}function NC(e){let t=(0,fe.join)(e,".agents","skills","godd-dev","SKILL.md");if(!(0,_e.existsSync)(t)||(0,_e.readFileSync)(t,"utf-8").includes(TC))return(0,_e.mkdirSync)((0,fe.dirname)(t),{recursive:!0}),(0,_e.writeFileSync)(t,Aq,"utf-8"),t}function jC(e,t,r){let n=(0,fe.join)(e,".codex","config.toml");if(!(!(0,_e.existsSync)(n)||(0,_e.readFileSync)(n,"utf-8").includes(kC)))return;let i=Ly(t,r),s=typeof i.command=="string"?i.command:"godd",a=Array.isArray(i.args)?i.args.filter(p=>typeof p=="string"):["server"],c=i.env&&typeof i.env=="object"?i.env:{},u=[kC,"GODD_LICENSE_KEY"in c?"# This file contains the license key; keep it out of version control.":"# The license is read from the `godd login` credentials (no key in this file).","","[mcp_servers.godd]",`command = ${JSON.stringify(s)}`,`args = [${a.map(p=>JSON.stringify(p)).join(", ")}]`,"","[mcp_servers.godd.env]",...Object.entries(c).map(([p,l])=>`${p} = ${JSON.stringify(String(l))}`),""];return(0,_e.mkdirSync)((0,fe.dirname)(n),{recursive:!0}),(0,_e.writeFileSync)(n,u.join(`
280
- `),"utf-8"),n}function MC(e){let t=new Map;for(let n of e){let o=zq[n.name]??n.category,i=t.get(o)??[];i.push(n),t.set(o,i)}return["language","frontend-ui","frontend-css","frontend-build","frontend","backend-api","backend-orm","backend-task","backend","runtime","database","infra","architecture"].filter(n=>t.has(n)).map(n=>({category:n,components:t.get(n)}))}function LC(e){return(My[e]??e).replace(/([^)]*)$/,"")}function Dq(e,t){let r=Iq[e];return r===void 0||r.length===0?!0:r.some(n=>t.has(n))}function Oq(){return!!process.pkg}async function Nq(e,t){try{let r=await fetch(`${e}/v1/components`,{headers:{Authorization:`Bearer ${t}`}});return r.ok?await r.json():null}catch{return null}}function ZC(e){return e.length<=8?"****":`${e.slice(0,4)}****${e.slice(-4)}`}function UC(e){let t=(0,fe.join)((0,fe.dirname)(e),".env"),r=mp(t),n={};if((0,_e.existsSync)(e))try{let c=(0,_e.readFileSync)(e,"utf-8"),u=br.load(c);u&&typeof u=="object"&&(n=u)}catch{}if(Object.keys(n).length===0&&Object.keys(r).length===0)return null;let o={},i=r.GODD_LICENSE_KEY??(typeof n.license_key=="string"?n.license_key:void 0);i&&(o.license_key=i);let s=r.GODD_LANGUAGE??(typeof n.language=="string"?n.language:void 0);s&&(o.language=s);let a=r.GODD_REGISTRY_URL??(typeof n.registry_url=="string"?n.registry_url:void 0);return a&&(o.registry_url=a),Array.isArray(n.components)&&n.components.every(c=>typeof c=="string")&&(o.components=n.components),typeof n.stack_profile=="string"&&(o.stack_profile=n.stack_profile),o}function jq(e){return["# GoDD MCP Server Configuration","# Generated by godd-init","","# \u6280\u8853\u30B9\u30BF\u30C3\u30AF\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8","components:",...e.map(r=>` - ${r}`),""].join(`
279
+ ${t}`)}return r}function qa(e,t={}){let r=t.env??process.env,n=mp((0,yC.join)(t.cwd??process.cwd(),".env")).GODD_REGISTRY_URL,o=t.savedRegistries??[],i=e?.trim()||r.GODD_REGISTRY_URL?.trim()||n?.trim()||(o.length===1?o[0]:void 0)||dn;return Xr(i)}function wC(e){let t=new Map;for(let r of e){let n=[];try{n=pn([r])}catch{}for(let o of n){let i=ot(o.registry_url);t.has(i)||t.set(i,o)}}return[...t.values()]}function bC(e,t){for(let r of t)try{let n=Do(e,[r]);if(n)return n}catch{}return null}function Oy(e){return e.credentialsPath?[e.credentialsPath]:kr(e.env)}async function _p(e,t={}){let r=t.log??(u=>console.log(u)),n=t.credentialsPath??jn(t.env),o=Xr(e.registryUrl),i=bC(o,Oy(t)),s=Dy(e.deviceName??(t.defaultDeviceName??gC.hostname)()),a=await hC({registryUrl:o,deviceName:s,drive:e.drive,noBrowser:e.noBrowser},t),c={registry_url:o,access_token:a.access_token,expires_at:a.expires_at,email:a.email,license_id:a.license_id,device_name:s,drive_authorized:a.drive_authorized,saved_at:(t.now??(()=>new Date))().toISOString()};if(Lx(c,n),i&&i.credentials.access_token!==c.access_token){if(i.path!==n)try{Ef(o,i.path)}catch{}await zy(o,i.credentials.access_token,t.fetch).catch(()=>{r(" \uFF08\u524D\u56DE\u306E\u7AEF\u672B\u30C8\u30FC\u30AF\u30F3\u306E\u5931\u52B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u671F\u9650\u304C\u6765\u308B\u304B\u7BA1\u7406\u753B\u9762\u3067\u5931\u52B9\u3055\u308C\u308B\u307E\u3067\u6709\u52B9\u3067\u3059\uFF09")})}return{credentials:c,driveError:a.drive_error}}function xC(e,t,r,n=null){let o=[`\u2713 \u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F: ${e.email??"\uFF08\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E\uFF09"}`,` \u30E9\u30A4\u30BB\u30F3\u30B9: ${e.license_id??"\uFF08\u4E0D\u660E\uFF09"}`,` \u7AEF\u672B\u540D: ${e.device_name}`,` \u6709\u52B9\u671F\u9650: ${e.expires_at??"\u306A\u3057\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u671F\u9650\u306B\u5F93\u3044\u307E\u3059\uFF09"}`,` Registry: ${e.registry_url}`,` \u4FDD\u5B58\u5148: ${t}`];return e.drive_authorized?o.push(" Drive: \u672C\u4EBA\u306E\u6A29\u9650\u3067\u306E\u8AAD\u307F\u53D6\u308A\u3092\u8A31\u53EF\u3057\u307E\u3057\u305F\uFF08Google \u306E\u540C\u610F\u753B\u9762\u304C\u30C6\u30B9\u30C8\u4E2D\u306E\u9593\u306F 7 \u65E5\u3067\u30ED\u30B0\u30A4\u30F3\u304C\u5207\u308C\u307E\u3059\u3002\u5207\u308C\u305F\u3089 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF09"):n==="not_granted"?o.push(" \u26A0 Drive \u306E\u8AAD\u307F\u53D6\u308A\u304C\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u540C\u610F\u753B\u9762\u3067 Google \u30C9\u30E9\u30A4\u30D6\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5165\u308C\u3066 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"):n==="not_configured"?o.push(" \u26A0 Registry \u5074\u3067 Drive \u306E\u8A31\u53EF\u3092\u4FDD\u5B58\u3059\u308B\u8A2D\u5B9A\u304C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3084\u308A\u76F4\u3057\u3066\u3082\u76F4\u308A\u307E\u305B\u3093\uFF09\u3002"):r&&o.push(" \u26A0 Drive \u306E\u8AAD\u307F\u53D6\u308A\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002Google \u306E\u753B\u9762\u3067 Drive \u3078\u306E\u30A2\u30AF\u30BB\u30B9\u3092\u8A31\u53EF\u3057\u3066 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),o.push(""),o.push("\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u8A2D\u5B9A\u3057\u3066\u3044\u306A\u3044\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u3001\u3053\u306E\u30ED\u30B0\u30A4\u30F3\u304C\u4F7F\u308F\u308C\u307E\u3059\u3002"),o.push("IDE / Claude Code / Codex \u306E MCP \u30B5\u30FC\u30D0\u30FC\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u518D\u8D77\u52D5\u3059\u308B\u307E\u3067\u306F\u524D\u306E\u30ED\u30B0\u30A4\u30F3\u306E\u307E\u307E\u3067\u3059\uFF09\u3002"),o}async function Cq(e,t={}){let r=t.log??(o=>console.log(o)),n=t.credentialsPath??jn(t.env);try{let o=_C(e),i=wC(Oy(t)).map(u=>u.registry_url),s=qa(o.registryUrl,{env:t.env,cwd:t.cwd,savedRegistries:i});r(`GoDD \u306B Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\uFF08Registry: ${s}\uFF09`),o.drive&&r("Drive \u306E\u8AAD\u307F\u53D6\u308A\uFF08\u672C\u4EBA\u306E\u6A29\u9650\uFF09\u3082\u8A31\u53EF\u3092\u6C42\u3081\u307E\u3059\u3002");let{credentials:a,driveError:c}=await _p({...o,registryUrl:s},{...t,credentialsPath:n});for(let u of xC(a,n,o.drive,c))r(u)}catch(o){console.error(`\u30A8\u30E9\u30FC: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1}}async function Tq(e,t={}){let r=t.log??(c=>console.log(c)),n=Oy(t),o,i;try{let c=vC(e);i=wC(n),o=c.registryUrl?ot(c.registryUrl):i.length===1?ot(i[0].registry_url):qa(void 0,{env:t.env,cwd:t.cwd})}catch(c){console.error(`\u30A8\u30E9\u30FC: ${c instanceof Error?c.message:String(c)}`),process.exitCode=1;return}let s=bC(o,n);if(s)try{await zy(o,s.credentials.access_token,t.fetch),r("\u2713 Registry \u3067\u3053\u306E\u7AEF\u672B\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u5931\u52B9\u3057\u307E\u3057\u305F")}catch(c){r(`\u26A0 Registry \u3067\u306E\u5931\u52B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${c instanceof Error?c.message:String(c)}\uFF09\u3002\u30ED\u30FC\u30AB\u30EB\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306F\u524A\u9664\u3057\u307E\u3059\u3002\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u753B\u9762\u3067\u7AEF\u672B\u30C8\u30FC\u30AF\u30F3\u3092\u5931\u52B9\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}let a=!1;for(let c of n)try{Ef(o,c)&&(a=!0,r(`\u2713 \u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u3092\u524A\u9664\u3057\u307E\u3057\u305F\uFF08Registry: ${o}\uFF09: ${c}`))}catch{(0,mC.rmSync)(c,{force:!0}),a=!0,r(`\u2713 \u8AAD\u307F\u8FBC\u3081\u306A\u3044\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664\u3057\u307E\u3057\u305F: ${c}`)}if(!a){r(`\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u307E\u305B\u3093\uFF08Registry: ${o} \u306E\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002`);let c=i.filter(u=>ot(u.registry_url)!==o);c.length>0&&r(` \u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3: ${c.map(u=>u.registry_url).join(", ")}\uFF08godd logout --registry-url <url> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`)}}var mC,gC,yC,Fa=b(()=>{"use strict";mC=require("node:fs"),gC=require("node:os"),yC=require("node:path");Ci();yp();Mn();$y()});var dT={};tr(dT,{BUILTIN_COMPONENTS:()=>jy,CATEGORY_LABELS:()=>My,DEFAULT_GOOGLE_MCP_URL:()=>gp,GOOGLE_ACCESS_TIMEOUT_MS:()=>JC,GOOGLE_MCP_SERVER_NAME:()=>jt,buildAgentBrowserMcpServerEntry:()=>WC,buildGoddMcpEnv:()=>lT,buildGoogleMcpServerEntry:()=>QC,buildHeadroomMcpServerEntry:()=>VC,buildLicenseKeyPrompt:()=>aT,buildMcpServerEntry:()=>Ly,buildMcpTargets:()=>oT,buildProjectUrlPrompt:()=>RC,buildTypeUiMcpServerEntry:()=>KC,ensureInitGitignoreEntries:()=>DC,fetchGoogleAccess:()=>YC,findSavedLogin:()=>cT,formatGoogleMcpMessage:()=>tT,getCategoryShortLabel:()=>LC,getHeadroomInstallNote:()=>HC,getProjectUrlDefaultMessage:()=>zC,groupByCategory:()=>MC,isGoogleRelayServerEntry:()=>XC,loadExistingConfigSafe:()=>UC,mergeMcpServers:()=>rT,resolveGoogleMcp:()=>eT,resolveGoogleMcpSettings:()=>Ey,resolveInitAuthChoice:()=>sT,resolveInitDeviceLogin:()=>uT,resolveProjectUrl:()=>IC,runInit:()=>pT,toClaudeCodeMcpServers:()=>nT,writeCodexMcpConfigFile:()=>jC,writeEnvFile:()=>GC,writeGoddDevCommandFiles:()=>OC,writeGoddDevSkillFile:()=>NC,writeMcpJsonFile:()=>iT});function Dr(e){return new Promise(t=>{AC.question(e,r=>t(r.trim()))})}function RC(e,t){return`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8URL\uFF08GoDD Admin Console \u3068\u9023\u643A\u3057\u3066\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u53D6\u5F97\u3059\u308B Registry API \u306E\u63A5\u7D9A\u5148\u3002Enter \u3067${t?"\u65E2\u5B58\u5024\u3092\u4FDD\u6301":"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u3092\u4F7F\u7528"}: ${e}\uFF09: `}function IC(e,t){let r=e.trim();return r?{url:Xr(r),usedDefault:!1}:{url:Xr(t),usedDefault:!0}}function zC(e,t){return` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8URL\u306F${t?"\u65E2\u5B58\u306E\u8A2D\u5B9A\u5024":"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024"}\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e}`}function DC(e){return fp(e,Aq)}function OC(e){let t=[];for(let r of zq){let n=(0,fe.join)(e,r);(!(0,_e.existsSync)(n)||(0,_e.readFileSync)(n,"utf-8").includes(CC))&&((0,_e.mkdirSync)((0,fe.dirname)(n),{recursive:!0}),(0,_e.writeFileSync)(n,Rq,"utf-8"),t.push(n))}return t}function NC(e){let t=(0,fe.join)(e,".agents","skills","godd-dev","SKILL.md");if(!(0,_e.existsSync)(t)||(0,_e.readFileSync)(t,"utf-8").includes(TC))return(0,_e.mkdirSync)((0,fe.dirname)(t),{recursive:!0}),(0,_e.writeFileSync)(t,Iq,"utf-8"),t}function jC(e,t,r){let n=(0,fe.join)(e,".codex","config.toml");if(!(!(0,_e.existsSync)(n)||(0,_e.readFileSync)(n,"utf-8").includes(kC)))return;let i=Ly(t,r),s=typeof i.command=="string"?i.command:"godd",a=Array.isArray(i.args)?i.args.filter(p=>typeof p=="string"):["server"],c=i.env&&typeof i.env=="object"?i.env:{},u=[kC,"GODD_LICENSE_KEY"in c?"# This file contains the license key; keep it out of version control.":"# The license is read from the `godd login` credentials (no key in this file).","","[mcp_servers.godd]",`command = ${JSON.stringify(s)}`,`args = [${a.map(p=>JSON.stringify(p)).join(", ")}]`,"","[mcp_servers.godd.env]",...Object.entries(c).map(([p,l])=>`${p} = ${JSON.stringify(String(l))}`),""];return(0,_e.mkdirSync)((0,fe.dirname)(n),{recursive:!0}),(0,_e.writeFileSync)(n,u.join(`
280
+ `),"utf-8"),n}function MC(e){let t=new Map;for(let n of e){let o=Oq[n.name]??n.category,i=t.get(o)??[];i.push(n),t.set(o,i)}return["language","frontend-ui","frontend-css","frontend-build","frontend","backend-api","backend-orm","backend-task","backend","runtime","database","infra","architecture"].filter(n=>t.has(n)).map(n=>({category:n,components:t.get(n)}))}function LC(e){return(My[e]??e).replace(/([^)]*)$/,"")}function Nq(e,t){let r=Dq[e];return r===void 0||r.length===0?!0:r.some(n=>t.has(n))}function jq(){return!!process.pkg}async function Mq(e,t){try{let r=await fetch(`${e}/v1/components`,{headers:{Authorization:`Bearer ${t}`}});return r.ok?await r.json():null}catch{return null}}function ZC(e){return e.length<=8?"****":`${e.slice(0,4)}****${e.slice(-4)}`}function UC(e){let t=(0,fe.join)((0,fe.dirname)(e),".env"),r=mp(t),n={};if((0,_e.existsSync)(e))try{let c=(0,_e.readFileSync)(e,"utf-8"),u=br.load(c);u&&typeof u=="object"&&(n=u)}catch{}if(Object.keys(n).length===0&&Object.keys(r).length===0)return null;let o={},i=r.GODD_LICENSE_KEY??(typeof n.license_key=="string"?n.license_key:void 0);i&&(o.license_key=i);let s=r.GODD_LANGUAGE??(typeof n.language=="string"?n.language:void 0);s&&(o.language=s);let a=r.GODD_REGISTRY_URL??(typeof n.registry_url=="string"?n.registry_url:void 0);return a&&(o.registry_url=a),Array.isArray(n.components)&&n.components.every(c=>typeof c=="string")&&(o.components=n.components),typeof n.stack_profile=="string"&&(o.stack_profile=n.stack_profile),o}function Lq(e){return["# GoDD MCP Server Configuration","# Generated by godd-init","","# \u6280\u8853\u30B9\u30BF\u30C3\u30AF\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8","components:",...e.map(r=>` - ${r}`),""].join(`
281
281
  `)}function GC(e,t,r,n){let o=new Set(["GODD_LICENSE_KEY","GODD_LANGUAGE","GODD_REGISTRY_URL"]),i=[];if((0,_e.existsSync)(e)){let c=(0,_e.readFileSync)(e,"utf-8");for(let u of c.split(`
282
- `)){let p=u.trim();if(Mq.has(p))continue;let l=p.indexOf("="),d=l>0?p.slice(0,l).trim():"";o.has(d)||i.push(u)}for(;i.length>0&&i[i.length-1].trim()==="";)i.pop()}let s=["",qC,t!==null?`GODD_LICENSE_KEY="${t}"`:FC,`GODD_LANGUAGE="${r}"`,`GODD_REGISTRY_URL="${n}"`,""],a=[...i,...s].join(`
283
- `);(0,_e.writeFileSync)(e,a,"utf-8")}function BC(){if(Oq())return{command:"godd",args:[]};let e;try{e=(0,PC.fileURLToPath)(__goddBundleUrl)}catch{typeof __filename<"u"?e=__filename:(e=process.argv[1]??process.execPath,console.warn(`[GoDD] import.meta.url / __filename \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002process.argv[1] \u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF: ${e}`))}let t=(0,fe.dirname)(e),r=e.includes("src")?(0,fe.resolve)(t,"..","..","dist","godd.js"):(0,fe.resolve)(t,"godd.js");return{command:process.execPath,args:[r]}}function Ly(e,t){let r={GODD_CONFIG:e,...t},{command:n,args:o}=BC();return{command:n,args:[...o,"server"],env:r}}function VC(e){let t=["mcp","serve"];return e&&t.push("--proxy-url",e),{type:"stdio",command:"headroom",args:t}}function HC(e=process.platform){let t="pipx/venv \u306E headroom \u304C Cursor \u304B\u3089\u898B\u3048\u306A\u3044\u5834\u5408\u306F .cursor/mcp.json \u306E command \u3092\u7D76\u5BFE\u30D1\u30B9\u306B\u5909\u66F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002";return e==="darwin"?"macOS + Homebrew Python \u3067\u306F PEP 668 \u306B\u3088\u308A bare pip install \u304C\u5931\u6557\u3059\u308B\u305F\u3081\u3001venv \u307E\u305F\u306F pipx \u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t:"\u4E8B\u524D\u306B venv/pipx \u7B49\u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t}function WC(e="core"){return{type:"stdio",command:"agent-browser",args:["mcp","--tools",e]}}function KC(e="https://mcp.typeui.sh",t){let r=t?.trim();return r?{url:e,headers:{Authorization:`Bearer ${r}`}}:{url:e}}async function YC(e,t,r={}){let n=r.fetchImpl??fetch,o=r.timeoutMs??JC,i=`${e.replace(/\/+$/,"")}/v1/google/access`,s;try{s=await n(i,{headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(o)})}catch(u){let p=u instanceof Error?u.name:"";return{status:"unavailable",reason:p==="TimeoutError"||p==="AbortError"?"\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8":"\u901A\u4FE1\u30A8\u30E9\u30FC"}}if(s.status===401||s.status===403)return{status:"unauthorized",httpStatus:s.status};if(s.status===404)return{status:"unsupported"};if(!s.ok)return{status:"unavailable",reason:`HTTP ${s.status}`};let a;try{a=await s.json()}catch{return{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}let c=a&&typeof a=="object"?a.projects:void 0;return Array.isArray(c)?c.length===0?{status:"none"}:{status:"granted",projectCount:c.length}:{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}function QC(e,t){return{url:e,headers:{Authorization:`Bearer ${t}`}}}function Lq(e,t){let{command:r,args:n}=BC(),o={GODD_REGISTRY_URL:e};return t!==gp&&(o.GODD_GOOGLE_MCP_URL=t),{command:r,args:[...n,"google-relay"],env:o}}function XC(e){if(!e||typeof e!="object")return!1;let{url:t,headers:r,args:n,env:o}=e;return t!==void 0||r!==void 0||!Array.isArray(n)||n[n.length-1]!=="google-relay"?!1:!(o&&typeof o=="object"&&"GODD_LICENSE_KEY"in o)}function SC(e,t,r,n,o=!1){let i=Zq(e,t,r);return o?i.action==="add"&&e.enabled?{action:"add",entry:Lq(n,e.url),projectCount:i.projectCount,relay:!0}:i.action==="keep"&&i.reason!=="disabled"?{action:"remove",reason:"device-token",cause:i.reason,detail:i.detail}:i:i}function Zq(e,t,r){if(!e.enabled)return{action:"keep",reason:e.reason};if(!t)return{action:"keep",reason:"unavailable"};switch(t.status){case"granted":return{action:"add",entry:QC(e.url,r),projectCount:t.projectCount};case"none":return{action:"remove",reason:"no-projects"};case"unauthorized":return{action:"remove",reason:"unauthorized"};case"unsupported":return{action:"keep",reason:"unsupported"};case"unavailable":return{action:"keep",reason:"unavailable",detail:t.reason}}}async function eT(e,t,r={}){let n=Ey(r.env);if(!n.enabled)return SC(n,null,t,e,r.deviceToken);let o=await YC(e,t,{fetchImpl:r.fetchImpl,timeoutMs:r.timeoutMs});return SC(n,o,t,e,r.deviceToken)}function tT(e,t,r){switch(e.action){case"add":return t.written?e.relay?`\u2713 ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001godd google-relay \u7D4C\u7531\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u306F MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\uFF09`:`\u2713 ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC ${ZC(r)}\uFF09`:null;case"remove":if(e.reason==="device-token"){if(e.cause==="unsupported")return t.removed&&!t.kept?`\u2713 Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u65E2\u5B58\u306E ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u305F\u3081\uFF09`:null;let n=e.cause==="invalid-url"?"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081":`Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09`;return t.kept&&!t.removed?`\u26A0 ${n}\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u65E2\u5B58\u306E godd google-relay \u7D4C\u7531\u306E\u8A2D\u5B9A\u306F\u305D\u306E\u307E\u307E\u6B8B\u3057\u307E\u3057\u305F\uFF09`:`\u26A0 ${n}\u3001${jt} \u3092\u8A2D\u5B9A\u3057\u307E\u305B\u3093\u3067\u3057\u305F`+(t.removed?"\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u65E2\u5B58\u306E\u8A2D\u5B9A\u306F\u524A\u9664\u3057\u307E\u3057\u305F":"")+"\u3002\u63A5\u7D9A\u3067\u304D\u308B\u72B6\u614B\u3067 godd init \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044"}return t.removed?e.reason==="no-projects"?`\u2713 Google \u9023\u643A\u306E\u5272\u5F53\u6848\u4EF6\u304C\u7121\u3044\u305F\u3081\u3001${jt} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:`\u2713 \u30E9\u30A4\u30BB\u30F3\u30B9\u3067 Google \u9023\u643A\u3092\u5229\u7528\u3067\u304D\u306A\u3044\u305F\u3081\uFF08\u7121\u52B9\u307E\u305F\u306F\u671F\u9650\u5207\u308C\uFF09\u3001${jt} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:null;case"keep":return e.reason==="disabled"?` GODD_GOOGLE_MCP \u306E\u6307\u5B9A\u306B\u3088\u308A ${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="invalid-url"?`\u26A0 GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="unsupported"?null:`\u26A0 Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`}}function rT(e,t,r=[]){let n=e?{...e}:{},i={...typeof n.mcpServers=="object"&&n.mcpServers!==null?n.mcpServers:{},...t};for(let s of r)s in t||delete i[s];return n.mcpServers=i,n}function nT(e){let t={};for(let[r,n]of Object.entries(e))t[r]="url"in n&&!("type"in n)?{type:"http",...n}:n;return t}function oT(e,t,r=(0,EC.homedir)()){return[{label:".cursor/mcp.json\uFF08Cursor \u7528\uFF09",path:(0,fe.resolve)((0,fe.join)(e,".cursor","mcp.json")),userGlobalPath:(0,fe.resolve)((0,fe.join)(r,".cursor","mcp.json")),servers:t},{label:".mcp.json\uFF08Claude Code \u7528\uFF09",path:(0,fe.resolve)((0,fe.join)(e,".mcp.json")),userGlobalPath:(0,fe.resolve)((0,fe.join)(r,".mcp.json")),servers:nT(t)}]}function iT(e,t,r=[],n){let o=null,i;if((0,_e.existsSync)(e)){let l=(0,_e.readFileSync)(e,"utf-8");try{o=JSON.parse(l)}catch{i=`${e}.bak`,(0,_e.writeFileSync)(i,l,"utf-8")}}else{let l=(0,fe.dirname)(e);(0,_e.existsSync)(l)||(0,_e.mkdirSync)(l,{recursive:!0})}let s=o&&typeof o.mcpServers=="object"&&o.mcpServers!==null?o.mcpServers:{},a=r.filter(l=>l in s&&!(l in t)),c=n?a.filter(l=>n(s[l])):[],u=a.filter(l=>!c.includes(l)),p=rT(o,t,u);return(0,_e.writeFileSync)(e,JSON.stringify(p,null,2),"utf-8"),{backupPath:i,removed:u,kept:c}}function sT(e,t,r){let n=e.trim();return Uq.has(n.toLowerCase())?{mode:"google"}:n?{mode:"license_key",licenseKey:n}:t?{mode:"license_key",licenseKey:t}:r?{mode:"google"}:{mode:"missing"}}function aT(e,t){return e?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u65E2\u5B58\u3092\u4FDD\u6301 [${ZC(e)}]\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: `:t?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3 [${t.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"} / ${t.registry_url}] \u3092\u4F7F\u7528\uFF09: `:"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: "}function cT(e,t=kr()){try{return Do(e,t)?.credentials??pn(t)[0]??null}catch{return null}}async function uT(e,t={}){let r=t.log??(c=>console.log(c)),n=t.credentialsPath?[t.credentialsPath]:kr(),o=null,i=[];try{o=Do(e,n)?.credentials??null,i=pn(n).filter(c=>ot(c.registry_url)!==ot(e))}catch{}if(o)return r(`\u2713 \u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u3044\u307E\u3059: ${o.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}`),fu(o,t.now)&&r(` \u26A0 \u624B\u5143\u306E\u8A18\u9332\u3067\u306F\u6709\u52B9\u671F\u9650\uFF08${o.expires_at}\uFF09\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u304C\u5EF6\u9577\u3057\u3066\u3044\u308C\u3070\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u3059\u3002\u62D2\u5426\u3055\u308C\u305F\u5834\u5408\u306F godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),o;if(i.length>0){let c=i.map(u=>u.registry_url).join(", ");r(`
282
+ `)){let p=u.trim();if(Zq.has(p))continue;let l=p.indexOf("="),d=l>0?p.slice(0,l).trim():"";o.has(d)||i.push(u)}for(;i.length>0&&i[i.length-1].trim()==="";)i.pop()}let s=["",qC,t!==null?`GODD_LICENSE_KEY="${t}"`:FC,`GODD_LANGUAGE="${r}"`,`GODD_REGISTRY_URL="${n}"`,""],a=[...i,...s].join(`
283
+ `);(0,_e.writeFileSync)(e,a,"utf-8")}function BC(){if(jq())return{command:"godd",args:[]};let e;try{e=(0,PC.fileURLToPath)(__goddBundleUrl)}catch{typeof __filename<"u"?e=__filename:(e=process.argv[1]??process.execPath,console.warn(`[GoDD] import.meta.url / __filename \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002process.argv[1] \u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF: ${e}`))}let t=(0,fe.dirname)(e),r=e.includes("src")?(0,fe.resolve)(t,"..","..","dist","godd.js"):(0,fe.resolve)(t,"godd.js");return{command:process.execPath,args:[r]}}function Ly(e,t){let r={GODD_CONFIG:e,...t},{command:n,args:o}=BC();return{command:n,args:[...o,"server"],env:r}}function VC(e){let t=["mcp","serve"];return e&&t.push("--proxy-url",e),{type:"stdio",command:"headroom",args:t}}function HC(e=process.platform){let t="pipx/venv \u306E headroom \u304C Cursor \u304B\u3089\u898B\u3048\u306A\u3044\u5834\u5408\u306F .cursor/mcp.json \u306E command \u3092\u7D76\u5BFE\u30D1\u30B9\u306B\u5909\u66F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002";return e==="darwin"?"macOS + Homebrew Python \u3067\u306F PEP 668 \u306B\u3088\u308A bare pip install \u304C\u5931\u6557\u3059\u308B\u305F\u3081\u3001venv \u307E\u305F\u306F pipx \u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t:"\u4E8B\u524D\u306B venv/pipx \u7B49\u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t}function WC(e="core"){return{type:"stdio",command:"agent-browser",args:["mcp","--tools",e]}}function KC(e="https://mcp.typeui.sh",t){let r=t?.trim();return r?{url:e,headers:{Authorization:`Bearer ${r}`}}:{url:e}}async function YC(e,t,r={}){let n=r.fetchImpl??fetch,o=r.timeoutMs??JC,i=`${e.replace(/\/+$/,"")}/v1/google/access`,s;try{s=await n(i,{headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(o)})}catch(u){let p=u instanceof Error?u.name:"";return{status:"unavailable",reason:p==="TimeoutError"||p==="AbortError"?"\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8":"\u901A\u4FE1\u30A8\u30E9\u30FC"}}if(s.status===401||s.status===403)return{status:"unauthorized",httpStatus:s.status};if(s.status===404)return{status:"unsupported"};if(!s.ok)return{status:"unavailable",reason:`HTTP ${s.status}`};let a;try{a=await s.json()}catch{return{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}let c=a&&typeof a=="object"?a.projects:void 0;return Array.isArray(c)?c.length===0?{status:"none"}:{status:"granted",projectCount:c.length}:{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}function QC(e,t){return{url:e,headers:{Authorization:`Bearer ${t}`}}}function Uq(e,t){let{command:r,args:n}=BC(),o={GODD_REGISTRY_URL:e};return t!==gp&&(o.GODD_GOOGLE_MCP_URL=t),{command:r,args:[...n,"google-relay"],env:o}}function XC(e){if(!e||typeof e!="object")return!1;let{url:t,headers:r,args:n,env:o}=e;return t!==void 0||r!==void 0||!Array.isArray(n)||n[n.length-1]!=="google-relay"?!1:!(o&&typeof o=="object"&&"GODD_LICENSE_KEY"in o)}function SC(e,t,r,n,o=!1){let i=qq(e,t,r);return o?i.action==="add"&&e.enabled?{action:"add",entry:Uq(n,e.url),projectCount:i.projectCount,relay:!0}:i.action==="keep"&&i.reason!=="disabled"?{action:"remove",reason:"device-token",cause:i.reason,detail:i.detail}:i:i}function qq(e,t,r){if(!e.enabled)return{action:"keep",reason:e.reason};if(!t)return{action:"keep",reason:"unavailable"};switch(t.status){case"granted":return{action:"add",entry:QC(e.url,r),projectCount:t.projectCount};case"none":return{action:"remove",reason:"no-projects"};case"unauthorized":return{action:"remove",reason:"unauthorized"};case"unsupported":return{action:"keep",reason:"unsupported"};case"unavailable":return{action:"keep",reason:"unavailable",detail:t.reason}}}async function eT(e,t,r={}){let n=Ey(r.env);if(!n.enabled)return SC(n,null,t,e,r.deviceToken);let o=await YC(e,t,{fetchImpl:r.fetchImpl,timeoutMs:r.timeoutMs});return SC(n,o,t,e,r.deviceToken)}function tT(e,t,r){switch(e.action){case"add":return t.written?e.relay?`\u2713 ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001godd google-relay \u7D4C\u7531\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u306F MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\uFF09`:`\u2713 ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC ${ZC(r)}\uFF09`:null;case"remove":if(e.reason==="device-token"){if(e.cause==="unsupported")return t.removed&&!t.kept?`\u2713 Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u65E2\u5B58\u306E ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u305F\u3081\uFF09`:null;let n=e.cause==="invalid-url"?"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081":`Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09`;return t.kept&&!t.removed?`\u26A0 ${n}\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u65E2\u5B58\u306E godd google-relay \u7D4C\u7531\u306E\u8A2D\u5B9A\u306F\u305D\u306E\u307E\u307E\u6B8B\u3057\u307E\u3057\u305F\uFF09`:`\u26A0 ${n}\u3001${jt} \u3092\u8A2D\u5B9A\u3057\u307E\u305B\u3093\u3067\u3057\u305F`+(t.removed?"\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u65E2\u5B58\u306E\u8A2D\u5B9A\u306F\u524A\u9664\u3057\u307E\u3057\u305F":"")+"\u3002\u63A5\u7D9A\u3067\u304D\u308B\u72B6\u614B\u3067 godd init \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044"}return t.removed?e.reason==="no-projects"?`\u2713 Google \u9023\u643A\u306E\u5272\u5F53\u6848\u4EF6\u304C\u7121\u3044\u305F\u3081\u3001${jt} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:`\u2713 \u30E9\u30A4\u30BB\u30F3\u30B9\u3067 Google \u9023\u643A\u3092\u5229\u7528\u3067\u304D\u306A\u3044\u305F\u3081\uFF08\u7121\u52B9\u307E\u305F\u306F\u671F\u9650\u5207\u308C\uFF09\u3001${jt} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:null;case"keep":return e.reason==="disabled"?` GODD_GOOGLE_MCP \u306E\u6307\u5B9A\u306B\u3088\u308A ${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="invalid-url"?`\u26A0 GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="unsupported"?null:`\u26A0 Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`}}function rT(e,t,r=[]){let n=e?{...e}:{},i={...typeof n.mcpServers=="object"&&n.mcpServers!==null?n.mcpServers:{},...t};for(let s of r)s in t||delete i[s];return n.mcpServers=i,n}function nT(e){let t={};for(let[r,n]of Object.entries(e))t[r]="url"in n&&!("type"in n)?{type:"http",...n}:n;return t}function oT(e,t,r=(0,EC.homedir)()){return[{label:".cursor/mcp.json\uFF08Cursor \u7528\uFF09",path:(0,fe.resolve)((0,fe.join)(e,".cursor","mcp.json")),userGlobalPath:(0,fe.resolve)((0,fe.join)(r,".cursor","mcp.json")),servers:t},{label:".mcp.json\uFF08Claude Code \u7528\uFF09",path:(0,fe.resolve)((0,fe.join)(e,".mcp.json")),userGlobalPath:(0,fe.resolve)((0,fe.join)(r,".mcp.json")),servers:nT(t)}]}function iT(e,t,r=[],n){let o=null,i;if((0,_e.existsSync)(e)){let l=(0,_e.readFileSync)(e,"utf-8");try{o=JSON.parse(l)}catch{i=`${e}.bak`,(0,_e.writeFileSync)(i,l,"utf-8")}}else{let l=(0,fe.dirname)(e);(0,_e.existsSync)(l)||(0,_e.mkdirSync)(l,{recursive:!0})}let s=o&&typeof o.mcpServers=="object"&&o.mcpServers!==null?o.mcpServers:{},a=r.filter(l=>l in s&&!(l in t)),c=n?a.filter(l=>n(s[l])):[],u=a.filter(l=>!c.includes(l)),p=rT(o,t,u);return(0,_e.writeFileSync)(e,JSON.stringify(p,null,2),"utf-8"),{backupPath:i,removed:u,kept:c}}function sT(e,t,r){let n=e.trim();return Fq.has(n.toLowerCase())?{mode:"google"}:n?{mode:"license_key",licenseKey:n}:t?{mode:"license_key",licenseKey:t}:r?{mode:"google"}:{mode:"missing"}}function aT(e,t){return e?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u65E2\u5B58\u3092\u4FDD\u6301 [${ZC(e)}]\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: `:t?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3 [${t.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"} / ${t.registry_url}] \u3092\u4F7F\u7528\uFF09: `:"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: "}function cT(e,t=kr()){try{return Do(e,t)?.credentials??pn(t)[0]??null}catch{return null}}async function uT(e,t={}){let r=t.log??(c=>console.log(c)),n=t.credentialsPath?[t.credentialsPath]:kr(),o=null,i=[];try{o=Do(e,n)?.credentials??null,i=pn(n).filter(c=>ot(c.registry_url)!==ot(e))}catch{}if(o)return r(`\u2713 \u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u3044\u307E\u3059: ${o.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}`),fu(o,t.now)&&r(` \u26A0 \u624B\u5143\u306E\u8A18\u9332\u3067\u306F\u6709\u52B9\u671F\u9650\uFF08${o.expires_at}\uFF09\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u304C\u5EF6\u9577\u3057\u3066\u3044\u308C\u3070\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u3059\u3002\u62D2\u5426\u3055\u308C\u305F\u5834\u5408\u306F godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),o;if(i.length>0){let c=i.map(u=>u.registry_url).join(", ");r(`
284
284
  \u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3\u306F\u5225\u306E Registry\uFF08${c}\uFF09\u5411\u3051\u3067\u3059\u3002${ot(e)} \u306B\u65B0\u3057\u304F\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\uFF08${c} \u306E\u30ED\u30B0\u30A4\u30F3\u306F\u305D\u306E\u307E\u307E\u6B8B\u308A\u307E\u3059\uFF09\u3002`)}r(`
285
285
  Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\u3002`);let a=await(t.login??(c=>_p({drive:!1,noBrowser:!1,registryUrl:c},{credentialsPath:t.credentialsPath,log:r}).then(u=>u.credentials)))(e);return r(`\u2713 \u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F: ${a.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}`),a}function lT(e,t,r){return{...e!==null?{GODD_LICENSE_KEY:e}:{},GODD_LANGUAGE:t,GODD_REGISTRY_URL:r}}async function pT(){console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 GoDD MCP Server \u2014 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log("");let e=process.cwd(),t=(0,fe.join)(e,"config.godd"),r=UC(t);r&&(console.log("\u65E2\u5B58\u306E config.godd \u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u5909\u66F4\u3059\u308B\u9805\u76EE\u306E\u307F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Enter \u3067\u30B9\u30AD\u30C3\u30D7\uFF09\u3002"),r.components?.length&&console.log(` \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8: ${r.components.join(", ")} (${r.components.length} \u4EF6)`),r.language&&console.log(` \u8A00\u8A9E: ${r.language}`),console.log(""));let n=cT(r?.registry_url??dn),o=await Dr(aT(r?.license_key,n)),i=sT(o,r?.license_key,n!==null);i.mode==="missing"&&(console.error("\u30A8\u30E9\u30FC: \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306F\u5FC5\u9808\u3067\u3059\u3002Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u4F7F\u3046\u5834\u5408\u306F google \u3068\u5165\u529B\u3059\u308B\u304B\u3001\u5148\u306B godd login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let s=i.mode==="google",a=r?.language??"ja",u=await Dr(`\u4F7F\u7528\u8A00\u8A9E\u3092\u9078\u629E [ja/en/zh/ru/kz/tr] (default: ${a}): `)||a,p=!!r?.registry_url,l=r?.registry_url??dn,d=await Dr(RC(l,p)),f;try{f=IC(d,l)}catch(ie){console.error(`\u30A8\u30E9\u30FC: ${ie instanceof Error?ie.message:String(ie)}`),process.exit(1)}let h=f.url;f.usedDefault&&console.log(zC(h,p));let g,y=null;if(i.mode==="google"){try{y=await uT(h)}catch(ie){console.error(`
286
286
  \u30A8\u30E9\u30FC: Google \u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002${ie instanceof Error?ie.message:String(ie)}`),process.exit(1)}g=y.access_token}else g=i.licenseKey;let v=wa();v||(console.error(`
@@ -288,7 +288,7 @@ Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\
288
288
  \u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u767B\u9332\u4E2D: ${v}`);try{let ie=await fetch(`${h}/v1/repos/register`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${g}`},body:JSON.stringify({remote_url:v}),signal:AbortSignal.timeout(1e4)});if(!ie.ok){let Ee=await ie.json().catch(()=>({detail:ie.statusText}));console.error(`
289
289
  \u30A8\u30E9\u30FC: \u30EA\u30DD\u30B8\u30C8\u30EA\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002`),console.error(` ${Ee.detail??ie.statusText}`);let $t=nt(ie.status,String(Ee.detail??""));$t?console.error(` ${$t}`):ie.status===401?console.error(s?" \u30ED\u30B0\u30A4\u30F3\u304C\u7121\u52B9\u3067\u3059\u3002godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002":" \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002"):ie.status===403&&console.error(" \u30EA\u30DD\u30B8\u30C8\u30EA\u6570\u306E\u4E0A\u9650\u306B\u9054\u3057\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)}console.log("\u2713 \u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u767B\u9332\u3057\u307E\u3057\u305F")}catch{console.error(`
290
290
  \u30A8\u30E9\u30FC: Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002`),console.error(` ${h} \u304C\u8D77\u52D5\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),process.exit(1)}console.log(`
291
- \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u4E2D...`);let w=await Nq(h,g)??jy;console.log(w===jy?" Registry API \u306B\u63A5\u7D9A\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30D3\u30EB\u30C8\u30A4\u30F3\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002":` ${w.length} \u4EF6\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u3057\u307E\u3057\u305F\u3002`);let x=MC(w),k=new Set,P=new Set;function q(ie){return x.find(Ee=>Ee.category===ie)}async function L(ie,Ee){let $t=My[ie.category]??ie.category,Pt=Ee?ie.components.filter(Ct=>Dq(Ct.name,P)):ie.components;if(Pt.length===0){console.log(` \u3010${$t}\u3011 \u2014 \u5BFE\u5FDC\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306F\u3042\u308A\u307E\u305B\u3093\uFF08\u30B9\u30AD\u30C3\u30D7\uFF09`);return}console.log(`
291
+ \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u4E2D...`);let w=await Mq(h,g)??jy;console.log(w===jy?" Registry API \u306B\u63A5\u7D9A\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30D3\u30EB\u30C8\u30A4\u30F3\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002":` ${w.length} \u4EF6\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u3057\u307E\u3057\u305F\u3002`);let x=MC(w),k=new Set,P=new Set;function q(ie){return x.find(Ee=>Ee.category===ie)}async function L(ie,Ee){let $t=My[ie.category]??ie.category,Pt=Ee?ie.components.filter(Ct=>Nq(Ct.name,P)):ie.components;if(Pt.length===0){console.log(` \u3010${$t}\u3011 \u2014 \u5BFE\u5FDC\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306F\u3042\u308A\u307E\u305B\u3093\uFF08\u30B9\u30AD\u30C3\u30D7\uFF09`);return}console.log(`
292
292
  \u3010${$t}\u3011`),Pt.forEach((Ct,_r)=>{console.log(` ${String(_r+1).padStart(2)}. ${Ct.label.padEnd(25)} ${Ct.description}`)});let Et=await Dr(" \u9078\u629E (\u4F8B: 1,3): ");if(Et.toLowerCase()==="all")for(let Ct of Pt)k.add(Ct.name);else if(Et){let Ct=Et.split(",").map(_r=>parseInt(_r.trim(),10));for(let _r of Ct)_r>=1&&_r<=Pt.length&&k.add(Pt[_r-1].name)}}let Ue=!1;if(r?.components&&r.components.length>0&&(await Dr("\u65E2\u5B58\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u8A2D\u5B9A\u3092\u5F15\u304D\u7D99\u304E\u307E\u3059\u304B\uFF1F [Y/n]: ")).toLowerCase()!=="n"){for(let Ee of r.components)k.add(Ee);Ue=!0,console.log(`
293
293
  \u2713 \u65E2\u5B58\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u8A2D\u5B9A\u3092\u5F15\u304D\u7D99\u304E\u307E\u3057\u305F\uFF08${k.size} \u4EF6\uFF09`)}if(!Ue){let ie=[{step:1,title:"\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E",categories:["language"]},{step:2,title:"\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF / \u30E9\u30A4\u30D6\u30E9\u30EA",categories:["frontend-ui","backend-api","frontend","backend"]},{step:3,title:`\u95A2\u9023\u30C4\u30FC\u30EB\uFF08CSS / \u30D3\u30EB\u30C9 / ORM / \u30BF\u30B9\u30AF\u30AD\u30E5\u30FC / ${LC("runtime")}\uFF09`,categories:["frontend-css","frontend-build","backend-orm","backend-task","runtime"]},{step:4,title:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",categories:["database"]},{step:5,title:"\u30A4\u30F3\u30D5\u30E9",categories:["infra"]}],Ee=ie.length;console.log(`
294
294
  \u2501\u2501\u2501 \u6280\u8853\u30B9\u30BF\u30C3\u30AF\u9078\u629E\uFF08${Ee} \u30B9\u30C6\u30C3\u30D7 + \u81EA\u52D5\u8A2D\u5B9A\uFF09\u2501\u2501\u2501`),console.log(`\u8907\u6570\u9078\u629E: "1,3,5" / \u5168\u9078\u629E: "all" / \u30B9\u30AD\u30C3\u30D7: Enter
@@ -299,11 +299,11 @@ Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\
299
299
  \u2714 \u8A2D\u8A08\u30D1\u30BF\u30FC\u30F3\u3092\u81EA\u52D5\u8A2D\u5B9A\u3057\u307E\u3057\u305F: ${Pt}`)}k.size===0&&(console.error(`
300
300
  \u30A8\u30E9\u30FC: \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C1\u3064\u3082\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`),process.exit(1))}console.log(`
301
301
  \u2501\u2501\u2501 \u9078\u629E\u3055\u308C\u305F\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 (${k.size} \u4EF6) \u2501\u2501\u2501`);for(let ie of k){let Ee=w.find($t=>$t.name===ie);console.log(` \u2713 ${Ee?.label??ie}`)}let Q=await Dr(`
302
- config.godd \u306E\u4FDD\u5B58\u5148 (default: ${t}): `)||t,qe=jq([...k]);(0,_e.writeFileSync)(Q,qe,"utf-8"),console.log(`
302
+ config.godd \u306E\u4FDD\u5B58\u5148 (default: ${t}): `)||t,qe=Lq([...k]);(0,_e.writeFileSync)(Q,qe,"utf-8"),console.log(`
303
303
  \u2713 config.godd \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${Q}`);let Be=(0,fe.join)((0,fe.dirname)(Q),".env");GC(Be,s?null:g,u,h),console.log(`\u2713 .env \u3092\u66F4\u65B0\u3057\u307E\u3057\u305F: ${Be}`),DC(e)?console.log("\u2713 GoDD \u306E\u79D8\u5BC6\u8A2D\u5B9A\u3092 .gitignore \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F"):console.log("\u2713 GoDD \u306E\u79D8\u5BC6\u8A2D\u5B9A\u306F .gitignore \u306B\u8FFD\u52A0\u6E08\u307F\u3067\u3059");let En=!1;if((await Dr(".cursor/mcp.json / .mcp.json / .codex/config.toml\uFF08\u5BFE\u5FDC\u5A92\u4F53\u306E MCP \u8A2D\u5B9A\uFF09\u3092\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: ")).toLowerCase()!=="n"){let ie=lT(s?null:g,u,h),$t=(await Dr("Headroom\uFF08\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u5727\u7E2E MCP\uFF09\u3082\u767B\u9332\u3057\u307E\u3059\u304B\uFF1F \u4E8B\u524D\u306B venv/pipx \u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044 [y/N]: ")).toLowerCase()==="y";$t&&console.log(` \u6CE8\u610F: ${HC()}`);let Et=(await Dr("agent-browser\uFF08\u30D6\u30E9\u30A6\u30B6\u64CD\u4F5C MCP\uFF09\u3082\u767B\u9332\u3057\u307E\u3059\u304B\uFF1F \u30D6\u30E9\u30A6\u30B6\u81EA\u52D5\u64CD\u4F5C\u306B\u52A0\u3048 JavaScript \u5B9F\u884C\uFF08eval, \u8A8D\u8A3C\u6E08\u307F\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u4F5C\u7528\uFF09\u3092\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3078\u8A31\u53EF\u3057\u307E\u3059\u3002\u4E8B\u524D\u306B `npm install -g agent-browser && agent-browser install` \u304C\u5FC5\u8981\u3067\u3059 [y/N]: ")).toLowerCase()==="y",_r=(await Dr("TypeUI\uFF08\u30C7\u30B6\u30A4\u30F3\u30B9\u30AD\u30EB / UI \u30D7\u30ED\u30F3\u30D7\u30C8 MCP\uFF09\u3082\u767B\u9332\u3057\u307E\u3059\u304B\uFF1F UI \u751F\u6210\u54C1\u8CEA\uFF08\u8131\u30FBAI \u611F\uFF09\u3092\u9AD8\u3081\u308B\u30C7\u30B6\u30A4\u30F3\u30AC\u30A4\u30C0\u30F3\u30B9\u3092\u6CE8\u5165\u3057\u307E\u3059\u3002\u30DB\u30B9\u30C8\u578B\u30B5\u30FC\u30D0\u30FC\uFF08https://mcp.typeui.sh\uFF09\u3067\u3001\u521D\u56DE\u5229\u7528\u6642\u306B TypeUI \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u304C\u5FC5\u8981\u3067\u3059 [y/N]: ")).toLowerCase()==="y",Ip="";_r&&(Ip=await Dr(" TypeUI \u3092\u72EC\u81EA\u30DB\u30B9\u30C8/\u30C8\u30FC\u30AF\u30F3\u8A8D\u8A3C\u3067\u4F7F\u3046\u5834\u5408\u306F Bearer \u30C8\u30FC\u30AF\u30F3\u3092\u5165\u529B \uFF08\u901A\u5E38\u306F\u7A7A Enter \u3067 OAuth \u5BFE\u8A71\u30B5\u30A4\u30F3\u30A4\u30F3\uFF09: "));let us={godd:Ly((0,fe.resolve)(Q),ie)};$t&&(us.headroom=VC()),Et&&(us["agent-browser"]=WC()),_r&&(us.typeui=KC(void 0,Ip));let co=await eT(h,g,{deviceToken:s});co.action==="add"&&(us[jt]=co.entry);let BA=co.action==="remove"?[jt]:[],VA=co.action==="remove"&&co.reason==="device-token"?XC:void 0,zp=!1,a_=!1,c_=!1,HA=oT(e,us),u_=0;for(let er of HA){if(er.path===er.userGlobalPath){console.log(`
304
304
  \u26A0 \u30E6\u30FC\u30B6\u30FC\u30B0\u30ED\u30FC\u30D0\u30EB\u306E MCP \u8A2D\u5B9A\u3092\u4E0A\u66F8\u304D\u3057\u306A\u3044\u305F\u3081\u3001${er.label} \u306B\u306F\u66F8\u304D\u8FBC\u307F\u307E\u305B\u3093\u3002`),console.log(` \u4EE5\u4E0B\u306E\u30D6\u30ED\u30C3\u30AF\u3092\u624B\u52D5\u3067 ${er.userGlobalPath} \u306E mcpServers \u306B\u8FFD\u8A18\u3057\u3066\u304F\u3060\u3055\u3044:
305
305
  `),console.log(JSON.stringify(er.servers,null,2)),console.log("");continue}let{backupPath:f_,removed:WA,kept:KA}=iT(er.path,er.servers,BA,VA);co.action==="add"&&(zp=!0),WA.length>0&&(a_=!0),KA.length>0&&(c_=!0),f_&&(console.warn(`\u26A0 \u65E2\u5B58\u306E ${er.path} \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u3092\u9000\u907F\u3057\u3001\u9078\u629E\u3057\u305F MCP \u30A8\u30F3\u30C8\u30EA\u306E\u307F\u3067\u518D\u751F\u6210\u3057\u307E\u3059\u3002`),console.warn(` \u9000\u907F\u5148: ${f_}\uFF08\u5FC5\u8981\u306A\u30A8\u30F3\u30C8\u30EA\u306F\u624B\u52D5\u3067\u30DE\u30FC\u30B8\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`)),console.log(`\u2713 ${er.label} \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${er.path}`),u_+=1}let l_=jC(e,(0,fe.resolve)(Q),ie);console.log(l_?`\u2713 Codex MCP \u8A2D\u5B9A\u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${l_}`:"\u2713 \u65E2\u5B58\u306E Codex config.toml \u306F\u4E0A\u66F8\u304D\u3057\u307E\u305B\u3093\u3067\u3057\u305F");let p_=OC(e);if(p_.length>0)for(let er of p_)console.log(`\u2713 /godd-dev \u30B3\u30DE\u30F3\u30C9\u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${er}`);else console.log("\u2713 /godd-dev \u30B3\u30DE\u30F3\u30C9\u306F\u65E2\u5B58\u306E\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u3092\u4FDD\u6301\u3057\u307E\u3057\u305F");let d_=NC(e);console.log(d_?`\u2713 Codex \u30B9\u30AD\u30EB\u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${d_}`:"\u2713 \u65E2\u5B58\u306E Codex godd-dev \u30B9\u30AD\u30EB\u306F\u4E0A\u66F8\u304D\u3057\u307E\u305B\u3093\u3067\u3057\u305F"),u_>0&&($t&&console.log("\u2713 Headroom MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08proxy \u9023\u643A\u306F\u4EFB\u610F\uFF09"),Et&&console.log("\u2713 agent-browser MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08\u8981 `npm install -g agent-browser && agent-browser install`\uFF09"),_r&&console.log(Ip?"\u2713 TypeUI MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08\u30DB\u30B9\u30C8\u578B\u30FBAuthorization: Bearer \u30D8\u30C3\u30C0\u3067\u8A8D\u8A3C\uFF09":"\u2713 TypeUI MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08\u30DB\u30B9\u30C8\u578B\u30FB\u521D\u56DE\u5229\u7528\u6642\u306B OAuth \u3067 TypeUI \u30A2\u30AB\u30A6\u30F3\u30C8\u3078\u30B5\u30A4\u30F3\u30A4\u30F3\uFF09"));let cc=tT(co,{written:zp,removed:a_,kept:c_},g);cc&&(cc.startsWith("\u26A0")?console.warn(cc):console.log(cc)),En=zp}console.log(`
306
- \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`),console.log("\u2551 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86\uFF01 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"),console.log(" 1. Cursor: IDE \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 2. Claude Code: \u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067 `claude` \u3092\u8D77\u52D5\u3057\u3001"),console.log(" \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30B9\u30B3\u30FC\u30D7 MCP\uFF08.mcp.json\uFF09\u306E\u627F\u8A8D\u30C0\u30A4\u30A2\u30ED\u30B0\u3067 godd \u3092\u627F\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" \uFF08\u521D\u56DE\u306F\u627F\u8A8D\u3059\u308B\u307E\u3067\u6709\u52B9\u5316\u3055\u308C\u307E\u305B\u3093\u3002`claude mcp list` \u3067\u72B6\u614B\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF09"),console.log(" 3. Codex: `/mcp` \u3067 godd \u304C\u63A5\u7D9A\u6E08\u307F\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 4. \u30C1\u30E3\u30C3\u30C8\u3067 GoDD MCP \u30C4\u30FC\u30EB\u304C\u4F7F\u3048\u308B\u3088\u3046\u306B\u306A\u308A\u307E\u3059"),console.log(" - godd-dev: \u958B\u767A\u652F\u63F4"),console.log(" - /godd-dev: Cursor / Claude Code \u5171\u901A\u306E\u76F4\u63A5\u30B3\u30DE\u30F3\u30C9"),console.log(" - godd-check: \u30B3\u30FC\u30C9\u30C1\u30A7\u30C3\u30AF"),console.log(" - godd-review: \u30B3\u30FC\u30C9\u30EC\u30D3\u30E5\u30FC"),console.log(" - godd-setup: \u74B0\u5883\u69CB\u7BC9\u652F\u63F4"),console.log(" \u4ED6 12 \u30C4\u30FC\u30EB"),En&&(console.log(` 5. Google \u9023\u643A: IDE / Claude Code \u3092\u518D\u8D77\u52D5\u3057\u3001/mcp \u3067 ${jt} \u304C connected \u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`),console.log(` \uFF08Claude Code \u306F godd \u3068\u540C\u3058\u304F\u521D\u56DE\u306B ${jt} \u306E\u627F\u8A8D\u304C\u5FC5\u8981\u3067\u3059\uFF09`)),y&&(console.log(""),console.log(`\u30ED\u30B0\u30A4\u30F3: Google\uFF08${y.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}\uFF09\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306F .env / MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\u3002`),console.log(` \u30ED\u30B0\u30A4\u30F3\u60C5\u5831: ${jn()}`),console.log(" \u30ED\u30B0\u30A4\u30F3\u304C\u5207\u308C\u305F\u3089 godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002Drive \u3092\u672C\u4EBA\u306E\u6A29\u9650\u3067\u8AAD\u3080\u5834\u5408\u306F godd login --drive \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002")),console.log(""),console.log("\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u63A8\u5968\u8A2D\u5B9A:"),console.log(" \u79D8\u5BC6\u60C5\u5831\u6F0F\u6D29\u9632\u6B62\u306E\u305F\u3081\u3001\u500B\u4EBA\u306E ~/.gitignore_global \u306B\u4EE5\u4E0B\u3092\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u3092\u63A8\u5968\u3057\u307E\u3059:"),console.log(" git config --global core.excludesFile ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json' >> ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json.bak' >> ~/.gitignore_global"),console.log(" echo '.mcp.json' >> ~/.gitignore_global"),console.log(" echo '.mcp.json.bak' >> ~/.gitignore_global"),console.log(""),AC.close()}function qq(){try{return __goddBundleUrl}catch{return}}var $C,_e,fe,PC,EC,jy,Cq,CC,Tq,TC,Aq,Rq,AC,kC,My,Iq,zq,qC,FC,Mq,jt,JC,Uq,fT=b(()=>{"use strict";$C=yt(require("node:readline"),1),_e=require("node:fs"),fe=require("node:path"),PC=require("node:url"),EC=require("node:os");Ls();Tf();ug();Sy();$y();Mn();Cy();Ci();yp();Kr();Fa();jy=[{id:"",name:"python",category:"language",label:"Python",description:"\u6C4E\u7528\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"typescript",category:"language",label:"TypeScript",description:"\u578B\u5B89\u5168\u306A JavaScript \u30B9\u30FC\u30D1\u30FC\u30BB\u30C3\u30C8"},{id:"",name:"javascript",category:"language",label:"JavaScript",description:"\u52D5\u7684\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E (ES2024+)"},{id:"",name:"go",category:"language",label:"Go",description:"\u9759\u7684\u578B\u4ED8\u3051\u30B3\u30F3\u30D1\u30A4\u30EB\u8A00\u8A9E"},{id:"",name:"php",category:"language",label:"PHP",description:"\u6C4E\u7528\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E"},{id:"",name:"ruby",category:"language",label:"Ruby",description:"\u52D5\u7684\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u6307\u5411\u8A00\u8A9E"},{id:"",name:"c",category:"language",label:"C",description:"\u30B7\u30B9\u30C6\u30E0\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"html",category:"language",label:"HTML",description:"HyperText Markup Language"},{id:"",name:"css",category:"language",label:"CSS",description:"Cascading Style Sheets"},{id:"",name:"react",category:"frontend",label:"React",description:"React UI \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"nextjs",category:"frontend",label:"Next.js",description:"React \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (SSR/SSG/ISR)"},{id:"",name:"vue",category:"frontend",label:"Vue.js",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 JavaScript \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"angular",category:"frontend",label:"Angular",description:"TypeScript \u30D9\u30FC\u30B9 Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"svelte",category:"frontend",label:"Svelte",description:"\u30B3\u30F3\u30D1\u30A4\u30EB\u6642 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"vite",category:"frontend",label:"Vite",description:"\u9AD8\u901F\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB"},{id:"",name:"tailwind",category:"frontend",label:"Tailwind CSS",description:"\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u30D5\u30A1\u30FC\u30B9\u30C8 CSS"},{id:"",name:"sass",category:"frontend",label:"Sass",description:"CSS \u30D7\u30EA\u30D7\u30ED\u30BB\u30C3\u30B5"},{id:"",name:"emotion",category:"frontend",label:"Emotion",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"styled-components",category:"frontend",label:"styled-components",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"mui",category:"frontend",label:"MUI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"chakra-ui",category:"frontend",label:"Chakra UI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"electron",category:"frontend",label:"Electron",description:"\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30A2\u30D7\u30EA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastapi",category:"backend",label:"FastAPI",description:"\u9AD8\u901F Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"django",category:"backend",label:"Django",description:"Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (batteries included)"},{id:"",name:"flask",category:"backend",label:"Flask",description:"Python \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"express",category:"backend",label:"Express",description:"\u6700\u5C0F\u9650\u306E Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastify",category:"backend",label:"Fastify",description:"\u9AD8\u901F Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"nestjs",category:"backend",label:"NestJS",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 Node.js \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"gin",category:"backend",label:"Gin",description:"Go HTTP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"echo",category:"backend",label:"Echo",description:"\u9AD8\u6027\u80FD Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fiber",category:"backend",label:"Fiber",description:"Express \u98A8 Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"laravel",category:"backend",label:"Laravel",description:"PHP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"symfony",category:"backend",label:"Symfony",description:"PHP \u30A8\u30F3\u30BF\u30FC\u30D7\u30E9\u30A4\u30BA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"wordpress",category:"backend",label:"WordPress",description:"PHP CMS \u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"rails",category:"backend",label:"Ruby on Rails",description:"Ruby Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (MVC)"},{id:"",name:"sinatra",category:"backend",label:"Sinatra",description:"Ruby \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"koa",category:"backend",label:"Koa",description:"\u6B21\u4E16\u4EE3 Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"node",category:"runtime",label:"Node.js",description:"config.godd \u767B\u9332\u7528\u306E JavaScript \u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{id:"",name:"agent-stdio",category:"runtime",label:"Agent Stdio",description:"config.godd \u767B\u9332\u7528\u306E MCP Agent stdio \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{id:"",name:"postgresql",category:"database",label:"PostgreSQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mysql",category:"database",label:"MySQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mongodb",category:"database",label:"MongoDB",description:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u6307\u5411 NoSQL DB"},{id:"",name:"redis",category:"database",label:"Redis",description:"\u30A4\u30F3\u30E1\u30E2\u30EA KVS / \u30AD\u30E3\u30C3\u30B7\u30E5"},{id:"",name:"sqlalchemy",category:"backend",label:"SQLAlchemy",description:"Python SQL \u30C4\u30FC\u30EB\u30AD\u30C3\u30C8 + ORM"},{id:"",name:"celery",category:"backend",label:"Celery",description:"\u5206\u6563\u30BF\u30B9\u30AF\u30AD\u30E5\u30FC"},{id:"",name:"docker",category:"infra",label:"Docker",description:"\u30B3\u30F3\u30C6\u30CA\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"terraform",category:"infra",label:"Terraform",description:"IaC \u30C4\u30FC\u30EB (HashiCorp)"},{id:"",name:"ddd-clean-architecture",category:"architecture",label:"DDD / Clean Architecture",description:"\u30C9\u30E1\u30A4\u30F3\u99C6\u52D5\u8A2D\u8A08 + Clean Architecture"}],Cq=[".cursor/mcp.json",".cursor/mcp.json.bak",".mcp.json",".mcp.json.bak",".codex/config.toml",".codex/config.toml.bak",".env",".cursor/commands/godd-dev.md",".claude/commands/godd-dev.md",".agents/skills/godd-dev/SKILL.md"],CC="<!-- GoDD managed command: godd-dev -->",Tq=`${CC}
306
+ \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`),console.log("\u2551 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86\uFF01 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"),console.log(" 1. Cursor: IDE \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 2. Claude Code: \u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067 `claude` \u3092\u8D77\u52D5\u3057\u3001"),console.log(" \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30B9\u30B3\u30FC\u30D7 MCP\uFF08.mcp.json\uFF09\u306E\u627F\u8A8D\u30C0\u30A4\u30A2\u30ED\u30B0\u3067 godd \u3092\u627F\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" \uFF08\u521D\u56DE\u306F\u627F\u8A8D\u3059\u308B\u307E\u3067\u6709\u52B9\u5316\u3055\u308C\u307E\u305B\u3093\u3002`claude mcp list` \u3067\u72B6\u614B\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF09"),console.log(" 3. Codex: `/mcp` \u3067 godd \u304C\u63A5\u7D9A\u6E08\u307F\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 4. \u30C1\u30E3\u30C3\u30C8\u3067 GoDD MCP \u30C4\u30FC\u30EB\u304C\u4F7F\u3048\u308B\u3088\u3046\u306B\u306A\u308A\u307E\u3059"),console.log(" - godd-dev: \u958B\u767A\u652F\u63F4"),console.log(" - /godd-dev: Cursor / Claude Code \u5171\u901A\u306E\u76F4\u63A5\u30B3\u30DE\u30F3\u30C9"),console.log(" - godd-check: \u30B3\u30FC\u30C9\u30C1\u30A7\u30C3\u30AF"),console.log(" - godd-review: \u30B3\u30FC\u30C9\u30EC\u30D3\u30E5\u30FC"),console.log(" - godd-setup: \u74B0\u5883\u69CB\u7BC9\u652F\u63F4"),console.log(" \u4ED6 12 \u30C4\u30FC\u30EB"),En&&(console.log(` 5. Google \u9023\u643A: IDE / Claude Code \u3092\u518D\u8D77\u52D5\u3057\u3001/mcp \u3067 ${jt} \u304C connected \u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`),console.log(` \uFF08Claude Code \u306F godd \u3068\u540C\u3058\u304F\u521D\u56DE\u306B ${jt} \u306E\u627F\u8A8D\u304C\u5FC5\u8981\u3067\u3059\uFF09`)),y&&(console.log(""),console.log(`\u30ED\u30B0\u30A4\u30F3: Google\uFF08${y.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}\uFF09\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306F .env / MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\u3002`),console.log(` \u30ED\u30B0\u30A4\u30F3\u60C5\u5831: ${jn()}`),console.log(" \u30ED\u30B0\u30A4\u30F3\u304C\u5207\u308C\u305F\u3089 godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002Drive \u3092\u672C\u4EBA\u306E\u6A29\u9650\u3067\u8AAD\u3080\u5834\u5408\u306F godd login --drive \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002")),console.log(""),console.log("\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u63A8\u5968\u8A2D\u5B9A:"),console.log(" \u79D8\u5BC6\u60C5\u5831\u6F0F\u6D29\u9632\u6B62\u306E\u305F\u3081\u3001\u500B\u4EBA\u306E ~/.gitignore_global \u306B\u4EE5\u4E0B\u3092\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u3092\u63A8\u5968\u3057\u307E\u3059:"),console.log(" git config --global core.excludesFile ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json' >> ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json.bak' >> ~/.gitignore_global"),console.log(" echo '.mcp.json' >> ~/.gitignore_global"),console.log(" echo '.mcp.json.bak' >> ~/.gitignore_global"),console.log(""),AC.close()}function Gq(){try{return __goddBundleUrl}catch{return}}var $C,_e,fe,PC,EC,jy,Aq,CC,Rq,TC,Iq,zq,AC,kC,My,Dq,Oq,qC,FC,Zq,jt,JC,Fq,fT=b(()=>{"use strict";$C=yt(require("node:readline"),1),_e=require("node:fs"),fe=require("node:path"),PC=require("node:url"),EC=require("node:os");Ls();Tf();ug();Sy();$y();Mn();Cy();Ci();yp();Kr();Fa();jy=[{id:"",name:"python",category:"language",label:"Python",description:"\u6C4E\u7528\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"typescript",category:"language",label:"TypeScript",description:"\u578B\u5B89\u5168\u306A JavaScript \u30B9\u30FC\u30D1\u30FC\u30BB\u30C3\u30C8"},{id:"",name:"javascript",category:"language",label:"JavaScript",description:"\u52D5\u7684\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E (ES2024+)"},{id:"",name:"go",category:"language",label:"Go",description:"\u9759\u7684\u578B\u4ED8\u3051\u30B3\u30F3\u30D1\u30A4\u30EB\u8A00\u8A9E"},{id:"",name:"php",category:"language",label:"PHP",description:"\u6C4E\u7528\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E"},{id:"",name:"ruby",category:"language",label:"Ruby",description:"\u52D5\u7684\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u6307\u5411\u8A00\u8A9E"},{id:"",name:"c",category:"language",label:"C",description:"\u30B7\u30B9\u30C6\u30E0\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"html",category:"language",label:"HTML",description:"HyperText Markup Language"},{id:"",name:"css",category:"language",label:"CSS",description:"Cascading Style Sheets"},{id:"",name:"react",category:"frontend",label:"React",description:"React UI \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"nextjs",category:"frontend",label:"Next.js",description:"React \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (SSR/SSG/ISR)"},{id:"",name:"vue",category:"frontend",label:"Vue.js",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 JavaScript \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"angular",category:"frontend",label:"Angular",description:"TypeScript \u30D9\u30FC\u30B9 Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"svelte",category:"frontend",label:"Svelte",description:"\u30B3\u30F3\u30D1\u30A4\u30EB\u6642 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"vite",category:"frontend",label:"Vite",description:"\u9AD8\u901F\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB"},{id:"",name:"tailwind",category:"frontend",label:"Tailwind CSS",description:"\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u30D5\u30A1\u30FC\u30B9\u30C8 CSS"},{id:"",name:"sass",category:"frontend",label:"Sass",description:"CSS \u30D7\u30EA\u30D7\u30ED\u30BB\u30C3\u30B5"},{id:"",name:"emotion",category:"frontend",label:"Emotion",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"styled-components",category:"frontend",label:"styled-components",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"mui",category:"frontend",label:"MUI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"chakra-ui",category:"frontend",label:"Chakra UI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"electron",category:"frontend",label:"Electron",description:"\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30A2\u30D7\u30EA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastapi",category:"backend",label:"FastAPI",description:"\u9AD8\u901F Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"django",category:"backend",label:"Django",description:"Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (batteries included)"},{id:"",name:"flask",category:"backend",label:"Flask",description:"Python \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"express",category:"backend",label:"Express",description:"\u6700\u5C0F\u9650\u306E Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastify",category:"backend",label:"Fastify",description:"\u9AD8\u901F Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"nestjs",category:"backend",label:"NestJS",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 Node.js \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"gin",category:"backend",label:"Gin",description:"Go HTTP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"echo",category:"backend",label:"Echo",description:"\u9AD8\u6027\u80FD Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fiber",category:"backend",label:"Fiber",description:"Express \u98A8 Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"laravel",category:"backend",label:"Laravel",description:"PHP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"symfony",category:"backend",label:"Symfony",description:"PHP \u30A8\u30F3\u30BF\u30FC\u30D7\u30E9\u30A4\u30BA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"wordpress",category:"backend",label:"WordPress",description:"PHP CMS \u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"rails",category:"backend",label:"Ruby on Rails",description:"Ruby Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (MVC)"},{id:"",name:"sinatra",category:"backend",label:"Sinatra",description:"Ruby \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"koa",category:"backend",label:"Koa",description:"\u6B21\u4E16\u4EE3 Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"node",category:"runtime",label:"Node.js",description:"config.godd \u767B\u9332\u7528\u306E JavaScript \u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{id:"",name:"agent-stdio",category:"runtime",label:"Agent Stdio",description:"config.godd \u767B\u9332\u7528\u306E MCP Agent stdio \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{id:"",name:"postgresql",category:"database",label:"PostgreSQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mysql",category:"database",label:"MySQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mongodb",category:"database",label:"MongoDB",description:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u6307\u5411 NoSQL DB"},{id:"",name:"redis",category:"database",label:"Redis",description:"\u30A4\u30F3\u30E1\u30E2\u30EA KVS / \u30AD\u30E3\u30C3\u30B7\u30E5"},{id:"",name:"sqlalchemy",category:"backend",label:"SQLAlchemy",description:"Python SQL \u30C4\u30FC\u30EB\u30AD\u30C3\u30C8 + ORM"},{id:"",name:"celery",category:"backend",label:"Celery",description:"\u5206\u6563\u30BF\u30B9\u30AF\u30AD\u30E5\u30FC"},{id:"",name:"docker",category:"infra",label:"Docker",description:"\u30B3\u30F3\u30C6\u30CA\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"terraform",category:"infra",label:"Terraform",description:"IaC \u30C4\u30FC\u30EB (HashiCorp)"},{id:"",name:"ddd-clean-architecture",category:"architecture",label:"DDD / Clean Architecture",description:"\u30C9\u30E1\u30A4\u30F3\u99C6\u52D5\u8A2D\u8A08 + Clean Architecture"}],Aq=[".cursor/mcp.json",".cursor/mcp.json.bak",".mcp.json",".mcp.json.bak",".codex/config.toml",".codex/config.toml.bak",".env",".cursor/commands/godd-dev.md",".claude/commands/godd-dev.md",".agents/skills/godd-dev/SKILL.md"],CC="<!-- GoDD managed command: godd-dev -->",Rq=`${CC}
307
307
  # GoDD \u958B\u767A
308
308
 
309
309
  \u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u6B63\u5F0F\u306A\u958B\u767A\u5165\u53E3\u3067\u3059\u3002
@@ -311,7 +311,7 @@ config.godd \u306E\u4FDD\u5B58\u5148 (default: ${t}): `)||t,qe=jq([...k]);(0,_e.
311
311
  \u3053\u306E\u30B3\u30DE\u30F3\u30C9\u306E\u5F8C\u306B\u5165\u529B\u3055\u308C\u305F\u30E6\u30FC\u30B6\u30FC\u306E\u4F9D\u983C\u3092 \`task\` \u3068\u3057\u3066\u3001GoDD MCP Server \u306E \`godd-dev\` \u30C4\u30FC\u30EB\uFF08\u30E1\u30F3\u30B7\u30E7\u30F3\u8868\u8A18: \`@godd-dev\`\uFF09\u3078\u76F4\u3061\u306B\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002MCP \u30C4\u30FC\u30EB\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u304C\u8FD4\u308B\u524D\u306B\u3001\u81EA\u5206\u3067\u5B9F\u88C5\u30FB\u7DE8\u96C6\u30FB\u30D6\u30E9\u30F3\u30C1\u4F5C\u6210\u3092\u59CB\u3081\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
312
312
 
313
313
  Issue \u756A\u53F7\u3001\u5B8C\u4E86\u6761\u4EF6\u3001\u5236\u7D04\u3001\u56DE\u7B54\u306A\u3069\u3001\u30B3\u30DE\u30F3\u30C9\u306E\u5F8C\u306B\u5165\u529B\u3055\u308C\u305F\u5185\u5BB9\u306F\u7701\u7565\u305B\u305A\u305D\u306E\u307E\u307E \`task\` \u306B\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\`godd-dev\` \u306E\u8FD4\u3057\u305F\u958B\u767A\u30D5\u30ED\u30FC\uFF08\u4ED5\u69D8\u78BA\u8A8D\u3001ATDD\u3001\u5B9F\u88C5\u3001\u54C1\u8CEA\u30B2\u30FC\u30C8\u3001\u8CAC\u52D9\u5225\u30B3\u30DF\u30C3\u30C8\uFF09\u306B\u5F93\u3063\u3066\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
314
- `,TC="<!-- GoDD managed skill: godd-dev -->",Aq=`---
314
+ `,TC="<!-- GoDD managed skill: godd-dev -->",Iq=`---
315
315
  name: godd-dev
316
316
  description: Run the GoDD development workflow for an Issue or implementation request. Use when the user asks to implement an Issue, start development with GoDD, or invokes /godd-dev or $godd-dev.
317
317
  ---
@@ -322,17 +322,17 @@ ${TC}
322
322
  Codex \u306E\u6B63\u5F0F\u306A GoDD \u958B\u767A\u5165\u53E3\u3067\u3059\u3002\u30E6\u30FC\u30B6\u30FC\u306E\u4F9D\u983C\u3092 \`task\` \u3068\u3057\u3066\u3001GoDD MCP Server \u306E \`godd-dev\` \u30C4\u30FC\u30EB\u3092\u6700\u521D\u306B\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002MCP \u30C4\u30FC\u30EB\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u304C\u8FD4\u308B\u524D\u306B\u3001\u81EA\u5206\u3067\u5B9F\u88C5\u30FB\u7DE8\u96C6\u30FB\u30D6\u30E9\u30F3\u30C1\u4F5C\u6210\u3092\u59CB\u3081\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
323
323
 
324
324
  Issue \u756A\u53F7\u3001\u5B8C\u4E86\u6761\u4EF6\u3001\u5236\u7D04\u3001\u56DE\u7B54\u306A\u3069\u3001\u30E6\u30FC\u30B6\u30FC\u304C\u5165\u529B\u3057\u305F\u5185\u5BB9\u306F\u7701\u7565\u305B\u305A \`task\` \u306B\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\`godd-dev\` \u306E\u8FD4\u3057\u305F\u958B\u767A\u30D5\u30ED\u30FC\uFF08\u4ED5\u69D8\u78BA\u8A8D\u3001ATDD\u3001\u5B9F\u88C5\u3001\u54C1\u8CEA\u30B2\u30FC\u30C8\u3001\u8CAC\u52D9\u5225\u30B3\u30DF\u30C3\u30C8\uFF09\u306B\u5F93\u3063\u3066\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
325
- `,Rq=[(0,fe.join)(".cursor","commands","godd-dev.md"),(0,fe.join)(".claude","commands","godd-dev.md")],AC=$C.createInterface({input:process.stdin,output:process.stdout});kC="# GoDD managed Codex MCP configuration";My={language:"\u8A00\u8A9E","frontend-ui":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","frontend-css":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 CSS","frontend-build":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",frontend:"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6","backend-api":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 API \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","backend-orm":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 ORM / DB \u30C4\u30FC\u30EB","backend-task":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u30BF\u30B9\u30AF\u30AD\u30E5\u30FC",backend:"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6",runtime:"\u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\uFF08\u4EFB\u610F\u30FB\u8907\u6570\u53EF\uFF09",database:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",infra:"\u30A4\u30F3\u30D5\u30E9",architecture:"\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3"};Iq={fastapi:["python"],django:["python"],flask:["python"],sqlalchemy:["python"],celery:["python"],express:["typescript","javascript"],fastify:["typescript","javascript"],nestjs:["typescript","javascript"],koa:["typescript","javascript"],gin:["go"],echo:["go"],fiber:["go"],laravel:["php"],symfony:["php"],wordpress:["php"],rails:["ruby"],sinatra:["ruby"],react:["typescript","javascript"],nextjs:["typescript","javascript"],vue:["typescript","javascript"],angular:["typescript","javascript"],svelte:["typescript","javascript"],vite:["typescript","javascript"],electron:["typescript","javascript"],emotion:["typescript","javascript"],"styled-components":["typescript","javascript"],mui:["typescript","javascript"],"chakra-ui":["typescript","javascript"],tailwind:[],sass:[],node:["typescript","javascript"],"agent-stdio":[]},zq={react:"frontend-ui",nextjs:"frontend-ui",vue:"frontend-ui",angular:"frontend-ui",svelte:"frontend-ui",electron:"frontend-ui",mui:"frontend-ui","chakra-ui":"frontend-ui",tailwind:"frontend-css",sass:"frontend-css",emotion:"frontend-css","styled-components":"frontend-css",vite:"frontend-build",fastapi:"backend-api",django:"backend-api",flask:"backend-api",express:"backend-api",fastify:"backend-api",nestjs:"backend-api",gin:"backend-api",echo:"backend-api",fiber:"backend-api",laravel:"backend-api",symfony:"backend-api",wordpress:"backend-api",rails:"backend-api",sinatra:"backend-api",koa:"backend-api",sqlalchemy:"backend-orm",celery:"backend-task"};qC="# GoDD MCP Server (managed by godd init)",FC="# GODD_LICENSE_KEY \u306F\u672A\u8A2D\u5B9A\uFF08godd login \u3067\u4FDD\u5B58\u3057\u305F\u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u7528\uFF09",Mq=new Set([qC,FC]);jt="ripla-google",JC=5e3;Uq=new Set(["google","g"]);mu(process.env,process.argv[1],qq())&&pT().catch(e=>{console.error("\u30A8\u30E9\u30FC:",e),process.exit(1)})});function vp(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function hT(e=fetch,t){return t?async(r,n)=>{let o={...t,...n,headers:n?.headers?{...vp(t.headers),...vp(n.headers)}:t.headers};return e(r,o)}:e}var mT=b(()=>{});async function Fq(e){return(await Zy).getRandomValues(new Uint8Array(e))}async function Gq(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,n="";for(;n.length<e;){let o=await Fq(e-n.length);for(let i of o)i<r&&(n+=t[i%t.length])}return n}async function Bq(e){return await Gq(e)}async function Vq(e){let t=await(await Zy).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Uy(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await Bq(e),r=await Vq(t);return{code_verifier:t,code_challenge:r}}var Zy,gT=b(()=>{Zy=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(e=>e.webcrypto)});var gt,_T,qy,Hq,vT,wT,bT,yT,Wq,Kq,xT,xee,kee,Fy=b(()=>{jd();gt=Ob().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Vb.custom,message:"URL must be parseable",fatal:!0}),dc}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),_T=Xe({resource:_().url(),authorization_servers:T(gt).optional(),jwks_uri:_().url().optional(),scopes_supported:T(_()).optional(),bearer_methods_supported:T(_()).optional(),resource_signing_alg_values_supported:T(_()).optional(),resource_name:_().optional(),resource_documentation:_().optional(),resource_policy_uri:_().url().optional(),resource_tos_uri:_().url().optional(),tls_client_certificate_bound_access_tokens:be().optional(),authorization_details_types_supported:T(_()).optional(),dpop_signing_alg_values_supported:T(_()).optional(),dpop_bound_access_tokens_required:be().optional()}),qy=Xe({issuer:_(),authorization_endpoint:gt,token_endpoint:gt,registration_endpoint:gt.optional(),scopes_supported:T(_()).optional(),response_types_supported:T(_()),response_modes_supported:T(_()).optional(),grant_types_supported:T(_()).optional(),token_endpoint_auth_methods_supported:T(_()).optional(),token_endpoint_auth_signing_alg_values_supported:T(_()).optional(),service_documentation:gt.optional(),revocation_endpoint:gt.optional(),revocation_endpoint_auth_methods_supported:T(_()).optional(),revocation_endpoint_auth_signing_alg_values_supported:T(_()).optional(),introspection_endpoint:_().optional(),introspection_endpoint_auth_methods_supported:T(_()).optional(),introspection_endpoint_auth_signing_alg_values_supported:T(_()).optional(),code_challenge_methods_supported:T(_()).optional(),client_id_metadata_document_supported:be().optional()}),Hq=Xe({issuer:_(),authorization_endpoint:gt,token_endpoint:gt,userinfo_endpoint:gt.optional(),jwks_uri:gt,registration_endpoint:gt.optional(),scopes_supported:T(_()).optional(),response_types_supported:T(_()),response_modes_supported:T(_()).optional(),grant_types_supported:T(_()).optional(),acr_values_supported:T(_()).optional(),subject_types_supported:T(_()),id_token_signing_alg_values_supported:T(_()),id_token_encryption_alg_values_supported:T(_()).optional(),id_token_encryption_enc_values_supported:T(_()).optional(),userinfo_signing_alg_values_supported:T(_()).optional(),userinfo_encryption_alg_values_supported:T(_()).optional(),userinfo_encryption_enc_values_supported:T(_()).optional(),request_object_signing_alg_values_supported:T(_()).optional(),request_object_encryption_alg_values_supported:T(_()).optional(),request_object_encryption_enc_values_supported:T(_()).optional(),token_endpoint_auth_methods_supported:T(_()).optional(),token_endpoint_auth_signing_alg_values_supported:T(_()).optional(),display_values_supported:T(_()).optional(),claim_types_supported:T(_()).optional(),claims_supported:T(_()).optional(),service_documentation:_().optional(),claims_locales_supported:T(_()).optional(),ui_locales_supported:T(_()).optional(),claims_parameter_supported:be().optional(),request_parameter_supported:be().optional(),request_uri_parameter_supported:be().optional(),require_request_uri_registration:be().optional(),op_policy_uri:gt.optional(),op_tos_uri:gt.optional(),client_id_metadata_document_supported:be().optional()}),vT=A({...Hq.shape,...qy.pick({code_challenge_methods_supported:!0}).shape}),wT=A({access_token:_(),id_token:_().optional(),token_type:_(),expires_in:Dc.number().optional(),scope:_().optional(),refresh_token:_().optional()}).strip(),bT=A({error:_(),error_description:_().optional(),error_uri:_().optional()}),yT=gt.optional().or(O("").transform(()=>{})),Wq=A({redirect_uris:T(gt),token_endpoint_auth_method:_().optional(),grant_types:T(_()).optional(),response_types:T(_()).optional(),client_name:_().optional(),client_uri:gt.optional(),logo_uri:yT,scope:_().optional(),contacts:T(_()).optional(),tos_uri:yT,policy_uri:_().optional(),jwks_uri:gt.optional(),jwks:jb().optional(),software_id:_().optional(),software_version:_().optional(),software_statement:_().optional()}).strip(),Kq=A({client_id:_(),client_secret:_().optional(),client_id_issued_at:de().optional(),client_secret_expires_at:de().optional()}).strip(),xT=Wq.merge(Kq),xee=A({error:_(),error_description:_().optional()}).strip(),kee=A({token:_(),token_type_hint:_().optional()}).strip()});function kT(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function ST({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),n=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;let o=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return o.startsWith(i)}var $T=b(()=>{});var Ge,Ga,Qo,Xo,ei,Ba,Va,Ha,Sn,Wa,Ka,Ja,Ya,Qa,Xa,ti,ec,tc,PT,ET=b(()=>{Ge=class extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}},Ga=class extends Ge{};Ga.errorCode="invalid_request";Qo=class extends Ge{};Qo.errorCode="invalid_client";Xo=class extends Ge{};Xo.errorCode="invalid_grant";ei=class extends Ge{};ei.errorCode="unauthorized_client";Ba=class extends Ge{};Ba.errorCode="unsupported_grant_type";Va=class extends Ge{};Va.errorCode="invalid_scope";Ha=class extends Ge{};Ha.errorCode="access_denied";Sn=class extends Ge{};Sn.errorCode="server_error";Wa=class extends Ge{};Wa.errorCode="temporarily_unavailable";Ka=class extends Ge{};Ka.errorCode="unsupported_response_type";Ja=class extends Ge{};Ja.errorCode="unsupported_token_type";Ya=class extends Ge{};Ya.errorCode="invalid_token";Qa=class extends Ge{};Qa.errorCode="method_not_allowed";Xa=class extends Ge{};Xa.errorCode="too_many_requests";ti=class extends Ge{};ti.errorCode="invalid_client_metadata";ec=class extends Ge{};ec.errorCode="insufficient_scope";tc=class extends Ge{};tc.errorCode="invalid_target";PT={[Ga.errorCode]:Ga,[Qo.errorCode]:Qo,[Xo.errorCode]:Xo,[ei.errorCode]:ei,[Ba.errorCode]:Ba,[Va.errorCode]:Va,[Ha.errorCode]:Ha,[Sn.errorCode]:Sn,[Wa.errorCode]:Wa,[Ka.errorCode]:Ka,[Ja.errorCode]:Ja,[Ya.errorCode]:Ya,[Qa.errorCode]:Qa,[Xa.errorCode]:Xa,[ti.errorCode]:ti,[ec.errorCode]:ec,[tc.errorCode]:tc}});function Jq(e){return["client_secret_basic","client_secret_post","none"].includes(e)}function Yq(e,t){let r=e.client_secret!==void 0;return t.length===0?r?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Jq(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function Qq(e,t,r,n){let{client_id:o,client_secret:i}=t;switch(e){case"client_secret_basic":Xq(o,i,r);return;case"client_secret_post":eF(o,i,n);return;case"none":tF(o,n);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function Xq(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");let n=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${n}`)}function eF(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function tF(e,t){t.set("client_id",e)}async function TT(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let n=bT.parse(JSON.parse(r)),{error:o,error_description:i,error_uri:s}=n,a=PT[o]||Sn;return new a(i||"",s)}catch(n){let o=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new Sn(o)}}async function rc(e,t){try{return await Vy(e,t)}catch(r){if(r instanceof Qo||r instanceof ei)return await e.invalidateCredentials?.("all"),await Vy(e,t);if(r instanceof Xo)return await e.invalidateCredentials?.("tokens"),await Vy(e,t);throw r}}async function Vy(e,{serverUrl:t,authorizationCode:r,scope:n,resourceMetadataUrl:o,fetchFn:i}){let s,a;try{s=await oF(t,{resourceMetadataUrl:o},i),s.authorization_servers&&s.authorization_servers.length>0&&(a=s.authorization_servers[0])}catch{}a||(a=new URL("/",t));let c=await nF(t,e,s),u=await uF(a,{fetchFn:i}),p=await Promise.resolve(e.clientInformation());if(!p){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let y=u?.client_id_metadata_document_supported===!0,v=e.clientMetadataUrl;if(v&&!rF(v))throw new ti(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${v}`);if(y&&v)p={client_id:v},await e.saveClientInformation?.(p);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let x=await hF(a,{metadata:u,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(x),p=x}}let l=!e.redirectUrl;if(r!==void 0||l){let y=await fF(e,a,{metadata:u,resource:c,authorizationCode:r,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}let d=await e.tokens();if(d?.refresh_token)try{let y=await dF(a,{metadata:u,clientInformation:p,refreshToken:d.refresh_token,resource:c,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}catch(y){if(!(!(y instanceof Ge)||y instanceof Sn))throw y}let f=e.state?await e.state():void 0,{authorizationUrl:h,codeVerifier:g}=await lF(a,{metadata:u,clientInformation:p,state:f,redirectUrl:e.redirectUrl,scope:n||s?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:c});return await e.saveCodeVerifier(g),await e.redirectToAuthorization(h),"REDIRECT"}function rF(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function nF(e,t,r){let n=kT(e);if(t.validateResourceURL)return await t.validateResourceURL(n,r?.resource);if(r){if(!ST({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function Wy(e){let t=e.headers.get("WWW-Authenticate");if(!t)return{};let[r,n]=t.split(" ");if(r.toLowerCase()!=="bearer"||!n)return{};let o=Hy(e,"resource_metadata")||void 0,i;if(o)try{i=new URL(o)}catch{}let s=Hy(e,"scope")||void 0,a=Hy(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:a}}function Hy(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let n=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),o=r.match(n);return o?o[1]||o[2]:null}async function oF(e,t,r=fetch){let n=await aF(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!n||n.status===404)throw await n?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw await n.body?.cancel(),new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return _T.parse(await n.json())}async function Ky(e,t,r=fetch){try{return await r(e,{headers:t})}catch(n){if(n instanceof TypeError)return t?Ky(e,void 0,r):void 0;throw n}}function iF(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function CT(e,t,r=fetch){return await Ky(e,{"MCP-Protocol-Version":t},r)}function sF(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function aF(e,t,r,n){let o=new URL(e),i=n?.protocolVersion??li,s;if(n?.metadataUrl)s=new URL(n.metadataUrl);else{let c=iF(t,o.pathname);s=new URL(c,n?.metadataServerUrl??o),s.search=o.search}let a=await CT(s,i,r);if(!n?.metadataUrl&&sF(a,o.pathname)){let c=new URL(`/.well-known/${t}`,o);a=await CT(c,i,r)}return a}function cF(e){let t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),n;let o=t.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,t.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,t.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,t.origin),type:"oidc"}),n}async function uF(e,{fetchFn:t=fetch,protocolVersion:r=li}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=cF(e);for(let{url:i,type:s}of o){let a=await Ky(i,n,t);if(a){if(!a.ok){if(await a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?qy.parse(await a.json()):vT.parse(await a.json())}}}async function lF(e,{metadata:t,clientInformation:r,redirectUrl:n,scope:o,state:i,resource:s}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Gy))throw new Error(`Incompatible auth server: does not support response type ${Gy}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(By))throw new Error(`Incompatible auth server: does not support code challenge method ${By}`)}else a=new URL("/authorize",e);let c=await Uy(),u=c.code_verifier,p=c.code_challenge;return a.searchParams.set("response_type",Gy),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",p),a.searchParams.set("code_challenge_method",By),a.searchParams.set("redirect_uri",String(n)),i&&a.searchParams.set("state",i),o&&a.searchParams.set("scope",o),o?.includes("offline_access")&&a.searchParams.append("prompt","consent"),s&&a.searchParams.set("resource",s.href),{authorizationUrl:a,codeVerifier:u}}function pF(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}async function AT(e,{metadata:t,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:i,fetchFn:s}){let a=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&r.set("resource",i.href),o)await o(c,r,a,t);else if(n){let p=t?.token_endpoint_auth_methods_supported??[],l=Yq(n,p);Qq(l,n,c,r)}let u=await(s??fetch)(a,{method:"POST",headers:c,body:r});if(!u.ok)throw await TT(u);return wT.parse(await u.json())}async function dF(e,{metadata:t,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:i,fetchFn:s}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),c=await AT(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:i,resource:o,fetchFn:s});return{refresh_token:n,...c}}async function fF(e,t,{metadata:r,resource:n,authorizationCode:o,fetchFn:i}={}){let s=e.clientMetadata.scope,a;if(e.prepareTokenRequest&&(a=await e.prepareTokenRequest(s)),!a){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let u=await e.codeVerifier();a=pF(o,u,e.redirectUrl)}let c=await e.clientInformation();return AT(t,{metadata:r,tokenRequestParams:a,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:n,fetchFn:i})}async function hF(e,{metadata:t,clientMetadata:r,fetchFn:n}){let o;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");o=new URL(t.registration_endpoint)}else o=new URL("/register",e);let i=await(n??fetch)(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw await TT(i);return xT.parse(await i.json())}var $n,Gy,By,RT=b(()=>{gT();An();Fy();Fy();$T();ET();$n=class extends Error{constructor(t){super(t??"Unauthorized")}};Gy="code",By="S256"});function Jy(e){}function IT(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=Jy,onError:r=Jy,onRetry:n=Jy,onComment:o}=e,i="",s=!0,a,c="",u="";function p(g){let y=s?g.replace(/^\xEF\xBB\xBF/,""):g,[v,w]=mF(`${i}${y}`);for(let x of v)l(x);i=w,s=!1}function l(g){if(g===""){f();return}if(g.startsWith(":")){o&&o(g.slice(g.startsWith(": ")?2:1));return}let y=g.indexOf(":");if(y!==-1){let v=g.slice(0,y),w=g[y+1]===" "?2:1,x=g.slice(y+w);d(v,x,g);return}d(g,"",g)}function d(g,y,v){switch(g){case"event":u=y;break;case"data":c=`${c}${y}
325
+ `,zq=[(0,fe.join)(".cursor","commands","godd-dev.md"),(0,fe.join)(".claude","commands","godd-dev.md")],AC=$C.createInterface({input:process.stdin,output:process.stdout});kC="# GoDD managed Codex MCP configuration";My={language:"\u8A00\u8A9E","frontend-ui":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","frontend-css":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 CSS","frontend-build":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",frontend:"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6","backend-api":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 API \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","backend-orm":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 ORM / DB \u30C4\u30FC\u30EB","backend-task":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u30BF\u30B9\u30AF\u30AD\u30E5\u30FC",backend:"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6",runtime:"\u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\uFF08\u4EFB\u610F\u30FB\u8907\u6570\u53EF\uFF09",database:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",infra:"\u30A4\u30F3\u30D5\u30E9",architecture:"\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3"};Dq={fastapi:["python"],django:["python"],flask:["python"],sqlalchemy:["python"],celery:["python"],express:["typescript","javascript"],fastify:["typescript","javascript"],nestjs:["typescript","javascript"],koa:["typescript","javascript"],gin:["go"],echo:["go"],fiber:["go"],laravel:["php"],symfony:["php"],wordpress:["php"],rails:["ruby"],sinatra:["ruby"],react:["typescript","javascript"],nextjs:["typescript","javascript"],vue:["typescript","javascript"],angular:["typescript","javascript"],svelte:["typescript","javascript"],vite:["typescript","javascript"],electron:["typescript","javascript"],emotion:["typescript","javascript"],"styled-components":["typescript","javascript"],mui:["typescript","javascript"],"chakra-ui":["typescript","javascript"],tailwind:[],sass:[],node:["typescript","javascript"],"agent-stdio":[]},Oq={react:"frontend-ui",nextjs:"frontend-ui",vue:"frontend-ui",angular:"frontend-ui",svelte:"frontend-ui",electron:"frontend-ui",mui:"frontend-ui","chakra-ui":"frontend-ui",tailwind:"frontend-css",sass:"frontend-css",emotion:"frontend-css","styled-components":"frontend-css",vite:"frontend-build",fastapi:"backend-api",django:"backend-api",flask:"backend-api",express:"backend-api",fastify:"backend-api",nestjs:"backend-api",gin:"backend-api",echo:"backend-api",fiber:"backend-api",laravel:"backend-api",symfony:"backend-api",wordpress:"backend-api",rails:"backend-api",sinatra:"backend-api",koa:"backend-api",sqlalchemy:"backend-orm",celery:"backend-task"};qC="# GoDD MCP Server (managed by godd init)",FC="# GODD_LICENSE_KEY \u306F\u672A\u8A2D\u5B9A\uFF08godd login \u3067\u4FDD\u5B58\u3057\u305F\u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u7528\uFF09",Zq=new Set([qC,FC]);jt="ripla-google",JC=5e3;Fq=new Set(["google","g"]);mu(process.env,process.argv[1],Gq())&&pT().catch(e=>{console.error("\u30A8\u30E9\u30FC:",e),process.exit(1)})});function vp(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function hT(e=fetch,t){return t?async(r,n)=>{let o={...t,...n,headers:n?.headers?{...vp(t.headers),...vp(n.headers)}:t.headers};return e(r,o)}:e}var mT=b(()=>{});async function Bq(e){return(await Zy).getRandomValues(new Uint8Array(e))}async function Vq(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,n="";for(;n.length<e;){let o=await Bq(e-n.length);for(let i of o)i<r&&(n+=t[i%t.length])}return n}async function Hq(e){return await Vq(e)}async function Wq(e){let t=await(await Zy).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Uy(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await Hq(e),r=await Wq(t);return{code_verifier:t,code_challenge:r}}var Zy,gT=b(()=>{Zy=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(e=>e.webcrypto)});var gt,_T,qy,Kq,vT,wT,bT,yT,Jq,Yq,xT,See,$ee,Fy=b(()=>{jd();gt=Ob().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Vb.custom,message:"URL must be parseable",fatal:!0}),dc}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),_T=Xe({resource:_().url(),authorization_servers:T(gt).optional(),jwks_uri:_().url().optional(),scopes_supported:T(_()).optional(),bearer_methods_supported:T(_()).optional(),resource_signing_alg_values_supported:T(_()).optional(),resource_name:_().optional(),resource_documentation:_().optional(),resource_policy_uri:_().url().optional(),resource_tos_uri:_().url().optional(),tls_client_certificate_bound_access_tokens:be().optional(),authorization_details_types_supported:T(_()).optional(),dpop_signing_alg_values_supported:T(_()).optional(),dpop_bound_access_tokens_required:be().optional()}),qy=Xe({issuer:_(),authorization_endpoint:gt,token_endpoint:gt,registration_endpoint:gt.optional(),scopes_supported:T(_()).optional(),response_types_supported:T(_()),response_modes_supported:T(_()).optional(),grant_types_supported:T(_()).optional(),token_endpoint_auth_methods_supported:T(_()).optional(),token_endpoint_auth_signing_alg_values_supported:T(_()).optional(),service_documentation:gt.optional(),revocation_endpoint:gt.optional(),revocation_endpoint_auth_methods_supported:T(_()).optional(),revocation_endpoint_auth_signing_alg_values_supported:T(_()).optional(),introspection_endpoint:_().optional(),introspection_endpoint_auth_methods_supported:T(_()).optional(),introspection_endpoint_auth_signing_alg_values_supported:T(_()).optional(),code_challenge_methods_supported:T(_()).optional(),client_id_metadata_document_supported:be().optional()}),Kq=Xe({issuer:_(),authorization_endpoint:gt,token_endpoint:gt,userinfo_endpoint:gt.optional(),jwks_uri:gt,registration_endpoint:gt.optional(),scopes_supported:T(_()).optional(),response_types_supported:T(_()),response_modes_supported:T(_()).optional(),grant_types_supported:T(_()).optional(),acr_values_supported:T(_()).optional(),subject_types_supported:T(_()),id_token_signing_alg_values_supported:T(_()),id_token_encryption_alg_values_supported:T(_()).optional(),id_token_encryption_enc_values_supported:T(_()).optional(),userinfo_signing_alg_values_supported:T(_()).optional(),userinfo_encryption_alg_values_supported:T(_()).optional(),userinfo_encryption_enc_values_supported:T(_()).optional(),request_object_signing_alg_values_supported:T(_()).optional(),request_object_encryption_alg_values_supported:T(_()).optional(),request_object_encryption_enc_values_supported:T(_()).optional(),token_endpoint_auth_methods_supported:T(_()).optional(),token_endpoint_auth_signing_alg_values_supported:T(_()).optional(),display_values_supported:T(_()).optional(),claim_types_supported:T(_()).optional(),claims_supported:T(_()).optional(),service_documentation:_().optional(),claims_locales_supported:T(_()).optional(),ui_locales_supported:T(_()).optional(),claims_parameter_supported:be().optional(),request_parameter_supported:be().optional(),request_uri_parameter_supported:be().optional(),require_request_uri_registration:be().optional(),op_policy_uri:gt.optional(),op_tos_uri:gt.optional(),client_id_metadata_document_supported:be().optional()}),vT=A({...Kq.shape,...qy.pick({code_challenge_methods_supported:!0}).shape}),wT=A({access_token:_(),id_token:_().optional(),token_type:_(),expires_in:Dc.number().optional(),scope:_().optional(),refresh_token:_().optional()}).strip(),bT=A({error:_(),error_description:_().optional(),error_uri:_().optional()}),yT=gt.optional().or(O("").transform(()=>{})),Jq=A({redirect_uris:T(gt),token_endpoint_auth_method:_().optional(),grant_types:T(_()).optional(),response_types:T(_()).optional(),client_name:_().optional(),client_uri:gt.optional(),logo_uri:yT,scope:_().optional(),contacts:T(_()).optional(),tos_uri:yT,policy_uri:_().optional(),jwks_uri:gt.optional(),jwks:jb().optional(),software_id:_().optional(),software_version:_().optional(),software_statement:_().optional()}).strip(),Yq=A({client_id:_(),client_secret:_().optional(),client_id_issued_at:de().optional(),client_secret_expires_at:de().optional()}).strip(),xT=Jq.merge(Yq),See=A({error:_(),error_description:_().optional()}).strip(),$ee=A({token:_(),token_type_hint:_().optional()}).strip()});function kT(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function ST({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),n=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;let o=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return o.startsWith(i)}var $T=b(()=>{});var Ge,Ga,Qo,Xo,ei,Ba,Va,Ha,Sn,Wa,Ka,Ja,Ya,Qa,Xa,ti,ec,tc,PT,ET=b(()=>{Ge=class extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}},Ga=class extends Ge{};Ga.errorCode="invalid_request";Qo=class extends Ge{};Qo.errorCode="invalid_client";Xo=class extends Ge{};Xo.errorCode="invalid_grant";ei=class extends Ge{};ei.errorCode="unauthorized_client";Ba=class extends Ge{};Ba.errorCode="unsupported_grant_type";Va=class extends Ge{};Va.errorCode="invalid_scope";Ha=class extends Ge{};Ha.errorCode="access_denied";Sn=class extends Ge{};Sn.errorCode="server_error";Wa=class extends Ge{};Wa.errorCode="temporarily_unavailable";Ka=class extends Ge{};Ka.errorCode="unsupported_response_type";Ja=class extends Ge{};Ja.errorCode="unsupported_token_type";Ya=class extends Ge{};Ya.errorCode="invalid_token";Qa=class extends Ge{};Qa.errorCode="method_not_allowed";Xa=class extends Ge{};Xa.errorCode="too_many_requests";ti=class extends Ge{};ti.errorCode="invalid_client_metadata";ec=class extends Ge{};ec.errorCode="insufficient_scope";tc=class extends Ge{};tc.errorCode="invalid_target";PT={[Ga.errorCode]:Ga,[Qo.errorCode]:Qo,[Xo.errorCode]:Xo,[ei.errorCode]:ei,[Ba.errorCode]:Ba,[Va.errorCode]:Va,[Ha.errorCode]:Ha,[Sn.errorCode]:Sn,[Wa.errorCode]:Wa,[Ka.errorCode]:Ka,[Ja.errorCode]:Ja,[Ya.errorCode]:Ya,[Qa.errorCode]:Qa,[Xa.errorCode]:Xa,[ti.errorCode]:ti,[ec.errorCode]:ec,[tc.errorCode]:tc}});function Qq(e){return["client_secret_basic","client_secret_post","none"].includes(e)}function Xq(e,t){let r=e.client_secret!==void 0;return t.length===0?r?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Qq(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function eF(e,t,r,n){let{client_id:o,client_secret:i}=t;switch(e){case"client_secret_basic":tF(o,i,r);return;case"client_secret_post":rF(o,i,n);return;case"none":nF(o,n);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function tF(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");let n=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${n}`)}function rF(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function nF(e,t){t.set("client_id",e)}async function TT(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let n=bT.parse(JSON.parse(r)),{error:o,error_description:i,error_uri:s}=n,a=PT[o]||Sn;return new a(i||"",s)}catch(n){let o=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new Sn(o)}}async function rc(e,t){try{return await Vy(e,t)}catch(r){if(r instanceof Qo||r instanceof ei)return await e.invalidateCredentials?.("all"),await Vy(e,t);if(r instanceof Xo)return await e.invalidateCredentials?.("tokens"),await Vy(e,t);throw r}}async function Vy(e,{serverUrl:t,authorizationCode:r,scope:n,resourceMetadataUrl:o,fetchFn:i}){let s,a;try{s=await sF(t,{resourceMetadataUrl:o},i),s.authorization_servers&&s.authorization_servers.length>0&&(a=s.authorization_servers[0])}catch{}a||(a=new URL("/",t));let c=await iF(t,e,s),u=await pF(a,{fetchFn:i}),p=await Promise.resolve(e.clientInformation());if(!p){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let y=u?.client_id_metadata_document_supported===!0,v=e.clientMetadataUrl;if(v&&!oF(v))throw new ti(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${v}`);if(y&&v)p={client_id:v},await e.saveClientInformation?.(p);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let x=await gF(a,{metadata:u,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(x),p=x}}let l=!e.redirectUrl;if(r!==void 0||l){let y=await mF(e,a,{metadata:u,resource:c,authorizationCode:r,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}let d=await e.tokens();if(d?.refresh_token)try{let y=await hF(a,{metadata:u,clientInformation:p,refreshToken:d.refresh_token,resource:c,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}catch(y){if(!(!(y instanceof Ge)||y instanceof Sn))throw y}let f=e.state?await e.state():void 0,{authorizationUrl:h,codeVerifier:g}=await dF(a,{metadata:u,clientInformation:p,state:f,redirectUrl:e.redirectUrl,scope:n||s?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:c});return await e.saveCodeVerifier(g),await e.redirectToAuthorization(h),"REDIRECT"}function oF(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function iF(e,t,r){let n=kT(e);if(t.validateResourceURL)return await t.validateResourceURL(n,r?.resource);if(r){if(!ST({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function Wy(e){let t=e.headers.get("WWW-Authenticate");if(!t)return{};let[r,n]=t.split(" ");if(r.toLowerCase()!=="bearer"||!n)return{};let o=Hy(e,"resource_metadata")||void 0,i;if(o)try{i=new URL(o)}catch{}let s=Hy(e,"scope")||void 0,a=Hy(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:a}}function Hy(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let n=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),o=r.match(n);return o?o[1]||o[2]:null}async function sF(e,t,r=fetch){let n=await uF(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!n||n.status===404)throw await n?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw await n.body?.cancel(),new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return _T.parse(await n.json())}async function Ky(e,t,r=fetch){try{return await r(e,{headers:t})}catch(n){if(n instanceof TypeError)return t?Ky(e,void 0,r):void 0;throw n}}function aF(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function CT(e,t,r=fetch){return await Ky(e,{"MCP-Protocol-Version":t},r)}function cF(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function uF(e,t,r,n){let o=new URL(e),i=n?.protocolVersion??li,s;if(n?.metadataUrl)s=new URL(n.metadataUrl);else{let c=aF(t,o.pathname);s=new URL(c,n?.metadataServerUrl??o),s.search=o.search}let a=await CT(s,i,r);if(!n?.metadataUrl&&cF(a,o.pathname)){let c=new URL(`/.well-known/${t}`,o);a=await CT(c,i,r)}return a}function lF(e){let t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),n;let o=t.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,t.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,t.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,t.origin),type:"oidc"}),n}async function pF(e,{fetchFn:t=fetch,protocolVersion:r=li}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=lF(e);for(let{url:i,type:s}of o){let a=await Ky(i,n,t);if(a){if(!a.ok){if(await a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?qy.parse(await a.json()):vT.parse(await a.json())}}}async function dF(e,{metadata:t,clientInformation:r,redirectUrl:n,scope:o,state:i,resource:s}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Gy))throw new Error(`Incompatible auth server: does not support response type ${Gy}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(By))throw new Error(`Incompatible auth server: does not support code challenge method ${By}`)}else a=new URL("/authorize",e);let c=await Uy(),u=c.code_verifier,p=c.code_challenge;return a.searchParams.set("response_type",Gy),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",p),a.searchParams.set("code_challenge_method",By),a.searchParams.set("redirect_uri",String(n)),i&&a.searchParams.set("state",i),o&&a.searchParams.set("scope",o),o?.includes("offline_access")&&a.searchParams.append("prompt","consent"),s&&a.searchParams.set("resource",s.href),{authorizationUrl:a,codeVerifier:u}}function fF(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}async function AT(e,{metadata:t,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:i,fetchFn:s}){let a=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&r.set("resource",i.href),o)await o(c,r,a,t);else if(n){let p=t?.token_endpoint_auth_methods_supported??[],l=Xq(n,p);eF(l,n,c,r)}let u=await(s??fetch)(a,{method:"POST",headers:c,body:r});if(!u.ok)throw await TT(u);return wT.parse(await u.json())}async function hF(e,{metadata:t,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:i,fetchFn:s}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),c=await AT(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:i,resource:o,fetchFn:s});return{refresh_token:n,...c}}async function mF(e,t,{metadata:r,resource:n,authorizationCode:o,fetchFn:i}={}){let s=e.clientMetadata.scope,a;if(e.prepareTokenRequest&&(a=await e.prepareTokenRequest(s)),!a){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let u=await e.codeVerifier();a=fF(o,u,e.redirectUrl)}let c=await e.clientInformation();return AT(t,{metadata:r,tokenRequestParams:a,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:n,fetchFn:i})}async function gF(e,{metadata:t,clientMetadata:r,fetchFn:n}){let o;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");o=new URL(t.registration_endpoint)}else o=new URL("/register",e);let i=await(n??fetch)(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw await TT(i);return xT.parse(await i.json())}var $n,Gy,By,RT=b(()=>{gT();An();Fy();Fy();$T();ET();$n=class extends Error{constructor(t){super(t??"Unauthorized")}};Gy="code",By="S256"});function Jy(e){}function IT(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=Jy,onError:r=Jy,onRetry:n=Jy,onComment:o}=e,i="",s=!0,a,c="",u="";function p(g){let y=s?g.replace(/^\xEF\xBB\xBF/,""):g,[v,w]=yF(`${i}${y}`);for(let x of v)l(x);i=w,s=!1}function l(g){if(g===""){f();return}if(g.startsWith(":")){o&&o(g.slice(g.startsWith(": ")?2:1));return}let y=g.indexOf(":");if(y!==-1){let v=g.slice(0,y),w=g[y+1]===" "?2:1,x=g.slice(y+w);d(v,x,g);return}d(g,"",g)}function d(g,y,v){switch(g){case"event":u=y;break;case"data":c=`${c}${y}
326
326
  `;break;case"id":a=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?n(parseInt(y,10)):r(new wp(`Invalid \`retry\` value: "${y}"`,{type:"invalid-retry",value:y,line:v}));break;default:r(new wp(`Unknown field "${g.length>20?`${g.slice(0,20)}\u2026`:g}"`,{type:"unknown-field",field:g,value:y,line:v}));break}}function f(){c.length>0&&t({id:a,event:u||void 0,data:c.endsWith(`
327
- `)?c.slice(0,-1):c}),a=void 0,c="",u=""}function h(g={}){i&&g.consume&&l(i),s=!0,a=void 0,c="",u="",i=""}return{feed:p,reset:h}}function mF(e){let t=[],r="",n=0;for(;n<e.length;){let o=e.indexOf("\r",n),i=e.indexOf(`
327
+ `)?c.slice(0,-1):c}),a=void 0,c="",u=""}function h(g={}){i&&g.consume&&l(i),s=!0,a=void 0,c="",u="",i=""}return{feed:p,reset:h}}function yF(e){let t=[],r="",n=0;for(;n<e.length;){let o=e.indexOf("\r",n),i=e.indexOf(`
328
328
  `,n),s=-1;if(o!==-1&&i!==-1?s=Math.min(o,i):o!==-1?o===e.length-1?s=-1:s=o:i!==-1&&(s=i),s===-1){r=e.slice(n);break}else{let a=e.slice(n,s);t.push(a),n=s+1,e[n-1]==="\r"&&e[n]===`
329
- `&&n++}}return[t,r]}var wp,zT=b(()=>{wp=class extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}});var bp,DT=b(()=>{zT();bp=class extends TransformStream{constructor({onError:t,onRetry:r,onComment:n}={}){let o;super({start(i){o=IT({onEvent:s=>{i.enqueue(s)},onError(s){t==="terminate"?i.error(s):typeof t=="function"&&t(s)},onRetry:r,onComment:n})},transform(i){o.feed(i)}})}}});var gF,oo,xp,OT=b(()=>{mT();An();RT();DT();gF={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},oo=class extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}},xp=class{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=hT(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??gF}async _authThenStart(){if(!this._authProvider)throw new $n("No auth provider");let t;try{t=await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new $n;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let t={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(t.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=vp(this._requestInit?.headers);return new Headers({...t,...r})}async _startOrAuthSse(t){let{resumptionToken:r}=t;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new oo(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,t,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,t),o)}_scheduleReconnection(t,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,r+1)})},o)}_handleSseStream(t,r,n){if(!t)return;let{onresumptiontoken:o,replayMessageId:i}=r,s,a=!1,c=!1;(async()=>{try{let p=t.pipeThrough(new TextDecoderStream).pipeThrough(new bp({onRetry:f=>{this._serverRetryMs=f}})).getReader();for(;;){let{value:f,done:h}=await p.read();if(h)break;if(f.id&&(s=f.id,a=!0,o?.(f.id)),!!f.data&&(!f.event||f.event==="message"))try{let g=pi.parse(JSON.parse(f.data));mo(g)&&(c=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(p){if(this.onerror?.(new Error(`SSE stream disconnected: ${p}`)),(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(f){this.onerror?.(new Error(`Failed to reconnect: ${f instanceof Error?f.message:String(f)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new $n("No auth provider");if(await rc(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $n("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:ho(t)?t.id:void 0}).catch(d=>this.onerror?.(d));return}let i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");let s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._url,s),c=a.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!a.ok){let d=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new oo(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:f,scope:h}=Wy(a);if(this._resourceMetadataUrl=f,this._scope=h,await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $n;return this._hasCompletedAuthFlow=!0,this.send(t)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:f,scope:h,error:g}=Wy(a);if(g==="insufficient_scope"){let y=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===y)throw new oo(403,"Server returned 403 after trying upscoping");if(h&&(this._scope=h),f&&(this._resourceMetadataUrl=f),this._lastUpscopingHeader=y??void 0,await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new $n;return this.send(t)}}throw new oo(a.status,`Error POSTing to endpoint: ${d}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),a0(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(d=>this.onerror?.(d));return}let p=(Array.isArray(t)?t:[t]).filter(d=>"method"in d&&"id"in d&&d.id!==void 0).length>0,l=a.headers.get("content-type");if(p)if(l?.includes("text/event-stream"))this._handleSseStream(a.body,{onresumptiontoken:o},!1);else if(l?.includes("application/json")){let d=await a.json(),f=Array.isArray(d)?d.map(h=>pi.parse(h)):[pi.parse(d)];for(let h of f)this.onmessage?.(h)}else throw await a.body?.cancel(),new oo(-1,`Unexpected content type: ${l}`);else await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new oo(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}}});var LT={};tr(LT,{RelayAuthError:()=>io,resolveRelayToken:()=>NT,resolveRelayUrl:()=>jT,runGoogleRelay:()=>wF,startGoogleRelay:()=>MT});function NT(e={}){let t=e.env??process.env,r=t.GODD_LICENSE_KEY?.trim();if(r)return{value:r,source:"license_key"};let n=e.paths??kr(t),o=[];try{o=pn(n).map(i=>i.registry_url)}catch{}try{let i=qa(void 0,{env:t,cwd:e.cwd,savedRegistries:o});return{value:Cf(i,{paths:n,warn:e.warn}),source:"device_token"}}catch(i){throw i instanceof Ye||i instanceof Error&&i.constructor===Error?new io(i.message):i}}function jT(e=process.env){let t=Py(e);if(!t)return{error:"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF08http \u306F localhost / 127.0.0.1 / [::1] \u306E\u307F\uFF09\u3002"};let{hostname:r}=new URL(t);return yF.has(r)||r==="ripla.co.jp"||r.endsWith(".ripla.co.jp")?{url:t}:{error:`GODD_GOOGLE_MCP_URL \u306E\u63A5\u7D9A\u5148\uFF08${r}\uFF09\u306B\u306F\u4E2D\u7D99\u3057\u307E\u305B\u3093\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u9001\u308B\u306E\u306F ripla.co.jp\uFF08\u3068\u305D\u306E\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF09\u3068\u3001\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\uFF08localhost / 127.0.0.1 / [::1]\uFF09\u3060\u3051\u3067\u3059\u3002`}}function _F(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"){let{error:r,detail:n}=t;if(typeof r=="string")return r;if(typeof n=="string")return n}}catch{}return e.trim().slice(0,200)}function vF(e,t,r){let n=`ripla-google \u304C\u63A5\u7D9A\u3092\u62D2\u5426\u3057\u307E\u3057\u305F\uFF08HTTP ${e}${t?`: ${t}`:""}\uFF09\u3002`;return r==="device_token"?`${n}godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4E2D\u7D99\u306E\u518D\u8D77\u52D5\u306F\u4E0D\u8981\u3067\u3059\uFF09\u3002`:`${n}GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}async function MT(e){let t=e.log??(l=>console.error(l)),r=e.fetchImpl??fetch,{local:n}=e,o=null,i=l=>o?l.split(o).join("***"):l,s=null,a=l=>{l!==s&&(s=l,t(`${ss} ${l}`))},c=async(l,d)=>{let f=e.resolveToken();o=f.value;let h=new Headers(d?.headers);h.set("Authorization",`Bearer ${f.value}`);let g=await r(l,{...d,headers:h});if(g.status===401||g.status===403){let y=_F(await g.text().catch(()=>""));throw new io(i(vF(g.status,y,f.source)))}return g.ok&&(s=null),g},u=new xp(new URL(e.url),{fetch:c}),p=new Set;return u.onmessage=l=>{let d="id"in l?l.id:void 0;if(d!==void 0&&p.has(d)&&(p.delete(d),"result"in l)){let f=l.result.protocolVersion;typeof f=="string"&&u.setProtocolVersion(f)}n.send(l).catch(f=>{t(`${ss} IDE \u3078\u306E\u5FDC\u7B54\u306E\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${f instanceof Error?f.message:String(f)}`)})},u.onerror=l=>{l instanceof io?a(l.message):t(`${ss} ripla-google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: ${i(l.message)}`)},n.onmessage=l=>{let d=ho(l)?l:null;d?.method==="initialize"&&p.add(d.id),u.send(l).catch(f=>{if(!d)return;p.delete(d.id);let h=f instanceof io?f.message:`ripla-google \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${i(f instanceof Error?f.message:String(f))}`;n.send({jsonrpc:"2.0",id:d.id,error:{code:ee.InternalError,message:h}}).catch(()=>{})})},n.onerror=l=>{t(`${ss} IDE \u304B\u3089\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u3081\u307E\u305B\u3093\u3067\u3057\u305F: ${l.message}`)},await u.start(),await n.start(),{close:async()=>{await u.close().catch(()=>{}),await n.close().catch(()=>{})}}}async function wF(){let e=jT(process.env);"error"in e&&(console.error(`${ss} ${e.error}`),process.exit(1));let{url:t}=e,r=new Set,n=a=>{r.has(a)||(r.add(a),console.error(a))},o=()=>NT({warn:n});try{o()}catch(a){if(!(a instanceof io))throw a;console.error(`${ss} ${a.message}\uFF08\u30ED\u30B0\u30A4\u30F3\u5F8C\u306B IDE \u3067 MCP \u3092\u518D\u63A5\u7D9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002Claude Code \u306A\u3089 /mcp\uFF09`)}let i=await MT({url:t,local:new hi,resolveToken:o}),s=()=>{i.close().finally(()=>process.exit(0))};process.stdin.once("end",s),process.stdin.once("close",s)}var ss,io,yF,ZT=b(()=>{"use strict";OT();sf();An();Ci();yp();Cy();Mn();Fa();ss="[GoDD google-relay]",io=class extends Error{name="RelayAuthError"};yF=new Set(["localhost","127.0.0.1","[::1]"])});var GT={};tr(GT,{runInstall:()=>$F});function bF(){if(process.platform==="win32"){let e=process.env.LOCALAPPDATA??(0,so.join)((0,kp.homedir)(),"AppData","Local");return(0,so.join)(e,"GoDD")}return(0,so.join)((0,kp.homedir)(),".godd","bin")}function xF(){return process.platform==="win32"?"godd.exe":"godd"}function FT(e){let t=process.env.PATH??"",r=process.platform==="win32"?";":":";return t.split(r).map(o=>o.replace(/[\\/]+$/,"").toLowerCase()).includes(e.replace(/[\\/]+$/,"").toLowerCase())}function kF(e){if(FT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}try{let t=["$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')","if ($currentPath -and $currentPath.Length -gt 0) {",` $newPath = $currentPath + ';' + '${e.replace(/'/g,"''")}'`,"} else {",` $newPath = '${e.replace(/'/g,"''")}'`,"}","[Environment]::SetEnvironmentVariable('PATH', $newPath, 'User')"].join("; ");(0,UT.execSync)(`powershell -NoProfile -Command "${t}"`,{stdio:"pipe"}),console.log(" PATH: \u30E6\u30FC\u30B6\u30FC\u74B0\u5883\u5909\u6570\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002")}catch{console.error(` PATH: \u81EA\u52D5\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u4EE5\u4E0B\u3092\u624B\u52D5\u3067 PATH \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044:
330
- ${e}`)}}function SF(e){if(FT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}let t=`
329
+ `&&n++}}return[t,r]}var wp,zT=b(()=>{wp=class extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}});var bp,DT=b(()=>{zT();bp=class extends TransformStream{constructor({onError:t,onRetry:r,onComment:n}={}){let o;super({start(i){o=IT({onEvent:s=>{i.enqueue(s)},onError(s){t==="terminate"?i.error(s):typeof t=="function"&&t(s)},onRetry:r,onComment:n})},transform(i){o.feed(i)}})}}});var _F,oo,xp,OT=b(()=>{mT();An();RT();DT();_F={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},oo=class extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}},xp=class{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=hT(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??_F}async _authThenStart(){if(!this._authProvider)throw new $n("No auth provider");let t;try{t=await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new $n;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let t={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(t.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=vp(this._requestInit?.headers);return new Headers({...t,...r})}async _startOrAuthSse(t){let{resumptionToken:r}=t;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new oo(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,t,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,t),o)}_scheduleReconnection(t,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,r+1)})},o)}_handleSseStream(t,r,n){if(!t)return;let{onresumptiontoken:o,replayMessageId:i}=r,s,a=!1,c=!1;(async()=>{try{let p=t.pipeThrough(new TextDecoderStream).pipeThrough(new bp({onRetry:f=>{this._serverRetryMs=f}})).getReader();for(;;){let{value:f,done:h}=await p.read();if(h)break;if(f.id&&(s=f.id,a=!0,o?.(f.id)),!!f.data&&(!f.event||f.event==="message"))try{let g=pi.parse(JSON.parse(f.data));mo(g)&&(c=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(p){if(this.onerror?.(new Error(`SSE stream disconnected: ${p}`)),(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(f){this.onerror?.(new Error(`Failed to reconnect: ${f instanceof Error?f.message:String(f)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new $n("No auth provider");if(await rc(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $n("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:ho(t)?t.id:void 0}).catch(d=>this.onerror?.(d));return}let i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");let s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._url,s),c=a.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!a.ok){let d=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new oo(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:f,scope:h}=Wy(a);if(this._resourceMetadataUrl=f,this._scope=h,await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $n;return this._hasCompletedAuthFlow=!0,this.send(t)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:f,scope:h,error:g}=Wy(a);if(g==="insufficient_scope"){let y=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===y)throw new oo(403,"Server returned 403 after trying upscoping");if(h&&(this._scope=h),f&&(this._resourceMetadataUrl=f),this._lastUpscopingHeader=y??void 0,await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new $n;return this.send(t)}}throw new oo(a.status,`Error POSTing to endpoint: ${d}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),a0(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(d=>this.onerror?.(d));return}let p=(Array.isArray(t)?t:[t]).filter(d=>"method"in d&&"id"in d&&d.id!==void 0).length>0,l=a.headers.get("content-type");if(p)if(l?.includes("text/event-stream"))this._handleSseStream(a.body,{onresumptiontoken:o},!1);else if(l?.includes("application/json")){let d=await a.json(),f=Array.isArray(d)?d.map(h=>pi.parse(h)):[pi.parse(d)];for(let h of f)this.onmessage?.(h)}else throw await a.body?.cancel(),new oo(-1,`Unexpected content type: ${l}`);else await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new oo(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}}});var LT={};tr(LT,{RelayAuthError:()=>io,resolveRelayToken:()=>NT,resolveRelayUrl:()=>jT,runGoogleRelay:()=>xF,startGoogleRelay:()=>MT});function NT(e={}){let t=e.env??process.env,r=t.GODD_LICENSE_KEY?.trim();if(r)return{value:r,source:"license_key"};let n=e.paths??kr(t),o=[];try{o=pn(n).map(i=>i.registry_url)}catch{}try{let i=qa(void 0,{env:t,cwd:e.cwd,savedRegistries:o});return{value:Cf(i,{paths:n,warn:e.warn}),source:"device_token"}}catch(i){throw i instanceof Ye||i instanceof Error&&i.constructor===Error?new io(i.message):i}}function jT(e=process.env){let t=Py(e);if(!t)return{error:"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF08http \u306F localhost / 127.0.0.1 / [::1] \u306E\u307F\uFF09\u3002"};let{hostname:r}=new URL(t);return vF.has(r)||r==="ripla.co.jp"||r.endsWith(".ripla.co.jp")?{url:t}:{error:`GODD_GOOGLE_MCP_URL \u306E\u63A5\u7D9A\u5148\uFF08${r}\uFF09\u306B\u306F\u4E2D\u7D99\u3057\u307E\u305B\u3093\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u9001\u308B\u306E\u306F ripla.co.jp\uFF08\u3068\u305D\u306E\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF09\u3068\u3001\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\uFF08localhost / 127.0.0.1 / [::1]\uFF09\u3060\u3051\u3067\u3059\u3002`}}function wF(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"){let{error:r,detail:n}=t;if(typeof r=="string")return r;if(typeof n=="string")return n}}catch{}return e.trim().slice(0,200)}function bF(e,t,r){let n=`ripla-google \u304C\u63A5\u7D9A\u3092\u62D2\u5426\u3057\u307E\u3057\u305F\uFF08HTTP ${e}${t?`: ${t}`:""}\uFF09\u3002`;return r==="device_token"?`${n}godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4E2D\u7D99\u306E\u518D\u8D77\u52D5\u306F\u4E0D\u8981\u3067\u3059\uFF09\u3002`:`${n}GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}async function MT(e){let t=e.log??(l=>console.error(l)),r=e.fetchImpl??fetch,{local:n}=e,o=null,i=l=>o?l.split(o).join("***"):l,s=null,a=l=>{l!==s&&(s=l,t(`${ss} ${l}`))},c=async(l,d)=>{let f=e.resolveToken();o=f.value;let h=new Headers(d?.headers);h.set("Authorization",`Bearer ${f.value}`);let g=await r(l,{...d,headers:h});if(g.status===401||g.status===403){let y=wF(await g.text().catch(()=>""));throw new io(i(bF(g.status,y,f.source)))}return g.ok&&(s=null),g},u=new xp(new URL(e.url),{fetch:c}),p=new Set;return u.onmessage=l=>{let d="id"in l?l.id:void 0;if(d!==void 0&&p.has(d)&&(p.delete(d),"result"in l)){let f=l.result.protocolVersion;typeof f=="string"&&u.setProtocolVersion(f)}n.send(l).catch(f=>{t(`${ss} IDE \u3078\u306E\u5FDC\u7B54\u306E\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${f instanceof Error?f.message:String(f)}`)})},u.onerror=l=>{l instanceof io?a(l.message):t(`${ss} ripla-google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: ${i(l.message)}`)},n.onmessage=l=>{let d=ho(l)?l:null;d?.method==="initialize"&&p.add(d.id),u.send(l).catch(f=>{if(!d)return;p.delete(d.id);let h=f instanceof io?f.message:`ripla-google \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${i(f instanceof Error?f.message:String(f))}`;n.send({jsonrpc:"2.0",id:d.id,error:{code:ee.InternalError,message:h}}).catch(()=>{})})},n.onerror=l=>{t(`${ss} IDE \u304B\u3089\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u3081\u307E\u305B\u3093\u3067\u3057\u305F: ${l.message}`)},await u.start(),await n.start(),{close:async()=>{await u.close().catch(()=>{}),await n.close().catch(()=>{})}}}async function xF(){let e=jT(process.env);"error"in e&&(console.error(`${ss} ${e.error}`),process.exit(1));let{url:t}=e,r=new Set,n=a=>{r.has(a)||(r.add(a),console.error(a))},o=()=>NT({warn:n});try{o()}catch(a){if(!(a instanceof io))throw a;console.error(`${ss} ${a.message}\uFF08\u30ED\u30B0\u30A4\u30F3\u5F8C\u306B IDE \u3067 MCP \u3092\u518D\u63A5\u7D9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002Claude Code \u306A\u3089 /mcp\uFF09`)}let i=await MT({url:t,local:new hi,resolveToken:o}),s=()=>{i.close().finally(()=>process.exit(0))};process.stdin.once("end",s),process.stdin.once("close",s)}var ss,io,vF,ZT=b(()=>{"use strict";OT();sf();An();Ci();yp();Cy();Mn();Fa();ss="[GoDD google-relay]",io=class extends Error{name="RelayAuthError"};vF=new Set(["localhost","127.0.0.1","[::1]"])});var GT={};tr(GT,{runInstall:()=>EF});function kF(){if(process.platform==="win32"){let e=process.env.LOCALAPPDATA??(0,so.join)((0,kp.homedir)(),"AppData","Local");return(0,so.join)(e,"GoDD")}return(0,so.join)((0,kp.homedir)(),".godd","bin")}function SF(){return process.platform==="win32"?"godd.exe":"godd"}function FT(e){let t=process.env.PATH??"",r=process.platform==="win32"?";":":";return t.split(r).map(o=>o.replace(/[\\/]+$/,"").toLowerCase()).includes(e.replace(/[\\/]+$/,"").toLowerCase())}function $F(e){if(FT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}try{let t=["$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')","if ($currentPath -and $currentPath.Length -gt 0) {",` $newPath = $currentPath + ';' + '${e.replace(/'/g,"''")}'`,"} else {",` $newPath = '${e.replace(/'/g,"''")}'`,"}","[Environment]::SetEnvironmentVariable('PATH', $newPath, 'User')"].join("; ");(0,UT.execSync)(`powershell -NoProfile -Command "${t}"`,{stdio:"pipe"}),console.log(" PATH: \u30E6\u30FC\u30B6\u30FC\u74B0\u5883\u5909\u6570\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002")}catch{console.error(` PATH: \u81EA\u52D5\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u4EE5\u4E0B\u3092\u624B\u52D5\u3067 PATH \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044:
330
+ ${e}`)}}function PF(e){if(FT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}let t=`
331
331
  # GoDD CLI
332
332
  export PATH="${e}:$PATH"
333
- `,r=(0,kp.homedir)(),n=[],o=(0,so.join)(r,".zshrc"),i=(0,so.join)(r,".bashrc"),s=(0,so.join)(r,".bash_profile");if((0,Or.existsSync)(o)&&n.push(o),(0,Or.existsSync)(i)?n.push(i):(0,Or.existsSync)(s)&&n.push(s),n.length===0){let a=process.platform==="darwin"?o:i;n.push(a)}for(let a of n){try{if((0,Sp.readFileSync)(a,"utf-8").includes(e)){console.log(` PATH: ${a} \u306B\u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002`);continue}}catch{}(0,Sp.appendFileSync)(a,t,"utf-8"),console.log(` PATH: ${a} \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002`)}}async function $F(){console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 GoDD CLI \u2014 \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log("");let e=bF(),t=xF(),r=(0,so.join)(e,t),n=process.execPath;console.log(`\u30BD\u30FC\u30B9: ${n}`),console.log(`\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148: ${r}`),console.log(""),(0,Or.existsSync)(e)||((0,Or.mkdirSync)(e,{recursive:!0}),console.log(`\u2713 \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F: ${e}`));let o=n.replace(/\\/g,"/").toLowerCase(),i=r.replace(/\\/g,"/").toLowerCase();if(o===i?console.log("\u2713 \u65E2\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148\u304B\u3089\u5B9F\u884C\u3055\u308C\u3066\u3044\u307E\u3059\uFF08\u30B3\u30D4\u30FC\u3092\u30B9\u30AD\u30C3\u30D7\uFF09\u3002"):((0,Or.copyFileSync)(n,r),console.log("\u2713 \u30D0\u30A4\u30CA\u30EA\u3092\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F\u3002"),process.platform!=="win32"&&(0,Or.chmodSync)(r,493)),console.log(""),process.platform==="win32"?kF(e):SF(e),console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5B8C\u4E86\uFF01 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"),console.log(" 1. \u30BF\u30FC\u30DF\u30CA\u30EB\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF08PATH \u3092\u53CD\u6620\u3059\u308B\u305F\u3081\uFF09"),console.log(" 2. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067 godd init \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(""),console.log("\u4F7F\u3044\u65B9:"),console.log(" godd init \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7"),console.log(" godd server MCP \u30B5\u30FC\u30D0\u30FC\u8D77\u52D5\uFF08Cursor \u304C\u81EA\u52D5\u5B9F\u884C\uFF09"),console.log(" godd version \u30D0\u30FC\u30B8\u30E7\u30F3\u8868\u793A"),console.log(" godd help \u30D8\u30EB\u30D7\u8868\u793A"),console.log(""),process.platform==="win32"&&!process.env.TERM&&!process.env.CI){let s=qT.createInterface({input:process.stdin,output:process.stdout});await new Promise(a=>{s.question("Enter \u30AD\u30FC\u3092\u62BC\u3057\u3066\u9589\u3058\u307E\u3059...",()=>{s.close(),a()})})}}var Or,so,kp,UT,Sp,qT,BT=b(()=>{"use strict";Or=require("node:fs"),so=require("node:path"),kp=require("node:os"),UT=require("node:child_process"),Sp=require("node:fs"),qT=yt(require("node:readline"),1)});function TF(e){return!(0,VT.existsSync)((0,HT.join)(e,"node_modules"))}function AF(e,t){TF(e)&&t("pnpm",[...PF],{cwd:e,label:"\u4F9D\u5B58\u95A2\u4FC2\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB"}),t("pnpm",[...EF],{cwd:e,label:"esbuild \u30D3\u30EB\u30C9\u30B9\u30AF\u30EA\u30D7\u30C8\u5B9F\u884C"})}function nc(e,t){AF(e,t),t("pnpm",[...CF],{cwd:e,label:"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9",nonInteractive:!0})}var VT,HT,PF,EF,CF,Yy=b(()=>{"use strict";VT=require("node:fs"),HT=require("node:path"),PF=["install","--frozen-lockfile","--ignore-scripts"],EF=["rebuild","esbuild"],CF=["exec","vite","build","--logLevel","info"]});function zF(e){let t=e.containerDefinitions;return Array.isArray(t)?{...e,containerDefinitions:t.map(r=>Array.isArray(r.secrets)?{...r,secrets:r.secrets.filter(n=>typeof n.name!="string"||!IF.has(n.name))}:r)}:e}function WT(e,t){let r={...e};for(let o of RF)delete r[o];let n=zF(r);if(t?.image&&Array.isArray(n.containerDefinitions)){let[o,...i]=n.containerDefinitions;o&&(n.containerDefinitions=[{...o,image:t.image},...i])}return n}var RF,IF,KT=b(()=>{"use strict";RF=["taskDefinitionArn","revision","status","requiresAttributes","compatibilities","registeredAt","registeredBy"],IF=new Set(["GITHUB_TOKEN"])});function OF(e){return process.platform!=="win32"?!1:QT.has((0,oc.extname)(e).toLowerCase())}function MF(e){let t=[],r=!1;for(let n of e){if(r){t.push("***"),r=!1;continue}let o=NF.exec(n);if(o){t.push(`${o[1]}=***`);continue}if(jF.test(n)){t.push(n),r=!0;continue}t.push(n)}return t.join(" ")}function LF(e,t){let r=t.findIndex(o=>JT.test(o));if(r===-1)return;let[n]=JT.exec(t[r])??[];throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5F15\u6570\u306B Windows shell \u4E88\u7D04\u6587\u5B57\uFF08${JSON.stringify(n)}\uFF09\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u5B9F\u884C\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\uFF08\u30B3\u30DE\u30F3\u30C9\u30A4\u30F3\u30B8\u30A7\u30AF\u30B7\u30E7\u30F3\u5BFE\u7B56\uFF09: ${e} \u306E\u7B2C${r+1}\u5F15\u6570`)}function UF(e){if(process.platform!=="win32")return e;let t=(0,oc.extname)(e);if(t&&DF.has(t.toLowerCase()))return e;let r=(0,oc.basename)(e).toLowerCase();return ZF.has(r)?`${e}.cmd`:e}function Le(e,t,r={}){FF(e,t,r)}function qF(e=process.env){return{...e,CI:"true",FORCE_COLOR:"0",npm_config_color:"false"}}function FF(e,t,r={}){let{cwd:n,label:o,env:i,stdin:s="ignore",nonInteractive:a=!1}=r;o&&console.log(` ${o}...`);let c=a?qF(i??process.env):i??process.env,u=UF(e),p=OF(u);p&&LF(u,t);let l=(0,YT.spawnSync)(u,[...t],{cwd:n,stdio:[s,"inherit","inherit"],env:c,windowsHide:!0,shell:p});if(l.error)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u8D77\u52D5\u5931\u6557: ${e}
334
- ${ye(l.error)}`);if(l.status!==0)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5931\u6557 (exit ${l.status}): ${e} ${MF(t)}`)}var YT,oc,QT,DF,JT,NF,jF,ZF,Qy=b(()=>{"use strict";YT=require("node:child_process"),oc=require("node:path");Xt();QT=new Set([".cmd",".bat"]),DF=new Set([...QT,".exe"]);JT=/[&|()<>^"%!\r\n]/,NF=/^(--?[\w-]*(?:token|secret|password|apikey|api-key|credential)[\w-]*)=(.+)$/i,jF=/^--?[\w-]*(?:token|secret|password|apikey|api-key|credential)[\w-]*$/i;ZF=new Set(["pnpm","npm","npx","yarn","yarnpkg","corepack","vercel","railway"])});var aA={};tr(aA,{SUPPORTED_DEPLOY_PROVIDERS:()=>nA,assertValidDeployEnv:()=>sA,executeAzureDeploy:()=>rG,executeGcpDeploy:()=>tG,executeVercelRailwayDeploy:()=>nG,extractAzureStorageAccountFromWebEndpoint:()=>iA,extractGcsBucketFromAppUrl:()=>oA,getTerraformDir:()=>$p,parseTerraformOutputValues:()=>Pp,resolveDeployProvider:()=>BF});function BF(e){return e&&nA.includes(e)?e:null}function $p(e,t){let r=t.env??"dev",n=t.outputDir??e;return(0,rA.join)(n,"terraform","godd-notes",r)}function Pp(e,t){if(!(0,e_.existsSync)(e))throw new Error(`Terraform \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let r;try{r=Xy.execSync("terraform output -json",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch(s){throw new Error(`terraform output \u306E\u5B9F\u884C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002terraform init && terraform apply \u3092\u5148\u306B\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
335
- ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${r.slice(0,200)}`)}let o=t.filter(s=>!n[s]?.value);if(o.length>0)throw new Error(`Terraform output \u306B\u5FC5\u8981\u306A\u5024\u304C\u3042\u308A\u307E\u305B\u3093: ${o.join(", ")}`);let i={};for(let s of t)i[s]=n[s].value;return i}function oA(e){return e.match(/^https:\/\/storage\.googleapis\.com\/([^/]+)\//)?.[1]??null}function iA(e){try{let r=new URL(e).hostname.split(".")[0];return r.length>0?r:null}catch{return null}}function en(e,t,r){try{Xy.execSync(e,{stdio:"pipe",timeout:GF})}catch{r.push(t)}}function VF(){let e=[];return en("gcloud --version","gcloud CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://cloud.google.com/sdk/docs/install",e),en("gcloud auth print-access-token","GCP \u8A8D\u8A3C\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002gcloud auth login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e),en("docker --version","Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",e),en("pnpm --version","pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm",e),{ok:e.length===0,errors:e}}function HF(){let e=[];return en("az --version","Azure CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://learn.microsoft.com/cli/azure/install-azure-cli",e),en("az account show","Azure \u8A8D\u8A3C\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002az login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e),en("docker --version","Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",e),en("pnpm --version","pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm",e),{ok:e.length===0,errors:e}}function WF(){let e=[];return en("vercel --version","Vercel CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g vercel",e),en("railway --version","Railway CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g @railway/cli",e),process.env.VERCEL_TOKEN||e.push("VERCEL_TOKEN \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),process.env.RAILWAY_TOKEN||e.push("RAILWAY_TOKEN \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),{ok:e.length===0,errors:e}}function KF(e){let t=Pp(e,["cloud_run_url","notes_app_url","artifact_registry"]),r=oA(t.notes_app_url);if(!r)throw new Error(`notes_app_url \u304B\u3089 GCS \u30D0\u30B1\u30C3\u30C8\u540D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${t.notes_app_url}`);return{cloud_run_url:t.cloud_run_url,notes_app_url:t.notes_app_url,artifact_registry:t.artifact_registry,gcs_bucket:r}}function JF(e,t){let r=Pp(e,["container_app_url","notes_app_url","cdn_endpoint","acr_login_server"]),n=iA(r.notes_app_url);if(!n)throw new Error(`notes_app_url \u304B\u3089 Storage Account \u540D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${r.notes_app_url}`);return{container_app_url:r.container_app_url,notes_app_url:r.notes_app_url,cdn_endpoint:r.cdn_endpoint,acr_login_server:r.acr_login_server,resource_group:`godd-notes-${t}`,storage_account:n}}function YF(e){let t=Pp(e,["vercel_url","vercel_project_id","railway_api_url"]);return{vercel_url:t.vercel_url,vercel_project_id:t.vercel_project_id,railway_api_url:t.railway_api_url}}async function t_(e,t){if(t)return!0;let r=tA.createInterface({input:process.stdin,output:process.stdout});try{return(await new Promise(o=>{r.question(e,i=>o(i.trim()))})).toLowerCase()==="n"?(console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002"),!1):!0}finally{r.close()}}async function QF(e,t,r){let n=t.region??"asia-northeast1",o=t.projectId;if(!o)throw new Error("GCP \u30C7\u30D7\u30ED\u30A4\u306B\u306F .godd-notes-infra.json \u306E projectId \u304C\u5FC5\u8981\u3067\u3059\u3002");let i=`${e.artifact_registry}/notes-api:latest`;console.log(`
333
+ `,r=(0,kp.homedir)(),n=[],o=(0,so.join)(r,".zshrc"),i=(0,so.join)(r,".bashrc"),s=(0,so.join)(r,".bash_profile");if((0,Or.existsSync)(o)&&n.push(o),(0,Or.existsSync)(i)?n.push(i):(0,Or.existsSync)(s)&&n.push(s),n.length===0){let a=process.platform==="darwin"?o:i;n.push(a)}for(let a of n){try{if((0,Sp.readFileSync)(a,"utf-8").includes(e)){console.log(` PATH: ${a} \u306B\u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002`);continue}}catch{}(0,Sp.appendFileSync)(a,t,"utf-8"),console.log(` PATH: ${a} \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002`)}}async function EF(){console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 GoDD CLI \u2014 \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log("");let e=kF(),t=SF(),r=(0,so.join)(e,t),n=process.execPath;console.log(`\u30BD\u30FC\u30B9: ${n}`),console.log(`\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148: ${r}`),console.log(""),(0,Or.existsSync)(e)||((0,Or.mkdirSync)(e,{recursive:!0}),console.log(`\u2713 \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F: ${e}`));let o=n.replace(/\\/g,"/").toLowerCase(),i=r.replace(/\\/g,"/").toLowerCase();if(o===i?console.log("\u2713 \u65E2\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148\u304B\u3089\u5B9F\u884C\u3055\u308C\u3066\u3044\u307E\u3059\uFF08\u30B3\u30D4\u30FC\u3092\u30B9\u30AD\u30C3\u30D7\uFF09\u3002"):((0,Or.copyFileSync)(n,r),console.log("\u2713 \u30D0\u30A4\u30CA\u30EA\u3092\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F\u3002"),process.platform!=="win32"&&(0,Or.chmodSync)(r,493)),console.log(""),process.platform==="win32"?$F(e):PF(e),console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5B8C\u4E86\uFF01 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"),console.log(" 1. \u30BF\u30FC\u30DF\u30CA\u30EB\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF08PATH \u3092\u53CD\u6620\u3059\u308B\u305F\u3081\uFF09"),console.log(" 2. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067 godd init \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(""),console.log("\u4F7F\u3044\u65B9:"),console.log(" godd init \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7"),console.log(" godd server MCP \u30B5\u30FC\u30D0\u30FC\u8D77\u52D5\uFF08Cursor \u304C\u81EA\u52D5\u5B9F\u884C\uFF09"),console.log(" godd version \u30D0\u30FC\u30B8\u30E7\u30F3\u8868\u793A"),console.log(" godd help \u30D8\u30EB\u30D7\u8868\u793A"),console.log(""),process.platform==="win32"&&!process.env.TERM&&!process.env.CI){let s=qT.createInterface({input:process.stdin,output:process.stdout});await new Promise(a=>{s.question("Enter \u30AD\u30FC\u3092\u62BC\u3057\u3066\u9589\u3058\u307E\u3059...",()=>{s.close(),a()})})}}var Or,so,kp,UT,Sp,qT,BT=b(()=>{"use strict";Or=require("node:fs"),so=require("node:path"),kp=require("node:os"),UT=require("node:child_process"),Sp=require("node:fs"),qT=yt(require("node:readline"),1)});function RF(e){return!(0,VT.existsSync)((0,HT.join)(e,"node_modules"))}function IF(e,t){RF(e)&&t("pnpm",[...CF],{cwd:e,label:"\u4F9D\u5B58\u95A2\u4FC2\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB"}),t("pnpm",[...TF],{cwd:e,label:"esbuild \u30D3\u30EB\u30C9\u30B9\u30AF\u30EA\u30D7\u30C8\u5B9F\u884C"})}function nc(e,t){IF(e,t),t("pnpm",[...AF],{cwd:e,label:"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9",nonInteractive:!0})}var VT,HT,CF,TF,AF,Yy=b(()=>{"use strict";VT=require("node:fs"),HT=require("node:path"),CF=["install","--frozen-lockfile","--ignore-scripts"],TF=["rebuild","esbuild"],AF=["exec","vite","build","--logLevel","info"]});function OF(e){let t=e.containerDefinitions;return Array.isArray(t)?{...e,containerDefinitions:t.map(r=>Array.isArray(r.secrets)?{...r,secrets:r.secrets.filter(n=>typeof n.name!="string"||!DF.has(n.name))}:r)}:e}function WT(e,t){let r={...e};for(let o of zF)delete r[o];let n=OF(r);if(t?.image&&Array.isArray(n.containerDefinitions)){let[o,...i]=n.containerDefinitions;o&&(n.containerDefinitions=[{...o,image:t.image},...i])}return n}var zF,DF,KT=b(()=>{"use strict";zF=["taskDefinitionArn","revision","status","requiresAttributes","compatibilities","registeredAt","registeredBy"],DF=new Set(["GITHUB_TOKEN"])});function jF(e){return process.platform!=="win32"?!1:QT.has((0,oc.extname)(e).toLowerCase())}function ZF(e){let t=[],r=!1;for(let n of e){if(r){t.push("***"),r=!1;continue}let o=MF.exec(n);if(o){t.push(`${o[1]}=***`);continue}if(LF.test(n)){t.push(n),r=!0;continue}t.push(n)}return t.join(" ")}function UF(e,t){let r=t.findIndex(o=>JT.test(o));if(r===-1)return;let[n]=JT.exec(t[r])??[];throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5F15\u6570\u306B Windows shell \u4E88\u7D04\u6587\u5B57\uFF08${JSON.stringify(n)}\uFF09\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u5B9F\u884C\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\uFF08\u30B3\u30DE\u30F3\u30C9\u30A4\u30F3\u30B8\u30A7\u30AF\u30B7\u30E7\u30F3\u5BFE\u7B56\uFF09: ${e} \u306E\u7B2C${r+1}\u5F15\u6570`)}function FF(e){if(process.platform!=="win32")return e;let t=(0,oc.extname)(e);if(t&&NF.has(t.toLowerCase()))return e;let r=(0,oc.basename)(e).toLowerCase();return qF.has(r)?`${e}.cmd`:e}function Le(e,t,r={}){BF(e,t,r)}function GF(e=process.env){return{...e,CI:"true",FORCE_COLOR:"0",npm_config_color:"false"}}function BF(e,t,r={}){let{cwd:n,label:o,env:i,stdin:s="ignore",nonInteractive:a=!1}=r;o&&console.log(` ${o}...`);let c=a?GF(i??process.env):i??process.env,u=FF(e),p=jF(u);p&&UF(u,t);let l=(0,YT.spawnSync)(u,[...t],{cwd:n,stdio:[s,"inherit","inherit"],env:c,windowsHide:!0,shell:p});if(l.error)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u8D77\u52D5\u5931\u6557: ${e}
334
+ ${ye(l.error)}`);if(l.status!==0)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5931\u6557 (exit ${l.status}): ${e} ${ZF(t)}`)}var YT,oc,QT,NF,JT,MF,LF,qF,Qy=b(()=>{"use strict";YT=require("node:child_process"),oc=require("node:path");Xt();QT=new Set([".cmd",".bat"]),NF=new Set([...QT,".exe"]);JT=/[&|()<>^"%!\r\n]/,MF=/^(--?[\w-]*(?:token|secret|password|apikey|api-key|credential)[\w-]*)=(.+)$/i,LF=/^--?[\w-]*(?:token|secret|password|apikey|api-key|credential)[\w-]*$/i;qF=new Set(["pnpm","npm","npx","yarn","yarnpkg","corepack","vercel","railway"])});var aA={};tr(aA,{SUPPORTED_DEPLOY_PROVIDERS:()=>nA,assertValidDeployEnv:()=>sA,executeAzureDeploy:()=>oG,executeGcpDeploy:()=>nG,executeVercelRailwayDeploy:()=>iG,extractAzureStorageAccountFromWebEndpoint:()=>iA,extractGcsBucketFromAppUrl:()=>oA,getTerraformDir:()=>$p,parseTerraformOutputValues:()=>Pp,resolveDeployProvider:()=>HF});function HF(e){return e&&nA.includes(e)?e:null}function $p(e,t){let r=t.env??"dev",n=t.outputDir??e;return(0,rA.join)(n,"terraform","godd-notes",r)}function Pp(e,t){if(!(0,e_.existsSync)(e))throw new Error(`Terraform \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let r;try{r=Xy.execSync("terraform output -json",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch(s){throw new Error(`terraform output \u306E\u5B9F\u884C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002terraform init && terraform apply \u3092\u5148\u306B\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
335
+ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${r.slice(0,200)}`)}let o=t.filter(s=>!n[s]?.value);if(o.length>0)throw new Error(`Terraform output \u306B\u5FC5\u8981\u306A\u5024\u304C\u3042\u308A\u307E\u305B\u3093: ${o.join(", ")}`);let i={};for(let s of t)i[s]=n[s].value;return i}function oA(e){return e.match(/^https:\/\/storage\.googleapis\.com\/([^/]+)\//)?.[1]??null}function iA(e){try{let r=new URL(e).hostname.split(".")[0];return r.length>0?r:null}catch{return null}}function en(e,t,r){try{Xy.execSync(e,{stdio:"pipe",timeout:VF})}catch{r.push(t)}}function WF(){let e=[];return en("gcloud --version","gcloud CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://cloud.google.com/sdk/docs/install",e),en("gcloud auth print-access-token","GCP \u8A8D\u8A3C\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002gcloud auth login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e),en("docker --version","Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",e),en("pnpm --version","pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm",e),{ok:e.length===0,errors:e}}function KF(){let e=[];return en("az --version","Azure CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://learn.microsoft.com/cli/azure/install-azure-cli",e),en("az account show","Azure \u8A8D\u8A3C\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002az login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e),en("docker --version","Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",e),en("pnpm --version","pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm",e),{ok:e.length===0,errors:e}}function JF(){let e=[];return en("vercel --version","Vercel CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g vercel",e),en("railway --version","Railway CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g @railway/cli",e),process.env.VERCEL_TOKEN||e.push("VERCEL_TOKEN \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),process.env.RAILWAY_TOKEN||e.push("RAILWAY_TOKEN \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),{ok:e.length===0,errors:e}}function YF(e){let t=Pp(e,["cloud_run_url","notes_app_url","artifact_registry"]),r=oA(t.notes_app_url);if(!r)throw new Error(`notes_app_url \u304B\u3089 GCS \u30D0\u30B1\u30C3\u30C8\u540D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${t.notes_app_url}`);return{cloud_run_url:t.cloud_run_url,notes_app_url:t.notes_app_url,artifact_registry:t.artifact_registry,gcs_bucket:r}}function QF(e,t){let r=Pp(e,["container_app_url","notes_app_url","cdn_endpoint","acr_login_server"]),n=iA(r.notes_app_url);if(!n)throw new Error(`notes_app_url \u304B\u3089 Storage Account \u540D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${r.notes_app_url}`);return{container_app_url:r.container_app_url,notes_app_url:r.notes_app_url,cdn_endpoint:r.cdn_endpoint,acr_login_server:r.acr_login_server,resource_group:`godd-notes-${t}`,storage_account:n}}function XF(e){let t=Pp(e,["vercel_url","vercel_project_id","railway_api_url"]);return{vercel_url:t.vercel_url,vercel_project_id:t.vercel_project_id,railway_api_url:t.railway_api_url}}async function t_(e,t){if(t)return!0;let r=tA.createInterface({input:process.stdin,output:process.stdout});try{return(await new Promise(o=>{r.question(e,i=>o(i.trim()))})).toLowerCase()==="n"?(console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002"),!1):!0}finally{r.close()}}async function eG(e,t,r){let n=t.region??"asia-northeast1",o=t.projectId;if(!o)throw new Error("GCP \u30C7\u30D7\u30ED\u30A4\u306B\u306F .godd-notes-infra.json \u306E projectId \u304C\u5FC5\u8981\u3067\u3059\u3002");let i=`${e.artifact_registry}/notes-api:latest`;console.log(`
336
336
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
337
337
  \u2551 GoDD Notes \u2014 GCP \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
338
338
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
@@ -349,7 +349,7 @@ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
349
349
  \u2551 Notes API: ${e.cloud_run_url.padEnd(35)}\u2551
350
350
  \u2551 \u2551
351
351
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
352
- `)}async function XF(e,t,r){let n=`${e.acr_login_server}/notes-api:latest`;console.log(`
352
+ `)}async function tG(e,t,r){let n=`${e.acr_login_server}/notes-api:latest`;console.log(`
353
353
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
354
354
  \u2551 GoDD Notes \u2014 Azure \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
355
355
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
@@ -368,7 +368,7 @@ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
368
368
  \u2551 CDN: ${e.cdn_endpoint.padEnd(35)}\u2551
369
369
  \u2551 \u2551
370
370
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
371
- `)}function sA(e){if(e==="dev"||e==="prod")return e;throw new Error(`.godd-notes-infra.json \u306E env \u306F "dev" \u307E\u305F\u306F "prod" \u306E\u307F\u8A31\u53EF\u3055\u308C\u307E\u3059\uFF08\u5B9F\u969B: ${JSON.stringify(e)}\uFF09`)}async function eG(e,t,r){let n=sA(t.env??"dev"),o=process.env.VERCEL_TOKEN??"";console.log(`
371
+ `)}function sA(e){if(e==="dev"||e==="prod")return e;throw new Error(`.godd-notes-infra.json \u306E env \u306F "dev" \u307E\u305F\u306F "prod" \u306E\u307F\u8A31\u53EF\u3055\u308C\u307E\u3059\uFF08\u5B9F\u969B: ${JSON.stringify(e)}\uFF09`)}async function rG(e,t,r){let n=sA(t.env??"dev"),o=process.env.VERCEL_TOKEN??"";console.log(`
372
372
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
373
373
  \u2551 GoDD Notes \u2014 Vercel \xD7 Railway \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
374
374
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
@@ -382,47 +382,47 @@ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
382
382
  \u2551 Notes API: ${e.railway_api_url.padEnd(35)}\u2551
383
383
  \u2551 \u2551
384
384
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
385
- `)}async function tG(e,t,r,n){console.log(`
386
- \u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=VF();if(!o.ok){console.error(`
385
+ `)}async function nG(e,t,r,n){console.log(`
386
+ \u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=WF();if(!o.ok){console.error(`
387
387
  \u30A8\u30E9\u30FC: GCP \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let a of o.errors)console.error(` - ${a}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
388
- `);let i=$p(t,e);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${i})`);let s=KF(i);console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
388
+ `);let i=$p(t,e);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${i})`);let s=YF(i);console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
389
389
  `),console.log("--- GCP \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Cloud Run: ${s.cloud_run_url}`),console.log(` GCS: ${s.gcs_bucket}`),console.log(` App URL: ${s.notes_app_url}`),await t_(`
390
- \u3053\u306E\u8A2D\u5B9A\u3067 GCP \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await QF(s,e,r)}async function rG(e,t,r,n){console.log(`
391
- \u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=HF();if(!o.ok){console.error(`
390
+ \u3053\u306E\u8A2D\u5B9A\u3067 GCP \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await eG(s,e,r)}async function oG(e,t,r,n){console.log(`
391
+ \u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=KF();if(!o.ok){console.error(`
392
392
  \u30A8\u30E9\u30FC: Azure \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let c of o.errors)console.error(` - ${c}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
393
- `);let i=e.env??"dev",s=$p(t,e);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${s})`);let a=JF(s,i);console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
393
+ `);let i=e.env??"dev",s=$p(t,e);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${s})`);let a=QF(s,i);console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
394
394
  `),console.log("--- Azure \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Container App: ${a.container_app_url}`),console.log(` Storage: ${a.storage_account}`),console.log(` App URL: ${a.notes_app_url}`),await t_(`
395
- \u3053\u306E\u8A2D\u5B9A\u3067 Azure \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await XF(a,e,r)}async function nG(e,t,r,n){console.log(`
396
- \u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=WF();if(!o.ok){console.error(`
395
+ \u3053\u306E\u8A2D\u5B9A\u3067 Azure \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await tG(a,e,r)}async function iG(e,t,r,n){console.log(`
396
+ \u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=JF();if(!o.ok){console.error(`
397
397
  \u30A8\u30E9\u30FC: Vercel \xD7 Railway \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let a of o.errors)console.error(` - ${a}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
398
- `);let i=$p(t,e),s;(0,e_.existsSync)(i)?(console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${i})`),s=YF(i),console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
398
+ `);let i=$p(t,e),s;(0,e_.existsSync)(i)?(console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${i})`),s=XF(i),console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
399
399
  `)):(s={vercel_url:"(vercel deploy \u5F8C\u306B\u78BA\u5B9A)",vercel_project_id:process.env.VERCEL_PROJECT_ID??"(\u672A\u8A2D\u5B9A)",railway_api_url:e.railwayApiUrl??"(Railway \u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u3067\u78BA\u8A8D)"},console.log(` \u2139 Terraform output \u306A\u3057 \u2014 CLI \u30C7\u30D7\u30ED\u30A4\u306E\u307F\u5B9F\u884C\u3057\u307E\u3059
400
400
  `)),console.log("--- Vercel \xD7 Railway \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Vercel: ${s.vercel_url}`),console.log(` Railway: ${s.railway_api_url}`),await t_(`
401
- \u3053\u306E\u8A2D\u5B9A\u3067 Vercel \xD7 Railway \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await eG(s,e,r)}var Xy,tA,e_,rA,GF,XT,eA,nA,cA=b(()=>{"use strict";Xy=yt(require("node:child_process"),1),tA=yt(require("node:readline"),1),e_=require("node:fs"),rA=require("node:path");Xt();Yy();Qy();GF=1e4,XT="godd-notes-api",eA="godd-notes-api",nA=["aws","gcp","azure","vercel-railway"]});var xA={};tr(xA,{PROVIDER_LABELS:()=>Ep,formatAwsProfileExportLines:()=>bA,runNotesInfra:()=>wG,saveProjectConfig:()=>wA,scaffoldNotesApplicationSources:()=>_A,shouldExcludeNotesSourceEntry:()=>gA,validateSavedInfraConfig:()=>mA});function mA(e){if(!e)return{ok:!1,error:`${xn} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002--yes \u306B\u306F\u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A\u304C\u5FC5\u8981\u3067\u3059\u3002\u307E\u305A\u5BFE\u8A71\u30E2\u30FC\u30C9\u3067 godd notes infra \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`};let t=e.provider;if(!t||!(t in Ep))return{ok:!1,error:`${xn} \u306E provider \u304C\u4E0D\u6B63\u3067\u3059: ${String(t)}`};let r=e,o=[...oG,...iG[t]].filter(i=>{let s=r[i];return typeof s=="string"?s==="":typeof s=="number"?!Number.isFinite(s):s==null});return o.length>0?{ok:!1,error:`${xn} \u306B\u5FC5\u9808\u30AD\u30FC\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059: ${o.join(", ")}\u3002\u5BFE\u8A71\u30E2\u30FC\u30C9\u3067 godd notes infra \u3092\u518D\u5B9F\u884C\u3057\u3066\u8A2D\u5B9A\u3092\u4FDD\u5B58\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}:{ok:!0,config:e}}function sG(){return dA.createInterface({input:process.stdin,output:process.stdout})}function oe(e,t){return new Promise(r=>{e.question(t,n=>r(n.trim()))})}function aG(){try{return(0,G.dirname)((0,fA.fileURLToPath)(__goddBundleUrl))}catch{return(0,G.dirname)(process.execPath)}}function cG(e){let t=aG(),r=[(0,G.resolve)(t,".."),(0,G.resolve)(t,"..","..")];for(let n of r){let o=(0,G.join)(n,"templates","terraform",e),i=(0,G.join)(n,"templates","github-actions",e);if((0,K.existsSync)(o)&&(0,K.existsSync)(i))return{terraformDir:o,ghaDir:i}}return null}function gA(e,t){return e===".env"||e.startsWith(".env.")&&e!==".env.example"||e.endsWith(".pyc")||e.endsWith(".tsbuildinfo")?!0:uG.has(e)||t.has(e)}function yA(e,t,r){(0,K.mkdirSync)(t,{recursive:!0});for(let n of(0,K.readdirSync)(e)){if(gA(n,r))continue;let o=(0,G.join)(e,n),i=(0,G.join)(t,n);(0,K.statSync)(o).isDirectory()?yA(o,i,r):(0,K.copyFileSync)(o,i)}}function _A(e){let t=ep();if(!t)return console.warn(`
402
- \u26A0 notes-api / notes-app \u306E\u540C\u68B1\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u3089\u306A\u3044\u305F\u3081\u3001\u30A2\u30D7\u30EA scaffold \u3092\u30B9\u30AD\u30C3\u30D7\u3057\u307E\u3057\u305F\u3002`),[];let r=[],n=[{label:"notes-api",src:t.apiDir,dest:(0,G.join)(e,"notes-api"),exclude:pG},{label:"notes-app",src:t.appDir,dest:(0,G.join)(e,"notes-app"),exclude:lG}];console.log(`
401
+ \u3053\u306E\u8A2D\u5B9A\u3067 Vercel \xD7 Railway \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await rG(s,e,r)}var Xy,tA,e_,rA,VF,XT,eA,nA,cA=b(()=>{"use strict";Xy=yt(require("node:child_process"),1),tA=yt(require("node:readline"),1),e_=require("node:fs"),rA=require("node:path");Xt();Yy();Qy();VF=1e4,XT="godd-notes-api",eA="godd-notes-api",nA=["aws","gcp","azure","vercel-railway"]});var xA={};tr(xA,{PROVIDER_LABELS:()=>Ep,formatAwsProfileExportLines:()=>bA,runNotesInfra:()=>xG,saveProjectConfig:()=>wA,scaffoldNotesApplicationSources:()=>_A,shouldExcludeNotesSourceEntry:()=>gA,validateSavedInfraConfig:()=>mA});function mA(e){if(!e)return{ok:!1,error:`${xn} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002--yes \u306B\u306F\u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A\u304C\u5FC5\u8981\u3067\u3059\u3002\u307E\u305A\u5BFE\u8A71\u30E2\u30FC\u30C9\u3067 godd notes infra \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`};let t=e.provider;if(!t||!(t in Ep))return{ok:!1,error:`${xn} \u306E provider \u304C\u4E0D\u6B63\u3067\u3059: ${String(t)}`};let r=e,o=[...sG,...aG[t]].filter(i=>{let s=r[i];return typeof s=="string"?s==="":typeof s=="number"?!Number.isFinite(s):s==null});return o.length>0?{ok:!1,error:`${xn} \u306B\u5FC5\u9808\u30AD\u30FC\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059: ${o.join(", ")}\u3002\u5BFE\u8A71\u30E2\u30FC\u30C9\u3067 godd notes infra \u3092\u518D\u5B9F\u884C\u3057\u3066\u8A2D\u5B9A\u3092\u4FDD\u5B58\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}:{ok:!0,config:e}}function cG(){return dA.createInterface({input:process.stdin,output:process.stdout})}function oe(e,t){return new Promise(r=>{e.question(t,n=>r(n.trim()))})}function uG(){try{return(0,G.dirname)((0,fA.fileURLToPath)(__goddBundleUrl))}catch{return(0,G.dirname)(process.execPath)}}function lG(e){let t=uG(),r=[(0,G.resolve)(t,".."),(0,G.resolve)(t,"..","..")];for(let n of r){let o=(0,G.join)(n,"templates","terraform",e),i=(0,G.join)(n,"templates","github-actions",e);if((0,K.existsSync)(o)&&(0,K.existsSync)(i))return{terraformDir:o,ghaDir:i}}return null}function gA(e,t){return e===".env"||e.startsWith(".env.")&&e!==".env.example"||e.endsWith(".pyc")||e.endsWith(".tsbuildinfo")?!0:pG.has(e)||t.has(e)}function yA(e,t,r){(0,K.mkdirSync)(t,{recursive:!0});for(let n of(0,K.readdirSync)(e)){if(gA(n,r))continue;let o=(0,G.join)(e,n),i=(0,G.join)(t,n);(0,K.statSync)(o).isDirectory()?yA(o,i,r):(0,K.copyFileSync)(o,i)}}function _A(e){let t=ep();if(!t)return console.warn(`
402
+ \u26A0 notes-api / notes-app \u306E\u540C\u68B1\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u3089\u306A\u3044\u305F\u3081\u3001\u30A2\u30D7\u30EA scaffold \u3092\u30B9\u30AD\u30C3\u30D7\u3057\u307E\u3057\u305F\u3002`),[];let r=[],n=[{label:"notes-api",src:t.apiDir,dest:(0,G.join)(e,"notes-api"),exclude:fG},{label:"notes-app",src:t.appDir,dest:(0,G.join)(e,"notes-app"),exclude:dG}];console.log(`
403
403
  [\u30A2\u30D7\u30EA] Notes \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30BD\u30FC\u30B9\u3092\u540C\u671F: ${e}`);for(let o of n){let i=(0,K.existsSync)(o.dest)?"\u66F4\u65B0":"\u914D\u7F6E";yA(o.src,o.dest,o.exclude),r.push(o.label),console.log(` \u2713 ${o.label}/ \u3092${i}`)}return r}function vA(e){return tp(e)}function wA(e){let t=(0,G.join)(e.outputDir,xn),r={...e,outputDir:"."};(0,K.writeFileSync)(t,JSON.stringify(r,null,2)+`
404
- `,"utf-8")}async function dG(e,t){console.log(`
404
+ `,"utf-8")}async function hG(e,t){console.log(`
405
405
  --- \u30AF\u30E9\u30A6\u30C9\u30D7\u30ED\u30D0\u30A4\u30C0\u9078\u629E ---`);let r=Object.entries(Ep);for(let s=0;s<r.length;s++){let[a,c]=r[s],u=a===(t??"aws");console.log(` ${s+1}. ${c}${u?" [\u30C7\u30D5\u30A9\u30EB\u30C8]":""}`)}let n=r.findIndex(([s])=>s===(t??"aws"))+1,o=await oe(e,`
406
- \u9078\u629E [${n}]: `)||String(n),i=parseInt(o,10)-1;return(i<0||i>=r.length)&&(console.error("\u30A8\u30E9\u30FC: \u7121\u52B9\u306A\u9078\u629E\u3067\u3059\u3002"),process.exit(1)),r[i][0]}async function fG(e,t){console.log(`
406
+ \u9078\u629E [${n}]: `)||String(n),i=parseInt(o,10)-1;return(i<0||i>=r.length)&&(console.error("\u30A8\u30E9\u30FC: \u7121\u52B9\u306A\u9078\u629E\u3067\u3059\u3002"),process.exit(1)),r[i][0]}async function mG(e,t){console.log(`
407
407
  --- AWS \u30A2\u30AB\u30A6\u30F3\u30C8\u8A2D\u5B9A ---`);let r=await oe(e,`AWS \u30A2\u30AB\u30A6\u30F3\u30C8 ID${t.accountId?` [${t.accountId}]`:""}: `)||t.accountId||"";(!r||!/^\d{12}$/.test(r))&&(console.error("\u30A8\u30E9\u30FC: 12\u6841\u306E AWS \u30A2\u30AB\u30A6\u30F3\u30C8 ID \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let n=await oe(e,`AWS \u30EA\u30FC\u30B8\u30E7\u30F3 [${t.region??"ap-northeast-1"}]: `)||t.region||"ap-northeast-1",o=await oe(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
408
408
  --- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let i=await oe(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",s=await oe(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!i||!s)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
409
409
  --- \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u8A2D\u5B9A ---`);let a=await oe(e,`VPC CIDR [${t.vpcCidr??"10.2.0.0/16"}]: `)||t.vpcCidr||"10.2.0.0/16";console.log(`
410
410
  --- \u30EA\u30BD\u30FC\u30B9\u30B5\u30A4\u30BA ---`);let c=await oe(e,`RDS \u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u30AF\u30E9\u30B9 [${t.rdsInstanceClass??"db.t4g.micro"}]: `)||t.rdsInstanceClass||"db.t4g.micro",u=await oe(e,`ECS CPU (vCPU \u5358\u4F4D) [${t.ecsCpu??256}]: `)||String(t.ecsCpu??256),p=await oe(e,`ECS \u30E1\u30E2\u30EA (MB) [${t.ecsMemory??512}]: `)||String(t.ecsMemory??512);console.log(`
411
- --- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".",d=parseInt(u,10),f=parseInt(p,10);return{provider:"aws",accountId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,rdsInstanceClass:c,ecsCpu:Number.isFinite(d)?d:256,ecsMemory:Number.isFinite(f)?f:512,outputDir:(0,G.resolve)(l)}}async function hG(e,t){console.log(`
411
+ --- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".",d=parseInt(u,10),f=parseInt(p,10);return{provider:"aws",accountId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,rdsInstanceClass:c,ecsCpu:Number.isFinite(d)?d:256,ecsMemory:Number.isFinite(f)?f:512,outputDir:(0,G.resolve)(l)}}async function gG(e,t){console.log(`
412
412
  --- GCP \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8A2D\u5B9A ---`);let r=await oe(e,`GCP \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ID${t.projectId?` [${t.projectId}]`:""}: `)||t.projectId||"";r||(console.error("\u30A8\u30E9\u30FC: GCP \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ID \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1));let n=await oe(e,`GCP \u30EA\u30FC\u30B8\u30E7\u30F3 [${t.region??"asia-northeast1"}]: `)||t.region||"asia-northeast1",o=await oe(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
413
413
  --- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let i=await oe(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",s=await oe(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!i||!s)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
414
414
  --- \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u8A2D\u5B9A ---`);let a=await oe(e,`VPC CIDR [${t.vpcCidr??"10.0.0.0/16"}]: `)||t.vpcCidr||"10.0.0.0/16";console.log(`
415
415
  --- \u30EA\u30BD\u30FC\u30B9\u30B5\u30A4\u30BA ---`);let c=await oe(e,`Cloud SQL \u30C6\u30A3\u30A2 [${t.dbTier??"db-f1-micro"}]: `)||t.dbTier||"db-f1-micro",u=await oe(e,`Cloud Run CPU [${t.cpuLimit??"1"}]: `)||t.cpuLimit||"1",p=await oe(e,`Cloud Run \u30E1\u30E2\u30EA [${t.memoryLimit??"512Mi"}]: `)||t.memoryLimit||"512Mi";console.log(`
416
- --- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".";return{provider:"gcp",projectId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,dbTier:c,cpuLimit:u,memoryLimit:p,outputDir:(0,G.resolve)(l)}}async function mG(e,t){console.log(`
416
+ --- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".";return{provider:"gcp",projectId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,dbTier:c,cpuLimit:u,memoryLimit:p,outputDir:(0,G.resolve)(l)}}async function yG(e,t){console.log(`
417
417
  --- Azure \u30B5\u30D6\u30B9\u30AF\u30EA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A ---`);let r=await oe(e,`Azure Subscription ID${t.subscriptionId?` [${t.subscriptionId}]`:""}: `)||t.subscriptionId||"";r||(console.error("\u30A8\u30E9\u30FC: Azure Subscription ID \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1));let n=await oe(e,`Azure \u30EA\u30FC\u30B8\u30E7\u30F3 [${t.region??"japaneast"}]: `)||t.region||"japaneast",o=await oe(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
418
418
  --- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let i=await oe(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",s=await oe(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!i||!s)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
419
419
  --- \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u8A2D\u5B9A ---`);let a=await oe(e,`VNet CIDR [${t.vpcCidr??"10.0.0.0/16"}]: `)||t.vpcCidr||"10.0.0.0/16";console.log(`
420
420
  --- \u30EA\u30BD\u30FC\u30B9\u30B5\u30A4\u30BA ---`);let c=await oe(e,`PostgreSQL SKU [${t.dbSku??"B_Standard_B1ms"}]: `)||t.dbSku||"B_Standard_B1ms",u=await oe(e,`Container App CPU [${t.cpuLimit??.25}]: `)||String(t.cpuLimit??.25),p=await oe(e,`Container App \u30E1\u30E2\u30EA [${t.memoryLimit??"0.5Gi"}]: `)||t.memoryLimit||"0.5Gi";console.log(`
421
- --- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".",d=parseFloat(u);return{provider:"azure",subscriptionId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,dbSku:c,cpuLimit:Number.isFinite(d)?d:.25,memoryLimit:p,outputDir:(0,G.resolve)(l)}}async function gG(e,t){console.log(`
421
+ --- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".",d=parseFloat(u);return{provider:"azure",subscriptionId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,dbSku:c,cpuLimit:Number.isFinite(d)?d:.25,memoryLimit:p,outputDir:(0,G.resolve)(l)}}async function _G(e,t){console.log(`
422
422
  --- Vercel + Railway \u8A2D\u5B9A ---`);let r=await oe(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
423
423
  --- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let n=await oe(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",o=await oe(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!n||!o)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
424
424
  --- Railway \u8A2D\u5B9A ---`);let i=await oe(e,`Railway API URL${t.railwayApiUrl?` [${t.railwayApiUrl}]`:""}: `)||t.railwayApiUrl||"";i||console.log(" \u203B Railway \u30C7\u30D7\u30ED\u30A4\u5F8C\u306B URL \u304C\u767A\u884C\u3055\u308C\u307E\u3059\u3002\u5F8C\u304B\u3089 .godd-notes-infra.json \u3067\u8A2D\u5B9A\u53EF\u80FD\u3067\u3059\u3002"),console.log(`
425
- --- \u51FA\u529B\u5148 ---`);let s=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".";return{provider:"vercel-railway",env:r,githubOwner:n,githubRepo:o,railwayApiUrl:i||"https://your-api.up.railway.app",outputDir:(0,G.resolve)(s)}}async function yG(e){console.log(`
425
+ --- \u51FA\u529B\u5148 ---`);let s=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".";return{provider:"vercel-railway",env:r,githubOwner:n,githubRepo:o,railwayApiUrl:i||"https://your-api.up.railway.app",outputDir:(0,G.resolve)(s)}}async function vG(e){console.log(`
426
426
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
427
427
  \u2551 GoDD Notes \u30A4\u30F3\u30D5\u30E9\u69CB\u7BC9\u30A6\u30A3\u30B6\u30FC\u30C9 \u2551
428
428
  \u2551 \u30A2\u30D7\u30EA + Terraform + GitHub Actions \u81EA\u52D5\u751F\u6210 \u2551
@@ -430,15 +430,15 @@ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
430
430
  \u2551 \u5BFE\u5FDC\u30D7\u30ED\u30D0\u30A4\u30C0: \u2551
431
431
  \u2551 AWS / GCP / Azure / Vercel\xD7Railway \u2551
432
432
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
433
- `);let t=vA(process.cwd());switch(await dG(e,t?.provider)){case"aws":return fG(e,t??{});case"gcp":return hG(e,t??{});case"azure":return mG(e,t??{});case"vercel-railway":return gG(e,t??{})}}function Pn(e,t){let r;try{r=(0,K.readFileSync)(e,"utf-8")}catch(n){throw new Error(`\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30D5\u30A1\u30A4\u30EB\u304C\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${e} \u2014 ${ye(n)}`,{cause:n})}try{return hA.default.compile(r,{noEscape:!0})(t)}catch(n){throw new Error(`\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30B3\u30F3\u30D1\u30A4\u30EB/\u30EC\u30F3\u30C0\u30EA\u30F3\u30B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} \u2014 ${ye(n)}`,{cause:n})}}function uA(e){switch(console.log(`
434
- --- \u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30D7\u30ED\u30D0\u30A4\u30C0: ${Ep[e.provider]}`),console.log(` \u74B0\u5883: ${e.env}`),console.log(` GitHub: ${e.githubOwner}/${e.githubRepo}`),e.provider){case"aws":console.log(` AWS \u30A2\u30AB\u30A6\u30F3\u30C8: ${e.accountId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` VPC CIDR: ${e.vpcCidr}`),console.log(` RDS: ${e.rdsInstanceClass}`),console.log(` ECS: ${e.ecsCpu} CPU / ${e.ecsMemory} MB`);break;case"gcp":console.log(` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${e.projectId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` Cloud SQL: ${e.dbTier}`),console.log(` Cloud Run: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"azure":console.log(` Subscription: ${e.subscriptionId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` PostgreSQL: ${e.dbSku}`),console.log(` Container App: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"vercel-railway":console.log(` Railway API: ${e.railwayApiUrl}`);break}console.log(` \u51FA\u529B\u5148: ${e.outputDir}`)}function lA(e){let t=cG(e.provider);t||(console.error(`\u30A8\u30E9\u30FC: ${e.provider} \u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002`),process.exit(1));let{terraformDir:r,ghaDir:n}=t,o=e;e.provider==="aws"?_G(r,n,e,o):vG(r,n,e,o),_A(e.outputDir),wA(e),console.log(`
435
- \u2713 \u8A2D\u5B9A\u3092 ${(0,G.join)(e.outputDir,xn)} \u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F`)}function _G(e,t,r,n){let o=(0,G.join)(r.outputDir,"terraform","godd-notes",r.env),i=(0,G.join)(r.outputDir,"terraform","godd-notes",`${r.env}-iam`),s=(0,G.join)(r.outputDir,".github","workflows");(0,K.mkdirSync)(o,{recursive:!0}),(0,K.mkdirSync)(i,{recursive:!0}),(0,K.mkdirSync)(s,{recursive:!0});let a=(0,K.readdirSync)(e).filter(x=>x.endsWith(".tf.hbs")),c=["iam.tf.hbs"],u=a.filter(x=>!c.includes(x)),p=(0,G.resolve)(e,"..","..","scripts","aws"),l=(0,G.join)(p,"terraform-backend-setup.sh.hbs"),d=(0,K.existsSync)(l),f=d?4:3,h=[];console.log(`
433
+ `);let t=vA(process.cwd());switch(await hG(e,t?.provider)){case"aws":return mG(e,t??{});case"gcp":return gG(e,t??{});case"azure":return yG(e,t??{});case"vercel-railway":return _G(e,t??{})}}function Pn(e,t){let r;try{r=(0,K.readFileSync)(e,"utf-8")}catch(n){throw new Error(`\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30D5\u30A1\u30A4\u30EB\u304C\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${e} \u2014 ${ye(n)}`,{cause:n})}try{return hA.default.compile(r,{noEscape:!0})(t)}catch(n){throw new Error(`\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30B3\u30F3\u30D1\u30A4\u30EB/\u30EC\u30F3\u30C0\u30EA\u30F3\u30B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} \u2014 ${ye(n)}`,{cause:n})}}function uA(e){switch(console.log(`
434
+ --- \u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30D7\u30ED\u30D0\u30A4\u30C0: ${Ep[e.provider]}`),console.log(` \u74B0\u5883: ${e.env}`),console.log(` GitHub: ${e.githubOwner}/${e.githubRepo}`),e.provider){case"aws":console.log(` AWS \u30A2\u30AB\u30A6\u30F3\u30C8: ${e.accountId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` VPC CIDR: ${e.vpcCidr}`),console.log(` RDS: ${e.rdsInstanceClass}`),console.log(` ECS: ${e.ecsCpu} CPU / ${e.ecsMemory} MB`);break;case"gcp":console.log(` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${e.projectId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` Cloud SQL: ${e.dbTier}`),console.log(` Cloud Run: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"azure":console.log(` Subscription: ${e.subscriptionId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` PostgreSQL: ${e.dbSku}`),console.log(` Container App: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"vercel-railway":console.log(` Railway API: ${e.railwayApiUrl}`);break}console.log(` \u51FA\u529B\u5148: ${e.outputDir}`)}function lA(e){let t=lG(e.provider);t||(console.error(`\u30A8\u30E9\u30FC: ${e.provider} \u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002`),process.exit(1));let{terraformDir:r,ghaDir:n}=t,o=e;e.provider==="aws"?wG(r,n,e,o):bG(r,n,e,o),_A(e.outputDir),wA(e),console.log(`
435
+ \u2713 \u8A2D\u5B9A\u3092 ${(0,G.join)(e.outputDir,xn)} \u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F`)}function wG(e,t,r,n){let o=(0,G.join)(r.outputDir,"terraform","godd-notes",r.env),i=(0,G.join)(r.outputDir,"terraform","godd-notes",`${r.env}-iam`),s=(0,G.join)(r.outputDir,".github","workflows");(0,K.mkdirSync)(o,{recursive:!0}),(0,K.mkdirSync)(i,{recursive:!0}),(0,K.mkdirSync)(s,{recursive:!0});let a=(0,K.readdirSync)(e).filter(x=>x.endsWith(".tf.hbs")),c=["iam.tf.hbs"],u=a.filter(x=>!c.includes(x)),p=(0,G.resolve)(e,"..","..","scripts","aws"),l=(0,G.join)(p,"terraform-backend-setup.sh.hbs"),d=(0,K.existsSync)(l),f=d?4:3,h=[];console.log(`
436
436
  [1/${f}] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let x of u){let k=x.replace(".hbs",""),P=Pn((0,G.join)(e,x),n);(0,K.writeFileSync)((0,G.join)(o,k),P,"utf-8"),console.log(` \u2713 ${k}`)}console.log(`
437
437
  [2/${f}] IAM Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${i}`);for(let x of c){let k=x.replace(".hbs",""),P=Pn((0,G.join)(e,x),n);(0,K.writeFileSync)((0,G.join)(i,k),P,"utf-8"),console.log(` \u2713 ${k}`)}let g=(0,G.join)(e,"local.tf.hbs");if((0,K.existsSync)(g)){let x=Pn(g,n);(0,K.writeFileSync)((0,G.join)(i,"local.tf"),x,"utf-8"),console.log(" \u2713 local.tf")}else console.warn(` \u26A0 local.tf.hbs \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${g}`),h.push("local.tf.hbs");let y=(0,G.join)(e,"provider.tf.hbs");if((0,K.existsSync)(y)){let x=Pn(y,n);(0,K.writeFileSync)((0,G.join)(i,"provider.tf"),x,"utf-8"),console.log(" \u2713 provider.tf")}else console.warn(` \u26A0 provider.tf.hbs \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${y}`),h.push("provider.tf.hbs");let v=(0,G.join)(e,"backend.tf.hbs");if((0,K.existsSync)(v)){let x=Pn(v,{...n,env:`${r.env}-iam`});(0,K.writeFileSync)((0,G.join)(i,"backend.tf"),x,"utf-8"),console.log(" \u2713 backend.tf")}else console.warn(` \u26A0 backend.tf.hbs \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${v}`),h.push("backend.tf.hbs");console.log(`
438
438
  [3/${f}] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${s}`);let w=(0,K.readdirSync)(t).filter(x=>x.endsWith(".yml.hbs"));for(let x of w){let k=x.replace(".hbs",""),P=Pn((0,G.join)(t,x),n);(0,K.writeFileSync)((0,G.join)(s,k),P,"utf-8"),console.log(` \u2713 ${k}`)}if(d){let x=(0,G.join)(r.outputDir,"scripts");(0,K.mkdirSync)(x,{recursive:!0}),console.log(`
439
439
  [4/${f}] \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u751F\u6210: ${x}`);let k=Pn(l,n),P=(0,G.join)(x,"terraform-backend-setup.sh");(0,K.writeFileSync)(P,k,"utf-8");try{(0,K.chmodSync)(P,493)}catch{}console.log(" \u2713 terraform-backend-setup.sh")}else console.warn(`
440
440
  \u26A0 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30B9\u30AF\u30EA\u30D7\u30C8\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: `+l),h.push("terraform-backend-setup.sh.hbs");if(h.length>0){console.warn(`
441
- \u26A0 \u30B9\u30AD\u30C3\u30D7\u3055\u308C\u305F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 (${h.length} \u4EF6):`);for(let x of h)console.warn(` - ${x}`)}}function vG(e,t,r,n){let o=(0,G.join)(r.outputDir,"terraform","godd-notes",r.env),i=(0,G.join)(r.outputDir,".github","workflows");(0,K.mkdirSync)(o,{recursive:!0}),(0,K.mkdirSync)(i,{recursive:!0});let s=(0,K.readdirSync)(e).filter(c=>c.endsWith(".tf.hbs"));console.log(`
441
+ \u26A0 \u30B9\u30AD\u30C3\u30D7\u3055\u308C\u305F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 (${h.length} \u4EF6):`);for(let x of h)console.warn(` - ${x}`)}}function bG(e,t,r,n){let o=(0,G.join)(r.outputDir,"terraform","godd-notes",r.env),i=(0,G.join)(r.outputDir,".github","workflows");(0,K.mkdirSync)(o,{recursive:!0}),(0,K.mkdirSync)(i,{recursive:!0});let s=(0,K.readdirSync)(e).filter(c=>c.endsWith(".tf.hbs"));console.log(`
442
442
  [1/2] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let c of s){let u=c.replace(".hbs",""),p=Pn((0,G.join)(e,c),n);(0,K.writeFileSync)((0,G.join)(o,u),p,"utf-8"),console.log(` \u2713 ${u}`)}console.log(`
443
443
  [2/2] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${i}`);let a=(0,K.readdirSync)(t).filter(c=>c.endsWith(".yml.hbs"));for(let c of a){let u=c.replace(".hbs",""),p=Pn((0,G.join)(t,c),n);(0,K.writeFileSync)((0,G.join)(i,u),p,"utf-8"),console.log(` \u2713 ${u}`)}}function bA(){return["export AWS_PROFILE=<PROFILE>",'$env:AWS_PROFILE="<PROFILE>"']}function pA(e){let[t,r]=bA();switch(e.provider){case"aws":console.log(`
444
444
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
@@ -551,7 +551,7 @@ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
551
551
  \u2551 godd notes deploy -y \u2551
552
552
  \u2551 \u2551
553
553
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
554
- `);break}}async function wG(e){if(e.includes("--help")||e.includes("-h")){console.log(`
554
+ `);break}}async function xG(e){if(e.includes("--help")||e.includes("-h")){console.log(`
555
555
  GoDD Notes Infra \u2014 \u30A2\u30D7\u30EA + \u30DE\u30EB\u30C1\u30AF\u30E9\u30A6\u30C9 \u30A4\u30F3\u30D5\u30E9\u81EA\u52D5\u751F\u6210
556
556
 
557
557
  Usage: godd notes infra [options]
@@ -570,9 +570,9 @@ Options:
570
570
  --yes, -y \u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A (.godd-notes-infra.json) \u3092\u5168\u9762\u63A1\u7528\u3057\u3066
571
571
  \u975E\u5BFE\u8A71\u3067\u30D5\u30A1\u30A4\u30EB\u751F\u6210\u3059\u308B\uFF08CI / AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u5411\u3051\uFF09
572
572
  --help, -h \u3053\u306E\u30D8\u30EB\u30D7\u3092\u8868\u793A
573
- `);return}if(e.includes("--yes")||e.includes("-y")){let r=vA(process.cwd()),n=mA(r);n.ok||(console.error(`\u30A8\u30E9\u30FC: ${n.error}`),process.exit(1)),console.log(`--yes: \u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A (${xn}) \u3092\u4F7F\u7528\u3057\u3066\u975E\u5BFE\u8A71\u3067\u751F\u6210\u3057\u307E\u3059\u3002`),uA(n.config),lA(n.config),pA(n.config);return}process.stdin.isTTY||console.warn("\u26A0 \u975E\u5BFE\u8A71\u74B0\u5883\uFF08stdin \u304C TTY \u3067\u306F\u306A\u3044\uFF09\u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002\u30D1\u30A4\u30D7\u5165\u529B\u306F\u53D6\u308A\u3053\u307C\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002CI / AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304B\u3089\u306E\u5B9F\u884C\u306B\u306F --yes \u3092\u63A8\u5968\u3057\u307E\u3059\u3002");let t=sG();try{let r=await yG(t);if(uA(r),(await oe(t,`
574
- \u3053\u306E\u8A2D\u5B9A\u3067\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}lA(r),pA(r)}finally{t.close()}}var dA,K,G,fA,hA,Ep,oG,iG,uG,lG,pG,kA=b(()=>{"use strict";dA=yt(require("node:readline"),1),K=require("node:fs"),G=require("node:path"),fA=require("node:url"),hA=yt(Ql(),1);Xt();rp();Ep={aws:"AWS (ECS Fargate + S3/CloudFront + RDS)",gcp:"GCP (Cloud Run + GCS + Cloud SQL)",azure:"Azure (Container Apps + Blob Storage + PostgreSQL)","vercel-railway":"Vercel \xD7 Railway (PaaS)"},oG=["env","githubOwner","githubRepo","outputDir"],iG={aws:["accountId","region","vpcCidr","rdsInstanceClass","ecsCpu","ecsMemory"],gcp:["projectId","region","vpcCidr","dbTier","cpuLimit","memoryLimit"],azure:["subscriptionId","region","vpcCidr","dbSku","cpuLimit","memoryLimit"],"vercel-railway":["railwayApiUrl"]};uG=new Set([".git","coverage","dist","node_modules"]),lG=new Set(["playwright-report","test-results"]),pG=new Set([".pytest_cache",".ruff_cache",".venv","__pycache__"])});var UA={};tr(UA,{checkAwsPrerequisites:()=>RA,checkDocker:()=>n_,ensureNotesComposeGitignoreEntries:()=>MA,generateEnvFile:()=>zA,generateSecret:()=>tn,getTerraformOutputs:()=>Tp,hasGithubReadAuth:()=>bG,loadComposeConfig:()=>jA,loadInfraConfig:()=>o_,parseDeployFlags:()=>OA,resolveComposeDeployDir:()=>NA,runNotes:()=>zG,saveComposeConfig:()=>ZA,toComposeEnvValue:()=>IA});function TA(){return EA.createInterface({input:process.stdin,output:process.stdout})}function Ht(e,t){return new Promise(r=>{e.question(t,n=>r(n.trim()))})}function tn(e=48){return CA.randomBytes(e).toString("base64url").slice(0,e)}function AA(e){return!!(e.githubAppId&&e.githubAppPrivateKey&&e.githubAppInstallationId)}function bG(e){return AA(e)}async function ic(e,t,r){for(;;){let n=await Ht(e,t);if(n)return n;console.log(r)}}function n_(){try{return it.execSync("docker --version",{stdio:"ignore",timeout:as}),it.execSync("docker compose version",{stdio:"ignore",timeout:as}),!0}catch{return!1}}function r_(e,t){(0,je.mkdirSync)(t,{recursive:!0});for(let r of(0,je.readdirSync)(e)){if(xG.has(r)||r.endsWith(".pyc")||r.endsWith(".tsbuildinfo"))continue;let n=(0,ve.join)(e,r),o=(0,ve.join)(t,r);(0,je.statSync)(n).isDirectory()?r_(n,o):(0,je.copyFileSync)(n,o)}}function kG(e,t){return new Promise((r,n)=>{let o=it.spawn("docker",["compose",...t],{cwd:e,stdio:"inherit"});o.on("error",i=>n(i)),o.on("close",i=>r(i??1))})}async function SA(e){return new Promise(t=>{let r=Ap.get(e,{timeout:3e3},n=>{let o="";n.on("data",i=>{o+=i.toString("utf-8")}),n.on("end",()=>{if(n.statusCode!==200){t(null);return}try{t(JSON.parse(o))}catch{t(null)}})});r.on("error",()=>t(null)),r.on("timeout",()=>{r.destroy(),t(null)})})}async function $A(e){let r=`${e.replace(/\/api\/health\/?$/,"")}/api/health/github-app`;return new Promise(n=>{let o=Ap.get(r,{timeout:1e4},i=>{i.resume(),n(i.statusCode===200)});o.on("error",()=>n(!1)),o.on("timeout",()=>{o.destroy(),n(!1)})})}function PA(e,t,r){if(console.log(` ${e}:`),!t){console.log(" \u2717 \u5FDC\u7B54\u306A\u3057");return}console.log(` status: ${t.status}`),console.log(` github_app_configured: ${t.github_app_configured?"yes":"no"}`),console.log(` github_write_author: ${t.github_write_author??"unknown"}`),t.github_write_author==="bot"?r===!0?console.log(" installation token refresh: \u2713 OK"):r===!1&&console.log(" installation token refresh: \u2717 \u5931\u6557\uFF08credentials \u307E\u305F\u306F Installation ID \u3092\u78BA\u8A8D\uFF09"):(console.log(" \u26A0 \u30E2\u30C3\u30AF\u30E2\u30FC\u30C9\uFF08GitHub App \u672A\u8A2D\u5B9A\uFF09\u3002PAT \u306F\u7981\u6B62\u3067\u3059\u3002GitHub App 3\u5909\u6570\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),console.log(" \u624B\u9806: docs/007_guides/bot-token-setup.md"))}async function SG(e,t=12e4){let r=Date.now(),n=3e3;for(;Date.now()-r<t;){if(await new Promise(i=>{let s=Ap.get(e,{timeout:3e3},a=>{a.resume(),i(a.statusCode===200)});s.on("error",()=>i(!1)),s.on("timeout",()=>{s.destroy(),i(!1)})}))return!0;await new Promise(i=>setTimeout(i,n))}return!1}function o_(e){return tp(e)}function Tp(e){if(!(0,je.existsSync)(e))throw new Error(`Terraform \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let t;try{t=it.execSync("terraform output -json",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch(s){throw new Error(`terraform output \u306E\u5B9F\u884C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002terraform init && terraform apply \u3092\u5148\u306B\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
575
- ${ye(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t.slice(0,200)}`)}let n=["ecr_repository_url","ecs_cluster_name","ecs_service_name","s3_bucket_name","cloudfront_distribution_id","cloudfront_domain","notes_app_url","notes_api_url"],o=n.filter(s=>!r[s]?.value);if(o.length>0)throw new Error(`Terraform output \u306B\u5FC5\u8981\u306A\u5024\u304C\u3042\u308A\u307E\u305B\u3093: ${o.join(", ")}`);let i={};for(let s of n)i[s]=r[s].value;return i}function RA(){let e=[];try{it.execSync("aws --version",{stdio:"pipe",timeout:as})}catch{e.push("AWS CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://aws.amazon.com/cli/")}try{it.execSync("aws sts get-caller-identity",{stdio:"pipe",timeout:as})}catch{e.push("AWS \u8A8D\u8A3C\u60C5\u5831\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002aws configure \u307E\u305F\u306F AWS SSO \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}try{it.execSync("docker --version",{stdio:"pipe",timeout:as})}catch{e.push("Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002")}try{it.execSync("pnpm --version",{stdio:"pipe",timeout:as})}catch{e.push("pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm")}return{ok:e.length===0,errors:e}}async function $G(e,t,r){let n=t.region??"ap-northeast-1",i=`${t.accountId??""}.dkr.ecr.${n}.amazonaws.com`;console.log(`
573
+ `);return}if(e.includes("--yes")||e.includes("-y")){let r=vA(process.cwd()),n=mA(r);n.ok||(console.error(`\u30A8\u30E9\u30FC: ${n.error}`),process.exit(1)),console.log(`--yes: \u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A (${xn}) \u3092\u4F7F\u7528\u3057\u3066\u975E\u5BFE\u8A71\u3067\u751F\u6210\u3057\u307E\u3059\u3002`),uA(n.config),lA(n.config),pA(n.config);return}process.stdin.isTTY||console.warn("\u26A0 \u975E\u5BFE\u8A71\u74B0\u5883\uFF08stdin \u304C TTY \u3067\u306F\u306A\u3044\uFF09\u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002\u30D1\u30A4\u30D7\u5165\u529B\u306F\u53D6\u308A\u3053\u307C\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002CI / AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304B\u3089\u306E\u5B9F\u884C\u306B\u306F --yes \u3092\u63A8\u5968\u3057\u307E\u3059\u3002");let t=cG();try{let r=await vG(t);if(uA(r),(await oe(t,`
574
+ \u3053\u306E\u8A2D\u5B9A\u3067\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}lA(r),pA(r)}finally{t.close()}}var dA,K,G,fA,hA,Ep,sG,aG,pG,dG,fG,kA=b(()=>{"use strict";dA=yt(require("node:readline"),1),K=require("node:fs"),G=require("node:path"),fA=require("node:url"),hA=yt(Ql(),1);Xt();rp();Ep={aws:"AWS (ECS Fargate + S3/CloudFront + RDS)",gcp:"GCP (Cloud Run + GCS + Cloud SQL)",azure:"Azure (Container Apps + Blob Storage + PostgreSQL)","vercel-railway":"Vercel \xD7 Railway (PaaS)"},sG=["env","githubOwner","githubRepo","outputDir"],aG={aws:["accountId","region","vpcCidr","rdsInstanceClass","ecsCpu","ecsMemory"],gcp:["projectId","region","vpcCidr","dbTier","cpuLimit","memoryLimit"],azure:["subscriptionId","region","vpcCidr","dbSku","cpuLimit","memoryLimit"],"vercel-railway":["railwayApiUrl"]};pG=new Set([".git","coverage","dist","node_modules"]),dG=new Set(["playwright-report","test-results"]),fG=new Set([".pytest_cache",".ruff_cache",".venv","__pycache__"])});var UA={};tr(UA,{checkAwsPrerequisites:()=>RA,checkDocker:()=>n_,ensureNotesComposeGitignoreEntries:()=>MA,generateEnvFile:()=>zA,generateSecret:()=>tn,getTerraformOutputs:()=>Tp,hasGithubReadAuth:()=>kG,loadComposeConfig:()=>jA,loadInfraConfig:()=>o_,parseDeployFlags:()=>OA,resolveComposeDeployDir:()=>NA,runNotes:()=>OG,saveComposeConfig:()=>ZA,toComposeEnvValue:()=>IA});function TA(){return EA.createInterface({input:process.stdin,output:process.stdout})}function Ht(e,t){return new Promise(r=>{e.question(t,n=>r(n.trim()))})}function tn(e=48){return CA.randomBytes(e).toString("base64url").slice(0,e)}function AA(e){return!!(e.githubAppId&&e.githubAppPrivateKey&&e.githubAppInstallationId)}function kG(e){return AA(e)}async function ic(e,t,r){for(;;){let n=await Ht(e,t);if(n)return n;console.log(r)}}function n_(){try{return it.execSync("docker --version",{stdio:"ignore",timeout:as}),it.execSync("docker compose version",{stdio:"ignore",timeout:as}),!0}catch{return!1}}function r_(e,t){(0,je.mkdirSync)(t,{recursive:!0});for(let r of(0,je.readdirSync)(e)){if(SG.has(r)||r.endsWith(".pyc")||r.endsWith(".tsbuildinfo"))continue;let n=(0,ve.join)(e,r),o=(0,ve.join)(t,r);(0,je.statSync)(n).isDirectory()?r_(n,o):(0,je.copyFileSync)(n,o)}}function $G(e,t){return new Promise((r,n)=>{let o=it.spawn("docker",["compose",...t],{cwd:e,stdio:"inherit"});o.on("error",i=>n(i)),o.on("close",i=>r(i??1))})}async function SA(e){return new Promise(t=>{let r=Ap.get(e,{timeout:3e3},n=>{let o="";n.on("data",i=>{o+=i.toString("utf-8")}),n.on("end",()=>{if(n.statusCode!==200){t(null);return}try{t(JSON.parse(o))}catch{t(null)}})});r.on("error",()=>t(null)),r.on("timeout",()=>{r.destroy(),t(null)})})}async function $A(e){let r=`${e.replace(/\/api\/health\/?$/,"")}/api/health/github-app`;return new Promise(n=>{let o=Ap.get(r,{timeout:1e4},i=>{i.resume(),n(i.statusCode===200)});o.on("error",()=>n(!1)),o.on("timeout",()=>{o.destroy(),n(!1)})})}function PA(e,t,r){if(console.log(` ${e}:`),!t){console.log(" \u2717 \u5FDC\u7B54\u306A\u3057");return}console.log(` status: ${t.status}`),console.log(` github_app_configured: ${t.github_app_configured?"yes":"no"}`),console.log(` github_write_author: ${t.github_write_author??"unknown"}`),t.github_write_author==="bot"?r===!0?console.log(" installation token refresh: \u2713 OK"):r===!1&&console.log(" installation token refresh: \u2717 \u5931\u6557\uFF08credentials \u307E\u305F\u306F Installation ID \u3092\u78BA\u8A8D\uFF09"):(console.log(" \u26A0 \u30E2\u30C3\u30AF\u30E2\u30FC\u30C9\uFF08GitHub App \u672A\u8A2D\u5B9A\uFF09\u3002PAT \u306F\u7981\u6B62\u3067\u3059\u3002GitHub App 3\u5909\u6570\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),console.log(" \u624B\u9806: docs/007_guides/bot-token-setup.md"))}async function PG(e,t=12e4){let r=Date.now(),n=3e3;for(;Date.now()-r<t;){if(await new Promise(i=>{let s=Ap.get(e,{timeout:3e3},a=>{a.resume(),i(a.statusCode===200)});s.on("error",()=>i(!1)),s.on("timeout",()=>{s.destroy(),i(!1)})}))return!0;await new Promise(i=>setTimeout(i,n))}return!1}function o_(e){return tp(e)}function Tp(e){if(!(0,je.existsSync)(e))throw new Error(`Terraform \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let t;try{t=it.execSync("terraform output -json",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch(s){throw new Error(`terraform output \u306E\u5B9F\u884C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002terraform init && terraform apply \u3092\u5148\u306B\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
575
+ ${ye(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t.slice(0,200)}`)}let n=["ecr_repository_url","ecs_cluster_name","ecs_service_name","s3_bucket_name","cloudfront_distribution_id","cloudfront_domain","notes_app_url","notes_api_url"],o=n.filter(s=>!r[s]?.value);if(o.length>0)throw new Error(`Terraform output \u306B\u5FC5\u8981\u306A\u5024\u304C\u3042\u308A\u307E\u305B\u3093: ${o.join(", ")}`);let i={};for(let s of n)i[s]=r[s].value;return i}function RA(){let e=[];try{it.execSync("aws --version",{stdio:"pipe",timeout:as})}catch{e.push("AWS CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://aws.amazon.com/cli/")}try{it.execSync("aws sts get-caller-identity",{stdio:"pipe",timeout:as})}catch{e.push("AWS \u8A8D\u8A3C\u60C5\u5831\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002aws configure \u307E\u305F\u306F AWS SSO \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}try{it.execSync("docker --version",{stdio:"pipe",timeout:as})}catch{e.push("Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002")}try{it.execSync("pnpm --version",{stdio:"pipe",timeout:as})}catch{e.push("pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm")}return{ok:e.length===0,errors:e}}async function EG(e,t,r){let n=t.region??"ap-northeast-1",i=`${t.accountId??""}.dkr.ecr.${n}.amazonaws.com`;console.log(`
576
576
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
577
577
  \u2551 GoDD Notes \u2014 AWS \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
578
578
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
@@ -596,7 +596,7 @@ ${ye(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u3
596
596
  \u2551 --services ${e.ecs_service_name.padEnd(32)}\u2551
597
597
  \u2551 \u2551
598
598
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
599
- `)}async function PG(e){console.log(`
599
+ `)}async function CG(e){console.log(`
600
600
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
601
601
  \u2551 GoDD Notes \u30C7\u30D7\u30ED\u30A4\u30A6\u30A3\u30B6\u30FC\u30C9 \u2551
602
602
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
@@ -610,9 +610,9 @@ ${ye(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u3
610
610
  `).replace(/\n/g,"\\n")}function zA(e){return["# GoDD Notes \u74B0\u5883\u5909\u6570\uFF08\u81EA\u52D5\u751F\u6210\uFF09",`POSTGRES_USER=${e.postgresUser}`,`POSTGRES_PASSWORD=${e.postgresPassword}`,`POSTGRES_DB=${e.postgresDb}`,`POSTGRES_PORT=${e.postgresPort}`,`NOTES_API_PORT=${e.notesApiPort}`,`NOTES_APP_PORT=${e.notesAppPort}`,`GITHUB_APP_ID=${e.githubAppId}`,`GITHUB_APP_PRIVATE_KEY=${IA(e.githubAppPrivateKey)}`,`GITHUB_APP_INSTALLATION_ID=${e.githubAppInstallationId}`,`GITHUB_OWNER=${e.githubOwner}`,`GITHUB_REPO=${e.githubRepo}`,`GITHUB_BRANCH=${e.githubBranch}`,`JWT_SECRET=${e.jwtSecret}`,`NOTES_ADMIN_USERNAME=${e.adminUsername}`,`NOTES_ADMIN_PASSWORD=${e.adminPassword}`,""].join(`
611
611
  `)}async function DA(e){let t=q2({preferredRoots:[process.cwd()]});t||(console.error("\u30A8\u30E9\u30FC: notes-api / notes-app \u306E\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),console.error("npm \u30D1\u30C3\u30B1\u30FC\u30B8\u304C\u6B63\u3057\u304F\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u308B\u304B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let{apiDir:r,appDir:n,composeTemplate:o}=t;try{console.log(`
612
612
  [1/5] \u30C7\u30D7\u30ED\u30A4\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6E96\u5099: ${e.deployDir}`),(0,je.mkdirSync)(e.deployDir,{recursive:!0}),console.log("[2/5] notes-api \u3092\u30B3\u30D4\u30FC..."),r_(r,(0,ve.join)(e.deployDir,"notes-api")),console.log("[3/5] notes-app \u3092\u30B3\u30D4\u30FC..."),r_(n,(0,ve.join)(e.deployDir,"notes-app")),console.log("[4/5] docker-compose.yml \u3068 .env \u3092\u751F\u6210...");let p=(0,je.readFileSync)(o,"utf-8");(0,je.writeFileSync)((0,ve.join)(e.deployDir,"docker-compose.yml"),p,"utf-8"),(0,je.writeFileSync)((0,ve.join)(e.deployDir,".env"),zA(e),"utf-8")}catch(p){let l=p instanceof Error?p.message:String(p);console.error(`
613
- \u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${l}`),console.error(`\u30C7\u30D7\u30ED\u30A4\u5148\u306E\u30D1\u30B9\u3068\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044: ${e.deployDir}`),process.exit(1)}console.log("[5/5] Docker Compose \u3067\u30B5\u30FC\u30D3\u30B9\u3092\u8D77\u52D5..."),await kG(e.deployDir,["up","-d","--build"])!==0&&(console.error(`
613
+ \u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${l}`),console.error(`\u30C7\u30D7\u30ED\u30A4\u5148\u306E\u30D1\u30B9\u3068\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044: ${e.deployDir}`),process.exit(1)}console.log("[5/5] Docker Compose \u3067\u30B5\u30FC\u30D3\u30B9\u3092\u8D77\u52D5..."),await $G(e.deployDir,["up","-d","--build"])!==0&&(console.error(`
614
614
  \u30A8\u30E9\u30FC: docker compose up \u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002`),console.error(`\u30ED\u30B0\u3092\u78BA\u8A8D: cd ${e.deployDir} && docker compose logs`),process.exit(1)),console.log(`
615
- \u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u5F85\u6A5F\u4E2D...`);let s=`http://localhost:${e.notesApiPort}/api/health`;await SG(s)||(console.warn(`
615
+ \u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u5F85\u6A5F\u4E2D...`);let s=`http://localhost:${e.notesApiPort}/api/health`;await PG(s)||(console.warn(`
616
616
  \u8B66\u544A: \u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u304C\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u3057\u307E\u3057\u305F\u3002`),console.warn("\u30B5\u30FC\u30D3\u30B9\u306E\u8D77\u52D5\u306B\u6642\u9593\u304C\u304B\u304B\u3063\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"),console.warn(`\u624B\u52D5\u3067\u78BA\u8A8D: curl ${s}`));let c=`http://localhost:${e.notesAppPort}`,u=`http://localhost:${e.notesApiPort}`;console.log(`
617
617
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
618
618
  \u2551 GoDD Notes \u30C7\u30D7\u30ED\u30A4\u5B8C\u4E86 \u2551
@@ -636,10 +636,10 @@ ${ye(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u3
636
636
  docker compose stop # \u505C\u6B62
637
637
  docker compose start # \u518D\u958B
638
638
  docker compose down -v # \u5B8C\u5168\u524A\u9664
639
- `)}async function EG(e){n_()||(console.error("\u30A8\u30E9\u30FC: Docker \u304A\u3088\u3073 Docker Compose \u304C\u5FC5\u8981\u3067\u3059\u3002"),console.error("https://docs.docker.com/get-docker/ \u304B\u3089\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let t=await PG(e);if(console.log(`
639
+ `)}async function TG(e){n_()||(console.error("\u30A8\u30E9\u30FC: Docker \u304A\u3088\u3073 Docker Compose \u304C\u5FC5\u8981\u3067\u3059\u3002"),console.error("https://docs.docker.com/get-docker/ \u304B\u3089\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let t=await CG(e);if(console.log(`
640
640
  --- \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30C7\u30D7\u30ED\u30A4\u5148: ${t.deployDir}`),console.log(` DB: ${t.postgresUser}@localhost:${t.postgresPort}/${t.postgresDb}`),console.log(` API \u30DD\u30FC\u30C8: ${t.notesApiPort}`),console.log(` App \u30DD\u30FC\u30C8: ${t.notesAppPort}`),console.log(` GitHub: ${t.githubOwner}/${t.githubRepo} (${t.githubBranch})`),console.log(" GitHub App: \u8A2D\u5B9A\u6E08\u307F (Bot author)"),console.log(` \u7BA1\u7406\u8005: ${t.adminUsername}`),(await Ht(e,`
641
- \u3053\u306E\u8A2D\u5B9A\u3067\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}LA(),await DA(t)}function OA(e){let t=!1;for(let r=0;r<e.length;r++)(e[r]==="--yes"||e[r]==="-y")&&(t=!0);return{yes:t}}function CG(e){let t=!1,r=null;for(let n=0;n<e.length;n++)e[n]==="--auto"?t=!0:e[n]==="--config"&&n+1<e.length&&(r=e[++n]);return{auto:t,configPath:r}}function NA(e,t){let r=(0,ve.resolve)(t,"godd-notes");return typeof e!="string"||e===""?r:oy(e)?(0,je.existsSync)(e)?(0,ve.resolve)(e):(console.warn(` \u26A0 ${i_} \u306E deployDir \u304C\u3053\u306E\u30DE\u30B7\u30F3\u306B\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e} \u2192 ${r}`),r):(0,ve.resolve)(t,e)}function jA(e){if(!(0,je.existsSync)(e))throw new Error(`\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let t;try{t=JSON.parse((0,je.readFileSync)(e,"utf-8"))}catch{throw new Error(`\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08JSON \u5F62\u5F0F\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\uFF09: ${e}`)}return{deployDir:NA(t.deployDir,(0,ve.dirname)((0,ve.resolve)(e))),postgresUser:t.postgresUser??"app_user",postgresPassword:t.postgresPassword??tn(24),postgresDb:t.postgresDb??"godd_notes",postgresPort:t.postgresPort??"5432",notesApiPort:t.notesApiPort??"3100",notesAppPort:t.notesAppPort??"5175",githubAppId:t.githubAppId??"",githubAppPrivateKey:t.githubAppPrivateKey??"",githubAppInstallationId:t.githubAppInstallationId??"",githubOwner:t.githubOwner??"",githubRepo:t.githubRepo??"",githubBranch:t.githubBranch??"main",jwtSecret:t.jwtSecret??tn(48),adminUsername:t.adminUsername??"admin",adminPassword:t.adminPassword??tn(16)}}function TG(){return{deployDir:(0,ve.resolve)("./godd-notes"),postgresUser:"app_user",postgresPassword:tn(24),postgresDb:"godd_notes",postgresPort:"5432",notesApiPort:"3100",notesAppPort:"5175",githubAppId:process.env.GITHUB_APP_ID??"",githubAppPrivateKey:process.env.GITHUB_APP_PRIVATE_KEY??"",githubAppInstallationId:process.env.GITHUB_APP_INSTALLATION_ID??"",githubOwner:process.env.GITHUB_OWNER??"",githubRepo:process.env.GITHUB_REPO??"",githubBranch:process.env.GITHUB_BRANCH??"main",jwtSecret:tn(48),adminUsername:"admin",adminPassword:tn(16)}}function MA(e=process.cwd()){return fp(e,AG)}function LA(e=process.cwd()){MA(e)?console.log("\u2713 Notes compose \u751F\u6210\u7269\u3092 .gitignore \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F"):console.log("\u2713 Notes compose \u751F\u6210\u7269\u306F .gitignore \u306B\u8FFD\u52A0\u6E08\u307F\u3067\u3059")}function ZA(e,t=process.cwd()){let{postgresPassword:r,jwtSecret:n,adminPassword:o,githubAppPrivateKey:i,...s}=e,a=(0,ve.relative)(t,e.deployDir),c=a===""?".":!a.startsWith("..")&&!(0,ve.isAbsolute)(a)?a:e.deployDir;(0,je.writeFileSync)((0,ve.join)(t,i_),JSON.stringify({...s,deployDir:c},null,2)+`
642
- `,"utf-8")}async function RG(){let e=process.cwd(),t=o_(e);console.log(`
641
+ \u3053\u306E\u8A2D\u5B9A\u3067\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}LA(),await DA(t)}function OA(e){let t=!1;for(let r=0;r<e.length;r++)(e[r]==="--yes"||e[r]==="-y")&&(t=!0);return{yes:t}}function AG(e){let t=!1,r=null;for(let n=0;n<e.length;n++)e[n]==="--auto"?t=!0:e[n]==="--config"&&n+1<e.length&&(r=e[++n]);return{auto:t,configPath:r}}function NA(e,t){let r=(0,ve.resolve)(t,"godd-notes");return typeof e!="string"||e===""?r:oy(e)?(0,je.existsSync)(e)?(0,ve.resolve)(e):(console.warn(` \u26A0 ${i_} \u306E deployDir \u304C\u3053\u306E\u30DE\u30B7\u30F3\u306B\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e} \u2192 ${r}`),r):(0,ve.resolve)(t,e)}function jA(e){if(!(0,je.existsSync)(e))throw new Error(`\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let t;try{t=JSON.parse((0,je.readFileSync)(e,"utf-8"))}catch{throw new Error(`\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08JSON \u5F62\u5F0F\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\uFF09: ${e}`)}return{deployDir:NA(t.deployDir,(0,ve.dirname)((0,ve.resolve)(e))),postgresUser:t.postgresUser??"app_user",postgresPassword:t.postgresPassword??tn(24),postgresDb:t.postgresDb??"godd_notes",postgresPort:t.postgresPort??"5432",notesApiPort:t.notesApiPort??"3100",notesAppPort:t.notesAppPort??"5175",githubAppId:t.githubAppId??"",githubAppPrivateKey:t.githubAppPrivateKey??"",githubAppInstallationId:t.githubAppInstallationId??"",githubOwner:t.githubOwner??"",githubRepo:t.githubRepo??"",githubBranch:t.githubBranch??"main",jwtSecret:t.jwtSecret??tn(48),adminUsername:t.adminUsername??"admin",adminPassword:t.adminPassword??tn(16)}}function RG(){return{deployDir:(0,ve.resolve)("./godd-notes"),postgresUser:"app_user",postgresPassword:tn(24),postgresDb:"godd_notes",postgresPort:"5432",notesApiPort:"3100",notesAppPort:"5175",githubAppId:process.env.GITHUB_APP_ID??"",githubAppPrivateKey:process.env.GITHUB_APP_PRIVATE_KEY??"",githubAppInstallationId:process.env.GITHUB_APP_INSTALLATION_ID??"",githubOwner:process.env.GITHUB_OWNER??"",githubRepo:process.env.GITHUB_REPO??"",githubBranch:process.env.GITHUB_BRANCH??"main",jwtSecret:tn(48),adminUsername:"admin",adminPassword:tn(16)}}function MA(e=process.cwd()){return fp(e,IG)}function LA(e=process.cwd()){MA(e)?console.log("\u2713 Notes compose \u751F\u6210\u7269\u3092 .gitignore \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F"):console.log("\u2713 Notes compose \u751F\u6210\u7269\u306F .gitignore \u306B\u8FFD\u52A0\u6E08\u307F\u3067\u3059")}function ZA(e,t=process.cwd()){let{postgresPassword:r,jwtSecret:n,adminPassword:o,githubAppPrivateKey:i,...s}=e,a=(0,ve.relative)(t,e.deployDir),c=a===""?".":!a.startsWith("..")&&!(0,ve.isAbsolute)(a)?a:e.deployDir;(0,je.writeFileSync)((0,ve.join)(t,i_),JSON.stringify({...s,deployDir:c},null,2)+`
642
+ `,"utf-8")}async function zG(){let e=process.cwd(),t=o_(e);console.log(`
643
643
  --- GoDD Notes \u30B9\u30C6\u30FC\u30BF\u30B9\u78BA\u8A8D ---
644
644
  `);let r=(0,je.existsSync)((0,ve.join)(e,"godd-notes"))?(0,ve.join)(e,"godd-notes"):e;if((0,je.existsSync)((0,ve.join)(r,"docker-compose.yml"))){console.log("[Docker Compose]");try{it.spawnSync("docker",["compose","ps"],{cwd:r,stdio:"inherit"})}catch{console.log(" Docker Compose \u304C\u8D77\u52D5\u3057\u3066\u3044\u307E\u305B\u3093\u3002")}console.log()}if(t?.provider==="aws"){console.log("[AWS ECS]");let u=t.region??"ap-northeast-1";try{let p=t.env??"dev",l=(0,ve.join)(t.outputDir??e,"terraform","godd-notes",p),d=Tp(l);it.spawnSync("aws",["ecs","describe-services","--cluster",d.ecs_cluster_name,"--services",d.ecs_service_name,"--region",u,"--query","services[0].{status:status,running:runningCount,desired:desiredCount,deployments:length(deployments)}","--output","table"],{stdio:"inherit"})}catch(p){console.log(` ECS \u30B9\u30C6\u30FC\u30BF\u30B9\u53D6\u5F97\u306B\u5931\u6557: ${ye(p)}`)}console.log()}let o=(0,ve.join)(e,i_),s=((0,je.existsSync)(o)?(()=>{try{return JSON.parse((0,je.readFileSync)(o,"utf-8"))}catch{return null}})():null)?.notesApiPort??"3100",a=[s,...s!=="8000"?["8000"]:[]];console.log("[\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF / GitHub App \u2014 #829]");let c=new Set;for(let u of a){let p=`http://localhost:${u}/api/health`,l=await SA(p),d=p.replace(/\/api\/health\/?$/,""),f=null;l?.github_app_configured&&(f=await $A(d)),PA(p,l,f),c.add(d),console.log()}if(t?.provider==="aws")try{let u=t.env??"dev",p=(0,ve.join)(t.outputDir??e,"terraform","godd-notes",u),d=`https://${Tp(p).cloudfront_domain}`;if(!c.has(d)){let f=`${d}/api/health`,h=await SA(f),g=null;h?.github_app_configured&&(g=await $A(d)),PA(f,h,g),console.log()}}catch{}}function Cp(){console.log(`
645
645
  GoDD Notes \u30C7\u30D7\u30ED\u30A4\u7BA1\u7406
@@ -694,13 +694,13 @@ AI \u9023\u643A:
694
694
  \u8A2D\u5B9A\u306E\u6C38\u7D9A\u5316:
695
695
  infra \u30B3\u30DE\u30F3\u30C9\u306F .godd-notes-infra.json \u3092\u4FDD\u5B58\u3057\u518D\u5229\u7528\u3002
696
696
  compose --config/--auto \u306F .godd-notes-compose.json \u3092\u4FDD\u5B58\u3057\u518D\u5229\u7528\u3002
697
- `)}async function IG(e,t,r,n){console.log(`
697
+ `)}async function DG(e,t,r,n){console.log(`
698
698
  \u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=RA();if(!o.ok){console.error(`
699
699
  \u30A8\u30E9\u30FC: AWS \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let u of o.errors)console.error(` - ${u}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
700
700
  `);let i=e.env??"dev",s=e.outputDir??t,a=(0,ve.join)(s,"terraform","godd-notes",i);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${a})`);let c=Tp(a);if(console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
701
701
  `),console.log("--- AWS \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` ECR: ${c.ecr_repository_url}`),console.log(` ECS: ${c.ecs_cluster_name} / ${c.ecs_service_name}`),console.log(` S3: ${c.s3_bucket_name}`),console.log(` CloudFront: ${c.cloudfront_distribution_id}`),console.log(` App URL: ${c.notes_app_url}`),!n){let u=TA();try{if((await Ht(u,`
702
- \u3053\u306E\u8A2D\u5B9A\u3067 AWS \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}}finally{u.close()}}await $G(c,e,r)}async function zG(e){let t=e[0]??"help";switch(t){case"compose":{if(e.includes("--help")||e.includes("-h")){Cp();return}n_()||(console.error("\u30A8\u30E9\u30FC: Docker \u304A\u3088\u3073 Docker Compose \u304C\u5FC5\u8981\u3067\u3059\u3002"),console.error("https://docs.docker.com/get-docker/ \u304B\u3089\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let r=CG(e.slice(1));if(r.auto||r.configPath){let n=r.configPath?jA(r.configPath):TG();AA(n)||(console.error("\u30A8\u30E9\u30FC: GitHub App \u8A8D\u8A3C\u60C5\u5831\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),console.error("PR / Issue \u4F5C\u6210\u306B\u306F GITHUB_APP_ID / GITHUB_APP_PRIVATE_KEY / GITHUB_APP_INSTALLATION_ID \u304C\u5FC5\u9808\u3067\u3059\u3002"),console.error("\u624B\u9806: docs/007_guides/bot-token-setup.md"),process.exit(1)),(!n.githubOwner||!n.githubRepo)&&(console.error("\u30A8\u30E9\u30FC: GITHUB_OWNER \u3068 GITHUB_REPO \u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)),console.log(`
703
- --- \u975E\u5BFE\u8A71\u30E2\u30FC\u30C9: \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A ---`),console.log(` \u30C7\u30D7\u30ED\u30A4\u5148: ${n.deployDir}`),console.log(` DB: ${n.postgresUser}@localhost:${n.postgresPort}/${n.postgresDb}`),console.log(` API \u30DD\u30FC\u30C8: ${n.notesApiPort}`),console.log(` App \u30DD\u30FC\u30C8: ${n.notesAppPort}`),console.log(` GitHub: ${n.githubOwner}/${n.githubRepo} (${n.githubBranch})`),console.log(" GitHub App: \u8A2D\u5B9A\u6E08\u307F (Bot author)"),console.log(` \u7BA1\u7406\u8005: ${n.adminUsername}`),LA(),ZA(n),await DA(n)}else{let n=TA();try{await EG(n)}finally{n.close()}}break}case"deploy":{if(e.includes("--help")||e.includes("-h")){Cp();return}let{yes:r}=OA(e),n=process.cwd(),o=o_(n);o||(console.error("\u30A8\u30E9\u30FC: .godd-notes-infra.json \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),console.error("\u5148\u306B godd notes infra \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let{resolveDeployProvider:i,executeGcpDeploy:s,executeAzureDeploy:a,executeVercelRailwayDeploy:c}=await Promise.resolve().then(()=>(cA(),aA)),u=i(o.provider);u||(console.error(`\u30A8\u30E9\u30FC: \u4E0D\u660E\u306A provider \u3067\u3059: ${o.provider}`),console.error("\u5148\u306B godd notes infra \u3092\u5B9F\u884C\u3057\u3001AWS / GCP / Azure / Vercel\xD7Railway \u306E\u3044\u305A\u308C\u304B\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let p=o.outputDir??n,l=ep({preferredRoots:[p,n]});switch(l||(console.error("\u30A8\u30E9\u30FC: notes-api / notes-app \u306E\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),process.exit(1)),F2(l),u){case"aws":await IG(o,n,l,r);break;case"gcp":await s(o,n,l,r);break;case"azure":await a(o,n,l,r);break;case"vercel-railway":await c(o,n,l,r);break}break}case"infra":{let{runNotesInfra:r}=await Promise.resolve().then(()=>(kA(),xA));await r(e.slice(1));break}case"status":{await RG();break}case"help":case"--help":case"-h":Cp();break;default:console.error(`\u4E0D\u660E\u306A\u30B5\u30D6\u30B3\u30DE\u30F3\u30C9: ${t}`),Cp(),process.exit(1)}}var EA,CA,je,ve,it,Ap,as,xG,i_,AG,qA=b(()=>{"use strict";EA=yt(require("node:readline"),1),CA=yt(require("node:crypto"),1),je=require("node:fs"),ve=require("node:path"),it=yt(require("node:child_process"),1),Ap=yt(require("node:http"),1);Xt();Sy();Yy();rp();KT();Qy();as=1e4;xG=new Set([".venv","__pycache__",".pytest_cache",".ruff_cache","node_modules",".git",".env","dist"]);i_=".godd-notes-compose.json",AG=["/godd-notes/",".godd-notes-*.json"]});var GA=require("node:fs"),sc=require("node:path"),s_=require("node:os");ri();Np();process.env.__GODD_CLI__="1";var cs=Nr();function DG(){return cs==="0.0.0"?`${cs} (development)`:`${cs} (${rr(cs)?.channel??"unknown"})`}function OG(){let e=process.platform==="win32"?"godd.exe":"godd",t=process.platform==="win32"?(0,sc.join)(process.env.LOCALAPPDATA??(0,sc.join)((0,s_.homedir)(),"AppData","Local"),"GoDD"):(0,sc.join)((0,s_.homedir)(),".godd","bin");return(0,GA.existsSync)((0,sc.join)(t,e))}var NG={i:"install",s:"server",n:"notes",v:"version",h:"help"};function jG(){return OG()?"help":"install"}var Rp=process.argv[2],ac=Rp?NG[Rp]??Rp:jG();function FA(){console.log(`
702
+ \u3053\u306E\u8A2D\u5B9A\u3067 AWS \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}}finally{u.close()}}await EG(c,e,r)}async function OG(e){let t=e[0]??"help";switch(t){case"compose":{if(e.includes("--help")||e.includes("-h")){Cp();return}n_()||(console.error("\u30A8\u30E9\u30FC: Docker \u304A\u3088\u3073 Docker Compose \u304C\u5FC5\u8981\u3067\u3059\u3002"),console.error("https://docs.docker.com/get-docker/ \u304B\u3089\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let r=AG(e.slice(1));if(r.auto||r.configPath){let n=r.configPath?jA(r.configPath):RG();AA(n)||(console.error("\u30A8\u30E9\u30FC: GitHub App \u8A8D\u8A3C\u60C5\u5831\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),console.error("PR / Issue \u4F5C\u6210\u306B\u306F GITHUB_APP_ID / GITHUB_APP_PRIVATE_KEY / GITHUB_APP_INSTALLATION_ID \u304C\u5FC5\u9808\u3067\u3059\u3002"),console.error("\u624B\u9806: docs/007_guides/bot-token-setup.md"),process.exit(1)),(!n.githubOwner||!n.githubRepo)&&(console.error("\u30A8\u30E9\u30FC: GITHUB_OWNER \u3068 GITHUB_REPO \u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)),console.log(`
703
+ --- \u975E\u5BFE\u8A71\u30E2\u30FC\u30C9: \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A ---`),console.log(` \u30C7\u30D7\u30ED\u30A4\u5148: ${n.deployDir}`),console.log(` DB: ${n.postgresUser}@localhost:${n.postgresPort}/${n.postgresDb}`),console.log(` API \u30DD\u30FC\u30C8: ${n.notesApiPort}`),console.log(` App \u30DD\u30FC\u30C8: ${n.notesAppPort}`),console.log(` GitHub: ${n.githubOwner}/${n.githubRepo} (${n.githubBranch})`),console.log(" GitHub App: \u8A2D\u5B9A\u6E08\u307F (Bot author)"),console.log(` \u7BA1\u7406\u8005: ${n.adminUsername}`),LA(),ZA(n),await DA(n)}else{let n=TA();try{await TG(n)}finally{n.close()}}break}case"deploy":{if(e.includes("--help")||e.includes("-h")){Cp();return}let{yes:r}=OA(e),n=process.cwd(),o=o_(n);o||(console.error("\u30A8\u30E9\u30FC: .godd-notes-infra.json \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),console.error("\u5148\u306B godd notes infra \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let{resolveDeployProvider:i,executeGcpDeploy:s,executeAzureDeploy:a,executeVercelRailwayDeploy:c}=await Promise.resolve().then(()=>(cA(),aA)),u=i(o.provider);u||(console.error(`\u30A8\u30E9\u30FC: \u4E0D\u660E\u306A provider \u3067\u3059: ${o.provider}`),console.error("\u5148\u306B godd notes infra \u3092\u5B9F\u884C\u3057\u3001AWS / GCP / Azure / Vercel\xD7Railway \u306E\u3044\u305A\u308C\u304B\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let p=o.outputDir??n,l=ep({preferredRoots:[p,n]});switch(l||(console.error("\u30A8\u30E9\u30FC: notes-api / notes-app \u306E\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),process.exit(1)),F2(l),u){case"aws":await DG(o,n,l,r);break;case"gcp":await s(o,n,l,r);break;case"azure":await a(o,n,l,r);break;case"vercel-railway":await c(o,n,l,r);break}break}case"infra":{let{runNotesInfra:r}=await Promise.resolve().then(()=>(kA(),xA));await r(e.slice(1));break}case"status":{await zG();break}case"help":case"--help":case"-h":Cp();break;default:console.error(`\u4E0D\u660E\u306A\u30B5\u30D6\u30B3\u30DE\u30F3\u30C9: ${t}`),Cp(),process.exit(1)}}var EA,CA,je,ve,it,Ap,as,SG,i_,IG,qA=b(()=>{"use strict";EA=yt(require("node:readline"),1),CA=yt(require("node:crypto"),1),je=require("node:fs"),ve=require("node:path"),it=yt(require("node:child_process"),1),Ap=yt(require("node:http"),1);Xt();Sy();Yy();rp();KT();Qy();as=1e4;SG=new Set([".venv","__pycache__",".pytest_cache",".ruff_cache","node_modules",".git",".env","dist"]);i_=".godd-notes-compose.json",IG=["/godd-notes/",".godd-notes-*.json"]});var GA=require("node:fs"),sc=require("node:path"),s_=require("node:os");ri();Np();process.env.__GODD_CLI__="1";var cs=Nr();function NG(){return cs==="0.0.0"?`${cs} (development)`:`${cs} (${rr(cs)?.channel??"unknown"})`}function jG(){let e=process.platform==="win32"?"godd.exe":"godd",t=process.platform==="win32"?(0,sc.join)(process.env.LOCALAPPDATA??(0,sc.join)((0,s_.homedir)(),"AppData","Local"),"GoDD"):(0,sc.join)((0,s_.homedir)(),".godd","bin");return(0,GA.existsSync)((0,sc.join)(t,e))}var MG={i:"install",s:"server",n:"notes",v:"version",h:"help"};function LG(){return jG()?"help":"install"}var Rp=process.argv[2],ac=Rp?MG[Rp]??Rp:LG();function FA(){console.log(`
704
704
  GoDD CLI v${cs}
705
705
 
706
706
  Usage: godd <command>
@@ -727,7 +727,7 @@ Examples:
727
727
  godd notes deploy \u30AF\u30E9\u30A6\u30C9\u306B\u30C7\u30D7\u30ED\u30A4\uFF08infra \u306E provider \u306B\u5F93\u3046\uFF09
728
728
  godd notes infra Notes \u30A2\u30D7\u30EA\u96DB\u5F62\u3068\u30AF\u30E9\u30A6\u30C9\u30A4\u30F3\u30D5\u30E9\u3092\u5BFE\u8A71\u5F62\u5F0F\u3067\u69CB\u7BC9
729
729
  godd version \u30D0\u30FC\u30B8\u30E7\u30F3\u78BA\u8A8D
730
- `)}async function MG(){switch(ac){case"server":{let{startServer:e}=await Promise.resolve().then(()=>(cC(),aC));await e();break}case"init":{let{runInit:e}=await Promise.resolve().then(()=>(fT(),dT));await e();break}case"login":{let{runLogin:e}=await Promise.resolve().then(()=>(Fa(),Ny));await e(process.argv.slice(3));break}case"logout":{let{runLogout:e}=await Promise.resolve().then(()=>(Fa(),Ny));await e(process.argv.slice(3));break}case"google-relay":{let{runGoogleRelay:e}=await Promise.resolve().then(()=>(ZT(),LT));await e();break}case"install":{let{runInstall:e}=await Promise.resolve().then(()=>(BT(),GT));await e();break}case"notes":{let{runNotes:e}=await Promise.resolve().then(()=>(qA(),UA));await e(process.argv.slice(3));break}case"version":console.log(`GoDD CLI v${DG()}`);break;case"help":FA();break;default:console.error(`\u4E0D\u660E\u306A\u30B3\u30DE\u30F3\u30C9: ${Rp}`),FA(),process.exit(1)}}var LG=ac==="server"||ac==="google-relay"?Promise.resolve(""):lc({version:cs})();MG().then(async()=>{if(ac==="server"||ac==="google-relay")return;let e=await LG;e&&console.log(`
730
+ `)}async function ZG(){switch(ac){case"server":{let{startServer:e}=await Promise.resolve().then(()=>(cC(),aC));await e();break}case"init":{let{runInit:e}=await Promise.resolve().then(()=>(fT(),dT));await e();break}case"login":{let{runLogin:e}=await Promise.resolve().then(()=>(Fa(),Ny));await e(process.argv.slice(3));break}case"logout":{let{runLogout:e}=await Promise.resolve().then(()=>(Fa(),Ny));await e(process.argv.slice(3));break}case"google-relay":{let{runGoogleRelay:e}=await Promise.resolve().then(()=>(ZT(),LT));await e();break}case"install":{let{runInstall:e}=await Promise.resolve().then(()=>(BT(),GT));await e();break}case"notes":{let{runNotes:e}=await Promise.resolve().then(()=>(qA(),UA));await e(process.argv.slice(3));break}case"version":console.log(`GoDD CLI v${NG()}`);break;case"help":FA();break;default:console.error(`\u4E0D\u660E\u306A\u30B3\u30DE\u30F3\u30C9: ${Rp}`),FA(),process.exit(1)}}var UG=ac==="server"||ac==="google-relay"?Promise.resolve(""):lc({version:cs})();ZG().then(async()=>{if(ac==="server"||ac==="google-relay")return;let e=await UG;e&&console.log(`
731
731
  ${e}`)}).catch(e=>{console.error("GoDD CLI \u30A8\u30E9\u30FC:",e),process.exit(1)});
732
732
  /*! Bundled license information:
733
733