wave-code 0.0.16 → 0.0.17
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/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/commands/plugin/disable.d.ts +5 -0
- package/dist/commands/plugin/disable.d.ts.map +1 -0
- package/dist/commands/plugin/disable.js +21 -0
- package/dist/commands/plugin/enable.d.ts +5 -0
- package/dist/commands/plugin/enable.d.ts.map +1 -0
- package/dist/commands/plugin/enable.js +21 -0
- package/dist/commands/plugin/install.d.ts +5 -0
- package/dist/commands/plugin/install.d.ts.map +1 -0
- package/dist/commands/plugin/install.js +28 -0
- package/dist/commands/plugin/list.d.ts +2 -0
- package/dist/commands/plugin/list.d.ts.map +1 -0
- package/dist/commands/plugin/list.js +53 -0
- package/dist/commands/plugin/marketplace.d.ts +8 -0
- package/dist/commands/plugin/marketplace.d.ts.map +1 -0
- package/dist/commands/plugin/marketplace.js +73 -0
- package/dist/components/App.d.ts +1 -0
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +4 -4
- package/dist/components/BashHistorySelector.d.ts +1 -0
- package/dist/components/BashHistorySelector.d.ts.map +1 -1
- package/dist/components/BashHistorySelector.js +15 -5
- package/dist/components/BashShellManager.d.ts.map +1 -1
- package/dist/components/BashShellManager.js +4 -4
- package/dist/components/ChatInterface.d.ts.map +1 -1
- package/dist/components/ChatInterface.js +1 -2
- package/dist/components/CommandSelector.d.ts.map +1 -1
- package/dist/components/CommandSelector.js +2 -2
- package/dist/components/Confirmation.d.ts +1 -0
- package/dist/components/Confirmation.d.ts.map +1 -1
- package/dist/components/Confirmation.js +151 -48
- package/dist/components/DiffDisplay.d.ts +3 -2
- package/dist/components/DiffDisplay.d.ts.map +1 -1
- package/dist/components/DiffDisplay.js +87 -82
- package/dist/components/FileSelector.d.ts.map +1 -1
- package/dist/components/FileSelector.js +2 -2
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +2 -2
- package/dist/components/McpManager.d.ts.map +1 -1
- package/dist/components/McpManager.js +3 -3
- package/dist/components/MemoryTypeSelector.d.ts.map +1 -1
- package/dist/components/MemoryTypeSelector.js +1 -1
- package/dist/components/MessageList.js +1 -1
- package/dist/components/PlanDisplay.d.ts +8 -0
- package/dist/components/PlanDisplay.d.ts.map +1 -0
- package/dist/components/PlanDisplay.js +14 -0
- package/dist/components/ToolResultDisplay.d.ts.map +1 -1
- package/dist/components/ToolResultDisplay.js +1 -1
- package/dist/contexts/useChat.d.ts +1 -0
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +3 -1
- package/dist/hooks/useInputManager.d.ts +1 -0
- package/dist/hooks/useInputManager.d.ts.map +1 -1
- package/dist/hooks/useInputManager.js +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +103 -0
- package/dist/managers/InputManager.d.ts +1 -0
- package/dist/managers/InputManager.d.ts.map +1 -1
- package/dist/managers/InputManager.js +7 -2
- package/dist/print-cli.d.ts +1 -0
- package/dist/print-cli.d.ts.map +1 -1
- package/dist/print-cli.js +2 -1
- package/package.json +2 -2
- package/src/cli.tsx +8 -1
- package/src/commands/plugin/disable.ts +31 -0
- package/src/commands/plugin/enable.ts +31 -0
- package/src/commands/plugin/install.ts +42 -0
- package/src/commands/plugin/list.ts +64 -0
- package/src/commands/plugin/marketplace.ts +72 -0
- package/src/components/App.tsx +11 -5
- package/src/components/BashHistorySelector.tsx +25 -7
- package/src/components/BashShellManager.tsx +16 -8
- package/src/components/ChatInterface.tsx +29 -27
- package/src/components/CommandSelector.tsx +8 -4
- package/src/components/Confirmation.tsx +312 -106
- package/src/components/DiffDisplay.tsx +167 -149
- package/src/components/FileSelector.tsx +8 -4
- package/src/components/InputBox.tsx +14 -4
- package/src/components/McpManager.tsx +12 -6
- package/src/components/MemoryTypeSelector.tsx +4 -2
- package/src/components/MessageList.tsx +1 -1
- package/src/components/PlanDisplay.tsx +46 -0
- package/src/components/ToolResultDisplay.tsx +4 -2
- package/src/contexts/useChat.tsx +4 -0
- package/src/hooks/useInputManager.ts +8 -0
- package/src/index.ts +178 -0
- package/src/managers/InputManager.ts +12 -1
- package/src/print-cli.ts +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanDisplay.d.ts","sourceRoot":"","sources":["../../src/components/PlanDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAoClD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Box, Text, useStdout } from "ink";
|
|
4
|
+
import { Markdown } from "./Markdown.js";
|
|
5
|
+
export const PlanDisplay = ({ plan, isExpanded = false, }) => {
|
|
6
|
+
const { stdout } = useStdout();
|
|
7
|
+
const maxHeight = useMemo(() => {
|
|
8
|
+
// Similar to DiffDisplay.tsx maxHeight calculation
|
|
9
|
+
return Math.max(5, (stdout?.rows || 24) - 20);
|
|
10
|
+
}, [stdout?.rows]);
|
|
11
|
+
const lines = useMemo(() => plan.split("\n"), [plan]);
|
|
12
|
+
const isOverflowing = !isExpanded && lines.length > maxHeight;
|
|
13
|
+
return (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsxs(Box, { paddingLeft: 2, borderLeft: true, borderColor: "cyan", flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Plan Content:" }), _jsx(Box, { flexDirection: "column", height: isOverflowing ? maxHeight : undefined, overflow: "hidden", children: _jsx(Markdown, { children: plan }) }), isOverflowing && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "yellow", dimColor: true, children: ["... (plan truncated, ", lines.length, " lines total)"] }) }))] }) }));
|
|
14
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolResultDisplay.d.ts","sourceRoot":"","sources":["../../src/components/ToolResultDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,UAAU,sBAAsB;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"ToolResultDisplay.d.ts","sourceRoot":"","sources":["../../src/components/ToolResultDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,UAAU,sBAAsB;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAqI9D,CAAC"}
|
|
@@ -49,5 +49,5 @@ export const ToolResultDisplay = ({ block, isExpanded = false, }) => {
|
|
|
49
49
|
return null;
|
|
50
50
|
};
|
|
51
51
|
const shortResult = getShortResult();
|
|
52
|
-
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: "magenta", children: "\uD83D\uDD27 " }), _jsx(Text, { color: "white", children: toolName }), !isExpanded && compactParams && (_jsxs(Text, { color: "gray", children: [" ", compactParams] })), _jsxs(Text, { color: getStatusColor(), children: [" ", getStatusText()] }), hasImages() && _jsxs(Text, { color: "blue", children: [" ", getImageIndicator()] })] }), !isExpanded && shortResult && !error && (_jsx(Box, { paddingLeft: 2, borderLeft: true, borderColor: "gray", flexDirection: "column", children: shortResult.split("\n").map((line, index) => (_jsx(Text, { color: "white", children: line }, index))) })), isExpanded && parameters && (_jsxs(Box, { paddingLeft: 2, borderLeft: true, borderColor: "gray", flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Parameters:" }), _jsx(Text, { color: "gray", children: parameters })] })), isExpanded && result && (_jsx(Box, { flexDirection: "column", children: _jsxs(Box, { paddingLeft: 2, borderLeft: true, borderColor: "green", flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Result:" }), _jsx(Text, { color: "white", children: result })] }) })), error && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", typeof error === "string" ? error : String(error)] }) })), _jsx(DiffDisplay, {
|
|
52
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: "magenta", children: "\uD83D\uDD27 " }), _jsx(Text, { color: "white", children: toolName }), !isExpanded && compactParams && (_jsxs(Text, { color: "gray", children: [" ", compactParams] })), _jsxs(Text, { color: getStatusColor(), children: [" ", getStatusText()] }), hasImages() && _jsxs(Text, { color: "blue", children: [" ", getImageIndicator()] })] }), !isExpanded && shortResult && !error && (_jsx(Box, { paddingLeft: 2, borderLeft: true, borderColor: "gray", flexDirection: "column", children: shortResult.split("\n").map((line, index) => (_jsx(Text, { color: "white", children: line }, index))) })), isExpanded && parameters && (_jsxs(Box, { paddingLeft: 2, borderLeft: true, borderColor: "gray", flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Parameters:" }), _jsx(Text, { color: "gray", children: parameters })] })), isExpanded && result && (_jsx(Box, { flexDirection: "column", children: _jsxs(Box, { paddingLeft: 2, borderLeft: true, borderColor: "green", flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Result:" }), _jsx(Text, { color: "white", children: result })] }) })), error && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", typeof error === "string" ? error : String(error)] }) })), stage === "end" && (_jsx(DiffDisplay, { toolName: name, parameters: parameters }))] }));
|
|
53
53
|
};
|
|
@@ -46,6 +46,7 @@ export declare const useChat: () => ChatContextType;
|
|
|
46
46
|
export interface ChatProviderProps {
|
|
47
47
|
children: React.ReactNode;
|
|
48
48
|
bypassPermissions?: boolean;
|
|
49
|
+
pluginDirs?: string[];
|
|
49
50
|
}
|
|
50
51
|
export declare const ChatProvider: React.FC<ChatProviderProps>;
|
|
51
52
|
//# sourceMappingURL=useChat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/contexts/useChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACV,OAAO,EACP,eAAe,EACf,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAUxB,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAE3B,UAAU,EAAE,OAAO,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CACX,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,KAC/C,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAE1B,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE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;AAEF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA6apD,CAAC"}
|
package/dist/contexts/useChat.js
CHANGED
|
@@ -13,7 +13,7 @@ export const useChat = () => {
|
|
|
13
13
|
}
|
|
14
14
|
return context;
|
|
15
15
|
};
|
|
16
|
-
export const ChatProvider = ({ children, bypassPermissions, }) => {
|
|
16
|
+
export const ChatProvider = ({ children, bypassPermissions, pluginDirs, }) => {
|
|
17
17
|
const { restoreSessionId, continueLastSession } = useAppConfig();
|
|
18
18
|
// Message Display State
|
|
19
19
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
@@ -118,6 +118,7 @@ export const ChatProvider = ({ children, bypassPermissions, }) => {
|
|
|
118
118
|
permissionMode: bypassPermissions ? "bypassPermissions" : undefined,
|
|
119
119
|
canUseTool: permissionCallback,
|
|
120
120
|
stream: false, // 关闭流式模式
|
|
121
|
+
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
121
122
|
});
|
|
122
123
|
agentRef.current = agent;
|
|
123
124
|
// Get initial state
|
|
@@ -146,6 +147,7 @@ export const ChatProvider = ({ children, bypassPermissions, }) => {
|
|
|
146
147
|
continueLastSession,
|
|
147
148
|
bypassPermissions,
|
|
148
149
|
showConfirmation,
|
|
150
|
+
pluginDirs,
|
|
149
151
|
]);
|
|
150
152
|
// Cleanup on unmount
|
|
151
153
|
useEffect(() => {
|
|
@@ -84,6 +84,7 @@ export declare const useInputManager: (callbacks?: Partial<InputManagerCallbacks
|
|
|
84
84
|
expandLongTextPlaceholders: (text: string) => string;
|
|
85
85
|
clearLongTextMap: () => void;
|
|
86
86
|
handleBashHistoryExecuteAndSend: (command: string) => void;
|
|
87
|
+
handleBashHistoryDelete: (command: string, workdir?: string) => void;
|
|
87
88
|
handleInput: (input: string, key: Key, attachedImages: Array<{
|
|
88
89
|
id: number;
|
|
89
90
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInputManager.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,eAAO,MAAM,eAAe,GAC1B,YAAW,OAAO,CAAC,qBAAqB,CAAM;;;;;;;;;;;;;;;;;;;;+BAwHpC,MAAM,aACD,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,KAAK,IAAI;oCAQrD,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,KAAK,IAAI;;;;;;qCA2Bd,MAAM;iCAK7C,MAAM;;;;;mCAe+B,MAAM;oCAIL,MAAM;wCAKF,MAAM;mCAKjD,MAAM;;;;mCAYN,MAAM;;;;;sCAemC,MAAM;uCAIL,MAAM;4CAKD,MAAM;uCAKrD,MAAM;;;;;0CAeuC,MAAM;wCAIR,MAAM;6CAID,MAAM;0CAKT,MAAM;mCAKhD,SAAS,GAAG,MAAM;;mCAWiB,MAAM,EAAE;iCAK5C,IAAI,GAAG,MAAM,gBAAgB,MAAM;;;;;mCAgBC,MAAM;+
|
|
1
|
+
{"version":3,"file":"useInputManager.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACd,MAAM,6BAA6B,CAAC;AACrC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,6 +238,9 @@ export const useInputManager = (callbacks = {}) => {
|
|
|
238
238
|
const handleBashHistoryExecuteAndSend = useCallback((command) => {
|
|
239
239
|
managerRef.current?.handleBashHistoryExecuteAndSend(command);
|
|
240
240
|
}, []);
|
|
241
|
+
const handleBashHistoryDelete = useCallback((command, workdir) => {
|
|
242
|
+
managerRef.current?.handleBashHistoryDelete(command, workdir);
|
|
243
|
+
}, []);
|
|
241
244
|
return {
|
|
242
245
|
// State
|
|
243
246
|
inputText,
|
|
@@ -336,6 +339,7 @@ export const useInputManager = (callbacks = {}) => {
|
|
|
336
339
|
}, []),
|
|
337
340
|
// Complex handlers combining multiple operations
|
|
338
341
|
handleBashHistoryExecuteAndSend,
|
|
342
|
+
handleBashHistoryDelete,
|
|
339
343
|
// Main input handler
|
|
340
344
|
handleInput: useCallback(async (input, key, attachedImages, isLoading = false, isCommandRunning = false, clearImages) => {
|
|
341
345
|
return ((await managerRef.current?.handleInput(input, key, attachedImages, isLoading, isCommandRunning, clearImages)) || false);
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,wBAAsB,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,wBAAsB,IAAI,kBAqSzB;AAGD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,30 +9,129 @@ export async function main() {
|
|
|
9
9
|
alias: "r",
|
|
10
10
|
description: "Restore session by ID",
|
|
11
11
|
type: "string",
|
|
12
|
+
global: false,
|
|
12
13
|
})
|
|
13
14
|
.option("continue", {
|
|
14
15
|
alias: "c",
|
|
15
16
|
description: "Continue from last session",
|
|
16
17
|
type: "boolean",
|
|
18
|
+
global: false,
|
|
17
19
|
})
|
|
18
20
|
.option("print", {
|
|
19
21
|
alias: "p",
|
|
20
22
|
description: "Print response without interactive mode",
|
|
21
23
|
type: "string",
|
|
24
|
+
global: false,
|
|
22
25
|
})
|
|
23
26
|
.option("show-stats", {
|
|
24
27
|
description: "Show timing and usage statistics in print mode",
|
|
25
28
|
type: "boolean",
|
|
29
|
+
global: false,
|
|
26
30
|
})
|
|
27
31
|
.option("list-sessions", {
|
|
28
32
|
description: "List all available sessions",
|
|
29
33
|
type: "boolean",
|
|
34
|
+
global: false,
|
|
30
35
|
})
|
|
31
36
|
.option("dangerously-skip-permissions", {
|
|
32
37
|
description: "Skip all permission checks (dangerous)",
|
|
33
38
|
type: "boolean",
|
|
34
39
|
default: false,
|
|
40
|
+
global: false,
|
|
35
41
|
})
|
|
42
|
+
.option("plugin-dir", {
|
|
43
|
+
description: "Load a plugin from a specific directory",
|
|
44
|
+
type: "array",
|
|
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) => {
|
|
52
|
+
return yargs
|
|
53
|
+
.help()
|
|
54
|
+
.command("add <input>", "Add a plugin marketplace (local path, owner/repo, or Git URL)", (yargs) => {
|
|
55
|
+
return yargs.positional("input", {
|
|
56
|
+
describe: "Path to local marketplace, GitHub owner/repo, or full Git URL (with optional #ref)",
|
|
57
|
+
type: "string",
|
|
58
|
+
});
|
|
59
|
+
}, async (argv) => {
|
|
60
|
+
const { addMarketplaceCommand } = await import("./commands/plugin/marketplace.js");
|
|
61
|
+
await addMarketplaceCommand(argv);
|
|
62
|
+
})
|
|
63
|
+
.command("update [name]", "Update registered marketplace(s)", (yargs) => {
|
|
64
|
+
return yargs.positional("name", {
|
|
65
|
+
describe: "Name of the marketplace to update",
|
|
66
|
+
type: "string",
|
|
67
|
+
});
|
|
68
|
+
}, async (argv) => {
|
|
69
|
+
const { updateMarketplaceCommand } = await import("./commands/plugin/marketplace.js");
|
|
70
|
+
await updateMarketplaceCommand(argv);
|
|
71
|
+
})
|
|
72
|
+
.command("list", "List registered marketplaces", {}, async () => {
|
|
73
|
+
const { listMarketplacesCommand } = await import("./commands/plugin/marketplace.js");
|
|
74
|
+
await listMarketplacesCommand();
|
|
75
|
+
})
|
|
76
|
+
.demandCommand(1, "Please specify a marketplace subcommand");
|
|
77
|
+
}, () => { })
|
|
78
|
+
.command("install <plugin>", "Install a plugin from a marketplace", (yargs) => {
|
|
79
|
+
return yargs
|
|
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",
|
|
128
|
+
});
|
|
129
|
+
}, async (argv) => {
|
|
130
|
+
const { disablePluginCommand } = await import("./commands/plugin/disable.js");
|
|
131
|
+
await disablePluginCommand(argv);
|
|
132
|
+
})
|
|
133
|
+
.demandCommand(1, "Please specify a plugin subcommand");
|
|
134
|
+
}, () => { })
|
|
36
135
|
.version()
|
|
37
136
|
.alias("v", "version")
|
|
38
137
|
.example("$0", "Start CLI with default settings")
|
|
@@ -42,6 +141,8 @@ export async function main() {
|
|
|
42
141
|
.example("$0 -p 'Hello' --show-stats", "Send message in print mode with statistics")
|
|
43
142
|
.example("$0 --list-sessions", "List all available sessions")
|
|
44
143
|
.help("h")
|
|
144
|
+
.recommendCommands()
|
|
145
|
+
.strict()
|
|
45
146
|
.parseAsync();
|
|
46
147
|
// Handle list sessions command
|
|
47
148
|
if (argv.listSessions) {
|
|
@@ -93,12 +194,14 @@ export async function main() {
|
|
|
93
194
|
message: argv.print,
|
|
94
195
|
showStats: argv.showStats,
|
|
95
196
|
bypassPermissions: argv.dangerouslySkipPermissions,
|
|
197
|
+
pluginDirs: argv.pluginDir,
|
|
96
198
|
});
|
|
97
199
|
}
|
|
98
200
|
await startCli({
|
|
99
201
|
restoreSessionId: argv.restore,
|
|
100
202
|
continueLastSession: argv.continue,
|
|
101
203
|
bypassPermissions: argv.dangerouslySkipPermissions,
|
|
204
|
+
pluginDirs: argv.pluginDir,
|
|
102
205
|
});
|
|
103
206
|
}
|
|
104
207
|
// Export CLI function
|
|
@@ -106,6 +106,7 @@ export declare class InputManager {
|
|
|
106
106
|
handleCancelBashHistorySelect(): void;
|
|
107
107
|
handleBashHistoryExecute(command: string): string;
|
|
108
108
|
handleBashHistoryExecuteAndSend(command: string): void;
|
|
109
|
+
handleBashHistoryDelete(command: string, workdir?: string): void;
|
|
109
110
|
checkForExclamationDeletion(cursorPosition: number): boolean;
|
|
110
111
|
activateMemoryTypeSelector(message: string): void;
|
|
111
112
|
handleMemoryTypeSelect(type: "project" | "user"): Promise<void>;
|
|
@@ -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,EAGL,cAAc,EACd,MAAM,EACP,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,EA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AE,OAAe,EACjC,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,OAAO,CAAC,OAAO,CAAC;IAwGb,WAAW,CACf,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,GAAG,EACR,cAAc,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,EACrE,SAAS,GAAE,OAAe,EAC1B,gBAAgB,GAAE,OAAe,EACjC,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,OAAO,CAAC,OAAO,CAAC;IAmDnB,OAAO,IAAI,IAAI;CAUhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { searchFiles as searchFilesUtil, } from "wave-agent-sdk";
|
|
1
|
+
import { searchFiles as searchFilesUtil, deleteBashCommandFromHistory, } from "wave-agent-sdk";
|
|
2
2
|
import { readClipboardImage } from "../utils/clipboard.js";
|
|
3
3
|
export class InputManager {
|
|
4
4
|
constructor(callbacks = {}) {
|
|
@@ -328,6 +328,11 @@ export class InputManager {
|
|
|
328
328
|
this.clearInput();
|
|
329
329
|
this.callbacks.onSendMessage?.(bashCommand);
|
|
330
330
|
}
|
|
331
|
+
handleBashHistoryDelete(command, workdir) {
|
|
332
|
+
deleteBashCommandFromHistory(command, workdir);
|
|
333
|
+
// Trigger a refresh of the selector state to force re-render of BashHistorySelector
|
|
334
|
+
this.callbacks.onBashHistorySelectorStateChange?.(this.showBashHistorySelector, this.bashHistorySearchQuery, this.exclamationPosition);
|
|
335
|
+
}
|
|
331
336
|
checkForExclamationDeletion(cursorPosition) {
|
|
332
337
|
if (this.showBashHistorySelector &&
|
|
333
338
|
cursorPosition <= this.exclamationPosition) {
|
|
@@ -633,7 +638,7 @@ export class InputManager {
|
|
|
633
638
|
this.permissionMode = mode;
|
|
634
639
|
}
|
|
635
640
|
cyclePermissionMode() {
|
|
636
|
-
const modes = ["default", "acceptEdits"];
|
|
641
|
+
const modes = ["default", "acceptEdits", "plan"];
|
|
637
642
|
const currentIndex = modes.indexOf(this.permissionMode);
|
|
638
643
|
const nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % modes.length;
|
|
639
644
|
const nextMode = modes[nextIndex];
|
package/dist/print-cli.d.ts
CHANGED
package/dist/print-cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print-cli.d.ts","sourceRoot":"","sources":["../src/print-cli.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"print-cli.d.ts","sourceRoot":"","sources":["../src/print-cli.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAgBD,wBAAsB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAgL3E"}
|
package/dist/print-cli.js
CHANGED
|
@@ -13,7 +13,7 @@ function displayTimingInfo(startTime, showStats) {
|
|
|
13
13
|
}
|
|
14
14
|
export async function startPrintCli(options) {
|
|
15
15
|
const startTime = new Date();
|
|
16
|
-
const { restoreSessionId, continueLastSession, message, showStats = false, bypassPermissions, } = options;
|
|
16
|
+
const { restoreSessionId, continueLastSession, message, showStats = false, bypassPermissions, pluginDirs, } = options;
|
|
17
17
|
if ((!message || message.trim() === "") &&
|
|
18
18
|
!continueLastSession &&
|
|
19
19
|
!restoreSessionId) {
|
|
@@ -115,6 +115,7 @@ export async function startPrintCli(options) {
|
|
|
115
115
|
restoreSessionId,
|
|
116
116
|
continueLastSession,
|
|
117
117
|
permissionMode: bypassPermissions ? "bypassPermissions" : undefined,
|
|
118
|
+
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
118
119
|
// 保持流式模式以获得更好的命令行用户体验
|
|
119
120
|
});
|
|
120
121
|
// Send message if provided and not empty
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-code",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "CLI-based code assistant powered by AI, built with React and Ink",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"marked": "^11.2.0",
|
|
32
32
|
"react": "^19.1.0",
|
|
33
33
|
"yargs": "^17.7.2",
|
|
34
|
-
"wave-agent-sdk": "0.0.
|
|
34
|
+
"wave-agent-sdk": "0.0.16"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/react": "^19.1.8",
|
package/src/cli.tsx
CHANGED
|
@@ -7,10 +7,16 @@ export interface CliOptions {
|
|
|
7
7
|
restoreSessionId?: string;
|
|
8
8
|
continueLastSession?: boolean;
|
|
9
9
|
bypassPermissions?: boolean;
|
|
10
|
+
pluginDirs?: string[];
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export async function startCli(options: CliOptions): Promise<void> {
|
|
13
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
restoreSessionId,
|
|
16
|
+
continueLastSession,
|
|
17
|
+
bypassPermissions,
|
|
18
|
+
pluginDirs,
|
|
19
|
+
} = options;
|
|
14
20
|
|
|
15
21
|
// Continue with ink-based UI for normal mode
|
|
16
22
|
// Global cleanup tracker
|
|
@@ -65,6 +71,7 @@ export async function startCli(options: CliOptions): Promise<void> {
|
|
|
65
71
|
restoreSessionId={restoreSessionId}
|
|
66
72
|
continueLastSession={continueLastSession}
|
|
67
73
|
bypassPermissions={bypassPermissions}
|
|
74
|
+
pluginDirs={pluginDirs}
|
|
68
75
|
/>,
|
|
69
76
|
);
|
|
70
77
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigurationService,
|
|
3
|
+
PluginManager,
|
|
4
|
+
PluginScopeManager,
|
|
5
|
+
} from "wave-agent-sdk";
|
|
6
|
+
|
|
7
|
+
export async function disablePluginCommand(argv: {
|
|
8
|
+
plugin: string;
|
|
9
|
+
scope: "user" | "project" | "local";
|
|
10
|
+
}) {
|
|
11
|
+
const workdir = process.cwd();
|
|
12
|
+
const configurationService = new ConfigurationService();
|
|
13
|
+
const pluginManager = new PluginManager({ workdir });
|
|
14
|
+
const scopeManager = new PluginScopeManager({
|
|
15
|
+
workdir,
|
|
16
|
+
configurationService,
|
|
17
|
+
pluginManager,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
await scopeManager.disablePlugin(argv.scope, argv.plugin);
|
|
22
|
+
console.log(
|
|
23
|
+
`Successfully disabled plugin: ${argv.plugin} in ${argv.scope} scope`,
|
|
24
|
+
);
|
|
25
|
+
process.exit(0);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
28
|
+
console.error(`Failed to disable plugin: ${message}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigurationService,
|
|
3
|
+
PluginManager,
|
|
4
|
+
PluginScopeManager,
|
|
5
|
+
} from "wave-agent-sdk";
|
|
6
|
+
|
|
7
|
+
export async function enablePluginCommand(argv: {
|
|
8
|
+
plugin: string;
|
|
9
|
+
scope: "user" | "project" | "local";
|
|
10
|
+
}) {
|
|
11
|
+
const workdir = process.cwd();
|
|
12
|
+
const configurationService = new ConfigurationService();
|
|
13
|
+
const pluginManager = new PluginManager({ workdir });
|
|
14
|
+
const scopeManager = new PluginScopeManager({
|
|
15
|
+
workdir,
|
|
16
|
+
configurationService,
|
|
17
|
+
pluginManager,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
await scopeManager.enablePlugin(argv.scope, argv.plugin);
|
|
22
|
+
console.log(
|
|
23
|
+
`Successfully enabled plugin: ${argv.plugin} in ${argv.scope} scope`,
|
|
24
|
+
);
|
|
25
|
+
process.exit(0);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
28
|
+
console.error(`Failed to enable plugin: ${message}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MarketplaceService,
|
|
3
|
+
ConfigurationService,
|
|
4
|
+
PluginManager,
|
|
5
|
+
PluginScopeManager,
|
|
6
|
+
} from "wave-agent-sdk";
|
|
7
|
+
|
|
8
|
+
export async function installPluginCommand(argv: {
|
|
9
|
+
plugin: string;
|
|
10
|
+
scope?: "user" | "project" | "local";
|
|
11
|
+
}) {
|
|
12
|
+
const marketplaceService = new MarketplaceService();
|
|
13
|
+
const workdir = process.cwd();
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const installed = await marketplaceService.installPlugin(argv.plugin);
|
|
17
|
+
console.log(
|
|
18
|
+
`Successfully installed plugin: ${installed.name} v${installed.version} from ${installed.marketplace}`,
|
|
19
|
+
);
|
|
20
|
+
console.log(`Cache path: ${installed.cachePath}`);
|
|
21
|
+
|
|
22
|
+
if (argv.scope) {
|
|
23
|
+
const configurationService = new ConfigurationService();
|
|
24
|
+
const pluginManager = new PluginManager({ workdir });
|
|
25
|
+
const scopeManager = new PluginScopeManager({
|
|
26
|
+
workdir,
|
|
27
|
+
configurationService,
|
|
28
|
+
pluginManager,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const pluginId = `${installed.name}@${installed.marketplace}`;
|
|
32
|
+
await scopeManager.enablePlugin(argv.scope, pluginId);
|
|
33
|
+
console.log(`Plugin ${pluginId} enabled in ${argv.scope} scope`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
process.exit(0);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
39
|
+
console.error(`Failed to install plugin: ${message}`);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { MarketplaceService, ConfigurationService } from "wave-agent-sdk";
|
|
2
|
+
|
|
3
|
+
export async function listPluginsCommand() {
|
|
4
|
+
const marketplaceService = new MarketplaceService();
|
|
5
|
+
const configurationService = new ConfigurationService();
|
|
6
|
+
const workdir = process.cwd();
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const installedPlugins = await marketplaceService.getInstalledPlugins();
|
|
10
|
+
const marketplaces = await marketplaceService.listMarketplaces();
|
|
11
|
+
const mergedEnabled = configurationService.getMergedEnabledPlugins(workdir);
|
|
12
|
+
|
|
13
|
+
// Collect all plugins from all marketplaces
|
|
14
|
+
const allMarketplacePlugins: {
|
|
15
|
+
name: string;
|
|
16
|
+
marketplace: string;
|
|
17
|
+
installed: boolean;
|
|
18
|
+
version?: string;
|
|
19
|
+
}[] = [];
|
|
20
|
+
|
|
21
|
+
for (const m of marketplaces) {
|
|
22
|
+
try {
|
|
23
|
+
const manifest = await marketplaceService.loadMarketplaceManifest(
|
|
24
|
+
marketplaceService.getMarketplacePath(m),
|
|
25
|
+
);
|
|
26
|
+
manifest.plugins.forEach((p) => {
|
|
27
|
+
const installed = installedPlugins.plugins.find(
|
|
28
|
+
(ip) => ip.name === p.name && ip.marketplace === m.name,
|
|
29
|
+
);
|
|
30
|
+
allMarketplacePlugins.push({
|
|
31
|
+
name: p.name,
|
|
32
|
+
marketplace: m.name,
|
|
33
|
+
installed: !!installed,
|
|
34
|
+
version: installed?.version,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
} catch {
|
|
38
|
+
// Skip marketplaces that fail to load
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (allMarketplacePlugins.length === 0) {
|
|
43
|
+
console.log("No plugins found in registered marketplaces.");
|
|
44
|
+
} else {
|
|
45
|
+
console.log("Plugins:");
|
|
46
|
+
allMarketplacePlugins.forEach((p) => {
|
|
47
|
+
const pluginId = `${p.name}@${p.marketplace}`;
|
|
48
|
+
const isEnabled = mergedEnabled[pluginId] !== false;
|
|
49
|
+
const status = p.installed
|
|
50
|
+
? isEnabled
|
|
51
|
+
? "enabled"
|
|
52
|
+
: "disabled"
|
|
53
|
+
: "not installed";
|
|
54
|
+
const versionStr = p.version ? ` v${p.version}` : "";
|
|
55
|
+
console.log(`- ${pluginId}${versionStr} [${status}]`);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
process.exit(0);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
61
|
+
console.error(`Failed to list plugins: ${message}`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
}
|