@pstdio/sdk 0.8.0 → 0.10.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 (66) hide show
  1. package/README.md +37 -184
  2. package/dist/api/extensions.d.ts +1 -1
  3. package/dist/api/index.d.ts +1 -2
  4. package/dist/api/statuses.d.ts +1 -0
  5. package/dist/api/tags.d.ts +1 -0
  6. package/dist/api/tickets.d.ts +3 -0
  7. package/dist/api/workspaces.d.ts +10 -1
  8. package/dist/client/client.d.ts +3 -2
  9. package/dist/client/index.d.ts +0 -1
  10. package/dist/client/index.js +0 -12
  11. package/dist/client/projects.d.ts +0 -11
  12. package/dist/client/statuses.d.ts +2 -0
  13. package/dist/client/tags.d.ts +2 -0
  14. package/dist/client/tickets.d.ts +2 -0
  15. package/dist/client/workspaces.d.ts +2 -0
  16. package/dist/extensions/define-command.d.ts +1 -1
  17. package/dist/extensions/define-extension.d.ts +50 -7
  18. package/dist/extensions/index.d.ts +3 -2
  19. package/dist/extensions/index.js +120 -11
  20. package/dist/extensions/kernel-slots.d.ts +36 -35
  21. package/dist/extensions/params.d.ts +19 -12
  22. package/dist/extensions/refs.d.ts +3 -3
  23. package/dist/extensions/slots.d.ts +1 -9
  24. package/dist/extensions/types/commands.d.ts +8 -0
  25. package/dist/extensions/types/context.d.ts +191 -12
  26. package/dist/extensions/types/contributions.d.ts +183 -10
  27. package/dist/extensions/types/extension.d.ts +16 -10
  28. package/dist/extensions/types/params.d.ts +43 -29
  29. package/dist/extensions/types/slots.d.ts +1 -1
  30. package/dist/extensions/types/webview-capabilities.d.ts +12 -2
  31. package/dist/extensions/workbench-targets.d.ts +134 -0
  32. package/dist/hooks/attempt.d.ts +2 -0
  33. package/dist/hooks/entities.d.ts +2 -0
  34. package/dist/hooks/index.d.ts +1 -1
  35. package/dist/hooks/ticket.d.ts +3 -0
  36. package/dist/resources/index.js +2 -2
  37. package/dist/resources/status.d.ts +1 -0
  38. package/dist/resources/tag.d.ts +1 -0
  39. package/dist/resources/ticket.d.ts +1 -0
  40. package/dist/resources/workspace.d.ts +4 -1
  41. package/package.json +2 -6
  42. package/dist/api/actions.d.ts +0 -13
  43. package/dist/client/actions.d.ts +0 -8
  44. package/dist/plugins/define-plugin.d.ts +0 -2
  45. package/dist/plugins/helpers/context.d.ts +0 -24
  46. package/dist/plugins/helpers/create-attempt.d.ts +0 -5
  47. package/dist/plugins/helpers/create-session.d.ts +0 -21
  48. package/dist/plugins/helpers/create-workspace.d.ts +0 -5
  49. package/dist/plugins/helpers/find-ticket-by-ref.d.ts +0 -6
  50. package/dist/plugins/helpers/find-workspace-by-ref.d.ts +0 -5
  51. package/dist/plugins/helpers/followup-session.d.ts +0 -29
  52. package/dist/plugins/helpers/get-attempts-for-ticket.d.ts +0 -17
  53. package/dist/plugins/helpers/index.d.ts +0 -16
  54. package/dist/plugins/helpers/remove-all-worktrees-for-ticket.d.ts +0 -2
  55. package/dist/plugins/helpers/run-command.d.ts +0 -10
  56. package/dist/plugins/helpers/save-ticket.d.ts +0 -14
  57. package/dist/plugins/helpers/set-ticket-status.d.ts +0 -7
  58. package/dist/plugins/helpers/set-workspace-attempt-status.d.ts +0 -7
  59. package/dist/plugins/helpers/ticket-pull.d.ts +0 -18
  60. package/dist/plugins/helpers/update-ticket-when-all-attempts-match.d.ts +0 -7
  61. package/dist/plugins/helpers/workspaces-for-ticket.d.ts +0 -17
  62. package/dist/plugins/helpers/worktree-bootstrap.d.ts +0 -8
  63. package/dist/plugins/hooks.d.ts +0 -42
  64. package/dist/plugins/index.d.ts +0 -5
  65. package/dist/plugins/index.js +0 -739
  66. package/dist/plugins/types.d.ts +0 -112
@@ -37,7 +37,6 @@ var defineSlot = (id, options) => ({
37
37
 
38
38
  // src/extensions/kernel-slots.ts
39
39
  var projectSlots = {
40
- sidebarNav: defineSlot("project.sidebarNav", { kind: "navigation" }),
41
40
  sidebar: defineSlot("project.sidebar", { kind: "view" }),
42
41
  headerPrimary: defineSlot("project.headerPrimary", { kind: "menu" }),
43
42
  headerOverflow: defineSlot("project.headerOverflow", { kind: "menu" }),
@@ -49,10 +48,13 @@ var sessionSlots = {
49
48
  headerOverflow: defineSlot("session.headerOverflow", { kind: "menu" }),
50
49
  transcriptActions: defineSlot("session.transcriptActions", { kind: "menu" })
51
50
  };
51
+ var ticketSlots = {
52
+ headerPrimary: defineSlot("ticket.headerPrimary", { kind: "menu" }),
53
+ headerOverflow: defineSlot("ticket.headerOverflow", { kind: "menu" })
54
+ };
52
55
  var workspaceSlots = {
53
56
  headerPrimary: defineSlot("workspace.headerPrimary", { kind: "menu" }),
54
57
  headerOverflow: defineSlot("workspace.headerOverflow", { kind: "menu" }),
55
- tabs: defineSlot("workspace.tabs", { kind: "navigation" }),
56
58
  sidebar: defineSlot("workspace.sidebar", { kind: "view" })
57
59
  };
58
60
  var projectEvents = {
@@ -101,17 +103,17 @@ var packageAsset = (path, baseUrl) => ({
101
103
  });
102
104
  // src/extensions/params.ts
103
105
  var params = {
104
- text: (options = {}) => ({ type: "text", ...options }),
105
- longText: (options = {}) => ({ type: "longtext", ...options }),
106
- number: (options = {}) => ({ type: "number", ...options }),
107
- boolean: (options = {}) => ({ type: "boolean", ...options }),
106
+ text: (options) => ({ type: "text", ...options }),
107
+ longText: (options) => ({ type: "longtext", ...options }),
108
+ number: (options) => ({ type: "number", ...options }),
109
+ boolean: (options) => ({ type: "boolean", ...options }),
108
110
  select: (options) => ({ type: "select", ...options }),
109
111
  multiSelect: (options) => ({
110
112
  type: "multi-select",
111
113
  ...options
112
114
  }),
113
- repo: (options = {}) => ({ type: "repo", ...options }),
114
- harness: (options = {}) => ({ type: "harness", ...options }),
115
+ repo: (options) => ({ type: "repo", ...options }),
116
+ harness: (options) => ({ type: "harness", ...options }),
115
117
  template: (options) => ({
116
118
  label: options.label,
117
119
  description: options.description,
@@ -122,7 +124,7 @@ var params = {
122
124
  templateType: options.type
123
125
  }),
124
126
  resource: (options) => ({ type: "resource", ...options }),
125
- json: (options = {}) => ({ type: "json", ...options })
127
+ json: (options) => ({ type: "json", ...options })
126
128
  };
127
129
  // src/extensions/types/extension.ts
128
130
  var EXTENSION_API_VERSION = "1.0.0";
@@ -133,18 +135,125 @@ var WEBVIEW_DECLARABLE_CAPABILITIES = [
133
135
  "resource.open",
134
136
  "notification.show",
135
137
  "preferences.get",
136
- "preferences.set"
138
+ "preferences.set",
139
+ "extension.settings.all",
140
+ "extension.settings.get",
141
+ "extension.settings.set",
142
+ "extension.settings.delete"
137
143
  ];
138
144
  var ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES = ["host.dispatchKeyboardEvent"];
139
145
  var WEBVIEW_HOST_CAPABILITIES = [
140
146
  ...WEBVIEW_DECLARABLE_CAPABILITIES,
141
147
  ...ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES
142
148
  ];
149
+ // src/extensions/workbench-targets.ts
150
+ var workbenchMenuTargets = [
151
+ "workbench.nav.actions",
152
+ "workbench.nav.overflow",
153
+ "workbench.commandPalette"
154
+ ];
155
+ var workbenchTreeTargets = [
156
+ "workbench.left.tree",
157
+ "workbench.main.left.tree",
158
+ "workbench.main.right.tree"
159
+ ];
160
+ var workbenchViewTargets = [
161
+ "workbench.main",
162
+ "workbench.main.left",
163
+ "workbench.main.right",
164
+ "workbench.secondary"
165
+ ];
166
+ var workbenchSettingsTargets = ["workbench.settings"];
167
+ var workbenchSettingsScopes = ["project", "global"];
168
+ var workbenchModeLayoutTargets = [
169
+ "workbench.left",
170
+ "workbench.main.left",
171
+ "workbench.main",
172
+ "workbench.main.right",
173
+ "workbench.secondary"
174
+ ];
175
+ var workbenchTargets = [
176
+ {
177
+ id: "workbench.nav.actions",
178
+ allowedKinds: ["menu"],
179
+ granularity: "surface",
180
+ rationale: "Primary command surface in the host-owned nav (top) workbench chrome."
181
+ },
182
+ {
183
+ id: "workbench.nav.overflow",
184
+ allowedKinds: ["menu"],
185
+ granularity: "surface",
186
+ rationale: "Secondary command surface in the host-owned nav (top) workbench chrome."
187
+ },
188
+ {
189
+ id: "workbench.commandPalette",
190
+ allowedKinds: ["menu"],
191
+ granularity: "surface",
192
+ rationale: "Global command discovery surface owned by the workbench."
193
+ },
194
+ {
195
+ id: "workbench.left.tree",
196
+ allowedKinds: ["treeItem"],
197
+ granularity: "areaTree",
198
+ rationale: "Tree entries for the active tree renderer mounted in the left area."
199
+ },
200
+ {
201
+ id: "workbench.main.left.tree",
202
+ allowedKinds: ["treeItem"],
203
+ granularity: "areaTree",
204
+ rationale: "Tree entries for the active tree renderer mounted in the main-left area."
205
+ },
206
+ {
207
+ id: "workbench.main.right.tree",
208
+ allowedKinds: ["treeItem"],
209
+ granularity: "areaTree",
210
+ rationale: "Tree entries for the active tree renderer mounted in the main-right area."
211
+ },
212
+ {
213
+ id: "workbench.main",
214
+ allowedKinds: ["view"],
215
+ granularity: "area",
216
+ rationale: "Direct extension view placement in the main area."
217
+ },
218
+ {
219
+ id: "workbench.main.left",
220
+ allowedKinds: ["view"],
221
+ granularity: "area",
222
+ rationale: "Direct extension view placement in the main-left area."
223
+ },
224
+ {
225
+ id: "workbench.main.right",
226
+ allowedKinds: ["view"],
227
+ granularity: "area",
228
+ rationale: "Direct extension view placement in the main-right area."
229
+ },
230
+ {
231
+ id: "workbench.secondary",
232
+ allowedKinds: ["view"],
233
+ granularity: "area",
234
+ rationale: "Direct extension view placement in the secondary area."
235
+ },
236
+ {
237
+ id: "workbench.settings",
238
+ allowedKinds: ["settings"],
239
+ granularity: "surface",
240
+ rationale: "Settings panel placement in host-owned settings navigation."
241
+ }
242
+ ];
243
+ var getWorkbenchTargetDefinition = (id) => workbenchTargets.find((target) => target.id === id);
143
244
  export {
144
245
  worktreeEvents,
145
246
  workspaceSlots,
146
247
  workspaceEvents,
147
248
  workspaceCommands,
249
+ workbenchViewTargets,
250
+ workbenchTreeTargets,
251
+ workbenchTargets,
252
+ workbenchSettingsTargets,
253
+ workbenchSettingsScopes,
254
+ workbenchModeLayoutTargets,
255
+ workbenchMenuTargets,
256
+ ticketSlots,
148
257
  ticketEvents,
149
258
  sessionSlots,
150
259
  sessionEvents,
@@ -153,8 +262,8 @@ export {
153
262
  params,
154
263
  packageAsset,
155
264
  gitEvents,
265
+ getWorkbenchTargetDefinition,
156
266
  eventRef,
157
- defineSlot,
158
267
  defineMiddleware,
159
268
  defineHook,
160
269
  defineExtensionView,
@@ -1,21 +1,9 @@
1
- import type { SetAttemptStatusInput, SetAttemptStatusResult } from "./types/context";
2
- import type { JsonObject } from "./types/json";
1
+ import type { ExtensionTicket, ExtensionWorkspace, SetAttemptStatusInput, SetAttemptStatusResult } from "./types/context";
3
2
  import type { ResourceAnchor } from "./types/resources";
3
+ /** @deprecated Legacy core ticket event payload. Ticket events are owned by the pstdio tickets extension. */
4
4
  export interface TicketArchivedEventPayload {
5
5
  projectId: string;
6
- ticket: {
7
- id: string;
8
- shorthand: string;
9
- displayTitle: string | null;
10
- userPrompt: string | null;
11
- parentId: string | null;
12
- draft: boolean;
13
- archived: boolean;
14
- status: string | null;
15
- tagIds: string[];
16
- tagNames: string[];
17
- fileIds: string[];
18
- };
6
+ ticket: ExtensionTicket;
19
7
  }
20
8
  export interface WorktreeCreatedEventPayload {
21
9
  projectId: string;
@@ -24,49 +12,55 @@ export interface WorktreeCreatedEventPayload {
24
12
  branch: string;
25
13
  workspace: string;
26
14
  workspaceId: string;
15
+ /** @deprecated Legacy ticket worktree linkage. Ticket worktree setup is owned by the pstdio tickets extension. */
27
16
  ticket: string;
28
17
  }
18
+ /** @deprecated Legacy core ticket event payload. Ticket events are owned by the pstdio tickets extension. */
29
19
  export interface TicketLifecyclePayload {
30
20
  projectId: string;
31
- ticket: JsonObject;
21
+ ticket: ExtensionTicket;
32
22
  }
23
+ /** @deprecated Legacy core ticket event payload. Ticket events are owned by the pstdio tickets extension. */
33
24
  export interface TicketStatusChangePayload {
34
25
  projectId: string;
35
- ticket: JsonObject;
26
+ ticket: ExtensionTicket;
36
27
  fromStatus: string | null;
37
- toStatus: string;
28
+ toStatus: string | null;
38
29
  }
39
30
  export interface AttemptStatusChangePayload {
40
31
  projectId: string;
41
32
  workspaceId: string;
42
- ticket: JsonObject | null;
33
+ /** @deprecated Legacy ticket attempt linkage. Ticket data is owned by the pstdio tickets extension. */
34
+ ticket: ExtensionTicket | null;
43
35
  fromStatus: string | null;
44
36
  toStatus: string;
45
37
  statusChangeId?: string;
46
38
  sessionId: string | null;
47
39
  originalSessionId: string | null;
48
40
  worktreePath: string | null;
49
- workspace: JsonObject;
41
+ workspace: ExtensionWorkspace;
50
42
  }
51
43
  export interface SessionLifecyclePayload {
52
44
  projectId: string;
53
45
  sessionId: string;
54
46
  sessionStatus?: string;
55
47
  originalSessionId?: string;
56
- workspace?: JsonObject;
48
+ workspace?: ExtensionWorkspace;
57
49
  workspaceId?: string;
58
50
  worktreePath?: string;
59
51
  branch?: string;
60
- ticket?: JsonObject;
52
+ /** @deprecated Legacy ticket session linkage. Ticket data is owned by the pstdio tickets extension. */
53
+ ticket?: ExtensionTicket;
61
54
  attemptStatus?: string;
62
55
  }
63
56
  export interface WorktreeRemovedPayload {
64
57
  projectId: string;
65
58
  repoPath?: string;
66
59
  worktreePath: string;
67
- workspace?: JsonObject;
60
+ workspace?: ExtensionWorkspace;
68
61
  workspaceId?: string;
69
- ticket?: JsonObject | string;
62
+ /** @deprecated Legacy ticket worktree linkage. Ticket data is owned by the pstdio tickets extension. */
63
+ ticket?: ExtensionTicket | string;
70
64
  }
71
65
  export interface CommitPayload {
72
66
  projectId: string;
@@ -74,16 +68,17 @@ export interface CommitPayload {
74
68
  worktreePath?: string;
75
69
  branch?: string;
76
70
  commitSha?: string;
77
- workspace?: JsonObject;
78
- ticket?: JsonObject | string;
71
+ workspace?: ExtensionWorkspace;
72
+ /** @deprecated Legacy ticket git linkage. Ticket data is owned by the pstdio tickets extension. */
73
+ ticket?: ExtensionTicket | string;
79
74
  }
80
75
  export interface RebasePayload {
81
76
  projectId: string;
82
77
  repoPath?: string;
83
78
  worktreePath?: string;
84
79
  branch?: string;
85
- workspace?: JsonObject;
86
- ticket?: JsonObject | string;
80
+ workspace?: ExtensionWorkspace;
81
+ ticket?: ExtensionTicket | string;
87
82
  }
88
83
  export interface MergePayload extends CommitPayload {
89
84
  }
@@ -93,11 +88,11 @@ export interface ConflictPayload {
93
88
  repoPath?: string;
94
89
  worktreePath?: string;
95
90
  branch?: string;
96
- workspace?: JsonObject;
97
- ticket?: JsonObject | string;
91
+ workspace?: ExtensionWorkspace;
92
+ /** @deprecated Legacy ticket git linkage. Ticket data is owned by the pstdio tickets extension. */
93
+ ticket?: ExtensionTicket | string;
98
94
  }
99
95
  export declare const projectSlots: {
100
- sidebarNav: import("./types").SlotRef<object, "navigation">;
101
96
  sidebar: import("./types").SlotRef<object, "view">;
102
97
  headerPrimary: import("./types").SlotRef<object, "menu">;
103
98
  headerOverflow: import("./types").SlotRef<object, "menu">;
@@ -109,10 +104,14 @@ export declare const sessionSlots: {
109
104
  headerOverflow: import("./types").SlotRef<object, "menu">;
110
105
  transcriptActions: import("./types").SlotRef<object, "menu">;
111
106
  };
107
+ /** @deprecated Legacy core ticket slots. Ticket UI contributions are owned by the pstdio tickets extension. */
108
+ export declare const ticketSlots: {
109
+ headerPrimary: import("./types").SlotRef<object, "menu">;
110
+ headerOverflow: import("./types").SlotRef<object, "menu">;
111
+ };
112
112
  export declare const workspaceSlots: {
113
113
  headerPrimary: import("./types").SlotRef<object, "menu">;
114
114
  headerOverflow: import("./types").SlotRef<object, "menu">;
115
- tabs: import("./types").SlotRef<object, "navigation">;
116
115
  sidebar: import("./types").SlotRef<object, "view">;
117
116
  };
118
117
  export declare const projectEvents: {
@@ -132,6 +131,7 @@ export declare const sessionEvents: {
132
131
  anchors?: ResourceAnchor[];
133
132
  }>;
134
133
  };
134
+ /** @deprecated Legacy core ticket events. Ticket events are owned by the pstdio tickets extension. */
135
135
  export declare const ticketEvents: {
136
136
  created: import("./types").EventRef<TicketLifecyclePayload>;
137
137
  statusChanged: import("./types").EventRef<TicketStatusChangePayload>;
@@ -140,13 +140,13 @@ export declare const ticketEvents: {
140
140
  };
141
141
  export declare const workspaceEvents: {
142
142
  created: import("./types").EventRef<{
143
- workspace: JsonObject;
143
+ workspace: ExtensionWorkspace;
144
144
  }>;
145
145
  archived: import("./types").EventRef<{
146
- workspace: JsonObject;
146
+ workspace: ExtensionWorkspace;
147
147
  }>;
148
148
  deleted: import("./types").EventRef<{
149
- workspace: JsonObject;
149
+ workspace: ExtensionWorkspace;
150
150
  }>;
151
151
  };
152
152
  export declare const worktreeEvents: {
@@ -159,6 +159,7 @@ export declare const gitEvents: {
159
159
  merged: import("./types").EventRef<MergePayload>;
160
160
  conflicted: import("./types").EventRef<ConflictPayload>;
161
161
  };
162
+ /** @deprecated Legacy ticket attempt status events. Workspace status automation is extension-owned. */
162
163
  export declare const attemptStatusEvents: {
163
164
  changed: import("./types").EventRef<AttemptStatusChangePayload>;
164
165
  };
@@ -1,4 +1,10 @@
1
1
  import type { BooleanParam, HarnessParam, JsonParam, LongTextParam, MultiSelectParam, NumberParam, RepoParam, ResourceParam, SelectParam, TemplateParam, TextParam } from "./types/params";
2
+ type RequiredOf<TOptions> = TOptions extends {
3
+ required: infer TRequired extends boolean;
4
+ } ? TRequired : undefined;
5
+ type ParamOptions<TParam extends {
6
+ type: string;
7
+ }> = Omit<TParam, "type">;
2
8
  /**
3
9
  * Builders for typed parameter descriptors. Each builder produces a discriminated
4
10
  * `ParamDescriptor` so the runtime and editor only see fields valid for that type.
@@ -10,17 +16,18 @@ import type { BooleanParam, HarnessParam, JsonParam, LongTextParam, MultiSelectP
10
16
  * }
11
17
  */
12
18
  export declare const params: {
13
- text: (options?: Omit<TextParam, "type">) => TextParam;
14
- longText: (options?: Omit<LongTextParam, "type">) => LongTextParam;
15
- number: (options?: Omit<NumberParam, "type">) => NumberParam;
16
- boolean: (options?: Omit<BooleanParam, "type">) => BooleanParam;
17
- select: (options: Omit<SelectParam, "type">) => SelectParam;
18
- multiSelect: (options: Omit<MultiSelectParam, "type">) => MultiSelectParam;
19
- repo: (options?: Omit<RepoParam, "type">) => RepoParam;
20
- harness: (options?: Omit<HarnessParam, "type">) => HarnessParam;
21
- template: (options: Omit<TemplateParam, "type" | "templateType"> & {
19
+ text: <const TOptions extends ParamOptions<TextParam> | undefined = undefined>(options?: TOptions) => TextParam<RequiredOf<TOptions>>;
20
+ longText: <const TOptions extends ParamOptions<LongTextParam> | undefined = undefined>(options?: TOptions) => LongTextParam<RequiredOf<TOptions>>;
21
+ number: <const TOptions extends ParamOptions<NumberParam> | undefined = undefined>(options?: TOptions) => NumberParam<RequiredOf<TOptions>>;
22
+ boolean: <const TOptions extends ParamOptions<BooleanParam> | undefined = undefined>(options?: TOptions) => BooleanParam<RequiredOf<TOptions>>;
23
+ select: <const TOptions extends ParamOptions<SelectParam>>(options: TOptions) => SelectParam<RequiredOf<TOptions>>;
24
+ multiSelect: <const TOptions extends ParamOptions<MultiSelectParam>>(options: TOptions) => MultiSelectParam<RequiredOf<TOptions>>;
25
+ repo: <const TOptions extends ParamOptions<RepoParam> | undefined = undefined>(options?: TOptions) => RepoParam<RequiredOf<TOptions>>;
26
+ harness: <const TOptions extends ParamOptions<HarnessParam> | undefined = undefined>(options?: TOptions) => HarnessParam<RequiredOf<TOptions>>;
27
+ template: <const TOptions extends Omit<TemplateParam, "type" | "templateType"> & {
22
28
  type: string;
23
- }) => TemplateParam;
24
- resource: (options: Omit<ResourceParam, "type">) => ResourceParam;
25
- json: <T = unknown>(options?: Omit<JsonParam<T>, "type">) => JsonParam<T>;
29
+ }>(options: TOptions) => TemplateParam<RequiredOf<TOptions>>;
30
+ resource: <const TOptions extends ParamOptions<ResourceParam>>(options: TOptions) => ResourceParam<RequiredOf<TOptions>>;
31
+ json: <T = unknown, const TOptions extends ParamOptions<JsonParam<T>> | undefined = undefined>(options?: TOptions) => JsonParam<T, RequiredOf<TOptions>>;
26
32
  };
33
+ export {};
@@ -17,8 +17,8 @@ export declare const eventRef: <TPayload extends Struct = Struct>(id: string) =>
17
17
  * the correct shape.
18
18
  */
19
19
  export declare const commandEvent: <TPhase extends CommandLifecyclePhase, TParams extends Struct = Struct, TResult = unknown>(command: CommandRef<TParams, TResult>, phase: TPhase) => EventRef<CommandLifecycleEventPayload<TPhase, TParams, TResult>>;
20
- type CommandsRecord = Record<string, CommandDefinition<any, any>>;
21
- type CommandRefFromDefinition<TDefinition> = TDefinition extends CommandDefinition<infer TSchema, infer TResult> ? CommandRef<TSchema extends ParamObjectSchema ? ParamsOf<TSchema> : Struct, TResult> : never;
20
+ type CommandsRecord = Record<string, CommandDefinition<any, any, any>>;
21
+ type CommandRefFromDefinition<TDefinition> = TDefinition extends CommandDefinition<infer TSchema, infer TResult, infer _TSettings> ? CommandRef<TSchema extends ParamObjectSchema ? ParamsOf<TSchema> : Struct, TResult> : never;
22
22
  type CommandsRefMap<TCommands extends CommandsRecord> = {
23
23
  [K in keyof TCommands]: CommandRefFromDefinition<TCommands[K]>;
24
24
  };
@@ -32,7 +32,7 @@ type CommandsRefMap<TCommands extends CommandsRecord> = {
32
32
  * @example
33
33
  * const ext = defineExtension({ commands: { ... } });
34
34
  * const labCommands = commandsOf("extension-lab", ext);
35
- * labCommands.awaken; // CommandRef<{ title: string }, ...>
35
+ * labCommands.awaken; // CommandRef<{ title?: string }, ...>
36
36
  */
37
37
  export declare const commandsOf: <TExtension extends {
38
38
  commands?: CommandsRecord;
@@ -1,14 +1,6 @@
1
1
  import type { Struct } from "./types/json";
2
2
  import type { SlotOptions, SlotRef, UiSlotKind } from "./types/slots";
3
3
  /**
4
- * Define a UI slot that contributions can target. The `TContext` parameter constrains
5
- * the data passed to renderers/menus invoked through the slot, and `TKind` picks the
6
- * contribution shape (`menu`, `navigation`, `view`, `settings`, `renderer`).
7
- *
8
- * @example
9
- * export const projectHeader = defineSlot<{ projectId: string }, "menu">("project.header", {
10
- * kind: "menu",
11
- * label: "Project header",
12
- * });
4
+ * Define a host-owned UI slot that extension contributions can target.
13
5
  */
14
6
  export declare const defineSlot: <TContext extends Struct = Struct, TKind extends UiSlotKind = UiSlotKind>(id: string, options: SlotOptions<TKind>) => SlotRef<TContext, TKind>;
@@ -1,3 +1,4 @@
1
+ import type { WorkbenchAttachmentTarget } from "../workbench-targets";
1
2
  import type { JsonObject, JsonValue, Struct } from "./json";
2
3
  import type { RepoContext, ResourceRef } from "./resources";
3
4
  import type { SlotInvocationContext } from "./slots";
@@ -13,11 +14,18 @@ export interface SerializedError {
13
14
  stack?: string;
14
15
  cause?: JsonValue;
15
16
  }
17
+ export interface WorkbenchAttachmentInvocationContext {
18
+ target: WorkbenchAttachmentTarget;
19
+ mode?: string;
20
+ projectId?: string;
21
+ resource?: ResourceRef;
22
+ }
16
23
  export interface CommandInvocation<TParams extends Struct = Struct> {
17
24
  params: TParams;
18
25
  resource?: ResourceRef;
19
26
  repoId?: string;
20
27
  repoPath?: string;
28
+ attachment?: WorkbenchAttachmentInvocationContext;
21
29
  slot?: SlotInvocationContext;
22
30
  metadata?: JsonObject;
23
31
  }