Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as opaque submodule gitlinks on GitHub) into fully-tracked first-party content. AITM now merges its 7 vendored repos as first-party engines: - memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts - git: vendored C git (bundled binary) + gitnexus (in-process code intelligence) - agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess) Includes the full session's product build: Gitgram web/mobile/backend features, AITM website/CLI/MCP, the unified memory layer, engine build tooling (scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md), and extensive test suites. Build artifacts, node_modules, external/, and gemini-cli are gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
98 lines
3.0 KiB
TypeScript
98 lines
3.0 KiB
TypeScript
import { ApolloProvider, useMutation } from '@apollo/react-hooks';
|
|
import { GoogleSignin } from '@react-native-community/google-signin';
|
|
import React, { useContext, useEffect } from 'react';
|
|
import { StatusBar, StyleSheet } from 'react-native';
|
|
import codePush from 'react-native-code-push';
|
|
import FlashMessage from 'react-native-flash-message';
|
|
import { SafeAreaView } from 'react-navigation';
|
|
import Config from './app/config';
|
|
import { Errors, PollIntervals } from './app/constants';
|
|
import { AppContext, AppContextProvider } from './app/context';
|
|
import client from './app/graphql/client';
|
|
import { MUTATION_LAST_SEEN } from './app/graphql/mutation';
|
|
import AppNavigator from './app/navigation';
|
|
import { ThemeStatic, Typography } from './app/theme';
|
|
import { DynamicStatusBar } from './app/theme/Colors';
|
|
import { ThemeColors } from './app/types/theme';
|
|
import { crashlytics } from './app/utils/firebase';
|
|
import { loadThemeType } from './app/utils/storage';
|
|
import { computeUnreadMessages } from './app/utils/shared';
|
|
|
|
const { webClientId } = Config;
|
|
|
|
GoogleSignin.configure({
|
|
webClientId,
|
|
forceConsentPrompt: true
|
|
});
|
|
|
|
const SafeAreaApp = () => {
|
|
const { user, theme, themeType, toggleTheme, updateUnreadMessages } = useContext(AppContext);
|
|
const { barStyle, backgroundColor } = DynamicStatusBar[themeType];
|
|
const [updateLastSeen] = useMutation(MUTATION_LAST_SEEN);
|
|
|
|
const initializeTheme = async () => {
|
|
try {
|
|
const themeType = await loadThemeType();
|
|
toggleTheme(themeType);
|
|
} catch ({ message }) {
|
|
crashlytics.recordCustomError(Errors.LOAD_THEME, message);
|
|
}
|
|
};
|
|
|
|
useEffect(() => {
|
|
initializeTheme();
|
|
}, []);
|
|
|
|
useEffect(() => {
|
|
setInterval(async () => {
|
|
if (user.id) {
|
|
try {
|
|
const { data: { updateLastSeen: { chats } } } = await updateLastSeen({ variables: { userId: user.id } });
|
|
const unreadMessages = computeUnreadMessages(chats, user.id);
|
|
|
|
updateUnreadMessages(unreadMessages);
|
|
} catch ({ message }) {
|
|
crashlytics.recordCustomError(Errors.UPDATE_LAST_SEEN, message);
|
|
}
|
|
}
|
|
}, PollIntervals.lastSeen);
|
|
}, [user.id]);
|
|
|
|
return (
|
|
<SafeAreaView style={styles(theme).container}>
|
|
<StatusBar animated barStyle={barStyle} backgroundColor={backgroundColor} />
|
|
<AppNavigator />
|
|
<FlashMessage titleStyle={styles().flashMessageTitle} floating position='bottom' />
|
|
</SafeAreaView>
|
|
);
|
|
};
|
|
|
|
const App = () => {
|
|
return (
|
|
<ApolloProvider client={client}>
|
|
<AppContextProvider>
|
|
<SafeAreaApp />
|
|
</AppContextProvider>
|
|
</ApolloProvider>
|
|
);
|
|
};
|
|
|
|
const styles = (theme = {} as ThemeColors) => StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
backgroundColor: theme.base
|
|
},
|
|
flashMessageTitle: {
|
|
...Typography.FontWeights.Light,
|
|
...Typography.FontSizes.Body,
|
|
color: ThemeStatic.white
|
|
}
|
|
});
|
|
|
|
const CodepushApp = codePush({
|
|
deploymentKey: Config.codepush.production,
|
|
checkFrequency: codePush.CheckFrequency.ON_APP_START
|
|
})(App);
|
|
|
|
export default CodepushApp;
|