@agi-fans/dsh-tui 0.19.0 → 0.21.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/lib/CHANGELOG.md +173 -1
- package/lib/chrome/box.js +2 -12
- package/lib/chrome/box.js.map +1 -1
- package/lib/chrome/code-highlight.d.ts +26 -18
- package/lib/chrome/code-highlight.js +114 -39
- package/lib/chrome/code-highlight.js.map +1 -1
- package/lib/chrome/diff-render.d.ts +1 -2
- package/lib/chrome/diff-render.js +41 -90
- package/lib/chrome/diff-render.js.map +1 -1
- package/lib/chrome/main-screen-renderer.d.ts +6 -32
- package/lib/chrome/main-screen-renderer.js +68 -15
- package/lib/chrome/main-screen-renderer.js.map +1 -1
- package/lib/chrome/markdown.js +128 -93
- package/lib/chrome/markdown.js.map +1 -1
- package/lib/chrome/math.d.ts +4 -0
- package/lib/chrome/math.js +340 -0
- package/lib/chrome/math.js.map +1 -0
- package/lib/chrome/md-style.d.ts +3 -0
- package/lib/chrome/md-style.js.map +1 -1
- package/lib/chrome/mermaid.d.ts +6 -0
- package/lib/chrome/mermaid.js +56 -0
- package/lib/chrome/mermaid.js.map +1 -0
- package/lib/chrome/renderer.d.ts +12 -0
- package/lib/chrome/renderer.js +1 -1
- package/lib/chrome/renderer.js.map +1 -1
- package/lib/chrome/status-config.d.ts +5 -0
- package/lib/chrome/status-config.js +3 -0
- package/lib/chrome/status-config.js.map +1 -1
- package/lib/chrome/status-line.d.ts +0 -21
- package/lib/chrome/status-line.js +8 -65
- package/lib/chrome/status-line.js.map +1 -1
- package/lib/chrome/terminal-images.d.ts +31 -0
- package/lib/chrome/terminal-images.js +34 -0
- package/lib/chrome/terminal-images.js.map +1 -0
- package/lib/chrome/theme.d.ts +5 -6
- package/lib/chrome/theme.js +225 -136
- package/lib/chrome/theme.js.map +1 -1
- package/lib/chrome/tool-args.d.ts +1 -1
- package/lib/chrome/tool-args.js +3 -1
- package/lib/chrome/tool-args.js.map +1 -1
- package/lib/chrome/tool-renderers.d.ts +2 -0
- package/lib/chrome/tool-renderers.js +10 -0
- package/lib/chrome/tool-renderers.js.map +1 -1
- package/lib/chrome/welcome-tips.d.ts +1 -0
- package/lib/chrome/welcome-tips.js +4 -3
- package/lib/chrome/welcome-tips.js.map +1 -1
- package/lib/chrome/width.d.ts +7 -3
- package/lib/chrome/width.js +78 -14
- package/lib/chrome/width.js.map +1 -1
- package/lib/commands/advisor.d.ts +15 -0
- package/lib/commands/advisor.js +200 -0
- package/lib/commands/advisor.js.map +1 -0
- package/lib/commands/auth.d.ts +4 -2
- package/lib/commands/auth.js +317 -83
- package/lib/commands/auth.js.map +1 -1
- package/lib/commands/btw.d.ts +15 -0
- package/lib/commands/btw.js +126 -0
- package/lib/commands/btw.js.map +1 -0
- package/lib/commands/diff.js +171 -5
- package/lib/commands/diff.js.map +1 -1
- package/lib/commands/export.d.ts +1 -1
- package/lib/commands/export.js +57 -8
- package/lib/commands/export.js.map +1 -1
- package/lib/commands/files.d.ts +8 -0
- package/lib/commands/files.js +185 -0
- package/lib/commands/files.js.map +1 -0
- package/lib/commands/integrations.js +18 -6
- package/lib/commands/integrations.js.map +1 -1
- package/lib/commands/model.js +1 -0
- package/lib/commands/model.js.map +1 -1
- package/lib/commands/permission.js +35 -1
- package/lib/commands/permission.js.map +1 -1
- package/lib/commands/plugins.d.ts +8 -0
- package/lib/commands/plugins.js +195 -0
- package/lib/commands/plugins.js.map +1 -0
- package/lib/commands/rate.d.ts +33 -0
- package/lib/commands/rate.js +212 -0
- package/lib/commands/rate.js.map +1 -0
- package/lib/commands/schedule.d.ts +19 -0
- package/lib/commands/schedule.js +197 -0
- package/lib/commands/schedule.js.map +1 -0
- package/lib/commands/session-configuration.d.ts +5 -1
- package/lib/commands/session-configuration.js +75 -35
- package/lib/commands/session-configuration.js.map +1 -1
- package/lib/commands/session.js +111 -60
- package/lib/commands/session.js.map +1 -1
- package/lib/commands/steer.js +2 -2
- package/lib/commands/steer.js.map +1 -1
- package/lib/commands/terminal.d.ts +21 -0
- package/lib/commands/terminal.js +202 -0
- package/lib/commands/terminal.js.map +1 -0
- package/lib/commands/worktree.d.ts +5 -0
- package/lib/commands/worktree.js +103 -0
- package/lib/commands/worktree.js.map +1 -0
- package/lib/definition.d.ts +163 -10
- package/lib/definition.js.map +1 -1
- package/lib/input/clipboard.d.ts +12 -7
- package/lib/input/clipboard.js +79 -20
- package/lib/input/clipboard.js.map +1 -1
- package/lib/input/composer-files.d.ts +26 -0
- package/lib/input/composer-files.js +50 -0
- package/lib/input/composer-files.js.map +1 -0
- package/lib/input/editor-discovery.d.ts +21 -0
- package/lib/input/editor-discovery.js +99 -0
- package/lib/input/editor-discovery.js.map +1 -0
- package/lib/input/editor.d.ts +26 -1
- package/lib/input/editor.js +126 -12
- package/lib/input/editor.js.map +1 -1
- package/lib/input/external-editor.d.ts +5 -2
- package/lib/input/external-editor.js +14 -12
- package/lib/input/external-editor.js.map +1 -1
- package/lib/input/fuzzy-search.d.ts +9 -0
- package/lib/input/fuzzy-search.js +113 -0
- package/lib/input/fuzzy-search.js.map +1 -0
- package/lib/input/keybindings-config.d.ts +6 -2
- package/lib/input/keybindings-config.js +61 -7
- package/lib/input/keybindings-config.js.map +1 -1
- package/lib/input/keys.d.ts +13 -1
- package/lib/input/keys.js +27 -8
- package/lib/input/keys.js.map +1 -1
- package/lib/input/mouse-policy.d.ts +3 -0
- package/lib/input/mouse-policy.js +14 -0
- package/lib/input/mouse-policy.js.map +1 -0
- package/lib/input/paste-burst.d.ts +16 -0
- package/lib/input/paste-burst.js +61 -0
- package/lib/input/paste-burst.js.map +1 -0
- package/lib/input/text-selection.d.ts +20 -0
- package/lib/input/text-selection.js +195 -0
- package/lib/input/text-selection.js.map +1 -0
- package/lib/runtime/agent-profile.d.ts +5 -0
- package/lib/runtime/agent-profile.js +12 -0
- package/lib/runtime/agent-profile.js.map +1 -1
- package/lib/runtime/approval-rules.d.ts +59 -0
- package/lib/runtime/approval-rules.js +179 -0
- package/lib/runtime/approval-rules.js.map +1 -0
- package/lib/runtime/btw-policy.d.ts +7 -0
- package/lib/runtime/btw-policy.js +18 -0
- package/lib/runtime/btw-policy.js.map +1 -0
- package/lib/runtime/btw.d.ts +47 -0
- package/lib/runtime/btw.js +200 -0
- package/lib/runtime/btw.js.map +1 -0
- package/lib/runtime/composer-images.d.ts +1 -0
- package/lib/runtime/composer-images.js +11 -3
- package/lib/runtime/composer-images.js.map +1 -1
- package/lib/runtime/composer-shell.d.ts +15 -0
- package/lib/runtime/composer-shell.js +84 -0
- package/lib/runtime/composer-shell.js.map +1 -0
- package/lib/runtime/file-open.d.ts +2 -0
- package/lib/runtime/file-open.js +12 -0
- package/lib/runtime/file-open.js.map +1 -0
- package/lib/runtime/file-recovery-local.d.ts +73 -0
- package/lib/runtime/file-recovery-local.js +351 -0
- package/lib/runtime/file-recovery-local.js.map +1 -0
- package/lib/runtime/file-recovery-recording.d.ts +23 -0
- package/lib/runtime/file-recovery-recording.js +131 -0
- package/lib/runtime/file-recovery-recording.js.map +1 -0
- package/lib/runtime/file-recovery-review.d.ts +4 -0
- package/lib/runtime/file-recovery-review.js +131 -0
- package/lib/runtime/file-recovery-review.js.map +1 -0
- package/lib/runtime/file-recovery-store.d.ts +83 -0
- package/lib/runtime/file-recovery-store.js +325 -0
- package/lib/runtime/file-recovery-store.js.map +1 -0
- package/lib/runtime/file-recovery-worker.d.ts +22 -0
- package/lib/runtime/file-recovery-worker.js +153 -0
- package/lib/runtime/file-recovery-worker.js.map +1 -0
- package/lib/runtime/file-review.d.ts +27 -0
- package/lib/runtime/file-review.js +225 -0
- package/lib/runtime/file-review.js.map +1 -0
- package/lib/runtime/herdr-agent.d.ts +11 -28
- package/lib/runtime/herdr-agent.js +170 -142
- package/lib/runtime/herdr-agent.js.map +1 -1
- package/lib/runtime/hook-settings.d.ts +17 -0
- package/lib/runtime/hook-settings.js +57 -0
- package/lib/runtime/hook-settings.js.map +1 -0
- package/lib/runtime/human-interaction.js +1 -1
- package/lib/runtime/human-interaction.js.map +1 -1
- package/lib/runtime/image-preview.d.ts +8 -0
- package/lib/runtime/image-preview.js +119 -0
- package/lib/runtime/image-preview.js.map +1 -0
- package/lib/runtime/plain-tui.d.ts +2 -0
- package/lib/runtime/plain-tui.js +2 -2
- package/lib/runtime/plain-tui.js.map +1 -1
- package/lib/runtime/plugin-settings.d.ts +40 -0
- package/lib/runtime/plugin-settings.js +450 -0
- package/lib/runtime/plugin-settings.js.map +1 -0
- package/lib/runtime/provider-local.d.ts +60 -10
- package/lib/runtime/provider-local.js +1640 -197
- package/lib/runtime/provider-local.js.map +1 -1
- package/lib/runtime/runner.js +50 -4
- package/lib/runtime/runner.js.map +1 -1
- package/lib/runtime/session-archive.d.ts +11 -0
- package/lib/runtime/session-archive.js +240 -0
- package/lib/runtime/session-archive.js.map +1 -0
- package/lib/runtime/session-runtime.js +1 -1
- package/lib/runtime/session-runtime.js.map +1 -1
- package/lib/runtime/settings-preferences.d.ts +5 -0
- package/lib/runtime/settings-preferences.js +34 -0
- package/lib/runtime/settings-preferences.js.map +1 -0
- package/lib/runtime/subagent-model-selection.d.ts +5 -0
- package/lib/runtime/subagent-model-selection.js +15 -0
- package/lib/runtime/subagent-model-selection.js.map +1 -0
- package/lib/runtime/terminal-notifications.d.ts +8 -0
- package/lib/runtime/terminal-notifications.js +16 -0
- package/lib/runtime/terminal-notifications.js.map +1 -1
- package/lib/runtime/terminal-reader.d.ts +11 -0
- package/lib/runtime/terminal-reader.js +87 -0
- package/lib/runtime/terminal-reader.js.map +1 -0
- package/lib/runtime/terminal-state.d.ts +29 -0
- package/lib/runtime/terminal-state.js +62 -0
- package/lib/runtime/terminal-state.js.map +1 -0
- package/lib/runtime/tool-presentation.js +50 -14
- package/lib/runtime/tool-presentation.js.map +1 -1
- package/lib/session/composer-drafts.d.ts +20 -0
- package/lib/session/composer-drafts.js +103 -0
- package/lib/session/composer-drafts.js.map +1 -0
- package/lib/session/conversation-turns.d.ts +16 -0
- package/lib/session/conversation-turns.js +33 -0
- package/lib/session/conversation-turns.js.map +1 -0
- package/lib/session/external-agents.d.ts +5 -0
- package/lib/session/external-agents.js +27 -0
- package/lib/session/external-agents.js.map +1 -0
- package/lib/session/feature-toggles.d.ts +8 -29
- package/lib/session/feature-toggles.js +15 -46
- package/lib/session/feature-toggles.js.map +1 -1
- package/lib/session/fold-policy.d.ts +0 -17
- package/lib/session/fold-policy.js +0 -11
- package/lib/session/fold-policy.js.map +1 -1
- package/lib/session/interaction-adapter.d.ts +3 -8
- package/lib/session/interaction-adapter.js +243 -34
- package/lib/session/interaction-adapter.js.map +1 -1
- package/lib/session/message-queue.d.ts +22 -0
- package/lib/session/message-queue.js +157 -0
- package/lib/session/message-queue.js.map +1 -0
- package/lib/session/model-readiness.d.ts +16 -0
- package/lib/session/model-readiness.js +43 -0
- package/lib/session/model-readiness.js.map +1 -0
- package/lib/session/project-context.d.ts +5 -0
- package/lib/session/project-context.js +36 -0
- package/lib/session/project-context.js.map +1 -1
- package/lib/session/project-file-search.js +3 -21
- package/lib/session/project-file-search.js.map +1 -1
- package/lib/session/session-controller.d.ts +11 -20
- package/lib/session/session-controller.js +287 -176
- package/lib/session/session-controller.js.map +1 -1
- package/lib/session/session-library.d.ts +11 -3
- package/lib/session/session-library.js +50 -8
- package/lib/session/session-library.js.map +1 -1
- package/lib/session/session-tree.d.ts +27 -0
- package/lib/session/session-tree.js +112 -0
- package/lib/session/session-tree.js.map +1 -0
- package/lib/session/steering.d.ts +3 -0
- package/lib/session/steering.js +9 -0
- package/lib/session/steering.js.map +1 -0
- package/lib/session/subagent-roster.d.ts +2 -1
- package/lib/session/subagent-roster.js +24 -3
- package/lib/session/subagent-roster.js.map +1 -1
- package/lib/session/subagent-tracker.d.ts +6 -2
- package/lib/session/subagent-tracker.js +49 -2
- package/lib/session/subagent-tracker.js.map +1 -1
- package/lib/session/tui-settings.d.ts +23 -1
- package/lib/session/tui-settings.js +15 -1
- package/lib/session/tui-settings.js.map +1 -1
- package/lib/session/workflow-projection.d.ts +9 -0
- package/lib/session/workflow-projection.js +44 -0
- package/lib/session/workflow-projection.js.map +1 -0
- package/lib/session/working-directory.d.ts +4 -0
- package/lib/session/working-directory.js +4 -0
- package/lib/session/working-directory.js.map +1 -0
- package/lib/session/worktrees.d.ts +13 -0
- package/lib/session/worktrees.js +49 -0
- package/lib/session/worktrees.js.map +1 -0
- package/lib/views/agent-hub.js +12 -4
- package/lib/views/agent-hub.js.map +1 -1
- package/lib/views/approval-rule.d.ts +3 -0
- package/lib/views/approval-rule.js +4 -0
- package/lib/views/approval-rule.js.map +1 -0
- package/lib/views/at-complete.d.ts +8 -0
- package/lib/views/at-complete.js +64 -2
- package/lib/views/at-complete.js.map +1 -1
- package/lib/views/autocomplete.d.ts +4 -0
- package/lib/views/autocomplete.js +33 -36
- package/lib/views/autocomplete.js.map +1 -1
- package/lib/views/copy-selector.d.ts +3 -0
- package/lib/views/copy-selector.js +46 -15
- package/lib/views/copy-selector.js.map +1 -1
- package/lib/views/copy-targets.d.ts +2 -2
- package/lib/views/copy-targets.js +31 -13
- package/lib/views/copy-targets.js.map +1 -1
- package/lib/views/document-reader.d.ts +34 -0
- package/lib/views/document-reader.js +145 -0
- package/lib/views/document-reader.js.map +1 -0
- package/lib/views/event-views.d.ts +1 -1
- package/lib/views/event-views.js +57 -2
- package/lib/views/event-views.js.map +1 -1
- package/lib/views/file-actions.d.ts +12 -0
- package/lib/views/file-actions.js +72 -0
- package/lib/views/file-actions.js.map +1 -0
- package/lib/views/hotkeys.d.ts +1 -0
- package/lib/views/hotkeys.js +18 -7
- package/lib/views/hotkeys.js.map +1 -1
- package/lib/views/prompt-selector.d.ts +36 -4
- package/lib/views/prompt-selector.js +316 -60
- package/lib/views/prompt-selector.js.map +1 -1
- package/lib/views/prompt-tree.d.ts +11 -0
- package/lib/views/prompt-tree.js +74 -0
- package/lib/views/prompt-tree.js.map +1 -0
- package/lib/views/session-files.d.ts +7 -0
- package/lib/views/session-files.js +62 -0
- package/lib/views/session-files.js.map +1 -0
- package/lib/views/settings-list.d.ts +63 -2
- package/lib/views/settings-list.js +269 -62
- package/lib/views/settings-list.js.map +1 -1
- package/lib/views/transcript-export.js +9 -0
- package/lib/views/transcript-export.js.map +1 -1
- package/lib/views/transcript-render.d.ts +25 -39
- package/lib/views/transcript-render.js +146 -217
- package/lib/views/transcript-render.js.map +1 -1
- package/lib/views/transcript-types.d.ts +1 -1
- package/package.json +126 -42
- package/lib/chrome/style.d.ts +0 -22
- package/lib/chrome/style.js +0 -23
- package/lib/chrome/style.js.map +0 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** File actions derive only from provider declarations and host-served summaries. */
|
|
2
|
+
import { dirname, isAbsolute, resolve } from 'node:path';
|
|
3
|
+
/** Tool arguments and arbitrary result text are not file declarations. */
|
|
4
|
+
export function toolFileLocations(presentation) {
|
|
5
|
+
if (presentation === undefined)
|
|
6
|
+
return [];
|
|
7
|
+
const files = new Map();
|
|
8
|
+
const add = (location) => {
|
|
9
|
+
if (location.path === '' || /[\u0000-\u001f\u007f-\u009f]/u.test(location.path))
|
|
10
|
+
return;
|
|
11
|
+
const prior = files.get(location.path);
|
|
12
|
+
const line = prior?.line ?? location.line;
|
|
13
|
+
files.set(location.path, { path: location.path, ...(line === undefined || !Number.isSafeInteger(line) || line < 1 ? {} : { line }) });
|
|
14
|
+
};
|
|
15
|
+
const { call, result } = presentation;
|
|
16
|
+
if (call?.card === 'generic' || call?.card === 'diff')
|
|
17
|
+
for (const location of call.locations ?? [])
|
|
18
|
+
add(location);
|
|
19
|
+
if (call?.card === 'diff')
|
|
20
|
+
for (const diff of call.diffs)
|
|
21
|
+
add({ path: diff.path });
|
|
22
|
+
if (result?.card === 'read')
|
|
23
|
+
add({ path: result.path, line: result.offset });
|
|
24
|
+
else if (result?.card === 'diff')
|
|
25
|
+
for (const diff of result.diffs)
|
|
26
|
+
add({ path: diff.path });
|
|
27
|
+
else if (result?.card === 'search') {
|
|
28
|
+
if (result.shape === 'paths')
|
|
29
|
+
for (const path of result.paths)
|
|
30
|
+
add({ path });
|
|
31
|
+
else
|
|
32
|
+
for (const file of result.files)
|
|
33
|
+
add({ path: file.path, ...(file.matches[0] === undefined ? {} : { line: file.matches[0].lineNumber }) });
|
|
34
|
+
}
|
|
35
|
+
return [...files.values()];
|
|
36
|
+
}
|
|
37
|
+
const actions = new WeakMap();
|
|
38
|
+
export function blockFileAction(block) {
|
|
39
|
+
if (!actions.has(block))
|
|
40
|
+
actions.set(block, projectFileAction(block));
|
|
41
|
+
return actions.get(block);
|
|
42
|
+
}
|
|
43
|
+
function projectFileAction(block) {
|
|
44
|
+
if (block.kind === 'workspace') {
|
|
45
|
+
const summary = block.summary;
|
|
46
|
+
if (summary === undefined || summary.files.length === 0)
|
|
47
|
+
return undefined;
|
|
48
|
+
return { title: `Turn ${summary.turn} files · current contents`, cwd: summary.cwd,
|
|
49
|
+
files: summary.files.map(file => ({ path: file.path, label: file.display })) };
|
|
50
|
+
}
|
|
51
|
+
if (block.kind !== 'tool')
|
|
52
|
+
return undefined;
|
|
53
|
+
const locations = toolFileLocations(block.presentation);
|
|
54
|
+
if (locations.length === 0)
|
|
55
|
+
return undefined;
|
|
56
|
+
const cwd = block.presentation?.cwd;
|
|
57
|
+
// Absolute declarations remain usable without a base; never guess a relative
|
|
58
|
+
// call's old directory from the currently viewed Session.
|
|
59
|
+
const available = cwd === undefined ? locations.filter(location => isAbsolute(location.path)) : locations;
|
|
60
|
+
if (available.length === 0)
|
|
61
|
+
return undefined;
|
|
62
|
+
const base = cwd ?? dirname(available[0].path);
|
|
63
|
+
const files = new Map();
|
|
64
|
+
for (const location of available) {
|
|
65
|
+
const path = resolve(base, location.path);
|
|
66
|
+
const prior = files.get(path);
|
|
67
|
+
const line = prior?.line ?? location.line;
|
|
68
|
+
files.set(path, { path, label: prior?.label ?? location.path, ...(line === undefined ? {} : { line }) });
|
|
69
|
+
}
|
|
70
|
+
return { title: 'Tool files · current contents', cwd: base, files: [...files.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AAA;IAC5C,MAAM,IAAI,GAAG,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAE,CAAC,IAAI,CAAC,CAAA;IAC/C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAA;IAC3C,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;QACzC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC7B,MAAM,IAAI,GAAG,KAAK,EAAE,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAA;QACzC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;IAC1G,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,+BAA+B,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,CAAA;AAC1F,CAAC"}
|
package/lib/views/hotkeys.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type { HotkeyRow };
|
|
|
8
8
|
export { formatHotkeyKeys, formatOverlayHint } from './hotkey-format.ts';
|
|
9
9
|
/** Effective application bindings shown alongside built-in editor bindings. */
|
|
10
10
|
export type HotkeyBindings = Readonly<Record<string, TuiAction>>;
|
|
11
|
+
export declare function displayKey(key: string): string;
|
|
11
12
|
/** Human-readable effective keys, or `Disabled` when no binding names the action. */
|
|
12
13
|
export declare function keysForAction(bindings: HotkeyBindings, action: TuiAction): string;
|
|
13
14
|
/** Number of shortcut rows in the catalog. */
|
package/lib/views/hotkeys.js
CHANGED
|
@@ -24,7 +24,7 @@ const OVERLAY_CATALOGS = [
|
|
|
24
24
|
{ label: 'Trajectory', rows: TRAJECTORY_HOTKEYS },
|
|
25
25
|
{ label: 'Prompts', rows: PROMPT_SELECTOR_HOTKEYS },
|
|
26
26
|
];
|
|
27
|
-
function displayKey(key) {
|
|
27
|
+
export function displayKey(key) {
|
|
28
28
|
return key.split('+').map((part) => {
|
|
29
29
|
const normalized = part.toLowerCase();
|
|
30
30
|
if (normalized === 'ctrl')
|
|
@@ -79,12 +79,18 @@ function sections(bindings) {
|
|
|
79
79
|
{ keys: 'Ctrl+K', action: 'Delete to the end of the line' },
|
|
80
80
|
{ keys: 'Ctrl+Y', action: 'Yank deleted text' },
|
|
81
81
|
{ keys: 'Alt+Y', action: 'Cycle the yank ring' },
|
|
82
|
-
{ keys: 'Ctrl+-', action: 'Undo the last edit' },
|
|
82
|
+
{ keys: 'Ctrl+-', action: 'Undo the last edit or restore a cleared draft' },
|
|
83
83
|
{ keys: 'Ctrl+D', action: 'Delete forward / quit when the editor is empty' },
|
|
84
|
-
{ keys:
|
|
85
|
-
{ keys: keysForAction(bindings, '
|
|
84
|
+
{ keys: 'Alt+Up', action: 'Recall the latest queued message into the composer' },
|
|
85
|
+
{ keys: keysForAction(bindings, 'stash-draft'), action: 'Stash or restore the current composer draft' },
|
|
86
|
+
{ keys: keysForAction(bindings, 'paste-clipboard'), action: 'Paste clipboard text or an image' },
|
|
87
|
+
{ keys: keysForAction(bindings, 'expand-paste'), action: 'Expand a pasted block for editing' },
|
|
88
|
+
{ keys: keysForAction(bindings, 'preview-images'), action: 'Preview draft images' },
|
|
89
|
+
{ keys: keysForAction(bindings, 'manage-queue'), action: 'Manage individual queued messages' },
|
|
90
|
+
{ keys: keysForAction(bindings, 'steer-turn'), action: 'Send the draft as guidance for the active turn’s next step' },
|
|
91
|
+
{ keys: keysForAction(bindings, 'copy-prompt'), action: 'Copy the selection or current prompt' },
|
|
86
92
|
{ keys: keysForAction(bindings, 'copy-line'), action: 'Copy the current line' },
|
|
87
|
-
{ keys: keysForAction(bindings, 'external-editor'), action: 'Edit the prompt in
|
|
93
|
+
{ keys: keysForAction(bindings, 'external-editor'), action: 'Edit the prompt in the selected editor' },
|
|
88
94
|
],
|
|
89
95
|
},
|
|
90
96
|
{
|
|
@@ -95,6 +101,7 @@ function sections(bindings) {
|
|
|
95
101
|
{ keys: 'End / click jump label', action: 'Return to the latest message while browsing' },
|
|
96
102
|
{ keys: keysForAction(bindings, 'toggle-tools'), action: 'Toggle completed turn details or tool descriptions' },
|
|
97
103
|
{ keys: keysForAction(bindings, 'toggle-tool-details'), action: 'Toggle full tool inputs and results for the current turn' },
|
|
104
|
+
{ keys: keysForAction(bindings, 'review-changes'), action: 'Preview the visible tool’s files, or review this turn’s changes' },
|
|
98
105
|
{ keys: keysForAction(bindings, 'search-transcript'), action: 'Search the current transcript; n/N step across matches' },
|
|
99
106
|
{ keys: keysForAction(bindings, 'inspect-subagent'), action: 'Open a subagent transcript; continuable children can be steered' },
|
|
100
107
|
],
|
|
@@ -102,7 +109,7 @@ function sections(bindings) {
|
|
|
102
109
|
{
|
|
103
110
|
title: 'Session',
|
|
104
111
|
rows: [
|
|
105
|
-
{ keys: 'Esc twice', action: '
|
|
112
|
+
{ keys: 'Esc twice', action: 'Browse conversation turns and branches' },
|
|
106
113
|
{ keys: 'Ctrl+C twice', action: 'Interrupt or clear, then exit' },
|
|
107
114
|
{ keys: 'Ctrl+Z', action: 'Suspend to the background' },
|
|
108
115
|
{ keys: 'Alt+L', action: 'Reset the terminal display' },
|
|
@@ -112,6 +119,7 @@ function sections(bindings) {
|
|
|
112
119
|
{ keys: keysForAction(bindings, 'cycle-model-backward'), action: 'Cycle to the previous favorite model' },
|
|
113
120
|
{ keys: keysForAction(bindings, 'cycle-reasoning'), action: 'Cycle the current model reasoning effort' },
|
|
114
121
|
{ keys: '/', action: 'Open slash-command completion' },
|
|
122
|
+
{ keys: '!command', action: 'Run a persistent Shell line; output stays outside model context' },
|
|
115
123
|
{ keys: '@ / ./ / ~/', action: 'Complete file paths' },
|
|
116
124
|
{ keys: 'Tab', action: 'Accept command or path completion' },
|
|
117
125
|
{ keys: '/copy', action: 'Open the copy picker' },
|
|
@@ -140,13 +148,16 @@ export function formatEssentialHotkeysText(bindings = DEFAULT_KEYBINDINGS) {
|
|
|
140
148
|
{ keys: 'Enter', action: 'Send the message' },
|
|
141
149
|
{ keys: 'Shift+Enter / Alt+Enter / Ctrl+J', action: 'Insert a new line' },
|
|
142
150
|
{ keys: 'Ctrl+C twice', action: 'Interrupt or clear, then exit' },
|
|
143
|
-
{ keys: 'Esc twice', action: '
|
|
151
|
+
{ keys: 'Esc twice', action: 'Browse conversation turns and branches' },
|
|
144
152
|
{ keys: keysForAction(bindings, 'search-history'), action: 'Search prompt history' },
|
|
145
153
|
{ keys: keysForAction(bindings, 'search-transcript'), action: 'Search the current transcript' },
|
|
146
154
|
{ keys: keysForActions(bindings, 'scroll-page-up', 'scroll-page-down'), action: 'Scroll the transcript' },
|
|
147
155
|
{ keys: keysForAction(bindings, 'toggle-tools'), action: 'Toggle completed turn details or tool descriptions' },
|
|
148
156
|
{ keys: keysForAction(bindings, 'toggle-tool-details'), action: 'Toggle full tool inputs and results for the current turn' },
|
|
149
157
|
{ keys: keysForAction(bindings, 'paste-clipboard'), action: 'Paste clipboard text or an image' },
|
|
158
|
+
{ keys: keysForAction(bindings, 'expand-paste'), action: 'Expand a pasted block for editing' },
|
|
159
|
+
{ keys: keysForAction(bindings, 'preview-images'), action: 'Preview draft images' },
|
|
160
|
+
{ keys: keysForAction(bindings, 'steer-turn'), action: 'Guide the active turn’s next step' },
|
|
150
161
|
];
|
|
151
162
|
return rows.map(row => `- \`${tableCell(row.keys)}\` — ${tableCell(row.action)}`).join('\n');
|
|
152
163
|
}
|
package/lib/views/hotkeys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hotkeys.js","sourceRoot":"","sources":["../../src/views/hotkeys.ts"],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AAC,GAAG,CAAC,IAAI,CAAC,QAAQ,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9F,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,iBAAiB,CAAC,WAA2B,mBAAmB;IAC9E,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;QACpD,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC5B,KAAK,OAAO,CAAC,KAAK,IAAI;QACtB,uBAAuB;QACvB,WAAW;QACX,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;KACxF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACf,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Interactive terminal selector used by resume, approval, and user questions. */
|
|
2
|
-
import type
|
|
2
|
+
import { type ImageProtocol } from '../chrome/terminal-images.ts';
|
|
3
|
+
import type { TuiDocumentPosition, TuiPrompt } from '../definition.ts';
|
|
3
4
|
import { type Theme } from '../chrome/theme.ts';
|
|
4
5
|
import { type HotkeyRow } from './hotkey-format.ts';
|
|
5
6
|
/** Presentation state owned by the terminal while a human prompt is active. */
|
|
@@ -9,10 +10,26 @@ export interface PromptSelectorState {
|
|
|
9
10
|
checked: ReadonlySet<number>;
|
|
10
11
|
/** Requested first document row for full-screen review surfaces. */
|
|
11
12
|
documentScroll?: number;
|
|
13
|
+
documentAnchor?: TuiDocumentPosition | undefined;
|
|
14
|
+
documentWordWrap?: boolean;
|
|
15
|
+
documentColumn?: number;
|
|
16
|
+
documentQuery?: string;
|
|
17
|
+
documentInput?: 'search' | 'line' | undefined;
|
|
18
|
+
documentError?: string | undefined;
|
|
19
|
+
documentOrigin?: TuiDocumentPosition;
|
|
20
|
+
documentOriginalQuery?: string;
|
|
21
|
+
documentTarget?: number | undefined;
|
|
22
|
+
collapsed?: ReadonlySet<string>;
|
|
23
|
+
previewScroll?: number;
|
|
12
24
|
/** Whether a rejected plan is collecting optional revision feedback. */
|
|
13
25
|
feedback?: boolean;
|
|
26
|
+
/** Editing or Take time paused this local countdown. */
|
|
27
|
+
waitHeld?: boolean;
|
|
28
|
+
/** Timestamp before which keyboard confirmation is ignored. */
|
|
29
|
+
armedUntil?: number;
|
|
14
30
|
}
|
|
15
31
|
export interface PromptSelectorFrame {
|
|
32
|
+
image?: import('../chrome/terminal-images.ts').ImagePlacement;
|
|
16
33
|
lines: string[];
|
|
17
34
|
cursor: {
|
|
18
35
|
row: number;
|
|
@@ -22,6 +39,7 @@ export interface PromptSelectorFrame {
|
|
|
22
39
|
start: number;
|
|
23
40
|
maxStart: number;
|
|
24
41
|
pageSize: number;
|
|
42
|
+
position?: TuiDocumentPosition;
|
|
25
43
|
};
|
|
26
44
|
cursorVisible?: boolean;
|
|
27
45
|
}
|
|
@@ -33,7 +51,17 @@ type PromptOption = NonNullable<TuiPrompt['options']>[number];
|
|
|
33
51
|
/** Preserve editor indices and line breaks while hiding every entered cell. */
|
|
34
52
|
export declare function maskPromptSecret(input: string): string;
|
|
35
53
|
/** Options matching the current full-screen selector query. */
|
|
36
|
-
export declare function filteredPromptOptions(request: TuiPrompt, query: string): readonly PromptOption[];
|
|
54
|
+
export declare function filteredPromptOptions(request: TuiPrompt, query: string, collapsed?: ReadonlySet<string>): readonly PromptOption[];
|
|
55
|
+
/** Keep the same live choice selected as entries arrive, move, or disappear. */
|
|
56
|
+
export declare function refreshPromptOptions<T extends PromptSelectorState>(state: T, options: NonNullable<TuiPrompt['options']>, query: string): T;
|
|
57
|
+
/** Page movement follows the list space remaining after wrapped action hints. */
|
|
58
|
+
export declare function promptTreePageSize(request: TuiPrompt, width: number, height: number): number;
|
|
59
|
+
/** A hierarchical choice with an independently scrollable content preview. */
|
|
60
|
+
export declare function renderPromptTreePage(state: PromptSelectorState, theme: Theme, width: number, height: number, input: string, inputCursor: number, appName: string): PromptSelectorFrame;
|
|
61
|
+
/** Fold/unfold a subtree or move to its parent, preserving selection by value. */
|
|
62
|
+
export declare function movePromptTree(state: PromptSelectorState, direction: 'left' | 'right', query: string): PromptSelectorState;
|
|
63
|
+
/** Start on a matching node instead of a context-only ancestor. */
|
|
64
|
+
export declare function searchPromptSelection(state: PromptSelectorState, query: string): PromptSelectorState;
|
|
37
65
|
/** Visible option window centered around the selected row. */
|
|
38
66
|
export declare function promptSelectorVisibleRange(count: number, selected: number, maxVisible?: number): {
|
|
39
67
|
start: number;
|
|
@@ -41,14 +69,18 @@ export declare function promptSelectorVisibleRange(count: number, selected: numb
|
|
|
41
69
|
};
|
|
42
70
|
/** Render an OMP-style full-height searchable selector with one outer frame. */
|
|
43
71
|
export declare function renderPromptSelectorPage(state: PromptSelectorState, theme: Theme, width: number, height: number, input: string, inputCursor: number, appName: string): PromptSelectorFrame;
|
|
44
|
-
/**
|
|
72
|
+
/** Reserve a bordered, padded rectangle; graphics never become display-row content. */
|
|
73
|
+
export declare function renderImagePreviewPage(state: PromptSelectorState, theme: Theme, width: number, height: number, appName: string, protocol?: ImageProtocol, cell?: {
|
|
74
|
+
width: number;
|
|
75
|
+
height: number;
|
|
76
|
+
}): PromptSelectorFrame;
|
|
45
77
|
export declare function renderPlanReviewPage(state: PromptSelectorState, theme: Theme, width: number, height: number, input: string, inputCursor: number, appName: string): PromptSelectorFrame;
|
|
46
78
|
/** Render the prompt card and its answer editor as one bottom-of-screen overlay. */
|
|
47
79
|
export declare function renderPromptSelector(state: PromptSelectorState, theme: Theme, width: number, input: string, inputCursor: number, maxVisible?: number): PromptSelectorFrame;
|
|
48
80
|
/** Keep a selected option index within the available prompt options. */
|
|
49
81
|
export declare function movePromptSelection(state: PromptSelectorState, next: number, count?: number): PromptSelectorState;
|
|
50
82
|
/** Toggle the active row for a multi-select prompt. */
|
|
51
|
-
export declare function togglePromptSelection(state: PromptSelectorState): PromptSelectorState;
|
|
83
|
+
export declare function togglePromptSelection(state: PromptSelectorState, query?: string): PromptSelectorState;
|
|
52
84
|
/** Resolve the selected labels in stable option order. */
|
|
53
85
|
export declare function selectedPromptAnswer(state: PromptSelectorState): string | null;
|
|
54
86
|
/** Resolve the selected answer after applying a full-screen selector query. */
|