align-agent 0.4.3__tar.gz → 0.4.4__tar.gz
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.
- {align_agent-0.4.3 → align_agent-0.4.4}/PKG-INFO +12 -11
- {align_agent-0.4.3 → align_agent-0.4.4}/README.md +11 -10
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/__init__.py +1 -1
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/cli.py +22 -1
- align_agent-0.4.4/align_agent/examples/teleport_control.json +10418 -0
- align_agent-0.4.4/align_agent/examples/teleport_diff.json +8586 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/mcp_server.py +1 -1
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/PKG-INFO +12 -11
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/SOURCES.txt +2 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/pyproject.toml +2 -1
- {align_agent-0.4.3 → align_agent-0.4.4}/LICENSE +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/common.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/deepswe.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/excerpts.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/extract.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/materialize.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/score.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/shellparse.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/tarsur.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/__init__.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/__init__.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/arms.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/completion.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/dependency_notice.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/freshness_hook.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/lean.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/mini_real.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/miniswe_scaffold.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/tail_diff.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/viewport.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/__init__.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/coherence.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/corruption_oracles.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/replay.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/statistics.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/verification.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/__init__.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/base_parser.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/file_events.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/miniswe_parser.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/openhands_parser.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/sweagent_parser.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/terminus_parser.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/core.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/run.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/sessions.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/__init__.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/__init__.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/__init__.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/harness/__init__.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/harness/dependency_notice.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/harness/lean.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/harness/tail_diff.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/harness/viewport.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/metrics/__init__.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/metrics/replay.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/parsers/__init__.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/parsers/file_events.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/claude_code.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/engine.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/hooks.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/protocol.py +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/dependency_links.txt +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/entry_points.txt +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/requires.txt +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/top_level.txt +0 -0
- {align_agent-0.4.3 → align_agent-0.4.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: align-agent
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: Find edits a coding agent made against a stale view of a file, and keep agents' views current with a write-through hook (Claude Code, any hook system, any MCP client, mini-swe-agent)
|
|
5
5
|
License: MIT License
|
|
6
6
|
|
|
@@ -51,11 +51,11 @@ engine uses only the standard library.
|
|
|
51
51
|
### 1. Install the commands
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
pipx install
|
|
54
|
+
pipx install align-agent # recommended: its own environment, commands on PATH
|
|
55
55
|
# or, in a virtual environment:
|
|
56
|
-
python3 -m venv ~/.align && ~/.align/bin/pip install
|
|
56
|
+
python3 -m venv ~/.align && ~/.align/bin/pip install align-agent
|
|
57
57
|
export PATH="$HOME/.align/bin:$PATH" # add this line to ~/.zshrc or ~/.bashrc
|
|
58
|
-
align-agent --version # prints: align-agent 0.4.
|
|
58
|
+
align-agent --version # prints: align-agent 0.4.4
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
If the shell says `command not found: align-agent`, the install folder is not on `PATH`: run
|
|
@@ -130,7 +130,7 @@ the command once and shows those lines. Nothing earlier in the conversation is r
|
|
|
130
130
|
prompt cache is kept.
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
|
-
pip install
|
|
133
|
+
pip install align-agent # the write-through engine itself uses only the standard library
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
| Agent | Set up |
|
|
@@ -151,21 +151,22 @@ deleted after each call, and sessions idle for 7 days are deleted (`ALIGN_KEEP_D
|
|
|
151
151
|
## Find stale edits in trajectories
|
|
152
152
|
|
|
153
153
|
```bash
|
|
154
|
-
pip install
|
|
155
|
-
align-agent analyze examples
|
|
154
|
+
pip install align-agent
|
|
155
|
+
align-agent analyze --examples # the two example trajectories bundled with the package
|
|
156
|
+
align-agent examples # where they are, to open or copy
|
|
156
157
|
```
|
|
157
158
|
|
|
158
159
|
Or, with nothing to install or build (image for amd64 and arm64, examples included):
|
|
159
160
|
|
|
160
161
|
```bash
|
|
161
|
-
docker run --rm ghcr.io/va24d/align-agent:0.4.
|
|
162
|
-
docker run --rm -v "$PWD:/work" ghcr.io/va24d/align-agent:0.4.
|
|
162
|
+
docker run --rm ghcr.io/va24d/align-agent:0.4.4 analyze /opt/align-agent/examples/teleport_control.json
|
|
163
|
+
docker run --rm -v "$PWD:/work" ghcr.io/va24d/align-agent:0.4.4 analyze /work/my_trajectories/
|
|
163
164
|
```
|
|
164
165
|
|
|
165
166
|
## `align-agent analyze`
|
|
166
167
|
|
|
167
168
|
```
|
|
168
|
-
align-agent analyze
|
|
169
|
+
align-agent analyze [PATH ...] [--examples] [--format F] [--cwd DIR] [--json OUT] [--quiet] [-j N]
|
|
169
170
|
```
|
|
170
171
|
|
|
171
172
|
Reads trajectory files, or directories of them. The format is detected:
|
|
@@ -206,7 +207,7 @@ align-agent run --repo DIR --task TEXT_OR_FILE --model NAME --base-url URL \
|
|
|
206
207
|
[--arm control|viewport|diff|lean|dependency] [--image IMAGE] [--out trajectory.json]
|
|
207
208
|
```
|
|
208
209
|
|
|
209
|
-
Needs the `[run]` extra: `pip install 'align-agent[run]
|
|
210
|
+
Needs the `[run]` extra: `pip install 'align-agent[run]'`. Runs mini-swe-agent 2.4.6 against any OpenAI-compatible endpoint. The API key is read from `$OPENAI_API_KEY`, or from the variable that `--api-key-env` names. After each command, the hook finds the files the command changed by content hash and appends one of these to that command's output:
|
|
210
211
|
|
|
211
212
|
- `viewport`: a numbered window around each change.
|
|
212
213
|
- `diff`: the net diff since the agent last saw the file.
|
|
@@ -14,11 +14,11 @@ engine uses only the standard library.
|
|
|
14
14
|
### 1. Install the commands
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
pipx install
|
|
17
|
+
pipx install align-agent # recommended: its own environment, commands on PATH
|
|
18
18
|
# or, in a virtual environment:
|
|
19
|
-
python3 -m venv ~/.align && ~/.align/bin/pip install
|
|
19
|
+
python3 -m venv ~/.align && ~/.align/bin/pip install align-agent
|
|
20
20
|
export PATH="$HOME/.align/bin:$PATH" # add this line to ~/.zshrc or ~/.bashrc
|
|
21
|
-
align-agent --version # prints: align-agent 0.4.
|
|
21
|
+
align-agent --version # prints: align-agent 0.4.4
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
If the shell says `command not found: align-agent`, the install folder is not on `PATH`: run
|
|
@@ -93,7 +93,7 @@ the command once and shows those lines. Nothing earlier in the conversation is r
|
|
|
93
93
|
prompt cache is kept.
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
|
-
pip install
|
|
96
|
+
pip install align-agent # the write-through engine itself uses only the standard library
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
| Agent | Set up |
|
|
@@ -114,21 +114,22 @@ deleted after each call, and sessions idle for 7 days are deleted (`ALIGN_KEEP_D
|
|
|
114
114
|
## Find stale edits in trajectories
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
|
-
pip install
|
|
118
|
-
align-agent analyze examples
|
|
117
|
+
pip install align-agent
|
|
118
|
+
align-agent analyze --examples # the two example trajectories bundled with the package
|
|
119
|
+
align-agent examples # where they are, to open or copy
|
|
119
120
|
```
|
|
120
121
|
|
|
121
122
|
Or, with nothing to install or build (image for amd64 and arm64, examples included):
|
|
122
123
|
|
|
123
124
|
```bash
|
|
124
|
-
docker run --rm ghcr.io/va24d/align-agent:0.4.
|
|
125
|
-
docker run --rm -v "$PWD:/work" ghcr.io/va24d/align-agent:0.4.
|
|
125
|
+
docker run --rm ghcr.io/va24d/align-agent:0.4.4 analyze /opt/align-agent/examples/teleport_control.json
|
|
126
|
+
docker run --rm -v "$PWD:/work" ghcr.io/va24d/align-agent:0.4.4 analyze /work/my_trajectories/
|
|
126
127
|
```
|
|
127
128
|
|
|
128
129
|
## `align-agent analyze`
|
|
129
130
|
|
|
130
131
|
```
|
|
131
|
-
align-agent analyze
|
|
132
|
+
align-agent analyze [PATH ...] [--examples] [--format F] [--cwd DIR] [--json OUT] [--quiet] [-j N]
|
|
132
133
|
```
|
|
133
134
|
|
|
134
135
|
Reads trajectory files, or directories of them. The format is detected:
|
|
@@ -169,7 +170,7 @@ align-agent run --repo DIR --task TEXT_OR_FILE --model NAME --base-url URL \
|
|
|
169
170
|
[--arm control|viewport|diff|lean|dependency] [--image IMAGE] [--out trajectory.json]
|
|
170
171
|
```
|
|
171
172
|
|
|
172
|
-
Needs the `[run]` extra: `pip install 'align-agent[run]
|
|
173
|
+
Needs the `[run]` extra: `pip install 'align-agent[run]'`. Runs mini-swe-agent 2.4.6 against any OpenAI-compatible endpoint. The API key is read from `$OPENAI_API_KEY`, or from the variable that `--api-key-env` names. After each command, the hook finds the files the command changed by content hash and appends one of these to that command's output:
|
|
173
174
|
|
|
174
175
|
- `viewport`: a numbered window around each change.
|
|
175
176
|
- `diff`: the net diff since the agent last saw the file.
|
|
@@ -11,6 +11,13 @@ from . import __version__
|
|
|
11
11
|
from .core import FORMATS, analyze, load, summarize
|
|
12
12
|
from .run import add_parser as add_run
|
|
13
13
|
|
|
14
|
+
EXAMPLES = os.path.join(os.path.dirname(os.path.abspath(__file__)), "examples")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def example_files():
|
|
18
|
+
"""The trajectories bundled with the package (two runs of one SWE-Bench Pro task)."""
|
|
19
|
+
return sorted(glob.glob(os.path.join(EXAMPLES, "*.json")))
|
|
20
|
+
|
|
14
21
|
|
|
15
22
|
def _files(paths):
|
|
16
23
|
for p in paths:
|
|
@@ -50,7 +57,18 @@ def _analyzed(args):
|
|
|
50
57
|
yield from pool.imap(_one, jobs, chunksize=8)
|
|
51
58
|
|
|
52
59
|
|
|
60
|
+
def cmd_examples(args):
|
|
61
|
+
for f in example_files():
|
|
62
|
+
print(f)
|
|
63
|
+
return 0
|
|
64
|
+
|
|
65
|
+
|
|
53
66
|
def cmd_analyze(args):
|
|
67
|
+
if args.examples:
|
|
68
|
+
args.paths = list(args.paths) + example_files()
|
|
69
|
+
if not args.paths:
|
|
70
|
+
print("align-agent analyze: give trajectory files or directories, or --examples", file=sys.stderr)
|
|
71
|
+
return 2
|
|
54
72
|
results, skipped, t0 = [], [], time.time()
|
|
55
73
|
for r, skip in _analyzed(args):
|
|
56
74
|
if skip:
|
|
@@ -85,13 +103,16 @@ def main(argv=None):
|
|
|
85
103
|
ap.add_argument("--version", action="version", version=f"align-agent {__version__}")
|
|
86
104
|
sub = ap.add_subparsers(dest="cmd", required=True)
|
|
87
105
|
a = sub.add_parser("analyze", help="find stale edits in trajectories")
|
|
88
|
-
a.add_argument("paths", nargs="
|
|
106
|
+
a.add_argument("paths", nargs="*", help="trajectory files or directories (searched for *.json and *.jsonl)")
|
|
107
|
+
a.add_argument("--examples", action="store_true", help="also analyze the example trajectories bundled with the package")
|
|
89
108
|
a.add_argument("--format", choices=sorted(FORMATS), help="skip format detection")
|
|
90
109
|
a.add_argument("--cwd", help="the agent's working directory, for resolving relative paths")
|
|
91
110
|
a.add_argument("--json", help="write per-edit results here")
|
|
92
111
|
a.add_argument("--quiet", action="store_true", help="print the summary only")
|
|
93
112
|
a.add_argument("-j", "--jobs", type=int, default=1, help="analyze this many files in parallel (default 1)")
|
|
94
113
|
a.set_defaults(fn=cmd_analyze)
|
|
114
|
+
e = sub.add_parser("examples", help="print the paths of the bundled example trajectories")
|
|
115
|
+
e.set_defaults(fn=cmd_examples)
|
|
95
116
|
add_run(sub)
|
|
96
117
|
args = ap.parse_args(argv)
|
|
97
118
|
return args.fn(args)
|