Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions external_plugins/barcode-label-maker/.zcode-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "barcode-label-maker",
"version": "0.1.0",
"description": "Turn a product sheet into barcode labels: EAN-13 and UPC-A with check-digit verification, Code 128 for SKUs and anything else, with product name and price, laid out on common A4/Letter label sheets (3×8, 4×10, 2×7, 5×13, 3×10). Set copies per product, skip labels already used on a sheet, fix codes in the panel and export a print-ready PDF plus SVG barcodes. Runs locally; no API keys.",
"description_i18n": {
"en": "Turn a product sheet into barcode labels: EAN-13 and UPC-A with check-digit verification, Code 128 for SKUs and anything else, with product name and price, laid out on common A4/Letter label sheets (3×8, 4×10, 2×7, 5×13, 3×10). Set copies per product, skip labels already used on a sheet, fix codes in the panel and export a print-ready PDF plus SVG barcodes. Runs locally; no API keys.",
"zh-CN": "把商品表做成条码标签:EAN-13、UPC-A 自动核对校验位,货号等其他内容用 Code 128,可带品名和价格,按常见 A4/Letter 不干胶标签纸(3×8、4×10、2×7、5×13、3×10)排版。可设每个商品打印几张、跳过半张纸上已用的标签,在面板里修正条码,导出可直接打印的 PDF 和 SVG 条码。在本地运行,无需 API 密钥。"
},
"author": {
"name": "Penova",
"url": "https://github.com/ppppp2005-p"
},
"license": "MIT",
"keywords": [
"barcode",
"ean-13",
"upc",
"code 128",
"labels",
"sku",
"price tag",
"条码",
"条形码",
"标签打印",
"价签",
"货号",
"不干胶"
],
"skills": "skills",
"mcpServers": {
"barcode-label-maker": {
"type": "stdio",
"command": "node",
"args": [
"${ZCODE_PLUGIN_ROOT}/dist/server.mjs"
],
"cwd": "${ZCODE_PROJECT_DIR}",
"timeoutMs": 900000,
"env": {
"ZCODE_WORKSPACE_ROOT": "${ZCODE_PROJECT_DIR}"
}
}
},
"ui": {
"surfaces": [
{
"id": "editor",
"title": {
"zh-CN": "条码标签打印",
"en-US": "Barcode Label Maker"
},
"icon": "barcode",
"server": "barcode-label-maker",
"resourceUri": "ui://barcode-label-maker/panel.html",
"availability": "session"
}
]
}
}
21 changes: 21 additions & 0 deletions external_plugins/barcode-label-maker/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Penova

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
52 changes: 52 additions & 0 deletions external_plugins/barcode-label-maker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Barcode Label Maker

Turn a product sheet into barcode labels: EAN-13 and UPC-A with check-digit verification, Code 128 for SKUs and anything else, with product name and price, laid out on common A4/Letter label sheets (3×8, 4×10, 2×7, 5×13, 3×10). Set copies per product, skip labels already used on a sheet, fix codes in the panel and export a print-ready PDF plus SVG barcodes. Runs locally; no API keys.

## Features

- **Columns**: sku/货号, name/品名, price/售价, barcode/条码, qty/数量 (copies), in Chinese or English.
- **Barcode rules**: 13 digits → EAN-13 with the check digit verified; a valid 12-digit UPC-A stays UPC-A; other 12-digit numbers get the EAN-13 check digit added; wrong check digits, letters or an empty barcode (the SKU is used) → Code 128. Every fallback is explained in the issue list.
- **Label sheets**: A4 3×8, 4×10, 2×7, 5×13 and Letter 3×10, with an outline option for a test print and “skip used labels” for partly used sheets.
- **Label content**: optional name and price, bars sized to the label with quiet zones, human-readable digits under the bars.
- **Output**: labels.pdf (print at 100% / actual size), one SVG per product and a CSV of the encoded values.
- **Panel**: pick input files, adjust settings, see problems, edit any cell in the table, preview the result and export — all in the ZCode side panel. Edits are saved in `barcode-label-maker/<project>.project.json` and kept until you re-open the inputs.

## Usage

Ask the agent in ZCode Desktop:

- "Make barcode labels for 店铺/products.xlsx on A4 3×8 label paper"
- "Print 6 labels for the mug, and start at label 10 because the sheet is partly used"
- "Export the label PDF and SVG barcodes"

## Tools

| Tool | Purpose |
|---|---|
| `labels_open` | Read the product sheet and encode every barcode. Opens the panel |
| `labels_edit` | Change settings, edit cells by row, add or remove rows |
| `labels_status` | Show the current rows, issues and summary |
| `labels_export` | Write labels.pdf for the chosen label sheet, svg/<sku>.svg and barcodes.csv |

Output goes to `barcode-label-maker/<project>/` in the workspace.

## Scope (v0.1)

- Linear barcodes only (EAN-13, UPC-A, Code 128); for QR codes use a QR tool. No GS1-128 application identifiers in v0.1.
- Barcode numbers are not registered for you — use numbers your business owns (e.g. from GS1) for retail.
- Custom label sizes beyond the five presets are not in v0.1.

## Privacy, network and files

- **Everything runs locally.** No network, no uploads, no API keys or accounts.
- Reads only the files you choose. Writes only the `barcode-label-maker/` folder in the workspace. No hooks.

## Build and test (developers)

- Source: `ui-plugins/barcode-label-maker/`.
- Build: `pnpm install --frozen-lockfile && pnpm build`, then add `dist/local-marketplace` as a local source.
- Tests: `pnpm --filter @penova/plugin-barcode-label-maker test` and `test:e2e` (needs Chrome; sample files in `test/samples/`).

## Third-party components and licenses

MIT licensed (author: Penova). Bundled: pdf-lib (MIT), fontkit (MIT), ExcelJS (MIT), MCP SDK and ext-apps (MIT), zod (MIT); the full list is in `dist/THIRD_PARTY_NOTICES.txt`.
52 changes: 52 additions & 0 deletions external_plugins/barcode-label-maker/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 条码标签打印

把商品表做成条码标签:EAN-13、UPC-A 自动核对校验位,货号等其他内容用 Code 128,可带品名和价格,按常见 A4/Letter 不干胶标签纸(3×8、4×10、2×7、5×13、3×10)排版。可设每个商品打印几张、跳过半张纸上已用的标签,在面板里修正条码,导出可直接打印的 PDF 和 SVG 条码。在本地运行,无需 API 密钥。

## 功能

- **列**:货号/sku、品名/name、售价/price、条码/barcode、数量/qty(打印张数),中英文列名都能识别。
- **条码规则**:13 位数字 → EAN-13 并核对校验位;有效的 12 位 UPC-A 保持 UPC-A;其他 12 位数字自动补 EAN-13 校验位;校验位错误、含字母或条码为空(改用货号)→ Code 128。每种改动都会在问题列表里说明。
- **标签纸**:A4 3×8、4×10、2×7、5×13 和 Letter 3×10,可打印边框试打,半张用过的纸可以“跳过已用的标签”。
- **标签内容**:可选品名和价格,条码按标签大小缩放并保留两侧空白,条码下方印数字。
- **输出**:labels.pdf(按 100% 实际大小打印)、每个商品一个 SVG,以及记录编码内容的 CSV。
- **面板**:在 ZCode 侧栏里选择输入文件、调整设置、查看问题、直接修改表格里的任意单元格、预览成品并导出。修改保存在 `barcode-label-maker/<项目>.project.json`,重新打开输入文件前一直保留。

## 使用方法

在 ZCode 桌面端对助手说:

- “用 店铺/products.xlsx 做条码标签,用 A4 3×8 的标签纸”
- “马克杯打 6 张,标签纸前 9 个已经用掉了,从第 10 个开始”
- “导出标签 PDF 和 SVG 条码”

## 工具

| 工具 | 作用 |
|---|---|
| `labels_open` | 读取商品表并为每个商品编码条码,并打开面板 |
| `labels_edit` | 修改设置、按行修改单元格、新增或删除行 |
| `labels_status` | 查看当前数据、问题和汇总 |
| `labels_export` | 导出按所选标签纸排版的 labels.pdf、svg/<货号>.svg 和 barcodes.csv |

导出文件写到工作区的 `barcode-label-maker/<项目>/` 文件夹。

## 范围(v0.1)

- 只做一维条码(EAN-13、UPC-A、Code 128);二维码请用二维码工具。v0.1 不支持 GS1-128 应用标识符。
- 不会替你注册条码号——零售上架请使用你公司拥有的号码(例如向物品编码中心/GS1 申请)。
- v0.1 只有五种预设标签纸规格。

## 隐私、网络与文件

- **全部在本地运行。** 不联网、不上传,不需要 API 密钥或账号。
- 只读取你选择的文件,只写入工作区的 `barcode-label-maker/` 文件夹。没有 Hook。

## 构建与测试(开发者)

- 源码:`ui-plugins/barcode-label-maker/`。
- 构建:`pnpm install --frozen-lockfile && pnpm build`,然后把 `dist/local-marketplace` 添加为本地来源。
- 测试:`pnpm --filter @penova/plugin-barcode-label-maker test` 和 `test:e2e`(需要 Chrome;样例文件在 `test/samples/`)。

## 第三方组件与许可证

MIT 许可(作者:Penova)。打包的组件:pdf-lib (MIT), fontkit (MIT), ExcelJS (MIT)、MCP SDK 与 ext-apps(MIT)、zod(MIT);完整列表见 `dist/THIRD_PARTY_NOTICES.txt`。
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: barcode-label-maker
description: 把商品表做成条码标签:EAN-13、UPC-A 自动核对校验位,货号等其他内容用 Code 128,可带品名和价格,按常见 A4/Letter 不干胶标签纸(3×8、4×10、2×7、5×13、3×10)排版。可设每个商品打印几张、跳过半张纸上已用的标签,在面板里修正条码,导出可直接打印的 PDF 和 SVG 条码。在本地运行,无需 API 密钥。 用户提到“条码 / 条形码 / 打印标签 / 价签 / EAN / 货号标签”时使用。
---

# 条码标签打印

1. `labels_open(inputs, settings?, project?)`:读取商品表并为每个商品编码条码。inputs 是工作区相对路径。
- 结果里有汇总、问题列表(错误 / 提醒)和前几行数据,每行有编号 `#n`。
- 用户说了标签纸规格就设 settings.sheet(a4-3x8、a4-4x10、a4-2x7、a4-5x13、letter-3x10)。
2. 向用户简要说明结果,先说错误和需要确认的地方,不要逐行念。
3. 用户要改时调用 `labels_edit(project, settings?, set?: [{row, values}], add?, remove?)`。
- 改张数:`set: [{row, values: {qty: 6}}]`;半张纸:`settings: {skip: 9}`(跳过前 9 个)。
4. `labels_export(project, formats?)`:导出按所选标签纸排版的 labels.pdf、svg/<货号>.svg 和 barcodes.csv。把文件路径告诉用户。
5. 提醒用户打印时选“实际大小 / 100%”,不要“适合页面”。
51 changes: 51 additions & 0 deletions marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,57 @@
"把上一个 Hi3D 任务生成的模型按角色拆分成部件"
]
}
},
{
"name": "barcode-label-maker",
"componentTypes": [
"ui"
],
"source": "./external_plugins/barcode-label-maker",
"displayName": "Barcode Label Maker",
"displayName_i18n": {
"en": "Barcode Label Maker",
"zh-CN": "条码标签打印"
},
"description": "Turn a product sheet into barcode labels: EAN-13 and UPC-A with check-digit verification, Code 128 for SKUs and anything else, with product name and price, laid out on common A4/Letter label sheets (3×8, 4×10, 2×7, 5×13, 3×10). Set copies per product, skip labels already used on a sheet, fix codes in the panel and export a print-ready PDF plus SVG barcodes. Runs locally; no API keys.",
"description_i18n": {
"en": "Turn a product sheet into barcode labels: EAN-13 and UPC-A with check-digit verification, Code 128 for SKUs and anything else, with product name and price, laid out on common A4/Letter label sheets (3×8, 4×10, 2×7, 5×13, 3×10). Set copies per product, skip labels already used on a sheet, fix codes in the panel and export a print-ready PDF plus SVG barcodes. Runs locally; no API keys.",
"zh-CN": "把商品表做成条码标签:EAN-13、UPC-A 自动核对校验位,货号等其他内容用 Code 128,可带品名和价格,按常见 A4/Letter 不干胶标签纸(3×8、4×10、2×7、5×13、3×10)排版。可设每个商品打印几张、跳过半张纸上已用的标签,在面板里修正条码,导出可直接打印的 PDF 和 SVG 条码。在本地运行,无需 API 密钥。"
},
"version": "0.1.0",
"author": {
"name": "Penova",
"url": "https://github.com/ppppp2005-p"
},
"license": "MIT",
"category": "productivity",
"keywords": [
"barcode",
"ean-13",
"upc",
"code 128",
"labels",
"sku",
"price tag",
"条码",
"条形码",
"标签打印",
"价签",
"货号",
"不干胶"
],
"examplePrompts": [
"Make barcode labels for 店铺/products.xlsx on A4 3×8 label paper",
"Print 6 labels for the mug, and start at label 10 because the sheet is partly used",
"Export the label PDF and SVG barcodes"
],
"examplePrompts_i18n": {
"zh-CN": [
"用 店铺/products.xlsx 做条码标签,用 A4 3×8 的标签纸",
"马克杯打 6 张,标签纸前 9 个已经用掉了,从第 10 个开始",
"导出标签 PDF 和 SVG 条码"
]
}
}
]
}
Loading