@lunora/do 1.0.0-alpha.301 → 1.0.0-alpha.302

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/dist/index.d.mts CHANGED
@@ -1635,6 +1635,8 @@ declare abstract class ShardDO {
1635
1635
  * not throw.
1636
1636
  */
1637
1637
  private afterCommitTail;
1638
+ /** Links on {@link ShardDO.afterCommitTail} not yet settled. See {@link ShardDO.hasUnfinishedWork}. */
1639
+ private unfinishedAfterCommitLinks;
1638
1640
  /**
1639
1641
  * True once a dispatch's bounded wait for its link on
1640
1642
  * {@link ShardDO.afterCommitTail} expired — i.e. a hook is stuck on a remote
@@ -2168,6 +2170,8 @@ declare abstract class ShardDO {
2168
2170
  private readonly liveSubscribers;
2169
2171
  /** The keepalive timer for open live streams. Runs only while at least one is open. */
2170
2172
  private liveKeepalive;
2173
+ /** SSE response bodies this instance created that are neither closed nor cancelled. See {@link ShardDO.hasUnfinishedWork}. */
2174
+ private openLiveStreams;
2171
2175
  /**
2172
2176
  * Per-socket {@link AbortController} map keyed by stream id, used to
2173
2177
  * propagate a client unsubscribe (or a socket close) into the user
@@ -2519,6 +2523,16 @@ declare abstract class ShardDO {
2519
2523
  * or one second of successful request-log rows.
2520
2524
  */
2521
2525
  flushBeforeClose(): void;
2526
+ /**
2527
+ * Whether this instance holds work in memory that a close would lose: a response body it created is still streaming
2528
+ * (its subscribers live only here), or an after-commit link is unfinished. A bounded wait can return with a hook still
2529
+ * running on the chain; an instance dropped then would let a later write on a fresh instance start a new chain that
2530
+ * overtakes it, so an external projection would see writes out of commit order.
2531
+ *
2532
+ * Node: the host keeps a shard open while this answers true. Cloudflare keeps the instance alive for an open response
2533
+ * body and pending work on its own and never calls it.
2534
+ */
2535
+ hasUnfinishedWork(): boolean;
2522
2536
  /**
2523
2537
  * Whether an upgrade may take a pending slot; an authenticated one always may. Closes
2524
2538
  * the pending sockets past their connect deadline first, so the count is of live ones.
package/dist/index.d.ts CHANGED
@@ -1635,6 +1635,8 @@ declare abstract class ShardDO {
1635
1635
  * not throw.
1636
1636
  */
1637
1637
  private afterCommitTail;
1638
+ /** Links on {@link ShardDO.afterCommitTail} not yet settled. See {@link ShardDO.hasUnfinishedWork}. */
1639
+ private unfinishedAfterCommitLinks;
1638
1640
  /**
1639
1641
  * True once a dispatch's bounded wait for its link on
1640
1642
  * {@link ShardDO.afterCommitTail} expired — i.e. a hook is stuck on a remote
@@ -2168,6 +2170,8 @@ declare abstract class ShardDO {
2168
2170
  private readonly liveSubscribers;
2169
2171
  /** The keepalive timer for open live streams. Runs only while at least one is open. */
2170
2172
  private liveKeepalive;
2173
+ /** SSE response bodies this instance created that are neither closed nor cancelled. See {@link ShardDO.hasUnfinishedWork}. */
2174
+ private openLiveStreams;
2171
2175
  /**
2172
2176
  * Per-socket {@link AbortController} map keyed by stream id, used to
2173
2177
  * propagate a client unsubscribe (or a socket close) into the user
@@ -2519,6 +2523,16 @@ declare abstract class ShardDO {
2519
2523
  * or one second of successful request-log rows.
2520
2524
  */
2521
2525
  flushBeforeClose(): void;
2526
+ /**
2527
+ * Whether this instance holds work in memory that a close would lose: a response body it created is still streaming
2528
+ * (its subscribers live only here), or an after-commit link is unfinished. A bounded wait can return with a hook still
2529
+ * running on the chain; an instance dropped then would let a later write on a fresh instance start a new chain that
2530
+ * overtakes it, so an external projection would see writes out of commit order.
2531
+ *
2532
+ * Node: the host keeps a shard open while this answers true. Cloudflare keeps the instance alive for an open response
2533
+ * body and pending work on its own and never calls it.
2534
+ */
2535
+ hasUnfinishedWork(): boolean;
2522
2536
  /**
2523
2537
  * Whether an upgrade may take a pending slot; an authenticated one always may. Closes
2524
2538
  * the pending sockets past their connect deadline first, so the count is of live ones.
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{AdminRevocationDO as a}from"./packem_shared/AdminRevocationDO-DHjoZWfF.mjs";import{installDeliveryFence as t}from"./packem_shared/installDeliveryFence-B6M9KOnb.mjs";import{MERGED_ROLES as S,mergeDurableObjects as i,roleNamespace as l}from"./packem_shared/MERGED_ROLES-BAMAmIcW.mjs";import{serveRelationFanout as n}from"./packem_shared/serveRelationFanout-Bms_fuoY.mjs";import{SESSION_DO_TTL_DEFAULT as d,SessionDO as p}from"./packem_shared/SESSION_DO_TTL_DEFAULT-DSvTwRjc.mjs";import{ROOT_DO_SIZE_WARN_BYTES as D,ROOT_SHARD_NAME as O,ShardDO as E}from"./packem_shared/ROOT_DO_SIZE_WARN_BYTES-Dj8nZ80f.mjs";import{SHARD_REGISTRY_DO_NAME as h,ShardRegistryDO as x,hostedShardRegistry as f}from"./packem_shared/SHARD_REGISTRY_DO_NAME-Dbh8JQJQ.mjs";import{createStableIdFactory as A,createStableRandomFactory as I}from"./packem_shared/createStableIdFactory-DPDT_chw.mjs";import{createShardAlarms as b,createShardDirectory as M,createShardHost as N,createShardKvStore as g,createShardPlatform as y,createSocketHost as k,createWorkerPlatform as F}from"@lunora/platform-cloudflare";import{REPROJECTION_MIGRATION_PREFIX as L,UNVOUCHABLE_DEP as v,applyCdcChanges as H,assertShapeShardable as P,backfillSearchIndexes as j,backfillVectorIndexes as U,buildReprojectionMigration as w,clearMemoryTables as G,countLegacyRows as V,createReadFootprint as B,createShardCtxDb as W,exportShardRows as Y,importShardRows as J,isSourceDue as K,markUnvouchableReads as X,pullExternalSourceIncrementalTick as Z,pullExternalSourceTick as q,reprojectionMigrationId as z,reprojectionTables as Q,runDataMigration as $,runShardMigrations as ee,subscriptionListDeltas as re}from"@lunora/shard-engine";import{A as oe}from"./packem_shared/admin-token-DrufJIZV.mjs";export{oe as ADMIN_REVOCATION_DO_NAME,a as AdminRevocationDO,S as MERGED_ROLES,L as REPROJECTION_MIGRATION_PREFIX,D as ROOT_DO_SIZE_WARN_BYTES,O as ROOT_SHARD_NAME,d as SESSION_DO_TTL_DEFAULT,h as SHARD_REGISTRY_DO_NAME,p as SessionDO,E as ShardDO,x as ShardRegistryDO,v as UNVOUCHABLE_DEP,H as applyCdcChanges,P as assertShapeShardable,j as backfillSearchIndexes,U as backfillVectorIndexes,w as buildReprojectionMigration,G as clearMemoryTables,V as countLegacyRows,B as createReadFootprint,b as createShardAlarms,W as createShardCtxDb,M as createShardDirectory,N as createShardHost,g as createShardKvStore,y as createShardPlatform,k as createSocketHost,A as createStableIdFactory,I as createStableRandomFactory,F as createWorkerPlatform,Y as exportShardRows,f as hostedShardRegistry,J as importShardRows,t as installDeliveryFence,K as isSourceDue,X as markUnvouchableReads,i as mergeDurableObjects,Z as pullExternalSourceIncrementalTick,q as pullExternalSourceTick,z as reprojectionMigrationId,Q as reprojectionTables,l as roleNamespace,$ as runDataMigration,ee as runShardMigrations,n as serveRelationFanout,re as subscriptionListDeltas};
1
+ import{AdminRevocationDO as a}from"./packem_shared/AdminRevocationDO-DHjoZWfF.mjs";import{installDeliveryFence as t}from"./packem_shared/installDeliveryFence-B6M9KOnb.mjs";import{MERGED_ROLES as S,mergeDurableObjects as i,roleNamespace as l}from"./packem_shared/MERGED_ROLES-BAMAmIcW.mjs";import{serveRelationFanout as n}from"./packem_shared/serveRelationFanout-Bms_fuoY.mjs";import{SESSION_DO_TTL_DEFAULT as d,SessionDO as p}from"./packem_shared/SESSION_DO_TTL_DEFAULT-DSvTwRjc.mjs";import{ROOT_DO_SIZE_WARN_BYTES as D,ROOT_SHARD_NAME as O,ShardDO as E}from"./packem_shared/ROOT_DO_SIZE_WARN_BYTES-BvLBzieD.mjs";import{SHARD_REGISTRY_DO_NAME as h,ShardRegistryDO as x,hostedShardRegistry as f}from"./packem_shared/SHARD_REGISTRY_DO_NAME-Dbh8JQJQ.mjs";import{createStableIdFactory as A,createStableRandomFactory as I}from"./packem_shared/createStableIdFactory-DPDT_chw.mjs";import{createShardAlarms as b,createShardDirectory as M,createShardHost as N,createShardKvStore as g,createShardPlatform as y,createSocketHost as k,createWorkerPlatform as F}from"@lunora/platform-cloudflare";import{REPROJECTION_MIGRATION_PREFIX as L,UNVOUCHABLE_DEP as v,applyCdcChanges as H,assertShapeShardable as P,backfillSearchIndexes as j,backfillVectorIndexes as U,buildReprojectionMigration as w,clearMemoryTables as G,countLegacyRows as V,createReadFootprint as B,createShardCtxDb as W,exportShardRows as Y,importShardRows as J,isSourceDue as K,markUnvouchableReads as X,pullExternalSourceIncrementalTick as Z,pullExternalSourceTick as q,reprojectionMigrationId as z,reprojectionTables as Q,runDataMigration as $,runShardMigrations as ee,subscriptionListDeltas as re}from"@lunora/shard-engine";import{A as oe}from"./packem_shared/admin-token-DrufJIZV.mjs";export{oe as ADMIN_REVOCATION_DO_NAME,a as AdminRevocationDO,S as MERGED_ROLES,L as REPROJECTION_MIGRATION_PREFIX,D as ROOT_DO_SIZE_WARN_BYTES,O as ROOT_SHARD_NAME,d as SESSION_DO_TTL_DEFAULT,h as SHARD_REGISTRY_DO_NAME,p as SessionDO,E as ShardDO,x as ShardRegistryDO,v as UNVOUCHABLE_DEP,H as applyCdcChanges,P as assertShapeShardable,j as backfillSearchIndexes,U as backfillVectorIndexes,w as buildReprojectionMigration,G as clearMemoryTables,V as countLegacyRows,B as createReadFootprint,b as createShardAlarms,W as createShardCtxDb,M as createShardDirectory,N as createShardHost,g as createShardKvStore,y as createShardPlatform,k as createSocketHost,A as createStableIdFactory,I as createStableRandomFactory,F as createWorkerPlatform,Y as exportShardRows,f as hostedShardRegistry,J as importShardRows,t as installDeliveryFence,K as isSourceDue,X as markUnvouchableReads,i as mergeDurableObjects,Z as pullExternalSourceIncrementalTick,q as pullExternalSourceTick,z as reprojectionMigrationId,Q as reprojectionTables,l as roleNamespace,$ as runDataMigration,ee as runShardMigrations,n as serveRelationFanout,re as subscriptionListDeltas};