/** * DEC-093 — Drumbeat D6 (slice a): per-host plugin glue. The drumbeat (D2) can * only relance a stopped agent if the stop was recorded with a launch context, * and the local-tmux relauncher (D3) needs a pane to target — both captured at * *stop* time, inside the host's own terminal. h2a cannot write into each * host's runtime, so — exactly like `renderMcpConfig` — it RENDERS the per-host * lifecycle-hook command + where each host places it. * * Grounded in `docs/plugin-capability-matrix.md` (primary-source probe of all * four CLIs, even-handed): claude settings hooks · gemini `gemini hooks` · * codex app-server / remote-control · agy = plugin import + **poll** (no daemon, * the one push gap). No host is privileged; agy is a first-class target here * (EVO-0), with a polling fallback instead of push. */ export type H2AHostPluginMechanism = "claude-settings-hook" | "gemini-hooks" | "codex-app-server" | "agy-plugin-poll" | "hermes-hooks" | "opencode-plugin"; export interface H2AHostPluginTarget { readonly host: string; /** The host's resume invocation — what the D3 relauncher sends to revive it. */ readonly resumeCommand: string; readonly mechanism: H2AHostPluginMechanism; /** Where/how to register the stop hook for this host. */ readonly hint: string; /** Whether the host can be push-notified (false ⇒ poll-only, e.g. agy). */ readonly push: boolean; } /** The supported hosts, at parity (codex/claude/gemini/agy/hermes/opencode). */ export declare const H2A_HOST_PLUGIN_TARGETS: Readonly>; export declare const H2A_HOST_PLUGIN_HOSTS: string[]; export interface RenderStopHookOptions { readonly instance: string; readonly root?: string; /** workStatus recorded on stop. Default `paused` (an unexpected stop = relance candidate). */ readonly status?: string; } export interface H2AStopHookRender { readonly host: string; readonly mechanism: H2AHostPluginMechanism; readonly push: boolean; readonly hint: string; /** Shell command the stop hook runs — captures the launch context (DEC-085) for D3. */ readonly record: string; /** Pre-action host hook: verifies signed h2a drive prompts before the host acts. */ readonly receive: string; /** Poll-only hosts (agy): the command to discover peers' stalls/blockages. */ readonly poll?: string; } /** * Render the stop-hook command + placement for a host. The command runs inside * the host's terminal on stop, where `$TMUX_PANE` and the tmux session name are * available, so the recorded launch context lets D3 send `resumeCommand` back * into the captured pane. Returns undefined for an unknown host. */ export declare function renderStopHook(host: string, options: RenderStopHookOptions): H2AStopHookRender | undefined; /** A single Claude-format command hook entry. */ export interface H2AClaudeCommandHook { readonly hooks: ReadonlyArray<{ readonly type: "command"; readonly command: string; }>; } /** A single Claude Code `Stop` hook entry (settings.json `hooks.Stop[]`). */ export type H2AClaudeStopHook = H2AClaudeCommandHook; /** * DEC-102 (D6 slice b): build the Claude Code `Stop` hook entry that runs the * rendered `record` command when a claude session stops — so the drumbeat (D2) * gets a stop recorded with launch context (D1) and D3 can relance it. This is * the merge fragment for `~/.claude/settings.json` `hooks.Stop`. */ export declare function claudeStopHookEntry(record: string): H2AClaudeStopHook; /** * Build the pre-action receive gate hook. The command reads the host hook JSON * from stdin, ignores ordinary user prompts, and rejects invalid signed h2a * drive prompts before the host processes them. */ export declare function claudeDriveReceiveHookEntry(receive: string): H2AClaudeCommandHook; /** True if a settings.json Stop-hook entry is an h2a drumbeat-record hook. */ export declare function isH2ARecordHook(entry: unknown): boolean; /** True if a Claude-format hook entry is an h2a drive receive gate. */ export declare function isH2ADriveReceiveHook(entry: unknown): boolean; /** * DEC-113 (D6 done): codex loads a plugin from a **local marketplace**, not a * bare plugin dir (verified live against codex CLI: `codex plugin marketplace * add ` is rejected with "marketplace root does not contain a * supported manifest"). A self-installable codex scaffold is therefore a * marketplace directory laid out exactly like codex's own `openai-curated`: * * /.agents/plugins/marketplace.json — the marketplace manifest * /plugins//.codex-plugin/plugin.json — the plugin manifest * /plugins//hooks/hooks.json — the Claude-format Stop hook * * The marketplace NAME comes from `marketplace.json.name` (codex assigns it on * `marketplace add` — confirmed it registered as `h2a-local`), so the trust * commands can use a fixed `@` selector — no placeholder. */ export declare const H2A_CODEX_PLUGIN_NAME = "h2a-drumbeat"; export declare const H2A_CODEX_MARKETPLACE_NAME = "h2a-local"; /** POSIX-relative path the plugin manifest's `hooks` key points at. */ export declare const H2A_CODEX_PLUGIN_HOOKS_REL = "./hooks/hooks.json"; /** The codex-native plugin manifest (`.codex-plugin/plugin.json`). */ export interface H2ACodexPluginManifest { readonly name: string; readonly version: string; readonly description: string; /** Relative path (POSIX) from the plugin root to the hooks.json. */ readonly hooks: string; } /** * One plugin entry in a codex `marketplace.json` (matches codex's curated * marketplace: `policy.authentication` ∈ {`ON_INSTALL`,`ON_USE`} — `NONE` is * rejected; verified live). */ export interface H2ACodexMarketplacePluginEntry { readonly name: string; readonly source: { readonly source: "local"; readonly path: string; }; readonly policy: { readonly installation: "AVAILABLE"; readonly authentication: "ON_INSTALL"; }; readonly category: string; } /** The codex marketplace manifest (`.agents/plugins/marketplace.json`). */ export interface H2ACodexMarketplaceManifest { readonly name: string; readonly interface: { readonly displayName: string; }; readonly plugins: ReadonlyArray; } /** Build the codex-native plugin manifest pointing at the scaffolded hooks.json. */ export declare function codexPluginManifest(name?: string): H2ACodexPluginManifest; /** * Build the codex marketplace manifest that lists the scaffolded plugin. The * plugin `source.path` is the marketplace-relative `./plugins/` dir. */ export declare function codexMarketplaceManifest(name?: string, marketplace?: string): H2ACodexMarketplaceManifest; /** * The trust step a codex user must run to load the freshly-scaffolded plugin. * Codex has **no drop-in plugin dir and no hook-trust-bypass flag** in the * shipped CLI (probed live: `codex plugin {marketplace add, list, add}`; trust * is recorded in `~/.codex/config.toml` as `[plugins."@"] enabled = * true`). h2a cannot safely pre-write that config, so it scaffolds the * marketplace + emits the exact, idempotent two-command trust step (register * the local marketplace, then install — codex prompts to enable/trust). No * faked install. Verified live: `marketplace add` registers as `` * and `plugin list` then shows `@` ready to install. */ export declare function codexPluginTrustCommands(marketplaceDir: string, name?: string, marketplace?: string): readonly string[]; //# sourceMappingURL=plugin.d.ts.map