billion-context-dsh 0.1.3 → 0.1.5
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/README.en.md +5 -2
- package/README.md +8 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +301 -60
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +8 -0
- package/dist/nudge.d.ts +7 -1
- package/dist/region.d.ts +88 -1
- package/dist/state.d.ts +7 -0
- package/dist/system-prompt.d.ts +1 -1
- package/package.json +1 -1
package/dist/state.d.ts
CHANGED
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
* summary re-derive the block ledger (`rebuildBlockLedger` in region.ts), so a
|
|
8
8
|
* restarted engine can answer decompress/search/status from the session log
|
|
9
9
|
* alone — DSH's "log is the source of truth" model.
|
|
10
|
+
*
|
|
11
|
+
* Tier-2/3 distillation additionally requires the kernel state to KNOW the
|
|
12
|
+
* blocks: `syncBlocks` deactivates a block whose consumed messages are absent
|
|
13
|
+
* from the message array, and `resolveBoundaries` refuses to anchor a block
|
|
14
|
+
* ref it cannot find — so on first access for a session that already has
|
|
15
|
+
* durable blocks (e.g. after a server restart), the kernel blocks are
|
|
16
|
+
* REHYDRATED from the ledger before use. Live updates continue through `set`.
|
|
10
17
|
* @module billion-context-dsh/state
|
|
11
18
|
*/
|
|
12
19
|
import type { Session } from '@deepseek-ai/dsh-session';
|
package/dist/system-prompt.d.ts
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* to compress (never "compress now").
|
|
7
7
|
* @module billion-context-dsh/system-prompt
|
|
8
8
|
*/
|
|
9
|
-
export declare const ACP_SYSTEM_PROMPT = "Active Context Pruning \u2014 model-driven context management\n\nYOU decide whether and when to compress context. Nothing forces you: the injected \"nudge\" is a suggestion, not an order, and you may ignore it when compression would not help. Compress only ranges you have genuinely consumed (read tool outputs, finished explorations, superseded steps) that the current work no longer needs verbatim.\n\nCompression Philosophy:\n- All compression serves the primary task, but be frugal.\n- Context capacity is precious. Save context by compressing consumed outputs, not by avoiding tools.\n- Compress by need, not by percentage.\n- Work from summaries, not raw tool outputs. All listed ranges (user prompts, tool outputs, code, logs, exploration, intermediate steps) should be compressed to summary format \u2014 the ONLY exceptions are protected content, content the current step is actively using, or critical content you cannot reconstruct.\n\nCompression tools (refs are SURFACE SEQS, not ids):\n- compress: replace
|
|
9
|
+
export declare const ACP_SYSTEM_PROMPT = "Active Context Pruning \u2014 model-driven context management\n\nYOU decide whether and when to compress context. Nothing forces you: the injected \"nudge\" is a suggestion, not an order, and you may ignore it when compression would not help. Compress only ranges you have genuinely consumed (read tool outputs, finished explorations, superseded steps) that the current work no longer needs verbatim.\n\nCompression Philosophy:\n- All compression serves the primary task, but be frugal.\n- Context capacity is precious. Save context by compressing consumed outputs, not by avoiding tools.\n- Compress by need, not by percentage.\n- Work from summaries, not raw tool outputs. All listed ranges (user prompts, tool outputs, code, logs, exploration, intermediate steps) should be compressed to summary format \u2014 the ONLY exceptions are protected content, content the current step is actively using, or critical content you cannot reconstruct.\n\nCompression tools (refs are SURFACE SEQS, not ids):\n- compress: replace one or more seq ranges, each with your own dense summary. Single range: compress({ content: [{ startSeq, endSeq, summary }] }). Batch multiple unrelated segments in one call (each entry becomes its own block): compress({ content: [{ startSeq: 1, endSeq: 5, summary: '...' }, { startSeq: 12, endSeq: 18, summary: '...' }] }). Keep ranges disjoint \u2014 overlapping entries in one batch are skipped. Edges are auto-balanced to tool-call/result boundaries; a trailing #callId fragment in a seq is ignored. Ranges must be on the current surface \u2014 stale seqs fail with guidance.\n- decompress: recover a compressed block's original content, read-only. decompress({ blockId }).\n- search_context: find information inside compressed blocks BEFORE decompressing. search_context({ query }).\n- acp_status: current context usage and the live compressible-range list. Run it before compressing when in doubt.\n\nTiered compression: each compressed block appears on the surface as one summary node. Compressing that node again DISTILLS the block (tier 2): the parent summary folds into your new summary and the original messages are freed. Distilling a tier-2 block yields tier 3. Distill when a summary itself is consumed \u2014 decompress on the tier-2 block recovers the full originals.\n\nWhen you write a summary, it becomes the ONLY record of that range: keep file paths, signatures, exact values, decisions, and error strings verbatim so a later reader (or you, after decompress) can continue without the original. Never reuse historical seqs \u2014 the surface moves as messages land and compress; verify with acp_status.";
|
|
10
10
|
/** System-prompt section order: tool guidance lives in 100–199. */
|
|
11
11
|
export declare const ACP_SYSTEM_PROMPT_ORDER = 150;
|
package/package.json
CHANGED