agent86-web 0.1.0 → 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/README.md CHANGED
@@ -9,11 +9,12 @@ agent86-web runs a small server on your machine (loopback only) and opens a page
9
9
  - **Saved sessions**, including ones started at a terminal (and `agent86 --resume <id>` continues a browser session at a terminal).
10
10
  - **Several threads at once.**
11
11
  - **Model and approval-mode pickers**, `/` commands, and `@` file mentions.
12
+ - **Thread names** you choose (saved in agent86 with 1.0.17 or newer), a resizable sessions panel, and a **Quit** button.
12
13
 
13
14
  ## Requirements
14
15
 
15
16
  - Node.js 20.19 or newer
16
- - [agent86](https://github.com/Maetek-Technologies/agent86) 1.0.15 or newer on your `PATH`, with a model it can use:
17
+ - [agent86](https://github.com/Maetek-Technologies/agent86) 1.0.15 or newer on your `PATH` (1.0.17 or newer recommended: it keeps thread names you give in the browser and lists each workspace's own sessions), with a model it can use:
17
18
 
18
19
  ```sh
19
20
  npm install -g agent86
@@ -52,7 +53,9 @@ agent86-web --root ~/code
52
53
  ## Things to know
53
54
 
54
55
  - **Workspaces.** A thread runs in one folder under a `--root`. Pick it with _Open a workspace…_. To work in another folder, open a new thread there.
55
- - **Project settings need trust.** agent86 ignores the riskier settings in a project's `.agent86/config.toml`, such as MCP servers, providers, and approvals, until you trust the file. When it does, the thread shows a banner. _Review and trust_ shows the whole file. agent86-web remembers your decision for that exact file in `~/.agent86-web/trusted-projects.json`, and asks again if the file changes. Revoke it under _About_.
56
+ - **Project settings need trust.** agent86 ignores the riskier settings in a project's `.agent86/config.toml`, such as MCP servers, providers, and approvals, until you trust the file. When it does, the thread shows a banner. _Review and trust_ shows the whole file. agent86-web remembers your decision for that exact file in `~/.agent86-web/trusted-projects.json`, and asks again if the file changes. Revoke it under _Settings & about_ (the agent86 version button in the top bar).
57
+ - **The approval mode new threads start in.** Choose it under _Settings & about_; it applies once, when a thread is first opened in that browser. To change agent86's own default everywhere, terminal included, set `approval = "auto"` (or `ask`, `deny`) under `[guardrails]` in `~/.agent86/config.toml`, or start agent86-web with `AGENT86_APPROVAL=auto` in its environment.
58
+ - **Stopping.** Press Ctrl+C in the terminal, or use ⏻ (Quit) in the top bar. Either way, every agent86 it started stops; sessions are saved.
56
59
  - **Model setup and secrets stay at the terminal.** Add keys with `agent86 keys set <provider>` or `/config model`, and enter secrets with `/secret NAME` in `agent86`, choosing to remember them for the project. Browser threads then use them. The protocol agent86-web speaks does not allow asking for secrets in a form.
57
60
  - **Using it from another device.** agent86-web listens only on loopback. Forward the port over SSH:
58
61
  ```sh
package/dist/cli.js CHANGED
@@ -120,6 +120,12 @@ async function main() {
120
120
  }
121
121
  const here = dirname(fileURLToPath(import.meta.url));
122
122
  const publicDir = values.static ?? join(here, "public");
123
+ let stopRequested = () => undefined;
124
+ const stopped = new Promise((resolve) => {
125
+ process.once("SIGINT", () => resolve("signal"));
126
+ process.once("SIGTERM", () => resolve("signal"));
127
+ stopRequested = () => resolve("browser");
128
+ });
123
129
  const bridge = await startBridge({
124
130
  roots,
125
131
  host: values.host,
@@ -130,19 +136,17 @@ async function main() {
130
136
  maxAgents,
131
137
  idleTimeoutMs,
132
138
  updateCheck: !values["no-update-check"] && !updateCheckDisabled() && !values["dev-origin"],
139
+ onShutdownRequested: () => stopRequested(),
133
140
  log: (line) => process.stderr.write(`${line}\n`),
134
141
  });
135
142
  process.stdout.write(`agent86-web ${BRIDGE_VERSION} (agent86 ${version})\n` +
136
143
  `Workspaces: ${roots.join(", ")}\n` +
137
144
  `Open: ${bridge.url}\n` +
138
- `The link works once and expires in 5 minutes. Press Ctrl+C to stop.\n`);
145
+ `The link works once and expires in 5 minutes. Press Ctrl+C (or Quit in the page) to stop.\n`);
139
146
  if (!values["no-open"])
140
147
  openBrowser(bridge.url);
141
- await new Promise((resolve) => {
142
- const stop = () => resolve();
143
- process.once("SIGINT", stop);
144
- process.once("SIGTERM", stop);
145
- });
148
+ if ((await stopped) === "browser")
149
+ process.stdout.write("Stopped from the browser.\n");
146
150
  await bridge.close();
147
151
  return 0;
148
152
  }