@shumai-one/shumai 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/bin/{chunk-th07gms7.js → chunk-0jesq6sm.js} +1 -1
  2. package/bin/{chunk-fnkrzqrn.js → chunk-0jr6q4j4.js} +2 -2
  3. package/bin/{chunk-nh4tzzn8.js → chunk-0sajh8fw.js} +2 -2
  4. package/bin/{chunk-xt9n0y9a.js → chunk-1b7shyfp.js} +1 -1
  5. package/bin/{chunk-bv642x5z.js → chunk-1f8rr3ef.js} +2 -2
  6. package/bin/{chunk-hbrndqpj.js → chunk-1fq10abj.js} +2 -2
  7. package/bin/chunk-1hn9v6hv.js +2 -0
  8. package/bin/{chunk-97y52q3a.js → chunk-20wtz3kc.js} +3 -3
  9. package/bin/chunk-2882s5sp.js +1 -0
  10. package/bin/{chunk-fcvtv783.js → chunk-29nhtrfv.js} +1 -1
  11. package/bin/chunk-3egeywt8.js +1 -0
  12. package/bin/{chunk-29203j0e.js → chunk-3htn4m2d.js} +2 -2
  13. package/bin/{chunk-g5mpp3nc.js → chunk-47093mwk.js} +1 -1
  14. package/bin/{chunk-6vn44e4d.js → chunk-4a9sdfyp.js} +2 -2
  15. package/bin/{chunk-v0cdg3n6.js → chunk-4ajat3xv.js} +57 -57
  16. package/bin/{chunk-8vc1m0kw.js → chunk-55myfmhy.js} +2 -2
  17. package/bin/{chunk-8vvr1ez5.js → chunk-5wrakb8p.js} +1 -1
  18. package/bin/{chunk-afzc5eae.js → chunk-6awkqp09.js} +1 -1
  19. package/bin/chunk-6bztpk7h.js +1 -0
  20. package/bin/{chunk-n67rfv86.js → chunk-6edadcpn.js} +2 -2
  21. package/bin/chunk-74zstxav.js +6 -0
  22. package/bin/chunk-76hs7g0x.js +2 -0
  23. package/bin/{chunk-7jkvjm4x.js → chunk-7b60a9sy.js} +2 -2
  24. package/bin/{chunk-3w9vybrh.js → chunk-7fm1hznx.js} +2 -2
  25. package/bin/{chunk-jkapr5we.js → chunk-800vdz5n.js} +1 -1
  26. package/bin/{chunk-4sdrjye2.js → chunk-89kqtj7x.js} +2 -2
  27. package/bin/chunk-8g0mhzsg.js +2 -0
  28. package/bin/{chunk-fgda7ncw.js → chunk-8jdgzy22.js} +2 -2
  29. package/bin/chunk-8js9m1j7.js +1 -0
  30. package/bin/{chunk-4b8ms2ct.js → chunk-9annjnj2.js} +2 -2
  31. package/bin/{chunk-g0jy85re.js → chunk-9hsfjqgq.js} +2 -2
  32. package/bin/{chunk-d4zx3r12.js → chunk-9p5n3m2z.js} +1 -1
  33. package/bin/{chunk-7mkk8ahk.js → chunk-9tnfhrnh.js} +2 -2
  34. package/bin/{chunk-fq6emqwq.js → chunk-a5fw02xq.js} +3 -3
  35. package/bin/chunk-adekdctx.css +1 -0
  36. package/bin/{chunk-ks8deg42.js → chunk-aeg4kya9.js} +1 -1
  37. package/bin/{chunk-zj1rz1s9.js → chunk-bq2aq6v8.js} +2 -2
  38. package/bin/{chunk-7w2tx08e.js → chunk-c9bpf8gp.js} +2 -2
  39. package/bin/{chunk-f7fevgv2.js → chunk-ce50f746.js} +2 -2
  40. package/bin/{chunk-3mprq5kb.js → chunk-crdvxq38.js} +2 -2
  41. package/bin/{chunk-rek85wwv.js → chunk-d2qp8g98.js} +2 -2
  42. package/bin/{chunk-xnzyt0kq.js → chunk-d8bpqbdw.js} +1 -1
  43. package/bin/{chunk-wknqst3v.js → chunk-dfzmqx1v.js} +3 -3
  44. package/bin/{chunk-hk7a2mgn.js → chunk-dmjzrdan.js} +2 -2
  45. package/bin/chunk-e5s7202g.js +2 -0
  46. package/bin/{chunk-fw5k0xrc.js → chunk-ef5v7gta.js} +2 -2
  47. package/bin/{chunk-bg10gwm1.js → chunk-ew4cxkcc.js} +2 -2
  48. package/bin/{chunk-v4re49f5.js → chunk-ex4qa7gv.js} +1 -1
  49. package/bin/{chunk-5r55htaw.js → chunk-f2eh802w.js} +1 -1
  50. package/bin/{chunk-r9s1zs4g.js → chunk-f44d9fpd.js} +2 -2
  51. package/bin/chunk-f5zg7b38.js +1 -0
  52. package/bin/chunk-fdm1yc29.js +1 -0
  53. package/bin/{chunk-c5esphve.js → chunk-fwbrcfaq.js} +2 -2
  54. package/bin/{chunk-w8vk30ze.js → chunk-fzaw1e34.js} +2 -2
  55. package/bin/{chunk-xqkwpr7s.js → chunk-g70eyttc.js} +2 -2
  56. package/bin/{chunk-avvzqqk2.js → chunk-gct52xks.js} +2 -2
  57. package/bin/{chunk-2jfbxefd.js → chunk-gewh7p42.js} +6 -6
  58. package/bin/chunk-gg1gwjtn.js +2 -0
  59. package/bin/chunk-gh64hag9.js +2 -0
  60. package/bin/{chunk-qm9w9fcv.js → chunk-ghz19a7t.js} +2 -2
  61. package/bin/{chunk-kn4tnhbw.js → chunk-gra3617w.js} +2 -2
  62. package/bin/{chunk-weean2ja.js → chunk-gx5rjm9m.js} +1 -1
  63. package/bin/chunk-h0p8yew4.js +1 -0
  64. package/bin/chunk-hgngnc1k.js +1 -0
  65. package/bin/chunk-hqbzjzsm.js +2 -0
  66. package/bin/{chunk-d1zpcags.js → chunk-j1awxx51.js} +2 -2
  67. package/bin/{chunk-52qe6z8w.js → chunk-js0genbf.js} +1 -1
  68. package/bin/chunk-jt4yh37q.js +62 -0
  69. package/bin/{chunk-8fsrs7mh.js → chunk-jtd7rydv.js} +1 -1
  70. package/bin/chunk-k0xpskyq.js +1 -0
  71. package/bin/{chunk-q0znwxfe.js → chunk-kaxwma6y.js} +1 -1
  72. package/bin/{chunk-p3k6nzhe.js → chunk-kk0gx8eg.js} +2 -2
  73. package/bin/{chunk-gd1x3rgn.js → chunk-mgbqjbfc.js} +1 -1
  74. package/bin/{chunk-sx1neqgr.js → chunk-mhj0pqq3.js} +2 -2
  75. package/bin/{chunk-4rz2105a.js → chunk-mmrtjcst.js} +1 -1
  76. package/bin/{chunk-8hq6sn31.js → chunk-mxee09jk.js} +2 -2
  77. package/bin/{chunk-f70xdh07.js → chunk-n198tewr.js} +2 -2
  78. package/bin/{chunk-6j6dejtd.js → chunk-n9cjmkky.js} +1 -1
  79. package/bin/{chunk-17bewdr0.js → chunk-nh31ma8d.js} +2 -2
  80. package/bin/{chunk-t58kqafx.js → chunk-nh8azwsx.js} +2 -2
  81. package/bin/chunk-nhc72y4x.js +2 -0
  82. package/bin/{chunk-7zdmpbt6.js → chunk-pm64et9d.js} +1 -1
  83. package/bin/chunk-px6q3jpz.js +1 -0
  84. package/bin/{chunk-jf5ytqxd.js → chunk-q7xfrtnj.js} +1 -1
  85. package/bin/{chunk-0bbhm7dp.js → chunk-rmm6y799.js} +2 -2
  86. package/bin/{chunk-b93djch5.js → chunk-snexx7ks.js} +1 -1
  87. package/bin/chunk-sx3by19j.js +1 -0
  88. package/bin/{chunk-p33nq4pp.js → chunk-sx7kparv.js} +2 -2
  89. package/bin/{chunk-vzb2b89p.js → chunk-t5561vz5.js} +1 -1
  90. package/bin/chunk-thj4cpev.js +2 -0
  91. package/bin/{chunk-8na8a41a.js → chunk-tqxmj05h.js} +2 -2
  92. package/bin/{chunk-54hmgj96.js → chunk-vgr9db5g.js} +2 -2
  93. package/bin/{chunk-gwxzjc0m.js → chunk-vqgz25av.js} +1 -1
  94. package/bin/{chunk-s0k2r6ym.js → chunk-vw1rhgjs.js} +2 -2
  95. package/bin/chunk-vz75bqvx.js +2 -0
  96. package/bin/{chunk-8skgcmxm.js → chunk-w16jgdfx.js} +1 -1
  97. package/bin/{chunk-x2z5zz01.js → chunk-w4ycztv5.js} +1 -1
  98. package/bin/{chunk-8mzg29m4.js → chunk-w98wvk17.js} +2 -2
  99. package/bin/chunk-wa8k9fwx.js +1 -0
  100. package/bin/{chunk-wg5tjyj9.js → chunk-y0yrmcf3.js} +2 -2
  101. package/bin/{chunk-3ydjrkbd.js → chunk-y1t47c7f.js} +1 -1
  102. package/bin/{chunk-c2a5x1pk.js → chunk-y8vw7zv1.js} +1 -1
  103. package/bin/{chunk-s0g0bc6t.js → chunk-ym47952x.js} +2 -2
  104. package/bin/{chunk-43mhpb0k.js → chunk-yzra1x8f.js} +2 -2
  105. package/bin/{chunk-arxd4qb9.js → chunk-z0tbq08w.js} +1 -1
  106. package/bin/{chunk-vpq224tm.js → chunk-z0zevgb6.js} +1 -1
  107. package/bin/{chunk-5yxngq5n.js → chunk-z2ef8zpz.js} +1 -1
  108. package/bin/chunk-z3p3qz9d.js +3 -0
  109. package/bin/chunk-zv85aqwb.css +1 -0
  110. package/bin/shumai-app.html +1 -1
  111. package/bin/shumai-app.js +484 -343
  112. package/package.json +7 -7
  113. package/prisma/migrations/20260810025327_add_mcp_servers/migration.sql +71 -0
  114. package/prisma/migrations/20260810074554_mcp_server_cleanup/migration.sql +12 -0
  115. package/prisma/migrations/20260810124707_add_mcp_server_instructions/migration.sql +2 -0
  116. package/prisma/schema.prisma +69 -0
  117. package/bin/chunk-1fqpgz02.js +0 -2
  118. package/bin/chunk-21hvrvzj.js +0 -2
  119. package/bin/chunk-23mj9p82.js +0 -1
  120. package/bin/chunk-24mag65w.js +0 -1
  121. package/bin/chunk-2jv9re91.js +0 -2
  122. package/bin/chunk-2rmceamt.js +0 -1
  123. package/bin/chunk-6kv3jyfc.js +0 -2
  124. package/bin/chunk-8ttfy5yy.js +0 -1
  125. package/bin/chunk-95qc4bkh.js +0 -2
  126. package/bin/chunk-9nd5m7hy.js +0 -1
  127. package/bin/chunk-ampyjbj4.js +0 -1
  128. package/bin/chunk-bkcf4hw5.js +0 -1
  129. package/bin/chunk-cbjfw47x.js +0 -62
  130. package/bin/chunk-h2tztyxs.js +0 -1
  131. package/bin/chunk-htrzgs2a.css +0 -1
  132. package/bin/chunk-jqyprvqd.js +0 -1
  133. package/bin/chunk-jyeyp8p3.js +0 -1
  134. package/bin/chunk-kwr4m6vh.js +0 -1
  135. package/bin/chunk-n62kyrh1.js +0 -1
  136. package/bin/chunk-ntxwp6aa.js +0 -3
  137. package/bin/chunk-qxwfhv63.js +0 -2
  138. package/bin/chunk-x217skr3.js +0 -2
  139. package/bin/chunk-y6aa5ee0.js +0 -2
  140. package/bin/{chunk-vvr179pz.js → chunk-hcvpb1hw.js} +1 -1
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Oj as O}from"./chunk-arxd4qb9.js";import{Pj as C,Qj as E}from"./chunk-3ydjrkbd.js";import{Rj as y,Sj as K,Tj as P}from"./chunk-17bewdr0.js";import{Uj as b}from"./chunk-x2z5zz01.js";import"./chunk-7zdmpbt6.js";import{Wj as M}from"./chunk-b93djch5.js";import{Yj as H}from"./chunk-q0znwxfe.js";import{Zj as k}from"./chunk-w8vk30ze.js";import"./chunk-43mhpb0k.js";import{mk as A,nk as N}from"./chunk-vpq224tm.js";import{sk as $,uk as S}from"./chunk-fcvtv783.js";import"./chunk-jkapr5we.js";import{yk as _}from"./chunk-5r55htaw.js";import{Fk as f}from"./chunk-bg10gwm1.js";import{Gk as U}from"./chunk-vvr179pz.js";import"./chunk-gd1x3rgn.js";var g=new Set(["openai","openai-codex","opencode"]),u=16;function V(j,D){if(!j)return!1;let w=D.toLowerCase();for(let[z,F]of Object.entries(j))if(z.toLowerCase()===w&&F!==null&&F.trim().length>0)return!0;return!1}function R(j,D,w){if(D)return D;if(V(w,"authorization")||V(w,"cf-aig-authorization"))return"unused";throw Error(`No API key for provider: ${j}`)}function c(j){return j.provider==="openrouter"||j.baseUrl.includes("openrouter.ai")?"openrouter":"openai"}function T(j,D){if(j)return j;if(k("PI_CACHE_RETENTION",D)==="long")return"long";return"short"}function q(j){return{supportsDeveloperRole:j.compat?.supportsDeveloperRole??!0,sessionAffinityFormat:j.compat?.sessionAffinityFormat??c(j),supportsLongCacheRetention:j.compat?.supportsLongCacheRetention??!0,supportsStrictMode:j.compat?.supportsStrictMode??!1,supportsOpenAIGrammarTools:j.compat?.supportsOpenAIGrammarTools??!1,supportsToolSearch:j.compat?.supportsToolSearch??!1,supportsExplicitPromptCacheMode:j.compat?.supportsExplicitPromptCacheMode??!1}}function r(j,D){return D==="long"&&j.supportsLongCacheRetention?"24h":void 0}function d(j){return N(A(j),"OpenAI API error")}var l=(j,D,w)=>{let z=new U;return(async()=>{let F={role:"assistant",content:[],api:j.api,provider:j.provider,model:j.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let Q=R(j.provider,w?.apiKey,w?.headers),W=T(w?.cacheRetention,w?.env)==="none"?void 0:w?.sessionId,X=q(j),J=$(D.tools,X.supportsOpenAIGrammarTools),Y=a(j,D,Q,w?.headers,W),Z=m(j,D,w,X,J),B=await w?.onPayload?.(Z,j);if(B!==void 0)Z=B;let v={...w?.signal?{signal:w.signal}:{},...w?.timeoutMs!==void 0?{timeout:w.timeoutMs}:{},maxRetries:0},{data:I,response:L}=await H(()=>Y.responses.create(Z,v).withResponse(),{maxRetries:w?.maxRetries,maxRetryDelayMs:w?.maxRetryDelayMs,signal:w?.signal});if(await w?.onResponse?.({status:L.status,headers:_(L.headers)},j),z.push({type:"start",partial:F}),await P(I,F,z,j,{serviceTier:w?.serviceTier,grammarToolInputProperties:J,applyServiceTierPricing:(x,h)=>n(x,h,j)}),w?.signal?.aborted)throw Error("Request was aborted");if(F.stopReason==="aborted"||F.stopReason==="error")throw Error("An unknown error occurred");z.push({type:"done",reason:F.stopReason,message:F}),z.end()}catch(Q){for(let G of F.content)delete G.index,delete G.partialJson,delete G.customInput;F.stopReason=w?.signal?.aborted?"aborted":"error",F.errorMessage=d(Q),z.push({type:"error",reason:F.stopReason,error:F}),z.end()}})(),z},Wj=(j,D,w)=>{R(j.provider,w?.apiKey,w?.headers);let z=S(j,D,w,w?.apiKey),F=w?.reasoning?f(j,w.reasoning):void 0;return l(j,D,{...z,reasoningEffort:F==="off"?void 0:F})};function a(j,D,w,z,F){let Q=q(j),G={...j.headers};if(j.provider==="github-copilot"){let W=C(D.messages),X=E({messages:D.messages,hasImages:W});Object.assign(G,X)}if(F)if(Q.sessionAffinityFormat==="openrouter")G["x-session-id"]=F;else{if(Q.sessionAffinityFormat==="openai")G.session_id=F;G["x-client-request-id"]=F}if(z)Object.assign(G,z);return new M({apiKey:w,baseURL:j.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:G})}function m(j,D,w,z=q(j),F=$(D.tools,z.supportsOpenAIGrammarTools)){let Q=O(D,z.supportsToolSearch),G=y(j,D,g,{grammarToolInputProperties:F,deferredTools:Q.deferred,toolOptions:{supportsStrictMode:z.supportsStrictMode,supportsOpenAIGrammarTools:z.supportsOpenAIGrammarTools}}),W=T(w?.cacheRetention,w?.env),X=W==="none"&&z.supportsExplicitPromptCacheMode,J={model:j.id,input:G,stream:!0,prompt_cache_key:W==="none"?void 0:b(w?.sessionId),prompt_cache_retention:r(z,W),prompt_cache_options:X?{mode:"explicit"}:void 0,store:!1};if(w?.maxTokens)J.max_output_tokens=Math.max(w.maxTokens,u);if(w?.temperature!==void 0)J.temperature=w?.temperature;if(w?.serviceTier!==void 0)J.service_tier=w.serviceTier;if(Q.immediate.length>0)J.tools=K(Q.immediate,{supportsStrictMode:z.supportsStrictMode,supportsOpenAIGrammarTools:z.supportsOpenAIGrammarTools});if(w?.toolChoice!==void 0)J.tool_choice=w.toolChoice;if(j.reasoning){if(w?.reasoningEffort||w?.reasoningSummary){let Y=w?.reasoningEffort?j.thinkingLevelMap?.[w.reasoningEffort]??w.reasoningEffort:"medium";J.reasoning={effort:Y,summary:w?.reasoningSummary||"auto"},J.include=["reasoning.encrypted_content"]}else if(j.provider!=="github-copilot"&&j.thinkingLevelMap?.off!==null)J.reasoning={effort:j.thinkingLevelMap?.off??"none"};if(j.provider==="xai")J.include=["reasoning.encrypted_content"]}return J}function i(j,D){switch(D){case"flex":return 0.5;case"priority":return j.id==="gpt-5.5"?2.5:2;default:return 1}}function n(j,D,w){let z=i(w,D);if(z===1)return;j.cost.input*=z,j.cost.output*=z,j.cost.cacheRead*=z,j.cost.cacheWrite*=z,j.cost.total=j.cost.input+j.cost.output+j.cost.cacheRead+j.cost.cacheWrite}export{Wj as streamSimple,l as stream};
2
+ import{Mk as O}from"./chunk-z0tbq08w.js";import{Nk as C,Ok as E}from"./chunk-y1t47c7f.js";import{Pk as y,Qk as K,Rk as P}from"./chunk-nh31ma8d.js";import{Sk as b}from"./chunk-w4ycztv5.js";import"./chunk-pm64et9d.js";import{Uk as M}from"./chunk-snexx7ks.js";import{Wk as H}from"./chunk-kaxwma6y.js";import{Xk as k}from"./chunk-fzaw1e34.js";import"./chunk-yzra1x8f.js";import{kl as A,ll as N}from"./chunk-z0zevgb6.js";import{ql as $,sl as S}from"./chunk-29nhtrfv.js";import"./chunk-800vdz5n.js";import{wl as _}from"./chunk-f2eh802w.js";import{Dl as f}from"./chunk-ew4cxkcc.js";import{El as U}from"./chunk-hcvpb1hw.js";import"./chunk-mgbqjbfc.js";var g=new Set(["openai","openai-codex","opencode"]),u=16;function V(j,D){if(!j)return!1;let w=D.toLowerCase();for(let[z,F]of Object.entries(j))if(z.toLowerCase()===w&&F!==null&&F.trim().length>0)return!0;return!1}function R(j,D,w){if(D)return D;if(V(w,"authorization")||V(w,"cf-aig-authorization"))return"unused";throw Error(`No API key for provider: ${j}`)}function c(j){return j.provider==="openrouter"||j.baseUrl.includes("openrouter.ai")?"openrouter":"openai"}function T(j,D){if(j)return j;if(k("PI_CACHE_RETENTION",D)==="long")return"long";return"short"}function q(j){return{supportsDeveloperRole:j.compat?.supportsDeveloperRole??!0,sessionAffinityFormat:j.compat?.sessionAffinityFormat??c(j),supportsLongCacheRetention:j.compat?.supportsLongCacheRetention??!0,supportsStrictMode:j.compat?.supportsStrictMode??!1,supportsOpenAIGrammarTools:j.compat?.supportsOpenAIGrammarTools??!1,supportsToolSearch:j.compat?.supportsToolSearch??!1,supportsExplicitPromptCacheMode:j.compat?.supportsExplicitPromptCacheMode??!1}}function r(j,D){return D==="long"&&j.supportsLongCacheRetention?"24h":void 0}function d(j){return N(A(j),"OpenAI API error")}var l=(j,D,w)=>{let z=new U;return(async()=>{let F={role:"assistant",content:[],api:j.api,provider:j.provider,model:j.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let Q=R(j.provider,w?.apiKey,w?.headers),W=T(w?.cacheRetention,w?.env)==="none"?void 0:w?.sessionId,X=q(j),J=$(D.tools,X.supportsOpenAIGrammarTools),Y=a(j,D,Q,w?.headers,W),Z=m(j,D,w,X,J),B=await w?.onPayload?.(Z,j);if(B!==void 0)Z=B;let v={...w?.signal?{signal:w.signal}:{},...w?.timeoutMs!==void 0?{timeout:w.timeoutMs}:{},maxRetries:0},{data:I,response:L}=await H(()=>Y.responses.create(Z,v).withResponse(),{maxRetries:w?.maxRetries,maxRetryDelayMs:w?.maxRetryDelayMs,signal:w?.signal});if(await w?.onResponse?.({status:L.status,headers:_(L.headers)},j),z.push({type:"start",partial:F}),await P(I,F,z,j,{serviceTier:w?.serviceTier,grammarToolInputProperties:J,applyServiceTierPricing:(x,h)=>n(x,h,j)}),w?.signal?.aborted)throw Error("Request was aborted");if(F.stopReason==="aborted"||F.stopReason==="error")throw Error("An unknown error occurred");z.push({type:"done",reason:F.stopReason,message:F}),z.end()}catch(Q){for(let G of F.content)delete G.index,delete G.partialJson,delete G.customInput;F.stopReason=w?.signal?.aborted?"aborted":"error",F.errorMessage=d(Q),z.push({type:"error",reason:F.stopReason,error:F}),z.end()}})(),z},Wj=(j,D,w)=>{R(j.provider,w?.apiKey,w?.headers);let z=S(j,D,w,w?.apiKey),F=w?.reasoning?f(j,w.reasoning):void 0;return l(j,D,{...z,reasoningEffort:F==="off"?void 0:F})};function a(j,D,w,z,F){let Q=q(j),G={...j.headers};if(j.provider==="github-copilot"){let W=C(D.messages),X=E({messages:D.messages,hasImages:W});Object.assign(G,X)}if(F)if(Q.sessionAffinityFormat==="openrouter")G["x-session-id"]=F;else{if(Q.sessionAffinityFormat==="openai")G.session_id=F;G["x-client-request-id"]=F}if(z)Object.assign(G,z);return new M({apiKey:w,baseURL:j.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:G})}function m(j,D,w,z=q(j),F=$(D.tools,z.supportsOpenAIGrammarTools)){let Q=O(D,z.supportsToolSearch),G=y(j,D,g,{grammarToolInputProperties:F,deferredTools:Q.deferred,toolOptions:{supportsStrictMode:z.supportsStrictMode,supportsOpenAIGrammarTools:z.supportsOpenAIGrammarTools}}),W=T(w?.cacheRetention,w?.env),X=W==="none"&&z.supportsExplicitPromptCacheMode,J={model:j.id,input:G,stream:!0,prompt_cache_key:W==="none"?void 0:b(w?.sessionId),prompt_cache_retention:r(z,W),prompt_cache_options:X?{mode:"explicit"}:void 0,store:!1};if(w?.maxTokens)J.max_output_tokens=Math.max(w.maxTokens,u);if(w?.temperature!==void 0)J.temperature=w?.temperature;if(w?.serviceTier!==void 0)J.service_tier=w.serviceTier;if(Q.immediate.length>0)J.tools=K(Q.immediate,{supportsStrictMode:z.supportsStrictMode,supportsOpenAIGrammarTools:z.supportsOpenAIGrammarTools});if(w?.toolChoice!==void 0)J.tool_choice=w.toolChoice;if(j.reasoning){if(w?.reasoningEffort||w?.reasoningSummary){let Y=w?.reasoningEffort?j.thinkingLevelMap?.[w.reasoningEffort]??w.reasoningEffort:"medium";J.reasoning={effort:Y,summary:w?.reasoningSummary||"auto"},J.include=["reasoning.encrypted_content"]}else if(j.provider!=="github-copilot"&&j.thinkingLevelMap?.off!==null)J.reasoning={effort:j.thinkingLevelMap?.off??"none"};if(j.provider==="xai")J.include=["reasoning.encrypted_content"]}return J}function i(j,D){switch(D){case"flex":return 0.5;case"priority":return j.id==="gpt-5.5"?2.5:2;default:return 1}}function n(j,D,w){let z=i(w,D);if(z===1)return;j.cost.input*=z,j.cost.output*=z,j.cost.cacheRead*=z,j.cost.cacheWrite*=z,j.cost.total=j.cost.input+j.cost.output+j.cost.cacheRead+j.cost.cacheWrite}export{Wj as streamSimple,l as stream};
@@ -1,2 +1,2 @@
1
- import{$g as l,Zg as a,ah as o}from"./chunk-cbjfw47x.js";var p=a()(o((i)=>({fileViewLeftSidebarCollapsed:!0,setFileViewLeftSidebarCollapsed:(e)=>i({fileViewLeftSidebarCollapsed:e}),fileViewRightSidebarCollapsed:!1,setFileViewRightSidebarCollapsed:(e)=>i({fileViewRightSidebarCollapsed:e}),fileListLeftSidebarCollapsed:!1,setFileListLeftSidebarCollapsed:(e)=>i({fileListLeftSidebarCollapsed:e}),fileListRightSidebarCollapsed:!0,setFileListRightSidebarCollapsed:(e)=>i({fileListRightSidebarCollapsed:e}),shareConfigLeftSidebarCollapsed:!1,setShareConfigLeftSidebarCollapsed:(e)=>i({shareConfigLeftSidebarCollapsed:e}),shareConfigRightSidebarCollapsed:!1,setShareConfigRightSidebarCollapsed:(e)=>i({shareConfigRightSidebarCollapsed:e}),viewModes:{},setViewMode:(e,d)=>i((s)=>({viewModes:{...s.viewModes,[e]:d}})),videoTimeDisplayMode:"standard",setVideoTimeDisplayMode:(e)=>i({videoTimeDisplayMode:e})}),{name:"ui-storage",storage:l(()=>localStorage)}));
2
- export{p as vf};
1
+ import{Uh as a,Wh as l,Xh as o}from"./chunk-jt4yh37q.js";var p=a()(o((i)=>({fileViewLeftSidebarCollapsed:!0,setFileViewLeftSidebarCollapsed:(e)=>i({fileViewLeftSidebarCollapsed:e}),fileViewRightSidebarCollapsed:!1,setFileViewRightSidebarCollapsed:(e)=>i({fileViewRightSidebarCollapsed:e}),fileListLeftSidebarCollapsed:!1,setFileListLeftSidebarCollapsed:(e)=>i({fileListLeftSidebarCollapsed:e}),fileListRightSidebarCollapsed:!0,setFileListRightSidebarCollapsed:(e)=>i({fileListRightSidebarCollapsed:e}),shareConfigLeftSidebarCollapsed:!1,setShareConfigLeftSidebarCollapsed:(e)=>i({shareConfigLeftSidebarCollapsed:e}),shareConfigRightSidebarCollapsed:!1,setShareConfigRightSidebarCollapsed:(e)=>i({shareConfigRightSidebarCollapsed:e}),viewModes:{},setViewMode:(e,d)=>i((s)=>({viewModes:{...s.viewModes,[e]:d}})),videoTimeDisplayMode:"standard",setVideoTimeDisplayMode:(e)=>i({videoTimeDisplayMode:e})}),{name:"ui-storage",storage:l(()=>localStorage)}));
2
+ export{p as Cg};