@neosh/api 0.1.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 (182) hide show
  1. package/package.json +31 -0
  2. package/src/generated/AccountKind.ts +9 -0
  3. package/src/generated/Activity.ts +85 -0
  4. package/src/generated/AgentCommand.ts +18 -0
  5. package/src/generated/AgentState.ts +6 -0
  6. package/src/generated/AgentSummary.ts +46 -0
  7. package/src/generated/Anchor.ts +12 -0
  8. package/src/generated/Animation.ts +40 -0
  9. package/src/generated/ApiCall.ts +520 -0
  10. package/src/generated/ApiError.ts +15 -0
  11. package/src/generated/ApiOk.ts +110 -0
  12. package/src/generated/ApiResponse.ts +8 -0
  13. package/src/generated/AscpMessage.ts +73 -0
  14. package/src/generated/AttachmentInfo.ts +25 -0
  15. package/src/generated/Attrs.ts +10 -0
  16. package/src/generated/AuthRef.ts +14 -0
  17. package/src/generated/BackgroundTask.ts +23 -0
  18. package/src/generated/BlockStartKind.ts +8 -0
  19. package/src/generated/BorderStyle.ts +3 -0
  20. package/src/generated/BranchInfo.ts +19 -0
  21. package/src/generated/Brand.ts +31 -0
  22. package/src/generated/BufferId.ts +6 -0
  23. package/src/generated/BuildId.ts +24 -0
  24. package/src/generated/Capability.ts +10 -0
  25. package/src/generated/ClientMessage.ts +67 -0
  26. package/src/generated/Color.ts +10 -0
  27. package/src/generated/CommandEntry.ts +13 -0
  28. package/src/generated/CommitInfo.ts +10 -0
  29. package/src/generated/ContentBlock.ts +39 -0
  30. package/src/generated/Contribution.ts +16 -0
  31. package/src/generated/CostBasis.ts +6 -0
  32. package/src/generated/CredentialInfo.ts +30 -0
  33. package/src/generated/CredentialSource.ts +18 -0
  34. package/src/generated/CursorMotion.ts +21 -0
  35. package/src/generated/CursorShape.ts +6 -0
  36. package/src/generated/DetachReason.ts +5 -0
  37. package/src/generated/DiffTarget.ts +10 -0
  38. package/src/generated/Dock.ts +9 -0
  39. package/src/generated/DriverCommand.ts +20 -0
  40. package/src/generated/DriverKind.ts +8 -0
  41. package/src/generated/Extent.ts +20 -0
  42. package/src/generated/ExtmarkId.ts +6 -0
  43. package/src/generated/ExtmarkInfo.ts +43 -0
  44. package/src/generated/ExtmarkOpts.ts +33 -0
  45. package/src/generated/ExtmarkRender.ts +44 -0
  46. package/src/generated/FileChange.ts +18 -0
  47. package/src/generated/FileState.ts +15 -0
  48. package/src/generated/FloatConfig.ts +63 -0
  49. package/src/generated/FrameSet.ts +9 -0
  50. package/src/generated/Gravity.ts +11 -0
  51. package/src/generated/HighlightDef.ts +13 -0
  52. package/src/generated/HighlightEntry.ts +14 -0
  53. package/src/generated/HighlightSpec.ts +19 -0
  54. package/src/generated/Hint.ts +18 -0
  55. package/src/generated/HlTarget.ts +10 -0
  56. package/src/generated/HookInvocation.ts +14 -0
  57. package/src/generated/HookName.ts +17 -0
  58. package/src/generated/HookOutcome.ts +14 -0
  59. package/src/generated/HookPayload.ts +95 -0
  60. package/src/generated/InputEvent.ts +31 -0
  61. package/src/generated/InstanceConfig.ts +26 -0
  62. package/src/generated/InstanceId.ts +6 -0
  63. package/src/generated/KeyCode.ts +20 -0
  64. package/src/generated/KeyContext.ts +24 -0
  65. package/src/generated/KeyMods.ts +8 -0
  66. package/src/generated/KeyPress.ts +5 -0
  67. package/src/generated/KeymapEntry.ts +11 -0
  68. package/src/generated/KeymapScope.ts +20 -0
  69. package/src/generated/LineDraw.ts +15 -0
  70. package/src/generated/LineRender.ts +9 -0
  71. package/src/generated/LinkState.ts +16 -0
  72. package/src/generated/MarkDraw.ts +40 -0
  73. package/src/generated/Message.ts +5 -0
  74. package/src/generated/MessageLevel.ts +3 -0
  75. package/src/generated/Mode.ts +6 -0
  76. package/src/generated/ModelCapabilities.ts +14 -0
  77. package/src/generated/ModelEntry.ts +13 -0
  78. package/src/generated/ModelId.ts +6 -0
  79. package/src/generated/ModelInfo.ts +30 -0
  80. package/src/generated/ModelSelection.ts +15 -0
  81. package/src/generated/ModelTier.ts +14 -0
  82. package/src/generated/NamespaceId.ts +6 -0
  83. package/src/generated/NodeCapabilities.ts +30 -0
  84. package/src/generated/NodeId.ts +11 -0
  85. package/src/generated/NodeInfo.ts +24 -0
  86. package/src/generated/NoticeKind.ts +11 -0
  87. package/src/generated/Offset.ts +7 -0
  88. package/src/generated/OnDelete.ts +7 -0
  89. package/src/generated/OptionChoice.ts +8 -0
  90. package/src/generated/OptionEntry.ts +23 -0
  91. package/src/generated/OptionSelection.ts +4 -0
  92. package/src/generated/OptionSpec.ts +17 -0
  93. package/src/generated/OptionType.ts +16 -0
  94. package/src/generated/OptionValue.ts +13 -0
  95. package/src/generated/PermissionDecision.ts +6 -0
  96. package/src/generated/PermissionMode.ts +3 -0
  97. package/src/generated/PermissionOption.ts +21 -0
  98. package/src/generated/PermissionOptionKind.ts +13 -0
  99. package/src/generated/PlanState.ts +6 -0
  100. package/src/generated/PlanStep.ts +7 -0
  101. package/src/generated/PluginActivation.ts +10 -0
  102. package/src/generated/PluginEvent.ts +77 -0
  103. package/src/generated/PluginId.ts +6 -0
  104. package/src/generated/PluginInbound.ts +10 -0
  105. package/src/generated/PluginInfo.ts +19 -0
  106. package/src/generated/PluginManifest.ts +54 -0
  107. package/src/generated/PluginOutbound.ts +11 -0
  108. package/src/generated/PluginPermission.ts +18 -0
  109. package/src/generated/PluginProvides.ts +19 -0
  110. package/src/generated/PluginRequest.ts +11 -0
  111. package/src/generated/PluginResponse.ts +10 -0
  112. package/src/generated/PointInfo.ts +16 -0
  113. package/src/generated/Pricing.ts +12 -0
  114. package/src/generated/ProjectKey.ts +21 -0
  115. package/src/generated/ProviderEmit.ts +11 -0
  116. package/src/generated/ProviderEvent.ts +32 -0
  117. package/src/generated/ProviderOptionDescriptor.ts +38 -0
  118. package/src/generated/ProviderOptionValue.ts +3 -0
  119. package/src/generated/QuestionAnswer.ts +24 -0
  120. package/src/generated/QuestionOption.ts +17 -0
  121. package/src/generated/QuotaCredits.ts +23 -0
  122. package/src/generated/QuotaSample.ts +19 -0
  123. package/src/generated/QuotaSeverity.ts +11 -0
  124. package/src/generated/QuotaSnapshot.ts +34 -0
  125. package/src/generated/QuotaSource.ts +6 -0
  126. package/src/generated/QuotaWindow.ts +40 -0
  127. package/src/generated/Rect.ts +7 -0
  128. package/src/generated/Refusal.ts +10 -0
  129. package/src/generated/RemoteProject.ts +19 -0
  130. package/src/generated/RepoInfo.ts +23 -0
  131. package/src/generated/RepoStatus.ts +5 -0
  132. package/src/generated/RequestId.ts +6 -0
  133. package/src/generated/Role.ts +3 -0
  134. package/src/generated/RunningTurn.ts +12 -0
  135. package/src/generated/SelectShape.ts +6 -0
  136. package/src/generated/ServerMessage.ts +15 -0
  137. package/src/generated/SessionId.ts +6 -0
  138. package/src/generated/SessionInfo.ts +171 -0
  139. package/src/generated/StatusAlign.ts +3 -0
  140. package/src/generated/StatusSegment.ts +49 -0
  141. package/src/generated/StopReason.ts +16 -0
  142. package/src/generated/StreamEvent.ts +26 -0
  143. package/src/generated/StreamId.ts +6 -0
  144. package/src/generated/SurfaceCell.ts +22 -0
  145. package/src/generated/SurfaceId.ts +6 -0
  146. package/src/generated/SwarmAgent.ts +11 -0
  147. package/src/generated/SwarmNode.ts +24 -0
  148. package/src/generated/SwarmStranger.ts +21 -0
  149. package/src/generated/TaskId.ts +11 -0
  150. package/src/generated/TaskStatus.ts +11 -0
  151. package/src/generated/TextEdit.ts +19 -0
  152. package/src/generated/ToolCall.ts +13 -0
  153. package/src/generated/ToolCallId.ts +6 -0
  154. package/src/generated/ToolDef.ts +12 -0
  155. package/src/generated/ToolInvocation.ts +11 -0
  156. package/src/generated/ToolResult.ts +3 -0
  157. package/src/generated/ToolSource.ts +12 -0
  158. package/src/generated/TurnId.ts +6 -0
  159. package/src/generated/TurnRequest.ts +56 -0
  160. package/src/generated/UiEvent.ts +80 -0
  161. package/src/generated/Usage.ts +15 -0
  162. package/src/generated/UsageBucket.ts +32 -0
  163. package/src/generated/UsageHistory.ts +23 -0
  164. package/src/generated/UsageResolution.ts +6 -0
  165. package/src/generated/UsageScanSource.ts +24 -0
  166. package/src/generated/UsageScanStatus.ts +3 -0
  167. package/src/generated/UserQuestion.ts +34 -0
  168. package/src/generated/VarScope.ts +18 -0
  169. package/src/generated/ViewId.ts +16 -0
  170. package/src/generated/ViewInfo.ts +23 -0
  171. package/src/generated/Viewport.ts +18 -0
  172. package/src/generated/VirtChunk.ts +6 -0
  173. package/src/generated/VirtTextPos.ts +6 -0
  174. package/src/generated/WindowId.ts +6 -0
  175. package/src/generated/WindowInfo.ts +22 -0
  176. package/src/generated/WindowLayout.ts +28 -0
  177. package/src/generated/WorkspaceStatus.ts +28 -0
  178. package/src/generated/WorktreeInfo.ts +16 -0
  179. package/src/globals.d.ts +39 -0
  180. package/src/index.ts +2961 -0
  181. package/src/ui.ts +3279 -0
  182. package/tsconfig.json +17 -0
@@ -0,0 +1,520 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { AgentCommand } from "./AgentCommand";
3
+ import type { BufferId } from "./BufferId";
4
+ import type { Capability } from "./Capability";
5
+ import type { CursorMotion } from "./CursorMotion";
6
+ import type { CursorShape } from "./CursorShape";
7
+ import type { DiffTarget } from "./DiffTarget";
8
+ import type { DriverKind } from "./DriverKind";
9
+ import type { ExtmarkId } from "./ExtmarkId";
10
+ import type { ExtmarkOpts } from "./ExtmarkOpts";
11
+ import type { FloatConfig } from "./FloatConfig";
12
+ import type { HighlightDef } from "./HighlightDef";
13
+ import type { Hint } from "./Hint";
14
+ import type { HlTarget } from "./HlTarget";
15
+ import type { HookName } from "./HookName";
16
+ import type { InstanceConfig } from "./InstanceConfig";
17
+ import type { InstanceId } from "./InstanceId";
18
+ import type { KeymapScope } from "./KeymapScope";
19
+ import type { LineDraw } from "./LineDraw";
20
+ import type { MessageLevel } from "./MessageLevel";
21
+ import type { Mode } from "./Mode";
22
+ import type { ModelSelection } from "./ModelSelection";
23
+ import type { NamespaceId } from "./NamespaceId";
24
+ import type { NodeId } from "./NodeId";
25
+ import type { NoticeKind } from "./NoticeKind";
26
+ import type { OptionSpec } from "./OptionSpec";
27
+ import type { OptionValue } from "./OptionValue";
28
+ import type { PermissionMode } from "./PermissionMode";
29
+ import type { ProjectKey } from "./ProjectKey";
30
+ import type { ProviderEvent } from "./ProviderEvent";
31
+ import type { QuotaSnapshot } from "./QuotaSnapshot";
32
+ import type { Rect } from "./Rect";
33
+ import type { SelectShape } from "./SelectShape";
34
+ import type { SessionId } from "./SessionId";
35
+ import type { StatusSegment } from "./StatusSegment";
36
+ import type { StreamId } from "./StreamId";
37
+ import type { SurfaceCell } from "./SurfaceCell";
38
+ import type { SurfaceId } from "./SurfaceId";
39
+ import type { TextEdit } from "./TextEdit";
40
+ import type { ToolDef } from "./ToolDef";
41
+ import type { UsageResolution } from "./UsageResolution";
42
+ import type { UserQuestion } from "./UserQuestion";
43
+ import type { VarScope } from "./VarScope";
44
+ import type { ViewId } from "./ViewId";
45
+ import type { WindowId } from "./WindowId";
46
+ import type { WindowLayout } from "./WindowLayout";
47
+
48
+ export type ApiCall =
49
+ | {
50
+ "call": "buf_create";
51
+ name?: string | null;
52
+ scratch: boolean;
53
+ /**
54
+ * What this buffer *is*, so that somebody else can say something about it.
55
+ */
56
+ kind?: string | null;
57
+ }
58
+ | { "call": "buf_line_count"; buf: BufferId }
59
+ | {
60
+ "call": "buf_get_lines";
61
+ buf: BufferId;
62
+ start: number;
63
+ /**
64
+ * Exclusive. Negative indices are `len + 1 + i`, as in Neovim: `-1` is one past the last
65
+ * line, so `0..-1` is the whole buffer.
66
+ */
67
+ end: number;
68
+ }
69
+ | {
70
+ "call": "buf_set_lines";
71
+ buf: BufferId;
72
+ start: number;
73
+ end: number;
74
+ lines: Array<string>;
75
+ }
76
+ | {
77
+ "call": "buf_render";
78
+ buf: BufferId;
79
+ ns: NamespaceId;
80
+ start: number;
81
+ end: number;
82
+ lines: Array<LineDraw>;
83
+ }
84
+ | { "call": "buf_append_text"; buf: BufferId; text: string }
85
+ | { "call": "buf_set_name"; buf: BufferId; name: string }
86
+ | { "call": "buf_set_kind"; buf: BufferId; kind?: string | null }
87
+ | { "call": "buf_get_kind"; buf: BufferId }
88
+ | { "call": "buf_attach"; buf: BufferId }
89
+ | { "call": "buf_detach"; buf: BufferId }
90
+ | {
91
+ "call": "win_open";
92
+ buf: BufferId;
93
+ layout: WindowLayout;
94
+ /**
95
+ * Which terminal to open it in.
96
+ *
97
+ * Almost never worth saying. The host works it out from the call — a float anchored to a
98
+ * window goes where that window is, and a buffer only one terminal is showing names it —
99
+ * and otherwise from the terminal whose key press is being served, which for anything a
100
+ * plugin does in answer to a key is exact. What this is for is the case none of that
101
+ * covers: an orchestrator putting something on a screen other than the one you are at.
102
+ */
103
+ view?: ViewId | null;
104
+ }
105
+ | { "call": "win_close"; win: WindowId }
106
+ | { "call": "win_resize"; win: WindowId; size: number | null }
107
+ | { "call": "win_set_buf"; win: WindowId; buf: BufferId }
108
+ | { "call": "win_get_cursor"; win: WindowId }
109
+ | { "call": "win_set_cursor"; win: WindowId; row: number; col: number }
110
+ | { "call": "win_get_viewport"; win: WindowId }
111
+ | { "call": "win_scroll_to"; win: WindowId; top_line: number | null }
112
+ | { "call": "win_list" }
113
+ | {
114
+ "call": "win_motion";
115
+ win: WindowId;
116
+ motion: CursorMotion;
117
+ select: boolean;
118
+ }
119
+ | { "call": "win_edit"; win: WindowId; edit: TextEdit }
120
+ | {
121
+ "call": "win_select";
122
+ win: WindowId;
123
+ /**
124
+ * `false` clears. `true` anchors here even if something was already selected.
125
+ */
126
+ on: boolean;
127
+ }
128
+ | { "call": "win_select_shape"; win: WindowId; shape: SelectShape }
129
+ | { "call": "win_cursor_shape"; win: WindowId; shape: CursorShape }
130
+ | { "call": "win_selection"; win: WindowId }
131
+ | { "call": "clipboard_write"; text: string }
132
+ | {
133
+ "call": "float_open";
134
+ buf: BufferId;
135
+ config: FloatConfig;
136
+ /**
137
+ * Which terminal to open it in.
138
+ *
139
+ * Almost never worth saying. The host works it out from the call — a float anchored to a
140
+ * window goes where that window is, and a buffer only one terminal is showing names it —
141
+ * and otherwise from the terminal whose key press is being served, which for anything a
142
+ * plugin does in answer to a key is exact. What this is for is the case none of that
143
+ * covers: an orchestrator putting something on a screen other than the one you are at.
144
+ */
145
+ view?: ViewId | null;
146
+ }
147
+ | { "call": "float_configure"; win: WindowId; config: FloatConfig }
148
+ | { "call": "ns_create"; name: string }
149
+ | {
150
+ "call": "mark_set";
151
+ ns: NamespaceId;
152
+ buf: BufferId;
153
+ row: number;
154
+ /**
155
+ * UTF-8 byte offset into the line, not a character or display column.
156
+ */
157
+ col: number;
158
+ opts: ExtmarkOpts;
159
+ }
160
+ | { "call": "mark_del"; ns: NamespaceId; buf: BufferId; id: ExtmarkId }
161
+ | {
162
+ "call": "mark_clear";
163
+ ns: NamespaceId;
164
+ buf: BufferId;
165
+ start?: number | null;
166
+ end?: number | null;
167
+ }
168
+ | { "call": "mark_get"; ns: NamespaceId; buf: BufferId; id: ExtmarkId }
169
+ | { "call": "mark_all"; ns: NamespaceId; buf: BufferId }
170
+ | { "call": "hl_define"; name: string; def: HighlightDef; default: boolean }
171
+ | { "call": "hl_get"; name: string }
172
+ | { "call": "hl_list" }
173
+ | { "call": "hl_reset"; name: string }
174
+ | {
175
+ "call": "win_set_highlights";
176
+ target: HlTarget;
177
+ map: Record<string, string>;
178
+ }
179
+ | { "call": "surface_claim"; win: WindowId; rect: Rect }
180
+ | { "call": "surface_put"; surface: SurfaceId; cells: Array<SurfaceCell> }
181
+ | { "call": "surface_release"; surface: SurfaceId }
182
+ | { "call": "cmd_register"; name: string; desc?: string | null }
183
+ | { "call": "cmd_unregister"; name: string }
184
+ | { "call": "cmd_exec"; name: string; args?: Array<string> }
185
+ | { "call": "cmd_call"; name: string; args?: Array<string> }
186
+ | { "call": "cmd_list" }
187
+ | {
188
+ "call": "keymap_set";
189
+ mode: Mode;
190
+ /**
191
+ * Neovim-style notation: `<C-x>`, `<Esc>`, `<CR>`, `gd`.
192
+ */
193
+ lhs: string;
194
+ /**
195
+ * Command name to invoke. Plugins bind keys to commands, never to raw callbacks, so that
196
+ * every binding is discoverable and remappable by the user.
197
+ */
198
+ command: string;
199
+ scope: KeymapScope | null;
200
+ desc?: string | null;
201
+ }
202
+ | { "call": "keymap_del"; mode: Mode; lhs: string; scope: KeymapScope | null }
203
+ | { "call": "keymap_capture"; win: WindowId; command: string }
204
+ | { "call": "keymap_release"; win: WindowId }
205
+ | { "call": "keymap_list"; mode?: Mode | null }
206
+ | { "call": "focus_push"; win: WindowId }
207
+ | { "call": "focus_pop" }
208
+ | { "call": "focus_current" }
209
+ | {
210
+ "call": "agent_send";
211
+ text: string;
212
+ /**
213
+ * Files to send with it, by path. Copied into the workspace's own directory on the way
214
+ * through, so a caller may hand over a temporary file and forget about it.
215
+ *
216
+ * Anything already on the composer's attachment row goes too — this is *extra*, for a
217
+ * plugin that has produced an image of its own rather than one somebody pasted.
218
+ */
219
+ images?: Array<string>;
220
+ }
221
+ | {
222
+ "call": "agent_command";
223
+ session?: SessionId | null;
224
+ command: AgentCommand;
225
+ }
226
+ | { "call": "agent_cancel" }
227
+ | { "call": "agent_get_selection" }
228
+ | { "call": "agent_set_selection"; selection: ModelSelection }
229
+ | {
230
+ "call": "agent_list_models";
231
+ instance?: InstanceId | null;
232
+ /**
233
+ * Re-query the endpoints instead of using this session's cache.
234
+ *
235
+ * Discovery is a network round trip per instance. Doing it on every keystroke that opens a
236
+ * model picker is seconds of nothing happening, so the answer is cached for the session
237
+ * and this is how you ask for a fresh one.
238
+ */
239
+ refresh: boolean;
240
+ }
241
+ | { "call": "agent_list_instances" }
242
+ | { "call": "agent_driver_commands" }
243
+ | { "call": "chat_attach"; path?: string | null }
244
+ | { "call": "chat_attachments" }
245
+ | { "call": "chat_detach"; index?: number | null }
246
+ | { "call": "chat_detach_all" }
247
+ | { "call": "chat_set_draft"; text: string }
248
+ | { "call": "provider_credentials" }
249
+ | {
250
+ "call": "provider_set_credential";
251
+ instance: InstanceId;
252
+ /**
253
+ * Overwrite a key that is already there without asking. Off by default.
254
+ */
255
+ replace: boolean;
256
+ }
257
+ | { "call": "provider_forget_credential"; instance: InstanceId }
258
+ | {
259
+ "call": "session_list";
260
+ /**
261
+ * Include conversations that have been put away. Off by default, so every existing caller
262
+ * keeps showing the list the user actually works in.
263
+ */
264
+ include_archived: boolean;
265
+ }
266
+ | { "call": "session_current" }
267
+ | {
268
+ "call": "session_new";
269
+ cwd?: string | null;
270
+ title?: string | null;
271
+ /**
272
+ * Switch to it as well. `false` is for restoring a workspace.
273
+ */
274
+ activate: boolean;
275
+ }
276
+ | {
277
+ "call": "session_switch";
278
+ session: SessionId;
279
+ /**
280
+ * Which terminal moves. Defaults to the one being served, which is what a key press in a
281
+ * panel means; an orchestrator sending somebody else's screen somewhere says so.
282
+ */
283
+ view?: ViewId | null;
284
+ }
285
+ | { "call": "view_list" }
286
+ | { "call": "session_close"; session: SessionId }
287
+ | { "call": "session_rename"; session: SessionId; title?: string | null }
288
+ | { "call": "session_archive"; session: SessionId; archived: boolean }
289
+ | { "call": "session_messages"; session?: SessionId | null }
290
+ | { "call": "sessions_stored" }
291
+ | { "call": "tool_register"; def: ToolDef }
292
+ | { "call": "tool_unregister"; name: string }
293
+ | { "call": "tool_list" }
294
+ | {
295
+ "call": "hook_register";
296
+ hook: HookName;
297
+ /**
298
+ * Non-blocking hooks are pure observers and cannot veto — that is what stops an audit
299
+ * plugin from wedging the agent loop. Blocking hooks are awaited, and a timeout is
300
+ * treated as a veto so a permission plugin fails closed.
301
+ */
302
+ blocking: boolean;
303
+ timeout_ms?: number | null;
304
+ }
305
+ | { "call": "hook_unregister"; hook: HookName }
306
+ | {
307
+ "call": "provider_register_driver";
308
+ driver: DriverKind;
309
+ instances: Array<InstanceConfig>;
310
+ /**
311
+ * Whether this driver runs its own agent loop, like `claude` or anything speaking ACP.
312
+ *
313
+ * It changes what the host does with the stream, not how the stream is produced: an agent
314
+ * driver is sent no tool list, because it brings its own, and neosh's tool registry, hooks
315
+ * and permission layer therefore do not gate what it does. Saying so is the honest option
316
+ * — a plugin shipping an agent driver that claimed to be a model driver would have the
317
+ * host run its tool calls a second time.
318
+ */
319
+ agent_loop: boolean;
320
+ }
321
+ | { "call": "provider_emit"; stream: StreamId; event: ProviderEvent }
322
+ | { "call": "permission_get_mode" }
323
+ | { "call": "permission_set_mode"; mode: PermissionMode }
324
+ | { "call": "permission_check"; capability: Capability }
325
+ | { "call": "ask_user"; questions: Array<UserQuestion> }
326
+ | { "call": "opt_declare"; spec: OptionSpec }
327
+ | { "call": "opt_set"; name: string; value: OptionValue }
328
+ | { "call": "opt_get"; name: string }
329
+ | { "call": "opt_reset"; name: string }
330
+ | { "call": "opt_all" }
331
+ | { "call": "state_get"; key: string }
332
+ | { "call": "state_set"; key: string; value: unknown }
333
+ | { "call": "state_delete"; key: string }
334
+ | {
335
+ "call": "ext_contribute";
336
+ point: string;
337
+ id: string;
338
+ item: unknown;
339
+ /**
340
+ * Where it sorts among the contributions on this point. Ties break on plugin id, so the
341
+ * order is stable across restarts rather than being load order.
342
+ */
343
+ priority: number;
344
+ }
345
+ | { "call": "ext_remove"; point: string; id: string }
346
+ | { "call": "ext_list"; point: string }
347
+ | { "call": "ext_points" }
348
+ | { "call": "plugin_list" }
349
+ | { "call": "event_emit"; name: string; data?: unknown }
350
+ | { "call": "var_get"; scope: VarScope; key: string }
351
+ | { "call": "var_set"; scope: VarScope; key: string; value: unknown }
352
+ | { "call": "var_delete"; scope: VarScope; key: string }
353
+ | { "call": "var_all"; scope: VarScope }
354
+ | { "call": "swarm_self" }
355
+ | { "call": "swarm_nodes" }
356
+ | { "call": "swarm_agents" }
357
+ | { "call": "swarm_hosts_of"; project: ProjectKey }
358
+ | {
359
+ "call": "swarm_command";
360
+ node: NodeId;
361
+ session: SessionId;
362
+ command: AgentCommand;
363
+ }
364
+ | { "call": "swarm_subscribe"; node: NodeId; session: SessionId }
365
+ | { "call": "swarm_unsubscribe"; node: NodeId; session: SessionId }
366
+ | { "call": "swarm_probe"; addr: string }
367
+ | { "call": "swarm_pair"; node: NodeId; name: string; addr?: string | null }
368
+ | { "call": "swarm_unpair"; node: NodeId }
369
+ | { "call": "swarm_reconnect"; node: NodeId }
370
+ | { "call": "swarm_disconnect"; node: NodeId }
371
+ | { "call": "swarm_strangers" }
372
+ | { "call": "quota_list" }
373
+ | { "call": "quota_refresh"; instance?: InstanceId | null }
374
+ | { "call": "quota_report"; snapshot: QuotaSnapshot }
375
+ | {
376
+ "call": "quota_history";
377
+ instance?: InstanceId | null;
378
+ /**
379
+ * Unix seconds, inclusive.
380
+ */
381
+ since: number;
382
+ /**
383
+ * Unix seconds, exclusive.
384
+ */
385
+ until: number;
386
+ }
387
+ | {
388
+ "call": "usage_history";
389
+ /**
390
+ * Unix seconds, inclusive.
391
+ */
392
+ since: number;
393
+ /**
394
+ * Unix seconds, exclusive.
395
+ */
396
+ until: number;
397
+ resolution: UsageResolution;
398
+ /**
399
+ * IANA zone to bucket days in. An offset is wrong for any span crossing a DST boundary.
400
+ */
401
+ time_zone?: string | null;
402
+ }
403
+ | { "call": "rtp_add"; path: string }
404
+ | { "call": "rtp_list" }
405
+ | { "call": "path_complete"; prefix: string }
406
+ | { "call": "git_status"; cwd?: string | null }
407
+ | {
408
+ "call": "git_branches";
409
+ include_remote: boolean;
410
+ /**
411
+ * Which checkout to ask. `None` is the one this conversation is in, which is what almost
412
+ * every caller means. See [`ApiCall::GitWorktrees`] for why the others exist.
413
+ */
414
+ cwd?: string | null;
415
+ }
416
+ | { "call": "git_worktrees"; cwd?: string | null }
417
+ | { "call": "git_log"; limit: number }
418
+ | {
419
+ "call": "git_diff";
420
+ target: DiffTarget;
421
+ /**
422
+ * `--stat` instead of the patch. A prompt builder wants this; a diff view does not.
423
+ */
424
+ stat: boolean;
425
+ }
426
+ | { "call": "git_default_branch" }
427
+ | { "call": "git_create_branch"; name: string; from?: string | null }
428
+ | { "call": "git_checkout"; rev: string }
429
+ | {
430
+ "call": "git_rename_branch";
431
+ old: string;
432
+ new: string;
433
+ /**
434
+ * The checkout the branch belongs to. `git branch -m` runs *inside* a repository, and a
435
+ * caller renaming the branch of a worktree other than the active conversation's has to
436
+ * say which — the same reason [`Self::GitAddWorktree`] takes one.
437
+ */
438
+ cwd?: string | null;
439
+ }
440
+ | { "call": "git_stage"; paths: Array<string> }
441
+ | { "call": "git_unstage"; paths: Array<string> }
442
+ | { "call": "git_commit"; message: string }
443
+ | {
444
+ "call": "git_pull";
445
+ /**
446
+ * The repository to pull in. The conversation's own when absent.
447
+ */
448
+ cwd?: string | null;
449
+ }
450
+ | {
451
+ "call": "git_add_worktree";
452
+ path: string;
453
+ branch: string;
454
+ create: boolean;
455
+ /**
456
+ * The repository to add it to. `git worktree add` runs *inside* a checkout, so a caller
457
+ * making a worktree of a project other than the active one has to say which.
458
+ */
459
+ cwd?: string | null;
460
+ }
461
+ | {
462
+ "call": "git_remove_worktree";
463
+ path: string;
464
+ force: boolean;
465
+ /**
466
+ * The repository the worktree belongs to. `git worktree remove` has to run from a
467
+ * checkout *other* than the one being removed, and the conversation the caller is in may
468
+ * be standing in exactly that one.
469
+ */
470
+ cwd?: string | null;
471
+ }
472
+ | {
473
+ "call": "gen_complete";
474
+ prompt: string;
475
+ system?: string | null;
476
+ /**
477
+ * Ask for JSON and parse it host-side, tolerating the code fences models wrap it in.
478
+ */
479
+ json: boolean;
480
+ /**
481
+ * Defaults to `gen.model` if set, else the session's own selection.
482
+ */
483
+ selection?: ModelSelection | null;
484
+ }
485
+ | { "call": "status_set"; key: string; segment: StatusSegment }
486
+ | { "call": "status_clear"; key: string }
487
+ | { "call": "hint_set"; key: string; hint: Hint }
488
+ | { "call": "hint_clear"; key: string }
489
+ | { "call": "log"; level: MessageLevel; message: string }
490
+ | {
491
+ "call": "notify";
492
+ level: MessageLevel;
493
+ message: string;
494
+ /**
495
+ * Whether the user asked for this. `Reply` is the default and is what a bare
496
+ * `neosh.notify` has always meant.
497
+ */
498
+ kind: NoticeKind;
499
+ /**
500
+ * Which progress row to write, for [`NoticeKind::Progress`]. Ignored otherwise.
501
+ */
502
+ key?: string | null;
503
+ }
504
+ | { "call": "notify_done"; key: string }
505
+ | {
506
+ "call": "alert";
507
+ level: MessageLevel;
508
+ /**
509
+ * What this is about, in a few words.
510
+ */
511
+ title: string;
512
+ message: string;
513
+ /**
514
+ * Which conversation this is about, if it is about one.
515
+ *
516
+ * The test for "can they see it already" is asked against this. An alert with no
517
+ * conversation is about the workspace, and is never on screen by definition.
518
+ */
519
+ session?: SessionId | null;
520
+ };
@@ -0,0 +1,15 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * Why a call failed.
5
+ *
6
+ * Distinguishing these matters: a plugin should retry a `Busy`, surface a `Denied` to the user,
7
+ * and treat `InvalidArgument` as its own bug.
8
+ */
9
+ export type ApiError =
10
+ | { "kind": "not_found"; what: string }
11
+ | { "kind": "invalid_argument"; message: string }
12
+ | { "kind": "denied"; reason: string }
13
+ | { "kind": "not_permitted"; capability: string }
14
+ | { "kind": "busy"; message: string }
15
+ | { "kind": "internal"; message: string };
@@ -0,0 +1,110 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { AttachmentInfo } from "./AttachmentInfo";
3
+ import type { BranchInfo } from "./BranchInfo";
4
+ import type { BufferId } from "./BufferId";
5
+ import type { CommandEntry } from "./CommandEntry";
6
+ import type { CommitInfo } from "./CommitInfo";
7
+ import type { Contribution } from "./Contribution";
8
+ import type { CredentialInfo } from "./CredentialInfo";
9
+ import type { DriverCommand } from "./DriverCommand";
10
+ import type { ExtmarkId } from "./ExtmarkId";
11
+ import type { ExtmarkInfo } from "./ExtmarkInfo";
12
+ import type { HighlightDef } from "./HighlightDef";
13
+ import type { HighlightEntry } from "./HighlightEntry";
14
+ import type { HighlightSpec } from "./HighlightSpec";
15
+ import type { InstanceConfig } from "./InstanceConfig";
16
+ import type { KeymapEntry } from "./KeymapEntry";
17
+ import type { Message } from "./Message";
18
+ import type { ModelEntry } from "./ModelEntry";
19
+ import type { ModelSelection } from "./ModelSelection";
20
+ import type { NamespaceId } from "./NamespaceId";
21
+ import type { NodeInfo } from "./NodeInfo";
22
+ import type { OptionEntry } from "./OptionEntry";
23
+ import type { PermissionDecision } from "./PermissionDecision";
24
+ import type { PermissionMode } from "./PermissionMode";
25
+ import type { PluginInfo } from "./PluginInfo";
26
+ import type { PointInfo } from "./PointInfo";
27
+ import type { QuestionAnswer } from "./QuestionAnswer";
28
+ import type { QuotaSample } from "./QuotaSample";
29
+ import type { QuotaSnapshot } from "./QuotaSnapshot";
30
+ import type { RepoStatus } from "./RepoStatus";
31
+ import type { SessionId } from "./SessionId";
32
+ import type { SessionInfo } from "./SessionInfo";
33
+ import type { SurfaceId } from "./SurfaceId";
34
+ import type { SwarmAgent } from "./SwarmAgent";
35
+ import type { SwarmNode } from "./SwarmNode";
36
+ import type { SwarmStranger } from "./SwarmStranger";
37
+ import type { ToolDef } from "./ToolDef";
38
+ import type { UsageHistory } from "./UsageHistory";
39
+ import type { ViewInfo } from "./ViewInfo";
40
+ import type { Viewport } from "./Viewport";
41
+ import type { WindowId } from "./WindowId";
42
+ import type { WindowInfo } from "./WindowInfo";
43
+ import type { WorktreeInfo } from "./WorktreeInfo";
44
+
45
+ /**
46
+ * Successful results. One variant per shape rather than a bag of JSON, so the TS side gets real
47
+ * discriminated unions.
48
+ */
49
+ export type ApiOk =
50
+ | { "ok": "unit" }
51
+ | { "ok": "bool"; value: boolean }
52
+ | { "ok": "buf"; buf: BufferId }
53
+ | { "ok": "win"; win: WindowId }
54
+ | { "ok": "views"; views: Array<ViewInfo> }
55
+ | { "ok": "ns"; ns: NamespaceId }
56
+ | { "ok": "mark"; id: ExtmarkId }
57
+ | { "ok": "surface"; surface: SurfaceId }
58
+ | { "ok": "lines"; lines: Array<string> }
59
+ | { "ok": "count"; n: number }
60
+ | { "ok": "cursor"; row: number; col: number }
61
+ | { "ok": "mark_info"; info: ExtmarkInfo | null }
62
+ | { "ok": "marks"; marks: Array<ExtmarkInfo> }
63
+ | { "ok": "models"; models: Array<ModelEntry> }
64
+ | { "ok": "instances"; instances: Array<InstanceConfig> }
65
+ | { "ok": "selection"; selection: ModelSelection | null }
66
+ | { "ok": "tools"; tools: Array<ToolDef> }
67
+ | { "ok": "names"; names: Array<string> }
68
+ | { "ok": "commands"; commands: Array<CommandEntry> }
69
+ | { "ok": "driver_commands"; commands: Array<DriverCommand> }
70
+ | { "ok": "keymaps"; keymaps: Array<KeymapEntry> }
71
+ | { "ok": "permission"; decision: PermissionDecision }
72
+ | { "ok": "answers"; answers?: Array<QuestionAnswer> | null }
73
+ | { "ok": "permission_mode"; mode: PermissionMode }
74
+ | { "ok": "focused_win"; win: WindowId | null }
75
+ | { "ok": "option"; entry: OptionEntry | null }
76
+ | { "ok": "options"; options: Array<OptionEntry> }
77
+ | { "ok": "paths"; paths: Array<string> }
78
+ | { "ok": "viewport"; viewport: Viewport | null }
79
+ | { "ok": "sessions"; sessions: Array<SessionInfo> }
80
+ | { "ok": "credentials"; credentials: Array<CredentialInfo> }
81
+ | { "ok": "session"; session: SessionInfo }
82
+ | { "ok": "maybe_session"; session: SessionId | null }
83
+ | { "ok": "messages"; messages: Array<Message> }
84
+ | { "ok": "status"; status: RepoStatus }
85
+ | { "ok": "branches"; branches: Array<BranchInfo> }
86
+ | { "ok": "worktrees"; worktrees: Array<WorktreeInfo> }
87
+ | { "ok": "commits"; commits: Array<CommitInfo> }
88
+ | { "ok": "commit"; commit: CommitInfo }
89
+ | { "ok": "text"; text: string }
90
+ | { "ok": "maybe_text"; text: string | null }
91
+ | { "ok": "json"; value: unknown }
92
+ | { "ok": "vars"; vars: Record<string, unknown> }
93
+ | { "ok": "contributions"; contributions: Array<Contribution> }
94
+ | { "ok": "windows"; windows: Array<WindowInfo> }
95
+ | {
96
+ "ok": "highlight";
97
+ def?: HighlightDef | null;
98
+ resolved?: HighlightSpec | null;
99
+ }
100
+ | { "ok": "highlights"; groups: Array<HighlightEntry> }
101
+ | { "ok": "points"; points: Array<PointInfo> }
102
+ | { "ok": "plugins"; plugins: Array<PluginInfo> }
103
+ | { "ok": "attachments"; attachments: Array<AttachmentInfo> }
104
+ | { "ok": "swarm_self"; node: NodeInfo | null }
105
+ | { "ok": "swarm_nodes"; nodes: Array<SwarmNode> }
106
+ | { "ok": "swarm_agents"; agents: Array<SwarmAgent> }
107
+ | { "ok": "swarm_strangers"; strangers: Array<SwarmStranger> }
108
+ | { "ok": "quotas"; quotas: Array<QuotaSnapshot> }
109
+ | { "ok": "quota_history"; samples: Array<QuotaSample> }
110
+ | { "ok": "usage_history"; history: UsageHistory };
@@ -0,0 +1,8 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { ApiError } from "./ApiError";
3
+ import type { ApiOk } from "./ApiOk";
4
+
5
+ export type ApiResponse = { "status": "ok"; value: ApiOk } | {
6
+ "status": "err";
7
+ error: ApiError;
8
+ };