@burtson-labs/bandit-engine 2.1.3 → 2.1.4

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.
package/dist/index.js CHANGED
@@ -40340,18 +40340,18 @@ var SchedulesTab_exports = {};
40340
40340
  __export(SchedulesTab_exports, {
40341
40341
  default: () => SchedulesTab_default
40342
40342
  });
40343
- var import_react91, import_material62, import_jsx_runtime64, PRESETS2, WEEKDAYS3, emptyForm2, fromSchedule, errorText, statusLabel, statusColor, SchedulesTab, SchedulesTab_default;
40343
+ var import_react92, import_material63, import_jsx_runtime65, PRESETS2, WEEKDAYS3, emptyForm2, fromSchedule, errorText, statusLabel2, statusColor, SchedulesTab, SchedulesTab_default;
40344
40344
  var init_SchedulesTab = __esm({
40345
40345
  "src/management/components/SchedulesTab.tsx"() {
40346
40346
  "use strict";
40347
- import_react91 = require("react");
40348
- import_material62 = require("@mui/material");
40347
+ import_react92 = require("react");
40348
+ import_material63 = require("@mui/material");
40349
40349
  init_icons();
40350
40350
  init_parts();
40351
40351
  init_StreamingMarkdown();
40352
40352
  init_schedulesService();
40353
40353
  init_scheduleArgs();
40354
- import_jsx_runtime64 = require("react/jsx-runtime");
40354
+ import_jsx_runtime65 = require("react/jsx-runtime");
40355
40355
  PRESETS2 = [
40356
40356
  { value: "daily", label: "Every day" },
40357
40357
  { value: "weekdays", label: "Weekdays" },
@@ -40382,29 +40382,29 @@ var init_SchedulesTab = __esm({
40382
40382
  deliverEmail: s.deliverEmail
40383
40383
  });
40384
40384
  errorText = (e, fallback) => e instanceof Error && e.message ? e.message : fallback;
40385
- statusLabel = (run) => run.status === "succeeded" ? "Done" : run.status === "failed" ? "Failed" : run.status === "skipped" ? "Skipped" : "Running";
40385
+ statusLabel2 = (run) => run.status === "succeeded" ? "Done" : run.status === "failed" ? "Failed" : run.status === "skipped" ? "Skipped" : "Running";
40386
40386
  statusColor = (status) => status === "succeeded" ? "success" : status === "failed" ? "error" : status === "skipped" ? "warning" : "default";
40387
40387
  SchedulesTab = ({ showSnackbar, chatPath = "/chat" }) => {
40388
- const [schedules, setSchedules] = (0, import_react91.useState)([]);
40389
- const [limits, setLimits] = (0, import_react91.useState)(null);
40390
- const [runs, setRuns] = (0, import_react91.useState)([]);
40391
- const [loading, setLoading] = (0, import_react91.useState)(true);
40392
- const [loadError, setLoadError] = (0, import_react91.useState)(null);
40393
- const [busy, setBusy] = (0, import_react91.useState)({});
40394
- const [form, setForm] = (0, import_react91.useState)(null);
40395
- const [editingId, setEditingId] = (0, import_react91.useState)(null);
40396
- const [formError, setFormError] = (0, import_react91.useState)(null);
40397
- const [saving, setSaving] = (0, import_react91.useState)(false);
40398
- const [preview, setPreview] = (0, import_react91.useState)(null);
40399
- const [previewError, setPreviewError] = (0, import_react91.useState)(null);
40400
- const [openRun, setOpenRun] = (0, import_react91.useState)(null);
40401
- const pollTimer = (0, import_react91.useRef)(null);
40402
- const formRef = (0, import_react91.useRef)(null);
40403
- const notify = (0, import_react91.useCallback)(
40388
+ const [schedules, setSchedules] = (0, import_react92.useState)([]);
40389
+ const [limits, setLimits] = (0, import_react92.useState)(null);
40390
+ const [runs, setRuns] = (0, import_react92.useState)([]);
40391
+ const [loading, setLoading] = (0, import_react92.useState)(true);
40392
+ const [loadError, setLoadError] = (0, import_react92.useState)(null);
40393
+ const [busy, setBusy] = (0, import_react92.useState)({});
40394
+ const [form, setForm] = (0, import_react92.useState)(null);
40395
+ const [editingId, setEditingId] = (0, import_react92.useState)(null);
40396
+ const [formError, setFormError] = (0, import_react92.useState)(null);
40397
+ const [saving, setSaving] = (0, import_react92.useState)(false);
40398
+ const [preview, setPreview] = (0, import_react92.useState)(null);
40399
+ const [previewError, setPreviewError] = (0, import_react92.useState)(null);
40400
+ const [openRun, setOpenRun] = (0, import_react92.useState)(null);
40401
+ const pollTimer = (0, import_react92.useRef)(null);
40402
+ const formRef = (0, import_react92.useRef)(null);
40403
+ const notify = (0, import_react92.useCallback)(
40404
40404
  (message, severity = "success") => showSnackbar?.(message, severity),
40405
40405
  [showSnackbar]
40406
40406
  );
40407
- const refresh2 = (0, import_react91.useCallback)(async (quiet = false) => {
40407
+ const refresh2 = (0, import_react92.useCallback)(async (quiet = false) => {
40408
40408
  if (!quiet) setLoading(true);
40409
40409
  try {
40410
40410
  const [list3, recent] = await Promise.all([listSchedules(), listRecentScheduleRuns(20)]);
@@ -40418,13 +40418,13 @@ var init_SchedulesTab = __esm({
40418
40418
  setLoading(false);
40419
40419
  }
40420
40420
  }, []);
40421
- (0, import_react91.useEffect)(() => {
40421
+ (0, import_react92.useEffect)(() => {
40422
40422
  void refresh2();
40423
40423
  return () => {
40424
40424
  if (pollTimer.current) clearTimeout(pollTimer.current);
40425
40425
  };
40426
40426
  }, [refresh2]);
40427
- (0, import_react91.useEffect)(() => {
40427
+ (0, import_react92.useEffect)(() => {
40428
40428
  try {
40429
40429
  const id = new URLSearchParams(window.location.search).get("run");
40430
40430
  if (!id) return;
@@ -40435,11 +40435,11 @@ var init_SchedulesTab = __esm({
40435
40435
  } catch {
40436
40436
  }
40437
40437
  }, []);
40438
- const anyRunning = (0, import_react91.useMemo)(
40438
+ const anyRunning = (0, import_react92.useMemo)(
40439
40439
  () => schedules.some((s) => s.runRequested) || runs.some((r) => r.status === "running"),
40440
40440
  [schedules, runs]
40441
40441
  );
40442
- (0, import_react91.useEffect)(() => {
40442
+ (0, import_react92.useEffect)(() => {
40443
40443
  if (!anyRunning) return;
40444
40444
  pollTimer.current = setTimeout(() => void refresh2(true), 5e3);
40445
40445
  return () => {
@@ -40448,7 +40448,7 @@ var init_SchedulesTab = __esm({
40448
40448
  }, [anyRunning, schedules, runs, refresh2]);
40449
40449
  const timing = form ? { preset: form.preset, time: form.time, weekday: form.weekday, cron: form.cron, timeZone: form.timeZone } : null;
40450
40450
  const timingKey = timing ? JSON.stringify(timing) : "";
40451
- (0, import_react91.useEffect)(() => {
40451
+ (0, import_react92.useEffect)(() => {
40452
40452
  if (!timing) return;
40453
40453
  if (timing.preset === "custom" ? !timing.cron : !timing.time) return;
40454
40454
  let cancelled = false;
@@ -40563,28 +40563,28 @@ var init_SchedulesTab = __esm({
40563
40563
  const atCap = limits ? limits.active >= limits.max : false;
40564
40564
  const fieldSx = { "& .MuiOutlinedInput-root": { borderRadius: 2 } };
40565
40565
  const formValid = !!form && form.name.trim().length > 0 && form.prompt.trim().length > 0 && (form.preset === "custom" ? Boolean(form.cron?.trim()) : Boolean(form.time)) && (form.preset !== "weekly" || Boolean(form.weekday)) && !previewError;
40566
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Stack, { spacing: 3, children: [
40567
- loadError && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40568
- import_material62.Alert,
40566
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Stack, { spacing: 3, children: [
40567
+ loadError && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40568
+ import_material63.Alert,
40569
40569
  {
40570
40570
  severity: "error",
40571
- action: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Button, { color: "inherit", size: "small", onClick: () => void refresh2(), children: "Retry" }),
40571
+ action: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Button, { color: "inherit", size: "small", onClick: () => void refresh2(), children: "Retry" }),
40572
40572
  children: loadError
40573
40573
  }
40574
40574
  ),
40575
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, flexWrap: "wrap" }, children: [
40576
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { children: [
40577
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "subtitle1", sx: { fontWeight: 600 }, children: "Your schedules" }),
40578
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "body2", color: "text.secondary", children: limits ? `${limits.active} of ${limits.max} active on the ${limits.plan.replace("_", " ")} plan \xB7 at most one run per ${limits.minIntervalMinutes >= 60 ? `${Math.round(limits.minIntervalMinutes / 60)} hour${limits.minIntervalMinutes >= 120 ? "s" : ""}` : `${limits.minIntervalMinutes} minutes`}` : "Prompts Bandit runs for you, with results in chat and by email." })
40575
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, flexWrap: "wrap" }, children: [
40576
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { children: [
40577
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Typography, { variant: "subtitle1", sx: { fontWeight: 600 }, children: "Your schedules" }),
40578
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Typography, { variant: "body2", color: "text.secondary", children: limits ? `${limits.active} of ${limits.max} active on the ${limits.plan.replace("_", " ")} plan \xB7 at most one run per ${limits.minIntervalMinutes >= 60 ? `${Math.round(limits.minIntervalMinutes / 60)} hour${limits.minIntervalMinutes >= 120 ? "s" : ""}` : `${limits.minIntervalMinutes} minutes`}` : "Prompts Bandit runs for you, with results in chat and by email." })
40579
40579
  ] }),
40580
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Stack, { direction: "row", spacing: 1, children: [
40581
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Tooltip, { title: "Refresh", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.IconButton, { "aria-label": "Refresh schedules", onClick: () => void refresh2(), size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Refresh2, { fontSize: "small" }) }) }),
40582
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40583
- import_material62.Button,
40580
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Stack, { direction: "row", spacing: 1, children: [
40581
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Tooltip, { title: "Refresh", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.IconButton, { "aria-label": "Refresh schedules", onClick: () => void refresh2(), size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Refresh2, { fontSize: "small" }) }) }),
40582
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40583
+ import_material63.Button,
40584
40584
  {
40585
40585
  variant: "contained",
40586
40586
  size: "small",
40587
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Plus2, {}),
40587
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Plus2, {}),
40588
40588
  onClick: openNew,
40589
40589
  disabled: loading || !!loadError || atCap && !editingId,
40590
40590
  sx: { textTransform: "none", borderRadius: 999 },
@@ -40593,13 +40593,13 @@ var init_SchedulesTab = __esm({
40593
40593
  )
40594
40594
  ] })
40595
40595
  ] }),
40596
- atCap && limits && !form && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Alert, { severity: "info", children: limits.max === 0 ? "Scheduled tasks are not included in your plan." : `Your plan allows ${limits.max} active schedule${limits.max === 1 ? "" : "s"}. Pause or delete one to add another.` }),
40597
- limits && !limits.emailAvailable && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Alert, { severity: "warning", children: "Email delivery is not available for this account right now; results still appear in your chat history." }),
40598
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { ref: formRef, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Collapse, { in: !!form, unmountOnExit: true, children: form && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Paper, { variant: "outlined", sx: { p: 2, borderRadius: 3 }, "data-testid": "schedule-form", children: [
40599
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "subtitle2", sx: { mb: 1.5 }, children: editingId ? "Edit schedule" : "New schedule" }),
40600
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Stack, { spacing: 1.5, children: [
40601
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40602
- import_material62.TextField,
40596
+ atCap && limits && !form && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Alert, { severity: "info", children: limits.max === 0 ? "Scheduled tasks are not included in your plan." : `Your plan allows ${limits.max} active schedule${limits.max === 1 ? "" : "s"}. Pause or delete one to add another.` }),
40597
+ limits && !limits.emailAvailable && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Alert, { severity: "warning", children: "Email delivery is not available for this account right now; results still appear in your chat history." }),
40598
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { ref: formRef, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Collapse, { in: !!form, unmountOnExit: true, children: form && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Paper, { variant: "outlined", sx: { p: 2, borderRadius: 3 }, "data-testid": "schedule-form", children: [
40599
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Typography, { variant: "subtitle2", sx: { mb: 1.5 }, children: editingId ? "Edit schedule" : "New schedule" }),
40600
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Stack, { spacing: 1.5, children: [
40601
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40602
+ import_material63.TextField,
40603
40603
  {
40604
40604
  label: "Name",
40605
40605
  size: "small",
@@ -40609,8 +40609,8 @@ var init_SchedulesTab = __esm({
40609
40609
  sx: fieldSx
40610
40610
  }
40611
40611
  ),
40612
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40613
- import_material62.TextField,
40612
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40613
+ import_material63.TextField,
40614
40614
  {
40615
40615
  label: "What Bandit should do",
40616
40616
  size: "small",
@@ -40624,9 +40624,9 @@ var init_SchedulesTab = __esm({
40624
40624
  sx: fieldSx
40625
40625
  }
40626
40626
  ),
40627
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { display: "grid", gap: 1.5, gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr 1fr 1fr" } }, children: [
40628
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40629
- import_material62.TextField,
40627
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { sx: { display: "grid", gap: 1.5, gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr 1fr 1fr" } }, children: [
40628
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40629
+ import_material63.TextField,
40630
40630
  {
40631
40631
  select: true,
40632
40632
  label: "Repeat",
@@ -40634,11 +40634,11 @@ var init_SchedulesTab = __esm({
40634
40634
  value: form.preset,
40635
40635
  onChange: (e) => setForm({ ...form, preset: e.target.value }),
40636
40636
  sx: fieldSx,
40637
- children: PRESETS2.map((p) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.MenuItem, { value: p.value, children: p.label }, p.value))
40637
+ children: PRESETS2.map((p) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.MenuItem, { value: p.value, children: p.label }, p.value))
40638
40638
  }
40639
40639
  ),
40640
- form.preset === "weekly" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40641
- import_material62.TextField,
40640
+ form.preset === "weekly" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40641
+ import_material63.TextField,
40642
40642
  {
40643
40643
  select: true,
40644
40644
  label: "Day",
@@ -40646,11 +40646,11 @@ var init_SchedulesTab = __esm({
40646
40646
  value: form.weekday ?? "",
40647
40647
  onChange: (e) => setForm({ ...form, weekday: e.target.value }),
40648
40648
  sx: fieldSx,
40649
- children: WEEKDAYS3.map((d) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.MenuItem, { value: d, children: d.charAt(0).toUpperCase() + d.slice(1) }, d))
40649
+ children: WEEKDAYS3.map((d) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.MenuItem, { value: d, children: d.charAt(0).toUpperCase() + d.slice(1) }, d))
40650
40650
  }
40651
40651
  ),
40652
- form.preset === "custom" ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40653
- import_material62.TextField,
40652
+ form.preset === "custom" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40653
+ import_material63.TextField,
40654
40654
  {
40655
40655
  label: "Cron",
40656
40656
  size: "small",
@@ -40660,8 +40660,8 @@ var init_SchedulesTab = __esm({
40660
40660
  inputProps: { "aria-label": "Cron expression" },
40661
40661
  sx: fieldSx
40662
40662
  }
40663
- ) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40664
- import_material62.TextField,
40663
+ ) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40664
+ import_material63.TextField,
40665
40665
  {
40666
40666
  label: "Time",
40667
40667
  type: "time",
@@ -40673,8 +40673,8 @@ var init_SchedulesTab = __esm({
40673
40673
  sx: fieldSx
40674
40674
  }
40675
40675
  ),
40676
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40677
- import_material62.TextField,
40676
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40677
+ import_material63.TextField,
40678
40678
  {
40679
40679
  label: "Time zone",
40680
40680
  size: "small",
@@ -40684,8 +40684,8 @@ var init_SchedulesTab = __esm({
40684
40684
  sx: fieldSx
40685
40685
  }
40686
40686
  ),
40687
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40688
- import_material62.TextField,
40687
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40688
+ import_material63.TextField,
40689
40689
  {
40690
40690
  select: true,
40691
40691
  label: "Model",
@@ -40693,30 +40693,30 @@ var init_SchedulesTab = __esm({
40693
40693
  value: form.model ?? limits?.defaultModel ?? "",
40694
40694
  onChange: (e) => setForm({ ...form, model: e.target.value }),
40695
40695
  sx: fieldSx,
40696
- children: (limits?.models ?? [form.model ?? ""]).map((m) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.MenuItem, { value: m, children: m }, m))
40696
+ children: (limits?.models ?? [form.model ?? ""]).map((m) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.MenuItem, { value: m, children: m }, m))
40697
40697
  }
40698
40698
  )
40699
40699
  ] }),
40700
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: [
40701
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40702
- import_material62.FormControlLabel,
40700
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: [
40701
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40702
+ import_material63.FormControlLabel,
40703
40703
  {
40704
- control: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40705
- import_material62.Switch,
40704
+ control: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40705
+ import_material63.Switch,
40706
40706
  {
40707
40707
  size: "small",
40708
40708
  checked: form.webSearch !== false,
40709
40709
  onChange: (e) => setForm({ ...form, webSearch: e.target.checked })
40710
40710
  }
40711
40711
  ),
40712
- label: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "body2", children: "Search the web" })
40712
+ label: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Typography, { variant: "body2", children: "Search the web" })
40713
40713
  }
40714
40714
  ),
40715
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40716
- import_material62.FormControlLabel,
40715
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40716
+ import_material63.FormControlLabel,
40717
40717
  {
40718
- control: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40719
- import_material62.Switch,
40718
+ control: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40719
+ import_material63.Switch,
40720
40720
  {
40721
40721
  size: "small",
40722
40722
  checked: form.deliverEmail !== false,
@@ -40724,25 +40724,25 @@ var init_SchedulesTab = __esm({
40724
40724
  onChange: (e) => setForm({ ...form, deliverEmail: e.target.checked })
40725
40725
  }
40726
40726
  ),
40727
- label: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Typography, { variant: "body2", children: [
40727
+ label: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Typography, { variant: "body2", children: [
40728
40728
  "Email me the result",
40729
40729
  limits?.email ? ` (${limits.email})` : ""
40730
40730
  ] })
40731
40731
  }
40732
40732
  )
40733
40733
  ] }),
40734
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "body2", color: previewError ? "error" : "text.secondary", role: "status", children: previewError ?? preview ?? describeSchedule(form) }),
40735
- formError && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Alert, { severity: "error", children: formError }),
40736
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Stack, { direction: "row", spacing: 1, justifyContent: "flex-end", children: [
40737
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Button, { onClick: closeForm, color: "inherit", size: "small", disabled: saving, sx: { textTransform: "none" }, children: "Cancel" }),
40738
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40739
- import_material62.Button,
40734
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Typography, { variant: "body2", color: previewError ? "error" : "text.secondary", role: "status", children: previewError ?? preview ?? describeSchedule(form) }),
40735
+ formError && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Alert, { severity: "error", children: formError }),
40736
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Stack, { direction: "row", spacing: 1, justifyContent: "flex-end", children: [
40737
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Button, { onClick: closeForm, color: "inherit", size: "small", disabled: saving, sx: { textTransform: "none" }, children: "Cancel" }),
40738
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40739
+ import_material63.Button,
40740
40740
  {
40741
40741
  onClick: () => void submitForm(),
40742
40742
  variant: "contained",
40743
40743
  size: "small",
40744
40744
  disabled: !formValid || saving,
40745
- startIcon: saving ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.CircularProgress, { size: 14, color: "inherit" }) : void 0,
40745
+ startIcon: saving ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.CircularProgress, { size: 14, color: "inherit" }) : void 0,
40746
40746
  sx: { textTransform: "none", borderRadius: 999 },
40747
40747
  children: editingId ? "Save changes" : "Create schedule"
40748
40748
  }
@@ -40750,24 +40750,24 @@ var init_SchedulesTab = __esm({
40750
40750
  ] })
40751
40751
  ] })
40752
40752
  ] }) }) }),
40753
- loading ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Stack, { spacing: 1, children: [
40754
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Skeleton, { variant: "rounded", height: 72 }),
40755
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Skeleton, { variant: "rounded", height: 72 })
40756
- ] }) : schedules.length === 0 ? !loadError && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40753
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Stack, { spacing: 1, children: [
40754
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Skeleton, { variant: "rounded", height: 72 }),
40755
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Skeleton, { variant: "rounded", height: 72 })
40756
+ ] }) : schedules.length === 0 ? !loadError && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40757
40757
  ManagementEmptyState,
40758
40758
  {
40759
40759
  title: "No schedules yet",
40760
40760
  description: 'Ask Bandit in chat ("every weekday at 8, summarise AI news and email me") or create one here.',
40761
- action: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Button, { variant: "outlined", size: "small", onClick: openNew, disabled: atCap, sx: { textTransform: "none" }, children: "New schedule" })
40761
+ action: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Button, { variant: "outlined", size: "small", onClick: openNew, disabled: atCap, sx: { textTransform: "none" }, children: "New schedule" })
40762
40762
  }
40763
- ) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Stack, { spacing: 1, "data-testid": "schedule-list", children: schedules.map((s) => {
40763
+ ) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Stack, { spacing: 1, "data-testid": "schedule-list", children: schedules.map((s) => {
40764
40764
  const isBusy = Boolean(busy[s.id]);
40765
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Paper, { variant: "outlined", sx: { p: 1.75, borderRadius: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { display: "flex", gap: 1.5, alignItems: "flex-start", flexWrap: "wrap" }, children: [
40766
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { flex: 1, minWidth: 220 }, children: [
40767
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
40768
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "subtitle2", sx: { fontWeight: 600 }, children: s.name }),
40769
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40770
- import_material62.Chip,
40765
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Paper, { variant: "outlined", sx: { p: 1.75, borderRadius: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { sx: { display: "flex", gap: 1.5, alignItems: "flex-start", flexWrap: "wrap" }, children: [
40766
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { sx: { flex: 1, minWidth: 220 }, children: [
40767
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
40768
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Typography, { variant: "subtitle2", sx: { fontWeight: 600 }, children: s.name }),
40769
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40770
+ import_material63.Chip,
40771
40771
  {
40772
40772
  size: "small",
40773
40773
  label: s.status === "active" ? "Active" : s.pausedReason === "failures" ? "Paused after failures" : "Paused",
@@ -40776,17 +40776,17 @@ var init_SchedulesTab = __esm({
40776
40776
  sx: { height: 20, fontSize: "0.7rem" }
40777
40777
  }
40778
40778
  ),
40779
- s.runRequested && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Chip, { size: "small", label: "Running\u2026", sx: { height: 20, fontSize: "0.7rem" } }),
40780
- s.webSearch && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Chip, { size: "small", label: "Web search", variant: "outlined", sx: { height: 20, fontSize: "0.7rem" } }),
40781
- s.deliverEmail && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Chip, { size: "small", label: "Email", variant: "outlined", sx: { height: 20, fontSize: "0.7rem" } })
40779
+ s.runRequested && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Chip, { size: "small", label: "Running\u2026", sx: { height: 20, fontSize: "0.7rem" } }),
40780
+ s.webSearch && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Chip, { size: "small", label: "Web search", variant: "outlined", sx: { height: 20, fontSize: "0.7rem" } }),
40781
+ s.deliverEmail && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Chip, { size: "small", label: "Email", variant: "outlined", sx: { height: 20, fontSize: "0.7rem" } })
40782
40782
  ] }),
40783
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Typography, { variant: "body2", color: "text.secondary", sx: { mt: 0.25 }, children: [
40783
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Typography, { variant: "body2", color: "text.secondary", sx: { mt: 0.25 }, children: [
40784
40784
  s.description,
40785
40785
  s.status === "active" && s.nextRunAt ? ` \xB7 next ${formatInZone(s.nextRunAt, s.timeZone)}` : "",
40786
- s.lastRunAt ? ` \xB7 last run ${statusLabel({ status: s.lastRunStatus ?? "succeeded" }).toLowerCase()} ${formatInZone(s.lastRunAt, s.timeZone)}` : ""
40786
+ s.lastRunAt ? ` \xB7 last run ${statusLabel2({ status: s.lastRunStatus ?? "succeeded" }).toLowerCase()} ${formatInZone(s.lastRunAt, s.timeZone)}` : ""
40787
40787
  ] }),
40788
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
40789
- import_material62.Typography,
40788
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
40789
+ import_material63.Typography,
40790
40790
  {
40791
40791
  variant: "body2",
40792
40792
  sx: {
@@ -40801,39 +40801,39 @@ var init_SchedulesTab = __esm({
40801
40801
  children: s.prompt
40802
40802
  }
40803
40803
  ),
40804
- s.lastError && s.lastRunStatus !== "succeeded" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "caption", color: "error", children: s.lastError })
40804
+ s.lastError && s.lastRunStatus !== "succeeded" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Typography, { variant: "caption", color: "error", children: s.lastError })
40805
40805
  ] }),
40806
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Stack, { direction: "row", spacing: 0.5, alignItems: "center", children: [
40807
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Button, { size: "small", onClick: () => void runNow(s), disabled: isBusy || s.runRequested, sx: { textTransform: "none" }, children: "Run now" }),
40808
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Button, { size: "small", onClick: () => void togglePause(s), disabled: isBusy, sx: { textTransform: "none" }, children: s.status === "active" ? "Pause" : "Resume" }),
40809
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Tooltip, { title: "Edit", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.IconButton, { size: "small", "aria-label": `Edit ${s.name}`, onClick: () => openEdit(s), disabled: isBusy, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Edit2, { fontSize: "small" }) }) }),
40810
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Tooltip, { title: "Delete", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.IconButton, { size: "small", "aria-label": `Delete ${s.name}`, onClick: () => void remove(s), disabled: isBusy, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Trash2, { fontSize: "small" }) }) })
40806
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Stack, { direction: "row", spacing: 0.5, alignItems: "center", children: [
40807
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Button, { size: "small", onClick: () => void runNow(s), disabled: isBusy || s.runRequested, sx: { textTransform: "none" }, children: "Run now" }),
40808
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Button, { size: "small", onClick: () => void togglePause(s), disabled: isBusy, sx: { textTransform: "none" }, children: s.status === "active" ? "Pause" : "Resume" }),
40809
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Tooltip, { title: "Edit", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.IconButton, { size: "small", "aria-label": `Edit ${s.name}`, onClick: () => openEdit(s), disabled: isBusy, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Edit2, { fontSize: "small" }) }) }),
40810
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Tooltip, { title: "Delete", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.IconButton, { size: "small", "aria-label": `Delete ${s.name}`, onClick: () => void remove(s), disabled: isBusy, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Trash2, { fontSize: "small" }) }) })
40811
40811
  ] })
40812
40812
  ] }) }, s.id);
40813
40813
  }) }),
40814
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { children: [
40815
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "subtitle1", sx: { fontWeight: 600, mb: 1 }, children: "Recent results" }),
40816
- runs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "body2", color: "text.secondary", children: "Results appear here after the first run, and in your chat history." }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Stack, { spacing: 1, "data-testid": "schedule-runs", children: runs.map((run) => {
40814
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { children: [
40815
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Typography, { variant: "subtitle1", sx: { fontWeight: 600, mb: 1 }, children: "Recent results" }),
40816
+ runs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Typography, { variant: "body2", color: "text.secondary", children: "Results appear here after the first run, and in your chat history." }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Stack, { spacing: 1, "data-testid": "schedule-runs", children: runs.map((run) => {
40817
40817
  const schedule = schedules.find((s) => s.id === run.scheduleId);
40818
40818
  const zone = schedule?.timeZone ?? browserTimeZone();
40819
40819
  const expanded = openRun === run.id;
40820
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Paper, { variant: "outlined", sx: { p: 1.5, borderRadius: 3 }, children: [
40821
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
40822
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Chip, { size: "small", label: statusLabel(run), color: statusColor(run.status), variant: "outlined", sx: { height: 20, fontSize: "0.7rem" } }),
40823
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "body2", sx: { fontWeight: 600 }, children: run.scheduleName }),
40824
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Typography, { variant: "body2", color: "text.secondary", children: [
40820
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Paper, { variant: "outlined", sx: { p: 1.5, borderRadius: 3 }, children: [
40821
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
40822
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Chip, { size: "small", label: statusLabel2(run), color: statusColor(run.status), variant: "outlined", sx: { height: 20, fontSize: "0.7rem" } }),
40823
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Typography, { variant: "body2", sx: { fontWeight: 600 }, children: run.scheduleName }),
40824
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Typography, { variant: "body2", color: "text.secondary", children: [
40825
40825
  formatInZone(run.startedAt, zone),
40826
40826
  run.trigger === "manual" ? " \xB7 run now" : "",
40827
40827
  run.searches.length ? ` \xB7 ${run.searches.length} search${run.searches.length === 1 ? "" : "es"}` : "",
40828
40828
  run.emailSent ? " \xB7 emailed" : ""
40829
40829
  ] }),
40830
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Box, { sx: { flex: 1 } }),
40831
- run.conversationId && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Link, { href: `${chatPath}?conversation=${encodeURIComponent(run.conversationId)}`, variant: "body2", underline: "hover", children: "Open in chat" }),
40832
- (run.result || run.error) && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Button, { size: "small", onClick: () => setOpenRun(expanded ? null : run.id), sx: { textTransform: "none" }, children: expanded ? "Hide" : "Show" })
40830
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Box, { sx: { flex: 1 } }),
40831
+ run.conversationId && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Link, { href: `${chatPath}?conversation=${encodeURIComponent(run.conversationId)}`, variant: "body2", underline: "hover", children: "Open in chat" }),
40832
+ (run.result || run.error) && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Button, { size: "small", onClick: () => setOpenRun(expanded ? null : run.id), sx: { textTransform: "none" }, children: expanded ? "Hide" : "Show" })
40833
40833
  ] }),
40834
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Collapse, { in: expanded, unmountOnExit: true, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { mt: 1.5, pt: 1.5, borderTop: 1, borderColor: "divider" }, children: [
40835
- run.error && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Alert, { severity: run.status === "skipped" ? "warning" : "error", sx: { mb: run.result ? 1.5 : 0 }, children: run.error }),
40836
- run.result && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(StreamingMarkdown_default, { content: run.result })
40834
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Collapse, { in: expanded, unmountOnExit: true, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { sx: { mt: 1.5, pt: 1.5, borderTop: 1, borderColor: "divider" }, children: [
40835
+ run.error && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.Alert, { severity: run.status === "skipped" ? "warning" : "error", sx: { mb: run.result ? 1.5 : 0 }, children: run.error }),
40836
+ run.result && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(StreamingMarkdown_default, { content: run.result })
40837
40837
  ] }) })
40838
40838
  ] }, run.id);
40839
40839
  }) })
@@ -41378,11 +41378,11 @@ var chat_provider_default = ChatProvider;
41378
41378
  init_chat2();
41379
41379
 
41380
41380
  // src/management/management.tsx
41381
- var import_react92 = require("react");
41381
+ var import_react93 = require("react");
41382
41382
  var import_useMediaQuery2 = __toESM(require("@mui/material/useMediaQuery"));
41383
41383
  init_useKnowledgeStore();
41384
41384
  init_indexedDBService();
41385
- var import_material63 = require("@mui/material");
41385
+ var import_material64 = require("@mui/material");
41386
41386
  var import_react_router_dom7 = require("react-router-dom");
41387
41387
 
41388
41388
  // src/modals/chat-modal/chat-modal.tsx
@@ -54014,8 +54014,8 @@ var ProviderTab = () => {
54014
54014
  };
54015
54015
 
54016
54016
  // src/management/components/MCPToolsTabV2.tsx
54017
- var import_react88 = require("react");
54018
- var import_material59 = require("@mui/material");
54017
+ var import_react89 = require("react");
54018
+ var import_material60 = require("@mui/material");
54019
54019
 
54020
54020
  // src/services/mcp/mcpControllerService.ts
54021
54021
  init_packageSettingsStore();
@@ -54689,12 +54689,221 @@ var McpServersSection = () => {
54689
54689
  };
54690
54690
  var McpServersSection_default = McpServersSection;
54691
54691
 
54692
+ // src/management/components/CrewSection.tsx
54693
+ var import_react88 = require("react");
54694
+ var import_material59 = require("@mui/material");
54695
+ init_icons();
54696
+
54697
+ // src/services/crew/crewService.ts
54698
+ init_packageSettingsStore();
54699
+ init_authenticationService();
54700
+ var gatewayBase3 = () => {
54701
+ const settings2 = usePackageSettingsStore.getState().settings;
54702
+ const url = settings2?.gatewayApiUrl?.replace(/\/$/, "");
54703
+ if (!url) throw new Error("Gateway API is not configured.");
54704
+ return url;
54705
+ };
54706
+ var authHeaders5 = () => {
54707
+ const headers = { "Content-Type": "application/json" };
54708
+ const token = authenticationService.getToken();
54709
+ if (token) headers["Authorization"] = `Bearer ${token}`;
54710
+ return headers;
54711
+ };
54712
+ var parse3 = async (res) => {
54713
+ const text = await res.text();
54714
+ const body = text ? JSON.parse(text) : null;
54715
+ if (!res.ok) {
54716
+ const message = body && typeof body === "object" && (body.error || body.message) || `Request failed (${res.status})`;
54717
+ throw new Error(String(message));
54718
+ }
54719
+ return body;
54720
+ };
54721
+ var scoped = (path2, scope) => `${gatewayBase3()}/crew/${path2}${scope ? `${path2.includes("?") ? "&" : "?"}scope=${encodeURIComponent(scope)}` : ""}`;
54722
+ var listBandits = async (scope) => parse3(await fetch(scoped("bandits", scope), { headers: authHeaders5() }));
54723
+ var createBandit = async (input, scope) => parse3(
54724
+ await fetch(scoped("bandits", scope), {
54725
+ method: "POST",
54726
+ headers: authHeaders5(),
54727
+ body: JSON.stringify(input)
54728
+ })
54729
+ );
54730
+ var deleteBandit = async (id, scope) => {
54731
+ const res = await fetch(scoped(`bandits/${encodeURIComponent(id)}`, scope), {
54732
+ method: "DELETE",
54733
+ headers: authHeaders5()
54734
+ });
54735
+ if (!res.ok && res.status !== 204) {
54736
+ throw new Error(`Could not remove the Bandit (${res.status}).`);
54737
+ }
54738
+ };
54739
+ var listCrewTasks = async (scope, limit = 8) => parse3(await fetch(scoped(`tasks?limit=${limit}`, scope), { headers: authHeaders5() }));
54740
+
54741
+ // src/management/components/CrewSection.tsx
54742
+ var import_jsx_runtime61 = require("react/jsx-runtime");
54743
+ var NAME_PATTERN = /^[A-Za-z][\w-]{0,30}$/;
54744
+ var statusLabel = (status) => {
54745
+ switch (status) {
54746
+ case "completed":
54747
+ return { label: "done", color: "success" };
54748
+ case "awaiting_approval":
54749
+ return { label: "needs approval", color: "warning" };
54750
+ case "failed":
54751
+ case "expired":
54752
+ return { label: status, color: "error" };
54753
+ case "cancelled":
54754
+ return { label: "stopped", color: "default" };
54755
+ default:
54756
+ return { label: status, color: "info" };
54757
+ }
54758
+ };
54759
+ var CrewSection = () => {
54760
+ const [bandits, setBandits] = (0, import_react88.useState)([]);
54761
+ const [tasks, setTasks] = (0, import_react88.useState)([]);
54762
+ const [loading, setLoading] = (0, import_react88.useState)(true);
54763
+ const [error, setError] = (0, import_react88.useState)(null);
54764
+ const [showForm, setShowForm] = (0, import_react88.useState)(false);
54765
+ const [name, setName] = (0, import_react88.useState)("");
54766
+ const [job, setJob] = (0, import_react88.useState)("");
54767
+ const [saving, setSaving] = (0, import_react88.useState)(false);
54768
+ const refresh2 = (0, import_react88.useCallback)(async () => {
54769
+ setLoading(true);
54770
+ setError(null);
54771
+ try {
54772
+ const [list3, recent] = await Promise.all([listBandits(), listCrewTasks(void 0, 5).catch(() => [])]);
54773
+ setBandits(list3);
54774
+ setTasks(recent);
54775
+ } catch (err) {
54776
+ setError(err instanceof Error ? err.message : "Could not load the crew.");
54777
+ } finally {
54778
+ setLoading(false);
54779
+ }
54780
+ }, []);
54781
+ (0, import_react88.useEffect)(() => {
54782
+ void refresh2();
54783
+ }, [refresh2]);
54784
+ const submit = async () => {
54785
+ const trimmedName = name.trim();
54786
+ const trimmedJob = job.trim();
54787
+ if (!NAME_PATTERN.test(trimmedName)) {
54788
+ setError("Names are one word: letters, digits, - or _ (for example Riley).");
54789
+ return;
54790
+ }
54791
+ if (trimmedJob.length < 10) {
54792
+ setError("Give the Bandit a job description of at least a sentence.");
54793
+ return;
54794
+ }
54795
+ setSaving(true);
54796
+ setError(null);
54797
+ try {
54798
+ await createBandit({ name: trimmedName, jobDescription: trimmedJob });
54799
+ setName("");
54800
+ setJob("");
54801
+ setShowForm(false);
54802
+ await refresh2();
54803
+ } catch (err) {
54804
+ setError(err instanceof Error ? err.message : "Could not create the Bandit.");
54805
+ } finally {
54806
+ setSaving(false);
54807
+ }
54808
+ };
54809
+ const remove = async (bandit) => {
54810
+ try {
54811
+ await deleteBandit(bandit.id);
54812
+ setBandits((current) => current.filter((b) => b.id !== bandit.id));
54813
+ } catch (err) {
54814
+ setError(err instanceof Error ? err.message : "Could not remove the Bandit.");
54815
+ }
54816
+ };
54817
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Box, { component: "section", "aria-label": "Bandit Crew", sx: { mt: 4 }, children: [
54818
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 0.5 }, children: [
54819
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Typography, { variant: "overline", color: "text.secondary", sx: { fontWeight: 700, letterSpacing: 0.6 }, children: "Bandit Crew" }),
54820
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Stack, { direction: "row", spacing: 0.5, children: [
54821
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Tooltip, { title: "Refresh", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.IconButton, { size: "small", onClick: () => void refresh2(), "aria-label": "Refresh crew", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Refresh2, { fontSize: "small" }) }) }),
54822
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Button, { size: "small", startIcon: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Plus2, {}), onClick: () => setShowForm((v) => !v), children: "New Bandit" })
54823
+ ] })
54824
+ ] }),
54825
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Typography, { variant: "body2", color: "text.secondary", sx: { mb: 1.5 }, children: [
54826
+ "Named teammates you can delegate work to in Slack: ",
54827
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("code", { children: "@Bandit ask Riley to research X and draft a summary" }),
54828
+ ". Each one shows its steps, asks before it acts outside the thread, and files the result in your Stash."
54829
+ ] }),
54830
+ loading && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.LinearProgress, { sx: { mb: 1 } }),
54831
+ error && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Alert, { severity: "error", sx: { mb: 1.5 }, onClose: () => setError(null), children: error }),
54832
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Collapse, { in: showForm, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Paper, { variant: "outlined", sx: { p: 2, mb: 1.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Stack, { spacing: 1.5, children: [
54833
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
54834
+ import_material59.TextField,
54835
+ {
54836
+ label: "Name",
54837
+ size: "small",
54838
+ value: name,
54839
+ onChange: (e) => setName(e.target.value),
54840
+ placeholder: "Riley",
54841
+ inputProps: { maxLength: 31, "aria-label": "Bandit name" }
54842
+ }
54843
+ ),
54844
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
54845
+ import_material59.TextField,
54846
+ {
54847
+ label: "Job description",
54848
+ size: "small",
54849
+ multiline: true,
54850
+ minRows: 2,
54851
+ value: job,
54852
+ onChange: (e) => setJob(e.target.value),
54853
+ placeholder: "Research analyst who writes short, cited briefs for the sales team.",
54854
+ inputProps: { "aria-label": "Job description" }
54855
+ }
54856
+ ),
54857
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Stack, { direction: "row", spacing: 1, children: [
54858
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Button, { variant: "contained", size: "small", onClick: () => void submit(), disabled: saving, children: saving ? "Creating\u2026" : "Create" }),
54859
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Button, { size: "small", onClick: () => setShowForm(false), disabled: saving, children: "Cancel" })
54860
+ ] })
54861
+ ] }) }) }),
54862
+ !loading && bandits.length === 0 && !showForm && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Paper, { variant: "outlined", sx: { p: 2, mb: 1.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Typography, { variant: "body2", color: "text.secondary", children: [
54863
+ "No Bandits yet. Create one here or in Slack: ",
54864
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("code", { children: "/bandit crew create Riley | Research analyst who writes short, cited briefs" })
54865
+ ] }) }),
54866
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Stack, { spacing: 1, children: bandits.map((bandit) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Paper, { variant: "outlined", sx: { p: 1.5, display: "flex", alignItems: "flex-start", gap: 1.5 }, children: [
54867
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Box, { sx: { flex: 1, minWidth: 0 }, children: [
54868
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
54869
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Typography, { sx: { fontWeight: 700 }, children: bandit.name }),
54870
+ bandit.model && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Chip, { size: "small", label: bandit.model })
54871
+ ] }),
54872
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Typography, { variant: "body2", color: "text.secondary", sx: { whiteSpace: "pre-wrap" }, children: bandit.jobDescription }),
54873
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Typography, { variant: "caption", color: "text.secondary", children: [
54874
+ "tools: ",
54875
+ bandit.allowedTools.join(", "),
54876
+ bandit.ownerDisplayName ? ` \xB7 owner ${bandit.ownerDisplayName}` : ""
54877
+ ] })
54878
+ ] }),
54879
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Tooltip, { title: `Remove ${bandit.name}`, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.IconButton, { size: "small", onClick: () => void remove(bandit), "aria-label": `Remove ${bandit.name}`, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Trash2, { fontSize: "small" }) }) })
54880
+ ] }, bandit.id)) }),
54881
+ tasks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Box, { sx: { mt: 2 }, children: [
54882
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Typography, { variant: "caption", color: "text.secondary", sx: { fontWeight: 700 }, children: "Recent tasks" }),
54883
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Stack, { spacing: 0.5, sx: { mt: 0.5 }, children: tasks.map((task) => {
54884
+ const status = statusLabel(task.status);
54885
+ const link2 = task.deliverables?.find((d) => d.shareUrl || d.url);
54886
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Stack, { direction: "row", spacing: 1, alignItems: "center", sx: { minWidth: 0 }, children: [
54887
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Chip, { size: "small", label: status.label, color: status.color, variant: "outlined" }),
54888
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Typography, { variant: "body2", noWrap: true, sx: { flex: 1, minWidth: 0 }, children: [
54889
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("strong", { children: task.banditName }),
54890
+ ": ",
54891
+ task.prompt
54892
+ ] }),
54893
+ link2 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Link, { href: link2.shareUrl ?? link2.url ?? void 0, target: "_blank", rel: "noreferrer", variant: "body2", children: "open" })
54894
+ ] }, task.id);
54895
+ }) })
54896
+ ] })
54897
+ ] });
54898
+ };
54899
+ var CrewSection_default = CrewSection;
54900
+
54692
54901
  // src/management/components/MCPToolsTabV2.tsx
54693
54902
  init_mcpToolsStore();
54694
54903
  init_packageSettingsStore();
54695
54904
  init_icons();
54696
54905
  init_parts();
54697
- var import_jsx_runtime61 = require("react/jsx-runtime");
54906
+ var import_jsx_runtime62 = require("react/jsx-runtime");
54698
54907
  var MCPToolsTabV2 = () => {
54699
54908
  const { settings: settings2 } = usePackageSettingsStore();
54700
54909
  const {
@@ -54707,10 +54916,10 @@ var MCPToolsTabV2 = () => {
54707
54916
  lastSavedAt,
54708
54917
  saveTools
54709
54918
  } = useMCPToolsStore();
54710
- const [loading, setLoading] = (0, import_react88.useState)(true);
54711
- const [error, setError] = (0, import_react88.useState)(null);
54712
- const [tools, setTools] = (0, import_react88.useState)([]);
54713
- const [health, setHealth] = (0, import_react88.useState)(null);
54919
+ const [loading, setLoading] = (0, import_react89.useState)(true);
54920
+ const [error, setError] = (0, import_react89.useState)(null);
54921
+ const [tools, setTools] = (0, import_react89.useState)([]);
54922
+ const [health, setHealth] = (0, import_react89.useState)(null);
54714
54923
  const gatewayConfigured = !!settings2?.gatewayApiUrl;
54715
54924
  const refresh2 = async () => {
54716
54925
  setLoading(true);
@@ -54735,7 +54944,7 @@ var MCPToolsTabV2 = () => {
54735
54944
  setLoading(false);
54736
54945
  }
54737
54946
  };
54738
- (0, import_react88.useEffect)(() => {
54947
+ (0, import_react89.useEffect)(() => {
54739
54948
  if (isLoaded) {
54740
54949
  refresh2();
54741
54950
  } else {
@@ -54744,7 +54953,7 @@ var MCPToolsTabV2 = () => {
54744
54953
  });
54745
54954
  }
54746
54955
  }, [isLoaded]);
54747
- const localEnabledMap = (0, import_react88.useMemo)(() => {
54956
+ const localEnabledMap = (0, import_react89.useMemo)(() => {
54748
54957
  const map23 = /* @__PURE__ */ new Map();
54749
54958
  const sortedTools = [...localTools].sort((a, b) => {
54750
54959
  if (a.isBuiltIn && !b.isBuiltIn) return -1;
@@ -54762,11 +54971,12 @@ var MCPToolsTabV2 = () => {
54762
54971
  }, [localTools]);
54763
54972
  const touchTarget = { width: { xs: 44, sm: 32 }, height: { xs: 44, sm: 32 } };
54764
54973
  const healthLabel = health?.status === "healthy" ? "Tool controller online" : health?.status === "unhealthy" ? "Tool controller reporting problems" : "Tool controller status unknown";
54765
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Box, { children: [
54766
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(McpServersSection_default, {}),
54767
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Box, { component: "section", "aria-label": "Built-in capabilities", sx: { mt: 4 }, children: [
54768
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
54769
- import_material59.Box,
54974
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_material60.Box, { children: [
54975
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(McpServersSection_default, {}),
54976
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CrewSection_default, {}),
54977
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_material60.Box, { component: "section", "aria-label": "Built-in capabilities", sx: { mt: 4 }, children: [
54978
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
54979
+ import_material60.Box,
54770
54980
  {
54771
54981
  sx: {
54772
54982
  display: "flex",
@@ -54776,8 +54986,8 @@ var MCPToolsTabV2 = () => {
54776
54986
  gap: 1
54777
54987
  },
54778
54988
  children: [
54779
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
54780
- import_material59.Typography,
54989
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
54990
+ import_material60.Typography,
54781
54991
  {
54782
54992
  variant: "overline",
54783
54993
  color: "text.secondary",
@@ -54785,9 +54995,9 @@ var MCPToolsTabV2 = () => {
54785
54995
  children: "Built-in capabilities"
54786
54996
  }
54787
54997
  ),
54788
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Box, { sx: { display: "flex", alignItems: "center", gap: 0.75 }, children: [
54789
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Tooltip, { title: healthLabel, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
54790
- import_material59.Box,
54998
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_material60.Box, { sx: { display: "flex", alignItems: "center", gap: 0.75 }, children: [
54999
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Tooltip, { title: healthLabel, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55000
+ import_material60.Box,
54791
55001
  {
54792
55002
  role: "img",
54793
55003
  "aria-label": healthLabel,
@@ -54799,22 +55009,22 @@ var MCPToolsTabV2 = () => {
54799
55009
  }
54800
55010
  }
54801
55011
  ) }),
54802
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Tooltip, { title: "Refresh", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
54803
- import_material59.IconButton,
55012
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Tooltip, { title: "Refresh", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55013
+ import_material60.IconButton,
54804
55014
  {
54805
55015
  size: "small",
54806
55016
  onClick: refresh2,
54807
55017
  "aria-label": "Refresh built-in capabilities",
54808
55018
  sx: touchTarget,
54809
- children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Refresh2, { fontSize: "small" })
55019
+ children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Refresh2, { fontSize: "small" })
54810
55020
  }
54811
55021
  ) })
54812
55022
  ] })
54813
55023
  ]
54814
55024
  }
54815
55025
  ),
54816
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
54817
- import_material59.Box,
55026
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55027
+ import_material60.Box,
54818
55028
  {
54819
55029
  sx: {
54820
55030
  display: "flex",
@@ -54825,8 +55035,8 @@ var MCPToolsTabV2 = () => {
54825
55035
  mb: 1.5
54826
55036
  },
54827
55037
  children: [
54828
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Typography, { variant: "body2", color: "text.secondary", children: "Things Bandit can do on its own. Switch one off to stop the assistant using it. Changes apply immediately." }),
54829
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
55038
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Typography, { variant: "body2", color: "text.secondary", children: "Things Bandit can do on its own. Switch one off to stop the assistant using it. Changes apply immediately." }),
55039
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
54830
55040
  SaveStatus,
54831
55041
  {
54832
55042
  auto: true,
@@ -54838,22 +55048,22 @@ var MCPToolsTabV2 = () => {
54838
55048
  ]
54839
55049
  }
54840
55050
  ),
54841
- loading && tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.LinearProgress, { sx: { mb: 2 } }),
54842
- error && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
54843
- import_material59.Alert,
55051
+ loading && tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.LinearProgress, { sx: { mb: 2 } }),
55052
+ error && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55053
+ import_material60.Alert,
54844
55054
  {
54845
55055
  severity: "error",
54846
55056
  sx: { mb: 2 },
54847
- action: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Button, { color: "inherit", size: "small", onClick: refresh2, children: "Retry" }),
55057
+ action: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Button, { color: "inherit", size: "small", onClick: refresh2, children: "Retry" }),
54848
55058
  children: [
54849
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Typography, { variant: "body2", sx: { fontWeight: 600 }, children: "Couldn't load built-in capabilities. The tool controller didn't respond." }),
54850
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Typography, { variant: "caption", sx: { display: "block", opacity: 0.8 }, children: error })
55059
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Typography, { variant: "body2", sx: { fontWeight: 600 }, children: "Couldn't load built-in capabilities. The tool controller didn't respond." }),
55060
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Typography, { variant: "caption", sx: { display: "block", opacity: 0.8 }, children: error })
54851
55061
  ]
54852
55062
  }
54853
55063
  ),
54854
- !gatewayConfigured && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Alert, { severity: "info", sx: { mb: 2 }, children: "No gateway URL is configured, so tool requests go to this site's own address." }),
54855
- loading && tools.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
54856
- import_material59.Box,
55064
+ !gatewayConfigured && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Alert, { severity: "info", sx: { mb: 2 }, children: "No gateway URL is configured, so tool requests go to this site's own address." }),
55065
+ loading && tools.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55066
+ import_material60.Box,
54857
55067
  {
54858
55068
  role: "status",
54859
55069
  "aria-busy": "true",
@@ -54863,19 +55073,19 @@ var MCPToolsTabV2 = () => {
54863
55073
  gridTemplateColumns: { xs: "1fr", sm: "repeat(2, 1fr)" },
54864
55074
  gap: 1.25
54865
55075
  },
54866
- children: Array.from({ length: 4 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Skeleton, { variant: "rounded", height: 64 }, i))
55076
+ children: Array.from({ length: 4 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Skeleton, { variant: "rounded", height: 64 }, i))
54867
55077
  }
54868
- ) : !loading && tools.length === 0 && !error ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
55078
+ ) : !loading && tools.length === 0 && !error ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
54869
55079
  ManagementEmptyState,
54870
55080
  {
54871
55081
  compact: true,
54872
- icon: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Braces2, {}),
55082
+ icon: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Braces2, {}),
54873
55083
  title: "No built-in capabilities reported",
54874
55084
  description: "The tool controller answered but listed no capabilities. They appear here once it reports them.",
54875
- action: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Button, { variant: "outlined", onClick: refresh2, children: "Check again" })
55085
+ action: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Button, { variant: "outlined", onClick: refresh2, children: "Check again" })
54876
55086
  }
54877
- ) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
54878
- import_material59.Box,
55087
+ ) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55088
+ import_material60.Box,
54879
55089
  {
54880
55090
  sx: {
54881
55091
  display: "grid",
@@ -54893,8 +55103,8 @@ var MCPToolsTabV2 = () => {
54893
55103
  );
54894
55104
  locallyEnabled = directLookup?.enabled ?? tool.isEnabled;
54895
55105
  }
54896
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
54897
- import_material59.Paper,
55106
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55107
+ import_material60.Paper,
54898
55108
  {
54899
55109
  variant: "outlined",
54900
55110
  sx: {
@@ -54905,10 +55115,10 @@ var MCPToolsTabV2 = () => {
54905
55115
  gap: 1
54906
55116
  },
54907
55117
  children: [
54908
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_material59.Box, { sx: { minWidth: 0 }, children: [
54909
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_material59.Typography, { variant: "subtitle2", sx: { fontWeight: 600 }, children: tool.name }),
54910
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
54911
- import_material59.Typography,
55118
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_material60.Box, { sx: { minWidth: 0 }, children: [
55119
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Typography, { variant: "subtitle2", sx: { fontWeight: 600 }, children: tool.name }),
55120
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55121
+ import_material60.Typography,
54912
55122
  {
54913
55123
  variant: "caption",
54914
55124
  color: "text.secondary",
@@ -54917,8 +55127,8 @@ var MCPToolsTabV2 = () => {
54917
55127
  }
54918
55128
  )
54919
55129
  ] }),
54920
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
54921
- import_material59.Switch,
55130
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55131
+ import_material60.Switch,
54922
55132
  {
54923
55133
  size: "small",
54924
55134
  checked: !!locallyEnabled,
@@ -54962,11 +55172,11 @@ init_useNotificationService();
54962
55172
  init_icons();
54963
55173
 
54964
55174
  // src/management/shell/ManagementShell.tsx
54965
- var import_react89 = __toESM(require("react"));
54966
- var import_material60 = require("@mui/material");
55175
+ var import_react90 = __toESM(require("react"));
55176
+ var import_material61 = require("@mui/material");
54967
55177
  var import_styles32 = require("@mui/material/styles");
54968
55178
  init_icons();
54969
- var import_jsx_runtime62 = require("react/jsx-runtime");
55179
+ var import_jsx_runtime63 = require("react/jsx-runtime");
54970
55180
  var RAIL_WIDTH = 248;
54971
55181
  var controlRadius = (theme) => `${Math.max(Number(theme.shape.borderRadius) - 2, 4)}px`;
54972
55182
  var SECTION_ICONS = {
@@ -55030,10 +55240,10 @@ function Navigation({
55030
55240
  textTransform: "uppercase",
55031
55241
  color: "text.secondary"
55032
55242
  };
55033
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_material60.Stack, { sx: { height: "100%", minHeight: 0 }, children: [
55034
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_material60.Box, { sx: { px: 1.5, pt: 1.5, pb: 1 }, children: [
55035
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55036
- import_material60.ButtonBase,
55243
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_material61.Stack, { sx: { height: "100%", minHeight: 0 }, children: [
55244
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_material61.Box, { sx: { px: 1.5, pt: 1.5, pb: 1 }, children: [
55245
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55246
+ import_material61.ButtonBase,
55037
55247
  {
55038
55248
  onClick: () => {
55039
55249
  onAfterSelect?.();
@@ -55053,14 +55263,14 @@ function Navigation({
55053
55263
  "& svg": { width: 16, height: 16 }
55054
55264
  }),
55055
55265
  children: [
55056
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ChevronLeft, {}),
55266
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ChevronLeft, {}),
55057
55267
  "Back to chat"
55058
55268
  ]
55059
55269
  }
55060
55270
  ),
55061
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Typography, { variant: "subtitle1", sx: { px: 1, mt: 1, fontWeight: 600 }, children: "Management" }),
55062
- onOpenCommandPalette && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55063
- import_material60.ButtonBase,
55271
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.Typography, { variant: "subtitle1", sx: { px: 1, mt: 1, fontWeight: 600 }, children: "Management" }),
55272
+ onOpenCommandPalette && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55273
+ import_material61.ButtonBase,
55064
55274
  {
55065
55275
  onClick: () => {
55066
55276
  onAfterSelect?.();
@@ -55083,10 +55293,10 @@ function Navigation({
55083
55293
  "& svg": { width: 15, height: 15 }
55084
55294
  }),
55085
55295
  children: [
55086
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Search2, {}),
55087
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Box, { component: "span", sx: { flex: 1, textAlign: "left" }, children: "Search\u2026" }),
55088
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55089
- import_material60.Box,
55296
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Search2, {}),
55297
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.Box, { component: "span", sx: { flex: 1, textAlign: "left" }, children: "Search\u2026" }),
55298
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55299
+ import_material61.Box,
55090
55300
  {
55091
55301
  component: "kbd",
55092
55302
  sx: (theme) => ({
@@ -55104,25 +55314,25 @@ function Navigation({
55104
55314
  }
55105
55315
  )
55106
55316
  ] }),
55107
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55108
- import_material60.Box,
55317
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55318
+ import_material61.Box,
55109
55319
  {
55110
55320
  component: "nav",
55111
55321
  "aria-label": "Management",
55112
55322
  sx: { flex: 1, overflowY: "auto", px: 1.5, pb: 2 },
55113
55323
  children: [
55114
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55115
- import_material60.List,
55324
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55325
+ import_material61.List,
55116
55326
  {
55117
55327
  component: "div",
55118
55328
  dense: true,
55119
55329
  disablePadding: true,
55120
- subheader: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.ListSubheader, { component: "div", disableSticky: true, sx: subheaderSx, children: "Workspace" }),
55330
+ subheader: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.ListSubheader, { component: "div", disableSticky: true, sx: subheaderSx, children: "Workspace" }),
55121
55331
  children: sections.map((section) => {
55122
55332
  const Icon = SECTION_ICONS[section.id];
55123
55333
  const selected = section.id === active2;
55124
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55125
- import_material60.ListItemButton,
55334
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55335
+ import_material61.ListItemButton,
55126
55336
  {
55127
55337
  selected,
55128
55338
  "aria-current": selected ? "page" : void 0,
@@ -55132,9 +55342,9 @@ function Navigation({
55132
55342
  },
55133
55343
  sx: (theme) => railItemSx(theme, selected),
55134
55344
  children: [
55135
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Icon, { fontSize: "small" }) }),
55136
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55137
- import_material60.ListItemText,
55345
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Icon, { fontSize: "small" }) }),
55346
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55347
+ import_material61.ListItemText,
55138
55348
  {
55139
55349
  primary: section.label,
55140
55350
  primaryTypographyProps: {
@@ -55150,16 +55360,16 @@ function Navigation({
55150
55360
  })
55151
55361
  }
55152
55362
  ),
55153
- organizationLinks && organizationLinks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55154
- import_material60.List,
55363
+ organizationLinks && organizationLinks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55364
+ import_material61.List,
55155
55365
  {
55156
55366
  component: "div",
55157
55367
  dense: true,
55158
55368
  disablePadding: true,
55159
55369
  sx: { mt: 1 },
55160
- subheader: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.ListSubheader, { component: "div", disableSticky: true, sx: subheaderSx, children: "Organization" }),
55161
- children: organizationLinks.map((link2) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55162
- import_material60.ListItemButton,
55370
+ subheader: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.ListSubheader, { component: "div", disableSticky: true, sx: subheaderSx, children: "Organization" }),
55371
+ children: organizationLinks.map((link2) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55372
+ import_material61.ListItemButton,
55163
55373
  {
55164
55374
  onClick: () => {
55165
55375
  onAfterSelect?.();
@@ -55167,9 +55377,9 @@ function Navigation({
55167
55377
  },
55168
55378
  sx: (theme) => railItemSx(theme, false),
55169
55379
  children: [
55170
- link2.icon && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.ListItemIcon, { children: link2.icon }),
55171
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55172
- import_material60.ListItemText,
55380
+ link2.icon && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.ListItemIcon, { children: link2.icon }),
55381
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55382
+ import_material61.ListItemText,
55173
55383
  {
55174
55384
  primary: link2.label,
55175
55385
  primaryTypographyProps: { variant: "body2", fontWeight: 500 }
@@ -55196,11 +55406,11 @@ function ManagementShell(props) {
55196
55406
  onBackHover,
55197
55407
  onOpenCommandPalette
55198
55408
  } = props;
55199
- const [sheetOpen, setSheetOpen] = import_react89.default.useState(false);
55409
+ const [sheetOpen, setSheetOpen] = import_react90.default.useState(false);
55200
55410
  const current = sections.find((s) => s.id === active2);
55201
55411
  if (isMobile) {
55202
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55203
- import_material60.Box,
55412
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55413
+ import_material61.Box,
55204
55414
  {
55205
55415
  sx: {
55206
55416
  display: "flex",
@@ -55209,8 +55419,8 @@ function ManagementShell(props) {
55209
55419
  bgcolor: "background.default"
55210
55420
  },
55211
55421
  children: [
55212
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55213
- import_material60.Box,
55422
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55423
+ import_material61.Box,
55214
55424
  {
55215
55425
  component: "header",
55216
55426
  sx: (theme) => ({
@@ -55228,18 +55438,18 @@ function ManagementShell(props) {
55228
55438
  bgcolor: theme.palette.bandit?.surface.base ?? theme.palette.background.default
55229
55439
  }),
55230
55440
  children: [
55231
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_material60.Tooltip, { title: "Back to chat", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55232
- import_material60.IconButton,
55441
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.Tooltip, { title: "Back to chat", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55442
+ import_material61.IconButton,
55233
55443
  {
55234
55444
  "aria-label": "Back to chat",
55235
55445
  onClick: onBackToChat,
55236
55446
  sx: { width: 44, height: 44 },
55237
- children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ChevronLeft, {})
55447
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ChevronLeft, {})
55238
55448
  }
55239
55449
  ) }),
55240
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_material60.Box, { sx: { flex: 1, minWidth: 0 }, children: [
55241
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55242
- import_material60.Typography,
55450
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_material61.Box, { sx: { flex: 1, minWidth: 0 }, children: [
55451
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55452
+ import_material61.Typography,
55243
55453
  {
55244
55454
  variant: "caption",
55245
55455
  color: "text.secondary",
@@ -55247,8 +55457,8 @@ function ManagementShell(props) {
55247
55457
  children: "Management"
55248
55458
  }
55249
55459
  ),
55250
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55251
- import_material60.Typography,
55460
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55461
+ import_material61.Typography,
55252
55462
  {
55253
55463
  variant: "subtitle1",
55254
55464
  noWrap: true,
@@ -55257,30 +55467,30 @@ function ManagementShell(props) {
55257
55467
  }
55258
55468
  )
55259
55469
  ] }),
55260
- onOpenCommandPalette && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55261
- import_material60.IconButton,
55470
+ onOpenCommandPalette && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55471
+ import_material61.IconButton,
55262
55472
  {
55263
55473
  "aria-label": "Search Management",
55264
55474
  onClick: onOpenCommandPalette,
55265
55475
  sx: { width: 44, height: 44 },
55266
- children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Search2, {})
55476
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Search2, {})
55267
55477
  }
55268
55478
  ),
55269
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55270
- import_material60.IconButton,
55479
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55480
+ import_material61.IconButton,
55271
55481
  {
55272
55482
  "aria-label": "Open Management navigation",
55273
55483
  "aria-expanded": sheetOpen,
55274
55484
  onClick: () => setSheetOpen(true),
55275
55485
  sx: { width: 44, height: 44 },
55276
- children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(PanelLeft, {})
55486
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PanelLeft, {})
55277
55487
  }
55278
55488
  )
55279
55489
  ]
55280
55490
  }
55281
55491
  ),
55282
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55283
- import_material60.SwipeableDrawer,
55492
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55493
+ import_material61.SwipeableDrawer,
55284
55494
  {
55285
55495
  anchor: "bottom",
55286
55496
  open: sheetOpen,
@@ -55298,8 +55508,8 @@ function ManagementShell(props) {
55298
55508
  })
55299
55509
  },
55300
55510
  children: [
55301
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55302
- import_material60.Box,
55511
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55512
+ import_material61.Box,
55303
55513
  {
55304
55514
  "aria-hidden": true,
55305
55515
  sx: (theme) => ({
@@ -55312,12 +55522,12 @@ function ManagementShell(props) {
55312
55522
  })
55313
55523
  }
55314
55524
  ),
55315
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Navigation, { ...props, onAfterSelect: () => setSheetOpen(false) })
55525
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Navigation, { ...props, onAfterSelect: () => setSheetOpen(false) })
55316
55526
  ]
55317
55527
  }
55318
55528
  ),
55319
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55320
- import_material60.Box,
55529
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55530
+ import_material61.Box,
55321
55531
  {
55322
55532
  component: "main",
55323
55533
  sx: {
@@ -55334,8 +55544,8 @@ function ManagementShell(props) {
55334
55544
  }
55335
55545
  );
55336
55546
  }
55337
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
55338
- import_material60.Box,
55547
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55548
+ import_material61.Box,
55339
55549
  {
55340
55550
  sx: {
55341
55551
  display: "flex",
@@ -55345,8 +55555,8 @@ function ManagementShell(props) {
55345
55555
  bgcolor: "background.default"
55346
55556
  },
55347
55557
  children: [
55348
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55349
- import_material60.Box,
55558
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55559
+ import_material61.Box,
55350
55560
  {
55351
55561
  component: "aside",
55352
55562
  sx: (theme) => ({
@@ -55356,11 +55566,11 @@ function ManagementShell(props) {
55356
55566
  borderRight: `1px solid ${theme.palette.divider}`,
55357
55567
  bgcolor: theme.palette.bandit?.surface.subtle ?? theme.palette.background.paper
55358
55568
  }),
55359
- children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Navigation, { ...props })
55569
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Navigation, { ...props })
55360
55570
  }
55361
55571
  ),
55362
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
55363
- import_material60.Box,
55572
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55573
+ import_material61.Box,
55364
55574
  {
55365
55575
  component: "main",
55366
55576
  sx: {
@@ -55380,10 +55590,10 @@ function ManagementShell(props) {
55380
55590
  }
55381
55591
 
55382
55592
  // src/management/shell/ManagementOverview.tsx
55383
- var import_material61 = require("@mui/material");
55593
+ var import_material62 = require("@mui/material");
55384
55594
  var import_styles33 = require("@mui/material/styles");
55385
55595
  init_parts();
55386
- var import_jsx_runtime63 = require("react/jsx-runtime");
55596
+ var import_jsx_runtime64 = require("react/jsx-runtime");
55387
55597
  var PROVIDER_LABELS = {
55388
55598
  ollama: "Ollama",
55389
55599
  openai: "OpenAI",
@@ -55403,8 +55613,8 @@ function Tile({
55403
55613
  onOpen
55404
55614
  }) {
55405
55615
  const Icon = SECTION_ICONS[id];
55406
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55407
- import_material61.ButtonBase,
55616
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
55617
+ import_material62.ButtonBase,
55408
55618
  {
55409
55619
  onClick: onOpen,
55410
55620
  "aria-label": `${label}: ${value}. Open ${label}`,
@@ -55425,17 +55635,17 @@ function Tile({
55425
55635
  }
55426
55636
  }),
55427
55637
  children: [
55428
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
55429
- import_material61.Stack,
55638
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
55639
+ import_material62.Stack,
55430
55640
  {
55431
55641
  direction: "row",
55432
55642
  alignItems: "center",
55433
55643
  spacing: 1,
55434
55644
  sx: { color: "text.secondary" },
55435
55645
  children: [
55436
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.Box, { sx: { display: "grid", "& svg": { width: 16, height: 16 } }, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Icon, { fontSize: "small" }) }),
55437
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55438
- import_material61.Typography,
55646
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Box, { sx: { display: "grid", "& svg": { width: 16, height: 16 } }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Icon, { fontSize: "small" }) }),
55647
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
55648
+ import_material62.Typography,
55439
55649
  {
55440
55650
  variant: "caption",
55441
55651
  sx: { fontWeight: 600, letterSpacing: "0.04em", textTransform: "uppercase" },
@@ -55445,8 +55655,8 @@ function Tile({
55445
55655
  ]
55446
55656
  }
55447
55657
  ),
55448
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.Typography, { variant: "h6", sx: { mt: 1, fontWeight: 600 }, noWrap: true, children: value }),
55449
- detail && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.Typography, { variant: "body2", color: "text.secondary", noWrap: true, children: detail })
55658
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "h6", sx: { mt: 1, fontWeight: 600 }, noWrap: true, children: value }),
55659
+ detail && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "body2", color: "text.secondary", noWrap: true, children: detail })
55450
55660
  ]
55451
55661
  }
55452
55662
  );
@@ -55461,7 +55671,7 @@ function ManagementOverview({
55461
55671
  const tiles = [];
55462
55672
  if (has("personalities"))
55463
55673
  tiles.push(
55464
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55674
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
55465
55675
  Tile,
55466
55676
  {
55467
55677
  id: "personalities",
@@ -55475,7 +55685,7 @@ function ManagementOverview({
55475
55685
  );
55476
55686
  if (has("knowledge"))
55477
55687
  tiles.push(
55478
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55688
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
55479
55689
  Tile,
55480
55690
  {
55481
55691
  id: "knowledge",
@@ -55489,7 +55699,7 @@ function ManagementOverview({
55489
55699
  );
55490
55700
  if (has("provider"))
55491
55701
  tiles.push(
55492
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55702
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
55493
55703
  Tile,
55494
55704
  {
55495
55705
  id: "provider",
@@ -55503,7 +55713,7 @@ function ManagementOverview({
55503
55713
  );
55504
55714
  if (has("branding"))
55505
55715
  tiles.push(
55506
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55716
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
55507
55717
  Tile,
55508
55718
  {
55509
55719
  id: "branding",
@@ -55517,7 +55727,7 @@ function ManagementOverview({
55517
55727
  );
55518
55728
  if (has("preferences"))
55519
55729
  tiles.push(
55520
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55730
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
55521
55731
  Tile,
55522
55732
  {
55523
55733
  id: "preferences",
@@ -55529,18 +55739,18 @@ function ManagementOverview({
55529
55739
  "preferences"
55530
55740
  )
55531
55741
  );
55532
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_material61.Box, { sx: { px: { xs: 1.5, sm: 2.5, md: 3 }, py: 2 }, children: [
55533
- facts.personalities === 0 && has("personalities") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.Box, { sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55742
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { px: { xs: 1.5, sm: 2.5, md: 3 }, py: 2 }, children: [
55743
+ facts.personalities === 0 && has("personalities") && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Box, { sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
55534
55744
  ManagementEmptyState,
55535
55745
  {
55536
55746
  compact: true,
55537
55747
  title: "Give this workspace its first personality",
55538
55748
  description: "A personality is the assistant people chat with: its name, instructions and the model it runs on.",
55539
- action: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material61.Button, { variant: "contained", onClick: () => onSelect("personalities"), children: "Create a personality" })
55749
+ action: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Button, { variant: "contained", onClick: () => onSelect("personalities"), children: "Create a personality" })
55540
55750
  }
55541
55751
  ) }),
55542
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
55543
- import_material61.Box,
55752
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
55753
+ import_material62.Box,
55544
55754
  {
55545
55755
  sx: {
55546
55756
  display: "grid",
@@ -55561,7 +55771,7 @@ function ManagementOverview({
55561
55771
  init_parts();
55562
55772
 
55563
55773
  // src/management/shell/sections.ts
55564
- var import_react90 = require("react");
55774
+ var import_react91 = require("react");
55565
55775
  init_useFeatures();
55566
55776
  init_authenticationService();
55567
55777
  var MANAGEMENT_SECTIONS = [
@@ -55660,7 +55870,7 @@ function useManagementAccess() {
55660
55870
  const limited = hasLimitedAdminDashboard();
55661
55871
  const full = hasAdminDashboard();
55662
55872
  const advanced = hasAdvancedSearch();
55663
- return (0, import_react90.useMemo)(() => {
55873
+ return (0, import_react91.useMemo)(() => {
55664
55874
  const roles = (token ? authenticationService.parseJwtClaims(token)?.roles : void 0) ?? [];
55665
55875
  return {
55666
55876
  sections: resolveManagementSections({
@@ -55676,9 +55886,9 @@ function useManagementAccess() {
55676
55886
  }
55677
55887
 
55678
55888
  // src/management/management.tsx
55679
- var import_jsx_runtime65 = require("react/jsx-runtime");
55889
+ var import_jsx_runtime66 = require("react/jsx-runtime");
55680
55890
  var preloadChatPage = () => Promise.resolve().then(() => (init_chat2(), chat_exports));
55681
- var SchedulesTab2 = (0, import_react92.lazy)(() => Promise.resolve().then(() => (init_SchedulesTab(), SchedulesTab_exports)));
55891
+ var SchedulesTab2 = (0, import_react93.lazy)(() => Promise.resolve().then(() => (init_SchedulesTab(), SchedulesTab_exports)));
55682
55892
  var buildCapabilitiesUrl = (gatewayApiUrl) => {
55683
55893
  const trimmed = gatewayApiUrl.replace(/\/$/, "");
55684
55894
  if (trimmed.endsWith("/api")) {
@@ -55739,16 +55949,16 @@ var Management = ({
55739
55949
  hasTransparentLogo,
55740
55950
  setHasTransparentLogo
55741
55951
  } = useModelStore();
55742
- const [modalOpen, setModalOpen] = (0, import_react92.useState)(false);
55952
+ const [modalOpen, setModalOpen] = (0, import_react93.useState)(false);
55743
55953
  const banditHead5 = "https://cdn.burtson.ai/images/bandit-head.png";
55744
- const [fabLogo, setFabLogo] = (0, import_react92.useState)(banditHead5);
55745
- const [logoFile, setLogoFile] = (0, import_react92.useState)(null);
55746
- const [logoBase64, setLogoBase64] = (0, import_react92.useState)(null);
55747
- const [brandingText, setBrandingText] = (0, import_react92.useState)("");
55748
- const [headerMode, setHeaderMode] = (0, import_react92.useState)("logo");
55749
- const [theme, setTheme] = (0, import_react92.useState)("bandit-dark");
55750
- const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react92.useState)(null);
55751
- const [presetAvatar, setPresetAvatar] = (0, import_react92.useState)(null);
55954
+ const [fabLogo, setFabLogo] = (0, import_react93.useState)(banditHead5);
55955
+ const [logoFile, setLogoFile] = (0, import_react93.useState)(null);
55956
+ const [logoBase64, setLogoBase64] = (0, import_react93.useState)(null);
55957
+ const [brandingText, setBrandingText] = (0, import_react93.useState)("");
55958
+ const [headerMode, setHeaderMode] = (0, import_react93.useState)("logo");
55959
+ const [theme, setTheme] = (0, import_react93.useState)("bandit-dark");
55960
+ const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react93.useState)(null);
55961
+ const [presetAvatar, setPresetAvatar] = (0, import_react93.useState)(null);
55752
55962
  const showSnackbarMessage = (message, severity = "success") => {
55753
55963
  if (severity === "success") {
55754
55964
  notificationService2?.showSuccess(message);
@@ -55756,22 +55966,22 @@ var Management = ({
55756
55966
  notificationService2?.showError(message);
55757
55967
  }
55758
55968
  };
55759
- const [brandingLoaded, setBrandingLoaded] = (0, import_react92.useState)(false);
55760
- const [isLoadingBranding, setIsLoadingBranding] = (0, import_react92.useState)(false);
55969
+ const [brandingLoaded, setBrandingLoaded] = (0, import_react93.useState)(false);
55970
+ const [isLoadingBranding, setIsLoadingBranding] = (0, import_react93.useState)(false);
55761
55971
  const { initModels } = useModelStore();
55762
55972
  const { settings: packageSettings } = usePackageSettingsStore();
55763
55973
  const authToken = useAuthenticationStore((state) => state.token);
55764
55974
  const { preferences, updatePreference } = usePreferencesStore();
55765
55975
  const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
55766
- const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react92.useState)(false);
55767
- const [localSelectedModel, setLocalSelectedModel] = (0, import_react92.useState)({
55976
+ const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react93.useState)(false);
55977
+ const [localSelectedModel, setLocalSelectedModel] = (0, import_react93.useState)({
55768
55978
  name: "",
55769
55979
  tagline: "",
55770
55980
  systemPrompt: "",
55771
55981
  selectedModel: ""
55772
55982
  });
55773
55983
  const { documents, addDocuments, removeDocument, loadDocuments, clearAllDocuments } = useKnowledgeStore2();
55774
- (0, import_react92.useEffect)(() => {
55984
+ (0, import_react93.useEffect)(() => {
55775
55985
  if (selectedModel) {
55776
55986
  const selected = availableModels.find((m) => m.name === selectedModel);
55777
55987
  if (selected) {
@@ -55795,7 +56005,7 @@ var Management = ({
55795
56005
  }
55796
56006
  }
55797
56007
  }, [selectedModel, availableModels]);
55798
- const loadBrandingConfig = (0, import_react92.useCallback)(async () => {
56008
+ const loadBrandingConfig = (0, import_react93.useCallback)(async () => {
55799
56009
  if (isLoadingBranding || brandingLoaded) {
55800
56010
  debugLogger.warn("Branding loading already in progress or completed, skipping");
55801
56011
  return;
@@ -55925,15 +56135,15 @@ var Management = ({
55925
56135
  setTagline,
55926
56136
  setTheme
55927
56137
  ]);
55928
- (0, import_react92.useEffect)(() => {
56138
+ (0, import_react93.useEffect)(() => {
55929
56139
  void loadBrandingConfig();
55930
56140
  }, [loadBrandingConfig]);
55931
56141
  const handleOpenModal = () => setModalOpen(true);
55932
56142
  const handleCloseModal = () => setModalOpen(false);
55933
- (0, import_react92.useEffect)(() => {
56143
+ (0, import_react93.useEffect)(() => {
55934
56144
  getOptimalFabLogo().then(setFabLogo);
55935
56145
  }, []);
55936
- (0, import_react92.useEffect)(() => {
56146
+ (0, import_react93.useEffect)(() => {
55937
56147
  if (logoBase64) {
55938
56148
  setFabLogo(logoBase64);
55939
56149
  } else {
@@ -56478,7 +56688,7 @@ var Management = ({
56478
56688
  reader.readAsText(file2);
56479
56689
  }
56480
56690
  };
56481
- (0, import_react92.useEffect)(() => {
56691
+ (0, import_react93.useEffect)(() => {
56482
56692
  if (localSelectedModel.selectedModel && !availableModels.some((m) => m.name === localSelectedModel.selectedModel)) {
56483
56693
  setLocalSelectedModel((prev) => ({
56484
56694
  ...prev,
@@ -56486,10 +56696,10 @@ var Management = ({
56486
56696
  }));
56487
56697
  }
56488
56698
  }, [availableModels, localSelectedModel.selectedModel]);
56489
- (0, import_react92.useEffect)(() => {
56699
+ (0, import_react93.useEffect)(() => {
56490
56700
  loadDocuments();
56491
56701
  }, [loadDocuments]);
56492
- (0, import_react92.useEffect)(() => {
56702
+ (0, import_react93.useEffect)(() => {
56493
56703
  const gatewayApiUrl = packageSettings?.gatewayApiUrl;
56494
56704
  if (!gatewayApiUrl || gatewayApiUrl.toLowerCase().startsWith("playground://")) {
56495
56705
  setSeedPacksEnabled(false);
@@ -56532,23 +56742,23 @@ var Management = ({
56532
56742
  isActive = false;
56533
56743
  };
56534
56744
  }, [packageSettings?.gatewayApiUrl, authToken]);
56535
- const currentTheme = (0, import_react92.useMemo)(
56745
+ const currentTheme = (0, import_react93.useMemo)(
56536
56746
  () => createBrandingTheme(theme, { density: "compact" }),
56537
56747
  [theme]
56538
56748
  );
56539
- (0, import_react92.useEffect)(() => {
56749
+ (0, import_react93.useEffect)(() => {
56540
56750
  onThemeChange?.(currentTheme);
56541
56751
  }, [currentTheme, onThemeChange]);
56542
56752
  const access = useManagementAccess();
56543
- const sections = (0, import_react92.useMemo)(
56753
+ const sections = (0, import_react93.useMemo)(
56544
56754
  () => sectionOverride ? MANAGEMENT_SECTIONS.filter((s) => sectionOverride.includes(s.id)) : access.sections,
56545
56755
  [sectionOverride, access.sections]
56546
56756
  );
56547
56757
  const defaultSection = sections.some((s) => s.id === "overview") ? "overview" : sections.some((s) => s.id === "preferences") ? "preferences" : sections[0]?.id ?? "preferences";
56548
- const [ownSection, setOwnSection] = (0, import_react92.useState)(null);
56758
+ const [ownSection, setOwnSection] = (0, import_react93.useState)(null);
56549
56759
  const requested = controlledSection ?? ownSection ?? defaultSection;
56550
56760
  const active2 = sections.some((s) => s.id === requested) ? requested : defaultSection;
56551
- const selectSection = (0, import_react92.useCallback)(
56761
+ const selectSection = (0, import_react93.useCallback)(
56552
56762
  (id) => {
56553
56763
  setOwnSection(id);
56554
56764
  onSectionChange?.(id);
@@ -56556,9 +56766,9 @@ var Management = ({
56556
56766
  [onSectionChange]
56557
56767
  );
56558
56768
  const activeDef = sectionById(active2);
56559
- const [createPersonalityRequest, setCreatePersonalityRequest] = (0, import_react92.useState)(0);
56560
- const [pendingUpload, setPendingUpload] = (0, import_react92.useState)(0);
56561
- (0, import_react92.useEffect)(() => {
56769
+ const [createPersonalityRequest, setCreatePersonalityRequest] = (0, import_react93.useState)(0);
56770
+ const [pendingUpload, setPendingUpload] = (0, import_react93.useState)(0);
56771
+ (0, import_react93.useEffect)(() => {
56562
56772
  if (!request) return;
56563
56773
  if (request.action === "create-personality") {
56564
56774
  selectSection("personalities");
@@ -56568,11 +56778,11 @@ var Management = ({
56568
56778
  setPendingUpload(request.id);
56569
56779
  }
56570
56780
  }, [request?.id]);
56571
- (0, import_react92.useEffect)(() => {
56781
+ (0, import_react93.useEffect)(() => {
56572
56782
  if (createPersonalityRequest && active2 === "personalities" && brandingLoaded)
56573
56783
  setCreatePersonalityRequest(0);
56574
56784
  }, [createPersonalityRequest, active2, brandingLoaded]);
56575
- (0, import_react92.useEffect)(() => {
56785
+ (0, import_react93.useEffect)(() => {
56576
56786
  if (!pendingUpload || active2 !== "knowledge" || !brandingLoaded) return;
56577
56787
  const frame = requestAnimationFrame(() => {
56578
56788
  document.getElementById("file-upload")?.click();
@@ -56584,9 +56794,9 @@ var Management = ({
56584
56794
  const prefSavedAt = usePreferencesStore((state) => state.lastSavedAt);
56585
56795
  const retryPreferences = usePreferencesStore((state) => state.savePreferences);
56586
56796
  const brandingValue = JSON.stringify({ logoBase64, brandingText, headerMode, theme });
56587
- const [brandingBaseline, setBrandingBaseline] = (0, import_react92.useState)(null);
56588
- const [brandingSave, setBrandingSave] = (0, import_react92.useState)("idle");
56589
- (0, import_react92.useEffect)(() => {
56797
+ const [brandingBaseline, setBrandingBaseline] = (0, import_react93.useState)(null);
56798
+ const [brandingSave, setBrandingSave] = (0, import_react93.useState)("idle");
56799
+ (0, import_react93.useEffect)(() => {
56590
56800
  if (brandingLoaded && brandingBaseline === null) setBrandingBaseline(brandingValue);
56591
56801
  }, [brandingLoaded, brandingBaseline, brandingValue]);
56592
56802
  const brandingDirty = brandingBaseline !== null && brandingBaseline !== brandingValue;
@@ -56613,7 +56823,7 @@ var Management = ({
56613
56823
  const personalityDirty = savedPersonality ? norm(localSelectedModel.name) !== norm(savedPersonality.name) || norm(localSelectedModel.tagline) !== norm(savedPersonality.tagline) || norm(localSelectedModel.systemPrompt) !== norm(savedPersonality.systemPrompt) : Boolean(
56614
56824
  norm(localSelectedModel.name) || norm(localSelectedModel.tagline) || norm(localSelectedModel.systemPrompt)
56615
56825
  );
56616
- const [personalitySaving, setPersonalitySaving] = (0, import_react92.useState)(false);
56826
+ const [personalitySaving, setPersonalitySaving] = (0, import_react93.useState)(false);
56617
56827
  const savePersonalityFromBar = async () => {
56618
56828
  setPersonalitySaving(true);
56619
56829
  try {
@@ -56634,7 +56844,7 @@ var Management = ({
56634
56844
  handleResetModel();
56635
56845
  }
56636
56846
  };
56637
- const headerStatus = active2 === "preferences" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56847
+ const headerStatus = active2 === "preferences" ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56638
56848
  SaveStatus,
56639
56849
  {
56640
56850
  auto: true,
@@ -56642,17 +56852,17 @@ var Management = ({
56642
56852
  savedAt: prefSavedAt,
56643
56853
  onRetry: () => void retryPreferences()
56644
56854
  }
56645
- ) : active2 === "branding" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56855
+ ) : active2 === "branding" ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56646
56856
  SaveStatus,
56647
56857
  {
56648
56858
  state: brandingDirty ? "unsaved" : brandingSave === "saving" ? "saving" : brandingSave
56649
56859
  }
56650
- ) : active2 === "personalities" && personalityDirty ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SaveStatus, { state: "unsaved" }) : null;
56860
+ ) : active2 === "personalities" && personalityDirty ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SaveStatus, { state: "unsaved" }) : null;
56651
56861
  const themeLabel = describeBrandingTheme(theme);
56652
56862
  if (!brandingLoaded) {
56653
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.ThemeProvider, { theme: currentTheme, children: [
56654
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.CssBaseline, {}),
56655
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56863
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_material64.ThemeProvider, { theme: currentTheme, children: [
56864
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_material64.CssBaseline, {}),
56865
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56656
56866
  ManagementShell,
56657
56867
  {
56658
56868
  sections,
@@ -56663,14 +56873,14 @@ var Management = ({
56663
56873
  onBackHover: preloadChatPage,
56664
56874
  onOpenCommandPalette,
56665
56875
  isMobile,
56666
- children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SectionSkeleton, {})
56876
+ children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SectionSkeleton, {})
56667
56877
  }
56668
56878
  )
56669
56879
  ] });
56670
56880
  }
56671
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.ThemeProvider, { theme: currentTheme, children: [
56672
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_material63.CssBaseline, {}),
56673
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
56881
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_material64.ThemeProvider, { theme: currentTheme, children: [
56882
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_material64.CssBaseline, {}),
56883
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
56674
56884
  ManagementShell,
56675
56885
  {
56676
56886
  sections,
@@ -56683,30 +56893,30 @@ var Management = ({
56683
56893
  isMobile,
56684
56894
  children: [
56685
56895
  notice,
56686
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56896
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56687
56897
  ManagementPageHeader,
56688
56898
  {
56689
56899
  title: activeDef.label,
56690
56900
  description: activeDef.description,
56691
56901
  status: headerStatus,
56692
- actions: active2 === "knowledge" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56693
- import_material63.Button,
56902
+ actions: active2 === "knowledge" ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56903
+ import_material64.Button,
56694
56904
  {
56695
56905
  variant: "contained",
56696
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(FileUp, {}),
56906
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FileUp, {}),
56697
56907
  onClick: () => document.getElementById("file-upload")?.click(),
56698
56908
  children: "Upload"
56699
56909
  }
56700
56910
  ) : void 0
56701
56911
  }
56702
56912
  ),
56703
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_material63.Box, { sx: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
56704
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
56705
- import_material63.Box,
56913
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_material64.Box, { sx: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
56914
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
56915
+ import_material64.Box,
56706
56916
  {
56707
56917
  sx: active2 === "overview" ? void 0 : { px: { xs: 1.5, sm: 2.5, md: 3 }, pt: 1.5, pb: 3, minWidth: 0 },
56708
56918
  children: [
56709
- active2 === "overview" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56919
+ active2 === "overview" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56710
56920
  ManagementOverview,
56711
56921
  {
56712
56922
  sections,
@@ -56723,7 +56933,7 @@ var Management = ({
56723
56933
  }
56724
56934
  }
56725
56935
  ),
56726
- active2 === "personalities" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56936
+ active2 === "personalities" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56727
56937
  PersonalitiesTab_default,
56728
56938
  {
56729
56939
  availableModels,
@@ -56743,7 +56953,7 @@ var Management = ({
56743
56953
  createRequest: createPersonalityRequest
56744
56954
  }
56745
56955
  ),
56746
- active2 === "branding" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56956
+ active2 === "branding" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56747
56957
  BrandingTab_default,
56748
56958
  {
56749
56959
  logoFile,
@@ -56768,7 +56978,7 @@ var Management = ({
56768
56978
  setLogoBase64
56769
56979
  }
56770
56980
  ),
56771
- active2 === "knowledge" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56981
+ active2 === "knowledge" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56772
56982
  KnowledgeHubTab_default,
56773
56983
  {
56774
56984
  documents,
@@ -56781,8 +56991,8 @@ var Management = ({
56781
56991
  seedPacksEnabled
56782
56992
  }
56783
56993
  ),
56784
- active2 === "storage" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(StorageTab_default, { currentTheme }),
56785
- active2 === "preferences" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56994
+ active2 === "storage" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(StorageTab_default, { currentTheme }),
56995
+ active2 === "preferences" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56786
56996
  PreferencesTab_default,
56787
56997
  {
56788
56998
  preferences,
@@ -56792,14 +57002,14 @@ var Management = ({
56792
57002
  showSnackbar: showSnackbarMessage
56793
57003
  }
56794
57004
  ),
56795
- active2 === "provider" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ProviderTab, {}),
56796
- active2 === "tools" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MCPToolsTabV2_default, {}),
56797
- active2 === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react92.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SectionSkeleton, {}), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SchedulesTab2, { showSnackbar: showSnackbarMessage, chatPath }) })
57005
+ active2 === "provider" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ProviderTab, {}),
57006
+ active2 === "tools" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(MCPToolsTabV2_default, {}),
57007
+ active2 === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react93.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SectionSkeleton, {}), children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SchedulesTab2, { showSnackbar: showSnackbarMessage, chatPath }) })
56798
57008
  ]
56799
57009
  },
56800
57010
  active2
56801
57011
  ),
56802
- active2 === "branding" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
57012
+ active2 === "branding" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56803
57013
  UnsavedChangesBar,
56804
57014
  {
56805
57015
  open: brandingDirty,
@@ -56810,7 +57020,7 @@ var Management = ({
56810
57020
  message: "Branding has unsaved changes"
56811
57021
  }
56812
57022
  ),
56813
- active2 === "personalities" && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
57023
+ active2 === "personalities" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56814
57024
  UnsavedChangesBar,
56815
57025
  {
56816
57026
  open: personalityDirty,
@@ -56825,8 +57035,8 @@ var Management = ({
56825
57035
  ]
56826
57036
  }
56827
57037
  ),
56828
- !isMobile && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
56829
- import_material63.Fab,
57038
+ !isMobile && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
57039
+ import_material64.Fab,
56830
57040
  {
56831
57041
  "aria-label": "Ask the assistant",
56832
57042
  onClick: handleOpenModal,
@@ -56837,7 +57047,7 @@ var Management = ({
56837
57047
  right: 16,
56838
57048
  zIndex: (t) => t.zIndex.modal - 1
56839
57049
  },
56840
- children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
57050
+ children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56841
57051
  "img",
56842
57052
  {
56843
57053
  src: fabLogo,
@@ -56847,17 +57057,17 @@ var Management = ({
56847
57057
  )
56848
57058
  }
56849
57059
  ),
56850
- !isMobile && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(chat_modal_default, { open: modalOpen, onClose: handleCloseModal })
57060
+ !isMobile && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(chat_modal_default, { open: modalOpen, onClose: handleCloseModal })
56851
57061
  ] });
56852
57062
  };
56853
57063
  var management_default = Management;
56854
57064
 
56855
57065
  // src/management/components/InterestsEditor.tsx
56856
- var import_react93 = require("react");
56857
- var import_material64 = require("@mui/material");
57066
+ var import_react94 = require("react");
57067
+ var import_material65 = require("@mui/material");
56858
57068
  init_preferencesStore();
56859
57069
  init_getStableQuestionPrompt();
56860
- var import_jsx_runtime66 = require("react/jsx-runtime");
57070
+ var import_jsx_runtime67 = require("react/jsx-runtime");
56861
57071
  var InterestsEditor = ({
56862
57072
  title = "Your interests",
56863
57073
  description = "Pick the topics you care about \u2014 your home-screen conversation starters lean toward them."
@@ -56866,19 +57076,19 @@ var InterestsEditor = ({
56866
57076
  const updatePreference = usePreferencesStore((s) => s.updatePreference);
56867
57077
  const loadPreferences = usePreferencesStore((s) => s.loadPreferences);
56868
57078
  const isLoaded = usePreferencesStore((s) => s.isLoaded);
56869
- (0, import_react93.useEffect)(() => {
57079
+ (0, import_react94.useEffect)(() => {
56870
57080
  if (!isLoaded) {
56871
57081
  void loadPreferences();
56872
57082
  }
56873
57083
  }, [isLoaded, loadPreferences]);
56874
57084
  const interests = preferences?.interests ?? [];
56875
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_material64.Box, { children: [
56876
- title && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_material64.Typography, { variant: "h6", sx: { fontWeight: 600, color: "text.primary" }, children: title }),
56877
- description && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_material64.Typography, { variant: "body2", color: "text.secondary", sx: { mb: 1.5 }, children: description }),
56878
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_material64.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: TOPICS.map((topic) => {
57085
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_material65.Box, { children: [
57086
+ title && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_material65.Typography, { variant: "h6", sx: { fontWeight: 600, color: "text.primary" }, children: title }),
57087
+ description && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_material65.Typography, { variant: "body2", color: "text.secondary", sx: { mb: 1.5 }, children: description }),
57088
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_material65.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: TOPICS.map((topic) => {
56879
57089
  const selected = interests.includes(topic);
56880
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
56881
- import_material64.Chip,
57090
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
57091
+ import_material65.Chip,
56882
57092
  {
56883
57093
  label: topic,
56884
57094
  size: "small",
@@ -56898,7 +57108,7 @@ var InterestsEditor = ({
56898
57108
  var InterestsEditor_default = InterestsEditor;
56899
57109
 
56900
57110
  // src/shared/custom-element.ts
56901
- var import_react94 = __toESM(require("react"));
57111
+ var import_react95 = __toESM(require("react"));
56902
57112
  var import_client = __toESM(require("react-dom/client"));
56903
57113
  function defineCustomElement(name, Component) {
56904
57114
  if (customElements.get(name)) return;
@@ -56926,7 +57136,7 @@ function defineCustomElement(name, Component) {
56926
57136
  if (!this.root) {
56927
57137
  this.root = import_client.default.createRoot(this.mountPoint);
56928
57138
  }
56929
- this.root.render(import_react94.default.createElement(Component, props));
57139
+ this.root.render(import_react95.default.createElement(Component, props));
56930
57140
  }
56931
57141
  }
56932
57142
  customElements.define(name, ReactElement);
@@ -57153,7 +57363,7 @@ var getFeatureMatrix = () => featureFlagService.generateFeatureMatrix();
57153
57363
  init_featureFlags();
57154
57364
 
57155
57365
  // src/hooks/useVoices.ts
57156
- var import_react95 = require("react");
57366
+ var import_react96 = require("react");
57157
57367
  init_voiceStore();
57158
57368
  init_packageSettingsStore();
57159
57369
  init_authenticationStore();
@@ -57173,7 +57383,7 @@ var useVoices = () => {
57173
57383
  } = useVoiceStore();
57174
57384
  const gatewayApiUrl = usePackageSettingsStore((state) => state.settings?.gatewayApiUrl);
57175
57385
  const { token } = useAuthenticationStore();
57176
- (0, import_react95.useEffect)(() => {
57386
+ (0, import_react96.useEffect)(() => {
57177
57387
  const isAuthenticated = authenticationService.isAuthenticated();
57178
57388
  if (gatewayApiUrl && token && isAuthenticated && !isServiceAvailable) {
57179
57389
  debugLogger.debug(
@@ -57215,9 +57425,9 @@ init_streaming_tts();
57215
57425
 
57216
57426
  // src/modals/SubscriptionExpiredModal.tsx
57217
57427
  init_storeBuild();
57218
- var import_material65 = require("@mui/material");
57428
+ var import_material66 = require("@mui/material");
57219
57429
  init_react();
57220
- var import_jsx_runtime67 = require("react/jsx-runtime");
57430
+ var import_jsx_runtime68 = require("react/jsx-runtime");
57221
57431
  var SubscriptionExpiredModal = ({
57222
57432
  open,
57223
57433
  onNavigateHome,
@@ -57239,8 +57449,8 @@ var SubscriptionExpiredModal = ({
57239
57449
  if (!IS_STORE_BUILD) window.location.href = "/manage-subscription";
57240
57450
  }
57241
57451
  };
57242
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
57243
- import_material65.Dialog,
57452
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
57453
+ import_material66.Dialog,
57244
57454
  {
57245
57455
  open,
57246
57456
  onClose,
@@ -57254,8 +57464,8 @@ var SubscriptionExpiredModal = ({
57254
57464
  }
57255
57465
  },
57256
57466
  children: [
57257
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_material65.DialogTitle, { sx: { textAlign: "center", pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
57258
- import_material65.Box,
57467
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_material66.DialogTitle, { sx: { textAlign: "center", pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
57468
+ import_material66.Box,
57259
57469
  {
57260
57470
  sx: {
57261
57471
  display: "flex",
@@ -57265,35 +57475,35 @@ var SubscriptionExpiredModal = ({
57265
57475
  mb: 1
57266
57476
  },
57267
57477
  children: [
57268
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(AlertTriangle, { size: 32, color: "warning" }),
57269
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_material65.Typography, { variant: "h5", component: "span", fontWeight: "bold", children: "Subscription Expired" })
57478
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(AlertTriangle, { size: 32, color: "warning" }),
57479
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_material66.Typography, { variant: "h5", component: "span", fontWeight: "bold", children: "Subscription Expired" })
57270
57480
  ]
57271
57481
  }
57272
57482
  ) }),
57273
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_material65.DialogContent, { sx: { pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_material65.Stack, { spacing: 2, children: [
57274
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_material65.Alert, { severity: "warning", sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_material65.Typography, { variant: "body2", children: "Your subscription has expired and access to features has been restricted." }) }),
57275
- userEmail && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
57276
- import_material65.Typography,
57483
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_material66.DialogContent, { sx: { pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_material66.Stack, { spacing: 2, children: [
57484
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_material66.Alert, { severity: "warning", sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_material66.Typography, { variant: "body2", children: "Your subscription has expired and access to features has been restricted." }) }),
57485
+ userEmail && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
57486
+ import_material66.Typography,
57277
57487
  {
57278
57488
  variant: "body2",
57279
57489
  color: "text.secondary",
57280
57490
  sx: { textAlign: "center" },
57281
57491
  children: [
57282
57492
  "Account: ",
57283
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("strong", { children: userEmail })
57493
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("strong", { children: userEmail })
57284
57494
  ]
57285
57495
  }
57286
57496
  ),
57287
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
57288
- import_material65.Typography,
57497
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
57498
+ import_material66.Typography,
57289
57499
  {
57290
57500
  variant: "body1",
57291
57501
  sx: { textAlign: "center", color: "text.secondary" },
57292
57502
  children: IS_STORE_BUILD ? "Premium features are unavailable on this account right now. You can subscribe to Pro in the app or review your account." : "To continue using all features, please renew your subscription or return to the main application."
57293
57503
  }
57294
57504
  ),
57295
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
57296
- import_material65.Box,
57505
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
57506
+ import_material66.Box,
57297
57507
  {
57298
57508
  sx: {
57299
57509
  bgcolor: "background.paper",
@@ -57303,14 +57513,14 @@ var SubscriptionExpiredModal = ({
57303
57513
  p: 2,
57304
57514
  mt: 2
57305
57515
  },
57306
- children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
57307
- import_material65.Typography,
57516
+ children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
57517
+ import_material66.Typography,
57308
57518
  {
57309
57519
  variant: "caption",
57310
57520
  color: "text.secondary",
57311
57521
  sx: { fontStyle: "italic" },
57312
57522
  children: [
57313
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("strong", { children: "What's affected:" }),
57523
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("strong", { children: "What's affected:" }),
57314
57524
  " All premium features including document upload, voice controls, advanced search, and admin dashboard access have been disabled until your subscription is renewed."
57315
57525
  ]
57316
57526
  }
@@ -57318,24 +57528,24 @@ var SubscriptionExpiredModal = ({
57318
57528
  }
57319
57529
  )
57320
57530
  ] }) }),
57321
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_material65.DialogActions, { sx: { px: 3, pb: 3, gap: 1, justifyContent: "center" }, children: [
57322
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
57323
- import_material65.Button,
57531
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_material66.DialogActions, { sx: { px: 3, pb: 3, gap: 1, justifyContent: "center" }, children: [
57532
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
57533
+ import_material66.Button,
57324
57534
  {
57325
57535
  onClick: handleNavigateHome,
57326
57536
  variant: "outlined",
57327
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Home, {}),
57537
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Home, {}),
57328
57538
  size: "large",
57329
57539
  sx: { minWidth: 140 },
57330
57540
  children: IS_STORE_BUILD ? "My Account" : "Go Home"
57331
57541
  }
57332
57542
  ),
57333
- (!IS_STORE_BUILD || onManageSubscription) && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
57334
- import_material65.Button,
57543
+ (!IS_STORE_BUILD || onManageSubscription) && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
57544
+ import_material66.Button,
57335
57545
  {
57336
57546
  onClick: handleManageSubscription,
57337
57547
  variant: "contained",
57338
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(CreditCard, {}),
57548
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(CreditCard, {}),
57339
57549
  size: "large",
57340
57550
  color: "primary",
57341
57551
  sx: { minWidth: 140 },
@@ -57349,10 +57559,10 @@ var SubscriptionExpiredModal = ({
57349
57559
  };
57350
57560
 
57351
57561
  // src/guards/SubscriptionExpiredGuard.tsx
57352
- var import_react97 = require("react");
57562
+ var import_react98 = require("react");
57353
57563
  init_useFeatures();
57354
57564
  init_authenticationService();
57355
- var import_jsx_runtime68 = require("react/jsx-runtime");
57565
+ var import_jsx_runtime69 = require("react/jsx-runtime");
57356
57566
  var SubscriptionExpiredGuard = ({
57357
57567
  children,
57358
57568
  onNavigateHome,
@@ -57361,9 +57571,9 @@ var SubscriptionExpiredGuard = ({
57361
57571
  allowContinue = false
57362
57572
  }) => {
57363
57573
  const { isExpiredTier, getFullEvaluation } = useFeatures();
57364
- const [showModal, setShowModal] = (0, import_react97.useState)(false);
57365
- const [userDismissed, setUserDismissed] = (0, import_react97.useState)(false);
57366
- (0, import_react97.useEffect)(() => {
57574
+ const [showModal, setShowModal] = (0, import_react98.useState)(false);
57575
+ const [userDismissed, setUserDismissed] = (0, import_react98.useState)(false);
57576
+ (0, import_react98.useEffect)(() => {
57367
57577
  if (isExpiredTier() && !userDismissed) {
57368
57578
  setShowModal(true);
57369
57579
  } else {
@@ -57387,9 +57597,9 @@ var SubscriptionExpiredGuard = ({
57387
57597
  }
57388
57598
  return void 0;
57389
57599
  })() : void 0;
57390
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
57600
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
57391
57601
  children,
57392
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
57602
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
57393
57603
  SubscriptionExpiredModal,
57394
57604
  {
57395
57605
  open: showModal,