{"_id":"@agentxin-ai/plugin-zip","name":"@agentxin-ai/plugin-zip","dist-tags":{"latest":"0.0.9"},"versions":{"0.0.9":{"name":"@agentxin-ai/plugin-zip","version":"0.0.9","license":"AGPL-3.0","repository":{"type":"git","url":"git+https://github.com/agentxin-ai/agentxin-plugins.git"},"bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"@agentxin-plugins-starter/source":"./src/index.ts","types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"dependencies":{"iconv-lite":"^0.7.0","jszip":"^3.10.1","tslib":"^2.3.0"},"peerDependencies":{"@langchain/core":"0.3.72","@langchain/langgraph":"0.4.7","@nestjs/common":"^11.1.6","@nestjs/config":"^4.0.2","@agentxin-ai/plugin-sdk":"^3.6.2","chalk":"4.1.2","zod":"3.25.67"},"_id":"@agentxin-ai/plugin-zip@0.0.9","description":"`@agentxin-ai/plugin-zip` is a file compression/decompression toolset plugin for the [AgentXin AI](https://github.com/agentxin-ai/agentxin) agent platform. It equips agents with Zip and Unzip tools so they can package intermediate artifacts or inspect upl","homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-c06pUJ2GXNWog4hk5Qp5WPOIRH4xoxNPg87KOXszaTHWBYxiqdNXBCN1IqsbqOieH41dABc1bWBXVzET+dg7GQ==","shasum":"1d31fddac252cbae799022704c3728de0907fcc4","tarball":"https://registry.npmjs.org/@agentxin-ai/plugin-zip/-/plugin-zip-0.0.9.tgz","fileCount":23,"unpackedSize":39963,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBIvub/kRqhJxkTAw8qHBMVARh+8rG/WxS0nbkWrjT94AiAS7P5bmdLCKUIb3NFvLyP35oHqxlIOhVLsR72MyPKgmw=="}]},"_npmUser":{"name":"agentxin-ai","email":"1304040880@qq.com"},"directories":{},"maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-zip_0.0.9_1775125148513_0.037162382748713085"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-02T10:19:08.440Z","0.0.9":"2026-04-02T10:19:08.689Z","modified":"2026-04-02T10:19:08.857Z"},"maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"description":"`@agentxin-ai/plugin-zip` is a file compression/decompression toolset plugin for the [AgentXin AI](https://github.com/agentxin-ai/agentxin) agent platform. It equips agents with Zip and Unzip tools so they can package intermediate artifacts or inspect upl","homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","repository":{"type":"git","url":"git+https://github.com/agentxin-ai/agentxin-plugins.git"},"bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"license":"AGPL-3.0","readme":"# AgentXin Plugin: Zip\n\n`@agentxin-ai/plugin-zip` is a file compression/decompression toolset plugin for the [AgentXin AI](https://github.com/agentxin-ai/agentxin) agent platform. It equips agents with Zip and Unzip tools so they can package intermediate artifacts or inspect uploaded archives directly inside workflows.\n\n## Installation\n\n```bash\npnpm add @agentxin-ai/plugin-zip\n# or\nnpm install @agentxin-ai/plugin-zip\n```\n\n> **Note**: This plugin depends on `@agentxin-ai/plugin-sdk`, `@nestjs/common@^11`, `@nestjs/config@^4`, `@langchain/core@0.3.72`, `chalk@4.1.2`, and `zod@3.25.67` as peer dependencies. Install these in the host project before enabling the plugin.\n\n## Quick Start\n\n1. **Install & Build**  \n   Add the dependency to your host service and rebuild to make the plugin discoverable.\n\n2. **Register the Plugin**  \n   Include the package in your plugin list (environment variable or configuration):\n\n   ```sh .env\n   PLUGINS=@agentxin-ai/plugin-zip\n   ```\n\n   The plugin bootstraps the `ZipPlugin` NestJS module, registers the toolset, and emits lifecycle logs.\n\n3. **Provision Toolsets for Agents**  \n   - AgentXin Console: add a Built-in Toolset instance and choose `Zip`.  \n   - API: request toolset `zip`.  \n\n   No credentials or secrets are required, so any authorized agent can immediately create instances.\n\n## Zip Toolset\n\n| Field        | Value                                                                 |\n| ------------ | --------------------------------------------------------------------- |\n| Name         | `zip`                                                                 |\n| Display Name | Zip / 压缩文件                                                         |\n| Category     | `tools`                                                               |\n| Description  | Compress multiple files or extract archives inside agent workflows.  |\n| Config       | No configuration or external integrations are needed.                |\n\nThe toolset wraps `jszip` to read/write archives fully in memory. Files are exchanged as base64 strings so they can travel safely through JSON payloads.\n\n## Tools\n\n| Tool      | Purpose                                                                                | Input Highlights                                                                                                                                                                                               | Output |\n| --------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |\n| `zip`     | Bundle multiple files into a `.zip` archive and return it as a base64 payload.         | `files[]`: each entry accepts `name`/`filename` plus `content` (string, Buffer, or `Uint8Array`). Optional `file_name` controls the resulting archive name (defaults to `files.zip`).                          | JSON string with `blob` (base64 zip), `mime_type`, `filename`. |\n| `unzip`   | Extract every file from a `.zip` archive, with MIME types inferred from extensions.    | `file`: supply `name`/`filename` ending in `.zip` plus `content`/`blob` (Buffer, `Uint8Array`, or base64 string). Directories are skipped automatically.                                                        | JSON string containing `files[]` entries with `blob`, `mime_type`, `filename`. |\n\n### Example Payloads\n\n```json\n// Zip\n{\n  \"tool\": \"zip\",\n  \"input\": {\n    \"files\": [\n      { \"name\": \"README.md\", \"content\": \"# intro\" },\n      { \"name\": \"data/data.json\", \"content\": \"{\\\"value\\\": 1}\" }\n    ],\n    \"file_name\": \"bundle.zip\"\n  }\n}\n```\n\n```json\n// Unzip\n{\n  \"tool\": \"unzip\",\n  \"input\": {\n    \"file\": {\n      \"name\": \"bundle.zip\",\n      \"blob\": \"<base64-encoded zip>\"\n    }\n  }\n}\n```\n\nEach tool returns JSON text. Agents typically parse it (`JSON.parse(result)`) to access the binary data as base64 strings. Invalid inputs produce friendly error strings generated by `getErrorMessage`.\n\n## MIME Detection & Behavior\n\n- Built-in mapping covers common document types (`.md`, `.docx`, `.xlsx`, `.pptx`), code files (`.py`, `.ts`, `.json`, etc.), images (`.webp`, `.svg`, `.ico`), and other formats (`.csv`, `.env`, `.gitignore`).\n- Unknown extensions default to `application/octet-stream`.\n- The Zip tool ignores empty file entries; the Unzip tool skips directories and returns an error if the archive is empty or invalid.\n\n## Permissions & Security\n\n- **No external network calls**: All compression/decompression happens locally.\n- **Filesystem**: Tools operate on memory buffers; granting file-system permissions is unnecessary unless your agent independently reads/writes files.\n- **Logging**: Only lightweight lifecycle logs are emitted (`register`, `onStart`, `onStop`).\n\n## Development & Testing\n\n```bash\nnpm install\nnpx nx build @agentxin-ai/plugin-zip\nnpx nx test @agentxin-ai/plugin-zip\n```\n\nRefer to `packages/zip/README-TEST.md` (and the Chinese variant) for manual testing instructions. Build artifacts land in `packages/zip/dist`; ensure compiled files, type declarations, and package metadata are aligned before publishing.\n\n## License\n\nThis project follows the [AGPL-3.0 License](../../../LICENSE) located at the repository root.\n","readmeFilename":"README.md","_rev":"1-9a62c0a95d49b996373cb9b496b1b2ea"}