A profile whose endpoint is the HEY app answers the reads from it
JE
15h ago+3023+3023+0123456789012345678901234567890123456789-51-51-01234567890123456789
Context
- An agent on this computer reaches HEY only through HEY's server, with the person's full sign-in.
- #640 reached the HEY Linux app's door (
$XDG_RUNTIME_DIR/hey/agent.sock, open while Settings › General › "Let Agents Use HEY" is on), but through ahey localcommand tree of its own. - The design that replaces it: the endpoint is a field of a profile (#644), the ordinary
heycommands answer from the app when the profile says so, behindHEY_EXPERIMENTAL=app, the default stays the server, no auto-switching. - This is the first of three: reads here; writes,
sent/waitingand exit 9 next; setup and the skill after.
Change
- A profile may name
"endpoint": "app"(or"server", the default); an app profile needs nobase_url. Any other value is a config error, never read as the server. - With
HEY_EXPERIMENTAL=app, an app profile is answered by the app's door:hey box view imbox(imbox.list),hey screener listandhey screener history(screener.list),hey draft list(drafts.list). - Answers keep the server's field names (postings with
topic_id,creator,seen;email_address;statusapproved/denied;updated_at,scheduled_delivery_at); the app's own facts ride along (made_as,sendable,kind, addresses);meta.id_kind: "sender"on the screener, whose ids are senders, not clearances. - Every envelope, errors included, names
meta.endpoint(apporserver) in an experimental build, besidemeta.profile. - On an app profile: no credential is read, migrated or signed in; no account scope;
--account,HEY_ACCOUNT_ID, a profile's own and a repository'saccount_idare refused (exit 1); every other command that reads a server is refused as "not offered by the HEY app on this computer" (exit 1),hey mcpandhey auth/login/logoutin their own words; another box,--pagelikewise; bareheyprints help, no wizard. - A shut door is exit 6, "Open HEY … turn on Let Agents Use HEY", never HEY's server instead; the app signed out is exit 3; an answer missing what a listing must have is exit 7.
- Hidden
hey app tools|call, registered only under the gate, runs the door's read tools; a tool of any other effect is refused before it is called. profile listandprofile showname the endpoint under the gate.internal/localappcomes from #640 at fcf918b unchanged.- Without the gate an app profile is refused at selection ("not in this build", exit 1), the design's choice over a quiet fallback; help,
.surfaceand the docs are unchanged.
Verification
internal/cmd/app_endpoint_test.go(21 tests) and two ininternal/config/profiles_test.go, each against a fake door on a temporary Unix socket and a server that fails the test if reached.- Each behaviour shown red with its code removed, 30 of 30: the gate's check,
hey app's registration,profile list's endpoint, each of the four routes, the refusals of other verbs,--accountandHEY_ACCOUNT_ID, the shut door's exit 6, signed out's exit 3, the requiredhas_more,hey app call's read-only check,meta.endpoint, a mistyped or non-string endpoint, completion and the credential-freeprofile showon an app profile, and the Imbox rows without the server's empty fields. - Without the gate:
.surfaceunchanged (make check-surface),hey commandslists noapp,profile listrows and server envelopes carry no endpoint,hey appis an unknown command. - A fresh review in its own context: no High or Medium; its four Lows fixed in 7241ab2 (completion, no keyring read, narrower Imbox rows, non-string endpoint).
- Bot review (cubic, greptile, Copilot): 26 threads: 21 fixed, 5 declined on 4 points with reasons in their threads (summary comment); fixes in bc9a34e, 4225008, bd7d6e4, cfd5879, each red without its fix; a second fresh review of the fixes found no High or Medium.
make checkgreen;GOOS=darwin,windows,linuxbuild.- Unrun: a check against a running HEY Linux app, since none had the door open on thelio.
Alternatives
- Falling back to the server when the gate is off or the door is shut: rejected, it answers with the person's full sign-in where they chose the app.
- Mapping the door's sender to
creatorvs. a door-onlysenderfield:creator {id, name}chosen so a script reads both endpoints alike; the id is the app's. hey profile create --endpoint app: left to the setup step that creates the app profile; the config is written by hand until then.hey auth status,hey doctorandhey config showlines for an app profile: refused or unchanged here, follow-ups with setup.box view sent|spam: the door serves no such list yet, so they are refused like any other box.--ids-onlyon the app's screener prints sender ids, the server's clearance ids;--jsonnames it inmeta.id_kind. Left as is: no command on the app takes either id until the writes land.XDG_RUNTIME_DIRunset and noHEY_LOCAL_SOCKETis exit 1 (usage: run from the desktop session), not exit 6: there is no door to call shut.