Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

refactor(desktop): keep the files a message sends in their own module

leepokai66bdfec1230f
diff --git a/apps/desktop/src/renderer/store/bot-store.ts b/apps/desktop/src/renderer/store/bot-store.ts
index 50d329d6..eb39acf6 100644
--- a/apps/desktop/src/renderer/store/bot-store.ts
+++ b/apps/desktop/src/renderer/store/bot-store.ts
@@ -23,16 +23,10 @@ import { FileDownloads } from './file-downloads'
import { BotSections } from './bot-sections'
import { DevServerCommands } from './dev-servers'
import { BotSync, sleep } from './bot-sync'
+import type { OutgoingFile } from './outgoing-files.ts'
export { builtInBackendName, type Connection } from './bot-mirror'
-/** A file picked in the composer, sent with the next message. */
-export interface OutgoingFile {
- id: string
- name: string
- data: Uint8Array
-}
-
/** What a message carries besides its text; `replyTo` shows on the bubble until the computer's own quote replaces it. */
export interface SendOptions {
files?: OutgoingFile[]
@@ -43,9 +37,6 @@ export interface SendOptions {
call?: string | null
}
-/** Anything larger is refused by the computer. */
-export const MAX_FILE_SIZE = 100 * 1024 * 1024
-
export const QUICK_REACTIONS = ['👍', '❤️', '😂', '🎉', '👀', '✅']
/**
diff --git a/apps/desktop/src/renderer/store/outgoing-files.ts b/apps/desktop/src/renderer/store/outgoing-files.ts
new file mode 100644
index 00000000..34af06d2
--- /dev/null
+++ b/apps/desktop/src/renderer/store/outgoing-files.ts
@@ -0,0 +1,9 @@
+/** A file picked in the composer, sent with the next message. */
+export interface OutgoingFile {
+ id: string
+ name: string
+ data: Uint8Array
+}
+
+/** Anything larger is refused by the computer. */
+export const MAX_FILE_SIZE = 100 * 1024 * 1024
diff --git a/apps/desktop/src/renderer/views/thread/Composer.tsx b/apps/desktop/src/renderer/views/thread/Composer.tsx
index edce5238..76d7beb3 100644
--- a/apps/desktop/src/renderer/views/thread/Composer.tsx
+++ b/apps/desktop/src/renderer/views/thread/Composer.tsx
@@ -12,7 +12,7 @@ import { HStack, VStack } from '../../components/Stack'
import { useModel } from '../../lib/observable'
import { useTr } from '../../lib/use-language'
import { useStore } from '../../store/context'
-import { MAX_FILE_SIZE, type OutgoingFile } from '../../store/bot-store'
+import { MAX_FILE_SIZE, type OutgoingFile } from '../../store/outgoing-files'
import { pluginsFor } from '../marketplace/plugins'
import { pastedFiles, readPicked } from './composer-files'
import { composerEnter } from './composer-keyboard'
diff --git a/apps/desktop/src/renderer/views/thread/ComposerAttachment.tsx b/apps/desktop/src/renderer/views/thread/ComposerAttachment.tsx
index d9932ffe..19168b10 100644
--- a/apps/desktop/src/renderer/views/thread/ComposerAttachment.tsx
+++ b/apps/desktop/src/renderer/views/thread/ComposerAttachment.tsx
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'
import { isImageName } from '@shared/models'
import { Icon } from '../../components/Icon'
import { Text } from '../../components/Text'
-import type { OutgoingFile } from '../../store/bot-store'
+import type { OutgoingFile } from '../../store/outgoing-files'
import { attachmentSymbol } from './Attachments'
import { useTr } from '../../lib/use-language'