refactor(core): consolidate filesystem services (#30447)

This commit is contained in:
Dax
2026-06-02 16:09:26 -04:00
committed by GitHub
parent b93963e462
commit 604a5f781f
153 changed files with 2553 additions and 4312 deletions

View File

@@ -25,11 +25,6 @@ function app() {
type TestApp = ReturnType<typeof app>
type TestHandler = ReturnType<typeof HttpApiApp.webHandler>
const handlerScoped = Effect.acquireRelease(
Effect.sync(() => HttpApiApp.webHandler()),
(handler) => Effect.promise(() => handler.dispose()).pipe(Effect.ignore),
)
const request = Effect.fnUntraced(function* (
handler: TestHandler,
route: string,
@@ -69,7 +64,7 @@ describe("mcp HttpApi", () => {
() =>
Effect.gen(function* () {
const tmp = yield* TestInstance
const handler = yield* handlerScoped
const handler = HttpApiApp.webHandler()
const response = yield* request(handler, McpPaths.status, tmp.directory)
expect(response.status).toBe(200)
@@ -93,7 +88,7 @@ describe("mcp HttpApi", () => {
() =>
Effect.gen(function* () {
const tmp = yield* TestInstance
const handler = yield* handlerScoped
const handler = HttpApiApp.webHandler()
const added = yield* request(handler, McpPaths.status, tmp.directory, {
method: "POST",
headers: { "content-type": "application/json" },
@@ -139,7 +134,7 @@ describe("mcp HttpApi", () => {
() =>
Effect.gen(function* () {
const tmp = yield* TestInstance
const handler = yield* handlerScoped
const handler = HttpApiApp.webHandler()
const start = yield* request(handler, "/mcp/demo/auth", tmp.directory, { method: "POST" })
expect(start.status).toBe(400)
@@ -202,7 +197,7 @@ describe("mcp HttpApi", () => {
() =>
Effect.gen(function* () {
const tmp = yield* TestInstance
const handler = yield* handlerScoped
const handler = HttpApiApp.webHandler()
for (const input of [
{ method: "POST", route: "/mcp/missing/auth" },