mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-07 17:31:54 +00:00
Agents can now create temporary files in the global tmp directory without triggering external_directory permission prompts. This enables agents to freely use temporary storage for intermediate files during builds and other operations.
16 lines
533 B
TypeScript
16 lines
533 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import fs from "fs/promises"
|
|
import os from "os"
|
|
import path from "path"
|
|
import { Global } from "@opencode-ai/core/global"
|
|
|
|
describe("global paths", () => {
|
|
test("tmp path is under the system temp directory", () => {
|
|
expect(Global.Path.tmp).toBe(path.join(os.tmpdir(), "opencode"))
|
|
expect(Global.make().tmp).toBe(Global.Path.tmp)
|
|
})
|
|
|
|
test("tmp path is created on module load", async () => {
|
|
expect((await fs.stat(Global.Path.tmp)).isDirectory()).toBe(true)
|
|
})
|
|
})
|