@robosystems/core 0.9.5 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { twMerge } from 'tailwind-merge';
3
3
  export function PageLayout({ children, variant = 'constrained', className, }) {
4
- return (_jsx("div", { className: twMerge('space-y-6 p-6', variant === 'constrained' && 'mx-auto max-w-7xl', className), children: children }));
4
+ return (_jsx("div", { className: twMerge('space-y-6 p-4 sm:p-6', variant === 'constrained' && 'mx-auto max-w-7xl', className), children: children }));
5
5
  }
@@ -665,7 +665,7 @@ export function ConsoleContent({ config }) {
665
665
  };
666
666
  // ── Render ──────────────────────────────────────────────────────────
667
667
  const { header } = config;
668
- return (_jsxs("div", { className: "mx-auto max-w-7xl space-y-6 p-6", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: `rounded-lg bg-gradient-to-br ${header.gradientFrom} ${header.gradientTo} p-3`, children: _jsx(HiTerminal, { className: "h-8 w-8 text-white" }) }), _jsxs("div", { children: [_jsx("h1", { className: "font-heading text-3xl font-bold text-gray-900 dark:text-white", children: header.title }), _jsx("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: header.subtitle })] })] }), (streamingQuery.isStreaming || operatorProgress.isRunning) && (_jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400", children: [_jsx("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-green-500" }), operatorProgress.isRunning && operatorProgress.message
668
+ return (_jsxs("div", { className: "mx-auto max-w-7xl space-y-6 p-4 sm:p-6", children: [_jsxs("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between sm:gap-4", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3 sm:gap-4", children: [_jsx("div", { className: `shrink-0 rounded-lg bg-gradient-to-br ${header.gradientFrom} ${header.gradientTo} p-2.5 sm:p-3`, children: _jsx(HiTerminal, { className: "h-6 w-6 text-white sm:h-8 sm:w-8" }) }), _jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "font-heading text-2xl font-bold break-words text-gray-900 sm:text-3xl dark:text-white", children: header.title }), _jsx("p", { className: "mt-1 text-sm break-words text-gray-500 dark:text-gray-400", children: header.subtitle })] })] }), (streamingQuery.isStreaming || operatorProgress.isRunning) && (_jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400", children: [_jsx("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-green-500" }), operatorProgress.isRunning && operatorProgress.message
669
669
  ? operatorProgress.message
670
670
  : 'Processing...', operatorProgress.percentage !== undefined &&
671
671
  ` (${operatorProgress.percentage}%)`] }))] }), _jsx(Card, { className: "overflow-hidden bg-gray-950 !p-0 [&>div]:!p-0", children: _jsxs("div", { className: "flex flex-col bg-gray-950", style: { height: 'calc(100vh - 280px)' }, children: [_jsxs("div", { ref: terminalScrollRef, className: "flex-1 overflow-y-auto p-4 font-mono text-sm", children: [terminalMessages.map((message) => (_jsxs("div", { className: "mb-4", children: [_jsxs("div", { className: "mb-1 flex items-center gap-2 text-xs text-gray-700", children: [_jsx("span", { children: message.timestamp.toLocaleTimeString() }), _jsx("span", { children: "-" }), _jsx("span", { className: "tracking-wider uppercase", children: message.type })] }), _jsxs("div", { className: `leading-relaxed break-words ${message.markdown && !message.isAnimating
@@ -91,7 +91,7 @@ export function ActiveSubscriptions({ onOpenConsole, onOpenUsage, onGettingStart
91
91
  }
92
92
  onBackups === null || onBackups === void 0 ? void 0 : onBackups(repositoryId);
93
93
  };
94
- return (_jsxs("div", { className: "space-y-6", children: [_jsx(ToastContainer, {}), _jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "from-primary-500 to-secondary-600 rounded-lg bg-gradient-to-br p-3", children: _jsx(HiGlobeAlt, { className: "h-8 w-8 text-white" }) }), _jsxs("div", { children: [_jsx("h1", { className: "font-heading text-3xl font-bold text-zinc-900 dark:text-zinc-100", children: "Repository Subscriptions" }), _jsx("p", { className: "mt-1 text-sm text-zinc-500 dark:text-zinc-400", children: "Browse shared public datasets" })] })] }), onBrowse && (_jsxs(Button, { onClick: onBrowse, color: "purple", children: [_jsx(HiGlobeAlt, { className: "mr-2 h-4 w-4" }), "Browse Repositories"] }))] }), activeSubscriptions.map((subscription) => {
94
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(ToastContainer, {}), _jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3 sm:gap-4", children: [_jsx("div", { className: "from-primary-500 to-secondary-600 shrink-0 rounded-lg bg-gradient-to-br p-2.5 sm:p-3", children: _jsx(HiGlobeAlt, { className: "h-6 w-6 text-white sm:h-8 sm:w-8" }) }), _jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "font-heading text-2xl font-bold break-words text-zinc-900 sm:text-3xl dark:text-zinc-100", children: "Repository Subscriptions" }), _jsx("p", { className: "mt-1 text-sm text-zinc-500 dark:text-zinc-400", children: "Browse shared public datasets" })] })] }), onBrowse && (_jsxs(Button, { onClick: onBrowse, color: "purple", children: [_jsx(HiGlobeAlt, { className: "mr-2 h-4 w-4" }), "Browse Repositories"] }))] }), activeSubscriptions.map((subscription) => {
95
95
  var _a, _b, _c;
96
96
  const repoOffering = (_a = offerings === null || offerings === void 0 ? void 0 : offerings.repositoryPlans) === null || _a === void 0 ? void 0 : _a[subscription.resource_id];
97
97
  const planFeatures = (_c = (_b = repoOffering === null || repoOffering === void 0 ? void 0 : repoOffering.plans) === null || _b === void 0 ? void 0 : _b.find((p) => p.plan.toLowerCase() === subscription.plan_name.toLowerCase())) === null || _c === void 0 ? void 0 : _c.features;
@@ -133,7 +133,7 @@ export function BrowseRepositories({ onSubscribed, onViewSubscriptions, showHead
133
133
  }
134
134
  // Check if user has any active subscriptions
135
135
  const hasActiveSubscriptions = userSubscriptions.some((sub) => sub.status === 'active');
136
- return (_jsxs("div", { className: "space-y-6", children: [_jsx(ToastContainer, {}), showHeader && (_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "from-primary-500 to-secondary-600 rounded-lg bg-gradient-to-br p-3", children: _jsx(HiGlobeAlt, { className: "h-8 w-8 text-white" }) }), _jsxs("div", { children: [_jsx("h1", { className: "font-heading text-3xl font-bold text-zinc-900 dark:text-zinc-100", children: "Browse Repositories" }), _jsx("p", { className: "mt-1 text-sm text-zinc-500 dark:text-zinc-400", children: "Subscribe to read-only graph databases containing curated data" })] })] }), hasActiveSubscriptions && onViewSubscriptions && (_jsx(Button, { onClick: onViewSubscriptions, color: "gray", children: "View My Subscriptions" }))] })), showInfoCard && (_jsx(Card, { children: _jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "bg-primary-100 dark:bg-primary-900/30 rounded-lg p-3", children: _jsx(HiInformationCircle, { className: "text-primary-600 dark:text-primary-400 h-6 w-6" }) }), _jsxs("div", { className: "flex-1", children: [_jsx("h3", { className: "font-heading mb-3 text-lg font-semibold text-zinc-900 dark:text-white", children: "How Shared Repositories Work" }), _jsxs("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsx("div", { className: "bg-primary-500 mt-1 h-2 w-2 rounded-full" }), _jsx("span", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Subscribe to gain read-only access to curated graph databases" })] }), _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("div", { className: "bg-primary-500 mt-1 h-2 w-2 rounded-full" }), _jsx("span", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Credits are used for AI agent calls - queries are unlimited" })] }), _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("div", { className: "bg-primary-500 mt-1 h-2 w-2 rounded-full" }), _jsx("span", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Generate API keys to access repositories via MCP tools in AI apps" })] }), _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("div", { className: "bg-primary-500 mt-1 h-2 w-2 rounded-full" }), _jsx("span", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Different tiers offer varying credit limits and features" })] })] })] })] }) })), (offerings === null || offerings === void 0 ? void 0 : offerings.repositoryPlans) &&
136
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(ToastContainer, {}), showHeader && (_jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3 sm:gap-4", children: [_jsx("div", { className: "from-primary-500 to-secondary-600 shrink-0 rounded-lg bg-gradient-to-br p-2.5 sm:p-3", children: _jsx(HiGlobeAlt, { className: "h-6 w-6 text-white sm:h-8 sm:w-8" }) }), _jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "font-heading text-2xl font-bold break-words text-zinc-900 sm:text-3xl dark:text-zinc-100", children: "Browse Repositories" }), _jsx("p", { className: "mt-1 text-sm text-zinc-500 dark:text-zinc-400", children: "Subscribe to read-only graph databases containing curated data" })] })] }), hasActiveSubscriptions && onViewSubscriptions && (_jsx(Button, { onClick: onViewSubscriptions, color: "gray", children: "View My Subscriptions" }))] })), showInfoCard && (_jsx(Card, { children: _jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "bg-primary-100 dark:bg-primary-900/30 rounded-lg p-3", children: _jsx(HiInformationCircle, { className: "text-primary-600 dark:text-primary-400 h-6 w-6" }) }), _jsxs("div", { className: "flex-1", children: [_jsx("h3", { className: "font-heading mb-3 text-lg font-semibold text-zinc-900 dark:text-white", children: "How Shared Repositories Work" }), _jsxs("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsx("div", { className: "bg-primary-500 mt-1 h-2 w-2 rounded-full" }), _jsx("span", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Subscribe to gain read-only access to curated graph databases" })] }), _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("div", { className: "bg-primary-500 mt-1 h-2 w-2 rounded-full" }), _jsx("span", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Credits are used for AI agent calls - queries are unlimited" })] }), _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("div", { className: "bg-primary-500 mt-1 h-2 w-2 rounded-full" }), _jsx("span", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Generate API keys to access repositories via MCP tools in AI apps" })] }), _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("div", { className: "bg-primary-500 mt-1 h-2 w-2 rounded-full" }), _jsx("span", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Different tiers offer varying credit limits and features" })] })] })] })] }) })), (offerings === null || offerings === void 0 ? void 0 : offerings.repositoryPlans) &&
137
137
  Object.entries(offerings.repositoryPlans)
138
138
  .filter(([_, repo]) => {
139
139
  const repoData = repo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robosystems/core",
3
- "version": "0.9.5",
3
+ "version": "0.11.0",
4
4
  "description": "Shared RoboSystems frontend core library (auth, contexts, task monitoring, UI components) for the RoboSystems Next.js apps",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -27,7 +27,7 @@
27
27
  "tailwind-merge": "^3"
28
28
  },
29
29
  "peerDependencies": {
30
- "@robosystems/client": ">=1.10 <2",
30
+ "@robosystems/client": ">=1.10 <3",
31
31
  "flowbite-react": "^0.12.5",
32
32
  "next": ">=15 <17",
33
33
  "react": ">=18 <20",
@@ -44,7 +44,7 @@ export function CoreNavbar({ appName, currentApp, apiUrl = process.env.NEXT_PUBL
44
44
  return (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden dark:block", children: _jsx(Tooltip, { content: "Toggle light mode", theme: customTheme.tooltip, children: _jsx(DarkThemeToggle, {}) }) }), _jsx("div", { className: "dark:hidden", children: _jsx(Tooltip, { content: "Toggle dark mode", theme: customTheme.tooltip, children: _jsx(DarkThemeToggle, {}) }) })] }));
45
45
  };
46
46
  const renderAppSwitcher = () => (_jsx(Tooltip, { content: "Switch apps", theme: customTheme.tooltip, children: _jsx(AppSwitcher, { apiUrl: apiUrl, currentApp: currentApp }) }));
47
- return (_jsx(FlowbiteNavbar, { fluid: true, theme: customTheme.navbar, className: `fixed top-0 z-30 w-full border-b border-gray-200 p-0 ${borderColorClass} bg-white sm:p-0 dark:bg-black ${className}`, children: _jsx("div", { className: "w-full p-3 pr-4", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center", children: [_jsxs("button", { onClick: handleToggleSidebar, className: "mr-3 cursor-pointer rounded-sm p-2 text-gray-600 hover:bg-zinc-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-zinc-700 dark:hover:text-white", children: [_jsx("span", { className: "sr-only", children: "Toggle sidebar" }), _jsx("div", { className: "lg:hidden", children: sidebar.mobile.isOpen ? (_jsx(HiX, { className: "h-6 w-6" })) : (_jsx(HiMenuAlt1, { className: "h-6 w-6" })) }), _jsx("div", { className: "hidden lg:block", children: _jsx(HiMenuAlt1, { className: "h-6 w-6" }) })] }), _jsxs(NavbarBrand, { as: Link, href: homeHref, className: "mr-14", children: [_jsx(LogoBadge, { app: currentApp, animate: "once", className: "mr-2 h-10 w-10" }), _jsx("span", { className: "font-heading mt-2 ml-1 self-center text-2xl font-semibold whitespace-nowrap text-gray-900 dark:text-white", children: appName })] })] }), _jsx("div", { className: "flex items-center lg:gap-3", children: _jsxs("div", { className: "flex items-center", children: [additionalComponents && (_jsx("div", { className: "mr-2 hidden md:block", children: additionalComponents })), _jsxs("div", { className: "flex items-center space-x-2", children: [showAppSwitcherFirst && renderAppSwitcher(), renderThemeToggle(), !showAppSwitcherFirst && renderAppSwitcher(), _jsx(UserDropdown, { user: user, apiUrl: apiUrl, docsHref: docsHref, onLogout: handleLogout })] })] }) })] }) }) }));
47
+ return (_jsx(FlowbiteNavbar, { fluid: true, theme: customTheme.navbar, className: `fixed top-0 z-30 w-full border-b border-gray-200 p-0 ${borderColorClass} bg-white sm:p-0 dark:bg-black ${className}`, children: _jsx("div", { className: "w-full p-3 pr-4", children: _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "flex min-w-0 items-center", children: [_jsxs("button", { onClick: handleToggleSidebar, className: "mr-1 shrink-0 cursor-pointer rounded-sm p-2 text-gray-600 hover:bg-zinc-100 hover:text-gray-900 sm:mr-3 dark:text-gray-400 dark:hover:bg-zinc-700 dark:hover:text-white", children: [_jsx("span", { className: "sr-only", children: "Toggle sidebar" }), _jsx("div", { className: "lg:hidden", children: sidebar.mobile.isOpen ? (_jsx(HiX, { className: "h-6 w-6" })) : (_jsx(HiMenuAlt1, { className: "h-6 w-6" })) }), _jsx("div", { className: "hidden lg:block", children: _jsx(HiMenuAlt1, { className: "h-6 w-6" }) })] }), _jsxs(NavbarBrand, { as: Link, href: homeHref, className: "min-w-0 lg:mr-14", children: [_jsx(LogoBadge, { app: currentApp, animate: "once", className: "mr-1.5 h-8 w-8 shrink-0 sm:mr-2 sm:h-10 sm:w-10" }), _jsx("span", { className: "font-heading mt-1 self-center truncate text-base font-semibold text-gray-900 sm:mt-2 sm:ml-1 sm:text-2xl dark:text-white", children: appName })] })] }), _jsx("div", { className: "flex shrink-0 items-center lg:gap-3", children: _jsxs("div", { className: "flex items-center", children: [additionalComponents && (_jsx("div", { className: "mr-2 hidden md:block", children: additionalComponents })), _jsxs("div", { className: "flex items-center space-x-2", children: [showAppSwitcherFirst && renderAppSwitcher(), renderThemeToggle(), !showAppSwitcherFirst && renderAppSwitcher(), _jsx(UserDropdown, { user: user, apiUrl: apiUrl, docsHref: docsHref, onLogout: handleLogout })] })] }) })] }) }) }));
48
48
  }
49
49
  function UserDropdown({ user, apiUrl, docsHref, onLogout }) {
50
50
  const settings = useAccountSettingsLink(apiUrl);
@@ -19,5 +19,12 @@ export interface PageHeaderProps {
19
19
  * the app's brand-gradient chip, a title, an optional subtitle, and optional
20
20
  * right-aligned actions. The gradient spans the brand `primary` → `secondary`
21
21
  * → `accent` tokens, so it reskins to each app automatically.
22
+ *
23
+ * Below `sm` the actions drop onto their own row under the title rather than
24
+ * competing with it for a 390px-wide line — a row of buttons that cannot fit
25
+ * beside the title is what used to push the whole page into a horizontal
26
+ * scroll. Above `sm` they return to the right edge. `min-w-0` on the title
27
+ * column is what lets a long title shrink instead of shoving the actions off
28
+ * the viewport, since a flex item's default `min-width: auto` refuses to.
22
29
  */
23
30
  export declare function PageHeader({ icon: Icon, title, subtitle, actions, className, }: PageHeaderProps): import("react").JSX.Element;
@@ -6,7 +6,14 @@ import { twMerge } from 'tailwind-merge';
6
6
  * the app's brand-gradient chip, a title, an optional subtitle, and optional
7
7
  * right-aligned actions. The gradient spans the brand `primary` → `secondary`
8
8
  * → `accent` tokens, so it reskins to each app automatically.
9
+ *
10
+ * Below `sm` the actions drop onto their own row under the title rather than
11
+ * competing with it for a 390px-wide line — a row of buttons that cannot fit
12
+ * beside the title is what used to push the whole page into a horizontal
13
+ * scroll. Above `sm` they return to the right edge. `min-w-0` on the title
14
+ * column is what lets a long title shrink instead of shoving the actions off
15
+ * the viewport, since a flex item's default `min-width: auto` refuses to.
9
16
  */
10
17
  export function PageHeader({ icon: Icon, title, subtitle, actions, className, }) {
11
- return (_jsxs("div", { className: twMerge('flex items-start justify-between gap-4', className), children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "from-primary-500 via-secondary-500 to-accent-500 shrink-0 rounded-lg bg-gradient-to-br p-3", children: _jsx(Icon, { className: "h-8 w-8 text-white" }) }), _jsxs("div", { children: [_jsx("h1", { className: "font-heading text-3xl font-bold text-gray-900 dark:text-white", children: title }), subtitle && (_jsx("div", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: subtitle }))] })] }), actions && _jsx("div", { className: "flex shrink-0 gap-2", children: actions })] }));
18
+ return (_jsxs("div", { className: twMerge('flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between', className), children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3 sm:gap-4", children: [_jsx("div", { className: "from-primary-500 via-secondary-500 to-accent-500 shrink-0 rounded-lg bg-gradient-to-br p-2.5 sm:p-3", children: _jsx(Icon, { className: "h-6 w-6 text-white sm:h-8 sm:w-8" }) }), _jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "font-heading text-2xl font-bold break-words text-gray-900 sm:text-3xl dark:text-white", children: title }), subtitle && (_jsx("div", { className: "mt-1 text-sm break-words text-gray-500 dark:text-gray-400", children: subtitle }))] })] }), actions && (_jsx("div", { className: "flex flex-wrap gap-2 sm:shrink-0", children: actions }))] }));
12
19
  }