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.

fmt

Julius Marminge060a8cef00de
diff --git a/apps/server/src/codexTextGenerator.ts b/apps/server/src/codexTextGenerator.ts
index 51166b380..ebc92ac9a 100644
--- a/apps/server/src/codexTextGenerator.ts
+++ b/apps/server/src/codexTextGenerator.ts
@@ -12,11 +12,13 @@ import type {
} from "./coreServices";
import { type ProcessRunOptions, type ProcessRunResult, runProcess } from "./processRunner";
-type ProcessRunner = (
- command: string,
- args: readonly string[],
- options?: ProcessRunOptions,
-) => Promise<ProcessRunResult>;
+interface ProcessRunner {
+ (
+ command: string,
+ args: readonly string[],
+ options?: ProcessRunOptions,
+ ): Promise<ProcessRunResult>;
+}
const CODEX_MODEL = "gpt-5.3-codex";
const CODEX_REASONING_EFFORT = "low";
diff --git a/apps/server/src/git.ts b/apps/server/src/git.ts
index a9a7aa062..bf84176a0 100644
--- a/apps/server/src/git.ts
+++ b/apps/server/src/git.ts
@@ -29,7 +29,7 @@ export interface TerminalCommandInput {
maxOutputBytes?: number;
}
-export type TerminalCommandResult = ProcessRunResult;
+
export interface GitStatusDetails extends Omit<GitStatusResult, "openPr"> {
upstreamRef: string | null;
@@ -159,7 +159,7 @@ function normalizeGitSpawnError(cwd: string, error: unknown): Error {
return new Error(`Failed to run git command: ${error.message}`);
}
-function normalizeGitExecutionError(args: readonly string[], result: TerminalCommandResult): Error {
+function normalizeGitExecutionError(args: readonly string[], result: ProcessRunResult): Error {
const stderr = result.stderr.trim();
if (stderr.toLowerCase().includes("not a git repository")) {
return new Error("Current folder is not a git repository.");
@@ -176,8 +176,8 @@ async function runGitOrThrow(
cwd: string,
args: readonly string[],
options: RunGitOptions = {},
-): Promise<TerminalCommandResult> {
- let result: TerminalCommandResult;
+): Promise<ProcessRunResult> {
+ let result: ProcessRunResult;
try {
result = await runGit(args, cwd, options.timeoutMs);
} catch (error) {
@@ -197,7 +197,7 @@ async function executeGit(
cwd: string,
args: readonly string[],
options: ExecuteGitOptions = {},
-): Promise<TerminalCommandResult> {
+): Promise<ProcessRunResult> {
const result = await runGitOrThrow(cwd, args, {
timeoutMs: options.timeoutMs,
allowNonZeroExit: true,
@@ -680,7 +680,7 @@ const defaultGitCoreService = new GitCoreService();
export async function runTerminalCommand(
input: TerminalCommandInput,
-): Promise<TerminalCommandResult> {
+): Promise<ProcessRunResult> {
const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES;
const shellPath =
process.platform === "win32"
diff --git a/apps/server/src/orchestration/Layer.ts b/apps/server/src/orchestration/Layer.ts
index bd36e701c..1edacd925 100644
--- a/apps/server/src/orchestration/Layer.ts
+++ b/apps/server/src/orchestration/Layer.ts
@@ -17,10 +17,10 @@ import {
import { createEmptyReadModel, reduceEvent } from "./reducer.ts";
import { OrchestrationEngineService, type OrchestrationEngineShape } from "./Service.ts";
-type CommandEnvelope = {
+interface CommandEnvelope {
command: OrchestrationCommand;
result: Deferred.Deferred<{ sequence: number }, OrchestrationDispatchError>;
-};
+}
function mapCommandToEvent(command: OrchestrationCommand): Omit<OrchestrationEvent, "sequence"> {
const eventId = crypto.randomUUID();
diff --git a/apps/server/src/persistence/Layers/OrchestrationEvents.ts b/apps/server/src/persistence/Layers/OrchestrationEvents.ts
index bbbc26c84..bd9f0bd7c 100644
--- a/apps/server/src/persistence/Layers/OrchestrationEvents.ts
+++ b/apps/server/src/persistence/Layers/OrchestrationEvents.ts
@@ -30,8 +30,6 @@ const EventRowSchema = Schema.Struct({
payloadJson: Schema.String,
});
-type EventRow = Schema.Schema.Type<typeof EventRowSchema>;
-
const AppendEventRequestSchema = Schema.Struct({
eventId: Schema.String,
type: Schema.String,
@@ -48,7 +46,7 @@ const ReadFromSequenceRequestSchema = Schema.Struct({
});
function eventRowToOrchestrationEvent(
- row: EventRow,
+ row: Schema.Schema.Type<typeof EventRowSchema>,
operation: string,
): Effect.Effect<OrchestrationEvent, OrchestrationEventRepositoryError> {
return Effect.try({
diff --git a/apps/server/src/persistence/Layers/Projects.ts b/apps/server/src/persistence/Layers/Projects.ts
index e38ef3458..fd6426ecb 100644
--- a/apps/server/src/persistence/Layers/Projects.ts
+++ b/apps/server/src/persistence/Layers/Projects.ts
@@ -44,8 +44,6 @@ const ProjectRowSchema = Schema.Struct({
updatedAt: Schema.String,
});
-type ProjectRow = Schema.Schema.Type<typeof ProjectRowSchema>;
-
const FindByIdRequestSchema = Schema.Struct({
id: Schema.String,
});
@@ -137,7 +135,7 @@ function decodeScriptsJson(
}
function rowToProjectRecord(
- row: ProjectRow,
+ row: Schema.Schema.Type<typeof ProjectRowSchema>,
operation: string,
): Effect.Effect<ProjectRecord, ProjectRepositoryError> {
return decodeScriptsJson(row.scriptsJson, `${operation}:scripts`).pipe(
diff --git a/apps/server/src/terminalManager.ts b/apps/server/src/terminalManager.ts
index dcdf78615..05217e90a 100644
--- a/apps/server/src/terminalManager.ts
+++ b/apps/server/src/terminalManager.ts
@@ -69,7 +69,10 @@ interface ShellCandidate {
args?: string[];
}
-type TerminalStartInput = TerminalOpenInput & { cols: number; rows: number };
+interface TerminalStartInput extends TerminalOpenInput {
+ cols: number;
+ rows: number
+};
function defaultShellResolver(): string {
if (process.platform === "win32") {