@morlay/session-rdb 0.0.18 → 0.0.20

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 (32) hide show
  1. package/dist/artifact.d.mts +1 -1
  2. package/dist/artifact.mjs +1 -1
  3. package/dist/{import-DZIAjOUr.mjs → branch-Co6xlbi0.mjs} +1 -186
  4. package/dist/import.d.mts +3 -2
  5. package/dist/import.mjs +197 -1
  6. package/dist/{index-BEKoV1Uy.d.mts → index-D55G9n4k.d.mts} +4 -3
  7. package/dist/index.d.mts +2 -2
  8. package/dist/index.mjs +94 -39
  9. package/dist/{magic-string.es-BWtG0AyA.mjs → magic-string.es-BgJoa-3K.mjs} +2 -2
  10. package/dist/{schema-Bo6Hy5gW.d.mts → schema-BkQN5GyT.d.mts} +36 -47
  11. package/dist/{sqlite-BIPdMNQb.mjs → sqlite-DYExtbLo.mjs} +27 -6
  12. package/dist/storage.d.mts +1 -1
  13. package/dist/storage.mjs +1 -1
  14. package/dist/testing.d.mts +2 -1
  15. package/dist/testing.mjs +22 -21
  16. package/drizzle/postgres/20260910120001_v3_storage_tables/snapshot.json +25 -78
  17. package/drizzle/postgres/20260910130001_v3_session_title_backfill/snapshot.json +25 -78
  18. package/drizzle/sqlite/20260910120000_v3_storage_tables/snapshot.json +25 -78
  19. package/drizzle/sqlite/20260910130000_v3_session_title_backfill/snapshot.json +25 -78
  20. package/package.json +4 -3
  21. package/src/entities/v3/workspace-state.ts +1 -1
  22. package/src/import-storages.ts +8 -3
  23. package/src/import.ts +41 -4
  24. package/src/index.ts +10 -2
  25. package/src/postgres.ts +15 -9
  26. package/src/session-query.ts +27 -0
  27. package/src/storage-takeover/index.ts +8 -8
  28. package/src/storage-takeover/projection-cache.ts +50 -24
  29. package/src/storage-takeover/repository.ts +66 -20
  30. package/src/storage-takeover/storage-backend.ts +65 -21
  31. package/src/storage-takeover/types.ts +11 -3
  32. package/src/testing.ts +3 -0
package/dist/index.mjs CHANGED
@@ -1,17 +1,20 @@
1
- import { S as WriteGuard, a as EVENT_ENCODING, b as postgresTableDefs, c as eventDimensions, i as DEFAULT_BUSY_TIMEOUT_MS, o as SCHEMA_VERSION, r as createStorageRepository, t as SqliteBackend, x as toPostgresSchema } from "./sqlite-BIPdMNQb.mjs";
1
+ import { S as WriteGuard, a as EVENT_ENCODING, b as postgresTableDefs, c as eventDimensions, i as DEFAULT_BUSY_TIMEOUT_MS, o as SCHEMA_VERSION, r as createStorageRepository, t as SqliteBackend, x as toPostgresSchema } from "./sqlite-DYExtbLo.mjs";
2
2
  import { _ as toJsonlArtifact, c as repairRequestHeaders, d as rowToMeta, f as scanRows, g as titleOfEventData, m as sessionInsertRow, p as sessionConflictRow, s as repairReadView } from "./log-DO69NQnn.mjs";
3
- import { c as SessionBranchRdbProvider, l as locateTurnEnd, o as registerSessionImport, s as SessionBranchRdb } from "./import-DZIAjOUr.mjs";
3
+ import { n as SessionBranchRdbProvider, r as locateTurnEnd, t as SessionBranchRdb } from "./branch-Co6xlbi0.mjs";
4
+ import { registerSessionImport } from "./import.mjs";
4
5
  import z from "@deepseek-ai/schemastery";
5
6
  import { randomUUID } from "node:crypto";
6
7
  import { Pool } from "pg";
7
8
  import { drizzle } from "drizzle-orm/node-postgres";
8
9
  import { SessionAlreadyExistsError, SessionAlreadyOwnedError, SessionHandleClosedError, SessionPersistence, SessionPersistenceNotFoundError, SessionPersistenceRevision, SessionReadOnlyError, assertContiguous, assertVersion, materializeAppendBatch, materializeCreateHeader, validateStoredEvents } from "@deepseek-ai/dsh-session-persistence";
9
10
  import { SESSION_FORMAT_VERSION, SessionLogOffset } from "@deepseek-ai/dsh-session";
11
+ import { sessionFormatLogFilename } from "@deepseek-ai/dsh-session-format";
10
12
  import { sessionFormatCatalog } from "@deepseek-ai/dsh-session-format-catalog";
11
13
  import { and, desc, eq, gte, sql } from "drizzle-orm";
12
14
  import { readdirSync } from "node:fs";
13
15
  import { fileURLToPath } from "node:url";
14
16
  import { migrate } from "drizzle-orm/node-postgres/migrator";
17
+ import { SessionQueryEngine, SessionQueryError } from "@deepseek-ai/dsh-session-query";
15
18
  import { StorageError, storageBackendServiceKey } from "@deepseek-ai/dsh-storage";
16
19
  import { Service } from "@deepseek-ai/cordis";
17
20
  //#region src/postgres.ts
@@ -49,7 +52,7 @@ var PostgresBackend = class PostgresBackend {
49
52
  } finally {
50
53
  this.txOverride = previous;
51
54
  }
52
- }),
55
+ }, { isolationLevel: "serializable" }),
53
56
  tables: this.tables
54
57
  });
55
58
  }
@@ -212,6 +215,22 @@ var PostgresBackend = class PostgresBackend {
212
215
  }
213
216
  };
214
217
  //#endregion
218
+ //#region src/session-query.ts
219
+ var SessionQueryRdb = class extends SessionQueryEngine {
220
+ constructor(ctx, config = {}) {
221
+ super(ctx, config);
222
+ }
223
+ async searchSessions() {
224
+ throw searchDisabled();
225
+ }
226
+ async searchEvents() {
227
+ throw searchDisabled();
228
+ }
229
+ };
230
+ function searchDisabled() {
231
+ return new SessionQueryError("session search is disabled: this deployment serves session queries from the rdb backend without a full-text index", "SESSION_QUERY_SEARCH_DISABLED");
232
+ }
233
+ //#endregion
215
234
  //#region src/legacy.ts
216
235
  /** 重建 v0/v1/v2 物理 header 记录(RDB 行 → 物理 JSON 对象)。 */
217
236
  function physicalHeader(row) {
@@ -319,36 +338,41 @@ const SESSION_PROJECTION_CACHE_SERVICE = "sessionProjectionCache";
319
338
  const PREDECESSOR_TITLE_KEY = "title";
320
339
  /** rdb 持久化的投影 checkpoint 服务:同步驱动直读介质,异步驱动用写穿镜像支撑同步签名。 */
321
340
  var SessionProjectionCacheRdb = class extends Service {
322
- config;
323
- repository;
324
- ready;
325
341
  static inject = ["sessionProjections", "sessions"];
326
342
  /** 异步驱动(PostgreSQL)的同步读镜像:同步驱动(SQLite)直读介质,这里恒为空。 */
327
343
  records = /* @__PURE__ */ new Map();
328
344
  dirty = /* @__PURE__ */ new Map();
329
345
  /** 读路径是否直读介质(`readProjcacheSync` 存在即同步驱动)。 */
330
346
  directReads;
347
+ config;
348
+ repository;
349
+ ready;
331
350
  /**
332
- * @param ctx - 插件上下文(须已注入 sessionProjections 与 sessions)。
333
- * @param config - 写节流参数。
334
- * @param repository - storages 接管表访问层。
335
- * @param ready - 介质就绪信号(直读介质前必须等到)。
351
+ * 本类按 cordis class plugin 装载(`ctx.plugin(SessionProjectionCacheRdb, options)`):
352
+ * `static inject` 等依赖就绪后构造,构造后框架调用 `[Service.init]` 安装写入
353
+ * 路径——直接 `new` 不会触发 init,写入路径会静默缺失。
354
+ * @param ctx - 插件上下文(已注入 sessionProjections 与 sessions)。
355
+ * @param options - 写节流 + storages 接管访问层 + 介质就绪信号。
336
356
  */
337
- constructor(ctx, config, repository, ready) {
357
+ constructor(ctx, options) {
338
358
  super(ctx, SESSION_PROJECTION_CACHE_SERVICE);
339
- this.config = config;
340
- this.repository = repository;
341
- this.ready = ready;
342
- this.directReads = repository.readProjcacheSync !== void 0;
359
+ this.config = options;
360
+ this.repository = options.repository;
361
+ this.ready = options.ready;
362
+ this.directReads = options.repository.readProjcacheSync !== void 0;
343
363
  }
344
364
  /**
345
- * Wait for the medium, then install the write path. Only the async driver
346
- * needs a startup mirror: the sync driver serves every read from the table.
365
+ * Install the write path before the async medium wait: listeners must exist
366
+ * from plugin activation on, or sessions created while the medium settles
367
+ * lose their mandatory checkpoints. Only the async driver needs the startup
368
+ * mirror; the sync driver serves every read from the table.
347
369
  */
348
370
  async [Service.init]() {
371
+ this.installWritePath();
349
372
  await this.ready;
373
+ const pruned = await this.repository.pruneStaleProjcache();
374
+ if (pruned > 0) this.ctx.logger.info(`session projection cache: pruned stale snapshot(s) for ${String(pruned)} session(s)`);
350
375
  if (!this.directReads) for (const entry of await this.repository.loadProjcache()) this.records.set(entry.sessionId, entry);
351
- this.installWritePath();
352
376
  }
353
377
  /** Read one session's stored record: straight from the medium, or from the async mirror. */
354
378
  lookup(id) {
@@ -601,8 +625,8 @@ const WORKSPACE_TABLE = "workspaces";
601
625
  var RdbStorageBackend = class {
602
626
  repository;
603
627
  kv = { open: (descriptor) => this.openUnit(descriptor) };
604
- /** 已打开(或打开中)的 unit 名;重复 open 是调用方 bug。 */
605
- open = /* @__PURE__ */ new Set();
628
+ /** 已打开(或打开中)的 unit;重复 open 是调用方 bug。 */
629
+ open = /* @__PURE__ */ new Map();
606
630
  closed = false;
607
631
  /**
608
632
  * @param repository - storages 接管表访问层(与事件日志同介质)。
@@ -614,35 +638,52 @@ var RdbStorageBackend = class {
614
638
  if (this.closed) throw new StorageError("closed", "rdb storage backend is closed");
615
639
  if (descriptor.name !== WORKSPACE_UNIT) throw new Error(`rdb storage backend serves only the '${WORKSPACE_UNIT}' domain (requested '${descriptor.name}')`);
616
640
  if (!descriptor.tables.includes(WORKSPACE_TABLE) || descriptor.hasGlobal !== true) throw new Error(`rdb storage backend expects the '${WORKSPACE_UNIT}' domain shape (table '${WORKSPACE_TABLE}' plus a global slot)`);
641
+ if (descriptor.layout !== void 0 && descriptor.layout !== "single") throw new Error(`rdb storage backend serves only the 'single' layout (domain '${descriptor.name}' declares '${descriptor.layout}')`);
617
642
  if (this.open.has(descriptor.name)) throw new Error(`kv unit '${descriptor.name}' is already open (double-open is a caller bug)`);
618
- const stored = await this.repository.readUnitVersion(descriptor.name);
619
- if (stored === void 0) await this.repository.insertUnitVersion(descriptor.name, descriptor.version);
620
- else if (stored !== descriptor.version) throw new StorageError("version-mismatch", `kv unit '${descriptor.name}' is stamped version ${stored} on the medium, incompatible with descriptor version ${descriptor.version}`);
621
- this.open.add(descriptor.name);
622
- return new WorkspaceKvUnit(this.repository, descriptor, () => {
643
+ const unit = new WorkspaceKvUnit(this.repository, descriptor);
644
+ this.open.set(descriptor.name, unit);
645
+ try {
646
+ const stored = await this.repository.readUnitVersion(descriptor.name);
647
+ if (stored === void 0) await this.repository.insertUnitVersion(descriptor.name, descriptor.version);
648
+ else if (stored !== descriptor.version) throw new StorageError("version-mismatch", `kv unit '${descriptor.name}' is stamped version ${stored} on the medium, incompatible with descriptor version ${descriptor.version}`);
649
+ } catch (error) {
650
+ this.open.delete(descriptor.name);
651
+ throw error;
652
+ }
653
+ unit.onClose(() => {
623
654
  this.open.delete(descriptor.name);
624
655
  });
656
+ return unit;
625
657
  }
626
658
  /**
627
- * Release the backend. The medium (the session database) belongs to the
628
- * owning session-rdb plugin, so closing open units here does not close it.
629
- * @returns resolution after the name table is cleared.
659
+ * Release the backend. New writes are rejected immediately; already-queued
660
+ * unit writes drain first (upstream backend contract). The medium (the
661
+ * session database) belongs to the owning session-rdb plugin, so closing
662
+ * open units here does not close it.
663
+ * @returns resolution after every open unit drained.
630
664
  */
631
665
  async close() {
632
666
  this.closed = true;
667
+ const units = [...this.open.values()];
633
668
  this.open.clear();
669
+ await Promise.all(units.map((unit) => unit.close()));
634
670
  }
635
671
  };
636
672
  /** workspace 域的 KV unit:每个原语一条 SQL 语句,值形状与上游记录一致。 */
637
673
  var WorkspaceKvUnit = class {
638
674
  repository;
639
675
  descriptor;
640
- onClose;
641
676
  closed = false;
642
- constructor(repository, descriptor, onClose) {
677
+ /** 在途写操作:close 先拒绝新写,再 drain 它们(不丢已受理的写)。 */
678
+ inflight = /* @__PURE__ */ new Set();
679
+ onClosed;
680
+ constructor(repository, descriptor) {
643
681
  this.repository = repository;
644
682
  this.descriptor = descriptor;
645
- this.onClose = onClose;
683
+ }
684
+ /** Install the name-release callback after the backend registered this unit. */
685
+ onClose(release) {
686
+ this.onClosed = release;
646
687
  }
647
688
  async loadAll() {
648
689
  this.assertOpen();
@@ -657,21 +698,32 @@ var WorkspaceKvUnit = class {
657
698
  async putRecord(table, key, value) {
658
699
  this.assertOpen();
659
700
  this.assertTable(table);
660
- await this.repository.putWorkspace(key, workspaceRecordOf(value));
701
+ await this.track(this.repository.putWorkspace(key, workspaceRecordOf(value)));
661
702
  }
662
703
  async deleteRecord(table, key) {
663
704
  this.assertOpen();
664
705
  this.assertTable(table);
665
- await this.repository.deleteWorkspace(key);
706
+ await this.track(this.repository.deleteWorkspace(key));
666
707
  }
667
708
  async setGlobal(value) {
668
709
  this.assertOpen();
669
- await this.repository.writeWorkspaceState(workspaceStateOf(value));
710
+ await this.track(this.repository.writeWorkspaceState(workspaceStateOf(value)));
670
711
  }
671
712
  async close() {
672
713
  if (this.closed) return;
673
714
  this.closed = true;
674
- this.onClose();
715
+ while (this.inflight.size > 0) await Promise.allSettled(this.inflight);
716
+ this.onClosed?.();
717
+ }
718
+ /** Register one accepted write so close can drain it. */
719
+ async track(operation) {
720
+ const settled = operation.then(() => void 0, () => void 0);
721
+ this.inflight.add(settled);
722
+ try {
723
+ await operation;
724
+ } finally {
725
+ this.inflight.delete(settled);
726
+ }
675
727
  }
676
728
  assertOpen() {
677
729
  if (this.closed) throw new StorageError("closed", `kv unit '${this.descriptor.name}' is closed`);
@@ -722,8 +774,10 @@ function installStorageTakeover(ctx, options) {
722
774
  }, "session-rdb.storageBackend");
723
775
  storageCtx.provide(storageBackendServiceKey("rdb"), backend);
724
776
  });
725
- ctx.inject(["sessionProjections"], (projectionCtx) => {
726
- new SessionProjectionCacheRdb(projectionCtx, options.projectionCache, options.repository, options.ready);
777
+ ctx.plugin(SessionProjectionCacheRdb, {
778
+ ...options.projectionCache,
779
+ repository: options.repository,
780
+ ready: options.ready
727
781
  });
728
782
  }
729
783
  //#endregion
@@ -1047,6 +1101,7 @@ var SessionPersistenceRdb = class SessionPersistenceRdb extends SessionPersisten
1047
1101
  this.ready = this.init();
1048
1102
  this.installLiveRouting(ctx);
1049
1103
  new SessionBranchRdb(this.ctx);
1104
+ this.ctx.plugin(SessionQueryRdb, {});
1050
1105
  registerSessionImport(this.ctx, this);
1051
1106
  installStorageTakeover(this.ctx, {
1052
1107
  repository: this.backend.storage,
@@ -1166,7 +1221,7 @@ var SessionPersistenceRdb = class SessionPersistenceRdb extends SessionPersisten
1166
1221
  }
1167
1222
  return snapshots;
1168
1223
  }
1169
- /** 导出 artifact(jsonl v2 文本),视图只读不落库。 */
1224
+ /** 导出当前世代的 jsonl artifact,视图只读不落库。 */
1170
1225
  async readRaw(id, signal) {
1171
1226
  signal?.throwIfAborted();
1172
1227
  await this.ready;
@@ -1178,7 +1233,7 @@ var SessionPersistenceRdb = class SessionPersistenceRdb extends SessionPersisten
1178
1233
  return {
1179
1234
  meta: log.meta,
1180
1235
  inheritedEventCount,
1181
- filename: "session.jsonl",
1236
+ filename: sessionFormatLogFilename(SESSION_FORMAT_VERSION),
1182
1237
  content: toJsonlArtifact(log.meta, inheritedEventCount, log.events)
1183
1238
  };
1184
1239
  }
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
1
+ //#region ../../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
2
2
  var comma = ",".charCodeAt(0);
3
3
  var semicolon = ";".charCodeAt(0);
4
4
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -78,7 +78,7 @@ function encode(decoded) {
78
78
  return writer.flush();
79
79
  }
80
80
  //#endregion
81
- //#region ../../node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
81
+ //#region ../../../node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
82
82
  var BitSet = class BitSet {
83
83
  constructor(arg) {
84
84
  this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
@@ -4,7 +4,7 @@ import { Session, SessionEvent, SessionHeader, SessionId, SessionLogOffset, Sess
4
4
  import { KvUnit } from "@deepseek-ai/dsh-storage";
5
5
  import { Context, Service } from "@deepseek-ai/cordis";
6
6
  import { SessionId as SessionId$1 } from "@deepseek-ai/dsh-session/types";
7
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/json-schema.d.cts
7
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema.d.cts
8
8
  type _JSONSchema = boolean | JSONSchema;
9
9
  type SchemaType = "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
10
10
  type JSONSchema = {
@@ -73,7 +73,7 @@ type JSONSchema = {
73
73
  };
74
74
  type BaseSchema = JSONSchema;
75
75
  //#endregion
76
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/standard-schema.d.cts
76
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/standard-schema.d.cts
77
77
  /** The Standard interface. */
78
78
  interface StandardTypedV1<Input = unknown, Output = Input> {
79
79
  /** The Standard properties. */
@@ -192,7 +192,7 @@ declare namespace StandardJSONSchemaV1 {
192
192
  }
193
193
  interface StandardSchemaWithJSONProps<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {}
194
194
  //#endregion
195
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/registries.d.cts
195
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.d.cts
196
196
  declare const $output: unique symbol;
197
197
  type $output = typeof $output;
198
198
  declare const $input: unique symbol;
@@ -219,7 +219,7 @@ interface JSONSchemaMeta {
219
219
  }
220
220
  interface GlobalMeta extends JSONSchemaMeta {}
221
221
  //#endregion
222
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/to-json-schema.d.cts
222
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.d.cts
223
223
  type Processor<T extends $ZodType = $ZodType> = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void;
224
224
  /**
225
225
  * Called for each schema that has no JSON Schema equivalent. Return a JSON Schema to use in its
@@ -341,14 +341,13 @@ interface ZodStandardJSONSchemaPayload<T> extends BaseSchema {
341
341
  "~standard": ZodStandardSchemaWithJSON$1<T>;
342
342
  }
343
343
  //#endregion
344
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/util.d.cts
344
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.d.cts
345
345
  type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
346
346
  type MimeTypes = "application/json" | "application/xml" | "application/x-www-form-urlencoded" | "application/javascript" | "application/pdf" | "application/zip" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/octet-stream" | "application/graphql" | "text/html" | "text/plain" | "text/css" | "text/javascript" | "text/csv" | "image/png" | "image/jpeg" | "image/gif" | "image/svg+xml" | "image/webp" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf" | "multipart/form-data" | (string & {});
347
347
  type IsAny<T> = 0 extends 1 & T ? true : false;
348
348
  type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
349
349
  type MakePartial<T, K extends keyof T> = Omit$1<T, K> & InexactPartial<Pick<T, K>>;
350
350
  type NoUndefined<T> = T extends undefined ? never : T;
351
- type Widen<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends bigint ? bigint : T;
352
351
  type LoosePartial<T extends object> = InexactPartial<T> & {
353
352
  [k: string]: unknown;
354
353
  };
@@ -385,14 +384,14 @@ declare abstract class Class {
385
384
  /** A trait's prototype members: a partial view of its own interface, with `this` typed as the instance. */
386
385
  type ProtoOf<T> = { [K in keyof T]?: (T[K] extends ((...args: infer A) => infer R) ? (...args: A) => R : T[K]) | undefined; } & ThisType<T>;
387
386
  //#endregion
388
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/versions.d.cts
387
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.d.cts
389
388
  declare const version: {
390
389
  readonly major: 4;
391
390
  readonly minor: 6;
392
391
  readonly patch: number;
393
392
  };
394
393
  //#endregion
395
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/schemas.d.cts
394
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.d.cts
396
395
  interface ParseContext<T extends $ZodIssueBase = never> {
397
396
  /** Customize error messages. */
398
397
  readonly error?: $ZodErrorMap<T>;
@@ -420,7 +419,7 @@ interface ParsePayload<T = unknown> {
420
419
  }
421
420
  type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
422
421
  interface $ZodTypeDef {
423
- type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom" | "properties";
422
+ type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom";
424
423
  error?: $ZodErrorMap<never> | undefined;
425
424
  checks?: $ZodCheck<never>[];
426
425
  }
@@ -1198,7 +1197,7 @@ interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1198
1197
  /** The default value. May be a getter. */
1199
1198
  defaultValue: input<T>;
1200
1199
  }
1201
- interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
1200
+ interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T> | undefined> {
1202
1201
  def: $ZodPrefaultDef<T>;
1203
1202
  optin: "defaulted";
1204
1203
  optout?: "optional" | undefined;
@@ -1411,24 +1410,9 @@ interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
1411
1410
  _zod: $ZodCustomInternals<O, I>;
1412
1411
  }
1413
1412
  declare const $ZodCustom: $constructor<$ZodCustom>;
1414
- interface $ZodPropertiesDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef, $ZodCheckDef {
1415
- type: "properties";
1416
- check: "properties";
1417
- shape: Shape;
1418
- }
1419
- interface $ZodPropertiesInternals<Shape extends $ZodShape = $ZodShape> extends $ZodTypeInternals<$InferObjectInput<Shape, {}>, $InferObjectInput<Shape, {}>>, $ZodCheckInternals<{ -readonly [k in keyof Shape]: Widen<input<Shape[k]>>; }> {
1420
- def: $ZodPropertiesDef<Shape>;
1421
- isst: $ZodIssueInvalidType;
1422
- issc: $ZodIssue;
1423
- }
1424
- interface $ZodProperties<Shape extends $ZodShape = $ZodShape> extends $ZodType {
1425
- _zod: $ZodPropertiesInternals<Shape>;
1426
- [Symbol.iterator](): Iterator<this>;
1427
- }
1428
- declare const $ZodProperties: $constructor<$ZodProperties>;
1429
- type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodProperties | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
1413
+ type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
1430
1414
  //#endregion
1431
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/checks.d.cts
1415
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.d.cts
1432
1416
  interface $ZodCheckDef {
1433
1417
  check: string;
1434
1418
  error?: $ZodErrorMap<never> | undefined;
@@ -1610,7 +1594,7 @@ interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
1610
1594
  }
1611
1595
  declare const $ZodCheckEndsWith: $constructor<$ZodCheckEndsWith>;
1612
1596
  //#endregion
1613
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/errors.d.cts
1597
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.d.cts
1614
1598
  interface $ZodIssueBase {
1615
1599
  readonly code?: string;
1616
1600
  readonly input?: unknown;
@@ -1739,7 +1723,7 @@ type $ZodFormattedError<T, U = string> = {
1739
1723
  _errors: U[];
1740
1724
  } & Flatten<_ZodFormattedError<T, U>>;
1741
1725
  //#endregion
1742
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/core.d.cts
1726
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.d.cts
1743
1727
  type ZodTrait = {
1744
1728
  _zod: {
1745
1729
  def: any;
@@ -1785,7 +1769,7 @@ type output<T> = T extends {
1785
1769
  };
1786
1770
  } ? T["_zod"]["output"] : unknown;
1787
1771
  //#endregion
1788
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/api.d.cts
1772
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.d.cts
1789
1773
  type Params<T extends $ZodType | $ZodCheck, IssueTypes extends $ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never> = Flatten<Partial<EmptyToNever<Omit<T["_zod"]["def"], OmitKeys> & ([IssueTypes] extends [never] ? {} : {
1790
1774
  error?: string | $ZodErrorMap<IssueTypes> | undefined;
1791
1775
  /** @deprecated This parameter is deprecated. Use `error` instead. */
@@ -1857,7 +1841,7 @@ interface $ZodSuperRefineParams {
1857
1841
  when?: ((payload: ParsePayload) => boolean) | undefined;
1858
1842
  }
1859
1843
  //#endregion
1860
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/errors.d.cts
1844
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.d.cts
1861
1845
  /** An Error-like class used to store Zod validation issues. */
1862
1846
  interface ZodError<T = unknown> extends $ZodError<T> {
1863
1847
  /** @deprecated Use the `z.treeifyError(err)` function instead. */
@@ -1875,7 +1859,7 @@ interface ZodError<T = unknown> extends $ZodError<T> {
1875
1859
  }
1876
1860
  declare const ZodError: $constructor<ZodError>;
1877
1861
  //#endregion
1878
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/parse.d.cts
1862
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.d.cts
1879
1863
  type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
1880
1864
  type ZodSafeParseSuccess<T> = {
1881
1865
  success: true;
@@ -1888,7 +1872,7 @@ type ZodSafeParseError<T> = {
1888
1872
  error: ZodError<T>;
1889
1873
  };
1890
1874
  //#endregion
1891
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/schemas.d.cts
1875
+ //#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.d.cts
1892
1876
  type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
1893
1877
  interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
1894
1878
  def: Internals["def"];
@@ -2220,7 +2204,7 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
2220
2204
  }
2221
2205
  declare const ZodReadonly: $constructor<ZodReadonly>;
2222
2206
  //#endregion
2223
- //#region ../../vendor/deepseek-harness/packages/session/session-projection/lib/types/types.d.ts
2207
+ //#region ../../../vendor/deepseek-harness/packages/session/session-projection/lib/types/types.d.ts
2224
2208
  /**
2225
2209
  * Pure-type outlet of the session-projection Service Definition: the one projection type
2226
2210
  * table, importable from client aggregates without dragging the host-side
@@ -2244,7 +2228,7 @@ interface SessionProjectionMap {}
2244
2228
  */
2245
2229
  interface SessionProjectionStateMap {}
2246
2230
  //#endregion
2247
- //#region ../../vendor/deepseek-harness/packages/session/session-projection/lib/types/index.d.ts
2231
+ //#region ../../../vendor/deepseek-harness/packages/session/session-projection/lib/types/index.d.ts
2248
2232
  declare module '@deepseek-ai/cordis' {
2249
2233
  interface Context {
2250
2234
  sessionProjections: SessionProjectionRegistry;
@@ -2512,7 +2496,7 @@ declare class SessionProjectionRegistry extends Service {
2512
2496
  private viewCell;
2513
2497
  }
2514
2498
  //#endregion
2515
- //#region ../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/spec.d.ts
2499
+ //#region ../../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/spec.d.ts
2516
2500
  /** Global singleton declaration: schema plus the value used before the first write. */
2517
2501
  interface DomainGlobalSpec<G> {
2518
2502
  /** Validates the stored global at the durable boundary. */
@@ -2575,7 +2559,7 @@ type TableKeyOf<S extends DomainSpec, N extends keyof S['tables']> = S['tables']
2575
2559
  /** Value type of one declared table. */
2576
2560
  type TableValueOf<S extends DomainSpec, N extends keyof S['tables']> = S['tables'][N] extends DomainTableSpec<string, infer V> ? V : never;
2577
2561
  //#endregion
2578
- //#region ../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/domain.d.ts
2562
+ //#region ../../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/domain.d.ts
2579
2563
  /** Handle on a domain's global singleton. */
2580
2564
  interface DomainGlobal<G> {
2581
2565
  /**
@@ -2729,7 +2713,7 @@ declare class DomainImpl {
2729
2713
  private assertReadable;
2730
2714
  }
2731
2715
  //#endregion
2732
- //#region ../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/events.d.ts
2716
+ //#region ../../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/events.d.ts
2733
2717
  /**
2734
2718
  * Change-event vocabulary of the domain data form. Every durable write emits
2735
2719
  * one event after the backend resolves durability, carrying the new snapshot
@@ -2774,7 +2758,7 @@ declare module '@deepseek-ai/cordis' {
2774
2758
  }
2775
2759
  }
2776
2760
  //#endregion
2777
- //#region ../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/index.d.ts
2761
+ //#region ../../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/index.d.ts
2778
2762
  declare module '@deepseek-ai/dsh-storage' {
2779
2763
  interface StorageForms {
2780
2764
  domain: DomainFacility;
@@ -2852,7 +2836,7 @@ declare class DomainFacility {
2852
2836
  closeAll(): Promise<void>;
2853
2837
  }
2854
2838
  //#endregion
2855
- //#region ../../vendor/deepseek-harness/packages/session/session-projection-cache/lib/types/spec.d.ts
2839
+ //#region ../../../vendor/deepseek-harness/packages/session/session-projection-cache/lib/types/spec.d.ts
2856
2840
  /**
2857
2841
  * The stored-log identity a record is bound to: the immutable header fields
2858
2842
  * that distinguish one session lifecycle from another under the same id. A
@@ -2879,7 +2863,7 @@ declare const checkpointIdentity: ZodObject<{
2879
2863
  /** The identity fields a record is bound to, inferred from {@link checkpointIdentity}. */
2880
2864
  type CheckpointIdentity = output<typeof checkpointIdentity>;
2881
2865
  //#endregion
2882
- //#region ../../vendor/deepseek-harness/packages/session/session-projection-cache/lib/types/index.d.ts
2866
+ //#region ../../../vendor/deepseek-harness/packages/session/session-projection-cache/lib/types/index.d.ts
2883
2867
  declare module '@deepseek-ai/cordis' {
2884
2868
  interface Context {
2885
2869
  sessionProjectionCache: SessionProjectionCache;
@@ -3014,7 +2998,7 @@ declare class SessionProjectionCache extends Service {
3014
2998
  private requireTable;
3015
2999
  }
3016
3000
  //#endregion
3017
- //#region ../../vendor/deepseek-harness/packages/util/brand/lib/types/index.d.ts
3001
+ //#region ../../../vendor/deepseek-harness/packages/util/brand/lib/types/index.d.ts
3018
3002
  /**
3019
3003
  * Duplicate-install-safe nominal primitive helpers.
3020
3004
  *
@@ -3034,7 +3018,7 @@ type Branded<B extends string> = string & {
3034
3018
  readonly [BRAND]: B;
3035
3019
  };
3036
3020
  //#endregion
3037
- //#region ../../vendor/deepseek-harness/packages/workspace/workspace/lib/types/types.d.ts
3021
+ //#region ../../../vendor/deepseek-harness/packages/workspace/workspace/lib/types/types.d.ts
3038
3022
  /**
3039
3023
  * Identifies one workspace record. A generated uuid, never the path: path
3040
3024
  * normalization rewrites paths, and a reference anchor must stay stable.
@@ -3127,7 +3111,7 @@ interface Workspace {
3127
3111
  status(): Promise<'ok' | 'missing-dir'>;
3128
3112
  }
3129
3113
  //#endregion
3130
- //#region ../../vendor/deepseek-harness/packages/workspace/workspace/lib/types/spec.d.ts
3114
+ //#region ../../../vendor/deepseek-harness/packages/workspace/workspace/lib/types/spec.d.ts
3131
3115
  /**
3132
3116
  * Durable shape of one workspace record. `path` is the `fs.realpath` canon
3133
3117
  * stamped at create; `sessionIds` is the ordered ownership account (array
@@ -3166,7 +3150,7 @@ declare const workspaceDomainState: ZodObject<{
3166
3150
  /** Durable registry state inferred from {@link workspaceDomainState}. */
3167
3151
  type WorkspaceDomainState = output<typeof workspaceDomainState>;
3168
3152
  //#endregion
3169
- //#region ../../vendor/deepseek-harness/packages/workspace/workspace/lib/types/index.d.ts
3153
+ //#region ../../../vendor/deepseek-harness/packages/workspace/workspace/lib/types/index.d.ts
3170
3154
  /** Identifies one workspace record (see `src/types.ts` for the brand rationale). */
3171
3155
  type WorkspaceId = WorkspaceId$1;
3172
3156
  /**
@@ -3359,8 +3343,13 @@ interface StorageRepository {
3359
3343
  * @param rows - 每个投影 key 一行。
3360
3344
  */
3361
3345
  putProjcache(sessionId: string, rows: ProjectionCheckpoint): Promise<void>;
3362
- /** 删除一个会话的 checkpoint(缺失为 no-op)。 */
3363
- deleteProjcache(sessionId: string): Promise<void>;
3346
+ /**
3347
+ * 清理陈旧 checkpoint 行:水位为负却已有事件的会话(旧版写入路径的产物,
3348
+ * 会把有对话的会话误判为空白)。缓存是派生数据,删除只让该会话回到
3349
+ * 「未知即可见」并等待下一次强制点重写。
3350
+ * @returns 删除的行数。
3351
+ */
3352
+ pruneStaleProjcache(): Promise<number>;
3364
3353
  }
3365
3354
  //#endregion
3366
3355
  //#region src/backend.d.ts
@@ -1,7 +1,7 @@
1
1
  import { g as titleOfEventData, m as sessionInsertRow, p as sessionConflictRow } from "./log-DO69NQnn.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
- import { SessionId, SessionLogOffset, SessionSeq } from "@deepseek-ai/dsh-session";
4
- import { and, desc, eq, gte, isNotNull, notInArray, sql } from "drizzle-orm";
3
+ import { SESSION_FORMAT_VERSION, SessionId, SessionLogOffset, SessionSeq } from "@deepseek-ai/dsh-session";
4
+ import { and, desc, eq, gte, inArray, isNotNull, lt, notInArray, sql } from "drizzle-orm";
5
5
  import { check, index, integer, sqliteTable, text, unique } from "drizzle-orm/sqlite-core";
6
6
  import { bigint, check as check$1, index as index$1, integer as integer$1, pgSchema, pgTable, serial, text as text$1, unique as unique$1 } from "drizzle-orm/pg-core";
7
7
  import { readdirSync, statSync } from "node:fs";
@@ -407,7 +407,7 @@ const workspaceSessions = {
407
407
  * workspace 域 global 单例(上游 `workspaceDomainState`):`initialized` 是
408
408
  * 引导标记,`pendingMutation` 拆成操作与目标两列(create / delete 的可恢复
409
409
  * 两写标记)。显示顺序(`workspaceIds`)在 `t_workspaces.f_position`,
410
- * 归档集在 `t_session_archives`。
410
+ * 归档集由 `t_sessions.f_archived_at` 承载(归档不触碰归属槽位)。
411
411
  */
412
412
  const workspaceState = {
413
413
  name: "t_workspace_state",
@@ -842,7 +842,24 @@ function createStorageRepository(host) {
842
842
  const archived = state.archivedSessionIds;
843
843
  await runQuery(archived.length === 0 ? db.update(tSessions).set({ fArchivedAt: null }).where(isNotNull(tSessions.fArchivedAt)) : db.update(tSessions).set({ fArchivedAt: null }).where(and(isNotNull(tSessions.fArchivedAt), notInArray(tSessions.fSessionId, archived))));
844
844
  const stamp = Date.now();
845
- for (const sessionId of archived) await runQuery(db.update(tSessions).set({ fArchivedAt: sql`COALESCE(${tSessions.fArchivedAt}, ${stamp})` }).where(eq(tSessions.fSessionId, sessionId)));
845
+ for (const sessionId of archived) await runQuery(db.insert(tSessions).values({
846
+ fSessionId: sessionId,
847
+ fHeadEventId: "",
848
+ fHeadSequence: -1,
849
+ fVersion: SESSION_FORMAT_VERSION,
850
+ fCreatedAt: stamp,
851
+ fCwd: null,
852
+ fParentSession: null,
853
+ fSeedLength: null,
854
+ fOrigin: null,
855
+ fDelegationDepth: null,
856
+ fIncarnation: randomUUID(),
857
+ fRevision: 0,
858
+ fArchivedAt: stamp
859
+ }).onConflictDoUpdate({
860
+ target: tSessions.fSessionId,
861
+ set: { fArchivedAt: sql`COALESCE(${tSessions.fArchivedAt}, ${stamp})` }
862
+ }));
846
863
  });
847
864
  },
848
865
  async loadProjcache() {
@@ -881,8 +898,12 @@ function createStorageRepository(host) {
881
898
  if (values.length > 0) await runQuery(db.insert(tProjcacheRows).values(values));
882
899
  });
883
900
  },
884
- async deleteProjcache(sessionId) {
885
- await runQuery((await dbx()).delete(tProjcacheRows).where(eq(tProjcacheRows.fSessionId, sessionId)));
901
+ async pruneStaleProjcache() {
902
+ const db = await dbx();
903
+ const stale = await allRows(db.select({ fSessionId: tProjcacheRows.fSessionId }).from(tProjcacheRows).where(and(lt(tProjcacheRows.fSeq, 0), inArray(tProjcacheRows.fSessionId, db.select({ fSessionId: tSessions.fSessionId }).from(tSessions).where(gte(tSessions.fHeadSequence, 0))))));
904
+ if (stale.length === 0) return 0;
905
+ await runQuery(db.delete(tProjcacheRows).where(inArray(tProjcacheRows.fSessionId, stale.map((row) => row.fSessionId))));
906
+ return stale.length;
886
907
  },
887
908
  ...host.dbSync === void 0 ? {} : {
888
909
  readProjcacheSync: (sessionId) => {
@@ -1,4 +1,4 @@
1
- import { C as EventRow, S as BackendTx, T as StorageRepository, _ as tWorkspaceSessions, a as JournalMode, b as WriteGuard, c as eventDimensions, d as tPersistenceState, f as tSchemaMeta, g as tStorageUnits, h as tSessions, i as EventRole, l as eventKind, m as tSessionProjcacheRows, n as EVENT_ENCODING, o as SCHEMA_VERSION, p as tSessionEvents, r as EventKind, s as SESSION_PERSISTENCE_SQLITE_APPLICATION_ID, t as DEFAULT_BUSY_TIMEOUT_MS, u as tEvents, v as tWorkspaceState, w as SessionRow, x as Backend, y as tWorkspaces } from "./schema-Bo6Hy5gW.mjs";
1
+ import { C as EventRow, S as BackendTx, T as StorageRepository, _ as tWorkspaceSessions, a as JournalMode, b as WriteGuard, c as eventDimensions, d as tPersistenceState, f as tSchemaMeta, g as tStorageUnits, h as tSessions, i as EventRole, l as eventKind, m as tSessionProjcacheRows, n as EVENT_ENCODING, o as SCHEMA_VERSION, p as tSessionEvents, r as EventKind, s as SESSION_PERSISTENCE_SQLITE_APPLICATION_ID, t as DEFAULT_BUSY_TIMEOUT_MS, u as tEvents, v as tWorkspaceState, w as SessionRow, x as Backend, y as tWorkspaces } from "./schema-BkQN5GyT.mjs";
2
2
  import { SessionId } from "@deepseek-ai/dsh-session";
3
3
  import { DatabaseSync } from "node:sqlite";
4
4
  //#region src/sqlite.d.ts
package/dist/storage.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { S as WriteGuard, _ as tWorkspaceSessions, a as EVENT_ENCODING, c as eventDimensions, d as tPersistenceState, f as tSchemaMeta, g as tStorageUnits, h as tSessions, i as DEFAULT_BUSY_TIMEOUT_MS, l as eventKind, m as tSessionProjcacheRows, n as openDatabase, o as SCHEMA_VERSION, p as tSessionEvents, s as SESSION_PERSISTENCE_SQLITE_APPLICATION_ID, t as SqliteBackend, u as tEvents, v as tWorkspaceState, y as tWorkspaces } from "./sqlite-BIPdMNQb.mjs";
1
+ import { S as WriteGuard, _ as tWorkspaceSessions, a as EVENT_ENCODING, c as eventDimensions, d as tPersistenceState, f as tSchemaMeta, g as tStorageUnits, h as tSessions, i as DEFAULT_BUSY_TIMEOUT_MS, l as eventKind, m as tSessionProjcacheRows, n as openDatabase, o as SCHEMA_VERSION, p as tSessionEvents, s as SESSION_PERSISTENCE_SQLITE_APPLICATION_ID, t as SqliteBackend, u as tEvents, v as tWorkspaceState, y as tWorkspaces } from "./sqlite-DYExtbLo.mjs";
2
2
  export { DEFAULT_BUSY_TIMEOUT_MS, EVENT_ENCODING, SCHEMA_VERSION, SESSION_PERSISTENCE_SQLITE_APPLICATION_ID, SqliteBackend, WriteGuard, eventDimensions, eventKind, openDatabase, tEvents, tPersistenceState, tSchemaMeta, tSessionEvents, tSessionProjcacheRows, tSessions, tStorageUnits, tWorkspaceSessions, tWorkspaceState, tWorkspaces };