@iblai/iblai-js 1.11.5 → 1.12.0

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.
@@ -198824,9 +198824,9 @@ const createDynamicSchema = (schemaFields) => {
198824
198824
  provider: z$3.string().min(1, 'Provider is required'),
198825
198825
  };
198826
198826
  schemaFields.forEach((field) => {
198827
- schemaObj[field] = z$3
198827
+ schemaObj[field.name] = z$3
198828
198828
  .string()
198829
- .min(1, `${field.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())} is required`);
198829
+ .min(1, `${field.name.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())} is required`);
198830
198830
  });
198831
198831
  return z$3.object(schemaObj);
198832
198832
  };
@@ -198852,7 +198852,14 @@ function CreateDataSourceModal({ isOpen, onClose, tenantKey, onSuccess }) {
198852
198852
  if (selectedProvider && availableProviders.length > 0) {
198853
198853
  const providerSchema = availableProviders.find((p) => p.name === selectedProvider);
198854
198854
  if (providerSchema) {
198855
- const fields = Object.keys(providerSchema.schema);
198855
+ const fields = Object.entries(providerSchema.schema).map(([name, meta]) => {
198856
+ var _a;
198857
+ return ({
198858
+ name,
198859
+ type: (_a = meta === null || meta === void 0 ? void 0 : meta.type) !== null && _a !== void 0 ? _a : 'string',
198860
+ isSensitive: Boolean(meta === null || meta === void 0 ? void 0 : meta.is_sensitive),
198861
+ });
198862
+ });
198856
198863
  setSchemaFields(fields);
198857
198864
  setShowProviderForm(true);
198858
198865
  }
@@ -198867,8 +198874,8 @@ function CreateDataSourceModal({ isOpen, onClose, tenantKey, onSuccess }) {
198867
198874
  try {
198868
198875
  const requestValue = {};
198869
198876
  schemaFields.forEach((field) => {
198870
- if (value[field]) {
198871
- requestValue[field] = value[field];
198877
+ if (value[field.name]) {
198878
+ requestValue[field.name] = value[field.name];
198872
198879
  }
198873
198880
  });
198874
198881
  await createIntegrationCredential({
@@ -198919,13 +198926,16 @@ function CreateDataSourceModal({ isOpen, onClose, tenantKey, onSuccess }) {
198919
198926
  provider.name;
198920
198927
  return (jsx(SelectItem, { value: provider.name, children: jsxs("div", { className: "flex items-center gap-2", children: [providerLogo ? (jsx("img", { src: providerLogo, alt: provider.name, className: "w-4 h-4 rounded-sm object-contain" })) : (jsx("span", { children: "\uD83D\uDD11" })), providerName || provider.name] }) }, provider.name));
198921
198928
  }) })] }), shouldShowError && (jsx("p", { className: "text-red-500 text-xs", children: (_b = field.state.meta.errors[0]) === null || _b === void 0 ? void 0 : _b.message }))] }));
198922
- } })), isIntegrationSchemaLoading && (jsxs("div", { className: "flex items-center justify-center py-4", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2" }), jsx("span", { className: "text-sm text-gray-600", children: "Loading provider configurations..." })] })), showProviderForm && !isIntegrationSchemaLoading && (jsx(Fragment$1, { children: schemaFields.map((fieldName) => (jsx(form.Field, { name: fieldName, children: (field) => {
198929
+ } })), isIntegrationSchemaLoading && (jsxs("div", { className: "flex items-center justify-center py-4", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2" }), jsx("span", { className: "text-sm text-gray-600", children: "Loading provider configurations..." })] })), showProviderForm && !isIntegrationSchemaLoading && (jsx(Fragment$1, { children: schemaFields.map((schemaField) => (jsx(form.Field, { name: schemaField.name, children: (field) => {
198923
198930
  var _a, _b;
198924
198931
  const hasError = ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) > 0;
198925
198932
  const isTouched = field.state.meta.isTouched;
198926
198933
  const shouldShowError = hasError && isTouched;
198927
- return (jsxs("div", { className: "space-y-1.5", children: [jsxs(Label, { className: "flex items-center text-sm font-medium text-[#646464]", children: [fieldName.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase()), jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(Input, { placeholder: `Enter ${fieldName.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())}`, value: field.state.value || '', onChange: (event) => field.handleChange(event.target.value), onBlur: () => field.handleBlur(), autoComplete: "off" }), shouldShowError && (jsx("p", { className: "text-red-500 text-xs", children: ((_b = field.state.meta.errors[0]) === null || _b === void 0 ? void 0 : _b.message) || 'This field is required' }))] }));
198928
- } }, fieldName))) })), jsx(DialogFooter, { className: "justify-end", children: jsx(form.Subscribe, { selector: (state) => ({ canSubmit: state.canSubmit }), children: ({ canSubmit }) => (jsx(Button$1, { type: "submit", disabled: !canSubmit || isLoading || isIntegrationSchemaLoading, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isLoading ? 'Submitting...' : 'Submit' })) }) })] })] }) }));
198934
+ const formattedLabel = schemaField.name
198935
+ .replace(/_/g, ' ')
198936
+ .replace(/\b\w/g, (l) => l.toUpperCase());
198937
+ return (jsxs("div", { className: "space-y-1.5", children: [jsxs(Label, { className: "flex items-center text-sm font-medium text-[#646464]", children: [formattedLabel, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(Input, { type: schemaField.isSensitive ? 'password' : 'text', placeholder: `Enter ${formattedLabel}`, value: field.state.value || '', onChange: (event) => field.handleChange(event.target.value), onBlur: () => field.handleBlur(), autoComplete: schemaField.isSensitive ? 'new-password' : 'off' }), shouldShowError && (jsx("p", { className: "text-red-500 text-xs", children: ((_b = field.state.meta.errors[0]) === null || _b === void 0 ? void 0 : _b.message) || 'This field is required' }))] }));
198938
+ } }, schemaField.name))) })), jsx(DialogFooter, { className: "justify-end", children: jsx(form.Subscribe, { selector: (state) => ({ canSubmit: state.canSubmit }), children: ({ canSubmit }) => (jsx(Button$1, { type: "submit", disabled: !canSubmit || isLoading || isIntegrationSchemaLoading, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isLoading ? 'Submitting...' : 'Submit' })) }) })] })] }) }));
198929
198939
  }
198930
198940
 
198931
198941
  function IntegrationDataSourcesTab({ tenantKey, }) {
@@ -219068,7 +219078,10 @@ function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInC
219068
219078
  }
219069
219079
 
219070
219080
  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, 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] })] }));
219081
+ 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 border-[#2563EB] text-[#2563EB]", 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: {
219082
+ 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',
219083
+ today: 'bg-blue-50 text-[#2563EB] data-[selected=true]:bg-[#2563EB] data-[selected=true]:text-white',
219084
+ }, 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
219085
  }
219073
219086
 
219074
219087
  function TaskMetricsCards({ tasksData, labels }) {
@@ -219523,6 +219536,21 @@ function combineDateAndTime(date, time) {
219523
219536
  result.setHours(hour, minute, 0, 0);
219524
219537
  return result;
219525
219538
  }
219539
+ const TASK_DATE_FILTER_FORMAT = 'yyyy-MM-dd';
219540
+ function formatTaskDateFilter(date) {
219541
+ return format(date, TASK_DATE_FILTER_FORMAT);
219542
+ }
219543
+ function getTaskDateFilterValue(task) {
219544
+ var _a, _b;
219545
+ const rawData = task.rawData;
219546
+ 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;
219547
+ if (!rawDate)
219548
+ return undefined;
219549
+ const date = new Date(rawDate);
219550
+ if (Number.isNaN(date.getTime()))
219551
+ return undefined;
219552
+ return formatTaskDateFilter(date);
219553
+ }
219526
219554
  function AgentTasksTab({ PaginationComponent = DefaultTasksPagination, labels: labelsOverride, }) {
219527
219555
  var _a, _b, _c;
219528
219556
  const { tenantKey, mentorId, username } = useAgentSettings();
@@ -219540,11 +219568,18 @@ function AgentTasksTab({ PaginationComponent = DefaultTasksPagination, labels: l
219540
219568
  const [debouncedSearchQuery] = a$3(searchQuery, 300);
219541
219569
  const tasksPerPage = 5;
219542
219570
  const logsPerPage = 5;
219571
+ const taskSearchFilterValue = debouncedSearchQuery.trim();
219572
+ const taskDateFilterValue = useMemo(() => (taskDate ? formatTaskDateFilter(taskDate) : undefined), [taskDate]);
219543
219573
  // Fetch periodic agents
219544
219574
  const { data: periodicAgentsData, isLoading } = useGetPeriodicAgentsQuery({
219545
219575
  org: tenantKey,
219546
219576
  // @ts-ignore - userId is not part of the generated query arg type
219547
219577
  userId: username,
219578
+ mentorId,
219579
+ ...(taskDateFilterValue
219580
+ ? { startDate: taskDateFilterValue, endDate: taskDateFilterValue }
219581
+ : {}),
219582
+ ...(taskSearchFilterValue ? { search: taskSearchFilterValue } : {}),
219548
219583
  }, {
219549
219584
  skip: !tenantKey || !username || !mentorId,
219550
219585
  });
@@ -219612,16 +219647,13 @@ function AgentTasksTab({ PaginationComponent = DefaultTasksPagination, labels: l
219612
219647
  rawData: agent,
219613
219648
  };
219614
219649
  })) || [];
219615
- // Filter tasks based on debounced search query
219650
+ // The text search is sent to the API; date filtering stays local as a
219651
+ // fallback for API responses that return the full page.
219616
219652
  const filteredTasks = useMemo(() => {
219617
- if (!debouncedSearchQuery.trim())
219618
- return tasksData;
219619
- const query = debouncedSearchQuery.toLowerCase();
219620
- return tasksData.filter((task) => task.name.toLowerCase().includes(query) ||
219621
- task.time.toLowerCase().includes(query) ||
219622
- task.repeat.toLowerCase().includes(query) ||
219623
- task.status.toLowerCase().includes(query));
219624
- }, [tasksData, debouncedSearchQuery]);
219653
+ return taskDateFilterValue
219654
+ ? tasksData.filter((task) => getTaskDateFilterValue(task) === taskDateFilterValue)
219655
+ : tasksData;
219656
+ }, [tasksData, taskDateFilterValue]);
219625
219657
  // Transform logs data for UI display
219626
219658
  const taskLogs = ((_b = periodicAgentLogsData === null || periodicAgentLogsData === void 0 ? void 0 : periodicAgentLogsData.results) === null || _b === void 0 ? void 0 : _b.map((log) => ({
219627
219659
  id: log.id.toString(),
@@ -219632,10 +219664,10 @@ function AgentTasksTab({ PaginationComponent = DefaultTasksPagination, labels: l
219632
219664
  startTime: log.start_time,
219633
219665
  endTime: log.end_time,
219634
219666
  }))) || [];
219635
- // Reset to page 1 when search query changes
219667
+ // Reset to page 1 when filters change
219636
219668
  useEffect(() => {
219637
219669
  setTasksCurrentPage(1);
219638
- }, [debouncedSearchQuery]);
219670
+ }, [taskSearchFilterValue, taskDateFilterValue]);
219639
219671
  // Reset logs pagination when the selected task changes
219640
219672
  useEffect(() => {
219641
219673
  setLogsCurrentPage(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/iblai-js",
3
- "version": "1.11.5",
3
+ "version": "1.12.0",
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/mcp": "1.4.14",
65
- "@iblai/web-containers": "1.7.5",
66
- "@iblai/data-layer": "1.5.10",
67
- "@iblai/web-utils": "1.7.1"
64
+ "@iblai/data-layer": "1.6.0",
65
+ "@iblai/web-utils": "1.7.1",
66
+ "@iblai/web-containers": "1.8.0",
67
+ "@iblai/mcp": "1.5.0"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@radix-ui/react-dialog": "^1.1.7",