ur-agent 1.28.1 → 1.30.1
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 +47 -0
- package/README.md +79 -11
- package/dist/cli.js +1755 -1029
- package/docs/ACP.md +85 -0
- package/docs/IDE.md +77 -0
- package/docs/USAGE.md +1 -1
- package/docs/plugins.md +77 -0
- package/docs/providers.md +5 -1
- package/documentation/index.html +2 -2
- package/extensions/vscode-ur-inline-diffs/extension.js +87 -0
- package/extensions/vscode-ur-inline-diffs/package.json +34 -4
- package/package.json +1 -1
package/docs/ACP.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Agent Communication / Client Protocol (ACP)
|
|
2
|
+
|
|
3
|
+
UR exposes two ACP surfaces:
|
|
4
|
+
|
|
5
|
+
1. **Stdio ACP agent** (`ur acp stdio`) — newline-delimited JSON-RPC over stdio,
|
|
6
|
+
the protocol Zed and ACP-capable editors speak. Use this for native editor
|
|
7
|
+
integration.
|
|
8
|
+
2. **HTTP JSON-RPC server** (`ur acp serve`) — a loopback HTTP endpoint for
|
|
9
|
+
scripting, task delegation, and custom clients. This is **not** Zed-style
|
|
10
|
+
stdio ACP; use the stdio agent for native ACP editors.
|
|
11
|
+
|
|
12
|
+
## Stdio ACP agent
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
ur acp stdio
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The editor launches this process and exchanges one JSON-RPC object per line.
|
|
19
|
+
|
|
20
|
+
Methods:
|
|
21
|
+
|
|
22
|
+
| Method | Direction | Result |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `initialize` | client → agent | `{ protocolVersion, agentCapabilities, authMethods }` |
|
|
25
|
+
| `authenticate` | client → agent | `{}` (no auth required for local stdio) |
|
|
26
|
+
| `session/new` | client → agent | `{ sessionId }` |
|
|
27
|
+
| `session/prompt` | client → agent | `{ stopReason }`, with streaming `session/update` notifications |
|
|
28
|
+
| `session/cancel` | client → agent (notification) | aborts the in-flight prompt |
|
|
29
|
+
| `shutdown` | client → agent | `null` |
|
|
30
|
+
|
|
31
|
+
During `session/prompt` the agent emits `session/update` notifications:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{ "jsonrpc": "2.0", "method": "session/update",
|
|
35
|
+
"params": { "sessionId": "sess_…",
|
|
36
|
+
"update": { "sessionUpdate": "agent_message_chunk",
|
|
37
|
+
"content": { "type": "text", "text": "…" } } } }
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`session/prompt` resolves with `{ "stopReason": "end_turn" }` (or `"cancelled"`
|
|
41
|
+
if a `session/cancel` arrived). Configure it with `ur ide config zed`.
|
|
42
|
+
|
|
43
|
+
## HTTP JSON-RPC server
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
ur acp serve --host 127.0.0.1 --port 8123 [--token <secret>] [--debug]
|
|
47
|
+
ur acp status [--json]
|
|
48
|
+
ur acp stop
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Binds to loopback only; binding off-loopback requires `--token`. `--debug` logs
|
|
52
|
+
each method and outcome to stderr. POST JSON-RPC to `/acp`; `GET /healthz`
|
|
53
|
+
returns `{ ok: true }`.
|
|
54
|
+
|
|
55
|
+
Methods: `initialize` (returns `capabilities` and `workspaceRoot`),
|
|
56
|
+
`session/new`, `session/prompt`, `session/cancel`, `tools/list`, `tools/call`,
|
|
57
|
+
`tasks/send` / `tasks/get` / `tasks/cancel`, `ide/diffCapture`, `ide/select`,
|
|
58
|
+
and `shutdown` (acknowledges, then stops the server).
|
|
59
|
+
|
|
60
|
+
Example:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
curl -s http://127.0.0.1:8123/acp \
|
|
64
|
+
-H 'content-type: application/json' \
|
|
65
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"initialize"}'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{ "jsonrpc": "2.0", "id": 1,
|
|
70
|
+
"result": { "name": "ur-agent", "protocolVersion": "0.1.0",
|
|
71
|
+
"workspaceRoot": "/path/to/project",
|
|
72
|
+
"capabilities": { "tools": true, "tasks": true, "sessions": true,
|
|
73
|
+
"ide": true, "streaming": false, "cancellation": true } } }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Capabilities and limitations
|
|
77
|
+
|
|
78
|
+
- The stdio agent streams via `session/update`; token-level granularity depends
|
|
79
|
+
on the active provider.
|
|
80
|
+
- The HTTP server returns unary responses (`streaming: false`); use the stdio
|
|
81
|
+
agent for incremental updates.
|
|
82
|
+
- Neither surface silently falls back to another provider; dispatch failures are
|
|
83
|
+
reported with the selected provider, model, and runtime backend.
|
|
84
|
+
- Errors use JSON-RPC error objects (`-32601` method not found, `-32602` bad
|
|
85
|
+
params, `-32001` unauthorized, `-32603` internal).
|
package/docs/IDE.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# IDE Integration
|
|
2
|
+
|
|
3
|
+
UR integrates with editors through three mechanisms, chosen per editor and stated
|
|
4
|
+
honestly — nothing claims support it does not have:
|
|
5
|
+
|
|
6
|
+
- **Native extension** — a UR extension/plugin runs inside the editor (VS Code
|
|
7
|
+
family, JetBrains). UR connects to it via the `/ide` flow.
|
|
8
|
+
- **Stdio ACP** — the editor launches UR as an [Agent Client Protocol](ACP.md)
|
|
9
|
+
agent over stdio (`ur acp stdio`). Used by Zed and ACP-capable Neovim clients.
|
|
10
|
+
- **Manual** — no auto-config; install a plugin and connect via `/ide`.
|
|
11
|
+
|
|
12
|
+
## Supported targets
|
|
13
|
+
|
|
14
|
+
| Editor | Mechanism | Auto config | Apply/reject | Notes |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| VS Code | native extension | `.vscode/settings.json` | via UR extension | Install the UR Inline Diffs extension. |
|
|
17
|
+
| Cursor | native extension (VS Code fork) | `.vscode/settings.json` | via UR extension | Same extension as VS Code. |
|
|
18
|
+
| Windsurf | native extension (VS Code fork) | `.vscode/settings.json` | via UR extension | Same extension as VS Code. |
|
|
19
|
+
| Zed | stdio ACP | `.zed/settings.json` | in-editor (ACP) | Real Agent Client Protocol over stdio. |
|
|
20
|
+
| JetBrains | manual plugin | none | via plugin | Install the UR JetBrains plugin, then `/ide`. |
|
|
21
|
+
| Neovim | stdio ACP | snippet | client-dependent | Requires a third-party ACP client plugin. |
|
|
22
|
+
| Generic ACP | stdio ACP / HTTP | snippet | client-dependent | `ur acp stdio` (native ACP) or `ur acp serve` (HTTP JSON-RPC). |
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
ur ide status # workspace, ACP server, provider/model, plugin count, warnings
|
|
28
|
+
ur ide doctor # pass/warn/fail checks; reports missing config clearly
|
|
29
|
+
ur ide config <editor> # print setup + config snippet for the chosen editor
|
|
30
|
+
ur ide open # open the current project/worktree in a detected IDE
|
|
31
|
+
ur ide diff capture # capture the current diff as a review bundle
|
|
32
|
+
ur ide diff list|show <id> # inspect captured bundles
|
|
33
|
+
ur ide diff approve|reject <id>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`ur ide config` targets: `vscode`, `cursor`, `windsurf`, `zed`, `jetbrains`,
|
|
37
|
+
`neovim`, `generic-acp` (aliases like `nvim`, `intellij`, `code` also resolve).
|
|
38
|
+
|
|
39
|
+
`ur ide status` reports the active workspace, whether the ACP server is running
|
|
40
|
+
and on which port, the active provider/model and runtime backend, the number of
|
|
41
|
+
loaded plugins, and any warnings. Add `--json` for machine-readable output.
|
|
42
|
+
|
|
43
|
+
## Patch / diff workflow
|
|
44
|
+
|
|
45
|
+
UR never writes to your files silently. Proposed changes are captured as bundles
|
|
46
|
+
under `.ur/ide/diffs/` (`ur ide diff capture`), then previewed and explicitly
|
|
47
|
+
applied or rejected:
|
|
48
|
+
|
|
49
|
+
- **CLI:** `ur ide diff show <id>`, `ur ide diff approve <id>`, `ur ide diff reject <id>`.
|
|
50
|
+
- **VS Code:** the UR Inline Diffs view lists bundles; right-click a bundle to
|
|
51
|
+
Open (preview), Apply (`git apply`, with a confirmation prompt), Reject, or
|
|
52
|
+
Comment. Applying is always an explicit, confirmed action.
|
|
53
|
+
|
|
54
|
+
## VS Code extension
|
|
55
|
+
|
|
56
|
+
The bundled `UR Inline Diffs` extension (`extensions/vscode-ur-inline-diffs`)
|
|
57
|
+
provides:
|
|
58
|
+
|
|
59
|
+
- a tree view of captured diff bundles;
|
|
60
|
+
- a read-only webview preview of each patch and its comments;
|
|
61
|
+
- **Apply** (confirmed `git apply`) and **Reject** actions;
|
|
62
|
+
- **UR: Show Status**, which runs `ur ide status` and prints provider/model and
|
|
63
|
+
plugin information to the UR output channel.
|
|
64
|
+
|
|
65
|
+
Install it with `ur ide install` (offers the bundled VSIX) or from the packaged
|
|
66
|
+
`.vsix`. Apply/reject and status require the UR CLI on your `PATH`.
|
|
67
|
+
|
|
68
|
+
## Troubleshooting
|
|
69
|
+
|
|
70
|
+
- **`ur ide status` shows "ACP server: not running":** start it with
|
|
71
|
+
`ur acp serve` (HTTP) or `ur acp stdio` (for ACP editors).
|
|
72
|
+
- **No IDE detected:** ensure the editor is running with the UR extension/plugin
|
|
73
|
+
installed, or generate config with `ur ide config <editor>`.
|
|
74
|
+
- **Zed doesn't see UR:** confirm `.zed/settings.json` contains the
|
|
75
|
+
`agent_servers.UR` block from `ur ide config zed`, then reload Zed.
|
|
76
|
+
- **Apply fails in VS Code:** the patch may not match the current tree; re-capture
|
|
77
|
+
with `ur ide diff capture`.
|
package/docs/USAGE.md
CHANGED
|
@@ -246,7 +246,7 @@ Interactive sessions include a compact bottom status bar when stdout is a real
|
|
|
246
246
|
terminal:
|
|
247
247
|
|
|
248
248
|
```text
|
|
249
|
-
UR-AGENT v1.
|
|
249
|
+
UR-AGENT v1.30.1 | Provider: Codex CLI | Auth: subscription | model: codex/gpt-5.5 | mode: ask | branch: main | tasks: idle | Update: 1.30.0 -> 1.30.1 available
|
|
250
250
|
```
|
|
251
251
|
|
|
252
252
|
The bar is not rendered in non-interactive mode, CI, dumb terminals, or
|
package/docs/plugins.md
CHANGED
|
@@ -50,3 +50,80 @@ ur --plugin-dir ./plugins/community/my-plugin
|
|
|
50
50
|
|
|
51
51
|
Plugins are loaded from local UR-AGENT paths first. Network marketplace installs
|
|
52
52
|
remain explicit user actions and are subject to plugin policy checks.
|
|
53
|
+
|
|
54
|
+
## Manifest reference
|
|
55
|
+
|
|
56
|
+
A plugin is a directory containing `.ur-plugin/plugin.json`. UR uses a
|
|
57
|
+
**declarative component model** — a manifest points at markdown/JSON components
|
|
58
|
+
rather than a JS entry point.
|
|
59
|
+
|
|
60
|
+
| Field | Type | Purpose |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| `name` | string (required) | Unique plugin id. |
|
|
63
|
+
| `version` | string | Semver; recommended for updates. |
|
|
64
|
+
| `description` | string | Shown in `ur plugin list`. |
|
|
65
|
+
| `author` | object | `{ name, url, email }`. |
|
|
66
|
+
| `commands` | string \| string[] \| object | Path(s) to markdown commands. |
|
|
67
|
+
| `agents` | string \| string[] | Path(s) to agent definitions. |
|
|
68
|
+
| `skills` | string \| string[] | Path(s) to `SKILL.md` skills. |
|
|
69
|
+
| `templates` | string \| string[] | Path(s) to templates. |
|
|
70
|
+
| `validators` | string \| string[] | Path(s) to JSON validators. |
|
|
71
|
+
| `outputStyles` | string \| string[] | Path(s) to output styles. |
|
|
72
|
+
| `hooks` | object | Lifecycle hooks (see below). |
|
|
73
|
+
| `mcpServers` | object | MCP servers the plugin registers. |
|
|
74
|
+
| `lspServers` | object | LSP servers for language adapters. |
|
|
75
|
+
| `languageAdapters` | object | Language → engine/LSP metadata. |
|
|
76
|
+
| `dependencies` | object | Other plugins that must be enabled. |
|
|
77
|
+
|
|
78
|
+
Validate a manifest strictly at any time:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
ur plugin validate <path-to-plugin-or-manifest>
|
|
82
|
+
ur plugin doctor # validate all installed/project/bundled plugins
|
|
83
|
+
ur plugin doctor --path plugins/core --json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`ur plugin doctor` reports, per plugin, whether the manifest is valid, its
|
|
87
|
+
version, the declared components, and the **capability surface** it touches
|
|
88
|
+
(commands, skills, templates, validators, hooks, mcpServers, lspServers,
|
|
89
|
+
languageAdapters). A broken plugin is reported but never crashes the scan or UR.
|
|
90
|
+
|
|
91
|
+
## Hooks
|
|
92
|
+
|
|
93
|
+
Hooks run on lifecycle events and are ordered, isolated, and load-error safe:
|
|
94
|
+
`BeforeEdit`, `AfterEdit`, `BeforeCommand`, `AfterCommand`, `BeforeCommit`, and
|
|
95
|
+
`OnFailure`. Declare them under `hooks` in the manifest. A hook failure is
|
|
96
|
+
isolated to that plugin.
|
|
97
|
+
|
|
98
|
+
## Plugin commands
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
ur plugin list [--json] # installed plugins
|
|
102
|
+
ur plugin doctor [--json] # validate manifests + capability report
|
|
103
|
+
ur plugin validate <path> # validate a single manifest
|
|
104
|
+
ur plugin install <name> # install from a marketplace
|
|
105
|
+
ur plugin enable <name> # enable an installed plugin
|
|
106
|
+
ur plugin disable <name> # disable (not loaded until re-enabled)
|
|
107
|
+
ur plugin uninstall <name>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Disabled plugins are not loaded. Enable/disable state persists in user settings.
|
|
111
|
+
|
|
112
|
+
## Permissions
|
|
113
|
+
|
|
114
|
+
UR's declarative model grants only what a plugin declares. Components run in the
|
|
115
|
+
same trust model as the CLI: commands/skills/templates are content, MCP and LSP
|
|
116
|
+
servers are launched only when the plugin is enabled, and network marketplace
|
|
117
|
+
installs are always explicit user actions gated by plugin policy. `ur plugin
|
|
118
|
+
doctor` surfaces the capability surface so you can review what a plugin touches
|
|
119
|
+
before enabling it.
|
|
120
|
+
|
|
121
|
+
## Troubleshooting
|
|
122
|
+
|
|
123
|
+
- **Plugin not loaded:** run `ur plugin list` to confirm it is installed and
|
|
124
|
+
enabled; `ur plugin doctor` to confirm the manifest validates.
|
|
125
|
+
- **Manifest rejected:** `ur plugin doctor` prints the exact schema errors
|
|
126
|
+
(field path + message).
|
|
127
|
+
- **Command not found after install:** ensure the manifest `commands` path
|
|
128
|
+
points at existing markdown files; re-run `ur plugin doctor`.
|
|
129
|
+
|
package/docs/providers.md
CHANGED
|
@@ -158,7 +158,7 @@ ur config set provider anthropic-api
|
|
|
158
158
|
|
|
159
159
|
| Provider type | Model discovery | Source label |
|
|
160
160
|
| --- | --- | --- |
|
|
161
|
-
| Subscription CLI (codex-cli, claude-code-cli, gemini-cli, antigravity-cli) | Static list of provider-
|
|
161
|
+
| Subscription CLI (codex-cli, claude-code-cli, gemini-cli, antigravity-cli) | Static list of provider-scoped CLI model aliases/names | static |
|
|
162
162
|
| API providers (openai-api, anthropic-api, gemini-api, openrouter) | Static list of provider-specific models | static |
|
|
163
163
|
| Local/server providers (ollama, lmstudio, llama.cpp, vllm) | Dynamic discovery from the selected provider endpoint | live |
|
|
164
164
|
| OpenAI-compatible | Dynamic discovery from configured endpoint | live |
|
|
@@ -211,6 +211,10 @@ Warning: Current model "gpt-5.5" is not available for provider "anthropic-api" a
|
|
|
211
211
|
After changing provider, run /model or: ur config set model claude-sonnet-5
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
+
For subscription CLIs, UR stores scoped IDs such as `claude-code/sonnet` and
|
|
215
|
+
passes only the CLI model name (`sonnet`) to the official command. Stale scoped
|
|
216
|
+
IDs such as `claude-code/sonnet-5` are rejected before runtime dispatch.
|
|
217
|
+
|
|
214
218
|
### Troubleshooting
|
|
215
219
|
|
|
216
220
|
**Check active provider and model:**
|
package/documentation/index.html
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<main id="content" class="content">
|
|
45
45
|
<header class="topbar">
|
|
46
46
|
<div>
|
|
47
|
-
<p class="eyebrow">Version 1.
|
|
47
|
+
<p class="eyebrow">Version 1.30.1</p>
|
|
48
48
|
<h1>UR-AGENT Documentation</h1>
|
|
49
49
|
<p class="lead">A practical, tutorial-style reference for installing, configuring, automating, extending, and operating UR-AGENT.</p>
|
|
50
50
|
</div>
|
|
@@ -159,7 +159,7 @@ ur config set provider.fallback ollama</code></pre>
|
|
|
159
159
|
</article>
|
|
160
160
|
<article>
|
|
161
161
|
<h3>Status bar and updates</h3>
|
|
162
|
-
<pre><code>UR-AGENT v1.
|
|
162
|
+
<pre><code>UR-AGENT v1.30.1 | Provider: Codex CLI | Auth: subscription | model: codex/gpt-5.5 | mode: ask | branch: main | tasks: idle | Update: 1.30.0 -> 1.30.1 available</code></pre>
|
|
163
163
|
<p>The interactive status bar shows provider, auth mode, model, branch, task state, checks status when known, and update availability. It is hidden in CI, dumb terminals, and non-interactive mode.</p>
|
|
164
164
|
</article>
|
|
165
165
|
</div>
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
const fs = require('node:fs')
|
|
2
2
|
const path = require('node:path')
|
|
3
|
+
const { execFile } = require('node:child_process')
|
|
4
|
+
const { promisify } = require('node:util')
|
|
3
5
|
const vscode = require('vscode')
|
|
4
6
|
|
|
7
|
+
const execFileAsync = promisify(execFile)
|
|
8
|
+
|
|
5
9
|
function workspaceRoot() {
|
|
6
10
|
return vscode.workspace.workspaceFolders?.[0]?.uri.fsPath
|
|
7
11
|
}
|
|
@@ -171,13 +175,96 @@ async function commentDiff(item, provider) {
|
|
|
171
175
|
vscode.window.showInformationMessage(`Added UR comment to ${bundle.id}.`)
|
|
172
176
|
}
|
|
173
177
|
|
|
178
|
+
function setBundleStatus(root, bundleId, status) {
|
|
179
|
+
const manifest = loadManifest(root)
|
|
180
|
+
const bundle = manifest.diffs.find(diff => diff.id === bundleId)
|
|
181
|
+
if (!bundle) return null
|
|
182
|
+
bundle.status = status
|
|
183
|
+
bundle.updatedAt = new Date().toISOString()
|
|
184
|
+
writeJson(manifestPath(root), manifest)
|
|
185
|
+
writeJson(metadataPath(root, bundle), bundle)
|
|
186
|
+
return bundle
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Apply the captured patch to the working tree. Never silent: the user is asked
|
|
190
|
+
// to confirm, and the result is reported. Uses `git apply` from the repo root.
|
|
191
|
+
async function applyDiff(item, provider) {
|
|
192
|
+
const root = workspaceRoot()
|
|
193
|
+
const bundle = item?.bundle
|
|
194
|
+
if (!root || !bundle) {
|
|
195
|
+
vscode.window.showWarningMessage('No UR inline diff selected.')
|
|
196
|
+
return
|
|
197
|
+
}
|
|
198
|
+
const patch = patchPath(root, bundle)
|
|
199
|
+
if (!fs.existsSync(patch)) {
|
|
200
|
+
vscode.window.showErrorMessage(`UR patch file missing for ${bundle.id}.`)
|
|
201
|
+
return
|
|
202
|
+
}
|
|
203
|
+
const choice = await vscode.window.showWarningMessage(
|
|
204
|
+
`Apply UR patch ${bundle.id} to your working tree? This modifies ${bundle.files?.length ?? 0} file(s).`,
|
|
205
|
+
{ modal: true },
|
|
206
|
+
'Apply',
|
|
207
|
+
)
|
|
208
|
+
if (choice !== 'Apply') return
|
|
209
|
+
try {
|
|
210
|
+
await execFileAsync('git', ['apply', '--whitespace=nowarn', patch], { cwd: root })
|
|
211
|
+
setBundleStatus(root, bundle.id, 'applied')
|
|
212
|
+
provider.refresh()
|
|
213
|
+
vscode.window.showInformationMessage(`Applied UR patch ${bundle.id}.`)
|
|
214
|
+
} catch (error) {
|
|
215
|
+
const message = error?.stderr || error?.message || String(error)
|
|
216
|
+
vscode.window.showErrorMessage(`Failed to apply UR patch ${bundle.id}: ${message}`)
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
async function rejectDiff(item, provider) {
|
|
221
|
+
const root = workspaceRoot()
|
|
222
|
+
const bundle = item?.bundle
|
|
223
|
+
if (!root || !bundle) {
|
|
224
|
+
vscode.window.showWarningMessage('No UR inline diff selected.')
|
|
225
|
+
return
|
|
226
|
+
}
|
|
227
|
+
const updated = setBundleStatus(root, bundle.id, 'rejected')
|
|
228
|
+
if (!updated) {
|
|
229
|
+
vscode.window.showErrorMessage(`UR inline diff not found: ${bundle.id}`)
|
|
230
|
+
return
|
|
231
|
+
}
|
|
232
|
+
provider.refresh()
|
|
233
|
+
vscode.window.showInformationMessage(`Rejected UR patch ${bundle.id} (no files changed).`)
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
async function showStatus(channel) {
|
|
237
|
+
const root = workspaceRoot()
|
|
238
|
+
if (!root) {
|
|
239
|
+
vscode.window.showWarningMessage('Open a workspace folder to query UR status.')
|
|
240
|
+
return
|
|
241
|
+
}
|
|
242
|
+
channel.clear()
|
|
243
|
+
channel.show(true)
|
|
244
|
+
channel.appendLine('Running: ur ide status')
|
|
245
|
+
try {
|
|
246
|
+
const { stdout } = await execFileAsync('ur', ['ide', 'status'], { cwd: root })
|
|
247
|
+
channel.appendLine(stdout.trim())
|
|
248
|
+
} catch (error) {
|
|
249
|
+
channel.appendLine(
|
|
250
|
+
`Could not run \`ur ide status\`: ${error?.message || String(error)}\n` +
|
|
251
|
+
'Ensure the UR CLI is installed and on PATH.',
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
174
256
|
function activate(context) {
|
|
175
257
|
const provider = new DiffProvider()
|
|
258
|
+
const channel = vscode.window.createOutputChannel('UR')
|
|
176
259
|
context.subscriptions.push(
|
|
260
|
+
channel,
|
|
177
261
|
vscode.window.registerTreeDataProvider('urInlineDiffs', provider),
|
|
178
262
|
vscode.commands.registerCommand('urInlineDiffs.refresh', () => provider.refresh()),
|
|
179
263
|
vscode.commands.registerCommand('urInlineDiffs.open', item => openDiff(item)),
|
|
180
264
|
vscode.commands.registerCommand('urInlineDiffs.comment', item => commentDiff(item, provider)),
|
|
265
|
+
vscode.commands.registerCommand('urInlineDiffs.apply', item => applyDiff(item, provider)),
|
|
266
|
+
vscode.commands.registerCommand('urInlineDiffs.reject', item => rejectDiff(item, provider)),
|
|
267
|
+
vscode.commands.registerCommand('urInlineDiffs.status', () => showStatus(channel)),
|
|
181
268
|
)
|
|
182
269
|
}
|
|
183
270
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ur-inline-diffs",
|
|
3
3
|
"displayName": "UR Inline Diffs",
|
|
4
|
-
"description": "Review UR inline diff bundles from .ur/ide/diffs inside VS Code.",
|
|
5
|
-
"version": "1.
|
|
4
|
+
"description": "Review, apply, and reject UR inline diff bundles from .ur/ide/diffs inside VS Code.",
|
|
5
|
+
"version": "1.30.1",
|
|
6
6
|
"publisher": "ur-agent",
|
|
7
7
|
"engines": {
|
|
8
8
|
"vscode": "^1.92.0"
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
"onView:urInlineDiffs",
|
|
15
15
|
"onCommand:urInlineDiffs.refresh",
|
|
16
16
|
"onCommand:urInlineDiffs.open",
|
|
17
|
-
"onCommand:urInlineDiffs.comment"
|
|
17
|
+
"onCommand:urInlineDiffs.comment",
|
|
18
|
+
"onCommand:urInlineDiffs.apply",
|
|
19
|
+
"onCommand:urInlineDiffs.reject",
|
|
20
|
+
"onCommand:urInlineDiffs.status"
|
|
18
21
|
],
|
|
19
22
|
"main": "./extension.js",
|
|
20
23
|
"contributes": {
|
|
@@ -47,6 +50,18 @@
|
|
|
47
50
|
{
|
|
48
51
|
"command": "urInlineDiffs.comment",
|
|
49
52
|
"title": "UR: Comment On Inline Diff"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"command": "urInlineDiffs.apply",
|
|
56
|
+
"title": "UR: Apply Inline Diff"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"command": "urInlineDiffs.reject",
|
|
60
|
+
"title": "UR: Reject Inline Diff"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"command": "urInlineDiffs.status",
|
|
64
|
+
"title": "UR: Show Status (provider, model, plugins)"
|
|
50
65
|
}
|
|
51
66
|
],
|
|
52
67
|
"menus": {
|
|
@@ -55,6 +70,11 @@
|
|
|
55
70
|
"command": "urInlineDiffs.refresh",
|
|
56
71
|
"when": "view == urInlineDiffs",
|
|
57
72
|
"group": "navigation"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"command": "urInlineDiffs.status",
|
|
76
|
+
"when": "view == urInlineDiffs",
|
|
77
|
+
"group": "navigation"
|
|
58
78
|
}
|
|
59
79
|
],
|
|
60
80
|
"view/item/context": [
|
|
@@ -63,10 +83,20 @@
|
|
|
63
83
|
"when": "view == urInlineDiffs && viewItem == diff",
|
|
64
84
|
"group": "inline"
|
|
65
85
|
},
|
|
86
|
+
{
|
|
87
|
+
"command": "urInlineDiffs.apply",
|
|
88
|
+
"when": "view == urInlineDiffs && viewItem == diff",
|
|
89
|
+
"group": "1_actions"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"command": "urInlineDiffs.reject",
|
|
93
|
+
"when": "view == urInlineDiffs && viewItem == diff",
|
|
94
|
+
"group": "1_actions"
|
|
95
|
+
},
|
|
66
96
|
{
|
|
67
97
|
"command": "urInlineDiffs.comment",
|
|
68
98
|
"when": "view == urInlineDiffs && viewItem == diff",
|
|
69
|
-
"group": "
|
|
99
|
+
"group": "2_review"
|
|
70
100
|
}
|
|
71
101
|
]
|
|
72
102
|
}
|
package/package.json
CHANGED