@dex-ai/coding-agent 0.1.92
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/bin/dex.ts +402 -0
- package/package.json +45 -0
- package/src/__tests__/command-validation.test.ts +205 -0
- package/src/__tests__/history.test.ts +183 -0
- package/src/cli-extension.ts +153 -0
- package/src/commands/extension-loader.ts +399 -0
- package/src/commands/extension.ts +924 -0
- package/src/commands/update.ts +419 -0
- package/src/env.d.ts +5 -0
- package/src/extensions/cli-tui-components/ActivityPanel.vue +24 -0
- package/src/extensions/cli-tui-components/ActivityPanel.vue.compiled.ts +96 -0
- package/src/extensions/cli-tui-components/App.vue +127 -0
- package/src/extensions/cli-tui-components/App.vue.compiled.ts +374 -0
- package/src/extensions/cli-tui-components/ApprovalPrompt.vue +30 -0
- package/src/extensions/cli-tui-components/ApprovalPrompt.vue.compiled.ts +72 -0
- package/src/extensions/cli-tui-components/AskPanel.vue +228 -0
- package/src/extensions/cli-tui-components/AskPanel.vue.compiled.ts +419 -0
- package/src/extensions/cli-tui-components/CommandPalette.vue +19 -0
- package/src/extensions/cli-tui-components/CommandPalette.vue.compiled.ts +65 -0
- package/src/extensions/cli-tui-components/ConfirmModal.vue +29 -0
- package/src/extensions/cli-tui-components/ConfirmModal.vue.compiled.ts +72 -0
- package/src/extensions/cli-tui-components/DiffView.vue +139 -0
- package/src/extensions/cli-tui-components/DiffView.vue.compiled.ts +274 -0
- package/src/extensions/cli-tui-components/FormModal.vue +58 -0
- package/src/extensions/cli-tui-components/FormModal.vue.compiled.ts +156 -0
- package/src/extensions/cli-tui-components/Header.vue +13 -0
- package/src/extensions/cli-tui-components/Header.vue.compiled.ts +42 -0
- package/src/extensions/cli-tui-components/InputArea.vue +202 -0
- package/src/extensions/cli-tui-components/InputArea.vue.compiled.ts +243 -0
- package/src/extensions/cli-tui-components/InteractivePanel.vue +32 -0
- package/src/extensions/cli-tui-components/InteractivePanel.vue.compiled.ts +103 -0
- package/src/extensions/cli-tui-components/ListModal.vue +58 -0
- package/src/extensions/cli-tui-components/ListModal.vue.compiled.ts +130 -0
- package/src/extensions/cli-tui-components/MarkdownContent.ts +54 -0
- package/src/extensions/cli-tui-components/Messages.vue +68 -0
- package/src/extensions/cli-tui-components/Messages.vue.compiled.ts +253 -0
- package/src/extensions/cli-tui-components/Modal.vue +56 -0
- package/src/extensions/cli-tui-components/Modal.vue.compiled.ts +61 -0
- package/src/extensions/cli-tui-components/SettingsPanel.vue +178 -0
- package/src/extensions/cli-tui-components/SettingsPanel.vue.compiled.ts +359 -0
- package/src/extensions/cli-tui-components/Spinner.vue +19 -0
- package/src/extensions/cli-tui-components/Spinner.vue.compiled.ts +42 -0
- package/src/extensions/cli-tui-components/StatusBar.vue +45 -0
- package/src/extensions/cli-tui-components/StatusBar.vue.compiled.ts +106 -0
- package/src/extensions/cli-tui-components/SteeringPreview.vue +11 -0
- package/src/extensions/cli-tui-components/SteeringPreview.vue.compiled.ts +38 -0
- package/src/extensions/cli-tui-components/ThinkingBlock.vue +40 -0
- package/src/extensions/cli-tui-components/ThinkingBlock.vue.compiled.ts +82 -0
- package/src/extensions/cli-tui-components/ToolCall.vue +114 -0
- package/src/extensions/cli-tui-components/ToolCall.vue.compiled.ts +319 -0
- package/src/extensions/cli-tui-components/UserMessage.vue +40 -0
- package/src/extensions/cli-tui-components/UserMessage.vue.compiled.ts +148 -0
- package/src/extensions/cli-tui-components/ask-panel-controller.ts +573 -0
- package/src/extensions/cli-tui-components/settings-panel-controller.ts +958 -0
- package/src/extensions/cli-tui.ts +2349 -0
- package/src/extensions/debug.ts +46 -0
- package/src/extensions/headless.ts +55 -0
- package/src/extensions/modal-system.ts +719 -0
- package/src/host.ts +505 -0
- package/src/index.ts +9 -0
- package/src/input/history.ts +233 -0
- package/src/input/index.ts +6 -0
- package/src/panels/dynamic-panel.ts +5 -0
- package/src/panels/index.ts +43 -0
- package/src/panels/state.ts +73 -0
- package/src/panels/types.ts +79 -0
- package/src/panels/widget.ts +25 -0
- package/src/provider-registry.ts +44 -0
- package/src/stderr-capture.ts +248 -0
- package/src/types.ts +20 -0
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import * as _Vue from "@vue/runtime-core";
|
|
2
|
+
const {
|
|
3
|
+
toDisplayString: _toDisplayString,
|
|
4
|
+
openBlock: _openBlock,
|
|
5
|
+
createElementBlock: _createElementBlock,
|
|
6
|
+
createElementVNode: _createElementVNode,
|
|
7
|
+
createVNode: _createVNode,
|
|
8
|
+
createBlock: _createBlock,
|
|
9
|
+
createCommentVNode: _createCommentVNode,
|
|
10
|
+
Fragment: _Fragment,
|
|
11
|
+
renderList: _renderList,
|
|
12
|
+
} = _Vue;
|
|
13
|
+
|
|
14
|
+
import { defineComponent as _defineComponent } from "@vue/runtime-core";
|
|
15
|
+
import { computed } from "@vue/runtime-core";
|
|
16
|
+
import type { AskTab, AskTabResult, AskTabState } from "./ask-panel-controller";
|
|
17
|
+
|
|
18
|
+
const __sfc_main = /*@__PURE__*/ _defineComponent({
|
|
19
|
+
__name: "AskPanel",
|
|
20
|
+
props: {
|
|
21
|
+
tabs: { type: Array, required: true },
|
|
22
|
+
singleTab: { type: Boolean, required: true },
|
|
23
|
+
activeTabIndex: { type: Number, required: true },
|
|
24
|
+
onSubmitTab: { type: Boolean, required: true },
|
|
25
|
+
tabStates: { type: Array, required: true },
|
|
26
|
+
focusedOptionIndex: { type: Number, required: true },
|
|
27
|
+
checkedValues: { type: Set, required: true },
|
|
28
|
+
freeTextFocused: { type: Boolean, required: true },
|
|
29
|
+
freeTextBuffer: { type: String, required: true },
|
|
30
|
+
actionFocused: { type: Boolean, required: true },
|
|
31
|
+
tabResults: { type: Array, required: true },
|
|
32
|
+
scrollOffset: { type: Number, required: true },
|
|
33
|
+
visibleOptions: { type: Number, required: true },
|
|
34
|
+
},
|
|
35
|
+
setup(__props: any, { expose: __expose }) {
|
|
36
|
+
__expose();
|
|
37
|
+
|
|
38
|
+
const props = __props;
|
|
39
|
+
|
|
40
|
+
const currentTab = computed(
|
|
41
|
+
() => props.tabs[props.activeTabIndex] as AskTab | undefined,
|
|
42
|
+
);
|
|
43
|
+
const currentQuestion = computed(() => currentTab.value?.question ?? "");
|
|
44
|
+
const multiSelect = computed(() => currentTab.value?.multiSelect ?? false);
|
|
45
|
+
const currentTabAllowsFreeText = computed(
|
|
46
|
+
() => currentTab.value?.allowFreeText ?? false,
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const computedVisibleOptions = computed(() => {
|
|
50
|
+
const tab = currentTab.value;
|
|
51
|
+
if (!tab) return [];
|
|
52
|
+
return tab.options.slice(
|
|
53
|
+
props.scrollOffset,
|
|
54
|
+
props.scrollOffset + props.visibleOptions,
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
function isOptionFocused(visibleIndex: number): boolean {
|
|
59
|
+
if (props.actionFocused || props.freeTextFocused) return false;
|
|
60
|
+
return props.scrollOffset + visibleIndex === props.focusedOptionIndex;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function isOptionChecked(option: { value: string }): boolean {
|
|
64
|
+
return props.checkedValues.has(option.value);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function checkMark(option: { value: string }): string {
|
|
68
|
+
const checked = props.checkedValues.has(option.value);
|
|
69
|
+
if (multiSelect.value) {
|
|
70
|
+
return checked ? "[×]" : "[ ]";
|
|
71
|
+
}
|
|
72
|
+
return checked ? "(●)" : "( )";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function tabColor(index: number): string {
|
|
76
|
+
const st = (props.tabStates as AskTabState[])[index];
|
|
77
|
+
if (index === props.activeTabIndex && !props.onSubmitTab) return "accent";
|
|
78
|
+
if (st === "completed") return "text";
|
|
79
|
+
return "muted";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function tabLabel(tab: AskTab, index: number): string {
|
|
83
|
+
const st = (props.tabStates as AskTabState[])[index];
|
|
84
|
+
const prefix = st === "completed" ? "✓ " : "";
|
|
85
|
+
if (index === props.activeTabIndex && !props.onSubmitTab) {
|
|
86
|
+
return `[${prefix}${tab.label}]`;
|
|
87
|
+
}
|
|
88
|
+
return `${prefix}${tab.label}`;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function formatResult(result: AskTabResult): string {
|
|
92
|
+
const parts: string[] = [];
|
|
93
|
+
if (result.selected.length > 0) {
|
|
94
|
+
parts.push(result.selected.join(", "));
|
|
95
|
+
}
|
|
96
|
+
if (result.freeText) {
|
|
97
|
+
parts.push(`"${result.freeText}"`);
|
|
98
|
+
}
|
|
99
|
+
return parts.join(" + ") || "(none)";
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const __returned__ = {
|
|
103
|
+
props,
|
|
104
|
+
currentTab,
|
|
105
|
+
currentQuestion,
|
|
106
|
+
multiSelect,
|
|
107
|
+
currentTabAllowsFreeText,
|
|
108
|
+
computedVisibleOptions,
|
|
109
|
+
isOptionFocused,
|
|
110
|
+
isOptionChecked,
|
|
111
|
+
checkMark,
|
|
112
|
+
tabColor,
|
|
113
|
+
tabLabel,
|
|
114
|
+
formatResult,
|
|
115
|
+
};
|
|
116
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
117
|
+
enumerable: false,
|
|
118
|
+
value: true,
|
|
119
|
+
});
|
|
120
|
+
return __returned__;
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const render = (
|
|
125
|
+
_ctx: any,
|
|
126
|
+
_cache: any,
|
|
127
|
+
$props: any,
|
|
128
|
+
$setup: any,
|
|
129
|
+
$data: any,
|
|
130
|
+
$options: any,
|
|
131
|
+
) => (
|
|
132
|
+
_openBlock(),
|
|
133
|
+
_createElementBlock(
|
|
134
|
+
"stack",
|
|
135
|
+
{ style: { borderTop: "solid", borderTopColor: "accent" } },
|
|
136
|
+
[
|
|
137
|
+
// Title
|
|
138
|
+
_createElementVNode("line", { style: { paddingLeft: 1 } }, [
|
|
139
|
+
_createElementVNode("text", { bold: "", color: "accent" }, "❯ "),
|
|
140
|
+
_createElementVNode(
|
|
141
|
+
"text",
|
|
142
|
+
{ bold: "", color: "accent" },
|
|
143
|
+
_toDisplayString(
|
|
144
|
+
$props.singleTab ? ($props.tabs[0]?.label ?? "Ask") : "Ask",
|
|
145
|
+
),
|
|
146
|
+
1 /* TEXT */,
|
|
147
|
+
),
|
|
148
|
+
_createElementVNode("text", { dim: "" }, " (esc to cancel)"),
|
|
149
|
+
]),
|
|
150
|
+
// Tab bar (multi-tab only)
|
|
151
|
+
!$props.singleTab
|
|
152
|
+
? (_openBlock(),
|
|
153
|
+
_createElementBlock(
|
|
154
|
+
"line",
|
|
155
|
+
{ key: 0, style: { paddingLeft: 2, paddingTop: 1 } },
|
|
156
|
+
[
|
|
157
|
+
...((_openBlock(true),
|
|
158
|
+
_createElementBlock(
|
|
159
|
+
_Fragment,
|
|
160
|
+
null,
|
|
161
|
+
_renderList($props.tabs, (tab: any, i: number) =>
|
|
162
|
+
_createElementVNode(
|
|
163
|
+
"text",
|
|
164
|
+
{
|
|
165
|
+
key: i,
|
|
166
|
+
color: $setup.tabColor(i),
|
|
167
|
+
style: {
|
|
168
|
+
fontWeight:
|
|
169
|
+
i === $props.activeTabIndex && !$props.onSubmitTab
|
|
170
|
+
? "bold"
|
|
171
|
+
: "normal",
|
|
172
|
+
paddingRight: 2,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
_toDisplayString($setup.tabLabel(tab, i)),
|
|
176
|
+
5 /* TEXT, STYLE */,
|
|
177
|
+
),
|
|
178
|
+
),
|
|
179
|
+
128 /* KEYED_FRAGMENT */,
|
|
180
|
+
)) as any),
|
|
181
|
+
_createElementVNode(
|
|
182
|
+
"text",
|
|
183
|
+
{
|
|
184
|
+
color: $props.onSubmitTab ? "accent" : "muted",
|
|
185
|
+
style: {
|
|
186
|
+
fontWeight: $props.onSubmitTab ? "bold" : "normal",
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
"[Submit]",
|
|
190
|
+
4 /* STYLE */,
|
|
191
|
+
),
|
|
192
|
+
],
|
|
193
|
+
))
|
|
194
|
+
: _createCommentVNode("v-if", true),
|
|
195
|
+
_createElementVNode("line"),
|
|
196
|
+
// Submit/Review tab vs Active tab
|
|
197
|
+
$props.onSubmitTab
|
|
198
|
+
? (_openBlock(),
|
|
199
|
+
_createElementBlock(_Fragment, { key: 1 }, [
|
|
200
|
+
_createElementVNode("line", { style: { paddingLeft: 3 } }, [
|
|
201
|
+
_createElementVNode(
|
|
202
|
+
"text",
|
|
203
|
+
{ bold: "" },
|
|
204
|
+
"Review your selections:",
|
|
205
|
+
),
|
|
206
|
+
]),
|
|
207
|
+
_createElementVNode("line"),
|
|
208
|
+
...((_openBlock(true),
|
|
209
|
+
_createElementBlock(
|
|
210
|
+
_Fragment,
|
|
211
|
+
null,
|
|
212
|
+
_renderList(
|
|
213
|
+
$props.tabResults,
|
|
214
|
+
(result: any, i: number) => (
|
|
215
|
+
_openBlock(),
|
|
216
|
+
_createElementBlock(_Fragment, { key: i }, [
|
|
217
|
+
result
|
|
218
|
+
? (_openBlock(),
|
|
219
|
+
_createElementBlock(
|
|
220
|
+
"line",
|
|
221
|
+
{ key: 0, style: { paddingLeft: 4 } },
|
|
222
|
+
[
|
|
223
|
+
_createElementVNode(
|
|
224
|
+
"text",
|
|
225
|
+
{ color: "accent" },
|
|
226
|
+
_toDisplayString(i + 1 + ". "),
|
|
227
|
+
1 /* TEXT */,
|
|
228
|
+
),
|
|
229
|
+
_createElementVNode(
|
|
230
|
+
"text",
|
|
231
|
+
null,
|
|
232
|
+
_toDisplayString(result.label + ": "),
|
|
233
|
+
1 /* TEXT */,
|
|
234
|
+
),
|
|
235
|
+
_createElementVNode(
|
|
236
|
+
"text",
|
|
237
|
+
{ dim: "" },
|
|
238
|
+
_toDisplayString($setup.formatResult(result)),
|
|
239
|
+
1 /* TEXT */,
|
|
240
|
+
),
|
|
241
|
+
],
|
|
242
|
+
))
|
|
243
|
+
: _createCommentVNode("v-if", true),
|
|
244
|
+
])
|
|
245
|
+
),
|
|
246
|
+
),
|
|
247
|
+
128 /* KEYED_FRAGMENT */,
|
|
248
|
+
)) as any),
|
|
249
|
+
_createElementVNode("line"),
|
|
250
|
+
_createElementVNode("line", { style: { paddingLeft: 3 } }, [
|
|
251
|
+
_createElementVNode(
|
|
252
|
+
"text",
|
|
253
|
+
{ color: "accent", bold: "" },
|
|
254
|
+
"↵ Submit",
|
|
255
|
+
),
|
|
256
|
+
_createElementVNode(
|
|
257
|
+
"text",
|
|
258
|
+
{ dim: "" },
|
|
259
|
+
" • press number to edit tab",
|
|
260
|
+
),
|
|
261
|
+
]),
|
|
262
|
+
]))
|
|
263
|
+
: (_openBlock(),
|
|
264
|
+
_createElementBlock(_Fragment, { key: 2 }, [
|
|
265
|
+
// Question text
|
|
266
|
+
_createElementVNode("line", { style: { paddingLeft: 3 } }, [
|
|
267
|
+
_createElementVNode(
|
|
268
|
+
"text",
|
|
269
|
+
null,
|
|
270
|
+
_toDisplayString($setup.currentQuestion),
|
|
271
|
+
1 /* TEXT */,
|
|
272
|
+
),
|
|
273
|
+
]),
|
|
274
|
+
_createElementVNode("line"),
|
|
275
|
+
// Options
|
|
276
|
+
...((_openBlock(true),
|
|
277
|
+
_createElementBlock(
|
|
278
|
+
_Fragment,
|
|
279
|
+
null,
|
|
280
|
+
_renderList(
|
|
281
|
+
$setup.computedVisibleOptions,
|
|
282
|
+
(option: any, i: number) => (
|
|
283
|
+
_openBlock(),
|
|
284
|
+
_createElementBlock(
|
|
285
|
+
"line",
|
|
286
|
+
{ key: option.value, style: { paddingLeft: 4 } },
|
|
287
|
+
[
|
|
288
|
+
_createElementVNode(
|
|
289
|
+
"text",
|
|
290
|
+
{
|
|
291
|
+
color: $setup.isOptionFocused(i) ? "accent" : "text",
|
|
292
|
+
},
|
|
293
|
+
_toDisplayString(
|
|
294
|
+
$setup.isOptionFocused(i) ? "▸ " : " ",
|
|
295
|
+
),
|
|
296
|
+
9 /* TEXT, PROPS */,
|
|
297
|
+
["color"],
|
|
298
|
+
),
|
|
299
|
+
_createElementVNode(
|
|
300
|
+
"text",
|
|
301
|
+
{
|
|
302
|
+
color: $setup.isOptionChecked(option)
|
|
303
|
+
? "accent"
|
|
304
|
+
: "muted",
|
|
305
|
+
},
|
|
306
|
+
_toDisplayString($setup.checkMark(option) + " "),
|
|
307
|
+
9 /* TEXT, PROPS */,
|
|
308
|
+
["color"],
|
|
309
|
+
),
|
|
310
|
+
_createElementVNode(
|
|
311
|
+
"text",
|
|
312
|
+
{
|
|
313
|
+
color: $setup.isOptionFocused(i) ? "text" : "muted",
|
|
314
|
+
style: {
|
|
315
|
+
fontWeight: $setup.isOptionFocused(i)
|
|
316
|
+
? "bold"
|
|
317
|
+
: "normal",
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
_toDisplayString(option.label),
|
|
321
|
+
5 /* TEXT, STYLE */,
|
|
322
|
+
),
|
|
323
|
+
option.description
|
|
324
|
+
? _createElementVNode(
|
|
325
|
+
"text",
|
|
326
|
+
{ key: 0, dim: "" },
|
|
327
|
+
_toDisplayString(" " + option.description),
|
|
328
|
+
1 /* TEXT */,
|
|
329
|
+
)
|
|
330
|
+
: _createCommentVNode("v-if", true),
|
|
331
|
+
],
|
|
332
|
+
)
|
|
333
|
+
),
|
|
334
|
+
),
|
|
335
|
+
128 /* KEYED_FRAGMENT */,
|
|
336
|
+
)) as any),
|
|
337
|
+
// Free text input
|
|
338
|
+
$setup.currentTabAllowsFreeText
|
|
339
|
+
? (_openBlock(),
|
|
340
|
+
_createElementBlock(
|
|
341
|
+
"line",
|
|
342
|
+
{ key: 0, style: { paddingLeft: 4 } },
|
|
343
|
+
[
|
|
344
|
+
_createElementVNode(
|
|
345
|
+
"text",
|
|
346
|
+
{
|
|
347
|
+
color: $props.freeTextFocused ? "accent" : "text",
|
|
348
|
+
},
|
|
349
|
+
_toDisplayString($props.freeTextFocused ? "▸ " : " "),
|
|
350
|
+
9 /* TEXT, PROPS */,
|
|
351
|
+
["color"],
|
|
352
|
+
),
|
|
353
|
+
_createElementVNode(
|
|
354
|
+
"text",
|
|
355
|
+
{
|
|
356
|
+
color: $props.freeTextFocused ? "accent" : "muted",
|
|
357
|
+
},
|
|
358
|
+
"✎ ",
|
|
359
|
+
8 /* PROPS */,
|
|
360
|
+
["color"],
|
|
361
|
+
),
|
|
362
|
+
$props.freeTextBuffer
|
|
363
|
+
? _createElementVNode(
|
|
364
|
+
"text",
|
|
365
|
+
{
|
|
366
|
+
key: 0,
|
|
367
|
+
color: $props.freeTextFocused ? "text" : "muted",
|
|
368
|
+
},
|
|
369
|
+
_toDisplayString($props.freeTextBuffer),
|
|
370
|
+
9 /* TEXT, PROPS */,
|
|
371
|
+
["color"],
|
|
372
|
+
)
|
|
373
|
+
: _createElementVNode(
|
|
374
|
+
"text",
|
|
375
|
+
{ key: 1, dim: "" },
|
|
376
|
+
"type custom response...",
|
|
377
|
+
),
|
|
378
|
+
],
|
|
379
|
+
))
|
|
380
|
+
: _createCommentVNode("v-if", true),
|
|
381
|
+
_createElementVNode("line"),
|
|
382
|
+
// Action bar
|
|
383
|
+
_createElementVNode("line", { style: { paddingLeft: 3 } }, [
|
|
384
|
+
_createElementVNode(
|
|
385
|
+
"text",
|
|
386
|
+
{
|
|
387
|
+
color: $props.actionFocused ? "accent" : "muted",
|
|
388
|
+
style: {
|
|
389
|
+
fontWeight: $props.actionFocused ? "bold" : "normal",
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
_toDisplayString($props.singleTab ? "↵ Submit" : "↵ Next"),
|
|
393
|
+
5 /* TEXT, STYLE */,
|
|
394
|
+
),
|
|
395
|
+
_createElementVNode("text", { dim: "" }, " • "),
|
|
396
|
+
_createElementVNode(
|
|
397
|
+
"text",
|
|
398
|
+
{ dim: "" },
|
|
399
|
+
_toDisplayString(
|
|
400
|
+
$setup.multiSelect ? "space: toggle" : "enter: select",
|
|
401
|
+
),
|
|
402
|
+
1 /* TEXT */,
|
|
403
|
+
),
|
|
404
|
+
!$props.singleTab
|
|
405
|
+
? _createElementVNode(
|
|
406
|
+
"text",
|
|
407
|
+
{ key: 0, dim: "" },
|
|
408
|
+
" • ctrl+←/→: tabs",
|
|
409
|
+
)
|
|
410
|
+
: _createCommentVNode("v-if", true),
|
|
411
|
+
]),
|
|
412
|
+
])),
|
|
413
|
+
],
|
|
414
|
+
)
|
|
415
|
+
);
|
|
416
|
+
|
|
417
|
+
__sfc_main.render = render;
|
|
418
|
+
|
|
419
|
+
export default __sfc_main;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<stack>
|
|
3
|
+
<line v-for="(item, i) in items" :key="item.name">
|
|
4
|
+
<text v-if="i === selectedIndex" bold color="accent" :style="{ paddingLeft: 1 }">❯ /{{ item.name }}</text>
|
|
5
|
+
<text v-else :style="{ paddingLeft: 3 }">/{{ item.name }}</text>
|
|
6
|
+
<text muted :style="{ paddingLeft: 1 }">{{ item.description }}</text>
|
|
7
|
+
</line>
|
|
8
|
+
<line v-if="items.length === 0">
|
|
9
|
+
<text muted :style="{ paddingLeft: 3 }">No matching commands</text>
|
|
10
|
+
</line>
|
|
11
|
+
</stack>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
defineProps<{
|
|
16
|
+
items: Array<{ name: string; description: string; isSubcommand?: boolean }>;
|
|
17
|
+
selectedIndex: number;
|
|
18
|
+
}>();
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as _Vue from "@vue/runtime-core";
|
|
2
|
+
const { h: _h, toDisplayString: _toDisplayString, openBlock: _openBlock, createElementBlock: _createElementBlock, createElementVNode: _createElementVNode, createVNode: _createVNode, createBlock: _createBlock, createCommentVNode: _createCommentVNode, Fragment: _Fragment, renderList: _renderList, withCtx: _withCtx, createTextVNode: _createTextVNode, resolveComponent: _resolveComponent, normalizeStyle: _normalizeStyle, normalizeClass: _normalizeClass, normalizeProps: _normalizeProps, guardReactiveProps: _guardReactiveProps, mergeProps: _mergeProps, withDirectives: _withDirectives, resolveDynamicComponent: _resolveDynamicComponent } = _Vue;
|
|
3
|
+
|
|
4
|
+
import { defineComponent as _defineComponent } from "@vue/runtime-core"
|
|
5
|
+
|
|
6
|
+
const __sfc_main = /*@__PURE__*/_defineComponent({
|
|
7
|
+
__name: 'CommandPalette',
|
|
8
|
+
props: {
|
|
9
|
+
items: { type: Array, required: true },
|
|
10
|
+
selectedIndex: { type: Number, required: true }
|
|
11
|
+
},
|
|
12
|
+
setup(__props: any, { expose: __expose }) {
|
|
13
|
+
__expose();
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const __returned__ = { }
|
|
18
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })
|
|
19
|
+
return __returned__
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const _hoisted_1 = {
|
|
25
|
+
key: 0,
|
|
26
|
+
bold: "",
|
|
27
|
+
color: "accent",
|
|
28
|
+
style: { paddingLeft: 1 }
|
|
29
|
+
}
|
|
30
|
+
const _hoisted_2 = {
|
|
31
|
+
key: 1,
|
|
32
|
+
style: { paddingLeft: 3 }
|
|
33
|
+
}
|
|
34
|
+
const _hoisted_3 = {
|
|
35
|
+
muted: "",
|
|
36
|
+
style: { paddingLeft: 1 }
|
|
37
|
+
}
|
|
38
|
+
const _hoisted_4 = { key: 0 }
|
|
39
|
+
|
|
40
|
+
const render = function(_ctx, _cache, $props, $setup, $data, $options) {
|
|
41
|
+
return (_openBlock(), _createElementBlock("stack", null, [
|
|
42
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList($props.items, (item, i) => {
|
|
43
|
+
return (_openBlock(), _createElementBlock("line", {
|
|
44
|
+
key: item.name
|
|
45
|
+
}, [
|
|
46
|
+
(i === $props.selectedIndex)
|
|
47
|
+
? (_openBlock(), _createElementBlock("text", _hoisted_1, "❯ /" + _toDisplayString(item.name), 1 /* TEXT */))
|
|
48
|
+
: (_openBlock(), _createElementBlock("text", _hoisted_2, "/" + _toDisplayString(item.name), 1 /* TEXT */)),
|
|
49
|
+
_createElementVNode("text", _hoisted_3, _toDisplayString(item.description), 1 /* TEXT */)
|
|
50
|
+
]))
|
|
51
|
+
}), 128 /* KEYED_FRAGMENT */)),
|
|
52
|
+
($props.items.length === 0)
|
|
53
|
+
? (_openBlock(), _createElementBlock("line", _hoisted_4, [...(_cache[0] || (_cache[0] = [
|
|
54
|
+
_createElementVNode("text", {
|
|
55
|
+
muted: "",
|
|
56
|
+
style: { paddingLeft: 3 }
|
|
57
|
+
}, "No matching commands", -1 /* CACHED */)
|
|
58
|
+
]))]))
|
|
59
|
+
: _createCommentVNode("v-if", true)
|
|
60
|
+
]))
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
__sfc_main.render = render;
|
|
64
|
+
|
|
65
|
+
export default __sfc_main;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<stack>
|
|
3
|
+
<line borderTop="solid" :style="{ borderTopColor: 'accent' }">
|
|
4
|
+
<text bold color="accent"> {{ title }} </text>
|
|
5
|
+
</line>
|
|
6
|
+
<line v-if="body">
|
|
7
|
+
<text :style="{ paddingLeft: 2 }">{{ body }}</text>
|
|
8
|
+
</line>
|
|
9
|
+
<spacer />
|
|
10
|
+
<line v-for="(opt, i) in options" :key="opt.key">
|
|
11
|
+
<text :style="{ paddingLeft: 2 }">
|
|
12
|
+
<text bold>({{ opt.key }})</text>
|
|
13
|
+
<text :style="{ paddingLeft: 1 }">{{ opt.label }}</text>
|
|
14
|
+
</text>
|
|
15
|
+
</line>
|
|
16
|
+
<spacer />
|
|
17
|
+
<line borderBottom="solid" :style="{ borderBottomColor: 'subtle' }">
|
|
18
|
+
<text muted>Press key to choose · esc cancel</text>
|
|
19
|
+
</line>
|
|
20
|
+
</stack>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
defineProps<{
|
|
25
|
+
title: string;
|
|
26
|
+
body?: string;
|
|
27
|
+
options: Array<{ key: string; label: string; value: string }>;
|
|
28
|
+
}>();
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as _Vue from "@vue/runtime-core";
|
|
2
|
+
const { h: _h, toDisplayString: _toDisplayString, openBlock: _openBlock, createElementBlock: _createElementBlock, createElementVNode: _createElementVNode, createVNode: _createVNode, createBlock: _createBlock, createCommentVNode: _createCommentVNode, Fragment: _Fragment, renderList: _renderList, withCtx: _withCtx, createTextVNode: _createTextVNode, resolveComponent: _resolveComponent, normalizeStyle: _normalizeStyle, normalizeClass: _normalizeClass, normalizeProps: _normalizeProps, guardReactiveProps: _guardReactiveProps, mergeProps: _mergeProps, withDirectives: _withDirectives, resolveDynamicComponent: _resolveDynamicComponent } = _Vue;
|
|
3
|
+
|
|
4
|
+
import { defineComponent as _defineComponent } from "@vue/runtime-core"
|
|
5
|
+
|
|
6
|
+
const __sfc_main = /*@__PURE__*/_defineComponent({
|
|
7
|
+
__name: 'ConfirmModal',
|
|
8
|
+
props: {
|
|
9
|
+
title: { type: String, required: true },
|
|
10
|
+
body: { type: String, required: false },
|
|
11
|
+
options: { type: Array, required: true }
|
|
12
|
+
},
|
|
13
|
+
setup(__props: any, { expose: __expose }) {
|
|
14
|
+
__expose();
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const __returned__ = { }
|
|
19
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })
|
|
20
|
+
return __returned__
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const _hoisted_1 = {
|
|
26
|
+
borderTop: "solid",
|
|
27
|
+
style: { borderTopColor: 'accent' }
|
|
28
|
+
}
|
|
29
|
+
const _hoisted_2 = {
|
|
30
|
+
bold: "",
|
|
31
|
+
color: "accent"
|
|
32
|
+
}
|
|
33
|
+
const _hoisted_3 = { key: 0 }
|
|
34
|
+
const _hoisted_4 = { style: { paddingLeft: 2 } }
|
|
35
|
+
const _hoisted_5 = { style: { paddingLeft: 2 } }
|
|
36
|
+
const _hoisted_6 = { bold: "" }
|
|
37
|
+
const _hoisted_7 = { style: { paddingLeft: 1 } }
|
|
38
|
+
|
|
39
|
+
const render = function(_ctx, _cache, $props, $setup, $data, $options) {
|
|
40
|
+
return (_openBlock(), _createElementBlock("stack", null, [
|
|
41
|
+
_createElementVNode("line", _hoisted_1, [
|
|
42
|
+
_createElementVNode("text", _hoisted_2, _toDisplayString($props.title), 1 /* TEXT */)
|
|
43
|
+
]),
|
|
44
|
+
($props.body)
|
|
45
|
+
? (_openBlock(), _createElementBlock("line", _hoisted_3, [
|
|
46
|
+
_createElementVNode("text", _hoisted_4, _toDisplayString($props.body), 1 /* TEXT */)
|
|
47
|
+
]))
|
|
48
|
+
: _createCommentVNode("v-if", true),
|
|
49
|
+
_cache[0] || (_cache[0] = _createElementVNode("spacer", null, null, -1 /* CACHED */)),
|
|
50
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList($props.options, (opt, i) => {
|
|
51
|
+
return (_openBlock(), _createElementBlock("line", {
|
|
52
|
+
key: opt.key
|
|
53
|
+
}, [
|
|
54
|
+
_createElementVNode("text", _hoisted_5, [
|
|
55
|
+
_createElementVNode("text", _hoisted_6, "(" + _toDisplayString(opt.key) + ")", 1 /* TEXT */),
|
|
56
|
+
_createElementVNode("text", _hoisted_7, _toDisplayString(opt.label), 1 /* TEXT */)
|
|
57
|
+
])
|
|
58
|
+
]))
|
|
59
|
+
}), 128 /* KEYED_FRAGMENT */)),
|
|
60
|
+
_cache[1] || (_cache[1] = _createElementVNode("spacer", null, null, -1 /* CACHED */)),
|
|
61
|
+
_cache[2] || (_cache[2] = _createElementVNode("line", {
|
|
62
|
+
borderBottom: "solid",
|
|
63
|
+
style: { borderBottomColor: 'subtle' }
|
|
64
|
+
}, [
|
|
65
|
+
_createElementVNode("text", { muted: "" }, "Press key to choose · esc cancel")
|
|
66
|
+
], -1 /* CACHED */))
|
|
67
|
+
]))
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
__sfc_main.render = render;
|
|
71
|
+
|
|
72
|
+
export default __sfc_main;
|