refactor(core): move v1 schemas into core (#30473)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { EventV2 } from "@opencode-ai/core/event"
|
||||
import { SessionID, MessageID, PartID } from "./schema"
|
||||
import { SessionLegacy } from "@opencode-ai/core/session/legacy"
|
||||
import { SessionV1 } from "@opencode-ai/core/v1/session"
|
||||
import { ProviderV2 } from "@opencode-ai/core/provider"
|
||||
import {
|
||||
APIError,
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
User,
|
||||
WithParts,
|
||||
type ToolPart,
|
||||
} from "@opencode-ai/core/session/legacy"
|
||||
} from "@opencode-ai/core/v1/session"
|
||||
|
||||
import { NamedError } from "@opencode-ai/core/util/error"
|
||||
import { APICallError, convertToModelMessages, LoadAPIKeyError, type ModelMessage, type UIMessage } from "ai"
|
||||
@@ -56,9 +56,9 @@ function truncateToolOutput(text: string, maxChars?: number) {
|
||||
}
|
||||
|
||||
export const Event = {
|
||||
Updated: SessionLegacy.Event.MessageUpdated,
|
||||
Removed: SessionLegacy.Event.MessageRemoved,
|
||||
PartUpdated: SessionLegacy.Event.PartUpdated,
|
||||
Updated: SessionV1.Event.MessageUpdated,
|
||||
Removed: SessionV1.Event.MessageRemoved,
|
||||
PartUpdated: SessionV1.Event.PartUpdated,
|
||||
PartDelta: EventV2.define({
|
||||
type: "message.part.delta",
|
||||
schema: {
|
||||
@@ -69,7 +69,7 @@ export const Event = {
|
||||
delta: Schema.String,
|
||||
},
|
||||
}),
|
||||
PartRemoved: SessionLegacy.Event.PartRemoved,
|
||||
PartRemoved: SessionV1.Event.PartRemoved,
|
||||
}
|
||||
|
||||
const Cursor = Schema.Struct({
|
||||
|
||||
Reference in New Issue
Block a user