@epam/ai-dial-skill-editor 1.2.0-dev.12 → 1.2.0-dev.120

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