@openscout/scout 0.2.64 → 0.2.65

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,7 +9,7 @@ bun add -g @openscout/scout
9
9
  scout --help
10
10
  ```
11
11
 
12
- `@openscout/scout` is the published package name. It installs the `scout` command and depends on `@openscout/runtime` for the local broker service.
12
+ `@openscout/scout` is the public package name. It installs the `scout` command and carries the bundled broker/runtime and web UI. Installing it does not start services; commands such as `scout setup`, `scout up`, and `scout server start` activate them explicitly.
13
13
 
14
14
  ## Canonical Flow
15
15
 
@@ -29,7 +29,7 @@ scout ask --to dewey "can you review our docs?"
29
29
  - `~/Library/Application Support/OpenScout/relay-agents.json` for compatibility with the existing machine-local agent registry
30
30
  - `.openscout/project.json` for the current repo when needed
31
31
 
32
- It also discovers local and project-backed agents from your configured workspace roots, installs the broker service, and attempts to start it.
32
+ It also discovers local and project-backed agents from your configured workspace roots, installs the base Scout service, attempts to start it, and ensures Caddy is available for the local `scout.local` edge. On macOS, setup installs missing Caddy with `brew install caddy`; otherwise install Caddy yourself or set `OPENSCOUT_CADDY_BIN`.
33
33
 
34
34
  `scout init` writes `~/.openscout/config.json` with the broker, web, and pairing ports that every Scout component reads. Run it once after install, or with `--force` to overwrite.
35
35
 
@@ -172,11 +172,16 @@ Aliases: `runtime:` = `harness:`, `persona:` = `profile:`, `branch:` / `worktree
172
172
 
173
173
  If direct send/ask still comes back unresolved, treat that as a routing problem, not a mere "target is offline" problem. The right follow-up is to disambiguate the target, inspect broker context with `scout who` / `scout latest`, or create/register the missing identity. Do not default to pushing the bring-up step back onto the operator for a known target.
174
174
 
175
- By default, a label handoff such as `@openscout.harness:claude` should mean
176
- "use the OpenScout identity on the Claude harness in a fresh session/context."
177
- Reusing an existing session is an explicit continuity choice, not the default.
178
- The broker should keep the stable agent name as the address and record the
179
- concrete session binding in the delivery receipt/history.
175
+ Local product handoffs use the public Scout address:
176
+
177
+ ```bash
178
+ scout send --to scout "message for the local Scout inbox"
179
+ ```
180
+
181
+ Broker names and concrete node or agent ids are diagnostic details. Normal send
182
+ output should say whether the message was sent, not which broker or internal
183
+ session handled it. Reusing an existing session is an explicit continuity
184
+ choice, not the default.
180
185
 
181
186
  Session refs are separate route targets for continuing a concrete bound
182
187
  session. Use the bare `ref:<suffix>` form in receipts/history, and pass the
@@ -188,10 +193,10 @@ scout ask --ref 7f3a9c21 "continue from that handoff"
188
193
  scout send --ref 7f3a9c21 "status for that same session"
189
194
  ```
190
195
 
191
- Receipts should name both layers, for example:
196
+ Diagnostic views may show both layers, for example:
192
197
 
193
198
  ```text
194
- sent to @openscout#claude via DM (ref:7f3a9c21)
199
+ sent to Scout via DM (ref:7f3a9c21)
195
200
  ```
196
201
 
197
202
  ## Current Commands
@@ -249,13 +254,20 @@ scout server open
249
254
  scout server start
250
255
  scout server start --port 3200
251
256
  scout server open --path /agents/arc-codex-2.master.mini
252
- scout server start --public-origin https://scout.my-mac.local
257
+ scout server start --public-origin https://scout.local
258
+ scout server edge --local-name m1
253
259
  scout server start --vite-url http://127.0.0.1:43173 # SPA dev server
254
260
  scout server start --static --static-root /custom/client
255
261
  ```
256
262
 
257
263
  `scout server open` reuses an already-running matching Scout server on that port, or starts one in the background and opens the browser for you. Use `scout server` or `scout server help` for full flags.
258
264
 
259
- The application server derives the LAN hostname `scout.<machine>.local` by default. For a Caddy or other edge proxy, set `--public-origin https://scout.<machine>.local` (or `OPENSCOUT_WEB_PUBLIC_ORIGIN`) so browser origins match the app server's trusted host model.
265
+ The application server binds to `0.0.0.0` by default, treats `scout.local` as the local portal name, and derives the node URL as `<machine>.scout.local` unless the user configures a short alias such as `m1`. `scout server edge` publishes `scout.local` plus the node host with Bonjour/mDNS and runs Caddy against the active web port. The managed edge serves HTTP on port `80` for zero-cert local browsing and HTTPS on port `443` with Caddy's local CA; the HTTPS path needs the local CA trusted once by browsers that enforce their own trust store.
266
+
267
+ `scout setup` verifies Caddy for this path. The setup command installs it with Homebrew on macOS when `caddy` is not already available, but Scout still runs Caddy directly with the generated `~/.scout/local-edge/Caddyfile` instead of registering a separate Homebrew service. The base LaunchAgent is labelled `dev.openscout` in source/dev installs and supervises the broker, local edge, web startup, and menu bar app; `scout doctor` prints the exact `launchctl bootout ...` command for the current mode.
268
+
269
+ When the edge is up but the web app is down, Caddy serves a same-origin "Start Scout" page. The button calls Caddy's internal `/__openscout/web/start` path, which proxies to the always-on broker and starts the web server while keeping the user-facing URL at `scout.local` or `<name>.scout.local`.
270
+
271
+ `packages/web` remains the internal web workspace. Published installs get that same server and client through `@openscout/scout`.
260
272
 
261
- For the same web UI without the full `scout` CLI package, use **`@openscout/web`** (`openscout-web`): it ships its own `dist/client`, bundled Bun server, and pairing supervisor.
273
+ For source development, `bun run dev:edge -- --local-name m1` starts the web dev stack and the local edge together. It generates Caddy config against the actual selected dev port, so worktree-specific ports and busy-port fallback still route through `scout.local`.
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env bun
2
+
3
+ import { spawn } from "node:child_process";
4
+ import { existsSync } from "node:fs";
5
+ import { dirname, resolve } from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ const binDir = dirname(fileURLToPath(import.meta.url));
9
+ const runtimeDistDir = resolve(binDir, "../dist/runtime");
10
+
11
+ const entrypoints = {
12
+ broker: resolve(runtimeDistDir, "broker-daemon.mjs"),
13
+ service: resolve(runtimeDistDir, "broker-process-manager.mjs"),
14
+ discover: resolve(runtimeDistDir, "mesh-discover.mjs"),
15
+ };
16
+
17
+ const [, , command = "service", ...args] = process.argv;
18
+ const entrypoint = entrypoints[command];
19
+
20
+ if (!entrypoint) {
21
+ console.error(`Unknown openscout-runtime command: ${command}`);
22
+ process.exit(1);
23
+ }
24
+
25
+ if (!existsSync(entrypoint)) {
26
+ console.error(
27
+ "Scout runtime dist entry is missing. Reinstall @openscout/scout or rebuild the package.",
28
+ );
29
+ process.exit(1);
30
+ }
31
+
32
+ const child = spawn(process.execPath, [entrypoint, ...args], {
33
+ stdio: "inherit",
34
+ });
35
+
36
+ child.on("exit", (code, signal) => {
37
+ if (signal) {
38
+ process.kill(process.pid, signal);
39
+ } else {
40
+ process.exit(code ?? 0);
41
+ }
42
+ });