mirror of
https://github.com/geoffsee/open-gsio.git
synced 2025-09-08 22:56:46 +00:00
Compare commits
13 Commits
dependabot
...
smart-land
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7ab1141540 | ||
![]() |
5630a95f1a | ||
![]() |
24351b0be7 | ||
![]() |
cd58a23942 | ||
![]() |
fbd696612a | ||
![]() |
b737ff09b3 | ||
![]() |
c436ae1b62 | ||
![]() |
5f6cb3d6c7 | ||
![]() |
195d071c3c | ||
![]() |
a996f115bc | ||
![]() |
3bbd4243c5 | ||
![]() |
944b956ffd | ||
![]() |
c3ea9ba599 |
@@ -46,6 +46,7 @@ describe('AssistantSdk', () => {
|
||||
|
||||
expect(prompt).toContain('# Assistant Knowledge');
|
||||
expect(prompt).toContain('### Date: ');
|
||||
expect(prompt).toContain('### Web Host: ');
|
||||
expect(prompt).toContain('### User Location: ');
|
||||
expect(prompt).toContain('### Timezone: ');
|
||||
});
|
||||
|
@@ -23,7 +23,7 @@ export class AssistantSdk {
|
||||
|
||||
return `# Assistant Knowledge
|
||||
## Assistant Name
|
||||
### open-gsio
|
||||
### yachtpit-ai
|
||||
## Current Context
|
||||
### Date: ${currentDate} ${currentTime}
|
||||
${maxTokens ? `### Max Response Length: ${maxTokens} tokens (maximum)` : ''}
|
||||
|
@@ -50,7 +50,7 @@
|
||||
"marked-katex-extension": "^5.1.4",
|
||||
"mobx": "^6.13.5",
|
||||
"mobx-react-lite": "^4.0.7",
|
||||
"mobx-state-tree": "^7.0.2",
|
||||
"mobx-state-tree": "^6.0.1",
|
||||
"qrcode.react": "^4.1.0",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { execSync, execFileSync } from 'node:child_process';
|
||||
import { execSync } from 'node:child_process';
|
||||
import {
|
||||
existsSync,
|
||||
readdirSync,
|
||||
@@ -175,7 +175,7 @@ function optimizeWasmSize() {
|
||||
|
||||
if (sizeInMb > 30) {
|
||||
logger.info(`WASM size is ${sizeInMb.toFixed(2)}MB, optimizing...`);
|
||||
execFileSync('wasm-opt', ['-Oz', '-o', wasmPath, wasmPath], {
|
||||
execSync(`wasm-opt -Oz -o ${wasmPath} ${wasmPath}`, {
|
||||
encoding: 'utf-8',
|
||||
});
|
||||
logger.info(`✅ WASM size optimized`);
|
||||
|
@@ -171,7 +171,7 @@ const InputMenu: React.FC<{ isDisabled?: boolean }> = observer(({ isDisabled })
|
||||
bg="background.tertiary"
|
||||
color="text.primary"
|
||||
onClick={() => {
|
||||
clientChatStore.reset();
|
||||
clientChatStore.setActiveConversation('conversation:new');
|
||||
onClose();
|
||||
}}
|
||||
_hover={{ bg: 'rgba(0, 0, 0, 0.05)' }}
|
||||
|
@@ -49,7 +49,7 @@ const InputTextArea: React.FC<InputTextAreaProps> = observer(
|
||||
color="text.primary"
|
||||
borderRadius="20px"
|
||||
border="none"
|
||||
placeholder="Free my mind..."
|
||||
placeholder="To Gilligan's island!"
|
||||
_placeholder={{
|
||||
color: 'gray.400',
|
||||
textWrap: 'nowrap',
|
||||
|
@@ -9,7 +9,7 @@ export function formatConversationMarkdown(messages: Instance<typeof IMessage>[]
|
||||
if (message.role === 'user') {
|
||||
return `**You**: ${message.content}`;
|
||||
} else if (message.role === 'assistant') {
|
||||
return `**open-gsio**: ${message.content}`;
|
||||
return `**yachtpit-ai**: ${message.content}`;
|
||||
}
|
||||
return '';
|
||||
})
|
||||
|
@@ -51,7 +51,7 @@ const MessageBubble = observer(({ msg, scrollRef }) => {
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
const [isHovered, setIsHovered] = useState(false);
|
||||
const isUser = msg.role === 'user';
|
||||
const senderName = isUser ? 'You' : 'open-gsio';
|
||||
const senderName = isUser ? 'You' : 'yachtpit-ai';
|
||||
const isLoading = !msg.content || !(msg.content.trim().length > 0);
|
||||
const messageRef = useRef();
|
||||
|
||||
|
@@ -104,7 +104,7 @@ describe('MessageBubble', () => {
|
||||
it('should render assistant message correctly', () => {
|
||||
render(<MessageBubble msg={mockAssistantMessage} scrollRef={mockScrollRef} />);
|
||||
|
||||
expect(screen.getByText('open-gsio')).toBeInTheDocument();
|
||||
expect(screen.getByText('yachtpit-ai')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('message-content')).toHaveTextContent('Assistant response');
|
||||
});
|
||||
|
||||
|
@@ -3,13 +3,16 @@ import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { useComponent } from '../contexts/ComponentContext.tsx';
|
||||
|
||||
// import { BevyScene } from './BevyScene.tsx';
|
||||
import { BevyScene } from './BevyScene.tsx';
|
||||
import Tweakbox from './Tweakbox.tsx';
|
||||
|
||||
export const LandingComponent: React.FC = () => {
|
||||
const [speed, setSpeed] = useState(0.2);
|
||||
const [intensity, setIntensity] = useState(0.99);
|
||||
const [mapActive, setMapActive] = useState(false);
|
||||
const [aiActive, setAiActive] = useState(true);
|
||||
const [glow, setGlow] = useState(false);
|
||||
const [bevyScene, setBevyScene] = useState(true);
|
||||
const [mapActive, setMapActive] = useState(true);
|
||||
const [aiActive, setAiActive] = useState(false);
|
||||
|
||||
const component = useComponent();
|
||||
const { setEnabledComponent } = component;
|
||||
@@ -24,8 +27,22 @@ export const LandingComponent: React.FC = () => {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Box as="section" bg="background.primary" overflow="hidden">
|
||||
<Box position="fixed" right={0} maxWidth="300px" minWidth="200px" zIndex={1000}>
|
||||
<Box
|
||||
as="section"
|
||||
bg="background.primary"
|
||||
w="100%"
|
||||
h="100vh"
|
||||
overflow="hidden"
|
||||
position="relative"
|
||||
>
|
||||
<Box
|
||||
position="fixed"
|
||||
bottom="100x"
|
||||
right="12px"
|
||||
maxWidth="300px"
|
||||
minWidth="200px"
|
||||
zIndex={1000}
|
||||
>
|
||||
<Tweakbox
|
||||
sliders={{
|
||||
intensity: {
|
||||
@@ -39,6 +56,13 @@ export const LandingComponent: React.FC = () => {
|
||||
},
|
||||
}}
|
||||
switches={{
|
||||
bevyScene: {
|
||||
value: bevyScene,
|
||||
onChange(enabled) {
|
||||
setBevyScene(enabled);
|
||||
},
|
||||
label: 'Instruments',
|
||||
},
|
||||
GpsMap: {
|
||||
value: mapActive,
|
||||
onChange(enabled) {
|
||||
@@ -50,7 +74,7 @@ export const LandingComponent: React.FC = () => {
|
||||
}
|
||||
setMapActive(enabled);
|
||||
},
|
||||
label: 'GPS',
|
||||
label: 'Map',
|
||||
},
|
||||
AI: {
|
||||
value: aiActive,
|
||||
@@ -68,7 +92,7 @@ export const LandingComponent: React.FC = () => {
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
{/*<BevyScene speed={speed} intensity={intensity} glow={glow} visible={bevyScene} />*/}
|
||||
<BevyScene speed={speed} intensity={intensity} glow={glow} visible={bevyScene} />
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
@@ -37,7 +37,7 @@ const key =
|
||||
function Map(props: { visible: boolean }) {
|
||||
return (
|
||||
/* Full-screen wrapper — fills the viewport and becomes the positioning context */
|
||||
<Box position={'absolute'} top={0} w="100vw" h={'100vh'} overflow="hidden">
|
||||
<Box w="100%" h="100vh" position="relative" overflow="hidden">
|
||||
{/* Button bar — absolutely positioned inside the wrapper */}
|
||||
|
||||
<MapNext mapboxPublicKey={atob(key)} />
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Box } from '@chakra-ui/react';
|
||||
import { Box, Button, HStack, Input } from '@chakra-ui/react';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import Map, {
|
||||
FullscreenControl,
|
||||
@@ -118,10 +118,11 @@ Type '{ city: string; population: string; image: string; state: string; latitude
|
||||
right: 0,
|
||||
}}
|
||||
>
|
||||
<GeolocateControl position="top-left" style={{ marginTop: '6rem' }} />
|
||||
<GeolocateControl position="top-left" />
|
||||
<FullscreenControl position="top-left" />
|
||||
<NavigationControl position="top-left" />
|
||||
<ScaleControl position="top-left" />
|
||||
|
||||
{pins}
|
||||
|
||||
{popupInfo && (
|
||||
|
@@ -6,7 +6,7 @@ import { useIsMobile } from '../components/contexts/MobileContext';
|
||||
function Content({ children }) {
|
||||
const isMobile = useIsMobile();
|
||||
return (
|
||||
<Flex flexDirection="column" w="100%" h="100vh">
|
||||
<Flex flexDirection="column" w="100%" h="100vh" p={!isMobile ? 4 : 1}>
|
||||
{children}
|
||||
</Flex>
|
||||
);
|
||||
|
@@ -1,6 +1,4 @@
|
||||
// runs before anything else
|
||||
import { registerSW } from 'virtual:pwa-register';
|
||||
|
||||
import UserOptionsStore from '../stores/UserOptionsStore';
|
||||
|
||||
UserOptionsStore.initialize();
|
||||
@@ -8,11 +6,7 @@ UserOptionsStore.initialize();
|
||||
try {
|
||||
const isLocal = window.location.hostname.includes('localhost');
|
||||
if (!isLocal) {
|
||||
if ('serviceWorker' in navigator) {
|
||||
// && !/localhost/.test(window.location)) {
|
||||
registerSW();
|
||||
}
|
||||
// navigator.serviceWorker.register('/service-worker.js');
|
||||
navigator.serviceWorker.register('/service-worker.js');
|
||||
} else {
|
||||
(async () => {
|
||||
await navigator.serviceWorker.getRegistrations().then(registrations => {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Box } from '@chakra-ui/react';
|
||||
import { Box, Grid, GridItem, Stack } from '@chakra-ui/react';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
import Chat from '../../components/chat/Chat.tsx';
|
||||
@@ -22,26 +22,27 @@ export default function IndexPage() {
|
||||
const component = useComponent();
|
||||
|
||||
return (
|
||||
<Box height="100%" width="100%">
|
||||
<LandingComponent />
|
||||
|
||||
<Box
|
||||
display={component.enabledComponent === 'ai' ? undefined : 'none'}
|
||||
width="100%"
|
||||
height="100%"
|
||||
overflowY="scroll"
|
||||
padding={'unset'}
|
||||
>
|
||||
<Chat />
|
||||
</Box>
|
||||
<Box
|
||||
display={component.enabledComponent === 'gpsmap' ? undefined : 'none'}
|
||||
width="100%"
|
||||
height="100%"
|
||||
padding={'unset'}
|
||||
>
|
||||
<ReactMap visible={component.enabledComponent === 'gpsmap'} />
|
||||
</Box>
|
||||
</Box>
|
||||
<Grid templateColumns="repeat(2, 1fr)" height="100%" width="100%" gap={0}>
|
||||
<GridItem>
|
||||
<LandingComponent />
|
||||
</GridItem>
|
||||
<GridItem p={2}>
|
||||
<Box
|
||||
display={component.enabledComponent === 'ai' ? undefined : 'none'}
|
||||
width="100%"
|
||||
height="100%"
|
||||
overflowY="scroll"
|
||||
>
|
||||
<Chat />
|
||||
</Box>
|
||||
<Box
|
||||
display={component.enabledComponent === 'gpsmap' ? undefined : 'none'}
|
||||
width="100%"
|
||||
height="100%"
|
||||
>
|
||||
<ReactMap visible={component.enabledComponent === 'gpsmap'} />
|
||||
</Box>
|
||||
</GridItem>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
export const welcome_home_text = `
|
||||
# open-gsio
|
||||
# yachtpit-ai
|
||||
---
|
||||
|
||||
<br/>
|
||||
|
@@ -22,6 +22,10 @@ const prebuildPlugin = () => ({
|
||||
console.log('Generated robots.txt -> public/robots.txt');
|
||||
child_process.execSync('bun run generate:fonts');
|
||||
console.log('Copied fonts -> public/static/fonts');
|
||||
child_process.execSync('bun run generate:bevy:bundle', {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
console.log('Bundled bevy app -> public/yachtpit.html');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@@ -10,7 +10,7 @@
|
||||
"@open-gsio/services": "workspace:*",
|
||||
"itty-router": "^5.0.18",
|
||||
"mobx": "^6.13.5",
|
||||
"mobx-state-tree": "^7.0.2",
|
||||
"mobx-state-tree": "^6.0.1",
|
||||
"vitest": "^3.1.4",
|
||||
"vite": "^6.3.5"
|
||||
}
|
||||
|
@@ -20,6 +20,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.7.2",
|
||||
"mobx-state-tree": "^7.0.2"
|
||||
"mobx-state-tree": "^6.0.1"
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@
|
||||
"itty-router": "^5.0.18",
|
||||
"jsdom": "^24.0.0",
|
||||
"mobx": "^6.13.5",
|
||||
"mobx-state-tree": "^7.0.2",
|
||||
"mobx-state-tree": "^6.0.1",
|
||||
"moo": "^0.5.2",
|
||||
"typescript": "^5.7.2",
|
||||
"vike": "0.4.235",
|
||||
|
@@ -30,7 +30,7 @@
|
||||
"itty-router": "^5.0.18",
|
||||
"jsdom": "^24.0.0",
|
||||
"mobx": "^6.13.5",
|
||||
"mobx-state-tree": "^7.0.2",
|
||||
"mobx-state-tree": "^6.0.1",
|
||||
"moo": "^0.5.2",
|
||||
"openai": "^5.0.1",
|
||||
"typescript": "^5.7.2",
|
||||
|
Reference in New Issue
Block a user