create-claude-workspace 1.1.152 → 2.1.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.
- package/README.md +33 -1
- package/dist/index.js +29 -56
- package/dist/scheduler/agents/health-checker.mjs +98 -0
- package/dist/scheduler/agents/health-checker.spec.js +143 -0
- package/dist/scheduler/agents/orchestrator.mjs +149 -0
- package/dist/scheduler/agents/orchestrator.spec.js +87 -0
- package/dist/scheduler/agents/prompt-builder.mjs +204 -0
- package/dist/scheduler/agents/prompt-builder.spec.js +240 -0
- package/dist/scheduler/agents/worker-pool.mjs +137 -0
- package/dist/scheduler/agents/worker-pool.spec.js +45 -0
- package/dist/scheduler/git/ci-watcher.mjs +93 -0
- package/dist/scheduler/git/ci-watcher.spec.js +35 -0
- package/dist/scheduler/git/manager.mjs +228 -0
- package/dist/scheduler/git/manager.spec.js +198 -0
- package/dist/scheduler/git/release.mjs +117 -0
- package/dist/scheduler/git/release.spec.js +175 -0
- package/dist/scheduler/index.mjs +309 -0
- package/dist/scheduler/index.spec.js +72 -0
- package/dist/scheduler/integration.spec.js +289 -0
- package/dist/scheduler/loop.mjs +435 -0
- package/dist/scheduler/loop.spec.js +139 -0
- package/dist/scheduler/state/session.mjs +14 -0
- package/dist/scheduler/state/session.spec.js +36 -0
- package/dist/scheduler/state/state.mjs +102 -0
- package/dist/scheduler/state/state.spec.js +175 -0
- package/dist/scheduler/tasks/inbox.mjs +98 -0
- package/dist/scheduler/tasks/inbox.spec.js +168 -0
- package/dist/scheduler/tasks/parser.mjs +228 -0
- package/dist/scheduler/tasks/parser.spec.js +303 -0
- package/dist/scheduler/tasks/queue.mjs +152 -0
- package/dist/scheduler/tasks/queue.spec.js +223 -0
- package/dist/scheduler/types.mjs +20 -0
- package/dist/scheduler/util/memory.mjs +126 -0
- package/dist/scheduler/util/memory.spec.js +165 -0
- package/dist/template/.claude/{profiles/angular.md → agents/angular-engineer.md} +9 -4
- package/dist/template/.claude/{profiles/react.md → agents/react-engineer.md} +9 -4
- package/dist/template/.claude/{profiles/svelte.md → agents/svelte-engineer.md} +9 -4
- package/dist/template/.claude/{profiles/vue.md → agents/vue-engineer.md} +9 -4
- package/package.json +3 -4
- package/dist/scripts/autonomous.mjs +0 -493
- package/dist/scripts/autonomous.spec.js +0 -46
- package/dist/scripts/docker-run.mjs +0 -462
- package/dist/scripts/integration.spec.js +0 -108
- package/dist/scripts/lib/formatter.mjs +0 -309
- package/dist/scripts/lib/formatter.spec.js +0 -262
- package/dist/scripts/lib/state.mjs +0 -44
- package/dist/scripts/lib/state.spec.js +0 -59
- package/dist/template/.claude/docker/.dockerignore +0 -8
- package/dist/template/.claude/docker/Dockerfile +0 -54
- package/dist/template/.claude/docker/docker-compose.yml +0 -22
- package/dist/template/.claude/docker/docker-entrypoint.sh +0 -101
- /package/dist/{scripts/lib/types.mjs → scheduler/shared-types.mjs} +0 -0
- /package/dist/{scripts/lib → scheduler/ui}/tui.mjs +0 -0
- /package/dist/{scripts/lib → scheduler/ui}/tui.spec.js +0 -0
- /package/dist/{scripts/lib → scheduler/util}/idle-poll.mjs +0 -0
- /package/dist/{scripts/lib → scheduler/util}/idle-poll.spec.js +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
FROM node:latest
|
|
2
|
-
|
|
3
|
-
RUN apt-get update && \
|
|
4
|
-
apt-get install -y --no-install-recommends git ca-certificates curl gosu jq && \
|
|
5
|
-
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# Non-root user — Claude Code refuses --dangerously-skip-permissions as root
|
|
9
|
-
RUN apt-get update && apt-get install -y --no-install-recommends sudo gpg && \
|
|
10
|
-
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
|
11
|
-
useradd -m -s /bin/bash claude && \
|
|
12
|
-
echo 'claude ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/claude && \
|
|
13
|
-
mkdir -p /home/claude/.claude && \
|
|
14
|
-
chown -R claude:claude /home/claude
|
|
15
|
-
|
|
16
|
-
# Install gh (GitHub CLI) from official apt repo
|
|
17
|
-
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
|
18
|
-
| gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg && \
|
|
19
|
-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
|
|
20
|
-
> /etc/apt/sources.list.d/github-cli.list && \
|
|
21
|
-
apt-get update && apt-get install -y --no-install-recommends gh && \
|
|
22
|
-
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
23
|
-
|
|
24
|
-
# Install glab (GitLab CLI) — latest .deb from GitLab releases
|
|
25
|
-
RUN GLAB_VER=$(curl -fsSL "https://gitlab.com/api/v4/projects/34675721/releases/permalink/latest" \
|
|
26
|
-
| node -pe 'JSON.parse(require("fs").readFileSync("/dev/stdin","utf8")).tag_name.slice(1)') && \
|
|
27
|
-
DEB_ARCH=$(dpkg --print-architecture) && \
|
|
28
|
-
curl -fsSL "https://gitlab.com/gitlab-org/cli/-/releases/v${GLAB_VER}/downloads/glab_${GLAB_VER}_linux_${DEB_ARCH}.deb" \
|
|
29
|
-
-o /tmp/glab.deb && \
|
|
30
|
-
dpkg -i /tmp/glab.deb && rm /tmp/glab.deb
|
|
31
|
-
|
|
32
|
-
# Install bun (system-wide via npm — reliable PATH, works for non-root claude user)
|
|
33
|
-
RUN npm install -g bun
|
|
34
|
-
|
|
35
|
-
# Install Claude Code natively as the claude user
|
|
36
|
-
RUN gosu claude bash -c 'curl -fsSL https://claude.ai/install.sh | bash'
|
|
37
|
-
ENV PATH="/home/claude/.local/bin:$PATH"
|
|
38
|
-
|
|
39
|
-
# Pre-configure Claude to skip first-run onboarding (theme, permissions prompts)
|
|
40
|
-
RUN echo '{"hasCompletedOnboarding":true,"theme":"dark"}' > /home/claude/.claude.json && \
|
|
41
|
-
chown claude:claude /home/claude/.claude.json
|
|
42
|
-
|
|
43
|
-
# Git config for commits inside container
|
|
44
|
-
RUN git config --system user.name "Claude Code" && \
|
|
45
|
-
git config --system user.email "claude@localhost"
|
|
46
|
-
|
|
47
|
-
WORKDIR /project
|
|
48
|
-
|
|
49
|
-
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
50
|
-
# Fix Windows CRLF line endings and set executable
|
|
51
|
-
RUN sed -i 's/\r$//' /usr/local/bin/docker-entrypoint.sh && \
|
|
52
|
-
chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
53
|
-
|
|
54
|
-
ENTRYPOINT ["docker-entrypoint.sh", "bash"]
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
services:
|
|
2
|
-
claude:
|
|
3
|
-
build: .
|
|
4
|
-
init: true
|
|
5
|
-
stop_grace_period: 3s
|
|
6
|
-
stdin_open: true
|
|
7
|
-
tty: true
|
|
8
|
-
volumes:
|
|
9
|
-
- ../..:/project
|
|
10
|
-
- claude-home:/home/claude/.claude
|
|
11
|
-
environment:
|
|
12
|
-
- ANTHROPIC_API_KEY
|
|
13
|
-
- NPM_TOKEN
|
|
14
|
-
- NPM_REGISTRY
|
|
15
|
-
- GH_TOKEN
|
|
16
|
-
- GITLAB_TOKEN
|
|
17
|
-
- FIGMA_API_KEY
|
|
18
|
-
- CLAUDE_DOCKER=1
|
|
19
|
-
- NODE_OPTIONS
|
|
20
|
-
|
|
21
|
-
volumes:
|
|
22
|
-
claude-home:
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set +x
|
|
3
|
-
|
|
4
|
-
# Strip \r from all env vars — Windows .env files use \r\n line endings,
|
|
5
|
-
# and a trailing \r in tokens causes "invalid header field value" HTTP errors.
|
|
6
|
-
# This is a blanket fix that covers all tokens (GITLAB_TOKEN, GH_TOKEN, NPM_TOKEN, etc.)
|
|
7
|
-
while IFS='=' read -r name value; do
|
|
8
|
-
if [[ -n "$name" && "${!name}" == *$'\r'* ]]; then
|
|
9
|
-
export "$name"="${!name//$'\r'/}"
|
|
10
|
-
fi
|
|
11
|
-
done < <(env)
|
|
12
|
-
|
|
13
|
-
# Also convert project .env to LF so that `source .env` inside the container works correctly
|
|
14
|
-
if [[ -f /project/.env ]]; then
|
|
15
|
-
sed -i 's/\r$//' /project/.env
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
# npm auth — create .npmrc from env var if set
|
|
19
|
-
if [[ -n "${NPM_TOKEN:-}" ]]; then
|
|
20
|
-
npm_registry="${NPM_REGISTRY:-registry.npmjs.org}"
|
|
21
|
-
echo "//${npm_registry}/:_authToken=${NPM_TOKEN}" > /home/claude/.npmrc
|
|
22
|
-
chown claude:claude /home/claude/.npmrc
|
|
23
|
-
fi
|
|
24
|
-
|
|
25
|
-
# Restore .claude.json if missing (volume only mounts $HOME/.claude/, not $HOME/.claude.json).
|
|
26
|
-
# First try backup from previous session, then fall back to onboarding-skip defaults.
|
|
27
|
-
if [[ ! -f /home/claude/.claude.json ]]; then
|
|
28
|
-
backup=$(find /home/claude/.claude/backups -name '.claude.json.backup.*' 2>/dev/null | sort -V | tail -1)
|
|
29
|
-
if [[ -n "$backup" ]]; then
|
|
30
|
-
cp "$backup" /home/claude/.claude.json
|
|
31
|
-
else
|
|
32
|
-
echo '{"hasCompletedOnboarding":true,"theme":"dark"}' > /home/claude/.claude.json
|
|
33
|
-
fi
|
|
34
|
-
chown claude:claude /home/claude/.claude.json
|
|
35
|
-
fi
|
|
36
|
-
|
|
37
|
-
# Ensure claude user owns its home dir (volume mounts come in as root)
|
|
38
|
-
chown claude:claude /home/claude
|
|
39
|
-
chown -R claude:claude /home/claude/.claude 2>/dev/null || true
|
|
40
|
-
|
|
41
|
-
# Fix git "dubious ownership" — /project is mounted from host with different uid
|
|
42
|
-
git config --global --add safe.directory /project
|
|
43
|
-
|
|
44
|
-
# Git platform auth — configure gh/glab + git credentials from env vars if set
|
|
45
|
-
if [[ -n "${GH_TOKEN:-}" ]]; then
|
|
46
|
-
echo "GH_TOKEN detected — GitHub CLI authenticated."
|
|
47
|
-
git config --global credential.helper store
|
|
48
|
-
echo "https://oauth2:${GH_TOKEN}@github.com" > /home/claude/.git-credentials
|
|
49
|
-
chown claude:claude /home/claude/.git-credentials
|
|
50
|
-
fi
|
|
51
|
-
if [[ -n "${GITLAB_TOKEN:-}" ]]; then
|
|
52
|
-
echo "GITLAB_TOKEN detected — GitLab CLI authenticated."
|
|
53
|
-
git config --global credential.helper store
|
|
54
|
-
echo "https://oauth2:${GITLAB_TOKEN}@gitlab.com" >> /home/claude/.git-credentials
|
|
55
|
-
chown claude:claude /home/claude/.git-credentials
|
|
56
|
-
# Configure glab auth (glab reads GITLAB_TOKEN env var automatically,
|
|
57
|
-
# but explicit login ensures 'glab auth status' reports correctly)
|
|
58
|
-
gosu claude glab auth login --hostname gitlab.com --token "$GITLAB_TOKEN" 2>/dev/null || true
|
|
59
|
-
fi
|
|
60
|
-
|
|
61
|
-
# Package manager configs — docker-run.mts mounts host ~/.npmrc and ~/.bunfig.toml
|
|
62
|
-
# automatically. As fallback, copy project-level configs if host ones weren't mounted.
|
|
63
|
-
if [[ ! -f /home/claude/.bunfig.toml ]] && [[ -f /project/.bunfig.toml ]]; then
|
|
64
|
-
cp /project/.bunfig.toml /home/claude/.bunfig.toml
|
|
65
|
-
chown claude:claude /home/claude/.bunfig.toml
|
|
66
|
-
echo "Copied project .bunfig.toml to claude home."
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
# Node.js heap limit — auto-detect from available memory if not explicitly set.
|
|
70
|
-
# Uses 75% of container memory for Node.js heap (leaves room for OS, git, native tools).
|
|
71
|
-
# Override: set NODE_OPTIONS="--max-old-space-size=XXXX" in .env or docker-compose environment.
|
|
72
|
-
if [[ -z "${NODE_OPTIONS:-}" ]]; then
|
|
73
|
-
mem_kb=$(grep MemTotal /proc/meminfo 2>/dev/null | awk '{print $2}')
|
|
74
|
-
if [[ -n "$mem_kb" && "$mem_kb" -gt 0 ]]; then
|
|
75
|
-
heap_mb=$(( mem_kb * 3 / 4 / 1024 ))
|
|
76
|
-
# Floor at 2 GB, no ceiling — use whatever the host gives us
|
|
77
|
-
[[ "$heap_mb" -lt 2048 ]] && heap_mb=2048
|
|
78
|
-
export NODE_OPTIONS="--max-old-space-size=${heap_mb}"
|
|
79
|
-
echo "Node.js heap auto-configured: ${heap_mb} MB (75% of ${mem_kb} KB available)"
|
|
80
|
-
fi
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
|
-
# Auth pre-check — fail fast if no credentials available
|
|
84
|
-
if [[ -z "${ANTHROPIC_API_KEY:-}" ]]; then
|
|
85
|
-
creds="/home/claude/.claude/.credentials.json"
|
|
86
|
-
if [[ ! -f "$creds" ]] || [[ ! -s "$creds" ]]; then
|
|
87
|
-
echo ""
|
|
88
|
-
echo "ERROR: No Claude authentication found."
|
|
89
|
-
echo ""
|
|
90
|
-
echo " Option 1 — On your HOST machine:"
|
|
91
|
-
echo " claude auth login"
|
|
92
|
-
echo " Then re-run docker-run.mjs"
|
|
93
|
-
echo ""
|
|
94
|
-
echo " Option 2 — API key:"
|
|
95
|
-
echo " ANTHROPIC_API_KEY=sk-... npx create-claude-workspace docker"
|
|
96
|
-
echo ""
|
|
97
|
-
exit 1
|
|
98
|
-
fi
|
|
99
|
-
fi
|
|
100
|
-
|
|
101
|
-
exec gosu claude "$@"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|