@pstdio/workbench 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +39 -317
  2. package/dist/extensions.d.ts +1283 -774
  3. package/dist/extensions.js +1454 -1924
  4. package/dist/extensions.js.map +1 -1
  5. package/dist/file-renderer-view-kfJRY3yR.js +515 -0
  6. package/dist/file-renderer-view-kfJRY3yR.js.map +1 -0
  7. package/dist/index.d.ts +589 -644
  8. package/dist/index.js +5011 -2644
  9. package/dist/index.js.map +1 -1
  10. package/dist/react.d.ts +540 -585
  11. package/dist/react.js +3583 -3424
  12. package/dist/react.js.map +1 -1
  13. package/dist/storage.d.ts +118 -157
  14. package/dist/storage.js +135 -149
  15. package/dist/storage.js.map +1 -1
  16. package/dist/webview-runtime.d.ts +2 -5
  17. package/dist/webview-runtime.js +3 -3
  18. package/dist/webview-runtime.js.map +1 -1
  19. package/dist/workbench-menu-paths-B_QJzcNU.js +12 -0
  20. package/dist/workbench-menu-paths-B_QJzcNU.js.map +1 -0
  21. package/dist/workbench-renderers-DmsrBGC7.js +960 -0
  22. package/dist/workbench-renderers-DmsrBGC7.js.map +1 -0
  23. package/dist/workspaces-DJwFj8uq.js +1872 -0
  24. package/dist/workspaces-DJwFj8uq.js.map +1 -0
  25. package/package.json +6 -41
  26. package/dist/composition-resolver-types-CWykPyEK.js +0 -241
  27. package/dist/composition-resolver-types-CWykPyEK.js.map +0 -1
  28. package/dist/file-renderer-view-B6_iR4EN.js +0 -496
  29. package/dist/file-renderer-view-B6_iR4EN.js.map +0 -1
  30. package/dist/file-section-navigation-CfYqVObc.js +0 -30
  31. package/dist/file-section-navigation-CfYqVObc.js.map +0 -1
  32. package/dist/layout-types-DMoZz38-.js +0 -100
  33. package/dist/layout-types-DMoZz38-.js.map +0 -1
  34. package/dist/surface-map-C1pOTUmF.js +0 -52
  35. package/dist/surface-map-C1pOTUmF.js.map +0 -1
  36. package/dist/testing.d.ts +0 -2443
  37. package/dist/testing.js +0 -58
  38. package/dist/testing.js.map +0 -1
  39. package/dist/workbench-built-ins-BCJ6-fIM.js +0 -1173
  40. package/dist/workbench-built-ins-BCJ6-fIM.js.map +0 -1
  41. package/dist/workbench-menu-paths-D-e7iscN.js +0 -43
  42. package/dist/workbench-menu-paths-D-e7iscN.js.map +0 -1
  43. package/dist/workflow-status-settings-DLiu9FZ0.js +0 -144
  44. package/dist/workflow-status-settings-DLiu9FZ0.js.map +0 -1
@@ -1,85 +1,91 @@
1
- import { jsxs as Ee, jsx as G } from "react/jsx-runtime";
2
- import { useRef as R, useState as Pe, useEffect as Q, createElement as K } from "react";
3
- import { host as yt } from "rimless";
4
- import { F as we } from "./file-section-navigation-CfYqVObc.js";
5
- import { i as vt, c as Ae, w as kt } from "./workbench-menu-paths-D-e7iscN.js";
6
- import { r as Le, d as Ie } from "./composition-resolver-types-CWykPyEK.js";
7
- import { W as Y, a as Rt } from "./workflow-status-settings-DLiu9FZ0.js";
8
- import { isLocalizedString as Ct, matchesResourceWhen as xt } from "@pstdio/sdk/extensions";
9
- import { w as Et } from "./layout-types-DMoZz38-.js";
10
- const ye = 1, Pt = ["commands.execute", "resource.open", "notification.show", "notification.action", "notification.resolve", "notification.dismiss", "preferences.get", "preferences.set", "extension.settings.all", "extension.settings.get", "extension.settings.set", "extension.settings.delete", "terminal.session", "files.upload", "files.list", "files.delete"], Ue = ["host.dispatchKeyboardEvent"], At = [...Pt, ...Ue], St = new Set(At), _e = (e) => St.has(e), Tt = (e) => {
11
- const [t, n] = e.split("@"), r = n === void 0 ? ye : Number(n);
1
+ import { jsxs as ge, jsx as N } from "react/jsx-runtime";
2
+ import { useRef as v, useState as we, useEffect as K, createElement as V } from "react";
3
+ import { host as Ze } from "rimless";
4
+ import { ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES as et, WEBVIEW_HOST_CAPABILITY_VERSION as ce, WEBVIEW_HOST_CAPABILITIES as tt, WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES as nt, resourceKey as B, isLocalizedString as ot, matchesResourceWhen as st } from "@pstdio/sdk/extensions";
5
+ import { b as rt, W as _, a as it } from "./workspaces-DJwFj8uq.js";
6
+ import { renderBadgeListDisplay as at } from "@pstdio/ui/kanban-renderer";
7
+ import { w as dt } from "./workbench-menu-paths-B_QJzcNU.js";
8
+ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", lt = new Set(tt), mt = new Set(nt), Te = (e) => lt.has(e), Pe = (e) => mt.has(e), ut = (e) => {
9
+ const [t = "", n] = e.split("@"), o = t.indexOf(":"), r = o === -1 ? t : t.slice(0, o), s = o === -1 ? void 0 : t.slice(o + 1), i = n === void 0 ? ce : Number(n);
12
10
  return {
13
11
  capability: e,
14
- name: t ?? "",
15
- version: r
12
+ name: r,
13
+ scope: s,
14
+ version: i
16
15
  };
17
- }, ne = (e) => ({
16
+ }, pt = (e) => Pe(e.name) ? !!e.scope : e.scope === void 0, L = (e) => ({
18
17
  capability: e,
19
18
  code: "unsupported_webview_capability",
20
19
  message: `Unsupported webview capability: ${e}`,
21
20
  severity: "error"
22
- }), jt = (e, t, n) => ({
21
+ }), bt = (e, t, n) => ({
23
22
  capability: e,
24
23
  code: "unsupported_webview_capability_version",
25
- message: `Unsupported webview capability version: ${t}@${n.toString()} (supported: ${ye.toString()})`,
24
+ message: `Unsupported webview capability version: ${t}@${n.toString()} (supported: ${ce.toString()})`,
26
25
  severity: "error"
27
- }), Wt = (e) => ({
26
+ }), Ie = (e) => ({
28
27
  capability: e,
29
28
  code: "undeclared_webview_capability",
30
29
  message: `Webview did not declare host capability: ${e}`,
31
30
  severity: "error"
32
- }), Mt = (e, t = {}) => {
33
- const n = [], r = /* @__PURE__ */ new Set();
34
- for (const s of Ue)
35
- t[s] && r.add(s);
31
+ }), ft = (e, t = {}) => {
32
+ const n = [], o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
33
+ for (const s of et)
34
+ t[s] && o.add(s);
36
35
  for (const s of e ?? []) {
37
- const o = Tt(s);
38
- if (!_e(o.name)) {
39
- n.push(ne(s));
36
+ const i = ut(s);
37
+ if (!Te(i.name) || !pt(i)) {
38
+ n.push(L(s));
40
39
  continue;
41
40
  }
42
- if (o.version !== ye) {
43
- n.push(jt(s, o.name, o.version));
41
+ if (i.version !== ce) {
42
+ n.push(bt(s, i.name, i.version));
44
43
  continue;
45
44
  }
46
- if (!t[o.name]) {
47
- n.push(ne(s));
45
+ if (!t[i.name]) {
46
+ n.push(L(s));
48
47
  continue;
49
48
  }
50
- r.add(o.name);
49
+ if (i.scope === void 0) {
50
+ o.add(i.name);
51
+ continue;
52
+ }
53
+ const a = r.get(i.name) ?? /* @__PURE__ */ new Set();
54
+ a.add(i.scope), r.set(i.name, a);
51
55
  }
52
56
  return {
53
- allowed: r,
57
+ allowed: o,
58
+ allowedScopes: r,
54
59
  diagnostics: n
55
60
  };
56
- }, Ot = (e) => {
61
+ }, ht = (e) => {
62
+ const t = e.params;
63
+ return typeof t?.mount == "string" && t.mount.length > 0 ? t.mount : void 0;
64
+ }, gt = (e) => {
57
65
  const {
58
66
  allowed: t,
59
- diagnostics: n
60
- } = Mt(e.declaredCapabilities, e.capabilities), r = (s) => {
61
- e.onDiagnostic?.(s);
62
- };
67
+ allowedScopes: n,
68
+ diagnostics: o
69
+ } = ft(e.declaredCapabilities, e.capabilities), r = (i) => {
70
+ e.onDiagnostic?.(i);
71
+ }, s = (i) => (r(i), new Error(i.message));
63
72
  return {
64
- diagnostics: n,
65
- async call(s) {
66
- if (!_e(s.method)) {
67
- const i = ne(s.method);
68
- throw r(i), new Error(i.message);
69
- }
70
- if (!t.has(s.method)) {
71
- const i = Wt(s.method);
72
- throw r(i), new Error(i.message);
73
- }
74
- const o = e.capabilities[s.method];
75
- if (!o) {
76
- const i = ne(s.method);
77
- throw r(i), new Error(i.message);
78
- }
79
- return await o(s.params);
73
+ diagnostics: o,
74
+ async call(i) {
75
+ if (!Te(i.method)) throw s(L(i.method));
76
+ if (Pe(i.method)) {
77
+ const d = ht(i);
78
+ if (!d) throw s(L(i.method));
79
+ if (!n.get(i.method)?.has(d))
80
+ throw s(Ie(`${i.method}:${d}`));
81
+ } else if (!t.has(i.method))
82
+ throw s(Ie(i.method));
83
+ const a = e.capabilities[i.method];
84
+ if (!a) throw s(L(i.method));
85
+ return await a(i.params);
80
86
  }
81
87
  };
82
- }, Ht = (e) => typeof e == "object" && e !== null, Se = (e) => {
88
+ }, wt = (e) => typeof e == "object" && e !== null, ye = (e) => {
83
89
  try {
84
90
  const t = JSON.stringify(e);
85
91
  if (typeof t == "string" && t.length > 0) return t;
@@ -90,7 +96,7 @@ const ye = 1, Pt = ["commands.execute", "resource.open", "notification.show", "n
90
96
  } catch {
91
97
  return "Unknown error";
92
98
  }
93
- }, Kt = (e) => {
99
+ }, It = (e) => {
94
100
  if (e instanceof Error) return {
95
101
  message: e.message,
96
102
  stack: e.stack
@@ -98,7 +104,7 @@ const ye = 1, Pt = ["commands.execute", "resource.open", "notification.show", "n
98
104
  if (typeof e == "string") return {
99
105
  message: e
100
106
  };
101
- if (Ht(e)) {
107
+ if (wt(e)) {
102
108
  const t = typeof e.message == "string" ? e.message : null, n = typeof e.stack == "string" ? e.stack : void 0;
103
109
  return t ? n ? {
104
110
  message: t,
@@ -106,42 +112,42 @@ const ye = 1, Pt = ["commands.execute", "resource.open", "notification.show", "n
106
112
  } : {
107
113
  message: t
108
114
  } : {
109
- message: Se(e)
115
+ message: ye(e)
110
116
  };
111
117
  }
112
118
  return e == null ? {
113
119
  message: "Unknown error"
114
120
  } : {
115
- message: Se(e)
121
+ message: ye(e)
116
122
  };
117
- }, de = () => {
123
+ }, oe = () => {
118
124
  if (typeof document > "u") return {};
119
125
  const e = getComputedStyle(document.documentElement), t = {};
120
126
  for (let n = 0; n < e.length; n += 1) {
121
- const r = e.item(n);
122
- r.startsWith("--chakra-") && (t[r] = e.getPropertyValue(r).trim());
127
+ const o = e.item(n);
128
+ o.startsWith("--chakra-") && (t[o] = e.getPropertyValue(o).trim());
123
129
  }
124
130
  return t;
125
- }, ce = (e) => {
131
+ }, se = (e) => {
126
132
  if (typeof document > "u") return e;
127
133
  const t = document.documentElement.getAttribute("data-theme");
128
134
  if (t === "dark" || t === "light") return t;
129
135
  const n = document.documentElement.getAttribute("data-color-mode");
130
136
  return n === "dark" || n === "light" ? n : e;
131
- }, $t = {
137
+ }, yt = {
132
138
  border: 0,
133
139
  display: "block",
134
140
  flex: "1 1 0%",
135
141
  height: "100%",
136
142
  minHeight: 0,
137
143
  width: "100%"
138
- }, Vt = {
144
+ }, vt = {
139
145
  display: "flex",
140
146
  height: "100%",
141
147
  minHeight: 0,
142
148
  position: "relative",
143
149
  width: "100%"
144
- }, Dt = {
150
+ }, kt = {
145
151
  alignItems: "center",
146
152
  background: "rgba(255, 255, 255, 0.92)",
147
153
  color: "#7a1f12",
@@ -152,160 +158,159 @@ const ye = 1, Pt = ["commands.execute", "resource.open", "notification.show", "n
152
158
  position: "absolute",
153
159
  textAlign: "center",
154
160
  zIndex: 1
155
- }, Bt = "allow-scripts allow-forms allow-popups", Ft = (e) => {
161
+ }, xt = "allow-scripts allow-forms allow-popups", Rt = (e) => {
156
162
  const {
157
163
  view: t,
158
164
  props: n,
159
- theme: r,
160
- capabilities: s,
161
- hostEvents: o,
165
+ theme: o,
166
+ capabilities: r,
167
+ hostEvents: s,
162
168
  onReady: i,
163
169
  onError: a,
164
170
  onDiagnostics: d,
165
- title: u
166
- } = e, w = R(null), l = R(null), m = R(!1), c = R(null), f = R(n), h = R(r), C = R(s), j = R(o), _ = R(t.webview.capabilities), q = R(i), W = R(a), b = R(d), [y, E] = Pe(null), [x, A] = Pe(0);
167
- return f.current = n, h.current = r, C.current = s, j.current = o, _.current = t.webview.capabilities, q.current = i, W.current = a, b.current = d, Q(() => {
168
- const g = w.current;
169
- if (!g) return;
170
- const M = () => {
171
- m.current && A((k) => k + 1);
171
+ title: m
172
+ } = e, l = v(null), c = v(null), p = v(null), u = v(!1), g = v(null), x = v(n), $ = v(o), O = v(r), H = v(s), z = v(t.webview.capabilities), te = v(i), T = v(a), f = v(d), [k, w] = we(null), [S, Q] = we(0);
173
+ return x.current = n, $.current = o, O.current = r, H.current = s, z.current = t.webview.capabilities, te.current = i, T.current = a, f.current = d, K(() => {
174
+ const h = l.current;
175
+ if (!h) return;
176
+ const A = () => {
177
+ c.current === h ? Q((y) => y + 1) : c.current = h;
172
178
  };
173
- g.addEventListener("load", M);
174
- const O = () => g.removeEventListener("load", M), z = `${x}
179
+ h.addEventListener("load", A);
180
+ const C = () => h.removeEventListener("load", A), F = `${S}
175
181
  ${t.webview.runtimeUrl}
176
182
  ${t.webview.moduleUrl}`;
177
- if (c.current === z) return O;
178
- c.current = z;
179
- const gt = t.webview.styles, ht = t.webview.moduleUrl, Ce = (k) => {
180
- k.length > 0 && b.current?.(k);
181
- }, xe = () => Ot({
182
- capabilities: C.current ?? {},
183
- declaredCapabilities: _.current,
184
- onDiagnostic: (k) => Ce([k])
183
+ if (g.current === F) return C;
184
+ g.current = F;
185
+ const Ge = t.webview.styles, Ye = t.webview.moduleUrl, fe = (y) => {
186
+ y.length > 0 && f.current?.(y);
187
+ }, he = () => gt({
188
+ capabilities: O.current ?? {},
189
+ declaredCapabilities: z.current,
190
+ onDiagnostic: (y) => fe([y])
185
191
  });
186
- Ce(xe().diagnostics);
187
- const wt = {
192
+ fe(he().diagnostics);
193
+ const Xe = {
188
194
  ready: () => {
189
195
  },
190
- runtimeError: (k) => {
191
- E(k.message), W.current?.(k);
196
+ runtimeError: (y) => {
197
+ w(y.message), T.current?.(y);
192
198
  },
193
- call: async (k) => await xe().call(k)
199
+ call: async (y) => await he().call(y)
194
200
  };
195
201
  return (() => {
196
- m.current = !1, l.current = null;
197
- const k = yt.connect(g, wt);
198
- g.contentWindow?.location.replace(t.webview.runtimeUrl), k.then(async (ae) => {
199
- const H = ae.remote;
200
- l.current = H, j.current?.bind((It) => H.hostEvent?.(It)), await H.init({
201
- moduleUrl: ht,
202
- styles: gt,
203
- props: f.current,
204
- theme: ce(h.current),
205
- themeVariables: de(),
202
+ u.current = !1, p.current = null;
203
+ const y = Ze.connect(h, Xe);
204
+ h.contentWindow?.location.replace(t.webview.runtimeUrl), y.then(async (ne) => {
205
+ if (l.current !== h) return;
206
+ const W = ne.remote;
207
+ p.current = W, H.current?.bind((Je) => W.hostEvent?.(Je)), await W.init({
208
+ moduleUrl: Ye,
209
+ styles: Ge,
210
+ props: x.current,
211
+ theme: se($.current),
212
+ themeVariables: oe(),
206
213
  extensionId: t.extensionId
207
- }), m.current = !0, E(null), q.current?.();
208
- }).catch((ae) => {
209
- const H = Kt(ae);
210
- E(H.message), W.current?.(H);
214
+ }), l.current === h && (u.current = !0, w(null), te.current?.());
215
+ }).catch((ne) => {
216
+ if (l.current !== h) return;
217
+ const W = It(ne);
218
+ w(W.message), T.current?.(W);
211
219
  });
212
- })(), O;
213
- }, [x, t.extensionId, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), Q(() => {
214
- const g = l.current;
215
- if (!(!g || !o))
216
- return o.bind((M) => g.hostEvent?.(M)), () => o.unbind();
217
- }, [o]), Q(() => {
218
- m.current && l.current?.propsUpdate({
220
+ })(), C;
221
+ }, [S, t.extensionId, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), K(() => {
222
+ const h = p.current;
223
+ if (!(!h || !s))
224
+ return s.bind((A) => h.hostEvent?.(A)), () => s.unbind();
225
+ }, [s]), K(() => {
226
+ u.current && p.current?.propsUpdate({
219
227
  props: n
220
228
  });
221
- }, [n]), Q(() => {
222
- m.current && l.current?.themeUpdate({
223
- theme: ce(r),
224
- variables: de()
229
+ }, [n]), K(() => {
230
+ u.current && p.current?.themeUpdate({
231
+ theme: se(o),
232
+ variables: oe()
225
233
  });
226
- }, [r]), Q(() => {
234
+ }, [o]), K(() => {
227
235
  if (typeof window > "u" || typeof MutationObserver > "u") return;
228
- let g = null;
229
- const M = () => {
230
- g !== null && cancelAnimationFrame(g), g = requestAnimationFrame(() => {
231
- g = null, m.current && l.current?.themeUpdate({
232
- theme: ce(h.current),
233
- variables: de()
236
+ let h = null;
237
+ const A = () => {
238
+ h !== null && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
239
+ h = null, u.current && p.current?.themeUpdate({
240
+ theme: se($.current),
241
+ variables: oe()
234
242
  });
235
243
  });
236
- }, O = new MutationObserver(M), z = {
244
+ }, C = new MutationObserver(A), F = {
237
245
  attributeFilter: ["class", "data-color-mode", "data-theme", "style"],
238
246
  attributes: !0
239
247
  };
240
- return O.observe(document.documentElement, z), O.observe(document.body, z), () => {
241
- O.disconnect(), g !== null && cancelAnimationFrame(g);
248
+ return C.observe(document.documentElement, F), C.observe(document.body, F), () => {
249
+ C.disconnect(), h !== null && cancelAnimationFrame(h);
242
250
  };
243
- }, []), /* @__PURE__ */ Ee("div", { style: Vt, children: [
244
- y ? /* @__PURE__ */ G("div", { role: "alert", style: Dt, children: /* @__PURE__ */ Ee("div", { children: [
245
- /* @__PURE__ */ G("strong", { children: "Extension view failed to load." }),
246
- /* @__PURE__ */ G("div", { children: y })
251
+ }, []), /* @__PURE__ */ ge("div", { style: vt, children: [
252
+ k ? /* @__PURE__ */ N("div", { role: "alert", style: kt, children: /* @__PURE__ */ ge("div", { children: [
253
+ /* @__PURE__ */ N("strong", { children: "Extension view failed to load." }),
254
+ /* @__PURE__ */ N("div", { children: k })
247
255
  ] }) }) : null,
248
- /* @__PURE__ */ G(
256
+ /* @__PURE__ */ N(
249
257
  "iframe",
250
258
  {
251
- ref: w,
252
- title: u ?? t.label,
259
+ ref: l,
260
+ title: m ?? t.label,
253
261
  allow: "fullscreen",
254
262
  allowFullScreen: !0,
255
- sandbox: Bt,
263
+ sandbox: xt,
256
264
  style: {
257
- ...$t,
258
- colorScheme: r
259
- },
260
- onLoad: () => {
261
- m.current && A((g) => g + 1);
265
+ ...yt,
266
+ colorScheme: o
262
267
  },
263
268
  onError: () => {
264
- const g = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
265
- E(g), W.current?.({
266
- message: g
269
+ const h = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
270
+ w(h), T.current?.({
271
+ message: h
267
272
  });
268
273
  }
269
274
  },
270
- x
275
+ S
271
276
  )
272
277
  ] });
273
- }, Nt = () => {
278
+ }, Et = () => {
274
279
  let e = null;
275
280
  const t = [], n = /* @__PURE__ */ new Set();
276
281
  return {
277
- emit(r) {
278
- e ? e(r) : t.push(r);
282
+ emit(o) {
283
+ e ? e(o) : t.push(o);
279
284
  },
280
- bind(r) {
281
- for (e = r; t.length > 0; ) r(t.shift());
285
+ bind(o) {
286
+ for (e = o; t.length > 0; ) o(t.shift());
282
287
  },
283
- onDisconnect(r) {
284
- return n.add(r), () => n.delete(r);
288
+ onDisconnect(o) {
289
+ return n.add(o), () => n.delete(o);
285
290
  },
286
291
  unbind() {
287
292
  e = null;
288
- for (const r of n) r();
293
+ for (const o of n) o();
289
294
  }
290
295
  };
291
- }, Lt = "terminal.session", Ut = (e) => {
296
+ }, At = "terminal.session", Ct = (e) => {
292
297
  const {
293
298
  terminal: t,
294
299
  hostEvents: n
295
- } = e, r = (s) => {
300
+ } = e, o = (r) => {
296
301
  n.emit({
297
- scope: Lt,
298
- payload: s
302
+ scope: At,
303
+ payload: r
299
304
  });
300
305
  };
301
- return async (s) => {
302
- const o = s;
303
- switch (o.operation) {
306
+ return async (r) => {
307
+ const s = r;
308
+ switch (s.operation) {
304
309
  case "open": {
305
310
  const {
306
311
  sessionId: i
307
312
  } = await t.open({
308
- request: o.request
313
+ request: s.request
309
314
  });
310
315
  return {
311
316
  operation: "open",
@@ -314,25 +319,25 @@ ${t.webview.moduleUrl}`;
314
319
  }
315
320
  case "write":
316
321
  return t.write({
317
- sessionId: o.sessionId,
318
- data: o.data
322
+ sessionId: s.sessionId,
323
+ data: s.data
319
324
  }), {
320
325
  operation: "write",
321
326
  accepted: !0
322
327
  };
323
328
  case "resize":
324
329
  return t.resize({
325
- sessionId: o.sessionId,
326
- cols: o.cols,
327
- rows: o.rows
330
+ sessionId: s.sessionId,
331
+ cols: s.cols,
332
+ rows: s.rows
328
333
  }), {
329
334
  operation: "resize",
330
335
  accepted: !0
331
336
  };
332
337
  case "kill":
333
338
  return await t.kill({
334
- sessionId: o.sessionId,
335
- signal: o.signal
339
+ sessionId: s.sessionId,
340
+ signal: s.signal
336
341
  }), {
337
342
  operation: "kill",
338
343
  accepted: !0
@@ -340,35 +345,35 @@ ${t.webview.moduleUrl}`;
340
345
  case "subscribe": {
341
346
  const {
342
347
  sessionId: i
343
- } = o;
348
+ } = s;
344
349
  let a = () => {
345
350
  }, d = () => {
346
- }, u = !1;
347
- const w = () => {
348
- u || (u = !0, a(), d());
351
+ }, m = !1;
352
+ const l = () => {
353
+ m || (m = !0, a(), d());
349
354
  };
350
355
  return a = t.subscribe(i, {
351
- onData: (l) => r({
356
+ onData: (c) => o({
352
357
  sessionId: i,
353
358
  kind: "data",
354
- chunk: l
359
+ chunk: c
355
360
  }),
356
- onExit: (l) => {
357
- r({
361
+ onExit: (c) => {
362
+ o({
358
363
  sessionId: i,
359
364
  kind: "exit",
360
- code: l.code,
361
- signal: l.signal
362
- }), w();
365
+ code: c.code,
366
+ signal: c.signal
367
+ }), l();
363
368
  }
364
- }), d = n.onDisconnect(w), {
369
+ }), d = n.onDisconnect(l), {
365
370
  operation: "subscribe",
366
371
  accepted: !0
367
372
  };
368
373
  }
369
374
  }
370
375
  };
371
- }, _t = (e) => {
376
+ }, St = (e) => {
372
377
  if (typeof document > "u") return;
373
378
  const t = new KeyboardEvent("keydown", {
374
379
  ...e,
@@ -376,17 +381,22 @@ ${t.webview.moduleUrl}`;
376
381
  cancelable: !0
377
382
  });
378
383
  document.dispatchEvent(t);
379
- }, qe = (e) => !e?.strategy || e.strategy === "persistent" ? {} : {
380
- replaceActive: !0
381
- }, ze = (e) => ({
384
+ }, Tt = (e) => ({
385
+ ...e.placement?.placementIdentity ? {
386
+ "placement.close": (t) => {
387
+ if (t !== void 0 && (typeof t != "object" || t === null || Array.isArray(t) || Object.keys(t).length > 0))
388
+ throw new Error("placement.close takes no parameters; the host supplies the calling placement.");
389
+ e.workbench.closePlacement(e.placement.placementIdentity);
390
+ }
391
+ } : {},
382
392
  "commands.execute": (t) => {
383
393
  const n = t;
384
394
  return e.workbench.commands.executeCommand(n.commandId, n.params);
385
395
  },
386
- "resource.open": (t) => {
396
+ "navigation.open": (t) => {
387
397
  const n = t;
388
- if (!n.resource) throw new Error("resource.open requires a resource.");
389
- return e.workbench.resources.openResource(n.resource, qe(n.input));
398
+ if (!n.target) throw new Error("navigation.open requires a target.");
399
+ return e.workbench.navigation.openTarget(n.target);
390
400
  },
391
401
  "notification.show": (t) => {
392
402
  const n = t;
@@ -409,45 +419,36 @@ ${t.webview.moduleUrl}`;
409
419
  value: n.value
410
420
  };
411
421
  },
412
- "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? _t)(t),
422
+ "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? St)(t),
413
423
  ...e.hostEvents ? {
414
- "terminal.session": Ut({
424
+ "terminal.session": Ct({
415
425
  terminal: e.workbench.terminal,
416
426
  hostEvents: e.hostEvents
417
427
  })
418
428
  } : {}
419
- }), qt = (e, t) => {
429
+ }), Pt = (e, t) => {
420
430
  for (const n of t)
421
431
  console.warn(`[workbench.webview:${e}] ${n.code}/${n.capability}: ${n.message}`);
422
- }, zt = (e, t) => {
432
+ }, jt = (e, t) => {
423
433
  console.error(`[workbench.webview:${e}] runtime error: ${t}`);
424
- }, se = "webview:bridge", Qt = (e) => {
425
- if (typeof e != "object" || e === null || Array.isArray(e)) return !1;
426
- const t = e;
427
- return typeof t.runtimeUrl == "string" && typeof t.moduleUrl == "string";
428
- }, Gt = ({
429
- placement: e
430
- }) => ({
431
- placement: e,
432
- resource: e.resource
433
- }), Qe = () => "light", Te = /* @__PURE__ */ new WeakMap(), Ge = (e, t) => {
434
- let n = Te.get(e);
435
- n || (n = /* @__PURE__ */ new Map(), Te.set(e, n));
436
- const r = t.instanceId;
437
- let s = n.get(r);
438
- return s || (s = Nt(), n.set(r, s)), s;
439
- }, Ye = (e) => {
434
+ }, $t = () => "light", ve = /* @__PURE__ */ new WeakMap(), Ht = (e, t) => {
435
+ let n = ve.get(e);
436
+ n || (n = /* @__PURE__ */ new Map(), ve.set(e, n));
437
+ const o = t.instanceId;
438
+ let r = n.get(o);
439
+ return r || (r = Et(), n.set(o, r)), r;
440
+ }, Wt = (e) => {
440
441
  const {
441
442
  context: t,
442
443
  createHostCapabilities: n,
443
- createProps: r,
444
- createTheme: s = Qe,
445
- ownerId: o,
444
+ createProps: o,
445
+ createTheme: r = $t,
446
+ ownerId: s,
446
447
  title: i,
447
448
  webview: a
448
449
  } = e;
449
- return /* @__PURE__ */ G(Ft, { view: {
450
- extensionId: o ?? "workbench",
450
+ return /* @__PURE__ */ N(Rt, { view: {
451
+ extensionId: s ?? "workbench",
451
452
  id: t.webviewId,
452
453
  label: a.title ?? i,
453
454
  webview: {
@@ -456,158 +457,79 @@ ${t.webview.moduleUrl}`;
456
457
  runtimeUrl: a.runtimeUrl,
457
458
  styles: a.styles ?? []
458
459
  }
459
- }, props: r(t), theme: s(t), capabilities: n(t), hostEvents: t.hostEvents, onDiagnostics: (d) => qt(t.webviewId, d), onError: (d) => zt(t.webviewId, d.message) });
460
- }, Yt = (e, t, n, r) => {
461
- const {
462
- workbench: s,
463
- panel: o,
464
- instance: i
465
- } = e, a = Qt(o.config) ? o.config : null;
466
- return a ? Ye({
467
- context: {
468
- workbench: s,
469
- webviewId: i.panelId,
470
- placement: i,
471
- hostEvents: Ge(s, i)
472
- },
473
- createHostCapabilities: t,
474
- createProps: n,
475
- createTheme: r,
476
- ownerId: "ownerId" in o ? o.ownerId : void 0,
477
- title: o.title,
478
- webview: a
479
- }) : null;
480
- }, Xt = (e = {}) => {
481
- const t = e.createHostCapabilities ?? ze, n = e.createProps ?? Gt, r = e.createTheme ?? Qe;
460
+ }, props: o(t), theme: r(t), capabilities: n(t), hostEvents: t.hostEvents, onDiagnostics: (d) => Pt(t.webviewId, d), onError: (d) => jt(t.webviewId, d.message) });
461
+ }, b = (e, t = "") => e === void 0 ? t : ct(e) ? e.default ?? e.$l10n : e, R = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), J = (e, t) => R(e) && e.kind === t && typeof e.id == "string", je = (e) => R(e) && typeof e.type == "string" && typeof e.id == "string", $e = (e) => e === void 0 || e === "preview" || e === "pin", le = (e, t = /* @__PURE__ */ new Set()) => {
462
+ if (!R(e) || e.kind !== "page" || !J(e.page, "page") || t.has(e) || e.resource !== void 0 && !je(e.resource) || e.section !== void 0 && !R(e.section) || !$e(e.open)) return !1;
463
+ if (e.parent === void 0) return !0;
464
+ const n = new Set(t);
465
+ return n.add(e), le(e.parent, n);
466
+ }, He = (e) => {
467
+ if (!R(e) || e.kind !== "panel" || !R(e.panel)) return !1;
468
+ const t = e.panel;
469
+ return (J(t, "placement") || t.kind === "page-slot" && J(t.page, "page") && typeof t.id == "string") && (e.resource === void 0 || je(e.resource)) && $e(e.open);
470
+ }, Mt = (e) => R(e) ? e.kind === "page" ? le(e) : e.kind === "panel" ? He(e) : e.kind === "href" ? typeof e.href == "string" : e.kind === "command" && R(e.target) && J(e.target.command, "command") && (e.target.params === void 0 || R(e.target.params)) : !1, Bt = (e) => Mt(e) ? !0 : !R(e) || e.kind !== "compound" || !Array.isArray(e.targets) || e.targets.length === 0 ? !1 : e.targets.every((t) => le(t) || He(t)), Vt = (e, t) => {
471
+ const n = t.commandTargetOf?.(e);
472
+ if (n) return n;
473
+ const o = e.target.command, r = o.extensionId ?? t.extensionId;
482
474
  return {
483
- id: se,
484
- render: (s) => Yt(s, t, n, r)
475
+ kind: "command",
476
+ commandId: t.commandIdOf?.(o) ?? (r && r !== "pstdio" ? `${r}.command.${o.id}` : o.id),
477
+ args: e.target.params
485
478
  };
486
- }, Jt = (e, t) => ({
487
- extensionId: "pstdio",
488
- kind: e,
489
- id: t
490
- }), le = (e, t, n) => ({
491
- id: e,
492
- ref: Jt("resource-kind", e),
493
- surface: "primary",
494
- label: t,
495
- menuSlots: n
496
- }), ue = [{
497
- id: "headerPrimary",
498
- placement: "header-primary",
499
- access: "public"
500
- }, {
501
- id: "headerOverflow",
502
- placement: "header-overflow",
503
- access: "public"
504
- }], me = {
505
- project: le("project", "Extension", ue),
506
- session: le("session", "Session", ue),
507
- workspace: le("workspace", "Workspace", ue)
508
- }, $ = {
509
- project: me.project.ref,
510
- session: me.session.ref,
511
- workspace: me.workspace.ref
512
- }, je = (e) => ({
479
+ }, ae = (e, t) => e.extensionId !== void 0 || t === void 0 ? e : {
513
480
  ...e,
514
- kind: "command"
515
- });
516
- Object.assign(je, {
517
- forExtension: (e) => (t) => je({
518
- extensionId: `${e.publisher}.${e.name}`,
519
- id: t
520
- })
521
- });
522
- const Zt = (e) => ({
481
+ extensionId: t
482
+ }, We = (e, t) => ({
523
483
  ...e,
524
- kind: "event"
525
- }), re = (e, t) => ({
526
- id: e,
527
- kind: t.kind,
528
- label: t.label,
529
- description: t.description,
530
- metadata: t.metadata
531
- }), I = (e) => Zt({
532
- extensionId: "pstdio",
533
- id: e
534
- }), V = (e, t) => re(`${e.id}.${t}`, {
535
- kind: "menu"
536
- });
537
- re("project.sidenav", {
538
- kind: "panel"
539
- }), V($.project, "headerPrimary"), V($.project, "headerOverflow"), re("project.settingsPanels", {
540
- kind: "settings"
541
- });
542
- V($.session, "headerPrimary"), V($.session, "headerOverflow");
543
- V($.workspace, "headerPrimary"), V($.workspace, "headerOverflow"), re("workspace.sidenav", {
544
- kind: "panel"
484
+ page: ae(e.page, t),
485
+ ...e.parent ? {
486
+ parent: We(e.parent, t)
487
+ } : {}
545
488
  });
546
- I("project.opened");
547
- I("session.started"), I("session.resumed"), I("session.awaitingInput"), I("session.succeeded"), I("session.failed"), I("session.completed");
548
- I("workspace.created"), I("workspace.provision"), I("workspace.ready"), I("workspace.archived"), I("workspace.deleted");
549
- I("worktree.removed");
550
- I("git.committed"), I("git.rebased"), I("git.merged"), I("git.conflicted");
551
- const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", p = (e, t = "") => e === void 0 ? t : en(e) ? e.default ?? e.$l10n : e, ie = (e) => {
489
+ function j(e, t = {}) {
490
+ return e.kind === "command" ? Vt(e, t) : e.kind === "href" ? e : e.kind === "page" ? We(e, t.extensionId) : e.kind === "panel" ? {
491
+ ...e,
492
+ panel: e.panel.kind === "page-slot" ? {
493
+ ...e.panel,
494
+ page: ae(e.panel.page, t.extensionId)
495
+ } : ae(e.panel, t.extensionId)
496
+ } : {
497
+ kind: "compound",
498
+ targets: e.targets.map((n) => j(n, t))
499
+ };
500
+ }
501
+ const me = (e, t = {}) => {
502
+ if (e != null) {
503
+ if (!Bt(e)) throw new Error("Renderer callback returned an invalid navigation target.");
504
+ return j(e, t);
505
+ }
506
+ }, ee = (e) => {
552
507
  const t = e;
553
508
  if (!t?.outcome) return e;
554
509
  if (t.outcome.status === "success") return t.outcome.value;
555
510
  throw new Error(t.outcome.reason ?? t.outcome.error?.message ?? "Extension command failed.");
556
- }, D = (e) => {
557
- if (e)
558
- return {
559
- type: e.kind,
560
- id: e.id ?? e.uri,
561
- label: e.label,
562
- metadata: e.metadata
563
- };
564
- }, J = (e) => {
565
- const t = e.icon, n = e.projectId ? {
566
- ...e.metadata,
567
- projectId: e.projectId
568
- } : e.metadata;
569
- return {
570
- kind: e.type,
571
- uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
572
- id: e.id,
573
- label: e.label,
574
- icon: typeof t == "string" ? t : void 0,
575
- metadata: n
576
- };
577
- }, B = (e) => ({
511
+ }, D = (e) => ({
578
512
  id: e.id,
579
513
  kind: e.kind,
580
514
  context: {
581
515
  projectId: e.projectId,
582
516
  ...e.context ?? {}
583
517
  }
584
- }), tn = (e) => typeof e == "object" && e !== null && !Array.isArray(e), nn = (e) => {
585
- if (!(!tn(e) || e.deleted !== !0))
518
+ }), Dt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ot = (e) => {
519
+ if (!(!Dt(e) || e.deleted !== !0))
586
520
  return typeof e.id == "string" ? e.id : void 0;
587
- }, rn = async (e, t, n) => {
588
- if (!t || nn(n) !== (t.id ?? t.uri) || (e.workbench.navigator.forgetResource(t.uri), e.workbench.getPrimaryResource()?.uri !== t.uri)) return;
589
- const r = e.workbench.resources.walkHierarchy(t).at(-2);
590
- if (r) {
591
- if (vt(r)) {
592
- await e.workbench.views.openView(r.viewId, {
593
- strategy: {
594
- kind: "replace-active"
595
- }
596
- });
597
- return;
598
- }
599
- await e.workbench.resources.openResource(r, {
600
- replaceActive: !0
601
- });
602
- }
603
- }, P = async (e, t, n = {}) => {
604
- const r = D(n.resource), s = await e.executeCommand(t, {
521
+ }, Ft = async (e, t, n) => {
522
+ if (!t || Ot(n) !== (t.id ?? B(t)) || B(e.workbench.getPrimaryResource()) !== B(t)) return;
523
+ const o = e.workbench.pageLocations.navigateToParent();
524
+ if (!o.ok) throw new Error(o.diagnostic.message);
525
+ }, E = async (e, t, n = {}) => {
526
+ const o = n.resource, r = await e.executeCommand(t, {
605
527
  projectId: e.projectId,
606
528
  ...n.params ? {
607
529
  params: n.params
608
530
  } : {},
609
- ...r ? {
610
- resource: r
531
+ ...o ? {
532
+ resource: o
611
533
  } : {},
612
534
  ...n.slot ? {
613
535
  slot: n.slot
@@ -616,342 +538,75 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
616
538
  ...n.metadata ? {
617
539
  metadata: n.metadata
618
540
  } : {}
619
- }), o = ie(s);
620
- return await rn(e, n.resource, o), o;
621
- }, S = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), Xe = (e, t) => S(e) && e.kind === t && typeof e.id == "string", on = (e) => S(e) && typeof e.type == "string" && typeof e.id == "string", sn = (e) => {
622
- if (!on(e.resource)) return !1;
623
- if (e.input === void 0) return !0;
624
- if (!S(e.input)) return !1;
625
- const t = e.input.strategy;
626
- return t === void 0 || t === "persistent" || t === "replace-active";
627
- }, an = (e) => {
628
- if (!Xe(e.view, "view")) return !1;
629
- if (e.input === void 0) return !0;
630
- if (!S(e.input)) return !1;
631
- const t = e.input.strategy;
632
- return t === void 0 || t === "persistent" || t === "preview" || t === "replace-active" || t === "replace-invoking";
633
- }, We = (e) => S(e) ? e.kind === "resource" ? sn(e) : e.kind === "view" ? an(e) : e.kind === "href" ? typeof e.href == "string" : e.kind === "command" && S(e.target) && Xe(e.target.command, "command") && (e.target.params === void 0 || S(e.target.params)) : !1, dn = (e) => We(e) ? !0 : S(e) && e.kind === "compound" && Array.isArray(e.targets) && e.targets.length > 0 && e.targets.every(We), cn = (e, t) => !e || e === "persistent" ? {} : {
634
- replaceActive: !0
635
- }, ln = (e, t) => {
636
- const n = e?.strategy;
637
- if (!n) return {};
638
- if (n === "persistent" || n === "preview" || n === "replace-active")
639
- return {
640
- strategy: {
641
- kind: n
642
- }
643
- };
644
- if (!t) throw new Error("replace-invoking requires a live source placement.");
645
- return {
646
- strategy: {
647
- kind: "replace-panel",
648
- instanceId: t.instanceId
649
- }
650
- };
651
- }, un = (e, t) => {
652
- const n = t.commandTargetOf?.(e);
653
- if (n) return n;
654
- const r = e.target.command, s = r.extensionId ?? t.extensionId;
655
- return {
656
- kind: "command",
657
- commandId: t.commandIdOf?.(r) ?? (s && s !== "pstdio" ? `${s}.command.${r.id}` : r.id),
658
- args: e.target.params
659
- };
660
- }, mn = (e, t) => {
661
- const n = e.view.extensionId ?? t;
662
- return n ? `${n}.view.${e.view.id}` : e.view.id;
663
- }, Z = (e, t = {}) => {
664
- if (e.kind === "resource") {
665
- if (e.section && !t.resourceOf)
666
- throw new Error("Resource targets with a section need a resourceOf translator that encodes the section.");
667
- return {
668
- kind: "resource",
669
- resource: t.resourceOf ? t.resourceOf(e.resource, e) : J(e.resource),
670
- input: cn(e.input?.strategy, t.sourcePlacement)
671
- };
672
- }
673
- return e.kind === "view" ? {
674
- kind: "view",
675
- viewId: mn(e, t.extensionId),
676
- input: ln(e.input, t.sourcePlacement)
677
- } : e.kind === "command" ? un(e, t) : e.kind === "href" ? e : {
678
- kind: "compound",
679
- targets: e.targets.map((n) => Z(n, t))
680
- };
681
- }, Je = (e, t = {}) => {
682
- if (e != null) {
683
- if (!dn(e)) throw new Error("Renderer callback returned an invalid navigation target.");
684
- return Z(e, t);
685
- }
686
- }, pn = (e) => typeof e == "object" && e !== null && !Array.isArray(e), fn = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, bn = async (e, t, n) => {
541
+ }), s = ee(r);
542
+ return await Ft(e, n.resource, s), s;
543
+ }, Kt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Nt = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Lt = async (e, t, n) => {
687
544
  const {
688
- target: r
545
+ target: o
689
546
  } = n;
690
- if (r.kind === "command") {
691
- await P(e, fn(r.target.command, t.extensionId), {
692
- params: r.target.params
547
+ if (o.kind === "command") {
548
+ await E(e, Nt(o.target.command, t.extensionId), {
549
+ params: o.target.params
693
550
  }), e.workbench.commandPaletteResources.refresh();
694
551
  return;
695
552
  }
696
- await e.workbench.navigation.openTarget(Z(r, {
697
- extensionId: t.extensionId,
698
- resourceOf: (s, o) => {
699
- const i = J(s);
700
- return o.section ? {
701
- ...i,
702
- metadata: {
703
- ...i.metadata,
704
- [we]: {
705
- treeId: t.id,
706
- targetNodeId: n.id,
707
- anchors: o.section.anchors
708
- }
709
- }
710
- } : i;
711
- }
553
+ await e.workbench.navigation.openTarget(j(o, {
554
+ extensionId: t.extensionId
712
555
  }));
713
- }, gn = (e, t, n, r) => ({
714
- id: `${t.id}:${r.id}`,
715
- label: r.label,
716
- description: r.description,
717
- icon: r.icon,
718
- keywords: r.keywords,
556
+ }, _t = (e, t, n, o) => ({
557
+ id: `${t.id}:${o.id}`,
558
+ label: o.label,
559
+ description: o.description,
560
+ icon: o.icon,
561
+ keywords: o.keywords,
719
562
  group: n,
720
- activate: () => bn(e, t, r)
721
- }), hn = (e, t) => {
563
+ activate: () => Lt(e, t, o)
564
+ }), Ut = (e, t) => {
722
565
  const n = [];
723
- for (const r of t) {
724
- const s = p(r.title, r.id);
566
+ for (const o of t) {
567
+ const r = b(o.title, o.id);
725
568
  n.push(e.workbench.commandPaletteResources.registerProvider({
726
- id: r.id,
727
- title: s,
728
- refreshEventIds: r.refreshEventIds,
569
+ id: o.id,
570
+ title: r,
571
+ refreshEventIds: o.refreshEventIds,
729
572
  query: async ({
730
- query: o,
573
+ query: s,
731
574
  limit: i
732
575
  }) => {
733
- const a = e.workbench.getActiveResource(), d = await P(e, r.queryHandlerId, {
576
+ const a = e.workbench.getActiveResource(), d = await E(e, o.queryHandlerId, {
734
577
  params: {
735
578
  projectId: e.projectId,
736
579
  modeId: e.workbench.modes.getActiveModeId(),
737
- activeResource: D(a),
738
- providerId: r.id,
739
- query: o,
580
+ activeResource: a,
581
+ providerId: o.id,
582
+ query: s,
740
583
  limit: i
741
584
  }
742
585
  });
743
- return pn(d) ? (d.items ?? []).map((u) => gn(e, r, s, u)) : [];
586
+ return Kt(d) ? (d.items ?? []).map((m) => _t(e, o, r, m)) : [];
744
587
  }
745
588
  }));
746
589
  }
747
590
  return {
748
591
  dispose() {
749
- for (let r = n.length - 1; r >= 0; r -= 1) n[r]?.dispose();
592
+ for (let o = n.length - 1; o >= 0; o -= 1) n[o]?.dispose();
750
593
  }
751
594
  };
752
- }, wn = (e) => e ? (Array.isArray(e) ? e : [e]).map(({
753
- for: n,
754
- ...r
755
- }) => ({
756
- ...r,
757
- resourceKind: n
758
- })) : [], In = () => {
759
- const e = [], t = [], n = [], r = /* @__PURE__ */ new Map(), s = (o, i) => Ae(() => {
760
- const a = o.indexOf(i);
761
- a >= 0 && o.splice(a, 1);
762
- });
763
- return {
764
- registerResourceKind(o) {
765
- return e.push(o), s(e, o);
766
- },
767
- registerPanelCapability(o) {
768
- return t.push(o), s(t, o);
769
- },
770
- registerResourcePanel(o) {
771
- return n.push(o), s(n, o);
772
- },
773
- registerModeComposition(o) {
774
- return r.set(o.id, o), Ae(() => {
775
- r.get(o.id) === o && r.delete(o.id);
776
- });
777
- },
778
- getComposition: () => ({
779
- resourceKinds: [...e],
780
- panels: [...t],
781
- resourcePanels: [...n]
782
- }),
783
- getModeComposition: (o) => r.get(o)
784
- };
785
- }, Ze = (e, t) => {
786
- const n = {};
787
- for (const r of Ie) {
788
- const s = e.regions[r], o = s.widgets.filter((a) => t.has(a.contributionId)).map((a) => a.contributionId), i = s.widgets.find((a) => a.widgetId === s.activeWidgetId);
789
- n[r] = {
790
- order: o,
791
- activePanelId: i && t.has(i.contributionId) ? i.contributionId : void 0
792
- };
793
- }
794
- return {
795
- regions: n
796
- };
797
- }, yn = (e) => {
798
- const t = e.registry.getModeComposition(e.modeId);
799
- if (!t) return [];
800
- const n = e.registry.getComposition(), r = new Set(n.panels.map((s) => s.id));
801
- return Le({
802
- context: {
803
- modeId: e.modeId,
804
- resourceKind: e.resourceKind
805
- },
806
- mode: t,
807
- composition: n,
808
- persisted: Ze(e.layout, r)
809
- }).addablePanels;
810
- }, Me = (e) => e === "main" ? "location" : "sub-panel", vn = (e, t) => {
811
- const n = e.layout.getLayout(), r = Ie.find((d) => n.regions[d].widgets.some((u) => u.contributionId === t.panelId)), s = () => e.layout.openWidget(t.panelId, {
812
- region: t.region,
813
- closable: !t.required,
814
- pinned: t.pinned,
815
- role: Me(t.region)
816
- });
817
- if (!r) {
818
- (t.origin === "persisted" || t.origin === "default" || t.required) && s();
819
- return;
820
- }
821
- if (!t.allowedRegions.includes(r)) {
822
- s();
823
- return;
824
- }
825
- const o = n.regions[r].widgets.find((d) => d.contributionId === t.panelId);
826
- if (!o) return;
827
- const i = Me(r), a = !t.required;
828
- ((o.closable ?? !0) !== a || o.pinned !== t.pinned || o.role !== i) && e.layout.updateWidgetPlacement(o.widgetId, {
829
- closable: a,
830
- pinned: t.pinned,
831
- role: i
832
- });
833
- }, kn = (e, t) => {
834
- for (const [n, r] of t) {
835
- if (!r) continue;
836
- const s = e.layout.getLayout().regions[n];
837
- s.activeWidgetId !== r && s.widgets.some((o) => o.widgetId === r) && e.layout.setRegionActiveWidget(n, r);
838
- }
839
- }, Rn = (e, t, n) => {
840
- const r = Cn(t);
841
- if (!n.requiredFallback) {
842
- e.notifications.dismiss(r);
843
- return;
844
- }
845
- const s = n.requiredFallback.panelId;
846
- e.layout.getLayout().regions.main.widgets.some((i) => i.contributionId === s) || e.layout.openWidget(s, {
847
- region: "main",
848
- pinned: !0,
849
- role: "location"
850
- }), e.notifications.show({
851
- id: r,
852
- level: "error",
853
- title: "A required panel could not be placed",
854
- message: n.diagnostics.map((i) => i.message).join(" ")
855
- });
856
- }, Cn = (e) => `workbench.composition.required.${e}`, xn = (e, t) => {
857
- const n = t.registry.getModeComposition(t.modeId);
858
- if (!n) return;
859
- const r = t.registry.getComposition(), s = new Set(r.panels.map((u) => u.id)), o = e.layout.getLayout(), i = t.seeding ? void 0 : Ze(o, s), a = Le({
860
- context: {
861
- modeId: t.modeId,
862
- resourceKind: t.resourceKind
863
- },
864
- mode: n,
865
- composition: r,
866
- persisted: i
867
- }), d = new Map(Ie.map((u) => [u, e.layout.getLayout().regions[u].activeWidgetId]));
868
- for (const u of a.placements) vn(e, u);
869
- return kn(e, d), e.layout.reconcilePanelMenus(), Rn(e, t.modeId, a), a;
870
- }, ve = (e) => ({
871
- title: p(e.title) || void 0,
872
- runtimeUrl: e.runtimeUrl,
873
- moduleUrl: e.moduleUrl,
874
- styles: e.styles,
875
- capabilities: e.capabilities
876
- }), F = (e, t) => e?.({
877
- id: t.id,
878
- title: p(t.title, t.id),
879
- icon: t.icon
880
- }), En = (e = 0) => ({
881
- priority: -e
882
- }), Pn = (e, t) => {
883
- const n = e.show ? Array.isArray(e.show) ? e.show : [e.show] : [];
884
- if (n.some((s) => s.for === void 0)) return;
885
- const r = [...n.flatMap((s) => s.for ? [s.for] : []), ...(t ?? []).filter((s) => s.panel === e.id).map((s) => s.resourceKind)].filter((s, o, i) => i.indexOf(s) === o);
886
- return r.length > 0 ? r : void 0;
887
- }, An = (e) => (e.show ? Array.isArray(e.show) ? e.show : [e.show] : [])[0]?.region ?? "main", N = (e) => ({
888
- id: e.panel.id,
889
- title: p(e.panel.title, e.panel.id),
890
- icon: e.panel.icon,
891
- region: An(e.panel),
892
- rendererId: e.rendererId,
893
- singleton: !0,
894
- resourceKinds: Pn(e.panel, e.resourcePanels),
895
- panelMenus: jn(e.panel.panelMenus, e.menuDeclarationOffset),
896
- config: e.config,
897
- ...En(e.declarationIndex)
898
- }), L = (e) => {
899
- const t = [];
900
- let n = 0;
901
- for (const r of e)
902
- t.push(n), n += r.panelMenus?.length ?? 0;
903
- return t;
904
- }, Sn = (e) => {
905
- const t = e.renderer?.id ?? (e.webview ? se : void 0);
906
- if (!t) throw new Error(`Panel Menu has no renderer: ${e.id}`);
907
- return t;
908
- }, Tn = {
909
- first: 1e6,
910
- default: 0,
911
- last: -1e6
912
- }, jn = (e, t = 0) => e?.map((n, r) => ({
913
- id: n.id,
914
- title: p(n.title, n.id),
915
- side: n.side,
916
- rendererId: Sn(n),
917
- config: n.webview ? ve(n.webview) : void 0,
918
- priority: Tn[n.placement ?? "default"] - (t + r)
919
- })), U = (e) => {
920
- const t = e.workbench.layout.registerPanel(e.contribution);
921
- let n;
922
- try {
923
- n = e.workbench.views.registerView({
924
- id: e.contribution.id,
925
- panelId: e.contribution.id,
926
- title: e.contribution.title,
927
- icon: e.contribution.icon,
928
- path: e.path,
929
- aliases: e.aliases,
930
- resolveInput: e.resolveInput
931
- });
932
- } catch (r) {
933
- throw t.dispose(), r;
934
- }
935
- return {
936
- dispose() {
937
- n.dispose(), t.dispose();
938
- }
939
- };
940
- }, ee = (e, t) => e.renderer?.kind === t ? e.renderer.id : void 0, pe = (e, t = "") => p(e, t), Wn = (e) => !!e && typeof e == "object" && !Array.isArray(e), Mn = (e, t, n) => {
941
- const r = B({
595
+ }, re = (e, t = "") => b(e, t), qt = (e, t, n) => {
596
+ const o = D({
942
597
  id: t.id,
943
598
  kind: "renderer",
944
599
  projectId: e.projectId,
945
600
  context: {
946
601
  controlsRendererId: t.id
947
602
  }
948
- }), s = (o, i, a) => o ? P(e, o, {
603
+ }), r = (s, i, a) => s ? E(e, s, {
949
604
  params: {
950
605
  renderer: {
951
606
  rendererId: t.id,
952
607
  projectId: e.projectId,
953
608
  ...a ? {
954
- resource: D(a)
609
+ resource: a
955
610
  } : {},
956
611
  invocation: {
957
612
  placement: "visible"
@@ -960,96 +615,84 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
960
615
  ...i
961
616
  },
962
617
  resource: a,
963
- slot: r,
618
+ slot: o,
964
619
  metadata: {
965
620
  controlsRendererId: t.id
966
621
  }
967
622
  }) : Promise.resolve(void 0);
968
- return e.workbench.renderers.registerControlsRenderer({
623
+ return e.workbench.views.registerView({
969
624
  id: t.id,
970
- title: pe(t.title, t.id),
971
- emptyTitle: pe(t.emptyTitle, ""),
972
- emptyDescription: pe(t.emptyDescription, ""),
973
- defaultValues: t.defaultValues,
974
- executeQuery: async (o) => {
975
- const i = await s(t.queryHandlerId, {}, o ?? n.resolveResource?.(t));
976
- return Wn(i) ? i : {};
977
- },
978
- updateValue: t.valueChangeHandlerId ? ({
979
- controlId: o,
980
- value: i,
981
- values: a,
982
- resource: d
983
- }) => s(t.valueChangeHandlerId, {
984
- controlId: o,
985
- value: i,
986
- values: a
987
- }, d).then(() => {
988
- }) : void 0,
989
- apply: t.applyHandlerId ? ({
990
- values: o,
991
- resource: i
992
- }) => s(t.applyHandlerId, {
993
- values: o
994
- }, i).then(() => {
995
- }) : void 0,
996
- reset: t.resetHandlerId ? ({
997
- controlIds: o,
998
- resource: i
999
- }) => s(t.resetHandlerId, {
1000
- controlIds: o
1001
- }, i).then(() => {
1002
- }) : void 0
625
+ title: re(t.title, t.id),
626
+ icon: t.icon,
627
+ body: {
628
+ kind: "controls",
629
+ emptyTitle: re(t.emptyTitle, ""),
630
+ emptyDescription: re(t.emptyDescription, ""),
631
+ defaultValues: t.defaultValues,
632
+ executeQuery: async (s) => {
633
+ const i = await r(t.queryHandlerId, {}, s ?? n.resolveResource?.(t)), a = rt.safeParse(i);
634
+ if (!a.success) {
635
+ const d = a.error.issues.map((m) => `body.query.${m.path.join(".")}: ${m.message}`).join("; ");
636
+ throw new Error(`Extension "${t.extensionId}" view "${t.id}" has invalid controls. Expected serializable control declarations. ${d}`);
637
+ }
638
+ return a.data;
639
+ },
640
+ updateValue: t.valueChangeHandlerId ? ({
641
+ controlId: s,
642
+ value: i,
643
+ values: a,
644
+ resource: d
645
+ }) => r(t.valueChangeHandlerId, {
646
+ controlId: s,
647
+ value: i,
648
+ values: a
649
+ }, d).then(() => {
650
+ }) : void 0,
651
+ apply: t.applyHandlerId ? ({
652
+ values: s,
653
+ resource: i
654
+ }) => r(t.applyHandlerId, {
655
+ values: s
656
+ }, i).then(() => {
657
+ }) : void 0,
658
+ reset: t.resetHandlerId ? ({
659
+ controlIds: s,
660
+ resource: i
661
+ }) => r(t.resetHandlerId, {
662
+ controlIds: s
663
+ }, i).then(() => {
664
+ }) : void 0
665
+ }
1003
666
  });
1004
- }, On = (e, t, n, r, s, o) => {
1005
- const i = ee(t, "controls");
1006
- if (i)
1007
- return U({
1008
- workbench: e.workbench,
1009
- path: t.path,
1010
- aliases: t.aliases,
1011
- resolveInput: F(o.resolveViewInput, t),
1012
- contribution: N({
1013
- panel: t,
1014
- rendererId: i,
1015
- declarationIndex: n,
1016
- menuDeclarationOffset: r,
1017
- resourcePanels: s
1018
- })
1019
- });
1020
- }, Hn = (e, t, n, r = {}, s = []) => {
667
+ }, zt = (e, t, n = {}) => {
1021
668
  const o = [];
1022
- for (const a of t) o.push(Mn(e, a, r));
1023
- const i = L(n);
1024
- return n.forEach((a, d) => {
1025
- const u = On(e, a, d, i[d], s, r);
1026
- u && o.push(u);
1027
- }), {
669
+ for (const r of t) o.push(qt(e, r, n));
670
+ return {
1028
671
  dispose() {
1029
- for (let a = o.length - 1; a >= 0; a -= 1) o[a]?.dispose();
672
+ for (let r = o.length - 1; r >= 0; r -= 1) o[r]?.dispose();
1030
673
  }
1031
674
  };
1032
- }, T = (e, t = "") => p(e, t), Oe = (e) => ({
675
+ }, P = (e, t = "") => b(e, t), ke = (e) => ({
1033
676
  ...e,
1034
- label: T(e.label, e.id),
1035
- description: e.description ? T(e.description) : void 0,
1036
- icon: e.icon ? K(Y, {
677
+ label: P(e.label, e.id),
678
+ description: e.description ? P(e.description) : void 0,
679
+ icon: e.icon ? V(_, {
1037
680
  name: e.icon,
1038
681
  size: 14
1039
682
  }) : void 0
1040
- }), Kn = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), $n = (e) => ({
683
+ }), Qt = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), Gt = (e) => ({
1041
684
  id: e.id,
1042
685
  values: e.values,
1043
- resource: e.resource ? J(e.resource) : void 0
1044
- }), Vn = (e, t) => {
1045
- const n = /* @__PURE__ */ new WeakMap(), r = B({
686
+ resource: e.resource ? e.resource : void 0
687
+ }), Yt = (e, t) => {
688
+ const n = /* @__PURE__ */ new WeakMap(), o = D({
1046
689
  id: t.id,
1047
690
  kind: "dataTableRenderer",
1048
691
  projectId: e.projectId,
1049
692
  context: {
1050
693
  dataTableRendererId: t.id
1051
694
  }
1052
- }), s = (o, i, a, d) => P(e, o, {
695
+ }), r = (s, i, a, d) => E(e, s, {
1053
696
  params: {
1054
697
  renderer: {
1055
698
  rendererId: t.id,
@@ -1058,7 +701,7 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1058
701
  modeId: d
1059
702
  } : {},
1060
703
  ...a ? {
1061
- resource: D(a)
704
+ resource: a
1062
705
  } : {},
1063
706
  invocation: {
1064
707
  placement: "visible"
@@ -1067,234 +710,212 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1067
710
  ...i
1068
711
  },
1069
712
  resource: a,
1070
- slot: r,
713
+ slot: o,
1071
714
  metadata: {
1072
715
  dataTableRendererId: t.id
1073
716
  }
1074
717
  });
1075
- return e.workbench.renderers.registerDataTableRenderer({
718
+ return e.workbench.views.registerView({
1076
719
  id: t.id,
1077
- title: T(t.title, t.id),
1078
- resourceKind: t.resourceKind,
1079
- columns: t.columns?.map(Oe),
1080
- initialPageSize: t.initialPageSize,
1081
- pageSizeOptions: t.pageSizeOptions,
1082
- selectionMode: t.selectionMode,
1083
- selectionActions: t.selectionActions?.map((o) => ({
1084
- id: o.id,
1085
- label: T(o.label, o.id),
1086
- icon: o.icon ? K(Y, {
1087
- name: o.icon,
1088
- size: 16
1089
- }) : void 0,
1090
- destructive: o.destructive,
1091
- run: (i) => s(o.commandId, {
1092
- rowIds: i.map((a) => a.id)
1093
- }).then(() => {
1094
- })
1095
- })),
1096
- emptyTitle: t.emptyTitle ? T(t.emptyTitle) : void 0,
1097
- emptyDescription: t.emptyDescription ? T(t.emptyDescription) : void 0,
1098
- executeQuery: async ({
1099
- resource: o,
1100
- modeId: i
1101
- }) => {
1102
- const a = await s(t.queryHandlerId, {}, o, i);
1103
- return Kn(a) ? {
1104
- rows: a.rows.map((u) => {
1105
- const w = $n(u);
1106
- return n.set(w, u), w;
1107
- }),
1108
- columns: a.columns?.map(Oe)
1109
- } : {
1110
- rows: []
1111
- };
1112
- },
1113
- rowActions: t.rowActions?.map((o) => ({
1114
- id: o.id,
1115
- label: T(o.label, o.id),
1116
- icon: o.icon ? K(Y, {
1117
- name: o.icon,
1118
- size: 16
1119
- }) : void 0,
1120
- destructive: o.destructive,
1121
- run: async (i) => {
1122
- await s(o.commandId, {
1123
- rowId: i.id
1124
- }, i.resource), e.workbench.renderers.refreshDataTableRenderer(t.id);
1125
- }
1126
- })),
1127
- onRowActivate: t.rowActivationHandlerId ? async (o) => {
1128
- const i = await s(t.rowActivationHandlerId, {
1129
- row: n.get(o) ?? o
1130
- }, o.resource), a = Je(i, {
1131
- extensionId: t.extensionId
1132
- });
1133
- a && await e.workbench.navigation.openTarget(a);
1134
- } : void 0
720
+ title: P(t.title, t.id),
721
+ icon: t.icon,
722
+ body: {
723
+ kind: "dataTable",
724
+ resourceKind: t.resourceKind,
725
+ columns: t.columns?.map(ke),
726
+ initialPageSize: t.initialPageSize,
727
+ pageSizeOptions: t.pageSizeOptions,
728
+ selectionMode: t.selectionMode,
729
+ selectionActions: t.selectionActions?.map((s) => ({
730
+ id: s.id,
731
+ label: P(s.label, s.id),
732
+ icon: s.icon ? V(_, {
733
+ name: s.icon,
734
+ size: 16
735
+ }) : void 0,
736
+ destructive: s.destructive,
737
+ run: (i) => r(s.commandId, {
738
+ rowIds: i.map((a) => a.id)
739
+ }).then(() => {
740
+ })
741
+ })),
742
+ emptyTitle: t.emptyTitle ? P(t.emptyTitle) : void 0,
743
+ emptyDescription: t.emptyDescription ? P(t.emptyDescription) : void 0,
744
+ executeQuery: async ({
745
+ resource: s,
746
+ modeId: i
747
+ }) => {
748
+ const a = await r(t.queryHandlerId, {}, s, i);
749
+ return Qt(a) ? {
750
+ rows: a.rows.map((m) => {
751
+ const l = Gt(m);
752
+ return n.set(l, m), l;
753
+ }),
754
+ columns: a.columns?.map(ke)
755
+ } : {
756
+ rows: []
757
+ };
758
+ },
759
+ rowActions: t.rowActions?.map((s) => ({
760
+ id: s.id,
761
+ label: P(s.label, s.id),
762
+ icon: s.icon ? V(_, {
763
+ name: s.icon,
764
+ size: 16
765
+ }) : void 0,
766
+ destructive: s.destructive,
767
+ run: async (i) => {
768
+ await r(s.commandId, {
769
+ rowId: i.id
770
+ }, i.resource), e.workbench.views.refreshView(t.id);
771
+ }
772
+ })),
773
+ onRowActivate: t.rowActivationHandlerId ? async (s) => {
774
+ const i = await r(t.rowActivationHandlerId, {
775
+ row: n.get(s) ?? s
776
+ }, s.resource), a = me(i, {
777
+ extensionId: t.extensionId
778
+ });
779
+ a && await e.workbench.navigation.openTarget(a);
780
+ } : void 0
781
+ }
1135
782
  });
1136
- }, Dn = (e, t, n, r, s, o) => {
1137
- const i = ee(t, "dataTable");
1138
- if (i)
1139
- return U({
1140
- workbench: e.workbench,
1141
- path: t.path,
1142
- aliases: t.aliases,
1143
- resolveInput: F(o, t),
1144
- contribution: N({
1145
- panel: t,
1146
- rendererId: i,
1147
- declarationIndex: n,
1148
- menuDeclarationOffset: r,
1149
- resourcePanels: s
1150
- })
1151
- });
1152
- }, Bn = (e, t, n, r = [], s) => {
1153
- const o = t.map((a) => Vn(e, a)), i = L(n);
1154
- return n.forEach((a, d) => {
1155
- const u = Dn(e, a, d, i[d], r, s);
1156
- u && o.push(u);
1157
- }), {
783
+ }, Xt = (e, t) => {
784
+ const n = t.map((o) => Yt(e, o));
785
+ return {
1158
786
  dispose() {
1159
- for (let a = o.length - 1; a >= 0; a -= 1) o[a]?.dispose();
787
+ for (let o = n.length - 1; o >= 0; o -= 1) n[o]?.dispose();
1160
788
  }
1161
789
  };
1162
- }, Fn = {
790
+ }, Jt = {
1163
791
  first: 0,
1164
792
  default: 1,
1165
793
  last: 2
1166
- }, Do = {
794
+ }, qo = {
1167
795
  commands: [],
1168
796
  commandPaletteContributions: [],
1169
797
  diagnostics: [],
1170
798
  extensions: [],
1171
799
  menuContributions: [],
1172
800
  modes: [],
801
+ pages: [],
1173
802
  views: [],
1174
803
  viewMenus: [],
1175
804
  placements: [],
1176
805
  resourceKinds: [],
1177
- resourceViews: [],
1178
806
  navigationItems: [],
807
+ navigationTrees: [],
1179
808
  statusBarItems: [],
1180
809
  statuses: [],
1181
810
  settingsPanels: [],
1182
811
  settingsDefinitions: []
1183
- }, Nn = (e) => `workbench.extension.menu.${e.id}`, Ln = (e) => `workbench.extension.palette.${e.id}`, et = (e, t) => Fn[e.placement ?? "default"] * 1e3 + t, tt = (e) => e === void 0 ? "" : Ct(e) ? e.default ?? e.$l10n : e, Un = (e) => {
812
+ }, Zt = (e) => `workbench.extension.menu.${e.id}`, en = (e) => `workbench.extension.palette.${e.id}`, Me = (e, t) => Jt[e.placement ?? "default"] * 1e3 + t, Be = (e) => e === void 0 ? "" : ot(e) ? e.default ?? e.$l10n : e, tn = (e) => {
1184
813
  const {
1185
814
  commandId: t,
1186
815
  contribution: n,
1187
- index: r,
1188
- resolveString: s,
1189
- slot: o,
816
+ index: o,
817
+ resolveString: r,
818
+ slot: s,
1190
819
  when: i
1191
820
  } = e;
1192
821
  return {
1193
822
  commandId: t,
1194
823
  sourceCommandId: n.commandId,
1195
- label: s(n.label, n.extensionId),
824
+ label: r(n.label, n.extensionId),
1196
825
  icon: n.icon,
1197
- group: o.group ?? n.group,
826
+ group: s.group ?? n.group,
1198
827
  args: n.params,
1199
- overflowLabel: o.overflowLabel,
1200
- order: et(n, r),
828
+ overflowLabel: s.overflowLabel,
829
+ order: Me(n, o),
1201
830
  when: i
1202
831
  };
1203
- }, _n = (e) => {
832
+ }, nn = (e) => {
1204
833
  const {
1205
834
  commandId: t,
1206
835
  contribution: n,
1207
- index: r,
1208
- resolveString: s
836
+ index: o,
837
+ resolveString: r
1209
838
  } = e;
1210
839
  return {
1211
840
  commandId: t,
1212
- label: s(n.label, n.extensionId),
841
+ label: r(n.label, n.extensionId),
1213
842
  icon: n.icon,
1214
843
  group: n.group,
1215
844
  args: n.params,
1216
- order: et(n, r)
845
+ order: Me(n, o)
1217
846
  };
1218
- }, qn = (e) => {
847
+ }, on = (e) => {
1219
848
  const {
1220
- createCommandId: t = Nn,
849
+ createCommandId: t = Zt,
1221
850
  createWhenExpression: n,
1222
- menuSlotsById: r,
1223
- menuTargetsById: s,
1224
- metadata: o,
1225
- resolveString: i = tt
851
+ menuSlotsById: o,
852
+ menuTargetsById: r,
853
+ metadata: s,
854
+ resolveString: i = Be
1226
855
  } = e, a = [], d = [];
1227
- return o.menuContributions.forEach((u, w) => {
1228
- const l = u.target ? s?.get(u.target) : r.get(u.slotId);
1229
- if (!l) {
856
+ return s.menuContributions.forEach((m, l) => {
857
+ const c = m.target ? r?.get(m.target) : o.get(m.slotId);
858
+ if (!c) {
1230
859
  d.push({
1231
- contribution: u,
1232
- targetId: u.target ?? u.slotId
860
+ contribution: m,
861
+ targetId: m.target ?? m.slotId
1233
862
  });
1234
863
  return;
1235
864
  }
1236
- const m = t(u), c = o.commands.find((f) => f.id === u.commandId);
865
+ const p = t(m), u = s.commands.find((g) => g.id === m.commandId);
1237
866
  a.push({
1238
867
  command: {
1239
- id: m,
1240
- label: i(u.label, u.extensionId),
1241
- category: u.group,
1242
- description: c ? i(c.description, c.extensionId) : void 0,
1243
- icon: u.icon,
1244
- params: c?.params
868
+ id: p,
869
+ label: i(m.label, m.extensionId),
870
+ category: m.group,
871
+ description: u ? i(u.description, u.extensionId) : void 0,
872
+ icon: m.icon,
873
+ params: u?.params
1245
874
  },
1246
- contribution: u,
1247
- menuItem: Un({
1248
- commandId: m,
1249
- contribution: u,
1250
- index: w,
875
+ contribution: m,
876
+ menuItem: tn({
877
+ commandId: p,
878
+ contribution: m,
879
+ index: l,
1251
880
  resolveString: i,
1252
- slot: l,
1253
- when: n?.(u)
881
+ slot: c,
882
+ when: n?.(m)
1254
883
  }),
1255
- menuPath: l.menuPath,
1256
- targetCommandId: u.commandId
884
+ menuPath: c.menuPath,
885
+ targetCommandId: m.commandId
1257
886
  });
1258
887
  }), {
1259
888
  registrations: a,
1260
889
  unresolved: d
1261
890
  };
1262
- }, zn = (e) => {
891
+ }, sn = (e) => {
1263
892
  const {
1264
- createCommandId: t = Ln,
893
+ createCommandId: t = en,
1265
894
  metadata: n,
1266
- resolveString: r = tt
1267
- } = e, s = [];
1268
- return (n.commandPaletteContributions ?? []).forEach((o, i) => {
1269
- const a = t(o), d = n.commands.find((u) => u.id === o.commandId);
1270
- s.push({
895
+ resolveString: o = Be
896
+ } = e, r = [];
897
+ return (n.commandPaletteContributions ?? []).forEach((s, i) => {
898
+ const a = t(s), d = n.commands.find((m) => m.id === s.commandId);
899
+ r.push({
1271
900
  command: {
1272
901
  id: a,
1273
- label: r(o.label, o.extensionId),
1274
- category: o.group,
1275
- description: d ? r(d.description, d.extensionId) : void 0,
1276
- icon: o.icon,
902
+ label: o(s.label, s.extensionId),
903
+ category: s.group,
904
+ description: d ? o(d.description, d.extensionId) : void 0,
905
+ icon: s.icon,
1277
906
  params: d?.params
1278
907
  },
1279
- contribution: o,
1280
- menuItem: _n({
908
+ contribution: s,
909
+ menuItem: nn({
1281
910
  commandId: a,
1282
- contribution: o,
911
+ contribution: s,
1283
912
  index: i,
1284
- resolveString: r
913
+ resolveString: o
1285
914
  }),
1286
- targetCommandId: o.commandId
915
+ targetCommandId: s.commandId
1287
916
  });
1288
- }), s;
1289
- }, Qn = (e) => {
1290
- if (e)
1291
- return {
1292
- type: e.kind,
1293
- id: e.id ?? e.uri,
1294
- label: e.label,
1295
- metadata: e.metadata
1296
- };
1297
- }, Gn = (e) => ({
917
+ }), r;
918
+ }, rn = (e) => ({
1298
919
  id: e.rendererId,
1299
920
  kind: "renderer",
1300
921
  context: {
@@ -1304,8 +925,8 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1304
925
  resourceId: e.resource.id
1305
926
  } : {}
1306
927
  }
1307
- }), He = async (e, t, n, r, s = {}, o) => {
1308
- const i = Qn(r), a = await e.executeCommand(n, {
928
+ }), xe = async (e, t, n, o, r = {}, s) => {
929
+ const i = o, a = await e.executeCommand(n, {
1309
930
  projectId: e.projectId,
1310
931
  params: {
1311
932
  renderer: {
@@ -1318,223 +939,211 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1318
939
  placement: "visible"
1319
940
  }
1320
941
  },
1321
- ...s
942
+ ...r
1322
943
  },
1323
944
  resource: i,
1324
- slot: Gn({
945
+ slot: rn({
1325
946
  projectId: e.projectId,
1326
947
  rendererId: t,
1327
948
  resource: i
1328
949
  }),
1329
950
  source: "dashboard",
1330
- ...o ? {
1331
- metadata: o
951
+ ...s ? {
952
+ metadata: s
1332
953
  } : {}
1333
954
  });
1334
- return ie(a);
1335
- }, nt = (e) => {
955
+ return ee(a);
956
+ }, Ve = (e) => {
1336
957
  if (!e || typeof e != "object") return;
1337
958
  const t = e.revision;
1338
959
  return typeof t == "string" ? t : void 0;
1339
- }, Bo = (e, t) => {
1340
- const n = e.metadata, r = n?.fileRendererOrigin;
1341
- if (!r || typeof r != "object") return;
1342
- const s = r;
1343
- if (typeof s.rendererId != "string" || typeof s.instanceId != "string" || typeof s.operationId != "string")
960
+ }, zo = (e, t) => {
961
+ const n = e.metadata, o = n?.fileRendererOrigin;
962
+ if (!o || typeof o != "object") return;
963
+ const r = o;
964
+ if (typeof r.rendererId != "string" || typeof r.instanceId != "string" || typeof r.operationId != "string")
1344
965
  return;
1345
- const o = n?.fileRendererResourceUri, i = nt(t.outcome.value);
966
+ const s = n?.fileRendererResourceKey, i = Ve(t.outcome.value);
1346
967
  return {
1347
968
  origin: {
1348
- rendererId: s.rendererId,
1349
- instanceId: s.instanceId,
1350
- operationId: s.operationId
969
+ rendererId: r.rendererId,
970
+ instanceId: r.instanceId,
971
+ operationId: r.operationId
1351
972
  },
1352
- ...typeof o == "string" ? {
1353
- resourceUri: o
973
+ ...typeof s == "string" ? {
974
+ resourceKey: s
1354
975
  } : {},
1355
976
  ...i ? {
1356
977
  revision: i
1357
978
  } : {}
1358
979
  };
1359
- }, Yn = (e, t) => e.workbench.renderers.registerFileRenderer({
980
+ }, an = (e, t) => e.workbench.views.registerView({
1360
981
  id: t.id,
1361
- title: p(t.title, t.id),
1362
- resourceKind: t.resourceKind,
1363
- load: async (n) => await He(e, t.id, t.loadHandlerId, n) ?? {},
1364
- save: t.saveHandlerId ? async (n, r, s) => {
1365
- const o = await He(e, t.id, t.saveHandlerId, n, {
1366
- content: r
1367
- }, {
1368
- ...s ? {
1369
- fileRendererOrigin: s
1370
- } : {},
1371
- ...n?.uri ? {
1372
- fileRendererResourceUri: n.uri
1373
- } : {}
1374
- }), i = nt(o);
1375
- return i ? {
1376
- revision: i
1377
- } : void 0;
1378
- } : void 0
1379
- }), Xn = (e, t, n, r) => {
1380
- const s = ee(t, "file");
1381
- if (s)
1382
- return U({
1383
- workbench: e.workbench,
1384
- path: t.path,
1385
- aliases: t.aliases,
1386
- resolveInput: F(e.resolveViewInput, t),
1387
- contribution: N({
1388
- panel: t,
1389
- rendererId: s,
1390
- declarationIndex: n,
1391
- menuDeclarationOffset: r,
1392
- resourcePanels: e.metadata.resourcePanels
1393
- })
1394
- });
1395
- }, Jn = (e) => {
982
+ title: b(t.title, t.id),
983
+ icon: t.icon,
984
+ body: {
985
+ kind: "file",
986
+ resourceKind: t.resourceKind,
987
+ load: async (n) => await xe(e, t.id, t.loadHandlerId, n) ?? {},
988
+ save: t.saveHandlerId ? async (n, o, r) => {
989
+ const s = await xe(e, t.id, t.saveHandlerId, n, {
990
+ content: o
991
+ }, {
992
+ ...r ? {
993
+ fileRendererOrigin: r
994
+ } : {},
995
+ ...B(n) ? {
996
+ fileRendererResourceKey: B(n)
997
+ } : {}
998
+ }), i = Ve(s);
999
+ return i ? {
1000
+ revision: i
1001
+ } : void 0;
1002
+ } : void 0
1003
+ }
1004
+ }), dn = (e) => {
1396
1005
  const t = [];
1397
- for (const r of e.metadata.fileRenderers ?? [])
1398
- t.push(Yn(e, r));
1399
- const n = L(e.metadata.panels);
1400
- return e.metadata.panels.forEach((r, s) => {
1401
- const o = Xn(e, r, s, n[s]);
1402
- o && t.push(o);
1403
- }), {
1006
+ for (const n of e.metadata.fileRenderers ?? [])
1007
+ t.push(an(e, n));
1008
+ return {
1404
1009
  dispose() {
1405
- for (let r = t.length - 1; r >= 0; r -= 1) t[r]?.dispose();
1010
+ for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
1406
1011
  }
1407
1012
  };
1408
- }, Zn = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ke = (e, t, n, r, s) => (t ?? []).map((o) => {
1409
- const i = {
1410
- ...o,
1411
- label: n(o.label, o.id),
1412
- type: o.type.kind === "status" ? {
1013
+ }, Re = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ee = (e, t, n, o, r, s) => (t ?? []).map((i) => {
1014
+ const a = i.display, d = a?.kind === "badge-list" && typeof a.itemsAttributeId == "string" ? {
1015
+ kind: "badge-list",
1016
+ itemsAttributeId: a.itemsAttributeId
1017
+ } : void 0;
1018
+ a && !d && s?.(i.id, a.kind);
1019
+ const m = {
1020
+ ...i,
1021
+ label: n(i.label, i.id),
1022
+ type: i.type.kind === "status" ? {
1413
1023
  kind: "enum",
1414
- options: s(o.type.statuses)
1415
- } : o.type.kind === "enum" || o.type.kind === "enum-multi" ? {
1416
- ...o.type,
1417
- options: Array.isArray(o.type.options) ? o.type.options.map((a) => ({
1418
- ...a,
1419
- label: n(a.label, a.value)
1420
- })) : o.type.options
1421
- } : o.type
1024
+ options: r(i.type.statuses)
1025
+ } : i.type.kind === "enum" || i.type.kind === "enum-multi" ? {
1026
+ ...i.type,
1027
+ options: Array.isArray(i.type.options) ? i.type.options.map((l) => ({
1028
+ ...l,
1029
+ label: n(l.label, l.value)
1030
+ })) : i.type.options
1031
+ } : i.type,
1032
+ display: d
1422
1033
  };
1423
- return r(e, i);
1424
- }), er = (e, t, n, r, s = () => []) => {
1425
- let o = Ke(e, t, n, r, s);
1426
- const i = /* @__PURE__ */ new Set();
1034
+ return o(e, m);
1035
+ }), cn = (e, t, n, o, r = () => [], s) => {
1036
+ let i = Ee(e, t, n, o, r, s);
1037
+ const a = /* @__PURE__ */ new Set();
1427
1038
  return {
1428
1039
  source: {
1429
- getSnapshot: () => o,
1430
- subscribe: (a) => (i.add(a), () => i.delete(a))
1040
+ getSnapshot: () => i,
1041
+ subscribe: (d) => (a.add(d), () => a.delete(d))
1431
1042
  },
1432
- set(a) {
1433
- o = Ke(e, a, n, r, s);
1434
- for (const d of i) d();
1043
+ set(d) {
1044
+ i = Ee(e, d, n, o, r, s);
1045
+ for (const m of a) m();
1435
1046
  }
1436
1047
  };
1437
- }, tr = (e) => !!(e && typeof e == "object" && typeof e.kind == "string"), nr = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), rr = (e, t) => `pstdio://extension-resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}`, rt = (e, t) => {
1048
+ }, ln = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), De = (e, t) => {
1438
1049
  const {
1439
1050
  resource: n
1440
1051
  } = t;
1441
- if (tr(n)) return n;
1442
- if (nr(n)) return J(n);
1443
- }, or = (e, t) => {
1444
- const n = rt(e, t);
1052
+ if (ln(n)) return n;
1053
+ }, mn = (e, t) => {
1054
+ const n = De(e, t);
1445
1055
  if (n) return n;
1446
1056
  if (e.resourceKind)
1447
1057
  return {
1448
- kind: e.resourceKind,
1449
- uri: rr(e.resourceKind, t.id),
1058
+ type: e.resourceKind,
1450
1059
  id: t.id,
1451
1060
  label: t.title
1452
1061
  };
1453
- }, $e = (e, t) => {
1454
- const n = e, r = t(n);
1455
- return r === void 0 ? n : {
1062
+ }, un = (e, t) => {
1063
+ const n = e, o = t(n);
1064
+ return o === void 0 ? n : {
1456
1065
  ...n,
1457
- resource: r
1066
+ resource: o
1458
1067
  };
1459
- }, ot = (...e) => Object.assign({}, ...e.filter((t) => !!t)), sr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, ir = (e) => Object.keys(e ?? {}).length > 0, ar = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), dr = (e, t, n) => {
1460
- if (!ar.has(t.type)) return;
1461
- const r = "options" in t && Array.isArray(t.options) ? t.options : [], s = t;
1068
+ }, Oe = (...e) => Object.assign({}, ...e.filter((t) => !!t)), pn = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, bn = (e) => Object.keys(e ?? {}).length > 0, fn = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), hn = (e, t, n) => {
1069
+ if (!fn.has(t.type)) return;
1070
+ const o = "options" in t && Array.isArray(t.options) ? t.options : [], r = t;
1462
1071
  return {
1463
1072
  id: e,
1464
1073
  label: n(t.label, e),
1465
1074
  description: t.description === void 0 ? void 0 : n(t.description),
1466
- placeholder: s.placeholder === void 0 ? void 0 : n(s.placeholder),
1075
+ placeholder: r.placeholder === void 0 ? void 0 : n(r.placeholder),
1467
1076
  type: t.type,
1468
1077
  required: t.required === !0,
1469
1078
  defaultValue: t.defaultValue,
1470
- options: t.type === "select" || t.type === "multi-select" ? r.map((o) => ({
1471
- value: o.value,
1472
- label: n(o.label, o.value),
1473
- icon: o.icon
1079
+ options: t.type === "select" || t.type === "multi-select" ? o.map((s) => ({
1080
+ value: s.value,
1081
+ label: n(s.label, s.value),
1082
+ icon: s.icon
1474
1083
  })) : void 0,
1475
- multiple: t.type === "files" ? s.multiple !== !1 : void 0,
1476
- accept: t.type === "files" && typeof s.accept == "string" ? s.accept : void 0
1084
+ multiple: t.type === "files" ? r.multiple !== !1 : void 0,
1085
+ accept: t.type === "files" && typeof r.accept == "string" ? r.accept : void 0
1477
1086
  };
1478
- }, cr = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([n, r]) => {
1479
- const s = dr(n, r, t);
1480
- return s ? [s] : [];
1481
- }), lr = (e, t) => B({
1087
+ }, gn = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([n, o]) => {
1088
+ const r = hn(n, o, t);
1089
+ return r ? [r] : [];
1090
+ }), wn = (e, t) => D({
1482
1091
  id: t.id,
1483
1092
  kind: "kanbanRenderer",
1484
1093
  projectId: e.projectId,
1485
1094
  context: {
1486
1095
  kanbanRendererId: t.id
1487
1096
  }
1488
- }), X = (e, t, n, r, s) => {
1489
- const o = s ?? e.workbench.getPrimaryResource();
1490
- return P(e, n, {
1097
+ }), U = (e, t, n, o, r) => {
1098
+ const s = r ?? e.workbench.getPrimaryResource();
1099
+ return E(e, n, {
1491
1100
  params: {
1492
1101
  renderer: {
1493
1102
  rendererId: t.id,
1494
1103
  projectId: e.projectId,
1495
- ...o ? {
1496
- resource: D(o)
1104
+ ...s ? {
1105
+ resource: s
1497
1106
  } : {},
1498
1107
  invocation: {
1499
1108
  placement: "visible"
1500
1109
  }
1501
1110
  },
1502
- ...r
1111
+ ...o
1503
1112
  },
1504
- resource: o,
1505
- slot: lr(e, t),
1113
+ resource: s,
1114
+ slot: wn(e, t),
1506
1115
  metadata: {
1507
1116
  kanbanRendererId: t.id
1508
1117
  }
1509
1118
  });
1510
- }, st = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, ur = (e, t, n) => (t.rowActions ?? []).map((r) => {
1511
- const s = e.workbench.commands.getCommand(r.commandId)?.command;
1119
+ }, Fe = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, In = (e, t, n) => (t.rowActions ?? []).map((o) => {
1120
+ const r = e.workbench.commands.getCommand(o.commandId)?.command;
1512
1121
  return e.workbench.commands.registerCommand({
1513
- id: st(t, r),
1514
- label: n(r.label, r.id),
1515
- icon: r.icon,
1516
- params: s?.params
1122
+ id: Fe(t, o),
1123
+ label: n(o.label, o.id),
1124
+ icon: o.icon,
1125
+ params: r?.params
1517
1126
  }, {
1518
- execute: (o, i) => X(e, t, r.commandId, ot(sr(o)), i?.resource)
1127
+ execute: (s, i) => U(e, t, o.commandId, Oe(pn(s)), i?.resource)
1519
1128
  });
1520
- }), mr = (e, t, n, r, s, o) => {
1521
- const i = st(t, n), a = e.workbench.commands.getCommand(i), d = {
1522
- rowId: r.id
1523
- }, u = s ? {
1524
- resource: s
1525
- } : void 0, w = o(n.label, n.id);
1526
- return a && ir(a.command.params) ? (e.workbench.commandPalette.requestParams({
1129
+ }), yn = (e, t, n, o, r, s) => {
1130
+ const i = Fe(t, n), a = e.workbench.commands.getCommand(i), d = {
1131
+ rowId: o.id
1132
+ }, m = r ? {
1133
+ resource: r
1134
+ } : void 0, l = s(n.label, n.id);
1135
+ return a && bn(a.command.params) ? (e.workbench.commandPalette.requestParams({
1527
1136
  record: a,
1528
- label: w,
1137
+ label: l,
1529
1138
  args: d,
1530
- context: u
1531
- }), Promise.resolve()) : a ? e.workbench.commands.executeCommand(a.command.id, d, u).then(() => {
1532
- }) : X(e, t, n.commandId, d, s).then(() => {
1139
+ context: m
1140
+ }), Promise.resolve()) : a ? e.workbench.commands.executeCommand(a.command.id, d, m).then(() => {
1141
+ }) : U(e, t, n.commandId, d, r).then(() => {
1533
1142
  });
1534
- }, pr = (e) => (n) => K(Y, {
1143
+ }, vn = (e) => (n) => V(_, {
1535
1144
  name: e ?? "MoreHorizontal",
1536
1145
  ...n
1537
- }), fr = (e, t) => ({
1146
+ }), kn = (e, t) => ({
1538
1147
  color: e?.color,
1539
1148
  canDragIn: e?.canDragIn,
1540
1149
  canDragOut: e?.canDragOut,
@@ -1542,55 +1151,45 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1542
1151
  actions: e?.actions?.map((n) => ({
1543
1152
  id: n.id,
1544
1153
  label: t(n.label, n.id),
1545
- icon: pr(n.icon)
1154
+ icon: vn(n.icon)
1546
1155
  }))
1547
- }), it = (e, t) => `${t.extensionId ?? e.extensionId}.status.${t.id}`, br = (e, t) => {
1156
+ }), Ke = (e, t) => `${t.extensionId ?? e.extensionId}.status.${t.id}`, xn = (e, t) => {
1548
1157
  const n = /* @__PURE__ */ new Map();
1549
- return (r) => {
1550
- const s = it(t, r), o = n.get(s);
1551
- if (o) return o;
1158
+ return (o) => {
1159
+ const r = Ke(t, o), s = n.get(r);
1160
+ if (s) return s;
1552
1161
  const i = {
1553
- getSnapshot: () => (e.workbench.statuses.getStatuses(s) ?? []).map((a) => ({
1162
+ getSnapshot: () => (e.workbench.statuses.getStatuses(r) ?? []).map((a) => ({
1554
1163
  value: a.id,
1555
1164
  label: a.label,
1556
1165
  color: a.color,
1557
1166
  icon: a.icon
1558
1167
  })),
1559
- subscribe: (a) => e.workbench.statuses.store.subscribeSelector((d) => d.values[s], a)
1168
+ subscribe: (a) => e.workbench.statuses.store.subscribeSelector((d) => d.values[r], a)
1560
1169
  };
1561
- return n.set(s, i), e.workbench.statuses.load(s).catch(() => {
1170
+ return n.set(r, i), e.workbench.statuses.load(r).catch(() => {
1562
1171
  }), i;
1563
1172
  };
1564
- }, gr = (e, t, n, r) => {
1565
- for (const s of n ?? []) {
1566
- if (s.type.kind !== "status") continue;
1567
- const o = it(t, s.type.statuses), i = e.workbench.statuses.getStatuses(o)?.find((d) => d.id === r);
1568
- if (!i) continue;
1569
- const a = e.workbench.statuses.getStatusSet(o);
1570
- return {
1571
- color: i.color,
1572
- canCreate: i.board?.canCreate,
1573
- canDragIn: i.board?.canDragIn,
1574
- canDragOut: i.board?.canDragOut,
1575
- actions: i.board?.actions?.flatMap((d) => {
1576
- const u = a?.actions?.find((w) => w.id === d);
1577
- return u ? [{
1578
- id: u.id,
1579
- label: u.label,
1580
- icon: u.icon
1581
- }] : [];
1582
- })
1583
- };
1584
- }
1585
- }, hr = (e) => e ? K(Y, {
1173
+ }, Rn = (e, t, n, o, r) => {
1174
+ const s = n?.find((d) => d.id === o);
1175
+ if (s?.type.kind !== "status") return;
1176
+ const i = Ke(t, s.type.statuses), a = e.workbench.statuses.getStatuses(i)?.find((d) => d.id === r);
1177
+ return a ? {
1178
+ color: a.color
1179
+ } : void 0;
1180
+ }, En = (e) => {
1181
+ if (e.defaultSettings?.columnGrouping) return e.defaultSettings.columnGrouping;
1182
+ const t = e.attributes?.filter((n) => n.type.kind === "status") ?? [];
1183
+ return t.length === 1 ? t[0]?.id : void 0;
1184
+ }, An = (e) => e ? V(_, {
1586
1185
  name: e,
1587
1186
  size: 16
1588
- }) : void 0, wr = (e, t) => {
1187
+ }) : void 0, Cn = (e, t) => {
1589
1188
  if (e.createRow)
1590
1189
  return {
1591
1190
  title: t(e.createRow.title, "Create row"),
1592
1191
  submitLabel: t(e.createRow.submitLabel, "Create"),
1593
- fields: cr(e, t),
1192
+ fields: gn(e, t),
1594
1193
  labels: {
1595
1194
  cancel: t(e.createRow.labels?.cancel, "Cancel"),
1596
1195
  properties: t(e.createRow.labels?.properties, "Properties"),
@@ -1598,211 +1197,180 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1598
1197
  removeFile: t(e.createRow.labels?.removeFile, "Remove file")
1599
1198
  }
1600
1199
  };
1601
- }, Ir = (e, t, n, r, s) => {
1200
+ }, Sn = (e, t, n, o, r) => {
1602
1201
  if (t.rowActivationHandlerId)
1603
- return async (o) => {
1604
- const i = r(t, o), a = await X(e, t, t.rowActivationHandlerId, {
1605
- row: s(o)
1606
- }, i), d = Je(a, {
1607
- extensionId: t.extensionId,
1608
- resourceOf: n.resolveNavigationResource ? (u) => n.resolveNavigationResource(t, u) : void 0
1202
+ return async (s) => {
1203
+ const i = o(t, s), a = await U(e, t, t.rowActivationHandlerId, {
1204
+ row: r(s)
1205
+ }, i), d = me(a, {
1206
+ extensionId: t.extensionId
1609
1207
  });
1610
1208
  d && await e.workbench.navigation.openTarget(d);
1611
1209
  };
1612
1210
  if (n.onRowClick)
1613
- return (o) => n.onRowClick?.({
1211
+ return (s) => n.onRowClick?.({
1614
1212
  record: t,
1615
- row: o,
1616
- resource: r(t, o)
1213
+ row: s,
1214
+ resource: o(t, s)
1617
1215
  });
1618
- }, yr = (e, t, n) => {
1216
+ }, Tn = (e, t, n, o) => {
1619
1217
  const r = e.createRow;
1620
1218
  if (r)
1621
1219
  return async (s) => {
1622
- const o = ot(s.values, r.columnParam ? {
1220
+ const i = Oe(s.values, r.columnParam ? {
1623
1221
  [r.columnParam]: s.columnId
1624
1222
  } : void 0, r.attributesParam ? {
1625
1223
  [r.attributesParam]: s.attributeValues
1626
- } : void 0), i = await n(e, r.commandId, o);
1627
- await t.onAfterCreate?.({
1224
+ } : void 0), a = await n(e, r.commandId, i);
1225
+ if (await t.onAfterCreate?.({
1628
1226
  record: e,
1629
- created: i,
1227
+ created: a,
1630
1228
  submission: s
1229
+ }), !o || typeof a != "object" || a === null) return;
1230
+ const d = a;
1231
+ typeof d.id != "string" || typeof d.title != "string" || await o({
1232
+ ...d,
1233
+ id: d.id,
1234
+ title: d.title,
1235
+ attributes: d.attributes ?? {}
1631
1236
  });
1632
1237
  };
1633
- }, vr = (e, t, n, r, s) => {
1634
- const o = t.rowActions;
1635
- if (o?.length)
1636
- return (i) => o.map((a) => {
1637
- const d = s(t, i), u = () => mr(e, t, a, i, d, r);
1238
+ }, Pn = (e, t, n, o, r) => {
1239
+ const s = t.rowActions;
1240
+ if (s?.length)
1241
+ return (i) => s.map((a) => {
1242
+ const d = r(t, i), m = () => yn(e, t, a, i, d, o);
1638
1243
  return {
1639
1244
  key: a.id,
1640
- label: r(a.label, a.id),
1245
+ label: o(a.label, a.id),
1641
1246
  commandId: a.commandId,
1642
- icon: hr(a.icon),
1247
+ icon: An(a.icon),
1643
1248
  onClick: () => n.executeRowAction ? n.executeRowAction({
1644
1249
  record: t,
1645
1250
  action: a,
1646
1251
  row: i,
1647
1252
  resource: d,
1648
- runDefault: u
1649
- }) : u()
1253
+ runDefault: m
1254
+ }) : m()
1650
1255
  };
1651
1256
  });
1652
- }, kr = (e, t, n = {}, r = [], s = []) => {
1653
- const o = [], i = n.resolveLabel ?? ((c, f) => p(c, f)), a = n.decorateAttribute ?? ((c, f) => f), d = n.resolveRowResource ?? rt, u = n.resolveRowActionResource ?? or, w = n.onAfterMutation ?? (() => {
1654
- }), l = (c, f, h) => X(e, c, f, h).then((C) => (w(c), C));
1655
- for (const c of t) {
1656
- const f = br(e, c), h = er(c, c.attributes, i, a, f);
1657
- let C = c.attributes;
1658
- const j = /* @__PURE__ */ new WeakMap();
1659
- let _;
1660
- const q = (b) => d(c, b), W = (b) => j.get(b) ?? b;
1661
- o.push(...ur(e, c, i)), o.push(e.workbench.renderers.registerKanbanRenderer({
1662
- id: c.id,
1663
- title: i(c.title, c.id),
1664
- resourceKind: c.resourceKind,
1665
- storageScope: e.projectId,
1666
- attributes: h.source,
1667
- defaultSettings: c.defaultSettings,
1668
- defaultFilters: c.defaultFilters,
1669
- defaultViews: c.defaultViews?.map((b) => ({
1670
- ...b,
1671
- title: i(b.title, b.id)
1672
- })),
1673
- defaultActiveViewId: c.defaultActiveViewId,
1674
- emptyTitle: i(c.emptyTitle, ""),
1675
- emptyDescription: i(c.emptyDescription, ""),
1676
- hideToolbar: c.hideToolbar,
1677
- createRow: wr(c, i),
1678
- getBoardColumnConfig: (b) => fr(_?.[b] ?? gr(e, c, C, b), i),
1679
- onRowActivate: Ir(e, c, n, d, W),
1680
- executeQuery: async (b) => {
1681
- const y = await X(e, c, c.queryHandlerId, {
1682
- settings: b.settings,
1683
- filters: b.filters
1684
- });
1685
- if (Array.isArray(y))
1686
- return y.map((x) => {
1687
- const A = $e(x, q);
1688
- return j.set(A, x), A;
1257
+ }, jn = (e, t, n = {}) => {
1258
+ const o = [], r = n.resolveLabel ?? ((l, c) => b(l, c)), s = (l, c) => {
1259
+ const p = c.display?.kind === "badge-list" ? {
1260
+ ...c,
1261
+ render: (u, g) => at(c, u, g)
1262
+ } : c;
1263
+ return n.decorateAttribute?.(l, p) ?? p;
1264
+ }, i = n.resolveRowResource ?? De, a = n.resolveRowActionResource ?? mn, d = n.onAfterMutation ?? (() => {
1265
+ }), m = (l, c, p) => U(e, l, c, p).then((u) => (d(l), u));
1266
+ for (const l of t) {
1267
+ const c = xn(e, l), p = (f, k) => e.workbench.notifications.show({
1268
+ id: `workbench.extension.${l.extensionId}.kanban.${l.id}.display.${f}`,
1269
+ level: "error",
1270
+ title: "Extension display is not available",
1271
+ message: `Attribute "${f}" in renderer "${l.id}" uses unknown display kind "${k}".`
1272
+ }), u = cn(l, l.attributes, r, s, c, p);
1273
+ let g = l.attributes, x = En(l);
1274
+ const $ = /* @__PURE__ */ new WeakMap();
1275
+ let O, H = 0;
1276
+ const z = (f) => i(l, f), T = Sn(e, l, n, i, (f) => $.get(f) ?? f);
1277
+ o.push(...In(e, l, r)), o.push(e.workbench.views.registerView({
1278
+ id: l.id,
1279
+ title: r(l.title, l.id),
1280
+ icon: l.icon,
1281
+ body: {
1282
+ kind: "kanban",
1283
+ resourceKind: l.resourceKind,
1284
+ storageScope: e.projectId,
1285
+ attributes: u.source,
1286
+ defaultSettings: l.defaultSettings,
1287
+ defaultFilters: l.defaultFilters,
1288
+ defaultViews: l.defaultViews?.map((f) => ({
1289
+ ...f,
1290
+ title: r(f.title, f.id)
1291
+ })),
1292
+ defaultActiveViewId: l.defaultActiveViewId,
1293
+ emptyTitle: r(l.emptyTitle, ""),
1294
+ emptyDescription: r(l.emptyDescription, ""),
1295
+ hideToolbar: l.hideToolbar,
1296
+ createRow: Cn(l, r),
1297
+ getBoardColumnConfig: (f) => kn(O?.[f] ?? Rn(e, l, g, x, f), r),
1298
+ onRowActivate: T,
1299
+ executeQuery: async (f) => {
1300
+ H += 1;
1301
+ const k = H, w = await U(e, l, l.queryHandlerId, {
1302
+ settings: f.settings,
1303
+ filters: f.filters
1304
+ }), S = (h) => h.map((A) => {
1305
+ const C = un(A, z);
1306
+ return $.set(C, A), C;
1689
1307
  });
1690
- if (!Zn(y)) return [];
1691
- const E = y.attributes ?? C;
1692
- if (y.boardColumnConfigs && E?.some((x) => x.type.kind === "status"))
1693
- throw new Error(`Status-backed Kanban renderer "${c.id}" cannot return boardColumnConfigs`);
1694
- return C = E, h.set(E), _ = y.boardColumnConfigs, (y.rows ?? []).map((x) => {
1695
- const A = $e(x, q);
1696
- return j.set(A, x), A;
1697
- });
1698
- },
1699
- onAttributeChange: c.attributeChangeHandlerId ? (b, y, E) => l(c, c.attributeChangeHandlerId, {
1700
- rowId: b,
1701
- attributeId: y,
1702
- value: E
1703
- }).then(() => {
1704
- }) : void 0,
1705
- onReorder: c.reorderHandlerId ? (b, y) => l(c, c.reorderHandlerId, {
1706
- rowId: b,
1707
- beforeRowId: y
1708
- }).then(() => {
1709
- }) : void 0,
1710
- onCreateRow: yr(c, n, l),
1711
- onColumnAction: c.columnActionHandlerId ? async (b, y) => {
1712
- await l(c, c.columnActionHandlerId, {
1713
- columnId: b,
1714
- actionId: y
1715
- });
1716
- } : void 0,
1717
- getRowContextMenuActions: vr(e, c, n, i, u)
1308
+ if (k !== H)
1309
+ return Array.isArray(w) ? S(w) : Re(w) ? S(w.rows ?? []) : [];
1310
+ if (x = f.settings.columnGrouping, Array.isArray(w)) return S(w);
1311
+ if (!Re(w)) return [];
1312
+ const Q = w.attributes ?? g;
1313
+ return g = Q, u.set(Q), O = w.boardColumnConfigs, S(w.rows ?? []);
1314
+ },
1315
+ onAttributeChange: l.attributeChangeHandlerId ? (f, k, w) => m(l, l.attributeChangeHandlerId, {
1316
+ rowId: f,
1317
+ attributeId: k,
1318
+ value: w
1319
+ }).then(() => {
1320
+ }) : void 0,
1321
+ onReorder: l.reorderHandlerId ? (f, k) => m(l, l.reorderHandlerId, {
1322
+ rowId: f,
1323
+ beforeRowId: k
1324
+ }).then(() => {
1325
+ }) : void 0,
1326
+ onCreateRow: Tn(l, n, m, l.rowActivationHandlerId ? T : void 0),
1327
+ onColumnAction: l.columnActionHandlerId ? async (f, k) => {
1328
+ await m(l, l.columnActionHandlerId, {
1329
+ columnId: f,
1330
+ actionId: k
1331
+ });
1332
+ } : void 0,
1333
+ getRowContextMenuActions: Pn(e, l, n, r, a)
1334
+ }
1718
1335
  }));
1719
1336
  }
1720
- const m = L(r);
1721
- return r.forEach((c, f) => {
1722
- const h = ee(c, "kanban");
1723
- h && o.push(U({
1724
- workbench: e.workbench,
1725
- path: c.path,
1726
- aliases: c.aliases,
1727
- resolveInput: F(n.resolveViewInput, c),
1728
- contribution: N({
1729
- panel: c,
1730
- rendererId: h,
1731
- declarationIndex: f,
1732
- menuDeclarationOffset: m[f],
1733
- resourcePanels: s
1734
- })
1735
- }));
1736
- }), {
1337
+ return {
1737
1338
  dispose() {
1738
- for (let c = o.length - 1; c >= 0; c -= 1) o[c]?.dispose();
1339
+ for (let l = o.length - 1; l >= 0; l -= 1) o[l]?.dispose();
1739
1340
  }
1740
1341
  };
1741
- }, Rr = (e, t) => {
1342
+ }, $n = (e, t) => {
1742
1343
  if (e)
1743
- return Object.fromEntries(Object.entries(e).map(([n, r]) => [n, {
1744
- ...r,
1745
- label: r.label === void 0 ? void 0 : t(r.label, n),
1746
- description: r.description === void 0 ? void 0 : t(r.description)
1344
+ return Object.fromEntries(Object.entries(e).map(([n, o]) => [n, {
1345
+ ...o,
1346
+ label: o.label === void 0 ? void 0 : t(o.label, n),
1347
+ description: o.description === void 0 ? void 0 : t(o.description)
1747
1348
  }]));
1748
- }, Cr = (e, t) => e.panels.flatMap((n) => [n, ...n.panelMenus ?? []]).filter((n) => n.renderer?.kind === "tree" && n.renderer.id === t.id), at = (e, t) => t.viewId ? e.find((n) => n.id === t.viewId) : e.length === 1 ? e[0] : void 0, xr = async (e) => {
1349
+ }, Hn = (e, t) => e.panels.flatMap((n) => [n, ...n.panelMenus ?? []]).filter((n) => n.renderer?.kind === "tree" && n.renderer.id === t.id), Ne = (e, t) => t.viewId ? e.find((n) => n.id === t.viewId) : e.length === 1 ? e[0] : void 0, Wn = async (e) => {
1749
1350
  const {
1750
1351
  ctx: t,
1751
1352
  getHostTreeHeaderNodes: n,
1752
- record: r,
1753
- treeViews: s
1754
- } = e, o = at(s, t);
1755
- return !o || !("hostTreeHeader" in o) || o.hostTreeHeader !== "default" ? [] : await n?.({
1353
+ record: o,
1354
+ treeViews: r
1355
+ } = e, s = Ne(r, t);
1356
+ return !s || !("hostTreeHeader" in s) || s.hostTreeHeader !== "default" ? [] : await n?.({
1756
1357
  ctx: t,
1757
- record: r,
1758
- panel: o
1358
+ record: o,
1359
+ panel: s
1759
1360
  }) ?? [];
1760
- }, Er = async (e) => {
1361
+ }, Mn = async (e) => {
1761
1362
  const {
1762
1363
  ctx: t,
1763
1364
  getHostTreeFooterNodes: n,
1764
- record: r,
1765
- treeViews: s
1766
- } = e, o = at(s, t);
1767
- return !o || !("hostTreeFooter" in o) || o.hostTreeFooter !== "default" ? [] : await n?.({
1365
+ record: o,
1366
+ treeViews: r
1367
+ } = e, s = Ne(r, t);
1368
+ return !s || !("hostTreeFooter" in s) || s.hostTreeFooter !== "default" ? [] : await n?.({
1768
1369
  ctx: t,
1769
- record: r,
1770
- panel: o
1370
+ record: o,
1371
+ panel: s
1771
1372
  }) ?? [];
1772
- }, Pr = (e, t, n, r) => {
1773
- const s = ee(t, "tree");
1774
- if (s)
1775
- return U({
1776
- workbench: e.workbench,
1777
- path: t.path,
1778
- aliases: t.aliases,
1779
- resolveInput: F(e.resolveViewInput, t),
1780
- contribution: N({
1781
- panel: t,
1782
- rendererId: s,
1783
- declarationIndex: n,
1784
- menuDeclarationOffset: r,
1785
- resourcePanels: e.resourcePanels
1786
- })
1787
- });
1788
- }, ge = (e) => {
1789
- if (e)
1790
- return {
1791
- type: e.kind,
1792
- id: e.id ?? e.uri,
1793
- label: e.label,
1794
- metadata: e.metadata
1795
- };
1796
- }, Ar = (e, t) => ({
1797
- kind: e.type,
1798
- uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
1799
- id: e.id,
1800
- label: e.label,
1801
- metadata: t ? {
1802
- ...e.metadata,
1803
- [we]: t
1804
- } : e.metadata
1805
- }), dt = (e) => ({
1373
+ }, Le = (e) => ({
1806
1374
  id: e.treeId,
1807
1375
  kind: "renderer",
1808
1376
  context: {
@@ -1816,55 +1384,55 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1816
1384
  resourceId: e.resource.id
1817
1385
  } : {}
1818
1386
  }
1819
- }), fe = (e, t, n, r) => {
1820
- const s = ge(n.resource), o = e.workbench.modes.getActiveModeId();
1387
+ }), G = (e, t, n, o) => {
1388
+ const r = n.resource, s = e.workbench.modes.getActiveModeId();
1821
1389
  return {
1822
1390
  renderer: {
1823
1391
  rendererId: t.id,
1824
1392
  projectId: e.projectId,
1825
- ...o ? {
1826
- modeId: o
1827
- } : {},
1828
1393
  ...s ? {
1829
- resource: s
1394
+ modeId: s
1395
+ } : {},
1396
+ ...r ? {
1397
+ resource: r
1830
1398
  } : {},
1831
1399
  invocation: {
1832
1400
  placement: "visible"
1833
1401
  }
1834
1402
  },
1835
- state: e.workbench.renderers.getTreeState(t.id),
1403
+ state: n.state,
1836
1404
  ...n.filter ? {
1837
1405
  filter: n.filter
1838
1406
  } : {},
1839
- ...r ? {
1840
- node: r
1407
+ ...o ? {
1408
+ node: o
1841
1409
  } : {}
1842
1410
  };
1843
- }, be = async (e, t, n, r) => {
1844
- const s = r.renderer, o = s?.resource, i = await e.executeCommand(n, {
1411
+ }, Y = async (e, t, n, o) => {
1412
+ const r = o.renderer, s = r?.resource, i = await e.executeCommand(n, {
1845
1413
  projectId: e.projectId,
1846
- params: r,
1847
- resource: o,
1848
- slot: dt({
1849
- modeId: s?.modeId,
1414
+ params: o,
1415
+ resource: s,
1416
+ slot: Le({
1417
+ modeId: r?.modeId,
1850
1418
  projectId: e.projectId,
1851
- resource: o,
1419
+ resource: s,
1852
1420
  treeId: t.id
1853
1421
  }),
1854
1422
  source: "dashboard"
1855
1423
  });
1856
- return ie(i);
1857
- }, ct = async (e, t, n, r, s) => {
1858
- const o = e.workbench.modes.getActiveModeId(), i = {
1859
- ...r ?? {},
1424
+ return ee(i);
1425
+ }, _e = async (e, t, n, o, r) => {
1426
+ const s = e.workbench.modes.getActiveModeId(), i = {
1427
+ ...o ?? {},
1860
1428
  renderer: {
1861
1429
  rendererId: t.id,
1862
1430
  projectId: e.projectId,
1863
- ...o ? {
1864
- modeId: o
1865
- } : {},
1866
1431
  ...s ? {
1867
- resource: s
1432
+ modeId: s
1433
+ } : {},
1434
+ ...r ? {
1435
+ resource: r
1868
1436
  } : {},
1869
1437
  invocation: {
1870
1438
  placement: "visible"
@@ -1873,11 +1441,11 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1873
1441
  }, a = await e.executeCommand(n, {
1874
1442
  projectId: e.projectId,
1875
1443
  params: i,
1876
- resource: s,
1877
- slot: dt({
1878
- modeId: o,
1444
+ resource: r,
1445
+ slot: Le({
1446
+ modeId: s,
1879
1447
  projectId: e.projectId,
1880
- resource: s,
1448
+ resource: r,
1881
1449
  treeId: t.id
1882
1450
  }),
1883
1451
  source: "dashboard",
@@ -1885,449 +1453,332 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1885
1453
  treeId: t.id
1886
1454
  }
1887
1455
  });
1888
- return ie(a);
1889
- }, Sr = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, Ve = (e) => e && !Array.isArray(e) ? e : void 0, Tr = (e, t) => {
1890
- const n = /* @__PURE__ */ new WeakMap(), r = `workbench.extensionTreeRenderer.${t.id}.command`, s = (l, m) => {
1891
- const c = e.resolveNodeResource?.(l);
1892
- return c ? m ? {
1893
- ...c,
1894
- metadata: {
1895
- ...c.metadata,
1896
- [we]: m
1897
- }
1898
- } : c : Ar(l, m);
1899
- }, o = (l) => {
1900
- if (l.emptyState)
1456
+ return ee(a);
1457
+ }, Bn = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, Ae = (e) => e && !Array.isArray(e) ? e : void 0, Vn = (e, t) => {
1458
+ const n = /* @__PURE__ */ new WeakMap(), o = `workbench.extensionTreeRenderer.${t.id}.command`, r = (c) => e.resolveNodeResource?.(c) ?? c, s = (c) => {
1459
+ if (c.emptyState)
1901
1460
  return {
1902
- title: p(l.emptyState.title),
1903
- description: p(l.emptyState.description),
1904
- icon: l.emptyState.icon
1461
+ title: b(c.emptyState.title),
1462
+ description: b(c.emptyState.description),
1463
+ icon: c.emptyState.icon
1905
1464
  };
1906
- }, i = (l, m, c) => l ? Z(l, {
1907
- commandTargetOf: (h) => ({
1465
+ }, i = (c, p, u) => c ? j(c, {
1466
+ commandTargetOf: (x) => ({
1908
1467
  kind: "command",
1909
- commandId: r,
1468
+ commandId: o,
1910
1469
  args: {
1911
- commandId: `${h.target.command.extensionId ?? t.extensionId}.command.${h.target.command.id}`,
1912
- nodeId: m.id,
1913
- params: h.target.params,
1914
- resource: m.resource ?? ge(c.resource),
1470
+ commandId: `${x.target.command.extensionId ?? t.extensionId}.command.${x.target.command.id}`,
1471
+ nodeId: p.id,
1472
+ params: x.target.params,
1473
+ resource: p.resource ?? u.resource,
1915
1474
  treeId: t.id
1916
1475
  }
1917
1476
  }),
1918
- extensionId: t.extensionId,
1919
- resourceOf: (h, C) => s(h, C.section ? {
1920
- treeId: t.id,
1921
- targetNodeId: m.id,
1922
- anchors: C.section.anchors
1923
- } : void 0)
1924
- }) : void 0, a = (l, m, c) => {
1925
- const f = l.command ? `${l.command.extensionId ?? t.extensionId}.command.${l.command.id}` : void 0;
1477
+ extensionId: t.extensionId
1478
+ }) : void 0, a = (c, p, u) => {
1479
+ const g = c.command ? `${c.command.extensionId ?? t.extensionId}.command.${c.command.id}` : void 0;
1926
1480
  return {
1927
- id: l.id,
1928
- label: p(l.label),
1929
- icon: l.icon,
1930
- args: Ve(l.params),
1931
- params: Rr(l.input, p),
1932
- submitLabel: l.submitLabel,
1933
- when: l.when,
1934
- disabled: l.disabled,
1481
+ id: c.id,
1482
+ label: b(c.label),
1483
+ icon: c.icon,
1484
+ args: Ae(c.params),
1485
+ params: $n(c.input, b),
1486
+ submitLabel: c.submitLabel,
1487
+ when: c.when,
1488
+ disabled: c.disabled,
1935
1489
  // Actions mutate tree data (create/delete/...), so refresh afterwards. Plain
1936
1490
  // node-target navigation runs through the runner command and must not refetch.
1937
- run: f ? async (h) => {
1938
- await ct(e, t, f, Sr(h, Ve(l.params)), m?.resource ?? ge(c.resource)), e.workbench.renderers.refresh(t.id);
1491
+ run: g ? async (x) => {
1492
+ await _e(e, t, g, Bn(x, Ae(c.params)), p?.resource ?? u.resource), u.refresh();
1939
1493
  } : void 0
1940
1494
  };
1941
- }, d = (l, m) => {
1942
- const c = {
1943
- id: l.id,
1944
- label: p(l.label),
1945
- icon: l.icon,
1946
- iconColor: l.iconColor,
1947
- iconTooltip: l.iconTooltip,
1948
- resource: l.resource ? s(l.resource) : void 0,
1949
- target: i(l.target, l, m),
1950
- rowVariant: l.rowVariant,
1951
- actions: l.actions?.map((f) => a(f, l, m)),
1952
- contextMenuActions: l.contextMenuActions?.map((f) => a(f, l, m)),
1953
- collapsible: l.collapsible,
1954
- disabled: l.disabled,
1955
- children: l.children?.map((f) => d(f, m)),
1956
- description: l.description,
1957
- contextValue: l.contextValue,
1958
- hiddenByDefault: l.hiddenByDefault,
1959
- canHide: l.canHide
1960
- };
1961
- return n.set(c, l), c;
1962
- };
1963
- return {
1964
- mapNodes: (l, m) => l.map((c) => d(c, m)),
1965
- mapSections: (l, m) => l.map((c) => ({
1495
+ }, d = (c, p) => {
1496
+ const u = {
1966
1497
  id: c.id,
1967
- label: p(c.label),
1968
- actions: c.actions?.map((f) => a(f, void 0, m)),
1498
+ selected: c.selected,
1499
+ label: b(c.label),
1500
+ icon: c.icon,
1501
+ iconColor: c.iconColor,
1502
+ iconTooltip: c.iconTooltip,
1503
+ resource: c.resource ? r(c.resource) : void 0,
1504
+ target: i(c.target, c, p),
1505
+ rowVariant: c.rowVariant,
1506
+ actions: c.actions?.map((g) => a(g, c, p)),
1507
+ contextMenuActions: c.contextMenuActions?.map((g) => a(g, c, p)),
1969
1508
  collapsible: c.collapsible,
1970
- emptyState: o(c),
1971
- nodes: c.nodes.map((f) => d(f, m)),
1509
+ disabled: c.disabled,
1510
+ children: c.children?.map((g) => d(g, p)),
1511
+ description: c.description,
1512
+ contextValue: c.contextValue,
1972
1513
  hiddenByDefault: c.hiddenByDefault,
1973
1514
  canHide: c.canHide
1515
+ };
1516
+ return n.set(u, c), u;
1517
+ };
1518
+ return {
1519
+ mapNodes: (c, p) => c.map((u) => d(u, p)),
1520
+ mapSections: (c, p) => c.map((u) => ({
1521
+ id: u.id,
1522
+ label: b(u.label),
1523
+ actions: u.actions?.map((g) => a(g, void 0, p)),
1524
+ collapsible: u.collapsible,
1525
+ emptyState: s(u),
1526
+ nodes: u.nodes.map((g) => d(g, p)),
1527
+ hiddenByDefault: u.hiddenByDefault,
1528
+ canHide: u.canHide
1974
1529
  })),
1975
1530
  originalNodes: n,
1976
- runnerCommandId: r
1531
+ runnerCommandId: o
1977
1532
  };
1978
- }, jr = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), De = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), lt = (e) => {
1979
- for (const t of e) {
1980
- if (t.selected) return t.id;
1981
- const n = lt(t.children ?? []);
1982
- if (n) return n;
1983
- }
1984
- }, Wr = (e) => {
1985
- for (const t of e) {
1986
- const n = lt(t.nodes);
1987
- if (n) return n;
1988
- }
1989
- }, Mr = (e, t) => {
1990
- const n = Tr(e, t), r = Cr(e.metadata, t), s = e.workbench.commands.registerCommand({
1533
+ }, ie = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), Dn = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), X = (e, t) => t.length > 0 ? [{
1534
+ id: e,
1535
+ nodes: t,
1536
+ canReorder: !1
1537
+ }] : [], On = (e, t) => {
1538
+ const n = Vn(e, t), o = Hn(e.metadata, t), r = e.workbench.commands.registerCommand({
1991
1539
  id: n.runnerCommandId,
1992
- label: `${p(t.title, t.id)} tree command`
1540
+ label: `${b(t.title, t.id)} tree command`
1993
1541
  }, {
1994
1542
  execute: async (i) => {
1995
- const a = i;
1996
- a.nodeId && e.workbench.renderers.setSelectedNode(t.id, a.nodeId);
1997
- const d = await ct(e, t, a.commandId, a.params, a.resource);
1998
- for (const u of e.workbench.renderers.listFileRenderers())
1999
- e.workbench.renderers.refreshFileRenderer(u.id);
1543
+ const a = i, d = await _e(e, t, a.commandId, a.params, a.resource);
1544
+ for (const m of e.workbench.views.listViews())
1545
+ m.body.kind === "file" && e.workbench.views.refreshView(m.id);
2000
1546
  return d;
2001
1547
  }
2002
- }), o = e.workbench.renderers.registerTreeRenderer({
1548
+ }), s = e.workbench.views.registerView({
2003
1549
  id: t.id,
2004
- title: p(t.title, t.id),
1550
+ title: b(t.title, t.id),
2005
1551
  icon: t.icon,
2006
- searchable: t.searchable,
2007
- searchPlaceholder: p(t.searchPlaceholder, "Search files"),
2008
- defaultExpandedNodeIds: t.defaultExpandedNodeIds,
2009
- defaultExpandedSectionIds: t.defaultExpandedSectionIds,
2010
- getHeader: (i) => xr({
2011
- ctx: i,
2012
- getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
2013
- record: t,
2014
- treeViews: r
2015
- }),
2016
- getBody: async (i) => {
2017
- const a = await be(e, t, t.bodyHandlerId, fe(e, t, i));
2018
- if (!jr(a)) return [];
2019
- const d = Wr(a);
2020
- return d && e.workbench.renderers.setSelectedNode(t.id, d), n.mapSections(a, i);
2021
- },
2022
- getFooter: async (i) => {
2023
- const a = await Er({
2024
- ctx: i,
2025
- getHostTreeFooterNodes: e.getHostTreeFooterNodes,
2026
- record: t,
2027
- treeViews: r
2028
- });
2029
- if (!t.footerHandlerId) return a;
2030
- const d = await be(e, t, t.footerHandlerId, fe(e, t, i));
2031
- return [...De(d) ? n.mapNodes(d, i) : [], ...a];
2032
- },
2033
- getChildren: async (i, a) => {
2034
- if (!t.childrenHandlerId) return i.children ?? [];
2035
- const d = n.originalNodes.get(i) ?? i, u = await be(e, t, t.childrenHandlerId, fe(e, t, a, d));
2036
- return De(u) ? n.mapNodes(u, a) : [];
1552
+ body: {
1553
+ kind: "tree",
1554
+ searchable: t.searchable,
1555
+ searchPlaceholder: b(t.searchPlaceholder, "Search files"),
1556
+ defaultExpandedNodeIds: t.defaultExpandedNodeIds,
1557
+ defaultExpandedSectionIds: t.defaultExpandedSectionIds,
1558
+ getHeader: async (i) => {
1559
+ const a = await Wn({
1560
+ ctx: i,
1561
+ getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
1562
+ record: t,
1563
+ treeViews: o
1564
+ });
1565
+ if (!t.headerHandlerId) return X(`${t.id}:host-header`, a);
1566
+ const d = await Y(e, t, t.headerHandlerId, G(e, t, i)), m = ie(d) ? n.mapSections(d, i) : [];
1567
+ return [...X(`${t.id}:host-header`, a), ...m];
1568
+ },
1569
+ getBody: async (i) => {
1570
+ const a = await Y(e, t, t.bodyHandlerId, G(e, t, i));
1571
+ return ie(a) ? n.mapSections(a, i) : [];
1572
+ },
1573
+ getFooter: async (i) => {
1574
+ const a = await Mn({
1575
+ ctx: i,
1576
+ getHostTreeFooterNodes: e.getHostTreeFooterNodes,
1577
+ record: t,
1578
+ treeViews: o
1579
+ });
1580
+ if (!t.footerHandlerId) return X(`${t.id}:host-footer`, a);
1581
+ const d = await Y(e, t, t.footerHandlerId, G(e, t, i));
1582
+ return [...ie(d) ? n.mapSections(d, i) : [], ...X(`${t.id}:host-footer`, a)];
1583
+ },
1584
+ getChildren: async (i, a) => {
1585
+ if (!t.childrenHandlerId) return i.children ?? [];
1586
+ const d = n.originalNodes.get(i);
1587
+ if (!d) return i.children ?? [];
1588
+ const m = await Y(e, t, t.childrenHandlerId, G(e, t, a, d));
1589
+ return Dn(m) ? n.mapNodes(m, a) : [];
1590
+ }
2037
1591
  }
2038
1592
  });
2039
1593
  return {
2040
1594
  dispose() {
2041
- o.dispose(), s.dispose();
1595
+ s.dispose(), r.dispose();
2042
1596
  }
2043
1597
  };
2044
- }, Or = (e) => {
1598
+ }, Fn = (e) => {
2045
1599
  const t = [];
2046
- for (const r of e.metadata.treeRenderers ?? [])
2047
- t.push(Mr(e, r));
2048
- const n = L(e.metadata.panels);
2049
- return e.metadata.panels.forEach((r, s) => {
2050
- const o = Pr({
2051
- workbench: e.workbench,
2052
- resourcePanels: e.metadata.resourcePanels,
2053
- resolveViewInput: e.resolveViewInput
2054
- }, r, s, n[s]);
2055
- o && t.push(o);
2056
- }), {
1600
+ for (const n of e.metadata.treeRenderers ?? [])
1601
+ t.push(On(e, n));
1602
+ return {
2057
1603
  dispose() {
2058
- for (let r = t.length - 1; r >= 0; r -= 1) t[r]?.dispose();
1604
+ for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
2059
1605
  }
2060
1606
  };
2061
- }, Hr = (e) => e.includes("main.right") ? "secondary" : (e.includes("main.left"), "sidenav"), Kr = (e, t) => (e.order ?? 0) - (t.order ?? 0) || e.id.localeCompare(t.id), $r = (e) => ({
1607
+ }, I = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.kind}.${e.id}`, Z = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.command.${e.id}`, Ue = (e) => {
1608
+ if (!e) return;
1609
+ const t = (n) => {
1610
+ if (n)
1611
+ return Array.isArray(n) ? n.map(I) : I(n);
1612
+ };
1613
+ return {
1614
+ mode: t(e.mode),
1615
+ source: e.source,
1616
+ viewId: t(e.view),
1617
+ resourceType: e.resourceType?.map((n) => n.id),
1618
+ metadata: e.metadata
1619
+ };
1620
+ }, Qo = Ue, ue = (e) => ({
1621
+ kind: e.kind,
1622
+ id: I(e),
1623
+ extensionId: e.extensionId
1624
+ }), Kn = (e, t, n) => {
1625
+ const o = n?.(t.when);
1626
+ return o ? e.context.matches(o) : !0;
1627
+ }, Nn = (e) => ({
2062
1628
  id: e.id,
2063
- label: p(e.label, e.id),
1629
+ label: b(e.label, e.id),
2064
1630
  icon: e.icon,
2065
- target: Z(e.action, {
1631
+ canHide: !0,
1632
+ canReorder: !0,
1633
+ target: j(e.action, {
2066
1634
  extensionId: e.extensionId
2067
1635
  })
2068
- }), Vr = (e) => {
1636
+ }), Ln = (e, t, n) => {
1637
+ const o = /* @__PURE__ */ new Map();
1638
+ for (const r of t) {
1639
+ if (!Kn(e, r, n)) continue;
1640
+ const s = r.group || void 0, i = s ? `${r.extensionId}:${s}` : "navigation.root", a = o.get(i) ?? {
1641
+ id: i,
1642
+ label: s,
1643
+ collapsible: !!s,
1644
+ canHide: !0,
1645
+ canReorder: !0,
1646
+ nodes: []
1647
+ };
1648
+ a.nodes.push(Nn(r)), o.set(i, a);
1649
+ }
1650
+ return [...o.values()];
1651
+ }, _n = (e) => {
2069
1652
  const t = /* @__PURE__ */ new Map();
2070
1653
  for (const n of e) {
2071
- const r = n.group ?? "Extensions";
1654
+ const o = ue(n.owner), r = `${n.extensionId}:${o.kind}:${o.id}:${n.slot}`;
2072
1655
  t.set(r, [...t.get(r) ?? [], n]);
2073
1656
  }
2074
- return t;
2075
- }, Dr = (e) => {
2076
- if (e.metadata.navigationItems.length === 0) return [];
2077
- const t = [], n = /* @__PURE__ */ new Map();
2078
- for (const r of e.metadata.navigationItems)
2079
- n.set(r.slot.id, [...n.get(r.slot.id) ?? [], r]);
2080
- for (const [r, s] of n) {
2081
- const o = `workbench.extension.navigation.${r}`, i = Vr([...s].sort(Kr));
2082
- t.push(e.workbench.renderers.registerTreeRenderer({
2083
- id: o,
2084
- title: "Extensions",
2085
- getChildren: (a) => a.children ?? [],
2086
- getBody: () => [...i].map(([a, d]) => ({
2087
- id: a,
2088
- label: a,
2089
- nodes: d.map($r)
2090
- }))
2091
- }), e.workbench.layout.registerPanel({
2092
- id: o,
2093
- title: "Extensions",
2094
- region: Hr(r),
2095
- rendererId: o,
2096
- singleton: !0
2097
- }));
2098
- }
2099
- return t;
2100
- }, Br = (e) => {
2101
- const t = /* @__PURE__ */ new Map();
2102
- for (const n of e.resourceKinds ?? [])
2103
- t.set(n.id, {
2104
- surface: n.surface,
2105
- extensionId: n.extensionId,
2106
- label: n.label ? p(n.label, n.id) : void 0,
2107
- icon: n.icon
2108
- });
2109
- for (const n of e.kanbanRenderers ?? [])
2110
- n.resourceKind && !t.has(n.resourceKind) && t.set(n.resourceKind, {
2111
- surface: "primary"
2112
- });
2113
- return t;
2114
- }, Fr = (e, t, n) => {
2115
- const s = (e.resourcePanels ?? []).filter((i) => i.resourceKind === t).flatMap((i) => {
2116
- const a = e.panels.find((d) => d.id === i.panel);
2117
- return a ? [{
2118
- edge: i,
2119
- panel: a
2120
- }] : [];
2121
- }), o = new Set(s.map(({
2122
- panel: i
2123
- }) => i.id));
2124
- for (const i of e.panels) {
2125
- if (o.has(i.id) || i.extensionId !== n) continue;
2126
- const d = (i.show ? Array.isArray(i.show) ? i.show : [i.show] : []).find((u) => u.for === t);
2127
- d && s.push({
2128
- panel: i,
2129
- placement: d
2130
- });
2131
- }
2132
- return s;
2133
- }, Be = (e, t) => {
2134
- const n = e.workbench.layout.getLayout();
2135
- return ["sidenav", "main", "secondary", "side"].find((s) => n.regions[s].widgets.some((o) => o.contributionId === t));
2136
- }, Nr = (e, t, n) => {
2137
- e.prepareResource?.(n);
2138
- const r = t.map(({
2139
- panel: o
2140
- }) => e.workbench.layout.openPanel(o.id, {
2141
- region: Be(e, o.id),
2142
- resource: n,
2143
- title: n.label ?? n.id ?? n.uri,
2144
- strategy: {
2145
- kind: "persistent"
2146
- }
2147
- }));
2148
- e.workbench.sidePanel.getMode() === "closed" && t.some(({
2149
- panel: o
2150
- }) => Be(e, o.id) === "side") && e.workbench.sidePanel.setMode("attached");
2151
- const s = t.findIndex((o) => o.edge?.slot === "primary" || o.placement?.region === "main");
2152
- return r[s >= 0 ? s : 0];
2153
- }, Lr = (e, t, n) => {
2154
- const r = [];
2155
- e.workbench.resources.getKind(t) || r.push(e.workbench.resources.registerKind({
2156
- kind: t,
2157
- label: n.label ?? t,
2158
- icon: n.icon ?? "FileText",
2159
- surface: n.surface
2160
- }));
2161
- const s = Fr(e.metadata, t, n.extensionId);
2162
- return s.length === 0 || r.push(e.workbench.resources.registerPresenter({
2163
- id: `workbench.extension.resource.${t}`,
2164
- canOpen: (o) => o.kind === t,
2165
- open: (o) => Nr(e, s, o)
2166
- })), r;
2167
- }, Ur = (e) => [...Br(e.metadata)].flatMap(([t, n]) => Lr(e, t, n)), _r = (e) => {
2168
- const t = In(), n = [];
2169
- for (const r of e.metadata.resourceKinds ?? [])
2170
- n.push(t.registerResourceKind({
2171
- id: r.id,
2172
- extensionId: r.extensionId,
2173
- surface: r.surface,
2174
- slots: r.slots
2175
- }));
2176
- for (const r of e.metadata.panels)
2177
- n.push(t.registerPanelCapability({
2178
- id: r.id,
2179
- extensionId: r.extensionId,
2180
- title: p(r.title, r.id),
2181
- icon: r.icon,
2182
- show: wn(r.show)
2183
- }));
2184
- for (const r of e.metadata.resourcePanels ?? [])
2185
- n.push(t.registerResourcePanel({
2186
- id: r.id,
2187
- extensionId: r.extensionId,
2188
- resourceKind: r.resourceKind,
2189
- panel: r.panel,
2190
- slot: r.slot
2191
- }));
2192
- for (const r of e.metadata.modes)
2193
- n.push(t.registerModeComposition({
2194
- id: r.modeId,
2195
- extensionId: r.extensionId,
2196
- resources: r.resources,
2197
- modePanels: r.modePanels
2198
- }));
2199
- return {
2200
- registry: t,
2201
- disposables: n
2202
- };
2203
- }, Fe = (e, t) => `pstdio://extension-resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}`, qr = (e, t) => {
2204
- if (t)
2205
- return "commandId" in t ? async () => {
2206
- const n = await e.executeCommand(t.commandId, {
2207
- projectId: e.projectId
2208
- });
2209
- if (!(!n || typeof n.type != "string" || typeof n.id != "string"))
2210
- return {
2211
- kind: n.type,
2212
- uri: Fe(n.type, n.id),
2213
- id: n.id,
2214
- label: n.label
2215
- };
2216
- } : {
2217
- kind: t.type,
2218
- uri: Fe(t.type, t.id),
2219
- id: t.id,
2220
- label: t.label
2221
- };
2222
- }, zr = (e, t) => e.metadata.modes.map((n) => {
2223
- const r = (s, o) => {
2224
- xn({
2225
- layout: s.layout,
2226
- notifications: s.notifications
2227
- }, {
2228
- registry: t,
2229
- modeId: n.modeId,
2230
- resourceKind: s.navigator.getSelectedResource()?.kind,
2231
- seeding: o
2232
- }), s.layout.getLayout().regions.side.widgets.length > 0 && s.shell.setSidePanelPresentation("attached");
2233
- };
2234
- return e.workbench.modes.registerMode({
2235
- id: n.modeId,
2236
- label: p(n.label, n.modeId),
2237
- panels: n.panelRegions,
2238
- resourceKinds: Object.keys(n.resources ?? {}),
2239
- defaultResource: qr(e, n.defaultResource),
2240
- listAddablePanels: ({
2241
- layout: s,
2242
- resource: o
2243
- }) => yn({
2244
- registry: t,
2245
- modeId: n.modeId,
2246
- layout: s,
2247
- resourceKind: o?.kind
2248
- }).filter((i) => Et.includes(i.region)),
2249
- activate: () => {
2250
- },
2251
- seed: (s) => r(s, !0),
2252
- reconcile: (s) => r(s, !1)
1657
+ return [...t.values()];
1658
+ }, Un = (e) => [...new Set(e.flatMap((t) => t.group ? [`${t.extensionId}:${t.group}`] : []))], qn = (e) => _n(e.metadata.navigationItems).map((t) => {
1659
+ const n = t[0];
1660
+ return e.workbench.navigationTrees.registerContribution({
1661
+ id: `${n.extensionId}.navigation-items.${n.owner.kind}.${I(n.owner)}.${n.slot}`,
1662
+ owner: ue(n.owner),
1663
+ sourceExtensionId: n.extensionId,
1664
+ declarationIndex: e.metadata.navigationItems.indexOf(n),
1665
+ slot: n.slot,
1666
+ defaultExpandedSectionIds: Un(t),
1667
+ getSections: () => Ln(e.workbench, t, e.createWhenExpression)
1668
+ });
1669
+ }), zn = (e) => e.metadata.navigationTrees.map((t, n) => {
1670
+ const o = I(t.view);
1671
+ return e.workbench.navigationTrees.registerContribution({
1672
+ id: t.id,
1673
+ idScope: t.id,
1674
+ owner: ue(t.owner),
1675
+ sourceExtensionId: t.extensionId,
1676
+ declarationIndex: e.metadata.navigationItems.length + n,
1677
+ slot: t.slot,
1678
+ viewId: o
2253
1679
  });
2254
- }), Qr = () => {
1680
+ }), Qn = (e) => [...qn(e), ...zn(e)], Gn = () => {
2255
1681
  if (typeof navigator > "u") return;
2256
1682
  const e = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
2257
1683
  if (e.includes("mac")) return "mac";
2258
1684
  if (e.includes("win")) return "win";
2259
1685
  if (e.includes("linux")) return "linux";
2260
- }, Gr = (e, t = Qr()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, Yr = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
2261
- commandId: t.commandId,
2262
- keybinding: Gr(t),
2263
- when: e.createWhenExpression?.(t.when),
2264
- args: t.args
2265
- })), v = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.kind}.${e.id}`, oe = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.command.${e.id}`, ut = (e) => {
2266
- if (!e) return;
2267
- const t = (n) => {
2268
- if (n)
2269
- return Array.isArray(n) ? n.map(v) : v(n);
2270
- };
2271
- return {
2272
- mode: t(e.mode),
2273
- source: e.source,
2274
- viewId: t(e.view),
2275
- resourceType: e.resourceType?.map((n) => n.id),
2276
- metadata: e.metadata
2277
- };
2278
- }, Fo = ut, te = (e, t) => e.resourceViews.find((n) => v(n.view) === t)?.resourceKind.id, Xr = (e, t) => {
2279
- const n = e.placements.flatMap((o) => o.item.kind === "view" && v(o.item.view) === t ? [{
2280
- region: o.region,
2281
- allowedRegions: o.movableTo,
2282
- required: o.required
2283
- }] : []), s = e.resourceViews.filter((o) => v(o.view) === t).flatMap((o) => e.placements.flatMap((i) => i.item.kind === "resource-slot" && i.item.slot.id === o.slot.id && i.item.slot.resourceKind.id === o.resourceKind.id ? [{
2284
- for: o.resourceKind.id,
2285
- region: i.region,
2286
- allowedRegions: i.movableTo,
2287
- required: i.required
2288
- }] : []));
2289
- return [...n, ...s];
2290
- }, mt = (e) => e.body.kind === "webview" ? {
1686
+ }, Yn = (e, t = Gn()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, Xn = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
1687
+ action: j(t.action, {
1688
+ commandIdOf: (n) => n.extensionId ? Z({
1689
+ extensionId: n.extensionId,
1690
+ id: n.id
1691
+ }) : void 0
1692
+ }),
1693
+ keybinding: Yn(t),
1694
+ when: e.createWhenExpression?.(t.when)
1695
+ })), Jn = (e, t) => ({
1696
+ ...e,
1697
+ tab: e.tab && t.createTab ? t.createTab({
1698
+ ...e.tab,
1699
+ extensionId: t.extensionId,
1700
+ placementId: t.placementId
1701
+ }) : void 0
1702
+ }), Zn = (e, t) => e.kind === "panels" ? e : {
1703
+ ...e,
1704
+ tab: e.tab && t.createTab ? t.createTab({
1705
+ ...e.tab,
1706
+ extensionId: t.extensionId,
1707
+ placementId: t.placementId
1708
+ }) : void 0
1709
+ }, eo = (e, t) => e.pages.map((n) => ({
1710
+ id: n.id,
1711
+ ref: {
1712
+ extensionId: n.extensionId,
1713
+ kind: "page",
1714
+ id: n.localId
1715
+ },
1716
+ title: n.title,
1717
+ path: n.path,
1718
+ modeId: I(n.mode),
1719
+ resource: n.resource,
1720
+ main: Zn(n.main, {
1721
+ extensionId: n.extensionId,
1722
+ placementId: `${n.id}.$main`,
1723
+ createTab: t
1724
+ }),
1725
+ slots: n.slots.map((o) => Jn(o, {
1726
+ extensionId: n.extensionId,
1727
+ placementId: `${n.id}.${o.id}`,
1728
+ createTab: t
1729
+ })),
1730
+ ...n.icon ? {
1731
+ icon: n.icon
1732
+ } : {},
1733
+ ...n.parent ? {
1734
+ parentId: I(n.parent)
1735
+ } : {}
1736
+ })), q = (e, t) => {
1737
+ const n = e.pages.flatMap((o) => [...o.main.kind === "view" && o.resource ? [{
1738
+ ...o.resource,
1739
+ view: o.main.view
1740
+ }] : [], ...o.slots.flatMap((r) => r.item.kind === "binding" ? [r.item.binding] : [])]);
1741
+ return n.push(...e.placements.flatMap((o) => o.item.kind === "binding" ? [o.item.binding] : [])), n.find((o) => I(o.view) === t)?.kinds[0]?.id;
1742
+ }, qe = (e) => e.body.kind === "webview" ? {
2291
1743
  webview: e.body.webview
2292
1744
  } : {
2293
1745
  renderer: {
2294
1746
  kind: e.body.kind,
2295
1747
  id: e.id
2296
1748
  }
2297
- }, Jr = (e, t) => e.viewMenus.flatMap((n) => {
2298
- if (v(n.owner) !== t.id) return [];
2299
- const r = e.views.find((s) => s.id === v(n.view));
2300
- return r ? [{
1749
+ }, to = (e, t) => e.viewMenus.flatMap((n) => {
1750
+ if (I(n.owner) !== t.id) return [];
1751
+ const o = e.views.find((r) => r.id === I(n.view));
1752
+ return o ? [{
2301
1753
  id: n.id,
2302
1754
  extensionId: n.extensionId,
2303
1755
  ownerPanelId: t.id,
2304
- title: r.title,
1756
+ viewId: o.id,
1757
+ title: o.title,
2305
1758
  side: n.side,
2306
1759
  group: n.group,
2307
1760
  placement: n.placement,
2308
1761
  hostTreeHeader: n.hostTreeHeader,
2309
1762
  hostTreeFooter: n.hostTreeFooter,
2310
- ...mt(r)
1763
+ ...qe(o)
2311
1764
  }] : [];
2312
- }), Zr = (e) => e.views.map((t) => {
2313
- const n = Xr(e, t.id), r = Jr(e, t);
1765
+ }), no = (e) => e.views.map((t) => {
1766
+ const n = to(e, t);
2314
1767
  return {
2315
1768
  id: t.id,
2316
1769
  extensionId: t.extensionId,
2317
1770
  title: t.title,
2318
- path: t.path,
2319
1771
  icon: t.icon,
2320
- show: n.length === 0 ? void 0 : n.length === 1 ? n[0] : n,
2321
- panelMenus: r.length > 0 ? r : void 0,
2322
- ...mt(t)
1772
+ panelMenus: n.length > 0 ? n : void 0,
1773
+ ...qe(t)
2323
1774
  };
2324
- }), he = (e) => e?.map(({
1775
+ }), de = (e) => e?.map(({
2325
1776
  command: t,
2326
1777
  ...n
2327
1778
  }) => ({
2328
1779
  ...n,
2329
- commandId: oe(t)
2330
- })), eo = (e) => e.views.flatMap((t) => {
1780
+ commandId: Z(t)
1781
+ })), oo = (e) => e.views.flatMap((t) => {
2331
1782
  const n = t.body;
2332
1783
  return n.kind !== "kanban" ? [] : [{
2333
1784
  ...n,
@@ -2335,7 +1786,7 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
2335
1786
  extensionId: t.extensionId,
2336
1787
  title: t.title,
2337
1788
  icon: t.icon,
2338
- resourceKind: te(e, t.id),
1789
+ resourceKind: q(e, t.id),
2339
1790
  createRow: n.createRow ? {
2340
1791
  title: n.createRow.title,
2341
1792
  submitLabel: n.createRow.submitLabel,
@@ -2343,16 +1794,16 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
2343
1794
  params: n.createRow.params,
2344
1795
  attributesParam: n.createRow.attributesParam,
2345
1796
  labels: n.createRow.labels,
2346
- commandId: oe(n.createRow.command),
1797
+ commandId: Z(n.createRow.command),
2347
1798
  attachments: n.createRow.attachments ? {
2348
1799
  resourceParam: n.createRow.attachments.resourceParam,
2349
1800
  fileParam: n.createRow.attachments.fileParam,
2350
- commandId: oe(n.createRow.attachments.command)
1801
+ commandId: Z(n.createRow.attachments.command)
2351
1802
  } : void 0
2352
1803
  } : void 0,
2353
- rowActions: he(n.rowActions)
1804
+ rowActions: de(n.rowActions)
2354
1805
  }];
2355
- }), to = (e) => e.views.flatMap((t) => {
1806
+ }), so = (e) => e.views.flatMap((t) => {
2356
1807
  const n = t.body;
2357
1808
  return n.kind !== "dataTable" ? [] : [{
2358
1809
  ...n,
@@ -2360,213 +1811,181 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
2360
1811
  extensionId: t.extensionId,
2361
1812
  title: t.title,
2362
1813
  icon: t.icon,
2363
- resourceKind: te(e, t.id),
2364
- selectionActions: he(n.selectionActions),
2365
- rowActions: he(n.rowActions)
1814
+ resourceKind: q(e, t.id),
1815
+ selectionActions: de(n.selectionActions),
1816
+ rowActions: de(n.rowActions)
2366
1817
  }];
2367
- }), no = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
1818
+ }), ro = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
2368
1819
  ...t.body,
2369
1820
  id: t.id,
2370
1821
  extensionId: t.extensionId,
2371
1822
  title: t.title,
2372
1823
  icon: t.icon,
2373
- resourceKind: te(e, t.id)
2374
- }] : []), ro = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
1824
+ resourceKind: q(e, t.id)
1825
+ }] : []), io = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
2375
1826
  ...t.body,
2376
1827
  id: t.id,
2377
1828
  extensionId: t.extensionId,
2378
1829
  title: t.title,
2379
1830
  icon: t.icon,
2380
- resourceKind: te(e, t.id)
2381
- }] : []), oo = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
1831
+ resourceKind: q(e, t.id)
1832
+ }] : []), ao = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
2382
1833
  ...t.body,
2383
1834
  id: t.id,
2384
1835
  extensionId: t.extensionId,
2385
1836
  title: t.title,
2386
1837
  icon: t.icon,
2387
- resourceKind: te(e, t.id)
2388
- }] : []), so = (e) => e.modes.map((t) => {
2389
- const n = e.placements.filter((i) => v(i.mode) === t.id), r = [...new Set(n.flatMap((i) => [i.region, ...i.movableTo ?? []]))].filter((i) => i !== "sidenav"), s = Object.fromEntries(n.flatMap((i) => i.item.kind === "view" ? [[v(i.item.view), {
2390
- region: i.region,
2391
- allowedRegions: i.movableTo,
2392
- required: i.required,
2393
- defaultOpen: i.required ? !0 : i.defaultOpen
2394
- }]] : [])), o = Object.fromEntries(e.resourceKinds.flatMap((i) => {
2395
- const a = Object.fromEntries(n.flatMap((d) => d.item.kind === "resource-slot" && d.item.slot.resourceKind.id === i.id ? [[d.item.slot.id, {
2396
- region: d.region,
2397
- allowedRegions: d.movableTo,
2398
- required: d.required,
2399
- defaultOpen: d.required ? !0 : d.defaultOpen
2400
- }]] : []));
2401
- return Object.keys(a).length > 0 ? [[i.id, {
2402
- slots: a
2403
- }]] : [];
2404
- }));
2405
- return {
2406
- id: t.id,
2407
- extensionId: t.extensionId,
2408
- modeId: t.id,
2409
- label: t.label,
2410
- icon: t.icon,
2411
- panelRegions: r.length > 0 ? r : void 0,
2412
- resources: o,
2413
- modePanels: s
2414
- };
2415
- }), io = (e) => {
2416
- const t = Zr(e);
1838
+ resourceKind: q(e, t.id)
1839
+ }] : []), co = (e) => e.modes.map((t) => ({
1840
+ id: t.id,
1841
+ extensionId: t.extensionId,
1842
+ modeId: t.id,
1843
+ label: t.label,
1844
+ icon: t.icon,
1845
+ panelRegions: t.regions,
1846
+ regionSettings: t.regionSettings,
1847
+ floatingPanels: t.floatingPanels,
1848
+ ...t.defaultTheme ? {
1849
+ defaultTheme: I(t.defaultTheme)
1850
+ } : {},
1851
+ ...t.chrome ? {
1852
+ chrome: Object.fromEntries(Object.entries(t.chrome).map(([n, o]) => [n, o === !1 ? !1 : I(o)]))
1853
+ } : {}
1854
+ })), lo = (e, t = {}) => {
1855
+ const n = no(e);
2417
1856
  return {
2418
1857
  extensions: e.extensions,
2419
1858
  commands: e.commands,
2420
1859
  menuContributions: e.menuContributions,
2421
1860
  commandPaletteContributions: e.commandPaletteContributions,
2422
- modes: so(e),
2423
- panels: t,
2424
- resourceKinds: e.resourceKinds.map((n) => ({
2425
- id: n.id,
2426
- extensionId: n.extensionId,
2427
- surface: n.surface,
2428
- label: n.label,
2429
- icon: n.icon,
2430
- slots: Object.fromEntries((n.slots ?? []).map((r) => [r.id, {
2431
- cardinality: r.cardinality,
2432
- external: r.access === "public"
2433
- }])),
2434
- menuSlots: Object.fromEntries((n.menuSlots ?? []).map((r) => [r.id, {
1861
+ modes: co(e),
1862
+ pages: eo(e, t.createTab),
1863
+ placements: e.placements.map((o) => ({
1864
+ id: o.id,
1865
+ ref: {
1866
+ extensionId: o.extensionId,
1867
+ kind: "placement",
1868
+ id: o.localId
1869
+ },
1870
+ modeId: I(o.mode),
1871
+ item: o.item,
1872
+ region: o.region,
1873
+ order: o.order,
1874
+ movableTo: o.movableTo,
1875
+ mountStrategy: o.mountStrategy,
1876
+ hiddenByDefault: o.hiddenByDefault,
1877
+ headerBorderBottom: o.headerBorderBottom,
1878
+ tab: o.tab && t.createTab ? t.createTab({
1879
+ ...o.tab,
1880
+ extensionId: o.extensionId,
1881
+ placementId: o.id
1882
+ }) : void 0
1883
+ })),
1884
+ panels: n,
1885
+ resourceKinds: e.resourceKinds.map((o) => ({
1886
+ id: o.id,
1887
+ extensionId: o.extensionId,
1888
+ label: o.label,
1889
+ icon: o.icon,
1890
+ menuSlots: Object.fromEntries((o.menuSlots ?? []).map((r) => [r.id, {
2435
1891
  placement: r.placement,
2436
1892
  label: r.label,
2437
1893
  external: r.access === "public",
2438
1894
  order: r.order
2439
1895
  }]))
2440
1896
  })),
2441
- resourcePanels: e.resourceViews.map((n) => ({
2442
- id: n.id,
2443
- extensionId: n.extensionId,
2444
- resourceKind: n.resourceKind.id,
2445
- panel: v(n.view),
2446
- slot: n.slot.id
2447
- })),
2448
- resourceHierarchyProviders: (e.resourceHierarchyProviders ?? []).map((n) => ({
2449
- id: n.id,
2450
- extensionId: n.extensionId,
2451
- resourceKind: n.resourceKind.id
2452
- })),
2453
- routes: [],
2454
- treeItems: [],
2455
- activityItems: (e.activityItems ?? []).map((n) => ({
2456
- id: n.id,
2457
- extensionId: n.extensionId,
2458
- title: n.title,
2459
- icon: n.icon,
2460
- modes: n.modes.map(v),
2461
- placement: n.placement,
2462
- commandId: oe(n.command),
2463
- params: n.params
1897
+ resourceHierarchyProviders: (e.resourceHierarchyProviders ?? []).map((o) => ({
1898
+ id: o.id,
1899
+ extensionId: o.extensionId,
1900
+ resourceKind: o.resourceKind.id
2464
1901
  })),
2465
1902
  settingsSections: e.settingsSections ?? [],
2466
- settingsPanels: e.settingsPanels.flatMap((n) => {
2467
- const r = e.views.find((s) => s.id === v(n.view));
2468
- return !r || r.body.kind !== "webview" ? [] : [{
2469
- id: n.id,
2470
- extensionId: n.extensionId,
2471
- slotId: n.slot.id,
2472
- scope: n.slot.id.includes("global") ? "global" : "project",
1903
+ settingsPanels: e.settingsPanels.flatMap((o) => {
1904
+ const r = e.views.find((s) => s.id === I(o.view));
1905
+ return r ? [{
1906
+ id: o.id,
1907
+ viewId: r.id,
1908
+ extensionId: o.extensionId,
1909
+ slotId: o.slot.id,
1910
+ scope: o.slot.id.includes("global") ? "global" : "project",
2473
1911
  title: r.title,
2474
1912
  icon: r.icon,
2475
- section: n.section ? v(n.section) : void 0,
2476
- webview: r.body.webview
2477
- }];
1913
+ section: o.section ? I(o.section) : void 0
1914
+ }] : [];
2478
1915
  }),
2479
- kanbanRenderers: eo(e),
2480
- dataTableRenderers: to(e),
1916
+ kanbanRenderers: oo(e),
1917
+ dataTableRenderers: so(e),
2481
1918
  commandPaletteResources: e.commandPaletteResources ?? [],
2482
- treeRenderers: no(e),
2483
- fileRenderers: ro(e),
2484
- controlsRenderers: oo(e),
1919
+ treeRenderers: ro(e),
1920
+ fileRenderers: io(e),
1921
+ controlsRenderers: ao(e),
2485
1922
  keybindings: e.keybindings ?? [],
2486
1923
  settingsDefinitions: e.settingsDefinitions ?? [],
2487
1924
  statuses: e.statuses,
2488
- statusBarItems: e.statusBarItems.map((n) => ({
2489
- id: n.id,
2490
- extensionId: n.extensionId,
2491
- viewId: v(n.view),
2492
- slot: n.slot.id.endsWith("leading") ? "leading" : "trailing",
2493
- order: n.order,
2494
- when: ut(n.when)
1925
+ statusBarItems: e.statusBarItems.map((o) => ({
1926
+ id: o.id,
1927
+ extensionId: o.extensionId,
1928
+ viewId: I(o.view),
1929
+ slot: o.slot.id.endsWith("leading") ? "leading" : "trailing",
1930
+ order: o.order,
1931
+ when: Ue(o.when)
2495
1932
  })),
2496
1933
  diagnostics: e.diagnostics
2497
1934
  };
2498
- }, ao = (e, t, n = {}) => {
2499
- t.kind === "tree" && e.renderers.refresh(t.id), t.kind === "file" && e.renderers.refreshFileRenderer(t.id, n), t.kind === "controls" && e.renderers.refreshControlsRenderer(t.id), t.kind === "dataTable" && e.renderers.refreshDataTableRenderer(t.id), t.kind === "kanban" && e.renderers.refreshKanbanRenderer(t.id);
2500
- }, co = (e) => {
2501
- const t = /* @__PURE__ */ new Map(), n = (r, s) => {
2502
- for (const o of new Set(s.refreshEventIds ?? [])) {
2503
- const i = t.get(o) ?? [];
2504
- i.some((a) => a.kind === r && a.id === s.id) || i.push({
2505
- id: s.id,
2506
- kind: r
2507
- }), t.set(o, i);
1935
+ }, mo = (e, t, n = {}) => {
1936
+ e.views.refreshView(t.id, t.kind === "file" ? n : void 0);
1937
+ }, uo = (e) => {
1938
+ const t = /* @__PURE__ */ new Map(), n = (o, r) => {
1939
+ for (const s of new Set(r.refreshEventIds ?? [])) {
1940
+ const i = t.get(s) ?? [];
1941
+ i.some((a) => a.kind === o && a.id === r.id) || i.push({
1942
+ id: r.id,
1943
+ kind: o
1944
+ }), t.set(s, i);
2508
1945
  }
2509
1946
  };
2510
- for (const r of e.views)
2511
- r.body.kind !== "webview" && n(r.body.kind, {
2512
- id: r.id,
2513
- refreshEventIds: r.body.refreshEventIds
1947
+ for (const o of e.views)
1948
+ o.body.kind !== "webview" && n(o.body.kind, {
1949
+ id: o.id,
1950
+ refreshEventIds: o.body.refreshEventIds
2514
1951
  });
2515
1952
  return t;
2516
- }, lo = (e) => {
2517
- const t = co(e.metadata);
1953
+ }, po = (e) => {
1954
+ const t = uo(e.metadata);
2518
1955
  return e.subscribe((n) => {
2519
1956
  const {
2520
- id: r,
2521
- ...s
1957
+ id: o,
1958
+ ...r
2522
1959
  } = n;
2523
- for (const o of t.get(r) ?? []) ao(e.workbench, o, s);
1960
+ for (const s of t.get(o) ?? []) mo(e.workbench, s, r);
2524
1961
  });
2525
- }, uo = (e, t) => e.layout.listPanelInstances().find((n) => n.panelId === t), mo = (e, t) => {
2526
- if (t)
2527
- try {
2528
- e.layout.activatePanel(t);
2529
- } catch {
2530
- }
2531
- }, No = (e, t) => {
2532
- const n = e.layout.getLayout().activeWidgetId;
2533
- for (const r of t.views) {
2534
- if (r.body.kind !== "webview") continue;
2535
- const s = uo(e, r.id);
2536
- s && e.layout.openPanel(r.id, {
2537
- resource: s.resource,
2538
- title: p(r.title, s.title),
2539
- strategy: {
2540
- kind: "replace-panel",
2541
- instanceId: s.instanceId
2542
- }
2543
- });
2544
- }
2545
- mo(e, n);
2546
- }, po = (e) => (t) => ({
2547
- ...ze({
1962
+ }, Go = (e, t) => {
1963
+ for (const n of t.views)
1964
+ n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
1965
+ }, bo = (e) => (t) => ({
1966
+ ...Tt({
2548
1967
  workbench: t.workbench,
1968
+ placement: t.placement,
2549
1969
  hostEvents: t.hostEvents
2550
1970
  }),
2551
- // Extension guests speak the SDK resource shape (`type`); normalize to the
2552
- // workbench shape (`kind` + synthesized uri) the resource registry expects,
2553
- // mirroring how commands.execute and tree targets normalize their resources.
2554
- "resource.open": (r) => {
2555
- const s = r;
2556
- if (!s.resource) throw new Error("resource.open requires a resource.");
2557
- return t.workbench.resources.openResource(J(s.resource), qe(s.input));
1971
+ "navigation.open": (o) => {
1972
+ const r = o;
1973
+ if (!r.target) throw new Error("navigation.open requires a target.");
1974
+ return t.workbench.navigation.openTarget(j(r.target, {
1975
+ extensionId: e.extensionIdForWebview(t.webviewId)
1976
+ }));
2558
1977
  },
2559
- "commands.execute": async (r) => {
2560
- const s = r, o = s.resource ?? D(t.placement.resource);
2561
- return e.executeCommand(s.commandId, {
1978
+ "commands.execute": async (o) => {
1979
+ const r = o, s = r.resource ?? t.placement.resource;
1980
+ return e.executeCommand(r.commandId, {
2562
1981
  projectId: e.projectId,
2563
- ...s.params ? {
2564
- params: s.params
1982
+ ...r.params ? {
1983
+ params: r.params
2565
1984
  } : {},
2566
- ...o ? {
2567
- resource: o
1985
+ ...s ? {
1986
+ resource: s
2568
1987
  } : {},
2569
- slot: B({
1988
+ slot: D({
2570
1989
  id: t.webviewId,
2571
1990
  kind: e.slotKind,
2572
1991
  projectId: e.projectId,
@@ -2581,283 +2000,394 @@ const en = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
2581
2000
  "files.upload": e.files.upload,
2582
2001
  "files.list": e.files.list,
2583
2002
  "files.delete": e.files.delete
2003
+ } : {},
2004
+ ...e.artifacts ? {
2005
+ // The image-url grant is bound to the requesting webview, so the host
2006
+ // resolves the webview id instead of trusting the guest to name one.
2007
+ "artifacts.read": (o) => e.artifacts.read(o, {
2008
+ webviewId: t.webviewId
2009
+ })
2584
2010
  } : {}
2585
- }), pt = "extensions", fo = 1e3, bo = 25, go = (e) => e === void 0 ? void 0 : e, ho = (e) => e === "global" ? "user" : "project", wo = (e, t) => t ? (n) => ({
2011
+ }), fo = (e) => ({
2012
+ title: b(e.title) || void 0,
2013
+ runtimeUrl: e.runtimeUrl,
2014
+ moduleUrl: e.moduleUrl,
2015
+ styles: e.styles,
2016
+ capabilities: e.capabilities
2017
+ }), ze = "extensions", ho = 1e3, go = 25, wo = (e) => e === void 0 ? void 0 : e, Io = (e) => e === "global" ? "user" : "project", yo = (e, t) => t ? (n) => ({
2586
2018
  ...e(n),
2587
2019
  ...t(n)
2588
- }) : e, ft = (e, t) => {
2589
- const n = e.createWebviewHostCapabilities ?? po({
2020
+ }) : e, vo = (e, t) => {
2021
+ const n = e.createWebviewHostCapabilities ?? bo({
2022
+ artifacts: e.webviewArtifacts,
2590
2023
  executeCommand: e.executeCommand,
2024
+ extensionIdForWebview: (o) => e.metadata.panels.find((r) => r.id === o)?.extensionId,
2591
2025
  files: e.webviewFiles,
2592
2026
  projectId: e.projectId,
2593
2027
  slotKind: t
2594
2028
  });
2595
- return wo(n, e.createWebviewHostCapabilityOverrides);
2596
- }, Io = (e) => e.workbench.renderers.getRenderer(se) ? [] : [e.workbench.renderers.registerRenderer(Xt({
2597
- createHostCapabilities: ft(e, "panel"),
2598
- createProps: e.createWebviewProps,
2599
- createTheme: e.createWebviewTheme
2600
- }))], yo = (e) => {
2601
- const t = L(e.metadata.panels);
2602
- return e.metadata.panels.flatMap((n, r) => n.webview ? [U({
2603
- workbench: e.workbench,
2604
- path: n.path,
2605
- aliases: n.aliases,
2606
- resolveInput: F(e.resolveViewInput, n),
2607
- contribution: N({
2608
- panel: n,
2609
- rendererId: se,
2610
- declarationIndex: r,
2611
- menuDeclarationOffset: t[r],
2612
- resourcePanels: e.metadata.resourcePanels,
2613
- config: ve(n.webview)
2614
- })
2615
- })] : []);
2616
- }, Ne = (e) => {
2029
+ return yo(n, e.createWebviewHostCapabilityOverrides);
2030
+ }, ko = (e) => e.metadata.panels.flatMap((t) => {
2031
+ if (!t.webview) return [];
2032
+ const n = fo(t.webview);
2033
+ return [e.workbench.views.registerView({
2034
+ id: t.id,
2035
+ title: b(t.title, t.id),
2036
+ icon: t.icon,
2037
+ body: {
2038
+ kind: "react",
2039
+ render: (o) => {
2040
+ const r = e.metadata.settingsPanels.some((s) => s.id === o.instance.panelId && s.viewId === t.id) ? "settings" : "panel";
2041
+ return e.renderWebview?.(o) ?? Wt({
2042
+ context: {
2043
+ workbench: o.workbench,
2044
+ webviewId: t.id,
2045
+ placement: o.instance,
2046
+ hostEvents: Ht(o.workbench, o.instance)
2047
+ },
2048
+ createHostCapabilities: vo(e, r),
2049
+ createProps: e.createWebviewProps ?? (({
2050
+ placement: s
2051
+ }) => ({
2052
+ placement: s,
2053
+ resource: s.resource
2054
+ })),
2055
+ createTheme: e.createWebviewTheme,
2056
+ ownerId: t.extensionId,
2057
+ title: b(t.title, t.id),
2058
+ webview: n
2059
+ });
2060
+ }
2061
+ }
2062
+ })];
2063
+ }), xo = {
2064
+ first: 1e6,
2065
+ default: 0,
2066
+ last: -1e6
2067
+ }, Ro = (e) => e.metadata.panels.flatMap((t) => t.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
2068
+ id: t.id,
2069
+ ownerViewId: t.ownerPanelId,
2070
+ viewId: t.viewId,
2071
+ side: t.side,
2072
+ priority: xo[t.placement ?? "default"] - n
2073
+ })), Ce = (e) => {
2617
2074
  if (!e || typeof e != "object" || !("statuses" in e) || !Array.isArray(e.statuses))
2618
2075
  throw new Error("Status provider returned an invalid response");
2619
2076
  return e.statuses;
2620
- }, vo = (e, t) => {
2077
+ }, Eo = (e, t) => {
2621
2078
  const n = e.metadata.statuses ?? [];
2622
2079
  if (n.length === 0) return [];
2623
- const r = n.map((s, o) => e.workbench.statuses.registerStatusSet({
2080
+ const o = "workbench.extension-statuses.settings", r = n.map((s, i) => e.workbench.statuses.registerStatusSet({
2624
2081
  id: s.id,
2625
- title: p(s.title, s.id),
2626
- actions: s.actions?.map((i) => ({
2627
- id: i.id,
2628
- label: p(i.label, i.id),
2629
- icon: i.icon
2082
+ title: b(s.title, s.id),
2083
+ actions: s.actions?.map((a) => ({
2084
+ id: a.id,
2085
+ label: b(a.label, a.id),
2086
+ icon: a.icon
2630
2087
  })),
2631
- query: async () => Ne(await P(t, s.queryHandlerId, {
2088
+ query: async () => Ce(await E(t, s.queryHandlerId, {
2632
2089
  params: {}
2633
2090
  })),
2634
- save: s.saveHandlerId ? async (i) => Ne(await P(t, s.saveHandlerId, {
2091
+ save: s.saveHandlerId ? async (a) => Ce(await E(t, s.saveHandlerId, {
2635
2092
  params: {
2636
- statuses: i
2093
+ statuses: a
2637
2094
  }
2638
2095
  })) : void 0
2639
2096
  }, {
2640
2097
  ownerId: s.extensionId,
2641
- priority: -o
2098
+ priority: -i
2642
2099
  }));
2643
- return r.push(e.workbench.settings.registerPanel({
2100
+ return r.push(e.workbench.views.registerView({
2101
+ id: o,
2102
+ title: "Statuses",
2103
+ body: {
2104
+ kind: "react",
2105
+ render: () => V(it, {
2106
+ workbench: e.workbench
2107
+ })
2108
+ }
2109
+ })), r.push(e.workbench.settings.registerPanel({
2644
2110
  id: "workbench.statuses",
2645
2111
  title: "Statuses",
2646
2112
  icon: "list-checks",
2647
- kind: "custom",
2648
- order: bo,
2649
- section: e.settingsSectionId ?? pt,
2113
+ kind: "view",
2114
+ order: go,
2115
+ section: e.settingsSectionId ?? ze,
2650
2116
  scope: "project",
2651
- render: () => K(Rt, {
2652
- workbench: e.workbench
2653
- })
2117
+ viewId: o
2654
2118
  })), r;
2655
- }, ko = (e) => {
2656
- const t = [], n = e.settingsSectionId ?? pt;
2119
+ }, Ao = (e) => {
2120
+ const t = [], n = e.settingsSectionId ?? ze;
2657
2121
  e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
2658
2122
  id: n,
2659
2123
  title: e.settingsSectionTitle ?? "Extensions"
2660
2124
  }));
2661
- const r = [...e.metadata.settingsSections].sort((i, a) => (i.order ?? 0) - (a.order ?? 0) || i.extensionId.localeCompare(a.extensionId) || i.id.localeCompare(a.id));
2662
- for (const i of r)
2125
+ const o = [...e.metadata.settingsSections].sort((i, a) => (i.order ?? 0) - (a.order ?? 0) || i.extensionId.localeCompare(a.extensionId) || i.id.localeCompare(a.id));
2126
+ for (const i of o)
2663
2127
  t.push(e.workbench.settings.registerSection({
2664
2128
  id: i.id,
2665
- title: p(i.title, i.id),
2129
+ title: b(i.title, i.id),
2666
2130
  order: i.order,
2667
2131
  scope: i.scope
2668
2132
  }));
2669
- const s = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((i) => [i.key, {
2133
+ const r = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((i) => [i.key, {
2670
2134
  type: i.type,
2671
- scope: ho(i.scope),
2672
- default: go(i.default),
2135
+ scope: Io(i.scope),
2136
+ default: wo(i.default),
2673
2137
  enum: i.enum,
2674
- description: p(i.description)
2138
+ description: b(i.description)
2675
2139
  }]));
2676
- Object.keys(s).length > 0 && t.push(e.workbench.preferences.registerSchema({
2677
- properties: s
2140
+ Object.keys(r).length > 0 && t.push(e.workbench.preferences.registerSchema({
2141
+ properties: r
2678
2142
  }));
2679
- const o = [...e.metadata.settingsPanels].sort((i, a) => i.extensionId.localeCompare(a.extensionId) || i.id.localeCompare(a.id));
2680
- for (const [i, a] of o.entries())
2143
+ const s = [...e.metadata.settingsPanels].sort((i, a) => i.extensionId.localeCompare(a.extensionId) || i.id.localeCompare(a.id));
2144
+ for (const [i, a] of s.entries())
2681
2145
  t.push(e.workbench.settings.registerPanel({
2682
2146
  id: a.id,
2683
- title: p(a.title, a.id),
2147
+ title: b(a.title, a.id),
2684
2148
  icon: a.icon,
2685
- kind: "custom",
2686
- order: fo + i,
2149
+ kind: "view",
2150
+ order: ho + i,
2687
2151
  section: a.section ?? n,
2688
2152
  scope: a.scope,
2689
- render: (d) => Ye({
2690
- context: {
2691
- workbench: d.workbench,
2692
- webviewId: a.id,
2693
- placement: {
2694
- ...d.instance,
2695
- panelId: a.id
2696
- },
2697
- hostEvents: Ge(d.workbench, d.instance)
2698
- },
2699
- createHostCapabilities: ft(e, "settings"),
2700
- createProps: e.createWebviewProps ?? (({
2701
- placement: u
2702
- }) => ({
2703
- placement: u,
2704
- resource: u.resource
2705
- })),
2706
- createTheme: e.createWebviewTheme,
2707
- ownerId: a.extensionId,
2708
- title: p(a.title, a.id),
2709
- webview: ve(a.webview)
2710
- })
2153
+ viewId: a.viewId
2711
2154
  }));
2712
2155
  return t;
2713
- }, Ro = (e) => {
2156
+ }, M = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), Co = (e, t) => {
2157
+ if (!M(e)) return {};
2158
+ const n = M(e.indicator) ? {
2159
+ icon: String(e.indicator.icon ?? ""),
2160
+ color: typeof e.indicator.color == "string" ? e.indicator.color : void 0,
2161
+ label: b(e.indicator.label)
2162
+ } : void 0, o = Array.isArray(e.menu) ? e.menu.flatMap((r) => !M(r) || typeof r.id != "string" || !Array.isArray(r.rows) ? [] : [{
2163
+ id: r.id,
2164
+ rows: r.rows.flatMap((s) => {
2165
+ if (!M(s) || typeof s.id != "string") return [];
2166
+ const i = me(s.action, {
2167
+ extensionId: t
2168
+ });
2169
+ return [{
2170
+ id: s.id,
2171
+ label: b(s.label, s.id),
2172
+ icon: typeof s.icon == "string" ? s.icon : void 0,
2173
+ iconColor: typeof s.iconColor == "string" ? s.iconColor : void 0,
2174
+ selected: s.selected === !0,
2175
+ disabled: s.disabled === !0,
2176
+ action: i ? {
2177
+ kind: "navigation",
2178
+ target: i
2179
+ } : void 0
2180
+ }];
2181
+ })
2182
+ }]) : void 0;
2183
+ return {
2184
+ label: b(e.label),
2185
+ icon: typeof e.icon == "string" ? e.icon : void 0,
2186
+ indicator: n?.icon ? n : void 0,
2187
+ menu: o
2188
+ };
2189
+ }, So = (e, t) => {
2190
+ const n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = new Set(t.refreshEventIds ?? []), i = (a) => {
2191
+ if (o.has(a.instanceId)) return;
2192
+ o.add(a.instanceId);
2193
+ const d = a.resource ? {
2194
+ type: a.resource.type,
2195
+ id: a.resource.id ?? B(a.resource),
2196
+ label: a.resource.label,
2197
+ metadata: a.resource.metadata
2198
+ } : void 0;
2199
+ Promise.resolve(e.executeCommand(t.queryHandlerId, {
2200
+ projectId: e.projectId,
2201
+ source: "dashboard",
2202
+ resource: d,
2203
+ params: {
2204
+ renderer: {
2205
+ rendererId: t.placementId,
2206
+ projectId: e.projectId,
2207
+ ...d ? {
2208
+ resource: d
2209
+ } : {},
2210
+ invocation: {
2211
+ placement: "visible"
2212
+ }
2213
+ }
2214
+ }
2215
+ })).then((m) => {
2216
+ const l = M(m) && M(m.outcome) ? m.outcome.value : m;
2217
+ n.set(a.instanceId, Co(l, t.extensionId));
2218
+ for (const c of r) c();
2219
+ }).finally(() => o.delete(a.instanceId));
2220
+ };
2221
+ return {
2222
+ refreshEvents: t.refreshEventIds,
2223
+ getSnapshot(a) {
2224
+ return i(a), n.get(a.instanceId) ?? {};
2225
+ },
2226
+ subscribe(a) {
2227
+ r.add(a);
2228
+ const d = e.subscribeRefreshEvents?.((l) => {
2229
+ s.has(l.id) && (n.clear(), a());
2230
+ });
2231
+ return {
2232
+ dispose() {
2233
+ r.delete(a), d?.dispose();
2234
+ }
2235
+ };
2236
+ }
2237
+ };
2238
+ }, Se = (e) => {
2714
2239
  for (let t = e.length - 1; t >= 0; t -= 1) e[t]?.dispose();
2715
- }, ke = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Re = (e, t, n, r, s) => e.prepareCommandArgs?.(t, n, r, s) ?? n, Co = (e, t) => t.commands.map((n) => e.workbench.commands.registerCommand({
2240
+ }, pe = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, be = (e, t, n, o, r) => e.prepareCommandArgs?.(t, n, o, r) ?? n, To = (e, t) => t.commands.map((n) => e.workbench.commands.registerCommand({
2716
2241
  id: n.id,
2717
- label: p(n.title, n.id),
2718
- description: p(n.description),
2242
+ label: b(n.title, n.id),
2243
+ description: b(n.description),
2719
2244
  params: n.params
2720
2245
  }, {
2721
- prepareArgs: (r, s, o) => Re(e, n.id, r, s, o),
2722
- execute: (r, s) => P(e, n.id, {
2723
- params: ke(r),
2724
- resource: s?.resource
2246
+ prepareArgs: (o, r, s) => be(e, n.id, o, r, s),
2247
+ execute: (o, r) => E(e, n.id, {
2248
+ params: pe(o),
2249
+ resource: r?.resource
2725
2250
  })
2726
- })), bt = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), xo = (e, t) => {
2251
+ })), Qe = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Po = (e, t) => {
2727
2252
  if (!e.menuSlotsById) return [];
2728
2253
  const {
2729
2254
  registrations: n
2730
- } = qn({
2255
+ } = on({
2731
2256
  metadata: e.metadata,
2732
2257
  menuSlotsById: e.menuSlotsById,
2733
2258
  menuTargetsById: e.menuTargetsById,
2734
2259
  createWhenExpression: e.createMenuWhenExpression
2735
- }), r = n.map(({
2736
- menuItem: o,
2260
+ }), o = n.map(({
2261
+ menuItem: s,
2737
2262
  menuPath: i,
2738
2263
  ...a
2739
2264
  }) => ({
2740
2265
  ...a,
2741
2266
  menuItems: [{
2742
- menuItem: o,
2267
+ menuItem: s,
2743
2268
  menuPath: i
2744
2269
  }]
2745
2270
  }));
2746
- return (e.menuRegistrations ?? r).flatMap((o) => [e.workbench.commands.registerCommand(o.command, {
2747
- prepareArgs: (i, a, d) => Re(t, o.targetCommandId, i, a, d),
2748
- execute: (i, a) => P(t, o.targetCommandId, {
2271
+ return (e.menuRegistrations ?? o).flatMap((s) => [e.workbench.commands.registerCommand(s.command, {
2272
+ prepareArgs: (i, a, d) => be(t, s.targetCommandId, i, a, d),
2273
+ execute: (i, a) => E(t, s.targetCommandId, {
2749
2274
  params: {
2750
- ...o.contribution.params ?? {},
2751
- ...ke(i) ?? {}
2275
+ ...s.contribution.params ?? {},
2276
+ ...pe(i) ?? {}
2752
2277
  },
2753
- resource: bt(e, a),
2754
- slot: B({
2755
- id: o.contribution.slotId,
2278
+ resource: Qe(e, a),
2279
+ slot: D({
2280
+ id: s.contribution.slotId,
2756
2281
  kind: "menu",
2757
2282
  projectId: e.projectId,
2758
2283
  context: {
2759
- panelId: o.contribution.id
2284
+ panelId: s.contribution.id
2760
2285
  }
2761
2286
  })
2762
2287
  })
2763
- }), ...o.menuItems.map(({
2288
+ }), ...s.menuItems.map(({
2764
2289
  menuPath: i,
2765
2290
  menuItem: a
2766
2291
  }) => e.workbench.layout.registerMenuItem(i, a))]);
2767
- }, Eo = (e, t) => zn({
2292
+ }, jo = (e, t) => sn({
2768
2293
  metadata: e.metadata
2769
- }).flatMap((r) => [e.workbench.commands.registerCommand(r.command, {
2770
- prepareArgs: (s, o, i) => Re(t, r.targetCommandId, s, o, i),
2771
- execute: (s, o) => P(t, r.targetCommandId, {
2294
+ }).flatMap((o) => [e.workbench.commands.registerCommand(o.command, {
2295
+ prepareArgs: (r, s, i) => be(t, o.targetCommandId, r, s, i),
2296
+ execute: (r, s) => E(t, o.targetCommandId, {
2772
2297
  params: {
2773
- ...r.contribution.params ?? {},
2774
- ...ke(s) ?? {}
2298
+ ...o.contribution.params ?? {},
2299
+ ...pe(r) ?? {}
2775
2300
  },
2776
- resource: bt(e, o),
2777
- slot: B({
2301
+ resource: Qe(e, s),
2302
+ slot: D({
2778
2303
  id: "workbench.commandPalette",
2779
2304
  kind: "menu",
2780
2305
  projectId: e.projectId,
2781
2306
  context: {
2782
- panelId: r.contribution.id
2307
+ panelId: o.contribution.id
2783
2308
  }
2784
2309
  })
2785
2310
  }),
2786
- isVisible: () => xt(r.contribution.when, e.workbench.getPrimaryResource()?.kind)
2787
- }), e.workbench.layout.registerMenuItem(kt, r.menuItem)]), Po = (e, t) => {
2311
+ isVisible: () => st(o.contribution.when, e.workbench.getPrimaryResource()?.type)
2312
+ }), e.workbench.layout.registerMenuItem(dt, o.menuItem)]), $o = (e, t) => {
2788
2313
  const n = t?.mode;
2789
2314
  if (!n) return !0;
2790
- const r = e.workbench.modes.getActiveModeId() ?? "";
2791
- return Array.isArray(n) ? n.includes(r) : n === r;
2792
- }, Ao = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
2315
+ const o = e.workbench.modes.getActiveModeId() ?? "";
2316
+ return Array.isArray(n) ? n.includes(o) : n === o;
2317
+ }, Ho = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
2793
2318
  id: t.id,
2794
2319
  viewId: t.viewId,
2795
2320
  slot: t.slot,
2796
2321
  order: t.order,
2797
- isVisible: () => Po(e, t.when)
2798
- })), Lo = (e) => {
2322
+ isVisible: () => $o(e, t.when)
2323
+ })), Wo = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), Mo = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
2324
+ kind: t.id,
2325
+ label: b(t.label, t.id),
2326
+ icon: t.icon ?? "FileText"
2327
+ })), Bo = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
2328
+ id: t.modeId,
2329
+ label: b(t.label, t.modeId),
2330
+ panels: t.panelRegions,
2331
+ regionSettings: t.regionSettings,
2332
+ floatingPanels: t.floatingPanels,
2333
+ defaultTheme: t.defaultTheme,
2334
+ chrome: t.chrome,
2335
+ activate: () => {
2336
+ }
2337
+ })), Vo = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), Yo = (e) => {
2799
2338
  const t = {
2800
2339
  ...e,
2801
- metadata: io(e.metadata)
2802
- }, n = [], r = t;
2803
- n.push(...Io(t)), n.push(...Co(r, t.metadata)), n.push(...Yr({
2804
- bindings: t.metadata.keybindings,
2805
- createWhenExpression: t.createKeybindingWhenExpression,
2806
- workbench: t.workbench
2807
- })), n.push(...xo(t, r)), n.push(...Eo(t, r)), n.push(Or({
2808
- ...t,
2809
- resolveNodeResource: t.resolveTreeNodeResource
2810
- })), n.push(Jn(t)), n.push(Hn(r, t.metadata.controlsRenderers ?? [], t.metadata.panels, {
2811
- resolveViewInput: t.resolveViewInput
2812
- }, t.metadata.resourcePanels)), n.push(...yo(t)), n.push(...ko(t)), n.push(...vo(t, r)), n.push(kr(r, t.metadata.kanbanRenderers ?? [], {
2813
- ...t.kanbanAdapter,
2814
- resolveViewInput: t.resolveViewInput
2815
- }, t.metadata.panels, t.metadata.resourcePanels)), n.push(Bn(r, t.metadata.dataTableRenderers ?? [], t.metadata.panels, t.metadata.resourcePanels, t.resolveViewInput)), n.push(hn(r, t.metadata.commandPaletteResources ?? [])), n.push(...Dr({
2816
- metadata: e.metadata,
2817
- workbench: e.workbench
2818
- })), e.subscribeRefreshEvents && n.push(lo({
2819
- metadata: e.metadata,
2820
- subscribe: e.subscribeRefreshEvents,
2821
- workbench: e.workbench
2822
- })), n.push(...Ao(t)), n.push(...Ur(t));
2823
- const s = _r(t);
2824
- return n.push(...s.disposables), n.push(...zr(t, s.registry)), {
2825
- dispose() {
2826
- Ro(n);
2827
- }
2828
- };
2340
+ metadata: lo(e.metadata, {
2341
+ createTab: (r) => So(e, r)
2342
+ })
2343
+ }, n = [], o = t;
2344
+ try {
2345
+ return n.push(...To(o, t.metadata)), n.push(...Xn({
2346
+ bindings: t.metadata.keybindings,
2347
+ createWhenExpression: t.createKeybindingWhenExpression,
2348
+ workbench: t.workbench
2349
+ })), n.push(...Po(t, o)), n.push(...jo(t, o)), n.push(Fn({
2350
+ ...t,
2351
+ resolveNodeResource: t.resolveTreeNodeResource
2352
+ })), n.push(dn(t)), n.push(zt(o, t.metadata.controlsRenderers ?? [])), n.push(...ko(t)), n.push(...Ao(t)), n.push(...Eo(t, o)), n.push(jn(o, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(Xt(o, t.metadata.dataTableRenderers ?? [])), n.push(...Ro(t)), n.push(Ut(o, t.metadata.commandPaletteResources ?? [])), n.push(...Qn({
2353
+ createWhenExpression: e.createNavigationWhenExpression,
2354
+ metadata: e.metadata,
2355
+ workbench: e.workbench
2356
+ })), e.subscribeRefreshEvents && n.push(po({
2357
+ metadata: e.metadata,
2358
+ subscribe: e.subscribeRefreshEvents,
2359
+ workbench: e.workbench
2360
+ })), n.push(...Ho(t)), n.push(...Mo(t)), n.push(...Wo(t)), n.push(...Bo(t)), n.push(...Vo(t)), {
2361
+ dispose() {
2362
+ Se(n);
2363
+ }
2364
+ };
2365
+ } catch (r) {
2366
+ throw Se(n), r;
2367
+ }
2829
2368
  };
2830
2369
  export {
2831
- se as BRIDGE_WEBVIEW_RENDERER_ID,
2832
- zn as buildWorkbenchExtensionCommandPaletteRegistrations,
2833
- qn as buildWorkbenchExtensionMenuRegistrations,
2834
- Cn as compositionRequiredNotificationId,
2835
- Xt as createBridgeWebviewRenderer,
2836
- Ut as createTerminalSessionCapability,
2837
- In as createWorkbenchCompositionRegistry,
2838
- ze as createWorkbenchWebviewHostCapabilities,
2839
- Do as emptyWorkbenchExtensionMetadata,
2840
- Bo as fileRendererRefreshEnvelopeFromCommand,
2841
- dn as isExtensionNavigationTarget,
2842
- yn as listCompositionAddablePanels,
2843
- L as panelMenuDeclarationOffsets,
2844
- xn as reconcileCompositionLayout,
2845
- No as refreshOpenWorkbenchExtensionWebviews,
2846
- ao as refreshWorkbenchExtensionRenderer,
2847
- hn as registerWorkbenchExtensionCommandPaletteResources,
2848
- Lo as registerWorkbenchExtensionContributions,
2849
- Hn as registerWorkbenchExtensionControlsRenderers,
2850
- Bn as registerWorkbenchExtensionDataTableRenderers,
2851
- Jn as registerWorkbenchExtensionFileRenderers,
2852
- kr as registerWorkbenchExtensionKanbanRenderers,
2853
- U as registerWorkbenchExtensionPanel,
2854
- lo as registerWorkbenchExtensionRendererRefreshEvents,
2855
- Or as registerWorkbenchExtensionTreeRenderers,
2856
- Ye as renderBridgeWebviewFrame,
2857
- wn as toPanelPlacements,
2858
- N as toWorkbenchCompositionPanelContribution,
2859
- Z as toWorkbenchNavigationTarget,
2860
- Je as toWorkbenchNavigationTargetResult,
2861
- Fo as toWorkbenchWhenExpression
2370
+ sn as buildWorkbenchExtensionCommandPaletteRegistrations,
2371
+ on as buildWorkbenchExtensionMenuRegistrations,
2372
+ Ct as createTerminalSessionCapability,
2373
+ Tt as createWorkbenchWebviewHostCapabilities,
2374
+ qo as emptyWorkbenchExtensionMetadata,
2375
+ zo as fileRendererRefreshEnvelopeFromCommand,
2376
+ Ht as getBridgeWebviewHostEventPublisher,
2377
+ Bt as isExtensionNavigationTarget,
2378
+ Go as refreshOpenWorkbenchExtensionWebviews,
2379
+ mo as refreshWorkbenchExtensionRenderer,
2380
+ Ut as registerWorkbenchExtensionCommandPaletteResources,
2381
+ Yo as registerWorkbenchExtensionContributions,
2382
+ zt as registerWorkbenchExtensionControlsRenderers,
2383
+ Xt as registerWorkbenchExtensionDataTableRenderers,
2384
+ dn as registerWorkbenchExtensionFileRenderers,
2385
+ jn as registerWorkbenchExtensionKanbanRenderers,
2386
+ po as registerWorkbenchExtensionRendererRefreshEvents,
2387
+ Fn as registerWorkbenchExtensionTreeRenderers,
2388
+ Wt as renderBridgeWebviewFrame,
2389
+ j as toWorkbenchNavigationTarget,
2390
+ me as toWorkbenchNavigationTargetResult,
2391
+ Qo as toWorkbenchWhenExpression
2862
2392
  };
2863
2393
  //# sourceMappingURL=extensions.js.map