agent-rev 0.5.14 → 0.5.24
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/dist/commands/repl.d.ts +0 -2
- package/dist/commands/repl.js +196 -233
- package/dist/commands/setup.js +64 -6
- package/dist/core/engine.js +265 -172
- package/dist/index.js +26 -19
- package/dist/ui/input.d.ts +23 -25
- package/dist/ui/input.js +310 -248
- package/dist/utils/qwen-auth.d.ts +14 -4
- package/dist/utils/qwen-auth.js +81 -8
- package/package.json +44 -1
package/dist/index.js
CHANGED
|
@@ -61,8 +61,8 @@ REPL commands (type inside the session):
|
|
|
61
61
|
/run orch <task> Run only orchestrator
|
|
62
62
|
/run impl <id> Run only implementor
|
|
63
63
|
/run rev <id> Run only reviewer
|
|
64
|
-
/login
|
|
65
|
-
/logout
|
|
64
|
+
/login Configure API key
|
|
65
|
+
/logout Clear API key and credentials
|
|
66
66
|
/models [cli] List available models
|
|
67
67
|
/tasks List all tasks
|
|
68
68
|
/clear Clear screen
|
|
@@ -100,25 +100,32 @@ if (nativeRole) {
|
|
|
100
100
|
console.log(chalk.dim(` Version: ${PKG_NAME} --version\n`));
|
|
101
101
|
process.exit(0);
|
|
102
102
|
}
|
|
103
|
-
// --login:
|
|
103
|
+
// --login: configure API key for this role
|
|
104
104
|
if (args.includes('--login') || args.includes('login')) {
|
|
105
|
-
const {
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
105
|
+
const { saveApiKeyConfig, loadApiKeyConfig, DEFAULT_API_BASE_URL } = await import('./utils/qwen-auth.js');
|
|
106
|
+
const rl = (await import('readline')).createInterface({ input: process.stdin, output: process.stdout });
|
|
107
|
+
const ask = (q) => new Promise((res) => rl.question(q, res));
|
|
108
|
+
const existing = await loadApiKeyConfig();
|
|
109
|
+
console.log(chalk.bold.cyan(`\n ${PKG_NAME} — API Key Setup\n`));
|
|
110
|
+
if (existing) {
|
|
111
|
+
console.log(chalk.dim(` Current: ${existing.provider} / ${existing.model}`));
|
|
112
|
+
}
|
|
113
|
+
const apiKey = await ask(` API Key${existing ? ' [Enter to keep]' : ''}: `);
|
|
114
|
+
const model = await ask(` Model [${existing?.model ?? 'qwen-plus'}]: `);
|
|
115
|
+
rl.close();
|
|
116
|
+
const cfg = {
|
|
117
|
+
provider: existing?.provider ?? 'openai-compatible',
|
|
118
|
+
api_key: apiKey.trim() || existing?.api_key || '',
|
|
119
|
+
base_url: DEFAULT_API_BASE_URL,
|
|
120
|
+
model: model.trim() || existing?.model || 'qwen-plus',
|
|
121
|
+
};
|
|
122
|
+
if (!cfg.api_key) {
|
|
123
|
+
console.log(chalk.red(' API key is required.'));
|
|
124
|
+
process.exit(1);
|
|
120
125
|
}
|
|
121
|
-
|
|
126
|
+
await saveApiKeyConfig(cfg);
|
|
127
|
+
console.log(chalk.green(`\n ✓ API key saved — ${cfg.provider} / ${cfg.model}\n`));
|
|
128
|
+
process.exit(0);
|
|
122
129
|
}
|
|
123
130
|
// --status: show auth status
|
|
124
131
|
if (args.includes('--status') || args.includes('status')) {
|
package/dist/ui/input.d.ts
CHANGED
|
@@ -1,41 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline prompt, styled like Gemini/Qwen CLI.
|
|
3
|
+
* Draws at the current cursor line; when output arrives we erase the area
|
|
4
|
+
* (line-by-line, \x1b[2K) and redraw below. No absolute positioning.
|
|
5
|
+
*/
|
|
1
6
|
export declare class FixedInput {
|
|
2
|
-
private buf;
|
|
3
7
|
private history;
|
|
4
|
-
private histIdx;
|
|
5
8
|
private origLog;
|
|
6
|
-
private _pasting;
|
|
7
|
-
private _pasteAccum;
|
|
8
|
-
private _drawPending;
|
|
9
9
|
private _activityHeader;
|
|
10
10
|
private _activityLines;
|
|
11
|
-
private
|
|
11
|
+
private _inputBuffer;
|
|
12
|
+
private _cursorPos;
|
|
13
|
+
private _pasting;
|
|
14
|
+
private _pasteAccum;
|
|
15
|
+
private _resolveInput?;
|
|
16
|
+
private _inputActive;
|
|
17
|
+
private _areaRows;
|
|
18
|
+
private _cursorRow;
|
|
19
|
+
private _onResize?;
|
|
12
20
|
get cols(): number;
|
|
13
|
-
private get _reservedRows();
|
|
14
|
-
private get scrollBottom();
|
|
15
|
-
private _contentRows;
|
|
16
21
|
setup(): void;
|
|
17
22
|
teardown(): void;
|
|
18
|
-
redrawBox(): void;
|
|
19
23
|
suspend(): () => void;
|
|
20
|
-
/** Enter activity mode: show the 5-line log box instead of the input box. */
|
|
21
24
|
startActivity(header: string): void;
|
|
22
|
-
/** Update the header line (spinner frame + elapsed time) without clearing lines. */
|
|
23
25
|
updateActivityHeader(header: string): void;
|
|
24
|
-
/**
|
|
25
|
-
* Append a line to the activity log (keeps last ACTIVITY_LINES lines).
|
|
26
|
-
* Strips ANSI codes and skips blank or pure-JSON lines.
|
|
27
|
-
*/
|
|
28
26
|
pushActivity(rawLine: string): void;
|
|
29
|
-
/**
|
|
27
|
+
/** Replace all content lines at once (for streaming preview). */
|
|
28
|
+
setActivityLines(lines: string[]): void;
|
|
30
29
|
stopActivity(): void;
|
|
31
|
-
readLine(): Promise<string>;
|
|
32
30
|
println(text: string): void;
|
|
33
31
|
printSeparator(): void;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
private
|
|
37
|
-
|
|
38
|
-
private
|
|
39
|
-
private
|
|
40
|
-
private
|
|
32
|
+
redrawBox(): void;
|
|
33
|
+
readLine(): Promise<string>;
|
|
34
|
+
private _commitPaste;
|
|
35
|
+
/** Build a string that erases the currently-drawn area and leaves the cursor at col 0 of the top row. */
|
|
36
|
+
private _buildClear;
|
|
37
|
+
private _clearArea;
|
|
38
|
+
private _redraw;
|
|
41
39
|
}
|