wave-code 0.14.2 → 0.14.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":"InstalledView.d.ts","sourceRoot":"","sources":["../../src/components/InstalledView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAwDjC,CAAC"}
1
+ {"version":3,"file":"InstalledView.d.ts","sourceRoot":"","sources":["../../src/components/InstalledView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAqEjC,CAAC"}
@@ -23,8 +23,11 @@ export const InstalledView = () => {
23
23
  if (installedPlugins.length === 0) {
24
24
  return (_jsx(Box, { padding: 1, children: _jsx(Text, { dimColor: true, children: "No plugins installed." }) }));
25
25
  }
26
- return (_jsx(Box, { flexDirection: "column", children: installedPlugins.map((plugin, index) => {
27
- const isSelected = index === selectedIndex;
26
+ const MAX_VISIBLE_ITEMS = 3;
27
+ const startIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_ITEMS / 2), Math.max(0, installedPlugins.length - MAX_VISIBLE_ITEMS)));
28
+ const visiblePlugins = installedPlugins.slice(startIndex, startIndex + MAX_VISIBLE_ITEMS);
29
+ return (_jsx(Box, { flexDirection: "column", children: visiblePlugins.map((plugin, index) => {
30
+ const isSelected = index + startIndex === selectedIndex;
28
31
  return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { children: _jsxs(Text, { color: isSelected ? "cyan" : undefined, children: [isSelected ? "> " : " ", _jsx(Text, { bold: true, children: plugin.name }), _jsxs(Text, { dimColor: true, children: [" @", plugin.marketplace] }), plugin.scope && _jsxs(Text, { color: "gray", children: [" (", plugin.scope, ")"] })] }) }), isSelected && (_jsx(Box, { marginLeft: 4, children: _jsx(Text, { dimColor: true, children: "Press Enter for actions" }) }))] }, `${plugin.name}@${plugin.marketplace}`));
29
32
  }) }));
30
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ModelSelector.d.ts","sourceRoot":"","sources":["../../src/components/ModelSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkGtD,CAAC"}
1
+ {"version":3,"file":"ModelSelector.d.ts","sourceRoot":"","sources":["../../src/components/ModelSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAID,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoHtD,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { Box, Text, useInput } from "ink";
4
+ const MAX_VISIBLE_ITEMS = 5;
4
5
  export const ModelSelector = ({ onCancel, currentModel, configuredModels, onSelectModel, }) => {
5
6
  const [selectedIndex, setSelectedIndex] = useState(() => {
6
7
  const index = configuredModels.indexOf(currentModel);
@@ -27,8 +28,14 @@ export const ModelSelector = ({ onCancel, currentModel, configuredModels, onSele
27
28
  return;
28
29
  }
29
30
  });
31
+ // Calculate visible window
32
+ const startIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_ITEMS / 2), Math.max(0, configuredModels.length - MAX_VISIBLE_ITEMS)));
33
+ const visibleModels = configuredModels.slice(startIndex, startIndex + MAX_VISIBLE_ITEMS);
30
34
  if (configuredModels.length === 0) {
31
35
  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: "Select AI Model" }), _jsx(Text, { children: "No models configured" }), _jsx(Text, { dimColor: true, children: "Press Escape to close" })] }));
32
36
  }
33
- 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: "Select AI Model" }) }), _jsx(Text, { dimColor: true, children: "Select a model to use for the current session" }), configuredModels.map((model, index) => (_jsx(Box, { children: _jsxs(Text, { color: index === selectedIndex ? "black" : "white", backgroundColor: index === selectedIndex ? "cyan" : undefined, children: [index === selectedIndex ? "▶ " : " ", model, model === currentModel ? (_jsx(Text, { color: "green", children: " (current)" })) : ("")] }) }, model))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "\u2191/\u2193 to select \u00B7 Enter to confirm \u00B7 Esc to cancel" }) })] }));
37
+ 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: "Select AI Model" }) }), _jsx(Text, { dimColor: true, children: "Select a model to use for the current session" }), visibleModels.map((model, index) => {
38
+ const actualIndex = startIndex + index;
39
+ return (_jsx(Box, { children: _jsxs(Text, { color: actualIndex === selectedIndex ? "black" : "white", backgroundColor: actualIndex === selectedIndex ? "cyan" : undefined, children: [actualIndex === selectedIndex ? "▶ " : " ", model, model === currentModel ? (_jsx(Text, { color: "green", children: " (current)" })) : ("")] }) }, model));
40
+ }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "\u2191/\u2193 to select \u00B7 Enter to confirm \u00B7 Esc to cancel" }) })] }));
34
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PluginList.d.ts","sourceRoot":"","sources":["../../src/components/PluginList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,UAAU,eAAe;IACvB,OAAO,EAAE,CAAC,sBAAsB,GAAG;QACjC,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,EAAE,CAAC;IACL,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoChD,CAAC"}
1
+ {"version":3,"file":"PluginList.d.ts","sourceRoot":"","sources":["../../src/components/PluginList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,UAAU,eAAe;IACvB,OAAO,EAAE,CAAC,sBAAsB,GAAG;QACjC,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,EAAE,CAAC;IACL,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAID,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgDhD,CAAC"}
@@ -1,11 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Text } from "ink";
3
+ const MAX_VISIBLE_ITEMS = 3;
3
4
  export const PluginList = ({ plugins, selectedIndex, }) => {
4
5
  if (plugins.length === 0) {
5
6
  return (_jsx(Box, { padding: 1, children: _jsx(Text, { dimColor: true, children: "No plugins found." }) }));
6
7
  }
7
- return (_jsx(Box, { flexDirection: "column", children: plugins.map((plugin, index) => {
8
- const isSelected = index === selectedIndex;
8
+ const startIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_ITEMS / 2), Math.max(0, plugins.length - MAX_VISIBLE_ITEMS)));
9
+ const visiblePlugins = plugins.slice(startIndex, startIndex + MAX_VISIBLE_ITEMS);
10
+ return (_jsx(Box, { flexDirection: "column", children: visiblePlugins.map((plugin, index) => {
11
+ const isSelected = index + startIndex === selectedIndex;
9
12
  const pluginId = `${plugin.name}@${plugin.marketplace}`;
10
13
  return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { children: _jsxs(Text, { color: isSelected ? "cyan" : undefined, children: [isSelected ? "> " : " ", _jsx(Text, { bold: true, children: plugin.name }), _jsxs(Text, { dimColor: true, children: [" @", plugin.marketplace] }), plugin.version && _jsxs(Text, { color: "blue", children: [" v", plugin.version] })] }) }), _jsx(Box, { marginLeft: 4, children: _jsx(Text, { dimColor: true, children: plugin.description }) })] }, pluginId));
11
14
  }) }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave-code",
3
- "version": "0.14.2",
3
+ "version": "0.14.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.14.2"
45
+ "wave-agent-sdk": "0.14.3"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/react": "^19.1.8",
@@ -30,10 +30,23 @@ export const InstalledView: React.FC = () => {
30
30
  );
31
31
  }
32
32
 
33
+ const MAX_VISIBLE_ITEMS = 3;
34
+ const startIndex = Math.max(
35
+ 0,
36
+ Math.min(
37
+ selectedIndex - Math.floor(MAX_VISIBLE_ITEMS / 2),
38
+ Math.max(0, installedPlugins.length - MAX_VISIBLE_ITEMS),
39
+ ),
40
+ );
41
+ const visiblePlugins = installedPlugins.slice(
42
+ startIndex,
43
+ startIndex + MAX_VISIBLE_ITEMS,
44
+ );
45
+
33
46
  return (
34
47
  <Box flexDirection="column">
35
- {installedPlugins.map((plugin, index) => {
36
- const isSelected = index === selectedIndex;
48
+ {visiblePlugins.map((plugin, index) => {
49
+ const isSelected = index + startIndex === selectedIndex;
37
50
  return (
38
51
  <Box
39
52
  key={`${plugin.name}@${plugin.marketplace}`}
@@ -8,6 +8,8 @@ export interface ModelSelectorProps {
8
8
  onSelectModel: (model: string) => void;
9
9
  }
10
10
 
11
+ const MAX_VISIBLE_ITEMS = 5;
12
+
11
13
  export const ModelSelector: React.FC<ModelSelectorProps> = ({
12
14
  onCancel,
13
15
  currentModel,
@@ -46,6 +48,19 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
46
48
  }
47
49
  });
48
50
 
51
+ // Calculate visible window
52
+ const startIndex = Math.max(
53
+ 0,
54
+ Math.min(
55
+ selectedIndex - Math.floor(MAX_VISIBLE_ITEMS / 2),
56
+ Math.max(0, configuredModels.length - MAX_VISIBLE_ITEMS),
57
+ ),
58
+ );
59
+ const visibleModels = configuredModels.slice(
60
+ startIndex,
61
+ startIndex + MAX_VISIBLE_ITEMS,
62
+ );
63
+
49
64
  if (configuredModels.length === 0) {
50
65
  return (
51
66
  <Box
@@ -84,22 +99,27 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
84
99
  </Box>
85
100
  <Text dimColor>Select a model to use for the current session</Text>
86
101
 
87
- {configuredModels.map((model, index) => (
88
- <Box key={model}>
89
- <Text
90
- color={index === selectedIndex ? "black" : "white"}
91
- backgroundColor={index === selectedIndex ? "cyan" : undefined}
92
- >
93
- {index === selectedIndex ? "▶ " : " "}
94
- {model}
95
- {model === currentModel ? (
96
- <Text color="green"> (current)</Text>
97
- ) : (
98
- ""
99
- )}
100
- </Text>
101
- </Box>
102
- ))}
102
+ {visibleModels.map((model, index) => {
103
+ const actualIndex = startIndex + index;
104
+ return (
105
+ <Box key={model}>
106
+ <Text
107
+ color={actualIndex === selectedIndex ? "black" : "white"}
108
+ backgroundColor={
109
+ actualIndex === selectedIndex ? "cyan" : undefined
110
+ }
111
+ >
112
+ {actualIndex === selectedIndex ? "▶ " : " "}
113
+ {model}
114
+ {model === currentModel ? (
115
+ <Text color="green"> (current)</Text>
116
+ ) : (
117
+ ""
118
+ )}
119
+ </Text>
120
+ </Box>
121
+ );
122
+ })}
103
123
 
104
124
  <Box marginTop={1}>
105
125
  <Text dimColor>↑/↓ to select · Enter to confirm · Esc to cancel</Text>
@@ -12,6 +12,8 @@ interface PluginListProps {
12
12
  onSelect?: (index: number) => void;
13
13
  }
14
14
 
15
+ const MAX_VISIBLE_ITEMS = 3;
16
+
15
17
  export const PluginList: React.FC<PluginListProps> = ({
16
18
  plugins,
17
19
  selectedIndex,
@@ -24,10 +26,22 @@ export const PluginList: React.FC<PluginListProps> = ({
24
26
  );
25
27
  }
26
28
 
29
+ const startIndex = Math.max(
30
+ 0,
31
+ Math.min(
32
+ selectedIndex - Math.floor(MAX_VISIBLE_ITEMS / 2),
33
+ Math.max(0, plugins.length - MAX_VISIBLE_ITEMS),
34
+ ),
35
+ );
36
+ const visiblePlugins = plugins.slice(
37
+ startIndex,
38
+ startIndex + MAX_VISIBLE_ITEMS,
39
+ );
40
+
27
41
  return (
28
42
  <Box flexDirection="column">
29
- {plugins.map((plugin, index) => {
30
- const isSelected = index === selectedIndex;
43
+ {visiblePlugins.map((plugin, index) => {
44
+ const isSelected = index + startIndex === selectedIndex;
31
45
  const pluginId = `${plugin.name}@${plugin.marketplace}`;
32
46
 
33
47
  return (