agentlas 1.0.42 → 1.0.44
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/CHANGELOG.md +24 -0
- package/engine/agentlas-workforce.cjs +1 -1
- package/engine/hephaestus/runtime.cjs +1 -1
- package/engine/storm/storm.cjs +1 -1
- package/engine/storm/swarm.cjs +1 -1
- package/engine/ui/palette.cjs +1 -0
- package/engine/ui/repl.cjs +34 -4
- package/engine/ui/shell.cjs +22 -3
- package/engine/vendor/mermaid/LICENSE +205 -0
- package/engine/vendor/mermaid/ansi.js +23 -0
- package/engine/vendor/mermaid/canvas.js +366 -0
- package/engine/vendor/mermaid/graph.js +91 -0
- package/engine/vendor/mermaid/index.js +100 -0
- package/engine/vendor/mermaid/labels.js +324 -0
- package/engine/vendor/mermaid/layout-seq.js +194 -0
- package/engine/vendor/mermaid/layout.js +881 -0
- package/engine/vendor/mermaid/package.json +1 -0
- package/engine/vendor/mermaid/parse.js +1108 -0
- package/engine/vendor/mermaid/source-box.js +78 -0
- package/engine/vendor/mermaid/types.js +1 -0
- package/engine/vendor/mermaid/width-data.js +994 -0
- package/engine/vendor/mermaid/width.js +76 -0
- package/engine/vendor/tui/LICENSE +20 -0
- package/engine/vendor/tui/autocomplete.js +632 -0
- package/engine/vendor/tui/components/alt-screen-flash.js +37 -0
- package/engine/vendor/tui/components/box.js +104 -0
- package/engine/vendor/tui/components/cancellable-loader.js +35 -0
- package/engine/vendor/tui/components/editor.js +1961 -0
- package/engine/vendor/tui/components/h-stack.js +43 -0
- package/engine/vendor/tui/components/image.js +90 -0
- package/engine/vendor/tui/components/input.js +378 -0
- package/engine/vendor/tui/components/loader.js +69 -0
- package/engine/vendor/tui/components/markdown.js +806 -0
- package/engine/vendor/tui/components/scroll-view.js +173 -0
- package/engine/vendor/tui/components/select-list.js +159 -0
- package/engine/vendor/tui/components/settings-list.js +182 -0
- package/engine/vendor/tui/components/spacer.js +23 -0
- package/engine/vendor/tui/components/stack.js +111 -0
- package/engine/vendor/tui/components/text.js +89 -0
- package/engine/vendor/tui/components/truncated-text.js +51 -0
- package/engine/vendor/tui/components/v-stack.js +26 -0
- package/engine/vendor/tui/deps/east-asian-width/LICENSE +9 -0
- package/engine/vendor/tui/deps/east-asian-width/index.js +30 -0
- package/engine/vendor/tui/deps/east-asian-width/lookup-data.js +21 -0
- package/engine/vendor/tui/deps/east-asian-width/lookup.js +138 -0
- package/engine/vendor/tui/deps/east-asian-width/utilities.js +24 -0
- package/engine/vendor/tui/deps/marked/LICENSE +44 -0
- package/engine/vendor/tui/deps/marked/index.js +77 -0
- package/engine/vendor/tui/editor-component.js +2 -0
- package/engine/vendor/tui/fuzzy.js +110 -0
- package/engine/vendor/tui/index.js +42 -0
- package/engine/vendor/tui/keybindings.js +209 -0
- package/engine/vendor/tui/keys.js +1174 -0
- package/engine/vendor/tui/kill-ring.js +44 -0
- package/engine/vendor/tui/latex.js +1264 -0
- package/engine/vendor/tui/layout-node.js +6 -0
- package/engine/vendor/tui/layout.js +314 -0
- package/engine/vendor/tui/native-modifiers.js +60 -0
- package/engine/vendor/tui/package.json +1 -0
- package/engine/vendor/tui/stdin-buffer.js +361 -0
- package/engine/vendor/tui/terminal-colors.js +59 -0
- package/engine/vendor/tui/terminal-image.js +518 -0
- package/engine/vendor/tui/terminal.js +436 -0
- package/engine/vendor/tui/tui-alt-screen.js +902 -0
- package/engine/vendor/tui/tui-main-screen.js +533 -0
- package/engine/vendor/tui/tui.js +937 -0
- package/engine/vendor/tui/undo-stack.js +25 -0
- package/engine/vendor/tui/utils.js +1191 -0
- package/engine/vendor/tui/word-navigation.js +96 -0
- package/package.json +2 -6
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fuzzy matching utilities.
|
|
3
|
+
* Matches if all query characters appear in order (not necessarily consecutive).
|
|
4
|
+
* Lower score = better match.
|
|
5
|
+
*/
|
|
6
|
+
export function fuzzyMatch(query, text) {
|
|
7
|
+
const queryLower = query.toLowerCase();
|
|
8
|
+
const textLower = text.toLowerCase();
|
|
9
|
+
const matchQuery = (normalizedQuery) => {
|
|
10
|
+
if (normalizedQuery.length === 0) {
|
|
11
|
+
return { matches: true, score: 0 };
|
|
12
|
+
}
|
|
13
|
+
if (normalizedQuery.length > textLower.length) {
|
|
14
|
+
return { matches: false, score: 0 };
|
|
15
|
+
}
|
|
16
|
+
let queryIndex = 0;
|
|
17
|
+
let score = 0;
|
|
18
|
+
let lastMatchIndex = -1;
|
|
19
|
+
let consecutiveMatches = 0;
|
|
20
|
+
for (let i = 0; i < textLower.length && queryIndex < normalizedQuery.length; i++) {
|
|
21
|
+
if (textLower[i] === normalizedQuery[queryIndex]) {
|
|
22
|
+
const isWordBoundary = i === 0 || /[\s\-_./:]/.test(textLower[i - 1]);
|
|
23
|
+
// Reward consecutive matches
|
|
24
|
+
if (lastMatchIndex === i - 1) {
|
|
25
|
+
consecutiveMatches++;
|
|
26
|
+
score -= consecutiveMatches * 5;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
consecutiveMatches = 0;
|
|
30
|
+
// Penalize gaps
|
|
31
|
+
if (lastMatchIndex >= 0) {
|
|
32
|
+
score += (i - lastMatchIndex - 1) * 2;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// Reward word boundary matches
|
|
36
|
+
if (isWordBoundary) {
|
|
37
|
+
score -= 10;
|
|
38
|
+
}
|
|
39
|
+
// Slight penalty for later matches
|
|
40
|
+
score += i * 0.1;
|
|
41
|
+
lastMatchIndex = i;
|
|
42
|
+
queryIndex++;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (queryIndex < normalizedQuery.length) {
|
|
46
|
+
return { matches: false, score: 0 };
|
|
47
|
+
}
|
|
48
|
+
if (normalizedQuery === textLower) {
|
|
49
|
+
score -= 100;
|
|
50
|
+
}
|
|
51
|
+
return { matches: true, score };
|
|
52
|
+
};
|
|
53
|
+
const primaryMatch = matchQuery(queryLower);
|
|
54
|
+
if (primaryMatch.matches) {
|
|
55
|
+
return primaryMatch;
|
|
56
|
+
}
|
|
57
|
+
const alphaNumericMatch = queryLower.match(/^(?<letters>[a-z]+)(?<digits>[0-9]+)$/);
|
|
58
|
+
const numericAlphaMatch = queryLower.match(/^(?<digits>[0-9]+)(?<letters>[a-z]+)$/);
|
|
59
|
+
const swappedQuery = alphaNumericMatch
|
|
60
|
+
? `${alphaNumericMatch.groups?.digits ?? ""}${alphaNumericMatch.groups?.letters ?? ""}`
|
|
61
|
+
: numericAlphaMatch
|
|
62
|
+
? `${numericAlphaMatch.groups?.letters ?? ""}${numericAlphaMatch.groups?.digits ?? ""}`
|
|
63
|
+
: "";
|
|
64
|
+
if (!swappedQuery) {
|
|
65
|
+
return primaryMatch;
|
|
66
|
+
}
|
|
67
|
+
const swappedMatch = matchQuery(swappedQuery);
|
|
68
|
+
if (!swappedMatch.matches) {
|
|
69
|
+
return primaryMatch;
|
|
70
|
+
}
|
|
71
|
+
return { matches: true, score: swappedMatch.score + 5 };
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Filter and sort items by fuzzy match quality (best matches first).
|
|
75
|
+
* Supports whitespace- and slash-separated tokens: all tokens must match.
|
|
76
|
+
*/
|
|
77
|
+
export function fuzzyFilter(items, query, getText) {
|
|
78
|
+
if (!query.trim()) {
|
|
79
|
+
return items;
|
|
80
|
+
}
|
|
81
|
+
const tokens = query
|
|
82
|
+
.trim()
|
|
83
|
+
.split(/[\s/]+/)
|
|
84
|
+
.filter((t) => t.length > 0);
|
|
85
|
+
if (tokens.length === 0) {
|
|
86
|
+
return items;
|
|
87
|
+
}
|
|
88
|
+
const results = [];
|
|
89
|
+
for (const item of items) {
|
|
90
|
+
const text = getText(item);
|
|
91
|
+
let totalScore = 0;
|
|
92
|
+
let allMatch = true;
|
|
93
|
+
for (const token of tokens) {
|
|
94
|
+
const match = fuzzyMatch(token, text);
|
|
95
|
+
if (match.matches) {
|
|
96
|
+
totalScore += match.score;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
allMatch = false;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (allMatch) {
|
|
104
|
+
results.push({ item, totalScore });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
results.sort((a, b) => a.totalScore - b.totalScore);
|
|
108
|
+
return results.map((r) => r.item);
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=fuzzy.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Core TUI interfaces and classes
|
|
2
|
+
export { Marked } from "./deps/marked/index.js";
|
|
3
|
+
// Autocomplete support
|
|
4
|
+
export { CombinedAutocompleteProvider, } from "./autocomplete.js";
|
|
5
|
+
// Components
|
|
6
|
+
export { Box } from "./components/box.js";
|
|
7
|
+
export { CancellableLoader } from "./components/cancellable-loader.js";
|
|
8
|
+
export { Editor } from "./components/editor.js";
|
|
9
|
+
export { HStack } from "./components/h-stack.js";
|
|
10
|
+
export { Image } from "./components/image.js";
|
|
11
|
+
export { Input } from "./components/input.js";
|
|
12
|
+
export { Loader } from "./components/loader.js";
|
|
13
|
+
export { Markdown } from "./components/markdown.js";
|
|
14
|
+
export { ScrollView } from "./components/scroll-view.js";
|
|
15
|
+
export { SelectList, } from "./components/select-list.js";
|
|
16
|
+
export { SettingsList } from "./components/settings-list.js";
|
|
17
|
+
export { Spacer } from "./components/spacer.js";
|
|
18
|
+
export { Text } from "./components/text.js";
|
|
19
|
+
export { TruncatedText } from "./components/truncated-text.js";
|
|
20
|
+
export { VStack, } from "./components/v-stack.js";
|
|
21
|
+
// Fuzzy matching
|
|
22
|
+
export { fuzzyFilter, fuzzyMatch } from "./fuzzy.js";
|
|
23
|
+
// Keybindings
|
|
24
|
+
export { getKeybindings, KeybindingsManager, setKeybindings, TUI_KEYBINDINGS, } from "./keybindings.js";
|
|
25
|
+
// Keyboard input handling
|
|
26
|
+
export { decodeKittyPrintable, isKeyRelease, isKeyRepeat, isKittyProtocolActive, Key, matchesKey, parseKey, setKittyProtocolActive, } from "./keys.js";
|
|
27
|
+
// LaTeX rendering
|
|
28
|
+
export { renderLatex } from "./latex.js";
|
|
29
|
+
// Input buffering for batch splitting
|
|
30
|
+
export { StdinBuffer } from "./stdin-buffer.js";
|
|
31
|
+
// Terminal interface and implementations
|
|
32
|
+
export { ProcessTerminal } from "./terminal.js";
|
|
33
|
+
// Terminal colors
|
|
34
|
+
export { parseOsc11BackgroundColor, parseTerminalColorSchemeReport, } from "./terminal-colors.js";
|
|
35
|
+
// Terminal image support
|
|
36
|
+
export { allocateImageId, calculateImageRows, deleteAllKittyImages, deleteKittyImage, detectCapabilities, encodeITerm2, encodeKitty, getCapabilities, getCellDimensions, getGifDimensions, getImageDimensions, getJpegDimensions, getPngDimensions, getWebpDimensions, hyperlink, imageFallback, renderImage, resetCapabilitiesCache, setCapabilities, setCellDimensions, } from "./terminal-image.js";
|
|
37
|
+
export { Container, CURSOR_MARKER, compositeTuiLine, isFocusable, isViewportTUI, } from "./tui.js";
|
|
38
|
+
export { TuiAltScreen } from "./tui-alt-screen.js";
|
|
39
|
+
export { TuiMainScreen } from "./tui-main-screen.js";
|
|
40
|
+
// Utilities
|
|
41
|
+
export { getOsc8LinkAtColumn, sliceByColumn, stripTerminalSequences, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "./utils.js";
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { matchesKey } from "./keys.js";
|
|
2
|
+
export const TUI_KEYBINDINGS = {
|
|
3
|
+
"tui.editor.cursorUp": { defaultKeys: "up", description: "Move cursor up" },
|
|
4
|
+
"tui.editor.cursorDown": { defaultKeys: "down", description: "Move cursor down" },
|
|
5
|
+
"tui.editor.historyPrevious": {
|
|
6
|
+
defaultKeys: [],
|
|
7
|
+
description: "Select previous prompt history entry",
|
|
8
|
+
},
|
|
9
|
+
"tui.editor.historyNext": {
|
|
10
|
+
defaultKeys: [],
|
|
11
|
+
description: "Select next prompt history entry",
|
|
12
|
+
},
|
|
13
|
+
"tui.editor.cursorLeft": {
|
|
14
|
+
defaultKeys: ["left", "ctrl+b"],
|
|
15
|
+
description: "Move cursor left",
|
|
16
|
+
},
|
|
17
|
+
"tui.editor.cursorRight": {
|
|
18
|
+
defaultKeys: ["right", "ctrl+f"],
|
|
19
|
+
description: "Move cursor right",
|
|
20
|
+
},
|
|
21
|
+
"tui.editor.cursorWordLeft": {
|
|
22
|
+
defaultKeys: ["alt+left", "ctrl+left", "alt+b"],
|
|
23
|
+
description: "Move cursor word left",
|
|
24
|
+
},
|
|
25
|
+
"tui.editor.cursorWordRight": {
|
|
26
|
+
defaultKeys: ["alt+right", "ctrl+right", "alt+f"],
|
|
27
|
+
description: "Move cursor word right",
|
|
28
|
+
},
|
|
29
|
+
"tui.editor.cursorLineStart": {
|
|
30
|
+
defaultKeys: ["home", "ctrl+home", "ctrl+a"],
|
|
31
|
+
description: "Move to line start",
|
|
32
|
+
},
|
|
33
|
+
"tui.editor.cursorLineEnd": {
|
|
34
|
+
defaultKeys: ["end", "ctrl+end", "ctrl+e"],
|
|
35
|
+
description: "Move to line end",
|
|
36
|
+
},
|
|
37
|
+
"tui.editor.jumpForward": {
|
|
38
|
+
defaultKeys: "ctrl+]",
|
|
39
|
+
description: "Jump forward to character",
|
|
40
|
+
},
|
|
41
|
+
"tui.editor.jumpBackward": {
|
|
42
|
+
defaultKeys: "ctrl+alt+]",
|
|
43
|
+
description: "Jump backward to character",
|
|
44
|
+
},
|
|
45
|
+
"tui.editor.pageUp": { defaultKeys: ["pageUp", "ctrl+pageUp"], description: "Page up" },
|
|
46
|
+
"tui.editor.pageDown": { defaultKeys: ["pageDown", "ctrl+pageDown"], description: "Page down" },
|
|
47
|
+
"tui.editor.deleteCharBackward": {
|
|
48
|
+
defaultKeys: "backspace",
|
|
49
|
+
description: "Delete character backward",
|
|
50
|
+
},
|
|
51
|
+
"tui.editor.deleteCharForward": {
|
|
52
|
+
defaultKeys: ["delete", "ctrl+d"],
|
|
53
|
+
description: "Delete character forward",
|
|
54
|
+
},
|
|
55
|
+
"tui.editor.deleteWordBackward": {
|
|
56
|
+
defaultKeys: ["ctrl+w", "alt+backspace"],
|
|
57
|
+
description: "Delete word backward",
|
|
58
|
+
},
|
|
59
|
+
"tui.editor.deleteWordForward": {
|
|
60
|
+
defaultKeys: ["alt+d", "alt+delete"],
|
|
61
|
+
description: "Delete word forward",
|
|
62
|
+
},
|
|
63
|
+
"tui.editor.deleteToLineStart": {
|
|
64
|
+
defaultKeys: "ctrl+u",
|
|
65
|
+
description: "Delete to line start",
|
|
66
|
+
},
|
|
67
|
+
"tui.editor.deleteToLineEnd": {
|
|
68
|
+
defaultKeys: "ctrl+k",
|
|
69
|
+
description: "Delete to line end",
|
|
70
|
+
},
|
|
71
|
+
"tui.editor.yank": { defaultKeys: "ctrl+y", description: "Yank" },
|
|
72
|
+
"tui.editor.yankPop": { defaultKeys: "alt+y", description: "Yank pop" },
|
|
73
|
+
"tui.editor.undo": { defaultKeys: "ctrl+-", description: "Undo" },
|
|
74
|
+
"tui.input.newLine": { defaultKeys: ["shift+enter", "ctrl+j"], description: "Insert newline" },
|
|
75
|
+
"tui.input.submit": { defaultKeys: "enter", description: "Submit input" },
|
|
76
|
+
"tui.input.tab": { defaultKeys: "tab", description: "Tab / autocomplete" },
|
|
77
|
+
"tui.input.copy": { defaultKeys: "ctrl+c", description: "Copy selection" },
|
|
78
|
+
"tui.select.up": { defaultKeys: "up", description: "Move selection up" },
|
|
79
|
+
"tui.select.down": { defaultKeys: "down", description: "Move selection down" },
|
|
80
|
+
"tui.select.pageUp": { defaultKeys: "pageUp", description: "Selection page up" },
|
|
81
|
+
"tui.select.pageDown": {
|
|
82
|
+
defaultKeys: "pageDown",
|
|
83
|
+
description: "Selection page down",
|
|
84
|
+
},
|
|
85
|
+
"tui.select.confirm": { defaultKeys: "enter", description: "Confirm selection" },
|
|
86
|
+
"tui.select.cancel": {
|
|
87
|
+
defaultKeys: ["escape", "ctrl+c"],
|
|
88
|
+
description: "Cancel selection",
|
|
89
|
+
},
|
|
90
|
+
// These intentionally shadow the unmodified editor bindings in fullscreen mode.
|
|
91
|
+
"tui.altScreen.pageUp": {
|
|
92
|
+
defaultKeys: "pageUp",
|
|
93
|
+
description: "Scroll viewport up one page",
|
|
94
|
+
},
|
|
95
|
+
"tui.altScreen.pageDown": {
|
|
96
|
+
defaultKeys: "pageDown",
|
|
97
|
+
description: "Scroll viewport down one page",
|
|
98
|
+
},
|
|
99
|
+
"tui.altScreen.halfPageUp": {
|
|
100
|
+
defaultKeys: [],
|
|
101
|
+
description: "Scroll viewport up half a page",
|
|
102
|
+
},
|
|
103
|
+
"tui.altScreen.halfPageDown": {
|
|
104
|
+
defaultKeys: [],
|
|
105
|
+
description: "Scroll viewport down half a page",
|
|
106
|
+
},
|
|
107
|
+
"tui.altScreen.previousPrompt": {
|
|
108
|
+
defaultKeys: "ctrl+shift+up",
|
|
109
|
+
description: "Jump to previous semantic prompt",
|
|
110
|
+
},
|
|
111
|
+
"tui.altScreen.nextPrompt": {
|
|
112
|
+
defaultKeys: "ctrl+shift+down",
|
|
113
|
+
description: "Jump to next semantic prompt",
|
|
114
|
+
},
|
|
115
|
+
"tui.altScreen.top": { defaultKeys: "home", description: "Scroll viewport to top" },
|
|
116
|
+
"tui.altScreen.bottom": { defaultKeys: "end", description: "Scroll viewport to bottom" },
|
|
117
|
+
};
|
|
118
|
+
function normalizeKeys(keys) {
|
|
119
|
+
if (keys === undefined)
|
|
120
|
+
return [];
|
|
121
|
+
const keyList = Array.isArray(keys) ? keys : [keys];
|
|
122
|
+
const seen = new Set();
|
|
123
|
+
const result = [];
|
|
124
|
+
for (const key of keyList) {
|
|
125
|
+
if (!seen.has(key)) {
|
|
126
|
+
seen.add(key);
|
|
127
|
+
result.push(key);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
export class KeybindingsManager {
|
|
133
|
+
definitions;
|
|
134
|
+
userBindings;
|
|
135
|
+
keysById = new Map();
|
|
136
|
+
conflicts = [];
|
|
137
|
+
constructor(definitions, userBindings = {}) {
|
|
138
|
+
this.definitions = definitions;
|
|
139
|
+
this.userBindings = userBindings;
|
|
140
|
+
this.rebuild();
|
|
141
|
+
}
|
|
142
|
+
rebuild() {
|
|
143
|
+
this.keysById.clear();
|
|
144
|
+
this.conflicts = [];
|
|
145
|
+
const userClaims = new Map();
|
|
146
|
+
for (const [keybinding, keys] of Object.entries(this.userBindings)) {
|
|
147
|
+
if (!(keybinding in this.definitions))
|
|
148
|
+
continue;
|
|
149
|
+
for (const key of normalizeKeys(keys)) {
|
|
150
|
+
const claimants = userClaims.get(key) ?? new Set();
|
|
151
|
+
claimants.add(keybinding);
|
|
152
|
+
userClaims.set(key, claimants);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
for (const [key, keybindings] of userClaims) {
|
|
156
|
+
if (keybindings.size > 1) {
|
|
157
|
+
this.conflicts.push({ key, keybindings: [...keybindings] });
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
for (const [id, definition] of Object.entries(this.definitions)) {
|
|
161
|
+
const userKeys = this.userBindings[id];
|
|
162
|
+
const keys = userKeys === undefined ? normalizeKeys(definition.defaultKeys) : normalizeKeys(userKeys);
|
|
163
|
+
this.keysById.set(id, keys);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
matches(data, keybinding) {
|
|
167
|
+
const keys = this.keysById.get(keybinding) ?? [];
|
|
168
|
+
for (const key of keys) {
|
|
169
|
+
if (matchesKey(data, key))
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
getKeys(keybinding) {
|
|
175
|
+
return [...(this.keysById.get(keybinding) ?? [])];
|
|
176
|
+
}
|
|
177
|
+
getDefinition(keybinding) {
|
|
178
|
+
return this.definitions[keybinding];
|
|
179
|
+
}
|
|
180
|
+
getConflicts() {
|
|
181
|
+
return this.conflicts.map((conflict) => ({ ...conflict, keybindings: [...conflict.keybindings] }));
|
|
182
|
+
}
|
|
183
|
+
setUserBindings(userBindings) {
|
|
184
|
+
this.userBindings = userBindings;
|
|
185
|
+
this.rebuild();
|
|
186
|
+
}
|
|
187
|
+
getUserBindings() {
|
|
188
|
+
return { ...this.userBindings };
|
|
189
|
+
}
|
|
190
|
+
getResolvedBindings() {
|
|
191
|
+
const resolved = {};
|
|
192
|
+
for (const id of Object.keys(this.definitions)) {
|
|
193
|
+
const keys = this.keysById.get(id) ?? [];
|
|
194
|
+
resolved[id] = keys.length === 1 ? keys[0] : [...keys];
|
|
195
|
+
}
|
|
196
|
+
return resolved;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
let globalKeybindings = null;
|
|
200
|
+
export function setKeybindings(keybindings) {
|
|
201
|
+
globalKeybindings = keybindings;
|
|
202
|
+
}
|
|
203
|
+
export function getKeybindings() {
|
|
204
|
+
if (!globalKeybindings) {
|
|
205
|
+
globalKeybindings = new KeybindingsManager(TUI_KEYBINDINGS);
|
|
206
|
+
}
|
|
207
|
+
return globalKeybindings;
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=keybindings.js.map
|