@krtclcdy/tersio 2.4.0 → 2.4.1
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,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { dirname, join } from 'node:path';
|
|
4
|
-
import { asPromptArray, getSharedComboState, isComboPresetActive, isOmpSubagentPrompt, lastCustomValue, normalizeInputCommand, normalizeMode, paintStatusBar, reconcileSharedComboEntries, sessionEntries, setSharedComboMode } from '../shared/session-state.js';
|
|
4
|
+
import { activeModesSummary, asPromptArray, getSharedComboState, isComboPresetActive, isOmpSubagentPrompt, lastCustomValue, normalizeInputCommand, normalizeMode, paintStatusBar, reconcileSharedComboEntries, sessionEntries, setSharedComboMode } from '../shared/session-state.js';
|
|
5
5
|
import { readCavemanDefault } from '../shared/plugin-settings.js';
|
|
6
6
|
const CAVERN_DIR = dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
const RULE_PATH = join(CAVERN_DIR, 'rule.md');
|
|
@@ -66,7 +66,10 @@ export default function cavemanSessionExtension(pi) {
|
|
|
66
66
|
pi.appendEntry?.('caveman-mode', { mode: normalized });
|
|
67
67
|
setSharedComboMode('caveman', normalized);
|
|
68
68
|
syncStatus(ctx);
|
|
69
|
-
const
|
|
69
|
+
const active = activeModesSummary(getSharedComboState());
|
|
70
|
+
const msg = normalized === 'off'
|
|
71
|
+
? `Caveman off. Active: ${active}.`
|
|
72
|
+
: `Caveman ${normalized} on — terse replies for this session. Active: ${active}.`;
|
|
70
73
|
ctx?.ui?.notify?.(msg, 'info');
|
|
71
74
|
return true;
|
|
72
75
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { createRequire } from 'node:module';
|
|
6
|
-
import { asPromptArray, COMBO_LEVELS, getSharedComboState, isComboPresetActive, isOmpSubagentPrompt, normalizeComboLevel, reconcileSharedComboEntries, sessionEntries, setSharedComboLevel, setSharedComboListener, systemPromptIncludes, } from '../shared/session-state.js';
|
|
6
|
+
import { activeModesSummary, asPromptArray, COMBO_LEVELS, getSharedComboState, isComboPresetActive, isOmpSubagentPrompt, normalizeComboLevel, reconcileSharedComboEntries, sessionEntries, setSharedComboLevel, setSharedComboListener, systemPromptIncludes, } from '../shared/session-state.js';
|
|
7
7
|
import { readComboDefault } from '../shared/plugin-settings.js';
|
|
8
8
|
const require = createRequire(import.meta.url);
|
|
9
9
|
const PONYTAIL_FALLBACK_INTENSITY = {
|
|
@@ -110,7 +110,8 @@ export default function comboToggleExtension(pi) {
|
|
|
110
110
|
}
|
|
111
111
|
persistPreset(level);
|
|
112
112
|
useState(setSharedComboLevel(level), ctx);
|
|
113
|
-
|
|
113
|
+
const active = activeModesSummary(getSharedComboState());
|
|
114
|
+
ctx?.ui?.notify?.(level === 'off' ? `Combo off — all tersio modes inactive for this session. Active: ${active}.` : `Combo ${level} on — ${active} active for this session.`, 'info');
|
|
114
115
|
if (ctx?.reload)
|
|
115
116
|
await ctx.reload();
|
|
116
117
|
},
|
|
@@ -126,7 +127,7 @@ export default function comboToggleExtension(pi) {
|
|
|
126
127
|
if (fallback !== 'off') {
|
|
127
128
|
persistPreset(fallback);
|
|
128
129
|
useState(setSharedComboLevel(fallback), ctx);
|
|
129
|
-
ctx?.ui?.notify?.(`Combo default applied: ${fallback}
|
|
130
|
+
ctx?.ui?.notify?.(`Combo default applied: ${fallback} — ${activeModesSummary(getSharedComboState())} active for this session.`, 'info');
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { asPromptArray, getSharedComboState, isComboPresetActive, isOmpSubagentPrompt, lastCustomValue, normalizeInputCommand, paintStatusBar, reconcileSharedComboEntries, sessionEntries, setSharedComboMode } from '../shared/session-state.js';
|
|
3
|
+
import { activeModesSummary, asPromptArray, getSharedComboState, isComboPresetActive, isOmpSubagentPrompt, lastCustomValue, normalizeInputCommand, paintStatusBar, reconcileSharedComboEntries, sessionEntries, setSharedComboMode } from '../shared/session-state.js';
|
|
4
4
|
import { readRtkDefault } from '../shared/plugin-settings.js';
|
|
5
5
|
const DEFAULT_ENABLED = false;
|
|
6
6
|
function asBoolean(value) {
|
|
@@ -44,7 +44,8 @@ export default function rtkSessionExtension(pi) {
|
|
|
44
44
|
pi.appendEntry?.('rtk-mode', { enabled });
|
|
45
45
|
setSharedComboMode('rtk', enabled);
|
|
46
46
|
syncStatus(ctx);
|
|
47
|
-
|
|
47
|
+
const active = activeModesSummary(getSharedComboState());
|
|
48
|
+
ctx?.ui?.notify?.(enabled ? `RTK on — compact shell output for this session. Active: ${active}.` : `RTK off. Active: ${active}.`, 'info');
|
|
48
49
|
}
|
|
49
50
|
pi.setLabel?.('RTK session toggle');
|
|
50
51
|
pi.registerCommand?.('rtk', {
|
|
@@ -36,9 +36,6 @@ function isPresetLevel(value) {
|
|
|
36
36
|
function isKnownLevel(value) {
|
|
37
37
|
return value === 'custom' || isPresetLevel(value);
|
|
38
38
|
}
|
|
39
|
-
function levelForIndividualModes(modes) {
|
|
40
|
-
return modes.caveman === 'off' && modes.rtk === 'off' && modes.ponytail === 'off' ? 'off' : 'custom';
|
|
41
|
-
}
|
|
42
39
|
function normalizedState(modes, level = deriveLevel(modes)) {
|
|
43
40
|
const state = {
|
|
44
41
|
caveman: normalizeMode('caveman', modes?.caveman) || 'off',
|
|
@@ -115,21 +112,21 @@ export function setSharedComboMode(name, value) {
|
|
|
115
112
|
if (!mode)
|
|
116
113
|
return getSharedComboState();
|
|
117
114
|
const modes = { ...getSharedComboState(), [name]: mode };
|
|
118
|
-
|
|
115
|
+
// Derive the level from the final triplet so a redundant same-value write
|
|
116
|
+
// (entry replay on resume, upstream ponytail re-affirming its mode) cannot
|
|
117
|
+
// strand a matching preset at 'custom' and drop the combo bar.
|
|
118
|
+
return publish(normalizedState(modes));
|
|
119
119
|
}
|
|
120
120
|
export function reconcileSharedComboEntries(entries) {
|
|
121
121
|
let modes = { ...COMBO_LEVELS.off };
|
|
122
|
-
let level = 'off';
|
|
123
122
|
if (Array.isArray(entries)) {
|
|
124
123
|
for (const entry of entries) {
|
|
125
124
|
if (entry?.type !== 'custom')
|
|
126
125
|
continue;
|
|
127
126
|
if (entry.customType === 'combo-level') {
|
|
128
127
|
const preset = normalizeComboLevel(entry?.data?.level);
|
|
129
|
-
if (preset)
|
|
128
|
+
if (preset)
|
|
130
129
|
modes = { ...COMBO_LEVELS[preset] };
|
|
131
|
-
level = preset;
|
|
132
|
-
}
|
|
133
130
|
continue;
|
|
134
131
|
}
|
|
135
132
|
const name = MODE_ENTRY_TYPES[entry.customType ?? ''] ?? null;
|
|
@@ -137,13 +134,18 @@ export function reconcileSharedComboEntries(entries) {
|
|
|
137
134
|
continue;
|
|
138
135
|
const value = name === 'rtk' ? entry?.data?.enabled : entry?.data?.mode;
|
|
139
136
|
const mode = normalizeMode(name, value);
|
|
140
|
-
if (mode)
|
|
137
|
+
if (mode)
|
|
141
138
|
modes[name] = mode;
|
|
142
|
-
level = levelForIndividualModes(modes);
|
|
143
|
-
}
|
|
144
139
|
}
|
|
145
140
|
}
|
|
146
|
-
|
|
141
|
+
// The level always reflects the final mode triplet, never the write order:
|
|
142
|
+
// a preset entry followed by the same values reconciles back to the preset.
|
|
143
|
+
return publish(normalizedState(modes));
|
|
144
|
+
}
|
|
145
|
+
// One-line session-wide mode summary for change confirmations, e.g.
|
|
146
|
+
// `caveman=ULTRA, rtk=ON, ponytail=ULTRA`.
|
|
147
|
+
export function activeModesSummary(state) {
|
|
148
|
+
return `caveman=${state.caveman.toUpperCase()}, rtk=${state.rtk.toUpperCase()}, ponytail=${state.ponytail.toUpperCase()}`;
|
|
147
149
|
}
|
|
148
150
|
export function setSharedComboListener(listener) {
|
|
149
151
|
bridge().listener = typeof listener === 'function' ? listener : null;
|
package/package.json
CHANGED