@opencode-ai/plugin 0.0.0-next-15537 → 0.0.0-next-15542
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 +54 -0
- package/package.json +4 -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;
|
|
@@ -87,6 +88,58 @@ export interface Page {
|
|
|
87
88
|
}) => JSX.Element;
|
|
88
89
|
}
|
|
89
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?: {
|
|
108
|
+
readonly name: string;
|
|
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;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
90
143
|
export interface UI {
|
|
91
144
|
readonly router: {
|
|
92
145
|
register(page: Page): () => void;
|
|
@@ -99,6 +152,7 @@ export interface Context {
|
|
|
99
152
|
readonly options: Readonly<Record<string, any>>;
|
|
100
153
|
readonly client: OpenCodeClient;
|
|
101
154
|
readonly data: Data;
|
|
155
|
+
readonly keymap: Keymap;
|
|
102
156
|
readonly ui: UI;
|
|
103
157
|
}
|
|
104
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-15542",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@ai-sdk/provider": "3.0.8",
|
|
55
|
-
"@opencode-ai/client": "0.0.0-next-
|
|
56
|
-
"@opencode-ai/schema": "0.0.0-next-
|
|
57
|
-
"@opencode-ai/sdk": "0.0.0-next-
|
|
55
|
+
"@opencode-ai/client": "0.0.0-next-15542",
|
|
56
|
+
"@opencode-ai/schema": "0.0.0-next-15542",
|
|
57
|
+
"@opencode-ai/sdk": "0.0.0-next-15542",
|
|
58
58
|
"effect": "4.0.0-beta.83",
|
|
59
59
|
"zod": "4.1.8"
|
|
60
60
|
},
|