@nanhara/hara 0.119.2 → 0.121.0
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 +32 -0
- package/dist/context/mentions.js +17 -7
- package/dist/desk.js +64 -0
- package/dist/feedback.js +55 -0
- package/dist/fs-read.js +157 -0
- package/dist/fs-write.js +105 -0
- package/dist/index.js +134 -0
- package/dist/tools/builtin.js +34 -11
- package/dist/tools/edit.js +10 -2
- package/dist/tools/patch.js +45 -15
- package/dist/tools/registry.js +20 -6
- package/dist/tools/result-limit.js +37 -0
- package/dist/tui/App.js +1 -1
- package/dist/tui/InputBox.js +62 -4
- package/dist/tui/input-history.js +167 -0
- package/dist/undo.js +6 -4
- package/package.json +6 -1
package/dist/undo.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// In-session undo stack for file changes. Each edit tool records the prior state of the files it
|
|
2
2
|
// touched; `/undo` pops the last group and restores it. Process-scoped (one REPL session).
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { unlink } from "node:fs/promises";
|
|
4
|
+
import { atomicWriteText } from "./fs-write.js";
|
|
5
|
+
import { invalidateFileCandidates } from "./context/mentions.js";
|
|
5
6
|
const stack = [];
|
|
6
7
|
const MAX = 50;
|
|
7
8
|
/** Record a group of file changes (one tool call = one undo step). */
|
|
@@ -27,8 +28,7 @@ export async function undoLast() {
|
|
|
27
28
|
await unlink(s.absPath).catch(() => { }); // was newly created → remove
|
|
28
29
|
}
|
|
29
30
|
else {
|
|
30
|
-
await
|
|
31
|
-
await writeFile(s.absPath, s.before, "utf8");
|
|
31
|
+
await atomicWriteText(s.absPath, s.before);
|
|
32
32
|
}
|
|
33
33
|
files.push(s.path);
|
|
34
34
|
}
|
|
@@ -36,5 +36,7 @@ export async function undoLast() {
|
|
|
36
36
|
/* skip a file we can't restore */
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
if (files.length)
|
|
40
|
+
invalidateFileCandidates();
|
|
39
41
|
return { files };
|
|
40
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanhara/hara",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.121.0",
|
|
4
4
|
"description": "hara — a coding agent CLI that runs like an engineering org.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"hara": "dist/index.js"
|
|
@@ -70,5 +70,10 @@
|
|
|
70
70
|
"optionalDependencies": {
|
|
71
71
|
"@zvec/zvec": "^0.5.0",
|
|
72
72
|
"qrcode-terminal": "^0.12.0"
|
|
73
|
+
},
|
|
74
|
+
"overrides": {
|
|
75
|
+
"@larksuiteoapi/node-sdk": {
|
|
76
|
+
"axios": "1.18.1"
|
|
77
|
+
}
|
|
73
78
|
}
|
|
74
79
|
}
|