@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,33 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { OnDelete } from "./OnDelete";
3
+ import type { VirtChunk } from "./VirtChunk";
4
+ import type { VirtTextPos } from "./VirtTextPos";
5
+
6
+ export type ExtmarkOpts = {
7
+ /**
8
+ * End column for a ranged highlight, as a UTF-8 byte offset. `None` means a point mark.
9
+ */
10
+ end_col?: number | null;
11
+ hl_group?: string | null;
12
+ /**
13
+ * A background for the whole rendered row, not just the bytes the mark covers.
14
+ *
15
+ * The distinction is the difference between a diff line that is green and a diff line whose
16
+ * *text* is green: the band has to reach the right edge of the window to read as one line, and
17
+ * how wide the window is is not known where the row is written. So the group is carried and
18
+ * the frontend fills to its own edge — which is also what makes the band survive a resize.
19
+ *
20
+ * It sits *under* every ranged `hl_group` on the row rather than competing with them, so a
21
+ * syntax colour on top keeps its foreground and inherits this background. Nothing else in the
22
+ * mark vocabulary composes; this one has to, because "which line changed" and "what does this
23
+ * word mean" are two facts about the same character.
24
+ */
25
+ line_hl_group?: string | null;
26
+ virt_text?: Array<VirtChunk>;
27
+ virt_text_pos: VirtTextPos;
28
+ on_delete: OnDelete;
29
+ /**
30
+ * Higher priority draws over lower when marks overlap.
31
+ */
32
+ priority: number;
33
+ };
@@ -0,0 +1,44 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { ExtmarkId } from "./ExtmarkId";
3
+ import type { NamespaceId } from "./NamespaceId";
4
+ import type { OnDelete } from "./OnDelete";
5
+ import type { VirtChunk } from "./VirtChunk";
6
+ import type { VirtTextPos } from "./VirtTextPos";
7
+
8
+ /**
9
+ * A mark as it appears on the wire, already resolved to a column on a specific line.
10
+ */
11
+ export type ExtmarkRender = {
12
+ ns: NamespaceId;
13
+ id: ExtmarkId;
14
+ /**
15
+ * UTF-8 byte offset into the line. The frontend converts to a display column.
16
+ */
17
+ col: number;
18
+ /**
19
+ * End column for a ranged highlight, as a UTF-8 byte offset. `None` means a point mark.
20
+ */
21
+ end_col?: number | null;
22
+ hl_group?: string | null;
23
+ /**
24
+ * A background for the whole rendered row, not just the bytes the mark covers.
25
+ *
26
+ * The distinction is the difference between a diff line that is green and a diff line whose
27
+ * *text* is green: the band has to reach the right edge of the window to read as one line, and
28
+ * how wide the window is is not known where the row is written. So the group is carried and
29
+ * the frontend fills to its own edge — which is also what makes the band survive a resize.
30
+ *
31
+ * It sits *under* every ranged `hl_group` on the row rather than competing with them, so a
32
+ * syntax colour on top keeps its foreground and inherits this background. Nothing else in the
33
+ * mark vocabulary composes; this one has to, because "which line changed" and "what does this
34
+ * word mean" are two facts about the same character.
35
+ */
36
+ line_hl_group?: string | null;
37
+ virt_text?: Array<VirtChunk>;
38
+ virt_text_pos: VirtTextPos;
39
+ on_delete: OnDelete;
40
+ /**
41
+ * Higher priority draws over lower when marks overlap.
42
+ */
43
+ priority: number;
44
+ };
@@ -0,0 +1,18 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { FileState } from "./FileState";
3
+
4
+ export type FileChange = {
5
+ path: string;
6
+ /**
7
+ * Set only for renames and copies.
8
+ */
9
+ from?: string | null;
10
+ /**
11
+ * State of the staged copy, if the path is staged at all.
12
+ */
13
+ staged?: FileState | null;
14
+ /**
15
+ * State of the working-tree copy, if it differs from the index.
16
+ */
17
+ unstaged?: FileState | null;
18
+ };
@@ -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
+ * What happened to one path, as reported by `git status --porcelain=v2`.
5
+ */
6
+ export type FileState =
7
+ | "added"
8
+ | "modified"
9
+ | "deleted"
10
+ | "renamed"
11
+ | "copied"
12
+ | "type_changed"
13
+ | "untracked"
14
+ | "ignored"
15
+ | "conflicted";
@@ -0,0 +1,63 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { Anchor } from "./Anchor";
3
+ import type { BorderStyle } from "./BorderStyle";
4
+ import type { Extent } from "./Extent";
5
+ import type { Offset } from "./Offset";
6
+
7
+ /**
8
+ * The highest-leverage primitive in the system. Pickers, completion, hover, permission prompts and
9
+ * keybinding hints are all this one type with different fields set.
10
+ */
11
+ export type FloatConfig = {
12
+ anchor: Anchor;
13
+ offset: Offset;
14
+ width: Extent;
15
+ height: Extent;
16
+ /**
17
+ * Higher draws on top. Ties break by open order.
18
+ */
19
+ z: number;
20
+ border: BorderStyle;
21
+ /**
22
+ * Semantic highlight group for the border, e.g. `"MyPlugin.Border"`.
23
+ */
24
+ border_hl?: string | null;
25
+ title?: string | null;
26
+ /**
27
+ * Close automatically when focus moves elsewhere. The right default for pickers and hovers.
28
+ */
29
+ close_on_blur: boolean;
30
+ /**
31
+ * Whether the float can take focus at all. `false` for passive hints and hover cards.
32
+ */
33
+ focusable: boolean;
34
+ /**
35
+ * While this float has focus, global bindings stop resolving.
36
+ *
37
+ * # Why this is not "bind over the keys you care about"
38
+ *
39
+ * That is what every panel here did, and it only ever worked for the keys the panel itself
40
+ * used. A widget shadows `<C-n>` because *it* wants `<C-n>` for "next" — so `<C-t>`, `<C-g>`,
41
+ * `<C-l>` and the rest still fell through to the workspace, and pressing one over an open
42
+ * picker opened a second panel behind the first and left focus somewhere neither of them
43
+ * expected. A control that is on screen for two seconds cannot be asked to enumerate every
44
+ * key the program will ever bind; the question it can answer is "does anything else reach me",
45
+ * and the answer for a panel you are answering a question with is no.
46
+ *
47
+ * Window, buffer and kind scopes still resolve, so a modal is exactly as extensible as any
48
+ * other panel: a third party binds against its **kind** and that binding is nearer than a
49
+ * global one, which is the ordering [`KeymapScope`](crate::KeymapScope) already promises.
50
+ *
51
+ * # The escape hatches survive
52
+ *
53
+ * `ui.modal_escape_keys` — `<C-q>` and `<C-r>` by default — resolve globally anyway. A modal
54
+ * that failed to bind a way out would otherwise be a terminal you have to kill, and "the
55
+ * panel is buggy" must never be the same event as "the program is gone". It is an option
56
+ * rather than a constant because which keys those are is the user's, like every other key
57
+ * here.
58
+ *
59
+ * A key nothing claimed is *swallowed* rather than reported unhandled: a modal that let
60
+ * characters through to the composer would be typing into a field you cannot see.
61
+ */
62
+ modal: boolean;
63
+ };
@@ -0,0 +1,9 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * The glyphs a [`Animation::Frames`] cycles through.
5
+ *
6
+ * Named rather than carried, so the frontend can answer the two questions a plugin cannot: what
7
+ * this terminal can draw, and how wide it comes out. Adding one here is adding it for everybody.
8
+ */
9
+ export type FrameSet = "braille" | "dots" | "bars" | "arc" | "corners";
@@ -0,0 +1,11 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * Which end of a window short content settles against.
5
+ *
6
+ * A layout property rather than a rendering trick, so it survives the trip through the protocol and
7
+ * a different frontend resolves it the same way. `End` is what makes a transcript read as a
8
+ * conversation: three exchanges should sit just above the field you are typing into, not stranded
9
+ * at the top of an empty screen with the composer a long way below them.
10
+ */
11
+ export type Gravity = "start" | "end";
@@ -0,0 +1,13 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { HighlightSpec } from "./HighlightSpec";
3
+
4
+ /**
5
+ * Plugins declare semantic names, never colors directly.
6
+ *
7
+ * [`HighlightDef::Link`] is what makes a plugin look correct under a theme its author never saw:
8
+ * `MyPlugin.Border -> Float.Border` inherits whatever the active theme decided borders look like.
9
+ */
10
+ export type HighlightDef = { "kind": "link"; to: string } | {
11
+ "kind": "spec";
12
+ spec: HighlightSpec;
13
+ };
@@ -0,0 +1,14 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { HighlightDef } from "./HighlightDef";
3
+
4
+ /**
5
+ * One highlight group as [`ApiCall::HlList`] reports it.
6
+ */
7
+ export type HighlightEntry = {
8
+ name: string;
9
+ def: HighlightDef;
10
+ /**
11
+ * The plugin that defined it, or `None` for the theme's own.
12
+ */
13
+ owner?: string | null;
14
+ };
@@ -0,0 +1,19 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { Animation } from "./Animation";
3
+ import type { Color } from "./Color";
4
+
5
+ export type HighlightSpec = {
6
+ fg?: Color | null;
7
+ bg?: Color | null;
8
+ /**
9
+ * Motion. Ignored when `ui.motion` is off, which is why it is a hint on the group rather than
10
+ * a promise to the plugin that set it.
11
+ */
12
+ animate?: Animation | null;
13
+ bold: boolean;
14
+ italic: boolean;
15
+ underline: boolean;
16
+ reverse: boolean;
17
+ dim: boolean;
18
+ strikethrough: boolean;
19
+ };
@@ -0,0 +1,18 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * One shortcut, as it reads on the row under the composer.
5
+ *
6
+ * Split into the key and what it does rather than one pre-formatted string, because the row has to
7
+ * survive a narrow terminal: labels are dropped before keys are, and that decision cannot be made
8
+ * once the two have been glued together. The key is written the way the user would press it —
9
+ * `^P`, `⏎`, `esc` — which is the frontend's spelling of a binding, not the core's `<C-p>`.
10
+ */
11
+ export type Hint = {
12
+ keys: string;
13
+ label: string;
14
+ /**
15
+ * Lower sorts first. Ties break by key, so the row does not reshuffle when a plugin reloads.
16
+ */
17
+ priority: number;
18
+ };
@@ -0,0 +1,10 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { WindowId } from "./WindowId";
3
+
4
+ /**
5
+ * What a highlight remap applies to. See [`ApiCall::WinSetHighlights`].
6
+ */
7
+ export type HlTarget = { "kind": "window"; win: WindowId } | {
8
+ "kind": "kind";
9
+ name: string;
10
+ };
@@ -0,0 +1,14 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { HookName } from "./HookName";
3
+ import type { HookPayload } from "./HookPayload";
4
+ import type { RequestId } from "./RequestId";
5
+
6
+ /**
7
+ * Identifies which hook payload a plugin is being asked about, paired with a request id so the
8
+ * host can match the answer.
9
+ */
10
+ export type HookInvocation = {
11
+ request: RequestId;
12
+ hook: HookName;
13
+ payload: HookPayload;
14
+ };
@@ -0,0 +1,17 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * Pre/post hook points. Every meaningful action has one.
5
+ *
6
+ * This is how policy, audit and permission plugins are written without the core knowing they
7
+ * exist.
8
+ */
9
+ export type HookName =
10
+ | "tool_pre"
11
+ | "tool_post"
12
+ | "turn_pre"
13
+ | "turn_route"
14
+ | "turn_post"
15
+ | "buf_pre_change"
16
+ | "permission_pre"
17
+ | "ask_user";
@@ -0,0 +1,14 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * What a hook decided.
5
+ *
6
+ * A hook registered as non-blocking is a pure observer and its outcome is ignored — that is
7
+ * deliberate, so an audit plugin can never wedge the agent loop. A *blocking* hook is awaited with
8
+ * a timeout, and **a timeout is treated as [`HookOutcome::Veto`]**: a permission plugin that hangs
9
+ * must fail closed, not open.
10
+ */
11
+ export type HookOutcome = { "action": "continue" } | {
12
+ "action": "modify";
13
+ payload: unknown;
14
+ } | { "action": "veto"; reason: string };
@@ -0,0 +1,95 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { BufferId } from "./BufferId";
3
+ import type { Capability } from "./Capability";
4
+ import type { ModelSelection } from "./ModelSelection";
5
+ import type { PermissionOption } from "./PermissionOption";
6
+ import type { QuestionAnswer } from "./QuestionAnswer";
7
+ import type { SessionId } from "./SessionId";
8
+ import type { StopReason } from "./StopReason";
9
+ import type { ToolCall } from "./ToolCall";
10
+ import type { ToolResult } from "./ToolResult";
11
+ import type { TurnId } from "./TurnId";
12
+ import type { Usage } from "./Usage";
13
+ import type { UserQuestion } from "./UserQuestion";
14
+
15
+ export type HookPayload =
16
+ | { "hook": "tool_pre"; call: ToolCall }
17
+ | { "hook": "tool_post"; call: ToolCall; result: ToolResult }
18
+ | { "hook": "turn_pre"; turn: TurnId; text: string }
19
+ | {
20
+ "hook": "turn_route";
21
+ turn: TurnId;
22
+ /**
23
+ * What is about to be asked, so the decision can be about the work rather than only about
24
+ * the conversation.
25
+ */
26
+ text: string;
27
+ /**
28
+ * Which conversation it belongs to. A workspace runs several turns at once, and a router
29
+ * that assumed the one on screen would send another's work to the wrong place.
30
+ */
31
+ session?: SessionId;
32
+ selection?: ModelSelection;
33
+ }
34
+ | { "hook": "turn_post"; turn: TurnId; stop_reason: StopReason; usage: Usage }
35
+ | {
36
+ "hook": "buf_pre_change";
37
+ buf: BufferId;
38
+ start: number;
39
+ old_end: number;
40
+ new_len: number;
41
+ }
42
+ | {
43
+ "hook": "permission_pre";
44
+ capability: Capability;
45
+ turn: TurnId | null;
46
+ /**
47
+ * Which conversation is blocked on this.
48
+ *
49
+ * What [`HookPayload::AskUser`] already carries, and for the same reason: a workspace
50
+ * runs several turns at once, only one of them is on screen, and a prompt drawn over
51
+ * whichever conversation you happen to be reading is a prompt about somebody else's work.
52
+ * `None` when a plugin asked outside any turn.
53
+ */
54
+ session?: SessionId;
55
+ /**
56
+ * What the asker said it was about to do, in its own words, when that is more than the
57
+ * capability can carry. An agent driver's `Run cargo test --workspace` is one line the
58
+ * user can act on; `Exec` plus a truncated command is not.
59
+ */
60
+ title?: string;
61
+ /**
62
+ * The answers the asker offers. Empty when the only answers are yes and no, which is the
63
+ * case for every built-in tool.
64
+ */
65
+ options: Array<PermissionOption>;
66
+ /**
67
+ * Which of `options` was taken, by `id`. Set by the hook, in a [`HookOutcome::Modify`]
68
+ * carrying this payload back — that is how an answer richer than yes-or-no gets home.
69
+ */
70
+ chosen?: string;
71
+ }
72
+ | {
73
+ "hook": "ask_user";
74
+ /**
75
+ * Which conversation is asking. A workspace runs several turns at once and only one of
76
+ * them is on screen, so a panel that assumed "the one in front of you" would put another
77
+ * conversation's question over the one you are reading.
78
+ */
79
+ session?: SessionId;
80
+ turn?: TurnId;
81
+ /**
82
+ * Where the turn is running, so a question about a file can be read against the right
83
+ * tree.
84
+ */
85
+ cwd: string;
86
+ questions: Array<UserQuestion>;
87
+ /**
88
+ * The answers. Set by the hook, in a [`HookOutcome::Modify`] carrying this payload back —
89
+ * the same way [`Self::PermissionPre::chosen`] comes home.
90
+ *
91
+ * `None` means nobody has answered yet. An empty list is not the same thing and is read as
92
+ * a refusal: it is what a hook that ran and declined to ask anybody returns.
93
+ */
94
+ answers?: Array<QuestionAnswer>;
95
+ };
@@ -0,0 +1,31 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { KeyPress } from "./KeyPress";
3
+ import type { WindowId } from "./WindowId";
4
+
5
+ export type InputEvent =
6
+ | { "type": "ready"; width: number; height: number }
7
+ | { "type": "attached"; width: number; height: number }
8
+ | { "type": "detached" }
9
+ | { "type": "key"; key: KeyPress }
10
+ | { "type": "paste"; text: string }
11
+ | { "type": "resize"; width: number; height: number }
12
+ | {
13
+ "type": "viewport_changed";
14
+ win: WindowId;
15
+ width: number;
16
+ height: number;
17
+ top_line: number;
18
+ /**
19
+ * How many *buffer* rows are on the screen, which on a wrapping window is not the height.
20
+ *
21
+ * The frontend is the only thing that can answer it, and everything that pages by a
22
+ * screenful needs it: a transcript of paragraphs draws six buffer rows in thirty cells of
23
+ * height, so half a screen counted as `height / 2` is four screens of scrolling and a
24
+ * cursor that lands somewhere nobody asked for.
25
+ */
26
+ rows: number;
27
+ }
28
+ | { "type": "command"; name: string; args: Array<string> }
29
+ | { "type": "repaint" }
30
+ | { "type": "focus"; on: boolean }
31
+ | { "type": "disconnected" };
@@ -0,0 +1,26 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { AuthRef } from "./AuthRef";
3
+ import type { Brand } from "./Brand";
4
+ import type { DriverKind } from "./DriverKind";
5
+ import type { InstanceId } from "./InstanceId";
6
+ import type { ModelInfo } from "./ModelInfo";
7
+
8
+ /**
9
+ * A configured driver.
10
+ */
11
+ export type InstanceConfig = {
12
+ id: InstanceId;
13
+ driver: DriverKind;
14
+ display_name: string;
15
+ base_url?: string | null;
16
+ auth: AuthRef;
17
+ /**
18
+ * How to draw it. `None` falls back to a generic mark.
19
+ */
20
+ brand?: Brand | null;
21
+ /**
22
+ * Models this instance serves. Empty means "ask the endpoint at runtime".
23
+ */
24
+ models?: Array<ModelInfo>;
25
+ extra_headers?: Array<[string, string]>;
26
+ };
@@ -0,0 +1,6 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * Names a *configured* driver: credentials, base URL, model list.
5
+ */
6
+ export type InstanceId = string;
@@ -0,0 +1,20 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type KeyCode =
4
+ | { "kind": "char"; c: string }
5
+ | { "kind": "enter" }
6
+ | { "kind": "tab" }
7
+ | { "kind": "back_tab" }
8
+ | { "kind": "backspace" }
9
+ | { "kind": "delete" }
10
+ | { "kind": "insert" }
11
+ | { "kind": "esc" }
12
+ | { "kind": "left" }
13
+ | { "kind": "right" }
14
+ | { "kind": "up" }
15
+ | { "kind": "down" }
16
+ | { "kind": "home" }
17
+ | { "kind": "end" }
18
+ | { "kind": "page_up" }
19
+ | { "kind": "page_down" }
20
+ | { "kind": "f"; n: number };
@@ -0,0 +1,24 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { KeyPress } from "./KeyPress";
3
+ import type { Mode } from "./Mode";
4
+ import type { ViewId } from "./ViewId";
5
+ import type { WindowId } from "./WindowId";
6
+
7
+ /**
8
+ * A key the host has already routed to this plugin's command. Included so a plugin can implement
9
+ * modal behaviour without re-deriving routing.
10
+ */
11
+ export type KeyContext = {
12
+ key: KeyPress;
13
+ mode: Mode;
14
+ /**
15
+ * Which terminal it was pressed in.
16
+ *
17
+ * A workspace can have several and they are not copies of each other, so a plugin that puts
18
+ * something on screen in answer to a key has to be able to put it on *that* screen. This is
19
+ * where the answer comes from, and the ergonomic layer hands it back as a namespace already
20
+ * bound to it, so the ordinary plugin never has to name a view at all.
21
+ */
22
+ view: ViewId;
23
+ win?: WindowId | null;
24
+ };
@@ -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
+
3
+ export type KeyMods = {
4
+ ctrl: boolean;
5
+ alt: boolean;
6
+ shift: boolean;
7
+ meta: boolean;
8
+ };
@@ -0,0 +1,5 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { KeyCode } from "./KeyCode";
3
+ import type { KeyMods } from "./KeyMods";
4
+
5
+ export type KeyPress = { code: KeyCode; mods: KeyMods };
@@ -0,0 +1,11 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { KeymapScope } from "./KeymapScope";
3
+ import type { Mode } from "./Mode";
4
+
5
+ export type KeymapEntry = {
6
+ mode: Mode;
7
+ lhs: string;
8
+ command: string;
9
+ scope: KeymapScope;
10
+ desc?: string | null;
11
+ };
@@ -0,0 +1,20 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { BufferId } from "./BufferId";
3
+ import type { WindowId } from "./WindowId";
4
+
5
+ /**
6
+ * Scope a keymap applies at. Resolution order is window -> buffer -> kind -> global; the first
7
+ * binding found wins, which is what stops every plugin fighting over `<Esc>`.
8
+ */
9
+ export type KeymapScope =
10
+ | { "kind": "global" }
11
+ | { "kind": "buffer"; buf: BufferId }
12
+ | { "kind": "window"; win: WindowId }
13
+ | {
14
+ "kind": "buf_kind";
15
+ /**
16
+ * The kind, not the discriminant — `name` because `kind` is already the tag this enum is
17
+ * serialized under.
18
+ */
19
+ name: string;
20
+ };
@@ -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
+ import type { MarkDraw } from "./MarkDraw";
3
+
4
+ /**
5
+ * One line of a repaint on the way *in*: text, and the marks to put on it.
6
+ *
7
+ * The inbound twin of [`LineRender`], and deliberately the same shape. A panel that draws itself
8
+ * hands over rows, not a script of mutations — see [`ApiCall::BufRender`](crate::ApiCall::BufRender)
9
+ * for why the script was the bug.
10
+ *
11
+ * No `ns` or `id` per mark: the namespace is the call's, and an id is a handle for deleting one
12
+ * mark later, which is not a thing a wholesale repaint ever does — it clears by namespace and
13
+ * writes the lot again.
14
+ */
15
+ export type LineDraw = { text: string; marks?: Array<MarkDraw> };
@@ -0,0 +1,9 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { ExtmarkRender } from "./ExtmarkRender";
3
+
4
+ /**
5
+ * One line of a buffer, with its annotations attached.
6
+ *
7
+ * Text and marks are never sent separately. See the module docs.
8
+ */
9
+ export type LineRender = { text: string; marks?: Array<ExtmarkRender> };
@@ -0,0 +1,16 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * How the connection to a peer stands, beyond the fact of it being up or not.
5
+ *
6
+ * `up` is the summary and this is the story, because "not connected" is three different rows on a
7
+ * board: a machine being dialled that has never answered, one that was here and is being dialled
8
+ * again, and one nothing is dialling at all — it reached us last time, or it was told to stop.
9
+ * `attempt` counts dials since the last success, so a panel can say `try 4` instead of drawing a
10
+ * spinner that has been spinning since Tuesday.
11
+ */
12
+ export type LinkState =
13
+ | { "state": "connecting"; attempt: number }
14
+ | { "state": "up" }
15
+ | { "state": "retrying"; attempt: number }
16
+ | { "state": "down" };