@ripla/godd-mcp 1.0.8-canary.49 → 1.0.8-canary.50

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.49"}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.50"}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(`
package/dist/godd.js CHANGED
@@ -44,7 +44,7 @@ import { readFileSync } from "node:fs";
44
44
  import { dirname, join } from "node:path";
45
45
  import { fileURLToPath } from "node:url";
46
46
  function packageVersion() {
47
- if (true) return "1.0.8-canary.49";
47
+ if (true) return "1.0.8-canary.50";
48
48
  const base = dirname(fileURLToPath(import.meta.url));
49
49
  for (const path of [join(base, "../package.json"), join(base, "../../package.json")]) {
50
50
  try {
package/dist/index.js CHANGED
@@ -232,7 +232,7 @@ config.godd \u306E knowledge.project_id \u306F\u66F8\u304D\u63DB\u3048\u305A\u30
232
232
  `):"\uFF08\u5BFE\u8C61\u306E\u8A18\u61B6\u306A\u3057\uFF09"].join(`
233
233
  `)}import{basename as j3}from"node:path";var D3=f.object({type:f.enum(["url","text","file"]).describe("\u6210\u679C\u7269\u306E\u7A2E\u985E"),title:f.string().min(1).max(500).describe("\u6210\u679C\u7269\u306E\u540D\u524D\uFF08\u4F8B: \u898B\u7A4D\u66F8\uFF08\u5E97\u8217\u4E88\u7D04\u30B7\u30B9\u30C6\u30E0\u958B\u767A\uFF09\uFF09"),url:f.string().max(4e3).regex(/^https?:\/\//,"url \u306F http:// \u304B https:// \u3067\u59CB\u307E\u308B\u30EA\u30F3\u30AF\u306B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u300CPR #123\u300D\u306E\u3088\u3046\u306A\u5024\u306F text \u306B\u3059\u308B\uFF09").optional().describe("type=url \u306E\u3068\u304D\u306E\u30EA\u30F3\u30AF\uFF08http(s) \u306E\u307F\uFF09"),body:f.string().optional().describe("type=text \u306E\u3068\u304D\u306E\u672C\u6587\uFF08Markdown\uFF09"),path:f.string().min(1).max(4e3).optional().describe("type=file \u306E\u3068\u304D\u306E\u30ED\u30FC\u30AB\u30EB\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u3002\u7D76\u5BFE\u30D1\u30B9\u3001\u307E\u305F\u306F project_root \u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9")}).superRefine((e,t)=>{e.type==="url"&&!e.url&&t.addIssue({code:"custom",message:"type=url \u306B\u306F url \u304C\u5FC5\u8981\u3067\u3059"}),e.type==="text"&&!e.body?.trim()&&t.addIssue({code:"custom",message:"type=text \u306B\u306F body \u304C\u5FC5\u8981\u3067\u3059"}),e.type==="file"&&!e.path&&t.addIssue({code:"custom",message:"type=file \u306B\u306F path \u304C\u5FC5\u8981\u3067\u3059"})}),Uk=f.object({title:f.string().min(1,"title \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(500).describe("\u3053\u306E\u8A18\u9332\u306E 1 \u884C\u306E\u8981\u7D04\uFF08\u4F8B: \u30B5\u30F3\u30D7\u30EB\u793E \u5E97\u8217\u4E88\u7D04\u30B7\u30B9\u30C6\u30E0\u306E\u898B\u7A4D\uFF09"),process:f.string().min(1,"process \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u4F5C\u696D\u306E\u533A\u5207\u308A\u306E\u624B\u9806\u306E\u5F62\u5F0F\u3067\u66F8\u3044\u305F\u7D4C\u7DEF\uFF08Markdown\uFF09"),deliverables:f.array(D3).max(50).default([]).describe("\u6210\u679C\u7269\u306E\u4E00\u89A7\u3002\u7121\u3051\u308C\u3070\u7A7A\u306E\u914D\u5217"),project_id:f.string().uuid("project_id \u306F godd-knowledge-projects \u304C\u8FD4\u3059 UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u4FDD\u5B58\u5148 project \u306E id\u3002\u7701\u7565\u6642\u306F config.godd \u306E knowledge.project_id\u3001\u305D\u308C\u3082\u7121\u3051\u308C\u3070 project \u306A\u3057"),without_project:f.boolean().optional().describe("true \u3067 config.godd \u306E\u8A2D\u5B9A\u306B\u304B\u304B\u308F\u3089\u305A project \u306A\u3057\u3067\u4FDD\u5B58\u3059\u308B\uFF08\u91D1\u984D\u3092\u6271\u3046\u4F5C\u696D\u3067\u793E\u5916\u79D8 project \u304C\u7121\u3044\u3068\u304D\uFF09\u3002project_id \u3068\u306F\u4F75\u7528\u3057\u306A\u3044"),project_root:f.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08config.godd \u3068\u76F8\u5BFE\u30D1\u30B9\u306E\u89E3\u6C7A\u57FA\u6E96\u3002\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),M3=f.object({id:f.string(),saved:f.boolean(),sequence:f.number(),project:f.object({id:f.string(),name:f.string()}).nullable(),deliverables:f.array(f.object({type:f.string(),title:f.string()}))}),Pf=class extends Error{constructor(r,n){super(n);this.status=r;this.name="WorkingRecordSaveError"}};function L3(e,t){if(e.without_project&&e.project_id!==void 0)throw new Error("project_id \u3068 without_project \u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002\u3069\u3061\u3089\u304B\u4E00\u65B9\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002");if(!e.without_project)return e.project_id??Vr(t)}function q3(e,t,r){let n=Fe(e,t,r.config.auth_source);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?`\u4FDD\u5B58\u5148\u306E project \u304C\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u7D42\u4E86\u3057\u3066\u3044\u308B\u3001\u307E\u305F\u306F\u3053\u306E\u64CD\u4F5C\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${t}
234
234
  godd-knowledge-projects \u3067\u4FDD\u5B58\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3001\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:e===413?`\u6210\u679C\u7269\u306E\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002${t}`:e===422?`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:`working record \u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}function Z3(e,t,r,n,o){let i=e.deliverables.flatMap(u=>u.type==="file"&&u.path?[u.path]:[]),s=bf(i,o),a={session_id:r.sessionId,sequence:r.sequence,title:e.title,process:e.process,mcp_version:n,started_at:r.startedAt,tools:r.tools,deliverables:e.deliverables.map(u=>({type:u.type,title:u.title,...u.type==="url"?{url:u.url}:{},...u.type==="text"?{body:u.body}:{},...u.type==="file"&&u.path?{file_name:j3(u.path)}:{}}))},c=new FormData;t!==void 0&&c.append("project_id",t),c.append("record",JSON.stringify(a));for(let u of s){let d=vf(u.fileName);c.append("files",new Blob([new Uint8Array(u.bytes)],d?{type:d}:void 0),u.fileName)}return c}async function Vk(e,t){let r=e.session;if(!r)throw new Error("\u3053\u306E\u30C4\u30FC\u30EB\u306F GoDD MCP \u30B5\u30FC\u30D0\u30FC\u304B\u3089\u3060\u3051\u547C\u3073\u51FA\u305B\u307E\u3059\uFF08\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u8A18\u9332\u304C\u3042\u308A\u307E\u305B\u3093\uFF09\u3002");let n=it(e,t.project_root).root,o=L3(t,n),i=r.snapshot(),s=Z3(t,o,i,e.config.client_version,n),a=e.config.registry_url.replace(/\/+$/,""),c,u;try{c=await fetch(`${a}/working-records`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`},body:s,signal:AbortSignal.timeout(9e4)}),u=await c.text()}catch(p){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u547C\u3073\u51FA\u3059\u3068\u3001\u540C\u3058\u5185\u5BB9\u3092\u91CD\u8907\u306A\u304F\u4FDD\u5B58\u3057\u76F4\u3057\u307E\u3059: ${Ve(p)}`)}if(c.status===409)return r.commit(i),`\u3053\u306E working record \u306F\u4FDD\u5B58\u6E08\u307F\u3067\u3057\u305F\uFF08${i.sequence} \u4EF6\u76EE\uFF09\u3002\u91CD\u8907\u3057\u3066\u4FDD\u5B58\u306F\u3057\u3066\u3044\u307E\u305B\u3093\u3002${To(u).slice(0,300)}`;if(!c.ok)throw new Pf(c.status,q3(c.status,To(u).slice(0,300),e));let d;try{d=M3.parse(JSON.parse(u))}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u3067\u3059: ${u.slice(0,200)}`)}return r.commit(i),[`working record \u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F: ${t.title}`,d.project?`- \u4FDD\u5B58\u5148: ${d.project.name}\uFF08project id: ${d.project.id}\uFF09`:t.without_project?"- \u4FDD\u5B58\u5148: project \u306A\u3057\uFF08\u6307\u5B9A\u3069\u304A\u308A\uFF09":"- \u4FDD\u5B58\u5148: project \u306A\u3057\uFF08config.godd \u306B knowledge.project_id \u3092\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u305D\u306E project \u306B\u4FDD\u5B58\u3055\u308C\u307E\u3059\uFF09",`- id: ${d.id}\uFF08\u3053\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306E ${d.sequence} \u4EF6\u76EE\uFF09`,`- \u4F7F\u3063\u305F GoDD \u30C4\u30FC\u30EB: ${i.tools.length>0?i.tools.map(p=>p.tool_name).join(", "):"\u306A\u3057"}`,`- \u6210\u679C\u7269: ${d.deliverables.length>0?d.deliverables.map(p=>`${p.title}\uFF08${p.type}\uFF09`).join(", "):"\u306A\u3057"}`].join(`
235
- `)}var Bk={setup:(e,t)=>ck(e,ak.parse(t)),"docs-init":(e,t)=>pk(e,lk.parse(t)),docs:(e,t)=>bk(e,_k.parse(t)),"notes-init":(e,t)=>wk(e,xk.parse(t)),"knowledge-save":(e,t)=>Sk(e,kk.parse(t)),feedback:(e,t)=>Ek(e,$k.parse(t)),"knowledge-search":(e,t)=>Tk(e,Pk.parse(t)),"knowledge-attachment":(e,t)=>Ck(e,zk.parse(t)),"knowledge-search-general":(e,t)=>Ak(e,Ik.parse(t)),"knowledge-projects":(e,t)=>Rk(e,Ok.parse(t)),memory:(e,t)=>Fk(e,Zk.parse(t)),"working-record-save":(e,t)=>Vk(e,Uk.parse(t))};var rs={network:{message:"Registry \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093",action:"\u901A\u4FE1\u3001\u63A5\u7D9A\u5148 URL\u3001DNS \u3068 HTTPS \u306E\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},unavailable:{message:"Registry \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093",action:"\u7A3C\u50CD\u72B6\u6CC1\u3068\u914D\u4FE1\u6A5F\u80FD\u306E\u53CD\u6620\u3092\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3001\u5FA9\u65E7\u5F8C\u306B\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},timeout:{message:"Registry \u306E\u5FDC\u7B54\u5F85\u3061\u3001\u5229\u7528\u5236\u9650\u3001\u307E\u305F\u306F\u6642\u9593\u5207\u308C\u3067\u3059",action:"\u901A\u4FE1\u3068\u7A3C\u50CD\u72B6\u6CC1\u3092\u78BA\u8A8D\u3057\u3001\u6642\u9593\u3092\u304A\u3044\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},auth:{message:"\u8A8D\u8A3C\u307E\u305F\u306F\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",action:"godd login \u307E\u305F\u306F godd-config \u3067\u8A8D\u8A3C\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u305F\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3001\u505C\u6B62\u3084\u6A29\u9650\u306F\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},missing:{message:"\u5229\u7528\u53EF\u80FD\u306A\u30C4\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",action:"\u6700\u65B0\u306E\u30C4\u30FC\u30EB\u4E00\u89A7\u3068\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},data:{message:"\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093",action:"\u7BA1\u7406\u8005\u306B\u30C7\u30FC\u30BF\u306E\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\u53E4\u3044\u5185\u5BB9\u3067\u306F\u7D9A\u3051\u307E\u305B\u3093\u3002"},input:{message:"\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F",action:"\u6700\u65B0\u306E\u30AC\u30A4\u30C9\u3068\u5F15\u6570\u306E\u9805\u76EE\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},execution_unknown:{message:"\u5B9F\u884C\u306E\u7D50\u679C\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093",action:"\u51E6\u7406\u304C\u5B8C\u4E86\u3057\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u518D\u9001\u3059\u308B\u524D\u306B\u4FDD\u5B58\u5148\u3084\u51E6\u7406\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3001\u4E0D\u660E\u306A\u3089\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}};import{readFileSync as F3}from"node:fs";import{dirname as U3,join as Gk}from"node:path";import{fileURLToPath as V3}from"node:url";function Br(){return"1.0.8-canary.49"}var Tf=/^(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 rr(e){let t=Tf.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 Hk(e,t){if(!rr(e)||!rr(t))throw new Error("Invalid release version");let r=Tf.exec(e),n=Tf.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 zc=f.object({name:f.string(),description:f.string().max(300),inputSchema:f.object({type:f.literal("object")}).passthrough(),version:f.number().int().positive(),guide_uri:f.string(),compatibility:f.object({min_version:f.string().nullable(),max_version:f.string().nullable(),channels:f.array(f.string()).nullable()}).optional()}),Kk=f.object({tools:f.array(zc),revision:f.string().optional()}),Wk=f.object({name:f.string(),version:f.number(),related_tools:f.array(f.string()),guide:f.object({purpose:f.string(),prerequisites:f.array(f.string()),steps:f.array(f.string()),success:f.string(),failures:f.array(f.object({message:f.string(),action:f.string()}))})}),B3=f.object({prompts:f.record(f.string()),agents:f.record(f.string()),partials:f.record(f.string()),mindsets:f.record(f.string()),quality_gate:f.record(f.string()),tools:f.array(f.unknown()),components:f.array(f.string()),language:f.string()}),zf=f.object({definition:zc,execution:f.object({kind:f.enum(["prompt","public_client","server"]),prompts:f.array(f.string()),handler:f.string().nullable(),defaults:f.record(f.unknown()),context_env:f.record(f.enum(["GODD_CONFIG","GODD_SLACK_TOOL","GODD_SLACK_PERMALINK_TOOL"])).optional(),archive:f.string().nullable().optional()}).optional(),bundle:B3.nullable().optional(),arguments:f.record(f.unknown()).optional(),result:f.unknown().optional(),prompt_versions:f.record(f.number()).optional(),assets:f.record(f.string()).optional(),catalog_revision:f.string().optional()}),ae=class extends Error{constructor(r,n){super(n);this.kind=r}};function Be(e){let t=rs[e];return new ae(e,`${t.message}\u3002${t.action}`)}function Cf(e,t,r){if(typeof t=="object"&&t!==null&&"detail"in t&&typeof t.detail=="object"&&t.detail!==null&&"code"in t.detail&&t.detail.code==="delivery_data_invalid")return Be("data");if(e===426)return new ae("compatibility",`\u672C\u4F53 ${r.client_version??Br()} \u306E\u7248\u30FB\u7CFB\u5217\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u540C\u3058\u7CFB\u5217\u306E\u672C\u4F53\u3078\u66F4\u65B0\u3057\u3066MCP\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);if(e===401||e===403){let o=typeof t=="object"&&t!==null&&"detail"in t&&typeof t.detail=="string"?t.detail:"",i=Fe(e,o,r.auth_source);return i?new ae("auth",i.includes("\u518D\u8D77\u52D5")?i:i+`
235
+ `)}var Bk={setup:(e,t)=>ck(e,ak.parse(t)),"docs-init":(e,t)=>pk(e,lk.parse(t)),docs:(e,t)=>bk(e,_k.parse(t)),"notes-init":(e,t)=>wk(e,xk.parse(t)),"knowledge-save":(e,t)=>Sk(e,kk.parse(t)),feedback:(e,t)=>Ek(e,$k.parse(t)),"knowledge-search":(e,t)=>Tk(e,Pk.parse(t)),"knowledge-attachment":(e,t)=>Ck(e,zk.parse(t)),"knowledge-search-general":(e,t)=>Ak(e,Ik.parse(t)),"knowledge-projects":(e,t)=>Rk(e,Ok.parse(t)),memory:(e,t)=>Fk(e,Zk.parse(t)),"working-record-save":(e,t)=>Vk(e,Uk.parse(t))};var rs={network:{message:"Registry \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093",action:"\u901A\u4FE1\u3001\u63A5\u7D9A\u5148 URL\u3001DNS \u3068 HTTPS \u306E\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},unavailable:{message:"Registry \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093",action:"\u7A3C\u50CD\u72B6\u6CC1\u3068\u914D\u4FE1\u6A5F\u80FD\u306E\u53CD\u6620\u3092\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3001\u5FA9\u65E7\u5F8C\u306B\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},timeout:{message:"Registry \u306E\u5FDC\u7B54\u5F85\u3061\u3001\u5229\u7528\u5236\u9650\u3001\u307E\u305F\u306F\u6642\u9593\u5207\u308C\u3067\u3059",action:"\u901A\u4FE1\u3068\u7A3C\u50CD\u72B6\u6CC1\u3092\u78BA\u8A8D\u3057\u3001\u6642\u9593\u3092\u304A\u3044\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},auth:{message:"\u8A8D\u8A3C\u307E\u305F\u306F\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",action:"godd login \u307E\u305F\u306F godd-config \u3067\u8A8D\u8A3C\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u305F\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3001\u505C\u6B62\u3084\u6A29\u9650\u306F\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},missing:{message:"\u5229\u7528\u53EF\u80FD\u306A\u30C4\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",action:"\u6700\u65B0\u306E\u30C4\u30FC\u30EB\u4E00\u89A7\u3068\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},data:{message:"\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093",action:"\u7BA1\u7406\u8005\u306B\u30C7\u30FC\u30BF\u306E\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\u53E4\u3044\u5185\u5BB9\u3067\u306F\u7D9A\u3051\u307E\u305B\u3093\u3002"},input:{message:"\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F",action:"\u6700\u65B0\u306E\u30AC\u30A4\u30C9\u3068\u5F15\u6570\u306E\u9805\u76EE\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},execution_unknown:{message:"\u5B9F\u884C\u306E\u7D50\u679C\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093",action:"\u51E6\u7406\u304C\u5B8C\u4E86\u3057\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u518D\u9001\u3059\u308B\u524D\u306B\u4FDD\u5B58\u5148\u3084\u51E6\u7406\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3001\u4E0D\u660E\u306A\u3089\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}};import{readFileSync as F3}from"node:fs";import{dirname as U3,join as Gk}from"node:path";import{fileURLToPath as V3}from"node:url";function Br(){return"1.0.8-canary.50"}var Tf=/^(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 rr(e){let t=Tf.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 Hk(e,t){if(!rr(e)||!rr(t))throw new Error("Invalid release version");let r=Tf.exec(e),n=Tf.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 zc=f.object({name:f.string(),description:f.string().max(300),inputSchema:f.object({type:f.literal("object")}).passthrough(),version:f.number().int().positive(),guide_uri:f.string(),compatibility:f.object({min_version:f.string().nullable(),max_version:f.string().nullable(),channels:f.array(f.string()).nullable()}).optional()}),Kk=f.object({tools:f.array(zc),revision:f.string().optional()}),Wk=f.object({name:f.string(),version:f.number(),related_tools:f.array(f.string()),guide:f.object({purpose:f.string(),prerequisites:f.array(f.string()),steps:f.array(f.string()),success:f.string(),failures:f.array(f.object({message:f.string(),action:f.string()}))})}),B3=f.object({prompts:f.record(f.string()),agents:f.record(f.string()),partials:f.record(f.string()),mindsets:f.record(f.string()),quality_gate:f.record(f.string()),tools:f.array(f.unknown()),components:f.array(f.string()),language:f.string()}),zf=f.object({definition:zc,execution:f.object({kind:f.enum(["prompt","public_client","server"]),prompts:f.array(f.string()),handler:f.string().nullable(),defaults:f.record(f.unknown()),context_env:f.record(f.enum(["GODD_CONFIG","GODD_SLACK_TOOL","GODD_SLACK_PERMALINK_TOOL"])).optional(),archive:f.string().nullable().optional()}).optional(),bundle:B3.nullable().optional(),arguments:f.record(f.unknown()).optional(),result:f.unknown().optional(),prompt_versions:f.record(f.number()).optional(),assets:f.record(f.string()).optional(),catalog_revision:f.string().optional()}),ae=class extends Error{constructor(r,n){super(n);this.kind=r}};function Be(e){let t=rs[e];return new ae(e,`${t.message}\u3002${t.action}`)}function Cf(e,t,r){if(typeof t=="object"&&t!==null&&"detail"in t&&typeof t.detail=="object"&&t.detail!==null&&"code"in t.detail&&t.detail.code==="delivery_data_invalid")return Be("data");if(e===426)return new ae("compatibility",`\u672C\u4F53 ${r.client_version??Br()} \u306E\u7248\u30FB\u7CFB\u5217\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u540C\u3058\u7CFB\u5217\u306E\u672C\u4F53\u3078\u66F4\u65B0\u3057\u3066MCP\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);if(e===401||e===403){let o=typeof t=="object"&&t!==null&&"detail"in t&&typeof t.detail=="string"?t.detail:"",i=Fe(e,o,r.auth_source);return i?new ae("auth",i.includes("\u518D\u8D77\u52D5")?i:i+`
236
236
  \u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u305F\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002`):Be("auth")}return e===404?Be("missing"):e===429||e===408||e===504?Be("timeout"):e>=500?Be("unavailable"):Be("input")}function Cc(e,t){if(e instanceof ae)return e;if(e instanceof Error&&["TimeoutError","AbortError"].includes(e.name))return Be("timeout");if(e instanceof TypeError&&/fetch|network/i.test(e.message))return Be("network");if(e&&typeof e=="object"&&"status"in e&&typeof e.status=="number"){let r=e instanceof Error&&["KnowledgeSaveError","KnowledgeSearchError","KnowledgeAttachmentError"].includes(e.name);if(!r){let n=Fe(e.status,e instanceof Error?e.message:"",t.auth_source);if(n)return new ae("auth",n)}if(e instanceof Error){let n=t.license_key.length>8?e.message.replaceAll(t.license_key,"[\u8A8D\u8A3C\u60C5\u5831]"):e.message,o=!r&&e.status===401?`
237
237
  ${rs.auth.action}`:!r&&e.status===403?`
238
238
  \u5229\u7528\u5BFE\u8C61\u306E\u6A29\u9650\u3084\u767B\u9332\u4E0A\u9650\u3092\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:"";return new ae(e.status===401||e.status===403?"auth":"tool",n.slice(0,1500-o.length)+o)}return Cf(e.status,{},t)}if(e instanceof f.ZodError){let r=[...new Set(e.issues.map(n=>n.path.join(".")||"\u5165\u529B"))].slice(0,5);return new ae("input",`${rs.input.message}\u3002\u78BA\u8A8D\u3059\u308B\u9805\u76EE: ${r.join("\u3001")}\u3002${rs.input.action}`)}if(e instanceof Error){let r=t.license_key.length>8?e.message.replaceAll(t.license_key,"[\u8A8D\u8A3C\u60C5\u5831]"):e.message;return new ae("tool",r.slice(0,1500))}return Be("input")}async function zo(e,t,r,n){let o,i,s=n!==void 0&&t.includes("/execute"),a=e.client_version??Br(),c=a==="0.0.0"?void 0:rr(a);try{o=await fetch(`${e.registry_url.replace(/\/+$/,"")}/v1/tools${t}`,{method:n===void 0?"GET":"POST",headers:{Authorization:`Bearer ${e.license_key}`,"Content-Type":"application/json","Cache-Control":"no-store",...c?{"X-GoDD-Version":c.version,"X-GoDD-Channel":c.channel}:{}},...n===void 0?{}:{body:JSON.stringify(n)},signal:AbortSignal.timeout(s?9e4:15e3)});let d=await o.text();try{i=JSON.parse(d)}catch{i=null}}catch(d){throw s?Be("execution_unknown"):d instanceof Error&&["TimeoutError","AbortError"].includes(d.name)?Be("timeout"):Be("network")}if(!o.ok){if(t.includes("/prepare?")&&(o.status===400||o.status===422))throw new ae("configuration","\u69CB\u6210\u3084\u8A00\u8A9E\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002config.godd \u306E components \u3068\u8A00\u8A9E\u30B3\u30FC\u30C9\u3092 godd-config \u3067\u78BA\u8A8D\u3057\u3001\u66F4\u65B0\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");let d=Cf(o.status,i,e);throw s&&o.status>=500&&d.kind!=="data"?Be("execution_unknown"):o.status===404&&t===""?Be("unavailable"):d}let u=r.safeParse(i);if(!u.success)throw Be(s?"execution_unknown":"data");return u.data}async function Jk(e,t){let r=e.client_version??Br(),n=r==="0.0.0"?void 0:rr(r),o,i;try{o=await fetch(`${e.registry_url.replace(/\/+$/,"")}/v1/tools/${encodeURIComponent(t)}/archive`,{headers:{Authorization:`Bearer ${e.license_key}`,"Cache-Control":"no-store",...n?{"X-GoDD-Version":n.version,"X-GoDD-Channel":n.channel}:{}},signal:AbortSignal.timeout(6e4)}),i=Buffer.from(await o.arrayBuffer())}catch(s){throw s instanceof Error&&["TimeoutError","AbortError"].includes(s.name)?Be("timeout"):Be("network")}if(!o.ok){let s=null;try{s=JSON.parse(i.toString("utf8"))}catch{s=null}throw Cf(o.status,s,e)}return{data:i,sha256:o.headers.get("X-GoDD-Archive-Sha256")??"",version:o.headers.get("X-GoDD-Archive-Version")??""}}function If(e){return new URLSearchParams({components:e.components.join(","),language:e.language}).toString()}var Yk=is(pf(),1);function Af(e,t,r){let n=Yk.default.create();n.registerHelper("eq",(s,a)=>s===a);for(let[s,a]of Object.entries(t.bundle?.partials??{}))n.registerPartial(s,a);let o={name:`registry:${e.components.join("+")}`,stacks:e.components.map(s=>({id:s,name:s,label:s})),quality_gate:{frontend:t.bundle?.quality_gate.frontend,backend:t.bundle?.quality_gate.backend,preflight_command:t.bundle?.quality_gate.preflight??"pnpm preflight",summary:"format/lint/typecheck/build"}},i=t.execution?.prompts.includes(Tc)??!1;return{config:e,profile:o,session:r,endsWithFinish:i,renderPrompt:(s,a)=>{let c=t.bundle?.prompts[s];if(c===void 0)throw new ae("data","\u914D\u4FE1\u30C7\u30FC\u30BF\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");let u={profile_name:o.name,stacks:o.stacks,quality_gate:o.quality_gate,tools:t.bundle?.tools??[],...t.execution?.defaults,...t.arguments,...a};for(let[d,l]of Object.entries(t.execution?.context_env??{}))u[d]=process.env[l];try{let d={};for(let[l,p]of Object.entries(t.bundle?.mindsets??{}))d[l]=n.compile(p)(u);return u.mindsets=d,n.compile(c)(u)}catch{throw new ae("data","\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}}}}function Qk(e,t){let r=Af(e,t),n=t.arguments??{},o=it(r,typeof n.project_root=="string"?n.project_root:void 0),i={...n,project:o,language:e.language},s=t.execution?.prompts.map(u=>r.renderPrompt(u,i)).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ripla/godd-mcp",
3
- "version": "1.0.8-canary.49",
3
+ "version": "1.0.8-canary.50",
4
4
  "type": "module",
5
5
  "description": "GoDD MCP Server - AI-powered development workflow tools via Model Context Protocol (slash commands support)",
6
6
  "main": "dist/index.js",