fix some?
This commit is contained in:
1 parent
a2330938d6
commit
375afb7c33
6 files changed
+26
-26
No files matched your search
@@ -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>,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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__");
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user