@xynogen/pix-optimizer 1.1.27 → 1.1.28
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/package.json +1 -1
- package/src/rtk.ts +7 -16
package/package.json
CHANGED
package/src/rtk.ts
CHANGED
|
@@ -90,15 +90,6 @@ export function applyRtkRewrite(
|
|
|
90
90
|
return true;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
const RTK_SYSTEM_PROMPT = `# RTK — token-optimized command wrapper
|
|
94
|
-
|
|
95
|
-
Prefix shell commands with \`rtk\` (e.g. \`rtk git status\`). RTK compacts output for git, gh, cargo, npm/pnpm/yarn/bun, tsc, lint, vitest/jest/playwright, docker, kubectl, ls, grep, prisma — and passes anything else through unchanged, so it's always safe.
|
|
96
|
-
|
|
97
|
-
Prefix EVERY segment in a chain, not just the first:
|
|
98
|
-
\`rtk git add . && rtk git commit -m "msg" && rtk git push\`
|
|
99
|
-
|
|
100
|
-
RTK also has filtering subcommands the auto-rewriter won't add — reach for these yourself when useful: \`rtk err <cmd>\` (errors only), \`rtk summary <cmd>\`, \`rtk log <file>\` (dedup), \`rtk json <file>\` (structure), \`rtk test <cmd>\` (failures only), \`rtk gain\` (savings stats).`;
|
|
101
|
-
|
|
102
93
|
// Commands that should be prefixed with rtk
|
|
103
94
|
const RTK_COMMANDS = new Set([
|
|
104
95
|
"git",
|
|
@@ -256,15 +247,15 @@ export function rtk(pi: ExtensionAPI, status: OptimizerStatus): OptimizerHandle
|
|
|
256
247
|
return rtkStatus;
|
|
257
248
|
};
|
|
258
249
|
|
|
259
|
-
//
|
|
260
|
-
|
|
261
|
-
|
|
250
|
+
// Detect sudo_run tool availability. No system-prompt injection — the
|
|
251
|
+
// tool_call rewrite hook adds the rtk prefix on its own, so we keep zero
|
|
252
|
+
// always-on context cost (ponytail: manual `rtk err`/`rtk summary`/`rtk
|
|
253
|
+
// test` subcommands are no longer advertised to the model; re-add a prompt
|
|
254
|
+
// here if you want those surfaced).
|
|
255
|
+
pi.on("before_agent_start", (event) => {
|
|
262
256
|
const tools: string[] = event.systemPromptOptions?.selectedTools ?? [];
|
|
263
257
|
hasSudoRunTool = tools.includes("sudo_run");
|
|
264
|
-
|
|
265
|
-
if (!enabled) return undefined;
|
|
266
|
-
const existing = event.systemPrompt ?? "";
|
|
267
|
-
return { systemPrompt: `${RTK_SYSTEM_PROMPT}\n\n${existing}` };
|
|
258
|
+
return undefined;
|
|
268
259
|
});
|
|
269
260
|
|
|
270
261
|
// Keep the status indicator in sync across the agent lifecycle. Probe
|