@pstdio/workbench 0.44.0 → 0.45.0-nightly.20261021030241

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.
@@ -1,56 +1,461 @@
1
- import { Cn as e, O as t, Tn as n, _n as r, an as i, dn as a, fn as o, gn as s, hn as c, on as l, pn as u, sn as d, vn as f, wn as p, xn as m, yn as h } from "./workbench-renderers-Bz_dLyHW.js";
2
- import { n as g } from "./navigation-tree-registry-C5l3eO3n.js";
3
- import { l as _, st as v, u as y } from "./react-C-HbdPSw.js";
4
- import { z as b } from "zod";
5
- import { CommandOutcomeError as x, commandRefId as S, contributionRefId as C, getCommandValue as ee, isLocalizedString as te, isNavigationTarget as ne, matchesResourceWhen as re, resourceKey as w } from "@pstdio/sdk/extensions";
6
- import { c as ie } from "react/compiler-runtime";
7
- import { Box as ae, Center as oe, Stack as se, Text as ce } from "@chakra-ui/react";
8
- import { createElement as T, useEffect as E, useRef as D, useState as le } from "react";
9
- import { jsx as O, jsxs as ue } from "react/jsx-runtime";
10
- import { renderBadgeListDisplay as de } from "@pstdio/ui/kanban-renderer";
11
- import { host as fe } from "rimless";
12
- //#region ../pstdio-api-contracts/src/extension-kernel/l10n.ts
13
- var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n == "string", k = (e) => !(!e || typeof e != "object" || Array.isArray(e)), A = (e, t) => k(e) && e.kind === t && typeof e.id == "string", me = (e) => k(e) && typeof e.type == "string" && typeof e.id == "string", he = (e) => e === void 0 || e === "preview" || e === "pin", ge = (t, n = /* @__PURE__ */ new Set()) => {
14
- if (!k(t) || t.kind !== "page" || !A(t.page, "page") || n.has(t) || t.resource !== void 0 && !me(t.resource) || t.section !== void 0 && !k(t.section) || t.position !== void 0 && (!e(t.position) || t.section !== void 0) || !he(t.open)) return !1;
15
- if (t.parent === void 0) return !0;
16
- let r = new Set(n);
17
- return r.add(t), ge(t.parent, r);
18
- }, _e = (e) => {
19
- if (!k(e) || e.kind !== "panel" || !k(e.panel)) return !1;
1
+ import { Ct as e, St as t, Tt as n, _t as r, bt as i, ct as a, dt as o, l as s, lt as c, u as l, ut as u, vt as d, wt as f, xt as p } from "./react-hsii-4ZV.js";
2
+ import { n as m, r as h } from "./navigation-tree-registry-BsMNSEyZ.js";
3
+ import { D as g, dn as _, fn as v } from "./workbench-renderers-Ku0_knjs.js";
4
+ import { z as y } from "zod";
5
+ import { CommandOutcomeError as b, commandRefId as x, contributionRefId as S, getCommandValue as C, isLocalizedString as w, isNavigationTarget as T, matchesResourceWhen as ee, resourceKey as E } from "@pstdio/sdk/extensions";
6
+ import { c as te } from "react/compiler-runtime";
7
+ import { Box as ne, Center as re, Stack as ie, Text as ae } from "@chakra-ui/react";
8
+ import { createElement as D, useEffect as O, useRef as k, useState as A } from "react";
9
+ import { jsx as j, jsxs as oe } from "react/jsx-runtime";
10
+ import { renderBadgeListDisplay as se } from "@pstdio/ui/kanban-renderer";
11
+ import { host as ce } from "rimless";
12
+ //#region ../pstdio-api-contracts/src/extension-kernel/workbench-targets.ts
13
+ var le = ["workbench.nav.actions", "workbench.nav.overflow"], ue = [
14
+ "workbench.left.tree",
15
+ "workbench.main.left.tree",
16
+ "workbench.main.right.tree"
17
+ ], de = [
18
+ "nav",
19
+ "activity",
20
+ "sidenav",
21
+ "main-header",
22
+ "main",
23
+ "secondary-header",
24
+ "secondary",
25
+ "side-header",
26
+ "side",
27
+ "status",
28
+ "overlay"
29
+ ], fe = [
30
+ "workbench.main",
31
+ "workbench.main.left",
32
+ "workbench.main.right",
33
+ "workbench.secondary"
34
+ ], pe = ["workbench.settings"], me = ["project", "global"], he = [
35
+ "workbench.left",
36
+ "workbench.main.left",
37
+ "workbench.main",
38
+ "workbench.main.right",
39
+ "workbench.secondary"
40
+ ], ge = y.enum(le), _e = y.enum(ue);
41
+ y.enum(de);
42
+ var ve = y.enum(fe), ye = y.enum(pe);
43
+ y.enum(he);
44
+ var be = y.union([
45
+ ge,
46
+ _e,
47
+ ve,
48
+ ye
49
+ ]);
50
+ y.enum(me);
51
+ //#endregion
52
+ //#region ../pstdio-api-contracts/src/extension-kernel/types/composition.ts
53
+ var xe = [
54
+ "main",
55
+ "secondary",
56
+ "side"
57
+ ], Se = (e) => {
58
+ if (typeof e != "string") return !1;
59
+ try {
60
+ let { protocol: t } = new URL(e);
61
+ return t === "https:" || t === "http:";
62
+ } catch {
63
+ return !1;
64
+ }
65
+ }, Ce = y.union([
66
+ y.string(),
67
+ y.number(),
68
+ y.boolean(),
69
+ y.array(y.string())
70
+ ]);
71
+ y.record(y.string(), y.discriminatedUnion("type", [
72
+ y.object({
73
+ type: y.literal("string"),
74
+ default: y.string().optional(),
75
+ values: y.array(y.string()).readonly().optional()
76
+ }).strict(),
77
+ y.object({
78
+ type: y.literal("number"),
79
+ default: y.number().optional()
80
+ }).strict(),
81
+ y.object({
82
+ type: y.literal("boolean"),
83
+ default: y.boolean().optional()
84
+ }).strict(),
85
+ y.object({
86
+ type: y.literal("string[]"),
87
+ default: y.array(y.string()).readonly().optional()
88
+ }).strict()
89
+ ])).superRefine((e, t) => {
90
+ try {
91
+ v(e);
92
+ } catch (e) {
93
+ t.addIssue({
94
+ code: "custom",
95
+ message: String(e)
96
+ });
97
+ }
98
+ });
99
+ //#endregion
100
+ //#region ../pstdio-api-contracts/src/extensions/workbench-refs-metadata.ts
101
+ var M = (e) => y.object({
102
+ extensionId: y.string(),
103
+ kind: y.literal(e),
104
+ id: y.string()
105
+ }), we = M("page"), Te = M("placement");
106
+ M("mode"), M("view"), M("resource-kind");
107
+ var Ee = y.object({
108
+ kind: y.literal("page-slot"),
109
+ page: we,
110
+ id: y.string()
111
+ }), De = y.union([Te, Ee]), Oe = y.object({
112
+ command: M("command"),
113
+ params: n.optional()
114
+ }), ke = y.object({
115
+ line: y.number().int().positive(),
116
+ column: y.number().int().positive().optional(),
117
+ endLine: y.number().int().positive().optional(),
118
+ endColumn: y.number().int().positive().optional()
119
+ }).refine(h, "Expected ordered source coordinates"), Ae = y.object({ anchors: y.array(y.object({
120
+ id: y.string(),
121
+ heading: y.string(),
122
+ occurrence: y.number().int().nonnegative().optional()
123
+ })) }), je = y.lazy(() => y.object({
124
+ kind: y.literal("page"),
125
+ page: we,
126
+ resource: p.optional(),
127
+ open: y.enum(["preview", "pin"]).optional(),
128
+ section: Ae.optional(),
129
+ position: ke.optional(),
130
+ params: y.record(y.string(), Ce).optional(),
131
+ parent: je.optional()
132
+ }).refine((e) => !(e.position && e.section), "Choose a source position or a heading section")).meta({ id: "WorkbenchMetadataPageTarget" }), Me = y.union([je, y.object({
133
+ kind: y.literal("panel"),
134
+ panel: De,
135
+ resource: p.optional(),
136
+ open: y.enum(["preview", "pin"]).optional()
137
+ })]), Ne = y.union([
138
+ Me,
139
+ y.object({
140
+ kind: y.literal("command"),
141
+ target: Oe
142
+ }),
143
+ y.object({
144
+ kind: y.literal("href"),
145
+ href: y.string().refine(Se, "Expected an HTTP or HTTPS URL")
146
+ }),
147
+ y.object({
148
+ kind: y.literal("compound"),
149
+ targets: y.array(Me).min(1)
150
+ })
151
+ ]), Pe = y.object({
152
+ type: y.enum([
153
+ "info",
154
+ "success",
155
+ "warning",
156
+ "error"
157
+ ]),
158
+ title: y.string().optional(),
159
+ message: y.string(),
160
+ metadata: n.optional()
161
+ }), Fe = y.object({
162
+ code: y.string(),
163
+ message: y.string(),
164
+ severity: y.enum([
165
+ "info",
166
+ "warning",
167
+ "error"
168
+ ]),
169
+ extensionId: y.string().optional(),
170
+ commandId: y.string().optional(),
171
+ metadata: n.optional()
172
+ }), Ie = (e) => {
173
+ let t = y.object({
174
+ name: y.string().optional(),
175
+ message: y.string(),
176
+ stack: y.string().optional(),
177
+ cause: e.optional()
178
+ }), r = {
179
+ notices: y.array(Pe).optional(),
180
+ diagnostics: y.array(Fe).optional()
181
+ }, i = {
182
+ ...r,
183
+ ok: y.literal(!1),
184
+ code: y.string().optional(),
185
+ reason: y.string(),
186
+ data: n.optional(),
187
+ cause: e.optional(),
188
+ error: t.optional()
189
+ }, a = Ne;
190
+ return y.discriminatedUnion("status", [
191
+ y.object({
192
+ ...r,
193
+ ok: y.literal(!0),
194
+ status: y.literal("success"),
195
+ value: y.unknown().optional(),
196
+ navigationRequests: y.array(a).optional()
197
+ }).transform((e) => ({
198
+ ...e,
199
+ value: e.value
200
+ })),
201
+ y.object({
202
+ ...i,
203
+ status: y.literal("rejected")
204
+ }),
205
+ y.object({
206
+ ...i,
207
+ status: y.literal("error")
208
+ })
209
+ ]);
210
+ }, Le = Ie(y.json()), Re = y.object({
211
+ id: y.string(),
212
+ kind: e,
213
+ context: f
214
+ }), ze = y.object({
215
+ target: be,
216
+ mode: y.string().optional(),
217
+ projectId: y.string().optional(),
218
+ resource: p.optional()
219
+ });
220
+ y.object({
221
+ rendererId: y.string(),
222
+ pageParams: y.record(y.string(), Ce).optional(),
223
+ projectId: y.string().optional(),
224
+ modeId: y.string().optional(),
225
+ resource: p.optional(),
226
+ invocation: y.object({ placement: y.enum(["visible", "background"]) }).optional()
227
+ }), y.object({
228
+ projectId: y.string().min(1),
229
+ workspaceId: y.string().optional(),
230
+ params: f.optional(),
231
+ resource: p.optional(),
232
+ attachment: ze.optional(),
233
+ slot: Re.optional(),
234
+ source: t.optional(),
235
+ metadata: f.optional()
236
+ }), y.object({
237
+ workspaceId: y.string().optional(),
238
+ params: f.optional(),
239
+ resource: p.optional(),
240
+ attachment: ze.optional(),
241
+ slot: Re.optional(),
242
+ source: t.optional(),
243
+ metadata: f.optional()
244
+ }), y.object({
245
+ eventId: y.string().min(1),
246
+ payload: f
247
+ }).strict();
248
+ var Be = Ne, Ve = y.object({
249
+ ok: y.boolean(),
250
+ status: y.enum([
251
+ "success",
252
+ "rejected",
253
+ "error"
254
+ ]),
255
+ value: y.unknown().optional(),
256
+ navigationRequests: y.array(Be).optional(),
257
+ code: y.string().optional(),
258
+ reason: y.string().optional(),
259
+ data: f.optional(),
260
+ error: y.object({
261
+ name: y.string().optional(),
262
+ message: y.string(),
263
+ stack: y.string().optional()
264
+ }).optional(),
265
+ notices: y.array(y.object({
266
+ type: y.enum([
267
+ "info",
268
+ "success",
269
+ "warning",
270
+ "error"
271
+ ]),
272
+ title: y.string().optional(),
273
+ message: y.string(),
274
+ metadata: f.optional()
275
+ })).optional(),
276
+ diagnostics: y.array(y.object({
277
+ code: y.string(),
278
+ message: y.string(),
279
+ severity: y.enum([
280
+ "info",
281
+ "warning",
282
+ "error"
283
+ ]),
284
+ extensionId: y.string().optional(),
285
+ commandId: y.string().optional(),
286
+ metadata: f.optional()
287
+ })).optional()
288
+ }), He = {
289
+ commandId: y.string(),
290
+ extensionId: y.string(),
291
+ eventIds: y.array(y.string()).optional()
292
+ };
293
+ y.object({
294
+ ...He,
295
+ outcome: Ve
296
+ });
297
+ var Ue = ((e) => y.object({
298
+ ...He,
299
+ outcome: Ie(e)
300
+ }))(y.json()), We = [
301
+ "is-any-of",
302
+ "is-none-of",
303
+ "is-empty",
304
+ "is-not-empty"
305
+ ], Ge = {
306
+ boolean: [
307
+ "is",
308
+ "is-not",
309
+ "is-empty",
310
+ "is-not-empty"
311
+ ],
312
+ string: [
313
+ "contains",
314
+ "does-not-contain",
315
+ "is",
316
+ "is-not",
317
+ "is-empty",
318
+ "is-not-empty"
319
+ ],
320
+ number: [
321
+ "is",
322
+ "is-not",
323
+ "gt",
324
+ "gte",
325
+ "lt",
326
+ "lte",
327
+ "is-empty",
328
+ "is-not-empty"
329
+ ],
330
+ date: [
331
+ "is",
332
+ "is-before",
333
+ "is-after",
334
+ "is-on-or-before",
335
+ "is-on-or-after",
336
+ "is-empty",
337
+ "is-not-empty"
338
+ ],
339
+ enum: We,
340
+ status: We,
341
+ user: We,
342
+ "enum-multi": [
343
+ "has-any-of",
344
+ "has-all-of",
345
+ "has-none-of",
346
+ "is-empty",
347
+ "is-not-empty"
348
+ ]
349
+ }, Ke = {
350
+ conjunction: "and",
351
+ rules: []
352
+ }, qe = [...new Set(Object.values(Ge).flat())], Je = y.enum(qe), Ye = y.object({
353
+ attributeId: y.string().min(1),
354
+ condition: Je,
355
+ value: y.union([
356
+ y.boolean(),
357
+ y.string(),
358
+ y.number(),
359
+ y.array(y.string())
360
+ ]).optional()
361
+ }), Xe = y.strictObject({
362
+ conjunction: y.enum(["and", "or"]),
363
+ rules: y.array(Ye)
364
+ });
365
+ Xe.extend({ groups: y.array(Xe).optional() }).refine((e) => !e.groups?.length || e.conjunction === "and", { message: "Normal rules and advanced groups combine using AND" });
366
+ var Ze = y.object({
367
+ attributeId: y.string().min(1),
368
+ direction: y.enum(["asc", "desc"])
369
+ });
370
+ y.array(Ze).max(1, "A view allows only one sort");
371
+ //#endregion
372
+ //#region ../pstdio-api-contracts/src/extension-kernel/types/data-table-renderer.ts
373
+ var Qe = {
374
+ grouping: "none",
375
+ rowNumbers: !0,
376
+ wrapRows: !1,
377
+ showStats: !0,
378
+ hiddenColumns: [],
379
+ columnOrder: []
380
+ }, $e = {
381
+ viewMode: "board",
382
+ columnGrouping: "none",
383
+ rowGrouping: "none",
384
+ displayProperties: []
385
+ }, et = (e, t) => {
386
+ let n = {
387
+ ...e,
388
+ ...t.defaultSettings
389
+ };
390
+ return t.defaultViews?.length ? {
391
+ settings: n,
392
+ views: t.defaultViews.map((e) => ({
393
+ ...e,
394
+ settings: {
395
+ ...n,
396
+ ...e.settings
397
+ },
398
+ filter: e.filter ?? Ke,
399
+ sorts: e.sorts ?? [],
400
+ builtIn: !0
401
+ }))
402
+ } : {
403
+ settings: n,
404
+ views: [{
405
+ id: "default",
406
+ title: "All",
407
+ settings: n,
408
+ filter: t.defaultFilter ?? Ke,
409
+ sorts: t.defaultSorts ?? [],
410
+ builtIn: !0
411
+ }]
412
+ };
413
+ }, tt = (e) => et($e, e), nt = (e) => et(Qe, e), rt = y.object({
414
+ resource: p,
415
+ autoOpen: y.boolean().optional(),
416
+ region: y.enum(xe),
417
+ open: y.enum(["preview", "pin"]).optional()
418
+ }), it = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n == "string", N = (e) => !(!e || typeof e != "object" || Array.isArray(e)), P = (e, t) => N(e) && e.kind === t && typeof e.id == "string", at = (e) => N(e) && typeof e.type == "string" && typeof e.id == "string", ot = (e) => e === void 0 || e === "preview" || e === "pin", st = (e, t = /* @__PURE__ */ new Set()) => {
419
+ if (!N(e) || e.kind !== "page" || !P(e.page, "page") || t.has(e) || e.resource !== void 0 && !at(e.resource) || e.section !== void 0 && !N(e.section) || e.position !== void 0 && (!h(e.position) || e.section !== void 0) || !ot(e.open)) return !1;
420
+ if (e.parent === void 0) return !0;
421
+ let n = new Set(t);
422
+ return n.add(e), st(e.parent, n);
423
+ }, ct = (e) => {
424
+ if (!N(e) || e.kind !== "panel" || !N(e.panel)) return !1;
20
425
  let t = e.panel;
21
- return (A(t, "placement") || t.kind === "page-slot" && A(t.page, "page") && typeof t.id == "string") && (e.resource === void 0 || me(e.resource)) && he(e.open);
22
- }, ve = (e) => k(e) ? e.kind === "page" ? ge(e) : e.kind === "panel" ? _e(e) : e.kind === "href" ? p(e.href) : e.kind === "command" && k(e.target) && A(e.target.command, "command") && (e.target.params === void 0 || k(e.target.params)) : !1, ye = (e) => ve(e) ? !0 : !k(e) || e.kind !== "compound" || !Array.isArray(e.targets) || e.targets.length === 0 ? !1 : e.targets.every((e) => ge(e) || _e(e)), j = (e, t) => e.extensionId !== void 0 || t === void 0 ? e : {
426
+ return (P(t, "placement") || t.kind === "page-slot" && P(t.page, "page") && typeof t.id == "string") && (e.resource === void 0 || at(e.resource)) && ot(e.open);
427
+ }, lt = (e) => N(e) ? e.kind === "page" ? st(e) : e.kind === "panel" ? ct(e) : e.kind === "href" ? Se(e.href) : e.kind === "command" && N(e.target) && P(e.target.command, "command") && (e.target.params === void 0 || N(e.target.params)) : !1, ut = (e) => lt(e) ? !0 : !N(e) || e.kind !== "compound" || !Array.isArray(e.targets) || e.targets.length === 0 ? !1 : e.targets.every((e) => st(e) || ct(e)), F = (e, t) => e.extensionId !== void 0 || t === void 0 ? e : {
23
428
  ...e,
24
429
  extensionId: t
25
- }, be = (e, t, n) => ({
430
+ }, dt = (e, t, n) => ({
26
431
  ...e,
27
- page: j(e.page, t),
28
- ...e.resource ? { resource: xe(e.resource, t, n) } : {},
29
- ...e.parent ? { parent: be(e.parent, t, n) } : {}
30
- }), xe = (e, t, n) => ({
432
+ page: F(e.page, t),
433
+ ...e.resource ? { resource: ft(e.resource, t, n) } : {},
434
+ ...e.parent ? { parent: dt(e.parent, t, n) } : {}
435
+ }), ft = (e, t, n) => ({
31
436
  ...e,
32
437
  extensionId: e.extensionId ?? t,
33
438
  projectId: e.projectId ?? n
34
- }), Se = (e, t, n) => {
35
- if (!ye(e)) throw Error("Invalid navigation target.");
36
- return e.kind === "page" ? be(e, t, n) : e.kind === "panel" ? {
439
+ }), pt = (e, t, n) => {
440
+ if (!ut(e)) throw Error("Invalid navigation target.");
441
+ return e.kind === "page" ? dt(e, t, n) : e.kind === "panel" ? {
37
442
  ...e,
38
443
  panel: e.panel.kind === "page-slot" ? {
39
444
  ...e.panel,
40
- page: j(e.panel.page, t)
41
- } : j(e.panel, t),
42
- ...e.resource ? { resource: xe(e.resource, t, n) } : {}
445
+ page: F(e.panel.page, t)
446
+ } : F(e.panel, t),
447
+ ...e.resource ? { resource: ft(e.resource, t, n) } : {}
43
448
  } : e.kind === "command" ? {
44
449
  ...e,
45
450
  target: {
46
451
  ...e.target,
47
- command: j(e.target.command, t)
452
+ command: F(e.target.command, t)
48
453
  }
49
454
  } : e.kind === "href" ? e : {
50
455
  ...e,
51
- targets: e.targets.map((e) => Se(e, t, n))
456
+ targets: e.targets.map((e) => pt(e, t, n))
52
457
  };
53
- }, Ce = (e) => {
458
+ }, mt = (e) => {
54
459
  let t = [], n = (e) => ({
55
460
  ...e,
56
461
  name: e.name,
@@ -73,7 +478,30 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
73
478
  }
74
479
  return r;
75
480
  }));
76
- }, we = /* @__PURE__ */ new Set([...l, ...i]), Te = new Set(d), Ee = (e) => we.has(e), De = (e) => Te.has(e), Oe = (e) => {
481
+ }, ht = [
482
+ "clipboard.write",
483
+ "commands.execute",
484
+ "commands.stream",
485
+ "harnesses.read",
486
+ "resources.actions",
487
+ "navigation.open",
488
+ "page.params.update",
489
+ "placement.close",
490
+ "notification.show",
491
+ "notification.action",
492
+ "notification.resolve",
493
+ "notification.dismiss",
494
+ "preferences.get",
495
+ "preferences.set",
496
+ "extension.settings.all",
497
+ "extension.settings.get",
498
+ "extension.settings.set",
499
+ "extension.settings.delete",
500
+ "terminal.session",
501
+ "files.upload",
502
+ "files.list",
503
+ "files.delete"
504
+ ], gt = ["artifacts.read"], _t = [...ht.filter((e) => e !== "clipboard.write"), ...gt], vt = "resources.actions", yt = /* @__PURE__ */ new Set([..._t, ...ht]), bt = new Set(gt), xt = (e) => yt.has(e), St = (e) => bt.has(e), Ct = (e) => {
77
505
  let [t = "", n] = e.split("@"), r = t.indexOf(":");
78
506
  return {
79
507
  capability: e,
@@ -81,36 +509,36 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
81
509
  scope: r === -1 ? void 0 : t.slice(r + 1),
82
510
  version: n === void 0 ? 1 : Number(n)
83
511
  };
84
- }, ke = (e) => De(e.name) ? !!e.scope : e.scope === void 0, M = (e) => ({
512
+ }, wt = (e) => St(e.name) ? !!e.scope : e.scope === void 0, I = (e) => ({
85
513
  capability: e,
86
514
  code: "unsupported_webview_capability",
87
515
  message: `Unsupported webview capability: ${e}`,
88
516
  severity: "error"
89
- }), Ae = (e, t, n) => ({
517
+ }), Tt = (e, t, n) => ({
90
518
  capability: e,
91
519
  code: "unsupported_webview_capability_version",
92
520
  message: `Unsupported webview capability version: ${t}@${n.toString()} (supported: 1)`,
93
521
  severity: "error"
94
- }), je = (e) => ({
522
+ }), Et = (e) => ({
95
523
  capability: e,
96
524
  code: "undeclared_webview_capability",
97
525
  message: `Webview did not declare host capability: ${e}`,
98
526
  severity: "error"
99
- }), Me = (e, t = {}) => {
527
+ }), Dt = (e, t = {}) => {
100
528
  let n = [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map();
101
529
  for (let a of e ?? []) {
102
- let e = Oe(a);
103
- if (!Ee(e.name) || !ke(e)) {
104
- n.push(M(a));
530
+ let e = Ct(a);
531
+ if (!xt(e.name) || !wt(e)) {
532
+ n.push(I(a));
105
533
  continue;
106
534
  }
107
535
  if (e.version !== 1) {
108
- n.push(Ae(a, e.name, e.version));
536
+ n.push(Tt(a, e.name, e.version));
109
537
  continue;
110
538
  }
111
539
  if (e.name === "clipboard.write") continue;
112
540
  if (!t[e.name]) {
113
- n.push(M(a));
541
+ n.push(I(a));
114
542
  continue;
115
543
  }
116
544
  if (e.scope === void 0) {
@@ -125,11 +553,11 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
125
553
  allowedScopes: i,
126
554
  diagnostics: n
127
555
  };
128
- }, Ne = (e) => {
556
+ }, Ot = (e) => {
129
557
  let t = e.params;
130
558
  return typeof t?.mount == "string" && t.mount.length > 0 ? t.mount : void 0;
131
- }, Pe = (e) => {
132
- let { allowed: t, allowedScopes: n, diagnostics: r } = Me(e.declaredCapabilities, e.capabilities), i = (t) => {
559
+ }, kt = (e) => {
560
+ let { allowed: t, allowedScopes: n, diagnostics: r } = Dt(e.declaredCapabilities, e.capabilities), i = (t) => {
133
561
  e.onDiagnostic?.(t);
134
562
  }, a = (e) => (i(e), Object.assign(Error(e.message), {
135
563
  code: e.code,
@@ -138,18 +566,18 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
138
566
  return {
139
567
  diagnostics: r,
140
568
  async call(r) {
141
- if (!Ee(r.method) || r.method === "clipboard.write") throw a(M(r.method));
142
- if (De(r.method)) {
143
- let e = Ne(r);
144
- if (!e) throw a(M(r.method));
145
- if (!n.get(r.method)?.has(e)) throw a(je(`${r.method}:${e}`));
146
- } else if (!t.has(r.method)) throw a(je(r.method));
569
+ if (!xt(r.method) || r.method === "clipboard.write") throw a(I(r.method));
570
+ if (St(r.method)) {
571
+ let e = Ot(r);
572
+ if (!e) throw a(I(r.method));
573
+ if (!n.get(r.method)?.has(e)) throw a(Et(`${r.method}:${e}`));
574
+ } else if (!t.has(r.method)) throw a(Et(r.method));
147
575
  let i = e.capabilities[r.method];
148
- if (!i) throw a(M(r.method));
576
+ if (!i) throw a(I(r.method));
149
577
  return await i(r.params);
150
578
  }
151
579
  };
152
- }, Fe = (e = {}) => {
580
+ }, At = (e = {}) => {
153
581
  let t = e.locale ?? "en";
154
582
  return {
155
583
  ...e,
@@ -166,7 +594,7 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
166
594
  defaultBundle: {}
167
595
  }
168
596
  };
169
- }, Ie = (e) => typeof e == "object" && !!e, Le = (e) => {
597
+ }, jt = (e) => typeof e == "object" && !!e, Mt = (e) => {
170
598
  try {
171
599
  let t = JSON.stringify(e);
172
600
  if (typeof t == "string" && t.length > 0) return t;
@@ -176,21 +604,21 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
176
604
  } catch {
177
605
  return "Unknown error";
178
606
  }
179
- }, Re = (e) => {
607
+ }, Nt = (e) => {
180
608
  if (e instanceof Error) return {
181
609
  message: e.message,
182
610
  stack: e.stack
183
611
  };
184
612
  if (typeof e == "string") return { message: e };
185
- if (Ie(e)) {
613
+ if (jt(e)) {
186
614
  let t = typeof e.message == "string" ? e.message : null, n = typeof e.stack == "string" ? e.stack : void 0;
187
615
  return t ? n ? {
188
616
  message: t,
189
617
  stack: n
190
- } : { message: t } : { message: Le(e) };
618
+ } : { message: t } : { message: Mt(e) };
191
619
  }
192
- return e == null ? { message: "Unknown error" } : { message: Le(e) };
193
- }, ze = async (e) => {
620
+ return e == null ? { message: "Unknown error" } : { message: Mt(e) };
621
+ }, Pt = async (e) => {
194
622
  try {
195
623
  return {
196
624
  ok: !0,
@@ -202,12 +630,12 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
202
630
  ok: !1,
203
631
  error: {
204
632
  code: "code" in t && typeof t.code == "string" ? t.code : "webview_capability_failed",
205
- message: Re(e).message,
633
+ message: Nt(e).message,
206
634
  ..."data" in t ? { data: t.data } : {}
207
635
  }
208
636
  };
209
637
  }
210
- }, Be = (e = []) => e.some((e) => e === "clipboard.write" || e === "clipboard.write@1") ? "fullscreen; clipboard-write" : "fullscreen", N = () => {
638
+ }, Ft = (e = []) => e.some((e) => e === "clipboard.write" || e === "clipboard.write@1") ? "fullscreen; clipboard-write" : "fullscreen", It = () => {
211
639
  if (typeof document > "u") return {};
212
640
  let e = getComputedStyle(document.documentElement), t = {};
213
641
  for (let n = 0; n < e.length; n += 1) {
@@ -215,48 +643,63 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
215
643
  r.startsWith("--chakra-") && (t[r] = e.getPropertyValue(r).trim());
216
644
  }
217
645
  return t;
218
- }, Ve = (e) => {
646
+ }, Lt = (e) => {
219
647
  if (typeof document > "u") return e;
220
648
  let t = document.documentElement.getAttribute("data-theme");
221
649
  if (t === "dark" || t === "light") return t;
222
650
  let n = document.documentElement.getAttribute("data-color-mode");
223
651
  return n === "dark" || n === "light" ? n : e;
224
- }, He = {
652
+ }, Rt = {
225
653
  border: 0,
226
654
  display: "block",
227
655
  flex: "1 1 0%",
228
656
  height: "100%",
229
657
  minHeight: 0,
230
658
  width: "100%"
231
- }, Ue = {
659
+ }, zt = {
232
660
  display: "flex",
233
661
  height: "100%",
234
662
  minHeight: 0,
235
663
  position: "relative",
236
664
  width: "100%"
237
- }, We = "allow-scripts allow-forms allow-popups", Ge = (e) => {
238
- let { view: t, props: n, theme: r, capabilities: i, onKeyboardEvent: a, hostEvents: o, onReady: s, onError: c, onDiagnostics: l, title: u } = e, d = D(null), f = D(null), p = D(!1), m = D(null), h = D(Fe(n)), g = D(r), _ = D(i), v = D(a), y = D(o), b = D(t.webview.capabilities), x = D(s), S = D(c), C = D(l), [ee, te] = le(0);
239
- return h.current = Fe(n), g.current = r, _.current = i, v.current = a, y.current = o, b.current = t.webview.capabilities, x.current = s, S.current = c, C.current = l, E(() => {
240
- let e = d.current;
665
+ }, Bt = "allow-scripts allow-forms allow-popups", Vt = (e) => {
666
+ let { view: t, props: n, theme: r, capabilities: i, onKeyboardEvent: a, hostEvents: o, onReady: s, onError: c, onDiagnostics: l, title: u, sizing: d } = e, f = k(null), p = k(null), m = k(!1), h = k(null), g = k(At(n)), _ = k(r), v = k(i), y = k(a), b = k(o), x = k(t.webview.capabilities), S = k(s), C = k(c), w = k(l), [T, ee] = A(0), [E, te] = A(0);
667
+ return g.current = At(n), _.current = r, v.current = i, y.current = a, b.current = o, x.current = t.webview.capabilities, S.current = s, C.current = c, w.current = l, O(() => {
668
+ let e = f.current;
241
669
  if (!e) return;
242
670
  let n = () => {
243
- e.contentWindow !== m.current && te((e) => e + 1);
671
+ e.contentWindow !== h.current && ee((e) => e + 1);
244
672
  };
245
673
  e.addEventListener("load", n);
246
674
  let r = () => e.removeEventListener("load", n);
247
- if (e.contentWindow === m.current) return r;
248
- m.current = e.contentWindow;
675
+ if (e.contentWindow === h.current) return r;
676
+ h.current = e.contentWindow;
249
677
  let i = t.webview.styles, a = t.webview.moduleUrl, o = (e) => {
250
- e.length > 0 && C.current?.(e);
251
- }, s = () => Pe({
252
- capabilities: _.current ?? {},
253
- declaredCapabilities: b.current,
678
+ e.length > 0 && w.current?.(e);
679
+ }, s = () => kt({
680
+ capabilities: v.current ?? {},
681
+ declaredCapabilities: x.current,
254
682
  onDiagnostic: (e) => o([e])
255
683
  });
256
684
  o(s().diagnostics);
257
685
  let c = {
686
+ dispatchPointerEvent: (t) => {
687
+ if (f.current !== e || !e.isConnected || t.type !== "pointerdown" && t.type !== "click") return;
688
+ let n = e.getBoundingClientRect();
689
+ n.width && n.height && e.dispatchEvent(new PointerEvent(t.type, {
690
+ ...t,
691
+ bubbles: !0,
692
+ composed: !0,
693
+ cancelable: !0,
694
+ clientX: n.left + t.clientX * (n.width / e.clientWidth),
695
+ clientY: n.top + t.clientY * (n.height / e.clientHeight)
696
+ }));
697
+ },
698
+ contentWidthChanged: (e) => {
699
+ d === "content-width" && Number.isFinite(e) && e >= 0 && te(e);
700
+ },
258
701
  dispatchKeyboardEvent: async (e) => {
259
- if (v.current) return v.current(e);
702
+ if (y.current) return y.current(e);
260
703
  document.dispatchEvent(new KeyboardEvent("keydown", {
261
704
  ...e,
262
705
  bubbles: !0,
@@ -265,51 +708,53 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
265
708
  },
266
709
  ready: () => {},
267
710
  runtimeError: (e) => {
268
- S.current?.(e);
711
+ C.current?.(e);
269
712
  },
270
- call: async (e) => await ze(() => s().call(e))
713
+ call: async (e) => await Pt(() => s().call(e))
271
714
  };
272
715
  return (() => {
273
- p.current = !1, f.current = null;
274
- let n = fe.connect(e, c);
716
+ m.current = !1, p.current = null;
717
+ let n = ce.connect(e, c);
275
718
  e.contentWindow?.location.replace(t.webview.runtimeUrl), n.then(async (n) => {
276
- if (d.current !== e) return;
719
+ if (f.current !== e) return;
277
720
  let r = n.remote;
278
- f.current = r, y.current?.bind((e) => r.hostEvent?.(e)), await r.init({
721
+ p.current = r, b.current?.bind((e) => r.hostEvent?.(e)), await r.init({
722
+ sizing: d,
279
723
  moduleUrl: a,
280
724
  styles: i,
281
- props: h.current,
282
- theme: Ve(g.current),
283
- themeVariables: N(),
725
+ props: g.current,
726
+ theme: Lt(_.current),
727
+ themeVariables: It(),
284
728
  extensionId: t.extensionId
285
- }), d.current === e && (p.current = !0, x.current?.());
729
+ }), f.current === e && (m.current = !0, S.current?.());
286
730
  }).catch((t) => {
287
- d.current === e && S.current?.(Re(t));
731
+ f.current === e && C.current?.(Nt(t));
288
732
  });
289
733
  })(), r;
290
734
  }, [
291
- ee,
735
+ T,
736
+ d,
292
737
  t.extensionId,
293
738
  t.webview.runtimeUrl,
294
739
  t.webview.moduleUrl,
295
740
  t.webview.styles
296
- ]), E(() => {
297
- let e = f.current;
741
+ ]), O(() => {
742
+ let e = p.current;
298
743
  if (e && o) return o.bind((t) => e.hostEvent?.(t)), () => o.unbind();
299
- }, [o]), E(() => {
300
- p.current && f.current?.propsUpdate({ props: Fe(n) });
301
- }, [n]), E(() => {
302
- p.current && f.current?.themeUpdate({
303
- theme: Ve(r),
304
- variables: N()
744
+ }, [o]), O(() => {
745
+ m.current && p.current?.propsUpdate({ props: At(n) });
746
+ }, [n]), O(() => {
747
+ m.current && p.current?.themeUpdate({
748
+ theme: Lt(r),
749
+ variables: It()
305
750
  });
306
- }, [r]), E(() => {
751
+ }, [r]), O(() => {
307
752
  if (typeof window > "u" || typeof MutationObserver > "u") return;
308
753
  let e = null, t = new MutationObserver(() => {
309
754
  e !== null && cancelAnimationFrame(e), e = requestAnimationFrame(() => {
310
- e = null, p.current && f.current?.themeUpdate({
311
- theme: Ve(g.current),
312
- variables: N()
755
+ e = null, m.current && p.current?.themeUpdate({
756
+ theme: Lt(_.current),
757
+ variables: It()
313
758
  });
314
759
  });
315
760
  }), n = {
@@ -324,26 +769,29 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
324
769
  return t.observe(document.documentElement, n), t.observe(document.body, n), () => {
325
770
  t.disconnect(), e !== null && cancelAnimationFrame(e);
326
771
  };
327
- }, []), /* @__PURE__ */ O("div", {
328
- style: Ue,
329
- children: /* @__PURE__ */ O("iframe", {
330
- ref: d,
772
+ }, []), /* @__PURE__ */ j("div", {
773
+ style: {
774
+ ...zt,
775
+ width: d === "content-width" ? E : "100%"
776
+ },
777
+ children: /* @__PURE__ */ j("iframe", {
778
+ ref: f,
331
779
  title: u ?? t.label,
332
- allow: Be(t.webview.capabilities),
333
- sandbox: We,
780
+ allow: Ft(t.webview.capabilities),
781
+ sandbox: Bt,
334
782
  style: {
335
- ...He,
783
+ ...Rt,
336
784
  colorScheme: r
337
785
  },
338
786
  onError: () => {
339
- S.current?.({ message: `Failed to load extension runtime at ${t.webview.runtimeUrl}` });
787
+ C.current?.({ message: `Failed to load extension runtime at ${t.webview.runtimeUrl}` });
340
788
  }
341
- }, `${ee}\n${t.webview.runtimeUrl}\n${t.webview.moduleUrl}`)
789
+ }, `${T}\n${t.webview.runtimeUrl}\n${t.webview.moduleUrl}`)
342
790
  });
343
- }, Ke = "[pstdio.extension-host] ", qe = (e, t = console.info) => {
344
- t(`${Ke}${JSON.stringify(e)}`);
345
- }, Je = (e, t) => {
346
- let n = (n) => qe({
791
+ }, Ht = "[pstdio.extension-host] ", Ut = (e, t = console.info) => {
792
+ t(`${Ht}${JSON.stringify(e)}`);
793
+ }, Wt = (e, t) => {
794
+ let n = (n) => Ut({
347
795
  extensionId: e.extensionId,
348
796
  contributionId: e.id,
349
797
  ...n
@@ -361,7 +809,7 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
361
809
  });
362
810
  }
363
811
  };
364
- }, Ye = () => {
812
+ }, Gt = () => {
365
813
  let e = null, t = [], n = /* @__PURE__ */ new Set();
366
814
  return {
367
815
  emit(n) {
@@ -378,83 +826,83 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
378
826
  for (let e of n) e();
379
827
  }
380
828
  };
381
- }, Xe = (e) => {
382
- let t = ie(37), n, r, i;
829
+ }, Kt = (e) => {
830
+ let t = te(38), n, r, i;
383
831
  t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({view: r, workbench: i, ...n} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
384
- let [a, o] = le(i.pages.store.getState), s;
832
+ let [a, o] = A(i.pages.store.getState), s;
385
833
  t[4] === i.pages.store ? s = t[5] : (s = () => i.pages.store.subscribe((e) => o(e)), t[4] = i.pages.store, t[5] = s);
386
834
  let c;
387
- t[6] === i ? c = t[7] : (c = [i], t[6] = i, t[7] = c), E(s, c);
835
+ t[6] === i ? c = t[7] : (c = [i], t[6] = i, t[7] = c), O(s, c);
388
836
  let l, u;
389
837
  if (t[8] !== a.activePageId || t[9] !== a.location || t[10] !== i.pages) {
390
838
  let e = a.activePageId ? i.pages.getPage(a.activePageId) : void 0;
391
- l = a.location, u = m(e?.params, a.location?.params), t[8] = a.activePageId, t[9] = a.location, t[10] = i.pages, t[11] = l, t[12] = u;
839
+ l = a.location, u = _(e?.params, a.location?.params), t[8] = a.activePageId, t[9] = a.location, t[10] = i.pages, t[11] = l, t[12] = u;
392
840
  } else l = t[11], u = t[12];
393
841
  let d;
394
842
  t[13] !== l || t[14] !== u ? (d = {
395
843
  pageLocation: l,
396
844
  pageParams: u
397
845
  }, t[13] = l, t[14] = u, t[15] = d) : d = t[15];
398
- let f = d, [p, h] = le(null), g;
399
- t[16] === r ? g = t[17] : (g = Je(r), t[16] = r, t[17] = g);
400
- let _ = g, v;
401
- t[18] === p ? v = t[19] : (v = p ? /* @__PURE__ */ O(oe, {
846
+ let f = d, [p, m] = A(null), h;
847
+ t[16] === r ? h = t[17] : (h = Wt(r), t[16] = r, t[17] = h);
848
+ let g = h, v = e.sizing ? "max-content" : "full", y;
849
+ t[18] === p ? y = t[19] : (y = p ? /* @__PURE__ */ j(re, {
402
850
  position: "absolute",
403
851
  inset: "0",
404
852
  px: "md",
405
853
  zIndex: 1,
406
854
  bg: "bg",
407
- children: /* @__PURE__ */ ue(se, {
855
+ children: /* @__PURE__ */ oe(ie, {
408
856
  gap: "xs",
409
857
  maxW: "md",
410
858
  textAlign: "center",
411
- children: [/* @__PURE__ */ O(ce, {
859
+ children: [/* @__PURE__ */ j(ae, {
412
860
  textStyle: "paragraph/S/medium",
413
861
  color: "fg.error",
414
862
  children: "Extension view failed to load."
415
- }), /* @__PURE__ */ O(ce, {
863
+ }), /* @__PURE__ */ j(ae, {
416
864
  textStyle: "paragraph/XS/regular",
417
865
  color: "fg.muted",
418
866
  children: p
419
867
  })]
420
868
  })
421
- }) : null, t[18] = p, t[19] = v);
422
- let y;
423
- t[20] !== n.props || t[21] !== f ? (y = {
869
+ }) : null, t[18] = p, t[19] = y);
870
+ let b;
871
+ t[20] !== n.props || t[21] !== f ? (b = {
424
872
  ...n.props,
425
873
  ...f
426
- }, t[20] = n.props, t[21] = f, t[22] = y) : y = t[22];
427
- let b;
428
- t[23] === _ ? b = t[24] : (b = () => {
429
- _.onReady(), h(null);
430
- }, t[23] = _, t[24] = b);
874
+ }, t[20] = n.props, t[21] = f, t[22] = b) : b = t[22];
431
875
  let x;
432
- t[25] === _ ? x = t[26] : (x = (e) => {
433
- _.onError(e), h(e.message);
434
- }, t[25] = _, t[26] = x);
876
+ t[23] === g ? x = t[24] : (x = () => {
877
+ g.onReady(), m(null);
878
+ }, t[23] = g, t[24] = x);
435
879
  let S;
436
- t[27] !== _.onDiagnostics || t[28] !== n || t[29] !== y || t[30] !== b || t[31] !== x || t[32] !== r ? (S = /* @__PURE__ */ O(Ge, {
880
+ t[25] === g ? S = t[26] : (S = (e) => {
881
+ g.onError(e), m(e.message);
882
+ }, t[25] = g, t[26] = S);
883
+ let C;
884
+ t[27] !== g.onDiagnostics || t[28] !== n || t[29] !== S || t[30] !== b || t[31] !== x || t[32] !== r ? (C = /* @__PURE__ */ j(Vt, {
437
885
  view: r,
438
886
  ...n,
439
- props: y,
440
- onReady: b,
441
- onDiagnostics: _.onDiagnostics,
442
- onError: x
443
- }), t[27] = _.onDiagnostics, t[28] = n, t[29] = y, t[30] = b, t[31] = x, t[32] = r, t[33] = S) : S = t[33];
444
- let C;
445
- return t[34] !== S || t[35] !== v ? (C = /* @__PURE__ */ ue(ae, {
887
+ props: b,
888
+ onReady: x,
889
+ onDiagnostics: g.onDiagnostics,
890
+ onError: S
891
+ }), t[27] = g.onDiagnostics, t[28] = n, t[29] = S, t[30] = b, t[31] = x, t[32] = r, t[33] = C) : C = t[33];
892
+ let w;
893
+ return t[34] !== C || t[35] !== v || t[36] !== y ? (w = /* @__PURE__ */ oe(ne, {
446
894
  position: "relative",
447
- width: "100%",
448
- height: "100%",
895
+ width: v,
896
+ height: "full",
449
897
  minH: "0",
450
898
  display: "flex",
451
899
  flexDirection: "column",
452
- children: [v, S]
453
- }), t[34] = S, t[35] = v, t[36] = C) : C = t[36], C;
454
- }, Ze = "terminal.session", Qe = (e) => {
900
+ children: [y, C]
901
+ }), t[34] = C, t[35] = v, t[36] = y, t[37] = w) : w = t[37], w;
902
+ }, qt = "terminal.session", Jt = (e) => {
455
903
  let { terminal: t, hostEvents: n } = e, r = (e) => {
456
904
  n.emit({
457
- scope: Ze,
905
+ scope: qt,
458
906
  payload: e
459
907
  });
460
908
  };
@@ -515,34 +963,34 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
515
963
  }
516
964
  }
517
965
  };
518
- }, $e = b.discriminatedUnion("kind", [
519
- b.object({
520
- kind: b.literal("navigate"),
521
- id: b.string(),
522
- label: b.string(),
523
- target: b.custom(ye, "Invalid navigation target."),
524
- primary: b.boolean().optional()
966
+ }, Yt = y.discriminatedUnion("kind", [
967
+ y.object({
968
+ kind: y.literal("navigate"),
969
+ id: y.string(),
970
+ label: y.string(),
971
+ target: y.custom(ut, "Invalid navigation target."),
972
+ primary: y.boolean().optional()
525
973
  }),
526
- b.object({
527
- kind: b.literal("command"),
528
- id: b.string(),
529
- label: b.string(),
530
- command: b.string(),
531
- params: n.optional(),
532
- primary: b.boolean().optional(),
533
- destructive: b.boolean().optional()
974
+ y.object({
975
+ kind: y.literal("command"),
976
+ id: y.string(),
977
+ label: y.string(),
978
+ command: y.string(),
979
+ params: f.optional(),
980
+ primary: y.boolean().optional(),
981
+ destructive: y.boolean().optional()
534
982
  }),
535
- b.object({
536
- kind: b.literal("url"),
537
- id: b.string(),
538
- label: b.string(),
539
- href: b.string(),
540
- primary: b.boolean().optional()
983
+ y.object({
984
+ kind: y.literal("url"),
985
+ id: y.string(),
986
+ label: y.string(),
987
+ href: y.string(),
988
+ primary: y.boolean().optional()
541
989
  })
542
- ]), et = b.object({
543
- title: b.string().min(1),
544
- body: b.string().optional(),
545
- kind: b.enum([
990
+ ]), Xt = y.object({
991
+ title: y.string().min(1),
992
+ body: y.string().optional(),
993
+ kind: y.enum([
546
994
  "needs_review",
547
995
  "ready_to_merge",
548
996
  "blocked",
@@ -550,33 +998,33 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
550
998
  "failed",
551
999
  "info"
552
1000
  ]),
553
- priority: b.enum([
1001
+ priority: y.enum([
554
1002
  "low",
555
1003
  "normal",
556
1004
  "high",
557
1005
  "urgent"
558
1006
  ]).optional(),
559
- target: f.optional(),
560
- related: b.array(f).optional(),
561
- actions: b.array($e).optional(),
562
- dedupeKey: b.string().optional(),
563
- expiresAt: b.string().optional(),
564
- snoozedUntil: b.string().optional(),
565
- metadata: n.optional()
566
- }), P = class extends Error {
1007
+ target: p.optional(),
1008
+ related: y.array(p).optional(),
1009
+ actions: y.array(Yt).optional(),
1010
+ dedupeKey: y.string().optional(),
1011
+ expiresAt: y.string().optional(),
1012
+ snoozedUntil: y.string().optional(),
1013
+ metadata: f.optional()
1014
+ }), L = class extends Error {
567
1015
  code;
568
1016
  data;
569
1017
  constructor(e, t, n) {
570
1018
  super(t), this.code = e, this.data = n, this.name = "WebviewHostCapabilityError";
571
1019
  }
572
- }, F = b.string().min(1), tt = b.object({}).strict().optional(), nt = b.object({
573
- commandId: F,
574
- params: n.optional(),
575
- workspaceId: F.optional(),
576
- resource: f.optional(),
577
- metadata: n.optional()
578
- }), rt = { streamId: F }, it = b.object({
579
- scope: b.enum([
1020
+ }, R = y.string().min(1), Zt = y.object({}).strict().optional(), Qt = y.object({
1021
+ commandId: R,
1022
+ params: f.optional(),
1023
+ workspaceId: R.optional(),
1024
+ resource: p.optional(),
1025
+ metadata: f.optional()
1026
+ }), $t = { streamId: R }, en = y.object({
1027
+ scope: y.enum([
580
1028
  "default",
581
1029
  "user",
582
1030
  "project",
@@ -584,141 +1032,153 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
584
1032
  "extension",
585
1033
  "session"
586
1034
  ]),
587
- scopeId: b.string().optional()
588
- }), at = b.object({
589
- name: F,
590
- scope: it.optional()
591
- }), ot = b.object({
592
- id: F.optional(),
593
- dedupeKey: b.string().optional(),
594
- status: b.enum([
1035
+ scopeId: y.string().optional()
1036
+ }), tn = y.object({
1037
+ name: R,
1038
+ scope: en.optional()
1039
+ }), nn = y.object({
1040
+ id: R.optional(),
1041
+ dedupeKey: y.string().optional(),
1042
+ status: y.enum([
595
1043
  "done",
596
1044
  "dismissed",
597
1045
  "expired"
598
1046
  ]).optional()
599
- }).refine((e) => e.id !== void 0 || e.dedupeKey !== void 0, "Provide a notification ID or dedupe key."), st = b.union([b.instanceof(Uint8Array), b.instanceof(ArrayBuffer)]), ct = b.object({
600
- type: F,
601
- id: b.string().optional()
602
- }), I = { sessionId: F }, lt = b.object({
603
- cols: b.number().int().positive(),
604
- rows: b.number().int().positive(),
605
- command: b.array(b.string()).optional(),
606
- cwd: b.string().optional(),
607
- env: b.record(b.string(), b.string()).optional()
608
- }), ut = {
609
- "commands.execute": nt,
610
- "commands.stream": b.discriminatedUnion("operation", [
611
- nt.extend({
612
- ...rt,
613
- operation: b.literal("start")
1047
+ }).refine((e) => e.id !== void 0 || e.dedupeKey !== void 0, "Provide a notification ID or dedupe key."), rn = y.union([y.instanceof(Uint8Array), y.instanceof(ArrayBuffer)]), an = y.object({
1048
+ type: R,
1049
+ id: y.string().optional()
1050
+ }), on = { sessionId: R }, sn = y.object({
1051
+ cols: y.number().int().positive(),
1052
+ rows: y.number().int().positive(),
1053
+ command: y.array(y.string()).optional(),
1054
+ cwd: y.string().optional(),
1055
+ env: y.record(y.string(), y.string()).optional()
1056
+ }), cn = {
1057
+ "harnesses.read": y.object({
1058
+ harnessId: R.optional(),
1059
+ model: y.string().optional()
1060
+ }),
1061
+ "resources.actions": y.discriminatedUnion("operation", [y.object({
1062
+ operation: y.literal("list"),
1063
+ resource: p
1064
+ }), y.object({
1065
+ operation: y.literal("execute"),
1066
+ resource: p,
1067
+ key: R
1068
+ })]),
1069
+ "commands.execute": Qt,
1070
+ "commands.stream": y.discriminatedUnion("operation", [
1071
+ Qt.extend({
1072
+ ...$t,
1073
+ operation: y.literal("start")
614
1074
  }),
615
- b.object({
616
- ...rt,
617
- operation: b.literal("cancel")
1075
+ y.object({
1076
+ ...$t,
1077
+ operation: y.literal("cancel")
618
1078
  }),
619
- b.object({
620
- ...rt,
621
- operation: b.literal("ack"),
622
- bytes: b.number().int().positive()
1079
+ y.object({
1080
+ ...$t,
1081
+ operation: y.literal("ack"),
1082
+ bytes: y.number().int().positive()
623
1083
  })
624
1084
  ]),
625
- "navigation.open": b.object({ target: b.custom(ye, "Invalid navigation target.") }),
626
- "page.params.update": b.object({ params: b.record(b.string(), h.nullable()) }),
627
- "placement.close": tt,
628
- "notification.show": b.union([b.object({
629
- type: b.enum([
1085
+ "navigation.open": y.object({ target: y.custom(ut, "Invalid navigation target.") }),
1086
+ "page.params.update": y.object({ params: y.record(y.string(), Ce.nullable()) }),
1087
+ "placement.close": Zt,
1088
+ "notification.show": y.union([y.object({
1089
+ type: y.enum([
630
1090
  "info",
631
1091
  "success",
632
1092
  "warning",
633
1093
  "error"
634
1094
  ]),
635
- title: b.string().optional(),
636
- message: b.string(),
637
- metadata: n.optional()
638
- }), b.object({
639
- level: b.enum([
1095
+ title: y.string().optional(),
1096
+ message: y.string(),
1097
+ metadata: f.optional()
1098
+ }), y.object({
1099
+ level: y.enum([
640
1100
  "info",
641
1101
  "success",
642
1102
  "warning",
643
1103
  "error"
644
1104
  ]),
645
- title: b.string().optional(),
646
- message: b.string().optional()
1105
+ title: y.string().optional(),
1106
+ message: y.string().optional()
647
1107
  })]),
648
- "notification.action": et,
649
- "notification.resolve": ot,
650
- "notification.dismiss": ot,
651
- "preferences.get": at,
652
- "preferences.set": at.extend({ value: b.union([
653
- b.boolean(),
654
- b.number(),
655
- b.string(),
656
- b.array(b.string()),
657
- b.array(b.number()),
658
- b.array(b.boolean()),
659
- n
1108
+ "notification.action": Xt,
1109
+ "notification.resolve": nn,
1110
+ "notification.dismiss": nn,
1111
+ "preferences.get": tn,
1112
+ "preferences.set": tn.extend({ value: y.union([
1113
+ y.boolean(),
1114
+ y.number(),
1115
+ y.string(),
1116
+ y.array(y.string()),
1117
+ y.array(y.number()),
1118
+ y.array(y.boolean()),
1119
+ f
660
1120
  ]) }),
661
- "extension.settings.all": tt,
662
- "extension.settings.get": b.object({ key: F }),
663
- "extension.settings.set": b.object({
664
- key: F,
665
- value: b.unknown()
1121
+ "extension.settings.all": Zt,
1122
+ "extension.settings.get": y.object({ key: R }),
1123
+ "extension.settings.set": y.object({
1124
+ key: R,
1125
+ value: y.unknown()
666
1126
  }),
667
- "extension.settings.delete": b.object({ key: F }),
668
- "terminal.session": b.discriminatedUnion("operation", [
669
- b.object({
670
- operation: b.literal("open"),
671
- request: lt
1127
+ "extension.settings.delete": y.object({ key: R }),
1128
+ "terminal.session": y.discriminatedUnion("operation", [
1129
+ y.object({
1130
+ operation: y.literal("open"),
1131
+ request: sn
672
1132
  }),
673
- b.object({
674
- ...I,
675
- operation: b.literal("write"),
676
- data: b.union([b.string(), b.instanceof(Uint8Array)])
1133
+ y.object({
1134
+ ...on,
1135
+ operation: y.literal("write"),
1136
+ data: y.union([y.string(), y.instanceof(Uint8Array)])
677
1137
  }),
678
- b.object({
679
- ...I,
680
- operation: b.literal("resize"),
681
- cols: b.number().int().positive(),
682
- rows: b.number().int().positive()
1138
+ y.object({
1139
+ ...on,
1140
+ operation: y.literal("resize"),
1141
+ cols: y.number().int().positive(),
1142
+ rows: y.number().int().positive()
683
1143
  }),
684
- b.object({
685
- ...I,
686
- operation: b.literal("kill"),
687
- signal: b.string().optional()
1144
+ y.object({
1145
+ ...on,
1146
+ operation: y.literal("kill"),
1147
+ signal: y.string().optional()
688
1148
  }),
689
- b.object({
690
- ...I,
691
- operation: b.literal("subscribe")
1149
+ y.object({
1150
+ ...on,
1151
+ operation: y.literal("subscribe")
692
1152
  })
693
1153
  ]),
694
- "files.upload": b.object({
695
- name: F,
696
- data: st,
697
- mimeType: b.string().optional(),
698
- scope: ct.optional()
1154
+ "files.upload": y.object({
1155
+ name: R,
1156
+ data: rn,
1157
+ mimeType: y.string().optional(),
1158
+ scope: an.optional()
699
1159
  }),
700
- "files.list": b.object({ scope: ct.optional() }),
701
- "files.delete": b.object({ id: F }),
702
- "artifacts.read": b.discriminatedUnion("op", [
703
- b.object({
704
- op: b.literal("list"),
705
- mount: F,
706
- prefix: b.string().optional()
1160
+ "files.list": y.object({ scope: an.optional() }),
1161
+ "files.delete": y.object({ id: R }),
1162
+ "artifacts.read": y.discriminatedUnion("op", [
1163
+ y.object({
1164
+ op: y.literal("list"),
1165
+ mount: R,
1166
+ prefix: y.string().optional()
707
1167
  }),
708
- b.object({
709
- op: b.literal("readText"),
710
- mount: F,
711
- path: b.string()
1168
+ y.object({
1169
+ op: y.literal("readText"),
1170
+ mount: R,
1171
+ path: y.string()
712
1172
  }),
713
- b.object({
714
- op: b.literal("imageUrl"),
715
- mount: F,
716
- path: b.string()
1173
+ y.object({
1174
+ op: y.literal("imageUrl"),
1175
+ mount: R,
1176
+ path: y.string()
717
1177
  })
718
1178
  ])
719
- }, dt = (e, t) => {
720
- let n = ut[e].safeParse(t);
721
- if (!n.success) throw new P("invalid_params", `Invalid parameters for ${e}.`, {
1179
+ }, ln = (e, t) => {
1180
+ let n = cn[e].safeParse(t);
1181
+ if (!n.success) throw new L("invalid_params", `Invalid parameters for ${e}.`, {
722
1182
  capability: e,
723
1183
  issues: n.error.issues.map((e) => ({
724
1184
  path: e.path.map(String),
@@ -726,13 +1186,13 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
726
1186
  }))
727
1187
  });
728
1188
  return n.data;
729
- }, ft = (e, t = e) => ({
1189
+ }, un = (e, t = e) => ({
730
1190
  ok: !1,
731
1191
  status: "error",
732
1192
  code: e,
733
1193
  reason: t
734
- }), pt = (e) => {
735
- let t = Ce(e);
1194
+ }), dn = (e) => {
1195
+ let t = mt(e);
736
1196
  return {
737
1197
  ok: !1,
738
1198
  status: "error",
@@ -741,14 +1201,14 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
741
1201
  error: t,
742
1202
  ...t.cause === void 0 ? {} : { cause: t.cause }
743
1203
  };
744
- }, mt = (e) => Object.assign(Error(e), { code: e }), ht = 16, gt = 8388608, _t = async (e, t) => {
1204
+ }, fn = (e) => Object.assign(Error(e), { code: e }), pn = 16, mn = 8388608, hn = async (e, t) => {
745
1205
  let n = new AbortController(), r = e.onDisconnect(() => n.abort());
746
1206
  try {
747
1207
  return await t(n.signal);
748
1208
  } finally {
749
1209
  r();
750
1210
  }
751
- }, vt = (e) => {
1211
+ }, gn = (e) => {
752
1212
  let t = /* @__PURE__ */ new Map();
753
1213
  return async (n, r) => {
754
1214
  let { streamId: i } = n;
@@ -757,44 +1217,44 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
757
1217
  let e = t.get(i);
758
1218
  e && Number.isSafeInteger(n.bytes) && n.bytes > 0 && n.bytes <= e.unread && (e.unread -= n.bytes);
759
1219
  } else {
760
- if (t.has(i)) throw mt("command_stream_duplicate");
761
- if (t.size >= ht) throw mt("command_stream_limit");
762
- let a = new AbortController(), o = !1, c = () => {}, l = (t) => e.emit({
1220
+ if (t.has(i)) throw fn("command_stream_duplicate");
1221
+ if (t.size >= pn) throw fn("command_stream_limit");
1222
+ let a = new AbortController(), o = !1, s = () => {}, c = (t) => e.emit({
763
1223
  scope: "commands.stream",
764
1224
  payload: {
765
1225
  streamId: i,
766
1226
  ...t
767
1227
  }
768
- }), u = (e, n = !0) => {
769
- o || (o = !0, t.delete(i), c(), a.abort(), n && l({
1228
+ }), l = (e, n = !0) => {
1229
+ o || (o = !0, t.delete(i), s(), a.abort(), n && c({
770
1230
  type: "end",
771
1231
  outcome: e
772
1232
  }));
773
- }, d = {
1233
+ }, u = {
774
1234
  unread: 0,
775
- stop: (e, t = !0) => u(ft(e), t)
1235
+ stop: (e, t = !0) => l(un(e), t)
776
1236
  };
777
- t.set(i, d), c = e.onDisconnect(() => d.stop("command_stream_cancelled", !1));
778
- let { operation: f, streamId: p, commandId: m, ...h } = n, g = (e) => {
1237
+ t.set(i, u), s = e.onDisconnect(() => u.stop("command_stream_cancelled", !1));
1238
+ let { operation: d, streamId: f, commandId: p, ...m } = n, h = (e) => {
779
1239
  if (e.type === "end") {
780
- let t = s.parse(e.response);
781
- r.publish?.(t), u(t.outcome);
1240
+ let t = Ue.parse(e.response);
1241
+ r.publish?.(t), l(t.outcome);
782
1242
  return;
783
1243
  }
784
- d.unread += new TextEncoder().encode(JSON.stringify(e.data)).byteLength, d.unread > gt ? d.stop("command_stream_overflow") : l(e);
1244
+ u.unread += new TextEncoder().encode(JSON.stringify(e.data)).byteLength, u.unread > mn ? u.stop("command_stream_overflow") : c(e);
785
1245
  };
786
1246
  (async () => {
787
1247
  try {
788
1248
  for await (let e of r.stream({
789
- commandId: m,
790
- ...h
1249
+ commandId: p,
1250
+ ...m
791
1251
  }, a.signal)) {
792
1252
  if (o) break;
793
- g(e);
1253
+ h(e);
794
1254
  }
795
- o || d.stop("command_stream_disconnected");
1255
+ o || u.stop("command_stream_disconnected");
796
1256
  } catch (e) {
797
- u(pt(e));
1257
+ l(dn(e));
798
1258
  }
799
1259
  })();
800
1260
  }
@@ -803,80 +1263,82 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
803
1263
  accepted: !0
804
1264
  };
805
1265
  };
806
- }, yt = b.object({ outcome: r }).passthrough(), bt = /* @__PURE__ */ new WeakMap(), xt = (e) => {
807
- let t = bt.get(e);
808
- return t || (t = vt(e), bt.set(e, t)), t;
809
- }, St = (e, t) => e instanceof Promise ? e.then(t) : t(), L = (e, t) => (n) => {
810
- if (!t) throw new P("unsupported", `The host does not support ${e}.`, { capability: e });
811
- return t(dt(e, n));
812
- }, Ct = (e) => {
1266
+ }, _n = y.object({ outcome: Le }).passthrough(), vn = /* @__PURE__ */ new WeakMap(), yn = (e) => {
1267
+ let t = vn.get(e);
1268
+ return t || (t = gn(e), vn.set(e, t)), t;
1269
+ }, bn = (e, t) => e instanceof Promise ? e.then(t) : t(), z = (e, t) => (n) => {
1270
+ if (!t) throw new L("unsupported", `The host does not support ${e}.`, { capability: e });
1271
+ return t(ln(e, n));
1272
+ }, xn = (e) => {
813
1273
  let { executeCommand: t, hostEvents: n } = e;
814
1274
  if (t) return async (e) => {
815
1275
  try {
816
- let r = n ? await _t(n, (n) => Promise.resolve(t(e, n))) : await t(e);
817
- return yt.parse(r);
1276
+ let r = n ? await hn(n, (n) => Promise.resolve(t(e, n))) : await t(e);
1277
+ return _n.parse(r);
818
1278
  } catch (e) {
819
- if (e instanceof x) return yt.parse({ outcome: e.outcome });
1279
+ if (e instanceof b) return _n.parse({ outcome: e.outcome });
820
1280
  throw e;
821
1281
  }
822
1282
  };
823
- }, wt = (e) => {
1283
+ }, Sn = (e) => {
824
1284
  let { streamCommand: t, hostEvents: n } = e;
825
- if (t && n) return (r) => xt(n)(r, {
1285
+ if (t && n) return (r) => yn(n)(r, {
826
1286
  stream: t,
827
1287
  publish: e.commandCompleted
828
1288
  });
829
- }, Tt = (e) => {
830
- let { hostEvents: t, navigation: n, pageParams: r, placement: i, notifications: a, settings: o, preferences: s, files: c, artifacts: l, terminal: u } = e, d = u && t ? Qe({
1289
+ }, Cn = (e) => {
1290
+ let { hostEvents: t, navigation: n, pageParams: r, placement: i, notifications: a, settings: o, preferences: s, files: c, artifacts: l, terminal: u } = e, d = u && t ? Jt({
831
1291
  terminal: u,
832
1292
  hostEvents: t
833
- }) : void 0;
1293
+ }) : void 0, f = e.harnesses?.read.bind(e.harnesses);
834
1294
  return {
835
- "commands.execute": L("commands.execute", Ct(e)),
836
- "commands.stream": L("commands.stream", wt(e)),
837
- "navigation.open": L("navigation.open", n && ((e) => St(n.open(e.target), () => void 0))),
838
- "page.params.update": L("page.params.update", r && ((e) => {
1295
+ "harnesses.read": z("harnesses.read", f),
1296
+ "resources.actions": z("resources.actions", e.resourceActions),
1297
+ "commands.execute": z("commands.execute", xn(e)),
1298
+ "commands.stream": z("commands.stream", Sn(e)),
1299
+ "navigation.open": z("navigation.open", n && ((e) => bn(n.open(e.target), () => void 0))),
1300
+ "page.params.update": z("page.params.update", r && ((e) => {
839
1301
  let t = r.update(e.params);
840
1302
  return t instanceof Promise ? t.then((e) => ({ location: e })) : { location: t };
841
1303
  })),
842
- "placement.close": L("placement.close", i && (() => i.close())),
843
- "notification.show": L("notification.show", a?.show && ((e) => St(a.show("type" in e ? e : {
1304
+ "placement.close": z("placement.close", i && (() => i.close())),
1305
+ "notification.show": z("notification.show", a?.show && ((e) => bn(a.show("type" in e ? e : {
844
1306
  type: e.level,
845
1307
  ...e.title === void 0 ? {} : { title: e.title },
846
1308
  message: e.message ?? ""
847
1309
  }), () => void 0))),
848
- "notification.action": L("notification.action", a?.create && ((e) => a.create(e))),
849
- "notification.resolve": L("notification.resolve", a?.resolve && ((e) => a.resolve({
1310
+ "notification.action": z("notification.action", a?.create && ((e) => a.create(e))),
1311
+ "notification.resolve": z("notification.resolve", a?.resolve && ((e) => a.resolve({
850
1312
  ...e,
851
1313
  status: e.status ?? "done"
852
1314
  }))),
853
- "notification.dismiss": L("notification.dismiss", a?.resolve && ((e) => a.resolve({
1315
+ "notification.dismiss": z("notification.dismiss", a?.resolve && ((e) => a.resolve({
854
1316
  ...e,
855
1317
  status: "dismissed"
856
1318
  }))),
857
- "preferences.get": L("preferences.get", s && ((e) => s.get(e.name, e.scope))),
858
- "preferences.set": L("preferences.set", s && ((e) => {
1319
+ "preferences.get": z("preferences.get", s && ((e) => s.get(e.name, e.scope))),
1320
+ "preferences.set": z("preferences.set", s && ((e) => {
859
1321
  let t = e.scope ?? { scope: "user" };
860
- if (t.scope === "default") throw new P("preference_scope_read_only", "Default preferences are read-only.", {});
861
- return St(s.set(e.name, e.value, t), () => ({
1322
+ if (t.scope === "default") throw new L("preference_scope_read_only", "Default preferences are read-only.", {});
1323
+ return bn(s.set(e.name, e.value, t), () => ({
862
1324
  name: e.name,
863
1325
  value: e.value
864
1326
  }));
865
1327
  })),
866
- "extension.settings.all": L("extension.settings.all", o && (() => o.all())),
867
- "extension.settings.get": L("extension.settings.get", o && ((e) => o.get(e.key))),
868
- "extension.settings.set": L("extension.settings.set", o && (async (e) => ({
1328
+ "extension.settings.all": z("extension.settings.all", o && (() => o.all())),
1329
+ "extension.settings.get": z("extension.settings.get", o && ((e) => o.get(e.key))),
1330
+ "extension.settings.set": z("extension.settings.set", o && (async (e) => ({
869
1331
  key: e.key,
870
1332
  value: (await o.set(e.key, e.value)).value
871
1333
  }))),
872
- "extension.settings.delete": L("extension.settings.delete", o && ((e) => o.delete(e.key))),
873
- "terminal.session": L("terminal.session", d && ((e) => d(e))),
874
- "files.upload": L("files.upload", c && ((e) => c.upload(e))),
875
- "files.list": L("files.list", c && ((e) => c.list(e))),
876
- "files.delete": L("files.delete", c && ((e) => c.delete(e))),
877
- "artifacts.read": L("artifacts.read", l && ((e) => l.read(e)))
1334
+ "extension.settings.delete": z("extension.settings.delete", o && ((e) => o.delete(e.key))),
1335
+ "terminal.session": z("terminal.session", d && ((e) => d(e))),
1336
+ "files.upload": z("files.upload", c && ((e) => c.upload(e))),
1337
+ "files.list": z("files.list", c && ((e) => c.list(e))),
1338
+ "files.delete": z("files.delete", c && ((e) => c.delete(e))),
1339
+ "artifacts.read": z("artifacts.read", l && ((e) => l.read(e)))
878
1340
  };
879
- }, Et = (e, t) => {
1341
+ }, wn = (e, t) => {
880
1342
  let n = t.commandTargetOf?.(e);
881
1343
  if (n) return {
882
1344
  ...n,
@@ -890,19 +1352,19 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
890
1352
  ...t.region ? { region: t.region } : {}
891
1353
  };
892
1354
  };
893
- function R(e, t = {}) {
894
- if (!ne(e)) throw Error("Invalid navigation target.");
895
- return t.extensionId && (e = Se(e, t.extensionId, t.projectId)), e.kind === "command" ? Et(e, t) : e.kind === "href" || e.kind === "page" ? e : e.kind === "panel" ? {
1355
+ function B(e, t = {}) {
1356
+ if (!T(e)) throw Error("Invalid navigation target.");
1357
+ return t.extensionId && (e = pt(e, t.extensionId, t.projectId)), e.kind === "command" ? wn(e, t) : e.kind === "href" || e.kind === "page" ? e : e.kind === "panel" ? {
896
1358
  ...e,
897
1359
  ...t.region ? { region: t.region } : {}
898
1360
  } : {
899
1361
  kind: "compound",
900
- targets: e.targets.map((e) => R(e, t))
1362
+ targets: e.targets.map((e) => B(e, t))
901
1363
  };
902
1364
  }
903
1365
  //#endregion
904
1366
  //#region src/extensions/bridge/webview-preferences-capability.ts
905
- var Dt = (e) => {
1367
+ var Tn = (e) => {
906
1368
  let t = e.workbench.preferences, n = () => {
907
1369
  if (!e.extensionId) throw Error("Preferences require the calling extension identity");
908
1370
  return e.extensionId;
@@ -917,9 +1379,50 @@ var Dt = (e) => {
917
1379
  return r(i) ? t.setValue(i, a, o) : (n(), e.ownedPreferences ? e.ownedPreferences.set(i, a, o) : t.setOwnedValue(n(), i, a, o));
918
1380
  }
919
1381
  };
920
- }, Ot = (e) => {
1382
+ }, En = (e, t) => {
1383
+ let n, r = !1, i = () => {
1384
+ r || (r = !0, queueMicrotask(() => {
1385
+ r = !1, t?.emit({
1386
+ scope: vt,
1387
+ payload: { type: "changed" }
1388
+ });
1389
+ }));
1390
+ };
1391
+ return () => {
1392
+ if (!t || n) return;
1393
+ let r = c(e, i), a = t.onDisconnect(() => n?.());
1394
+ n = () => {
1395
+ r(), a(), n = void 0;
1396
+ };
1397
+ };
1398
+ }, Dn = (e, t, n) => {
1399
+ let r = En(e, n);
1400
+ return async (n) => {
1401
+ let i = a(e, t ? {
1402
+ ...n.resource,
1403
+ projectId: t
1404
+ } : n.resource), s = i ? u(o(i)) : [];
1405
+ if (n.operation === "execute") {
1406
+ let e = s.find(({ id: e }) => e === n.key);
1407
+ if (!e?.run || e.disabled) throw Error("This resource action is no longer available.");
1408
+ return await e.run(), [];
1409
+ }
1410
+ return r(), s.map((e) => ({
1411
+ key: e.id,
1412
+ label: e.label,
1413
+ commandId: e.commandId,
1414
+ icon: e.icon,
1415
+ iconSrc: e.iconSrc,
1416
+ description: e.description,
1417
+ isDisabled: e.disabled,
1418
+ separatorBefore: e.separatorBefore,
1419
+ group: e.group ?? i?.group
1420
+ }));
1421
+ };
1422
+ }, On = (e) => {
921
1423
  let { workbench: t, placement: n, extensionId: r, projectId: i, hostEvents: a } = e;
922
1424
  return {
1425
+ resourceActions: Dn(t, i, a),
923
1426
  hostEvents: a,
924
1427
  executeCommand: async (e, n) => ({ outcome: {
925
1428
  ok: !0,
@@ -936,27 +1439,34 @@ var Dt = (e) => {
936
1439
  if (!r || r !== n.location.page.extensionId) throw Error("page_params_not_owner");
937
1440
  return t.pageLocations.updateParams(e);
938
1441
  } },
939
- navigation: { open: (e) => t.navigation.openTarget(R(e, {
1442
+ navigation: { open: (e) => t.navigation.openTarget(B(e, {
940
1443
  extensionId: r,
941
1444
  projectId: i
942
1445
  })) },
943
- notifications: { show: (e) => t.notifications.show({
944
- level: e.type,
945
- metadata: e.metadata,
946
- title: e.title ?? e.message,
947
- message: e.title === void 0 ? void 0 : e.message
948
- }) },
949
- preferences: Dt(e),
1446
+ notifications: { show: (e) => {
1447
+ if (e.type === "error") {
1448
+ t.notifications.captureActionError(e.title ?? "Extension action", n?.instanceId)(Error(e.message));
1449
+ return;
1450
+ }
1451
+ t.notifications.show({
1452
+ level: e.type,
1453
+ metadata: e.metadata,
1454
+ title: e.title ?? e.message,
1455
+ message: e.title === void 0 ? void 0 : e.message
1456
+ });
1457
+ } },
1458
+ preferences: Tn(e),
950
1459
  terminal: t.terminal
951
1460
  };
952
- }, kt = (e) => Tt(Ot(e)), At = () => "light", jt = /* @__PURE__ */ new WeakMap(), Mt = (e, t) => {
953
- let n = jt.get(e);
954
- n || (n = /* @__PURE__ */ new Map(), jt.set(e, n));
1461
+ }, kn = (e) => Cn(On(e)), An = () => "light", jn = /* @__PURE__ */ new WeakMap(), Mn = (e, t) => {
1462
+ let n = jn.get(e);
1463
+ n || (n = /* @__PURE__ */ new Map(), jn.set(e, n));
955
1464
  let r = t.instanceId, i = n.get(r);
956
- return i || (i = Ye(), n.set(r, i)), i;
957
- }, Nt = (e) => {
958
- let { context: t, createHostAdapters: n, createProps: r, createTheme: i = At, ownerId: a, title: o, webview: s } = e;
959
- return /* @__PURE__ */ O(Xe, {
1465
+ return i || (i = Gt(), n.set(r, i)), i;
1466
+ }, Nn = (e) => {
1467
+ let { context: t, createHostAdapters: n, createProps: r, createTheme: i = An, ownerId: a, title: o, webview: s } = e;
1468
+ return /* @__PURE__ */ j(Kt, {
1469
+ sizing: e.sizing,
960
1470
  view: {
961
1471
  extensionId: a ?? "workbench",
962
1472
  id: t.webviewId,
@@ -971,16 +1481,16 @@ var Dt = (e) => {
971
1481
  props: r(t),
972
1482
  workbench: t.workbench,
973
1483
  theme: i(t),
974
- capabilities: Tt(n({
1484
+ capabilities: Cn(n({
975
1485
  ...t,
976
1486
  extensionId: a ?? t.extensionId
977
1487
  })),
978
1488
  hostEvents: t.hostEvents
979
1489
  });
980
- }, z = (e, t = "") => e === void 0 ? t : pe(e) ? e.default ?? e.$l10n : e, B = (e) => {
1490
+ }, V = (e, t = "") => e === void 0 ? t : it(e) ? e.default ?? e.$l10n : e, H = (e) => {
981
1491
  let t = e;
982
- return t?.outcome ? ee(t.outcome) : e;
983
- }, Pt = async (e, t, n, r, i) => {
1492
+ return t?.outcome ? C(t.outcome) : e;
1493
+ }, Pn = async (e, t, n, r, i) => {
984
1494
  let a = t.resourceMutation;
985
1495
  if (!a) return i();
986
1496
  let o = n?.[a.idParam] ?? r?.resource?.id;
@@ -991,7 +1501,7 @@ var Dt = (e) => {
991
1501
  extensionId: t.extensionId,
992
1502
  projectId: e.projectId
993
1503
  };
994
- if (a.kind === "remove" && !await e.workbench.commandPalette.requestConfirmation(z(t.title, "Delete"))) return;
1504
+ if (a.kind === "remove" && !await e.workbench.commandPalette.requestConfirmation(V(t.title, "Delete"))) return;
995
1505
  let c = a.kind === "rename" ? n?.[a.labelParam] : void 0;
996
1506
  if (a.kind === "rename" && (typeof c != "string" || !c.trim())) return i();
997
1507
  let l = e.workbench.resources.preview.begin(s, a.kind === "remove" ? { removed: !0 } : { label: c.trim() });
@@ -1001,15 +1511,15 @@ var Dt = (e) => {
1001
1511
  } catch (e) {
1002
1512
  throw l.rollback(), e;
1003
1513
  }
1004
- }, V = (e) => ({
1514
+ }, U = (e) => ({
1005
1515
  id: e.id,
1006
1516
  kind: e.kind,
1007
1517
  context: {
1008
1518
  projectId: e.projectId,
1009
1519
  ...e.context ?? {}
1010
1520
  }
1011
- }), H = async (e, t, n = {}) => {
1012
- let r = n.resource, i = await e.executeCommand(t, {
1521
+ }), W = async (e, t, n = {}) => {
1522
+ let r = n.resource, i = e.workbench.notifications.captureActionError("Open command result"), a = await e.executeCommand(t, {
1013
1523
  projectId: e.projectId,
1014
1524
  ...n.workspaceId ? { workspaceId: n.workspaceId } : {},
1015
1525
  ...n.params ? { params: n.params } : {},
@@ -1017,34 +1527,36 @@ var Dt = (e) => {
1017
1527
  ...n.slot ? { slot: n.slot } : {},
1018
1528
  source: "dashboard",
1019
1529
  ...n.metadata ? { metadata: n.metadata } : {}
1020
- }, n.signal), a = i?.outcome;
1021
- if (a?.status === "success") for (let t of a.navigationRequests ?? []) try {
1022
- await e.workbench.navigation.openTarget(R(t, { region: n.region }));
1023
- } catch (t) {
1024
- e.workbench.notifications.show({
1025
- level: "warning",
1026
- title: "Command completed, but navigation failed",
1027
- message: t instanceof Error ? t.message : String(t)
1028
- });
1530
+ }, n.signal), o = a?.outcome;
1531
+ if (o?.status === "success") for (let t of o.navigationRequests ?? []) try {
1532
+ await e.workbench.navigation.openTarget(B(t, { region: n.region }));
1533
+ } catch (e) {
1534
+ i(e);
1029
1535
  }
1030
- return i;
1031
- }, U = async (e, t, n = {}) => {
1032
- let r = async () => B(await H(e, t, n)), i = e.metadata?.commands.find((e) => e.id === t);
1033
- return i ? Pt(e, i, n.params, { resource: n.resource }, r) : r();
1034
- }, Ft = (e) => typeof e == "object" && !!e && !Array.isArray(e), It = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Lt = async (e, t, n) => {
1536
+ return a;
1537
+ }, G = async (e, t, n = {}) => {
1538
+ let i = e.metadata?.commands.find((e) => e.id === t), a = i ? {
1539
+ ...r(i.params, n.params, { resource: n.resource }),
1540
+ ...n.params
1541
+ } : n.params, o = async () => H(await W(e, t, {
1542
+ ...n,
1543
+ params: a
1544
+ }));
1545
+ return i ? Pn(e, i, a, { resource: n.resource }, o) : o();
1546
+ }, Fn = (e) => typeof e == "object" && !!e && !Array.isArray(e), In = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Ln = async (e, t, n) => {
1035
1547
  let { target: r } = n;
1036
1548
  if (r.kind === "command") {
1037
- await U(e, It(r.target.command, t.extensionId), { params: r.target.params }), e.workbench.commandPaletteResources.refresh();
1549
+ await G(e, In(r.target.command, t.extensionId), { params: r.target.params }), e.workbench.commandPaletteResources.refresh();
1038
1550
  return;
1039
1551
  }
1040
- await e.workbench.navigation.openTarget(R(r, { extensionId: t.extensionId }));
1041
- }, Rt = (e) => {
1552
+ await e.workbench.navigation.openTarget(B(r, { extensionId: t.extensionId }));
1553
+ }, Rn = (e) => {
1042
1554
  if (e.kind === "page" || e.kind === "panel") return e.resource;
1043
1555
  if (e.kind === "compound") return e.targets.find((e) => e.resource)?.resource;
1044
- }, zt = (e, t, n, r) => ({
1556
+ }, zn = (e, t, n, r) => ({
1045
1557
  id: `${t.id}:${r.id}`,
1046
1558
  resource: (() => {
1047
- let n = Rt(r.target);
1559
+ let n = Rn(r.target);
1048
1560
  return n ? {
1049
1561
  ...n,
1050
1562
  projectId: n.projectId ?? e.projectId,
@@ -1056,17 +1568,17 @@ var Dt = (e) => {
1056
1568
  icon: r.icon,
1057
1569
  keywords: r.keywords,
1058
1570
  group: n,
1059
- activate: () => Lt(e, t, r)
1060
- }), Bt = (e, t) => {
1571
+ activate: () => Ln(e, t, r)
1572
+ }), Bn = (e, t) => {
1061
1573
  let n = [];
1062
1574
  for (let r of t) {
1063
- let t = z(r.title, r.id);
1575
+ let t = V(r.title, r.id);
1064
1576
  n.push(e.workbench.commandPaletteResources.registerProvider({
1065
1577
  id: r.id,
1066
1578
  title: t,
1067
1579
  refreshEventIds: r.refreshEventIds,
1068
1580
  query: async ({ query: n, limit: i, signal: a }) => {
1069
- let o = e.workbench.getActiveResource(), s = await U(e, r.queryHandlerId, {
1581
+ let o = e.workbench.getActiveResource(), s = await G(e, r.queryHandlerId, {
1070
1582
  signal: a,
1071
1583
  params: {
1072
1584
  projectId: e.projectId,
@@ -1077,20 +1589,20 @@ var Dt = (e) => {
1077
1589
  limit: i
1078
1590
  }
1079
1591
  });
1080
- return Ft(s) ? (s.items ?? []).map((n) => zt(e, r, t, n)) : [];
1592
+ return Fn(s) ? (s.items ?? []).map((n) => zn(e, r, t, n)) : [];
1081
1593
  }
1082
1594
  }));
1083
1595
  }
1084
1596
  return { dispose() {
1085
1597
  for (let e = n.length - 1; e >= 0; --e) n[e]?.dispose();
1086
1598
  } };
1087
- }, Vt = (e, t = "") => z(e, t), Ht = (e, t, n) => {
1088
- let r = V({
1599
+ }, Vn = (e, t = "") => V(e, t), Hn = (e, t, n) => {
1600
+ let r = U({
1089
1601
  id: t.id,
1090
1602
  kind: "renderer",
1091
1603
  projectId: e.projectId,
1092
1604
  context: { controlsRendererId: t.id }
1093
- }), i = (n, i, a, o, s) => n ? U(e, n, {
1605
+ }), a = (n, i, a, o, s) => n ? G(e, n, {
1094
1606
  params: {
1095
1607
  renderer: {
1096
1608
  rendererId: t.id,
@@ -1108,84 +1620,84 @@ var Dt = (e) => {
1108
1620
  }) : Promise.resolve(void 0);
1109
1621
  return e.workbench.views.registerView({
1110
1622
  id: t.id,
1111
- title: Vt(t.title, t.id),
1623
+ title: Vn(t.title, t.id),
1112
1624
  icon: t.icon,
1113
1625
  body: {
1114
1626
  kind: "controls",
1115
- emptyTitle: Vt(t.emptyTitle, ""),
1116
- emptyDescription: Vt(t.emptyDescription, ""),
1627
+ emptyTitle: Vn(t.emptyTitle, ""),
1628
+ emptyDescription: Vn(t.emptyDescription, ""),
1117
1629
  defaultValues: t.defaultValues,
1118
- executeQuery: async (e, r, a) => {
1119
- let o = await i(t.queryHandlerId, {}, e ?? n.resolveResource?.(t), r, a), s = c.safeParse(o);
1120
- if (!s.success) {
1121
- let e = s.error.issues.map((e) => `body.query.${e.path.join(".")}: ${e.message}`).join("; ");
1630
+ executeQuery: async (e, r, o) => {
1631
+ let s = await a(t.queryHandlerId, {}, e ?? n.resolveResource?.(t), r, o), c = i.safeParse(s);
1632
+ if (!c.success) {
1633
+ let e = c.error.issues.map((e) => `body.query.${e.path.join(".")}: ${e.message}`).join("; ");
1122
1634
  throw Error(`Extension "${t.extensionId}" view "${t.id}" has invalid controls. Expected serializable control declarations. ${e}`);
1123
1635
  }
1124
- return s.data;
1636
+ return c.data;
1125
1637
  },
1126
- updateValue: t.valueChangeHandlerId ? ({ controlId: e, value: n, values: r, resource: a }) => i(t.valueChangeHandlerId, {
1638
+ updateValue: t.valueChangeHandlerId ? ({ controlId: e, value: n, values: r, resource: i }) => a(t.valueChangeHandlerId, {
1127
1639
  controlId: e,
1128
1640
  value: n,
1129
1641
  values: r
1130
- }, a).then(() => void 0) : void 0,
1131
- apply: t.applyHandlerId ? ({ values: e, resource: n }) => i(t.applyHandlerId, { values: e }, n).then(() => void 0) : void 0,
1132
- reset: t.resetHandlerId ? ({ controlIds: e, resource: n }) => i(t.resetHandlerId, { controlIds: e }, n).then(() => void 0) : void 0
1642
+ }, i).then(() => void 0) : void 0,
1643
+ apply: t.applyHandlerId ? ({ values: e, resource: n }) => a(t.applyHandlerId, { values: e }, n).then(() => void 0) : void 0,
1644
+ reset: t.resetHandlerId ? ({ controlIds: e, resource: n }) => a(t.resetHandlerId, { controlIds: e }, n).then(() => void 0) : void 0
1133
1645
  }
1134
1646
  });
1135
- }, Ut = (e, t, n = {}) => {
1647
+ }, Un = (e, t, n = {}) => {
1136
1648
  let r = [];
1137
- for (let i of t) r.push(Ht(e, i, n));
1649
+ for (let i of t) r.push(Hn(e, i, n));
1138
1650
  return { dispose() {
1139
1651
  for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
1140
1652
  } };
1141
- }, W = (e, t, n) => {
1653
+ }, K = (e, t, n) => {
1142
1654
  if (e) return Object.fromEntries(Object.entries(e).map(([e, r]) => [e, {
1143
1655
  ...r,
1144
- ...r.options && !Array.isArray(r.options) ? { options: Wt(r.options, n) } : {},
1656
+ ...r.options && !Array.isArray(r.options) ? { options: Wn(r.options, n) } : {},
1145
1657
  label: r.label === void 0 ? void 0 : t(r.label, e),
1146
1658
  description: r.description === void 0 ? void 0 : t(r.description)
1147
1659
  }]));
1148
- }, Wt = (e, t) => {
1660
+ }, Wn = (e, t) => {
1149
1661
  let n = e;
1150
1662
  return {
1151
1663
  valueField: n.valueField,
1152
1664
  labelField: n.labelField,
1153
1665
  params: n.params,
1154
- commandId: S({
1666
+ commandId: x({
1155
1667
  id: n.command.id,
1156
1668
  extensionId: n.command.extensionId ?? t ?? "pstdio"
1157
1669
  })
1158
1670
  };
1159
- }, Gt = (e) => e.toolbarActions?.map((t) => ({
1671
+ }, Gn = (e) => e.toolbarActions?.map((t) => ({
1160
1672
  id: t.id,
1161
- label: z(t.label, t.id),
1673
+ label: V(t.label, t.id),
1162
1674
  icon: t.icon,
1163
1675
  presentation: t.presentation,
1164
1676
  commandId: t.commandId,
1165
1677
  args: t.params,
1166
- params: W(t.input, z, e.extensionId),
1678
+ params: K(t.input, V, e.extensionId),
1167
1679
  submitLabel: t.submitLabel,
1168
1680
  disabled: t.disabled,
1169
1681
  when: t.when
1170
- })), G = (e, t = "") => z(e, t), Kt = (e) => ({
1682
+ })), q = (e, t = "") => V(e, t), Kn = (e) => ({
1171
1683
  ...e,
1172
- label: G(e.label, e.id),
1173
- description: e.description ? G(e.description) : void 0,
1174
- icon: e.icon ? T(v, {
1684
+ label: q(e.label, e.id),
1685
+ description: e.description ? q(e.description) : void 0,
1686
+ icon: e.icon ? D(d, {
1175
1687
  name: e.icon,
1176
1688
  size: 14
1177
1689
  }) : void 0
1178
- }), qt = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), Jt = (e) => ({
1690
+ }), qn = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), Jn = (e) => ({
1179
1691
  id: e.id,
1180
1692
  values: e.values,
1181
1693
  resource: e.resource ? e.resource : void 0
1182
- }), Yt = (e, t, n) => {
1183
- let r = o(t), i = /* @__PURE__ */ new WeakMap(), a = V({
1694
+ }), Yn = (e, t, n) => {
1695
+ let r = nt(t), i = /* @__PURE__ */ new WeakMap(), a = U({
1184
1696
  id: t.id,
1185
1697
  kind: "dataTableRenderer",
1186
1698
  projectId: e.projectId,
1187
1699
  context: { dataTableRendererId: t.id }
1188
- }), s = (n, r, i, o, s, c) => U(e, n, {
1700
+ }), o = (n, r, i, o, s, c) => G(e, n, {
1189
1701
  params: {
1190
1702
  renderer: {
1191
1703
  rendererId: t.id,
@@ -1204,13 +1716,13 @@ var Dt = (e) => {
1204
1716
  });
1205
1717
  return e.workbench.views.registerView({
1206
1718
  id: t.id,
1207
- title: G(t.title, t.id),
1719
+ title: q(t.title, t.id),
1208
1720
  icon: t.icon,
1209
1721
  body: {
1210
1722
  kind: "dataTable",
1211
1723
  resourceKind: t.resourceKind,
1212
- toolbarActions: Gt(t),
1213
- columns: t.columns?.map(Kt),
1724
+ toolbarActions: Gn(t),
1725
+ columns: t.columns?.map(Kn),
1214
1726
  initialPageSize: t.initialPageSize,
1215
1727
  pageSizeOptions: t.pageSizeOptions,
1216
1728
  defaultSettings: r.settings,
@@ -1218,7 +1730,7 @@ var Dt = (e) => {
1218
1730
  defaultSorts: t.defaultSorts,
1219
1731
  defaultViews: r.views.map((e) => ({
1220
1732
  ...e,
1221
- title: G(e.title, e.id)
1733
+ title: q(e.title, e.id)
1222
1734
  })),
1223
1735
  defaultActiveViewId: t.defaultActiveViewId,
1224
1736
  viewsProvider: n.createViewsProvider?.(t),
@@ -1226,58 +1738,58 @@ var Dt = (e) => {
1226
1738
  selectionActions: t.selectionActions?.map((e) => ({
1227
1739
  id: e.id,
1228
1740
  commandId: e.commandId,
1229
- label: G(e.label, e.id),
1230
- icon: e.icon ? T(v, {
1741
+ label: q(e.label, e.id),
1742
+ icon: e.icon ? D(d, {
1231
1743
  name: e.icon,
1232
1744
  size: 16
1233
1745
  }) : void 0,
1234
1746
  destructive: e.destructive,
1235
- run: (t) => s(e.commandId, { rowIds: t.map((e) => e.id) }).then(() => void 0)
1747
+ run: (t) => o(e.commandId, { rowIds: t.map((e) => e.id) }).then(() => void 0)
1236
1748
  })),
1237
- emptyTitle: t.emptyTitle ? G(t.emptyTitle) : void 0,
1238
- emptyDescription: t.emptyDescription ? G(t.emptyDescription) : void 0,
1239
- executeQuery: async ({ resource: e, modeId: r, filter: a, sorts: o, settings: c, pageParams: l }, u) => {
1240
- let d = await s(t.queryHandlerId, {
1749
+ emptyTitle: t.emptyTitle ? q(t.emptyTitle) : void 0,
1750
+ emptyDescription: t.emptyDescription ? q(t.emptyDescription) : void 0,
1751
+ executeQuery: async ({ resource: e, modeId: r, filter: a, sorts: s, settings: c, pageParams: l }, u) => {
1752
+ let d = await o(t.queryHandlerId, {
1241
1753
  filter: a,
1242
- sorts: o,
1754
+ sorts: s,
1243
1755
  settings: c
1244
1756
  }, e, r, u, l);
1245
- return qt(d) ? {
1757
+ return qn(d) ? {
1246
1758
  rows: d.rows.map((e) => {
1247
- let r = Jt(e);
1759
+ let r = Jn(e);
1248
1760
  return n.resolveRowResource && (r.resource = n.resolveRowResource(t, e)), i.set(r, e), r;
1249
1761
  }),
1250
- columns: d.columns?.map(Kt)
1762
+ columns: d.columns?.map(Kn)
1251
1763
  } : { rows: [] };
1252
1764
  },
1253
1765
  rowActions: t.rowActions?.map((n) => ({
1254
1766
  id: n.id,
1255
1767
  commandId: n.commandId,
1256
- label: G(n.label, n.id),
1257
- icon: n.icon ? T(v, {
1768
+ label: q(n.label, n.id),
1769
+ icon: n.icon ? D(d, {
1258
1770
  name: n.icon,
1259
1771
  size: 16
1260
1772
  }) : void 0,
1261
1773
  destructive: n.destructive,
1262
1774
  run: async (r) => {
1263
- await s(n.commandId, { rowId: r.id }, r.resource), e.workbench.views.refreshView(t.id);
1775
+ await o(n.commandId, { rowId: r.id }, r.resource), e.workbench.views.refreshView(t.id);
1264
1776
  }
1265
1777
  })),
1266
1778
  onRowActivate: t.rowActivationHandlerId ? async (e) => {
1267
- await s(t.rowActivationHandlerId, { row: i.get(e) ?? e }, e.resource);
1779
+ await o(t.rowActivationHandlerId, { row: i.get(e) ?? e }, e.resource);
1268
1780
  } : void 0
1269
1781
  }
1270
1782
  });
1271
- }, Xt = (e, t, n = {}) => {
1272
- let r = t.map((t) => Yt(e, t, n));
1783
+ }, Xn = (e, t, n = {}) => {
1784
+ let r = t.map((t) => Yn(e, t, n));
1273
1785
  return { dispose() {
1274
1786
  for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
1275
1787
  } };
1276
- }, Zt = {
1788
+ }, Zn = {
1277
1789
  first: 0,
1278
1790
  default: 1,
1279
1791
  last: 2
1280
- }, Qt = {
1792
+ }, Qn = {
1281
1793
  commands: [],
1282
1794
  commandPaletteContributions: [],
1283
1795
  diagnostics: [],
@@ -1294,7 +1806,7 @@ var Dt = (e) => {
1294
1806
  statusBarItems: [],
1295
1807
  settingsPanels: [],
1296
1808
  settingsDefinitions: []
1297
- }, $t = (e) => `workbench.extension.menu.${e.id}`, en = (e) => `workbench.extension.palette.${e.id}`, tn = (e, t) => Zt[e.placement ?? "default"] * 1e3 + t, nn = (e) => e === void 0 ? "" : te(e) ? e.default ?? e.$l10n : e, rn = (e) => {
1809
+ }, $n = (e) => `workbench.extension.menu.${e.id}`, er = (e) => `workbench.extension.palette.${e.id}`, tr = (e, t) => Zn[e.placement ?? "default"] * 1e3 + t, nr = (e) => e === void 0 ? "" : w(e) ? e.default ?? e.$l10n : e, rr = (e) => {
1298
1810
  let { commandId: t, contribution: n, index: r, resolveString: i, slot: a, when: o, disabledWhen: s } = e;
1299
1811
  return {
1300
1812
  commandId: t,
@@ -1306,12 +1818,12 @@ var Dt = (e) => {
1306
1818
  resourceGroup: a.resourceGroup,
1307
1819
  args: n.params,
1308
1820
  overflowLabel: a.overflowLabel,
1309
- order: tn(n, r),
1821
+ order: tr(n, r),
1310
1822
  when: o,
1311
1823
  disabledWhen: s,
1312
1824
  disabledReason: i(n.disabledReason, n.extensionId)
1313
1825
  };
1314
- }, an = (e) => {
1826
+ }, ir = (e) => {
1315
1827
  let { commandId: t, contribution: n, index: r, resolveString: i } = e;
1316
1828
  return {
1317
1829
  commandId: t,
@@ -1320,10 +1832,10 @@ var Dt = (e) => {
1320
1832
  icon: n.icon,
1321
1833
  group: n.group,
1322
1834
  args: n.params,
1323
- order: tn(n, r)
1835
+ order: tr(n, r)
1324
1836
  };
1325
- }, on = (e) => {
1326
- let { createCommandId: t = $t, createWhenExpression: n, menuSlotsById: r, menuTargetsById: i, metadata: a, resolveString: o = nn } = e, s = [], c = [];
1837
+ }, ar = (e) => {
1838
+ let { createCommandId: t = $n, createWhenExpression: n, menuSlotsById: r, menuTargetsById: i, metadata: a, resolveString: o = nr } = e, s = [], c = [];
1327
1839
  return a.menuContributions.forEach((e, l) => {
1328
1840
  let u = e.target ? i?.get(e.target) : r.get(e.slotId);
1329
1841
  if (!u) {
@@ -1342,10 +1854,10 @@ var Dt = (e) => {
1342
1854
  resourceMutation: f?.resourceMutation,
1343
1855
  description: f ? o(f.description, f.extensionId) : void 0,
1344
1856
  icon: e.icon,
1345
- params: W(f?.params, (t) => o(t, f?.extensionId ?? e.extensionId), f?.extensionId)
1857
+ params: K(f?.params, (t) => o(t, f?.extensionId ?? e.extensionId), f?.extensionId)
1346
1858
  },
1347
1859
  contribution: e,
1348
- menuItem: rn({
1860
+ menuItem: rr({
1349
1861
  commandId: d,
1350
1862
  contribution: e,
1351
1863
  index: l,
@@ -1364,8 +1876,8 @@ var Dt = (e) => {
1364
1876
  registrations: s,
1365
1877
  unresolved: c
1366
1878
  };
1367
- }, sn = (e) => {
1368
- let { createCommandId: t = en, metadata: n, resolveString: r = nn } = e, i = [];
1879
+ }, or = (e) => {
1880
+ let { createCommandId: t = er, metadata: n, resolveString: r = nr } = e, i = [];
1369
1881
  return (n.commandPaletteContributions ?? []).forEach((e, a) => {
1370
1882
  let o = t(e), s = n.commands.find((t) => t.id === e.commandId);
1371
1883
  i.push({
@@ -1375,10 +1887,10 @@ var Dt = (e) => {
1375
1887
  category: e.group,
1376
1888
  description: s ? r(s.description, s.extensionId) : void 0,
1377
1889
  icon: e.icon,
1378
- params: W(s?.params, (t) => r(t, s?.extensionId ?? e.extensionId), s?.extensionId)
1890
+ params: K(s?.params, (t) => r(t, s?.extensionId ?? e.extensionId), s?.extensionId)
1379
1891
  },
1380
1892
  contribution: e,
1381
- menuItem: an({
1893
+ menuItem: ir({
1382
1894
  commandId: o,
1383
1895
  contribution: e,
1384
1896
  index: a,
@@ -1387,7 +1899,7 @@ var Dt = (e) => {
1387
1899
  targetCommandId: e.commandId
1388
1900
  });
1389
1901
  }), i;
1390
- }, cn = (e) => ({
1902
+ }, sr = (e) => ({
1391
1903
  id: e.rendererId,
1392
1904
  kind: "renderer",
1393
1905
  context: {
@@ -1397,9 +1909,9 @@ var Dt = (e) => {
1397
1909
  resourceId: e.resource.id
1398
1910
  } : {}
1399
1911
  }
1400
- }), ln = async (e, t, n, r, i = {}, a, o, s) => {
1912
+ }), cr = async (e, t, n, r, i = {}, a, o, s) => {
1401
1913
  let c = r;
1402
- return H(e, n, {
1914
+ return W(e, n, {
1403
1915
  params: {
1404
1916
  renderer: {
1405
1917
  rendererId: t,
@@ -1412,23 +1924,23 @@ var Dt = (e) => {
1412
1924
  },
1413
1925
  resource: c,
1414
1926
  signal: o,
1415
- slot: cn({
1927
+ slot: sr({
1416
1928
  projectId: e.projectId,
1417
1929
  rendererId: t,
1418
1930
  resource: c
1419
1931
  }),
1420
1932
  ...a ? { metadata: a } : {}
1421
1933
  });
1422
- }, un = (e) => {
1934
+ }, lr = (e) => {
1423
1935
  if (!e || typeof e != "object") return;
1424
1936
  let t = e.revision;
1425
1937
  return typeof t == "string" ? t : void 0;
1426
- }, dn = (e, t) => {
1938
+ }, ur = (e, t) => {
1427
1939
  let n = e.metadata, r = n?.fileRendererOrigin;
1428
1940
  if (!r || typeof r != "object") return;
1429
1941
  let i = r;
1430
1942
  if (typeof i.rendererId != "string" || typeof i.instanceId != "string" || typeof i.operationId != "string") return;
1431
- let a = n?.fileRendererResourceKey, o = t.outcome.ok ? un(t.outcome.value) : void 0;
1943
+ let a = n?.fileRendererResourceKey, o = t.outcome.ok ? lr(t.outcome.value) : void 0;
1432
1944
  return {
1433
1945
  origin: {
1434
1946
  rendererId: i.rendererId,
@@ -1438,42 +1950,42 @@ var Dt = (e) => {
1438
1950
  ...typeof a == "string" ? { resourceKey: a } : {},
1439
1951
  ...o ? { revision: o } : {}
1440
1952
  };
1441
- }, fn = (e, t) => e.workbench.views.registerView({
1953
+ }, dr = (e, t) => e.workbench.views.registerView({
1442
1954
  id: t.id,
1443
- title: z(t.title, t.id),
1955
+ title: V(t.title, t.id),
1444
1956
  icon: t.icon,
1445
1957
  body: {
1446
1958
  kind: "file",
1447
1959
  resourceKind: t.resourceKind,
1448
1960
  load: async (n, r, i) => {
1449
- let a = await ln(e, t.id, t.loadHandlerId, n, {}, { fileStorageVersions: {} }, r, i);
1450
- return _(B(a) ?? {}, a);
1961
+ let a = await cr(e, t.id, t.loadHandlerId, n, {}, { fileStorageVersions: {} }, r, i);
1962
+ return s(H(a) ?? {}, a);
1451
1963
  },
1452
1964
  save: t.saveHandlerId ? async (n, r, i, a) => {
1453
- let o = await ln(e, t.id, t.saveHandlerId, n, { content: r }, {
1454
- fileStorageVersions: y(a),
1965
+ let o = await cr(e, t.id, t.saveHandlerId, n, { content: r }, {
1966
+ fileStorageVersions: l(a),
1455
1967
  ...i ? { fileRendererOrigin: i } : {},
1456
- ...w(n) ? { fileRendererResourceKey: w(n) } : {}
1457
- }), s = un(B(o));
1458
- return _(s ? { revision: s } : {}, o);
1968
+ ...E(n) ? { fileRendererResourceKey: E(n) } : {}
1969
+ }), c = lr(H(o));
1970
+ return s(c ? { revision: c } : {}, o);
1459
1971
  } : void 0
1460
1972
  }
1461
- }), pn = (e) => {
1973
+ }), fr = (e) => {
1462
1974
  let t = [];
1463
- for (let n of e.metadata.fileRenderers ?? []) t.push(fn(e, n));
1975
+ for (let n of e.metadata.fileRenderers ?? []) t.push(dr(e, n));
1464
1976
  return { dispose() {
1465
1977
  for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
1466
1978
  } };
1467
- }, mn = (e, t, n, r, i) => {
1979
+ }, pr = (e, t, n, r, i) => {
1468
1980
  let a = e.attributes[t]?.find((e) => e.id === n);
1469
- return a?.target ? R(a.target, {
1981
+ return a?.target ? B(a.target, {
1470
1982
  extensionId: r,
1471
1983
  projectId: i
1472
1984
  }) : void 0;
1473
- }, hn = (e) => (t) => T(v, {
1985
+ }, mr = (e) => (t) => D(d, {
1474
1986
  name: e ?? "MoreHorizontal",
1475
1987
  ...t
1476
- }), gn = (e, t) => ({
1988
+ }), hr = (e, t) => ({
1477
1989
  color: e?.color,
1478
1990
  canDragIn: e?.canDragIn,
1479
1991
  canDragOut: e?.canDragOut,
@@ -1481,9 +1993,9 @@ var Dt = (e) => {
1481
1993
  actions: e?.actions?.map((e) => ({
1482
1994
  id: e.id,
1483
1995
  label: t(e.label, e.id),
1484
- icon: hn(e.icon)
1996
+ icon: mr(e.icon)
1485
1997
  }))
1486
- }), _n = (e) => typeof e == "object" && !!e && !Array.isArray(e), vn = (e, t, n, r, i) => (t ?? []).map((t) => {
1998
+ }), gr = (e) => typeof e == "object" && !!e && !Array.isArray(e), _r = (e, t, n, r, i) => (t ?? []).map((t) => {
1487
1999
  let a = t.display, o = a?.kind === "badge-list" && typeof a.itemsAttributeId == "string" ? {
1488
2000
  kind: "badge-list",
1489
2001
  itemsAttributeId: a.itemsAttributeId
@@ -1505,8 +2017,8 @@ var Dt = (e) => {
1505
2017
  type: s(),
1506
2018
  display: o
1507
2019
  });
1508
- }), yn = (e, t, n, r, i) => {
1509
- let a = vn(e, t, n, r, i), o = /* @__PURE__ */ new Set(), s = JSON.stringify(t);
2020
+ }), vr = (e, t, n, r, i) => {
2021
+ let a = _r(e, t, n, r, i), o = /* @__PURE__ */ new Set(), s = JSON.stringify(t);
1510
2022
  return {
1511
2023
  source: {
1512
2024
  getSnapshot: () => a,
@@ -1515,29 +2027,29 @@ var Dt = (e) => {
1515
2027
  set(t) {
1516
2028
  let c = JSON.stringify(t);
1517
2029
  if (c !== s) {
1518
- s = c, a = vn(e, t, n, r, i);
2030
+ s = c, a = _r(e, t, n, r, i);
1519
2031
  for (let e of o) e();
1520
2032
  }
1521
2033
  }
1522
2034
  };
1523
- }, bn = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), xn = (e, t) => {
2035
+ }, yr = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), br = (e, t) => {
1524
2036
  let { resource: n } = t;
1525
- if (bn(n)) return n;
1526
- }, Sn = (e, t) => {
1527
- let n = xn(e, t);
2037
+ if (yr(n)) return n;
2038
+ }, xr = (e, t) => {
2039
+ let n = br(e, t);
1528
2040
  if (n) return n;
1529
2041
  if (e.resourceKind) return {
1530
2042
  type: e.resourceKind,
1531
2043
  id: t.id,
1532
2044
  label: t.title
1533
2045
  };
1534
- }, Cn = (e, t) => {
2046
+ }, Sr = (e, t) => {
1535
2047
  let n = e, r = t(n);
1536
2048
  return r === void 0 ? n : {
1537
2049
  ...n,
1538
2050
  resource: r
1539
2051
  };
1540
- }, wn = (...e) => Object.assign({}, ...e.filter((e) => !!e)), Tn = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, En = (e) => Object.keys(e ?? {}).length > 0, Dn = /* @__PURE__ */ new Set([
2052
+ }, Cr = (...e) => Object.assign({}, ...e.filter((e) => !!e)), wr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Tr = (e) => Object.keys(e ?? {}).length > 0, Er = /* @__PURE__ */ new Set([
1541
2053
  "text",
1542
2054
  "longtext",
1543
2055
  "markdown",
@@ -1546,8 +2058,8 @@ var Dt = (e) => {
1546
2058
  "select",
1547
2059
  "multi-select",
1548
2060
  "files"
1549
- ]), On = (e, t, n) => {
1550
- if (!Dn.has(t.type)) return;
2061
+ ]), Dr = (e, t, n) => {
2062
+ if (!Er.has(t.type)) return;
1551
2063
  let r = "options" in t && Array.isArray(t.options) ? t.options : [], i = t;
1552
2064
  return {
1553
2065
  id: e,
@@ -1565,17 +2077,17 @@ var Dt = (e) => {
1565
2077
  multiple: t.type === "files" ? i.multiple !== !1 : void 0,
1566
2078
  accept: t.type === "files" && typeof i.accept == "string" ? i.accept : void 0
1567
2079
  };
1568
- }, kn = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([e, n]) => {
1569
- let r = On(e, n, t);
2080
+ }, Or = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([e, n]) => {
2081
+ let r = Dr(e, n, t);
1570
2082
  return r ? [r] : [];
1571
- }), An = (e, t) => V({
2083
+ }), kr = (e, t) => U({
1572
2084
  id: t.id,
1573
2085
  kind: "kanbanRenderer",
1574
2086
  projectId: e.projectId,
1575
2087
  context: { kanbanRendererId: t.id }
1576
- }), K = (e, t, n, r, i, a, o) => {
2088
+ }), J = (e, t, n, r, i, a, o) => {
1577
2089
  let s = i ?? e.workbench.getPrimaryResource();
1578
- return U(e, n, {
2090
+ return G(e, n, {
1579
2091
  params: {
1580
2092
  renderer: {
1581
2093
  rendererId: t.id,
@@ -1588,33 +2100,33 @@ var Dt = (e) => {
1588
2100
  },
1589
2101
  resource: s,
1590
2102
  signal: a,
1591
- slot: An(e, t),
2103
+ slot: kr(e, t),
1592
2104
  metadata: { kanbanRendererId: t.id }
1593
2105
  });
1594
- }, jn = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, Mn = (e, t, n) => (t.rowActions ?? []).map((r) => {
2106
+ }, Ar = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, jr = (e, t, n) => (t.rowActions ?? []).map((r) => {
1595
2107
  let i = e.workbench.commands.getCommand(r.commandId)?.command;
1596
2108
  return e.workbench.commands.registerCommand({
1597
- id: jn(t, r),
2109
+ id: Ar(t, r),
1598
2110
  label: n(r.label, r.id),
1599
2111
  icon: r.icon,
1600
2112
  params: i?.params
1601
- }, { execute: (n, i) => K(e, t, r.commandId, wn(Tn(n)), i?.resource) });
1602
- }), Nn = (e, t, n, r, i, a) => {
1603
- let o = jn(t, n), s = e.workbench.commands.getCommand(o), c = { rowId: r.id }, l = i ? { resource: i } : void 0, u = a(n.label, n.id);
1604
- return s && En(s.command.params) ? (e.workbench.commandPalette.requestParams({
2113
+ }, { execute: (n, i) => J(e, t, r.commandId, Cr(wr(n)), i?.resource) });
2114
+ }), Mr = (e, t, n, r, i, a) => {
2115
+ let o = Ar(t, n), s = e.workbench.commands.getCommand(o), c = { rowId: r.id }, l = i ? { resource: i } : void 0, u = a(n.label, n.id);
2116
+ return s && Tr(s.command.params) ? (e.workbench.commandPalette.requestParams({
1605
2117
  record: s,
1606
2118
  label: u,
1607
2119
  args: c,
1608
2120
  context: l
1609
- }), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) : K(e, t, n.commandId, c, i).then(() => void 0);
1610
- }, Pn = (e) => e ? T(v, {
2121
+ }), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) : J(e, t, n.commandId, c, i).then(() => void 0);
2122
+ }, Nr = (e) => e ? D(d, {
1611
2123
  name: e,
1612
2124
  size: 16
1613
- }) : void 0, Fn = (e, t) => {
2125
+ }) : void 0, Pr = (e, t) => {
1614
2126
  if (e.createRow) return {
1615
2127
  title: t(e.createRow.title, "Create row"),
1616
2128
  submitLabel: t(e.createRow.submitLabel, "Create"),
1617
- fields: kn(e, t),
2129
+ fields: Or(e, t),
1618
2130
  labels: {
1619
2131
  cancel: t(e.createRow.labels?.cancel, "Cancel"),
1620
2132
  properties: t(e.createRow.labels?.properties, "Properties"),
@@ -1623,20 +2135,20 @@ var Dt = (e) => {
1623
2135
  submitWithoutOpening: t(void 0, "Create without opening")
1624
2136
  }
1625
2137
  };
1626
- }, In = (e, t, n, r, i) => {
2138
+ }, Fr = (e, t, n, r, i) => {
1627
2139
  if (t.rowActivationHandlerId) return async (n) => {
1628
2140
  let a = r(t, n);
1629
- await K(e, t, t.rowActivationHandlerId, { row: i(n) }, a);
2141
+ await J(e, t, t.rowActivationHandlerId, { row: i(n) }, a);
1630
2142
  };
1631
2143
  if (n.onRowClick) return (e) => n.onRowClick?.({
1632
2144
  record: t,
1633
2145
  row: e,
1634
2146
  resource: r(t, e)
1635
2147
  });
1636
- }, Ln = (e, t, n, r) => {
2148
+ }, Ir = (e, t, n, r) => {
1637
2149
  let i = e.createRow;
1638
2150
  if (i) return async (a) => {
1639
- let o = wn(a.values, i.columnParam ? { [i.columnParam]: a.columnId } : void 0, i.attributesParam ? { [i.attributesParam]: a.attributeValues } : void 0), s = await n(e, i.commandId, o);
2151
+ let o = Cr(a.values, i.columnParam ? { [i.columnParam]: a.columnId } : void 0, i.attributesParam ? { [i.attributesParam]: a.attributeValues } : void 0), s = await n(e, i.commandId, o);
1640
2152
  if (await t.onAfterCreate?.({
1641
2153
  record: e,
1642
2154
  created: s,
@@ -1650,15 +2162,15 @@ var Dt = (e) => {
1650
2162
  attributes: c.attributes ?? {}
1651
2163
  });
1652
2164
  };
1653
- }, Rn = (e, t, n, r, i) => {
2165
+ }, Lr = (e, t, n, r, i) => {
1654
2166
  let a = t.rowActions;
1655
2167
  if (a?.length) return (o) => a.map((a) => {
1656
- let s = i(t, o), c = () => Nn(e, t, a, o, s, r);
2168
+ let s = i(t, o), c = () => Mr(e, t, a, o, s, r);
1657
2169
  return {
1658
2170
  key: a.id,
1659
2171
  label: r(a.label, a.id),
1660
2172
  commandId: a.commandId,
1661
- icon: Pn(a.icon),
2173
+ icon: Nr(a.icon),
1662
2174
  onClick: () => n.executeRowAction ? n.executeRowAction({
1663
2175
  record: t,
1664
2176
  action: a,
@@ -1668,46 +2180,46 @@ var Dt = (e) => {
1668
2180
  }) : c()
1669
2181
  };
1670
2182
  });
1671
- }, zn = (e, t, n = {}) => {
1672
- let r = [], i = n.resolveLabel ?? ((e, t) => z(e, t)), a = (t, r) => {
2183
+ }, Rr = (e, t, n = {}) => {
2184
+ let r = [], i = n.resolveLabel ?? ((e, t) => V(e, t)), a = (t, r) => {
1673
2185
  let i = r.display?.kind === "badge-list" ? {
1674
2186
  ...r,
1675
- render: (n, i) => de(r, n, i, void 0, (n) => {
2187
+ render: (n, i) => se(r, n, i, void 0, (n) => {
1676
2188
  if (r.display?.kind !== "badge-list") return;
1677
- let a = mn(i, r.display.itemsAttributeId, n, t.extensionId, e.projectId);
2189
+ let a = pr(i, r.display.itemsAttributeId, n, t.extensionId, e.projectId);
1678
2190
  return a ? () => {
1679
2191
  e.workbench.navigation.openTarget(a);
1680
2192
  } : void 0;
1681
2193
  })
1682
2194
  } : r;
1683
2195
  return n.decorateAttribute?.(t, i) ?? i;
1684
- }, o = n.resolveRowResource ?? xn, s = n.resolveRowActionResource ?? Sn, c = n.onAfterMutation ?? (() => {}), l = (t, n, r) => K(e, t, n, r).then((e) => (c(t), e));
2196
+ }, o = n.resolveRowResource ?? br, s = n.resolveRowActionResource ?? xr, c = n.onAfterMutation ?? (() => {}), l = (t, n, r) => J(e, t, n, r).then((e) => (c(t), e));
1685
2197
  for (let c of t) {
1686
- let t = yn(c, c.attributes, i, a, (t, n) => e.workbench.notifications.show({
2198
+ let t = vr(c, c.attributes, i, a, (t, n) => e.workbench.notifications.show({
1687
2199
  id: `workbench.extension.${c.extensionId}.kanban.${c.id}.display.${t}`,
1688
2200
  level: "error",
1689
2201
  title: "Extension display is not available",
1690
2202
  message: `Attribute "${t}" in renderer "${c.id}" uses unknown display kind "${n}".`
1691
- })), d = c.attributes, f = u(c), p = /* @__PURE__ */ new WeakMap(), m, h = 0, g = /* @__PURE__ */ new Map(), _ = (e) => o(c, e), v = In(e, c, n, o, (e) => p.get(e) ?? e);
1692
- r.push(...Mn(e, c, i)), r.push(e.workbench.views.registerView({
2203
+ })), u = c.attributes, d = tt(c), f = /* @__PURE__ */ new WeakMap(), p, m = 0, h = /* @__PURE__ */ new Map(), g = (e) => o(c, e), _ = Fr(e, c, n, o, (e) => f.get(e) ?? e);
2204
+ r.push(...jr(e, c, i)), r.push(e.workbench.views.registerView({
1693
2205
  id: c.id,
1694
2206
  title: i(c.title, c.id),
1695
2207
  icon: c.icon,
1696
2208
  body: {
1697
2209
  kind: "kanban",
1698
2210
  resourceKind: c.resourceKind,
1699
- toolbarActions: Gt(c),
2211
+ toolbarActions: Gn(c),
1700
2212
  listRowActions: () => (c.rowActions ?? []).map((e) => ({
1701
2213
  commandId: e.commandId,
1702
2214
  label: i(e.label, e.id)
1703
2215
  })),
1704
2216
  storageScope: e.projectId,
1705
2217
  attributes: t.source,
1706
- defaultSettings: f.settings,
2218
+ defaultSettings: d.settings,
1707
2219
  defaultFilter: c.defaultFilter,
1708
2220
  defaultSorts: c.defaultSorts,
1709
2221
  viewsProvider: n.createViewsProvider?.(c),
1710
- defaultViews: f.views.map((e) => ({
2222
+ defaultViews: d.views.map((e) => ({
1711
2223
  ...e,
1712
2224
  title: i(e.title, e.id)
1713
2225
  })),
@@ -1715,30 +2227,36 @@ var Dt = (e) => {
1715
2227
  emptyTitle: i(c.emptyTitle, ""),
1716
2228
  emptyDescription: i(c.emptyDescription, ""),
1717
2229
  hideToolbar: c.hideToolbar,
1718
- createRow: Fn(c, i),
1719
- getBoardColumnConfig: (e) => gn(m?.[e], i),
1720
- onRowActivate: v,
2230
+ createRow: Pr(c, i),
2231
+ getBoardColumnConfig: (e) => hr(p?.[e], i),
2232
+ onRowActivate: _,
1721
2233
  executeQuery: async (n, r) => {
1722
- h += 1;
1723
- let i = h, a = await K(e, c, c.queryHandlerId, {
2234
+ m += 1;
2235
+ let i = m, a = await J(e, c, c.queryHandlerId, {
1724
2236
  settings: n.settings,
1725
2237
  filter: n.filter,
1726
2238
  sorts: n.sorts
1727
- }, void 0, r, n.pageParams), o = (e) => {
1728
- let t = /* @__PURE__ */ new Map(), n = e.map((e) => {
1729
- let n = e, r = JSON.stringify(e), i = g.get(n.id), a = i?.signature === r ? i.row : Cn(e, _);
1730
- return p.set(a, n), t.set(a.id, {
1731
- signature: r,
1732
- row: a
1733
- }), a;
2239
+ }, void 0, r, n.pageParams), o = (t) => {
2240
+ let n = /* @__PURE__ */ new Map(), r = t.map((t) => {
2241
+ let r = t, i = JSON.stringify(t), a = h.get(r.id), o = t.target, s = a?.signature === i ? a.row : {
2242
+ ...Sr(t, g),
2243
+ ...o ? { target: B(o, {
2244
+ extensionId: c.extensionId,
2245
+ projectId: e.projectId
2246
+ }) } : {}
2247
+ };
2248
+ return f.set(s, r), n.set(s.id, {
2249
+ signature: i,
2250
+ row: s
2251
+ }), s;
1734
2252
  });
1735
- return i === h && (g = t), n;
2253
+ return i === m && (h = n), r;
1736
2254
  };
1737
- if (i !== h) return Array.isArray(a) ? o(a) : _n(a) ? o(a.rows ?? []) : [];
2255
+ if (i !== m) return Array.isArray(a) ? o(a) : gr(a) ? o(a.rows ?? []) : [];
1738
2256
  if (Array.isArray(a)) return o(a);
1739
- if (!_n(a)) return [];
1740
- let s = a.attributes ?? d;
1741
- return d = s, t.set(s), m = a.boardColumnConfigs, o(a.rows ?? []);
2257
+ if (!gr(a)) return [];
2258
+ let s = a.attributes ?? u;
2259
+ return u = s, t.set(s), p = a.boardColumnConfigs, o(a.rows ?? []);
1742
2260
  },
1743
2261
  onAttributeChange: c.attributeChangeHandlerId ? (e, t, n) => l(c, c.attributeChangeHandlerId, {
1744
2262
  rowId: e,
@@ -1746,21 +2264,21 @@ var Dt = (e) => {
1746
2264
  value: n
1747
2265
  }).then(() => void 0) : void 0,
1748
2266
  onMove: c.moveHandlerId ? (e) => l(c, c.moveHandlerId, { ...e }).then(() => void 0) : void 0,
1749
- onCreateRow: Ln(c, n, l, c.rowActivationHandlerId ? v : void 0),
2267
+ onCreateRow: Ir(c, n, l, c.rowActivationHandlerId ? _ : void 0),
1750
2268
  onColumnAction: c.columnActionHandlerId ? async (e, t) => {
1751
2269
  await l(c, c.columnActionHandlerId, {
1752
2270
  columnId: e,
1753
2271
  actionId: t
1754
2272
  });
1755
2273
  } : void 0,
1756
- getRowContextMenuActions: Rn(e, c, n, i, s)
2274
+ getRowContextMenuActions: Lr(e, c, n, i, s)
1757
2275
  }
1758
2276
  }));
1759
2277
  }
1760
2278
  return { dispose() {
1761
2279
  for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
1762
2280
  } };
1763
- }, Bn = (e) => ({
2281
+ }, zr = (e) => ({
1764
2282
  id: e.treeId,
1765
2283
  kind: "renderer",
1766
2284
  context: {
@@ -1772,7 +2290,7 @@ var Dt = (e) => {
1772
2290
  resourceId: e.resource.id
1773
2291
  } : {}
1774
2292
  }
1775
- }), q = (e, t, n, r) => {
2293
+ }), Y = (e, t, n, r) => {
1776
2294
  let i = n.resource, a = e.workbench.modes.getActiveModeId();
1777
2295
  return {
1778
2296
  renderer: {
@@ -1787,22 +2305,22 @@ var Dt = (e) => {
1787
2305
  ...n.filter ? { filter: n.filter } : {},
1788
2306
  ...r ? { node: r } : {}
1789
2307
  };
1790
- }, J = async (e, t, n, r, i) => {
2308
+ }, X = async (e, t, n, r, i) => {
1791
2309
  let a = r.renderer, o = a?.resource;
1792
- return U(e, n, {
2310
+ return G(e, n, {
1793
2311
  params: r,
1794
2312
  signal: i,
1795
2313
  resource: o,
1796
- slot: Bn({
2314
+ slot: zr({
1797
2315
  modeId: a?.modeId,
1798
2316
  projectId: e.projectId,
1799
2317
  resource: o,
1800
2318
  treeId: t.id
1801
2319
  })
1802
2320
  });
1803
- }, Vn = async (e, t, n, r, i) => {
2321
+ }, Br = async (e, t, n, r, i) => {
1804
2322
  let a = e.workbench.modes.getActiveModeId();
1805
- return U(e, n, {
2323
+ return G(e, n, {
1806
2324
  params: {
1807
2325
  ...r ?? {},
1808
2326
  renderer: {
@@ -1814,7 +2332,7 @@ var Dt = (e) => {
1814
2332
  }
1815
2333
  },
1816
2334
  resource: i,
1817
- slot: Bn({
2335
+ slot: zr({
1818
2336
  modeId: a,
1819
2337
  projectId: e.projectId,
1820
2338
  resource: i,
@@ -1822,28 +2340,42 @@ var Dt = (e) => {
1822
2340
  }),
1823
2341
  metadata: { treeId: t.id }
1824
2342
  });
1825
- }, Hn = (e, t) => e.panels.flatMap((e) => [e, ...e.panelMenus ?? []]).filter((e) => e.renderer?.kind === "tree" && e.renderer.id === t.id), Un = (e, t) => t.viewId ? e.find((e) => e.id === t.viewId) : e.length === 1 ? e[0] : void 0, Wn = async (e) => {
1826
- let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a = Un(i, t);
2343
+ }, Vr = (e, t) => e.panels.flatMap((e) => [e, ...e.panelMenus ?? []]).filter((e) => e.renderer?.kind === "tree" && e.renderer.id === t.id), Hr = (e, t) => t.viewId ? e.find((e) => e.id === t.viewId) : e.length === 1 ? e[0] : void 0, Ur = async (e) => {
2344
+ let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a = Hr(i, t);
1827
2345
  return !a || !("hostTreeHeader" in a) || a.hostTreeHeader !== "default" ? [] : await n?.({
1828
2346
  ctx: t,
1829
2347
  record: r,
1830
2348
  panel: a
1831
2349
  }) ?? [];
1832
- }, Gn = async (e) => {
1833
- let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a = Un(i, t);
2350
+ }, Wr = async (e) => {
2351
+ let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a = Hr(i, t);
1834
2352
  return !a || !("hostTreeFooter" in a) || a.hostTreeFooter !== "default" ? [] : await n?.({
1835
2353
  ctx: t,
1836
2354
  record: r,
1837
2355
  panel: a
1838
2356
  }) ?? [];
1839
- }, Kn = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, qn = (e) => e && !Array.isArray(e) ? e : void 0, Jn = (e, t) => {
2357
+ }, Gr = (e, t) => (e.structure ?? []).map((e) => ({
2358
+ id: e.id,
2359
+ label: V(e.label),
2360
+ collapsible: e.collapsible,
2361
+ hiddenByDefault: e.hiddenByDefault,
2362
+ canHide: e.canHide,
2363
+ loading: !e.resourceNode,
2364
+ nodes: e.resourceNode && t ? [{
2365
+ id: e.resourceNode.id,
2366
+ label: t.label ?? t.id ?? t.type,
2367
+ icon: e.resourceNode.icon,
2368
+ resource: t,
2369
+ selected: !0
2370
+ }] : []
2371
+ })), Kr = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, qr = (e) => e && !Array.isArray(e) ? e : void 0, Jr = (e, t) => {
1840
2372
  let n = /* @__PURE__ */ new WeakMap(), r = `workbench.extensionTreeRenderer.${t.id}.command`, i = (t) => e.resolveNodeResource?.(t) ?? t, a = (e) => {
1841
2373
  if (e.emptyState) return {
1842
- title: z(e.emptyState.title),
1843
- description: z(e.emptyState.description),
2374
+ title: V(e.emptyState.title),
2375
+ description: V(e.emptyState.description),
1844
2376
  icon: e.emptyState.icon
1845
2377
  };
1846
- }, o = (n, i, a) => n ? R(n, {
2378
+ }, o = (n, i, a) => n ? B(n, {
1847
2379
  commandTargetOf: (e) => ({
1848
2380
  kind: "command",
1849
2381
  commandId: r,
@@ -1858,34 +2390,34 @@ var Dt = (e) => {
1858
2390
  extensionId: t.extensionId,
1859
2391
  projectId: e.projectId
1860
2392
  }) : void 0, s = (n, r, i) => {
1861
- let a = n.command ? S({
2393
+ let a = n.command ? x({
1862
2394
  ...n.command,
1863
2395
  extensionId: n.command.extensionId ?? t.extensionId
1864
2396
  }) : void 0;
1865
2397
  return {
1866
2398
  id: n.id,
1867
2399
  resourceMutation: e.metadata.commands.find((e) => e.id === a)?.resourceMutation,
1868
- label: z(n.label),
2400
+ label: V(n.label),
1869
2401
  icon: n.icon,
1870
- args: qn(n.params),
1871
- params: W(n.input, z, t.extensionId),
2402
+ args: qr(n.params),
2403
+ params: K(n.input, V, t.extensionId),
1872
2404
  submitLabel: n.submitLabel,
1873
2405
  when: n.when,
1874
2406
  disabled: n.disabled,
1875
2407
  run: a ? async (o) => {
1876
- let s = Kn(o, qn(n.params));
2408
+ let s = Kr(o, qr(n.params));
1877
2409
  if (n.command?.extensionId === "pstdio") {
1878
2410
  await e.workbench.commands.executeCommand(a, s, { resource: r?.resource ?? i.resource });
1879
2411
  return;
1880
2412
  }
1881
- await Vn(e, t, a, s, r?.resource ?? i.resource), i.refresh();
2413
+ await Br(e, t, a, s, r?.resource ?? i.resource), i.refresh();
1882
2414
  } : void 0
1883
2415
  };
1884
2416
  }, c = (e, t) => {
1885
2417
  let r = {
1886
2418
  id: e.id,
1887
2419
  selected: e.selected,
1888
- label: z(e.label),
2420
+ label: V(e.label),
1889
2421
  icon: e.icon,
1890
2422
  iconColor: e.iconColor,
1891
2423
  badge: e.badge,
@@ -1912,7 +2444,7 @@ var Dt = (e) => {
1912
2444
  mapNodes: (e, t) => e.map((e) => c(e, t)),
1913
2445
  mapSections: (e, t) => e.map((e) => ({
1914
2446
  id: e.id,
1915
- label: z(e.label),
2447
+ label: V(e.label),
1916
2448
  actions: e.actions?.map((e) => s(e, void 0, t)),
1917
2449
  collapsible: e.collapsible,
1918
2450
  emptyState: a(e),
@@ -1923,58 +2455,59 @@ var Dt = (e) => {
1923
2455
  originalNodes: n,
1924
2456
  runnerCommandId: r
1925
2457
  };
1926
- }, Yn = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e), Xn = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "id" in e), Y = (e, t) => t.length > 0 ? [{
2458
+ }, Yr = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e), Xr = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "id" in e), Z = (e, t) => t.length > 0 ? [{
1927
2459
  id: e,
1928
2460
  nodes: t,
1929
2461
  canReorder: !1
1930
- }] : [], Zn = (e, t) => {
1931
- let n = Jn(e, t), r = Hn(e.metadata, t), i = e.workbench.commands.registerCommand({
2462
+ }] : [], Zr = (e, t) => {
2463
+ let n = Jr(e, t), r = Vr(e.metadata, t), i = e.workbench.commands.registerCommand({
1932
2464
  id: n.runnerCommandId,
1933
- label: `${z(t.title, t.id)} tree command`
2465
+ label: `${V(t.title, t.id)} tree command`
1934
2466
  }, { execute: async (n) => {
1935
- let r = n, i = await Vn(e, t, r.commandId, r.params, r.resource);
2467
+ let r = n, i = await Br(e, t, r.commandId, r.params, r.resource);
1936
2468
  for (let t of e.workbench.views.listViews()) t.body.kind === "file" && e.workbench.views.refreshView(t.id);
1937
2469
  return i;
1938
2470
  } }), a = e.workbench.views.registerView({
1939
2471
  id: t.id,
1940
- title: z(t.title, t.id),
2472
+ title: V(t.title, t.id),
1941
2473
  icon: t.icon,
1942
2474
  body: {
1943
2475
  kind: "tree",
2476
+ getStructure: t.structure ? (e) => Gr(t, e.resource) : void 0,
1944
2477
  searchable: t.searchable,
1945
- searchPlaceholder: z(t.searchPlaceholder, "Search files"),
2478
+ searchPlaceholder: V(t.searchPlaceholder, "Search files"),
1946
2479
  defaultExpandedNodeIds: t.defaultExpandedNodeIds,
1947
2480
  defaultExpandedSectionIds: t.defaultExpandedSectionIds,
1948
2481
  getHeader: async (i) => {
1949
- let a = await Wn({
2482
+ let a = await Ur({
1950
2483
  ctx: i,
1951
2484
  getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
1952
2485
  record: t,
1953
2486
  treeViews: r
1954
2487
  });
1955
- if (!t.headerHandlerId) return Y(`${t.id}:host-header`, a);
1956
- let o = await J(e, t, t.headerHandlerId, q(e, t, i), i.signal), s = Yn(o) ? n.mapSections(o, i) : [];
1957
- return [...Y(`${t.id}:host-header`, a), ...s];
2488
+ if (!t.headerHandlerId) return Z(`${t.id}:host-header`, a);
2489
+ let o = await X(e, t, t.headerHandlerId, Y(e, t, i), i.signal), s = Yr(o) ? n.mapSections(o, i) : [];
2490
+ return [...Z(`${t.id}:host-header`, a), ...s];
1958
2491
  },
1959
2492
  getBody: async (r) => {
1960
- let i = await J(e, t, t.bodyHandlerId, q(e, t, r), r.signal);
1961
- return Yn(i) ? n.mapSections(i, r) : [];
2493
+ let i = await X(e, t, t.bodyHandlerId, Y(e, t, r), r.signal);
2494
+ return Yr(i) ? n.mapSections(i, r) : [];
1962
2495
  },
1963
2496
  getFooter: async (i) => {
1964
- let a = await Gn({
2497
+ let a = await Wr({
1965
2498
  ctx: i,
1966
2499
  getHostTreeFooterNodes: e.getHostTreeFooterNodes,
1967
2500
  record: t,
1968
2501
  treeViews: r
1969
2502
  });
1970
- if (!t.footerHandlerId) return Y(`${t.id}:host-footer`, a);
1971
- let o = await J(e, t, t.footerHandlerId, q(e, t, i), i.signal);
1972
- return [...Yn(o) ? n.mapSections(o, i) : [], ...Y(`${t.id}:host-footer`, a)];
2503
+ if (!t.footerHandlerId) return Z(`${t.id}:host-footer`, a);
2504
+ let o = await X(e, t, t.footerHandlerId, Y(e, t, i), i.signal);
2505
+ return [...Yr(o) ? n.mapSections(o, i) : [], ...Z(`${t.id}:host-footer`, a)];
1973
2506
  },
1974
2507
  moveNode: t.moveHandlerId ? async (r, i, a) => {
1975
2508
  let o = n.originalNodes.get(r), s = i ? n.originalNodes.get(i) : void 0;
1976
- !o?.canDrag || i && !s?.canDrop || (await J(e, t, t.moveHandlerId, {
1977
- ...q(e, t, a),
2509
+ !o?.canDrag || i && !s?.canDrop || (await X(e, t, t.moveHandlerId, {
2510
+ ...Y(e, t, a),
1978
2511
  source: o,
1979
2512
  target: s,
1980
2513
  position: a.position ?? "inside"
@@ -1984,39 +2517,39 @@ var Dt = (e) => {
1984
2517
  if (!t.childrenHandlerId) return r.children ?? [];
1985
2518
  let a = n.originalNodes.get(r);
1986
2519
  if (!a) return r.children ?? [];
1987
- let o = await J(e, t, t.childrenHandlerId, q(e, t, i, a), i.signal);
1988
- return Xn(o) ? n.mapNodes(o, i) : [];
2520
+ let o = await X(e, t, t.childrenHandlerId, Y(e, t, i, a), i.signal);
2521
+ return Xr(o) ? n.mapNodes(o, i) : [];
1989
2522
  }
1990
2523
  }
1991
2524
  });
1992
2525
  return { dispose() {
1993
2526
  a.dispose(), i.dispose();
1994
2527
  } };
1995
- }, Qn = (e) => {
2528
+ }, Qr = (e) => {
1996
2529
  let t = [];
1997
- for (let n of e.metadata.treeRenderers ?? []) t.push(Zn(e, n));
2530
+ for (let n of e.metadata.treeRenderers ?? []) t.push(Zr(e, n));
1998
2531
  return { dispose() {
1999
2532
  for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
2000
2533
  } };
2001
- }, X = (e) => ({
2534
+ }, $r = (e) => ({
2002
2535
  kind: e.kind,
2003
- id: C(e),
2536
+ id: S(e),
2004
2537
  extensionId: e.extensionId
2005
- }), $n = (e, t, n) => {
2538
+ }), ei = (e, t, n) => {
2006
2539
  let r = n?.(t.when);
2007
2540
  return !r || e.context.matches(r);
2008
- }, er = (e) => ({
2541
+ }, ti = (e) => ({
2009
2542
  id: e.id,
2010
- label: z(e.label, e.id),
2543
+ label: V(e.label, e.id),
2011
2544
  icon: e.icon,
2012
2545
  canHide: !0,
2013
2546
  canReorder: !0,
2014
- target: R(e.action, { extensionId: e.extensionId })
2015
- }), tr = (e, t, n) => {
2547
+ target: B(e.action, { extensionId: e.extensionId })
2548
+ }), ni = (e, t, n) => {
2016
2549
  let r = /* @__PURE__ */ new Map();
2017
2550
  for (let i of t) {
2018
- if (!$n(e, i, n)) continue;
2019
- let t = i.group || void 0, a = t ? `${i.extensionId}:${t}` : g(i.slot), o = r.get(a) ?? {
2551
+ if (!ei(e, i, n)) continue;
2552
+ let t = i.group || void 0, a = t ? `${i.extensionId}:${t}` : m(i.slot), o = r.get(a) ?? {
2020
2553
  id: a,
2021
2554
  label: t,
2022
2555
  collapsible: !!t,
@@ -2024,49 +2557,49 @@ var Dt = (e) => {
2024
2557
  canReorder: !0,
2025
2558
  nodes: []
2026
2559
  };
2027
- o.nodes.push(er(i)), r.set(a, o);
2560
+ o.nodes.push(ti(i)), r.set(a, o);
2028
2561
  }
2029
2562
  return [...r.values()];
2030
- }, nr = (e) => {
2563
+ }, ri = (e) => {
2031
2564
  let t = /* @__PURE__ */ new Map();
2032
2565
  for (let n of e) {
2033
- let e = X(n.owner), r = `${n.extensionId}:${e.kind}:${e.id}:${n.slot}`;
2566
+ let e = $r(n.owner), r = `${n.extensionId}:${e.kind}:${e.id}:${n.slot}`;
2034
2567
  t.set(r, [...t.get(r) ?? [], n]);
2035
2568
  }
2036
2569
  return [...t.values()];
2037
- }, rr = (e) => [...new Set(e.flatMap((e) => e.group ? [`${e.extensionId}:${e.group}`] : []))], ir = (e) => nr(e.metadata.navigationItems).map((t) => {
2570
+ }, ii = (e) => [...new Set(e.flatMap((e) => e.group ? [`${e.extensionId}:${e.group}`] : []))], ai = (e) => ri(e.metadata.navigationItems).map((t) => {
2038
2571
  let n = t[0], r = t.some((e) => e.when?.resourceType?.length || e.when?.metadata);
2039
2572
  return e.workbench.navigationTrees.registerContribution({
2040
- id: `${n.extensionId}.navigation-items.${n.owner.kind}.${C(n.owner)}.${n.slot}`,
2041
- owner: X(n.owner),
2573
+ id: `${n.extensionId}.navigation-items.${n.owner.kind}.${S(n.owner)}.${n.slot}`,
2574
+ owner: $r(n.owner),
2042
2575
  sourceExtensionId: n.extensionId,
2043
2576
  declarationIndex: e.metadata.navigationItems.indexOf(n),
2044
2577
  slot: n.slot,
2045
- defaultExpandedSectionIds: rr(t),
2578
+ defaultExpandedSectionIds: ii(t),
2046
2579
  ...r ? {} : { resolveResource: () => void 0 },
2047
- getSections: () => tr(e.workbench, t, e.createWhenExpression),
2580
+ getSections: () => ni(e.workbench, t, e.createWhenExpression),
2048
2581
  listActions: () => t.map((e) => ({
2049
- label: z(e.label, e.id),
2582
+ label: V(e.label, e.id),
2050
2583
  category: e.group || void 0,
2051
- action: R(e.action, { extensionId: e.extensionId })
2584
+ action: B(e.action, { extensionId: e.extensionId })
2052
2585
  }))
2053
2586
  });
2054
- }), ar = (e) => e.metadata.navigationTrees.map((t, n) => {
2055
- let r = C(t.view);
2587
+ }), oi = (e) => e.metadata.navigationTrees.map((t, n) => {
2588
+ let r = S(t.view);
2056
2589
  return e.workbench.navigationTrees.registerContribution({
2057
2590
  id: t.id,
2058
2591
  idScope: t.id,
2059
- owner: X(t.owner),
2592
+ owner: $r(t.owner),
2060
2593
  sourceExtensionId: t.extensionId,
2061
2594
  declarationIndex: e.metadata.navigationItems.length + n,
2062
2595
  slot: t.slot,
2063
2596
  viewId: r,
2064
2597
  ...t.resourceScope === "project" ? { resolveResource: () => void 0 } : {}
2065
2598
  });
2066
- }), or = (e) => [...ir(e), ...ar(e)], sr = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
2599
+ }), si = (e) => [...ai(e), ...oi(e)], ci = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
2067
2600
  kind: t.id,
2068
2601
  extensionId: t.extensionId,
2069
- label: z(t.label, t.id),
2602
+ label: V(t.label, t.id),
2070
2603
  icon: t.icon ?? "FileText",
2071
2604
  relatedOpenings: t.relatedOpeningsCommand ? async (n, r) => {
2072
2605
  let i = await e.executeCommand(t.relatedOpeningsCommand, {
@@ -2074,7 +2607,7 @@ var Dt = (e) => {
2074
2607
  resource: n,
2075
2608
  source: "dashboard"
2076
2609
  }, r);
2077
- return r.throwIfAborted(), a.array().parse(B(i)).map((n) => ({
2610
+ return r.throwIfAborted(), rt.array().parse(H(i)).map((n) => ({
2078
2611
  ...n,
2079
2612
  resource: {
2080
2613
  ...n.resource,
@@ -2083,24 +2616,24 @@ var Dt = (e) => {
2083
2616
  }
2084
2617
  }));
2085
2618
  } : void 0
2086
- })), cr = () => {
2619
+ })), li = () => {
2087
2620
  if (typeof navigator > "u") return;
2088
2621
  let e = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
2089
2622
  if (e.includes("mac")) return "mac";
2090
2623
  if (e.includes("win")) return "win";
2091
2624
  if (e.includes("linux")) return "linux";
2092
- }, lr = (e, t = cr()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, ur = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
2625
+ }, ui = (e, t = li()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, di = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
2093
2626
  sourceExtensionId: t.extensionId,
2094
- action: R(t.action, { commandIdOf: (e) => e.extensionId ? S({
2627
+ action: B(t.action, { commandIdOf: (e) => e.extensionId ? x({
2095
2628
  extensionId: e.extensionId,
2096
2629
  id: e.id
2097
2630
  }) : void 0 }),
2098
- keybinding: lr(t),
2631
+ keybinding: ui(t),
2099
2632
  when: e.createWhenExpression?.(t.when)
2100
- })), dr = (e) => {
2633
+ })), fi = (e) => {
2101
2634
  if (!e) return;
2102
2635
  let t = (e) => {
2103
- if (e) return Array.isArray(e) ? e.map((e) => C(e)) : C(e);
2636
+ if (e) return Array.isArray(e) ? e.map((e) => S(e)) : S(e);
2104
2637
  };
2105
2638
  return {
2106
2639
  mode: t(e.mode),
@@ -2109,21 +2642,21 @@ var Dt = (e) => {
2109
2642
  resourceType: e.resourceType?.map((e) => e.id),
2110
2643
  metadata: e.metadata
2111
2644
  };
2112
- }, fr = (e, t) => ({
2645
+ }, pi = (e, t) => ({
2113
2646
  ...e,
2114
2647
  tab: e.tab && t.createTab ? t.createTab({
2115
2648
  ...e.tab,
2116
2649
  extensionId: t.extensionId,
2117
2650
  placementId: t.placementId
2118
2651
  }) : void 0
2119
- }), pr = (e, t) => e.kind === "panels" ? e : {
2652
+ }), mi = (e, t) => e.kind === "panels" ? e : {
2120
2653
  ...e,
2121
2654
  tab: e.tab && t.createTab ? t.createTab({
2122
2655
  ...e.tab,
2123
2656
  extensionId: t.extensionId,
2124
2657
  placementId: t.placementId
2125
2658
  }) : void 0
2126
- }, mr = (e, t) => e.pages.map((e) => ({
2659
+ }, hi = (e, t) => e.pages.map((e) => ({
2127
2660
  id: e.id,
2128
2661
  ref: {
2129
2662
  extensionId: e.extensionId,
@@ -2134,32 +2667,32 @@ var Dt = (e) => {
2134
2667
  path: e.path,
2135
2668
  document: e.document,
2136
2669
  params: e.params,
2137
- modeId: C(e.mode),
2670
+ modeId: S(e.mode),
2138
2671
  resource: e.resource,
2139
- main: pr(e.main, {
2672
+ main: mi(e.main, {
2140
2673
  extensionId: e.extensionId,
2141
2674
  placementId: `${e.id}.$main`,
2142
2675
  createTab: t
2143
2676
  }),
2144
- slots: e.slots.map((n) => fr(n, {
2677
+ slots: e.slots.map((n) => pi(n, {
2145
2678
  extensionId: e.extensionId,
2146
2679
  placementId: `${e.id}.${n.id}`,
2147
2680
  createTab: t
2148
2681
  })),
2149
2682
  ...e.icon ? { icon: e.icon } : {},
2150
- ...e.parent ? { parentId: C(e.parent) } : {}
2151
- })), Z = (e, t) => {
2683
+ ...e.parent ? { parentId: S(e.parent) } : {}
2684
+ })), Q = (e, t) => {
2152
2685
  let n = e.pages.flatMap((e) => [...e.main.kind === "view" && e.resource ? [{
2153
2686
  ...e.resource,
2154
2687
  view: e.main.view
2155
2688
  }] : [], ...e.slots.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])]);
2156
- return n.push(...e.placements.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])), n.find((e) => C(e.view) === t)?.kinds[0]?.id;
2157
- }, hr = (e) => e.body.kind === "webview" ? { webview: e.body.webview } : { renderer: {
2689
+ return n.push(...e.placements.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])), n.find((e) => S(e.view) === t)?.kinds[0]?.id;
2690
+ }, gi = (e) => e.body.kind === "webview" ? { webview: e.body.webview } : { renderer: {
2158
2691
  kind: e.body.kind,
2159
2692
  id: e.id
2160
- } }, gr = (e, t) => e.viewMenus.flatMap((n) => {
2161
- if (C(n.owner) !== t.id) return [];
2162
- let r = e.views.find((e) => e.id === C(n.view));
2693
+ } }, _i = (e, t) => e.viewMenus.flatMap((n) => {
2694
+ if (S(n.owner) !== t.id) return [];
2695
+ let r = e.views.find((e) => e.id === S(n.view));
2163
2696
  return r ? [{
2164
2697
  id: n.id,
2165
2698
  extensionId: n.extensionId,
@@ -2171,22 +2704,22 @@ var Dt = (e) => {
2171
2704
  placement: n.placement,
2172
2705
  hostTreeHeader: n.hostTreeHeader,
2173
2706
  hostTreeFooter: n.hostTreeFooter,
2174
- ...hr(r)
2707
+ ...gi(r)
2175
2708
  }] : [];
2176
- }), _r = (e) => e.views.map((t) => {
2177
- let n = gr(e, t);
2709
+ }), vi = (e) => e.views.map((t) => {
2710
+ let n = _i(e, t);
2178
2711
  return {
2179
2712
  id: t.id,
2180
2713
  extensionId: t.extensionId,
2181
2714
  title: t.title,
2182
2715
  icon: t.icon,
2183
2716
  panelMenus: n.length > 0 ? n : void 0,
2184
- ...hr(t)
2717
+ ...gi(t)
2185
2718
  };
2186
- }), Q = (e) => e?.map(({ command: e, ...t }) => ({
2719
+ }), $ = (e) => e?.map(({ command: e, ...t }) => ({
2187
2720
  ...t,
2188
- commandId: S(e)
2189
- })), vr = (e) => e.views.flatMap((t) => {
2721
+ commandId: x(e)
2722
+ })), yi = (e) => e.views.flatMap((t) => {
2190
2723
  let n = t.body;
2191
2724
  return n.kind === "kanban" ? [{
2192
2725
  ...n,
@@ -2194,7 +2727,7 @@ var Dt = (e) => {
2194
2727
  extensionId: t.extensionId,
2195
2728
  title: t.title,
2196
2729
  icon: t.icon,
2197
- resourceKind: n.resourceKind ?? Z(e, t.id),
2730
+ resourceKind: n.resourceKind ?? Q(e, t.id),
2198
2731
  createRow: n.createRow ? {
2199
2732
  title: n.createRow.title,
2200
2733
  submitLabel: n.createRow.submitLabel,
@@ -2202,17 +2735,17 @@ var Dt = (e) => {
2202
2735
  params: n.createRow.params,
2203
2736
  attributesParam: n.createRow.attributesParam,
2204
2737
  labels: n.createRow.labels,
2205
- commandId: S(n.createRow.command),
2738
+ commandId: x(n.createRow.command),
2206
2739
  attachments: n.createRow.attachments ? {
2207
2740
  resourceParam: n.createRow.attachments.resourceParam,
2208
2741
  fileParam: n.createRow.attachments.fileParam,
2209
- commandId: S(n.createRow.attachments.command)
2742
+ commandId: x(n.createRow.attachments.command)
2210
2743
  } : void 0
2211
2744
  } : void 0,
2212
- rowActions: Q(n.rowActions),
2213
- toolbarActions: Q(n.toolbarActions)
2745
+ rowActions: $(n.rowActions),
2746
+ toolbarActions: $(n.toolbarActions)
2214
2747
  }] : [];
2215
- }), yr = (e) => e.views.flatMap((t) => {
2748
+ }), bi = (e) => e.views.flatMap((t) => {
2216
2749
  let n = t.body;
2217
2750
  return n.kind === "dataTable" ? [{
2218
2751
  ...n,
@@ -2220,33 +2753,33 @@ var Dt = (e) => {
2220
2753
  extensionId: t.extensionId,
2221
2754
  title: t.title,
2222
2755
  icon: t.icon,
2223
- resourceKind: n.resourceKind ?? Z(e, t.id),
2224
- selectionActions: Q(n.selectionActions),
2225
- rowActions: Q(n.rowActions),
2226
- toolbarActions: Q(n.toolbarActions)
2756
+ resourceKind: n.resourceKind ?? Q(e, t.id),
2757
+ selectionActions: $(n.selectionActions),
2758
+ rowActions: $(n.rowActions),
2759
+ toolbarActions: $(n.toolbarActions)
2227
2760
  }] : [];
2228
- }), br = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
2761
+ }), xi = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
2229
2762
  ...t.body,
2230
2763
  id: t.id,
2231
2764
  extensionId: t.extensionId,
2232
2765
  title: t.title,
2233
2766
  icon: t.icon,
2234
- resourceKind: t.body.resourceKind ?? Z(e, t.id)
2235
- }] : []), xr = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
2767
+ resourceKind: t.body.resourceKind ?? Q(e, t.id)
2768
+ }] : []), Si = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
2236
2769
  ...t.body,
2237
2770
  id: t.id,
2238
2771
  extensionId: t.extensionId,
2239
2772
  title: t.title,
2240
2773
  icon: t.icon,
2241
- resourceKind: t.body.resourceKind ?? Z(e, t.id)
2242
- }] : []), Sr = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
2774
+ resourceKind: t.body.resourceKind ?? Q(e, t.id)
2775
+ }] : []), Ci = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
2243
2776
  ...t.body,
2244
2777
  id: t.id,
2245
2778
  extensionId: t.extensionId,
2246
2779
  title: t.title,
2247
2780
  icon: t.icon,
2248
- resourceKind: t.body.resourceKind ?? Z(e, t.id)
2249
- }] : []), Cr = (e) => e.modes.map((e) => ({
2781
+ resourceKind: t.body.resourceKind ?? Q(e, t.id)
2782
+ }] : []), wi = (e) => e.modes.map((e) => ({
2250
2783
  id: e.id,
2251
2784
  extensionId: e.extensionId,
2252
2785
  modeId: e.id,
@@ -2255,17 +2788,17 @@ var Dt = (e) => {
2255
2788
  panelRegions: e.regions,
2256
2789
  regionSettings: e.regionSettings,
2257
2790
  floatingPanels: e.floatingPanels,
2258
- ...e.defaultTheme ? { defaultTheme: C(e.defaultTheme) } : {},
2259
- ...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 && C(t)])) } : {}
2260
- })), wr = (e, t = {}) => {
2261
- let n = _r(e);
2791
+ ...e.defaultTheme ? { defaultTheme: S(e.defaultTheme) } : {},
2792
+ ...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 && S(t)])) } : {}
2793
+ })), Ti = (e, t = {}) => {
2794
+ let n = vi(e);
2262
2795
  return {
2263
2796
  extensions: e.extensions,
2264
2797
  commands: e.commands,
2265
2798
  menuContributions: e.menuContributions,
2266
2799
  commandPaletteContributions: e.commandPaletteContributions,
2267
- modes: Cr(e),
2268
- pages: mr(e, t.createTab),
2800
+ modes: wi(e),
2801
+ pages: hi(e, t.createTab),
2269
2802
  placements: e.placements.map((e) => ({
2270
2803
  id: e.id,
2271
2804
  ref: {
@@ -2273,7 +2806,7 @@ var Dt = (e) => {
2273
2806
  kind: "placement",
2274
2807
  id: e.localId
2275
2808
  },
2276
- modeId: C(e.mode),
2809
+ modeId: S(e.mode),
2277
2810
  item: e.item,
2278
2811
  region: e.region,
2279
2812
  order: e.order,
@@ -2308,7 +2841,7 @@ var Dt = (e) => {
2308
2841
  })),
2309
2842
  settingsSections: e.settingsSections ?? [],
2310
2843
  settingsPanels: e.settingsPanels.flatMap((t) => {
2311
- let n = e.views.find((e) => e.id === C(t.view));
2844
+ let n = e.views.find((e) => e.id === S(t.view));
2312
2845
  return n ? [{
2313
2846
  id: t.id,
2314
2847
  viewId: n.id,
@@ -2317,30 +2850,30 @@ var Dt = (e) => {
2317
2850
  scope: t.slot.id.includes("global") ? "global" : "project",
2318
2851
  title: n.title,
2319
2852
  icon: n.icon,
2320
- section: t.section ? C(t.section) : void 0
2853
+ section: t.section ? S(t.section) : void 0
2321
2854
  }] : [];
2322
2855
  }),
2323
- kanbanRenderers: vr(e),
2324
- dataTableRenderers: yr(e),
2856
+ kanbanRenderers: yi(e),
2857
+ dataTableRenderers: bi(e),
2325
2858
  commandPaletteResources: e.commandPaletteResources ?? [],
2326
- treeRenderers: br(e),
2327
- fileRenderers: xr(e),
2328
- controlsRenderers: Sr(e),
2859
+ treeRenderers: xi(e),
2860
+ fileRenderers: Si(e),
2861
+ controlsRenderers: Ci(e),
2329
2862
  keybindings: e.keybindings ?? [],
2330
2863
  settingsDefinitions: e.settingsDefinitions ?? [],
2331
2864
  statusBarItems: e.statusBarItems.map((e) => ({
2332
2865
  id: e.id,
2333
2866
  extensionId: e.extensionId,
2334
- viewId: C(e.view),
2867
+ viewId: S(e.view),
2335
2868
  slot: e.slot.id.endsWith("leading") ? "leading" : "trailing",
2336
2869
  order: e.order,
2337
- when: dr(e.when)
2870
+ when: fi(e.when)
2338
2871
  })),
2339
2872
  diagnostics: e.diagnostics
2340
2873
  };
2341
- }, Tr = (e, t, n = {}) => {
2874
+ }, Ei = (e, t, n = {}) => {
2342
2875
  e.views.refreshView(t.id, t.kind === "file" ? n : void 0);
2343
- }, Er = (e) => {
2876
+ }, Di = (e) => {
2344
2877
  let t = /* @__PURE__ */ new Map(), n = (e, n) => {
2345
2878
  for (let r of new Set(n.refreshEventIds ?? [])) {
2346
2879
  let i = t.get(r) ?? [];
@@ -2355,25 +2888,25 @@ var Dt = (e) => {
2355
2888
  refreshEventIds: t.body.refreshEventIds
2356
2889
  });
2357
2890
  return t;
2358
- }, Dr = (e) => {
2359
- let t = Er(e.metadata);
2891
+ }, Oi = (e) => {
2892
+ let t = Di(e.metadata);
2360
2893
  return e.subscribe((n) => {
2361
2894
  let { id: r, ...i } = n;
2362
- for (let n of t.get(r) ?? []) Tr(e.workbench, n, i);
2895
+ for (let n of t.get(r) ?? []) Ei(e.workbench, n, i);
2363
2896
  });
2364
- }, Or = (e, t) => {
2897
+ }, ki = (e, t) => {
2365
2898
  for (let n of t.views) n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
2366
- }, kr = (e) => (t) => {
2899
+ }, Ai = (e) => (t) => {
2367
2900
  let n = t.extensionId ?? e.extensionIdForWebview(t.webviewId);
2368
2901
  return {
2369
- ...Ot({
2902
+ ...On({
2370
2903
  ...t,
2371
2904
  extensionId: n,
2372
2905
  projectId: e.projectId
2373
2906
  }),
2374
2907
  executeCommand: (n, r) => {
2375
2908
  let i = n.resource ?? t.placement.resource;
2376
- return H({
2909
+ return W({
2377
2910
  ...e,
2378
2911
  workbench: t.workbench
2379
2912
  }, n.commandId, {
@@ -2382,7 +2915,7 @@ var Dt = (e) => {
2382
2915
  metadata: n.metadata,
2383
2916
  resource: i,
2384
2917
  signal: r,
2385
- slot: V({
2918
+ slot: U({
2386
2919
  id: t.webviewId,
2387
2920
  kind: e.slotKind,
2388
2921
  projectId: e.projectId,
@@ -2393,14 +2926,14 @@ var Dt = (e) => {
2393
2926
  files: e.files,
2394
2927
  artifacts: e.artifacts ? { read: (n) => e.artifacts.read(n, { webviewId: t.webviewId }) } : void 0
2395
2928
  };
2396
- }, Ar = (e) => ({
2397
- title: z(e.title) || void 0,
2929
+ }, ji = (e) => ({
2930
+ title: V(e.title) || void 0,
2398
2931
  runtimeUrl: e.runtimeUrl,
2399
2932
  moduleUrl: e.moduleUrl,
2400
2933
  styles: e.styles,
2401
2934
  capabilities: e.capabilities
2402
- }), jr = "extensions", Mr = 1e3, Nr = (e) => e === void 0 ? void 0 : e, Pr = (e) => e === "global" ? "user" : "project", Fr = (e, t) => {
2403
- let n = kr({
2935
+ }), Mi = "extensions", Ni = 1e3, Pi = (e) => e === void 0 ? void 0 : e, Fi = (e) => e === "global" ? "user" : "project", Ii = (e, t) => {
2936
+ let n = Ai({
2404
2937
  artifacts: e.webviewArtifacts,
2405
2938
  executeCommand: e.executeCommand,
2406
2939
  extensionIdForWebview: (t) => e.metadata.panels.find((e) => e.id === t)?.extensionId,
@@ -2412,49 +2945,50 @@ var Dt = (e) => {
2412
2945
  ...n(t),
2413
2946
  ...e.createWebviewHostAdapters?.(t)
2414
2947
  });
2415
- }, Ir = (e) => e.metadata.panels.flatMap((t) => {
2948
+ }, Li = (e) => e.metadata.panels.flatMap((t) => {
2416
2949
  if (!t.webview) return [];
2417
- let n = Ar(t.webview);
2950
+ let n = ji(t.webview);
2418
2951
  return [e.workbench.views.registerView({
2419
2952
  id: t.id,
2420
- title: z(t.title, t.id),
2953
+ title: V(t.title, t.id),
2421
2954
  icon: t.icon,
2422
2955
  body: {
2423
2956
  kind: "react",
2424
2957
  render: (r) => {
2425
2958
  let i = e.metadata.settingsPanels.some((e) => e.id === r.instance.panelId && e.viewId === t.id) ? "settings" : "panel";
2426
- return e.renderWebview?.(r) ?? Nt({
2959
+ return e.renderWebview?.(r) ?? Nn({
2960
+ sizing: r.panel.region === "status" ? "content-width" : void 0,
2427
2961
  context: {
2428
2962
  workbench: r.workbench,
2429
2963
  webviewId: t.id,
2430
2964
  placement: r.instance,
2431
- hostEvents: Mt(r.workbench, r.instance)
2965
+ hostEvents: Mn(r.workbench, r.instance)
2432
2966
  },
2433
- createHostAdapters: Fr(e, i),
2967
+ createHostAdapters: Ii(e, i),
2434
2968
  createProps: e.createWebviewProps ?? (({ placement: e }) => ({
2435
2969
  placement: e,
2436
2970
  resource: e.resource
2437
2971
  })),
2438
2972
  createTheme: e.createWebviewTheme,
2439
2973
  ownerId: t.extensionId,
2440
- title: z(t.title, t.id),
2974
+ title: V(t.title, t.id),
2441
2975
  webview: n
2442
2976
  });
2443
2977
  }
2444
2978
  }
2445
2979
  })];
2446
- }), Lr = {
2980
+ }), Ri = {
2447
2981
  first: 1e6,
2448
2982
  default: 0,
2449
2983
  last: -1e6
2450
- }, Rr = (e) => e.metadata.panels.flatMap((e) => e.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
2984
+ }, zi = (e) => e.metadata.panels.flatMap((e) => e.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
2451
2985
  id: t.id,
2452
2986
  ownerViewId: t.ownerPanelId,
2453
2987
  viewId: t.viewId,
2454
2988
  side: t.side,
2455
- priority: Lr[t.placement ?? "default"] - n
2456
- })), zr = (e) => {
2457
- let t = [], n = e.settingsSectionId ?? jr;
2989
+ priority: Ri[t.placement ?? "default"] - n
2990
+ })), Bi = (e) => {
2991
+ let t = [], n = e.settingsSectionId ?? Mi;
2458
2992
  e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
2459
2993
  id: n,
2460
2994
  title: e.settingsSectionTitle ?? "Extensions"
@@ -2462,7 +2996,7 @@ var Dt = (e) => {
2462
2996
  let r = [...e.metadata.settingsSections].sort((e, t) => (e.order ?? 0) - (t.order ?? 0) || e.extensionId.localeCompare(t.extensionId) || e.id.localeCompare(t.id));
2463
2997
  for (let n of r) t.push(e.workbench.settings.registerSection({
2464
2998
  id: n.id,
2465
- title: z(n.title, n.id),
2999
+ title: V(n.title, n.id),
2466
3000
  order: n.order,
2467
3001
  scope: n.scope
2468
3002
  }));
@@ -2471,34 +3005,34 @@ var Dt = (e) => {
2471
3005
  let t = a.get(e.extensionId) ?? Object.create(null);
2472
3006
  t[e.key] = {
2473
3007
  type: e.type,
2474
- scope: Pr(e.scope),
2475
- default: Nr(e.default),
3008
+ scope: Fi(e.scope),
3009
+ default: Pi(e.default),
2476
3010
  enum: e.enum,
2477
- description: z(e.description)
3011
+ description: V(e.description)
2478
3012
  }, a.set(e.extensionId, t);
2479
3013
  }
2480
3014
  for (let [n, r] of a) t.push(e.workbench.preferences.registerSchema({ properties: r }, { ownerId: n }));
2481
3015
  let o = [...e.metadata.settingsPanels].sort((e, t) => e.extensionId.localeCompare(t.extensionId) || e.id.localeCompare(t.id));
2482
3016
  for (let [r, i] of o.entries()) i.slotId !== "extension.settings" && t.push(e.workbench.settings.registerPanel({
2483
3017
  id: i.id,
2484
- title: z(i.title, i.id),
3018
+ title: V(i.title, i.id),
2485
3019
  icon: i.icon,
2486
3020
  kind: "view",
2487
- order: Mr + r,
3021
+ order: Ni + r,
2488
3022
  section: i.section ?? n,
2489
3023
  scope: i.scope,
2490
3024
  viewId: i.viewId
2491
3025
  }));
2492
3026
  return t;
2493
- }, $ = (e) => !(!e || typeof e != "object" || Array.isArray(e)), Br = (e, t, n) => ne(e) ? R(e, {
3027
+ }, Vi = (e) => !(!e || typeof e != "object" || Array.isArray(e)), Hi = (e, t, n) => T(e) ? B(e, {
2494
3028
  extensionId: t,
2495
3029
  projectId: n
2496
- }) : void 0, Vr = (e, t, n) => Array.isArray(e) ? e.flatMap((e) => {
2497
- if (!$(e) || typeof e.id != "string") return [];
2498
- let r = Br(e.action, t, n);
3030
+ }) : void 0, Ui = (e, t, n) => Array.isArray(e) ? e.flatMap((e) => {
3031
+ if (!Vi(e) || typeof e.id != "string") return [];
3032
+ let r = Hi(e.action, t, n);
2499
3033
  return [{
2500
3034
  id: e.id,
2501
- label: z(e.label, e.id),
3035
+ label: V(e.label, e.id),
2502
3036
  icon: typeof e.icon == "string" ? e.icon : void 0,
2503
3037
  iconColor: typeof e.iconColor == "string" ? e.iconColor : void 0,
2504
3038
  selected: e.selected === !0,
@@ -2508,29 +3042,29 @@ var Dt = (e) => {
2508
3042
  target: r
2509
3043
  } : void 0
2510
3044
  }];
2511
- }) : [], Hr = (e, t, n) => {
2512
- if (!$(e)) return {};
2513
- let r = $(e.indicator) ? {
3045
+ }) : [], Wi = (e, t, n) => {
3046
+ if (!Vi(e)) return {};
3047
+ let r = Vi(e.indicator) ? {
2514
3048
  icon: String(e.indicator.icon ?? ""),
2515
3049
  color: typeof e.indicator.color == "string" ? e.indicator.color : void 0,
2516
- label: z(e.indicator.label)
2517
- } : void 0, i = Array.isArray(e.menu) ? e.menu.flatMap((e) => !$(e) || typeof e.id != "string" || !Array.isArray(e.rows) ? [] : [{
3050
+ label: V(e.indicator.label)
3051
+ } : void 0, i = Array.isArray(e.menu) ? e.menu.flatMap((e) => !Vi(e) || typeof e.id != "string" || !Array.isArray(e.rows) ? [] : [{
2518
3052
  id: e.id,
2519
- label: z(e.label),
2520
- rows: Vr(e.rows, t, n)
3053
+ label: V(e.label),
3054
+ rows: Ui(e.rows, t, n)
2521
3055
  }]) : void 0;
2522
3056
  return {
2523
- label: z(e.label),
3057
+ label: V(e.label),
2524
3058
  icon: typeof e.icon == "string" ? e.icon : void 0,
2525
3059
  indicator: r?.icon ? r : void 0,
2526
3060
  menu: i
2527
3061
  };
2528
- }, Ur = (e, t) => {
3062
+ }, Gi = (e, t) => {
2529
3063
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = new Set(t.refreshEventIds ?? []), s = 0, c = (o) => {
2530
3064
  r.set(o.instanceId, o);
2531
3065
  let l = i.get(o.instanceId);
2532
3066
  if (l) return l;
2533
- let u = o.resource, d = s, f = Promise.resolve(U(e, t.queryHandlerId, {
3067
+ let u = o.resource, d = s, f = Promise.resolve(G(e, t.queryHandlerId, {
2534
3068
  resource: u,
2535
3069
  params: { renderer: {
2536
3070
  rendererId: t.placementId,
@@ -2543,7 +3077,7 @@ var Dt = (e) => {
2543
3077
  i.delete(o.instanceId), await c(o);
2544
3078
  return;
2545
3079
  }
2546
- n.set(o.instanceId, Hr(r, t.extensionId, e.projectId));
3080
+ n.set(o.instanceId, Wi(r, t.extensionId, e.projectId));
2547
3081
  for (let e of a) e();
2548
3082
  }).finally(() => {
2549
3083
  i.get(o.instanceId) === f && i.delete(o.instanceId);
@@ -2558,7 +3092,7 @@ var Dt = (e) => {
2558
3092
  subscribe(t) {
2559
3093
  a.add(t);
2560
3094
  let n = e.workbench.resources.preview.subscribeRefresh(async (e) => {
2561
- let t = [...r.values()].filter((t) => t.resource && w(t.resource) === w(e));
3095
+ let t = [...r.values()].filter((t) => t.resource && E(t.resource) === E(e));
2562
3096
  t.length && (s++, await Promise.all(t.map(c)));
2563
3097
  }), i = e.subscribeRefreshEvents?.((e) => {
2564
3098
  if (o.has(e.id)) {
@@ -2571,25 +3105,25 @@ var Dt = (e) => {
2571
3105
  } };
2572
3106
  }
2573
3107
  };
2574
- }, Wr = (e) => {
3108
+ }, Ki = (e) => {
2575
3109
  for (let t = e.length - 1; t >= 0; --t) e[t]?.dispose();
2576
- }, Gr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Kr = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n, qr = (e, t) => t.commands.map((t) => e.workbench.commands.registerCommand({
3110
+ }, qi = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Ji = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n, Yi = (e, t) => t.commands.map((t) => e.workbench.commands.registerCommand({
2577
3111
  id: t.id,
2578
- label: z(t.title, t.id),
2579
- description: z(t.description),
2580
- params: W(t.params, z, t.extensionId),
3112
+ label: V(t.title, t.id),
3113
+ description: V(t.description),
3114
+ params: K(t.params, V, t.extensionId),
2581
3115
  resourceMutation: t.resourceMutation
2582
3116
  }, {
2583
- prepareArgs: (n, r, i) => Kr(e, t.id, n, r, i),
2584
- execute: (n, r) => U(e, t.id, {
2585
- params: Gr(n),
3117
+ prepareArgs: (n, r, i) => Ji(e, t.id, n, r, i),
3118
+ execute: (n, r) => G(e, t.id, {
3119
+ params: qi(n),
2586
3120
  resource: r?.resource,
2587
3121
  signal: r?.signal,
2588
3122
  region: r?.region
2589
3123
  })
2590
- })), Jr = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Yr = (e, t) => {
3124
+ })), Xi = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Zi = (e, t) => {
2591
3125
  if (!e.menuSlotsById) return [];
2592
- let { registrations: n } = on({
3126
+ let { registrations: n } = ar({
2593
3127
  metadata: e.metadata,
2594
3128
  menuSlotsById: e.menuSlotsById,
2595
3129
  menuTargetsById: e.menuTargetsById,
@@ -2602,14 +3136,14 @@ var Dt = (e) => {
2602
3136
  }]
2603
3137
  }));
2604
3138
  return (e.menuRegistrations ?? r).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
2605
- prepareArgs: (e, r, i) => Kr(t, n.targetCommandId, e, r, i),
2606
- execute: (r, i) => U(t, n.targetCommandId, {
3139
+ prepareArgs: (e, r, i) => Ji(t, n.targetCommandId, e, r, i),
3140
+ execute: (r, i) => G(t, n.targetCommandId, {
2607
3141
  params: {
2608
3142
  ...n.contribution.params ?? {},
2609
- ...Gr(r) ?? {}
3143
+ ...qi(r) ?? {}
2610
3144
  },
2611
- resource: Jr(e, i),
2612
- slot: V({
3145
+ resource: Xi(e, i),
3146
+ slot: U({
2613
3147
  id: n.contribution.slotId,
2614
3148
  kind: "menu",
2615
3149
  projectId: e.projectId,
@@ -2617,71 +3151,72 @@ var Dt = (e) => {
2617
3151
  })
2618
3152
  })
2619
3153
  }), ...n.menuItems.map(({ menuPath: t, menuItem: n }) => e.workbench.layout.registerMenuItem(t, n))]);
2620
- }, Xr = (e, n) => sn({ metadata: e.metadata }).flatMap((r) => [e.workbench.commands.registerCommand(r.command, {
2621
- prepareArgs: (e, t, i) => Kr(n, r.targetCommandId, e, t, i),
2622
- execute: (t, i) => U(n, r.targetCommandId, {
3154
+ }, Qi = (e, t) => or({ metadata: e.metadata }).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
3155
+ prepareArgs: (e, r, i) => Ji(t, n.targetCommandId, e, r, i),
3156
+ execute: (r, i) => G(t, n.targetCommandId, {
2623
3157
  params: {
2624
- ...r.contribution.params ?? {},
2625
- ...Gr(t) ?? {}
3158
+ ...n.contribution.params ?? {},
3159
+ ...qi(r) ?? {}
2626
3160
  },
2627
- resource: Jr(e, i),
2628
- slot: V({
3161
+ resource: Xi(e, i),
3162
+ slot: U({
2629
3163
  id: "workbench.commandPalette",
2630
3164
  kind: "menu",
2631
3165
  projectId: e.projectId,
2632
- context: { panelId: r.contribution.id }
3166
+ context: { panelId: n.contribution.id }
2633
3167
  })
2634
3168
  }),
2635
- isVisible: () => re(r.contribution.when, e.workbench.getPrimaryResource()?.type)
2636
- }), e.workbench.layout.registerMenuItem(t, r.menuItem)]), Zr = (e, t) => {
3169
+ isVisible: () => ee(n.contribution.when, e.workbench.getPrimaryResource()?.type)
3170
+ }), e.workbench.layout.registerMenuItem(g, n.menuItem)]), $i = (e, t) => {
2637
3171
  let n = t?.mode;
2638
3172
  if (!n) return !0;
2639
3173
  let r = e.workbench.modes.getActiveModeId() ?? "";
2640
3174
  return Array.isArray(n) ? n.includes(r) : n === r;
2641
- }, Qr = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
3175
+ }, ea = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
2642
3176
  id: t.id,
2643
3177
  viewId: t.viewId,
2644
3178
  slot: t.slot,
2645
3179
  order: t.order,
2646
- isVisible: () => Zr(e, t.when)
2647
- })), $r = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), ei = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
3180
+ isVisible: () => $i(e, t.when)
3181
+ })), ta = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), na = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
2648
3182
  id: t.modeId,
2649
- label: z(t.label, t.modeId),
3183
+ label: V(t.label, t.modeId),
2650
3184
  panels: t.panelRegions,
2651
3185
  regionSettings: t.regionSettings,
3186
+ panelHeaders: "legacy",
2652
3187
  floatingPanels: t.floatingPanels,
2653
3188
  defaultTheme: t.defaultTheme,
2654
3189
  chrome: t.chrome,
2655
3190
  activate: () => void 0
2656
- })), ti = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), ni = (e) => {
3191
+ })), ra = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), ia = (e) => {
2657
3192
  let t = {
2658
3193
  ...e,
2659
- metadata: wr(e.metadata, { createTab: (t) => Ur(e, t) })
3194
+ metadata: Ti(e.metadata, { createTab: (t) => Gi(e, t) })
2660
3195
  }, n = [], r = t;
2661
3196
  try {
2662
- return n.push(...qr(r, t.metadata)), n.push(...ur({
3197
+ return n.push(...Yi(r, t.metadata)), n.push(...di({
2663
3198
  bindings: t.metadata.keybindings,
2664
3199
  createWhenExpression: t.createKeybindingWhenExpression,
2665
3200
  workbench: t.workbench
2666
- })), n.push(...Yr(t, r)), n.push(...Xr(t, r)), n.push(Qn({
3201
+ })), n.push(...Zi(t, r)), n.push(...Qi(t, r)), n.push(Qr({
2667
3202
  ...t,
2668
3203
  resolveNodeResource: t.resolveTreeNodeResource
2669
- })), n.push(pn(t)), n.push(Ut(r, t.metadata.controlsRenderers ?? [])), n.push(...Ir(t)), n.push(...zr(t)), n.push(zn(r, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(Xt(r, t.metadata.dataTableRenderers ?? [], t.dataTableAdapter)), n.push(...Rr(t)), n.push(Bt(r, t.metadata.commandPaletteResources ?? [])), n.push(...or({
3204
+ })), n.push(fr(t)), n.push(Un(r, t.metadata.controlsRenderers ?? [])), n.push(...Li(t)), n.push(...Bi(t)), n.push(Rr(r, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(Xn(r, t.metadata.dataTableRenderers ?? [], t.dataTableAdapter)), n.push(...zi(t)), n.push(Bn(r, t.metadata.commandPaletteResources ?? [])), n.push(...si({
2670
3205
  createWhenExpression: e.createNavigationWhenExpression,
2671
3206
  metadata: e.metadata,
2672
3207
  workbench: e.workbench
2673
- })), e.subscribeRefreshEvents && n.push(Dr({
3208
+ })), e.subscribeRefreshEvents && n.push(Oi({
2674
3209
  metadata: e.metadata,
2675
3210
  subscribe: e.subscribeRefreshEvents,
2676
3211
  workbench: e.workbench
2677
- })), n.push(...Qr(t)), n.push(...sr(t)), n.push(...$r(t)), n.push(...ei(t)), n.push(...ti(t)), { dispose() {
2678
- Wr(n);
3212
+ })), n.push(...ea(t)), n.push(...ci(t)), n.push(...ta(t)), n.push(...na(t)), n.push(...ra(t)), { dispose() {
3213
+ Ki(n);
2679
3214
  } };
2680
3215
  } catch (e) {
2681
- throw Wr(n), e;
3216
+ throw Ki(n), e;
2682
3217
  }
2683
3218
  };
2684
3219
  //#endregion
2685
- export { P as WebviewHostCapabilityError, sn as buildWorkbenchExtensionCommandPaletteRegistrations, on as buildWorkbenchExtensionMenuRegistrations, V as createExtensionSlot, Tt as createExtensionWebviewHostCapabilities, Qe as createTerminalSessionCapability, Ot as createWorkbenchWebviewHostAdapters, kt as createWorkbenchWebviewHostCapabilities, Qt as emptyWorkbenchExtensionMetadata, H as executeWorkbenchExtensionCommandResponse, dn as fileRendererRefreshEnvelopeFromCommand, Mt as getBridgeWebviewHostEventPublisher, Or as refreshOpenWorkbenchExtensionWebviews, Tr as refreshWorkbenchExtensionRenderer, Bt as registerWorkbenchExtensionCommandPaletteResources, ni as registerWorkbenchExtensionContributions, Ut as registerWorkbenchExtensionControlsRenderers, Xt as registerWorkbenchExtensionDataTableRenderers, pn as registerWorkbenchExtensionFileRenderers, zn as registerWorkbenchExtensionKanbanRenderers, Dr as registerWorkbenchExtensionRendererRefreshEvents, Qn as registerWorkbenchExtensionTreeRenderers, Nt as renderBridgeWebviewFrame, R as toWorkbenchNavigationTarget, dr as toWorkbenchWhenExpression, _t as withFrameSignal };
3220
+ export { L as WebviewHostCapabilityError, or as buildWorkbenchExtensionCommandPaletteRegistrations, ar as buildWorkbenchExtensionMenuRegistrations, U as createExtensionSlot, Cn as createExtensionWebviewHostCapabilities, Jt as createTerminalSessionCapability, On as createWorkbenchWebviewHostAdapters, kn as createWorkbenchWebviewHostCapabilities, Qn as emptyWorkbenchExtensionMetadata, W as executeWorkbenchExtensionCommandResponse, ur as fileRendererRefreshEnvelopeFromCommand, Mn as getBridgeWebviewHostEventPublisher, ki as refreshOpenWorkbenchExtensionWebviews, Ei as refreshWorkbenchExtensionRenderer, Bn as registerWorkbenchExtensionCommandPaletteResources, ia as registerWorkbenchExtensionContributions, Un as registerWorkbenchExtensionControlsRenderers, Xn as registerWorkbenchExtensionDataTableRenderers, fr as registerWorkbenchExtensionFileRenderers, Rr as registerWorkbenchExtensionKanbanRenderers, Oi as registerWorkbenchExtensionRendererRefreshEvents, Qr as registerWorkbenchExtensionTreeRenderers, Nn as renderBridgeWebviewFrame, B as toWorkbenchNavigationTarget, fi as toWorkbenchWhenExpression, hn as withFrameSignal };
2686
3221
 
2687
3222
  //# sourceMappingURL=extensions.js.map