Skip to content

Commit ced5f86

Browse files
committed
Resolve v1.15.3 rebase compatibility
1 parent 1488bf1 commit ced5f86

3 files changed

Lines changed: 7 additions & 23 deletions

File tree

packages/opencode/src/mcp/index.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ import { EffectBridge } from "@/effect/bridge"
3131
import { InstanceState } from "@/effect/instance-state"
3232
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
3333
import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
34-
import { zod as effectZod } from "@opencode-ai/core/effect-zod"
35-
import { withStatics } from "@opencode-ai/core/schema"
3634
import { McpCallContext } from "./context"
3735

3836
function createContextAwareFetch(baseFetch?: typeof globalThis.fetch): typeof globalThis.fetch {
@@ -66,9 +64,7 @@ export const Resource = Schema.Struct({
6664
description: Schema.optional(Schema.String),
6765
mimeType: Schema.optional(Schema.String),
6866
client: Schema.String,
69-
})
70-
.annotate({ identifier: "McpResource" })
71-
.pipe(withStatics((s) => ({ zod: effectZod(s) })))
67+
}).annotate({ identifier: "McpResource" })
7268
export type Resource = Schema.Schema.Type<typeof Resource>
7369

7470
export const ToolsChanged = BusEvent.define(
@@ -115,9 +111,7 @@ export const Status = Schema.Union([
115111
StatusFailed,
116112
StatusNeedsAuth,
117113
StatusNeedsClientRegistration,
118-
])
119-
.annotate({ identifier: "MCPStatus", discriminator: "status" })
120-
.pipe(withStatics((s) => ({ zod: effectZod(s) })))
114+
]).annotate({ identifier: "MCPStatus", discriminator: "status" })
121115
export type Status = Schema.Schema.Type<typeof Status>
122116

123117
// Store transports for OAuth servers to allow finishing auth

packages/opencode/src/session/message-v2.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import type { SystemError } from "bun"
2222
import type { Provider } from "@/provider/provider"
2323
import { ModelID, ProviderID } from "@/provider/schema"
2424
import { Effect, Schema, Types } from "effect"
25-
import { zod } from "@opencode-ai/core/effect-zod"
26-
import { NonNegativeInt, withStatics } from "@opencode-ai/core/schema"
25+
import { NonNegativeInt } from "@opencode-ai/core/schema"
2726
import * as EffectLogger from "@opencode-ai/core/effect/logger"
2827
import { MessageError } from "./message-error"
2928
import { AuthError, OutputLengthError } from "./message-error"
@@ -277,9 +276,7 @@ export const ToolStateCompleted = Schema.Struct({
277276
}),
278277
attachments: Schema.optional(Schema.Array(FilePart)),
279278
rawOutput: Schema.optional(Schema.Any),
280-
})
281-
.annotate({ identifier: "ToolStateCompleted" })
282-
.pipe(withStatics((s) => ({ zod: zod(s) })))
279+
}).annotate({ identifier: "ToolStateCompleted" })
283280
export type ToolStateCompleted = Types.DeepMutable<Schema.Schema.Type<typeof ToolStateCompleted>>
284281

285282
function truncateToolOutput(text: string, maxChars?: number) {
@@ -298,9 +295,7 @@ export const ToolStateError = Schema.Struct({
298295
end: NonNegativeInt,
299296
}),
300297
rawError: Schema.optional(Schema.Any),
301-
})
302-
.annotate({ identifier: "ToolStateError" })
303-
.pipe(withStatics((s) => ({ zod: zod(s) })))
298+
}).annotate({ identifier: "ToolStateError" })
304299
export type ToolStateError = Types.DeepMutable<Schema.Schema.Type<typeof ToolStateError>>
305300

306301
export const ToolState = Schema.Union([
@@ -323,9 +318,7 @@ export const ToolPart = Schema.Struct({
323318
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Any)),
324319
providerExecuted: Schema.optional(Schema.Boolean),
325320
dynamic: Schema.optional(Schema.Boolean),
326-
})
327-
.annotate({ identifier: "ToolPart" })
328-
.pipe(withStatics((s) => ({ zod: zod(s) })))
321+
}).annotate({ identifier: "ToolPart" })
329322
export type ToolPart = Omit<Types.DeepMutable<Schema.Schema.Type<typeof ToolPart>>, "state"> & {
330323
state: ToolState
331324
}

packages/opencode/src/session/prompt.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import { Image } from "@/image/image"
4747
import { decodeDataUrl } from "@/util/data-url"
4848
import { Process } from "@/util/process"
4949
import { Cause, Effect, Exit, Latch, Layer, Option, Scope, Context, Schema, Types } from "effect"
50-
import { zod } from "@opencode-ai/core/effect-zod"
5150
import * as EffectLogger from "@opencode-ai/core/effect/logger"
5251
import { InstanceState } from "@/effect/instance-state"
5352
import { TaskTool, type TaskPromptOps } from "@/tool/task"
@@ -2129,9 +2128,7 @@ export class LoopInput extends Schema.Class<LoopInput>("SessionPrompt.LoopInput"
21292128
sessionID: SessionID,
21302129
mcpHeaders: Schema.optional(Schema.Record(Schema.String, Schema.String)),
21312130
additionalFields: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
2132-
}) {
2133-
static readonly zod = zod(this)
2134-
}
2131+
}) {}
21352132

21362133
export const ShellInput = Schema.Struct({
21372134
sessionID: SessionID,

0 commit comments

Comments
 (0)