Skip to content

Latest commit

 

History

History
109 lines (89 loc) · 17.7 KB

first-launch.md

File metadata and controls

109 lines (89 loc) · 17.7 KB

First launch and the install kit

  • Code: hide-kit/src/agent_kit.rs, hide-kit/src/coordination_retirement.rs, hide-kit/src/retirement_inspection.rs, hide-kit/src/legacy.rs, hide-kit/src/hooks.rs, hided/src/core_install/
  • Index: INSTALL.md

First launch

The app runs its own bundled hide CLI, which starts hided beside it. hided serves the web shell inside the app's window, and its node runs each pane in a pane holder, hide-holder beside hided, which keeps the pane's program running when the daemon restarts (ARCHITECTURE.md). It keeps running after the window closes for as long as a pane runs, so agent labels stay current with no window open; with no pane running and no client connected it exits after ten minutes. The CLI search order, and HIDE_CLI_PATH, are documented in ARCHITECTURE.md, "The desktop host".

Hide saves each machine's workspaces, tabs and panes in its state folder (engine/session.json), and a start after a reboot opens them again: each pane a new shell in its folder, each agent resumed on its conversation with the model and effort it ran with.

Hide no longer runs Herdr, and it never stops or moves a Herdr. A Herdr an earlier Hide started, or one you run yourself, is never stopped or changed: its saved work can be imported, read only, from the first run, the sidebar or Settings > General, or with hide import herdr, which shows what would come over and does it only with --yes.

Authentication is not bundled: SSH and every agent CLI keep their own sign-in state and credentials. If you want to start agents from hide, install and sign in to the relevant CLI before launching the app.

What the first launch installs

Every launch of the installed app installs Hide's kit on this computer without asking, and puts back only what a newer app needs. The one exception is a computer the kit has never run on: it holds Claude Code's, Codex's and agy's hook entries, skills and Codex trust (the three agents on by default; the other agents start off until switched on) until the operator answers the first-run agent choice, the first step of the first-run wizard (UI_BEHAVIOR.md, First run); the three are recorded off in the hold, installed or not, so an agent installed later also starts off, and the rest below is installed as usual:

  • ~/.local/bin/hide, a link to the app's hide command, unless a hide that is not Hide's is already there;
  • Hide's entries in ~/.claude/settings.json and ~/.codex/hooks.json, for each of Claude Code and Codex whose folder (~/.claude, ~/.codex) is on this Mac, next to whatever other tools put there, among them a PreToolUse entry that refuses a result handed to the system opener and points to hide browser open or hide file open (agent-hooks.md);
  • for each of the other agents that is on and installed, and, like Claude Code and Codex, at least as new as the oldest version Hide's piece for it was proven on (agent-hooks.md), its own piece, in the file agent-hooks.md lists: Grok's ~/.grok/hooks/hide.json, Pi's and omp's extension hide.ts under ~/.pi/agent/extensions and ~/.omp/agent/extensions, and Hide's hide block in agy's ~/.gemini/config/hooks.json with a trusted folder for Hide AI under ~/.hide/ai, with each agent's hide, hide-mission and hide-issue skill stubs, and an earlier build's hide-browser, hide-conductor, hide-plan and hide-task stubs taken out unless the operator edited it; an agent counts as installed when its program is found (agent-hooks.md), while Claude Code's and Codex's entries follow their folders;
  • Codex's trust for those Codex entries: Codex asks for a review of every new or changed hook, so Hide takes installing it as your agreement to its own hooks and has Codex record them as trusted (through codex app-server, never by editing ~/.codex/config.toml), only for an entry whose command is exactly the one Hide wrote, so a Mac the kit set up starts Codex with no review screen; another tool's hook still opens Codex's review screen (only Codex asks; a survey on 2026-10-07 found no hook approval screen for the other agents, agent-hooks.md), and switching Hide's hook off in Codex's hook list keeps it off (agent-hooks.md);
  • A one-release retirement stage removes the former coordination installation after its read-only preflight succeeds; see Coordination retirement below;
  • a one-time removal of what an earlier Hide put down for fifteen agents it no longer supports (GitHub Copilot CLI, Amp, Factory Droid, Kiro, Qwen Code, Goose, Cline, Kilo Code, Crush, Junie, Augment, Kimi Code, Mistral Vibe, Gemini CLI and OpenCode): only its marked skill and hook entries and OpenCode's unedited plugin files come out, and a file you wrote or edited stays, OpenCode's own settings and the MCP servers Hide copied into them among them;
  • the Codex daemon setting is not touched by an install: a Mac where an earlier Hide ran codex features disable daemon_auto_start keeps it off, and Hide reads it so every Codex it starts gets --no-daemon. Only the operator's confirmed "Turn off Codex's shared server…" in a not connected Codex pane changes it, and that also stops the shared daemon running now, which disconnects every Codex attached to it until it is continued with codex resume.

Coordination retirement

Merging this change and installing its build performs the transition. The operator chooses a time with no active sasu runs, open requests or active watches. The kit retains this stage for one release on each machine, with its result shown in Settings > Devices.

Before changing anything, the stage checks the legacy ledgers, Hide's delivery ledger and the sasu run registry and registered checkout run state. Both the legacy v1 and current Hide-only v2 registries are inspected read-only; a selected revision that disappears causes a refusal and a retry instruction, never an empty-registry assumption. An open item, an unreadable or unknown record, or a capacity limit stops the pass, names the reason and recovery action, and leaves the machine unchanged. An acknowledged letter with an explicit unconfirmed hook receipt is still open; a legacy acknowledgement with no receipt and no answer wait remains closed for compatibility and provides no confirmation evidence, while malformed or contradictory receipts refuse the pass. Every local directory below the selected HOME or registered checkout must be a real directory owned by the account and unwritable by other accounts; an alias at or above that selected root remains valid. An outside-HOME HIDE_STATE_DIR or XDG_STATE_HOME remains supported on every system only after its entire namespace is inspected, including before a missing ledger is treated as empty; protected system directories and authenticated system aliases are allowed, while account-controlled links and directories another account can modify are refused without changing them. A system folder others may only add entries of their own to is allowed by the sticky rule (ARCHITECTURE.md): /tmp on Unix, and on Windows a drive's root such as D:\, where every signed-in account may make a folder; a folder made directly in that root inherits every signed-in account's right to change it and is refused, so a state folder there is made by Hide, whose private folders inherit nothing, or given the same protection. A relocated legacy home must stay below HOME and cannot overlap the active Hide state or kit; an indexed run outside HOME needs its owning checkout registered before inspection. A device runs no such check: the operator ended it for devices on 2026-10-29, and the core machine keeps it. The kit never stops an old test server by name without an ownership receipt. Before the transition, the operator checks earlier test servers and refuses automatic cleanup of any whose ownership cannot be confirmed. After that check succeeds, the ordered steps stop the old daemon, unload its LaunchAgent and delete the plist, remove only Hide-owned command and plugin links, remove the kit copy, and rename the old ~/.hide/hcoord and ~/.hcoord folders to siblings ending in .retired-YYYY-MM-DD. A socket confirmed absent, or an owned socket that refuses a connection, is already stopped; a missing socket does not need its name validated by the local transport. A linked, foreign or unreadable endpoint is refused, and other connection failures remain visible at the stop step. The old ledger is never imported into Hide or deleted. There is no compatibility command and no rollback.

The private ~/.hide/kit/coordination-retirement.json receipt records completion or the failed step. An interrupted pass retries idempotently at the next kit pass or Reinstall, with completed removals staying removed. A failed retirement step stays visible while the ordinary kit parts continue their pass; a preflight refusal stops the whole pass before it changes anything. A completed stage does no more work, and the operator decides when a later release removes this stage after every device has passed it. Retirement is tested only with private homes, fixture ledgers and injected service control.

When a kit pass stops before changing anything

A preflight refusal, like the kit's own folder or lock being unavailable, leaves nothing installed by that pass, so on a new install the hide command, the agents' hooks and letters are all missing until it passes. It reaches the operator once, as what stopped it and what to change, never as a reason copied onto every part (hide_kit::KitRefusal): a folder or file another account can change or a link in the way (unsafe), an earlier Hide's open work or a record Hide cannot read, its own kit record (~/.hide/kit/installed.json) among them, unreadable or written by a newer build (record), more registered projects than one pass checks (projects), or another Hide changing the same account (busy), with the folder or file at fault; a cause a newer helper names that this build does not know reads as other and says only to update Hide. On a Mac no pass has answered for, the first-run wizard opens on its agents step with that line, Try again and Not now; on an install set up before, and on a device, the line sits under the machine in Settings > Devices with Retry (UI_BEHAVIOR.md, First run and Settings: each machine's install kit). Try again and Retry run the same pass again, and a read while Settings is open runs the same check, so the line goes only once nothing stops the pass; Not now closes the wizard with the agent question unanswered, and it opens again for a different refusal, when Hide's daemon starts again, or with the question once a pass runs. The kit's own words go to the diagnostic log when a refusal appears or changes (kit.refused, and refused on apply.completed). To recover:

  • A state folder chosen by HIDE_STATE_DIR or XDG_STATE_HOME, refused on any system (on Windows a folder below a drive root such as D:\ whose permissions let every signed-in account change it; on macOS and Linux one that is group- or world-writable, another account's, or reached through an account's link): the line names the variable; set it to a folder only your account can change, or unset it so the state returns to ~/.hide/state. The app hands the hide connect it runs its own environment, that connect starts hided on the folder the environment chooses, and hided keeps that folder until it stops: quitting the app leaves it running as long as a pane runs, a launch whose environment chooses the same folder attaches to it again, and one that chooses another folder starts a second daemon beside it. So on the machine that runs the app the line also names the command that stops the daemon on the refused folder, with that folder and the app's own hide written out (HIDE_STATE_DIR='<folder>' '<app>/hide' stop, or the PowerShell form on Windows); quit Hide, run it, change the variable where the app's launch reads it, and open Hide again. A device's line names no command: its helper reads the variable when it starts there.
  • Where the app's launch reads the variable:
    • macOS: an app opened from the Dock, Finder or Spotlight gets launchd's environment, not a shell profile's, so launchctl setenv and launchctl unsetenv change it for the next launch; an app opened with open from a terminal gets that terminal's variables.
    • Windows: an app started from the Start menu gets the account's environment variables (System Properties or setx), which Explorer passes to every app it starts after the change.
    • Linux: an app started from the desktop's menu gets the session's environment, set at login (~/.profile, environment.d), so a change there reaches it at the next login; one started from a terminal gets that terminal's.
    • hide connect run from a terminal reads that terminal's variables.
  • Any other folder or file it names: make it a real folder of your account that no other account can change, then press Try again or Retry.
  • Open work of an earlier Hide: finish or close it, then try again.
  • The kit record: one a newer Hide wrote is that build's, so update Hide; one no Hide can read can be moved aside, and the next pass starts a new record and asks the agent choice again.
  • Too many projects: remove the ones you no longer use, then try again.

hide connect and hide open do not print the refusal: the pass runs after the connection, on its own worker and for up to three minutes, so waiting for it would delay every window, and each way to use Hide after them, the desktop window or a browser tab, which shows the wizard's agents step alone, shows the line.

Desk's agents

Desk (◆ Desk in the sidebar) talks to the agents switched on in Settings › Agents over ACP: Claude Code, Codex, Pi, omp, Antigravity and Grok, each started as your terminal starts it, in its own default mode with your own settings, so what it asks before it acts is what it asks there. Under Desk's box, 다 허용 (the default) lets Desk allow each of those asks once without a card, and 에이전트대로 shows each as a card with the agent's own choices; a line of hide commands is allowed once either way (UI_BEHAVIOR.md). Claude Code, Codex and Pi speak ACP through an npm package, which Hide downloads for every one of them not yet in place when you turn Desk on, while the selector says 준비 중. Each adapter is pinned to one version, with every package it needs checked against the integrity in contracts/desk-adapters/<agent>/package-lock.json: @agentclientprotocol/claude-agent-acp for Claude Code, @agentclientprotocol/codex-acp for Codex, and pi-acp for Pi. Hide runs npm ci with the Node and npm your login shell finds, into a staging folder it renames into place only once the adapter's program is there, so an install that fails or stops leaves nothing that looks installed, and 다시 받기 tries again. An installed version needs no network afterwards. omp, Antigravity and Grok speak ACP themselves (omp --mode acp, agy acp, grok agent stdio), so Desk runs your own CLI and downloads nothing for them. Each of the six runs the hooks, plugin or extension Hide installed for it as it does in a pane, so a Hide Bot thread's agent gets the global instruction, the guide, Memory and the opener guard a pane's agent gets; Grok's session start adds no context in a pane either (ADR 0068).

Desk's npm adapters need Node 22 or later on your login shell's PATH. Hide does not install Node: without it, or with an older one, the agent selector says the agent needs Node 22 or later, and installing Node from nodejs.org or your package manager makes it choosable. Every agent runs your own CLI, the claude, codex, pi, omp, agy or grok your terminal runs, so each is choosable only once it is on that PATH; the selector says CLI 없음 until then. An adapter never runs a CLI of its own, so a model your CLI knows is one Desk answers with, and Hide checks no version of it. Every agent uses your own sign-in, the one Settings › Agents shows: you sign in with the agent's own CLI (claude /login, codex login, pi /login, omp login, grok login, or by starting agy), and Desk never asks for a key or a sign-in of its own. Desk's agent runs with your account's environment as a new terminal gets it, so a key or setting your agent reads from a variable (ANTHROPIC_API_KEY, a provider key your agent's own configuration names) reaches it whether Hide was opened from the Dock or a terminal: on macOS and Linux every variable your login shell exports (read once with the PATH, and again when a startup file changes), on Windows the variables System Properties or setx keep for your account. A variable set only with launchctl setenv and in no startup file does not reach it, except the language and proxy variables; nothing named HERDR_* or HIDE_* does. A turn that fails shows the agent's own reason on its 답을 끝내지 못했어요 line, and a provider that wants a sign-in shows the agent's sign-in command. Desk's Codex runs with your own Codex folder (CODEX_HOME, or ~/.codex), as your terminal does, in the Codex CLI's own default mode rather than the one your config.toml sets (What each system supports). What an older Hide kept for Desk under ~/.hide/state/desk is no longer read and can be deleted: codex, the folder it gave Desk's Codex, and pi-desk.js, pi-desk (pi-desk.cmd on Windows) and pi-ready-*, its Pi extension and launcher.