mirror of
https://github.com/docker/docker-agent.git
synced 2026-11-04 18:30:09 +00:00
Add support for staging a docker-agent kit (skills and prompt files) in the sandbox before launch. The kit is built by the host, redacted with portcullis, and mounted read-only at /agent-kit inside the sandbox. This allows skills and prompt files to travel with the agent even though the sandbox /Users/dgageot differs from the host's. - New pkg/promptfiles: centralizes prompt-file lookup logic (used by both the add_prompt_files hook and the kit builder). - New pkg/sandbox/kit: builds the kit by collecting skills (via skills.Load) and per-agent prompt files, storing them in <cache>/sandbox-kits/<hash>/ with redaction applied to all text files via portcullis.Redact. Skips files already covered by the live workspace mount. - pkg/skills/local.go: when DOCKER_AGENT_KIT_DIR is set, skill discovery is rooted only at the kit's skills directory; host paths are skipped since they don't exist inside the sandbox. - pkg/hooks/builtins/add_prompt_files.go: delegates to promptfiles and prefers the kit over $HOME inside the sandbox. - pkg/sandbox.Backend.Ensure: changed to accept extras []string instead of a single extra path, enabling multiple mounts for the kit and config dir. - cmd/root: builds the kit before sandbox.Ensure, mounts it at /agent-kit, forwards DOCKER_AGENT_KIT_DIR env var to the sandbox, and cleans up on exit. Added --no-kit and (hidden) --kit-keep flags. - Tests: added coverage for kit build (redaction, workspace scoping, rebuild semantics, helpers) and kit-aware skill/prompt-file resolution. Moved existing add_prompt_files tests to pkg/promptfiles.