wave-code 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/plugin/disable.d.ts +2 -1
- package/dist/commands/plugin/disable.d.ts.map +1 -1
- package/dist/commands/plugin/disable.js +3 -2
- package/dist/commands/plugin/enable.d.ts +2 -1
- package/dist/commands/plugin/enable.d.ts.map +1 -1
- package/dist/commands/plugin/enable.js +3 -2
- package/dist/commands/plugin/install.d.ts +2 -1
- package/dist/commands/plugin/install.d.ts.map +1 -1
- package/dist/commands/plugin/list.d.ts.map +1 -1
- package/dist/commands/plugin/list.js +15 -3
- package/dist/commands/plugin/marketplace.d.ts +3 -0
- package/dist/commands/plugin/marketplace.d.ts.map +1 -1
- package/dist/commands/plugin/marketplace.js +15 -1
- package/dist/commands/plugin/uninstall.d.ts +4 -0
- package/dist/commands/plugin/uninstall.d.ts.map +1 -0
- package/dist/commands/plugin/uninstall.js +29 -0
- package/dist/commands/plugin/update.d.ts +4 -0
- package/dist/commands/plugin/update.d.ts.map +1 -0
- package/dist/commands/plugin/update.js +15 -0
- package/dist/components/ChatInterface.d.ts.map +1 -1
- package/dist/components/ChatInterface.js +2 -2
- package/dist/components/CommandSelector.d.ts.map +1 -1
- package/dist/components/CommandSelector.js +6 -0
- package/dist/components/Confirmation.js +1 -1
- package/dist/components/DiscoverView.d.ts +3 -0
- package/dist/components/DiscoverView.d.ts.map +1 -0
- package/dist/components/DiscoverView.js +25 -0
- package/dist/components/FileSelector.js +1 -1
- package/dist/components/HistorySearch.d.ts +8 -0
- package/dist/components/HistorySearch.d.ts.map +1 -0
- package/dist/components/HistorySearch.js +67 -0
- package/dist/components/InputBox.d.ts +1 -1
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +26 -17
- package/dist/components/InstalledView.d.ts +3 -0
- package/dist/components/InstalledView.d.ts.map +1 -0
- package/dist/components/InstalledView.js +30 -0
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/Markdown.js +22 -9
- package/dist/components/MarketplaceAddForm.d.ts +3 -0
- package/dist/components/MarketplaceAddForm.d.ts.map +1 -0
- package/dist/components/MarketplaceAddForm.js +26 -0
- package/dist/components/MarketplaceDetail.d.ts +3 -0
- package/dist/components/MarketplaceDetail.d.ts.map +1 -0
- package/dist/components/MarketplaceDetail.js +38 -0
- package/dist/components/MarketplaceList.d.ts +9 -0
- package/dist/components/MarketplaceList.d.ts.map +1 -0
- package/dist/components/MarketplaceList.js +16 -0
- package/dist/components/MarketplaceView.d.ts +3 -0
- package/dist/components/MarketplaceView.d.ts.map +1 -0
- package/dist/components/MarketplaceView.js +28 -0
- package/dist/components/PluginDetail.d.ts +3 -0
- package/dist/components/PluginDetail.d.ts.map +1 -0
- package/dist/components/PluginDetail.js +63 -0
- package/dist/components/PluginList.d.ts +14 -0
- package/dist/components/PluginList.d.ts.map +1 -0
- package/dist/components/PluginList.js +12 -0
- package/dist/components/PluginManagerShell.d.ts +5 -0
- package/dist/components/PluginManagerShell.d.ts.map +1 -0
- package/dist/components/PluginManagerShell.js +89 -0
- package/dist/components/PluginManagerTypes.d.ts +33 -0
- package/dist/components/PluginManagerTypes.d.ts.map +1 -0
- package/dist/components/PluginManagerTypes.js +1 -0
- package/dist/components/RewindCommand.d.ts +9 -0
- package/dist/components/RewindCommand.d.ts.map +1 -0
- package/dist/components/RewindCommand.js +42 -0
- package/dist/components/SessionSelector.d.ts +11 -0
- package/dist/components/SessionSelector.d.ts.map +1 -0
- package/dist/components/SessionSelector.js +38 -0
- package/dist/components/SubagentBlock.d.ts.map +1 -1
- package/dist/components/SubagentBlock.js +20 -1
- package/dist/components/ToolResultDisplay.js +1 -1
- package/dist/contexts/PluginManagerContext.d.ts +4 -0
- package/dist/contexts/PluginManagerContext.d.ts.map +1 -0
- package/dist/contexts/PluginManagerContext.js +9 -0
- package/dist/contexts/useChat.d.ts +2 -0
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +21 -0
- package/dist/hooks/useInputManager.d.ts +6 -14
- package/dist/hooks/useInputManager.d.ts.map +1 -1
- package/dist/hooks/useInputManager.js +29 -45
- package/dist/hooks/usePluginManager.d.ts +3 -0
- package/dist/hooks/usePluginManager.d.ts.map +1 -0
- package/dist/hooks/usePluginManager.js +223 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +150 -177
- package/dist/managers/InputManager.d.ts +12 -21
- package/dist/managers/InputManager.d.ts.map +1 -1
- package/dist/managers/InputManager.js +77 -108
- package/dist/plugin-manager-cli.d.ts +6 -0
- package/dist/plugin-manager-cli.d.ts.map +1 -0
- package/dist/plugin-manager-cli.js +12 -0
- package/dist/session-selector-cli.d.ts +2 -0
- package/dist/session-selector-cli.d.ts.map +1 -0
- package/dist/session-selector-cli.js +25 -0
- package/package.json +7 -3
- package/src/commands/plugin/disable.ts +7 -3
- package/src/commands/plugin/enable.ts +7 -3
- package/src/commands/plugin/install.ts +2 -1
- package/src/commands/plugin/list.ts +21 -3
- package/src/commands/plugin/marketplace.ts +17 -1
- package/src/commands/plugin/uninstall.ts +39 -0
- package/src/commands/plugin/update.ts +19 -0
- package/src/components/ChatInterface.tsx +2 -1
- package/src/components/CommandSelector.tsx +7 -0
- package/src/components/Confirmation.tsx +1 -1
- package/src/components/DiscoverView.tsx +31 -0
- package/src/components/FileSelector.tsx +1 -1
- package/src/components/HistorySearch.tsx +148 -0
- package/src/components/InputBox.tsx +43 -28
- package/src/components/InstalledView.tsx +61 -0
- package/src/components/Markdown.tsx +37 -26
- package/src/components/MarketplaceAddForm.tsx +39 -0
- package/src/components/MarketplaceDetail.tsx +79 -0
- package/src/components/MarketplaceList.tsx +52 -0
- package/src/components/MarketplaceView.tsx +43 -0
- package/src/components/PluginDetail.tsx +147 -0
- package/src/components/PluginList.tsx +51 -0
- package/src/components/PluginManagerShell.tsx +189 -0
- package/src/components/PluginManagerTypes.ts +47 -0
- package/src/components/RewindCommand.tsx +114 -0
- package/src/components/SessionSelector.tsx +127 -0
- package/src/components/SubagentBlock.tsx +29 -1
- package/src/components/ToolResultDisplay.tsx +2 -2
- package/src/contexts/PluginManagerContext.ts +15 -0
- package/src/contexts/useChat.tsx +26 -0
- package/src/hooks/useInputManager.ts +29 -61
- package/src/hooks/usePluginManager.ts +296 -0
- package/src/index.ts +241 -280
- package/src/managers/InputManager.ts +93 -149
- package/src/plugin-manager-cli.tsx +13 -0
- package/src/session-selector-cli.tsx +37 -0
- package/dist/components/BashHistorySelector.d.ts +0 -11
- package/dist/components/BashHistorySelector.d.ts.map +0 -1
- package/dist/components/BashHistorySelector.js +0 -93
- package/dist/hooks/usePagination.d.ts +0 -20
- package/dist/hooks/usePagination.d.ts.map +0 -1
- package/dist/hooks/usePagination.js +0 -168
- package/src/components/BashHistorySelector.tsx +0 -181
- package/src/hooks/usePagination.ts +0 -203
package/dist/index.js
CHANGED
|
@@ -1,208 +1,181 @@
|
|
|
1
1
|
import yargs from "yargs";
|
|
2
2
|
import { hideBin } from "yargs/helpers";
|
|
3
3
|
import { startCli } from "./cli.js";
|
|
4
|
-
import { listSessions, getSessionFilePath, getFirstMessageContent, } from "wave-agent-sdk";
|
|
5
4
|
// Export main function for external use
|
|
6
5
|
export async function main() {
|
|
7
|
-
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
string: true,
|
|
46
|
-
global: false,
|
|
47
|
-
})
|
|
48
|
-
.command("plugin", "Manage plugins and marketplaces", (yargs) => {
|
|
49
|
-
return yargs
|
|
50
|
-
.help()
|
|
51
|
-
.command("marketplace", "Manage plugin marketplaces", (yargs) => {
|
|
6
|
+
try {
|
|
7
|
+
const argv = await yargs(hideBin(process.argv))
|
|
8
|
+
.option("restore", {
|
|
9
|
+
alias: "r",
|
|
10
|
+
description: "Restore session by ID (or list sessions if no ID provided)",
|
|
11
|
+
type: "string",
|
|
12
|
+
global: false,
|
|
13
|
+
})
|
|
14
|
+
.option("continue", {
|
|
15
|
+
alias: "c",
|
|
16
|
+
description: "Continue from last session",
|
|
17
|
+
type: "boolean",
|
|
18
|
+
global: false,
|
|
19
|
+
})
|
|
20
|
+
.option("print", {
|
|
21
|
+
alias: "p",
|
|
22
|
+
description: "Print response without interactive mode",
|
|
23
|
+
type: "string",
|
|
24
|
+
global: false,
|
|
25
|
+
})
|
|
26
|
+
.option("show-stats", {
|
|
27
|
+
description: "Show timing and usage statistics in print mode",
|
|
28
|
+
type: "boolean",
|
|
29
|
+
global: false,
|
|
30
|
+
})
|
|
31
|
+
.option("dangerously-skip-permissions", {
|
|
32
|
+
description: "Skip all permission checks (dangerous)",
|
|
33
|
+
type: "boolean",
|
|
34
|
+
default: false,
|
|
35
|
+
global: false,
|
|
36
|
+
})
|
|
37
|
+
.option("plugin-dir", {
|
|
38
|
+
description: "Load a plugin from a specific directory",
|
|
39
|
+
type: "array",
|
|
40
|
+
string: true,
|
|
41
|
+
global: false,
|
|
42
|
+
})
|
|
43
|
+
.command("plugin", "Manage plugins and marketplaces", (yargs) => {
|
|
52
44
|
return yargs
|
|
53
45
|
.help()
|
|
54
|
-
.command("
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
.command("ui", "Open interactive plugin manager UI", {}, async () => {
|
|
47
|
+
const { startPluginManagerCli } = await import("./plugin-manager-cli.js");
|
|
48
|
+
const shouldExit = await startPluginManagerCli();
|
|
49
|
+
if (shouldExit) {
|
|
50
|
+
process.exit(0);
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
.command("marketplace", "Manage plugin marketplaces", (yargs) => {
|
|
54
|
+
return yargs
|
|
55
|
+
.help()
|
|
56
|
+
.command("add <input>", "Add a plugin marketplace (local path, owner/repo, or Git URL)", (yargs) => {
|
|
57
|
+
return yargs.positional("input", {
|
|
58
|
+
describe: "Path to local marketplace, GitHub owner/repo, or full Git URL (with optional #ref)",
|
|
59
|
+
type: "string",
|
|
60
|
+
});
|
|
61
|
+
}, async (argv) => {
|
|
62
|
+
const { addMarketplaceCommand } = await import("./commands/plugin/marketplace.js");
|
|
63
|
+
await addMarketplaceCommand(argv);
|
|
64
|
+
})
|
|
65
|
+
.command("update [name]", "Update registered marketplace(s)", (yargs) => {
|
|
66
|
+
return yargs.positional("name", {
|
|
67
|
+
describe: "Name of the marketplace to update",
|
|
68
|
+
type: "string",
|
|
69
|
+
});
|
|
70
|
+
}, async (argv) => {
|
|
71
|
+
const { updateMarketplaceCommand } = await import("./commands/plugin/marketplace.js");
|
|
72
|
+
await updateMarketplaceCommand(argv);
|
|
73
|
+
})
|
|
74
|
+
.command("list", "List registered marketplaces", {}, async () => {
|
|
75
|
+
const { listMarketplacesCommand } = await import("./commands/plugin/marketplace.js");
|
|
76
|
+
await listMarketplacesCommand();
|
|
77
|
+
})
|
|
78
|
+
.demandCommand(1, "Please specify a marketplace subcommand");
|
|
79
|
+
}, () => { })
|
|
80
|
+
.command("install <plugin>", "Install a plugin from a marketplace", (yargs) => {
|
|
81
|
+
return yargs
|
|
82
|
+
.positional("plugin", {
|
|
83
|
+
describe: "Plugin to install (format: name@marketplace)",
|
|
84
|
+
type: "string",
|
|
85
|
+
})
|
|
86
|
+
.option("scope", {
|
|
87
|
+
alias: "s",
|
|
88
|
+
describe: "Scope to enable the plugin in",
|
|
89
|
+
choices: ["user", "project", "local"],
|
|
57
90
|
type: "string",
|
|
58
91
|
});
|
|
59
92
|
}, async (argv) => {
|
|
60
|
-
const {
|
|
61
|
-
await
|
|
93
|
+
const { installPluginCommand } = await import("./commands/plugin/install.js");
|
|
94
|
+
await installPluginCommand(argv);
|
|
95
|
+
})
|
|
96
|
+
.command("list", "List all available plugins from marketplaces", {}, async () => {
|
|
97
|
+
const { listPluginsCommand } = await import("./commands/plugin/list.js");
|
|
98
|
+
await listPluginsCommand();
|
|
62
99
|
})
|
|
63
|
-
.command("
|
|
64
|
-
return yargs.positional("
|
|
65
|
-
describe: "
|
|
100
|
+
.command("uninstall <plugin>", "Uninstall a plugin", (yargs) => {
|
|
101
|
+
return yargs.positional("plugin", {
|
|
102
|
+
describe: "Plugin to uninstall (format: name@marketplace)",
|
|
66
103
|
type: "string",
|
|
67
104
|
});
|
|
68
105
|
}, async (argv) => {
|
|
69
|
-
const {
|
|
70
|
-
await
|
|
106
|
+
const { uninstallPluginCommand } = await import("./commands/plugin/uninstall.js");
|
|
107
|
+
await uninstallPluginCommand(argv);
|
|
71
108
|
})
|
|
72
|
-
.command("
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.positional("plugin", {
|
|
81
|
-
describe: "Plugin to install (format: name@marketplace)",
|
|
82
|
-
type: "string",
|
|
83
|
-
})
|
|
84
|
-
.option("scope", {
|
|
85
|
-
alias: "s",
|
|
86
|
-
describe: "Scope to enable the plugin in",
|
|
87
|
-
choices: ["user", "project", "local"],
|
|
88
|
-
default: "user",
|
|
89
|
-
type: "string",
|
|
90
|
-
});
|
|
91
|
-
}, async (argv) => {
|
|
92
|
-
const { installPluginCommand } = await import("./commands/plugin/install.js");
|
|
93
|
-
await installPluginCommand(argv);
|
|
94
|
-
})
|
|
95
|
-
.command("list", "List all available plugins from marketplaces", {}, async () => {
|
|
96
|
-
const { listPluginsCommand } = await import("./commands/plugin/list.js");
|
|
97
|
-
await listPluginsCommand();
|
|
98
|
-
})
|
|
99
|
-
.command("enable <plugin>", "Enable a plugin in a specific scope", (yargs) => {
|
|
100
|
-
return yargs
|
|
101
|
-
.positional("plugin", {
|
|
102
|
-
describe: "Plugin ID (format: name@marketplace)",
|
|
103
|
-
type: "string",
|
|
104
|
-
})
|
|
105
|
-
.option("scope", {
|
|
106
|
-
alias: "s",
|
|
107
|
-
describe: "Scope to enable the plugin in",
|
|
108
|
-
choices: ["user", "project", "local"],
|
|
109
|
-
default: "user",
|
|
110
|
-
type: "string",
|
|
111
|
-
});
|
|
112
|
-
}, async (argv) => {
|
|
113
|
-
const { enablePluginCommand } = await import("./commands/plugin/enable.js");
|
|
114
|
-
await enablePluginCommand(argv);
|
|
115
|
-
})
|
|
116
|
-
.command("disable <plugin>", "Disable a plugin in a specific scope", (yargs) => {
|
|
117
|
-
return yargs
|
|
118
|
-
.positional("plugin", {
|
|
119
|
-
describe: "Plugin ID (format: name@marketplace)",
|
|
120
|
-
type: "string",
|
|
121
|
-
})
|
|
122
|
-
.option("scope", {
|
|
123
|
-
alias: "s",
|
|
124
|
-
describe: "Scope to disable the plugin in",
|
|
125
|
-
choices: ["user", "project", "local"],
|
|
126
|
-
default: "user",
|
|
127
|
-
type: "string",
|
|
109
|
+
.command("update <plugin>", "Update a plugin (uninstall followed by install)", (yargs) => {
|
|
110
|
+
return yargs.positional("plugin", {
|
|
111
|
+
describe: "Plugin to update (format: name@marketplace)",
|
|
112
|
+
type: "string",
|
|
113
|
+
});
|
|
114
|
+
}, async (argv) => {
|
|
115
|
+
const { updatePluginCommand } = await import("./commands/plugin/update.js");
|
|
116
|
+
await updatePluginCommand(argv);
|
|
128
117
|
});
|
|
129
118
|
}, async (argv) => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
.alias("v", "version")
|
|
137
|
-
.example("$0", "Start CLI with default settings")
|
|
138
|
-
.example("$0 --restore session_123", "Restore specific session")
|
|
139
|
-
.example("$0 --continue", "Continue from last session")
|
|
140
|
-
.example("$0 --print 'Hello'", "Send message in print mode")
|
|
141
|
-
.example("$0 -p 'Hello' --show-stats", "Send message in print mode with statistics")
|
|
142
|
-
.example("$0 --list-sessions", "List all available sessions")
|
|
143
|
-
.help("h")
|
|
144
|
-
.recommendCommands()
|
|
145
|
-
.strict()
|
|
146
|
-
.parseAsync();
|
|
147
|
-
// Handle list sessions command
|
|
148
|
-
if (argv.listSessions) {
|
|
149
|
-
try {
|
|
150
|
-
const currentWorkdir = process.cwd();
|
|
151
|
-
const sessions = await listSessions(currentWorkdir);
|
|
152
|
-
if (sessions.length === 0) {
|
|
153
|
-
console.log(`No sessions found for workdir: ${currentWorkdir}`);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
console.log(`Available sessions for: ${currentWorkdir}`);
|
|
157
|
-
console.log("==========================================");
|
|
158
|
-
// Get last 5 sessions
|
|
159
|
-
const lastSessions = sessions.slice(0, 5);
|
|
160
|
-
for (const session of lastSessions) {
|
|
161
|
-
const lastActiveAt = new Date(session.lastActiveAt).toLocaleString();
|
|
162
|
-
const filePath = await getSessionFilePath(session.id, session.workdir);
|
|
163
|
-
// Get first message content
|
|
164
|
-
const firstMessageContent = await getFirstMessageContent(session.id, session.workdir);
|
|
165
|
-
// Truncate content if too long
|
|
166
|
-
let truncatedContent = firstMessageContent || "No first message content";
|
|
167
|
-
if (truncatedContent.length > 30) {
|
|
168
|
-
truncatedContent = truncatedContent.substring(0, 30) + "...";
|
|
119
|
+
// If no subcommand is provided, launch the UI
|
|
120
|
+
if (argv._.length === 1 && argv._[0] === "plugin") {
|
|
121
|
+
const { startPluginManagerCli } = await import("./plugin-manager-cli.js");
|
|
122
|
+
const shouldExit = await startPluginManagerCli();
|
|
123
|
+
if (shouldExit) {
|
|
124
|
+
process.exit(0);
|
|
169
125
|
}
|
|
170
|
-
console.log(`ID: ${session.id}`);
|
|
171
|
-
console.log(` Workdir: ${session.workdir}`);
|
|
172
|
-
console.log(` File Path: ${filePath}`);
|
|
173
|
-
console.log(` Last Active: ${lastActiveAt}`);
|
|
174
|
-
console.log(` Last Message Tokens: ${session.latestTotalTokens}`);
|
|
175
|
-
console.log(` First Message: ${truncatedContent}`);
|
|
176
|
-
console.log("");
|
|
177
126
|
}
|
|
178
|
-
|
|
179
|
-
|
|
127
|
+
})
|
|
128
|
+
.version()
|
|
129
|
+
.alias("v", "version")
|
|
130
|
+
.example("$0", "Start CLI with default settings")
|
|
131
|
+
.example("$0 --restore session_123", "Restore specific session")
|
|
132
|
+
.example("$0 --continue", "Continue from last session")
|
|
133
|
+
.example("$0 --print 'Hello'", "Send message in print mode")
|
|
134
|
+
.example("$0 -p 'Hello' --show-stats", "Send message in print mode with statistics")
|
|
135
|
+
.help("h")
|
|
136
|
+
.recommendCommands()
|
|
137
|
+
.strict()
|
|
138
|
+
.parseAsync();
|
|
139
|
+
// Handle restore session command
|
|
140
|
+
if (argv.restore === "" ||
|
|
141
|
+
(process.argv.includes("-r") && argv.restore === undefined) ||
|
|
142
|
+
(process.argv.includes("--restore") && argv.restore === undefined)) {
|
|
143
|
+
// Interactive session selection
|
|
144
|
+
const { startSessionSelectorCli } = await import("./session-selector-cli.js");
|
|
145
|
+
const selectedSessionId = await startSessionSelectorCli();
|
|
146
|
+
if (!selectedSessionId) {
|
|
147
|
+
return;
|
|
180
148
|
}
|
|
181
|
-
|
|
149
|
+
// Continue with the selected session
|
|
150
|
+
return startCli({
|
|
151
|
+
restoreSessionId: selectedSessionId,
|
|
152
|
+
bypassPermissions: argv.dangerouslySkipPermissions,
|
|
153
|
+
pluginDirs: argv.pluginDir,
|
|
154
|
+
});
|
|
182
155
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
156
|
+
// Handle print mode directly
|
|
157
|
+
if (argv.print !== undefined) {
|
|
158
|
+
const { startPrintCli } = await import("./print-cli.js");
|
|
159
|
+
return startPrintCli({
|
|
160
|
+
restoreSessionId: argv.restore,
|
|
161
|
+
continueLastSession: argv.continue,
|
|
162
|
+
message: argv.print,
|
|
163
|
+
showStats: argv.showStats,
|
|
164
|
+
bypassPermissions: argv.dangerouslySkipPermissions,
|
|
165
|
+
pluginDirs: argv.pluginDir,
|
|
166
|
+
});
|
|
186
167
|
}
|
|
187
|
-
|
|
188
|
-
// Handle print mode directly
|
|
189
|
-
if (argv.print !== undefined) {
|
|
190
|
-
const { startPrintCli } = await import("./print-cli.js");
|
|
191
|
-
return startPrintCli({
|
|
168
|
+
await startCli({
|
|
192
169
|
restoreSessionId: argv.restore,
|
|
193
170
|
continueLastSession: argv.continue,
|
|
194
|
-
message: argv.print,
|
|
195
|
-
showStats: argv.showStats,
|
|
196
171
|
bypassPermissions: argv.dangerouslySkipPermissions,
|
|
197
172
|
pluginDirs: argv.pluginDir,
|
|
198
173
|
});
|
|
199
174
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
pluginDirs: argv.pluginDir,
|
|
205
|
-
});
|
|
175
|
+
catch (error) {
|
|
176
|
+
console.error("Failed to start WAVE Code:", error);
|
|
177
|
+
process.exit(1);
|
|
178
|
+
}
|
|
206
179
|
}
|
|
207
180
|
// Export CLI function
|
|
208
181
|
export { startCli } from "./cli.js";
|
|
@@ -11,12 +11,14 @@ export interface InputManagerCallbacks {
|
|
|
11
11
|
onCursorPositionChange?: (position: number) => void;
|
|
12
12
|
onFileSelectorStateChange?: (show: boolean, files: FileItem[], query: string, position: number) => void;
|
|
13
13
|
onCommandSelectorStateChange?: (show: boolean, query: string, position: number) => void;
|
|
14
|
-
|
|
14
|
+
onHistorySearchStateChange?: (show: boolean, query: string) => void;
|
|
15
15
|
onMemoryTypeSelectorStateChange?: (show: boolean, message: string) => void;
|
|
16
16
|
onShowBashManager?: () => void;
|
|
17
17
|
onShowMcpManager?: () => void;
|
|
18
|
+
onShowRewindManager?: () => void;
|
|
18
19
|
onBashManagerStateChange?: (show: boolean) => void;
|
|
19
20
|
onMcpManagerStateChange?: (show: boolean) => void;
|
|
21
|
+
onRewindManagerStateChange?: (show: boolean) => void;
|
|
20
22
|
onImagesStateChange?: (images: AttachedImage[]) => void;
|
|
21
23
|
onSendMessage?: (content: string, images?: Array<{
|
|
22
24
|
path: string;
|
|
@@ -40,9 +42,8 @@ export declare class InputManager {
|
|
|
40
42
|
private showCommandSelector;
|
|
41
43
|
private slashPosition;
|
|
42
44
|
private commandSearchQuery;
|
|
43
|
-
private
|
|
44
|
-
private
|
|
45
|
-
private bashHistorySearchQuery;
|
|
45
|
+
private showHistorySearch;
|
|
46
|
+
private historySearchQuery;
|
|
46
47
|
private showMemoryTypeSelector;
|
|
47
48
|
private memoryMessage;
|
|
48
49
|
private userInputHistory;
|
|
@@ -58,6 +59,7 @@ export declare class InputManager {
|
|
|
58
59
|
private imageIdCounter;
|
|
59
60
|
private showBashManager;
|
|
60
61
|
private showMcpManager;
|
|
62
|
+
private showRewindManager;
|
|
61
63
|
private permissionMode;
|
|
62
64
|
private selectorJustUsed;
|
|
63
65
|
private callbacks;
|
|
@@ -97,17 +99,6 @@ export declare class InputManager {
|
|
|
97
99
|
};
|
|
98
100
|
handleCancelCommandSelect(): void;
|
|
99
101
|
checkForSlashDeletion(cursorPosition: number): boolean;
|
|
100
|
-
activateBashHistorySelector(position: number): void;
|
|
101
|
-
updateBashHistorySearchQuery(query: string): void;
|
|
102
|
-
handleBashHistorySelect(command: string): {
|
|
103
|
-
newInput: string;
|
|
104
|
-
newCursorPosition: number;
|
|
105
|
-
};
|
|
106
|
-
handleCancelBashHistorySelect(): void;
|
|
107
|
-
handleBashHistoryExecute(command: string): string;
|
|
108
|
-
handleBashHistoryExecuteAndSend(command: string): void;
|
|
109
|
-
handleBashHistoryDelete(command: string, workdir?: string): void;
|
|
110
|
-
checkForExclamationDeletion(cursorPosition: number): boolean;
|
|
111
102
|
activateMemoryTypeSelector(message: string): void;
|
|
112
103
|
handleMemoryTypeSelect(type: "project" | "user"): Promise<void>;
|
|
113
104
|
handleCancelMemoryTypeSelect(): void;
|
|
@@ -119,7 +110,6 @@ export declare class InputManager {
|
|
|
119
110
|
resetHistoryNavigation(): void;
|
|
120
111
|
isFileSelectorActive(): boolean;
|
|
121
112
|
isCommandSelectorActive(): boolean;
|
|
122
|
-
isBashHistorySelectorActive(): boolean;
|
|
123
113
|
isMemoryTypeSelectorActive(): boolean;
|
|
124
114
|
getFileSelectorState(): {
|
|
125
115
|
show: boolean;
|
|
@@ -132,11 +122,6 @@ export declare class InputManager {
|
|
|
132
122
|
query: string;
|
|
133
123
|
position: number;
|
|
134
124
|
};
|
|
135
|
-
getBashHistorySelectorState(): {
|
|
136
|
-
show: boolean;
|
|
137
|
-
query: string;
|
|
138
|
-
position: number;
|
|
139
|
-
};
|
|
140
125
|
getMemoryTypeSelectorState(): {
|
|
141
126
|
show: boolean;
|
|
142
127
|
message: string;
|
|
@@ -156,6 +141,8 @@ export declare class InputManager {
|
|
|
156
141
|
setShowBashManager(show: boolean): void;
|
|
157
142
|
getShowMcpManager(): boolean;
|
|
158
143
|
setShowMcpManager(show: boolean): void;
|
|
144
|
+
getShowRewindManager(): boolean;
|
|
145
|
+
setShowRewindManager(show: boolean): void;
|
|
159
146
|
getPermissionMode(): PermissionMode;
|
|
160
147
|
setPermissionMode(mode: PermissionMode): void;
|
|
161
148
|
cyclePermissionMode(): void;
|
|
@@ -165,6 +152,10 @@ export declare class InputManager {
|
|
|
165
152
|
mimeType: string;
|
|
166
153
|
}>, isLoading?: boolean, isCommandRunning?: boolean): Promise<void>;
|
|
167
154
|
handleSelectorInput(input: string, key: Key): boolean;
|
|
155
|
+
activateHistorySearch(): void;
|
|
156
|
+
updateHistorySearchQuery(query: string): void;
|
|
157
|
+
handleHistorySearchSelect(prompt: string): void;
|
|
158
|
+
handleCancelHistorySearch(): void;
|
|
168
159
|
handleNormalInput(input: string, key: Key, attachedImages: Array<{
|
|
169
160
|
id: number;
|
|
170
161
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputManager.d.ts","sourceRoot":"","sources":["../../src/managers/InputManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"InputManager.d.ts","sourceRoot":"","sources":["../../src/managers/InputManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAEL,cAAc,EACd,MAAM,EAEP,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/B,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,yBAAyB,CAAC,EAAE,CAC1B,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,QAAQ,EAAE,EACjB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,4BAA4B,CAAC,EAAE,CAC7B,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,0BAA0B,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,+BAA+B,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MA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