Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

489 B
Raw Blame
import { toXml } from '@macro-inc/lexical-core/transformers/xml';
import type { LexicalSession } from './ai-toolkit';

/** Prefix each line with a 1-indexed `N | ` gutter -- the line addressing the agents read. */
export function numberLines(text: string): string {
  return text
    .split('\n')
    .map((line, i) => `${i + 1} | ${line}`)
    .join('\n');
}

export function serializeWithXml(session: LexicalSession): string {
  return toXml(session.editor.getEditorState().toJSON());
}