| 1 | import type { DocsWebDict } from "../types"; |
| 2 | |
| 3 | /** |
| 4 | * English reference dictionary for `app/[locale]/docs/web/page.tsx`. |
| 5 | * Copy moved verbatim from the page's `isZh` ternaries — any wording change |
| 6 | * belongs in its own commit, never mixed into a structural move. |
| 7 | */ |
| 8 | export const docsWeb: DocsWebDict = { |
| 9 | metaTitle: "Browser Client · Codewhale Docs", |
| 10 | metaDescription: |
| 11 | "The loopback-only embedded browser client — one-time bootstrap, session cookie, the local trust boundary — and remote control of a running local session from the signed-in web app with /rc.", |
| 12 | bodyClassName: "text-ink-soft leading-relaxed", |
| 13 | overviewTitle: "Browser Client", |
| 14 | overviewLead: |
| 15 | "{webCommand} opens Codewhale's embedded browser client over the canonical Runtime API. It is a local surface: the server always binds to {loopbackHost}, cannot be rebound to a LAN address, and cannot run with Runtime authentication disabled. The default address is {defaultUrl}; on a port collision, pick another loopback port with {portExample}. Stop the process with Ctrl+C and the browser session ends with it.", |
| 16 | overviewBody: |
| 17 | "The current client provides a responsive thread and search rail, Runtime-owned session facts, transcript and tool receipts, and a composer. It can create, select, rename, and archive threads; start or steer turns; interrupt work; resolve approvals; and answer Runtime user-input requests. The browser is another view of the same local Runtime — it does not create a second cloud account, copy provider credentials into browser storage, or weaken the configured approval and sandbox policies.", |
| 18 | authTitle: "Authentication boundary", |
| 19 | authLead: |
| 20 | "The browser-launch URL carries a random, short-lived, one-time bootstrap capability — never the Runtime bearer token. A loopback request exchanges it for an HttpOnly, SameSite=Strict, process-local session cookie and immediately invalidates the capability. Reused, expired, malformed, and non-loopback bootstrap attempts fail closed. The Runtime token is never placed in rendered HTML, browser storage, URL queries or fragments, or browser-launch arguments. Cookie-authenticated state-changing requests must also present the exact local web origin; cross-origin browser requests are rejected.", |
| 21 | localTitle: "Local means local", |
| 22 | localLead: |
| 23 | "{webCommand} accepts only {portFlag} — there is no {hostFlag} and no insecure-auth option on this command. Do not treat it as a public website or expose its port through router forwarding, a public reverse proxy, or a tunnel. The separate {mobileCommand} and {httpFlag} modes carry different deployment and authentication contracts; read the Runtime API documentation before operating either one, especially before selecting a non-loopback bind.", |
| 24 | remoteTitle: "Remote control from the web app", |
| 25 | remoteLead: |
| 26 | "Available now. To continue the exact running local session from the signed-in Codewhale web app, type /rc in that session or launch with codewhale rc, then approve the one-time code in your browser. While the lease is active the browser owns new prompts and approvals and the terminal stays a readable safety surface; interrupt remains available from both.", |
| 27 | remoteBody: |
| 28 | "Once connected, the banner and a transcript note show the live session link. /rc open opens it in your browser, /rc link prints it, /rc status shows who owns the session, and /rc stop returns it to the terminal. A dropped connection keeps local input locked until the last web lease expires, so two controllers never race. Every folder you enroll from one terminal shares a single stable device id, so the web app lists one computer per machine, not one per session. This is different from the loopback browser client above: /rc pairs a local session with your account; codewhale web serves a local page with no account at all.", |
| 29 | troubleshootingTitle: "Troubleshooting", |
| 30 | troubleshootingLead: |
| 31 | "If port 7878 is occupied, pass an unused --port. If the browser cannot be opened, the command exits with an error rather than leaving a reusable bootstrap capability behind; check the OS default-browser setup and start again. If the page loads but a provider is unavailable, inspect codewhale doctor and /provider — the web command does not configure or move provider credentials. If a session expired, restart codewhale web to mint a new process-local session; reusing an old bootstrap URL is expected to fail.", |
| 32 | sourceNote: "Source document: docs/WEB.md · Update docs-map.ts when changing.", |
| 33 | }; |
| 34 |