@iblai/iblai-js 1.11.5 → 1.11.7
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.
|
@@ -219068,7 +219068,10 @@ function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInC
|
|
|
219068
219068
|
}
|
|
219069
219069
|
|
|
219070
219070
|
function TasksTabToolbar({ taskDate, setTaskDate, setIsScheduleTaskDialogOpen, searchQuery, setSearchQuery, labels, }) {
|
|
219071
|
-
return (jsxs("div", { className: "flex flex-col sm:flex-row items-center gap-4", children: [jsxs("div", { className: "relative flex-1 w-full", children: [jsx(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-500" }), jsx(Input, { className: "pl-10 w-full", placeholder: labels.toolbar.searchPlaceholder, value: searchQuery, onChange: (e) => setSearchQuery(e.target.value) })] }), jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", className: "flex items-center gap-2 justify-start w-full sm:w-auto bg-transparent", children: [jsx(Calendar$1, { className: "h-4 w-4" }), jsx("span", { children: taskDate ? format(taskDate, 'MM/dd/yyyy') : labels.toolbar.selectDate })] }) }), jsx(PopoverContent, { className: "w-auto p-0", align: "start", children: jsx(Calendar, { mode: "single", selected: taskDate, onSelect: setTaskDate,
|
|
219071
|
+
return (jsxs("div", { className: "flex flex-col sm:flex-row items-center gap-4", children: [jsxs("div", { className: "relative flex-1 w-full", children: [jsx(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-500" }), jsx(Input, { className: "pl-10 w-full", placeholder: labels.toolbar.searchPlaceholder, value: searchQuery, onChange: (e) => setSearchQuery(e.target.value) })] }), jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", className: "flex items-center gap-2 justify-start w-full sm:w-auto bg-transparent", children: [jsx(Calendar$1, { className: "h-4 w-4" }), jsx("span", { children: taskDate ? format(taskDate, 'MM/dd/yyyy') : labels.toolbar.selectDate })] }) }), jsx(PopoverContent, { className: "w-auto p-0", align: "start", portalled: false, children: jsx(Calendar, { mode: "single", selected: taskDate, onSelect: setTaskDate, classNames: {
|
|
219072
|
+
day_button: 'data-[selected-single=true]:bg-[#2563EB] data-[selected-single=true]:text-white data-[range-start=true]:bg-[#2563EB] data-[range-start=true]:text-white data-[range-end=true]:bg-[#2563EB] data-[range-end=true]:text-white',
|
|
219073
|
+
today: 'bg-blue-50 text-[#2563EB] data-[selected=true]:bg-[#2563EB] data-[selected=true]:text-white',
|
|
219074
|
+
}, initialFocus: true }) })] }), jsxs(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white font-medium w-full sm:w-auto", onClick: () => setIsScheduleTaskDialogOpen(true), children: [jsx(Plus, { className: "h-4 w-4 mr-2" }), labels.toolbar.scheduleTask] })] }));
|
|
219072
219075
|
}
|
|
219073
219076
|
|
|
219074
219077
|
function TaskMetricsCards({ tasksData, labels }) {
|
|
@@ -219523,6 +219526,21 @@ function combineDateAndTime(date, time) {
|
|
|
219523
219526
|
result.setHours(hour, minute, 0, 0);
|
|
219524
219527
|
return result;
|
|
219525
219528
|
}
|
|
219529
|
+
const TASK_DATE_FILTER_FORMAT = 'yyyy-MM-dd';
|
|
219530
|
+
function formatTaskDateFilter(date) {
|
|
219531
|
+
return format(date, TASK_DATE_FILTER_FORMAT);
|
|
219532
|
+
}
|
|
219533
|
+
function getTaskDateFilterValue(task) {
|
|
219534
|
+
var _a, _b;
|
|
219535
|
+
const rawData = task.rawData;
|
|
219536
|
+
const rawDate = (_b = (_a = rawData === null || rawData === void 0 ? void 0 : rawData.task) === null || _a === void 0 ? void 0 : _a.start_time) !== null && _b !== void 0 ? _b : rawData === null || rawData === void 0 ? void 0 : rawData.created_at;
|
|
219537
|
+
if (!rawDate)
|
|
219538
|
+
return undefined;
|
|
219539
|
+
const date = new Date(rawDate);
|
|
219540
|
+
if (Number.isNaN(date.getTime()))
|
|
219541
|
+
return undefined;
|
|
219542
|
+
return formatTaskDateFilter(date);
|
|
219543
|
+
}
|
|
219526
219544
|
function AgentTasksTab({ PaginationComponent = DefaultTasksPagination, labels: labelsOverride, }) {
|
|
219527
219545
|
var _a, _b, _c;
|
|
219528
219546
|
const { tenantKey, mentorId, username } = useAgentSettings();
|
|
@@ -219540,11 +219558,18 @@ function AgentTasksTab({ PaginationComponent = DefaultTasksPagination, labels: l
|
|
|
219540
219558
|
const [debouncedSearchQuery] = a$3(searchQuery, 300);
|
|
219541
219559
|
const tasksPerPage = 5;
|
|
219542
219560
|
const logsPerPage = 5;
|
|
219561
|
+
const taskSearchFilterValue = debouncedSearchQuery.trim();
|
|
219562
|
+
const taskDateFilterValue = useMemo(() => (taskDate ? formatTaskDateFilter(taskDate) : undefined), [taskDate]);
|
|
219543
219563
|
// Fetch periodic agents
|
|
219544
219564
|
const { data: periodicAgentsData, isLoading } = useGetPeriodicAgentsQuery({
|
|
219545
219565
|
org: tenantKey,
|
|
219546
219566
|
// @ts-ignore - userId is not part of the generated query arg type
|
|
219547
219567
|
userId: username,
|
|
219568
|
+
mentorId,
|
|
219569
|
+
...(taskDateFilterValue
|
|
219570
|
+
? { startDate: taskDateFilterValue, endDate: taskDateFilterValue }
|
|
219571
|
+
: {}),
|
|
219572
|
+
...(taskSearchFilterValue ? { search: taskSearchFilterValue } : {}),
|
|
219548
219573
|
}, {
|
|
219549
219574
|
skip: !tenantKey || !username || !mentorId,
|
|
219550
219575
|
});
|
|
@@ -219612,16 +219637,13 @@ function AgentTasksTab({ PaginationComponent = DefaultTasksPagination, labels: l
|
|
|
219612
219637
|
rawData: agent,
|
|
219613
219638
|
};
|
|
219614
219639
|
})) || [];
|
|
219615
|
-
//
|
|
219640
|
+
// The text search is sent to the API; date filtering stays local as a
|
|
219641
|
+
// fallback for API responses that return the full page.
|
|
219616
219642
|
const filteredTasks = useMemo(() => {
|
|
219617
|
-
|
|
219618
|
-
|
|
219619
|
-
|
|
219620
|
-
|
|
219621
|
-
task.time.toLowerCase().includes(query) ||
|
|
219622
|
-
task.repeat.toLowerCase().includes(query) ||
|
|
219623
|
-
task.status.toLowerCase().includes(query));
|
|
219624
|
-
}, [tasksData, debouncedSearchQuery]);
|
|
219643
|
+
return taskDateFilterValue
|
|
219644
|
+
? tasksData.filter((task) => getTaskDateFilterValue(task) === taskDateFilterValue)
|
|
219645
|
+
: tasksData;
|
|
219646
|
+
}, [tasksData, taskDateFilterValue]);
|
|
219625
219647
|
// Transform logs data for UI display
|
|
219626
219648
|
const taskLogs = ((_b = periodicAgentLogsData === null || periodicAgentLogsData === void 0 ? void 0 : periodicAgentLogsData.results) === null || _b === void 0 ? void 0 : _b.map((log) => ({
|
|
219627
219649
|
id: log.id.toString(),
|
|
@@ -219632,10 +219654,10 @@ function AgentTasksTab({ PaginationComponent = DefaultTasksPagination, labels: l
|
|
|
219632
219654
|
startTime: log.start_time,
|
|
219633
219655
|
endTime: log.end_time,
|
|
219634
219656
|
}))) || [];
|
|
219635
|
-
// Reset to page 1 when
|
|
219657
|
+
// Reset to page 1 when filters change
|
|
219636
219658
|
useEffect(() => {
|
|
219637
219659
|
setTasksCurrentPage(1);
|
|
219638
|
-
}, [
|
|
219660
|
+
}, [taskSearchFilterValue, taskDateFilterValue]);
|
|
219639
219661
|
// Reset logs pagination when the selected task changes
|
|
219640
219662
|
useEffect(() => {
|
|
219641
219663
|
setLogsCurrentPage(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iblai/iblai-js",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.7",
|
|
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": {
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"axios": "1.13.6",
|
|
62
62
|
"dotenv": "16.6.1",
|
|
63
63
|
"winston": "3.19.0",
|
|
64
|
-
"@iblai/
|
|
65
|
-
"@iblai/web-
|
|
66
|
-
"@iblai/data-layer": "1.5.
|
|
67
|
-
"@iblai/
|
|
64
|
+
"@iblai/web-containers": "1.7.7",
|
|
65
|
+
"@iblai/web-utils": "1.7.1",
|
|
66
|
+
"@iblai/data-layer": "1.5.11",
|
|
67
|
+
"@iblai/mcp": "1.4.14"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@radix-ui/react-dialog": "^1.1.7",
|