dsh-context-compression-improved 0.10.5 → 0.11.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/CHANGELOG.md +8 -0
- package/CHANGELOG.zh.md +9 -0
- package/docs/shallow-teaching-preset-template.md +46 -0
- package/package.json +5 -5
- package/packages/selector/dsh.plugin.json +1 -1
- package/packages/selector/lib/client.d.ts +8 -0
- package/packages/selector/lib/client.js +212 -3
- package/packages/selector/lib/index.js +1 -1
- package/packages/selector/lib/profiles.d.ts +34 -0
- package/packages/selector/lib/pruner.d.ts +55 -0
- package/packages/selector/lib/pruner.js +1925 -303
- package/packages/selector/lib/savings-integral.js +126 -3
- package/packages/selector/lib/tool-result.js +9 -1
- package/packages/selector/package.json +1 -1
- package/packages/selector/src/client/CompressionProfileControls.tsx +33 -0
- package/packages/selector/src/client/CompressionProfileSelector.tsx +2 -0
- package/packages/selector/src/client/decode.ts +5 -1
- package/packages/selector/src/client/index.ts +4 -0
- package/packages/selector/src/client/locales/de.ts +7 -0
- package/packages/selector/src/client/locales/es.ts +7 -0
- package/packages/selector/src/client/locales/fr.ts +7 -0
- package/packages/selector/src/client/locales/it.ts +7 -0
- package/packages/selector/src/client/locales/ja.ts +7 -0
- package/packages/selector/src/client/locales/ko.ts +7 -0
- package/packages/selector/src/client/locales/ru.ts +7 -0
- package/packages/selector/src/client/locales.ts +14 -0
- package/packages/selector/src/client/monitor-fab.ts +14 -0
- package/packages/selector/src/client/settings-section.tsx +9 -2
- package/packages/selector/src/profiles.ts +103 -0
- package/packages/selector/src/pruner.ts +310 -4
- package/packages/selector/src/runtime/audit.ts +1 -0
- package/packages/selector/src/runtime/config.ts +88 -1
- package/packages/selector/src/runtime/fold-router.ts +143 -0
- package/packages/selector/src/runtime/monitor.ts +31 -0
- package/packages/selector/src/runtime/reducers.ts +1 -1
- package/packages/selector/src/runtime/sediment-card.ts +126 -0
- package/packages/selector/src/runtime/sediment-clock.ts +87 -0
- package/packages/selector/src/runtime/sediment-guard.ts +136 -0
- package/packages/selector/src/runtime/sediment-publish.ts +144 -0
- package/packages/selector/src/runtime/sediment-span.ts +170 -0
- package/packages/selector/src/runtime/sediment.ts +209 -0
- package/packages/selector/src/runtime/shallow-tools.ts +342 -0
- package/packages/selector/src/runtime/tool-names.ts +6 -0
- package/packages/selector/src/runtime/triage/masks.ts +128 -0
- package/packages/selector/src/runtime/triage/shallow.ts +132 -0
- package/packages/selector/src/runtime/triage/signals.ts +167 -0
- package/packages/selector/src/runtime/triage/types.ts +125 -0
- package/packages/selector/src/runtime/types.ts +28 -0
- package/packages/selector/tests/fixtures/sediment-pool/52adc205-cloud-5.orig.txt +231 -0
- package/packages/selector/tests/fixtures/sediment-pool/95fcba5d-cloud-25.orig.txt +236 -0
- package/packages/selector/tests/fixtures/sediment-pool/95fcba5d-cloud-38.orig.txt +220 -0
- package/packages/selector/tests/fixtures/sediment-pool/95fcba5d-cloud-42.orig.txt +140 -0
- package/packages/selector/tests/fixtures/sediment-pool/95fcba5d-cloud-53.orig.txt +117 -0
- package/packages/selector/tests/fixtures/sediment-pool/95fcba5d-local-10.orig.txt +67 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-45.orig.txt +119 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-49.orig.txt +119 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-63.orig.txt +131 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-75.orig.txt +196 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-76.orig.txt +71 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-85.orig.txt +126 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-86.orig.txt +86 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-87.orig.txt +50 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-96.orig.txt +102 -0
- package/packages/selector/tests/public/package-contract.client.spec.ts +7 -4
- package/packages/selector/tests/runtime/fold-router.spec.ts +140 -0
- package/packages/selector/tests/runtime/sediment-card.spec.ts +111 -0
- package/packages/selector/tests/runtime/sediment-config.spec.ts +56 -0
- package/packages/selector/tests/runtime/sediment-guard.spec.ts +71 -0
- package/packages/selector/tests/runtime/sediment-masks.spec.ts +95 -0
- package/packages/selector/tests/runtime/sediment-orchestrator.spec.ts +166 -0
- package/packages/selector/tests/runtime/sediment-pool-share.spec.ts +65 -0
- package/packages/selector/tests/runtime/sediment-publish.spec.ts +142 -0
- package/packages/selector/tests/runtime/sediment-real-shapes.spec.ts +158 -0
- package/packages/selector/tests/runtime/sediment-settings.spec.ts +73 -0
- package/packages/selector/tests/runtime/sediment-signals.spec.ts +124 -0
- package/packages/selector/tests/runtime/sediment-span.spec.ts +92 -0
- package/packages/selector/tests/runtime/shallow-primitives.spec.ts +135 -0
- package/packages/selector/tests/settings-seat.client.spec.ts +1 -1
- package/scripts/hosts.d.mts +3 -0
- package/scripts/sediment-latency-report.mjs +63 -0
- package/scripts/verify-release.mjs +7 -2
- package/$null +0 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Line-A signal rules (plan cci-sedimentation-triage, Phase 1).
|
|
3
|
+
*
|
|
4
|
+
* Two decoupled layers, mirroring the trial-3 findings:
|
|
5
|
+
* 1. `blockFailureVerdict` — the five BASE structural signals that mark a
|
|
6
|
+
* whole tool result as a hard failure (audit + card section grouping).
|
|
7
|
+
* 2. `linePool` — verbatim per-line capture, INDEPENDENT of the block verdict
|
|
8
|
+
* so soft-failure blocks (exit 0 with error lines in the body) still yield
|
|
9
|
+
* protected lines. Round-1 replay measured 62.4% recall when capture was
|
|
10
|
+
* gated on the block verdict; decoupling is the regression anchor.
|
|
11
|
+
*
|
|
12
|
+
* The base set is never removable; `mergeExtraPatterns` appends the validated
|
|
13
|
+
* default extras (trial-3: extras carried 48.2% of pool lines) plus user
|
|
14
|
+
* entries from `sediment.extraSignalPatterns`. Invalid regex entries are
|
|
15
|
+
* skipped here (profiles decode already rejects them upstream — belt and
|
|
16
|
+
* suspenders, never a throw at capture time).
|
|
17
|
+
*
|
|
18
|
+
* @module runtime/triage/signals
|
|
19
|
+
*/
|
|
20
|
+
import type { TriageRole, VerbatimLine } from './types.ts'
|
|
21
|
+
|
|
22
|
+
/** Per-line verbatim cap (plan: 240 codepoints, ` …` marker excluded). */
|
|
23
|
+
const LINE_CAP = 240
|
|
24
|
+
|
|
25
|
+
/** Base structural block signals: id + predicate over the raw result text. */
|
|
26
|
+
const BASE_BLOCK_SIGNALS: ReadonlyArray<{
|
|
27
|
+
readonly id: string
|
|
28
|
+
readonly test: (text: string, isError: boolean) => boolean
|
|
29
|
+
}> = Object.freeze([
|
|
30
|
+
{ id: 'sig:isError-flag', test: (_text, isError) => isError },
|
|
31
|
+
{ id: 'sig:stderr-prefix', test: text => text.trimStart().startsWith('[stderr]') },
|
|
32
|
+
{
|
|
33
|
+
id: 'sig:exit-code-bracket',
|
|
34
|
+
test: text => {
|
|
35
|
+
const trimmed = text.trim()
|
|
36
|
+
return /\[exit code:\s*(?!0\b)-?\d+\s*\]\s*$/.test(trimmed)
|
|
37
|
+
|| /\[Command finished with exit code\s+(?!0\b)-?\d+\]\s*$/.test(trimmed)
|
|
38
|
+
|| /^exit_code=\s*(?!0\b)-?\d+\s*$/.test(trimmed)
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'sig:json-exitcode',
|
|
43
|
+
test: text => {
|
|
44
|
+
const trimmed = text.trim()
|
|
45
|
+
if (!trimmed.startsWith('{') || !trimmed.endsWith('}')) return false
|
|
46
|
+
try {
|
|
47
|
+
const parsed: unknown = JSON.parse(trimmed)
|
|
48
|
+
return typeof (parsed as Record<string, unknown>)?.exitCode === 'number'
|
|
49
|
+
&& (parsed as { exitCode: number }).exitCode !== 0
|
|
50
|
+
} catch {
|
|
51
|
+
return false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
])
|
|
56
|
+
|
|
57
|
+
/** Line-level base family: the classic failure markers (spine-validated). */
|
|
58
|
+
const FAILURE_BASE_PATTERN = /(?:^|\s)(?:FAIL(?:ED)?\b|Error:|Exception:|Traceback\b|panic:|AssertionError)/
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Built-in default extras — trial-3 validated families the base misses
|
|
62
|
+
* (48.2% of pool lines in the replay corpus). Distributed like user extras:
|
|
63
|
+
* append-only, never replaces the base, individually skippable when invalid.
|
|
64
|
+
*/
|
|
65
|
+
const DEFAULT_EXTRA_PATTERNS: ReadonlyArray<{ readonly id: string; readonly source: string }> = Object.freeze([
|
|
66
|
+
{ id: 'ext:tool-timeout', source: String.raw`TOOL_TIMEOUT|timed out after \d+ms` },
|
|
67
|
+
{ id: 'ext:npm-err', source: String.raw`npm ERR!|\bERR!` },
|
|
68
|
+
{ id: 'ext:proc-kill', source: String.raw`\bkilled\b|OOM|out of memory` },
|
|
69
|
+
{ id: 'ext:assert-ctx', source: String.raw`expected .* to (?:be|equal|throw)|Received:|toStrictEqual` },
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
/** One compiled line rule with its audit id. */
|
|
73
|
+
export interface LineRule {
|
|
74
|
+
readonly id: string
|
|
75
|
+
readonly pattern: RegExp
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Compile the append-only line-rule set: base classic family first (its id
|
|
80
|
+
* wins on multi-rule matches, keeping audit stable), then built-in default
|
|
81
|
+
* extras, then user extras. Invalid user regexes are skipped silently — the
|
|
82
|
+
* settings boundary already rejected them upstream; capture must never throw.
|
|
83
|
+
*/
|
|
84
|
+
export function mergeExtraPatterns(userExtra: readonly string[]): readonly LineRule[] {
|
|
85
|
+
const rules: LineRule[] = [{ id: 'line:failure-classic', pattern: FAILURE_BASE_PATTERN }]
|
|
86
|
+
for (const entry of DEFAULT_EXTRA_PATTERNS) {
|
|
87
|
+
try {
|
|
88
|
+
rules.push({ id: entry.id, pattern: new RegExp(entry.source, 'i') })
|
|
89
|
+
} catch {
|
|
90
|
+
// Unreachable by construction; keep the loop total regardless.
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
for (const source of userExtra) {
|
|
94
|
+
try {
|
|
95
|
+
rules.push({ id: `ext:user:${source.slice(0, 60)}`, pattern: new RegExp(source) })
|
|
96
|
+
} catch {
|
|
97
|
+
// Invalid or oversized entry: skip this rule only; base and defaults stay armed.
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return rules
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const DEFAULT_LINE_RULES = mergeExtraPatterns([])
|
|
104
|
+
|
|
105
|
+
/** Verdict of the base structural block-signal set. */
|
|
106
|
+
export interface BlockFailureVerdict {
|
|
107
|
+
readonly hard: boolean
|
|
108
|
+
readonly ruleIds: readonly string[]
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Decide whether the whole block carries a hard failure signal (audit/grouping only — never gates the line pool). */
|
|
112
|
+
export function blockFailureVerdict(text: string, isError: boolean): BlockFailureVerdict {
|
|
113
|
+
const ruleIds: string[] = []
|
|
114
|
+
for (const rule of BASE_BLOCK_SIGNALS) {
|
|
115
|
+
if (rule.test(text, isError)) ruleIds.push(rule.id)
|
|
116
|
+
}
|
|
117
|
+
return { hard: ruleIds.length > 0, ruleIds }
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Capture context for one block's lines. */
|
|
121
|
+
export interface LinePoolContext {
|
|
122
|
+
readonly seq: number
|
|
123
|
+
readonly role: TriageRole
|
|
124
|
+
readonly hardFailure: boolean
|
|
125
|
+
/** Compiled rule set from `mergeExtraPatterns`; absent uses the default set. */
|
|
126
|
+
readonly extraPatterns?: readonly LineRule[]
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function usefulLines(text: string): string[] {
|
|
130
|
+
return text.replace(/\n+$/, '').split('\n')
|
|
131
|
+
.filter(line => {
|
|
132
|
+
const trimmed = line.trim()
|
|
133
|
+
return trimmed.length > 0 && trimmed !== '[stderr]' && !/^\[exit code:/.test(trimmed)
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Verbatim per-line capture over the compiled rule set. Dedup by exact line
|
|
139
|
+
* text within the block, 240-codepoint cap with ` …` marker, first-matching
|
|
140
|
+
* rule wins the audit id (base order guarantees `line:failure-classic` wins
|
|
141
|
+
* ties). Decoupled from block classification: soft-failure blocks pass through
|
|
142
|
+
* with `hardFailure: false` and still yield lines.
|
|
143
|
+
*/
|
|
144
|
+
export function linePool(text: string, context: LinePoolContext): VerbatimLine[] {
|
|
145
|
+
const rules = context.extraPatterns ?? DEFAULT_LINE_RULES
|
|
146
|
+
const pool: VerbatimLine[] = []
|
|
147
|
+
const seen = new Set<string>()
|
|
148
|
+
for (const raw of usefulLines(text)) {
|
|
149
|
+
const line = raw.trim()
|
|
150
|
+
if (seen.has(line)) continue
|
|
151
|
+
const matched = rules.find(rule => rule.pattern.test(line))
|
|
152
|
+
if (matched === undefined) continue
|
|
153
|
+
seen.add(line)
|
|
154
|
+
const chars = Array.from(line)
|
|
155
|
+
const truncated = chars.length > LINE_CAP
|
|
156
|
+
const captured = truncated ? `${chars.slice(0, LINE_CAP).join('')} …` : line
|
|
157
|
+
pool.push({
|
|
158
|
+
seq: context.seq,
|
|
159
|
+
role: context.role,
|
|
160
|
+
text: captured,
|
|
161
|
+
ruleId: matched.id,
|
|
162
|
+
truncated,
|
|
163
|
+
hardFailure: context.hardFailure,
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
return pool
|
|
167
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frozen triage contract (plan cci-sedimentation-triage, T0.4).
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for the three-line sorting vocabulary shared by the
|
|
5
|
+
* signal pool (line A), the narrative stream (line B), and the deterministic
|
|
6
|
+
* masks (line C), plus the whole-turn card assembly. Downstream phases treat
|
|
7
|
+
* this file as read-only: contract changes require a plan amendment, not an
|
|
8
|
+
* in-flight edit.
|
|
9
|
+
*
|
|
10
|
+
* @module runtime/triage/types
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** Roles whose lines may enter the verbatim protection pool. */
|
|
14
|
+
export type TriageRole = 'user' | 'assistant' | 'tool'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Permanent shallow-read checkpoint (plan R11): survives `discard` — the
|
|
18
|
+
* map is never lost, only the map's bulk. Four fields, rendered as one line.
|
|
19
|
+
*/
|
|
20
|
+
export interface ShallowCheckpoint {
|
|
21
|
+
/** Normalized target path (drive letter lowered, separators unified). */
|
|
22
|
+
readonly path: string
|
|
23
|
+
/** Coverage statement of the body the checkpoint stands for. */
|
|
24
|
+
readonly coverage: string
|
|
25
|
+
/** session:// reference into the original event (retrieve target). */
|
|
26
|
+
readonly ref: string
|
|
27
|
+
/** Cheap structural fingerprint (size + head hash) for staleness hints. */
|
|
28
|
+
readonly fingerprint: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** One verbatim line captured by a signal rule, capped at capture time. */
|
|
32
|
+
export interface VerbatimLine {
|
|
33
|
+
/** Event seq of the owning tool/result or message on the session surface. */
|
|
34
|
+
readonly seq: number
|
|
35
|
+
readonly role: TriageRole
|
|
36
|
+
/** Line text as captured (240-codepoint cap applied, `truncated` marks it). */
|
|
37
|
+
readonly text: string
|
|
38
|
+
/** Rule id that captured this line (base set or extra slot), for audit. */
|
|
39
|
+
readonly ruleId: string
|
|
40
|
+
/** True when the stored text hit the per-line cap. */
|
|
41
|
+
readonly truncated: boolean
|
|
42
|
+
/** True when the owning block carried a hard failure signal (exit/stderr/isError). */
|
|
43
|
+
readonly hardFailure: boolean
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Deterministic mask verdict for one tool result (line C). */
|
|
47
|
+
export type MaskVerdict =
|
|
48
|
+
| {
|
|
49
|
+
readonly kind: 'manifest'
|
|
50
|
+
/** Target paths resolved from call args first, result text only as fallback. */
|
|
51
|
+
readonly paths: readonly string[]
|
|
52
|
+
readonly seq: number
|
|
53
|
+
}
|
|
54
|
+
| {
|
|
55
|
+
readonly kind: 'skeleton'
|
|
56
|
+
/** Captured declaration lines (base order preserved, capped). */
|
|
57
|
+
readonly lines: readonly string[]
|
|
58
|
+
/** Total body lines the skeleton stands for. */
|
|
59
|
+
readonly totalLines: number
|
|
60
|
+
/** Byte length of the elided body, for omission stats. */
|
|
61
|
+
readonly elidedChars: number
|
|
62
|
+
readonly seq: number
|
|
63
|
+
/** Permanent checkpoint layer (R11); `discard` may remove body, never this. */
|
|
64
|
+
readonly checkpoint?: ShallowCheckpoint
|
|
65
|
+
}
|
|
66
|
+
| {
|
|
67
|
+
readonly kind: 'pointer'
|
|
68
|
+
/** Oversized single result replaced by its event-seq pointer. */
|
|
69
|
+
readonly seq: number
|
|
70
|
+
readonly tokens: number
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** One narrative span left for the compression stream (line B). */
|
|
74
|
+
export interface NarrativeSpan {
|
|
75
|
+
readonly seq: number
|
|
76
|
+
readonly role: TriageRole
|
|
77
|
+
/** Token estimate carried by the span (estimator contract: same meter as stats). */
|
|
78
|
+
readonly tokens: number
|
|
79
|
+
readonly text: string
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Complete per-block triage output. `poolLines` and `mask` are verbatim-safe
|
|
84
|
+
* (copy, never paraphrase); `residualNarrative` is the only fold-eligible
|
|
85
|
+
* material and MUST NOT contain pooled or masked content.
|
|
86
|
+
*/
|
|
87
|
+
export interface TriageResult {
|
|
88
|
+
readonly poolLines: readonly VerbatimLine[]
|
|
89
|
+
readonly mask?: MaskVerdict
|
|
90
|
+
readonly residualNarrative: readonly NarrativeSpan[]
|
|
91
|
+
/** Gross tokens of the source block, for the rewrite guard accounting. */
|
|
92
|
+
readonly sourceTokens: number
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Card assembly order (R1/R7): mechanical cache first, narrative appended last. */
|
|
96
|
+
export interface TurnCardDraft {
|
|
97
|
+
/** Pointer head: one line, event-seq reference, no backup paths. */
|
|
98
|
+
readonly head: string
|
|
99
|
+
/** Verbatim protection pool section (line A). */
|
|
100
|
+
readonly pool: readonly VerbatimLine[]
|
|
101
|
+
/** Mask sections (line C), in span order. */
|
|
102
|
+
readonly masks: readonly MaskVerdict[]
|
|
103
|
+
/** Omission stats line (counts only). */
|
|
104
|
+
readonly omissionStats: string
|
|
105
|
+
/** Narrative segment: closing text (tier 1) or fold output (tier 2); absent = tier 3. */
|
|
106
|
+
readonly narrative?: string
|
|
107
|
+
/** Narrative tier actually used, for audit and stats separation (M22). */
|
|
108
|
+
readonly narrativeTier: 'closing' | 'fold' | 'mechanical-only'
|
|
109
|
+
/** Sum of retained verbatim+narrative tokens; replacement requires < sourceTokens (M7). */
|
|
110
|
+
readonly retainedTokens: number
|
|
111
|
+
/** Source span tokens this card replaces. */
|
|
112
|
+
readonly sourceTokens: number
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Gate verdicts for one whole-turn replacement candidate (R13). */
|
|
116
|
+
export interface TurnGateVerdict {
|
|
117
|
+
/** reason gate: only `turn/end(completed)` may proceed. */
|
|
118
|
+
readonly completed: boolean
|
|
119
|
+
/** closing qualification gate result (tier decision already made upstream). */
|
|
120
|
+
readonly narrativeTier: TurnCardDraft['narrativeTier']
|
|
121
|
+
/** rewrite guard: retained saving must clear tail-rewrite × ratio (findings F2). */
|
|
122
|
+
readonly rewriteGuardPassed: boolean
|
|
123
|
+
/** estimated cached-tail tokens invalidated by the replacement point. */
|
|
124
|
+
readonly rewriteTailTokens: number
|
|
125
|
+
}
|
|
@@ -147,6 +147,32 @@ export interface MonitorPanelSettings {
|
|
|
147
147
|
enabled: boolean
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Turn-tail sedimentation gate (plan cci-sedimentation-triage). Whole-turn
|
|
152
|
+
* atomic replacement primary, span as oversized-turn split and cache-strict
|
|
153
|
+
* fallback. Default off; mirrored browser-side in profiles.ts.
|
|
154
|
+
*/
|
|
155
|
+
export interface SedimentSettings {
|
|
156
|
+
enabled: boolean
|
|
157
|
+
granularity: 'turn' | 'span'
|
|
158
|
+
minClosingTokens: number
|
|
159
|
+
rewriteGuardRatio: number
|
|
160
|
+
maxTurnSpanTokens: number
|
|
161
|
+
/** Append-only extra failure-signal patterns; never replaces the base set. */
|
|
162
|
+
extraSignalPatterns?: string[]
|
|
163
|
+
/** Fold narrative channel (Phase 4): '' keeps tier 2 inert. */
|
|
164
|
+
foldMode?: '' | 'host' | 'direct'
|
|
165
|
+
/** LAN fold endpoints share one OpenAI-compatible base URL (direct mode). */
|
|
166
|
+
foldBaseUrl?: string
|
|
167
|
+
foldBaseUrlKey?: string
|
|
168
|
+
/** Tier-1 endpoint (≤2K input): high hot-decode throughput. */
|
|
169
|
+
foldStrataProvider?: string
|
|
170
|
+
foldStrataModel?: string
|
|
171
|
+
/** Tier-2 endpoint (2~8K input): stable cold-prefill profile. */
|
|
172
|
+
foldLocal35Provider?: string
|
|
173
|
+
foldLocal35Model?: string
|
|
174
|
+
}
|
|
175
|
+
|
|
150
176
|
/**
|
|
151
177
|
* Persisted sub-capability overrides for the `tokenpilot-inspired` preset.
|
|
152
178
|
* Absent fields inherit the preset defaults; the section is only meaningful
|
|
@@ -189,6 +215,8 @@ export interface ContextCompressionSettings {
|
|
|
189
215
|
autoCompact: AutoCompactSettings
|
|
190
216
|
/** Code-skeleton reducer gate snapped independently of `profile`. */
|
|
191
217
|
codeSkeleton: CodeSkeletonSettings
|
|
218
|
+
/** Turn-tail sedimentation gate; absent inherits the off defaults (optional section like `monitorPanel`). */
|
|
219
|
+
sediment?: SedimentSettings
|
|
192
220
|
/** Turn-tail intent-summary gate snapped independently of `profile`. */
|
|
193
221
|
intentSummary: IntentSummarySettings
|
|
194
222
|
/** Floating compression-monitor panel (FAB); absent inherits hidden. */
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
[assistant] 改名后 tsc EXIT 0、58 文件全绿、三 bundle 构建完成。补 `Tests` 计数 + 重打 1.4.1 包(替换上轮误留的 1.4.0 tgz)+ 逐字节核验 + 看改名影响哪些 tracked 文件。
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
[tool-call pwsh "{\"command\":\"Set-Location \\\"E:\\\\test\\\\rewrite-agently\\\\mine-dsh-plugins\\\\dsh-browser-cdp\\\"; \\\"=== Tests]
|
|
5
|
+
===
|
|
6
|
+
[tool] === Tests 计数 ===
|
|
7
|
+
|
|
8
|
+
Tests 850 passed | 12 skipped (862)
|
|
9
|
+
=== 删旧 1.4.0 tgz, 重打 1.4.1 ===
|
|
10
|
+
dsh-browser-cdp-1.4.1.tgz
|
|
11
|
+
tgz版本: 1.4.1
|
|
12
|
+
tgz SHA: E7F804F6871979B42D4F8145EAB5EABA4FE22C73905F62C8A70B4A6A2DC54E15
|
|
13
|
+
build SHA: E7F804F6871979B42D4F8145EAB5EABA4FE22C73905F62C8A70B4A6A2DC54E15
|
|
14
|
+
MATCH ✅
|
|
15
|
+
tgz大小: 517920 B
|
|
16
|
+
=== 改名影响 tracked 文件 ===
|
|
17
|
+
M CHANGELOG.md
|
|
18
|
+
M README.md
|
|
19
|
+
M dsh-plugin.json
|
|
20
|
+
M package.json
|
|
21
|
+
M tests/tool-tiers.test.ts
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
[stderr]
|
|
25
|
+
ConvertFrom-Json : 传入的对象无效,应为“:”或“}”。 (1034): {
|
|
26
|
+
"$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
|
|
27
|
+
"id": "dsh-browser-cdp",
|
|
28
|
+
"name": "dsh-browser-cdp",
|
|
29
|
+
"version": "1.4.1",
|
|
30
|
+
"manifestVersion": "0.15",
|
|
31
|
+
"facets": {
|
|
32
|
+
"host": {
|
|
33
|
+
"entry": "lib/index.js",
|
|
34
|
+
"apiVersion": "v1alpha1"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"requires": {
|
|
38
|
+
"contracts": [
|
|
39
|
+
{
|
|
40
|
+
"apiVersion": "presentation.dsh/v1alpha1",
|
|
41
|
+
"kind": "OpenExternal",
|
|
42
|
+
"optional": true,
|
|
43
|
+
"fallback": "report the URL as text instead of opening it"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"apiVersion": "presentation.dsh/v1alpha1",
|
|
47
|
+
"kind": "Notification",
|
|
48
|
+
"optional": true,
|
|
49
|
+
"fallback": "log the notice to the browser-status scene"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"permissions": [],
|
|
54
|
+
"contributes": {
|
|
55
|
+
"commands": [],
|
|
56
|
+
"x-dsh-tui": [
|
|
57
|
+
{
|
|
58
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
59
|
+
"kind": "Scene",
|
|
60
|
+
"id": "dsh-browser-cdp.watch",
|
|
61
|
+
"name": "agent_browser",
|
|
62
|
+
"spec": {
|
|
63
|
+
"title": "Agent 娴忚鍣?,
|
|
64
|
+
"titles": {
|
|
65
|
+
"en": "Agent Browser",
|
|
66
|
+
"zh": "Agent 娴忚鍣?
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
72
|
+
"kind": "SettingsSection",
|
|
73
|
+
"id": "dsh-browser-cdp.settings",
|
|
74
|
+
"name": "dsh_browser_cdp_settings",
|
|
75
|
+
"spec": {
|
|
76
|
+
"namespace": "dsh-browser-cdp",
|
|
77
|
+
"title": "Agent 娴忚鍣?,
|
|
78
|
+
"titles": {
|
|
79
|
+
"en": "Agent Browser",
|
|
80
|
+
"zh": "Agent 娴忚鍣?
|
|
81
|
+
},
|
|
82
|
+
"fields": [
|
|
83
|
+
{
|
|
84
|
+
"path": [
|
|
85
|
+
"toolInjection"
|
|
86
|
+
],
|
|
87
|
+
"label": "宸ュ叿娉ㄥ叆妯″紡 (Tool injection mode)",
|
|
88
|
+
"kind": "select",
|
|
89
|
+
"options": [
|
|
90
|
+
{
|
|
91
|
+
"value": "lazy",
|
|
92
|
+
"label": "lazy"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"value": "always",
|
|
96
|
+
"label": "always"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"hint": "lazy锛堥粯璁わ級= 甯搁┗鏍稿績 7 涓?+ 閫冪敓鑸?2 涓紝鍏朵綑棣栨 bcdp_* 璋冪敤鍚庢寜涓嬫柟寮€鍏虫敞鍏ワ紝闂茬疆鍥炴敹鏃舵敹鍥烇紱always = 鎸傝浇鍗虫敞鍐屽叏
|
|
100
|
+
閮?38 涓紙鍘嗗彶琛屼负锛夈€?
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"path": [
|
|
104
|
+
"toolBrowse"
|
|
105
|
+
],
|
|
106
|
+
"label": "鍩虹鎿嶄綔宸ュ叿锛?6 涓級",
|
|
107
|
+
"kind": "boolean",
|
|
108
|
+
"hint": "寮€锛堥粯璁わ級= 娴忚鍣ㄦ椿鍔ㄥ悗鎸?act 鈫?observe 鈫?wait 涓夋尝鏀捐锛涘叧 = 16 涓伐鍏蜂粠妯″瀷宸ュ叿鍒楄〃绉婚櫎锛堢偣鍑?濉啓/閿紶/鎷栨嫿/鎴浘/
|
|
109
|
+
璇诲彇/绛夊緟鈥︼級銆?
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"path": [
|
|
113
|
+
"toolExtended"
|
|
114
|
+
],
|
|
115
|
+
"label": "鎵╁睍鑳藉姏宸ュ叿锛? 涓級",
|
|
116
|
+
"kind": "boolean",
|
|
117
|
+
"hint": "寮€锛堥粯璁わ級= 娴忚鍣ㄦ椿鍔ㄥ悗娉ㄥ唽锛涘叧 = 8 涓伐鍏风Щ闄わ紙瑁?CDP/HTTP/涓婁紶/涓嬭浇/瀵硅瘽妗?楠岃瘉鐮?鐧诲綍钀界洏/鐧诲綍瀵煎叆锛夈€?
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"path": [
|
|
121
|
+
"toolEscape"
|
|
122
|
+
],
|
|
123
|
+
"label": "閫冪敓鑸?cli / script锛? 涓級",
|
|
124
|
+
"kind": "boolean",
|
|
125
|
+
"hint": "濮嬬粓鍙敤鈥斺€斾笌鍏跺畠妗d笉鍚岋紝瀹冧笉绛夋祻瑙堝櫒娲诲姩锛屽洜涓轰竴涓?heredoc 灏辫兘鍋氬埌鍏朵綑 36 涓伐鍏风殑浜嬨€傚叧 = 灏佸嵃銆?
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"path": [
|
|
129
|
+
"toolJudge"
|
|
130
|
+
],
|
|
131
|
+
"label": "璇勫宸ュ叿 bcdp_jev_*锛? 涓級",
|
|
132
|
+
"kind": "boolean",
|
|
133
|
+
"hint": "寮€浠嶉渶閰嶄簡 JEV 鎴?Laya Key锛氭病 Key 鐨勮瘎瀹″伐鍏峰彧鑳藉洖绛斻€屾湭閰嶇疆銆嶏紝渚濇棫涓嶆敞鍏ャ€傚叧 = 浠讳綍鎯呭喌涓嬮兘涓嶆敞鍏ャ€?
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"path": [
|
|
137
|
+
"isolateSpaces"
|
|
138
|
+
],
|
|
139
|
+
"label": "浠诲姟绌洪棿娌欑洅闅旂 (Space isolation)",
|
|
140
|
+
"kind": "boolean",
|
|
141
|
+
"hint": "榛樿鍏抽棴锛氫娇鐢ㄧ鐩樻寔涔呭寲 Profile锛屼换鍔′腑鐧诲綍鐨勮处鍙疯法鐢佃剳閲嶅惎姘镐箙淇濈暀锛涘紑鍚悗浣跨敤鍐呭瓨涓存椂娌欑洅闅旂锛屼换鍔$粨鏉熶笉钀界洏銆?
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"path": [
|
|
145
|
+
"idleTimeoutMin"
|
|
146
|
+
],
|
|
147
|
+
"label": "绌洪棽鑷姩鍥炴敹 (Idle auto-stop, minutes)",
|
|
148
|
+
"kind": "number",
|
|
149
|
+
"hint": "N 鍒嗛挓娌℃湁浠讳綍 bcdp_* 璋冪敤鍚庤嚜鍔ㄥ叧闂悗鍙版祻瑙堝櫒杩涚▼锛? = 鍏抽棴姝ゅ姛鑳斤級銆備笅娆¤皟鐢ㄤ細鑷姩鍐峰惎鍔紙绾?2-4 绉掞級銆傝瀵熺獥姝e湪瑙傜湅涓嶇畻
|
|
150
|
+
娲诲姩銆?
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"path": [
|
|
154
|
+
"chromePath"
|
|
155
|
+
],
|
|
156
|
+
"label": "Browser binary path",
|
|
157
|
+
"kind": "text",
|
|
158
|
+
"hint": "Path to the Chrome/Chromium/Edge binary. Empty = auto-detect."
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"path": [
|
|
162
|
+
"captureBackend"
|
|
163
|
+
],
|
|
164
|
+
"label": "Capture backend",
|
|
165
|
+
"kind": "select",
|
|
166
|
+
"options": [
|
|
167
|
+
{
|
|
168
|
+
"value": "auto",
|
|
169
|
+
"label": "Auto"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"value": "cdp",
|
|
173
|
+
"label": "CDP"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"value": "ffmpeg",
|
|
177
|
+
"label": "FFmpeg"
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"path": [
|
|
183
|
+
"streamProfile"
|
|
184
|
+
],
|
|
185
|
+
"label": "Quality profile",
|
|
186
|
+
"kind": "select",
|
|
187
|
+
"options": [
|
|
188
|
+
{
|
|
189
|
+
"value": "balanced",
|
|
190
|
+
"label": "Balanced"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"value": "quality",
|
|
194
|
+
"label": "Quality"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"value": "speed",
|
|
198
|
+
"label": "Speed"
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"path": [
|
|
204
|
+
"ffmpegPath"
|
|
205
|
+
],
|
|
206
|
+
"label": "FFmpeg binary path",
|
|
207
|
+
"kind": "text",
|
|
208
|
+
"hint": "Path to ffmpeg. Empty = auto-detect / on-demand install."
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
"subscriptions": [],
|
|
216
|
+
"license": "MIT",
|
|
217
|
+
"source": {
|
|
218
|
+
"repository": "https://github.com/drscrewdriver/dsh-browser-cdp"
|
|
219
|
+
},
|
|
220
|
+
"compat": {
|
|
221
|
+
"hosts": [
|
|
222
|
+
"dsh-tui"
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
所在位置 行:1 字符: 703
|
|
227
|
+
+ ... -Content "_p\package\dsh-plugin.json" -Raw | ConvertFrom-Json).versio ...
|
|
228
|
+
+ ~~~~~~~~~~~~~~~~
|
|
229
|
+
+ CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
|
|
230
|
+
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
|
|
231
|
+
|