@felan-ai/ext-rtk-optimizer 0.1.0 → 0.3.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/NOTICE +5 -0
- package/README.md +57 -38
- package/dist/command-rewriter.d.ts +1 -0
- package/dist/command-rewriter.d.ts.map +1 -1
- package/dist/command-rewriter.js +75 -24
- package/dist/command-rewriter.js.map +1 -1
- package/dist/command.d.ts +2 -2
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +17 -173
- package/dist/command.js.map +1 -1
- package/dist/config.d.ts +23 -10
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +95 -116
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -16
- package/dist/index.js.map +1 -1
- package/dist/installer.d.ts +8 -0
- package/dist/installer.d.ts.map +1 -0
- package/dist/installer.js +123 -0
- package/dist/installer.js.map +1 -0
- package/dist/runtime-path.d.ts +1 -0
- package/dist/runtime-path.d.ts.map +1 -1
- package/dist/runtime-path.js +4 -1
- package/dist/runtime-path.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/NOTICE
CHANGED
|
@@ -12,3 +12,8 @@ tool-output compaction techniques, read-compaction safeguards, configuration,
|
|
|
12
12
|
session metrics, and the /rtk command behavior. Felan routes I/O through
|
|
13
13
|
AgentRuntime and adds native support for Codex exec_command and write_stdin
|
|
14
14
|
tools while preserving their structured result envelopes.
|
|
15
|
+
|
|
16
|
+
The optional /rtk install command downloads, verifies, and executes the
|
|
17
|
+
official rtk-ai/rtk installer from commit
|
|
18
|
+
b34be37caf3796b69a50952a28e60e32b5daad43 to install RTK 0.45.0. The installer
|
|
19
|
+
and RTK binary are not bundled in this npm package.
|
package/README.md
CHANGED
|
@@ -27,21 +27,29 @@ of at most 80 lines stay exact even when read compaction is enabled.
|
|
|
27
27
|
## Requirements
|
|
28
28
|
|
|
29
29
|
Install [RTK](https://github.com/rtk-ai/rtk) in the execution runtime and make
|
|
30
|
-
the `rtk` executable available on its `PATH
|
|
31
|
-
|
|
30
|
+
the `rtk` executable available on its `PATH`, or run `/rtk install`. The
|
|
31
|
+
explicit install command downloads a commit-pinned copy of RTK's official
|
|
32
|
+
installer, verifies its reviewed SHA-256 digest, and asks that installer for
|
|
33
|
+
the pinned RTK 0.45.0 release. The upstream installer verifies the release
|
|
34
|
+
archive checksum before placing the executable in Felan agent storage. It
|
|
35
|
+
requires `curl` plus standard Linux/macOS shell utilities; Windows users must
|
|
36
|
+
place `rtk.exe` on `PATH` manually.
|
|
37
|
+
|
|
38
|
+
Managed RTK is preferred over `PATH`. Rewritten shell commands receive its bin
|
|
39
|
+
directory through a command-scoped `PATH`, so no shell-profile change is
|
|
40
|
+
required and compound rewrites can resolve every `rtk` invocation. Use
|
|
41
|
+
`/rtk verify` to check the same `AgentRuntime` used by coding tools. Installation
|
|
42
|
+
never runs during extension startup or from a model-initiated tool call.
|
|
32
43
|
|
|
33
44
|
## Configuration
|
|
34
45
|
|
|
35
|
-
The extension
|
|
46
|
+
The extension receives portable configuration from:
|
|
36
47
|
|
|
37
|
-
|
|
38
|
-
$FELAN_AGENT_DIR/storage/agent/rtk-optimizer/config.json
|
|
39
|
-
```
|
|
48
|
+
`extensionConfig.rtkOptimizer` in `$FELAN_AGENT_DIR/settings.json`.
|
|
40
49
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
the extension host when it exposes a notification channel; the invalid file is
|
|
50
|
+
Root sessions and nested subagents receive the resolved snapshot. Invalid
|
|
51
|
+
fields, invalid types, and values outside the documented ranges stop activation
|
|
52
|
+
with a settings error; changes take effect in a new session. The invalid value is
|
|
45
53
|
not overwritten.
|
|
46
54
|
|
|
47
55
|
```json
|
|
@@ -50,30 +58,22 @@ not overwritten.
|
|
|
50
58
|
"mode": "rewrite",
|
|
51
59
|
"guardWhenRtkMissing": true,
|
|
52
60
|
"showRewriteNotifications": true,
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
"aggregateTestOutput": true,
|
|
71
|
-
"filterBuildOutput": true,
|
|
72
|
-
"compactGitOutput": true,
|
|
73
|
-
"aggregateLinterOutput": true,
|
|
74
|
-
"groupSearchOutput": true,
|
|
75
|
-
"trackSavings": true
|
|
76
|
-
}
|
|
61
|
+
"compactionEnabled": true,
|
|
62
|
+
"stripAnsi": true,
|
|
63
|
+
"readCompaction": false,
|
|
64
|
+
"truncate": true,
|
|
65
|
+
"truncateMaxChars": 12000,
|
|
66
|
+
"sourceCodeFilteringEnabled": false,
|
|
67
|
+
"preserveExactSkillReads": false,
|
|
68
|
+
"sourceFiltering": "none",
|
|
69
|
+
"smartTruncate": false,
|
|
70
|
+
"smartTruncateMaxLines": 220,
|
|
71
|
+
"aggregateTestOutput": true,
|
|
72
|
+
"filterBuildOutput": true,
|
|
73
|
+
"compactGitOutput": true,
|
|
74
|
+
"aggregateLinterOutput": true,
|
|
75
|
+
"groupSearchOutput": true,
|
|
76
|
+
"trackSavings": true
|
|
77
77
|
}
|
|
78
78
|
```
|
|
79
79
|
|
|
@@ -83,14 +83,14 @@ or `aggressive`. `truncate.maxChars` accepts 1,000–200,000 and
|
|
|
83
83
|
|
|
84
84
|
## Command
|
|
85
85
|
|
|
86
|
-
Run `/
|
|
86
|
+
Run `/settings` to edit RTK settings interactively. `/rtk` provides operational
|
|
87
|
+
commands. Subcommands are:
|
|
87
88
|
|
|
88
89
|
- `/rtk show`
|
|
89
|
-
- `/rtk path`
|
|
90
90
|
- `/rtk verify`
|
|
91
|
+
- `/rtk install`
|
|
91
92
|
- `/rtk stats`
|
|
92
93
|
- `/rtk clear-stats`
|
|
93
|
-
- `/rtk reset`
|
|
94
94
|
- `/rtk help`
|
|
95
95
|
|
|
96
96
|
Metrics are scoped to the current Felan extension session and reset at session
|
|
@@ -112,4 +112,23 @@ pnpm --filter @felan-ai/ext-rtk-optimizer test
|
|
|
112
112
|
## Attribution
|
|
113
113
|
|
|
114
114
|
This package adapts the MIT-licensed `pi-rtk-optimizer` 0.9.0 implementation.
|
|
115
|
-
See [NOTICE](NOTICE) for source provenance.
|
|
115
|
+
See [NOTICE](NOTICE) and [LICENSE](LICENSE) for source provenance.
|
|
116
|
+
|
|
117
|
+
## Package boundary and requirements
|
|
118
|
+
|
|
119
|
+
The extension owns rewrite decisions at the tool boundary, command/result
|
|
120
|
+
association, output compaction, configuration validation, and savings metrics.
|
|
121
|
+
The host supplies `AgentRuntime`, the agent-scoped storage root, interactive
|
|
122
|
+
settings presentation, and explicit installation policy. Output compaction can
|
|
123
|
+
operate without the executable; command rewriting requires a compatible `rtk`
|
|
124
|
+
on the active runtime.
|
|
125
|
+
|
|
126
|
+
It requires a compatible `@felan-ai/agent-core` peer. Managed installation is
|
|
127
|
+
explicit, digest-verified, and never runs during startup or a model tool call.
|
|
128
|
+
Lossy read compaction remains opt-in and explicit ranges remain exact.
|
|
129
|
+
|
|
130
|
+
## Related documentation
|
|
131
|
+
|
|
132
|
+
- [Configuration](../../docs/user-guide/configuration.md#rtk)
|
|
133
|
+
- [Commands and shortcuts](../../docs/user-guide/commands-and-shortcuts.md)
|
|
134
|
+
- [Runtime dependencies](../../docs/reference/runtime-dependencies.md)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-rewriter.d.ts","sourceRoot":"","sources":["../src/command-rewriter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"command-rewriter.d.ts","sourceRoot":"","sources":["../src/command-rewriter.ts"],"names":[],"mappings":"AAAA,OAAO,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Q,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAMA"}
|
package/dist/command-rewriter.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { managedRtkExecutable, supportsManagedRtk } from './installer.js';
|
|
1
2
|
export async function computeRewriteDecision(runtime, command, options) {
|
|
2
3
|
if (!command.trim()) {
|
|
3
4
|
return {
|
|
@@ -7,7 +8,24 @@ export async function computeRewriteDecision(runtime, command, options) {
|
|
|
7
8
|
reason: 'empty',
|
|
8
9
|
};
|
|
9
10
|
}
|
|
11
|
+
if (isAlreadyManagedRtk(command, options?.executable)) {
|
|
12
|
+
return {
|
|
13
|
+
changed: false,
|
|
14
|
+
originalCommand: command,
|
|
15
|
+
rewrittenCommand: command,
|
|
16
|
+
reason: 'already_rtk',
|
|
17
|
+
};
|
|
18
|
+
}
|
|
10
19
|
if (isAlreadyRtk(command)) {
|
|
20
|
+
const executable = options?.executable;
|
|
21
|
+
if (executable && executable !== 'rtk') {
|
|
22
|
+
return {
|
|
23
|
+
changed: true,
|
|
24
|
+
originalCommand: command,
|
|
25
|
+
rewrittenCommand: qualifyManagedRewrite(command, executable),
|
|
26
|
+
reason: 'ok',
|
|
27
|
+
};
|
|
28
|
+
}
|
|
11
29
|
return {
|
|
12
30
|
changed: false,
|
|
13
31
|
originalCommand: command,
|
|
@@ -33,11 +51,12 @@ export async function computeRewriteDecision(runtime, command, options) {
|
|
|
33
51
|
};
|
|
34
52
|
}
|
|
35
53
|
export async function resolveRtkRewrite(runtime, command, options = {}) {
|
|
54
|
+
const executable = options.executable ?? 'rtk';
|
|
36
55
|
try {
|
|
37
|
-
const result = await runtime.exec(
|
|
56
|
+
const result = await runtime.exec(executable, ['rewrite', command], {
|
|
38
57
|
timeout: options.timeoutMs ?? 3_000,
|
|
39
58
|
});
|
|
40
|
-
const
|
|
59
|
+
const rawRewritten = result.stdout.trim();
|
|
41
60
|
if (result.code === 1) {
|
|
42
61
|
return { changed: false, rewrittenCommand: command, exitCode: result.code };
|
|
43
62
|
}
|
|
@@ -50,7 +69,7 @@ export async function resolveRtkRewrite(runtime, command, options = {}) {
|
|
|
50
69
|
};
|
|
51
70
|
}
|
|
52
71
|
if (result.code === 0 || result.code === 3) {
|
|
53
|
-
if (!
|
|
72
|
+
if (!rawRewritten) {
|
|
54
73
|
return {
|
|
55
74
|
changed: false,
|
|
56
75
|
rewrittenCommand: command,
|
|
@@ -58,6 +77,9 @@ export async function resolveRtkRewrite(runtime, command, options = {}) {
|
|
|
58
77
|
error: 'rtk returned empty output',
|
|
59
78
|
};
|
|
60
79
|
}
|
|
80
|
+
const rewritten = rawRewritten === command
|
|
81
|
+
? rawRewritten
|
|
82
|
+
: qualifyManagedRewrite(rawRewritten, executable);
|
|
61
83
|
return {
|
|
62
84
|
changed: rewritten !== command,
|
|
63
85
|
rewrittenCommand: rewritten,
|
|
@@ -81,29 +103,39 @@ export async function resolveRtkRewrite(runtime, command, options = {}) {
|
|
|
81
103
|
}
|
|
82
104
|
}
|
|
83
105
|
export async function inspectRtkRuntime(runtime) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
106
|
+
const failures = [];
|
|
107
|
+
const candidates = [
|
|
108
|
+
...(supportsManagedRtk(runtime)
|
|
109
|
+
? [{ command: managedRtkExecutable(runtime), source: 'managed' }]
|
|
110
|
+
: []),
|
|
111
|
+
{ command: 'rtk', source: 'path' },
|
|
112
|
+
];
|
|
113
|
+
for (const candidate of candidates) {
|
|
114
|
+
try {
|
|
115
|
+
const result = await runtime.exec(candidate.command, ['--version'], { timeout: 5_000 });
|
|
116
|
+
if (result.code === 0 && !result.killed) {
|
|
117
|
+
return {
|
|
118
|
+
rtkAvailable: true,
|
|
119
|
+
lastCheckedAt: Date.now(),
|
|
120
|
+
command: candidate.command,
|
|
121
|
+
source: candidate.source,
|
|
122
|
+
...(result.stdout.trim() ? { version: trimMessage(result.stdout) } : {}),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const detail = result.killed
|
|
126
|
+
? 'timed out or was terminated'
|
|
127
|
+
: trimMessage(`${result.stderr} ${result.stdout}`) || `exit ${result.code}`;
|
|
128
|
+
failures.push(`${candidate.source}: ${detail}`);
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
failures.push(`${candidate.source}: ${trimMessage(errorMessage(error))}`);
|
|
92
132
|
}
|
|
93
|
-
const detail = trimMessage(`${result.stderr} ${result.stdout}`);
|
|
94
|
-
return {
|
|
95
|
-
rtkAvailable: false,
|
|
96
|
-
lastCheckedAt: Date.now(),
|
|
97
|
-
lastError: detail || `exit ${result.code}`,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
return {
|
|
102
|
-
rtkAvailable: false,
|
|
103
|
-
lastCheckedAt: Date.now(),
|
|
104
|
-
lastError: trimMessage(errorMessage(error)),
|
|
105
|
-
};
|
|
106
133
|
}
|
|
134
|
+
return {
|
|
135
|
+
rtkAvailable: false,
|
|
136
|
+
lastCheckedAt: Date.now(),
|
|
137
|
+
lastError: trimMessage(failures.join('; ')),
|
|
138
|
+
};
|
|
107
139
|
}
|
|
108
140
|
export function isAlreadyRtk(command) {
|
|
109
141
|
const effectiveCommand = splitLeadingEnvAssignments(command.trimStart()).command.trimStart();
|
|
@@ -123,4 +155,23 @@ function trimMessage(value, maxLength = 220) {
|
|
|
123
155
|
function errorMessage(error) {
|
|
124
156
|
return error instanceof Error ? error.message : String(error);
|
|
125
157
|
}
|
|
158
|
+
function qualifyManagedRewrite(rewritten, executable) {
|
|
159
|
+
if (executable === 'rtk' || !rewritten)
|
|
160
|
+
return rewritten;
|
|
161
|
+
return `${managedPathPrefix(executable)}${rewritten}\n\n)`;
|
|
162
|
+
}
|
|
163
|
+
function isAlreadyManagedRtk(command, executable) {
|
|
164
|
+
if (!executable || executable === 'rtk')
|
|
165
|
+
return false;
|
|
166
|
+
const effectiveCommand = splitLeadingEnvAssignments(command.trimStart()).command.trimStart();
|
|
167
|
+
return effectiveCommand.startsWith(managedPathPrefix(executable));
|
|
168
|
+
}
|
|
169
|
+
function managedPathPrefix(executable) {
|
|
170
|
+
const separator = executable.lastIndexOf('/');
|
|
171
|
+
const directory = separator < 0 ? '.' : executable.slice(0, separator);
|
|
172
|
+
return `(PATH=${quotePosixShellArgument(directory)}:"$PATH"; export PATH; `;
|
|
173
|
+
}
|
|
174
|
+
function quotePosixShellArgument(value) {
|
|
175
|
+
return `'${value.replace(/'/gu, `'\\''`)}'`;
|
|
176
|
+
}
|
|
126
177
|
//# sourceMappingURL=command-rewriter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-rewriter.js","sourceRoot":"","sources":["../src/command-rewriter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-rewriter.js","sourceRoot":"","sources":["../src/command-rewriter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAuB1E,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAqB,EACrB,OAAe,EACf,OAAkC;IAElC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,eAAe,EAAE,OAAO;YACxB,gBAAgB,EAAE,OAAO;YACzB,MAAM,EAAE,OAAO;SAChB,CAAC;IACJ,CAAC;IAED,IAAI,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC;QACtD,OAAO;YACL,OAAO,EAAE,KAAK;YACd,eAAe,EAAE,OAAO;YACxB,gBAAgB,EAAE,OAAO;YACzB,MAAM,EAAE,aAAa;SACtB,CAAC;IACJ,CAAC;IAED,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1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GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACvE,OAAO,SAAS,uBAAuB,CAAC,SAAS,CAAC,yBAAyB,CAAC;AAC9E,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAa;IAC5C,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC;AAC9C,CAAC"}
|
package/dist/command.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { FelanExtensionAPI } from '@felan-ai/agent-core';
|
|
2
|
-
import {
|
|
2
|
+
import type { RtkOptimizerConfig, RuntimeStatus } from './types.js';
|
|
3
3
|
export interface RtkOptimizerController {
|
|
4
4
|
getConfig(): RtkOptimizerConfig;
|
|
5
|
-
setConfig(config: RtkOptimizerConfig): Promise<void>;
|
|
6
5
|
getRuntimeStatus(): RuntimeStatus;
|
|
7
6
|
refreshRuntimeStatus(): Promise<RuntimeStatus>;
|
|
7
|
+
install(onStatus: (message: string) => void): Promise<RuntimeStatus>;
|
|
8
8
|
getMetricsSummary(): string;
|
|
9
9
|
clearMetrics(): void;
|
|
10
10
|
}
|
package/dist/command.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpE,MAAM,WAAW,sBAAsB;IACrC,SAAS,IAAI,kBAAkB,CAAC;IAChC,gBAAgB,IAAI,aAAa,CAAC;IAClC,oBAAoB,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/C,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACrE,iBAAiB,IAAI,MAAM,CAAC;IAC5B,YAAY,IAAI,IAAI,CAAC;CACtB;AAYD,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAuDlG"}
|
package/dist/command.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { DEFAULT_RTK_OPTIMIZER_CONFIG } from './types.js';
|
|
3
|
-
const USAGE = 'Usage: /rtk [show|path|verify|stats|clear-stats|reset|help]';
|
|
1
|
+
const USAGE = 'Usage: /rtk [show|verify|install|stats|clear-stats|help]';
|
|
4
2
|
const SUBCOMMANDS = [
|
|
5
3
|
['show', 'Show current RTK configuration and runtime status'],
|
|
6
|
-
['path', 'Show the RTK configuration path'],
|
|
7
4
|
['verify', 'Check whether rtk is available in the runtime'],
|
|
5
|
+
['install', 'Run the pinned official RTK installer'],
|
|
8
6
|
['stats', 'Show output-compaction metrics'],
|
|
9
7
|
['clear-stats', 'Clear output-compaction metrics'],
|
|
10
|
-
['reset', 'Reset RTK settings to defaults'],
|
|
11
8
|
['help', 'Show command usage'],
|
|
12
9
|
];
|
|
13
10
|
export function registerRtkCommand(pi, controller) {
|
|
@@ -25,11 +22,7 @@ export function registerRtkCommand(pi, controller) {
|
|
|
25
22
|
handler: async (args, ctx) => {
|
|
26
23
|
const subcommand = args.trim().toLowerCase();
|
|
27
24
|
if (!subcommand) {
|
|
28
|
-
|
|
29
|
-
ctx.ui.notify('/rtk settings require interactive TUI mode.', 'warning');
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
await openSettings(ctx, controller);
|
|
25
|
+
ctx.ui.notify('Configure RTK through /settings. Use /rtk show to inspect the resolved settings.', 'info');
|
|
33
26
|
return;
|
|
34
27
|
}
|
|
35
28
|
if (subcommand === 'help') {
|
|
@@ -38,15 +31,26 @@ export function registerRtkCommand(pi, controller) {
|
|
|
38
31
|
else if (subcommand === 'show') {
|
|
39
32
|
ctx.ui.notify(formatSummary(controller.getConfig(), controller.getRuntimeStatus()), 'info');
|
|
40
33
|
}
|
|
41
|
-
else if (subcommand === 'path') {
|
|
42
|
-
ctx.ui.notify(`RTK config: ${getRtkOptimizerConfigPath(pi.runtime)}`, 'info');
|
|
43
|
-
}
|
|
44
34
|
else if (subcommand === 'verify') {
|
|
45
35
|
const status = await controller.refreshRuntimeStatus();
|
|
46
36
|
ctx.ui.notify(status.rtkAvailable
|
|
47
37
|
? `RTK is available${status.version ? ` (${status.version})` : ''}.`
|
|
48
38
|
: `RTK is unavailable${status.lastError ? `: ${status.lastError}` : '.'}`, status.rtkAvailable ? 'info' : 'warning');
|
|
49
39
|
}
|
|
40
|
+
else if (subcommand === 'install') {
|
|
41
|
+
ctx.ui.setStatus('rtk-install', '… Installing RTK');
|
|
42
|
+
try {
|
|
43
|
+
const status = await controller.install((message) => {
|
|
44
|
+
ctx.ui.setStatus('rtk-install', `… ${message}`);
|
|
45
|
+
});
|
|
46
|
+
ctx.ui.notify(status.rtkAvailable
|
|
47
|
+
? `RTK installed successfully${status.version ? ` (${status.version})` : ''}.`
|
|
48
|
+
: `RTK installation failed${status.lastError ? `: ${status.lastError}` : '.'}`, status.rtkAvailable ? 'info' : 'error');
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
ctx.ui.setStatus('rtk-install', undefined);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
50
54
|
else if (subcommand === 'stats') {
|
|
51
55
|
ctx.ui.notify(controller.getMetricsSummary(), 'info');
|
|
52
56
|
}
|
|
@@ -54,172 +58,12 @@ export function registerRtkCommand(pi, controller) {
|
|
|
54
58
|
controller.clearMetrics();
|
|
55
59
|
ctx.ui.notify('RTK metrics cleared.', 'info');
|
|
56
60
|
}
|
|
57
|
-
else if (subcommand === 'reset') {
|
|
58
|
-
if (await saveConfig(ctx, controller, structuredClone(DEFAULT_RTK_OPTIMIZER_CONFIG))) {
|
|
59
|
-
ctx.ui.notify('RTK optimizer settings reset to defaults.', 'info');
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
61
|
else {
|
|
63
62
|
ctx.ui.notify(USAGE, 'warning');
|
|
64
63
|
}
|
|
65
64
|
},
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
|
-
async function openSettings(ctx, controller) {
|
|
69
|
-
while (true) {
|
|
70
|
-
const config = controller.getConfig();
|
|
71
|
-
const choices = settingChoices(config);
|
|
72
|
-
const close = 'Close RTK settings';
|
|
73
|
-
const selected = await ctx.ui.select('RTK Optimizer settings', [...choices.map((choice) => choice.label), close]);
|
|
74
|
-
if (!selected || selected === close)
|
|
75
|
-
return;
|
|
76
|
-
const choice = choices.find((candidate) => candidate.label === selected);
|
|
77
|
-
if (!choice)
|
|
78
|
-
continue;
|
|
79
|
-
const next = await changeSetting(ctx, config, choice.id);
|
|
80
|
-
if (next)
|
|
81
|
-
await saveConfig(ctx, controller, next);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async function changeSetting(ctx, config, id) {
|
|
85
|
-
const next = structuredClone(config);
|
|
86
|
-
const output = next.outputCompaction;
|
|
87
|
-
switch (id) {
|
|
88
|
-
case 'enabled':
|
|
89
|
-
next.enabled = !next.enabled;
|
|
90
|
-
break;
|
|
91
|
-
case 'mode':
|
|
92
|
-
next.mode = next.mode === 'rewrite' ? 'suggest' : 'rewrite';
|
|
93
|
-
break;
|
|
94
|
-
case 'guardWhenRtkMissing':
|
|
95
|
-
next.guardWhenRtkMissing = !next.guardWhenRtkMissing;
|
|
96
|
-
break;
|
|
97
|
-
case 'showRewriteNotifications':
|
|
98
|
-
next.showRewriteNotifications = !next.showRewriteNotifications;
|
|
99
|
-
break;
|
|
100
|
-
case 'compactionEnabled':
|
|
101
|
-
output.enabled = !output.enabled;
|
|
102
|
-
break;
|
|
103
|
-
case 'stripAnsi':
|
|
104
|
-
output.stripAnsi = !output.stripAnsi;
|
|
105
|
-
break;
|
|
106
|
-
case 'readCompaction':
|
|
107
|
-
output.readCompaction.enabled = !output.readCompaction.enabled;
|
|
108
|
-
break;
|
|
109
|
-
case 'sourceFilteringEnabled':
|
|
110
|
-
output.sourceCodeFilteringEnabled = !output.sourceCodeFilteringEnabled;
|
|
111
|
-
break;
|
|
112
|
-
case 'preserveExactSkillReads':
|
|
113
|
-
output.preserveExactSkillReads = !output.preserveExactSkillReads;
|
|
114
|
-
break;
|
|
115
|
-
case 'aggregateTestOutput':
|
|
116
|
-
output.aggregateTestOutput = !output.aggregateTestOutput;
|
|
117
|
-
break;
|
|
118
|
-
case 'filterBuildOutput':
|
|
119
|
-
output.filterBuildOutput = !output.filterBuildOutput;
|
|
120
|
-
break;
|
|
121
|
-
case 'compactGitOutput':
|
|
122
|
-
output.compactGitOutput = !output.compactGitOutput;
|
|
123
|
-
break;
|
|
124
|
-
case 'aggregateLinterOutput':
|
|
125
|
-
output.aggregateLinterOutput = !output.aggregateLinterOutput;
|
|
126
|
-
break;
|
|
127
|
-
case 'groupSearchOutput':
|
|
128
|
-
output.groupSearchOutput = !output.groupSearchOutput;
|
|
129
|
-
break;
|
|
130
|
-
case 'smartTruncate':
|
|
131
|
-
output.smartTruncate.enabled = !output.smartTruncate.enabled;
|
|
132
|
-
break;
|
|
133
|
-
case 'truncate':
|
|
134
|
-
output.truncate.enabled = !output.truncate.enabled;
|
|
135
|
-
break;
|
|
136
|
-
case 'trackSavings':
|
|
137
|
-
output.trackSavings = !output.trackSavings;
|
|
138
|
-
break;
|
|
139
|
-
case 'sourceFiltering': {
|
|
140
|
-
const selected = await ctx.ui.select('Read source filtering', ['none', 'minimal', 'aggressive']);
|
|
141
|
-
if (!selected)
|
|
142
|
-
return undefined;
|
|
143
|
-
output.sourceCodeFiltering = selected;
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
case 'smartTruncateMaxLines': {
|
|
147
|
-
const selected = await ctx.ui.select('Read smart-truncation maximum lines', [
|
|
148
|
-
'40',
|
|
149
|
-
'80',
|
|
150
|
-
'120',
|
|
151
|
-
'160',
|
|
152
|
-
'220',
|
|
153
|
-
'320',
|
|
154
|
-
'500',
|
|
155
|
-
'1000',
|
|
156
|
-
'2000',
|
|
157
|
-
'4000',
|
|
158
|
-
]);
|
|
159
|
-
if (!selected)
|
|
160
|
-
return undefined;
|
|
161
|
-
output.smartTruncate.maxLines = Number.parseInt(selected, 10);
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
case 'truncateMaxChars': {
|
|
165
|
-
const selected = await ctx.ui.select('Hard-truncation maximum characters', [
|
|
166
|
-
'4000',
|
|
167
|
-
'8000',
|
|
168
|
-
'12000',
|
|
169
|
-
'20000',
|
|
170
|
-
'50000',
|
|
171
|
-
'100000',
|
|
172
|
-
'200000',
|
|
173
|
-
]);
|
|
174
|
-
if (!selected)
|
|
175
|
-
return undefined;
|
|
176
|
-
output.truncate.maxChars = Number.parseInt(selected, 10);
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return next;
|
|
181
|
-
}
|
|
182
|
-
async function saveConfig(ctx, controller, config) {
|
|
183
|
-
try {
|
|
184
|
-
await controller.setConfig(config);
|
|
185
|
-
return true;
|
|
186
|
-
}
|
|
187
|
-
catch (error) {
|
|
188
|
-
ctx.ui.notify(`Failed to save RTK settings: ${errorMessage(error)}`, 'error');
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
function settingChoices(config) {
|
|
193
|
-
const output = config.outputCompaction;
|
|
194
|
-
return [
|
|
195
|
-
setting('enabled', 'Optimizer enabled', onOff(config.enabled)),
|
|
196
|
-
setting('mode', 'Rewrite mode', config.mode),
|
|
197
|
-
setting('guardWhenRtkMissing', 'Guard when RTK is missing', onOff(config.guardWhenRtkMissing)),
|
|
198
|
-
setting('showRewriteNotifications', 'Rewrite notifications', onOff(config.showRewriteNotifications)),
|
|
199
|
-
setting('compactionEnabled', 'Output compaction', onOff(output.enabled)),
|
|
200
|
-
setting('stripAnsi', 'Strip ANSI', onOff(output.stripAnsi)),
|
|
201
|
-
setting('readCompaction', 'Lossy read compaction', onOff(output.readCompaction.enabled)),
|
|
202
|
-
setting('sourceFilteringEnabled', 'Read source filtering', onOff(output.sourceCodeFilteringEnabled)),
|
|
203
|
-
setting('sourceFiltering', 'Read source-filter level', output.sourceCodeFiltering),
|
|
204
|
-
setting('preserveExactSkillReads', 'Preserve exact skill reads', onOff(output.preserveExactSkillReads)),
|
|
205
|
-
setting('aggregateTestOutput', 'Aggregate test output', onOff(output.aggregateTestOutput)),
|
|
206
|
-
setting('filterBuildOutput', 'Filter build output', onOff(output.filterBuildOutput)),
|
|
207
|
-
setting('compactGitOutput', 'Compact Git output', onOff(output.compactGitOutput)),
|
|
208
|
-
setting('aggregateLinterOutput', 'Aggregate linter output', onOff(output.aggregateLinterOutput)),
|
|
209
|
-
setting('groupSearchOutput', 'Group search output', onOff(output.groupSearchOutput)),
|
|
210
|
-
setting('smartTruncate', 'Read smart truncation', onOff(output.smartTruncate.enabled)),
|
|
211
|
-
setting('smartTruncateMaxLines', 'Read smart-truncation lines', String(output.smartTruncate.maxLines)),
|
|
212
|
-
setting('truncate', 'Hard truncation', onOff(output.truncate.enabled)),
|
|
213
|
-
setting('truncateMaxChars', 'Hard-truncation characters', String(output.truncate.maxChars)),
|
|
214
|
-
setting('trackSavings', 'Track savings', onOff(output.trackSavings)),
|
|
215
|
-
];
|
|
216
|
-
}
|
|
217
|
-
function setting(id, name, value) {
|
|
218
|
-
return { id, label: `${name}: ${value}` };
|
|
219
|
-
}
|
|
220
|
-
function onOff(value) {
|
|
221
|
-
return value ? 'on' : 'off';
|
|
222
|
-
}
|
|
223
67
|
function formatSummary(config, status) {
|
|
224
68
|
const runtime = status.rtkAvailable
|
|
225
69
|
? `available${status.version ? ` (${status.version})` : ''}`
|
package/dist/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAYA,MAAM,KAAK,GAAG,0DAA0D,CAAC;AACzE,MAAM,WAAW,GAAG;IAClB,CAAC,MAAM,EAAE,mDAAmD,CAAC;IAC7D,CAAC,QAAQ,EAAE,+CAA+C,CAAC;IAC3D,CAAC,SAAS,EAAE,uCAAuC,CAAC;IACpD,CAAC,OAAO,EAAE,gCAAgC,CAAC;IAC3C,CAAC,aAAa,EAAE,iCAAiC,CAAC;IAClD,CAAC,MAAM,EAAE,oBAAoB,CAAC;CACtB,CAAC;AAEX,MAAM,UAAU,kBAAkB,CAAC,EAAqB,EAAE,UAAkC;IAC1F,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE;QACxB,WAAW,EAAE,+CAA+C;QAC5D,sBAAsB,EAAE,CAAC,MAAM,EAAE,EAAE;YACjC,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,CAAC;YACpD,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YAC1C,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;YAC5E,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC;gBACzB,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;QACxF,CAAC;QACD,O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