mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +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
@@ -1,6 +1,6 @@
|
||||
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
|
||||
import { spawn, spawnSync } from 'child_process'
|
||||
import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'fs'
|
||||
import { chmodSync, copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { tmpdir } from 'os'
|
||||
import { repoRoot } from '../helpers/repo-root'
|
||||
@@ -54,13 +54,16 @@ afterEach(() => {
|
||||
rmSync(workDir, { recursive: true, force: true })
|
||||
})
|
||||
|
||||
const runInstaller = (env: Record<string, string> = {}) =>
|
||||
const runInstaller = (
|
||||
env: Record<string, string> = {},
|
||||
path = `${stubDir}:/usr/bin:/bin`,
|
||||
) =>
|
||||
new Promise<{ status: number | null; stdout: string; stderr: string }>((resolve, reject) => {
|
||||
const child = spawn('sh', [installerPath], {
|
||||
const child = spawn('/bin/sh', [installerPath], {
|
||||
detached: true,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
env: {
|
||||
PATH: `${stubDir}:/usr/bin:/bin`,
|
||||
PATH: path,
|
||||
HOME: workDir,
|
||||
OCM_DIR: installDir,
|
||||
OCM_STUB_LOG: logPath,
|
||||
@@ -157,9 +160,11 @@ describe('install.sh', () => {
|
||||
})
|
||||
|
||||
it('stops before downloading anything when Docker is missing', async () => {
|
||||
rmSync(join(stubDir, 'docker'))
|
||||
const isolatedBin = join(workDir, 'isolated-bin')
|
||||
mkdirSync(isolatedBin)
|
||||
copyFileSync(join(stubDir, 'curl'), join(isolatedBin, 'curl'))
|
||||
|
||||
const res = await runInstaller()
|
||||
const res = await runInstaller({}, isolatedBin)
|
||||
|
||||
expect(res.status).toBe(1)
|
||||
expect(res.stderr).toContain('Docker is required')
|
||||
|
||||
Reference in new issue
Block a user