@humain/humain-code 0.4.4 → 0.4.6

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/bundle/agent-monitor.js +1 -1
  3. package/dist/bundle/chunks/anthropic-messages-OHNAMPAM.js +69 -0
  4. package/dist/bundle/chunks/{azure-openai-responses-OJKB2O3D.js → azure-openai-responses-FREWTLSS.js} +6 -5
  5. package/dist/bundle/chunks/bedrock-converse-stream.js +61 -55
  6. package/dist/bundle/chunks/{chunk-VZV7GLZT.js → chunk-2NX3BVH6.js} +6 -5
  7. package/dist/bundle/chunks/{chunk-JCLZBP27.js → chunk-BBBBZ5HY.js} +2 -2
  8. package/dist/bundle/chunks/{chunk-T2IF7HO3.js → chunk-FP2SXW5M.js} +129 -121
  9. package/dist/bundle/chunks/{chunk-O2WQYQO4.js → chunk-IMR3ZJM5.js} +1 -1
  10. package/dist/bundle/chunks/{chunk-PEZZKT73.js → chunk-KLIRQQH5.js} +1 -1
  11. package/dist/bundle/chunks/{chunk-2KKLZK2N.js → chunk-LFXFQLII.js} +1 -1
  12. package/dist/bundle/chunks/{chunk-ERT2BD7V.js → chunk-PBBQBIHY.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-HDP4USTE.js → chunk-RXHSJSYY.js} +1 -1
  14. package/dist/bundle/chunks/{chunk-524BLM37.js → chunk-SKIP6KJV.js} +1 -1
  15. package/dist/bundle/chunks/{chunk-Q5TQLAOM.js → chunk-UBQSONVR.js} +1 -1
  16. package/dist/bundle/chunks/{chunk-PI3NYWSK.js → chunk-UTMYL2YO.js} +8 -6
  17. package/dist/bundle/chunks/{chunk-VS3OEOQ4.js → chunk-UU4WS4BQ.js} +57 -57
  18. package/dist/bundle/chunks/{chunk-T45HXZW7.js → chunk-VQTXF23B.js} +8 -8
  19. package/dist/bundle/chunks/{chunk-RTFCP3VQ.js → chunk-WPLW452J.js} +1 -1
  20. package/dist/bundle/chunks/chunk-YTVFIA3A.js +2 -0
  21. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-3QIT2RE2.js → cloudflare-workers-ai-system-one-YPOLSCPT.js} +1 -1
  22. package/dist/bundle/chunks/{compat-U2AA66JI.js → compat-LJ4ZIVJZ.js} +3 -3
  23. package/dist/bundle/chunks/{dist-SIXP5HVD.js → dist-QHFJK4TH.js} +2 -2
  24. package/dist/bundle/chunks/{dist-NKHGTDJG.js → dist-UAQRGPZO.js} +520 -464
  25. package/dist/bundle/chunks/{event-streams-PKTMLNE5.js → event-streams-CGCQQL5M.js} +1 -1
  26. package/dist/bundle/chunks/{execute-KEUC5IWA.js → execute-MFIDTEMB.js} +1 -1
  27. package/dist/bundle/chunks/{extract-WUAT5T4V.js → extract-EWN2GRAC.js} +2 -2
  28. package/dist/bundle/chunks/google-generative-ai-TS4ZE2RO.js +21 -0
  29. package/dist/bundle/chunks/google-vertex-MJK2SMNE.js +25 -0
  30. package/dist/bundle/chunks/{host-SPBJ4YAA.js → host-3OGMFGBY.js} +1 -1
  31. package/dist/bundle/chunks/mistral-conversations-5HCMHK6E.js +43 -0
  32. package/dist/bundle/chunks/{openai-codex-responses-B7CTZNPK.js → openai-codex-responses-5AJAJHTK.js} +5 -5
  33. package/dist/bundle/chunks/{openai-completions-2FYSVT4M.js → openai-completions-65RRYKEQ.js} +35 -34
  34. package/dist/bundle/chunks/{openai-decisions-BLNICGXO.js → openai-decisions-MKH4OJHH.js} +1 -1
  35. package/dist/bundle/chunks/{openai-responses-APOZMFDL.js → openai-responses-72W3PGZ7.js} +4 -4
  36. package/dist/bundle/chunks/{pi-messages-WNFZL3B7.js → pi-messages-RLLYRBDT.js} +8 -8
  37. package/dist/bundle/chunks/{typesafe-system-one-L7FINSCN.js → typesafe-system-one-PAYJECQK.js} +1 -1
  38. package/dist/bundle/chunks/{virtual-modules-6XA5HC3B.js → virtual-modules-LWYOTTHQ.js} +2 -2
  39. package/dist/bundle/cli-runtime.js +2 -2
  40. package/dist/bundle/flow/assets/profiles/anthropic.json +3 -3
  41. package/dist/bundle/flow/assets/profiles/openai.json +3 -3
  42. package/dist/bundle/flow/assets/profiles/oss-first.json +3 -3
  43. package/dist/bundle/flow/assets/profiles/premium.json +92 -8
  44. package/dist/bundle/flow/package.json +1 -1
  45. package/dist/bundle/index.js +4 -4
  46. package/dist/bundle/rpc-entry.js +2 -2
  47. package/dist/core/agent-session.d.ts +2 -0
  48. package/dist/core/agent-session.d.ts.map +1 -1
  49. package/dist/core/agent-session.js +1 -0
  50. package/dist/core/agent-session.js.map +1 -1
  51. package/dist/core/tools/subagent.d.ts.map +1 -1
  52. package/dist/core/tools/subagent.js +2 -0
  53. package/dist/core/tools/subagent.js.map +1 -1
  54. package/dist/core/usage-totals.d.ts +2 -0
  55. package/dist/core/usage-totals.d.ts.map +1 -1
  56. package/dist/core/usage-totals.js +5 -1
  57. package/dist/core/usage-totals.js.map +1 -1
  58. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +18 -0
  59. package/dist/humain/node-http.d.ts.map +1 -1
  60. package/dist/humain/node-http.js +29 -0
  61. package/dist/humain/node-http.js.map +1 -1
  62. package/dist/humain/trace-capture/index.d.ts.map +1 -1
  63. package/dist/humain/trace-capture/index.js +15 -12
  64. package/dist/humain/trace-capture/index.js.map +1 -1
  65. package/docs/flow-profiles.md +2 -0
  66. package/npm-shrinkwrap.json +6 -6
  67. package/package.json +2 -2
  68. package/dist/bundle/chunks/anthropic-messages-RKOVHQPW.js +0 -67
  69. package/dist/bundle/chunks/google-generative-ai-MDUVUFFQ.js +0 -20
  70. package/dist/bundle/chunks/google-vertex-UQGG6LEW.js +0 -24
  71. package/dist/bundle/chunks/mistral-conversations-56EA73FO.js +0 -42
@@ -182,7 +182,7 @@ N");let endpoint=await getEndpointFromInstructions2(args.input,{getEndpointParam
182
182
  Object.assign(httpAuthOption.signingProperties||{},{signing_region:authScheme.signingRegion,signingRegion:authScheme.signingRegion,signing_service:authScheme.signingName,signingName:authScheme.signingName,signingRegionSet:authScheme.signingRegionSet},authScheme.properties))}return next({...args})}}var init_endpointMiddleware=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js"(){init_transport();init_getEndpointFromInstructions()}});function bindGetEndpointPlugin(getEndpointFromConfig2){let endpointMiddleware2=bindEndpointMiddleware(getEndpointFromConfig2);return(config,instructions)=>({applyToStack:clientStack=>{clientStack.addRelativeTo(endpointMiddleware2({config,instructions}),endpointMiddlewareOptions)}})}var serializerMiddlewareOption2,endpointMiddlewareOptions,init_getEndpointPlugin=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/getEndpointPlugin.js"(){init_endpointMiddleware();serializerMiddlewareOption2=
183
183
  {name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0},endpointMiddlewareOptions={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:serializerMiddlewareOption2.name}}});function bindResolveEndpointConfig(getEndpointFromConfig2){return input=>{let tls3=input.tls??!0,{endpoint,useDualstackEndpoint,useFipsEndpoint}=input,customEndpointProvider=endpoint!=null?async()=>toEndpointV1(await normalizeProvider(endpoint)()):void 0,resolvedConfig=Object.assign(input,{endpoint:customEndpointProvider,tls:tls3,isCustomEndpoint:!!endpoint,useDualstackEndpoint:normalizeProvider(useDualstackEndpoint??!1),useFipsEndpoint:normalizeProvider(useFipsEndpoint??!1),ignoreConfiguredEndpointUrls:!!input.
184
184
  ignoreConfiguredEndpointUrls}),configuredEndpointPromise;return resolvedConfig.serviceConfiguredEndpoint=async()=>(input.serviceId&&!configuredEndpointPromise&&(configuredEndpointPromise=getEndpointFromConfig2(input.serviceId)),configuredEndpointPromise),resolvedConfig}}var init_resolveEndpointConfig=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js"(){init_transport();init_toEndpointV12()}});var BinaryDecisionDiagram,init_BinaryDecisionDiagram=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/bdd/BinaryDecisionDiagram.js"(){BinaryDecisionDiagram=class _BinaryDecisionDiagram{nodes;root;conditions;results;constructor(bdd5,root5,conditions,results){this.nodes=bdd5,this.root=root5,this.conditions=conditions,this.results=results}static from(bdd5,root5,conditions,results){return new _BinaryDecisionDiagram(bdd5,root5,conditions,results)}}}});var EndpointCache,init_EndpointCache=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js"(){EndpointCache=class{capacity;data=new Map;parameters=[];constructor({size,params}){this.capacity=size??50,params&&(this.parameters=params)}get(endpointParams,resolver){let key=this.hash(endpointParams);if(key===!1)return resolver();if(!this.data.has(key)){if(this.data.size>this.capacity+10){let keys=this.data.keys(),i5=0;for(;;){let{value,done}=keys.next();
185
- if(this.data.delete(value),done||++i5>10)break}}this.data.set(key,resolver())}return this.data.get(key)}size(){return this.data.size}hash(endpointParams){let buffer="",{parameters}=this;if(parameters.length===0)return!1;for(let param of parameters){let val=String(endpointParams[param]??"");if(val.includes("|;"))return!1;buffer+=val+"|;"}return buffer}}}});var EndpointError,init_EndpointError=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js"(){EndpointError=class extends Error{constructor(message){super(message),this.name="EndpointError"}}}});var init_types2=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/index.js"(){init_EndpointError()}});var debugId,init_debugId=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/debugId.js"(){debugId="endpoints"}});function toDebugString(input){return typeof input!="object"||input==null?input:"ref"in input?`$${toDebugString(input.ref)}`:"fn"in input?`${input.fn}(${(input.argv||[]).map(toDebugString).join(", ")})`:JSON.stringify(input,null,2)}var init_toDebugString=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/toDebugString.js"(){}});var init_debug=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/index.js"(){init_debugId();init_toDebugString()}});var customEndpointFunctions,init_customEndpointFunctions=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/customEndpointFunctions.js"(){customEndpointFunctions={}}});var booleanEquals,init_booleanEquals=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/booleanEquals.js"(){booleanEquals=(value1,value2)=>value1===value2}});function coalesce(...args){for(let arg of args)if(arg!=null)return arg}var init_coalesce=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/coalesce.js"(){}});var getAttrPathList,init_getAttrPathList=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js"(){init_types2();getAttrPathList=path=>{let parts=path.split("."),pathList=[];for(let part of parts){let squareBracketIndex=part.indexOf("[");if(squareBracketIndex!==-1){if(part.indexOf("]")!==part.length-1)throw new EndpointError(`Path: '${path}' does not end with ']'`);let arrayIndex=part.slice(squareBracketIndex+1,-1);if(Number.isNaN(parseInt(arrayIndex)))
185
+ if(this.data.delete(value),done||++i5>10)break}}this.data.set(key,resolver())}return this.data.get(key)}size(){return this.data.size}hash(endpointParams){let buffer="",{parameters}=this;if(parameters.length===0)return!1;for(let param of parameters){let raw=endpointParams[param],val=raw==null?"\0":String(raw);if(val.includes("|;"))return!1;buffer+=val+"|;"}return buffer}}}});var EndpointError,init_EndpointError=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js"(){EndpointError=class extends Error{constructor(message){super(message),this.name="EndpointError"}}}});var init_types2=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/index.js"(){init_EndpointError()}});var debugId,init_debugId=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/debugId.js"(){debugId="endpoints"}});function toDebugString(input){return typeof input!="object"||input==null?input:"ref"in input?`$${toDebugString(input.ref)}`:"fn"in input?`${input.fn}(${(input.argv||[]).map(toDebugString).join(", ")})`:JSON.stringify(input,null,2)}var init_toDebugString=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/toDebugString.js"(){}});var init_debug=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/index.js"(){init_debugId();init_toDebugString()}});var customEndpointFunctions,init_customEndpointFunctions=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/customEndpointFunctions.js"(){customEndpointFunctions={}}});var booleanEquals,init_booleanEquals=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/booleanEquals.js"(){booleanEquals=(value1,value2)=>value1===value2}});function coalesce(...args){for(let arg of args)if(arg!=null)return arg}var init_coalesce=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/coalesce.js"(){}});var getAttrPathList,init_getAttrPathList=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js"(){init_types2();getAttrPathList=path=>{let parts=path.split("."),pathList=[];for(let part of parts){let squareBracketIndex=part.indexOf("[");if(squareBracketIndex!==-1){if(part.indexOf("]")!==part.length-1)throw new EndpointError(`Path: '${path}' does not end with ']'`);let arrayIndex=part.slice(squareBracketIndex+1,-1);if(Number.isNaN(parseInt(arrayIndex)))
186
186
  throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);squareBracketIndex!==0&&pathList.push(part.slice(0,squareBracketIndex)),pathList.push(arrayIndex)}else pathList.push(part)}return pathList}}});var getAttr,init_getAttr=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttr.js"(){init_types2();init_getAttrPathList();getAttr=(value,path)=>getAttrPathList(path).reduce((acc,index)=>{if(typeof acc!="object")throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);if(Array.isArray(acc)){let i5=parseInt(index);return acc[i5<0?acc.length+i5:i5]}return acc[index]},value)}});var isSet,init_isSet=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isSet.js"(){isSet=value=>value!=null}});function ite(condition,trueValue,falseValue){return condition?trueValue:falseValue}var init_ite=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/ite.js"(){}});var not,init_not=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/not.js"(){not=value=>!value}});var IP_V4_REGEX,isIpAddress,init_isIpAddress=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isIpAddress.js"(){IP_V4_REGEX=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),isIpAddress=value=>IP_V4_REGEX.test(value)||value.startsWith("[")&&value.endsWith("]")}});var import_types12,DEFAULT_PORTS,parseURL,init_parseURL=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/parseURL.js"(){import_types12=__toESM(require_dist_cjs());init_isIpAddress();DEFAULT_PORTS={[import_types12.EndpointURLScheme.HTTP]:80,[import_types12.EndpointURLScheme.HTTPS]:443},parseURL=value=>{let whatwgURL=(()=>{try{if(value instanceof URL)return value;if(typeof value=="object"&&"hostname"in value){let{hostname:hostname2,port,protocol:protocol2="",path="",
187
187
  query={}}=value,url=new URL(`${protocol2}//${hostname2}${port?`:${port}`:""}${path}`);return url.search=Object.entries(query).map(([k5,v])=>`${k5}=${v}`).join("&"),url}return new URL(value)}catch{return null}})();if(!whatwgURL)return console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`),null;let urlString=whatwgURL.href,{host,hostname,pathname,protocol,search}=whatwgURL;if(search)return null;let scheme=protocol.slice(0,-1);if(!Object.values(import_types12.EndpointURLScheme).
188
188
  includes(scheme))return null;let isIp=isIpAddress(hostname),inputContainsDefaultPort=urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`)||typeof value=="string"&&value.includes(`${host}:${DEFAULT_PORTS[scheme]}`),authority=`${host}${inputContainsDefaultPort?`:${DEFAULT_PORTS[scheme]}`:""}`;return{scheme,authority,path:pathname,normalizedPath:pathname.endsWith("/")?pathname:`${pathname}/`,isIp}}}});function split(value,delimiter,limit){if(limit===1)return[value];if(value==="")return[""];let parts=value.split(delimiter);return limit===0?parts:parts.slice(0,limit-1).concat(parts.slice(1).join(delimiter))}var init_split=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/split.js"(){}});var stringEquals,init_stringEquals=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/stringEquals.js"(){stringEquals=(value1,value2)=>value1===value2}});var substring,init_substring=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/substring.js"(){substring=(input,start,stop,reverse)=>input==null||start>=stop||input.length<stop||/[^\u0000-\u007f]/.test(input)?null:reverse?input.substring(input.length-stop,input.length-start):input.substring(start,stop)}});var uriEncode,init_uriEncode=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/uriEncode.js"(){uriEncode=value=>encodeURIComponent(value).replace(/[!*'()]/g,c5=>`%${c5.charCodeAt(0).toString(16).toUpperCase()}`)}});var init_lib=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/index.js"(){init_booleanEquals();init_coalesce();init_getAttr();init_isSet();init_transport();init_ite();init_not();init_parseURL();init_split();init_stringEquals();init_substring();init_uriEncode()}});var endpointFunctions,init_endpointFunctions=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/endpointFunctions.js"(){init_lib();endpointFunctions={booleanEquals,coalesce,getAttr,isSet,isValidHostLabel,ite,not,parseURL,split,stringEquals,substring,uriEncode}}});var evaluateTemplate,init_evaluateTemplate=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateTemplate.js"(){init_lib();evaluateTemplate=(template,options)=>{let evaluatedTemplateArr=[],{referenceRecord,endpointParams}=options,currentIndex=0;for(;currentIndex<template.length;){let openingBraceIndex=template.indexOf("{",currentIndex);if(openingBraceIndex===-1){evaluatedTemplateArr.push(template.slice(currentIndex));break}evaluatedTemplateArr.push(template.
@@ -717,13 +717,13 @@ try{let result=await requestHandler.handle(request,{requestTimeout});return getC
717
717
  `))throw new CredentialsProviderError2("Authorization token contains invalid \\r\\n sequence.");return token};exports.fromHttp=fromHttp}});function createAwsAuthSigv4HttpAuthOption(authParameters){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:authParameters.region},propertiesExtractor:(config,context)=>({signingProperties:{config,context}})}}function createSmithyApiNoAuthHttpAuthOption(authParameters){return{schemeId:"smithy.api#noAuth"}}var defaultSSOOIDCHttpAuthSchemeParametersProvider,defaultSSOOIDCHttpAuthSchemeProvider,resolveHttpAuthSchemeConfig,init_httpAuthSchemeProvider=__esm({"node_modules/@a\
718
718
  ws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js"(){init_httpAuthSchemes2();init_client2();defaultSSOOIDCHttpAuthSchemeParametersProvider=async(config,context,input)=>({operation:getSmithyContext(context).operation,region:await normalizeProvider(config.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});defaultSSOOIDCHttpAuthSchemeProvider=authParameters=>{let options=[];return authParameters.operation==="CreateToken"?
719
719
  options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)):options.push(createAwsAuthSigv4HttpAuthOption(authParameters)),options},resolveHttpAuthSchemeConfig=config=>{let config_0=resolveAwsSdkSigV4Config(config);return Object.assign(config_0,{authSchemePreference:normalizeProvider(config.authSchemePreference??[])})}}});var resolveClientEndpointParameters,commonParams,init_EndpointParameters=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/EndpointParameters.js"(){resolveClientEndpointParameters=options=>Object.assign(options,{useDualstackEndpoint:options.useDualstackEndpoint??!1,useFipsEndpoint:options.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),commonParams={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"\
720
- builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}});var package_default,init_package=__esm({"node_modules/@aws-sdk/nested-clients/package.json"(){package_default={name:"@aws-sdk/nested-clients",version:"3.997.46",description:"Nested clients for AWS SDK packages.",homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",license:"Apache-2.0",author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/sdk-for-javascript/"},repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/ne\
720
+ builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}});var package_default,init_package=__esm({"node_modules/@aws-sdk/nested-clients/package.json"(){package_default={name:"@aws-sdk/nested-clients",version:"3.997.47",description:"Nested clients for AWS SDK packages.",homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",license:"Apache-2.0",author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/sdk-for-javascript/"},repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/ne\
721
721
  sted-clients"},files:["./cognito-identity.d.ts","./cognito-identity.js","./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sso.d.ts","./sso.js","./sts.d.ts","./sts.js","dist-*/**"],sideEffects:!1,main:"./dist-cjs/index.js",module:"./dist-es/index.js",browser:{"./dist-es/submodules/cognito-identity/runtimeConfig":"./dist-es/submodules/cognito-identity/runtimeConfig.browser","./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/s\
722
722
  ubmodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sso/runtimeConfig":"./dist-es/submodules/sso/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},types:"./dist-types/index.d.ts",typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"],"*":["dist-types/ts3.4/submodules/*/index.d.ts"]}},"react-native":{},exports:{"./package.json":"./package.json","./sso-oidc":{types:"./dis\
723
723
  t-types/submodules/sso-oidc/index.d.ts",module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{types:"./dist-types/submodules/sts/index.d.ts",module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js"},"./signin":{types:"./dist-types/subm\
724
724
  odules/signin/index.d.ts",module:"./dist-es/submodules/signin/index.js",node:"./dist-cjs/submodules/signin/index.js",import:"./dist-es/submodules/signin/index.js",require:"./dist-cjs/submodules/signin/index.js"},"./cognito-identity":{types:"./dist-types/submodules/cognito-identity/index.d.ts",module:"./dist-es/submodules/cognito-identity/index.js",node:"./dist-cjs/submodules/cognito-identity/index.js",import:"./dist-es/submodules/cognito-identity/index.js",require:"./dist-cjs/submodules/cognito-\
725
725
  identity/index.js"},"./sso":{types:"./dist-types/submodules/sso/index.d.ts",module:"./dist-es/submodules/sso/index.js",node:"./dist-cjs/submodules/sso/index.js",import:"./dist-es/submodules/sso/index.js",require:"./dist-cjs/submodules/sso/index.js"}},scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline","build:es":"premove dist-es && tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_pack\
726
- age_name"',"build:types":"premove dist-types && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types",lint:"node ../../scripts/validation/submodules-linter.js",prebuild:"yarn lint",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},dependencies:{"@aws-sdk/core":"^3.978.1","@aws-sdk/signature-v4-multi-region":"^3.996.47","@aws-sdk/types":"^3.974.6","@smithy/core":"^3.35.0","@smithy/fetch-http-handler":"\
726
+ age_name"',"build:types":"premove dist-types && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types",lint:"node ../../scripts/validation/submodules-linter.js",prebuild:"yarn lint",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},dependencies:{"@aws-sdk/core":"^3.978.2","@aws-sdk/signature-v4-multi-region":"^3.996.48","@aws-sdk/types":"^3.974.6","@smithy/core":"^3.35.2","@smithy/fetch-http-handler":"\
727
727
  ^5.8.0","@smithy/node-http-handler":"^4.12.1","@smithy/types":"^4.19.0",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~7.0.2"},engines:{node:">=20.0.0"}}}});var tagSymbol,init_cbor_types=__esm({"node_modules/@smithy/core/dist-es/submodules/cbor/cbor-types.js"(){tagSymbol=Symbol("@smithy/core/cbor::tagSymbol")}});var loadSmithyRpcV2CborErrorCode,init_parseCborBody=__esm({"node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js"(){loadSmithyRpcV2CborErrorCode=(output,data)=>{let sanitizeErrorCode2=rawValue=>{let cleanValue=rawValue;return typeof cleanValue=="number"&&(cleanValue=cleanValue.toString()),cleanValue.indexOf(",")>=0&&(cleanValue=cleanValue.split(",")[0]),cleanValue.indexOf(":")>=0&&(cleanValue=cleanValue.split(":")[0]),cleanValue};if(data.__type!==void 0)return sanitizeErrorCode2(data.
728
728
  __type)}}});function loadCborStructIterator(ns){let schema=ns.getSchema(),existing=schema[CBOR_STRUCT_CACHE];if(existing)return existing;let memberNames=[],memberSchemas=[];for(let[name,memberSchema]of ns.structIterator())memberNames.push(name),memberSchemas.push(memberSchema);let encodedKeys=new Array(memberNames.length);for(let i5=0;i5<memberNames.length;++i5)encodedKeys[i5]=encodeCborStringKey(memberNames[i5]);let cache5={memberNames,memberSchemas,encodedKeys};return schema[CBOR_STRUCT_CACHE]=cache5,cache5}
729
729
  function encodeCborStringKey(s2){let utf8Bytes;USE_BUFFER?utf8Bytes=Buffer.from(s2,"utf-8"):utf8Bytes=new TextEncoder().encode(s2);let byteLen=utf8Bytes.length,headerSize;byteLen<24?headerSize=1:byteLen<256?headerSize=2:headerSize=3;let result=new Uint8Array(headerSize+byteLen);return headerSize===1?result[0]=96|byteLen:headerSize===2?(result[0]=120,result[1]=byteLen):(result[0]=121,result[1]=byteLen>>8,result[2]=byteLen&255),result.set(utf8Bytes,headerSize),result}function allocUnsafe(size){return USE_BUFFER?
@@ -923,15 +923,17 @@ parseJsonBody:()=>parseJsonBody,parseJsonErrorBody:()=>parseJsonErrorBody,parseX
923
923
  init_JsonShapeSerializer2();init_parseJsonBody();init_AwsEc2QueryProtocol();init_AwsQueryProtocol();init_QueryShapeSerializer();init_AwsRestXmlProtocol();init_XmlCodec();init_XmlShapeDeserializer();init_XmlShapeSerializer();init_parseXmlBody();init_awsExpectUnion();init_coercing_serializers()}});var k,a,b,c,d,e,f,g,h,i,j,_data,root,r,nodes,bdd,init_bdd=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/bdd.js"(){init_endpoints();k="ref",a=-1,b=!0,c="isSet",d="PartitionResult",e="booleanEquals",f="getAttr",g={[k]:"Endpoint"},h={[k]:d},i={},j=[{[k]:"Region"}],_data={conditions:[[c,[g]],[c,j],["aws.partition",j,d],[e,[{[k]:"UseFIPS"},b]],[e,[{[k]:"UseDualStack"},b]],[e,[{fn:f,argv:[h,"supportsDualStack"]},b]],[e,[{fn:f,argv:[h,"supportsFIPS"]},b]],["stringEqu\
924
924
  als",[{fn:f,argv:[h,"name"]},"aws-us-gov"]]],results:[[a],[a,"Invalid Configuration: FIPS and custom endpoint are not supported"],[a,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[g,i],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",i],[a,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",i],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",i],[a,"FIPS is enabled but this\
925
925
  partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",i],[a,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",i],[a,"Invalid Configuration: Missing Region"]]},root=2,r=1e8,nodes=new Int32Array([-1,1,-1,0,13,3,1,4,r+12,2,5,r+12,3,8,6,4,7,r+11,5,r+9,r+10,4,11,9,6,10,r+8,7,r+6,r+7,5,12,r+5,6,r+4,r+5,3,r+1,14,4,r+2,r+3]),bdd=BinaryDecisionDiagram.from(nodes,root,_data.conditions,_data.
926
- results)}});var cache,defaultEndpointResolver,init_endpointResolver=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js"(){init_client3();init_endpoints();init_bdd();cache=new EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),defaultEndpointResolver=(endpointParams,context={})=>cache.get(endpointParams,()=>decideEndpoint(bdd,{endpointParams,logger:context.logger}));customEndpointFunctions.aws=awsEndpointFunctions}});var SSOOIDCServiceException,init_SSOOIDCServiceException=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js"(){init_client2();SSOOIDCServiceException=class _SSOOIDCServiceException extends ServiceException{constructor(options){super(options),Object.setPrototypeOf(this,_SSOOIDCServiceException.prototype)}}}});var AccessDeniedException,AuthorizationPendingException,ExpiredTokenException,InternalServerException,InvalidClientException,InvalidGrantException,InvalidRequestException,InvalidScopeException,SlowDownException,UnauthorizedClientException,UnsupportedGrantTypeException,init_errors=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js"(){init_SSOOIDCServiceException();AccessDeniedException=class _AccessDeniedException extends SSOOIDCServiceException{name="Access\
927
- DeniedException";$fault="client";error;reason;error_description;constructor(opts){super({name:"AccessDeniedException",$fault:"client",...opts}),Object.setPrototypeOf(this,_AccessDeniedException.prototype),this.error=opts.error,this.reason=opts.reason,this.error_description=opts.error_description}},AuthorizationPendingException=class _AuthorizationPendingException extends SSOOIDCServiceException{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(opts){super({
928
- name:"AuthorizationPendingException",$fault:"client",...opts}),Object.setPrototypeOf(this,_AuthorizationPendingException.prototype),this.error=opts.error,this.error_description=opts.error_description}},ExpiredTokenException=class _ExpiredTokenException extends SSOOIDCServiceException{name="ExpiredTokenException";$fault="client";error;error_description;constructor(opts){super({name:"ExpiredTokenException",$fault:"client",...opts}),Object.setPrototypeOf(this,_ExpiredTokenException.prototype),this.
929
- error=opts.error,this.error_description=opts.error_description}},InternalServerException=class _InternalServerException extends SSOOIDCServiceException{name="InternalServerException";$fault="server";error;error_description;constructor(opts){super({name:"InternalServerException",$fault:"server",...opts}),Object.setPrototypeOf(this,_InternalServerException.prototype),this.error=opts.error,this.error_description=opts.error_description}},InvalidClientException=class _InvalidClientException extends SSOOIDCServiceException{name="\
930
- InvalidClientException";$fault="client";error;error_description;constructor(opts){super({name:"InvalidClientException",$fault:"client",...opts}),Object.setPrototypeOf(this,_InvalidClientException.prototype),this.error=opts.error,this.error_description=opts.error_description}},InvalidGrantException=class _InvalidGrantException extends SSOOIDCServiceException{name="InvalidGrantException";$fault="client";error;error_description;constructor(opts){super({name:"InvalidGrantException",$fault:"client",...opts}),
931
- Object.setPrototypeOf(this,_InvalidGrantException.prototype),this.error=opts.error,this.error_description=opts.error_description}},InvalidRequestException=class _InvalidRequestException extends SSOOIDCServiceException{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(opts){super({name:"InvalidRequestException",$fault:"client",...opts}),Object.setPrototypeOf(this,_InvalidRequestException.prototype),this.error=opts.error,this.reason=opts.reason,this.error_description=
932
- opts.error_description}},InvalidScopeException=class _InvalidScopeException extends SSOOIDCServiceException{name="InvalidScopeException";$fault="client";error;error_description;constructor(opts){super({name:"InvalidScopeException",$fault:"client",...opts}),Object.setPrototypeOf(this,_InvalidScopeException.prototype),this.error=opts.error,this.error_description=opts.error_description}},SlowDownException=class _SlowDownException extends SSOOIDCServiceException{name="SlowDownException";$fault="clie\
933
- nt";error;error_description;constructor(opts){super({name:"SlowDownException",$fault:"client",...opts}),Object.setPrototypeOf(this,_SlowDownException.prototype),this.error=opts.error,this.error_description=opts.error_description}},UnauthorizedClientException=class _UnauthorizedClientException extends SSOOIDCServiceException{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(opts){super({name:"UnauthorizedClientException",$fault:"client",...opts}),Object.setPrototypeOf(
934
- this,_UnauthorizedClientException.prototype),this.error=opts.error,this.error_description=opts.error_description}},UnsupportedGrantTypeException=class _UnsupportedGrantTypeException extends SSOOIDCServiceException{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(opts){super({name:"UnsupportedGrantTypeException",$fault:"client",...opts}),Object.setPrototypeOf(this,_UnsupportedGrantTypeException.prototype),this.error=opts.error,this.error_description=opts.error_description}}}});var _ADE,_APE,_AT,_CS,_CT,_CTR,_CTRr,_CV,_ETE,_ICE,_IGE,_IRE,_ISE,_ISEn,_IT,_RT,_SDE,_UCE,_UGTE,_aT,_c,_cI,_cS,_cV,_co,_dC,_e,_eI,_ed,_gT,_h,_hE,_iT,_r,_rT,_rU,_s,_sc,_se,_tT,n0,_s_registry,SSOOIDCServiceException$,n0_registry,AccessDeniedException$,AuthorizationPendingException$,ExpiredTokenException$,InternalServerException$,InvalidClientException$,InvalidGrantException$,InvalidRequestException$,InvalidScopeException$,SlowDownException$,UnauthorizedClientException$,UnsupportedGrantTypeException$,
926
+ results)}});var cache,defaultEndpointResolver,init_endpointResolver=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js"(){init_client3();init_endpoints();init_bdd();cache=new EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),defaultEndpointResolver=(endpointParams,context={})=>cache.get(endpointParams,()=>decideEndpoint(bdd,{endpointParams,logger:context.logger}));customEndpointFunctions.aws=awsEndpointFunctions}});var SSOOIDCServiceException,init_SSOOIDCServiceException=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js"(){init_client2();SSOOIDCServiceException=class _SSOOIDCServiceException extends ServiceException{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc#SSOOIDCServiceException";constructor(options){super(options),Object.setPrototypeOf(this,_SSOOIDCServiceException.prototype)}}}});var AccessDeniedException,AuthorizationPendingException,ExpiredTokenException,InternalServerException,InvalidClientException,InvalidGrantException,InvalidRequestException,InvalidScopeException,SlowDownException,UnauthorizedClientException,UnsupportedGrantTypeException,init_errors=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js"(){init_SSOOIDCServiceException();AccessDeniedException=class _AccessDeniedException extends SSOOIDCServiceException{static shapeId="\
927
+ com.amazonaws.ssooidc#AccessDeniedException";name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(opts){super({name:"AccessDeniedException",$fault:"client",...opts}),Object.setPrototypeOf(this,_AccessDeniedException.prototype),this.error=opts.error,this.reason=opts.reason,this.error_description=opts.error_description}},AuthorizationPendingException=class _AuthorizationPendingException extends SSOOIDCServiceException{static shapeId="com.amazonaws.ssooidc#Authori\
928
+ zationPendingException";name="AuthorizationPendingException";$fault="client";error;error_description;constructor(opts){super({name:"AuthorizationPendingException",$fault:"client",...opts}),Object.setPrototypeOf(this,_AuthorizationPendingException.prototype),this.error=opts.error,this.error_description=opts.error_description}},ExpiredTokenException=class _ExpiredTokenException extends SSOOIDCServiceException{static shapeId="com.amazonaws.ssooidc#ExpiredTokenException";name="ExpiredTokenException";$fault="\
929
+ client";error;error_description;constructor(opts){super({name:"ExpiredTokenException",$fault:"client",...opts}),Object.setPrototypeOf(this,_ExpiredTokenException.prototype),this.error=opts.error,this.error_description=opts.error_description}},InternalServerException=class _InternalServerException extends SSOOIDCServiceException{static shapeId="com.amazonaws.ssooidc#InternalServerException";name="InternalServerException";$fault="server";error;error_description;constructor(opts){super({name:"Inter\
930
+ nalServerException",$fault:"server",...opts}),Object.setPrototypeOf(this,_InternalServerException.prototype),this.error=opts.error,this.error_description=opts.error_description}},InvalidClientException=class _InvalidClientException extends SSOOIDCServiceException{static shapeId="com.amazonaws.ssooidc#InvalidClientException";name="InvalidClientException";$fault="client";error;error_description;constructor(opts){super({name:"InvalidClientException",$fault:"client",...opts}),Object.setPrototypeOf(this,
931
+ _InvalidClientException.prototype),this.error=opts.error,this.error_description=opts.error_description}},InvalidGrantException=class _InvalidGrantException extends SSOOIDCServiceException{static shapeId="com.amazonaws.ssooidc#InvalidGrantException";name="InvalidGrantException";$fault="client";error;error_description;constructor(opts){super({name:"InvalidGrantException",$fault:"client",...opts}),Object.setPrototypeOf(this,_InvalidGrantException.prototype),this.error=opts.error,this.error_description=
932
+ opts.error_description}},InvalidRequestException=class _InvalidRequestException extends SSOOIDCServiceException{static shapeId="com.amazonaws.ssooidc#InvalidRequestException";name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(opts){super({name:"InvalidRequestException",$fault:"client",...opts}),Object.setPrototypeOf(this,_InvalidRequestException.prototype),this.error=opts.error,this.reason=opts.reason,this.error_description=opts.error_description}},InvalidScopeException=
933
+ class _InvalidScopeException extends SSOOIDCServiceException{static shapeId="com.amazonaws.ssooidc#InvalidScopeException";name="InvalidScopeException";$fault="client";error;error_description;constructor(opts){super({name:"InvalidScopeException",$fault:"client",...opts}),Object.setPrototypeOf(this,_InvalidScopeException.prototype),this.error=opts.error,this.error_description=opts.error_description}},SlowDownException=class _SlowDownException extends SSOOIDCServiceException{static shapeId="com.ama\
934
+ zonaws.ssooidc#SlowDownException";name="SlowDownException";$fault="client";error;error_description;constructor(opts){super({name:"SlowDownException",$fault:"client",...opts}),Object.setPrototypeOf(this,_SlowDownException.prototype),this.error=opts.error,this.error_description=opts.error_description}},UnauthorizedClientException=class _UnauthorizedClientException extends SSOOIDCServiceException{static shapeId="com.amazonaws.ssooidc#UnauthorizedClientException";name="UnauthorizedClientException";$fault="\
935
+ client";error;error_description;constructor(opts){super({name:"UnauthorizedClientException",$fault:"client",...opts}),Object.setPrototypeOf(this,_UnauthorizedClientException.prototype),this.error=opts.error,this.error_description=opts.error_description}},UnsupportedGrantTypeException=class _UnsupportedGrantTypeException extends SSOOIDCServiceException{static shapeId="com.amazonaws.ssooidc#UnsupportedGrantTypeException";name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(opts){
936
+ super({name:"UnsupportedGrantTypeException",$fault:"client",...opts}),Object.setPrototypeOf(this,_UnsupportedGrantTypeException.prototype),this.error=opts.error,this.error_description=opts.error_description}}}});var _ADE,_APE,_AT,_CS,_CT,_CTR,_CTRr,_CV,_ETE,_ICE,_IGE,_IRE,_ISE,_ISEn,_IT,_RT,_SDE,_UCE,_UGTE,_aT,_c,_cI,_cS,_cV,_co,_dC,_e,_eI,_ed,_gT,_h,_hE,_iT,_r,_rT,_rU,_s,_sc,_se,_tT,n0,_s_registry,SSOOIDCServiceException$,n0_registry,AccessDeniedException$,AuthorizationPendingException$,ExpiredTokenException$,InternalServerException$,InvalidClientException$,InvalidGrantException$,InvalidRequestException$,InvalidScopeException$,SlowDownException$,UnauthorizedClientException$,UnsupportedGrantTypeException$,
935
937
  errorTypeRegistries,AccessToken,ClientSecret,CodeVerifier,IdToken,RefreshToken,CreateTokenRequest$,CreateTokenResponse$,CreateToken$,init_schemas_0=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js"(){init_schema();init_errors();init_SSOOIDCServiceException();_ADE="AccessDeniedException",_APE="AuthorizationPendingException",_AT="AccessToken",_CS="ClientSecret",_CT="CreateToken",_CTR="CreateTokenRequest",_CTRr="CreateTokenResponse",_CV="CodeVerifier",_ETE=
936
938
  "ExpiredTokenException",_ICE="InvalidClientException",_IGE="InvalidGrantException",_IRE="InvalidRequestException",_ISE="InternalServerException",_ISEn="InvalidScopeException",_IT="IdToken",_RT="RefreshToken",_SDE="SlowDownException",_UCE="UnauthorizedClientException",_UGTE="UnsupportedGrantTypeException",_aT="accessToken",_c="client",_cI="clientId",_cS="clientSecret",_cV="codeVerifier",_co="code",_dC="deviceCode",_e="error",_eI="expiresIn",_ed="error_description",_gT="grantType",_h="http",_hE="h\
937
939
  ttpError",_iT="idToken",_r="reason",_rT="refreshToken",_rU="redirectUri",_s="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",_sc="scope",_se="server",_tT="tokenType",n0="com.amazonaws.ssooidc",_s_registry=new TypeRegistry(_s),SSOOIDCServiceException$=[-3,_s,"SSOOIDCServiceException",0,[],[]];_s_registry.registerError(SSOOIDCServiceException$,SSOOIDCServiceException);n0_registry=new TypeRegistry(n0),AccessDeniedException$=[-3,n0,_ADE,{[_e]:_c,[_hE]:400},[_e,_r,_ed],[0,0,0]];n0_registry.registerError(
@@ -970,9 +972,10 @@ push(createSmithyApiNoAuthHttpAuthOption2(authParameters)):options.push(createAw
970
972
  type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}});var k2,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,_data2,root2,r2,nodes2,bdd2,init_bdd2=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/bdd.js"(){init_endpoints();k2="ref",a2=-1,b2=!0,c2="isSet",d2="PartitionResult",e2="booleanEquals",f2="getAttr",g2={[k2]:"Endpoint"},h2={[k2]:d2},i2={},j2=[{[k2]:"Region"}],_data2={conditions:[[c2,[g2]],[c2,j2],["aws.partition",j2,d2],[e2,[{[k2]:"UseFIPS"},b2]],[e2,[{[k2]:"UseDualStack"},b2]],[e2,[{fn:f2,argv:[h2,"supportsDualStack"]},b2]],[e2,[{
971
973
  fn:f2,argv:[h2,"supportsFIPS"]},b2]],["stringEquals",[{fn:f2,argv:[h2,"name"]},"aws-us-gov"]]],results:[[a2],[a2,"Invalid Configuration: FIPS and custom endpoint are not supported"],[a2,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[g2,i2],["https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",i2],[a2,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://portal.sso.{Region}.amazonaws.com",i2],["https://portal.ss\
972
974
  o-fips.{Region}.{PartitionResult#dnsSuffix}",i2],[a2,"FIPS is enabled but this partition does not support FIPS"],["https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",i2],[a2,"DualStack is enabled but this partition does not support DualStack"],["https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",i2],[a2,"Invalid Configuration: Missing Region"]]},root2=2,r2=1e8,nodes2=new Int32Array([-1,1,-1,0,13,3,1,4,r2+12,2,5,r2+12,3,8,6,4,7,r2+11,5,r2+9,r2+10,4,11,9,6,10,r2+8,7,r2+6,r2+7,
973
- 5,12,r2+5,6,r2+4,r2+5,3,r2+1,14,4,r2+2,r2+3]),bdd2=BinaryDecisionDiagram.from(nodes2,root2,_data2.conditions,_data2.results)}});var cache2,defaultEndpointResolver2,init_endpointResolver2=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js"(){init_client3();init_endpoints();init_bdd2();cache2=new EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),defaultEndpointResolver2=(endpointParams,context={})=>cache2.get(endpointParams,()=>decideEndpoint(bdd2,{endpointParams,logger:context.logger}));customEndpointFunctions.aws=awsEndpointFunctions}});var SSOServiceException,init_SSOServiceException=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js"(){init_client2();SSOServiceException=class _SSOServiceException extends ServiceException{constructor(options){super(options),Object.setPrototypeOf(this,_SSOServiceException.prototype)}}}});var InvalidRequestException2,ResourceNotFoundException,TooManyRequestsException,UnauthorizedException,init_errors2=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js"(){init_SSOServiceException();InvalidRequestException2=class _InvalidRequestException extends SSOServiceException{name="InvalidRequestException";$fault="client";constructor(opts){super({name:"InvalidRequestException",$fault:"client",...opts}),Object.setPrototypeOf(this,_InvalidRequestException.prototype)}},
974
- ResourceNotFoundException=class _ResourceNotFoundException extends SSOServiceException{name="ResourceNotFoundException";$fault="client";constructor(opts){super({name:"ResourceNotFoundException",$fault:"client",...opts}),Object.setPrototypeOf(this,_ResourceNotFoundException.prototype)}},TooManyRequestsException=class _TooManyRequestsException extends SSOServiceException{name="TooManyRequestsException";$fault="client";constructor(opts){super({name:"TooManyRequestsException",$fault:"client",...opts}),
975
- Object.setPrototypeOf(this,_TooManyRequestsException.prototype)}},UnauthorizedException=class _UnauthorizedException extends SSOServiceException{name="UnauthorizedException";$fault="client";constructor(opts){super({name:"UnauthorizedException",$fault:"client",...opts}),Object.setPrototypeOf(this,_UnauthorizedException.prototype)}}}});var _ATT,_GRC,_GRCR,_GRCRe,_IRE2,_RC,_RNFE,_SAKT,_STT,_TMRE,_UE,_aI,_aKI,_aT2,_ai,_c2,_e2,_ex,_h2,_hE2,_hH,_hQ,_m,_rC,_rN,_rn,_s2,_sAK,_sT,_xasbt,n02,_s_registry2,SSOServiceException$,n0_registry2,InvalidRequestException$2,ResourceNotFoundException$,TooManyRequestsException$,UnauthorizedException$,errorTypeRegistries2,AccessTokenType,SecretAccessKeyType,SessionTokenType,GetRoleCredentialsRequest$,GetRoleCredentialsResponse$,RoleCredentials$,GetRoleCredentials$,init_schemas_02=__esm({"node_module\
975
+ 5,12,r2+5,6,r2+4,r2+5,3,r2+1,14,4,r2+2,r2+3]),bdd2=BinaryDecisionDiagram.from(nodes2,root2,_data2.conditions,_data2.results)}});var cache2,defaultEndpointResolver2,init_endpointResolver2=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js"(){init_client3();init_endpoints();init_bdd2();cache2=new EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),defaultEndpointResolver2=(endpointParams,context={})=>cache2.get(endpointParams,()=>decideEndpoint(bdd2,{endpointParams,logger:context.logger}));customEndpointFunctions.aws=awsEndpointFunctions}});var SSOServiceException,init_SSOServiceException=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js"(){init_client2();SSOServiceException=class _SSOServiceException extends ServiceException{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.sso#SSOServiceException";constructor(options){super(options),Object.setPrototypeOf(this,_SSOServiceException.prototype)}}}});var InvalidRequestException2,ResourceNotFoundException,TooManyRequestsException,UnauthorizedException,init_errors2=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js"(){init_SSOServiceException();InvalidRequestException2=class _InvalidRequestException extends SSOServiceException{static shapeId="com.amazonaws.sso#InvalidRequestException";name="InvalidRequestException";$fault="client";constructor(opts){super({name:"InvalidRequestException",$fault:"client",...opts}),
976
+ Object.setPrototypeOf(this,_InvalidRequestException.prototype)}},ResourceNotFoundException=class _ResourceNotFoundException extends SSOServiceException{static shapeId="com.amazonaws.sso#ResourceNotFoundException";name="ResourceNotFoundException";$fault="client";constructor(opts){super({name:"ResourceNotFoundException",$fault:"client",...opts}),Object.setPrototypeOf(this,_ResourceNotFoundException.prototype)}},TooManyRequestsException=class _TooManyRequestsException extends SSOServiceException{static shapeId="\
977
+ com.amazonaws.sso#TooManyRequestsException";name="TooManyRequestsException";$fault="client";constructor(opts){super({name:"TooManyRequestsException",$fault:"client",...opts}),Object.setPrototypeOf(this,_TooManyRequestsException.prototype)}},UnauthorizedException=class _UnauthorizedException extends SSOServiceException{static shapeId="com.amazonaws.sso#UnauthorizedException";name="UnauthorizedException";$fault="client";constructor(opts){super({name:"UnauthorizedException",$fault:"client",...opts}),
978
+ Object.setPrototypeOf(this,_UnauthorizedException.prototype)}}}});var _ATT,_GRC,_GRCR,_GRCRe,_IRE2,_RC,_RNFE,_SAKT,_STT,_TMRE,_UE,_aI,_aKI,_aT2,_ai,_c2,_e2,_ex,_h2,_hE2,_hH,_hQ,_m,_rC,_rN,_rn,_s2,_sAK,_sT,_xasbt,n02,_s_registry2,SSOServiceException$,n0_registry2,InvalidRequestException$2,ResourceNotFoundException$,TooManyRequestsException$,UnauthorizedException$,errorTypeRegistries2,AccessTokenType,SecretAccessKeyType,SessionTokenType,GetRoleCredentialsRequest$,GetRoleCredentialsResponse$,RoleCredentials$,GetRoleCredentials$,init_schemas_02=__esm({"node_module\
976
979
  s/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js"(){init_schema();init_errors2();init_SSOServiceException();_ATT="AccessTokenType",_GRC="GetRoleCredentials",_GRCR="GetRoleCredentialsRequest",_GRCRe="GetRoleCredentialsResponse",_IRE2="InvalidRequestException",_RC="RoleCredentials",_RNFE="ResourceNotFoundException",_SAKT="SecretAccessKeyType",_STT="SessionTokenType",_TMRE="TooManyRequestsException",_UE="UnauthorizedException",_aI="accountId",_aKI="accessKeyId",_aT2="accessToke\
977
980
  n",_ai="account_id",_c2="client",_e2="error",_ex="expiration",_h2="http",_hE2="httpError",_hH="httpHeader",_hQ="httpQuery",_m="message",_rC="roleCredentials",_rN="roleName",_rn="role_name",_s2="smithy.ts.sdk.synthetic.com.amazonaws.sso",_sAK="secretAccessKey",_sT="sessionToken",_xasbt="x-amz-sso_bearer_token",n02="com.amazonaws.sso",_s_registry2=new TypeRegistry(_s2),SSOServiceException$=[-3,_s2,"SSOServiceException",0,[],[]];_s_registry2.registerError(SSOServiceException$,SSOServiceException);n0_registry2=
978
981
  new TypeRegistry(n02),InvalidRequestException$2=[-3,n02,_IRE2,{[_e2]:_c2,[_hE2]:400},[_m],[0]];n0_registry2.registerError(InvalidRequestException$2,InvalidRequestException2);ResourceNotFoundException$=[-3,n02,_RNFE,{[_e2]:_c2,[_hE2]:404},[_m],[0]];n0_registry2.registerError(ResourceNotFoundException$,ResourceNotFoundException);TooManyRequestsException$=[-3,n02,_TMRE,{[_e2]:_c2,[_hE2]:429},[_m],[0]];n0_registry2.registerError(TooManyRequestsException$,TooManyRequestsException);UnauthorizedException$=
@@ -1026,11 +1029,12 @@ authParameters);let options=[];for(let scheme of authSchemes){let{name:resolvedN
1026
1029
  sigv4aDependency()==="none"&&sigv4Present)continue}else if(name.startsWith("sigv4"))schemeId="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);let createOption=createHttpAuthOptionFunctions[schemeId];if(!createOption)throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);let option=createOption(authParameters);option.schemeId=schemeId,option.signingProperties={...option.signingProperties||{},...rest,...properties},
1027
1030
  options.push(option)}return options},_defaultSTSHttpAuthSchemeProvider=authParameters=>{let options=[];return authParameters.operation==="AssumeRoleWithWebIdentity"?(options.push(createSmithyApiNoAuthHttpAuthOption3(authParameters)),options.push(createAwsAuthSigv4aHttpAuthOption(authParameters))):(options.push(createAwsAuthSigv4HttpAuthOption3(authParameters)),options.push(createAwsAuthSigv4aHttpAuthOption(authParameters))),options},defaultSTSHttpAuthSchemeProvider=createEndpointRuleSetHttpAuthSchemeProvider(
1028
1031
  defaultEndpointResolver3,_defaultSTSHttpAuthSchemeProvider,{"aws.auth#sigv4":createAwsAuthSigv4HttpAuthOption3,"aws.auth#sigv4a":createAwsAuthSigv4aHttpAuthOption,"smithy.api#noAuth":createSmithyApiNoAuthHttpAuthOption3}),resolveHttpAuthSchemeConfig3=config=>{let config_0=resolveAwsSdkSigV4Config(config),config_1=resolveAwsSdkSigV4AConfig(config_0);return Object.assign(config_1,{authSchemePreference:normalizeProvider(config.authSchemePreference??[])})}}});var resolveClientEndpointParameters3,commonParams3,init_EndpointParameters3=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js"(){resolveClientEndpointParameters3=options=>Object.assign(options,{useDualstackEndpoint:options.useDualstackEndpoint??!1,useFipsEndpoint:options.useFipsEndpoint??!1,useGlobalEndpoint:options.useGlobalEndpoint??!1,defaultSigningName:"sts"}),commonParams3={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{
1029
- type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}});var STSServiceException,init_STSServiceException=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js"(){init_client2();STSServiceException=class _STSServiceException extends ServiceException{constructor(options){super(options),Object.setPrototypeOf(this,_STSServiceException.prototype)}}}});var ExpiredTokenException2,MalformedPolicyDocumentException,PackedPolicyTooLargeException,RegionDisabledException,IDPRejectedClaimException,InvalidIdentityTokenException,IDPCommunicationErrorException,init_errors3=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js"(){init_STSServiceException();ExpiredTokenException2=class _ExpiredTokenException extends STSServiceException{name="ExpiredTokenException";$fault="client";constructor(opts){super({name:"ExpiredTokenExc\
1030
- eption",$fault:"client",...opts}),Object.setPrototypeOf(this,_ExpiredTokenException.prototype)}},MalformedPolicyDocumentException=class _MalformedPolicyDocumentException extends STSServiceException{name="MalformedPolicyDocumentException";$fault="client";constructor(opts){super({name:"MalformedPolicyDocumentException",$fault:"client",...opts}),Object.setPrototypeOf(this,_MalformedPolicyDocumentException.prototype)}},PackedPolicyTooLargeException=class _PackedPolicyTooLargeException extends STSServiceException{name="\
1031
- PackedPolicyTooLargeException";$fault="client";constructor(opts){super({name:"PackedPolicyTooLargeException",$fault:"client",...opts}),Object.setPrototypeOf(this,_PackedPolicyTooLargeException.prototype)}},RegionDisabledException=class _RegionDisabledException extends STSServiceException{name="RegionDisabledException";$fault="client";constructor(opts){super({name:"RegionDisabledException",$fault:"client",...opts}),Object.setPrototypeOf(this,_RegionDisabledException.prototype)}},IDPRejectedClaimException=
1032
- class _IDPRejectedClaimException extends STSServiceException{name="IDPRejectedClaimException";$fault="client";constructor(opts){super({name:"IDPRejectedClaimException",$fault:"client",...opts}),Object.setPrototypeOf(this,_IDPRejectedClaimException.prototype)}},InvalidIdentityTokenException=class _InvalidIdentityTokenException extends STSServiceException{name="InvalidIdentityTokenException";$fault="client";constructor(opts){super({name:"InvalidIdentityTokenException",$fault:"client",...opts}),Object.
1033
- setPrototypeOf(this,_InvalidIdentityTokenException.prototype)}},IDPCommunicationErrorException=class _IDPCommunicationErrorException extends STSServiceException{name="IDPCommunicationErrorException";$fault="client";$retryable={};constructor(opts){super({name:"IDPCommunicationErrorException",$fault:"client",...opts}),Object.setPrototypeOf(this,_IDPCommunicationErrorException.prototype)}}}});var _A,_AKI,_AR,_ARI,_ARR,_ARRs,_ARU,_ARWWI,_ARWWIR,_ARWWIRs,_Au,_C,_CA,_DS,_E,_EI,_ETE2,_IDPCEE,_IDPRCE,_IITE,_K,_MPDE,_MSTS,_P,_PA,_PAr,_PC,_PCLT,_PCr,_PDT,_PI,_PPS,_PPTLE,_Pr,_RA,_RDE,_RSN,_SAK,_SFWIT,_SI,_SN,_ST,_STS,_STU,_T,_TC,_TTK,_Ta,_V,_WIT,_a,_aKST,_aQE,_c3,_cTT,_e3,_hE3,_m2,_pDLT,_s3,_tLT,n03,_s_registry3,STSServiceException$,n0_registry3,ExpiredTokenException$2,IDPCommunicationErrorException$,IDPRejectedClaimException$,InvalidIdentityTokenException$,MalformedPolicyDocumentException$,
1032
+ type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}});var STSServiceException,init_STSServiceException=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js"(){init_client2();STSServiceException=class _STSServiceException extends ServiceException{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.sts#STSServiceException";constructor(options){super(options),Object.setPrototypeOf(this,_STSServiceException.prototype)}}}});var ExpiredTokenException2,MalformedPolicyDocumentException,PackedPolicyTooLargeException,RegionDisabledException,IDPRejectedClaimException,InvalidIdentityTokenException,IDPCommunicationErrorException,init_errors3=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js"(){init_STSServiceException();ExpiredTokenException2=class _ExpiredTokenException extends STSServiceException{static shapeId="com.amazonaws.sts#ExpiredTokenException";name="ExpiredTokenException";$fault="\
1033
+ client";constructor(opts){super({name:"ExpiredTokenException",$fault:"client",...opts}),Object.setPrototypeOf(this,_ExpiredTokenException.prototype)}},MalformedPolicyDocumentException=class _MalformedPolicyDocumentException extends STSServiceException{static shapeId="com.amazonaws.sts#MalformedPolicyDocumentException";name="MalformedPolicyDocumentException";$fault="client";constructor(opts){super({name:"MalformedPolicyDocumentException",$fault:"client",...opts}),Object.setPrototypeOf(this,_MalformedPolicyDocumentException.
1034
+ prototype)}},PackedPolicyTooLargeException=class _PackedPolicyTooLargeException extends STSServiceException{static shapeId="com.amazonaws.sts#PackedPolicyTooLargeException";name="PackedPolicyTooLargeException";$fault="client";constructor(opts){super({name:"PackedPolicyTooLargeException",$fault:"client",...opts}),Object.setPrototypeOf(this,_PackedPolicyTooLargeException.prototype)}},RegionDisabledException=class _RegionDisabledException extends STSServiceException{static shapeId="com.amazonaws.st\
1035
+ s#RegionDisabledException";name="RegionDisabledException";$fault="client";constructor(opts){super({name:"RegionDisabledException",$fault:"client",...opts}),Object.setPrototypeOf(this,_RegionDisabledException.prototype)}},IDPRejectedClaimException=class _IDPRejectedClaimException extends STSServiceException{static shapeId="com.amazonaws.sts#IDPRejectedClaimException";name="IDPRejectedClaimException";$fault="client";constructor(opts){super({name:"IDPRejectedClaimException",$fault:"client",...opts}),
1036
+ Object.setPrototypeOf(this,_IDPRejectedClaimException.prototype)}},InvalidIdentityTokenException=class _InvalidIdentityTokenException extends STSServiceException{static shapeId="com.amazonaws.sts#InvalidIdentityTokenException";name="InvalidIdentityTokenException";$fault="client";constructor(opts){super({name:"InvalidIdentityTokenException",$fault:"client",...opts}),Object.setPrototypeOf(this,_InvalidIdentityTokenException.prototype)}},IDPCommunicationErrorException=class _IDPCommunicationErrorException extends STSServiceException{static shapeId="\
1037
+ com.amazonaws.sts#IDPCommunicationErrorException";name="IDPCommunicationErrorException";$fault="client";$retryable={};constructor(opts){super({name:"IDPCommunicationErrorException",$fault:"client",...opts}),Object.setPrototypeOf(this,_IDPCommunicationErrorException.prototype)}}}});var _A,_AKI,_AR,_ARI,_ARR,_ARRs,_ARU,_ARWWI,_ARWWIR,_ARWWIRs,_Au,_C,_CA,_DS,_E,_EI,_ETE2,_IDPCEE,_IDPRCE,_IITE,_K,_MPDE,_MSTS,_P,_PA,_PAr,_PC,_PCLT,_PCr,_PDT,_PI,_PPS,_PPTLE,_Pr,_RA,_RDE,_RSN,_SAK,_SFWIT,_SI,_SN,_ST,_STS,_STU,_T,_TC,_TTK,_Ta,_V,_WIT,_a,_aKST,_aQE,_c3,_cTT,_e3,_hE3,_m2,_pDLT,_s3,_tLT,n03,_s_registry3,STSServiceException$,n0_registry3,ExpiredTokenException$2,IDPCommunicationErrorException$,IDPRejectedClaimException$,InvalidIdentityTokenException$,MalformedPolicyDocumentException$,
1034
1038
  PackedPolicyTooLargeException$,RegionDisabledException$,errorTypeRegistries3,accessKeySecretType,clientTokenType,AssumedRoleUser$,AssumeRoleRequest$,AssumeRoleResponse$,AssumeRoleWithWebIdentityRequest$,AssumeRoleWithWebIdentityResponse$,Credentials$,PolicyDescriptorType$,ProvidedContext$,Tag$,policyDescriptorListType,ProvidedContextsListType,tagListType,AssumeRole$,AssumeRoleWithWebIdentity$,init_schemas_03=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js"(){
1035
1039
  init_schema();init_errors3();init_STSServiceException();_A="Arn",_AKI="AccessKeyId",_AR="AssumeRole",_ARI="AssumedRoleId",_ARR="AssumeRoleRequest",_ARRs="AssumeRoleResponse",_ARU="AssumedRoleUser",_ARWWI="AssumeRoleWithWebIdentity",_ARWWIR="AssumeRoleWithWebIdentityRequest",_ARWWIRs="AssumeRoleWithWebIdentityResponse",_Au="Audience",_C="Credentials",_CA="ContextAssertion",_DS="DurationSeconds",_E="Expiration",_EI="ExternalId",_ETE2="ExpiredTokenException",_IDPCEE="IDPCommunicationErrorException",
1036
1040
  _IDPRCE="IDPRejectedClaimException",_IITE="InvalidIdentityTokenException",_K="Key",_MPDE="MalformedPolicyDocumentException",_MSTS="MinimumSessionTokenSize",_P="Policy",_PA="PolicyArns",_PAr="ProviderArn",_PC="ProvidedContexts",_PCLT="ProvidedContextsListType",_PCr="ProvidedContext",_PDT="PolicyDescriptorType",_PI="ProviderId",_PPS="PackedPolicySize",_PPTLE="PackedPolicyTooLargeException",_Pr="Provider",_RA="RoleArn",_RDE="RegionDisabledException",_RSN="RoleSessionName",_SAK="SecretAccessKey",_SFWIT=
@@ -1077,9 +1081,10 @@ gnin.c2shome.ic.gov",p2],["https://{Region}.signin.sc2shome.sgov.gov",p2],["http
1077
1081
  custom endpoint are not supported"],[k4,p2],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",p2],[a4,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",p2],[a4,"FIPS is enabled but this partition does not support FIPS"],[j4,p2],[a4,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",p2],[a4,"Invalid Configuration:\
1078
1082
  Missing Region"]]},root4=2,r4=1e8,nodes4=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,r4+27,6,r4+4,r4+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,r4+7,13,10,r4+8,14,12,r4+9,15,13,r4+10,16,14,r4+11,17,15,r4+12,18,16,r4+13,r4+16,6,r4+5,20,7,21,r4+6,17,r4+24,r4+25,6,r4+4,23,7,27,24,9,r4+14,25,10,r4+15,26,11,r4+22,r4+23,11,28,r4+21,17,r4+20,r4+21,2,35,30,3,39,31,4,32,r4+27,6,r4+4,33,7,r4+27,34,9,r4+14,r4+27,3,39,36,4,38,37,7,r4+18,r4+19,6,r4+4,r4+17,5,r4+1,40,8,r4+2,r4+3]),bdd4=BinaryDecisionDiagram.
1079
1083
  from(nodes4,root4,_data4.conditions,_data4.results)}});var cache4,defaultEndpointResolver4,init_endpointResolver4=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js"(){init_client3();init_endpoints();init_bdd4();cache4=new EndpointCache({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),defaultEndpointResolver4=(endpointParams,context={})=>cache4.get(endpointParams,()=>decideEndpoint(bdd4,{endpointParams,logger:context.logger}));customEndpointFunctions.
1080
- aws=awsEndpointFunctions}});var SigninServiceException,init_SigninServiceException=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js"(){init_client2();SigninServiceException=class _SigninServiceException extends ServiceException{constructor(options){super(options),Object.setPrototypeOf(this,_SigninServiceException.prototype)}}}});var AccessDeniedException2,InternalServerException2,TooManyRequestsError,ValidationException,init_errors4=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js"(){init_SigninServiceException();AccessDeniedException2=class _AccessDeniedException extends SigninServiceException{name="AccessDeniedException";$fault="client";error;constructor(opts){super({name:"AccessDeniedException",$fault:"client",...opts}),Object.setPrototypeOf(this,_AccessDeniedException.prototype),
1081
- this.error=opts.error}},InternalServerException2=class _InternalServerException extends SigninServiceException{name="InternalServerException";$fault="server";error;constructor(opts){super({name:"InternalServerException",$fault:"server",...opts}),Object.setPrototypeOf(this,_InternalServerException.prototype),this.error=opts.error}},TooManyRequestsError=class _TooManyRequestsError extends SigninServiceException{name="TooManyRequestsError";$fault="client";error;constructor(opts){super({name:"TooMan\
1082
- yRequestsError",$fault:"client",...opts}),Object.setPrototypeOf(this,_TooManyRequestsError.prototype),this.error=opts.error}},ValidationException=class _ValidationException extends SigninServiceException{name="ValidationException";$fault="client";error;constructor(opts){super({name:"ValidationException",$fault:"client",...opts}),Object.setPrototypeOf(this,_ValidationException.prototype),this.error=opts.error}}}});var _ADE2,_AT2,_COAT,_COATR,_COATRB,_COATRBr,_COATRr,_COATWIAM,_COATWIAMR,_COATWIAMRr,_ISE2,_OAAT,_RT2,_TMRE2,_VE,_aKI2,_aT3,_at,_c4,_cI2,_cV2,_co2,_e4,_eI2,_ei,_gT2,_gt,_h3,_hE4,_iT2,_jN,_m3,_r2,_rT2,_rU2,_s4,_sAK2,_sT2,_se2,_tI,_tO,_tT2,_tt,n04,_s_registry4,SigninServiceException$,n0_registry4,AccessDeniedException$2,InternalServerException$2,TooManyRequestsError$,ValidationException$,errorTypeRegistries4,OAuthAccessToken,RefreshToken2,AccessToken$,CreateOAuth2TokenRequest$,CreateOAuth2TokenRequestBody$,
1084
+ aws=awsEndpointFunctions}});var SigninServiceException,init_SigninServiceException=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js"(){init_client2();SigninServiceException=class _SigninServiceException extends ServiceException{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.signin#SigninServiceException";constructor(options){super(options),Object.setPrototypeOf(this,_SigninServiceException.prototype)}}}});var AccessDeniedException2,InternalServerException2,TooManyRequestsError,ValidationException,init_errors4=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js"(){init_SigninServiceException();AccessDeniedException2=class _AccessDeniedException extends SigninServiceException{static shapeId="com.amazonaws.signin#AccessDeniedException";name="AccessDeniedException";$fault="client";error;constructor(opts){super({name:"AccessDeniedException",$fault:"client",...opts}),
1085
+ Object.setPrototypeOf(this,_AccessDeniedException.prototype),this.error=opts.error}},InternalServerException2=class _InternalServerException extends SigninServiceException{static shapeId="com.amazonaws.signin#InternalServerException";name="InternalServerException";$fault="server";error;constructor(opts){super({name:"InternalServerException",$fault:"server",...opts}),Object.setPrototypeOf(this,_InternalServerException.prototype),this.error=opts.error}},TooManyRequestsError=class _TooManyRequestsError extends SigninServiceException{static shapeId="\
1086
+ com.amazonaws.signin#TooManyRequestsError";name="TooManyRequestsError";$fault="client";error;constructor(opts){super({name:"TooManyRequestsError",$fault:"client",...opts}),Object.setPrototypeOf(this,_TooManyRequestsError.prototype),this.error=opts.error}},ValidationException=class _ValidationException extends SigninServiceException{static shapeId="com.amazonaws.signin#ValidationException";name="ValidationException";$fault="client";error;constructor(opts){super({name:"ValidationException",$fault:"\
1087
+ client",...opts}),Object.setPrototypeOf(this,_ValidationException.prototype),this.error=opts.error}}}});var _ADE2,_AT2,_COAT,_COATR,_COATRB,_COATRBr,_COATRr,_COATWIAM,_COATWIAMR,_COATWIAMRr,_ISE2,_OAAT,_RT2,_TMRE2,_VE,_aKI2,_aT3,_at,_c4,_cI2,_cV2,_co2,_e4,_eI2,_ei,_gT2,_gt,_h3,_hE4,_iT2,_jN,_m3,_r2,_rT2,_rU2,_s4,_sAK2,_sT2,_se2,_tI,_tO,_tT2,_tt,n04,_s_registry4,SigninServiceException$,n0_registry4,AccessDeniedException$2,InternalServerException$2,TooManyRequestsError$,ValidationException$,errorTypeRegistries4,OAuthAccessToken,RefreshToken2,AccessToken$,CreateOAuth2TokenRequest$,CreateOAuth2TokenRequestBody$,
1083
1088
  CreateOAuth2TokenResponse$,CreateOAuth2TokenResponseBody$,CreateOAuth2TokenWithIAMRequest$,CreateOAuth2TokenWithIAMResponse$,CreateOAuth2Token$,CreateOAuth2TokenWithIAM$,init_schemas_04=__esm({"node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js"(){init_schema();init_errors4();init_SigninServiceException();_ADE2="AccessDeniedException",_AT2="AccessToken",_COAT="CreateOAuth2Token",_COATR="CreateOAuth2TokenRequest",_COATRB="CreateOAuth2TokenRequestBody",_COATRBr="Cr\
1084
1089
  eateOAuth2TokenResponseBody",_COATRr="CreateOAuth2TokenResponse",_COATWIAM="CreateOAuth2TokenWithIAM",_COATWIAMR="CreateOAuth2TokenWithIAMRequest",_COATWIAMRr="CreateOAuth2TokenWithIAMResponse",_ISE2="InternalServerException",_OAAT="OAuthAccessToken",_RT2="RefreshToken",_TMRE2="TooManyRequestsError",_VE="ValidationException",_aKI2="accessKeyId",_aT3="accessToken",_at="access_token",_c4="client",_cI2="clientId",_cV2="codeVerifier",_co2="code",_e4="error",_eI2="expiresIn",_ei="expires_in",_gT2="gr\
1085
1090
  antType",_gt="grant_type",_h3="http",_hE4="httpError",_iT2="idToken",_jN="jsonName",_m3="message",_r2="resource",_rT2="refreshToken",_rU2="redirectUri",_s4="smithy.ts.sdk.synthetic.com.amazonaws.signin",_sAK2="secretAccessKey",_sT2="sessionToken",_se2="server",_tI="tokenInput",_tO="tokenOutput",_tT2="tokenType",_tt="token_type",n04="com.amazonaws.signin",_s_registry4=new TypeRegistry(_s4),SigninServiceException$=[-3,_s4,"SigninServiceException",0,[],[]];_s_registry4.registerError(SigninServiceException$,
@@ -1428,7 +1433,7 @@ hostname=stripBrackets(parsedUrl.hostname||parsedUrl.host.replace(/:\d*$/,"")),p
1428
1433
  URL.";function resolveHttpProxyUrlForTarget(targetUrl,env2){let proxy=getProxyForUrl(targetUrl,env2);if(!proxy)return;let proxyUrl;try{proxyUrl=new URL(proxy)}catch(error2){throw new Error(`Invalid proxy URL ${JSON.stringify(proxy)}: ${error2 instanceof Error?error2.message:String(error2)}`)}if(proxyUrl.protocol!=="http:"&&proxyUrl.protocol!=="https:")throw new Error(`${UNSUPPORTED_PROXY_PROTOCOL_MESSAGE} Got ${proxyUrl.protocol}`);return proxyUrl}var MAX_SEQUENCE=(1n<<41n)-1n,lastOrdinaryTimestamp=-1,sequence;function uuidv7(timestampMs){let requestedTimestamp=timestampMs??Date.now();if(!Number.isInteger(requestedTimestamp)||requestedTimestamp<0||requestedTimestamp>0xffffffffffff)throw new RangeError(`UUIDv7 timestamp must be an integer between 0 and ${0xffffffffffff}`);let effectiveTimestamp=timestampMs===void 0?Math.max(requestedTimestamp,lastOrdinaryTimestamp):timestampMs;timestampMs===void 0&&(lastOrdinaryTimestamp=effectiveTimestamp);
1429
1434
  let bytes=new Uint8Array(16);if(globalThis.crypto.getRandomValues(bytes),sequence===void 0)sequence=BigInt(bytes[1])<<32n|BigInt(bytes[2])<<24n|BigInt(bytes[3])<<16n|BigInt(bytes[4])<<8n|BigInt(bytes[5]);else{if(sequence===MAX_SEQUENCE)throw new RangeError("UUIDv7 generator sequence exhausted");sequence++}let timestamp=BigInt(effectiveTimestamp);for(let index=5;index>=0;index--)bytes[index]=Number(timestamp>>BigInt((5-index)*8))&255;bytes[6]=112|Number(sequence>>37n&0x0fn),bytes[7]=Number(sequence>>
1430
1435
  29n&0xffn),bytes[8]=128|Number(sequence>>23n&0x3fn),bytes[9]=Number(sequence>>15n&0xffn),bytes[10]=Number(sequence>>7n&0xffn),bytes[11]=Number((sequence&0x7fn)<<1n)|bytes[11]&1;let hex=Array.from(bytes,byte=>byte.toString(16).padStart(2,"0"));return`${hex.slice(0,4).join("")}-${hex.slice(4,6).join("")}-${hex.slice(6,8).join("")}-${hex.slice(8,10).join("")}-${hex.slice(10).join("")}`}var noop=async()=>{};function createRequestObserver(options,info){let onRequest=options?.onRequest;if(!onRequest)return noop;let requestId=uuidv7(),submissionNumber=0;return async(body,overrides)=>{submissionNumber++;let value=Object.freeze({requestId,submissionId:uuidv7(),submissionNumber,api:info.api,provider:info.provider,model:info.model,operation:overrides?.operation??info.operation,transport:overrides?.transport??"http",representation:overrides?.representation??"json-body",body});try{await onRequest(
1431
- value)}catch{}}}function sanitizeSurrogates(text){return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"")}var UnsupportedStrictJsonSchemaError=class extends Error{},UNSUPPORTED_STRICT_SCHEMA_KEYS=["$ref","$defs","definitions","allOf","oneOf","patternProperties","dependentSchemas","dependencies","unevaluatedProperties","propertyNames","contains","prefixItems","not","if","then","else"];function isJsonSchemaObject(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function isStructuredSchema(schema){if(!isJsonSchemaObject(schema))return!1;let types=typeof schema.type=="string"?[schema.
1436
+ value)}catch{}}}function sanitizeSurrogates(text){return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"")}function hasIncompleteUsage(required,optional=[]){return[...required,...optional.filter(value=>value!==void 0)].some(value=>typeof value!="number"||!Number.isSafeInteger(value)||value<0)}var UnsupportedStrictJsonSchemaError=class extends Error{},UNSUPPORTED_STRICT_SCHEMA_KEYS=["$ref","$defs","definitions","allOf","oneOf","patternProperties","dependentSchemas","dependencies","unevaluatedProperties","propertyNames","contains","prefixItems","not","if","then","else"];function isJsonSchemaObject(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function isStructuredSchema(schema){if(!isJsonSchemaObject(schema))return!1;let types=typeof schema.type=="string"?[schema.
1432
1437
  type]:Array.isArray(schema.type)?schema.type:[];return types.includes("object")||types.includes("array")||schema.properties!==void 0||schema.items!==void 0}function schemaAllowsNull(schema){return isJsonSchemaObject(schema)?schema.type==="null"||Array.isArray(schema.type)&&schema.type.includes("null")||schema.const===null||Array.isArray(schema.enum)&&schema.enum.includes(null)?!0:Array.isArray(schema.anyOf)&&schema.anyOf.some(variant=>schemaAllowsNull(variant)):!1}function makeJsonSchemaNodeStrict(schema,isUnsupportedKeyword){
1433
1438
  if(!isJsonSchemaObject(schema))throw new UnsupportedStrictJsonSchemaError("boolean schemas are unsupported");for(let key of UNSUPPORTED_STRICT_SCHEMA_KEYS)if(schema[key]!==void 0)throw new UnsupportedStrictJsonSchemaError(`${key} schemas are unsupported`);if(isUnsupportedKeyword){for(let[key,value]of Object.entries(schema))if(isUnsupportedKeyword(key,value))throw new UnsupportedStrictJsonSchemaError(`${key}: ${JSON.stringify(value)} is unsupported`)}if(schema.anyOf!==void 0){if(!Array.isArray(schema.
1434
1439
  anyOf)||schema.anyOf.length===0)throw new UnsupportedStrictJsonSchemaError("anyOf must contain at least one schema");for(let variant of schema.anyOf){if(isStructuredSchema(variant))throw new UnsupportedStrictJsonSchemaError("object and array unions are unsupported");makeJsonSchemaNodeStrict(variant,isUnsupportedKeyword)}}if(schema.items!==void 0){if(Array.isArray(schema.items))throw new UnsupportedStrictJsonSchemaError("tuple schemas are unsupported");makeJsonSchemaNodeStrict(schema.items,isUnsupportedKeyword)}
@@ -1450,10 +1455,10 @@ content==null?{...msg,content:[]}:msg),transformed=downgradeUnsupportedImages(no
1450
1455
  content.flatMap(block=>{if(block.type==="thinking")return block.redacted?isSameModel?block:[]:isSameModel&&block.thinkingSignature?block:!block.thinking||block.thinking.trim()===""?[]:isSameModel?block:{type:"text",text:block.thinking};if(block.type==="text")return isSameModel?block:{type:"text",text:block.text};if(block.type==="toolCall"){let toolCall=block,normalizedToolCall=toolCall;if(!isSameModel&&toolCall.thoughtSignature&&(normalizedToolCall={...toolCall},delete normalizedToolCall.thoughtSignature),
1451
1456
  !isSameModel&&normalizeToolCallId2){let normalizedId=normalizeToolCallId2(toolCall.id,model,assistantMsg);normalizedId!==toolCall.id&&(toolCallIdMap.set(toolCall.id,normalizedId),normalizedToolCall={...normalizedToolCall,id:normalizedId})}return normalizedToolCall}return block});return{...assistantMsg,content:transformedContent}}return msg}),result=[],pendingToolCalls=[],existingToolResultIds=new Set,heldSystemMessages=[],closePendingToolCalls=()=>{if(pendingToolCalls.length>0){for(let tc of pendingToolCalls)
1452
1457
  existingToolResultIds.has(tc.id)||result.push({role:"toolResult",toolCallId:tc.id,toolName:tc.name,content:[{type:"text",text:"No result provided"}],isError:!0,timestamp:Date.now()});pendingToolCalls=[],existingToolResultIds=new Set}result.push(...heldSystemMessages),heldSystemMessages.length=0};for(let i5=0;i5<transformed.length;i5++){let msg=transformed[i5];if(msg.role==="assistant"){closePendingToolCalls();let assistantMsg=msg;if(assistantMsg.stopReason==="error"||assistantMsg.stopReason==="a\
1453
- borted")continue;let toolCalls=assistantMsg.content.filter(b5=>b5.type==="toolCall");toolCalls.length>0&&(pendingToolCalls=toolCalls,existingToolResultIds=new Set),result.push(msg)}else msg.role==="toolResult"?(existingToolResultIds.add(msg.toolCallId),result.push(msg)):msg.role==="system"?pendingToolCalls.length>0?heldSystemMessages.push(msg):result.push(msg):(msg.role==="user"&&closePendingToolCalls(),result.push(msg))}return closePendingToolCalls(),result}var EMPTY_TEXT_PLACEHOLDER="<empty>",THINKING_BINDING_CONTROLS_BETA="thinking-binding-controls-2026-08-01",REDACTED_THINKING_PLACEHOLDER="[Reasoning redacted]",stream=(model,context,options={})=>{let stream2=new AssistantMessageEventStream,normalizedContext=collapseSystemMessages(context);return(async()=>{let output={role:"assistant",content:[],api:"bedrock-converse-stream",provider:model.provider,model:model.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,
1454
- cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()},blocks=output.content,optionsProfile=options.profile||options.env?.AWS_PROFILE,config={profile:optionsProfile||getProviderEnvValue("AWS_PROFILE",options.env)},configuredRegion=getConfiguredBedrockRegion(options),hasAmbientConfiguredProfile=!!getProviderEnvValue("AWS_PROFILE"),endpointRegion=getStandardBedrockEndpointRegion(model.baseUrl),useExplicitEndpoint=shouldUseExplicitBedrockEndpoint(model.baseUrl,configuredRegion,
1455
- hasAmbientConfiguredProfile);useExplicitEndpoint&&(config.endpoint=model.baseUrl);let skipAuth=getProviderEnvValue("AWS_BEDROCK_SKIP_AUTH",options.env)==="1",bearerToken=options.bearerToken||options.apiKey||getProviderEnvValue("AWS_BEARER_TOKEN_BEDROCK",options.env)||void 0,useBearerToken=bearerToken!==void 0&&!skipAuth;if(typeof process<"u"&&(process.versions?.node||process.versions?.bun)){let arnRegionMatch=model.id.match(/^arn:aws(?:-[a-z0-9-]+)?:bedrock:([a-z0-9-]+):/);arnRegionMatch?config.
1456
- region=arnRegionMatch[1]:configuredRegion?config.region=configuredRegion:endpointRegion&&useExplicitEndpoint?config.region=endpointRegion:hasAmbientConfiguredProfile||(config.region="us-east-1"),skipAuth&&(config.credentials={accessKeyId:"dummy-access-key",secretAccessKey:"dummy-secret-key"});let credentials=getConfiguredBedrockCredentials(options.env);!skipAuth&&credentials&&!optionsProfile&&(config.credentials=credentials);let proxyUrl=shouldBypassBedrockProxy(model.baseUrl)?void 0:resolveHttpProxyUrlForTarget(
1458
+ borted")continue;let toolCalls=assistantMsg.content.filter(b5=>b5.type==="toolCall");toolCalls.length>0&&(pendingToolCalls=toolCalls,existingToolResultIds=new Set),result.push(msg)}else msg.role==="toolResult"?(existingToolResultIds.add(msg.toolCallId),result.push(msg)):msg.role==="system"?pendingToolCalls.length>0?heldSystemMessages.push(msg):result.push(msg):(msg.role==="user"&&closePendingToolCalls(),result.push(msg))}return closePendingToolCalls(),result}var EMPTY_TEXT_PLACEHOLDER="<empty>",THINKING_BINDING_CONTROLS_BETA="thinking-binding-controls-2026-08-01",REDACTED_THINKING_PLACEHOLDER="[Reasoning redacted]",stream=(model,context,options={})=>{let stream2=new AssistantMessageEventStream,normalizedContext=collapseSystemMessages(context);return(async()=>{let output={role:"assistant",content:[],api:"bedrock-converse-stream",provider:model.provider,model:model.id,usage:{usageIncomplete:!0,input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{
1459
+ input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()},blocks=output.content,optionsProfile=options.profile||options.env?.AWS_PROFILE,config={profile:optionsProfile||getProviderEnvValue("AWS_PROFILE",options.env)},configuredRegion=getConfiguredBedrockRegion(options),hasAmbientConfiguredProfile=!!getProviderEnvValue("AWS_PROFILE"),endpointRegion=getStandardBedrockEndpointRegion(model.baseUrl),useExplicitEndpoint=shouldUseExplicitBedrockEndpoint(model.baseUrl,
1460
+ configuredRegion,hasAmbientConfiguredProfile);useExplicitEndpoint&&(config.endpoint=model.baseUrl);let skipAuth=getProviderEnvValue("AWS_BEDROCK_SKIP_AUTH",options.env)==="1",bearerToken=options.bearerToken||options.apiKey||getProviderEnvValue("AWS_BEARER_TOKEN_BEDROCK",options.env)||void 0,useBearerToken=bearerToken!==void 0&&!skipAuth;if(typeof process<"u"&&(process.versions?.node||process.versions?.bun)){let arnRegionMatch=model.id.match(/^arn:aws(?:-[a-z0-9-]+)?:bedrock:([a-z0-9-]+):/);arnRegionMatch?
1461
+ config.region=arnRegionMatch[1]:configuredRegion?config.region=configuredRegion:endpointRegion&&useExplicitEndpoint?config.region=endpointRegion:hasAmbientConfiguredProfile||(config.region="us-east-1"),skipAuth&&(config.credentials={accessKeyId:"dummy-access-key",secretAccessKey:"dummy-secret-key"});let credentials=getConfiguredBedrockCredentials(options.env);!skipAuth&&credentials&&!optionsProfile&&(config.credentials=credentials);let proxyUrl=shouldBypassBedrockProxy(model.baseUrl)?void 0:resolveHttpProxyUrlForTarget(
1457
1462
  model.baseUrl,options.env);proxyUrl?config.requestHandler=new import_node_http_handler5.NodeHttpHandler({httpAgent:new HttpProxyAgent(proxyUrl),httpsAgent:new HttpsProxyAgent(proxyUrl)}):shouldUseBedrockHttp1Handler(model.baseUrl,options.env)&&(config.requestHandler=new import_node_http_handler5.NodeHttpHandler)}else config.region=configuredRegion||(endpointRegion&&useExplicitEndpoint?endpointRegion:void 0)||"us-east-1";useBearerToken&&(config.token={token:bearerToken},config.authSchemePreference=
1458
1463
  ["httpBearerAuth"]);let responseRequestId,client;try{let supportsStrictMode=model.compat?.supportsStrictMode??!1;client=new import_client_bedrock_runtime.BedrockRuntimeClient(config);let observedRawResponse=!1;options.onResponse&&addResponseHeadersMiddleware(client,options.onResponse,model,()=>{observedRawResponse=!0});let customHeaders=providerHeadersToRecord(options.headers);customHeaders&&addCustomHeadersMiddleware(client,customHeaders);let cacheRetention=resolveCacheRetention(options.cacheRetention,
1459
1464
  options.env),inferenceMaxTokens=options.maxTokens??(isAnthropicClaudeModel(model)?model.maxTokens:void 0),initialSystemMessage=getInitialSystemMessage(normalizedContext.messages),initialSystemPrompt=initialSystemMessage?getSystemMessageText(initialSystemMessage):void 0,commandInput={modelId:model.id,messages:convertMessages(normalizedContext,model,cacheRetention,options.env),system:buildSystemPrompt(initialSystemPrompt,model,cacheRetention,options.env),inferenceConfig:{...inferenceMaxTokens!==void 0&&
@@ -1477,30 +1482,31 @@ let contentBlockIndex=event.contentBlockIndex,delta=event.delta,index=blocks.fin
1477
1482
  toolUse&&block?.type==="toolCall")block.partialJson=(block.partialJson||"")+(delta.toolUse.input||""),block.arguments=parseStreamingJson(block.partialJson),stream2.push({type:"toolcall_delta",contentIndex:index,delta:delta.toolUse.input||"",partial:output});else if(delta?.reasoningContent){let thinkingBlock=block,thinkingIndex=index;if(!thinkingBlock){let newBlock={type:"thinking",thinking:"",thinkingSignature:"",index:contentBlockIndex};output.content.push(newBlock),thinkingIndex=blocks.length-
1478
1483
  1,thinkingBlock=blocks[thinkingIndex],stream2.push({type:"thinking_start",contentIndex:thinkingIndex,partial:output})}thinkingBlock?.type==="thinking"&&(delta.reasoningContent.text&&(thinkingBlock.thinking+=delta.reasoningContent.text,stream2.push({type:"thinking_delta",contentIndex:thinkingIndex,delta:delta.reasoningContent.text,partial:output})),delta.reasoningContent.signature&&!thinkingBlock.redacted&&(thinkingBlock.thinkingSignature=(thinkingBlock.thinkingSignature||"")+delta.reasoningContent.
1479
1484
  signature),delta.reasoningContent.redactedContent?.length&&(thinkingBlock.redacted||(thinkingBlock.redacted=!0,thinkingBlock.thinkingSignature="",thinkingBlock.thinking+=REDACTED_THINKING_PLACEHOLDER,stream2.push({type:"thinking_delta",contentIndex:thinkingIndex,delta:REDACTED_THINKING_PLACEHOLDER,partial:output})),thinkingBlock.redactedChunks??=[],thinkingBlock.redactedChunks.push(delta.reasoningContent.redactedContent)))}}function flushRedactedContent(block){block.type!=="thinking"||!block.redactedChunks||
1480
- (block.thinkingSignature=bytesToBase64(block.redactedChunks),delete block.redactedChunks)}function finalizeStreamingBlock(block){delete block.index,delete block.partialJson,flushRedactedContent(block)}function handleMetadata(event,model,output){event.usage&&(output.usage.input=event.usage.inputTokens||0,output.usage.output=event.usage.outputTokens||0,output.usage.cacheRead=event.usage.cacheReadInputTokens||0,output.usage.cacheWrite=event.usage.cacheWriteInputTokens||0,output.usage.cacheWrite1h=event.
1481
- usage.cacheDetails?.reduce((total,detail)=>total+(detail.ttl===import_client_bedrock_runtime.CacheTTL.ONE_HOUR?detail.inputTokens??0:0),0),output.usage.totalTokens=event.usage.totalTokens||output.usage.input+output.usage.output,calculateCost(model,output.usage))}function handleContentBlockStop(event,blocks,output,stream2){let index=blocks.findIndex(b5=>b5.index===event.contentBlockIndex),block=blocks[index];if(block)switch(delete block.index,block.type){case"text":stream2.push({type:"text_end",contentIndex:index,
1482
- content:block.text,partial:output});break;case"thinking":flushRedactedContent(block),stream2.push({type:"thinking_end",contentIndex:index,content:block.thinking,partial:output});break;case"toolCall":block.arguments=parseStreamingJson(block.partialJson),delete block.partialJson,stream2.push({type:"toolcall_end",contentIndex:index,toolCall:block,partial:output});break}}function getModelMatchCandidates(modelId,modelName){return(modelName?[modelId,modelName]:[modelId]).flatMap(value=>{let lower=value.
1483
- toLowerCase();return[lower,lower.replace(/[\s_.:]+/g,"-")]})}function supportsAdaptiveThinking(modelId,modelName){return getModelMatchCandidates(modelId,modelName).some(s2=>s2.includes("opus-4-6")||s2.includes("opus-4-7")||s2.includes("opus-4-8")||s2.includes("opus-5")||s2.includes("sonnet-4-6")||s2.includes("sonnet-5")||s2.includes("haiku-5")||s2.includes("fable-5"))}function supportsNativeXhighEffort(model){return getModelMatchCandidates(model.id,model.name).some(s2=>s2.includes("opus-4-7")||s2.
1484
- includes("opus-4-8")||s2.includes("opus-5")||s2.includes("sonnet-5")||s2.includes("haiku-5")||s2.includes("fable-5"))}function supportsThinkingBlockBinding(model){return getModelMatchCandidates(model.id,model.name).some(s2=>s2.includes("opus-4-7")||s2.includes("opus-4-8")||s2.includes("opus-5")||s2.includes("sonnet-5")||s2.includes("haiku-5")||s2.includes("fable-5"))}function mapThinkingLevelToEffort(model,level){if(level==="xhigh"&&supportsNativeXhighEffort(model))return"xhigh";let mapped=level?
1485
- model.thinkingLevelMap?.[level]:void 0;if(typeof mapped=="string")return mapped;switch(level){case"minimal":case"low":return"low";case"medium":return"medium";case"high":return"high";default:return"high"}}function resolveCacheRetention(cacheRetention,env2){return cacheRetention||(getProviderEnvValue("HUMAIN_TERMINAL_CACHE_RETENTION",env2)==="long"||getProviderEnvValue("PI_CACHE_RETENTION",env2)==="long"?"long":"short")}function isAnthropicClaudeModel(model){let id=model.id.toLowerCase(),name=model.
1486
- name?.toLowerCase()??"";return id.includes("anthropic.claude")||id.includes("anthropic/claude")||name.includes("anthropic.claude")||name.includes("anthropic/claude")||name.includes("claude")}function supportsPromptCaching(model,env2){let candidates=getModelMatchCandidates(model.id,model.name);return candidates.some(s2=>s2.includes("claude"))?!!(candidates.some(s2=>s2.includes("fable-5")||s2.includes("opus-5")||s2.includes("sonnet-5")||s2.includes("haiku-5"))||candidates.some(s2=>s2.includes("-4-"))||
1487
- candidates.some(s2=>s2.includes("claude-3-7-sonnet"))||candidates.some(s2=>s2.includes("claude-3-5-haiku"))):getProviderEnvValue("AWS_BEDROCK_FORCE_CACHE",env2)==="1"}function supportsThinkingSignature(model){return isAnthropicClaudeModel(model)}function buildSystemPrompt(systemPrompt,model,cacheRetention,env2){if(!systemPrompt)return;let blocks=[{text:sanitizeSurrogates(systemPrompt)}];return cacheRetention!=="none"&&supportsPromptCaching(model,env2)&&blocks.push({cachePoint:{type:import_client_bedrock_runtime.CachePointType.
1488
- DEFAULT,...cacheRetention==="long"?{ttl:import_client_bedrock_runtime.CacheTTL.ONE_HOUR}:{}}}),blocks}function normalizeToolCallId(id){let sanitized=id.replace(/[^a-zA-Z0-9_-]/g,"_");return sanitized.length>64?sanitized.slice(0,64):sanitized}function createNonBlankTextBlock(text){let sanitized=sanitizeSurrogates(text);return sanitized.trim().length===0?void 0:{text:sanitized}}function createRequiredTextBlock(text){return createNonBlankTextBlock(text)??{text:EMPTY_TEXT_PLACEHOLDER}}function sanitizeBedrockDocument(value){
1489
- return Array.isArray(value)?value.map(sanitizeBedrockDocument):value!==null&&typeof value=="object"?Object.fromEntries(Object.entries(value).filter(([key])=>key.length>0).map(([key,nestedValue])=>[key,sanitizeBedrockDocument(nestedValue)])):value}function convertToolResultContent(content){let result=[];for(let c5 of content)if(c5.type==="image")result.push({image:createImageBlock(c5.mimeType,c5.data)});else{let textBlock=createNonBlankTextBlock(c5.text);textBlock&&result.push(textBlock)}return result.
1490
- length===0&&result.push({text:EMPTY_TEXT_PLACEHOLDER}),result}function convertMessages(context,model,cacheRetention,env2){let result=[],transformedMessages=transformMessages(withoutInitialSystemMessage(context.messages),model,normalizeToolCallId);for(let i5=0;i5<transformedMessages.length;i5++){let m3=transformedMessages[i5];switch(m3.role){case"user":{let content=[];if(typeof m3.content=="string")content.push(createRequiredTextBlock(m3.content));else{for(let c5 of m3.content)switch(c5.type){case"\
1491
- text":{let textBlock=createNonBlankTextBlock(c5.text);textBlock&&content.push(textBlock);break}case"image":content.push({image:createImageBlock(c5.mimeType,c5.data)});break;default:continue}content.length===0&&content.push({text:EMPTY_TEXT_PLACEHOLDER})}result.push({role:import_client_bedrock_runtime.ConversationRole.USER,content});break}case"assistant":{if(m3.content.length===0)continue;let contentBlocks=[];for(let c5 of m3.content)switch(c5.type){case"text":{let textBlock=createNonBlankTextBlock(
1492
- c5.text);if(!textBlock)continue;contentBlocks.push(textBlock);break}case"toolCall":contentBlocks.push({toolUse:{toolUseId:c5.id,name:c5.name,input:sanitizeBedrockDocument(c5.arguments)}});break;case"thinking":{if(c5.redacted){let redactedContent=decodeRedactedContent(c5.thinkingSignature);redactedContent?.length&&contentBlocks.push({reasoningContent:{redactedContent}});continue}let thinking=sanitizeSurrogates(c5.thinking);if(thinking.trim().length===0)continue;supportsThinkingSignature(model)?!c5.
1493
- thinkingSignature||c5.thinkingSignature.trim().length===0?contentBlocks.push({text:thinking}):contentBlocks.push({reasoningContent:{reasoningText:{text:thinking,signature:c5.thinkingSignature}}}):contentBlocks.push({reasoningContent:{reasoningText:{text:thinking}}});break}default:continue}if(contentBlocks.length===0)continue;result.push({role:import_client_bedrock_runtime.ConversationRole.ASSISTANT,content:contentBlocks});break}case"toolResult":{let toolResults=[];toolResults.push({toolResult:{toolUseId:m3.
1494
- toolCallId,content:convertToolResultContent(m3.content),status:m3.isError?import_client_bedrock_runtime.ToolResultStatus.ERROR:import_client_bedrock_runtime.ToolResultStatus.SUCCESS}});let j5=i5+1;for(;j5<transformedMessages.length&&transformedMessages[j5].role==="toolResult";){let nextMsg=transformedMessages[j5];toolResults.push({toolResult:{toolUseId:nextMsg.toolCallId,content:convertToolResultContent(nextMsg.content),status:nextMsg.isError?import_client_bedrock_runtime.ToolResultStatus.ERROR:
1495
- import_client_bedrock_runtime.ToolResultStatus.SUCCESS}}),j5++}i5=j5-1,result.push({role:import_client_bedrock_runtime.ConversationRole.USER,content:toolResults});break}default:continue}}if(cacheRetention!=="none"&&supportsPromptCaching(model,env2)&&result.length>0){let lastMessage=result[result.length-1];lastMessage.role===import_client_bedrock_runtime.ConversationRole.USER&&lastMessage.content&&lastMessage.content.push({cachePoint:{type:import_client_bedrock_runtime.CachePointType.DEFAULT,...cacheRetention===
1496
- "long"?{ttl:import_client_bedrock_runtime.CacheTTL.ONE_HOUR}:{}}})}return result}function convertToolConfig(tools,toolChoice,supportsStrictMode){if(!tools?.length||toolChoice==="none")return;let bedrockTools=tools.map(tool=>{let strict=resolveJsonSchemaStrictSampling(tool,supportsStrictMode);return{toolSpec:{name:tool.name,description:tool.description,inputSchema:{json:getJsonSchemaToolParameters(tool,strict)},...strict===!0?{strict:!0}:{}}}}),bedrockToolChoice;switch(toolChoice){case"auto":bedrockToolChoice=
1497
- {auto:{}};break;case"any":bedrockToolChoice={any:{}};break;default:toolChoice?.type==="tool"&&(bedrockToolChoice={tool:{name:toolChoice.name}})}return{tools:bedrockTools,toolChoice:bedrockToolChoice}}function mapStopReason(reason){switch(reason){case import_client_bedrock_runtime.StopReason.END_TURN:case import_client_bedrock_runtime.StopReason.STOP_SEQUENCE:return{stopReason:"stop"};case import_client_bedrock_runtime.StopReason.MAX_TOKENS:case import_client_bedrock_runtime.StopReason.MODEL_CONTEXT_WINDOW_EXCEEDED:
1498
- return{stopReason:"length"};case import_client_bedrock_runtime.StopReason.TOOL_USE:return{stopReason:"toolUse"};default:return reason?{stopReason:"error",errorMessage:`Provider stopped with: ${reason}`}:{stopReason:"error"}}}function getConfiguredBedrockRegion(options){return options.region||getProviderEnvValue("AWS_REGION",options.env)||getProviderEnvValue("AWS_DEFAULT_REGION",options.env)||void 0}function getConfiguredBedrockCredentials(env2){let accessKeyId=getProviderEnvValue("AWS_ACCESS_KEY\
1499
- _ID",env2),secretAccessKey=getProviderEnvValue("AWS_SECRET_ACCESS_KEY",env2);if(!accessKeyId||!secretAccessKey)return;let sessionToken=getProviderEnvValue("AWS_SESSION_TOKEN",env2);return{accessKeyId,secretAccessKey,...sessionToken?{sessionToken}:{}}}function getStandardBedrockEndpointRegion(baseUrl){if(baseUrl)try{let{hostname}=new URL(baseUrl);return hostname.toLowerCase().match(/^bedrock-runtime(?:-fips)?\.([a-z0-9-]+)\.amazonaws\.com(?:\.cn)?$/)?.[1]}catch{return}}function shouldUseExplicitBedrockEndpoint(baseUrl,configuredRegion,hasAmbientConfiguredProfile){
1500
- return getStandardBedrockEndpointRegion(baseUrl)?!configuredRegion&&!hasAmbientConfiguredProfile:!0}function shouldUseBedrockHttp1Handler(baseUrl,env2){if(getProviderEnvValue("AWS_BEDROCK_FORCE_HTTP1",env2)==="1")return!0;if(!baseUrl)return!1;try{return new URL(baseUrl).protocol==="http:"}catch{return!1}}function shouldBypassBedrockProxy(baseUrl){if(!baseUrl)return!1;try{let url=new URL(baseUrl);return url.protocol==="http:"&&isLoopbackHostname(url.hostname)}catch{return!1}}function isLoopbackHostname(hostname){
1501
- return hostname==="localhost"||hostname==="0.0.0.0"||hostname==="[::1]"||hostname.startsWith("127.")}function isGovCloudBedrockTarget(model,options){if(getConfiguredBedrockRegion(options)?.toLowerCase().startsWith("us-gov-"))return!0;let modelId=model.id.toLowerCase();return modelId.startsWith("us-gov.")||modelId.startsWith("arn:aws-us-gov:")}function buildAdditionalModelRequestFields(model,options){if(!options.reasoning||!model.reasoning)return;if(isAnthropicClaudeModel(model)){let isGovCloud=isGovCloudBedrockTarget(
1502
- model,options),display=isGovCloud?void 0:options.thinkingDisplay??"summarized",useBlockBinding=!isGovCloud&&supportsThinkingBlockBinding(model),result=supportsAdaptiveThinking(model.id,model.name)?{thinking:{type:"adaptive",...display!==void 0?{display}:{},...useBlockBinding?{block_binding:{prefix_mismatch_behavior:"drop_block"}}:{}},output_config:{effort:mapThinkingLevelToEffort(model,options.reasoning)},...useBlockBinding?{anthropic_beta:[THINKING_BINDING_CONTROLS_BETA]}:{}}:(()=>{let defaultBudgets={
1503
- minimal:1024,low:2048,medium:8192,high:16384,xhigh:16384,max:16384},level=options.reasoning==="xhigh"||options.reasoning==="max"?"high":options.reasoning;return{thinking:{type:"enabled",budget_tokens:options.thinkingBudgets?.[level]??defaultBudgets[options.reasoning],...display!==void 0?{display}:{}}}})();return!supportsAdaptiveThinking(model.id,model.name)&&(options.interleavedThinking??!0)&&(result.anthropic_beta=["interleaved-thinking-2025-05-14"]),result}let candidates=getModelMatchCandidates(
1504
- model.id,model.name);if(candidates.some(s2=>s2.includes("gpt-oss")))return{reasoning_effort:OPENAI_GPT_OSS_EFFORT[options.reasoning]};if(candidates.some(s2=>s2.includes("gpt-"))){let mapped=model.thinkingLevelMap?.[options.reasoning];return{reasoning:{effort:typeof mapped=="string"?mapped:OPENAI_GPT_EFFORT[options.reasoning]}}}}var OPENAI_GPT_EFFORT={minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},OPENAI_GPT_OSS_EFFORT={minimal:"low",low:"low",medium:"medium",high:"h\
1505
- igh",xhigh:"high",max:"high"};function createImageBlock(mimeType,data){let format2;switch(mimeType){case"image/jpeg":case"image/jpg":format2=import_client_bedrock_runtime.ImageFormat.JPEG;break;case"image/png":format2=import_client_bedrock_runtime.ImageFormat.PNG;break;case"image/gif":format2=import_client_bedrock_runtime.ImageFormat.GIF;break;case"image/webp":format2=import_client_bedrock_runtime.ImageFormat.WEBP;break;default:throw new Error(`Unknown image type: ${mimeType}`)}return{source:{bytes:base64ToBytes(
1506
- data)},format:format2}}function base64ToBytes(data){let binaryString=atob(data),bytes=new Uint8Array(binaryString.length);for(let i5=0;i5<binaryString.length;i5++)bytes[i5]=binaryString.charCodeAt(i5);return bytes}function decodeRedactedContent(signature){if(signature)try{return base64ToBytes(signature)}catch{return}}function bytesToBase64(chunks){let binary="";for(let chunk of chunks)for(let i5=0;i5<chunk.length;i5+=32768)binary+=String.fromCharCode(...chunk.subarray(i5,i5+32768));return btoa(binary)}export{stream,streamSimple};
1485
+ (block.thinkingSignature=bytesToBase64(block.redactedChunks),delete block.redactedChunks)}function finalizeStreamingBlock(block){delete block.index,delete block.partialJson,flushRedactedContent(block)}function handleMetadata(event,model,output){event.usage&&(output.usage.usageIncomplete=hasIncompleteUsage([event.usage.inputTokens,event.usage.outputTokens],[event.usage.totalTokens,event.usage.cacheReadInputTokens,event.usage.cacheWriteInputTokens,...event.usage.cacheDetails?.map(detail=>detail.inputTokens)??
1486
+ []]),output.usage.input=event.usage.inputTokens||0,output.usage.output=event.usage.outputTokens||0,output.usage.cacheRead=event.usage.cacheReadInputTokens||0,output.usage.cacheWrite=event.usage.cacheWriteInputTokens||0,output.usage.cacheWrite1h=event.usage.cacheDetails?.reduce((total,detail)=>total+(detail.ttl===import_client_bedrock_runtime.CacheTTL.ONE_HOUR?detail.inputTokens??0:0),0),output.usage.totalTokens=event.usage.totalTokens||output.usage.input+output.usage.output,output.usage.usageIncomplete||=
1487
+ hasIncompleteUsage([output.usage.totalTokens],[output.usage.cacheWrite1h]),calculateCost(model,output.usage))}function handleContentBlockStop(event,blocks,output,stream2){let index=blocks.findIndex(b5=>b5.index===event.contentBlockIndex),block=blocks[index];if(block)switch(delete block.index,block.type){case"text":stream2.push({type:"text_end",contentIndex:index,content:block.text,partial:output});break;case"thinking":flushRedactedContent(block),stream2.push({type:"thinking_end",contentIndex:index,
1488
+ content:block.thinking,partial:output});break;case"toolCall":block.arguments=parseStreamingJson(block.partialJson),delete block.partialJson,stream2.push({type:"toolcall_end",contentIndex:index,toolCall:block,partial:output});break}}function getModelMatchCandidates(modelId,modelName){return(modelName?[modelId,modelName]:[modelId]).flatMap(value=>{let lower=value.toLowerCase();return[lower,lower.replace(/[\s_.:]+/g,"-")]})}function supportsAdaptiveThinking(modelId,modelName){return getModelMatchCandidates(
1489
+ modelId,modelName).some(s2=>s2.includes("opus-4-6")||s2.includes("opus-4-7")||s2.includes("opus-4-8")||s2.includes("opus-5")||s2.includes("sonnet-4-6")||s2.includes("sonnet-5")||s2.includes("haiku-5")||s2.includes("fable-5"))}function supportsNativeXhighEffort(model){return getModelMatchCandidates(model.id,model.name).some(s2=>s2.includes("opus-4-7")||s2.includes("opus-4-8")||s2.includes("opus-5")||s2.includes("sonnet-5")||s2.includes("haiku-5")||s2.includes("fable-5"))}function supportsThinkingBlockBinding(model){
1490
+ return getModelMatchCandidates(model.id,model.name).some(s2=>s2.includes("opus-4-7")||s2.includes("opus-4-8")||s2.includes("opus-5")||s2.includes("sonnet-5")||s2.includes("haiku-5")||s2.includes("fable-5"))}function mapThinkingLevelToEffort(model,level){if(level==="xhigh"&&supportsNativeXhighEffort(model))return"xhigh";let mapped=level?model.thinkingLevelMap?.[level]:void 0;if(typeof mapped=="string")return mapped;switch(level){case"minimal":case"low":return"low";case"medium":return"medium";case"\
1491
+ high":return"high";default:return"high"}}function resolveCacheRetention(cacheRetention,env2){return cacheRetention||(getProviderEnvValue("HUMAIN_TERMINAL_CACHE_RETENTION",env2)==="long"||getProviderEnvValue("PI_CACHE_RETENTION",env2)==="long"?"long":"short")}function isAnthropicClaudeModel(model){let id=model.id.toLowerCase(),name=model.name?.toLowerCase()??"";return id.includes("anthropic.claude")||id.includes("anthropic/claude")||name.includes("anthropic.claude")||name.includes("anthropic/clau\
1492
+ de")||name.includes("claude")}function supportsPromptCaching(model,env2){let candidates=getModelMatchCandidates(model.id,model.name);return candidates.some(s2=>s2.includes("claude"))?!!(candidates.some(s2=>s2.includes("fable-5")||s2.includes("opus-5")||s2.includes("sonnet-5")||s2.includes("haiku-5"))||candidates.some(s2=>s2.includes("-4-"))||candidates.some(s2=>s2.includes("claude-3-7-sonnet"))||candidates.some(s2=>s2.includes("claude-3-5-haiku"))):getProviderEnvValue("AWS_BEDROCK_FORCE_CACHE",env2)===
1493
+ "1"}function supportsThinkingSignature(model){return isAnthropicClaudeModel(model)}function buildSystemPrompt(systemPrompt,model,cacheRetention,env2){if(!systemPrompt)return;let blocks=[{text:sanitizeSurrogates(systemPrompt)}];return cacheRetention!=="none"&&supportsPromptCaching(model,env2)&&blocks.push({cachePoint:{type:import_client_bedrock_runtime.CachePointType.DEFAULT,...cacheRetention==="long"?{ttl:import_client_bedrock_runtime.CacheTTL.ONE_HOUR}:{}}}),blocks}function normalizeToolCallId(id){
1494
+ let sanitized=id.replace(/[^a-zA-Z0-9_-]/g,"_");return sanitized.length>64?sanitized.slice(0,64):sanitized}function createNonBlankTextBlock(text){let sanitized=sanitizeSurrogates(text);return sanitized.trim().length===0?void 0:{text:sanitized}}function createRequiredTextBlock(text){return createNonBlankTextBlock(text)??{text:EMPTY_TEXT_PLACEHOLDER}}function sanitizeBedrockDocument(value){return Array.isArray(value)?value.map(sanitizeBedrockDocument):value!==null&&typeof value=="object"?Object.fromEntries(
1495
+ Object.entries(value).filter(([key])=>key.length>0).map(([key,nestedValue])=>[key,sanitizeBedrockDocument(nestedValue)])):value}function convertToolResultContent(content){let result=[];for(let c5 of content)if(c5.type==="image")result.push({image:createImageBlock(c5.mimeType,c5.data)});else{let textBlock=createNonBlankTextBlock(c5.text);textBlock&&result.push(textBlock)}return result.length===0&&result.push({text:EMPTY_TEXT_PLACEHOLDER}),result}function convertMessages(context,model,cacheRetention,env2){
1496
+ let result=[],transformedMessages=transformMessages(withoutInitialSystemMessage(context.messages),model,normalizeToolCallId);for(let i5=0;i5<transformedMessages.length;i5++){let m3=transformedMessages[i5];switch(m3.role){case"user":{let content=[];if(typeof m3.content=="string")content.push(createRequiredTextBlock(m3.content));else{for(let c5 of m3.content)switch(c5.type){case"text":{let textBlock=createNonBlankTextBlock(c5.text);textBlock&&content.push(textBlock);break}case"image":content.push(
1497
+ {image:createImageBlock(c5.mimeType,c5.data)});break;default:continue}content.length===0&&content.push({text:EMPTY_TEXT_PLACEHOLDER})}result.push({role:import_client_bedrock_runtime.ConversationRole.USER,content});break}case"assistant":{if(m3.content.length===0)continue;let contentBlocks=[];for(let c5 of m3.content)switch(c5.type){case"text":{let textBlock=createNonBlankTextBlock(c5.text);if(!textBlock)continue;contentBlocks.push(textBlock);break}case"toolCall":contentBlocks.push({toolUse:{toolUseId:c5.
1498
+ id,name:c5.name,input:sanitizeBedrockDocument(c5.arguments)}});break;case"thinking":{if(c5.redacted){let redactedContent=decodeRedactedContent(c5.thinkingSignature);redactedContent?.length&&contentBlocks.push({reasoningContent:{redactedContent}});continue}let thinking=sanitizeSurrogates(c5.thinking);if(thinking.trim().length===0)continue;supportsThinkingSignature(model)?!c5.thinkingSignature||c5.thinkingSignature.trim().length===0?contentBlocks.push({text:thinking}):contentBlocks.push({reasoningContent:{
1499
+ reasoningText:{text:thinking,signature:c5.thinkingSignature}}}):contentBlocks.push({reasoningContent:{reasoningText:{text:thinking}}});break}default:continue}if(contentBlocks.length===0)continue;result.push({role:import_client_bedrock_runtime.ConversationRole.ASSISTANT,content:contentBlocks});break}case"toolResult":{let toolResults=[];toolResults.push({toolResult:{toolUseId:m3.toolCallId,content:convertToolResultContent(m3.content),status:m3.isError?import_client_bedrock_runtime.ToolResultStatus.
1500
+ ERROR:import_client_bedrock_runtime.ToolResultStatus.SUCCESS}});let j5=i5+1;for(;j5<transformedMessages.length&&transformedMessages[j5].role==="toolResult";){let nextMsg=transformedMessages[j5];toolResults.push({toolResult:{toolUseId:nextMsg.toolCallId,content:convertToolResultContent(nextMsg.content),status:nextMsg.isError?import_client_bedrock_runtime.ToolResultStatus.ERROR:import_client_bedrock_runtime.ToolResultStatus.SUCCESS}}),j5++}i5=j5-1,result.push({role:import_client_bedrock_runtime.ConversationRole.
1501
+ USER,content:toolResults});break}default:continue}}if(cacheRetention!=="none"&&supportsPromptCaching(model,env2)&&result.length>0){let lastMessage=result[result.length-1];lastMessage.role===import_client_bedrock_runtime.ConversationRole.USER&&lastMessage.content&&lastMessage.content.push({cachePoint:{type:import_client_bedrock_runtime.CachePointType.DEFAULT,...cacheRetention==="long"?{ttl:import_client_bedrock_runtime.CacheTTL.ONE_HOUR}:{}}})}return result}function convertToolConfig(tools,toolChoice,supportsStrictMode){
1502
+ if(!tools?.length||toolChoice==="none")return;let bedrockTools=tools.map(tool=>{let strict=resolveJsonSchemaStrictSampling(tool,supportsStrictMode);return{toolSpec:{name:tool.name,description:tool.description,inputSchema:{json:getJsonSchemaToolParameters(tool,strict)},...strict===!0?{strict:!0}:{}}}}),bedrockToolChoice;switch(toolChoice){case"auto":bedrockToolChoice={auto:{}};break;case"any":bedrockToolChoice={any:{}};break;default:toolChoice?.type==="tool"&&(bedrockToolChoice={tool:{name:toolChoice.
1503
+ name}})}return{tools:bedrockTools,toolChoice:bedrockToolChoice}}function mapStopReason(reason){switch(reason){case import_client_bedrock_runtime.StopReason.END_TURN:case import_client_bedrock_runtime.StopReason.STOP_SEQUENCE:return{stopReason:"stop"};case import_client_bedrock_runtime.StopReason.MAX_TOKENS:case import_client_bedrock_runtime.StopReason.MODEL_CONTEXT_WINDOW_EXCEEDED:return{stopReason:"length"};case import_client_bedrock_runtime.StopReason.TOOL_USE:return{stopReason:"toolUse"};default:
1504
+ return reason?{stopReason:"error",errorMessage:`Provider stopped with: ${reason}`}:{stopReason:"error"}}}function getConfiguredBedrockRegion(options){return options.region||getProviderEnvValue("AWS_REGION",options.env)||getProviderEnvValue("AWS_DEFAULT_REGION",options.env)||void 0}function getConfiguredBedrockCredentials(env2){let accessKeyId=getProviderEnvValue("AWS_ACCESS_KEY_ID",env2),secretAccessKey=getProviderEnvValue("AWS_SECRET_ACCESS_KEY",env2);if(!accessKeyId||!secretAccessKey)return;let sessionToken=getProviderEnvValue(
1505
+ "AWS_SESSION_TOKEN",env2);return{accessKeyId,secretAccessKey,...sessionToken?{sessionToken}:{}}}function getStandardBedrockEndpointRegion(baseUrl){if(baseUrl)try{let{hostname}=new URL(baseUrl);return hostname.toLowerCase().match(/^bedrock-runtime(?:-fips)?\.([a-z0-9-]+)\.amazonaws\.com(?:\.cn)?$/)?.[1]}catch{return}}function shouldUseExplicitBedrockEndpoint(baseUrl,configuredRegion,hasAmbientConfiguredProfile){return getStandardBedrockEndpointRegion(baseUrl)?!configuredRegion&&!hasAmbientConfiguredProfile:
1506
+ !0}function shouldUseBedrockHttp1Handler(baseUrl,env2){if(getProviderEnvValue("AWS_BEDROCK_FORCE_HTTP1",env2)==="1")return!0;if(!baseUrl)return!1;try{return new URL(baseUrl).protocol==="http:"}catch{return!1}}function shouldBypassBedrockProxy(baseUrl){if(!baseUrl)return!1;try{let url=new URL(baseUrl);return url.protocol==="http:"&&isLoopbackHostname(url.hostname)}catch{return!1}}function isLoopbackHostname(hostname){return hostname==="localhost"||hostname==="0.0.0.0"||hostname==="[::1]"||hostname.
1507
+ startsWith("127.")}function isGovCloudBedrockTarget(model,options){if(getConfiguredBedrockRegion(options)?.toLowerCase().startsWith("us-gov-"))return!0;let modelId=model.id.toLowerCase();return modelId.startsWith("us-gov.")||modelId.startsWith("arn:aws-us-gov:")}function buildAdditionalModelRequestFields(model,options){if(!options.reasoning||!model.reasoning)return;if(isAnthropicClaudeModel(model)){let isGovCloud=isGovCloudBedrockTarget(model,options),display=isGovCloud?void 0:options.thinkingDisplay??
1508
+ "summarized",useBlockBinding=!isGovCloud&&supportsThinkingBlockBinding(model),result=supportsAdaptiveThinking(model.id,model.name)?{thinking:{type:"adaptive",...display!==void 0?{display}:{},...useBlockBinding?{block_binding:{prefix_mismatch_behavior:"drop_block"}}:{}},output_config:{effort:mapThinkingLevelToEffort(model,options.reasoning)},...useBlockBinding?{anthropic_beta:[THINKING_BINDING_CONTROLS_BETA]}:{}}:(()=>{let defaultBudgets={minimal:1024,low:2048,medium:8192,high:16384,xhigh:16384,max:16384},
1509
+ level=options.reasoning==="xhigh"||options.reasoning==="max"?"high":options.reasoning;return{thinking:{type:"enabled",budget_tokens:options.thinkingBudgets?.[level]??defaultBudgets[options.reasoning],...display!==void 0?{display}:{}}}})();return!supportsAdaptiveThinking(model.id,model.name)&&(options.interleavedThinking??!0)&&(result.anthropic_beta=["interleaved-thinking-2025-05-14"]),result}let candidates=getModelMatchCandidates(model.id,model.name);if(candidates.some(s2=>s2.includes("gpt-oss")))
1510
+ return{reasoning_effort:OPENAI_GPT_OSS_EFFORT[options.reasoning]};if(candidates.some(s2=>s2.includes("gpt-"))){let mapped=model.thinkingLevelMap?.[options.reasoning];return{reasoning:{effort:typeof mapped=="string"?mapped:OPENAI_GPT_EFFORT[options.reasoning]}}}}var OPENAI_GPT_EFFORT={minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},OPENAI_GPT_OSS_EFFORT={minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"high",max:"high"};function createImageBlock(mimeType,data){
1511
+ let format2;switch(mimeType){case"image/jpeg":case"image/jpg":format2=import_client_bedrock_runtime.ImageFormat.JPEG;break;case"image/png":format2=import_client_bedrock_runtime.ImageFormat.PNG;break;case"image/gif":format2=import_client_bedrock_runtime.ImageFormat.GIF;break;case"image/webp":format2=import_client_bedrock_runtime.ImageFormat.WEBP;break;default:throw new Error(`Unknown image type: ${mimeType}`)}return{source:{bytes:base64ToBytes(data)},format:format2}}function base64ToBytes(data){let binaryString=atob(
1512
+ data),bytes=new Uint8Array(binaryString.length);for(let i5=0;i5<binaryString.length;i5++)bytes[i5]=binaryString.charCodeAt(i5);return bytes}function decodeRedactedContent(signature){if(signature)try{return base64ToBytes(signature)}catch{return}}function bytesToBase64(chunks){let binary="";for(let chunk of chunks)for(let i5=0;i5<chunk.length;i5+=32768)binary+=String.fromCharCode(...chunk.subarray(i5,i5+32768));return btoa(binary)}export{stream,streamSimple};
@@ -1,8 +1,9 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{VisualLinePreview,getTextOutput,replaceTabs,str}from"./chunk-OXJXKCLB.js";import{Container,Spacer,Text,highlightCode,keyHint}from"./chunk-ICLZNV4V.js";import{getDocsPath}from"./chunk-DUZY4PDA.js";import{typebox_exports}from"./chunk-BHM75BJJ.js";function createUsageTotals(){return{input:0,output:0,cacheRead:0,cacheWrite:0,cost:0}}function addUsageToTotals(totals,usage){totals.input+=usage.input,totals.output+=usage.output,totals.cacheRead+=usage.cacheRead,totals.cacheWrite+=usage.cacheWrite,totals.cost+=usage.cost.total}function combineUsage(first,second){return{input:first.input+second.input,output:first.output+second.output,cacheRead:first.cacheRead+second.cacheRead,cacheWrite:first.cacheWrite+second.cacheWrite,...first.cacheWrite1h!==
3
- void 0||second.cacheWrite1h!==void 0?{cacheWrite1h:(first.cacheWrite1h??0)+(second.cacheWrite1h??0)}:{},...first.reasoning!==void 0||second.reasoning!==void 0?{reasoning:(first.reasoning??0)+(second.reasoning??0)}:{},totalTokens:first.totalTokens+second.totalTokens,cost:{input:first.cost.input+second.cost.input,output:first.cost.output+second.cost.output,cacheRead:first.cost.cacheRead+second.cost.cacheRead,cacheWrite:first.cost.cacheWrite+second.cost.cacheWrite,total:first.cost.total+second.cost.
4
- total}}}function getUsageCostBreakdown(entries){let totalsByKey=new Map;for(let entry of entries){let key,usage;if(entry.type==="message"&&entry.message.role==="assistant"?(key=`${entry.message.provider}/${entry.message.responseModel??entry.message.model}`,usage=entry.message.usage):entry.type==="usage"?(key=`${entry.provider}/${entry.model}`,usage=entry.usage):entry.type==="message"&&entry.message.role==="toolResult"&&entry.message.usage?(key="Tools/summaries",usage=entry.message.usage):(entry.
5
- type==="branch_summary"||entry.type==="compaction")&&entry.usage&&(key="Tools/summaries",usage=entry.usage),!key||!usage)continue;let totals=totalsByKey.get(key);totals||(totals=createUsageTotals(),totalsByKey.set(key,totals)),addUsageToTotals(totals,usage)}return Array.from(totalsByKey,([key,totals])=>({key,cost:totals.cost,tokens:totals.input+totals.output+totals.cacheRead+totals.cacheWrite})).filter(entry=>entry.cost>0||entry.tokens>0).sort((a,b)=>b.cost-a.cost)}function toCodemodeIdentifier(name){let identifier="";for(let char of name){let valid=identifier===""?/^[A-Za-z_$]$/.test(char):/^[A-Za-z0-9_$]$/.test(char);identifier+=valid?char:"_"}return identifier===""?"_":identifier}var IDENTIFIER=/^[A-Za-z_$][A-Za-z0-9_$]*$/,INDENT=" ",DEFAULT_INPUT_SCHEMA_MAX_CHARS=16e3,MAX_REF_EXPANSIONS=32,MCP_TYPESCRIPT_PREAMBLE=`type Role = "user" | "assistant";
2
+ import{VisualLinePreview,getTextOutput,replaceTabs,str}from"./chunk-OXJXKCLB.js";import{Container,Spacer,Text,highlightCode,keyHint}from"./chunk-ICLZNV4V.js";import{getDocsPath}from"./chunk-DUZY4PDA.js";import{typebox_exports}from"./chunk-BHM75BJJ.js";function createUsageTotals(){return{input:0,output:0,cacheRead:0,cacheWrite:0,cost:0}}function addUsageToTotals(totals,usage){usage.usageIncomplete&&(totals.usageIncomplete=!0),totals.input+=usage.input,totals.output+=usage.output,totals.cacheRead+=usage.cacheRead,totals.cacheWrite+=usage.cacheWrite,totals.cost+=usage.cost.total}function combineUsage(first,second){return{...first.usageIncomplete||second.usageIncomplete?{usageIncomplete:!0}:{},input:first.input+second.input,output:first.output+second.
3
+ output,cacheRead:first.cacheRead+second.cacheRead,cacheWrite:first.cacheWrite+second.cacheWrite,...first.cacheWrite1h!==void 0||second.cacheWrite1h!==void 0?{cacheWrite1h:(first.cacheWrite1h??0)+(second.cacheWrite1h??0)}:{},...first.reasoning!==void 0||second.reasoning!==void 0?{reasoning:(first.reasoning??0)+(second.reasoning??0)}:{},totalTokens:first.totalTokens+second.totalTokens,cost:{input:first.cost.input+second.cost.input,output:first.cost.output+second.cost.output,cacheRead:first.cost.cacheRead+
4
+ second.cost.cacheRead,cacheWrite:first.cost.cacheWrite+second.cost.cacheWrite,total:first.cost.total+second.cost.total}}}function getUsageCostBreakdown(entries){let totalsByKey=new Map;for(let entry of entries){let key,usage;if(entry.type==="message"&&entry.message.role==="assistant"?(key=`${entry.message.provider}/${entry.message.responseModel??entry.message.model}`,usage=entry.message.usage):entry.type==="usage"?(key=`${entry.provider}/${entry.model}`,usage=entry.usage):entry.type==="message"&&
5
+ entry.message.role==="toolResult"&&entry.message.usage?(key="Tools/summaries",usage=entry.message.usage):(entry.type==="branch_summary"||entry.type==="compaction")&&entry.usage&&(key="Tools/summaries",usage=entry.usage),!key||!usage)continue;let totals=totalsByKey.get(key);totals||(totals=createUsageTotals(),totalsByKey.set(key,totals)),addUsageToTotals(totals,usage)}return Array.from(totalsByKey,([key,totals])=>({key,...totals.usageIncomplete?{usageIncomplete:!0}:{},cost:totals.cost,tokens:totals.
6
+ input+totals.output+totals.cacheRead+totals.cacheWrite})).filter(entry=>entry.usageIncomplete||entry.cost>0||entry.tokens>0).sort((a,b)=>b.cost-a.cost)}function toCodemodeIdentifier(name){let identifier="";for(let char of name){let valid=identifier===""?/^[A-Za-z_$]$/.test(char):/^[A-Za-z0-9_$]$/.test(char);identifier+=valid?char:"_"}return identifier===""?"_":identifier}var IDENTIFIER=/^[A-Za-z_$][A-Za-z0-9_$]*$/,INDENT=" ",DEFAULT_INPUT_SCHEMA_MAX_CHARS=16e3,MAX_REF_EXPANSIONS=32,MCP_TYPESCRIPT_PREAMBLE=`type Role = "user" | "assistant";
6
7
  type MetaObject = Record<string, unknown>;
7
8
  type Annotations = {
8
9
  audience?: Role[];
@@ -119,7 +120,7 @@ Searches over deferred tool metadata with BM25 and exposes matching tools for th
119
120
  Some of the tools, such as tools of MCP servers, may not have been provided to you upfront, and you should use this tool (\`${TOOL_SEARCH_TOOL_NAME}\`) to search for the required tools. For MCP tool discovery, always use \`${TOOL_SEARCH_TOOL_NAME}\`.`;function createToolSearchToolDefinition(options={}){return{name:TOOL_SEARCH_TOOL_NAME,label:TOOL_SEARCH_TOOL_NAME,description:TOOL_SEARCH_DESCRIPTION,promptSnippet:"Search for tools that are not loaded yet and load the matches",parameters:toolSearchSchema,
120
121
  exposure:"model-only",async execute(_toolCallId,{query,limit}){if(query.trim()==="")throw new Error("query must not be empty");let max=limit??DEFAULT_TOOL_SEARCH_LIMIT;if(!Number.isInteger(max)||max<=0)throw new Error("limit must be a positive integer");let tools=options.tools?searchAndLoad(options.tools,query,max):[];return{content:[{type:"text",text:tools.length===0?"No matching tools found.":`Loaded ${tools.length} tool${tools.length===1?"":"s"}. They are available from your next call:
121
122
  ${tools.map(tool=>`- ${tool.name}: ${tool.description.trim().split(/\r?\n/)[0]}`).join(`
122
- `)}`}],details:{loaded:tools.map(tool=>tool.name)}}}}}import{join}from"node:path";function wrapToolDefinition(definition,ctxFactory){return{name:definition.name,label:definition.label,description:definition.description,parameters:definition.parameters,outputSchema:definition.outputSchema,constrainedSampling:definition.constrainedSampling,prepareArguments:definition.prepareArguments,executionMode:definition.executionMode,execute:(toolCallId,params,signal,onUpdate,ctx)=>definition.execute(toolCallId,params,signal,onUpdate,ctx??ctxFactory?.(toolCallId,signal))}}function createToolDefinitionFromAgentTool(tool){return{name:tool.name,label:tool.label,description:tool.description,parameters:tool.parameters,outputSchema:tool.outputSchema,constrainedSampling:tool.constrainedSampling,prepareArguments:tool.prepareArguments,executionMode:tool.executionMode,execute:async(toolCallId,params,signal,onUpdate)=>tool.execute(toolCallId,params,signal,onUpdate)}}var loadCodemodeExecutor=()=>import("./execute-KEUC5IWA.js");var CODE_PREVIEW_LINES=10,CALL_PREVIEW_COUNT=8,OUTPUT_PREVIEW_LINES=5,COLLAPSED_ARGS_CHARS=80,SCRIPT_HEADER=/^Script (completed|failed)\nWall time [\d.]+ seconds\nOutput:\n$/;function expandHint(theme,hidden,noun){return`${theme.fg("muted",`... (${hidden} more ${noun},`)} ${keyHint("app.tools.expand","to expand")}${theme.fg("muted",")")}`}function formatDuration(ms){return ms===void 0?"":ms<1e3?`${Math.round(ms)}ms`:`${(ms/1e3).toFixed(1)}s`}function formatCost(cost){return`$${cost>=.01?cost.toFixed(
123
+ `)}`}],details:{loaded:tools.map(tool=>tool.name)}}}}}import{join}from"node:path";function wrapToolDefinition(definition,ctxFactory){return{name:definition.name,label:definition.label,description:definition.description,parameters:definition.parameters,outputSchema:definition.outputSchema,constrainedSampling:definition.constrainedSampling,prepareArguments:definition.prepareArguments,executionMode:definition.executionMode,execute:(toolCallId,params,signal,onUpdate,ctx)=>definition.execute(toolCallId,params,signal,onUpdate,ctx??ctxFactory?.(toolCallId,signal))}}function createToolDefinitionFromAgentTool(tool){return{name:tool.name,label:tool.label,description:tool.description,parameters:tool.parameters,outputSchema:tool.outputSchema,constrainedSampling:tool.constrainedSampling,prepareArguments:tool.prepareArguments,executionMode:tool.executionMode,execute:async(toolCallId,params,signal,onUpdate)=>tool.execute(toolCallId,params,signal,onUpdate)}}var loadCodemodeExecutor=()=>import("./execute-MFIDTEMB.js");var CODE_PREVIEW_LINES=10,CALL_PREVIEW_COUNT=8,OUTPUT_PREVIEW_LINES=5,COLLAPSED_ARGS_CHARS=80,SCRIPT_HEADER=/^Script (completed|failed)\nWall time [\d.]+ seconds\nOutput:\n$/;function expandHint(theme,hidden,noun){return`${theme.fg("muted",`... (${hidden} more ${noun},`)} ${keyHint("app.tools.expand","to expand")}${theme.fg("muted",")")}`}function formatDuration(ms){return ms===void 0?"":ms<1e3?`${Math.round(ms)}ms`:`${(ms/1e3).toFixed(1)}s`}function formatCost(cost){return`$${cost>=.01?cost.toFixed(
123
124
  2):cost.toPrecision(2)}`}function statusIcon(call,theme){switch(call.status){case"running":return theme.fg("warning","\u2026");case"ok":return theme.fg("success","\u2713");case"error":return theme.fg("error","\u2717");case"cancelled":return theme.fg("muted","\u2298")}}function formatCall(call,theme,expanded){let args=!expanded&&call.args.length>COLLAPSED_ARGS_CHARS?`${call.args.slice(0,COLLAPSED_ARGS_CHARS-3)}...`:call.args,duration=formatDuration(call.durationMs),line=`${statusIcon(call,theme)}\
124
125
  ${theme.fg("toolTitle",call.name)}`;return args&&(line+=` ${theme.fg("muted",args)}`),duration&&(line+=` ${theme.fg("dim",duration)}`),call.cost&&(line+=` ${theme.fg("dim",formatCost(call.cost))}`),expanded&&call.error&&(line+=`
125
126
  ${theme.fg("error",call.error.split(`
@@ -4,9 +4,9 @@ InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorCom
4
4
  createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodemodeExtension,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLocalPowerShellOperations,createLsTool,createLsToolDefinition,createMcpExtension,createPiAgentExecutionHost,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,
5
5
  createReadTool,createReadToolDefinition,createSubagentTool,createSyntheticSourceInfo,createToolSearchExtension,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAgents,discoverAndLoadExtensions,estimateTokens,executeHumainAgentRequest,findCutPoint,findTurnStartIndex,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getFlowChildLaunchHost,getFlowControlHost,getFlowTraceProducer,
6
6
  getLastAssistantUsage,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,parseArgs,parseFrontmatter,parseSkillBlock,prepareBranchEntries,prepareChildLaunch,renderDiff,renderTaskWithContext,resolveCliModel,resolveModelScopeWithDiagnostics,runAgentExecMode,runPrintMode,runRpcMode,serializeConversation,shouldCompact,stripFrontmatter,
7
- withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunk-T2IF7HO3.js";import{ProjectTrustStore,hasTrustRequiringProjectResources}from"./chunk-H5CZL7M5.js";import{CURRENT_SESSION_VERSION,SessionManager,buildContextEntries,buildSessionContext,buildSessionProjection,convertToLlm,formatDimensionNote,getLatestCompactionEntry,migrateSessionEntries,parseSessionEntries,resizeImage,sessionEntryToContextMessages}from"./chunk-2KKLZK2N.js";import{readStoredCredential}from"./chunk-JQZ7BIAI.js";
7
+ withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunk-FP2SXW5M.js";import{ProjectTrustStore,hasTrustRequiringProjectResources}from"./chunk-H5CZL7M5.js";import{CURRENT_SESSION_VERSION,SessionManager,buildContextEntries,buildSessionContext,buildSessionProjection,convertToLlm,formatDimensionNote,getLatestCompactionEntry,migrateSessionEntries,parseSessionEntries,resizeImage,sessionEntryToContextMessages}from"./chunk-LFXFQLII.js";import{readStoredCredential}from"./chunk-JQZ7BIAI.js";
8
8
  import{DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,formatSize,getPowerShellConfig,getShellConfig,truncateHead,truncateLine,truncateTail,truncateToVisualLines}from"./chunk-OXJXKCLB.js";import{ArminComponent}from"./chunk-E7WGCXWK.js";import{Container,SelectList,Theme,getAvailableThemes,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme,keyHint,keyText,rawKeyHint}from"./chunk-ICLZNV4V.js";import{HUMAIN_AGENT_EXECUTION_FAILURE_CODES,HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION,
9
- HumainAgentArtifactSchema,HumainAgentExecutionClaimSchema,HumainAgentExecutionControlsSchema,HumainAgentExecutionOutcomeSchema,HumainAgentExecutionRequestSchema,HumainAgentExecutionResponseSchema,HumainAgentRouteRefSchema,HumainAgentUsageSchema,parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse}from"./chunk-T45HXZW7.js";import{CONFIG_DIR_NAME,UPSTREAM_PI_VERSION,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunk-DUZY4PDA.js";import{
9
+ HumainAgentArtifactSchema,HumainAgentExecutionClaimSchema,HumainAgentExecutionControlsSchema,HumainAgentExecutionOutcomeSchema,HumainAgentExecutionRequestSchema,HumainAgentExecutionResponseSchema,HumainAgentRouteRefSchema,HumainAgentUsageSchema,parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse}from"./chunk-VQTXF23B.js";import{CONFIG_DIR_NAME,UPSTREAM_PI_VERSION,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunk-DUZY4PDA.js";import{
10
10
  __export}from"./chunk-JXWJOIH4.js";var dist_exports={};__export(dist_exports,{ACCOUNT_RETURN_COOLDOWN_MS:()=>ACCOUNT_RETURN_COOLDOWN_MS,ACCOUNT_RETURN_MAX_COOLDOWN_MS:()=>ACCOUNT_RETURN_MAX_COOLDOWN_MS,AgentExecInputError:()=>AgentExecInputError,AgentSession:()=>AgentSession,AgentSessionRuntime:()=>AgentSessionRuntime,ArminComponent:()=>ArminComponent,AssistantMessageComponent:()=>AssistantMessageComponent,BashExecutionComponent:()=>BashExecutionComponent,BorderedLoader:()=>BorderedLoader,BranchSummaryMessageComponent:()=>BranchSummaryMessageComponent,
11
11
  CONFIG_DIR_NAME:()=>CONFIG_DIR_NAME,CURRENT_SESSION_VERSION:()=>CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent:()=>CompactionSummaryMessageComponent,CredentialSynchronizationError:()=>CredentialSynchronizationError,CustomEditor:()=>CustomEditor,CustomMessageComponent:()=>CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS:()=>DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES:()=>DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES:()=>DEFAULT_MAX_LINES,DefaultPackageManager:()=>DefaultPackageManager,DefaultResourceLoader:()=>DefaultResourceLoader,
12
12
  DynamicBorder:()=>DynamicBorder,ExtensionEditorComponent:()=>ExtensionEditorComponent,ExtensionInputComponent:()=>ExtensionInputComponent,ExtensionRunner:()=>ExtensionRunner,ExtensionSelectorComponent:()=>ExtensionSelectorComponent,FooterComponent:()=>FooterComponent,HUMAIN_AGENT_EXECUTION_FAILURE_CODES:()=>HUMAIN_AGENT_EXECUTION_FAILURE_CODES,HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION:()=>HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION,HumainAgentArtifactSchema:()=>HumainAgentArtifactSchema,HumainAgentExecutionClaimSchema:()=>HumainAgentExecutionClaimSchema,