effect-herdr-sdk 0.0.0-stage → 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iamdin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ Portions of this package (schema/, scripts/gen/, src/generated/, src/socket-path.ts) are derived from
2
+ @brooswit/herdr-sdk 0.3.0 (https://github.com/brooswit-factory/jsHerdrSDK), MIT License, Copyright brooswit-factory.
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "effect-herdr-sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.1-beta.0",
4
+ "description": "Effect-native client for the herdr socket API. Types generated from herdr's published JSON Schema; forked from @brooswit/herdr-sdk (MIT).",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/iamdin/orchestrate-my-agent-cli.git",
10
+ "directory": "packages/effect-herdr-sdk"
11
+ },
12
+ "files": [
13
+ "src",
14
+ "NOTICE",
15
+ "LICENSE"
16
+ ],
17
+ "exports": {
18
+ ".": "./src/index.ts",
19
+ "./bun": "./src/bun.ts"
20
+ },
21
+ "scripts": {
22
+ "generate": "bun scripts/gen/index.ts",
23
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.core.json && bun scripts/gen/index.ts --check",
24
+ "test": "cd ../.. && bun --bun vitest run packages/effect-herdr-sdk"
25
+ },
26
+ "dependencies": {
27
+ "effect": "4.0.2"
28
+ },
29
+ "peerDependencies": {
30
+ "@effect/platform-bun": "4.0.2"
31
+ },
32
+ "peerDependenciesMeta": {
33
+ "@effect/platform-bun": {
34
+ "optional": true
35
+ }
36
+ },
37
+ "devDependencies": {
38
+ "@effect/platform-bun": "4.0.2"
39
+ }
40
+ }
package/src/bun.ts ADDED
@@ -0,0 +1,9 @@
1
+ // Bun implementations of what the core leaves abstract. The only SDK file that names a runtime.
2
+ import { BunPath, BunSocket } from "@effect/platform-bun"
3
+ import { Layer } from "effect"
4
+ import { SocketConnector } from "./socket-connector.js"
5
+
6
+ export const layerSocketConnector = Layer.succeed(SocketConnector, (endpoint) => BunSocket.makeNet({ path: endpoint }))
7
+
8
+ /** Everything `Herdr.layer` needs on Bun. */
9
+ export const layer = Layer.mergeAll(layerSocketConnector, BunPath.layer)
@@ -0,0 +1,4 @@
1
+ // GENERATED by scripts/gen from schema/herdr-api.schema.json — do not edit.
2
+ // herdr protocol 22, schema_version 1.
3
+
4
+ export type ErrorBody = { "code": string; "message": string; };
@@ -0,0 +1,59 @@
1
+ // GENERATED by scripts/gen from schema/herdr-api.schema.json — do not edit.
2
+ // herdr protocol 22, schema_version 1.
3
+
4
+ // ---- session events ----
5
+ export type AgentSessionInfo = { "agent": string; "kind": AgentSessionRefKind; "source": string; "value": string; };
6
+
7
+ export type AgentSessionRefKind = "id" | "path";
8
+
9
+ export type AgentStatus = "idle" | "working" | "blocked" | "done" | "unknown";
10
+
11
+ export type EventData = ({ "type": "workspace_created"; "workspace": WorkspaceInfo; }) | ({ "type": "workspace_updated"; "workspace": WorkspaceInfo; }) | ({ "type": "workspace_metadata_updated"; "workspace": WorkspaceInfo; }) | ({ "type": "workspace_closed"; "workspace"?: (WorkspaceInfo) | (null); "workspace_id": string; }) | ({ "label": string; "type": "workspace_renamed"; "workspace_id": string; }) | ({ "insert_index": number; "type": "workspace_moved"; "workspace_id": string; "workspaces": Array<WorkspaceInfo>; }) | ({ "before_workspace_id"?: string | null; "type": "workspace_reordered"; "workspace_ids": Array<string>; "workspaces": Array<WorkspaceInfo>; }) | ({ "type": "workspace_focused"; "workspace_id": string; }) | ({ "type": "worktree_created"; "workspace": WorkspaceInfo; "worktree": WorktreeInfo; }) | ({ "already_open": boolean; "type": "worktree_opened"; "workspace": WorkspaceInfo; "worktree": WorktreeInfo; }) | ({ "forced": boolean; "type": "worktree_removed"; "workspace"?: (WorkspaceInfo) | (null); "workspace_id": string; "worktree": WorktreeInfo; }) | ({ "tab": TabInfo; "type": "tab_created"; }) | ({ "tab_id": string; "type": "tab_closed"; "workspace_id": string; }) | ({ "label": string; "tab_id": string; "type": "tab_renamed"; "workspace_id": string; }) | ({ "insert_index": number; "tab_id": string; "tabs": Array<TabInfo>; "type": "tab_moved"; "workspace_id": string; }) | ({ "tab_id": string; "type": "tab_focused"; "workspace_id": string; }) | ({ "pane": PaneInfo; "type": "pane_created"; }) | ({ "pane_id": string; "type": "pane_closed"; "workspace_id": string; }) | ({ "pane": PaneInfo; "type": "pane_updated"; }) | ({ "pane_id": string; "type": "pane_focused"; "workspace_id": string; }) | ({ "closed_tab_id"?: string | null; "closed_workspace_id"?: string | null; "created_tab"?: (TabInfo) | (null); "created_workspace"?: (WorkspaceInfo) | (null); "pane": PaneInfo; "previous_pane_id": string; "previous_tab_id": string; "previous_workspace_id": string; "type": "pane_moved"; }) | ({ "pane_id": string; "revision": number; "type": "pane_output_changed"; "workspace_id": string; }) | ({ "pane_id": string; "type": "pane_exited"; "workspace_id": string; }) | ({ "agent"?: string | null; "final_status"?: (AgentStatus) | (null); "pane_id": string; "released"?: boolean; "type": "pane_agent_detected"; "workspace_id": string; }) | ({ "agent"?: string | null; "agent_status": AgentStatus; "display_agent"?: string | null; "pane_id": string; "state_labels"?: { [key: string]: string; }; "title"?: string | null; "type": "pane_agent_status_changed"; "workspace_id": string; }) | ({ "layout": PaneLayoutSnapshot; "type": "layout_updated"; });
12
+
13
+ export type EventKind = "workspace_created" | "workspace_updated" | "workspace_metadata_updated" | "workspace_closed" | "workspace_renamed" | "workspace_moved" | "workspace_reordered" | "workspace_focused" | "worktree_created" | "worktree_opened" | "worktree_removed" | "tab_created" | "tab_closed" | "tab_renamed" | "tab_moved" | "tab_focused" | "pane_created" | "pane_closed" | "pane_updated" | "pane_focused" | "pane_moved" | "pane_output_changed" | "pane_exited" | "pane_agent_detected" | "pane_agent_status_changed" | "layout_updated";
14
+
15
+ export type PaneInfo = { "agent"?: string | null; "agent_session"?: (AgentSessionInfo) | (null); "agent_status": AgentStatus; "cwd"?: string | null; "display_agent"?: string | null; "focused": boolean; "foreground_cwd"?: string | null; "label"?: string | null; "pane_id": string; "revision": number; "scroll"?: (PaneScrollInfo) | (null); "state_labels"?: { [key: string]: string; }; "tab_id": string; "terminal_id": string; "terminal_title"?: string | null; "terminal_title_stripped"?: string | null; "title"?: string | null; "tokens"?: { [key: string]: string; }; "workspace_id": string; };
16
+
17
+ export type PaneLayoutPane = { "focused": boolean; "pane_id": string; "rect": PaneLayoutRect; };
18
+
19
+ export type PaneLayoutRect = { "height": number; "width": number; "x": number; "y": number; };
20
+
21
+ export type PaneLayoutSnapshot = { "area": PaneLayoutRect; "focused_pane_id": string; "panes": Array<PaneLayoutPane>; "splits": Array<PaneLayoutSplit>; "tab_id": string; "workspace_id": string; "zoomed": boolean; };
22
+
23
+ export type PaneLayoutSplit = { "direction": SplitDirection; "id": string; "ratio": number; "rect": PaneLayoutRect; };
24
+
25
+ export type PaneScrollInfo = { "max_offset_from_bottom": number; "offset_from_bottom": number; "viewport_rows": number; };
26
+
27
+ export type SplitDirection = "right" | "down";
28
+
29
+ export type TabInfo = { "agent_status": AgentStatus; "focused": boolean; "label": string; "number": number; "pane_count": number; "tab_id": string; "workspace_id": string; };
30
+
31
+ export type WorkspaceInfo = { "active_tab_id": string; "agent_status": AgentStatus; "focused": boolean; "label": string; "number": number; "pane_count": number; "tab_count": number; "tokens"?: { [key: string]: string; }; "workspace_id": string; "worktree"?: (WorkspaceWorktreeInfo) | (null); };
32
+
33
+ export type WorkspaceWorktreeInfo = { "checkout_path": string; "is_linked_worktree": boolean; "repo_key": string; "repo_name": string; "repo_root": string; };
34
+
35
+ export type WorktreeInfo = { "branch"?: string | null; "is_bare": boolean; "is_detached": boolean; "is_linked_worktree": boolean; "is_prunable": boolean; "label": string; "open_workspace_id"?: string | null; "path": string; };
36
+
37
+ export type EventFrame = { event: EventKind; data: EventData };
38
+
39
+ // ---- subscription-specific events ----
40
+ export type PaneAgentStatusChangedEvent = { "agent"?: string | null; "agent_status": AgentStatus; "display_agent"?: string | null; "pane_id": string; "state_labels"?: { [key: string]: string; }; "title"?: string | null; "workspace_id": string; };
41
+
42
+ export type PaneOutputMatchedEvent = { "matched_line": string; "pane_id": string; "read": PaneReadResult; };
43
+
44
+ export type PaneReadResult = { "format": ReadFormat; "pane_id": string; "revision": number; "source": ReadSource; "tab_id": string; "text": string; "truncated": boolean; "workspace_id": string; };
45
+
46
+ export type PaneScrollChangedEvent = { "pane_id": string; "scroll": PaneScrollInfo; "workspace_id": string; };
47
+
48
+ export type ReadFormat = "text" | "ansi";
49
+
50
+ export type ReadSource = "visible" | "recent" | "recent_unwrapped" | "detection";
51
+
52
+ export type SubscriptionEventData = (PaneOutputMatchedEvent) | (PaneAgentStatusChangedEvent) | (PaneScrollChangedEvent);
53
+
54
+ export type SubscriptionEventKind = "pane.output_matched" | "pane.agent_status_changed" | "pane.scroll_changed";
55
+
56
+ export type SubscriptionEventFrame = { event: SubscriptionEventKind; data: SubscriptionEventData };
57
+
58
+ /** Any frame that can arrive on a subscription connection after the ack. */
59
+ export type PushFrame = EventFrame | SubscriptionEventFrame;
@@ -0,0 +1,19 @@
1
+ // GENERATED by scripts/gen from schema/herdr-api.schema.json — do not edit.
2
+ // herdr protocol 22, schema_version 1.
3
+
4
+ // Each schema namespace is its own module: 12 type names (PaneInfo, TabInfo,
5
+ // WorkspaceInfo, ...) are defined DIFFERENTLY in the event and response
6
+ // namespaces, so a flat merge would be wrong, not just ambiguous.
7
+ export * as params from "./params.js";
8
+ export * as results from "./results.js";
9
+ export * as errors from "./errors.js";
10
+ export * as events from "./events.js";
11
+ // The handful of names everything needs, re-exported flat for convenience.
12
+ export type { Method, MethodParams, Subscription } from "./params.js";
13
+ export { METHODS } from "./params.js";
14
+ export type { ResponseResult, ResultByTag, ResultTag } from "./results.js";
15
+ export { METHOD_RESULT } from "./results.js";
16
+ export type { ErrorBody } from "./errors.js";
17
+ export type { EventFrame, SubscriptionEventFrame, PushFrame, AgentStatus, EventKind, SubscriptionEventKind } from "./events.js";
18
+ export const PROTOCOL = 22 as const;
19
+ export const SCHEMA_VERSION = 1 as const;
@@ -0,0 +1,460 @@
1
+ // GENERATED by scripts/gen from schema/herdr-api.schema.json — do not edit.
2
+ // herdr protocol 22, schema_version 1.
3
+
4
+ export type AgentPromptParams = { "target": string; "text": string; "wait"?: (AgentPromptWaitOptions) | (null); };
5
+
6
+ export type AgentPromptWaitOptions = { "timeout_ms"?: number | null; "until"?: Array<AgentStatus>; };
7
+
8
+ export type AgentReadParams = { "format"?: ReadFormat; "lines"?: number | null; "source": ReadSource; "strip_ansi"?: boolean; "target": string; };
9
+
10
+ export type AgentRenameParams = { "name"?: string | null; "target": string; };
11
+
12
+ export type AgentSendKeysParams = { "keys": Array<string>; "target": string; };
13
+
14
+ export type AgentStartParams = { "args"?: Array<string>; "kind": string; "name": string; "pane_id": string; /** Startup timeout in milliseconds. Values must be greater than 3000 and at most 300000. */ "timeout_ms"?: number | null; };
15
+
16
+ export type AgentStatus = "idle" | "working" | "blocked" | "done" | "unknown";
17
+
18
+ export type AgentTarget = { "target": string; };
19
+
20
+ export type AgentViewBuiltinField = "status" | "workspace_id" | "tab_id" | "pane_id" | "agent" | "seen" | "state_change_seq";
21
+
22
+ export type AgentViewBuiltinSortField = "workspace_order" | "tab_order" | "pane_order" | "attention" | "status" | "agent" | "seen" | "state_change_seq";
23
+
24
+ export type AgentViewClearParams = { "source"?: string | null; };
25
+
26
+ export type AgentViewContext = "current_workspace_id" | "current_tab_id";
27
+
28
+ export type AgentViewField = (AgentViewBuiltinField) | ({ "token": string; });
29
+
30
+ export type AgentViewFilter = ({ "filters": Array<AgentViewFilter>; "op": "all"; }) | ({ "filters": Array<AgentViewFilter>; "op": "any"; }) | ({ "filter": AgentViewFilter; "op": "not"; }) | ({ "field": AgentViewField; "op": "eq"; "value": AgentViewValue; }) | ({ "field": AgentViewField; "op": "in"; "values": Array<AgentViewValue>; }) | ({ "field": AgentViewField; "op": "exists"; });
31
+
32
+ export type AgentViewSetParams = { "filter"?: (AgentViewFilter) | (null); "label"?: string | null; "sort"?: Array<AgentViewSort>; "source": string; };
33
+
34
+ export type AgentViewSort = { "field": AgentViewSortField; "order"?: AgentViewSortOrder; };
35
+
36
+ export type AgentViewSortField = (AgentViewBuiltinSortField) | ({ "token": string; });
37
+
38
+ export type AgentViewSortOrder = "asc" | "desc";
39
+
40
+ export type AgentViewValue = (string) | (boolean) | (number) | ({ "context": AgentViewContext; });
41
+
42
+ export type AgentWaitParams = { "target": string; "timeout_ms"?: number | null; "until"?: Array<AgentStatus>; };
43
+
44
+ /** Updates whether the requesting client shell receives and controls pane presentation. */
45
+ export type ClientShellSurfaceSetParams = { "active": boolean; };
46
+
47
+ export type ClientWindowTitleSetParams = { "title": string; };
48
+
49
+ export type CommandInvokeParams = { /** Opaque endpoint-issued command identifier from the client-shell projection. */ "command_id": string; "pane_id"?: string | null; /** Client-owned selection coordinates, validated against the pane's content revision. */ "selection"?: (PaneSelectionReadParams) | (null); "tab_id"?: string | null; "workspace_id"?: string | null; };
50
+
51
+ export type EmptyParams = Record<string, never>;
52
+
53
+ export type EventMatch = ({ "event": "workspace_created"; "workspace_id"?: string | null; }) | ({ "event": "workspace_updated"; "workspace_id": string; }) | ({ "event": "workspace_closed"; "workspace_id": string; }) | ({ "event": "workspace_renamed"; "label"?: string | null; "workspace_id": string; }) | ({ "event": "workspace_moved"; "workspace_id": string; }) | ({ "event": "workspace_focused"; "workspace_id": string; }) | ({ "event": "tab_created"; "tab_id"?: string | null; "workspace_id"?: string | null; }) | ({ "event": "tab_closed"; "tab_id": string; }) | ({ "event": "tab_renamed"; "label"?: string | null; "tab_id": string; }) | ({ "event": "tab_moved"; "tab_id": string; }) | ({ "event": "tab_focused"; "tab_id": string; }) | ({ "event": "pane_created"; "pane_id"?: string | null; "workspace_id"?: string | null; }) | ({ "event": "pane_closed"; "pane_id": string; }) | ({ "event": "pane_focused"; "pane_id": string; }) | ({ "event": "pane_moved"; "pane_id": string; }) | ({ "event": "pane_output_changed"; "min_revision"?: number | null; "pane_id": string; }) | ({ "event": "pane_exited"; "pane_id": string; }) | ({ "agent"?: string | null; "event": "pane_agent_detected"; "pane_id": string; }) | ({ "agent_status": AgentStatus; "event": "pane_agent_status_changed"; "pane_id": string; });
54
+
55
+ export type EventsSubscribeParams = { "subscriptions": Array<Subscription>; };
56
+
57
+ export type EventsWaitParams = { "match_event": EventMatch; "timeout_ms"?: number | null; };
58
+
59
+ export type IntegrationInstallParams = { "target": IntegrationTarget; };
60
+
61
+ export type IntegrationTarget = "pi" | "omp" | "claude" | "codex" | "copilot" | "devin" | "droid" | "kimi" | "opencode" | "kilo" | "hermes" | "qodercli" | "qwen" | "cursor" | "mastracode" | "antigravity_cli" | "grok";
62
+
63
+ export type IntegrationUninstallParams = { "target": IntegrationTarget; };
64
+
65
+ export type LayoutApplyParams = { "focus"?: boolean; "root": LayoutNode; "tab_id"?: string | null; "tab_label"?: string | null; "workspace_id"?: string | null; };
66
+
67
+ export type LayoutExportParams = { "pane_id"?: string | null; "tab_id"?: string | null; };
68
+
69
+ export type LayoutNode = ({ "command"?: Array<string> | null; "cwd"?: string | null; "env"?: { [key: string]: string; }; "label"?: string | null; "pane_id"?: string | null; "type": "pane"; }) | ({ "direction": SplitDirection; "first": LayoutNode; "ratio": number; "second": LayoutNode; "type": "split"; });
70
+
71
+ export type LayoutSetSplitRatioParams = { "pane_id"?: string | null; "path": Array<boolean>; "ratio": number; "tab_id"?: string | null; };
72
+
73
+ export type NotificationShowParams = { "body"?: string | null; "position"?: (ToastHerdrPosition) | (null); "sound"?: NotificationShowSound; "title": string; };
74
+
75
+ export type NotificationShowSound = "none" | "done" | "request";
76
+
77
+ export type OutputMatch = ({ "type": "substring"; "value": string; }) | ({ "type": "regex"; "value": string; });
78
+
79
+ export type PaneAgentState = "idle" | "working" | "blocked" | "unknown";
80
+
81
+ export type PaneClearAgentAuthorityParams = { "pane_id": string; "seq"?: number | null; "source"?: string | null; };
82
+
83
+ export type PaneCopyMotion = "line_end" | "first_non_blank" | "next_word_start" | "previous_word_start" | "next_word_end" | "next_big_word_start" | "previous_big_word_start" | "next_big_word_end" | "previous_paragraph" | "next_paragraph";
84
+
85
+ export type PaneCopyMotionParams = { "content_revision"?: number | null; "cursor": PaneTextPoint; "motion": PaneCopyMotion; "pane_id": string; };
86
+
87
+ export type PaneCopySearchDirection = "forward" | "backward";
88
+
89
+ export type PaneCopySearchParams = { "content_revision": number; "cursor": PaneTextPoint; "direction": PaneCopySearchDirection; "pane_id": string; "previous"?: (PaneTextRange) | (null); "query": string; };
90
+
91
+ export type PaneCurrentParams = { "caller_pane_id"?: string | null; };
92
+
93
+ export type PaneDirection = "left" | "right" | "up" | "down";
94
+
95
+ export type PaneEdgesParams = { "pane_id"?: string | null; };
96
+
97
+ export type PaneFocusDirectionParams = { "direction": PaneDirection; "pane_id"?: string | null; };
98
+
99
+ export type PaneGraphicsClearParams = { "layer_id"?: string | null; "pane_id": string; };
100
+
101
+ export type PaneGraphicsFormat = "png" | "rgb" | "rgba" | "bgra";
102
+
103
+ export type PaneGraphicsPlacementParams = { "grid_cols"?: number; "grid_rows"?: number; "viewport_col"?: number; "viewport_row"?: number; };
104
+
105
+ export type PaneGraphicsSetParams = { "data_base64"?: string; "format": PaneGraphicsFormat; "image_height": number; "image_width": number; "layer_id"?: string | null; "pane_id": string; "placement"?: PaneGraphicsPlacementParams; "z_index"?: number; };
106
+
107
+ export type PaneInputSetParams = { "pane_id": string; "right_click": PaneRightClickTarget; };
108
+
109
+ export type PaneLayoutParams = { "pane_id"?: string | null; };
110
+
111
+ export type PaneLinkActivateParams = { "col": number; "content_revision"?: number | null; "offset_from_bottom"?: number | null; "pane_id": string; "viewport_row": number; };
112
+
113
+ export type PaneListParams = { "workspace_id"?: string | null; };
114
+
115
+ export type PaneMoveDestination = ({ "ratio"?: number | null; "split": SplitDirection; "tab_id": string; "target_pane_id"?: string | null; "type": "tab"; }) | ({ "label"?: string | null; "type": "new_tab"; "workspace_id"?: string | null; }) | ({ "label"?: string | null; "tab_label"?: string | null; "type": "new_workspace"; });
116
+
117
+ export type PaneMoveParams = { "destination": PaneMoveDestination; "focus"?: boolean; "pane_id": string; };
118
+
119
+ export type PaneNeighborParams = { "direction": PaneDirection; "pane_id"?: string | null; };
120
+
121
+ export type PaneProcessInfoParams = { "pane_id"?: string | null; };
122
+
123
+ export type PaneReadParams = { "format"?: ReadFormat; "lines"?: number | null; "pane_id": string; "source": ReadSource; "strip_ansi"?: boolean; };
124
+
125
+ export type PaneReleaseAgentParams = { "agent": string; "pane_id": string; "seq"?: number | null; "source": string; };
126
+
127
+ export type PaneRenameParams = { "label"?: string | null; "pane_id": string; };
128
+
129
+ export type PaneReportAgentParams = { "agent": string; "agent_session_id"?: string | null; "agent_session_path"?: string | null; "message"?: string | null; "pane_id": string; "seq"?: number | null; "source": string; "state": PaneAgentState; };
130
+
131
+ export type PaneReportAgentSessionParams = { "agent": string; "agent_session_id"?: string | null; "agent_session_path"?: string | null; "pane_id": string; "seq"?: number | null; "session_start_source"?: string | null; "source": string; };
132
+
133
+ export type PaneReportMetadataParams = { "agent"?: string | null; "applies_to_source"?: string | null; "clear_display_agent"?: boolean; "clear_state_labels"?: boolean; "clear_title"?: boolean; "display_agent"?: string | null; "pane_id": string; "seq"?: number | null; "source": string; "state_labels"?: { [key: string]: string; }; "title"?: string | null; "tokens"?: { [key: string]: string | null; }; "ttl_ms"?: number | null; };
134
+
135
+ export type PaneResizeParams = { "amount"?: number | null; "direction": PaneDirection; "pane_id"?: string | null; };
136
+
137
+ export type PaneRightClickTarget = "herdr" | "pane";
138
+
139
+ export type PaneScrollParams = { "offset_from_bottom": number; "pane_id": string; };
140
+
141
+ export type PaneSelectionReadParams = { "anchor": PaneTextPoint; "content_revision"?: number | null; "cursor": PaneTextPoint; "pane_id": string; };
142
+
143
+ export type PaneSendInputParams = { "keys"?: Array<string>; "pane_id": string; "text"?: string; };
144
+
145
+ export type PaneSendKeysParams = { "keys": Array<string>; "pane_id": string; };
146
+
147
+ export type PaneSendTextParams = { "pane_id": string; "text": string; };
148
+
149
+ export type PaneSplitParams = { "cwd"?: string | null; "direction": SplitDirection; "env"?: { [key: string]: string; }; "focus"?: boolean; "ratio"?: number | null; "right_click"?: PaneRightClickTarget; "target_pane_id"?: string | null; "workspace_id"?: string | null; };
150
+
151
+ export type PaneSwapParams = { "direction"?: (PaneDirection) | (null); "pane_id"?: string | null; "source_pane_id"?: string | null; "target_pane_id"?: string | null; };
152
+
153
+ export type PaneTarget = { "pane_id": string; };
154
+
155
+ export type PaneTextPoint = { "col": number; "row": number; };
156
+
157
+ export type PaneTextRange = { "end": PaneTextPoint; "start": PaneTextPoint; };
158
+
159
+ export type PaneWaitForOutputParams = { "lines"?: number | null; "match": OutputMatch; "pane_id": string; "source": ReadSource; "strip_ansi"?: boolean; "timeout_ms"?: number | null; };
160
+
161
+ export type PaneZoomMode = "toggle" | "on" | "off";
162
+
163
+ export type PaneZoomParams = { "mode"?: PaneZoomMode; "pane_id"?: string | null; };
164
+
165
+ export type PingParams = Record<string, never>;
166
+
167
+ export type PluginActionInvokeParams = { "action_id": string; "context"?: (PluginInvocationContext) | (null); "plugin_id"?: string | null; };
168
+
169
+ export type PluginActionListParams = { "plugin_id"?: string | null; };
170
+
171
+ export type PluginInvocationContext = { "clicked_url"?: string | null; "correlation_id"?: string | null; "focused_pane_agent"?: string | null; "focused_pane_cwd"?: string | null; "focused_pane_id"?: string | null; "focused_pane_status"?: (AgentStatus) | (null); "invocation_source"?: string | null; "link_handler_id"?: string | null; "selected_text"?: string | null; "tab_id"?: string | null; "tab_label"?: string | null; "workspace_cwd"?: string | null; "workspace_id"?: string | null; "workspace_label"?: string | null; "worktree"?: (WorkspaceWorktreeInfo) | (null); };
172
+
173
+ export type PluginLinkParams = { "enabled"?: boolean; "path": string; "source"?: (PluginSourceInfo) | (null); };
174
+
175
+ export type PluginListParams = { "plugin_id"?: string | null; };
176
+
177
+ export type PluginLogListParams = { "limit"?: number | null; "plugin_id"?: string | null; };
178
+
179
+ export type PluginPaneCloseParams = { "pane_id": string; };
180
+
181
+ export type PluginPaneFocusParams = { "pane_id": string; };
182
+
183
+ export type PluginPaneOpenParams = { "cwd"?: string | null; "direction"?: (SplitDirection) | (null); "entrypoint": string; "env"?: { [key: string]: string; }; "focus"?: boolean; "height"?: (PopupSize) | (null); "placement"?: (PluginPanePlacement) | (null); "plugin_id": string; "target_pane_id"?: string | null; "width"?: (PopupSize) | (null); "workspace_id"?: string | null; };
184
+
185
+ export type PluginPanePlacement = "overlay" | "popup" | "split" | "tab" | "zoomed";
186
+
187
+ export type PluginSetEnabledParams = { "plugin_id": string; };
188
+
189
+ export type PluginSourceInfo = { "installed_unix_ms"?: number | null; "kind"?: PluginSourceKind; "managed_path"?: string | null; "owner"?: string | null; "repo"?: string | null; "requested_ref"?: string | null; "resolved_commit"?: string | null; "subdir"?: string | null; };
190
+
191
+ export type PluginSourceKind = "local" | "github";
192
+
193
+ export type PluginUnlinkParams = { "plugin_id": string; };
194
+
195
+ export type PopupSize = (number) | (string);
196
+
197
+ export type ProductAnnouncementDismissParams = { "id": string; "version": string; };
198
+
199
+ export type ReadFormat = "text" | "ansi";
200
+
201
+ export type ReadSource = "visible" | "recent" | "recent_unwrapped" | "detection";
202
+
203
+ export type ReleaseNotesDismissParams = { "version": string; };
204
+
205
+ export type ServerLiveHandoffParams = { "expected_protocol"?: number | null; "expected_version"?: string | null; "import_exe"?: string | null; };
206
+
207
+ export type SplitDirection = "right" | "down";
208
+
209
+ export type Subscription = ({ "type": "workspace.created"; }) | ({ "type": "workspace.updated"; }) | ({ "type": "workspace.metadata_updated"; }) | ({ "type": "workspace.renamed"; }) | ({ "type": "workspace.moved"; }) | ({ "type": "workspace.reordered"; }) | ({ "type": "workspace.closed"; }) | ({ "type": "workspace.focused"; }) | ({ "type": "worktree.created"; }) | ({ "type": "worktree.opened"; }) | ({ "type": "worktree.removed"; }) | ({ "type": "tab.created"; }) | ({ "type": "tab.closed"; }) | ({ "type": "tab.focused"; }) | ({ "type": "tab.renamed"; }) | ({ "type": "tab.moved"; }) | ({ "type": "pane.created"; }) | ({ "type": "pane.closed"; }) | ({ "type": "pane.updated"; }) | ({ "type": "pane.focused"; }) | ({ "type": "pane.moved"; }) | ({ "type": "pane.exited"; }) | ({ "type": "pane.agent_detected"; }) | ({ "lines"?: number | null; "match": OutputMatch; "pane_id": string; "source": ReadSource; "strip_ansi"?: boolean; "type": "pane.output_matched"; }) | ({ "agent_status"?: (AgentStatus) | (null); "pane_id": string; "type": "pane.agent_status_changed"; }) | ({ "pane_id": string; "type": "pane.scroll_changed"; }) | ({ "type": "layout.updated"; });
210
+
211
+ export type TabCreateParams = { "cwd"?: string | null; "env"?: { [key: string]: string; }; "focus"?: boolean; "label"?: string | null; "workspace_id"?: string | null; };
212
+
213
+ export type TabListParams = { "workspace_id"?: string | null; };
214
+
215
+ export type TabMoveParams = { "insert_index": number; "tab_id": string; };
216
+
217
+ export type TabRenameParams = { "label": string; "tab_id": string; };
218
+
219
+ export type TabTarget = { "tab_id": string; };
220
+
221
+ export type ToastHerdrPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
222
+
223
+ export type WorkspaceCloseParams = { "close_group"?: boolean; "workspace_id": string; };
224
+
225
+ export type WorkspaceCreateParams = { "cwd"?: string | null; "env"?: { [key: string]: string; }; "focus"?: boolean; "label"?: string | null; /** Workspace whose focused pane supplies the `follow` cwd policy. */ "source_workspace_id"?: string | null; };
226
+
227
+ export type WorkspaceMoveBlockParams = { "before_workspace_id"?: string | null; "workspace_ids": Array<string>; };
228
+
229
+ export type WorkspaceMoveParams = { "insert_index": number; "workspace_id": string; };
230
+
231
+ export type WorkspaceRenameParams = { "label": string; "workspace_id": string; };
232
+
233
+ export type WorkspaceReportMetadataParams = { "seq"?: number | null; "source": string; "tokens": { [key: string]: string | null; }; "ttl_ms"?: number | null; "workspace_id": string; };
234
+
235
+ export type WorkspaceTarget = { "workspace_id": string; };
236
+
237
+ export type WorkspaceWorktreeInfo = { "checkout_path": string; "is_linked_worktree": boolean; "repo_key": string; "repo_name": string; "repo_root": string; };
238
+
239
+ export type WorktreeCreateParams = { "base"?: string | null; "branch"?: string | null; "cwd"?: string | null; "focus"?: boolean; "label"?: string | null; "path"?: string | null; "trust_repository"?: boolean; "workspace_id"?: string | null; };
240
+
241
+ export type WorktreeListParams = { "cwd"?: string | null; "trust_repository"?: boolean; "workspace_id"?: string | null; };
242
+
243
+ export type WorktreeOpenParams = { "branch"?: string | null; "cwd"?: string | null; "focus"?: boolean; "label"?: string | null; "path"?: string | null; "trust_repository"?: boolean; "workspace_id"?: string | null; };
244
+
245
+ export type WorktreeRemoveParams = { "force"?: boolean; "trust_repository"?: boolean; "workspace_id": string; };
246
+
247
+ /** Every method the server accepts, mapped to its params type. */
248
+ export interface MethodParams {
249
+ "ping": PingParams;
250
+ "server.stop": EmptyParams;
251
+ "server.live_handoff": ServerLiveHandoffParams;
252
+ "server.reload_config": EmptyParams;
253
+ "server.agent_manifests": EmptyParams;
254
+ "server.reload_agent_manifests": EmptyParams;
255
+ "notification.show": NotificationShowParams;
256
+ "product_announcement.dismiss": ProductAnnouncementDismissParams;
257
+ "release_notes.dismiss": ReleaseNotesDismissParams;
258
+ "command.invoke": CommandInvokeParams;
259
+ "client.window_title.set": ClientWindowTitleSetParams;
260
+ "client.window_title.clear": EmptyParams;
261
+ "client_shell.surface.set": ClientShellSurfaceSetParams;
262
+ "session.snapshot": EmptyParams;
263
+ "workspace.create": WorkspaceCreateParams;
264
+ "workspace.list": EmptyParams;
265
+ "workspace.get": WorkspaceTarget;
266
+ "workspace.focus": WorkspaceTarget;
267
+ "workspace.rename": WorkspaceRenameParams;
268
+ "workspace.move": WorkspaceMoveParams;
269
+ "workspace.move_block": WorkspaceMoveBlockParams;
270
+ "workspace.report_metadata": WorkspaceReportMetadataParams;
271
+ "workspace.close": WorkspaceCloseParams;
272
+ "worktree.list": WorktreeListParams;
273
+ "worktree.create": WorktreeCreateParams;
274
+ "worktree.open": WorktreeOpenParams;
275
+ "worktree.remove": WorktreeRemoveParams;
276
+ "tab.create": TabCreateParams;
277
+ "tab.list": TabListParams;
278
+ "tab.get": TabTarget;
279
+ "tab.focus": TabTarget;
280
+ "tab.rename": TabRenameParams;
281
+ "tab.move": TabMoveParams;
282
+ "tab.close": TabTarget;
283
+ "agent.list": EmptyParams;
284
+ "agent.get": AgentTarget;
285
+ "agent.read": AgentReadParams;
286
+ "agent.explain": AgentTarget;
287
+ "agent.send_keys": AgentSendKeysParams;
288
+ "agent.rename": AgentRenameParams;
289
+ "agent.view.set": AgentViewSetParams;
290
+ "agent.view.clear": AgentViewClearParams;
291
+ "agent.focus": AgentTarget;
292
+ "agent.start": AgentStartParams;
293
+ "agent.prompt": AgentPromptParams;
294
+ "agent.wait": AgentWaitParams;
295
+ "pane.split": PaneSplitParams;
296
+ "pane.swap": PaneSwapParams;
297
+ "pane.move": PaneMoveParams;
298
+ "pane.zoom": PaneZoomParams;
299
+ "pane.layout": PaneLayoutParams;
300
+ "pane.process_info": PaneProcessInfoParams;
301
+ "layout.export": LayoutExportParams;
302
+ "layout.apply": LayoutApplyParams;
303
+ "layout.set_split_ratio": LayoutSetSplitRatioParams;
304
+ "pane.neighbor": PaneNeighborParams;
305
+ "pane.edges": PaneEdgesParams;
306
+ "pane.focus_direction": PaneFocusDirectionParams;
307
+ "pane.resize": PaneResizeParams;
308
+ "pane.scroll": PaneScrollParams;
309
+ "pane.edit_scrollback": PaneTarget;
310
+ "pane.selection.read": PaneSelectionReadParams;
311
+ "pane.copy_motion": PaneCopyMotionParams;
312
+ "pane.copy_search": PaneCopySearchParams;
313
+ "pane.list": PaneListParams;
314
+ "pane.current": PaneCurrentParams;
315
+ "pane.get": PaneTarget;
316
+ "pane.focus": PaneTarget;
317
+ "pane.input.set": PaneInputSetParams;
318
+ "pane.link.activate": PaneLinkActivateParams;
319
+ "pane.link.resolve": PaneLinkActivateParams;
320
+ "pane.rename": PaneRenameParams;
321
+ "pane.send_text": PaneSendTextParams;
322
+ "pane.send_keys": PaneSendKeysParams;
323
+ "pane.send_input": PaneSendInputParams;
324
+ "pane.read": PaneReadParams;
325
+ "pane.graphics.set": PaneGraphicsSetParams;
326
+ "pane.graphics.clear": PaneGraphicsClearParams;
327
+ "pane.graphics.info": PaneTarget;
328
+ "pane.report_agent": PaneReportAgentParams;
329
+ "pane.report_agent_session": PaneReportAgentSessionParams;
330
+ "pane.report_metadata": PaneReportMetadataParams;
331
+ "pane.clear_agent_authority": PaneClearAgentAuthorityParams;
332
+ "pane.release_agent": PaneReleaseAgentParams;
333
+ "pane.close": PaneTarget;
334
+ "popup.close": EmptyParams;
335
+ "events.subscribe": EventsSubscribeParams;
336
+ "events.wait": EventsWaitParams;
337
+ "pane.wait_for_output": PaneWaitForOutputParams;
338
+ "integration.list": EmptyParams;
339
+ "integration.install": IntegrationInstallParams;
340
+ "integration.uninstall": IntegrationUninstallParams;
341
+ "plugin.link": PluginLinkParams;
342
+ "plugin.list": PluginListParams;
343
+ "plugin.unlink": PluginUnlinkParams;
344
+ "plugin.enable": PluginSetEnabledParams;
345
+ "plugin.disable": PluginSetEnabledParams;
346
+ "plugin.action.list": PluginActionListParams;
347
+ "plugin.action.invoke": PluginActionInvokeParams;
348
+ "plugin.log.list": PluginLogListParams;
349
+ "plugin.pane.open": PluginPaneOpenParams;
350
+ "plugin.pane.focus": PluginPaneFocusParams;
351
+ "plugin.pane.close": PluginPaneCloseParams;
352
+ }
353
+
354
+ export type Method = keyof MethodParams;
355
+
356
+ export const METHODS = [
357
+ "ping",
358
+ "server.stop",
359
+ "server.live_handoff",
360
+ "server.reload_config",
361
+ "server.agent_manifests",
362
+ "server.reload_agent_manifests",
363
+ "notification.show",
364
+ "product_announcement.dismiss",
365
+ "release_notes.dismiss",
366
+ "command.invoke",
367
+ "client.window_title.set",
368
+ "client.window_title.clear",
369
+ "client_shell.surface.set",
370
+ "session.snapshot",
371
+ "workspace.create",
372
+ "workspace.list",
373
+ "workspace.get",
374
+ "workspace.focus",
375
+ "workspace.rename",
376
+ "workspace.move",
377
+ "workspace.move_block",
378
+ "workspace.report_metadata",
379
+ "workspace.close",
380
+ "worktree.list",
381
+ "worktree.create",
382
+ "worktree.open",
383
+ "worktree.remove",
384
+ "tab.create",
385
+ "tab.list",
386
+ "tab.get",
387
+ "tab.focus",
388
+ "tab.rename",
389
+ "tab.move",
390
+ "tab.close",
391
+ "agent.list",
392
+ "agent.get",
393
+ "agent.read",
394
+ "agent.explain",
395
+ "agent.send_keys",
396
+ "agent.rename",
397
+ "agent.view.set",
398
+ "agent.view.clear",
399
+ "agent.focus",
400
+ "agent.start",
401
+ "agent.prompt",
402
+ "agent.wait",
403
+ "pane.split",
404
+ "pane.swap",
405
+ "pane.move",
406
+ "pane.zoom",
407
+ "pane.layout",
408
+ "pane.process_info",
409
+ "layout.export",
410
+ "layout.apply",
411
+ "layout.set_split_ratio",
412
+ "pane.neighbor",
413
+ "pane.edges",
414
+ "pane.focus_direction",
415
+ "pane.resize",
416
+ "pane.scroll",
417
+ "pane.edit_scrollback",
418
+ "pane.selection.read",
419
+ "pane.copy_motion",
420
+ "pane.copy_search",
421
+ "pane.list",
422
+ "pane.current",
423
+ "pane.get",
424
+ "pane.focus",
425
+ "pane.input.set",
426
+ "pane.link.activate",
427
+ "pane.link.resolve",
428
+ "pane.rename",
429
+ "pane.send_text",
430
+ "pane.send_keys",
431
+ "pane.send_input",
432
+ "pane.read",
433
+ "pane.graphics.set",
434
+ "pane.graphics.clear",
435
+ "pane.graphics.info",
436
+ "pane.report_agent",
437
+ "pane.report_agent_session",
438
+ "pane.report_metadata",
439
+ "pane.clear_agent_authority",
440
+ "pane.release_agent",
441
+ "pane.close",
442
+ "popup.close",
443
+ "events.subscribe",
444
+ "events.wait",
445
+ "pane.wait_for_output",
446
+ "integration.list",
447
+ "integration.install",
448
+ "integration.uninstall",
449
+ "plugin.link",
450
+ "plugin.list",
451
+ "plugin.unlink",
452
+ "plugin.enable",
453
+ "plugin.disable",
454
+ "plugin.action.list",
455
+ "plugin.action.invoke",
456
+ "plugin.log.list",
457
+ "plugin.pane.open",
458
+ "plugin.pane.focus",
459
+ "plugin.pane.close",
460
+ ] as const satisfies readonly Method[];