pi-rtk-optimizer 0.3.3 → 0.5.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 +102 -67
- package/README.md +292 -290
- package/config/config.example.json +36 -35
- package/package.json +4 -4
- package/src/additional-coverage-test.ts +278 -0
- package/src/boolean-format.ts +3 -0
- package/src/command-rewriter-test.ts +160 -120
- package/src/command-rewriter.ts +594 -585
- package/src/config-modal-test.ts +168 -0
- package/src/config-modal.ts +613 -600
- package/src/config-store.ts +224 -217
- package/src/index-test.ts +54 -0
- package/src/index.ts +410 -289
- package/src/output-compactor-test.ts +500 -158
- package/src/output-compactor.ts +432 -349
- package/src/record-utils.ts +6 -0
- package/src/rewrite-bypass.ts +332 -173
- package/src/rewrite-pipeline-safety.ts +154 -0
- package/src/rewrite-rules.ts +255 -255
- package/src/rtk-command-environment.ts +64 -0
- package/src/runtime-guard-test.ts +42 -50
- package/src/runtime-guard.ts +14 -14
- package/src/techniques/build.ts +155 -155
- package/src/techniques/emoji.ts +91 -0
- package/src/techniques/git.ts +231 -229
- package/src/techniques/index.ts +10 -16
- package/src/techniques/linter.ts +151 -161
- package/src/techniques/path-utils.ts +67 -0
- package/src/techniques/rtk.ts +136 -0
- package/src/techniques/search.ts +67 -76
- package/src/techniques/source.ts +253 -253
- package/src/techniques/test-output.ts +172 -172
- package/src/test-helpers.ts +10 -0
- package/src/tool-execution-sanitizer.ts +69 -0
- package/src/types-shims.d.ts +192 -183
- package/src/types.ts +103 -114
- package/src/zellij-modal.ts +1001 -1001
- package/src/compat-commands.ts +0 -207
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"enabled": true,
|
|
3
|
-
"mode": "rewrite",
|
|
4
|
-
"guardWhenRtkMissing": true,
|
|
5
|
-
"showRewriteNotifications": true,
|
|
6
|
-
"rewriteGitGithub": true,
|
|
7
|
-
"rewriteFilesystem": true,
|
|
8
|
-
"rewriteRust": true,
|
|
9
|
-
"rewriteJavaScript": true,
|
|
10
|
-
"rewritePython": true,
|
|
11
|
-
"rewriteGo": true,
|
|
12
|
-
"rewriteContainers": true,
|
|
13
|
-
"rewriteNetwork": true,
|
|
14
|
-
"rewritePackageManagers": true,
|
|
15
|
-
"outputCompaction": {
|
|
16
|
-
"enabled": true,
|
|
17
|
-
"stripAnsi": true,
|
|
18
|
-
"sourceCodeFilteringEnabled": true,
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"enabled": true,
|
|
3
|
+
"mode": "rewrite",
|
|
4
|
+
"guardWhenRtkMissing": true,
|
|
5
|
+
"showRewriteNotifications": true,
|
|
6
|
+
"rewriteGitGithub": true,
|
|
7
|
+
"rewriteFilesystem": true,
|
|
8
|
+
"rewriteRust": true,
|
|
9
|
+
"rewriteJavaScript": true,
|
|
10
|
+
"rewritePython": true,
|
|
11
|
+
"rewriteGo": true,
|
|
12
|
+
"rewriteContainers": true,
|
|
13
|
+
"rewriteNetwork": true,
|
|
14
|
+
"rewritePackageManagers": true,
|
|
15
|
+
"outputCompaction": {
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"stripAnsi": true,
|
|
18
|
+
"sourceCodeFilteringEnabled": true,
|
|
19
|
+
"preserveExactSkillReads": false,
|
|
20
|
+
"truncate": {
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"maxChars": 12000
|
|
23
|
+
},
|
|
24
|
+
"sourceCodeFiltering": "minimal",
|
|
25
|
+
"smartTruncate": {
|
|
26
|
+
"enabled": true,
|
|
27
|
+
"maxLines": 220
|
|
28
|
+
},
|
|
29
|
+
"aggregateTestOutput": true,
|
|
30
|
+
"filterBuildOutput": true,
|
|
31
|
+
"compactGitOutput": true,
|
|
32
|
+
"aggregateLinterOutput": true,
|
|
33
|
+
"groupSearchOutput": true,
|
|
34
|
+
"trackSavings": true
|
|
35
|
+
}
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-rtk-optimizer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Pi extension that optimizes RTK command rewriting and tool output compaction for the coding agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"build": "npx --yes -p typescript@5.7.3 tsc -p tsconfig.json --noCheck",
|
|
20
20
|
"lint": "npm run build",
|
|
21
21
|
"typecheck": "npx --yes -p typescript@5.7.3 tsc -p tsconfig.json",
|
|
22
|
-
"test": "bun ./src/output-compactor-test.ts && bun ./src/command-rewriter-test.ts && bun ./src/runtime-guard-test.ts",
|
|
22
|
+
"test": "bun ./src/output-compactor-test.ts && bun ./src/command-rewriter-test.ts && bun ./src/runtime-guard-test.ts && bun ./src/additional-coverage-test.ts && bun ./src/config-modal-test.ts && bun ./src/index-test.ts",
|
|
23
23
|
"check": "npm run lint && npm run typecheck && npm run test",
|
|
24
24
|
"build:check": "bunx esbuild ./index.ts --bundle --platform=node --format=esm --outfile=./.pi-rtk-optimizer-check.mjs --external:@mariozechner/pi-coding-agent --external:@mariozechner/pi-tui && bun -e \"import { unlinkSync } from 'node:fs'; unlinkSync('./.pi-rtk-optimizer-check.mjs');\""
|
|
25
25
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@mariozechner/pi-coding-agent": "
|
|
58
|
-
"@mariozechner/pi-tui": "
|
|
57
|
+
"@mariozechner/pi-coding-agent": "^0.62.0",
|
|
58
|
+
"@mariozechner/pi-tui": "^0.62.0"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
ensureConfigExists,
|
|
6
|
+
getRtkIntegrationConfigPath,
|
|
7
|
+
loadRtkIntegrationConfig,
|
|
8
|
+
normalizeRtkIntegrationConfig,
|
|
9
|
+
saveRtkIntegrationConfig,
|
|
10
|
+
} from "./config-store.ts";
|
|
11
|
+
import { clearOutputMetrics, getOutputMetricsSummary, trackOutputSavings } from "./output-metrics.ts";
|
|
12
|
+
import { runTest } from "./test-helpers.ts";
|
|
13
|
+
import { matchesCommandPatterns, normalizeCommandForDetection } from "./techniques/command-detection.ts";
|
|
14
|
+
import { compactPath } from "./techniques/path-utils.ts";
|
|
15
|
+
import { applyWindowsBashCompatibilityFixes } from "./windows-command-helpers.ts";
|
|
16
|
+
import { applyRewrittenCommandShellSafetyFixups } from "./rewrite-pipeline-safety.ts";
|
|
17
|
+
import { sanitizeStreamingBashExecutionResult } from "./tool-execution-sanitizer.ts";
|
|
18
|
+
import { sanitizeRtkEmojiOutput } from "./techniques/emoji.ts";
|
|
19
|
+
import { stripRtkHookWarnings } from "./techniques/rtk.ts";
|
|
20
|
+
|
|
21
|
+
function makeTempConfigPath(): string {
|
|
22
|
+
return `${getRtkIntegrationConfigPath()}.test-${Date.now()}-${Math.random().toString(16).slice(2)}.json`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function cleanupFile(path: string): void {
|
|
26
|
+
for (const candidate of [path, `${path}.tmp`]) {
|
|
27
|
+
try {
|
|
28
|
+
if (existsSync(candidate)) {
|
|
29
|
+
unlinkSync(candidate);
|
|
30
|
+
}
|
|
31
|
+
} catch {
|
|
32
|
+
// Ignore cleanup failures in tests.
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
runTest("config-store normalizes invalid values and clamps numeric ranges", () => {
|
|
38
|
+
const normalized = normalizeRtkIntegrationConfig({
|
|
39
|
+
enabled: "yes",
|
|
40
|
+
mode: "invalid",
|
|
41
|
+
rewriteGitGithub: false,
|
|
42
|
+
outputCompaction: {
|
|
43
|
+
stripAnsi: false,
|
|
44
|
+
sourceCodeFilteringEnabled: "sometimes",
|
|
45
|
+
sourceCodeFiltering: "extreme",
|
|
46
|
+
truncate: {
|
|
47
|
+
enabled: true,
|
|
48
|
+
maxChars: 12,
|
|
49
|
+
},
|
|
50
|
+
smartTruncate: {
|
|
51
|
+
enabled: true,
|
|
52
|
+
maxLines: 999_999,
|
|
53
|
+
},
|
|
54
|
+
trackSavings: false,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
assert.equal(normalized.enabled, true);
|
|
59
|
+
assert.equal(normalized.mode, "rewrite");
|
|
60
|
+
assert.equal(normalized.rewriteGitGithub, false);
|
|
61
|
+
assert.equal(normalized.outputCompaction.stripAnsi, false);
|
|
62
|
+
assert.equal(normalized.outputCompaction.sourceCodeFilteringEnabled, true);
|
|
63
|
+
assert.equal(normalized.outputCompaction.sourceCodeFiltering, "minimal");
|
|
64
|
+
assert.equal(normalized.outputCompaction.truncate.maxChars, 1_000);
|
|
65
|
+
assert.equal(normalized.outputCompaction.smartTruncate.maxLines, 4_000);
|
|
66
|
+
assert.equal(normalized.outputCompaction.trackSavings, false);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
runTest("config-store can ensure, save, and reload isolated config files", () => {
|
|
70
|
+
const tempPath = makeTempConfigPath();
|
|
71
|
+
cleanupFile(tempPath);
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
const ensured = ensureConfigExists(tempPath);
|
|
75
|
+
assert.equal(ensured.created, true);
|
|
76
|
+
assert.equal(existsSync(tempPath), true);
|
|
77
|
+
|
|
78
|
+
const defaultLoad = loadRtkIntegrationConfig(tempPath);
|
|
79
|
+
assert.equal(defaultLoad.warning, undefined);
|
|
80
|
+
assert.equal(defaultLoad.config.mode, "rewrite");
|
|
81
|
+
|
|
82
|
+
const saved = saveRtkIntegrationConfig(
|
|
83
|
+
{
|
|
84
|
+
...defaultLoad.config,
|
|
85
|
+
mode: "suggest",
|
|
86
|
+
outputCompaction: {
|
|
87
|
+
...defaultLoad.config.outputCompaction,
|
|
88
|
+
truncate: {
|
|
89
|
+
...defaultLoad.config.outputCompaction.truncate,
|
|
90
|
+
maxChars: 250_000,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
tempPath,
|
|
95
|
+
);
|
|
96
|
+
assert.equal(saved.success, true);
|
|
97
|
+
|
|
98
|
+
const reloaded = loadRtkIntegrationConfig(tempPath);
|
|
99
|
+
assert.equal(reloaded.config.mode, "suggest");
|
|
100
|
+
assert.equal(reloaded.config.outputCompaction.truncate.maxChars, 200_000);
|
|
101
|
+
assert.ok(readFileSync(tempPath, "utf-8").endsWith("\n"));
|
|
102
|
+
} finally {
|
|
103
|
+
cleanupFile(tempPath);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
runTest("config-store falls back to defaults when JSON is invalid", () => {
|
|
108
|
+
const tempPath = makeTempConfigPath();
|
|
109
|
+
cleanupFile(tempPath);
|
|
110
|
+
|
|
111
|
+
try {
|
|
112
|
+
writeFileSync(tempPath, "{not valid json", "utf-8");
|
|
113
|
+
const loaded = loadRtkIntegrationConfig(tempPath);
|
|
114
|
+
assert.equal(loaded.config.mode, "rewrite");
|
|
115
|
+
assert.ok((loaded.warning ?? "").includes(tempPath));
|
|
116
|
+
assert.ok((loaded.warning ?? "").includes("Failed to parse"));
|
|
117
|
+
} finally {
|
|
118
|
+
cleanupFile(tempPath);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
runTest("output metrics summarize tracked savings and clear state", () => {
|
|
123
|
+
clearOutputMetrics();
|
|
124
|
+
assert.equal(getOutputMetricsSummary(), "RTK output compaction metrics: no data yet.");
|
|
125
|
+
|
|
126
|
+
const first = trackOutputSavings("1234567890", "12345", "bash", ["ansi", "truncate"]);
|
|
127
|
+
assert.equal(first.tool, "bash");
|
|
128
|
+
assert.equal(first.techniques, "ansi,truncate");
|
|
129
|
+
assert.equal(first.savingsPercent, 50);
|
|
130
|
+
|
|
131
|
+
trackOutputSavings("123456", "1234", "read", []);
|
|
132
|
+
const summary = getOutputMetricsSummary();
|
|
133
|
+
assert.ok(summary.includes("calls=2, saved=7 chars (43.8%)"));
|
|
134
|
+
assert.ok(summary.includes("- bash: 1 calls, saved 5 chars (50.0%)"));
|
|
135
|
+
assert.ok(summary.includes("- read: 1 calls, saved 2 chars (33.3%)"));
|
|
136
|
+
|
|
137
|
+
clearOutputMetrics();
|
|
138
|
+
assert.equal(getOutputMetricsSummary(), "RTK output compaction metrics: no data yet.");
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
runTest("command detection ignores env prefixes, blank lines, and chained suffixes", () => {
|
|
142
|
+
assert.equal(normalizeCommandForDetection("NODE_ENV=test FOO=bar npm test && echo done"), "npm test");
|
|
143
|
+
assert.equal(normalizeCommandForDetection("\n\n PYTHONPATH=src git status\n echo later"), "git status");
|
|
144
|
+
assert.equal(normalizeCommandForDetection(" "), null);
|
|
145
|
+
assert.equal(matchesCommandPatterns("CI=1 bun test | head -5", [/^bun test/]), true);
|
|
146
|
+
assert.equal(matchesCommandPatterns("echo hello", [/^bun test/]), false);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
runTest("path compaction preserves the tail and handles Windows separators", () => {
|
|
150
|
+
const unixPath = "/Users/example/projects/pi-rtk-optimizer/src/techniques/path-utils.ts";
|
|
151
|
+
const compactUnixPath = compactPath(unixPath, 28);
|
|
152
|
+
assert.ok(compactUnixPath.length <= 28);
|
|
153
|
+
assert.ok(compactUnixPath.endsWith("path-utils.ts"));
|
|
154
|
+
assert.ok(compactUnixPath.includes("/"));
|
|
155
|
+
|
|
156
|
+
const windowsPath = "C:\\Users\\Administrator\\Documents\\pi-rtk-optimizer\\src\\windows-command-helpers.ts";
|
|
157
|
+
const compactWindowsPath = compactPath(windowsPath, 30);
|
|
158
|
+
assert.ok(compactWindowsPath.length <= 30);
|
|
159
|
+
assert.equal(compactWindowsPath.includes("\\"), true);
|
|
160
|
+
assert.ok(compactWindowsPath.endsWith("windows-command-helpers.ts"));
|
|
161
|
+
|
|
162
|
+
assert.equal(compactPath("src/file.ts", 40), "src/file.ts");
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
runTest("windows bash compatibility rewrites only when the runtime is Windows", () => {
|
|
166
|
+
const command = "cd /d C:\\Users\\Administrator\\project && python script.py";
|
|
167
|
+
const fixed = applyWindowsBashCompatibilityFixes(command);
|
|
168
|
+
|
|
169
|
+
if (process.platform === "win32") {
|
|
170
|
+
assert.deepEqual(fixed.applied, ["cd-/d", "python-utf8"]);
|
|
171
|
+
assert.equal(
|
|
172
|
+
fixed.command,
|
|
173
|
+
'PYTHONIOENCODING=utf-8 cd "C:/Users/Administrator/project" && python script.py',
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
const alreadyUtf8 = applyWindowsBashCompatibilityFixes("PYTHONIOENCODING=utf-8 python script.py");
|
|
177
|
+
assert.deepEqual(alreadyUtf8.applied, []);
|
|
178
|
+
assert.equal(alreadyUtf8.command, "PYTHONIOENCODING=utf-8 python script.py");
|
|
179
|
+
} else {
|
|
180
|
+
assert.deepEqual(fixed.applied, []);
|
|
181
|
+
assert.equal(fixed.command, command);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
runTest("rewrite pipeline safety buffers rewritten Windows producer commands", () => {
|
|
186
|
+
const rewritten = applyRewrittenCommandShellSafetyFixups("rtk git diff | grep TODO");
|
|
187
|
+
|
|
188
|
+
if (process.platform === "win32") {
|
|
189
|
+
assert.ok(rewritten.includes('mktemp'));
|
|
190
|
+
assert.ok(rewritten.includes('trap'));
|
|
191
|
+
assert.ok(rewritten.includes('rtk git diff > "$__pi_rtk_pipe_tmp"'));
|
|
192
|
+
assert.ok(rewritten.includes('(grep TODO) < "$__pi_rtk_pipe_tmp"'));
|
|
193
|
+
} else {
|
|
194
|
+
assert.equal(rewritten, "rtk git diff | grep TODO");
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
assert.equal(applyRewrittenCommandShellSafetyFixups("git diff | grep TODO"), "git diff | grep TODO");
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
runTest("stripRtkHookWarnings handles bare, prefixed, and already-sanitized hook notices", () => {
|
|
201
|
+
assert.equal(
|
|
202
|
+
stripRtkHookWarnings("No hook installed — run `rtk init -g` for automatic token savings\n\nready\n", null),
|
|
203
|
+
"ready\n",
|
|
204
|
+
);
|
|
205
|
+
assert.equal(
|
|
206
|
+
stripRtkHookWarnings("[WARN] Hook outdated — run `rtk init -g` to update\n\nready\n", null),
|
|
207
|
+
"ready\n",
|
|
208
|
+
);
|
|
209
|
+
assert.equal(
|
|
210
|
+
stripRtkHookWarnings(
|
|
211
|
+
"?? bun.lock[rtk] /!\\ No hook installed — run `rtk init -g` for automatic token savings\n",
|
|
212
|
+
null,
|
|
213
|
+
),
|
|
214
|
+
"?? bun.lock\n",
|
|
215
|
+
);
|
|
216
|
+
assert.equal(
|
|
217
|
+
stripRtkHookWarnings("[rtk] /!\\ No hook installed — run `rtk init -g` for automatic token savings\n\n", "rtk git status"),
|
|
218
|
+
"",
|
|
219
|
+
);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
runTest("stripRtkHookWarnings leaves quoted hook text untouched", () => {
|
|
223
|
+
const quoted = 'const warning = "No hook installed — run `rtk init -g` for automatic token savings";\n';
|
|
224
|
+
assert.equal(stripRtkHookWarnings(quoted, null), null);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
runTest("sanitizeRtkEmojiOutput normalizes RTK-shaped warning output without removing content", () => {
|
|
228
|
+
const sanitized = sanitizeRtkEmojiOutput(
|
|
229
|
+
"⚠️ Warning: --hook-only only makes sense with --global\n For local projects, use default mode or --claude-md\n",
|
|
230
|
+
"rtk init --hook-only",
|
|
231
|
+
);
|
|
232
|
+
assert.equal(
|
|
233
|
+
sanitized,
|
|
234
|
+
"[WARN] Warning: --hook-only only makes sense with --global\n For local projects, use default mode or --claude-md\n",
|
|
235
|
+
);
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
runTest("streaming sanitizer strips hook notices, sanitizes emoji output, and preserves non-text blocks", () => {
|
|
239
|
+
const hookNoticeResult = {
|
|
240
|
+
content: [
|
|
241
|
+
{
|
|
242
|
+
type: "text",
|
|
243
|
+
text: "[rtk] /!\\ No hook installed — run `rtk init -g` for automatic token savings\n\nworking tree clean\n",
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
};
|
|
247
|
+
assert.equal(sanitizeStreamingBashExecutionResult(hookNoticeResult, "rtk git status"), true);
|
|
248
|
+
assert.equal(
|
|
249
|
+
(hookNoticeResult.content[0] as { text: string }).text,
|
|
250
|
+
"working tree clean\n",
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
const emojiResult = {
|
|
254
|
+
content: [
|
|
255
|
+
{ type: "text", text: "📄 src/file.ts\n✅ Files are identical\n" },
|
|
256
|
+
{ type: "image", url: "ignored" },
|
|
257
|
+
],
|
|
258
|
+
};
|
|
259
|
+
assert.equal(sanitizeStreamingBashExecutionResult(emojiResult, "rtk git diff -- src/file.ts"), true);
|
|
260
|
+
assert.equal((emojiResult.content[0] as { text: string }).text, "> src/file.ts\n[OK] Files are identical\n");
|
|
261
|
+
assert.deepEqual(emojiResult.content[1], { type: "image", url: "ignored" });
|
|
262
|
+
|
|
263
|
+
const parseWarningResult = {
|
|
264
|
+
content: [
|
|
265
|
+
{
|
|
266
|
+
type: "text",
|
|
267
|
+
text: "[rtk] warning: builtin filters: parse failure\n\nworking tree clean\n",
|
|
268
|
+
},
|
|
269
|
+
],
|
|
270
|
+
};
|
|
271
|
+
assert.equal(sanitizeStreamingBashExecutionResult(parseWarningResult, "rtk git status"), false);
|
|
272
|
+
assert.equal(
|
|
273
|
+
(parseWarningResult.content[0] as { text: string }).text,
|
|
274
|
+
"[rtk] warning: builtin filters: parse failure\n\nworking tree clean\n",
|
|
275
|
+
);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
console.log("All additional coverage tests passed.");
|