@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.
- package/package.json +31 -0
- package/src/generated/AccountKind.ts +9 -0
- package/src/generated/Activity.ts +85 -0
- package/src/generated/AgentCommand.ts +18 -0
- package/src/generated/AgentState.ts +6 -0
- package/src/generated/AgentSummary.ts +46 -0
- package/src/generated/Anchor.ts +12 -0
- package/src/generated/Animation.ts +40 -0
- package/src/generated/ApiCall.ts +520 -0
- package/src/generated/ApiError.ts +15 -0
- package/src/generated/ApiOk.ts +110 -0
- package/src/generated/ApiResponse.ts +8 -0
- package/src/generated/AscpMessage.ts +73 -0
- package/src/generated/AttachmentInfo.ts +25 -0
- package/src/generated/Attrs.ts +10 -0
- package/src/generated/AuthRef.ts +14 -0
- package/src/generated/BackgroundTask.ts +23 -0
- package/src/generated/BlockStartKind.ts +8 -0
- package/src/generated/BorderStyle.ts +3 -0
- package/src/generated/BranchInfo.ts +19 -0
- package/src/generated/Brand.ts +31 -0
- package/src/generated/BufferId.ts +6 -0
- package/src/generated/BuildId.ts +24 -0
- package/src/generated/Capability.ts +10 -0
- package/src/generated/ClientMessage.ts +67 -0
- package/src/generated/Color.ts +10 -0
- package/src/generated/CommandEntry.ts +13 -0
- package/src/generated/CommitInfo.ts +10 -0
- package/src/generated/ContentBlock.ts +39 -0
- package/src/generated/Contribution.ts +16 -0
- package/src/generated/CostBasis.ts +6 -0
- package/src/generated/CredentialInfo.ts +30 -0
- package/src/generated/CredentialSource.ts +18 -0
- package/src/generated/CursorMotion.ts +21 -0
- package/src/generated/CursorShape.ts +6 -0
- package/src/generated/DetachReason.ts +5 -0
- package/src/generated/DiffTarget.ts +10 -0
- package/src/generated/Dock.ts +9 -0
- package/src/generated/DriverCommand.ts +20 -0
- package/src/generated/DriverKind.ts +8 -0
- package/src/generated/Extent.ts +20 -0
- package/src/generated/ExtmarkId.ts +6 -0
- package/src/generated/ExtmarkInfo.ts +43 -0
- package/src/generated/ExtmarkOpts.ts +33 -0
- package/src/generated/ExtmarkRender.ts +44 -0
- package/src/generated/FileChange.ts +18 -0
- package/src/generated/FileState.ts +15 -0
- package/src/generated/FloatConfig.ts +63 -0
- package/src/generated/FrameSet.ts +9 -0
- package/src/generated/Gravity.ts +11 -0
- package/src/generated/HighlightDef.ts +13 -0
- package/src/generated/HighlightEntry.ts +14 -0
- package/src/generated/HighlightSpec.ts +19 -0
- package/src/generated/Hint.ts +18 -0
- package/src/generated/HlTarget.ts +10 -0
- package/src/generated/HookInvocation.ts +14 -0
- package/src/generated/HookName.ts +17 -0
- package/src/generated/HookOutcome.ts +14 -0
- package/src/generated/HookPayload.ts +95 -0
- package/src/generated/InputEvent.ts +31 -0
- package/src/generated/InstanceConfig.ts +26 -0
- package/src/generated/InstanceId.ts +6 -0
- package/src/generated/KeyCode.ts +20 -0
- package/src/generated/KeyContext.ts +24 -0
- package/src/generated/KeyMods.ts +8 -0
- package/src/generated/KeyPress.ts +5 -0
- package/src/generated/KeymapEntry.ts +11 -0
- package/src/generated/KeymapScope.ts +20 -0
- package/src/generated/LineDraw.ts +15 -0
- package/src/generated/LineRender.ts +9 -0
- package/src/generated/LinkState.ts +16 -0
- package/src/generated/MarkDraw.ts +40 -0
- package/src/generated/Message.ts +5 -0
- package/src/generated/MessageLevel.ts +3 -0
- package/src/generated/Mode.ts +6 -0
- package/src/generated/ModelCapabilities.ts +14 -0
- package/src/generated/ModelEntry.ts +13 -0
- package/src/generated/ModelId.ts +6 -0
- package/src/generated/ModelInfo.ts +30 -0
- package/src/generated/ModelSelection.ts +15 -0
- package/src/generated/ModelTier.ts +14 -0
- package/src/generated/NamespaceId.ts +6 -0
- package/src/generated/NodeCapabilities.ts +30 -0
- package/src/generated/NodeId.ts +11 -0
- package/src/generated/NodeInfo.ts +24 -0
- package/src/generated/NoticeKind.ts +11 -0
- package/src/generated/Offset.ts +7 -0
- package/src/generated/OnDelete.ts +7 -0
- package/src/generated/OptionChoice.ts +8 -0
- package/src/generated/OptionEntry.ts +23 -0
- package/src/generated/OptionSelection.ts +4 -0
- package/src/generated/OptionSpec.ts +17 -0
- package/src/generated/OptionType.ts +16 -0
- package/src/generated/OptionValue.ts +13 -0
- package/src/generated/PermissionDecision.ts +6 -0
- package/src/generated/PermissionMode.ts +3 -0
- package/src/generated/PermissionOption.ts +21 -0
- package/src/generated/PermissionOptionKind.ts +13 -0
- package/src/generated/PlanState.ts +6 -0
- package/src/generated/PlanStep.ts +7 -0
- package/src/generated/PluginActivation.ts +10 -0
- package/src/generated/PluginEvent.ts +77 -0
- package/src/generated/PluginId.ts +6 -0
- package/src/generated/PluginInbound.ts +10 -0
- package/src/generated/PluginInfo.ts +19 -0
- package/src/generated/PluginManifest.ts +54 -0
- package/src/generated/PluginOutbound.ts +11 -0
- package/src/generated/PluginPermission.ts +18 -0
- package/src/generated/PluginProvides.ts +19 -0
- package/src/generated/PluginRequest.ts +11 -0
- package/src/generated/PluginResponse.ts +10 -0
- package/src/generated/PointInfo.ts +16 -0
- package/src/generated/Pricing.ts +12 -0
- package/src/generated/ProjectKey.ts +21 -0
- package/src/generated/ProviderEmit.ts +11 -0
- package/src/generated/ProviderEvent.ts +32 -0
- package/src/generated/ProviderOptionDescriptor.ts +38 -0
- package/src/generated/ProviderOptionValue.ts +3 -0
- package/src/generated/QuestionAnswer.ts +24 -0
- package/src/generated/QuestionOption.ts +17 -0
- package/src/generated/QuotaCredits.ts +23 -0
- package/src/generated/QuotaSample.ts +19 -0
- package/src/generated/QuotaSeverity.ts +11 -0
- package/src/generated/QuotaSnapshot.ts +34 -0
- package/src/generated/QuotaSource.ts +6 -0
- package/src/generated/QuotaWindow.ts +40 -0
- package/src/generated/Rect.ts +7 -0
- package/src/generated/Refusal.ts +10 -0
- package/src/generated/RemoteProject.ts +19 -0
- package/src/generated/RepoInfo.ts +23 -0
- package/src/generated/RepoStatus.ts +5 -0
- package/src/generated/RequestId.ts +6 -0
- package/src/generated/Role.ts +3 -0
- package/src/generated/RunningTurn.ts +12 -0
- package/src/generated/SelectShape.ts +6 -0
- package/src/generated/ServerMessage.ts +15 -0
- package/src/generated/SessionId.ts +6 -0
- package/src/generated/SessionInfo.ts +171 -0
- package/src/generated/StatusAlign.ts +3 -0
- package/src/generated/StatusSegment.ts +49 -0
- package/src/generated/StopReason.ts +16 -0
- package/src/generated/StreamEvent.ts +26 -0
- package/src/generated/StreamId.ts +6 -0
- package/src/generated/SurfaceCell.ts +22 -0
- package/src/generated/SurfaceId.ts +6 -0
- package/src/generated/SwarmAgent.ts +11 -0
- package/src/generated/SwarmNode.ts +24 -0
- package/src/generated/SwarmStranger.ts +21 -0
- package/src/generated/TaskId.ts +11 -0
- package/src/generated/TaskStatus.ts +11 -0
- package/src/generated/TextEdit.ts +19 -0
- package/src/generated/ToolCall.ts +13 -0
- package/src/generated/ToolCallId.ts +6 -0
- package/src/generated/ToolDef.ts +12 -0
- package/src/generated/ToolInvocation.ts +11 -0
- package/src/generated/ToolResult.ts +3 -0
- package/src/generated/ToolSource.ts +12 -0
- package/src/generated/TurnId.ts +6 -0
- package/src/generated/TurnRequest.ts +56 -0
- package/src/generated/UiEvent.ts +80 -0
- package/src/generated/Usage.ts +15 -0
- package/src/generated/UsageBucket.ts +32 -0
- package/src/generated/UsageHistory.ts +23 -0
- package/src/generated/UsageResolution.ts +6 -0
- package/src/generated/UsageScanSource.ts +24 -0
- package/src/generated/UsageScanStatus.ts +3 -0
- package/src/generated/UserQuestion.ts +34 -0
- package/src/generated/VarScope.ts +18 -0
- package/src/generated/ViewId.ts +16 -0
- package/src/generated/ViewInfo.ts +23 -0
- package/src/generated/Viewport.ts +18 -0
- package/src/generated/VirtChunk.ts +6 -0
- package/src/generated/VirtTextPos.ts +6 -0
- package/src/generated/WindowId.ts +6 -0
- package/src/generated/WindowInfo.ts +22 -0
- package/src/generated/WindowLayout.ts +28 -0
- package/src/generated/WorkspaceStatus.ts +28 -0
- package/src/generated/WorktreeInfo.ts +16 -0
- package/src/globals.d.ts +39 -0
- package/src/index.ts +2961 -0
- package/src/ui.ts +3279 -0
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
import type { BackgroundTask } from "./BackgroundTask";
|
|
3
|
+
import type { PermissionMode } from "./PermissionMode";
|
|
4
|
+
import type { SessionId } from "./SessionId";
|
|
5
|
+
import type { TurnId } from "./TurnId";
|
|
6
|
+
import type { Usage } from "./Usage";
|
|
7
|
+
|
|
8
|
+
export type SessionInfo = {
|
|
9
|
+
id: SessionId;
|
|
10
|
+
cwd: string;
|
|
11
|
+
/**
|
|
12
|
+
* What to call the directory this conversation is in.
|
|
13
|
+
*
|
|
14
|
+
* The last segment of the path is the obvious answer and is wrong for the case that matters:
|
|
15
|
+
* a worktree is named by whoever created it, and a list of projects reading `wt-fe3c0d93`
|
|
16
|
+
* tells you nothing about which repository or branch that is. A checkout is named by the
|
|
17
|
+
* repository it belongs to, and a linked worktree adds the branch — `neosh · fix/thing` —
|
|
18
|
+
* because that is what a person means when they say which one they are in.
|
|
19
|
+
*
|
|
20
|
+
* Computed by the host so every frontend and plugin agrees, the same as `label`.
|
|
21
|
+
*/
|
|
22
|
+
project: string;
|
|
23
|
+
/**
|
|
24
|
+
* The main checkout of the repository `cwd` is in, when it is in one.
|
|
25
|
+
*
|
|
26
|
+
* This is what lets a list *group* rather than merely label: `project` says `neosh ·
|
|
27
|
+
* fix/thing` about a linked worktree, but a string made for reading is not a key — the only
|
|
28
|
+
* way to find the worktree's siblings in it is to parse a display format back apart. The
|
|
29
|
+
* sidebar nests a worktree under the project it is a worktree *of*, and this is the field
|
|
30
|
+
* that says which one that is. Equal to `cwd` in the main checkout itself; `None` outside a
|
|
31
|
+
* repository.
|
|
32
|
+
*/
|
|
33
|
+
repo_root?: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* The branch checked out at `cwd` when the host last looked, `None` on a detached head or
|
|
36
|
+
* outside a repository. A label, not a fact about *now*: it is refreshed when the directory
|
|
37
|
+
* is next visited, not on every `git switch` someone runs in a shell.
|
|
38
|
+
*/
|
|
39
|
+
branch?: string | null;
|
|
40
|
+
message_count: number;
|
|
41
|
+
active_turn?: TurnId | null;
|
|
42
|
+
/**
|
|
43
|
+
* Seconds since the epoch, stamped when the running turn began.
|
|
44
|
+
*
|
|
45
|
+
* A list that says a conversation is working should say for how long — "thinking" with no
|
|
46
|
+
* clock is indistinguishable from "wedged". Only meaningful while `active_turn` is set; the
|
|
47
|
+
* value is deliberately left behind afterwards rather than cleared, because nothing reads it
|
|
48
|
+
* then and clearing it would be one more write on the turn-end path.
|
|
49
|
+
*/
|
|
50
|
+
turn_started_at?: number | null;
|
|
51
|
+
/**
|
|
52
|
+
* Set by the user or by generation. `None` until something names it.
|
|
53
|
+
*/
|
|
54
|
+
title?: string | null;
|
|
55
|
+
/**
|
|
56
|
+
* What to show in a list: the title, else the opening of the first user message. Computed by
|
|
57
|
+
* the host so every frontend and plugin agrees on the fallback.
|
|
58
|
+
*/
|
|
59
|
+
label: string;
|
|
60
|
+
created_at: number;
|
|
61
|
+
updated_at: number;
|
|
62
|
+
usage: Usage;
|
|
63
|
+
/**
|
|
64
|
+
* How full the context window was on the most recent request: input plus cache, for that one
|
|
65
|
+
* turn.
|
|
66
|
+
*
|
|
67
|
+
* Separate from `usage`, which is cumulative and therefore useless for this: a conversation
|
|
68
|
+
* that has spent 400k tokens across twenty turns is not 400k tokens *long*. The number people
|
|
69
|
+
* want is how much room is left, and only the last request knows it.
|
|
70
|
+
*/
|
|
71
|
+
context_tokens: number;
|
|
72
|
+
/**
|
|
73
|
+
* The window those tokens are a fraction of, **as the driver reports it**.
|
|
74
|
+
*
|
|
75
|
+
* `None` when nothing has said, and then a catalogue figure is the best available guess. It is
|
|
76
|
+
* only a guess: a vendor CLI's window is whatever that CLI decided, which is not always what a
|
|
77
|
+
* catalogue says the model has. `claude` running `claude-haiku-4-5` answers `maxTokens:
|
|
78
|
+
* 200000` while neosh's own entry for the selected model said a million — so the meter was
|
|
79
|
+
* dividing a number it half-knew by a denominator it had invented, and read `2%` where the
|
|
80
|
+
* agent itself would have said `8%`.
|
|
81
|
+
*/
|
|
82
|
+
context_window?: number | null;
|
|
83
|
+
/**
|
|
84
|
+
* Whether this is the conversation on screen **in the terminal that asked**.
|
|
85
|
+
*
|
|
86
|
+
* A workspace can have several terminals and each is somewhere, so this is a question with as
|
|
87
|
+
* many answers as there are screens and the host stamps in the one for whoever is asking. A
|
|
88
|
+
* panel drawing a list marks its own conversation with it; use [`Self::on_screen`] for "is
|
|
89
|
+
* anybody looking at this".
|
|
90
|
+
*/
|
|
91
|
+
is_active: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Whether *some* terminal is reading this conversation.
|
|
94
|
+
*
|
|
95
|
+
* The workspace-wide half of the question above, and the one an unread mark turns on: a turn
|
|
96
|
+
* that ends where nobody could see it is news, and where nobody could see it means every
|
|
97
|
+
* screen.
|
|
98
|
+
*/
|
|
99
|
+
on_screen: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* A turn finished here while you were looking at something else.
|
|
102
|
+
*
|
|
103
|
+
* The one thing a list of conversations cannot say without being told. A turn takes minutes,
|
|
104
|
+
* you switch away, and the row it left behind is indistinguishable from the twelve above it —
|
|
105
|
+
* so the answer you were waiting for is found by opening conversations until one of them has
|
|
106
|
+
* it. This is the mark that makes it findable, and it is *news* rather than state: it is set
|
|
107
|
+
* when a turn ends somewhere you were not, and cleared the moment you arrive.
|
|
108
|
+
*
|
|
109
|
+
* Off screen is the whole test. A turn that ended in the conversation on screen has already
|
|
110
|
+
* been seen — including when nothing was attached, because reattaching lands you in that
|
|
111
|
+
* conversation with the answer in it.
|
|
112
|
+
*/
|
|
113
|
+
unread: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* The workspace stopped while a turn was running here, and nothing ended that turn.
|
|
116
|
+
*
|
|
117
|
+
* The one thing a conversation cannot notice about itself: a process that is killed does not
|
|
118
|
+
* get to write down that it was. So a turn writes down that it *started* and clears the note
|
|
119
|
+
* when it ends, and a note still there when the conversation is next loaded says the process
|
|
120
|
+
* that made it never got to the end — the machine was shut down, the workspace was `SIGKILL`ed,
|
|
121
|
+
* the OOM killer chose it. Whatever the agent had already done is in `messages`; what it was
|
|
122
|
+
* in the middle of is gone, and this is the only thing that will ever say so.
|
|
123
|
+
*
|
|
124
|
+
* Deliberately *not* the same kind of mark as [`Self::unread`], which is news and is cleared
|
|
125
|
+
* by arriving. This is a fact about the conversation's last turn, and arriving does not change
|
|
126
|
+
* it: at startup you land in the conversation you were last in, which is usually the one that
|
|
127
|
+
* was cut off, and a mark that cleared on arrival would clear exactly the one that mattered
|
|
128
|
+
* most before you had read it. It goes when a new turn starts here, because that is the point
|
|
129
|
+
* at which the last turn stops being the last turn.
|
|
130
|
+
*/
|
|
131
|
+
interrupted: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* What is still running here that no turn is waiting for.
|
|
134
|
+
*
|
|
135
|
+
* The other half of [`Self::unread`]. That one says a turn *finished* somewhere you were not
|
|
136
|
+
* looking; this says one did not finish everything it started — a shell the agent put in the
|
|
137
|
+
* background, a sub-agent it let go of — and that the conversation is still doing something
|
|
138
|
+
* even though it has told you it is done.
|
|
139
|
+
*
|
|
140
|
+
* A level: whatever the driver last said is running, verbatim, and empty means nothing is.
|
|
141
|
+
* Kept on the conversation rather than the turn because the turn is over — that is the case
|
|
142
|
+
* it exists for — and because there is more than one list that has to agree about it. See
|
|
143
|
+
* [`crate::Activity::Background`], including why it is never persisted.
|
|
144
|
+
*/
|
|
145
|
+
background?: Array<BackgroundTask>;
|
|
146
|
+
/**
|
|
147
|
+
* Put away rather than thrown away.
|
|
148
|
+
*
|
|
149
|
+
* An archived conversation keeps every message and can be brought back; it is simply not in
|
|
150
|
+
* the list you look at every day. It exists because the alternative verb people were reaching
|
|
151
|
+
* for was delete, and delete is the one thing in a workspace that cannot be undone.
|
|
152
|
+
*/
|
|
153
|
+
archived: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Seconds since the epoch, stamped when it was archived. `None` while it is in the open list.
|
|
156
|
+
*/
|
|
157
|
+
archived_at?: number | null;
|
|
158
|
+
/**
|
|
159
|
+
* What this conversation lets the agent do without asking.
|
|
160
|
+
*
|
|
161
|
+
* A property of the conversation and not of the process, because that is how it is used: a
|
|
162
|
+
* throwaway question in someone else's repository and the branch you have been on all week are
|
|
163
|
+
* not the same risk, and a mode that followed whichever one you looked at last would be a
|
|
164
|
+
* setting you could only trust by re-reading it. It is saved with the conversation for the
|
|
165
|
+
* same reason — coming back to a conversation should mean coming back to how it was set up.
|
|
166
|
+
*
|
|
167
|
+
* `None` means the conversation has never been given one and takes whatever `config.toml`
|
|
168
|
+
* says.
|
|
169
|
+
*/
|
|
170
|
+
permission_mode?: PermissionMode | null;
|
|
171
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
import type { StatusAlign } from "./StatusAlign";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One piece of the status line.
|
|
6
|
+
*/
|
|
7
|
+
export type StatusSegment = {
|
|
8
|
+
text: string;
|
|
9
|
+
/**
|
|
10
|
+
* The same thing, said in less room — used when the strip will not fit and before this
|
|
11
|
+
* segment is dropped for it.
|
|
12
|
+
*
|
|
13
|
+
* A narrow terminal is the case a status line has to survive, and the two answers it had were
|
|
14
|
+
* both wrong. Truncating is out: half a token count is a wrong token count, and a bar cut
|
|
15
|
+
* short is a bar reading a level nothing is at. Dropping is what happened instead, and it
|
|
16
|
+
* took the context meter out of exactly the terminal that most needed it — a turn running
|
|
17
|
+
* adds a segment, which is why the number people watch went missing precisely while there was
|
|
18
|
+
* something to watch.
|
|
19
|
+
*
|
|
20
|
+
* So the segment says its own short form, for the reason [`Hint`] splits its key from its
|
|
21
|
+
* label: what may be given up is a decision only the thing that wrote the text can make, and
|
|
22
|
+
* it cannot be made once the text is one string. `███░░░░░ 34%` is the same fact as
|
|
23
|
+
* `███░░░░░ 34% of 200k` with the denominator left out, and it is still true.
|
|
24
|
+
*
|
|
25
|
+
* Absent means there is no shorter true version, and the segment is dropped whole.
|
|
26
|
+
*/
|
|
27
|
+
short?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* The key that changes this, written the way the user would press it — `^P`, `^Z`.
|
|
30
|
+
*
|
|
31
|
+
* Beside what it acts on rather than in a list of its own, because a key is only memorable
|
|
32
|
+
* once you have seen it next to the thing it does. A separate legend is a second place to
|
|
33
|
+
* look, and the thing being looked up is right there.
|
|
34
|
+
*/
|
|
35
|
+
keys?: string | null;
|
|
36
|
+
hl?: string | null;
|
|
37
|
+
align: StatusAlign;
|
|
38
|
+
/**
|
|
39
|
+
* Lower sorts first within its side. Ties break by key, so the order is stable across redraws
|
|
40
|
+
* rather than depending on which plugin happened to load first.
|
|
41
|
+
*
|
|
42
|
+
* It is also what a narrow strip gives up first, in reverse — so this is a statement about
|
|
43
|
+
* how much the segment is worth, not only about where it goes. Two segments on the same
|
|
44
|
+
* number are separated by the spelling of their keys, which is fine for an order and is no
|
|
45
|
+
* way to decide which of them survives: give anything you would mind losing a number of its
|
|
46
|
+
* own.
|
|
47
|
+
*/
|
|
48
|
+
priority: number;
|
|
49
|
+
};
|
|
@@ -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
|
+
* Why a turn stopped.
|
|
5
|
+
*
|
|
6
|
+
* `Refusal` is explicit because current models return HTTP 200 with a refusal stop reason rather
|
|
7
|
+
* than an error — code that only checks for transport failures silently renders an empty turn.
|
|
8
|
+
*/
|
|
9
|
+
export type StopReason =
|
|
10
|
+
| { "kind": "end_turn" }
|
|
11
|
+
| { "kind": "tool_use" }
|
|
12
|
+
| { "kind": "max_tokens" }
|
|
13
|
+
| { "kind": "stop_sequence" }
|
|
14
|
+
| { "kind": "refusal"; category?: string | null; explanation?: string | null }
|
|
15
|
+
| { "kind": "cancelled" }
|
|
16
|
+
| { "kind": "error"; message: string };
|
|
@@ -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 { Activity } from "./Activity";
|
|
3
|
+
import type { Message } from "./Message";
|
|
4
|
+
import type { StopReason } from "./StopReason";
|
|
5
|
+
import type { Usage } from "./Usage";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What a subscriber is told while watching one agent.
|
|
9
|
+
*
|
|
10
|
+
* The same events the owning node's own frontend gets, minus anything a viewer cannot act on.
|
|
11
|
+
* Enough to render a live transcript: that is the point, because "it feels like the agent is on
|
|
12
|
+
* this computer" is a claim about what you can see, not about where the process is.
|
|
13
|
+
*/
|
|
14
|
+
export type StreamEvent =
|
|
15
|
+
| { "event": "history"; messages: Array<Message> }
|
|
16
|
+
| { "event": "turn_started"; turn: string }
|
|
17
|
+
| { "event": "token"; turn: string; text: string }
|
|
18
|
+
| { "event": "thinking"; turn: string; text: string }
|
|
19
|
+
| { "event": "activity"; turn: string; activity: Activity }
|
|
20
|
+
| {
|
|
21
|
+
"event": "turn_ended";
|
|
22
|
+
turn: string;
|
|
23
|
+
stop_reason: StopReason;
|
|
24
|
+
usage: Usage;
|
|
25
|
+
}
|
|
26
|
+
| { "event": "blocked"; turn: string; prompt: string };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
import type { Attrs } from "./Attrs";
|
|
3
|
+
import type { Color } from "./Color";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A directly-addressed cell within a claimed surface.
|
|
7
|
+
*
|
|
8
|
+
* The escape hatch for the ~5% of plugins (diff gutters, sparklines, token/cost graphs) that
|
|
9
|
+
* cannot be expressed as text plus annotations. A non-terminal frontend renders a surface as an
|
|
10
|
+
* opaque monospace grid.
|
|
11
|
+
*/
|
|
12
|
+
export type SurfaceCell = {
|
|
13
|
+
row: number;
|
|
14
|
+
col: number;
|
|
15
|
+
/**
|
|
16
|
+
* One grapheme cluster, not one `char`. Emoji and combining sequences are single cells here.
|
|
17
|
+
*/
|
|
18
|
+
grapheme: string;
|
|
19
|
+
fg?: Color | null;
|
|
20
|
+
bg?: Color | null;
|
|
21
|
+
attrs: Attrs;
|
|
22
|
+
};
|
|
@@ -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 { AgentSummary } from "./AgentSummary";
|
|
3
|
+
import type { NodeInfo } from "./NodeInfo";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* One remote agent, with the node it belongs to attached.
|
|
7
|
+
*
|
|
8
|
+
* Flattened for the common case, which is drawing a list: an agent is addressed as `(node,
|
|
9
|
+
* session)`, and a row that carried only the session would be a row you cannot act on.
|
|
10
|
+
*/
|
|
11
|
+
export type SwarmAgent = { node: NodeInfo; agent: AgentSummary };
|
|
@@ -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 { AgentSummary } from "./AgentSummary";
|
|
3
|
+
import type { LinkState } from "./LinkState";
|
|
4
|
+
import type { NodeCapabilities } from "./NodeCapabilities";
|
|
5
|
+
import type { NodeInfo } from "./NodeInfo";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A node, as a plugin sees it: what it is, and what it has.
|
|
9
|
+
*/
|
|
10
|
+
export type SwarmNode = {
|
|
11
|
+
info: NodeInfo;
|
|
12
|
+
capabilities: NodeCapabilities;
|
|
13
|
+
/**
|
|
14
|
+
* `false` for a machine we have lost touch with. Its agents are still described, because they
|
|
15
|
+
* were real a moment ago and probably still are — what changed is that we cannot see them.
|
|
16
|
+
*/
|
|
17
|
+
up: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The story behind `up`: connecting, retrying with a count, or not being dialled at all.
|
|
20
|
+
*/
|
|
21
|
+
link: LinkState;
|
|
22
|
+
reason?: string | null;
|
|
23
|
+
agents: Array<AgentSummary>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
import type { NodeInfo } from "./NodeInfo";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A machine that proved who it is and has not been paired with.
|
|
6
|
+
*/
|
|
7
|
+
export type SwarmStranger = {
|
|
8
|
+
info: NodeInfo;
|
|
9
|
+
/**
|
|
10
|
+
* `true` when we found it by dialling an address, `false` when it dialled us.
|
|
11
|
+
*
|
|
12
|
+
* Decides what to ask. One is "this is what is at that address — add it?", the other is
|
|
13
|
+
* "this machine wants to join — allow it?", and they are different questions even though the
|
|
14
|
+
* button does the same thing.
|
|
15
|
+
*/
|
|
16
|
+
dialled: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Where it was reached, when we were the one dialling.
|
|
19
|
+
*/
|
|
20
|
+
addr?: string | null;
|
|
21
|
+
};
|
|
@@ -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
|
+
* One sub-agent, from the moment it is spawned to the moment it reports.
|
|
5
|
+
*
|
|
6
|
+
* Distinct from the [`ToolCallId`] of the call that started it: a driver may run a task
|
|
7
|
+
* nobody asked for by name — a background job, a workflow member — and those have no call to
|
|
8
|
+
* borrow an id from. When there *is* one, it is carried alongside rather than reused, so the
|
|
9
|
+
* tree can be rebuilt without either id having to mean two things.
|
|
10
|
+
*/
|
|
11
|
+
export type TaskId = string;
|
|
@@ -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
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A change to make at a window's cursor.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately verbs rather than a text diff: a plugin that wants "delete the word behind the
|
|
7
|
+
* cursor" should not have to reimplement word boundaries, and every caller getting the same answer
|
|
8
|
+
* is the only way `<C-w>` means one thing across the whole program.
|
|
9
|
+
*/
|
|
10
|
+
export type TextEdit =
|
|
11
|
+
| { "kind": "insert"; text: string }
|
|
12
|
+
| { "kind": "delete_back" }
|
|
13
|
+
| { "kind": "delete_forward" }
|
|
14
|
+
| { "kind": "delete_word_back" }
|
|
15
|
+
| { "kind": "delete_word_forward" }
|
|
16
|
+
| { "kind": "delete_to_line_start" }
|
|
17
|
+
| { "kind": "delete_to_line_end" }
|
|
18
|
+
| { "kind": "delete_range"; from: [number, number]; to: [number, number] }
|
|
19
|
+
| { "kind": "delete_selection" };
|
|
@@ -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 { ToolCallId } from "./ToolCallId";
|
|
3
|
+
import type { TurnId } from "./TurnId";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A tool call in flight, as seen by hooks.
|
|
7
|
+
*/
|
|
8
|
+
export type ToolCall = {
|
|
9
|
+
id: ToolCallId;
|
|
10
|
+
turn: TurnId;
|
|
11
|
+
name: string;
|
|
12
|
+
input: unknown;
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
import type { ToolSource } from "./ToolSource";
|
|
3
|
+
|
|
4
|
+
export type ToolDef = {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
/**
|
|
8
|
+
* JSON Schema. Passed to the provider verbatim.
|
|
9
|
+
*/
|
|
10
|
+
input_schema: Record<string, unknown>;
|
|
11
|
+
source: ToolSource;
|
|
12
|
+
};
|
|
@@ -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 { RequestId } from "./RequestId";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A tool the host wants the plugin to run.
|
|
6
|
+
*/
|
|
7
|
+
export type ToolInvocation = {
|
|
8
|
+
request: RequestId;
|
|
9
|
+
name: string;
|
|
10
|
+
input: unknown;
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Where a tool came from.
|
|
5
|
+
*
|
|
6
|
+
* Built-in, plugin and MCP tools land in one namespace with one shape, so that a policy hook does
|
|
7
|
+
* not have to care which kind it is intercepting.
|
|
8
|
+
*/
|
|
9
|
+
export type ToolSource = { "kind": "builtin" } | {
|
|
10
|
+
"kind": "plugin";
|
|
11
|
+
plugin: string;
|
|
12
|
+
} | { "kind": "mcp"; server: string };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
import type { Message } from "./Message";
|
|
3
|
+
import type { ModelSelection } from "./ModelSelection";
|
|
4
|
+
import type { SessionId } from "./SessionId";
|
|
5
|
+
import type { ToolDef } from "./ToolDef";
|
|
6
|
+
|
|
7
|
+
export type TurnRequest = {
|
|
8
|
+
selection: ModelSelection;
|
|
9
|
+
/**
|
|
10
|
+
* Which conversation this turn belongs to.
|
|
11
|
+
*
|
|
12
|
+
* A driver that keeps anything between turns needs this and cannot derive it. A vendor CLI
|
|
13
|
+
* holds the history on its side and hands back a session id to resume into; a driver that
|
|
14
|
+
* kept one of those per *process* — as this one did — would resume the second conversation
|
|
15
|
+
* into the first one's history, and neither of them would ever say anything was wrong.
|
|
16
|
+
*
|
|
17
|
+
* Several conversations run at once by design, so "the current one" is not a thing a driver
|
|
18
|
+
* may assume. Empty for a caller that has no conversation to name, such as a one-shot
|
|
19
|
+
* generation — a driver keying state by this must treat that as "keep nothing".
|
|
20
|
+
*/
|
|
21
|
+
conversation: SessionId;
|
|
22
|
+
/**
|
|
23
|
+
* The directory this turn happens in.
|
|
24
|
+
*
|
|
25
|
+
* The conversation's, not the process's. A vendor CLI is an agent that reads files, runs
|
|
26
|
+
* commands and looks at git — all of it relative to where it was started — so a driver that
|
|
27
|
+
* spawns it in whatever directory neosh happened to be launched from is asking about the
|
|
28
|
+
* wrong repository. Every conversation carries a project; this is how a driver finds out
|
|
29
|
+
* which one.
|
|
30
|
+
*
|
|
31
|
+
* Empty means "wherever the host process is", which is what a driver with no opinion did
|
|
32
|
+
* before this field existed.
|
|
33
|
+
*/
|
|
34
|
+
cwd: string;
|
|
35
|
+
/**
|
|
36
|
+
* What the driver called this conversation last time, if it named it.
|
|
37
|
+
*
|
|
38
|
+
* A vendor CLI keeps the history on its side and hands back a handle — `claude`'s session id,
|
|
39
|
+
* ACP's session, `codex`'s conversation. A driver that only remembers that handle in its own
|
|
40
|
+
* process remembers it exactly as long as the workspace lives: restart, reopen a conversation
|
|
41
|
+
* with a hundred messages in it, and the agent is started fresh and told only the newest one.
|
|
42
|
+
* The transcript looks full and the model has never heard of any of it, which is not a thing
|
|
43
|
+
* either side reports as an error — it is simply an agent that has forgotten, and the first
|
|
44
|
+
* visible sign of it is `/compact` finishing instantly with nothing to compact.
|
|
45
|
+
*
|
|
46
|
+
* So the handle belongs to the conversation, which is the thing that outlives the process.
|
|
47
|
+
* The driver hands it over with [`Activity::Resume`] and is given it back here. `None` means
|
|
48
|
+
* this conversation has never been run by this driver, which is the only case where starting
|
|
49
|
+
* fresh is right.
|
|
50
|
+
*/
|
|
51
|
+
resume?: string | null;
|
|
52
|
+
system?: string | null;
|
|
53
|
+
messages: Array<Message>;
|
|
54
|
+
tools?: Array<ToolDef>;
|
|
55
|
+
max_output_tokens?: number | null;
|
|
56
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
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 { CursorShape } from "./CursorShape";
|
|
4
|
+
import type { HighlightDef } from "./HighlightDef";
|
|
5
|
+
import type { LineRender } from "./LineRender";
|
|
6
|
+
import type { MessageLevel } from "./MessageLevel";
|
|
7
|
+
import type { NoticeKind } from "./NoticeKind";
|
|
8
|
+
import type { Rect } from "./Rect";
|
|
9
|
+
import type { SurfaceCell } from "./SurfaceCell";
|
|
10
|
+
import type { SurfaceId } from "./SurfaceId";
|
|
11
|
+
import type { WindowId } from "./WindowId";
|
|
12
|
+
import type { WindowLayout } from "./WindowLayout";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A retained-state delta. Frontends fold these into a mirror and draw from it.
|
|
16
|
+
*
|
|
17
|
+
* Emitted in coalesced batches — see [`UiEvent::Flush`].
|
|
18
|
+
*/
|
|
19
|
+
export type UiEvent =
|
|
20
|
+
| { "type": "init"; protocol_version: number }
|
|
21
|
+
| { "type": "buffer_opened"; buf: BufferId; name: string }
|
|
22
|
+
| { "type": "buffer_closed"; buf: BufferId }
|
|
23
|
+
| {
|
|
24
|
+
"type": "buffer_lines";
|
|
25
|
+
buf: BufferId;
|
|
26
|
+
start: number;
|
|
27
|
+
old_end: number;
|
|
28
|
+
lines: Array<LineRender>;
|
|
29
|
+
}
|
|
30
|
+
| {
|
|
31
|
+
"type": "window_opened";
|
|
32
|
+
win: WindowId;
|
|
33
|
+
buf: BufferId;
|
|
34
|
+
layout: WindowLayout;
|
|
35
|
+
}
|
|
36
|
+
| { "type": "window_configured"; win: WindowId; layout: WindowLayout }
|
|
37
|
+
| { "type": "window_buffer"; win: WindowId; buf: BufferId }
|
|
38
|
+
| { "type": "window_closed"; win: WindowId }
|
|
39
|
+
| { "type": "cursor_moved"; win: WindowId; row: number; col: number }
|
|
40
|
+
| { "type": "cursor_shape_changed"; win: WindowId; shape: CursorShape }
|
|
41
|
+
| { "type": "scroll_to"; win: WindowId; top_line: number | null }
|
|
42
|
+
| { "type": "highlight_defined"; name: string; def: HighlightDef }
|
|
43
|
+
| { "type": "highlight_cleared"; name: string }
|
|
44
|
+
| { "type": "window_highlights"; win: WindowId; map: Record<string, string> }
|
|
45
|
+
| { "type": "surface_claimed"; surface: SurfaceId; win: WindowId; rect: Rect }
|
|
46
|
+
| { "type": "surface_cells"; surface: SurfaceId; cells: Array<SurfaceCell> }
|
|
47
|
+
| { "type": "surface_released"; surface: SurfaceId }
|
|
48
|
+
| { "type": "focus_changed"; win: WindowId | null }
|
|
49
|
+
| {
|
|
50
|
+
"type": "message";
|
|
51
|
+
level: MessageLevel;
|
|
52
|
+
text: string;
|
|
53
|
+
/**
|
|
54
|
+
* Whether you asked for this, which is what decides how long it lives.
|
|
55
|
+
*
|
|
56
|
+
* Defaulted rather than required: `Reply` is what every existing sender meant, and a
|
|
57
|
+
* frontend from before this existed folds the field away and draws what it always drew.
|
|
58
|
+
*/
|
|
59
|
+
kind: NoticeKind;
|
|
60
|
+
/**
|
|
61
|
+
* Which progress row this is, for [`NoticeKind::Progress`].
|
|
62
|
+
*
|
|
63
|
+
* Ignored on every other kind. Writing the same key twice replaces the row; see
|
|
64
|
+
* [`UiEvent::ProgressDone`] for taking it away.
|
|
65
|
+
*/
|
|
66
|
+
key?: string | null;
|
|
67
|
+
}
|
|
68
|
+
| { "type": "progress_done"; key: string }
|
|
69
|
+
| {
|
|
70
|
+
"type": "alert";
|
|
71
|
+
/**
|
|
72
|
+
* What this is about, in a few words — a conversation's name, usually.
|
|
73
|
+
*/
|
|
74
|
+
title: string;
|
|
75
|
+
body: string;
|
|
76
|
+
level: MessageLevel;
|
|
77
|
+
}
|
|
78
|
+
| { "type": "clipboard"; text: string }
|
|
79
|
+
| { "type": "flush" }
|
|
80
|
+
| { "type": "shutdown" };
|
|
@@ -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
|
+
* Token accounting, surfaced so a plugin can render a budget without scraping.
|
|
5
|
+
*/
|
|
6
|
+
export type Usage = {
|
|
7
|
+
input_tokens: number;
|
|
8
|
+
output_tokens: number;
|
|
9
|
+
cache_read_tokens: number;
|
|
10
|
+
cache_write_tokens: number;
|
|
11
|
+
/**
|
|
12
|
+
* Thinking tokens, where the provider reports them separately.
|
|
13
|
+
*/
|
|
14
|
+
thinking_tokens: number;
|
|
15
|
+
};
|