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
package/src/types-shims.d.ts
CHANGED
|
@@ -1,183 +1,192 @@
|
|
|
1
|
-
declare module "@mariozechner/pi-tui" {
|
|
2
|
-
export interface SettingItem {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
description: string;
|
|
6
|
-
currentValue: string;
|
|
7
|
-
values: string[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface AutocompleteItem {
|
|
11
|
-
value: string;
|
|
12
|
-
label: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class Box {
|
|
17
|
-
constructor(...args: unknown[]);
|
|
18
|
-
addChild(child: unknown): void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export class Container {
|
|
22
|
-
constructor(...args: unknown[]);
|
|
23
|
-
addChild(child: unknown): void;
|
|
24
|
-
render(width: number): string[];
|
|
25
|
-
invalidate(): void;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export class SettingsList {
|
|
29
|
-
constructor(...args: unknown[]);
|
|
30
|
-
handleInput(data: string): void;
|
|
31
|
-
updateValue(id: string, value: string): void;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export class Spacer {
|
|
35
|
-
constructor(...args: unknown[]);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export class Text {
|
|
39
|
-
constructor(...args: unknown[]);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function truncateToWidth(text: string, width: number, suffix?: string, pad?: boolean): string;
|
|
43
|
-
export function visibleWidth(text: string): number;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare module "@mariozechner/pi-coding-agent" {
|
|
47
|
-
interface UiLike {
|
|
48
|
-
notify(message: string, level: "info" | "warning" | "error"): void;
|
|
49
|
-
custom<T>(
|
|
50
|
-
renderer: (
|
|
51
|
-
tui: { requestRender(): void },
|
|
52
|
-
theme: Theme,
|
|
53
|
-
keybindings: unknown,
|
|
54
|
-
done: () => void,
|
|
55
|
-
) => {
|
|
56
|
-
render(width: number): string[];
|
|
57
|
-
invalidate?(): void;
|
|
58
|
-
handleInput(data: string): void;
|
|
59
|
-
},
|
|
60
|
-
options?: Record<string, unknown>,
|
|
61
|
-
): Promise<T>;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface ExtensionContext {
|
|
65
|
-
hasUI: boolean;
|
|
66
|
-
cwd?: string;
|
|
67
|
-
ui: UiLike;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface ExtensionCommandContext extends ExtensionContext {}
|
|
71
|
-
|
|
72
|
-
export interface ToolResultEvent {
|
|
73
|
-
toolName: string;
|
|
74
|
-
input: Record<string, unknown>;
|
|
75
|
-
content: Array<Record<string, unknown>>;
|
|
76
|
-
details?: unknown;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface BashToolCallEvent {
|
|
80
|
-
toolName: "bash";
|
|
81
|
-
input: { command: string } & Record<string, unknown>;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
85
|
-
|
|
86
|
-
export interface Theme {
|
|
87
|
-
fg(color: string, text: string): string;
|
|
88
|
-
bold(text: string): string;
|
|
89
|
-
getFgAnsi?(name: string): string;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export function getSettingsListTheme(): unknown;
|
|
93
|
-
|
|
94
|
-
export interface ExtensionAPI {
|
|
95
|
-
exec(
|
|
96
|
-
command: string,
|
|
97
|
-
args: string[],
|
|
98
|
-
options?: { timeout?: number },
|
|
99
|
-
): Promise<{ code: number; stdout: string; stderr: string }>;
|
|
100
|
-
|
|
101
|
-
on(
|
|
102
|
-
eventName: "tool_call",
|
|
103
|
-
handler: (
|
|
104
|
-
event: Record<string, unknown>,
|
|
105
|
-
ctx: ExtensionContext,
|
|
106
|
-
) => MaybePromise<Record<string, unknown> | void>,
|
|
107
|
-
): void;
|
|
108
|
-
|
|
109
|
-
on(
|
|
110
|
-
eventName: "tool_result",
|
|
111
|
-
handler: (
|
|
112
|
-
event: ToolResultEvent,
|
|
113
|
-
ctx: ExtensionContext,
|
|
114
|
-
) => MaybePromise<Record<string, unknown> | void>,
|
|
115
|
-
): void;
|
|
116
|
-
|
|
117
|
-
on(
|
|
118
|
-
eventName: "before_agent_start",
|
|
119
|
-
handler: (
|
|
120
|
-
event: { systemPrompt: string },
|
|
121
|
-
ctx: ExtensionContext,
|
|
122
|
-
) => MaybePromise<{ systemPrompt: string } | Record<string, unknown> | void>,
|
|
123
|
-
): void;
|
|
124
|
-
|
|
125
|
-
on(
|
|
126
|
-
eventName: string,
|
|
127
|
-
handler: (event: Record<string, unknown>, ctx: ExtensionContext) => MaybePromise<Record<string, unknown> | void>,
|
|
128
|
-
): void;
|
|
129
|
-
|
|
130
|
-
registerCommand(
|
|
131
|
-
name: string,
|
|
132
|
-
definition: {
|
|
133
|
-
description: string;
|
|
134
|
-
getArgumentCompletions?: (argumentPrefix: string) => Array<{ value: string; label: string; description?: string }> | null;
|
|
135
|
-
handler: (args: string, ctx: ExtensionCommandContext) => MaybePromise<void>;
|
|
136
|
-
},
|
|
137
|
-
): void;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export function isToolCallEventType(
|
|
141
|
-
toolName: "bash",
|
|
142
|
-
event: Record<string, unknown>,
|
|
143
|
-
): event is BashToolCallEvent;
|
|
144
|
-
|
|
145
|
-
export function isToolCallEventType(
|
|
146
|
-
toolName: string,
|
|
147
|
-
event: Record<string, unknown>,
|
|
148
|
-
): boolean;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
declare module "node:assert/strict" {
|
|
153
|
-
const assert: {
|
|
154
|
-
equal(actual: unknown, expected: unknown, message?: string): void;
|
|
155
|
-
deepEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
156
|
-
ok(value: unknown, message?: string): void;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export default assert;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
declare
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
export function
|
|
180
|
-
export function
|
|
181
|
-
export function
|
|
182
|
-
export
|
|
183
|
-
}
|
|
1
|
+
declare module "@mariozechner/pi-tui" {
|
|
2
|
+
export interface SettingItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
currentValue: string;
|
|
7
|
+
values: string[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface AutocompleteItem {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class Box {
|
|
17
|
+
constructor(...args: unknown[]);
|
|
18
|
+
addChild(child: unknown): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class Container {
|
|
22
|
+
constructor(...args: unknown[]);
|
|
23
|
+
addChild(child: unknown): void;
|
|
24
|
+
render(width: number): string[];
|
|
25
|
+
invalidate(): void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class SettingsList {
|
|
29
|
+
constructor(...args: unknown[]);
|
|
30
|
+
handleInput(data: string): void;
|
|
31
|
+
updateValue(id: string, value: string): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class Spacer {
|
|
35
|
+
constructor(...args: unknown[]);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class Text {
|
|
39
|
+
constructor(...args: unknown[]);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function truncateToWidth(text: string, width: number, suffix?: string, pad?: boolean): string;
|
|
43
|
+
export function visibleWidth(text: string): number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare module "@mariozechner/pi-coding-agent" {
|
|
47
|
+
interface UiLike {
|
|
48
|
+
notify(message: string, level: "info" | "warning" | "error"): void;
|
|
49
|
+
custom<T>(
|
|
50
|
+
renderer: (
|
|
51
|
+
tui: { requestRender(): void },
|
|
52
|
+
theme: Theme,
|
|
53
|
+
keybindings: unknown,
|
|
54
|
+
done: () => void,
|
|
55
|
+
) => {
|
|
56
|
+
render(width: number): string[];
|
|
57
|
+
invalidate?(): void;
|
|
58
|
+
handleInput(data: string): void;
|
|
59
|
+
},
|
|
60
|
+
options?: Record<string, unknown>,
|
|
61
|
+
): Promise<T>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface ExtensionContext {
|
|
65
|
+
hasUI: boolean;
|
|
66
|
+
cwd?: string;
|
|
67
|
+
ui: UiLike;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface ExtensionCommandContext extends ExtensionContext {}
|
|
71
|
+
|
|
72
|
+
export interface ToolResultEvent {
|
|
73
|
+
toolName: string;
|
|
74
|
+
input: Record<string, unknown>;
|
|
75
|
+
content: Array<Record<string, unknown>>;
|
|
76
|
+
details?: unknown;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface BashToolCallEvent {
|
|
80
|
+
toolName: "bash";
|
|
81
|
+
input: { command: string } & Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
85
|
+
|
|
86
|
+
export interface Theme {
|
|
87
|
+
fg(color: string, text: string): string;
|
|
88
|
+
bold(text: string): string;
|
|
89
|
+
getFgAnsi?(name: string): string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function getSettingsListTheme(): unknown;
|
|
93
|
+
|
|
94
|
+
export interface ExtensionAPI {
|
|
95
|
+
exec(
|
|
96
|
+
command: string,
|
|
97
|
+
args: string[],
|
|
98
|
+
options?: { timeout?: number },
|
|
99
|
+
): Promise<{ code: number; stdout: string; stderr: string }>;
|
|
100
|
+
|
|
101
|
+
on(
|
|
102
|
+
eventName: "tool_call",
|
|
103
|
+
handler: (
|
|
104
|
+
event: Record<string, unknown>,
|
|
105
|
+
ctx: ExtensionContext,
|
|
106
|
+
) => MaybePromise<Record<string, unknown> | void>,
|
|
107
|
+
): void;
|
|
108
|
+
|
|
109
|
+
on(
|
|
110
|
+
eventName: "tool_result",
|
|
111
|
+
handler: (
|
|
112
|
+
event: ToolResultEvent,
|
|
113
|
+
ctx: ExtensionContext,
|
|
114
|
+
) => MaybePromise<Record<string, unknown> | void>,
|
|
115
|
+
): void;
|
|
116
|
+
|
|
117
|
+
on(
|
|
118
|
+
eventName: "before_agent_start",
|
|
119
|
+
handler: (
|
|
120
|
+
event: { systemPrompt: string },
|
|
121
|
+
ctx: ExtensionContext,
|
|
122
|
+
) => MaybePromise<{ systemPrompt: string } | Record<string, unknown> | void>,
|
|
123
|
+
): void;
|
|
124
|
+
|
|
125
|
+
on(
|
|
126
|
+
eventName: string,
|
|
127
|
+
handler: (event: Record<string, unknown>, ctx: ExtensionContext) => MaybePromise<Record<string, unknown> | void>,
|
|
128
|
+
): void;
|
|
129
|
+
|
|
130
|
+
registerCommand(
|
|
131
|
+
name: string,
|
|
132
|
+
definition: {
|
|
133
|
+
description: string;
|
|
134
|
+
getArgumentCompletions?: (argumentPrefix: string) => Array<{ value: string; label: string; description?: string }> | null;
|
|
135
|
+
handler: (args: string, ctx: ExtensionCommandContext) => MaybePromise<void>;
|
|
136
|
+
},
|
|
137
|
+
): void;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function isToolCallEventType(
|
|
141
|
+
toolName: "bash",
|
|
142
|
+
event: Record<string, unknown>,
|
|
143
|
+
): event is BashToolCallEvent;
|
|
144
|
+
|
|
145
|
+
export function isToolCallEventType(
|
|
146
|
+
toolName: string,
|
|
147
|
+
event: Record<string, unknown>,
|
|
148
|
+
): boolean;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
declare module "node:assert/strict" {
|
|
153
|
+
const assert: {
|
|
154
|
+
equal(actual: unknown, expected: unknown, message?: string): void;
|
|
155
|
+
deepEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
156
|
+
ok(value: unknown, message?: string): void;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export default assert;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
declare module "bun:test" {
|
|
163
|
+
export const mock: {
|
|
164
|
+
module(specifier: string, factory: () => Record<string, unknown>): void;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
declare const process: {
|
|
169
|
+
platform: string;
|
|
170
|
+
env: Record<string, string | undefined>;
|
|
171
|
+
cwd(): string;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
declare module "node:os" {
|
|
175
|
+
export function homedir(): string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare module "node:path" {
|
|
179
|
+
export function join(...segments: string[]): string;
|
|
180
|
+
export function dirname(path: string): string;
|
|
181
|
+
export function resolve(...segments: string[]): string;
|
|
182
|
+
export const sep: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
declare module "node:fs" {
|
|
186
|
+
export function existsSync(path: string): boolean;
|
|
187
|
+
export function mkdirSync(path: string, options?: { recursive?: boolean }): void;
|
|
188
|
+
export function readFileSync(path: string, encoding: "utf-8"): string;
|
|
189
|
+
export function renameSync(oldPath: string, newPath: string): void;
|
|
190
|
+
export function unlinkSync(path: string): void;
|
|
191
|
+
export function writeFileSync(path: string, data: string, encoding: "utf-8"): void;
|
|
192
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -1,114 +1,103 @@
|
|
|
1
|
-
export const RTK_MODES = ["rewrite", "suggest"] as const;
|
|
2
|
-
export const RTK_SOURCE_FILTER_LEVELS = ["none", "minimal", "aggressive"] as const;
|
|
3
|
-
|
|
4
|
-
export type RtkMode = (typeof RTK_MODES)[number];
|
|
5
|
-
export type RtkSourceFilterLevel = (typeof RTK_SOURCE_FILTER_LEVELS)[number];
|
|
6
|
-
|
|
7
|
-
export interface RtkOutputCompactionConfig {
|
|
8
|
-
enabled: boolean;
|
|
9
|
-
stripAnsi: boolean;
|
|
10
|
-
truncate: {
|
|
11
|
-
enabled: boolean;
|
|
12
|
-
maxChars: number;
|
|
13
|
-
};
|
|
14
|
-
sourceCodeFilteringEnabled: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"files",
|
|
105
|
-
"rust",
|
|
106
|
-
"js",
|
|
107
|
-
"python",
|
|
108
|
-
"go",
|
|
109
|
-
"containers",
|
|
110
|
-
"network",
|
|
111
|
-
"packages",
|
|
112
|
-
] as const;
|
|
113
|
-
|
|
114
|
-
export type RtkCategoryKey = (typeof RTK_CATEGORY_KEYS)[number];
|
|
1
|
+
export const RTK_MODES = ["rewrite", "suggest"] as const;
|
|
2
|
+
export const RTK_SOURCE_FILTER_LEVELS = ["none", "minimal", "aggressive"] as const;
|
|
3
|
+
|
|
4
|
+
export type RtkMode = (typeof RTK_MODES)[number];
|
|
5
|
+
export type RtkSourceFilterLevel = (typeof RTK_SOURCE_FILTER_LEVELS)[number];
|
|
6
|
+
|
|
7
|
+
export interface RtkOutputCompactionConfig {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
stripAnsi: boolean;
|
|
10
|
+
truncate: {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
maxChars: number;
|
|
13
|
+
};
|
|
14
|
+
sourceCodeFilteringEnabled: boolean;
|
|
15
|
+
preserveExactSkillReads: boolean;
|
|
16
|
+
sourceCodeFiltering: RtkSourceFilterLevel;
|
|
17
|
+
smartTruncate: {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
maxLines: number;
|
|
20
|
+
};
|
|
21
|
+
aggregateTestOutput: boolean;
|
|
22
|
+
filterBuildOutput: boolean;
|
|
23
|
+
compactGitOutput: boolean;
|
|
24
|
+
aggregateLinterOutput: boolean;
|
|
25
|
+
groupSearchOutput: boolean;
|
|
26
|
+
trackSavings: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface RtkIntegrationConfig {
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
mode: RtkMode;
|
|
32
|
+
guardWhenRtkMissing: boolean;
|
|
33
|
+
showRewriteNotifications: boolean;
|
|
34
|
+
rewriteGitGithub: boolean;
|
|
35
|
+
rewriteFilesystem: boolean;
|
|
36
|
+
rewriteRust: boolean;
|
|
37
|
+
rewriteJavaScript: boolean;
|
|
38
|
+
rewritePython: boolean;
|
|
39
|
+
rewriteGo: boolean;
|
|
40
|
+
rewriteContainers: boolean;
|
|
41
|
+
rewriteNetwork: boolean;
|
|
42
|
+
rewritePackageManagers: boolean;
|
|
43
|
+
outputCompaction: RtkOutputCompactionConfig;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const DEFAULT_RTK_INTEGRATION_CONFIG: RtkIntegrationConfig = {
|
|
47
|
+
enabled: true,
|
|
48
|
+
mode: "rewrite",
|
|
49
|
+
guardWhenRtkMissing: true,
|
|
50
|
+
showRewriteNotifications: true,
|
|
51
|
+
rewriteGitGithub: true,
|
|
52
|
+
rewriteFilesystem: true,
|
|
53
|
+
rewriteRust: true,
|
|
54
|
+
rewriteJavaScript: true,
|
|
55
|
+
rewritePython: true,
|
|
56
|
+
rewriteGo: true,
|
|
57
|
+
rewriteContainers: true,
|
|
58
|
+
rewriteNetwork: true,
|
|
59
|
+
rewritePackageManagers: true,
|
|
60
|
+
outputCompaction: {
|
|
61
|
+
enabled: true,
|
|
62
|
+
stripAnsi: true,
|
|
63
|
+
truncate: {
|
|
64
|
+
enabled: true,
|
|
65
|
+
maxChars: 12_000,
|
|
66
|
+
},
|
|
67
|
+
sourceCodeFilteringEnabled: true,
|
|
68
|
+
preserveExactSkillReads: false,
|
|
69
|
+
sourceCodeFiltering: "minimal",
|
|
70
|
+
smartTruncate: {
|
|
71
|
+
enabled: true,
|
|
72
|
+
maxLines: 220,
|
|
73
|
+
},
|
|
74
|
+
aggregateTestOutput: true,
|
|
75
|
+
filterBuildOutput: true,
|
|
76
|
+
compactGitOutput: true,
|
|
77
|
+
aggregateLinterOutput: true,
|
|
78
|
+
groupSearchOutput: true,
|
|
79
|
+
trackSavings: true,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export interface ConfigLoadResult {
|
|
84
|
+
config: RtkIntegrationConfig;
|
|
85
|
+
warning?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface ConfigSaveResult {
|
|
89
|
+
success: boolean;
|
|
90
|
+
error?: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface EnsureConfigResult {
|
|
94
|
+
created: boolean;
|
|
95
|
+
error?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface RuntimeStatus {
|
|
99
|
+
rtkAvailable: boolean;
|
|
100
|
+
lastCheckedAt?: number;
|
|
101
|
+
lastError?: string;
|
|
102
|
+
}
|
|
103
|
+
|