@epam/ai-dial-chat-hooks 1.2.0-dev.164 → 1.2.0-dev.170

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,153 +1,159 @@
1
1
  import { getApiErrorDetails as e, getApiErrorStatus as t } from "../api-error/api-error.js";
2
- import { buildSkillFilesPayload as n, buildSkillManifestForSubmit as r, isValidSkillRelativePath as i, normalizeSkillName as a, startsWithFrontmatterBlock as o } from "./skill.js";
3
- import { useCallback as s, useRef as c, useState as l } from "react";
4
- import { NotificationVariant as u } from "@epam/ai-dial-ui-kit";
2
+ import { SKILL_TEXT_FIELD_MAX_LENGTHS as n, buildSkillFilesPayload as r, buildSkillManifestForSubmit as i, getSkillFieldLengthViolations as a, isValidSkillRelativePath as o, normalizeSkillName as s, startsWithFrontmatterBlock as c } from "./skill.js";
3
+ import { useCallback as l, useRef as u, useState as d } from "react";
4
+ import { NotificationVariant as f } from "@epam/ai-dial-ui-kit";
5
5
  //#region src/skill/useSkillEditorSubmit.ts
6
- var d = (e, t) => JSON.stringify({
6
+ var p = (e, t) => JSON.stringify({
7
7
  values: e,
8
8
  files: [...t].sort((e, t) => e.path.localeCompare(t.path))
9
- }), f = ({ bucket: f, isEditMode: p, files: m, filesContentRef: h, frontmatterRef: g, loadedPathRef: _, etagRef: v, returnUrl: y, getCreateReturnUrl: b, refetchSkills: x, client: S, messages: C, onNavigate: w, onNotify: T }) => {
10
- let [E, D] = l({}), [O, k] = l(), [A, j] = l(!1), [M, N] = l(), [P, F] = l("idle"), I = c(null), L = c(null), R = s(async (n) => {
9
+ }), m = ({ bucket: m, isEditMode: h, files: g, filesContentRef: _, frontmatterRef: v, loadedPathRef: y, etagRef: b, returnUrl: x, getCreateReturnUrl: S, refetchSkills: C, client: w, messages: T, onNavigate: E, onNotify: D }) => {
10
+ let [O, k] = d({}), [A, j] = d(), [M, N] = d(!1), [P, F] = d(), [I, L] = d("idle"), R = u(null), z = u(null), B = l(async (n) => {
11
11
  switch (t(n)) {
12
12
  case 409:
13
- D({ name: C.nameConflict });
13
+ k({ name: T.nameConflict });
14
14
  return;
15
15
  case 412:
16
- D({ name: C.nameConflict });
16
+ k({ name: T.nameConflict });
17
17
  return;
18
18
  case 413:
19
- k(C.archiveTooLarge);
19
+ j(T.archiveTooLarge);
20
20
  return;
21
21
  case 503:
22
- k(C.serviceUnavailable), j(!0);
22
+ j(T.serviceUnavailable), N(!0);
23
23
  return;
24
24
  case 400: {
25
25
  let { message: t } = await e(n);
26
- k(t ?? C.pathInvalid);
26
+ j(t ?? T.pathInvalid);
27
27
  return;
28
28
  }
29
29
  default: {
30
30
  let { traceId: t } = await e(n);
31
- k(C.saveError), T({
32
- variant: u.Error,
33
- message: C.saveError,
31
+ j(T.saveError), D({
32
+ variant: f.Error,
33
+ message: T.saveError,
34
34
  requestId: t
35
35
  });
36
36
  }
37
37
  }
38
- }, [C, T]), z = s(async (e) => {
39
- let t = a(e.name);
40
- if (!t || !i(t)) {
41
- D({ name: C.nameInvalid });
38
+ }, [T, D]), V = l(async (e) => {
39
+ let t = s(e.name);
40
+ if (!t || !o(t)) {
41
+ k({ name: T.nameInvalid });
42
42
  return;
43
43
  }
44
- let o = d(e, m), s = I.current, c = s != null && s.fingerprint === o, l = t, p, _, v;
45
- c ? {skillManifest: p, filePaths: _, files: v} = s : (p = r(g.current, t, e.description, e.instructions), {filePaths: _, files: v} = n(m, h.current)), F("submitting"), I.current = {
46
- fingerprint: o,
47
- bucket: f,
44
+ let n = p(e, g), a = R.current, c = a != null && a.fingerprint === n, l = t, u, d, h;
45
+ c ? {skillManifest: u, filePaths: d, files: h} = a : (u = i(v.current, t, e.description, e.instructions), {filePaths: d, files: h} = r(g, _.current)), L("submitting"), R.current = {
46
+ fingerprint: n,
47
+ bucket: m,
48
48
  path: l,
49
- skillManifest: p,
50
- filePaths: _,
51
- files: v
49
+ skillManifest: u,
50
+ filePaths: d,
51
+ files: h
52
52
  };
53
53
  try {
54
- await S.createSkill(f, l, p, _, v), await x(), F("success"), T({
55
- variant: u.Success,
56
- title: C.saveSuccessTitle,
57
- message: C.createSuccess(t)
58
- }), w(b?.(l) ?? y);
54
+ await w.createSkill(m, l, u, d, h), await C(), L("success"), D({
55
+ variant: f.Success,
56
+ title: T.saveSuccessTitle,
57
+ message: T.createSuccess(t)
58
+ }), E(S?.(l) ?? x);
59
59
  } catch (e) {
60
- F("failure"), await R(e);
60
+ L("failure"), await B(e);
61
61
  }
62
62
  }, [
63
- f,
64
63
  m,
65
- h,
66
64
  g,
67
- C,
68
- S,
65
+ _,
66
+ v,
69
67
  T,
70
68
  w,
71
- y,
72
- b,
69
+ D,
70
+ E,
73
71
  x,
74
- R
75
- ]), B = s(async (e) => {
76
- let i = _.current, a = v.current;
77
- if (!i || !a) {
78
- k(C.saveError);
72
+ S,
73
+ C,
74
+ B
75
+ ]), H = l(async (e) => {
76
+ let n = y.current, a = b.current;
77
+ if (!n || !a) {
78
+ j(T.saveError);
79
79
  return;
80
80
  }
81
- let o = r(g.current, e.name, e.description, e.instructions), { filePaths: s, files: c } = n(m, h.current);
82
- F("submitting");
81
+ let o = i(v.current, e.name, e.description, e.instructions), { filePaths: s, files: c } = r(g, _.current);
82
+ L("submitting");
83
83
  try {
84
- v.current = (await S.updateSkill(f, i, o, s, c, a)).etag ?? a, await x(), F("success"), T({
85
- variant: u.Success,
86
- title: C.updateSuccessTitle,
87
- message: C.updateSuccess(e.name)
88
- }), w(y);
84
+ b.current = (await w.updateSkill(m, n, o, s, c, a)).etag ?? a, await C(), L("success"), D({
85
+ variant: f.Success,
86
+ title: T.updateSuccessTitle,
87
+ message: T.updateSuccess(e.name)
88
+ }), E(x);
89
89
  } catch (e) {
90
- if (F("failure"), t(e) === 412) {
91
- N({ message: C.conflictMessage });
90
+ if (L("failure"), t(e) === 412) {
91
+ F({ message: T.conflictMessage });
92
92
  return;
93
93
  }
94
- await R(e);
94
+ await B(e);
95
95
  }
96
96
  }, [
97
- f,
98
97
  m,
99
- h,
100
98
  g,
101
99
  _,
102
100
  v,
103
- C,
104
- S,
101
+ y,
102
+ b,
105
103
  T,
106
104
  w,
107
- y,
105
+ D,
106
+ E,
108
107
  x,
109
- R
110
- ]), V = s((e) => {
111
- let t = o(e.instructions);
112
- D((e) => {
113
- if (t === (e.instructions === C.instructionsFrontmatter)) return e;
114
- if (t) return {
115
- ...e,
116
- instructions: C.instructionsFrontmatter
117
- };
118
- let n = { ...e };
119
- return delete n.instructions, n;
108
+ C,
109
+ B
110
+ ]), U = l((e) => {
111
+ let t = c(e.instructions), r = a(e);
112
+ k((e) => {
113
+ let i = { ...e };
114
+ for (let e of Object.keys(n)) {
115
+ let t = T.tooLong(n[e]);
116
+ r[e] ? i[e] = t : i[e] === t && delete i[e];
117
+ }
118
+ if (!r.instructions) {
119
+ let e = i.instructions === T.instructionsFrontmatter;
120
+ t && !e ? i.instructions = T.instructionsFrontmatter : !t && e && delete i.instructions;
121
+ }
122
+ return Object.keys(i).length === Object.keys(e).length && Object.keys(i).every((t) => i[t] === e[t]) ? e : i;
120
123
  });
121
- }, [C]), H = s(async (e) => {
122
- if (P === "submitting" || !f) return;
124
+ }, [T]), W = l(async (e) => {
125
+ if (I === "submitting" || !m) return;
123
126
  let t = {};
124
- if (e.name.trim() || (t.name = C.required), e.description.trim() || (t.description = C.required), e.instructions.trim() ? o(e.instructions) && (t.instructions = C.instructionsFrontmatter) : t.instructions = C.required, Object.keys(t).length > 0) {
125
- D(t);
127
+ e.name.trim() || (t.name = T.required), e.description.trim() || (t.description = T.required), e.instructions.trim() ? c(e.instructions) && (t.instructions = T.instructionsFrontmatter) : t.instructions = T.required;
128
+ let r = a(e);
129
+ for (let e of Object.keys(r)) t[e] ??= T.tooLong(n[e]);
130
+ if (Object.keys(t).length > 0) {
131
+ k(t);
126
132
  return;
127
133
  }
128
- D({}), k(void 0), j(!1), N(void 0), L.current = e, p ? await B(e) : await z(e);
134
+ k({}), j(void 0), N(!1), F(void 0), z.current = e, h ? await H(e) : await V(e);
129
135
  }, [
130
- P,
131
- f,
132
- C,
133
- p,
134
- B,
135
- z
136
+ I,
137
+ m,
138
+ T,
139
+ h,
140
+ H,
141
+ V
136
142
  ]);
137
143
  return {
138
- phase: P,
139
- errors: E,
140
- submitError: O,
141
- isSubmitErrorRetryable: A,
142
- retrySubmit: s(() => {
143
- let e = L.current;
144
- e != null && H(e);
145
- }, [H]),
146
- conflict: M,
147
- clearConflict: () => N(void 0),
148
- handleSubmit: H,
149
- handleValuesChange: V
144
+ phase: I,
145
+ errors: O,
146
+ submitError: A,
147
+ isSubmitErrorRetryable: M,
148
+ retrySubmit: l(() => {
149
+ let e = z.current;
150
+ e != null && W(e);
151
+ }, [W]),
152
+ conflict: P,
153
+ clearConflict: () => F(void 0),
154
+ handleSubmit: W,
155
+ handleValuesChange: U
150
156
  };
151
157
  };
152
158
  //#endregion
153
- export { f as useSkillEditorSubmit };
159
+ export { m as useSkillEditorSubmit };
@@ -1,99 +1,111 @@
1
- import { SKILL_MANIFEST_FILE as e, buildSkillManifest as t, buildSkillManifestFromFrontmatter as n, nameFromPath as r } from "./skill.js";
2
- import { validateSkillFileBatch as i } from "./skill-file-batch-validation.js";
3
- import { getUtf8ByteLength as a } from "@epam/ai-dial-chat-shared";
4
- import { useCallback as o, useMemo as s, useRef as c, useState as l } from "react";
5
- import { SkillFileNodeKind as u } from "@epam/ai-dial-skill-editor";
1
+ import { SKILL_MANIFEST_FILE as e, buildSkillManifest as t, buildSkillManifestFromFrontmatter as n, isValidSkillRelativePath as r, nameFromPath as i } from "./skill.js";
2
+ import { validateSkillFileBatch as a } from "./skill-file-batch-validation.js";
3
+ import { extractSkillArchive as o } from "./skill-archive.js";
4
+ import { getUtf8ByteLength as s } from "@epam/ai-dial-chat-shared";
5
+ import { useCallback as c, useMemo as l, useRef as u, useState as d } from "react";
6
+ import { SkillFileNodeKind as f } from "@epam/ai-dial-skill-editor";
6
7
  //#region src/skill/useSkillFileActions.ts
7
- var d = ({ files: d, setFiles: f, filesContentRef: p, frontmatterRef: m, loadedValues: h, setLoadedValues: g, isEditMode: _, isDirty: v, setSelectedPath: y, messages: b }) => {
8
- let [x, S] = l(!1), C = c(null), w = o(() => {
9
- let e = d.filter((e) => e.kind === u.File).map((e) => e.path), r = 0;
10
- for (let t of e) r += p.current.get(t)?.bytes.length ?? 0;
8
+ var p = "probe", m = ({ files: m, setFiles: h, filesContentRef: g, frontmatterRef: _, loadedValues: v, setLoadedValues: y, isEditMode: b, isDirty: x, setSelectedPath: S, messages: C, pickFromFileSystem: w }) => {
9
+ let [T, E] = d(!1), D = u(null), O = c(() => {
10
+ let e = m.filter((e) => e.kind === f.File).map((e) => e.path), r = 0;
11
+ for (let t of e) r += g.current.get(t)?.bytes.length ?? 0;
11
12
  let i = {
12
- name: h?.name ?? "",
13
- description: h?.description ?? "",
14
- instructions: h?.instructions ?? ""
15
- }, o = _ ? n(m.current, i.name, i.description, i.instructions) : t(i);
13
+ name: v?.name ?? "",
14
+ description: v?.description ?? "",
15
+ instructions: v?.instructions ?? ""
16
+ }, a = b ? n(_.current, i.name, i.description, i.instructions) : t(i);
16
17
  return {
17
18
  existingPaths: e,
18
19
  existingTotalBytes: r,
19
- manifestByteLength: a(o),
20
- messages: b
20
+ manifestByteLength: s(a),
21
+ messages: C
21
22
  };
22
23
  }, [
23
- d,
24
- p,
25
- _,
26
24
  m,
27
- h,
28
- b
29
- ]), T = o(() => new Promise((e) => {
30
- C.current = e, S(!0);
31
- }), []), E = o((e) => {
32
- S(!1), C.current?.(e), C.current = null;
25
+ g,
26
+ b,
27
+ _,
28
+ v,
29
+ C
30
+ ]), k = c(() => new Promise((e) => {
31
+ D.current = e, E(!0);
32
+ }), []), A = c((e) => {
33
+ E(!1), D.current?.(e), D.current = null;
33
34
  }, []);
34
35
  return {
35
- fileActions: s(() => ({
36
+ fileActions: l(() => ({
36
37
  validateBatch: async (e) => {
37
- let { results: t, batchErrors: n } = await i(e, w());
38
+ let { results: t, batchErrors: n } = await a(e, O());
38
39
  return {
39
40
  results: t,
40
41
  batchErrors: n
41
42
  };
42
43
  },
43
44
  commitBatch: async (e) => {
44
- let { results: t, batchErrors: n, manifestCandidate: a } = await i(e, w());
45
- if (t.some((e) => e.error !== void 0) || n.length > 0) return { error: n[0]?.message ?? b.saveError };
46
- if (a) {
47
- if (_ && a.name !== (h?.name ?? "")) return { error: b.manifestNameMismatch };
48
- if ((_ || v) && !await T()) return { error: b.manifestImportDeclined };
45
+ let { results: t, batchErrors: n, manifestCandidate: r } = await a(e, O());
46
+ if (t.some((e) => e.error !== void 0) || n.length > 0) return { error: n[0]?.message ?? C.saveError };
47
+ if (r) {
48
+ if (b && r.name !== (v?.name ?? "")) return { error: C.manifestNameMismatch };
49
+ if ((b || x) && !await k()) return { error: C.manifestImportDeclined };
49
50
  }
50
51
  try {
51
- let t = e.filter((e) => e.id !== a?.candidateId), n = await Promise.all(t.map(async (e) => ({
52
+ let t = e.filter((e) => e.id !== r?.candidateId), n = await Promise.all(t.map(async (e) => ({
52
53
  path: e.path,
53
54
  bytes: new Uint8Array(await e.file.arrayBuffer()),
54
55
  mimeType: e.file.type || void 0
55
56
  })));
56
- for (let e of n) p.current.set(e.path, {
57
+ for (let e of n) g.current.set(e.path, {
57
58
  bytes: e.bytes,
58
59
  mimeType: e.mimeType
59
60
  });
60
- return n.length > 0 && f((e) => [...e, ...n.map((e) => ({
61
+ return n.length > 0 && h((e) => [...e, ...n.map((e) => ({
61
62
  path: e.path,
62
- name: r(e.path),
63
- kind: u.File
64
- }))]), a && (m.current = _ ? {
65
- ...m.current,
66
- ...a.frontmatter
67
- } : a.frontmatter, g({
68
- name: _ ? h?.name ?? a.name : a.name,
69
- description: a.description,
70
- instructions: a.instructions
63
+ name: i(e.path),
64
+ kind: f.File
65
+ }))]), r && (_.current = b ? {
66
+ ..._.current,
67
+ ...r.frontmatter
68
+ } : r.frontmatter, y({
69
+ name: b ? v?.name ?? r.name : r.name,
70
+ description: r.description,
71
+ instructions: r.instructions
71
72
  })), {};
72
73
  } catch (e) {
73
74
  return { error: e instanceof Error ? e.message : String(e) };
74
75
  }
75
76
  },
76
77
  onRemoveNode: (t) => {
77
- f((e) => e.filter((e) => e.path !== t && !e.path.startsWith(`${t}/`)));
78
- for (let e of [...p.current.keys()]) (e === t || e.startsWith(`${t}/`)) && p.current.delete(e);
79
- y((n) => n === t || n.startsWith(`${t}/`) ? e : n);
80
- }
78
+ h((e) => e.filter((e) => e.path !== t && !e.path.startsWith(`${t}/`)));
79
+ for (let e of [...g.current.keys()]) (e === t || e.startsWith(`${t}/`)) && g.current.delete(e);
80
+ S((n) => n === t || n.startsWith(`${t}/`) ? e : n);
81
+ },
82
+ onCreateFolder: (e) => {
83
+ h((t) => t.some((t) => t.path === e) ? t : [...t, {
84
+ path: e,
85
+ name: i(e),
86
+ kind: f.Folder
87
+ }]);
88
+ },
89
+ validateFolderPath: (e) => r(`${e}/${p}`) ? void 0 : C.pathInvalid,
90
+ extractArchive: o,
91
+ pickFromFileSystem: w
81
92
  }), [
82
- w,
83
- _,
93
+ O,
94
+ b,
95
+ x,
84
96
  v,
85
- h,
86
- T,
87
- p,
88
- m,
89
- f,
97
+ k,
90
98
  g,
99
+ _,
100
+ h,
91
101
  y,
92
- b
102
+ S,
103
+ C,
104
+ w
93
105
  ]),
94
- pendingManifestImport: x,
95
- resolveManifestImport: E
106
+ pendingManifestImport: T,
107
+ resolveManifestImport: A
96
108
  };
97
109
  };
98
110
  //#endregion
99
- export { d as useSkillFileActions };
111
+ export { m as useSkillFileActions };
package/skill-editor.d.ts CHANGED
@@ -7,6 +7,7 @@ import { SkillEditorFileActions } from '@epam/ai-dial-skill-editor';
7
7
  import { SkillEditorValues } from '@epam/ai-dial-skill-editor';
8
8
  import { SkillFileBatchError } from '@epam/ai-dial-skill-editor';
9
9
  import { SkillFileListResponseDto } from '@epam/ai-dial-chat-api-client';
10
+ import { SkillFileSourceEntry } from '@epam/ai-dial-skill-editor';
10
11
  import { SkillFileTreeNode } from '@epam/ai-dial-skill-editor';
11
12
  import { SkillFileUploadCandidate } from '@epam/ai-dial-skill-editor';
12
13
  import { SkillFileValidationResult } from '@epam/ai-dial-skill-editor';
@@ -50,6 +51,9 @@ export declare const buildSkillManifestFromFrontmatter: (baseFrontmatter: Record
50
51
  */
51
52
  export declare const classifySkillArchiveImportError: (status: number | undefined) => SkillArchiveImportErrorKind;
52
53
 
54
+ /** Returns the limit each over-long skill field exceeds, keyed by field; fields within their limit are omitted. */
55
+ export declare const getSkillFieldLengthViolations: (values: Record<SkillTextField, string>) => Partial<Record<SkillTextField, number>>;
56
+
53
57
  /**
54
58
  * Client-side mirror of the backend's `isValidSkillRelativePath`
55
59
  * (`apps/chat-api/src/skills/utils/skill-path.util.ts`), used only for
@@ -105,6 +109,9 @@ export declare const SKILL_FILE_UPLOAD_MAX_BYTES = 1048576;
105
109
  /** Root manifest filename required at the top of every skill archive (mirrors `SKILL_MANIFEST_FILE` in `apps/chat-api/src/skills/utils/skill-path.util.ts`). */
106
110
  export declare const SKILL_MANIFEST_FILE = "SKILL.md";
107
111
 
112
+ /** Length limit of each skill editor text field. */
113
+ export declare const SKILL_TEXT_FIELD_MAX_LENGTHS: Record<SkillTextField, number>;
114
+
108
115
  /**
109
116
  * Client-side mirror of the backend's default `SKILL_UPLOAD_MAX_FILES`
110
117
  * (`apps/chat-api/src/config/environment.config.ts`), used only for
@@ -192,6 +199,8 @@ export declare interface SkillEditorSubmitClient {
192
199
  export declare interface SkillEditorSubmitMessages {
193
200
  /** Shown when a required field is empty. */
194
201
  required: string;
202
+ /** Shown when a name, description or instructions value exceeds its length limit, given that limit. */
203
+ tooLong: (maxLength: number) => string;
195
204
  /**
196
205
  * Shown when the Instructions value opens with its own YAML frontmatter
197
206
  * block — pasting a whole `SKILL.md` in there would otherwise produce a
@@ -363,6 +372,9 @@ export declare interface SkillManifestValues {
363
372
  instructions: string;
364
373
  }
365
374
 
375
+ /** Skill editor text fields with a length limit. */
376
+ export declare type SkillTextField = 'name' | 'description' | 'instructions';
377
+
366
378
  /**
367
379
  * Answers one question: would appending this text after the fence that
368
380
  * `buildSkillManifest` writes produce a *second* frontmatter block?
@@ -559,10 +571,11 @@ export declare interface UseSkillEditorSubmitResult {
559
571
  /**
560
572
  * Owns the Skill Editor's batch file upload workflow: validating a staged
561
573
  * batch, committing it atomically (supporting files plus an optional
562
- * `SKILL.md` manifest import, with a confirmation gate), and removing
574
+ * `SKILL.md` manifest import, with a confirmation gate), creating empty
575
+ * folders, expanding `.zip` archives for staging, and removing
563
576
  * already-committed nodes.
564
577
  */
565
- export declare const useSkillFileActions: ({ files, setFiles, filesContentRef, frontmatterRef, loadedValues, setLoadedValues, isEditMode, isDirty, setSelectedPath, messages, }: UseSkillFileActionsParams) => UseSkillFileActionsResult;
578
+ export declare const useSkillFileActions: ({ files, setFiles, filesContentRef, frontmatterRef, loadedValues, setLoadedValues, isEditMode, isDirty, setSelectedPath, messages, pickFromFileSystem, }: UseSkillFileActionsParams) => UseSkillFileActionsResult;
566
579
 
567
580
  /** Parameters accepted by {@link useSkillFileActions}. */
568
581
  export declare interface UseSkillFileActionsParams {
@@ -586,6 +599,12 @@ export declare interface UseSkillFileActionsParams {
586
599
  setSelectedPath: Dispatch<SetStateAction<string>>;
587
600
  /** Localized messages, resolved by the host. */
588
601
  messages: SkillFileActionsMessages;
602
+ /**
603
+ * Opens the host's file-system picker; passed through unchanged as
604
+ * `fileActions.pickFromFileSystem`. Omit to hide the editor's "Open DIAL
605
+ * file system" entry.
606
+ */
607
+ pickFromFileSystem?: () => Promise<SkillFileSourceEntry[] | undefined>;
589
608
  }
590
609
 
591
610
  /** Return value of {@link useSkillFileActions}. */
package/skill-editor.js CHANGED
@@ -1,9 +1,9 @@
1
- import { SKILL_FILE_UPLOAD_MAX_BYTES as e, SKILL_MANIFEST_FILE as t, SKILL_UPLOAD_MAX_FILES as n, SKILL_UPLOAD_MAX_TOTAL_BYTES as r, buildSkillFilesPayload as i, buildSkillManifest as a, buildSkillManifestForSubmit as o, buildSkillManifestFromFrontmatter as s, isValidSkillRelativePath as c, nameFromPath as l, normalizeSkillName as u, parseSkillManifest as d, skillFileBytesToBlob as f, startsWithFrontmatterBlock as p, unpackSkillArchive as m } from "./skill/skill.js";
2
- import { parseSkillManifestDocument as h } from "./skill/skill-manifest.js";
3
- import { validateSkillFileBatch as g } from "./skill/skill-file-batch-validation.js";
4
- import { skillFileToAttachment as _ } from "./skill/skill-file-preview.js";
5
- import { SkillEditorLoadState as v, useSkillEditorLoad as y } from "./skill/useSkillEditorLoad.js";
6
- import { useSkillEditorSubmit as b } from "./skill/useSkillEditorSubmit.js";
7
- import { useSkillFileActions as x } from "./skill/useSkillFileActions.js";
8
- import { SkillArchiveImportErrorKind as S, SkillArchiveImportStatus as C, SkillArchiveSelectionRejectionReason as w, classifySkillArchiveImportError as T, useSkillArchiveImport as E } from "./skill/useSkillArchiveImport/useSkillArchiveImport.js";
9
- export { e as SKILL_FILE_UPLOAD_MAX_BYTES, t as SKILL_MANIFEST_FILE, n as SKILL_UPLOAD_MAX_FILES, r as SKILL_UPLOAD_MAX_TOTAL_BYTES, S as SkillArchiveImportErrorKind, C as SkillArchiveImportStatus, w as SkillArchiveSelectionRejectionReason, v as SkillEditorLoadState, i as buildSkillFilesPayload, a as buildSkillManifest, o as buildSkillManifestForSubmit, s as buildSkillManifestFromFrontmatter, T as classifySkillArchiveImportError, c as isValidSkillRelativePath, l as nameFromPath, u as normalizeSkillName, d as parseSkillManifest, h as parseSkillManifestDocument, f as skillFileBytesToBlob, _ as skillFileToAttachment, p as startsWithFrontmatterBlock, m as unpackSkillArchive, E as useSkillArchiveImport, y as useSkillEditorLoad, b as useSkillEditorSubmit, x as useSkillFileActions, g as validateSkillFileBatch };
1
+ import { SKILL_FILE_UPLOAD_MAX_BYTES as e, SKILL_MANIFEST_FILE as t, SKILL_TEXT_FIELD_MAX_LENGTHS as n, SKILL_UPLOAD_MAX_FILES as r, SKILL_UPLOAD_MAX_TOTAL_BYTES as i, buildSkillFilesPayload as a, buildSkillManifest as o, buildSkillManifestForSubmit as s, buildSkillManifestFromFrontmatter as c, getSkillFieldLengthViolations as l, isValidSkillRelativePath as u, nameFromPath as d, normalizeSkillName as f, parseSkillManifest as p, skillFileBytesToBlob as m, startsWithFrontmatterBlock as h, unpackSkillArchive as g } from "./skill/skill.js";
2
+ import { parseSkillManifestDocument as _ } from "./skill/skill-manifest.js";
3
+ import { validateSkillFileBatch as v } from "./skill/skill-file-batch-validation.js";
4
+ import { skillFileToAttachment as y } from "./skill/skill-file-preview.js";
5
+ import { SkillEditorLoadState as b, useSkillEditorLoad as x } from "./skill/useSkillEditorLoad.js";
6
+ import { useSkillEditorSubmit as S } from "./skill/useSkillEditorSubmit.js";
7
+ import { useSkillFileActions as C } from "./skill/useSkillFileActions.js";
8
+ import { SkillArchiveImportErrorKind as w, SkillArchiveImportStatus as T, SkillArchiveSelectionRejectionReason as E, classifySkillArchiveImportError as D, useSkillArchiveImport as O } from "./skill/useSkillArchiveImport/useSkillArchiveImport.js";
9
+ export { e as SKILL_FILE_UPLOAD_MAX_BYTES, t as SKILL_MANIFEST_FILE, n as SKILL_TEXT_FIELD_MAX_LENGTHS, r as SKILL_UPLOAD_MAX_FILES, i as SKILL_UPLOAD_MAX_TOTAL_BYTES, w as SkillArchiveImportErrorKind, T as SkillArchiveImportStatus, E as SkillArchiveSelectionRejectionReason, b as SkillEditorLoadState, a as buildSkillFilesPayload, o as buildSkillManifest, s as buildSkillManifestForSubmit, c as buildSkillManifestFromFrontmatter, D as classifySkillArchiveImportError, l as getSkillFieldLengthViolations, u as isValidSkillRelativePath, d as nameFromPath, f as normalizeSkillName, p as parseSkillManifest, _ as parseSkillManifestDocument, m as skillFileBytesToBlob, y as skillFileToAttachment, h as startsWithFrontmatterBlock, g as unpackSkillArchive, O as useSkillArchiveImport, x as useSkillEditorLoad, S as useSkillEditorSubmit, C as useSkillFileActions, v as validateSkillFileBatch };