@factiii/runner 0.0.1 → 0.2.0

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.
Files changed (3) hide show
  1. package/Dockerfile.claude +25 -3
  2. package/dist/cli.js +2633 -838
  3. package/package.json +3 -1
package/Dockerfile.claude CHANGED
@@ -1,11 +1,33 @@
1
- FROM node:20-alpine
2
- RUN apk add --no-cache git bash sudo curl
3
- RUN adduser -D claude && echo "claude ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
1
+ FROM node:20-bookworm-slim
2
+ RUN apt-get update && apt-get install -y --no-install-recommends \
3
+ git bash sudo curl tmux ca-certificates xz-utils fuse3 \
4
+ && rm -rf /var/lib/apt/lists/*
5
+ # Keep downloaded .debs so the /cache-backed apt archive persists across
6
+ # sessions (debian-slim's docker-clean hook wipes them otherwise).
7
+ RUN rm -f /etc/apt/apt.conf.d/docker-clean \
8
+ && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' \
9
+ > /etc/apt/apt.conf.d/keep-cache
10
+ RUN useradd -m -s /bin/bash claude \
11
+ && echo "claude ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
4
12
  RUN npm install -g @anthropic-ai/claude-code@~2.1.0
5
13
  RUN mkdir -p /cache && chown claude:claude /cache
6
14
 
15
+ # Nix (single-user, owned by `claude`) for prebuilt runtime/tool installs at run
16
+ # time: `nix profile install nixpkgs#<pkg>`. Pulls prebuilt binaries from the
17
+ # Nix cache — databases included, no compiler. /nix is a persistent volume
18
+ # (mounted by the runner) so installs are cached across sessions.
19
+ RUN mkdir -m 0755 /nix && chown claude:claude /nix
20
+
7
21
  # frpc is `docker cp`'d in at runtime by the runner (only when public previews
8
22
  # are enabled). See shared/all/helpers/card-ai/frpc.ts.
9
23
 
10
24
  USER claude
25
+ ENV USER=claude
26
+ RUN curl -L https://nixos.org/nix/install | sh -s -- --no-daemon \
27
+ && /home/claude/.nix-profile/bin/nix --version
28
+ ENV PATH=/home/claude/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH
29
+ ENV NIX_CONFIG="experimental-features = nix-command flakes"
30
+ # Debian's apt rclone is ancient (v1.60-DEV) and botches OneDrive small-file
31
+ # uploads (multipart "Unauthenticated"). Install the current build from nixpkgs.
32
+ RUN nix profile install nixpkgs#rclone && rclone version | head -1
11
33
  WORKDIR /home/claude