@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.
@@ -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. `cp -a` keeps directory trees intact
291
- // (engine-account homes), and the result is chowned to the task user so
292
- // the agents can read what was copied in for them.
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
- ? 'mkdir -p "$(dirname "$2")" && cp -a "$1" "$2" && chown -R node:node "$2"'
296
- : 'mkdir -p "$(dirname "$2")" && cp -a "$1" "$2"';
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runuai/host",
3
- "version": "0.9.130",
3
+ "version": "0.9.131",
4
4
  "description": "Uai host — runs ephemeral AI tasks in containers on a machine you control.",
5
5
  "license": "MIT",
6
6
  "author": "Uai Tech <team@runuai.com>",