local-operator-ui 0.7.5 → 0.8.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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DV8SteiB.js","./fonts-DnoCbbVd.js","./fonts-B9KBGB-g.css","./index-Dp4J_UIV.js","./pug-By0kVCfm.js","./javascript-C3MnDRiU.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-cc_xe9_G.js","./fonts-DnoCbbVd.js","./fonts-B9KBGB-g.css","./index-qogN06h3.js","./pug-By0kVCfm.js","./javascript-C3MnDRiU.js"])))=>i.map(i=>d[i]);
2
2
  import { c as createStyled, r as resolveProps, u as useTheme, a as reactExports, b as clsx, d as useForkRef, e as extendSxProp, j as jsxRuntimeExports, h as handleBreakpoints, f as resolveBreakpointValues, g as createUnarySpacing, i as deepmerge, m as mergeBreakpointsInOrder, k as composeClasses, l as generateUtilityClass, n as createTheme$1, o as getValue, R as React, p as getDefaultExportFromCjs, q as requireReactDom, s as React$1, t as generateUtilityClasses, v as useDefaultProps, w as styled$1, x as capitalize, y as memoTheme, _ as _inheritsLoose, z as _objectWithoutPropertiesLoose$i, T as TransitionGroupContext, A as duration, B as useTheme$1, C as useTimeout, D as useId, E as ButtonBase, F as alpha$1, G as createSimplePaletteValueFilter, H as CircularProgress, P as Paper, I as darken, J as lighten, K as useEventCallback, L as useEnhancedEffect, M as useRtl, N as globalCss, O as formatMuiErrorMessage, Q as rootShouldForwardProp, S as Typography, U as css$1, V as keyframes, W as getPath$2, X as isFocusVisible, Y as typographyClasses, Z as slotShouldForwardProp, $ as clamp, a0 as emphasize, a1 as Timeout, a2 as createLucideIcon, a3 as Button, a4 as Box, a5 as FontAwesomeIcon, a6 as faExclamationTriangle, a7 as DEFAULT_THEME, a8 as faChevronLeft, a9 as faChevronRight, aa as faRobot, ab as faCheck, ac as faTimes, ad as faEraser, ae as faPen, af as faFileImport, ag as faUpload, ah as requireReact, ai as faComment, aj as faSave, ak as faEdit, al as faTrashAlt, am as faComments, an as faInfoCircle, ao as faGear, ap as faPlus, aq as faServer, ar as faStar, as as faTag, at as faIdCard, au as faCalendarAlt, av as faCodeBranch, aw as faShieldAlt, ax as faArrowLeft, ay as faClock, az as faHome, aA as faDownload, aB as faFileAlt, aC as faDesktop, aD as faImage, aE as faMusic, aF as faVideo, aG as faLaptop, aH as faUsers, aI as faDatabase, aJ as faBoxOpen, aK as faBook, aL as faHdd, aM as faBox, aN as faArchive, aO as faNetworkWired, aP as faFolder, aQ as faFolderOpen, aR as faFolderTree, aS as faChevronDown, aT as faTools, aU as _extends$u, aV as faSliders, aW as faTrash, aX as faArrowDown, aY as faPaperclip, aZ as faStop, a_ as faPaperPlane, a$ as faChevronUp, b0 as faQuestion, b1 as faFile, b2 as faExclamationCircle, b3 as faLightbulb, b4 as faCode, b5 as faCommentDots, b6 as faShare, b7 as faPencilAlt, b8 as faUser, b9 as faCopy, ba as isDevelopmentMode, bb as faCommentSlash, bc as faArrowRight, bd as faBrain, be as faWandMagicSparkles, bf as faExternalLinkAlt, bg as faKey, bh as radientTheme, bi as faGlobe, bj as faSearch, bk as commonjsGlobal, bl as PropTypes, bm as faLock, bn as faSignOut, bo as themes, bp as faMoon, bq as faSun, br as faHexagonNodes, bs as faSkull, bt as faLeaf, bu as faMountain, bv as faFire, bw as faIcicles, bx as faEnvelope, by as faHistory, bz as faListAlt, bA as faAdjust, bB as faCreditCard, bC as faPlusCircle, bD as faChartLine, bE as faShield, bF as library$1, bG as icons$1, bH as CssBaseline, bI as ThemeProvider$1, bJ as getTheme, bK as ReactDOM$1, bL as ErrorBoundary } from "./fonts-DnoCbbVd.js";
3
3
  const styled = createStyled();
4
4
  function getThemeProps(params) {
@@ -28605,6 +28605,155 @@ const ModelsApi = {
28605
28605
  listProviders,
28606
28606
  listModels
28607
28607
  };
28608
+ const SchedulesApi = {
28609
+ /**
28610
+ * List all schedules
28611
+ * Retrieve a paginated list of all schedules across all agents.
28612
+ *
28613
+ * @param baseUrl - The base URL of the Local Operator API
28614
+ * @param page - Page number (default: 1)
28615
+ * @param perPage - Number of schedules per page (default: 10)
28616
+ * @returns Promise resolving to the schedules list response
28617
+ */
28618
+ async listAllSchedules(baseUrl, page = 1, perPage = 10) {
28619
+ const url = new URL(`${baseUrl}/v1/schedules`);
28620
+ url.searchParams.append("page", page.toString());
28621
+ url.searchParams.append("per_page", perPage.toString());
28622
+ const response = await fetch(url.toString(), {
28623
+ method: "GET",
28624
+ headers: {
28625
+ Accept: "application/json"
28626
+ }
28627
+ });
28628
+ if (!response.ok) {
28629
+ throw new Error(
28630
+ `List all schedules request failed: ${response.status} ${response.statusText}`
28631
+ );
28632
+ }
28633
+ return response.json();
28634
+ },
28635
+ /**
28636
+ * Create a new schedule for an agent
28637
+ * Create a new schedule for a specific agent.
28638
+ *
28639
+ * @param baseUrl - The base URL of the Local Operator API
28640
+ * @param agentId - ID of the agent to create the schedule for
28641
+ * @param scheduleData - The schedule details to create
28642
+ * @returns Promise resolving to the created schedule response
28643
+ */
28644
+ async createScheduleForAgent(baseUrl, agentId, scheduleData) {
28645
+ const response = await fetch(`${baseUrl}/v1/agents/${agentId}/schedules`, {
28646
+ method: "POST",
28647
+ headers: {
28648
+ "Content-Type": "application/json",
28649
+ Accept: "application/json"
28650
+ },
28651
+ body: JSON.stringify(scheduleData)
28652
+ });
28653
+ if (!response.ok) {
28654
+ throw new Error(
28655
+ `Create schedule for agent request failed: ${response.status} ${response.statusText}`
28656
+ );
28657
+ }
28658
+ return response.json();
28659
+ },
28660
+ /**
28661
+ * List schedules for a specific agent
28662
+ * Retrieve a paginated list of schedules for a specific agent.
28663
+ *
28664
+ * @param baseUrl - The base URL of the Local Operator API
28665
+ * @param agentId - ID of the agent to list schedules for
28666
+ * @param page - Page number (default: 1)
28667
+ * @param perPage - Number of schedules per page (default: 10)
28668
+ * @returns Promise resolving to the schedules list response
28669
+ */
28670
+ async listSchedulesForAgent(baseUrl, agentId, page = 1, perPage = 10) {
28671
+ const url = new URL(`${baseUrl}/v1/agents/${agentId}/schedules`);
28672
+ url.searchParams.append("page", page.toString());
28673
+ url.searchParams.append("per_page", perPage.toString());
28674
+ const response = await fetch(url.toString(), {
28675
+ method: "GET",
28676
+ headers: {
28677
+ Accept: "application/json"
28678
+ }
28679
+ });
28680
+ if (!response.ok) {
28681
+ throw new Error(
28682
+ `List schedules for agent request failed: ${response.status} ${response.statusText}`
28683
+ );
28684
+ }
28685
+ return response.json();
28686
+ },
28687
+ /**
28688
+ * Get a single schedule by ID
28689
+ * Retrieve a single schedule by its ID.
28690
+ *
28691
+ * @param baseUrl - The base URL of the Local Operator API
28692
+ * @param scheduleId - ID of the schedule to retrieve
28693
+ * @returns Promise resolving to the schedule details response
28694
+ */
28695
+ async getScheduleById(baseUrl, scheduleId) {
28696
+ const response = await fetch(`${baseUrl}/v1/schedules/${scheduleId}`, {
28697
+ method: "GET",
28698
+ headers: {
28699
+ Accept: "application/json"
28700
+ }
28701
+ });
28702
+ if (!response.ok) {
28703
+ throw new Error(
28704
+ `Get schedule by ID request failed: ${response.status} ${response.statusText}`
28705
+ );
28706
+ }
28707
+ return response.json();
28708
+ },
28709
+ /**
28710
+ * Edit an existing schedule
28711
+ * Edit an existing schedule by its ID.
28712
+ *
28713
+ * @param baseUrl - The base URL of the Local Operator API
28714
+ * @param scheduleId - ID of the schedule to update
28715
+ * @param scheduleData - The schedule details to update
28716
+ * @returns Promise resolving to the updated schedule response
28717
+ */
28718
+ async editSchedule(baseUrl, scheduleId, scheduleData) {
28719
+ const response = await fetch(`${baseUrl}/v1/schedules/${scheduleId}`, {
28720
+ method: "PATCH",
28721
+ headers: {
28722
+ "Content-Type": "application/json",
28723
+ Accept: "application/json"
28724
+ },
28725
+ body: JSON.stringify(scheduleData)
28726
+ });
28727
+ if (!response.ok) {
28728
+ throw new Error(
28729
+ `Edit schedule request failed: ${response.status} ${response.statusText}`
28730
+ );
28731
+ }
28732
+ return response.json();
28733
+ },
28734
+ /**
28735
+ * Remove a schedule by ID
28736
+ * Remove a schedule by its ID.
28737
+ *
28738
+ * @param baseUrl - The base URL of the Local Operator API
28739
+ * @param scheduleId - ID of the schedule to delete
28740
+ * @returns Promise resolving to the deletion response
28741
+ */
28742
+ async removeSchedule(baseUrl, scheduleId) {
28743
+ const response = await fetch(`${baseUrl}/v1/schedules/${scheduleId}`, {
28744
+ method: "DELETE",
28745
+ headers: {
28746
+ Accept: "application/json"
28747
+ }
28748
+ });
28749
+ if (!response.ok) {
28750
+ throw new Error(
28751
+ `Remove schedule request failed: ${response.status} ${response.statusText}`
28752
+ );
28753
+ }
28754
+ return response.json();
28755
+ }
28756
+ };
28608
28757
  const getImageUrl = (baseUrl, imagePath) => {
28609
28758
  const normalizedBaseUrl = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
28610
28759
  let normalizedPath = imagePath;
@@ -29204,6 +29353,12 @@ class LocalOperatorClient {
29204
29353
  get static() {
29205
29354
  return this.bindBaseUrlToApi(StaticApi);
29206
29355
  }
29356
+ /**
29357
+ * Get the Schedules API client with methods bound to the base URL
29358
+ */
29359
+ get schedules() {
29360
+ return this.bindBaseUrlToApi(SchedulesApi);
29361
+ }
29207
29362
  /**
29208
29363
  * Bind the base URL to all methods of an API client
29209
29364
  *
@@ -34462,18 +34617,18 @@ const useAgentSelectionStore = create$1()(
34462
34617
  * This source code is licensed under the ISC license.
34463
34618
  * See the LICENSE file in the root directory of this source tree.
34464
34619
  */
34465
- const __iconNode$G = [
34620
+ const __iconNode$L = [
34466
34621
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
34467
34622
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
34468
34623
  ];
34469
- const ArrowLeft = createLucideIcon("arrow-left", __iconNode$G);
34624
+ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$L);
34470
34625
  /**
34471
34626
  * @license lucide-react v0.507.0 - ISC
34472
34627
  *
34473
34628
  * This source code is licensed under the ISC license.
34474
34629
  * See the LICENSE file in the root directory of this source tree.
34475
34630
  */
34476
- const __iconNode$F = [
34631
+ const __iconNode$K = [
34477
34632
  ["path", { d: "M12 8V4H8", key: "hb8ula" }],
34478
34633
  ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
34479
34634
  ["path", { d: "M2 14h2", key: "vft8re" }],
@@ -34481,77 +34636,108 @@ const __iconNode$F = [
34481
34636
  ["path", { d: "M15 13v2", key: "1xurst" }],
34482
34637
  ["path", { d: "M9 13v2", key: "rq6x2g" }]
34483
34638
  ];
34484
- const Bot = createLucideIcon("bot", __iconNode$F);
34639
+ const Bot = createLucideIcon("bot", __iconNode$K);
34485
34640
  /**
34486
34641
  * @license lucide-react v0.507.0 - ISC
34487
34642
  *
34488
34643
  * This source code is licensed under the ISC license.
34489
34644
  * See the LICENSE file in the root directory of this source tree.
34490
34645
  */
34491
- const __iconNode$E = [
34646
+ const __iconNode$J = [
34492
34647
  ["path", { d: "M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16", key: "jecpp" }],
34493
34648
  ["rect", { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" }]
34494
34649
  ];
34495
- const Briefcase = createLucideIcon("briefcase", __iconNode$E);
34650
+ const Briefcase = createLucideIcon("briefcase", __iconNode$J);
34496
34651
  /**
34497
34652
  * @license lucide-react v0.507.0 - ISC
34498
34653
  *
34499
34654
  * This source code is licensed under the ISC license.
34500
34655
  * See the LICENSE file in the root directory of this source tree.
34501
34656
  */
34502
- const __iconNode$D = [
34657
+ const __iconNode$I = [
34658
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
34659
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
34660
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
34661
+ ["path", { d: "M3 10h18", key: "8toen8" }],
34662
+ ["path", { d: "M8 14h.01", key: "6423bh" }],
34663
+ ["path", { d: "M12 14h.01", key: "1etili" }],
34664
+ ["path", { d: "M16 14h.01", key: "1gbofw" }],
34665
+ ["path", { d: "M8 18h.01", key: "lrp35t" }],
34666
+ ["path", { d: "M12 18h.01", key: "mhygvu" }],
34667
+ ["path", { d: "M16 18h.01", key: "kzsmim" }]
34668
+ ];
34669
+ const CalendarDays = createLucideIcon("calendar-days", __iconNode$I);
34670
+ /**
34671
+ * @license lucide-react v0.507.0 - ISC
34672
+ *
34673
+ * This source code is licensed under the ISC license.
34674
+ * See the LICENSE file in the root directory of this source tree.
34675
+ */
34676
+ const __iconNode$H = [
34503
34677
  ["line", { x1: "18", x2: "18", y1: "20", y2: "10", key: "1xfpm4" }],
34504
34678
  ["line", { x1: "12", x2: "12", y1: "20", y2: "4", key: "be30l9" }],
34505
34679
  ["line", { x1: "6", x2: "6", y1: "20", y2: "14", key: "1r4le6" }]
34506
34680
  ];
34507
- const ChartNoAxesColumn = createLucideIcon("chart-no-axes-column", __iconNode$D);
34681
+ const ChartNoAxesColumn = createLucideIcon("chart-no-axes-column", __iconNode$H);
34508
34682
  /**
34509
34683
  * @license lucide-react v0.507.0 - ISC
34510
34684
  *
34511
34685
  * This source code is licensed under the ISC license.
34512
34686
  * See the LICENSE file in the root directory of this source tree.
34513
34687
  */
34514
- const __iconNode$C = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
34515
- const ChevronLeft = createLucideIcon("chevron-left", __iconNode$C);
34688
+ const __iconNode$G = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
34689
+ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$G);
34516
34690
  /**
34517
34691
  * @license lucide-react v0.507.0 - ISC
34518
34692
  *
34519
34693
  * This source code is licensed under the ISC license.
34520
34694
  * See the LICENSE file in the root directory of this source tree.
34521
34695
  */
34522
- const __iconNode$B = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
34523
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$B);
34696
+ const __iconNode$F = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
34697
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$F);
34524
34698
  /**
34525
34699
  * @license lucide-react v0.507.0 - ISC
34526
34700
  *
34527
34701
  * This source code is licensed under the ISC license.
34528
34702
  * See the LICENSE file in the root directory of this source tree.
34529
34703
  */
34530
- const __iconNode$A = [
34704
+ const __iconNode$E = [
34531
34705
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
34532
34706
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
34533
34707
  ];
34534
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$A);
34708
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$E);
34535
34709
  /**
34536
34710
  * @license lucide-react v0.507.0 - ISC
34537
34711
  *
34538
34712
  * This source code is licensed under the ISC license.
34539
34713
  * See the LICENSE file in the root directory of this source tree.
34540
34714
  */
34541
- const __iconNode$z = [
34715
+ const __iconNode$D = [
34542
34716
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
34543
34717
  ["path", { d: "M17 12h.01", key: "1m0b6t" }],
34544
34718
  ["path", { d: "M12 12h.01", key: "1mp3jc" }],
34545
34719
  ["path", { d: "M7 12h.01", key: "eqddd0" }]
34546
34720
  ];
34547
- const CircleEllipsis = createLucideIcon("circle-ellipsis", __iconNode$z);
34721
+ const CircleEllipsis = createLucideIcon("circle-ellipsis", __iconNode$D);
34548
34722
  /**
34549
34723
  * @license lucide-react v0.507.0 - ISC
34550
34724
  *
34551
34725
  * This source code is licensed under the ISC license.
34552
34726
  * See the LICENSE file in the root directory of this source tree.
34553
34727
  */
34554
- const __iconNode$y = [
34728
+ const __iconNode$C = [
34729
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
34730
+ ["path", { d: "M8 12h8", key: "1wcyev" }],
34731
+ ["path", { d: "M12 8v8", key: "napkw2" }]
34732
+ ];
34733
+ const CirclePlus = createLucideIcon("circle-plus", __iconNode$C);
34734
+ /**
34735
+ * @license lucide-react v0.507.0 - ISC
34736
+ *
34737
+ * This source code is licensed under the ISC license.
34738
+ * See the LICENSE file in the root directory of this source tree.
34739
+ */
34740
+ const __iconNode$B = [
34555
34741
  ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
34556
34742
  [
34557
34743
  "path",
@@ -34565,50 +34751,50 @@ const __iconNode$y = [
34565
34751
  ["path", { d: "M8 11h.01", key: "1dfujw" }],
34566
34752
  ["path", { d: "M8 16h.01", key: "18s6g9" }]
34567
34753
  ];
34568
- const ClipboardList = createLucideIcon("clipboard-list", __iconNode$y);
34754
+ const ClipboardList = createLucideIcon("clipboard-list", __iconNode$B);
34569
34755
  /**
34570
34756
  * @license lucide-react v0.507.0 - ISC
34571
34757
  *
34572
34758
  * This source code is licensed under the ISC license.
34573
34759
  * See the LICENSE file in the root directory of this source tree.
34574
34760
  */
34575
- const __iconNode$x = [
34761
+ const __iconNode$A = [
34576
34762
  ["path", { d: "M12 13v8", key: "1l5pq0" }],
34577
34763
  ["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
34578
34764
  ["path", { d: "m8 17 4-4 4 4", key: "1quai1" }]
34579
34765
  ];
34580
- const CloudUpload = createLucideIcon("cloud-upload", __iconNode$x);
34766
+ const CloudUpload = createLucideIcon("cloud-upload", __iconNode$A);
34581
34767
  /**
34582
34768
  * @license lucide-react v0.507.0 - ISC
34583
34769
  *
34584
34770
  * This source code is licensed under the ISC license.
34585
34771
  * See the LICENSE file in the root directory of this source tree.
34586
34772
  */
34587
- const __iconNode$w = [
34773
+ const __iconNode$z = [
34588
34774
  ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
34589
34775
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
34590
34776
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
34591
34777
  ];
34592
- const CodeXml = createLucideIcon("code-xml", __iconNode$w);
34778
+ const CodeXml = createLucideIcon("code-xml", __iconNode$z);
34593
34779
  /**
34594
34780
  * @license lucide-react v0.507.0 - ISC
34595
34781
  *
34596
34782
  * This source code is licensed under the ISC license.
34597
34783
  * See the LICENSE file in the root directory of this source tree.
34598
34784
  */
34599
- const __iconNode$v = [
34785
+ const __iconNode$y = [
34600
34786
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
34601
34787
  ["polyline", { points: "7 10 12 15 17 10", key: "2ggqvy" }],
34602
34788
  ["line", { x1: "12", x2: "12", y1: "15", y2: "3", key: "1vk2je" }]
34603
34789
  ];
34604
- const Download = createLucideIcon("download", __iconNode$v);
34790
+ const Download = createLucideIcon("download", __iconNode$y);
34605
34791
  /**
34606
34792
  * @license lucide-react v0.507.0 - ISC
34607
34793
  *
34608
34794
  * This source code is licensed under the ISC license.
34609
34795
  * See the LICENSE file in the root directory of this source tree.
34610
34796
  */
34611
- const __iconNode$u = [
34797
+ const __iconNode$x = [
34612
34798
  ["path", { d: "M21.54 15H17a2 2 0 0 0-2 2v4.54", key: "1djwo0" }],
34613
34799
  [
34614
34800
  "path",
@@ -34620,26 +34806,26 @@ const __iconNode$u = [
34620
34806
  ["path", { d: "M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05", key: "14pb5j" }],
34621
34807
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
34622
34808
  ];
34623
- const Earth = createLucideIcon("earth", __iconNode$u);
34809
+ const Earth = createLucideIcon("earth", __iconNode$x);
34624
34810
  /**
34625
34811
  * @license lucide-react v0.507.0 - ISC
34626
34812
  *
34627
34813
  * This source code is licensed under the ISC license.
34628
34814
  * See the LICENSE file in the root directory of this source tree.
34629
34815
  */
34630
- const __iconNode$t = [
34816
+ const __iconNode$w = [
34631
34817
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
34632
34818
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
34633
34819
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
34634
34820
  ];
34635
- const EllipsisVertical = createLucideIcon("ellipsis-vertical", __iconNode$t);
34821
+ const EllipsisVertical = createLucideIcon("ellipsis-vertical", __iconNode$w);
34636
34822
  /**
34637
34823
  * @license lucide-react v0.507.0 - ISC
34638
34824
  *
34639
34825
  * This source code is licensed under the ISC license.
34640
34826
  * See the LICENSE file in the root directory of this source tree.
34641
34827
  */
34642
- const __iconNode$s = [
34828
+ const __iconNode$v = [
34643
34829
  [
34644
34830
  "path",
34645
34831
  {
@@ -34650,79 +34836,79 @@ const __iconNode$s = [
34650
34836
  ["path", { d: "M22 21H7", key: "t4ddhn" }],
34651
34837
  ["path", { d: "m5 11 9 9", key: "1mo9qw" }]
34652
34838
  ];
34653
- const Eraser = createLucideIcon("eraser", __iconNode$s);
34839
+ const Eraser = createLucideIcon("eraser", __iconNode$v);
34654
34840
  /**
34655
34841
  * @license lucide-react v0.507.0 - ISC
34656
34842
  *
34657
34843
  * This source code is licensed under the ISC license.
34658
34844
  * See the LICENSE file in the root directory of this source tree.
34659
34845
  */
34660
- const __iconNode$r = [
34846
+ const __iconNode$u = [
34661
34847
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
34662
34848
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
34663
34849
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
34664
34850
  ];
34665
- const ExternalLink = createLucideIcon("external-link", __iconNode$r);
34851
+ const ExternalLink = createLucideIcon("external-link", __iconNode$u);
34666
34852
  /**
34667
34853
  * @license lucide-react v0.507.0 - ISC
34668
34854
  *
34669
34855
  * This source code is licensed under the ISC license.
34670
34856
  * See the LICENSE file in the root directory of this source tree.
34671
34857
  */
34672
- const __iconNode$q = [
34858
+ const __iconNode$t = [
34673
34859
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
34674
34860
  ["path", { d: "M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2", key: "1vk7w2" }],
34675
34861
  ["path", { d: "M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6", key: "1jink5" }],
34676
34862
  ["path", { d: "m5 11-3 3", key: "1dgrs4" }],
34677
34863
  ["path", { d: "m5 17-3-3h10", key: "1mvvaf" }]
34678
34864
  ];
34679
- const FileOutput = createLucideIcon("file-output", __iconNode$q);
34865
+ const FileOutput = createLucideIcon("file-output", __iconNode$t);
34680
34866
  /**
34681
34867
  * @license lucide-react v0.507.0 - ISC
34682
34868
  *
34683
34869
  * This source code is licensed under the ISC license.
34684
34870
  * See the LICENSE file in the root directory of this source tree.
34685
34871
  */
34686
- const __iconNode$p = [
34872
+ const __iconNode$s = [
34687
34873
  ["path", { d: "M12 17h.01", key: "p32p05" }],
34688
34874
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z", key: "1mlx9k" }],
34689
34875
  ["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }]
34690
34876
  ];
34691
- const FileQuestion = createLucideIcon("file-question", __iconNode$p);
34877
+ const FileQuestion = createLucideIcon("file-question", __iconNode$s);
34692
34878
  /**
34693
34879
  * @license lucide-react v0.507.0 - ISC
34694
34880
  *
34695
34881
  * This source code is licensed under the ISC license.
34696
34882
  * See the LICENSE file in the root directory of this source tree.
34697
34883
  */
34698
- const __iconNode$o = [
34884
+ const __iconNode$r = [
34699
34885
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
34700
34886
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
34701
34887
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
34702
34888
  ["path", { d: "M16 13H8", key: "t4e002" }],
34703
34889
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
34704
34890
  ];
34705
- const FileText = createLucideIcon("file-text", __iconNode$o);
34891
+ const FileText = createLucideIcon("file-text", __iconNode$r);
34706
34892
  /**
34707
34893
  * @license lucide-react v0.507.0 - ISC
34708
34894
  *
34709
34895
  * This source code is licensed under the ISC license.
34710
34896
  * See the LICENSE file in the root directory of this source tree.
34711
34897
  */
34712
- const __iconNode$n = [
34898
+ const __iconNode$q = [
34713
34899
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
34714
34900
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
34715
34901
  ["path", { d: "M12 12v6", key: "3ahymv" }],
34716
34902
  ["path", { d: "m15 15-3-3-3 3", key: "15xj92" }]
34717
34903
  ];
34718
- const FileUp = createLucideIcon("file-up", __iconNode$n);
34904
+ const FileUp = createLucideIcon("file-up", __iconNode$q);
34719
34905
  /**
34720
34906
  * @license lucide-react v0.507.0 - ISC
34721
34907
  *
34722
34908
  * This source code is licensed under the ISC license.
34723
34909
  * See the LICENSE file in the root directory of this source tree.
34724
34910
  */
34725
- const __iconNode$m = [
34911
+ const __iconNode$p = [
34726
34912
  [
34727
34913
  "path",
34728
34914
  {
@@ -34733,14 +34919,14 @@ const __iconNode$m = [
34733
34919
  ["path", { d: "M6.453 15h11.094", key: "3shlmq" }],
34734
34920
  ["path", { d: "M8.5 2h7", key: "csnxdl" }]
34735
34921
  ];
34736
- const FlaskConical = createLucideIcon("flask-conical", __iconNode$m);
34922
+ const FlaskConical = createLucideIcon("flask-conical", __iconNode$p);
34737
34923
  /**
34738
34924
  * @license lucide-react v0.507.0 - ISC
34739
34925
  *
34740
34926
  * This source code is licensed under the ISC license.
34741
34927
  * See the LICENSE file in the root directory of this source tree.
34742
34928
  */
34743
- const __iconNode$l = [
34929
+ const __iconNode$o = [
34744
34930
  [
34745
34931
  "path",
34746
34932
  {
@@ -34751,14 +34937,14 @@ const __iconNode$l = [
34751
34937
  ["path", { d: "M22 10v6", key: "1lu8f3" }],
34752
34938
  ["path", { d: "M6 12.5V16a6 3 0 0 0 12 0v-3.5", key: "1r8lef" }]
34753
34939
  ];
34754
- const GraduationCap = createLucideIcon("graduation-cap", __iconNode$l);
34940
+ const GraduationCap = createLucideIcon("graduation-cap", __iconNode$o);
34755
34941
  /**
34756
34942
  * @license lucide-react v0.507.0 - ISC
34757
34943
  *
34758
34944
  * This source code is licensed under the ISC license.
34759
34945
  * See the LICENSE file in the root directory of this source tree.
34760
34946
  */
34761
- const __iconNode$k = [
34947
+ const __iconNode$n = [
34762
34948
  [
34763
34949
  "path",
34764
34950
  {
@@ -34768,14 +34954,14 @@ const __iconNode$k = [
34768
34954
  ],
34769
34955
  ["path", { d: "M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27", key: "1uw2ng" }]
34770
34956
  ];
34771
- const HeartPulse = createLucideIcon("heart-pulse", __iconNode$k);
34957
+ const HeartPulse = createLucideIcon("heart-pulse", __iconNode$n);
34772
34958
  /**
34773
34959
  * @license lucide-react v0.507.0 - ISC
34774
34960
  *
34775
34961
  * This source code is licensed under the ISC license.
34776
34962
  * See the LICENSE file in the root directory of this source tree.
34777
34963
  */
34778
- const __iconNode$j = [
34964
+ const __iconNode$m = [
34779
34965
  [
34780
34966
  "path",
34781
34967
  {
@@ -34784,14 +34970,14 @@ const __iconNode$j = [
34784
34970
  }
34785
34971
  ]
34786
34972
  ];
34787
- const Heart = createLucideIcon("heart", __iconNode$j);
34973
+ const Heart = createLucideIcon("heart", __iconNode$m);
34788
34974
  /**
34789
34975
  * @license lucide-react v0.507.0 - ISC
34790
34976
  *
34791
34977
  * This source code is licensed under the ISC license.
34792
34978
  * See the LICENSE file in the root directory of this source tree.
34793
34979
  */
34794
- const __iconNode$i = [
34980
+ const __iconNode$l = [
34795
34981
  ["path", { d: "M12 3v12", key: "1x0j5s" }],
34796
34982
  ["path", { d: "m8 11 4 4 4-4", key: "1dohi6" }],
34797
34983
  [
@@ -34802,38 +34988,38 @@ const __iconNode$i = [
34802
34988
  }
34803
34989
  ]
34804
34990
  ];
34805
- const Import = createLucideIcon("import", __iconNode$i);
34991
+ const Import = createLucideIcon("import", __iconNode$l);
34806
34992
  /**
34807
34993
  * @license lucide-react v0.507.0 - ISC
34808
34994
  *
34809
34995
  * This source code is licensed under the ISC license.
34810
34996
  * See the LICENSE file in the root directory of this source tree.
34811
34997
  */
34812
- const __iconNode$h = [
34998
+ const __iconNode$k = [
34813
34999
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
34814
35000
  ["path", { d: "M12 16v-4", key: "1dtifu" }],
34815
35001
  ["path", { d: "M12 8h.01", key: "e9boi3" }]
34816
35002
  ];
34817
- const Info$1 = createLucideIcon("info", __iconNode$h);
35003
+ const Info$1 = createLucideIcon("info", __iconNode$k);
34818
35004
  /**
34819
35005
  * @license lucide-react v0.507.0 - ISC
34820
35006
  *
34821
35007
  * This source code is licensed under the ISC license.
34822
35008
  * See the LICENSE file in the root directory of this source tree.
34823
35009
  */
34824
- const __iconNode$g = [
35010
+ const __iconNode$j = [
34825
35011
  ["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
34826
35012
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
34827
35013
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
34828
35014
  ];
34829
- const Key = createLucideIcon("key", __iconNode$g);
35015
+ const Key = createLucideIcon("key", __iconNode$j);
34830
35016
  /**
34831
35017
  * @license lucide-react v0.507.0 - ISC
34832
35018
  *
34833
35019
  * This source code is licensed under the ISC license.
34834
35020
  * See the LICENSE file in the root directory of this source tree.
34835
35021
  */
34836
- const __iconNode$f = [
35022
+ const __iconNode$i = [
34837
35023
  [
34838
35024
  "path",
34839
35025
  {
@@ -34856,35 +35042,35 @@ const __iconNode$f = [
34856
35042
  }
34857
35043
  ]
34858
35044
  ];
34859
- const Layers = createLucideIcon("layers", __iconNode$f);
35045
+ const Layers = createLucideIcon("layers", __iconNode$i);
34860
35046
  /**
34861
35047
  * @license lucide-react v0.507.0 - ISC
34862
35048
  *
34863
35049
  * This source code is licensed under the ISC license.
34864
35050
  * See the LICENSE file in the root directory of this source tree.
34865
35051
  */
34866
- const __iconNode$e = [
35052
+ const __iconNode$h = [
34867
35053
  ["path", { d: "m3 11 18-5v12L3 14v-3z", key: "n962bs" }],
34868
35054
  ["path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6", key: "1yl0tm" }]
34869
35055
  ];
34870
- const Megaphone = createLucideIcon("megaphone", __iconNode$e);
35056
+ const Megaphone = createLucideIcon("megaphone", __iconNode$h);
34871
35057
  /**
34872
35058
  * @license lucide-react v0.507.0 - ISC
34873
35059
  *
34874
35060
  * This source code is licensed under the ISC license.
34875
35061
  * See the LICENSE file in the root directory of this source tree.
34876
35062
  */
34877
- const __iconNode$d = [
35063
+ const __iconNode$g = [
34878
35064
  ["path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z", key: "vv11sd" }]
34879
35065
  ];
34880
- const MessageCircle = createLucideIcon("message-circle", __iconNode$d);
35066
+ const MessageCircle = createLucideIcon("message-circle", __iconNode$g);
34881
35067
  /**
34882
35068
  * @license lucide-react v0.507.0 - ISC
34883
35069
  *
34884
35070
  * This source code is licensed under the ISC license.
34885
35071
  * See the LICENSE file in the root directory of this source tree.
34886
35072
  */
34887
- const __iconNode$c = [
35073
+ const __iconNode$f = [
34888
35074
  ["path", { d: "m14.622 17.897-10.68-2.913", key: "vj2p1u" }],
34889
35075
  [
34890
35076
  "path",
@@ -34901,50 +35087,68 @@ const __iconNode$c = [
34901
35087
  }
34902
35088
  ]
34903
35089
  ];
34904
- const Paintbrush = createLucideIcon("paintbrush", __iconNode$c);
35090
+ const Paintbrush = createLucideIcon("paintbrush", __iconNode$f);
34905
35091
  /**
34906
35092
  * @license lucide-react v0.507.0 - ISC
34907
35093
  *
34908
35094
  * This source code is licensed under the ISC license.
34909
35095
  * See the LICENSE file in the root directory of this source tree.
34910
35096
  */
34911
- const __iconNode$b = [
35097
+ const __iconNode$e = [
34912
35098
  ["path", { d: "M5 12h14", key: "1ays0h" }],
34913
35099
  ["path", { d: "M12 5v14", key: "s699le" }]
34914
35100
  ];
34915
- const Plus$1 = createLucideIcon("plus", __iconNode$b);
35101
+ const Plus$1 = createLucideIcon("plus", __iconNode$e);
34916
35102
  /**
34917
35103
  * @license lucide-react v0.507.0 - ISC
34918
35104
  *
34919
35105
  * This source code is licensed under the ISC license.
34920
35106
  * See the LICENSE file in the root directory of this source tree.
34921
35107
  */
34922
- const __iconNode$a = [
35108
+ const __iconNode$d = [
35109
+ [
35110
+ "path",
35111
+ {
35112
+ d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
35113
+ key: "1c8476"
35114
+ }
35115
+ ],
35116
+ ["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
35117
+ ["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
35118
+ ];
35119
+ const Save = createLucideIcon("save", __iconNode$d);
35120
+ /**
35121
+ * @license lucide-react v0.507.0 - ISC
35122
+ *
35123
+ * This source code is licensed under the ISC license.
35124
+ * See the LICENSE file in the root directory of this source tree.
35125
+ */
35126
+ const __iconNode$c = [
34923
35127
  ["path", { d: "m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z", key: "7g6ntu" }],
34924
35128
  ["path", { d: "m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z", key: "ijws7r" }],
34925
35129
  ["path", { d: "M7 21h10", key: "1b0cd5" }],
34926
35130
  ["path", { d: "M12 3v18", key: "108xh3" }],
34927
35131
  ["path", { d: "M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2", key: "3gwbw2" }]
34928
35132
  ];
34929
- const Scale = createLucideIcon("scale", __iconNode$a);
35133
+ const Scale = createLucideIcon("scale", __iconNode$c);
34930
35134
  /**
34931
35135
  * @license lucide-react v0.507.0 - ISC
34932
35136
  *
34933
35137
  * This source code is licensed under the ISC license.
34934
35138
  * See the LICENSE file in the root directory of this source tree.
34935
35139
  */
34936
- const __iconNode$9 = [
35140
+ const __iconNode$b = [
34937
35141
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
34938
35142
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
34939
35143
  ];
34940
- const Search = createLucideIcon("search", __iconNode$9);
35144
+ const Search = createLucideIcon("search", __iconNode$b);
34941
35145
  /**
34942
35146
  * @license lucide-react v0.507.0 - ISC
34943
35147
  *
34944
35148
  * This source code is licensed under the ISC license.
34945
35149
  * See the LICENSE file in the root directory of this source tree.
34946
35150
  */
34947
- const __iconNode$8 = [
35151
+ const __iconNode$a = [
34948
35152
  [
34949
35153
  "path",
34950
35154
  {
@@ -34954,14 +35158,14 @@ const __iconNode$8 = [
34954
35158
  ],
34955
35159
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
34956
35160
  ];
34957
- const Settings$1 = createLucideIcon("settings", __iconNode$8);
35161
+ const Settings$1 = createLucideIcon("settings", __iconNode$a);
34958
35162
  /**
34959
35163
  * @license lucide-react v0.507.0 - ISC
34960
35164
  *
34961
35165
  * This source code is licensed under the ISC license.
34962
35166
  * See the LICENSE file in the root directory of this source tree.
34963
35167
  */
34964
- const __iconNode$7 = [
35168
+ const __iconNode$9 = [
34965
35169
  [
34966
35170
  "path",
34967
35171
  {
@@ -34970,14 +35174,14 @@ const __iconNode$7 = [
34970
35174
  }
34971
35175
  ]
34972
35176
  ];
34973
- const Shield = createLucideIcon("shield", __iconNode$7);
35177
+ const Shield = createLucideIcon("shield", __iconNode$9);
34974
35178
  /**
34975
35179
  * @license lucide-react v0.507.0 - ISC
34976
35180
  *
34977
35181
  * This source code is licensed under the ISC license.
34978
35182
  * See the LICENSE file in the root directory of this source tree.
34979
35183
  */
34980
- const __iconNode$6 = [
35184
+ const __iconNode$8 = [
34981
35185
  ["circle", { cx: "8", cy: "21", r: "1", key: "jimo8o" }],
34982
35186
  ["circle", { cx: "19", cy: "21", r: "1", key: "13723u" }],
34983
35187
  [
@@ -34988,7 +35192,36 @@ const __iconNode$6 = [
34988
35192
  }
34989
35193
  ]
34990
35194
  ];
34991
- const ShoppingCart = createLucideIcon("shopping-cart", __iconNode$6);
35195
+ const ShoppingCart = createLucideIcon("shopping-cart", __iconNode$8);
35196
+ /**
35197
+ * @license lucide-react v0.507.0 - ISC
35198
+ *
35199
+ * This source code is licensed under the ISC license.
35200
+ * See the LICENSE file in the root directory of this source tree.
35201
+ */
35202
+ const __iconNode$7 = [
35203
+ ["path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7", key: "1m0v6g" }],
35204
+ [
35205
+ "path",
35206
+ {
35207
+ d: "M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",
35208
+ key: "ohrbg2"
35209
+ }
35210
+ ]
35211
+ ];
35212
+ const SquarePen = createLucideIcon("square-pen", __iconNode$7);
35213
+ /**
35214
+ * @license lucide-react v0.507.0 - ISC
35215
+ *
35216
+ * This source code is licensed under the ISC license.
35217
+ * See the LICENSE file in the root directory of this source tree.
35218
+ */
35219
+ const __iconNode$6 = [
35220
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
35221
+ ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
35222
+ ["path", { d: "m9 9 6 6", key: "z0biqf" }]
35223
+ ];
35224
+ const SquareX = createLucideIcon("square-x", __iconNode$6);
34992
35225
  /**
34993
35226
  * @license lucide-react v0.507.0 - ISC
34994
35227
  *
@@ -35266,7 +35499,7 @@ const OptionsMenu = styled$1(Menu)(({ theme: theme2 }) => ({
35266
35499
  background: theme2.palette.background.paper
35267
35500
  }
35268
35501
  }));
35269
- const StyledMenuItem = styled$1(MenuItem)(({ theme: theme2 }) => ({
35502
+ const StyledMenuItem$1 = styled$1(MenuItem)(({ theme: theme2 }) => ({
35270
35503
  borderRadius: "0.375rem",
35271
35504
  // rounded-md
35272
35505
  padding: "0.5rem 0.75rem",
@@ -35408,7 +35641,7 @@ const AgentOptionsMenu = ({
35408
35641
  },
35409
35642
  children: [
35410
35643
  isAgentsPage && onChatWithAgent && /* @__PURE__ */ jsxRuntimeExports.jsxs(
35411
- StyledMenuItem,
35644
+ StyledMenuItem$1,
35412
35645
  {
35413
35646
  onClick: () => {
35414
35647
  onChatWithAgent();
@@ -35421,7 +35654,7 @@ const AgentOptionsMenu = ({
35421
35654
  }
35422
35655
  ),
35423
35656
  !isAgentsPage && onViewAgentSettings && /* @__PURE__ */ jsxRuntimeExports.jsxs(
35424
- StyledMenuItem,
35657
+ StyledMenuItem$1,
35425
35658
  {
35426
35659
  onClick: () => {
35427
35660
  onViewAgentSettings();
@@ -35434,7 +35667,7 @@ const AgentOptionsMenu = ({
35434
35667
  }
35435
35668
  ),
35436
35669
  onExportAgent && /* @__PURE__ */ jsxRuntimeExports.jsxs(
35437
- StyledMenuItem,
35670
+ StyledMenuItem$1,
35438
35671
  {
35439
35672
  onClick: () => {
35440
35673
  onExportAgent();
@@ -35447,7 +35680,7 @@ const AgentOptionsMenu = ({
35447
35680
  }
35448
35681
  ),
35449
35682
  onUploadAgentToHub && /* @__PURE__ */ jsxRuntimeExports.jsxs(
35450
- StyledMenuItem,
35683
+ StyledMenuItem$1,
35451
35684
  {
35452
35685
  onClick: () => {
35453
35686
  onUploadAgentToHub();
@@ -39178,6 +39411,9 @@ const useCurrentView = () => {
39178
39411
  if (pathIncludes(currentPath, "/agent-hub")) {
39179
39412
  return "agent-hub";
39180
39413
  }
39414
+ if (pathIncludes(currentPath, "/schedules")) {
39415
+ return "schedules";
39416
+ }
39181
39417
  return "chat";
39182
39418
  };
39183
39419
  const useScrollToBottom = (buttonThreshold = 50, externalContainerRef) => {
@@ -40290,7 +40526,7 @@ const FieldContainer$5 = styled$1(Box)({
40290
40526
  marginBottom: 16
40291
40527
  // Reduced margin
40292
40528
  });
40293
- const FieldLabel$6 = styled$1("label")(({ theme: theme2 }) => ({
40529
+ const FieldLabel$7 = styled$1("label")(({ theme: theme2 }) => ({
40294
40530
  display: "flex",
40295
40531
  alignItems: "center",
40296
40532
  marginBottom: 6,
@@ -40601,7 +40837,7 @@ const EditableField = ({
40601
40837
  const hasChanged = editValue !== originalValue;
40602
40838
  const showClearButton = !isSaving && originalValue !== "";
40603
40839
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer$5, { children: [
40604
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$6, { children: [
40840
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$7, { children: [
40605
40841
  icon && /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon$7, { children: icon }),
40606
40842
  label
40607
40843
  ] }),
@@ -51936,7 +52172,7 @@ const CATEGORY_LABELS = Object.fromEntries(
51936
52172
  const FieldContainer$4 = styled$1(Box)({
51937
52173
  marginBottom: 16
51938
52174
  });
51939
- const FieldLabel$5 = styled$1("label")(({ theme: theme2 }) => ({
52175
+ const FieldLabel$6 = styled$1("label")(({ theme: theme2 }) => ({
51940
52176
  display: "flex",
51941
52177
  alignItems: "center",
51942
52178
  marginBottom: 6,
@@ -51992,7 +52228,7 @@ const CategoriesInputChips = ({
51992
52228
  onChange(value.filter((c2) => c2 !== cat));
51993
52229
  };
51994
52230
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer$4, { children: [
51995
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$5, { children: [
52231
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$6, { children: [
51996
52232
  icon && /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon$5, { children: icon }),
51997
52233
  label
51998
52234
  ] }),
@@ -52149,7 +52385,7 @@ const CategoriesInputChips = ({
52149
52385
  const FieldContainer$3 = styled$1(Box)({
52150
52386
  marginBottom: 16
52151
52387
  });
52152
- const FieldLabel$4 = styled$1("label")(({ theme: theme2 }) => ({
52388
+ const FieldLabel$5 = styled$1("label")(({ theme: theme2 }) => ({
52153
52389
  display: "flex",
52154
52390
  alignItems: "center",
52155
52391
  marginBottom: 6,
@@ -52229,7 +52465,7 @@ const TagsInputChips = ({
52229
52465
  onChange(value.filter((t2) => t2 !== tag));
52230
52466
  };
52231
52467
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer$3, { children: [
52232
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$4, { children: [
52468
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$5, { children: [
52233
52469
  icon && /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon$4, { children: icon }),
52234
52470
  label
52235
52471
  ] }),
@@ -52379,7 +52615,7 @@ const FieldContainer$2 = styled$1(Box)({
52379
52615
  // Reduced margin
52380
52616
  position: "relative"
52381
52617
  });
52382
- const FieldLabel$3 = styled$1(Typography)(({ theme: theme2 }) => ({
52618
+ const FieldLabel$4 = styled$1(Typography)(({ theme: theme2 }) => ({
52383
52619
  marginBottom: 6,
52384
52620
  // Reduced margin
52385
52621
  display: "flex",
@@ -52397,7 +52633,7 @@ const LabelIcon$3 = styled$1(Box)({
52397
52633
  display: "flex",
52398
52634
  alignItems: "center"
52399
52635
  });
52400
- const StyledAutocomplete$1 = styled$1(Autocomplete)(({ theme: theme2 }) => ({
52636
+ const StyledAutocomplete$2 = styled$1(Autocomplete)(({ theme: theme2 }) => ({
52401
52637
  "& .MuiOutlinedInput-root": {
52402
52638
  // Target the root for border, background, height
52403
52639
  borderRadius: 6,
@@ -52663,12 +52899,12 @@ const HostingSelect = ({
52663
52899
  }
52664
52900
  };
52665
52901
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer$2, { children: [
52666
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$3, { variant: "subtitle2", children: [
52902
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$4, { variant: "subtitle2", children: [
52667
52903
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon$3, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faServer }) }),
52668
52904
  "Hosting Provider"
52669
52905
  ] }),
52670
52906
  /* @__PURE__ */ jsxRuntimeExports.jsx(
52671
- StyledAutocomplete$1,
52907
+ StyledAutocomplete$2,
52672
52908
  {
52673
52909
  value: selectedOption,
52674
52910
  inputValue,
@@ -62150,7 +62386,7 @@ const FieldContainer$1 = styled$1(Box)({
62150
62386
  marginBottom: 16,
62151
62387
  position: "relative"
62152
62388
  });
62153
- const FieldLabel$2 = styled$1(Typography)(({ theme: theme2 }) => ({
62389
+ const FieldLabel$3 = styled$1(Typography)(({ theme: theme2 }) => ({
62154
62390
  marginBottom: 6,
62155
62391
  display: "flex",
62156
62392
  alignItems: "center",
@@ -62164,7 +62400,7 @@ const LabelIcon$2 = styled$1(Box)({
62164
62400
  display: "flex",
62165
62401
  alignItems: "center"
62166
62402
  });
62167
- const StyledAutocomplete = styled$1(Autocomplete)(({ theme: theme2 }) => ({
62403
+ const StyledAutocomplete$1 = styled$1(Autocomplete)(({ theme: theme2 }) => ({
62168
62404
  "& .MuiOutlinedInput-root": {
62169
62405
  borderRadius: 6,
62170
62406
  backgroundColor: theme2.palette.background.paper,
@@ -62420,12 +62656,12 @@ const ModelSelect = ({
62420
62656
  return "";
62421
62657
  };
62422
62658
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer$1, { children: [
62423
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$2, { variant: "subtitle2", children: [
62659
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$3, { variant: "subtitle2", children: [
62424
62660
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faRobot }) }),
62425
62661
  "Model"
62426
62662
  ] }),
62427
62663
  /* @__PURE__ */ jsxRuntimeExports.jsx(
62428
- StyledAutocomplete,
62664
+ StyledAutocomplete$1,
62429
62665
  {
62430
62666
  value: selectedOption,
62431
62667
  inputValue,
@@ -62525,7 +62761,7 @@ const FieldContainer = styled$1(Box)({
62525
62761
  position: "relative",
62526
62762
  marginBottom: 16
62527
62763
  });
62528
- const FieldLabel$1 = styled$1("div")(({ theme: theme2 }) => ({
62764
+ const FieldLabel$2 = styled$1("div")(({ theme: theme2 }) => ({
62529
62765
  fontFamily: theme2.typography.fontFamily,
62530
62766
  fontSize: "0.875rem",
62531
62767
  // Small text size
@@ -62721,7 +62957,7 @@ const GeneralSettings = ({
62721
62957
  },
62722
62958
  `model-select-${currentHosting}`
62723
62959
  ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer, { children: [
62724
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
62960
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$2, { children: [
62725
62961
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faRobot }) }),
62726
62962
  "Model"
62727
62963
  ] }),
@@ -62823,14 +63059,14 @@ const GeneralSettings = ({
62823
63059
  ),
62824
63060
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { container: true, spacing: 3, children: [
62825
63061
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { item: true, xs: 12, sm: 6, children: [
62826
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
63062
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$2, { children: [
62827
63063
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faIdCard, size: "xs" }) }),
62828
63064
  "ID"
62829
63065
  ] }),
62830
63066
  /* @__PURE__ */ jsxRuntimeExports.jsx(InfoCard, { title: selectedAgent.id, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MonospaceValueText, { children: selectedAgent.id }) })
62831
63067
  ] }),
62832
63068
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { item: true, xs: 12, sm: 6, children: [
62833
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
63069
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$2, { children: [
62834
63070
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCalendarAlt, size: "xs" }) }),
62835
63071
  "Created"
62836
63072
  ] }),
@@ -62843,7 +63079,7 @@ const GeneralSettings = ({
62843
63079
  )
62844
63080
  ] }),
62845
63081
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { item: true, xs: 12, sm: 6, children: [
62846
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
63082
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$2, { children: [
62847
63083
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCodeBranch, size: "xs" }) }),
62848
63084
  "Version"
62849
63085
  ] }),
@@ -63498,7 +63734,7 @@ const OptionsButtonContainer$1 = styled$1(Box)({
63498
63734
  pointerEvents: "auto"
63499
63735
  }
63500
63736
  });
63501
- const formatDate = (dateString) => {
63737
+ const formatDate$1 = (dateString) => {
63502
63738
  if (!dateString) return "Unknown date";
63503
63739
  const date2 = new Date(dateString);
63504
63740
  return date2.toLocaleDateString(void 0, {
@@ -63729,14 +63965,14 @@ const AgentsSidebar = ({
63729
63965
  /* @__PURE__ */ jsxRuntimeExports.jsx(
63730
63966
  Tooltip$1,
63731
63967
  {
63732
- title: `Created: ${formatDate(agent.created_date)}`,
63968
+ title: `Created: ${formatDate$1(agent.created_date)}`,
63733
63969
  arrow: true,
63734
63970
  placement: "bottom-start",
63735
63971
  enterDelay: 1200,
63736
63972
  enterNextDelay: 1200,
63737
63973
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CreationDateText, { children: [
63738
63974
  /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faClock, size: "xs" }),
63739
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: formatDate(agent.created_date) })
63975
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: formatDate$1(agent.created_date) })
63740
63976
  ] })
63741
63977
  }
63742
63978
  )
@@ -83160,7 +83396,7 @@ const languages = [
83160
83396
  name: "Go",
83161
83397
  extensions: ["go"],
83162
83398
  load() {
83163
- return __vitePreload(() => import("./index-DV8SteiB.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url).then((m2) => m2.go());
83399
+ return __vitePreload(() => import("./index-cc_xe9_G.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url).then((m2) => m2.go());
83164
83400
  }
83165
83401
  }),
83166
83402
  /* @__PURE__ */ LanguageDescription.of({
@@ -83337,7 +83573,7 @@ const languages = [
83337
83573
  alias: ["yml"],
83338
83574
  extensions: ["yaml", "yml"],
83339
83575
  load() {
83340
- return __vitePreload(() => import("./index-Dp4J_UIV.js"), true ? __vite__mapDeps([3,1,2]) : void 0, import.meta.url).then((m2) => m2.yaml());
83576
+ return __vitePreload(() => import("./index-qogN06h3.js"), true ? __vite__mapDeps([3,1,2]) : void 0, import.meta.url).then((m2) => m2.yaml());
83341
83577
  }
83342
83578
  }),
83343
83579
  // Legacy modes ported from CodeMirror 5
@@ -184396,7 +184632,7 @@ const SectionDescription$1 = styled$1(Box)(({ theme: theme2 }) => ({
184396
184632
  // Consistent margin
184397
184633
  lineHeight: 1.5
184398
184634
  }));
184399
- const FieldLabel = styled$1("label")(({ theme: theme2 }) => ({
184635
+ const FieldLabel$1 = styled$1("label")(({ theme: theme2 }) => ({
184400
184636
  ...theme2.typography.body2,
184401
184637
  marginBottom: 6,
184402
184638
  display: "flex",
@@ -184934,7 +185170,7 @@ const DefaultModelStep = () => {
184934
185170
  ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
184935
185171
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
184936
185172
  " ",
184937
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { children: [
185173
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
184938
185174
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faRobot, size: "sm" }) }),
184939
185175
  "Model Provider"
184940
185176
  ] }),
@@ -184954,7 +185190,7 @@ const DefaultModelStep = () => {
184954
185190
  ] }),
184955
185191
  selectedProvider && /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { mt: 1.5 }, children: [
184956
185192
  " ",
184957
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { children: [
185193
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
184958
185194
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faWandMagicSparkles, size: "sm" }) }),
184959
185195
  "AI Model"
184960
185196
  ] }),
@@ -185257,7 +185493,7 @@ const ModelCredentialStep = () => {
185257
185493
  /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer, { children: [
185258
185494
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
185259
185495
  " ",
185260
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { children: [
185496
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
185261
185497
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon, { children: "🤖" }),
185262
185498
  "Model Provider"
185263
185499
  ] }),
@@ -185329,7 +185565,7 @@ const ModelCredentialStep = () => {
185329
185565
  ),
185330
185566
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
185331
185567
  " ",
185332
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { children: [
185568
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
185333
185569
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faKey, size: "sm" }) }),
185334
185570
  "API Key"
185335
185571
  ] }),
@@ -185849,7 +186085,7 @@ const SearchApiStep = () => {
185849
186085
  ),
185850
186086
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
185851
186087
  " ",
185852
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { children: [
186088
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
185853
186089
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon, { children: "🔎" }),
185854
186090
  "Search API Provider"
185855
186091
  ] }),
@@ -185932,7 +186168,7 @@ const SearchApiStep = () => {
185932
186168
  ),
185933
186169
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
185934
186170
  " ",
185935
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { children: [
186171
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
185936
186172
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faKey, size: "sm" }) }),
185937
186173
  "API Key (Optional)"
185938
186174
  ] }),
@@ -186054,7 +186290,7 @@ const UserProfileStep = () => {
186054
186290
  /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer, { children: [
186055
186291
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
186056
186292
  " ",
186057
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { children: [
186293
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
186058
186294
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon, { children: "😎" }),
186059
186295
  " ",
186060
186296
  "Your Name"
@@ -186076,7 +186312,7 @@ const UserProfileStep = () => {
186076
186312
  ] }),
186077
186313
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
186078
186314
  " ",
186079
- /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { children: [
186315
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel$1, { children: [
186080
186316
  /* @__PURE__ */ jsxRuntimeExports.jsx(LabelIcon, { children: "📧" }),
186081
186317
  " ",
186082
186318
  "Email Address (Optional)"
@@ -186403,6 +186639,1048 @@ const OnboardingModal = ({ open: open2 }) => {
186403
186639
  }
186404
186640
  );
186405
186641
  };
186642
+ const SCHEDULE_QUERY_KEY = "schedules";
186643
+ const AGENT_SCHEDULE_QUERY_KEY = "agentSchedules";
186644
+ const useListAllSchedules = (page = 1, perPage = 10) => {
186645
+ const { baseUrl } = apiConfig;
186646
+ return useQuery({
186647
+ queryKey: [SCHEDULE_QUERY_KEY, "all", page, perPage],
186648
+ queryFn: () => SchedulesApi.listAllSchedules(baseUrl, page, perPage),
186649
+ enabled: !!baseUrl
186650
+ });
186651
+ };
186652
+ const useCreateScheduleForAgent = () => {
186653
+ const queryClient2 = useQueryClient();
186654
+ const { baseUrl } = apiConfig;
186655
+ return useMutation({
186656
+ mutationFn: ({ agentId, scheduleData }) => SchedulesApi.createScheduleForAgent(baseUrl, agentId, scheduleData),
186657
+ onSuccess: (_2, variables) => {
186658
+ queryClient2.invalidateQueries({ queryKey: [SCHEDULE_QUERY_KEY, "all"] });
186659
+ queryClient2.invalidateQueries({
186660
+ queryKey: [AGENT_SCHEDULE_QUERY_KEY, variables.agentId]
186661
+ });
186662
+ }
186663
+ });
186664
+ };
186665
+ const useEditSchedule = () => {
186666
+ const queryClient2 = useQueryClient();
186667
+ const { baseUrl } = apiConfig;
186668
+ return useMutation({
186669
+ mutationFn: ({ scheduleId, scheduleData }) => SchedulesApi.editSchedule(baseUrl, scheduleId, scheduleData),
186670
+ onSuccess: (data2) => {
186671
+ const agentId = data2.result?.agent_id;
186672
+ queryClient2.invalidateQueries({ queryKey: [SCHEDULE_QUERY_KEY, "all"] });
186673
+ queryClient2.invalidateQueries({
186674
+ queryKey: [SCHEDULE_QUERY_KEY, data2.result?.id]
186675
+ });
186676
+ if (agentId) {
186677
+ queryClient2.invalidateQueries({
186678
+ queryKey: [AGENT_SCHEDULE_QUERY_KEY, agentId]
186679
+ });
186680
+ }
186681
+ }
186682
+ });
186683
+ };
186684
+ const useRemoveSchedule = () => {
186685
+ const queryClient2 = useQueryClient();
186686
+ const { baseUrl } = apiConfig;
186687
+ return useMutation({
186688
+ mutationFn: ({ scheduleId }) => SchedulesApi.removeSchedule(baseUrl, scheduleId),
186689
+ onSuccess: (_2, variables) => {
186690
+ queryClient2.invalidateQueries({ queryKey: [SCHEDULE_QUERY_KEY, "all"] });
186691
+ queryClient2.invalidateQueries({
186692
+ queryKey: [SCHEDULE_QUERY_KEY, variables.scheduleId]
186693
+ });
186694
+ if (variables.agentId) {
186695
+ queryClient2.invalidateQueries({
186696
+ queryKey: [AGENT_SCHEDULE_QUERY_KEY, variables.agentId]
186697
+ });
186698
+ }
186699
+ }
186700
+ });
186701
+ };
186702
+ const StyledFormGrid = styled$1(Grid)(({ theme: theme2 }) => ({
186703
+ paddingTop: theme2.spacing(1)
186704
+ }));
186705
+ const FieldLabel = styled$1("label")(({ theme: theme2 }) => ({
186706
+ display: "block",
186707
+ marginBottom: theme2.spacing(0.75),
186708
+ color: theme2.palette.text.secondary,
186709
+ fontWeight: 500,
186710
+ fontSize: "0.875rem",
186711
+ lineHeight: 1.5
186712
+ }));
186713
+ const FullWidthTextField = styled$1(TextField)(({ theme: theme2 }) => ({
186714
+ width: "100%",
186715
+ "& .MuiOutlinedInput-root": {
186716
+ borderRadius: 6,
186717
+ border: `1px solid ${theme2.palette.divider}`,
186718
+ backgroundColor: theme2.palette.background.paper,
186719
+ minHeight: "36px",
186720
+ height: "36px",
186721
+ padding: 0,
186722
+ transition: "border-color 0.2s ease, box-shadow 0.2s ease",
186723
+ "&:hover": {
186724
+ borderColor: theme2.palette.text.secondary
186725
+ },
186726
+ "&.Mui-focused": {
186727
+ borderColor: theme2.palette.primary.main,
186728
+ boxShadow: `0 0 0 2px ${alpha$1(theme2.palette.primary.main, 0.2)}`
186729
+ },
186730
+ "& .MuiOutlinedInput-notchedOutline": {
186731
+ border: "none"
186732
+ },
186733
+ "&:not(.MuiInputBase-multiline) .MuiInputBase-input": {
186734
+ height: "calc(36px - 16px)",
186735
+ padding: "8px 12px"
186736
+ },
186737
+ "&.MuiInputBase-multiline": {
186738
+ minHeight: "36px",
186739
+ height: "auto",
186740
+ padding: "8px 12px"
186741
+ }
186742
+ },
186743
+ "& .MuiInputBase-input": {
186744
+ fontSize: "0.875rem",
186745
+ lineHeight: 1.5,
186746
+ boxSizing: "border-box",
186747
+ "&.MuiInputBase-inputMultiline": {
186748
+ padding: "0px",
186749
+ height: "auto"
186750
+ }
186751
+ }
186752
+ }));
186753
+ const FullWidthFormControl = styled$1(FormControl)(({ theme: theme2 }) => ({
186754
+ width: "100%",
186755
+ "& .MuiOutlinedInput-root": {
186756
+ borderRadius: 6,
186757
+ border: `1px solid ${theme2.palette.divider}`,
186758
+ backgroundColor: theme2.palette.background.paper,
186759
+ minHeight: "36px",
186760
+ height: "36px",
186761
+ padding: "0 !important",
186762
+ transition: "border-color 0.2s ease, box-shadow 0.2s ease",
186763
+ "&:hover": {
186764
+ borderColor: theme2.palette.text.secondary
186765
+ },
186766
+ "&.Mui-focused": {
186767
+ borderColor: theme2.palette.primary.main,
186768
+ boxShadow: `0 0 0 2px ${alpha$1(theme2.palette.primary.main, 0.2)}`
186769
+ },
186770
+ "& .MuiOutlinedInput-notchedOutline": {
186771
+ border: "none"
186772
+ }
186773
+ },
186774
+ "& .MuiSelect-select": {
186775
+ padding: "8px 12px !important",
186776
+ fontSize: "0.875rem",
186777
+ lineHeight: 1.5,
186778
+ height: "calc(36px - 16px) !important",
186779
+ boxSizing: "border-box",
186780
+ display: "flex",
186781
+ alignItems: "center"
186782
+ }
186783
+ }));
186784
+ const StyledAutocomplete = styled$1(
186785
+ Autocomplete
186786
+ )(({ theme: theme2 }) => ({
186787
+ "& .MuiOutlinedInput-root": {
186788
+ borderRadius: 6,
186789
+ border: `1px solid ${theme2.palette.divider}`,
186790
+ backgroundColor: theme2.palette.background.paper,
186791
+ minHeight: "36px",
186792
+ height: "36px",
186793
+ padding: "0 !important",
186794
+ transition: "border-color 0.2s ease, box-shadow 0.2s ease",
186795
+ "&:hover": {
186796
+ borderColor: theme2.palette.text.secondary
186797
+ },
186798
+ "&.Mui-focused": {
186799
+ borderColor: theme2.palette.primary.main,
186800
+ boxShadow: `0 0 0 2px ${alpha$1(theme2.palette.primary.main, 0.2)}`
186801
+ },
186802
+ "& .MuiOutlinedInput-notchedOutline": {
186803
+ border: "none"
186804
+ },
186805
+ "& .MuiInputBase-input": {
186806
+ padding: "8px 12px !important",
186807
+ fontSize: "0.875rem",
186808
+ lineHeight: 1.5,
186809
+ height: "calc(36px - 16px)",
186810
+ boxSizing: "border-box"
186811
+ }
186812
+ },
186813
+ "& .MuiAutocomplete-endAdornment": {
186814
+ right: "8px",
186815
+ top: "50%",
186816
+ transform: "translateY(-50%)"
186817
+ },
186818
+ "& .MuiAutocomplete-clearIndicator, & .MuiAutocomplete-popupIndicator": {
186819
+ color: theme2.palette.text.secondary,
186820
+ "&:hover": {
186821
+ color: theme2.palette.text.primary,
186822
+ backgroundColor: alpha$1(theme2.palette.action.active, 0.04)
186823
+ }
186824
+ }
186825
+ }));
186826
+ const StyledFormHelperText = styled$1(Typography, {
186827
+ shouldForwardProp: (prop) => prop !== "error"
186828
+ })(({ theme: theme2, error }) => ({
186829
+ fontSize: "0.75rem",
186830
+ marginTop: theme2.spacing(0.5),
186831
+ marginLeft: theme2.spacing(0.25),
186832
+ color: error ? theme2.palette.error.main : theme2.palette.text.secondary
186833
+ }));
186834
+ const StyledSwitch = styled$1(Switch)(({ theme: theme2 }) => ({
186835
+ width: 42,
186836
+ height: 26,
186837
+ padding: 0,
186838
+ "& .MuiSwitch-switchBase": {
186839
+ padding: 0,
186840
+ margin: 2,
186841
+ transitionDuration: "300ms",
186842
+ "&.Mui-checked": {
186843
+ transform: "translateX(16px)",
186844
+ color: "#fff",
186845
+ "& + .MuiSwitch-track": {
186846
+ backgroundColor: theme2.palette.primary.main,
186847
+ opacity: 1,
186848
+ border: 0
186849
+ },
186850
+ "&.Mui-disabled + .MuiSwitch-track": {
186851
+ opacity: 0.5
186852
+ }
186853
+ },
186854
+ "&.Mui-focusVisible .MuiSwitch-thumb": {
186855
+ color: theme2.palette.primary.main,
186856
+ border: "6px solid #fff"
186857
+ },
186858
+ "&.Mui-disabled .MuiSwitch-thumb": {
186859
+ color: theme2.palette.mode === "light" ? theme2.palette.grey[100] : theme2.palette.grey[600]
186860
+ },
186861
+ "&.Mui-disabled + .MuiSwitch-track": {
186862
+ opacity: theme2.palette.mode === "light" ? 0.7 : 0.3
186863
+ }
186864
+ },
186865
+ "& .MuiSwitch-thumb": {
186866
+ boxSizing: "border-box",
186867
+ width: 22,
186868
+ height: 22,
186869
+ boxShadow: "none"
186870
+ },
186871
+ "& .MuiSwitch-track": {
186872
+ borderRadius: 26 / 2,
186873
+ backgroundColor: theme2.palette.mode === "light" ? "#E9E9EA" : theme2.palette.grey[700],
186874
+ opacity: 1,
186875
+ transition: theme2.transitions.create(["background-color"], {
186876
+ duration: 500
186877
+ })
186878
+ }
186879
+ }));
186880
+ const StyledFormControlLabel = styled$1(FormControlLabel)(({ theme: theme2 }) => ({
186881
+ marginLeft: 0,
186882
+ marginRight: theme2.spacing(1),
186883
+ "& .MuiTypography-root": {
186884
+ fontSize: "0.875rem",
186885
+ color: theme2.palette.text.primary,
186886
+ paddingLeft: theme2.spacing(1)
186887
+ }
186888
+ }));
186889
+ const StyledMenuItem = styled$1(MenuItem)(({ theme: theme2 }) => ({
186890
+ fontSize: "0.875rem",
186891
+ paddingTop: theme2.spacing(1),
186892
+ paddingBottom: theme2.spacing(1),
186893
+ "&:hover": {
186894
+ backgroundColor: alpha$1(theme2.palette.action.hover, 0.08)
186895
+ },
186896
+ "&.Mui-selected": {
186897
+ backgroundColor: alpha$1(theme2.palette.primary.main, 0.12),
186898
+ "&:hover": {
186899
+ backgroundColor: alpha$1(theme2.palette.primary.main, 0.16)
186900
+ }
186901
+ }
186902
+ }));
186903
+ const defaultFormState = {
186904
+ selectedAgentId: null,
186905
+ // Initialize selectedAgentId
186906
+ prompt: "",
186907
+ interval: 1,
186908
+ unit: "hours",
186909
+ is_active: true,
186910
+ one_time: false,
186911
+ start_time_utc: null,
186912
+ end_time_utc: null
186913
+ };
186914
+ const ScheduleFormDialog = ({
186915
+ open: open2,
186916
+ onClose,
186917
+ onSubmit,
186918
+ initialData
186919
+ // agentId prop removed
186920
+ }) => {
186921
+ const [formData, setFormData] = reactExports.useState(defaultFormState);
186922
+ const [isSubmitting, setIsSubmitting] = reactExports.useState(false);
186923
+ const [agentSearchQuery, setAgentSearchQuery] = reactExports.useState("");
186924
+ const [selectedAgentForForm, setSelectedAgentForForm] = reactExports.useState(null);
186925
+ const isEditMode = !!initialData;
186926
+ const {
186927
+ data: agentsListResult,
186928
+ isLoading: isLoadingAgents,
186929
+ isError: isAgentsError
186930
+ } = useAgents(1, 50, 0, agentSearchQuery || void 0);
186931
+ const agentOptions = reactExports.useMemo(
186932
+ () => agentsListResult?.agents || [],
186933
+ [agentsListResult]
186934
+ );
186935
+ reactExports.useEffect(() => {
186936
+ if (open2) {
186937
+ if (initialData) {
186938
+ setFormData({
186939
+ selectedAgentId: initialData.agent_id,
186940
+ // Pre-fill agent if editing
186941
+ prompt: initialData.prompt,
186942
+ interval: initialData.interval,
186943
+ unit: initialData.unit,
186944
+ is_active: initialData.is_active,
186945
+ one_time: initialData.one_time,
186946
+ start_time_utc: initialData.start_time_utc ? new Date(initialData.start_time_utc).toISOString().slice(0, 16) : null,
186947
+ end_time_utc: initialData.end_time_utc ? new Date(initialData.end_time_utc).toISOString().slice(0, 16) : null
186948
+ });
186949
+ const currentAgent = agentOptions.find(
186950
+ (agent) => agent.id === initialData.agent_id
186951
+ );
186952
+ if (currentAgent) {
186953
+ setSelectedAgentForForm(currentAgent);
186954
+ } else if (initialData.agent_id && !isLoadingAgents && agentOptions.length > 0) ;
186955
+ } else {
186956
+ setFormData(defaultFormState);
186957
+ setSelectedAgentForForm(null);
186958
+ setAgentSearchQuery("");
186959
+ }
186960
+ }
186961
+ }, [open2, initialData, agentOptions, isLoadingAgents]);
186962
+ const handleChange = (event) => {
186963
+ const { name: name2, value } = event.target;
186964
+ let processedValue = value;
186965
+ if ("type" in event.target) {
186966
+ const targetType = event.target.type;
186967
+ if (targetType === "number" && name2 === "interval") {
186968
+ processedValue = value === "" ? "" : Number.parseInt(value, 10);
186969
+ }
186970
+ }
186971
+ setFormData((prev2) => ({
186972
+ ...prev2,
186973
+ [name2]: processedValue
186974
+ }));
186975
+ };
186976
+ const handleSwitchChange = (event) => {
186977
+ setFormData((prev2) => ({
186978
+ ...prev2,
186979
+ [event.target.name]: event.target.checked
186980
+ }));
186981
+ };
186982
+ const handleDateTimeChange = (event) => {
186983
+ const { name: name2, value } = event.target;
186984
+ setFormData((prev2) => ({
186985
+ ...prev2,
186986
+ [name2]: value ? new Date(value).toISOString() : null
186987
+ }));
186988
+ };
186989
+ const handleSubmit = async () => {
186990
+ setIsSubmitting(true);
186991
+ try {
186992
+ if (!isEditMode && !formData.selectedAgentId) {
186993
+ console.error("Agent ID is required to create a schedule.");
186994
+ setIsSubmitting(false);
186995
+ return;
186996
+ }
186997
+ const scheduleData = {
186998
+ prompt: formData.prompt,
186999
+ interval: Number(formData.interval),
187000
+ unit: formData.unit,
187001
+ is_active: formData.is_active,
187002
+ one_time: formData.one_time,
187003
+ start_time_utc: formData.start_time_utc || null,
187004
+ end_time_utc: formData.end_time_utc || null
187005
+ };
187006
+ if (scheduleData.start_time_utc === "")
187007
+ scheduleData.start_time_utc = null;
187008
+ if (scheduleData.end_time_utc === "") scheduleData.end_time_utc = null;
187009
+ const agentForSubmit = isEditMode ? initialData.agent_id : formData.selectedAgentId;
187010
+ if (!agentForSubmit) {
187011
+ console.error("Agent ID is missing for submission.");
187012
+ setIsSubmitting(false);
187013
+ return;
187014
+ }
187015
+ await onSubmit(scheduleData, agentForSubmit);
187016
+ onClose();
187017
+ } catch (error) {
187018
+ console.error("Failed to submit schedule:", error);
187019
+ y$2.error(
187020
+ `Failed to save schedule: ${error instanceof Error ? error.message : "Unknown error"}`
187021
+ );
187022
+ } finally {
187023
+ setIsSubmitting(false);
187024
+ }
187025
+ };
187026
+ const dialogTitle = isEditMode ? "Edit Schedule" : "Create New Schedule";
187027
+ const dialogActions = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
187028
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187029
+ SecondaryButton$1,
187030
+ {
187031
+ onClick: onClose,
187032
+ disabled: isSubmitting,
187033
+ startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(SquareX, { size: 18 }),
187034
+ children: "Cancel"
187035
+ }
187036
+ ),
187037
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187038
+ PrimaryButton$1,
187039
+ {
187040
+ onClick: handleSubmit,
187041
+ disabled: isSubmitting || !formData.prompt || formData.interval != null && formData.interval < 1 || !isEditMode && !formData.selectedAgentId,
187042
+ startIcon: isSubmitting ? /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress, { size: 18, color: "inherit" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Save, { size: 18 }),
187043
+ children: isSubmitting ? "Saving..." : isEditMode ? "Save Changes" : "Create Schedule"
187044
+ }
187045
+ )
187046
+ ] });
187047
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
187048
+ BaseDialog,
187049
+ {
187050
+ open: open2,
187051
+ onClose,
187052
+ title: dialogTitle,
187053
+ actions: dialogActions,
187054
+ maxWidth: "sm",
187055
+ fullWidth: true,
187056
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(StyledFormGrid, { container: true, spacing: 2, children: [
187057
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { display: "flex", alignItems: "center", mb: 1, children: [
187058
+ /* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { size: "small", sx: { mr: 1, color: "info.main" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Info$1, { size: 16 }) }),
187059
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187060
+ Typography,
187061
+ {
187062
+ variant: "body2",
187063
+ color: "text.secondary",
187064
+ fontSize: "0.875rem",
187065
+ children: 'Tip: It is often easier to ask an agent through chat to do something for you on a regular basis, like "Send me an email with the latest news at 8am every day".'
187066
+ }
187067
+ )
187068
+ ] }) }),
187069
+ !isEditMode && /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { item: true, xs: 12, children: [
187070
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { htmlFor: "agent-select-for-schedule", children: [
187071
+ "Select Agent",
187072
+ " ",
187073
+ isEditMode ? "" : /* @__PURE__ */ jsxRuntimeExports.jsx(
187074
+ Typography,
187075
+ {
187076
+ component: "span",
187077
+ color: "error.main",
187078
+ sx: { ml: 0.5 },
187079
+ children: "*"
187080
+ }
187081
+ )
187082
+ ] }),
187083
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187084
+ StyledAutocomplete,
187085
+ {
187086
+ id: "agent-select-for-schedule",
187087
+ options: agentOptions,
187088
+ value: selectedAgentForForm,
187089
+ getOptionLabel: (option2) => option2.name || `Agent ID: ${option2.id.substring(0, 8)}...`,
187090
+ isOptionEqualToValue: (option2, value) => option2.id === value.id,
187091
+ onChange: (_event, newValue) => {
187092
+ setSelectedAgentForForm(newValue);
187093
+ setFormData((prev2) => ({
187094
+ ...prev2,
187095
+ selectedAgentId: newValue ? newValue.id : null
187096
+ }));
187097
+ },
187098
+ onInputChange: (_event, newInputValue) => {
187099
+ const timer = setTimeout(() => {
187100
+ setAgentSearchQuery(newInputValue);
187101
+ }, 300);
187102
+ return () => clearTimeout(timer);
187103
+ },
187104
+ loading: isLoadingAgents,
187105
+ disabled: isSubmitting || isEditMode,
187106
+ renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(
187107
+ TextField,
187108
+ {
187109
+ ...params,
187110
+ placeholder: "Search or select an agent...",
187111
+ error: isAgentsError || !isEditMode && !formData.selectedAgentId && isSubmitting,
187112
+ InputProps: {
187113
+ ...params.InputProps,
187114
+ endAdornment: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
187115
+ isLoadingAgents ? /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress, { color: "inherit", size: 20 }) : null,
187116
+ params.InputProps.endAdornment
187117
+ ] })
187118
+ }
187119
+ }
187120
+ ),
187121
+ renderOption: (props2, option2) => /* @__PURE__ */ reactExports.createElement(
187122
+ Box,
187123
+ {
187124
+ component: "li",
187125
+ ...props2,
187126
+ key: option2.id,
187127
+ sx: (theme2) => ({
187128
+ display: "flex",
187129
+ justifyContent: "left",
187130
+ alignItems: "flex-start",
187131
+ "&:hover": {
187132
+ backgroundColor: alpha$1(theme2.palette.action.hover, 0.08)
187133
+ },
187134
+ '&[aria-selected="true"]': {
187135
+ backgroundColor: alpha$1(theme2.palette.primary.main, 0.12)
187136
+ }
187137
+ })
187138
+ },
187139
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187140
+ Typography,
187141
+ {
187142
+ variant: "body2",
187143
+ component: "span",
187144
+ sx: { fontWeight: 500 },
187145
+ children: option2.name || "Unnamed Agent"
187146
+ }
187147
+ )
187148
+ )
187149
+ }
187150
+ ),
187151
+ (isAgentsError || !isEditMode && !formData.selectedAgentId && isSubmitting) && /* @__PURE__ */ jsxRuntimeExports.jsx(
187152
+ StyledFormHelperText,
187153
+ {
187154
+ error: !!isAgentsError || !isEditMode && !formData.selectedAgentId && !!isSubmitting,
187155
+ children: isAgentsError ? "Failed to load agents." : "Agent selection is required."
187156
+ }
187157
+ )
187158
+ ] }),
187159
+ isEditMode && initialData && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { variant: "body2", color: "text.secondary", sx: { mt: 1 }, children: [
187160
+ "Editing schedule for Agent:",
187161
+ " ",
187162
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { component: "span", sx: { fontWeight: 500 }, children: selectedAgentForForm?.name || `${initialData.agent_id.substring(0, 8)}...` }),
187163
+ " ",
187164
+ "(Agent cannot be changed)"
187165
+ ] }) }),
187166
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
187167
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { htmlFor: "prompt", children: [
187168
+ "Prompt",
187169
+ " ",
187170
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { component: "span", color: "error.main", sx: { ml: 0.5 }, children: "*" }),
187171
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187172
+ Tooltip$1,
187173
+ {
187174
+ title: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
187175
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "caption", display: "block", gutterBottom: true, children: "This is the message that will be sent to the agent on the schedule." }),
187176
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "caption", display: "block", children: 'Example: "Send me an email with a detailed world news breakdown with key events"' })
187177
+ ] }),
187178
+ placement: "top-start",
187179
+ arrow: true,
187180
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { size: "small", sx: { color: "info.main" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Info$1, { size: 14 }) })
187181
+ }
187182
+ )
187183
+ ] }),
187184
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187185
+ FullWidthTextField,
187186
+ {
187187
+ id: "prompt",
187188
+ name: "prompt",
187189
+ value: formData.prompt,
187190
+ onChange: handleChange,
187191
+ required: true,
187192
+ multiline: true,
187193
+ rows: 3,
187194
+ disabled: isSubmitting,
187195
+ placeholder: "e.g., Send me an email with a detailed world news breakdown..."
187196
+ }
187197
+ )
187198
+ ] }) }),
187199
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { item: true, xs: 6, children: [
187200
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { htmlFor: "interval", children: [
187201
+ "Interval",
187202
+ " ",
187203
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { component: "span", color: "error.main", sx: { ml: 0.5 }, children: "*" })
187204
+ ] }),
187205
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187206
+ FullWidthTextField,
187207
+ {
187208
+ id: "interval",
187209
+ name: "interval",
187210
+ type: "number",
187211
+ value: formData.interval === null ? "" : formData.interval,
187212
+ onChange: handleChange,
187213
+ required: true,
187214
+ disabled: isSubmitting,
187215
+ InputProps: { inputProps: { min: 1 } },
187216
+ placeholder: "e.g., 1"
187217
+ }
187218
+ )
187219
+ ] }),
187220
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { item: true, xs: 6, children: [
187221
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { htmlFor: "unit-select", children: [
187222
+ "Unit",
187223
+ " ",
187224
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { component: "span", color: "error.main", sx: { ml: 0.5 }, children: "*" })
187225
+ ] }),
187226
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187227
+ FullWidthFormControl,
187228
+ {
187229
+ required: true,
187230
+ disabled: isSubmitting,
187231
+ id: "unit-select-formcontrol",
187232
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
187233
+ Select,
187234
+ {
187235
+ id: "unit-select",
187236
+ name: "unit",
187237
+ value: formData.unit || "hours",
187238
+ onChange: handleChange,
187239
+ displayEmpty: true,
187240
+ children: [
187241
+ /* @__PURE__ */ jsxRuntimeExports.jsx(StyledMenuItem, { value: "minutes", children: "Minutes" }),
187242
+ /* @__PURE__ */ jsxRuntimeExports.jsx(StyledMenuItem, { value: "hours", children: "Hours" }),
187243
+ /* @__PURE__ */ jsxRuntimeExports.jsx(StyledMenuItem, { value: "days", children: "Days" })
187244
+ ]
187245
+ }
187246
+ )
187247
+ }
187248
+ )
187249
+ ] }),
187250
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { item: true, xs: 12, sm: 6, children: [
187251
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FieldLabel, { htmlFor: "start_time_utc", children: "Start Time (UTC, Optional)" }),
187252
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187253
+ FullWidthTextField,
187254
+ {
187255
+ id: "start_time_utc",
187256
+ name: "start_time_utc",
187257
+ type: "datetime-local",
187258
+ value: formData.start_time_utc ? formData.start_time_utc.slice(0, 16) : "",
187259
+ onChange: handleDateTimeChange,
187260
+ disabled: isSubmitting
187261
+ }
187262
+ ),
187263
+ /* @__PURE__ */ jsxRuntimeExports.jsx(StyledFormHelperText, { children: "If not set, starts immediately or on next interval." })
187264
+ ] }),
187265
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { item: true, xs: 12, sm: 6, children: [
187266
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FieldLabel, { htmlFor: "end_time_utc", children: "End Time (UTC, Optional)" }),
187267
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187268
+ FullWidthTextField,
187269
+ {
187270
+ id: "end_time_utc",
187271
+ name: "end_time_utc",
187272
+ type: "datetime-local",
187273
+ value: formData.end_time_utc ? formData.end_time_utc.slice(0, 16) : "",
187274
+ onChange: handleDateTimeChange,
187275
+ disabled: isSubmitting
187276
+ }
187277
+ ),
187278
+ /* @__PURE__ */ jsxRuntimeExports.jsx(StyledFormHelperText, { children: "If not set, schedule runs indefinitely." })
187279
+ ] }),
187280
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, xs: 6, sx: { display: "flex", alignItems: "center", mt: 1 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
187281
+ StyledFormControlLabel,
187282
+ {
187283
+ control: /* @__PURE__ */ jsxRuntimeExports.jsx(
187284
+ StyledSwitch,
187285
+ {
187286
+ checked: formData.is_active || false,
187287
+ onChange: handleSwitchChange,
187288
+ name: "is_active",
187289
+ disabled: isSubmitting
187290
+ }
187291
+ ),
187292
+ label: "Active"
187293
+ }
187294
+ ) }),
187295
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, xs: 6, sx: { display: "flex", alignItems: "center", mt: 1 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
187296
+ StyledFormControlLabel,
187297
+ {
187298
+ control: /* @__PURE__ */ jsxRuntimeExports.jsx(
187299
+ StyledSwitch,
187300
+ {
187301
+ checked: formData.one_time || false,
187302
+ onChange: handleSwitchChange,
187303
+ name: "one_time",
187304
+ disabled: isSubmitting
187305
+ }
187306
+ ),
187307
+ label: "One-time"
187308
+ }
187309
+ ) })
187310
+ ] })
187311
+ }
187312
+ );
187313
+ };
187314
+ const formatTime = (date2) => {
187315
+ return date2.toLocaleTimeString(navigator.language, {
187316
+ hour: "numeric",
187317
+ minute: "2-digit"
187318
+ });
187319
+ };
187320
+ const formatDate = (date2, includeYear) => {
187321
+ const options = {
187322
+ weekday: "long",
187323
+ month: "long",
187324
+ day: "numeric"
187325
+ };
187326
+ if (includeYear) {
187327
+ options.year = "numeric";
187328
+ }
187329
+ return date2.toLocaleDateString(navigator.language, options);
187330
+ };
187331
+ const createScheduleDisplayString = (schedule) => {
187332
+ let intervalString;
187333
+ if (schedule.interval === 1) {
187334
+ intervalString = `Every ${schedule.unit.slice(0, -1)}`;
187335
+ } else {
187336
+ intervalString = `Every ${schedule.interval} ${schedule.unit}`;
187337
+ }
187338
+ let displayString = intervalString;
187339
+ const now = /* @__PURE__ */ new Date();
187340
+ const currentYear = now.getFullYear();
187341
+ if (schedule.start_time_utc) {
187342
+ const startTime = new Date(schedule.start_time_utc);
187343
+ displayString += ` @ ${formatTime(startTime)}`;
187344
+ if (schedule.one_time) {
187345
+ const startYear = startTime.getFullYear();
187346
+ displayString += ` on ${formatDate(startTime, startYear !== currentYear)}`;
187347
+ }
187348
+ }
187349
+ if (schedule.end_time_utc) {
187350
+ const endTime = new Date(schedule.end_time_utc);
187351
+ if (schedule.start_time_utc) {
187352
+ displayString += ` to ${formatTime(endTime)}`;
187353
+ if (schedule.one_time) {
187354
+ const startTime = schedule.start_time_utc ? new Date(schedule.start_time_utc) : null;
187355
+ if (!startTime || startTime.toDateString() !== endTime.toDateString()) {
187356
+ const endYear = endTime.getFullYear();
187357
+ displayString += ` on ${formatDate(endTime, endYear !== currentYear)}`;
187358
+ }
187359
+ }
187360
+ } else {
187361
+ displayString += ` ending @ ${formatTime(endTime)}`;
187362
+ if (schedule.one_time) {
187363
+ const endYear = endTime.getFullYear();
187364
+ displayString += ` on ${formatDate(endTime, endYear !== currentYear)}`;
187365
+ }
187366
+ }
187367
+ }
187368
+ if (schedule.one_time && !schedule.start_time_utc && !schedule.end_time_utc) {
187369
+ displayString += " (One-time)";
187370
+ }
187371
+ return displayString;
187372
+ };
187373
+ const ListItemPaper = styled$1(Paper)(({ theme: theme2 }) => ({
187374
+ padding: theme2.spacing(2),
187375
+ marginBottom: theme2.spacing(2),
187376
+ display: "grid",
187377
+ gridTemplateAreas: `
187378
+ "prompt prompt actions"
187379
+ "info info info"
187380
+ "footer footer footer"
187381
+ `,
187382
+ gridTemplateColumns: "1fr auto auto",
187383
+ gap: theme2.spacing(1),
187384
+ backgroundImage: "none",
187385
+ border: `1px solid ${alpha$1(theme2.palette.divider, 0.1)}`,
187386
+ borderRadius: theme2.shape.borderRadius,
187387
+ transition: "border-color 0.2s ease",
187388
+ "&:hover": {
187389
+ borderColor: alpha$1(theme2.palette.divider, 0.4)
187390
+ }
187391
+ }));
187392
+ const PromptSection = styled$1(Box)({
187393
+ gridArea: "prompt",
187394
+ wordBreak: "break-word"
187395
+ });
187396
+ const InfoSection = styled$1(Box)(({ theme: theme2 }) => ({
187397
+ gridArea: "info",
187398
+ display: "flex",
187399
+ flexDirection: "column",
187400
+ gap: theme2.spacing(0.5)
187401
+ }));
187402
+ const ActionsSection = styled$1(Box)(({ theme: theme2 }) => ({
187403
+ gridArea: "actions",
187404
+ display: "flex",
187405
+ gap: theme2.spacing(1),
187406
+ alignSelf: "start"
187407
+ }));
187408
+ const FooterSection = styled$1(Box)({
187409
+ gridArea: "footer",
187410
+ display: "flex",
187411
+ justifyContent: "flex-end",
187412
+ alignItems: "center"
187413
+ });
187414
+ const useAgentName = (agentId) => {
187415
+ const baseUrl = apiConfig.baseUrl;
187416
+ return useQuery({
187417
+ queryKey: ["agent-name", agentId, baseUrl],
187418
+ queryFn: async () => {
187419
+ if (!baseUrl) {
187420
+ console.warn("Base URL for Local Operator API is not configured.");
187421
+ return "Agent ID";
187422
+ }
187423
+ const response = await AgentsApi.getAgent(baseUrl, agentId);
187424
+ return response.result?.name || "Unknown Agent";
187425
+ },
187426
+ enabled: !!agentId && !!baseUrl,
187427
+ staleTime: 1e3 * 60 * 5
187428
+ });
187429
+ };
187430
+ const ScheduleListItem = ({
187431
+ schedule,
187432
+ onEdit,
187433
+ onDelete
187434
+ }) => {
187435
+ const { data: agentName, isLoading: isLoadingAgentName } = useAgentName(
187436
+ schedule.agent_id
187437
+ );
187438
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(ListItemPaper, { elevation: 0, children: [
187439
+ /* @__PURE__ */ jsxRuntimeExports.jsx(PromptSection, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
187440
+ Typography,
187441
+ {
187442
+ variant: "body2",
187443
+ color: "text.secondary",
187444
+ fontSize: "0.875rem",
187445
+ sx: { mt: 0.5 },
187446
+ children: schedule.prompt
187447
+ }
187448
+ ) }),
187449
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(ActionsSection, { children: [
187450
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187451
+ IconButton,
187452
+ {
187453
+ onClick: () => onEdit(schedule),
187454
+ size: "small",
187455
+ title: "Edit Schedule",
187456
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(SquarePen, { size: 20 })
187457
+ }
187458
+ ),
187459
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187460
+ IconButton,
187461
+ {
187462
+ onClick: () => onDelete(schedule.id),
187463
+ size: "small",
187464
+ title: "Delete Schedule",
187465
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { size: 20 })
187466
+ }
187467
+ )
187468
+ ] }),
187469
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(InfoSection, { children: [
187470
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { display: "flex", alignItems: "center", minHeight: 28 }, children: isLoadingAgentName ? /* @__PURE__ */ jsxRuntimeExports.jsx(
187471
+ Skeleton,
187472
+ {
187473
+ width: 80,
187474
+ height: 28,
187475
+ variant: "rectangular",
187476
+ sx: { borderRadius: 1 }
187477
+ }
187478
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
187479
+ Chip,
187480
+ {
187481
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(User, { size: 12, style: { marginLeft: 2 } }),
187482
+ label: agentName || schedule.agent_id.substring(0, 8),
187483
+ variant: "outlined",
187484
+ color: "primary",
187485
+ size: "small",
187486
+ sx: {
187487
+ fontSize: "0.75rem",
187488
+ height: 24,
187489
+ maxWidth: 180,
187490
+ overflow: "hidden",
187491
+ textOverflow: "ellipsis",
187492
+ pl: 1,
187493
+ pr: 0.5
187494
+ },
187495
+ "aria-label": "Agent Name"
187496
+ }
187497
+ ) }),
187498
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "caption", color: "text.secondary", children: createScheduleDisplayString(schedule) }),
187499
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
187500
+ Typography,
187501
+ {
187502
+ variant: "caption",
187503
+ display: "block",
187504
+ color: schedule.is_active ? "success.main" : "error.main",
187505
+ children: [
187506
+ "Status: ",
187507
+ schedule.is_active ? "Active" : "Inactive"
187508
+ ]
187509
+ }
187510
+ )
187511
+ ] }),
187512
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FooterSection, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
187513
+ Typography,
187514
+ {
187515
+ variant: "caption",
187516
+ color: "text.secondary",
187517
+ fontSize: "0.75rem",
187518
+ sx: { opacity: 0.6 },
187519
+ children: [
187520
+ "ID: ",
187521
+ schedule.id
187522
+ ]
187523
+ }
187524
+ ) })
187525
+ ] });
187526
+ };
187527
+ const SchedulesContainer = styled$1(Paper)(({ theme: theme2 }) => ({
187528
+ padding: theme2.spacing(3),
187529
+ marginTop: theme2.spacing(2),
187530
+ backgroundImage: "none",
187531
+ border: `1px solid ${theme2.palette.divider}`,
187532
+ borderRadius: theme2.shape.borderRadius * 2
187533
+ }));
187534
+ const NoSchedulesMessage = styled$1(Typography)(({ theme: theme2 }) => ({
187535
+ textAlign: "center",
187536
+ color: theme2.palette.text.secondary,
187537
+ padding: theme2.spacing(4, 0)
187538
+ }));
187539
+ const SchedulesPage = () => {
187540
+ const theme2 = useTheme$1();
187541
+ const [isFormOpen, setIsFormOpen] = reactExports.useState(false);
187542
+ const [editingSchedule, setEditingSchedule] = reactExports.useState(null);
187543
+ const {
187544
+ data: schedulesResponse,
187545
+ isLoading,
187546
+ error,
187547
+ refetch: refetchSchedules
187548
+ } = useListAllSchedules();
187549
+ const createScheduleMutation = useCreateScheduleForAgent();
187550
+ const editScheduleMutation = useEditSchedule();
187551
+ const removeScheduleMutation = useRemoveSchedule();
187552
+ const handleOpenForm = (schedule) => {
187553
+ setEditingSchedule(schedule || null);
187554
+ setIsFormOpen(true);
187555
+ };
187556
+ const handleCloseForm = () => {
187557
+ setIsFormOpen(false);
187558
+ setEditingSchedule(null);
187559
+ };
187560
+ const handleSubmitForm = async (data2, agentId) => {
187561
+ try {
187562
+ if (editingSchedule) {
187563
+ await editScheduleMutation.mutateAsync({
187564
+ scheduleId: editingSchedule.id,
187565
+ scheduleData: data2
187566
+ });
187567
+ y$2.success("Schedule updated successfully!");
187568
+ } else {
187569
+ await createScheduleMutation.mutateAsync({
187570
+ agentId,
187571
+ // Use the agentId selected in the form
187572
+ scheduleData: data2
187573
+ });
187574
+ y$2.success("Schedule created successfully!");
187575
+ }
187576
+ refetchSchedules();
187577
+ } catch (err) {
187578
+ console.error("Failed to save schedule:", err);
187579
+ y$2.error(
187580
+ `Failed to save schedule: ${err instanceof Error ? err.message : "Unknown error"}`
187581
+ );
187582
+ }
187583
+ };
187584
+ const handleDeleteSchedule = async (scheduleId) => {
187585
+ const scheduleToDelete = schedulesResponse?.result?.schedules.find(
187586
+ (s2) => s2.id === scheduleId
187587
+ );
187588
+ try {
187589
+ await removeScheduleMutation.mutateAsync({
187590
+ scheduleId,
187591
+ agentId: scheduleToDelete?.agent_id
187592
+ });
187593
+ y$2.success("Schedule removed successfully!");
187594
+ refetchSchedules();
187595
+ } catch (err) {
187596
+ console.error("Failed to delete schedule:", err);
187597
+ y$2.error(
187598
+ `Failed to remove schedule: ${err instanceof Error ? err.message : "Unknown error"}`
187599
+ );
187600
+ }
187601
+ };
187602
+ const handleToggleActive = async (schedule) => {
187603
+ try {
187604
+ await editScheduleMutation.mutateAsync({
187605
+ scheduleId: schedule.id,
187606
+ scheduleData: { is_active: !schedule.is_active }
187607
+ });
187608
+ y$2.success(
187609
+ `Schedule ${schedule.is_active ? "deactivated" : "activated"} successfully!`
187610
+ );
187611
+ refetchSchedules();
187612
+ } catch (err) {
187613
+ console.error("Failed to toggle schedule active state:", err);
187614
+ y$2.error(
187615
+ `Failed to toggle schedule: ${err instanceof Error ? err.message : "Unknown error"}`
187616
+ );
187617
+ }
187618
+ };
187619
+ const schedules = schedulesResponse?.result?.schedules || [];
187620
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
187621
+ Box,
187622
+ {
187623
+ sx: { p: 3, height: "100%", display: "flex", flexDirection: "column" },
187624
+ children: [
187625
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187626
+ PageHeader,
187627
+ {
187628
+ title: "Schedules",
187629
+ icon: CalendarDays,
187630
+ subtitle: "View and manage scheduled tasks for your AI team.",
187631
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
187632
+ Button,
187633
+ {
187634
+ variant: "outlined",
187635
+ color: "primary",
187636
+ startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(CirclePlus, { size: 18 }),
187637
+ onClick: () => handleOpenForm(),
187638
+ sx: {
187639
+ textTransform: "none",
187640
+ fontSize: "0.8125rem",
187641
+ padding: theme2.spacing(0.75, 1.75),
187642
+ borderRadius: theme2.shape.borderRadius * 0.75,
187643
+ fontWeight: 500,
187644
+ "&:hover": {
187645
+ backgroundColor: theme2.palette.primary.dark
187646
+ }
187647
+ },
187648
+ children: "Create Schedule"
187649
+ }
187650
+ )
187651
+ }
187652
+ ),
187653
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SchedulesContainer, { elevation: 0, sx: { flexGrow: 1, overflowY: "auto" }, children: [
187654
+ isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress, { sx: { display: "block", margin: "auto", mt: 4 } }),
187655
+ error && /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { severity: "error", sx: { mt: 2 }, children: [
187656
+ "Error fetching schedules: ",
187657
+ error.message
187658
+ ] }),
187659
+ !isLoading && !error && schedules.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(NoSchedulesMessage, { children: "No schedules found. Simply ask an agent to do a daily/weekly task for you, or to handle something in the future and that task will appear here." }),
187660
+ !isLoading && !error && schedules.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2 }, children: schedules.map((schedule) => /* @__PURE__ */ jsxRuntimeExports.jsx(
187661
+ ScheduleListItem,
187662
+ {
187663
+ schedule,
187664
+ onEdit: () => handleOpenForm(schedule),
187665
+ onDelete: handleDeleteSchedule,
187666
+ onToggleActive: handleToggleActive
187667
+ },
187668
+ schedule.id
187669
+ )) })
187670
+ ] }),
187671
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
187672
+ ScheduleFormDialog,
187673
+ {
187674
+ open: isFormOpen,
187675
+ onClose: handleCloseForm,
187676
+ onSubmit: handleSubmitForm,
187677
+ initialData: editingSchedule
187678
+ }
187679
+ )
187680
+ ]
187681
+ }
187682
+ );
187683
+ };
186406
187684
  const SectionTitle = ({
186407
187685
  title,
186408
187686
  icon,
@@ -212619,6 +213897,12 @@ const SidebarNavigation = () => {
212619
213897
  path: "/agent-hub",
212620
213898
  isActive: currentView === "agent-hub"
212621
213899
  },
213900
+ {
213901
+ icon: CalendarDays,
213902
+ label: "Schedules",
213903
+ path: "/schedules",
213904
+ isActive: currentView === "schedules"
213905
+ },
212622
213906
  {
212623
213907
  icon: Settings$1,
212624
213908
  label: "Settings",
@@ -212732,6 +214016,7 @@ const App = () => {
212732
214016
  /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/settings", element: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsPage, {}) }),
212733
214017
  /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent-hub", element: /* @__PURE__ */ jsxRuntimeExports.jsx(AgentHubPage, {}) }),
212734
214018
  /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent-hub/:agentId", element: /* @__PURE__ */ jsxRuntimeExports.jsx(AgentDetailsPage, {}) }),
214019
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/schedules", element: /* @__PURE__ */ jsxRuntimeExports.jsx(SchedulesPage, {}) }),
212735
214020
  /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "*", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Navigate, { to: "/chat", replace: true }) })
212736
214021
  ] }) })
212737
214022
  ] });