@lunora/shard-engine 1.0.0-alpha.48 → 1.0.0-alpha.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/conformance/index.mjs +1 -1
  2. package/dist/index.d.mts +3 -3
  3. package/dist/index.d.ts +3 -3
  4. package/dist/index.mjs +1 -1
  5. package/dist/packem_shared/ADMIN_FUNCTIONS-oJ7IyZP6.mjs +1 -0
  6. package/dist/packem_shared/{AGG_COUNT-DLoWGwBC.mjs → AGG_COUNT-JTc_jUaL.mjs} +1 -1
  7. package/dist/packem_shared/{CDC_LOG_TABLE-BknLCi4r.mjs → CDC_LOG_TABLE-gl0FuepJ.mjs} +1 -1
  8. package/dist/packem_shared/{CURSOR_PREFIX-CheBVHA7.mjs → CURSOR_PREFIX-C0HEpLAN.mjs} +1 -1
  9. package/dist/packem_shared/{DEFAULT_MAX_RELATION_KEYS-DrUSQbcU.mjs → DEFAULT_MAX_RELATION_KEYS-Bl7H97aj.mjs} +1 -1
  10. package/dist/packem_shared/{DEFAULT_MAX_RELAYS-JVr88opJ.mjs → DEFAULT_MAX_RELAYS-Bjx0HDbs.mjs} +1 -1
  11. package/dist/packem_shared/{DEFAULT_PROMOTION_THRESHOLDS-DFAcRYsv.mjs → DEFAULT_PROMOTION_THRESHOLDS-DpUu_mpH.mjs} +1 -1
  12. package/dist/packem_shared/{DurableStreamRunner-cq7kMv9M.mjs → DurableStreamRunner-CWqdczw1.mjs} +1 -1
  13. package/dist/packem_shared/{NotUniqueError-DJFaCeQK.mjs → NotUniqueError-Dwab63fS.mjs} +1 -1
  14. package/dist/packem_shared/{RANK_TIEBREAK-DBzb8aDX.mjs → RANK_TIEBREAK-D157XEqw.mjs} +1 -1
  15. package/dist/packem_shared/{ReactiveCache-BpnU4D2r.mjs → ReactiveCache-BngdZxr9.mjs} +1 -1
  16. package/dist/packem_shared/{ShapeDiffCache-DIqpvunX.mjs → ShapeDiffCache-CLm5XXd1.mjs} +1 -1
  17. package/dist/packem_shared/{aggregateTableName-XtEbp1DE.mjs → aggregateTableName-CGi8gxeK.mjs} +1 -1
  18. package/dist/packem_shared/{applyOnDelete-DxgoRrx9.mjs → applyOnDelete-82J3ehcF.mjs} +1 -1
  19. package/dist/packem_shared/{awaitWsDrain-KLafbnds.mjs → awaitWsDrain-CjWMVZOG.mjs} +1 -1
  20. package/dist/packem_shared/{backfillAggregateIndexes-92hEoqfj.mjs → backfillAggregateIndexes-BtC-XM_S.mjs} +1 -1
  21. package/dist/packem_shared/{buildPokeFrames-BvgtmTHk.mjs → buildPokeFrames-C8km3IhJ.mjs} +1 -1
  22. package/dist/packem_shared/{buildReprojectionMigration-DcEoW2QQ.mjs → buildReprojectionMigration-CR2RSgJd.mjs} +1 -1
  23. package/dist/packem_shared/{buildShapeDiff-CphrFTHd.mjs → buildShapeDiff-Bmn0jPTM.mjs} +1 -1
  24. package/dist/packem_shared/{computeRankPage-EhvBDg7F.mjs → computeRankPage-kpaDsuAs.mjs} +1 -1
  25. package/dist/packem_shared/createCompanionSync-Bi6IG6fu.mjs +1 -0
  26. package/dist/packem_shared/{createReplicaLink-GrknD9FY.mjs → createReplicaLink-DujqFlHs.mjs} +1 -1
  27. package/dist/packem_shared/{ctx-db-companions-BeVsHnEe.mjs → ctx-db-companions-DKBBb0u8.mjs} +1 -1
  28. package/dist/packem_shared/{ctx-db-relay-shapes-C93UQ7LV.mjs → ctx-db-relay-shapes-CakvRIFx.mjs} +1 -1
  29. package/dist/packem_shared/{defineEngineContractSuite-DwDn7oH9.mjs → defineEngineContractSuite-DzZCsNfm.mjs} +1 -1
  30. package/dist/packem_shared/{do-sql-DqQTxsj_.mjs → do-sql-bkXQEBl8.mjs} +1 -1
  31. package/dist/packem_shared/{exportShardRows-Cgt3ITwH.mjs → exportShardRows-CegEECNc.mjs} +1 -1
  32. package/dist/packem_shared/{isSoftDeleted-h1UH0yYz.mjs → isSoftDeleted-BhchsmqX.mjs} +1 -1
  33. package/dist/packem_shared/{materializeExternalRows-C4G4u8QD.mjs → materializeExternalRows-DZnPHEJw.mjs} +1 -1
  34. package/dist/packem_shared/{runShardMigrations-DS2tQC3s.mjs → runShardMigrations-PZnc7KFE.mjs} +1 -1
  35. package/dist/packem_shared/{selectExpiredIds-rvmKjueQ.mjs → selectExpiredIds-D784Mqvh.mjs} +1 -1
  36. package/dist/packem_shared/{selectShapeMembers-Ce5Jr6UH.mjs → selectShapeMembers-CKQv8nwD.mjs} +1 -1
  37. package/dist/packem_shared/{stableWireKey-DQUcEqhM.mjs → stableWireKey-9bjKL5Gy.mjs} +1 -1
  38. package/dist/packem_shared/{wire-codec-CDds5uQW.mjs → wire-codec-COhOSEe4.mjs} +1 -1
  39. package/package.json +3 -3
  40. package/dist/packem_shared/ADMIN_FUNCTIONS-DKos6M_I.mjs +0 -1
  41. package/dist/packem_shared/createCompanionSync-rsUA_OO2.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import{S as A,y as u,l as L}from"./ctx-db-companions-BeVsHnEe.mjs";import{sql as e}from"drizzle-orm";import{aggregateTableName as p}from"./aggregateTableName-XtEbp1DE.mjs";import{backfillSearchIndexesForTable as N}from"./backfillAggregateIndexes-92hEoqfj.mjs";import{migrateCdcLog as h,migrateCdcMeta as R}from"./CDC_LOG_TABLE-BknLCi4r.mjs";import{migrateClientWatermark as x}from"./CLIENT_WATERMARK_TABLE-CRnrAnJ2.mjs";import{migrateCommitSeq as l}from"./COMMIT_SEQ_FIELD-BUdOMG5y.mjs";import{migrateGlobalShapeSnapshot as O}from"./GLOBAL_SHAPE_SNAPSHOT_TABLE-BicDuO0a.mjs";import{migrateIdempotency as C}from"./IDEMPOTENCY_TABLE-DOpm_oMF.mjs";import{m as b}from"./ctx-db-relay-shapes-C93UQ7LV.mjs";import{migrateSearchState as U}from"./SEARCH_STATE_TABLE-BCqn5ksa.mjs";import{migrateShapePokeCursor as $}from"./SHAPE_POKE_CURSOR_TABLE-ByJVDHds.mjs";import{runDrizzle as a}from"./runDrizzle-2ULFQR_k.mjs";import{D,e as g,d as T,t as X,i as G,g as F,a as M,b as B,A as I}from"./do-sql-DqQTxsj_.mjs";import{renderSql as k}from"./param-DlozcSQu.mjs";import{migrateDurableStreams as Y}from"./appendStreamChunk-8eH4HB1Q.mjs";import{rankTableName as v,sortColumnName as y}from"./RANK_TIEBREAK-DBzb8aDX.mjs";import{migrateReactorState as P}from"./REACTOR_STATE_TABLE-QPRFyxMS.mjs";import{recordSchemaVersion as j}from"./SCHEMA_HISTORY_MAX_VERSIONS-BluIj2s-.mjs";const K=e`_creationTime, id`,V=(r,o,n,i,t)=>{const m=a(r,e`SELECT sql FROM sqlite_master WHERE type = 'index' AND name = ${o} AND tbl_name = ${n}`).toArray()[0]?.sql;if(m==null)return;const f=c=>{const _=c.indexOf("(");return _===-1?void 0:c.slice(_,c.lastIndexOf(")")+1)},d=f(k("sqlite",T(o,n,i,t)).sql),E=f(m);d===void 0||E===void 0||d===E||a(r,e`DROP INDEX IF EXISTS ${e.identifier(o)}`)},w=(r,o,n)=>{for(const i of n.indexes){const t=`${o}_${i.name}`,s=i.unique??!1,m=e.join(i.fields.map(d=>g(d)),e`, `),f=s?m:e`${m}, ${K}`;V(r,t,o,f,s),a(r,T(t,o,f,s))}for(const[i,t]of X(n)){if(!t.unique)continue;const s=`${o}_unique_${i}`;a(r,T(s,o,g(i),!0))}},z=(r,o,n)=>{if(!(!n.searchIndexes||n.searchIndexes.length===0||!G(r))){for(const i of n.searchIndexes){const t=A(o,i.name);a(r,e`CREATE VIRTUAL TABLE IF NOT EXISTS ${e.identifier(t)} USING fts5(${e.identifier(u)}, ${e.identifier(L)} UNINDEXED)`),a(r,e`CREATE VIRTUAL TABLE IF NOT EXISTS ${e.identifier(`${t}__vocab`)} USING fts5vocab(${e.identifier(t)}, ${e.raw("instance")})`)}N(r,o,n)}},W=(r,o,n)=>{if(n.geoIndexes)for(const i of n.geoIndexes){const t=F(o,i.name);a(r,e`CREATE TABLE IF NOT EXISTS ${e.identifier(t)} (${e.identifier("__id__")} TEXT PRIMARY KEY, ${e.identifier("__geohash__")} TEXT NOT NULL, ${e.identifier("__lat__")} REAL NOT NULL, ${e.identifier("__lng__")} REAL NOT NULL)`);const s=`${o}__geo_${i.name}__btree`;a(r,T(s,t,e`${e.identifier("__geohash__")} ASC, ${e.identifier("__id__")} ASC`,!1))}},H=(r,o,n)=>{if(n.aggregateIndexes)for(const i of n.aggregateIndexes){const t=p(o,i.name);a(r,e`CREATE TABLE IF NOT EXISTS ${e.identifier(t)} (${M} TEXT PRIMARY KEY, ${B} REAL, ${I} INTEGER NOT NULL DEFAULT 0)`),a(r,e`PRAGMA table_info(${e.identifier(t)})`).toArray().some(m=>m.name==="__count__")||a(r,e`ALTER TABLE ${e.identifier(t)} ADD COLUMN ${I} INTEGER NOT NULL DEFAULT 0`)}},J=(r,o,n)=>{if(n.rankIndexes)for(const i of n.rankIndexes){const t=v(o,i.name),s=i.sortBy.map((c,_)=>y(_)),m=s.map(c=>e`${e.identifier(c)} BLOB`),f=m.length>0?e`, ${e.join(m,e`, `)}`:e``;a(r,e`CREATE TABLE IF NOT EXISTS ${e.identifier(t)} (${e.identifier("__id__")} TEXT PRIMARY KEY, ${e.identifier("__partition__")} TEXT NOT NULL${f})`);const d=[e`${e.identifier("__partition__")} ASC`];for(const[c,_]of s.entries()){const S=i.sortBy[c]?.direction;d.push(e`${e.identifier(_)} ${e.raw(S==="desc"?"DESC":"ASC")}`)}d.push(e`${e.identifier("__id__")} ASC`);const E=`${o}__rank_${i.name}__btree`;a(r,T(E,t,e.join(d,e`, `),!1))}},Ie=(r,o,n={})=>{n.schemaSnapshot!==void 0&&j(r,n.schemaSnapshot.hash,n.schemaSnapshot.json),U(r);for(const[i,t]of Object.entries(o.tables))t.shardMode?.kind!=="global"&&(a(r,e`CREATE TABLE IF NOT EXISTS ${e.identifier(i)} (
1
+ import{S as A,y as u,l as L}from"./ctx-db-companions-DKBBb0u8.mjs";import{sql as e}from"drizzle-orm";import{aggregateTableName as p}from"./aggregateTableName-CGi8gxeK.mjs";import{backfillSearchIndexesForTable as N}from"./backfillAggregateIndexes-BtC-XM_S.mjs";import{migrateCdcLog as h,migrateCdcMeta as R}from"./CDC_LOG_TABLE-gl0FuepJ.mjs";import{migrateClientWatermark as x}from"./CLIENT_WATERMARK_TABLE-CRnrAnJ2.mjs";import{migrateCommitSeq as l}from"./COMMIT_SEQ_FIELD-BUdOMG5y.mjs";import{migrateGlobalShapeSnapshot as O}from"./GLOBAL_SHAPE_SNAPSHOT_TABLE-BicDuO0a.mjs";import{migrateIdempotency as C}from"./IDEMPOTENCY_TABLE-DOpm_oMF.mjs";import{m as b}from"./ctx-db-relay-shapes-CakvRIFx.mjs";import{migrateSearchState as U}from"./SEARCH_STATE_TABLE-BCqn5ksa.mjs";import{migrateShapePokeCursor as $}from"./SHAPE_POKE_CURSOR_TABLE-ByJVDHds.mjs";import{runDrizzle as a}from"./runDrizzle-2ULFQR_k.mjs";import{D,e as g,d as T,t as X,i as G,g as F,a as M,b as B,A as I}from"./do-sql-bkXQEBl8.mjs";import{renderSql as k}from"./param-DlozcSQu.mjs";import{migrateDurableStreams as Y}from"./appendStreamChunk-8eH4HB1Q.mjs";import{rankTableName as v,sortColumnName as y}from"./RANK_TIEBREAK-D157XEqw.mjs";import{migrateReactorState as P}from"./REACTOR_STATE_TABLE-QPRFyxMS.mjs";import{recordSchemaVersion as j}from"./SCHEMA_HISTORY_MAX_VERSIONS-BluIj2s-.mjs";const K=e`_creationTime, id`,V=(r,o,n,i,t)=>{const m=a(r,e`SELECT sql FROM sqlite_master WHERE type = 'index' AND name = ${o} AND tbl_name = ${n}`).toArray()[0]?.sql;if(m==null)return;const f=c=>{const _=c.indexOf("(");return _===-1?void 0:c.slice(_,c.lastIndexOf(")")+1)},d=f(k("sqlite",T(o,n,i,t)).sql),E=f(m);d===void 0||E===void 0||d===E||a(r,e`DROP INDEX IF EXISTS ${e.identifier(o)}`)},w=(r,o,n)=>{for(const i of n.indexes){const t=`${o}_${i.name}`,s=i.unique??!1,m=e.join(i.fields.map(d=>g(d)),e`, `),f=s?m:e`${m}, ${K}`;V(r,t,o,f,s),a(r,T(t,o,f,s))}for(const[i,t]of X(n)){if(!t.unique)continue;const s=`${o}_unique_${i}`;a(r,T(s,o,g(i),!0))}},z=(r,o,n)=>{if(!(!n.searchIndexes||n.searchIndexes.length===0||!G(r))){for(const i of n.searchIndexes){const t=A(o,i.name);a(r,e`CREATE VIRTUAL TABLE IF NOT EXISTS ${e.identifier(t)} USING fts5(${e.identifier(u)}, ${e.identifier(L)} UNINDEXED)`),a(r,e`CREATE VIRTUAL TABLE IF NOT EXISTS ${e.identifier(`${t}__vocab`)} USING fts5vocab(${e.identifier(t)}, ${e.raw("instance")})`)}N(r,o,n)}},W=(r,o,n)=>{if(n.geoIndexes)for(const i of n.geoIndexes){const t=F(o,i.name);a(r,e`CREATE TABLE IF NOT EXISTS ${e.identifier(t)} (${e.identifier("__id__")} TEXT PRIMARY KEY, ${e.identifier("__geohash__")} TEXT NOT NULL, ${e.identifier("__lat__")} REAL NOT NULL, ${e.identifier("__lng__")} REAL NOT NULL)`);const s=`${o}__geo_${i.name}__btree`;a(r,T(s,t,e`${e.identifier("__geohash__")} ASC, ${e.identifier("__id__")} ASC`,!1))}},H=(r,o,n)=>{if(n.aggregateIndexes)for(const i of n.aggregateIndexes){const t=p(o,i.name);a(r,e`CREATE TABLE IF NOT EXISTS ${e.identifier(t)} (${M} TEXT PRIMARY KEY, ${B} REAL, ${I} INTEGER NOT NULL DEFAULT 0)`),a(r,e`PRAGMA table_info(${e.identifier(t)})`).toArray().some(m=>m.name==="__count__")||a(r,e`ALTER TABLE ${e.identifier(t)} ADD COLUMN ${I} INTEGER NOT NULL DEFAULT 0`)}},J=(r,o,n)=>{if(n.rankIndexes)for(const i of n.rankIndexes){const t=v(o,i.name),s=i.sortBy.map((c,_)=>y(_)),m=s.map(c=>e`${e.identifier(c)} BLOB`),f=m.length>0?e`, ${e.join(m,e`, `)}`:e``;a(r,e`CREATE TABLE IF NOT EXISTS ${e.identifier(t)} (${e.identifier("__id__")} TEXT PRIMARY KEY, ${e.identifier("__partition__")} TEXT NOT NULL${f})`);const d=[e`${e.identifier("__partition__")} ASC`];for(const[c,_]of s.entries()){const S=i.sortBy[c]?.direction;d.push(e`${e.identifier(_)} ${e.raw(S==="desc"?"DESC":"ASC")}`)}d.push(e`${e.identifier("__id__")} ASC`);const E=`${o}__rank_${i.name}__btree`;a(r,T(E,t,e.join(d,e`, `),!1))}},Ie=(r,o,n={})=>{n.schemaSnapshot!==void 0&&j(r,n.schemaSnapshot.hash,n.schemaSnapshot.json),U(r);for(const[i,t]of Object.entries(o.tables))t.shardMode?.kind!=="global"&&(a(r,e`CREATE TABLE IF NOT EXISTS ${e.identifier(i)} (
2
2
  id TEXT PRIMARY KEY,
3
3
  _creationTime REAL NOT NULL,
4
4
  ${e.identifier(D)} TEXT NOT NULL
@@ -1 +1 @@
1
- import{sql as o}from"drizzle-orm";import{runDrizzle as h}from"./runDrizzle-2ULFQR_k.mjs";import{e}from"./do-sql-DqQTxsj_.mjs";const E=(s,t,f,r)=>{const d=f-(t.after??0),i=[o`${e(t.field)} IS NOT NULL`,o`${e(t.field)} < ${d}`];t.softDeleteField!==void 0&&i.push(o`${e(t.softDeleteField)} IS NULL`);const l=o`SELECT id FROM ${o.identifier(t.table)} WHERE ${o.join(i,o` AND `)} LIMIT ${o.raw(String(Math.max(0,Math.floor(r))+1))}`,n=h(s,l).toArray(),a=n.length>r,$=n.slice(0,r).map(c=>c.id);return{hasMore:a,ids:$}};export{E as selectExpiredIds};
1
+ import{sql as o}from"drizzle-orm";import{runDrizzle as h}from"./runDrizzle-2ULFQR_k.mjs";import{e}from"./do-sql-bkXQEBl8.mjs";const E=(s,t,f,r)=>{const d=f-(t.after??0),i=[o`${e(t.field)} IS NOT NULL`,o`${e(t.field)} < ${d}`];t.softDeleteField!==void 0&&i.push(o`${e(t.softDeleteField)} IS NULL`);const l=o`SELECT id FROM ${o.identifier(t.table)} WHERE ${o.join(i,o` AND `)} LIMIT ${o.raw(String(Math.max(0,Math.floor(r))+1))}`,n=h(s,l).toArray(),a=n.length>r,$=n.slice(0,r).map(c=>c.id);return{hasMore:a,ids:$}};export{E as selectExpiredIds};
@@ -1 +1 @@
1
- import{sql as e}from"drizzle-orm";import{runDrizzle as m}from"./runDrizzle-2ULFQR_k.mjs";import{D as p,r as d,e as h}from"./do-sql-DqQTxsj_.mjs";import{sqliteInList as w}from"./param-DlozcSQu.mjs";import{c as S}from"./where-sql-DxCbgqDJ.mjs";import{serializeSqlValue as $}from"./serializeSqlValue-DbI1VQYM.mjs";const C={fieldRef:h,serialize:$},g=o=>{if(o.length!==0)return w(e`${e.identifier("id")}`,o,!1)},u=(o,i)=>{const r=[];i&&r.push(i);const t=S(o,C);return t&&r.push(t),r.length===0?e``:e` WHERE ${e.join(r,e` AND `)}`},v=(o,i,r)=>{const t=u(r,void 0),s=m(o,e`SELECT id, _creationTime, ${e.identifier(p)} FROM ${e.identifier(i)}${t}`).toArray(),f=[];for(const l of s){const n=d(l),{id:c}=l;n!==void 0&&typeof c=="string"&&f.push({doc:n,id:c})}return f},z=(o,i,r,t)=>{const s=new Map;if(t.length===0)return s;const f=u(r,g(t)),l=m(o,e`SELECT id, _creationTime, ${e.identifier(p)} FROM ${e.identifier(i)}${f}`).toArray();for(const n of l){const c=d(n),{id:a}=n;c!==void 0&&typeof a=="string"&&s.set(a,c)}return s};export{z as selectShapeMembers,v as selectShapeRows};
1
+ import{sql as e}from"drizzle-orm";import{runDrizzle as m}from"./runDrizzle-2ULFQR_k.mjs";import{D as p,r as d,e as h}from"./do-sql-bkXQEBl8.mjs";import{sqliteInList as w}from"./param-DlozcSQu.mjs";import{c as S}from"./where-sql-DxCbgqDJ.mjs";import{serializeSqlValue as $}from"./serializeSqlValue-DbI1VQYM.mjs";const C={fieldRef:h,serialize:$},g=o=>{if(o.length!==0)return w(e`${e.identifier("id")}`,o,!1)},u=(o,i)=>{const r=[];i&&r.push(i);const t=S(o,C);return t&&r.push(t),r.length===0?e``:e` WHERE ${e.join(r,e` AND `)}`},v=(o,i,r)=>{const t=u(r,void 0),s=m(o,e`SELECT id, _creationTime, ${e.identifier(p)} FROM ${e.identifier(i)}${t}`).toArray(),f=[];for(const l of s){const n=d(l),{id:c}=l;n!==void 0&&typeof c=="string"&&f.push({doc:n,id:c})}return f},z=(o,i,r,t)=>{const s=new Map;if(t.length===0)return s;const f=u(r,g(t)),l=m(o,e`SELECT id, _creationTime, ${e.identifier(p)} FROM ${e.identifier(i)}${f}`).toArray();for(const n of l){const c=d(n),{id:a}=n;c!==void 0&&typeof a=="string"&&s.set(a,c)}return s};export{z as selectShapeMembers,v as selectShapeRows};
@@ -1 +1 @@
1
- import{stableStringify as r}from"./stableStringify-DibjylKD.mjs";import{e as o}from"./wire-codec-CDds5uQW.mjs";const m=e=>r(o(e));export{m as stableWireKey};
1
+ import{stableStringify as r}from"./stableStringify-DibjylKD.mjs";import{e as o}from"./wire-codec-COhOSEe4.mjs";const m=e=>r(o(e));export{m as stableWireKey};
@@ -1 +1 @@
1
- import{t as w,f as R}from"./base64-DfpzS4o_.mjs";const o="$lunora.wire$",g=64,A=1024,m="__proto__",O={BigInt64Array,BigUint64Array,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array},p={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},j=r=>{if(r===null||typeof r!="object")return!1;const t=Object.getPrototypeOf(r);return t===null||t===Object.prototype},E=(r,t=0)=>{if(t>g)return!0;if(r===null)return!1;const c=typeof r;if(c==="string"||c==="boolean")return!1;if(c==="number")return!Number.isFinite(r);if(c!=="object")return!0;if(Array.isArray(r))return r.length>0&&r[0]===o?!0:r.some(f=>f===void 0||E(f,t+1));if(!j(r)||Object.hasOwn(r,m))return!0;for(const f of Object.keys(r)){const i=r[f];if(i!==void 0&&E(i,t+1))return!0}return!1},u=(r,t=0)=>{if(t>g)throw new RangeError(`wire-codec: value nesting exceeds the ${g}-level limit`);if(r===void 0)return[o,"undefined"];if(r===null)return null;const c=typeof r;if(c==="bigint")return[o,"bigint",r.toString()];if(c==="number"){const e=r;return Number.isNaN(e)?[o,"nan"]:e===1/0?[o,"inf"]:e===-1/0?[o,"-inf"]:e}if(c!=="object")return r;if(r instanceof Date)return[o,"date",u(r.getTime(),t+1)];if(r instanceof Error){const e=r,n={};for(const a of Object.keys(e))e[a]!==void 0&&(n[a]=u(e[a],t+1));const s=[o,"error",e.name,e.message,n];return e.cause!==void 0&&s.push(u(e.cause,t+1)),s}if(r instanceof URL)return[o,"url",r.href];if(r instanceof Map)return[o,"map",[...r.entries()].map(([e,n])=>[u(e,t+1),u(n,t+1)])];if(r instanceof Set)return[o,"set",[...r].map(e=>u(e,t+1))];if(r instanceof ArrayBuffer)return[o,"bytes",w(new Uint8Array(r)),"ArrayBuffer"];if(ArrayBuffer.isView(r)){const e=r,n=e.constructor.name,s=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return n==="Uint8Array"?[o,"bytes",w(s)]:[o,"bytes",w(s),n]}if(Array.isArray(r)){const e=r.map(n=>u(n,t+1));return e.length>0&&e[0]===o?[o,"arr",e]:e}if(!j(r)){const e=r.constructor?.name??"value";throw new TypeError(`wire-codec: cannot encode a ${e} over the Lunora wire — only plain objects, arrays, and the supported built-ins (Date, Error, URL, Map, Set, ArrayBuffer/typed arrays, bigint) round-trip`)}const f=r,i={};for(const e of Object.keys(f)){const n=f[e];if(n===void 0)continue;const s=u(n,t+1);e===m?Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:s,writable:!0}):i[e]=s}return i},y=(r,t=0)=>{if(t>g)throw new RangeError(`wire-codec: value nesting exceeds the ${g}-level limit`);if(r===null||typeof r!="object")return r;if(Array.isArray(r)){if(r[0]===o)switch(r[1]){case"-inf":return-1/0;case"arr":return r[2].map(e=>y(e,t+1));case"bigint":{const e=r[2];if(typeof e!="string"||e.length>A||!/^-?\d+$/.test(e))throw new RangeError(`wire-codec: invalid or over-long bigint (max ${A} digits)`);return BigInt(e)}case"date":return new Date(y(r[2],t+1));case"map":return new Map(r[2].map(([e,n])=>[y(e,t+1),y(n,t+1)]));case"set":return new Set(r[2].map(e=>y(e,t+1)));case"url":return new URL(r[2]);case"error":{const e=r[2],n=r[3],s=(Object.hasOwn(p,e)?p[e]:void 0)??Error,a=new s(n);a.name!==e&&Object.defineProperty(a,"name",{configurable:!0,value:e,writable:!0});const d=y(r[4],t+1);for(const b of Object.keys(d))b===m?Object.defineProperty(a,b,{configurable:!0,enumerable:!0,value:d[b],writable:!0}):a[b]=d[b];return r.length>5&&Object.defineProperty(a,"cause",{configurable:!0,value:y(r[5],t+1),writable:!0}),a}case"bytes":{const e=R(r[2]),n=r[3]??"Uint8Array";if(n==="ArrayBuffer")return e.buffer.byteLength===e.byteLength?e.buffer:e.slice().buffer;const s=Object.hasOwn(O,n)?O[n]:void 0;return s?new s(e.slice().buffer):e}case"inf":return 1/0;case"nan":return Number.NaN;case"undefined":return;default:return r.map(e=>y(e,t+1))}return r.map(i=>y(i,t+1))}const c=r,f={};for(const i of Object.keys(c)){const e=y(c[i],t+1);i===m?Object.defineProperty(f,i,{configurable:!0,enumerable:!0,value:e,writable:!0}):f[i]=e}return f};export{y as d,u as e,j as i,E as n};
1
+ import{t as w,f as l}from"./base64-DfpzS4o_.mjs";const o="$lunora.wire$",m=64,A=1024,g="__proto__",p={BigInt64Array,BigUint64Array,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array},O={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},j=r=>{if(r===null||typeof r!="object")return!1;const t=Object.getPrototypeOf(r);return t===null||t===Object.prototype},E=(r,t=0)=>{if(t>m)return!0;if(r===null)return!1;const c=typeof r;if(c==="string"||c==="boolean")return!1;if(c==="number")return!Number.isFinite(r);if(c!=="object")return!0;if(Array.isArray(r))return r.length>0&&r[0]===o?!0:r.some(f=>f===void 0||E(f,t+1));if(!j(r)||Object.hasOwn(r,g))return!0;for(const f of Object.keys(r)){const i=r[f];if(i!==void 0&&E(i,t+1))return!0}return!1},u=(r,t=0)=>{if(t>m)throw new RangeError(`wire-codec: value nesting exceeds the ${m}-level limit`);if(r===void 0)return[o,"undefined"];if(r===null)return null;const c=typeof r;if(c==="bigint")return[o,"bigint",r.toString()];if(c==="number"){const e=r;return Number.isNaN(e)?[o,"nan"]:e===1/0?[o,"inf"]:e===-1/0?[o,"-inf"]:e}if(c!=="object")return r;if(r instanceof Date)return[o,"date",u(r.getTime(),t+1)];if(r instanceof Error){const e=r,n={};for(const a of Object.keys(e))e[a]!==void 0&&(n[a]=u(e[a],t+1));const s=[o,"error",e.name,e.message,n];return e.cause!==void 0&&s.push(u(e.cause,t+1)),s}if(r instanceof URL)return[o,"url",r.href];if(r instanceof Map)return[o,"map",[...r.entries()].map(([e,n])=>[u(e,t+1),u(n,t+1)])];if(r instanceof Set)return[o,"set",[...r].map(e=>u(e,t+1))];if(r instanceof ArrayBuffer)return[o,"bytes",w(new Uint8Array(r)),"ArrayBuffer"];if(ArrayBuffer.isView(r)){const e=r,n=e.constructor.name,s=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return n==="Uint8Array"?[o,"bytes",w(s)]:[o,"bytes",w(s),n]}if(Array.isArray(r)){const e=r.map(n=>u(n,t+1));return e.length>0&&e[0]===o?[o,"arr",e]:e}if(!j(r)){const e=r.constructor?.name??"value";throw new TypeError(`wire-codec: cannot encode a ${e} over the Lunora wire — only plain objects, arrays, and the supported built-ins (Date, Error, URL, Map, Set, ArrayBuffer/typed arrays, bigint) round-trip`)}const f=r,i={};for(const e of Object.keys(f)){const n=f[e];if(n===void 0)continue;const s=u(n,t+1);e===g?Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:s,writable:!0}):i[e]=s}return i},y=(r,t=0)=>{if(t>m)throw new RangeError(`wire-codec: value nesting exceeds the ${m}-level limit`);if(r===null||typeof r!="object")return r;if(Array.isArray(r)){if(r[0]===o)switch(r[1]){case"-inf":return-1/0;case"arr":return r[2].map(e=>y(e,t+1));case"bigint":{const e=r[2];if(typeof e!="string"||e.length>A||!/^-?\d+$/.test(e))throw new RangeError(`wire-codec: invalid or over-long bigint (max ${A} digits)`);return BigInt(e)}case"date":return new Date(y(r[2],t+1));case"map":{const e=r[2];return new Map(e.map(n=>{if(!Array.isArray(n)||n.length!==2)throw new TypeError("wire-codec: malformed map entry — expected a [key, value] pair");return[y(n[0],t+1),y(n[1],t+1)]}))}case"set":return new Set(r[2].map(e=>y(e,t+1)));case"url":return new URL(r[2]);case"error":{const e=r[2],n=r[3],s=(Object.hasOwn(O,e)?O[e]:void 0)??Error,a=new s(n);a.name!==e&&Object.defineProperty(a,"name",{configurable:!0,value:e,writable:!0});const d=y(r[4],t+1);for(const b of Object.keys(d))b===g?Object.defineProperty(a,b,{configurable:!0,enumerable:!0,value:d[b],writable:!0}):a[b]=d[b];return r.length>5&&Object.defineProperty(a,"cause",{configurable:!0,value:y(r[5],t+1),writable:!0}),a}case"bytes":{const e=l(r[2]),n=r[3]??"Uint8Array";if(n==="ArrayBuffer")return e.buffer.byteLength===e.byteLength?e.buffer:e.slice().buffer;const s=Object.hasOwn(p,n)?p[n]:void 0;return s?new s(e.slice().buffer):e}case"inf":return 1/0;case"nan":return Number.NaN;case"undefined":return;default:return r.map(e=>y(e,t+1))}return r.map(i=>y(i,t+1))}const c=r,f={};for(const i of Object.keys(c)){const e=y(c[i],t+1);i===g?Object.defineProperty(f,i,{configurable:!0,enumerable:!0,value:e,writable:!0}):f[i]=e}return f};export{y as d,u as e,j as i,E as n};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/shard-engine",
3
- "version": "1.0.0-alpha.48",
3
+ "version": "1.0.0-alpha.49",
4
4
  "description": "Host-neutral reactive engine for Lunora: per-shard state, OCC, CDC, reactive subscriptions, and the poke protocol. Consumes @lunora/platform host contracts and can be mounted on any platform host.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -48,8 +48,8 @@
48
48
  "access": "public"
49
49
  },
50
50
  "dependencies": {
51
- "@lunora/errors": "1.0.0-alpha.26",
52
- "@lunora/platform": "1.0.0-alpha.22",
51
+ "@lunora/errors": "1.0.0-alpha.27",
52
+ "@lunora/platform": "1.0.0-alpha.23",
53
53
  "drizzle-orm": "^0.45.2"
54
54
  },
55
55
  "engines": {
@@ -1 +0,0 @@
1
- import{LunoraError as v}from"@lunora/errors";import{m as $,n as y}from"./do-sql-DqQTxsj_.mjs";import{quoteIdentifier as d}from"./quoteIdentifier-CObIFRhb.mjs";import{d as L}from"./wire-codec-CDds5uQW.mjs";const te="__lunora_admin__:",re="__lunora_relation__:",ne="__lunora_flags__:",se={applyCdc:"__lunora_admin__:applyCdc",aiAvailable:"__lunora_admin__:aiAvailable",aiChartConfig:"__lunora_admin__:aiChartConfig",aiGenerateSql:"__lunora_admin__:aiGenerateSql",aiTableFilter:"__lunora_admin__:aiTableFilter",assignIssue:"__lunora_admin__:assignIssue",backfillSearch:"__lunora_admin__:backfillSearch",backRelationCounts:"__lunora_admin__:backRelationCounts",cdcSync:"__lunora_admin__:cdcSync",clearCapturedMail:"__lunora_admin__:clearCapturedMail",clearQueueMessages:"__lunora_admin__:clearQueueMessages",clearTable:"__lunora_admin__:clearTable",createWorkflowInstance:"__lunora_admin__:createWorkflowInstance",deleteRows:"__lunora_admin__:deleteRows",describeTable:"__lunora_admin__:describeTable",describeTables:"__lunora_admin__:describeTables",explainIssue:"__lunora_admin__:explainIssue",exportShard:"__lunora_admin__:exportShard",facetColumn:"__lunora_admin__:facetColumn",getAdvisories:"__lunora_admin__:getAdvisories",getAdvisorProcedures:"__lunora_admin__:getAdvisorProcedures",getAuditLog:"__lunora_admin__:getAuditLog",getAuthMetrics:"__lunora_admin__:getAuthMetrics",getCapturedMail:"__lunora_admin__:getCapturedMail",getFanoutMetrics:"__lunora_admin__:getFanoutMetrics",getFunctionStats:"__lunora_admin__:getFunctionStats",getIssues:"__lunora_admin__:getIssues",getMetricHistory:"__lunora_admin__:getMetricHistory",getMetricSeries:"__lunora_admin__:getMetricSeries",listSubscriptions:"__lunora_admin__:listSubscriptions",listTableIndexes:"__lunora_admin__:listTableIndexes",listTablesIndexes:"__lunora_admin__:listTablesIndexes",getLogs:"__lunora_admin__:getLogs",getMetrics:"__lunora_admin__:getMetrics",getPitrBookmark:"__lunora_admin__:getPitrBookmark",getQueryInsights:"__lunora_admin__:getQueryInsights",getQueueMessages:"__lunora_admin__:getQueueMessages",getRequestLog:"__lunora_admin__:getRequestLog",getSecurityAudit:"__lunora_admin__:getSecurityAudit",getSettings:"__lunora_admin__:getSettings",getTraces:"__lunora_admin__:getTraces",getWorkflowInstanceStatus:"__lunora_admin__:getWorkflowInstanceStatus",ignoreIssue:"__lunora_admin__:ignoreIssue",importShard:"__lunora_admin__:importShard",listFlags:"__lunora_admin__:listFlags",listReactors:"__lunora_admin__:listReactors",listQueues:"__lunora_admin__:listQueues",lintSql:"__lunora_admin__:lintSql",listTables:"__lunora_admin__:listTables",listWorkflows:"__lunora_admin__:listWorkflows",maskPolicies:"__lunora_admin__:maskPolicies",migrationStatus:"__lunora_admin__:migrationStatus",pitrRestore:"__lunora_admin__:pitrRestore",rankBefore:"__lunora_admin__:rankBefore",rankPage:"__lunora_admin__:rankPage",readTablePage:"__lunora_admin__:readTablePage",recordAuthEvent:"__lunora_admin__:recordAuthEvent",recordContainerEvent:"__lunora_admin__:recordContainerEvent",recordMail:"__lunora_admin__:recordMail",recordQueueMessage:"__lunora_admin__:recordQueueMessage",replayQueueMessage:"__lunora_admin__:replayQueueMessage",resolveIssue:"__lunora_admin__:resolveIssue",rlsPolicies:"__lunora_admin__:rlsPolicies",schemaHistory:"__lunora_admin__:schemaHistory",schemaVersion:"__lunora_admin__:schemaVersion",runAs:"__lunora_admin__:runAs",runMigration:"__lunora_admin__:runMigration",runSql:"__lunora_admin__:runSql",sendQueueMessage:"__lunora_admin__:sendQueueMessage",sendTestMail:"__lunora_admin__:sendTestMail",setIssueSeverity:"__lunora_admin__:setIssueSeverity",storageOrphans:"__lunora_admin__:storageOrphans",storageReferences:"__lunora_admin__:storageReferences",storageRules:"__lunora_admin__:storageRules",studioFeatures:"__lunora_admin__:studioFeatures",writeRow:"__lunora_admin__:writeRow"},D=50,g=500,U=30,W=200,m="__doc__",O=e=>{try{const t=JSON.parse(e);return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch{return}},j=e=>{const{[y]:t,...r}=e;return t===void 0?r:t===null||typeof t!="object"||Array.isArray(t)?{[y]:t,...r}:{...r,...L(t)}},Q=(e,t)=>{if(!e.includes(m))return{columns:e,rows:t};const r=[];for(const s of t){const a=s[m],i=typeof a=="string"?O(a):void 0;if(i===void 0)return{columns:e,rows:t};const c=Object.fromEntries(Object.entries(s).filter(([u])=>u!==m));r.push({...c,...j(i)})}const n=e.filter(s=>s!==m),o=[],_=new Set(n);for(const s of r)for(const a of Object.keys(s))_.has(a)||(_.add(a),o.push(a));return{columns:[...n,...o],rows:r}},F=e=>`instr(lower(CAST(${e} AS TEXT)), lower(?)) > 0`,I=e=>e.startsWith("sqlite_")||e.startsWith("_cf_")||e.startsWith("__miniflare")||e.startsWith("__lunora")||e.includes("__fts_"),E=(e,t,r)=>Math.min(Math.max(e,t),r),x=(e,t)=>{const r=e.exec(`SELECT COUNT(*) AS c FROM ${t}`).one();return Number(r.c)},oe=e=>{const t=e.exec("SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name").toArray(),r=[];for(const{name:n}of t)I(n)||r.push({name:n,rowCount:x(e,d(n))});return r},P=(e,t)=>e.exec("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ? LIMIT 1",t).toArray().length>0,C=(e,t)=>{if(I(t)||!P(e,t))throw new v("UNKNOWN_TABLE",`unknown table: ${t}`,{status:404})},S=(e,t)=>e.exec(`PRAGMA table_info(${t})`).toArray().map(r=>r.name),q={eq:"=",gt:">",gte:">=",lt:"<",lte:"<=",ne:"<>"},G=e=>typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):"",M=(e,t)=>{const r=t.includes(e),n=t.includes(m);if(!(!r&&!n))return r?{expression:d(e),params:[]}:{expression:`json_extract(${d(m)}, ?)`,params:[`$.${$(e)}`]}},H=(e,t)=>{const r=M(e.column,t);if(r===void 0)return;const{expression:n,params:o}=r;return e.operator==="contains"?{params:[...o,G(e.value)],sql:F(n)}:{params:[...o,e.value],sql:`${n} ${q[e.operator]} ?`}},B=/^(\d{4})(?:-(\d{2}))?(?:-(\d{2}))?$/u,X=e=>{const t=B.exec(e.trim());if(t===null)return;const r=Number(t[1]),n=t[2]===void 0?void 0:Number(t[2]),o=t[3]===void 0?void 0:Number(t[3]);if(n!==void 0&&(n<1||n>12)||o!==void 0&&(o<1||o>31)||r<100)return;const _=Date.UTC(r,(n??1)-1,o??1);if(o!==void 0&&new Date(_).getUTCDate()!==o)return;let s;return o!==void 0?s=Date.UTC(r,(n??1)-1,o+1):n===void 0?s=Date.UTC(r+1,0,1):s=Date.UTC(r,n,1),{from:_,to:s}},A=(e,t,r)=>{const n=[],o=[];if(t!==""&&e.length>0){const _=e.map(a=>F(d(a)));o.push(...e.map(()=>t));const s=X(t);if(s!==void 0)for(const a of e)_.push(`(${d(a)} >= ? AND ${d(a)} < ?)`),o.push(s.from,s.to);n.push(`(${_.join(" OR ")})`)}for(const _ of r??[]){const s=H(_,e);s!==void 0&&(n.push(`(${s.sql})`),o.push(...s.params))}return n.length===0?void 0:{parameters:o,where:n.join(" AND ")}},K=(e,t)=>{if(e===void 0)return;const r=M(e.column,t);if(r===void 0)return;const n=e.direction==="desc"?"DESC":"ASC";return{params:r.params,sql:`${r.expression} ${n}`}},ae=(e,t)=>{const{table:r}=t;C(e,r);const n=E(Math.trunc(t.limit??D),1,g),o=Math.max(0,Math.trunc(t.offset??0)),_=d(r),s=S(e,_),a=t.search?.trim()??"",i=b=>{if(t.refs===void 0)return b;const T={};for(const k of b.columns){const w=t.refs[k];w!==void 0&&(T[k]=w)}return Object.keys(T).length>0?{...b,refs:T}:b},c=A(s,a,t.filters),u=K(t.orderBy,s),l=c===void 0?"":` WHERE ${c.where}`,f=u===void 0?"":` ORDER BY ${u.sql}`,p=c?.parameters??[],h=u?.params??[];let R;t.skipCount||(R=c===void 0?x(e,_):Number(e.exec(`SELECT COUNT(*) AS c FROM ${_}${l}`,...p).one().c));const N=e.exec(`SELECT * FROM ${_}${l}${f} LIMIT ? OFFSET ?`,...p,...h,n,o).toArray();return i({...Q(s,N),total:R})},_e=(e,t)=>{const{table:r}=t;C(e,r);const n=E(Math.trunc(t.limit??g),1,g),o=d(r),_=S(e,o),s=t.search?.trim()??"",a=A(_,s,t.filters),i=a===void 0?e.exec(`SELECT id FROM ${o} LIMIT ?`,n+1).toArray():e.exec(`SELECT id FROM ${o} WHERE ${a.where} LIMIT ?`,...a.parameters,n+1).toArray(),c=i.length>n,u=i.slice(0,n).map(l=>l.id);return{hasMore:c,ids:u}},Y=(e,t,r)=>{const n=new Set(r.filter(_=>_!==m));if(!r.includes(m))return n;const o=e.exec(`SELECT ${d(m)} AS doc FROM ${t} LIMIT ?`,g).toArray();for(const{doc:_}of o){const s=typeof _=="string"?O(_):void 0;if(s!==void 0)for(const a of Object.keys(s))n.add(a)}return n},ie=(e,t)=>{const{column:r,table:n}=t;C(e,n);const o=d(n),_=S(e,o);if(!Y(e,o,_).has(r))throw new v("UNKNOWN_COLUMN",`unknown column: ${r}`,{status:404});const s=M(r,_);if(s===void 0)throw new v("UNKNOWN_COLUMN",`unknown column: ${r}`,{status:404});const a=E(Math.trunc(t.limit??U),1,W),i=t.search?.trim()??"",c=A(_,i,t.filters),u=c===void 0?"":` WHERE ${c.where}`,l=c?.parameters??[],f=e.exec(`SELECT ${s.expression} AS value, COUNT(*) AS count FROM ${o}${u} GROUP BY ${s.expression} ORDER BY count DESC LIMIT ?`,...s.params,...l,...s.params,a+1).toArray();return{truncated:f.length>a,values:f.slice(0,a).map(h=>({count:Number(h.count),value:h.value}))}},ce=(e,t,r)=>{const n={},o=r.slice(0,g);for(const s of o)n[s]=[];if(o.length===0)return{references:n,storageColumns:t};const _=o.map(()=>"?").join(", ");for(const[s,a]of Object.entries(t)){if(I(s)||!P(e,s))continue;const i=d(s),c=S(e,i);for(const u of a){const l=M(u,c);if(l===void 0)continue;const f=e.exec(`SELECT id, ${l.expression} AS ref FROM ${i} WHERE ${l.expression} IN (${_})`,...l.params,...l.params,...o).toArray();for(const p of f)n[p.ref]?.push({column:u,id:p.id,table:s})}}return{references:n,storageColumns:t}},ue=e=>{const t=e.map((n,o)=>{const _=Object.values(n.subs??{}).map(s=>({args:s.args,functionPath:s.functionPath,table:s.table}));return{admin:n.admin===!0,id:o,subscriptions:_}}),r=t.reduce((n,o)=>n+o.subscriptions.length,0);return{connections:t,totalConnections:t.length,totalSubscriptions:r}},V=20,le=()=>({maxMs:0,passes:0,peakSocketsIterated:0,socketsDelivered:0,socketsIterated:0,totalMs:0}),de=()=>({run:0,served:0}),me=()=>({drains:0,pairsSkipped:0}),fe=(e,t,r)=>({drains:e.drains+t,pairsSkipped:e.pairsSkipped+r}),pe=(e,t,r)=>({run:e.run+t,served:e.served+r}),ge=(e,t,r,n)=>({maxMs:Math.max(e.maxMs,n),passes:e.passes+1,peakSocketsIterated:Math.max(e.peakSocketsIterated,t),socketsDelivered:e.socketsDelivered+r,socketsIterated:e.socketsIterated+t,totalMs:e.totalMs+n}),he=(e,t=V)=>{const r=new Map,n=new Map;for(const s of e){for(const a of Object.values(s.shapes??{})){const i=a.name??"(unknown shape)";r.set(i,(r.get(i)??0)+1)}for(const a of s.whispers??[])n.set(a,(n.get(a)??0)+1)}const o=[...[...r].map(([s,a])=>({kind:"shape",subscribers:a,topic:s})),...[...n].map(([s,a])=>({kind:"whisper",subscribers:a,topic:s}))];return o.sort((s,a)=>a.subscribers-s.subscribers||s.topic.localeCompare(a.topic)),{peakSubscribers:o[0]?.subscribers??0,topics:o.slice(0,t),totalConnections:e.length}};export{se as ADMIN_FUNCTIONS,te as ADMIN_FUNCTION_PREFIX,V as DEFAULT_FANOUT_TOPIC_LIMIT,ne as FLAGS_FUNCTION_PREFIX,g as MAX_PAGE_SIZE,re as RELATION_FUNCTION_PREFIX,le as createFanoutCounters,me as createGlobalPollCounters,de as createShapeProbeCounters,X as datePrefixRange,ie as facetColumn,ce as findStorageReferences,oe as listTables,ae as readTablePage,ge as recordFanoutPass,fe as recordGlobalPollPass,pe as recordShapeProbePass,_e as selectMatchingIds,he as summarizeFanoutTopics,ue as summarizeSubscriptions};
@@ -1 +0,0 @@
1
- import{c as l,i as C,r as R}from"./ctx-db-companions-BeVsHnEe.mjs";import"./AGGREGATE_SQL_FUNCTION-m1iUU1rv.mjs";import"./aggregateTableName-XtEbp1DE.mjs";import"./runDrizzle-2ULFQR_k.mjs";import"./do-sql-DqQTxsj_.mjs";import"./param-DlozcSQu.mjs";import"./GEO_DEFAULT_PRECISION-CqpQZ-J_.mjs";import"./CURSOR_PREFIX-CheBVHA7.mjs";import"./RANK_TIEBREAK-DBzb8aDX.mjs";import"./sql-projection-BqmxFxQU.mjs";import"./serializeSqlValue-DbI1VQYM.mjs";export{l as createCompanionSync,C as insertRankRow,R as rankColumnsSql};