feat: add endpoints to delete and update message parts (#5433)

This commit is contained in:
Tommy D. Rossi
2025-12-20 16:00:20 +01:00
committed by opencode
parent 6e93d14bdb
commit a7a2bbb497
5 changed files with 425 additions and 0 deletions

View File

@@ -339,6 +339,23 @@ export namespace Session {
},
)
export const removePart = fn(
z.object({
sessionID: Identifier.schema("session"),
messageID: Identifier.schema("message"),
partID: Identifier.schema("part"),
}),
async (input) => {
await Storage.remove(["part", input.messageID, input.partID])
Bus.publish(MessageV2.Event.PartRemoved, {
sessionID: input.sessionID,
messageID: input.messageID,
partID: input.partID,
})
return input.partID
},
)
const UpdatePartInput = z.union([
MessageV2.Part,
z.object({