@ashrlabs/ashr 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/README.md CHANGED
@@ -1,3 +1,146 @@
1
- # Temporary Holding Version
1
+ # ashr
2
2
 
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.
3
+ The Ashr terminal interface. By default it connects to the same hosted Manifold
4
+ tasks, chats, files, skills, memory, command queue and approvals as the browser.
5
+ Use `--local` for the separate agent that runs in your repository on your machine.
6
+
7
+ ## Install
8
+
9
+ ```
10
+ npm i -g @ashrlabs/ashr # then run: ashr
11
+ npx @ashrlabs/ashr # try it without installing
12
+ ```
13
+
14
+ Needs Node 22.19 or newer.
15
+
16
+ ## Hosted Manifold
17
+
18
+ ```
19
+ ashr sign in (first run only) and open the hosted workspace
20
+ ashr --task support select a task
21
+ ashr --task support --chat ID open the same chat as the browser
22
+ ashr --service require MANIFOLD_API_KEY or a saved key; never opens a browser
23
+ ashr login sign in through the browser and exit
24
+ ashr login --key ask_… save a service key instead
25
+ ashr logout forget the saved sign-in
26
+ ```
27
+
28
+ On first launch `ashr` opens the dashboard's `/terminal` page. Sign in, pick
29
+ the organization, and click **Connect terminal**. The dashboard mints a key for
30
+ this terminal (labelled `Terminal · <hostname>` under API keys) and hands it
31
+ back once to a loopback listener. The terminal saves it to
32
+ `~/.ashr/credentials.json` (mode 600), and you can close the tab. Later launches
33
+ open the workspace directly. If the key is revoked, `ashr` asks you to sign in
34
+ again. If the browser doesn't open, use the printed URL.
35
+
36
+ `--api-url`/`MANIFOLD_API_URL` and `--dashboard-url`/`MANIFOLD_DASHBOARD_URL`
37
+ select matching deployments. `MANIFOLD_API_KEY` or `--key` override the saved
38
+ sign-in.
39
+
40
+ `/account` shows who the terminal is signed in as. `/org` opens organization
41
+ settings in the browser. `/login` signs in again (for example to switch
42
+ organization) and clears the old task/chat selection. `/logout` forgets the
43
+ saved key.
44
+
45
+ Use `/help` for the complete command reference. Hosted controls include:
46
+
47
+ - `/tasks`, `/task NAME`, `/chats SEARCH`, `/new NAME`, `/open ID`, `/rename NAME`, `/fork NAME [SEQ]`.
48
+ - `/model PROVIDER/MODEL`, `/thinking LEVEL`, `/compact`, `/steer TEXT`, `/next TEXT`, `/queue`, `/stop`, `/approve ID`, `/reject ID`.
49
+ - `/files`, `/view PATH`, `/diff PATH`, `/download PATH LOCAL_FILE`, `/export LOCAL_FILE`.
50
+ - `/skills`, `/skill import LOCAL_FOLDER`, `/skill toggle NAME`, `/skill invoke NAME`, `/memory QUERY`.
51
+ - `/pipelines`, `/sources`, `/datasets`, `/evals`, `/benchmarks`, `/experiments`, `/models`, `/monitoring`, `/interactions`, `/uploads`, `/artifacts`, `/serving`, `/sdk`.
52
+
53
+ Hosted `!COMMAND` runs in the hosted workspace; `!!COMMAND` excludes its output
54
+ from model context. Escape stops active hosted work or pauses a local transfer.
55
+ Ctrl-C stops active hosted work; when idle it disconnects. `/quit` disconnects
56
+ while leaving hosted jobs running. `/pending` and `/retry` recover uncertain
57
+ submissions without changing their request IDs. Upload receipts support resume.
58
+
59
+ Dashboard writes require the command's explicit `--confirm` flag. The terminal
60
+ covers serving, training and evaluation environments. Organization, member and
61
+ API-key administration stay in the dashboard; `/org` opens it.
62
+
63
+ ## Local model keys
64
+
65
+ ashr uses your own model provider key. Set it in your shell, or store it once:
66
+
67
+ ```
68
+ export ANTHROPIC_API_KEY=sk-… # or OPENAI_API_KEY, GEMINI_API_KEY
69
+ ashr login --provider anthropic # stores it in ~/.ashr/credentials.json (readable only by you)
70
+ ```
71
+
72
+ A key set in your shell always wins over a stored one. Keys are never passed to the commands the agent runs.
73
+
74
+ `ashr login` opens a human Manifold workspace. It does not store a provider key.
75
+
76
+ ## Using the local agent
77
+
78
+ ```
79
+ ashr --local new session in this repo
80
+ ashr -c continue the latest session here
81
+ ashr -r pick a session to resume
82
+ ashr -p "<prompt>" one turn, printed (for scripts and CI)
83
+ ```
84
+
85
+ While the agent works, Enter steers it, Option-Enter queues a message for when it finishes, and Esc stops it. When an approval is waiting, `a` approves, `r` rejects and `A` always allows; Tab switches to the input box so you can type a message instead. Ctrl-O shows the full output of the last tool. Type `/` for commands: `/usage`, `/permissions` (and `/permissions remove <rule>`), `/resume`, `/fork`, `/rewind`, `/compact`, `/model`, `/mode`, `/add-dir`, `/help`.
86
+
87
+ ## Local permissions
88
+
89
+ Like pi, ashr runs the agent's tools without asking by default (Auto mode). It still stops and asks before:
90
+
91
+ - anything that spends money on Manifold (data copies, GPU runs, evaluations, deploys)
92
+ - reading or writing outside the repo, including a shell redirect to a file outside it
93
+ - `git push`, force operations, `sudo`, and running a downloaded script
94
+
95
+ Outside the repo covers shell commands too: a command that names a path outside the repo (for example `cat ~/.ssh/id_rsa` or `--out=/tmp/x`) asks in every mode, unless it's a directory you added with `/add-dir` or a device file under `/dev`.
96
+
97
+ Prefer to approve more? Shift-Tab cycles the mode:
98
+
99
+ | Mode | Runs without asking | Asks first |
100
+ |---|---|---|
101
+ | auto (default) | everything inside the repo | the stops above |
102
+ | ask | reading and read-only commands (`ls`, `cat`, `grep`, `git log` …) | edits, other shell commands, connector tools |
103
+ | edit | reads, read-only commands and edits inside the repo | other shell commands, connector tools |
104
+
105
+ In ask and edit mode, changes to the repo's own `.git/` files always ask, since git settings there can run commands.
106
+
107
+ Set your own default with `"defaultMode": "ask"` in `~/.ashr/settings.json`. A repo's committed settings can make you stricter but never move you to Auto.
108
+
109
+ These stops catch an agent's honest mistakes. They are not a security boundary: in Auto the agent can run any program, and a program can do anything your user account can. For untrusted repos, run ashr in a container or a separate user account.
110
+
111
+ Answering `A` on an approval saves an "always allow" rule. Rules live in three files; any deny rule wins:
112
+
113
+ - `~/.ashr/settings.json` — yours, everywhere
114
+ - `.ashr/settings.json` — the team's, committed
115
+ - `.ashr/settings.local.json` — yours, for this repo (gitignored; "always allow" writes here)
116
+
117
+ ```json
118
+ { "permissions": { "allow": ["shell:pytest *", "edit:src/**"], "deny": ["shell:git push *", "edit:.env*"] } }
119
+ ```
120
+
121
+ A repo's committed rules apply only after you trust them; ashr asks the first time and again whenever they change.
122
+
123
+ In print mode nothing can be approved interactively: a run that needs approval exits 3 and names the rule to add, for example `--allow "edit:a.txt"` (one `--allow` per part of a compound shell command), or the mode that would allow it (`--mode edit|auto` for edits, `--mode auto` otherwise). Actions that ask in every mode (spending, outside the repo, dangerous shell commands) need an interactive run.
124
+
125
+ ## Where local things live
126
+
127
+ - Sessions: `~/.ashr/sessions/<org>/<repo>/` (one JSONL file per session, plus full tool outputs and file snapshots for `/fork` and `/rewind`)
128
+ - `ASHR.md` in your repo and `~/.ashr/memory.md` are read into every session.
129
+ - Set `ASHR_HOME` to keep all of this somewhere else.
130
+
131
+ ## Parity checks
132
+
133
+ Run `npm test`, `npm run typecheck`, and `npm run build` from `cli/`.
134
+ `npm run test:parity` starts a disposable SQLite backend and verifies both
135
+ client contracts against real routes. Set `MANIFOLD_TEST_PYTHON` to a Python
136
+ environment with the repository's backend test dependencies installed.
137
+
138
+ `npm run test:parity:browser` builds the actual React/TUI fixtures, starts
139
+ loopback-only servers on ports 3192, 3194 and 3195, then runs Chromium acceptance
140
+ and saves video/screenshots under `.artifacts/parity/`. It needs Playwright and
141
+ its Chromium browser installed; `PLAYWRIGHT_MODULE` may point to an existing
142
+ Playwright ESM entry. It refuses occupied fixture ports and stops its own servers.
143
+
144
+ These tests simulate Clerk identity and model/compute responses explicitly.
145
+ They do not verify deployed Clerk configuration, paid compute or external
146
+ storage. See `docs/terminal-parity-audit.md` for coverage and remaining live checks.