wave-code 1.0.10 → 1.1.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.
Files changed (242) hide show
  1. package/bin/wave-code.js +8 -2
  2. package/dist/bundle/wave.mjs +3207 -0
  3. package/package.json +24 -25
  4. package/src/commands/update.ts +2 -7
  5. package/src/components/App.tsx +3 -7
  6. package/src/components/BtwDisplay.tsx +10 -1
  7. package/src/components/ChatInterface.tsx +21 -52
  8. package/src/components/ConfirmationDetails.tsx +144 -37
  9. package/src/components/DiffDisplay.tsx +335 -301
  10. package/src/components/InputBox.tsx +3 -1
  11. package/src/components/LoadingIndicator.tsx +16 -2
  12. package/src/components/MessageBlockItem.tsx +2 -4
  13. package/src/components/MessageList.tsx +75 -14
  14. package/src/components/ReasoningDisplay.tsx +2 -4
  15. package/src/components/SessionSelector.tsx +82 -11
  16. package/src/components/StatusCommand.tsx +2 -9
  17. package/src/components/ToolDisplay.tsx +2 -4
  18. package/src/contexts/useChat.tsx +156 -335
  19. package/src/daemon/commands.ts +57 -27
  20. package/src/daemon/jsonRpcClient.ts +1 -1
  21. package/src/daemon/socketClient.ts +2 -2
  22. package/src/hooks/useInputManager.ts +1 -1
  23. package/src/index.ts +57 -10
  24. package/src/managers/inputReducer.ts +186 -104
  25. package/src/print-cli.ts +21 -17
  26. package/src/reducers/selectorReducer.ts +10 -0
  27. package/src/session-selector-cli.tsx +269 -28
  28. package/src/stdio/agentBridge.ts +22 -21
  29. package/src/stdio/daemonServer.ts +3 -1
  30. package/src/utils/clipboard.ts +21 -0
  31. package/src/utils/highlightUtils.ts +46 -1
  32. package/src/utils/readPackageJson.ts +29 -0
  33. package/src/utils/streamingText.ts +11 -0
  34. package/src/utils/worktree.ts +191 -43
  35. package/dist/cli.d.ts +0 -6
  36. package/dist/cli.js +0 -53
  37. package/dist/commands/plugin/disable.d.ts +0 -5
  38. package/dist/commands/plugin/disable.js +0 -15
  39. package/dist/commands/plugin/enable.d.ts +0 -5
  40. package/dist/commands/plugin/enable.js +0 -15
  41. package/dist/commands/plugin/install.d.ts +0 -5
  42. package/dist/commands/plugin/install.js +0 -21
  43. package/dist/commands/plugin/list.d.ts +0 -1
  44. package/dist/commands/plugin/list.js +0 -31
  45. package/dist/commands/plugin/marketplace.d.ts +0 -10
  46. package/dist/commands/plugin/marketplace.js +0 -90
  47. package/dist/commands/plugin/uninstall.d.ts +0 -3
  48. package/dist/commands/plugin/uninstall.js +0 -16
  49. package/dist/commands/plugin/update.d.ts +0 -3
  50. package/dist/commands/plugin/update.js +0 -15
  51. package/dist/commands/update.d.ts +0 -1
  52. package/dist/commands/update.js +0 -97
  53. package/dist/components/AgentsManager.d.ts +0 -7
  54. package/dist/components/AgentsManager.js +0 -109
  55. package/dist/components/App.d.ts +0 -9
  56. package/dist/components/App.js +0 -76
  57. package/dist/components/BackgroundTaskManager.d.ts +0 -5
  58. package/dist/components/BackgroundTaskManager.js +0 -99
  59. package/dist/components/BangDisplay.d.ts +0 -8
  60. package/dist/components/BangDisplay.js +0 -17
  61. package/dist/components/BtwDisplay.d.ts +0 -7
  62. package/dist/components/BtwDisplay.js +0 -19
  63. package/dist/components/ChatInterface.d.ts +0 -2
  64. package/dist/components/ChatInterface.js +0 -61
  65. package/dist/components/CommandSelector.d.ts +0 -10
  66. package/dist/components/CommandSelector.js +0 -66
  67. package/dist/components/CompactDisplay.d.ts +0 -8
  68. package/dist/components/CompactDisplay.js +0 -13
  69. package/dist/components/ConfirmationDetails.d.ts +0 -9
  70. package/dist/components/ConfirmationDetails.js +0 -45
  71. package/dist/components/ConfirmationSelector.d.ts +0 -13
  72. package/dist/components/ConfirmationSelector.js +0 -127
  73. package/dist/components/DiffDisplay.d.ts +0 -8
  74. package/dist/components/DiffDisplay.js +0 -201
  75. package/dist/components/DiscoverView.d.ts +0 -2
  76. package/dist/components/DiscoverView.js +0 -37
  77. package/dist/components/FileSelector.d.ts +0 -11
  78. package/dist/components/FileSelector.js +0 -50
  79. package/dist/components/HelpView.d.ts +0 -7
  80. package/dist/components/HelpView.js +0 -74
  81. package/dist/components/HistorySearch.d.ts +0 -8
  82. package/dist/components/HistorySearch.js +0 -66
  83. package/dist/components/InputBox.d.ts +0 -24
  84. package/dist/components/InputBox.js +0 -149
  85. package/dist/components/InstalledView.d.ts +0 -2
  86. package/dist/components/InstalledView.js +0 -45
  87. package/dist/components/LoadingIndicator.d.ts +0 -10
  88. package/dist/components/LoadingIndicator.js +0 -6
  89. package/dist/components/LoginCommand.d.ts +0 -5
  90. package/dist/components/LoginCommand.js +0 -153
  91. package/dist/components/Markdown.d.ts +0 -5
  92. package/dist/components/Markdown.js +0 -127
  93. package/dist/components/MarketplaceAddForm.d.ts +0 -2
  94. package/dist/components/MarketplaceAddForm.js +0 -55
  95. package/dist/components/MarketplaceDetail.d.ts +0 -2
  96. package/dist/components/MarketplaceDetail.js +0 -74
  97. package/dist/components/MarketplaceList.d.ts +0 -8
  98. package/dist/components/MarketplaceList.js +0 -17
  99. package/dist/components/MarketplaceView.d.ts +0 -2
  100. package/dist/components/MarketplaceView.js +0 -41
  101. package/dist/components/McpManager.d.ts +0 -9
  102. package/dist/components/McpManager.js +0 -88
  103. package/dist/components/MessageBlockItem.d.ts +0 -8
  104. package/dist/components/MessageBlockItem.js +0 -15
  105. package/dist/components/MessageList.d.ts +0 -10
  106. package/dist/components/MessageList.js +0 -80
  107. package/dist/components/ModelSelector.d.ts +0 -8
  108. package/dist/components/ModelSelector.js +0 -45
  109. package/dist/components/Notifications.d.ts +0 -7
  110. package/dist/components/Notifications.js +0 -9
  111. package/dist/components/PlanDisplay.d.ts +0 -7
  112. package/dist/components/PlanDisplay.js +0 -6
  113. package/dist/components/PluginDetail.d.ts +0 -2
  114. package/dist/components/PluginDetail.js +0 -87
  115. package/dist/components/PluginList.d.ts +0 -13
  116. package/dist/components/PluginList.js +0 -15
  117. package/dist/components/PluginManagerShell.d.ts +0 -6
  118. package/dist/components/PluginManagerShell.js +0 -92
  119. package/dist/components/PluginManagerTypes.d.ts +0 -35
  120. package/dist/components/PluginManagerTypes.js +0 -1
  121. package/dist/components/QueuedMessageList.d.ts +0 -2
  122. package/dist/components/QueuedMessageList.js +0 -18
  123. package/dist/components/ReasoningDisplay.d.ts +0 -8
  124. package/dist/components/ReasoningDisplay.js +0 -13
  125. package/dist/components/RewindCommand.d.ts +0 -12
  126. package/dist/components/RewindCommand.js +0 -78
  127. package/dist/components/SessionSelector.d.ts +0 -12
  128. package/dist/components/SessionSelector.js +0 -47
  129. package/dist/components/StatusCommand.d.ts +0 -5
  130. package/dist/components/StatusCommand.js +0 -28
  131. package/dist/components/StatusLine.d.ts +0 -6
  132. package/dist/components/StatusLine.js +0 -9
  133. package/dist/components/TaskList.d.ts +0 -5
  134. package/dist/components/TaskList.js +0 -197
  135. package/dist/components/TaskNotificationMessage.d.ts +0 -5
  136. package/dist/components/TaskNotificationMessage.js +0 -12
  137. package/dist/components/ToolDisplay.d.ts +0 -9
  138. package/dist/components/ToolDisplay.js +0 -55
  139. package/dist/components/WorkflowManager.d.ts +0 -5
  140. package/dist/components/WorkflowManager.js +0 -102
  141. package/dist/components/WorktreeExitPrompt.d.ts +0 -12
  142. package/dist/components/WorktreeExitPrompt.js +0 -35
  143. package/dist/constants/commands.d.ts +0 -2
  144. package/dist/constants/commands.js +0 -92
  145. package/dist/contexts/PluginManagerContext.d.ts +0 -3
  146. package/dist/contexts/PluginManagerContext.js +0 -9
  147. package/dist/contexts/useAppConfig.d.ts +0 -10
  148. package/dist/contexts/useAppConfig.js +0 -13
  149. package/dist/contexts/useChat.d.ts +0 -101
  150. package/dist/contexts/useChat.js +0 -993
  151. package/dist/contracts/status.d.ts +0 -7
  152. package/dist/contracts/status.js +0 -1
  153. package/dist/daemon/commands.d.ts +0 -49
  154. package/dist/daemon/commands.js +0 -341
  155. package/dist/daemon/jsonRpcClient.d.ts +0 -38
  156. package/dist/daemon/jsonRpcClient.js +0 -129
  157. package/dist/daemon/socketClient.d.ts +0 -13
  158. package/dist/daemon/socketClient.js +0 -26
  159. package/dist/daemon-cli.d.ts +0 -10
  160. package/dist/daemon-cli.js +0 -15
  161. package/dist/hooks/useInputManager.d.ts +0 -75
  162. package/dist/hooks/useInputManager.js +0 -583
  163. package/dist/hooks/usePluginManager.d.ts +0 -4
  164. package/dist/hooks/usePluginManager.js +0 -265
  165. package/dist/hooks/useTasks.d.ts +0 -1
  166. package/dist/hooks/useTasks.js +0 -5
  167. package/dist/index.d.ts +0 -4
  168. package/dist/index.js +0 -447
  169. package/dist/managers/inputHandlers.d.ts +0 -30
  170. package/dist/managers/inputHandlers.js +0 -625
  171. package/dist/managers/inputReducer.d.ts +0 -271
  172. package/dist/managers/inputReducer.js +0 -1121
  173. package/dist/plugin-manager-cli.d.ts +0 -5
  174. package/dist/plugin-manager-cli.js +0 -12
  175. package/dist/print-cli.d.ts +0 -10
  176. package/dist/print-cli.js +0 -209
  177. package/dist/reducers/agentsManagerReducer.d.ts +0 -26
  178. package/dist/reducers/agentsManagerReducer.js +0 -54
  179. package/dist/reducers/backgroundTaskManagerReducer.d.ts +0 -62
  180. package/dist/reducers/backgroundTaskManagerReducer.js +0 -106
  181. package/dist/reducers/confirmationReducer.d.ts +0 -37
  182. package/dist/reducers/confirmationReducer.js +0 -193
  183. package/dist/reducers/helpSelectorReducer.d.ts +0 -25
  184. package/dist/reducers/helpSelectorReducer.js +0 -52
  185. package/dist/reducers/marketplaceAddFormReducer.d.ts +0 -24
  186. package/dist/reducers/marketplaceAddFormReducer.js +0 -58
  187. package/dist/reducers/mcpManagerReducer.d.ts +0 -37
  188. package/dist/reducers/mcpManagerReducer.js +0 -74
  189. package/dist/reducers/pluginDetailReducer.d.ts +0 -32
  190. package/dist/reducers/pluginDetailReducer.js +0 -70
  191. package/dist/reducers/questionReducer.d.ts +0 -82
  192. package/dist/reducers/questionReducer.js +0 -375
  193. package/dist/reducers/rewindSelectorReducer.d.ts +0 -21
  194. package/dist/reducers/rewindSelectorReducer.js +0 -37
  195. package/dist/reducers/selectorReducer.d.ts +0 -23
  196. package/dist/reducers/selectorReducer.js +0 -42
  197. package/dist/reducers/workflowManagerReducer.d.ts +0 -40
  198. package/dist/reducers/workflowManagerReducer.js +0 -100
  199. package/dist/session-selector-cli.d.ts +0 -3
  200. package/dist/session-selector-cli.js +0 -25
  201. package/dist/stdio/agentBridge.d.ts +0 -139
  202. package/dist/stdio/agentBridge.js +0 -999
  203. package/dist/stdio/daemonServer.d.ts +0 -67
  204. package/dist/stdio/daemonServer.js +0 -191
  205. package/dist/stdio/index.d.ts +0 -5
  206. package/dist/stdio/index.js +0 -5
  207. package/dist/stdio/jsonRpcConnection.d.ts +0 -39
  208. package/dist/stdio/jsonRpcConnection.js +0 -135
  209. package/dist/stdio/protocol.d.ts +0 -41
  210. package/dist/stdio/protocol.js +0 -26
  211. package/dist/stdio/stdioServer.d.ts +0 -36
  212. package/dist/stdio/stdioServer.js +0 -51
  213. package/dist/stdio-cli.d.ts +0 -8
  214. package/dist/stdio-cli.js +0 -15
  215. package/dist/types.d.ts +0 -20
  216. package/dist/types.js +0 -1
  217. package/dist/utils/bracketedPaste.d.ts +0 -39
  218. package/dist/utils/bracketedPaste.js +0 -122
  219. package/dist/utils/clipboard.d.ts +0 -21
  220. package/dist/utils/clipboard.js +0 -347
  221. package/dist/utils/constants.d.ts +0 -16
  222. package/dist/utils/constants.js +0 -18
  223. package/dist/utils/highlightUtils.d.ts +0 -1
  224. package/dist/utils/highlightUtils.js +0 -93
  225. package/dist/utils/inputUtils.d.ts +0 -17
  226. package/dist/utils/inputUtils.js +0 -67
  227. package/dist/utils/logger.d.ts +0 -71
  228. package/dist/utils/logger.js +0 -259
  229. package/dist/utils/markdownTable.d.ts +0 -34
  230. package/dist/utils/markdownTable.js +0 -302
  231. package/dist/utils/rewindCheckpoints.d.ts +0 -8
  232. package/dist/utils/rewindCheckpoints.js +0 -17
  233. package/dist/utils/throttle.d.ts +0 -14
  234. package/dist/utils/throttle.js +0 -55
  235. package/dist/utils/toolParameterTransforms.d.ts +0 -18
  236. package/dist/utils/toolParameterTransforms.js +0 -73
  237. package/dist/utils/usageSummary.d.ts +0 -28
  238. package/dist/utils/usageSummary.js +0 -121
  239. package/dist/utils/version.d.ts +0 -1
  240. package/dist/utils/version.js +0 -4
  241. package/dist/utils/worktree.d.ts +0 -35
  242. package/dist/utils/worktree.js +0 -219
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import type { ToolBlock } from "wave-agent-sdk";
3
- interface ToolDisplayProps {
4
- block: ToolBlock;
5
- isExpanded?: boolean;
6
- }
7
- export declare const getToolStatusColor: (stage: ToolBlock["stage"], success?: boolean, error?: string | Error) => string;
8
- export declare const ToolDisplay: React.FC<ToolDisplayProps>;
9
- export {};
@@ -1,55 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { getLastLines } from "wave-agent-sdk";
4
- import { DiffDisplay } from "./DiffDisplay.js";
5
- // Status dot color for a tool block. In-flight stages (start/streaming/running)
6
- // never show red — the outcome isn't known until the tool reaches "end".
7
- // An explicit error overrides everything.
8
- export const getToolStatusColor = (stage, success, error) => {
9
- if (error)
10
- return "red";
11
- if (stage === "start" || stage === "streaming")
12
- return "gray";
13
- if (stage === "running")
14
- return "yellow";
15
- if (success)
16
- return "green";
17
- if (success === false)
18
- return "red";
19
- return "gray"; // Unknown state or no state information
20
- };
21
- export const ToolDisplay = ({ block, isExpanded = false, }) => {
22
- const { parameters, result, compactParams, stage, success, error, name } = block;
23
- // Directly use compactParams
24
- // (no change needed as we destructured it above)
25
- const getStatusColor = () => getToolStatusColor(stage, success, error);
26
- const hasImages = () => {
27
- return block.images && block.images.length > 0;
28
- };
29
- const getImageIndicator = () => {
30
- if (!hasImages())
31
- return "";
32
- const imageCount = block.images.length;
33
- return imageCount === 1 ? "#" : `#×${imageCount}`;
34
- };
35
- const toolName = name ? String(name) : "Tool";
36
- // Get shortResult, if not available show last 5 lines of result
37
- const getShortResult = () => {
38
- if (block.shortResult) {
39
- return block.shortResult;
40
- }
41
- // If no shortResult but has result, return last 5 lines
42
- if (block.result) {
43
- return getLastLines(block.result, 5);
44
- }
45
- return null;
46
- };
47
- const shortResult = getShortResult();
48
- return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsxs(Box, { flexShrink: 0, children: [_jsx(Text, { color: getStatusColor(), children: "\u25CF " }), _jsx(Text, { color: "white", children: toolName })] }), !isExpanded && compactParams && (_jsxs(Text, { color: "gray", children: [" ", compactParams] })), !isExpanded &&
49
- stage === "streaming" &&
50
- parameters &&
51
- !compactParams && (_jsx(Text, { color: "gray", wrap: "truncate-end", children: ` ${(() => {
52
- const flat = parameters.replace(/\n/g, "\\n");
53
- return flat.length > 30 ? `…${flat.slice(-30)}` : flat;
54
- })()}` })), 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: "gray", wrap: "truncate-end", 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)] }) })), !isExpanded && stage === "end" && success && (_jsx(DiffDisplay, { toolName: name, parameters: parameters, startLineNumber: block.startLineNumber }))] }));
55
- };
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- export interface WorkflowManagerProps {
3
- onCancel: () => void;
4
- }
5
- export declare const WorkflowManager: React.FC<WorkflowManagerProps>;
@@ -1,102 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import React, { useEffect, useReducer } from "react";
3
- import { Box, Text, useInput } from "ink";
4
- import { useChat } from "../contexts/useChat.js";
5
- import { workflowManagerReducer, } from "../reducers/workflowManagerReducer.js";
6
- const statusColor = (status) => {
7
- switch (status) {
8
- case "running":
9
- return "green";
10
- case "completed":
11
- return "blue";
12
- case "failed":
13
- case "aborted":
14
- return "red";
15
- case "paused":
16
- return "yellow";
17
- }
18
- };
19
- const formatDuration = (ms) => {
20
- if (ms < 1000)
21
- return `${ms}ms`;
22
- if (ms < 60000)
23
- return `${Math.round(ms / 1000)}s`;
24
- const minutes = Math.floor(ms / 60000);
25
- const seconds = Math.round((ms % 60000) / 1000);
26
- return `${minutes}m ${seconds}s`;
27
- };
28
- const formatTime = (timestamp) => {
29
- return new Date(timestamp).toLocaleTimeString();
30
- };
31
- const formatTokens = (tokens) => {
32
- if (tokens < 1000)
33
- return `${tokens}`;
34
- return `${(tokens / 1000).toFixed(1)}k`;
35
- };
36
- export const WorkflowManager = ({ onCancel, }) => {
37
- const { workflowRuns, stopWorkflowRun } = useChat();
38
- const MAX_VISIBLE_ITEMS = 3;
39
- const [state, dispatch] = useReducer(workflowManagerReducer, {
40
- runs: [],
41
- selectedIndex: 0,
42
- viewMode: "list",
43
- detailRunId: null,
44
- pendingEffect: null,
45
- });
46
- // Handle pending effects
47
- useEffect(() => {
48
- if (!state.pendingEffect)
49
- return;
50
- const effect = state.pendingEffect;
51
- dispatch({ type: "CLEAR_PENDING_EFFECT" });
52
- switch (effect.type) {
53
- case "CANCEL":
54
- onCancel();
55
- break;
56
- case "STOP_RUN":
57
- stopWorkflowRun(effect.runId);
58
- break;
59
- }
60
- }, [state.pendingEffect, onCancel, stopWorkflowRun]);
61
- const { runs, selectedIndex, viewMode, detailRunId } = state;
62
- // Sync workflowRuns from context
63
- useEffect(() => {
64
- dispatch({ type: "SET_RUNS", runs: workflowRuns });
65
- }, [workflowRuns]);
66
- useInput((input, key) => {
67
- dispatch({ type: "HANDLE_KEY", input, key });
68
- });
69
- // Detail view
70
- if (viewMode === "detail" && detailRunId) {
71
- const run = runs.find((r) => r.runId === detailRunId);
72
- if (!run) {
73
- dispatch({ type: "RESET_DETAIL" });
74
- return null;
75
- }
76
- const elapsed = run.endTime
77
- ? run.endTime - run.startTime
78
- : Date.now() - run.startTime;
79
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", borderBottom: false, borderLeft: false, borderRight: false, paddingTop: 1, gap: 1, children: [_jsx(Box, { children: _jsxs(Text, { color: "cyan", bold: true, children: ["Workflow Details: ", run.meta.name] }) }), _jsxs(Box, { flexDirection: "column", gap: 0, children: [_jsx(Box, { children: _jsxs(Text, { children: [_jsx(Text, { color: "blue", children: "Run ID:" }), " ", run.runId] }) }), run.meta.description && (_jsx(Box, { children: _jsxs(Text, { children: [_jsx(Text, { color: "blue", children: "Description:" }), " ", run.meta.description] }) })), _jsx(Box, { children: _jsxs(Text, { children: [_jsx(Text, { color: "blue", children: "Status:" }), " ", _jsx(Text, { color: statusColor(run.status), children: run.status })] }) }), _jsx(Box, { children: _jsxs(Text, { children: [_jsx(Text, { color: "blue", children: "Started:" }), " ", formatTime(run.startTime), run.endTime && (_jsxs(Text, { children: [" ", "| ", _jsx(Text, { color: "blue", children: "Ended:" }), " ", formatTime(run.endTime)] })), " | ", _jsx(Text, { color: "blue", children: "Duration:" }), " ", formatDuration(elapsed)] }) }), _jsx(Box, { children: _jsxs(Text, { children: [_jsx(Text, { color: "blue", children: "Agents:" }), " ", run.totalAgents, " ", " | ", _jsx(Text, { color: "blue", children: "Tokens:" }), " ", formatTokens(run.totalTokens)] }) }), _jsx(Box, { children: _jsxs(Text, { children: [_jsx(Text, { color: "blue", children: "Script:" }), " ", run.scriptPath] }) }), run.error && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: [_jsx(Text, { color: "blue", children: "Error:" }), " ", run.error] }) }))] }), run.phases.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: "cyan", bold: true, children: "Phases:" }), run.phases.map((phase, i) => (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { children: [_jsx(Text, { color: "blue", children: phase.title }), " — ", phase.agentCount, " agents | ", formatTokens(phase.tokens), " ", "tokens | ", formatDuration(phase.elapsed)] }) }, i)))] })), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: [run.status === "running" ? "k to stop · " : "", "Esc back"] }) })] }));
80
- }
81
- // Empty state
82
- if (runs.length === 0) {
83
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", borderBottom: false, borderLeft: false, borderRight: false, paddingTop: 1, children: [_jsx(Text, { color: "cyan", bold: true, children: "Workflows" }), _jsx(Text, { children: "No workflow runs found" }), _jsx(Text, { dimColor: true, children: "Press Escape to close" })] }));
84
- }
85
- // List view
86
- const startIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_ITEMS / 2), Math.max(0, runs.length - MAX_VISIBLE_ITEMS)));
87
- const visibleRuns = runs.slice(startIndex, startIndex + MAX_VISIBLE_ITEMS);
88
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", borderBottom: false, borderLeft: false, borderRight: false, paddingTop: 1, gap: 1, children: [_jsx(Box, { children: _jsx(Text, { color: "cyan", bold: true, children: "Workflows" }) }), _jsx(Text, { dimColor: true, children: "Select a run to view details" }), _jsx(Box, { flexDirection: "column", children: visibleRuns.map((run, index) => {
89
- const actualIndex = startIndex + index;
90
- const isSelected = actualIndex === selectedIndex;
91
- const elapsed = run.endTime
92
- ? run.endTime - run.startTime
93
- : Date.now() - run.startTime;
94
- const phaseText = run.phases.map((p) => p.title).join(" → ");
95
- return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: isSelected ? "black" : "white", backgroundColor: isSelected ? "cyan" : undefined, children: [isSelected ? "▶ " : " ", actualIndex + 1, ". ", run.runId.slice(0, 8), " ", run.meta.name, _jsxs(Text, { color: statusColor(run.status), children: [" (", run.status, ")"] })] }), _jsxs(Text, { color: isSelected ? "black" : "gray", backgroundColor: isSelected ? "cyan" : undefined, children: [" ", run.totalAgents, " agents \u00B7 ", formatTokens(run.totalTokens), " ", "tokens \u00B7 ", formatDuration(elapsed)] }), phaseText && (_jsxs(Text, { color: isSelected ? "black" : "gray", backgroundColor: isSelected ? "cyan" : undefined, children: [" ", run.phases.map((p, pi) => (_jsxs(React.Fragment, { children: [pi > 0 && " → ", _jsx(Text, { color: isSelected
96
- ? "black"
97
- : pi === run.phases.length - 1 &&
98
- run.status === "running"
99
- ? "green"
100
- : undefined, backgroundColor: isSelected ? "cyan" : undefined, children: p.title })] }, pi)))] })), isSelected && (_jsx(Box, { marginLeft: 4, flexDirection: "column", children: _jsxs(Text, { color: "gray", dimColor: true, children: [_jsx(Text, { color: "blue", children: "Script:" }), " ", run.scriptPath] }) }))] }, run.runId));
101
- }) }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["\u2191/\u2193 select \u00B7 Enter detail \u00B7", " ", runs[selectedIndex]?.status === "running" ? "k stop · " : "", "Esc close"] }) })] }));
102
- };
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- interface WorktreeExitPromptProps {
3
- name: string;
4
- path: string;
5
- hasUncommittedChanges: boolean;
6
- hasNewCommits: boolean;
7
- onKeep: () => void;
8
- onRemove: () => void;
9
- onCancel: () => void;
10
- }
11
- export declare const WorktreeExitPrompt: React.FC<WorktreeExitPromptProps>;
12
- export {};
@@ -1,35 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useReducer, useEffect } from "react";
3
- import { Box, Text, useInput } from "ink";
4
- import { selectorReducer, } from "../reducers/selectorReducer.js";
5
- export const WorktreeExitPrompt = ({ name, path: worktreePath, hasUncommittedChanges, hasNewCommits, onKeep, onRemove, onCancel, }) => {
6
- const [state, dispatch] = useReducer((selectorReducer), {
7
- selectedIndex: 0,
8
- pendingDecision: null,
9
- items: ["keep", "remove"],
10
- });
11
- const { selectedIndex, pendingDecision } = state;
12
- useInput((_input, key) => {
13
- dispatch({
14
- type: "HANDLE_KEY",
15
- key,
16
- hasInsert: false,
17
- });
18
- });
19
- useEffect(() => {
20
- if (pendingDecision === "select") {
21
- if (selectedIndex === 0) {
22
- onKeep();
23
- }
24
- else {
25
- onRemove();
26
- }
27
- dispatch({ type: "CLEAR_DECISION" });
28
- }
29
- else if (pendingDecision === "cancel") {
30
- onCancel();
31
- dispatch({ type: "CLEAR_DECISION" });
32
- }
33
- }, [pendingDecision, selectedIndex, onKeep, onRemove, onCancel]);
34
- return (_jsxs(Box, { flexDirection: "column", paddingX: 1, marginY: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, children: "Exiting worktree session" }) }), _jsx(Box, { marginBottom: 1, children: hasUncommittedChanges && hasNewCommits ? (_jsx(Text, { children: "You have uncommitted changes and new commits. These will be lost if you remove the worktree." })) : hasUncommittedChanges ? (_jsx(Text, { children: "You have uncommitted changes. These will be lost if you remove the worktree." })) : (_jsxs(Text, { children: ["You have new commits on worktree-", name, ". The branch will be deleted if you remove the worktree."] })) }), _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { children: _jsxs(Text, { color: selectedIndex === 0 ? "cyan" : undefined, children: [selectedIndex === 0 ? "❯ " : " ", "Keep worktree Stays at", " ", worktreePath] }) }), _jsx(Box, { children: _jsxs(Text, { color: selectedIndex === 1 ? "cyan" : undefined, children: [selectedIndex === 1 ? "❯ " : " ", "Remove worktree All changes and commits will be lost."] }) })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Enter to confirm \u00B7 Esc to cancel" }) })] }));
35
- };
@@ -1,2 +0,0 @@
1
- import type { SlashCommand } from "wave-agent-sdk";
2
- export declare const AVAILABLE_COMMANDS: SlashCommand[];
@@ -1,92 +0,0 @@
1
- export const AVAILABLE_COMMANDS = [
2
- {
3
- id: "tasks",
4
- name: "tasks",
5
- description: "View and manage background tasks (shells and subagents)",
6
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
7
- },
8
- {
9
- id: "mcp",
10
- name: "mcp",
11
- description: "View and manage MCP servers",
12
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
13
- },
14
- {
15
- id: "agents",
16
- name: "agents",
17
- description: "List available agents and active subagents",
18
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
19
- },
20
- {
21
- id: "rewind",
22
- name: "rewind",
23
- description: "Revert conversation and file changes to a previous checkpoint",
24
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
25
- },
26
- {
27
- id: "help",
28
- name: "help",
29
- description: "Show help and key bindings",
30
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
31
- },
32
- {
33
- id: "status",
34
- name: "status",
35
- description: "Show agent status and configuration",
36
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
37
- },
38
- {
39
- id: "plugin",
40
- name: "plugin",
41
- description: "View and manage plugins",
42
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
43
- },
44
- {
45
- id: "btw",
46
- name: "btw",
47
- description: "Ask a side question without tool use",
48
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
49
- },
50
- {
51
- id: "model",
52
- name: "model",
53
- description: "Switch between configured AI models",
54
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
55
- },
56
- {
57
- id: "login",
58
- name: "login",
59
- description: "Authenticate via SSO",
60
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
61
- },
62
- {
63
- id: "logout",
64
- name: "logout",
65
- description: "Clear SSO authentication",
66
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
67
- },
68
- {
69
- id: "workflows",
70
- name: "workflows",
71
- description: "View and manage workflow runs",
72
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
73
- },
74
- {
75
- id: "clear",
76
- name: "clear",
77
- description: "Clear conversation history and reset session",
78
- handler: () => { },
79
- },
80
- {
81
- id: "compact",
82
- name: "compact",
83
- description: "Compact conversation history to reduce context usage",
84
- handler: () => { },
85
- },
86
- {
87
- id: "add-dir",
88
- name: "add-dir",
89
- description: "Add a directory to the session Safe Zone",
90
- handler: () => { }, // Handler here won't be used, actual processing is in the hook
91
- },
92
- ];
@@ -1,3 +0,0 @@
1
- import { PluginManagerContextType } from "../components/PluginManagerTypes.js";
2
- export declare const PluginManagerContext: import("react").Context<PluginManagerContextType | null>;
3
- export declare const usePluginManagerContext: () => PluginManagerContextType;
@@ -1,9 +0,0 @@
1
- import { createContext, useContext } from "react";
2
- export const PluginManagerContext = createContext(null);
3
- export const usePluginManagerContext = () => {
4
- const context = useContext(PluginManagerContext);
5
- if (!context) {
6
- throw new Error("usePluginManagerContext must be used within a PluginManagerProvider");
7
- }
8
- return context;
9
- };
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- export interface AppConfig {
3
- restoreSessionId?: string;
4
- continueLastSession?: boolean;
5
- }
6
- export declare const useAppConfig: () => AppConfig;
7
- export interface AppProviderProps extends AppConfig {
8
- children: React.ReactNode;
9
- }
10
- export declare const AppProvider: React.FC<AppProviderProps>;
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { createContext, useContext } from "react";
3
- const AppContext = createContext(null);
4
- export const useAppConfig = () => {
5
- const context = useContext(AppContext);
6
- if (!context) {
7
- throw new Error("useAppConfig must be used within AppProvider");
8
- }
9
- return context;
10
- };
11
- export const AppProvider = ({ restoreSessionId, continueLastSession, children, }) => {
12
- return (_jsx(AppContext.Provider, { value: { restoreSessionId, continueLastSession }, children: children }));
13
- };
@@ -1,101 +0,0 @@
1
- import React from "react";
2
- import type { Message, McpServerStatus, BackgroundTask, Task, SlashCommand, SubagentConfiguration, PermissionDecision, PermissionMode, QueuedMessage, WorkflowRun, ToolBlockUpdateCallbackParams } from "wave-agent-sdk";
3
- import { BaseAppProps } from "../types.js";
4
- export interface ChatContextType {
5
- messages: Message[];
6
- isLoading: boolean;
7
- isCommandRunning: boolean;
8
- isCompacting: boolean;
9
- isExpanded: boolean;
10
- isTaskListVisible: boolean;
11
- setIsTaskListVisible: (visible: boolean) => void;
12
- isBtwActive: boolean;
13
- setIsBtwActive: (active: boolean) => void;
14
- queuedMessages: QueuedMessage[];
15
- sessionId: string;
16
- sendMessage: (content: string, images?: Array<{
17
- path: string;
18
- mimeType: string;
19
- }>, longTextMap?: Record<string, string>) => Promise<void>;
20
- askBtw: (question: string, abortSignal?: AbortSignal, onContent?: (content: string) => void) => Promise<string>;
21
- clearMessages: () => Promise<void>;
22
- compact: (instructions?: string) => Promise<void>;
23
- addDir: (args?: string) => Promise<void>;
24
- abortMessage: () => void;
25
- recallQueuedMessage: () => QueuedMessage | null;
26
- removeQueuedMessageById: (id: string) => boolean;
27
- latestTotalTokens: number;
28
- maxInputTokens: number;
29
- currentModel: string;
30
- configuredModels: string[];
31
- getConfiguredModels: () => string[];
32
- setModel: (model: string) => void;
33
- mcpServers: McpServerStatus[];
34
- connectMcpServer: (serverName: string) => Promise<boolean>;
35
- disconnectMcpServer: (serverName: string) => Promise<boolean>;
36
- backgroundTasks: BackgroundTask[];
37
- workflowRuns: WorkflowRun[];
38
- stopWorkflowRun: (runId: string) => void;
39
- tasks: Task[];
40
- getBackgroundTaskOutput: (taskId: string) => {
41
- stdout: string;
42
- stderr: string;
43
- status: string;
44
- outputPath?: string;
45
- } | null;
46
- stopBackgroundTask: (taskId: string) => boolean;
47
- slashCommands: SlashCommand[];
48
- hasSlashCommand: (commandId: string) => boolean;
49
- agentDefinitions: SubagentConfiguration[];
50
- permissionMode: PermissionMode;
51
- setPermissionMode: (mode: PermissionMode) => void;
52
- isConfirmationVisible: boolean;
53
- hasPendingConfirmations: boolean;
54
- confirmingTool?: {
55
- name: string;
56
- input?: Record<string, unknown>;
57
- suggestedPrefix?: string;
58
- hidePersistentOption?: boolean;
59
- planContent?: string;
60
- permissionMode?: PermissionMode;
61
- warning?: string;
62
- };
63
- showConfirmation: (toolName: string, toolInput?: Record<string, unknown>, suggestedPrefix?: string, hidePersistentOption?: boolean, planContent?: string, permissionMode?: PermissionMode, warning?: string) => Promise<PermissionDecision>;
64
- hideConfirmation: () => void;
65
- handleConfirmationDecision: (decision: PermissionDecision) => void;
66
- handleConfirmationCancel: () => void;
67
- backgroundCurrentTask: () => void;
68
- remountKey: number;
69
- forceRemount: () => void;
70
- handleRewindSelect: (index: number) => Promise<void>;
71
- getFullMessageThread: () => Promise<{
72
- messages: Message[];
73
- sessionIds: string[];
74
- }>;
75
- getGatewayConfig: () => import("wave-agent-sdk").GatewayConfig;
76
- getModelConfig: () => import("wave-agent-sdk").ModelConfig;
77
- workingDirectory: string;
78
- version?: string;
79
- workdir?: string;
80
- recreateAgent: () => void;
81
- triggerWorktreeRemoveHook: (worktreePath: string) => Promise<void>;
82
- }
83
- export declare const useChat: () => ChatContextType;
84
- export interface ChatProviderProps extends BaseAppProps {
85
- children: React.ReactNode;
86
- }
87
- /**
88
- * Per-tool window-concat throttle for pure-delta tool parameter streaming:
89
- * `parametersChunk` deltas are accumulated independently per tool block id
90
- * within the cooldown window, so interleaved multi-tool streams lose no delta
91
- * (a plain throttle's single last-args slot would drop every earlier tool's
92
- * deltas, leaving the first tool without streaming parameters). `start` /
93
- * `running` apply immediately (one-shot snapshots); `end` flushes pending
94
- * streaming deltas first, then applies the authoritative parameters/result.
95
- */
96
- export declare function createToolStreamingThrottle(fn: (params: ToolBlockUpdateCallbackParams) => void, wait: number): {
97
- (params: ToolBlockUpdateCallbackParams): void;
98
- cancel: () => void;
99
- flush: () => void;
100
- };
101
- export declare const ChatProvider: React.FC<ChatProviderProps>;