mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-26 15:55:45 +00:00
17 lines
442 B
TypeScript
17 lines
442 B
TypeScript
import { PartID } from "@/session/schema"
|
|
import type { PromptInfo } from "./history"
|
|
|
|
type Item = PromptInfo["parts"][number]
|
|
|
|
export function strip(part: Item & { id: string; messageID: string; sessionID: string }): Item {
|
|
const { id: _id, messageID: _messageID, sessionID: _sessionID, ...rest } = part
|
|
return rest
|
|
}
|
|
|
|
export function assign(part: Item): Item & { id: PartID } {
|
|
return {
|
|
...part,
|
|
id: PartID.ascending(),
|
|
}
|
|
}
|