Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Merge remote-tracking branch 'origin/main' into juliusmarminge/git-integration

Julius Marminge6e3726ec32bb
diff --cc apps/desktop/src/main.ts
index 66e4b8a33,1315aeb08..de9e839fd
--- a/apps/desktop/src/main.ts
+++ b/apps/desktop/src/main.ts
@@@ -12,8 -12,9 +12,9 @@@ import { fixPath } from "./fixPath"
fixPath();
const PICK_FOLDER_CHANNEL = "desktop:pick-folder";
+ const CONTEXT_MENU_CHANNEL = "desktop:context-menu";
const ROOT_DIR = path.resolve(__dirname, "../../..");
-const BACKEND_ENTRY = path.join(ROOT_DIR, "apps/server/dist/index.js");
+const BACKEND_ENTRY = path.join(ROOT_DIR, "apps/server/dist/index.mjs");
const WEB_ENTRY = path.join(ROOT_DIR, "apps/web/dist/index.html");
const STATE_DIR = path.join(os.homedir(), ".t3", "userdata");
const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL);
diff --cc apps/web/src/store.ts
index 2ee930fbb,e5b4e9f8e..5f9c6165f
--- a/apps/web/src/store.ts
+++ b/apps/web/src/store.ts
@@@ -33,13 -33,8 +33,14 @@@ type Action
| { type: "SET_ERROR"; threadId: string; error: string | null }
| { type: "SET_THREAD_TITLE"; threadId: string; title: string }
| { type: "SET_THREAD_MODEL"; threadId: string; model: string }
+ | {
+ type: "SET_THREAD_BRANCH";
+ threadId: string;
+ branch: string | null;
+ worktreePath: string | null;
+ }
- | { type: "SET_RUNTIME_MODE"; mode: RuntimeMode };
+ | { type: "SET_RUNTIME_MODE"; mode: RuntimeMode }
+ | { type: "DELETE_THREAD"; threadId: string };
// ── State ────────────────────────────────────────────────────────────
diff --cc apps/web/src/wsNativeApi.ts
index 7e8b3ad02,257efa47a..c837bcea1
--- a/apps/web/src/wsNativeApi.ts
+++ b/apps/web/src/wsNativeApi.ts
@@@ -95,16 -96,17 +96,27 @@@ export function createWsNativeApi(): Na
openInEditor: (cwd, editor) =>
transport.request(WS_METHODS.shellOpenInEditor, { cwd, editor }),
},
+ git: {
+ listBranches: (input) => transport.request(WS_METHODS.gitListBranches, input),
+ createWorktree: (input) =>
+ transport.request(WS_METHODS.gitCreateWorktree, input),
+ removeWorktree: (input) =>
+ transport.request(WS_METHODS.gitRemoveWorktree, input),
+ createBranch: (input) => transport.request(WS_METHODS.gitCreateBranch, input),
+ checkout: (input) => transport.request(WS_METHODS.gitCheckout, input),
+ init: (input) => transport.request(WS_METHODS.gitInit, input),
+ },
+ contextMenu: {
+ show: async <T extends string>(
+ items: readonly { id: T; label: string }[],
+ position?: { x: number; y: number },
+ ): Promise<T | null> => {
+ if (window.desktopBridge) {
+ return window.desktopBridge.showContextMenu(items) as Promise<T | null>;
+ }
+ return showContextMenuFallback(items, position);
+ },
+ },
};
instance = { api, transport };
diff --cc packages/contracts/src/ipc.ts
index 0070e3100,e1f748f83..1681a0caf
--- a/packages/contracts/src/ipc.ts
+++ b/packages/contracts/src/ipc.ts
@@@ -72,12 -62,10 +72,18 @@@ export interface NativeApi
shell: {
openInEditor: (cwd: string, editor: EditorId) => Promise<void>;
};
+ git: {
+ listBranches: (input: GitListBranchesInput) => Promise<GitListBranchesResult>;
+ createWorktree: (input: GitCreateWorktreeInput) => Promise<GitCreateWorktreeResult>;
+ removeWorktree: (input: GitRemoveWorktreeInput) => Promise<void>;
+ createBranch: (input: GitCreateBranchInput) => Promise<void>;
+ checkout: (input: GitCheckoutInput) => Promise<void>;
+ init: (input: GitInitInput) => Promise<void>;
+ };
+ contextMenu: {
+ show: <T extends string>(
+ items: readonly { id: T; label: string }[],
+ position?: { x: number; y: number },
+ ) => Promise<T | null>;
+ };
}