@harperfast/harper 5.2.8 → 5.2.9
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/config-root.schema.json +10 -0
- package/dist/resources/search.d.ts +1 -0
- package/dist/resources/search.js +8 -6
- package/dist/resources/search.js.map +1 -1
- package/dist/utility/hdbTerms.d.ts +2 -0
- package/dist/utility/hdbTerms.js +2 -0
- package/dist/utility/hdbTerms.js.map +1 -1
- package/dist/utility/rocksMemoryConfig.js +7 -4
- package/dist/utility/rocksMemoryConfig.js.map +1 -1
- package/dist/validation/configValidator.js +2 -0
- package/dist/validation/configValidator.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/resources/search.ts +11 -7
- package/studio/web/assets/{Chat-DDlysEi_.js → Chat-JpO8EtUu.js} +1 -1
- package/studio/web/assets/{FloatingChat-DdJ3DZJX.js → FloatingChat-Bcj3xSZu.js} +3 -3
- package/studio/web/assets/{apiToken-CrPb_98N.js → apiToken-c3Rd-w6g.js} +1 -1
- package/studio/web/assets/{applications-C6Y4nL_X.js → applications-ByqLRKyZ.js} +1 -1
- package/studio/web/assets/{cssMode-D8ceA4av.js → cssMode-CEN2mzSA.js} +1 -1
- package/studio/web/assets/{editor-C-jlLd1G.js → editor-D8oDeCTL.js} +1 -1
- package/studio/web/assets/{html-BnuKFPjv.js → html-u3vOg7LJ.js} +1 -1
- package/studio/web/assets/{htmlMode-DXM6YYUw.js → htmlMode-DyO31v-P.js} +1 -1
- package/studio/web/assets/{index-BtTvoLf8.js → index-aSt5tY-L.js} +5 -5
- package/studio/web/assets/{index.lazy-PVbC6xQh.js → index.lazy-B9jiPwT8.js} +1 -1
- package/studio/web/assets/{javascript-CAuAkYxc.js → javascript-CUvxOyTC.js} +1 -1
- package/studio/web/assets/{jsonMode-Dny8hrU7.js → jsonMode-f_IwbF3D.js} +1 -1
- package/studio/web/assets/{languageServices-D1uNqC6s.js → languageServices-DXtZ6rEF.js} +1 -1
- package/studio/web/assets/{lspLanguageFeatures-Bh-bvkyK.js → lspLanguageFeatures-B4pCF1zO.js} +1 -1
- package/studio/web/assets/{notifications-DPTOF-SX.js → notifications-CUoYgU98.js} +1 -1
- package/studio/web/assets/{notifications-DsE0S3zT.js → notifications-D3tIQ4sg.js} +1 -1
- package/studio/web/assets/{profile-BIeCZr-w.js → profile-DZWU7MgT.js} +1 -1
- package/studio/web/assets/{regions-B5lGduv5.js → regions-CkyurXzE.js} +1 -1
- package/studio/web/assets/{register-Cvc1TpmQ.js → register-BUyhWjBO.js} +2 -2
- package/studio/web/assets/{setComponentFile-D8ZLDWhU.js → setComponentFile-CeyKSZAa.js} +1 -1
- package/studio/web/assets/{setup-D2az-Ue_.js → setup-D2kn7cAA.js} +2 -2
- package/studio/web/assets/{status-BJegPrWN.js → status-D7Xn5ePA.js} +1 -1
- package/studio/web/assets/{toggleHighContrast-BdIEw2rK.js → toggleHighContrast-C0UW6rI2.js} +1 -1
- package/studio/web/assets/{tsMode-CulNMwI9.js → tsMode-DBC0zmDx.js} +1 -1
- package/studio/web/assets/{typescript-BpRqjmvQ.js → typescript-DApRQir3.js} +1 -1
- package/studio/web/assets/{useEntityRestURL-C7x-Yz9r.js → useEntityRestURL-DB6JStU1.js} +1 -1
- package/studio/web/assets/{workers-B2WpJDK9.js → workers-C0bFIedw.js} +1 -1
- package/studio/web/assets/{xml-CZnimVSX.js → xml-HWd01lU-.js} +1 -1
- package/studio/web/assets/{yaml-BwNuyZS-.js → yaml-CIH0Nt-h.js} +1 -1
- package/studio/web/index.html +1 -1
- package/utility/hdbTerms.ts +2 -0
- package/utility/rocksMemoryConfig.ts +7 -4
- package/validation/configValidator.ts +2 -0
package/resources/search.ts
CHANGED
|
@@ -1131,7 +1131,7 @@ export function estimateCondition(table) {
|
|
|
1131
1131
|
for (const subCondition of condition.conditions) {
|
|
1132
1132
|
estimateConditionForTable(subCondition);
|
|
1133
1133
|
estimatedCount = isFinite(estimatedCount)
|
|
1134
|
-
? (estimatedCount * subCondition.estimated_count) / estimatedEntryCount(table.primaryStore)
|
|
1134
|
+
? (estimatedCount * subCondition.estimated_count) / (estimatedEntryCount(table.primaryStore) || 1)
|
|
1135
1135
|
: subCondition.estimated_count;
|
|
1136
1136
|
}
|
|
1137
1137
|
}
|
|
@@ -1174,8 +1174,10 @@ export function estimateCondition(table) {
|
|
|
1174
1174
|
const attribute_name = condition[0] ?? condition.attribute;
|
|
1175
1175
|
const index = table.indices[attribute_name];
|
|
1176
1176
|
if (condition.value === null && searchType === 'ne') {
|
|
1177
|
-
condition.estimated_count =
|
|
1178
|
-
estimatedEntryCount(table.primaryStore) - (index ? index.getValuesCount(null) : 0)
|
|
1177
|
+
condition.estimated_count = Math.max(
|
|
1178
|
+
estimatedEntryCount(table.primaryStore) - (index ? index.getValuesCount(null) : 0),
|
|
1179
|
+
0
|
|
1180
|
+
);
|
|
1179
1181
|
} else condition.estimated_count = Infinity;
|
|
1180
1182
|
} else if (searchType === 'in') {
|
|
1181
1183
|
const attribute_name = condition[0] ?? condition.attribute;
|
|
@@ -1619,16 +1621,18 @@ export function flattenKey(key) {
|
|
|
1619
1621
|
return key;
|
|
1620
1622
|
}
|
|
1621
1623
|
|
|
1622
|
-
function estimatedEntryCount(store) {
|
|
1624
|
+
export function estimatedEntryCount(store) {
|
|
1623
1625
|
const now = Date.now();
|
|
1624
1626
|
if ((store.estimatedEntryCountExpires || 0) < now) {
|
|
1625
|
-
//
|
|
1626
|
-
|
|
1627
|
+
// getStats is the LMDB fast path; for RocksDB, estimate-num-keys is O(1) where an exact
|
|
1628
|
+
// getKeysCount() would iterate the entire store
|
|
1629
|
+
store.estimatedEntryCount =
|
|
1630
|
+
store instanceof RocksDatabase ? store.getEstimatedKeyCount() : store.getStats().entryCount;
|
|
1627
1631
|
store.estimatedEntryCountExpires = now + 10000;
|
|
1628
1632
|
}
|
|
1629
1633
|
return store.estimatedEntryCount;
|
|
1630
1634
|
}
|
|
1631
1635
|
|
|
1632
1636
|
export function intersectionEstimate(store, left, right) {
|
|
1633
|
-
return (left * right) / estimatedEntryCount(store);
|
|
1637
|
+
return (left * right) / Math.max(estimatedEntryCount(store), 1);
|
|
1634
1638
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{C as n,S as r,_ as i,b as a,c as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,u as v,v as ee,x as te,y}from"./vendor-core-RCcadM3e.js";import{i as b,t as x}from"./button-DhiX-njv.js";import{H as ne,L as re,k as ie,z as ae}from"./vendor-tanstack-BiFWSB3W.js";import{a as oe}from"./vendor-datadog-BRv-mOv1.js";import{r as se}from"./vendor-react-Dyj4O3HE.js";import{n as ce}from"./setSessionStorage-B0bf71m4.js";import{It as le}from"./vendor-ui-vhu-UHhF.js";import{t as S}from"./createLucideIcon-BKGPfjm2.js";import{n as ue,r as de,t as fe}from"./chevron-up-Df2c8uoU.js";import{c as pe,f as me,g as he,h as ge,i as _e,l as ve,m as ye,p as be,r as xe,t as Se,u as Ce}from"./setComponentFile-
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{C as n,S as r,_ as i,b as a,c as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,u as v,v as ee,x as te,y}from"./vendor-core-RCcadM3e.js";import{i as b,t as x}from"./button-DhiX-njv.js";import{H as ne,L as re,k as ie,z as ae}from"./vendor-tanstack-BiFWSB3W.js";import{a as oe}from"./vendor-datadog-BRv-mOv1.js";import{r as se}from"./vendor-react-Dyj4O3HE.js";import{n as ce}from"./setSessionStorage-B0bf71m4.js";import{It as le}from"./vendor-ui-vhu-UHhF.js";import{t as S}from"./createLucideIcon-BKGPfjm2.js";import{n as ue,r as de,t as fe}from"./chevron-up-Df2c8uoU.js";import{c as pe,f as me,g as he,h as ge,i as _e,l as ve,m as ye,p as be,r as xe,t as Se,u as Ce}from"./setComponentFile-CeyKSZAa.js";import{t as we}from"./x-B9o9hsep.js";import{n as Te}from"./setLocalStorage-D_kflv4U.js";import{t as Ee}from"./useLocalStorage-Dtj1QS8_.js";import{An as De,En as Oe,Er as ke,H as Ae,It as je,Mt as Me,Nr as Ne,Nt as Pe,Or as Fe,Pt as Ie,V as Le,Z as Re,br as ze,c as Be,cr as Ve,d as He,dr as Ue,f as We,ft as Ge,gr as Ke,in as qe,kr as Je,m as Ye,or as Xe,pr as Ze,ur as Qe,ut as $e,xr as et,yt as tt}from"./index-aSt5tY-L.js";import{t as nt}from"./useEntityRestURL-DB6JStU1.js";import{n as rt,t as it}from"./FloatingChat-Bcj3xSZu.js";import{n as at}from"./getAnalytics-D4LKGeVy.js";var ot=S(`between-horizontal-start`,[[`rect`,{width:`13`,height:`7`,x:`8`,y:`3`,rx:`1`,key:`pkso9a`}],[`path`,{d:`m2 9 3 3-3 3`,key:`1agib5`}],[`rect`,{width:`13`,height:`7`,x:`8`,y:`14`,rx:`1`,key:`1q5fc1`}]]),st=S(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),ct=S(`chart-area`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z`,key:`q0gr47`}]]),lt=S(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ut=S(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),dt=S(`logs`,[[`path`,{d:`M3 5h1`,key:`1mv5vm`}],[`path`,{d:`M3 12h1`,key:`lp3yf2`}],[`path`,{d:`M3 19h1`,key:`w6f3n9`}],[`path`,{d:`M8 5h1`,key:`1nxr5w`}],[`path`,{d:`M8 12h1`,key:`1con00`}],[`path`,{d:`M8 19h1`,key:`k7p10e`}],[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}]]),ft=S(`message-square-heart`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7.5 9.5c0 .687.265 1.383.697 1.844l3.009 3.264a1.14 1.14 0 0 0 .407.314 1 1 0 0 0 .783-.004 1.14 1.14 0 0 0 .398-.31l3.008-3.264A2.77 2.77 0 0 0 16.5 9.5 2.5 2.5 0 0 0 12 8a2.5 2.5 0 0 0-4.5 1.5`,key:`1faxuh`}]]),pt=S(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),mt=S(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]);async function ht(){await b.delete(`/Chat/Messages/`)}var C=e(oe(),1),w=se();function gt({setMessages:e}){let[t,n]=(0,C.useState)(!1),r=(0,C.useCallback)(async()=>{if(!t){n(!0);try{await ht(),e([])}catch(e){console.error(`Failed to clear chat:`,e)}finally{n(!1)}}},[t,e]);return(0,w.jsxs)(`button`,{type:`button`,className:`clear-chat-button gap-1`,onClick:r,disabled:t,title:`Clear chat`,children:[t?(0,w.jsx)(ze,{className:`animate-spin`,size:18}):(0,w.jsx)(Qe,{size:18}),`Clear`]})}async function _t(){let{data:e}=await b.get(`/Chat/Messages/`);return e}var vt=`vercel.ai.error`,yt=Symbol.for(vt),bt,xt,T=class e extends (xt=Error,bt=yt,xt){constructor({name:e,message:t,cause:n}){super(t),this[bt]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,vt)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};function St(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var Ct=`AI_InvalidArgumentError`,wt=`vercel.ai.error.${Ct}`,Tt=Symbol.for(wt),Et,Dt,Ot=class extends (Dt=T,Et=Tt,Dt){constructor({message:e,cause:t,argument:n}){super({name:Ct,message:e,cause:t}),this[Et]=!0,this.argument=n}static isInstance(e){return T.hasMarker(e,wt)}},kt=`AI_JSONParseError`,At=`vercel.ai.error.${kt}`,jt=Symbol.for(At),Mt,Nt,Pt=class extends (Nt=T,Mt=jt,Nt){constructor({text:e,cause:t}){super({name:kt,message:`JSON parsing failed: Text: ${e}.
|
|
2
2
|
Error message: ${St(t)}`,cause:t}),this[Mt]=!0,this.text=e}static isInstance(e){return T.hasMarker(e,At)}},Ft=`AI_TypeValidationError`,It=`vercel.ai.error.${Ft}`,Lt=Symbol.for(It),Rt,zt,E=class e extends (zt=T,Rt=Lt,zt){constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:Ft,message:`${r}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${St(t)}`,cause:t}),this[Rt]=!0,this.value=e,this.context=n}static isInstance(e){return T.hasMarker(e,It)}static wrap({value:t,cause:n,context:r}){return e.isInstance(n)&&n.value===t&&n.context?.field===r?.field&&n.context?.entityName===r?.entityName&&n.context?.entityId===r?.entityId?n:new e({value:t,cause:n,context:r})}},Bt=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},Vt=10,Ht=13,D=32;function Ut(e){}function Wt(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=Ut,onError:n=Ut,onRetry:r=Ut,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(`
|
|
4
4
|
`)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new Bt(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(`
|