wings-plugin-sdk 0.7.0 → 0.9.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 +1 -1
- package/wings.d.ts +64 -1
package/package.json
CHANGED
package/wings.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ interface WingsPane {
|
|
|
11
11
|
/** What runs in the pane right now, like `zsh` or `claude`. */
|
|
12
12
|
command: string;
|
|
13
13
|
project: string;
|
|
14
|
+
/** The id of that project, the same as `project().id`. Needs Wings 0.1.22. */
|
|
15
|
+
projectId: string;
|
|
14
16
|
/** Set while Claude Code runs in the pane. `startedAt` is when that `claude` started, in ms; a resumed session's transcript also has what came before. */
|
|
15
17
|
session: { sessionId: string; name: string | null; state: string; startedAt: number } | null;
|
|
16
18
|
/** The focused pane of the tab on screen. At most one pane has it, and none while no tab is open. */
|
|
@@ -98,6 +100,28 @@ interface WingsExecOptions {
|
|
|
98
100
|
onOutput?: (line: string) => void;
|
|
99
101
|
}
|
|
100
102
|
|
|
103
|
+
/** A project (space) as pages see it. */
|
|
104
|
+
interface WingsProject {
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
path: string;
|
|
108
|
+
branch: string | null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** A line in a plugin's section under a project in the sidebar. Needs Wings 0.1.23. */
|
|
112
|
+
interface WingsProjectSectionRow {
|
|
113
|
+
/** Up to 64 characters, unique in the section. */
|
|
114
|
+
id: string;
|
|
115
|
+
/** Up to 120 characters. */
|
|
116
|
+
label: string;
|
|
117
|
+
/** Muted text under the label, up to 120 characters. */
|
|
118
|
+
detail?: string;
|
|
119
|
+
/** A small pill after the label. `text` is up to 24 characters. */
|
|
120
|
+
badge?: { text: string; tone?: Tone };
|
|
121
|
+
/** Clicking the row opens `view`, one of the plugin's `contributes.views` that lists `tab` in `opens`, as a tab in the row's project, with `args` (JSON, up to 16 KB) as `viewArgs()`. */
|
|
122
|
+
open: { view: string; args?: unknown };
|
|
123
|
+
}
|
|
124
|
+
|
|
101
125
|
interface Wings {
|
|
102
126
|
// Every `on*` call returns a function that removes the listener, for cleaning up in a React effect.
|
|
103
127
|
/** Every terminal pane, on every change. */
|
|
@@ -215,8 +239,47 @@ interface Wings {
|
|
|
215
239
|
* in a window of its own or as a tab in the project on screen (`tab` needs Wings 0.1.15). `as` must be in the
|
|
216
240
|
* view's `opens`, and defaults to the first. A window or tab that's already open comes to the front. The page
|
|
217
241
|
* gets the same `wings` object wherever it opens.
|
|
242
|
+
*
|
|
243
|
+
* `args` (JSON, up to 16 KB, only with `as: "tab"`) is what the tab's page reads with `viewArgs`. A tab that's
|
|
244
|
+
* already open with other args takes the new ones, drops its saved tab state and reloads; a view with `"multiple": true` opens a new tab,
|
|
245
|
+
* unless a tab of it in that project already has the same `args`: that one is shown. Needs Wings 0.1.22.
|
|
246
|
+
*/
|
|
247
|
+
openView(id: string, options?: { as?: "sidebar" | "modal" | "window" | "tab"; args?: unknown }): Promise<void>;
|
|
248
|
+
/** Where this page shows. `null` in the plugin's main script. Needs Wings 0.1.22. */
|
|
249
|
+
placement(): "sidebar" | "tab" | "modal" | "window" | null;
|
|
250
|
+
/** What `openView` passed as `args` when it opened this tab, or `null`. Available at once. Needs Wings 0.1.22. */
|
|
251
|
+
viewArgs<T = unknown>(): T | null;
|
|
252
|
+
/**
|
|
253
|
+
* The project this page is about, or `null` when none is open. A tab page's project is the one the tab belongs to
|
|
254
|
+
* and never changes; any other page gets the project on screen. Needs Wings 0.1.22.
|
|
255
|
+
*/
|
|
256
|
+
project(): Promise<WingsProject | null>;
|
|
257
|
+
/**
|
|
258
|
+
* Calls the listener with the current project, then each time it changes: the project on screen switched (not for a
|
|
259
|
+
* tab page), or its branch or name changed. Needs Wings 0.1.22.
|
|
260
|
+
*/
|
|
261
|
+
onProject(listener: (project: WingsProject | null) => void): () => void;
|
|
262
|
+
/** Every project in Wings, in sidebar order. Worktrees are projects too. Needs Wings 0.1.23. */
|
|
263
|
+
projects(): Promise<WingsProject[]>;
|
|
264
|
+
/**
|
|
265
|
+
* Calls the listener with every project, then each time one is added, removed or renamed, or a branch changes.
|
|
266
|
+
* Works in the main script and in pages. Needs Wings 0.1.23.
|
|
267
|
+
*/
|
|
268
|
+
onProjects(listener: (projects: WingsProject[]) => void): () => void;
|
|
269
|
+
/**
|
|
270
|
+
* Shows `rows` under a project in the sidebar, in the section `sectionId` that the manifest declares in
|
|
271
|
+
* `contributes.projectSections`, or removes the section with `null`. Up to 50 rows. Rejects for a project that isn't
|
|
272
|
+
* there, a section the plugin didn't declare, or a row whose `open.view` isn't one of its views that opens as a tab.
|
|
273
|
+
* Sections are kept in memory and go when the plugin is turned off, so fill them again on start. Needs Wings 0.1.23.
|
|
274
|
+
*/
|
|
275
|
+
setProjectSection(projectId: string, sectionId: string, rows: WingsProjectSectionRow[] | null): Promise<void>;
|
|
276
|
+
/** In a tab page: the state it last saved with `setTabState`, or `null`. Outside a tab it is `null`. Opening the tab with new `args` clears it. Needs Wings 0.1.22. */
|
|
277
|
+
tabState<T = unknown>(): Promise<T | null>;
|
|
278
|
+
/**
|
|
279
|
+
* In a tab page: saves JSON state, up to 64 KB, on the tab. Wings keeps it across restarts and while the page is
|
|
280
|
+
* unloaded. Rejects outside a tab or when the state is too big. Needs Wings 0.1.22.
|
|
218
281
|
*/
|
|
219
|
-
|
|
282
|
+
setTabState(state: unknown): Promise<void>;
|
|
220
283
|
/** Closes a sidebar or view wherever it's open. */
|
|
221
284
|
closeView(id: string): Promise<void>;
|
|
222
285
|
/** Opens Wings Settings at the plugin's settings page, `contributes.settings`. Wings 0.1.15 and newer. */
|