wings-plugin-sdk 0.10.0 → 0.11.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 +15 -5
package/package.json
CHANGED
package/wings.d.ts
CHANGED
|
@@ -41,6 +41,14 @@ interface WingsBadge {
|
|
|
41
41
|
actions?: { id: string; label: string; primary?: boolean }[];
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/** Where the diff viewer scrolls to and highlights once the patch is shown. A path or line the patch doesn't have just opens the diff. */
|
|
45
|
+
interface WingsDiffFocus {
|
|
46
|
+
path: string;
|
|
47
|
+
line?: number;
|
|
48
|
+
/** `new` (the default) counts lines after the change, `old` before it. */
|
|
49
|
+
side?: "old" | "new";
|
|
50
|
+
}
|
|
51
|
+
|
|
44
52
|
interface WingsComment {
|
|
45
53
|
id: number;
|
|
46
54
|
replyTo: number | null;
|
|
@@ -145,7 +153,7 @@ interface Wings {
|
|
|
145
153
|
* is sent back as a failed call. `paneId` is the Wings pane Claude runs in, or `null`. Register it in `main`.
|
|
146
154
|
*/
|
|
147
155
|
onTool(name: string, handler: (input: Record<string, unknown>, context: { paneId: string | null }) => unknown): void;
|
|
148
|
-
/** Runs a command from `permissions.exec`, like `git branch --show-current`. */
|
|
156
|
+
/** Runs a command from `permissions.exec`, like `git branch --show-current`. Rejects with `Output is larger than 8 MB` (and kills the program) when stdout or stderr passes 8 MB. */
|
|
149
157
|
exec(program: string, args?: string[], options?: WingsExecOptions): Promise<{ code: number | null; stdout: string; stderr: string }>;
|
|
150
158
|
/**
|
|
151
159
|
* Needs `permissions.statusline`. What Claude Code last told its status line, once `wings statusline` is your
|
|
@@ -187,9 +195,9 @@ interface Wings {
|
|
|
187
195
|
/** Needs `permissions.notify`. A desktop notification, up to 3 a minute. The title is cut at 64 characters, the body at 256. */
|
|
188
196
|
notify(notification: { title: string; body?: string }): Promise<void>;
|
|
189
197
|
/** Needs `"diff"` in `contributes.ui`. Leave out `patch` to open it loading, then call `updateDiff`. */
|
|
190
|
-
openDiff(diff: { title: string; subtitle?: string; /** The repo or folder the diff is of, so Send to agent offers the agent working there first. */ cwd?: string; patch?: string; comments?: WingsComment[] }): Promise<{ id: string }>;
|
|
198
|
+
openDiff(diff: { title: string; subtitle?: string; /** The repo or folder the diff is of, so Send to agent offers the agent working there first. */ cwd?: string; patch?: string; comments?: WingsComment[]; focus?: WingsDiffFocus }): Promise<{ id: string }>;
|
|
191
199
|
/** Updates a viewer opened with `openDiff`; ignored once it's closed. `{ comments }` alone keeps the patch, like after a reply. */
|
|
192
|
-
updateDiff(id: string, update: { patch: string; comments?: WingsComment[] } | { comments: WingsComment[] } | { error: string }): Promise<void>;
|
|
200
|
+
updateDiff(id: string, update: { patch: string; comments?: WingsComment[]; focus?: WingsDiffFocus } | { comments: WingsComment[]; focus?: WingsDiffFocus } | { error: string }): Promise<void>;
|
|
193
201
|
/**
|
|
194
202
|
* Needs `"diff"` in `contributes.ui`. A reply typed under a comment with `canReply` in the diff viewer. Post it,
|
|
195
203
|
* then add it with `updateDiff`. The reply box waits for the returned promise, and a thrown error shows under it
|
|
@@ -198,7 +206,8 @@ interface Wings {
|
|
|
198
206
|
onReply(handler: (reply: WingsReply) => unknown): void;
|
|
199
207
|
/**
|
|
200
208
|
* POSTs `fields` (string or whole-number values, up to 64 KB) as JSON to a `permissions.post` path, as you:
|
|
201
|
-
* `gh api
|
|
209
|
+
* `gh api` (against `host` for a GitHub Enterprise Server), `glab api` against `host`, or `az rest` for Azure
|
|
210
|
+
* DevOps. Wings builds the command itself. A manifest entry may pin a field, like `{event=APPROVE}`.
|
|
202
211
|
*/
|
|
203
212
|
post(
|
|
204
213
|
program: "gh" | "glab" | "az",
|
|
@@ -207,7 +216,8 @@ interface Wings {
|
|
|
207
216
|
options?: { host?: string },
|
|
208
217
|
): Promise<{ code: number | null; stdout: string; stderr: string }>;
|
|
209
218
|
/**
|
|
210
|
-
* An HTTP request to a URL under `permissions.fetch`, made by Wings.
|
|
219
|
+
* An HTTP request to a URL under `permissions.fetch`, made by Wings. An entry may be `GET <prefix>`, or
|
|
220
|
+
* `POST <url with * segments>` (optionally `{field=value}`) for one write with a JSON `body`. `bearer` names a secret that Wings sends
|
|
211
221
|
* as `Authorization: Bearer <secret>`. Resolves for any status; redirects aren't followed.
|
|
212
222
|
*/
|
|
213
223
|
fetch(
|