@umage.ai/redline-agent 0.0.0-stage → 0.2.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 umage.ai
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 CHANGED
@@ -1,3 +1,120 @@
1
- # Temporary Holding Version
1
+ <h1 align="center">Redline agent</h1>
2
+ <p align="center"><b>Your agent CLI, run from the Redline overlay: apply notes, answer its questions, see what it changed.</b></p>
3
+ <p align="center"><a href="https://www.npmjs.com/package/@umage.ai/redline-agent"><img alt="npm" src="https://img.shields.io/npm/v/@umage.ai/redline-agent?label=npm&color=e5484d"></a> <a href="https://github.com/umage-ai/redline/blob/main/LICENSE"><img alt="MIT license" src="https://img.shields.io/npm/l/@umage.ai/redline-agent?color=555"></a></p>
4
+ <p align="center"><a href="#quick-start"><b>Quick start</b></a> · <a href="#features">Features</a> · <a href="#options">Options</a> · <a href="https://github.com/umage-ai/redline/blob/main/docs/USAGE.md#agent-panel">Guide</a> · <a href="https://github.com/umage-ai/redline#packages">All packages</a></p>
2
5
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
6
+ ![The agent toolbar: the CLI asks to edit src/App.tsx; the card shows the diff and its three options](https://raw.githubusercontent.com/umage-ai/redline/main/docs/images/agent.png)
7
+
8
+ Reviewers pin notes with [Redline](https://github.com/umage-ai/redline); this package runs your agent CLI (Claude Code,
9
+ OpenCode, any terminal program, any [ACP](https://agentclientprotocol.com) agent) on the dev server and drives it from
10
+ the overlay. **Apply 3 notes**, answer its permission prompts in a card, and see the files it changed, without opening a terminal.
11
+
12
+ ## Quick start
13
+
14
+ ```bash
15
+ npm i -D @umage.ai/redline @umage.ai/redline-agent
16
+ ```
17
+
18
+ ```js
19
+ redline({ agent: true }) // in vite.config (or Astro, Next, Angular, the Node server): every installed CLI is offered
20
+ ```
21
+
22
+ Open the app, press **Alt+Shift+A** (or **A** in Redline's toolbar), pin a note, press **Apply 1 note**. node-pty comes with
23
+ it (prebuilt on Windows and macOS, compiled on Linux; without build tools: `npm i -D @lydell/node-pty`).
24
+
25
+ ## Features
26
+
27
+ | | |
28
+ |---|---|
29
+ | **The agent toolbar** | **← Agent**, the state ("Claude Code · Working…"), a tab per session (named by its notes), **Apply N notes**, **>_** the CLI window, **⚙** settings |
30
+ | **Questions in a card** | Permission prompts with their diff, Claude Code's stepped questions, trust dialogs: every option, and a field for your own answer. ACP agents send theirs as data |
31
+ | **Several CLIs** | Every installed one is offered; ⚙ or holding **Apply** switches; model and effort per CLI (only values the CLI offers reach it) |
32
+ | **Fresh sessions** | A new session per prompt with only its notes, several at once; or one shared session that keeps its context |
33
+ | **Worktrees** | ⚙ **Each new session in its own git worktree**: its own branch, `redline/<name>`; when it ends, keep, merge (clean only) or discard it |
34
+ | **Attachments** | A 📎 count on each tab: per prompt, the files it changed (with the diff), images, files and links it pointed at |
35
+ | **MCP wired in** | Sessions it starts get Redline's MCP: `working_on` tags the note being worked on, `attach` shows a file on the tab, `note_dom` and `page_console` read the open page |
36
+ | **Live status** | From the CLI's OSC 7501 reports or the ACP session: a sweeping light while it works, orange while it waits for you, green when done; a ring on the closed launcher too |
37
+
38
+ ![The agent toolbar's settings: the CLI, its model and effort, sessions, worktrees](https://raw.githubusercontent.com/umage-ai/redline/main/docs/images/agent-settings.png)
39
+
40
+ Local dev only: it answers this machine only (whatever Redline's `network` option says), every call needs a per-process
41
+ token, and the CLI keeps its own permission prompts.
42
+
43
+ ## Options
44
+
45
+ ```js
46
+ redline({ agent: 'opencode' }) // one CLI by name, no picker
47
+ redline({ agent: { clis: ['claude', 'opencode', { command: 'codex', label: 'Codex' }] } }) // the CLIs offered
48
+ redline({
49
+ agent: {
50
+ command: 'claude', args: ['--permission-mode', 'acceptEdits'],
51
+ model: 'opus', effort: 'high', // defaults for ⚙ (Claude Code --model/--effort; ACP: the agent's options)
52
+ commands: [{ label: 'Review page', prompt: 'Review page {page} against the open Redline notes {ids}' }],
53
+ sessions: 'fresh', maxSessions: 3, // a new session per prompt (the default; 'shared': one session)
54
+ worktrees: true, // each new session in its own git worktree (default off; ⚙ switches)
55
+ instructions: { file: 'redline-agent.md' }, // your rules for the sessions Redline starts
56
+ hotkey: 'alt+shift+a', key: 'a', // false for none
57
+ },
58
+ })
59
+ ```
60
+
61
+ Or hand it over yourself, typed: `import { agent } from '@umage.ai/redline-agent'; redline({ agent: agent({ command: 'codex' }) })`.
62
+ Every option and its default: [docs/OPTIONS.md](https://github.com/umage-ai/redline/blob/main/docs/OPTIONS.md#agent-umageairedline-agent-d53).
63
+
64
+ Prompts fill in `{page}`, `{url}` and `{ids}` (the open notes on the page no running session has); a prompt with `{ids}`
65
+ shows their count and tags those notes in the notes panel (sent, being worked on, waiting for you, done).
66
+ `instructions` (text, or `{ file }` read at every start) reach Claude Code as `--append-system-prompt-file`, any other CLI
67
+ ahead of its first prompt.
68
+
69
+ ### Worktrees
70
+
71
+ With **Each new session in its own git worktree** on (⚙, or `worktrees: true`), a fresh session works in
72
+ `.redline/worktrees/<name>` on the branch `redline/<name>`, so parallel sessions never edit the same files. The tab's
73
+ hover names the branch. When the session ends, the card offers **Keep branch**, **Merge into <your branch>** (a
74
+ fast-forward or a clean merge, never forced; uncommitted work must be committed first) or **Discard** (asks first when
75
+ that would drop work). The worktree has no node_modules: the agent edits and commits there; to run the app or tests in
76
+ it, install first. Not a git repo: the switch is off and says why.
77
+
78
+ ### Attachments
79
+
80
+ ![A session's attachments: the files it changed with their diff, an image, a link](https://raw.githubusercontent.com/umage-ai/redline/main/docs/images/agent-files.png)
81
+
82
+ A 📎 count on a tab opens what that session pointed at, per prompt, most reliable first: what the agent attached (MCP
83
+ `attach`, an ACP agent's resource links and tool-call files), the files that changed in the turn (git, with +/− and the
84
+ diff), links the CLI marked (OSC 8), and, folded, files and URLs its output merely mentioned. Images open zoomed; links
85
+ on this machine open in a new tab; nothing is fetched by the server, and files are served only from inside the project.
86
+
87
+ ### MCP
88
+
89
+ Sessions the toolbar starts get Redline's MCP (`/__redline/mcp`) wired in: Claude Code through `--mcp-config`, an ACP agent
90
+ through `session/new`, with their own token and session id (`REDLINE_AGENT_SESSION`). Besides the note tools they get
91
+ `working_on` (the note it is on: its tag and the tab say so), `attach`, `note_dom` and `page_console` (from the open page),
92
+ `check_page`, and `list_agent_sessions` / `get_agent_session` to see what other sessions are doing.
93
+
94
+ ### Several CLIs, adapters, ACP
95
+
96
+ Hold **Apply** (500 ms; or right-click, Alt+↓, Shift+F10) to switch the CLI for the next prompt; the pick is remembered in
97
+ this browser. With one shared session, a prompt for another CLI stops it between turns and starts the new one.
98
+ What is particular to a CLI sits in an adapter: Claude Code (menus read off its screen, `--model`, `--effort`, instructions as
99
+ a file) and OpenCode (over ACP by default). Add your own, tried first:
100
+
101
+ ```js
102
+ import { agent, openCode } from '@umage.ai/redline-agent';
103
+ redline({ agent: agent({ command: 'opencode', adapters: [{ ...openCode, settleMs: 2000 }] }) })
104
+ ```
105
+
106
+ ACP agents run without a terminal: status and permission requests arrive as data (the card shows "Allow once", "Always
107
+ allow", "Reject"), the CLI window shows a transcript and takes typed prompts. Any other ACP agent:
108
+ `{ command: 'my-acp-agent', protocol: 'acp' }`. OpenCode asks before nothing by default; to approve from the card, set
109
+ `"permission": { "bash": "ask", "edit": "ask" }` in its config (or `env: { OPENCODE_CONFIG_CONTENT: '…' }` for Redline's sessions only).
110
+
111
+ ## How it is built
112
+
113
+ The generic part, driving agent CLIs from a browser (sessions, adapters, OSC 7501, menu reading, worktrees, attachments,
114
+ one guarded HTTP handler), is [`agent-bridge/`](https://github.com/umage-ai/redline/blob/main/agent-bridge/README.md),
115
+ bundled into this package; this package adds the toolbar and Redline's notes. Decisions:
116
+ [D53, D55, D56, D58, D59, D62–D66](https://github.com/umage-ai/redline/blob/main/docs/DECISIONS.md). MIT licensed.
117
+
118
+ ---
119
+
120
+ Part of **Redline** ([umage.ai/products/redline](https://umage.ai/products/redline)): [all packages](https://github.com/umage-ai/redline#packages), [source](https://github.com/umage-ai/redline).