@stateforge-labs/herdr-sdk 0.0.0-stage → 0.3.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.
Files changed (171) hide show
  1. package/LICENSE +18 -0
  2. package/NOTICE.md +51 -0
  3. package/README.md +211 -2
  4. package/bin/herdr-drift.js +14 -0
  5. package/bin/herdr-skill.js +38 -0
  6. package/dist/admin.d.ts +2 -0
  7. package/dist/admin.js +3 -0
  8. package/dist/constants.d.ts +236 -0
  9. package/dist/constants.js +294 -0
  10. package/dist/core/backoff.d.ts +20 -0
  11. package/dist/core/backoff.js +53 -0
  12. package/dist/core/constants.d.ts +143 -0
  13. package/dist/core/constants.js +98 -0
  14. package/dist/core/errors.d.ts +35 -0
  15. package/dist/core/errors.js +16 -0
  16. package/dist/core/events.d.ts +42 -0
  17. package/dist/core/events.js +128 -0
  18. package/dist/core/kernel.d.ts +65 -0
  19. package/dist/core/kernel.js +138 -0
  20. package/dist/core/link.d.ts +47 -0
  21. package/dist/core/link.js +187 -0
  22. package/dist/core/test-kit/constants.d.ts +51 -0
  23. package/dist/core/test-kit/constants.js +43 -0
  24. package/dist/core/test-kit/fake-core.d.ts +61 -0
  25. package/dist/core/test-kit/fake-core.js +228 -0
  26. package/dist/core/test-kit/frames.d.ts +1 -0
  27. package/dist/core/test-kit/frames.js +480 -0
  28. package/dist/core/test-kit/setup-test.d.ts +18 -0
  29. package/dist/core/test-kit/setup-test.js +35 -0
  30. package/dist/core/wire.d.ts +85 -0
  31. package/dist/core/wire.js +199 -0
  32. package/dist/core-test-kit.d.ts +5 -0
  33. package/dist/core-test-kit.js +5 -0
  34. package/dist/core.d.ts +15 -0
  35. package/dist/core.js +12 -0
  36. package/dist/drift/cli.d.ts +22 -0
  37. package/dist/drift/cli.js +146 -0
  38. package/dist/drift/constants.d.ts +83 -0
  39. package/dist/drift/constants.js +73 -0
  40. package/dist/drift/diff.d.ts +7 -0
  41. package/dist/drift/diff.js +91 -0
  42. package/dist/drift/schema.d.ts +19 -0
  43. package/dist/drift/schema.js +190 -0
  44. package/dist/drift/types.d.ts +76 -0
  45. package/dist/drift/types.js +1 -0
  46. package/dist/drift.d.ts +5 -0
  47. package/dist/drift.js +6 -0
  48. package/dist/effect.d.ts +3 -0
  49. package/dist/effect.js +4 -0
  50. package/dist/herdr/client/connect.d.ts +5 -0
  51. package/dist/herdr/client/connect.js +81 -0
  52. package/dist/herdr/client/held.d.ts +54 -0
  53. package/dist/herdr/client/held.js +100 -0
  54. package/dist/herdr/client/long-poll.d.ts +33 -0
  55. package/dist/herdr/client/long-poll.js +66 -0
  56. package/dist/herdr/client/scoped.d.ts +45 -0
  57. package/dist/herdr/client/scoped.js +241 -0
  58. package/dist/herdr/client/streams.d.ts +9 -0
  59. package/dist/herdr/client/streams.js +40 -0
  60. package/dist/herdr/client/subscribe.d.ts +75 -0
  61. package/dist/herdr/client/subscribe.js +208 -0
  62. package/dist/herdr/client/types.d.ts +150 -0
  63. package/dist/herdr/client/types.js +1 -0
  64. package/dist/herdr/client/watch-pane-set.d.ts +34 -0
  65. package/dist/herdr/client/watch-pane-set.js +271 -0
  66. package/dist/herdr/client/watch.d.ts +117 -0
  67. package/dist/herdr/client/watch.js +138 -0
  68. package/dist/herdr/effect/to-tagged-error.d.ts +2 -0
  69. package/dist/herdr/effect/to-tagged-error.js +54 -0
  70. package/dist/herdr/effect/types.d.ts +51 -0
  71. package/dist/herdr/effect/types.js +26 -0
  72. package/dist/herdr/errors.d.ts +53 -0
  73. package/dist/herdr/errors.js +87 -0
  74. package/dist/herdr/generated/entries/admin.d.ts +2 -0
  75. package/dist/herdr/generated/entries/admin.js +5 -0
  76. package/dist/herdr/generated/entries/client.d.ts +2 -0
  77. package/dist/herdr/generated/entries/client.js +5 -0
  78. package/dist/herdr/generated/entries/held.d.ts +2 -0
  79. package/dist/herdr/generated/entries/held.js +5 -0
  80. package/dist/herdr/generated/entries/prompt.d.ts +2 -0
  81. package/dist/herdr/generated/entries/prompt.js +5 -0
  82. package/dist/herdr/generated/entries/read-only-content.d.ts +2 -0
  83. package/dist/herdr/generated/entries/read-only-content.js +5 -0
  84. package/dist/herdr/generated/entries/read-only.d.ts +2 -0
  85. package/dist/herdr/generated/entries/read-only.js +5 -0
  86. package/dist/herdr/generated/entry-methods.d.ts +9 -0
  87. package/dist/herdr/generated/entry-methods.js +17 -0
  88. package/dist/herdr/generated/errors.d.ts +4 -0
  89. package/dist/herdr/generated/errors.js +3 -0
  90. package/dist/herdr/generated/events.d.ts +274 -0
  91. package/dist/herdr/generated/events.js +3 -0
  92. package/dist/herdr/generated/index.d.ts +20 -0
  93. package/dist/herdr/generated/index.js +19 -0
  94. package/dist/herdr/generated/method-table.d.ts +615 -0
  95. package/dist/herdr/generated/method-table.js +106 -0
  96. package/dist/herdr/generated/names/agent-status.d.ts +10 -0
  97. package/dist/herdr/generated/names/agent-status.js +10 -0
  98. package/dist/herdr/generated/names/capability-class.d.ts +14 -0
  99. package/dist/herdr/generated/names/capability-class.js +15 -0
  100. package/dist/herdr/generated/names/event-kind.d.ts +31 -0
  101. package/dist/herdr/generated/names/event-kind.js +31 -0
  102. package/dist/herdr/generated/names/event-match-kind.d.ts +23 -0
  103. package/dist/herdr/generated/names/event-match-kind.js +24 -0
  104. package/dist/herdr/generated/names/index.d.ts +10 -0
  105. package/dist/herdr/generated/names/index.js +12 -0
  106. package/dist/herdr/generated/names/method.d.ts +209 -0
  107. package/dist/herdr/generated/names/method.js +209 -0
  108. package/dist/herdr/generated/names/result-tag.d.ts +68 -0
  109. package/dist/herdr/generated/names/result-tag.js +68 -0
  110. package/dist/herdr/generated/names/server-capability.d.ts +10 -0
  111. package/dist/herdr/generated/names/server-capability.js +11 -0
  112. package/dist/herdr/generated/names/subscription-event-kind.d.ts +8 -0
  113. package/dist/herdr/generated/names/subscription-event-kind.js +8 -0
  114. package/dist/herdr/generated/names/subscription-type.d.ts +31 -0
  115. package/dist/herdr/generated/names/subscription-type.js +32 -0
  116. package/dist/herdr/generated/names/token-name-pattern.d.ts +2 -0
  117. package/dist/herdr/generated/names/token-name-pattern.js +4 -0
  118. package/dist/herdr/generated/namespaces.d.ts +785 -0
  119. package/dist/herdr/generated/namespaces.js +3 -0
  120. package/dist/herdr/generated/overrides.d.ts +33 -0
  121. package/dist/herdr/generated/overrides.js +20 -0
  122. package/dist/herdr/generated/params.d.ts +799 -0
  123. package/dist/herdr/generated/params.js +3 -0
  124. package/dist/herdr/generated/preset-methods.d.ts +4 -0
  125. package/dist/herdr/generated/preset-methods.js +7 -0
  126. package/dist/herdr/generated/presets/sessions-reader.d.ts +2 -0
  127. package/dist/herdr/generated/presets/sessions-reader.js +5 -0
  128. package/dist/herdr/generated/results.d.ts +978 -0
  129. package/dist/herdr/generated/results.js +52 -0
  130. package/dist/herdr/generated/test-data/defaults.d.ts +739 -0
  131. package/dist/herdr/generated/test-data/defaults.js +741 -0
  132. package/dist/herdr/generated/test-data/shapes.d.ts +1325 -0
  133. package/dist/herdr/generated/test-data/shapes.js +2245 -0
  134. package/dist/herdr/test-kit/fake-herdr.d.ts +13 -0
  135. package/dist/herdr/test-kit/fake-herdr.js +216 -0
  136. package/dist/herdr/test-kit/fake-protocol.d.ts +107 -0
  137. package/dist/herdr/test-kit/fake-protocol.js +436 -0
  138. package/dist/herdr/test-kit/types.d.ts +88 -0
  139. package/dist/herdr/test-kit/types.js +1 -0
  140. package/dist/herdr/wire/codec.d.ts +36 -0
  141. package/dist/herdr/wire/codec.js +62 -0
  142. package/dist/herdr/wire/connection.d.ts +13 -0
  143. package/dist/herdr/wire/connection.js +65 -0
  144. package/dist/herdr/wire/dedicated.d.ts +2 -0
  145. package/dist/herdr/wire/dedicated.js +238 -0
  146. package/dist/herdr/wire/push-decoder.d.ts +2 -0
  147. package/dist/herdr/wire/push-decoder.js +40 -0
  148. package/dist/herdr/wire/rpc.d.ts +3 -0
  149. package/dist/herdr/wire/rpc.js +141 -0
  150. package/dist/herdr/wire/socket-path.d.ts +8 -0
  151. package/dist/herdr/wire/socket-path.js +23 -0
  152. package/dist/herdr/wire/types.d.ts +78 -0
  153. package/dist/herdr/wire/types.js +1 -0
  154. package/dist/index.d.ts +11 -0
  155. package/dist/index.js +7 -0
  156. package/dist/read-only.d.ts +5 -0
  157. package/dist/read-only.js +6 -0
  158. package/dist/schema.d.ts +5 -0
  159. package/dist/schema.js +6 -0
  160. package/dist/test-kit.d.ts +2 -0
  161. package/dist/test-kit.js +3 -0
  162. package/docs/api/events.md +43 -0
  163. package/docs/api/methods.md +232 -0
  164. package/package.json +112 -4
  165. package/schema/herdr-api.schema.json +10759 -0
  166. package/schema/herdr-version.json +5 -0
  167. package/skills/herdr-sdk/SKILL.md +75 -0
  168. package/skills/herdr-sdk/references/api-map.md +28 -0
  169. package/skills/herdr-sdk/references/errors.md +19 -0
  170. package/skills/herdr-sdk/references/recipes.md +171 -0
  171. package/skills/herdr-sdk/references/versions.md +7 -0
@@ -0,0 +1,799 @@
1
+ import type { Method } from './names/method.js';
2
+ export type AgentPromptParams = {
3
+ "target": string;
4
+ "text": string;
5
+ "wait"?: (AgentPromptWaitOptions) | (null);
6
+ };
7
+ export type AgentPromptWaitOptions = {
8
+ "timeout_ms"?: number | null;
9
+ "until"?: Array<AgentStatus>;
10
+ };
11
+ export type AgentReadParams = {
12
+ "format"?: ReadFormat;
13
+ "lines"?: number | null;
14
+ "source": ReadSource; /** @default true */
15
+ "strip_ansi"?: boolean;
16
+ "target": string;
17
+ };
18
+ export type AgentRenameParams = {
19
+ "name"?: string | null;
20
+ "target": string;
21
+ };
22
+ export type AgentSendKeysParams = {
23
+ "keys": Array<string>;
24
+ "target": string;
25
+ };
26
+ export type AgentStartParams = {
27
+ "args"?: Array<string>;
28
+ "kind": string;
29
+ "name": string;
30
+ "pane_id": string; /** Startup timeout in milliseconds. Values must be greater than 3000 and at most 300000. uint64: values above 2^53 lose precision */
31
+ "timeout_ms"?: number | null;
32
+ };
33
+ export type AgentStatus = "idle" | "working" | "blocked" | "done" | "unknown";
34
+ export type AgentTarget = {
35
+ "target": string;
36
+ };
37
+ export type AgentViewBuiltinField = "status" | "workspace_id" | "tab_id" | "pane_id" | "agent" | "seen" | "state_change_seq";
38
+ export type AgentViewBuiltinSortField = "workspace_order" | "tab_order" | "pane_order" | "attention" | "status" | "agent" | "seen" | "state_change_seq";
39
+ export type AgentViewClearParams = {
40
+ "source"?: string | null;
41
+ };
42
+ export type AgentViewContext = "current_workspace_id" | "current_tab_id";
43
+ export type AgentViewField = (AgentViewBuiltinField) | ({
44
+ "token": string;
45
+ });
46
+ export type AgentViewFilter = ({
47
+ "filters": Array<AgentViewFilter>;
48
+ "op": "all";
49
+ }) | ({
50
+ "filters": Array<AgentViewFilter>;
51
+ "op": "any";
52
+ }) | ({
53
+ "filter": AgentViewFilter;
54
+ "op": "not";
55
+ }) | ({
56
+ "field": AgentViewField;
57
+ "op": "eq";
58
+ "value": AgentViewValue;
59
+ }) | ({
60
+ "field": AgentViewField;
61
+ "op": "in";
62
+ "values": Array<AgentViewValue>;
63
+ }) | ({
64
+ "field": AgentViewField;
65
+ "op": "exists";
66
+ });
67
+ export type AgentViewSetParams = {
68
+ "filter"?: (AgentViewFilter) | (null);
69
+ "label"?: string | null;
70
+ "sort"?: Array<AgentViewSort>;
71
+ "source": string;
72
+ };
73
+ export type AgentViewSort = {
74
+ "field": AgentViewSortField; /** @default "asc" */
75
+ "order"?: AgentViewSortOrder;
76
+ };
77
+ export type AgentViewSortField = (AgentViewBuiltinSortField) | ({
78
+ "token": string;
79
+ });
80
+ export type AgentViewSortOrder = "asc" | "desc";
81
+ export type AgentViewValue = (string) | (boolean) | (number) | ({
82
+ "context": AgentViewContext;
83
+ });
84
+ export type AgentWaitParams = {
85
+ "target": string; /** uint64: values above 2^53 lose precision */
86
+ "timeout_ms"?: number | null;
87
+ "until"?: Array<AgentStatus>;
88
+ };
89
+ /** Updates whether the requesting client shell receives and controls pane presentation. */
90
+ export type ClientShellSurfaceSetParams = {
91
+ "active": boolean;
92
+ };
93
+ export type ClientWindowTitleSetParams = {
94
+ "title": string;
95
+ };
96
+ export type CommandInvokeParams = {
97
+ "command_id": string;
98
+ "pane_id"?: string | null; /** Client-owned selection coordinates, validated against the pane's content revision. */
99
+ "selection"?: (PaneSelectionReadParams) | (null);
100
+ "tab_id"?: string | null;
101
+ "workspace_id"?: string | null;
102
+ };
103
+ export type EmptyParams = Record<string, never>;
104
+ export type EventMatch = ({
105
+ "event": "workspace_created";
106
+ "workspace_id"?: string | null;
107
+ }) | ({
108
+ "event": "workspace_updated";
109
+ "workspace_id": string;
110
+ }) | ({
111
+ "event": "workspace_closed";
112
+ "workspace_id": string;
113
+ }) | ({
114
+ "event": "workspace_renamed";
115
+ "label"?: string | null;
116
+ "workspace_id": string;
117
+ }) | ({
118
+ "event": "workspace_moved";
119
+ "workspace_id": string;
120
+ }) | ({
121
+ "event": "workspace_focused";
122
+ "workspace_id": string;
123
+ }) | ({
124
+ "event": "tab_created";
125
+ "tab_id"?: string | null;
126
+ "workspace_id"?: string | null;
127
+ }) | ({
128
+ "event": "tab_closed";
129
+ "tab_id": string;
130
+ }) | ({
131
+ "event": "tab_renamed";
132
+ "label"?: string | null;
133
+ "tab_id": string;
134
+ }) | ({
135
+ "event": "tab_moved";
136
+ "tab_id": string;
137
+ }) | ({
138
+ "event": "tab_focused";
139
+ "tab_id": string;
140
+ }) | ({
141
+ "event": "pane_created";
142
+ "pane_id"?: string | null;
143
+ "workspace_id"?: string | null;
144
+ }) | ({
145
+ "event": "pane_closed";
146
+ "pane_id": string;
147
+ }) | ({
148
+ "event": "pane_focused";
149
+ "pane_id": string;
150
+ }) | ({
151
+ "event": "pane_moved";
152
+ "pane_id": string;
153
+ }) | ({
154
+ "event": "pane_output_changed"; /** uint64: values above 2^53 lose precision */
155
+ "min_revision"?: number | null;
156
+ "pane_id": string;
157
+ }) | ({
158
+ "event": "pane_exited";
159
+ "pane_id": string;
160
+ }) | ({
161
+ "agent"?: string | null;
162
+ "event": "pane_agent_detected";
163
+ "pane_id": string;
164
+ }) | ({
165
+ "agent_status": AgentStatus;
166
+ "event": "pane_agent_status_changed";
167
+ "pane_id": string;
168
+ });
169
+ export type EventsSubscribeParams = {
170
+ "subscriptions": Array<Subscription>;
171
+ };
172
+ export type EventsWaitParams = {
173
+ "match_event": EventMatch; /** uint64: values above 2^53 lose precision */
174
+ "timeout_ms"?: number | null;
175
+ };
176
+ export type IntegrationInstallParams = {
177
+ "target": IntegrationTarget;
178
+ };
179
+ export type IntegrationTarget = "pi" | "omp" | "claude" | "codex" | "copilot" | "devin" | "droid" | "kimi" | "opencode" | "kilo" | "hermes" | "qodercli" | "qwen" | "cursor" | "mastracode" | "antigravity_cli" | "grok";
180
+ export type IntegrationUninstallParams = {
181
+ "target": IntegrationTarget;
182
+ };
183
+ export type LayoutApplyParams = {
184
+ "focus"?: boolean;
185
+ "root": LayoutNode;
186
+ "tab_id"?: string | null;
187
+ "tab_label"?: string | null;
188
+ "workspace_id"?: string | null;
189
+ };
190
+ export type LayoutExportParams = {
191
+ "pane_id"?: string | null;
192
+ "tab_id"?: string | null;
193
+ };
194
+ export type LayoutNode = ({
195
+ "command"?: Array<string> | null;
196
+ "cwd"?: string | null;
197
+ "env"?: {
198
+ [key: string]: string;
199
+ };
200
+ "label"?: string | null;
201
+ "pane_id"?: string | null;
202
+ "type": "pane";
203
+ }) | ({
204
+ "direction": SplitDirection;
205
+ "first": LayoutNode;
206
+ "ratio": number;
207
+ "second": LayoutNode;
208
+ "type": "split";
209
+ });
210
+ export type LayoutSetSplitRatioParams = {
211
+ "pane_id"?: string | null;
212
+ "path": Array<boolean>;
213
+ "ratio": number;
214
+ "tab_id"?: string | null;
215
+ };
216
+ export type NotificationShowParams = {
217
+ "body"?: string | null;
218
+ "position"?: (ToastHerdrPosition) | (null);
219
+ "sound"?: NotificationShowSound;
220
+ "title": string;
221
+ };
222
+ export type NotificationShowSound = "none" | "done" | "request";
223
+ export type OutputMatch = ({
224
+ "type": "substring";
225
+ "value": string;
226
+ }) | ({
227
+ "type": "regex";
228
+ "value": string;
229
+ });
230
+ export type PaneAgentState = "idle" | "working" | "blocked" | "unknown";
231
+ export type PaneClearAgentAuthorityParams = {
232
+ "pane_id": string; /** uint64: values above 2^53 lose precision */
233
+ "seq"?: number | null;
234
+ "source"?: string | null;
235
+ };
236
+ 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";
237
+ export type PaneCopyMotionParams = {
238
+ "content_revision"?: number | null;
239
+ "cursor": PaneTextPoint;
240
+ "motion": PaneCopyMotion;
241
+ "pane_id": string;
242
+ };
243
+ export type PaneCopySearchDirection = "forward" | "backward";
244
+ export type PaneCopySearchParams = {
245
+ "content_revision": number;
246
+ "cursor": PaneTextPoint;
247
+ "direction": PaneCopySearchDirection;
248
+ "pane_id": string;
249
+ "previous"?: (PaneTextRange) | (null);
250
+ "query": string;
251
+ };
252
+ export type PaneCurrentParams = {
253
+ "caller_pane_id"?: string | null;
254
+ };
255
+ export type PaneDirection = "left" | "right" | "up" | "down";
256
+ export type PaneEdgesParams = {
257
+ "pane_id"?: string | null;
258
+ };
259
+ export type PaneFocusDirectionParams = {
260
+ "direction": PaneDirection;
261
+ "pane_id"?: string | null;
262
+ };
263
+ export type PaneInputSetParams = {
264
+ "pane_id": string;
265
+ "right_click": PaneRightClickTarget;
266
+ };
267
+ export type PaneLayoutParams = {
268
+ "pane_id"?: string | null;
269
+ };
270
+ export type PaneLinkActivateParams = {
271
+ "col": number; /** uint64: values above 2^53 lose precision */
272
+ "content_revision"?: number | null; /** uint64: values above 2^53 lose precision */
273
+ "offset_from_bottom"?: number | null;
274
+ "pane_id": string;
275
+ "viewport_row": number;
276
+ };
277
+ export type PaneListParams = {
278
+ "workspace_id"?: string | null;
279
+ };
280
+ export type PaneMoveDestination = ({
281
+ "ratio"?: number | null;
282
+ "split": SplitDirection;
283
+ "tab_id": string;
284
+ "target_pane_id"?: string | null;
285
+ "type": "tab";
286
+ }) | ({
287
+ "label"?: string | null;
288
+ "type": "new_tab";
289
+ "workspace_id"?: string | null;
290
+ }) | ({
291
+ "label"?: string | null;
292
+ "tab_label"?: string | null;
293
+ "type": "new_workspace";
294
+ });
295
+ export type PaneMoveParams = {
296
+ "destination": PaneMoveDestination; /** @default false */
297
+ "focus"?: boolean;
298
+ "pane_id": string;
299
+ };
300
+ export type PaneNeighborParams = {
301
+ "direction": PaneDirection;
302
+ "pane_id"?: string | null;
303
+ };
304
+ export type PaneProcessInfoParams = {
305
+ "pane_id"?: string | null;
306
+ };
307
+ export type PaneReadParams = {
308
+ "format"?: ReadFormat;
309
+ "lines"?: number | null;
310
+ "pane_id": string;
311
+ "source": ReadSource; /** @default true */
312
+ "strip_ansi"?: boolean;
313
+ };
314
+ export type PaneReleaseAgentParams = {
315
+ "agent": string;
316
+ "pane_id": string; /** uint64: values above 2^53 lose precision */
317
+ "seq"?: number | null;
318
+ "source": string;
319
+ };
320
+ export type PaneRenameParams = {
321
+ "label"?: string | null;
322
+ "pane_id": string;
323
+ };
324
+ export type PaneReportAgentParams = {
325
+ "agent": string;
326
+ "agent_session_id"?: string | null;
327
+ "agent_session_path"?: string | null;
328
+ "message"?: string | null;
329
+ "pane_id": string; /** Command that resumes this agent's session after a Herdr restart. The first element must be a plain command name. */
330
+ "resume_argv"?: Array<string> | null; /** uint64: values above 2^53 lose precision */
331
+ "seq"?: number | null;
332
+ "source": string;
333
+ "state": PaneAgentState;
334
+ };
335
+ export type PaneReportAgentSessionParams = {
336
+ "agent": string;
337
+ "agent_session_id"?: string | null;
338
+ "agent_session_path"?: string | null;
339
+ "pane_id": string; /** Command that resumes this agent's session after a Herdr restart. The first element must be a plain command name. */
340
+ "resume_argv"?: Array<string> | null; /** uint64: values above 2^53 lose precision */
341
+ "seq"?: number | null;
342
+ "session_start_source"?: string | null;
343
+ "source": string;
344
+ };
345
+ export type PaneReportMetadataParams = {
346
+ "agent"?: string | null;
347
+ "applies_to_source"?: string | null; /** @default false */
348
+ "clear_display_agent"?: boolean; /** @default false */
349
+ "clear_state_labels"?: boolean; /** @default false */
350
+ "clear_title"?: boolean;
351
+ "display_agent"?: string | null;
352
+ "pane_id": string; /** uint64: values above 2^53 lose precision */
353
+ "seq"?: number | null;
354
+ "source": string;
355
+ "state_labels"?: {
356
+ [key: string]: string;
357
+ };
358
+ "title"?: string | null; /** keys match ^[A-Za-z0-9_-]{1,32}$ */
359
+ "tokens"?: {
360
+ [key: string]: string | null;
361
+ }; /** uint64: values above 2^53 lose precision */
362
+ "ttl_ms"?: number | null;
363
+ };
364
+ export type PaneResizeParams = {
365
+ "amount"?: number | null;
366
+ "direction": PaneDirection;
367
+ "pane_id"?: string | null;
368
+ };
369
+ export type PaneRightClickTarget = "herdr" | "pane";
370
+ export type PaneScrollParams = {
371
+ "offset_from_bottom": number;
372
+ "pane_id": string;
373
+ };
374
+ export type PaneSelectionReadParams = {
375
+ "anchor": PaneTextPoint; /** uint64: values above 2^53 lose precision */
376
+ "content_revision"?: number | null;
377
+ "cursor": PaneTextPoint;
378
+ "pane_id": string;
379
+ };
380
+ export type PaneSendInputParams = {
381
+ "keys"?: Array<string>;
382
+ "pane_id": string;
383
+ "text"?: string;
384
+ };
385
+ export type PaneSendKeysParams = {
386
+ "keys": Array<string>;
387
+ "pane_id": string;
388
+ };
389
+ export type PaneSendTextParams = {
390
+ "pane_id": string;
391
+ "text": string;
392
+ };
393
+ export type PaneSplitParams = {
394
+ "cwd"?: string | null;
395
+ "direction": SplitDirection;
396
+ "env"?: {
397
+ [key: string]: string;
398
+ }; /** @default false */
399
+ "focus"?: boolean;
400
+ "ratio"?: number | null; /** @default "herdr" */
401
+ "right_click"?: PaneRightClickTarget;
402
+ "target_pane_id"?: string | null;
403
+ "workspace_id"?: string | null;
404
+ };
405
+ export type PaneSwapParams = {
406
+ "direction"?: (PaneDirection) | (null);
407
+ "pane_id"?: string | null;
408
+ "source_pane_id"?: string | null;
409
+ "target_pane_id"?: string | null;
410
+ };
411
+ export type PaneTarget = {
412
+ "pane_id": string;
413
+ };
414
+ export type PaneTextPoint = {
415
+ "col": number;
416
+ "row": number;
417
+ };
418
+ export type PaneTextRange = {
419
+ "end": PaneTextPoint;
420
+ "start": PaneTextPoint;
421
+ };
422
+ export type PaneWaitForOutputParams = {
423
+ "lines"?: number | null;
424
+ "match": OutputMatch;
425
+ "pane_id": string;
426
+ "source": ReadSource; /** @default true */
427
+ "strip_ansi"?: boolean; /** uint64: values above 2^53 lose precision */
428
+ "timeout_ms"?: number | null;
429
+ };
430
+ export type PaneZoomMode = "toggle" | "on" | "off";
431
+ export type PaneZoomParams = {
432
+ "mode"?: PaneZoomMode;
433
+ "pane_id"?: string | null;
434
+ };
435
+ export type PingParams = Record<string, never>;
436
+ export type PluginActionInvokeParams = {
437
+ "action_id": string;
438
+ "context"?: (PluginInvocationContext) | (null);
439
+ "plugin_id"?: string | null;
440
+ };
441
+ export type PluginActionListParams = {
442
+ "plugin_id"?: string | null;
443
+ };
444
+ export type PluginInvocationContext = {
445
+ "clicked_url"?: string | null;
446
+ "correlation_id"?: string | null;
447
+ "focused_pane_agent"?: string | null;
448
+ "focused_pane_cwd"?: string | null;
449
+ "focused_pane_id"?: string | null;
450
+ "focused_pane_status"?: (AgentStatus) | (null);
451
+ "invocation_source"?: string | null;
452
+ "link_handler_id"?: string | null;
453
+ "selected_text"?: string | null;
454
+ "tab_id"?: string | null;
455
+ "tab_label"?: string | null;
456
+ "workspace_cwd"?: string | null;
457
+ "workspace_id"?: string | null;
458
+ "workspace_label"?: string | null;
459
+ "worktree"?: (WorkspaceWorktreeInfo) | (null);
460
+ };
461
+ export type PluginLinkParams = {
462
+ "enabled"?: boolean;
463
+ "path": string;
464
+ "source"?: (PluginSourceInfo) | (null);
465
+ };
466
+ export type PluginListParams = {
467
+ "plugin_id"?: string | null;
468
+ };
469
+ export type PluginLogListParams = {
470
+ "limit"?: number | null;
471
+ "plugin_id"?: string | null;
472
+ };
473
+ export type PluginPaneCloseParams = {
474
+ "pane_id": string;
475
+ };
476
+ export type PluginPaneFocusParams = {
477
+ "pane_id": string;
478
+ };
479
+ export type PluginPaneOpenParams = {
480
+ "cwd"?: string | null;
481
+ "direction"?: (SplitDirection) | (null);
482
+ "entrypoint": string;
483
+ "env"?: {
484
+ [key: string]: string;
485
+ }; /** @default false */
486
+ "focus"?: boolean;
487
+ "height"?: (PopupSize) | (null);
488
+ "placement"?: (PluginPanePlacement) | (null);
489
+ "plugin_id": string;
490
+ "target_pane_id"?: string | null;
491
+ "width"?: (PopupSize) | (null);
492
+ "workspace_id"?: string | null;
493
+ };
494
+ export type PluginPanePlacement = "overlay" | "popup" | "split" | "tab" | "zoomed";
495
+ export type PluginSetEnabledParams = {
496
+ "plugin_id": string;
497
+ };
498
+ export type PluginSourceInfo = {
499
+ "installed_unix_ms"?: number | null; /** @default "local" */
500
+ "kind"?: PluginSourceKind;
501
+ "managed_path"?: string | null;
502
+ "owner"?: string | null;
503
+ "repo"?: string | null;
504
+ "requested_ref"?: string | null;
505
+ "resolved_commit"?: string | null;
506
+ "subdir"?: string | null;
507
+ };
508
+ export type PluginSourceKind = "local" | "github";
509
+ export type PluginUnlinkParams = {
510
+ "plugin_id": string;
511
+ };
512
+ export type PopupSize = (number) | (string);
513
+ export type ProductAnnouncementDismissParams = {
514
+ "id": string;
515
+ "version": string;
516
+ };
517
+ export type ReadFormat = "text" | "ansi";
518
+ export type ReadSource = "visible" | "recent" | "recent_unwrapped" | "detection";
519
+ export type ReleaseNotesDismissParams = {
520
+ "version": string;
521
+ };
522
+ export type ServerLiveHandoffParams = {
523
+ "expected_protocol"?: number | null;
524
+ "expected_version"?: string | null;
525
+ "import_exe"?: string | null;
526
+ };
527
+ export type ServerSshAgentRegisterParams = {
528
+ "socket_path": string;
529
+ };
530
+ export type SplitDirection = "right" | "down";
531
+ export type Subscription = ({
532
+ "type": "workspace.created";
533
+ }) | ({
534
+ "type": "workspace.updated";
535
+ }) | ({
536
+ "type": "workspace.metadata_updated";
537
+ }) | ({
538
+ "type": "workspace.renamed";
539
+ }) | ({
540
+ "type": "workspace.moved";
541
+ }) | ({
542
+ "type": "workspace.reordered";
543
+ }) | ({
544
+ "type": "workspace.closed";
545
+ }) | ({
546
+ "type": "workspace.focused";
547
+ }) | ({
548
+ "type": "worktree.created";
549
+ }) | ({
550
+ "type": "worktree.opened";
551
+ }) | ({
552
+ "type": "worktree.removed";
553
+ }) | ({
554
+ "type": "tab.created";
555
+ }) | ({
556
+ "type": "tab.closed";
557
+ }) | ({
558
+ "type": "tab.focused";
559
+ }) | ({
560
+ "type": "tab.renamed";
561
+ }) | ({
562
+ "type": "tab.moved";
563
+ }) | ({
564
+ "type": "pane.created";
565
+ }) | ({
566
+ "type": "pane.closed";
567
+ }) | ({
568
+ "type": "pane.updated";
569
+ }) | ({
570
+ "type": "pane.focused";
571
+ }) | ({
572
+ "type": "pane.moved";
573
+ }) | ({
574
+ "type": "pane.exited";
575
+ }) | ({
576
+ "type": "pane.agent_detected";
577
+ }) | ({
578
+ "lines"?: number | null;
579
+ "match": OutputMatch;
580
+ "pane_id": string;
581
+ "source": ReadSource; /** @default true */
582
+ "strip_ansi"?: boolean;
583
+ "type": "pane.output_matched";
584
+ }) | ({
585
+ "agent_status"?: (AgentStatus) | (null);
586
+ "pane_id": string;
587
+ "type": "pane.agent_status_changed";
588
+ }) | ({
589
+ "pane_id": string;
590
+ "type": "pane.scroll_changed";
591
+ }) | ({
592
+ "type": "layout.updated";
593
+ });
594
+ export type TabCreateParams = {
595
+ "cwd"?: string | null;
596
+ "env"?: {
597
+ [key: string]: string;
598
+ }; /** @default false */
599
+ "focus"?: boolean;
600
+ "label"?: string | null;
601
+ "workspace_id"?: string | null;
602
+ };
603
+ export type TabListParams = {
604
+ "workspace_id"?: string | null;
605
+ };
606
+ export type TabMoveParams = {
607
+ "insert_index": number;
608
+ "tab_id": string;
609
+ };
610
+ export type TabRenameParams = {
611
+ "label": string;
612
+ "tab_id": string;
613
+ };
614
+ export type TabTarget = {
615
+ "tab_id": string;
616
+ };
617
+ export type ToastHerdrPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
618
+ export type WorkspaceCloseParams = {
619
+ "close_group"?: boolean;
620
+ "workspace_id": string;
621
+ };
622
+ export type WorkspaceCreateParams = {
623
+ "cwd"?: string | null;
624
+ "env"?: {
625
+ [key: string]: string;
626
+ }; /** @default false */
627
+ "focus"?: boolean;
628
+ "label"?: string | null; /** Workspace whose focused pane supplies the `follow` cwd policy. */
629
+ "source_workspace_id"?: string | null;
630
+ };
631
+ export type WorkspaceMoveBlockParams = {
632
+ "before_workspace_id"?: string | null;
633
+ "workspace_ids": Array<string>;
634
+ };
635
+ export type WorkspaceMoveParams = {
636
+ "insert_index": number;
637
+ "workspace_id": string;
638
+ };
639
+ export type WorkspaceRenameParams = {
640
+ "label": string;
641
+ "workspace_id": string;
642
+ };
643
+ export type WorkspaceReportMetadataParams = {
644
+ "seq"?: number | null;
645
+ "source": string; /** keys match ^[A-Za-z0-9_-]{1,32}$ */
646
+ "tokens": {
647
+ [key: string]: string | null;
648
+ }; /** uint64: values above 2^53 lose precision */
649
+ "ttl_ms"?: number | null;
650
+ "workspace_id": string;
651
+ };
652
+ export type WorkspaceTarget = {
653
+ "workspace_id": string;
654
+ };
655
+ export type WorkspaceWorktreeInfo = {
656
+ "checkout_path": string;
657
+ "is_linked_worktree": boolean;
658
+ "repo_key": string;
659
+ "repo_name": string;
660
+ "repo_root": string;
661
+ };
662
+ export type WorktreeCreateParams = {
663
+ "base"?: string | null;
664
+ "branch"?: string | null;
665
+ "cwd"?: string | null; /** @default false */
666
+ "focus"?: boolean;
667
+ "label"?: string | null;
668
+ "path"?: string | null;
669
+ "trust_repository"?: boolean;
670
+ "workspace_id"?: string | null;
671
+ };
672
+ export type WorktreeListParams = {
673
+ "cwd"?: string | null;
674
+ "trust_repository"?: boolean;
675
+ "workspace_id"?: string | null;
676
+ };
677
+ export type WorktreeOpenParams = {
678
+ "branch"?: string | null;
679
+ "cwd"?: string | null; /** @default false */
680
+ "focus"?: boolean;
681
+ "label"?: string | null;
682
+ "path"?: string | null;
683
+ "trust_repository"?: boolean;
684
+ "workspace_id"?: string | null;
685
+ };
686
+ export type WorktreeRemoveParams = {
687
+ "force"?: boolean;
688
+ "trust_repository"?: boolean;
689
+ "workspace_id": string;
690
+ };
691
+ /** Every method the server accepts, mapped to its params type. */
692
+ export interface MethodParams {
693
+ "ping": PingParams;
694
+ "server.stop": EmptyParams;
695
+ "server.live_handoff": ServerLiveHandoffParams;
696
+ "server.reload_config": EmptyParams;
697
+ "server.ssh_agent.register": ServerSshAgentRegisterParams;
698
+ "server.agent_manifests": EmptyParams;
699
+ "server.reload_agent_manifests": EmptyParams;
700
+ "notification.show": NotificationShowParams;
701
+ "product_announcement.dismiss": ProductAnnouncementDismissParams;
702
+ "release_notes.dismiss": ReleaseNotesDismissParams;
703
+ "command.invoke": CommandInvokeParams;
704
+ "client.window_title.set": ClientWindowTitleSetParams;
705
+ "client.window_title.clear": EmptyParams;
706
+ "client_shell.surface.set": ClientShellSurfaceSetParams;
707
+ "session.snapshot": EmptyParams;
708
+ "workspace.create": WorkspaceCreateParams;
709
+ "workspace.list": EmptyParams;
710
+ "workspace.get": WorkspaceTarget;
711
+ "workspace.focus": WorkspaceTarget;
712
+ "workspace.rename": WorkspaceRenameParams;
713
+ "workspace.move": WorkspaceMoveParams;
714
+ "workspace.move_block": WorkspaceMoveBlockParams;
715
+ "workspace.report_metadata": WorkspaceReportMetadataParams;
716
+ "workspace.close": WorkspaceCloseParams;
717
+ "worktree.list": WorktreeListParams;
718
+ "worktree.create": WorktreeCreateParams;
719
+ "worktree.open": WorktreeOpenParams;
720
+ "worktree.remove": WorktreeRemoveParams;
721
+ "tab.create": TabCreateParams;
722
+ "tab.list": TabListParams;
723
+ "tab.get": TabTarget;
724
+ "tab.focus": TabTarget;
725
+ "tab.rename": TabRenameParams;
726
+ "tab.move": TabMoveParams;
727
+ "tab.close": TabTarget;
728
+ "agent.list": EmptyParams;
729
+ "agent.get": AgentTarget;
730
+ "agent.read": AgentReadParams;
731
+ "agent.explain": AgentTarget;
732
+ "agent.send_keys": AgentSendKeysParams;
733
+ "agent.rename": AgentRenameParams;
734
+ "agent.view.set": AgentViewSetParams;
735
+ "agent.view.clear": AgentViewClearParams;
736
+ "agent.focus": AgentTarget;
737
+ "agent.start": AgentStartParams;
738
+ "agent.prompt": AgentPromptParams;
739
+ "agent.wait": AgentWaitParams;
740
+ "pane.split": PaneSplitParams;
741
+ "pane.swap": PaneSwapParams;
742
+ "pane.move": PaneMoveParams;
743
+ "pane.zoom": PaneZoomParams;
744
+ "pane.layout": PaneLayoutParams;
745
+ "pane.process_info": PaneProcessInfoParams;
746
+ "layout.export": LayoutExportParams;
747
+ "layout.apply": LayoutApplyParams;
748
+ "layout.set_split_ratio": LayoutSetSplitRatioParams;
749
+ "pane.neighbor": PaneNeighborParams;
750
+ "pane.edges": PaneEdgesParams;
751
+ "pane.focus_direction": PaneFocusDirectionParams;
752
+ "pane.resize": PaneResizeParams;
753
+ "pane.scroll": PaneScrollParams;
754
+ "pane.clear": PaneTarget;
755
+ "pane.edit_scrollback": PaneTarget;
756
+ "pane.selection.read": PaneSelectionReadParams;
757
+ "pane.copy_motion": PaneCopyMotionParams;
758
+ "pane.copy_search": PaneCopySearchParams;
759
+ "pane.list": PaneListParams;
760
+ "pane.current": PaneCurrentParams;
761
+ "pane.get": PaneTarget;
762
+ "pane.focus": PaneTarget;
763
+ "pane.input.set": PaneInputSetParams;
764
+ "pane.link.activate": PaneLinkActivateParams;
765
+ "pane.link.resolve": PaneLinkActivateParams;
766
+ "pane.rename": PaneRenameParams;
767
+ "pane.send_text": PaneSendTextParams;
768
+ "pane.send_keys": PaneSendKeysParams;
769
+ "pane.send_input": PaneSendInputParams;
770
+ "pane.read": PaneReadParams;
771
+ "pane.report_agent": PaneReportAgentParams;
772
+ "pane.report_agent_session": PaneReportAgentSessionParams;
773
+ "pane.report_metadata": PaneReportMetadataParams;
774
+ "pane.clear_agent_authority": PaneClearAgentAuthorityParams;
775
+ "pane.release_agent": PaneReleaseAgentParams;
776
+ "pane.close": PaneTarget;
777
+ "popup.close": EmptyParams;
778
+ "events.subscribe": EventsSubscribeParams;
779
+ "events.wait": EventsWaitParams;
780
+ "pane.wait_for_output": PaneWaitForOutputParams;
781
+ "integration.list": EmptyParams;
782
+ "integration.install": IntegrationInstallParams;
783
+ "integration.uninstall": IntegrationUninstallParams;
784
+ "plugin.link": PluginLinkParams;
785
+ "plugin.list": PluginListParams;
786
+ "plugin.unlink": PluginUnlinkParams;
787
+ "plugin.enable": PluginSetEnabledParams;
788
+ "plugin.disable": PluginSetEnabledParams;
789
+ "plugin.action.list": PluginActionListParams;
790
+ "plugin.action.invoke": PluginActionInvokeParams;
791
+ "plugin.log.list": PluginLogListParams;
792
+ "plugin.pane.open": PluginPaneOpenParams;
793
+ "plugin.pane.focus": PluginPaneFocusParams;
794
+ "plugin.pane.close": PluginPaneCloseParams;
795
+ }
796
+ /** Fails to compile when a method in methods.ts has no entry in MethodParams. */
797
+ export type MethodParamsCheck = {
798
+ [M in Method]: MethodParams[M];
799
+ };