fix: issue from structuredClone addition by using unwrap (#14359)
parent
8d781b08ce
commit
1a329ba47d
|
|
@ -2,7 +2,7 @@ import path from "path"
|
||||||
import { Global } from "@/global"
|
import { Global } from "@/global"
|
||||||
import { Filesystem } from "@/util/filesystem"
|
import { Filesystem } from "@/util/filesystem"
|
||||||
import { onMount } from "solid-js"
|
import { onMount } from "solid-js"
|
||||||
import { createStore, produce } from "solid-js/store"
|
import { createStore, produce, unwrap } from "solid-js/store"
|
||||||
import { createSimpleContext } from "../../context/helper"
|
import { createSimpleContext } from "../../context/helper"
|
||||||
import { appendFile, writeFile } from "fs/promises"
|
import { appendFile, writeFile } from "fs/promises"
|
||||||
import type { AgentPart, FilePart, TextPart } from "@opencode-ai/sdk/v2"
|
import type { AgentPart, FilePart, TextPart } from "@opencode-ai/sdk/v2"
|
||||||
|
|
@ -82,7 +82,7 @@ export const { use: usePromptHistory, provider: PromptHistoryProvider } = create
|
||||||
return store.history.at(store.index)
|
return store.history.at(store.index)
|
||||||
},
|
},
|
||||||
append(item: PromptInfo) {
|
append(item: PromptInfo) {
|
||||||
const entry = structuredClone(item)
|
const entry = structuredClone(unwrap(item))
|
||||||
let trimmed = false
|
let trimmed = false
|
||||||
setStore(
|
setStore(
|
||||||
produce((draft) => {
|
produce((draft) => {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import path from "path"
|
||||||
import { Global } from "@/global"
|
import { Global } from "@/global"
|
||||||
import { Filesystem } from "@/util/filesystem"
|
import { Filesystem } from "@/util/filesystem"
|
||||||
import { onMount } from "solid-js"
|
import { onMount } from "solid-js"
|
||||||
import { createStore, produce } from "solid-js/store"
|
import { createStore, produce, unwrap } from "solid-js/store"
|
||||||
import { createSimpleContext } from "../../context/helper"
|
import { createSimpleContext } from "../../context/helper"
|
||||||
import { appendFile, writeFile } from "fs/promises"
|
import { appendFile, writeFile } from "fs/promises"
|
||||||
import type { PromptInfo } from "./history"
|
import type { PromptInfo } from "./history"
|
||||||
|
|
@ -52,7 +52,7 @@ export const { use: usePromptStash, provider: PromptStashProvider } = createSimp
|
||||||
return store.entries
|
return store.entries
|
||||||
},
|
},
|
||||||
push(entry: Omit<StashEntry, "timestamp">) {
|
push(entry: Omit<StashEntry, "timestamp">) {
|
||||||
const stash = structuredClone({ ...entry, timestamp: Date.now() })
|
const stash = structuredClone(unwrap({ ...entry, timestamp: Date.now() }))
|
||||||
let trimmed = false
|
let trimmed = false
|
||||||
setStore(
|
setStore(
|
||||||
produce((draft) => {
|
produce((draft) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue