dsh-context-compression-improved 0.14.3 → 0.15.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-context-compression-improved",
3
- "version": "0.14.3",
3
+ "version": "0.15.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "tag": "latest"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-context-compression-improved",
3
- "version": "0.14.3",
3
+ "version": "0.15.0",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Token-saving, auditable tool-result context-compression selector with code-skeleton gate for DeepSeek Harness — fewer tokens on every turn",
6
6
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-context-compression-improved",
3
- "version": "0.14.3",
3
+ "version": "0.15.0",
4
4
  "description": "Token-saving context-compression selector bundle for DeepSeek Harness — fewer tool-result tokens on every turn, fully auditable",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Cross-plugin conflict detection (F11).
3
+ *
4
+ * Plan: cci-longterm-refactor v0.15.2
5
+ *
6
+ * Detects co-installed plugins at startup. Warns once, does NOT disable.
7
+ * The plugins occupy independent multiplication zones:
8
+ * - CCI: selector-level tool-result trimming (what/how to cut)
9
+ * - live-compact: turn-end small cuts (when to cut, prefix cache)
10
+ * - billion-context: model-driven fold (model decides what to compress)
11
+ * - flash-presets: global threshold + tool schema pruning
12
+ *
13
+ * @module dsh-context-compression-improved/runtime/conflict-detect
14
+ */
15
+
16
+ export interface PluginPresence {
17
+ readonly name: string
18
+ readonly version: string
19
+ }
20
+
21
+ /** Known compaction-adjacent plugins to detect. */
22
+ const WATCH_PLUGINS = [
23
+ 'dsh-live-compact',
24
+ 'dsh-live-compact-x',
25
+ 'billion-context',
26
+ 'billion-context-dsh',
27
+ 'dsh-flash-presets',
28
+ ] as const
29
+
30
+ export interface CoexistenceReport {
31
+ readonly detected: readonly PluginPresence[]
32
+ readonly mode: 'solo' | 'coexist'
33
+ readonly note: string
34
+ }
35
+
36
+ /**
37
+ * Given a list of installed plugins (from ctx.plugin.list() or equivalent),
38
+ * produce a coexistence report. Call once at startup.
39
+ */
40
+ export function detectCoexistence(installed: readonly PluginPresence[]): CoexistenceReport {
41
+ const detected = installed.filter(p =>
42
+ (WATCH_PLUGINS as readonly string[]).includes(p.name),
43
+ )
44
+ if (detected.length === 0) {
45
+ return { detected: [], mode: 'solo', note: '' }
46
+ }
47
+ const names = detected.map(p => `${p.name}@${p.version}`).join(', ')
48
+ return {
49
+ detected,
50
+ mode: 'coexist',
51
+ note: `Co-installed: ${names}. CCI handles selector-level trimming; these plugins handle other compaction layers. Independent multiplication zones — no conflict expected.`,
52
+ }
53
+ }