mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
feat: add multi-run fusion and session change walkthroughs
Fuse two to five completed multi-run entries into one synthesized session, and explain a session's diff as ordered walkthrough stops cached by diff hash. - Multi-run fusion service, persistence, routes and FuseRunDialog - Change walkthrough service, persistence, routes and ChangesWalkthroughDialog - Shared unified-diff parser plus bounded text generation, json-extract, text-truncate and service-error helpers
This commit is contained in:
1 parent
90c6ccf236
commit
b36d412ca2
66 files changed
+6228
-468
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import type { FileDiffInfo } from '@opencode-manager/shared/opencode'
|
||||
import type { OpenCodeClient } from './opencode/client'
|
||||
|
||||
export const SESSION_CHANGES_CONTEXT_LINES = 3
|
||||
|
||||
export async function readSessionChanges(client: OpenCodeClient, sessionId: string): Promise<FileDiffInfo[]> {
|
||||
const [first, last] = await Promise.all([
|
||||
client.api.message.list({ sessionID: sessionId, type: 'user', order: 'asc', limit: 1 }),
|
||||
client.api.message.list({ sessionID: sessionId, type: 'user', order: 'desc', limit: 1 }),
|
||||
])
|
||||
|
||||
const from = first.data[0]
|
||||
const to = last.data[0]
|
||||
if (!from || !to) {
|
||||
return []
|
||||
}
|
||||
|
||||
return client.api.session.diff({
|
||||
sessionID: sessionId,
|
||||
from: from.id,
|
||||
to: to.id,
|
||||
context: SESSION_CHANGES_CONTEXT_LINES,
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user