mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 09:07:40 +00:00
* feat(acp): ACP agents can run with a private per-process temp folder * feat(acp): a reclamation primitive removes all but the kept managed runtime release The installer calls it while it owns the runtime's installs and launches; it answers the entries it could not remove so that caller can report them. Nothing calls it from adapter construction.
14 lines
635 B
TypeScript
14 lines
635 B
TypeScript
import { mkdir, mkdtemp, readdir, rm } from 'node:fs/promises'
|
|
import { tmpdir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
import { expect, it } from 'vitest'
|
|
import { reclaimRuntimeReleases } from './managed-runtime-release'
|
|
|
|
it('removes every release and leftover but the kept one', async () => {
|
|
const root = await mkdtemp(join(tmpdir(), 'orca-runtime-reclaim-'))
|
|
await Promise.all(['1.0', '0.9', '.download-1-left'].map((name) => mkdir(join(root, name))))
|
|
expect(await reclaimRuntimeReleases(root, '1.0')).toEqual([])
|
|
expect(await readdir(root)).toEqual(['1.0'])
|
|
await rm(root, { recursive: true, force: true })
|
|
})
|