@xpert-ai/plugin-zip-unzip-cli
v0.0.1
Published
`@xpert-ai/plugin-zip-unzip-cli` adds sandboxed `zip` / `unzip` support to Xpert agents by preparing the agent sandbox and teaching the model how to use those system commands through `sandbox_shell`. The middleware does not register a standalone tool. It
Readme
Xpert Plugin: Zip/Unzip CLI Middleware
@xpert-ai/plugin-zip-unzip-cli adds sandboxed zip / unzip support to Xpert agents by preparing the agent sandbox and teaching the model how to use those system commands through sandbox_shell. The middleware does not register a standalone tool. It only checks or installs the binaries inside the sandbox, uploads embedded skill files, and injects usage guidance into the agent prompt.
Key Features
- Checks whether
zipandunzipare present in the sandbox on first use. - Installs
zipandunzipwithapt-getautomatically when the sandbox image does not already include them. - Serializes first-time installation with a plugin-level bootstrap lock inside the sandbox.
- Retries automatically when
apt/dpkgpackage-manager locks are temporarily held by another process. - Writes embedded skill assets (
SKILL.mdand workflow references) into the sandbox at/workspace/.xpert/skills/zip-unzipby default. - Appends the embedded Zip/Unzip skill description to the system prompt inside
<skill>...</skill>tags. - Re-checks bootstrap state before
sandbox_shellcommands that invokeziporunzip. - Blocks interactive
zip -epassword prompts, which can hang in non-interactive sandbox sessions. - Validates agent drafts and warns when sandbox support or
SandboxShellis missing.
Quick Start
Register the Plugin
PLUGINS=@xpert-ai/plugin-zip-unzip-cliEnable Sandbox Support Turn on the agent sandbox feature for the team/agent that will handle archive tasks.
Add
SandboxShellon the Same Agent This middleware depends on thesandbox_shelltool exposed by theSandboxShellmiddleware.Add the Zip/Unzip Middleware In the Xpert console (or agent definition), add a middleware entry with strategy
ZipUnzipCLISkill.Ask the Agent to Work with Archives
User: Compress ./project into backup.zip but exclude node_modules and *.log files. Agent: (reads SKILL.md, then runs `zip -r backup.zip ./project -x "*/node_modules/*" "*.log"` via sandbox_shell)
Configuration
This middleware does not expose runtime configuration in v1. Skill assets are always written to:
/workspace/.xpert/skills/zip-unzip
Runtime Behavior
- On first use, the middleware checks
/workspace/.xpert/.zip-unzip-bootstrap.json. - If the stamp is missing or outdated, it verifies whether
zipandunzipexist inPATH. - If either binary is missing, it checks for
apt-get. - Each install attempt runs inside a plugin-level bootstrap lock rooted at
/workspace/.xpert/.zip-unzip-bootstrap.lock. - Inside the lock, it re-checks
zipandunzipbefore running package installation so concurrent requests can reuse a completed install. - Package installation uses:
DEBIAN_FRONTEND=noninteractive apt-get updateDEBIAN_FRONTEND=noninteractive apt-get install -y zip unzip
- When installation fails because
aptordpkgis locked, the middleware waits and retries with bounded backoff before surfacing an error. - After bootstrap, it writes:
SKILL.mdreferences/common-workflows.md- the bootstrap stamp file
- The system prompt appends:
<skill>- the
descriptionfield from the embeddedSKILL.md </skill>
- Non-archive
sandbox_shellcommands are passed through unchanged.
Validation Rules
The plugin contributes draft validation warnings when:
- the agent uses
ZipUnzipCLISkillbut sandbox support is disabled - the agent uses
ZipUnzipCLISkillwithoutSandboxShellon the same agent
Sandbox Assets
During bootstrap, the middleware writes the following assets into the sandbox:
SKILL.mdreferences/common-workflows.md/workspace/.xpert/.zip-unzip-bootstrap.json
Configuration Precedence
This middleware currently uses a fixed internal configuration with no user overrides.
Development & Testing
pnpm -C xpertai exec nx build @xpert-ai/plugin-zip-unzip-cli
pnpm -C xpertai exec nx test @xpert-ai/plugin-zip-unzip-cli
pnpm -C plugin-dev-harness build
node plugin-dev-harness/dist/index.js --workspace ./xpertai --plugin @xpert-ai/plugin-zip-unzip-cliIf the local Node version is too new for the harness, use Node 20:
npx -y node@20 plugin-dev-harness/dist/index.js --workspace ./xpertai --plugin @xpert-ai/plugin-zip-unzip-cliLicense
This project follows the AGPL-3.0 License located at the repository root.
