wave-code 0.10.2 → 0.10.3
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.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +4 -4
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/print-cli.d.ts.map +1 -1
- package/dist/print-cli.js +2 -2
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/cli.tsx +2 -0
- package/src/components/App.tsx +4 -0
- package/src/contexts/useChat.tsx +9 -3
- package/src/index.ts +17 -2
- package/src/print-cli.ts +3 -1
- package/src/types.ts +2 -0
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAsB,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAsB,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA4DjE"}
|
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ import { App } from "./components/App.js";
|
|
|
4
4
|
import { cleanupLogs } from "./utils/logger.js";
|
|
5
5
|
import { removeWorktree } from "./utils/worktree.js";
|
|
6
6
|
export async function startCli(options) {
|
|
7
|
-
const { restoreSessionId, continueLastSession, bypassPermissions, pluginDirs, tools, worktreeSession, workdir, version, model, } = options;
|
|
7
|
+
const { restoreSessionId, continueLastSession, bypassPermissions, permissionMode, pluginDirs, tools, worktreeSession, workdir, version, model, } = options;
|
|
8
8
|
// Continue with ink-based UI for normal mode
|
|
9
9
|
let shouldRemoveWorktree = false;
|
|
10
10
|
const handleExit = (shouldRemove) => {
|
|
@@ -12,7 +12,7 @@ export async function startCli(options) {
|
|
|
12
12
|
unmount();
|
|
13
13
|
};
|
|
14
14
|
// Render the application
|
|
15
|
-
const { unmount, waitUntilExit } = render(_jsx(App, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, bypassPermissions: bypassPermissions, pluginDirs: pluginDirs, tools: tools, worktreeSession: worktreeSession, workdir: workdir, version: version, model: model, onExit: handleExit }), { exitOnCtrlC: false });
|
|
15
|
+
const { unmount, waitUntilExit } = render(_jsx(App, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, bypassPermissions: bypassPermissions, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, worktreeSession: worktreeSession, workdir: workdir, version: version, model: model, onExit: handleExit }), { exitOnCtrlC: false });
|
|
16
16
|
// Wait for the app to finish unmounting
|
|
17
17
|
await waitUntilExit();
|
|
18
18
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/components/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAWxE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,UAAU,QAAS,SAAQ,YAAY;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,MAAM,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/components/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAWxE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,UAAU,QAAS,SAAQ,YAAY;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,MAAM,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AA4ID,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA+BlC,CAAC"}
|
package/dist/components/App.js
CHANGED
|
@@ -6,7 +6,7 @@ import { ChatProvider, useChat } from "../contexts/useChat.js";
|
|
|
6
6
|
import { AppProvider } from "../contexts/useAppConfig.js";
|
|
7
7
|
import { WorktreeExitPrompt } from "./WorktreeExitPrompt.js";
|
|
8
8
|
import { hasUncommittedChanges, hasNewCommits, getDefaultRemoteBranch, } from "wave-agent-sdk";
|
|
9
|
-
const AppWithProviders = ({ bypassPermissions, pluginDirs, tools, worktreeSession, workdir, version, model, onExit, }) => {
|
|
9
|
+
const AppWithProviders = ({ bypassPermissions, permissionMode, pluginDirs, tools, worktreeSession, workdir, version, model, onExit, }) => {
|
|
10
10
|
const [isExiting, setIsExiting] = useState(false);
|
|
11
11
|
const [worktreeStatus, setWorktreeStatus] = useState(null);
|
|
12
12
|
const handleSignal = useCallback(async () => {
|
|
@@ -48,7 +48,7 @@ const AppWithProviders = ({ bypassPermissions, pluginDirs, tools, worktreeSessio
|
|
|
48
48
|
if (isExiting && worktreeSession && worktreeStatus) {
|
|
49
49
|
return (_jsx(WorktreeExitPrompt, { name: worktreeSession.name, path: worktreeSession.path, hasUncommittedChanges: worktreeStatus.hasUncommittedChanges, hasNewCommits: worktreeStatus.hasNewCommits, onKeep: () => onExit(false), onRemove: () => onExit(true), onCancel: () => setIsExiting(false) }));
|
|
50
50
|
}
|
|
51
|
-
return (_jsx(ChatProvider, { bypassPermissions: bypassPermissions, pluginDirs: pluginDirs, tools: tools, workdir: workdir, worktreeSession: worktreeSession, version: version, model: model, children: _jsx(ChatInterfaceWithRemount, {}) }));
|
|
51
|
+
return (_jsx(ChatProvider, { bypassPermissions: bypassPermissions, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, workdir: workdir, worktreeSession: worktreeSession, version: version, model: model, children: _jsx(ChatInterfaceWithRemount, {}) }));
|
|
52
52
|
};
|
|
53
53
|
const ChatInterfaceWithRemount = () => {
|
|
54
54
|
const { stdout } = useStdout();
|
|
@@ -86,6 +86,6 @@ const ChatInterfaceWithRemount = () => {
|
|
|
86
86
|
]);
|
|
87
87
|
return _jsx(ChatInterface, {}, remountKey);
|
|
88
88
|
};
|
|
89
|
-
export const App = ({ restoreSessionId, continueLastSession, bypassPermissions, pluginDirs, tools, worktreeSession, workdir, version, model, onExit, }) => {
|
|
90
|
-
return (_jsx(AppProvider, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, children: _jsx(AppWithProviders, { bypassPermissions: bypassPermissions, pluginDirs: pluginDirs, tools: tools, worktreeSession: worktreeSession, workdir: workdir, version: version, model: model, onExit: onExit }) }));
|
|
89
|
+
export const App = ({ restoreSessionId, continueLastSession, bypassPermissions, permissionMode, pluginDirs, tools, worktreeSession, workdir, version, model, onExit, }) => {
|
|
90
|
+
return (_jsx(AppProvider, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, children: _jsx(AppWithProviders, { bypassPermissions: bypassPermissions, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, worktreeSession: worktreeSession, workdir: workdir, version: version, model: model, onExit: onExit }) }));
|
|
91
91
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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E,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvE,gBAAgB,EAAE,MAAM,OAAO,gBAAgB,EAAE,aAAa,CAAC;IAC/D,cAAc,EAAE,MAAM,OAAO,gBAAgB,EAAE,WAAW,CAAC;IAC3D,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,eAAO,MAAM,OAAO,uBAMnB,CAAC;AAEF,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA+jBpD,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, pluginDirs, tools, workdir, worktreeSession, version, model, }) => {
|
|
16
|
+
export const ChatProvider = ({ children, bypassPermissions, permissionMode: initialPermissionMode, pluginDirs, tools, workdir, worktreeSession, version, model, }) => {
|
|
17
17
|
const { restoreSessionId, continueLastSession } = useAppConfig();
|
|
18
18
|
// Message Display State
|
|
19
19
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
@@ -42,7 +42,8 @@ export const ChatProvider = ({ children, bypassPermissions, pluginDirs, tools, w
|
|
|
42
42
|
const [subagentMessages, setSubagentMessages] = useState({});
|
|
43
43
|
const [subagentLatestTokens, setSubagentLatestTokens] = useState({});
|
|
44
44
|
// Permission state
|
|
45
|
-
const [permissionMode, setPermissionModeState] = useState(
|
|
45
|
+
const [permissionMode, setPermissionModeState] = useState(initialPermissionMode ||
|
|
46
|
+
(bypassPermissions ? "bypassPermissions" : "default"));
|
|
46
47
|
// Confirmation state with queue-based architecture
|
|
47
48
|
const [isConfirmationVisible, setIsConfirmationVisible] = useState(false);
|
|
48
49
|
const [confirmingTool, setConfirmingTool] = useState();
|
|
@@ -145,7 +146,8 @@ export const ChatProvider = ({ children, bypassPermissions, pluginDirs, tools, w
|
|
|
145
146
|
restoreSessionId,
|
|
146
147
|
continueLastSession,
|
|
147
148
|
logger,
|
|
148
|
-
permissionMode:
|
|
149
|
+
permissionMode: initialPermissionMode ||
|
|
150
|
+
(bypassPermissions ? "bypassPermissions" : undefined),
|
|
149
151
|
canUseTool: permissionCallback,
|
|
150
152
|
stream: false, // 关闭流式模式
|
|
151
153
|
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
@@ -188,6 +190,7 @@ export const ChatProvider = ({ children, bypassPermissions, pluginDirs, tools, w
|
|
|
188
190
|
worktreeSession,
|
|
189
191
|
model,
|
|
190
192
|
debouncedSetTasks,
|
|
193
|
+
initialPermissionMode,
|
|
191
194
|
]);
|
|
192
195
|
// Cleanup on unmount
|
|
193
196
|
useEffect(() => {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAsB,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAsB,IAAI,kBAiUzB;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
|
@@ -49,6 +49,18 @@ export async function main() {
|
|
|
49
49
|
type: "boolean",
|
|
50
50
|
default: false,
|
|
51
51
|
global: false,
|
|
52
|
+
})
|
|
53
|
+
.option("permission-mode", {
|
|
54
|
+
description: "Permission mode to use for the session",
|
|
55
|
+
choices: [
|
|
56
|
+
"acceptEdits",
|
|
57
|
+
"bypassPermissions",
|
|
58
|
+
"default",
|
|
59
|
+
"dontAsk",
|
|
60
|
+
"plan",
|
|
61
|
+
],
|
|
62
|
+
type: "string",
|
|
63
|
+
global: false,
|
|
52
64
|
})
|
|
53
65
|
.option("plugin-dir", {
|
|
54
66
|
description: "Load a plugin from a specific directory",
|
|
@@ -194,6 +206,7 @@ export async function main() {
|
|
|
194
206
|
return startCli({
|
|
195
207
|
restoreSessionId: selectedSessionId,
|
|
196
208
|
bypassPermissions: argv.dangerouslySkipPermissions,
|
|
209
|
+
permissionMode: argv.permissionMode,
|
|
197
210
|
pluginDirs,
|
|
198
211
|
tools,
|
|
199
212
|
worktreeSession,
|
|
@@ -211,6 +224,7 @@ export async function main() {
|
|
|
211
224
|
message: argv.print,
|
|
212
225
|
showStats: argv.showStats,
|
|
213
226
|
bypassPermissions: argv.dangerouslySkipPermissions,
|
|
227
|
+
permissionMode: argv.permissionMode,
|
|
214
228
|
pluginDirs,
|
|
215
229
|
tools,
|
|
216
230
|
worktreeSession,
|
|
@@ -223,6 +237,7 @@ export async function main() {
|
|
|
223
237
|
restoreSessionId: argv.restore,
|
|
224
238
|
continueLastSession: argv.continue,
|
|
225
239
|
bypassPermissions: argv.dangerouslySkipPermissions,
|
|
240
|
+
permissionMode: argv.permissionMode,
|
|
226
241
|
pluginDirs,
|
|
227
242
|
tools,
|
|
228
243
|
worktreeSession,
|
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":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAgBD,wBAAsB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"print-cli.d.ts","sourceRoot":"","sources":["../src/print-cli.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAgBD,wBAAsB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwM3E"}
|
package/dist/print-cli.js
CHANGED
|
@@ -14,7 +14,7 @@ function displayTimingInfo(startTime, showStats) {
|
|
|
14
14
|
}
|
|
15
15
|
export async function startPrintCli(options) {
|
|
16
16
|
const startTime = new Date();
|
|
17
|
-
const { restoreSessionId, continueLastSession, message, showStats = false, bypassPermissions, pluginDirs, tools, worktreeSession, workdir, model, } = options;
|
|
17
|
+
const { restoreSessionId, continueLastSession, message, showStats = false, bypassPermissions, permissionMode, pluginDirs, tools, worktreeSession, workdir, model, } = options;
|
|
18
18
|
if ((!message || message.trim() === "") &&
|
|
19
19
|
!continueLastSession &&
|
|
20
20
|
!restoreSessionId) {
|
|
@@ -96,7 +96,7 @@ export async function startPrintCli(options) {
|
|
|
96
96
|
callbacks,
|
|
97
97
|
restoreSessionId,
|
|
98
98
|
continueLastSession,
|
|
99
|
-
permissionMode: bypassPermissions ? "bypassPermissions" : undefined,
|
|
99
|
+
permissionMode: permissionMode || (bypassPermissions ? "bypassPermissions" : undefined),
|
|
100
100
|
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
101
101
|
tools,
|
|
102
102
|
workdir,
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { WorktreeSession } from "./utils/worktree.js";
|
|
2
|
+
import { PermissionMode } from "wave-agent-sdk";
|
|
2
3
|
export interface BaseAppProps {
|
|
3
4
|
bypassPermissions?: boolean;
|
|
5
|
+
permissionMode?: PermissionMode;
|
|
4
6
|
pluginDirs?: string[];
|
|
5
7
|
tools?: string[];
|
|
6
8
|
worktreeSession?: WorktreeSession;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-code",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "CLI-based code assistant powered by AI, built with React and Ink",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"yargs": "^17.7.2",
|
|
42
42
|
"@agentclientprotocol/sdk": "0.16.1",
|
|
43
43
|
"zod": "^3.23.8",
|
|
44
|
-
"wave-agent-sdk": "0.10.
|
|
44
|
+
"wave-agent-sdk": "0.10.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/react": "^19.1.8",
|
package/src/cli.tsx
CHANGED
|
@@ -15,6 +15,7 @@ export async function startCli(options: CliOptions): Promise<void> {
|
|
|
15
15
|
restoreSessionId,
|
|
16
16
|
continueLastSession,
|
|
17
17
|
bypassPermissions,
|
|
18
|
+
permissionMode,
|
|
18
19
|
pluginDirs,
|
|
19
20
|
tools,
|
|
20
21
|
worktreeSession,
|
|
@@ -37,6 +38,7 @@ export async function startCli(options: CliOptions): Promise<void> {
|
|
|
37
38
|
restoreSessionId={restoreSessionId}
|
|
38
39
|
continueLastSession={continueLastSession}
|
|
39
40
|
bypassPermissions={bypassPermissions}
|
|
41
|
+
permissionMode={permissionMode}
|
|
40
42
|
pluginDirs={pluginDirs}
|
|
41
43
|
tools={tools}
|
|
42
44
|
worktreeSession={worktreeSession}
|
package/src/components/App.tsx
CHANGED
|
@@ -23,6 +23,7 @@ interface AppWithProvidersProps extends BaseAppProps {
|
|
|
23
23
|
|
|
24
24
|
const AppWithProviders: React.FC<AppWithProvidersProps> = ({
|
|
25
25
|
bypassPermissions,
|
|
26
|
+
permissionMode,
|
|
26
27
|
pluginDirs,
|
|
27
28
|
tools,
|
|
28
29
|
worktreeSession,
|
|
@@ -94,6 +95,7 @@ const AppWithProviders: React.FC<AppWithProvidersProps> = ({
|
|
|
94
95
|
return (
|
|
95
96
|
<ChatProvider
|
|
96
97
|
bypassPermissions={bypassPermissions}
|
|
98
|
+
permissionMode={permissionMode}
|
|
97
99
|
pluginDirs={pluginDirs}
|
|
98
100
|
tools={tools}
|
|
99
101
|
workdir={workdir}
|
|
@@ -157,6 +159,7 @@ export const App: React.FC<AppProps> = ({
|
|
|
157
159
|
restoreSessionId,
|
|
158
160
|
continueLastSession,
|
|
159
161
|
bypassPermissions,
|
|
162
|
+
permissionMode,
|
|
160
163
|
pluginDirs,
|
|
161
164
|
tools,
|
|
162
165
|
worktreeSession,
|
|
@@ -172,6 +175,7 @@ export const App: React.FC<AppProps> = ({
|
|
|
172
175
|
>
|
|
173
176
|
<AppWithProviders
|
|
174
177
|
bypassPermissions={bypassPermissions}
|
|
178
|
+
permissionMode={permissionMode}
|
|
175
179
|
pluginDirs={pluginDirs}
|
|
176
180
|
tools={tools}
|
|
177
181
|
worktreeSession={worktreeSession}
|
package/src/contexts/useChat.tsx
CHANGED
|
@@ -125,6 +125,7 @@ export interface ChatProviderProps extends BaseAppProps {
|
|
|
125
125
|
export const ChatProvider: React.FC<ChatProviderProps> = ({
|
|
126
126
|
children,
|
|
127
127
|
bypassPermissions,
|
|
128
|
+
permissionMode: initialPermissionMode,
|
|
128
129
|
pluginDirs,
|
|
129
130
|
tools,
|
|
130
131
|
workdir,
|
|
@@ -180,8 +181,10 @@ export const ChatProvider: React.FC<ChatProviderProps> = ({
|
|
|
180
181
|
>({});
|
|
181
182
|
|
|
182
183
|
// Permission state
|
|
183
|
-
const [permissionMode, setPermissionModeState] =
|
|
184
|
-
|
|
184
|
+
const [permissionMode, setPermissionModeState] = useState<PermissionMode>(
|
|
185
|
+
initialPermissionMode ||
|
|
186
|
+
(bypassPermissions ? "bypassPermissions" : "default"),
|
|
187
|
+
);
|
|
185
188
|
|
|
186
189
|
// Confirmation state with queue-based architecture
|
|
187
190
|
const [isConfirmationVisible, setIsConfirmationVisible] = useState(false);
|
|
@@ -339,7 +342,9 @@ export const ChatProvider: React.FC<ChatProviderProps> = ({
|
|
|
339
342
|
restoreSessionId,
|
|
340
343
|
continueLastSession,
|
|
341
344
|
logger,
|
|
342
|
-
permissionMode:
|
|
345
|
+
permissionMode:
|
|
346
|
+
initialPermissionMode ||
|
|
347
|
+
(bypassPermissions ? "bypassPermissions" : undefined),
|
|
343
348
|
canUseTool: permissionCallback,
|
|
344
349
|
stream: false, // 关闭流式模式
|
|
345
350
|
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
@@ -386,6 +391,7 @@ export const ChatProvider: React.FC<ChatProviderProps> = ({
|
|
|
386
391
|
worktreeSession,
|
|
387
392
|
model,
|
|
388
393
|
debouncedSetTasks,
|
|
394
|
+
initialPermissionMode,
|
|
389
395
|
]);
|
|
390
396
|
|
|
391
397
|
// Cleanup on unmount
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import yargs from "yargs";
|
|
2
2
|
import { hideBin } from "yargs/helpers";
|
|
3
3
|
import { startCli } from "./cli.js";
|
|
4
|
-
import { Scope, generateRandomName } from "wave-agent-sdk";
|
|
4
|
+
import { Scope, generateRandomName, type PermissionMode } from "wave-agent-sdk";
|
|
5
5
|
import { createWorktree, type WorktreeSession } from "./utils/worktree.js";
|
|
6
6
|
import path from "path";
|
|
7
7
|
import { readFileSync } from "fs";
|
|
@@ -53,6 +53,18 @@ export async function main() {
|
|
|
53
53
|
default: false,
|
|
54
54
|
global: false,
|
|
55
55
|
})
|
|
56
|
+
.option("permission-mode", {
|
|
57
|
+
description: "Permission mode to use for the session",
|
|
58
|
+
choices: [
|
|
59
|
+
"acceptEdits",
|
|
60
|
+
"bypassPermissions",
|
|
61
|
+
"default",
|
|
62
|
+
"dontAsk",
|
|
63
|
+
"plan",
|
|
64
|
+
],
|
|
65
|
+
type: "string",
|
|
66
|
+
global: false,
|
|
67
|
+
})
|
|
56
68
|
.option("plugin-dir", {
|
|
57
69
|
description: "Load a plugin from a specific directory",
|
|
58
70
|
type: "array",
|
|
@@ -274,7 +286,8 @@ export async function main() {
|
|
|
274
286
|
// Continue with the selected session
|
|
275
287
|
return startCli({
|
|
276
288
|
restoreSessionId: selectedSessionId,
|
|
277
|
-
bypassPermissions: argv.dangerouslySkipPermissions,
|
|
289
|
+
bypassPermissions: argv.dangerouslySkipPermissions as boolean,
|
|
290
|
+
permissionMode: argv.permissionMode as PermissionMode | undefined,
|
|
278
291
|
pluginDirs,
|
|
279
292
|
tools,
|
|
280
293
|
worktreeSession,
|
|
@@ -295,6 +308,7 @@ export async function main() {
|
|
|
295
308
|
bypassPermissions: argv.dangerouslySkipPermissions as
|
|
296
309
|
| boolean
|
|
297
310
|
| undefined,
|
|
311
|
+
permissionMode: argv.permissionMode as PermissionMode | undefined,
|
|
298
312
|
pluginDirs,
|
|
299
313
|
tools,
|
|
300
314
|
worktreeSession,
|
|
@@ -308,6 +322,7 @@ export async function main() {
|
|
|
308
322
|
restoreSessionId: argv.restore as string | undefined,
|
|
309
323
|
continueLastSession: argv.continue as boolean | undefined,
|
|
310
324
|
bypassPermissions: argv.dangerouslySkipPermissions as boolean | undefined,
|
|
325
|
+
permissionMode: argv.permissionMode as PermissionMode | undefined,
|
|
311
326
|
pluginDirs,
|
|
312
327
|
tools,
|
|
313
328
|
worktreeSession,
|
package/src/print-cli.ts
CHANGED
|
@@ -38,6 +38,7 @@ export async function startPrintCli(options: PrintCliOptions): Promise<void> {
|
|
|
38
38
|
message,
|
|
39
39
|
showStats = false,
|
|
40
40
|
bypassPermissions,
|
|
41
|
+
permissionMode,
|
|
41
42
|
pluginDirs,
|
|
42
43
|
tools,
|
|
43
44
|
worktreeSession,
|
|
@@ -144,7 +145,8 @@ export async function startPrintCli(options: PrintCliOptions): Promise<void> {
|
|
|
144
145
|
callbacks,
|
|
145
146
|
restoreSessionId,
|
|
146
147
|
continueLastSession,
|
|
147
|
-
permissionMode:
|
|
148
|
+
permissionMode:
|
|
149
|
+
permissionMode || (bypassPermissions ? "bypassPermissions" : undefined),
|
|
148
150
|
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
149
151
|
tools,
|
|
150
152
|
workdir,
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { WorktreeSession } from "./utils/worktree.js";
|
|
2
|
+
import { PermissionMode } from "wave-agent-sdk";
|
|
2
3
|
|
|
3
4
|
export interface BaseAppProps {
|
|
4
5
|
bypassPermissions?: boolean;
|
|
6
|
+
permissionMode?: PermissionMode;
|
|
5
7
|
pluginDirs?: string[];
|
|
6
8
|
tools?: string[];
|
|
7
9
|
worktreeSession?: WorktreeSession;
|