feat(agent-hooks): on-disk endpoint discovery for surviving PTYs (v2) (#1196)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Brennan Benson
2026-04-27 21:49:18 -07:00
committed by GitHub
co-authored by Orca
parent 812ca5488b
commit 4279fc8075
10 changed files with 658 additions and 22 deletions
+11 -6
View File
@@ -1,8 +1,8 @@
// Why: these IPC payload shapes live here but have no renderer/main consumer
// in this PR. They are pulled in by the main-process hook server (Claude /
// Codex / Gemini native hook integrations) that lands in the follow-up PR.
// Keeping the types shared up-front avoids a churn PR that renames or splits
// them once the hook server imports them.
// Why: shared agent-hook IPC payload shapes and the managed-script protocol
// version constant. Consumed by both the main-process hook server (src/main/
// agent-hooks/server.ts) and each per-agent hook service (claude/codex/
// gemini/cursor/hook-service.ts). Lives in `shared/` to keep a single
// source of truth for the version string and status contract.
export type AgentHookTarget = 'claude' | 'codex' | 'gemini' | 'cursor'
@@ -19,5 +19,10 @@ export type AgentHookInstallStatus = {
// Why: bumped whenever the managed script's request shape changes. The
// receiver logs a warning when it sees a request from a different version so a
// stale script installed by an older app build is diagnosable instead of
// silently producing partial payloads.
// silently producing partial payloads. Still at v1 because the endpoint-file
// rollout is additive — pre-endpoint-file scripts still post the same JSON
// body shape, and no caller was ever shipped on v2 (the Claude/Codex/Gemini
// install path has been gated behind AGENT_DASHBOARD_ENABLED=false, and the
// Cursor/OpenCode scripts reroll on every Orca launch so no in-wild fleet
// exists to distinguish from). Reserve the next bump for a real wire change.
export const ORCA_HOOK_PROTOCOL_VERSION = '1' as const