@runuai/host 0.9.130 → 0.9.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/task-environment/self.ts +15 -6
- package/package.json +1 -1
|
@@ -287,13 +287,22 @@ class SelfTaskEnvironmentHandle implements TaskEnvironmentHandle {
|
|
|
287
287
|
) {
|
|
288
288
|
throw new Error("self copy paths must be absolute and NUL-free");
|
|
289
289
|
}
|
|
290
|
-
// Both sides are this machine.
|
|
291
|
-
//
|
|
292
|
-
//
|
|
290
|
+
// Both sides are this machine. A directory source lands as the
|
|
291
|
+
// destination's CONTENTS, the way the machine provider's tar stream
|
|
292
|
+
// does: engine-account provisioning pre-creates the destination, and a
|
|
293
|
+
// plain `cp -a dir dest` into an existing dest nests `dest/dir/…`, so
|
|
294
|
+
// CODEX_HOME / GROK_HOME pointed at a dir without auth.json and both
|
|
295
|
+
// engines ran signed out and silent (live 2026-09-10, first codex + grok
|
|
296
|
+
// agents on a task machine). A file source copies as before. The result
|
|
297
|
+
// is chowned to the task user when this process is root, so the agents
|
|
298
|
+
// can read what was copied in for them.
|
|
299
|
+
const copy =
|
|
300
|
+
'if [ -d "$1" ]; then mkdir -p "$2" && cp -a "$1/." "$2/"; ' +
|
|
301
|
+
'else mkdir -p "$(dirname "$2")" && cp -a "$1" "$2"; fi';
|
|
293
302
|
const script =
|
|
294
|
-
request.direction === "into"
|
|
295
|
-
?
|
|
296
|
-
:
|
|
303
|
+
request.direction === "into" && this.#privileged()
|
|
304
|
+
? `${copy} && chown -R ${SELF_TASK_USER}:${SELF_TASK_USER} "$2"`
|
|
305
|
+
: copy;
|
|
297
306
|
const result = await this.exec({
|
|
298
307
|
argv: ["/bin/sh", "-c", script, "copy", request.source, request.destination],
|
|
299
308
|
user: "root",
|