Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
feat(cloud): ask Cloud bots to push code work with a remote to a new branch (#7242)
Milind Sonif5dfbcd8f1b1
diff --git a/server/system-prompt.test.ts b/server/system-prompt.test.tsindex 4a6977e91f..bb94ac3b9c 100644--- a/server/system-prompt.test.ts+++ b/server/system-prompt.test.ts@@ -8,6 +8,7 @@ import {CONVERSATIONAL_STYLE_PROMPT,CLOUD_HOME_PLACE,CLOUD_ENGINES_HERE,+ CLOUD_PUSH_CODE_WORK,CLOUD_REUSE_INSTALLS,cloudHomePrompt,userProfileSystemPrompt,@@ -415,6 +416,16 @@ describe("cloudHomePrompt", () => {}});+ it("asks bots to push code work with a remote to a new branch, never forced, never the default branch, never secrets", () => {+ for (const tools of [true, false]) {+ const text = cloudHomePrompt(tools);+ expect(text).toContain(CLOUD_REUSE_INSTALLS + CLOUD_PUSH_CODE_WORK);+ }+ expect(CLOUD_PUSH_CODE_WORK).toMatch(/push it to a new branch/);+ expect(CLOUD_PUSH_CODE_WORK).toMatch(/never force-push, never push to the default branch/);+ expect(CLOUD_PUSH_CODE_WORK).toMatch(/never commit secrets, \.env files or installed packages/);+ });+it("says the Cloud is off their network, whatever memory says, and sends ssh through the lent computer", () => {const lent = cloudHomePrompt(true, [], [{ name: "ASH-PC", platform: "win32" }]);expect(lent).toContain("This Cloud is not on their network");diff --git a/server/system-prompt.ts b/server/system-prompt.tsindex fce4954af5..286a9fd91e 100644--- a/server/system-prompt.ts+++ b/server/system-prompt.ts@@ -200,6 +200,9 @@ export const CLOUD_ENGINES_HERE = " The AIs bots run on (Claude, Codex, Cursor a/** My Cloud's disk is its owner's: what a task already has in its folder is used again, not fetched a second time. */export const CLOUD_REUSE_INSTALLS = " Reuse, and update if needed, what is already installed or cloned in your working folder instead of installing or cloning it again, unless the person asks for a fresh copy.";+/** Work on a Cloud disk lives only there: code with a remote goes up as a branch, never over anyone's main line. */+export const CLOUD_PUSH_CODE_WORK = " When a project has a git remote you can push to, commit your work and push it to a new branch instead of leaving it only on this disk: never force-push, never push to the default branch, and never commit secrets, .env files or installed packages such as node_modules.";+/** `asks`: the person's own Cloud, whose bots ask them to turn on what their computer doesn't give now (ask_for_computer). */export function cloudHomePrompt(sharedComputerTools: boolean, synced: ReadonlyArray<{ computerName: string; pcPath: string; cloudPath: string }> = [],lent: ReadonlyArray<{ name: string; platform: "darwin" | "win32" | "linux" | null; online?: boolean; lent?: boolean; lastSeenAt?: number; typing?: boolean }> = [], asks = false): string {@@ -216,6 +219,7 @@ export function cloudHomePrompt(sharedComputerTools: boolean, synced: ReadonlyAr+ " the built-in browser and their cloud computer, a desktop in the cloud. Call it their cloud computer, as the app does. Never ask them to set up this computer or a Local VM; neither exists here."+ CLOUD_ENGINES_HERE+ CLOUD_REUSE_INSTALLS+ + CLOUD_PUSH_CODE_WORK+ syncedFoldersPrompt(synced);}