dsh-context-compression-improved 0.9.8 → 0.9.9-beta.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/README.md +15 -98
- package/README.zh.md +14 -92
- package/THIRD_PARTY_NOTICES.md +25 -7
- package/{packages/selector/dsh.plugin.json → dsh.plugin.json} +1 -1
- package/{packages/selector/lib → lib}/client.d.ts +16 -0
- package/{packages/selector/lib → lib}/client.js +393 -116
- package/{packages/selector/lib → lib}/index.js +829 -10
- package/{packages/selector/lib → lib}/invariant.js +2 -1
- package/{packages/selector/lib → lib}/pruner.d.ts +1 -1
- package/{packages/selector/lib → lib}/pruner.js +77 -983
- package/lib/savings-integral.js +4515 -0
- package/{packages/selector/lib → lib}/tail-trim.js +2 -90
- package/lib/tool-result.js +150 -0
- package/package.json +125 -112
- package/screenshots.json +3 -6
- package/.gitattributes +0 -2
- package/.githooks/pre-push +0 -37
- package/.github/workflows/ci.yml +0 -39
- package/CHANGELOG.de.md +0 -580
- package/CHANGELOG.es.md +0 -588
- package/CHANGELOG.fr.md +0 -576
- package/CHANGELOG.it.md +0 -577
- package/CHANGELOG.ja.md +0 -261
- package/CHANGELOG.ko.md +0 -254
- package/CHANGELOG.md +0 -536
- package/CHANGELOG.ru.md +0 -554
- package/CHANGELOG.zh.md +0 -236
- package/CONTRIBUTING.md +0 -22
- package/README.de.md +0 -96
- package/README.es.md +0 -96
- package/README.fr.md +0 -96
- package/README.it.md +0 -96
- package/README.ja.md +0 -102
- package/README.ko.md +0 -102
- package/README.ru.md +0 -96
- package/SECURITY.md +0 -18
- package/assets/board.png +0 -0
- package/assets/context.png +0 -0
- package/docs/assets/context-compression-selector-profiles.jpg +0 -0
- package/docs/assets/context-compression-selector-settings.png +0 -0
- package/docs/compat-0.1.5-report.md +0 -77
- package/docs/installation.de.md +0 -104
- package/docs/installation.es.md +0 -104
- package/docs/installation.fr.md +0 -104
- package/docs/installation.it.md +0 -104
- package/docs/installation.ja.md +0 -78
- package/docs/installation.ko.md +0 -78
- package/docs/installation.md +0 -103
- package/docs/installation.ru.md +0 -104
- package/docs/installation.zh.md +0 -100
- package/docs/repair-log.md +0 -657
- package/eslint.config.js +0 -30
- package/packages/selector/LICENSE +0 -21
- package/packages/selector/README.md +0 -26
- package/packages/selector/README.zh.md +0 -24
- package/packages/selector/THIRD_PARTY_NOTICES.md +0 -32
- package/packages/selector/docs/history-tool-call-working-set-spec.md +0 -112
- package/packages/selector/docs/native-tool-result-selector-spec.md +0 -34
- package/packages/selector/docs/subagent-cache-reuse-spec.md +0 -46
- package/packages/selector/lib/config.js +0 -1777
- package/packages/selector/lib/host-generation.js +0 -62
- package/packages/selector/lib/style.css +0 -350
- package/packages/selector/package.json +0 -174
- package/packages/selector/screenshots.json +0 -3
- package/packages/selector/src/client/CompressionProfileControls.tsx +0 -293
- package/packages/selector/src/client/CompressionProfileSelector.module.css +0 -199
- package/packages/selector/src/client/CompressionProfileSelector.tsx +0 -85
- package/packages/selector/src/client/CustomPolicyEditor.tsx +0 -216
- package/packages/selector/src/client/EstimatorControls.tsx +0 -277
- package/packages/selector/src/client/bridge-scope.ts +0 -125
- package/packages/selector/src/client/decode.ts +0 -57
- package/packages/selector/src/client/index.ts +0 -421
- package/packages/selector/src/client/locales/de.ts +0 -142
- package/packages/selector/src/client/locales/es.ts +0 -142
- package/packages/selector/src/client/locales/fr.ts +0 -142
- package/packages/selector/src/client/locales/it.ts +0 -142
- package/packages/selector/src/client/locales/ja.ts +0 -142
- package/packages/selector/src/client/locales/ko.ts +0 -142
- package/packages/selector/src/client/locales/ru.ts +0 -142
- package/packages/selector/src/client/locales.ts +0 -284
- package/packages/selector/src/client/monitor-fab.ts +0 -349
- package/packages/selector/src/client/preset-options.ts +0 -88
- package/packages/selector/src/client/savings-card.tsx +0 -150
- package/packages/selector/src/client/scope-face.ts +0 -24
- package/packages/selector/src/client/settings-section.tsx +0 -140
- package/packages/selector/src/compat/host-generation.ts +0 -96
- package/packages/selector/src/compat/llm-messages.ts +0 -50
- package/packages/selector/src/compat/settings-lease.ts +0 -108
- package/packages/selector/src/compat/tool-result.ts +0 -91
- package/packages/selector/src/css-modules.d.ts +0 -6
- package/packages/selector/src/deepseek-v4-tokenizer.ts +0 -205
- package/packages/selector/src/estimator-catalog.ts +0 -104
- package/packages/selector/src/index.ts +0 -655
- package/packages/selector/src/invariant.ts +0 -113
- package/packages/selector/src/preset-overlay.ts +0 -749
- package/packages/selector/src/profiles.ts +0 -431
- package/packages/selector/src/pruner/content.ts +0 -198
- package/packages/selector/src/pruner/session.ts +0 -97
- package/packages/selector/src/pruner/state.ts +0 -61
- package/packages/selector/src/pruner/tuning.ts +0 -23
- package/packages/selector/src/pruner/types.ts +0 -78
- package/packages/selector/src/pruner.ts +0 -2868
- package/packages/selector/src/runtime/adaptive-cost.ts +0 -205
- package/packages/selector/src/runtime/audit.ts +0 -303
- package/packages/selector/src/runtime/config.ts +0 -756
- package/packages/selector/src/runtime/custom-policy.ts +0 -278
- package/packages/selector/src/runtime/deepseek-official-pricing.ts +0 -298
- package/packages/selector/src/runtime/deepseek-v4-vision-tokens.ts +0 -254
- package/packages/selector/src/runtime/measurement.ts +0 -444
- package/packages/selector/src/runtime/monitor.ts +0 -235
- package/packages/selector/src/runtime/reducers.ts +0 -1754
- package/packages/selector/src/runtime/retrieve.ts +0 -484
- package/packages/selector/src/runtime/savings-projection.ts +0 -226
- package/packages/selector/src/runtime/savings.ts +0 -417
- package/packages/selector/src/runtime/session-events.ts +0 -30
- package/packages/selector/src/runtime/summary-command.ts +0 -127
- package/packages/selector/src/runtime/tail-trim.ts +0 -176
- package/packages/selector/src/runtime/token-count.ts +0 -72
- package/packages/selector/src/runtime/tokenpilot/advisor-prompt.ts +0 -233
- package/packages/selector/src/runtime/tokenpilot/advisor-state.ts +0 -204
- package/packages/selector/src/runtime/tokenpilot/advisor.ts +0 -419
- package/packages/selector/src/runtime/tokenpilot/benefit.ts +0 -200
- package/packages/selector/src/runtime/tokenpilot/dedup.ts +0 -81
- package/packages/selector/src/runtime/tokenpilot/estimator.ts +0 -151
- package/packages/selector/src/runtime/tokenpilot/intent-fold.ts +0 -53
- package/packages/selector/src/runtime/tokenpilot/intent-gate.ts +0 -65
- package/packages/selector/src/runtime/tokenpilot/intent-input-mask.ts +0 -125
- package/packages/selector/src/runtime/tokenpilot/intent-range.ts +0 -37
- package/packages/selector/src/runtime/tokenpilot/locator.ts +0 -128
- package/packages/selector/src/runtime/tokenpilot/read-state.ts +0 -98
- package/packages/selector/src/runtime/tokenpilot/sidechannel.ts +0 -303
- package/packages/selector/src/runtime/toolclass.ts +0 -103
- package/packages/selector/src/runtime/types.ts +0 -365
- package/packages/selector/src/runtime/value.ts +0 -48
- package/packages/selector/src/settings-bridge.ts +0 -175
- package/packages/selector/tests/advisor-report.host.spec.ts +0 -223
- package/packages/selector/tests/auto-compact.client.spec.tsx +0 -214
- package/packages/selector/tests/built/client-artifact.spec.ts +0 -56
- package/packages/selector/tests/cache-prefix-audit.spec.ts +0 -123
- package/packages/selector/tests/code-skeleton.client.spec.ts +0 -98
- package/packages/selector/tests/compat/compat-narrow-waist.spec.ts +0 -150
- package/packages/selector/tests/custom-contract.client.spec.ts +0 -226
- package/packages/selector/tests/estimator-catalog.spec.ts +0 -70
- package/packages/selector/tests/estimator-channel.client.spec.tsx +0 -253
- package/packages/selector/tests/estimator-route-registration.host.spec.ts +0 -199
- package/packages/selector/tests/helpers/legacy-namespace.ts +0 -35
- package/packages/selector/tests/helpers/legacy-settings/index.ts +0 -15
- package/packages/selector/tests/helpers/legacy-settings/legacy/provider.d.ts +0 -41
- package/packages/selector/tests/helpers/legacy-settings/legacy/provider.js +0 -647
- package/packages/selector/tests/helpers/legacy-settings/legacy/redact.js +0 -78
- package/packages/selector/tests/helpers/legacy-settings/legacy/util-values.js +0 -234
- package/packages/selector/tests/host-preset-overlay.host.spec.ts +0 -204
- package/packages/selector/tests/monitor-fab.client.spec.ts +0 -138
- package/packages/selector/tests/preset-options-write.client.spec.ts +0 -192
- package/packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts +0 -200
- package/packages/selector/tests/preset-overlay.host.spec.ts +0 -246
- package/packages/selector/tests/profiles.client.spec.tsx +0 -436
- package/packages/selector/tests/public/package-contract.client.spec.ts +0 -86
- package/packages/selector/tests/runtime/adaptive-cost.spec.ts +0 -167
- package/packages/selector/tests/runtime/advice-never-withholds.host.spec.ts +0 -230
- package/packages/selector/tests/runtime/advisor-invariant.spec.ts +0 -272
- package/packages/selector/tests/runtime/advisor.spec.ts +0 -226
- package/packages/selector/tests/runtime/audit.spec.ts +0 -275
- package/packages/selector/tests/runtime/auto-compact-config.spec.ts +0 -523
- package/packages/selector/tests/runtime/char-basis.spec.ts +0 -30
- package/packages/selector/tests/runtime/code-skeleton.spec.ts +0 -152
- package/packages/selector/tests/runtime/deepseek-official-pricing.spec.ts +0 -186
- package/packages/selector/tests/runtime/deepseek-v4-tokenizer.spec.ts +0 -122
- package/packages/selector/tests/runtime/deepseek-v4-vision-tokens.spec.ts +0 -122
- package/packages/selector/tests/runtime/deprecated-preset-options.spec.ts +0 -96
- package/packages/selector/tests/runtime/fixtures/profile-baseline.json +0 -273
- package/packages/selector/tests/runtime/fixtures/tokenizer-golden.json +0 -106
- package/packages/selector/tests/runtime/fixtures/vision-golden.json +0 -459
- package/packages/selector/tests/runtime/frequency-longstrings.spec.ts +0 -74
- package/packages/selector/tests/runtime/fresh-gate.spec.ts +0 -43
- package/packages/selector/tests/runtime/html-reducer.spec.ts +0 -212
- package/packages/selector/tests/runtime/intent-gate.spec.ts +0 -62
- package/packages/selector/tests/runtime/intent-summary.spec.ts +0 -156
- package/packages/selector/tests/runtime/jsonl-reducer.spec.ts +0 -79
- package/packages/selector/tests/runtime/line-mapping.spec.ts +0 -153
- package/packages/selector/tests/runtime/monitor.spec.ts +0 -301
- package/packages/selector/tests/runtime/prose-reducers.spec.ts +0 -133
- package/packages/selector/tests/runtime/public/public-runtime.spec.ts +0 -2782
- package/packages/selector/tests/runtime/read-input-cap.spec.ts +0 -33
- package/packages/selector/tests/runtime/savings-projection.spec.ts +0 -89
- package/packages/selector/tests/runtime/savings.spec.ts +0 -139
- package/packages/selector/tests/runtime/search-reducer.spec.ts +0 -110
- package/packages/selector/tests/runtime/session-events.spec.ts +0 -27
- package/packages/selector/tests/runtime/settings-unwrap.spec.ts +0 -58
- package/packages/selector/tests/runtime/sidechannel.spec.ts +0 -241
- package/packages/selector/tests/runtime/summary-command.spec.ts +0 -154
- package/packages/selector/tests/runtime/toc-and-bundled.spec.ts +0 -159
- package/packages/selector/tests/runtime/tokenizer-golden.spec.ts +0 -53
- package/packages/selector/tests/runtime/tokenpilot/benefit.spec.ts +0 -217
- package/packages/selector/tests/runtime/tokenpilot/dedup.spec.ts +0 -52
- package/packages/selector/tests/runtime/tokenpilot/estimator.spec.ts +0 -79
- package/packages/selector/tests/runtime/tokenpilot/locator.spec.ts +0 -76
- package/packages/selector/tests/runtime/tokenpilot/profile-baseline.spec.ts +0 -119
- package/packages/selector/tests/runtime/tokenpilot/read-state.spec.ts +0 -82
- package/packages/selector/tests/runtime/toolclass.spec.ts +0 -156
- package/packages/selector/tests/runtime/value.spec.ts +0 -23
- package/packages/selector/tests/settings-seat.client.spec.ts +0 -215
- package/packages/selector/tests/standing-generation.host.spec.ts +0 -724
- package/packages/selector/tests/subagent-cache-reuse.host.spec.ts +0 -269
- package/packages/selector/tests/support/cache-prefix-audit.ts +0 -105
- package/packages/selector/tests/support/mock-adapter.ts +0 -37
- package/packages/selector/tests/support/ui-primitives.tsx +0 -34
- package/packages/selector/tsconfig.json +0 -11
- package/packages/selector/tsdown.client.config.ts +0 -102
- package/packages/selector/tsdown.config.ts +0 -20
- package/pnpm-workspace.yaml +0 -72
- package/scripts/capture-profile-baseline.mjs +0 -42
- package/scripts/cell-browser-e2e.mjs +0 -354
- package/scripts/generate-tokenizer-fixtures.py +0 -81
- package/scripts/generate-vision-fixtures.py +0 -208
- package/scripts/hosts.mjs +0 -78
- package/scripts/packed-components-smoke.mjs +0 -763
- package/scripts/packed-install-e2e.mjs +0 -1346
- package/scripts/sync-hosts.mjs +0 -174
- package/scripts/toolclass-corpus-replay.mjs +0 -281
- package/scripts/verify-release.mjs +0 -335
- package/tests/TEST_INVENTORY.md +0 -41
- package/tsconfig.base.json +0 -18
- package/tsconfig.json +0 -7
- package/tsconfig.tests.json +0 -15
- package/vitest.built.config.ts +0 -9
- package/vitest.config.ts +0 -46
- /package/{packages/selector/assets → assets}/deepseek-v4/LICENSE.DeepSeek-V4-Pro.txt +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4/manifest.json +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4/tokenizer.json +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4/tokenizer_config.json +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/LICENSE.DeepSeek-V4-Flash-Vision-Exp.txt +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/manifest.json +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/tokenizer.json +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/tokenizer_config.json +0 -0
- /package/{packages/selector/cordis.patch.yml → cordis.patch.yml} +0 -0
- /package/{packages/selector/lib → lib}/index.d.ts +0 -0
- /package/{packages/selector/lib → lib}/invariant.d.ts +0 -0
- /package/{packages/selector/lib → lib}/profiles.d.ts +0 -0
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { resolveConfig, resolvePolicy } from '../../src/pruner.ts'
|
|
3
|
-
|
|
4
|
-
/** task_4 (G2): the read input cap is in CHARACTERS while the fresh trigger is
|
|
5
|
-
* in TOKENS. At the conservative 4.0 chars/token upper bound, a cap at or
|
|
6
|
-
* below `freshTriggerTokens × 4.0` truncates every read result below the
|
|
7
|
-
* trigger and silently silences the fresh path — so `resolvePolicy` must
|
|
8
|
-
* reject that combination at startup. 32k fails (32,000 < 8192×4.0 = 32,768);
|
|
9
|
-
* the deployed 50k cap passes; unset stays untouched. */
|
|
10
|
-
describe('readInputCapChars invariant', () => {
|
|
11
|
-
it('throws when the cap would sit below the fresh trigger (32k vs 8192×4.0)', () => {
|
|
12
|
-
const config = resolveConfig({ readInputCapChars: 32_000 })
|
|
13
|
-
expect(() => resolvePolicy(config, 'balanced')).toThrow(
|
|
14
|
-
'context compression policy: read input cap would silence the fresh path',
|
|
15
|
-
)
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('accepts the deployed 50k cap', () => {
|
|
19
|
-
const config = resolveConfig({ readInputCapChars: 50_000 })
|
|
20
|
-
const policy = resolvePolicy(config, 'balanced')
|
|
21
|
-
expect(policy.readInputCapChars).toBe(50_000)
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it('leaves the policy untouched when the cap is not set', () => {
|
|
25
|
-
const policy = resolvePolicy(resolveConfig({}), 'balanced')
|
|
26
|
-
expect(policy.readInputCapChars).toBeUndefined()
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
it('keeps profiles without a configured cap byte-identical (no field on the resolved object)', () => {
|
|
30
|
-
const policy = resolvePolicy(resolveConfig({}), 'balanced')
|
|
31
|
-
expect(Object.hasOwn(policy, 'readInputCapChars')).toBe(false)
|
|
32
|
-
})
|
|
33
|
-
})
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
|
3
|
-
import { projectSavingsCore, type SavingsTextCounter } from '../../src/runtime/savings-projection.ts'
|
|
4
|
-
|
|
5
|
-
/** 假规范化计数器:直接按字符数出精确口径,便于断言。 */
|
|
6
|
-
const counter: SavingsTextCounter = text => Object.freeze({
|
|
7
|
-
kind: 'exact-tokenizer',
|
|
8
|
-
tokens: text.length,
|
|
9
|
-
tokenizerId: 'test',
|
|
10
|
-
tokenizerRevision: 'r1',
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
function toolResult(seq: number, time: number, text: string, surfaceOp?: unknown): SessionEvent {
|
|
14
|
-
return {
|
|
15
|
-
type: 'tool/result',
|
|
16
|
-
seq,
|
|
17
|
-
time,
|
|
18
|
-
...(surfaceOp === undefined ? {} : { surfaceOp }),
|
|
19
|
-
data: { message: { content: [{ type: 'text', text }] } },
|
|
20
|
-
} as unknown as SessionEvent
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function manifest(seq: number, time: number): SessionEvent {
|
|
24
|
-
return { type: 'compaction/prune', seq, time, data: {} } as unknown as SessionEvent
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const replace0 = { op: 'replace', startSeq: 0, endSeq: 0 }
|
|
28
|
-
|
|
29
|
-
describe('savings projection(会话日志投影重建)', () => {
|
|
30
|
-
it('surface 中的替换计为当前生效毛节省;重读原文计负项', () => {
|
|
31
|
-
const original = 'A'.repeat(400)
|
|
32
|
-
const events = [
|
|
33
|
-
toolResult(0, 1, original),
|
|
34
|
-
manifest(1, 2),
|
|
35
|
-
toolResult(2, 3, 'A'.repeat(100), replace0),
|
|
36
|
-
toolResult(3, 4, original), // 全文重读
|
|
37
|
-
]
|
|
38
|
-
const projection = projectSavingsCore({ events, surfaceNodes: [2], counter })
|
|
39
|
-
expect(projection.savings).toHaveLength(1)
|
|
40
|
-
expect(projection.savings[0]).toMatchObject({ tokens: 300, basis: 'exact-tokenizer', replacementSeq: 2 })
|
|
41
|
-
expect(projection.offsets).toHaveLength(1)
|
|
42
|
-
expect(projection.offsets[0]).toMatchObject({ component: 'full-read', tokens: 400, basis: 'exact-tokenizer' })
|
|
43
|
-
expect(projection.offsets[0]?.note).toContain('#0')
|
|
44
|
-
expect(projection.registry).toHaveLength(1)
|
|
45
|
-
expect(projection.registry[0]).toMatchObject({ claimedTokens: 300, sourceSeq: 0 })
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('替换离开 surface → 毛节省回落为 0(仪表)', () => {
|
|
49
|
-
const events = [
|
|
50
|
-
toolResult(0, 1, 'A'.repeat(400)),
|
|
51
|
-
toolResult(2, 3, 'A'.repeat(100), replace0),
|
|
52
|
-
]
|
|
53
|
-
const still = projectSavingsCore({ events, surfaceNodes: [2], counter })
|
|
54
|
-
expect(still.savings).toHaveLength(1)
|
|
55
|
-
const gone = projectSavingsCore({ events, surfaceNodes: [0], counter })
|
|
56
|
-
expect(gone.savings).toHaveLength(0)
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
it('每次重读都罚(不再一次性消费)', () => {
|
|
60
|
-
const original = 'B'.repeat(500)
|
|
61
|
-
const events = [
|
|
62
|
-
toolResult(0, 1, original),
|
|
63
|
-
toolResult(2, 3, 'B'.repeat(120), replace0),
|
|
64
|
-
toolResult(3, 4, original),
|
|
65
|
-
toolResult(4, 5, original),
|
|
66
|
-
]
|
|
67
|
-
const projection = projectSavingsCore({ events, surfaceNodes: [2], counter })
|
|
68
|
-
expect(projection.offsets).toHaveLength(2)
|
|
69
|
-
expect(projection.offsets.every(entry => entry.tokens === 500)).toBe(true)
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
it('首次压缩之前的重复读取不算惩罚(必须有"第一次的压缩"才配对)', () => {
|
|
73
|
-
const original = 'C'.repeat(300)
|
|
74
|
-
const events = [
|
|
75
|
-
toolResult(0, 1, original),
|
|
76
|
-
toolResult(1, 2, original), // 压缩前重复:registry 还空,不计
|
|
77
|
-
toolResult(2, 3, 'C'.repeat(80), replace0),
|
|
78
|
-
toolResult(3, 4, original), // 压缩后重读:计
|
|
79
|
-
]
|
|
80
|
-
const projection = projectSavingsCore({ events, surfaceNodes: [2], counter })
|
|
81
|
-
expect(projection.offsets).toHaveLength(1)
|
|
82
|
-
expect(projection.registry).toHaveLength(1)
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
it('空事件流返回空投影', () => {
|
|
86
|
-
const projection = projectSavingsCore({ events: [], surfaceNodes: [1, 2], counter })
|
|
87
|
-
expect(projection).toEqual({ savings: [], offsets: [], registry: [] })
|
|
88
|
-
})
|
|
89
|
-
})
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it } from 'vitest'
|
|
2
|
-
import { SavingsLedger, savingsHash } from '../../src/runtime/savings.ts'
|
|
3
|
-
|
|
4
|
-
/** 模拟 pruner land 的真实调用序列:先压缩,后全文重读。 */
|
|
5
|
-
describe('savings ledger(诚实口径)', () => {
|
|
6
|
-
let ledger: SavingsLedger
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
ledger = new SavingsLedger()
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
it('compression saving lands: gross = tokensBefore − tokensAfter, zero-negative ignored', () => {
|
|
12
|
-
ledger.recordSaving({
|
|
13
|
-
sessionId: 's1',
|
|
14
|
-
component: 'fresh',
|
|
15
|
-
tokensBefore: 10_000,
|
|
16
|
-
tokensAfter: 2_000,
|
|
17
|
-
basis: 'exact-tokenizer',
|
|
18
|
-
sourceSeq: 12,
|
|
19
|
-
originalText: 'const a = 1\n'.repeat(500),
|
|
20
|
-
})
|
|
21
|
-
const snap = ledger.snapshot('s1')
|
|
22
|
-
expect(snap.gross.exact).toBe(8_000)
|
|
23
|
-
expect(snap.net.exact).toBe(8_000)
|
|
24
|
-
// 无节省(没压掉任何东西)不入账
|
|
25
|
-
ledger.recordSaving({ sessionId: 's1', component: 'fresh', tokensBefore: 100, tokensAfter: 100, basis: 'exact-tokenizer', sourceSeq: 13 })
|
|
26
|
-
expect(ledger.snapshot('s1').gross.exact).toBe(8_000)
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
it('仪表口径:替换离开 surface 后毛节省回落;仍在 surface 时保持', () => {
|
|
30
|
-
ledger.recordSaving({
|
|
31
|
-
sessionId: 's1',
|
|
32
|
-
component: 'fresh',
|
|
33
|
-
tokensBefore: 9_000,
|
|
34
|
-
tokensAfter: 1_000,
|
|
35
|
-
basis: 'exact-tokenizer',
|
|
36
|
-
sourceSeq: 5,
|
|
37
|
-
replacementSeq: 100,
|
|
38
|
-
})
|
|
39
|
-
expect(ledger.snapshot('s1').gross.exact).toBe(8_000)
|
|
40
|
-
// 替换仍在 surface → 保持
|
|
41
|
-
ledger.observeActive('s1', new Set([100, 101]))
|
|
42
|
-
expect(ledger.snapshot('s1').gross.exact).toBe(8_000)
|
|
43
|
-
// 替换离开 surface → 回落为 0
|
|
44
|
-
ledger.observeActive('s1', new Set([101]))
|
|
45
|
-
expect(ledger.snapshot('s1').gross.exact).toBe(0)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('**先骨架后全文 = 负节省**:全文重读抵消原声称,净额可为负', () => {
|
|
49
|
-
const original = 'export function readFile() {\n // ...long body...\n}\n'.repeat(200)
|
|
50
|
-
ledger.recordSaving({
|
|
51
|
-
sessionId: 's1',
|
|
52
|
-
component: 'fresh',
|
|
53
|
-
tokensBefore: 5_000,
|
|
54
|
-
tokensAfter: 800,
|
|
55
|
-
basis: 'exact-tokenizer',
|
|
56
|
-
sourceSeq: 7,
|
|
57
|
-
originalText: original,
|
|
58
|
-
})
|
|
59
|
-
// 全文重读(同一原文 → 哈希配对):按全文计量记抵消
|
|
60
|
-
ledger.noteFullText({
|
|
61
|
-
sessionId: 's1',
|
|
62
|
-
seq: 40,
|
|
63
|
-
text: original,
|
|
64
|
-
measure: () => ({ tokens: 5_000, basis: 'exact-tokenizer' }),
|
|
65
|
-
})
|
|
66
|
-
const snap = ledger.snapshot('s1')
|
|
67
|
-
expect(snap.gross.exact).toBe(4_200)
|
|
68
|
-
expect(snap.offsets.exact).toBe(5_000)
|
|
69
|
-
expect(snap.net.exact).toBe(-800) // **负节省**
|
|
70
|
-
expect(snap.recentOffsets).toHaveLength(1)
|
|
71
|
-
expect(snap.recentOffsets[0]?.note).toContain('#7')
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
it('同一 (session, seq) 的全文只探测一次;每次重读都记负项(不再一次性消费)', () => {
|
|
75
|
-
const text = 'payload-body\n'.repeat(100)
|
|
76
|
-
ledger.recordSaving({ sessionId: 's1', component: 'history', tokensBefore: 900, tokensAfter: 100, basis: 'characters', sourceSeq: 3, originalText: text })
|
|
77
|
-
const measure = () => ({ tokens: 900, basis: 'characters' as const })
|
|
78
|
-
ledger.noteFullText({ sessionId: 's1', seq: 30, text, measure })
|
|
79
|
-
ledger.noteFullText({ sessionId: 's1', seq: 30, text, measure }) // 同 seq 重放:忽略
|
|
80
|
-
expect(ledger.snapshot('s1').offsets.estimated).toBe(900)
|
|
81
|
-
ledger.noteFullText({ sessionId: 's1', seq: 31, text: text + '\n', measure }) // 新 seq、同哈希:再次记负
|
|
82
|
-
expect(ledger.snapshot('s1').offsets.estimated).toBe(1_800)
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
it('跨会话不串账;retrieve 抵消走估算口径分列', () => {
|
|
86
|
-
const text = 'data\n'.repeat(50)
|
|
87
|
-
ledger.recordSaving({ sessionId: 's1', component: 'fresh', tokensBefore: 1_000, tokensAfter: 100, basis: 'exact-tokenizer', sourceSeq: 1, originalText: text })
|
|
88
|
-
ledger.noteFullText({ sessionId: 's2', seq: 1, text, measure: () => ({ tokens: 1_000, basis: 'exact-tokenizer' }) })
|
|
89
|
-
expect(ledger.snapshot('s1').offsets.exact).toBe(0)
|
|
90
|
-
ledger.recordOffset({ sessionId: 's1', component: 'retrieve', tokens: 300, basis: 'characters' })
|
|
91
|
-
const snap = ledger.snapshot()
|
|
92
|
-
expect(snap.net.exact).toBe(900)
|
|
93
|
-
expect(snap.net.estimated).toBe(-300) // 口径分列:估算抵消不污染精确净额
|
|
94
|
-
expect(snap.sessions).toBe(1)
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
it('savingsHash 规整行尾与首尾空白:同文件两次读取的 innocuous 差异仍配对', () => {
|
|
98
|
-
expect(savingsHash('a\nb\r\nc')).toBe(savingsHash('a\nb\nc'))
|
|
99
|
-
expect(savingsHash(' a\nb ')).toBe(savingsHash('a\nb'))
|
|
100
|
-
expect(savingsHash('a')).not.toBe(savingsHash('b'))
|
|
101
|
-
})
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
describe('savings ledger(usage 聚合与分桶,monitor 口径)', () => {
|
|
105
|
-
let ledger: SavingsLedger
|
|
106
|
-
beforeEach(() => {
|
|
107
|
-
ledger = new SavingsLedger()
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
it('aggregates official usage per session and computes cache hit rate', () => {
|
|
111
|
-
ledger.recordUsage('s1', { inputTokens: 100, outputTokens: 500, cacheReadTokens: 9_000, cacheWriteTokens: 400 })
|
|
112
|
-
ledger.recordUsage('s1', { inputTokens: 200, outputTokens: 300, cacheReadTokens: 8_000, cacheWriteTokens: 500 })
|
|
113
|
-
const snap = ledger.snapshot('s1')
|
|
114
|
-
expect(snap.usage.requests).toBe(2)
|
|
115
|
-
expect(snap.usage.inputTokens).toBe(300)
|
|
116
|
-
expect(snap.usage.cacheReadTokens).toBe(17_000)
|
|
117
|
-
expect(snap.usage.cacheHitRate).toBeCloseTo(17_000 / 18_200, 3)
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
it('buckets sessions by net savings; per-session list only in global snapshot', () => {
|
|
121
|
-
ledger.recordUsage('s1', { inputTokens: 10, outputTokens: 1, cacheReadTokens: 90, cacheWriteTokens: 0 })
|
|
122
|
-
ledger.recordUsage('s2', { inputTokens: 10, outputTokens: 1, cacheReadTokens: 10, cacheWriteTokens: 0 })
|
|
123
|
-
ledger.recordSaving({ sessionId: 's2', component: 'fresh', tokensBefore: 500, tokensAfter: 100, basis: 'exact-tokenizer', sourceSeq: 1 })
|
|
124
|
-
const global = ledger.snapshot()
|
|
125
|
-
expect(global.perSession).toHaveLength(2)
|
|
126
|
-
expect(global.perSession[0]!.sessionId).toBe('s2')
|
|
127
|
-
expect(global.perSession[0]!.cacheHitRate).toBe(0.5)
|
|
128
|
-
const single = ledger.snapshot('s1')
|
|
129
|
-
expect(single.perSession).toHaveLength(0)
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
it('sessionSummaryLine renders one-line account for dispose log', () => {
|
|
133
|
-
ledger.recordUsage('s1', { inputTokens: 100, outputTokens: 10, cacheReadTokens: 900, cacheWriteTokens: 0 })
|
|
134
|
-
ledger.recordSaving({ sessionId: 's1', component: 'fresh', tokensBefore: 400, tokensAfter: 100, basis: 'exact-tokenizer', sourceSeq: 2 })
|
|
135
|
-
const line = ledger.sessionSummaryLine('s1')
|
|
136
|
-
expect(line).toContain('net=300(exact)/0(est)')
|
|
137
|
-
expect(line).toContain('cacheHit=90%')
|
|
138
|
-
})
|
|
139
|
-
})
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { reduceFreshToolResult } from '../../src/runtime/reducers.ts'
|
|
3
|
-
|
|
4
|
-
const SOURCE_REF = 'session://s1/event/7'
|
|
5
|
-
|
|
6
|
-
function searchInput(text: string, budgetChars = 16_000): Parameters<typeof reduceFreshToolResult>[0] {
|
|
7
|
-
return {
|
|
8
|
-
toolName: 'grep_search',
|
|
9
|
-
argumentsText: '{"pattern":"config"}',
|
|
10
|
-
text,
|
|
11
|
-
budgetChars,
|
|
12
|
-
sourceRef: SOURCE_REF,
|
|
13
|
-
isError: false,
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
describe('search L1 locator (R10)', () => {
|
|
18
|
-
it('reports the complete line-number set for a 592-hit file (count == hits)', () => {
|
|
19
|
-
// 实测 upper bound: one real session had a 592-hit file; the old reducer
|
|
20
|
-
// reported only "(592 matches)" and dropped every line number (21.2% of
|
|
21
|
-
// all hits across sessions were silently unlocatable).
|
|
22
|
-
const lines = Array.from({ length: 592 }, (_, i) =>
|
|
23
|
-
`src/deep/module.ts:${String(i + 1)}: export const config${String(i)} = configure(${String(i)})`)
|
|
24
|
-
const output = reduceFreshToolResult(searchInput(lines.join('\n')))
|
|
25
|
-
expect(output).not.toBeNull()
|
|
26
|
-
const locator = output!.text.split('\n').find(line => line.startsWith('## src/deep/module.ts'))
|
|
27
|
-
expect(locator).toBeDefined()
|
|
28
|
-
const numbers = [...locator!.matchAll(/L(\d+)/g)].map(match => Number(match[1]))
|
|
29
|
-
expect(numbers).toHaveLength(592)
|
|
30
|
-
expect(numbers[0]).toBe(1)
|
|
31
|
-
expect(numbers[591]).toBe(592)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('keeps L1 free of content rows (pure locator)', () => {
|
|
35
|
-
const lines = Array.from({ length: 40 }, (_, i) => `a.ts:${String(i + 1)}: content row ${String(i)}`)
|
|
36
|
-
const output = reduceFreshToolResult(searchInput(lines.join('\n'), 700))
|
|
37
|
-
expect(output).not.toBeNull()
|
|
38
|
-
const locatorLine = output!.text.split('\n').find(line => line.startsWith('## a.ts'))
|
|
39
|
-
expect(locatorLine).toBeDefined()
|
|
40
|
-
expect(locatorLine).not.toContain('content row')
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
it('announces withheld locators visibly instead of silently truncating', () => {
|
|
44
|
-
// Budget too small for the full L1 set: the header must state how much
|
|
45
|
-
// was withheld rather than quietly shrinking the list.
|
|
46
|
-
const lines = [
|
|
47
|
-
...Array.from({ length: 300 }, (_, i) => `big.ts:${String(i + 1)}: hit ${String(i)}`),
|
|
48
|
-
...Array.from({ length: 5 }, (_, i) => `small.ts:${String(i + 1)}: hit ${String(i)}`),
|
|
49
|
-
].join('\n')
|
|
50
|
-
const output = reduceFreshToolResult(searchInput(lines, 900))
|
|
51
|
-
expect(output).not.toBeNull()
|
|
52
|
-
expect(output!.text).toMatch(/withheld|more (?:files|matches)/i)
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
describe('search L2 water-filling (R10)', () => {
|
|
57
|
-
it('serves every file one round before any file takes a second row', () => {
|
|
58
|
-
const fat = Array.from({ length: 500 }, (_, i) => `fat.ts:${String(i + 1)}: fat file row ${String(i)}`)
|
|
59
|
-
const mid = Array.from({ length: 10 }, (_, i) => `mid.ts:${String(i + 1)}: mid file row ${String(i)}`)
|
|
60
|
-
const thin = Array.from({ length: 5 }, (_, i) => `thin.ts:${String(i + 1)}: thin file row ${String(i)}`)
|
|
61
|
-
// Tight content quota: only ~15 rows fit after L1. Round-robin must give
|
|
62
|
-
// each file a row per round — the old "fill from index 0" let the first
|
|
63
|
-
// file eat the whole quota.
|
|
64
|
-
const output = reduceFreshToolResult(searchInput([...fat, ...mid, ...thin].join('\n'), 1_600))
|
|
65
|
-
expect(output).not.toBeNull()
|
|
66
|
-
const counts = new Map<string, number>()
|
|
67
|
-
for (const line of output!.text.split('\n')) {
|
|
68
|
-
const match = /^(fat|mid|thin)\.ts:\d+:/.exec(line)
|
|
69
|
-
if (match !== null) counts.set(match[1]!, (counts.get(match[1]!) ?? 0) + 1)
|
|
70
|
-
}
|
|
71
|
-
expect(counts.get('fat')!).toBeGreaterThan(0)
|
|
72
|
-
expect(counts.get('mid')!).toBeGreaterThan(0)
|
|
73
|
-
expect(counts.get('thin')!).toBeGreaterThan(0)
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
it('exhausts small files before the big file takes the remaining quota', () => {
|
|
77
|
-
const fat = Array.from({ length: 500 }, (_, i) => `fat.ts:${String(i + 1)}: fat file row ${String(i)}`)
|
|
78
|
-
const mid = Array.from({ length: 10 }, (_, i) => `mid.ts:${String(i + 1)}: mid file row ${String(i)}`)
|
|
79
|
-
const thin = Array.from({ length: 5 }, (_, i) => `thin.ts:${String(i + 1)}: thin file row ${String(i)}`)
|
|
80
|
-
// Generous quota after L1: mid and thin end up FULLY covered (100% of
|
|
81
|
-
// their rows) while fat takes only what is left.
|
|
82
|
-
const output = reduceFreshToolResult(searchInput([...fat, ...mid, ...thin].join('\n'), 6_000))
|
|
83
|
-
const counts = new Map<string, number>()
|
|
84
|
-
for (const line of output!.text.split('\n')) {
|
|
85
|
-
const match = /^(fat|mid|thin)\.ts:\d+:/.exec(line)
|
|
86
|
-
if (match !== null) counts.set(match[1]!, (counts.get(match[1]!) ?? 0) + 1)
|
|
87
|
-
}
|
|
88
|
-
expect(counts.get('thin')).toBe(5)
|
|
89
|
-
expect(counts.get('mid')).toBe(10)
|
|
90
|
-
expect(counts.get('fat')!).toBeGreaterThan(0)
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
it('keeps error rows available to the quota', () => {
|
|
94
|
-
const rows = Array.from({ length: 40 }, (_, i) => `app.ts:${String(i + 1)}: ordinary row ${String(i)}`)
|
|
95
|
-
rows.push('app.ts:99: FATAL: unhandled rejection in loader')
|
|
96
|
-
// Tight quota: round 0 must reach the important row (offered first within
|
|
97
|
-
// the file) even though 40 ordinary rows outrank it by line number.
|
|
98
|
-
const output = reduceFreshToolResult(searchInput(rows.join('\n'), 900))
|
|
99
|
-
expect(output).not.toBeNull()
|
|
100
|
-
expect(output!.text).toContain('FATAL: unhandled rejection in loader')
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
it('falls back to salience when no path:line form exists', () => {
|
|
104
|
-
const output = reduceFreshToolResult(searchInput([
|
|
105
|
-
...Array.from({ length: 60 }, (_, i) => `ordinary output line ${String(i)} without any locators at all`),
|
|
106
|
-
'FATAL: something exploded without a path prefix',
|
|
107
|
-
].join('\n'), 1_200))
|
|
108
|
-
expect(output?.reducer).toBe('search-salience')
|
|
109
|
-
})
|
|
110
|
-
})
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest'
|
|
2
|
-
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
|
|
3
|
-
import { sessionEvents } from '../../src/runtime/session-events.ts'
|
|
4
|
-
|
|
5
|
-
const EVENTS = Object.freeze([
|
|
6
|
-
Object.freeze({ seq: 0, time: 1, type: 'turn/start', data: { turn: 1 } }),
|
|
7
|
-
]) as unknown as readonly SessionEvent[]
|
|
8
|
-
|
|
9
|
-
describe('sessionEvents', () => {
|
|
10
|
-
it('retains the rc.2 events accessor fallback', () => {
|
|
11
|
-
const session = { events: EVENTS } as unknown as Session
|
|
12
|
-
expect(sessionEvents(session)).toBe(EVENTS)
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
it('prefers the Alpha 5 public snapshotEvents API and preserves its receiver', () => {
|
|
16
|
-
const modern = {
|
|
17
|
-
marker: EVENTS,
|
|
18
|
-
events: undefined,
|
|
19
|
-
snapshotEvents(this: { marker: readonly SessionEvent[] }) {
|
|
20
|
-
return this.marker
|
|
21
|
-
},
|
|
22
|
-
}
|
|
23
|
-
const snapshot = vi.spyOn(modern, 'snapshotEvents')
|
|
24
|
-
expect(sessionEvents(modern as unknown as Session)).toBe(EVENTS)
|
|
25
|
-
expect(snapshot).toHaveBeenCalledOnce()
|
|
26
|
-
})
|
|
27
|
-
})
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { unwrapSettingsEntry } from '../../src/pruner.ts'
|
|
3
|
-
import { parseContextCompressionSettings } from '../../src/runtime/config.ts'
|
|
4
|
-
|
|
5
|
-
// The desktop 0.2.0 host hands back the whole entry config `{ settings: <subtree> }`;
|
|
6
|
-
// the parser only understands the subtree. Regression guard for the fail-open-to-off
|
|
7
|
-
// bug that silently disabled fresh/aggregate on the desktop (0 compression).
|
|
8
|
-
const SUBTREE = {
|
|
9
|
-
profile: 'tokenpilot-inspired',
|
|
10
|
-
custom: {
|
|
11
|
-
version: 3,
|
|
12
|
-
unit: 'tokens',
|
|
13
|
-
fresh: { enabled: true, trigger: 8192, target: 3072 },
|
|
14
|
-
aggregate: { enabled: true, trigger: 32768, target: 12288 },
|
|
15
|
-
history: { enabled: true, trigger: 500000, keepRecentToolCalls: 10, keepRecentTokens: 64000, minReclaim: 96000 },
|
|
16
|
-
prefixPolicy: 'pressure-break',
|
|
17
|
-
tailTrim: { enabled: false, trigger: 700000 },
|
|
18
|
-
},
|
|
19
|
-
autoCompact: { thresholdPercent: 80 },
|
|
20
|
-
codeSkeleton: { enabled: true },
|
|
21
|
-
intentSummary: { enabled: true },
|
|
22
|
-
monitorPanel: { enabled: true },
|
|
23
|
-
presetOptions: { estimatorMode: 'host', estimatorProvider: 'local-35', estimatorModel: 'Qwen3.6-35B-A3B' },
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
describe('unwrapSettingsEntry (0.2.0 host config wrapper)', () => {
|
|
27
|
-
it('descends a single {settings:<obj>} wrapper when the root has no profile', () => {
|
|
28
|
-
expect(unwrapSettingsEntry({ settings: SUBTREE })).toBe(SUBTREE)
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
it('leaves a bare subtree (root already has profile) untouched', () => {
|
|
32
|
-
expect(unwrapSettingsEntry(SUBTREE)).toBe(SUBTREE)
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
it('leaves non-object and array values untouched', () => {
|
|
36
|
-
expect(unwrapSettingsEntry(undefined)).toBe(undefined)
|
|
37
|
-
expect(unwrapSettingsEntry(null)).toBe(null)
|
|
38
|
-
expect(unwrapSettingsEntry('x')).toBe('x')
|
|
39
|
-
const arr = [1, 2]
|
|
40
|
-
expect(unwrapSettingsEntry(arr)).toBe(arr)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
it('does NOT descend when `settings` is not an object (keeps exotic rejection intact)', () => {
|
|
44
|
-
const exotic = { settings: 'not-an-object' }
|
|
45
|
-
expect(unwrapSettingsEntry(exotic)).toBe(exotic)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('round-trips the wrapped desktop value where the bare parse would throw', () => {
|
|
49
|
-
// The exact desktop failure: wrapped shape → parse throws "missing its
|
|
50
|
-
// complete shape" → activeSettings fails open to profile:'off'. After the
|
|
51
|
-
// one-level unwrap the same value parses to tokenpilot-inspired (fresh on).
|
|
52
|
-
const wrapped = { settings: SUBTREE }
|
|
53
|
-
expect(() => parseContextCompressionSettings(wrapped)).toThrow(/complete shape|plain/)
|
|
54
|
-
const parsed = parseContextCompressionSettings(unwrapSettingsEntry(wrapped) as never)
|
|
55
|
-
expect(parsed.profile).toBe('tokenpilot-inspired')
|
|
56
|
-
expect(parsed.presetOptions?.estimatorMode).toBe('host')
|
|
57
|
-
})
|
|
58
|
-
})
|