UNPKG

@azure/functions

Version:
2 lines 67.3 kB
(()=>{"use strict";var e={8157(e,t,r){var n,o,i,s=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.InvocationContext=void 0;const c=r(5396);t.InvocationContext=class{constructor(e){var t,r,o,i;n.set(this,void 0),e=e||{};const a="unknown";this.invocationId=e.invocationId||a,this.functionName=e.functionName||a,this.extraInputs=new u,this.extraOutputs=new p,this.retryContext=e.retryContext,this.traceContext=e.traceContext,this.triggerMetadata=e.triggerMetadata,this.options={trigger:(null===(t=e.options)||void 0===t?void 0:t.trigger)||{name:a,type:a},return:null===(r=e.options)||void 0===r?void 0:r.return,extraInputs:(null===(o=e.options)||void 0===o?void 0:o.extraInputs)||[],extraOutputs:(null===(i=e.options)||void 0===i?void 0:i.extraOutputs)||[]},s(this,n,e.logHandler||c.fallbackLogHandler,"f")}log(...e){a(this,n,"f").call(this,"information",...e)}trace(...e){a(this,n,"f").call(this,"trace",...e)}debug(...e){a(this,n,"f").call(this,"debug",...e)}info(...e){a(this,n,"f").call(this,"information",...e)}warn(...e){a(this,n,"f").call(this,"warning",...e)}error(...e){a(this,n,"f").call(this,"error",...e)}},n=new WeakMap;class u{constructor(){o.set(this,{})}get(e){const t="string"==typeof e?e:e.name;return a(this,o,"f")[t]}set(e,t){const r="string"==typeof e?e:e.name;a(this,o,"f")[r]=t}}o=new WeakMap;class p{constructor(){i.set(this,{})}get(e){const t="string"==typeof e?e:e.name;return a(this,i,"f")[t]}set(e,t){const r="string"==typeof e?e:e.name;a(this,i,"f")[r]=t}}i=new WeakMap},6691(e,t,r){var n,o,i,s,a,c,u,p,l,f,d,y=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})},g=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},h=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.InvocationModel=void 0;const m=r(8354),v=r(6921),b=r(5521),w=r(1776),P=r(4714),T=r(679),C=r(917),O=r(2288),x=r(5064),S=r(4454),j=r(725),M=r(2337),k=r(7992),R=r(8157),E=r(9572),N=r(337),_=r(9898),A=r(9168);t.InvocationModel=class{constructor(e){n.add(this),o.set(this,!1),i.set(this,void 0),s.set(this,void 0),a.set(this,void 0),c.set(this,void 0),g(this,i,e,"f"),g(this,s,(0,A.nonNullProp)(e.metadata,"name"),"f"),g(this,a,(0,A.nonNullProp)(e.metadata,"bindings"),"f");const t=(0,A.nonNullValue)(Object.values(h(this,a,"f")).find(e=>(0,_.isTrigger)(e.type)),"triggerBinding");g(this,c,(0,A.nonNullProp)(t,"type"),"f")}getArguments(){return y(this,void 0,void 0,function*(){const e=h(this,i,"f").request,t=new R.InvocationContext({invocationId:(0,A.nonNullProp)(h(this,i,"f"),"invocationId"),functionName:h(this,s,"f"),logHandler:(e,...t)=>h(this,n,"m",d).call(this,e,...t),retryContext:(0,w.fromRpcRetryContext)(e.retryContext),traceContext:(0,w.fromRpcTraceContext)(e.traceContext),triggerMetadata:(0,P.fromRpcTriggerMetadata)(e.triggerMetadata,h(this,c,"f")),options:(0,b.fromRpcBindings)(h(this,a,"f"))}),r=[];if(e.inputData)for(const n of e.inputData){const o=(0,A.nonNullProp)(n,"name"),s=h(this,a,"f")[o];if(!s)throw new j.AzFuncSystemError(`Failed to find binding "${o}" in bindings "${Object.keys(h(this,a,"f")).join(", ")}".`);const c=s.type;let u;if((0,_.isHttpTrigger)(c)&&N.enableHttpStream){const t=yield(0,M.waitForProxyRequest)(h(this,i,"f").invocationId);u=(0,k.createStreamRequest)(t,(0,A.nonNullProp)(e,"triggerMetadata"))}else u=(0,T.fromRpcTypedData)(n.data);(0,_.isTimerTrigger)(c)&&(u=(0,C.toCamelCaseValue)(u)),(0,_.isMcpPromptTrigger)(c)&&(u=new E.PromptInvocationContext(u)),(0,_.isTrigger)(c)?r.push(u):t.extraInputs.set(o,u)}return{context:t,inputs:r}})}invokeFunction(e,t,r){return y(this,void 0,void 0,function*(){try{return yield Promise.resolve(r(...t,e))}finally{g(this,o,!0,"f")}})}getResponse(e,t){return y(this,void 0,void 0,function*(){const r={invocationId:h(this,i,"f").invocationId,outputData:[]};let o=!1;for(const[i,s]of Object.entries(h(this,a,"f")))if("out"===s.direction)if(i===v.returnBindingKey)r.returnValue=(0,_.isMcpToolTrigger)(h(this,c,"f"))?h(this,n,"m",p).call(this,e,t):yield h(this,n,"m",u).call(this,e.invocationId,s,t),o=!0;else{const t=yield h(this,n,"m",u).call(this,e.invocationId,s,e.extraOutputs.get(i));(0,A.isDefined)(t)&&r.outputData.push({name:i,data:t})}return o||(0,_.isHttpTrigger)(h(this,c,"f"))||(r.returnValue=h(this,n,"m",p).call(this,e,t)),r})}},o=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,c=new WeakMap,n=new WeakSet,u=function(e,t,r){var n;return y(this,void 0,void 0,function*(){return"http"===(null===(n=t.type)||void 0===n?void 0:n.toLowerCase())?(0,x.toRpcHttp)(e,r):(0,S.toRpcTypedData)(r)})},p=function(e,t){if(!(0,_.isMcpToolTrigger)(h(this,c,"f")))return(0,S.toRpcTypedData)(t);const r=(0,O.toMcpToolResult)(t,e);return null==r?r:{string:"string"==typeof r?r:JSON.stringify(r)}},l=function(e,t,...r){h(this,i,"f").log(e,t,(0,m.format)(...r))},f=function(e,...t){h(this,n,"m",l).call(this,e,"system",...t)},d=function(e,...t){if(h(this,o,"f")&&"postInvocationHooks"!==h(this,i,"f").state){let e="Warning: Unexpected call to 'log' on the context object after function execution has completed. Please check for asynchronous calls that are not awaited. ";e+=`Function name: ${h(this,s,"f")}. Invocation Id: ${h(this,i,"f").invocationId}.`,h(this,n,"m",f).call(this,"warning",e)}h(this,n,"m",l).call(this,e,"user",...t)}},520(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ProgrammingModel=void 0;const o=r(6921),i=r(2337),s=r(6691),a=r(337);t.ProgrammingModel=class{constructor(){this.name="@azure/functions",this.version=o.version}getInvocationModel(e){return new s.InvocationModel(e)}getCapabilities(e){return n(this,void 0,void 0,function*(){if((0,a.lockSetup)(),a.enableHttpStream){const t=yield(0,i.setupHttpProxy)();e.HttpUri=t}return Object.assign(e,a.capabilities),e})}}},6693(e,t,r){t.addBindingName=void 0;const n=r(4169);t.addBindingName=function(e,t){if(!e.name){let r=e.type;r.toLowerCase().endsWith(t.toLowerCase())||(r+=t),e.name=r+(0,n.getStringHash)(JSON.stringify(e))}return e}},1859(e,t,r){var n=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.generic=t.mcpPrompt=t.mcpResource=t.mcpTool=t.webPubSub=t.mySql=t.sql=t.warmup=t.cosmosDB=t.connectorTrigger=t.eventGrid=t.eventHub=t.serviceBusTopic=t.serviceBusQueue=t.storageQueue=t.storageBlob=t.timer=t.http=t.deleteRequest=t.patch=t.post=t.put=t.get=t.setup=t.hook=void 0;const o=r(2757),i=r(811),s=r(520),a=r(2888),c=r(3476);t.hook=r(6765);var u=r(337);Object.defineProperty(t,"setup",{enumerable:!0,get:function(){return u.setup}});let p=!1;function l(e,t){const r="function"==typeof e?{handler:e}:e;return r.methods=[t],r}function f(e,t){const{handler:r,return:o,trigger:i,extraInputs:s,extraOutputs:a,retry:c}=e,u=n(e,["handler","return","trigger","extraInputs","extraOutputs","retry"]);return{trigger:null!=i?i:t(u),return:o,retry:c,extraInputs:s,extraOutputs:a,handler:r}}function d(e,t){t.return||(t.return=i.http({})),y(e,f(t,a.http))}function y(e,t){p||function(){const e=(0,c.tryGetCoreApiLazy)();e?e.setProgrammingModel(new s.ProgrammingModel):console.warn('WARNING: Failed to detect the Azure Functions runtime. Switching "@azure/functions" package to test mode - not all features are supported.'),p=!0}();const r=(0,c.tryGetCoreApiLazy)();r?r.registerFunction((0,o.toCoreFunctionMetadata)(e,t),t.handler):console.warn(`WARNING: Skipping call to register function "${e}" because the "@azure/functions" package is in test mode.`)}t.get=function(e,t){d(e,l(t,"GET"))},t.put=function(e,t){d(e,l(t,"PUT"))},t.post=function(e,t){d(e,l(t,"POST"))},t.patch=function(e,t){d(e,l(t,"PATCH"))},t.deleteRequest=function(e,t){d(e,l(t,"DELETE"))},t.http=d,t.timer=function(e,t){y(e,f(t,a.timer))},t.storageBlob=function(e,t){y(e,f(t,a.storageBlob))},t.storageQueue=function(e,t){y(e,f(t,a.storageQueue))},t.serviceBusQueue=function(e,t){y(e,f(t,a.serviceBusQueue))},t.serviceBusTopic=function(e,t){y(e,f(t,a.serviceBusTopic))},t.eventHub=function(e,t){y(e,f(t,a.eventHub))},t.eventGrid=function(e,t){y(e,f(t,a.eventGrid))},t.connectorTrigger=function(e,t){y(e,f(t,a.connectorTrigger))},t.cosmosDB=function(e,t){y(e,f(t,a.cosmosDB))},t.warmup=function(e,t){y(e,f(t,a.warmup))},t.sql=function(e,t){y(e,f(t,a.sql))},t.mySql=function(e,t){y(e,f(t,a.mySql))},t.webPubSub=function(e,t){y(e,f(t,a.webPubSub))},t.mcpTool=function(e,t){y(e,f(t,a.mcpTool))},t.mcpResource=function(e,t){y(e,f(t,a.mcpResource))},t.mcpPrompt=function(e,t){y(e,f(t,a.mcpPrompt))},t.generic=y},6921(e,t){t.returnBindingKey=t.version=void 0,t.version="4.16.5",t.returnBindingKey="$return"},5521(e,t,r){t.fromRpcBindings=void 0;const n=r(6921),o=r(9898),i=r(9168);function s(e,t){return Object.assign(Object.assign({},t),{type:(0,i.nonNullProp)(t,"type"),name:e})}t.fromRpcBindings=function(e){let t,r;const a=[],c=[];for(const[u,p]of Object.entries((0,i.nonNullValue)(e,"bindings")))(0,o.isTrigger)(p.type)?t=s(u,p):u===n.returnBindingKey?r=s(u,p):"in"===p.direction?a.push(s(u,p)):"out"===p.direction&&c.push(s(u,p));return{trigger:(0,i.nonNullValue)(t,"trigger"),return:r,extraInputs:a,extraOutputs:c}}},1776(e,t,r){t.fromRpcTraceContext=t.fromRpcRetryContext=void 0;const n=r(9168);t.fromRpcRetryContext=function(e){if(e){const t={retryCount:(0,n.nonNullProp)(e,"retryCount"),maxRetryCount:(0,n.nonNullProp)(e,"maxRetryCount")};return e.exception&&(t.exception=function(e){const t={};return(0,n.copyPropIfDefined)(e,t,"message"),(0,n.copyPropIfDefined)(e,t,"source"),(0,n.copyPropIfDefined)(e,t,"stackTrace"),t}(e.exception)),t}},t.fromRpcTraceContext=function(e){if(e){const t={};return(0,n.copyPropIfDefined)(e,t,"traceParent"),(0,n.copyPropIfDefined)(e,t,"traceState"),e.attributes&&(t.attributes=e.attributes),t}}},5138(e,t){t.fromNullableMapping=void 0,t.fromNullableMapping=function(e,t){var r;let n={};if(e&&Object.keys(e).length>0)for(const t in e)n[t]=(null===(r=e[t])||void 0===r?void 0:r.value)||"";else t&&Object.keys(t).length>0&&(n=t);return n}},4714(e,t,r){t.fromRpcTriggerMetadata=void 0;const n=r(9898),o=r(679),i=r(917);t.fromRpcTriggerMetadata=function(e,t){if(e&&!(0,n.isHttpTrigger)(t)&&!(0,n.isTimerTrigger)(t)){const t={};for(const[r,n]of Object.entries(e))t[(0,i.toCamelCaseKey)(r)]=(0,i.toCamelCaseValue)((0,o.fromRpcTypedData)(n));return t}}},679(e,t,r){t.fromRpcTypedData=void 0;const n=r(6490),o=r(7992),i=r(9168);function s(e){try{return JSON.parse(e)}catch(t){return e}}t.fromRpcTypedData=function(e){var t;if(e){if((0,i.isDefined)(e.string))return s(e.string);if((0,i.isDefined)(e.json))return JSON.parse(e.json);if((0,i.isDefined)(e.bytes))return Buffer.from(e.bytes);if((0,i.isDefined)(e.stream))return Buffer.from(e.stream);if((0,i.isDefined)(e.http))return new o.HttpRequest(e.http);if((0,i.isDefined)(e.int))return e.int;if((0,i.isDefined)(e.double))return e.double;if(e.collectionBytes&&(0,i.isDefined)(e.collectionBytes.bytes))return e.collectionBytes.bytes.map(e=>Buffer.from(e));if(e.collectionString&&(0,i.isDefined)(e.collectionString.string))return e.collectionString.string.map(s);if(e.collectionDouble&&(0,i.isDefined)(e.collectionDouble.double))return e.collectionDouble.double;if(e.collectionSint64&&(0,i.isDefined)(e.collectionSint64.sint64))return e.collectionSint64.sint64;if(e.modelBindingData&&(0,i.isDefined)(e.modelBindingData.content))try{return n.ResourceFactoryResolver.getInstance().createClient(e.modelBindingData.source,e.modelBindingData)}catch(e){throw new Error(`Unable to create client. Please register the extensions library with your function app. Error: ${e instanceof Error?e.message:String(e)}`)}else if(e.collectionModelBindingData&&(0,i.isDefined)(e.collectionModelBindingData.modelBindingData)&&e.collectionModelBindingData.modelBindingData.length>0)try{return n.ResourceFactoryResolver.getInstance().createClient(null===(t=e.collectionModelBindingData.modelBindingData[0])||void 0===t?void 0:t.source,e.collectionModelBindingData.modelBindingData)}catch(e){throw new Error(`Unable to create client. Please register the extensions library with your function app. Error: ${e instanceof Error?e.message:String(e)}`)}}}},917(e,t){function r(e){return e.charAt(0).toLowerCase()+e.slice(1)}t.toCamelCaseKey=t.toCamelCaseValue=void 0,t.toCamelCaseValue=function e(t){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return t.map(e);{const n={};for(const[o,i]of Object.entries(t))n[r(o)]=e(i);return n}},t.toCamelCaseKey=r},2757(e,t,r){t.toCoreFunctionMetadata=void 0;const n=r(6921),o=r(725),i=r(9898),s=r(4893),a=r(8360);function c(e,t,r,n,o){if(void 0!==e&&!0===e){const e={operation:"EnableDeferredBinding",properties:{functionName:t||"unknown",entityType:o?"binding":"trigger",triggerType:r||"unknown",bindingOrTriggerName:n||"unknown",supportsDeferredBinding:!0},message:`Enabled Deferred Binding of type '${r||"unknown"}' for function '${t||"unknown"}'`};return(0,s.workerSystemLog)("information",JSON.stringify(e)),{supportsDeferredBinding:"true"}}return{supportsDeferredBinding:"false"}}t.toCoreFunctionMetadata=function(e,t){var r;const s={},u=[],p=t.trigger;if(s[p.name]=Object.assign(Object.assign({},p),{direction:"in",type:(0,i.isTrigger)(p.type)?p.type:p.type+"Trigger",properties:c(null===(r=t.trigger)||void 0===r?void 0:r.sdkBinding,e,p.type,p.name,!1)}),u.push(p.name),t.extraInputs)for(const r of t.extraInputs)s[r.name]=Object.assign(Object.assign({},r),{direction:"in",properties:c(null==r?void 0:r.sdkBinding,e,r.type,r.name,!0)}),u.push(r.name);if(t.return&&(s[n.returnBindingKey]=Object.assign(Object.assign({},t.return),{direction:"out"}),u.push(n.returnBindingKey)),t.extraOutputs)for(const e of t.extraOutputs)s[e.name]=Object.assign(Object.assign({},e),{direction:"out"}),u.push(e.name);if(u.filter((e,t)=>u.indexOf(e)!==t).length>0)throw new o.AzFuncSystemError(`Duplicate bindings found for function "${e}". Remove a duplicate binding or manually specify the "name" property to make it unique.`);let l;return t.retry&&(l=Object.assign(Object.assign({},t.retry),{retryStrategy:t.retry.strategy,delayInterval:(0,a.toRpcDuration)(t.retry.delayInterval,"retry.delayInterval"),maximumInterval:(0,a.toRpcDuration)(t.retry.maximumInterval,"retry.maximumInterval"),minimumInterval:(0,a.toRpcDuration)(t.retry.minimumInterval,"retry.minimumInterval")})),{name:e,bindings:s,retryOptions:l}}},5111(e,t,r){t.convertToMcpPromptTriggerOptionsToRpc=void 0;const n=r(9855);t.convertToMcpPromptTriggerOptionsToRpc=function(e){if(!e.promptName||"string"!=typeof e.promptName||""===e.promptName.trim())throw new Error('MCP Prompt trigger requires a valid "promptName" property.');const t=function(e){if(!e)return"[]";const t=Array.isArray(e)?e:Object.entries(e).map(([e,t])=>{if(!(t instanceof n.McpPromptArgumentBuilder))throw new Error('MCP Prompt trigger "promptArguments" record values must be created with `promptArg.describe(...)`.');return t.toPromptArgument(e)});if(0===t.length)return"[]";const r=t.map(e=>{var t;if(!e.name||"string"!=typeof e.name||""===e.name.trim())throw new Error('MCP Prompt trigger "promptArguments" entries require a non-empty "name".');return{name:e.name,description:null!==(t=e.description)&&void 0!==t?t:null,required:!0===e.required}});return JSON.stringify(r)}(e.promptArguments),r={promptName:e.promptName,promptArguments:t};if(void 0!==e.title&&(r.title=e.title),void 0!==e.description&&(r.description=e.description),void 0!==e.metadata&&"string"==typeof e.metadata&&""!==e.metadata.trim()){try{JSON.parse(e.metadata)}catch(e){throw new Error('MCP Prompt trigger "metadata" must be a valid JSON string.')}r.metadata=e.metadata}if(void 0!==e.icons&&"string"==typeof e.icons&&""!==e.icons.trim()){try{JSON.parse(e.icons)}catch(e){throw new Error('MCP Prompt trigger "icons" must be a valid JSON string.')}r.icons=e.icons}return r}},8329(e,t){t.convertToMcpResourceTriggerOptionsToRpc=void 0,t.convertToMcpResourceTriggerOptionsToRpc=function(e){if(!e.uri||"string"!=typeof e.uri||""===e.uri.trim())throw new Error('MCP Resource trigger requires a valid "uri" property.');if(!e.resourceName||"string"!=typeof e.resourceName||""===e.resourceName.trim())throw new Error('MCP Resource trigger requires a valid "resourceName" property.');const t={uri:e.uri,resourceName:e.resourceName};if(void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),void 0!==e.mimeType&&(t.mimeType=e.mimeType),void 0!==e.size){if("number"!=typeof e.size||e.size<0)throw new Error('MCP Resource trigger "size" must be a non-negative number.');t.size=e.size}if(void 0!==e.metadata&&"string"==typeof e.metadata&&""!==e.metadata.trim()){try{JSON.parse(e.metadata)}catch(e){throw new Error('MCP Resource trigger "metadata" must be a valid JSON string.')}t.metadata=e.metadata}return t}},2288(e,t,r){t.toMcpToolResult=void 0;const n=r(8642),o=r(5665),i=r(6199),s="text";function a(e){const t=function(e){if(null===e.structuredContent||void 0===e.structuredContent)return e.content;if(e.content.some(e=>e instanceof n.McpTextContent))return e.content;const t="string"==typeof e.structuredContent?e.structuredContent:JSON.stringify(e.structuredContent);return[...e.content,new n.McpTextContent(t)]}(e);let r,o;if(1===t.length){const[e]=t;r=e.type,o=JSON.stringify(e)}else r="multi_content_result",o=JSON.stringify(t);const i={type:r,content:o};return void 0!==e.structuredContent&&null!==e.structuredContent&&(i.structuredContent="string"==typeof e.structuredContent?e.structuredContent:JSON.stringify(e.structuredContent)),i}t.toMcpToolResult=function(e,t){if(null==e)return e;if(e instanceof n.McpToolResponse)return a(e);if(e instanceof n.McpContentBlock)return a(new n.McpToolResponse({content:[e]}));if(Array.isArray(e)&&e.length>0&&e.every(e=>e instanceof n.McpContentBlock))return a(new n.McpToolResponse({content:e}));(0,o.warnIfLooksLikeMcpSdkValue)(e,t);const r="string"==typeof e?e:JSON.stringify(e),c={type:s,content:JSON.stringify({type:s,text:r})};return(0,i.shouldCreateStructuredContentMarker)(e)&&(c.structuredContent=JSON.stringify(e)),c}},5571(e,t,r){t.converToMcpToolTriggerOptionsToRpc=void 0;const n=r(7175);t.converToMcpToolTriggerOptionsToRpc=function(e){let t,r;if(void 0!==e.metadata&&"string"==typeof e.metadata&&""!==e.metadata.trim())try{JSON.parse(e.metadata),t=e.metadata}catch(e){throw new Error('MCP Tool trigger "metadata" must be a valid JSON string.')}if(void 0!==e.resultSchema&&"string"==typeof e.resultSchema&&""!==e.resultSchema.trim())try{JSON.parse(e.resultSchema),r=e.resultSchema}catch(e){throw new Error('MCP Tool trigger "resultSchema" must be a valid JSON string.')}const o=Object.assign(Object.assign({toolName:e.toolName,description:e.description,useResultSchema:!0},void 0!==t&&{metadata:t}),void 0!==r&&{resultSchema:r});let i;try{i=(0,n.normalizeToolProperties)(e.toolProperties)}catch(e){if(e instanceof Error&&(e.message.includes("Property type is required")||e.message.includes("Property type must be specified")))throw e;i=void 0}if(void 0!==i)return Object.assign(Object.assign({},o),{toolProperties:JSON.stringify(i)});throw new Error(`Invalid toolProperties for tool '${e.toolName}': Expected an array of McpToolProperty or ToolProps objects or ToolProps need a type defined.`)}},8360(e,t,r){t.toRpcDuration=void 0;const n=r(725),o=r(9168);t.toRpcDuration=function(e,t){if((0,o.isDefined)(e)){try{let t;if("object"==typeof e){const r=(e.minutes||0)+60*(e.hours||0),n=(e.seconds||0)+60*r;t=(e.milliseconds||0)+1e3*n}else"number"==typeof e&&(t=e);if((0,o.isDefined)(t)&&t>=0)return{seconds:Math.round(t/1e3)}}catch(e){}throw new n.AzFuncSystemError(`A 'number' or 'Duration' object was expected instead of a '${typeof e}'. Cannot parse value of '${t}'.`)}}},5064(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.toRpcHttp=void 0;const o=r(725),i=r(2337),s=r(8950),a=r(337),c=r(7866),u=r(4454);t.toRpcHttp=function(e,t){return n(this,void 0,void 0,function*(){if(null==t)return t;if("object"!=typeof t)throw new o.AzFuncSystemError('The HTTP response must be an object with optional properties "body", "status", "headers", and "cookies".');const r=t instanceof s.HttpResponse?t:new s.HttpResponse(t);if(a.enableHttpStream)return void(yield(0,i.sendProxyResponse)(e,r));const n={};n.statusCode=r.status.toString(),n.headers={};for(const[e,t]of r.headers.entries())n.headers[e]=t;n.cookies=[];for(const e of r.cookies)n.cookies.push((0,c.toRpcHttpCookie)(e));n.enableContentNegotiation=r.enableContentNegotiation;const p=yield r.arrayBuffer();return n.body=(0,u.toRpcTypedData)(p),{http:n}})}},7866(e,t,r){t.toRpcHttpCookie=void 0;const n=r(1705);t.toRpcHttpCookie=function(e){let t="none";if(e&&e.sameSite){const r=e.sameSite.toLocaleLowerCase();"lax"===r?t="lax":"strict"===r?t="strict":"none"===r&&(t="explicitNone")}return{name:e&&(0,n.toRpcString)(e.name,"cookie.name"),value:e&&(0,n.toRpcString)(e.value,"cookie.value"),domain:(0,n.toNullableString)(e&&e.domain,"cookie.domain"),path:(0,n.toNullableString)(e&&e.path,"cookie.path"),expires:(0,n.toNullableTimestamp)(e&&e.expires,"cookie.expires"),secure:(0,n.toNullableBool)(e&&e.secure,"cookie.secure"),httpOnly:(0,n.toNullableBool)(e&&e.httpOnly,"cookie.httpOnly"),sameSite:t,maxAge:(0,n.toNullableDouble)(e&&e.maxAge,"cookie.maxAge")}}},1705(e,t,r){t.toNullableTimestamp=t.toNullableString=t.toRpcString=t.toNullableDouble=t.toNullableBool=void 0;const n=r(725),o=r(9168);t.toNullableBool=function(e,t){if("boolean"==typeof e)return{value:e};if((0,o.isDefined)(e))throw new n.AzFuncSystemError(`A 'boolean' type was expected instead of a '${typeof e}' type. Cannot parse value of '${t}'.`)},t.toNullableDouble=function(e,t){if("number"==typeof e)return{value:e};if("string"==typeof e&&!isNaN(Number(e)))return{value:parseFloat(e)};if((0,o.isDefined)(e))throw new n.AzFuncSystemError(`A 'number' type was expected instead of a '${typeof e}' type. Cannot parse value of '${t}'.`)},t.toRpcString=function(e,t){if("string"==typeof e)return e;if((0,o.isDefined)(e))throw new n.AzFuncSystemError(`A 'string' type was expected instead of a '${typeof e}' type. Cannot parse value of '${t}'.`);return""},t.toNullableString=function(e,t){if("string"==typeof e)return{value:e};if((0,o.isDefined)(e))throw new n.AzFuncSystemError(`A 'string' type was expected instead of a '${typeof e}' type. Cannot parse value of '${t}'.`)},t.toNullableTimestamp=function(e,t){if((0,o.isDefined)(e))try{const t="number"==typeof e?e:e.getTime();if(t&&t>=0)return{value:{seconds:Math.round(t/1e3)}}}catch(r){throw new n.AzFuncSystemError(`A 'number' or 'Date' input was expected instead of a '${typeof e}'. Cannot parse value of '${t}'.`)}}},4454(e,t){t.toRpcTypedData=void 0,t.toRpcTypedData=function(e){return null==e?e:"string"==typeof e?{string:e}:Buffer.isBuffer(e)?{bytes:e}:ArrayBuffer.isView(e)?{bytes:new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}:e instanceof ArrayBuffer?{bytes:new Uint8Array(e)}:"number"==typeof e?Number.isInteger(e)?{int:e}:{double:e}:{json:JSON.stringify(e)}}},725(e,t,r){t.ensureErrorType=t.ReadOnlyError=t.AzFuncSystemError=void 0;const n=r(5230);class o extends Error{constructor(){super(...arguments),this.isAzureFunctionsSystemError=!0}}t.AzFuncSystemError=o;class i extends TypeError{constructor(){super(...arguments),this.isAzureFunctionsSystemError=!0}}RangeError;t.ReadOnlyError=class extends i{constructor(e){super(`Cannot assign to read only property '${e}'`)}},t.ensureErrorType=function(e){if(e instanceof Error)return e;{let t;return t=null==e?"Unknown error":"string"==typeof e?(0,n.sanitizeErrorString)(e):"object"==typeof e?(0,n.stringifySanitizedErrorObject)(e):(0,n.sanitizeErrorString)(String(e)),new Error(t)}}},7531(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AppStartContext=void 0;const n=r(5789);class o extends n.HookContext{}t.AppStartContext=o},4586(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AppTerminateContext=void 0;const n=r(5789);class o extends n.HookContext{}t.AppTerminateContext=o},5789(e,t,r){var n,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.HookContext=void 0;const s=r(725),a=r(9168);t.HookContext=class{constructor(e){var t,r;n.set(this,void 0),o(this,n,null!=e?e:{},"f"),null!==(t=(r=i(this,n,"f")).hookData)&&void 0!==t||(r.hookData={})}get hookData(){return(0,a.nonNullProp)(i(this,n,"f"),"hookData")}set hookData(e){throw new s.ReadOnlyError("hookData")}},n=new WeakMap},9463(e,t,r){var n,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.InvocationHookContext=void 0;const s=r(725),a=r(8157),c=r(9168),u=r(5789);class p extends u.HookContext{constructor(e){var t,r,s,c;super(e),n.set(this,void 0),o(this,n,null!=e?e:{},"f"),null!==(t=(s=i(this,n,"f")).inputs)&&void 0!==t||(s.inputs=[]),null!==(r=(c=i(this,n,"f")).invocationContext)&&void 0!==r||(c.invocationContext=new a.InvocationContext)}get invocationContext(){return(0,c.nonNullProp)(i(this,n,"f"),"invocationContext")}set invocationContext(e){throw new s.ReadOnlyError("invocationContext")}get inputs(){return(0,c.nonNullProp)(i(this,n,"f"),"inputs")}set inputs(e){i(this,n,"f").inputs=e}}t.InvocationHookContext=p,n=new WeakMap},5407(e,t,r){var n,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.LogHookContext=void 0;const s=r(725),a=r(9168),c=r(5789);class u extends c.HookContext{constructor(e){var t,r,s,a,c,u;super(e),n.set(this,void 0),o(this,n,null!=e?e:{},"f"),null!==(t=(a=i(this,n,"f")).level)&&void 0!==t||(a.level="information"),null!==(r=(c=i(this,n,"f")).message)&&void 0!==r||(c.message="unknown"),null!==(s=(u=i(this,n,"f")).category)&&void 0!==s||(u.category="user")}get level(){return(0,a.nonNullProp)(i(this,n,"f"),"level")}set level(e){i(this,n,"f").level=e}get message(){return(0,a.nonNullProp)(i(this,n,"f"),"message")}set message(e){i(this,n,"f").message=e}get category(){return(0,a.nonNullProp)(i(this,n,"f"),"category")}set category(e){throw new s.ReadOnlyError("category")}get invocationContext(){return i(this,n,"f").invocationContext}set invocationContext(e){throw new s.ReadOnlyError("invocationContext")}}t.LogHookContext=u,n=new WeakMap},7508(e,t,r){var n,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.PostInvocationContext=void 0;const s=r(9463);class a extends s.InvocationHookContext{constructor(e){super(e),n.set(this,void 0),o(this,n,null!=e?e:{},"f")}get result(){return i(this,n,"f").result}set result(e){i(this,n,"f").result=e}get error(){return i(this,n,"f").error}set error(e){i(this,n,"f").error=e}}t.PostInvocationContext=a,n=new WeakMap},8561(e,t,r){var n,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.PreInvocationContext=void 0;const s=r(9168),a=r(9463);class c extends a.InvocationHookContext{constructor(e){var t,r;super(e),n.set(this,void 0),o(this,n,null!=e?e:{},"f"),null!==(t=(r=i(this,n,"f")).functionCallback)&&void 0!==t||(r.functionCallback=()=>{})}get functionHandler(){return(0,s.nonNullProp)(i(this,n,"f"),"functionCallback")}set functionHandler(e){i(this,n,"f").functionCallback=e}}t.PreInvocationContext=c,n=new WeakMap},6765(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.log=t.postInvocation=t.preInvocation=t.appTerminate=t.appStart=void 0;const n=r(725),o=r(1898),i=r(3476),s=r(7531),a=r(4586),c=r(5407),u=r(7508),p=r(8561);function l(e,t){const r=(0,i.tryGetCoreApiLazy)();return r?r.registerHook(e,t):(console.warn(`WARNING: Skipping call to register ${e} hook because the "@azure/functions" package is in test mode.`),new o.Disposable(()=>{console.warn(`WARNING: Skipping call to dispose ${e} hook because the "@azure/functions" package is in test mode.`)}))}t.appStart=function(e){return l("appStart",t=>e(new s.AppStartContext(t)))},t.appTerminate=function(e){return l("appTerminate",t=>e(new a.AppTerminateContext(t)))},t.preInvocation=function(e){return l("preInvocation",t=>e(new p.PreInvocationContext(t)))},t.postInvocation=function(e){return l("postInvocation",t=>e(new u.PostInvocationContext(t)))},t.log=function(e){try{return l("log",t=>e(new c.LogHookContext(t)))}catch(e){const t=(0,n.ensureErrorType)(e);throw"RangeError"===t.name&&t.isAzureFunctionsSystemError?new n.AzFuncSystemError("Log hooks require Azure Functions Host v4.34 or higher."):e}}},7992(e,t,r){var n,o,i,s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},c=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},u=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamRequest=t.HttpRequest=void 0;const p=r(9551),l=r(5138),f=r(679),d=r(725),y=r(9168),g=r(4893),h=r(8529);class m{constructor(e){var t,r,s,u,f,d;n.set(this,void 0),o.set(this,void 0),i.set(this,void 0),a(this,i,e,"f");let h=e.nativeRequest;if(!h){const n=(0,y.nonNullProp)(e,"url"),o=(0,y.nonNullProp)(e,"method");let i;const a=o.toLowerCase();"get"!==a&&"head"!==a?(null===(t=e.body)||void 0===t?void 0:t.bytes)?i=Buffer.from(null===(r=e.body)||void 0===r?void 0:r.bytes):(null===(s=e.body)||void 0===s?void 0:s.string)&&(i=e.body.string):((null===(f=null===(u=e.body)||void 0===u?void 0:u.bytes)||void 0===f?void 0:f.length)||(null===(d=e.body)||void 0===d?void 0:d.string))&&(0,g.workerSystemLog)("warning",`Discarding the body of the incoming ${o} request because GET and HEAD requests cannot have a body.`),h=new Request(n,{body:i,method:o,headers:(0,l.fromNullableMapping)(e.nullableHeaders,e.headers)})}a(this,o,h,"f"),e.nullableQuery||e.query?this.query=new p.URLSearchParams((0,l.fromNullableMapping)(e.nullableQuery,e.query)):this.query=new URL(c(this,o,"f").url).searchParams,this.params=(0,l.fromNullableMapping)(e.nullableParams,e.params)}get url(){return c(this,o,"f").url}get method(){return c(this,o,"f").method}get headers(){return c(this,o,"f").headers}get user(){return void 0===c(this,n,"f")&&a(this,n,(0,h.extractHttpUserFromHeaders)(this.headers),"f"),c(this,n,"f")}get body(){return c(this,o,"f").body}get bodyUsed(){return c(this,o,"f").bodyUsed}arrayBuffer(){return s(this,void 0,void 0,function*(){return c(this,o,"f").arrayBuffer()})}blob(){return s(this,void 0,void 0,function*(){return c(this,o,"f").blob()})}formData(){return s(this,void 0,void 0,function*(){return c(this,o,"f").formData()})}json(){return s(this,void 0,void 0,function*(){return c(this,o,"f").json()})}text(){return s(this,void 0,void 0,function*(){return c(this,o,"f").text()})}clone(){const e=c(this,i,"f"),{nativeRequest:t}=e,r=u(e,["nativeRequest"]),n=structuredClone(r);return n.nativeRequest=c(this,o,"f").clone(),new m(n)}}t.HttpRequest=m,n=new WeakMap,o=new WeakMap,i=new WeakMap,t.createStreamRequest=function(e,t){var r;const n="x-forwarded-host",o="x-forwarded-proto",i=e.headers[n],s=e.headers[o];if("string"!=typeof i||"string"!=typeof s)throw new d.AzFuncSystemError(`Expected headers "${n}" and "${o}" to be set.`);const a=`${s}://${i}${(0,y.nonNullProp)(e,"url")}`;let c;const p=null===(r=e.method)||void 0===r?void 0:r.toLowerCase();"get"!==p&&"head"!==p&&(c=e);const{Query:l,Headers:g}=t,h=u(t,["Query","Headers"]);let v;const b=(0,f.fromRpcTypedData)(g);"object"==typeof b&&(0,y.isDefined)(b)&&(v=b);const w=new Request(a,{body:c,duplex:"half",method:(0,y.nonNullProp)(e,"method"),headers:v}),P={};for(const[e,t]of Object.entries(h))(0,y.isDefined)(t.string)&&(P[e]=t.string);return new m({nativeRequest:w,params:P})}},8950(e,t,r){var n,o,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})},s=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpResponse=void 0;const c=r(9168),u=new Set([204,205,304]);class p{constructor(e){var t;if(n.set(this,void 0),o.set(this,void 0),null!=e||(e={}),s(this,o,e,"f"),e.nativeResponse)s(this,n,e.nativeResponse,"f");else{const t={status:e.status,headers:e.headers},r=(0,c.isDefined)(e.status)&&u.has(e.status);if((0,c.isDefined)(e.jsonBody)&&!r){const r=JSON.stringify(e.jsonBody),o=new Headers(t.headers);o.has("content-type")||o.set("content-type","application/json"),s(this,n,new Response(r,Object.assign(Object.assign({},t),{headers:o})),"f")}else s(this,n,new Response(r?void 0:e.body,t),"f")}this.cookies=null!==(t=e.cookies)&&void 0!==t?t:[],this.enableContentNegotiation=!!e.enableContentNegotiation}get status(){return a(this,n,"f").status}get headers(){return a(this,n,"f").headers}get body(){return a(this,n,"f").body}get bodyUsed(){return a(this,n,"f").bodyUsed}arrayBuffer(){return i(this,void 0,void 0,function*(){return a(this,n,"f").arrayBuffer()})}blob(){return i(this,void 0,void 0,function*(){return a(this,n,"f").blob()})}formData(){return i(this,void 0,void 0,function*(){return a(this,n,"f").formData()})}json(){return i(this,void 0,void 0,function*(){return a(this,n,"f").json()})}text(){return i(this,void 0,void 0,function*(){return a(this,n,"f").text()})}clone(){const e=structuredClone(a(this,o,"f"));return e.nativeResponse=a(this,n,"f").clone(),new p(e)}}t.HttpResponse=p,n=new WeakMap,o=new WeakMap},8529(e,t,r){t.extractHttpUserFromHeaders=void 0;const n=r(9168),o=r(4893);t.extractHttpUserFromHeaders=function(e){let t=null;const r=e.get("x-ms-client-principal");if(r){let i;try{i=JSON.parse(Buffer.from(r,"base64").toString("utf-8"))}catch(e){return(0,o.workerSystemLog)("warning",`Failed to parse x-ms-client-principal header: ${e instanceof Error?e.message:String(e)}`),null}if(null===i||"object"!=typeof i||Array.isArray(i))return(0,o.workerSystemLog)("warning","Parsed x-ms-client-principal header was not a JSON object."),null;t=i.identityProvider?{type:"StaticWebApps",id:i.userId,username:i.userDetails,identityProvider:i.identityProvider,claimsPrincipalData:i}:{type:"AppService",id:(0,n.nonNullValue)(e.get("x-ms-client-principal-id"),"user-id"),username:(0,n.nonNullValue)(e.get("x-ms-client-principal-name"),"user-name"),identityProvider:(0,n.nonNullValue)(e.get("x-ms-client-principal-idp"),"user-idp"),claimsPrincipalData:i}}return t}},2337(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,o,(t=e[r](t)).done,t.value)})}}};Object.defineProperty(t,"__esModule",{value:!0}),t.setupHttpProxy=t.isAllowedProxyResponseHeader=t.sendProxyResponse=t.waitForProxyRequest=void 0;const i=r(5096),s=r(4735),a=r(1630),c=r(1645),u=r(725),p=r(5230),l=r(9168),f=r(4893),d={},y={},g=new Set(["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","trailers","transfer-encoding","upgrade"]),h=new s.EventEmitter;t.waitForProxyRequest=function(e){return n(this,void 0,void 0,function*(){return new Promise((t,r)=>{const n=d[e];n?(t(n),delete d[e]):h.once(e,()=>{const r=d[e];r&&(t(r),delete d[e])})})})};const m="x-ms-invocation-id";function v(e,t){const r=e.toLowerCase();return!g.has(r)&&!function(e){return new Set(null==e?void 0:e.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0))}(t).has(r)}t.sendProxyResponse=function(e,t){var r,s,a,c;return n(this,void 0,void 0,function*(){const n=(0,l.nonNullProp)(y,e);delete y[e];const u=t.headers.get("connection");for(const[e,r]of t.headers.entries())v(e,u)&&n.setHeader(e,r);if(n.setHeader(m,e),n.statusCode=t.status,t.cookies.length>0&&function(e,t){const r=e.cookies.map(e=>{let t;switch(e.sameSite){case"Lax":t="lax";break;case"None":t="none";break;case"Strict":t="strict";break;default:t=e.sameSite}return(0,i.serialize)(e.name,e.value,{domain:e.domain,path:e.path,expires:"number"==typeof e.expires?new Date(e.expires):e.expires,secure:e.secure,httpOnly:e.httpOnly,sameSite:t,maxAge:e.maxAge})});t.setHeader("Set-Cookie",r)}(t,n),t.body)try{for(var p,f=!0,d=o(t.body.values());p=yield d.next(),!(r=p.done);){c=p.value,f=!1;try{const e=c;n.write(e)}finally{f=!0}}}catch(e){s={error:e}}finally{try{f||r||!(a=d.return)||(yield a.call(d))}finally{if(s)throw s.error}}n.end()})},t.isAllowedProxyResponseHeader=v,t.setupHttpProxy=function(){return n(this,void 0,void 0,function*(){return new Promise((e,t)=>{const r=a.createServer();r.on("request",(e,t)=>{const r=e.headers[m];"string"==typeof r?(d[r]=e,y[r]=t,h.emit(r)):(0,f.workerSystemLog)("error",`Http proxy request missing header ${m}`)}),r.on("error",e=>{e=(0,u.ensureErrorType)(e),(0,f.workerSystemLog)("error",`Http proxy error: ${(0,p.sanitizeErrorString)(e.stack||e.message)}`)}),r.listen(()=>{const n=r.address();null!==n&&"object"==typeof n?0===n.port?((0,f.workerSystemLog)("debug","Port 0 assigned. Finding open port."),function(e){const t=c.createServer();!function r(n){if(n>55025)throw new u.AzFuncSystemError("No available ports found between 55000 and 55025. To enable HTTP streaming, please open a port in this range.");t.once("error",()=>{r(n+1)}),t.once("listening",()=>{const r=t.address();null!==r&&"object"==typeof r&&(n=r.port,t.close(),e(n))}),t.listen(n)}(55e3)}(t=>{r.close(),r.listen(t,()=>{(0,f.workerSystemLog)("debug",`Server is now listening on found open port: ${t}`)}),e(`http://localhost:${t}/`)})):((0,f.workerSystemLog)("debug",`Auto-assigned port is valid. Port: ${n.port}`),e(`http://localhost:${n.port}/`)):t(new u.AzFuncSystemError("Unexpected server address during http proxy setup"))}),r.on("close",()=>{(0,f.workerSystemLog)("information","Http proxy closing")})})})}},8156(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.MySqlChangeOperation=t.SqlChangeOperation=t.CosmosDBv4ChangeFeedMode=t.CosmosDBChangeFeedMode=t.arg=t.McpContent=t.Disposable=t.trigger=t.output=t.PromptInvocationContext=t.McpToolResponse=t.McpTextContent=t.McpResourceLinkContent=t.McpResourceContent=t.McpImageContent=t.McpContentBlock=t.McpAudioContent=t.promptArg=t.InvocationContext=t.input=t.HttpResponse=t.HttpRequest=t.PreInvocationContext=t.PostInvocationContext=t.LogHookContext=t.InvocationHookContext=t.HookContext=t.AppTerminateContext=t.AppStartContext=t.app=void 0,t.app=r(1859);var n=r(7531);Object.defineProperty(t,"AppStartContext",{enumerable:!0,get:function(){return n.AppStartContext}});var o=r(4586);Object.defineProperty(t,"AppTerminateContext",{enumerable:!0,get:function(){return o.AppTerminateContext}});var i=r(5789);Object.defineProperty(t,"HookContext",{enumerable:!0,get:function(){return i.HookContext}});var s=r(9463);Object.defineProperty(t,"InvocationHookContext",{enumerable:!0,get:function(){return s.InvocationHookContext}});var a=r(5407);Object.defineProperty(t,"LogHookContext",{enumerable:!0,get:function(){return a.LogHookContext}});var c=r(7508);Object.defineProperty(t,"PostInvocationContext",{enumerable:!0,get:function(){return c.PostInvocationContext}});var u=r(8561);Object.defineProperty(t,"PreInvocationContext",{enumerable:!0,get:function(){return u.PreInvocationContext}});var p=r(7992);Object.defineProperty(t,"HttpRequest",{enumerable:!0,get:function(){return p.HttpRequest}});var l=r(8950);Object.defineProperty(t,"HttpResponse",{enumerable:!0,get:function(){return l.HttpResponse}}),t.input=r(4788);var f=r(8157);Object.defineProperty(t,"InvocationContext",{enumerable:!0,get:function(){return f.InvocationContext}});var d=r(9855);Object.defineProperty(t,"promptArg",{enumerable:!0,get:function(){return d.promptArg}});var y=r(8642);Object.defineProperty(t,"McpAudioContent",{enumerable:!0,get:function(){return y.McpAudioContent}}),Object.defineProperty(t,"McpContentBlock",{enumerable:!0,get:function(){return y.McpContentBlock}}),Object.defineProperty(t,"McpImageContent",{enumerable:!0,get:function(){return y.McpImageContent}}),Object.defineProperty(t,"McpResourceContent",{enumerable:!0,get:function(){return y.McpResourceContent}}),Object.defineProperty(t,"McpResourceLinkContent",{enumerable:!0,get:function(){return y.McpResourceLinkContent}}),Object.defineProperty(t,"McpTextContent",{enumerable:!0,get:function(){return y.McpTextContent}}),Object.defineProperty(t,"McpToolResponse",{enumerable:!0,get:function(){return y.McpToolResponse}});var g=r(9572);Object.defineProperty(t,"PromptInvocationContext",{enumerable:!0,get:function(){return g.PromptInvocationContext}}),t.output=r(811),t.trigger=r(2888);var h=r(1898);Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return h.Disposable}});var m=r(6199);Object.defineProperty(t,"McpContent",{enumerable:!0,get:function(){return m.McpContent}});var v,b,w,P=r(7175);Object.defineProperty(t,"arg",{enumerable:!0,get:function(){return P.arg}}),function(e){e.LatestVersion="LatestVersion",e.AllVersionsAndDeletes="AllVersionsAndDeletes"}(v=t.CosmosDBChangeFeedMode||(t.CosmosDBChangeFeedMode={})),t.CosmosDBv4ChangeFeedMode=v,(w=t.SqlChangeOperation||(t.SqlChangeOperation={}))[w.Insert=0]="Insert",w[w.Update=1]="Update",w[w.Delete=2]="Delete",(b=t.MySqlChangeOperation||(t.MySqlChangeOperation={}))[b.Update=0]="Update"},4788(e,t,r){var n=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.generic=t.webPubSubContext=t.webPubSubConnection=t.mySql=t.sql=t.cosmosDB=t.table=t.storageBlob=void 0;const o=r(6693);function i(e){return(0,o.addBindingName)(e,"Input")}t.storageBlob=function(e){return i(Object.assign(Object.assign({},e),{type:"blob"}))},t.table=function(e){return i(Object.assign(Object.assign({},e),{type:"table"}))},t.cosmosDB=function(e){return i(Object.assign(Object.assign({},e),{type:"cosmosDB"}))},t.sql=function(e){return i(Object.assign(Object.assign({},e),{type:"sql"}))},t.mySql=function(e){return i(Object.assign(Object.assign({},e),{type:"mysql"}))},t.webPubSubConnection=function(e){return i(Object.assign(Object.assign({},e),{type:"webPubSubConnection"}))},t.webPubSubContext=function(e){var t;const{connection:r}=e,o=n(e,["connection"]);return i(Object.assign(Object.assign({},o),{connections:null!==(t=o.connections)&&void 0!==t?t:r?[r]:void 0,type:"webPubSubContext"}))},t.generic=function(e){return i(e)}},9855(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.promptArg=t.McpPromptArgumentBuilder=void 0;class r{constructor(){this._required=!1}describe(e){return this._description=e,this}isRequired(){return this._required=!0,this}toPromptArgument(e){return{name:e,description:this._description,required:this._required}}}t.McpPromptArgumentBuilder=r,t.promptArg={describe:e=>(new r).describe(e)}},8642(e,t){function r(e){if("string"==typeof e)return e;if(Buffer.isBuffer(e))return e.toString("base64");if(ArrayBuffer.isView(e)){const t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return Buffer.from(t).toString("base64")}return Buffer.from(new Uint8Array(e)).toString("base64")}Object.defineProperty(t,"__esModule",{value:!0}),t.McpToolResponse=t.McpResourceContent=t.McpResourceLinkContent=t.McpAudioContent=t.McpImageContent=t.McpTextContent=t.McpContentBlock=void 0;class n{}t.McpContentBlock=n,t.McpTextContent=class extends n{constructor(e){super(),this.type="text",this.text=e}toJSON(){return{type:this.type,text:this.text}}},t.McpImageContent=class extends n{constructor(e){super(),this.type="image",this.data=e.data,this.mimeType=e.mimeType}toJSON(){const e={type:this.type,data:r(this.data)};return void 0!==this.mimeType&&(e.mimeType=this.mimeType),e}},t.McpAudioContent=class extends n{constructor(e){super(),this.type="audio",this.data=e.data,this.mimeType=e.mimeType}toJSON(){const e={type:this.type,data:r(this.data)};return void 0!==this.mimeType&&(e.mimeType=this.mimeType),e}},t.McpResourceLinkContent=class extends n{constructor(e){super(),this.type="resource_link",this.uri=e.uri,this.name=e.name,this.description=e.description,this.mimeType=e.mimeType}toJSON(){const e={type:this.type,uri:this.uri};return void 0!==this.name&&(e.name=this.name),void 0!==this.description&&(e.description=this.description),void 0!==this.mimeType&&(e.mimeType=this.mimeType),e}},t.McpResourceContent=class extends n{constructor(e){super(),this.type="resource",this.resource=e.resource}toJSON(){const e=this.resource,t={uri:e.uri};return void 0!==e.mimeType&&(t.mimeType=e.mimeType),void 0!==e.text&&(t.text=e.text),void 0!==e.blob&&(t.blob=r(e.blob)),{type:this.type,resource:t}}},t.McpToolResponse=class{constructor(e){this.content=e.content,this.structuredContent=e.structuredContent,this.isError=e.isError}}},9572(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PromptInvocationContext=void 0,t.PromptInvocationContext=class{constructor(e){var t;let r={};if("string"==typeof e)try{const t=JSON.parse(e);t&&"object"==typeof t&&(r=t)}catch(e){r={}}else e&&"object"==typeof e&&(r=e);this.name="string"==typeof r.name?r.name:"";const n=r.arguments;if(n&&"object"==typeof n&&!Array.isArray(n)){const e={};for(const[t,r]of Object.entries(n))e[t]="string"==typeof r?r:null==r?"":String(r);this.arguments=e}else this.arguments={};const o=null!==(t=r.sessionId)&&void 0!==t?t:r.sessionid;this.sessionId="string"==typeof o?o:void 0;const i=r.transport;this.transport=i&&"object"==typeof i&&!Array.isArray(i)?i:void 0}}},5665(e,t){t.warnIfLooksLikeMcpSdkValue=void 0;let r=!1;t.warnIfLooksLikeMcpSdkValue=function(e,t){!r&&t&&function(e){if(!e||"object"!=typeof e)return!1;const t=e;return!!Array.isArray(t.content)||"string"==typeof t.type&&("text"in t||"data"in t||"uri"in t||"resource"in t)}(e)&&(r=!0,t.warn("[@azure/functions] Tool handler return value appears to use types from `@modelcontextprotocol/sdk` (e.g. `CallToolResult`, `TextContent`, `ImageContent`). These types are not supported directly and will be serialized as plain text. Use the equivalent classes from `@azure/functions` instead — `McpToolResponse`, `McpTextContent`, `McpImageContent`, etc. See the `McpContentBlock` JSDoc for custom content block examples."))}},811(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.generic=t.webPubSub=t.mySql=t.sql=t.cosmosDB=t.eventGrid=t.eventHub=t.serviceBusTopic=t.serviceBusQueue=t.storageQueue=t.table=t.storageBlob=t.http=void 0;const n=r(6693);function o(e){return(0,n.addBindingName)(e,"Output")}t.http=function(e){return o(Object.assign(Object.assign({},e),{type:"http"}))},t.storageBlob=function(e){return o(Object.assign(Object.assign({},e),{type:"blob"}))},t.table=function(e){return o(Object.assign(Object.assign({},e),{type:"table"}))},t.storageQueue=function(e){return o(Object.assign(Object.assign({},e),{type:"queue"}))},t.serviceBusQueue=function(e){return o(Object.assign(Object.assign({},e),{type:"serviceBus"}))},t.serviceBusTopic=function(e){return o(Object.assign(Object.assign({},e),{type:"serviceBus"}))},t.eventHub=function(e){return o(Object.assign(Object.assign({},e),{type:"eventHub"}))},t.eventGrid=function(e){return o(Object.assign(Object.assign({},e),{type:"eventGrid"}))},t.cosmosDB=function(e){return o(Object.assign(Object.assign({},e),{type:"cosmosDB"}))},t.sql=function(e){return o(Object.assign(Object.assign({},e),{type:"sql"}))},t.mySql=function(e){return o(Object.assign(Object.assign({},e),{type:"mysql"}))},t.webPubSub=function(e){return o(Object.assign(Object.assign({},e),{type:"webPubSub"}))},t.generic=function(e){return o(e)}},337(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setup=t.capabilities=t.enableHttpStream=t.lockSetup=void 0;const n=r(725),o=r(9168),i=r(3476),s=r(4893);let a=!1;t.lockSetup=function(){a=!0},t.enableHttpStream=!1,t.capabilities={},t.setup=function(e){if(a)throw new n.AzFuncSystemError("Setup options can't be changed after app startup has finished.");if(e.enableHttpStream){const e=(0,i.tryGetCoreApiLazy)();if(e&&!e.log)throw new n.AzFuncSystemError("HTTP streaming requires Azure Functions Host v4.28 or higher.")}if((0,o.isDefined)(e.enableHttpStream)&&(t.enableHttpStream=e.enableHttpStream),e.capabilities)for(let[r,n]of Object.entries(e.capabilities))(0,o.isDefined)(n)&&(n=String(n),(0,s.workerSystemLog)("debug",`Capability ${r} set to ${n}.`),t.capabilities[r]=n);t.enableHttpStream&&(0,s.workerSystemLog)("debug","HTTP streaming enabled.")}},2888(e,t,r){var n=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.generic=t.connectorTrigger=t.mcpPrompt=t.mcpResource=t.mcpTool=t.webPubSub=t.mySql=t.sql=t.warmup=t.cosmosDB=t.eventGrid=t.eventHub=t.serviceBusTopic=t.serviceBusQueue=t.storageQueue=t.storageBlob=t.timer=t.http=void 0;const o=r(6693),i=r(5111),s=r(8329),a=r(5571);function c(e){return(0,o.addBindingName)(e,"Trigger")}t.http=function(e){return c(Object.assign(Object.assign({},e),{authLevel:e.authLevel||"anonymous",methods:e.methods||["GET","POST"],type:"httpTrigger"}))},t.timer=function(e){return c(Object.assign(Object.assign({},e),{type:"timerTrigger"}))},t.storageBlob=function(e){return c(Object.assign(Object.assign({},e),{type:"blobTrigger"}))},t.storageQueue=function(e){return c(Object.assign(Object.assign({},e),{type:"queueTrigger"}))},t.serviceBusQueue=function(e){return c(Object.assign(Object.assign({},e),{type:"serviceBusTrigger"}))},t.serviceBusTopic=function(e){return c(Object.assign(Object.assign({},e),{type:"serviceBusTrigger"}))},t.eventHub=function(e){return c(Object.assign(Object.assign({},e),{type:"eventHubTrigger"}))},t.eventGrid=function(e){return c(Object.assign(Object.assign({},e),{type:"eventGridTrigger"}))},t.cosmosDB=function(e){return c(Object.assign(Object.assign({},e),{type:"cosmosDBTrigger"}))},t.warmup=function(e){return c(Object.assign(Object.assign({},e),{type:"warmupTrigger"}))},t.sql=function(e){return c(Object.assign(Object.assign({},e),{type:"sqlTrigger"}))},t.mySql=function(e){return c(Object.assign(Object.assign({},e),{type:"mysqlTrigger"}))},t.webPubSub=function(e){var t;const{connection:r}=e,o=n(e,["connection"]);return c(Object.assign(Object.assign({},o),{connections:null!==(t=o.connections)&&void 0!==t?t:r?[r]:void 0,type:"webPubSubTrigger"}))},t.mcpTool=function(e){return c(Object.assign(Object.assign({},(0,a.converToMcpToolTriggerOptionsToRpc)(e)),{type:"mcpToolTrigger"}))},t.mcpResource=function(e){return c(Object.assign(Object.assign({},(0,s.convertToMcpResourceTriggerOptionsToRpc)(e)),{type:"mcpResourceTrigger"}))},t.mcpPrompt=function(e){return c(Object.assign(Object.assign({},(0,i.convertToMcpPromptTriggerOptionsToRpc)(e)),{type:"mcpPromptTrigger"}))},t.connectorTrigger=function(e){return c(Object.assign(Object.assign({},e),{type:"connectorTrigger"}))},t.generic=function(e){return c(e)}},1898(e,t){var r,n=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;class i{static from(...e){let t=e;return new i(function(){if(t){for(const e of t)e&&"function"==typeof e.dispose&&e.dispose();t=void 0}})}constructor(e){r.set(this,void 0),n(this,r,e,"f")}dispose(){"function"==typeof o(this,r,"f")&&(o(this,r,"f").call(this),n(this,r,void 0,"f"))}}t.Disposable=i,r=new WeakMap},5230(e,t){t.stringifySanitizedErrorObject=t.sanitizeErrorString=void 0;const r="[Hidden Credential]",n=["password","pwd","key","secret","token","sas"],o=["Token=","DefaultEndpointsProtocol=http","AccountKey=","Data Source=","Server=","Password=","pwd=","&amp;sig=","&sig=","?sig=","SharedAccessKey=","&amp;code=","&code=","?code=","/code=","key="],i=/\b([a-zA-Z]+):\/\/([^:/\s]+):([^@/\s]+)@([^:/\s]+):([0-9]+)\b/g;function s(e){if(!e)return e;let t=e;for(const e of o)t=a(t,e);return t.replace(i,r)}function a(e,t){const n=e.toLowerCase(),o=t.toLowerCase();let i=n.indexOf(o);if(-1===i)return e;let s="",a=0;for(;-1!==i;){const t=c(e,i);s+=e.substring(a,i)+r,a=t,i=n.indexOf(o,a)}return s+e.substring(a)}function c(e,t){const r=e.substring(t).search(/[<"'\r\n]/);return-1===r?e.length:t+r}t.sanitizeErrorString=s,t.stringifySanitizedErrorObject=function(e){const t=new WeakSet;return JSON.stringify(e,(e,o)=>{if(i=e,n.some(e=>i.toLowerCase().includes(e)))return r;var i;if("string"==typeof o)return s(o);if("bigint"==typeof o)return o.toString();if("object"==typeof o&&null!==o){if(t.has(o))return"[Circular]";t.add(o)}return o})}},5396(e,t){t.fallbackLogHandler=void 0,t.fallbackLogHandler=function(e,...t){switch(e){case"trace":console.trace(...t);break;case"debug":console.debug(...t);break;case"information":console.info(...t);break;case"warning":console.warn(...t);break;case"critical":case"error":console.error(...t);break;default:console.log(...t)}}},4169(e,t,r){t.getStringHash=void 0;const n=r(5511);t.getStringHash=function(e,t=10){return n.createHash("sha256").update(e).digest("hex").slice(0,t)}},9898(e,t){t.isMcpPromptTrigger=t.isMcpToolTrigger=t.isTimerTrigger=t.isHttpTrigger=t.isTrigger=void 0,t.isTrigger=function(e){return!!e&&/trigger$/i.test(e)},t.isHttpTrigger=function(e){return"httptrigger"===(null==e?void 0:e.toLowerCase())},t.isTimerTrigger=function(e){return"timertrigger"===(null==e?void 0:e.toLowerCase())},t.isMcpToolTrigger=function(e){return"mcptooltrigger"===(null==e?void 0:e.toLowerCase())},t.isMcpPromptTrigger=function(e){return"mcpprompttrigger"===(null==e?void 0:e.toLowerCase())}},6199(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.shouldCreateStructuredContentMarker=t.hasMcpContentMarker=t.McpContent=void 0;const r=Symbol("__mcp_content__");function n(e){return null!=e&&("function"==typeof e?"object"==typeof e.prototype&&null!==e.prototype&&r in e.prototype:"object"==typeof e&&r in e)}t.McpContent=function(e){const t=e=>(Object.defineProperty(e.prototype,r,{value:!0,writable:!1,enumerable:!1,configurable:!1}),e);return void 0===e?t:t(e)},t.hasMcpContentMarker=n,t.shouldCreateStructuredContentMarker=function(e){return null!=e&&"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e&&!Array.isArray(e)&&!(e instanceof Date||e instanceof RegExp||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||Buffer.isBuffer(e)||e instanceof Set||e instanceof Map)&&n(e)}},9168(e,t,r){t.isDefined=t.copyPropIfDefined=t.nonNullValue=t.nonNullProp=void 0;const n=r(725);function o(e,t){if(null==e)throw new n.AzFuncSystemError("Internal error: Expected value to be neither null nor undefined"+(t?`: ${t}`:""));return e}t.nonNullProp=function(e,t){return o(e[t],t)},t.nonNullValue=o,t.copyPropIfDefined=function(e,t,r){null!==e[r]&&void 0!==e[r]&&(t[r]=e[r])},t.isDefined=function(e){return null!=e}},7175(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeToolProperties=t.isToolProperties=t.convertToolProperties=t.arg=t.ToolPropertyBuilder=void 0;class r{constructor(){this.property={}}get propertyName(){return this.property.propertyName||""}get propertyType(){if(!this.property.propertyType)throw new Error("Property type must be specified (use .string(), .number(), etc.)");return this.property.propertyType}get description(){return this.property.description||""}get isRequired(){var e;return null===(e=this.property.isRequired)||void 0===e||e}get isArray(){var e;return null!==(e=this.property.isArray)&&void 0!==e&&e}string(){return this.property.propertyType="string",this}double(){return this.property.propertyType="number",this}long(){return this.property.propertyType="number",this}number(){return this.property.propertyType="number",this}boolean(){return this.property.propertyType="boolean",this}object(){return this.property.propertyType="object",this}integer(){return this.property.propertyType="integer",this}datetime(){return this.property.propertyType="string",this}describe(e){return this.property.description=e,this}optional(){return this.property.isRequired=!1,this}asArray(){return this.property.isArray=!0,this}}function n(e){return Object.entries(e).map(([e,t])=>{var r,n;return{propertyName:e,propertyType:t.propertyType,description:t.description||"",isRequired:null===(r=t.isRequired)||void 0===r||r,isArray:null!==(n=t.isArray)&&void 0!==n&&n}})}function o(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&Object.values(e).every(e=>"object"==typeof e&&null!==e&&"propertyType"in e&&"description"in e&&"isRequired"in e&&"isArray"in e)}t.ToolPropertyBuilder=r,t.arg={string:()=>(new r).string(),integer:()=>(new r).integer(),number:()=>(new r).number(),long:()=>(new r).long(),double:()=>(new r).double(),boolean:()=>(new r).boolean(),datetime:()=>(new r).datetime(),object:()=>(new r).object()},t.convertToolProperties=n,t.isToolProperties=o,t.normalizeToolProperties=function(e){if(e){if(Array.isArray(e))return e.forEach((e,t)=>{!function(e,t){const r=t?` for property '${t}'`:"";if(!e.propertyType||""===e.propertyType.trim())throw new Error(`Property type is required${r}`);void 0!==e.description&&null!==e.description||(e.description="")}(e,e.propertyName||`index ${t}`)}),e;if(o(e))return n(e);throw new Error("Invalid tool properties format")}}},3476(e,t,r){let n;t.tryGetCoreApiLazy=void 0,t.tryGetCoreApiLazy=function(){if(void 0===n)try{n=r(8789)}catch(e){n=null}return n}},4893(e,t,r){t.workerSystemLog=void 0;const n=r(8354),o=r(5396),i=r(3476);t.workerSystemLog=function(e,...t){const r=(0,i.tryGetCoreApiLazy)();r&&r.log?r.log(e,"system",(0,n.format)(...t)):(0,o.fallbackLogHandler)(e,...t)}},8789(e){e.exports=require("@azure/functions-core")},6490(e){e.exports=require("@azure/functions-extensions-base")},5096(e){e.exports=require("cookie")},5511(e){e.exports=require("crypto")},4735(e){e.exports=require("events")},1630(e){e.exports=require("http")},1645(e){e.exports=require("net")},9551(e){e.exports=require("url")},8354(e){e.exports=require("util")}};const t={};let r=function r(n){const o=t[n];if(void 0!==o)return o.exports;const i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}(8156);module.exports=r})();
//# sourceMappingURL=azure-functions.min.js.map