@aiwayds/dsh-tui-pi 0.1.1 → 0.4.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/README.md +175 -41
- package/lib/agent-manager.d.ts +125 -0
- package/lib/agent-manager.js +298 -0
- package/lib/agent-manager.js.map +1 -0
- package/lib/agents.d.ts +30 -0
- package/lib/agents.js +489 -0
- package/lib/agents.js.map +1 -0
- package/lib/append-system.d.ts +2 -0
- package/lib/append-system.js +1 -1
- package/lib/append-system.js.map +1 -1
- package/lib/dsh-events.d.ts +12 -0
- package/lib/editor.d.ts +58 -0
- package/lib/editor.js +92 -0
- package/lib/editor.js.map +1 -1
- package/lib/footer.d.ts +46 -0
- package/lib/footer.js +65 -0
- package/lib/footer.js.map +1 -1
- package/lib/hotkeys.d.ts +93 -0
- package/lib/hotkeys.js +305 -0
- package/lib/hotkeys.js.map +1 -0
- package/lib/index.js +342 -61
- package/lib/index.js.map +1 -1
- package/lib/keymap.d.ts +243 -0
- package/lib/keymap.js +245 -0
- package/lib/keymap.js.map +1 -0
- package/lib/live-widgets.d.ts +59 -49
- package/lib/live-widgets.js +174 -117
- package/lib/live-widgets.js.map +1 -1
- package/lib/panels.d.ts +177 -0
- package/lib/panels.js +331 -0
- package/lib/panels.js.map +1 -0
- package/lib/selectors.d.ts +12 -1
- package/lib/selectors.js +1 -1
- package/lib/selectors.js.map +1 -1
- package/lib/session.d.ts +25 -0
- package/lib/session.js +173 -12
- package/lib/session.js.map +1 -1
- package/lib/settings.d.ts +1 -2
- package/lib/subagent-policy.d.ts +88 -0
- package/lib/subagent-policy.js +189 -0
- package/lib/subagent-policy.js.map +1 -0
- package/lib/subagent-viewer.d.ts +49 -0
- package/lib/subagent-viewer.js +523 -0
- package/lib/subagent-viewer.js.map +1 -0
- package/lib/theme/index.js +4 -0
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/palette.d.ts +21 -3
- package/lib/theme/palette.js +27 -6
- package/lib/theme/palette.js.map +1 -1
- package/lib/theme-settings.d.ts +71 -9
- package/lib/theme-settings.js +145 -21
- package/lib/theme-settings.js.map +1 -1
- package/lib/tui.d.ts +23 -9
- package/lib/tui.js +110 -7
- package/lib/tui.js.map +1 -1
- package/package.json +3 -4
- package/patches/@earendil-works__pi-tui.patch +206 -2
- package/scripts/dev-install.mjs +87 -0
- package/scripts/link-dsh-closure.mjs +85 -0
- package/templates/agents/ArtyDuck.md +11 -0
- package/templates/agents/oldfox.md +33 -0
- package/templates/agents/workhorse.md +34 -0
package/lib/hotkeys.js
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/hotkeys` — view and customize the app-level keybindings, in the /agents
|
|
3
|
+
* select-panel style (src/panels.ts).
|
|
4
|
+
*
|
|
5
|
+
* pi's convention is a `/hotkeys` command plus a user-editable
|
|
6
|
+
* `~/.pi/agent/keybindings.json`. dsh side: `$DSH_HOME/keybindings.json`
|
|
7
|
+
* (default `~/.dsh/keybindings.json`). The file is a PARTIAL map of the four
|
|
8
|
+
* app keys ({@link APP_KEY_FIELDS}) to pi-tui key ids; anything missing falls
|
|
9
|
+
* back to the defaults (`src/keymap.ts`).
|
|
10
|
+
*
|
|
11
|
+
* UI (mirrors `/agents`): a FieldPanel lists the app keys — binding, custom
|
|
12
|
+
* star, action, file path + warnings; Enter opens an EditField to type a new
|
|
13
|
+
* key id (empty input resets the key to its default). A commit writes the
|
|
14
|
+
* file AND live-applies the new bindings to the running TUI (no /reload
|
|
15
|
+
* needed). Invalid entries never block: they warn and keep the default.
|
|
16
|
+
*
|
|
17
|
+
* The decision logic stays in `keymap.ts` (pure); this module owns the file
|
|
18
|
+
* contract, the validation, the display table and the interactive flow.
|
|
19
|
+
*/
|
|
20
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
21
|
+
import { basename, join } from 'node:path';
|
|
22
|
+
import { DEFAULT_KEYBINDINGS } from "./keymap.js";
|
|
23
|
+
import { FieldPanel, PanelHost } from "./panels.js";
|
|
24
|
+
import { EditField } from "./settings.js";
|
|
25
|
+
import { ansiFg, BOLD, RESET } from "./theme/index.js";
|
|
26
|
+
/** The user-editable keybindings file name inside the dsh home. */
|
|
27
|
+
export const KEYBINDINGS_FILE = 'keybindings.json';
|
|
28
|
+
/** Absolute path of the keybindings file under a dsh home directory. */
|
|
29
|
+
export function keybindingsPath(home) {
|
|
30
|
+
return join(home, KEYBINDINGS_FILE);
|
|
31
|
+
}
|
|
32
|
+
/** The five app-level bindings the file may remap (order = display order). */
|
|
33
|
+
export const APP_KEY_FIELDS = ['escape', 'ctrlC', 'ctrlD', 'modelPicker', 'subagentViewer'];
|
|
34
|
+
/** Action descriptions for the `/hotkeys` table. */
|
|
35
|
+
const KEY_ACTIONS = {
|
|
36
|
+
escape: 'stop the current task — requires two presses (1st arms, 2nd within 500ms fires)',
|
|
37
|
+
ctrlC: 'running: cancel turn · idle: clear editor · second press quits',
|
|
38
|
+
ctrlD: 'quit — only on an empty editor',
|
|
39
|
+
modelPicker: 'open the model / think picker',
|
|
40
|
+
subagentViewer: 'open the subagent picker / viewer',
|
|
41
|
+
};
|
|
42
|
+
// ------------------------------------------------------------- validation --
|
|
43
|
+
const MODIFIERS = new Set(['ctrl', 'shift', 'alt', 'super']);
|
|
44
|
+
const NAMED_KEYS = new Set([
|
|
45
|
+
'escape', 'esc', 'enter', 'return', 'tab', 'space', 'backspace', 'delete',
|
|
46
|
+
'insert', 'home', 'end', 'pageup', 'pagedown', 'up', 'down', 'left',
|
|
47
|
+
'right', 'clear',
|
|
48
|
+
]);
|
|
49
|
+
/**
|
|
50
|
+
* Conservative check of one pi-tui key id as a user might type it:
|
|
51
|
+
* `modifier+key` where every modifier is ctrl/shift/alt/super and the key is
|
|
52
|
+
* a named key (`escape`, `pageUp`, `f5`, …) or a single printable character.
|
|
53
|
+
* pi-tui's own `parseKeyId` is lenient (unknown ids just never match), so we
|
|
54
|
+
* reject obvious typos up front and let a warning surface them.
|
|
55
|
+
*/
|
|
56
|
+
export function isValidKeyId(value) {
|
|
57
|
+
if (typeof value !== 'string' || value === '' || value !== value.trim())
|
|
58
|
+
return false;
|
|
59
|
+
const parts = value.toLowerCase().split('+');
|
|
60
|
+
const key = parts[parts.length - 1];
|
|
61
|
+
if (key === '')
|
|
62
|
+
return false;
|
|
63
|
+
for (const modifier of parts.slice(0, -1)) {
|
|
64
|
+
if (!MODIFIERS.has(modifier))
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (/^f([1-9]|1[0-9]|2[0-4])$/.test(key))
|
|
68
|
+
return true;
|
|
69
|
+
if (NAMED_KEYS.has(key))
|
|
70
|
+
return true;
|
|
71
|
+
return [...key].length === 1;
|
|
72
|
+
}
|
|
73
|
+
/** Human display of a key id: `escape`→`Esc`, `ctrl+shift+p`→`Ctrl+Shift+P`. */
|
|
74
|
+
export function displayKey(id) {
|
|
75
|
+
const parts = id.split('+');
|
|
76
|
+
const modifiers = parts.slice(0, -1).map(m => m[0].toUpperCase() + m.slice(1));
|
|
77
|
+
const last = parts[parts.length - 1];
|
|
78
|
+
const key = last === 'escape' || last === 'esc'
|
|
79
|
+
? 'Esc'
|
|
80
|
+
: last.length === 1
|
|
81
|
+
? last.toUpperCase()
|
|
82
|
+
: last.charAt(0).toUpperCase() + last.slice(1);
|
|
83
|
+
return [...modifiers, key].join('+');
|
|
84
|
+
}
|
|
85
|
+
const EMPTY = { bindings: {}, warnings: [], exists: false };
|
|
86
|
+
/** Read + validate `$DSH_HOME/keybindings.json`. Never throws. */
|
|
87
|
+
export function loadKeyBindings(path) {
|
|
88
|
+
let text;
|
|
89
|
+
try {
|
|
90
|
+
text = readFileSync(path, 'utf8');
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return EMPTY;
|
|
94
|
+
}
|
|
95
|
+
const label = basename(path);
|
|
96
|
+
let raw;
|
|
97
|
+
try {
|
|
98
|
+
raw = JSON.parse(text);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
return { bindings: {}, warnings: [`${label}: invalid JSON — ${error.message}`], exists: true };
|
|
102
|
+
}
|
|
103
|
+
if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
104
|
+
return { bindings: {}, warnings: [`${label}: expected a JSON object of app-key → key id`], exists: true };
|
|
105
|
+
}
|
|
106
|
+
const record = raw;
|
|
107
|
+
const bindings = {};
|
|
108
|
+
const warnings = [];
|
|
109
|
+
for (const field of APP_KEY_FIELDS) {
|
|
110
|
+
const value = record[field];
|
|
111
|
+
if (value === undefined)
|
|
112
|
+
continue;
|
|
113
|
+
if (!isValidKeyId(value)) {
|
|
114
|
+
warnings.push(`${label}: "${field}" = ${JSON.stringify(value)} is not a valid key id — keeping the default`);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
bindings[field] = value;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
for (const field of Object.keys(record)) {
|
|
121
|
+
if (!APP_KEY_FIELDS.includes(field)) {
|
|
122
|
+
warnings.push(`${label}: unknown field "${field}" — ignored`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return { bindings, warnings, exists: true };
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Merge-write the keybindings file: each `[field, value]` sets a binding,
|
|
129
|
+
* `null` removes it (reset to default). Unknown fields already in the file
|
|
130
|
+
* are preserved (the user's other keys survive). Missing file → fresh object;
|
|
131
|
+
* an unreadable/broken EXISTING file is an error — never clobbered silently.
|
|
132
|
+
* Returns an error message, or `undefined` on success.
|
|
133
|
+
*/
|
|
134
|
+
export function updateKeyBindingsFile(path, updates) {
|
|
135
|
+
const label = basename(path);
|
|
136
|
+
const existing = {};
|
|
137
|
+
let fileExisted = false;
|
|
138
|
+
try {
|
|
139
|
+
const text = readFileSync(path, 'utf8');
|
|
140
|
+
fileExisted = true;
|
|
141
|
+
const parsed = JSON.parse(text);
|
|
142
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
143
|
+
return `${label}: expected a JSON object — fix or delete the file, then retry`;
|
|
144
|
+
}
|
|
145
|
+
Object.assign(existing, parsed);
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
if (fileExisted)
|
|
149
|
+
return `${label}: ${error.message} — fix or delete the file, then retry`;
|
|
150
|
+
// Absent file: start fresh.
|
|
151
|
+
}
|
|
152
|
+
for (const [field, value] of updates) {
|
|
153
|
+
if (value === null)
|
|
154
|
+
delete existing[field];
|
|
155
|
+
else
|
|
156
|
+
existing[field] = value;
|
|
157
|
+
}
|
|
158
|
+
try {
|
|
159
|
+
writeFileSync(path, JSON.stringify(existing, null, 2) + '\n');
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
return `${label}: cannot write — ${error.message}`;
|
|
163
|
+
}
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
/** The `/hotkeys` EditField parse: empty = reset, else a validated key id. */
|
|
167
|
+
export function parseKeyInput(text) {
|
|
168
|
+
const trimmed = text.trim();
|
|
169
|
+
if (trimmed === '')
|
|
170
|
+
return { kind: 'unset' };
|
|
171
|
+
if (!isValidKeyId(trimmed)) {
|
|
172
|
+
return { kind: 'error', error: `not a key id — ctrl/shift/alt/super + key (e.g. ctrl+x, f5, escape)` };
|
|
173
|
+
}
|
|
174
|
+
return { kind: 'value', value: trimmed };
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Build the app-key rows from the effective bindings — defaults, with any
|
|
178
|
+
* file override replacing the key display and flagging the row as custom.
|
|
179
|
+
* Pure, so the table content is unit-testable without a terminal.
|
|
180
|
+
*/
|
|
181
|
+
export function appHotkeyRows(custom) {
|
|
182
|
+
return APP_KEY_FIELDS.map(field => {
|
|
183
|
+
const override = custom[field];
|
|
184
|
+
return {
|
|
185
|
+
field,
|
|
186
|
+
key: displayKey(override ?? DEFAULT_KEYBINDINGS[field]),
|
|
187
|
+
action: KEY_ACTIONS[field],
|
|
188
|
+
custom: override !== undefined,
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Open the `/hotkeys` manager: a FieldPanel of the five app keys (binding,
|
|
194
|
+
* custom star, action, file status + warnings), Enter opens an EditField that
|
|
195
|
+
* writes the file and live-applies the change. Resolves with a summary when
|
|
196
|
+
* the user changed something and closed, or `undefined` when nothing changed.
|
|
197
|
+
*/
|
|
198
|
+
export async function openHotkeysManager(tui, theme, options) {
|
|
199
|
+
let changed = false;
|
|
200
|
+
/** Live status line of the FieldPanel (last commit result). */
|
|
201
|
+
let status;
|
|
202
|
+
/** Settles the manager promise (assigned inside the executor below). */
|
|
203
|
+
let settle;
|
|
204
|
+
const host = new PanelHost(tui, theme, message => {
|
|
205
|
+
options.restoreFocus();
|
|
206
|
+
settle?.(`✘ failed to open the hotkeys view: ${message}`);
|
|
207
|
+
});
|
|
208
|
+
/** Re-read the file after a write and push the change into the running TUI. */
|
|
209
|
+
const applyBindings = () => {
|
|
210
|
+
const loaded = loadKeyBindings(options.filePath);
|
|
211
|
+
options.apply(loaded.bindings);
|
|
212
|
+
};
|
|
213
|
+
/** Rebuild the field panel from the current file state. */
|
|
214
|
+
const show = () => {
|
|
215
|
+
const loaded = loadKeyBindings(options.filePath);
|
|
216
|
+
const fields = appHotkeyRows(loaded.bindings).map(row => ({
|
|
217
|
+
key: row.field,
|
|
218
|
+
value: `${row.key}${row.custom ? '*' : ''} — ${row.action}`,
|
|
219
|
+
editable: true,
|
|
220
|
+
}));
|
|
221
|
+
const customCount = Object.keys(loaded.bindings).length;
|
|
222
|
+
const content = [
|
|
223
|
+
loaded.exists
|
|
224
|
+
? `custom: ${options.filePath} (${customCount} override${customCount === 1 ? '' : 's'})`
|
|
225
|
+
: `custom: ${options.filePath} (not found — defaults in use)`,
|
|
226
|
+
'format: ctrl/shift/alt/super+key · Enter edits · empty input resets to the default',
|
|
227
|
+
'editor: pi-tui defaults — arrows · Ctrl+B/F · Alt+←→ word · Home/End · Ctrl+W/U/K delete · Ctrl+- undo',
|
|
228
|
+
...loaded.warnings.map(warning => `! ${warning}`),
|
|
229
|
+
];
|
|
230
|
+
const panel = new FieldPanel(theme, {
|
|
231
|
+
title: ansiFg(theme.palette.accent) + BOLD + '⚙ hotkeys' + RESET,
|
|
232
|
+
content,
|
|
233
|
+
fields,
|
|
234
|
+
status: () => status,
|
|
235
|
+
footer: '↑↓ key · Enter change · Esc close',
|
|
236
|
+
onEdit: index => edit(fields[index].key),
|
|
237
|
+
onCancel: () => {
|
|
238
|
+
host.close();
|
|
239
|
+
options.restoreFocus();
|
|
240
|
+
resolve(changed ? 'Keybindings updated.' : undefined);
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
host.open(panel);
|
|
244
|
+
};
|
|
245
|
+
const resolve = (value) => {
|
|
246
|
+
settle?.(value);
|
|
247
|
+
};
|
|
248
|
+
/** EditField for one app key: type a key id, empty = reset to default. */
|
|
249
|
+
const edit = (field) => {
|
|
250
|
+
const loaded = loadKeyBindings(options.filePath);
|
|
251
|
+
const current = loaded.bindings[field];
|
|
252
|
+
const editor = new EditField(tui, {
|
|
253
|
+
title: `Key for ${field} — default ${displayKey(DEFAULT_KEYBINDINGS[field])}`
|
|
254
|
+
+ (current !== undefined ? ` · custom ${displayKey(current)}` : ''),
|
|
255
|
+
subtitle: 'ctrl/shift/alt/super + key · empty resets to the default',
|
|
256
|
+
initial: current ?? '',
|
|
257
|
+
parse: parseKeyInput,
|
|
258
|
+
onCommit: async (outcome) => {
|
|
259
|
+
if (outcome.kind === 'value') {
|
|
260
|
+
const id = outcome.value;
|
|
261
|
+
// Writing the default is a reset: keep the file minimal.
|
|
262
|
+
const reset = id === DEFAULT_KEYBINDINGS[field];
|
|
263
|
+
const fresh = loadKeyBindings(options.filePath);
|
|
264
|
+
if (reset && fresh.bindings[field] === undefined)
|
|
265
|
+
return undefined; // already default — no write
|
|
266
|
+
const error = updateKeyBindingsFile(options.filePath, [[field, reset ? null : id]]);
|
|
267
|
+
if (error !== undefined)
|
|
268
|
+
return { error };
|
|
269
|
+
changed = true;
|
|
270
|
+
applyBindings();
|
|
271
|
+
status = reset
|
|
272
|
+
? `${field} → default (${displayKey(DEFAULT_KEYBINDINGS[field])}) — applied`
|
|
273
|
+
: `${field} → ${id} — applied`;
|
|
274
|
+
return undefined;
|
|
275
|
+
}
|
|
276
|
+
if (outcome.kind === 'unset') {
|
|
277
|
+
const fresh = loadKeyBindings(options.filePath);
|
|
278
|
+
if (fresh.bindings[field] === undefined)
|
|
279
|
+
return undefined; // nothing custom to reset
|
|
280
|
+
const error = updateKeyBindingsFile(options.filePath, [[field, null]]);
|
|
281
|
+
if (error !== undefined)
|
|
282
|
+
return { error };
|
|
283
|
+
changed = true;
|
|
284
|
+
applyBindings();
|
|
285
|
+
status = `${field} → default (${displayKey(DEFAULT_KEYBINDINGS[field])}) — applied`;
|
|
286
|
+
return undefined;
|
|
287
|
+
}
|
|
288
|
+
return undefined;
|
|
289
|
+
},
|
|
290
|
+
onDone: () => show(),
|
|
291
|
+
onError: message => {
|
|
292
|
+
status = `✘ ${message}`;
|
|
293
|
+
show();
|
|
294
|
+
},
|
|
295
|
+
}, theme);
|
|
296
|
+
host.open(editor);
|
|
297
|
+
};
|
|
298
|
+
return new Promise(resolve => {
|
|
299
|
+
settle = resolve;
|
|
300
|
+
// First render inside the executor: a synchronous showOverlay failure in
|
|
301
|
+
// the initial show() must be able to settle the promise through settle.
|
|
302
|
+
show();
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=hotkeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hotkeys.js","sourceRoot":"","sources":["../src/hotkeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW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