@novaqore/atom 0.0.1 → 0.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novaqore/atom",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "description": "A full-system code agent with root-level access, built for isolated servers.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -292,9 +292,9 @@ export function ChatScreen({ version, unhinged }) {
292
292
  React.createElement(
293
293
  Text,
294
294
  { bold: true, color: "cyan" },
295
- "Atom: "
295
+ "Atom:"
296
296
  ),
297
- React.createElement(Text, null, firstLine)
297
+ React.createElement(Text, null, " ", firstLine)
298
298
  ),
299
299
  rest ? React.createElement(Text, null, rest) : null
300
300
  )
@@ -327,9 +327,9 @@ export function ChatScreen({ version, unhinged }) {
327
327
  React.createElement(
328
328
  Text,
329
329
  { color: "cyan", bold: true },
330
- "Atom: "
330
+ "Atom:"
331
331
  ),
332
- React.createElement(Text, null, firstLine)
332
+ React.createElement(Text, null, " ", firstLine)
333
333
  ),
334
334
  rest ? React.createElement(Text, null, rest) : null
335
335
  );
@@ -40,8 +40,18 @@ function balanceForStreaming(buffer) {
40
40
  return out;
41
41
  }
42
42
 
43
+ const cache = new Map();
44
+ const MAX_CACHE = 500;
45
+
43
46
  export function renderMarkdown(text, { streaming = false } = {}) {
44
47
  if (!text) return "";
45
- const input = streaming ? balanceForStreaming(text) : text;
46
- return marked.parse(input).trim();
48
+ if (streaming) {
49
+ return marked.parse(balanceForStreaming(text)).trim();
50
+ }
51
+ const cached = cache.get(text);
52
+ if (cached !== undefined) return cached;
53
+ const result = marked.parse(text).trim();
54
+ if (cache.size >= MAX_CACHE) cache.clear();
55
+ cache.set(text, result);
56
+ return result;
47
57
  }