@pstdio/sdk 0.10.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.
Files changed (56) hide show
  1. package/README.md +1 -4
  2. package/dist/api/extensions.d.ts +1 -1
  3. package/dist/api/index.d.ts +2 -6
  4. package/dist/api/workspaces.d.ts +2 -6
  5. package/dist/client/agents.d.ts +2 -7
  6. package/dist/client/client.d.ts +0 -9
  7. package/dist/client/index.d.ts +0 -3
  8. package/dist/client/index.js +17 -116
  9. package/dist/client/projects.d.ts +2 -2
  10. package/dist/client/workspaces.d.ts +2 -4
  11. package/dist/extensions/command-outcome.d.ts +5 -0
  12. package/dist/extensions/define-command.d.ts +1 -3
  13. package/dist/extensions/define-extension-view.d.ts +25 -0
  14. package/dist/extensions/define-extension.d.ts +1 -4
  15. package/dist/extensions/index.d.ts +6 -8
  16. package/dist/extensions/index.js +145 -89
  17. package/dist/extensions/params.d.ts +2 -1
  18. package/dist/extensions/refs.d.ts +2 -14
  19. package/dist/extensions/when.d.ts +9 -0
  20. package/dist/hooks/entities.d.ts +7 -9
  21. package/dist/hooks/index.d.ts +0 -2
  22. package/dist/hooks/session.d.ts +2 -3
  23. package/dist/hooks/worktree.d.ts +4 -3
  24. package/dist/resources/agent.d.ts +1 -1
  25. package/dist/resources/index.d.ts +2 -5
  26. package/dist/resources/index.js +3 -1
  27. package/dist/resources/known-agents.d.ts +2 -0
  28. package/dist/resources/workspace.d.ts +0 -1
  29. package/package.json +2 -2
  30. package/dist/api/agents.d.ts +0 -1
  31. package/dist/api/statuses.d.ts +0 -2
  32. package/dist/api/tags.d.ts +0 -2
  33. package/dist/api/tickets.d.ts +0 -26
  34. package/dist/client/statuses.d.ts +0 -24
  35. package/dist/client/tags.d.ts +0 -15
  36. package/dist/client/tickets.d.ts +0 -24
  37. package/dist/extensions/kernel-slots.d.ts +0 -168
  38. package/dist/extensions/package-asset.d.ts +0 -10
  39. package/dist/extensions/slots.d.ts +0 -6
  40. package/dist/extensions/types/commands.d.ts +0 -125
  41. package/dist/extensions/types/context.d.ts +0 -396
  42. package/dist/extensions/types/contributions.d.ts +0 -275
  43. package/dist/extensions/types/events.d.ts +0 -10
  44. package/dist/extensions/types/extension.d.ts +0 -174
  45. package/dist/extensions/types/index.d.ts +0 -10
  46. package/dist/extensions/types/json.d.ts +0 -7
  47. package/dist/extensions/types/params.d.ts +0 -80
  48. package/dist/extensions/types/resources.d.ts +0 -25
  49. package/dist/extensions/types/slots.d.ts +0 -22
  50. package/dist/extensions/types/webview-capabilities.d.ts +0 -65
  51. package/dist/extensions/workbench-targets.d.ts +0 -134
  52. package/dist/hooks/attempt.d.ts +0 -16
  53. package/dist/hooks/ticket.d.ts +0 -26
  54. package/dist/resources/status.d.ts +0 -2
  55. package/dist/resources/tag.d.ts +0 -2
  56. package/dist/resources/ticket.d.ts +0 -2
@@ -1,396 +0,0 @@
1
- import type { CommandHelpersApi, CommandInvocation, CommandMiddlewareResult, CommandNotice, CommandSource, WorkbenchAttachmentInvocationContext } from "./commands";
2
- import type { EventDeliveryResult, EventRef } from "./events";
3
- import type { JsonObject, MaybePromise, Struct } from "./json";
4
- import type { RepoContext, ResourceAnchor, ResourceRef } from "./resources";
5
- import type { SlotInvocationContext } from "./slots";
6
- export interface ExtensionStorageCollectionApi<TItem = unknown> {
7
- get(id: string): Promise<TItem | undefined>;
8
- list(): Promise<TItem[]>;
9
- put(id: string, value: TItem): Promise<void>;
10
- create(value: TItem): Promise<TItem & {
11
- id: string;
12
- }>;
13
- delete(id: string): Promise<void>;
14
- }
15
- export type StorageScope = {
16
- type: "project";
17
- } | {
18
- type: "repo";
19
- repoId?: string;
20
- } | {
21
- type: "resource";
22
- resource?: ResourceRef;
23
- } | {
24
- type: string;
25
- id?: string;
26
- };
27
- export interface ExtensionStorageApi {
28
- scope(scope: StorageScope): ExtensionStorageApi;
29
- get<T = unknown>(key: string): Promise<T | undefined>;
30
- set<T = unknown>(key: string, value: T): Promise<void>;
31
- delete(key: string): Promise<void>;
32
- collection<TItem = unknown>(name: string): ExtensionStorageCollectionApi<TItem>;
33
- }
34
- export interface ArtifactFile {
35
- path: string;
36
- size?: number;
37
- updatedAt?: string;
38
- }
39
- export interface ArtifactMount {
40
- exists(path: string): Promise<boolean>;
41
- readText(path: string): Promise<string>;
42
- writeText(path: string, value: string): Promise<void>;
43
- readBytes(path: string): Promise<Uint8Array>;
44
- writeBytes(path: string, value: Uint8Array): Promise<void>;
45
- list(pattern?: string): Promise<ArtifactFile[]>;
46
- listDirs(path?: string): Promise<string[]>;
47
- delete(path: string): Promise<void>;
48
- }
49
- export interface ExtensionArtifactApi {
50
- mount(key: string): ArtifactMount;
51
- }
52
- export interface ExtensionFilesApi {
53
- readText(fileId: string): Promise<string>;
54
- writeText(fileId: string, value: string): Promise<void>;
55
- createText(input: {
56
- name: string;
57
- content: string;
58
- metadata?: JsonObject;
59
- }): Promise<{
60
- id: string;
61
- }>;
62
- delete(fileId: string): Promise<void>;
63
- }
64
- export interface ExtensionSessionsApi {
65
- create(input: {
66
- title: string;
67
- prompt?: string;
68
- template?: string;
69
- vars?: JsonObject;
70
- harness?: ExtensionHarnessInput;
71
- workspaceId?: string;
72
- repoId?: string;
73
- anchors?: ResourceAnchor[];
74
- originalSessionId?: string;
75
- }): Promise<{
76
- id: string;
77
- }>;
78
- followup(input: {
79
- sessionId: string;
80
- prompt?: string;
81
- template?: string;
82
- vars?: JsonObject;
83
- }): Promise<void>;
84
- }
85
- export interface ExtensionHarnessInput {
86
- harnessId: string;
87
- model?: string;
88
- }
89
- /** @deprecated Legacy core ticket extension API. Ticket data is owned by the pstdio tickets extension. */
90
- export interface ExtensionTicket {
91
- id: string;
92
- shorthand: string;
93
- created_at?: string;
94
- updated_at?: string;
95
- display_title?: string | null;
96
- displayTitle?: string | null;
97
- user_prompt?: string | null;
98
- userPrompt?: string | null;
99
- parent_id?: string | null;
100
- parentId?: string | null;
101
- draft?: boolean;
102
- archived?: boolean;
103
- status_id?: string | null;
104
- status?: string | null;
105
- status_name?: string | null;
106
- tag_ids?: string[];
107
- tag_names?: string[];
108
- tagIds?: string[];
109
- tagNames?: string[];
110
- file_id?: string | null;
111
- fileId?: string | null;
112
- fileIds?: string[];
113
- }
114
- /** @deprecated Legacy core ticket extension API. Ticket data is owned by the pstdio tickets extension. */
115
- export interface ExtensionTicketFile {
116
- id: string;
117
- file_name?: string | null;
118
- fileName?: string | null;
119
- file_kind?: string | null;
120
- fileKind?: string | null;
121
- mime_type?: string | null;
122
- mimeType?: string | null;
123
- created_at?: string;
124
- updated_at?: string;
125
- }
126
- /** @deprecated Legacy core ticket extension API. Ticket data is owned by the pstdio tickets extension. */
127
- export interface ExtensionTicketListInput {
128
- status?: string;
129
- tag?: string | string[];
130
- archived?: boolean;
131
- draft?: boolean;
132
- parentId?: string;
133
- shorthand?: string;
134
- search?: string;
135
- }
136
- export interface ExtensionWorkspace {
137
- id: string;
138
- project_id?: string;
139
- workspace_shorthand?: string;
140
- /** @deprecated Legacy ticket-workspace linkage. Ticket data is owned by the pstdio tickets extension. */
141
- ticket_id?: string | null;
142
- /** @deprecated Legacy ticket-workspace linkage. Ticket data is owned by the pstdio tickets extension. */
143
- ticket_shorthand?: string | null;
144
- branch?: string | null;
145
- worktree_path?: string | null;
146
- attempt_status_id?: string | null;
147
- attempt_status_name?: string | null;
148
- initializing?: boolean;
149
- }
150
- /** @deprecated Legacy core ticket extension API. Ticket data is owned by the pstdio tickets extension. */
151
- export interface ExtensionTicketsApi {
152
- list(input?: ExtensionTicketListInput): Promise<ExtensionTicket[]>;
153
- get(ref: string): Promise<ExtensionTicket>;
154
- update(input: {
155
- ticket: string;
156
- content?: string;
157
- }): Promise<ExtensionTicket>;
158
- listFiles(ref: string): Promise<ExtensionTicketFile[]>;
159
- createAttempt(input: {
160
- ticket: string;
161
- agent?: string;
162
- branch?: string;
163
- repoId?: string;
164
- repoPath?: string;
165
- mode?: "worktree" | "current_branch";
166
- model?: string;
167
- prompt?: string;
168
- base?: string;
169
- startSession?: boolean;
170
- }): Promise<unknown>;
171
- setStatus(input: {
172
- ticket: string;
173
- status: string;
174
- }): Promise<void>;
175
- updateWhenAllAttemptsMatch(input: {
176
- ticket: string;
177
- allAttemptsStatus: string;
178
- setStatus: string;
179
- }): Promise<{
180
- updated: boolean;
181
- }>;
182
- }
183
- /** @deprecated Legacy core ticket status extension API. Ticket statuses are owned by the pstdio tickets extension. */
184
- export interface ExtensionTicketStatus {
185
- id: string;
186
- name: string;
187
- color: string;
188
- sortOrder: number;
189
- isDefault: boolean;
190
- canCreate: boolean;
191
- canDragIn: boolean;
192
- canDragOut: boolean;
193
- columnActions: string[];
194
- }
195
- /** @deprecated Legacy core ticket status extension API. Ticket statuses are owned by the pstdio tickets extension. */
196
- export interface ExtensionTicketStatusesApi {
197
- list(): Promise<ExtensionTicketStatus[]>;
198
- create(input: {
199
- name: string;
200
- color: string;
201
- sortOrder?: number;
202
- isDefault?: boolean;
203
- canCreate?: boolean;
204
- canDragIn?: boolean;
205
- canDragOut?: boolean;
206
- columnActions?: string[];
207
- }): Promise<ExtensionTicketStatus>;
208
- update(input: {
209
- statusId: string;
210
- name?: string;
211
- color?: string;
212
- sortOrder?: number;
213
- canCreate?: boolean;
214
- canDragIn?: boolean;
215
- canDragOut?: boolean;
216
- columnActions?: string[];
217
- }): Promise<ExtensionTicketStatus>;
218
- setDefault(input: {
219
- statusId: string;
220
- }): Promise<void>;
221
- delete(input: {
222
- statusId: string;
223
- }): Promise<void>;
224
- }
225
- /** @deprecated Legacy ticket attempt status extension API. Workspace status automation is extension-owned. */
226
- export interface ExtensionAttemptStatus {
227
- id: string;
228
- name: string;
229
- color: string;
230
- sortOrder: number;
231
- isDefault: boolean;
232
- }
233
- /** @deprecated Legacy ticket attempt status extension API. Workspace status automation is extension-owned. */
234
- export interface ExtensionAttemptStatusesApi {
235
- list(): Promise<ExtensionAttemptStatus[]>;
236
- create(input: {
237
- name: string;
238
- color: string;
239
- sortOrder?: number;
240
- isDefault?: boolean;
241
- }): Promise<ExtensionAttemptStatus>;
242
- update(input: {
243
- statusId: string;
244
- name?: string;
245
- color?: string;
246
- sortOrder?: number;
247
- isDefault?: boolean;
248
- }): Promise<ExtensionAttemptStatus>;
249
- delete(input: {
250
- statusId: string;
251
- }): Promise<void>;
252
- }
253
- export interface SetAttemptStatusInput {
254
- workspaceId: string;
255
- status: string;
256
- sessionId?: string;
257
- }
258
- export interface SetAttemptStatusResult {
259
- id: string;
260
- attempt_status_id: string | null;
261
- from_status: string | null;
262
- to_status: string;
263
- status_change_id: string;
264
- }
265
- export interface ExtensionWorkspacesApi {
266
- get(id: string): Promise<ExtensionWorkspace | null>;
267
- getByShorthand(shorthand: string): Promise<ExtensionWorkspace | null>;
268
- create(input: JsonObject): Promise<ExtensionWorkspace>;
269
- archive(id: string): Promise<void>;
270
- delete(id: string): Promise<void>;
271
- setAttemptStatus(input: SetAttemptStatusInput): Promise<SetAttemptStatusResult>;
272
- }
273
- export interface BootstrapWorktreeInput {
274
- repoPath: string;
275
- worktreePath: string;
276
- /** @deprecated Legacy ticket worktree bootstrap. Ticket worktree setup is owned by the pstdio tickets extension. */
277
- ticketId?: string;
278
- }
279
- /** @deprecated Legacy ticket worktree cleanup. Ticket worktree setup is owned by the pstdio tickets extension. */
280
- export interface RemoveWorktreesForTicketInput {
281
- ticketId?: string;
282
- }
283
- export interface ExtensionWorktreesApi {
284
- bootstrap(input: BootstrapWorktreeInput): Promise<void>;
285
- /** @deprecated Legacy ticket worktree cleanup. Ticket worktree setup is owned by the pstdio tickets extension. */
286
- removeAllForTicket(input: RemoveWorktreesForTicketInput): Promise<number>;
287
- }
288
- export interface ExtensionReposApi {
289
- list(): Promise<RepoContext[]>;
290
- get(repoId: string): Promise<RepoContext>;
291
- getDefault(): Promise<RepoContext | undefined>;
292
- resolvePath(repoId: string, relativePath: string, options?: {
293
- basePath?: string;
294
- }): Promise<string>;
295
- }
296
- export interface ExtensionEventsApi {
297
- emit<TPayload extends Struct>(event: EventRef<TPayload> | string, payload: TPayload): Promise<EventDeliveryResult>;
298
- }
299
- export interface ExtensionActivityApi {
300
- record(input: {
301
- message: string;
302
- target?: ResourceRef;
303
- related?: ResourceRef[];
304
- metadata?: JsonObject;
305
- }): Promise<{
306
- id: string;
307
- }>;
308
- }
309
- export interface ExtensionNotifyApi {
310
- toast(notice: CommandNotice): Promise<void>;
311
- }
312
- export interface ProcessRunResult {
313
- exitCode: number;
314
- stdout: string;
315
- stderr: string;
316
- }
317
- export interface ProcessRunInput {
318
- command: string[];
319
- cwd?: string;
320
- env?: Record<string, string>;
321
- timeoutMs?: number;
322
- }
323
- export interface ExtensionProcessApi {
324
- run(input: ProcessRunInput): Promise<ProcessRunResult>;
325
- runOrThrow(input: ProcessRunInput): Promise<ProcessRunResult>;
326
- spawnDetached(input: {
327
- command: string[];
328
- cwd?: string;
329
- env?: Record<string, string>;
330
- }): Promise<{
331
- pid?: number;
332
- }>;
333
- }
334
- export interface ExtensionNetApi {
335
- findFreePort(input?: {
336
- host?: string;
337
- }): Promise<number>;
338
- }
339
- export interface ExtensionLoggerApi {
340
- info(message: string, metadata?: JsonObject): void;
341
- warn(message: string, metadata?: JsonObject): void;
342
- error(message: string, metadata?: JsonObject): void;
343
- }
344
- export interface ExtensionSettingsApi<TSettings extends Record<string, unknown> = Record<string, unknown>> {
345
- all(): Promise<Partial<TSettings>>;
346
- get<TKey extends keyof TSettings & string>(key: TKey): Promise<TSettings[TKey] | undefined>;
347
- set<TKey extends keyof TSettings & string>(key: TKey, value: TSettings[TKey]): Promise<void>;
348
- delete<TKey extends keyof TSettings & string>(key: TKey): Promise<void>;
349
- }
350
- export interface ExtensionContextBase<TSettings extends Record<string, unknown> = Record<string, unknown>> {
351
- projectId: string;
352
- extensionId: string;
353
- /** Extension package name. Used for grouping/prefixing user-facing references. */
354
- name: string;
355
- repo?: RepoContext;
356
- source?: CommandSource;
357
- storage: ExtensionStorageApi;
358
- artifacts: ExtensionArtifactApi;
359
- files: ExtensionFilesApi;
360
- /** @deprecated Legacy core ticket extension API. Ticket data is owned by the pstdio tickets extension. */
361
- tickets: ExtensionTicketsApi;
362
- /** @deprecated Legacy core ticket status extension API. Ticket statuses are owned by the pstdio tickets extension. */
363
- ticketStatuses: ExtensionTicketStatusesApi;
364
- /** @deprecated Legacy ticket attempt status extension API. Workspace status automation is extension-owned. */
365
- attemptStatuses: ExtensionAttemptStatusesApi;
366
- sessions: ExtensionSessionsApi;
367
- workspaces: ExtensionWorkspacesApi;
368
- worktrees: ExtensionWorktreesApi;
369
- repos: ExtensionReposApi;
370
- commands: CommandHelpersApi;
371
- events: ExtensionEventsApi;
372
- activity: ExtensionActivityApi;
373
- notify: ExtensionNotifyApi;
374
- process: ExtensionProcessApi;
375
- net: ExtensionNetApi;
376
- logger: ExtensionLoggerApi;
377
- settings: ExtensionSettingsApi<TSettings>;
378
- }
379
- export interface CommandContext<TParams extends Struct = Struct, TSettings extends Record<string, unknown> = Record<string, unknown>> extends ExtensionContextBase<TSettings> {
380
- commandId: string;
381
- invocationId: string;
382
- invocation: CommandInvocation<TParams>;
383
- resource?: ResourceRef;
384
- attachment?: WorkbenchAttachmentInvocationContext;
385
- slot?: SlotInvocationContext;
386
- params: TParams;
387
- }
388
- export type CommandMiddlewareContext<TParams extends Struct = Struct> = CommandContext<TParams>;
389
- export type CommandMiddlewareHandler<TParams extends Struct = Struct> = (ctx: CommandMiddlewareContext<TParams>) => MaybePromise<CommandMiddlewareResult<TParams>>;
390
- export type CommandRunHandler<TParams extends Struct = Struct, TResult = unknown, TSettings extends Record<string, unknown> = Record<string, unknown>> = (ctx: CommandContext<TParams, TSettings>) => MaybePromise<TResult>;
391
- export interface EventContext extends ExtensionContextBase {
392
- eventId: string;
393
- deliveryId: string;
394
- }
395
- export type SetupContext = ExtensionContextBase;
396
- export type MigrationContext = ExtensionContextBase;
@@ -1,275 +0,0 @@
1
- import type { WorkbenchMenuTarget, WorkbenchModeLayoutTarget, WorkbenchSettingsScope, WorkbenchSettingsTarget, WorkbenchTreeTarget, WorkbenchViewTarget } from "../workbench-targets";
2
- import type { CommandRef, CommandSource } from "./commands";
3
- import type { JsonObject, JsonValue, Struct } from "./json";
4
- import type { ParamObjectSchema } from "./params";
5
- import type { PackageAssetDescriptor } from "./resources";
6
- import type { SlotRef } from "./slots";
7
- import type { WebviewCapabilityDeclaration } from "./webview-capabilities";
8
- export interface CliContribution {
9
- path?: string[];
10
- globalAliases?: string[][];
11
- description?: string;
12
- examples?: string[];
13
- hidden?: boolean;
14
- }
15
- export interface WhenExpression {
16
- mode?: string | string[];
17
- source?: CommandSource[];
18
- resourceType?: string[];
19
- metadata?: JsonObject;
20
- }
21
- export interface MenuContribution<TSlotContext extends Struct = Struct, TParams extends Struct = Struct> {
22
- target?: WorkbenchMenuTarget;
23
- slot?: SlotRef<TSlotContext, "menu"> | string;
24
- label?: string;
25
- group?: string;
26
- placement?: "first" | "default" | "last";
27
- icon?: string;
28
- when?: WhenExpression;
29
- command?: CommandRef<TParams, unknown> | string;
30
- params?: Partial<TParams>;
31
- presentation?: "menu-item" | "button" | "icon-button";
32
- }
33
- export interface TreeItemContribution<TParams extends Struct = Struct> {
34
- target: WorkbenchTreeTarget;
35
- label: string;
36
- group?: string;
37
- placement?: "first" | "default" | "last";
38
- icon?: string;
39
- when?: WhenExpression;
40
- action: {
41
- kind: "command";
42
- command: CommandRef<TParams, unknown> | string;
43
- params?: Partial<TParams>;
44
- } | {
45
- kind: "dataRenderer";
46
- dataRenderer: string;
47
- } | {
48
- kind: "route";
49
- route: string;
50
- } | {
51
- kind: "href";
52
- href: string;
53
- };
54
- }
55
- export type WorkbenchLayoutTarget = WorkbenchModeLayoutTarget;
56
- export type ModeTargetContribution = {
57
- target: WorkbenchLayoutTarget;
58
- view: string;
59
- title?: string;
60
- resource?: string;
61
- pinned?: boolean;
62
- } | {
63
- target: WorkbenchLayoutTarget;
64
- resource: string;
65
- widget?: string;
66
- title?: string;
67
- pinned?: boolean;
68
- };
69
- export interface ModeLayoutContribution {
70
- reset?: boolean | WorkbenchLayoutTarget[];
71
- open?: ModeTargetContribution[];
72
- }
73
- export interface ModeContribution {
74
- id?: string;
75
- label: string;
76
- icon?: string;
77
- layout?: ModeLayoutContribution;
78
- }
79
- export interface WebviewContribution {
80
- entry: PackageAssetDescriptor;
81
- title?: string;
82
- capabilities?: WebviewCapabilityDeclaration[];
83
- }
84
- export interface ViewContribution<TSlotContext extends Struct = Struct> {
85
- title: string;
86
- target?: WorkbenchViewTarget;
87
- slot?: SlotRef<TSlotContext, "view"> | string;
88
- group?: string;
89
- placement?: "first" | "default" | "last";
90
- webview: WebviewContribution;
91
- }
92
- export interface RouteContribution {
93
- path: string;
94
- label: string;
95
- webview: WebviewContribution;
96
- }
97
- export interface SettingsPanelContribution<TSlotContext extends Struct = Struct> {
98
- title: string;
99
- target?: WorkbenchSettingsTarget;
100
- scope?: WorkbenchSettingsScope;
101
- slot?: SlotRef<TSlotContext, "settings"> | string;
102
- webview: WebviewContribution;
103
- }
104
- export type DataRendererViewMode = "board" | "list";
105
- export type DataRendererSortDirection = "asc" | "desc";
106
- export interface DataRendererEnumOption {
107
- value: string;
108
- label: string;
109
- color?: string;
110
- icon?: string | null;
111
- }
112
- export type DataRendererAttributeType = {
113
- kind: "enum";
114
- options: DataRendererEnumOption[];
115
- } | {
116
- kind: "enum-multi";
117
- options: DataRendererEnumOption[];
118
- } | {
119
- kind: "string";
120
- } | {
121
- kind: "date";
122
- } | {
123
- kind: "number";
124
- } | {
125
- kind: "user";
126
- };
127
- export interface DataRendererAttributeDescriptor {
128
- id: string;
129
- label: string;
130
- type: DataRendererAttributeType;
131
- filterable?: boolean;
132
- groupable?: boolean;
133
- sortable?: boolean;
134
- displayable?: boolean;
135
- editable?: boolean;
136
- }
137
- export interface DataRendererSettings {
138
- viewMode: DataRendererViewMode;
139
- columnGrouping: string;
140
- rowGrouping: string;
141
- ordering: {
142
- attributeId: string;
143
- direction: DataRendererSortDirection;
144
- };
145
- displayProperties: string[];
146
- }
147
- export type DataRendererFilterState = Record<string, string[]>;
148
- export interface DataRendererQueryParams {
149
- settings: DataRendererSettings;
150
- filters: DataRendererFilterState;
151
- }
152
- export interface DataRendererResourceRef {
153
- type: string;
154
- id: string;
155
- projectId?: string;
156
- label?: string;
157
- extensionId?: string;
158
- metadata?: JsonObject;
159
- }
160
- export interface DataRendererRow {
161
- id: string;
162
- title: string;
163
- resource?: DataRendererResourceRef;
164
- attributes: Record<string, unknown>;
165
- }
166
- export interface DataRendererColumnAction {
167
- id: string;
168
- label: string;
169
- icon?: string;
170
- }
171
- export interface DataRendererBoardColumnConfig {
172
- color?: string;
173
- canDragIn?: boolean;
174
- canDragOut?: boolean;
175
- canCreate?: boolean;
176
- actions?: DataRendererColumnAction[];
177
- }
178
- export interface DataRendererQueryResult {
179
- rows: DataRendererRow[];
180
- attributes?: DataRendererAttributeDescriptor[];
181
- boardColumnConfigs?: Record<string, DataRendererBoardColumnConfig>;
182
- }
183
- export interface DataRendererCreateRowContribution<TParams extends ParamObjectSchema = ParamObjectSchema> {
184
- command: CommandRef<Struct, unknown> | string;
185
- title?: string;
186
- submitLabel?: string;
187
- columnParam?: string;
188
- params?: TParams;
189
- }
190
- export interface DataRendererSavedViewsContribution {
191
- resourceKind: string;
192
- scope?: "project" | "user";
193
- }
194
- export interface DataRendererContribution {
195
- title: string;
196
- resourceKind?: string;
197
- attributes?: DataRendererAttributeDescriptor[];
198
- queryCommand: CommandRef<DataRendererQueryParams, DataRendererQueryResult> | string;
199
- updateAttributeCommand?: CommandRef<{
200
- rowId: string;
201
- attributeId: string;
202
- value: unknown;
203
- }, unknown> | string;
204
- reorderCommand?: CommandRef<{
205
- rowId: string;
206
- beforeRowId?: string;
207
- }, unknown> | string;
208
- columnActionCommand?: CommandRef<{
209
- columnId: string;
210
- actionId: string;
211
- }, unknown> | string;
212
- createRow?: DataRendererCreateRowContribution;
213
- defaultSettings?: Partial<DataRendererSettings>;
214
- defaultFilters?: DataRendererFilterState;
215
- emptyTitle?: string;
216
- emptyDescription?: string;
217
- hideToolbar?: boolean;
218
- savedViews?: DataRendererSavedViewsContribution;
219
- }
220
- export type ExtensionSettingScope = "global" | "project";
221
- export type ExtensionSettingValueType = "boolean" | "number" | "string" | "array" | "object";
222
- export type ExtensionSettingValueForType<TType extends ExtensionSettingValueType> = TType extends "boolean" ? boolean : TType extends "number" ? number : TType extends "string" ? string : TType extends "array" ? JsonValue[] : JsonObject;
223
- export type ExtensionSettingProperty<TType extends ExtensionSettingValueType = ExtensionSettingValueType> = {
224
- [TSettingType in TType]: {
225
- type: TSettingType;
226
- scope: ExtensionSettingScope;
227
- default?: ExtensionSettingValueForType<TSettingType>;
228
- enum?: ExtensionSettingValueForType<TSettingType>[];
229
- title?: string;
230
- description?: string;
231
- };
232
- }[TType];
233
- export interface ExtensionSettingsContribution<TProperties extends Record<string, ExtensionSettingProperty> = Record<string, ExtensionSettingProperty>> {
234
- properties: TProperties;
235
- }
236
- export interface RendererContribution<TSlotContext extends Struct = Struct> {
237
- slot: SlotRef<TSlotContext, "renderer"> | string;
238
- for: string;
239
- webview: WebviewContribution;
240
- }
241
- export interface ArtifactMountContribution {
242
- /** Relative path under .pstdio/<extension.name>/. */
243
- path: string;
244
- label: string;
245
- repoRole?: "default" | "selected" | "workspace";
246
- }
247
- export interface TemplateTypeContribution {
248
- label: string;
249
- description?: string;
250
- }
251
- export interface TemplateContribution {
252
- title: string;
253
- type: string;
254
- source: PackageAssetDescriptor;
255
- description?: string;
256
- }
257
- export interface SkillContribution {
258
- title: string;
259
- source: PackageAssetDescriptor;
260
- description?: string;
261
- }
262
- export type ThemeMode = "light" | "dark";
263
- export interface ThemeContribution {
264
- title: string;
265
- source: PackageAssetDescriptor;
266
- format: "vscode-color-theme";
267
- mode?: ThemeMode;
268
- description?: string;
269
- }
270
- export interface FileIconThemeContribution {
271
- title: string;
272
- source: PackageAssetDescriptor;
273
- format: "vscode-file-icon-theme";
274
- description?: string;
275
- }
@@ -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
- }