sample-aws-pricing-calculator-mcp 1.3.1 → 1.3.2

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.
@@ -128,7 +128,7 @@ If any service fails validation, returns a structured needs_field_grounding redi
128
128
 
129
129
  The estimate is kept in the in-memory store, so the returned aws_estimate_id can be passed to add_service/export_estimate to extend it.
130
130
 
131
- For large estimates (20+ services / line items), prefer create_estimate + multiple add_service calls + export_estimate. This avoids token-generation limits and allows incremental building.`+dy;Vn.IMPORT_ESTIMATE="Download an existing AWS Pricing Calculator estimate by URL or ID. Returns the estimate in JSON (raw, for modifications like region swaps) or Markdown (for LLM consumption, summaries, funding recommendations). Use JSON format when you need to modify and re-export the estimate; use Markdown format when summarizing or presenting costs to the user. Accepts a full estimate URL or a bare ID. If the user gave you a URL, pass the whole URL rather than reducing it to the ID \u2014 the domain identifies which calculator stores the estimate (standard calculator.aws vs European Sovereign Cloud pricing.calculator.aws.eu). A bare ID is always read from the standard calculator, so an ESC estimate is only importable as its full pricing.calculator.aws.eu URL."});var HE=b((Bhe,pte)=>{pte.exports={name:"sample-aws-pricing-calculator-mcp",version:"1.3.1",bin:"dist/mcp-server.js",files:["dist/mcp-server.js","catalog/schema.json","catalog/services/*.json"],description:"MCP server for creating, reading, updating AWS Pricing Calculator estimates through natural language.",license:"MIT-0",main:"mcp-server.js",scripts:{test:"npm run validate-catalog && SKIP_NETWORK=1 node --test test/*.test.js","test:network":"npm run validate-catalog && node --test test/*.test.js","test:roundtrip":"node --test test/catalog-roundtrip.test.js",mcp:"node mcp-server.js","validate-catalog":"node scripts/validate-catalog.js","validate-catalog:cost":"node scripts/validate-verified-catalog.js",build:"esbuild mcp-server.js --bundle --platform=node --outfile=dist/mcp-server.js --format=cjs --minify --external:@aws-sdk/client-dynamodb --external:@aws-sdk/lib-dynamodb && node scripts/emit-bundle-contract.js && rm -f dist/aws-calculator.zip && zip dist/aws-calculator.zip mcp-server.js lib/aws/aws-client.js lib/aws/fetch-resilience.js lib/aws/estimate-builder.js lib/aws/ec2.js package.json"},dependencies:{"@modelcontextprotocol/sdk":"1.30.0",express:"5.2.1"},peerDependencies:{"@aws-sdk/client-dynamodb":">=3.700.0","@aws-sdk/lib-dynamodb":">=3.700.0"},peerDependenciesMeta:{"@aws-sdk/client-dynamodb":{optional:!0},"@aws-sdk/lib-dynamodb":{optional:!0}},devDependencies:{"@aws-sdk/client-dynamodb":"3.1046.0","@aws-sdk/lib-dynamodb":"3.1046.0",ajv:"8.20.0","ajv-formats":"3.0.1",esbuild:"0.28.1",playwright:"1.60.0"}}});var GE=b(JE=>{var fte="x-hono-already-sent";Object.defineProperty(JE,"X_ALREADY_SENT",{enumerable:!0,get:function(){return fte}})});var XE=b((Hhe,WE)=>{var fy=Object.defineProperty,mte=Object.getOwnPropertyDescriptor,hte=Object.getOwnPropertyNames,vte=Object.prototype.hasOwnProperty,gte=(e,t)=>{for(var r in t)fy(e,r,{get:t[r],enumerable:!0})},yte=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of hte(t))!vte.call(e,n)&&n!==r&&fy(e,n,{get:()=>t[n],enumerable:!(i=mte(t,n))||i.enumerable});return e},bte=e=>yte(fy({},"__esModule",{value:!0}),e),KE={};gte(KE,{WSContext:()=>py,createWSMessageEvent:()=>_te,defineWebSocketHelper:()=>xte});WE.exports=bte(KE);var py=class{#e;constructor(t){this.#e=t,this.raw=t.raw,this.url=t.url?new URL(t.url):null,this.protocol=t.protocol??null}send(t,r){this.#e.send(t,r??{})}raw;binaryType="arraybuffer";get readyState(){return this.#e.readyState}url;protocol;close(t,r){this.#e.close(t,r)}},_te=e=>new MessageEvent("message",{data:e}),xte=e=>((...t)=>{if(typeof t[0]=="function"){let[r,i]=t;return async function(a,o){let s=await r(a),c=await e(a,s,i);if(c)return c;await o()}}else{let[r,i,n]=t;return(async()=>{let a=await e(r,i,n);if(!a)throw new Error("Failed to upgrade WebSocket");return a})()}})});var SI=b(qa=>{Object.defineProperty(qa,Symbol.toStringTag,{value:"Module"});var wte=GE(),oI=require("node:http"),Na=require("node:http2"),YE=require("node:stream"),Ste=XE(),Zr=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}},$te=/^\/[!#$&-;=?-\[\]_a-z~]*$/,Pte=/\/\.\.?(?:[/?#]|$)/,Ote=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,Ete=(e,t,r)=>{let i=`${e}://${t}${r}`;if(Ote.test(t)){if(r.length===0)return i+"/";if(r.charCodeAt(0)!==47)throw new Zr("Invalid URL");return!$te.test(r)||Pte.test(r)?new URL(i).href:i}else{let n=new URL(i);if(n.hostname.length!==t.length&&n.hostname!==(t.includes(":")?t.replace(/:\d+$/,""):t).toLowerCase())throw new Zr("Invalid host header");return n.href}},Ite=e=>e instanceof Zr?e:new Zr(e.message,{cause:e}),jte=global.Request,Fo=class extends jte{constructor(e,t){if(typeof e=="object"&&Wi in e){let r=t!==void 0&&"body"in t&&t.body!=null;if(e[gi]&&!r)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");e=e[Wi]()}typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},sI=e=>{let t=[],r=e.rawHeaders;for(let i=0,n=r.length;i<n;i+=2){let a=r[i];a.charCodeAt(0)!==58&&t.push([a,r[i+1]])}return new Headers(t)},cI=Symbol("wrapBodyStream"),Tte=new Set(["latin1","binary","hex","base64","base64url"]),kte=e=>e===null||Tte.has(e),my=Symbol("bodyBufferedBeforeDisconnect"),hy=Symbol("bodyBufferedLengthBeforeDisconnect"),uI=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??"utf8"),xy=e=>!(e instanceof Na.Http2ServerRequest)&&!!e.complete&&!!e.readableAborted&&typeof e.read=="function"&&kte(e.readableEncoding),QE=e=>{if(e.readableDidRead||!xy(e))return;let t=e;t[hy]??=e.readableLength},Dp=(e,t)=>{if(e.readableDidRead&&!t||!xy(e))return;let r=e;if(r[my]!==void 0)return r[my];let i,n=e.errored;if(n&&n.code!=="ECONNRESET")i=n;else if(r[hy]!==void 0&&e.readableLength!==r[hy])i=Mp();else{let a=t??[],o=e.read();o!==null&&a.push(uI(o,e.readableEncoding));let s=a.length===1?a[0]:Buffer.concat(a);i=s;let c=e.headers["content-length"];if(typeof c=="string"&&/^\d+$/.test(c)){let u=Number(c);Number.isSafeInteger(u)&&s.length!==u&&(i=Mp())}}return r[my]=i,i},eI=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},Cte=(e,t,r,i,n)=>{let a={method:e,headers:r,signal:n.signal};if(e==="TRACE"){a.method="GET";let o=new Fo(t,a);return Object.defineProperty(o,"method",{get(){return"TRACE"}}),o}if(!(e==="GET"||e==="HEAD"))if("rawBody"in i&&i.rawBody instanceof Buffer)a.body=new ReadableStream({start(o){o.enqueue(i.rawBody),o.close()}});else if(i[cI]){let o;a.body=new ReadableStream({async pull(s){try{if(!o){let l=Dp(i);if(l!==void 0){eI(s,l);return}}o||=YE.Readable.toWeb(i).getReader();let{done:c,value:u}=await o.read();c?s.close():s.enqueue(u)}catch(c){s.error(c)}}})}else{let o=Dp(i);o!==void 0?a.body=new ReadableStream({start(s){eI(s,o)}}):a.body=YE.Readable.toWeb(i)}return new Fo(t,a)},Wi=Symbol("getRequestCache"),hi=Symbol("requestCache"),Bo=Symbol("incomingKey"),$c=Symbol("urlKey"),lI=Symbol("methodKey"),dI=Symbol("headersKey"),wc=Symbol("abortControllerKey"),vy=Symbol("getAbortController"),gy=Symbol("abortRequest"),Ki=Symbol("bodyBuffer"),Ap=Symbol("bodyReadPromise"),gi=Symbol("bodyConsumedDirectly"),tI=Symbol("bodyLockReader"),Sc=Symbol("abortReason"),Mp=()=>new TypeError("Body is unusable"),Pc=()=>Promise.reject(Mp()),Rte=new TextDecoder,Ate=e=>{if(e[gi])return Pc();e[gi]=!0},Dte=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),Mte=e=>(e[dI]||=sI(e[Bo])).get("content-type")||"",Zte=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,zte=e=>{if(typeof e!="string"||e.length===0)return"GET";switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"PATCH":case"POST":case"PUT":case"QUERY":return e}let t=e.toUpperCase();switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return t;default:return e}},Nte=e=>{if(!Zte.test(e))return new TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(t==="CONNECT"||t==="TRACK"||t==="TRACE"&&e!=="TRACE")return new TypeError(`'${e}' HTTP method is unsupported.`)},wy=(e,t,r)=>{if(e[gi])return Pc();let i=e.method;if(i==="GET"||i==="HEAD")return e[Wi]()[t]();let n=Nte(i);if(n)return Promise.reject(n);if(e[hi]&&i!=="TRACE")return e[hi][t]();let a=Ate(e);if(a)return a;let o=qte(e);if(o){let s=Promise.resolve(r(o,e));return e[Ki]=void 0,s}return Ute(e).then(s=>{let c=r(s,e);return e[Ki]=void 0,c})},qte=e=>{let t=e[Bo];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},rI=(e,t)=>{if(t.errored)return t.errored;let r=e[Sc];return r!==void 0?r instanceof Error?r:new Error(String(r)):new Error("Client connection prematurely closed.")},Ute=e=>{if(e[Ki])return Promise.resolve(e[Ki]);if(e[Ap])return e[Ap];let t=e[Bo];if(t.readableDidRead)return Pc();let r=Dp(t);if(r!==void 0)return r instanceof Error?Promise.reject(r):(e[Ki]=r,Promise.resolve(r));let i=new Promise((n,a)=>{let o=[],s=!1,c=_=>{s||(s=!0,v(),_())},u=_=>{let x=t.errored??_;return!xy(t)||x&&x.code!=="ECONNRESET"?!1:(c(()=>{let P=Dp(t,o);P instanceof Error?a(P):P===void 0?a(_??rI(e,t)):(e[Ki]=P,n(P))}),!0)},l=_=>{o.push(uI(_,t.readableEncoding))},d=()=>{c(()=>{let _=o.length===1?o[0]:Buffer.concat(o);e[Ki]=_,n(_)})},p=_=>{u(_)||c(()=>{a(_)})},m=()=>{if(t.readableEnded){d();return}u()||c(()=>{a(rI(e,t))})},v=()=>{t.off("data",l),t.off("end",d),t.off("error",p),t.off("close",m),e[Ap]=void 0};t.on("data",l),t.on("end",d),t.on("error",p),t.on("close",m),queueMicrotask(()=>{s||(t.readableEnded?d():t.errored?p(t.errored):t.destroyed&&m())})});return e[Ap]=i,i},Jn={get method(){return this[lI]},get url(){return this[$c]},get headers(){return this[dI]||=sI(this[Bo])},[gy](e){this[Sc]===void 0&&(this[Sc]=e);let t=this[wc];t&&!t.signal.aborted&&t.abort(e)},[vy](){return this[wc]||=new AbortController,this[Sc]!==void 0&&!this[wc].signal.aborted&&this[wc].abort(this[Sc]),this[wc]},[Wi](){let e=this[vy]();if(this[hi])return this[hi];let t=this.method;if(this[gi]&&!(t==="GET"||t==="HEAD")){this[Ki]=void 0;let r={method:t==="TRACE"?"GET":t,headers:this.headers,signal:e.signal};t!=="TRACE"&&(r.body=new ReadableStream({start(n){n.close()}}),r.duplex="half");let i=new Fo(this[$c],r);return t==="TRACE"&&Object.defineProperty(i,"method",{get(){return"TRACE"}}),this[hi]=i}return this[hi]=Cte(this.method,this[$c],this.headers,this[Bo],e)},get body(){if(!this[gi])return this[Wi]().body;let e=this[Wi]();return!this[tI]&&e.body&&(this[tI]=e.body.getReader()),e.body},get bodyUsed(){return this[gi]?!0:this[hi]?this[hi].bodyUsed:!1}};Object.defineProperty(Jn,"signal",{get(){return this[vy]().signal}});["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(Jn,e,{get(){return this[Wi]()[e]}})});["clone","formData"].forEach(e=>{Object.defineProperty(Jn,e,{value:function(){if(this[gi]){if(e==="clone")throw Mp();return Pc()}return this[Wi]()[e]()}})});Object.defineProperty(Jn,"text",{value:function(){return wy(this,"text",e=>Rte.decode(e))}});Object.defineProperty(Jn,"arrayBuffer",{value:function(){return wy(this,"arrayBuffer",e=>Dte(e))}});Object.defineProperty(Jn,"blob",{value:function(){return wy(this,"blob",(e,t)=>{let r=Mte(t),i=r?{headers:{"content-type":r}}:void 0;return new Response(e,i).blob()})}});Object.defineProperty(Jn,"json",{value:function(){return this[gi]?Pc():this.text().then(JSON.parse)}});Object.defineProperty(Jn,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Request (lightweight) ${r({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[hi]},{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(Jn,Fo.prototype);var Lte=(e,t)=>{let r=Object.create(Jn);r[Bo]=e,r[lI]=zte(e.method);let i=e.url||"";if(i[0]!=="/"&&(i.startsWith("http://")||i.startsWith("https://"))){if(e instanceof Na.Http2ServerRequest)throw new Zr("Absolute URL for :path is not allowed in HTTP/2");try{r[$c]=new URL(i).href}catch(o){throw new Zr("Invalid absolute URL",{cause:o})}return r}let n=(e instanceof Na.Http2ServerRequest?e.authority:e.headers.host)||t;if(!n)throw new Zr("Missing host header");let a;if(e instanceof Na.Http2ServerRequest){if(a=e.scheme,!(a==="http"||a==="https"))throw new Zr("Unsupported scheme")}else a=e.socket&&e.socket.encrypted?"https":"http";try{r[$c]=Ete(a,n,i)}catch(o){throw o instanceof Zr?o:new Zr("Invalid URL",{cause:o})}return r},Gi="text/plain; charset=UTF-8",yy=Symbol("responseCache"),Lo=Symbol("getResponseCache"),vi=Symbol("cache"),Zp=global.Response,Hn=class pI{#e;#t;[Lo](){let t=this[vi],r=t&&t[2]instanceof Headers?t[2]:void 0;return delete this[vi],this[yy]||=new Zp(this.#e,r?{status:this.#t?.status,statusText:this.#t?.statusText,headers:r}:this.#t)}constructor(t,r){let i;if(this.#e=t,r instanceof Zp){let n=r[yy];if(n){this.#t=n,this[Lo]();return}this.#t=r instanceof pI?r.#t:r,i=new Headers(r.headers)}else this.#t=r;(t==null||typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(this[vi]=[r?.status||200,t??null,i||r?.headers])}get headers(){let t=this[vi];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2]||(t[1]===null?void 0:{"content-type":Gi}))),t[2]):this[Lo]().headers}get status(){return this[vi]?.[0]??this[Lo]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(Hn.prototype,e,{get(){return this[Lo]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(Hn.prototype,e,{value:function(){return this[Lo]()[e]()}})});Object.defineProperty(Hn.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Response (lightweight) ${r({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[yy]},{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(Hn,Zp);Object.setPrototypeOf(Hn.prototype,Zp.prototype);var Fte=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,Bte=e=>e instanceof URL?e.href:Fte.test(e)?e:new URL(e).href,Vte=new Set([301,302,303,307,308]);Object.defineProperty(Hn,"redirect",{value:function(t,r=302){if(!Vte.has(r))throw new RangeError("Invalid status code");return new Hn(null,{status:r,headers:{location:Bte(t)}})},writable:!0,configurable:!0});Object.defineProperty(Hn,"json",{value:function(t,r){let i=JSON.stringify(t);if(i===void 0)throw new TypeError("The data is not JSON serializable");let n=r?.headers,a;return n?(a=new Headers(n),a.has("content-type")||a.set("content-type","application/json")):a={"content-type":"application/json"},new Hn(i,{status:r?.status??200,statusText:r?.statusText,headers:a})},writable:!0,configurable:!0});async function Hte(e){return Promise.race([e,Promise.resolve().then(()=>Promise.resolve(void 0))])}function fI(e,t,r){let i=s=>{e.cancel(s).catch(()=>{})};return t.on("close",i),t.on("error",i),(r??e.read()).then(o,n),e.closed.finally(()=>{t.off("close",i),t.off("error",i)});function n(s){s&&t.destroy(s)}function a(){e.read().then(o,n)}function o({done:s,value:c}){try{if(s)t.end();else if(!t.write(c))t.once("drain",a);else return e.read().then(o,n)}catch(u){n(u)}}}function nI(e,t){if(e.locked)throw new TypeError("ReadableStream is locked.");return t.destroyed?void 0:fI(e.getReader(),t)}var by=(e,t)=>{let r={};if(e instanceof Headers||(e=new Headers(e??void 0)),e.has("set-cookie")){let i=[];for(let[n,a]of e)n==="set-cookie"?i.push(a):r[n]=a;i.length>0&&(r["set-cookie"]=i)}else for(let[i,n]of e)r[i]=n;return t&&(r["content-type"]??=t),r},zp=Symbol("outgoingEnded"),iI=Symbol("incomingDraining"),Jte=500,Gte=64*1024*1024,mI=e=>{let t=e;if(e.destroyed||t[iI])return;if(t[iI]=!0,e instanceof Na.Http2ServerRequest){try{e.stream?.close?.(Na.constants.NGHTTP2_NO_ERROR)}catch{}return}let r=0,i=()=>{clearTimeout(a),e.off("data",o),e.off("end",i),e.off("error",i)},n=()=>{i();let s=e.socket;s&&!s.destroyed&&(typeof s.destroySoon=="function"?s.destroySoon():typeof s.destroy=="function"&&s.destroy())},a=setTimeout(n,Jte);a.unref?.();let o=s=>{r+=s.length,r>Gte&&n()};e.on("data",o),e.on("end",i),e.on("error",i),e.resume()},Kte=(e,t,r,i)=>()=>{t.errored?(QE(t),e[gy](t.errored.toString())):r.writableFinished||(QE(t),e[gy]("Client connection prematurely closed.")),i&&!t.readableEnded&&setTimeout(()=>{t.readableEnded||setTimeout(()=>{mI(t)})})},Wte=e=>{if(!(vi in e))return!1;let t=e[vi][1];return t===null||typeof t=="string"||t instanceof Uint8Array},Xte=()=>new Response(null,{status:400}),hI=e=>new Response(null,{status:e instanceof Error&&(e.name==="TimeoutError"||e.constructor.name==="TimeoutError")?504:500}),Np=(e,t)=>{let r=e instanceof Error?e:new Error("unknown error",{cause:e});r.code==="ERR_STREAM_PREMATURE_CLOSE"?console.info("The user aborted a request."):(console.error(e),t.headersSent||t.writeHead(500,{"Content-Type":"text/plain"}),t.end(`Error: ${r.message}`),t.destroy(r))},_y=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},vI=async(e,t)=>{let[r,i,n]=e[vi];if(!n){i===null?(t.writeHead(r),t.end()):typeof i=="string"?(t.writeHead(r,{"Content-Type":Gi,"Content-Length":Buffer.byteLength(i)}),t.end(i)):i instanceof Uint8Array?(t.writeHead(r,{"Content-Type":Gi,"Content-Length":i.byteLength}),t.end(i)):i instanceof Blob?(t.writeHead(r,{"Content-Type":Gi,"Content-Length":i.size}),t.end(new Uint8Array(await i.arrayBuffer()))):(t.writeHead(r,{"Content-Type":Gi}),_y(t),await nI(i,t)?.catch(o=>Np(o,t))),t[zp]?.();return}let a=!1;if(n instanceof Headers)a=n.has("content-length"),n=by(n,i===null?void 0:Gi);else if(Array.isArray(n)){let o=new Headers(n);a=o.has("content-length"),n=by(o,i===null?void 0:Gi)}else for(let o in n)if(o.length===14&&o.toLowerCase()==="content-length"){a=!0;break}a||(typeof i=="string"?n["Content-Length"]=Buffer.byteLength(i):i instanceof Uint8Array?n["Content-Length"]=i.byteLength:i instanceof Blob&&(n["Content-Length"]=i.size)),t.writeHead(r,n),i==null?t.end():typeof i=="string"||i instanceof Uint8Array?t.end(i):i instanceof Blob?t.end(new Uint8Array(await i.arrayBuffer())):(_y(t),await nI(i,t)?.catch(o=>Np(o,t))),t[zp]?.()},gI=e=>typeof e.then=="function",Yte=async(e,t,r={})=>{if(gI(e))if(r.errorHandler)try{e=await e}catch(n){let a=await r.errorHandler(n);if(!a)return;e=a}else e=await e.catch(hI);if(vi in e)return vI(e,t);let i=by(e.headers,e.body===null?void 0:Gi);if(e.body){let n=e.body.getReader(),a=[],o=!1,s;if(i["transfer-encoding"]!=="chunked"){let c=2;for(let u=0;u<c;u++){s||=n.read();let l=await Hte(s).catch(d=>{console.error(d),o=!0});if(!l){if(u===1){await new Promise(d=>setTimeout(d)),c=3;continue}break}if(s=void 0,l.value&&a.push(l.value),l.done){o=!0;break}}o&&!("content-length"in i)&&(i["content-length"]=a.reduce((u,l)=>u+l.length,0))}t.writeHead(e.status,i),a.forEach(c=>{t.write(c)}),o?t.end():(a.length===0&&_y(t),await fI(n,t,s))}else i[wte.X_ALREADY_SENT]||(t.writeHead(e.status,i),t.end());t[zp]?.()},yI=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return t.overrideGlobalObjects!==!1&&global.Request!==Fo&&(Object.defineProperty(global,"Request",{value:Fo}),Object.defineProperty(global,"Response",{value:Hn})),async(i,n)=>{let a,o,s=!1,c=!1,u=()=>{!o||c||(c=!0,n.on("close",Kte(o,i,n,s)))};try{if(o=Lte(i,t.hostname),s=r&&!(i.method==="GET"||i.method==="HEAD"),s&&(i[cI]=!0,i instanceof Na.Http2ServerRequest&&(n[zp]=()=>{i.readableEnded||setTimeout(()=>{i.readableEnded||setTimeout(()=>{i.destroy(),n.destroy()})})})),a=e(o,{incoming:i,outgoing:n}),!gI(a)&&Wte(a))return s&&!i.readableEnded&&n.once("finish",()=>{i.readableEnded||mI(i)}),vI(a,n);u()}catch(l){if(a)return Np(l,n);if(t.errorHandler){if(u(),a=await t.errorHandler(o?l:Ite(l)),!a)return}else o?a=hI(l):a=Xte()}try{return await Yte(a,n,t)}catch(l){return Np(l,n)}}},Qte=globalThis.CloseEvent??class extends Event{#e;constructor(e,t={}){super(e,t),this.#e=t}get wasClean(){return this.#e.wasClean??!1}get code(){return this.#e.code??0}get reason(){return this.#e.reason??""}},ere=globalThis.ErrorEvent??class extends Event{#e;constructor(e,t={}){super(e,t),this.#e=t}get message(){return this.#e.message??""}get filename(){return this.#e.filename??""}get lineno(){return this.#e.lineno??0}get colno(){return this.#e.colno??0}get error(){return this.#e.error??null}},tre=()=>Symbol("connection"),bI=Symbol("CONNECTION_SYMBOL_KEY"),_I=Symbol("WAIT_FOR_WEBSOCKET_SYMBOL"),rre=new Set(["connection","content-length","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","sec-websocket-accept","sec-websocket-extensions","sec-websocket-protocol"]),xI=(e,t)=>{t&&t.forEach((r,i)=>{rre.has(i.toLowerCase())||e.push(`${i}: ${r}`)})},aI=(e,t,r)=>{let i=["Connection: close","Content-Length: 0"];xI(i,r),e.end(`HTTP/1.1 ${t.toString()} ${oI.STATUS_CODES[t]??""}\r
131
+ For large estimates (20+ services / line items), prefer create_estimate + multiple add_service calls + export_estimate. This avoids token-generation limits and allows incremental building.`+dy;Vn.IMPORT_ESTIMATE="Download an existing AWS Pricing Calculator estimate by URL or ID. Returns the estimate in JSON (raw, for modifications like region swaps) or Markdown (for LLM consumption, summaries, funding recommendations). Use JSON format when you need to modify and re-export the estimate; use Markdown format when summarizing or presenting costs to the user. Accepts a full estimate URL or a bare ID. If the user gave you a URL, pass the whole URL rather than reducing it to the ID \u2014 the domain identifies which calculator stores the estimate (standard calculator.aws vs European Sovereign Cloud pricing.calculator.aws.eu). A bare ID is always read from the standard calculator, so an ESC estimate is only importable as its full pricing.calculator.aws.eu URL."});var HE=b((Bhe,pte)=>{pte.exports={name:"sample-aws-pricing-calculator-mcp",version:"1.3.2",bin:"dist/mcp-server.js",files:["dist/mcp-server.js","catalog/schema.json","catalog/services/*.json"],description:"MCP server for creating, reading, updating AWS Pricing Calculator estimates through natural language.",license:"MIT-0",main:"mcp-server.js",scripts:{test:"npm run validate-catalog && SKIP_NETWORK=1 node --test test/*.test.js","test:network":"npm run validate-catalog && node --test test/*.test.js","test:roundtrip":"node --test test/catalog-roundtrip.test.js",mcp:"node mcp-server.js","validate-catalog":"node scripts/validate-catalog.js","validate-catalog:cost":"node scripts/validate-verified-catalog.js",build:"esbuild mcp-server.js --bundle --platform=node --outfile=dist/mcp-server.js --format=cjs --minify --external:@aws-sdk/client-dynamodb --external:@aws-sdk/lib-dynamodb && node scripts/emit-bundle-contract.js && rm -f dist/aws-calculator.zip && zip dist/aws-calculator.zip mcp-server.js lib/aws/aws-client.js lib/aws/fetch-resilience.js lib/aws/estimate-builder.js lib/aws/ec2.js package.json"},dependencies:{"@modelcontextprotocol/sdk":"1.30.0",express:"5.2.1"},peerDependencies:{"@aws-sdk/client-dynamodb":">=3.700.0","@aws-sdk/lib-dynamodb":">=3.700.0"},peerDependenciesMeta:{"@aws-sdk/client-dynamodb":{optional:!0},"@aws-sdk/lib-dynamodb":{optional:!0}},devDependencies:{"@aws-sdk/client-dynamodb":"3.1046.0","@aws-sdk/lib-dynamodb":"3.1046.0",ajv:"8.20.0","ajv-formats":"3.0.1",esbuild:"0.28.1",playwright:"1.60.0"}}});var GE=b(JE=>{var fte="x-hono-already-sent";Object.defineProperty(JE,"X_ALREADY_SENT",{enumerable:!0,get:function(){return fte}})});var XE=b((Hhe,WE)=>{var fy=Object.defineProperty,mte=Object.getOwnPropertyDescriptor,hte=Object.getOwnPropertyNames,vte=Object.prototype.hasOwnProperty,gte=(e,t)=>{for(var r in t)fy(e,r,{get:t[r],enumerable:!0})},yte=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of hte(t))!vte.call(e,n)&&n!==r&&fy(e,n,{get:()=>t[n],enumerable:!(i=mte(t,n))||i.enumerable});return e},bte=e=>yte(fy({},"__esModule",{value:!0}),e),KE={};gte(KE,{WSContext:()=>py,createWSMessageEvent:()=>_te,defineWebSocketHelper:()=>xte});WE.exports=bte(KE);var py=class{#e;constructor(t){this.#e=t,this.raw=t.raw,this.url=t.url?new URL(t.url):null,this.protocol=t.protocol??null}send(t,r){this.#e.send(t,r??{})}raw;binaryType="arraybuffer";get readyState(){return this.#e.readyState}url;protocol;close(t,r){this.#e.close(t,r)}},_te=e=>new MessageEvent("message",{data:e}),xte=e=>((...t)=>{if(typeof t[0]=="function"){let[r,i]=t;return async function(a,o){let s=await r(a),c=await e(a,s,i);if(c)return c;await o()}}else{let[r,i,n]=t;return(async()=>{let a=await e(r,i,n);if(!a)throw new Error("Failed to upgrade WebSocket");return a})()}})});var SI=b(qa=>{Object.defineProperty(qa,Symbol.toStringTag,{value:"Module"});var wte=GE(),oI=require("node:http"),Na=require("node:http2"),YE=require("node:stream"),Ste=XE(),Zr=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}},$te=/^\/[!#$&-;=?-\[\]_a-z~]*$/,Pte=/\/\.\.?(?:[/?#]|$)/,Ote=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,Ete=(e,t,r)=>{let i=`${e}://${t}${r}`;if(Ote.test(t)){if(r.length===0)return i+"/";if(r.charCodeAt(0)!==47)throw new Zr("Invalid URL");return!$te.test(r)||Pte.test(r)?new URL(i).href:i}else{let n=new URL(i);if(n.hostname.length!==t.length&&n.hostname!==(t.includes(":")?t.replace(/:\d+$/,""):t).toLowerCase())throw new Zr("Invalid host header");return n.href}},Ite=e=>e instanceof Zr?e:new Zr(e.message,{cause:e}),jte=global.Request,Fo=class extends jte{constructor(e,t){if(typeof e=="object"&&Wi in e){let r=t!==void 0&&"body"in t&&t.body!=null;if(e[gi]&&!r)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");e=e[Wi]()}typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},sI=e=>{let t=[],r=e.rawHeaders;for(let i=0,n=r.length;i<n;i+=2){let a=r[i];a.charCodeAt(0)!==58&&t.push([a,r[i+1]])}return new Headers(t)},cI=Symbol("wrapBodyStream"),Tte=new Set(["latin1","binary","hex","base64","base64url"]),kte=e=>e===null||Tte.has(e),my=Symbol("bodyBufferedBeforeDisconnect"),hy=Symbol("bodyBufferedLengthBeforeDisconnect"),uI=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??"utf8"),xy=e=>!(e instanceof Na.Http2ServerRequest)&&!!e.complete&&!!e.readableAborted&&typeof e.read=="function"&&kte(e.readableEncoding),QE=e=>{if(e.readableDidRead||!xy(e))return;let t=e;t[hy]??=e.readableLength},Dp=(e,t)=>{if(e.readableDidRead&&!t||!xy(e))return;let r=e;if(r[my]!==void 0)return r[my];let i,n=e.errored;if(n&&n.code!=="ECONNRESET")i=n;else if(r[hy]!==void 0&&e.readableLength!==r[hy])i=Mp();else{let a=t??[],o=e.read();o!==null&&a.push(uI(o,e.readableEncoding));let s=a.length===1?a[0]:Buffer.concat(a);i=s;let c=e.headers["content-length"];if(typeof c=="string"&&/^\d+$/.test(c)){let u=Number(c);Number.isSafeInteger(u)&&s.length!==u&&(i=Mp())}}return r[my]=i,i},eI=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},Cte=(e,t,r,i,n)=>{let a={method:e,headers:r,signal:n.signal};if(e==="TRACE"){a.method="GET";let o=new Fo(t,a);return Object.defineProperty(o,"method",{get(){return"TRACE"}}),o}if(!(e==="GET"||e==="HEAD"))if("rawBody"in i&&i.rawBody instanceof Buffer)a.body=new ReadableStream({start(o){o.enqueue(i.rawBody),o.close()}});else if(i[cI]){let o;a.body=new ReadableStream({async pull(s){try{if(!o){let l=Dp(i);if(l!==void 0){eI(s,l);return}}o||=YE.Readable.toWeb(i).getReader();let{done:c,value:u}=await o.read();c?s.close():s.enqueue(u)}catch(c){s.error(c)}}})}else{let o=Dp(i);o!==void 0?a.body=new ReadableStream({start(s){eI(s,o)}}):a.body=YE.Readable.toWeb(i)}return new Fo(t,a)},Wi=Symbol("getRequestCache"),hi=Symbol("requestCache"),Bo=Symbol("incomingKey"),$c=Symbol("urlKey"),lI=Symbol("methodKey"),dI=Symbol("headersKey"),wc=Symbol("abortControllerKey"),vy=Symbol("getAbortController"),gy=Symbol("abortRequest"),Ki=Symbol("bodyBuffer"),Ap=Symbol("bodyReadPromise"),gi=Symbol("bodyConsumedDirectly"),tI=Symbol("bodyLockReader"),Sc=Symbol("abortReason"),Mp=()=>new TypeError("Body is unusable"),Pc=()=>Promise.reject(Mp()),Rte=new TextDecoder,Ate=e=>{if(e[gi])return Pc();e[gi]=!0},Dte=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),Mte=e=>(e[dI]||=sI(e[Bo])).get("content-type")||"",Zte=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,zte=e=>{if(typeof e!="string"||e.length===0)return"GET";switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"PATCH":case"POST":case"PUT":case"QUERY":return e}let t=e.toUpperCase();switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return t;default:return e}},Nte=e=>{if(!Zte.test(e))return new TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(t==="CONNECT"||t==="TRACK"||t==="TRACE"&&e!=="TRACE")return new TypeError(`'${e}' HTTP method is unsupported.`)},wy=(e,t,r)=>{if(e[gi])return Pc();let i=e.method;if(i==="GET"||i==="HEAD")return e[Wi]()[t]();let n=Nte(i);if(n)return Promise.reject(n);if(e[hi]&&i!=="TRACE")return e[hi][t]();let a=Ate(e);if(a)return a;let o=qte(e);if(o){let s=Promise.resolve(r(o,e));return e[Ki]=void 0,s}return Ute(e).then(s=>{let c=r(s,e);return e[Ki]=void 0,c})},qte=e=>{let t=e[Bo];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},rI=(e,t)=>{if(t.errored)return t.errored;let r=e[Sc];return r!==void 0?r instanceof Error?r:new Error(String(r)):new Error("Client connection prematurely closed.")},Ute=e=>{if(e[Ki])return Promise.resolve(e[Ki]);if(e[Ap])return e[Ap];let t=e[Bo];if(t.readableDidRead)return Pc();let r=Dp(t);if(r!==void 0)return r instanceof Error?Promise.reject(r):(e[Ki]=r,Promise.resolve(r));let i=new Promise((n,a)=>{let o=[],s=!1,c=_=>{s||(s=!0,v(),_())},u=_=>{let x=t.errored??_;return!xy(t)||x&&x.code!=="ECONNRESET"?!1:(c(()=>{let P=Dp(t,o);P instanceof Error?a(P):P===void 0?a(_??rI(e,t)):(e[Ki]=P,n(P))}),!0)},l=_=>{o.push(uI(_,t.readableEncoding))},d=()=>{c(()=>{let _=o.length===1?o[0]:Buffer.concat(o);e[Ki]=_,n(_)})},p=_=>{u(_)||c(()=>{a(_)})},m=()=>{if(t.readableEnded){d();return}u()||c(()=>{a(rI(e,t))})},v=()=>{t.off("data",l),t.off("end",d),t.off("error",p),t.off("close",m),e[Ap]=void 0};t.on("data",l),t.on("end",d),t.on("error",p),t.on("close",m),queueMicrotask(()=>{s||(t.readableEnded?d():t.errored?p(t.errored):t.destroyed&&m())})});return e[Ap]=i,i},Jn={get method(){return this[lI]},get url(){return this[$c]},get headers(){return this[dI]||=sI(this[Bo])},[gy](e){this[Sc]===void 0&&(this[Sc]=e);let t=this[wc];t&&!t.signal.aborted&&t.abort(e)},[vy](){return this[wc]||=new AbortController,this[Sc]!==void 0&&!this[wc].signal.aborted&&this[wc].abort(this[Sc]),this[wc]},[Wi](){let e=this[vy]();if(this[hi])return this[hi];let t=this.method;if(this[gi]&&!(t==="GET"||t==="HEAD")){this[Ki]=void 0;let r={method:t==="TRACE"?"GET":t,headers:this.headers,signal:e.signal};t!=="TRACE"&&(r.body=new ReadableStream({start(n){n.close()}}),r.duplex="half");let i=new Fo(this[$c],r);return t==="TRACE"&&Object.defineProperty(i,"method",{get(){return"TRACE"}}),this[hi]=i}return this[hi]=Cte(this.method,this[$c],this.headers,this[Bo],e)},get body(){if(!this[gi])return this[Wi]().body;let e=this[Wi]();return!this[tI]&&e.body&&(this[tI]=e.body.getReader()),e.body},get bodyUsed(){return this[gi]?!0:this[hi]?this[hi].bodyUsed:!1}};Object.defineProperty(Jn,"signal",{get(){return this[vy]().signal}});["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(Jn,e,{get(){return this[Wi]()[e]}})});["clone","formData"].forEach(e=>{Object.defineProperty(Jn,e,{value:function(){if(this[gi]){if(e==="clone")throw Mp();return Pc()}return this[Wi]()[e]()}})});Object.defineProperty(Jn,"text",{value:function(){return wy(this,"text",e=>Rte.decode(e))}});Object.defineProperty(Jn,"arrayBuffer",{value:function(){return wy(this,"arrayBuffer",e=>Dte(e))}});Object.defineProperty(Jn,"blob",{value:function(){return wy(this,"blob",(e,t)=>{let r=Mte(t),i=r?{headers:{"content-type":r}}:void 0;return new Response(e,i).blob()})}});Object.defineProperty(Jn,"json",{value:function(){return this[gi]?Pc():this.text().then(JSON.parse)}});Object.defineProperty(Jn,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Request (lightweight) ${r({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[hi]},{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(Jn,Fo.prototype);var Lte=(e,t)=>{let r=Object.create(Jn);r[Bo]=e,r[lI]=zte(e.method);let i=e.url||"";if(i[0]!=="/"&&(i.startsWith("http://")||i.startsWith("https://"))){if(e instanceof Na.Http2ServerRequest)throw new Zr("Absolute URL for :path is not allowed in HTTP/2");try{r[$c]=new URL(i).href}catch(o){throw new Zr("Invalid absolute URL",{cause:o})}return r}let n=(e instanceof Na.Http2ServerRequest?e.authority:e.headers.host)||t;if(!n)throw new Zr("Missing host header");let a;if(e instanceof Na.Http2ServerRequest){if(a=e.scheme,!(a==="http"||a==="https"))throw new Zr("Unsupported scheme")}else a=e.socket&&e.socket.encrypted?"https":"http";try{r[$c]=Ete(a,n,i)}catch(o){throw o instanceof Zr?o:new Zr("Invalid URL",{cause:o})}return r},Gi="text/plain; charset=UTF-8",yy=Symbol("responseCache"),Lo=Symbol("getResponseCache"),vi=Symbol("cache"),Zp=global.Response,Hn=class pI{#e;#t;[Lo](){let t=this[vi],r=t&&t[2]instanceof Headers?t[2]:void 0;return delete this[vi],this[yy]||=new Zp(this.#e,r?{status:this.#t?.status,statusText:this.#t?.statusText,headers:r}:this.#t)}constructor(t,r){let i;if(this.#e=t,r instanceof Zp){let n=r[yy];if(n){this.#t=n,this[Lo]();return}this.#t=r instanceof pI?r.#t:r,i=new Headers(r.headers)}else this.#t=r;(t==null||typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(this[vi]=[r?.status||200,t??null,i||r?.headers])}get headers(){let t=this[vi];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2]||(t[1]===null?void 0:{"content-type":Gi}))),t[2]):this[Lo]().headers}get status(){return this[vi]?.[0]??this[Lo]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(Hn.prototype,e,{get(){return this[Lo]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(Hn.prototype,e,{value:function(){return this[Lo]()[e]()}})});Object.defineProperty(Hn.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Response (lightweight) ${r({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[yy]},{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(Hn,Zp);Object.setPrototypeOf(Hn.prototype,Zp.prototype);var Fte=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,Bte=e=>e instanceof URL?e.href:Fte.test(e)?e:new URL(e).href,Vte=new Set([301,302,303,307,308]);Object.defineProperty(Hn,"redirect",{value:function(t,r=302){if(!Vte.has(r))throw new RangeError("Invalid status code");return new Hn(null,{status:r,headers:{location:Bte(t)}})},writable:!0,configurable:!0});Object.defineProperty(Hn,"json",{value:function(t,r){let i=JSON.stringify(t);if(i===void 0)throw new TypeError("The data is not JSON serializable");let n=r?.headers,a;return n?(a=new Headers(n),a.has("content-type")||a.set("content-type","application/json")):a={"content-type":"application/json"},new Hn(i,{status:r?.status??200,statusText:r?.statusText,headers:a})},writable:!0,configurable:!0});async function Hte(e){return Promise.race([e,Promise.resolve().then(()=>Promise.resolve(void 0))])}function fI(e,t,r){let i=s=>{e.cancel(s).catch(()=>{})};return t.on("close",i),t.on("error",i),(r??e.read()).then(o,n),e.closed.finally(()=>{t.off("close",i),t.off("error",i)});function n(s){s&&t.destroy(s)}function a(){e.read().then(o,n)}function o({done:s,value:c}){try{if(s)t.end();else if(!t.write(c))t.once("drain",a);else return e.read().then(o,n)}catch(u){n(u)}}}function nI(e,t){if(e.locked)throw new TypeError("ReadableStream is locked.");return t.destroyed?void 0:fI(e.getReader(),t)}var by=(e,t)=>{let r={};if(e instanceof Headers||(e=new Headers(e??void 0)),e.has("set-cookie")){let i=[];for(let[n,a]of e)n==="set-cookie"?i.push(a):r[n]=a;i.length>0&&(r["set-cookie"]=i)}else for(let[i,n]of e)r[i]=n;return t&&(r["content-type"]??=t),r},zp=Symbol("outgoingEnded"),iI=Symbol("incomingDraining"),Jte=500,Gte=64*1024*1024,mI=e=>{let t=e;if(e.destroyed||t[iI])return;if(t[iI]=!0,e instanceof Na.Http2ServerRequest){try{e.stream?.close?.(Na.constants.NGHTTP2_NO_ERROR)}catch{}return}let r=0,i=()=>{clearTimeout(a),e.off("data",o),e.off("end",i),e.off("error",i)},n=()=>{i();let s=e.socket;s&&!s.destroyed&&(typeof s.destroySoon=="function"?s.destroySoon():typeof s.destroy=="function"&&s.destroy())},a=setTimeout(n,Jte);a.unref?.();let o=s=>{r+=s.length,r>Gte&&n()};e.on("data",o),e.on("end",i),e.on("error",i),e.resume()},Kte=(e,t,r,i)=>()=>{t.errored?(QE(t),e[gy](t.errored.toString())):r.writableFinished||(QE(t),e[gy]("Client connection prematurely closed.")),i&&!t.readableEnded&&setTimeout(()=>{t.readableEnded||setTimeout(()=>{mI(t)})})},Wte=e=>{if(!(vi in e))return!1;let t=e[vi][1];return t===null||typeof t=="string"||t instanceof Uint8Array},Xte=()=>new Response(null,{status:400}),hI=e=>new Response(null,{status:e instanceof Error&&(e.name==="TimeoutError"||e.constructor.name==="TimeoutError")?504:500}),Np=(e,t)=>{let r=e instanceof Error?e:new Error("unknown error",{cause:e});r.code==="ERR_STREAM_PREMATURE_CLOSE"?console.info("The user aborted a request."):(console.error(e),t.headersSent||t.writeHead(500,{"Content-Type":"text/plain"}),t.end(`Error: ${r.message}`),t.destroy(r))},_y=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},vI=async(e,t)=>{let[r,i,n]=e[vi];if(!n){i===null?(t.writeHead(r),t.end()):typeof i=="string"?(t.writeHead(r,{"Content-Type":Gi,"Content-Length":Buffer.byteLength(i)}),t.end(i)):i instanceof Uint8Array?(t.writeHead(r,{"Content-Type":Gi,"Content-Length":i.byteLength}),t.end(i)):i instanceof Blob?(t.writeHead(r,{"Content-Type":Gi,"Content-Length":i.size}),t.end(new Uint8Array(await i.arrayBuffer()))):(t.writeHead(r,{"Content-Type":Gi}),_y(t),await nI(i,t)?.catch(o=>Np(o,t))),t[zp]?.();return}let a=!1;if(n instanceof Headers)a=n.has("content-length"),n=by(n,i===null?void 0:Gi);else if(Array.isArray(n)){let o=new Headers(n);a=o.has("content-length"),n=by(o,i===null?void 0:Gi)}else for(let o in n)if(o.length===14&&o.toLowerCase()==="content-length"){a=!0;break}a||(typeof i=="string"?n["Content-Length"]=Buffer.byteLength(i):i instanceof Uint8Array?n["Content-Length"]=i.byteLength:i instanceof Blob&&(n["Content-Length"]=i.size)),t.writeHead(r,n),i==null?t.end():typeof i=="string"||i instanceof Uint8Array?t.end(i):i instanceof Blob?t.end(new Uint8Array(await i.arrayBuffer())):(_y(t),await nI(i,t)?.catch(o=>Np(o,t))),t[zp]?.()},gI=e=>typeof e.then=="function",Yte=async(e,t,r={})=>{if(gI(e))if(r.errorHandler)try{e=await e}catch(n){let a=await r.errorHandler(n);if(!a)return;e=a}else e=await e.catch(hI);if(vi in e)return vI(e,t);let i=by(e.headers,e.body===null?void 0:Gi);if(e.body){let n=e.body.getReader(),a=[],o=!1,s;if(i["transfer-encoding"]!=="chunked"){let c=2;for(let u=0;u<c;u++){s||=n.read();let l=await Hte(s).catch(d=>{console.error(d),o=!0});if(!l){if(u===1){await new Promise(d=>setTimeout(d)),c=3;continue}break}if(s=void 0,l.value&&a.push(l.value),l.done){o=!0;break}}o&&!("content-length"in i)&&(i["content-length"]=a.reduce((u,l)=>u+l.length,0))}t.writeHead(e.status,i),a.forEach(c=>{t.write(c)}),o?t.end():(a.length===0&&_y(t),await fI(n,t,s))}else i[wte.X_ALREADY_SENT]||(t.writeHead(e.status,i),t.end());t[zp]?.()},yI=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return t.overrideGlobalObjects!==!1&&global.Request!==Fo&&(Object.defineProperty(global,"Request",{value:Fo}),Object.defineProperty(global,"Response",{value:Hn})),async(i,n)=>{let a,o,s=!1,c=!1,u=()=>{!o||c||(c=!0,n.on("close",Kte(o,i,n,s)))};try{if(o=Lte(i,t.hostname),s=r&&!(i.method==="GET"||i.method==="HEAD"),s&&(i[cI]=!0,i instanceof Na.Http2ServerRequest&&(n[zp]=()=>{i.readableEnded||setTimeout(()=>{i.readableEnded||setTimeout(()=>{i.destroy(),n.destroy()})})})),a=e(o,{incoming:i,outgoing:n}),!gI(a)&&Wte(a))return s&&!i.readableEnded&&n.once("finish",()=>{i.readableEnded||mI(i)}),vI(a,n);u()}catch(l){if(a)return Np(l,n);if(t.errorHandler){if(u(),a=await t.errorHandler(o?l:Ite(l)),!a)return}else o?a=hI(l):a=Xte()}try{return await Yte(a,n,t)}catch(l){return Np(l,n)}}},Qte=globalThis.CloseEvent??class extends Event{#e;constructor(e,t={}){super(e,t),this.#e=t}get wasClean(){return this.#e.wasClean??!1}get code(){return this.#e.code??0}get reason(){return this.#e.reason??""}},ere=globalThis.ErrorEvent??class extends Event{#e;constructor(e,t={}){super(e,t),this.#e=t}get message(){return this.#e.message??""}get filename(){return this.#e.filename??""}get lineno(){return this.#e.lineno??0}get colno(){return this.#e.colno??0}get error(){return this.#e.error??null}},tre=()=>Symbol("connection"),bI=Symbol("CONNECTION_SYMBOL_KEY"),_I=Symbol("WAIT_FOR_WEBSOCKET_SYMBOL"),rre=new Set(["connection","content-length","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","sec-websocket-accept","sec-websocket-extensions","sec-websocket-protocol"]),xI=(e,t)=>{t&&t.forEach((r,i)=>{rre.has(i.toLowerCase())||e.push(`${i}: ${r}`)})},aI=(e,t,r)=>{let i=["Connection: close","Content-Length: 0"];xI(i,r),e.end(`HTTP/1.1 ${t.toString()} ${oI.STATUS_CODES[t]??""}\r
132
132
  ${i.join(`\r
133
133
  `)}\r
134
134
  \r
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sample-aws-pricing-calculator-mcp",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "bin": "dist/mcp-server.js",
5
5
  "files": [
6
6
  "dist/mcp-server.js",