summaryrefslogtreecommitdiffhomepage
path: root/packages/core/src
diff options
context:
space:
mode:
authorDax <[email protected]>2026-04-30 23:47:15 -0400
committerGitHub <[email protected]>2026-04-30 23:47:15 -0400
commit22839791999161c7bd84f8b17cda46a2d2cb5ade (patch)
tree8ad12db63e4761030c88d8a85caa4f3bfaf8b58b /packages/core/src
parent33f7f593eeba84de34c52779a42b24b4edfa652a (diff)
downloadopencode-22839791999161c7bd84f8b17cda46a2d2cb5ade.tar.gz
opencode-22839791999161c7bd84f8b17cda46a2d2cb5ade.zip
Preapprove agent tmp directory access (#25226)
Diffstat (limited to 'packages/core/src')
-rw-r--r--packages/core/src/global.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/core/src/global.ts b/packages/core/src/global.ts
index 42e0f1030..1acc3f47f 100644
--- a/packages/core/src/global.ts
+++ b/packages/core/src/global.ts
@@ -11,6 +11,7 @@ const data = path.join(xdgData!, app)
const cache = path.join(xdgCache!, app)
const config = path.join(xdgConfig!, app)
const state = path.join(xdgState!, app)
+const tmp = path.join(os.tmpdir(), app)
const paths = {
get home() {
@@ -22,6 +23,7 @@ const paths = {
cache,
config,
state,
+ tmp,
}
export const Path = paths
@@ -32,6 +34,7 @@ await Promise.all([
fs.mkdir(Path.data, { recursive: true }),
fs.mkdir(Path.config, { recursive: true }),
fs.mkdir(Path.state, { recursive: true }),
+ fs.mkdir(Path.tmp, { recursive: true }),
fs.mkdir(Path.log, { recursive: true }),
fs.mkdir(Path.bin, { recursive: true }),
])
@@ -44,6 +47,7 @@ export interface Interface {
readonly cache: string
readonly config: string
readonly state: string
+ readonly tmp: string
readonly bin: string
readonly log: string
}
@@ -55,6 +59,7 @@ export function make(input: Partial<Interface> = {}): Interface {
cache: Path.cache,
config: Flag.OPENCODE_CONFIG_DIR ?? Path.config,
state: Path.state,
+ tmp: Path.tmp,
bin: Path.bin,
log: Path.log,
...input,