ur-agent 1.22.1 → 1.22.2
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 +26 -0
- package/README.md +17 -3
- package/dist/cli.js +3313 -2702
- package/docs/AGENT_FEATURES.md +7 -0
- package/docs/USAGE.md +49 -1
- package/documentation/index.html +1 -1
- package/extensions/vscode-ur-inline-diffs/package.json +1 -1
- package/package.json +1 -1
package/docs/AGENT_FEATURES.md
CHANGED
|
@@ -59,6 +59,13 @@ ur spec run auth-refactor --all
|
|
|
59
59
|
ur spec verify auth-refactor
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
## v1.22.2 Additions
|
|
63
|
+
|
|
64
|
+
| Addition | Surface | What it adds |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| Lifecycle hooks | `.ur/hooks.json`, `UR.md` frontmatter, `src/utils/hooks.ts` | New hook events `BeforeEdit`, `AfterEdit`, `BeforeCommand`, `AfterCommand`, `BeforeCommit`, and `OnFailure`. Fire around file edits, shell commands, git commits, and failures. Advisory by default; can block actions or write project memory. |
|
|
67
|
+
| Persistent project memory | `ur context-pack remember`, `src/services/context/projectContextManifest.ts` | New memory kinds `architecture`, `preference`, `attempt`, `accepted`, and `rejected` with status, rationale, scope, and source metadata. Stored in `.ur/context/task-memory.jsonl` and surfaced in the compressed context summary. |
|
|
68
|
+
|
|
62
69
|
## v1.22.0 Additions
|
|
63
70
|
|
|
64
71
|
| Addition | Surface | What it adds |
|
package/docs/USAGE.md
CHANGED
|
@@ -100,6 +100,53 @@ ur context-pack remember --decision "Use package scripts before ad hoc commands"
|
|
|
100
100
|
ur context-pack compress
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
+
## Project memory
|
|
104
|
+
|
|
105
|
+
`ur context-pack remember` stores durable project memory in `.ur/context/task-memory.jsonl`. Use it to record decisions, constraints, preferred commands, failed attempts, accepted patterns, rejected approaches, and architecture notes. The compressed summary in `.ur/context/compressed.md` is included in agent context.
|
|
106
|
+
|
|
107
|
+
Memory kinds:
|
|
108
|
+
|
|
109
|
+
- `decision`, `constraint`, `command`, `diff`, `note` — original task memory categories.
|
|
110
|
+
- `architecture` — architecture decisions and design rationale.
|
|
111
|
+
- `preference` — preferred commands, tools, or workflows.
|
|
112
|
+
- `attempt` — things you tried that did not work out (often written by `OnFailure` hooks).
|
|
113
|
+
- `accepted` — patterns or approaches that worked and should be reused.
|
|
114
|
+
- `rejected` — approaches that should not be repeated, optionally with an `alternative-to`.
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
ur context-pack remember --architecture "Repository pattern for data access" --status accepted --rationale "Testability"
|
|
118
|
+
ur context-pack remember --preference "Use bun test over jest"
|
|
119
|
+
ur context-pack remember --accepted "Use p-map for bounded concurrency" --scope project
|
|
120
|
+
ur context-pack remember --rejected "Switch to esbuild" --alternative-to "Keep bun bundle"
|
|
121
|
+
ur context-pack remember --attempt "Tried Deno runtime" --status superseded
|
|
122
|
+
ur context-pack compress
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Lifecycle hooks
|
|
126
|
+
|
|
127
|
+
UR supports lifecycle hook events that fire around agent actions. Hooks are configured in `.ur/hooks.json` or `UR.md` frontmatter and receive JSON payloads.
|
|
128
|
+
|
|
129
|
+
| Event | Fires | Payload |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| `BeforeEdit` | Before `FileEditTool` writes a file. | `file_path`, `old_string`, `new_string`, `replace_all`, `tool_use_id` |
|
|
132
|
+
| `AfterEdit` | After a file edit succeeds. | Same as `BeforeEdit` plus `success: true`. Can write project memory. |
|
|
133
|
+
| `BeforeCommand` | Before a Bash/PowerShell command runs. | `command`, `shell_type`, `cwd`, `timeout_ms`, `sandbox`, `tool_use_id` |
|
|
134
|
+
| `AfterCommand` | After a command finishes. | `command`, `exit_code`, `stdout`, `stderr`, `tool_use_id` |
|
|
135
|
+
| `BeforeCommit` | After a successful `git commit` command. | `command`, `message`, `files`, `tool_use_id` |
|
|
136
|
+
| `OnFailure` | When a tool, turn, or API call fails. | `error`, `stage`, `tool_name`, `tool_use_id` |
|
|
137
|
+
|
|
138
|
+
Example `UR.md` frontmatter hook:
|
|
139
|
+
|
|
140
|
+
```yaml
|
|
141
|
+
---
|
|
142
|
+
hooks:
|
|
143
|
+
- event: BeforeCommit
|
|
144
|
+
command: 'echo "Commit detected: $UR_CODE_HOOK_INPUT" >> /tmp/ur-commits.log'
|
|
145
|
+
---
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Hooks are advisory by default. A `BeforeEdit`/`BeforeCommand`/`BeforeCommit` hook can block the action by returning `{"decision":"block","reason":"..."}` or exit code 2. `AfterEdit` and `OnFailure` hooks can return `{"hookSpecificOutput":{"hookEventName":"...","memory":{"kind":"accepted","text":"..."}}}` to append project memory automatically.
|
|
149
|
+
|
|
103
150
|
## Commands
|
|
104
151
|
|
|
105
152
|
UR includes slash commands and CLI subcommands for common workflows:
|
|
@@ -113,7 +160,7 @@ UR includes slash commands and CLI subcommands for common workflows:
|
|
|
113
160
|
- `ur bg ...` to run detached local background agents with optional worktrees and PRs
|
|
114
161
|
- `ur repo-edit ...` to index the repo, plan AST-aware renames, preview patches, and apply with rollback
|
|
115
162
|
- `ur safety ...` to inspect project shell safety policy and preview command risk
|
|
116
|
-
- `ur context-pack ...` to summarize architecture and persist
|
|
163
|
+
- `ur context-pack ...` to summarize architecture and persist project memory (decisions, constraints, commands, diffs, architecture, preferences, attempts, accepted, rejected)
|
|
117
164
|
- `ur code-index watch` to keep the local semantic code index fresh
|
|
118
165
|
- `ur memory retention ...` to prune project-local memory by TTL, max entries, and decay
|
|
119
166
|
- `ur spec ...` to scaffold requirements, design, and tasks, run a spec task list, and verify with strict proof gates
|
|
@@ -155,6 +202,7 @@ ur safety status
|
|
|
155
202
|
ur safety check --command "rm -rf build"
|
|
156
203
|
ur context-pack scan
|
|
157
204
|
ur context-pack remember --constraint "Run command evidence before claiming success"
|
|
205
|
+
ur context-pack remember --accepted "Use p-map for concurrency" --scope project
|
|
158
206
|
ur context-pack compress
|
|
159
207
|
ur acp serve --port 8123
|
|
160
208
|
ur exec "add tests for the parser" --concurrency 4 --json
|
package/documentation/index.html
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<main id="content" class="content">
|
|
44
44
|
<header class="topbar">
|
|
45
45
|
<div>
|
|
46
|
-
<p class="eyebrow">Version 1.22.
|
|
46
|
+
<p class="eyebrow">Version 1.22.2</p>
|
|
47
47
|
<h1>UR Agent Documentation</h1>
|
|
48
48
|
<p class="lead">A practical, tutorial-style reference for installing, configuring, automating, extending, and operating UR Agent.</p>
|
|
49
49
|
</div>
|