@sortedyuan/maybecode 0.3.2 → 0.5.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 +166 -55
- package/README.zh-CN.md +267 -0
- package/dist/application.d.ts +40 -34
- package/dist/application.d.ts.map +1 -1
- package/dist/application.js +290 -170
- package/dist/application.js.map +1 -1
- package/dist/args.d.ts +2 -2
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +50 -27
- package/dist/args.js.map +1 -1
- package/dist/bin.js +82 -71
- package/dist/bin.js.map +4 -4
- package/dist/cli/chunk-3IORPKBL.js +3572 -0
- package/dist/cli/chunk-3IORPKBL.js.map +7 -0
- package/dist/cli/{chunk-LVTRXPDS.js → chunk-4B2Z6KW7.js} +1547 -1536
- package/dist/cli/chunk-4B2Z6KW7.js.map +7 -0
- package/dist/cli/{chunk-JT6VBKOM.js → chunk-4WG6JIJJ.js} +127 -33
- package/dist/cli/{chunk-JT6VBKOM.js.map → chunk-4WG6JIJJ.js.map} +3 -3
- package/dist/cli/{chunk-K5JWPNSY.js → chunk-5SLWALZK.js} +3521 -16164
- package/dist/cli/chunk-5SLWALZK.js.map +7 -0
- package/dist/cli/chunk-MNBYXL5Y.js +132 -0
- package/dist/cli/chunk-MNBYXL5Y.js.map +7 -0
- package/dist/cli/{chunk-F4XRPLUM.js → chunk-SLWLUEHQ.js} +226 -86
- package/dist/cli/chunk-SLWLUEHQ.js.map +7 -0
- package/dist/cli/chunk-UQDZ55LQ.js +199 -0
- package/dist/cli/chunk-UQDZ55LQ.js.map +7 -0
- package/dist/cli/{chunk-7ISOHFS7.js → chunk-WMSG5ZTR.js} +717 -388
- package/dist/cli/chunk-WMSG5ZTR.js.map +7 -0
- package/dist/cli/chunk-WVIRS76R.js +4057 -0
- package/dist/cli/chunk-WVIRS76R.js.map +7 -0
- package/dist/cli/{chunk-HOU5ITUK.js → chunk-XTEMRAQW.js} +1 -1
- package/dist/cli/chunk-XTEMRAQW.js.map +7 -0
- package/dist/cli/chunk-Z3BOPBVU.js +91 -0
- package/dist/cli/chunk-Z3BOPBVU.js.map +7 -0
- package/dist/cli/{configured-WHY3GGAJ.js → configured-ACNM6TRQ.js} +10 -9
- package/dist/cli/{file-type-R2T7TBHI.js → file-type-HLHPV7WC.js} +817 -13
- package/dist/cli/file-type-HLHPV7WC.js.map +7 -0
- package/dist/cli/mcp-auth-XD5U7WCV.js +74 -0
- package/dist/cli/mcp-auth-XD5U7WCV.js.map +7 -0
- package/dist/cli/onboarding-WQWCPYEO.js +530 -0
- package/dist/cli/onboarding-WQWCPYEO.js.map +7 -0
- package/dist/cli/onboarding-check-HRRI5OJ7.js +32 -0
- package/dist/cli/onboarding-check-HRRI5OJ7.js.map +7 -0
- package/dist/cli/{retained-tui-VJ3VX4R3.js → retained-tui-QF5VMYLC.js} +788 -332
- package/dist/cli/retained-tui-QF5VMYLC.js.map +7 -0
- package/dist/cli/{sixel-LWTCM76G.js → sixel-ISZ4FZ3U.js} +37 -37
- package/dist/cli/{sixel-LWTCM76G.js.map → sixel-ISZ4FZ3U.js.map} +1 -1
- package/dist/cli/{team-T7G7PPNN.js → team-O2I5BXHM.js} +7 -6
- package/dist/cli/{team-v2-JGBBQ7FR.js → team-v2-YYO2G7DJ.js} +816 -390
- package/dist/cli/team-v2-YYO2G7DJ.js.map +7 -0
- package/dist/cli/{web-server-FOMNPY7Q.js → web-server-SXMH6FGA.js} +55 -19
- package/dist/cli/web-server-SXMH6FGA.js.map +7 -0
- package/dist/cli/{web-ui-COB6PKC5.js → web-ui-UWQUFE4W.js} +7 -6
- package/dist/config-schema.json +337 -0
- package/dist/configured.d.ts +18 -11
- package/dist/configured.d.ts.map +1 -1
- package/dist/configured.js +213 -390
- package/dist/configured.js.map +1 -1
- package/dist/controller.d.ts +19 -18
- package/dist/controller.d.ts.map +1 -1
- package/dist/delegation-commands.d.ts +1 -1
- package/dist/delegation-commands.d.ts.map +1 -1
- package/dist/delegation-commands.js +8 -8
- package/dist/delegation-commands.js.map +1 -1
- package/dist/errors.d.ts +2 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +2 -1
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +8 -6
- package/dist/events.d.ts.map +1 -1
- package/dist/fork-picker.d.ts.map +1 -1
- package/dist/fork-picker.js +19 -5
- package/dist/fork-picker.js.map +1 -1
- package/dist/git-request.d.ts +6 -6
- package/dist/git-request.d.ts.map +1 -1
- package/dist/git-request.js +28 -15
- package/dist/git-request.js.map +1 -1
- package/dist/goal-commands.d.ts +1 -1
- package/dist/goal-commands.d.ts.map +1 -1
- package/dist/goal-commands.js +12 -5
- package/dist/goal-commands.js.map +1 -1
- package/dist/index.d.ts +5 -37
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -36
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +2 -7
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +7 -15
- package/dist/instructions.js.map +1 -1
- package/dist/keymap.d.ts +2 -2
- package/dist/keymap.d.ts.map +1 -1
- package/dist/keymap.js +2 -2
- package/dist/keymap.js.map +1 -1
- package/dist/maybecode-config.schema.json +1765 -0
- package/dist/mcp-auth.d.ts +1 -1
- package/dist/mcp-auth.d.ts.map +1 -1
- package/dist/mcp-auth.js +11 -8
- package/dist/mcp-auth.js.map +1 -1
- package/dist/mcp-commands.d.ts.map +1 -1
- package/dist/mcp-commands.js +18 -4
- package/dist/mcp-commands.js.map +1 -1
- package/dist/mcp-interaction-ui.d.ts.map +1 -1
- package/dist/mcp-interaction-ui.js +11 -4
- package/dist/mcp-interaction-ui.js.map +1 -1
- package/dist/media-history.d.ts +1 -1
- package/dist/media-history.d.ts.map +1 -1
- package/dist/media-history.js +8 -2
- package/dist/media-history.js.map +1 -1
- package/dist/model-picker.d.ts.map +1 -1
- package/dist/model-picker.js +10 -11
- package/dist/model-picker.js.map +1 -1
- package/dist/model-transition.d.ts +11 -0
- package/dist/model-transition.d.ts.map +1 -0
- package/dist/model-transition.js +48 -0
- package/dist/model-transition.js.map +1 -0
- package/dist/model.d.ts +2 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +8 -4
- package/dist/model.js.map +1 -1
- package/dist/onboarding-check.d.ts +3 -0
- package/dist/onboarding-check.d.ts.map +1 -0
- package/dist/onboarding-check.js +22 -0
- package/dist/onboarding-check.js.map +1 -0
- package/dist/onboarding.d.ts +6 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +463 -0
- package/dist/onboarding.js.map +1 -0
- package/dist/plugins/application.d.ts +6 -4
- package/dist/plugins/application.d.ts.map +1 -1
- package/dist/plugins/application.js +106 -52
- package/dist/plugins/application.js.map +1 -1
- package/dist/plugins/instructions.d.ts +1 -1
- package/dist/plugins/instructions.d.ts.map +1 -1
- package/dist/plugins/instructions.js +24 -11
- package/dist/plugins/instructions.js.map +1 -1
- package/dist/plugins/resources.d.ts +2 -2
- package/dist/plugins/resources.d.ts.map +1 -1
- package/dist/plugins/resources.js +22 -12
- package/dist/plugins/resources.js.map +1 -1
- package/dist/policy.d.ts +1 -1
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +59 -11
- package/dist/policy.js.map +1 -1
- package/dist/run.d.ts +2 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +38 -33
- package/dist/run.js.map +1 -1
- package/dist/runtime-instructions.d.ts +1 -1
- package/dist/runtime-instructions.d.ts.map +1 -1
- package/dist/runtime-instructions.js +15 -7
- package/dist/runtime-instructions.js.map +1 -1
- package/dist/session-navigation.d.ts +6 -0
- package/dist/session-navigation.d.ts.map +1 -0
- package/dist/session-navigation.js +64 -0
- package/dist/session-navigation.js.map +1 -0
- package/dist/session-picker.d.ts +1 -1
- package/dist/session-picker.d.ts.map +1 -1
- package/dist/session-picker.js +23 -32
- package/dist/session-picker.js.map +1 -1
- package/dist/settings.d.ts +718 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +14 -0
- package/dist/settings.js.map +1 -0
- package/dist/skills.d.ts +1 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +10 -12
- package/dist/skills.js.map +1 -1
- package/dist/slash-commands.d.ts +2 -2
- package/dist/slash-commands.d.ts.map +1 -1
- package/dist/slash-commands.js +149 -67
- package/dist/slash-commands.js.map +1 -1
- package/dist/team-execution.d.ts +10 -0
- package/dist/team-execution.d.ts.map +1 -0
- package/dist/team-execution.js +29 -0
- package/dist/team-execution.js.map +1 -0
- package/dist/team-patches.d.ts.map +1 -1
- package/dist/team-patches.js +149 -52
- package/dist/team-patches.js.map +1 -1
- package/dist/team-plan.d.ts +2 -2
- package/dist/team-plan.d.ts.map +1 -1
- package/dist/team-plan.js +115 -34
- package/dist/team-plan.js.map +1 -1
- package/dist/team-recovery.d.ts +1 -1
- package/dist/team-recovery.d.ts.map +1 -1
- package/dist/team-recovery.js +40 -10
- package/dist/team-recovery.js.map +1 -1
- package/dist/team-v2.d.ts.map +1 -1
- package/dist/team-v2.js +335 -104
- package/dist/team-v2.js.map +1 -1
- package/dist/team-verification.d.ts +4 -2
- package/dist/team-verification.d.ts.map +1 -1
- package/dist/team-verification.js +300 -97
- package/dist/team-verification.js.map +1 -1
- package/dist/team.d.ts +2 -2
- package/dist/team.d.ts.map +1 -1
- package/dist/team.js +172 -62
- package/dist/team.js.map +1 -1
- package/dist/terminal-web.d.ts +1 -0
- package/dist/terminal-web.d.ts.map +1 -1
- package/dist/terminal-web.js +28 -10
- package/dist/terminal-web.js.map +1 -1
- package/dist/ui/actions.d.ts.map +1 -1
- package/dist/ui/actions.js.map +1 -1
- package/dist/ui/retained-tui.d.ts.map +1 -1
- package/dist/ui/retained-tui.js +231 -173
- package/dist/ui/retained-tui.js.map +1 -1
- package/dist/ui/{prototype-view.d.ts → terminal-view.d.ts} +7 -7
- package/dist/ui/terminal-view.d.ts.map +1 -0
- package/dist/ui/{prototype-view.js → terminal-view.js} +185 -98
- package/dist/ui/terminal-view.js.map +1 -0
- package/dist/web-commands.d.ts.map +1 -1
- package/dist/web-commands.js +160 -57
- package/dist/web-commands.js.map +1 -1
- package/dist/web-extension.d.ts.map +1 -1
- package/dist/web-extension.js +14 -4
- package/dist/web-extension.js.map +1 -1
- package/dist/web-server.d.ts.map +1 -1
- package/dist/web-server.js +2 -1
- package/dist/web-server.js.map +1 -1
- package/dist/web-ui.d.ts.map +1 -1
- package/dist/web-ui.js +167 -40
- package/dist/web-ui.js.map +1 -1
- package/dist/workspace-configuration.d.ts +7 -0
- package/dist/workspace-configuration.d.ts.map +1 -0
- package/dist/workspace-configuration.js +134 -0
- package/dist/workspace-configuration.js.map +1 -0
- package/dist/workspace-state.d.ts +20 -0
- package/dist/workspace-state.d.ts.map +1 -0
- package/dist/workspace-state.js +2 -0
- package/dist/workspace-state.js.map +1 -0
- package/dist/workspace.d.ts +26 -43
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +261 -323
- package/dist/workspace.js.map +1 -1
- package/package.json +21 -31
- package/dist/cli/chunk-7ISOHFS7.js.map +0 -7
- package/dist/cli/chunk-F4XRPLUM.js.map +0 -7
- package/dist/cli/chunk-H7SNBFO4.js +0 -5522
- package/dist/cli/chunk-H7SNBFO4.js.map +0 -7
- package/dist/cli/chunk-HOU5ITUK.js.map +0 -7
- package/dist/cli/chunk-K5JWPNSY.js.map +0 -7
- package/dist/cli/chunk-LVTRXPDS.js.map +0 -7
- package/dist/cli/chunk-VAZMCNBB.js +0 -686
- package/dist/cli/chunk-VAZMCNBB.js.map +0 -7
- package/dist/cli/chunk-WOFEI42C.js +0 -7820
- package/dist/cli/chunk-WOFEI42C.js.map +0 -7
- package/dist/cli/file-type-R2T7TBHI.js.map +0 -7
- package/dist/cli/mcp-auth-UNRHSIKJ.js +0 -63
- package/dist/cli/mcp-auth-UNRHSIKJ.js.map +0 -7
- package/dist/cli/retained-tui-VJ3VX4R3.js.map +0 -7
- package/dist/cli/team-v2-JGBBQ7FR.js.map +0 -7
- package/dist/cli/tui-SA74DKMA.js +0 -1705
- package/dist/cli/tui-SA74DKMA.js.map +0 -7
- package/dist/cli/web-server-FOMNPY7Q.js.map +0 -7
- package/dist/delegation.d.ts +0 -2
- package/dist/delegation.d.ts.map +0 -1
- package/dist/delegation.js +0 -2
- package/dist/delegation.js.map +0 -1
- package/dist/history-memory.d.ts +0 -2
- package/dist/history-memory.d.ts.map +0 -1
- package/dist/history-memory.js +0 -2
- package/dist/history-memory.js.map +0 -1
- package/dist/subagent-budget.d.ts +0 -2
- package/dist/subagent-budget.d.ts.map +0 -1
- package/dist/subagent-budget.js +0 -2
- package/dist/subagent-budget.js.map +0 -1
- package/dist/subagent-files.d.ts +0 -2
- package/dist/subagent-files.d.ts.map +0 -1
- package/dist/subagent-files.js +0 -2
- package/dist/subagent-files.js.map +0 -1
- package/dist/subagent-host.d.ts +0 -2
- package/dist/subagent-host.d.ts.map +0 -1
- package/dist/subagent-host.js +0 -2
- package/dist/subagent-host.js.map +0 -1
- package/dist/subagent-instructions.d.ts +0 -2
- package/dist/subagent-instructions.d.ts.map +0 -1
- package/dist/subagent-instructions.js +0 -2
- package/dist/subagent-instructions.js.map +0 -1
- package/dist/subagents.d.ts +0 -2
- package/dist/subagents.d.ts.map +0 -1
- package/dist/subagents.js +0 -2
- package/dist/subagents.js.map +0 -1
- package/dist/summarizer.d.ts +0 -2
- package/dist/summarizer.d.ts.map +0 -1
- package/dist/summarizer.js +0 -2
- package/dist/summarizer.js.map +0 -1
- package/dist/tui.d.ts +0 -7
- package/dist/tui.d.ts.map +0 -1
- package/dist/tui.js +0 -1109
- package/dist/tui.js.map +0 -1
- package/dist/ui/prototype-view.d.ts.map +0 -1
- package/dist/ui/prototype-view.js.map +0 -1
- /package/dist/cli/{configured-WHY3GGAJ.js.map → configured-ACNM6TRQ.js.map} +0 -0
- /package/dist/cli/{team-T7G7PPNN.js.map → team-O2I5BXHM.js.map} +0 -0
- /package/dist/cli/{web-ui-COB6PKC5.js.map → web-ui-UWQUFE4W.js.map} +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { omitUndefined } from "@sortedyuan/may/core";
|
|
1
2
|
import { Column, Dialog, Editor, EditorHistory, FocusManager, Panel, ScrollView, SelectList, Text, sanitizeTerminalText, styleText, SessionForkPicker, WorkspaceDiffViewer, workspaceGitLabel, } from "@sortedyuan/tui";
|
|
2
|
-
import { TranscriptView
|
|
3
|
+
import { TranscriptView } from "@sortedyuan/tui/transcript";
|
|
3
4
|
import { createMaybeCodeKeymap, MAYBECODE_EDITOR_KEYBINDINGS } from "../keymap.js";
|
|
4
5
|
import { MAYBECODE_DARK_THEME } from "./theme.js";
|
|
5
6
|
import { MaybeCodeUiActionRegistry } from "./actions.js";
|
|
6
7
|
/** Retained MaybeCode view shared by the experimental terminal frontend. */
|
|
7
|
-
export class
|
|
8
|
+
export class MaybeCodeTerminalView {
|
|
8
9
|
options;
|
|
9
10
|
focus = new FocusManager();
|
|
10
11
|
keymap;
|
|
@@ -34,13 +35,13 @@ export class MaybeCodePrototypeView {
|
|
|
34
35
|
layout = new Column([]);
|
|
35
36
|
editorSize = { width: 1, height: 1 };
|
|
36
37
|
editorRegion = {
|
|
37
|
-
render: size => {
|
|
38
|
+
render: (size) => {
|
|
38
39
|
this.editorSize = size;
|
|
39
40
|
return new Panel(this.editor, {
|
|
40
41
|
borderStyle: this.focus.focusedId === "editor" ? this.theme.borderAccent : this.theme.border,
|
|
41
42
|
}).render(size);
|
|
42
43
|
},
|
|
43
|
-
handlePointer: event => {
|
|
44
|
+
handlePointer: (event) => {
|
|
44
45
|
if (event.type === "down") {
|
|
45
46
|
if (event.button !== 0)
|
|
46
47
|
return false;
|
|
@@ -54,8 +55,8 @@ export class MaybeCodePrototypeView {
|
|
|
54
55
|
},
|
|
55
56
|
};
|
|
56
57
|
transcriptRegion = {
|
|
57
|
-
render: size => this.transcript.render(size),
|
|
58
|
-
handlePointer: event => {
|
|
58
|
+
render: (size) => this.transcript.render(size),
|
|
59
|
+
handlePointer: (event) => {
|
|
59
60
|
if (event.type === "down") {
|
|
60
61
|
if (event.button !== 0)
|
|
61
62
|
return false;
|
|
@@ -74,7 +75,7 @@ export class MaybeCodePrototypeView {
|
|
|
74
75
|
baseView = {
|
|
75
76
|
render: (size) => this.renderBase(size),
|
|
76
77
|
handleKey: (stroke) => this.handleBaseKey(stroke),
|
|
77
|
-
handlePointer: event => this.layout.handlePointer(event),
|
|
78
|
+
handlePointer: (event) => this.layout.handlePointer(event),
|
|
78
79
|
};
|
|
79
80
|
constructor(options) {
|
|
80
81
|
this.options = options;
|
|
@@ -88,34 +89,36 @@ export class MaybeCodePrototypeView {
|
|
|
88
89
|
assistantLabel: "MaybeCode",
|
|
89
90
|
selectedToolDetailsHint: "Enter details",
|
|
90
91
|
toolDetailsHint: `${this.shortcutHint("app.tools.toggle")} all`,
|
|
91
|
-
...(
|
|
92
|
+
...omitUndefined({ toolRenderers: options.toolRenderers }),
|
|
92
93
|
});
|
|
93
94
|
this.transcript = new ScrollView(this.transcriptView, {
|
|
94
95
|
followEnd: true,
|
|
95
96
|
onInvalidate: () => options.onInvalidate?.(),
|
|
96
97
|
});
|
|
97
98
|
this.inputHistory = options.inputHistory ?? new EditorHistory();
|
|
98
|
-
this.uiActions =
|
|
99
|
-
.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
99
|
+
this.uiActions =
|
|
100
|
+
options.uiActions ??
|
|
101
|
+
new MaybeCodeUiActionRegistry()
|
|
102
|
+
.register({
|
|
103
|
+
id: "tools.toggle",
|
|
104
|
+
command: "/details",
|
|
105
|
+
description: "Toggle all tool execution details",
|
|
106
|
+
run: () => {
|
|
107
|
+
this.preserveSelectedToolPosition();
|
|
108
|
+
const visible = this.transcriptView.toggleToolDetails();
|
|
109
|
+
return `Tool details ${visible ? "shown" : "hidden"}`;
|
|
110
|
+
},
|
|
111
|
+
})
|
|
112
|
+
.register({
|
|
113
|
+
id: "thinking.toggle",
|
|
114
|
+
command: "/thinking",
|
|
115
|
+
description: "Toggle reasoning block visibility",
|
|
116
|
+
run: () => {
|
|
117
|
+
this.preserveSelectedToolPosition();
|
|
118
|
+
const visible = this.transcriptView.toggleReasoning();
|
|
119
|
+
return `Thinking ${visible ? "shown" : "hidden"}`;
|
|
120
|
+
},
|
|
121
|
+
});
|
|
119
122
|
this.editor = new Editor({
|
|
120
123
|
...this.editorOptions(),
|
|
121
124
|
history: this.inputHistory,
|
|
@@ -168,13 +171,20 @@ export class MaybeCodePrototypeView {
|
|
|
168
171
|
editorOptions() {
|
|
169
172
|
return {
|
|
170
173
|
keybindings: MAYBECODE_EDITOR_KEYBINDINGS,
|
|
171
|
-
...(
|
|
174
|
+
...omitUndefined({ clipboard: this.options.clipboard }),
|
|
172
175
|
onInvalidate: () => this.options.onInvalidate?.(),
|
|
173
|
-
onError: error => this.setStatus(`Error: ${error instanceof Error ? error.message : String(error)}`),
|
|
176
|
+
onError: (error) => this.setStatus(`Error: ${error instanceof Error ? error.message : String(error)}`),
|
|
174
177
|
};
|
|
175
178
|
}
|
|
176
179
|
shortcutHint(action) {
|
|
177
|
-
return this.keymap
|
|
180
|
+
return (this.keymap
|
|
181
|
+
.keysForAction(action)[0]
|
|
182
|
+
?.split(" ")
|
|
183
|
+
.map((key) => key
|
|
184
|
+
.split("+")
|
|
185
|
+
.map((part) => (part.length === 1 ? part.toUpperCase() : part[0].toUpperCase() + part.slice(1)))
|
|
186
|
+
.join("+"))
|
|
187
|
+
.join(" ") ?? "");
|
|
178
188
|
}
|
|
179
189
|
resetInputContext() {
|
|
180
190
|
this.keymap.reset();
|
|
@@ -210,7 +220,9 @@ export class MaybeCodePrototypeView {
|
|
|
210
220
|
return new Promise((resolve) => {
|
|
211
221
|
let settled = false;
|
|
212
222
|
const abort = () => pending.finish();
|
|
213
|
-
const pending = {
|
|
223
|
+
const pending = {
|
|
224
|
+
prompt,
|
|
225
|
+
finish: (value) => {
|
|
214
226
|
if (settled)
|
|
215
227
|
return;
|
|
216
228
|
settled = true;
|
|
@@ -225,7 +237,8 @@ export class MaybeCodePrototypeView {
|
|
|
225
237
|
}
|
|
226
238
|
resolve(value);
|
|
227
239
|
this.options.onInvalidate?.();
|
|
228
|
-
}
|
|
240
|
+
},
|
|
241
|
+
};
|
|
229
242
|
this.mcpQuestions.push(pending);
|
|
230
243
|
signal.addEventListener("abort", abort, { once: true });
|
|
231
244
|
this.openCurrentApproval();
|
|
@@ -304,9 +317,7 @@ export class MaybeCodePrototypeView {
|
|
|
304
317
|
});
|
|
305
318
|
}
|
|
306
319
|
requestReasoningEffortSelection(state) {
|
|
307
|
-
if (state.status !== "known" ||
|
|
308
|
-
this.dialog !== undefined ||
|
|
309
|
-
this.resolveEffortDialog !== undefined) {
|
|
320
|
+
if (state.status !== "known" || this.dialog !== undefined || this.resolveEffortDialog !== undefined) {
|
|
310
321
|
return state.status === "known"
|
|
311
322
|
? Promise.reject(new Error("Another dialog is already open"))
|
|
312
323
|
: Promise.resolve(undefined);
|
|
@@ -352,10 +363,22 @@ export class MaybeCodePrototypeView {
|
|
|
352
363
|
requestForkSelection(points, currentSessionId) {
|
|
353
364
|
if (this.dialog)
|
|
354
365
|
return Promise.reject(new Error("Another dialog is already open"));
|
|
355
|
-
return new Promise(resolve => {
|
|
366
|
+
return new Promise((resolve) => {
|
|
356
367
|
this.resolveVersionDialog = resolve;
|
|
357
|
-
const picker = new SessionForkPicker(points, {
|
|
358
|
-
|
|
368
|
+
const picker = new SessionForkPicker(points, {
|
|
369
|
+
currentSessionId,
|
|
370
|
+
theme: this.theme,
|
|
371
|
+
onComplete: (selection) => this.completeVersionDialog(selection),
|
|
372
|
+
});
|
|
373
|
+
this.dialog = new Dialog(this.baseView, picker, {
|
|
374
|
+
open: true,
|
|
375
|
+
title: "Session 分支",
|
|
376
|
+
width: 100,
|
|
377
|
+
height: 25,
|
|
378
|
+
dismissOnEscape: false,
|
|
379
|
+
borderStyle: this.theme.borderAccent,
|
|
380
|
+
titleStyle: this.theme.accent,
|
|
381
|
+
});
|
|
359
382
|
this.dialogKind = "fork";
|
|
360
383
|
this.synchronizeDialog();
|
|
361
384
|
this.options.onInvalidate?.();
|
|
@@ -364,10 +387,23 @@ export class MaybeCodePrototypeView {
|
|
|
364
387
|
requestChanges(diff, operations = {}) {
|
|
365
388
|
if (this.dialog)
|
|
366
389
|
return Promise.reject(new Error("Another dialog is already open"));
|
|
367
|
-
return new Promise(resolve => {
|
|
390
|
+
return new Promise((resolve) => {
|
|
368
391
|
this.resolveVersionDialog = () => resolve();
|
|
369
|
-
const viewer = new WorkspaceDiffViewer(diff, {
|
|
370
|
-
|
|
392
|
+
const viewer = new WorkspaceDiffViewer(diff, {
|
|
393
|
+
theme: this.theme,
|
|
394
|
+
onClose: () => this.completeVersionDialog(),
|
|
395
|
+
...operations,
|
|
396
|
+
onInvalidate: () => this.options.onInvalidate?.(),
|
|
397
|
+
});
|
|
398
|
+
this.dialog = new Dialog(this.baseView, viewer, {
|
|
399
|
+
open: true,
|
|
400
|
+
title: "文件变化",
|
|
401
|
+
width: 110,
|
|
402
|
+
height: 30,
|
|
403
|
+
dismissOnEscape: false,
|
|
404
|
+
borderStyle: this.theme.borderAccent,
|
|
405
|
+
titleStyle: this.theme.accent,
|
|
406
|
+
});
|
|
371
407
|
this.dialogKind = "changes";
|
|
372
408
|
this.synchronizeDialog();
|
|
373
409
|
this.options.onInvalidate?.();
|
|
@@ -418,9 +454,7 @@ export class MaybeCodePrototypeView {
|
|
|
418
454
|
}
|
|
419
455
|
}
|
|
420
456
|
renderBase(size) {
|
|
421
|
-
const suggestionHeight = this.suggestionsVisible
|
|
422
|
-
? Math.min(7, this.suggestions.length + 2)
|
|
423
|
-
: 0;
|
|
457
|
+
const suggestionHeight = this.suggestionsVisible ? Math.min(7, this.suggestions.length + 2) : 0;
|
|
424
458
|
this.layout.setItems([
|
|
425
459
|
{
|
|
426
460
|
height: 3,
|
|
@@ -429,14 +463,16 @@ export class MaybeCodePrototypeView {
|
|
|
429
463
|
{ flex: 1, minHeight: 1, component: this.transcriptRegion },
|
|
430
464
|
...(suggestionHeight === 0
|
|
431
465
|
? []
|
|
432
|
-
: [
|
|
466
|
+
: [
|
|
467
|
+
{
|
|
433
468
|
height: suggestionHeight,
|
|
434
469
|
component: new Panel(this.suggestionList, {
|
|
435
470
|
title: " Commands ",
|
|
436
471
|
borderStyle: this.theme.border,
|
|
437
472
|
titleStyle: this.theme.accent,
|
|
438
473
|
}),
|
|
439
|
-
}
|
|
474
|
+
},
|
|
475
|
+
]),
|
|
440
476
|
{
|
|
441
477
|
height: 4,
|
|
442
478
|
component: this.editorRegion,
|
|
@@ -454,14 +490,16 @@ export class MaybeCodePrototypeView {
|
|
|
454
490
|
this.transcript.scrollBy(stroke.key === "wheelup" ? -3 : 3);
|
|
455
491
|
return true;
|
|
456
492
|
}
|
|
457
|
-
if (this.focus.focusedId === "editor" &&
|
|
458
|
-
|
|
493
|
+
if (this.focus.focusedId === "editor" &&
|
|
494
|
+
this.editor.hasSelection &&
|
|
495
|
+
stroke.ctrl &&
|
|
496
|
+
stroke.key === "c" &&
|
|
497
|
+
this.editor.handleKey(stroke)) {
|
|
459
498
|
this.keymap.reset();
|
|
460
499
|
this.clearShortcutHint();
|
|
461
500
|
return true;
|
|
462
501
|
}
|
|
463
|
-
const shortcut = this.keymap.resolve(stroke, this.transcriptView.hasSelection
|
|
464
|
-
? ["global", "transcript.selection"] : ["global"]);
|
|
502
|
+
const shortcut = this.keymap.resolve(stroke, this.transcriptView.hasSelection ? ["global", "transcript.selection"] : ["global"]);
|
|
465
503
|
if (shortcut.type === "pending") {
|
|
466
504
|
this.statusBeforeShortcut ??= this.status;
|
|
467
505
|
this.status = `Shortcut: ${shortcut.completions.join(" / ")}`;
|
|
@@ -476,7 +514,7 @@ export class MaybeCodePrototypeView {
|
|
|
476
514
|
this.setStatus("Error: Clipboard is unavailable");
|
|
477
515
|
}
|
|
478
516
|
else {
|
|
479
|
-
this.pendingClipboard = this.options.clipboard.writeText(text).then(() => this.setStatus("Copied"), error => this.setStatus(`Error: ${error instanceof Error ? error.message : String(error)}`));
|
|
517
|
+
this.pendingClipboard = this.options.clipboard.writeText(text).then(() => this.setStatus("Copied"), (error) => this.setStatus(`Error: ${error instanceof Error ? error.message : String(error)}`));
|
|
480
518
|
}
|
|
481
519
|
return true;
|
|
482
520
|
}
|
|
@@ -520,21 +558,34 @@ export class MaybeCodePrototypeView {
|
|
|
520
558
|
this.hideSuggestions();
|
|
521
559
|
return true;
|
|
522
560
|
}
|
|
523
|
-
if (this.suggestionsVisible &&
|
|
524
|
-
stroke.key
|
|
561
|
+
if (this.suggestionsVisible &&
|
|
562
|
+
isSuggestionNavigation(stroke.key) &&
|
|
563
|
+
stroke.key !== "home" &&
|
|
564
|
+
stroke.key !== "end" &&
|
|
565
|
+
!stroke.shift &&
|
|
566
|
+
!stroke.ctrl &&
|
|
567
|
+
!stroke.alt) {
|
|
525
568
|
return this.suggestionList.handleKey(stroke);
|
|
526
569
|
}
|
|
527
570
|
if (stroke.key === "tab" && !stroke.shift) {
|
|
528
571
|
this.completeSuggestion(false);
|
|
529
572
|
return true;
|
|
530
573
|
}
|
|
531
|
-
if (stroke.key === "enter" &&
|
|
574
|
+
if (stroke.key === "enter" &&
|
|
575
|
+
this.suggestionsVisible &&
|
|
576
|
+
!stroke.shift &&
|
|
577
|
+
!stroke.ctrl &&
|
|
578
|
+
!stroke.alt &&
|
|
579
|
+
!stroke.meta) {
|
|
532
580
|
this.completeSuggestion(true);
|
|
533
581
|
return true;
|
|
534
582
|
}
|
|
535
583
|
}
|
|
536
|
-
const transcriptInteraction = stroke.key === "j" ||
|
|
537
|
-
stroke.key === "
|
|
584
|
+
const transcriptInteraction = stroke.key === "j" ||
|
|
585
|
+
stroke.key === "k" ||
|
|
586
|
+
stroke.key === "enter" ||
|
|
587
|
+
stroke.key === "space" ||
|
|
588
|
+
stroke.text === " ";
|
|
538
589
|
const togglesSelectedTool = this.focus.focusedId === "transcript" &&
|
|
539
590
|
(stroke.key === "enter" || stroke.key === "space" || stroke.text === " ");
|
|
540
591
|
if (togglesSelectedTool)
|
|
@@ -558,7 +609,9 @@ export class MaybeCodePrototypeView {
|
|
|
558
609
|
this.hideSuggestions();
|
|
559
610
|
this.setStatus("Running");
|
|
560
611
|
const epoch = this.submissionEpoch;
|
|
561
|
-
const submit = () => this.disposed || epoch !== this.submissionEpoch
|
|
612
|
+
const submit = () => this.disposed || epoch !== this.submissionEpoch
|
|
613
|
+
? undefined
|
|
614
|
+
: this.resolveSubmission(value, completeCommand, epoch);
|
|
562
615
|
const previous = this.submissionTail;
|
|
563
616
|
const pending = (previous ? previous.then(submit) : Promise.resolve(submit()))
|
|
564
617
|
.then((status) => {
|
|
@@ -570,7 +623,8 @@ export class MaybeCodePrototypeView {
|
|
|
570
623
|
if (this.editor.value === "")
|
|
571
624
|
this.editor.setValue(value);
|
|
572
625
|
this.setStatus(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
573
|
-
})
|
|
626
|
+
})
|
|
627
|
+
.finally(() => {
|
|
574
628
|
if (this.submissionTail === pending)
|
|
575
629
|
this.submissionTail = undefined;
|
|
576
630
|
});
|
|
@@ -614,9 +668,7 @@ export class MaybeCodePrototypeView {
|
|
|
614
668
|
this.suggestionList.setItems(suggestions.map((suggestion) => ({
|
|
615
669
|
value: suggestion,
|
|
616
670
|
label: suggestion.label,
|
|
617
|
-
...(suggestion.description === undefined
|
|
618
|
-
? {}
|
|
619
|
-
: { description: suggestion.description }),
|
|
671
|
+
...(suggestion.description === undefined ? {} : { description: suggestion.description }),
|
|
620
672
|
})));
|
|
621
673
|
this.suggestionsVisible = suggestions.length > 0;
|
|
622
674
|
this.options.onInvalidate?.();
|
|
@@ -656,8 +708,13 @@ export class MaybeCodePrototypeView {
|
|
|
656
708
|
const question = this.mcpQuestions[0];
|
|
657
709
|
if (question !== undefined) {
|
|
658
710
|
this.dialog = new Dialog(this.baseView, new McpInputPrompt(question.prompt, question.finish, this.editorOptions(), this.options.keymap), {
|
|
659
|
-
open: true,
|
|
660
|
-
|
|
711
|
+
open: true,
|
|
712
|
+
title: "MCP user interaction — untrusted server",
|
|
713
|
+
width: 92,
|
|
714
|
+
height: 24,
|
|
715
|
+
dismissOnEscape: false,
|
|
716
|
+
borderStyle: this.theme.warning,
|
|
717
|
+
titleStyle: this.theme.warning,
|
|
661
718
|
});
|
|
662
719
|
this.dialogKind = "mcp";
|
|
663
720
|
this.synchronizeDialog();
|
|
@@ -727,11 +784,10 @@ class ModelPrompt {
|
|
|
727
784
|
const currentIndex = models.findIndex((model) => model.name === currentProfile);
|
|
728
785
|
this.list = new SelectList(models.map((model) => ({
|
|
729
786
|
value: model,
|
|
730
|
-
label: `${model.name === currentProfile ? "* " : ""}${model.name}` +
|
|
731
|
-
`${model.isDefault ? " [default]" : ""}`,
|
|
787
|
+
label: `${model.name === currentProfile ? "* " : ""}${model.name}` + `${model.isDefault ? " [default]" : ""}`,
|
|
732
788
|
description: `${model.provider}/${model.model} · ${model.adapter}`,
|
|
733
789
|
})), {
|
|
734
|
-
onSelect: item => this.complete({ type: "switch", profile: item.value.name }),
|
|
790
|
+
onSelect: (item) => this.complete({ type: "switch", profile: item.value.name }),
|
|
735
791
|
onCancel: () => this.complete(undefined),
|
|
736
792
|
selectedIndex: Math.max(0, currentIndex),
|
|
737
793
|
selectedStyle: theme.selected,
|
|
@@ -751,7 +807,9 @@ class ModelPrompt {
|
|
|
751
807
|
]);
|
|
752
808
|
return this.layout.render(size);
|
|
753
809
|
}
|
|
754
|
-
handlePointer(event) {
|
|
810
|
+
handlePointer(event) {
|
|
811
|
+
return this.layout.handlePointer(event);
|
|
812
|
+
}
|
|
755
813
|
handleKey(stroke) {
|
|
756
814
|
const result = this.keymap.resolve(stroke, ["select", "modelPicker"]);
|
|
757
815
|
if (result.type === "pending")
|
|
@@ -777,9 +835,7 @@ class EffortPrompt {
|
|
|
777
835
|
this.complete = complete;
|
|
778
836
|
this.keymap = createMaybeCodeKeymap(keymapOptions);
|
|
779
837
|
const efforts = ["default", ...state.efforts];
|
|
780
|
-
const currentIndex = state.overridden
|
|
781
|
-
? efforts.indexOf(state.effectiveEffort ?? "")
|
|
782
|
-
: 0;
|
|
838
|
+
const currentIndex = state.overridden ? efforts.indexOf(state.effectiveEffort ?? "") : 0;
|
|
783
839
|
this.list = new SelectList(efforts.map((effort) => ({
|
|
784
840
|
value: effort,
|
|
785
841
|
label: `${effort === efforts[currentIndex] ? "* " : ""}${effort}`,
|
|
@@ -787,7 +843,7 @@ class EffortPrompt {
|
|
|
787
843
|
? `Clear override · default ${state.defaultEffort ?? "is provider-defined"}`
|
|
788
844
|
: `Capability source: ${state.source}`,
|
|
789
845
|
})), {
|
|
790
|
-
onSelect: item => this.complete(item.value),
|
|
846
|
+
onSelect: (item) => this.complete(item.value),
|
|
791
847
|
onCancel: () => this.complete(undefined),
|
|
792
848
|
selectedIndex: Math.max(0, currentIndex),
|
|
793
849
|
selectedStyle: theme.selected,
|
|
@@ -799,11 +855,16 @@ class EffortPrompt {
|
|
|
799
855
|
render(size) {
|
|
800
856
|
this.layout.setItems([
|
|
801
857
|
{ flex: 1, minHeight: 1, component: this.list },
|
|
802
|
-
{
|
|
858
|
+
{
|
|
859
|
+
height: 1,
|
|
860
|
+
component: new Text(`${promptShortcut(this.keymap, "list.accept", "select")} select · ${promptShortcut(this.keymap, "list.cancel", "select")} close`),
|
|
861
|
+
},
|
|
803
862
|
]);
|
|
804
863
|
return this.layout.render(size);
|
|
805
864
|
}
|
|
806
|
-
handlePointer(event) {
|
|
865
|
+
handlePointer(event) {
|
|
866
|
+
return this.layout.handlePointer(event);
|
|
867
|
+
}
|
|
807
868
|
handleKey(stroke) {
|
|
808
869
|
const result = this.keymap.resolve(stroke, ["select"]);
|
|
809
870
|
return result.type === "action" ? this.list.performAction(result.action) : result.type === "pending";
|
|
@@ -825,13 +886,21 @@ class ApprovalPrompt {
|
|
|
825
886
|
{ value: "allow", label: "Allow once", description: promptShortcut(this.keymap, "approval.allow", "approval") },
|
|
826
887
|
...(request.grantKey === undefined
|
|
827
888
|
? []
|
|
828
|
-
: [
|
|
889
|
+
: [
|
|
890
|
+
{
|
|
829
891
|
value: "allow-session",
|
|
830
892
|
label: "Allow matching calls for this session",
|
|
831
893
|
description: promptShortcut(this.keymap, "approval.allowSession", "approval"),
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
|
|
894
|
+
},
|
|
895
|
+
]),
|
|
896
|
+
{
|
|
897
|
+
value: "deny",
|
|
898
|
+
label: "Deny",
|
|
899
|
+
description: `${promptShortcut(this.keymap, "approval.deny", "approval")} / ${promptShortcut(this.keymap, "list.cancel", "select")}`,
|
|
900
|
+
},
|
|
901
|
+
...(request.persistent
|
|
902
|
+
? [{ value: "allow-persistent", label: "保存允许规则", description: request.persistent.description }]
|
|
903
|
+
: []),
|
|
835
904
|
], {
|
|
836
905
|
onSelect: (item) => this.decide(item.value),
|
|
837
906
|
onCancel: () => this.decide("deny"),
|
|
@@ -856,7 +925,9 @@ class ApprovalPrompt {
|
|
|
856
925
|
]);
|
|
857
926
|
return this.layout.render(size);
|
|
858
927
|
}
|
|
859
|
-
handlePointer(event) {
|
|
928
|
+
handlePointer(event) {
|
|
929
|
+
return this.layout.handlePointer(event);
|
|
930
|
+
}
|
|
860
931
|
handleKey(stroke) {
|
|
861
932
|
const result = this.keymap.resolve(stroke, ["select", "approval"]);
|
|
862
933
|
if (result.type === "pending")
|
|
@@ -891,8 +962,8 @@ class SessionPrompt {
|
|
|
891
962
|
keymap;
|
|
892
963
|
layout = new Column([], { gap: 1 });
|
|
893
964
|
listRegion = {
|
|
894
|
-
render: size => this.list.render(size),
|
|
895
|
-
handlePointer: event => (this.mode === "browse" || this.mode === "search") && this.list.handlePointer(event),
|
|
965
|
+
render: (size) => this.list.render(size),
|
|
966
|
+
handlePointer: (event) => (this.mode === "browse" || this.mode === "search") && this.list.handlePointer(event),
|
|
896
967
|
};
|
|
897
968
|
constructor(sessions, currentSessionId, theme, complete, editorOptions, keymapOptions = {}) {
|
|
898
969
|
this.sessions = sessions;
|
|
@@ -940,8 +1011,12 @@ class SessionPrompt {
|
|
|
940
1011
|
]);
|
|
941
1012
|
return this.layout.render(size);
|
|
942
1013
|
}
|
|
943
|
-
handlePointer(event) {
|
|
944
|
-
|
|
1014
|
+
handlePointer(event) {
|
|
1015
|
+
return this.layout.handlePointer(event);
|
|
1016
|
+
}
|
|
1017
|
+
dispose() {
|
|
1018
|
+
this.input.dispose();
|
|
1019
|
+
}
|
|
945
1020
|
handleKey(stroke) {
|
|
946
1021
|
const contexts = this.mode === "browse"
|
|
947
1022
|
? ["select", "sessionPicker"]
|
|
@@ -969,14 +1044,19 @@ class SessionPrompt {
|
|
|
969
1044
|
this.status = "Type to filter by id, title, or preview";
|
|
970
1045
|
this.input.setValue("");
|
|
971
1046
|
return true;
|
|
972
|
-
case "search.finish":
|
|
973
|
-
|
|
1047
|
+
case "search.finish":
|
|
1048
|
+
return this.resumeSelected();
|
|
1049
|
+
case "session.rename.start":
|
|
1050
|
+
return this.beginRename();
|
|
974
1051
|
case "session.rename.accept":
|
|
975
1052
|
this.input.performAction("editor.submit");
|
|
976
1053
|
return true;
|
|
977
|
-
case "session.delete.request":
|
|
978
|
-
|
|
979
|
-
case "session.delete.
|
|
1054
|
+
case "session.delete.request":
|
|
1055
|
+
return this.beginDelete();
|
|
1056
|
+
case "session.delete.cancel":
|
|
1057
|
+
return this.setMode("browse");
|
|
1058
|
+
case "session.delete.accept":
|
|
1059
|
+
return this.deleteSelected();
|
|
980
1060
|
case "text.clear":
|
|
981
1061
|
this.input.setValue("");
|
|
982
1062
|
return true;
|
|
@@ -1085,8 +1165,7 @@ class HeaderView {
|
|
|
1085
1165
|
const title = `${styleText("◆", this.theme.accent)} ` +
|
|
1086
1166
|
`${styleText("MaybeCode", this.theme.accent)} ` +
|
|
1087
1167
|
styleText(sanitizeTerminalText(this.model), this.theme.muted);
|
|
1088
|
-
const workspace = `${styleText("workspace", this.theme.dim)} ` +
|
|
1089
|
-
styleText(sanitizeTerminalText(this.workspace), this.theme.muted);
|
|
1168
|
+
const workspace = `${styleText("workspace", this.theme.dim)} ` + styleText(sanitizeTerminalText(this.workspace), this.theme.muted);
|
|
1090
1169
|
const divider = styleText("─".repeat(size.width), this.theme.border);
|
|
1091
1170
|
return new Text(`${title}\n${workspace}\n${divider}`, { wrap: false }).render(size);
|
|
1092
1171
|
}
|
|
@@ -1120,7 +1199,8 @@ class FooterView {
|
|
|
1120
1199
|
: /running|cancell/iu.test(this.status)
|
|
1121
1200
|
? this.theme.warning
|
|
1122
1201
|
: this.theme.success;
|
|
1123
|
-
const value = (this.gitLabel ? `${styleText(this.gitLabel, this.theme.accent)} ` : "") +
|
|
1202
|
+
const value = (this.gitLabel ? `${styleText(this.gitLabel, this.theme.accent)} ` : "") +
|
|
1203
|
+
(this.yolo ? `${styleText("YOLO · Auto-approve", this.theme.warning)} ` : "") +
|
|
1124
1204
|
`${styleText("●", statusStyle)} ${styleText(this.status, statusStyle)} ` +
|
|
1125
1205
|
`${styleText(this.focus ?? "none", this.theme.muted)} ` +
|
|
1126
1206
|
`${styleText(this.replyHint, this.theme.dim)} reply ` +
|
|
@@ -1149,8 +1229,7 @@ function truncate(value, maximum) {
|
|
|
1149
1229
|
return value.length <= maximum ? value : `${value.slice(0, maximum - 1)}…`;
|
|
1150
1230
|
}
|
|
1151
1231
|
function isSuggestionNavigation(key) {
|
|
1152
|
-
return key === "up" || key === "down" || key === "pageup" ||
|
|
1153
|
-
key === "pagedown" || key === "home" || key === "end";
|
|
1232
|
+
return key === "up" || key === "down" || key === "pageup" || key === "pagedown" || key === "home" || key === "end";
|
|
1154
1233
|
}
|
|
1155
1234
|
function commonPrefix(input, values) {
|
|
1156
1235
|
const candidates = values.filter((value) => value.startsWith(input));
|
|
@@ -1188,12 +1267,20 @@ class McpInputPrompt {
|
|
|
1188
1267
|
this.layout.setItems([
|
|
1189
1268
|
{ flex: 1, minHeight: 1, component: this.body },
|
|
1190
1269
|
{ height: 4, component: this.editor },
|
|
1191
|
-
{
|
|
1270
|
+
{
|
|
1271
|
+
height: 1,
|
|
1272
|
+
component: new Text(`${promptShortcut(this.keymap, "request.pageUp", "mcpInput")}/${promptShortcut(this.keymap, "request.pageDown", "mcpInput")} review request | Enter continue | ${promptShortcut(this.keymap, "request.cancel", "mcpInput")} cancel`),
|
|
1273
|
+
},
|
|
1192
1274
|
]);
|
|
1193
1275
|
return this.layout.render(size);
|
|
1194
1276
|
}
|
|
1195
|
-
handlePointer(event) {
|
|
1196
|
-
|
|
1277
|
+
handlePointer(event) {
|
|
1278
|
+
return this.layout.handlePointer(event);
|
|
1279
|
+
}
|
|
1280
|
+
dispose() {
|
|
1281
|
+
this.editor.dispose();
|
|
1282
|
+
this.body.dispose();
|
|
1283
|
+
}
|
|
1197
1284
|
handleKey(stroke) {
|
|
1198
1285
|
const result = this.keymap.resolve(stroke, ["mcpInput"]);
|
|
1199
1286
|
if (result.type === "pending")
|
|
@@ -1223,4 +1310,4 @@ class McpInputPrompt {
|
|
|
1223
1310
|
function promptShortcut(keymap, action, context) {
|
|
1224
1311
|
return keymap.keysForAction(action, context).join(" / ");
|
|
1225
1312
|
}
|
|
1226
|
-
//# sourceMappingURL=
|
|
1313
|
+
//# sourceMappingURL=terminal-view.js.map
|