);
};
-export default Footer;
\ No newline at end of file
+export default Footer;
diff --git a/llm-fe/src/llm-fe/components/legal/TermsOfServiceDocument.tsx b/llm-fe/src/llm-fe/components/legal/TermsOfServiceDocument.tsx
new file mode 100644
index 0000000..cbf126a
--- /dev/null
+++ b/llm-fe/src/llm-fe/components/legal/TermsOfServiceDocument.tsx
@@ -0,0 +1,138 @@
+import React, { Fragment } from 'react';
+import { Typography } from '@mui/material';
+
+/** Shared legal text for in-app ToS acknowledge and public read-only page. */
+const TermsOfServiceDocument = (): JSX.Element => (
+
+
+ Last Updated: July 27, 2026
+
+
+
+ Welcome to Hesychia (hesychia.ai)! These Terms of Service ("Terms") are a legally binding
+ agreement between you and AI ML Operations, LLC ("we," "us," or "our") governing your access
+ to and use of the Hesychia large language model chat service (the "Service").
+
+
+ Please read these Terms carefully. By accessing or using the Service, you agree
+ to be bound by these Terms. If you do not agree, do not use the Service.
+
+
+
+ 1. Acceptance of Terms
+
+
+ By creating an account, signing in, or otherwise using the Service, you acknowledge that you have
+ read, understood, and agree to be bound by these Terms. If you are using the Service on behalf of
+ an organization, you represent that you have authority to bind that organization.
+
+
+
+ 2. Data Confidentiality and Privacy
+
+
+ We respect your data. Information you enter into the Service is contained within your organization
+ workspace and will not be sold, shared, or disclosed to third parties without your explicit consent,
+ except as needed to operate the Service (for example, infrastructure providers under appropriate
+ agreements) or as required by law. See also Section 6 (Analytics and Cookies).
+
+
+
+ 3. Acceptable Use
+
+
+ You agree to use the Service for legitimate purposes only and to comply with all applicable laws
+ and regulations. You must not use the Service to harass others, distribute malware, attempt
+ unauthorized access, scrape or overload the Service, or generate content that violates law or
+ third-party rights.
+
+
+
+ 4. Intellectual Property
+
+
+ All intellectual property rights in the Service, including the software and models we provide,
+ remain the property of AI ML Operations, LLC or its licensors. Output you generate through the
+ Service is for your use; AI ML Operations, LLC makes no claim of ownership over that output,
+ subject to any rights of underlying model providers and applicable law.
+
+
+
+ 5. Limitation of Liability and AI Disclaimer
+
+
+ The Service provides AI-generated responses that may be inaccurate, incomplete, or inappropriate
+ for your use case. You are solely responsible for reviewing outputs before relying on them.
+
+ {' '}
+ The Service is provided "AS IS" and "AS AVAILABLE" without warranties of any kind.
+ {' '}
+ To the fullest extent permitted by law, AI ML Operations, LLC is not liable for any damages,
+ including consequential, incidental, or punitive damages, arising from your use of the Service
+ or reliance on any AI-generated content.
+
+
+
+ 6. Analytics and Cookies
+
+
+ We use privacy-focused analytics (Tianji, operated on our infrastructure) to understand how the
+ Service is used, diagnose issues, and improve features. We do not use advertising cookies. Before
+ optional behavioral analytics run on production or beta builds, we ask for your consent through a
+ notice on the Service. You may accept or decline at that time.
+
+
+ We always collect limited usage information such as:
+
+
Anonymous page views and general device or browser type
+
Referral or campaign parameters (such as UTM tags) and referrer information when present
+
+ If you accept optional analytics, we may also collect:
+
+
+ Product actions (for example, sign-in, sign-up, checkout, conversation created, message sent —
+ without message or document contents)
+
+
+ When you are signed in, a stable account identifier (such as email) so we can understand
+ authenticated usage
+
+
+
+
+ If you decline optional analytics, we still collect anonymous page views and referral data
+ described above, but we do not collect optional product events or associate activity with your
+ account. Strictly necessary storage used for security and core functionality (such as JWT
+ authentication in local storage) is separate from optional analytics. You can change your
+ analytics choice by clearing site data for Hesychia in your browser; the consent notice will
+ appear again on your next visit.
+
+
+
+ 7. Changes to Terms
+
+
+ We may update these Terms from time to time. We will notify you of significant changes, and your
+ continued use of the Service after changes take effect constitutes acceptance of the updated Terms.
+
+
+
+ 8. Governing Law
+
+
+ These Terms are governed by and construed in accordance with the laws of the United States and
+ the State of Illinois, without regard to conflict-of-law principles.
+
+
+
+ 9. Contact
+
+
+ Questions about these Terms? Contact AI ML Operations, LLC via{' '}
+ aimloperations.com or your Hesychia account
+ administrator.
+
+
+);
+
+export default TermsOfServiceDocument;
diff --git a/llm-fe/src/llm-fe/pages/SignIn/SignIn.tsx b/llm-fe/src/llm-fe/pages/SignIn/SignIn.tsx
index 7401241..e3d76e3 100644
--- a/llm-fe/src/llm-fe/pages/SignIn/SignIn.tsx
+++ b/llm-fe/src/llm-fe/pages/SignIn/SignIn.tsx
@@ -275,6 +275,9 @@ const SignIn = (): JSX.Element => {
Don't have an account? Sign up
)}
+ navigate('/terms_of_service/')}>
+ Terms of Service
+
diff --git a/llm-fe/src/llm-fe/pages/SignUp/SignUp.tsx b/llm-fe/src/llm-fe/pages/SignUp/SignUp.tsx
index f6b58ca..bf84e78 100644
--- a/llm-fe/src/llm-fe/pages/SignUp/SignUp.tsx
+++ b/llm-fe/src/llm-fe/pages/SignUp/SignUp.tsx
@@ -355,6 +355,9 @@ const SignUp = (): JSX.Element => {
)}
Already have an account? Sign in
+
+ Terms of Service
+
diff --git a/llm-fe/src/llm-fe/pages/TermsOfService/PublicTermsOfServicePage.tsx b/llm-fe/src/llm-fe/pages/TermsOfService/PublicTermsOfServicePage.tsx
new file mode 100644
index 0000000..98f06cd
--- /dev/null
+++ b/llm-fe/src/llm-fe/pages/TermsOfService/PublicTermsOfServicePage.tsx
@@ -0,0 +1,7 @@
+import React from 'react';
+import TermsOfService from './TermsOfService';
+
+/** Unauthenticated / marketing entry for Terms of Service. */
+const PublicTermsOfServicePage = (): JSX.Element => ;
+
+export default PublicTermsOfServicePage;
diff --git a/llm-fe/src/llm-fe/pages/TermsOfService/TermsOfService.test.tsx b/llm-fe/src/llm-fe/pages/TermsOfService/TermsOfService.test.tsx
new file mode 100644
index 0000000..6fac41d
--- /dev/null
+++ b/llm-fe/src/llm-fe/pages/TermsOfService/TermsOfService.test.tsx
@@ -0,0 +1,48 @@
+import React from 'react';
+import { MemoryRouter } from 'react-router-dom';
+import { render, screen } from '@testing-library/react';
+import { AuthContext } from '../../contexts/AuthContext';
+import { AccountContext } from '../../contexts/AccountContext';
+import PublicTermsOfServicePage from './PublicTermsOfServicePage';
+
+jest.mock('../../../axiosApi', () => ({
+ axiosInstance: {
+ post: jest.fn(),
+ get: jest.fn(),
+ defaults: { headers: { common: {} as Record } },
+ },
+}));
+
+jest.mock('../../components/PageWrapperLayout/PageWrapperLayout', () => ({
+ __esModule: true,
+ default: ({ children }: { children: React.ReactNode }) =>
{children}
,
+}));
+
+describe('PublicTermsOfServicePage', () => {
+ it('renders key headings without auth', () => {
+ render(
+
+
+
+
+
+
+ ,
+ );
+
+ expect(screen.getByRole('heading', { name: /Terms of Service/i })).toBeInTheDocument();
+ expect(screen.getByRole('heading', { name: /Acceptance of Terms/i })).toBeInTheDocument();
+ expect(screen.getByRole('heading', { name: /Analytics and Cookies/i })).toBeInTheDocument();
+ expect(screen.getByRole('heading', { name: /Governing Law/i })).toBeInTheDocument();
+ expect(screen.getByRole('heading', { name: /Contact/i })).toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: /Acknowledge/i })).not.toBeInTheDocument();
+ });
+});
diff --git a/llm-fe/src/llm-fe/pages/TermsOfService/TermsOfService.tsx b/llm-fe/src/llm-fe/pages/TermsOfService/TermsOfService.tsx
index 7fc2230..b82579b 100644
--- a/llm-fe/src/llm-fe/pages/TermsOfService/TermsOfService.tsx
+++ b/llm-fe/src/llm-fe/pages/TermsOfService/TermsOfService.tsx
@@ -1,90 +1,113 @@
-import { Form, Formik } from 'formik';
-import React from 'react';
-import { Card, CardContent, Divider } from '@mui/material';
+import React, { useContext, useState } from 'react';
+import { Alert, Box, Button, Card, CardContent, Divider, Stack, Typography } from '@mui/material';
+import { Link as RouterLink, useNavigate } from 'react-router-dom';
import { axiosInstance } from '../../../axiosApi';
-import { useNavigate } from 'react-router-dom';
-import MDTypography from '../../ui-kit/components/MDTypography';
+import { AuthContext } from '../../contexts/AuthContext';
+import { AccountContext } from '../../contexts/AccountContext';
+import { Account } from '../../data';
+import TermsOfServiceDocument from '../../components/legal/TermsOfServiceDocument';
import PageWrapperLayout from '../../components/PageWrapperLayout/PageWrapperLayout';
-import MDBox from '../../ui-kit/components/MDBox';
-import MDButton from '../../ui-kit/components/MDButton';
-const TermsOfService = (): JSX.Element => {
- const navigate = useNavigate();
-
- const handleAcknowledge = async (): Promise => {
-
- try{
- await axiosInstance.post('/user/acknowledge_tos/')
- navigate('/')
+type TermsOfServiceProps = {
+ /** Marketing / legal alias: always read-only chrome (no app shell). */
+ publicView?: boolean;
+};
- }catch(error){
- console.log(error)
- }
+/**
+ * Shared Terms page: public without auth; Acknowledge when signed in on /terms_of_service/.
+ */
+const TermsOfService = ({ publicView = false }: TermsOfServiceProps): JSX.Element => {
+ const navigate = useNavigate();
+ const { authenticated } = useContext(AuthContext);
+ const { account, setAccount } = useContext(AccountContext);
+ const [error, setError] = useState(null);
+ const [submitting, setSubmitting] = useState(false);
+
+ const showAcknowledge = authenticated && !publicView;
+
+ const handleAcknowledge = async (): Promise => {
+ setError(null);
+ setSubmitting(true);
+ try {
+ await axiosInstance.post('/user/acknowledge_tos/');
+ if (account) {
+ setAccount(new Account({ ...account, has_signed_tos: true }));
+ }
+ navigate('/');
+ } catch (err) {
+ console.log(err);
+ setError('Unable to acknowledge. Please try again.');
+ } finally {
+ setSubmitting(false);
}
+ };
-
+ const documentBody = (
+
+
+
+ Terms of Service
+
+
+ Hesychia · hesychia.ai · AI ML Operations, LLC
+
+
+
+
+
+
+
+
+ {showAcknowledge && (
+ <>
+
+
+ {error && (
+
+ {error}
+
+ )}
+
+ By clicking Acknowledge, you confirm that you have read and agree to these Terms.
+
+
+
+ >
+ )}
+ {!authenticated && (
+ <>
+
+
+
+ Already have an account?{' '}
+
+
+
+ >
+ )}
+
+ );
+ if (publicView || !authenticated) {
+ return (
+
+ {documentBody}
+
+ );
+ }
return (
-
-
-
-
- Terms of service
-
-
-
-
- Welcome to Hesychia (hesychia.ai)! We're excited to have you on board. Before you start using our large language model, supplied by AI ML Operations, LLC, we need you to agree to our Terms of Service.
-
-
- 1. Acceptance of Terms
-
- By logging in, you acknowledge that you have read, understood, and agree to be bound by these Terms of Service. If you don't agree, please don't use our services.
- 2. Data Confidentiality
- We respect your data. All information entered by you will be contained within your organization and will not be sold, shared, or disclosed to any third parties without your explicit consent.
- 3. Use of Services
- You agree to use our large language model for legitimate purposes only. You're responsible for ensuring that your use of our services complies with all applicable laws and regulations.
- 4. Intellectual Property
- All intellectual property rights in our services, including the large language model, remain the property of AI ML Operations, LLC. Any information generated by our service is for your use and AI ML Operations, LLC makes no claim to it.
- 5. Limitation of Liability
- In no event will we be liable for any damages, including consequential, incidental, or punitive damages, arising from your use of our services.
- 6. Changes to Terms
- We may update these Terms of Service from time to time. We'll notify you of significant changes, and your continued use of our services will constitute acceptance of the updated terms.
- 7. Governing Law
- These Terms of Service will be governed by and construed in accordance with the laws of the United States and the state of Illinois.
- By logging in, you acknowledge that you have read and agree to these Terms of Service. If you have any questions, please don't hesitate to contact us.
- Happy using our services!
-
-
- {(formik) => (
-
- )}
-
-
-
-
-
+ {documentBody}
);
};