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>
74 lines
1.7 KiB
TypeScript
74 lines
1.7 KiB
TypeScript
import React, { useMemo } from 'react';
|
|
import { View, Text, StyleSheet } from 'react-native';
|
|
import { parseCodeContent, ContentSegment, hasCode } from '../../utils/codeParser';
|
|
import CodeBlock, { InlineCode } from './CodeBlock';
|
|
import { Colors } from '../../constants/Colors';
|
|
|
|
interface RichContentProps {
|
|
content: string;
|
|
textStyle?: object;
|
|
}
|
|
|
|
/**
|
|
* Renders text content with syntax-highlighted code blocks and inline code
|
|
*/
|
|
export default function RichContent({ content, textStyle = {} }: RichContentProps) {
|
|
const segments = useMemo(() => parseCodeContent(content), [content]);
|
|
|
|
// If no code, just render plain text for better performance
|
|
if (!hasCode(content)) {
|
|
return (
|
|
<Text style={[styles.text, textStyle]}>
|
|
{content}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<View style={styles.container}>
|
|
{segments.map((segment, index) => (
|
|
<RenderSegment key={index} segment={segment} textStyle={textStyle} />
|
|
))}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function RenderSegment({
|
|
segment,
|
|
textStyle,
|
|
}: {
|
|
segment: ContentSegment;
|
|
textStyle: object;
|
|
}) {
|
|
switch (segment.type) {
|
|
case 'code-block':
|
|
return (
|
|
<CodeBlock
|
|
code={segment.code}
|
|
language={segment.language}
|
|
showLineNumbers={segment.code.split('\n').length > 3}
|
|
/>
|
|
);
|
|
|
|
case 'inline-code':
|
|
return <InlineCode>{segment.code}</InlineCode>;
|
|
|
|
case 'text':
|
|
return <Text style={[styles.text, textStyle]}>{segment.content}</Text>;
|
|
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flexDirection: 'column',
|
|
},
|
|
text: {
|
|
color: Colors.text,
|
|
fontSize: 14,
|
|
lineHeight: 20,
|
|
},
|
|
});
|