billion-context-dsh 0.2.17 → 0.2.19

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.
@@ -11,7 +11,7 @@
11
11
  * @module billion-context-pi-dsh/messages
12
12
  */
13
13
  import type { CoreMessage } from 'acp-kernel';
14
- import type { SessionEvent } from '@deepseek-ai/dsh-session';
14
+ import type { Session, SessionEvent } from '@deepseek-ai/dsh-session';
15
15
  /**
16
16
  * Extract plain text from a DSH content block array or string.
17
17
  *
@@ -54,7 +54,7 @@ export declare function projectEvent(event: SessionEvent, toolNames?: ReadonlyMa
54
54
  /** Project a session's message events into CoreMessage[] in log order. */
55
55
  export declare function eventsToCoreMessages(events: readonly SessionEvent[], toolNames?: ReadonlyMap<string, string>): CoreMessage[];
56
56
  /** The surface-visible message events of a session, in model-visible order. */
57
- export declare function surfaceEventsOf(session: import('@deepseek-ai/dsh-session').Session): SessionEvent[];
57
+ export declare function surfaceEventsOf(session: Session): SessionEvent[];
58
58
  /**
59
59
  * ALL message-type events in log order — the visible surface PLUS everything
60
60
  * shadowed by compression. The ACP kernel deactivates any block whose consumed
package/dist/region.d.ts CHANGED
@@ -39,7 +39,19 @@ export interface AcpBlockLedgerEntry {
39
39
  }
40
40
  /** The open turn number, or null when the log ends between turns. */
41
41
  export declare function findOpenTurn(events: readonly SessionEvent[]): number | null;
42
- /** Reject a second concurrent compaction for the same session. */
42
+ /**
43
+ * Reject a second concurrent compaction for the same session.
44
+ *
45
+ * Compaction is synchronous and a session is single-writer, so a
46
+ * `compaction/start` with NO matching `compaction/end` in the durable log can
47
+ * only be a stale leftover from a prior run that died mid-write (a hard kill,
48
+ * not a caught throw — every caught throw is paired with a compensating
49
+ * `compaction/end` in runCompactionTransaction). Such a leftover must NOT
50
+ * permanently block every later compress call: this treats it as stale,
51
+ * surfaces it once, and lets a new compaction proceed. The old "already
52
+ * active" throw only fired when a genuine concurrent compaction existed,
53
+ * which the synchronous single-writer premise makes impossible.
54
+ */
43
55
  export declare function assertNoActiveCompaction(events: readonly SessionEvent[]): void;
44
56
  /**
45
57
  * A requested range whose EVERY live message was already shadowed by one or
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Cross-version session event access.
3
+ *
4
+ * DSH `0.1.2-alpha` replaced the public `Session.events` getter with explicit
5
+ * `snapshotEvents()` / `eventAt(seq)` methods; rc.6 / 0.1.1-rc.x still expose
6
+ * `events`. Both shapes are feature-detected here so a single build runs on
7
+ * either seam (the engine's peer range keeps `^0.1.0-rc.6 || ^0.1.1-rc.1`).
8
+ *
9
+ * Semantics match on both sides:
10
+ * - `events` (rc.6) and `snapshotEvents()` (0.1.2-alpha) both return the
11
+ * current full log as a stable, cached snapshot (reused until the next
12
+ * append), with `seq === array index`.
13
+ * - indexed reads map to `events[seq]` / `eventAt(seq)` with the same
14
+ * `undefined`-when-absent contract.
15
+ * @module billion-context-dsh/session-events
16
+ */
17
+ import type { Session, SessionEvent } from '@deepseek-ai/dsh-session';
18
+ /** All events of a session in log order (seq == array index). */
19
+ export declare function sessionEventsOf(session: Session): readonly SessionEvent[];
20
+ /** The event at one exact seq, or undefined when the log has no such seq. */
21
+ export declare function eventAtOf(session: Session, seq: number): SessionEvent | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billion-context-dsh",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "Active Context Pruning (ACP) for the DeepSeek Harness — model-driven context management as a CompactionEngine backend.",
5
5
  "keywords": [
6
6
  "deepseek",
@@ -47,7 +47,10 @@
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@deepseek-ai/cordis": "^4.0.1",
50
- "@deepseek-ai/dsh-compaction": "^0.1.0-rc.6 || ^0.1.1-rc.1"
50
+ "@deepseek-ai/dsh-compaction": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.4",
51
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.4",
52
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.4",
53
+ "@deepseek-ai/dsh-tools": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.4"
51
54
  },
52
55
  "devDependencies": {
53
56
  "acp-kernel": "0.0.29",