@aigne/cli 1.42.4 → 1.43.1
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 +42 -0
- package/dist/commands/run.js +20 -16
- package/dist/utils/inquirer/checkbox.js +29 -12
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.43.1](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.43.0...cli-v1.43.1) (2025-09-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **cli:** ensure console is restored after loadAIGNE call ([#447](https://github.com/AIGNE-io/aigne-framework/issues/447)) ([68fae38](https://github.com/AIGNE-io/aigne-framework/commit/68fae38c10346cd202266decf0ab0869bb618a07))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/agent-library bumped to 1.21.36
|
|
16
|
+
* @aigne/agentic-memory bumped to 1.0.36
|
|
17
|
+
* @aigne/aigne-hub bumped to 0.8.6
|
|
18
|
+
* @aigne/core bumped to 1.57.5
|
|
19
|
+
* @aigne/default-memory bumped to 1.1.18
|
|
20
|
+
* @aigne/openai bumped to 0.13.7
|
|
21
|
+
* devDependencies
|
|
22
|
+
* @aigne/test-utils bumped to 0.5.43
|
|
23
|
+
|
|
24
|
+
## [1.43.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.42.4...cli-v1.43.0) (2025-08-30)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* **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))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Dependencies
|
|
33
|
+
|
|
34
|
+
* The following workspace dependencies were updated
|
|
35
|
+
* dependencies
|
|
36
|
+
* @aigne/agent-library bumped to 1.21.35
|
|
37
|
+
* @aigne/agentic-memory bumped to 1.0.35
|
|
38
|
+
* @aigne/aigne-hub bumped to 0.8.5
|
|
39
|
+
* @aigne/core bumped to 1.57.4
|
|
40
|
+
* @aigne/default-memory bumped to 1.1.17
|
|
41
|
+
* @aigne/openai bumped to 0.13.6
|
|
42
|
+
* devDependencies
|
|
43
|
+
* @aigne/test-utils bumped to 0.5.42
|
|
44
|
+
|
|
3
45
|
## [1.42.4](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.42.3...cli-v1.42.4) (2025-08-30)
|
|
4
46
|
|
|
5
47
|
|
package/dist/commands/run.js
CHANGED
|
@@ -76,26 +76,30 @@ export function createRunCommand({ aigneFilePath, } = {}) {
|
|
|
76
76
|
task.output = args.join(" ");
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
try {
|
|
80
|
+
const aigne = await loadAIGNE({
|
|
81
|
+
path: dir,
|
|
82
|
+
modelOptions: {
|
|
83
|
+
...options,
|
|
84
|
+
inquirerPromptFn: (prompt) => {
|
|
85
|
+
if (prompt.type === "input") {
|
|
86
|
+
return task
|
|
87
|
+
.prompt(ListrInquirerPromptAdapter)
|
|
88
|
+
.run(inputInquirer, prompt)
|
|
89
|
+
.then((res) => ({ [prompt.name]: res }));
|
|
90
|
+
}
|
|
85
91
|
return task
|
|
86
92
|
.prompt(ListrInquirerPromptAdapter)
|
|
87
|
-
.run(
|
|
93
|
+
.run(selectInquirer, prompt)
|
|
88
94
|
.then((res) => ({ [prompt.name]: res }));
|
|
89
|
-
}
|
|
90
|
-
return task
|
|
91
|
-
.prompt(ListrInquirerPromptAdapter)
|
|
92
|
-
.run(selectInquirer, prompt)
|
|
93
|
-
.then((res) => ({ [prompt.name]: res }));
|
|
95
|
+
},
|
|
94
96
|
},
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
});
|
|
98
|
+
ctx.aigne = aigne;
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
Object.assign(console, originalLog);
|
|
102
|
+
}
|
|
99
103
|
},
|
|
100
104
|
},
|
|
101
105
|
{
|
|
@@ -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,
|
|
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
|
-
//
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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 (
|
|
276
|
-
|
|
277
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "1.43.1",
|
|
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.
|
|
83
|
-
"@aigne/
|
|
84
|
-
"@aigne/
|
|
85
|
-
"@aigne/core": "^1.57.
|
|
86
|
-
"@aigne/default-memory": "^1.1.
|
|
82
|
+
"@aigne/agent-library": "^1.21.36",
|
|
83
|
+
"@aigne/agentic-memory": "^1.0.36",
|
|
84
|
+
"@aigne/aigne-hub": "^0.8.6",
|
|
85
|
+
"@aigne/core": "^1.57.5",
|
|
86
|
+
"@aigne/default-memory": "^1.1.18",
|
|
87
87
|
"@aigne/observability-api": "^0.10.1",
|
|
88
|
-
"@aigne/openai": "^0.13.
|
|
88
|
+
"@aigne/openai": "^0.13.7"
|
|
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.
|
|
105
|
+
"@aigne/test-utils": "^0.5.43"
|
|
106
106
|
},
|
|
107
107
|
"scripts": {
|
|
108
108
|
"lint": "tsc --noEmit",
|