@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,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
|
+
* The names a plugin publishes for other plugins to use. See [`PluginManifest::provides`].
|
|
5
|
+
*/
|
|
6
|
+
export type PluginProvides = {
|
|
7
|
+
/**
|
|
8
|
+
* Contribution points this plugin reads (`sidebar.section`).
|
|
9
|
+
*/
|
|
10
|
+
points?: Array<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Buffer kinds it creates (`neosh.sidebar`).
|
|
13
|
+
*/
|
|
14
|
+
kinds?: Array<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Shared vars it writes (`sidebar.favorite`).
|
|
17
|
+
*/
|
|
18
|
+
vars?: Array<string>;
|
|
19
|
+
};
|
|
@@ -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 { HookName } from "./HookName";
|
|
3
|
+
import type { HookPayload } from "./HookPayload";
|
|
4
|
+
import type { StreamId } from "./StreamId";
|
|
5
|
+
import type { TurnRequest } from "./TurnRequest";
|
|
6
|
+
|
|
7
|
+
export type PluginRequest =
|
|
8
|
+
| { "type": "run_tool"; name: string; input: unknown }
|
|
9
|
+
| { "type": "hook"; hook: HookName; payload: HookPayload }
|
|
10
|
+
| { "type": "command"; name: string; args?: Array<string> }
|
|
11
|
+
| { "type": "provider_stream"; stream: StreamId; request: TurnRequest };
|
|
@@ -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 { HookOutcome } from "./HookOutcome";
|
|
3
|
+
import type { ToolResult } from "./ToolResult";
|
|
4
|
+
|
|
5
|
+
export type PluginResponse =
|
|
6
|
+
| { "type": "tool"; result: ToolResult }
|
|
7
|
+
| { "type": "hook"; outcome: HookOutcome }
|
|
8
|
+
| { "type": "command"; value: unknown }
|
|
9
|
+
| { "type": "provider_accepted" }
|
|
10
|
+
| { "type": "error"; message: string };
|
|
@@ -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
|
+
* A contribution point as [`ApiCall::ExtPoints`] reports it.
|
|
5
|
+
*/
|
|
6
|
+
export type PointInfo = {
|
|
7
|
+
point: string;
|
|
8
|
+
/**
|
|
9
|
+
* Plugins whose manifest says they read it.
|
|
10
|
+
*/
|
|
11
|
+
readers: Array<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Plugins with something on it now.
|
|
14
|
+
*/
|
|
15
|
+
contributors: Array<string>;
|
|
16
|
+
};
|
|
@@ -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
|
+
* Cost per million tokens, for budget display. `None` where unknown (local models, unlisted
|
|
5
|
+
* endpoints) — the UI must render "unknown" rather than guessing zero.
|
|
6
|
+
*/
|
|
7
|
+
export type Pricing = {
|
|
8
|
+
input_per_mtok: number;
|
|
9
|
+
output_per_mtok: number;
|
|
10
|
+
cache_read_per_mtok: number;
|
|
11
|
+
cache_write_per_mtok: number;
|
|
12
|
+
};
|
|
@@ -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
|
+
|
|
3
|
+
/**
|
|
4
|
+
* How two machines recognise the same project.
|
|
5
|
+
*
|
|
6
|
+
* The hard part of showing "this project is on three computers" is that the path is not the same
|
|
7
|
+
* on any of them: `/Users/me/dev/neosh`, `/home/me/src/neosh`, `C:\code\neosh`. Comparing paths
|
|
8
|
+
* answers the wrong question, and comparing directory names says two unrelated `api` directories
|
|
9
|
+
* are one project.
|
|
10
|
+
*
|
|
11
|
+
* So the key is the repository's origin URL, normalised — `git:github.com/neoswarm/neosh` — which
|
|
12
|
+
* is the same string on every machine that cloned it, including through different protocols
|
|
13
|
+
* (`git@github.com:…`, `https://github.com/…`). A directory that is not a checkout falls back to
|
|
14
|
+
* `dir:<basename>`, which is weak on purpose: it is a guess, and a guess about identity should be
|
|
15
|
+
* visibly a guess rather than quietly wrong.
|
|
16
|
+
*
|
|
17
|
+
* Worktrees of one repository share a key. That is deliberate — they are the same project, checked
|
|
18
|
+
* out twice — and it is what lets a board say "neosh: on mac-studio and on linux-box" rather than
|
|
19
|
+
* listing four rows that are all really one thing.
|
|
20
|
+
*/
|
|
21
|
+
export type ProjectKey = string;
|
|
@@ -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 { ProviderEvent } from "./ProviderEvent";
|
|
3
|
+
import type { StreamId } from "./StreamId";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Emitted by a *plugin-implemented* provider, pushed rather than returned.
|
|
7
|
+
*
|
|
8
|
+
* A plugin cannot return a stream across the RPC boundary, so it answers the stream request
|
|
9
|
+
* immediately and then pushes events tagged with the [`StreamId`] until it sends `MessageStop`.
|
|
10
|
+
*/
|
|
11
|
+
export type ProviderEmit = { stream: StreamId; event: ProviderEvent };
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { BlockStartKind } from "./BlockStartKind";
|
|
4
|
+
import type { StopReason } from "./StopReason";
|
|
5
|
+
import type { ToolCallId } from "./ToolCallId";
|
|
6
|
+
import type { Usage } from "./Usage";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Normalized streaming events.
|
|
10
|
+
*
|
|
11
|
+
* These mirror the Anthropic Messages SSE shape because it is the most expressive of the wire
|
|
12
|
+
* formats we target (separate thinking blocks, incremental tool-input JSON). Every other driver
|
|
13
|
+
* adapts *into* this, so the agent loop has exactly one stream shape to handle.
|
|
14
|
+
*/
|
|
15
|
+
export type ProviderEvent =
|
|
16
|
+
| { "type": "message_start"; model?: string | null; usage: Usage }
|
|
17
|
+
| { "type": "block_start"; index: number; block: BlockStartKind }
|
|
18
|
+
| { "type": "text_delta"; index: number; text: string }
|
|
19
|
+
| { "type": "thinking_delta"; index: number; text: string }
|
|
20
|
+
| { "type": "signature_delta"; index: number; signature: string }
|
|
21
|
+
| { "type": "tool_input_delta"; index: number; partial_json: string }
|
|
22
|
+
| { "type": "block_stop"; index: number }
|
|
23
|
+
| { "type": "message_delta"; stop_reason?: StopReason | null; usage: Usage }
|
|
24
|
+
| { "type": "message_stop" }
|
|
25
|
+
| {
|
|
26
|
+
"type": "tool_result";
|
|
27
|
+
id: ToolCallId;
|
|
28
|
+
content: string;
|
|
29
|
+
is_error: boolean;
|
|
30
|
+
}
|
|
31
|
+
| { "type": "activity"; activity: Activity }
|
|
32
|
+
| { "type": "error"; message: string; retryable: boolean };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
import type { OptionChoice } from "./OptionChoice";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One knob a model exposes.
|
|
6
|
+
*
|
|
7
|
+
* The UI renders these without knowing what any of them mean, so a driver can add
|
|
8
|
+
* `{"id":"fast_mode"}` and have it appear in the model picker with no host change.
|
|
9
|
+
*/
|
|
10
|
+
export type ProviderOptionDescriptor = {
|
|
11
|
+
"type": "select";
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
description?: string | null;
|
|
15
|
+
options: Array<OptionChoice>;
|
|
16
|
+
current_value?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Values that are applied by prefixing the *prompt* rather than by sending a request
|
|
19
|
+
* parameter. Some vendors gate reasoning depth on magic words in the user message.
|
|
20
|
+
*/
|
|
21
|
+
prompt_injected_values?: Array<string>;
|
|
22
|
+
} | {
|
|
23
|
+
"type": "boolean";
|
|
24
|
+
id: string;
|
|
25
|
+
label: string;
|
|
26
|
+
description?: string | null;
|
|
27
|
+
current_value: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* A word to put in the message while this is on, for a switch a vendor reads out of the
|
|
30
|
+
* prompt rather than off a parameter.
|
|
31
|
+
*
|
|
32
|
+
* The switch is then *nothing but* that word: with it on, the word is written into the
|
|
33
|
+
* turn and no option value is sent at all. The same idea as
|
|
34
|
+
* [`Self::Select::prompt_injected_values`], for the knobs that are a yes/no rather than a
|
|
35
|
+
* rung — orchestration modes, personas, anything a harness gates on what you said.
|
|
36
|
+
*/
|
|
37
|
+
prompt_injected_word?: string | null;
|
|
38
|
+
};
|
|
@@ -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
|
+
|
|
3
|
+
/**
|
|
4
|
+
* What somebody said, for one question.
|
|
5
|
+
*/
|
|
6
|
+
export type QuestionAnswer = {
|
|
7
|
+
/**
|
|
8
|
+
* Which question this answers, by its [`UserQuestion::question`] text.
|
|
9
|
+
*/
|
|
10
|
+
question: string;
|
|
11
|
+
/**
|
|
12
|
+
* The labels taken, in the order they were taken. Exactly one for a single-select question.
|
|
13
|
+
*
|
|
14
|
+
* An answer somebody *typed* is one entry that is not any of the offered labels, and that is
|
|
15
|
+
* not a special case on the wire: to the agent, "Postgres" and "neither, use what is already
|
|
16
|
+
* there" are the same kind of thing — what the user said.
|
|
17
|
+
*/
|
|
18
|
+
answers: Array<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Whether [`Self::answers`] was typed rather than chosen. Carried so a transcript can draw it
|
|
21
|
+
* differently; nothing sent to the agent depends on it.
|
|
22
|
+
*/
|
|
23
|
+
custom: boolean;
|
|
24
|
+
};
|
|
@@ -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
|
+
* One answer on offer.
|
|
5
|
+
*/
|
|
6
|
+
export type QuestionOption = {
|
|
7
|
+
/**
|
|
8
|
+
* What the option is called. **This is what is sent back** — the agent matches on the label
|
|
9
|
+
* it wrote, not on a position in a list, so a client that reorders the rows still answers the
|
|
10
|
+
* question it was asked.
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* What taking it would mean. Shown under the label, dimmed; often the part that decides it.
|
|
15
|
+
*/
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Paid-for headroom past the plan, where the vendor sells it.
|
|
5
|
+
*/
|
|
6
|
+
export type QuotaCredits = {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the account can actually spend past its plan. `false` is the interesting case: it is
|
|
9
|
+
* why hitting a limit stops work rather than costing money.
|
|
10
|
+
*/
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
used_percent?: number | null;
|
|
13
|
+
/**
|
|
14
|
+
* Already formatted by whoever knew the currency. A balance rendered from a minor-unit integer
|
|
15
|
+
* by a client that guessed `USD` is a number that is wrong twice a year.
|
|
16
|
+
*/
|
|
17
|
+
balance?: string | null;
|
|
18
|
+
limit?: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Why it is off, in the vendor's words, when it is off for a reason worth repeating.
|
|
21
|
+
*/
|
|
22
|
+
disabled_reason?: string | null;
|
|
23
|
+
};
|
|
@@ -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 { InstanceId } from "./InstanceId";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One window's percentage at one instant, kept so a gauge can be a line rather than a number.
|
|
6
|
+
*
|
|
7
|
+
* Sampled rather than derived. Nothing on disk records what a plan percentage was an hour ago —
|
|
8
|
+
* the vendor reports only *now* — so a history exists at all only because something wrote each
|
|
9
|
+
* answer down as it arrived.
|
|
10
|
+
*/
|
|
11
|
+
export type QuotaSample = {
|
|
12
|
+
at: number;
|
|
13
|
+
instance: InstanceId;
|
|
14
|
+
/**
|
|
15
|
+
* [`QuotaWindow::id`], so a sample can be matched back to the window it belongs to.
|
|
16
|
+
*/
|
|
17
|
+
window: string;
|
|
18
|
+
used_percent: number;
|
|
19
|
+
};
|
|
@@ -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
|
+
* How worried to be, as the vendor grades it.
|
|
5
|
+
*
|
|
6
|
+
* Graded at the source rather than by a threshold here, because the thresholds are not ours to
|
|
7
|
+
* pick: Anthropic calls 94% of a weekly window `critical` and 55% of a session window `normal`,
|
|
8
|
+
* and a client that decided at 80% for both would be shouting about the wrong one. A source that
|
|
9
|
+
* reports no grade gets one from [`QuotaSeverity::of`], which is the fallback and says so.
|
|
10
|
+
*/
|
|
11
|
+
export type QuotaSeverity = "normal" | "warn" | "critical" | "exhausted";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
import type { InstanceId } from "./InstanceId";
|
|
3
|
+
import type { QuotaCredits } from "./QuotaCredits";
|
|
4
|
+
import type { QuotaSource } from "./QuotaSource";
|
|
5
|
+
import type { QuotaWindow } from "./QuotaWindow";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Everything known about one account's allowance, as of one instant.
|
|
9
|
+
*
|
|
10
|
+
* Whole rather than patched, for the reason [`crate::Activity::Plan`] is whole: a patch is only
|
|
11
|
+
* correct if the previous state was, and every source of these reports the complete set anyway.
|
|
12
|
+
*/
|
|
13
|
+
export type QuotaSnapshot = {
|
|
14
|
+
/**
|
|
15
|
+
* Which configured provider instance this is the account of. Two instances may share one
|
|
16
|
+
* account and two accounts may share one vendor, so this is keyed by instance and never by
|
|
17
|
+
* vendor.
|
|
18
|
+
*/
|
|
19
|
+
instance: InstanceId;
|
|
20
|
+
/**
|
|
21
|
+
* The plan's own name, when the vendor says it: `max`, `pro`, `plus`. Drawn as context for the
|
|
22
|
+
* percentages, never used to infer what the limits are.
|
|
23
|
+
*/
|
|
24
|
+
plan?: string | null;
|
|
25
|
+
windows: Array<QuotaWindow>;
|
|
26
|
+
credits?: QuotaCredits | null;
|
|
27
|
+
/**
|
|
28
|
+
* Unix seconds. The reason this is on the wire rather than stamped on arrival: a snapshot
|
|
29
|
+
* travels — over ASCP from another computer, out of a store on reattach — and "when it was
|
|
30
|
+
* received here" is a different fact from "when it was true".
|
|
31
|
+
*/
|
|
32
|
+
observed_at: number;
|
|
33
|
+
source: QuotaSource;
|
|
34
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
import type { QuotaSeverity } from "./QuotaSeverity";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One rolling allowance, as the vendor describes it.
|
|
6
|
+
*/
|
|
7
|
+
export type QuotaWindow = {
|
|
8
|
+
/**
|
|
9
|
+
* The vendor's own name for this limit. Stable enough to key a redraw on, opaque by design.
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* What to draw. Written for a person: `Session`, `Weekly`, `Weekly · Opus`.
|
|
14
|
+
*/
|
|
15
|
+
label: string;
|
|
16
|
+
/**
|
|
17
|
+
* 0-100. Above 100 is possible and is not clamped — an account in overage really has used more
|
|
18
|
+
* than its allowance, and rounding that down to "full" loses the only interesting part.
|
|
19
|
+
*/
|
|
20
|
+
used_percent: number;
|
|
21
|
+
/**
|
|
22
|
+
* Unix seconds. `None` for an allowance that does not roll over.
|
|
23
|
+
*/
|
|
24
|
+
resets_at?: number | null;
|
|
25
|
+
/**
|
|
26
|
+
* How long the window is, when the vendor says. Lets a client show how fast it is being spent
|
|
27
|
+
* rather than only how much is gone.
|
|
28
|
+
*/
|
|
29
|
+
window_minutes?: number | null;
|
|
30
|
+
severity: QuotaSeverity;
|
|
31
|
+
/**
|
|
32
|
+
* What this limit is *about*, when it is about one thing: a model, a surface. `Fable`, `Opus`.
|
|
33
|
+
*/
|
|
34
|
+
scope?: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* The limit currently doing the limiting. Several windows are usually open at once and only
|
|
37
|
+
* one of them is the reason a request would be refused.
|
|
38
|
+
*/
|
|
39
|
+
active: boolean;
|
|
40
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
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 resolved rectangle in frontend cell space. Only ever travels frontend -> core (as viewport
|
|
5
|
+
* feedback) or core -> frontend for raw-cell surfaces, which are opaque blits by definition.
|
|
6
|
+
*/
|
|
7
|
+
export type Rect = { row: number; col: number; width: number; height: number };
|
|
@@ -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
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Why a command was not carried out.
|
|
5
|
+
*/
|
|
6
|
+
export type Refusal =
|
|
7
|
+
| { "reason": "no_such_agent" }
|
|
8
|
+
| { "reason": "not_permitted"; what: string }
|
|
9
|
+
| { "reason": "busy"; message: string }
|
|
10
|
+
| { "reason": "failed"; message: 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
|
+
import type { ProjectKey } from "./ProjectKey";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One checkout a node has, for "start something over there".
|
|
6
|
+
*/
|
|
7
|
+
export type RemoteProject = {
|
|
8
|
+
key: ProjectKey;
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* The path on the owning node. Opaque here: it is what you hand back in
|
|
12
|
+
* [`AgentCommand::NewSession`], not something to look at locally.
|
|
13
|
+
*/
|
|
14
|
+
cwd: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether this node has a conversation open in it now.
|
|
17
|
+
*/
|
|
18
|
+
active: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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 repository is and what state its HEAD is in.
|
|
5
|
+
*/
|
|
6
|
+
export type RepoInfo = {
|
|
7
|
+
/**
|
|
8
|
+
* Absolute path to the working tree root.
|
|
9
|
+
*/
|
|
10
|
+
root: string;
|
|
11
|
+
/**
|
|
12
|
+
* `None` on a detached HEAD, which is why `head` is reported separately.
|
|
13
|
+
*/
|
|
14
|
+
branch?: string | null;
|
|
15
|
+
detached: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Short hash of HEAD. `None` in a repository with no commits yet.
|
|
18
|
+
*/
|
|
19
|
+
head?: string | null;
|
|
20
|
+
upstream?: string | null;
|
|
21
|
+
ahead: number;
|
|
22
|
+
behind: number;
|
|
23
|
+
};
|
|
@@ -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 { FileChange } from "./FileChange";
|
|
3
|
+
import type { RepoInfo } from "./RepoInfo";
|
|
4
|
+
|
|
5
|
+
export type RepoStatus = { repo: RepoInfo; changes: Array<FileChange> };
|
|
@@ -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 { SessionId } from "./SessionId";
|
|
3
|
+
|
|
4
|
+
export type RunningTurn = {
|
|
5
|
+
session: SessionId;
|
|
6
|
+
label: string;
|
|
7
|
+
/**
|
|
8
|
+
* The directory the conversation belongs to.
|
|
9
|
+
*/
|
|
10
|
+
cwd: string;
|
|
11
|
+
elapsed_secs: number;
|
|
12
|
+
};
|
|
@@ -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 { BuildId } from "./BuildId";
|
|
3
|
+
import type { DetachReason } from "./DetachReason";
|
|
4
|
+
import type { UiEvent } from "./UiEvent";
|
|
5
|
+
import type { WorkspaceStatus } from "./WorkspaceStatus";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What the workspace says back.
|
|
9
|
+
*/
|
|
10
|
+
export type ServerMessage =
|
|
11
|
+
| { "kind": "attached"; protocol_version: number; build: BuildId }
|
|
12
|
+
| { "kind": "refused"; reason: string; protocol_version: number }
|
|
13
|
+
| { "kind": "events"; batch: Array<UiEvent> }
|
|
14
|
+
| { "kind": "detached"; reason: DetachReason }
|
|
15
|
+
| { "kind": "status"; status: WorkspaceStatus };
|