@xbghc/warden 0.5.0 → 0.6.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/README.md +18 -14
- package/dist/cli.js +1 -20
- package/dist/web/assets/index-Bi9N5cIP.js +197 -0
- package/dist/web/assets/index-pyKaNQqX.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-BRm8bZtC.css +0 -1
- package/dist/web/assets/index-CZMo0jXP.js +0 -194
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ with line comments you can copy back to the agent as a prompt.
|
|
|
14
14
|
- Comments follow the code: they move with a hunk that gets staged, re-attach after the agent edits the file, and are cleaned up once the change is committed.
|
|
15
15
|
- Auto-refresh — warden watches the repository and reloads itself when you edit, stage, commit or switch branches.
|
|
16
16
|
- Local issues (title, Markdown body, open/closed) that link comments.
|
|
17
|
-
- Branch-scoped todos,
|
|
17
|
+
- Branch-scoped todos, each copied to the clipboard on its own — one task at a time for the agent.
|
|
18
18
|
- Commit history browser: grouped by day, branch / tag labels, search by message, sha, author or
|
|
19
19
|
path (each a `git log` on the server, not a filter over the rows already loaded), and a
|
|
20
20
|
first-parent view that folds merged branches into their merge commits.
|
|
@@ -58,18 +58,25 @@ Several instances on the same repository can run at the same time.
|
|
|
58
58
|
Refs accept anything git can resolve (`main`, `v1.2`, `HEAD~3`, a sha). `@` is `HEAD`.
|
|
59
59
|
Worktrees are discovered with `git worktree list` and share the review state of the main repository.
|
|
60
60
|
|
|
61
|
+
There is no target switcher in the UI: the sidebar's two blocks *are* the working tree, a commit is
|
|
62
|
+
picked from the *Commits* panel, and the *Branch vs* and *Range* fields at the top of that panel open
|
|
63
|
+
the other two. The sidebar names whatever is under review in its block header and puts a
|
|
64
|
+
*返回工作区* link above it.
|
|
65
|
+
|
|
61
66
|
`working`, `staged` and `all` are the three **local views** of one worktree. While any of them is
|
|
62
67
|
selected the sidebar shows two blocks — Unstaged (`working`) and Staged (`staged`) — instead of a
|
|
63
68
|
single tree, and clicking a file switches to the view it belongs to. A file that is only partly
|
|
64
69
|
staged appears in both. Switching between the three keeps your comments, the draft you are typing
|
|
65
|
-
and the current selection; only the diff is reloaded.
|
|
70
|
+
and the current selection; only the diff is reloaded. `all` has no control of its own (a saved
|
|
71
|
+
`lastTarget` can still restore it; *Branch vs* `@` shows the same diff). Commit, range and `base`
|
|
72
|
+
targets keep the single tree.
|
|
66
73
|
|
|
67
74
|
`base:<ref>` is for a branch a coding agent has been working on, committing as it goes: one tree with
|
|
68
75
|
everything since the branch forked off `<ref>` — the commits plus whatever is still uncommitted or
|
|
69
76
|
untracked. The diff runs against the merge base, so commits that landed on `<ref>` after the fork are
|
|
70
|
-
not listed as reverted (which is what a plain `git diff <ref>` would do). The *Branch*
|
|
71
|
-
base for you — the main worktree's branch when a sibling worktree is under
|
|
72
|
-
`master` — and
|
|
77
|
+
not listed as reverted (which is what a plain `git diff <ref>` would do). The *Branch vs* field in the
|
|
78
|
+
Commits panel suggests the base for you — the main worktree's branch when a sibling worktree is under
|
|
79
|
+
review, otherwise `main` or `master` — and takes any ref. Unlike the three local views, `base` keeps its own
|
|
73
80
|
pool of comments and a commit never deletes them: the round under review is not over when the agent
|
|
74
81
|
commits, so a comment whose lines changed stays *orphaned*, snippet and all, until you have checked
|
|
75
82
|
the fix and delete or re-attach it.
|
|
@@ -161,19 +168,16 @@ Notes attached to a branch rather than to a line of code, for the things you not
|
|
|
161
168
|
that do not belong in a comment. They are not deleted when you commit. They sit in the right-hand
|
|
162
169
|
rail next to the comments, under the *Todo* tab: type a title and press Enter to add one, expand a
|
|
163
170
|
card to read or edit its Markdown body, filter by status, and switch between the current branch
|
|
164
|
-
and all branches
|
|
165
|
-
|
|
171
|
+
and all branches.
|
|
172
|
+
|
|
173
|
+
Each card has its own *复制* button, and there is deliberately no "copy all": a todo is one task to
|
|
174
|
+
hand to an agent, and the agent it goes to is already working in that branch. So the clipboard gets
|
|
175
|
+
the title and the body — no branch, repo, count or numbering:
|
|
166
176
|
|
|
167
177
|
```markdown
|
|
168
|
-
|
|
169
|
-
Branch: feature/x
|
|
170
|
-
Repo: /home/user/project
|
|
171
|
-
Count: 2
|
|
178
|
+
补充 OrderList 的空状态
|
|
172
179
|
|
|
173
|
-
## 1. 补充 OrderList 的空状态
|
|
174
180
|
描述正文(Markdown)…
|
|
175
|
-
|
|
176
|
-
## 2. useOrder 的依赖数组缺少 id
|
|
177
181
|
```
|
|
178
182
|
|
|
179
183
|
## nvim integration
|
package/dist/cli.js
CHANGED
|
@@ -3960,16 +3960,6 @@ function formatIssueExport({ repoRoot, issue, comments }) {
|
|
|
3960
3960
|
parts.push(...comments.map(formatCommentSection));
|
|
3961
3961
|
return parts.join("\n\n") + "\n";
|
|
3962
3962
|
}
|
|
3963
|
-
function formatTodosExport({ repoRoot, branch, todos }) {
|
|
3964
|
-
const head = ["# TODO", `Branch: ${branch}`, `Repo: ${repoRoot}`, `Count: ${todos.length}`];
|
|
3965
|
-
const sections = todos.map((t, i) => {
|
|
3966
|
-
const title = `## ${i + 1}. ${t.title}${t.status === "done" ? " (done)" : ""}`;
|
|
3967
|
-
const body = t.body.replace(/\r\n/g, "\n").trim();
|
|
3968
|
-
return body ? `${title}
|
|
3969
|
-
${body}` : title;
|
|
3970
|
-
});
|
|
3971
|
-
return [head.join("\n"), ...sections].join("\n\n") + "\n";
|
|
3972
|
-
}
|
|
3973
3963
|
|
|
3974
3964
|
// packages/server/src/nvim.ts
|
|
3975
3965
|
import os2 from "os";
|
|
@@ -4721,15 +4711,6 @@ function createApp(opts) {
|
|
|
4721
4711
|
});
|
|
4722
4712
|
return c.json(todo, 201);
|
|
4723
4713
|
});
|
|
4724
|
-
api.post("/todos/export", async (c) => {
|
|
4725
|
-
const body = await c.req.json();
|
|
4726
|
-
const branch = typeof body.branch === "string" ? body.branch.trim() : "";
|
|
4727
|
-
if (!branch) throw badRequest("branch is required");
|
|
4728
|
-
const s = await store.load();
|
|
4729
|
-
const todos = s.todos.filter((t) => t.branch === branch && (body.includeDone === true || t.status === "open"));
|
|
4730
|
-
const res = { text: formatTodosExport({ repoRoot: repo.root, branch, todos }), count: todos.length };
|
|
4731
|
-
return c.json(res);
|
|
4732
|
-
});
|
|
4733
4714
|
api.patch("/todos/:id", async (c) => {
|
|
4734
4715
|
const id = c.req.param("id");
|
|
4735
4716
|
const body = await c.req.json();
|
|
@@ -4978,7 +4959,7 @@ async function startServer(opts) {
|
|
|
4978
4959
|
}
|
|
4979
4960
|
|
|
4980
4961
|
// bin/cli.ts
|
|
4981
|
-
var VERSION = true ? "0.
|
|
4962
|
+
var VERSION = true ? "0.6.0" : "dev";
|
|
4982
4963
|
function parseArgs(argv) {
|
|
4983
4964
|
const args = { repoPath: process.cwd(), open: true, help: false, version: false };
|
|
4984
4965
|
for (let i = 0; i < argv.length; i++) {
|