codemini-cli 0.4.3 → 0.4.4
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/deployment.md +5 -5
- package/package.json +1 -1
- package/src/commands/chat.js +18 -5
- package/src/core/fff-adapter.js +1 -1
package/deployment.md
CHANGED
|
@@ -13,13 +13,13 @@ npm pack
|
|
|
13
13
|
Expected output:
|
|
14
14
|
|
|
15
15
|
```text
|
|
16
|
-
codemini-cli-0.4.
|
|
16
|
+
codemini-cli-0.4.4.tgz
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
If you want to verify the package contents:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
tar -tf codemini-cli-0.4.
|
|
22
|
+
tar -tf codemini-cli-0.4.4.tgz
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## 2. Copy To The Target Machine
|
|
@@ -34,7 +34,7 @@ Copy the generated `.tgz` file to the Win10 machine by one of these methods:
|
|
|
34
34
|
Recommended target path:
|
|
35
35
|
|
|
36
36
|
```powershell
|
|
37
|
-
C:\temp\codemini-cli-0.4.
|
|
37
|
+
C:\temp\codemini-cli-0.4.4.tgz
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## 3. Environment Requirements
|
|
@@ -58,7 +58,7 @@ npm -v
|
|
|
58
58
|
Global install:
|
|
59
59
|
|
|
60
60
|
```powershell
|
|
61
|
-
npm install -g C:\temp\codemini-cli-0.4.
|
|
61
|
+
npm install -g C:\temp\codemini-cli-0.4.4.tgz
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
If global install is blocked by company policy, install in a working directory instead:
|
|
@@ -66,7 +66,7 @@ If global install is blocked by company policy, install in a working directory i
|
|
|
66
66
|
```powershell
|
|
67
67
|
mkdir C:\temp\coder-test
|
|
68
68
|
cd C:\temp\coder-test
|
|
69
|
-
npm install C:\temp\codemini-cli-0.4.
|
|
69
|
+
npm install C:\temp\codemini-cli-0.4.4.tgz
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
## 5. Confirm Installation
|
package/package.json
CHANGED
package/src/commands/chat.js
CHANGED
|
@@ -42,6 +42,22 @@ function parseChatArgs(args) {
|
|
|
42
42
|
return parsed;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
export async function submitAndPrint(runtime, line, { output: out = process.stdout } = {}) {
|
|
46
|
+
let streamed = false;
|
|
47
|
+
const result = await runtime.submit(line, (event) => {
|
|
48
|
+
if (event?.type !== 'assistant:delta' || !event.text) return;
|
|
49
|
+
streamed = true;
|
|
50
|
+
out.write(String(event.text));
|
|
51
|
+
});
|
|
52
|
+
if (result.type === 'exit' || result.type === 'noop') return result;
|
|
53
|
+
if (streamed) {
|
|
54
|
+
out.write('\n');
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
if (result.text) out.write(`${result.text}\n`);
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
|
|
45
61
|
async function runPlainLoop(runtime) {
|
|
46
62
|
console.log('CodeMini CLI plain mode. Use /help and /exit.');
|
|
47
63
|
const rl = readline.createInterface({ input, output });
|
|
@@ -53,10 +69,8 @@ async function runPlainLoop(runtime) {
|
|
|
53
69
|
} catch {
|
|
54
70
|
break;
|
|
55
71
|
}
|
|
56
|
-
const result = await runtime
|
|
72
|
+
const result = await submitAndPrint(runtime, line, { output });
|
|
57
73
|
if (result.type === 'exit') break;
|
|
58
|
-
if (result.type === 'noop') continue;
|
|
59
|
-
if (result.text) console.log(result.text);
|
|
60
74
|
}
|
|
61
75
|
} finally {
|
|
62
76
|
rl.close();
|
|
@@ -80,8 +94,7 @@ export async function handleChat(args) {
|
|
|
80
94
|
|
|
81
95
|
try {
|
|
82
96
|
if (parsed.prompt) {
|
|
83
|
-
|
|
84
|
-
if (result.text) console.log(result.text);
|
|
97
|
+
await submitAndPrint(runtime, parsed.prompt, { output: process.stdout });
|
|
85
98
|
return;
|
|
86
99
|
}
|
|
87
100
|
|