wave-code 0.18.1 → 0.18.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.
@@ -1 +1 @@
1
- {"version":3,"file":"CommandSelector.d.ts","sourceRoot":"","sources":["../../src/components/CommandSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOnD,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoJ1D,CAAC"}
1
+ {"version":3,"file":"CommandSelector.d.ts","sourceRoot":"","sources":["../../src/components/CommandSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOnD,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoJ1D,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { useReducer, useEffect } from "react";
2
+ import { useReducer, useEffect, useMemo } from "react";
3
3
  import { Box, Text, useInput } from "ink";
4
4
  import { AVAILABLE_COMMANDS } from "../constants/commands.js";
5
5
  import { selectorReducer, } from "../reducers/selectorReducer.js";
@@ -14,11 +14,12 @@ export const CommandSelector = ({ searchQuery, onSelect, onInsert, onCancel, com
14
14
  useEffect(() => {
15
15
  dispatch({ type: "RESET_INDEX" });
16
16
  }, [searchQuery]);
17
- // Merge agent commands and local commands
18
- const allCommands = [...AVAILABLE_COMMANDS, ...commands];
19
- // Filter command list
20
- const filteredCommands = allCommands.filter((command) => !searchQuery ||
21
- command.id.toLowerCase().includes(searchQuery.toLowerCase()));
17
+ // Merge agent commands and local commands, memoized to stabilize useEffect dependencies
18
+ const filteredCommands = useMemo(() => {
19
+ const allCommands = [...AVAILABLE_COMMANDS, ...commands];
20
+ return allCommands.filter((command) => !searchQuery ||
21
+ command.id.toLowerCase().includes(searchQuery.toLowerCase()));
22
+ }, [searchQuery, commands]);
22
23
  // Handle decisions from reducer
23
24
  useEffect(() => {
24
25
  if (!pendingDecision)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave-code",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "CLI-based code assistant powered by AI, built with React and Ink",
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,7 +42,7 @@
42
42
  "semver": "^7.7.4",
43
43
  "yargs": "^17.7.2",
44
44
  "zod": "^3.23.8",
45
- "wave-agent-sdk": "0.18.1"
45
+ "wave-agent-sdk": "0.18.3"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/react": "^19.1.8",
@@ -1,4 +1,4 @@
1
- import React, { useReducer, useEffect } from "react";
1
+ import React, { useReducer, useEffect, useMemo } from "react";
2
2
  import { Box, Text, useInput } from "ink";
3
3
  import type { SlashCommand } from "wave-agent-sdk";
4
4
  import { AVAILABLE_COMMANDS } from "../constants/commands.js";
@@ -35,15 +35,15 @@ export const CommandSelector: React.FC<CommandSelectorProps> = ({
35
35
  dispatch({ type: "RESET_INDEX" });
36
36
  }, [searchQuery]);
37
37
 
38
- // Merge agent commands and local commands
39
- const allCommands = [...AVAILABLE_COMMANDS, ...commands];
40
-
41
- // Filter command list
42
- const filteredCommands = allCommands.filter(
43
- (command) =>
44
- !searchQuery ||
45
- command.id.toLowerCase().includes(searchQuery.toLowerCase()),
46
- );
38
+ // Merge agent commands and local commands, memoized to stabilize useEffect dependencies
39
+ const filteredCommands = useMemo(() => {
40
+ const allCommands = [...AVAILABLE_COMMANDS, ...commands];
41
+ return allCommands.filter(
42
+ (command) =>
43
+ !searchQuery ||
44
+ command.id.toLowerCase().includes(searchQuery.toLowerCase()),
45
+ );
46
+ }, [searchQuery, commands]);
47
47
 
48
48
  // Handle decisions from reducer
49
49
  useEffect(() => {