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
60 changes: 60 additions & 0 deletions external_plugins/attendance-report/.zcode-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "attendance-report",
"version": "0.1.0",
"description": "Turn the raw punch records from your time clock or attendance app into a monthly attendance report. Pick the export, set the shift hours, grace minutes, flexible start, lunch break, overtime rule, rest days and holidays, and see for each person and day the first and last punch, late arrivals, early leaves, missing punches, absences and overtime. Fix a forgotten punch or mark leave and business trips right in the table, then export a summary workbook and one workbook per person for them to check. Runs locally; no HR system or API keys.",
"description_i18n": {
"en": "Turn the raw punch records from your time clock or attendance app into a monthly attendance report. Pick the export, set the shift hours, grace minutes, flexible start, lunch break, overtime rule, rest days and holidays, and see for each person and day the first and last punch, late arrivals, early leaves, missing punches, absences and overtime. Fix a forgotten punch or mark leave and business trips right in the table, then export a summary workbook and one workbook per person for them to check. Runs locally; no HR system or API keys.",
"zh-CN": "把考勤机或打卡应用导出的原始打卡记录,变成每月的考勤统计。选上导出文件,设置上下班时间、迟到宽限、弹性上班、午休、加班规则、休息日和节假日,就能看到每个人每天的首末次打卡、迟到、早退、缺卡、缺勤和加班。忘打卡的可以直接在表里补,请假、出差也在表里标注,然后导出汇总表和每人一份的明细给本人核对。在本地运行,不用人事系统,无需 API 密钥。"
},
"author": {
"name": "Penova",
"url": "https://github.com/ppppp2005-p"
},
"license": "MIT",
"keywords": [
"attendance",
"time clock",
"punch",
"clock in",
"late",
"overtime",
"timesheet",
"考勤",
"打卡",
"迟到",
"早退",
"加班",
"缺卡",
"考勤统计"
],
"skills": "skills",
"mcpServers": {
"attendance-report": {
"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": "Attendance Report"
},
"icon": "clock",
"server": "attendance-report",
"resourceUri": "ui://attendance-report/panel.html",
"availability": "session"
}
]
}
}
21 changes: 21 additions & 0 deletions external_plugins/attendance-report/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/attendance-report/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Attendance Report

Turn the raw punch records from your time clock or attendance app into a monthly attendance report. Pick the export, set the shift hours, grace minutes, flexible start, lunch break, overtime rule, rest days and holidays, and see for each person and day the first and last punch, late arrivals, early leaves, missing punches, absences and overtime. Fix a forgotten punch or mark leave and business trips right in the table, then export a summary workbook and one workbook per person for them to check. Runs locally; no HR system or API keys.

## Features

- **From any punch export**: one row per punch with 姓名 and 打卡时间 (or 日期 + 时间), in CSV or Excel; duplicate punches are merged.
- **Your rules**: shift start/end, late and early-leave grace, flexible start, lunch break, overtime threshold and minimum.
- **Calendar**: Sat+Sun, Sun-only or no rest days; public holidays and make-up working days.
- **Every day judged**: late, early leave, missing punch, absence, weekday and rest-day overtime, hours worked.
- **Fix in the table**: add a forgotten punch, or write 请假/病假/出差 in the note to excuse the day.
- **Workbooks**: a summary per person with the day-by-day detail highlighted, plus one workbook per person.
- **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 `attendance-report/<project>.project.json` and kept until you re-open the inputs.

## Usage

Ask the agent in ZCode Desktop:

- "Make the November attendance report from punches.xlsx"
- "Shift is 9:30–18:30 with 30 minutes flexible start"
- "Mark 赵小雨 on leave on 11-18 and 11-19 and export"

## Tools

| Tool | Purpose |
|---|---|
| `attend_open` | Read the punch records and work out each day. Opens the panel |
| `attend_edit` | Change settings, edit cells by row, add or remove rows |
| `attend_status` | Show the current rows, issues and summary |
| `attend_export` | Write attendance-<month>.xlsx and people/<name>-<month>.xlsx |

Output goes to `attendance-report/<project>/` in the workspace.

## Scope (v0.1)

- One shift per company in v0.1 — no rotating or night shifts across midnight.
- Leave balances and payroll are not calculated.

## 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 `attendance-report/` folder in the workspace. No hooks.

## Build and test (developers)

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

## Third-party components and licenses

MIT licensed (author: Penova). Bundled: 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/attendance-report/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 考勤统计

把考勤机或打卡应用导出的原始打卡记录,变成每月的考勤统计。选上导出文件,设置上下班时间、迟到宽限、弹性上班、午休、加班规则、休息日和节假日,就能看到每个人每天的首末次打卡、迟到、早退、缺卡、缺勤和加班。忘打卡的可以直接在表里补,请假、出差也在表里标注,然后导出汇总表和每人一份的明细给本人核对。在本地运行,不用人事系统,无需 API 密钥。

## 功能

- **适配各种打卡导出**:每行一次打卡,含 姓名 和 打卡时间(或 日期 + 时间),CSV 或 Excel;重复打卡自动合并。
- **按你的规则**:上下班时间、迟到和早退宽限、弹性上班、午休、加班起算和最少时长。
- **日历**:双休、单休或无固定休息日;节假日和调休上班日。
- **逐日判断**:迟到、早退、缺卡、缺勤、工作日和休息日加班、工作时长。
- **表内修正**:补上忘打的卡,或在备注写 请假/病假/出差 即不算缺勤。
- **Excel 报表**:每人一行的汇总表,附逐日明细并标色;另给每人一份明细。
- **面板**:在 ZCode 侧栏里选择输入文件、调整设置、查看问题、直接修改表格里的任意单元格、预览成品并导出。修改保存在 `attendance-report/<项目>.project.json`,重新打开输入文件前一直保留。

## 使用方法

在 ZCode 桌面端对助手说:

- “用 punches.xlsx 做 11 月考勤统计”
- “上班时间 9:30–18:30,弹性 30 分钟”
- “赵小雨 11-18、11-19 请年假,然后导出”

## 工具

| 工具 | 作用 |
|---|---|
| `attend_open` | 读取打卡记录并逐日计算,并打开面板 |
| `attend_edit` | 修改设置、按行修改单元格、新增或删除行 |
| `attend_status` | 查看当前数据、问题和汇总 |
| `attend_export` | 导出 attendance-<月份>.xlsx 和 people/<姓名>-<月份>.xlsx |

导出文件写到工作区的 `attendance-report/<项目>/` 文件夹。

## 范围(v0.1)

- v0.1 只支持一种固定班次,不支持轮班和跨零点的夜班。
- 不计算假期余额和工资。

## 隐私、网络与文件

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

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

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

## 第三方组件与许可证

MIT 许可(作者:Penova)。打包的组件: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: attendance-report
description: 把考勤机或打卡应用导出的原始打卡记录,变成每月的考勤统计。选上导出文件,设置上下班时间、迟到宽限、弹性上班、午休、加班规则、休息日和节假日,就能看到每个人每天的首末次打卡、迟到、早退、缺卡、缺勤和加班。忘打卡的可以直接在表里补,请假、出差也在表里标注,然后导出汇总表和每人一份的明细给本人核对。在本地运行,不用人事系统,无需 API 密钥。 用户提到“考勤统计 / 打卡记录 / 迟到早退 / 加班统计 / 缺卡 / 月度考勤”时使用。
---

# 考勤统计

1. `attend_open(inputs, settings?, project?)`:读取打卡记录并逐日计算。inputs 是工作区相对路径。
- 结果里有汇总、问题列表(错误 / 提醒)和前几行数据,每行有编号 `#n`。
- settings: {month: "2026-11", start: "09:00", end: "18:00", grace: 5, elastic: 0, lunch: 60, otAfter: 30, otMin: 30, weekend: "sat-sun", holidays, workdays};weekend 可为 sat-sun/sun/none。
2. 向用户简要说明结果,先说错误和需要确认的地方,不要逐行念。
3. 用户要改时调用 `attend_edit(project, settings?, set?: [{row, values}], add?, remove?)`。
- 每行是一个人的一天:`set: [{row, values: {in: "08:55", out, note: "请假"}}]`;date 不可改。
4. `attend_export(project, formats?)`:导出 attendance-<月份>.xlsx 和 people/<姓名>-<月份>.xlsx。把文件路径告诉用户。
5. 不要替用户编造请假记录;只标注用户明确说过的。
52 changes: 52 additions & 0 deletions marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,58 @@
"把上一个 Hi3D 任务生成的模型按角色拆分成部件"
]
}
},
{
"name": "attendance-report",
"componentTypes": [
"ui"
],
"source": "./external_plugins/attendance-report",
"displayName": "Attendance Report",
"displayName_i18n": {
"en": "Attendance Report",
"zh-CN": "考勤统计"
},
"description": "Turn the raw punch records from your time clock or attendance app into a monthly attendance report. Pick the export, set the shift hours, grace minutes, flexible start, lunch break, overtime rule, rest days and holidays, and see for each person and day the first and last punch, late arrivals, early leaves, missing punches, absences and overtime. Fix a forgotten punch or mark leave and business trips right in the table, then export a summary workbook and one workbook per person for them to check. Runs locally; no HR system or API keys.",
"description_i18n": {
"en": "Turn the raw punch records from your time clock or attendance app into a monthly attendance report. Pick the export, set the shift hours, grace minutes, flexible start, lunch break, overtime rule, rest days and holidays, and see for each person and day the first and last punch, late arrivals, early leaves, missing punches, absences and overtime. Fix a forgotten punch or mark leave and business trips right in the table, then export a summary workbook and one workbook per person for them to check. Runs locally; no HR system or API keys.",
"zh-CN": "把考勤机或打卡应用导出的原始打卡记录,变成每月的考勤统计。选上导出文件,设置上下班时间、迟到宽限、弹性上班、午休、加班规则、休息日和节假日,就能看到每个人每天的首末次打卡、迟到、早退、缺卡、缺勤和加班。忘打卡的可以直接在表里补,请假、出差也在表里标注,然后导出汇总表和每人一份的明细给本人核对。在本地运行,不用人事系统,无需 API 密钥。"
},
"version": "0.1.0",
"author": {
"name": "Penova",
"url": "https://github.com/ppppp2005-p"
},
"license": "MIT",
"category": "productivity",
"keywords": [
"attendance",
"time clock",
"punch",
"clock in",
"late",
"overtime",
"timesheet",
"考勤",
"打卡",
"迟到",
"早退",
"加班",
"缺卡",
"考勤统计"
],
"examplePrompts": [
"Make the November attendance report from punches.xlsx",
"Shift is 9:30–18:30 with 30 minutes flexible start",
"Mark 赵小雨 on leave on 11-18 and 11-19 and export"
],
"examplePrompts_i18n": {
"zh-CN": [
"用 punches.xlsx 做 11 月考勤统计",
"上班时间 9:30–18:30,弹性 30 分钟",
"赵小雨 11-18、11-19 请年假,然后导出"
]
}
}
]
}
Loading