@epam/ai-dial-projects 1.3.0-dev.214 → 1.3.0-dev.223

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.
@@ -0,0 +1,156 @@
1
+ import { Attachment, TextRefinementCallback, TextRefinementLabels } from '@epam/ai-dial-chat-shared';
2
+ import { EditorThemes } from '@epam/ai-dial-ui-kit';
3
+ import { ContextFileRejection } from '../types/context-file-rejection';
4
+ import { ProjectNameError } from '../types/project-name-error';
5
+ /** Text fields of the {@link ProjectCreateForm}, owned by the host. */
6
+ export interface ProjectCreateFormValues {
7
+ /** Project name; the host trims it before sending. */
8
+ name: string;
9
+ /** Plain-text description. */
10
+ description: string;
11
+ /** Markdown instructions. */
12
+ instructions: string;
13
+ }
14
+ /** Host-supplied errors, e.g. from a rejected create request. */
15
+ export interface ProjectCreateFormErrors {
16
+ /** Shown under Name; takes precedence over the form's own name check. */
17
+ name?: string;
18
+ /** Shown under the Context drop zone. */
19
+ context?: string;
20
+ }
21
+ /** Localized labels used by the {@link ProjectCreateForm} component. */
22
+ export interface ProjectCreateFormLabels {
23
+ /** Page title, e.g. "New project". */
24
+ title: string;
25
+ /** Accessible name of the back button. */
26
+ backLabel: string;
27
+ /** Cancel button label. */
28
+ cancelLabel: string;
29
+ /** Create button label. */
30
+ createLabel: string;
31
+ /** Create button label while the request is in flight. Defaults to `createLabel`. */
32
+ submittingLabel?: string;
33
+ /** Name field label. */
34
+ nameLabel: string;
35
+ /** Name field placeholder, e.g. "Enter project name". */
36
+ namePlaceholder: string;
37
+ /** Message per client-side name check failure. */
38
+ nameErrors: Record<ProjectNameError, string>;
39
+ /** Description field label. */
40
+ descriptionLabel: string;
41
+ /** Description placeholder, e.g. "Describe what the project is about". */
42
+ descriptionPlaceholder: string;
43
+ /** Instructions field label. */
44
+ instructionsLabel: string;
45
+ /** Instructions editor placeholder. */
46
+ instructionsPlaceholder: string;
47
+ /** Context section label. */
48
+ contextLabel: string;
49
+ /** Drop zone copy, e.g. "Drag&drop context, upload from device or file manager". */
50
+ dropZoneLabel: string;
51
+ /** Drop zone hint, e.g. "File formats .csv, .pdf and .xlsx (max 1 MB)". */
52
+ dropZoneHint: string;
53
+ /** Add menu trigger label. */
54
+ addLabel: string;
55
+ /** Add menu item that opens the device file picker. */
56
+ addFromDeviceLabel: string;
57
+ /** Add menu item that opens the host's file manager. */
58
+ addFromFileManagerLabel: string;
59
+ /** Title of the overlay shown while files are dragged over the form. */
60
+ dropOverlayTitle?: string;
61
+ /** Subtitle of that overlay. */
62
+ dropOverlaySubtitle?: string;
63
+ /** Accessible name of the capacity meter, e.g. "Context capacity". */
64
+ capacityMeterLabel: string;
65
+ /** Visible capacity text, e.g. "10% of capacity used". */
66
+ capacityLabel: (percent: number) => string;
67
+ /** Accessible name of a file card's remove button, e.g. "Remove tickets.csv". */
68
+ removeFileLabel: (name: string) => string;
69
+ /** Message per client-side file rejection, given the file name. */
70
+ fileRejections: Record<ContextFileRejection, (name: string) => string>;
71
+ /** Announced after files are added, e.g. "2 files added". */
72
+ filesAddedStatus: (count: number) => string;
73
+ /** Announced after a file is removed, e.g. "tickets.csv removed". */
74
+ fileRemovedStatus: (name: string) => string;
75
+ /** Announced when a submission starts, e.g. "Creating project…". */
76
+ creatingStatus: string;
77
+ /** Refine with AI copy for Description and Instructions. */
78
+ refinement?: TextRefinementLabels;
79
+ }
80
+ /**
81
+ * Color overrides for the {@link ProjectCreateForm} component, applied as CSS
82
+ * custom properties with app theme fallbacks.
83
+ */
84
+ export interface ProjectCreateFormColors {
85
+ /** Page background. Fallback: `--bg-layer-base`. */
86
+ background?: string;
87
+ /** Header border. Fallback: `--stroke-tertiary`. */
88
+ headerBorder?: string;
89
+ /** Hint, rejection and capacity text. Fallback: `--text-secondary`. */
90
+ helperText?: string;
91
+ /** Capacity meter track. Fallback: `--bg-layer-sunken`. */
92
+ meterTrack?: string;
93
+ /** Capacity meter fill. Fallback: `--stroke-accent`. */
94
+ meterFill?: string;
95
+ }
96
+ /** Typography overrides for the {@link ProjectCreateForm} component. */
97
+ export interface ProjectCreateFormTypography {
98
+ /** CSS class applied to the page title. Defaults to `'dial-h1-text'`. */
99
+ titleClassName?: string;
100
+ /** CSS class applied to field labels. Defaults to `'dial-body-semi-text'`. */
101
+ labelClassName?: string;
102
+ /** CSS class applied to hints, rejections and capacity text. Defaults to `'dial-tiny-text'`. */
103
+ helperClassName?: string;
104
+ }
105
+ /** Style overrides for the {@link ProjectCreateForm} component. */
106
+ export interface ProjectCreateFormStyles {
107
+ /** Color overrides applied as CSS custom properties. */
108
+ colors?: ProjectCreateFormColors;
109
+ /** Typography class overrides. */
110
+ typography?: ProjectCreateFormTypography;
111
+ }
112
+ /** Props for the {@link ProjectCreateForm} component. */
113
+ export interface ProjectCreateFormProps {
114
+ /** Current field values (controlled). */
115
+ values: ProjectCreateFormValues;
116
+ /** Host-supplied field errors. */
117
+ errors: ProjectCreateFormErrors;
118
+ /** Called with a field and its new value. */
119
+ onFieldChange: <K extends keyof ProjectCreateFormValues>(field: K, value: ProjectCreateFormValues[K]) => void;
120
+ /** Context files added so far (controlled). */
121
+ contextFiles: Attachment[];
122
+ /** Called with the next context file list after an add or a remove. */
123
+ onContextFilesChange: (files: Attachment[]) => void;
124
+ /** Lower-case extensions, without a dot, accepted as context files. */
125
+ allowedExtensions: string[];
126
+ /** Maximum size of one context file, in bytes. */
127
+ maxFileBytes: number;
128
+ /** Maximum combined size of the context files (the capacity), in bytes. */
129
+ maxTotalBytes: number;
130
+ /**
131
+ * Opens the host's file manager and resolves the picked files, or
132
+ * `undefined` when cancelled. The File manager source is hidden when omitted.
133
+ */
134
+ onPickFromFileManager?: () => Promise<File[] | undefined>;
135
+ /** Rewrites the description; the Refine with AI action is hidden when omitted. */
136
+ onRefineDescription?: TextRefinementCallback;
137
+ /** Rewrites the instructions; the Refine with AI action is hidden when omitted. */
138
+ onRefineInstructions?: TextRefinementCallback;
139
+ /** Called when the user activates the back button. */
140
+ onBack: () => void;
141
+ /** Called when the user activates Cancel. */
142
+ onCancel: () => void;
143
+ /** Called when the user activates Create on a valid form. */
144
+ onSubmit: () => void;
145
+ /** Disables Create and shows its loading state. Defaults to `false`. */
146
+ isSubmitting?: boolean;
147
+ /** Localized labels. */
148
+ labels: ProjectCreateFormLabels;
149
+ /** Theme of the markdown editor. */
150
+ markdownEditorTheme?: EditorThemes;
151
+ /** Additional CSS class on the root element. */
152
+ className?: string;
153
+ /** Color and typography overrides. */
154
+ styles?: ProjectCreateFormStyles;
155
+ }
156
+ //# sourceMappingURL=project-create-form-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-create-form-props.d.ts","sourceRoot":"","sources":["../../src/models/project-create-form-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,uEAAuE;AACvE,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,iEAAiE;AACjE,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wEAAwE;AACxE,MAAM,WAAW,uBAAuB;IACtC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,2BA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IAAI,CAAC;IACpD,uEAAuE;IACvE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC;IAC1D,kFAAkF;IAClF,mBAAmB,CAAC,EAAE,sBAAsB,CAAC;IAC7C,mFAAmF;IACnF,oBAAoB,CAAC,EAAE,sBAAsB,CAAC;IAC9C,sDAAsD;IACtD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wBAAwB;IACxB,MAAM,EAAE,uBAAuB,CAAC;IAChC,oCAAoC;IACpC,mBAAmB,CAAC,EAAE,YAAY,CAAC;IACnC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC"}
@@ -5,9 +5,11 @@ export interface ProjectItem {
5
5
  id: string;
6
6
  /** Display name, matched by search and highlighted. */
7
7
  name: string;
8
- /** Where the project comes from; selects the source badge label. */
8
+ /** Where the project comes from; its label is the first segment of the card's folder path. */
9
9
  source: ProjectSource;
10
- /** Last-updated time in epoch milliseconds; the card omits its date line when unset. */
10
+ /** `/`-separated grouping folders the project sits in, shown after the source in the folder path. */
11
+ parentPath?: string;
12
+ /** Last-updated time in epoch milliseconds, used by the date sort orders. */
11
13
  updatedAt?: number;
12
14
  }
13
15
  //# sourceMappingURL=project-item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-item.d.ts","sourceRoot":"","sources":["../../src/models/project-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,MAAM,EAAE,aAAa,CAAC;IACtB,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
1
+ {"version":3,"file":"project-item.d.ts","sourceRoot":"","sources":["../../src/models/project-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,8FAA8F;IAC9F,MAAM,EAAE,aAAa,CAAC;IACtB,qGAAqG;IACrG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -30,10 +30,14 @@ export interface ProjectsLabels {
30
30
  incompleteLabel: string;
31
31
  /** Label of the retry action shown when loading failed. */
32
32
  retryLabel: string;
33
- /** Text of the source badge for each project source. */
33
+ /** Label of each project source, the first segment of a card's folder path. */
34
34
  sourceLabels: Record<ProjectSource, string>;
35
+ /** Accessible name of a card's folder path, e.g. "Project location". */
36
+ folderPathLabel: string;
35
37
  /** Announced through the status region when projects are listed, e.g. "3 projects". */
36
38
  resultCountLabel: (count: number) => string;
39
+ /** Label of the header and empty-state New project buttons; required whenever `onCreateProject` is supplied. */
40
+ createProjectLabel?: string;
37
41
  }
38
42
  /**
39
43
  * Color overrides for the {@link Projects} component, applied as CSS custom
@@ -48,16 +52,12 @@ export interface ProjectsColors {
48
52
  sortButtonText?: string;
49
53
  /** Card background. Fallback: `--bg-layer-raised`. */
50
54
  cardBackground?: string;
51
- /** Card border color. Fallback: `--stroke-tertiary`. */
52
- cardBorder?: string;
53
55
  /** Project name color on a card. Fallback: `--text-primary`. */
54
56
  cardTitleText?: string;
55
- /** Source badge background. Fallback: `--bg-layer-sunken`. */
56
- badgeBackground?: string;
57
- /** Source badge text color. Fallback: `--text-primary`. */
58
- badgeText?: string;
59
- /** Last-updated date text color on a card. Fallback: `--text-secondary`. */
60
- metaText?: string;
57
+ /** Divider above a card's folder path. Fallback: `--stroke-tertiary`. */
58
+ cardDivider?: string;
59
+ /** Folder path text color on a card. Fallback: `--text-secondary`. */
60
+ pathText?: string;
61
61
  }
62
62
  /** Typography overrides for the {@link Projects} component. */
63
63
  export interface ProjectsTypography {
@@ -67,10 +67,10 @@ export interface ProjectsTypography {
67
67
  subtitleClassName?: string;
68
68
  /** CSS class applied to each card's project name. Defaults to `'dial-body-semi-text'`. */
69
69
  cardTitleClassName?: string;
70
- /** CSS class applied to each card's source badge. Defaults to `'dial-tiny-semi-text'`. */
71
- badgeClassName?: string;
72
- /** CSS class applied to each card's last-updated date. Defaults to `'dial-small-text'`. */
73
- metaClassName?: string;
70
+ /** CSS class applied to the non-leaf folder path segments. Defaults to `'dial-tiny-text'`. */
71
+ pathLabelClassName?: string;
72
+ /** CSS class applied to the last folder path segment. Defaults to `'dial-tiny-semi-text'`. */
73
+ pathLeafClassName?: string;
74
74
  }
75
75
  /** Style overrides for the {@link Projects} component. */
76
76
  export interface ProjectsStyles {
@@ -91,6 +91,8 @@ export interface ProjectsProps {
91
91
  incompleteSources?: ProjectSource[];
92
92
  /** Called when the user activates the retry action. */
93
93
  onRetry: () => void;
94
+ /** Called from the New project buttons; the buttons are not rendered when omitted. */
95
+ onCreateProject?: () => void;
94
96
  /** Current search query (controlled). */
95
97
  searchQuery: string;
96
98
  /** Called with the new query when the user types or clears the search. */
@@ -99,8 +101,6 @@ export interface ProjectsProps {
99
101
  sortKey: ProjectsSortKey;
100
102
  /** Called when the user picks another sort order. */
101
103
  onSortKeyChange: (sortKey: ProjectsSortKey) => void;
102
- /** Formats a card's last-updated time (epoch milliseconds) as display text. */
103
- formatUpdatedAt: (timestamp: number) => string;
104
104
  /** Localized labels. */
105
105
  labels: ProjectsLabels;
106
106
  /** BCP 47 locale used to collate names for the Name A–Z order. Defaults to the runtime locale. */
@@ -1 +1 @@
1
- {"version":3,"file":"projects-props.d.ts","sourceRoot":"","sources":["../../src/models/projects-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qDAAqD;IACrD,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,8DAA8D;IAC9D,cAAc,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,eAAe,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,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C;IAC5B,8FAA8F;IAC9F,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,0DAA0D;AAC1D,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,kCAAkC;IAClC,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC;AAED,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,iFAAiF;IACjF,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yHAAyH;IACzH,iBAAiB,CAAC,EAAE,aAAa,EAAE,CAAC;IACpC,uDAAuD;IACvD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sFAAsF;IACtF,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,uCAAuC;IACvC,OAAO,EAAE,eAAe,CAAC;IACzB,qDAAqD;IACrD,eAAe,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,wBAAwB;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,kGAAkG;IAClG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-projects",
3
- "description": "Presentational Projects page shell — searchable, sortable grid of the projects available to a user",
4
- "version": "1.3.0-dev.214",
3
+ "description": "Presentational Projects page shell and New project form — searchable, sortable grid of the projects available to a user",
4
+ "version": "1.3.0-dev.223",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,10 +17,14 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "@tabler/icons-react": "^3.44.0"
20
+ "@epam/ai-dial-attachment-input": "1.3.0-dev.223",
21
+ "@epam/ai-dial-builder-form": "1.3.0-dev.223",
22
+ "@tabler/icons-react": "^3.44.0",
23
+ "@uiw/react-markdown-preview": "^5.2.1",
24
+ "@uiw/react-md-editor": "^4.1.1"
21
25
  },
22
26
  "peerDependencies": {
23
- "@epam/ai-dial-chat-shared": "1.3.0-dev.214",
27
+ "@epam/ai-dial-chat-shared": "1.3.0-dev.223",
24
28
  "@epam/ai-dial-ui-kit": "^0.16.0-dev.45",
25
29
  "react": "^19.2.8"
26
30
  },
@@ -0,0 +1,14 @@
1
+ /** Why {@link checkContextFiles} rejected a context file. */
2
+ export declare enum ContextFileRejection {
3
+ /** The extension is not in the allowed list. */
4
+ UnsupportedType = "unsupported-type",
5
+ /** The file is larger than the per-file limit. */
6
+ TooLarge = "too-large",
7
+ /** Adding the file would push the total over the capacity. */
8
+ CapacityExceeded = "capacity-exceeded",
9
+ /** A file with the same name is already added. */
10
+ Duplicate = "duplicate",
11
+ /** The file name is not a valid DIAL resource name. */
12
+ InvalidName = "invalid-name"
13
+ }
14
+ //# sourceMappingURL=context-file-rejection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-file-rejection.d.ts","sourceRoot":"","sources":["../../src/types/context-file-rejection.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,oBAAY,oBAAoB;IAC9B,gDAAgD;IAChD,eAAe,qBAAqB;IACpC,kDAAkD;IAClD,QAAQ,cAAc;IACtB,8DAA8D;IAC9D,gBAAgB,sBAAsB;IACtC,kDAAkD;IAClD,SAAS,cAAc;IACvB,uDAAuD;IACvD,WAAW,iBAAiB;CAC7B"}
@@ -0,0 +1,12 @@
1
+ /** Why {@link validateProjectName} rejected a project name. */
2
+ export declare enum ProjectNameError {
3
+ /** The name is empty or whitespace only. */
4
+ Required = "required",
5
+ /** The name contains a forbidden or control character. */
6
+ InvalidCharacters = "invalid-characters",
7
+ /** The name is one DIAL Core reserves (`v`, `files`, `.dial-resource`, …). */
8
+ Reserved = "reserved",
9
+ /** The name is longer than 255 UTF-8 bytes. */
10
+ TooLong = "too-long"
11
+ }
12
+ //# sourceMappingURL=project-name-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-name-error.d.ts","sourceRoot":"","sources":["../../src/types/project-name-error.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,oBAAY,gBAAgB;IAC1B,4CAA4C;IAC5C,QAAQ,aAAa;IACrB,0DAA0D;IAC1D,iBAAiB,uBAAuB;IACxC,8EAA8E;IAC9E,QAAQ,aAAa;IACrB,+CAA+C;IAC/C,OAAO,aAAa;CACrB"}
@@ -0,0 +1,36 @@
1
+ import { Attachment } from '@epam/ai-dial-chat-shared';
2
+ import { ContextFileRejection } from '../types/context-file-rejection';
3
+ /** Limits a batch of incoming context files is checked against. */
4
+ export interface ContextFileLimits {
5
+ /** Lower-case extensions, without a dot. */
6
+ allowedExtensions: string[];
7
+ /** Maximum size of one file, in bytes. */
8
+ maxFileBytes: number;
9
+ /** Maximum combined size of all context files, in bytes. */
10
+ maxTotalBytes: number;
11
+ }
12
+ /** One rejected incoming file. */
13
+ export interface RejectedContextFile {
14
+ name: string;
15
+ reason: ContextFileRejection;
16
+ }
17
+ /** Result of {@link checkContextFiles}. */
18
+ export interface ContextFileCheck {
19
+ /** Files to append, already shaped as staged attachments. */
20
+ accepted: Attachment[];
21
+ /** Files that were not added, in input order. */
22
+ rejected: RejectedContextFile[];
23
+ }
24
+ /** Sum of the `file.size` of every context file, in bytes. */
25
+ export declare const getContextFilesSize: (files: Attachment[]) => number;
26
+ /**
27
+ * Splits incoming files into those that can be added to `existing` and those
28
+ * that cannot, with the same rules `POST /api/v1/projects` enforces: an
29
+ * allowed extension, the per-file size, the running total against the
30
+ * capacity, a unique name (against `existing` and earlier files in the same
31
+ * batch), and a valid DIAL name. Pure — the caller appends `accepted`.
32
+ */
33
+ export declare const checkContextFiles: (incoming: File[], existing: Attachment[], limits: ContextFileLimits) => ContextFileCheck;
34
+ /** Share of the capacity in use, as a whole percentage clamped to 0–100. */
35
+ export declare const getCapacityPercent: (usedBytes: number, maxBytes: number) => number;
36
+ //# sourceMappingURL=context-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-files.d.ts","sourceRoot":"","sources":["../../src/utils/context-files.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EAIhB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGvE,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,iDAAiD;IACjD,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAQD,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,GAAI,OAAO,UAAU,EAAE,KAAG,MACY,CAAC;AA4CvE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,IAAI,EAAE,EAChB,UAAU,UAAU,EAAE,EACtB,QAAQ,iBAAiB,KACxB,gBAkBF,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,GAC7B,WAAW,MAAM,EACjB,UAAU,MAAM,KACf,MAGF,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { ProjectNameError } from '../types/project-name-error';
2
+ /** Upper bound of a DIAL resource name, in UTF-8 bytes. */
3
+ export declare const PROJECT_NAME_MAX_BYTES = 255;
4
+ /**
5
+ * Checks a project (or context file) name against the rule
6
+ * `POST /api/v1/projects` enforces, so the form rejects early. The name is
7
+ * trimmed first, because the host trims it before sending. Returns `null`
8
+ * for a valid name.
9
+ */
10
+ export declare const validateProjectName: (name: string) => ProjectNameError | null;
11
+ //# sourceMappingURL=project-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-name.d.ts","sourceRoot":"","sources":["../../src/utils/project-name.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAqB1C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,gBAAgB,GAAG,IAWrE,CAAC"}