@bkm016/basalt 0.1.11 → 0.1.12
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/{chunk-755sy11p.js → chunk-01nve4qy.js} +1 -1
- package/{chunk-jtsve11b.js → chunk-0fc9apfn.js} +9 -9
- package/{chunk-d5j74pcp.js → chunk-1h34mzh7.js} +4 -4
- package/{chunk-fgwda4m0.js → chunk-1xfv4bd7.js} +1 -1
- package/{chunk-mbpb5c7w.js → chunk-2fyjph3f.js} +1 -1
- package/{chunk-13gvs0ax.js → chunk-2kxnw7vs.js} +1 -1
- package/{chunk-95964592.js → chunk-37zystxb.js} +11 -11
- package/{chunk-h1kb8b49.js → chunk-3pf1d62g.js} +2 -2
- package/{chunk-29qrxygd.js → chunk-5wnmbc1b.js} +2 -2
- package/{chunk-c71173py.js → chunk-6mges89p.js} +4 -4
- package/{chunk-d0a1jxk5.js → chunk-6sz5q3df.js} +2 -2
- package/chunk-7er5pz7s.js +479 -0
- package/{chunk-gbjn6d81.js → chunk-7g5smgjj.js} +1 -1
- package/chunk-7m3jagqn.js +2 -0
- package/{chunk-wnzvnskb.js → chunk-85v69h91.js} +2 -2
- package/{chunk-38g3gctw.js → chunk-9c4gdg1q.js} +2 -2
- package/{chunk-en218k4y.js → chunk-cbgpymt4.js} +1 -1
- package/{chunk-a1rb1a48.js → chunk-cdw03j4t.js} +2 -2
- package/chunk-ch1r3ted.js +2 -0
- package/{chunk-dfh9m9n7.js → chunk-db7ws33a.js} +2 -2
- package/{chunk-1n7dat03.js → chunk-ejjem0tc.js} +3 -3
- package/{chunk-c4qr1f41.js → chunk-eq4wqxzt.js} +2 -2
- package/{chunk-zc9ar0r4.js → chunk-eyrtbbdd.js} +1 -1
- package/{chunk-r4ttdkrz.js → chunk-fhxy6y34.js} +2 -2
- package/{chunk-zyyzk5ha.js → chunk-fy82qxa1.js} +1 -1
- package/{chunk-xtq1xpq0.js → chunk-hc300148.js} +1 -1
- package/{chunk-vtqr7dm8.js → chunk-j64dc767.js} +2 -2
- package/{chunk-msm9hmk9.js → chunk-jpnf71q7.js} +2 -2
- package/{chunk-q9f4xb0w.js → chunk-kpe7pnhy.js} +4 -4
- package/{chunk-a98wma9j.js → chunk-ksk49hv0.js} +1 -1
- package/{chunk-bdjr0kfr.js → chunk-m4bg1apa.js} +5 -5
- package/{chunk-dq01v5eq.js → chunk-nhm9z3d8.js} +1 -1
- package/{chunk-30rjf7my.js → chunk-ntks40jd.js} +2 -2
- package/{chunk-a1352w87.js → chunk-nw1xpt3s.js} +1 -1
- package/{chunk-xh444pfn.js → chunk-p2pmdbt2.js} +8 -8
- package/{chunk-hb4f2v34.js → chunk-qfcr5g35.js} +2 -2
- package/{chunk-n2jcx65v.js → chunk-qs8zzg50.js} +2 -2
- package/{chunk-qaeyhe65.js → chunk-r4gm8ngh.js} +1 -1
- package/{chunk-pz2afna8.js → chunk-rks90mh1.js} +1 -1
- package/{chunk-asyr3gnq.js → chunk-rwks9zaw.js} +2 -2
- package/{chunk-v3ee9z3f.js → chunk-t7te60m7.js} +1 -1
- package/{chunk-4dw43syb.js → chunk-tv52xajf.js} +1 -1
- package/{chunk-c0zfefq8.js → chunk-v7wcchy2.js} +1 -1
- package/{chunk-tevejprz.js → chunk-vjne04dp.js} +3 -3
- package/{chunk-ax04trym.js → chunk-w0rr66z7.js} +1 -1
- package/{chunk-gkf5jwvj.js → chunk-w6f2r052.js} +1 -1
- package/{chunk-jymx3a77.js → chunk-wqqjzsjt.js} +310 -278
- package/{chunk-c6q04xrd.js → chunk-xef4642x.js} +1 -1
- package/compiled.js +7 -7
- package/package.json +1 -1
- package/ui-test-worker.js +2 -2
- package/web/{chunk-jhpg2kcf.js → chunk-04drx71p.js} +1 -1
- package/web/chunk-0rdgt4jb.css +1 -0
- package/web/{chunk-cbwvfedy.js → chunk-19zd0tye.js} +3 -3
- package/web/chunk-1m0kp0g3.js +8 -0
- package/web/{chunk-j4gvtszc.js → chunk-1zwc09e8.js} +2 -2
- package/web/{chunk-a3pye9ag.js → chunk-2cyzaqjy.js} +3 -3
- package/web/{chunk-8csw0mvf.js → chunk-2jfesv7m.js} +2 -2
- package/web/chunk-3j2tcphs.js +1 -0
- package/web/chunk-3k9h7a73.js +1142 -0
- package/web/chunk-3m1bb2fw.js +1 -0
- package/web/{chunk-4rwwtfnd.js → chunk-3n9ypydh.js} +2 -2
- package/web/{chunk-90fkdzx3.js → chunk-3psgr0q8.js} +13 -13
- package/web/{chunk-nafe18y9.js → chunk-3qxxrwsp.js} +6 -6
- package/web/{chunk-hjyev38w.js → chunk-3rkkp6ed.js} +4 -4
- package/web/{chunk-v3dn9bfw.js → chunk-4f6a8dsk.js} +1 -1
- package/web/chunk-55nvm2mj.js +1 -0
- package/web/chunk-5dkqfnh7.js +2 -0
- package/web/{chunk-96xhmmqz.js → chunk-5g8md2wg.js} +4 -4
- package/web/{chunk-mpdeqzc9.js → chunk-5np514v5.js} +8 -8
- package/web/{chunk-1zfxaafq.js → chunk-60mym60n.js} +1 -1
- package/web/{chunk-nhx8pw7p.js → chunk-6f2sz84q.js} +2 -2
- package/web/{chunk-q8v5j963.js → chunk-7adsmqv6.js} +2 -2
- package/web/{chunk-27812gqr.js → chunk-7ksg3ccg.js} +3 -3
- package/web/chunk-7ky5nrrr.js +1 -0
- package/web/{chunk-pq56b3mq.js → chunk-7tkgbbf9.js} +2 -2
- package/web/{chunk-tpdcrrf1.js → chunk-7v85yvb2.js} +1 -1
- package/web/{chunk-dk0fnj87.js → chunk-7vgh17es.js} +1 -1
- package/web/{chunk-rqympya7.js → chunk-80z8s8zb.js} +1 -1
- package/web/{chunk-36dc7tcg.js → chunk-81s15c2e.js} +2 -2
- package/web/{chunk-mykbcvqz.js → chunk-8539865x.js} +1 -1
- package/web/{chunk-wbwets5x.js → chunk-8cnjd0f2.js} +17 -17
- package/web/{chunk-48479gnx.js → chunk-8sdjgv3k.js} +1 -1
- package/web/chunk-9bxtzwtc.js +1 -0
- package/web/{chunk-drchr3yn.js → chunk-aa46mrgh.js} +1 -1
- package/web/{chunk-8151c970.js → chunk-act3rr85.js} +1 -1
- package/web/{chunk-94denx9h.js → chunk-aebrw6cv.js} +3 -3
- package/web/{chunk-3a57m7xm.js → chunk-aeymdtm1.js} +2 -2
- package/web/{chunk-3020mmp1.js → chunk-ar6jnhm5.js} +1 -1
- package/web/{chunk-e763h2px.js → chunk-b5zf1hs3.js} +66 -66
- package/web/{chunk-5ahx98zj.js → chunk-b99k8q22.js} +8 -8
- package/web/chunk-bcjgzwef.js +1 -0
- package/web/{chunk-f79ajymt.js → chunk-bra33pt0.js} +2 -2
- package/web/{chunk-57pyz29y.js → chunk-bygwbpvq.js} +2 -2
- package/web/{chunk-3ftb27f3.js → chunk-c3fty2c2.js} +5 -5
- package/web/{chunk-d3f763n7.js → chunk-cxpnj495.js} +1 -1
- package/web/{chunk-8z7texmv.js → chunk-d1btrqmw.js} +1 -1
- package/web/{chunk-jqqbkdtw.js → chunk-d57fm7k0.js} +2 -2
- package/web/{chunk-1t38sgrk.js → chunk-d73zkc4q.js} +4 -4
- package/web/chunk-d94t9z70.js +1 -0
- package/web/{chunk-2ds0a2z1.js → chunk-dndd757x.js} +3 -3
- package/web/{chunk-d4519smc.js → chunk-e94pd9rr.js} +10 -10
- package/web/{chunk-qykt7avq.js → chunk-enwfd8d5.js} +2 -2
- package/web/chunk-fr4fft89.js +1 -0
- package/web/{chunk-g0rtcedn.js → chunk-g488hxx0.js} +3 -3
- package/web/{chunk-b6sqwmq7.js → chunk-g4zm0crw.js} +1 -1
- package/web/{chunk-086dshck.js → chunk-gckmcef6.js} +1 -1
- package/web/{chunk-0hvxb5d5.js → chunk-gkmaryr4.js} +1 -1
- package/web/chunk-gnb09wmx.js +1 -0
- package/web/chunk-gx340asc.js +1 -0
- package/web/chunk-h0c42zy3.js +1 -0
- package/web/chunk-h24ybwp6.js +1 -0
- package/web/{chunk-m24yb8md.js → chunk-h754ntg7.js} +1 -1
- package/web/{chunk-3b4wqmnh.js → chunk-hn8m1vsg.js} +7 -7
- package/web/{chunk-2f2agfpj.js → chunk-hqxc9m07.js} +7 -7
- package/web/chunk-hrgqc1vr.js +1 -0
- package/web/{chunk-793m5jjh.js → chunk-hva7xyne.js} +2 -2
- package/web/{chunk-yrh86m0n.js → chunk-hxbfkdjd.js} +1 -1
- package/web/chunk-j9c8fa82.js +1 -0
- package/web/{chunk-4gc663j0.js → chunk-jeafmjsm.js} +1 -1
- package/web/chunk-jyf7a7yp.js +2 -0
- package/web/chunk-jz5mmp64.js +1 -0
- package/web/{chunk-s0xy00v5.js → chunk-k0cg4n2k.js} +2 -2
- package/web/{chunk-g31dbnzm.js → chunk-k4dnjf8n.js} +4 -4
- package/web/{chunk-59nk506k.js → chunk-kerfb21g.js} +1 -1
- package/web/chunk-m0136xav.js +1 -0
- package/web/chunk-m6vyvgm5.js +1 -0
- package/web/{chunk-0y971zgq.js → chunk-mxkbmgcv.js} +2 -2
- package/web/{chunk-0fy590s0.js → chunk-my0ec787.js} +1 -1
- package/web/chunk-mzzaet63.js +1 -0
- package/web/{chunk-xjc5fmcr.js → chunk-n9v14vyd.js} +18 -18
- package/web/{chunk-cpshsp24.js → chunk-ncfzmf2g.js} +1 -1
- package/web/chunk-ny436sqg.js +1 -0
- package/web/chunk-ph75hddv.js +1 -0
- package/web/chunk-phdfyqaa.js +1 -0
- package/web/chunk-phxa5krt.js +1 -0
- package/web/{chunk-b3j07x0n.js → chunk-pjpre6de.js} +2 -2
- package/web/chunk-q1zxvjhs.js +2 -0
- package/web/{chunk-n33753da.js → chunk-qdd3bx8q.js} +1 -1
- package/web/{chunk-ydtrc1ay.js → chunk-qh62nkem.js} +2 -2
- package/web/{chunk-05mvzx00.js → chunk-qp3tjhaq.js} +1 -1
- package/web/chunk-r4zbw4zj.js +2 -0
- package/web/{chunk-g4as4zzd.js → chunk-r6kk4vp1.js} +4 -4
- package/web/{chunk-ppjw1mps.js → chunk-rdr6wt22.js} +4 -4
- package/web/chunk-ry4ycah9.js +1 -0
- package/web/{chunk-47mbbmst.js → chunk-sdr5wa4z.js} +3 -3
- package/web/chunk-sqm16fat.js +1 -0
- package/web/{chunk-zv73g4qq.js → chunk-td83xf12.js} +2 -2
- package/web/chunk-tj1fn8v2.js +1 -0
- package/web/{chunk-q65zxczs.js → chunk-v0wtk059.js} +4 -4
- package/web/{chunk-enryqmj7.js → chunk-v1hfbjz9.js} +4 -4
- package/web/chunk-v1qt3gq4.js +1 -0
- package/web/{chunk-2tsxj613.js → chunk-v34mr9ky.js} +9 -9
- package/web/{chunk-tgkdyxbn.js → chunk-v854w9yn.js} +1 -1
- package/web/{chunk-dtrh40vr.js → chunk-ve56gxq0.js} +1 -1
- package/web/chunk-w573ym17.js +1 -0
- package/web/{chunk-9kkzmss7.js → chunk-w9gnqkez.js} +3 -3
- package/web/{chunk-kfbgvh0c.js → chunk-wqzbxzk3.js} +1 -1
- package/web/{chunk-hm8thq7c.js → chunk-wvrs986a.js} +2 -2
- package/web/chunk-x0mjydtp.js +1 -0
- package/web/{chunk-7dycbjxn.js → chunk-xpecre7w.js} +4 -4
- package/web/{chunk-zdhyq3ch.js → chunk-xvfeq8v2.js} +7 -7
- package/web/{chunk-2weaa3gn.js → chunk-y2rzeb4v.js} +2 -2
- package/web/{chunk-tggja45g.js → chunk-yf8ykk4v.js} +4 -4
- package/web/{chunk-gyhr27dm.js → chunk-yjs6jmdb.js} +1 -1
- package/web/{chunk-dsbyfvwz.js → chunk-ym7kv2hs.js} +1 -1
- package/web/chunk-zhybh04p.js +1 -0
- package/web/index.html +1 -1
- package/worker.js +1 -1
- package/chunk-7zkswxvk.js +0 -2
- package/chunk-m1eam0s5.js +0 -2
- package/chunk-zq32mwxj.js +0 -479
- package/web/chunk-32zmk3f5.js +0 -1
- package/web/chunk-3d3wnh8a.js +0 -2
- package/web/chunk-6cjm2yr7.js +0 -1
- package/web/chunk-7ycxz39p.js +0 -1
- package/web/chunk-9wr33d0t.js +0 -1
- package/web/chunk-a4tdrxdh.js +0 -1
- package/web/chunk-a9fvsyc1.js +0 -1
- package/web/chunk-apvbvg4d.js +0 -1
- package/web/chunk-bkxcc7v5.js +0 -1
- package/web/chunk-bve354k7.js +0 -1
- package/web/chunk-cwpxakby.js +0 -1
- package/web/chunk-jd7npyv9.js +0 -8
- package/web/chunk-jzz5htxp.js +0 -1
- package/web/chunk-ka3q31t1.js +0 -1
- package/web/chunk-kahab58k.js +0 -1139
- package/web/chunk-krgvx75q.js +0 -1
- package/web/chunk-m7k4wr3k.js +0 -1
- package/web/chunk-mdj3r75b.js +0 -1
- package/web/chunk-nbcpbqq4.js +0 -1
- package/web/chunk-p1yc8hwn.js +0 -2
- package/web/chunk-p29brxyt.js +0 -1
- package/web/chunk-p8fbes0t.js +0 -1
- package/web/chunk-r6q1301x.js +0 -1
- package/web/chunk-r8kghrkb.js +0 -1
- package/web/chunk-rhxn7mxg.js +0 -1
- package/web/chunk-svqshmpg.js +0 -1
- package/web/chunk-swzxq7r3.css +0 -1
- package/web/chunk-t18tn37m.js +0 -2
- package/web/chunk-tbsaseer.js +0 -1
- package/web/chunk-v0zfnvc1.js +0 -1
- package/web/chunk-vj31fs16.js +0 -1
- package/web/chunk-vr79r8vh.js +0 -1
- package/web/chunk-wb9tax0m.js +0 -1
- package/web/chunk-x9eghjjd.js +0 -1
- package/web/chunk-z3ky5ews.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function c(e){if(!(e instanceof Error)||!("status"in e)||!("headers"in e))return!1;return(e.status===void 0||typeof e.status==="number")&&(e.headers===void 0||e.headers instanceof Headers)}function d(e){let t=e.headers?.get("x-should-retry");if(t==="true")return!0;if(t==="false")return!1;if(e.status===void 0)return!0;return e.status===408||e.status===409||e.status===429||typeof e.status==="number"&&e.status>=500}function f(e,t,s){let n=t??60000;if(n>0&&e>n)throw Error(`Server requested ${Math.ceil(e/1000)}s retry delay (max: ${Math.ceil(n/1000)}s). ${s}`);return e}function l(e,t,s){let n=e.headers?.get("retry-after-ms");if(n){let a=Number.parseFloat(n);if(Number.isFinite(a))return f(a,s,e.message)}let r=e.headers?.get("retry-after");if(r){let a=Number.parseFloat(r),o=Number.isNaN(a)?Date.parse(r)-Date.now():a*1000;if(Number.isFinite(o))return f(o,s,e.message)}return Math.min(0.5*2**t,8)*1000*(1-Math.random()*0.25)}function i(){let e=Error("Request aborted");return e.name="AbortError",e}function m(e,t){return new Promise((s,n)=>{if(t?.aborted){n(i());return}let r=()=>{clearTimeout(u),n(i())},u=setTimeout(()=>{t?.removeEventListener("abort",r),s()},Math.max(0,e));t?.addEventListener("abort",r,{once:!0})})}async function
|
|
3
|
-
export{
|
|
2
|
+
function c(e){if(!(e instanceof Error)||!("status"in e)||!("headers"in e))return!1;return(e.status===void 0||typeof e.status==="number")&&(e.headers===void 0||e.headers instanceof Headers)}function d(e){let t=e.headers?.get("x-should-retry");if(t==="true")return!0;if(t==="false")return!1;if(e.status===void 0)return!0;return e.status===408||e.status===409||e.status===429||typeof e.status==="number"&&e.status>=500}function f(e,t,s){let n=t??60000;if(n>0&&e>n)throw Error(`Server requested ${Math.ceil(e/1000)}s retry delay (max: ${Math.ceil(n/1000)}s). ${s}`);return e}function l(e,t,s){let n=e.headers?.get("retry-after-ms");if(n){let a=Number.parseFloat(n);if(Number.isFinite(a))return f(a,s,e.message)}let r=e.headers?.get("retry-after");if(r){let a=Number.parseFloat(r),o=Number.isNaN(a)?Date.parse(r)-Date.now():a*1000;if(Number.isFinite(o))return f(o,s,e.message)}return Math.min(0.5*2**t,8)*1000*(1-Math.random()*0.25)}function i(){let e=Error("Request aborted");return e.name="AbortError",e}function m(e,t){return new Promise((s,n)=>{if(t?.aborted){n(i());return}let r=()=>{clearTimeout(u),n(i())},u=setTimeout(()=>{t?.removeEventListener("abort",r),s()},Math.max(0,e));t?.addEventListener("abort",r,{once:!0})})}async function ae(e,t={}){let s=t.maxRetries??0,n=s;for(;;)try{return await e()}catch(r){if(t.signal?.aborted)throw i();if(n<=0||!c(r)||!d(r))throw r;if(r.status!==void 0&&t.noRetryStatuses?.includes(r.status))throw r;let u=s-n;n--,await m(l(r,u,t.maxRetryDelayMs),t.signal)}}
|
|
3
|
+
export{ae};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{
|
|
2
|
+
import{ae}from"./chunk-3pf1d62g.js";import{j,ye}from"./chunk-nrsd810j.js";import{Q}from"./chunk-ejjem0tc.js";function w(e,t,n){let a=Error(`${e} returned ${t.status}`);return a.status=t.status,a.headers=t.headers,a.body=n,a}function b(e){let t=Error(`Request timed out after ${e}ms`);return t.name="TimeoutError",t.status=void 0,t.headers=void 0,t.body="",t}function le(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ue(e,t,n){if(typeof t!=="number"||!Number.isFinite(t))throw Error(`${e} returned an invalid ${n}`);return t}function g(e,t,n){return ye({authorization:`Bearer ${t}`,"content-type":"application/json"},e.headers,n)??{}}async function Ar(e,t,n,a,r,f){if(!r?.apiKey)throw Error(`No API key for provider: ${n.provider}`);let h=r.apiKey,s=a,u=await r.onPayload?.(s,n);if(u!==void 0)s=u;let y=r.fetch??globalThis.fetch,{response:d,json:m}=await ae(async()=>{let i=r.timeoutMs!==void 0?AbortSignal.timeout(r.timeoutMs):void 0,p=r.signal&&i?AbortSignal.any([r.signal,i]):r.signal??i;try{let o=await y(t,{method:"POST",headers:g(n,h,r.headers),body:JSON.stringify(s),signal:p});if(!o.ok)throw w(e,o,await o.text());return{response:o,json:await o.json()}}catch(o){if(i?.aborted&&!r.signal?.aborted)throw b(r.timeoutMs);throw o}},{maxRetries:r.maxRetries??2,maxRetryDelayMs:r.maxRetryDelayMs,signal:r.signal,noRetryStatuses:f});return await r.onResponse?.({status:d.status,headers:j(d.headers)},n),m}function c(e){return typeof e==="number"&&Number.isFinite(e)&&e>0?e:0}function Er(e,t){if(!le(e)||e.input_tokens===void 0&&e.output_tokens===void 0)return;let n=c(e.input_tokens),a=c(e.output_tokens),r={input:n,output:a,cacheRead:0,cacheWrite:0,totalTokens:n+a,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}};return Q(t,r),r}
|
|
3
|
+
export{le,Ue,Ar,Er};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Database as E}from"bun:sqlite";import{chmodSync as R,closeSync as I,existsSync as T,openSync as m,rmSync as N}from"fs";var S=2,g=
|
|
2
|
+
import{Database as E}from"bun:sqlite";import{chmodSync as R,closeSync as I,existsSync as T,openSync as m,rmSync as N}from"fs";var S=2,g=2,Si="basalt-search.db",He=0,Et=1;function c(t){let e=new E(":memory:");try{for(let r of t)e.run(r);return!0}catch{return!1}finally{e.close()}}var u;function wi(){if(u)return u;let t=c(["CREATE VIRTUAL TABLE f USING fts5(text)"]),e=t&&c(["CREATE VIRTUAL TABLE f USING fts5(text, tokenize='trigram')"]);return u={fts5:t,trigram:e,trigramDiacritics:e&&c(["CREATE VIRTUAL TABLE f USING fts5(text, tokenize='trigram remove_diacritics 1')"]),contentlessDelete:t&&c(["CREATE VIRTUAL TABLE f USING fts5(text, content='', contentless_delete=1)","INSERT INTO f (rowid, text) VALUES (1, 'probe')","DELETE FROM f WHERE rowid = 1"]),secureDelete:t&&c(["CREATE VIRTUAL TABLE f USING fts5(text)","INSERT INTO f (f, rank) VALUES ('secure-delete', 1)"])},u}function L(t){return{msg:t.trigram?"trigram":"unicode61",contentless:t.contentlessDelete}}function A(t){return JSON.stringify({schema:S,extractor:g,...t})}function p(t,e){return`text, ${t.contentless?"content='', contentless_delete=1, ":""}detail=full, tokenize="${e}"`}function d(t,e,r){let n=r.msg==="trigram"?e.trigramDiacritics?"trigram remove_diacritics 1":"trigram":"unicode61 remove_diacritics 2";t.transaction(()=>{if(t.run("CREATE TABLE IF NOT EXISTS meta (k TEXT PRIMARY KEY, v) WITHOUT ROWID"),t.run(`CREATE TABLE IF NOT EXISTS doc (
|
|
3
3
|
id INTEGER PRIMARY KEY,
|
|
4
4
|
hash INTEGER NOT NULL UNIQUE,
|
|
5
5
|
refs INTEGER NOT NULL,
|
|
@@ -18,8 +18,8 @@ import{Database as E}from"bun:sqlite";import{chmodSync as R,closeSync as I,exist
|
|
|
18
18
|
PRIMARY KEY (session_id, seq, part)
|
|
19
19
|
) WITHOUT ROWID`),t.run("CREATE INDEX IF NOT EXISTS ref_doc ON ref(doc,time,kind,tool,err,model)"),t.run("CREATE INDEX IF NOT EXISTS ref_time ON ref(time,session_id,seq,part,doc,kind,tool,err,model)"),t.run("CREATE TABLE IF NOT EXISTS term (t TEXT PRIMARY KEY, n INTEGER NOT NULL) WITHOUT ROWID"),t.run("CREATE TABLE IF NOT EXISTS evicted (session_id TEXT PRIMARY KEY) WITHOUT ROWID"),t.run("CREATE TABLE IF NOT EXISTS backfill_todo (ord INTEGER PRIMARY KEY, session_id TEXT NOT NULL)"),t.run(`CREATE VIRTUAL TABLE IF NOT EXISTS fts USING fts5(${p(r,n)})`),t.run(`CREATE VIRTUAL TABLE IF NOT EXISTS fts_out USING fts5(${p(r,"unicode61 remove_diacritics 2")})`),t.run("CREATE VIRTUAL TABLE IF NOT EXISTS fts_vocab USING fts5vocab(fts, 'row')"),t.run("CREATE VIRTUAL TABLE IF NOT EXISTS fts_out_vocab USING fts5vocab(fts_out, 'row')"),e.secureDelete)t.run("INSERT INTO fts (fts, rank) VALUES ('secure-delete', 1)"),t.run("INSERT INTO fts_out (fts_out, rank) VALUES ('secure-delete', 1)");t.query("INSERT OR REPLACE INTO meta (k, v) VALUES ('fingerprint', ?)").run(A(r)),t.query("INSERT OR REPLACE INTO meta (k, v) VALUES ('layout', ?)").run(JSON.stringify(r))})()}function Yn(t){for(let e of["","-wal","-shm","-journal"])N(t+e,{force:!0})}function x(t){for(let e of["","-wal","-shm"])if(T(t+e))R(t+e,384)}function Yr(t,e){return t.query("SELECT v FROM main.meta WHERE k = ?").get(e)?.v??void 0}function qt(t,e,r){t.query("INSERT OR REPLACE INTO main.meta (k, v) VALUES (?, ?)").run(e,r)}function xi(t,e,r){let n=L(r),s=!1;if(T(t)){let i=!1;try{let a=new E(t);try{i=a.query("SELECT v FROM meta WHERE k = 'fingerprint'").get()?.v===A(n)}finally{a.close()}}catch{i=!1}if(!i)Yn(t),s=!0}if(!T(t))I(m(t,"a",384));let o=new E(t,{create:!0,strict:!0});return o.run("PRAGMA journal_mode = WAL"),o.run("PRAGMA synchronous = NORMAL"),o.run("PRAGMA busy_timeout = 5000"),d(o,r,n),x(t),o.query("ATTACH ? AS store").run(e),{db:o,layout:n,reset:s}}function vi(t,e){if(!T(t))return;let r;try{return r=new E(t,{readonly:!0,strict:!0}),r.run("PRAGMA busy_timeout = 5000"),r.query("ATTACH ? AS store").run(e),r.query("SELECT v FROM meta WHERE k = 'layout'").get(),r}catch{r?.close();return}}var _i=49152,Ai=16384,Ei=64;function f(t){if(t.length<=65536)return t;return`${t.slice(0,49152)}
|
|
20
20
|
\u2026
|
|
21
|
-
${t.slice(-16384)}`}var O=/[\u3040-\u30FF\u3400-\u9FFF\uF900-\uFAFF\uAC00-\uD7AF]+/g,_=/[A-Za-z][a-z0-9]*(?:[A-Z][a-z0-9]+)+|[A-Z]{2,}[a-z0-9]+[A-Za-z0-9]*/g,U=/([a-z0-9])([A-Z])|([A-Z])([A-Z][a-z])/g;function Zn(t){return t.replace(O,(e)=>{if(e.length===1)return` ${e} `;let r=[];for(let n=0;n<e.length-1;n++)r.push(e.slice(n,n+2));return` ${r.join(" ")} `}).replace(_,(e)=>`${e} ${e.replace(U,"$1$3 $2$4")}`)}function
|
|
21
|
+
${t.slice(-16384)}`}var O=/[\u3040-\u30FF\u3400-\u9FFF\uF900-\uFAFF\uAC00-\uD7AF]+/g,_=/[A-Za-z][a-z0-9]*(?:[A-Z][a-z0-9]+)+|[A-Z]{2,}[a-z0-9]+[A-Za-z0-9]*/g,U=/([a-z0-9])([A-Z])|([A-Z])([A-Z][a-z])/g;function Zn(t){return t.replace(O,(e)=>{if(e.length===1)return` ${e} `;let r=[];for(let n=0;n<e.length-1;n++)r.push(e.slice(n,n+2));return` ${r.join(" ")} `}).replace(_,(e)=>`${e} ${e.replace(U,"$1$3 $2$4")}`)}function Ti(t){return`${t} `}function Tt(t){return t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]+/g,"").normalize("NFC")}var y=/[\p{L}\p{N}\p{Co}]+/gu;function Pi(t){return Tt(Zn(t)).match(y)??[]}var Ne={user:1,assistant:2,thinking:3,tool_input:4,tool_output:5,error:6,extension:7,notice:8,attachment:9,title:10},eo=Object.fromEntries(Object.entries(Ne).map(([t,e])=>[e,t])),h=1e4,k=-1,C=2048;function ki(t){return t==="tool_output"||t==="attachment"||t==="thinking"||t==="tool_input"}function l(t,e=[],r=0){if(r>6)return e;if(typeof t==="string")e.push(t);else if(typeof t==="number"||typeof t==="boolean")e.push(String(t));else if(Array.isArray(t))for(let n of t)l(n,e,r+1);else if(t&&typeof t==="object")for(let n of Object.values(t))l(n,e,r+1);return e}function Ke(t,e=!1){let r=[];switch(t.type){case"user":{if(typeof t.text==="string")r.push({part:0,kind:t.notices?"notice":"user",text:t.text});(Array.isArray(t.attachments)?t.attachments:[]).forEach((s,o)=>{let i=String(s?.name??""),a=s?.kind==="image"?i:`${i}
|
|
22
22
|
${String(s?.data??"")}`;r.push({part:1+o,kind:"attachment",text:a})});break}case"notice_pending":if(typeof t.notice?.text==="string")r.push({part:0,kind:"notice",text:t.notice.text});break;case"assistant":{let n=typeof t.model==="string"?t.model:void 0;if((Array.isArray(t.parts)?t.parts:[]).forEach((o,i)=>{if(o?.type==="text"||o?.type==="thinking"){if(typeof o.text==="string")r.push({part:i,kind:o.type==="text"?"assistant":"thinking",text:o.text,model:n})}else if(o?.type==="tool_call"){let a=typeof o.name==="string"?o.name:void 0;if(r.push({part:i,kind:"tool_input",tool:a,model:n,text:[a??"",...l(o.input)].join(`
|
|
23
|
-
`)}),typeof o.output==="string")r.push({part:
|
|
23
|
+
`)}),typeof o.output==="string")r.push({part:h+i,kind:"tool_output",tool:a,model:n,text:o.output})}}),typeof t.error==="string")r.push({part:k,kind:"error",err:!0,model:n,text:t.error});break}case"tool_result":{let n=typeof t.name==="string"?t.name:void 0,s=typeof t.output==="string"?t.output:"",o=t.isError===!0;if(r.push({part:0,kind:"tool_output",tool:n,err:o,text:s}),o)r.push({part:1,kind:"error",tool:n,err:o,text:s.slice(0,C)});break}case"run":if("error"in t&&typeof t.error==="string")r.push({part:0,kind:"error",err:!0,text:t.error});break;case"extension":{let n=t.display;if(n&&typeof n.text==="string")r.push({part:0,kind:"extension",text:`${n.title??""}
|
|
24
24
|
${n.text}`});break}}if(!e)for(let n of r)n.text=f(n.text);return r.filter((n)=>n.text.trim())}function Ri(t){return t.trim()?[{part:0,kind:"title",text:f(t)}]:[]}
|
|
25
|
-
export{Si,He,Et,wi,Yn,Yr,qt,xi,vi,_i,Ai,Ei,Zn,
|
|
25
|
+
export{Si,He,Et,wi,Yn,Yr,qt,xi,vi,_i,Ai,Ei,Zn,Ti,Tt,Pi,Ne,eo,ki,Ke,Ri};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:o});return e};var se=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:r,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoSession:p}=e,{ssoClient:S}=e,d=g.getProfileName({profile:e.profile??o?.profile});if(!r&&!t&&!n&&!a&&!p){let s=(await g.parseKnownFiles(e))[d];if(!s)throw new g.CredentialsProviderError(`Profile ${d} was not found.`,{logger:e.logger});if(!U(s))throw new g.CredentialsProviderError(`Profile ${d} is not configured with SSO credentials.`,{logger:e.logger});if(s?.sso_session){let u=(await g.loadSsoSessionData(e))[s.sso_session],
|
|
2
|
+
import{O}from"./chunk-vjne04dp.js";import{b}from"./chunk-cmwdjes8.js";import{i}from"./chunk-bwawt15q.js";var g=i(b());var U=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var v=i(O());var f=i(b());var j=300000,k="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var q=async(e,o={},r)=>{let{SSOOIDCClient:t}=await import("./chunk-r4gm8ngh.js"),n=(p)=>o.clientConfig?.[p]??o.parentClientConfig?.[p]??r?.[p];return new t(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:n("logger"),userAgentAppId:n("userAgentAppId")}))};var W=async(e,o,r={},t)=>{let{CreateTokenCommand:n}=await import("./chunk-r4gm8ngh.js");return(await q(o,r,t)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var X=i(b());var N=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new X.TokenProviderError(`Token is expired. ${k}`,!1)};var z=i(b());var w=(e,o,r=!1)=>{if(typeof o>"u")throw new z.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${k}`,!1)};var J=i(b());import{promises as ee}from"fs";var{writeFile:oe}=ee,V=(e,o)=>{let r=J.getSSOTokenFilepath(e),t=JSON.stringify(o,null,2);return oe(r,t)};var Y=new Map,R=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let r=await f.parseKnownFiles(e),t=f.getProfileName({profile:e.profile??o?.profile}),n=r[t];if(!n)throw new f.TokenProviderError(`Profile '${t}' could not be found in shared credentials file.`,!1);else if(!n.sso_session)throw new f.TokenProviderError(`Profile '${t}' is missing required property 'sso_session'.`);let a=n.sso_session,S=(await f.loadSsoSessionData(e))[a];if(!S)throw new f.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let c of["sso_start_url","sso_region"])if(!S[c])throw new f.TokenProviderError(`Sso session '${a}' is missing required property '${c}'.`,!1);let{sso_start_url:d,sso_region:E}=S,s;try{s=await f.getSSOTokenFromFile(a)}catch(c){throw new f.TokenProviderError(`The SSO session token associated with profile=${t} was not found or is invalid. ${k}`,!1)}w("accessToken",s.accessToken),w("expiresAt",s.expiresAt);let{accessToken:T,expiresAt:x}=s,l={token:T,expiration:new Date(x)};if(l.expiration.getTime()-Date.now()>j)return l;let m=Y.get(a)??0;if(Date.now()-m<30000)return N(l),l;w("clientId",s.clientId,!0),w("clientSecret",s.clientSecret,!0),w("refreshToken",s.refreshToken,!0);try{Y.set(a,Date.now());let c=await W(s,E,e,o);w("accessToken",c.accessToken),w("expiresIn",c.expiresIn);let C=new Date(Date.now()+c.expiresIn*1000);try{await V(a,{...s,accessToken:c.accessToken,expiresAt:C.toISOString(),refreshToken:c.refreshToken})}catch(u){}return{token:c.accessToken,expiration:C}}catch(c){return N(l),l}};var h=i(b()),y=!1,P=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:r,ssoRegion:t,ssoRoleName:n,ssoClient:a,clientConfig:p,parentClientConfig:S,callerClientConfig:d,profile:E,filepath:s,configFilepath:T,ignoreCache:x,logger:l})=>{let m,c="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{let _=await R({profile:E,filepath:s,configFilepath:T,ignoreCache:x,clientConfig:p,parentClientConfig:S,logger:l})({callerClientConfig:d});m={accessToken:_.token,expiresAt:new Date(_.expiration).toISOString()}}catch(_){throw new h.CredentialsProviderError(_.message,{tryNextLink:y,logger:l})}else try{m=await h.getSSOTokenFromFile(e)}catch(_){throw new h.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:y,logger:l})}if(new Date(m.expiresAt).getTime()-Date.now()<=0)throw new h.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:y,logger:l});let{accessToken:C}=m,{SSOClient:u,GetRoleCredentialsCommand:A}=await import("./chunk-tv52xajf.js"),Z=a||new u(Object.assign({},p??{},{logger:p?.logger??d?.logger??S?.logger,region:p?.region??t,userAgentAppId:p?.userAgentAppId??d?.userAgentAppId??S?.userAgentAppId})),F;try{F=await Z.send(new A({accountId:r,roleName:n,accessToken:C}))}catch(_){throw new h.CredentialsProviderError(_,{tryNextLink:y,logger:l})}let{roleCredentials:{accessKeyId:D,secretAccessKey:L,sessionToken:M,expiration:G,credentialScope:K,accountId:H}={}}=F;if(!D||!L||!M||!G)throw new h.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:y,logger:l});let I={accessKeyId:D,secretAccessKey:L,sessionToken:M,expiration:new Date(G),...K&&{credentialScope:K},...H&&{accountId:H}};if(o)v.setCredentialFeature(I,"CREDENTIALS_SSO","s");else v.setCredentialFeature(I,"CREDENTIALS_SSO_LEGACY","u");return I};var B=i(b()),Q=(e,o)=>{let{sso_start_url:r,sso_account_id:t,sso_region:n,sso_role_name:a}=e;if(!r||!t||!n||!a)throw new B.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
|
|
3
|
+
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:o});return e};var se=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:r,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoSession:p}=e,{ssoClient:S}=e,d=g.getProfileName({profile:e.profile??o?.profile});if(!r&&!t&&!n&&!a&&!p){let s=(await g.parseKnownFiles(e))[d];if(!s)throw new g.CredentialsProviderError(`Profile ${d} was not found.`,{logger:e.logger});if(!U(s))throw new g.CredentialsProviderError(`Profile ${d} is not configured with SSO credentials.`,{logger:e.logger});if(s?.sso_session){let u=(await g.loadSsoSessionData(e))[s.sso_session],A=` configurations in profile ${d} and sso-session ${s.sso_session}`;if(n&&n!==u.sso_region)throw new g.CredentialsProviderError("Conflicting SSO region"+A,{tryNextLink:!1,logger:e.logger});if(r&&r!==u.sso_start_url)throw new g.CredentialsProviderError("Conflicting SSO start_url"+A,{tryNextLink:!1,logger:e.logger});s.sso_region=u.sso_region,s.sso_start_url=u.sso_start_url}let{sso_start_url:T,sso_account_id:x,sso_region:l,sso_role_name:m,sso_session:c}=Q(s,e.logger);return P({ssoStartUrl:T,ssoSession:c,ssoAccountId:x,ssoRegion:l,ssoRoleName:m,ssoClient:S,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:d,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}else if(!r||!t||!n||!a)throw new g.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return P({ssoStartUrl:r,ssoSession:p,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoClient:S,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:d,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})};export{se as fromSSO};
|