@epam/ai-dial-skill-editor 1.2.0-dev.15 → 1.2.0-dev.153

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,129 +1,142 @@
1
- import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as t, buildCssVars as n, formatFileSize as r, mergeClasses as i, useAvailableHeightCap as a } from "@epam/ai-dial-chat-shared";
2
- import { Accordion as o, CaptionText as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, EditorThemes as u, ErrorText as d, FileDropzone as f, GhostButton as ee, GhostIconButton as te, Input as p, NeutralButton as m, Popup as ne, PopupSize as re, PrimaryButton as ie, Spinner as h, Textarea as g } from "@epam/ai-dial-ui-kit";
3
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
4
- import { IconArrowNarrowLeft as b, IconFileText as ae, IconPlus as oe, IconTrashX as se, IconUpload as x } from "@tabler/icons-react";
5
- import { Suspense as S, lazy as C, useCallback as w, useEffect as T, useId as E, useMemo as D, useRef as O, useState as k } from "react";
6
- import { DialFileNodeType as A, DialFoldersTree as ce } from "@epam/ai-dial-react-file-manager";
7
- import { LazyMarkdownEditor as j } from "@epam/ai-dial-ui-kit/editors";
8
- var M = {
1
+ import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as t, TextRefinementField as n, buildCssVars as r, formatFileSize as i, mergeClasses as a, useAvailableHeightCap as o, useTextRefinement as s } from "@epam/ai-dial-chat-shared";
2
+ import { Accordion as c, ButtonAppearance as l, ButtonVariant as u, CaptionText as d, DIAL_ICON_SIZE as f, DIAL_KIT_ICON_STROKE as p, EditorThemes as m, ErrorText as h, FileDropzone as g, GhostButton as _, GhostIconButton as ee, Input as te, Label as ne, NeutralButton as v, Popup as re, PopupSize as y, PrimaryButton as b, Spinner as x, Textarea as ie } from "@epam/ai-dial-ui-kit";
3
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
4
+ import { IconArrowNarrowLeft as T, IconFileText as E, IconPlus as ae, IconTrashX as oe, IconUpload as D } from "@tabler/icons-react";
5
+ import { Suspense as se, lazy as O, useCallback as k, useEffect as A, useId as j, useMemo as M, useRef as N, useState as P } from "react";
6
+ import { DialFileNodeType as F, DialFoldersTree as ce } from "@epam/ai-dial-react-file-manager";
7
+ import { LazyMarkdownEditor as le } from "@epam/ai-dial-ui-kit/editors";
8
+ a("flex flex-col", {
9
+ body: "_body_m2y60_2",
10
+ sideColumn: "_sideColumn_m2y60_6",
11
+ reservedColumn: "_reservedColumn_m2y60_10"
12
+ }.sideColumn);
13
+ //#endregion
14
+ //#region ../builder-form/src/constants/public-class-names.ts
15
+ var ue = {
16
+ layout: "dial-builder-form-layout",
17
+ section: "dial-builder-form-section"
18
+ }, I = {
9
19
  headerBorder: "_headerBorder_1kidu_1",
10
20
  footerBorder: "_footerBorder_1kidu_5",
11
21
  sidebarBorder: "_sidebarBorder_1kidu_9"
12
- }, N = ({ title: e, onBack: t, backAriaLabel: r = "Back", actions: a, leftContent: o, rightContent: s, isSaving: u = !1, labels: d, styles: f, dir: ee }) => {
13
- let p = E(), m = u ? d?.savingStatusLabel ?? "Saving" : "";
14
- return /* @__PURE__ */ y("div", {
15
- dir: ee,
16
- className: "flex min-h-0 flex-1 flex-col",
17
- style: n({
18
- "--el-header-border-color": f?.colors?.headerBorderColor,
19
- "--el-sidebar-border-color": f?.colors?.sidebarBorderColor
20
- }),
22
+ }, de = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: i, leftContent: o, rightContent: s, isSaving: c = !1, labels: l, styles: u, dir: d }) => {
23
+ let m = j(), h = c ? l?.savingStatusLabel ?? "Saving" : "", g = r({
24
+ "--el-header-border-color": u?.colors?.headerBorderColor,
25
+ "--el-sidebar-border-color": u?.colors?.sidebarBorderColor
26
+ });
27
+ return /* @__PURE__ */ w("div", {
28
+ dir: d,
29
+ className: a("flex min-h-0 flex-1 flex-col", ue.layout),
30
+ style: g,
21
31
  children: [
22
- /* @__PURE__ */ v("span", {
32
+ /* @__PURE__ */ C("span", {
23
33
  role: "status",
24
34
  "aria-live": "polite",
25
35
  className: "sr-only",
26
- id: p,
27
- children: m
36
+ id: m,
37
+ children: h
28
38
  }),
29
- /* @__PURE__ */ y("div", {
30
- className: i("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", M.headerBorder),
31
- children: [/* @__PURE__ */ y("div", {
39
+ /* @__PURE__ */ w("div", {
40
+ className: a("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", I.headerBorder),
41
+ children: [/* @__PURE__ */ w("div", {
32
42
  className: "flex min-w-0 flex-1 items-center gap-2",
33
- children: [/* @__PURE__ */ v(te, {
34
- icon: /* @__PURE__ */ v(b, {
35
- size: c.LG,
36
- stroke: l,
43
+ children: [/* @__PURE__ */ C(ee, {
44
+ icon: /* @__PURE__ */ C(T, {
45
+ size: f.LG,
46
+ stroke: p,
37
47
  "aria-hidden": !0,
38
48
  className: "rtl:scale-x-[-1]"
39
49
  }),
40
- "aria-label": r,
50
+ "aria-label": n,
41
51
  onClick: t
42
- }), /* @__PURE__ */ v("h1", {
52
+ }), /* @__PURE__ */ C("h1", {
43
53
  className: "dial-h2-text min-w-0 truncate",
44
54
  children: e
45
55
  })]
46
- }), a != null && /* @__PURE__ */ v("div", {
56
+ }), i != null && /* @__PURE__ */ C("div", {
47
57
  className: "hidden shrink-0 items-center gap-2 desktop:flex",
48
- children: a
58
+ children: i
49
59
  })]
50
60
  }),
51
- /* @__PURE__ */ y("div", {
61
+ /* @__PURE__ */ w("div", {
52
62
  className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
53
- children: [/* @__PURE__ */ v("div", {
54
- className: i(s == null ? "desktop:flex-1" : "desktop:w-[360px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", s == null ? void 0 : M.sidebarBorder),
63
+ children: [/* @__PURE__ */ C("div", {
64
+ className: a(s == null ? "desktop:flex-1" : "desktop:w-[360px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", s == null ? void 0 : I.sidebarBorder),
55
65
  children: o
56
- }), s != null && /* @__PURE__ */ v("div", {
66
+ }), s != null && /* @__PURE__ */ C("div", {
57
67
  className: "desktop:flex-1 desktop:overflow-y-auto",
58
68
  children: s
59
69
  })]
60
70
  }),
61
- a != null && /* @__PURE__ */ v("div", {
62
- className: i("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", M.footerBorder),
63
- children: a
71
+ i != null && /* @__PURE__ */ C("div", {
72
+ className: a("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", I.footerBorder),
73
+ children: i
64
74
  })
65
75
  ]
66
76
  });
67
- }, P = (e) => !!e.dataTransfer?.types.includes("Files"), le = (e) => {
68
- let [t, n] = k(!1), r = O(0);
77
+ }, fe = {
78
+ root: "dial-skill-editor-root",
79
+ refineFeedback: "dial-skill-editor-refine-feedback"
80
+ }, L = (e) => !!e.dataTransfer?.types.includes("Files"), pe = (e) => {
81
+ let [t, n] = P(!1), r = N(0);
69
82
  return {
70
83
  isDragActive: t,
71
84
  dropZoneHandlers: {
72
- onDragEnter: w((e) => {
73
- P(e) && (e.preventDefault(), r.current += 1, n(!0));
85
+ onDragEnter: k((e) => {
86
+ L(e) && (e.preventDefault(), r.current += 1, n(!0));
74
87
  }, []),
75
- onDragLeave: w((e) => {
76
- P(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
88
+ onDragLeave: k((e) => {
89
+ L(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
77
90
  }, []),
78
- onDragOver: w((e) => {
79
- P(e) && e.preventDefault();
91
+ onDragOver: k((e) => {
92
+ L(e) && e.preventDefault();
80
93
  }, []),
81
- onDrop: w((t) => {
82
- if (!P(t)) return;
94
+ onDrop: k((t) => {
95
+ if (!L(t)) return;
83
96
  t.preventDefault(), r.current = 0, n(!1);
84
97
  let i = Array.from(t.dataTransfer?.files ?? []);
85
98
  i.length > 0 && e(i);
86
99
  }, [e])
87
100
  }
88
101
  };
89
- }, F = "SKILL.md", I = /* @__PURE__ */ function(e) {
102
+ }, R = "SKILL.md", z = /* @__PURE__ */ function(e) {
90
103
  return e.File = "file", e.Folder = "folder", e;
91
- }({}), L = (e) => {
104
+ }({}), B = (e) => {
92
105
  let t = e.lastIndexOf("/");
93
106
  return t === -1 ? null : e.slice(0, t);
94
- }, R = (e) => {
107
+ }, V = (e) => {
95
108
  let t = e.lastIndexOf("/");
96
109
  return t === -1 ? e : e.slice(t + 1);
97
- }, ue = (e) => {
110
+ }, me = (e) => {
98
111
  let t = /* @__PURE__ */ new Map(), n = (e) => {
99
112
  let n = t.get(e);
100
113
  if (n) return n;
101
114
  let r = {
102
115
  path: e,
103
- name: R(e),
104
- nodeType: A.FOLDER,
105
- parentPath: L(e),
116
+ name: V(e),
117
+ nodeType: F.FOLDER,
118
+ parentPath: B(e),
106
119
  folderId: e,
107
120
  items: []
108
121
  };
109
122
  return t.set(e, r), r;
110
123
  };
111
124
  for (let r of e) {
112
- if (r.kind === I.Folder) {
125
+ if (r.kind === z.Folder) {
113
126
  n(r.path);
114
127
  continue;
115
128
  }
116
129
  t.set(r.path, {
117
130
  path: r.path,
118
131
  name: r.name,
119
- nodeType: A.ITEM,
120
- parentPath: L(r.path),
121
- folderId: L(r.path) ?? ""
132
+ nodeType: F.ITEM,
133
+ parentPath: B(r.path),
134
+ folderId: B(r.path) ?? ""
122
135
  });
123
136
  }
124
137
  for (let t of [...e]) {
125
- let e = L(t.path);
126
- for (; e != null;) n(e), e = L(e);
138
+ let e = B(t.path);
139
+ for (; e != null;) n(e), e = B(e);
127
140
  }
128
141
  let r = [];
129
142
  for (let e of t.values()) {
@@ -135,462 +148,525 @@ var M = {
135
148
  n ? n.items = [...n.items ?? [], e] : r.push(e);
136
149
  }
137
150
  return r;
138
- }, de = ({ isVisible: e, labels: t }) => {
151
+ }, he = ({ isVisible: e, labels: t }) => {
139
152
  if (!e) return null;
140
153
  let n = t ?? {};
141
- return /* @__PURE__ */ v("div", {
154
+ return /* @__PURE__ */ C("div", {
142
155
  role: "status",
143
156
  "aria-live": "polite",
144
- className: i("pointer-events-none absolute inset-0 z-[100] flex items-center justify-center backdrop-blur-sm"),
145
- children: /* @__PURE__ */ y("div", {
157
+ className: a("pointer-events-none absolute inset-0 z-[100] flex items-center justify-center backdrop-blur-sm"),
158
+ children: /* @__PURE__ */ w("div", {
146
159
  className: "flex flex-col items-center text-center",
147
160
  children: [
148
- /* @__PURE__ */ v(x, {
161
+ /* @__PURE__ */ C(D, {
149
162
  size: 100,
150
163
  className: "text-accent-primary",
151
164
  "aria-hidden": !0,
152
- stroke: l
165
+ stroke: p
153
166
  }),
154
- /* @__PURE__ */ v("span", {
167
+ /* @__PURE__ */ C("span", {
155
168
  className: "dial-h3-text mt-5",
156
169
  children: n.dropOverlayTitle ?? "Upload files"
157
170
  }),
158
- /* @__PURE__ */ v("span", {
171
+ /* @__PURE__ */ C("span", {
159
172
  className: "dial-small-text mt-4",
160
173
  children: n.dropOverlaySubtitle ?? "Drop files here to add them to this skill"
161
174
  })
162
175
  ]
163
176
  })
164
177
  });
165
- }, fe = /* @__PURE__ */ function(e) {
178
+ }, H = /* @__PURE__ */ function(e) {
166
179
  return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
167
- }({}), z = /* @__PURE__ */ function(e) {
180
+ }({}), U = /* @__PURE__ */ function(e) {
168
181
  return e.Valid = "valid", e.Invalid = "invalid", e;
169
- }({}), B = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), V = 0, H = () => `skill-file-candidate-${++V}`, pe = ({ isOpen: e, onClose: t, fileActions: n, initialFiles: i, labels: a }) => {
170
- let o = a ?? {}, [s, c] = k([]), [u, p] = k(/* @__PURE__ */ new Map()), [m, g] = k([]), [b, oe] = k(!1), [x, S] = k(), [C, w] = k(!1), D = E(), O = (e) => {
182
+ }({}), ge = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), _e = 0, ve = () => `skill-file-candidate-${++_e}`, ye = ({ isOpen: e, onClose: t, fileActions: n, initialFiles: r, labels: a }) => {
183
+ let o = a ?? {}, [s, c] = P([]), [d, f] = P(/* @__PURE__ */ new Map()), [m, _] = P([]), [te, ne] = P(!1), [v, b] = P(), [ie, T] = P(!1), ae = j(), D = (e) => {
171
184
  let t = e.map((e) => ({
172
- id: H(),
185
+ id: ve(),
173
186
  file: e,
174
- path: B(e)
187
+ path: ge(e)
175
188
  }));
176
- S(void 0), c((e) => [...e, ...t]);
177
- }, A = (e) => {
189
+ b(void 0), c((e) => [...e, ...t]);
190
+ }, se = (e) => {
178
191
  c((t) => t.filter((t) => t.id !== e));
179
192
  };
180
- T(() => {
181
- e && (c((i ?? []).map((e) => ({
182
- id: H(),
193
+ A(() => {
194
+ e && (c((r ?? []).map((e) => ({
195
+ id: ve(),
183
196
  file: e,
184
- path: B(e)
185
- }))), p(/* @__PURE__ */ new Map()), g([]), S(void 0));
186
- }, [e]), T(() => {
197
+ path: ge(e)
198
+ }))), f(/* @__PURE__ */ new Map()), _([]), b(void 0));
199
+ }, [e]), A(() => {
187
200
  if (!e) return;
188
201
  let t = !1;
189
202
  if (s.length === 0) {
190
- p(/* @__PURE__ */ new Map()), g([]);
203
+ f(/* @__PURE__ */ new Map()), _([]);
191
204
  return;
192
205
  }
193
- return oe(!0), n.validateBatch(s).then(({ results: e, batchErrors: n }) => {
194
- t || (p(new Map(e.map((e) => [e.candidateId, e]))), g(n.map((e) => e.message)));
206
+ return ne(!0), n.validateBatch(s).then(({ results: e, batchErrors: n }) => {
207
+ t || (f(new Map(e.map((e) => [e.candidateId, e]))), _(n.map((e) => e.message)));
195
208
  }).finally(() => {
196
- t || oe(!1);
209
+ t || ne(!1);
197
210
  }), () => {
198
211
  t = !0;
199
212
  };
200
213
  }, [s, e]);
201
- let ce = s.some((e) => u.get(e.id)?.status === z.Invalid), j = s.length > 0 && s.every((e) => u.get(e.id)?.status === z.Invalid), M = s.length > 0 && !ce && m.length === 0 && !b && !C, N = async () => {
202
- w(!0), S(void 0);
214
+ let O = s.some((e) => d.get(e.id)?.status === U.Invalid), k = s.length > 0 && s.every((e) => d.get(e.id)?.status === U.Invalid), M = s.length > 0 && !O && m.length === 0 && !te && !ie, N = async () => {
215
+ T(!0), b(void 0);
203
216
  try {
204
217
  let { results: e, batchErrors: r } = await n.validateBatch(s), i = new Map(e.map((e) => [e.candidateId, e]));
205
- if (p(i), g(r.map((e) => e.message)), s.some((e) => i.get(e.id)?.status === z.Invalid) || r.length > 0) return;
218
+ if (f(i), _(r.map((e) => e.message)), s.some((e) => i.get(e.id)?.status === U.Invalid) || r.length > 0) return;
206
219
  let a = await n.commitBatch(s);
207
220
  if (a.error) {
208
- S(a.error);
221
+ b(a.error);
209
222
  return;
210
223
  }
211
224
  t();
212
225
  } finally {
213
- w(!1);
226
+ T(!1);
214
227
  }
215
228
  };
216
- return /* @__PURE__ */ v(ne, {
229
+ return /* @__PURE__ */ C(re, {
217
230
  open: e,
218
231
  header: o.uploadDialogTitle ?? "Upload files from device",
219
- size: re.Sm,
232
+ size: y.Sm,
220
233
  closeAriaLabel: o.uploadDialogCloseAriaLabel ?? "Close",
221
234
  onClose: t,
222
- footer: /* @__PURE__ */ y("div", {
223
- className: "flex min-h-[44px] items-center justify-end gap-2 px-6 py-4",
224
- children: [/* @__PURE__ */ v(ee, {
225
- label: o.uploadCancelLabel ?? "Cancel",
226
- onClick: t
227
- }), /* @__PURE__ */ v(ie, {
228
- label: o.uploadConfirmLabel ?? "Add",
229
- iconBefore: C ? /* @__PURE__ */ v(h, {
230
- size: 16,
231
- ariaLabel: ""
232
- }) : void 0,
233
- onClick: () => void N(),
234
- disabled: !M
235
- })]
236
- }),
237
- children: /* @__PURE__ */ y("div", {
235
+ mainButtons: [{
236
+ label: o.uploadCancelLabel ?? "Cancel",
237
+ variant: u.Primary,
238
+ appearance: l.Ghost,
239
+ onClick: t
240
+ }, {
241
+ label: o.uploadConfirmLabel ?? "Add",
242
+ variant: u.Primary,
243
+ iconBefore: ie ? /* @__PURE__ */ C(x, {
244
+ size: 16,
245
+ ariaLabel: ""
246
+ }) : void 0,
247
+ onClick: () => void N(),
248
+ disabled: !M
249
+ }],
250
+ children: /* @__PURE__ */ w("div", {
238
251
  className: "flex flex-col gap-4 px-6 py-4",
239
252
  children: [
240
- /* @__PURE__ */ v(f, {
241
- label: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("span", {
253
+ /* @__PURE__ */ C(g, {
254
+ label: /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("span", {
242
255
  className: "desktop:hidden",
243
256
  children: o.uploadDropZoneMobileLabel ?? "Click here to upload"
244
- }), /* @__PURE__ */ v("span", {
257
+ }), /* @__PURE__ */ C("span", {
245
258
  className: "hidden desktop:inline",
246
259
  children: o.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
247
260
  })] }),
248
261
  ariaLabel: o.uploadDropZoneAriaLabel ?? "Upload files",
249
262
  multiple: !0,
250
- className: j ? "border-error hover:border-error" : void 0,
251
- onChange: O
263
+ className: k ? "border-error hover:border-error" : void 0,
264
+ onChange: D
252
265
  }),
253
- /* @__PURE__ */ v("span", {
266
+ /* @__PURE__ */ C("span", {
254
267
  role: "status",
255
268
  "aria-live": "polite",
256
269
  className: "sr-only",
257
- id: D,
270
+ id: ae,
258
271
  children: m.map((e) => `${o.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
259
272
  }),
260
- m.map((e) => /* @__PURE__ */ v(d, { text: e }, e)),
261
- s.length > 0 && /* @__PURE__ */ v("ul", {
273
+ m.map((e) => /* @__PURE__ */ C(h, { text: e }, e)),
274
+ s.length > 0 && /* @__PURE__ */ C("ul", {
262
275
  className: "flex flex-col gap-2",
263
276
  children: s.map((e) => {
264
- let t = u.get(e.id), n = t?.kind === fe.Manifest, i = t?.status === z.Invalid;
265
- return /* @__PURE__ */ y("li", {
277
+ let t = d.get(e.id), n = t?.kind === H.Manifest, r = t?.status === U.Invalid;
278
+ return /* @__PURE__ */ w("li", {
266
279
  className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
267
280
  children: [
268
- /* @__PURE__ */ v(ae, {
281
+ /* @__PURE__ */ C(E, {
269
282
  size: 20,
270
283
  "aria-hidden": !0,
271
- stroke: l
284
+ stroke: p
272
285
  }),
273
- /* @__PURE__ */ y("div", {
286
+ /* @__PURE__ */ w("div", {
274
287
  className: "flex min-w-0 flex-1 flex-col",
275
288
  children: [
276
- /* @__PURE__ */ v("span", {
289
+ /* @__PURE__ */ C("span", {
277
290
  className: "dial-small-text truncate",
278
291
  children: e.path
279
292
  }),
280
- /* @__PURE__ */ v("span", {
293
+ /* @__PURE__ */ C("span", {
281
294
  className: "dial-tiny-text text-secondary",
282
- children: r(e.file.size)
295
+ children: i(e.file.size)
283
296
  }),
284
- i && t?.error && /* @__PURE__ */ v(d, { text: t.error }),
285
- n && !i && /* @__PURE__ */ v("span", {
297
+ r && t?.error && /* @__PURE__ */ C(h, { text: t.error }),
298
+ n && !r && /* @__PURE__ */ C("span", {
286
299
  className: "dial-tiny-text text-secondary",
287
300
  children: o.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
288
301
  })
289
302
  ]
290
303
  }),
291
- /* @__PURE__ */ v(te, {
292
- icon: /* @__PURE__ */ v(se, {
304
+ /* @__PURE__ */ C(ee, {
305
+ icon: /* @__PURE__ */ C(oe, {
293
306
  size: 16,
294
307
  "aria-hidden": !0,
295
- stroke: l
308
+ stroke: p
296
309
  }),
297
310
  "aria-label": o.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
298
- onClick: () => A(e.id)
311
+ onClick: () => se(e.id)
299
312
  })
300
313
  ]
301
314
  }, e.id);
302
315
  })
303
316
  }),
304
- x && /* @__PURE__ */ v(d, { text: x })
317
+ v && /* @__PURE__ */ C(h, { text: v })
305
318
  ]
306
319
  })
307
320
  });
308
- }, U = {
309
- title: "_title_65glc_1",
310
- helperText: "_helperText_65glc_5"
311
- }, me = C(async () => {
312
- let { MarkdownEditor: e } = await j();
321
+ }, W = {
322
+ title: "_title_1cnn4_1",
323
+ helperText: "_helperText_1cnn4_5",
324
+ refineFeedback: "_refineFeedback_1cnn4_9",
325
+ refineError: "_refineError_1cnn4_13"
326
+ }, be = O(async () => {
327
+ let { MarkdownEditor: e } = await le();
313
328
  return { default: e };
314
- }), W = ({ initialValues: r, files: f, selectedPath: te, onSelectedPathChange: ne, expandedPaths: re, onExpandedPathsChange: b, isLoading: ae = !1, hasLoadError: x = !1, isSubmitting: C = !1, errors: E, submitError: A, conflict: j, onReloadLatest: M, isNameReadOnly: P = !1, onDirtyChange: L, fileActions: R, supportingFileContent: fe, onSubmit: z, onCancel: B, onBack: V, backAriaLabel: H, title: W, onRetry: he, labels: ge, styles: _e, dir: ve, instructionsEditorTheme: ye = u.light }) => {
315
- let [G, K] = k({
316
- name: r?.name ?? "",
317
- description: r?.description ?? "",
318
- instructions: r?.instructions ?? ""
319
- }), be = a(), xe = O(r), Se = xe.current !== r, Ce = O(f);
320
- T(() => {
321
- xe.current = r, K({
322
- name: r?.name ?? "",
323
- description: r?.description ?? "",
324
- instructions: r?.instructions ?? ""
325
- }), Ce.current = f;
326
- }, [r]);
327
- let we = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), Te = O(!1);
328
- T(() => {
329
- if (Se) return;
329
+ }), G = ({ initialValues: i, files: l, selectedPath: u, onSelectedPathChange: g, expandedPaths: ee, onExpandedPathsChange: re, isLoading: y = !1, hasLoadError: T = !1, isSubmitting: E = !1, errors: D, submitError: O, conflict: F, onReloadLatest: le, isNameReadOnly: ue = !1, onDirtyChange: I, onValuesChange: L, onRefineDescription: B, onRefineInstructions: V, fileActions: H, supportingFileContent: U, onSubmit: ge, onCancel: _e, onBack: ve, backAriaLabel: G, title: xe, onRetry: Se, onRetrySubmit: Ce, labels: we, styles: Te, dir: Ee, instructionsEditorTheme: De = m.light }) => {
330
+ let [K, Oe] = P({
331
+ name: i?.name ?? "",
332
+ description: i?.description ?? "",
333
+ instructions: i?.instructions ?? ""
334
+ }), ke = j(), Ae = j(), q = N(void 0), je = o(), Me = N(K), J = (e) => {
335
+ let t = {
336
+ ...Me.current,
337
+ ...e
338
+ };
339
+ Me.current = t, Oe(t), L?.(t);
340
+ }, Ne = (e) => e ? async (t, n) => {
341
+ if (q.current && !q.current.aborted) throw new DOMException("Busy", "AbortError");
342
+ q.current = n;
343
+ try {
344
+ return await e(t, n);
345
+ } finally {
346
+ q.current === n && (q.current = void 0);
347
+ }
348
+ } : void 0, Y = s({
349
+ value: K.description,
350
+ onChange: (e) => J({ description: e }),
351
+ onRefine: Ne(B),
352
+ disabled: E || y || T,
353
+ resetKey: i
354
+ }), Pe = s({
355
+ value: K.instructions,
356
+ onChange: (e) => J({ instructions: e }),
357
+ onRefine: Ne(V),
358
+ disabled: E || y || T,
359
+ resetKey: i
360
+ }), Fe = Y.isPending || Pe.isPending, Ie = () => {
361
+ Y.reset(), Pe.reset();
362
+ }, Le = () => {
363
+ Ie(), _e();
364
+ }, Re = () => {
365
+ Ie(), ve();
366
+ }, ze = () => {
367
+ E || y || T || q.current && !q.current.aborted || ge(K);
368
+ }, Be = N(i), Ve = Be.current !== i, He = N(l);
369
+ A(() => {
370
+ Be.current = i;
371
+ let e = {
372
+ name: i?.name ?? "",
373
+ description: i?.description ?? "",
374
+ instructions: i?.instructions ?? ""
375
+ };
376
+ Me.current = e, Oe(e), He.current = l;
377
+ }, [i]);
378
+ let Ue = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), We = N(!1);
379
+ A(() => {
380
+ if (Ve) return;
330
381
  let e = {
331
- name: r?.name ?? "",
332
- description: r?.description ?? "",
333
- instructions: r?.instructions ?? ""
334
- }, t = JSON.stringify(G) !== JSON.stringify(e) || we(f) !== we(Ce.current);
335
- t !== Te.current && (Te.current = t, L?.(t));
382
+ name: i?.name ?? "",
383
+ description: i?.description ?? "",
384
+ instructions: i?.instructions ?? ""
385
+ }, t = JSON.stringify(K) !== JSON.stringify(e) || Ue(l) !== Ue(He.current);
386
+ t !== We.current && (We.current = t, I?.(t));
336
387
  }, [
337
- G,
338
- f,
339
- r,
340
- Se,
341
- L
388
+ K,
389
+ l,
390
+ i,
391
+ Ve,
392
+ I
342
393
  ]);
343
- let [Ee, De] = k(F), q = te ?? Ee, J = w((e) => {
344
- De(e), ne?.(e);
345
- }, [ne]), [Oe, ke] = k([]), Ae = re ?? Oe, je = D(() => new Set(Ae), [Ae]), Me = w((e) => {
394
+ let [Ge, Ke] = P(R), X = u ?? Ge, qe = k((e) => {
395
+ Ke(e), g?.(e);
396
+ }, [g]), [Je, Ye] = P([]), Xe = ee ?? Je, Ze = M(() => new Set(Xe), [Xe]), Qe = k((e) => {
346
397
  let t = [...e];
347
- ke(t), b?.(t);
348
- }, [b]), [Y, Ne] = k(!1), [Pe, Fe] = k(), [Ie, Le] = k(!1), { isDragActive: Re, dropZoneHandlers: ze } = le(w((e) => {
349
- Y || (Fe(e), Ne(!0));
350
- }, [Y])), X = ge ?? {}, Z = _e?.colors, Q = _e?.typography ?? {}, Be = Q.titleClassName ?? "dial-body-semi-text", Ve = Q.helperTextClassName ?? "dial-tiny-semi-text", He = Q.removeIconClassName ?? "text-secondary", Ue = n({
351
- "--se-title-color": Z?.title,
352
- "--se-helper-text-color": Z?.helperText
353
- }), We = Z?.border ? { colors: {
354
- headerBorderColor: Z.border,
355
- sidebarBorderColor: Z.border
356
- } } : void 0, Ge = D(() => ue([{
357
- path: F,
358
- name: F,
359
- kind: I.File
360
- }, ...f]), [f]), $ = D(() => f.find((e) => e.path === q), [f, q]), Ke = w((e) => {
361
- J(e.path);
362
- }, [J]), qe = w((e) => {
363
- R.onRemoveNode(e), q === e && J(F);
398
+ Ye(t), re?.(t);
399
+ }, [re]), [$e, et] = P(!1), [tt, nt] = P(), [rt, it] = P(!1), { isDragActive: at, dropZoneHandlers: ot } = pe(k((e) => {
400
+ $e || (nt(e), et(!0));
401
+ }, [$e])), Z = we ?? {}, Q = Te?.colors, st = Te?.typography ?? {}, ct = st.titleClassName ?? "dial-body-semi-text", lt = st.helperTextClassName ?? "dial-tiny-semi-text", ut = st.removeIconClassName ?? "text-secondary", dt = r({
402
+ "--se-title-color": Q?.title,
403
+ "--se-helper-text-color": Q?.helperText,
404
+ "--se-refine-action-text": Q?.refineActionText,
405
+ "--se-refine-error-text": Q?.refineErrorText
406
+ }), ft = {
407
+ feedbackClassName: a(W.refineFeedback, st.refineFeedbackClassName ?? "dial-small-text", fe.refineFeedback),
408
+ errorClassName: W.refineError
409
+ }, pt = Q?.border ? { colors: {
410
+ headerBorderColor: Q.border,
411
+ sidebarBorderColor: Q.border
412
+ } } : void 0, mt = M(() => me([{
413
+ path: R,
414
+ name: R,
415
+ kind: z.File
416
+ }, ...l]), [l]), $ = M(() => l.find((e) => e.path === X), [l, X]), ht = k((e) => {
417
+ qe(e.path);
418
+ }, [qe]), gt = k((e) => {
419
+ H.onRemoveNode(e), X === e && qe(R);
364
420
  }, [
365
- R,
366
- q,
367
- J
368
- ]), Je = w((e) => e.path === "SKILL.md" ? [] : [{
421
+ H,
422
+ X,
423
+ qe
424
+ ]), _t = k((e) => e.path === "SKILL.md" ? [] : [{
369
425
  key: "remove",
370
- label: X.removeLabel ?? "Remove",
371
- icon: /* @__PURE__ */ v(se, {
372
- size: c.SM,
373
- className: He,
426
+ label: Z.removeLabel ?? "Remove",
427
+ icon: /* @__PURE__ */ C(oe, {
428
+ size: f.SM,
429
+ className: ut,
374
430
  "aria-hidden": !0,
375
- stroke: l
431
+ stroke: p
376
432
  }),
377
- onClick: () => qe(e.path)
433
+ onClick: () => gt(e.path)
378
434
  }], [
379
- X.removeLabel,
380
- He,
381
- qe
382
- ]), Ye = /* @__PURE__ */ y("div", {
435
+ Z.removeLabel,
436
+ ut,
437
+ gt
438
+ ]), vt = /* @__PURE__ */ w("div", {
383
439
  className: "flex flex-col gap-2 desktop:gap-5",
384
- children: [/* @__PURE__ */ y("div", {
440
+ children: [/* @__PURE__ */ w("div", {
385
441
  className: "flex items-center justify-between",
386
- children: [/* @__PURE__ */ v("span", {
387
- className: i(U.title, Be),
388
- children: X.filesHeading ?? "Files"
389
- }), /* @__PURE__ */ v(m, {
390
- label: X.addUploadLabel ?? "Upload from device",
391
- iconBefore: /* @__PURE__ */ v(oe, {
442
+ children: [/* @__PURE__ */ C("span", {
443
+ className: a(W.title, ct),
444
+ children: Z.filesHeading ?? "Files"
445
+ }), /* @__PURE__ */ C(v, {
446
+ label: Z.addUploadLabel ?? "Upload from device",
447
+ iconBefore: /* @__PURE__ */ C(ae, {
392
448
  size: 16,
393
449
  "aria-hidden": !0,
394
- stroke: l
450
+ stroke: p
395
451
  }),
396
452
  onClick: () => {
397
- Fe(void 0), Ne(!0);
453
+ nt(void 0), et(!0);
398
454
  }
399
455
  })]
400
- }), /* @__PURE__ */ v("div", {
456
+ }), /* @__PURE__ */ C("div", {
401
457
  role: "tree",
402
- "aria-label": X.filesTreeAriaLabel ?? "Skill files",
403
- children: /* @__PURE__ */ v(ce, {
404
- items: Ge,
458
+ "aria-label": Z.filesTreeAriaLabel ?? "Skill files",
459
+ children: /* @__PURE__ */ C(ce, {
460
+ items: mt,
405
461
  showFiles: !0,
406
- selectedPath: q,
407
- expandedPaths: je,
408
- onExpandedPathsChange: Me,
409
- onItemClick: Ke,
410
- getContextMenuItems: Je,
462
+ selectedPath: X,
463
+ expandedPaths: Ze,
464
+ onExpandedPathsChange: Qe,
465
+ onItemClick: ht,
466
+ getContextMenuItems: _t,
411
467
  rootItemPath: ""
412
468
  })
413
469
  })]
414
- }), Xe = /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(m, {
415
- label: X.cancelLabel ?? "Cancel",
416
- onClick: B,
417
- disabled: C
418
- }), /* @__PURE__ */ v(ie, {
419
- label: X.createLabel ?? "Create",
420
- iconBefore: C ? /* @__PURE__ */ v(h, {
470
+ }), yt = /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(v, {
471
+ label: Z.cancelLabel ?? "Cancel",
472
+ onClick: Le,
473
+ disabled: E
474
+ }), /* @__PURE__ */ C(b, {
475
+ label: Z.createLabel ?? "Create",
476
+ iconBefore: E ? /* @__PURE__ */ C(x, {
421
477
  size: 16,
422
478
  ariaLabel: ""
423
479
  }) : void 0,
424
- onClick: () => z(G),
425
- disabled: C
480
+ onClick: ze,
481
+ disabled: E || Fe || y || T
426
482
  })] });
427
- return ae ? /* @__PURE__ */ v("div", {
428
- dir: ve,
483
+ return y ? /* @__PURE__ */ C("div", {
484
+ dir: Ee,
429
485
  className: "relative flex min-h-0 flex-1 flex-col",
430
- children: /* @__PURE__ */ v(N, {
431
- title: W,
432
- onBack: V,
433
- backAriaLabel: H,
434
- actions: Xe,
486
+ children: /* @__PURE__ */ C(de, {
487
+ title: xe,
488
+ onBack: Re,
489
+ backAriaLabel: G,
490
+ actions: yt,
435
491
  isSaving: !1,
436
- labels: { savingStatusLabel: X.savingStatusLabel },
437
- styles: We,
438
- leftContent: /* @__PURE__ */ v("div", {
492
+ labels: { savingStatusLabel: Z.savingStatusLabel },
493
+ styles: pt,
494
+ leftContent: /* @__PURE__ */ C("div", {
439
495
  role: "status",
440
- "aria-label": X.loadingAriaLabel ?? "Loading skill",
496
+ "aria-label": Z.loadingAriaLabel ?? "Loading skill",
441
497
  className: "flex flex-1 items-center justify-center p-8",
442
- children: /* @__PURE__ */ v(h, {})
498
+ children: /* @__PURE__ */ C(x, {})
443
499
  })
444
500
  })
445
- }) : x ? /* @__PURE__ */ v("div", {
446
- dir: ve,
501
+ }) : T ? /* @__PURE__ */ C("div", {
502
+ dir: Ee,
447
503
  className: "relative flex min-h-0 flex-1 flex-col",
448
- children: /* @__PURE__ */ v(N, {
449
- title: W,
450
- onBack: V,
451
- backAriaLabel: H,
452
- actions: Xe,
504
+ children: /* @__PURE__ */ C(de, {
505
+ title: xe,
506
+ onBack: Re,
507
+ backAriaLabel: G,
508
+ actions: yt,
453
509
  isSaving: !1,
454
- labels: { savingStatusLabel: X.savingStatusLabel },
455
- styles: We,
456
- leftContent: /* @__PURE__ */ y("div", {
510
+ labels: { savingStatusLabel: Z.savingStatusLabel },
511
+ styles: pt,
512
+ leftContent: /* @__PURE__ */ w("div", {
457
513
  role: "alert",
458
514
  className: "flex flex-col items-center gap-4 p-8",
459
- children: [/* @__PURE__ */ v(d, { text: X.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ v(ie, {
460
- label: X.retryLabel ?? "Retry",
461
- onClick: he
515
+ children: [/* @__PURE__ */ C(h, { text: Z.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ C(b, {
516
+ label: Z.retryLabel ?? "Retry",
517
+ onClick: Se
462
518
  })]
463
519
  })
464
520
  })
465
- }) : /* @__PURE__ */ y("div", {
466
- dir: ve,
467
- className: "relative flex min-h-0 flex-1 flex-col",
468
- style: Ue,
469
- ...ze,
521
+ }) : /* @__PURE__ */ w("div", {
522
+ dir: Ee,
523
+ className: a("relative flex min-h-0 flex-1 flex-col", fe.root),
524
+ style: dt,
525
+ ...ot,
470
526
  children: [
471
- /* @__PURE__ */ v(de, {
472
- isVisible: Re && !Y,
473
- labels: ge
527
+ /* @__PURE__ */ C(he, {
528
+ isVisible: at && !$e,
529
+ labels: we
474
530
  }),
475
- /* @__PURE__ */ v(N, {
476
- title: W,
477
- onBack: V,
478
- backAriaLabel: H,
479
- actions: Xe,
480
- isSaving: C,
481
- labels: { savingStatusLabel: X.savingStatusLabel },
482
- styles: We,
483
- leftContent: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("div", {
531
+ /* @__PURE__ */ C(de, {
532
+ title: xe,
533
+ onBack: Re,
534
+ backAriaLabel: G,
535
+ actions: yt,
536
+ isSaving: E,
537
+ labels: { savingStatusLabel: Z.savingStatusLabel },
538
+ styles: pt,
539
+ leftContent: /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("div", {
484
540
  className: "px-4 py-4 desktop:hidden",
485
- children: /* @__PURE__ */ v(o, {
486
- title: X.editingFileLabel ?? "Editing file",
541
+ children: /* @__PURE__ */ C(c, {
542
+ title: Z.editingFileLabel ?? "Editing file",
487
543
  description: $?.name ?? "SKILL.md",
488
- expanded: Ie,
489
- onToggle: Le,
490
- ariaLabel: X.editingFileLabel ?? "Editing file",
491
- children: Ye
544
+ expanded: rt,
545
+ onToggle: it,
546
+ ariaLabel: Z.editingFileLabel ?? "Editing file",
547
+ children: vt
492
548
  })
493
- }), /* @__PURE__ */ v("div", {
549
+ }), /* @__PURE__ */ C("div", {
494
550
  className: "hidden px-8 py-6 desktop:block",
495
- children: Ye
551
+ children: vt
496
552
  })] }),
497
- rightContent: /* @__PURE__ */ y("div", {
553
+ rightContent: /* @__PURE__ */ w("div", {
498
554
  className: "flex flex-1 flex-col gap-4 px-4 py-6 desktop:gap-5 desktop:px-8",
499
555
  children: [
500
- A != null && /* @__PURE__ */ v("div", {
556
+ O != null && /* @__PURE__ */ w("div", {
501
557
  role: "alert",
502
- children: /* @__PURE__ */ v(d, { text: A })
558
+ className: "flex items-center gap-2",
559
+ children: [/* @__PURE__ */ C(h, { text: O }), Ce != null && /* @__PURE__ */ C(_, {
560
+ label: Z.retryLabel ?? "Retry",
561
+ onClick: Ce
562
+ })]
503
563
  }),
504
- j != null && /* @__PURE__ */ y("div", {
564
+ F != null && /* @__PURE__ */ w("div", {
505
565
  role: "alert",
506
566
  className: "flex items-center gap-2",
507
- children: [/* @__PURE__ */ v(d, { text: j.message }), /* @__PURE__ */ v(ee, {
508
- label: X.reloadLatestLabel ?? "Reload latest",
509
- onClick: M
567
+ children: [/* @__PURE__ */ C(h, { text: F.message }), /* @__PURE__ */ C(_, {
568
+ label: Z.reloadLatestLabel ?? "Reload latest",
569
+ onClick: le
510
570
  })]
511
571
  }),
512
- /* @__PURE__ */ v("h2", {
513
- className: i(U.title, Be),
514
- children: q === "SKILL.md" ? F : X.selectedFileHeading?.($?.name ?? q) ?? $?.name ?? q
572
+ /* @__PURE__ */ C("h2", {
573
+ className: a(W.title, ct),
574
+ children: X === "SKILL.md" ? R : Z.selectedFileHeading?.($?.name ?? X) ?? $?.name ?? X
515
575
  }),
516
- q === "SKILL.md" ? /* @__PURE__ */ y(_, { children: [
517
- /* @__PURE__ */ v(p, {
576
+ X === "SKILL.md" ? /* @__PURE__ */ w(S, { children: [
577
+ /* @__PURE__ */ C(te, {
518
578
  labelProps: {
519
- label: X.nameLabel ?? "Name",
579
+ label: Z.nameLabel ?? "Name",
520
580
  required: !0
521
581
  },
522
- value: G.name,
523
- onChange: (e) => K((t) => ({
524
- ...t,
525
- name: e ?? ""
526
- })),
527
- placeholder: X.namePlaceholder ?? "good-morning-breakfast",
528
- caption: E?.name ? void 0 : X.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
529
- error: E?.name,
530
- invalid: !!E?.name,
531
- disabled: P
582
+ value: K.name,
583
+ onChange: (e) => J({ name: e ?? "" }),
584
+ placeholder: Z.namePlaceholder ?? "good-morning-breakfast",
585
+ caption: D?.name ? void 0 : Z.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
586
+ error: D?.name,
587
+ invalid: !!D?.name,
588
+ disabled: ue
532
589
  }),
533
- /* @__PURE__ */ v(g, {
534
- labelProps: {
535
- label: X.descriptionLabel ?? "Description",
536
- required: !0
537
- },
538
- value: G.description,
539
- placeholder: X.descriptionPlaceholder ?? "What this skill does and when to use it",
540
- onChange: (e) => K((t) => ({
541
- ...t,
542
- description: e
543
- })),
544
- error: E?.description,
545
- invalid: !!E?.description
590
+ /* @__PURE__ */ C(n, {
591
+ isEnabled: !!B,
592
+ fieldId: ke,
593
+ required: !0,
594
+ label: Z.descriptionLabel ?? "Description",
595
+ labels: Z,
596
+ refinement: Y,
597
+ disabled: Fe || E,
598
+ ...ft,
599
+ children: /* @__PURE__ */ C(ie, {
600
+ id: ke,
601
+ "aria-required": !0,
602
+ labelProps: B ? void 0 : {
603
+ label: Z.descriptionLabel ?? "Description",
604
+ required: !0
605
+ },
606
+ value: K.description,
607
+ placeholder: Z.descriptionPlaceholder ?? "What this skill does and when to use it",
608
+ onChange: (e) => {
609
+ Y.reset(), J({ description: e });
610
+ },
611
+ error: D?.description,
612
+ invalid: !!D?.description
613
+ })
546
614
  }),
547
- /* @__PURE__ */ y("div", {
548
- className: "flex flex-1 flex-col gap-2",
549
- children: [
550
- /* @__PURE__ */ y("span", {
551
- className: "flex items-center gap-0.5",
552
- children: [/* @__PURE__ */ v("span", {
553
- className: i(U.helperText, Ve),
554
- children: X.instructionsLabel ?? "Instructions"
555
- }), /* @__PURE__ */ v("span", {
556
- className: "dial-tiny-text text-error",
557
- children: "*"
558
- })]
559
- }),
560
- /* @__PURE__ */ v("div", {
561
- ref: be,
562
- className: i(e, t),
563
- children: /* @__PURE__ */ v(S, {
564
- fallback: /* @__PURE__ */ v(h, { ariaLabel: X.instructionsLoadingAriaLabel ?? "Loading" }),
565
- children: /* @__PURE__ */ v(me, {
566
- value: G.instructions,
567
- onChange: (e) => K((t) => ({
568
- ...t,
569
- instructions: e
570
- })),
571
- theme: ye,
572
- placeholder: X.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
615
+ /* @__PURE__ */ C(n, {
616
+ isEnabled: !!V,
617
+ fieldId: Ae,
618
+ required: !0,
619
+ labelClassName: a(W.helperText, lt),
620
+ label: Z.instructionsLabel ?? "Instructions",
621
+ labels: Z,
622
+ refinement: Pe,
623
+ disabled: Fe || E,
624
+ ...ft,
625
+ children: /* @__PURE__ */ w("div", {
626
+ className: "flex flex-1 flex-col gap-2",
627
+ children: [
628
+ !V && /* @__PURE__ */ C(ne, {
629
+ htmlFor: Ae,
630
+ className: a(W.helperText, lt),
631
+ label: Z.instructionsLabel ?? "Instructions",
632
+ required: !0
633
+ }),
634
+ /* @__PURE__ */ C("div", {
635
+ ref: je,
636
+ className: a(e, t),
637
+ children: /* @__PURE__ */ C(se, {
638
+ fallback: /* @__PURE__ */ C(x, { ariaLabel: Z.instructionsLoadingAriaLabel ?? "Loading" }),
639
+ children: /* @__PURE__ */ C(be, {
640
+ id: Ae,
641
+ ariaLabel: Z.instructionsLabel ?? "Instructions",
642
+ value: K.instructions,
643
+ onChange: (e) => {
644
+ Pe.reset(), J({ instructions: e });
645
+ },
646
+ theme: De,
647
+ placeholder: Z.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
648
+ })
573
649
  })
574
- })
575
- }),
576
- E?.instructions != null && /* @__PURE__ */ v(d, { text: E.instructions })
577
- ]
650
+ }),
651
+ D?.instructions != null && /* @__PURE__ */ C(h, { text: D.instructions })
652
+ ]
653
+ })
578
654
  })
579
- ] }) : $?.kind === I.File && (fe ?? /* @__PURE__ */ v(s, { text: X.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." }))
655
+ ] }) : $?.kind === z.File && (U ?? /* @__PURE__ */ C(d, { text: Z.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." }))
580
656
  ]
581
657
  })
582
658
  }),
583
- /* @__PURE__ */ v(pe, {
584
- isOpen: Y,
659
+ /* @__PURE__ */ C(ye, {
660
+ isOpen: $e,
585
661
  onClose: () => {
586
- Ne(!1), Fe(void 0);
662
+ et(!1), nt(void 0);
587
663
  },
588
- fileActions: R,
589
- initialFiles: Pe,
590
- labels: ge
664
+ fileActions: H,
665
+ initialFiles: tt,
666
+ labels: we
591
667
  })
592
668
  ]
593
669
  });
594
670
  };
595
671
  //#endregion
596
- export { W as SkillEditor, fe as SkillFileCandidateKind, I as SkillFileNodeKind, z as SkillFileValidationStatus };
672
+ export { fe as SKILL_EDITOR_CLASS, G as SkillEditor, H as SkillFileCandidateKind, z as SkillFileNodeKind, U as SkillFileValidationStatus };