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.

611 B
Raw Blame
import type { Attachment, Attachments } from '@core/component/AI/types';

type HomeComposerInput = {
  attachments: Pick<Attachments, 'setAttached'>;
  setPendingDraft: (text: string | null) => void;
};

type HomeComposerEditor = {
  setMarkdown: (markdown: string) => void;
};

export function replaceHomeComposerSelection(
  input: HomeComposerInput,
  draft: string,
  attachments: Attachment[] = []
) {
  input.attachments.setAttached(attachments);
  input.setPendingDraft(draft);
}

export function replaceHomeComposerDraft(
  editor: HomeComposerEditor,
  draft: string
) {
  editor.setMarkdown(draft);
}