@umage.ai/redline-agent 0.0.0-stage → 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 +74 -2
- package/dist/index.cjs +6138 -0
- package/dist/panel.js +83 -0
- package/dist/terminal.js +325 -0
- package/index.d.ts +6 -0
- package/package.json +51 -4
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,75 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @umage.ai/redline-agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The agent panel for [Redline](https://github.com/umage-ai/redline)'s dev server. It runs your agent CLI
|
|
4
|
+
(Claude Code by default; Codex, Gemini CLI, aider… any terminal program) in a pseudo-terminal on the dev
|
|
5
|
+
server and drives it from the overlay, so reviewers never need to open a terminal:
|
|
6
|
+
|
|
7
|
+
- **The agent toolbar**: **Agent** (A) in Redline's toolbar, or `Alt+Shift+A` from anywhere. It shows the
|
|
8
|
+
agent's state and its own message, **Apply 3 notes** and your own prompt buttons, **CLI** for its
|
|
9
|
+
terminal (xterm.js), and stop.
|
|
10
|
+
- **Its questions in a card** on the toolbar: when the CLI shows a menu (a permission prompt with its diff, Claude Code's
|
|
11
|
+
stepped questions, a trust dialog), the card shows the context, the question and every option, with a field for
|
|
12
|
+
"Type something". It is read off the CLI's screen, so it is exactly what the terminal shows; a click moves the
|
|
13
|
+
CLI's cursor and presses Enter. This is for Claude Code (detected from its OSC 7501 reports or the command
|
|
14
|
+
`claude`); other CLIs get **Allow**/**Deny** and the terminal (`menus: true` tries it anyway).
|
|
15
|
+
- **Live status** from the CLI's OSC 7501 reports (Claude Code sends them): a light sweeping round the toolbar
|
|
16
|
+
and a turning ring on the closed launcher while it works, an orange glow while it waits for you, green when done.
|
|
17
|
+
- **Fresh sessions** (the toolbar's **Fresh**, or `sessions: 'fresh'`): every prompt starts its own session with
|
|
18
|
+
only its notes (none that a running session already has), several at once, a tab each (3 shown, the rest
|
|
19
|
+
behind **+N**, a list of every session; on phones one session button opens it). The default is one shared
|
|
20
|
+
session that keeps its context; either way a note goes to one running session at a time.
|
|
21
|
+
- **The notes panel** tags each note it was sent: being worked on, waiting for your answer, sent, or done.
|
|
22
|
+
- **← and ✕**: ← goes back to the main toolbar (Esc too), ✕ closes the overlay.
|
|
23
|
+
|
|
24
|
+
Local dev only: it answers this machine only (whatever Redline's `network` option says), and every call needs a
|
|
25
|
+
per-process token. The CLI keeps its own permission prompts.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm i -D @umage.ai/redline @umage.ai/redline-agent
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
node-pty comes with it (an optional dependency: prebuilt on Windows and macOS, compiled on Linux). Linux without
|
|
34
|
+
build tools: `npm i -D @lydell/node-pty` instead.
|
|
35
|
+
|
|
36
|
+
## Use
|
|
37
|
+
|
|
38
|
+
Turn it on with Redline's `agent` option, in any setup (Vite, Astro, Next, Angular, the Node server):
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
redline({ agent: true }) // claude
|
|
42
|
+
redline({ agent: 'codex' }) // another CLI
|
|
43
|
+
redline({
|
|
44
|
+
agent: {
|
|
45
|
+
command: 'claude', args: ['--permission-mode', 'acceptEdits'],
|
|
46
|
+
commands: [{ label: 'Review page', prompt: 'Review page {page} against the open Redline notes {ids}' }],
|
|
47
|
+
keys: { allow: '\r', deny: '\x1b' }, // what Allow / Deny send (Claude Code's prompt)
|
|
48
|
+
hotkey: 'alt+shift+a',
|
|
49
|
+
key: 'a', // the Agent button's key in the toolbar; false when an extension uses A
|
|
50
|
+
sessions: 'fresh', maxSessions: 3, // a new session per prompt (default 'shared': one session)
|
|
51
|
+
instructions: { file: 'redline-agent.md' }, // or a string; see below
|
|
52
|
+
},
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Redline finds this package in your project. Or hand it over yourself (typed, and bundler-friendly):
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
import { agent } from '@umage.ai/redline-agent';
|
|
60
|
+
redline({ agent: agent({ command: 'codex' }) })
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Prompts fill in `{page}`, `{url}` and `{ids}` (the open notes on the page); a prompt with `{ids}` shows their count
|
|
64
|
+
and tags those notes "sent". Prompts wait until the CLI is ready for input.
|
|
65
|
+
|
|
66
|
+
`instructions` adds your own rules to the sessions Redline starts, on top of the project's CLAUDE.md / AGENTS.md
|
|
67
|
+
(say "don't commit", "run the tests for the files you touch"). Text, or `{ file }` relative to the project root,
|
|
68
|
+
read at every start. Claude Code gets it as `--append-system-prompt-file`; any other CLI ahead of the session's
|
|
69
|
+
first prompt. The agent starts in the project root (where `.redline/` is), or `cwd`.
|
|
70
|
+
|
|
71
|
+
How it works and why: [D53](https://github.com/umage-ai/redline/blob/main/docs/DECISIONS.md). MIT licensed.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
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).
|