| 1 | import type { DocsWebDict } from "../types"; |
| 2 | |
| 3 | /** |
| 4 | * English reference dictionary for `app/[locale]/docs/web/page.tsx` |
| 5 | * ("Open the browser client"). Checked against docs/WEB.md, `WebArgs` in |
| 6 | * crates/cli/src/lib.rs (`--port`, default 7878), and the `/rc` command in |
| 7 | * crates/tui/src/commands/groups/session/remote_control.rs. |
| 8 | */ |
| 9 | export const docsWeb: DocsWebDict = { |
| 10 | metaTitle: "Open the browser client · Codewhale Docs", |
| 11 | metaDescription: |
| 12 | "Work with Codewhale in a browser tab on your own machine, or continue a running terminal session from the Codewhale web app with /rc.", |
| 13 | bodyClassName: "text-ink-soft leading-relaxed", |
| 14 | title: "Open the browser client", |
| 15 | lede: |
| 16 | "Prefer a browser window to a terminal? Codewhale can serve its own client on your machine. It is another view of the same local session — same approvals, same sandbox, no account.", |
| 17 | sections: [ |
| 18 | { |
| 19 | id: "start", |
| 20 | title: "Start it", |
| 21 | blocks: [ |
| 22 | { p: "Run this from the folder you want Codewhale to work in:" }, |
| 23 | { code: "codewhale web\ncodewhale web --port 8788 # if 7878 is taken", lang: "Terminal" }, |
| 24 | { |
| 25 | p: "Codewhale starts a local server at `http://127.0.0.1:7878`, prints a one-time link, and opens it in your default browser. If the browser does not open, use the printed link within ten minutes. Press Ctrl+C in the terminal to stop; the browser session ends with it.", |
| 26 | }, |
| 27 | ], |
| 28 | }, |
| 29 | { |
| 30 | id: "use", |
| 31 | title: "Work in the browser", |
| 32 | blocks: [ |
| 33 | { |
| 34 | p: "The browser client lists and searches your threads, shows the transcript with each tool's result, and has a composer. You can start, steer, or interrupt a turn, answer approvals, and rename or archive threads. Your provider keys stay in Codewhale; nothing is copied into browser storage.", |
| 35 | }, |
| 36 | ], |
| 37 | }, |
| 38 | { |
| 39 | id: "local", |
| 40 | title: "Keep it local", |
| 41 | blocks: [ |
| 42 | { |
| 43 | list: [ |
| 44 | "The server only listens on `127.0.0.1`. There is no option to open it to your network, and it cannot run without authentication.", |
| 45 | "The link carries a single-use code, not your access token. Opening it swaps the code for a cookie tied to this process, and the code stops working.", |
| 46 | "Do not forward the port through a router, a public proxy, or a tunnel. For a phone or another machine, see the [Runtime API](/docs/runtime-api) and read its authentication rules first.", |
| 47 | ], |
| 48 | }, |
| 49 | ], |
| 50 | }, |
| 51 | { |
| 52 | id: "remote", |
| 53 | title: "Continue a session from the web app", |
| 54 | blocks: [ |
| 55 | { |
| 56 | p: "This is different: it hands a session already running in your terminal to the signed-in Codewhale web app, so you can keep going from another device. It needs a [Codewhale account](/docs/auth#account).", |
| 57 | }, |
| 58 | { |
| 59 | code: `/rc # in the running session; approve the one-time code in your browser |
| 60 | /rc status # who controls the session now |
| 61 | /rc link # print the session link |
| 62 | /rc stop # hand control back to the terminal`, |
| 63 | lang: "Codewhale", |
| 64 | }, |
| 65 | { |
| 66 | p: "While the web app holds the session, new prompts and approvals come from the browser, and the terminal stays readable. Either side can interrupt. You can also start a session this way with `codewhale rc`.", |
| 67 | }, |
| 68 | ], |
| 69 | }, |
| 70 | { |
| 71 | id: "fix", |
| 72 | title: "If something goes wrong", |
| 73 | blocks: [ |
| 74 | { |
| 75 | rows: [ |
| 76 | ["Port in use", "Pass a free port with `--port`."], |
| 77 | ["Browser did not open", "Copy the printed link into a browser on the same machine within ten minutes."], |
| 78 | ["Link expired or already used", "That is expected. Run `codewhale web` again for a new one."], |
| 79 | ["No model answers", "The web command does not set up providers. Check `codewhale doctor` and `/provider`."], |
| 80 | ], |
| 81 | }, |
| 82 | ], |
| 83 | }, |
| 84 | ], |
| 85 | next: [ |
| 86 | { |
| 87 | href: "/docs/runtime-api", |
| 88 | label: "Automate with the Runtime API", |
| 89 | note: "The local API the browser client is built on.", |
| 90 | }, |
| 91 | { |
| 92 | href: "/docs/auth", |
| 93 | label: "Connect a provider", |
| 94 | note: "Give the browser client a model to talk to.", |
| 95 | }, |
| 96 | { |
| 97 | href: "/docs/modes", |
| 98 | label: "Set modes and approvals", |
| 99 | note: "The same approvals apply in the browser.", |
| 100 | }, |
| 101 | ], |
| 102 | sourceNote: "Source document: docs/WEB.md · Update docs-map.ts when changing.", |
| 103 | }; |
| 104 |