lavista 0.1.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/LICENSE +21 -0
- package/README.md +199 -0
- package/dist/cli.js +92176 -0
- package/dist/cli.js.LEGAL.txt +111 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 takuma-shishido
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<h1 align="center">lavista</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<b>Astra plans. Claude Code executes. Astra verifies.</b><br>
|
|
5
|
+
Write one goal, and lavista works through it stage by stage until its completion criteria are met.
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://github.com/takuma-shishido/lavista/actions/workflows/ci.yml"><img src="https://github.com/takuma-shishido/lavista/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
10
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a>
|
|
11
|
+
<img src="https://img.shields.io/badge/node-%3E%3D22.12-brightgreen.svg" alt="Node.js 22.12 or later">
|
|
12
|
+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-lightgrey.svg" alt="macOS and Linux">
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<img src="assets/demo.gif" width="800" alt="Running lavista start: the goal is written in vim, Astra plans a stage, Claude Code writes the code and runs the tests in the left pane, Astra verifies the result in the right pane, and the run ends as done">
|
|
17
|
+
</p>
|
|
18
|
+
<p align="center">
|
|
19
|
+
<sub>A real run, recorded with the agents' part sped up</sub>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
## What is lavista?
|
|
23
|
+
|
|
24
|
+
Hand Claude Code a large task in one go and it may stop halfway, or report "done" when it isn't. lavista splits the work between two agents to prevent that:
|
|
25
|
+
|
|
26
|
+
- **Astra** (Codex CLI) splits the goal into stages. After every step it reads Claude's log and the project, read-only, decides whether the stage's completion criteria are met, and writes the next instruction.
|
|
27
|
+
- **Claude Code** works on one stage at a time, each in a fresh session.
|
|
28
|
+
|
|
29
|
+
```mermaid
|
|
30
|
+
flowchart LR
|
|
31
|
+
goal([Goal and completion criteria]) --> plan[Astra<br>plans the stages]
|
|
32
|
+
plan --> work[Claude Code<br>works on one stage]
|
|
33
|
+
work --> review[Astra<br>checks logs and code]
|
|
34
|
+
review -- next stage --> work
|
|
35
|
+
review -- every stage done --> done([Done])
|
|
36
|
+
review -- needs a decision --> ask([Asks you])
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Features
|
|
40
|
+
|
|
41
|
+
- **Completion is judged on evidence**: Astra reads the tool calls, their results and the project itself instead of taking Claude's word for it.
|
|
42
|
+
- **A fresh session for every stage**: long conversations don't degrade the context, and the plan is revised after every review.
|
|
43
|
+
- **Side-by-side TUI**: both agents' thinking, tool calls, results and the current stage, live.
|
|
44
|
+
- **Permission prompts in place**: Claude runs in auto mode; only the actions that need your approval are asked in the TUI (<kbd>y</kbd> / <kbd>a</kbd> / <kbd>n</kbd>).
|
|
45
|
+
- **Stop and pick up again**: all state and logs are kept in `.lavista/runs/`. After an interruption, a failure or a usage limit, continue with `resume` or `retry`.
|
|
46
|
+
- **Parallel runs**: several runs can work in the same project at once; each agent is told what the others are doing and to keep clear of it.
|
|
47
|
+
|
|
48
|
+
> [!WARNING]
|
|
49
|
+
> Claude edits files and runs commands in the current directory on its own, in auto mode. Changes land in place, and lavista cannot undo them.
|
|
50
|
+
> - Run it in a git repository and commit first, or in a separate working copy such as a `git worktree`.
|
|
51
|
+
> - Do not run it where there are secrets or data you cannot afford to lose.
|
|
52
|
+
> - Claude and Codex usage is billed to your own accounts.
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
Install [Claude Code](https://docs.anthropic.com/en/docs/claude-code) and [Codex CLI](https://github.com/openai/codex) and log in to both. Node.js 22.12 or later is required.
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
npm install -g lavista
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
<details>
|
|
63
|
+
<summary>From source</summary>
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
git clone https://github.com/takuma-shishido/lavista.git
|
|
67
|
+
cd lavista
|
|
68
|
+
npm ci && npm run build && npm link
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
> [!NOTE]
|
|
74
|
+
> Tested with Claude Code 2.1.281 and codex-cli 0.153.4. lavista reads both CLIs' output formats, so a CLI update may break it.
|
|
75
|
+
|
|
76
|
+
## Quick start
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
cd /path/to/project
|
|
80
|
+
lavista start
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
1. Pick the models and efforts from a list (skipped for those set in the config or as flags).
|
|
84
|
+
2. Your editor opens (`$VISUAL`, then `$EDITOR`, then `vi`). Write the goal and its completion criteria, then save and quit to start. Quitting with it empty cancels.
|
|
85
|
+
3. Watch the TUI. <kbd>q</kbd> or <kbd>Ctrl</kbd>+<kbd>C</kbd> stops the run; press it again to kill the agents at once.
|
|
86
|
+
|
|
87
|
+
The goal is saved with the run's logs as `.lavista/runs/<run>/goal.md`. `.lavista/runs/` is git-ignored, so no task file is left in your working tree.
|
|
88
|
+
|
|
89
|
+
<details>
|
|
90
|
+
<summary>Example goal</summary>
|
|
91
|
+
|
|
92
|
+
The goal from the demo:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
Implement slugify(text) in src/slug.js.
|
|
96
|
+
- Lowercase the text and turn each run of non-alphanumeric characters into one hyphen
|
|
97
|
+
- Trim leading and trailing hyphens
|
|
98
|
+
Done when: test/slug.test.js covers these rules and npm test passes
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Astra splits the work into stages and judges completion from these criteria, so criteria it can check (tests pass, a command prints something) make the judgement reliable. You can write the goal in any language: Claude's instructions are written in English, and Astra explains its decisions in the language of your goal.
|
|
102
|
+
|
|
103
|
+
</details>
|
|
104
|
+
|
|
105
|
+
## Usage
|
|
106
|
+
|
|
107
|
+
### When Astra needs a decision
|
|
108
|
+
|
|
109
|
+
When the goal leaves open a choice Astra should not make for you, it asks instead of guessing. The run stops with the question; `lavista answer` opens your editor with the question shown below the line, and Astra decides again with your answer added to the goal.
|
|
110
|
+
|
|
111
|
+
<p align="center">
|
|
112
|
+
<img src="assets/question.gif" width="800" alt="A goal asks how slugify should treat accented letters; Astra stops before planning and asks whether Crème Brûlée should become creme-brulee or keep its accents; lavista answer opens vim with the question, the answer is typed, and Astra plans, Claude implements and Astra verifies until done">
|
|
113
|
+
</p>
|
|
114
|
+
|
|
115
|
+
### Commands
|
|
116
|
+
|
|
117
|
+
| Command | Description |
|
|
118
|
+
|---|---|
|
|
119
|
+
| `lavista start [file]` | Start a new run. With `file`, the editor starts from its text |
|
|
120
|
+
| `lavista status [run]` | Print the run's state and plan |
|
|
121
|
+
| `lavista resume [run]` | Continue a stopped run (e.g. after Astra failed or a usage limit) |
|
|
122
|
+
| `lavista retry [run]` | Retry a failed Claude step in a fresh session |
|
|
123
|
+
| `lavista review [run]` | Have Astra judge a saved Claude result |
|
|
124
|
+
| `lavista answer [run]` | Answer Astra's question (`needs_input`) in the editor and let it decide again |
|
|
125
|
+
|
|
126
|
+
`[run]` defaults to the latest run; `resume`, `retry`, `review` and `answer` skip runs another lavista is working on. A run stopped by a usage limit exits with code 75.
|
|
127
|
+
|
|
128
|
+
Off a terminal (pipes, CI) no editor can open, so the file given to `lavista start <file>` or `lavista answer --file <file>` is used as is.
|
|
129
|
+
|
|
130
|
+
### Permission prompts
|
|
131
|
+
|
|
132
|
+
Auto mode's classifier decides most actions. Only those that need your approval appear in the TUI, with a desktop notification on macOS.
|
|
133
|
+
|
|
134
|
+
| Key | Action |
|
|
135
|
+
|---|---|
|
|
136
|
+
| <kbd>y</kbd> | Allow this once |
|
|
137
|
+
| <kbd>a</kbd> | Allow matching actions for the rest of the run (the rule shown is saved with the run) |
|
|
138
|
+
| <kbd>n</kbd> | Deny |
|
|
139
|
+
|
|
140
|
+
<details>
|
|
141
|
+
<summary>Details</summary>
|
|
142
|
+
|
|
143
|
+
- Time spent waiting for your answer does not count toward `timeout`.
|
|
144
|
+
- Actions the classifier denies are denied on the spot, without a prompt. They are listed, and the step goes on to review.
|
|
145
|
+
- To allow an action every time, add a rule to `allowed_tools`.
|
|
146
|
+
- Off a terminal, every action that needs approval is denied.
|
|
147
|
+
|
|
148
|
+
</details>
|
|
149
|
+
|
|
150
|
+
### Background work
|
|
151
|
+
|
|
152
|
+
If Claude ends its turn while a build or other background job it started is still running, lavista keeps the session open until the job finishes (the TUI shows `waiting for background work`). Claude then continues in the same session, and the step ends once nothing is left running. This wait does not count toward `timeout`.
|
|
153
|
+
|
|
154
|
+
### Parallel runs
|
|
155
|
+
|
|
156
|
+
Running `lavista start` from another terminal in the same project starts a second run alongside the first. Each run's agents are given the other runs' goals and current stages and told to keep clear of that work. The working directory is shared, so give the runs goals that don't overlap.
|
|
157
|
+
|
|
158
|
+
## Configuration
|
|
159
|
+
|
|
160
|
+
Settings go in `.lavista/config.json` (shared) and `.lavista/config.local.json` (personal; takes precedence). For models and efforts, the `lavista start` flags (`--claude-model`, `--claude-effort`, `--astra-model`, `--astra-effort`) take precedence over both.
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"claude_model": "claude-opus-5-5",
|
|
165
|
+
"claude_effort": "high",
|
|
166
|
+
"astra_model": "gpt-6-astra",
|
|
167
|
+
"astra_effort": "xhigh",
|
|
168
|
+
"allowed_tools": "Bash(npm test)"
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
<details>
|
|
173
|
+
<summary>All settings</summary>
|
|
174
|
+
|
|
175
|
+
| Key | Default | Description |
|
|
176
|
+
|---|---|---|
|
|
177
|
+
| `claude_model` / `claude_effort` | picked from a list | Claude's model and effort. `""` uses the CLI's own setting |
|
|
178
|
+
| `astra_model` / `astra_effort` | picked from a list | Astra's model and effort. `""` uses the CLI's own setting |
|
|
179
|
+
| `allowed_tools` | `""` | Tool rules Claude may use without asking, e.g. `"Bash(npm test)"`. Rules approved with <kbd>a</kbd> are saved in the run's `approved_tools` and used as well |
|
|
180
|
+
| `max_iterations` | `20` | Maximum number of Claude steps |
|
|
181
|
+
| `timeout` | `1800` | Stop a CLI after this many seconds without output (waiting for you or for background work excluded) |
|
|
182
|
+
|
|
183
|
+
The chosen models and efforts are passed to each CLI as flags for that run only; `~/.claude` and `~/.codex/config.toml` are never changed.
|
|
184
|
+
|
|
185
|
+
</details>
|
|
186
|
+
|
|
187
|
+
## Development
|
|
188
|
+
|
|
189
|
+
```sh
|
|
190
|
+
npm run check # type check
|
|
191
|
+
npm test # tests
|
|
192
|
+
npm run build # bundle into dist/cli.js with esbuild
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The published package is a single bundled file with no runtime dependencies. lavista runs the `claude` and `codex` already on your `PATH`, so the Agent SDK's bundled Claude Code binaries are left out.
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
199
|
+
[MIT](LICENSE)
|