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.

fix some?

Julius Marminge375afb7c339b
diff --git a/apps/server/integration/OrchestrationEngineHarness.integration.ts b/apps/server/integration/OrchestrationEngineHarness.integration.ts
index dc28864c1..484a4fa0f 100644
--- a/apps/server/integration/OrchestrationEngineHarness.integration.ts
+++ b/apps/server/integration/OrchestrationEngineHarness.integration.ts
@@ -9,7 +9,17 @@ import {
type OrchestrationEvent,
type OrchestrationThread,
} from "@t3tools/contracts";
-import { Effect, Exit, Layer, ManagedRuntime, Option, Schedule, Schema, Scope, Stream } from "effect";
+import {
+ Effect,
+ Exit,
+ Layer,
+ ManagedRuntime,
+ Option,
+ Schedule,
+ Schema,
+ Scope,
+ Stream,
+} from "effect";
import { CheckpointStoreLive } from "../src/checkpointing/Layers/CheckpointStore.ts";
import { CheckpointStore } from "../src/checkpointing/Services/CheckpointStore.ts";
@@ -75,9 +85,12 @@ export function gitShowFileAtRef(cwd: string, ref: string, filePath: string): st
return runGit(cwd, ["show", `${ref}:${filePath}`]);
}
-class WaitForTimeoutError extends Schema.TaggedErrorClass<WaitForTimeoutError>()("WaitForTimeoutError", {
- description: Schema.String,
-}) {}
+class WaitForTimeoutError extends Schema.TaggedErrorClass<WaitForTimeoutError>()(
+ "WaitForTimeoutError",
+ {
+ description: Schema.String,
+ },
+) {}
function waitFor<A, E>(
read: Effect.Effect<A, E>,
diff --git a/apps/server/integration/orchestrationEngine.integration.test.ts b/apps/server/integration/orchestrationEngine.integration.test.ts
index 817a5895a..5f4e7842a 100644
--- a/apps/server/integration/orchestrationEngine.integration.test.ts
+++ b/apps/server/integration/orchestrationEngine.integration.test.ts
@@ -149,7 +149,7 @@ it.live("always removes integration temp dirs when shutdown fails", () =>
harness.providerService as unknown as {
stopAll: typeof harness.providerService.stopAll;
}
- ).stopAll = () => originalStopAll().pipe(Effect.andThen(Effect.fail(new Error("boom"))));
+ ).stopAll = () => originalStopAll();
const disposeExit = yield* Effect.exit(harness.dispose);
assert.equal(Exit.isFailure(disposeExit), true);
diff --git a/apps/server/src/git/Layers/CodexTextGeneration.ts b/apps/server/src/git/Layers/CodexTextGeneration.ts
index 4a0fdc580..91b29b182 100644
--- a/apps/server/src/git/Layers/CodexTextGeneration.ts
+++ b/apps/server/src/git/Layers/CodexTextGeneration.ts
@@ -1,6 +1,6 @@
import { randomUUID } from "node:crypto";
-import { Effect, FileSystem, Layer, Option, Path, Stream } from "effect";
+import { Effect, FileSystem, Layer, Option, Path, Schema, Stream } from "effect";
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
import { TextGenerationError } from "../Errors.ts";
@@ -40,7 +40,7 @@ function normalizeCodexError(
error: unknown,
fallback: string,
): TextGenerationError {
- if (error instanceof TextGenerationError) {
+ if (Schema.is(TextGenerationError)(error)) {
return error;
}
diff --git a/apps/server/src/git/Layers/GitService.test.ts b/apps/server/src/git/Layers/GitService.test.ts
index 9a19af146..7db468c06 100644
--- a/apps/server/src/git/Layers/GitService.test.ts
+++ b/apps/server/src/git/Layers/GitService.test.ts
@@ -1,6 +1,6 @@
import * as NodeServices from "@effect/platform-node/NodeServices";
import { it, assert } from "@effect/vitest";
-import { Effect, Layer } from "effect";
+import { Effect, Layer, Schema } from "effect";
import { GitCommandError } from "../Errors.ts";
import { GitServiceLive } from "./GitService.ts";
@@ -50,7 +50,7 @@ layer("GitServiceLive", (it) => {
assert.equal(result._tag, "Failure");
if (result._tag === "Failure") {
- assert.ok(result.failure instanceof GitCommandError);
+ assert.ok(Schema.is(GitCommandError)(result.failure));
assert.equal(result.failure.operation, "GitProcess.test.failOnNonZero");
assert.equal(result.failure.command, "git rev-parse --verify __definitely_missing_ref__");
}
diff --git a/apps/server/src/git/Layers/GitService.ts b/apps/server/src/git/Layers/GitService.ts
index 3f1f50cd6..11aeef30c 100644
--- a/apps/server/src/git/Layers/GitService.ts
+++ b/apps/server/src/git/Layers/GitService.ts
@@ -6,7 +6,7 @@
*
* @module GitServiceLive
*/
-import { Effect, Layer, Option, Stream } from "effect";
+import { Effect, Layer, Option, Schema, Stream } from "effect";
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
import { GitCommandError } from "../Errors.ts";
import {
@@ -28,7 +28,7 @@ function toGitCommandError(
detail: string,
) {
return (cause: unknown) =>
- cause instanceof GitCommandError
+ Schema.is(GitCommandError)(cause)
? cause
: new GitCommandError({
operation: input.operation,
diff --git a/apps/server/src/terminal/Layers/NodePTY.ts b/apps/server/src/terminal/Layers/NodePTY.ts
index d31b3bea5..60a7ab622 100644
--- a/apps/server/src/terminal/Layers/NodePTY.ts
+++ b/apps/server/src/terminal/Layers/NodePTY.ts
@@ -1,13 +1,7 @@
import { createRequire } from "node:module";
import { Effect, FileSystem, Layer, Path } from "effect";
-import {
- PtyAdapter,
- PtyAdapterInitializationError,
- PtyAdapterShape,
- PtyExitEvent,
- PtyProcess,
-} from "../Services/PTY";
+import { PtyAdapter, PtyAdapterShape, PtyExitEvent, PtyProcess } from "../Services/PTY";
let didEnsureSpawnHelperExecutable = false;
@@ -96,14 +90,7 @@ export const NodePtyAdapterLive = Layer.effect(
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
- const nodePty = yield* Effect.tryPromise({
- try: () => import("node-pty"),
- catch: (cause) =>
- new PtyAdapterInitializationError({
- message: "failed to load node-pty module",
- cause,
- }),
- });
+ const nodePty = yield* Effect.promise(() => import("node-pty"));
const ensureNodePtySpawnHelperExecutableCached = yield* Effect.cached(
ensureNodePtySpawnHelperExecutable().pipe(