@astrosheep/keiyaku 0.1.77 → 0.1.79
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 +46 -38
- package/build/.tsbuildinfo +1 -1
- package/build/config/apply-argument-descriptions.js +1 -1
- package/build/config/base-rules.js +2 -1
- package/build/config/dotenv.js +2 -1
- package/build/config/settings.js +2 -7
- package/build/config/term-presets/default-preset.js +3 -4
- package/build/config/term-presets/resolver.js +0 -3
- package/build/errno.js +3 -0
- package/build/flow-error.js +2 -0
- package/build/generated/version.js +1 -1
- package/build/git/diff/constants.js +1 -0
- package/build/git/diff/filter.js +3 -18
- package/build/git/diff/parsers.js +149 -61
- package/build/git/diff/preview.js +16 -2
- package/build/git/diff/read.js +32 -20
- package/build/git/snapshot.js +5 -24
- package/build/git/worktree.js +5 -4
- package/build/mcp/server.js +61 -69
- package/build/protocol/draft-artifacts.js +2 -1
- package/build/protocol/file-guards.js +2 -1
- package/build/protocol/markdown/lex.js +52 -14
- package/build/protocol/markdown/normalization.js +3 -2
- package/build/protocol/markdown/parser.js +2 -2
- package/build/protocol/response-history.js +44 -5
- package/build/protocol/status-previews.js +20 -8
- package/build/protocol/summon-draft.js +3 -2
- package/build/protocol/summon-input.js +1 -0
- package/build/tools/amend/index.js +11 -21
- package/build/tools/ask/index.js +11 -18
- package/build/tools/ask/persist.js +60 -37
- package/build/tools/ask/run.js +15 -5
- package/build/tools/create-handler.js +31 -0
- package/build/tools/drive/index.js +11 -24
- package/build/tools/drive/run.js +9 -5
- package/build/tools/petition/claim-gates.js +24 -1
- package/build/tools/petition/claim.js +19 -2
- package/build/tools/petition/forfeit.js +4 -1
- package/build/tools/petition/index.js +43 -58
- package/build/tools/petition/run.js +12 -0
- package/build/tools/round/head-guard.js +10 -0
- package/build/tools/round/incremental-diff.js +6 -2
- package/build/tools/round/report.js +24 -2
- package/build/tools/round/run.js +6 -0
- package/build/tools/round/worktree.js +6 -2
- package/build/tools/status/index.js +11 -24
- package/build/tools/status/read.js +6 -4
- package/build/tools/summon/index.js +17 -27
- package/build/tools/summon/run.js +21 -18
- package/package.json +6 -6
- package/build/git/diff/stat.js +0 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Keiyaku
|
|
2
2
|
|
|
3
|
-
MCP server
|
|
3
|
+
MCP server. AI code changes run on an isolated branch. Tasks are written into the repo. Nothing closes without your sign-off.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install -g @astrosheep/keiyaku
|
|
@@ -8,17 +8,25 @@ npm install -g @astrosheep/keiyaku
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Before You Start
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Missing any of these? Don't come crying.
|
|
14
14
|
|
|
15
|
-
- **Git repo
|
|
16
|
-
- **MCP client
|
|
17
|
-
- **Subagent CLI
|
|
15
|
+
- **Git repo.** Clean worktree. Dirty = refused.
|
|
16
|
+
- **MCP client.** Claude Desktop, Claude Code, anything stdio.
|
|
17
|
+
- **Subagent CLI.** [`claude`](https://docs.anthropic.com/en/docs/claude-code), [`gemini`](https://github.com/google-gemini/gemini-cli), or [`codex`](https://github.com/openai/codex). Installed. Logged in. Keiyaku doesn't run code itself — it delegates everything to a subprocess. No CLI = nothing happens.
|
|
18
|
+
|
|
19
|
+
**Codex users, one extra step.** Codex clears env before spawning MCP servers. Add this to your `~/.codex/config.toml` or keiyaku won't know when it's running as a subagent:
|
|
20
|
+
|
|
21
|
+
```toml
|
|
22
|
+
[mcp_servers.keiyaku]
|
|
23
|
+
# ... rest of your config ...
|
|
24
|
+
env_vars = ["KEIYAKU_DISABLE_SUBAGENT_SPAWN"]
|
|
25
|
+
```
|
|
18
26
|
|
|
19
27
|
---
|
|
20
28
|
|
|
21
|
-
##
|
|
29
|
+
## Setup
|
|
22
30
|
|
|
23
31
|
Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
24
32
|
|
|
@@ -33,31 +41,31 @@ Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json
|
|
|
33
41
|
}
|
|
34
42
|
```
|
|
35
43
|
|
|
36
|
-
|
|
44
|
+
Restart client. Open a git repo. Run `status`. Done.
|
|
37
45
|
|
|
38
46
|
---
|
|
39
47
|
|
|
40
|
-
##
|
|
48
|
+
## Flow
|
|
41
49
|
|
|
42
50
|
```
|
|
43
|
-
ask (
|
|
51
|
+
ask (anytime) | summon → [drive | ask]* → petition
|
|
44
52
|
```
|
|
45
53
|
|
|
46
54
|
---
|
|
47
55
|
|
|
48
|
-
##
|
|
56
|
+
## Tools
|
|
49
57
|
|
|
50
|
-
**`ask`** —
|
|
58
|
+
**`ask`** — For questions. No branch, no contract. Use it freely.
|
|
51
59
|
|
|
52
60
|
```
|
|
53
|
-
retry
|
|
61
|
+
Where's the retry logic? Run the unit tests for that file.
|
|
54
62
|
```
|
|
55
63
|
|
|
56
64
|
---
|
|
57
65
|
|
|
58
|
-
**`summon`** —
|
|
66
|
+
**`summon`** — Opens a branch, writes the contract. Repo must be clean.
|
|
59
67
|
|
|
60
|
-
criteria
|
|
68
|
+
Vague criteria = vague results. Write "make it better" and don't blame anyone but yourself.
|
|
61
69
|
|
|
62
70
|
```
|
|
63
71
|
summon:
|
|
@@ -71,38 +79,38 @@ summon:
|
|
|
71
79
|
|
|
72
80
|
---
|
|
73
81
|
|
|
74
|
-
**`drive`** —
|
|
82
|
+
**`drive`** — Next round. Review the diff, say what's wrong, run another round.
|
|
75
83
|
|
|
76
84
|
```
|
|
77
|
-
Backoff
|
|
85
|
+
Backoff is 1.5x, should be 2x. Fix it, update the tests too.
|
|
78
86
|
```
|
|
79
87
|
|
|
80
88
|
---
|
|
81
89
|
|
|
82
|
-
**`petition`** —
|
|
90
|
+
**`petition`** — Close the task.
|
|
83
91
|
|
|
84
|
-
`CLAIM` =
|
|
92
|
+
`CLAIM` = verified, all criteria pass. `FORFEIT` = abandon, throw everything away.
|
|
85
93
|
|
|
86
|
-
|
|
94
|
+
Scores required (0–10). Oath required. The gates will actually reject you. Don't show up without checking.
|
|
87
95
|
|
|
88
96
|
---
|
|
89
97
|
|
|
90
|
-
**`status`** —
|
|
98
|
+
**`status`** — Current state and what's blocking you.
|
|
91
99
|
|
|
92
|
-
**`help`** —
|
|
100
|
+
**`help`** — Full reference.
|
|
93
101
|
|
|
94
102
|
---
|
|
95
103
|
|
|
96
|
-
##
|
|
104
|
+
## What Gets Written to the Repo
|
|
97
105
|
|
|
98
|
-
|
|
|
106
|
+
| File | |
|
|
99
107
|
|------|--|
|
|
100
|
-
| `KEIYAKU.md` |
|
|
101
|
-
| `KEIYAKU_TRACE.md` |
|
|
102
|
-
| `KEIYAKU.draft.md` | summon
|
|
103
|
-
| `.keiyaku/response/*.md` |
|
|
108
|
+
| `KEIYAKU.md` | Active contract |
|
|
109
|
+
| `KEIYAKU_TRACE.md` | Per-round log |
|
|
110
|
+
| `KEIYAKU.draft.md` | Recovery draft if summon fails |
|
|
111
|
+
| `.keiyaku/response/*.md` | Per-round output |
|
|
104
112
|
|
|
105
|
-
|
|
113
|
+
Don't want these tracked:
|
|
106
114
|
|
|
107
115
|
```gitignore
|
|
108
116
|
.keiyaku/draft/
|
|
@@ -111,22 +119,22 @@ Backoff 是 1.5x,应该 2x。改掉,test 也更新。
|
|
|
111
119
|
|
|
112
120
|
---
|
|
113
121
|
|
|
114
|
-
##
|
|
122
|
+
## Advanced
|
|
115
123
|
|
|
116
124
|
```bash
|
|
117
125
|
keiyaku dump-env
|
|
118
126
|
```
|
|
119
127
|
|
|
120
|
-
|
|
|
121
|
-
|
|
122
|
-
| `KEIYAKU_MCP_TRANSPORT` | `stdio` | `stdio`
|
|
123
|
-
| `KEIYAKU_MCP_HTTP_PORT` | `3000` | HTTP
|
|
124
|
-
| `KEIYAKU_SUBAGENT_EXEC_TIMEOUT_MS` | — |
|
|
125
|
-
| `KEIYAKU_SUBAGENT_EXEC_IDLE_TIMEOUT_MS` | — |
|
|
128
|
+
| Variable | Default | |
|
|
129
|
+
|----------|---------|--|
|
|
130
|
+
| `KEIYAKU_MCP_TRANSPORT` | `stdio` | `stdio` or `streamable-http` |
|
|
131
|
+
| `KEIYAKU_MCP_HTTP_PORT` | `3000` | HTTP port |
|
|
132
|
+
| `KEIYAKU_SUBAGENT_EXEC_TIMEOUT_MS` | — | Execution timeout |
|
|
133
|
+
| `KEIYAKU_SUBAGENT_EXEC_IDLE_TIMEOUT_MS` | — | Idle timeout |
|
|
126
134
|
| `KEIYAKU_INCREMENTAL_DIFF_MODE` | `targeted` | `targeted` \| `stat` \| `unified` |
|
|
127
|
-
| `KEIYAKU_FAKE_SUBAGENT` | `0` | `1` =
|
|
135
|
+
| `KEIYAKU_FAKE_SUBAGENT` | `0` | `1` = test stub |
|
|
128
136
|
|
|
129
|
-
HTTP transport
|
|
137
|
+
HTTP transport:
|
|
130
138
|
|
|
131
139
|
```bash
|
|
132
140
|
KEIYAKU_MCP_TRANSPORT=streamable-http \
|