@pstdio/sdk 0.11.0 → 0.12.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/dist/api/index.d.ts +0 -1
- package/dist/client/agents.d.ts +2 -7
- package/dist/client/index.js +1 -6
- package/dist/extensions/command-outcome.d.ts +1 -1
- package/dist/extensions/define-command.d.ts +1 -3
- package/dist/extensions/define-extension-view.d.ts +2 -2
- package/dist/extensions/define-extension.d.ts +1 -4
- package/dist/extensions/index.d.ts +3 -8
- package/dist/extensions/index.js +131 -130
- package/dist/extensions/params.d.ts +1 -1
- package/dist/extensions/refs.d.ts +2 -14
- package/dist/extensions/when.d.ts +1 -1
- package/dist/resources/agent.d.ts +1 -1
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +3 -1
- package/dist/resources/known-agents.d.ts +2 -0
- package/package.json +2 -2
- package/dist/api/agents.d.ts +0 -1
- package/dist/extensions/kernel-slots.d.ts +0 -112
- package/dist/extensions/l10n.d.ts +0 -10
- package/dist/extensions/package-asset.d.ts +0 -10
- package/dist/extensions/slots.d.ts +0 -6
- package/dist/extensions/types/commands.d.ts +0 -125
- package/dist/extensions/types/context.d.ts +0 -258
- package/dist/extensions/types/contributions.d.ts +0 -374
- package/dist/extensions/types/events.d.ts +0 -10
- package/dist/extensions/types/extension.d.ts +0 -183
- package/dist/extensions/types/index.d.ts +0 -11
- package/dist/extensions/types/json.d.ts +0 -7
- package/dist/extensions/types/params.d.ts +0 -83
- package/dist/extensions/types/resources.d.ts +0 -25
- package/dist/extensions/types/slots.d.ts +0 -22
- package/dist/extensions/types/tree-renderer.d.ts +0 -89
- package/dist/extensions/types/webview-capabilities.d.ts +0 -93
- package/dist/extensions/workbench-targets.d.ts +0 -124
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
import type { Localizable } from "../l10n";
|
|
2
|
-
import type { WorkbenchMenuTarget, WorkbenchModeLayoutTarget, WorkbenchSettingsScope, WorkbenchSettingsTarget, WorkbenchTreeTarget, WorkbenchViewTarget } from "../workbench-targets";
|
|
3
|
-
import type { CommandRef, CommandSource } from "./commands";
|
|
4
|
-
import type { EventRef } from "./events";
|
|
5
|
-
import type { JsonObject, JsonValue, Struct } from "./json";
|
|
6
|
-
import type { ParamObjectSchema } from "./params";
|
|
7
|
-
import type { PackageAssetDescriptor, ResourceRef } from "./resources";
|
|
8
|
-
import type { SlotRef } from "./slots";
|
|
9
|
-
import type { WebviewCapabilityDeclaration } from "./webview-capabilities";
|
|
10
|
-
export interface CliContribution {
|
|
11
|
-
path?: string[];
|
|
12
|
-
globalAliases?: string[][];
|
|
13
|
-
description?: Localizable<string>;
|
|
14
|
-
examples?: string[];
|
|
15
|
-
hidden?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface WhenExpression {
|
|
18
|
-
mode?: string | string[];
|
|
19
|
-
source?: CommandSource[];
|
|
20
|
-
resourceType?: string[];
|
|
21
|
-
metadata?: JsonObject;
|
|
22
|
-
}
|
|
23
|
-
export interface MenuContribution<TSlotContext extends Struct = Struct, TParams extends Struct = Struct> {
|
|
24
|
-
target?: WorkbenchMenuTarget;
|
|
25
|
-
slot?: SlotRef<TSlotContext, "menu"> | string;
|
|
26
|
-
label?: Localizable<string>;
|
|
27
|
-
group?: string;
|
|
28
|
-
placement?: "first" | "default" | "last";
|
|
29
|
-
icon?: string;
|
|
30
|
-
when?: WhenExpression;
|
|
31
|
-
command?: CommandRef<TParams, unknown> | string;
|
|
32
|
-
params?: Partial<TParams>;
|
|
33
|
-
presentation?: "menu-item" | "button" | "icon-button";
|
|
34
|
-
}
|
|
35
|
-
export interface CommandPaletteContribution<TParams extends Struct = Struct> {
|
|
36
|
-
label?: Localizable<string>;
|
|
37
|
-
group?: string;
|
|
38
|
-
placement?: "first" | "default" | "last";
|
|
39
|
-
icon?: string;
|
|
40
|
-
when?: WhenExpression;
|
|
41
|
-
params?: Partial<TParams>;
|
|
42
|
-
}
|
|
43
|
-
export interface TreeItemContribution<TParams extends Struct = Struct> {
|
|
44
|
-
target: WorkbenchTreeTarget;
|
|
45
|
-
label: Localizable<string>;
|
|
46
|
-
group?: string;
|
|
47
|
-
placement?: "first" | "default" | "last";
|
|
48
|
-
icon?: string;
|
|
49
|
-
when?: WhenExpression;
|
|
50
|
-
action: {
|
|
51
|
-
kind: "command";
|
|
52
|
-
command: CommandRef<TParams, unknown> | string;
|
|
53
|
-
params?: Partial<TParams>;
|
|
54
|
-
} | {
|
|
55
|
-
kind: "dataRenderer";
|
|
56
|
-
dataRenderer: string;
|
|
57
|
-
} | {
|
|
58
|
-
kind: "route";
|
|
59
|
-
route: string;
|
|
60
|
-
} | {
|
|
61
|
-
kind: "href";
|
|
62
|
-
href: string;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
export type WorkbenchLayoutTarget = WorkbenchModeLayoutTarget;
|
|
66
|
-
export type ModeTargetContribution = {
|
|
67
|
-
target: WorkbenchLayoutTarget;
|
|
68
|
-
view: string;
|
|
69
|
-
title?: Localizable<string>;
|
|
70
|
-
resource?: string;
|
|
71
|
-
pinned?: boolean;
|
|
72
|
-
} | {
|
|
73
|
-
target: WorkbenchLayoutTarget;
|
|
74
|
-
resource: string;
|
|
75
|
-
widget?: string;
|
|
76
|
-
title?: Localizable<string>;
|
|
77
|
-
pinned?: boolean;
|
|
78
|
-
};
|
|
79
|
-
export interface ModeLayoutContribution {
|
|
80
|
-
reset?: boolean | WorkbenchLayoutTarget[];
|
|
81
|
-
open?: ModeTargetContribution[];
|
|
82
|
-
}
|
|
83
|
-
export interface ModeContribution {
|
|
84
|
-
id?: string;
|
|
85
|
-
label: Localizable<string>;
|
|
86
|
-
icon?: string;
|
|
87
|
-
layout?: ModeLayoutContribution;
|
|
88
|
-
}
|
|
89
|
-
export interface WebviewContribution {
|
|
90
|
-
entry: PackageAssetDescriptor;
|
|
91
|
-
title?: Localizable<string>;
|
|
92
|
-
capabilities?: WebviewCapabilityDeclaration[];
|
|
93
|
-
}
|
|
94
|
-
export interface ViewContributionBase<TSlotContext extends Struct = Struct> {
|
|
95
|
-
title: Localizable<string>;
|
|
96
|
-
target?: WorkbenchViewTarget;
|
|
97
|
-
slot?: SlotRef<TSlotContext, "view"> | string;
|
|
98
|
-
group?: string;
|
|
99
|
-
placement?: "first" | "default" | "last";
|
|
100
|
-
/**
|
|
101
|
-
* Marks this view as the editor for resources of the given kind. The host opens
|
|
102
|
-
* the view's webview as a widget (bound to the resource) whenever a resource of
|
|
103
|
-
* this kind is opened — e.g. a `ticket` data-renderer row opening the editor.
|
|
104
|
-
*/
|
|
105
|
-
resourceKind?: string;
|
|
106
|
-
/**
|
|
107
|
-
* Where the host mounts the view. `panel` (default) docks it in a workbench area;
|
|
108
|
-
* `modal` mounts it as an overlay dialog — used by data-renderer create flows where
|
|
109
|
-
* a row's create button opens the matching `resourceKind` modal instead of the
|
|
110
|
-
* inline create command.
|
|
111
|
-
*/
|
|
112
|
-
surface?: "panel" | "modal";
|
|
113
|
-
}
|
|
114
|
-
export type ViewContribution<TSlotContext extends Struct = Struct> = ViewContributionBase<TSlotContext> & ({
|
|
115
|
-
webview: WebviewContribution;
|
|
116
|
-
treeRenderer?: never;
|
|
117
|
-
} | {
|
|
118
|
-
treeRenderer: string;
|
|
119
|
-
webview?: never;
|
|
120
|
-
});
|
|
121
|
-
export interface RouteContribution {
|
|
122
|
-
path: string;
|
|
123
|
-
label: Localizable<string>;
|
|
124
|
-
webview: WebviewContribution;
|
|
125
|
-
}
|
|
126
|
-
export interface SettingsPanelContribution<TSlotContext extends Struct = Struct> {
|
|
127
|
-
title: Localizable<string>;
|
|
128
|
-
target?: WorkbenchSettingsTarget;
|
|
129
|
-
scope?: WorkbenchSettingsScope;
|
|
130
|
-
slot?: SlotRef<TSlotContext, "settings"> | string;
|
|
131
|
-
webview: WebviewContribution;
|
|
132
|
-
}
|
|
133
|
-
export type DataRendererViewMode = "board" | "list";
|
|
134
|
-
export type DataRendererSortDirection = "asc" | "desc";
|
|
135
|
-
export interface DataRendererEnumOption {
|
|
136
|
-
value: string;
|
|
137
|
-
label: Localizable<string>;
|
|
138
|
-
color?: string;
|
|
139
|
-
icon?: string | null;
|
|
140
|
-
}
|
|
141
|
-
export type DataRendererAttributeType = {
|
|
142
|
-
kind: "enum";
|
|
143
|
-
options: DataRendererEnumOption[];
|
|
144
|
-
} | {
|
|
145
|
-
kind: "enum-multi";
|
|
146
|
-
options: DataRendererEnumOption[];
|
|
147
|
-
} | {
|
|
148
|
-
kind: "string";
|
|
149
|
-
} | {
|
|
150
|
-
kind: "date";
|
|
151
|
-
} | {
|
|
152
|
-
kind: "number";
|
|
153
|
-
} | {
|
|
154
|
-
kind: "user";
|
|
155
|
-
};
|
|
156
|
-
export interface DataRendererAttributeDescriptor {
|
|
157
|
-
id: string;
|
|
158
|
-
label: Localizable<string>;
|
|
159
|
-
type: DataRendererAttributeType;
|
|
160
|
-
filterable?: boolean;
|
|
161
|
-
groupable?: boolean;
|
|
162
|
-
sortable?: boolean;
|
|
163
|
-
displayable?: boolean;
|
|
164
|
-
editable?: boolean;
|
|
165
|
-
}
|
|
166
|
-
export interface DataRendererSettings {
|
|
167
|
-
viewMode: DataRendererViewMode;
|
|
168
|
-
columnGrouping: string;
|
|
169
|
-
rowGrouping: string;
|
|
170
|
-
ordering: {
|
|
171
|
-
attributeId: string;
|
|
172
|
-
direction: DataRendererSortDirection;
|
|
173
|
-
};
|
|
174
|
-
displayProperties: string[];
|
|
175
|
-
}
|
|
176
|
-
export type DataRendererFilterState = Record<string, string[]>;
|
|
177
|
-
export interface DataRendererQueryParams {
|
|
178
|
-
settings: DataRendererSettings;
|
|
179
|
-
filters: DataRendererFilterState;
|
|
180
|
-
}
|
|
181
|
-
export interface DataRendererResourceRef {
|
|
182
|
-
type: string;
|
|
183
|
-
id: string;
|
|
184
|
-
projectId?: string;
|
|
185
|
-
label?: string;
|
|
186
|
-
extensionId?: string;
|
|
187
|
-
metadata?: JsonObject;
|
|
188
|
-
}
|
|
189
|
-
export interface DataRendererRow {
|
|
190
|
-
id: string;
|
|
191
|
-
title: string;
|
|
192
|
-
resource?: DataRendererResourceRef;
|
|
193
|
-
attributes: Record<string, unknown>;
|
|
194
|
-
}
|
|
195
|
-
export interface DataRendererColumnAction {
|
|
196
|
-
id: string;
|
|
197
|
-
label: Localizable<string>;
|
|
198
|
-
icon?: string;
|
|
199
|
-
}
|
|
200
|
-
export interface DataRendererBoardColumnConfig {
|
|
201
|
-
color?: string;
|
|
202
|
-
canDragIn?: boolean;
|
|
203
|
-
canDragOut?: boolean;
|
|
204
|
-
canCreate?: boolean;
|
|
205
|
-
actions?: DataRendererColumnAction[];
|
|
206
|
-
}
|
|
207
|
-
export interface DataRendererQueryResult {
|
|
208
|
-
rows: DataRendererRow[];
|
|
209
|
-
attributes?: DataRendererAttributeDescriptor[];
|
|
210
|
-
boardColumnConfigs?: Record<string, DataRendererBoardColumnConfig>;
|
|
211
|
-
}
|
|
212
|
-
export interface DataRendererCreateRowContribution<TParams extends ParamObjectSchema = ParamObjectSchema> {
|
|
213
|
-
command: CommandRef<Struct, unknown> | string;
|
|
214
|
-
title?: Localizable<string>;
|
|
215
|
-
submitLabel?: Localizable<string>;
|
|
216
|
-
columnParam?: string;
|
|
217
|
-
params?: TParams;
|
|
218
|
-
}
|
|
219
|
-
export interface DataRendererSavedViewsContribution {
|
|
220
|
-
resourceKind: string;
|
|
221
|
-
scope?: "project" | "user";
|
|
222
|
-
}
|
|
223
|
-
export interface DataRendererRowAction<TParams extends Struct = Struct> {
|
|
224
|
-
id: string;
|
|
225
|
-
label: Localizable<string>;
|
|
226
|
-
icon?: string;
|
|
227
|
-
/** Invoked with `{ rowId }` when the row's context-menu action is chosen. */
|
|
228
|
-
command: CommandRef<TParams, unknown> | string;
|
|
229
|
-
destructive?: boolean;
|
|
230
|
-
}
|
|
231
|
-
export interface DataRendererContribution {
|
|
232
|
-
title: Localizable<string>;
|
|
233
|
-
resourceKind?: string;
|
|
234
|
-
attributes?: DataRendererAttributeDescriptor[];
|
|
235
|
-
queryCommand: CommandRef<DataRendererQueryParams, DataRendererQueryResult> | string;
|
|
236
|
-
updateAttributeCommand?: CommandRef<{
|
|
237
|
-
rowId: string;
|
|
238
|
-
attributeId: string;
|
|
239
|
-
value: unknown;
|
|
240
|
-
}, unknown> | string;
|
|
241
|
-
reorderCommand?: CommandRef<{
|
|
242
|
-
rowId: string;
|
|
243
|
-
beforeRowId?: string;
|
|
244
|
-
}, unknown> | string;
|
|
245
|
-
columnActionCommand?: CommandRef<{
|
|
246
|
-
columnId: string;
|
|
247
|
-
actionId: string;
|
|
248
|
-
}, unknown> | string;
|
|
249
|
-
createRow?: DataRendererCreateRowContribution;
|
|
250
|
-
rowActions?: DataRendererRowAction[];
|
|
251
|
-
defaultSettings?: Partial<DataRendererSettings>;
|
|
252
|
-
defaultFilters?: DataRendererFilterState;
|
|
253
|
-
emptyTitle?: Localizable<string>;
|
|
254
|
-
emptyDescription?: Localizable<string>;
|
|
255
|
-
hideToolbar?: boolean;
|
|
256
|
-
savedViews?: DataRendererSavedViewsContribution;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Command palette resource providers contribute dynamic, searchable palette results
|
|
260
|
-
* (e.g. slides in a presentation) backed by an extension `queryCommand`, instead of
|
|
261
|
-
* static command entries generated at module load. The host queries matching providers
|
|
262
|
-
* as the user types and refreshes results when a declared `refreshEvent` fires.
|
|
263
|
-
*/
|
|
264
|
-
export interface CommandPaletteResourceQueryParams {
|
|
265
|
-
projectId?: string;
|
|
266
|
-
modeId?: string;
|
|
267
|
-
activeResource?: ResourceRef;
|
|
268
|
-
providerId: string;
|
|
269
|
-
query: string;
|
|
270
|
-
limit: number;
|
|
271
|
-
}
|
|
272
|
-
export type CommandPaletteResourceTarget = {
|
|
273
|
-
kind: "command";
|
|
274
|
-
command: CommandRef<Struct, unknown> | string;
|
|
275
|
-
params?: Struct;
|
|
276
|
-
} | {
|
|
277
|
-
kind: "resource";
|
|
278
|
-
resource: ResourceRef;
|
|
279
|
-
};
|
|
280
|
-
export interface CommandPaletteResourceItem {
|
|
281
|
-
id: string;
|
|
282
|
-
label: string;
|
|
283
|
-
description?: string;
|
|
284
|
-
icon?: string;
|
|
285
|
-
keywords?: string[];
|
|
286
|
-
target: CommandPaletteResourceTarget;
|
|
287
|
-
}
|
|
288
|
-
export interface CommandPaletteResourceQueryResult {
|
|
289
|
-
items: CommandPaletteResourceItem[];
|
|
290
|
-
}
|
|
291
|
-
export interface CommandPaletteResourceContribution {
|
|
292
|
-
title: Localizable<string>;
|
|
293
|
-
resourceKind?: string;
|
|
294
|
-
queryCommand: CommandRef<CommandPaletteResourceQueryParams, CommandPaletteResourceQueryResult> | string;
|
|
295
|
-
refreshEvents?: (EventRef | string)[];
|
|
296
|
-
}
|
|
297
|
-
export type ExtensionSettingScope = "global" | "project";
|
|
298
|
-
export type ExtensionSettingValueType = "boolean" | "number" | "string" | "array" | "object";
|
|
299
|
-
export type ExtensionSettingValueForType<TType extends ExtensionSettingValueType> = TType extends "boolean" ? boolean : TType extends "number" ? number : TType extends "string" ? string : TType extends "array" ? JsonValue[] : JsonObject;
|
|
300
|
-
export type ExtensionSettingProperty<TType extends ExtensionSettingValueType = ExtensionSettingValueType> = {
|
|
301
|
-
[TSettingType in TType]: {
|
|
302
|
-
type: TSettingType;
|
|
303
|
-
scope: ExtensionSettingScope;
|
|
304
|
-
default?: ExtensionSettingValueForType<TSettingType>;
|
|
305
|
-
enum?: ExtensionSettingValueForType<TSettingType>[];
|
|
306
|
-
title?: Localizable<string>;
|
|
307
|
-
description?: Localizable<string>;
|
|
308
|
-
};
|
|
309
|
-
}[TType];
|
|
310
|
-
export interface ExtensionSettingsContribution<TProperties extends Record<string, ExtensionSettingProperty> = Record<string, ExtensionSettingProperty>> {
|
|
311
|
-
properties: TProperties;
|
|
312
|
-
}
|
|
313
|
-
export interface RendererContribution<TSlotContext extends Struct = Struct> {
|
|
314
|
-
slot: SlotRef<TSlotContext, "renderer"> | string;
|
|
315
|
-
for: string;
|
|
316
|
-
webview: WebviewContribution;
|
|
317
|
-
}
|
|
318
|
-
export interface ArtifactMountContribution {
|
|
319
|
-
/** Relative path under .pstdio/<extension.name>/. */
|
|
320
|
-
path: string;
|
|
321
|
-
label: Localizable<string>;
|
|
322
|
-
repoRole?: "default" | "selected" | "workspace";
|
|
323
|
-
}
|
|
324
|
-
export interface TemplateTypeContribution {
|
|
325
|
-
label: Localizable<string>;
|
|
326
|
-
description?: Localizable<string>;
|
|
327
|
-
}
|
|
328
|
-
export interface TemplateContribution {
|
|
329
|
-
title: Localizable<string>;
|
|
330
|
-
type: string;
|
|
331
|
-
source: PackageAssetDescriptor;
|
|
332
|
-
description?: Localizable<string>;
|
|
333
|
-
}
|
|
334
|
-
export interface SkillContribution {
|
|
335
|
-
title: Localizable<string>;
|
|
336
|
-
source: PackageAssetDescriptor;
|
|
337
|
-
description?: Localizable<string>;
|
|
338
|
-
}
|
|
339
|
-
export type ThemeMode = "light" | "dark";
|
|
340
|
-
export interface ThemeContribution {
|
|
341
|
-
title: Localizable<string>;
|
|
342
|
-
source: PackageAssetDescriptor;
|
|
343
|
-
format: "vscode-color-theme";
|
|
344
|
-
mode?: ThemeMode;
|
|
345
|
-
description?: Localizable<string>;
|
|
346
|
-
}
|
|
347
|
-
export interface FileIconThemeContribution {
|
|
348
|
-
title: Localizable<string>;
|
|
349
|
-
source: PackageAssetDescriptor;
|
|
350
|
-
format: "vscode-file-icon-theme";
|
|
351
|
-
description?: Localizable<string>;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Chord string in TanStack Hotkeys syntax (e.g. "mod+shift+p"). `mod` is
|
|
355
|
-
* Cmd on macOS and Ctrl elsewhere. Parsing, validation, canonicalization,
|
|
356
|
-
* and display labels are all delegated to `@tanstack/hotkeys`.
|
|
357
|
-
*/
|
|
358
|
-
export type KeybindingChord = string;
|
|
359
|
-
export interface KeybindingContribution<TParams extends Struct = Struct> {
|
|
360
|
-
/** Default chord. Used on every platform unless an override is provided. */
|
|
361
|
-
key: KeybindingChord;
|
|
362
|
-
/** macOS override. */
|
|
363
|
-
mac?: KeybindingChord;
|
|
364
|
-
/** Linux override. */
|
|
365
|
-
linux?: KeybindingChord;
|
|
366
|
-
/** Windows override. */
|
|
367
|
-
win?: KeybindingChord;
|
|
368
|
-
/** Command this chord executes. */
|
|
369
|
-
command: CommandRef<TParams, unknown> | string;
|
|
370
|
-
/** Optional command params. */
|
|
371
|
-
args?: Partial<TParams>;
|
|
372
|
-
/** Optional gating predicate. The host evaluates it at dispatch time. */
|
|
373
|
-
when?: WhenExpression;
|
|
374
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CommandDiagnostic } from "./commands";
|
|
2
|
-
import type { Struct } from "./json";
|
|
3
|
-
export interface EventRef<TPayload extends Struct = Struct> {
|
|
4
|
-
id: string;
|
|
5
|
-
payload?: TPayload;
|
|
6
|
-
}
|
|
7
|
-
export interface EventDeliveryResult {
|
|
8
|
-
delivered: number;
|
|
9
|
-
diagnostics?: CommandDiagnostic[];
|
|
10
|
-
}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import type { Localizable } from "../l10n";
|
|
2
|
-
import type { CommandRef } from "./commands";
|
|
3
|
-
import type { CommandMiddlewareHandler, CommandRunHandler, EventContext, ExtensionContextBase, MigrationContext, SetupContext } from "./context";
|
|
4
|
-
import type { ArtifactMountContribution, CliContribution, CommandPaletteContribution, CommandPaletteResourceContribution, DataRendererContribution, ExtensionSettingsContribution, FileIconThemeContribution, KeybindingContribution, MenuContribution, ModeContribution, RendererContribution, RouteContribution, SettingsPanelContribution, SkillContribution, TemplateContribution, TemplateTypeContribution, ThemeContribution, TreeItemContribution, ViewContribution } from "./contributions";
|
|
5
|
-
import type { EventRef } from "./events";
|
|
6
|
-
import type { JsonObject, MaybePromise, Struct } from "./json";
|
|
7
|
-
import type { ParamObjectSchema, ParamsOf } from "./params";
|
|
8
|
-
import type { PackageAssetDescriptor } from "./resources";
|
|
9
|
-
import type { TreeRendererContribution } from "./tree-renderer";
|
|
10
|
-
/** Current host extension API version. `engines.pstdio` in package.json is a semver range checked against this. */
|
|
11
|
-
export declare const EXTENSION_API_VERSION = "1.0.0";
|
|
12
|
-
type SchemaParams<TSchema extends ParamObjectSchema | undefined> = TSchema extends ParamObjectSchema ? ParamsOf<TSchema> : Struct;
|
|
13
|
-
/**
|
|
14
|
-
* A command exposed by an extension. The `params` schema (typed via `params.*`) drives
|
|
15
|
-
* the inferred shape of `ctx.params` in `run`.
|
|
16
|
-
*/
|
|
17
|
-
export interface CommandDefinition<TSchema extends ParamObjectSchema | undefined = ParamObjectSchema | undefined, TResult = unknown, TSettings extends Record<string, unknown> = Record<string, unknown>> {
|
|
18
|
-
title: Localizable<string>;
|
|
19
|
-
description?: Localizable<string>;
|
|
20
|
-
params?: TSchema;
|
|
21
|
-
menus?: MenuContribution[];
|
|
22
|
-
palette?: boolean | CommandPaletteContribution<SchemaParams<TSchema>> | CommandPaletteContribution<SchemaParams<TSchema>>[];
|
|
23
|
-
cli?: boolean | CliContribution;
|
|
24
|
-
run: CommandRunHandler<SchemaParams<TSchema>, TResult, TSettings>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Middleware that runs before a command. Use `command` for a typed `CommandRef`; use
|
|
28
|
-
* `commandId` only when referencing a command from another extension you don't import.
|
|
29
|
-
*/
|
|
30
|
-
export interface MiddlewareDefinition<TParams extends Struct = Struct, TResult = unknown> {
|
|
31
|
-
command?: CommandRef<TParams, TResult>;
|
|
32
|
-
commandId?: string;
|
|
33
|
-
handler: CommandMiddlewareHandler<TParams>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* A handler for an event. Use `event` for a typed `EventRef`; use `eventId` for events
|
|
37
|
-
* you cannot import (e.g. originating in another extension).
|
|
38
|
-
*/
|
|
39
|
-
export interface HookDefinition<TPayload extends Struct = Struct> {
|
|
40
|
-
event?: EventRef<TPayload>;
|
|
41
|
-
eventId?: string;
|
|
42
|
-
handler(ctx: EventContext, payload: TPayload): MaybePromise<void>;
|
|
43
|
-
}
|
|
44
|
-
export interface ScheduleContribution<TParams extends Struct = Struct> {
|
|
45
|
-
title: Localizable<string>;
|
|
46
|
-
cron: string;
|
|
47
|
-
command?: CommandRef<TParams, unknown>;
|
|
48
|
-
commandId?: string;
|
|
49
|
-
params?: TParams;
|
|
50
|
-
repoId?: string;
|
|
51
|
-
repoPath?: string;
|
|
52
|
-
disabled?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface HarnessDetectionResult {
|
|
55
|
-
available: boolean;
|
|
56
|
-
version?: string;
|
|
57
|
-
reason?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface HarnessRun {
|
|
60
|
-
runId: string;
|
|
61
|
-
pid?: number;
|
|
62
|
-
metadata?: JsonObject;
|
|
63
|
-
}
|
|
64
|
-
export interface HarnessProvider {
|
|
65
|
-
id: string;
|
|
66
|
-
label: Localizable<string>;
|
|
67
|
-
detect?(ctx: ExtensionContextBase): MaybePromise<HarnessDetectionResult>;
|
|
68
|
-
start(ctx: ExtensionContextBase, input: {
|
|
69
|
-
workspacePath: string;
|
|
70
|
-
sessionId: string;
|
|
71
|
-
prompt?: string;
|
|
72
|
-
}): MaybePromise<HarnessRun>;
|
|
73
|
-
send?(ctx: ExtensionContextBase, input: {
|
|
74
|
-
runId: string;
|
|
75
|
-
message: string;
|
|
76
|
-
}): MaybePromise<void>;
|
|
77
|
-
stop?(ctx: ExtensionContextBase, input: {
|
|
78
|
-
runId: string;
|
|
79
|
-
}): MaybePromise<void>;
|
|
80
|
-
}
|
|
81
|
-
export interface WorkspaceTypeProvider {
|
|
82
|
-
id: string;
|
|
83
|
-
label: Localizable<string>;
|
|
84
|
-
create(ctx: ExtensionContextBase, input: JsonObject): MaybePromise<JsonObject>;
|
|
85
|
-
resolve(ctx: ExtensionContextBase, workspace: JsonObject): MaybePromise<{
|
|
86
|
-
rootPath: string;
|
|
87
|
-
displayPath?: string;
|
|
88
|
-
}>;
|
|
89
|
-
archive?(ctx: ExtensionContextBase, workspace: JsonObject): MaybePromise<void>;
|
|
90
|
-
delete?(ctx: ExtensionContextBase, workspace: JsonObject): MaybePromise<void>;
|
|
91
|
-
}
|
|
92
|
-
export interface LocalExtensionSource {
|
|
93
|
-
name: string;
|
|
94
|
-
path: string;
|
|
95
|
-
origin?: string;
|
|
96
|
-
installedAt: string;
|
|
97
|
-
updatedAt: string;
|
|
98
|
-
}
|
|
99
|
-
export interface ProjectExtensionInstance {
|
|
100
|
-
projectId: string;
|
|
101
|
-
extensionId: string;
|
|
102
|
-
name: string;
|
|
103
|
-
sourceName: string;
|
|
104
|
-
enabled: boolean;
|
|
105
|
-
config: JsonObject;
|
|
106
|
-
}
|
|
107
|
-
export type ExtensionLoadScope = "user" | "repo";
|
|
108
|
-
/** Validated view of an extension's package.json identity fields. */
|
|
109
|
-
export interface PackageManifest {
|
|
110
|
-
/** Extension package name. Matches `^[a-z][a-z0-9-]*$`. */
|
|
111
|
-
name: string;
|
|
112
|
-
/** Package version (semver). */
|
|
113
|
-
version: string;
|
|
114
|
-
/** Optional human-friendly name. Falls back to `name`. */
|
|
115
|
-
displayName?: string;
|
|
116
|
-
/** Optional package description. */
|
|
117
|
-
description?: string;
|
|
118
|
-
/** Publisher segment of the extension id. Matches `^[a-z][a-z0-9-]*$`. */
|
|
119
|
-
publisher: string;
|
|
120
|
-
/** Relative path to the contributions entry module. */
|
|
121
|
-
main: string;
|
|
122
|
-
/** Semver range checked against the host extension API version. */
|
|
123
|
-
enginesPstdio: string;
|
|
124
|
-
/** Prompt Studio-specific package metadata. */
|
|
125
|
-
pstdio?: {
|
|
126
|
-
/** Install/load scope. Defaults to "user" when omitted. */
|
|
127
|
-
scope?: ExtensionLoadScope;
|
|
128
|
-
};
|
|
129
|
-
/** Derived `${publisher}.${name}`. */
|
|
130
|
-
id: string;
|
|
131
|
-
}
|
|
132
|
-
/** UI surface contributions: modes, routes, panels, renderers. */
|
|
133
|
-
export interface UiContributions {
|
|
134
|
-
modes?: Record<string, ModeContribution>;
|
|
135
|
-
routes?: Record<string, RouteContribution>;
|
|
136
|
-
views?: Record<string, ViewContribution>;
|
|
137
|
-
treeItems?: Record<string, TreeItemContribution>;
|
|
138
|
-
treeRenderers?: Record<string, TreeRendererContribution>;
|
|
139
|
-
settingsPanels?: Record<string, SettingsPanelContribution>;
|
|
140
|
-
dataRenderers?: Record<string, DataRendererContribution>;
|
|
141
|
-
commandPaletteResources?: Record<string, CommandPaletteResourceContribution>;
|
|
142
|
-
keybindings?: Record<string, KeybindingContribution<any>>;
|
|
143
|
-
activityRenderers?: Record<string, RendererContribution>;
|
|
144
|
-
sessionAnchorRenderers?: Record<string, RendererContribution>;
|
|
145
|
-
}
|
|
146
|
-
/** Behavioural surface: commands, middleware, hooks, schedules. */
|
|
147
|
-
export interface BehaviourContributions {
|
|
148
|
-
commands?: Record<string, CommandDefinition<any, any, any>>;
|
|
149
|
-
middlewares?: Record<string, MiddlewareDefinition<any, any>>;
|
|
150
|
-
hooks?: Record<string, HookDefinition<any>>;
|
|
151
|
-
schedules?: Record<string, ScheduleContribution<any>>;
|
|
152
|
-
}
|
|
153
|
-
/** Static asset contributions: artifact mounts, templates, skills. */
|
|
154
|
-
export interface AssetContributions {
|
|
155
|
-
artifactMounts?: Record<string, ArtifactMountContribution>;
|
|
156
|
-
templateTypes?: Record<string, TemplateTypeContribution>;
|
|
157
|
-
templates?: Record<string, TemplateContribution>;
|
|
158
|
-
skills?: Record<string, SkillContribution>;
|
|
159
|
-
themes?: Record<string, ThemeContribution>;
|
|
160
|
-
fileIconThemes?: Record<string, FileIconThemeContribution>;
|
|
161
|
-
translations?: Record<string, PackageAssetDescriptor>;
|
|
162
|
-
defaultLocale?: string;
|
|
163
|
-
}
|
|
164
|
-
/** Provider contributions: harnesses, workspace types. */
|
|
165
|
-
export interface ProviderContributions {
|
|
166
|
-
workspaceTypes?: Record<string, WorkspaceTypeProvider>;
|
|
167
|
-
harnesses?: Record<string, HarnessProvider>;
|
|
168
|
-
}
|
|
169
|
-
/** Lifecycle hooks invoked by the runtime when an extension is installed or upgraded. */
|
|
170
|
-
export interface ExtensionLifecycle {
|
|
171
|
-
initialSetup?: (ctx: SetupContext) => MaybePromise<void>;
|
|
172
|
-
migrate?: (ctx: MigrationContext, fromVersion: string | null) => MaybePromise<void>;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* The full shape of an extension's contributions module. Identity (id, name, version,
|
|
176
|
-
* description, etc.) lives in `package.json`; `defineExtension` only accepts
|
|
177
|
-
* contribution surfaces.
|
|
178
|
-
*/
|
|
179
|
-
export interface ExtensionDefinition extends UiContributions, BehaviourContributions, AssetContributions, ProviderContributions, ExtensionLifecycle {
|
|
180
|
-
settings?: ExtensionSettingsContribution;
|
|
181
|
-
}
|
|
182
|
-
export type ExtensionSourceKind = "local_path" | "git" | "registry";
|
|
183
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type * from "./commands";
|
|
2
|
-
export type * from "./context";
|
|
3
|
-
export type * from "./contributions";
|
|
4
|
-
export type * from "./events";
|
|
5
|
-
export type * from "./extension";
|
|
6
|
-
export type * from "./json";
|
|
7
|
-
export type * from "./params";
|
|
8
|
-
export type * from "./resources";
|
|
9
|
-
export type * from "./slots";
|
|
10
|
-
export type * from "./tree-renderer";
|
|
11
|
-
export * from "./webview-capabilities";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type JsonPrimitive = string | number | boolean | null;
|
|
2
|
-
export type JsonValue = JsonPrimitive | JsonValue[] | JsonObject;
|
|
3
|
-
export type JsonObject = {
|
|
4
|
-
[key: string]: JsonValue;
|
|
5
|
-
};
|
|
6
|
-
export type MaybePromise<T> = T | Promise<T>;
|
|
7
|
-
export type Struct = object;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { JsonObject } from "./json";
|
|
2
|
-
import type { ResourceRef } from "./resources";
|
|
3
|
-
export type ParamType = "text" | "longtext" | "number" | "boolean" | "select" | "multi-select" | "repo" | "harness" | "template" | "resource" | "json" | "list";
|
|
4
|
-
type ParamRequired<TRequired extends boolean | undefined> = TRequired extends true ? {
|
|
5
|
-
required: true;
|
|
6
|
-
} : TRequired extends false ? {
|
|
7
|
-
required: false;
|
|
8
|
-
} : {
|
|
9
|
-
required?: boolean;
|
|
10
|
-
};
|
|
11
|
-
type ParamBase<TValue, TRequired extends boolean | undefined = boolean | undefined> = {
|
|
12
|
-
label?: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
defaultValue?: TValue;
|
|
15
|
-
metadata?: JsonObject;
|
|
16
|
-
} & ParamRequired<TRequired>;
|
|
17
|
-
export type TextParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string, TRequired> & {
|
|
18
|
-
type: "text";
|
|
19
|
-
};
|
|
20
|
-
export type LongTextParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string, TRequired> & {
|
|
21
|
-
type: "longtext";
|
|
22
|
-
};
|
|
23
|
-
export type NumberParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<number, TRequired> & {
|
|
24
|
-
type: "number";
|
|
25
|
-
};
|
|
26
|
-
export type BooleanParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<boolean, TRequired> & {
|
|
27
|
-
type: "boolean";
|
|
28
|
-
};
|
|
29
|
-
export type SelectParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string, TRequired> & {
|
|
30
|
-
type: "select";
|
|
31
|
-
options: Array<{
|
|
32
|
-
label: string;
|
|
33
|
-
value: string;
|
|
34
|
-
}>;
|
|
35
|
-
};
|
|
36
|
-
export type MultiSelectParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string[], TRequired> & {
|
|
37
|
-
type: "multi-select";
|
|
38
|
-
options: Array<{
|
|
39
|
-
label: string;
|
|
40
|
-
value: string;
|
|
41
|
-
}>;
|
|
42
|
-
};
|
|
43
|
-
export type RepoParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<{
|
|
44
|
-
repoId: string;
|
|
45
|
-
branch?: string;
|
|
46
|
-
}, TRequired> & {
|
|
47
|
-
type: "repo";
|
|
48
|
-
};
|
|
49
|
-
export type HarnessParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<{
|
|
50
|
-
harnessId: string;
|
|
51
|
-
model?: string;
|
|
52
|
-
}, TRequired> & {
|
|
53
|
-
type: "harness";
|
|
54
|
-
};
|
|
55
|
-
export type TemplateParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string, TRequired> & {
|
|
56
|
-
type: "template";
|
|
57
|
-
templateType: string;
|
|
58
|
-
};
|
|
59
|
-
export type ResourceParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<ResourceRef, TRequired> & {
|
|
60
|
-
type: "resource";
|
|
61
|
-
resourceType: string;
|
|
62
|
-
};
|
|
63
|
-
export type JsonParam<T = unknown, TRequired extends boolean | undefined = boolean | undefined> = ParamBase<T, TRequired> & {
|
|
64
|
-
type: "json";
|
|
65
|
-
};
|
|
66
|
-
export type ListParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string[], TRequired> & {
|
|
67
|
-
type: "list";
|
|
68
|
-
};
|
|
69
|
-
export type ParamDescriptor<TValue = unknown, TRequired extends boolean | undefined = boolean | undefined> = TextParam<TRequired> | LongTextParam<TRequired> | NumberParam<TRequired> | BooleanParam<TRequired> | SelectParam<TRequired> | MultiSelectParam<TRequired> | RepoParam<TRequired> | HarnessParam<TRequired> | TemplateParam<TRequired> | ResourceParam<TRequired> | JsonParam<TValue, TRequired> | ListParam<TRequired>;
|
|
70
|
-
export type ParamObjectSchema = Record<string, ParamDescriptor>;
|
|
71
|
-
export type ParamValue<TDescriptor extends ParamDescriptor> = TDescriptor extends ParamDescriptor<infer V> ? V : never;
|
|
72
|
-
type RequiredParamKeys<TSchema extends ParamObjectSchema> = {
|
|
73
|
-
[K in keyof TSchema]: TSchema[K] extends {
|
|
74
|
-
required: true;
|
|
75
|
-
} ? K : never;
|
|
76
|
-
}[keyof TSchema];
|
|
77
|
-
type OptionalParamKeys<TSchema extends ParamObjectSchema> = Exclude<keyof TSchema, RequiredParamKeys<TSchema>>;
|
|
78
|
-
export type ParamsOf<TSchema extends ParamObjectSchema> = {
|
|
79
|
-
[K in RequiredParamKeys<TSchema>]: ParamValue<TSchema[K]>;
|
|
80
|
-
} & {
|
|
81
|
-
[K in OptionalParamKeys<TSchema>]?: ParamValue<TSchema[K]>;
|
|
82
|
-
};
|
|
83
|
-
export {};
|