@krtclcdy/tersio 2.22.1 → 2.23.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.
@@ -1,29 +0,0 @@
1
- import { asPromptArray, reconcileSharedComboEntries, sessionEntries, systemPromptIncludes } from './session-state.ts';
2
- import type { ExtensionApi, SystemPromptEvent } from './types.ts';
3
-
4
- const MARKER = 'SUPREME TOKEN SAVER MODES ACTIVE';
5
-
6
- function instruction(state: { caveman: string; rtk: string; ponytail: string }): string | null {
7
- const modes = [
8
- state.caveman !== 'off' && `caveman=${state.caveman}`,
9
- state.rtk === 'on' && 'rtk=on',
10
- state.ponytail !== 'off' && `ponytail=${state.ponytail}`,
11
- ].filter(Boolean);
12
- if (!modes.length) return null;
13
-
14
- return `${MARKER}: ${modes.join(' · ')}. Keep these active for the entire response: concise Caveman prose, RTK for eligible noisy shell output, and the smallest correct Ponytail solution. Do not weaken or disable a mode unless the user explicitly asks.`;
15
- }
16
-
17
- export default function modeReinforcementExtension(pi: ExtensionApi): void {
18
- pi.setLabel?.('Tersio mode reinforcement');
19
-
20
- pi.on('before_agent_start', async (event: SystemPromptEvent, ctx) => {
21
- if (!ctx?.hasUI) return;
22
- const text = instruction(reconcileSharedComboEntries(sessionEntries(ctx)));
23
- if (!text) return;
24
-
25
- const base = asPromptArray(event.systemPrompt);
26
- if (systemPromptIncludes(base, MARKER)) return;
27
- return { systemPrompt: [...base, text] };
28
- });
29
- }