@aigne/cli 1.41.3 → 1.42.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 +33 -0
- package/dist/cli.js +1 -0
- package/dist/commands/aigne.js +2 -2
- package/dist/tracer/terminal.js +6 -3
- package/dist/utils/inquirer/checkbox.d.ts +55 -0
- package/dist/utils/inquirer/checkbox.js +303 -0
- package/package.json +16 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.42.1](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.42.0...cli-v1.42.1) (2025-08-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* resolve checkbox multi-select issues and add comprehensive test ([#430](https://github.com/AIGNE-io/aigne-framework/issues/430)) ([a81be74](https://github.com/AIGNE-io/aigne-framework/commit/a81be74253923a1a2981f0780a15f175fd439210))
|
|
9
|
+
|
|
10
|
+
## [1.42.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.41.3...cli-v1.42.0) (2025-08-28)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **cli:** add searchable checkbox component with dynamic filtering ([#426](https://github.com/AIGNE-io/aigne-framework/issues/426)) ([1a76fe7](https://github.com/AIGNE-io/aigne-framework/commit/1a76fe7c2f7d91bc4041dfcd73850b39a18a036b))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **cli:** only show ascii logo on help and errors ([#425](https://github.com/AIGNE-io/aigne-framework/issues/425)) ([1279376](https://github.com/AIGNE-io/aigne-framework/commit/1279376b7ca9c1c38148dcde581ee4730771a4ad))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Dependencies
|
|
24
|
+
|
|
25
|
+
* The following workspace dependencies were updated
|
|
26
|
+
* dependencies
|
|
27
|
+
* @aigne/agent-library bumped to 1.21.31
|
|
28
|
+
* @aigne/agentic-memory bumped to 1.0.31
|
|
29
|
+
* @aigne/aigne-hub bumped to 0.8.1
|
|
30
|
+
* @aigne/core bumped to 1.57.0
|
|
31
|
+
* @aigne/default-memory bumped to 1.1.13
|
|
32
|
+
* @aigne/openai bumped to 0.13.2
|
|
33
|
+
* devDependencies
|
|
34
|
+
* @aigne/test-utils bumped to 0.5.38
|
|
35
|
+
|
|
3
36
|
## [1.41.3](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.41.2...cli-v1.41.3) (2025-08-27)
|
|
4
37
|
|
|
5
38
|
|
package/dist/cli.js
CHANGED
package/dist/commands/aigne.js
CHANGED
|
@@ -10,10 +10,9 @@ import { createRunCommand } from "./run.js";
|
|
|
10
10
|
import { createServeMCPCommand } from "./serve-mcp.js";
|
|
11
11
|
import { createTestCommand } from "./test.js";
|
|
12
12
|
export function createAIGNECommand(options) {
|
|
13
|
-
console.log(asciiLogo);
|
|
14
13
|
return yargs()
|
|
15
14
|
.scriptName("aigne")
|
|
16
|
-
.usage(
|
|
15
|
+
.usage(`${asciiLogo}\n$0 <command> [options]`)
|
|
17
16
|
.version(AIGNE_CLI_VERSION)
|
|
18
17
|
.command(createRunCommand(options))
|
|
19
18
|
.command(createTestCommand(options))
|
|
@@ -26,5 +25,6 @@ export function createAIGNECommand(options) {
|
|
|
26
25
|
.demandCommand()
|
|
27
26
|
.alias("help", "h")
|
|
28
27
|
.alias("version", "v")
|
|
28
|
+
.wrap(null)
|
|
29
29
|
.strict();
|
|
30
30
|
}
|
package/dist/tracer/terminal.js
CHANGED
|
@@ -9,6 +9,7 @@ import * as prompts from "@inquirer/prompts";
|
|
|
9
9
|
import chalk from "chalk";
|
|
10
10
|
import { Marked } from "marked";
|
|
11
11
|
import { AIGNE_HUB_CREDITS_NOT_ENOUGH_ERROR_TYPE } from "../constants.js";
|
|
12
|
+
import checkbox from "../utils/inquirer/checkbox.js";
|
|
12
13
|
import { AIGNEListr, AIGNEListrRenderer } from "../utils/listr.js";
|
|
13
14
|
import { highlightUrl } from "../utils/string-utils.js";
|
|
14
15
|
import { parseDuration } from "../utils/time.js";
|
|
@@ -188,10 +189,12 @@ export class TerminalTracer {
|
|
|
188
189
|
listr;
|
|
189
190
|
proxiedPrompts = new Proxy({}, {
|
|
190
191
|
get: (_target, prop) => {
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
const method = prop === "checkbox"
|
|
193
|
+
? checkbox
|
|
194
|
+
: // biome-ignore lint/performance/noDynamicNamespaceImportAccess: we need to access prompts dynamically
|
|
195
|
+
prompts[prop];
|
|
193
196
|
if (typeof method !== "function")
|
|
194
|
-
|
|
197
|
+
throw new Error(`Unsupported prompt method ${String(prop)}`);
|
|
195
198
|
return async (config) => {
|
|
196
199
|
const renderer = this.listr?.["renderer"] instanceof AIGNEListrRenderer
|
|
197
200
|
? this.listr["renderer"]
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Separator, type Theme } from "@inquirer/core";
|
|
2
|
+
import type { PartialDeep } from "@inquirer/type";
|
|
3
|
+
type CheckboxTheme = {
|
|
4
|
+
icon: {
|
|
5
|
+
checked: string;
|
|
6
|
+
unchecked: string;
|
|
7
|
+
cursor: string;
|
|
8
|
+
};
|
|
9
|
+
style: {
|
|
10
|
+
disabledChoice: (text: string) => string;
|
|
11
|
+
renderSelectedChoices: <T>(selectedChoices: ReadonlyArray<NormalizedChoice<T>>, allChoices: ReadonlyArray<NormalizedChoice<T> | Separator>) => string;
|
|
12
|
+
description: (text: string) => string;
|
|
13
|
+
searchTerm: (text: string) => string;
|
|
14
|
+
};
|
|
15
|
+
helpMode: "always" | "never" | "auto";
|
|
16
|
+
};
|
|
17
|
+
type CheckboxShortcuts = {
|
|
18
|
+
all?: string | null;
|
|
19
|
+
invert?: string | null;
|
|
20
|
+
};
|
|
21
|
+
type Choice<Value> = {
|
|
22
|
+
value: Value;
|
|
23
|
+
name?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
short?: string;
|
|
26
|
+
disabled?: boolean | string;
|
|
27
|
+
checked?: boolean;
|
|
28
|
+
type?: never;
|
|
29
|
+
};
|
|
30
|
+
type NormalizedChoice<Value> = {
|
|
31
|
+
value: Value;
|
|
32
|
+
name: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
short: string;
|
|
35
|
+
disabled: boolean | string;
|
|
36
|
+
checked: boolean;
|
|
37
|
+
};
|
|
38
|
+
declare const _default: <Value>(config: {
|
|
39
|
+
message: string;
|
|
40
|
+
prefix?: string | undefined;
|
|
41
|
+
pageSize?: number | undefined;
|
|
42
|
+
instructions?: string | boolean | undefined;
|
|
43
|
+
choices?: readonly (string | Separator)[] | readonly (Separator | Choice<Value>)[] | undefined;
|
|
44
|
+
source?: ((term: string | undefined, opt: {
|
|
45
|
+
signal: AbortSignal;
|
|
46
|
+
}) => readonly (string | Separator)[] | Promise<readonly (string | Separator)[]> | readonly (Separator | Choice<Value>)[] | Promise<readonly (Separator | Choice<Value>)[]>) | undefined;
|
|
47
|
+
loop?: boolean | undefined;
|
|
48
|
+
required?: boolean | undefined;
|
|
49
|
+
validate?: ((choices: readonly Choice<Value>[]) => boolean | string | Promise<string | boolean>) | undefined;
|
|
50
|
+
theme?: PartialDeep<Theme<CheckboxTheme>> | undefined;
|
|
51
|
+
shortcuts?: CheckboxShortcuts | undefined;
|
|
52
|
+
}, context?: import("@inquirer/type").Context) => Promise<Value[]> & {
|
|
53
|
+
cancel: () => void;
|
|
54
|
+
};
|
|
55
|
+
export default _default;
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { createPrompt, isDownKey, isEnterKey, isNumberKey, isSpaceKey, isUpKey, makeTheme, Separator, useEffect, useKeypress, useMemo, usePagination, usePrefix, useRef, useState, ValidationError, } from "@inquirer/core";
|
|
2
|
+
import figures from "@inquirer/figures";
|
|
3
|
+
import ansiEscapes from "ansi-escapes";
|
|
4
|
+
import colors from "yoctocolors-cjs";
|
|
5
|
+
const checkboxTheme = {
|
|
6
|
+
icon: {
|
|
7
|
+
checked: colors.green(figures.circleFilled),
|
|
8
|
+
unchecked: figures.circle,
|
|
9
|
+
cursor: figures.pointer,
|
|
10
|
+
},
|
|
11
|
+
style: {
|
|
12
|
+
disabledChoice: (text) => colors.dim(`- ${text}`),
|
|
13
|
+
renderSelectedChoices: (selectedChoices) => selectedChoices.map((choice) => choice.short).join(", "),
|
|
14
|
+
description: (text) => colors.cyan(text),
|
|
15
|
+
searchTerm: (text) => colors.cyan(text),
|
|
16
|
+
},
|
|
17
|
+
helpMode: "auto",
|
|
18
|
+
};
|
|
19
|
+
function isSelectable(item) {
|
|
20
|
+
return !Separator.isSeparator(item) && !item.disabled;
|
|
21
|
+
}
|
|
22
|
+
function toggle(item) {
|
|
23
|
+
return isSelectable(item) ? { ...item, checked: !item.checked } : item;
|
|
24
|
+
}
|
|
25
|
+
function check(checked) {
|
|
26
|
+
return (item) => isSelectable(item) ? { ...item, checked } : item;
|
|
27
|
+
}
|
|
28
|
+
function normalizeChoices(choices) {
|
|
29
|
+
return choices.map((choice) => {
|
|
30
|
+
if (Separator.isSeparator(choice))
|
|
31
|
+
return choice;
|
|
32
|
+
if (typeof choice === "string") {
|
|
33
|
+
return {
|
|
34
|
+
value: choice,
|
|
35
|
+
name: choice,
|
|
36
|
+
short: choice,
|
|
37
|
+
disabled: false,
|
|
38
|
+
checked: false,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const name = choice.name ?? String(choice.value);
|
|
42
|
+
const normalizedChoice = {
|
|
43
|
+
value: choice.value,
|
|
44
|
+
name,
|
|
45
|
+
short: choice.short ?? name,
|
|
46
|
+
disabled: choice.disabled ?? false,
|
|
47
|
+
checked: choice.checked ?? false,
|
|
48
|
+
};
|
|
49
|
+
if (choice.description) {
|
|
50
|
+
normalizedChoice.description = choice.description;
|
|
51
|
+
}
|
|
52
|
+
return normalizedChoice;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export default createPrompt((config, done) => {
|
|
56
|
+
const { instructions, pageSize = 7, loop = true, required, validate = () => true } = config;
|
|
57
|
+
const shortcuts = { all: "a", invert: "i", ...config.shortcuts };
|
|
58
|
+
const theme = makeTheme(checkboxTheme, config.theme);
|
|
59
|
+
const firstRender = useRef(true);
|
|
60
|
+
const [status, setStatus] = useState(config.source ? "loading" : "idle");
|
|
61
|
+
const prefix = usePrefix({ status, theme });
|
|
62
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
63
|
+
const [searchError, setSearchError] = useState();
|
|
64
|
+
const initialItems = config.choices ? normalizeChoices(config.choices) : [];
|
|
65
|
+
const initialSelectedChoices = new Map(initialItems
|
|
66
|
+
.filter((item) => !Separator.isSeparator(item) && item.checked)
|
|
67
|
+
.map((item) => [item.value, item]));
|
|
68
|
+
const [selectedChoices, setSelectedChoices] = useState(initialSelectedChoices);
|
|
69
|
+
const [items, setItems] = useState(initialItems);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
const { source } = config;
|
|
72
|
+
if (!source)
|
|
73
|
+
return;
|
|
74
|
+
const controller = new AbortController();
|
|
75
|
+
setStatus("loading");
|
|
76
|
+
setSearchError(undefined);
|
|
77
|
+
const fetchResults = async () => {
|
|
78
|
+
try {
|
|
79
|
+
const results = await source(searchTerm || undefined, {
|
|
80
|
+
signal: controller.signal,
|
|
81
|
+
});
|
|
82
|
+
if (!controller.signal.aborted) {
|
|
83
|
+
const normalizedResults = normalizeChoices(results);
|
|
84
|
+
// Preserve selected state from selectedChoices
|
|
85
|
+
const itemsWithSelection = normalizedResults.map((item) => {
|
|
86
|
+
if (!Separator.isSeparator(item)) {
|
|
87
|
+
return {
|
|
88
|
+
...item,
|
|
89
|
+
checked: selectedChoices.has(item.value),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
return item;
|
|
93
|
+
});
|
|
94
|
+
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
|
+
}
|
|
100
|
+
setSearchError(undefined);
|
|
101
|
+
setStatus("idle");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
if (!controller.signal.aborted && error instanceof Error) {
|
|
106
|
+
setSearchError(error.message);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
void fetchResults();
|
|
111
|
+
return () => {
|
|
112
|
+
controller.abort();
|
|
113
|
+
};
|
|
114
|
+
}, [searchTerm, config.source, selectedChoices]);
|
|
115
|
+
const bounds = useMemo(() => {
|
|
116
|
+
const first = items.findIndex(isSelectable);
|
|
117
|
+
const last = items.findLastIndex(isSelectable);
|
|
118
|
+
if (first === -1 && !config.source && status !== "loading") {
|
|
119
|
+
throw new ValidationError("[checkbox prompt] No selectable choices. All choices are disabled.");
|
|
120
|
+
}
|
|
121
|
+
return { first, last };
|
|
122
|
+
}, [items, config.source, status]);
|
|
123
|
+
const [active, setActive] = useState(bounds.first >= 0 ? bounds.first : 0);
|
|
124
|
+
const [showHelpTip, setShowHelpTip] = useState(true);
|
|
125
|
+
const [errorMsg, setError] = useState();
|
|
126
|
+
useKeypress(async (key, rl) => {
|
|
127
|
+
if (isEnterKey(key)) {
|
|
128
|
+
const selectionChoices = Array.from(selectedChoices.values());
|
|
129
|
+
const isValid = await validate(selectionChoices);
|
|
130
|
+
if (required && selectedChoices.size === 0) {
|
|
131
|
+
setError("At least one choice must be selected");
|
|
132
|
+
}
|
|
133
|
+
else if (isValid === true) {
|
|
134
|
+
setStatus("done");
|
|
135
|
+
done(selectionChoices.map((choice) => choice.value));
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
setError(isValid || "You must select a valid value");
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else if (isUpKey(key) || isDownKey(key)) {
|
|
142
|
+
if (loop ||
|
|
143
|
+
(isUpKey(key) && active !== bounds.first) ||
|
|
144
|
+
(isDownKey(key) && active !== bounds.last)) {
|
|
145
|
+
const offset = isUpKey(key) ? -1 : 1;
|
|
146
|
+
let next = active;
|
|
147
|
+
do {
|
|
148
|
+
next = (next + offset + items.length) % items.length;
|
|
149
|
+
// biome-ignore lint/style/noNonNullAssertion: we need to access items dynamically
|
|
150
|
+
} while (!isSelectable(items[next]));
|
|
151
|
+
setActive(next);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
else if (isSpaceKey(key)) {
|
|
155
|
+
setError(undefined);
|
|
156
|
+
setShowHelpTip(false);
|
|
157
|
+
if (config.source) {
|
|
158
|
+
// In search mode, prevent space from being added to search term
|
|
159
|
+
rl.clearLine(0);
|
|
160
|
+
rl.write(searchTerm); // Restore search term without the space
|
|
161
|
+
}
|
|
162
|
+
const activeItem = items[active];
|
|
163
|
+
if (activeItem && isSelectable(activeItem)) {
|
|
164
|
+
const newSelectedChoices = new Map(selectedChoices);
|
|
165
|
+
if (selectedChoices.has(activeItem.value)) {
|
|
166
|
+
newSelectedChoices.delete(activeItem.value);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
newSelectedChoices.set(activeItem.value, activeItem);
|
|
170
|
+
}
|
|
171
|
+
setSelectedChoices(newSelectedChoices);
|
|
172
|
+
setItems(items.map((choice, i) => (i === active ? toggle(choice) : choice)));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
else if (key.name === shortcuts.all && !config.source) {
|
|
176
|
+
const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked);
|
|
177
|
+
const newSelectedChoices = new Map();
|
|
178
|
+
if (selectAll) {
|
|
179
|
+
items.forEach((item) => {
|
|
180
|
+
if (isSelectable(item)) {
|
|
181
|
+
newSelectedChoices.set(item.value, item);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
setSelectedChoices(newSelectedChoices);
|
|
186
|
+
setItems(items.map(check(selectAll)));
|
|
187
|
+
}
|
|
188
|
+
else if (key.name === shortcuts.invert && !config.source) {
|
|
189
|
+
const newSelectedChoices = new Map();
|
|
190
|
+
items.forEach((item) => {
|
|
191
|
+
if (isSelectable(item)) {
|
|
192
|
+
if (!selectedChoices.has(item.value)) {
|
|
193
|
+
newSelectedChoices.set(item.value, item);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
setSelectedChoices(newSelectedChoices);
|
|
198
|
+
setItems(items.map(toggle));
|
|
199
|
+
}
|
|
200
|
+
else if (isNumberKey(key) && !config.source) {
|
|
201
|
+
const selectedIndex = Number(key.name) - 1;
|
|
202
|
+
// Find the nth item (ignoring separators)
|
|
203
|
+
let selectableIndex = -1;
|
|
204
|
+
const position = items.findIndex((item) => {
|
|
205
|
+
if (Separator.isSeparator(item))
|
|
206
|
+
return false;
|
|
207
|
+
selectableIndex++;
|
|
208
|
+
return selectableIndex === selectedIndex;
|
|
209
|
+
});
|
|
210
|
+
const selectedItem = items[position];
|
|
211
|
+
if (selectedItem && isSelectable(selectedItem)) {
|
|
212
|
+
setActive(position);
|
|
213
|
+
const newSelectedChoices = new Map(selectedChoices);
|
|
214
|
+
if (selectedChoices.has(selectedItem.value)) {
|
|
215
|
+
newSelectedChoices.delete(selectedItem.value);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
newSelectedChoices.set(selectedItem.value, selectedItem);
|
|
219
|
+
}
|
|
220
|
+
setSelectedChoices(newSelectedChoices);
|
|
221
|
+
setItems(items.map((choice, i) => (i === position ? toggle(choice) : choice)));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
else if (config.source && !isSpaceKey(key)) {
|
|
225
|
+
setSearchTerm(rl.line);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
const message = theme.style.message(config.message, status);
|
|
229
|
+
let description;
|
|
230
|
+
const page = usePagination({
|
|
231
|
+
items,
|
|
232
|
+
active,
|
|
233
|
+
renderItem({ item, isActive }) {
|
|
234
|
+
if (Separator.isSeparator(item)) {
|
|
235
|
+
return ` ${item.separator}`;
|
|
236
|
+
}
|
|
237
|
+
if (item.disabled) {
|
|
238
|
+
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
|
|
239
|
+
return theme.style.disabledChoice(`${item.name} ${disabledLabel}`);
|
|
240
|
+
}
|
|
241
|
+
if (isActive) {
|
|
242
|
+
description = item.description;
|
|
243
|
+
}
|
|
244
|
+
const checkbox = item.checked ? theme.icon.checked : theme.icon.unchecked;
|
|
245
|
+
const color = isActive ? theme.style.highlight : (x) => x;
|
|
246
|
+
const cursor = isActive ? theme.icon.cursor : " ";
|
|
247
|
+
return color(`${cursor}${checkbox} ${item.name}`);
|
|
248
|
+
},
|
|
249
|
+
pageSize,
|
|
250
|
+
loop,
|
|
251
|
+
});
|
|
252
|
+
if (status === "done") {
|
|
253
|
+
const selection = Array.from(selectedChoices.values());
|
|
254
|
+
const answer = theme.style.answer(theme.style.renderSelectedChoices(selection, items));
|
|
255
|
+
return `${prefix} ${message} ${answer}`;
|
|
256
|
+
}
|
|
257
|
+
let helpTipTop = "";
|
|
258
|
+
let helpTipBottom = "";
|
|
259
|
+
if (theme.helpMode === "always" ||
|
|
260
|
+
(theme.helpMode === "auto" && showHelpTip && (instructions === undefined || instructions))) {
|
|
261
|
+
if (typeof instructions === "string") {
|
|
262
|
+
helpTipTop = instructions;
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
const keys = [
|
|
266
|
+
`${theme.style.key("space")} to select`,
|
|
267
|
+
!config.source && shortcuts.all ? `${theme.style.key(shortcuts.all)} to toggle all` : "",
|
|
268
|
+
!config.source && shortcuts.invert
|
|
269
|
+
? `${theme.style.key(shortcuts.invert)} to invert selection`
|
|
270
|
+
: "",
|
|
271
|
+
`and ${theme.style.key("enter")} to proceed`,
|
|
272
|
+
];
|
|
273
|
+
helpTipTop = ` (Press ${keys.filter((key) => key !== "").join(", ")})`;
|
|
274
|
+
}
|
|
275
|
+
if (items.length > pageSize &&
|
|
276
|
+
(theme.helpMode === "always" ||
|
|
277
|
+
(theme.helpMode === "auto" && (firstRender.current || config.source)))) {
|
|
278
|
+
helpTipBottom = `\n${theme.style.help("(Use arrow keys to reveal more choices)")}`;
|
|
279
|
+
if (!config.source) {
|
|
280
|
+
firstRender.current = false;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
const choiceDescription = description ? `\n${theme.style.description(description)}` : ``;
|
|
285
|
+
let error = "";
|
|
286
|
+
if (searchError) {
|
|
287
|
+
error = `\n${theme.style.error(searchError)}`;
|
|
288
|
+
}
|
|
289
|
+
else if (config.source && items.length === 0 && searchTerm !== "" && status === "idle") {
|
|
290
|
+
error = `\n${theme.style.error("No results found")}`;
|
|
291
|
+
}
|
|
292
|
+
else if (errorMsg) {
|
|
293
|
+
error = `\n${theme.style.error(errorMsg)}`;
|
|
294
|
+
}
|
|
295
|
+
if (config.source) {
|
|
296
|
+
const searchStr = theme.style.searchTerm(searchTerm);
|
|
297
|
+
return [
|
|
298
|
+
[prefix, message, searchStr].filter(Boolean).join(" "),
|
|
299
|
+
`${error || page}${helpTipBottom}${choiceDescription}`,
|
|
300
|
+
];
|
|
301
|
+
}
|
|
302
|
+
return `${prefix} ${message}${helpTipTop}\n${page}${helpTipBottom}${choiceDescription}${error}${ansiEscapes.cursorHide}`;
|
|
303
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.1",
|
|
4
4
|
"description": "Your command center for agent development",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -47,12 +47,15 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@aigne/listr2": "^1.0.10",
|
|
49
49
|
"@aigne/marked-terminal": "^7.3.2",
|
|
50
|
-
"@inquirer/
|
|
50
|
+
"@inquirer/core": "^10.2.0",
|
|
51
|
+
"@inquirer/figures": "^1.0.13",
|
|
52
|
+
"@inquirer/prompts": "^7.8.4",
|
|
51
53
|
"@inquirer/type": "^3.0.8",
|
|
52
|
-
"@listr2/prompt-adapter-inquirer": "^3.0.
|
|
54
|
+
"@listr2/prompt-adapter-inquirer": "^3.0.2",
|
|
53
55
|
"@modelcontextprotocol/sdk": "^1.15.0",
|
|
54
56
|
"@ocap/mcrypto": "^1.21.0",
|
|
55
57
|
"@smithy/node-http-handler": "^4.1.0",
|
|
58
|
+
"ansi-escapes": "^7.0.0",
|
|
56
59
|
"boxen": "^8.0.1",
|
|
57
60
|
"chalk": "^5.4.1",
|
|
58
61
|
"cli-table3": "^0.6.5",
|
|
@@ -62,7 +65,7 @@
|
|
|
62
65
|
"glob": "^11.0.3",
|
|
63
66
|
"gradient-string": "^3.0.0",
|
|
64
67
|
"https-proxy-agent": "^7.0.6",
|
|
65
|
-
"inquirer": "^12.
|
|
68
|
+
"inquirer": "^12.9.4",
|
|
66
69
|
"log-update": "^6.1.0",
|
|
67
70
|
"marked": "^16.0.0",
|
|
68
71
|
"nunjucks": "^3.2.4",
|
|
@@ -74,16 +77,18 @@
|
|
|
74
77
|
"wrap-ansi": "^9.0.0",
|
|
75
78
|
"yaml": "^2.8.0",
|
|
76
79
|
"yargs": "^18.0.0",
|
|
80
|
+
"yoctocolors-cjs": "^2.1.3",
|
|
77
81
|
"zod": "^3.25.67",
|
|
78
|
-
"@aigne/agent-library": "^1.21.
|
|
79
|
-
"@aigne/agentic-memory": "^1.0.
|
|
80
|
-
"@aigne/
|
|
81
|
-
"@aigne/
|
|
82
|
-
"@aigne/default-memory": "^1.1.12",
|
|
82
|
+
"@aigne/agent-library": "^1.21.31",
|
|
83
|
+
"@aigne/agentic-memory": "^1.0.31",
|
|
84
|
+
"@aigne/aigne-hub": "^0.8.1",
|
|
85
|
+
"@aigne/core": "^1.57.0",
|
|
83
86
|
"@aigne/observability-api": "^0.10.1",
|
|
84
|
-
"@aigne/
|
|
87
|
+
"@aigne/default-memory": "^1.1.13",
|
|
88
|
+
"@aigne/openai": "^0.13.2"
|
|
85
89
|
},
|
|
86
90
|
"devDependencies": {
|
|
91
|
+
"@inquirer/testing": "^2.1.49",
|
|
87
92
|
"@types/archiver": "^6.0.3",
|
|
88
93
|
"@types/bun": "^1.2.18",
|
|
89
94
|
"@types/express": "^5.0.3",
|
|
@@ -97,7 +102,7 @@
|
|
|
97
102
|
"rimraf": "^6.0.1",
|
|
98
103
|
"typescript": "^5.8.3",
|
|
99
104
|
"ufo": "^1.6.1",
|
|
100
|
-
"@aigne/test-utils": "^0.5.
|
|
105
|
+
"@aigne/test-utils": "^0.5.38"
|
|
101
106
|
},
|
|
102
107
|
"scripts": {
|
|
103
108
|
"lint": "tsc --noEmit",
|