wave-code 0.19.5 → 0.19.7
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 +0 -1
- package/dist/cli.js +2 -2
- package/dist/commands/plugin/disable.d.ts +0 -1
- package/dist/commands/plugin/enable.d.ts +0 -1
- package/dist/commands/plugin/install.d.ts +0 -1
- package/dist/commands/plugin/list.d.ts +0 -1
- package/dist/commands/plugin/marketplace.d.ts +0 -1
- package/dist/commands/plugin/uninstall.d.ts +0 -1
- package/dist/commands/plugin/update.d.ts +0 -1
- package/dist/commands/update.d.ts +0 -1
- package/dist/components/App.d.ts +0 -1
- package/dist/components/App.js +5 -5
- package/dist/components/BackgroundTaskManager.d.ts +0 -1
- package/dist/components/BangDisplay.d.ts +0 -1
- package/dist/components/BtwDisplay.d.ts +0 -1
- package/dist/components/ChatInterface.d.ts +0 -1
- package/dist/components/CommandSelector.d.ts +0 -1
- package/dist/components/CompactDisplay.d.ts +0 -1
- package/dist/components/ConfirmationDetails.d.ts +0 -1
- package/dist/components/ConfirmationSelector.d.ts +0 -1
- package/dist/components/DiffDisplay.d.ts +0 -1
- package/dist/components/DiscoverView.d.ts +0 -1
- package/dist/components/FileSelector.d.ts +0 -1
- package/dist/components/HelpView.d.ts +0 -1
- package/dist/components/HistorySearch.d.ts +0 -1
- package/dist/components/InputBox.d.ts +0 -1
- package/dist/components/InstalledView.d.ts +0 -1
- package/dist/components/LoadingIndicator.d.ts +0 -1
- package/dist/components/LoginCommand.d.ts +0 -1
- package/dist/components/Markdown.d.ts +0 -1
- package/dist/components/MarketplaceAddForm.d.ts +0 -1
- package/dist/components/MarketplaceDetail.d.ts +0 -1
- package/dist/components/MarketplaceList.d.ts +0 -1
- package/dist/components/MarketplaceView.d.ts +0 -1
- package/dist/components/McpManager.d.ts +0 -1
- package/dist/components/MessageBlockItem.d.ts +0 -1
- package/dist/components/MessageList.d.ts +0 -1
- package/dist/components/ModelSelector.d.ts +0 -1
- package/dist/components/PlanDisplay.d.ts +0 -1
- package/dist/components/PluginDetail.d.ts +0 -1
- package/dist/components/PluginList.d.ts +0 -1
- package/dist/components/PluginManagerShell.d.ts +0 -1
- package/dist/components/PluginManagerTypes.d.ts +0 -1
- package/dist/components/QueuedMessageList.d.ts +0 -1
- package/dist/components/ReasoningDisplay.d.ts +0 -1
- package/dist/components/RewindCommand.d.ts +0 -1
- package/dist/components/SessionSelector.d.ts +0 -1
- package/dist/components/StatusCommand.d.ts +0 -1
- package/dist/components/StatusLine.d.ts +0 -1
- package/dist/components/TaskList.d.ts +0 -1
- package/dist/components/TaskNotificationMessage.d.ts +0 -1
- package/dist/components/ToolDisplay.d.ts +0 -1
- package/dist/components/WorkflowManager.d.ts +0 -1
- package/dist/components/WorktreeExitPrompt.d.ts +0 -1
- package/dist/constants/commands.d.ts +0 -1
- package/dist/contexts/PluginManagerContext.d.ts +0 -1
- package/dist/contexts/useAppConfig.d.ts +0 -1
- package/dist/contexts/useChat.d.ts +0 -1
- package/dist/contexts/useChat.js +16 -1
- package/dist/contracts/status.d.ts +0 -1
- package/dist/hooks/useInputManager.d.ts +0 -1
- package/dist/hooks/usePluginManager.d.ts +0 -1
- package/dist/hooks/useTasks.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +7 -10
- package/dist/managers/inputHandlers.d.ts +0 -1
- package/dist/managers/inputReducer.d.ts +0 -1
- package/dist/plugin-manager-cli.d.ts +0 -1
- package/dist/print-cli.d.ts +0 -1
- package/dist/print-cli.js +15 -1
- package/dist/reducers/backgroundTaskManagerReducer.d.ts +0 -1
- package/dist/reducers/confirmationReducer.d.ts +0 -1
- package/dist/reducers/helpSelectorReducer.d.ts +0 -1
- package/dist/reducers/marketplaceAddFormReducer.d.ts +0 -1
- package/dist/reducers/mcpManagerReducer.d.ts +0 -1
- package/dist/reducers/pluginDetailReducer.d.ts +0 -1
- package/dist/reducers/questionReducer.d.ts +0 -1
- package/dist/reducers/rewindSelectorReducer.d.ts +0 -1
- package/dist/reducers/selectorReducer.d.ts +0 -1
- package/dist/reducers/workflowManagerReducer.d.ts +0 -1
- package/dist/session-selector-cli.d.ts +0 -1
- package/dist/stdio/agentBridge.d.ts +2 -1
- package/dist/stdio/agentBridge.js +25 -27
- package/dist/stdio/index.d.ts +0 -1
- package/dist/stdio/protocol.d.ts +2 -3
- package/dist/stdio/stdioServer.d.ts +0 -1
- package/dist/stdio-cli.d.ts +0 -1
- package/dist/types.d.ts +2 -1
- package/dist/utils/clipboard.d.ts +0 -1
- package/dist/utils/constants.d.ts +0 -1
- package/dist/utils/highlightUtils.d.ts +0 -1
- package/dist/utils/inputUtils.d.ts +0 -1
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/throttle.d.ts +0 -1
- package/dist/utils/toolParameterTransforms.d.ts +0 -1
- package/dist/utils/usageSummary.d.ts +0 -1
- package/dist/utils/version.d.ts +0 -1
- package/dist/utils/worktree.d.ts +0 -1
- package/package.json +2 -2
- package/src/cli.tsx +2 -0
- package/src/components/App.tsx +5 -0
- package/src/contexts/useChat.tsx +18 -0
- package/src/index.ts +7 -15
- package/src/print-cli.ts +17 -0
- package/src/stdio/agentBridge.ts +41 -38
- package/src/stdio/protocol.ts +5 -1
- package/src/types.ts +2 -0
- package/dist/cli.d.ts.map +0 -1
- package/dist/commands/plugin/disable.d.ts.map +0 -1
- package/dist/commands/plugin/enable.d.ts.map +0 -1
- package/dist/commands/plugin/install.d.ts.map +0 -1
- package/dist/commands/plugin/list.d.ts.map +0 -1
- package/dist/commands/plugin/marketplace.d.ts.map +0 -1
- package/dist/commands/plugin/uninstall.d.ts.map +0 -1
- package/dist/commands/plugin/update.d.ts.map +0 -1
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/components/App.d.ts.map +0 -1
- package/dist/components/BackgroundTaskManager.d.ts.map +0 -1
- package/dist/components/BangDisplay.d.ts.map +0 -1
- package/dist/components/BtwDisplay.d.ts.map +0 -1
- package/dist/components/ChatInterface.d.ts.map +0 -1
- package/dist/components/CommandSelector.d.ts.map +0 -1
- package/dist/components/CompactDisplay.d.ts.map +0 -1
- package/dist/components/ConfirmationDetails.d.ts.map +0 -1
- package/dist/components/ConfirmationSelector.d.ts.map +0 -1
- package/dist/components/DiffDisplay.d.ts.map +0 -1
- package/dist/components/DiscoverView.d.ts.map +0 -1
- package/dist/components/FileSelector.d.ts.map +0 -1
- package/dist/components/HelpView.d.ts.map +0 -1
- package/dist/components/HistorySearch.d.ts.map +0 -1
- package/dist/components/InputBox.d.ts.map +0 -1
- package/dist/components/InstalledView.d.ts.map +0 -1
- package/dist/components/LoadingIndicator.d.ts.map +0 -1
- package/dist/components/LoginCommand.d.ts.map +0 -1
- package/dist/components/Markdown.d.ts.map +0 -1
- package/dist/components/MarketplaceAddForm.d.ts.map +0 -1
- package/dist/components/MarketplaceDetail.d.ts.map +0 -1
- package/dist/components/MarketplaceList.d.ts.map +0 -1
- package/dist/components/MarketplaceView.d.ts.map +0 -1
- package/dist/components/McpManager.d.ts.map +0 -1
- package/dist/components/MessageBlockItem.d.ts.map +0 -1
- package/dist/components/MessageList.d.ts.map +0 -1
- package/dist/components/ModelSelector.d.ts.map +0 -1
- package/dist/components/PlanDisplay.d.ts.map +0 -1
- package/dist/components/PluginDetail.d.ts.map +0 -1
- package/dist/components/PluginList.d.ts.map +0 -1
- package/dist/components/PluginManagerShell.d.ts.map +0 -1
- package/dist/components/PluginManagerTypes.d.ts.map +0 -1
- package/dist/components/QueuedMessageList.d.ts.map +0 -1
- package/dist/components/ReasoningDisplay.d.ts.map +0 -1
- package/dist/components/RewindCommand.d.ts.map +0 -1
- package/dist/components/SessionSelector.d.ts.map +0 -1
- package/dist/components/StatusCommand.d.ts.map +0 -1
- package/dist/components/StatusLine.d.ts.map +0 -1
- package/dist/components/TaskList.d.ts.map +0 -1
- package/dist/components/TaskNotificationMessage.d.ts.map +0 -1
- package/dist/components/ToolDisplay.d.ts.map +0 -1
- package/dist/components/WorkflowManager.d.ts.map +0 -1
- package/dist/components/WorktreeExitPrompt.d.ts.map +0 -1
- package/dist/constants/commands.d.ts.map +0 -1
- package/dist/contexts/PluginManagerContext.d.ts.map +0 -1
- package/dist/contexts/useAppConfig.d.ts.map +0 -1
- package/dist/contexts/useChat.d.ts.map +0 -1
- package/dist/contracts/status.d.ts.map +0 -1
- package/dist/hooks/useInputManager.d.ts.map +0 -1
- package/dist/hooks/usePluginManager.d.ts.map +0 -1
- package/dist/hooks/useTasks.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/managers/inputHandlers.d.ts.map +0 -1
- package/dist/managers/inputReducer.d.ts.map +0 -1
- package/dist/plugin-manager-cli.d.ts.map +0 -1
- package/dist/print-cli.d.ts.map +0 -1
- package/dist/reducers/backgroundTaskManagerReducer.d.ts.map +0 -1
- package/dist/reducers/confirmationReducer.d.ts.map +0 -1
- package/dist/reducers/helpSelectorReducer.d.ts.map +0 -1
- package/dist/reducers/marketplaceAddFormReducer.d.ts.map +0 -1
- package/dist/reducers/mcpManagerReducer.d.ts.map +0 -1
- package/dist/reducers/pluginDetailReducer.d.ts.map +0 -1
- package/dist/reducers/questionReducer.d.ts.map +0 -1
- package/dist/reducers/rewindSelectorReducer.d.ts.map +0 -1
- package/dist/reducers/selectorReducer.d.ts.map +0 -1
- package/dist/reducers/workflowManagerReducer.d.ts.map +0 -1
- package/dist/session-selector-cli.d.ts.map +0 -1
- package/dist/stdio/agentBridge.d.ts.map +0 -1
- package/dist/stdio/index.d.ts.map +0 -1
- package/dist/stdio/protocol.d.ts.map +0 -1
- package/dist/stdio/stdioServer.d.ts.map +0 -1
- package/dist/stdio-cli.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/clipboard.d.ts.map +0 -1
- package/dist/utils/constants.d.ts.map +0 -1
- package/dist/utils/highlightUtils.d.ts.map +0 -1
- package/dist/utils/inputUtils.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/throttle.d.ts.map +0 -1
- package/dist/utils/toolParameterTransforms.d.ts.map +0 -1
- package/dist/utils/usageSummary.d.ts.map +0 -1
- package/dist/utils/version.d.ts.map +0 -1
- package/dist/utils/worktree.d.ts.map +0 -1
package/dist/cli.d.ts
CHANGED
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, permissionMode, pluginDirs, tools, allowedTools, disallowedTools, worktreeSession, workdir, version, model, mcpServers, } = options;
|
|
7
|
+
const { restoreSessionId, continueLastSession, bypassPermissions, permissionMode, pluginDirs, tools, allowedTools, disallowedTools, worktreeSession, workdir, originalCwd, version, model, mcpServers, } = 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, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, allowedTools: allowedTools, disallowedTools: disallowedTools, worktreeSession: worktreeSession, workdir: workdir, version: version, model: model, mcpServers: mcpServers, onExit: handleExit }), { exitOnCtrlC: false });
|
|
15
|
+
const { unmount, waitUntilExit } = render(_jsx(App, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, bypassPermissions: bypassPermissions, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, allowedTools: allowedTools, disallowedTools: disallowedTools, worktreeSession: worktreeSession, workdir: workdir, originalCwd: originalCwd, version: version, model: model, mcpServers: mcpServers, onExit: handleExit }), { exitOnCtrlC: false });
|
|
16
16
|
// Wait for the app to finish unmounting
|
|
17
17
|
await waitUntilExit();
|
|
18
18
|
try {
|
package/dist/components/App.d.ts
CHANGED
package/dist/components/App.js
CHANGED
|
@@ -50,7 +50,7 @@ const ChatWithExitPrompt = ({ worktreeSession, onExit }) => {
|
|
|
50
50
|
}
|
|
51
51
|
return _jsx(ChatInterface, {});
|
|
52
52
|
};
|
|
53
|
-
const AppWithProviders = ({ bypassPermissions, permissionMode, pluginDirs, tools, allowedTools, disallowedTools, worktreeSession, workdir, version, model, mcpServers, onExit, }) => {
|
|
53
|
+
const AppWithProviders = ({ bypassPermissions, permissionMode, pluginDirs, tools, allowedTools, disallowedTools, worktreeSession, workdir, originalCwd, version, model, mcpServers, onExit, }) => {
|
|
54
54
|
// Handle Ctrl-C for non-worktree sessions (immediate exit)
|
|
55
55
|
// Ink runs terminal in raw mode, so Ctrl+C arrives as useInput event, not SIGINT
|
|
56
56
|
useInput((input, key) => {
|
|
@@ -60,10 +60,10 @@ const AppWithProviders = ({ bypassPermissions, permissionMode, pluginDirs, tools
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
if (worktreeSession) {
|
|
63
|
-
return (_jsx(ChatProvider, { bypassPermissions: bypassPermissions, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, allowedTools: allowedTools, disallowedTools: disallowedTools, workdir: workdir, worktreeSession: worktreeSession, version: version, model: model, mcpServers: mcpServers, children: _jsx(ChatWithExitPrompt, { worktreeSession: worktreeSession, onExit: onExit }) }));
|
|
63
|
+
return (_jsx(ChatProvider, { bypassPermissions: bypassPermissions, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, allowedTools: allowedTools, disallowedTools: disallowedTools, workdir: workdir, worktreeSession: worktreeSession, originalCwd: originalCwd, version: version, model: model, mcpServers: mcpServers, children: _jsx(ChatWithExitPrompt, { worktreeSession: worktreeSession, onExit: onExit }) }));
|
|
64
64
|
}
|
|
65
|
-
return (_jsx(ChatProvider, { bypassPermissions: bypassPermissions, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, allowedTools: allowedTools, disallowedTools: disallowedTools, workdir: workdir, worktreeSession: worktreeSession, version: version, model: model, mcpServers: mcpServers, children: _jsx(ChatInterface, {}) }));
|
|
65
|
+
return (_jsx(ChatProvider, { bypassPermissions: bypassPermissions, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, allowedTools: allowedTools, disallowedTools: disallowedTools, workdir: workdir, worktreeSession: worktreeSession, originalCwd: originalCwd, version: version, model: model, mcpServers: mcpServers, children: _jsx(ChatInterface, {}) }));
|
|
66
66
|
};
|
|
67
|
-
export const App = ({ restoreSessionId, continueLastSession, bypassPermissions, permissionMode, pluginDirs, tools, allowedTools, disallowedTools, worktreeSession, workdir, version, model, mcpServers, onExit, }) => {
|
|
68
|
-
return (_jsx(AppProvider, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, children: _jsx(AppWithProviders, { bypassPermissions: bypassPermissions, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, allowedTools: allowedTools, disallowedTools: disallowedTools, worktreeSession: worktreeSession, workdir: workdir, version: version, model: model, mcpServers: mcpServers, onExit: onExit }) }));
|
|
67
|
+
export const App = ({ restoreSessionId, continueLastSession, bypassPermissions, permissionMode, pluginDirs, tools, allowedTools, disallowedTools, worktreeSession, workdir, originalCwd, version, model, mcpServers, onExit, }) => {
|
|
68
|
+
return (_jsx(AppProvider, { restoreSessionId: restoreSessionId, continueLastSession: continueLastSession, children: _jsx(AppWithProviders, { bypassPermissions: bypassPermissions, permissionMode: permissionMode, pluginDirs: pluginDirs, tools: tools, allowedTools: allowedTools, disallowedTools: disallowedTools, worktreeSession: worktreeSession, workdir: workdir, originalCwd: originalCwd, version: version, model: model, mcpServers: mcpServers, onExit: onExit }) }));
|
|
69
69
|
};
|
|
@@ -8,4 +8,3 @@ export interface MessageListProps {
|
|
|
8
8
|
workdir?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare const MessageList: React.MemoExoticComponent<({ messages, isExpanded, forceStatic, version, workdir, }: MessageListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
-
//# sourceMappingURL=MessageList.d.ts.map
|
|
@@ -3,4 +3,3 @@ import type { Task, TaskStatus } from "wave-agent-sdk";
|
|
|
3
3
|
export declare const getStatusIcon: (status: TaskStatus) => React.ReactNode;
|
|
4
4
|
export declare function sortTasksByPriority(tasks: Task[], completionTimestamps: Map<string, number>, now: number, needsTruncation: boolean): Task[];
|
|
5
5
|
export declare const TaskList: React.FC;
|
|
6
|
-
//# sourceMappingURL=TaskList.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { PluginManagerContextType } from "../components/PluginManagerTypes.js";
|
|
2
2
|
export declare const PluginManagerContext: import("react").Context<PluginManagerContextType | null>;
|
|
3
3
|
export declare const usePluginManagerContext: () => PluginManagerContextType;
|
|
4
|
-
//# sourceMappingURL=PluginManagerContext.d.ts.map
|
package/dist/contexts/useChat.js
CHANGED
|
@@ -15,7 +15,7 @@ export const useChat = () => {
|
|
|
15
15
|
}
|
|
16
16
|
return context;
|
|
17
17
|
};
|
|
18
|
-
export const ChatProvider = ({ children, bypassPermissions, permissionMode: initialPermissionMode, pluginDirs, tools, allowedTools, disallowedTools, workdir, worktreeSession, version, model, mcpServers, }) => {
|
|
18
|
+
export const ChatProvider = ({ children, bypassPermissions, permissionMode: initialPermissionMode, pluginDirs, tools, allowedTools, disallowedTools, workdir, worktreeSession, originalCwd, version, model, mcpServers, }) => {
|
|
19
19
|
const { restoreSessionId, continueLastSession } = useAppConfig();
|
|
20
20
|
const { stdout } = useStdout();
|
|
21
21
|
// Message Display State
|
|
@@ -233,6 +233,20 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
233
233
|
mcpServers,
|
|
234
234
|
});
|
|
235
235
|
agentRef.current = agent;
|
|
236
|
+
// Inject worktree session into this agent's own DI container so system
|
|
237
|
+
// prompts and permission checks reflect the CLI -w worktree. This state is
|
|
238
|
+
// per-session, not process-global (see specs/047-worktree.md FR-042).
|
|
239
|
+
if (worktreeSession) {
|
|
240
|
+
const session = {
|
|
241
|
+
originalCwd: originalCwd ?? worktreeSession.repoRoot,
|
|
242
|
+
worktreePath: worktreeSession.path,
|
|
243
|
+
worktreeBranch: worktreeSession.branch,
|
|
244
|
+
worktreeName: worktreeSession.name,
|
|
245
|
+
isNew: worktreeSession.isNew,
|
|
246
|
+
repoRoot: worktreeSession.repoRoot,
|
|
247
|
+
};
|
|
248
|
+
agent.setWorktreeSession(session);
|
|
249
|
+
}
|
|
236
250
|
// Get initial state
|
|
237
251
|
setSessionId(agent.sessionId);
|
|
238
252
|
setMessages(agent.messages);
|
|
@@ -266,6 +280,7 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
266
280
|
disallowedTools,
|
|
267
281
|
workdir,
|
|
268
282
|
worktreeSession,
|
|
283
|
+
originalCwd,
|
|
269
284
|
model,
|
|
270
285
|
initialPermissionMode,
|
|
271
286
|
throttledSetMessages,
|
package/dist/hooks/useTasks.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ export declare function main(): Promise<void>;
|
|
|
2
2
|
export { startCli } from "./cli.js";
|
|
3
3
|
export { logger } from "./utils/logger.js";
|
|
4
4
|
export { readClipboardImage, cleanupTempImage, hasClipboardImage, type ClipboardImageResult, } from "./utils/clipboard.js";
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
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 { generateRandomName
|
|
4
|
+
import { generateRandomName } from "wave-agent-sdk";
|
|
5
5
|
import { createWorktree } from "./utils/worktree.js";
|
|
6
6
|
import path from "path";
|
|
7
7
|
import { readFileSync } from "fs";
|
|
@@ -237,15 +237,9 @@ export async function main() {
|
|
|
237
237
|
name = generateRandomName();
|
|
238
238
|
}
|
|
239
239
|
worktreeSession = createWorktree(name, originalCwd);
|
|
240
|
-
//
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
worktreePath: worktreeSession.path,
|
|
244
|
-
worktreeBranch: worktreeSession.branch,
|
|
245
|
-
worktreeName: worktreeSession.name,
|
|
246
|
-
isNew: worktreeSession.isNew,
|
|
247
|
-
repoRoot: worktreeSession.repoRoot,
|
|
248
|
-
});
|
|
240
|
+
// Note: the full worktree session (originalCwd etc.) is injected into the
|
|
241
|
+
// agent's DI container after the agent is created in useChat.tsx. This keeps
|
|
242
|
+
// worktree state per-session instead of process-global.
|
|
249
243
|
}
|
|
250
244
|
const workdir = worktreeSession?.path || originalCwd;
|
|
251
245
|
if (worktreeSession) {
|
|
@@ -272,6 +266,7 @@ export async function main() {
|
|
|
272
266
|
disallowedTools,
|
|
273
267
|
worktreeSession,
|
|
274
268
|
workdir,
|
|
269
|
+
originalCwd,
|
|
275
270
|
version,
|
|
276
271
|
model: argv.model,
|
|
277
272
|
mcpServers,
|
|
@@ -293,6 +288,7 @@ export async function main() {
|
|
|
293
288
|
disallowedTools,
|
|
294
289
|
worktreeSession,
|
|
295
290
|
workdir,
|
|
291
|
+
originalCwd,
|
|
296
292
|
version,
|
|
297
293
|
model: argv.model,
|
|
298
294
|
mcpServers,
|
|
@@ -314,6 +310,7 @@ export async function main() {
|
|
|
314
310
|
disallowedTools,
|
|
315
311
|
worktreeSession,
|
|
316
312
|
workdir,
|
|
313
|
+
originalCwd,
|
|
317
314
|
version,
|
|
318
315
|
model: argv.model,
|
|
319
316
|
mcpServers,
|
|
@@ -28,4 +28,3 @@ export declare const checkForSlashDeletion: (state: InputState, dispatch: React.
|
|
|
28
28
|
export declare const handleSelectorInput: (state: InputState, dispatch: React.Dispatch<InputAction>, callbacks: Partial<InputManagerCallbacks>, input: string, key: Key) => boolean;
|
|
29
29
|
export declare const handleNormalInput: (state: InputState, dispatch: React.Dispatch<InputAction>, callbacks: Partial<InputManagerCallbacks>, input: string, key: Key, clearImages?: () => void) => Promise<boolean>;
|
|
30
30
|
export declare const handleInput: (state: InputState, dispatch: React.Dispatch<InputAction>, callbacks: Partial<InputManagerCallbacks>, input: string, key: Key, clearImages?: () => void) => Promise<boolean>;
|
|
31
|
-
//# sourceMappingURL=inputHandlers.d.ts.map
|
package/dist/print-cli.d.ts
CHANGED
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, permissionMode, pluginDirs, tools, allowedTools, disallowedTools, worktreeSession, workdir, model, mcpServers, } = options;
|
|
17
|
+
const { restoreSessionId, continueLastSession, message, showStats = false, bypassPermissions, permissionMode, pluginDirs, tools, allowedTools, disallowedTools, worktreeSession, workdir, originalCwd, model, mcpServers, } = options;
|
|
18
18
|
if ((typeof message !== "string" || message.trim() === "") &&
|
|
19
19
|
!continueLastSession &&
|
|
20
20
|
!restoreSessionId) {
|
|
@@ -81,10 +81,24 @@ export async function startPrintCli(options) {
|
|
|
81
81
|
allowedTools,
|
|
82
82
|
disallowedTools,
|
|
83
83
|
workdir,
|
|
84
|
+
worktreeName: worktreeSession?.name,
|
|
85
|
+
isNewWorktree: worktreeSession?.isNew,
|
|
84
86
|
model,
|
|
85
87
|
mcpServers,
|
|
86
88
|
// 保持流式模式以获得更好的命令行用户体验
|
|
87
89
|
});
|
|
90
|
+
// Inject worktree session into this agent's container (per-session, not global)
|
|
91
|
+
if (worktreeSession) {
|
|
92
|
+
const session = {
|
|
93
|
+
originalCwd: originalCwd ?? worktreeSession.repoRoot,
|
|
94
|
+
worktreePath: worktreeSession.path,
|
|
95
|
+
worktreeBranch: worktreeSession.branch,
|
|
96
|
+
worktreeName: worktreeSession.name,
|
|
97
|
+
isNew: worktreeSession.isNew,
|
|
98
|
+
repoRoot: worktreeSession.repoRoot,
|
|
99
|
+
};
|
|
100
|
+
agent.setWorktreeSession(session);
|
|
101
|
+
}
|
|
88
102
|
// Send message if provided and not empty
|
|
89
103
|
if (typeof message === "string" && message.trim() !== "") {
|
|
90
104
|
await agent.sendMessage(message);
|
|
@@ -60,4 +60,3 @@ export type BackgroundTaskManagerAction = {
|
|
|
60
60
|
type: "CLEAR_PENDING_EFFECT";
|
|
61
61
|
};
|
|
62
62
|
export declare function backgroundTaskManagerReducer(state: BackgroundTaskManagerState, action: BackgroundTaskManagerAction): BackgroundTaskManagerState;
|
|
63
|
-
//# sourceMappingURL=backgroundTaskManagerReducer.d.ts.map
|
|
@@ -22,4 +22,3 @@ export type MarketplaceAddFormAction = {
|
|
|
22
22
|
type: "CLEAR_PENDING_ACTION";
|
|
23
23
|
};
|
|
24
24
|
export declare function marketplaceAddFormReducer(state: MarketplaceAddFormState, action: MarketplaceAddFormAction): MarketplaceAddFormState;
|
|
25
|
-
//# sourceMappingURL=marketplaceAddFormReducer.d.ts.map
|