Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Team: a member's own MausBot's main chat is its first, whatever chat is open
milind-soni1ea57b921589
diff --git a/server/cloud-team-mausbot-own-chat.e2e.test.ts b/server/cloud-team-mausbot-own-chat.e2e.test.tsindex 783a475f27..cf28ad8419 100644--- a/server/cloud-team-mausbot-own-chat.e2e.test.ts+++ b/server/cloud-team-mausbot-own-chat.e2e.test.ts@@ -57,6 +57,9 @@ it("is the person's own: private on the wire, its notes in their layer, and noboconst maus = await ownMausBot(mira);expect(maus.tasks!.find((task) => task.threadId === maus.threadId)?.private, "her main chat is marked hers").toBe(true);expect((maus as Bot & { mainThreadId?: string }).mainThreadId, "and it is still her MausBot's main chat").toBe(maus.threadId);+ const other = await team.as(mira, "POST", `/api/bots/${maus.id}/tasks`, { title: "Another chat" });+ expect(other.status).toBe(201);+ expect(((await botsOf(mira)).find((bot) => bot.id === maus.id) as Bot & { mainThreadId?: string }).mainThreadId, "a newer chat of hers doesn't become it").toBe(maus.threadId);writeFileSync(planPath(), JSON.stringify({ [maus.id]: { script: [{ key: "M-NOTE", repeat: true, match: ["MAIN-CHAT-LINE"], reply: "Noted Kestrel19.", steps: [{ tool: "memory_update", arguments: { action: "append", text: NOTE } }] },] } }));diff --git a/server/index.ts b/server/index.tsindex 7b6d7dce64..3a19599584 100644--- a/server/index.ts+++ b/server/index.ts@@ -8762,7 +8762,7 @@ function routineSourceOwner(run: Pick<RoutineRun, "botId" | "sourceThreadId" | "return group?.memberIds.includes(bot.id) ? { bot, group, threadId } : null;}-function mainThreadTasks(botId: string) { const tasks = store.tasks(botId), own = store.bot(botId)?.defaultBot?.person ? store.bot(botId)?.threadId : undefined; return CLOUD_TEAM ? tasks.filter((task) => teamHost.audienceOf(task.threadId) === "team" || task.threadId === own) : CLOUD_HOME ? tasks.filter((task) => !cloudGuestOpened(task.threadId)) : tasks; }+function mainThreadTasks(botId: string) { const tasks = store.tasks(botId), own = store.bot(botId)?.defaultBot?.person ? [...tasks].sort((a, b) => a.createdAt - b.createdAt)[0]?.threadId : undefined; return CLOUD_TEAM ? tasks.filter((task) => teamHost.audienceOf(task.threadId) === "team" || task.threadId === own) : CLOUD_HOME ? tasks.filter((task) => !cloudGuestOpened(task.threadId)) : tasks; }function botMainThread(botId: string): string | undefined {return mainThread(mainThreadTasks(botId), store.bot(botId)?.threadId, store.bot(botId)?.mainThreadChoice);}