@aigne/cli 1.42.3 → 1.43.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.43.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.42.4...cli-v1.43.0) (2025-08-30)
4
+
5
+
6
+ ### Features
7
+
8
+ * **cli:** support ctrl+a select all items for prompts.checkbox ([#439](https://github.com/AIGNE-io/aigne-framework/issues/439)) ([af1c6c0](https://github.com/AIGNE-io/aigne-framework/commit/af1c6c03a1ebb2a168d6750a121aacd142ab26ea))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/agent-library bumped to 1.21.35
16
+ * @aigne/agentic-memory bumped to 1.0.35
17
+ * @aigne/aigne-hub bumped to 0.8.5
18
+ * @aigne/core bumped to 1.57.4
19
+ * @aigne/default-memory bumped to 1.1.17
20
+ * @aigne/openai bumped to 0.13.6
21
+ * devDependencies
22
+ * @aigne/test-utils bumped to 0.5.42
23
+
24
+ ## [1.42.4](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.42.3...cli-v1.42.4) (2025-08-30)
25
+
26
+
27
+ ### Dependencies
28
+
29
+ * The following workspace dependencies were updated
30
+ * dependencies
31
+ * @aigne/agent-library bumped to 1.21.34
32
+ * @aigne/agentic-memory bumped to 1.0.34
33
+ * @aigne/aigne-hub bumped to 0.8.4
34
+ * @aigne/core bumped to 1.57.3
35
+ * @aigne/default-memory bumped to 1.1.16
36
+ * @aigne/openai bumped to 0.13.5
37
+ * devDependencies
38
+ * @aigne/test-utils bumped to 0.5.41
39
+
3
40
  ## [1.42.3](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.42.2...cli-v1.42.3) (2025-08-29)
4
41
 
5
42
 
@@ -55,12 +55,16 @@ function normalizeChoices(choices) {
55
55
  export default createPrompt((config, done) => {
56
56
  const { instructions, pageSize = 7, loop = true, required, validate = () => true } = config;
57
57
  const shortcuts = { all: "a", invert: "i", ...config.shortcuts };
58
- const theme = makeTheme(checkboxTheme, config.theme);
58
+ const theme = makeTheme(checkboxTheme, {
59
+ ...config.theme,
60
+ helpMode: config.theme?.helpMode || (config.source ? "always" : "auto"),
61
+ });
59
62
  const firstRender = useRef(true);
60
63
  const [status, setStatus] = useState(config.source ? "loading" : "idle");
61
64
  const prefix = usePrefix({ status, theme });
62
65
  const [searchTerm, setSearchTerm] = useState("");
63
66
  const [searchError, setSearchError] = useState();
67
+ const [preserveActivePosition, setPreserveActivePosition] = useState(false);
64
68
  const initialItems = config.choices ? normalizeChoices(config.choices) : [];
65
69
  const initialSelectedChoices = new Map(initialItems
66
70
  .filter((item) => !Separator.isSeparator(item) && item.checked)
@@ -92,11 +96,14 @@ export default createPrompt((config, done) => {
92
96
  return item;
93
97
  });
94
98
  setItems(itemsWithSelection);
95
- // Reset active to first selectable item after search
96
- const firstSelectable = itemsWithSelection.findIndex(isSelectable);
97
- if (firstSelectable >= 0) {
98
- setActive(firstSelectable);
99
+ // Only reset active to first selectable item when not preserving position
100
+ if (!preserveActivePosition) {
101
+ const firstSelectable = itemsWithSelection.findIndex(isSelectable);
102
+ if (firstSelectable >= 0) {
103
+ setActive(firstSelectable);
104
+ }
99
105
  }
106
+ setPreserveActivePosition(false);
100
107
  setSearchError(undefined);
101
108
  setStatus("idle");
102
109
  }
@@ -158,6 +165,8 @@ export default createPrompt((config, done) => {
158
165
  // In search mode, prevent space from being added to search term
159
166
  rl.clearLine(0);
160
167
  rl.write(searchTerm); // Restore search term without the space
168
+ // Preserve active position when updating selected choices
169
+ setPreserveActivePosition(true);
161
170
  }
162
171
  const activeItem = items[active];
163
172
  if (activeItem && isSelectable(activeItem)) {
@@ -172,7 +181,7 @@ export default createPrompt((config, done) => {
172
181
  setItems(items.map((choice, i) => (i === active ? toggle(choice) : choice)));
173
182
  }
174
183
  }
175
- else if (key.name === shortcuts.all && !config.source) {
184
+ else if ((key.name === shortcuts.all && !config.source) || (key.ctrl && key.name === "a")) {
176
185
  const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked);
177
186
  const newSelectedChoices = new Map();
178
187
  if (selectAll) {
@@ -184,6 +193,10 @@ export default createPrompt((config, done) => {
184
193
  }
185
194
  setSelectedChoices(newSelectedChoices);
186
195
  setItems(items.map(check(selectAll)));
196
+ if (config.source) {
197
+ // Preserve active position when updating selected choices in search mode
198
+ setPreserveActivePosition(true);
199
+ }
187
200
  }
188
201
  else if (key.name === shortcuts.invert && !config.source) {
189
202
  const newSelectedChoices = new Map();
@@ -272,13 +285,17 @@ export default createPrompt((config, done) => {
272
285
  ];
273
286
  helpTipTop = ` (Press ${keys.filter((key) => key !== "").join(", ")})`;
274
287
  }
275
- if (items.length > pageSize &&
276
- (theme.helpMode === "always" ||
277
- (theme.helpMode === "auto" && (firstRender.current || config.source)))) {
288
+ if (config.source) {
289
+ // Always show bottom tip in search mode for better UX
290
+ const message = items.length > pageSize
291
+ ? "(Use arrow keys to reveal more choices, ctrl+a to select all)"
292
+ : "(Use arrow keys to navigate, ctrl+a to select all)";
293
+ helpTipBottom = `\n${theme.style.help(message)}`;
294
+ }
295
+ else if (items.length > pageSize &&
296
+ (theme.helpMode === "always" || (theme.helpMode === "auto" && firstRender.current))) {
278
297
  helpTipBottom = `\n${theme.style.help("(Use arrow keys to reveal more choices)")}`;
279
- if (!config.source) {
280
- firstRender.current = false;
281
- }
298
+ firstRender.current = false;
282
299
  }
283
300
  }
284
301
  const choiceDescription = description ? `\n${theme.style.description(description)}` : ``;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.42.3",
3
+ "version": "1.43.0",
4
4
  "description": "Your command center for agent development",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -79,13 +79,13 @@
79
79
  "yargs": "^18.0.0",
80
80
  "yoctocolors-cjs": "^2.1.3",
81
81
  "zod": "^3.25.67",
82
- "@aigne/agent-library": "^1.21.33",
83
- "@aigne/agentic-memory": "^1.0.33",
84
- "@aigne/aigne-hub": "^0.8.3",
85
- "@aigne/default-memory": "^1.1.15",
82
+ "@aigne/agentic-memory": "^1.0.35",
83
+ "@aigne/agent-library": "^1.21.35",
84
+ "@aigne/aigne-hub": "^0.8.5",
85
+ "@aigne/default-memory": "^1.1.17",
86
+ "@aigne/openai": "^0.13.6",
86
87
  "@aigne/observability-api": "^0.10.1",
87
- "@aigne/openai": "^0.13.4",
88
- "@aigne/core": "^1.57.2"
88
+ "@aigne/core": "^1.57.4"
89
89
  },
90
90
  "devDependencies": {
91
91
  "@inquirer/testing": "^2.1.49",
@@ -102,7 +102,7 @@
102
102
  "rimraf": "^6.0.1",
103
103
  "typescript": "^5.8.3",
104
104
  "ufo": "^1.6.1",
105
- "@aigne/test-utils": "^0.5.40"
105
+ "@aigne/test-utils": "^0.5.42"
106
106
  },
107
107
  "scripts": {
108
108
  "lint": "tsc --noEmit",