Skip to content

Commit 2f3549f

Browse files
committed
Fix workspace typecheck failures
1 parent 630d0b3 commit 2f3549f

17 files changed

Lines changed: 122 additions & 64 deletions

File tree

‎apps/server/tsconfig.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"jsx": "react-jsx",
1515
"plugins": [
1616
{
17-
"name": "@effect/language-service"
17+
"name": "@effect/language-service",
18+
"diagnostics": {
19+
"globalErrorInEffectFailure": "off"
20+
}
1821
}
1922
]
2023
},

‎apps/web/src/vite-env.d.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

‎apps/web/tsconfig.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"outDir": "dist",
1010
"rootDir": ".",
1111
"jsx": "react-jsx",
12+
"typeRoots": ["../../node_modules/@types"],
1213
"plugins": [
1314
{
1415
"name": "@effect/language-service"

‎apps/web/vite.config.ts‎

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,22 @@ const toWebRequest = async (
3838
const host = req.headers.host ?? "localhost";
3939
const url = `http://${host}${req.url}`;
4040

41-
return new Request(url, {
42-
method: req.method,
43-
headers,
44-
body:
45-
req.method !== "GET" && req.method !== "HEAD"
46-
? (await new Promise<Buffer>((resolve) => {
47-
const chunks: Buffer[] = [];
48-
req.on("data", (c: Buffer) => chunks.push(c));
49-
req.on("end", () => resolve(Buffer.concat(chunks)));
50-
}) as unknown as BodyInit)
51-
: undefined,
52-
duplex: "half" as const,
53-
});
41+
return new Request(
42+
url,
43+
{
44+
method: req.method,
45+
headers,
46+
body:
47+
req.method !== "GET" && req.method !== "HEAD"
48+
? (await new Promise<Buffer>((resolve) => {
49+
const chunks: Buffer[] = [];
50+
req.on("data", (c: Buffer) => chunks.push(c));
51+
req.on("end", () => resolve(Buffer.concat(chunks)));
52+
}) as unknown as BodyInit)
53+
: undefined,
54+
duplex: "half" as const,
55+
} as RequestInit & { duplex: "half" },
56+
);
5457
};
5558

5659
// Pipe a Web Response back to a Node ServerResponse, streaming if needed

‎bun.lock‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/core/execution/src/engine.ts‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Effect } from "effect";
2+
import * as Data from "effect/Data";
23

34
import type {
45
Executor,
@@ -123,6 +124,12 @@ export const formatPausedExecution = (paused: PausedExecution): {
123124
// Full invoker (base + discover + describe)
124125
// ---------------------------------------------------------------------------
125126

127+
class DescribeToolPathRequiredError extends Data.TaggedError(
128+
"DescribeToolPathRequiredError",
129+
)<{
130+
readonly message: string;
131+
}> {}
132+
126133
const makeFullInvoker = (
127134
executor: Executor,
128135
invokeOptions: InvokeOptions,
@@ -136,7 +143,13 @@ const makeFullInvoker = (
136143
}
137144
if (path === "describe.tool") {
138145
const input = (args ?? {}) as { path?: string };
139-
if (!input.path) return Effect.fail(new Error("describe.tool requires a path"));
146+
if (!input.path) {
147+
return Effect.fail(
148+
new DescribeToolPathRequiredError({
149+
message: "describe.tool requires a path",
150+
}),
151+
);
152+
}
140153
return describeTool(executor, input.path);
141154
}
142155
return base.invoke({ path, args });

‎packages/core/execution/src/tool-invoker.ts‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import { Effect } from "effect";
2+
import * as Data from "effect/Data";
23
import type { Executor, ToolId, ToolMetadata, ToolSchema, InvokeOptions } from "@executor/sdk";
34
import type { SandboxToolInvoker } from "@executor/codemode-core";
45

6+
class ToolApprovalDeclinedError extends Data.TaggedError(
7+
"ToolApprovalDeclinedError",
8+
)<{
9+
readonly toolId: ToolId;
10+
readonly action: "decline" | "cancel";
11+
readonly message: string;
12+
}> {}
13+
514
/**
615
* Bridges QuickJS `tools.someSource.someOp(args)` calls into
716
* `executor.tools.invoke(toolId, args)`.
@@ -19,9 +28,11 @@ export const makeExecutorToolInvoker = (
1928
).pipe(
2029
Effect.catchTag("ElicitationDeclinedError", (err) =>
2130
Effect.fail(
22-
new Error(
23-
`Tool "${err.toolId}" requires approval but the request was ${err.action === "cancel" ? "cancelled" : "declined"} by the user.`,
24-
),
31+
new ToolApprovalDeclinedError({
32+
toolId: err.toolId,
33+
action: err.action,
34+
message: `Tool "${err.toolId}" requires approval but the request was ${err.action === "cancel" ? "cancelled" : "declined"} by the user.`,
35+
}),
2536
),
2637
),
2738
);

‎packages/plugins/graphql/src/sdk/plugin.ts‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import {
1717

1818
import { introspect, parseIntrospectionJson, type IntrospectionResult, type IntrospectionType, type IntrospectionField } from "./introspect";
1919
import { extract } from "./extract";
20+
import {
21+
GraphqlExtractionError,
22+
} from "./errors";
2023
import { makeGraphqlInvoker } from "./invoke";
2124
import type { GraphqlOperationStore } from "./operation-store";
2225
import { makeInMemoryOperationStore } from "./kv-operation-store";
@@ -399,10 +402,12 @@ export const graphqlPlugin = (options?: {
399402
addSource: (config: GraphqlSourceConfig) =>
400403
addSourceInternal(config).pipe(
401404
Effect.map(({ toolCount }) => ({ toolCount })),
402-
Effect.catchAll((err) =>
403-
Effect.fail(
404-
err instanceof Error ? err : new Error(String(err)),
405-
),
405+
Effect.mapError(
406+
(err) =>
407+
new GraphqlExtractionError({
408+
message:
409+
err instanceof Error ? err.message : String(err),
410+
}),
406411
),
407412
),
408413

‎packages/plugins/graphql/tsconfig.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
{
1616
"name": "@effect/language-service",
1717
"diagnostics": {
18-
"preferSchemaOverJson": "off"
18+
"preferSchemaOverJson": "off",
19+
"globalErrorInEffectFailure": "off"
1920
}
2021
}
2122
]

‎packages/plugins/mcp/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@effect/vitest": "catalog:",
6060
"@types/node": "catalog:",
6161
"bun-types": "catalog:",
62-
"vitest": "catalog:"
62+
"vitest": "catalog:",
63+
"zod": "^4.3.6"
6364
}
6465
}

0 commit comments

Comments
 (0)