@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
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@neosh/api",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The neosh plugin API. Types are generated from the Rust side and drift-checked in CI.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"exports": { ".": "./src/index.ts" },
|
|
9
|
+
"keywords": [
|
|
10
|
+
"neosh",
|
|
11
|
+
"neosh-plugin",
|
|
12
|
+
"agent",
|
|
13
|
+
"typescript"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/neoswarm/neosh",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/neoswarm/neosh.git",
|
|
19
|
+
"directory": "plugins/api"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"src",
|
|
23
|
+
"tsconfig.json"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"typecheck": "tsc --noEmit"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"typescript": "^5.7.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -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
|
+
* What you are spending when you use an instance.
|
|
5
|
+
*
|
|
6
|
+
* The one distinction the old flat list could not make. Everything else in a picker — ordering,
|
|
7
|
+
* grouping, which sign-in verb to offer, whether to show a price — follows from this.
|
|
8
|
+
*/
|
|
9
|
+
export type AccountKind = "plan" | "api_key" | "local";
|
|
@@ -0,0 +1,85 @@
|
|
|
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 { DriverCommand } from "./DriverCommand";
|
|
4
|
+
import type { PlanStep } from "./PlanStep";
|
|
5
|
+
import type { QuotaCredits } from "./QuotaCredits";
|
|
6
|
+
import type { QuotaWindow } from "./QuotaWindow";
|
|
7
|
+
import type { TaskId } from "./TaskId";
|
|
8
|
+
import type { TaskStatus } from "./TaskStatus";
|
|
9
|
+
import type { ToolCallId } from "./ToolCallId";
|
|
10
|
+
import type { Usage } from "./Usage";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Something the driver's own loop did that is not part of the message it is producing.
|
|
14
|
+
*
|
|
15
|
+
* [`ProviderEvent`] mirrors the Messages SSE shape, and for a model driver that is the whole
|
|
16
|
+
* story: a model emits content blocks and nothing else. An agent driver is *running a loop* — it
|
|
17
|
+
* spawns sub-agents, keeps a plan, compacts its own context, and knows which commands it will
|
|
18
|
+
* accept. None of that is a content block, and the two ways to force it into one are both bad:
|
|
19
|
+
* invent assistant text nobody wrote, or drop it. neosh dropped it, in one line
|
|
20
|
+
* (`sse.rs`: *"non-model event families must be ignored"*), which is why a running sub-agent was
|
|
21
|
+
* invisible and `/compact` looked like a hang.
|
|
22
|
+
*
|
|
23
|
+
* This is a decision about **shape, not access**. Every one of these already arrives on the
|
|
24
|
+
* transport the driver uses — for `claude` they are `{"type":"system",…}` lines on the same stdout
|
|
25
|
+
* the content blocks come down, and `Plan` is read out of an ordinary `TodoWrite` call. Nothing
|
|
26
|
+
* here needs a privileged channel; it needed somewhere to go.
|
|
27
|
+
*/
|
|
28
|
+
export type Activity =
|
|
29
|
+
| {
|
|
30
|
+
"kind": "task_started";
|
|
31
|
+
task: TaskId;
|
|
32
|
+
/**
|
|
33
|
+
* What it was asked to do, in one line.
|
|
34
|
+
*/
|
|
35
|
+
title: string;
|
|
36
|
+
/**
|
|
37
|
+
* Which kind of sub-agent, when the driver distinguishes them.
|
|
38
|
+
*/
|
|
39
|
+
role?: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* The call that spawned it, when a call did. Absent for a task the driver started on its
|
|
42
|
+
* own — a background job, a member of a workflow.
|
|
43
|
+
*/
|
|
44
|
+
parent_call?: ToolCallId | null;
|
|
45
|
+
model?: string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Whether it was let go of at the moment it started, rather than the turn blocking on it.
|
|
48
|
+
*
|
|
49
|
+
* A shell launched detached and a sub-agent spawned into the background both arrive this
|
|
50
|
+
* way. The *later* move to the background arrives as a status change instead, which is
|
|
51
|
+
* the case that was already handled — so without this the two halves of one idea were
|
|
52
|
+
* read in two different places and the commoner half was the one that was missed.
|
|
53
|
+
*/
|
|
54
|
+
backgrounded: boolean;
|
|
55
|
+
}
|
|
56
|
+
| {
|
|
57
|
+
"kind": "task_progress";
|
|
58
|
+
task: TaskId;
|
|
59
|
+
summary?: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* The last tool it called, which is the cheapest possible "it is not stuck".
|
|
62
|
+
*/
|
|
63
|
+
last_tool?: string | null;
|
|
64
|
+
usage: Usage;
|
|
65
|
+
}
|
|
66
|
+
| {
|
|
67
|
+
"kind": "task_ended";
|
|
68
|
+
task: TaskId;
|
|
69
|
+
status: TaskStatus;
|
|
70
|
+
summary?: string | null;
|
|
71
|
+
}
|
|
72
|
+
| { "kind": "background"; tasks: Array<BackgroundTask> }
|
|
73
|
+
| { "kind": "plan"; steps: Array<PlanStep> }
|
|
74
|
+
| { "kind": "waiting"; what: string; retry_in_ms?: number | null }
|
|
75
|
+
| { "kind": "compacting" }
|
|
76
|
+
| { "kind": "compacted"; before?: number | null; after?: number | null }
|
|
77
|
+
| { "kind": "commands"; commands: Array<DriverCommand> }
|
|
78
|
+
| { "kind": "resume"; token: string }
|
|
79
|
+
| { "kind": "context"; used: number; total: number }
|
|
80
|
+
| {
|
|
81
|
+
"kind": "quota";
|
|
82
|
+
plan?: string | null;
|
|
83
|
+
windows: Array<QuotaWindow>;
|
|
84
|
+
credits?: QuotaCredits | null;
|
|
85
|
+
};
|
|
@@ -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 { PermissionDecision } from "./PermissionDecision";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* What a node can be asked to do with an agent it owns.
|
|
6
|
+
*
|
|
7
|
+
* Every one is a *request*. The owner decides — it may be busy, the conversation may have been
|
|
8
|
+
* deleted a moment ago, or the person sitting at it may have said no to remote control entirely.
|
|
9
|
+
* A command that could not be refused would make every node an administrator of every other one.
|
|
10
|
+
*/
|
|
11
|
+
export type AgentCommand =
|
|
12
|
+
| { "command": "send"; text: string }
|
|
13
|
+
| { "command": "interrupt" }
|
|
14
|
+
| { "command": "approve"; decision: PermissionDecision }
|
|
15
|
+
| { "command": "set_model"; instance: string; model: string }
|
|
16
|
+
| { "command": "rename"; title: string | null }
|
|
17
|
+
| { "command": "archive"; archived: boolean }
|
|
18
|
+
| { "command": "new_session"; cwd?: string | null; title?: string | null };
|
|
@@ -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
|
+
* What an agent is doing, coarsely enough to be worth sending on every change.
|
|
5
|
+
*/
|
|
6
|
+
export type AgentState = "idle" | "running" | "blocked" | "failed";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
|
+
import type { AgentState } from "./AgentState";
|
|
3
|
+
import type { ProjectKey } from "./ProjectKey";
|
|
4
|
+
import type { SessionId } from "./SessionId";
|
|
5
|
+
import type { Usage } from "./Usage";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* One agent, as another node sees it.
|
|
9
|
+
*
|
|
10
|
+
* A description, not a handle. Everything here is for showing and for deciding what to ask; acting
|
|
11
|
+
* on it means sending a [`Command`](AscpMessage::Command) to the node that owns it.
|
|
12
|
+
*/
|
|
13
|
+
export type AgentSummary = {
|
|
14
|
+
/**
|
|
15
|
+
* The conversation id, which is unique on its own node and nowhere else. Address an agent as
|
|
16
|
+
* `(node, id)`; two machines restoring from the same backup would otherwise be one collision
|
|
17
|
+
* away from steering each other's work.
|
|
18
|
+
*/
|
|
19
|
+
session: SessionId;
|
|
20
|
+
project: ProjectKey;
|
|
21
|
+
/**
|
|
22
|
+
* What that node calls the project — `neosh`, or `neosh · fix/thing` for a worktree.
|
|
23
|
+
*/
|
|
24
|
+
project_name: string;
|
|
25
|
+
/**
|
|
26
|
+
* The working directory **on the owning node**. Shown, never opened: it is a path in somebody
|
|
27
|
+
* else's filesystem and may not exist here at all.
|
|
28
|
+
*/
|
|
29
|
+
cwd: string;
|
|
30
|
+
/**
|
|
31
|
+
* The title, or the opening of the first message. Computed by the owner so every node agrees.
|
|
32
|
+
*/
|
|
33
|
+
label: string;
|
|
34
|
+
state: AgentState;
|
|
35
|
+
message_count: number;
|
|
36
|
+
/**
|
|
37
|
+
* The model the owner will use for the next turn, for a board that says so.
|
|
38
|
+
*/
|
|
39
|
+
model?: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Seconds since the epoch, when the running turn began. Only meaningful while `Running`.
|
|
42
|
+
*/
|
|
43
|
+
turn_started_at?: number | null;
|
|
44
|
+
updated_at: number;
|
|
45
|
+
usage: Usage;
|
|
46
|
+
};
|
|
@@ -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 { Dock } from "./Dock";
|
|
3
|
+
import type { WindowId } from "./WindowId";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* What a float is positioned relative to.
|
|
7
|
+
*/
|
|
8
|
+
export type Anchor =
|
|
9
|
+
| { "kind": "cursor" }
|
|
10
|
+
| { "kind": "window"; win: WindowId }
|
|
11
|
+
| { "kind": "screen" }
|
|
12
|
+
| { "kind": "dock"; dock: Dock };
|
|
@@ -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 { FrameSet } from "./FrameSet";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Text that moves on its own.
|
|
6
|
+
*
|
|
7
|
+
* Declared on a highlight group rather than driven by whoever wrote the text, for two reasons.
|
|
8
|
+
* A plugin animating text itself would have to re-set an extmark per character per tick — forty
|
|
9
|
+
* API calls at 20 Hz, across a runtime boundary, to move a highlight two columns. And motion is a
|
|
10
|
+
* *display* decision: how bright a band can get depends on what the terminal can render, which is
|
|
11
|
+
* the one thing only the frontend knows.
|
|
12
|
+
*
|
|
13
|
+
* So the core stores this and forwards it; the frontend animates whatever carries it, at whatever
|
|
14
|
+
* rate it likes, and stops when nothing animated is on screen. Nothing wakes the core.
|
|
15
|
+
*/
|
|
16
|
+
export type Animation =
|
|
17
|
+
| {
|
|
18
|
+
"kind": "shimmer";
|
|
19
|
+
/**
|
|
20
|
+
* One full sweep, in milliseconds.
|
|
21
|
+
*/
|
|
22
|
+
period_ms: number;
|
|
23
|
+
}
|
|
24
|
+
| { "kind": "pulse"; period_ms: number }
|
|
25
|
+
| {
|
|
26
|
+
"kind": "frames";
|
|
27
|
+
set: FrameSet;
|
|
28
|
+
/**
|
|
29
|
+
* One full cycle through the set, in milliseconds.
|
|
30
|
+
*/
|
|
31
|
+
period_ms: number;
|
|
32
|
+
}
|
|
33
|
+
| {
|
|
34
|
+
"kind": "flash";
|
|
35
|
+
/**
|
|
36
|
+
* How long the lift takes to fall back to nothing.
|
|
37
|
+
*/
|
|
38
|
+
ms: number;
|
|
39
|
+
}
|
|
40
|
+
| { "kind": "spectrum"; period_ms: number };
|