@muxcodecli/cli 1.15.17 → 1.15.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bip-bop-01-ga21wr3r.mp3 +0 -0
- package/dist/bip-bop-03-kgfd4rq4.mp3 +0 -0
- package/dist/chunk-0hqmdrjr.js +3 -0
- package/dist/chunk-0npjzye0.js +2 -0
- package/dist/chunk-0pe6y883.js +2 -0
- package/dist/chunk-0qqpjj2h.js +3 -0
- package/dist/chunk-0r3h8jgj.js +2 -0
- package/dist/chunk-11285jfy.js +3 -0
- package/dist/chunk-11ant2kk.js +3 -0
- package/dist/chunk-124qmktt.js +18 -0
- package/dist/chunk-138ntz3h.js +2 -0
- package/dist/chunk-1e73ypg5.js +3 -0
- package/dist/chunk-1evcc54z.js +3 -0
- package/dist/chunk-1mqsg5s7.js +75 -0
- package/dist/chunk-1pv2317e.js +7 -0
- package/dist/chunk-1y3ssxx6.js +2 -0
- package/dist/chunk-20x8vsdn.js +7 -0
- package/dist/chunk-21x3anp4.js +9 -0
- package/dist/chunk-22qpzg37.js +212 -0
- package/dist/chunk-2bt5mtgm.js +3 -0
- package/dist/chunk-2d95ene8.js +2 -0
- package/dist/chunk-2h2zq5cp.js +2 -0
- package/dist/chunk-2pc63est.js +2 -0
- package/dist/chunk-33gs9z8d.js +2 -0
- package/dist/chunk-33vwwxjk.js +2 -0
- package/dist/chunk-3dq7hfxc.js +9 -0
- package/dist/chunk-3jvft1k1.js +2 -0
- package/dist/chunk-4jqh4mpm.js +2 -0
- package/dist/chunk-4mgyaytc.js +672 -0
- package/dist/chunk-4va8fzq1.js +2 -0
- package/dist/chunk-4wkq9y2z.js +7 -0
- package/dist/chunk-526nbm9e.js +2 -0
- package/dist/chunk-5a6895cv.js +37 -0
- package/dist/chunk-5e9dq2av.js +2 -0
- package/dist/chunk-5jn2z3nf.js +3 -0
- package/dist/chunk-5npr1qyq.js +574 -0
- package/dist/chunk-5sfky0gz.js +8 -0
- package/dist/chunk-5t7xqdvk.js +3 -0
- package/dist/chunk-5tpqj6ag.js +10 -0
- package/dist/chunk-5v5015am.js +12 -0
- package/dist/chunk-5wawdxv2.js +7 -0
- package/dist/chunk-6btrg3ff.js +2 -0
- package/dist/chunk-6skbzman.js +6 -0
- package/dist/chunk-6sz698ew.js +11 -0
- package/dist/chunk-6xzrzmsr.js +2 -0
- package/dist/chunk-7848rf5q.js +63 -0
- package/dist/chunk-7ep2edcv.js +12 -0
- package/dist/chunk-7svw66kw.js +13 -0
- package/dist/chunk-7xgr8vx6.js +2 -0
- package/dist/chunk-7zjn6m1m.js +2 -0
- package/dist/chunk-8atqb297.js +12 -0
- package/dist/chunk-8ebkxjar.js +7 -0
- package/dist/chunk-8j3aw4qg.js +3 -0
- package/dist/chunk-8jy0dvcn.js +3 -0
- package/dist/chunk-8refh038.js +2 -0
- package/dist/chunk-93cszp8k.js +3 -0
- package/dist/chunk-93ze3gcb.js +2 -0
- package/dist/chunk-98yxzxtd.js +2 -0
- package/dist/chunk-9g64kggy.js +3 -0
- package/dist/chunk-9h1pwxb2.js +8 -0
- package/dist/chunk-9j4j9nrm.js +2 -0
- package/dist/chunk-9kzczwh0.js +3 -0
- package/dist/chunk-9n629gtn.js +3 -0
- package/dist/chunk-9y59sxde.js +2 -0
- package/dist/chunk-a2m5jyd8.js +2 -0
- package/dist/chunk-a595cp8s.js +2 -0
- package/dist/chunk-ak0k3m4q.js +3 -0
- package/dist/chunk-apksmrz9.js +3 -0
- package/dist/chunk-b05r09sj.js +10 -0
- package/dist/chunk-b47e563q.js +2 -0
- package/dist/chunk-b57avnse.js +2 -0
- package/dist/chunk-bfjq7w7k.js +2 -0
- package/dist/chunk-bhc70qet.js +3 -0
- package/dist/chunk-bvtscj68.js +2 -0
- package/dist/chunk-bw2cy5v0.js +8 -0
- package/dist/chunk-c7dvyh2x.js +2 -0
- package/dist/chunk-cbz8b7g5.js +3 -0
- package/dist/chunk-cw4vbnet.js +3 -0
- package/dist/chunk-czcj3j9y.js +2 -0
- package/dist/chunk-dg466kdp.js +2 -0
- package/dist/chunk-dmscgnhq.js +2 -0
- package/dist/chunk-dtk4m8rm.js +3 -0
- package/dist/chunk-dy7akyj3.js +2 -0
- package/dist/chunk-e2wv2sp4.js +2 -0
- package/dist/chunk-e8j03wnd.js +3 -0
- package/dist/chunk-egkp6tct.js +2 -0
- package/dist/chunk-emfc800a.js +2 -0
- package/dist/chunk-envnht72.js +4 -0
- package/dist/chunk-eskw1cj2.js +3 -0
- package/dist/chunk-ezz15tyg.js +2 -0
- package/dist/chunk-fkmzj0qt.js +16 -0
- package/dist/chunk-fqt3c3g5.js +4 -0
- package/dist/chunk-frbht418.js +19 -0
- package/dist/chunk-ftz8cqfq.js +2 -0
- package/dist/chunk-g4jxdrr6.js +2 -0
- package/dist/chunk-g52xzmrr.js +2 -0
- package/dist/chunk-gbtvkje9.js +4 -0
- package/dist/chunk-gm9msqq5.js +8 -0
- package/dist/chunk-gxat3dpd.js +3 -0
- package/dist/chunk-hfppq1w5.js +4 -0
- package/dist/chunk-jdg870gy.js +1683 -0
- package/dist/chunk-jfz77m78.js +3 -0
- package/dist/chunk-jg9r58pf.js +16 -0
- package/dist/chunk-jgzt4945.js +2 -0
- package/dist/chunk-jh2epywq.js +2 -0
- package/dist/chunk-jpj6a56k.js +2 -0
- package/dist/chunk-jw4sgq23.js +2 -0
- package/dist/chunk-jws11ngd.js +2 -0
- package/dist/chunk-jxhz82qt.js +2 -0
- package/dist/chunk-k19y2psf.js +4 -0
- package/dist/chunk-k6cj14zk.js +2 -0
- package/dist/chunk-kktm0pdc.js +3 -0
- package/dist/chunk-kmr27ake.js +160 -0
- package/dist/chunk-kyhwvbvq.js +2 -0
- package/dist/chunk-mgn5pejx.js +2 -0
- package/dist/chunk-mskyzxb3.js +3 -0
- package/dist/chunk-my9cfmvt.js +5 -0
- package/dist/chunk-n4vx7kvs.js +389 -0
- package/dist/chunk-nc44rvs7.js +23 -0
- package/dist/chunk-ng3vbpmy.js +3 -0
- package/dist/chunk-nmnp5g5p.js +228 -0
- package/dist/chunk-nn0t3xmn.js +2 -0
- package/dist/chunk-npr41z9a.js +19 -0
- package/dist/chunk-ntvr3177.js +25 -0
- package/dist/chunk-pkc5hkha.js +2 -0
- package/dist/chunk-ppg6zhae.js +3 -0
- package/dist/chunk-pqwm9zk1.js +6 -0
- package/dist/chunk-ptvjmfqx.js +2 -0
- package/dist/chunk-q1r48y0y.js +34 -0
- package/dist/chunk-q9yddd1r.js +3 -0
- package/dist/chunk-qavtgsrh.js +2 -0
- package/dist/chunk-qvh8ghjw.js +7 -0
- package/dist/chunk-qx6r187q.js +2 -0
- package/dist/chunk-r093mfa8.js +32 -0
- package/dist/chunk-rbaj9ktq.js +2 -0
- package/dist/chunk-rkf9ynkx.js +3 -0
- package/dist/chunk-rpp44jtx.js +3 -0
- package/dist/chunk-rrvwp351.js +2 -0
- package/dist/chunk-rs8fsgqt.js +81 -0
- package/dist/chunk-s4gy87ft.js +8 -0
- package/dist/chunk-s5qq2ch2.js +12 -0
- package/dist/chunk-s92578qx.js +71 -0
- package/dist/chunk-snsb760m.js +2 -0
- package/dist/chunk-sp1cvejp.js +2 -0
- package/dist/chunk-spb3tm25.js +4 -0
- package/dist/chunk-srnmswkj.js +2 -0
- package/dist/chunk-sxgbzwrs.js +2 -0
- package/dist/chunk-t2s6m9t2.js +35 -0
- package/dist/chunk-t98sdxty.js +2 -0
- package/dist/chunk-tbnxx5na.js +2 -0
- package/dist/chunk-tfxm3qz4.js +2 -0
- package/dist/chunk-treb38pz.js +3 -0
- package/dist/chunk-tvw8tfpr.js +6 -0
- package/dist/chunk-v107htgw.js +101 -0
- package/dist/chunk-v8at4gnt.js +2 -0
- package/dist/chunk-vmr3get8.js +2 -0
- package/dist/chunk-vqrnejgj.js +71 -0
- package/dist/chunk-vvwy955j.js +3 -0
- package/dist/chunk-w5jxffnq.js +2 -0
- package/dist/chunk-wcbh5jqy.js +3 -0
- package/dist/chunk-wfmrnep1.js +2 -0
- package/dist/chunk-wk11yy8h.js +3 -0
- package/dist/chunk-wn5f1tfj.js +2 -0
- package/dist/chunk-wpm2p1gq.js +3 -0
- package/dist/chunk-wxkyv5gj.js +2 -0
- package/dist/chunk-wyed730e.js +2 -0
- package/dist/chunk-x65zs89t.js +3 -0
- package/dist/chunk-x6zjq78z.js +2 -0
- package/dist/chunk-xedav0qx.js +3 -0
- package/dist/chunk-xmftb9ad.js +38 -0
- package/dist/chunk-xvtkw7hj.js +3 -0
- package/dist/chunk-xy0txg0n.js +2 -0
- package/dist/chunk-y7s5cpwr.js +34 -0
- package/dist/chunk-yg48tfvv.js +16 -0
- package/dist/chunk-ygpen625.js +3 -0
- package/dist/chunk-ymb45bt6.js +2 -0
- package/dist/chunk-yp2zfcvh.js +8 -0
- package/dist/chunk-z3mx7n44.js +3 -0
- package/dist/chunk-zaj612bw.js +3 -0
- package/dist/chunk-zb3179f9.js +3 -0
- package/dist/chunk-zhd8f4pc.js +759 -0
- package/dist/chunk-zjpnyah2.js +3 -0
- package/dist/cli/cmd/tui/worker.js +2 -0
- package/dist/highlights-eq9cgrbb.scm +604 -0
- package/dist/highlights-ghv9g403.scm +205 -0
- package/dist/highlights-hk7bwhj4.scm +284 -0
- package/dist/highlights-r812a2qc.scm +150 -0
- package/dist/highlights-x6tmsnaa.scm +115 -0
- package/dist/index.js +146 -5742
- package/dist/injections-73j83es3.scm +27 -0
- package/dist/muxcode-linux-x64 +0 -0
- package/dist/nope-03-2z8weyjw.mp3 +0 -0
- package/dist/photon_rs_bg-bq08arze.wasm +0 -0
- package/dist/staplebops-06-rz29m246.mp3 +0 -0
- package/dist/tree-sitter-3jzf13jk.wasm +0 -0
- package/dist/tree-sitter-bash-hq5s6fxb.wasm +0 -0
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-powershell-ryb2ffqs.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/dist/yup-01-30ecpeh9.mp3 +0 -0
- package/package.json +2 -2
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{il as Ue,jl as T,nl as E}from"./chunk-4mgyaytc.js";import{om as S}from"./chunk-n4vx7kvs.js";import{Dn as qe,En as je}from"./chunk-vqrnejgj.js";import{$o as se,Ar as J,Bq as xe,Ep as ee,Gr as Ae,Hr as ve,Jp as F,Op as W,Rp as O,Xr as Z,_r as l,dp as De,gq as D,no as Q,po as I,up as ie,uq as me,wp as be,xp as B,xq as ke,zq as fe}from"./chunk-zhd8f4pc.js";import{xs as C}from"./chunk-8jy0dvcn.js";import{wv as we}from"./chunk-ng3vbpmy.js";import{AF as e,Aw as ye,Dw as _,Fx as V,Rx as G,Yz as v,eC as t,fz as oe,gA as re}from"./chunk-1mqsg5s7.js";import{SF as ne}from"./chunk-8j3aw4qg.js";var U={};ne(U,{layer:()=>ae,defaultLayer:()=>Me,Truncate:()=>U,Service:()=>K,MAX_LINES:()=>M,MAX_BYTES:()=>X,GLOB:()=>Ze,DIR:()=>Ie});import L from"path";var Ne=e.String.check(e.isStartsWith("tool")).pipe(e.brand("ToolID")),te=Ne.pipe(ee((n)=>({ascending:(r)=>n.make(F.ascending("tool",r))})));import Qe from"path";var H=Qe.join(C.Path.data,"tool-output");var Ve=se({service:"truncation"}),Te=G.days(7),M=2000,X=51200,Ie=H,Ze=L.join(H,"*");function Le(n){if(!n?.permission)return!1;return Z("task","*",n.permission).action!=="deny"}class K extends V.Service()("@muxcode/Truncate"){}var ae=v.effect(K,t.gen(function*(){let n=yield*B.Service,r=t.fn("Truncate.cleanup")(function*(){let p=F.timestamp(F.create("tool","ascending",Date.now()-G.toMillis(Te))),g=yield*n.readDirectory(H).pipe(t.map((u)=>u.filter((w)=>w.startsWith("tool_"))),t.catch(()=>t.succeed([])));for(let u of g){if(F.timestamp(u)>=p)continue;yield*n.remove(L.join(H,u)).pipe(t.catch(()=>t.void))}}),o=t.fn("Truncate.write")(function*(p){let g=L.join(H,te.ascending());return yield*n.ensureDir(H).pipe(t.orDie),yield*n.writeFileString(g,p).pipe(t.orDie),g}),c=t.fn("Truncate.limits")(function*(){let p=yield*t.serviceOption(J.Service);if(_.isNone(p))return{maxLines:M,maxBytes:X};let g=yield*p.value.get().pipe(t.catch(()=>t.succeed(void 0)));return{maxLines:g?.tool_output?.max_lines??M,maxBytes:g?.tool_output?.max_bytes??X}}),a=t.fn("Truncate.output")(function*(p,g={},u){let w=yield*c(),f=g.maxLines??w.maxLines,A=g.maxBytes??w.maxBytes,x=g.direction??"head",y=p.split(`
|
|
3
|
+
`),b=Buffer.byteLength(p,"utf-8");if(y.length<=f&&b<=A)return{content:p,truncated:!1};let d=[],m=0,q=0,j=!1;if(x==="head")for(m=0;m<y.length&&m<f;m++){let R=Buffer.byteLength(y[m],"utf-8")+(m>0?1:0);if(q+R>A){j=!0;break}d.push(y[m]),q+=R}else for(m=y.length-1;m>=0&&d.length<f;m--){let R=Buffer.byteLength(y[m],"utf-8")+(d.length>0?1:0);if(q+R>A){j=!0;break}d.unshift(y[m]),q+=R}let k=j?b-q:y.length-d.length,i=j?"bytes":"lines",h=d.join(`
|
|
4
|
+
`),s=yield*o(p),z=Le(u)?`The tool call succeeded but the output was truncated. Full output saved to: ${s}
|
|
5
|
+
Use the Task tool to have explore agent process this file with Grep and Read (with offset/limit). Do NOT read the full file yourself - delegate to save context.`:`The tool call succeeded but the output was truncated. Full output saved to: ${s}
|
|
6
|
+
Use Grep to search the full content or Read with offset/limit to view specific sections.`;return{content:x==="head"?`${h}
|
|
7
|
+
|
|
8
|
+
...${k} ${i} truncated...
|
|
9
|
+
|
|
10
|
+
${z}`:`...${k} ${i} truncated...
|
|
11
|
+
|
|
12
|
+
${z}
|
|
13
|
+
|
|
14
|
+
${h}`,truncated:!0,outputPath:s}});return yield*r().pipe(t.catchCause((p)=>{return Ve.error("truncation cleanup failed",{cause:oe.pretty(p)}),t.void}),t.repeat(re.spaced(G.hours(1))),t.delay(G.minutes(1)),t.forkScoped),K.of({cleanup:r,write:o,output:a,limits:c})})),Me=ae.pipe(v.provide(B.defaultLayer),v.provide(ie.layer));var N={};ne(N,{use:()=>et,layer:()=>Ye,defaultLayer:()=>tt,Service:()=>$,Info:()=>Pe,Agent:()=>N});var he=`You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.
|
|
15
|
+
|
|
16
|
+
**Important Context**: You may have access to project-specific instructions from CLAUDE.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices.
|
|
17
|
+
|
|
18
|
+
When a user describes what they want an agent to do, you will:
|
|
19
|
+
|
|
20
|
+
1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from CLAUDE.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise.
|
|
21
|
+
|
|
22
|
+
2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach.
|
|
23
|
+
|
|
24
|
+
3. **Architect Comprehensive Instructions**: Develop a system prompt that:
|
|
25
|
+
|
|
26
|
+
- Establishes clear behavioral boundaries and operational parameters
|
|
27
|
+
- Provides specific methodologies and best practices for task execution
|
|
28
|
+
- Anticipates edge cases and provides guidance for handling them
|
|
29
|
+
- Incorporates any specific requirements or preferences mentioned by the user
|
|
30
|
+
- Defines output format expectations when relevant
|
|
31
|
+
- Aligns with project-specific coding standards and patterns from CLAUDE.md
|
|
32
|
+
|
|
33
|
+
4. **Optimize for Performance**: Include:
|
|
34
|
+
|
|
35
|
+
- Decision-making frameworks appropriate to the domain
|
|
36
|
+
- Quality control mechanisms and self-verification steps
|
|
37
|
+
- Efficient workflow patterns
|
|
38
|
+
- Clear escalation or fallback strategies
|
|
39
|
+
|
|
40
|
+
5. **Create Identifier**: Design a concise, descriptive identifier that:
|
|
41
|
+
- Uses lowercase letters, numbers, and hyphens only
|
|
42
|
+
- Is typically 2-4 words joined by hyphens
|
|
43
|
+
- Clearly indicates the agent's primary function
|
|
44
|
+
- Is memorable and easy to type
|
|
45
|
+
- Avoids generic terms like "helper" or "assistant"
|
|
46
|
+
|
|
47
|
+
6 **Example agent descriptions**:
|
|
48
|
+
|
|
49
|
+
- in the 'whenToUse' field of the JSON object, you should include examples of when this agent should be used.
|
|
50
|
+
- examples should be of the form:
|
|
51
|
+
- <example>
|
|
52
|
+
Context: The user is creating a code-review agent that should be called after a logical chunk of code is written.
|
|
53
|
+
user: "Please write a function that checks if a number is prime"
|
|
54
|
+
assistant: "Here is the relevant function: "
|
|
55
|
+
<function call omitted for brevity only for this example>
|
|
56
|
+
<commentary>
|
|
57
|
+
Since the user is greeting, use the Task tool to launch the greeting-responder agent to respond with a friendly joke.
|
|
58
|
+
</commentary>
|
|
59
|
+
assistant: "Now let me use the code-reviewer agent to review the code"
|
|
60
|
+
</example>
|
|
61
|
+
- <example>
|
|
62
|
+
Context: User is creating an agent to respond to the word "hello" with a friendly jok.
|
|
63
|
+
user: "Hello"
|
|
64
|
+
assistant: "I'm going to use the Task tool to launch the greeting-responder agent to respond with a friendly joke"
|
|
65
|
+
<commentary>
|
|
66
|
+
Since the user is greeting, use the greeting-responder agent to respond with a friendly joke.
|
|
67
|
+
</commentary>
|
|
68
|
+
</example>
|
|
69
|
+
- If the user mentioned or implied that the agent should be used proactively, you should include examples of this.
|
|
70
|
+
- NOTE: Ensure that in the examples, you are making the assistant use the Agent tool and not simply respond directly to the task.
|
|
71
|
+
|
|
72
|
+
Your output must be a valid JSON object with exactly these fields:
|
|
73
|
+
{
|
|
74
|
+
"identifier": "A unique, descriptive identifier using lowercase letters, numbers, and hyphens (e.g., 'code-reviewer', 'api-docs-writer', 'test-generator')",
|
|
75
|
+
"whenToUse": "A precise, actionable description starting with 'Use this agent when...' that clearly defines the triggering conditions and use cases. Ensure you include examples as described above.",
|
|
76
|
+
"systemPrompt": "The complete system prompt that will govern the agent's behavior, written in second person ('You are...', 'You will...') and structured for maximum clarity and effectiveness"
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
Key principles for your system prompts:
|
|
80
|
+
|
|
81
|
+
- Be specific rather than generic - avoid vague instructions
|
|
82
|
+
- Include concrete examples when they would clarify behavior
|
|
83
|
+
- Balance comprehensiveness with clarity - every instruction should add value
|
|
84
|
+
- Ensure the agent has enough context to handle variations of the core task
|
|
85
|
+
- Make the agent proactive in seeking clarification when needed
|
|
86
|
+
- Build in quality assurance and self-correction mechanisms
|
|
87
|
+
|
|
88
|
+
Remember: The agents you create should be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
|
|
89
|
+
`;var ce=`You are an anchored context summarization assistant for coding sessions.
|
|
90
|
+
|
|
91
|
+
Summarize only the conversation history you are given. The newest turns may be kept verbatim outside your summary, so focus on the older context that still matters for continuing the work.
|
|
92
|
+
|
|
93
|
+
If the prompt includes a <previous-summary> block, treat it as the current anchored summary. Update it with the new history by preserving still-true details, removing stale details, and merging in new facts.
|
|
94
|
+
|
|
95
|
+
Always follow the exact output structure requested by the user prompt. Keep every section, preserve exact file paths and identifiers when known, and prefer terse bullets over paragraphs.
|
|
96
|
+
|
|
97
|
+
Do not answer the conversation itself. Do not mention that you are summarizing, compacting, or merging context. Respond in the same language as the conversation.
|
|
98
|
+
`;var le=`You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
|
|
99
|
+
|
|
100
|
+
Your strengths:
|
|
101
|
+
- Rapidly finding files using glob patterns
|
|
102
|
+
- Searching code and text with powerful regex patterns
|
|
103
|
+
- Reading and analyzing file contents
|
|
104
|
+
|
|
105
|
+
Guidelines:
|
|
106
|
+
- Use Glob for broad file pattern matching
|
|
107
|
+
- Use Grep for searching file contents with regex
|
|
108
|
+
- Use Read when you know the specific file path you need to read
|
|
109
|
+
- Use Bash for file operations like copying, moving, or listing directory contents
|
|
110
|
+
- Adapt your search approach based on the thoroughness level specified by the caller
|
|
111
|
+
- Return file paths as absolute paths in your final response
|
|
112
|
+
- For clear communication, avoid using emojis
|
|
113
|
+
- Do not create any files, or run bash commands that modify the user's system state in any way
|
|
114
|
+
|
|
115
|
+
Complete the user's search request efficiently and report your findings clearly.
|
|
116
|
+
`;var ue=`You are \`scout\`, a read-only research agent for external libraries, dependency source, and documentation.
|
|
117
|
+
|
|
118
|
+
Your purpose is to investigate code outside the local workspace and return evidence-backed findings without modifying the user's workspace.
|
|
119
|
+
|
|
120
|
+
Use this agent when asked to:
|
|
121
|
+
- inspect dependency repositories or library source
|
|
122
|
+
- compare local code against upstream implementations
|
|
123
|
+
- research public GitHub repositories the environment can clone
|
|
124
|
+
- explain how a library or framework works by reading its source and docs
|
|
125
|
+
- investigate third-party APIs, workflows, or behavior outside the current workspace
|
|
126
|
+
|
|
127
|
+
Working style:
|
|
128
|
+
1. When the task involves a GitHub repository or dependency source, use \`repo_clone\` first.
|
|
129
|
+
2. After cloning, use \`Glob\`, \`Grep\`, and \`Read\` to inspect the cloned repository.
|
|
130
|
+
3. Use \`WebFetch\` for official documentation pages when source alone is not enough.
|
|
131
|
+
4. Prefer direct code and documentation evidence over assumptions.
|
|
132
|
+
5. If multiple external repositories are relevant, inspect each one before drawing conclusions.
|
|
133
|
+
|
|
134
|
+
Research standards:
|
|
135
|
+
- cite exact absolute file paths and line references whenever possible
|
|
136
|
+
- separate what is verified from what is inferred
|
|
137
|
+
- if the answer depends on branch state, note that you are reading the repository's current default clone state unless the caller specifies otherwise
|
|
138
|
+
- if a repository cannot be cloned or accessed, say so explicitly and continue with whatever evidence is still available
|
|
139
|
+
- call out uncertainty clearly instead of smoothing over gaps
|
|
140
|
+
|
|
141
|
+
Output expectations:
|
|
142
|
+
- start with the direct answer
|
|
143
|
+
- then explain the evidence repository by repository or source by source
|
|
144
|
+
- include file references when relevant
|
|
145
|
+
- keep the explanation organized and easy to scan
|
|
146
|
+
|
|
147
|
+
Constraints:
|
|
148
|
+
- do not modify files or run tools that change the user's workspace
|
|
149
|
+
- return absolute file paths for cloned-repo findings in your final response
|
|
150
|
+
|
|
151
|
+
Complete the user's research request efficiently and report your findings clearly.
|
|
152
|
+
`;var de=`Summarize what was done in this conversation. Write like a pull request description.
|
|
153
|
+
|
|
154
|
+
Rules:
|
|
155
|
+
- 2-3 sentences max
|
|
156
|
+
- Describe the changes made, not the process
|
|
157
|
+
- Do not mention running tests, builds, or other validation steps
|
|
158
|
+
- Do not explain what the user asked for
|
|
159
|
+
- Write in first person (I added..., I fixed...)
|
|
160
|
+
- Never ask questions or add new questions
|
|
161
|
+
- If the conversation ends with an unanswered question to the user, preserve that exact question
|
|
162
|
+
- If the conversation ends with an imperative statement or request to the user (e.g. "Now please run the command and paste the console output"), always include that exact request in the summary
|
|
163
|
+
`;var pe=`You are a title generator. You output ONLY a thread title. Nothing else.
|
|
164
|
+
|
|
165
|
+
<task>
|
|
166
|
+
Generate a brief title that would help the user find this conversation later.
|
|
167
|
+
|
|
168
|
+
Follow all rules in <rules>
|
|
169
|
+
Use the <examples> so you know what a good title looks like.
|
|
170
|
+
Your output must be:
|
|
171
|
+
- A single line
|
|
172
|
+
- \u226450 characters
|
|
173
|
+
- No explanations
|
|
174
|
+
</task>
|
|
175
|
+
|
|
176
|
+
<rules>
|
|
177
|
+
- you MUST use the same language as the user message you are summarizing
|
|
178
|
+
- Title must be grammatically correct and read naturally - no word salad
|
|
179
|
+
- Never include tool names in the title (e.g. "read tool", "bash tool", "edit tool")
|
|
180
|
+
- Focus on the main topic or question the user needs to retrieve
|
|
181
|
+
- Vary your phrasing - avoid repetitive patterns like always starting with "Analyzing"
|
|
182
|
+
- When a file is mentioned, focus on WHAT the user wants to do WITH the file, not just that they shared it
|
|
183
|
+
- Keep exact: technical terms, numbers, filenames, HTTP codes
|
|
184
|
+
- Remove: the, this, my, a, an
|
|
185
|
+
- Never assume tech stack
|
|
186
|
+
- Never use tools
|
|
187
|
+
- NEVER respond to questions, just generate a title for the conversation
|
|
188
|
+
- The title should NEVER include "summarizing" or "generating" when generating a title
|
|
189
|
+
- DO NOT SAY YOU CANNOT GENERATE A TITLE OR COMPLAIN ABOUT THE INPUT
|
|
190
|
+
- Always output something meaningful, even if the input is minimal.
|
|
191
|
+
- If the user message is short or conversational (e.g. "hello", "lol", "what's up", "hey"):
|
|
192
|
+
\u2192 create a title that reflects the user's tone or intent (such as Greeting, Quick check-in, Light chat, Intro message, etc.)
|
|
193
|
+
</rules>
|
|
194
|
+
|
|
195
|
+
<examples>
|
|
196
|
+
"debug 500 errors in production" \u2192 Debugging production 500 errors
|
|
197
|
+
"refactor user service" \u2192 Refactoring user service
|
|
198
|
+
"why is app.js failing" \u2192 app.js failure investigation
|
|
199
|
+
"implement rate limiting" \u2192 Rate limiting implementation
|
|
200
|
+
"how do I connect postgres to my API" \u2192 Postgres API connection
|
|
201
|
+
"best practices for React hooks" \u2192 React hooks best practices
|
|
202
|
+
"@src/auth.ts can you add refresh token support" \u2192 Auth refresh token support
|
|
203
|
+
"@utils/parser.ts this is broken" \u2192 Parser bug fix
|
|
204
|
+
"look at @config.json" \u2192 Config review
|
|
205
|
+
"@App.tsx add dark mode toggle" \u2192 Dark mode toggle in App
|
|
206
|
+
</examples>
|
|
207
|
+
`;import Y from"path";var Pe=e.Struct({name:e.String,description:e.optional(e.String),mode:e.Literals(["subagent","primary","all"]),native:e.optional(e.Boolean),hidden:e.optional(e.Boolean),topP:e.optional(e.Finite),temperature:e.optional(e.Finite),color:e.optional(e.String),permission:l.Ruleset,model:e.optional(e.Struct({modelID:je,providerID:qe})),variant:e.optional(e.String),prompt:e.optional(e.String),options:e.Record(e.String,e.Unknown),steps:e.optional(e.Finite)}).annotate({identifier:"Agent"}),ge=e.Struct({identifier:e.String,whenToUse:e.String,systemPrompt:e.String});class $ extends V.Service()("@muxcode/Agent"){}var et=be($),Ye=v.effect($,t.gen(function*(){let n=yield*J.Service,r=yield*O.Service,o=yield*E.Service,c=yield*S.Service,a=yield*T.Service,p=yield*D.Service,g=yield*W.make(t.fn("Agent.state")(function*(u){let w=yield*n.get(),f=yield*c.dirs(),A=[U.GLOB,Y.join(C.Path.tmp,"*"),...f.map((i)=>Y.join(i,"*"))],x={"*":"ask",...Object.fromEntries(A.map((i)=>[i,"allow"]))},y=l.fromConfig({"*":"allow",doom_loop:"ask",external_directory:{"*":"ask",...Object.fromEntries(A.map((i)=>[i,"allow"]))},question:"deny",plan_enter:"deny",plan_exit:"deny",repo_clone:"deny",repo_overview:"deny",read:{"*":"allow","*.env":"ask","*.env.*":"ask","*.env.example":"allow"}}),b=l.fromConfig(w.permission??{}),d={build:{name:"build",description:"The default agent. Executes tools based on configured permissions.",options:{},permission:l.merge(y,l.fromConfig({question:"allow",plan_enter:"allow"}),b),mode:"primary",native:!0},plan:{name:"plan",description:"Plan mode. Disallows all edit tools.",options:{},permission:l.merge(y,l.fromConfig({question:"allow",plan_exit:"allow",external_directory:{[Y.join(C.Path.data,"plans","*")]:"allow"},edit:{"*":"deny",[Y.join(".muxcode","plans","*.md")]:"allow",[Y.relative(u.worktree,Y.join(C.Path.data,Y.join("plans","*.md")))]:"allow"}}),b),mode:"primary",native:!0},general:{name:"general",description:"General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel.",permission:l.merge(y,l.fromConfig({todowrite:"deny"}),b),options:{},mode:"subagent",native:!0},explore:{name:"explore",permission:l.merge(y,l.fromConfig({"*":"deny",grep:"allow",glob:"allow",list:"allow",bash:"allow",webfetch:"allow",websearch:"allow",read:"allow",external_directory:x}),b),description:'Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?"). When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions.',prompt:le,options:{},mode:"subagent",native:!0},...p.experimentalScout?{scout:{name:"scout",permission:l.merge(y,l.fromConfig({"*":"deny",grep:"allow",glob:"allow",webfetch:"allow",websearch:"allow",read:"allow",repo_clone:"allow",repo_overview:"allow",external_directory:{...x,[Y.join(C.Path.repos,"*")]:"allow"}}),b),description:"Docs and dependency-source specialist. Use this when you need to inspect external documentation, clone dependency repositories into the managed cache, and research library implementation details without modifying the user's workspace.",prompt:ue,options:{},mode:"subagent",native:!0}}:{},compaction:{name:"compaction",mode:"primary",native:!0,hidden:!0,prompt:ce,permission:l.merge(y,l.fromConfig({"*":"deny"}),b),options:{}},title:{name:"title",mode:"primary",options:{},native:!0,hidden:!0,temperature:0.5,permission:l.merge(y,l.fromConfig({"*":"deny"}),b),prompt:pe},summary:{name:"summary",mode:"primary",options:{},native:!0,hidden:!0,permission:l.merge(y,l.fromConfig({"*":"deny"}),b),prompt:de}};for(let[i,h]of Object.entries(w.agent??{})){if(h.disable){delete d[i];continue}let s=d[i];if(!s)s=d[i]={name:i,mode:"all",permission:l.merge(y,b),options:{},native:!1};if(h.model)s.model=T.parseModel(h.model);s.variant=h.variant??s.variant,s.prompt=h.prompt??s.prompt,s.description=h.description??s.description,s.temperature=h.temperature??s.temperature,s.topP=h.top_p??s.topP,s.mode=h.mode??s.mode,s.color=h.color??s.color,s.hidden=h.hidden??s.hidden,s.name=h.name??s.name,s.steps=h.steps??s.steps,s.options=xe(s.options,h.options??{}),s.permission=l.merge(s.permission,l.fromConfig(h.permission??{}))}for(let i in d){if(d[i].permission.some((z)=>{if(z.permission!=="external_directory")return!1;if(z.action!=="deny")return!1;return z.pattern===U.GLOB}))continue;d[i].permission=l.merge(d[i].permission,l.fromConfig({external_directory:{[U.GLOB]:"allow"}}))}let m=t.fnUntraced(function*(i){return d[i]}),q=t.fnUntraced(function*(){let i=yield*n.get();return me(d,ke(),fe([(h)=>i.default_agent?h.name===i.default_agent:h.name==="build","desc"],[(h)=>h.name,"asc"]))}),j=t.fnUntraced(function*(){let i=yield*n.get();if(i.default_agent){let s=d[i.default_agent];if(!s)throw Error(`default agent "${i.default_agent}" not found`);if(s.mode==="subagent")throw Error(`default agent "${i.default_agent}" is a subagent`);if(s.hidden===!0)throw Error(`default agent "${i.default_agent}" is hidden`);return s}let h=Object.values(d).find((s)=>s.mode!=="subagent"&&s.hidden!==!0);if(!h)throw Error("no primary visible agent found");return h}),k=t.fnUntraced(function*(){return(yield*j()).name});return{get:m,list:q,defaultInfo:j,defaultAgent:k}}));return $.of({get:t.fn("Agent.get")(function*(u){return yield*W.useEffect(g,(w)=>w.get(u))}),list:t.fn("Agent.list")(function*(){return yield*W.useEffect(g,(u)=>u.list())}),defaultInfo:t.fn("Agent.defaultInfo")(function*(){return yield*W.useEffect(g,(u)=>u.defaultInfo())}),defaultAgent:t.fn("Agent.defaultAgent")(function*(){return yield*W.useEffect(g,(u)=>u.defaultAgent())}),generate:t.fn("Agent.generate")(function*(u){let w=yield*n.get(),f=u.model??(yield*a.defaultModel()),A=yield*a.getModel(f.providerID,f.modelID),x=yield*a.getLanguage(A),y=w.experimental?.openTelemetry?ye(yield*t.serviceOption(we)):void 0,b=[he];yield*o.trigger("experimental.chat.system.transform",{model:A},{system:b});let d=yield*W.useEffect(g,(k)=>k.list()),m=yield*r.get(f.providerID).pipe(t.orDie),q=f.providerID==="openai"&&m?.type==="oauth",j={experimental_telemetry:{isEnabled:w.experimental?.openTelemetry,tracer:y,metadata:{userId:w.username??"unknown"}},temperature:0.3,messages:[...q?[]:b.map((k)=>({role:"system",content:k})),{role:"user",content:`Create an agent configuration based on this request: "${u.description}".
|
|
208
|
+
|
|
209
|
+
IMPORTANT: The following identifiers already exist and must NOT be used: ${d.map((k)=>k.name).join(", ")}
|
|
210
|
+
Return ONLY the JSON object, no other text, do not wrap in backticks`}],model:x,schema:Object.assign(e.toStandardSchemaV1(ge),e.toStandardJSONSchemaV1(ge))};if(q)return yield*t.promise(async()=>{let k=ve({...j,providerOptions:Ue.providerOptions(A,{instructions:b.join(`
|
|
211
|
+
`),store:!1}),onError:()=>{}});for await(let i of k.fullStream)if(i.type==="error")throw i.error;return k.object});return yield*t.promise(()=>Ae(j).then((k)=>k.object))})})})),tt=Ye.pipe(v.provide(E.defaultLayer),v.provide(T.defaultLayer),v.provide(O.defaultLayer),v.provide(J.defaultLayer),v.provide(S.defaultLayer),v.provide(D.defaultLayer));class Ce extends e.TaggedErrorClass()("ToolInvalidArgumentsError",{tool:e.String,detail:e.String}){get message(){return`The ${this.tool} tool was called with invalid arguments: ${this.detail}.
|
|
212
|
+
Please rewrite the input so it satisfies the expected schema.`}}function nt(n,r,o,c){return()=>t.gen(function*(){let a=typeof r==="function"?{...yield*r()}:{...r},p=e.decodeUnknownEffect(a.parameters),g=a.execute;return a.execute=(u,w)=>{let f={"tool.name":n,"session.id":w.sessionID,"message.id":w.messageID,...w.callID?{"tool.call_id":w.callID}:{}};return t.gen(function*(){let A=yield*p(u).pipe(t.mapError((d)=>new Ce({tool:n,detail:a.formatValidationError?a.formatValidationError(d):String(d)}))),x=yield*g(A,w);if(x.metadata.truncated!==void 0)return x;let y=yield*c.get(w.agent),b=yield*o.output(x.output,{},y);return{...x,output:b.content,metadata:{...x.metadata,truncated:b.truncated,...b.truncated&&{outputPath:b.outputPath}}}}).pipe(t.orDie,t.withSpan("Tool.execute",{attributes:f}))},a})}function He(n,r){return Object.assign(t.gen(function*(){let o=yield*r,c=yield*K,a=yield*N.Service;return{id:n,init:nt(n,o,c,a)}}),{id:n})}function pn(n){return t.gen(function*(){return{...yield*n.init(),id:n.id}})}var Fe=process.env.EXA_API_KEY?`https://mcp.exa.ai/mcp?exaApiKey=${encodeURIComponent(process.env.EXA_API_KEY)}`:"https://mcp.exa.ai/mcp",Ke="https://search.parallel.ai/mcp",ot=e.Struct({result:e.Struct({content:e.Array(e.Struct({type:e.String,text:e.String}))})}),rt=e.decodeUnknownEffect(e.fromJsonString(ot)),ze=(n)=>t.gen(function*(){let r=n.trim();if(!r.startsWith("{"))return;return(yield*rt(r)).result.content.find((c)=>c.text)?.text}),st=t.fn("McpWebSearch.parseResponse")(function*(n){let r=n.trim(),o=r?yield*ze(r):void 0;if(o)return o;for(let c of n.split(`
|
|
213
|
+
`)){if(!c.startsWith("data: "))continue;let a=yield*ze(c.substring(6));if(a)return a}return}),Re=e.Struct({query:e.String,type:e.String,numResults:e.Number,livecrawl:e.String,contextMaxCharacters:e.optional(e.Number)}),Ge=e.Struct({objective:e.String,search_queries:e.Array(e.String),session_id:e.optional(e.String),model_name:e.optional(e.String)}),it=(n)=>e.Struct({jsonrpc:e.Literal("2.0"),id:e.Literal(1),method:e.Literal("tools/call"),params:e.Struct({name:e.String,arguments:n})}),P=(n,r,o,c,a,p,g)=>t.gen(function*(){let u=yield*Q.post(r).pipe(Q.accept("application/json, text/event-stream"),Q.setHeaders(g??{}),Q.schemaBodyJson(it(c))({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:o,arguments:a}})),f=yield*(yield*I.filterStatusOk(n).execute(u).pipe(t.timeoutOrElse({duration:p,orElse:()=>t.die(Error(`${o} request timed out`))}))).text;return yield*st(f)});var Je=`- Search the web using the session's web search provider - performs real-time web searches and can scrape content from specific URLs
|
|
214
|
+
- Provides up-to-date information for current events and recent data
|
|
215
|
+
- Supports configurable result counts and returns the content from the most relevant websites
|
|
216
|
+
- Use this tool for accessing information beyond knowledge cutoff
|
|
217
|
+
- Searches are performed automatically within a single API call
|
|
218
|
+
|
|
219
|
+
Usage notes:
|
|
220
|
+
- Supports live crawling modes when available: 'fallback' (backup if cached unavailable) or 'preferred' (prioritize live crawling)
|
|
221
|
+
- Search types when available: 'auto' (balanced), 'fast' (quick results), 'deep' (comprehensive search)
|
|
222
|
+
- Configurable context length for optimal LLM integration
|
|
223
|
+
- Domain filtering and advanced search options available
|
|
224
|
+
|
|
225
|
+
The current year is {{year}}. You MUST use this year when searching for recent information or current events
|
|
226
|
+
- Example: If the current year is 2026 and the user asks for "latest AI news", search for "AI news 2026", NOT "AI news 2025"
|
|
227
|
+
`;function $e(n){if(!n)return;let r=2166136261;for(let o=0;o<n.length;o++)r^=n.charCodeAt(o),r=Math.imul(r,16777619);return(r>>>0).toString(36)}var ct=e.Struct({query:e.String.annotate({description:"Websearch query"}),numResults:e.optional(e.Number).annotate({description:"Number of search results to return (default: 8)"}),livecrawl:e.optional(e.Literals(["fallback","preferred"])).annotate({description:"Live crawl mode - 'fallback': use live crawling as backup if cached content unavailable, 'preferred': prioritize live crawling (default: 'fallback')"}),type:e.optional(e.Literals(["auto","fast","deep"])).annotate({description:"Search type - 'auto': balanced search (default), 'fast': quick results, 'deep': comprehensive search"}),contextMaxCharacters:e.optional(e.Number).annotate({description:"Maximum characters for context string optimized for LLMs (default: 10000)"})}),jn=e.Literals(["exa","parallel"]);function lt(n,r={exa:!1,parallel:!1}){let o=process.env.MUXCODE_WEBSEARCH_PROVIDER;if(o==="exa"||o==="parallel")return o;if(r.parallel)return"parallel";if(r.exa)return"exa";return Number.parseInt($e(n)??"0",36)%2===0?"exa":"parallel"}function ut(n){if(n==="parallel")return"Parallel Web Search";if(n==="exa")return"Exa Web Search";return"Web Search"}function dt(n){let r=n?.model;if(!r||typeof r!=="object")return;let o="api"in r&&r.api&&typeof r.api==="object"?r.api:void 0,c=o&&"id"in o&&typeof o.id==="string"?o.id:void 0,a="id"in r&&typeof r.id==="string"?r.id:void 0;return(c??a)?.slice(0,100)}function pt(){let n={"User-Agent":`muxcode/${De}`};if(!process.env.PARALLEL_API_KEY)return n;return{...n,Authorization:`Bearer ${process.env.PARALLEL_API_KEY}`}}function gt(n,r,o,c){if(r==="parallel")return P(n,Ke,"web_search",Ge,{objective:o.query,search_queries:[o.query],session_id:c.sessionID,model_name:dt(c.extra)},"25 seconds",pt());return P(n,Fe,"web_search_exa",Re,{query:o.query,type:o.type||"auto",numResults:o.numResults||8,livecrawl:o.livecrawl||"fallback",contextMaxCharacters:o.contextMaxCharacters},"25 seconds")}var Un=He("websearch",t.gen(function*(){let n=yield*I.HttpClient,r=yield*D.Service;return{get description(){return Je.replace("{{year}}",new Date().getFullYear().toString())},parameters:ct,execute:(o,c)=>t.gen(function*(){let a=lt(c.sessionID,{exa:r.enableExa,parallel:r.enableParallel}),p=ut(a);return yield*c.metadata({title:`${p} "${o.query}"`,metadata:{provider:a}}),yield*c.ask({permission:"websearch",patterns:[o.query],always:["*"],metadata:{query:o.query,numResults:o.numResults,livecrawl:o.livecrawl,type:o.type,contextMaxCharacters:o.contextMaxCharacters,provider:a}}),{output:(yield*gt(n,a,o,c))??"No search results found. Please try a different query.",title:`${p}: ${o.query}`,metadata:{provider:a}}}).pipe(t.orDie)}}));
|
|
228
|
+
export{K as wk,Me as xk,U as yk,N as zk,He as Ak,pn as Bk,ut as Ck,Un as Dk};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ah as NN,Bh as QN,Eh as _,Fh as h,Gh as m,Hh as XN,Ih as YN,Kh as ZN,Lh as $N,Mh as C,Oh as JN,lh as I,nh as r,ph as l,th as O,uh as t,xh as e,zh as o}from"./chunk-yp2zfcvh.js";import{Tt as q,Xt as u,_t as v}from"./chunk-21x3anp4.js";import{Du as N}from"./chunk-ntvr3177.js";import"./chunk-8j3aw4qg.js";function s(Q){var J,z,B,j;if(Q==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let $=(J=Q.prompt_tokens)!=null?J:0,X=(z=Q.completion_tokens)!=null?z:0,Y=(j=(B=Q.completion_tokens_details)==null?void 0:B.reasoning_tokens)!=null?j:void 0,Z=Y!=null?X-Y:X;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:Z,reasoning:Y},raw:Q}}function BN(Q){var J;let z=[];for(let{role:B,content:j}of Q)switch(B){case"system":{z.push({role:"system",content:j});break}case"user":{if(j.length===1&&j[0].type==="text"){z.push({role:"user",content:j[0].text});break}z.push({role:"user",content:j.map(($)=>{switch($.type){case"text":return{type:"text",text:$.text};case"file":{if(!$.mediaType.startsWith("image/"))throw new v({functionality:"Non-image file content parts"});let X=$.mediaType==="image/*"?"image/jpeg":$.mediaType;return{type:"image_url",image_url:{url:$.data instanceof URL?$.data.toString():`data:${X};base64,${l($.data)}`}}}}})});break}case"assistant":{let $="",X="",Y=[];for(let Z of j)switch(Z.type){case"reasoning":{X+=Z.text;break}case"text":{$+=Z.text;break}case"tool-call":{Y.push({id:Z.toolCallId,type:"function",function:{name:Z.toolName,arguments:JSON.stringify(Z.input)}});break}}z.push({role:"assistant",content:$,...X.length>0?{reasoning:X}:null,...Y.length>0?{tool_calls:Y}:null});break}case"tool":{for(let $ of j){if($.type==="tool-approval-response")continue;let X=$.output,Y;switch(X.type){case"text":case"error-text":Y=X.value;break;case"execution-denied":Y=(J=X.reason)!=null?J:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(X.value);break}z.push({role:"tool",tool_call_id:$.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${B}`)}return z}function a({id:Q,model:J,created:z}){return{id:Q!=null?Q:void 0,modelId:J!=null?J:void 0,timestamp:z!=null?new Date(z*1000):void 0}}var GN=N.object({reasoningFormat:N.enum(["parsed","raw","hidden"]).optional(),reasoningEffort:N.enum(["none","default","low","medium","high"]).optional(),parallelToolCalls:N.boolean().optional(),user:N.string().optional(),structuredOutputs:N.boolean().optional(),strictJsonSchema:N.boolean().optional(),serviceTier:N.enum(["on_demand","flex","auto"]).optional()}),jN=N.object({error:N.object({message:N.string(),type:N.string()})}),g=ZN({errorSchema:jN,errorToMessage:(Q)=>Q.error.message}),zN=["openai/gpt-oss-20b","openai/gpt-oss-120b"];function KN(Q){return zN.includes(Q)}function UN(){return zN.join(", ")}function VN({tools:Q,toolChoice:J,modelId:z}){Q=(Q==null?void 0:Q.length)?Q:void 0;let B=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:B};let j=[];for(let X of Q)if(X.type==="provider")if(X.id==="groq.browser_search")if(!KN(z))B.push({type:"unsupported",feature:`provider-defined tool ${X.id}`,details:`Browser search is only supported on the following models: ${UN()}. Current model: ${z}`});else j.push({type:"browser_search"});else B.push({type:"unsupported",feature:`provider-defined tool ${X.id}`});else j.push({type:"function",function:{name:X.name,description:X.description,parameters:X.inputSchema,...X.strict!=null?{strict:X.strict}:{}}});if(J==null)return{tools:j,toolChoice:void 0,toolWarnings:B};let $=J.type;switch($){case"auto":case"none":case"required":return{tools:j,toolChoice:$,toolWarnings:B};case"tool":return{tools:j,toolChoice:{type:"function",function:{name:J.toolName}},toolWarnings:B};default:throw new v({functionality:`tool choice type: ${$}`})}}function n(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var LN=class{constructor(Q,J){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=Q,this.config=J}get provider(){return this.config.provider}async getArgs({prompt:Q,maxOutputTokens:J,temperature:z,topP:B,topK:j,frequencyPenalty:$,presencePenalty:X,stopSequences:Y,responseFormat:Z,seed:K,stream:L,tools:V,toolChoice:W,providerOptions:U}){var G,E,S;let b=[],H=await h({provider:"groq",providerOptions:U,schema:GN}),F=(G=H==null?void 0:H.structuredOutputs)!=null?G:!0,f=(E=H==null?void 0:H.strictJsonSchema)!=null?E:!0;if(j!=null)b.push({type:"unsupported",feature:"topK"});if((Z==null?void 0:Z.type)==="json"&&Z.schema!=null&&!F)b.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:k,toolChoice:D,toolWarnings:R}=VN({tools:V,toolChoice:W,modelId:this.modelId});return{args:{model:this.modelId,user:H==null?void 0:H.user,parallel_tool_calls:H==null?void 0:H.parallelToolCalls,max_tokens:J,temperature:z,top_p:B,frequency_penalty:$,presence_penalty:X,stop:Y,seed:K,response_format:(Z==null?void 0:Z.type)==="json"?F&&Z.schema!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:f,name:(S=Z.name)!=null?S:"response",description:Z.description}}:{type:"json_object"}:void 0,reasoning_format:H==null?void 0:H.reasoningFormat,reasoning_effort:H==null?void 0:H.reasoningEffort,service_tier:H==null?void 0:H.serviceTier,messages:BN(Q),tools:k,tool_choice:D},warnings:[...b,...R]}}async doGenerate(Q){var J,z;let{args:B,warnings:j}=await this.getArgs({...Q,stream:!1}),$=JSON.stringify(B),{responseHeaders:X,value:Y,rawValue:Z}=await m({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),body:B,failedResponseHandler:g,successfulResponseHandler:C(HN),abortSignal:Q.abortSignal,fetch:this.config.fetch}),K=Y.choices[0],L=[],V=K.message.content;if(V!=null&&V.length>0)L.push({type:"text",text:V});let W=K.message.reasoning;if(W!=null&&W.length>0)L.push({type:"reasoning",text:W});if(K.message.tool_calls!=null)for(let U of K.message.tool_calls)L.push({type:"tool-call",toolCallId:(J=U.id)!=null?J:O(),toolName:U.function.name,input:U.function.arguments});return{content:L,finishReason:{unified:n(K.finish_reason),raw:(z=K.finish_reason)!=null?z:void 0},usage:s(Y.usage),response:{...a(Y),headers:X,body:Z},warnings:j,request:{body:$}}}async doStream(Q){let{args:J,warnings:z}=await this.getArgs({...Q,stream:!0}),B=JSON.stringify({...J,stream:!0}),{responseHeaders:j,value:$}=await m({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),body:{...J,stream:!0},failedResponseHandler:g,successfulResponseHandler:$N(wN),abortSignal:Q.abortSignal,fetch:this.config.fetch}),X=[],Y={unified:"other",raw:void 0},Z=void 0,K=!0,L=!1,V=!1,W;return{stream:$.pipeThrough(new TransformStream({start(U){U.enqueue({type:"stream-start",warnings:z})},transform(U,G){var E,S,b,H,F,f,k,D,R,d,c,p,i;if(Q.includeRawChunks)G.enqueue({type:"raw",rawValue:U.rawValue});if(!U.success){Y={unified:"error",raw:void 0},G.enqueue({type:"error",error:U.error});return}let y=U.value;if("error"in y){Y={unified:"error",raw:void 0},G.enqueue({type:"error",error:y.error});return}if(K)K=!1,G.enqueue({type:"response-metadata",...a(y)});if(((E=y.x_groq)==null?void 0:E.usage)!=null)Z=y.x_groq.usage;let x=y.choices[0];if((x==null?void 0:x.finish_reason)!=null)Y={unified:n(x.finish_reason),raw:x.finish_reason};if((x==null?void 0:x.delta)==null)return;let M=x.delta;if(M.reasoning!=null&&M.reasoning.length>0){if(!V)G.enqueue({type:"reasoning-start",id:"reasoning-0"}),V=!0;G.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:M.reasoning})}if(M.content!=null&&M.content.length>0){if(V)G.enqueue({type:"reasoning-end",id:"reasoning-0"}),V=!1;if(!L)G.enqueue({type:"text-start",id:"txt-0"}),L=!0;G.enqueue({type:"text-delta",id:"txt-0",delta:M.content})}if(M.tool_calls!=null){if(V)G.enqueue({type:"reasoning-end",id:"reasoning-0"}),V=!1;for(let w of M.tool_calls){let T=w.index;if(X[T]==null){if(w.type!=="function")throw new q({data:w,message:"Expected 'function' type."});if(w.id==null)throw new q({data:w,message:"Expected 'id' to be a string."});if(((S=w.function)==null?void 0:S.name)==null)throw new q({data:w,message:"Expected 'function.name' to be a string."});G.enqueue({type:"tool-input-start",id:w.id,toolName:w.function.name}),X[T]={id:w.id,type:"function",function:{name:w.function.name,arguments:(b=w.function.arguments)!=null?b:""},hasFinished:!1};let A=X[T];if(((H=A.function)==null?void 0:H.name)!=null&&((F=A.function)==null?void 0:F.arguments)!=null){if(A.function.arguments.length>0)G.enqueue({type:"tool-input-delta",id:A.id,delta:A.function.arguments});if(_(A.function.arguments))G.enqueue({type:"tool-input-end",id:A.id}),G.enqueue({type:"tool-call",toolCallId:(f=A.id)!=null?f:O(),toolName:A.function.name,input:A.function.arguments}),A.hasFinished=!0}continue}let P=X[T];if(P.hasFinished)continue;if(((k=w.function)==null?void 0:k.arguments)!=null)P.function.arguments+=(R=(D=w.function)==null?void 0:D.arguments)!=null?R:"";if(G.enqueue({type:"tool-input-delta",id:P.id,delta:(d=w.function.arguments)!=null?d:""}),((c=P.function)==null?void 0:c.name)!=null&&((p=P.function)==null?void 0:p.arguments)!=null&&_(P.function.arguments))G.enqueue({type:"tool-input-end",id:P.id}),G.enqueue({type:"tool-call",toolCallId:(i=P.id)!=null?i:O(),toolName:P.function.name,input:P.function.arguments}),P.hasFinished=!0}}},flush(U){if(V)U.enqueue({type:"reasoning-end",id:"reasoning-0"});if(L)U.enqueue({type:"text-end",id:"txt-0"});U.enqueue({type:"finish",finishReason:Y,usage:s(Z),...W!=null?{providerMetadata:W}:{}})}})),request:{body:B},response:{headers:j}}}},HN=N.object({id:N.string().nullish(),created:N.number().nullish(),model:N.string().nullish(),choices:N.array(N.object({message:N.object({content:N.string().nullish(),reasoning:N.string().nullish(),tool_calls:N.array(N.object({id:N.string().nullish(),type:N.literal("function"),function:N.object({name:N.string(),arguments:N.string()})})).nullish()}),index:N.number(),finish_reason:N.string().nullish()})),usage:N.object({prompt_tokens:N.number().nullish(),completion_tokens:N.number().nullish(),total_tokens:N.number().nullish(),prompt_tokens_details:N.object({cached_tokens:N.number().nullish()}).nullish(),completion_tokens_details:N.object({reasoning_tokens:N.number().nullish()}).nullish()}).nullish()}),wN=N.union([N.object({id:N.string().nullish(),created:N.number().nullish(),model:N.string().nullish(),choices:N.array(N.object({delta:N.object({content:N.string().nullish(),reasoning:N.string().nullish(),tool_calls:N.array(N.object({index:N.number(),id:N.string().nullish(),type:N.literal("function").optional(),function:N.object({name:N.string().nullish(),arguments:N.string().nullish()})})).nullish()}).nullish(),finish_reason:N.string().nullable().optional(),index:N.number()})),x_groq:N.object({usage:N.object({prompt_tokens:N.number().nullish(),completion_tokens:N.number().nullish(),total_tokens:N.number().nullish(),prompt_tokens_details:N.object({cached_tokens:N.number().nullish()}).nullish(),completion_tokens_details:N.object({reasoning_tokens:N.number().nullish()}).nullish()}).nullish()}).nullish()}),jN]),WN=NN(()=>QN(N.object({language:N.string().nullish(),prompt:N.string().nullish(),responseFormat:N.string().nullish(),temperature:N.number().min(0).max(1).nullish(),timestampGranularities:N.array(N.string()).nullish()}))),PN=class{constructor(Q,J){this.modelId=Q,this.config=J,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:Q,mediaType:J,providerOptions:z}){var B,j,$,X,Y;let Z=[],K=await h({provider:"groq",providerOptions:z,schema:WN}),L=new FormData,V=Q instanceof Uint8Array?new Blob([Q]):new Blob([r(Q)]);L.append("model",this.modelId);let W=o(J);if(L.append("file",new File([V],"audio",{type:J}),`audio.${W}`),K){let U={language:(B=K.language)!=null?B:void 0,prompt:(j=K.prompt)!=null?j:void 0,response_format:($=K.responseFormat)!=null?$:void 0,temperature:(X=K.temperature)!=null?X:void 0,timestamp_granularities:(Y=K.timestampGranularities)!=null?Y:void 0};for(let G in U){let E=U[G];if(E!==void 0)if(Array.isArray(E))for(let S of E)L.append(`${G}[]`,String(S));else L.append(G,String(E))}}return{formData:L,warnings:Z}}async doGenerate(Q){var J,z,B,j,$,X,Y;let Z=(B=(z=(J=this.config._internal)==null?void 0:J.currentDate)==null?void 0:z.call(J))!=null?B:new Date,{formData:K,warnings:L}=await this.getArgs(Q),{value:V,responseHeaders:W,rawValue:U}=await XN({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),formData:K,failedResponseHandler:g,successfulResponseHandler:C(AN),abortSignal:Q.abortSignal,fetch:this.config.fetch});return{text:V.text,segments:($=(j=V.segments)==null?void 0:j.map((G)=>({text:G.text,startSecond:G.start,endSecond:G.end})))!=null?$:[],language:(X=V.language)!=null?X:void 0,durationInSeconds:(Y=V.duration)!=null?Y:void 0,warnings:L,response:{timestamp:Z,modelId:this.modelId,headers:W,body:U}}}},AN=N.object({text:N.string(),x_groq:N.object({id:N.string()}),task:N.string().nullish(),language:N.string().nullish(),duration:N.number().nullish(),segments:N.array(N.object({id:N.number(),seek:N.number(),start:N.number(),end:N.number(),text:N.string(),tokens:N.array(N.number()),temperature:N.number(),avg_logprob:N.number(),compression_ratio:N.number(),no_speech_prob:N.number()})).nullish()}),EN=YN({id:"groq.browser_search",inputSchema:N.object({})}),MN={browserSearch:EN},SN="3.0.31";function xN(Q={}){var J;let z=(J=JN(Q.baseURL))!=null?J:"https://api.groq.com/openai/v1",B=()=>t({Authorization:`Bearer ${e({apiKey:Q.apiKey,environmentVariableName:"GROQ_API_KEY",description:"Groq"})}`,...Q.headers},`ai-sdk/groq/${SN}`),j=(Z)=>new LN(Z,{provider:"groq.chat",url:({path:K})=>`${z}${K}`,headers:B,fetch:Q.fetch}),$=(Z)=>{if(new.target)throw Error("The Groq model function cannot be called with the new keyword.");return j(Z)},X=(Z)=>{return new PN(Z,{provider:"groq.transcription",url:({path:K})=>`${z}${K}`,headers:B,fetch:Q.fetch})},Y=function(Z){return $(Z)};return Y.specificationVersion="v3",Y.languageModel=$,Y.chat=j,Y.embeddingModel=(Z)=>{throw new u({modelId:Z,modelType:"embeddingModel"})},Y.textEmbeddingModel=Y.embeddingModel,Y.imageModel=(Z)=>{throw new u({modelId:Z,modelType:"imageModel"})},Y.transcription=X,Y.transcriptionModel=X,Y.tools=MN,Y}var gN=xN();export{gN as groq,xN as createGroq,EN as browserSearch,SN as VERSION};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Rg as ye}from"./chunk-e8j03wnd.js";import{Sg as Gs}from"./chunk-wk11yy8h.js";import{Tg as Pt}from"./chunk-rkf9ynkx.js";import{Ks as Jn,Ls as na}from"./chunk-zjpnyah2.js";import{Ns as at,Os as xe}from"./chunk-0hqmdrjr.js";import{RF as _,UF as D}from"./chunk-8j3aw4qg.js";var At=_((Qs)=>{var Mt=Pt(),vs=(e)=>e[Mt.SMITHY_CONTEXT_KEY]||(e[Mt.SMITHY_CONTEXT_KEY]={}),Ys=(e)=>{if(typeof e==="function")return e;let t=Promise.resolve(e);return()=>t};Qs.getSmithyContext=vs;Qs.normalizeProvider=Ys});var Ut=_((Ks)=>{var Rt=Gs(),Vs=(e)=>{if(typeof e==="object"){if("url"in e){let t=Rt.parseUrl(e.url);if(e.headers){t.headers={};for(let[r,s]of Object.entries(e.headers))t.headers[r.toLowerCase()]=s.join(", ")}return t}return e}return Rt.parseUrl(e)};Ks.toEndpointV1=Vs});var Qe=_((mn)=>{var tn=ye(),It=At(),rn=Ut(),de=(e)=>{if(typeof e==="function")return e();return e},Ye=(e,t,r,s,n)=>({name:t,namespace:e,traits:r,input:s,output:n}),sn=(e)=>(t,r)=>async(s)=>{let{response:n}=await t(s),{operationSchema:o}=It.getSmithyContext(r),[,i,c,a,d,l]=o??[];try{let f=await e.protocol.deserializeResponse(Ye(i,c,a,d,l),{...e,...r},n);return{response:n,output:f}}catch(f){if(Object.defineProperty(f,"$response",{value:n,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in f)){try{f.message+=`
|
|
3
|
+
Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(h){if(!r.logger||r.logger?.constructor?.name==="NoOpLogger")console.warn("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.");else r.logger?.warn?.("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.")}if(typeof f.$responseBodyText<"u"){if(f.$response)f.$response.body=f.$responseBodyText}try{if(tn.HttpResponse.isInstance(n)){let{headers:h={}}=n,p=Object.entries(h);f.$metadata={httpStatusCode:n.statusCode,requestId:Je(/^x-[\w-]+-request-?id$/,p),extendedRequestId:Je(/^x-[\w-]+-id-2$/,p),cfId:Je(/^x-[\w-]+-cf-id$/,p)}}}catch(h){}}throw f}},Je=(e,t)=>{return(t.find(([r])=>{return r.match(e)})||[void 0,void 0])[1]},nn=(e)=>(t,r)=>async(s)=>{let{operationSchema:n}=It.getSmithyContext(r),[,o,i,c,a,d]=n??[],l=r.endpointV2?async()=>rn.toEndpointV1(r.endpointV2):e.endpoint,f=await e.protocol.serializeRequest(Ye(o,i,c,a,d),s.input,{...e,...r,endpoint:l});return t({...s,request:f})},Dt={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Bt={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function on(e){return{applyToStack:(t)=>{t.add(nn(e),Bt),t.add(sn(e),Dt),e.protocol.setSerdeContext(e)}}}class A{name;namespace;traits;static assign(e,t){return Object.assign(e,t)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);if(!t&&typeof e==="object"&&e!==null)return e.symbol===this.symbol;return t}getName(){return this.namespace+"#"+this.name}}class be extends A{static symbol=Symbol.for("@smithy/lis");name;traits;valueSchema;symbol=be.symbol}var cn=(e,t,r,s)=>A.assign(new be,{name:t,namespace:e,traits:r,valueSchema:s});class we extends A{static symbol=Symbol.for("@smithy/map");name;traits;keySchema;valueSchema;symbol=we.symbol}var an=(e,t,r,s,n)=>A.assign(new we,{name:t,namespace:e,traits:r,keySchema:s,valueSchema:n});class ge extends A{static symbol=Symbol.for("@smithy/ope");name;traits;input;output;symbol=ge.symbol}var fn=(e,t,r,s,n)=>A.assign(new ge,{name:t,namespace:e,traits:r,input:s,output:n});class re extends A{static symbol=Symbol.for("@smithy/str");name;traits;memberNames;memberList;symbol=re.symbol}var un=(e,t,r,s,n)=>A.assign(new re,{name:t,namespace:e,traits:r,memberNames:s,memberList:n});class _e extends re{static symbol=Symbol.for("@smithy/err");ctor;symbol=_e.symbol}var hn=(e,t,r,s,n,o)=>A.assign(new _e,{name:t,namespace:e,traits:r,memberNames:s,memberList:n,ctor:null}),le=[];function te(e){if(typeof e==="object")return e;if(e=e|0,le[e])return le[e];let t={},r=0;for(let s of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])if((e>>r++&1)===1)t[s]=1;return le[e]=t}var K={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},pe=[],me={};class L{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=L.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,t){this.ref=e,this.memberName=t;let r=[],s=e,n=e;this._isMemberSchema=!1;while(ve(s))r.push(s[1]),s=s[0],n=de(s),this._isMemberSchema=!0;if(r.length>0){this.memberTraits={};for(let o=r.length-1;o>=0;--o){let i=r[o];Object.assign(this.memberTraits,te(i))}}else this.memberTraits=0;if(n instanceof L){let o=this.memberTraits;Object.assign(this,n),this.memberTraits=Object.assign({},o,n.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=t??n.memberName;return}if(this.schema=de(n),Nt(this.schema))this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3];else this.name=this.memberName??String(n),this.traits=0;if(this._isMemberSchema&&!t)throw Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);if(!t&&typeof e==="object"&&e!==null)return e.symbol===this.symbol;return t}static of(e){let t=typeof e==="function"||typeof e==="object"&&e!==null;if(typeof e==="number"){if(pe[e])return pe[e]}else if(typeof e==="string"){if(me[e])return me[e]}else if(t){if(e[K.ns])return e[K.ns]}let r=de(e);if(r instanceof L)return r;if(ve(r)){let[n,o]=r;if(n instanceof L)return Object.assign(n.getMergedTraits(),te(o)),n;throw Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}let s=new L(r);if(t)return e[K.ns]=s;if(typeof r==="string")return me[r]=s;if(typeof r==="number")return pe[r]=s;return s}getSchema(){let e=this.schema;if(Array.isArray(e)&&e[0]===0)return e[4];return e}getName(e=!1){let{name:t}=this;return!e&&t&&t.includes("#")?t.split("#")[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){let e=this.getSchema();return typeof e==="number"?e>=64&&e<128:e[0]===1}isMapSchema(){let e=this.getSchema();return typeof e==="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){let e=this.getSchema();if(typeof e!=="object")return!1;let t=e[0];return t===3||t===-3||t===4}isUnionSchema(){let e=this.getSchema();if(typeof e!=="object")return!1;return e[0]===4}isBlobSchema(){let e=this.getSchema();return e===21||e===42}isTimestampSchema(){let e=this.getSchema();return typeof e==="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){let{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return te(this.memberTraits)}getOwnTraits(){return te(this.traits)}getKeySchema(){let[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);let r=this.getSchema(),s=e?15:r[4]??0;return ee([s,0],"key")}getValueSchema(){let e=this.getSchema(),[t,r,s]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],n=typeof e==="number"?63&e:e&&typeof e==="object"&&(r||s)?e[3+e[0]]:t?15:void 0;if(n!=null)return ee([n,0],r?"value":"member");throw Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){let t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){let r=t[4].indexOf(e),s=t[5][r];return ee(ve(s)?s:[s,0],e)}if(this.isDocumentSchema())return ee([15,0],e);throw Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){let e={};try{for(let[t,r]of this.structIterator())e[t]=r}catch(t){}return e}getEventStreamMember(){if(this.isStructSchema()){for(let[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw Error("@smithy/core/schema - cannot iterate non-struct schema.");let e=this.getSchema(),t=e[4].length,r=e[K.it];if(r&&t===r.length){yield*r;return}r=Array(t);for(let s=0;s<t;++s){let n=e[4][s],o=ee([e[5][s],0],n);yield r[s]=[n,o]}e[K.it]=r}}function ee(e,t){if(e instanceof L)return Object.assign(e,{memberName:t,_isMemberSchema:!0});return new L(e,t)}var ve=(e)=>Array.isArray(e)&&e.length===2,Nt=(e)=>Array.isArray(e)&&e.length>=5;class se extends A{static symbol=Symbol.for("@smithy/sim");name;schemaRef;traits;symbol=se.symbol}var dn=(e,t,r,s)=>A.assign(new se,{name:t,namespace:e,traits:s,schemaRef:r}),ln=(e,t,r,s)=>A.assign(new se,{name:t,namespace:e,traits:r,schemaRef:s}),pn={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128};class q{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,r=new Map){this.namespace=e,this.schemas=t,this.exceptions=r}static for(e){if(!q.registries.has(e))q.registries.set(e,new q(e));return q.registries.get(e)}copyFrom(e){let{schemas:t,exceptions:r}=this;for(let[s,n]of e.schemas)if(!t.has(s))t.set(s,n);for(let[s,n]of e.exceptions)if(!r.has(s))r.set(s,n)}register(e,t){let r=this.normalizeShapeId(e);for(let s of[this,q.for(r.split("#")[0])])s.schemas.set(r,t)}getSchema(e){let t=this.normalizeShapeId(e);if(!this.schemas.has(t))throw Error(`@smithy/core/schema - schema not found for ${t}`);return this.schemas.get(t)}registerError(e,t){let r=e,s=r[1];for(let n of[this,q.for(s)])n.schemas.set(s+"#"+r[2],r),n.exceptions.set(r,t)}getErrorCtor(e){let t=e;if(this.exceptions.has(t))return this.exceptions.get(t);return q.for(t[1]).exceptions.get(t)}getBaseException(){for(let e of this.exceptions.keys())if(Array.isArray(e)){let[,t,r]=e,s=t+"#"+r;if(s.startsWith("smithy.ts.sdk.synthetic.")&&s.endsWith("ServiceException"))return e}return}find(e){return[...this.schemas.values()].find(e)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){if(e.includes("#"))return e;return this.namespace+"#"+e}}mn.ErrorSchema=_e;mn.ListSchema=be;mn.MapSchema=we;mn.NormalizedSchema=L;mn.OperationSchema=ge;mn.SCHEMA=pn;mn.Schema=A;mn.SimpleSchema=se;mn.StructureSchema=re;mn.TypeRegistry=q;mn.deref=de;mn.deserializerMiddlewareOption=Dt;mn.error=hn;mn.getSchemaSerdePlugin=on;mn.isStaticSchema=Nt;mn.list=cn;mn.map=an;mn.op=fn;mn.operation=Ye;mn.serializerMiddlewareOption=Bt;mn.sim=dn;mn.simAdapter=ln;mn.simpleSchemaCacheN=pe;mn.simpleSchemaCacheS=me;mn.struct=un;mn.traitsCache=le;mn.translateTraits=te});var jt=_((Wn)=>{var W=(e,t)=>{let r=[];if(e)r.push(e);if(t)for(let s of t)r.push(s);return r},z=(e,t)=>{return`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`},Ze=()=>{let e=[],t=[],r=!1,s=new Set,n=(f)=>f.sort((u,h)=>qt[h.step]-qt[u.step]||Lt[h.priority||"normal"]-Lt[u.priority||"normal"]),o=(f)=>{let u=!1,h=(p)=>{let b=W(p.name,p.aliases);if(b.includes(f)){u=!0;for(let y of b)s.delete(y);return!1}return!0};return e=e.filter(h),t=t.filter(h),u},i=(f)=>{let u=!1,h=(p)=>{if(p.middleware===f){u=!0;for(let b of W(p.name,p.aliases))s.delete(b);return!1}return!0};return e=e.filter(h),t=t.filter(h),u},c=(f)=>{return e.forEach((u)=>{f.add(u.middleware,{...u})}),t.forEach((u)=>{f.addRelativeTo(u.middleware,{...u})}),f.identifyOnResolve?.(l.identifyOnResolve()),f},a=(f)=>{let u=[];return f.before.forEach((h)=>{if(h.before.length===0&&h.after.length===0)u.push(h);else u.push(...a(h))}),u.push(f),f.after.reverse().forEach((h)=>{if(h.before.length===0&&h.after.length===0)u.push(h);else u.push(...a(h))}),u},d=(f=!1)=>{let u=[],h=[],p={};return e.forEach((y)=>{let m={...y,before:[],after:[]};for(let w of W(m.name,m.aliases))p[w]=m;u.push(m)}),t.forEach((y)=>{let m={...y,before:[],after:[]};for(let w of W(m.name,m.aliases))p[w]=m;h.push(m)}),h.forEach((y)=>{if(y.toMiddleware){let m=p[y.toMiddleware];if(m===void 0){if(f)return;throw Error(`${y.toMiddleware} is not found when adding ${z(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}if(y.relation==="after")m.after.push(y);if(y.relation==="before")m.before.push(y)}}),n(u).map(a).reduce((y,m)=>{return y.push(...m),y},[])},l={add:(f,u={})=>{let{name:h,override:p,aliases:b}=u,y={step:"initialize",priority:"normal",middleware:f,...u},m=W(h,b);if(m.length>0){if(m.some((w)=>s.has(w))){if(!p)throw Error(`Duplicate middleware name '${z(h,b)}'`);for(let w of m){let S=e.findIndex((O)=>O.name===w||O.aliases?.some((I)=>I===w));if(S===-1)continue;let g=e[S];if(g.step!==y.step||y.priority!==g.priority)throw Error(`"${z(g.name,g.aliases)}" middleware with ${g.priority} priority in ${g.step} step cannot be overridden by "${z(h,b)}" middleware with ${y.priority} priority in ${y.step} step.`);e.splice(S,1)}}for(let w of m)s.add(w)}e.push(y)},addRelativeTo:(f,u)=>{let{name:h,override:p,aliases:b}=u,y={middleware:f,...u},m=W(h,b);if(m.length>0){if(m.some((w)=>s.has(w))){if(!p)throw Error(`Duplicate middleware name '${z(h,b)}'`);for(let w of m){let S=t.findIndex((O)=>O.name===w||O.aliases?.some((I)=>I===w));if(S===-1)continue;let g=t[S];if(g.toMiddleware!==y.toMiddleware||g.relation!==y.relation)throw Error(`"${z(g.name,g.aliases)}" middleware ${g.relation} "${g.toMiddleware}" middleware cannot be overridden by "${z(h,b)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);t.splice(S,1)}}for(let w of m)s.add(w)}t.push(y)},clone:()=>c(Ze()),use:(f)=>{f.applyToStack(l)},remove:(f)=>{if(typeof f==="string")return o(f);else return i(f)},removeByTag:(f)=>{let u=!1,h=(p)=>{let{tags:b,name:y,aliases:m}=p;if(b&&b.includes(f)){let w=W(y,m);for(let S of w)s.delete(S);return u=!0,!1}return!0};return e=e.filter(h),t=t.filter(h),u},concat:(f)=>{let u=c(Ze());return u.use(f),u.identifyOnResolve(r||u.identifyOnResolve()||(f.identifyOnResolve?.()??!1)),u},applyToStack:c,identify:()=>{return d(!0).map((f)=>{let u=f.step??f.relation+" "+f.toMiddleware;return z(f.name,f.aliases)+" - "+u})},identifyOnResolve(f){if(typeof f==="boolean")r=f;return r},resolve:(f,u)=>{for(let h of d().map((p)=>p.middleware).reverse())f=h(f,u);if(r)console.log(l.identify());return f}};return l},qt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Lt={high:3,normal:2,low:1};Wn.constructStack=Ze});var zt=_((Ft)=>{Object.defineProperty(Ft,"__esModule",{value:!0});Ft.randomUUID=void 0;var vn=Jn(),Ct=vn.__importDefault(D("crypto"));Ft.randomUUID=Ct.default.randomUUID.bind(Ct.default)});var kt=_((Qn)=>{var Wt=zt(),M=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),Yn=()=>{if(Wt.randomUUID)return Wt.randomUUID();let e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,M[e[0]]+M[e[1]]+M[e[2]]+M[e[3]]+"-"+M[e[4]]+M[e[5]]+"-"+M[e[6]]+M[e[7]]+"-"+M[e[8]]+M[e[9]]+"-"+M[e[10]]+M[e[11]]+M[e[12]]+M[e[13]]+M[e[14]]+M[e[15]]};Qn.v4=Yn});var ct=_((Jo)=>{var Xn=kt(),Gn=(e,t,r=(s)=>s)=>e,Vn=(e)=>{switch(e){case"true":return!0;case"false":return!1;default:throw Error(`Unable to parse boolean value "${e}"`)}},Kn=(e)=>{if(e===null||e===void 0)return;if(typeof e==="number"){if(e===0||e===1)ce.warn(Ee(`Expected boolean, got ${typeof e}: ${e}`));if(e===0)return!1;if(e===1)return!0}if(typeof e==="string"){let t=e.toLowerCase();if(t==="false"||t==="true")ce.warn(Ee(`Expected boolean, got ${typeof e}: ${e}`));if(t==="false")return!1;if(t==="true")return!0}if(typeof e==="boolean")return e;throw TypeError(`Expected boolean, got ${typeof e}: ${e}`)},oe=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string"){let t=parseFloat(e);if(!Number.isNaN(t)){if(String(t)!==String(e))ce.warn(Ee(`Expected number but observed string: ${e}`));return t}}if(typeof e==="number")return e;throw TypeError(`Expected number, got ${typeof e}: ${e}`)},eo=Math.ceil(340282346638528860000000000000000000000),Te=(e)=>{let t=oe(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0){if(Math.abs(t)>eo)throw TypeError(`Expected 32-bit float, got ${e}`)}return t},ie=(e)=>{if(e===null||e===void 0)return;if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw TypeError(`Expected integer, got ${typeof e}: ${e}`)},to=ie,Ge=(e)=>et(e,32),Ve=(e)=>et(e,16),Ke=(e)=>et(e,8),et=(e,t)=>{let r=ie(e);if(r!==void 0&&ro(r,t)!==r)throw TypeError(`Expected ${t}-bit integer, got ${e}`);return r},ro=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},so=(e,t)=>{if(e===null||e===void 0){if(t)throw TypeError(`Expected a non-null value for ${t}`);throw TypeError("Expected a non-null value")}return e},vt=(e)=>{if(e===null||e===void 0)return;if(typeof e==="object"&&!Array.isArray(e))return e;let t=Array.isArray(e)?"array":typeof e;throw TypeError(`Expected object, got ${t}: ${e}`)},no=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string")return e;if(["boolean","number","bigint"].includes(typeof e))return ce.warn(Ee(`Expected string, got ${typeof e}: ${e}`)),String(e);throw TypeError(`Expected string, got ${typeof e}: ${e}`)},oo=(e)=>{if(e===null||e===void 0)return;let t=vt(e),r=Object.entries(t).filter(([,s])=>s!=null).map(([s])=>s);if(r.length===0)throw TypeError("Unions must have exactly one non-null member. None were found.");if(r.length>1)throw TypeError(`Unions must have exactly one non-null member. Keys ${r} were not null.`);return t},tt=(e)=>{if(typeof e=="string")return oe(Z(e));return oe(e)},io=tt,Yt=(e)=>{if(typeof e=="string")return Te(Z(e));return Te(e)},co=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,Z=(e)=>{let t=e.match(co);if(t===null||t[0].length!==e.length)throw TypeError("Expected real number, got implicit NaN");return parseFloat(e)},rt=(e)=>{if(typeof e=="string")return Qt(e);return oe(e)},ao=rt,fo=rt,uo=(e)=>{if(typeof e=="string")return Qt(e);return Te(e)},Qt=(e)=>{switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw Error(`Unable to parse float value: ${e}`)}},Zt=(e)=>{if(typeof e==="string")return ie(Z(e));return ie(e)},ho=Zt,lo=(e)=>{if(typeof e==="string")return Ge(Z(e));return Ge(e)},Y=(e)=>{if(typeof e==="string")return Ve(Z(e));return Ve(e)},Xt=(e)=>{if(typeof e==="string")return Ke(Z(e));return Ke(e)},Ee=(e)=>{return String(TypeError(e).stack||e).split(`
|
|
4
|
+
`).slice(0,5).filter((t)=>!t.includes("stackTraceWarning")).join(`
|
|
5
|
+
`)},ce={warn:console.warn},po=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function mo(e){let t=e.getUTCFullYear(),r=e.getUTCMonth(),s=e.getUTCDay(),n=e.getUTCDate(),o=e.getUTCHours(),i=e.getUTCMinutes(),c=e.getUTCSeconds(),a=n<10?`0${n}`:`${n}`,d=o<10?`0${o}`:`${o}`,l=i<10?`0${i}`:`${i}`,f=c<10?`0${c}`:`${c}`;return`${po[s]}, ${a} ${st[r]} ${t} ${d}:${l}:${f} GMT`}var yo=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),bo=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let t=yo.exec(e);if(!t)throw TypeError("Invalid RFC-3339 date-time value");let[r,s,n,o,i,c,a,d]=t,l=Y(Q(s)),f=N(n,"month",1,12),u=N(o,"day",1,31);return ne(l,f,u,{hours:i,minutes:c,seconds:a,fractionalMilliseconds:d})},wo=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),go=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let t=wo.exec(e);if(!t)throw TypeError("Invalid RFC-3339 date-time value");let[r,s,n,o,i,c,a,d,l]=t,f=Y(Q(s)),u=N(n,"month",1,12),h=N(o,"day",1,31),p=ne(f,u,h,{hours:i,minutes:c,seconds:a,fractionalMilliseconds:d});if(l.toUpperCase()!="Z")p.setTime(p.getTime()-Io(l));return p},_o=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),To=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Eo=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),So=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-7231 date-times must be expressed as strings");let t=_o.exec(e);if(t){let[r,s,n,o,i,c,a,d]=t;return ne(Y(Q(o)),Xe(n),N(s,"day",1,31),{hours:i,minutes:c,seconds:a,fractionalMilliseconds:d})}if(t=To.exec(e),t){let[r,s,n,o,i,c,a,d]=t;return Mo(ne($o(o),Xe(n),N(s,"day",1,31),{hours:i,minutes:c,seconds:a,fractionalMilliseconds:d}))}if(t=Eo.exec(e),t){let[r,s,n,o,i,c,a,d]=t;return ne(Y(Q(d)),Xe(s),N(n.trimLeft(),"day",1,31),{hours:o,minutes:i,seconds:c,fractionalMilliseconds:a})}throw TypeError("Invalid RFC-7231 date-time value")},xo=(e)=>{if(e===null||e===void 0)return;let t;if(typeof e==="number")t=e;else if(typeof e==="string")t=tt(e);else if(typeof e==="object"&&e.tag===1)t=e.value;else throw TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1000))},ne=(e,t,r,s)=>{let n=t-1;return Ao(e,n,r),new Date(Date.UTC(e,n,r,N(s.hours,"hour",0,23),N(s.minutes,"minute",0,59),N(s.seconds,"seconds",0,60),Uo(s.fractionalMilliseconds)))},$o=(e)=>{let t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+Y(Q(e));if(r<t)return r+100;return r},Oo=1576800000000,Mo=(e)=>{if(e.getTime()-new Date().getTime()>Oo)return new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()));return e},Xe=(e)=>{let t=st.indexOf(e);if(t<0)throw TypeError(`Invalid month: ${e}`);return t+1},Po=[31,28,31,30,31,30,31,31,30,31,30,31],Ao=(e,t,r)=>{let s=Po[t];if(t===1&&Ro(e))s=29;if(r>s)throw TypeError(`Invalid day for ${st[t]} in ${e}: ${r}`)},Ro=(e)=>{return e%4===0&&(e%100!==0||e%400===0)},N=(e,t,r,s)=>{let n=Xt(Q(e));if(n<r||n>s)throw TypeError(`${t} must be between ${r} and ${s}, inclusive`);return n},Uo=(e)=>{if(e===null||e===void 0)return 0;return Yt("0."+e)*1000},Io=(e)=>{let t=e[0],r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw TypeError(`Offset direction, ${t}, must be "+" or "-"`);let s=Number(e.substring(1,3)),n=Number(e.substring(4,6));return r*(s*60+n)*60*1000},Q=(e)=>{let t=0;while(t<e.length-1&&e.charAt(t)==="0")t++;if(t===0)return e;return e.slice(t)},k=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};k.from=(e)=>{if(e&&typeof e==="object"&&(e instanceof k||("deserializeJSON"in e)))return e;else if(typeof e==="string"||Object.getPrototypeOf(e)===String.prototype)return k(String(e));return k(JSON.stringify(e))};k.fromObject=k.from;function Do(e){if(e.includes(",")||e.includes('"'))e=`"${e.replace(/"/g,"\\\"")}"`;return e}var nt="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",ot="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",it="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",Gt="(\\d?\\d)",Vt="(\\d{4})",Bo=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),No=new RegExp(`^${nt}, ${Gt} ${ot} ${Vt} ${it} GMT$`),qo=new RegExp(`^${nt}, ${Gt}-${ot}-(\\d\\d) ${it} GMT$`),Lo=new RegExp(`^${nt} ${ot} ( [1-9]|\\d\\d) ${it} ${Vt}$`),jo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Co=(e)=>{if(e==null)return;let t=NaN;if(typeof e==="number")t=e;else if(typeof e==="string"){if(!/^-?\d*\.?\d+$/.test(e))throw TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else if(typeof e==="object"&&e.tag===1)t=e.value;if(isNaN(t)||Math.abs(t)===1/0)throw TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1000))},Fo=(e)=>{if(e==null)return;if(typeof e!=="string")throw TypeError("RFC3339 timestamps must be strings");let t=Bo.exec(e);if(!t)throw TypeError(`Invalid RFC3339 timestamp format ${e}`);let[,r,s,n,o,i,c,,a,d]=t;j(s,1,12),j(n,1,31),j(o,0,23),j(i,0,59),j(c,0,60);let l=new Date(Date.UTC(Number(r),Number(s)-1,Number(n),Number(o),Number(i),Number(c),Number(a)?Math.round(parseFloat(`0.${a}`)*1000):0));if(l.setUTCFullYear(Number(r)),d.toUpperCase()!="Z"){let[,f,u,h]=/([+-])(\d\d):(\d\d)/.exec(d)||[void 0,"+",0,0],p=f==="-"?1:-1;l.setTime(l.getTime()+p*(Number(u)*60*60*1000+Number(h)*60*1000))}return l},Ho=(e)=>{if(e==null)return;if(typeof e!=="string")throw TypeError("RFC7231 timestamps must be strings.");let t,r,s,n,o,i,c,a;if(a=No.exec(e))[,t,r,s,n,o,i,c]=a;else if(a=qo.exec(e))[,t,r,s,n,o,i,c]=a,s=(Number(s)+1900).toString();else if(a=Lo.exec(e))[,r,t,n,o,i,c,s]=a;if(s&&i){let d=Date.UTC(Number(s),jo.indexOf(r),Number(t),Number(n),Number(o),Number(i),c?Math.round(parseFloat(`0.${c}`)*1000):0);j(t,1,31),j(n,0,23),j(o,0,59),j(i,0,60);let l=new Date(d);return l.setUTCFullYear(Number(s)),l}throw TypeError(`Invalid RFC7231 date-time value ${e}.`)};function j(e,t,r){let s=Number(e);if(s<t||s>r)throw Error(`Value ${s} out of range [${t}, ${r}]`)}function zo(e,t,r){if(r<=0||!Number.isInteger(r))throw Error("Invalid number of delimiters ("+r+") for splitEvery.");let s=e.split(t);if(r===1)return s;let n=[],o="";for(let i=0;i<s.length;i++){if(o==="")o=s[i];else o+=t+s[i];if((i+1)%r===0)n.push(o),o=""}if(o!=="")n.push(o);return n}var Wo=(e)=>{let t=e.length,r=[],s=!1,n=void 0,o=0;for(let i=0;i<t;++i){let c=e[i];switch(c){case'"':if(n!=="\\")s=!s;break;case",":if(!s)r.push(e.slice(o,i)),o=i+1;break}n=c}return r.push(e.slice(o)),r.map((i)=>{i=i.trim();let c=i.length;if(c<2)return i;if(i[0]==='"'&&i[c-1]==='"')i=i.slice(1,c-1);return i.replace(/\\"/g,'"')})},Jt=/^-?\d*(\.\d+)?$/;class Se{string;type;constructor(e,t){if(this.string=e,this.type=t,!Jt.test(e))throw Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!=="object")return!1;let t=e;return Se.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&Jt.test(t.string)}}function ko(e){return new Se(String(e),"bigDecimal")}Jo.generateIdempotencyToken=Xn.v4;Jo.LazyJsonString=k;Jo.NumericValue=Se;Jo._parseEpochTimestamp=Co;Jo._parseRfc3339DateTimeWithOffset=Fo;Jo._parseRfc7231DateTime=Ho;Jo.copyDocumentWithTransform=Gn;Jo.dateToUtcString=mo;Jo.expectBoolean=Kn;Jo.expectByte=Ke;Jo.expectFloat32=Te;Jo.expectInt=to;Jo.expectInt32=Ge;Jo.expectLong=ie;Jo.expectNonNull=so;Jo.expectNumber=oe;Jo.expectObject=vt;Jo.expectShort=Ve;Jo.expectString=no;Jo.expectUnion=oo;Jo.handleFloat=ao;Jo.limitedParseDouble=rt;Jo.limitedParseFloat=fo;Jo.limitedParseFloat32=uo;Jo.logger=ce;Jo.nv=ko;Jo.parseBoolean=Vn;Jo.parseEpochTimestamp=xo;Jo.parseRfc3339DateTime=bo;Jo.parseRfc3339DateTimeWithOffset=go;Jo.parseRfc7231DateTime=So;Jo.quoteHeader=Do;Jo.splitEvery=zo;Jo.splitHeader=Wo;Jo.strictParseByte=Xt;Jo.strictParseDouble=tt;Jo.strictParseFloat=io;Jo.strictParseFloat32=Yt;Jo.strictParseInt=ho;Jo.strictParseInt32=lo;Jo.strictParseLong=Zt;Jo.strictParseShort=Y});var tr=_((Kt)=>{Object.defineProperty(Kt,"__esModule",{value:!0});Kt.fromBase64=void 0;var Bi=at(),Ni=/^[A-Za-z0-9+/]*={0,2}$/,qi=(e)=>{if(e.length*3%4!==0)throw TypeError("Incorrect padding on base64 string.");if(!Ni.exec(e))throw TypeError("Invalid base64 string.");let t=(0,Bi.fromString)(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};Kt.fromBase64=qi});var nr=_((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.toBase64=void 0;var Li=at(),ji=xe(),Ci=(e)=>{let t;if(typeof e==="string")t=(0,ji.fromUtf8)(e);else t=e;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return(0,Li.fromArrayBuffer)(t.buffer,t.byteOffset,t.byteLength).toString("base64")};rr.toBase64=Ci});var J=_((C)=>{var $e=tr(),Oe=nr();Object.prototype.hasOwnProperty.call($e,"__proto__")&&!Object.prototype.hasOwnProperty.call(C,"__proto__")&&Object.defineProperty(C,"__proto__",{enumerable:!0,value:$e.__proto__});Object.keys($e).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(C,e))C[e]=$e[e]});Object.prototype.hasOwnProperty.call(Oe,"__proto__")&&!Object.prototype.hasOwnProperty.call(C,"__proto__")&&Object.defineProperty(C,"__proto__",{enumerable:!0,value:Oe.__proto__});Object.keys(Oe).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(C,e))C[e]=Oe[e]})});var ft=_((ir)=>{Object.defineProperty(ir,"__esModule",{value:!0});ir.ChecksumStream=void 0;var Fi=J(),Hi=D("stream");class or extends Hi.Duplex{expectedChecksum;checksumSourceLocation;checksum;source;base64Encoder;pendingCallback=null;constructor({expectedChecksum:e,checksum:t,source:r,checksumSourceLocation:s,base64Encoder:n}){super();if(typeof r.pipe==="function")this.source=r;else throw Error(`@smithy/util-stream: unsupported source type ${r?.constructor?.name??r} in ChecksumStream.`);this.base64Encoder=n??Fi.toBase64,this.expectedChecksum=e,this.checksum=t,this.checksumSourceLocation=s,this.source.pipe(this)}_read(e){if(this.pendingCallback){let t=this.pendingCallback;this.pendingCallback=null,t()}}_write(e,t,r){try{if(this.checksum.update(e),!this.push(e)){this.pendingCallback=r;return}}catch(s){return r(s)}return r()}async _final(e){try{let t=await this.checksum.digest(),r=this.base64Encoder(t);if(this.expectedChecksum!==r)return e(Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${r}" in response header "${this.checksumSourceLocation}".`))}catch(t){return e(t)}return this.push(null),e()}}ir.ChecksumStream=or});var F=_((ar)=>{Object.defineProperty(ar,"__esModule",{value:!0});ar.isBlob=ar.isReadableStream=void 0;var zi=(e)=>typeof ReadableStream==="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream);ar.isReadableStream=zi;var Wi=(e)=>{return typeof Blob==="function"&&(e?.constructor?.name===Blob.name||e instanceof Blob)};ar.isBlob=Wi});var lr=_((hr)=>{Object.defineProperty(hr,"__esModule",{value:!0});hr.ChecksumStream=void 0;var Ji=typeof ReadableStream==="function"?ReadableStream:function(){};class ur extends Ji{}hr.ChecksumStream=ur});var yr=_((pr)=>{Object.defineProperty(pr,"__esModule",{value:!0});pr.createChecksumStream=void 0;var vi=J(),Yi=F(),Qi=lr(),Zi=({expectedChecksum:e,checksum:t,source:r,checksumSourceLocation:s,base64Encoder:n})=>{if(!(0,Yi.isReadableStream)(r))throw Error(`@smithy/util-stream: unsupported source type ${r?.constructor?.name??r} in ChecksumStream.`);let o=n??vi.toBase64;if(typeof TransformStream!=="function")throw Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let i=new TransformStream({start(){},async transform(a,d){t.update(a),d.enqueue(a)},async flush(a){let d=await t.digest(),l=o(d);if(e!==l){let f=Error(`Checksum mismatch: expected "${e}" but received "${l}" in response header "${s}".`);a.error(f)}else a.terminate()}});r.pipeThrough(i);let c=i.readable;return Object.setPrototypeOf(c,Qi.ChecksumStream.prototype),c};pr.createChecksumStream=Zi});var wr=_((br)=>{Object.defineProperty(br,"__esModule",{value:!0});br.createChecksumStream=Ki;var Xi=F(),Gi=ft(),Vi=yr();function Ki(e){if(typeof ReadableStream==="function"&&(0,Xi.isReadableStream)(e.source))return(0,Vi.createChecksumStream)(e);return new Gi.ChecksumStream(e)}});var ut=_((_r)=>{Object.defineProperty(_r,"__esModule",{value:!0});_r.ByteArrayCollector=void 0;class gr{allocByteArray;byteLength=0;byteArrays=[];constructor(e){this.allocByteArray=e}push(e){this.byteArrays.push(e),this.byteLength+=e.byteLength}flush(){if(this.byteArrays.length===1){let r=this.byteArrays[0];return this.reset(),r}let e=this.allocByteArray(this.byteLength),t=0;for(let r=0;r<this.byteArrays.length;++r){let s=this.byteArrays[r];e.set(s,t),t+=s.byteLength}return this.reset(),e}reset(){this.byteArrays=[],this.byteLength=0}}_r.ByteArrayCollector=gr});var Mr=_(($r)=>{Object.defineProperty($r,"__esModule",{value:!0});$r.createBufferedReadable=void 0;$r.createBufferedReadableStream=Er;$r.merge=Sr;$r.flush=Me;$r.sizeOf=X;$r.modeOf=xr;var tc=ut();function Er(e,t,r){let s=e.getReader(),n=!1,o=0,i=["",new tc.ByteArrayCollector((d)=>new Uint8Array(d))],c=-1,a=async(d)=>{let{value:l,done:f}=await s.read(),u=l;if(f){if(c!==-1){let h=Me(i,c);if(X(h)>0)d.enqueue(h)}d.close()}else{let h=xr(u,!1);if(c!==h){if(c>=0)d.enqueue(Me(i,c));c=h}if(c===-1){d.enqueue(u);return}let p=X(u);o+=p;let b=X(i[c]);if(p>=t&&b===0)d.enqueue(u);else{let y=Sr(i,c,u);if(!n&&o>t*2)n=!0,r?.warn(`@smithy/util-stream - stream chunk size ${p} is below threshold of ${t}, automatically buffering.`);if(y>=t)d.enqueue(Me(i,c));else await a(d)}}};return new ReadableStream({pull:a})}$r.createBufferedReadable=Er;function Sr(e,t,r){switch(t){case 0:return e[0]+=r,X(e[0]);case 1:case 2:return e[t].push(r),X(e[t])}}function Me(e,t){switch(t){case 0:let r=e[0];return e[0]="",r;case 1:case 2:return e[t].flush()}throw Error(`@smithy/util-stream - invalid index ${t} given to flush()`)}function X(e){return e?.byteLength??e?.length??0}function xr(e,t=!0){if(t&&typeof Buffer<"u"&&e instanceof Buffer)return 2;if(e instanceof Uint8Array)return 1;if(typeof e==="string")return 0;return-1}});var Rr=_((Ar)=>{Object.defineProperty(Ar,"__esModule",{value:!0});Ar.createBufferedReadable=fc;var cc=D("stream"),Pr=ut(),H=Mr(),ac=F();function fc(e,t,r){if((0,ac.isReadableStream)(e))return(0,H.createBufferedReadableStream)(e,t,r);let s=new cc.Readable({read(){}}),n=!1,o=0,i=["",new Pr.ByteArrayCollector((a)=>new Uint8Array(a)),new Pr.ByteArrayCollector((a)=>Buffer.from(new Uint8Array(a)))],c=-1;return e.on("data",(a)=>{let d=(0,H.modeOf)(a,!0);if(c!==d){if(c>=0)s.push((0,H.flush)(i,c));c=d}if(c===-1){s.push(a);return}let l=(0,H.sizeOf)(a);o+=l;let f=(0,H.sizeOf)(i[c]);if(l>=t&&f===0)s.push(a);else{let u=(0,H.merge)(i,c,a);if(!n&&o>t*2)n=!0,r?.warn(`@smithy/util-stream - stream chunk size ${l} is below threshold of ${t}, automatically buffering.`);if(u>=t)s.push((0,H.flush)(i,c))}}),e.on("end",()=>{if(c!==-1){let a=(0,H.flush)(i,c);if((0,H.sizeOf)(a)>0)s.push(a)}s.push(null)}),s}});var Dr=_((Ur)=>{Object.defineProperty(Ur,"__esModule",{value:!0});Ur.getAwsChunkedEncodingStream=void 0;var hc=(e,t)=>{let{base64Encoder:r,bodyLengthChecker:s,checksumAlgorithmFn:n,checksumLocationName:o,streamHasher:i}=t,c=r!==void 0&&s!==void 0&&n!==void 0&&o!==void 0&&i!==void 0,a=c?i(n,e):void 0,d=e.getReader();return new ReadableStream({async pull(l){let{value:f,done:u}=await d.read();if(u){if(l.enqueue(`0\r
|
|
6
|
+
`),c){let h=r(await a);l.enqueue(`${o}:${h}\r
|
|
7
|
+
`),l.enqueue(`\r
|
|
8
|
+
`)}l.close()}else l.enqueue(`${(s(f)||0).toString(16)}\r
|
|
9
|
+
${f}\r
|
|
10
|
+
`)}})};Ur.getAwsChunkedEncodingStream=hc});var Nr=_((Br)=>{Object.defineProperty(Br,"__esModule",{value:!0});Br.getAwsChunkedEncodingStream=mc;var dc=D("stream"),lc=Dr(),pc=F();function mc(e,t){let r=e,s=e;if((0,pc.isReadableStream)(s))return(0,lc.getAwsChunkedEncodingStream)(s,t);let{base64Encoder:n,bodyLengthChecker:o,checksumAlgorithmFn:i,checksumLocationName:c,streamHasher:a}=t,d=n!==void 0&&i!==void 0&&c!==void 0&&a!==void 0,l=d?a(i,r):void 0,f=new dc.Readable({read:()=>{}});return r.on("data",(u)=>{let h=o(u)||0;if(h===0)return;f.push(`${h.toString(16)}\r
|
|
11
|
+
`),f.push(u),f.push(`\r
|
|
12
|
+
`)}),r.on("end",async()=>{if(f.push(`0\r
|
|
13
|
+
`),d){let u=n(await l);f.push(`${c}:${u}\r
|
|
14
|
+
`),f.push(`\r
|
|
15
|
+
`)}f.push(null)}),f}});var Lr=_((qr)=>{Object.defineProperty(qr,"__esModule",{value:!0});qr.headStream=bc;async function bc(e,t){let r=0,s=[],n=e.getReader(),o=!1;while(!o){let{done:a,value:d}=await n.read();if(d)s.push(d),r+=d?.byteLength??0;if(r>=t)break;o=a}n.releaseLock();let i=new Uint8Array(Math.min(t,r)),c=0;for(let a of s){if(a.byteLength>i.byteLength-c){i.set(a.subarray(0,i.byteLength-c),c);break}else i.set(a,c);c+=a.length}return i}});var Hr=_((Cr)=>{Object.defineProperty(Cr,"__esModule",{value:!0});Cr.headStream=void 0;var gc=D("stream"),_c=Lr(),Tc=F(),Ec=(e,t)=>{if((0,Tc.isReadableStream)(e))return(0,_c.headStream)(e,t);return new Promise((r,s)=>{let n=new jr;n.limit=t,e.pipe(n),e.on("error",(o)=>{n.end(),s(o)}),n.on("error",s),n.on("finish",function(){let o=new Uint8Array(Buffer.concat(this.buffers));r(o)})})};Cr.headStream=Ec;class jr extends gc.Writable{buffers=[];limit=1/0;bytesBuffered=0;_write(e,t,r){if(this.buffers.push(e),this.bytesBuffered+=e.byteLength??0,this.bytesBuffered>=this.limit){let s=this.bytesBuffered-this.limit,n=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=n.subarray(0,n.byteLength-s),this.emit("finish")}r()}}});var Wr=_(($c)=>{var zr=(e)=>encodeURIComponent(e).replace(/[!'()*]/g,Sc),Sc=(e)=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,xc=(e)=>e.split("/").map(zr).join("/");$c.escapeUri=zr;$c.escapeUriPath=xc});var dt=_((Ac)=>{var ht=Wr();function Pc(e){let t=[];for(let r of Object.keys(e).sort()){let s=e[r];if(r=ht.escapeUri(r),Array.isArray(s))for(let n=0,o=s.length;n<o;n++)t.push(`${r}=${ht.escapeUri(s[n])}`);else{let n=r;if(s||typeof s==="string")n+=`=${ht.escapeUri(s)}`;t.push(n)}}return t.join("&")}Ac.buildQueryString=Pc});var rs=_((zc)=>{var Qr=ye(),Zr=dt(),Pe=D("https"),Xr=D("stream"),lt=D("http2");function Re(e){let t=e&&typeof e==="object"&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){let n=Error("Request aborted");return n.name="AbortError",n.cause=t,n}let s=Error(String(t));return s.name="AbortError",s}let r=Error("Request aborted");return r.name="AbortError",r}var Uc=["ECONNRESET","EPIPE","ETIMEDOUT"],Gr=(e)=>{let t={};for(let r of Object.keys(e)){let s=e[r];t[r]=Array.isArray(s)?s.join(","):s}return t},P={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:(e)=>clearTimeout(e)},kr=1000,Ic=(e,t,r=0)=>{if(!r)return-1;let s=(n)=>{let o=P.setTimeout(()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${r} ms.`),{name:"TimeoutError"}))},r-n),i=(c)=>{if(c?.connecting)c.on("connect",()=>{P.clearTimeout(o)});else P.clearTimeout(o)};if(e.socket)i(e.socket);else e.on("socket",i)};if(r<2000)return s(0),0;return P.setTimeout(s.bind(null,kr),kr)},Dc=(e,t,r=0,s,n)=>{if(r)return P.setTimeout(()=>{let o=`@smithy/node-http-handler - [${s?"ERROR":"WARN"}] a request has exceeded the configured ${r} ms requestTimeout.`;if(s){let i=Object.assign(Error(o),{name:"TimeoutError",code:"ETIMEDOUT"});e.destroy(i),t(i)}else o+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",n?.warn?.(o)},r);return-1},Bc=3000,Nc=(e,{keepAlive:t,keepAliveMsecs:r},s=Bc)=>{if(t!==!0)return-1;let n=()=>{if(e.socket)e.socket.setKeepAlive(t,r||0);else e.on("socket",(o)=>{o.setKeepAlive(t,r||0)})};if(s===0)return n(),0;return P.setTimeout(n,s)},Jr=3000,qc=(e,t,r=0)=>{let s=(n)=>{let o=r-n,i=()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket timed out after ${r} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};if(e.socket)e.socket.setTimeout(o,i),e.on("close",()=>e.socket?.removeListener("timeout",i));else e.setTimeout(o,i)};if(0<r&&r<6000)return s(0),0;return P.setTimeout(s.bind(null,r===0?0:Jr),Jr)},vr=6000;async function Vr(e,t,r=vr,s=!1){let n=t.headers??{},o=n.Expect||n.expect,i=-1,c=!0;if(!s&&o==="100-continue")c=await Promise.race([new Promise((a)=>{i=Number(P.setTimeout(()=>a(!0),Math.max(vr,r)))}),new Promise((a)=>{e.on("continue",()=>{P.clearTimeout(i),a(!0)}),e.on("response",()=>{P.clearTimeout(i),a(!1)}),e.on("error",()=>{P.clearTimeout(i),a(!1)})})]);if(c)Lc(e,t.body)}function Lc(e,t){if(t instanceof Xr.Readable){t.pipe(e);return}if(t){let r=Buffer.isBuffer(t);if(r||typeof t==="string"){if(r&&t.byteLength===0)e.end();else e.end(t);return}let n=t;if(typeof n==="object"&&n.buffer&&typeof n.byteOffset==="number"&&typeof n.byteLength==="number"){e.end(Buffer.from(n.buffer,n.byteOffset,n.byteLength));return}e.end(Buffer.from(t));return}e.end()}var jc=0,Ae=void 0,Yr=void 0;class Ue{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){if(typeof e?.handle==="function")return e;return new Ue(e)}static checkSocketUsage(e,t,r=console){let{sockets:s,requests:n,maxSockets:o}=e;if(typeof o!=="number"||o===1/0)return t;let i=15000;if(Date.now()-i<t)return t;if(s&&n)for(let c in s){let a=s[c]?.length??0,d=n[c]?.length??0;if(a>=o&&d>=2*o)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${a} and ${d} additional requests are enqueued.
|
|
16
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
17
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,r)=>{if(typeof e==="function")e().then((s)=>{t(this.resolveDefaultConfig(s))}).catch(r);else t(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t,requestTimeout:r}={}){if(!this.config)this.config=await this.configProvider;let s=this.config,n=e.protocol==="https:";if(!n&&!this.config.httpAgent)this.config.httpAgent=await this.config.httpAgentProvider();return new Promise((o,i)=>{let c=void 0,a=[],d=async(E)=>{await c,a.forEach(P.clearTimeout),o(E)},l=async(E)=>{await c,a.forEach(P.clearTimeout),i(E)};if(t?.aborted){let E=Re(t);l(E);return}let f=e.headers??{},u=(f.Expect??f.expect)==="100-continue",h=n?s.httpsAgent:s.httpAgent;if(u&&!this.externalAgent)h=new(n?Pe.Agent:Ae)({keepAlive:!1,maxSockets:1/0});a.push(P.setTimeout(()=>{this.socketWarningTimestamp=Ue.checkSocketUsage(h,this.socketWarningTimestamp,s.logger)},s.socketAcquisitionWarningTimeout??(s.requestTimeout??2000)+(s.connectionTimeout??1000)));let p=Zr.buildQueryString(e.query||{}),b=void 0;if(e.username!=null||e.password!=null){let E=e.username??"",x=e.password??"";b=`${E}:${x}`}let y=e.path;if(p)y+=`?${p}`;if(e.fragment)y+=`#${e.fragment}`;let m=e.hostname??"";if(m[0]==="["&&m.endsWith("]"))m=e.hostname.slice(1,-1);else m=e.hostname;let w={headers:e.headers,host:m,method:e.method,path:y,port:e.port,agent:h,auth:b},g=(n?Pe.request:Yr)(w,(E)=>{let x=new Qr.HttpResponse({statusCode:E.statusCode||-1,reason:E.statusMessage,headers:Gr(E.headers),body:E});d({response:x})});if(g.on("error",(E)=>{if(Uc.includes(E.code))l(Object.assign(E,{name:"TimeoutError"}));else l(E)}),t){let E=()=>{g.destroy();let x=Re(t);l(x)};if(typeof t.addEventListener==="function"){let x=t;x.addEventListener("abort",E,{once:!0}),g.once("close",()=>x.removeEventListener("abort",E))}else t.onabort=E}let O=r??s.requestTimeout;a.push(Ic(g,l,s.connectionTimeout)),a.push(Dc(g,l,O,s.throwOnRequestTimeout,s.logger??console)),a.push(qc(g,l,s.socketTimeout));let I=w.agent;if(typeof I==="object"&&"keepAlive"in I)a.push(Nc(g,{keepAlive:I.keepAlive,keepAliveMsecs:I.keepAliveMsecs}));c=Vr(g,e,O,this.externalAgent).catch((E)=>{return a.forEach(P.clearTimeout),i(E)})})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[e]:t}})}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:r,socketTimeout:s,socketAcquisitionWarningTimeout:n,httpAgent:o,httpsAgent:i,throwOnRequestTimeout:c,logger:a}=e||{},d=!0,l=50;return{connectionTimeout:r,requestTimeout:t,socketTimeout:s,socketAcquisitionWarningTimeout:n,throwOnRequestTimeout:c,httpAgentProvider:async()=>{let{Agent:f,request:u}=await import("http");if(Yr=u,Ae=f,o instanceof Ae||typeof o?.destroy==="function")return this.externalAgent=!0,o;return new Ae({keepAlive:!0,maxSockets:50,...o})},httpsAgent:(()=>{if(i instanceof Pe.Agent||typeof i?.destroy==="function")return this.externalAgent=!0,i;return new Pe.Agent({keepAlive:!0,maxSockets:50,...i})})(),logger:a}}}class Kr{sessions=[];constructor(e){this.sessions=e??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(e){this.sessions.push(e)}contains(e){return this.sessions.includes(e)}remove(e){this.sessions=this.sessions.filter((t)=>t!==e)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(e){for(let t of this.sessions)if(t===e){if(!t.destroyed)t.destroy()}}}class es{constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError("maxConcurrency must be greater than zero.")}config;sessionCache=new Map;lease(e,t){let r=this.getUrlString(e),s=this.sessionCache.get(r);if(s){let c=s.poll();if(c&&!this.config.disableConcurrency)return c}let n=lt.connect(r);if(this.config.maxConcurrency)n.settings({maxConcurrentStreams:this.config.maxConcurrency},(c)=>{if(c)throw Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+e.destination.toString())});n.unref();let o=()=>{n.destroy(),this.deleteSession(r,n)};if(n.on("goaway",o),n.on("error",o),n.on("frameError",o),n.on("close",()=>this.deleteSession(r,n)),t.requestTimeout)n.setTimeout(t.requestTimeout,o);let i=this.sessionCache.get(r)||new Kr;return i.offerLast(n),this.sessionCache.set(r,i),n}deleteSession(e,t){let r=this.sessionCache.get(e);if(!r)return;if(!r.contains(t))return;r.remove(t),this.sessionCache.set(e,r)}release(e,t){let r=this.getUrlString(e);this.sessionCache.get(r)?.offerLast(t)}destroy(){for(let[e,t]of this.sessionCache){for(let r of t){if(!r.destroyed)r.destroy();t.remove(r)}this.sessionCache.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=e}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}getUrlString(e){return e.destination.toString()}}class pt{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new es({});static create(e){if(typeof e?.handle==="function")return e;return new pt(e)}constructor(e){this.configProvider=new Promise((t,r)=>{if(typeof e==="function")e().then((s)=>{t(s||{})}).catch(r);else t(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:t,requestTimeout:r}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}let{requestTimeout:s,disableConcurrentStreams:n}=this.config,o=r??s;return new Promise((i,c)=>{let a=!1,d=void 0,l=async($)=>{await d,i($)},f=async($)=>{await d,c($)};if(t?.aborted){a=!0;let $=Re(t);f($);return}let{hostname:u,method:h,port:p,protocol:b,query:y}=e,m="";if(e.username!=null||e.password!=null){let $=e.username??"",B=e.password??"";m=`${$}:${B}@`}let w=`${b}//${m}${u}${p?`:${p}`:""}`,S={destination:new URL(w)},g=this.connectionManager.lease(S,{requestTimeout:this.config?.sessionTimeout,disableConcurrentStreams:n||!1}),O=($)=>{if(n)this.destroySession(g);a=!0,f($)},I=Zr.buildQueryString(y||{}),E=e.path;if(I)E+=`?${I}`;if(e.fragment)E+=`#${e.fragment}`;let x=g.request({...e.headers,[lt.constants.HTTP2_HEADER_PATH]:E,[lt.constants.HTTP2_HEADER_METHOD]:h});if(g.ref(),x.on("response",($)=>{let B=new Qr.HttpResponse({statusCode:$[":status"]||-1,headers:Gr($),body:x});if(a=!0,l({response:B}),n)g.close(),this.connectionManager.deleteSession(w,g)}),o)x.setTimeout(o,()=>{x.close();let $=Error(`Stream timed out because of no activity for ${o} ms`);$.name="TimeoutError",O($)});if(t){let $=()=>{x.close();let B=Re(t);O(B)};if(typeof t.addEventListener==="function"){let B=t;B.addEventListener("abort",$,{once:!0}),x.once("close",()=>B.removeEventListener("abort",$))}else t.onabort=$}x.on("frameError",($,B,Js)=>{O(Error(`Frame type id ${$} in stream id ${Js} has failed with code ${B}.`))}),x.on("error",O),x.on("aborted",()=>{O(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${x.rstCode}.`))}),x.on("close",()=>{if(g.unref(),n)g.destroy();if(!a)O(Error("Unexpected error: http2 request did not get a response"))}),d=Vr(x,e,o)})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[e]:t}})}httpHandlerConfigs(){return this.config??{}}destroySession(e){if(!e.destroyed)e.destroy()}}class ts extends Xr.Writable{bufferedBytes=[];_write(e,t,r){this.bufferedBytes.push(e),r()}}var Cc=(e)=>{if(Fc(e))return Hc(e);return new Promise((t,r)=>{let s=new ts;e.pipe(s),e.on("error",(n)=>{s.end(),r(n)}),s.on("error",r),s.on("finish",function(){let n=new Uint8Array(Buffer.concat(this.bufferedBytes));t(n)})})},Fc=(e)=>typeof ReadableStream==="function"&&e instanceof ReadableStream;async function Hc(e){let t=[],r=e.getReader(),s=!1,n=0;while(!s){let{done:c,value:a}=await r.read();if(a)t.push(a),n+=a.length;s=c}let o=new Uint8Array(n),i=0;for(let c of t)o.set(c,i),i+=c.length;return o}zc.DEFAULT_REQUEST_TIMEOUT=jc;zc.NodeHttp2Handler=pt;zc.NodeHttpHandler=Ue;zc.streamCollector=Cc});var is=_((ea)=>{var ss=ye(),Yc=dt(),Qc=J();function ns(e,t){return new Request(e,t)}function Zc(e=0){return new Promise((t,r)=>{if(e)setTimeout(()=>{let s=Error(`Request did not complete within ${e} ms`);s.name="TimeoutError",r(s)},e)})}var Ie={supported:void 0};class mt{config;configProvider;static create(e){if(typeof e?.handle==="function")return e;return new mt(e)}constructor(e){if(typeof e==="function")this.configProvider=e().then((t)=>t||{});else this.config=e??{},this.configProvider=Promise.resolve(this.config);if(Ie.supported===void 0)Ie.supported=Boolean(typeof Request<"u"&&"keepalive"in ns("https://[::1]"))}destroy(){}async handle(e,{abortSignal:t,requestTimeout:r}={}){if(!this.config)this.config=await this.configProvider;let s=r??this.config.requestTimeout,n=this.config.keepAlive===!0,o=this.config.credentials;if(t?.aborted){let m=os(t);return Promise.reject(m)}let i=e.path,c=Yc.buildQueryString(e.query||{});if(c)i+=`?${c}`;if(e.fragment)i+=`#${e.fragment}`;let a="";if(e.username!=null||e.password!=null){let m=e.username??"",w=e.password??"";a=`${m}:${w}@`}let{port:d,method:l}=e,f=`${e.protocol}//${a}${e.hostname}${d?`:${d}`:""}${i}`,u=l==="GET"||l==="HEAD"?void 0:e.body,h={body:u,headers:new Headers(e.headers),method:l,credentials:o};if(this.config?.cache)h.cache=this.config.cache;if(u)h.duplex="half";if(typeof AbortController<"u")h.signal=t;if(Ie.supported)h.keepalive=n;if(typeof this.config.requestInit==="function")Object.assign(h,this.config.requestInit(e));let p=()=>{},b=ns(f,h),y=[fetch(b).then((m)=>{let w=m.headers,S={};for(let O of w.entries())S[O[0]]=O[1];if(m.body==null)return m.blob().then((O)=>({response:new ss.HttpResponse({headers:S,reason:m.statusText,statusCode:m.status,body:O})}));return{response:new ss.HttpResponse({headers:S,reason:m.statusText,statusCode:m.status,body:m.body})}}),Zc(s)];if(t)y.push(new Promise((m,w)=>{let S=()=>{let g=os(t);w(g)};if(typeof t.addEventListener==="function"){let g=t;g.addEventListener("abort",S,{once:!0}),p=()=>g.removeEventListener("abort",S)}else t.onabort=S}));return Promise.race(y).finally(p)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return r[e]=t,r})}httpHandlerConfigs(){return this.config??{}}}function os(e){let t=e&&typeof e==="object"&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){let n=Error("Request aborted");return n.name="AbortError",n.cause=t,n}let s=Error(String(t));return s.name="AbortError",s}let r=Error("Request aborted");return r.name="AbortError",r}var Xc=async(e)=>{if(typeof Blob==="function"&&e instanceof Blob||e.constructor?.name==="Blob"){if(Blob.prototype.arrayBuffer!==void 0)return new Uint8Array(await e.arrayBuffer());return Gc(e)}return Vc(e)};async function Gc(e){let t=await Kc(e),r=Qc.fromBase64(t);return new Uint8Array(r)}async function Vc(e){let t=[],r=e.getReader(),s=!1,n=0;while(!s){let{done:c,value:a}=await r.read();if(a)t.push(a),n+=a.length;s=c}let o=new Uint8Array(n),i=0;for(let c of t)o.set(c,i),i+=c.length;return o}function Kc(e){return new Promise((t,r)=>{let s=new FileReader;s.onloadend=()=>{if(s.readyState!==2)return r(Error("Reader aborted too early"));let n=s.result??"",o=n.indexOf(","),i=o>-1?o+1:n.length;t(n.substring(i))},s.onabort=()=>r(Error("Read aborted")),s.onerror=()=>r(s.error),s.readAsDataURL(e)})}ea.FetchHttpHandler=mt;ea.keepAliveSupport=Ie;ea.streamCollector=Xc});var ds=_((us)=>{Object.defineProperty(us,"__esModule",{value:!0});us.sdkStreamMixin=void 0;var oa=is(),ia=J(),ca=na(),aa=xe(),cs=F(),as="The stream has already been transformed.",fa=(e)=>{if(!fs(e)&&!(0,cs.isReadableStream)(e)){let n=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${n}`)}let t=!1,r=async()=>{if(t)throw Error(as);return t=!0,await(0,oa.streamCollector)(e)},s=(n)=>{if(typeof n.stream!=="function")throw Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
18
|
+
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return n.stream()};return Object.assign(e,{transformToByteArray:r,transformToString:async(n)=>{let o=await r();if(n==="base64")return(0,ia.toBase64)(o);else if(n==="hex")return(0,ca.toHex)(o);else if(n===void 0||n==="utf8"||n==="utf-8")return(0,aa.toUtf8)(o);else if(typeof TextDecoder==="function")return new TextDecoder(n).decode(o);else throw Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw Error(as);if(t=!0,fs(e))return s(e);else if((0,cs.isReadableStream)(e))return e;else throw Error(`Cannot transform payload to web stream, got ${e}`)}})};us.sdkStreamMixin=fa;var fs=(e)=>typeof Blob==="function"&&e instanceof Blob});var ys=_((ps)=>{Object.defineProperty(ps,"__esModule",{value:!0});ps.sdkStreamMixin=void 0;var ua=rs(),ha=at(),yt=D("stream"),da=ds(),ls="The stream has already been transformed.",la=(e)=>{if(!(e instanceof yt.Readable))try{return(0,da.sdkStreamMixin)(e)}catch(s){let n=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${n}`)}let t=!1,r=async()=>{if(t)throw Error(ls);return t=!0,await(0,ua.streamCollector)(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async(s)=>{let n=await r();if(s===void 0||Buffer.isEncoding(s))return(0,ha.fromArrayBuffer)(n.buffer,n.byteOffset,n.byteLength).toString(s);else return new TextDecoder(s).decode(n)},transformToWebStream:()=>{if(t)throw Error(ls);if(e.readableFlowing!==null)throw Error("The stream has been consumed by other callbacks.");if(typeof yt.Readable.toWeb!=="function")throw Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,yt.Readable.toWeb(e)}})};ps.sdkStreamMixin=la});var ws=_((bs)=>{Object.defineProperty(bs,"__esModule",{value:!0});bs.splitStream=pa;async function pa(e){if(typeof e.stream==="function")e=e.stream();return e.tee()}});var Es=_((Ts)=>{Object.defineProperty(Ts,"__esModule",{value:!0});Ts.splitStream=ba;var gs=D("stream"),ya=ws(),_s=F();async function ba(e){if((0,_s.isReadableStream)(e)||(0,_s.isBlob)(e))return(0,ya.splitStream)(e);let t=new gs.PassThrough,r=new gs.PassThrough;return e.pipe(t),e.pipe(r),[t,r]}});var Os=_((T)=>{var Ss=J(),xs=xe(),De=ft(),Be=wr(),Ne=Rr(),qe=Nr(),Le=Hr(),je=ys(),Ce=Es(),$s=F();class ae extends Uint8Array{static fromString(e,t="utf-8"){if(typeof e==="string"){if(t==="base64")return ae.mutate(Ss.fromBase64(e));return ae.mutate(xs.fromUtf8(e))}throw Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,ae.prototype),e}transformToString(e="utf-8"){if(e==="base64")return Ss.toBase64(this);return xs.toUtf8(this)}}T.isBlob=$s.isBlob;T.isReadableStream=$s.isReadableStream;T.Uint8ArrayBlobAdapter=ae;Object.prototype.hasOwnProperty.call(De,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:De.__proto__});Object.keys(De).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=De[e]});Object.prototype.hasOwnProperty.call(Be,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:Be.__proto__});Object.keys(Be).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=Be[e]});Object.prototype.hasOwnProperty.call(Ne,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:Ne.__proto__});Object.keys(Ne).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=Ne[e]});Object.prototype.hasOwnProperty.call(qe,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:qe.__proto__});Object.keys(qe).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=qe[e]});Object.prototype.hasOwnProperty.call(Le,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:Le.__proto__});Object.keys(Le).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=Le[e]});Object.prototype.hasOwnProperty.call(je,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:je.__proto__});Object.keys(je).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=je[e]});Object.prototype.hasOwnProperty.call(Ce,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:Ce.__proto__});Object.keys(Ce).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=Ce[e]})});var Is=_((Sa)=>{var Fe=Os(),R=Qe(),U=ct(),fe=ye(),He=J(),bt=xe(),v=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return Fe.Uint8ArrayBlobAdapter.mutate(e);if(!e)return Fe.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let r=t.streamCollector(e);return Fe.Uint8ArrayBlobAdapter.mutate(await r)};function ue(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}class G{serdeContext;setSerdeContext(e){this.serdeContext=e}}class ze extends G{options;compositeErrorRegistry;constructor(e){super();this.options=e,this.compositeErrorRegistry=R.TypeRegistry.for(e.defaultNamespace);for(let t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return fe.HttpRequest}getResponseType(){return fe.HttpResponse}setSerdeContext(e){if(this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec())this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){if(e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,!e.query)e.query={};for(let[r,s]of t.url.searchParams.entries())e.query[r]=s;if(t.headers)for(let[r,s]of Object.entries(t.headers))e.headers[r]=s.join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(let[r,s]of Object.entries(t.headers))e.headers[r]=s;return e}}setHostPrefix(e,t,r){if(this.serdeContext?.disableHostPrefix)return;let s=R.NormalizedSchema.of(t.input),n=R.translateTraits(t.traits??{});if(n.endpoint){let o=n.endpoint?.[0];if(typeof o==="string"){let i=[...s.structIterator()].filter(([,c])=>c.getMergedTraits().hostLabel);for(let[c]of i){let a=r[c];if(typeof a!=="string")throw Error(`@smithy/core/schema - ${c} in input must be a string as hostLabel.`);o=o.replace(`{${c}}`,a)}e.hostname=o+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:r}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:r})}async loadEventStreamCapability(){let{EventStreamSerde:e}=await import("./chunk-tfxm3qz4.js");return new e({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,r,s,n){return[]}getEventStreamMarshaller(){let e=this.serdeContext;if(!e.eventStreamMarshaller)throw Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class Ms extends ze{async serializeRequest(e,t,r){let s=t&&typeof t==="object"?t:{},n=this.serializer,o={},i={},c=await r.endpoint(),a=R.NormalizedSchema.of(e?.input),d=[],l=[],f=!1,u,h=new fe.HttpRequest({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:o,headers:i,body:void 0});if(c){this.updateServiceEndpoint(h,c),this.setHostPrefix(h,e,s);let p=R.translateTraits(e.traits);if(p.http){h.method=p.http[0];let[b,y]=p.http[1].split("?");if(h.path=="/")h.path=b;else h.path+=b;let m=new URLSearchParams(y??"");Object.assign(o,Object.fromEntries(m))}}for(let[p,b]of a.structIterator()){let y=b.getMergedTraits()??{},m=s[p];if(m==null&&!b.isIdempotencyToken()){if(y.httpLabel){if(h.path.includes(`{${p}+}`)||h.path.includes(`{${p}}`))throw Error(`No value provided for input HTTP label: ${p}.`)}continue}if(y.httpPayload)if(b.isStreaming())if(b.isStructSchema()){if(s[p])u=await this.serializeEventStream({eventStream:s[p],requestSchema:a})}else u=m;else n.write(b,m),u=n.flush();else if(y.httpLabel){n.write(b,m);let w=n.flush();if(h.path.includes(`{${p}+}`))h.path=h.path.replace(`{${p}+}`,w.split("/").map(ue).join("/"));else if(h.path.includes(`{${p}}`))h.path=h.path.replace(`{${p}}`,ue(w))}else if(y.httpHeader)n.write(b,m),i[y.httpHeader.toLowerCase()]=String(n.flush());else if(typeof y.httpPrefixHeaders==="string")for(let[w,S]of Object.entries(m)){let g=y.httpPrefixHeaders+w;n.write([b.getValueSchema(),{httpHeader:g}],S),i[g.toLowerCase()]=n.flush()}else if(y.httpQuery||y.httpQueryParams)this.serializeQuery(b,m,o);else f=!0,d.push(p),l.push(b)}if(f&&s){let[p,b]=(a.getName(!0)??"#Unknown").split("#"),y=a.getSchema()[6],m=[3,p,b,a.getMergedTraits(),d,l,void 0];if(y)m[6]=y;else m.pop();n.write(m,s),u=n.flush()}return h.headers=i,h.query=o,h.body=u,h}serializeQuery(e,t,r){let s=this.serializer,n=e.getMergedTraits();if(n.httpQueryParams){for(let[o,i]of Object.entries(t))if(!(o in r)){let c=e.getValueSchema();Object.assign(c.getMergedTraits(),{...n,httpQuery:o,httpQueryParams:void 0}),this.serializeQuery(c,i,r)}return}if(e.isListSchema()){let o=!!e.getMergedTraits().sparse,i=[];for(let c of t){s.write([e.getValueSchema(),n],c);let a=s.flush();if(o||a!==void 0)i.push(a)}r[n.httpQuery]=i}else s.write([e,n],t),r[n.httpQuery]=s.flush()}async deserializeResponse(e,t,r){let s=this.deserializer,n=R.NormalizedSchema.of(e.output),o={};if(r.statusCode>=300){let c=await v(r.body,t);if(c.byteLength>0)Object.assign(o,await s.read(15,c));throw await this.handleError(e,t,r,o,this.deserializeMetadata(r)),Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let c in r.headers){let a=r.headers[c];delete r.headers[c],r.headers[c.toLowerCase()]=a}let i=await this.deserializeHttpMessage(n,t,r,o);if(i.length){let c=await v(r.body,t);if(c.byteLength>0){let a=await s.read(n,c);for(let d of i)if(a[d]!=null)o[d]=a[d]}}else if(i.discardResponseBody)await v(r.body,t);return o.$metadata=this.deserializeMetadata(r),o}async deserializeHttpMessage(e,t,r,s,n){let o;if(s instanceof Set)o=n;else o=s;let i=!0,c=this.deserializer,a=R.NormalizedSchema.of(e),d=[];for(let[l,f]of a.structIterator()){let u=f.getMemberTraits();if(u.httpPayload){if(i=!1,f.isStreaming())if(f.isStructSchema())o[l]=await this.deserializeEventStream({response:r,responseSchema:a});else o[l]=Fe.sdkStreamMixin(r.body);else if(r.body){let p=await v(r.body,t);if(p.byteLength>0)o[l]=await c.read(f,p)}}else if(u.httpHeader){let h=String(u.httpHeader).toLowerCase(),p=r.headers[h];if(p!=null)if(f.isListSchema()){let b=f.getValueSchema();b.getMergedTraits().httpHeader=h;let y;if(b.isTimestampSchema()&&b.getSchema()===4)y=U.splitEvery(p,",",2);else y=U.splitHeader(p);let m=[];for(let w of y)m.push(await c.read(b,w.trim()));o[l]=m}else o[l]=await c.read(f,p)}else if(u.httpPrefixHeaders!==void 0){o[l]={};for(let[h,p]of Object.entries(r.headers))if(h.startsWith(u.httpPrefixHeaders)){let b=f.getValueSchema();b.getMergedTraits().httpHeader=h,o[l][h.slice(u.httpPrefixHeaders.length)]=await c.read(b,p)}}else if(u.httpResponseCode)o[l]=r.statusCode;else d.push(l)}return d.discardResponseBody=i,d}}class Ps extends ze{async serializeRequest(e,t,r){let s=this.serializer,n={},o={},i=await r.endpoint(),c=R.NormalizedSchema.of(e?.input),a=c.getSchema(),d,l=t&&typeof t==="object"?t:{},f=new fe.HttpRequest({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:n,headers:o,body:void 0});if(i)this.updateServiceEndpoint(f,i),this.setHostPrefix(f,e,l);if(l){let u=c.getEventStreamMember();if(u){if(l[u]){let h={};for(let[p,b]of c.structIterator())if(p!==u&&l[p])s.write(b,l[p]),h[p]=s.flush();d=await this.serializeEventStream({eventStream:l[u],requestSchema:c,initialRequest:h})}}else s.write(a,l),d=s.flush()}return f.headers=Object.assign(f.headers,o),f.query=n,f.body=d,f.method="POST",f}async deserializeResponse(e,t,r){let s=this.deserializer,n=R.NormalizedSchema.of(e.output),o={};if(r.statusCode>=300){let c=await v(r.body,t);if(c.byteLength>0)Object.assign(o,await s.read(15,c));throw await this.handleError(e,t,r,o,this.deserializeMetadata(r)),Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let c in r.headers){let a=r.headers[c];delete r.headers[c],r.headers[c.toLowerCase()]=a}let i=n.getEventStreamMember();if(i)o[i]=await this.deserializeEventStream({response:r,responseSchema:n,initialResponseContainer:o});else{let c=await v(r.body,t);if(c.byteLength>0)Object.assign(o,await s.read(n,c))}return o.$metadata=this.deserializeMetadata(r),o}}var As=(e,t,r,s,n,o)=>{if(t!=null&&t[r]!==void 0){let i=s();if(i==null||i.length<=0)throw Error("Empty value provided for input HTTP label: "+r+".");e=e.replace(n,o?i.split("/").map((c)=>ue(c)).join("/"):ue(i))}else throw Error("No value provided for input HTTP label: "+r+".");return e};function Ea(e,t){return new wt(e,t)}class wt{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(e,t){this.input=e,this.context=t}async build(){let{hostname:e,protocol:t="https",port:r,path:s}=await this.context.endpoint();this.path=s;for(let n of this.resolvePathStack)n(this.path);return new fe.HttpRequest({protocol:t,hostname:this.hostname||e,port:r,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push((t)=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e}),this}p(e,t,r,s){return this.resolvePathStack.push((n)=>{this.path=As(n,this.input,e,t,r,s)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}function gt(e,t){if(t.timestampFormat.useTrait){if(e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema()}let{httpLabel:r,httpPrefixHeaders:s,httpHeader:n,httpQuery:o}=e.getMergedTraits();return(t.httpBindings?typeof s==="string"||Boolean(n)?6:Boolean(o)||Boolean(r)?5:void 0:void 0)??t.timestampFormat.default}class _t extends G{settings;constructor(e){super();this.settings=e}read(e,t){let r=R.NormalizedSchema.of(e);if(r.isListSchema())return U.splitHeader(t).map((s)=>this.read(r.getValueSchema(),s));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??He.fromBase64)(t);if(r.isTimestampSchema())switch(gt(r,this.settings)){case 5:return U._parseRfc3339DateTimeWithOffset(t);case 6:return U._parseRfc7231DateTime(t);case 7:return U._parseEpochTimestamp(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(r.isStringSchema()){let s=r.getMergedTraits().mediaType,n=t;if(s){if(r.getMergedTraits().httpHeader)n=this.base64ToUtf8(n);if(s==="application/json"||s.endsWith("+json"))n=U.LazyJsonString.from(n);return n}}if(r.isNumericSchema())return Number(t);if(r.isBigIntegerSchema())return BigInt(t);if(r.isBigDecimalSchema())return new U.NumericValue(t,"bigDecimal");if(r.isBooleanSchema())return String(t).toLowerCase()==="true";return t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??bt.toUtf8)((this.serdeContext?.base64Decoder??He.fromBase64)(e))}}class Rs extends G{codecDeserializer;stringDeserializer;constructor(e,t){super();this.codecDeserializer=e,this.stringDeserializer=new _t(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){let r=R.NormalizedSchema.of(e),s=r.getMergedTraits(),n=this.serdeContext?.utf8Encoder??bt.toUtf8;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(r,n(t));if(s.httpPayload){if(r.isBlobSchema()){let o=this.serdeContext?.utf8Decoder??bt.fromUtf8;if(typeof t==="string")return o(t);return t}else if(r.isStringSchema()){if("byteLength"in t)return n(t);return t}}return this.codecDeserializer.read(r,t)}}class Tt extends G{settings;stringBuffer="";constructor(e){super();this.settings=e}write(e,t){let r=R.NormalizedSchema.of(e);switch(typeof t){case"object":if(t===null){this.stringBuffer="null";return}if(r.isTimestampSchema()){if(!(t instanceof Date))throw Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${r.getName(!0)}`);switch(gt(r,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=U.dateToUtcString(t);break;case 7:this.stringBuffer=String(t.getTime()/1000);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1000)}return}if(r.isBlobSchema()&&"byteLength"in t){this.stringBuffer=(this.serdeContext?.base64Encoder??He.toBase64)(t);return}if(r.isListSchema()&&Array.isArray(t)){let o="";for(let i of t){this.write([r.getValueSchema(),r.getMergedTraits()],i);let c=this.flush(),a=r.getValueSchema().isTimestampSchema()?c:U.quoteHeader(c);if(o!=="")o+=", ";o+=a}this.stringBuffer=o;return}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":let s=r.getMergedTraits().mediaType,n=t;if(s){if(s==="application/json"||s.endsWith("+json"))n=U.LazyJsonString.from(n);if(r.getMergedTraits().httpHeader){this.stringBuffer=(this.serdeContext?.base64Encoder??He.toBase64)(n.toString());return}}this.stringBuffer=t;break;default:if(r.isIdempotencyToken())this.stringBuffer=U.generateIdempotencyToken();else this.stringBuffer=String(t)}}flush(){let e=this.stringBuffer;return this.stringBuffer="",e}}class Us{codecSerializer;stringSerializer;buffer;constructor(e,t,r=new Tt(t)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){let r=R.NormalizedSchema.of(e),s=r.getMergedTraits();if(s.httpHeader||s.httpLabel||s.httpQuery){this.stringSerializer.write(r,t),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(r,t)}flush(){if(this.buffer!==void 0){let e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}Sa.FromStringShapeDeserializer=_t;Sa.HttpBindingProtocol=Ms;Sa.HttpInterceptingShapeDeserializer=Rs;Sa.HttpInterceptingShapeSerializer=Us;Sa.HttpProtocol=ze;Sa.RequestBuilder=wt;Sa.RpcProtocol=Ps;Sa.SerdeContext=G;Sa.ToStringShapeSerializer=Tt;Sa.collectBody=v;Sa.determineTimestampFormat=gt;Sa.extendedEncodeURIComponent=ue;Sa.requestBuilder=Ea;Sa.resolvedPath=As});var Df=_((he)=>{var Bs=jt(),We=Pt(),ja=Qe(),ke=ct(),$t=Is();class Ns{config;middlewareStack=Bs.constructStack();initConfig;handlers;constructor(e){this.config=e;let{protocol:t,protocolSettings:r}=e;if(r){if(typeof t==="function")e.protocol=new t(r)}}send(e,t,r){let s=typeof t!=="function"?t:void 0,n=typeof t==="function"?t:r,o=s===void 0&&this.config.cacheMiddleware===!0,i;if(o){if(!this.handlers)this.handlers=new WeakMap;let c=this.handlers;if(c.has(e.constructor))i=c.get(e.constructor);else i=e.resolveMiddleware(this.middlewareStack,this.config,s),c.set(e.constructor,i)}else delete this.handlers,i=e.resolveMiddleware(this.middlewareStack,this.config,s);if(n)i(e).then((c)=>n(null,c.output),(c)=>n(c)).catch(()=>{});else return i(e).then((c)=>c.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var Et="***SensitiveInformation***";function St(e,t){if(t==null)return t;let r=ja.NormalizedSchema.of(e);if(r.getMergedTraits().sensitive)return Et;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return Et}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return Et}else if(r.isStructSchema()&&typeof t==="object"){let s=t,n={};for(let[o,i]of r.structIterator())if(s[o]!=null)n[o]=St(i,s[o]);return n}return t}class Ot{middlewareStack=Bs.constructStack();schema;static classBuilder(){return new qs}resolveMiddlewareWithContext(e,t,r,{middlewareFn:s,clientName:n,commandName:o,inputFilterSensitiveLog:i,outputFilterSensitiveLog:c,smithyContext:a,additionalContext:d,CommandCtor:l}){for(let b of s.bind(this)(l,e,t,r))this.middlewareStack.use(b);let f=e.concat(this.middlewareStack),{logger:u}=t,h={logger:u,clientName:n,commandName:o,inputFilterSensitiveLog:i,outputFilterSensitiveLog:c,[We.SMITHY_CONTEXT_KEY]:{commandInstance:this,...a},...d},{requestHandler:p}=t;return f.resolve((b)=>p.handle(b.request,r||{}),h)}}class qs{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,r={}){return this._smithyContext={service:e,operation:t,...r},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=(r)=>r,t=(r)=>r){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){let e=this,t;return t=class extends Ot{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[r]){super();this.input=r??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(r,s,n){let o=e._operationSchema,i=o?.[4]??o?.input,c=o?.[5]??o?.output;return this.resolveMiddlewareWithContext(r,s,n,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(o?St.bind(null,i):(a)=>a),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?St.bind(null,c):(a)=>a),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}var Ca="***SensitiveInformation***",Fa=(e,t,r)=>{for(let[o,i]of Object.entries(e)){let c=async function(d,l,f){let u=new i(d);if(typeof l==="function")this.send(u,l);else if(typeof f==="function"){if(typeof l!=="object")throw Error(`Expected http options but got ${typeof l}`);this.send(u,l||{},f)}else return this.send(u,l)},a=(o[0].toLowerCase()+o.slice(1)).replace(/Command$/,"");t.prototype[a]=c}let{paginators:s={},waiters:n={}}=r??{};for(let[o,i]of Object.entries(s))if(t.prototype[o]===void 0)t.prototype[o]=function(c={},a,...d){return i({...a,client:this},c,...d)};for(let[o,i]of Object.entries(n))if(t.prototype[o]===void 0)t.prototype[o]=async function(c={},a,...d){let l=a;if(typeof a==="number")l={maxWaitTime:a};return i({...l,client:this},c,...d)}};class V extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message);Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;let t=e;return V.prototype.isPrototypeOf(t)||Boolean(t.$fault)&&Boolean(t.$metadata)&&(t.$fault==="client"||t.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;let t=e;if(this===V)return V.isInstance(e);if(V.isInstance(e)){if(t.name&&this.name)return this.prototype.isPrototypeOf(e)||t.name===this.name;return this.prototype.isPrototypeOf(e)}return!1}}var Ls=(e,t={})=>{Object.entries(t).filter(([,s])=>s!==void 0).forEach(([s,n])=>{if(e[s]==null||e[s]==="")e[s]=n});let r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e},js=({output:e,parsedBody:t,exceptionCtor:r,errorCode:s})=>{let n=za(e),o=n.httpStatusCode?n.httpStatusCode+"":void 0,i=new r({name:t?.code||t?.Code||s||o||"UnknownError",$fault:"client",$metadata:n});throw Ls(i,t)},Ha=(e)=>{return({output:t,parsedBody:r,errorCode:s})=>{js({output:t,parsedBody:r,exceptionCtor:e,errorCode:s})}},za=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Wa=(e)=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}},Ds=!1,ka=(e)=>{if(e&&!Ds&&parseInt(e.substring(1,e.indexOf(".")))<16)Ds=!0},Cs=Object.values(We.AlgorithmId),Ja=(e)=>{let t=[];for(let r in We.AlgorithmId){let s=We.AlgorithmId[r];if(e[s]===void 0)continue;t.push({algorithmId:()=>s,checksumConstructor:()=>e[s]})}for(let[r,s]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>r,checksumConstructor:()=>s});return{addChecksumAlgorithm(r){e.checksumAlgorithms=e.checksumAlgorithms??{};let s=r.algorithmId(),n=r.checksumConstructor();if(Cs.includes(s))e.checksumAlgorithms[s.toUpperCase()]=n;else e.checksumAlgorithms[s]=n;t.push(r)},checksumAlgorithms(){return t}}},va=(e)=>{let t={};return e.checksumAlgorithms().forEach((r)=>{let s=r.algorithmId();if(Cs.includes(s))t[s]=r.checksumConstructor()}),t},Ya=(e)=>{return{setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}},Qa=(e)=>{let t={};return t.retryStrategy=e.retryStrategy(),t},Fs=(e)=>{return Object.assign(Ja(e),Ya(e))},Za=Fs,Xa=(e)=>{return Object.assign(va(e),Qa(e))},Ga=(e)=>Array.isArray(e)?e:[e],Hs=(e)=>{for(let r in e)if(e.hasOwnProperty(r)&&e[r]["#text"]!==void 0)e[r]=e[r]["#text"];else if(typeof e[r]==="object"&&e[r]!==null)e[r]=Hs(e[r]);return e},Va=(e)=>{return e!=null};class zs{trace(){}debug(){}info(){}warn(){}error(){}}function Ws(e,t,r){let s,n,o;if(typeof t>"u"&&typeof r>"u")s={},o=e;else if(s=e,typeof t==="function")return n=t,o=r,tf(s,n,o);else o=t;for(let i of Object.keys(o)){if(!Array.isArray(o[i])){s[i]=o[i];continue}ks(s,null,o,i)}return s}var Ka=(e)=>{let t={};for(let[r,s]of Object.entries(e||{}))t[r]=[,s];return t},ef=(e,t)=>{let r={};for(let s in t)ks(r,e,t,s);return r},tf=(e,t,r)=>{return Ws(e,Object.entries(r).reduce((s,[n,o])=>{if(Array.isArray(o))s[n]=o;else if(typeof o==="function")s[n]=[t,o()];else s[n]=[t,o];return s},{}))},ks=(e,t,r,s)=>{if(t!==null){let i=r[s];if(typeof i==="function")i=[,i];let[c=rf,a=sf,d=s]=i;if(typeof c==="function"&&c(t[d])||typeof c!=="function"&&!!c)e[s]=a(t[d]);return}let[n,o]=r[s];if(typeof o==="function"){let i,c=n===void 0&&(i=o())!=null,a=typeof n==="function"&&!!n(void 0)||typeof n!=="function"&&!!n;if(c)e[s]=i;else if(a)e[s]=o()}else{let i=n===void 0&&o!=null,c=typeof n==="function"&&!!n(o)||typeof n!=="function"&&!!n;if(i||c)e[s]=o}},rf=(e)=>e!=null,sf=(e)=>e,nf=(e)=>{if(e!==e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}},of=(e)=>e.toISOString().replace(".000Z","Z"),xt=(e)=>{if(e==null)return{};if(Array.isArray(e))return e.filter((t)=>t!=null).map(xt);if(typeof e==="object"){let t={};for(let r of Object.keys(e)){if(e[r]==null)continue;t[r]=xt(e[r])}return t}return e};he.collectBody=$t.collectBody;he.extendedEncodeURIComponent=$t.extendedEncodeURIComponent;he.resolvedPath=$t.resolvedPath;he.Client=Ns;he.Command=Ot;he.NoOpLogger=zs;he.SENSITIVE_STRING=Ca;he.ServiceException=V;he._json=xt;he.convertMap=Ka;he.createAggregatedClient=Fa;he.decorateServiceException=Ls;he.emitWarningIfUnsupportedVersion=ka;he.getArrayIfSingleItem=Ga;he.getDefaultClientConfiguration=Za;he.getDefaultExtensionConfiguration=Fs;he.getValueFromTextNode=Hs;he.isSerializableHeaderValue=Va;he.loadConfigsForDefaultMode=Wa;he.map=Ws;he.resolveDefaultRuntimeConfig=Xa;he.serializeDateTime=of;he.serializeFloat=nf;he.take=ef;he.throwDefaultError=js;he.withBaseException=Ha;Object.prototype.hasOwnProperty.call(ke,"__proto__")&&!Object.prototype.hasOwnProperty.call(he,"__proto__")&&Object.defineProperty(he,"__proto__",{enumerable:!0,value:ke.__proto__});Object.keys(ke).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(he,e))he[e]=ke[e]})});
|
|
19
|
+
export{At as Gg,J as Hg,Wr as Ig,rs as Jg,Os as Kg,Ut as Lg,Qe as Mg,kt as Ng,ct as Og,Is as Pg,Df as Qg};
|