fix(app): update remote sdk contracts
This commit is contained in:
parent
8db7487c89
commit
5592f5225b
20 changed files with 62 additions and 51 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { parseDiffFromFile, parsePatchFiles, type FileDiffMetadata } from "@pierre/diffs"
|
||||
import { parsePatch } from "diff"
|
||||
import type { FileDiffInfo, VcsFileDiff } from "@opencode-ai/sdk/v2"
|
||||
import type { SnapshotFileDiff, VcsFileDiff } from "@opencode-ai/sdk/v2"
|
||||
|
||||
type LegacyDiff = {
|
||||
file: string
|
||||
|
|
@ -12,7 +12,7 @@ type LegacyDiff = {
|
|||
status?: "added" | "deleted" | "modified"
|
||||
}
|
||||
|
||||
type ReviewDiff = FileDiffInfo | VcsFileDiff | LegacyDiff
|
||||
type ReviewDiff = (SnapshotFileDiff | VcsFileDiff | LegacyDiff) & { file: string }
|
||||
export type DiffSource = Pick<LegacyDiff, "file" | "patch" | "before" | "after">
|
||||
|
||||
export type ViewDiff = {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import { getDirectory, getFilename } from "@opencode-ai/core/util/path"
|
|||
import { checksum } from "@opencode-ai/core/util/encode"
|
||||
import { createEffect, createMemo, For, Match, onCleanup, Show, Switch, untrack, type JSX } from "solid-js"
|
||||
import { createStore } from "solid-js/store"
|
||||
import { type FileContent, type FileDiffInfo, type VcsFileDiff } from "@opencode-ai/sdk/v2"
|
||||
import { type FileContent, type SnapshotFileDiff, type VcsFileDiff } from "@opencode-ai/sdk/v2"
|
||||
import { PreloadMultiFileDiffResult } from "@pierre/diffs/ssr"
|
||||
import { type SelectedLineRange } from "@pierre/diffs"
|
||||
import { Dynamic } from "solid-js/web"
|
||||
|
|
@ -62,10 +62,12 @@ export type SessionReviewCommentActions = {
|
|||
|
||||
export type SessionReviewFocus = { file: string; id: string }
|
||||
|
||||
type RawReviewDiff = (FileDiffInfo | VcsFileDiff) & {
|
||||
type RawReviewDiff = (SnapshotFileDiff | VcsFileDiff) & {
|
||||
file: string
|
||||
preloaded?: PreloadMultiFileDiffResult<any>
|
||||
}
|
||||
type ReviewDiff = (FileDiffInfo | VcsFileDiff) & {
|
||||
type ReviewDiff = (SnapshotFileDiff | VcsFileDiff) & {
|
||||
file: string
|
||||
preloaded?: PreloadMultiFileDiffResult<any>
|
||||
}
|
||||
function diff(value: unknown): value is ReviewDiff {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
AssistantMessage,
|
||||
type FileDiffInfo,
|
||||
type SnapshotFileDiff,
|
||||
Message as MessageType,
|
||||
Part as PartType,
|
||||
type UserMessage,
|
||||
|
|
@ -92,7 +92,7 @@ function list<T>(value: T[] | undefined | null, fallback: T[]) {
|
|||
}
|
||||
|
||||
type SummaryDiffInput = NonNullable<NonNullable<UserMessage["summary"]>["diffs"]>[number]
|
||||
type SummaryDiff = FileDiffInfo
|
||||
type SummaryDiff = SnapshotFileDiff & { file: string; patch: string }
|
||||
|
||||
function summaryDiff(value: SummaryDiffInput): value is SummaryDiff {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { FileDiffInfo, Message, Part, Provider, Session, SessionStatus } from "@opencode-ai/sdk/v2"
|
||||
import type { Message, Part, Provider, Session, SessionStatus, SnapshotFileDiff } from "@opencode-ai/sdk/v2"
|
||||
import { createSimpleContext } from "@opencode-ai/ui/context"
|
||||
import { PreloadMultiFileDiffResult } from "@pierre/diffs/ssr"
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ type Data = {
|
|||
[sessionID: string]: SessionStatus
|
||||
}
|
||||
session_diff: {
|
||||
[sessionID: string]: FileDiffInfo[]
|
||||
[sessionID: string]: SnapshotFileDiff[]
|
||||
}
|
||||
session_diff_preload?: {
|
||||
[sessionID: string]: PreloadMultiFileDiffResult<any>[]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { useFileComponent } from "@opencode-ai/ui/context/file"
|
|||
import { useI18n } from "@opencode-ai/ui/context/i18n"
|
||||
import { mediaKindFromPath } from "../../pierre/media"
|
||||
import { cloneSelectedLineRange, previewSelectedLines } from "../../pierre/selection-bridge"
|
||||
import type { FileContent, FileDiffInfo, VcsFileDiff } from "@opencode-ai/sdk/v2"
|
||||
import type { FileContent, SnapshotFileDiff, VcsFileDiff } from "@opencode-ai/sdk/v2"
|
||||
import { createEffect, createMemo, onCleanup, Show, untrack } from "solid-js"
|
||||
import { createStore } from "solid-js/store"
|
||||
import { Dynamic } from "solid-js/web"
|
||||
|
|
@ -27,7 +27,7 @@ import { LineCommentV2OverflowIcon } from "@opencode-ai/ui/v2/line-comment-v2"
|
|||
import { MenuV2 } from "@opencode-ai/ui/v2/menu-v2"
|
||||
import "./session-review-v2.css"
|
||||
|
||||
type ReviewDiff = FileDiffInfo | VcsFileDiff
|
||||
type ReviewDiff = (SnapshotFileDiff | VcsFileDiff) & { file: string }
|
||||
|
||||
export type SessionReviewFilePreviewV2Props = {
|
||||
file: string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue