lcagent-cli 0.1.0 → 0.1.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/dist/bin/cli.js +10 -2
- package/dist/core/http.d.ts +2 -0
- package/dist/core/http.js +2 -0
- package/dist/core/model.js +1 -0
- package/package.json +4 -3
package/dist/bin/cli.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import { stdin as input, stdout as output } from 'node:process';
|
|
4
|
-
import { createInterface } from 'node:readline
|
|
4
|
+
import { createInterface } from 'node:readline';
|
|
5
5
|
import { createApp } from '../app/bootstrap.js';
|
|
6
|
+
import { fetch } from '../core/http.js';
|
|
6
7
|
import { agentConfigSchema } from '../config/schema.js';
|
|
7
8
|
import { getConfigPath, loadConfig, updateConfig } from '../config/store.js';
|
|
8
9
|
import { getDefaultTools } from '../tools/registry.js';
|
|
9
10
|
function trimTrailingSlash(value) {
|
|
10
11
|
return value.replace(/\/+$/, '');
|
|
11
12
|
}
|
|
13
|
+
function questionAsync(rl, prompt) {
|
|
14
|
+
return new Promise(resolve => {
|
|
15
|
+
rl.question(prompt, answer => {
|
|
16
|
+
resolve(answer);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
12
20
|
async function probeUrl(url) {
|
|
13
21
|
try {
|
|
14
22
|
const response = await fetch(url, {
|
|
@@ -119,7 +127,7 @@ async function runChat() {
|
|
|
119
127
|
const rl = createInterface({ input, output });
|
|
120
128
|
try {
|
|
121
129
|
while (true) {
|
|
122
|
-
const line = (await rl
|
|
130
|
+
const line = (await questionAsync(rl, '> ')).trim();
|
|
123
131
|
if (!line) {
|
|
124
132
|
continue;
|
|
125
133
|
}
|
package/dist/core/model.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lcagent-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A minimal coding agent CLI for terminal-based coding workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"prepublishOnly": "npm run build"
|
|
23
23
|
},
|
|
24
24
|
"engines": {
|
|
25
|
-
"node": ">=
|
|
25
|
+
"node": ">=16.17"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
28
|
"agent",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"terminal"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"commander": "^
|
|
34
|
+
"commander": "^11.1.0",
|
|
35
|
+
"undici": "^5.28.5",
|
|
35
36
|
"zod": "^4.1.5"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|