@opencode-ai/plugin 0.0.0-next-15536 → 0.0.0-next-15541
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/dist/v2/tui/context.d.ts +75 -12
- package/package.json +8 -4
package/dist/v2/tui/context.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentInfo, CommandInfo, FormInfo, IntegrationInfo, LocationRef, McpResource, McpServer, ModelInfo, OpenCodeClient, OpenCodeEvent, PermissionSavedInfo, PermissionV2Request, ProviderV2Info, ReferenceInfo, SessionInfo, SessionMessageInfo, SessionPendingInfo, ShellInfo, SkillInfo } from "@opencode-ai/client";
|
|
2
|
+
import type { Renderable } from "@opentui/core";
|
|
2
3
|
import type { JSX } from "@opentui/solid";
|
|
3
4
|
interface LocationCollection<Value> {
|
|
4
5
|
list(location?: LocationRef): Value[] | undefined;
|
|
@@ -66,30 +67,92 @@ export interface Data {
|
|
|
66
67
|
readonly skill: LocationCollection<SkillInfo>;
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
|
-
export
|
|
70
|
+
export type Route = {
|
|
71
|
+
readonly type: "home";
|
|
72
|
+
} | {
|
|
73
|
+
readonly type: "session";
|
|
74
|
+
readonly sessionID: string;
|
|
75
|
+
} | {
|
|
76
|
+
readonly type: "plugin";
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly name: string;
|
|
79
|
+
readonly data?: Record<string, any>;
|
|
80
|
+
};
|
|
81
|
+
export type Destination = Route | Omit<Extract<Route, {
|
|
82
|
+
readonly type: "plugin";
|
|
83
|
+
}>, "id">;
|
|
84
|
+
export interface Page {
|
|
70
85
|
readonly name: string;
|
|
71
86
|
readonly render: (input: {
|
|
72
|
-
readonly
|
|
87
|
+
readonly data?: Record<string, any>;
|
|
73
88
|
}) => JSX.Element;
|
|
74
89
|
}
|
|
75
|
-
export
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
90
|
+
export type Slot = (props: Record<string, any>) => JSX.Element;
|
|
91
|
+
export interface KeymapCommand {
|
|
92
|
+
/** Stable command and config keybind identifier. Omit for an inline command. */
|
|
93
|
+
readonly id?: string;
|
|
94
|
+
/** Optional label used by command discovery and keyboard-help UI. */
|
|
95
|
+
readonly title?: string;
|
|
96
|
+
/** Optional longer description. */
|
|
97
|
+
readonly description?: string;
|
|
98
|
+
/** Groups the command in discovery and keyboard-help UI. */
|
|
99
|
+
readonly group?: string;
|
|
100
|
+
/** Enables or disables the command. */
|
|
101
|
+
readonly enabled?: boolean | (() => boolean);
|
|
102
|
+
/** Configures automatic binding, or disables it for a named command. */
|
|
103
|
+
readonly bind?: false | string;
|
|
104
|
+
/** Adds a named command to the command palette. */
|
|
105
|
+
readonly palette?: true;
|
|
106
|
+
/** Adds a named command to prompt slash completion. */
|
|
107
|
+
readonly slash?: {
|
|
82
108
|
readonly name: string;
|
|
83
|
-
readonly
|
|
109
|
+
readonly aliases?: string[];
|
|
110
|
+
};
|
|
111
|
+
/** Executes the command. Return false to let keymap dispatch continue. */
|
|
112
|
+
readonly run: () => void | false | Promise<void>;
|
|
113
|
+
}
|
|
114
|
+
export interface KeymapLayer {
|
|
115
|
+
/** Limits the layer to one OpenCode input mode. Use global to opt out; defaults to base. */
|
|
116
|
+
readonly mode?: string;
|
|
117
|
+
/** Enables or disables the complete layer. */
|
|
118
|
+
readonly enabled?: boolean | (() => boolean);
|
|
119
|
+
/** Limits the layer to a focused renderable. */
|
|
120
|
+
readonly target?: () => Renderable | null | undefined;
|
|
121
|
+
/** Resolves conflicts with other active layers. */
|
|
122
|
+
readonly priority?: number;
|
|
123
|
+
/** Commands owned by this layer. */
|
|
124
|
+
readonly commands?: readonly KeymapCommand[];
|
|
125
|
+
/** IDs of commands whose configured bindings should be active in this layer. */
|
|
126
|
+
readonly bindings?: readonly string[];
|
|
127
|
+
}
|
|
128
|
+
export interface Keymap {
|
|
129
|
+
/** Creates a reactive keymap layer owned by the calling component. */
|
|
130
|
+
layer(input: () => KeymapLayer): void;
|
|
131
|
+
/** Dispatches a reachable command by ID. */
|
|
132
|
+
dispatch(id: string): void;
|
|
133
|
+
/** Returns the formatted shortcut for a registered command. */
|
|
134
|
+
shortcut(id: string): string | undefined;
|
|
135
|
+
/** Controls mutually exclusive OpenCode input modes. */
|
|
136
|
+
readonly mode: {
|
|
137
|
+
/** Returns the active mode. */
|
|
138
|
+
current(): string;
|
|
139
|
+
/** Pushes a mode until the returned cleanup is called. */
|
|
140
|
+
push(mode: string): () => void;
|
|
84
141
|
};
|
|
85
142
|
}
|
|
86
143
|
export interface UI {
|
|
87
|
-
readonly
|
|
144
|
+
readonly router: {
|
|
145
|
+
register(page: Page): () => void;
|
|
146
|
+
navigate(destination: Destination): void;
|
|
147
|
+
current(): Route;
|
|
148
|
+
};
|
|
149
|
+
readonly slot: (name: string, render: Slot) => () => void;
|
|
88
150
|
}
|
|
89
151
|
export interface Context {
|
|
90
|
-
readonly options: Readonly<Record<string,
|
|
152
|
+
readonly options: Readonly<Record<string, any>>;
|
|
91
153
|
readonly client: OpenCodeClient;
|
|
92
154
|
readonly data: Data;
|
|
155
|
+
readonly keymap: Keymap;
|
|
93
156
|
readonly ui: UI;
|
|
94
157
|
}
|
|
95
158
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/plugin",
|
|
4
|
-
"version": "0.0.0-next-
|
|
4
|
+
"version": "0.0.0-next-15541",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -34,6 +34,10 @@
|
|
|
34
34
|
"import": "./dist/v2/tui/index.js",
|
|
35
35
|
"types": "./dist/v2/tui/index.d.ts"
|
|
36
36
|
},
|
|
37
|
+
"./v2/tui/*": {
|
|
38
|
+
"import": "./dist/v2/tui/*.js",
|
|
39
|
+
"types": "./dist/v2/tui/*.d.ts"
|
|
40
|
+
},
|
|
37
41
|
"./v2": {
|
|
38
42
|
"import": "./dist/v2/promise/index.js",
|
|
39
43
|
"types": "./dist/v2/promise/index.d.ts"
|
|
@@ -48,9 +52,9 @@
|
|
|
48
52
|
],
|
|
49
53
|
"dependencies": {
|
|
50
54
|
"@ai-sdk/provider": "3.0.8",
|
|
51
|
-
"@opencode-ai/client": "0.0.0-next-
|
|
52
|
-
"@opencode-ai/schema": "0.0.0-next-
|
|
53
|
-
"@opencode-ai/sdk": "0.0.0-next-
|
|
55
|
+
"@opencode-ai/client": "0.0.0-next-15541",
|
|
56
|
+
"@opencode-ai/schema": "0.0.0-next-15541",
|
|
57
|
+
"@opencode-ai/sdk": "0.0.0-next-15541",
|
|
54
58
|
"effect": "4.0.0-beta.83",
|
|
55
59
|
"zod": "4.1.8"
|
|
56
60
|
},
|