@iblai/iblai-js 1.27.1 → 2.2.1
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.
|
@@ -61547,6 +61547,7 @@ var datasetsTabLabels$3 = {
|
|
|
61547
61547
|
title: "Datasets",
|
|
61548
61548
|
description: "Manage training datasets and knowledge sources."
|
|
61549
61549
|
},
|
|
61550
|
+
infoBox: "Teach your agent with your own material. Upload documents, files, or links and it'll answer from them — grounded in your content instead of guessing.",
|
|
61550
61551
|
search: {
|
|
61551
61552
|
placeholder: "Search datasets..."
|
|
61552
61553
|
},
|
|
@@ -67246,6 +67247,7 @@ var datasetsTabLabels$2 = {
|
|
|
67246
67247
|
title: "Jeux de données",
|
|
67247
67248
|
description: "Gérez les jeux de données d'entraînement et les sources de connaissances."
|
|
67248
67249
|
},
|
|
67250
|
+
infoBox: "Formez votre agent avec vos propres contenus. Importez des documents, des fichiers ou des liens, et il y puisera ses réponses — en s'appuyant sur votre contenu plutôt qu'en devinant.",
|
|
67249
67251
|
search: {
|
|
67250
67252
|
placeholder: "Rechercher des jeux de données..."
|
|
67251
67253
|
},
|
|
@@ -72945,6 +72947,7 @@ var datasetsTabLabels$1 = {
|
|
|
72945
72947
|
title: "Conjuntos de datos",
|
|
72946
72948
|
description: "Administre los conjuntos de datos de entrenamiento y las fuentes de conocimiento."
|
|
72947
72949
|
},
|
|
72950
|
+
infoBox: "Enseña a tu agente con tu propio material. Sube documentos, archivos o enlaces y responderá a partir de ellos, basándose en tu contenido en lugar de adivinar.",
|
|
72948
72951
|
search: {
|
|
72949
72952
|
placeholder: "Buscar conjuntos de datos..."
|
|
72950
72953
|
},
|
|
@@ -78644,6 +78647,7 @@ var datasetsTabLabels = {
|
|
|
78644
78647
|
title: "数据集",
|
|
78645
78648
|
description: "管理训练数据集和知识来源。"
|
|
78646
78649
|
},
|
|
78650
|
+
infoBox: "用您自己的资料训练智能体。上传文档、文件或链接,它就会依据这些内容作答——基于您的内容,而不是凭空猜测。",
|
|
78647
78651
|
search: {
|
|
78648
78652
|
placeholder: "搜索数据集..."
|
|
78649
78653
|
},
|
|
@@ -225219,23 +225223,36 @@ function useAgentSettings() {
|
|
|
225219
225223
|
return ctx;
|
|
225220
225224
|
}
|
|
225221
225225
|
|
|
225222
|
-
function useDatasetsWithPagination(itemsPerPage = 5) {
|
|
225226
|
+
function useDatasetsWithPagination(itemsPerPage = 5, opts = {}) {
|
|
225227
|
+
const { page: controlledPage, search: controlledSearch, onPageChange, onSearchChange } = opts;
|
|
225228
|
+
// Controlled/uncontrolled is decided per axis, independently.
|
|
225229
|
+
const isPageControlled = controlledPage !== undefined;
|
|
225230
|
+
const isSearchControlled = controlledSearch !== undefined;
|
|
225223
225231
|
const { tenantKey, mentorId, username } = useAgentSettings();
|
|
225224
|
-
|
|
225232
|
+
// Input echo — keeps typing responsive in both modes and is the source of
|
|
225233
|
+
// truth for the search term when uncontrolled. Seeded from the controlled
|
|
225234
|
+
// value so a URL-driven search shows up immediately on mount.
|
|
225235
|
+
const [searchQuery, setSearchQuery] = React__default.useState(isSearchControlled ? controlledSearch : '');
|
|
225225
225236
|
const [debouncedSearchQuery] = a(searchQuery, 500);
|
|
225226
|
-
const [
|
|
225237
|
+
const [localPage, setLocalPage] = React__default.useState(1);
|
|
225227
225238
|
const [isTraining, setIsTraining] = React__default.useState(false);
|
|
225228
|
-
const
|
|
225229
|
-
|
|
225230
|
-
|
|
225231
|
-
|
|
225232
|
-
|
|
225239
|
+
const currentPage = isPageControlled ? controlledPage : localPage;
|
|
225240
|
+
// Reset to the first page during render (not in an effect) when the debounced
|
|
225241
|
+
// search changes, so the query never fires with a stale offset. Only touches
|
|
225242
|
+
// internal page state — in page-controlled mode the host performs the reset
|
|
225243
|
+
// via the onSearchChange contract above.
|
|
225244
|
+
const [lastSearchQuery, setLastSearchQuery] = React__default.useState(debouncedSearchQuery);
|
|
225245
|
+
if (lastSearchQuery !== debouncedSearchQuery) {
|
|
225246
|
+
setLastSearchQuery(debouncedSearchQuery);
|
|
225247
|
+
if (!isPageControlled)
|
|
225248
|
+
setLocalPage(1);
|
|
225249
|
+
}
|
|
225233
225250
|
const { data: datasets, isLoading: isDatasetsLoading, isFetching: isDatasetsFetching, } = useGetTrainingDocumentsQuery({
|
|
225234
225251
|
org: tenantKey,
|
|
225235
225252
|
pathway: mentorId,
|
|
225236
|
-
limit:
|
|
225237
|
-
offset:
|
|
225238
|
-
search:
|
|
225253
|
+
limit: itemsPerPage,
|
|
225254
|
+
offset: (currentPage - 1) * itemsPerPage,
|
|
225255
|
+
search: debouncedSearchQuery,
|
|
225239
225256
|
// @ts-expect-error userId is not in the typed args but the API accepts it
|
|
225240
225257
|
userId: username !== null && username !== void 0 ? username : '',
|
|
225241
225258
|
}, {
|
|
@@ -225256,24 +225273,31 @@ function useDatasetsWithPagination(itemsPerPage = 5) {
|
|
|
225256
225273
|
setIsTraining(_isTraining);
|
|
225257
225274
|
}
|
|
225258
225275
|
}, [isDatasetsFetching]);
|
|
225259
|
-
//
|
|
225276
|
+
// Report the debounced search back to the host (search-controlled only).
|
|
225277
|
+
// Firing this implies a page reset — see the onSearchChange contract above.
|
|
225260
225278
|
React__default.useEffect(() => {
|
|
225261
|
-
|
|
225262
|
-
|
|
225263
|
-
|
|
225264
|
-
|
|
225265
|
-
|
|
225266
|
-
|
|
225279
|
+
if (!isSearchControlled)
|
|
225280
|
+
return;
|
|
225281
|
+
if (debouncedSearchQuery === controlledSearch)
|
|
225282
|
+
return;
|
|
225283
|
+
onSearchChange === null || onSearchChange === void 0 ? void 0 : onSearchChange(debouncedSearchQuery);
|
|
225284
|
+
}, [debouncedSearchQuery, isSearchControlled]);
|
|
225285
|
+
// Reconcile the input echo when the controlled search changes externally
|
|
225286
|
+
// (back/forward, reload, shared link) without clobbering in-flight typing.
|
|
225267
225287
|
React__default.useEffect(() => {
|
|
225268
|
-
|
|
225269
|
-
|
|
225270
|
-
|
|
225271
|
-
|
|
225272
|
-
|
|
225273
|
-
|
|
225274
|
-
}, [debouncedSearchQuery]);
|
|
225288
|
+
if (!isSearchControlled)
|
|
225289
|
+
return;
|
|
225290
|
+
if (controlledSearch === debouncedSearchQuery)
|
|
225291
|
+
return;
|
|
225292
|
+
setSearchQuery(controlledSearch);
|
|
225293
|
+
}, [controlledSearch, isSearchControlled]);
|
|
225275
225294
|
const handlePageChange = (newPage) => {
|
|
225276
|
-
|
|
225295
|
+
if (isPageControlled) {
|
|
225296
|
+
onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange(newPage);
|
|
225297
|
+
}
|
|
225298
|
+
else {
|
|
225299
|
+
setLocalPage(newPage);
|
|
225300
|
+
}
|
|
225277
225301
|
// Scroll to top of the list when changing pages
|
|
225278
225302
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
225279
225303
|
};
|
|
@@ -227128,6 +227152,9 @@ var addMentorToProjectModal = /*#__PURE__*/Object.freeze({
|
|
|
227128
227152
|
AddMentorToProjectModal: AddMentorToProjectModal
|
|
227129
227153
|
});
|
|
227130
227154
|
|
|
227155
|
+
const CustomSwitch = React.forwardRef(({ className, checked, onCheckedChange, ...props }, ref) => (jsx(Root$a, { checked: checked, onCheckedChange: onCheckedChange, className: cn('peer focus-visible:ring-ring focus-visible:ring-offset-background inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=unchecked]:bg-gray-200', className), ...props, ref: ref, children: jsx(Thumb, { className: cn('pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0') }) })));
|
|
227156
|
+
CustomSwitch.displayName = Root$a.displayName;
|
|
227157
|
+
|
|
227131
227158
|
const DeleteDatasetModal$1 = dynamic(() => Promise.resolve().then(function () { return deleteDatasetModal; }).then((mod) => ({
|
|
227132
227159
|
default: mod.DeleteDatasetModal,
|
|
227133
227160
|
})));
|
|
@@ -227229,7 +227256,7 @@ function TrainingStatusSwitch({ is_trained, url, training_status, disabled, hand
|
|
|
227229
227256
|
if (training_status === 'pending') {
|
|
227230
227257
|
return (jsx(Badge, { variant: "outline", className: "bg-blue-50 text-blue-700", children: t('datasetsTabDatasetItem.inProgress') }));
|
|
227231
227258
|
}
|
|
227232
|
-
return (jsx(
|
|
227259
|
+
return (jsx(CustomSwitch, { checked: is_trained, onCheckedChange: () => {
|
|
227233
227260
|
// If trying to train an untrained dataset, show the modal
|
|
227234
227261
|
if (!is_trained) {
|
|
227235
227262
|
onTrainRequest === null || onTrainRequest === void 0 ? void 0 : onTrainRequest();
|
|
@@ -227287,6 +227314,7 @@ const AGENT_DATASETS_TAB_LABELS = {
|
|
|
227287
227314
|
title: 'Datasets',
|
|
227288
227315
|
description: 'Manage training datasets and knowledge sources.',
|
|
227289
227316
|
},
|
|
227317
|
+
infoBox: "Teach your agent with your own material. Upload documents, files, or links and it'll answer from them — grounded in your content instead of guessing.",
|
|
227290
227318
|
search: {
|
|
227291
227319
|
placeholder: 'Search datasets...',
|
|
227292
227320
|
},
|
|
@@ -227346,6 +227374,7 @@ function buildDatasetsTabLabels(t) {
|
|
|
227346
227374
|
title: t('datasetsTabLabels.header.title'),
|
|
227347
227375
|
description: t('datasetsTabLabels.header.description'),
|
|
227348
227376
|
},
|
|
227377
|
+
infoBox: t('datasetsTabLabels.infoBox'),
|
|
227349
227378
|
search: {
|
|
227350
227379
|
placeholder: t('datasetsTabLabels.search.placeholder'),
|
|
227351
227380
|
},
|
|
@@ -98750,6 +98750,7 @@ var datasetsTabLabels$3 = {
|
|
|
98750
98750
|
title: "Datasets",
|
|
98751
98751
|
description: "Manage training datasets and knowledge sources."
|
|
98752
98752
|
},
|
|
98753
|
+
infoBox: "Teach your agent with your own material. Upload documents, files, or links and it'll answer from them — grounded in your content instead of guessing.",
|
|
98753
98754
|
search: {
|
|
98754
98755
|
placeholder: "Search datasets..."
|
|
98755
98756
|
},
|
|
@@ -104449,6 +104450,7 @@ var datasetsTabLabels$2 = {
|
|
|
104449
104450
|
title: "Jeux de données",
|
|
104450
104451
|
description: "Gérez les jeux de données d'entraînement et les sources de connaissances."
|
|
104451
104452
|
},
|
|
104453
|
+
infoBox: "Formez votre agent avec vos propres contenus. Importez des documents, des fichiers ou des liens, et il y puisera ses réponses — en s'appuyant sur votre contenu plutôt qu'en devinant.",
|
|
104452
104454
|
search: {
|
|
104453
104455
|
placeholder: "Rechercher des jeux de données..."
|
|
104454
104456
|
},
|
|
@@ -110148,6 +110150,7 @@ var datasetsTabLabels$1 = {
|
|
|
110148
110150
|
title: "Conjuntos de datos",
|
|
110149
110151
|
description: "Administre los conjuntos de datos de entrenamiento y las fuentes de conocimiento."
|
|
110150
110152
|
},
|
|
110153
|
+
infoBox: "Enseña a tu agente con tu propio material. Sube documentos, archivos o enlaces y responderá a partir de ellos, basándose en tu contenido en lugar de adivinar.",
|
|
110151
110154
|
search: {
|
|
110152
110155
|
placeholder: "Buscar conjuntos de datos..."
|
|
110153
110156
|
},
|
|
@@ -115847,6 +115850,7 @@ var datasetsTabLabels = {
|
|
|
115847
115850
|
title: "数据集",
|
|
115848
115851
|
description: "管理训练数据集和知识来源。"
|
|
115849
115852
|
},
|
|
115853
|
+
infoBox: "用您自己的资料训练智能体。上传文档、文件或链接,它就会依据这些内容作答——基于您的内容,而不是凭空猜测。",
|
|
115850
115854
|
search: {
|
|
115851
115855
|
placeholder: "搜索数据集..."
|
|
115852
115856
|
},
|
|
@@ -250000,23 +250004,36 @@ function useAgentSettings() {
|
|
|
250000
250004
|
return ctx;
|
|
250001
250005
|
}
|
|
250002
250006
|
|
|
250003
|
-
function useDatasetsWithPagination(itemsPerPage = 5) {
|
|
250007
|
+
function useDatasetsWithPagination(itemsPerPage = 5, opts = {}) {
|
|
250008
|
+
const { page: controlledPage, search: controlledSearch, onPageChange, onSearchChange } = opts;
|
|
250009
|
+
// Controlled/uncontrolled is decided per axis, independently.
|
|
250010
|
+
const isPageControlled = controlledPage !== undefined;
|
|
250011
|
+
const isSearchControlled = controlledSearch !== undefined;
|
|
250004
250012
|
const { tenantKey, mentorId, username } = useAgentSettings();
|
|
250005
|
-
|
|
250013
|
+
// Input echo — keeps typing responsive in both modes and is the source of
|
|
250014
|
+
// truth for the search term when uncontrolled. Seeded from the controlled
|
|
250015
|
+
// value so a URL-driven search shows up immediately on mount.
|
|
250016
|
+
const [searchQuery, setSearchQuery] = React__default.useState(isSearchControlled ? controlledSearch : '');
|
|
250006
250017
|
const [debouncedSearchQuery] = a$3(searchQuery, 500);
|
|
250007
|
-
const [
|
|
250018
|
+
const [localPage, setLocalPage] = React__default.useState(1);
|
|
250008
250019
|
const [isTraining, setIsTraining] = React__default.useState(false);
|
|
250009
|
-
const
|
|
250010
|
-
|
|
250011
|
-
|
|
250012
|
-
|
|
250013
|
-
|
|
250020
|
+
const currentPage = isPageControlled ? controlledPage : localPage;
|
|
250021
|
+
// Reset to the first page during render (not in an effect) when the debounced
|
|
250022
|
+
// search changes, so the query never fires with a stale offset. Only touches
|
|
250023
|
+
// internal page state — in page-controlled mode the host performs the reset
|
|
250024
|
+
// via the onSearchChange contract above.
|
|
250025
|
+
const [lastSearchQuery, setLastSearchQuery] = React__default.useState(debouncedSearchQuery);
|
|
250026
|
+
if (lastSearchQuery !== debouncedSearchQuery) {
|
|
250027
|
+
setLastSearchQuery(debouncedSearchQuery);
|
|
250028
|
+
if (!isPageControlled)
|
|
250029
|
+
setLocalPage(1);
|
|
250030
|
+
}
|
|
250014
250031
|
const { data: datasets, isLoading: isDatasetsLoading, isFetching: isDatasetsFetching, } = useGetTrainingDocumentsQuery({
|
|
250015
250032
|
org: tenantKey,
|
|
250016
250033
|
pathway: mentorId,
|
|
250017
|
-
limit:
|
|
250018
|
-
offset:
|
|
250019
|
-
search:
|
|
250034
|
+
limit: itemsPerPage,
|
|
250035
|
+
offset: (currentPage - 1) * itemsPerPage,
|
|
250036
|
+
search: debouncedSearchQuery,
|
|
250020
250037
|
// @ts-expect-error userId is not in the typed args but the API accepts it
|
|
250021
250038
|
userId: username !== null && username !== void 0 ? username : '',
|
|
250022
250039
|
}, {
|
|
@@ -250037,24 +250054,31 @@ function useDatasetsWithPagination(itemsPerPage = 5) {
|
|
|
250037
250054
|
setIsTraining(_isTraining);
|
|
250038
250055
|
}
|
|
250039
250056
|
}, [isDatasetsFetching]);
|
|
250040
|
-
//
|
|
250057
|
+
// Report the debounced search back to the host (search-controlled only).
|
|
250058
|
+
// Firing this implies a page reset — see the onSearchChange contract above.
|
|
250041
250059
|
React__default.useEffect(() => {
|
|
250042
|
-
|
|
250043
|
-
|
|
250044
|
-
|
|
250045
|
-
|
|
250046
|
-
|
|
250047
|
-
|
|
250060
|
+
if (!isSearchControlled)
|
|
250061
|
+
return;
|
|
250062
|
+
if (debouncedSearchQuery === controlledSearch)
|
|
250063
|
+
return;
|
|
250064
|
+
onSearchChange === null || onSearchChange === void 0 ? void 0 : onSearchChange(debouncedSearchQuery);
|
|
250065
|
+
}, [debouncedSearchQuery, isSearchControlled]);
|
|
250066
|
+
// Reconcile the input echo when the controlled search changes externally
|
|
250067
|
+
// (back/forward, reload, shared link) without clobbering in-flight typing.
|
|
250048
250068
|
React__default.useEffect(() => {
|
|
250049
|
-
|
|
250050
|
-
|
|
250051
|
-
|
|
250052
|
-
|
|
250053
|
-
|
|
250054
|
-
|
|
250055
|
-
}, [debouncedSearchQuery]);
|
|
250069
|
+
if (!isSearchControlled)
|
|
250070
|
+
return;
|
|
250071
|
+
if (controlledSearch === debouncedSearchQuery)
|
|
250072
|
+
return;
|
|
250073
|
+
setSearchQuery(controlledSearch);
|
|
250074
|
+
}, [controlledSearch, isSearchControlled]);
|
|
250056
250075
|
const handlePageChange = (newPage) => {
|
|
250057
|
-
|
|
250076
|
+
if (isPageControlled) {
|
|
250077
|
+
onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange(newPage);
|
|
250078
|
+
}
|
|
250079
|
+
else {
|
|
250080
|
+
setLocalPage(newPage);
|
|
250081
|
+
}
|
|
250058
250082
|
// Scroll to top of the list when changing pages
|
|
250059
250083
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
250060
250084
|
};
|
|
@@ -251957,6 +251981,9 @@ var addMentorToProjectModal = /*#__PURE__*/Object.freeze({
|
|
|
251957
251981
|
AddMentorToProjectModal: AddMentorToProjectModal
|
|
251958
251982
|
});
|
|
251959
251983
|
|
|
251984
|
+
const CustomSwitch = React.forwardRef(({ className, checked, onCheckedChange, ...props }, ref) => (jsx(Root$c, { checked: checked, onCheckedChange: onCheckedChange, className: cn('peer focus-visible:ring-ring focus-visible:ring-offset-background inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=unchecked]:bg-gray-200', className), ...props, ref: ref, children: jsx(Thumb, { className: cn('pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0') }) })));
|
|
251985
|
+
CustomSwitch.displayName = Root$c.displayName;
|
|
251986
|
+
|
|
251960
251987
|
const DeleteDatasetModal$1 = dynamic(() => Promise.resolve().then(function () { return deleteDatasetModal; }).then((mod) => ({
|
|
251961
251988
|
default: mod.DeleteDatasetModal,
|
|
251962
251989
|
})));
|
|
@@ -252058,7 +252085,7 @@ function TrainingStatusSwitch({ is_trained, url, training_status, disabled, hand
|
|
|
252058
252085
|
if (training_status === 'pending') {
|
|
252059
252086
|
return (jsx(Badge, { variant: "outline", className: "bg-blue-50 text-blue-700", children: t('datasetsTabDatasetItem.inProgress') }));
|
|
252060
252087
|
}
|
|
252061
|
-
return (jsx(
|
|
252088
|
+
return (jsx(CustomSwitch, { checked: is_trained, onCheckedChange: () => {
|
|
252062
252089
|
// If trying to train an untrained dataset, show the modal
|
|
252063
252090
|
if (!is_trained) {
|
|
252064
252091
|
onTrainRequest === null || onTrainRequest === void 0 ? void 0 : onTrainRequest();
|
|
@@ -252116,6 +252143,7 @@ const AGENT_DATASETS_TAB_LABELS = {
|
|
|
252116
252143
|
title: 'Datasets',
|
|
252117
252144
|
description: 'Manage training datasets and knowledge sources.',
|
|
252118
252145
|
},
|
|
252146
|
+
infoBox: "Teach your agent with your own material. Upload documents, files, or links and it'll answer from them — grounded in your content instead of guessing.",
|
|
252119
252147
|
search: {
|
|
252120
252148
|
placeholder: 'Search datasets...',
|
|
252121
252149
|
},
|
|
@@ -252175,6 +252203,7 @@ function buildDatasetsTabLabels(t) {
|
|
|
252175
252203
|
title: t('datasetsTabLabels.header.title'),
|
|
252176
252204
|
description: t('datasetsTabLabels.header.description'),
|
|
252177
252205
|
},
|
|
252206
|
+
infoBox: t('datasetsTabLabels.infoBox'),
|
|
252178
252207
|
search: {
|
|
252179
252208
|
placeholder: t('datasetsTabLabels.search.placeholder'),
|
|
252180
252209
|
},
|
|
@@ -260103,9 +260132,6 @@ function BasicSubTab({ form, labels, mentor, isDisabled, categories }) {
|
|
|
260103
260132
|
}, className: "hidden" })] })] })) })) })] }));
|
|
260104
260133
|
}
|
|
260105
260134
|
|
|
260106
|
-
const CustomSwitch = React.forwardRef(({ className, checked, onCheckedChange, ...props }, ref) => (jsx(Root$c, { checked: checked, onCheckedChange: onCheckedChange, className: cn('peer focus-visible:ring-ring focus-visible:ring-offset-background inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=unchecked]:bg-gray-200', className), ...props, ref: ref, children: jsx(Thumb, { className: cn('pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0') }) })));
|
|
260107
|
-
CustomSwitch.displayName = Root$c.displayName;
|
|
260108
|
-
|
|
260109
260135
|
/**
|
|
260110
260136
|
* A single label + info-tooltip + `CustomSwitch` row bound to a boolean field
|
|
260111
260137
|
* of the settings form. Collapses the block that was copy-pasted for every
|
|
@@ -265347,15 +265373,29 @@ function AgentHumanSupportTab({ PaginationComponent = IblPagination, labels: lab
|
|
|
265347
265373
|
: labels.list.untitled }) }), jsx("div", { className: "mx-auto w-full max-w-full overflow-x-hidden", children: selectedTicket && renderTicketDetail(selectedTicket) })] }) })] }));
|
|
265348
265374
|
}
|
|
265349
265375
|
|
|
265350
|
-
function AgentDatasetsTab({ labels: labelsOverride, onSelect, selectedDatasetId, AddResourceModal, PaginationComponent, }) {
|
|
265376
|
+
function AgentDatasetsTab({ labels: labelsOverride, onSelect, selectedDatasetId, AddResourceModal, PaginationComponent, page, search, onPageChange, onSearchChange, }) {
|
|
265351
265377
|
var _a;
|
|
265352
|
-
const { executeGatedAction } = useAgentSettings();
|
|
265378
|
+
const { tenantKey, mentorId, username, rbacPermissions, executeGatedAction } = useAgentSettings();
|
|
265353
265379
|
const t = useT();
|
|
265354
265380
|
const labels = React__default.useMemo(() => resolveDatasetsTabLabels(labelsOverride, t), [labelsOverride, t]);
|
|
265355
265381
|
const [showAddResourceModal, setShowAddResourceModal] = React__default.useState(false);
|
|
265356
265382
|
const openAddResourceModal = () => setShowAddResourceModal(true);
|
|
265357
265383
|
const closeAddResourceModal = () => setShowAddResourceModal(false);
|
|
265358
|
-
const {
|
|
265384
|
+
const { data: mentorSettings } = useGetMentorSettingsQuery({
|
|
265385
|
+
mentor: mentorId,
|
|
265386
|
+
org: tenantKey,
|
|
265387
|
+
// @ts-ignore
|
|
265388
|
+
userId: username !== null && username !== void 0 ? username : '',
|
|
265389
|
+
}, {
|
|
265390
|
+
skip: !mentorId || !tenantKey || !username,
|
|
265391
|
+
});
|
|
265392
|
+
// The RBAC path uses the mentor DB id returned by the settings query — the
|
|
265393
|
+
// URL/modal mentor id is not the same value as the one RBAC permissions are
|
|
265394
|
+
// keyed by. While mentor_id is undefined (still loading), the path will not
|
|
265395
|
+
// match any entry and WithPermissions resolves hasPermission=false.
|
|
265396
|
+
// @ts-ignore mentor_id exists on MentorSettings
|
|
265397
|
+
const createResource = `/mentors/${mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_id}/documents/#create`;
|
|
265398
|
+
const { datasets, isDatasetsLoading, isDatasetsFetching, searchQuery, setSearchQuery, currentPage, totalPages, handlePageChange, } = useDatasetsWithPagination(5, { page, search, onPageChange, onSearchChange });
|
|
265359
265399
|
const handleAddResourceClick = () => {
|
|
265360
265400
|
if (executeGatedAction) {
|
|
265361
265401
|
executeGatedAction(() => openAddResourceModal());
|
|
@@ -265364,14 +265404,22 @@ function AgentDatasetsTab({ labels: labelsOverride, onSelect, selectedDatasetId,
|
|
|
265364
265404
|
openAddResourceModal();
|
|
265365
265405
|
}
|
|
265366
265406
|
};
|
|
265367
|
-
return (jsxs(Fragment$1, { children: [jsx("div", { className: "flex h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: labels.header.title }), jsx("p", { className: "text-xs text-gray-600", children: labels.header.description })] }) }),
|
|
265407
|
+
return (jsxs(Fragment$1, { children: [jsx("div", { className: "flex h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: labels.header.title }), jsx("p", { className: "text-xs text-gray-600", children: labels.header.description })] }) }), jsxs("div", { className: "flex-1 space-y-4 p-3 lg:p-4", style: {
|
|
265368
265408
|
overflowY: 'auto',
|
|
265369
265409
|
overflowX: 'hidden',
|
|
265370
|
-
}, children: jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center", children: [jsxs("div", { className: "relative w-full sm:w-64", children: [isDatasetsFetching ? (jsx(Spinner, { className: "absolute top-2.5 left-2.5 h-4 w-4 text-
|
|
265371
|
-
//
|
|
265410
|
+
}, children: [jsx("div", { className: "rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-600", "data-testid": "datasets-info-box", children: labels.infoBox }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center", children: [jsxs("div", { className: "relative w-full sm:w-64", children: [isDatasetsFetching ? (jsx(Spinner, { className: "absolute top-2.5 left-2.5 h-4 w-4 text-blue-500" })) : (jsx(Search, { className: "absolute top-2.5 left-2.5 h-4 w-4 text-gray-500" })), jsx(Input
|
|
265411
|
+
// `type="text"` (not "search") so the browser renders no
|
|
265412
|
+
// native clear (✕) button; the Search icon + placeholder
|
|
265413
|
+
// convey the search affordance instead.
|
|
265372
265414
|
, {
|
|
265415
|
+
// `type="text"` (not "search") so the browser renders no
|
|
265416
|
+
// native clear (✕) button; the Search icon + placeholder
|
|
265417
|
+
// convey the search affordance instead.
|
|
265418
|
+
type: "text", placeholder: labels.search.placeholder, className: "pl-8", value: searchQuery, onChange: (event) => setSearchQuery(event.target.value) })] }), jsx(WithPermissions, { rbacResource: createResource, rbacPermissions: rbacPermissions !== null && rbacPermissions !== void 0 ? rbacPermissions : {}, children: ({ hasPermission }) => hasPermission ? (jsxs(Button$1, { onClick: handleAddResourceClick, size: "sm", className: "cursor-pointer bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), labels.addResource.button] })) : null })] }), jsx("div", { className: "overflow-hidden rounded-md border", children: jsx("div", { className: "overflow-x-auto sm:mx-0", children: jsx("div", { className: "inline-block min-w-full align-middle", children: isDatasetsLoading ? (jsx("div", { className: "flex w-full items-center justify-center py-10", children: jsx(Spinner, {}) })) : (jsxs(Table$1, { className: "min-w-full", children: [jsx(TableHeader$1, { children: jsxs(TableRow$1, { className: "bg-muted/50 border-b", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.nameColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.typeColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.tokensColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.intervalColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.visibilityColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.statusColumn })] }) }), jsx(DatasetItemList
|
|
265373
265419
|
// @ts-ignore - Type mismatch between RetrieverDocumentEmbedding[] and Dataset[], id property type difference
|
|
265374
|
-
|
|
265420
|
+
, {
|
|
265421
|
+
// @ts-ignore - Type mismatch between RetrieverDocumentEmbedding[] and Dataset[], id property type difference
|
|
265422
|
+
datasets: (_a = datasets === null || datasets === void 0 ? void 0 : datasets.results) !== null && _a !== void 0 ? _a : [], onSelect: onSelect, selectedDatasetId: selectedDatasetId, labels: labels })] })) }) }) }), PaginationComponent && (jsx(PaginationComponent, { currentPage: currentPage, totalPages: totalPages, onPageChange: handlePageChange, disabled: isDatasetsFetching || isDatasetsLoading })), AddResourceModal && (jsx(AddResourceModal, { isOpen: showAddResourceModal, onClose: () => closeAddResourceModal(), keepParentOpen: true }))] })] })] }));
|
|
265375
265423
|
}
|
|
265376
265424
|
|
|
265377
265425
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iblai/iblai-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Unified JavaScript SDK for IBL.ai — re-exports data-layer, web-containers, and web-utils under a single package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"axios": "1.13.6",
|
|
77
77
|
"dotenv": "16.6.1",
|
|
78
78
|
"winston": "3.19.0",
|
|
79
|
-
"@iblai/
|
|
80
|
-
"@iblai/
|
|
79
|
+
"@iblai/mcp": "1.8.3",
|
|
80
|
+
"@iblai/data-layer": "1.11.0",
|
|
81
81
|
"@iblai/web-containers": "1.15.7",
|
|
82
|
-
"@iblai/
|
|
82
|
+
"@iblai/web-utils": "2.1.1"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@radix-ui/react-dialog": "^1.1.7",
|