@robosystems/core 0.21.0 → 0.21.2

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://badge.fury.io/js/@robosystems%2Fcore.svg)](https://www.npmjs.com/package/@robosystems/core)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
 
6
- Shared React core for the RoboSystems ecosystem apps — authentication, platform contexts, task monitoring, and the common UI component set used by robosystems-app, roboledger-app, and roboinvestor-app. Built for the Next.js App Router (client/server components and Server Actions) and consumed as a versioned npm package.
6
+ Part of RoboSystems, the open-source knowledge graph for finance. Shared React core for the RoboSystems apps: authentication, platform contexts, task monitoring, and the common UI component set used by robosystems-app, roboledger-app, and roboinvestor-app. Built for the Next.js App Router (client/server components and Server Actions) and consumed as a versioned npm package.
7
7
 
8
8
  ## Features
9
9
 
@@ -45,7 +45,7 @@ export const APP_CONFIGS = {
45
45
  name: 'robosystems',
46
46
  displayName: 'RoboSystems',
47
47
  url: process.env.NEXT_PUBLIC_ROBOSYSTEMS_APP_URL || 'https://robosystems.ai',
48
- description: 'Financial Intelligence Platform',
48
+ description: 'Knowledge graph for finance',
49
49
  initials: 'RS',
50
50
  colorClass: 'bg-blue-600 dark:bg-blue-500',
51
51
  brandColor: BRAND_COLORS.robosystems,
@@ -124,7 +124,7 @@ export function BrowseRepositories({ onSubscribed, onViewSubscriptions, showHead
124
124
  sub.ends_at &&
125
125
  new Date(sub.ends_at) > new Date())));
126
126
  };
127
- const handleChangePlan = (repoType, repoName, currentPlan, currentPlanName, currentPrice, newPlan, newPlanName, newPrice) => {
127
+ const handleChangePlan = (repoType, repoName, currentPlan, currentPlanName, currentPrice, newPlan, newPlanName, newPrice, trialEndsAt) => {
128
128
  setPlanChangeModal({
129
129
  repoType,
130
130
  repoName,
@@ -135,6 +135,7 @@ export function BrowseRepositories({ onSubscribed, onViewSubscriptions, showHead
135
135
  newPlanName,
136
136
  newPrice,
137
137
  isUpgrade: newPrice > currentPrice,
138
+ trialEndsAt,
138
139
  });
139
140
  };
140
141
  const handleChangePlanConfirm = async () => {
@@ -182,7 +183,7 @@ export function BrowseRepositories({ onSubscribed, onViewSubscriptions, showHead
182
183
  const trialEndsAt = userSub === null || userSub === void 0 ? void 0 : userSub.trial_ends_at;
183
184
  const onTrial = !!trialEndsAt && utcDate(trialEndsAt) > new Date();
184
185
  return (_jsx(Card, { className: "overflow-hidden", children: _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "flex items-start justify-between", children: [_jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "from-primary-500 to-secondary-600 rounded-lg bg-gradient-to-br p-3", children: _jsx(GoRepo, { className: "h-8 w-8 text-white" }) }), _jsxs("div", { children: [_jsx("h2", { className: "font-heading text-2xl font-bold text-zinc-900 dark:text-zinc-100", children: repoData.name }), _jsx("p", { className: "mt-1 text-zinc-600 dark:text-zinc-400", children: repoData.description })] })] }), userSub && (_jsxs(Badge, { color: onTrial ? 'info' : 'success', icon: HiCheckCircle, size: "lg", children: [onTrial ? 'Free trial' : 'Active', " -", ' ', userSub.plan_name.charAt(0).toUpperCase() +
185
- userSub.plan_name.slice(1)] }))] }), trialDays > 0 && (_jsx(Alert, { color: "info", icon: HiInformationCircle, children: _jsxs("p", { className: "text-sm", children: [_jsxs("span", { className: "font-semibold", children: ["Start with a ", trialDays, "-day free trial on either plan."] }), ' ', "The trial opens the analysis tools over MCP and the API. Raw Cypher queries, the AI analyst and your monthly credits open with the first payment. A card is required; your plan starts when the trial ends, and you can cancel any time before then and keep the rest of the trial."] }) })), _jsx("div", { className: `grid gap-6 ${repoData.plans.length === 2
186
+ userSub.plan_name.slice(1)] }))] }), trialDays > 0 && (_jsx(Alert, { color: "info", icon: HiInformationCircle, children: _jsxs("p", { className: "text-sm", children: [_jsxs("span", { className: "font-semibold", children: ["Start with a ", trialDays, "-day free trial on either plan."] }), ' ', "The trial opens the analysis tools over MCP and the API, at lower rate limits than the plan. Raw Cypher queries, the AI analyst and your monthly credits open with the first payment. A card is required and your plan starts when the trial ends; you can start it sooner from your organization's Subscriptions tab, or cancel any time before then and keep the rest of the trial."] }) })), _jsx("div", { className: `grid gap-6 ${repoData.plans.length === 2
186
187
  ? 'mx-auto max-w-3xl lg:grid-cols-2'
187
188
  : 'lg:grid-cols-3'}`, children: repoData.plans.map((plan, index) => {
188
189
  var _a, _b;
@@ -206,7 +207,9 @@ export function BrowseRepositories({ onSubscribed, onViewSubscriptions, showHead
206
207
  ? 'border-secondary-500 from-secondary-50 dark:from-secondary-900/20 bg-gradient-to-b to-white shadow-md dark:to-zinc-800'
207
208
  : 'border-zinc-200 bg-white hover:border-zinc-300 dark:border-zinc-700 dark:bg-zinc-800'}`, children: [isPopular && (_jsx("div", { className: "absolute -top-3 left-1/2 -translate-x-1/2", children: _jsx(Badge, { color: "purple", size: "sm", children: "Most Popular" }) })), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "text-center", children: [_jsx("h3", { className: "font-heading mb-2 text-xl font-bold text-zinc-900 dark:text-zinc-100", children: plan.name }), _jsxs("div", { className: "mb-1", children: [_jsxs("span", { className: "text-3xl font-bold text-zinc-900 dark:text-zinc-100", children: ["$", plan.monthlyPrice] }), _jsx("span", { className: "text-zinc-500 dark:text-zinc-400", children: "/month" })] }), trialDays > 0 && (_jsxs("p", { className: "text-primary-600 dark:text-primary-400 mb-1 text-sm font-medium", children: ["after a ", trialDays, "-day free trial"] })), _jsxs("p", { className: "mb-6 text-sm font-medium text-zinc-600 dark:text-zinc-400", children: [plan.monthlyCredits.toLocaleString(), ' ', "credits/month"] })] }), plan.features && (_jsx("ul", { className: "mb-6 space-y-2 text-sm", children: plan.features.map((feature, idx) => (_jsxs("li", { className: "flex items-start gap-2", children: [_jsx(HiCheckCircle, { className: "mt-0.5 h-4 w-4 shrink-0 text-green-500" }), _jsx("span", { className: "text-zinc-600 dark:text-zinc-400", children: feature })] }, idx))) }))] }), _jsx("div", { className: "mt-6", children: isCurrentPlan ? (_jsxs(Button, { color: "gray", disabled: true, className: "w-full", size: "lg", children: [_jsx(HiCheckCircle, { className: "mr-2 h-4 w-4" }), "Current Plan"] })) : userSub ? (_jsx(Button, { onClick: () => {
208
209
  var _a;
209
- return handleChangePlan(repoType, repoData.name, userSub.plan_name, userSub.plan_display_name, (_a = currentPlanData === null || currentPlanData === void 0 ? void 0 : currentPlanData.monthlyPrice) !== null && _a !== void 0 ? _a : 0, plan.plan, plan.name, plan.monthlyPrice);
210
+ return handleChangePlan(repoType, repoData.name, userSub.plan_name, userSub.plan_display_name, (_a = currentPlanData === null || currentPlanData === void 0 ? void 0 : currentPlanData.monthlyPrice) !== null && _a !== void 0 ? _a : 0, plan.plan, plan.name, plan.monthlyPrice, onTrial
211
+ ? (trialEndsAt !== null && trialEndsAt !== void 0 ? trialEndsAt : undefined)
212
+ : undefined);
210
213
  }, className: "w-full", size: "lg", color: isUpgrade ? 'purple' : 'blue', children: isUpgrade ? (_jsxs(_Fragment, { children: [_jsx(HiArrowUp, { className: "mr-2 h-4 w-4" }), "Upgrade to ", plan.name] })) : (_jsxs(_Fragment, { children: [_jsx(HiArrowDown, { className: "mr-2 h-4 w-4" }), "Downgrade to ", plan.name] })) })) : (_jsx(Button, { onClick: () => handleSubscribe(repoType, plan.plan), disabled: subscribing === `${repoType}-${plan.plan}`, className: "w-full", size: "lg", color: isPopular ? 'purple' : 'blue', children: subscribing === `${repoType}-${plan.plan}`
211
214
  ? 'Subscribing...'
212
215
  : trialDays > 0
@@ -217,9 +220,11 @@ export function BrowseRepositories({ onSubscribed, onViewSubscriptions, showHead
217
220
  Object.keys(offerings.repositoryPlans).filter((key) => offerings.repositoryPlans[key].enabled &&
218
221
  !offerings.repositoryPlans[key].comingSoon).length === 0) && (_jsx(Card, { children: _jsxs("div", { className: "py-8 text-center", children: [_jsx(HiDatabase, { className: "mx-auto mb-4 h-12 w-12 text-zinc-400" }), _jsx("p", { className: "text-zinc-600 dark:text-zinc-400", children: "No shared repositories available at this time" })] }) })), _jsxs(Modal, { show: !!planChangeModal, onClose: () => !changingPlan && setPlanChangeModal(null), size: "md", children: [_jsxs(ModalHeader, { children: [(planChangeModal === null || planChangeModal === void 0 ? void 0 : planChangeModal.isUpgrade) ? 'Upgrade' : 'Downgrade', " Plan"] }), _jsx(ModalBody, { children: planChangeModal && (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx("div", { className: `rounded-full p-3 ${planChangeModal.isUpgrade
219
222
  ? 'bg-secondary-100 dark:bg-secondary-900/30'
220
- : 'bg-primary-100 dark:bg-primary-900/30'}`, children: planChangeModal.isUpgrade ? (_jsx(HiArrowUp, { className: "text-secondary-600 dark:text-secondary-400 h-6 w-6" })) : (_jsx(HiArrowDown, { className: "text-primary-600 dark:text-primary-400 h-6 w-6" })) }), _jsxs("div", { className: "flex-1", children: [_jsxs("h3", { className: "font-semibold text-gray-900 dark:text-white", children: [planChangeModal.isUpgrade ? 'Upgrade' : 'Downgrade', ' ', planChangeModal.repoName, "?"] }), _jsx("div", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: _jsxs("p", { children: [planChangeModal.currentPlanName, " ($", planChangeModal.currentPrice, "/mo) \u2192", ' ', planChangeModal.newPlanName, " ($", planChangeModal.newPrice, "/mo)"] }) })] })] }), _jsx(Alert, { color: planChangeModal.isUpgrade ? 'info' : 'warning', icon: HiInformationCircle, children: _jsx("p", { className: "text-sm", children: planChangeModal.isUpgrade
221
- ? 'Your new plan will take effect immediately. You will be charged a prorated amount for the remainder of this billing period.'
222
- : 'Your plan will be downgraded immediately. You will receive a prorated credit for the remainder of this billing period.' }) })] })) }), _jsx(ModalFooter, { children: _jsxs("div", { className: "flex w-full gap-3", children: [_jsx(Button, { onClick: () => setPlanChangeModal(null), disabled: changingPlan, color: "gray", className: "flex-1", children: "Cancel" }), _jsx(Button, { onClick: handleChangePlanConfirm, disabled: changingPlan, color: (planChangeModal === null || planChangeModal === void 0 ? void 0 : planChangeModal.isUpgrade) ? 'purple' : 'blue', className: "flex-1", children: changingPlan
223
+ : 'bg-primary-100 dark:bg-primary-900/30'}`, children: planChangeModal.isUpgrade ? (_jsx(HiArrowUp, { className: "text-secondary-600 dark:text-secondary-400 h-6 w-6" })) : (_jsx(HiArrowDown, { className: "text-primary-600 dark:text-primary-400 h-6 w-6" })) }), _jsxs("div", { className: "flex-1", children: [_jsxs("h3", { className: "font-semibold text-gray-900 dark:text-white", children: [planChangeModal.isUpgrade ? 'Upgrade' : 'Downgrade', ' ', planChangeModal.repoName, "?"] }), _jsx("div", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: _jsxs("p", { children: [planChangeModal.currentPlanName, " ($", planChangeModal.currentPrice, "/mo) \u2192", ' ', planChangeModal.newPlanName, " ($", planChangeModal.newPrice, "/mo)"] }) })] })] }), _jsx(Alert, { color: planChangeModal.isUpgrade ? 'info' : 'warning', icon: HiInformationCircle, children: _jsx("p", { className: "text-sm", children: planChangeModal.trialEndsAt
224
+ ? `Your free trial carries on, now for ${planChangeModal.newPlanName}. Nothing is charged today, and the trial's limits stay as they are. The first charge is $${planChangeModal.newPrice} when the trial ends on ${utcDate(planChangeModal.trialEndsAt).toLocaleDateString(undefined, { month: 'short', day: 'numeric' })}.`
225
+ : planChangeModal.isUpgrade
226
+ ? 'Your new plan will take effect immediately. You will be charged a prorated amount for the remainder of this billing period.'
227
+ : 'Your plan will be downgraded immediately. You will receive a prorated credit for the remainder of this billing period.' }) })] })) }), _jsx(ModalFooter, { children: _jsxs("div", { className: "flex w-full gap-3", children: [_jsx(Button, { onClick: () => setPlanChangeModal(null), disabled: changingPlan, color: "gray", className: "flex-1", children: "Cancel" }), _jsx(Button, { onClick: handleChangePlanConfirm, disabled: changingPlan, color: (planChangeModal === null || planChangeModal === void 0 ? void 0 : planChangeModal.isUpgrade) ? 'purple' : 'blue', className: "flex-1", children: changingPlan
223
228
  ? 'Processing...'
224
229
  : `Confirm ${(planChangeModal === null || planChangeModal === void 0 ? void 0 : planChangeModal.isUpgrade) ? 'Upgrade' : 'Downgrade'}` })] }) })] })] }));
225
230
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@robosystems/core",
3
- "version": "0.21.0",
4
- "description": "Shared RoboSystems frontend core library (auth, contexts, task monitoring, UI components) for the RoboSystems Next.js apps",
3
+ "version": "0.21.2",
4
+ "description": "Shared React core for the RoboSystems apps",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "type": "module",
@@ -44,5 +44,5 @@ export function LandingFooter({ tagline, productLinks, contactModal: ContactModa
44
44
  return (_jsx("li", { children: _jsx(Link, Object.assign({ href: cfg.url }, (isCurrent
45
45
  ? {}
46
46
  : { target: '_blank', rel: 'noopener noreferrer' }), { className: linkClass, children: cfg.displayName })) }, app));
47
- }), _jsx("li", { children: _jsx(Link, { href: "https://xbrlkit.com", target: "_blank", rel: "noopener noreferrer", className: linkClass, children: "xbrlkit" }) })] })] }), _jsxs("div", { children: [_jsx("h3", { className: headingClass, children: "Company" }), _jsxs("ul", { className: "space-y-2 text-sm", children: [_jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/about` }, companyLinkProps, { className: linkClass, children: "About" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: researchHref }, researchLinkProps, { className: linkClass, children: "Research" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: resolvedBlogHref }, blogLinkProps, { className: linkClass, children: "Blog" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/pages/privacy` }, companyLinkProps, { className: linkClass, children: "Privacy" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/pages/terms` }, companyLinkProps, { className: linkClass, children: "Terms" })) }), _jsx("li", { children: _jsx(Link, { href: "https://trust.robosystems.ai", target: "_blank", rel: "noopener noreferrer", className: linkClass, children: "Trust Center" }) }), _jsx("li", { children: _jsx(Link, { href: "https://status.robosystems.ai", target: "_blank", rel: "noopener noreferrer", className: linkClass, children: "Status" }) }), ContactModal && (_jsx("li", { children: _jsx("button", { onClick: () => setShowContact(true), className: linkClass, children: "Contact" }) }))] })] })] }), _jsxs("div", { className: "mt-8 border-t border-gray-800 pt-8 text-center text-sm text-gray-400", children: [_jsxs("p", { children: ["\u00A9 ", new Date().getFullYear(), " RFS LLC. All rights reserved."] }), _jsxs("p", { className: "mt-2", children: ["Implementation and training by", ' ', _jsx(Link, { href: "https://harbinger.finance", target: "_blank", rel: "noopener noreferrer", className: "text-gray-300 transition-colors hover:text-white", children: "Harbinger FinLab" })] })] })] }), ContactModal && (_jsx(ContactModal, { isOpen: showContact, onClose: () => setShowContact(false) }))] }));
47
+ }), _jsx("li", { children: _jsx(Link, { href: "https://xbrlkit.com", target: "_blank", rel: "noopener noreferrer", className: linkClass, children: "xbrlkit" }) })] })] }), _jsxs("div", { children: [_jsx("h3", { className: headingClass, children: "Company" }), _jsxs("ul", { className: "space-y-2 text-sm", children: [_jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/about` }, companyLinkProps, { className: linkClass, children: "About" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: researchHref }, researchLinkProps, { className: linkClass, children: "Research" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: resolvedBlogHref }, blogLinkProps, { className: linkClass, children: "Blog" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/pages/privacy` }, companyLinkProps, { className: linkClass, children: "Privacy" })) }), _jsx("li", { children: _jsx(Link, Object.assign({ href: `${companyBase}/pages/terms` }, companyLinkProps, { className: linkClass, children: "Terms" })) }), _jsx("li", { children: _jsx(Link, { href: "https://trust.robosystems.ai", target: "_blank", rel: "noopener noreferrer", className: linkClass, children: "Trust Center" }) }), _jsx("li", { children: _jsx(Link, { href: "https://status.robosystems.ai", target: "_blank", rel: "noopener noreferrer", className: linkClass, children: "Status" }) }), ContactModal && (_jsx("li", { children: _jsx("button", { onClick: () => setShowContact(true), className: linkClass, children: "Contact" }) }))] })] })] }), _jsxs("div", { className: "mt-8 border-t border-gray-800 pt-8 text-center text-sm text-gray-400", children: [_jsxs("p", { children: ["\u00A9 ", new Date().getFullYear(), " RFS LLC. All rights reserved."] }), _jsxs("p", { className: "mt-2", children: ["The Finance AI Deployment by", ' ', _jsx(Link, { href: "https://harbinger.finance", target: "_blank", rel: "noopener noreferrer", className: "text-gray-300 transition-colors hover:text-white", children: "Harbinger FinLab" })] })] })] }), ContactModal && (_jsx(ContactModal, { isOpen: showContact, onClose: () => setShowContact(false) }))] }));
48
48
  }