feat: dev container setup for Codespaces (maintainer + consumer configs) - #124
Merged
Conversation
Adds two dev container configurations so users can experiment with agentic-kit on Codespaces or any dev-container-compatible tool: - .devcontainer/devcontainer.json — contributor environment; pnpm install + npm link so `ak`/`agentic-kit` resolve to the live checkout. - .devcontainer/consumer/devcontainer.json — reuses docker/Dockerfile to install the published @pacphi/agentic-kit release into a disposable container, seeding a ~/sandbox project outside the mounted repo. CI (.github/workflows/devcontainers.yml) builds and smoke-tests both configs with the devcontainers/ci action on relevant PR changes (a paths-filter job scopes each config to only the files it depends on) and monthly, to catch base-image or published-package drift independent of any change in this repo. docs/DEVCONTAINERS.md documents both configs, the CI job, and how the dashboard's port forwarding differs from the docker/ compose bridge; linked from README and cross-linked from docker/USER-GUIDE.md.
CI (devcontainers.yml) caught this: postCreateCommand runs as the non-root `node` user, but corepack's shim install and npm link both write into the base image's root-owned /usr/local/bin, so both failed with EACCES. The devcontainers base image grants node passwordless sudo for exactly this. pnpm install stays unprivileged — it only touches the (UID-synced) mounted repo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.devcontainer/devcontainer.json— contributor environment: Node 22 + pnpm,pnpm install, thennpm linksoak/agentic-kitresolve to the live checkout (edit source, runakimmediately)..devcontainer/consumer/devcontainer.json— reusesdocker/Dockerfile(the same image the existing first-usedocker composeenvironment builds) to install the published@pacphi/agentic-kitrelease into a disposable container, seeding a~/sandboxproject outside the mounted repo soak setup's project-scope work never touches this checkout..github/workflows/devcontainers.yml: builds + smoke-tests both configs with thedevcontainers/ciaction (the referencedevcontainerCLI, same one Codespaces uses).changesjob (dorny/paths-filter) scopes each job to only the files it depends on, so adocker/Dockerfile-only change doesn't rebuild the maintainer config and vice versa.23 6 1 * *, unfiltered — the point is catching base-image or published-package drift even when nothing here changed), and viaworkflow_dispatch.docs/DEVCONTAINERS.mddocumenting both configs, the CI job, and how port forwarding differs fromdocker/'s socat bridge (VS Code Server attaches inside the container, so no bridge is needed). Linked from README and cross-linked fromdocker/USER-GUIDE.md.Test plan
pnpm run check(typecheck + lint + markdown lint + build + test) passespnpm run lint:links:internal— all new doc links resolveactionlint .github/workflows/devcontainers.yml— cleandevcontainer.jsonfiles validated as parseable JSONCdevcontainersCI workflow run (will execute on this PR since it touches.devcontainer/**,docker/Dockerfile, and the workflow file itself)