peaks-loop 4.2.3 → 4.2.4
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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +47 -0
- package/dist/cli/commands/code-context-now-command.js +8 -3
- package/dist/cli/commands/code-context-now-envelope.d.ts +27 -2
- package/dist/cli/commands/code-context-now-envelope.js +47 -2
- package/dist/cli/commands/compact-harness-window-command.js +19 -111
- package/dist/cli/commands/compact-harness-window-opt-out.d.ts +4 -0
- package/dist/cli/commands/compact-harness-window-opt-out.js +76 -0
- package/dist/cli/commands/compact-harness-window-percent.d.ts +39 -0
- package/dist/cli/commands/compact-harness-window-percent.js +78 -0
- package/dist/cli/commands/compact-harness-window-reports.d.ts +8 -0
- package/dist/cli/commands/compact-harness-window-reports.js +149 -0
- package/dist/cli/commands/workspace/init-actions.d.ts +2 -0
- package/dist/cli/commands/workspace/init-actions.js +15 -1
- package/dist/cli/commands/workspace/init-command.js +1 -1
- package/dist/cli/commands/workspace/init-envelope.d.ts +2 -1
- package/dist/cli/commands/workspace/init-envelope.js +18 -1
- package/dist/cli/commands/workspace/init-harness-threshold.d.ts +30 -0
- package/dist/cli/commands/workspace/init-harness-threshold.js +134 -0
- package/dist/services/context/auto-compact-reader.d.ts +6 -5
- package/dist/services/context/auto-compact-reader.js +24 -27
- package/dist/services/context/harness-compact-threshold-config.d.ts +178 -0
- package/dist/services/context/harness-compact-threshold-config.js +166 -0
- package/dist/services/context/harness-compact-threshold-ensure.d.ts +90 -0
- package/dist/services/context/harness-compact-threshold-ensure.js +158 -0
- package/dist/services/context/harness-compact-threshold-refusal.d.ts +39 -0
- package/dist/services/context/harness-compact-threshold-refusal.js +122 -0
- package/dist/services/context/harness-compact-threshold-reset-types.d.ts +59 -0
- package/dist/services/context/harness-compact-threshold-reset-types.js +9 -0
- package/dist/services/context/harness-compact-threshold-reset.d.ts +48 -0
- package/dist/services/context/harness-compact-threshold-reset.js +215 -0
- package/dist/services/context/harness-compact-threshold-verdict.d.ts +71 -0
- package/dist/services/context/harness-compact-threshold-verdict.js +124 -0
- package/dist/services/context/harness-percent-gates.d.ts +35 -0
- package/dist/services/context/harness-percent-gates.js +102 -0
- package/dist/services/context/harness-percent-ownership.d.ts +126 -0
- package/dist/services/context/harness-percent-ownership.js +200 -0
- package/dist/services/context/harness-settings-file.d.ts +70 -0
- package/dist/services/context/harness-settings-file.js +83 -0
- package/dist/services/context/harness-window-config.d.ts +53 -141
- package/dist/services/context/harness-window-config.js +58 -296
- package/dist/services/context/harness-window-opt-out.d.ts +67 -0
- package/dist/services/context/harness-window-opt-out.js +241 -0
- package/dist/services/context/harness-window-ownership.d.ts +49 -0
- package/dist/services/context/harness-window-ownership.js +130 -0
- package/dist/services/ide/adapters/claude-code-adapter.d.ts +9 -9
- package/dist/services/ide/adapters/claude-code-adapter.js +5 -5
- package/dist/services/ide/ide-compact-types.d.ts +23 -4
- package/dist/services/ide/shared/safe-path.d.ts +18 -0
- package/dist/services/ide/shared/safe-path.js +34 -1
- package/package.json +6 -6
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"metadata": {
|
|
3
3
|
"pluginRoot": ".",
|
|
4
|
-
"version": "4.2.
|
|
4
|
+
"version": "4.2.4"
|
|
5
5
|
},
|
|
6
6
|
"plugins": [
|
|
7
7
|
{
|
|
8
8
|
"name": "peaks-loop",
|
|
9
9
|
"description": "Loop Engineering CLI — workflow primitive / loop guards / evaluators / slice orchestration",
|
|
10
|
-
"version": "4.2.
|
|
10
|
+
"version": "4.2.4",
|
|
11
11
|
"author": {
|
|
12
12
|
"name": "SquabbyZ"
|
|
13
13
|
},
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.2.4 — 2026-11-22(下游项目装完即用早期自动压缩,配置只落项目级)
|
|
4
|
+
|
|
5
|
+
**版本级别**:**minor**(新增能力:项目级压缩阈值配置 + `harnessThreshold` 如实上报;无 schema 变更,无门禁阈值放宽)。
|
|
6
|
+
|
|
7
|
+
**一句话:装完 peaks-loop 的项目,`.claude/settings.local.json` 里会自动带上 250K 窗口 + 80% 触发点(阈值 200,000 token),而不是等默认的 1M 窗口涨到 ~967K 才压。**
|
|
8
|
+
|
|
9
|
+
### 1. 问题不是「阈值定太晚」,是「配置根本不在项目里」
|
|
10
|
+
|
|
11
|
+
Claude Code 的自动压缩阈值公式(2.1.314 二进制反汇编确认):
|
|
12
|
+
|
|
13
|
+
- 设了 `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`:`阈值 = 窗口 × PCT%`
|
|
14
|
+
- 否则:`窗口 − 13,000`(窗口 ≥ 200K)或 `窗口 − 20,000`(窗口 < 200K)
|
|
15
|
+
|
|
16
|
+
1M 窗口下默认压到 `1M − 13K ≈ 987K`,也就是 98.7%。**而这个值只在进程启动时读一次**,所以运行中的会话改配置不生效。
|
|
17
|
+
|
|
18
|
+
早前把原因误判为「harness 阈值固定 96.5%」——那只是 1M 窗口的结果,不是机制。本轮用一次真实压缩推翻它:100K 窗口下 `preTokens 133,536 → postTokens 11,283`,会话继续跑完。
|
|
19
|
+
|
|
20
|
+
### 2. 做了什么
|
|
21
|
+
|
|
22
|
+
- **adapter 声明百分比键**:`autoCompactPercentEnvVar`,claude-code 指向 `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`。
|
|
23
|
+
- **`peaks workspace init` 同时写两把键**到项目自己的 `.claude/settings.local.json`(窗口 250,000 / 百分比 80),各带来源标记;`--no-claude-hooks` 下完全不写。**全局 `~/.claude/settings.json` 全程不碰。**
|
|
24
|
+
- **所有权规则**:没有标记、或标记/值的写法是 peaks-loop 根本写不出来的(`1e6`、`080`、`eighty`),一律视为用户自己的值,永不删除;peaks 自己写坏的值仍可清理。
|
|
25
|
+
- **`peaks code context-now` 新增 `harnessThreshold{configured, inForce, matches}`**,文件与会话不一致时提示需要重开会话——不再假装新配置已经生效。
|
|
26
|
+
- **`--reset` 只撤销 peaks 写的内容**,并留下 opt-out 标记。
|
|
27
|
+
- **安全**:所有写入路径拒绝符号链接的**文件**和符号链接的 `.claude` **目录**(后者是上一轮遗漏的一层);服务层返回值不再携带设置文件里的原始字符串,误放在阈值键里的密钥不会进日志。
|
|
28
|
+
|
|
29
|
+
### 3. 质量数据
|
|
30
|
+
|
|
31
|
+
| 项 | 结果 |
|
|
32
|
+
|---|---|
|
|
33
|
+
| 单元测试 | 705 文件 / 7617 通过 / 4 跳过 |
|
|
34
|
+
| `tsc --noEmit` | 0 |
|
|
35
|
+
| `peaks-gate repo` | 0,所有 ceiling 保持或下降 |
|
|
36
|
+
| 变异(6 个核心模块) | **90.38%**,无模块低于 80%,弱断言 0.5% |
|
|
37
|
+
| 安全审计 | 0 CRITICAL / 0 HIGH |
|
|
38
|
+
|
|
39
|
+
### 4. 已知遗留(本版不修,已在交付说明中逐条记录)
|
|
40
|
+
|
|
41
|
+
1. 设置文件的读-改-写没有锁/CAS,"检查链接"与"写入"之间仍可被换链。
|
|
42
|
+
2. `context-now` 会把环境变量来源的窗口值写进项目文件并标记为 peaks 所有(既有路径)。
|
|
43
|
+
3. adapter 声明的 `claude --compact` 命令不存在,dispatch 装完 hook 就返回。
|
|
44
|
+
4. 旧版"仅窗口回滚"路径仍无条件删除;今天不可达,若将来有 adapter 只声明窗口键才会变活。
|
|
45
|
+
|
|
46
|
+
### 5. 发版后请验收这一项
|
|
47
|
+
|
|
48
|
+
下游项目跑 `peaks workspace init`,开会话输入 `/autocompact`:显示 **~200K** 表示配置生效;显示 **~987K** 表示项目级配置未被采纳。**250K + 80% 这组具体数值没有在真实 200K 会话里观察到触发**,证据是公式、上述 100K 窗口的真实压缩、以及真实进程读到了项目里的两把键。
|
|
49
|
+
|
|
3
50
|
## 4.2.3 — 2026-11-19(变异基线从 19.1% 提到 80.5%,首次过阈值)
|
|
4
51
|
|
|
5
52
|
**版本级别**:**patch**(只加测试,无源码行为变化;无门禁阈值放宽,无 schema 变更)。
|
|
@@ -4,7 +4,7 @@ import { readJobShapeDecision, JobShapeDecisionError } from '../../services/code
|
|
|
4
4
|
import { resolveOuterSessionId } from '../../services/session/binding-status-service.js';
|
|
5
5
|
import { resolveCanonicalProjectRoot } from '../../services/config/config-service.js';
|
|
6
6
|
import { readActiveSid } from './code-runtime-session.js';
|
|
7
|
-
import { buildContextNowData, buildContextNowNextActions, buildContextNowWarnings, readContextNowHarness, resolveContextNowDecision } from './code-context-now-envelope.js';
|
|
7
|
+
import { buildContextNowData, buildContextNowNextActions, buildContextNowWarnings, readContextNowHarness, readContextNowThreshold, resolveContextNowDecision } from './code-context-now-envelope.js';
|
|
8
8
|
const CONTEXT_NOW_DESCRIPTION = "v2.13.0 AC-1: read the active IDE adapter's context-fill % " +
|
|
9
9
|
'without requiring the LLM to pass --prompt-size <bytes> manually. ' +
|
|
10
10
|
'Adapter-driven (no hard-coded IDE names): Claude Code is the MVP ' +
|
|
@@ -89,14 +89,19 @@ async function runCodeContextNow(opts, io) {
|
|
|
89
89
|
const canonicalProjectRoot = resolveCanonicalProjectRoot(opts.project);
|
|
90
90
|
const harness = readContextNowHarness(canonicalProjectRoot, sessionId, outerSessionId, probe);
|
|
91
91
|
const decision = resolveContextNowDecision(canonicalProjectRoot, probe.ratio, flags.isJobMode);
|
|
92
|
+
// The threshold verdict re-reads the same file the sync above may just have
|
|
93
|
+
// written, so `configured` is what is on disk AFTER this probe — which is
|
|
94
|
+
// exactly what the next session will read.
|
|
95
|
+
const threshold = readContextNowThreshold(canonicalProjectRoot);
|
|
92
96
|
printResult(io, ok('code.context-now', buildContextNowData({
|
|
93
97
|
probe,
|
|
94
98
|
ratioPct: (probe.ratio * 100).toFixed(1),
|
|
95
99
|
isJobMode: flags.isJobMode,
|
|
96
100
|
promptSizeBytes: flags.promptSizeBytes,
|
|
97
101
|
decision,
|
|
98
|
-
harness
|
|
99
|
-
|
|
102
|
+
harness,
|
|
103
|
+
threshold
|
|
104
|
+
}), buildContextNowWarnings(harness), buildContextNowNextActions(decision, harness, threshold)),
|
|
100
105
|
// `true`, which made the declared `--json` flag a no-op and left the
|
|
101
106
|
// human with raw JSON and no `next:` lines — so a person running this
|
|
102
107
|
// command could not see that peaks-loop had just written their
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import type { ContextPercentProbe } from '../../services/context/auto-compact-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The HARNESS side of the threshold: what the project file configures vs what
|
|
4
|
+
* this running session is actually using.
|
|
5
|
+
*
|
|
6
|
+
* It reports, it never changes anything: the harness reads its env once at
|
|
7
|
+
* process start (measured 2026-11-20), so a mid-session write cannot move the
|
|
8
|
+
* trigger and a claim that it did would be the pretending this field removes.
|
|
9
|
+
* `restartNotice` is the actionable half — the `nextActions` line naming the
|
|
10
|
+
* restart — and the verdict itself is the machine-readable one, so a JSON
|
|
11
|
+
* consumer sees a threshold that is not in force without parsing prose.
|
|
12
|
+
*
|
|
13
|
+
* `harnessThreshold` is `null` when the active adapter declares no percent
|
|
14
|
+
* knob: the field is omitted rather than reported as a false `matches: true`
|
|
15
|
+
* for a mechanism this IDE does not have.
|
|
16
|
+
*/
|
|
17
|
+
export declare function readContextNowThreshold(canonicalProjectRoot: string): {
|
|
18
|
+
harnessThreshold: null;
|
|
19
|
+
restartNotice: null;
|
|
20
|
+
} | {
|
|
21
|
+
harnessThreshold: import("../../services/context/harness-compact-threshold-verdict.js").HarnessThresholdVerdict;
|
|
22
|
+
restartNotice: string | null;
|
|
23
|
+
};
|
|
24
|
+
type ContextNowThreshold = ReturnType<typeof readContextNowThreshold>;
|
|
2
25
|
/**
|
|
3
26
|
* The harness half of the probe: the window sync, its warning, the witness read
|
|
4
27
|
* and its notice. Lifted verbatim from the action body — it reads only its
|
|
@@ -40,7 +63,10 @@ export declare function buildContextNowData(args: {
|
|
|
40
63
|
promptSizeBytes: number | undefined;
|
|
41
64
|
decision: ContextNowDecision;
|
|
42
65
|
harness: ContextNowHarness;
|
|
66
|
+
threshold: ContextNowThreshold;
|
|
43
67
|
}): {
|
|
68
|
+
harnessWitness: import("../../services/context/harness-context-witness.js").HarnessWitnessComparison;
|
|
69
|
+
harnessThreshold?: import("../../services/context/harness-compact-threshold-verdict.js").HarnessThresholdVerdict;
|
|
44
70
|
ratio: number;
|
|
45
71
|
ratioPct: string;
|
|
46
72
|
verdict: string;
|
|
@@ -57,10 +83,9 @@ export declare function buildContextNowData(args: {
|
|
|
57
83
|
bytesPrompt: number | null;
|
|
58
84
|
capturedAt: string;
|
|
59
85
|
harnessWindow: import("../../services/context/harness-window-config.js").HarnessWindowSyncResult | null;
|
|
60
|
-
harnessWitness: import("../../services/context/harness-context-witness.js").HarnessWitnessComparison;
|
|
61
86
|
};
|
|
62
87
|
/** The envelope's `warnings` array, lifted verbatim out of the action body. */
|
|
63
88
|
export declare function buildContextNowWarnings(harness: ContextNowHarness): string[];
|
|
64
89
|
/** The envelope's `nextActions` array, lifted verbatim out of the action body. */
|
|
65
|
-
export declare function buildContextNowNextActions(decision: ContextNowDecision, harness: ContextNowHarness): string[];
|
|
90
|
+
export declare function buildContextNowNextActions(decision: ContextNowDecision, harness: ContextNowHarness, threshold: ContextNowThreshold): string[];
|
|
66
91
|
export {};
|
|
@@ -6,8 +6,38 @@
|
|
|
6
6
|
import { resolveAutoCompactProfile } from '../../services/mode/mode-status-service.js';
|
|
7
7
|
import { syncHarnessWindowForProject } from '../../services/context/auto-compact-reader.js';
|
|
8
8
|
import { describeHarnessWindowSync, harnessWindowSyncWarning } from '../../services/context/harness-window-config.js';
|
|
9
|
+
import { resolveHarnessCompactThresholdLocation } from '../../services/context/harness-compact-threshold-config.js';
|
|
10
|
+
import { buildHarnessThresholdVerdict, describeHarnessThresholdRestart, readHarnessCompactThreshold } from '../../services/context/harness-compact-threshold-verdict.js';
|
|
9
11
|
import { describeHarnessWitness, readAndCompareHarnessWitness } from '../../services/context/harness-context-witness.js';
|
|
10
12
|
import { contextNowActionFor, contextNowBandLabels } from './code-context-now-mapping.js';
|
|
13
|
+
/**
|
|
14
|
+
* The HARNESS side of the threshold: what the project file configures vs what
|
|
15
|
+
* this running session is actually using.
|
|
16
|
+
*
|
|
17
|
+
* It reports, it never changes anything: the harness reads its env once at
|
|
18
|
+
* process start (measured 2026-11-20), so a mid-session write cannot move the
|
|
19
|
+
* trigger and a claim that it did would be the pretending this field removes.
|
|
20
|
+
* `restartNotice` is the actionable half — the `nextActions` line naming the
|
|
21
|
+
* restart — and the verdict itself is the machine-readable one, so a JSON
|
|
22
|
+
* consumer sees a threshold that is not in force without parsing prose.
|
|
23
|
+
*
|
|
24
|
+
* `harnessThreshold` is `null` when the active adapter declares no percent
|
|
25
|
+
* knob: the field is omitted rather than reported as a false `matches: true`
|
|
26
|
+
* for a mechanism this IDE does not have.
|
|
27
|
+
*/
|
|
28
|
+
export function readContextNowThreshold(canonicalProjectRoot) {
|
|
29
|
+
const location = resolveHarnessCompactThresholdLocation({
|
|
30
|
+
projectRoot: canonicalProjectRoot,
|
|
31
|
+
env: process.env
|
|
32
|
+
});
|
|
33
|
+
if (location === null)
|
|
34
|
+
return { harnessThreshold: null, restartNotice: null };
|
|
35
|
+
const read = readHarnessCompactThreshold({ location, env: process.env });
|
|
36
|
+
return {
|
|
37
|
+
harnessThreshold: buildHarnessThresholdVerdict(read),
|
|
38
|
+
restartNotice: describeHarnessThresholdRestart(read)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
11
41
|
/**
|
|
12
42
|
* The harness half of the probe: the window sync, its warning, the witness read
|
|
13
43
|
* and its notice. Lifted verbatim from the action body — it reads only its
|
|
@@ -95,7 +125,18 @@ export function buildContextNowData(args) {
|
|
|
95
125
|
// window sync did on this probe. Reported rather than silent — the
|
|
96
126
|
// harness tells a user who overrides the window only via
|
|
97
127
|
// `/autocompact`, so peaks-loop must be the one that says it.
|
|
128
|
+
//
|
|
129
|
+
// The sync result AS IS: it holds a BOUNDED note where the file's value
|
|
130
|
+
// would be (MED-2, bounded at its source), so a secret mis-parked under the
|
|
131
|
+
// window key cannot reach this field's `--json` output or the logs.
|
|
98
132
|
harnessWindow: harness.harnessWindow,
|
|
133
|
+
// The threshold the PROJECT configures vs the one this SESSION is using —
|
|
134
|
+
// reported, never assumed. `null` (field omitted) when the adapter has no
|
|
135
|
+
// percent knob; a `matches: false` here is the honest answer to "I changed
|
|
136
|
+
// the settings, why is it still compacting late?".
|
|
137
|
+
...(args.threshold.harnessThreshold !== null
|
|
138
|
+
? { harnessThreshold: args.threshold.harnessThreshold }
|
|
139
|
+
: {}),
|
|
99
140
|
harnessWitness: harness.harnessWitness
|
|
100
141
|
};
|
|
101
142
|
}
|
|
@@ -110,7 +151,7 @@ export function buildContextNowWarnings(harness) {
|
|
|
110
151
|
];
|
|
111
152
|
}
|
|
112
153
|
/** The envelope's `nextActions` array, lifted verbatim out of the action body. */
|
|
113
|
-
export function buildContextNowNextActions(decision, harness) {
|
|
154
|
+
export function buildContextNowNextActions(decision, harness, threshold) {
|
|
114
155
|
const { action, next, bands, gateModeNotice } = decision;
|
|
115
156
|
return [
|
|
116
157
|
action === 'red-line'
|
|
@@ -131,6 +172,10 @@ export function buildContextNowNextActions(decision, harness) {
|
|
|
131
172
|
// the same split, and note this one never asks a question.
|
|
132
173
|
...(harness.witnessNotice === null
|
|
133
174
|
? []
|
|
134
|
-
: ['Re-probe with `peaks code context-now` to confirm; this is reported, not blocking.'])
|
|
175
|
+
: ['Re-probe with `peaks code context-now` to confirm; this is reported, not blocking.']),
|
|
176
|
+
// The restart line rides LAST and only when the file and this session
|
|
177
|
+
// actually differ: it is the one statement that turns "the settings are
|
|
178
|
+
// right" into "and they are not in force yet", which nothing else says.
|
|
179
|
+
...(threshold.restartNotice === null ? [] : [threshold.restartNotice])
|
|
135
180
|
];
|
|
136
181
|
}
|
|
@@ -1,120 +1,31 @@
|
|
|
1
1
|
import { resolveCanonicalProjectRoot } from '../../services/config/config-service.js';
|
|
2
2
|
import { findProjectRoot } from '../../services/config/config-safety.js';
|
|
3
|
-
import { fail,
|
|
3
|
+
import { fail, getErrorMessage } from 'peaks-loop-shared/result';
|
|
4
4
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const HARNESS_WINDOW_DESCRIPTION = 'Report / roll back the auto-compact window peaks-loop writes into the ' +
|
|
5
|
+
import { reportDisableHarnessWindow, reportHarnessWindowState, reportReenableHarnessWindow, reportResetHarnessWindow, reportUnmanagedHarnessWindow, resolveCommandLocation } from './compact-harness-window-reports.js';
|
|
6
|
+
const HARNESS_WINDOW_DESCRIPTION = 'Report / roll back the auto-compact pair peaks-loop writes into the ' +
|
|
8
7
|
"harness's own machine-local settings (the adapter-declared " +
|
|
9
|
-
'autoCompactWindowEnvVar, e.g.
|
|
8
|
+
'autoCompactWindowEnvVar and autoCompactPercentEnvVar, e.g. ' +
|
|
9
|
+
'CLAUDE_CODE_AUTO_COMPACT_WINDOW and CLAUDE_AUTOCOMPACT_PCT_OVERRIDE in ' +
|
|
10
10
|
'.claude/settings.local.json). peaks-loop computes its context ratio ' +
|
|
11
|
-
'against exactly this
|
|
11
|
+
'against exactly this window, so the value it reports as "85%" and the ' +
|
|
12
12
|
'point the harness compacts at are the same. Context probes ' +
|
|
13
13
|
'(`peaks code context-now`, `peaks code auto-compact`) materialize it ' +
|
|
14
14
|
'automatically. Two different intentions, two verbs: --reset removes ' +
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
15
|
+
'BOTH keys peaks-loop wrote (the window and the percent, with their ' +
|
|
16
|
+
'provenance markers) AND opts the project out so later probes do not put ' +
|
|
17
|
+
'them back — a percent left behind would move the trigger EARLIER, which ' +
|
|
18
|
+
'is the opposite of a rollback; a percent you set by hand is kept. When ' +
|
|
19
|
+
'the file holds no peaks-loop row at all there is nothing to roll back, ' +
|
|
20
|
+
'so --reset writes nothing. --disable records the opt-out only, leaving ' +
|
|
21
|
+
'whatever values are already there untouched, so "stop managing these ' +
|
|
22
|
+
'keys" works on a project peaks-loop has never written to; --reenable ' +
|
|
23
|
+
'undoes either opt-out (and is the way back from BOTH keys).';
|
|
21
24
|
function resolveHarnessWindowProject(options) {
|
|
22
25
|
return options.project !== undefined
|
|
23
26
|
? resolveCanonicalProjectRoot(options.project)
|
|
24
27
|
: (findProjectRoot(process.cwd()) ?? process.cwd());
|
|
25
28
|
}
|
|
26
|
-
function reportUnmanagedHarnessWindow(io, project, json) {
|
|
27
|
-
printResult(io, ok('compact.harness-window', {
|
|
28
|
-
projectRoot: project,
|
|
29
|
-
managed: false,
|
|
30
|
-
message: 'The active IDE adapter declares no auto-compact window key, so peaks-loop cannot tie ' +
|
|
31
|
-
'the harness window to its own ratio. Nothing was written and there is nothing to roll back.'
|
|
32
|
-
}), json);
|
|
33
|
-
}
|
|
34
|
-
function buildResetWindowActions(result, location) {
|
|
35
|
-
return [
|
|
36
|
-
result.action === 'removed'
|
|
37
|
-
? `Removed ${location.envVar} from ${result.settingsPath} and opted this project out, so later probes stop writing it. Undo with \`peaks compact harness-window --reenable\`.`
|
|
38
|
-
: `Nothing to remove — ${location.envVar} was already absent from ${result.settingsPath}, so nothing was written and no opt-out row was recorded: if a probe writes a window here later, run --reset again to remove it. To say "never manage this key here" WITHOUT waiting for that first write, run \`peaks compact harness-window --disable\`.`
|
|
39
|
-
];
|
|
40
|
-
}
|
|
41
|
-
function reportResetHarnessWindow(io, project, location, json) {
|
|
42
|
-
const result = resetHarnessWindow({ location, env: process.env });
|
|
43
|
-
printResult(io, ok('compact.harness-window', {
|
|
44
|
-
projectRoot: project,
|
|
45
|
-
action: result.action,
|
|
46
|
-
key: location.envVar,
|
|
47
|
-
settingsPath: result.settingsPath,
|
|
48
|
-
previousTokens: result.previousTokens
|
|
49
|
-
}, [], buildResetWindowActions(result, location)), json);
|
|
50
|
-
}
|
|
51
|
-
function buildDisableWindowActions(result, location) {
|
|
52
|
-
return [
|
|
53
|
-
result.action === 'disabled'
|
|
54
|
-
? `Recorded the opt-out in ${result.settingsPath}: peaks-loop will not write ${location.envVar} here, and left any value already in the file exactly as it was. Undo with \`peaks compact harness-window --reenable\`.`
|
|
55
|
-
: result.action === 'already-opted-out'
|
|
56
|
-
? `Already opted out — ${result.settingsPath} carries ${location.envVar}'s opt-out, so nothing was written. Undo with \`peaks compact harness-window --reenable\`.`
|
|
57
|
-
: result.action === 'refused-unsafe-project-root'
|
|
58
|
-
? `Nothing written: the resolved project root is the user's own home directory, so ${result.settingsPath} is their PERSONAL harness settings, not a project's. peaks-loop already refuses to write ${location.envVar} there, so an opt-out would change nothing except which refusal you see. Point --project at a project (a subdirectory of home is fine) and the opt-out lands there.`
|
|
59
|
-
: `Nothing written — ${result.settingsPath} is not a JSON object peaks-loop can safely edit, so the opt-out could not be recorded there.`
|
|
60
|
-
];
|
|
61
|
-
}
|
|
62
|
-
function reportDisableHarnessWindow(io, project, location, json) {
|
|
63
|
-
const result = disableHarnessWindowSync({ location });
|
|
64
|
-
printResult(io, ok('compact.harness-window', {
|
|
65
|
-
projectRoot: project,
|
|
66
|
-
action: result.action,
|
|
67
|
-
key: location.envVar,
|
|
68
|
-
settingsPath: result.settingsPath
|
|
69
|
-
}, [], buildDisableWindowActions(result, location)), json);
|
|
70
|
-
}
|
|
71
|
-
function buildReenableWindowActions(result) {
|
|
72
|
-
return [
|
|
73
|
-
result.action === 'reenabled'
|
|
74
|
-
? 'Opt-out cleared; the next context probe will materialize the window again.'
|
|
75
|
-
: 'No opt-out was recorded for this project.'
|
|
76
|
-
];
|
|
77
|
-
}
|
|
78
|
-
function reportReenableHarnessWindow(io, project, location, json) {
|
|
79
|
-
const result = reenableHarnessWindowSync({ location });
|
|
80
|
-
printResult(io, ok('compact.harness-window', {
|
|
81
|
-
projectRoot: project,
|
|
82
|
-
action: result.action,
|
|
83
|
-
key: location.envVar,
|
|
84
|
-
settingsPath: result.settingsPath
|
|
85
|
-
}, [], buildReenableWindowActions(result)), json);
|
|
86
|
-
}
|
|
87
|
-
function buildHarnessWindowStateActions(state) {
|
|
88
|
-
return [
|
|
89
|
-
state?.tokens === null || state?.tokens === undefined
|
|
90
|
-
? 'No window is set yet. The next `peaks code context-now` probe materializes the window it computes its ratio against.'
|
|
91
|
-
: `peaks-loop computes its context ratio against ${state.tokens} tokens; the harness fires near the end of that window. ${state.peakWritten
|
|
92
|
-
? 'peaks-loop wrote this value; it may raise it if a session outgrows it.'
|
|
93
|
-
: "This value is not peaks-loop's own write, so peaks-loop will not raise it — it is treated as your setting."}`,
|
|
94
|
-
'Rollback: `peaks compact harness-window --reset`.',
|
|
95
|
-
'Intent-vs-observed calibration: `peaks compact history --json` → windowCalibration.'
|
|
96
|
-
];
|
|
97
|
-
}
|
|
98
|
-
function buildHarnessWindowStateData(project, location, state) {
|
|
99
|
-
return {
|
|
100
|
-
projectRoot: project,
|
|
101
|
-
managed: true,
|
|
102
|
-
key: location.envVar,
|
|
103
|
-
settingsPath: location.settingsPath,
|
|
104
|
-
tokens: state?.tokens ?? null,
|
|
105
|
-
raw: state?.raw ?? null,
|
|
106
|
-
source: state?.source ?? null,
|
|
107
|
-
optedOut: state?.optedOut ?? false,
|
|
108
|
-
// Provenance: whether this value is peaks-loop's own write or
|
|
109
|
-
// one the user set by hand. It decides whether the late 1M
|
|
110
|
-
// rescue may override it, so it is not just diagnostics.
|
|
111
|
-
peakWritten: state?.peakWritten ?? false
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
function reportHarnessWindowState(io, project, location, json) {
|
|
115
|
-
const state = readHarnessWindowState({ projectRoot: project, env: process.env });
|
|
116
|
-
printResult(io, ok('compact.harness-window', buildHarnessWindowStateData(project, location, state), [], buildHarnessWindowStateActions(state)), json);
|
|
117
|
-
}
|
|
118
29
|
function reportHarnessWindowFailure(io, error, json) {
|
|
119
30
|
printResult(io, fail('compact.harness-window', 'COMPACT_HARNESS_WINDOW_FAILED', getErrorMessage(error), {}, [
|
|
120
31
|
'Verify the project path is writable and a session is bound'
|
|
@@ -124,10 +35,7 @@ function reportHarnessWindowFailure(io, error, json) {
|
|
|
124
35
|
function runCompactHarnessWindow(options, io) {
|
|
125
36
|
try {
|
|
126
37
|
const project = resolveHarnessWindowProject(options);
|
|
127
|
-
const location =
|
|
128
|
-
projectRoot: project,
|
|
129
|
-
env: process.env
|
|
130
|
-
});
|
|
38
|
+
const location = resolveCommandLocation(project);
|
|
131
39
|
if (location === null) {
|
|
132
40
|
reportUnmanagedHarnessWindow(io, project, options.json);
|
|
133
41
|
return;
|
|
@@ -167,8 +75,8 @@ export function registerCompactHarnessWindowCommand(compact, io) {
|
|
|
167
75
|
.command('harness-window')
|
|
168
76
|
.description(HARNESS_WINDOW_DESCRIPTION)
|
|
169
77
|
.option('--project <path>', 'project root (defaults to git root or cwd)')
|
|
170
|
-
.option('--reset', 'rollback: remove
|
|
171
|
-
.option('--disable', 'record the opt-out only (do not manage
|
|
172
|
-
.option('--reenable', 'undo a --reset or --disable opt-out (peaks-loop manages
|
|
78
|
+
.option('--reset', 'rollback: remove BOTH keys peaks-loop wrote (window + percent) and stop managing them')
|
|
79
|
+
.option('--disable', 'record the opt-out only (do not manage these keys), without removing values already there; expressible before the first write')
|
|
80
|
+
.option('--reenable', 'undo a --reset or --disable opt-out (peaks-loop manages the window and the percent again)')
|
|
173
81
|
.action((options) => runCompactHarnessWindow(options, io)));
|
|
174
82
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ProgramIO } from '../cli-helpers.js';
|
|
2
|
+
import { type HarnessWindowLocation } from '../../services/context/harness-window-config.js';
|
|
3
|
+
export declare function reportDisableHarnessWindow(io: ProgramIO, project: string, location: HarnessWindowLocation, json?: boolean): void;
|
|
4
|
+
export declare function reportReenableHarnessWindow(io: ProgramIO, project: string, location: HarnessWindowLocation, json?: boolean): void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// The `--disable` / `--reenable` halves of `peaks compact harness-window`, split
|
|
2
|
+
// out of `compact-harness-window-reports.ts` when that file crossed the 300-raw-
|
|
3
|
+
// line cap. Every body below is the original one, moved; the two verbs are the
|
|
4
|
+
// pair that EDIT the opt-out row, so they belong together.
|
|
5
|
+
import { ok } from 'peaks-loop-shared/result';
|
|
6
|
+
import { printResult } from '../cli-helpers.js';
|
|
7
|
+
import { disableHarnessWindowSync, reenableHarnessWindowSync } from '../../services/context/harness-window-config.js';
|
|
8
|
+
import { describeReenabledPercent, readPercentReport } from './compact-harness-window-percent.js';
|
|
9
|
+
/**
|
|
10
|
+
* One sentence per `--disable` outcome.
|
|
11
|
+
*
|
|
12
|
+
* A REFUSAL IS NAMED AS ONE. `symlinked-settings` has its own clause because the
|
|
13
|
+
* file may parse perfectly — the problem is where the write would LAND — and
|
|
14
|
+
* `unreadable-settings` is deliberately the fall-through rather than a token.
|
|
15
|
+
*/
|
|
16
|
+
function buildDisableWindowActions(result, location) {
|
|
17
|
+
return [
|
|
18
|
+
result.action === 'disabled'
|
|
19
|
+
? `Recorded the opt-out in ${result.settingsPath}: peaks-loop will not write ${location.envVar} here, and left any value already in the file exactly as it was. Undo with \`peaks compact harness-window --reenable\`.`
|
|
20
|
+
: result.action === 'already-opted-out'
|
|
21
|
+
? `Already opted out — ${result.settingsPath} carries ${location.envVar}'s opt-out, so nothing was written. Undo with \`peaks compact harness-window --reenable\`.`
|
|
22
|
+
: result.action === 'refused-unsafe-project-root'
|
|
23
|
+
? `Nothing written: the resolved project root is the user's own home directory, so ${result.settingsPath} is their PERSONAL harness settings, not a project's. peaks-loop already refuses to write ${location.envVar} there, so an opt-out would change nothing except which refusal you see. Point --project at a project (a subdirectory of home is fine) and the opt-out lands there.`
|
|
24
|
+
: result.action === 'symlinked-settings'
|
|
25
|
+
? `Nothing written — ${result.settingsPath} is a symlink (or a Windows junction), or the directory holding it is, so recording the opt-out would follow the link and overwrite the file it points at. Replace the link with a real file (or directory) and the opt-out lands here.`
|
|
26
|
+
: `Nothing written — ${result.settingsPath} is not a JSON object peaks-loop can safely edit, so the opt-out could not be recorded there.`
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
export function reportDisableHarnessWindow(io, project, location, json) {
|
|
30
|
+
const result = disableHarnessWindowSync({ location });
|
|
31
|
+
printResult(io, ok('compact.harness-window', {
|
|
32
|
+
projectRoot: project,
|
|
33
|
+
action: result.action,
|
|
34
|
+
key: location.envVar,
|
|
35
|
+
settingsPath: result.settingsPath
|
|
36
|
+
}, [], buildDisableWindowActions(result, location)), json);
|
|
37
|
+
}
|
|
38
|
+
function buildReenableWindowActions(result, location, percent) {
|
|
39
|
+
// N4 — SAY WHAT HAPPENS TO EACH KNOB (the percent clause has its own reason
|
|
40
|
+
// in `describeReenabledPercent`). `--reenable` only clears the opt-out; it
|
|
41
|
+
// removes nothing and writes no values, so after a `--reset` the next probe
|
|
42
|
+
// fills the window only.
|
|
43
|
+
//
|
|
44
|
+
// A REFUSAL (home root, a linked file) is NAMED rather than folded into
|
|
45
|
+
// "No opt-out was recorded": nothing was cleared, and saying otherwise would
|
|
46
|
+
// report a refusal as a no-op.
|
|
47
|
+
const percentOutcome = describeReenabledPercent(percent);
|
|
48
|
+
if (result.action === 'refused-unsafe-project-root') {
|
|
49
|
+
return [
|
|
50
|
+
`Nothing written: the resolved project root is the user's own home directory, so ${result.settingsPath} is their PERSONAL harness settings, not a project's. Point --project at a project (a subdirectory of home is fine) and --reenable lands there.${percentOutcome}`
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
if (result.action === 'symlinked-settings') {
|
|
54
|
+
return [
|
|
55
|
+
`Nothing written — ${result.settingsPath} is a symlink (or a Windows junction), or the directory holding it is, so clearing the opt-out would follow the link and overwrite the file it points at. Replace the link with a real file (or directory) and --reenable lands here.${percentOutcome}`
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
return [
|
|
59
|
+
result.action === 'reenabled'
|
|
60
|
+
? `Opt-out cleared; the next context probe will materialize the window ${location.envVar} again.${percentOutcome}`
|
|
61
|
+
: `No opt-out was recorded for this project.${percentOutcome}`
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
export function reportReenableHarnessWindow(io, project, location, json) {
|
|
65
|
+
const percent = readPercentReport(project);
|
|
66
|
+
const result = reenableHarnessWindowSync({ location });
|
|
67
|
+
printResult(io, ok('compact.harness-window', {
|
|
68
|
+
projectRoot: project,
|
|
69
|
+
action: result.action,
|
|
70
|
+
key: location.envVar,
|
|
71
|
+
settingsPath: result.settingsPath,
|
|
72
|
+
// The percent half is reported too, so the envelope answers "what is
|
|
73
|
+
// managed now" for BOTH keys rather than the window alone.
|
|
74
|
+
percent
|
|
75
|
+
}, [], buildReenableWindowActions(result, location, percent)), json);
|
|
76
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type HarnessPercentState } from '../../services/context/harness-compact-threshold-config.js';
|
|
2
|
+
/** The percent half as an envelope reports it, or null when unmanaged here. */
|
|
3
|
+
export interface HarnessPercentReport {
|
|
4
|
+
readonly key: string;
|
|
5
|
+
readonly percent: number | null;
|
|
6
|
+
/**
|
|
7
|
+
* A BOUNDED description of an unparseable file value (see `boundedRawNote`) —
|
|
8
|
+
* never the raw string. MED-2: this report is printed as JSON and its
|
|
9
|
+
* sentences reach logs, and the value under this key is user-writable, so a
|
|
10
|
+
* secret mis-parked there must not travel. `null` when the slot is empty.
|
|
11
|
+
*/
|
|
12
|
+
readonly rawNote: string | null;
|
|
13
|
+
readonly ownership: HarnessPercentState['ownership'];
|
|
14
|
+
/** The file the value was read from — the same one the window half names. */
|
|
15
|
+
readonly settingsPath: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Read the percent half for a project, or null when the active adapter declares
|
|
19
|
+
* no percent knob (an IDE with no such setting; peaks does not manage it there
|
|
20
|
+
* and says so rather than inventing a key).
|
|
21
|
+
*/
|
|
22
|
+
export declare function readPercentReport(project: string): HarnessPercentReport | null;
|
|
23
|
+
/**
|
|
24
|
+
* The percent half in words — ONE clause, so a report says what the percent key
|
|
25
|
+
* is and who owns it even when the answer is "peaks does not manage it here".
|
|
26
|
+
*/
|
|
27
|
+
export declare function describePercentHalf(percent: HarnessPercentReport | null): string;
|
|
28
|
+
/**
|
|
29
|
+
* What `--reenable` did to the percent — the companion clause of its window
|
|
30
|
+
* sentence.
|
|
31
|
+
*
|
|
32
|
+
* `--reenable` only clears the opt-out: it removes nothing and writes no
|
|
33
|
+
* values. After a `--reset` the file therefore holds no window AND no percent,
|
|
34
|
+
* and the next probe fills the window only. Left unsaid (the measured N4
|
|
35
|
+
* defect), a percent the user expected back stays absent with nothing on screen
|
|
36
|
+
* explaining it — and a later init then reports `not-peaks-owned` about a value
|
|
37
|
+
* that is not even there.
|
|
38
|
+
*/
|
|
39
|
+
export declare function describeReenabledPercent(percent: HarnessPercentReport | null): string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// The PERCENT half of `peaks compact harness-window`'s reporting — split out of
|
|
2
|
+
// `compact-harness-window-reports.ts` so that file stays under the file-size cap
|
|
3
|
+
// once every report has to show both knobs of the pair.
|
|
4
|
+
//
|
|
5
|
+
// The rule this module exists to keep: the command manages TWO keys, so every
|
|
6
|
+
// report and every sentence must be honest about both. A window-only report
|
|
7
|
+
// could not distinguish a rolled-back project from a fresh one, and a
|
|
8
|
+
// `--reenable` that said nothing about the percent left its later absence
|
|
9
|
+
// unexplained.
|
|
10
|
+
import { readHarnessPercentState, resolveHarnessCompactThresholdLocation } from '../../services/context/harness-compact-threshold-config.js';
|
|
11
|
+
/**
|
|
12
|
+
* Read the percent half for a project, or null when the active adapter declares
|
|
13
|
+
* no percent knob (an IDE with no such setting; peaks does not manage it there
|
|
14
|
+
* and says so rather than inventing a key).
|
|
15
|
+
*/
|
|
16
|
+
export function readPercentReport(project) {
|
|
17
|
+
const threshold = resolveHarnessCompactThresholdLocation({
|
|
18
|
+
projectRoot: project,
|
|
19
|
+
env: process.env
|
|
20
|
+
});
|
|
21
|
+
if (threshold === null)
|
|
22
|
+
return null;
|
|
23
|
+
const state = readHarnessPercentState(threshold.settingsPath, threshold.percentEnvVar);
|
|
24
|
+
return {
|
|
25
|
+
key: state.key,
|
|
26
|
+
percent: state.percent,
|
|
27
|
+
// The service layer bounds the value at its source (MED-2); carry the note.
|
|
28
|
+
rawNote: state.rawNote ?? null,
|
|
29
|
+
ownership: state.ownership,
|
|
30
|
+
settingsPath: threshold.settingsPath
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The percent half in words — ONE clause, so a report says what the percent key
|
|
35
|
+
* is and who owns it even when the answer is "peaks does not manage it here".
|
|
36
|
+
*/
|
|
37
|
+
export function describePercentHalf(percent) {
|
|
38
|
+
if (percent === null) {
|
|
39
|
+
return 'peaks does not manage the percent here: the active IDE adapter declares no auto-compact percent key.';
|
|
40
|
+
}
|
|
41
|
+
switch (percent.ownership) {
|
|
42
|
+
case 'peaks':
|
|
43
|
+
return `The percent ${percent.key}=${String(percent.percent)} is peaks-loop's own write; it may update it.`;
|
|
44
|
+
case 'peaks-corrupt':
|
|
45
|
+
return `The percent ${percent.key} holds ${percent.rawNote ?? 'an unreadable value'}, which is not a percentage — a corruption of peaks-loop's own write. \`peaks compact harness-window --reset\` clears it.`;
|
|
46
|
+
case 'human':
|
|
47
|
+
return percent.percent !== null
|
|
48
|
+
? `The percent ${percent.key}=${String(percent.percent)} is not peaks-loop's own write, so peaks-loop will not overwrite it.`
|
|
49
|
+
: `The percent ${percent.key} holds ${percent.rawNote ?? 'an unreadable value'} and is not peaks-loop's own write, so peaks-loop will not overwrite it.`;
|
|
50
|
+
case 'stale-marker':
|
|
51
|
+
return `The percent ${percent.key} is unset but a provenance marker survives; \`peaks compact harness-window --reset\` cleans it up.`;
|
|
52
|
+
default:
|
|
53
|
+
return `The percent ${percent.key} is not set.`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* What `--reenable` did to the percent — the companion clause of its window
|
|
58
|
+
* sentence.
|
|
59
|
+
*
|
|
60
|
+
* `--reenable` only clears the opt-out: it removes nothing and writes no
|
|
61
|
+
* values. After a `--reset` the file therefore holds no window AND no percent,
|
|
62
|
+
* and the next probe fills the window only. Left unsaid (the measured N4
|
|
63
|
+
* defect), a percent the user expected back stays absent with nothing on screen
|
|
64
|
+
* explaining it — and a later init then reports `not-peaks-owned` about a value
|
|
65
|
+
* that is not even there.
|
|
66
|
+
*/
|
|
67
|
+
export function describeReenabledPercent(percent) {
|
|
68
|
+
if (percent === null) {
|
|
69
|
+
return ' The active IDE adapter declares no auto-compact percent key, so peaks-loop does not manage a percent here.';
|
|
70
|
+
}
|
|
71
|
+
if (percent.ownership === 'none') {
|
|
72
|
+
return ` The percent key ${percent.key} is not set, and peaks-loop does not restore a value it removed: the next \`peaks code context-now\` probe writes the window, and the percent stays unset unless a later init or probe has a measured value to write.`;
|
|
73
|
+
}
|
|
74
|
+
if (percent.ownership === 'peaks') {
|
|
75
|
+
return ` The percent key ${percent.key}=${String(percent.percent)} is peaks-loop's own write and stands; a later probe may update it.`;
|
|
76
|
+
}
|
|
77
|
+
return ` The percent key ${percent.key} holds ${percent.rawNote ?? 'an unreadable value'}, which peaks-loop does not manage; it is left exactly as it is.`;
|
|
78
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ProgramIO } from '../cli-helpers.js';
|
|
2
|
+
import { type HarnessWindowLocation } from '../../services/context/harness-window-config.js';
|
|
3
|
+
export { reportDisableHarnessWindow, reportReenableHarnessWindow } from './compact-harness-window-opt-out.js';
|
|
4
|
+
export declare function reportUnmanagedHarnessWindow(io: ProgramIO, project: string, json?: boolean): void;
|
|
5
|
+
export declare function reportResetHarnessWindow(io: ProgramIO, project: string, location: HarnessWindowLocation, json?: boolean): void;
|
|
6
|
+
export declare function reportHarnessWindowState(io: ProgramIO, project: string, location: HarnessWindowLocation, json?: boolean): void;
|
|
7
|
+
/** The one place the command's location is resolved, so the reports share it. */
|
|
8
|
+
export declare function resolveCommandLocation(project: string): HarnessWindowLocation | null;
|