@runlith/tagma 0.1.0 → 0.2.3
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/host.d.ts +421 -421
- package/package.json +6 -1
- package/plugin/{Held-6krt6ncs.js → Held-cvetk2wg.js} +1 -1
- package/plugin/{accountKey-tdjj67f5.js → accountKey-t44g9avw.js} +1 -1
- package/plugin/anthropic-messages-svq0svwe.js +2 -0
- package/plugin/anthropic-q1xa9n0j.js +2 -0
- package/plugin/{auth-0w6kk39v.js → auth-cp8wnd0z.js} +1 -1
- package/plugin/authStatus-d6scztz5.js +2 -0
- package/plugin/bundling.d.ts +3 -3
- package/plugin/{callback-server-0wrzmjfx.js → callback-server-q2asby82.js} +1 -1
- package/plugin/{capabilities-n3vfpy41.js → capabilities-jfhf61dt.js} +1 -1
- package/plugin/cli.js +1 -1
- package/plugin/{cliStore-9rhjxtht.js → cliStore-5s0qerr7.js} +1 -1
- package/plugin/{connect-vrdsw05j.js → connect-d7ec6kfh.js} +1 -1
- package/plugin/credential-garn07qc.js +2 -0
- package/plugin/deepseek-sp4vxjqy.js +2 -0
- package/plugin/definition-0h3gqd2z.js +2 -0
- package/plugin/{deviceGrant-vgbscpr4.js → deviceGrant-axpyc7xr.js} +1 -1
- package/plugin/duplex-yexjcpv2.js +2 -0
- package/plugin/endpoint-0b9bsb4q.js +2 -0
- package/plugin/{errors-5t42p4q1.js → errors-kck87dpv.js} +1 -1
- package/plugin/{events-e8vv9hda.js → events-81m69vqz.js} +1 -1
- package/plugin/executor-avear8af.js +2 -0
- package/plugin/failure-ddv4456n.js +2 -0
- package/plugin/framing-jnd2zm0h.js +2 -0
- package/plugin/grant-85r3bbqn.js +2 -0
- package/plugin/{harness-nrh78w4d.js → harness-jm3fhnwg.js} +1 -1
- package/plugin/headers-w6p5sp18.js +2 -0
- package/plugin/{ids-n269hc5k.js → ids-2dndaq8y.js} +1 -1
- package/plugin/images-s2kqebfv.js +2 -0
- package/plugin/{index-cyd7v366.js → index-b3yp4szm.js} +1 -1
- package/plugin/{index-jpmjpmkn.js → index-xs7nfsck.js} +1 -1
- package/plugin/lifecycle-er51apxp.js +2 -0
- package/plugin/{messages-1szh3p3k.js → messages-gmwcg1pq.js} +1 -1
- package/plugin/{metadata-zm1v3ptf.js → metadata-gpazs3f5.js} +1 -1
- package/plugin/muse-g8bc58v8.js +2 -0
- package/plugin/notes-5m0m3pdr.js +2 -0
- package/plugin/{openai-37dne8v0.js → openai-6f50tf64.js} +1 -1
- package/plugin/openai-compatible-chat-eez8hkge.js +2 -0
- package/plugin/openai-images-haszbnft.js +2 -0
- package/plugin/{openai-0z6fy497.js → openai-mfqwg6pa.js} +1 -1
- package/plugin/openai-responses-1gpyp640.js +2 -0
- package/plugin/{opencodeGo-173fz5c5.js → opencodeGo-1wgdjtjz.js} +1 -1
- package/plugin/{options-pxwjpfdk.js → options-476akxaj.js} +1 -1
- package/plugin/{pkce-nrpept7w.js → pkce-y3sh5pk8.js} +1 -1
- package/plugin/{plugin-qpda63gv.js → plugin-0e34qaar.js} +1 -1
- package/plugin/{plugin-521srf94.js → plugin-1zkx860n.js} +1 -1
- package/plugin/{plugin-285exjxd.js → plugin-217mw9ck.js} +1 -1
- package/plugin/{plugin-a4ng6krf.js → plugin-24j9hnc7.js} +1 -1
- package/plugin/{plugin-pkxw1pfs.js → plugin-2s6bq45c.js} +1 -1
- package/plugin/{plugin-q1sqj2tc.js → plugin-3969dy0b.js} +1 -1
- package/plugin/{plugin-7y7ndrk9.js → plugin-3t0qp574.js} +1 -1
- package/plugin/{plugin-je5cfnqn.js → plugin-6vzw5yyr.js} +1 -1
- package/plugin/{plugin-sfdxgkds.js → plugin-7swap1ad.js} +1 -1
- package/plugin/{plugin-zz7yc97m.js → plugin-7te9b50h.js} +1 -1
- package/plugin/{plugin-1x94cj6e.js → plugin-7xmwhj5h.js} +1 -1
- package/plugin/{plugin-vv72e4ah.js → plugin-8g8myq9g.js} +1 -1
- package/plugin/{plugin-3whwpedj.js → plugin-8q44b578.js} +1 -1
- package/plugin/{plugin-v7k9fx92.js → plugin-8v4g0q0b.js} +1 -1
- package/plugin/{plugin-zphe2a5v.js → plugin-8x3c401q.js} +1 -1
- package/plugin/{plugin-zxe49p72.js → plugin-92sxs4r1.js} +1 -1
- package/plugin/{plugin-ff38dxy1.js → plugin-9zbh7788.js} +1 -1
- package/plugin/{plugin-nkb5bb2q.js → plugin-a3vzpk4e.js} +1 -1
- package/plugin/{plugin-g65b14k1.js → plugin-azkzdkpk.js} +1 -1
- package/plugin/{plugin-nqmb78ez.js → plugin-d28d8jar.js} +1 -1
- package/plugin/{plugin-zvyk8bnr.js → plugin-dd951075.js} +1 -1
- package/plugin/{plugin-zew2m18x.js → plugin-dqxdznvd.js} +1 -1
- package/plugin/plugin-dsjq4tye.js +3 -0
- package/plugin/{plugin-3pfrkxg1.js → plugin-e5ybk2a2.js} +1 -1
- package/plugin/{plugin-njh1f7b2.js → plugin-eksq91yp.js} +1 -1
- package/plugin/{plugin-yxgg03s0.js → plugin-er1kc6f6.js} +1 -1
- package/plugin/{plugin-60bdzk1r.js → plugin-fjsmz1vy.js} +1 -1
- package/plugin/{plugin-d6hbav22.js → plugin-fre9hdcg.js} +1 -1
- package/plugin/{plugin-jjm52353.js → plugin-g0zv4vrz.js} +1 -1
- package/plugin/{plugin-ay29ch70.js → plugin-g4hst0jz.js} +1 -1
- package/plugin/{plugin-zw3ywa4b.js → plugin-g7hrtg2p.js} +1 -1
- package/plugin/{plugin-kjtzm2q6.js → plugin-hkjxkgty.js} +1 -1
- package/plugin/{plugin-pfj9nc2e.js → plugin-p6x7emar.js} +1 -1
- package/plugin/{plugin-ba1sv0th.js → plugin-pdww1ma8.js} +1 -1
- package/plugin/{plugin-fhc5q7r3.js → plugin-psj9935q.js} +1 -1
- package/plugin/{plugin-frrvs5yc.js → plugin-q6pvb1xf.js} +1 -1
- package/plugin/{plugin-8230g28p.js → plugin-r342d8zf.js} +1 -1
- package/plugin/{plugin-q1n5kwx0.js → plugin-r7g3vqrm.js} +1 -1
- package/plugin/plugin-t4xrq5q2.js +3 -0
- package/plugin/{plugin-z6hkd9rw.js → plugin-tetj2cr3.js} +1 -1
- package/plugin/{plugin-h66k1zhn.js → plugin-v80m00bq.js} +1 -1
- package/plugin/{plugin-8jf7f360.js → plugin-vqrd05eg.js} +1 -1
- package/plugin/{plugin-e2y95zm5.js → plugin-w3zbkmy6.js} +1 -1
- package/plugin/{plugin-1n46me5n.js → plugin-y9cdpmbv.js} +1 -1
- package/plugin/{plugin-ca4vf4j5.js → plugin-yg0h5k5d.js} +1 -1
- package/plugin/{plugin-gkgs7vfv.js → plugin-yp736z4n.js} +1 -1
- package/plugin/{plugin-q7rk75bs.js → plugin-zrb8bbr4.js} +1 -1
- package/plugin/{plugin-1xze8f5y.js → plugin-zsv7wawc.js} +1 -1
- package/plugin/plugin.d.ts +1 -1
- package/plugin/process.js +1 -1
- package/plugin/protocol-8c26dk6v.js +2 -0
- package/plugin/{quota-vrrmfag6.js → quota-v63yvp13.js} +1 -1
- package/plugin/quotaRead-esmjycnd.js +2 -0
- package/plugin/reasoning-1saw6tds.js +2 -0
- package/plugin/responseFold-xxhqx4sa.js +2 -0
- package/plugin/{settings-vdypzert.js → settings-8xq8dvhp.js} +1 -1
- package/plugin/{shared-a2yyy8ry.js → shared-4jndfh28.js} +1 -1
- package/plugin/stepfun-xp1c5wpk.js +2 -0
- package/plugin/stream-8yrr289z.js +2 -0
- package/plugin/{synthesisDuplex-m2j6pmyv.js → synthesisDuplex-ch9jhqzt.js} +1 -1
- package/plugin/template.js +1 -1
- package/plugin/testing.js +1 -1
- package/plugin/tool-content-vean6rqa.js +2 -0
- package/plugin/tool-stream-fb180jmt.js +2 -0
- package/plugin/transport-j784dsdr.js +2 -0
- package/plugin/ui.generated.d.ts +2 -5
- package/plugin/vendorCall-82evk8b3.js +2 -0
- package/plugin/{vendorPayload-awxqr7t8.js → vendorPayload-458354fv.js} +1 -1
- package/plugin/vendorWeb-cz5t01m7.js +2 -0
- package/plugin/verbatim-2f2d9n02.js +2 -0
- package/plugin/xai-2cqraa99.js +2 -0
- package/plugin/anthropic-messages-7gtja121.js +0 -2
- package/plugin/anthropic-z9xqmm3q.js +0 -2
- package/plugin/authStatus-a1g3eb9p.js +0 -2
- package/plugin/credential-5sgapkh0.js +0 -2
- package/plugin/deepseek-v388d1wv.js +0 -2
- package/plugin/definition-s3xx207f.js +0 -2
- package/plugin/duplex-kpmftvf7.js +0 -2
- package/plugin/endpoint-kvf97tz7.js +0 -2
- package/plugin/executor-q8kp5q8h.js +0 -2
- package/plugin/failure-vr32debc.js +0 -2
- package/plugin/framing-nktw5sts.js +0 -2
- package/plugin/grant-67b10nhx.js +0 -2
- package/plugin/headers-ss3dzznj.js +0 -2
- package/plugin/images-q80x3bt1.js +0 -2
- package/plugin/lifecycle-qf4fh5m8.js +0 -2
- package/plugin/muse-r16jp51z.js +0 -2
- package/plugin/notes-6amdhm6h.js +0 -2
- package/plugin/openai-compatible-chat-tq9w69h4.js +0 -2
- package/plugin/openai-images-x1sj79qh.js +0 -2
- package/plugin/openai-responses-dka6k753.js +0 -2
- package/plugin/plugin-92redty0.js +0 -3
- package/plugin/plugin-ff9hx5a4.js +0 -3
- package/plugin/protocol-hwnfh4h1.js +0 -2
- package/plugin/quotaRead-vj6e90xc.js +0 -2
- package/plugin/reasoning-5nanktp2.js +0 -2
- package/plugin/responseFold-w4526gvb.js +0 -2
- package/plugin/stepfun-bwsz4nrd.js +0 -2
- package/plugin/stream-bt8etfpc.js +0 -2
- package/plugin/tool-content-b9jtprr7.js +0 -2
- package/plugin/tool-stream-gdajdxn0.js +0 -2
- package/plugin/transport-7hfp9sn4.js +0 -2
- package/plugin/vendorCall-hv01nwsp.js +0 -2
- package/plugin/vendorWeb-vnf344r1.js +0 -2
- package/plugin/verbatim-mqt9x4aa.js +0 -2
- package/plugin/xai-z1ysta23.js +0 -2
- /package/plugin/{plugin-6xpcmvm3.js → plugin-xfcgt5ba.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./plugin-h66k1zhn.js";import"./plugin-nqmb78ez.js";import{N}from"./plugin-me00x60n.js";import"./plugin-frrvs5yc.js";import"./plugin-zz7yc97m.js";import{Pt}from"./plugin-je5cfnqn.js";import{rn,Zl,de}from"./plugin-7y7ndrk9.js";import{Cf,Co}from"./plugin-ay29ch70.js";import"./plugin-3whwpedj.js";import"./plugin-72xxqm1t.js";import{Ia}from"./plugin-1n46me5n.js";import"./plugin-nkb5bb2q.js";import"./plugin-gkgs7vfv.js";import{pc,Ps,ls}from"./plugin-zw3ywa4b.js";import"./plugin-a4ng6krf.js";import"./plugin-q1n5kwx0.js";import"./plugin-pfj9nc2e.js";import"./plugin-e2y95zm5.js";import"./plugin-krbbb4ts.js";import{Io}from"./plugin-3pfrkxg1.js";import"./plugin-60bdzk1r.js";import"./plugin-1x94cj6e.js";import"./plugin-ba1sv0th.js";import"./plugin-sfdxgkds.js";import"./plugin-fhc5q7r3.js";import{Rs,Fg,as}from"./plugin-q7rk75bs.js";import"./plugin-1xze8f5y.js";import"./plugin-pkxw1pfs.js";import"./plugin-ff9hx5a4.js";import"./plugin-9gha9fx3.js";import{rf,ac,lm,of,zg}from"./plugin-q1sqj2tc.js";import{pu}from"./plugin-jxvmq18y.js";import{tf}from"./plugin-ff38dxy1.js";import{Dg}from"./plugin-zxe49p72.js";import{Lg}from"./plugin-285exjxd.js";import{Hn,mm,hf}from"./plugin-zvyk8bnr.js";import{Is,Al}from"./plugin-d6hbav22.js";import{Yn}from"./plugin-jjm52353.js";import"./plugin-kc4z9msd.js";import{rl,wh,aa,Es,ei,r,d,y,f,c,s,i,kn,at,Wc,Vc,ee,po,pt,ew,WS,n,ce,t,S,o,ge,x,gt,ye,Kn}from"./plugin-6xpcmvm3.js";import{arch as oe,platform as ie,release as se}from"os";var ae=`${ie()} ${se()}; ${oe()}`;function T(e){return`${e.client.name}/${e.client.version} (${ae})`}function U(e,a){return{originator:e.client.name,"User-Agent":T(e),"session-id":a}}var ue=new TextEncoder,W=new TextDecoder,H=(e,a)=>a<e.length&&((e[a]??0)&192)===128,le=(e,a)=>{let u=Math.min(a,e.length);while(u>0&&H(e,u))u-=1;return u},pe=(e,a)=>{let u=Math.max(a,0);while(u<e.length&&H(e,u))u+=1;return u},Q=(e)=>Math.ceil(e/4),me=(e,a)=>{let u=a*4,l=Math.floor(u/2),p=e.subarray(0,le(e,l)),m=e.subarray(pe(e,e.length-(u-l)));return`${W.decode(p)}\u2026${Q(e.length-u)} tokens truncated\u2026${W.decode(m)}`},v=(e)=>e.content.flatMap((a)=>a.type==="text"&&a.deferredTools===void 0?[a.text]:[]),D=(e)=>e.role==="user"&&v(e).length>0,F=(e)=>{let a=e.findLastIndex(D);if(a<0)return[];let u=e.findLastIndex((p,m)=>m<a&&D(p)),l=1000;return e.slice(u<0?a:u,a+1).flatMap((p)=>{if(p.role==="user"){let h=v(p);return h.length===0?[]:[{type:"message",role:"user",content:h.map((w)=>({type:"input_text",text:w}))}]}if(p.role!=="assistant")return[];let m=v(p).flatMap((h)=>{if(l===0)return[];let w=ue.encode(h),g=Q(w.length);if(g<=l)return l-=g,[{type:"output_text",text:h}];let b=me(w,l);return l=0,[{type:"output_text",text:b}]});return m.length===0?[]:[{type:"message",role:"assistant",content:m}]})};var he=new Set(["search_query","image_query","finance","weather","sports","time","response_length"]),we=["search_query","image_query"],be=["open","click","find","screenshot"],_e=o({output:t}),xe=pt(Kn(_e)),Ie=(e)=>!N(e)||Object.keys(e).some((a)=>!he.has(a)),G=(e,a,u)=>N(e)?a.flatMap((l)=>{let p=e[l];return Array.isArray(p)?p.flatMap((m)=>N(m)&&typeof m[u]==="string"?[m[u]]:[]):[]}):[],Ae=(e)=>URL.canParse(e)&&/^https?:$/.test(new URL(e).protocol),ke=(e)=>({queries:G(e,we,"q"),pages:[...new Set(G(e,be,"ref_id").filter(Ae))]}),Se=(e)=>Array.isArray(e)?"array":e===null?"null":Number.isInteger(e)?"integer":typeof e,P=(e,a,u)=>{if(!N(e))return;let l=e.type,p=Se(a);if(typeof l==="string"&&l!==p&&!(l==="number"&&p==="integer"))return`${u} must be ${l}, not ${p}`;if(Array.isArray(e.enum)&&!e.enum.includes(a))return`${u} must be one of ${e.enum.join(", ")}`;if(Array.isArray(a)){for(let[g,b]of a.entries()){let _=P(e.items,b,`${u}[${g}]`);if(_!==void 0)return _}return}if(!N(a))return;let h=(Array.isArray(e.required)?e.required:[]).find((g)=>typeof g==="string"&&!(g in a));if(h!==void 0)return`${u}.${h} is required`;let w=N(e.properties)?e.properties:{};for(let[g,b]of Object.entries(a)){let _=P(w[g],b,`${u}.${g}`);if(_!==void 0)return _}return},Te=(e)=>ge(t,ce).check(ye((a)=>P(e.parameters,a,"input")??!0)),ve=(e)=>e.text.pipe(s(xe),at((a)=>new tf({reason:`The search answer could not be read: ${a.message}`})),s(({output:a})=>a.trim()===""?c(new tf({reason:"The search answered with no output."})):r(a))),Pe=ee("codexWeb.search")(function*(e,a,u,l){let p=yield*Io,m=F(l.messages),h=JSON.stringify({id:yield*a.session,model:a.model,input:m.length===0?void 0:m,commands:u,settings:e.settings,max_output_tokens:e.maxOutputTokens}),w=f(function*(){let b=yield*Co(a.auth)({method:"POST",url:a.url,body:h,headers:Pt({"Content-Type":"application/json",Accept:"application/json"})});return yield*Vc((_)=>s(p.execute(Ia({url:a.url,body:h,headers:b}),_),ve))}),g=rl(1).pipe(aa(({input:b})=>r(b._tag==="LLM.Error"&&b.status===401&&a.recover!==void 0)),wh(()=>a.recover??y));return yield*Wc(w,g)}),B=(e)=>{let a={vendor:{name:e.name,namespace:e.namespace},description:e.description,inputSchema:e.parameters},u=Te(e);return(l)=>({tools:{websearch:{wire:a,input:u,reads:Ie,targets:ke,run:(m,h)=>Pe(e,l,m,h)}}})};var I={client:"codex-cli 0.162.0",models:["gpt-6.1-sol","gpt-6-astra","gpt-6-sol","gpt-6-luna","gpt-reserve","gpt-5.6-sol","gpt-5.6-terra","gpt-5.6-luna","codex-auto-review"],path:"/alpha/search",namespace:{name:"web",description:"Tools in the web namespace."},name:"run",description:'Tool for accessing the internet.\n\n\n---\n\n## Examples of different commands available in this tool\n\nExamples of different commands available in this tool:\n* `search_query`: {"search_query": [{"q": "What is the capital of France?"}, {"q": "What is the capital of belgium?"}]}. Searches the internet for a given query (and optionally with a domain or recency filter)\n* `image_query`: {"image_query":[{"q": "waterfalls"}]}.\n* `open`: {"open": [{"ref_id": "turn0search0"}, {"ref_id": "https://www.openai.com", "lineno": 120}]}\n* `click`: {"click": [{"ref_id": "turn0fetch3", "id": 17}]}\n* `find`: {"find": [{"ref_id": "turn0fetch3", "pattern": "Annie Case"}]}\n* `screenshot`: {"screenshot": [{"ref_id": "turn1view0", "pageno": 0}, {"ref_id": "turn1view0", "pageno": 3}]}\n* `finance`: {"finance":[{"ticker":"AMD","type":"equity","market":"USA"}]}, {"finance":[{"ticker":"BTC","type":"crypto","market":""}]}\n* `weather`: {"weather":[{"location":"San Francisco, CA"}]}\n* `sports`: {"sports":[{"fn":"standings","league":"nfl"}, {"fn":"schedule","league":"nba","team":"GSW","date_from":"2025-02-24"}]}\n* `time`: {"time":[{"utc_offset":"+03:00"}]}\n\n---\n\n## Usage hints\nTo use this tool efficiently:\n* Use multiple commands and queries in one call to get more results faster; e.g. {"search_query": [{"q": "bitcoin news"}], "finance":[{"ticker":"BTC","type":"crypto","market":""}], "find": [{"ref_id": "turn0search0", "pattern": "Annie Case"}, {"ref_id": "turn0search1", "pattern": "John Smith"}]}\n* Use "response_length" to control the number of results returned by this tool, omit it if you intend to pass "short" in\n* Only write required parameters; do not write empty lists or nulls where they could be omitted.\n* `search_query` must have length at most 4 in each call. If it has length > 3, response_length must be medium or long\n* If you find yourself in a situation where you accidentally call the `web.run` tool, it\'s best just to send an empty query: {"search_query": [{"q": ""}]}.\n\n---\n\n## Decision boundary\n\nIf the user makes an explicit request to search the internet, find latest information, look up, etc (or to not do so), you must obey their request.\nWhen you make an assumption, always consider whether it is temporally stable; i.e. whether there\'s even a small (>10%) chance it has changed. If it is unstable, you must verify with browsing the internet for verification.\n\n<situations_where_you_must_browse_the_internet>\nBelow is a list of scenarios where browsing the internet MUST be used. PAY CLOSE ATTENTION: you MUST browse the internet in these cases. If you\'re unsure or on the fence, you MUST bias towards browsing the internet.\n- The information could have changed recently: for example news; prices; laws; schedules; product specs; sports scores; economic indicators; political/public/company figures (e.g. the question relates to \'the president of country A\' or \'the CEO of company B\', which might change over time); rules; regulations; standards; software libraries that could be updated; exchange rates; recommendations (i.e., recommendations about various topics or things might be informed by what currently exists / is popular / is safe / is unsafe / is in the zeitgeist / etc.); and many many many more categories -- again, if you\'re on the fence, you MUST browse the internet!\n - For news queries, prioritize more recent events, ensuring you compare publish dates and the date that the event happened.\n- The user is seeking recommendations that could lead them to spend substantial time or money -- researching products, restaurants, travel plans, etc.\n- The user wants (or would benefit from) direct quotes, links, or precise source attribution.\n- A specific page, paper, dataset, PDF, or site is referenced and you haven\'t been given its contents.\n- You\'re unsure about a fact, the topic is niche or emerging, or you suspect there\'s at least a 10% chance you will incorrectly recall it\n- High-stakes accuracy matters (medical, legal, financial guidance). For these you generally should search by default because this information is highly temporally unstable\n- The user explicitly says to search, browse, verify, or look it up.\n</situations_where_you_must_browse_the_internet>\n\n---\n\n## Citations\n\nResults from `web.run` include internal reference IDs such as `turn2search5`. Use\nthose reference IDs only in calls to `web.run`; do not expose them in the final\nresponse.\n\nCite sources in the final response using Markdown links:\n\n- Cite a single source as `[descriptive source title](https://example.com/page)`.\n- Cite multiple sources with separate Markdown links, for example\n `[first source](https://example.com/one), [second source](https://example.com/two)`.\n- Link directly to the page that supports the claim. Do not link to search result\n pages or use bare URLs.\n\nFormatting of citations:\n\n- Place each citation as near as possible to the claim it supports, normally at\n the end of the sentence or paragraph and after punctuation.\n- Do not place citations inside code fences.\n- Do not put citations on a line by themselves or collect all citations at the\n end of the response.\n\nIf you browse the internet, cite statements supported by web sources. Each cited\nsource must directly support the associated claim. Prefer primary and\nauthoritative sources, and use sources from different domains when the response\nbenefits from multiple perspectives.\n\n---\n\n## Special cases\nIf these conflict with any other instructions, these should take precedence.\n\n<special_cases>\n- When the user asks for information about how to use OpenAI products, (ChatGPT, the OpenAI API, etc.), you should check the code in local env and only browse as fallback, when you browse restrict your sources to official OpenAI websites using the domains filter, unless otherwise requested.\n- When using search to answer technical questions, you must only rely on primary sources (research papers, official documentation, etc.)\n- Clearly indicate when you are making an inference from sources.\n</special_cases>\n\n---\n\n## Word limits\nResponses may not excessively quote or draw on a specific source. There are several limits here:\n- **Limit on verbatim quotes:**\n - You may not quote more than 25 words verbatim from any single non-lyrical source, unless the source is reddit.\n - For song lyrics, verbatim quotes must be limited to at most 10 words.\n - Long quotes from reddit are allowed, as long as you indicate that those are direct quotes via a markdown blockquote starting with ">", copy verbatim, and link the source.\n- **Word limits:**\n - Each webpage source in the sources has a word limit label formatted like "[wordlim N]", in which N is the maximum number of words in the whole response that are attributed to that source. If omitted, the word limit is 200 words.\n - Non-contiguous words derived from a given source must be counted to the word limit.\n - The summarization limit N is a maximum for each source.\n - When using multiple sources, their summarization limits add together. However, each article used must be relevant to the response.\n- **Copyright compliance:**\n - You must avoid providing full articles, long verbatim passages, or extensive direct quotes due to copyright concerns.\n - If the user asked for a verbatim quote, the response should provide a short compliant excerpt and then answer with paraphrases and summaries.\n - Again, this limit does not apply to reddit content, as long as it\'s appropriately indicated that those are direct quotes and you link to the source.\n',parameters:{type:"object",properties:{click:{type:"array",description:"Open links from previously opened pages.",items:{type:"object",properties:{id:{type:"integer",description:"Numbered link id to open."},ref_id:{type:"string",description:"Reference id containing the numbered link."}},required:["id","ref_id"]}},finance:{type:"array",description:"Look up prices for the given stock symbols.",items:{type:"object",properties:{market:{type:"string",description:'ISO 3166-1 alpha-3 country code, "OTC", or "" for cryptocurrency.'},ticker:{type:"string",description:"Ticker symbol to look up."},type:{type:"string",description:"Asset type to look up.",enum:["equity","fund","crypto","index"]}},required:["ticker","type"]}},find:{type:"array",description:"Find text patterns in pages.",items:{type:"object",properties:{pattern:{type:"string",description:"Text pattern to find."},ref_id:{type:"string",description:"Reference id or URL to search within."}},required:["pattern","ref_id"]}},image_query:{type:"array",description:"Query the image search engine for a given list of queries.",items:{type:"object",properties:{domains:{type:"array",description:"Whether to filter by a specific list of domains.",items:{type:"string"}},q:{type:"string",description:"Search query."},recency:{type:"integer",description:"Whether to filter by recency, as a number of recent days."}},required:["q"]}},open:{type:"array",description:"Open pages by reference id or URL.",items:{type:"object",properties:{lineno:{type:"integer",description:"Line number to position the page at."},ref_id:{type:"string",description:"Reference id or URL to open."}},required:["ref_id"]}},response_length:{type:"string",description:"Set the length of the response to be returned.",enum:["short","medium","long"]},screenshot:{type:"array",description:"Take screenshots of PDF pages.",items:{type:"object",properties:{pageno:{type:"integer",description:"Zero-indexed PDF page number."},ref_id:{type:"string",description:"Reference id or URL to screenshot."}},required:["pageno","ref_id"]}},search_query:{type:"array",description:"Query the internet search engine for a given list of queries.",items:{type:"object",properties:{domains:{type:"array",description:"Whether to filter by a specific list of domains.",items:{type:"string"}},q:{type:"string",description:"Search query."},recency:{type:"integer",description:"Whether to filter by recency, as a number of recent days."}},required:["q"]}},sports:{type:"array",description:"Look up sports schedules and standings.",items:{type:"object",properties:{date_from:{type:"string",description:"Start date in YYYY-MM-DD format."},date_to:{type:"string",description:"End date in YYYY-MM-DD format."},fn:{type:"string",description:"Sports function to call.",enum:["schedule","standings"]},league:{type:"string",description:"League to look up.",enum:["nba","wnba","nfl","nhl","mlb","epl","ncaamb","ncaawb","ipl"]},locale:{type:"string",description:"Locale for the lookup."},num_games:{type:"integer",description:"Number of games to return."},opponent:{type:"string",description:"Opponent to use with `team` when narrowing the lookup."},team:{type:"string",description:"Team to look up, using the common 3 or 4 letter alias used in broadcasts."},tool:{type:"string",description:"Tool name for sports requests.",enum:["sports"]}},required:["fn","league"]}},time:{type:"array",description:"Get time for the given UTC offsets.",items:{type:"object",properties:{utc_offset:{type:"string",description:'UTC offset formatted like "+03:00".'}},required:["utc_offset"]}},weather:{type:"array",description:"Look up weather forecasts.",items:{type:"object",properties:{duration:{type:"integer",description:"Number of days to return. Defaults to 7."},location:{type:"string",description:'Location in "Country, Area, City" format.'},start:{type:"string",description:"Start date in YYYY-MM-DD format. Defaults to today."}},required:["location"]}}}},settings:{allowed_callers:["direct"],external_web_access:!0},maxOutputTokens:1e4};var Ee=o({error:o({resets_at:n(S)})}),qe=ew(Kn(Ee)),Re=(e)=>{let a=e.http?.body,u=a===void 0?void 0:qe(a);if(u!==void 0&&u._tag==="Some"&&u.value.error.resets_at!==void 0)return u.value.error.resets_at;let l=Number(e.http?.response?.headers["x-codex-primary-reset-at"]);return Number.isFinite(l)&&l>0?l:void 0},Me=(e)=>{if(e.reason._tag!=="QuotaExceeded"||e.reason.resetsAt!==void 0)return e;let a=Re(e.reason);return a===void 0?e:new de({...e,reason:new Zl({...e.reason,resetsAt:a})})},V=(e)=>ee("codexImages.generate")(function*(a,u,l){yield*Lg(a,l);let p=yield*Dg({baseURL:u.baseURL,auth:u.auth,recover:u.recover,fields:e.fields},l);return{images:p.images,requestId:p.requestId,headers:p.headers}},(a)=>at(a,Me));var K={client:"codex-cli 0.162.0",model:"gpt-image-2",fields:{quality:"auto",size:"auto"}};var q="https://chatgpt.com/backend-api/codex",R=32000,Ce="https://chatgpt.com/backend-api/wham/usage",z=o({used_percent:S,limit_window_seconds:n(S),reset_at:n(S)}),J=o({primary_window:n(gt(z)),secondary_window:n(gt(z))}),Oe=o({plan_type:t,rate_limit:J,additional_rate_limits:n(gt(x(o({limit_name:t,rate_limit:n(gt(J))})))),rate_limit_reset_credits:n(gt(o({available_count:S})))}),M=(e,a)=>{let u=e[a];return u===void 0||u.trim()===""?void 0:u.trim()},E=(e,a)=>{let u=M(e,a);if(u===void 0)return null;let l=Number(u);return Number.isFinite(l)?l:null},X=(e)=>e.toLowerCase().replace(/[^a-z0-9]/g,"").includes("codexspark"),Le=10080,Ue=40320,We=(e,a)=>{if(e==="bucket")return"bucket";if(a===void 0)return e==="primary"?"session":"weekly";if(a>=Ue)return"monthly";return a>=Le?"weekly":"session"},Z=(e,a,u)=>a.windowMinutes===0?null:new pc({kind:We(e,a.windowMinutes),label:u,usedPercent:a.usedPercent,windowMinutes:a.windowMinutes,resetsAt:a.resetsAt}),A=(e,a,u,l)=>{let p=E(e,`${a}-used-percent`);if(p===null)return null;return Z(u,{usedPercent:p,windowMinutes:E(e,`${a}-window-minutes`)??void 0,resetsAt:E(e,`${a}-reset-at`)??void 0},l)},C=(e,a)=>{let u=[],l=A(e,"x-codex-primary","primary"),p=A(e,"x-codex-secondary","secondary");if(l!==null)u.push(l);if(p!==null)u.push(p);for(let m of Object.keys(e)){let h=/^x-(.+)-primary-used-percent$/.exec(m);if(h===null||h[1]==="codex")continue;let w=h[1],g=w.trim().toLowerCase().replaceAll("-","_"),b=`x-${w}-primary`,_=M(e,`x-${w}-limit-name`)??g;if(X(_))continue;let L=A(e,b,"bucket",_);if(L!==null)u.push(L)}if(u.length===0)return null;return new Ps({observedAt:a,source:"reply",windows:u})},Ne=(e,a,u)=>Z(a,{usedPercent:Math.min(100,Math.max(0,e.used_percent)),windowMinutes:e.limit_window_seconds===void 0?void 0:e.limit_window_seconds/60,resetsAt:e.reset_at},u),$e=(e,a)=>pt(Oe)(e).pipe(at((u)=>new ls({message:`The OpenAI usage answer did not match its schema: ${u.message}`})),s((u)=>{let l=[],p=(m,h,w)=>{let g=m===void 0||m===null?null:Ne(m,h,w);if(g!==null)l.push(g)};p(u.rate_limit.primary_window,"primary"),p(u.rate_limit.secondary_window,"secondary");for(let m of u.additional_rate_limits??[]){if(X(m.limit_name))continue;p(m.rate_limit?.primary_window,"bucket",m.limit_name)}return l.length===0?c(new ls({message:"The OpenAI usage answer carried no quota windows."})):r(new Ps({observedAt:a,source:"usage",windows:l,plan:u.plan_type,resetCredits:u.rate_limit_reset_credits?.available_count}))})),De=(e)=>({fromHeaders:C,read:(a,u,l)=>Al({url:Ce,auth:Xe({credentials:a,ownerId:u,account:l},e),headers:{Accept:"application/json"}}).pipe(s((p)=>$e(p.body,p.observedAt)))}),te={fromHeaders:C,read:Is};function ne(e){let a=Yn(e.rung);return Rs({store:!1,reasoningEffort:a,reasoningSummary:a!==void 0&&e.reasoningOutput?"auto":void 0,promptCacheKey:e.cacheGroup,parallelToolCalls:e.parallelToolCalls,serviceTier:e.switches.serviceTier==="priority"?"priority":void 0})}var He={output:{budget:R,sent:!0},model:(e)=>r(ze(e)),options:ne},k=({credentials:e,ownerId:a,account:u})=>{let l=e.recoverAccessToken;return{recover:l===void 0?void 0:hf("OpenAI credential recovery",()=>l.call(e,a,ac,u)).pipe(kn)}},Qe=B(I),Fe=(e,a)=>{if(!I.models.includes(e.model))return;return d(()=>{let u={...e,cacheGroup:e.cacheGroup||void 0};return Qe({url:`${q}${I.path}`,auth:O(u,a),recover:k(u).recover,session:ei(()=>pu(u.cacheGroup)),model:u.model})})},Ge="images",je=(e,a)=>{if(M(e,"x-codex-active-limit")===void 0)return null;let u=A(e,"x-codex-primary","bucket",Ge);return u===null?null:new Ps({observedAt:a,source:"reply",windows:[u]})},Ye=V(K),Be=(e)=>({generate:(a,u)=>{let l=of.imageModels?.[u.model];if(l===void 0)return c(Ve(u.model));return Ye(l,{baseURL:q,auth:O(a,e),recover:k(a).recover},u)},quota:je}),Ve=(e)=>new de({module:"Images",method:"generate",reason:new rn({message:`${e} is not an image model ChatGPT serves.`})}),Ke=(e)=>({web:(a)=>Fe(a,e),retry:k,output:{budget:R,sent:!1},model:(a)=>r(et(a,e)),options:ne});function ze(e){return as.with({provider:rf,quota:te.fromHeaders,limits:{output:R},auth:Hn(e.credentials,e.ownerId,rf,e.account).bearer()}).model({id:e.model})}var Je=WS(zg);async function re(e){return(await Je(await e.credentials.credential(e.ownerId,ac,e.account))).accountId}function O(e,a){return mm(e.credentials,e.ownerId,ac,e.account).bearer().andThen(Cf((u)=>Es({accountId:hf("ChatGPT account id",()=>re(e)),sessionId:ei(()=>pu(e.cacheGroup))}).pipe(i(({accountId:l,sessionId:p})=>po(u.headers,{...U(a,p),...l?{"ChatGPT-Account-Id":l}:{}})))))}function Xe(e,a){return mm(e.credentials,e.ownerId,ac,e.account).bearer().andThen(Cf((u)=>hf("ChatGPT account id",()=>re(e)).pipe(i((l)=>po(u.headers,{"User-Agent":T(a),...l?{"ChatGPT-Account-Id":l}:{}})))))}function Ze(e){return Cf((a)=>{let u=a.request?Fg(a.request):void 0,l=`model=${e}${u?`;tier=${u}`:""}`;return r(po(a.headers,{"x-codex-routing-hint":l}))})}function et(e,a){return as.with({provider:ac,quota:C,endpoint:{baseURL:q},auth:O(e,a).andThen(Ze(e.model)),retry:k(e)}).model({id:e.model})}var tt={...lm,profile:He,quota:te},nt=(e)=>({...of,profile:Ke(e),quota:De(e),images:Be(e)}),Qt=(e)=>[nt(e),tt];export{q as OPENAI_CHATGPT_BASE_URL,R as OPENAI_OUTPUT_RESERVATION,O as chatgptIdentity,tt as openaiConsoleRegistration,De as openaiQuota,Qt as openaiRegistrations,nt as openaiSubscriptionRegistration};
|
|
2
|
+
import"./plugin-v80m00bq.js";import"./plugin-d28d8jar.js";import{N}from"./plugin-me00x60n.js";import"./plugin-q6pvb1xf.js";import"./plugin-7te9b50h.js";import{Pt}from"./plugin-6vzw5yyr.js";import{rn,Zl,de}from"./plugin-3t0qp574.js";import{Cf,Co}from"./plugin-g4hst0jz.js";import"./plugin-8q44b578.js";import"./plugin-72xxqm1t.js";import{Ia}from"./plugin-y9cdpmbv.js";import"./plugin-a3vzpk4e.js";import"./plugin-yp736z4n.js";import{pc,Ps,ls}from"./plugin-g7hrtg2p.js";import"./plugin-24j9hnc7.js";import"./plugin-r7g3vqrm.js";import"./plugin-p6x7emar.js";import"./plugin-w3zbkmy6.js";import"./plugin-krbbb4ts.js";import{Io}from"./plugin-e5ybk2a2.js";import"./plugin-fjsmz1vy.js";import"./plugin-7xmwhj5h.js";import"./plugin-pdww1ma8.js";import"./plugin-7swap1ad.js";import"./plugin-psj9935q.js";import{Rs,Fg,as}from"./plugin-zrb8bbr4.js";import"./plugin-zsv7wawc.js";import"./plugin-2s6bq45c.js";import"./plugin-dsjq4tye.js";import"./plugin-9gha9fx3.js";import{rf,ac,lm,of,zg}from"./plugin-3969dy0b.js";import{pu}from"./plugin-jxvmq18y.js";import{tf}from"./plugin-9zbh7788.js";import{Dg}from"./plugin-92sxs4r1.js";import{Lg}from"./plugin-217mw9ck.js";import{Hn,mm,hf}from"./plugin-dd951075.js";import{Is,Al}from"./plugin-fre9hdcg.js";import{Yn}from"./plugin-g0zv4vrz.js";import"./plugin-kc4z9msd.js";import{rl,wh,aa,Es,ei,r,d,y,f,c,s,i,kn,at,Wc,Vc,ee,po,pt,ew,WS,n,ce,t,S,o,ge,x,gt,ye,Kn}from"./plugin-xfcgt5ba.js";import{arch as oe,platform as ie,release as se}from"os";var ae=`${ie()} ${se()}; ${oe()}`;function T(e){return`${e.client.name}/${e.client.version} (${ae})`}function U(e,a){return{originator:e.client.name,"User-Agent":T(e),"session-id":a}}var ue=new TextEncoder,W=new TextDecoder,H=(e,a)=>a<e.length&&((e[a]??0)&192)===128,le=(e,a)=>{let u=Math.min(a,e.length);while(u>0&&H(e,u))u-=1;return u},pe=(e,a)=>{let u=Math.max(a,0);while(u<e.length&&H(e,u))u+=1;return u},Q=(e)=>Math.ceil(e/4),me=(e,a)=>{let u=a*4,l=Math.floor(u/2),p=e.subarray(0,le(e,l)),m=e.subarray(pe(e,e.length-(u-l)));return`${W.decode(p)}\u2026${Q(e.length-u)} tokens truncated\u2026${W.decode(m)}`},v=(e)=>e.content.flatMap((a)=>a.type==="text"&&a.deferredTools===void 0?[a.text]:[]),D=(e)=>e.role==="user"&&v(e).length>0,F=(e)=>{let a=e.findLastIndex(D);if(a<0)return[];let u=e.findLastIndex((p,m)=>m<a&&D(p)),l=1000;return e.slice(u<0?a:u,a+1).flatMap((p)=>{if(p.role==="user"){let h=v(p);return h.length===0?[]:[{type:"message",role:"user",content:h.map((w)=>({type:"input_text",text:w}))}]}if(p.role!=="assistant")return[];let m=v(p).flatMap((h)=>{if(l===0)return[];let w=ue.encode(h),g=Q(w.length);if(g<=l)return l-=g,[{type:"output_text",text:h}];let b=me(w,l);return l=0,[{type:"output_text",text:b}]});return m.length===0?[]:[{type:"message",role:"assistant",content:m}]})};var he=new Set(["search_query","image_query","finance","weather","sports","time","response_length"]),we=["search_query","image_query"],be=["open","click","find","screenshot"],_e=o({output:t}),xe=pt(Kn(_e)),Ie=(e)=>!N(e)||Object.keys(e).some((a)=>!he.has(a)),G=(e,a,u)=>N(e)?a.flatMap((l)=>{let p=e[l];return Array.isArray(p)?p.flatMap((m)=>N(m)&&typeof m[u]==="string"?[m[u]]:[]):[]}):[],Ae=(e)=>URL.canParse(e)&&/^https?:$/.test(new URL(e).protocol),ke=(e)=>({queries:G(e,we,"q"),pages:[...new Set(G(e,be,"ref_id").filter(Ae))]}),Se=(e)=>Array.isArray(e)?"array":e===null?"null":Number.isInteger(e)?"integer":typeof e,P=(e,a,u)=>{if(!N(e))return;let l=e.type,p=Se(a);if(typeof l==="string"&&l!==p&&!(l==="number"&&p==="integer"))return`${u} must be ${l}, not ${p}`;if(Array.isArray(e.enum)&&!e.enum.includes(a))return`${u} must be one of ${e.enum.join(", ")}`;if(Array.isArray(a)){for(let[g,b]of a.entries()){let _=P(e.items,b,`${u}[${g}]`);if(_!==void 0)return _}return}if(!N(a))return;let h=(Array.isArray(e.required)?e.required:[]).find((g)=>typeof g==="string"&&!(g in a));if(h!==void 0)return`${u}.${h} is required`;let w=N(e.properties)?e.properties:{};for(let[g,b]of Object.entries(a)){let _=P(w[g],b,`${u}.${g}`);if(_!==void 0)return _}return},Te=(e)=>ge(t,ce).check(ye((a)=>P(e.parameters,a,"input")??!0)),ve=(e)=>e.text.pipe(s(xe),at((a)=>new tf({reason:`The search answer could not be read: ${a.message}`})),s(({output:a})=>a.trim()===""?c(new tf({reason:"The search answered with no output."})):r(a))),Pe=ee("codexWeb.search")(function*(e,a,u,l){let p=yield*Io,m=F(l.messages),h=JSON.stringify({id:yield*a.session,model:a.model,input:m.length===0?void 0:m,commands:u,settings:e.settings,max_output_tokens:e.maxOutputTokens}),w=f(function*(){let b=yield*Co(a.auth)({method:"POST",url:a.url,body:h,headers:Pt({"Content-Type":"application/json",Accept:"application/json"})});return yield*Vc((_)=>s(p.execute(Ia({url:a.url,body:h,headers:b}),_),ve))}),g=rl(1).pipe(aa(({input:b})=>r(b._tag==="LLM.Error"&&b.status===401&&a.recover!==void 0)),wh(()=>a.recover??y));return yield*Wc(w,g)}),B=(e)=>{let a={vendor:{name:e.name,namespace:e.namespace},description:e.description,inputSchema:e.parameters},u=Te(e);return(l)=>({tools:{websearch:{wire:a,input:u,reads:Ie,targets:ke,run:(m,h)=>Pe(e,l,m,h)}}})};var I={client:"codex-cli 0.162.0",models:["gpt-6.1-sol","gpt-6-astra","gpt-6-sol","gpt-6-luna","gpt-reserve","gpt-5.6-sol","gpt-5.6-terra","gpt-5.6-luna","codex-auto-review"],path:"/alpha/search",namespace:{name:"web",description:"Tools in the web namespace."},name:"run",description:'Tool for accessing the internet.\n\n\n---\n\n## Examples of different commands available in this tool\n\nExamples of different commands available in this tool:\n* `search_query`: {"search_query": [{"q": "What is the capital of France?"}, {"q": "What is the capital of belgium?"}]}. Searches the internet for a given query (and optionally with a domain or recency filter)\n* `image_query`: {"image_query":[{"q": "waterfalls"}]}.\n* `open`: {"open": [{"ref_id": "turn0search0"}, {"ref_id": "https://www.openai.com", "lineno": 120}]}\n* `click`: {"click": [{"ref_id": "turn0fetch3", "id": 17}]}\n* `find`: {"find": [{"ref_id": "turn0fetch3", "pattern": "Annie Case"}]}\n* `screenshot`: {"screenshot": [{"ref_id": "turn1view0", "pageno": 0}, {"ref_id": "turn1view0", "pageno": 3}]}\n* `finance`: {"finance":[{"ticker":"AMD","type":"equity","market":"USA"}]}, {"finance":[{"ticker":"BTC","type":"crypto","market":""}]}\n* `weather`: {"weather":[{"location":"San Francisco, CA"}]}\n* `sports`: {"sports":[{"fn":"standings","league":"nfl"}, {"fn":"schedule","league":"nba","team":"GSW","date_from":"2025-02-24"}]}\n* `time`: {"time":[{"utc_offset":"+03:00"}]}\n\n---\n\n## Usage hints\nTo use this tool efficiently:\n* Use multiple commands and queries in one call to get more results faster; e.g. {"search_query": [{"q": "bitcoin news"}], "finance":[{"ticker":"BTC","type":"crypto","market":""}], "find": [{"ref_id": "turn0search0", "pattern": "Annie Case"}, {"ref_id": "turn0search1", "pattern": "John Smith"}]}\n* Use "response_length" to control the number of results returned by this tool, omit it if you intend to pass "short" in\n* Only write required parameters; do not write empty lists or nulls where they could be omitted.\n* `search_query` must have length at most 4 in each call. If it has length > 3, response_length must be medium or long\n* If you find yourself in a situation where you accidentally call the `web.run` tool, it\'s best just to send an empty query: {"search_query": [{"q": ""}]}.\n\n---\n\n## Decision boundary\n\nIf the user makes an explicit request to search the internet, find latest information, look up, etc (or to not do so), you must obey their request.\nWhen you make an assumption, always consider whether it is temporally stable; i.e. whether there\'s even a small (>10%) chance it has changed. If it is unstable, you must verify with browsing the internet for verification.\n\n<situations_where_you_must_browse_the_internet>\nBelow is a list of scenarios where browsing the internet MUST be used. PAY CLOSE ATTENTION: you MUST browse the internet in these cases. If you\'re unsure or on the fence, you MUST bias towards browsing the internet.\n- The information could have changed recently: for example news; prices; laws; schedules; product specs; sports scores; economic indicators; political/public/company figures (e.g. the question relates to \'the president of country A\' or \'the CEO of company B\', which might change over time); rules; regulations; standards; software libraries that could be updated; exchange rates; recommendations (i.e., recommendations about various topics or things might be informed by what currently exists / is popular / is safe / is unsafe / is in the zeitgeist / etc.); and many many many more categories -- again, if you\'re on the fence, you MUST browse the internet!\n - For news queries, prioritize more recent events, ensuring you compare publish dates and the date that the event happened.\n- The user is seeking recommendations that could lead them to spend substantial time or money -- researching products, restaurants, travel plans, etc.\n- The user wants (or would benefit from) direct quotes, links, or precise source attribution.\n- A specific page, paper, dataset, PDF, or site is referenced and you haven\'t been given its contents.\n- You\'re unsure about a fact, the topic is niche or emerging, or you suspect there\'s at least a 10% chance you will incorrectly recall it\n- High-stakes accuracy matters (medical, legal, financial guidance). For these you generally should search by default because this information is highly temporally unstable\n- The user explicitly says to search, browse, verify, or look it up.\n</situations_where_you_must_browse_the_internet>\n\n---\n\n## Citations\n\nResults from `web.run` include internal reference IDs such as `turn2search5`. Use\nthose reference IDs only in calls to `web.run`; do not expose them in the final\nresponse.\n\nCite sources in the final response using Markdown links:\n\n- Cite a single source as `[descriptive source title](https://example.com/page)`.\n- Cite multiple sources with separate Markdown links, for example\n `[first source](https://example.com/one), [second source](https://example.com/two)`.\n- Link directly to the page that supports the claim. Do not link to search result\n pages or use bare URLs.\n\nFormatting of citations:\n\n- Place each citation as near as possible to the claim it supports, normally at\n the end of the sentence or paragraph and after punctuation.\n- Do not place citations inside code fences.\n- Do not put citations on a line by themselves or collect all citations at the\n end of the response.\n\nIf you browse the internet, cite statements supported by web sources. Each cited\nsource must directly support the associated claim. Prefer primary and\nauthoritative sources, and use sources from different domains when the response\nbenefits from multiple perspectives.\n\n---\n\n## Special cases\nIf these conflict with any other instructions, these should take precedence.\n\n<special_cases>\n- When the user asks for information about how to use OpenAI products, (ChatGPT, the OpenAI API, etc.), you should check the code in local env and only browse as fallback, when you browse restrict your sources to official OpenAI websites using the domains filter, unless otherwise requested.\n- When using search to answer technical questions, you must only rely on primary sources (research papers, official documentation, etc.)\n- Clearly indicate when you are making an inference from sources.\n</special_cases>\n\n---\n\n## Word limits\nResponses may not excessively quote or draw on a specific source. There are several limits here:\n- **Limit on verbatim quotes:**\n - You may not quote more than 25 words verbatim from any single non-lyrical source, unless the source is reddit.\n - For song lyrics, verbatim quotes must be limited to at most 10 words.\n - Long quotes from reddit are allowed, as long as you indicate that those are direct quotes via a markdown blockquote starting with ">", copy verbatim, and link the source.\n- **Word limits:**\n - Each webpage source in the sources has a word limit label formatted like "[wordlim N]", in which N is the maximum number of words in the whole response that are attributed to that source. If omitted, the word limit is 200 words.\n - Non-contiguous words derived from a given source must be counted to the word limit.\n - The summarization limit N is a maximum for each source.\n - When using multiple sources, their summarization limits add together. However, each article used must be relevant to the response.\n- **Copyright compliance:**\n - You must avoid providing full articles, long verbatim passages, or extensive direct quotes due to copyright concerns.\n - If the user asked for a verbatim quote, the response should provide a short compliant excerpt and then answer with paraphrases and summaries.\n - Again, this limit does not apply to reddit content, as long as it\'s appropriately indicated that those are direct quotes and you link to the source.\n',parameters:{type:"object",properties:{click:{type:"array",description:"Open links from previously opened pages.",items:{type:"object",properties:{id:{type:"integer",description:"Numbered link id to open."},ref_id:{type:"string",description:"Reference id containing the numbered link."}},required:["id","ref_id"]}},finance:{type:"array",description:"Look up prices for the given stock symbols.",items:{type:"object",properties:{market:{type:"string",description:'ISO 3166-1 alpha-3 country code, "OTC", or "" for cryptocurrency.'},ticker:{type:"string",description:"Ticker symbol to look up."},type:{type:"string",description:"Asset type to look up.",enum:["equity","fund","crypto","index"]}},required:["ticker","type"]}},find:{type:"array",description:"Find text patterns in pages.",items:{type:"object",properties:{pattern:{type:"string",description:"Text pattern to find."},ref_id:{type:"string",description:"Reference id or URL to search within."}},required:["pattern","ref_id"]}},image_query:{type:"array",description:"Query the image search engine for a given list of queries.",items:{type:"object",properties:{domains:{type:"array",description:"Whether to filter by a specific list of domains.",items:{type:"string"}},q:{type:"string",description:"Search query."},recency:{type:"integer",description:"Whether to filter by recency, as a number of recent days."}},required:["q"]}},open:{type:"array",description:"Open pages by reference id or URL.",items:{type:"object",properties:{lineno:{type:"integer",description:"Line number to position the page at."},ref_id:{type:"string",description:"Reference id or URL to open."}},required:["ref_id"]}},response_length:{type:"string",description:"Set the length of the response to be returned.",enum:["short","medium","long"]},screenshot:{type:"array",description:"Take screenshots of PDF pages.",items:{type:"object",properties:{pageno:{type:"integer",description:"Zero-indexed PDF page number."},ref_id:{type:"string",description:"Reference id or URL to screenshot."}},required:["pageno","ref_id"]}},search_query:{type:"array",description:"Query the internet search engine for a given list of queries.",items:{type:"object",properties:{domains:{type:"array",description:"Whether to filter by a specific list of domains.",items:{type:"string"}},q:{type:"string",description:"Search query."},recency:{type:"integer",description:"Whether to filter by recency, as a number of recent days."}},required:["q"]}},sports:{type:"array",description:"Look up sports schedules and standings.",items:{type:"object",properties:{date_from:{type:"string",description:"Start date in YYYY-MM-DD format."},date_to:{type:"string",description:"End date in YYYY-MM-DD format."},fn:{type:"string",description:"Sports function to call.",enum:["schedule","standings"]},league:{type:"string",description:"League to look up.",enum:["nba","wnba","nfl","nhl","mlb","epl","ncaamb","ncaawb","ipl"]},locale:{type:"string",description:"Locale for the lookup."},num_games:{type:"integer",description:"Number of games to return."},opponent:{type:"string",description:"Opponent to use with `team` when narrowing the lookup."},team:{type:"string",description:"Team to look up, using the common 3 or 4 letter alias used in broadcasts."},tool:{type:"string",description:"Tool name for sports requests.",enum:["sports"]}},required:["fn","league"]}},time:{type:"array",description:"Get time for the given UTC offsets.",items:{type:"object",properties:{utc_offset:{type:"string",description:'UTC offset formatted like "+03:00".'}},required:["utc_offset"]}},weather:{type:"array",description:"Look up weather forecasts.",items:{type:"object",properties:{duration:{type:"integer",description:"Number of days to return. Defaults to 7."},location:{type:"string",description:'Location in "Country, Area, City" format.'},start:{type:"string",description:"Start date in YYYY-MM-DD format. Defaults to today."}},required:["location"]}}}},settings:{allowed_callers:["direct"],external_web_access:!0},maxOutputTokens:1e4};var Ee=o({error:o({resets_at:n(S)})}),qe=ew(Kn(Ee)),Re=(e)=>{let a=e.http?.body,u=a===void 0?void 0:qe(a);if(u!==void 0&&u._tag==="Some"&&u.value.error.resets_at!==void 0)return u.value.error.resets_at;let l=Number(e.http?.response?.headers["x-codex-primary-reset-at"]);return Number.isFinite(l)&&l>0?l:void 0},Me=(e)=>{if(e.reason._tag!=="QuotaExceeded"||e.reason.resetsAt!==void 0)return e;let a=Re(e.reason);return a===void 0?e:new de({...e,reason:new Zl({...e.reason,resetsAt:a})})},V=(e)=>ee("codexImages.generate")(function*(a,u,l){yield*Lg(a,l);let p=yield*Dg({baseURL:u.baseURL,auth:u.auth,recover:u.recover,fields:e.fields},l);return{images:p.images,requestId:p.requestId,headers:p.headers}},(a)=>at(a,Me));var K={client:"codex-cli 0.162.0",model:"gpt-image-2",fields:{quality:"auto",size:"auto"}};var q="https://chatgpt.com/backend-api/codex",R=32000,Ce="https://chatgpt.com/backend-api/wham/usage",z=o({used_percent:S,limit_window_seconds:n(S),reset_at:n(S)}),J=o({primary_window:n(gt(z)),secondary_window:n(gt(z))}),Oe=o({plan_type:t,rate_limit:J,additional_rate_limits:n(gt(x(o({limit_name:t,rate_limit:n(gt(J))})))),rate_limit_reset_credits:n(gt(o({available_count:S})))}),M=(e,a)=>{let u=e[a];return u===void 0||u.trim()===""?void 0:u.trim()},E=(e,a)=>{let u=M(e,a);if(u===void 0)return null;let l=Number(u);return Number.isFinite(l)?l:null},X=(e)=>e.toLowerCase().replace(/[^a-z0-9]/g,"").includes("codexspark"),Le=10080,Ue=40320,We=(e,a)=>{if(e==="bucket")return"bucket";if(a===void 0)return e==="primary"?"session":"weekly";if(a>=Ue)return"monthly";return a>=Le?"weekly":"session"},Z=(e,a,u)=>a.windowMinutes===0?null:new pc({kind:We(e,a.windowMinutes),label:u,usedPercent:a.usedPercent,windowMinutes:a.windowMinutes,resetsAt:a.resetsAt}),A=(e,a,u,l)=>{let p=E(e,`${a}-used-percent`);if(p===null)return null;return Z(u,{usedPercent:p,windowMinutes:E(e,`${a}-window-minutes`)??void 0,resetsAt:E(e,`${a}-reset-at`)??void 0},l)},C=(e,a)=>{let u=[],l=A(e,"x-codex-primary","primary"),p=A(e,"x-codex-secondary","secondary");if(l!==null)u.push(l);if(p!==null)u.push(p);for(let m of Object.keys(e)){let h=/^x-(.+)-primary-used-percent$/.exec(m);if(h===null||h[1]==="codex")continue;let w=h[1],g=w.trim().toLowerCase().replaceAll("-","_"),b=`x-${w}-primary`,_=M(e,`x-${w}-limit-name`)??g;if(X(_))continue;let L=A(e,b,"bucket",_);if(L!==null)u.push(L)}if(u.length===0)return null;return new Ps({observedAt:a,source:"reply",windows:u})},Ne=(e,a,u)=>Z(a,{usedPercent:Math.min(100,Math.max(0,e.used_percent)),windowMinutes:e.limit_window_seconds===void 0?void 0:e.limit_window_seconds/60,resetsAt:e.reset_at},u),$e=(e,a)=>pt(Oe)(e).pipe(at((u)=>new ls({message:`The OpenAI usage answer did not match its schema: ${u.message}`})),s((u)=>{let l=[],p=(m,h,w)=>{let g=m===void 0||m===null?null:Ne(m,h,w);if(g!==null)l.push(g)};p(u.rate_limit.primary_window,"primary"),p(u.rate_limit.secondary_window,"secondary");for(let m of u.additional_rate_limits??[]){if(X(m.limit_name))continue;p(m.rate_limit?.primary_window,"bucket",m.limit_name)}return l.length===0?c(new ls({message:"The OpenAI usage answer carried no quota windows."})):r(new Ps({observedAt:a,source:"usage",windows:l,plan:u.plan_type,resetCredits:u.rate_limit_reset_credits?.available_count}))})),De=(e)=>({fromHeaders:C,read:(a,u,l)=>Al({url:Ce,auth:Xe({credentials:a,ownerId:u,account:l},e),headers:{Accept:"application/json"}}).pipe(s((p)=>$e(p.body,p.observedAt)))}),te={fromHeaders:C,read:Is};function ne(e){let a=Yn(e.rung);return Rs({store:!1,reasoningEffort:a,reasoningSummary:a!==void 0&&e.reasoningOutput?"auto":void 0,promptCacheKey:e.cacheGroup,parallelToolCalls:e.parallelToolCalls,serviceTier:e.switches.serviceTier==="priority"?"priority":void 0})}var He={output:{budget:R,sent:!0},model:(e)=>r(ze(e)),options:ne},k=({credentials:e,ownerId:a,account:u})=>{let l=e.recoverAccessToken;return{recover:l===void 0?void 0:hf("OpenAI credential recovery",()=>l.call(e,a,ac,u)).pipe(kn)}},Qe=B(I),Fe=(e,a)=>{if(!I.models.includes(e.model))return;return d(()=>{let u={...e,cacheGroup:e.cacheGroup||void 0};return Qe({url:`${q}${I.path}`,auth:O(u,a),recover:k(u).recover,session:ei(()=>pu(u.cacheGroup)),model:u.model})})},Ge="images",je=(e,a)=>{if(M(e,"x-codex-active-limit")===void 0)return null;let u=A(e,"x-codex-primary","bucket",Ge);return u===null?null:new Ps({observedAt:a,source:"reply",windows:[u]})},Ye=V(K),Be=(e)=>({generate:(a,u)=>{let l=of.imageModels?.[u.model];if(l===void 0)return c(Ve(u.model));return Ye(l,{baseURL:q,auth:O(a,e),recover:k(a).recover},u)},quota:je}),Ve=(e)=>new de({module:"Images",method:"generate",reason:new rn({message:`${e} is not an image model ChatGPT serves.`})}),Ke=(e)=>({web:(a)=>Fe(a,e),retry:k,output:{budget:R,sent:!1},model:(a)=>r(et(a,e)),options:ne});function ze(e){return as.with({provider:rf,quota:te.fromHeaders,limits:{output:R},auth:Hn(e.credentials,e.ownerId,rf,e.account).bearer()}).model({id:e.model})}var Je=WS(zg);async function re(e){return(await Je(await e.credentials.credential(e.ownerId,ac,e.account))).accountId}function O(e,a){return mm(e.credentials,e.ownerId,ac,e.account).bearer().andThen(Cf((u)=>Es({accountId:hf("ChatGPT account id",()=>re(e)),sessionId:ei(()=>pu(e.cacheGroup))}).pipe(i(({accountId:l,sessionId:p})=>po(u.headers,{...U(a,p),...l?{"ChatGPT-Account-Id":l}:{}})))))}function Xe(e,a){return mm(e.credentials,e.ownerId,ac,e.account).bearer().andThen(Cf((u)=>hf("ChatGPT account id",()=>re(e)).pipe(i((l)=>po(u.headers,{"User-Agent":T(a),...l?{"ChatGPT-Account-Id":l}:{}})))))}function Ze(e){return Cf((a)=>{let u=a.request?Fg(a.request):void 0,l=`model=${e}${u?`;tier=${u}`:""}`;return r(po(a.headers,{"x-codex-routing-hint":l}))})}function et(e,a){return as.with({provider:ac,quota:C,endpoint:{baseURL:q},auth:O(e,a).andThen(Ze(e.model)),retry:k(e)}).model({id:e.model})}var tt={...lm,profile:He,quota:te},nt=(e)=>({...of,profile:Ke(e),quota:De(e),images:Be(e)}),Qt=(e)=>[nt(e),tt];export{q as OPENAI_CHATGPT_BASE_URL,R as OPENAI_OUTPUT_RESERVATION,O as chatgptIdentity,tt as openaiConsoleRegistration,De as openaiQuota,Qt as openaiRegistrations,nt as openaiSubscriptionRegistration};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{nf,Ew,vw,Rs,Fg,ww,kw,_w,Tw,Rw,ME,Iw,as,Cw,H_}from"./plugin-zrb8bbr4.js";import"./plugin-psj9935q.js";import"./plugin-zsv7wawc.js";import"./plugin-2s6bq45c.js";import"./plugin-pdww1ma8.js";import"./plugin-kc4z9msd.js";import"./plugin-7swap1ad.js";import"./plugin-7xmwhj5h.js";import"./plugin-fjsmz1vy.js";import"./plugin-24j9hnc7.js";import"./plugin-yp736z4n.js";import"./plugin-a3vzpk4e.js";import"./plugin-r7g3vqrm.js";import"./plugin-g7hrtg2p.js";import"./plugin-e5ybk2a2.js";import"./plugin-8q44b578.js";import"./plugin-p6x7emar.js";import"./plugin-y9cdpmbv.js";import"./plugin-g4hst0jz.js";import"./plugin-3t0qp574.js";import"./plugin-w3zbkmy6.js";import"./plugin-6vzw5yyr.js";import"./plugin-d28d8jar.js";import"./plugin-7te9b50h.js";import"./plugin-krbbb4ts.js";import"./plugin-72xxqm1t.js";import"./plugin-me00x60n.js";import"./plugin-q6pvb1xf.js";import"./plugin-v80m00bq.js";export{nf as ADAPTER,Ew as DEFAULT_BASE_URL,Rw as OpenAIResponsesEvent,ww as OpenAIResponsesInputItem,Tw as OpenAIResponsesStreamItem,kw as OpenAIResponsesTool,_w as OpenAIResponsesUsage,vw as PATH,Iw as httpTransport,Rs as options,ME as protocol,as as route,Fg as serviceTier,H_ as webSocketRoute,Cw as webSocketTransport};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./plugin-
|
|
2
|
+
import"./plugin-v80m00bq.js";import"./plugin-d28d8jar.js";import{N}from"./plugin-me00x60n.js";import"./plugin-q6pvb1xf.js";import"./plugin-7te9b50h.js";import"./plugin-6vzw5yyr.js";import{rn,de}from"./plugin-3t0qp574.js";import{Fr,bu}from"./plugin-g4hst0jz.js";import"./plugin-8q44b578.js";import"./plugin-72xxqm1t.js";import{Dr,jn,ds,Ta,Ls,mi,Ds,cy,fs,Ra,ps,Us,Xr,lr}from"./plugin-y9cdpmbv.js";import"./plugin-a3vzpk4e.js";import"./plugin-yp736z4n.js";import{pc,Ps,ls}from"./plugin-g7hrtg2p.js";import{ln,we}from"./plugin-24j9hnc7.js";import{Lr}from"./plugin-r7g3vqrm.js";import{Zo,Ns}from"./plugin-p6x7emar.js";import"./plugin-w3zbkmy6.js";import"./plugin-krbbb4ts.js";import{qi}from"./plugin-e5ybk2a2.js";import{Ms}from"./plugin-fjsmz1vy.js";import"./plugin-7xmwhj5h.js";import{To}from"./plugin-pdww1ma8.js";import{Il,Cl}from"./plugin-eksq91yp.js";import{Cs,nn,Vo,cs,yr,Pl,As}from"./plugin-zsv7wawc.js";import"./plugin-2s6bq45c.js";import"./plugin-psj9935q.js";import{Ea,va}from"./plugin-er1kc6f6.js";import"./plugin-7swap1ad.js";import{Rs,as}from"./plugin-zrb8bbr4.js";import{sf,dm}from"./plugin-p59gy5xd.js";import{pu}from"./plugin-jxvmq18y.js";import{Hn}from"./plugin-dd951075.js";import{Al}from"./plugin-fre9hdcg.js";import{Yn,Ml}from"./plugin-g0zv4vrz.js";import{Ro}from"./plugin-kc4z9msd.js";import{ei,r,c,s,i,at,ee,ml,pt,n,ce,t,S,z,o,x,O,W}from"./plugin-xfcgt5ba.js";var Q=["type","properties","items","prefixItems","enum","const","$ref","additionalProperties","patternProperties","required","not","if","then","else"],C=(e)=>N(e)&&(Array.isArray(e.anyOf)||Array.isArray(e.oneOf)||Array.isArray(e.allOf)),K=(e)=>N(e)&&(C(e)||Q.some((a)=>(a in e))),k=(e)=>{if(!N(e))return Array.isArray(e)?e.map(k):e;let a=Object.fromEntries(Object.entries(e).map(([d,u])=>[d,d==="enum"&&Array.isArray(u)?u.map(String):k(u)]));if(Array.isArray(a.enum)&&(a.type==="integer"||a.type==="number"))a.type="string";let l=a.properties;if(a.type==="object"&&N(l)&&Array.isArray(a.required))a.required=a.required.filter((d)=>typeof d==="string"&&(d in l));if(a.type==="array"&&!C(a)){if(a.items=a.items??{},N(a.items)&&!K(a.items))a.items={...a.items,type:"string"}}if(typeof a.type==="string"&&a.type!=="object"&&!C(a))delete a.properties,delete a.required;return a},Y=(e)=>e.type==="object"&&(!N(e.properties)||Object.keys(e.properties).length===0)&&!e.additionalProperties&&!C(e),R=(e)=>{if(!Array.isArray(e.allOf))return e;let{allOf:a,...l}=e,d=[...a.filter(N).map(R),l],u=Object.assign({},...d.map((m)=>N(m.properties)?m.properties:{})),p=[...new Set(d.flatMap((m)=>Array.isArray(m.required)?m.required:[]))];return{...Object.assign({},...d),properties:Object.keys(u).length===0?void 0:u,required:p.length===0?void 0:p}},T=(e)=>{if(!N(e))return;let a=R(e);if(Y(a))return;let l=Array.isArray(a.anyOf)?a.anyOf:Array.isArray(a.oneOf)?a.oneOf:void 0;return Object.fromEntries([["description",a.description],["required",a.required],["format",a.format],["type",Array.isArray(a.type)?a.type.filter((d)=>d!=="null")[0]:a.type],["nullable",Array.isArray(a.type)&&a.type.includes("null")?!0:void 0],["enum",a.const!==void 0?[a.const]:a.enum],["properties",N(a.properties)?Object.fromEntries(Object.entries(a.properties).map(([d,u])=>[d,T(u)])):void 0],["items",Array.isArray(a.items)?a.items.map(T):a.items===void 0?void 0:T(a.items)],["anyOf",l?.map(T)],["minLength",a.minLength]].filter((d)=>d[1]!==void 0))},P=(e)=>T(k(e));var L="gemini",v=new Set(cy),te="https://generativelanguage.googleapis.com/v1beta",ne=o({text:t,thought:n(z),thoughtSignature:n(t)}),b=o({inlineData:o({mimeType:t,data:t})}),oe=o({functionCall:o({id:n(t),name:t,args:ce}),thoughtSignature:n(t)}),ie=o({functionResponse:o({id:n(t),name:t,response:ce,parts:jn(b)})}),re=O([ne,b,oe,ie]),I=o({role:W(["user","model"]),parts:x(re)}),se=o({parts:x(o({text:t}))}),ae=o({name:t,description:t,parameters:n(Dr)}),le=o({functionDeclarations:x(ae)}),ue=o({functionCallingConfig:o({mode:W(["AUTO","NONE","ANY"]),allowedFunctionNames:jn(t)})}),w=W(["minimal","low","medium","high"]),pe=ml(w),me=o({thinkingLevel:n(w),thinkingBudget:n(S),includeThoughts:n(z)}),ge=o({maxOutputTokens:n(S),temperature:n(S),topP:n(S),topK:n(S),stopSequences:jn(t),thinkingConfig:n(me)}),fe={contents:x(I),systemInstruction:n(se),tools:jn(le),toolConfig:n(ue),generationConfig:n(ge)},he=o(fe),ye=o({cachedContentTokenCount:n(S),thoughtsTokenCount:n(S),promptTokenCount:n(S),toolUsePromptTokenCount:n(S),candidatesTokenCount:n(S),totalTokenCount:n(S)}),Se=o({content:n(I),finishReason:n(t)}),Te=o({code:n(S),message:n(t),status:n(t)}),Ce=o({candidates:jn(Se),promptFeedback:n(o({blockReason:n(t)})),usageMetadata:n(ye),error:n(Te)}),ke=(e,a)=>({name:e.name,description:e.description,parameters:P(a)}),Ae=(e)=>Us("Gemini",e,{auto:()=>({functionCallingConfig:{mode:"AUTO"}}),none:()=>({functionCallingConfig:{mode:"NONE"}}),required:()=>({functionCallingConfig:{mode:"ANY"}}),tool:(a)=>({functionCallingConfig:{mode:"ANY",allowedFunctionNames:[a]}})}),Ee=ee("Gemini.lowerUserPart")(function*(e){if(e.type==="text")return{text:e.text};let a=yield*fs("Gemini",e,v);return{inlineData:{mimeType:a.mime,data:a.base64}}}),y=(e)=>({google:e}),A=(e)=>{let a=e?.google;return N(a)&&typeof a.thoughtSignature==="string"?a.thoughtSignature:void 0},Ge=(e)=>({functionCall:{id:e.id,name:e.name,args:e.input},thoughtSignature:A(e.providerMetadata)}),Re=ee("Gemini.lowerMessages")(function*(e){let a=[];for(let l of e.messages){if(l.role==="system"){let u=yield*Ds("Gemini",l),p=a.at(-1);if(p?.role==="user"&&!p.parts.some((m)=>("functionResponse"in m)))a[a.length-1]={role:"user",parts:[...p.parts,{text:u.text}]};else a.push({role:"user",parts:[{text:u.text}]});continue}if(l.role==="user"){let u=[];for(let p of l.content){if(!Xr(p,["text","media"]))return yield*lr("Gemini","user",["text","media"]);u.push(yield*Ee(p))}a.push({role:"user",parts:u});continue}if(l.role==="assistant"){let u=[];for(let p of l.content){if(!Xr(p,["text","reasoning","tool-call"]))return yield*lr("Gemini","assistant",["text","reasoning","tool-call"]);if(p.type==="text"){u.push({text:p.text,thoughtSignature:A(p.providerMetadata)});continue}if(p.type==="reasoning"){u.push({text:p.text,thought:!0,thoughtSignature:A(p.providerMetadata)});continue}if(p.type==="tool-call")u.push(Ge(p))}a.push({role:"model",parts:u});continue}let d=[];for(let u of l.content){if(!Xr(u,["tool-result"]))return yield*lr("Gemini","tool",["tool-result"]);if(u.result.type!=="content"){d.push({functionResponse:{id:u.id,name:u.name,response:{name:u.name,content:ps(u)}}});continue}let p=u.result.value,m=p.filter((h)=>h.type==="text").map((h)=>h.text),f=[];for(let h of p){if(h.type==="text")continue;let g=yield*Ra("Gemini",h,v);f.push({inlineData:{mimeType:g.mime,data:g.base64}})}d.push({functionResponse:{id:u.id,name:u.name,response:{name:u.name,content:m.join(`
|
|
3
3
|
`)},parts:f.length===0?void 0:f}})}a.push({role:"user",parts:d})}return a}),Oe=(e)=>e.providerOptions?.gemini,Pe=(e)=>{let a=Oe(e)?.thinkingConfig;if(!N(a))return;let l={thinkingLevel:pe(a.thinkingLevel)?a.thinkingLevel:void 0,thinkingBudget:typeof a.thinkingBudget==="number"?a.thinkingBudget:void 0,includeThoughts:typeof a.includeThoughts==="boolean"?a.includeThoughts:void 0};return Object.values(l).some((d)=>d!==void 0)?l:void 0},M=(e)=>e.thinkingConfig===void 0?void 0:{gemini:{thinkingConfig:e.thinkingConfig}},Le=ee("Gemini.fromRequest")(function*(e){let a=e.tools.length>0&&e.toolChoice?.type!=="none",l=e.generation,d=e.model.compatibility?.toolSchema,u={maxOutputTokens:l?.maxTokens,temperature:l?.temperature,topP:l?.topP,topK:l?.topK,stopSequences:l?.stop,thinkingConfig:Pe(e)};return{contents:yield*Re(e),systemInstruction:e.system.length===0?void 0:{parts:[{text:mi(e.system)}]},tools:a?[{functionDeclarations:e.tools.map((p)=>ke(p,Ro.modelCompatibility(p.inputSchema,d)))}]:void 0,toolConfig:a&&e.toolChoice?yield*Ae(e.toolChoice):void 0,generationConfig:Object.values(u).some((p)=>p!==void 0)?u:void 0}}),ve=(e)=>{if(!e)return;let a=e.cachedContentTokenCount,l=e.promptTokenCount!==void 0?e.promptTokenCount+(e.toolUsePromptTokenCount??0):void 0,d=Ta(l,a),u=e.candidatesTokenCount!==void 0?e.candidatesTokenCount+(e.thoughtsTokenCount??0):void 0;return new ln({inputTokens:l,outputTokens:u,nonCachedInputTokens:d,cacheReadInputTokens:a,reasoningTokens:e.thoughtsTokenCount,totalTokens:ds(l,u,e.totalTokenCount),providerMetadata:{google:e}})},be=new Set(["SAFETY","RECITATION","LANGUAGE","BLOCKLIST","PROHIBITED_CONTENT","SPII","IMAGE_SAFETY","IMAGE_PROHIBITED_CONTENT","IMAGE_RECITATION","ESCALATION","PUP_LIMITED_DISABLED"]),xe=new Set(["MALFORMED_FUNCTION_CALL","UNEXPECTED_TOOL_CALL","TOO_MANY_TOOL_CALLS","MISSING_THOUGHT_SIGNATURE","MALFORMED_RESPONSE"]),Ie=(e)=>{if(e.blockReason!==void 0)return"content-filter";let a=e.finishReason;if(a==="STOP")return e.hasToolCalls?"tool-calls":"stop";if(a==="MAX_TOKENS"||a==="CONTINUATION")return"length";if(a!==void 0&&be.has(a))return"content-filter";if(a!==void 0&&xe.has(a))return"error";return"unknown"},Ne=(e)=>{if(e.finishReason===void 0&&e.blockReason===void 0)return[];let a=[],l=e.reasoningSignature?yr(e.lifecycle,a,"reasoning-0",y({thoughtSignature:e.reasoningSignature})):e.lifecycle;if(e.textSignature!==void 0)l=Pl(l.text.has("text-0")?l:Vo(l,a,"text-0",""),a,"text-0",y({thoughtSignature:e.textSignature}));return As(l,a,{reason:Ie(e),usage:e.usage}),a},Me=new Set(["UNAVAILABLE","RESOURCE_EXHAUSTED","INTERNAL","DEADLINE_EXCEEDED"]),Ue=(e,a,l)=>{let d=l.message??"";return Ls({module:"Gemini",refusal:{code:l.status??(l.code===void 0?void 0:String(l.code)),message:d},evidence:{eventType:void 0,keys:Object.keys(a),payloadKeys:Object.keys(l)},retryable:l.status!==void 0&&Me.has(l.status)||l.code!==void 0&&l.code>=500,contextOverflow:qi(d),modelStarted:e.lifecycle.stepStarted})},De=(e,a)=>{if(a.error!==void 0)return c(Ue(e,a,a.error));let l={...e,usage:a.usageMetadata?ve(a.usageMetadata)??e.usage:e.usage,blockReason:a.promptFeedback?.blockReason??e.blockReason},d=a.candidates?.[0];if(!d?.content)return r([{...l,finishReason:d?.finishReason??l.finishReason},[]]);let u=[],{hasToolCalls:p,lifecycle:m,reasoningSignature:f,textSignature:h}=l;for(let g of d.content.parts){if("text"in g&&g.thoughtSignature)if(g.thought)f=g.thoughtSignature;else h=g.thoughtSignature;if("text"in g&&g.text.length>0){if(g.thought){m=cs(m,u,"reasoning-0",g.text,g.thoughtSignature?y({thoughtSignature:g.thoughtSignature}):void 0);continue}m=yr(m,u,"reasoning-0",f?y({thoughtSignature:f}):void 0),m=Vo(m,u,"text-0",g.text);continue}if("functionCall"in g){let B=g.functionCall.args,H=g.functionCall.id??`tool_${crypto.randomUUID()}`;m=yr(m,u,"reasoning-0",f?y({thoughtSignature:f}):void 0),m=nn(m,u),u.push(we.toolCall({id:H,name:g.functionCall.name,input:B,providerMetadata:g.thoughtSignature?y({thoughtSignature:g.thoughtSignature}):void 0})),p=!0}}return r([{...l,hasToolCalls:p,lifecycle:m,reasoningSignature:f,textSignature:h,finishReason:d.finishReason??l.finishReason},u])},_e=Zo({id:L,body:{schema:he,from:Le},stream:{event:Ns(Ce),initial:()=>({hasToolCalls:!1,lifecycle:Cs()}),step:De,onHalt:Ne}}),U=To.make({id:L,protocol:_e,endpoint:Lr.path(({request:e})=>`/models/${e.model.id}:streamGenerateContent?alt=sse`,{baseURL:te}),auth:Fr,framing:Ms});var D="https://opencode.ai/inference/go/v1",_=(e)=>`${e.client.name}/${e.client.version}`,F=32000,je=300,j={"glm-5.3-flash":"chat","glm-5.3":"chat","glm-5.2":"chat","glm-5.1":"chat","kimi-k3":"chat","kimi-k2.7-code":"chat","kimi-k2.6":"chat","longcat-2.0":"chat","deepseek-v4.1-flash":"chat","deepseek-v4-pro":"chat","mimo-v2.5":"chat","mimo-v2.5-pro":"chat",hy3:"chat","hy4-preview":"chat","gemini-4-argon-contributor":"gemini","gpt-5.6-luna":"responses","grok-4.6":"responses","muse-spark-1.3-contributor":"responses","muse-spark-1.2-contributor":"responses","minimax-m3":"messages","minimax-m2.7":"messages","qwen3.8-max":"messages","qwen3.8-flash":"messages","qwen3.7-plus":"messages","qwen3.7-max":"messages","qwen3.6-plus":"messages","union-alpha":"messages"},qe=new Set(["minimal","low","medium","high"]),Be=(e)=>e!==void 0&&qe.has(e),He=new Set(["deepseek-v4.1-flash","deepseek-v4-pro"]),We=(e)=>new de({module:"OpenCodeGo",method:"model",reason:new rn({message:`"${e}" is not an OpenCode Go model this build serves: no wire is declared for it.`})}),E=o({status:t,percent:S,resetsAt:t}),Qe=o({usage:o({rolling:E,weekly:E,monthly:E})}),G=(e,a,l)=>{let d=Date.parse(e.resetsAt);return new pc({kind:a,usedPercent:Math.min(100,Math.max(0,e.percent)),windowMinutes:l,resetsAt:Number.isNaN(d)?void 0:d/1000})},Ke=(e,a)=>pt(Qe)(e).pipe(at((l)=>new ls({message:`The OpenCode Go usage answer did not match its schema: ${l.message}`})),i((l)=>new Ps({observedAt:a,source:"usage",windows:[G(l.usage.rolling,"bucket",je),G(l.usage.weekly,"weekly"),G(l.usage.monthly,"monthly")]}))),q=()=>null,Ye=(e)=>({fromHeaders:q,read:(a,l,d)=>Al({url:`${D}/usage`,auth:Hn(a,l,sf,d).bearer(),headers:{Accept:"application/json","User-Agent":_(e)}}).pipe(s((u)=>Ke(u.body,u.observedAt)))}),$e=(e)=>{let a=Yn(e.rung);switch(j[e.model]){case"responses":return Rs({store:!1,reasoningEffort:a,parallelToolCalls:e.parallelToolCalls});case"gemini":return M({thinkingConfig:{thinkingLevel:Be(a)?a:void 0,includeThoughts:!0}});case"messages":{let l=Ml(a,e.outputTokens);return Il({thinking:l===void 0?void 0:{type:"enabled",budgetTokens:l},disableParallelToolUse:e.parallelToolCalls===void 0?void 0:!e.parallelToolCalls})}case void 0:return;default:return Ea({reasoningEffort:a,parallelToolCalls:e.parallelToolCalls})}},Ve=(e,a,l,d)=>{let u=Hn(e.credentials,e.ownerId,sf,e.account),p={provider:sf,quota:q,endpoint:{baseURL:D},limits:{output:F},headers:{"User-Agent":_(a),"x-opencode-session":d}};if(l==="messages")return Cl.with({...p,auth:u.pipe(bu("x-api-key"))}).model({id:e.model});if(l==="gemini")return U.with({...p,auth:u.pipe(bu("x-goog-api-key"))}).model({id:e.model});return(l==="responses"?as:va).with({...p,auth:u.bearer()}).model({id:e.model,compatibility:He.has(e.model)?{reasoningEcho:"required"}:void 0})},Xe=(e)=>({output:{budget:F,sent:!0},model:ee("opencodeGo.model")(function*(a){let l=j[a.model];if(l===void 0)return yield*We(a.model);let d=yield*ei(()=>pu(a.cacheGroup));return Ve(a,e,l,d)}),options:$e}),Je=(e)=>({...dm,profile:Xe(e),quota:Ye(e)}),Gt=(e)=>[Je(e)];export{D as OPENCODE_GO_BASE_URL,F as OPENCODE_GO_OUTPUT_RESERVATION,Ye as opencodeGoQuota,Je as opencodeGoRegistration,Gt as opencodeGoRegistrations,Ke as opencodeGoUsage,_ as opencodeGoUserAgent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ql,Xm,Yl,Oo,Uf,Xl,Ur,ed,Wi,td,eh,r_,o_,nd,Sc,rd,Ut,gs,s_,_y}from"./plugin-
|
|
2
|
+
import{Ql,Xm,Yl,Oo,Uf,Xl,Ur,ed,Wi,td,eh,r_,o_,nd,Sc,rd,Ut,gs,s_,_y}from"./plugin-7te9b50h.js";import"./plugin-me00x60n.js";import"./plugin-q6pvb1xf.js";import"./plugin-v80m00bq.js";export{gs as CacheHint,_y as CachePolicy,s_ as CachePolicyObject,Ur as GenerationOptions,Oo as HttpOptions,Sc as Model,nd as ModelCompatibility,td as ModelDefaults,Ut as ModelIdentity,Wi as ModelLimits,o_ as ModelReasoningEcho,rd as ModelSchema,Xm as ProviderOptions,eh as ToolChoiceMode,r_ as ToolSchemaDialect,ed as mergeGenerationOptions,Xl as mergeHttpOptions,Ql as mergeJsonRecords,Yl as mergeProviderOptions,Uf as orderedHeaders};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./plugin-
|
|
2
|
+
import"./plugin-v80m00bq.js";import{F,it,i,v}from"./plugin-xfcgt5ba.js";var a=/=+$/g;function n(r){let e="";for(let t of r)e+=String.fromCharCode(t);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(a,"")}function o(r){let e=new Uint8Array(r);return crypto.getRandomValues(e),e}class c extends F("PkceFailed"){}function s(){return n(o(64))}function f(r){let e=new TextEncoder().encode(r);return it({try:()=>crypto.subtle.digest("SHA-256",e),catch:(t)=>new c({cause:t})}).pipe(i((t)=>n(new Uint8Array(t))))}var u=v(function*(){let r=s(),e=yield*f(r);return{verifier:r,challenge:e}});function p(r,e=24){return r+n(o(e))}export{c as PkceFailed,f as generateCodeChallenge,s as generateCodeVerifier,u as generatePkce,p as generateState};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Mv,Jl,zs,ku,Gm,Hs}from"./plugin-
|
|
2
|
+
import{Mv,Jl,zs,ku,Gm,Hs}from"./plugin-d28d8jar.js";import{Pt}from"./plugin-6vzw5yyr.js";import{Ma}from"./plugin-w3zbkmy6.js";import{uc}from"./plugin-dqxdznvd.js";import{at,Va,co,mr,ee}from"./plugin-xfcgt5ba.js";var uk=ee("OAuth.vendorCall")(function*(e,t,n){let o=yield*Hs,s=t["Content-Type"]??t["content-type"]??"application/json",i=n===void 0?Mv(e).pipe(zs(t)):Jl(e).pipe(zs(t),Gm(n,s)),r=yield*o.execute(i.pipe(ku((a)=>Pt(a,Object.keys(t))))).pipe(co),p=yield*r.text;return{ok:r.status>=200&&r.status<300,status:r.status,statusText:"",text:p}}),Gg=(e,t,n)=>uk(e,t,n).pipe(at((o)=>uc(o))),lk=Ma,Fl=(e)=>mr(e.pipe(Va(lk)));
|
|
3
3
|
export{uk,Gg,lk,Fl};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Om,_f,dn}from"./plugin-
|
|
2
|
+
import{Om,_f,dn}from"./plugin-yp736z4n.js";import{we,dc}from"./plugin-24j9hnc7.js";var i=new TextEncoder,u=(e,t,n,o)=>dn.make({role:"assistant",content:[...t],origin:e,id:n,requestId:o}),a=(e,t)=>t===void 0?{type:"text",text:e}:{type:"text",text:e,providerMetadata:t},s=(e,t)=>t===void 0?{type:"reasoning",text:e}:{type:"reasoning",text:e,providerMetadata:t},l=(e)=>{let t=[...e.content];for(let n of Object.values(e.textParts))t[n.contentIndex]=a(n.chunks.join(""),n.providerMetadata);for(let n of Object.values(e.reasoningParts))t[n.contentIndex]=s(n.chunks.join(""),n.providerMetadata);return t},Em=(e)=>{let t={events:[],content:[],get message(){let n=u(t.origin,l(t),t.messageId,t.requestId);return t.native===void 0?n:new dn({...n,native:t.native})},origin:e,textParts:{},reasoningParts:{},toolInputs:{},arguments:{}};return t},c=(e)=>e,p=(e,t)=>{let n=c(e);if(n.events.push(t),t.type==="step-finish")n.requestId=t.requestId,n.native=t.native;if(we.is.finish(t))n.usage=t.usage??n.usage,n.finishReason=t.reason;else if("usage"in t&&t.usage!==void 0)n.usage=t.usage;return n},r=(e,t)=>(e.content.push(t),e),g=(e,t,n)=>{if(e.textParts[t])return e;let o=e.content.length;return r(e,a("",n)),e.textParts[t]={contentIndex:o,chunks:[],providerMetadata:n},e},y=(e,t)=>{let n=g(e,t.id,t.providerMetadata).textParts[t.id];if(!n)return e;return n.chunks.push(t.text),n.providerMetadata=t.providerMetadata??n.providerMetadata,e},M=(e,t)=>{let n=e.textParts[t.id];if(!n)return e;let o=t.providerMetadata??n.providerMetadata;return e.content[n.contentIndex]=a(n.chunks.join(""),o),delete e.textParts[t.id],e},d=(e,t,n)=>{if(e.reasoningParts[t])return e;let o=e.content.length;return r(e,s("",n)),e.reasoningParts[t]={contentIndex:o,chunks:[],providerMetadata:n},e},f=(e,t)=>{let n=d(e,t.id,t.providerMetadata).reasoningParts[t.id];if(!n)return e;return n.chunks.push(t.text),n.providerMetadata=t.providerMetadata??n.providerMetadata,e},m=(e,t)=>{let n=e.reasoningParts[t.id];if(!n)return e;let o=t.providerMetadata??n.providerMetadata;return e.content[n.contentIndex]=s(n.chunks.join(""),o),delete e.reasoningParts[t.id],e},R=(e,t)=>(e.toolInputs[t.id]={name:t.name,chunks:[],providerMetadata:t.providerMetadata},e),I=(e,t)=>{let n=e.toolInputs[t.id]??{name:t.name,chunks:[]};return n.chunks.push(t.text),e.toolInputs[t.id]=n,e},x=(e,t)=>{let n=e.toolInputs[t.id]??{name:t.name,chunks:[]};return n.name=t.name,n.providerMetadata=t.providerMetadata??n.providerMetadata,n.chunks=[n.chunks.join("")],e.toolInputs[t.id]=n,e},b=(e)=>Om.from({id:e.id,name:e.name,input:e.input,unparsed:e.unparsed,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),P=(e)=>_f.from({id:e.id,name:e.name,result:e.result,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),h=(e,t)=>{let n=e.toolInputs[t.id]?.chunks.join("")??"";return e.arguments[t.id]=n.length>0?n:JSON.stringify(t.input??{}),delete e.toolInputs[t.id],r(e,b(t))},k=(e,t)=>{e.origin=t.to,e.content.splice(0);for(let n of Object.keys(e.textParts))delete e.textParts[n];for(let n of Object.keys(e.reasoningParts))delete e.reasoningParts[n];for(let n of Object.keys(e.toolInputs))delete e.toolInputs[n];for(let n of Object.keys(e.arguments))delete e.arguments[n];return r(e,{type:"model-fallback",from:t.from,to:t.to,trigger:t.trigger,providerMetadata:t.providerMetadata})},S=(e,t)=>{if(e.messageId===void 0&&t.messageId!==void 0)e.messageId=t.messageId;return e},vm=(e,t)=>{let n=p(e,t);switch(t.type){case"step-start":if(t.origin!==void 0)n.origin=t.origin;return n;case"input-usage":return S(n,t);case"text-delta":return y(n,t);case"text-end":return M(n,t);case"reasoning-start":return d(n,t.id,t.providerMetadata);case"reasoning-delta":return f(n,t);case"reasoning-end":return m(n,t);case"tool-input-start":return R(n,t);case"tool-input-delta":return I(n,t);case"tool-input-end":return x(n,t);case"tool-call":return h(n,t);case"tool-result":return r(n,P(t));case"model-fallback":return k(n,t);default:return n}},wm=(e)=>e.finishReason===void 0?void 0:new dc({message:e.message,events:[...e.events],usage:e.usage,finishReason:e.finishReason}),sT=(e)=>i.encode(JSON.stringify({message:e.message,finishReason:e.finishReason,usage:e.usage})),iT=(e)=>wm(e.reduce(vm,Em()));
|
|
3
3
|
export{Em,vm,wm,sT,iT};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{rn,de}from"./plugin-
|
|
2
|
+
import{rn,de}from"./plugin-3t0qp574.js";import{y,c}from"./plugin-xfcgt5ba.js";var n=(e)=>new de({module:"Images",method:"generate",reason:new rn({message:e})}),gw=(e,t)=>{if(t.prompt.trim()==="")return"The picture needs a prompt.";if(t.images.length>e.inputs)return e.inputs===0?`${e.label} draws from a prompt alone and takes no input images.`:`${e.label} takes at most ${e.inputs} input images, not ${t.images.length}.`;let r=t.images.find((a)=>!e.inputTypes.includes(a.mediaType));if(r!==void 0)return`${e.label} takes ${e.inputTypes.join(", ")} images, not ${r.mediaType}.`;if(t.transparent&&!e.transparent)return`${e.label} draws no transparent background.`;return null},Lg=(e,t)=>{let r=gw(e,t);return r===null?y:c(n(r))};
|
|
3
3
|
export{gw,Lg};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Sr,ut,Ry,sd,Oa,Pa,zf}from"./plugin-
|
|
2
|
+
import{Sr,ut,Ry,sd,Oa,Pa,zf}from"./plugin-q6pvb1xf.js";import{rd,Ut}from"./plugin-7te9b50h.js";import{Os,Mm,dn}from"./plugin-yp736z4n.js";import{Ps}from"./plugin-g7hrtg2p.js";import{n,ce,t,S,z,o,ge,x,O,P,Kr,zp,Ke}from"./plugin-xfcgt5ba.js";class ln extends Ke("LLM.Usage")({inputTokens:n(S),outputTokens:n(S),nonCachedInputTokens:n(S),cacheReadInputTokens:n(S),cacheWriteInputTokens:n(S),reasoningTokens:n(S),totalTokens:n(S),providerMetadata:n(ut)}){get visibleOutputTokens(){return Math.max(0,(this.outputTokens??0)-(this.reasoningTokens??0))}static from(e){return e instanceof ln?e:new ln(e)}}function PT(e,r){if(!e)return r?ln.from(r):new ln({});if(!r)return ln.from(e);let p=(l,s)=>l===void 0&&s===void 0?void 0:(l??0)+(s??0);return new ln({inputTokens:p(e.inputTokens,r.inputTokens),outputTokens:p(e.outputTokens,r.outputTokens),nonCachedInputTokens:p(e.nonCachedInputTokens,r.nonCachedInputTokens),cacheReadInputTokens:p(e.cacheReadInputTokens,r.cacheReadInputTokens),cacheWriteInputTokens:p(e.cacheWriteInputTokens,r.cacheWriteInputTokens),reasoningTokens:p(e.reasoningTokens,r.reasoningTokens),totalTokens:p(e.totalTokens,r.totalTokens),providerMetadata:r.providerMetadata??e.providerMetadata})}class lc extends Ke("LLM.InputUsage")({inputTokens:S,nonCachedInputTokens:n(S),cacheReadInputTokens:n(S),cacheWriteInputTokens:n(S),providerMetadata:n(ut)}){static from(e){return e instanceof lc?e:new lc(e)}}var iv=o({type:P("step-start"),index:S,origin:n(Ut)}).annotate({identifier:"LLM.Event.StepStart"}),av=o({type:P("input-usage"),inputUsage:lc,messageId:n(t)}).annotate({identifier:"LLM.Event.InputUsage"}),cv=o({type:P("text-start"),id:Oa,providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.TextStart"}),uv=o({type:P("text-delta"),id:Oa,text:t,providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.TextDelta"}),lv=o({type:P("text-end"),id:Oa,providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.TextEnd"}),dv=o({type:P("reasoning-start"),id:Oa,providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.ReasoningStart"}),fv=o({type:P("reasoning-delta"),id:Oa,text:t,providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.ReasoningDelta"}),pv=o({type:P("reasoning-end"),id:Oa,providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.ReasoningEnd"}),mv=o({type:P("tool-input-start"),id:Pa,name:t,providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.ToolInputStart"}),hv=o({type:P("tool-input-delta"),id:Pa,name:t,text:t}).annotate({identifier:"LLM.Event.ToolInputDelta"}),gv=o({type:P("tool-input-end"),id:Pa,name:t,providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.ToolInputEnd"}),yv=o({type:P("tool-call"),id:Pa,name:t,input:ce,unparsed:n(t),providerExecuted:n(z),providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.ToolCall"}),xv=o({type:P("tool-result"),id:Pa,name:t,result:Os,output:n(Mm),providerExecuted:n(z),providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.ToolResult"}),Sv=o({type:P("tool-error"),id:Pa,name:t,message:t,error:n(zp()),providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.ToolError"}),bv=o({type:P("model-fallback"),from:Ut,to:Ut,trigger:Sr,providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.ModelFallback"}),Ev=o({type:P("step-finish"),index:S,reason:zf,usage:n(ln),quota:n(Ps),requestId:n(t),native:n(Sr),providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.StepFinish"}),vv=o({type:P("finish"),reason:zf,usage:n(ln),providerMetadata:n(ut)}).annotate({identifier:"LLM.Event.Finish"}),i=O([iv,av,cv,uv,lv,dv,fv,pv,mv,hv,gv,yv,xv,Sv,bv,Ev,vv]).pipe(Kr("type")),d=(e)=>Oa.make(e),u=(e)=>Pa.make(e),we=Object.assign(i,{stepStart:iv.make,inputUsage:(e)=>av.make({type:"input-usage",inputUsage:lc.from(e.inputUsage),messageId:e.messageId}),textStart:(e)=>cv.make({...e,id:d(e.id)}),textDelta:(e)=>uv.make({...e,id:d(e.id)}),textEnd:(e)=>lv.make({...e,id:d(e.id)}),reasoningStart:(e)=>dv.make({...e,id:d(e.id)}),reasoningDelta:(e)=>fv.make({...e,id:d(e.id)}),reasoningEnd:(e)=>pv.make({...e,id:d(e.id)}),toolInputStart:(e)=>mv.make({...e,id:u(e.id)}),toolInputDelta:(e)=>hv.make({...e,id:u(e.id)}),toolInputEnd:(e)=>gv.make({...e,id:u(e.id)}),toolCall:(e)=>yv.make({...e,id:u(e.id)}),toolResult:(e)=>xv.make({...e,id:u(e.id),output:e.output===void 0?void 0:Mm.from(e.output.structured,e.output.content)}),toolError:(e)=>Sv.make({...e,id:u(e.id)}),modelFallback:bv.make,stepFinish:(e)=>Ev.make({...e,usage:e.usage===void 0?void 0:ln.from(e.usage)}),finish:(e)=>vv.make({...e,usage:e.usage===void 0?void 0:ln.from(e.usage)}),is:{stepStart:i.guards["step-start"],inputUsage:i.guards["input-usage"],textStart:i.guards["text-start"],textDelta:i.guards["text-delta"],textEnd:i.guards["text-end"],reasoningStart:i.guards["reasoning-start"],reasoningDelta:i.guards["reasoning-delta"],reasoningEnd:i.guards["reasoning-end"],toolInputStart:i.guards["tool-input-start"],toolInputDelta:i.guards["tool-input-delta"],toolInputEnd:i.guards["tool-input-end"],toolCall:i.guards["tool-call"],toolResult:i.guards["tool-result"],toolError:i.guards["tool-error"],modelFallback:i.guards["model-fallback"],stepFinish:i.guards["step-finish"],finish:i.guards.finish}});class Am extends Ke("LLM.PreparedRequest")({id:t,route:sd,protocol:Ry,model:rd,body:ce,metadata:n(ge(t,ce))}){}var c=(e,r,p)=>{let l=[],s=0;for(let a of e)if(a.type==="text-delta"&&r==="text"||a.type==="reasoning-delta"&&r==="reasoning")l.push(a.text),s+=a.text.length;for(let a of p?.content??[]){if(a.type!=="text"&&a.type!=="reasoning"||a.type!==r||a.text.length!==s)continue;let g=0;for(let m of l){if(!a.text.startsWith(m,g))break;g+=m.length}if(g===s)return a.text;break}return l.join("")},T=(e)=>e.reduce((r,p)=>("usage"in p)&&p.usage!==void 0?p.usage:r,void 0);class dc extends Ke("LLM.Response")({message:dn,events:x(we),usage:n(ln),finishReason:zf}){get text(){return c(this.events,"text",this.message)}get reasoning(){return c(this.events,"reasoning",this.message)}get toolCalls(){return this.events.filter(we.is.toolCall)}}((s)=>(s.text=(a)=>c(a.events,"text",a instanceof dc?a.message:void 0),s.usage=(a)=>a.usage??T(a.events),s.toolCalls=(a)=>a.events.filter(we.is.toolCall),s.reasoning=(a)=>c(a.events,"reasoning",a instanceof dc?a.message:void 0)))(dc||={});
|
|
3
3
|
export{ln,PT,lc,iv,av,cv,uv,lv,dv,fv,pv,mv,hv,gv,yv,xv,Sv,bv,Ev,vv,we,Am,dc};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{de}from"./plugin-
|
|
2
|
+
import{de}from"./plugin-3t0qp574.js";import{we}from"./plugin-24j9hnc7.js";import{Et,ay}from"./plugin-y9cdpmbv.js";var Hi=()=>({}),u=(e,t,n)=>(e[t]=n,e),K=(e,t)=>(delete e[t],e),l=(e)=>we.toolInputStart({id:e.id,name:e.name,providerMetadata:e.providerMetadata}),c=(e,t)=>we.toolInputDelta({id:e.id,name:e.name,text:t}),y=(e,t)=>{let{input:n,unparsed:r}=ay(t??e.input.join(""));return we.toolCall({id:e.id,name:e.name,input:n,unparsed:r,providerExecuted:e.providerExecuted?!0:void 0,providerMetadata:e.providerMetadata})},s=(e,t)=>[we.toolInputEnd({id:e.id,name:e.name,providerMetadata:e.providerMetadata}),y(e,t)],m=(e,t,n,r)=>{let o=[];if(!e[t])o.push(l(n));if(r.length>0)o.push(c(n,r));return{tools:u(e,t,n),tool:n,events:o}},wa=(e)=>e instanceof de,hu=(e,t,n)=>u(e,t,{...n,input:n.input?[n.input]:[]}),Bg=(e,t,n,r,o)=>{let a=t[n],i=r.id??a?.id,d=r.name??a?.name;if(!i||!d)return Et(void 0,{route:e,message:o,family:"invalid-output"});if(a&&r.text.length===0&&a.id===i&&a.name===d)return{tools:t,tool:a,events:[]};let p={id:i,name:d,input:a?.input??[],providerExecuted:a?.providerExecuted,providerMetadata:a?.providerMetadata};if(r.text.length>0)p.input.push(r.text);return m(t,n,p,r.text)},$l=(e,t,n,r,o)=>{let a=t[n];if(!a)return Et(void 0,{route:e,message:o,family:"invalid-output"});if(r.length===0)return{tools:t,tool:a,events:[]};return a.input.push(r),m(t,n,a,r)},Nl=(e,t)=>{let n=e[t];if(!n)return{tools:e};return{tools:K(e,t),events:s(n)}},Wg=(e,t,n)=>{let r=e[t];if(!r)return{tools:e};return{tools:K(e,t),events:s(r,n)}},Ll=(e)=>({tools:Hi(),events:Object.values(e).flatMap((t)=>t===void 0?[]:s(t))});
|
|
3
3
|
export{Hi,wa,hu,Bg,$l,Nl,Wg,Ll};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Hg}from"./plugin-
|
|
2
|
+
import{Hg}from"./plugin-dsjq4tye.js";import{Dl,di}from"./plugin-9gha9fx3.js";import{n,t,o}from"./plugin-xfcgt5ba.js";var rf="openai",ac="openai-oauth",Aw="codex",u={buckets:[{gap:"<1m",warmShare:0.94,sample:210},{gap:"1\u20135m",warmShare:0.93,sample:206},{gap:"5\u201315m",warmShare:0.86,sample:97},{gap:"15\u201330m",warmShare:0.79,sample:29},{gap:"30\u201360m",warmShare:0.74,sample:23},{gap:"1\u20132h",warmShare:0.36,sample:11},{gap:">2h",warmShare:0,sample:12}],measuredBy:"operator installation",measuredAt:"2026-09-10"},mu="gpt-5.6-terra",OE="gpt-6.1-sol",c={bytes:52428800,media:500},i={context:1050000,input:922000,output:128000},a={context:872000,input:744000,output:128000},d={context:272000,input:144000,output:128000},e=["low","medium","high","xhigh","max"],h=["low","medium","high","xhigh"],p=(m)=>[{id:"serviceTier",label:"Fast",description:m,values:[{id:"standard",label:"Standard"},{id:"priority",label:"Fast"}],default:null,icon:Dl}],s=p("1.5x speed, increased usage"),T=p("2x speed, increased usage"),r=p("1.5x speed"),_=p("Faster, increased usage"),l={"gpt-6-astra":{label:"GPT-6 Astra",short:"Astra",capacity:a,capabilities:["text","vision"],reasoning:e,defaultReasoning:"high",switches:T},"gpt-6.1-sol":{label:"GPT-6.1 Sol",short:"Sol 6.1",capacity:i,capabilities:["text","vision"],reasoning:e,defaultReasoning:"high"},"gpt-6.1-terra":{label:"GPT-6.1 Terra",short:"Terra 6.1",capacity:i,capabilities:["text","vision"],reasoning:["none","low","medium","high","xhigh","max"],defaultReasoning:"medium"},"gpt-6-sol":{label:"GPT-6 Sol",short:"Sol",capacity:i,capabilities:["text","vision"],reasoning:["none","low","medium","high","xhigh","max"],defaultReasoning:"high"},"gpt-6-luna":{label:"GPT-6 Luna",short:"Luna",capacity:i,capabilities:["text","vision"],reasoning:["none","low","medium","high","xhigh","max"],defaultReasoning:"high"},"gpt-5.6-sol":{label:"GPT-5.6 Sol",short:"Sol 5.6",capacity:i,capabilities:["text","vision"],reasoning:["none","low","medium","high","xhigh","max"],defaultReasoning:"high"},[mu]:{label:"GPT-5.6 Terra",short:"Terra",capacity:i,capabilities:["text","vision"],reasoning:["none","low","medium","high","xhigh","max"],defaultReasoning:"high"},"gpt-5.6-luna":{label:"GPT-5.6 Luna",short:"Luna 5.6",capacity:i,capabilities:["text","vision"],reasoning:["none","low","medium","high","xhigh","max"],defaultReasoning:"high"},"gpt-5.5":{label:"GPT-5.5",short:"5.5",capacity:i,capabilities:["text","vision"],reasoning:["none","low","medium","high","xhigh"],defaultReasoning:"high"}},g=[{model:"gpt-6.1-sol",reasoning:"high",open:7,depth:7,taste:6,ui:6,spend:4},{model:"gpt-6.1-sol",reasoning:"xhigh",open:8,depth:8,taste:7,ui:6,spend:6},{model:"gpt-6.1-sol",reasoning:"max",open:8,depth:10,taste:7,ui:6,spend:8},{model:"gpt-6.1-terra",reasoning:"xhigh",open:6,depth:7,taste:6,ui:6,spend:3},{model:"gpt-6.1-terra",reasoning:"max",open:7,depth:8,taste:7,ui:6,spend:5},{model:"gpt-6-luna",reasoning:"medium",open:2,depth:3,taste:3,ui:2,spend:1,only:["research","fix"],note:"lookups and small edits"},{model:"gpt-6-astra",reasoning:"high",open:9,depth:9,taste:8,ui:7,spend:10,operatorOnly:!0}],lm={id:rf,label:"OpenAI",auth:"api-key",models:di(l,{ids:["gpt-6.1-sol","gpt-6.1-terra","gpt-6-sol","gpt-6-luna","gpt-5.6-sol",mu,"gpt-5.6-luna","gpt-5.5"]}),cacheLifetime:{promisedSeconds:null,prior:null},requestLimits:c,defaultTextModel:mu,lightTextModel:{model:"gpt-6-luna",rung:"none"},team:g},Mw="gpt-image-2",x={[Mw]:{label:"GPT Image 2",inputs:5,inputTypes:["image/png","image/jpeg","image/webp"],transparent:!0}},of={id:ac,label:"ChatGPT",auth:"oauth",imageModels:x,models:di(l,{ids:["gpt-6-astra",OE,"gpt-6.1-terra","gpt-6-sol","gpt-6-luna","gpt-5.6-sol",mu,"gpt-5.6-luna","gpt-5.5"],overrides:{"gpt-6.1-sol":{capacity:a,reasoning:e,switches:_},"gpt-6.1-terra":{capacity:a,reasoning:e,defaultReasoning:"low",switches:r},"gpt-6-sol":{capacity:a,reasoning:e,switches:r},"gpt-6-luna":{capacity:a,reasoning:e,switches:r},"gpt-5.6-sol":{capacity:a,reasoning:e,switches:s},[mu]:{capacity:a,reasoning:e,switches:s},"gpt-5.6-luna":{capacity:a,reasoning:e,switches:s},"gpt-5.5":{capacity:d,reasoning:h,switches:s}}}),cacheLifetime:{promisedSeconds:null,prior:u},requestLimits:c,defaultTextModel:OE,lightTextModel:{model:"gpt-6-luna",rung:"low"},team:g},Ug="gpt-6-astra",Ow={id:Aw,label:"Codex",auth:"cli",models:di(l,{ids:[Ug,"gpt-6.1-sol","gpt-6.1-terra","gpt-6-sol","gpt-6-luna","gpt-5.6-sol",mu,"gpt-5.6-luna","gpt-5.5"],overrides:{[Ug]:{switches:[]},"gpt-6.1-sol":{capacity:a,reasoning:e},"gpt-6.1-terra":{capacity:a,reasoning:e,defaultReasoning:"low"},"gpt-6-sol":{capacity:a,reasoning:e},"gpt-6-luna":{capacity:a,reasoning:e},"gpt-5.6-sol":{capacity:a,reasoning:e},[mu]:{capacity:a,reasoning:e},"gpt-5.6-luna":{capacity:a,reasoning:e},"gpt-5.5":{capacity:d,reasoning:h}}}),cacheLifetime:{promisedSeconds:null,prior:null},defaultTextModel:Ug,lightTextModel:{model:"gpt-6-luna",rung:"low"},team:g},zg=o({...Hg,accountId:n(t)}),j_={providers:[of,lm,Ow]};
|
|
3
3
|
export{rf,ac,Aw,mu,OE,lm,Mw,of,Ug,Ow,zg,j_};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ut,sd,Au,qs}from"./plugin-
|
|
2
|
+
import{ut,sd,Au,qs}from"./plugin-q6pvb1xf.js";import{F,r,n,w,t,S,z,o,ge,x,O,W,qh,P,Kr,Ke}from"./plugin-xfcgt5ba.js";var Yk=w("context-overflow"),kv=W(["dns","tls","reset","connect-timeout","unknown"]),_v=O([W(["invalid-request","no-route","auth","rate-limit","quota","content-policy","overloaded","refused","torn-stream","non-json-answer","socket-closed","clean-eof-no-finish","blank-error","invalid-output","stalled"]),kv]),u=new Set(["rate-limit","overloaded","torn-stream","socket-closed","clean-eof-no-finish","blank-error","dns","tls","reset","connect-timeout","unknown"]),Bm=(e)=>u.has(e),dy=o({tag:t,message:t,code:n(t)}),Tv=o({type:n(t),count:S}),Af={status:n(S),upstreamRequestId:n(t),attempt:n(S),bytesRead:n(S),elapsedMs:n(S),lastEvent:n(Tv)},Mf=5,Eu=2048;class Of extends Ke("LLM.HttpRequestDetails")({method:t,url:t,headers:ge(t,t)}){}class Pf extends Ke("LLM.HttpResponseDetails")({status:S,headers:ge(t,t)}){}var $f=o({retryAfterMs:n(S),limit:n(ge(t,t)),remaining:n(ge(t,t)),reset:n(ge(t,t))});class ms extends Ke("LLM.HttpContext")({request:Of,response:n(Pf),body:n(t),bodyTruncated:n(z),bodyUnreadable:n(t),requestId:n(t),rateLimit:n($f)}){}class rn extends Ke("LLM.Error.InvalidRequest")({_tag:P("InvalidRequest"),message:t,parameter:n(t),classification:n(Yk),providerMetadata:n(ut),http:n(ms),...Af}){get family(){return"invalid-request"}}class Rv extends Ke("LLM.Error.NoRoute")({_tag:P("NoRoute"),route:sd,provider:qs,model:Au}){get family(){return"no-route"}get message(){return`No LLM route for ${this.provider}/${this.model} using ${this.route}`}}class Iv extends Ke("LLM.Error.NotInstalled")({_tag:P("NotInstalled"),provider:qs}){get family(){return"no-route"}get message(){return`No installed adapter provides ${this.provider}; install it to call its models.`}}class Cv extends Ke("LLM.Error.AdapterFailed")({_tag:P("AdapterFailed"),provider:qs,detail:t}){get family(){return"refused"}get message(){return`The adapter providing ${this.provider} failed to load: ${this.detail}`}}class kr extends Ke("LLM.Error.Authentication")({_tag:P("Authentication"),message:t,kind:W(["missing","invalid","expired","insufficient-permissions","unknown"]),providerMetadata:n(ut),http:n(ms)}){get family(){return"auth"}}class Vl extends Ke("LLM.Error.RateLimit")({_tag:P("RateLimit"),message:t,retryAfterMs:n(S),rateLimit:n($f),providerMetadata:n(ut),http:n(ms)}){get family(){return"rate-limit"}}class Zl extends Ke("LLM.Error.QuotaExceeded")({_tag:P("QuotaExceeded"),message:t,resetsAt:n(S),providerMetadata:n(ut),http:n(ms)}){get family(){return"quota"}}class fy extends Ke("LLM.Error.ContentPolicy")({_tag:P("ContentPolicy"),message:t,providerMetadata:n(ut),http:n(ms)}){get family(){return"content-policy"}}class Bi extends Ke("LLM.Error.ProviderInternal")({_tag:P("ProviderInternal"),message:t,retryAfterMs:n(S),modelStarted:n(z),providerMetadata:n(ut),http:n(ms),...Af}){get family(){return"overloaded"}}class mc extends Ke("LLM.Error.Transport")({_tag:P("Transport"),message:t,kind:kv.pipe(qh(r("unknown"))),host:n(t),attempt:n(S),elapsedMs:n(S),cause:n(x(dy)),http:n(ms)}){get family(){return this.kind}}class hc extends Ke("LLM.Error.StreamStalled")({_tag:P("StreamStalled"),message:t,idleMs:S,url:n(t),...Af}){get family(){return"stalled"}}class Aa extends Ke("LLM.Error.InvalidProviderOutput")({_tag:P("InvalidProviderOutput"),message:t,family:_v.pipe(qh(r("invalid-output"))),route:n(t),excerpt:n(t),...Af,cause:n(x(dy)),providerMetadata:n(ut)}){}class vu extends Ke("LLM.Error.UnknownProvider")({_tag:P("UnknownProvider"),message:t,modelStarted:n(z),providerMetadata:n(ut),http:n(ms),...Af}){get family(){return"refused"}}var GT=O([rn,Rv,Iv,Cv,kr,Vl,Zl,fy,Bi,mc,hc,Aa,vu]).pipe(Kr("_tag")),l=(e)=>typeof e==="string"&&e.trim()!==""?e.trim():void 0,Av=(e)=>{if(e===void 0||!e.trimStart().startsWith("{"))return{};let a;try{a=JSON.parse(e)}catch(s){if(s instanceof SyntaxError)return{};throw s}if(typeof a!=="object"||a===null)return{};let i=a,d=typeof i.error==="object"&&i.error!==null?i.error:void 0;return{message:l(d?.message)??l(i.message)??l(i.error)??l(i.error_description),code:l(d?.code)??l(i.code)}},py=(e)=>{let a=e.http?.body??"";if(/content[-_\s]?policy|content_filter|safety/i.test(a))return new fy({message:e.message,http:e.http});if(e.status===401){let i=Av(e.http?.body),d=/expired/i.test(i.code??"");return new kr({message:e.message,kind:d?"expired":"invalid",http:e.http})}if(e.status===403)return new kr({message:e.message,kind:"insufficient-permissions",http:e.http});if(e.status===429){if(/insufficient[-_\s]?quota|quota[-_\s]?exceeded|usage[-_\s]?limit[-_\s]?reached/i.test(a))return new Zl({message:e.message,http:e.http});return new Vl({message:e.message,retryAfterMs:e.retryAfterMs,rateLimit:e.rateLimit,http:e.http})}if(e.status===400||e.status===404||e.status===409||e.status===413||e.status===422)return new rn({message:e.message,classification:e.classification,http:e.http});if(e.status>=500)return new Bi({message:e.message,status:e.status,retryAfterMs:e.retryAfterMs,http:e.http});return new vu({message:e.message,status:e.status,http:e.http})};class de extends F("LLM.Error"){cause=this.reason;get family(){return this.reason.family}get retryable(){return Bm(this.family)}get retryAfterMs(){return"retryAfterMs"in this.reason?this.reason.retryAfterMs:void 0}get modelStarted(){return"modelStarted"in this.reason?this.reason.modelStarted:void 0}get status(){if("status"in this.reason&&typeof this.reason.status==="number")return this.reason.status;return"http"in this.reason?this.reason.http?.response?.status:void 0}get detail(){let e="excerpt"in this.reason?this.reason.excerpt:void 0,a=("cause"in this.reason?this.reason.cause??[]:[]).map((s)=>`${s.tag}${s.code===void 0?"":` [${s.code}]`}: ${s.message}`);if(e!==void 0||a.length>0)return[e,...a].filter((s)=>s!==void 0&&s!=="").join(" \xB7 ");if(!("http"in this.reason)||this.reason.http===void 0)return;let i=this.reason.http,d=i.response?.status;return[d===void 0?void 0:`HTTP ${d}`,i.requestId,i.body].filter((s)=>s!==void 0&&s!=="").join(" \xB7 ")}get message(){return`${this.module}.${this.method}: ${this.reason.message}`}}var JT=o({family:_v,status:n(S),upstreamRequestId:n(t),attempt:n(S),elapsedMs:n(S),bytesRead:n(S),lastEvent:n(Tv),excerpt:n(t),idleMs:n(S),host:n(t),cause:n(x(dy)),kind:n(t),said:n(t)}),KT=(e)=>{let a=e.reason,i="http"in a?a.http:void 0,d=("upstreamRequestId"in a?a.upstreamRequestId:void 0)??i?.requestId,s="cause"in a?a.cause:void 0;return{family:e.family,status:e.status,upstreamRequestId:d,attempt:"attempt"in a?a.attempt:void 0,elapsedMs:"elapsedMs"in a?a.elapsedMs:void 0,bytesRead:"bytesRead"in a?a.bytesRead:void 0,lastEvent:"lastEvent"in a?a.lastEvent:void 0,excerpt:"excerpt"in a?a.excerpt:void 0,idleMs:"idleMs"in a?a.idleMs:void 0,host:"host"in a?a.host:void 0,cause:s===void 0||s.length===0?void 0:s,kind:"kind"in a?a.kind:void 0,said:Av(i?.body).message}};class Xk extends F("LLM.ToolFailure"){}
|
|
3
3
|
export{Yk,kv,_v,Bm,dy,Tv,Af,Mf,Eu,Of,Pf,$f,ms,rn,Rv,Iv,Cv,kr,Vl,Zl,fy,Bi,mc,hc,Aa,vu,GT,Av,py,de,JT,KT,Xk};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Uf}from"./plugin-
|
|
2
|
+
import{Uf}from"./plugin-7te9b50h.js";import{ht}from"./plugin-xfcgt5ba.js";var o=new WeakMap,Ao=(e)=>o.get(e)??(Symbol.iterator in e?Array.from(e,([r])=>r):Object.keys(e)),Pt=(e,r)=>{let t=ht(e),n=Uf(t,Ao(e));return o.set(t,Object.keys(Uf(n,r))),t},my=(e)=>Uf(e,Ao(e));
|
|
3
3
|
export{Ao,Pt,my};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{od,Vi}from"./plugin-72xxqm1t.js";import{mc,de}from"./plugin-
|
|
2
|
+
import{od,Vi}from"./plugin-72xxqm1t.js";import{mc,de}from"./plugin-3t0qp574.js";import{Su,Et,xt}from"./plugin-y9cdpmbv.js";import{ny}from"./plugin-7xmwhj5h.js";import{oe,Dc,Mt,d,y,pr,f,c,Ze,s,Te,dt,v,ee,bl,El,ks,rc,vo,Qn,Fi,Ot,un}from"./plugin-xfcgt5ba.js";class xf extends oe()("@runlith/llm/WebSocketTransport"){}var g=(e,r,o)=>new de({module:"WebSocketExecutor",method:e,reason:new mc({message:r,kind:o.kind,host:o.url!==void 0&&URL.canParse(o.url)?new URL(o.url).host:void 0,cause:Su(o.cause)})}),S=(e)=>{if("message"in e&&typeof e.message==="string")return e.message;return e.type},m=(e)=>{if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return},h=(e,r)=>{if(e.readyState===globalThis.WebSocket.OPEN)return y;if(e.readyState===globalThis.WebSocket.CLOSING||e.readyState===globalThis.WebSocket.CLOSED)return c(g("open",`WebSocket closed before opening (state ${e.readyState})`,{url:r.url,kind:"reset"}));return pr((o,i)=>{let a=()=>{e.removeEventListener("open",u),e.removeEventListener("error",t),e.removeEventListener("close",n),i.removeEventListener("abort",l)},l=()=>{if(a(),e.readyState!==globalThis.WebSocket.CLOSED&&e.readyState!==globalThis.WebSocket.CLOSING)e.close(1000)},u=()=>{a(),o(y)},t=(p)=>{a(),o(c(g("open",`Failed to open WebSocket: ${S(p)}`,{url:r.url,kind:"unknown"})))},n=(p)=>{a(),o(c(g("open",`WebSocket closed before opening with code ${p.code}`,{url:r.url,kind:"reset"})))};e.addEventListener("open",u,{once:!0}),e.addEventListener("error",t,{once:!0}),e.addEventListener("close",n,{once:!0}),i.addEventListener("abort",l,{once:!0})})},k=(e)=>Ze({try:()=>{let r=new URL(e);if(r.protocol==="https:")return r.protocol="wss:",r.toString();if(r.protocol==="http:")return r.protocol="ws:",r.toString();throw Error(`Unsupported WebSocket URL protocol ${r.protocol}`)},catch:(r)=>xt(r instanceof Error?r.message:`A WebSocket deployment cannot be reached at ${e}`)}),E=(e)=>Ze({try:()=>new globalThis.WebSocket(e.url,{headers:e.headers}),catch:(r)=>g("open",r instanceof Error?r.message:"Failed to construct WebSocket",{url:e.url,kind:"unknown",cause:r})}).pipe(s((r)=>L(r,e))),A=Mt(xf,xf.of({open:E})),L=ee("WebSocket.connect")(function*(e,r){yield*h(e,r);let o=yield*bl(128),i=(t)=>{if(typeof t.data==="string")return El(o,t.data);let n=m(t.data);if(n)return El(o,n);ks(o,Dc(Et(void 0,{module:"WebSocketExecutor",method:"message",route:r.url,message:"The peer sent a message payload this transport cannot read",family:"invalid-output"})))},a=(t)=>{ks(o,Dc(Et(void 0,{module:"WebSocketExecutor",method:"message",route:r.url,message:`The socket errored: ${S(t)}`,family:"socket-closed"})))},l=(t)=>{if(t.code===1000||t.code===1005)return rc(o);ks(o,Dc(Et(void 0,{module:"WebSocketExecutor",method:"message",route:r.url,message:`The peer closed the socket with code ${t.code}`,family:"socket-closed",excerpt:t.reason===""?void 0:t.reason})))},u=d(()=>{e.removeEventListener("message",i),e.removeEventListener("error",a),e.removeEventListener("close",l)}).pipe(Te(vo(o)));return e.addEventListener("message",i),e.addEventListener("error",a),e.addEventListener("close",l),{sendText:(t)=>Ze({try:()=>e.send(t),catch:(n)=>g("sendText",n instanceof Error?n.message:"Failed to send WebSocket message",{url:r.url,kind:"reset",cause:n})}),messages:Fi(o),close:u.pipe(Te(d(()=>{if(e.readyState===globalThis.WebSocket.CLOSED||e.readyState===globalThis.WebSocket.CLOSING)return;e.close(1000)})))}}),W=(e,r)=>typeof e==="string"?e:r.decode(e),b=(e)=>({id:"websocket-json",with:(r)=>b({...e,...r}),prepare:v(function*(r){let o=yield*ny({...r});return{url:yield*k(o.url),headers:o.headers,message:e.encodeMessage(yield*e.toMessage(o.jsonBody))}}),frames:(r,o,i,a,l)=>{let u=i.webSocket;if(!u)return Qn(xt("A WebSocket JSON transport requires the WebSocketTransport service"));let t=new TextDecoder;return Ot(f(function*(){l.secrets=new Set([...Vi(Object.entries(r.headers)),...Vi(new URL(r.url).searchParams,od)]);let n=yield*dt(u.open({url:r.url,headers:r.headers}),(p)=>p.close);return yield*n.sendText(r.message),n.messages.pipe(un((p)=>W(p,t)))}))}}),XE={id:"websocket-json",with:b};
|
|
3
3
|
export{xf,XE};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{N}from"./plugin-me00x60n.js";import{Au,qs,Ou}from"./plugin-
|
|
2
|
+
import{N}from"./plugin-me00x60n.js";import{Au,qs,Ou}from"./plugin-q6pvb1xf.js";import{Je,n,w,ce,t,S,z,o,ge,x,O,W,Ke}from"./plugin-xfcgt5ba.js";var Ql=(...e)=>{let i=e.filter((d)=>d!==void 0),r=i.length===1?i[0]:void 0;if(i.length===0)return;if(r&&Object.values(r).every((d)=>d!==void 0))return r;let a={};for(let d of i)for(let[s,l]of Object.entries(d)){if(l===void 0)continue;a[s]=N(a[s])&&N(l)?Ql(a[s],l):l}return Object.keys(a).length===0?void 0:a},c=(...e)=>{let i=e.filter((a)=>a!==void 0);if(i.length===0)return;if(i.length===1)return i[0];let r=Object.fromEntries(i.flatMap((a)=>Object.entries(a).filter((d)=>d[1]!==void 0)));return Object.keys(r).length===0?void 0:r},Xm=ge(t,ge(t,ce)),Yl=(...e)=>{let i={};for(let r of e){if(!r)continue;for(let[a,d]of Object.entries(r)){let s=Ql(i[a],d);if(s)i[a]=s}}return Object.keys(i).length===0?void 0:i};class Oo extends Ke("LLM.HttpOptions")({body:n(Ou),headers:n(ge(t,t)),headerOrder:n(x(t)),query:n(ge(t,t))}){}var Uf=(e,i)=>{let r=new Map(Object.entries(e).map(([d,s])=>[d.toLowerCase(),{name:d,value:s}])),a={};for(let d of i??[]){let s=d.toLowerCase(),l=r.get(s);if(l===void 0)continue;a[d]=l.value,r.delete(s)}for(let{name:d,value:s}of r.values())a[d]=s;return a};((i)=>i.make=(r)=>r instanceof Oo?r:new Oo(r))(Oo||={});var Xl=(...e)=>{let i=Ql(...e.map((s)=>s?.body)),r=c(...e.map((s)=>s?.headers)),a=c(...e.map((s)=>s?.query)),d=e.findLast((s)=>s?.headerOrder!==void 0)?.headerOrder;if(!i&&!r&&!a&&d===void 0)return;return new Oo({body:i,headers:r,query:a,headerOrder:d})};class Ur extends Ke("LLM.GenerationOptions")({maxTokens:n(S),temperature:n(S),topP:n(S),topK:n(S),frequencyPenalty:n(S),presencePenalty:n(S),seed:n(S),stop:n(x(t))}){}((i)=>i.make=(r={})=>r instanceof Ur?r:new Ur(r))(Ur||={});var p=(e,i)=>e.findLast((r)=>r?.[i]!==void 0)?.[i],ed=(...e)=>{let i=new Ur({maxTokens:p(e,"maxTokens"),temperature:p(e,"temperature"),topP:p(e,"topP"),topK:p(e,"topK"),frequencyPenalty:p(e,"frequencyPenalty"),presencePenalty:p(e,"presencePenalty"),seed:p(e,"seed"),stop:p(e,"stop")});return Object.values(i).some((r)=>r!==void 0)?i:void 0};class Wi extends Ke("LLM.ModelLimits")({context:n(S),output:n(S)}){}((i)=>i.make=(r)=>r instanceof Wi?r:new Wi(r??{}))(Wi||={});class td extends Ke("LLM.ModelDefaults")({limits:n(Wi),generation:n(Ur),providerOptions:n(Xm),http:n(Oo)}){}((i)=>i.make=(r)=>{if(r instanceof td)return r;return new td({limits:r.limits===void 0?void 0:Wi.make(r.limits),generation:r.generation===void 0?void 0:Ur.make(r.generation),providerOptions:r.providerOptions,http:r.http===void 0?void 0:Oo.make(r.http)})})(td||={});var eh=W(["auto","none","required","tool"]),r_=Je((e)=>typeof e==="function",{expected:"LLM.ToolSchemaDialect"}),o_=W(["required"]);class nd extends Ke("LLM.ModelCompatibility")({toolSchema:n(r_),toolChoice:n(x(eh)),reasoningEcho:n(o_)}){}((i)=>i.make=(r)=>r instanceof nd?r:new nd(r))(nd||={});class Sc{id;provider;route;defaults;compatibility;constructor(e){this.id=e.id,this.provider=e.provider,this.route=e.route,this.defaults=e.defaults,this.compatibility=e.compatibility}static make(e){return new Sc({id:Au.make(e.id),provider:qs.make(e.provider),route:e.route,defaults:e.defaults===void 0?void 0:td.make(e.defaults),compatibility:e.compatibility===void 0?void 0:nd.make(e.compatibility)})}static input(e){return{id:e.id,provider:e.provider,route:e.route,defaults:e.defaults,compatibility:e.compatibility}}static update(e,i){if(Object.keys(i).length===0)return e;return Sc.make({...Sc.input(e),...i})}}var rd=Je((e)=>e instanceof Sc,{expected:"LLM.Model"});class Ut extends Ke("LLM.ModelIdentity")({provider:qs,model:Au}){}((r)=>(r.of=(a)=>new Ut({provider:a.provider,model:a.id}),r.same=(a,d)=>a!==void 0&&d!==void 0&&a.provider===d.provider&&a.model===d.model))(Ut||={});class gs extends Ke("LLM.CacheHint")({type:W(["ephemeral","persistent"]),ttlSeconds:n(S)}){}var s_=o({tools:n(z),system:n(z),messages:n(O([w("latest-message"),w("latest-assistant"),o({tail:S})])),ttlSeconds:n(S)}),_y=O([w("auto"),w("none"),s_]);
|
|
3
3
|
export{Ql,Xm,Yl,Oo,Uf,Xl,Ur,ed,Wi,td,eh,r_,o_,nd,Sc,rd,Ut,gs,s_,_y};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{N}from"./plugin-me00x60n.js";import{Ql}from"./plugin-
|
|
2
|
+
import{N}from"./plugin-me00x60n.js";import{Ql}from"./plugin-7te9b50h.js";import{Pt}from"./plugin-6vzw5yyr.js";import{xr,Et,xt,Ia}from"./plugin-y9cdpmbv.js";import{Co}from"./plugin-g4hst0jz.js";import{$m}from"./plugin-r7g3vqrm.js";import{_a,Rf,zl}from"./plugin-e5ybk2a2.js";import{Ms}from"./plugin-fjsmz1vy.js";import{ze,d,i,v,Qn,Ot,oc,mg}from"./plugin-xfcgt5ba.js";var rv=(e,t)=>({attempt:e,startedAt:t,status:void 0,upstreamRequestId:void 0,bytesRead:0,events:0,lastEventType:void 0,secrets:[]}),wf=(e)=>({type:e.lastEventType,count:e.events}),ov=(e,t)=>({status:e.status,upstreamRequestId:e.upstreamRequestId,attempt:e.attempt,bytesRead:e.bytesRead,elapsedMs:t-e.startedAt,lastEvent:wf(e)}),sv=(e,t)=>{e.events+=1,e.lastEventType=t};var u=(e,t)=>{if(!t)return e;let o=new URL(e);return Object.entries(t).forEach(([s,r])=>o.searchParams.set(s,r)),o.toString()},ty=(e)=>u($m(e.endpoint,{request:e.request,body:e.body}).toString(),e.request.http?.query),c=new Set(["content","contents","diagnostics","frequencyPenalty","frequency_penalty","generationConfig","inferenceConfig","input","maxTokens","max_tokens","messages","model","presencePenalty","presence_penalty","responseFormat","response_format","seed","stop","stopSequences","stop_sequences","stream","streamOptions","stream_options","system","systemInstruction","system_instruction","temperature","thinking","thread","toolChoice","toolConfig","tool_choice","tool_config","tools","topK","topP","top_k","top_p"]),f=(e)=>Object.keys(e).filter((t)=>c.has(t)),l=v(function*(e,t,o){if(t.http?.body===void 0)return{jsonBody:e,bodyText:o(e)};let s=f(t.http.body);if(s.length>0)return yield*xt(`http.body cannot overlay protocol-owned field(s): ${s.join(", ")}`);if(N(e)){let r=Ql(e,t.http.body)??{};return{jsonBody:r,bodyText:xr(r)}}return yield*xt("http.body can only overlay JSON object request bodies")}),ny=v(function*(e){let t=ty(e),o=yield*l(e.body,e.request,e.encodeBody),s=yield*Co(e.auth)({request:e.request,method:"POST",url:t,body:o.bodyText,headers:Pt({...e.headers?.({request:e.request}),...e.request.http?.headers})});return{url:t,jsonBody:o.jsonBody,bodyText:o.bodyText,headers:Pt(s,e.request.http?.headerOrder)}}),ry=(e,t,o,s,r,m)=>Ot(o.http.execute(e.request,s,m,{retry:t.model.route.retry?.open===void 0,rateLimits:t.model.route.rateLimits}).pipe(i((n)=>{let p=`${t.model.provider}/${t.model.route.id}`;return r.secrets=zl(e.request),r.status=n.status,r.upstreamRequestId=Rf(_a(n.headers)),e.framing.frame(n.stream.pipe(oc((a)=>d(()=>{r.bytesRead+=a.byteLength})),mg("HttpClientError",(a)=>Ot(i(ze,(y)=>Qn(Et(a,{route:p,message:`Failed to read the ${p} stream`,family:"torn-stream",status:r.status,upstreamRequestId:r.upstreamRequestId,attempt:r.attempt,bytesRead:r.bytesRead,elapsedMs:y-r.startedAt,lastEvent:wf(r),secrets:zl(e.request)})))))))}))),Cm=(e)=>({id:"http-json",with:(t)=>Cm({...e,...t}),prepare:(t)=>ny({...t}).pipe(i((o)=>({request:Ia({url:o.url,body:o.bodyText,headers:o.headers}),framing:e.framing}))),frames:ry}),kf={id:"http-json/sse",with:()=>Cm({framing:Ms})};
|
|
3
3
|
export{rv,wf,ov,sv,ty,ny,ry,Cm,kf};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Xn,Jg,ka,uc,gf,yf,Kg}from"./plugin-
|
|
2
|
+
import{Xn,Jg,ka,uc,gf,yf,Kg}from"./plugin-dqxdznvd.js";import{Gg,Fl}from"./plugin-0e34qaar.js";import{Ne,ze,d,pr,f,c,Ze,en,Wa,v,ee,n,t,o}from"./plugin-xfcgt5ba.js";function aT(e,r){return{accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:e.expiresAt,scope:e.scope||r?.scope||""}}var ik="urn:ietf:params:oauth:grant-type:device_code",m=5000,g=1000,ak=5000,k=300000,G=3000,D=o({access_token:n(t),refresh_token:n(t),id_token:n(t),expires_in:gf,scope:n(t)}),x=o({device_code:n(t),user_code:n(t),verification_uri:n(t),verification_uri_complete:n(t),expires_in:gf,interval:gf}),_=ee("DeviceGrant.postForm")(function*(e,r,i){return yield*Jg(f(function*(){let s=yield*Gg(r,e.headers(),new URLSearchParams(i).toString());return{response:s,text:s.text}}),`${e.label} token exchange`)}),km=ee("DeviceGrant.begin")(function*(e){let r={client_id:e.clientId,...e.scope?{scope:e.scope}:{}},{response:i,text:s}=yield*_(e,e.deviceAuthorizationUrl,r);if(!i.ok)return yield*new Xn({reason:`${e.label} device code request failed (${i.status}): ${ka(s.trim(),r)||i.statusText}`});let a=yield*Ze({try:()=>yf(x,s,`${e.label} device code response`,r),catch:uc});if(!a.device_code||!a.user_code||!a.verification_uri)return yield*new Xn({reason:`${e.label} device code response is missing device_code / user_code / verification_uri`});return{deviceCode:a.device_code,userCode:a.user_code,verificationUri:a.verification_uri,verificationUriComplete:a.verification_uri_complete,expiresAt:(yield*ze)+y(a.expires_in,k),intervalMs:Math.max(y(a.interval,m),g)}});function cT(e){return Fl(km(e))}var YE=ee("DeviceGrant.poll")(function*(e,r){let i={grant_type:ik,client_id:e.clientId,device_code:r.deviceCode},{response:s,text:a}=yield*_(e,e.tokenUrl,i);if(s.ok){let u=yield*Ze({try:()=>yf(D,a,`${e.label} token response`,i),catch:uc});return{status:"ready",tokens:yield*h(e,u)}}let l=Kg(a,i);if(l.error==="authorization_pending")return{status:"pending",slowDown:!1};if(l.error==="slow_down")return{status:"pending",slowDown:!0};if(l.error==="access_denied"||l.error==="authorization_denied")return yield*new Xn({reason:`${e.label} device authorization was denied`});if(l.error==="expired_token")return yield*new Xn({reason:`${e.label} device code expired \u2014 start the sign-in again`});let p=l.error_description??l.error??"";return yield*new Xn({reason:`${e.label} device token exchange failed (${s.status})${p?`: ${p}`:""}`})});function uT(e,r){return Fl(YE(e,r))}var _m=ee("DeviceGrant.approval")(function*(e,r,i={}){let s=f(function*(){let l=r.intervalMs;while((yield*ze)<r.expiresAt){let p=yield*YE(e,r);if(p.status==="ready")return p.tokens;if(p.slowDown)l+=ak;let u=Math.max(0,r.expiresAt-(yield*ze));yield*en(Ne(Math.min(l+G,u)))}return yield*new Xn({reason:`${e.label} device authorization timed out`})}),a=i.signal;if(!a)return yield*s;return yield*Wa(s,T(e,a))});function T(e,r){return pr((i)=>{let s=()=>i(c(new Xn({reason:`${e.label} device authorization cancelled`})));if(r.aborted)return s();return r.addEventListener("abort",s,{once:!0}),d(()=>r.removeEventListener("abort",s))})}function lT(e,r,i={}){return Fl(_m(e,r,i))}var ck=ee("DeviceGrant.refresh")(function*(e,r){if(!r.trim())return yield*new Xn({reason:`${e.label} refresh token is empty`});let i={grant_type:"refresh_token",refresh_token:r,client_id:e.clientId},{response:s,text:a}=yield*_(e,e.tokenUrl,i);if(!s.ok)return yield*new Xn({reason:`${e.label} token refresh failed (${s.status}): ${ka(a.trim(),i)||s.statusText}`});let l=yield*Ze({try:()=>yf(D,a,`${e.label} token response`,i),catch:uc});return yield*h(e,l,r)});function dT(e,r){return Fl(ck(e,r))}var h=v(function*(e,r,i){let s=(r.access_token??"").trim();if(!s)return yield*new Xn({reason:`${e.label} token response missing access_token`});let a=(r.refresh_token??i??(e.refreshOptional?s:"")).trim();if(!a)return yield*new Xn({reason:`${e.label} token response missing refresh_token`});let l=typeof r.expires_in==="number"&&r.expires_in>0?r.expires_in:3600;return{accessToken:s,refreshToken:a,expiresAt:(yield*ze)+l*1000,scope:(r.scope??"").trim(),idToken:(r.id_token??"").trim()||void 0}});function y(e,r){let i=Number(e);return Number.isFinite(i)&&i>0?i*1000:r}
|
|
3
3
|
export{aT,ik,ak,km,cT,YE,uT,_m,lT,ck,dT};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{q,ze,Es,r,y,i}from"./plugin-
|
|
2
|
+
import{q,ze,Es,r,y,i}from"./plugin-xfcgt5ba.js";var p=q("@runlith/activity/ActivityCause",{defaultValue:()=>null});var c=(t)=>({name:t});var A={record:()=>{},settled:y},a=q("@runlith/activity/ActivityLog",{defaultValue:()=>A});var u=q("@runlith/activity/CurrentActivity",{defaultValue:()=>null});function f(t,e){return i(Es([a,u,ze]),([o,n,d])=>{if(n===null||e!==void 0&&e.run!==n.run){if(e!==void 0)o.record({_tag:"Noted",activity:e,at:d,note:t});return null}return n.notes+=1,o.record({_tag:"Noted",activity:n.id,at:d,note:t}),n.notes})}var D=c("fault");function g(t){return i(Es([a,u,ze]),([e,o,n])=>o===null?null:m(e,o,n,t))}function m(t,e,o,n){return e.bodies+=1,t.record({_tag:"Bodied",activity:e.id,n:e.bodies,at:o,thread:e.thread,body:n}),e.bodies}var $s=(t)=>f(t),oy=(t)=>t.body._tag==="Uint8Array"?g({kind:"request",encoded:t.body.body,contentType:t.body.contentType,series:!0}):r(null);
|
|
3
3
|
export{$s,oy};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{F}from"./plugin-
|
|
2
|
+
import{F}from"./plugin-xfcgt5ba.js";class ur extends F("SpeechFailure"){static auth(e){return new ur({reason:"auth",message:e,retryable:!1})}static rate(e,r){return new ur({reason:"rate",message:e,retryable:!0,retryAfterMs:r})}static invalidRequest(e){return new ur({reason:"invalid-request",message:e,retryable:!1})}static transport(e){return new ur({reason:"transport",message:e,retryable:!0})}static provider(e,r){return new ur({reason:"provider",message:e,retryable:r})}static unsupported(e){return new ur({reason:"unsupported",message:e,retryable:!1})}static unconfirmedTail(e){return new ur({reason:"unconfirmed-tail",message:e,retryable:!1})}}class Xd extends F("Overflow"){}
|
|
3
3
|
export{ur,Xd};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var e={name:"@runlith/tagma",version:"0.1.0",private:!0,description:"The public contract of Tagma: rules a repository declares in tagma.config.ts and the adapter a model provider is written against.",bin:{"tagma-plugin":"./src/plugin/cli.ts"},type:"module",exports:{"./rules":{types:"./src/rules/rules.ts",default:"./src/rules/rules.ts"},"./rules/effect":{types:"./src/rules/effect.ts",default:"./src/rules/effect.ts"},"./sources":{types:"./src/rules/sources.ts",bun:"./src/rules/sources.ts",default:null},"./adapter/provider":{types:"./src/adapter/provider.ts",browser:"./src/adapter/provider.ts",bun:"./src/adapter/provider.ts",default:"./src/adapter/provider.ts"},"./adapter/harness":{types:"./src/adapter/harness.ts",browser:"./src/adapter/harness.ts",node:"./src/adapter/harness.ts",bun:"./src/adapter/harness.ts",default:"./src/adapter/harness.ts"},"./adapter/metadata":{types:"./src/adapter/metadata.ts",bun:"./src/adapter/metadata.ts",default:"./src/adapter/metadata.ts"},"./adapter/hook":{types:"./src/adapter/hook.ts",browser:"./src/adapter/hook.ts",bun:"./src/adapter/hook.ts",default:"./src/adapter/hook.ts"},"./adapter/payload":{types:"./src/adapter/payload.ts",browser:"./src/adapter/payload.ts",bun:"./src/adapter/payload.ts",default:"./src/adapter/payload.ts"},"./adapter/claude-hooks":{types:"./src/adapter/claudeHooks.ts",browser:"./src/adapter/claudeHooks.ts",bun:"./src/adapter/claudeHooks.ts",default:"./src/adapter/claudeHooks.ts"},"./adapter/settings":{types:"./src/adapter/settings.ts",browser:"./src/adapter/settings.ts",bun:"./src/adapter/settings.ts",default:"./src/adapter/settings.ts"},"./adapter/speech":{types:"./src/adapter/speech.ts",bun:"./src/adapter/speech.ts",default:"./src/adapter/speech.ts"},"./adapter/loader":{types:"./src/adapter/loader.ts",bun:"./src/adapter/loader.ts",default:null},"./adapter/declaration":{types:"./src/adapter/declaration.ts",default:"./src/adapter/declaration.ts"},"./adapter/host-modules":{types:"./src/adapter/hostModules.ts",bun:"./src/adapter/hostModules.ts",default:null},"./plugin":{types:"./src/plugin/plugin.ts",browser:"./src/plugin/plugin.ts",default:"./src/plugin/plugin.ts"},"./plugin/bundling":{types:"./src/plugin/bundling.ts",bun:"./src/plugin/bundling.ts",default:null},"./plugin/process":{types:"./src/plugin/process.ts",bun:"./src/plugin/process.ts",default:null},"./plugin/protocol":{types:"./src/plugin/protocol.ts",default:"./src/plugin/protocol.ts"},"./plugin/value":{types:"./src/plugin/value.ts",browser:"./src/plugin/value.ts",default:"./src/plugin/value.ts"},"./plugin/points":{types:"./src/plugin/points.generated.ts",default:"./src/plugin/points.generated.ts"},"./plugin/template":{types:"./src/plugin/template.ts",default:"./src/plugin/template.ts"},"./ui":{types:"./src/plugin/ui.generated.d.ts",default:"./src/plugin/ui.generated.d.ts"},"./testing":{types:"./src/plugin/testing.ts",bun:"./src/plugin/testing.ts",default:null}},scripts:{build:"bun kit/build.ts",test:"testbed bun test --no-isolate --pass-with-no-tests src","test:integration":"testbed itest --no-isolate",typecheck:"runlith-typecheck"},dependencies:{"@modelcontextprotocol/sdk":"catalog:","@runlith/adapter-anthropic":"workspace:*","@runlith/adapter-deepseek":"workspace:*","@runlith/adapter-devin":"workspace:*","@runlith/adapter-google":"workspace:*","@runlith/adapter-muse":"workspace:*","@runlith/adapter-openai":"workspace:*","@runlith/adapter-opencode-go":"workspace:*","@runlith/adapter-stepfun":"workspace:*","@runlith/adapter-xai":"workspace:*","@runlith/agent":"workspace:*","@runlith/held":"workspace:*","@runlith/llm":"workspace:*","@runlith/mcp":"workspace:*","@runlith/speech":"workspace:*","@runlith/utils":"workspace:*","@standard-schema/spec":"^1.1.0","@tailwindcss/oxide":"catalog:",svelte:"catalog:",svelte2tsx:"catalog:",typescript:"catalog:"},devDependencies:{"@runlith/tsconfig":"workspace:*","@tagma/inspection":"workspace:*","@types/bun":"catalog:",effect:"catalog:",zod:"catalog:"},peerDependencies:{effect:"^4.0.1"},changeCheck:{loads:{"src/adapter/loader.ts":[]}},tagma:{host:["./adapter/claude-hooks","./adapter/harness","./adapter/hook","./adapter/metadata","./adapter/payload","./adapter/provider","./adapter/settings","./adapter/speech","effect","effect/http"]}};var oT="BUILT_SDK",a="0.
|
|
2
|
+
var e={name:"@runlith/tagma",version:"0.1.0",private:!0,description:"The public contract of Tagma: rules a repository declares in tagma.config.ts and the adapter a model provider is written against.",bin:{"tagma-plugin":"./src/plugin/cli.ts"},type:"module",exports:{"./rules":{types:"./src/rules/rules.ts",default:"./src/rules/rules.ts"},"./rules/effect":{types:"./src/rules/effect.ts",default:"./src/rules/effect.ts"},"./sources":{types:"./src/rules/sources.ts",bun:"./src/rules/sources.ts",default:null},"./adapter/provider":{types:"./src/adapter/provider.ts",browser:"./src/adapter/provider.ts",bun:"./src/adapter/provider.ts",default:"./src/adapter/provider.ts"},"./adapter/harness":{types:"./src/adapter/harness.ts",browser:"./src/adapter/harness.ts",node:"./src/adapter/harness.ts",bun:"./src/adapter/harness.ts",default:"./src/adapter/harness.ts"},"./adapter/metadata":{types:"./src/adapter/metadata.ts",bun:"./src/adapter/metadata.ts",default:"./src/adapter/metadata.ts"},"./adapter/hook":{types:"./src/adapter/hook.ts",browser:"./src/adapter/hook.ts",bun:"./src/adapter/hook.ts",default:"./src/adapter/hook.ts"},"./adapter/payload":{types:"./src/adapter/payload.ts",browser:"./src/adapter/payload.ts",bun:"./src/adapter/payload.ts",default:"./src/adapter/payload.ts"},"./adapter/claude-hooks":{types:"./src/adapter/claudeHooks.ts",browser:"./src/adapter/claudeHooks.ts",bun:"./src/adapter/claudeHooks.ts",default:"./src/adapter/claudeHooks.ts"},"./adapter/settings":{types:"./src/adapter/settings.ts",browser:"./src/adapter/settings.ts",bun:"./src/adapter/settings.ts",default:"./src/adapter/settings.ts"},"./adapter/speech":{types:"./src/adapter/speech.ts",bun:"./src/adapter/speech.ts",default:"./src/adapter/speech.ts"},"./adapter/loader":{types:"./src/adapter/loader.ts",bun:"./src/adapter/loader.ts",default:null},"./adapter/declaration":{types:"./src/adapter/declaration.ts",default:"./src/adapter/declaration.ts"},"./adapter/host-modules":{types:"./src/adapter/hostModules.ts",bun:"./src/adapter/hostModules.ts",default:null},"./plugin":{types:"./src/plugin/plugin.ts",browser:"./src/plugin/plugin.ts",default:"./src/plugin/plugin.ts"},"./plugin/bundling":{types:"./src/plugin/bundling.ts",bun:"./src/plugin/bundling.ts",default:null},"./plugin/process":{types:"./src/plugin/process.ts",bun:"./src/plugin/process.ts",default:null},"./plugin/protocol":{types:"./src/plugin/protocol.ts",default:"./src/plugin/protocol.ts"},"./plugin/value":{types:"./src/plugin/value.ts",browser:"./src/plugin/value.ts",default:"./src/plugin/value.ts"},"./plugin/points":{types:"./src/plugin/points.generated.ts",default:"./src/plugin/points.generated.ts"},"./plugin/template":{types:"./src/plugin/template.ts",default:"./src/plugin/template.ts"},"./ui":{types:"./src/plugin/ui.generated.d.ts",default:"./src/plugin/ui.generated.d.ts"},"./testing":{types:"./src/plugin/testing.ts",bun:"./src/plugin/testing.ts",default:null}},scripts:{build:"bun kit/build.ts",test:"testbed bun test --no-isolate --pass-with-no-tests src","test:integration":"testbed itest --no-isolate",typecheck:"runlith-typecheck"},dependencies:{"@modelcontextprotocol/sdk":"catalog:","@runlith/adapter-anthropic":"workspace:*","@runlith/adapter-deepseek":"workspace:*","@runlith/adapter-devin":"workspace:*","@runlith/adapter-google":"workspace:*","@runlith/adapter-muse":"workspace:*","@runlith/adapter-openai":"workspace:*","@runlith/adapter-opencode-go":"workspace:*","@runlith/adapter-stepfun":"workspace:*","@runlith/adapter-xai":"workspace:*","@runlith/agent":"workspace:*","@runlith/held":"workspace:*","@runlith/llm":"workspace:*","@runlith/mcp":"workspace:*","@runlith/speech":"workspace:*","@runlith/utils":"workspace:*","@standard-schema/spec":"^1.1.0","@tailwindcss/oxide":"catalog:",svelte:"catalog:",svelte2tsx:"catalog:",typescript:"catalog:"},devDependencies:{"@runlith/tsconfig":"workspace:*","@tagma/inspection":"workspace:*","@types/bun":"catalog:",effect:"catalog:",zod:"catalog:"},peerDependencies:{effect:"^4.0.1"},changeCheck:{loads:{"src/adapter/loader.ts":[]}},tagma:{host:["./adapter/claude-hooks","./adapter/harness","./adapter/hook","./adapter/metadata","./adapter/payload","./adapter/provider","./adapter/settings","./adapter/speech","effect","effect/http"]}};var oT="BUILT_SDK",a="0.2.3",bm=a??e.version,sk=a??"link:@runlith/tagma",s=(t)=>`${JSON.stringify(t,null,2)}
|
|
3
3
|
`,Zg=({id:t,title:r})=>[{path:"package.json",text:s({name:t,version:"0.1.0",private:!0,type:"module",scripts:{build:"tagma-plugin build",dev:"tagma-plugin dev",test:"bun test"},devDependencies:{"@runlith/tagma":sk,"@types/bun":"^1.3.0",zod:"^4.2.0"}})},{path:"tsconfig.json",text:s({compilerOptions:{target:"ESNext",module:"Preserve",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,verbatimModuleSyntax:!0,allowImportingTsExtensions:!0,types:["bun"]},include:["**/*.ts"],exclude:["node_modules","dist"]})},{path:"plugin.ts",text:["import { definePlugin, tool } from '@runlith/tagma/plugin';","import { z } from 'zod';","","export default definePlugin({",` id: ${JSON.stringify(t)},`,` title: ${JSON.stringify(r)},`," tools: {"," hello: tool({"," description: 'Greet someone by name.',"," audience: 'agents',"," readOnly: true,"," input: z.object({ name: z.string().describe('Who to greet') }),"," run: async ({ name }) => `Hello, ${name}!`,"," }),"," },","});",""].join(`
|
|
4
4
|
`)},{path:"plugin.test.ts",text:["import { expect, test } from 'bun:test';","import { testPlugin } from '@runlith/tagma/testing';","import plugin from './plugin';","","test('hello greets by name', async () => {"," expect(await testPlugin(plugin).call('hello', { name: 'Ada' })).toEqual({ text: 'Hello, Ada!', isError: false });","});",""].join(`
|
|
5
5
|
`)},{path:".gitattributes",text:["dist/** linguist-generated=true merge=binary","tagma-plugin.json linguist-generated=true merge=binary",""].join(`
|