tcmts.cli.browser

test/
2 definitions
AGENT_BROWSER "0.41.2"
The agent-browser `tcm browser` runs (npm's `agent-browser`): pinned, as a change to its commands is one to tcm's.
agentBrowserBin () => string
agent-browser's own launcher (its package's bin, which runs the binary built for this platform), installed into `userCache` the first time, as a codebase's packages are installed into its cache (`ensureExternals`), saying so. Its install script isn't run (tcm runs none): it only marks the binary runnable, which the launcher does too.
browser ({ cwd, args }: { cwd: string; args: string[]; }) => Promise<number>
`tcm browser <agent-browser arguments…>`: agent-browser, run with them as given (`open app.App` as `browserArgs` says), on the Chrome `tcm shot` uses unless AGENT_BROWSER_EXECUTABLE_PATH says (with none, agent-browser's own, from its `install`), in the codebase branch's own session unless AGENT_BROWSER_SESSION or `--session` says. What it prints, and its exit code.
browserArgs (args: string[], root: string | undefined) => string[]
agent-browser's arguments, with what `open` is given as `tcm shot` takes it (`shotTarget`): an app `tcm dev` or `tcm start` runs here (app.App) or a port or `host:port` on this machine, as its URL. Anything else is left to agent-browser (`example.com` included); a component's name that nothing runs is an error.
browserSession (root: string | undefined, branch: string | undefined, cwd: string) => string
The agent-browser session (its own browser and daemon) for a codebase's branch: an agent working on its session's branch has its own, apart from another's and the user's. Outside a codebase, the directory's.
chromePath () => Promise<string | undefined>
The Chrome `tcm shot` uses: the one installed (where Playwright's `chrome` channel looks), else the Chromium of the Playwright tcm ships, if it has downloaded it. Undefined when there's neither.
userCache () => string
Where tcm installs what it runs for any codebase, or outside one (`tcm browser`'s agent-browser, too big to ship with tcm): one install for the user, as a codebase's `.tcm/cache` is one for the codebase: `tcm` in XDG_CACHE_HOME, else in ~/.cache.
workingBranch (root: string) => string | undefined
The branch a tcm in `root` works on: a session's (`TCM_BRANCH`), else the codebase's own (`tcm switch`).