From adbc5bc0c37a6f0c7cbc7de6e698e1485cbb862a Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:21:57 -0400 Subject: [PATCH 01/11] feat(ui-plugins): add Attendance Report (attendance-report) --- marketplace.json | 52 ++ pnpm-lock.yaml | 1389 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 1400 insertions(+), 41 deletions(-) diff --git a/marketplace.json b/marketplace.json index 32e8c8ef..3898fb03 100644 --- a/marketplace.json +++ b/marketplace.json @@ -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 请年假,然后导出" + ] + } } ] } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 14b35f76..0348fc3a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,6 +42,40 @@ importers: specifier: 4.6.5 version: 4.6.5 + ui-plugins/attendance-report: + dependencies: + '@modelcontextprotocol/sdk': + specifier: 1.29.0 + version: 1.29.0(zod@4.6.5) + exceljs: + specifier: 4.4.0 + version: 4.4.0 + zod: + specifier: ^4.6.5 + version: 4.6.5 + devDependencies: + '@modelcontextprotocol/core': + specifier: 2.0.0 + version: 2.0.0 + '@modelcontextprotocol/ext-apps': + specifier: 2.0.0 + version: 2.0.0(@modelcontextprotocol/client@2.2.0)(@modelcontextprotocol/core@2.0.0)(@modelcontextprotocol/server@2.0.0)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(zod@4.6.5) + '@types/node': + specifier: 25.5.0 + version: 25.5.0 + esbuild: + specifier: ^0.25.12 + version: 0.25.12 + playwright-core: + specifier: 1.59.1 + version: 1.59.1 + typescript: + specifier: 6.0.2 + version: 6.0.2 + vitest: + specifier: 4.1.4 + version: 4.1.4(@opentelemetry/api@1.9.1)(@types/node@25.5.0)(msw@2.13.3(@types/node@25.5.0)(typescript@6.0.2))(vite@8.3.1(@types/node@25.5.0)(esbuild@0.25.12)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.9.0)) + ui-plugins/cadcraft: {} ui-plugins/craft-runtime: {} @@ -745,6 +779,12 @@ packages: resolution: {integrity: sha512-nULYsQxkWHnbmHvcs+efMkJ4/9TtvNyFeLyHdeGxW0zHs6P+jYVqcRff9A6Vq9w9JXeDRnRh2VKvTtS19GW2qA==} engines: {node: '>=10'} + '@fast-csv/format@4.3.5': + resolution: {integrity: sha512-8iRn6QF3I8Ak78lNAa+Gdl5MJJBM5vRHivFtMRUWINdevNo00K7OXxS2PshawLKTejVwieIlPmK5YlLu6w4u8A==} + + '@fast-csv/parse@4.3.6': + resolution: {integrity: sha512-uRsLYksqpbDmWaSmzvJcuApSEe38+6NQZBUsuAyMZKqHxH0g1wcJgsKUvN3WC8tewaqFjBMMGrkHmC+T7k8LvA==} + '@floating-ui/core@1.7.5': resolution: {integrity: sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==} @@ -1875,6 +1915,9 @@ packages: '@types/geojson@7946.0.16': resolution: {integrity: sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==} + '@types/node@14.18.63': + resolution: {integrity: sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==} + '@types/node@22.20.4': resolution: {integrity: sha512-zJRE40jpHtKqE/C4fgHrAKQLJuSpzEnP9ff9Y7YtoR3Wd2pwqzlekDeEuUQXjRd+QCYnVnNwuJYmhdk9XV8gvA==} @@ -2018,29 +2061,85 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + archiver-utils@2.1.0: + resolution: {integrity: sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==} + engines: {node: '>= 6'} + + archiver-utils@3.0.4: + resolution: {integrity: sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==} + engines: {node: '>= 10'} + + archiver@5.3.2: + resolution: {integrity: sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==} + engines: {node: '>= 10'} + aria-hidden@1.2.6: resolution: {integrity: sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==} engines: {node: '>=10'} + array-buffer-byte-length@1.0.2: + resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} + engines: {node: '>= 0.4'} + + arraybuffer.prototype.slice@1.0.4: + resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} + engines: {node: '>= 0.4'} + assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} + async-function@1.0.0: + resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} + engines: {node: '>= 0.4'} + + async@3.2.6: + resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} + + available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + base64-arraybuffer@1.0.2: resolution: {integrity: sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==} engines: {node: '>= 0.6.0'} + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + + big-integer@1.6.52: + resolution: {integrity: sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==} + engines: {node: '>=0.6'} + binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} + binary@0.3.0: + resolution: {integrity: sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg==} + bind-event-listener@3.0.0: resolution: {integrity: sha512-PJvH288AWQhKs2v9zyfYdPzlPqf5bXbGMmhmUIY9x4dAUGIWgomO771oBQNwJnMQSnUIXhKu6sgzpBRXTlvb8Q==} + bl@4.1.0: + resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + + bluebird@3.4.7: + resolution: {integrity: sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==} + body-parser@2.2.2: resolution: {integrity: sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==} engines: {node: '>=18'} + brace-expansion@1.1.22: + resolution: {integrity: sha512-CKLDTuSsN0+r1ThM0WkzzBI7dnPI6xEGfa/JnVYIK9JNBA1N1NyPwXVHor//NKD/y3sDxp764sZdLhFK7pH8XQ==} + + brace-expansion@2.1.8: + resolution: {integrity: sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig==} + braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} @@ -2048,6 +2147,20 @@ packages: browser-fs-access@0.29.1: resolution: {integrity: sha512-LSvVX5e21LRrXqVMhqtAwj5xPgDb+fXAIH80NsnCQ9xuZPs2xWsOREi24RKgZa1XOiQRbcmVrv87+ulOKsgjxw==} + buffer-crc32@0.2.13: + resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} + + buffer-indexof-polyfill@1.0.2: + resolution: {integrity: sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==} + engines: {node: '>=0.10'} + + buffer@5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + + buffers@0.1.1: + resolution: {integrity: sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ==} + engines: {node: '>=0.2.0'} + bun@1.3.11: resolution: {integrity: sha512-AvXWYFO6j/ZQ7bhGm4X6eilq2JHsDVC90ZM32k2B7/srhC2gs3Sdki1QTbwrdRCo8o7eT+167vcB1yzOvPdbjA==} cpu: [arm64, x64] @@ -2062,6 +2175,10 @@ packages: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} + call-bind@1.0.9: + resolution: {integrity: sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==} + engines: {node: '>= 0.4'} + call-bound@1.0.4: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} @@ -2080,6 +2197,9 @@ packages: resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} engines: {node: '>=18'} + chainsaw@0.1.0: + resolution: {integrity: sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ==} + chevrotain-allstar@0.3.1: resolution: {integrity: sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==} peerDependencies: @@ -2136,6 +2256,13 @@ packages: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} + compress-commons@4.1.2: + resolution: {integrity: sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==} + engines: {node: '>= 10'} + + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + confbox@0.1.8: resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} @@ -2182,6 +2309,15 @@ packages: resolution: {integrity: sha512-kucVIjOmMc1f0tv53BJ/5WIX+MGLcKuoBhnGqQrgKJNqLByb/sVMWfW/Aw6hw0jgcqjJ2pi9E5y32zOIpaUlsA==} engines: {node: '>=0.8'} + crc-32@1.2.2: + resolution: {integrity: sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==} + engines: {node: '>=0.8'} + hasBin: true + + crc32-stream@4.0.3: + resolution: {integrity: sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==} + engines: {node: '>= 10'} + crelt@1.0.7: resolution: {integrity: sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA==} @@ -2369,6 +2505,18 @@ packages: dagre-d3-es@7.0.14: resolution: {integrity: sha512-P4rFMVq9ESWqmOgK+dlXvOtLwYg0i7u0HBGJER0LZDJT2VHIPAMZ/riPxqJceWMStH5+E61QxFra9kIS3AqdMg==} + data-view-buffer@1.0.2: + resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} + engines: {node: '>= 0.4'} + + data-view-byte-length@1.0.2: + resolution: {integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==} + engines: {node: '>= 0.4'} + + data-view-byte-offset@1.0.1: + resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} + engines: {node: '>= 0.4'} + dayjs@1.11.20: resolution: {integrity: sha512-YbwwqR/uYpeoP4pu043q+LTDLFBLApUP6VxRihdfNTqu4ubqMlGDLd6ErXhEgsyvY0K6nCs7nggYumAN+9uEuQ==} @@ -2381,6 +2529,14 @@ packages: supports-color: optional: true + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + + define-properties@1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} + engines: {node: '>= 0.4'} + defu@6.1.7: resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} @@ -2412,6 +2568,9 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} + duplexer2@0.1.4: + resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} + ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -2422,10 +2581,21 @@ packages: resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} engines: {node: '>= 0.8'} + end-of-stream@1.4.5: + resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} + entities@7.0.1: resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} engines: {node: '>=0.12'} + es-abstract-get@1.0.0: + resolution: {integrity: sha512-6PMWXpdhshVvFp+FoWYs1EvG1Nj0tvk0dZM+XcK0xMEM1czRVcP6ohqPWHy6qPagSpC8j4+p89WXlT+xXJs/fg==} + engines: {node: '>= 0.4'} + + es-abstract@1.24.2: + resolution: {integrity: sha512-2FpH9Q5i2RRwyEP1AylXe6nYLR5OhaJTZwmlcP0dL/+JCbgg7yyEo/sEK6HeGZRf3dFpWwThaRHVApXSkW3xeg==} + engines: {node: '>= 0.4'} + es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} @@ -2441,6 +2611,18 @@ packages: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} + es-object-atoms@1.1.2: + resolution: {integrity: sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==} + engines: {node: '>= 0.4'} + + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + + es-to-primitive@1.3.4: + resolution: {integrity: sha512-yPDz7wqpg1/mmHLmS3tcfTfbw5f1eryXvyghYBffGdERwe+mV7ZcWzTR8LR17Kvqt3qfPurjlonmnq3MKXIOXw==} + engines: {node: '>= 0.4'} + es-toolkit@1.46.1: resolution: {integrity: sha512-5eNtXOs3tbfxXOj04tjjseeWkRWaoCjdEI+96DgwzZoe6c9juL49pXlzAFTI72aWC9Y8p7168g6XIKjh7k6pyQ==} @@ -2475,10 +2657,6 @@ packages: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} - eventsource-parser@3.1.0: - resolution: {integrity: sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg==} - engines: {node: '>=18.0.0'} - eventsource-parser@3.1.1: resolution: {integrity: sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==} engines: {node: '>=18.0.0'} @@ -2487,6 +2665,10 @@ packages: resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==} engines: {node: '>=18.0.0'} + exceljs@4.4.0: + resolution: {integrity: sha512-XctvKaEMaj1Ii9oDOqbW/6e1gXknSY4g/aLCDicOXqBE4M0nRWkUu0PTp++UPNzoFY12BNHMfs/VadKIS6llvg==} + engines: {node: '>=8.3.0'} + expect-type@1.4.0: resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} engines: {node: '>=12.0.0'} @@ -2504,6 +2686,10 @@ packages: resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} engines: {node: '>= 18'} + fast-csv@4.3.6: + resolution: {integrity: sha512-2RNSpuwwsJGP0frGsOmTb9oUF+VkFSM4SyLTDgwf2ciHWTarN0lQTC+F2f/t5J9QjW+c65VFIAAu85GsvMIusw==} + engines: {node: '>=10.0.0'} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -2539,6 +2725,10 @@ packages: fontoxpath@3.34.0: resolution: {integrity: sha512-7FgBQRohn4WR/2eVdYqZtKBFZkJNaiP4kGdfqS6bAg465og05ixGA2OgfMdxsO1mnX67+64JX/8JKclVqS+bzA==} + for-each@0.3.5: + resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} + engines: {node: '>= 0.4'} + forwarded@0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} @@ -2551,14 +2741,32 @@ packages: resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} engines: {node: '>= 0.8'} + fs-constants@1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + fstream@1.0.12: + resolution: {integrity: sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==} + engines: {node: '>=0.6'} + deprecated: This package is no longer supported. + function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + function.prototype.name@1.2.0: + resolution: {integrity: sha512-jObKIik1P2QjPHP5nz5BaOtUlfgS0fWo8IUByNXkM+o+02sJOi94em77GwJKQSJ3gfPHdgzLNrHc1uokV4P/ew==} + engines: {node: '>= 0.4'} + + functions-have-names@1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + fuzzy@0.1.3: resolution: {integrity: sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w==} engines: {node: '>= 0.6.0'} @@ -2566,6 +2774,10 @@ packages: fzstd@0.1.1: resolution: {integrity: sha512-dkuVSOKKwh3eas5VkJy1AW1vFpet8TA/fGmVA5krThl8YcOVE/8ZIoEA1+U1vEn5ckxxhLirSdY837azmbaNHA==} + generator-function@2.0.1: + resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==} + engines: {node: '>= 0.4'} + get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} @@ -2582,6 +2794,10 @@ packages: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} + get-symbol-description@1.1.0: + resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} + engines: {node: '>= 0.4'} + get-tsconfig@4.13.7: resolution: {integrity: sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q==} @@ -2589,6 +2805,14 @@ packages: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + + globalthis@1.0.4: + resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} + engines: {node: '>= 0.4'} + glur@1.1.2: resolution: {integrity: sha512-l+8esYHTKOx2G/Aao4lEQ0bnHWg4fWtJbVoZZT9Knxi01pB8C80BR85nONLFwkkQoFRCmXY+BUcGZN3yZ2QsRA==} @@ -2596,6 +2820,9 @@ packages: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} + graceful-fs@4.2.12: + resolution: {integrity: sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw==} + graphql@16.13.2: resolution: {integrity: sha512-5bJ+nf/UCpAjHM8i06fl7eLyVC9iuNAjm9qzkiu2ZGhM0VscSvS6WDPfAwkdkBuoXGM9FJSbKl6wylMwP9Ktig==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} @@ -2603,14 +2830,33 @@ packages: hachure-fill@0.5.2: resolution: {integrity: sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==} + has-bigints@1.1.0: + resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} + engines: {node: '>= 0.4'} + + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + + has-proto@1.2.0: + resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} + engines: {node: '>= 0.4'} + has-symbols@1.1.0: resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} engines: {node: '>= 0.4'} + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + hasown@2.0.4: + resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} + engines: {node: '>= 0.4'} + headers-polyfill@4.0.3: resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==} @@ -2637,6 +2883,9 @@ packages: resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==} engines: {node: '>=0.10.0'} + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + image-blob-reduce@3.0.1: resolution: {integrity: sha512-/VmmWgIryG/wcn4TVrV7cC4mlfUC/oyiKIfSg5eVM3Ten/c1c34RJhMYKCWTnoSMHSqXLt3tsrBR4Q2HInvN+Q==} @@ -2654,9 +2903,17 @@ packages: immutable@4.3.9: resolution: {integrity: sha512-ObHy4YN7ycwZOUCLI1/6svfyAFu7vL8RhAvVu/bh/RZW9EPlOyDaQ9jDQWCtdqzaXUjgXZCW1migtHE7YI7UGQ==} + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + internal-slot@1.1.0: + resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} + engines: {node: '>= 0.4'} + internmap@1.0.1: resolution: {integrity: sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==} @@ -2675,25 +2932,77 @@ packages: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} + is-array-buffer@3.0.5: + resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} + engines: {node: '>= 0.4'} + + is-async-function@2.1.1: + resolution: {integrity: sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==} + engines: {node: '>= 0.4'} + + is-bigint@1.1.0: + resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} + engines: {node: '>= 0.4'} + is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} + is-boolean-object@1.2.2: + resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==} + engines: {node: '>= 0.4'} + + is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + + is-data-view@1.0.2: + resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} + engines: {node: '>= 0.4'} + + is-date-object@1.1.0: + resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} + engines: {node: '>= 0.4'} + + is-document.all@1.0.0: + resolution: {integrity: sha512-+XSoyS05OdBbhFuELhgTCpFNHkpBOJqtsZfUFFpe5QTw+9Sjbh8zitxhQkYAo6wV7e1Vb8cAPvpCk9jGam/82g==} + engines: {node: '>= 0.4'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + is-finalizationregistry@1.1.1: + resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} + engines: {node: '>= 0.4'} + is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-generator-function@1.1.2: + resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==} + engines: {node: '>= 0.4'} + is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-map@2.0.3: + resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} + engines: {node: '>= 0.4'} + + is-negative-zero@2.0.3: + resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} + engines: {node: '>= 0.4'} + is-node-process@1.2.0: resolution: {integrity: sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==} + is-number-object@1.1.1: + resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==} + engines: {node: '>= 0.4'} + is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -2701,9 +3010,48 @@ packages: is-promise@4.0.0: resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} + is-regex@1.2.1: + resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} + engines: {node: '>= 0.4'} + + is-set@2.0.3: + resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} + engines: {node: '>= 0.4'} + + is-shared-array-buffer@1.0.4: + resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} + engines: {node: '>= 0.4'} + + is-string@1.1.1: + resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==} + engines: {node: '>= 0.4'} + + is-symbol@1.1.1: + resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} + engines: {node: '>= 0.4'} + + is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + + is-weakmap@2.0.2: + resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} + engines: {node: '>= 0.4'} + + is-weakref@1.1.1: + resolution: {integrity: sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==} + engines: {node: '>= 0.4'} + + is-weakset@2.0.4: + resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==} + engines: {node: '>= 0.4'} + isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -2714,9 +3062,6 @@ packages: jose@6.2.12: resolution: {integrity: sha512-9NiFmJEex0sy2Dk58j2UGBSHgUs2ypF9eZSu4L6vjOX3Dp96Sw1F3uL+H+D1sx02jZZdzUT0HgvCy59CuvXcWw==} - jose@6.2.2: - resolution: {integrity: sha512-d7kPDd34KO/YnzaDOlikGpOurfF0ByC2sEV4cANCtdqLlTfBlw2p14O/5d/zv40gJPbIQxfES3nSx1/oYNyuZQ==} - jotai-scope@0.7.2: resolution: {integrity: sha512-Gwed97f3dDObrO43++2lRcgOqw4O2sdr4JCjP/7eHK1oPACDJ7xKHGScpJX9XaflU+KBHXF+VhwECnzcaQiShg==} peerDependencies: @@ -2775,6 +3120,10 @@ packages: layout-base@2.0.1: resolution: {integrity: sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==} + lazystream@1.0.1: + resolution: {integrity: sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==} + engines: {node: '>= 0.6.3'} + lie@3.3.0: resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} @@ -2855,6 +3204,9 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + listenercount@1.0.1: + resolution: {integrity: sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ==} + lodash-es@4.17.21: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} @@ -2864,9 +3216,49 @@ packages: lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} + lodash.defaults@4.2.0: + resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} + + lodash.difference@4.5.0: + resolution: {integrity: sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==} + + lodash.escaperegexp@4.1.2: + resolution: {integrity: sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==} + + lodash.flatten@4.4.0: + resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} + + lodash.groupby@4.6.0: + resolution: {integrity: sha512-5dcWxm23+VAoz+awKmBaiBvzox8+RqMgFhi7UvX9DHZr2HdxHXM/Wrf8cfKpsW37RNrvtPn6hSwNqurSILbmJw==} + + lodash.isboolean@3.0.3: + resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==} + + lodash.isequal@4.5.0: + resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + deprecated: This package is deprecated. Use require('node:util').isDeepStrictEqual instead. + + lodash.isfunction@3.0.9: + resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} + + lodash.isnil@4.0.0: + resolution: {integrity: sha512-up2Mzq3545mwVnMhTDMdfoG1OurpA/s5t88JmQX809eH3C8491iu2sfKhTfhQtKY78oPNhiaHJUpT/dUDAAtng==} + + lodash.isplainobject@4.0.6: + resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + + lodash.isundefined@3.0.1: + resolution: {integrity: sha512-MXB1is3s899/cD8jheYYE2V9qTHwKvt+npCwpD+1Sxm3Q3cECXCiYHjeHWXNwr6Q0SOBPrYUDxendrO6goVTEA==} + lodash.throttle@4.1.1: resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==} + lodash.union@4.6.0: + resolution: {integrity: sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==} + + lodash.uniq@4.5.0: + resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} + magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -2906,6 +3298,20 @@ packages: resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} engines: {node: '>=18'} + minimatch@3.1.5: + resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} + + minimatch@5.1.9: + resolution: {integrity: sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==} + engines: {node: '>=10'} + + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + + mkdirp@0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + mlly@1.8.2: resolution: {integrity: sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==} @@ -2974,6 +3380,14 @@ packages: resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} engines: {node: '>= 0.4'} + object-keys@1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + + object.assign@4.1.7: + resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==} + engines: {node: '>= 0.4'} + obug@2.2.1: resolution: {integrity: sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==} engines: {node: '>=12.20.0'} @@ -3001,6 +3415,10 @@ packages: outvariant@1.4.3: resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} + own-keys@1.0.2: + resolution: {integrity: sha512-19YVAg7T+WTrxggPukVq7DjTv6+PJ867TmhCvBsYwmbFCsZd344rq2Ld1p0wo8f8Qrrhgp82c6FJRqdXWtSEhg==} + engines: {node: '>= 0.4'} + oxfmt@0.41.0: resolution: {integrity: sha512-sKLdJZdQ3bw6x9qKiT7+eID4MNEXlDHf5ZacfIircrq6Qwjk0L6t2/JQlZZrVHTXJawK3KaMuBoJnEJPcqCEdg==} engines: {node: ^20.19.0 || >=22.12.0} @@ -3035,6 +3453,10 @@ packages: path-data-parser@0.1.0: resolution: {integrity: sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==} + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -3068,10 +3490,6 @@ packages: resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} engines: {node: '>=8.6'} - picomatch@4.0.4: - resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} - engines: {node: '>=12'} - picomatch@4.0.7: resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} engines: {node: '>=12'} @@ -3110,6 +3528,10 @@ packages: points-on-path@0.2.1: resolution: {integrity: sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==} + possible-typed-array-names@1.1.0: + resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} + engines: {node: '>= 0.4'} + postcss@8.5.28: resolution: {integrity: sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==} engines: {node: ^10 || ^12 || >=14} @@ -3193,13 +3615,28 @@ packages: readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + + readdir-glob@1.1.3: + resolution: {integrity: sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==} + readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + reflect.getprototypeof@1.0.10: + resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} + engines: {node: '>= 0.4'} + regenerator-runtime@0.13.11: resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} + regexp.prototype.flags@1.5.4: + resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} + engines: {node: '>= 0.4'} + reka-ui@2.10.4: resolution: {integrity: sha512-kbS5GAbkHkYj0EVKAg5ZPEPndhBjeUFSa1Aq5m5ftQwyHnB1v5tw8X6fcwfKH/ry3StPXblMWM1DW82MVS71cw==} peerDependencies: @@ -3223,6 +3660,11 @@ packages: resolution: {integrity: sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==} engines: {node: '>= 0.8.15'} + rimraf@2.7.1: + resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + robust-predicates@3.0.3: resolution: {integrity: sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==} @@ -3244,9 +3686,21 @@ packages: rw@1.3.3: resolution: {integrity: sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==} + safe-array-concat@1.1.4: + resolution: {integrity: sha512-wtZlHyOje6OZTGqAoaDKxFkgRtkF9CnHAVnCHKfuj200wAgL+bSJhdsCD2l0Qx/2ekEXjPWcyKkfGb5CPboslg==} + engines: {node: '>=0.4'} + safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + safe-push-apply@1.0.0: + resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} + engines: {node: '>= 0.4'} + + safe-regex-test@1.1.0: + resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} + engines: {node: '>= 0.4'} + safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -3255,6 +3709,10 @@ packages: engines: {node: '>=12.0.0'} hasBin: true + saxes@5.0.1: + resolution: {integrity: sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==} + engines: {node: '>=10'} + scheduler@0.27.0: resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} @@ -3266,6 +3724,18 @@ packages: resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==} engines: {node: '>= 18'} + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + + set-function-name@2.0.2: + resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} + engines: {node: '>= 0.4'} + + set-proto@1.0.0: + resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} + engines: {node: '>= 0.4'} + setimmediate@1.0.5: resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} @@ -3329,6 +3799,10 @@ packages: std-env@4.2.0: resolution: {integrity: sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==} + stop-iteration-iterator@1.1.0: + resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} + engines: {node: '>= 0.4'} + strict-event-emitter@0.5.1: resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} @@ -3336,6 +3810,18 @@ packages: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} + string.prototype.trim@1.2.11: + resolution: {integrity: sha512-PwvK7BU+CMTJGYQCTZb5RWXIML92lftJLhQz1tBzgKiqGxJaMlBAa48POXaNAC2s4y8jr3EFqrkF9+44neS46w==} + engines: {node: '>= 0.4'} + + string.prototype.trimend@1.0.10: + resolution: {integrity: sha512-2+3aDAOmPTmuFwjDnmJG2ctEkQKVki7vOSqaxkv42Mowj1V6PnvuwFCRrR5lChUux1TBskPjfkeTOhqczDMxTw==} + engines: {node: '>= 0.4'} + + string.prototype.trimstart@1.0.8: + resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} + engines: {node: '>= 0.4'} + string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} @@ -3370,6 +3856,10 @@ packages: resolution: {integrity: sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==} engines: {node: '>=20'} + tar-stream@2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + text-segmentation@1.0.3: resolution: {integrity: sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==} @@ -3383,18 +3873,10 @@ packages: tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@1.1.1: - resolution: {integrity: sha512-VKS/ZaQhhkKFMANmAOhhXVoIfBXblQxGX1myCQ2faQrfmobMftXeJPcZGp0gS07ocvGJWDLZGyOZDadDBqYIJg==} - engines: {node: '>=18'} - tinyexec@1.3.1: resolution: {integrity: sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==} engines: {node: '>=18'} - tinyglobby@0.2.16: - resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==} - engines: {node: '>=12.0.0'} - tinyglobby@0.2.17: resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} engines: {node: '>=12.0.0'} @@ -3414,6 +3896,10 @@ packages: resolution: {integrity: sha512-+Zg3vWhRUv8B1maGSTFdev9mjoo8Etn2Ayfs4cnjlD3CsGkxXX4QyW3j2WJ0wdjYcYmy7Lx2RDsZMhgCWafKIw==} hasBin: true + tmp@0.2.7: + resolution: {integrity: sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==} + engines: {node: '>=14.14'} + to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -3426,6 +3912,10 @@ packages: resolution: {integrity: sha512-LktZQb3IeoUWB9lqR5EWTHgW/VTITCXg4D21M+lvybRVdylLrRMnqaIONLVb5mav8vM19m44HIcGq4qASeu2Qw==} engines: {node: '>=16'} + traverse@0.3.10: + resolution: {integrity: sha512-pd6fq5qmiFuPA3TpdqBCqJXlOrSdCSt0l9IZDg83Vbf4x3m/X18prEwMMVM5LXp9vGL9NxjeiDGBrTasqyngXQ==} + engines: {node: '>= 0.4'} + ts-dedent@2.2.0: resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} engines: {node: '>=6.10'} @@ -3455,6 +3945,26 @@ packages: resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} engines: {node: '>= 0.6'} + typed-array-buffer@1.0.3: + resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} + engines: {node: '>= 0.4'} + + typed-array-byte-length@1.0.3: + resolution: {integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==} + engines: {node: '>= 0.4'} + + typed-array-byte-offset@1.0.5: + resolution: {integrity: sha512-0FHJvLPqZ7KJzp17O13jfsAjsqazgrxBu2zEK95PmUz8lv2+GjRuxUInCr2Rk9Dms3ihN21zJ929ZO43yJ95QQ==} + engines: {node: '>= 0.4'} + + typed-array-length@1.0.8: + resolution: {integrity: sha512-phPGCwqr2+Qo0fwniCE8e4pKnGu/yFb5nD5Y8bf0EEeiI5GklnACYA9GFy/DrAeRrKHXvHn+1SUsOWgJp6RO+g==} + engines: {node: '>= 0.4'} + + typedarray.prototype.slice@1.0.6: + resolution: {integrity: sha512-r+7YvGfM5TkTiDQ5EqWi/Z4L4KP3jUI+YCmTtWg1tmTHUw6xladLJqzR2heMaHBIM0TTFLZmn/EkIaEHYs/bIA==} + engines: {node: '>= 0.4'} + typescript@6.0.2: resolution: {integrity: sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==} engines: {node: '>=14.17'} @@ -3463,6 +3973,10 @@ packages: ufo@1.6.3: resolution: {integrity: sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==} + unbox-primitive@1.1.0: + resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} + engines: {node: '>= 0.4'} + undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} @@ -3483,6 +3997,9 @@ packages: until-async@3.0.2: resolution: {integrity: sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw==} + unzipper@0.10.14: + resolution: {integrity: sha512-ti4wZj+0bQTiX2KmKWuwj7lhV+2n//uXEotUmGuQqrbVZSEGFMbI68+c6JCQ8aAmUWYvtHEz2A8K6wXvueR/6g==} + use-callback-ref@1.3.3: resolution: {integrity: sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==} engines: {node: '>=10'} @@ -3518,6 +4035,11 @@ packages: resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} hasBin: true + uuid@8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). + hasBin: true + vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} @@ -3654,6 +4176,22 @@ packages: webworkify@1.5.0: resolution: {integrity: sha512-AMcUeyXAhbACL8S2hqqdqOLqvJ8ylmIbNwUIqQujRSouf4+eUFaXbG6F1Rbu+srlJMmxQWsiU7mOJi0nMBfM1g==} + which-boxed-primitive@1.1.1: + resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} + engines: {node: '>= 0.4'} + + which-builtin-type@1.2.1: + resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} + engines: {node: '>= 0.4'} + + which-collection@1.0.2: + resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} + engines: {node: '>= 0.4'} + + which-typed-array@1.1.24: + resolution: {integrity: sha512-wk4Mf4pR5mRP7eYuuTBCIQ9d0ud2Fv2jRLQpfgnRjbOxAFHmjKFValgTpitVKzJJS8ajnYQV2Du1SZ8j6b/EUQ==} + engines: {node: '>= 0.4'} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -3690,6 +4228,9 @@ packages: utf-8-validate: optional: true + xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + xspattern@3.1.0: resolution: {integrity: sha512-rxtOX8ORJizRqswIdZ72G3thKrHd0Q+TvyUCMByc5VdjDz1nkuZKfPXM3xGdrGi0fwEy+DDJN7DqtAZ06Re4bA==} @@ -3714,6 +4255,10 @@ packages: resolution: {integrity: sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==} engines: {node: '>=18'} + zip-stream@4.1.1: + resolution: {integrity: sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==} + engines: {node: '>= 10'} + zod-to-json-schema@3.25.2: resolution: {integrity: sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==} peerDependencies: @@ -3742,7 +4287,7 @@ snapshots: '@antfu/install-pkg@1.1.0': dependencies: package-manager-detector: 1.6.0 - tinyexec: 1.1.1 + tinyexec: 1.3.1 '@atlaskit/pragmatic-drag-and-drop-hitbox@1.2.0': dependencies: @@ -4105,6 +4650,25 @@ snapshots: '@excalidraw/random-username@1.1.0': {} + '@fast-csv/format@4.3.5': + dependencies: + '@types/node': 14.18.63 + lodash.escaperegexp: 4.1.2 + lodash.isboolean: 3.0.3 + lodash.isequal: 4.5.0 + lodash.isfunction: 3.0.9 + lodash.isnil: 4.0.0 + + '@fast-csv/parse@4.3.6': + dependencies: + '@types/node': 14.18.63 + lodash.escaperegexp: 4.1.2 + lodash.groupby: 4.6.0 + lodash.isfunction: 3.0.9 + lodash.isnil: 4.0.0 + lodash.isundefined: 3.0.1 + lodash.uniq: 4.5.0 + '@floating-ui/core@1.7.5': dependencies: '@floating-ui/utils': 0.2.11 @@ -4285,11 +4849,11 @@ snapshots: cors: 2.8.6 cross-spawn: 7.0.6 eventsource: 3.0.7 - eventsource-parser: 3.1.0 + eventsource-parser: 3.1.1 express: 5.2.1 express-rate-limit: 8.3.2(express@5.2.1) hono: 4.12.12 - jose: 6.2.2 + jose: 6.2.12 json-schema-typed: 8.0.2 pkce-challenge: 5.0.1 raw-body: 3.0.2 @@ -5108,6 +5672,8 @@ snapshots: '@types/geojson@7946.0.16': {} + '@types/node@14.18.63': {} + '@types/node@22.20.4': dependencies: undici-types: 6.21.0 @@ -5288,19 +5854,97 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.2 + archiver-utils@2.1.0: + dependencies: + glob: 7.2.3 + graceful-fs: 4.2.12 + lazystream: 1.0.1 + lodash.defaults: 4.2.0 + lodash.difference: 4.5.0 + lodash.flatten: 4.4.0 + lodash.isplainobject: 4.0.6 + lodash.union: 4.6.0 + normalize-path: 3.0.0 + readable-stream: 2.3.8 + + archiver-utils@3.0.4: + dependencies: + glob: 7.2.3 + graceful-fs: 4.2.12 + lazystream: 1.0.1 + lodash.defaults: 4.2.0 + lodash.difference: 4.5.0 + lodash.flatten: 4.4.0 + lodash.isplainobject: 4.0.6 + lodash.union: 4.6.0 + normalize-path: 3.0.0 + readable-stream: 3.6.2 + + archiver@5.3.2: + dependencies: + archiver-utils: 2.1.0 + async: 3.2.6 + buffer-crc32: 0.2.13 + readable-stream: 3.6.2 + readdir-glob: 1.1.3 + tar-stream: 2.2.0 + zip-stream: 4.1.1 + aria-hidden@1.2.6: dependencies: tslib: 2.8.1 + array-buffer-byte-length@1.0.2: + dependencies: + call-bound: 1.0.4 + is-array-buffer: 3.0.5 + + arraybuffer.prototype.slice@1.0.4: + dependencies: + array-buffer-byte-length: 1.0.2 + call-bind: 1.0.9 + define-properties: 1.2.1 + es-abstract: 1.24.2 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + is-array-buffer: 3.0.5 + assertion-error@2.0.1: {} + async-function@1.0.0: {} + + async@3.2.6: {} + + available-typed-arrays@1.0.7: + dependencies: + possible-typed-array-names: 1.1.0 + + balanced-match@1.0.2: {} + base64-arraybuffer@1.0.2: optional: true + base64-js@1.5.1: {} + + big-integer@1.6.52: {} + binary-extensions@2.3.0: {} + binary@0.3.0: + dependencies: + buffers: 0.1.1 + chainsaw: 0.1.0 + bind-event-listener@3.0.0: {} + bl@4.1.0: + dependencies: + buffer: 5.7.1 + inherits: 2.0.4 + readable-stream: 3.6.2 + + bluebird@3.4.7: {} + body-parser@2.2.2: dependencies: bytes: 3.1.2 @@ -5315,12 +5959,32 @@ snapshots: transitivePeerDependencies: - supports-color + brace-expansion@1.1.22: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + brace-expansion@2.1.8: + dependencies: + balanced-match: 1.0.2 + braces@3.0.3: dependencies: fill-range: 7.1.1 browser-fs-access@0.29.1: {} + buffer-crc32@0.2.13: {} + + buffer-indexof-polyfill@1.0.2: {} + + buffer@5.7.1: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + + buffers@0.1.1: {} + bun@1.3.11: optionalDependencies: '@oven/bun-darwin-aarch64': 1.3.11 @@ -5343,6 +6007,13 @@ snapshots: es-errors: 1.3.0 function-bind: 1.1.2 + call-bind@1.0.9: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + get-intrinsic: 1.3.0 + set-function-length: 1.2.2 + call-bound@1.0.4: dependencies: call-bind-apply-helpers: 1.0.2 @@ -5368,6 +6039,10 @@ snapshots: chai@6.2.2: {} + chainsaw@0.1.0: + dependencies: + traverse: 0.3.10 + chevrotain-allstar@0.3.1(chevrotain@11.0.3): dependencies: chevrotain: 11.0.3 @@ -5435,6 +6110,15 @@ snapshots: commander@8.3.0: {} + compress-commons@4.1.2: + dependencies: + buffer-crc32: 0.2.13 + crc32-stream: 4.0.3 + normalize-path: 3.0.0 + readable-stream: 3.6.2 + + concat-map@0.0.1: {} + confbox@0.1.8: {} content-disposition@1.1.0: {} @@ -5470,6 +6154,13 @@ snapshots: crc-32@0.3.0: {} + crc-32@1.2.2: {} + + crc32-stream@4.0.3: + dependencies: + crc-32: 1.2.2 + readable-stream: 3.6.2 + crelt@1.0.7: {} cross-env@7.0.3: @@ -5682,12 +6373,42 @@ snapshots: d3: 7.9.0 lodash-es: 4.18.1 + data-view-buffer@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-data-view: 1.0.2 + + data-view-byte-length@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-data-view: 1.0.2 + + data-view-byte-offset@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-data-view: 1.0.2 + dayjs@1.11.20: {} debug@4.4.3: dependencies: ms: 2.1.3 + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + + define-properties@1.2.1: + dependencies: + define-data-property: 1.1.4 + has-property-descriptors: 1.0.2 + object-keys: 1.1.1 + defu@6.1.7: {} delaunator@5.1.0: @@ -5714,6 +6435,10 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 + duplexer2@0.1.4: + dependencies: + readable-stream: 2.3.8 + ee-first@1.1.1: {} emoji-regex@8.0.0: @@ -5721,8 +6446,76 @@ snapshots: encodeurl@2.0.0: {} + end-of-stream@1.4.5: + dependencies: + once: 1.4.0 + entities@7.0.1: {} + es-abstract-get@1.0.0: + dependencies: + es-errors: 1.3.0 + es-object-atoms: 1.1.2 + is-callable: 1.2.7 + object-inspect: 1.13.4 + + es-abstract@1.24.2: + dependencies: + array-buffer-byte-length: 1.0.2 + arraybuffer.prototype.slice: 1.0.4 + available-typed-arrays: 1.0.7 + call-bind: 1.0.9 + call-bound: 1.0.4 + data-view-buffer: 1.0.2 + data-view-byte-length: 1.0.2 + data-view-byte-offset: 1.0.1 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + es-set-tostringtag: 2.1.0 + es-to-primitive: 1.3.4 + function.prototype.name: 1.2.0 + get-intrinsic: 1.3.0 + get-proto: 1.0.1 + get-symbol-description: 1.1.0 + globalthis: 1.0.4 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + has-proto: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + internal-slot: 1.1.0 + is-array-buffer: 3.0.5 + is-callable: 1.2.7 + is-data-view: 1.0.2 + is-negative-zero: 2.0.3 + is-regex: 1.2.1 + is-set: 2.0.3 + is-shared-array-buffer: 1.0.4 + is-string: 1.1.1 + is-typed-array: 1.1.15 + is-weakref: 1.1.1 + math-intrinsics: 1.1.0 + object-inspect: 1.13.4 + object-keys: 1.1.1 + object.assign: 4.1.7 + own-keys: 1.0.2 + regexp.prototype.flags: 1.5.4 + safe-array-concat: 1.1.4 + safe-push-apply: 1.0.0 + safe-regex-test: 1.1.0 + set-proto: 1.0.0 + stop-iteration-iterator: 1.1.0 + string.prototype.trim: 1.2.11 + string.prototype.trimend: 1.0.10 + string.prototype.trimstart: 1.0.8 + typed-array-buffer: 1.0.3 + typed-array-byte-length: 1.0.3 + typed-array-byte-offset: 1.0.5 + typed-array-length: 1.0.8 + unbox-primitive: 1.1.0 + which-typed-array: 1.1.24 + es-define-property@1.0.1: {} es-errors@1.3.0: {} @@ -5733,6 +6526,26 @@ snapshots: dependencies: es-errors: 1.3.0 + es-object-atoms@1.1.2: + dependencies: + es-errors: 1.3.0 + + es-set-tostringtag@2.1.0: + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + + es-to-primitive@1.3.4: + dependencies: + es-abstract-get: 1.0.0 + es-define-property: 1.0.1 + es-errors: 1.3.0 + is-callable: 1.2.7 + is-date-object: 1.1.0 + is-symbol: 1.1.1 + es-toolkit@1.46.1: {} es6-promise-pool@2.5.0: {} @@ -5809,13 +6622,23 @@ snapshots: etag@1.8.1: {} - eventsource-parser@3.1.0: {} - eventsource-parser@3.1.1: {} eventsource@3.0.7: dependencies: - eventsource-parser: 3.1.0 + eventsource-parser: 3.1.1 + + exceljs@4.4.0: + dependencies: + archiver: 5.3.2 + dayjs: 1.11.20 + fast-csv: 4.3.6 + jszip: 3.10.1 + readable-stream: 3.6.2 + saxes: 5.0.1 + tmp: 0.2.7 + unzipper: 0.10.14 + uuid: 8.3.2 expect-type@1.4.0: {} @@ -5859,6 +6682,11 @@ snapshots: transitivePeerDependencies: - supports-color + fast-csv@4.3.6: + dependencies: + '@fast-csv/format': 4.3.5 + '@fast-csv/parse': 4.3.6 + fast-deep-equal@3.1.3: {} fast-png@6.4.0: @@ -5869,10 +6697,6 @@ snapshots: fast-uri@3.1.0: {} - fdir@6.5.0(picomatch@4.0.4): - optionalDependencies: - picomatch: 4.0.4 - fdir@6.5.0(picomatch@4.0.7): optionalDependencies: picomatch: 4.0.7 @@ -5901,21 +6725,52 @@ snapshots: prsc: 4.0.0 xspattern: 3.1.0 + for-each@0.3.5: + dependencies: + is-callable: 1.2.7 + forwarded@0.2.0: {} fractional-indexing@3.2.0: {} fresh@2.0.0: {} + fs-constants@1.0.0: {} + + fs.realpath@1.0.0: {} + fsevents@2.3.3: optional: true + fstream@1.0.12: + dependencies: + graceful-fs: 4.2.12 + inherits: 2.0.4 + mkdirp: 0.5.6 + rimraf: 2.7.1 + function-bind@1.1.2: {} + function.prototype.name@1.2.0: + dependencies: + call-bind: 1.0.9 + call-bound: 1.0.4 + es-define-property: 1.0.1 + es-errors: 1.3.0 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.2 + hasown: 2.0.4 + is-callable: 1.2.7 + is-document.all: 1.0.0 + + functions-have-names@1.2.3: {} + fuzzy@0.1.3: {} fzstd@0.1.1: {} + generator-function@2.0.1: {} + get-caller-file@2.0.5: optional: true @@ -5939,6 +6794,12 @@ snapshots: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 + get-symbol-description@1.1.0: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + get-tsconfig@4.13.7: dependencies: resolve-pkg-maps: 1.0.0 @@ -5948,21 +6809,55 @@ snapshots: dependencies: is-glob: 4.0.3 + glob@7.2.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.5 + once: 1.4.0 + path-is-absolute: 1.0.1 + + globalthis@1.0.4: + dependencies: + define-properties: 1.2.1 + gopd: 1.2.0 + glur@1.1.2: {} gopd@1.2.0: {} + graceful-fs@4.2.12: {} + graphql@16.13.2: optional: true hachure-fill@0.5.2: {} + has-bigints@1.1.0: {} + + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.1 + + has-proto@1.2.0: + dependencies: + dunder-proto: 1.0.1 + has-symbols@1.1.0: {} + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + hasown@2.0.2: dependencies: function-bind: 1.1.2 + hasown@2.0.4: + dependencies: + function-bind: 1.1.2 + headers-polyfill@4.0.3: optional: true @@ -5992,6 +6887,8 @@ snapshots: dependencies: safer-buffer: 2.1.2 + ieee754@1.2.1: {} + image-blob-reduce@3.0.1: dependencies: pica: 7.1.1 @@ -6007,8 +6904,19 @@ snapshots: immutable@4.3.9: {} + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + inherits@2.0.4: {} + internal-slot@1.1.0: + dependencies: + es-errors: 1.3.0 + hasown: 2.0.2 + side-channel: 1.1.0 + internmap@1.0.1: {} internmap@2.0.3: {} @@ -6019,28 +6927,130 @@ snapshots: ipaddr.js@1.9.1: {} + is-array-buffer@3.0.5: + dependencies: + call-bind: 1.0.9 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + + is-async-function@2.1.1: + dependencies: + async-function: 1.0.0 + call-bound: 1.0.4 + get-proto: 1.0.1 + has-tostringtag: 1.0.2 + safe-regex-test: 1.1.0 + + is-bigint@1.1.0: + dependencies: + has-bigints: 1.1.0 + is-binary-path@2.1.0: dependencies: binary-extensions: 2.3.0 + is-boolean-object@1.2.2: + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + + is-callable@1.2.7: {} + + is-data-view@1.0.2: + dependencies: + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + is-typed-array: 1.1.15 + + is-date-object@1.1.0: + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + + is-document.all@1.0.0: + dependencies: + call-bound: 1.0.4 + is-extglob@2.1.1: {} + is-finalizationregistry@1.1.1: + dependencies: + call-bound: 1.0.4 + is-fullwidth-code-point@3.0.0: optional: true + is-generator-function@1.1.2: + dependencies: + call-bound: 1.0.4 + generator-function: 2.0.1 + get-proto: 1.0.1 + has-tostringtag: 1.0.2 + safe-regex-test: 1.1.0 + is-glob@4.0.3: dependencies: is-extglob: 2.1.1 + is-map@2.0.3: {} + + is-negative-zero@2.0.3: {} + is-node-process@1.2.0: optional: true + is-number-object@1.1.1: + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + is-number@7.0.0: {} is-promise@4.0.0: {} + is-regex@1.2.1: + dependencies: + call-bound: 1.0.4 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + + is-set@2.0.3: {} + + is-shared-array-buffer@1.0.4: + dependencies: + call-bound: 1.0.4 + + is-string@1.1.1: + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + + is-symbol@1.1.1: + dependencies: + call-bound: 1.0.4 + has-symbols: 1.1.0 + safe-regex-test: 1.1.0 + + is-typed-array@1.1.15: + dependencies: + which-typed-array: 1.1.24 + + is-weakmap@2.0.2: {} + + is-weakref@1.1.1: + dependencies: + call-bound: 1.0.4 + + is-weakset@2.0.4: + dependencies: + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + isarray@1.0.0: {} + isarray@2.0.5: {} + isexe@2.0.0: {} jiti@2.6.1: @@ -6048,8 +7058,6 @@ snapshots: jose@6.2.12: {} - jose@6.2.2: {} - jotai-scope@0.7.2(jotai@2.11.0(@types/react@19.2.14)(react@19.2.7))(react@19.2.7): dependencies: jotai: 2.11.0(@types/react@19.2.14)(react@19.2.7) @@ -6115,6 +7123,10 @@ snapshots: layout-base@2.0.1: {} + lazystream@1.0.1: + dependencies: + readable-stream: 2.3.8 + lie@3.3.0: dependencies: immediate: 3.0.6 @@ -6170,14 +7182,42 @@ snapshots: lines-and-columns@1.2.4: {} + listenercount@1.0.1: {} + lodash-es@4.17.21: {} lodash-es@4.18.1: {} lodash.debounce@4.0.8: {} + lodash.defaults@4.2.0: {} + + lodash.difference@4.5.0: {} + + lodash.escaperegexp@4.1.2: {} + + lodash.flatten@4.4.0: {} + + lodash.groupby@4.6.0: {} + + lodash.isboolean@3.0.3: {} + + lodash.isequal@4.5.0: {} + + lodash.isfunction@3.0.9: {} + + lodash.isnil@4.0.0: {} + + lodash.isplainobject@4.0.6: {} + + lodash.isundefined@3.0.1: {} + lodash.throttle@4.1.1: {} + lodash.union@4.6.0: {} + + lodash.uniq@4.5.0: {} + magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -6224,6 +7264,20 @@ snapshots: dependencies: mime-db: 1.54.0 + minimatch@3.1.5: + dependencies: + brace-expansion: 1.1.22 + + minimatch@5.1.9: + dependencies: + brace-expansion: 2.1.8 + + minimist@1.2.8: {} + + mkdirp@0.5.6: + dependencies: + minimist: 1.2.8 + mlly@1.8.2: dependencies: acorn: 8.16.0 @@ -6293,6 +7347,17 @@ snapshots: object-inspect@1.13.4: {} + object-keys@1.1.1: {} + + object.assign@4.1.7: + dependencies: + call-bind: 1.0.9 + call-bound: 1.0.4 + define-properties: 1.2.1 + es-object-atoms: 1.1.1 + has-symbols: 1.1.0 + object-keys: 1.1.1 + obug@2.2.1: {} ofetch@1.5.1: @@ -6318,6 +7383,13 @@ snapshots: outvariant@1.4.3: optional: true + own-keys@1.0.2: + dependencies: + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + object-keys: 1.1.1 + safe-push-apply: 1.0.0 + oxfmt@0.41.0: dependencies: tinypool: 2.1.0 @@ -6376,6 +7448,8 @@ snapshots: path-data-parser@0.1.0: {} + path-is-absolute@1.0.1: {} + path-key@3.1.1: {} path-to-regexp@6.3.0: @@ -6406,8 +7480,6 @@ snapshots: picomatch@2.3.2: {} - picomatch@4.0.4: {} - picomatch@4.0.7: {} pirates@4.0.7: {} @@ -6442,6 +7514,8 @@ snapshots: path-data-parser: 0.1.0 points-on-curve: 0.2.0 + possible-typed-array-names@1.1.0: {} + postcss@8.5.28: dependencies: nanoid: 3.3.19 @@ -6534,13 +7608,43 @@ snapshots: string_decoder: 1.1.1 util-deprecate: 1.0.2 + readable-stream@3.6.2: + dependencies: + inherits: 2.0.4 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + + readdir-glob@1.1.3: + dependencies: + minimatch: 5.1.9 + readdirp@3.6.0: dependencies: picomatch: 2.3.2 + reflect.getprototypeof@1.0.10: + dependencies: + call-bind: 1.0.9 + define-properties: 1.2.1 + es-abstract: 1.24.2 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + get-intrinsic: 1.3.0 + get-proto: 1.0.1 + which-builtin-type: 1.2.1 + regenerator-runtime@0.13.11: optional: true + regexp.prototype.flags@1.5.4: + dependencies: + call-bind: 1.0.9 + define-properties: 1.2.1 + es-errors: 1.3.0 + get-proto: 1.0.1 + gopd: 1.2.0 + set-function-name: 2.0.2 + reka-ui@2.10.4(vue@3.5.42(typescript@6.0.2)): dependencies: '@floating-ui/dom': 1.7.6 @@ -6571,6 +7675,10 @@ snapshots: rgbcolor@1.0.1: optional: true + rimraf@2.7.1: + dependencies: + glob: 7.2.3 + robust-predicates@3.0.3: {} rolldown@1.2.11: @@ -6620,8 +7728,27 @@ snapshots: rw@1.3.3: {} + safe-array-concat@1.1.4: + dependencies: + call-bind: 1.0.9 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + has-symbols: 1.1.0 + isarray: 2.0.5 + safe-buffer@5.1.2: {} + safe-push-apply@1.0.0: + dependencies: + es-errors: 1.3.0 + isarray: 2.0.5 + + safe-regex-test@1.1.0: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-regex: 1.2.1 + safer-buffer@2.1.2: {} sass@1.51.0: @@ -6630,6 +7757,10 @@ snapshots: immutable: 4.3.9 source-map-js: 1.2.1 + saxes@5.0.1: + dependencies: + xmlchars: 2.2.0 + scheduler@0.27.0: {} send@1.2.1: @@ -6657,6 +7788,28 @@ snapshots: transitivePeerDependencies: - supports-color + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.3.0 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + + set-function-name@2.0.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.2 + + set-proto@1.0.0: + dependencies: + dunder-proto: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + setimmediate@1.0.5: {} setprototypeof@1.2.0: {} @@ -6715,6 +7868,11 @@ snapshots: std-env@4.2.0: {} + stop-iteration-iterator@1.1.0: + dependencies: + es-errors: 1.3.0 + internal-slot: 1.1.0 + strict-event-emitter@0.5.1: optional: true @@ -6725,6 +7883,30 @@ snapshots: strip-ansi: 6.0.1 optional: true + string.prototype.trim@1.2.11: + dependencies: + call-bind: 1.0.9 + call-bound: 1.0.4 + define-data-property: 1.1.4 + define-properties: 1.2.1 + es-abstract: 1.24.2 + es-object-atoms: 1.1.2 + has-property-descriptors: 1.0.2 + safe-regex-test: 1.1.0 + + string.prototype.trimend@1.0.10: + dependencies: + call-bind: 1.0.9 + call-bound: 1.0.4 + define-properties: 1.2.1 + es-object-atoms: 1.1.2 + + string.prototype.trimstart@1.0.8: + dependencies: + call-bind: 1.0.9 + define-properties: 1.2.1 + es-object-atoms: 1.1.1 + string_decoder@1.1.1: dependencies: safe-buffer: 5.1.2 @@ -6745,7 +7927,7 @@ snapshots: lines-and-columns: 1.2.4 mz: 2.7.0 pirates: 4.0.7 - tinyglobby: 0.2.16 + tinyglobby: 0.2.17 ts-interface-checker: 0.1.13 svg-pathdata@6.0.3: @@ -6764,6 +7946,14 @@ snapshots: tagged-tag@1.0.0: optional: true + tar-stream@2.2.0: + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.5 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.2 + text-segmentation@1.0.3: dependencies: utrie: 1.0.2 @@ -6779,15 +7969,8 @@ snapshots: tinybench@2.9.0: {} - tinyexec@1.1.1: {} - tinyexec@1.3.1: {} - tinyglobby@0.2.16: - dependencies: - fdir: 6.5.0(picomatch@4.0.4) - picomatch: 4.0.4 - tinyglobby@0.2.17: dependencies: fdir: 6.5.0(picomatch@4.0.7) @@ -6805,6 +7988,8 @@ snapshots: tldts-core: 7.0.28 optional: true + tmp@0.2.7: {} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 @@ -6816,6 +8001,14 @@ snapshots: tldts: 7.0.28 optional: true + traverse@0.3.10: + dependencies: + define-data-property: 1.1.4 + es-to-primitive: 1.3.4 + gopd: 1.2.0 + typedarray.prototype.slice: 1.0.6 + which-typed-array: 1.1.24 + ts-dedent@2.2.0: {} ts-interface-checker@0.1.13: {} @@ -6851,10 +8044,60 @@ snapshots: media-typer: 1.1.0 mime-types: 3.0.2 + typed-array-buffer@1.0.3: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-typed-array: 1.1.15 + + typed-array-byte-length@1.0.3: + dependencies: + call-bind: 1.0.9 + for-each: 0.3.5 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + + typed-array-byte-offset@1.0.5: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.9 + for-each: 0.3.5 + gopd: 1.2.0 + is-typed-array: 1.1.15 + reflect.getprototypeof: 1.0.10 + + typed-array-length@1.0.8: + dependencies: + call-bind: 1.0.9 + for-each: 0.3.5 + gopd: 1.2.0 + is-typed-array: 1.1.15 + possible-typed-array-names: 1.1.0 + reflect.getprototypeof: 1.0.10 + + typedarray.prototype.slice@1.0.6: + dependencies: + call-bind: 1.0.9 + define-properties: 1.2.1 + es-abstract: 1.24.2 + es-errors: 1.3.0 + get-proto: 1.0.1 + math-intrinsics: 1.1.0 + typed-array-buffer: 1.0.3 + typed-array-byte-offset: 1.0.5 + typescript@6.0.2: {} ufo@1.6.3: {} + unbox-primitive@1.1.0: + dependencies: + call-bound: 1.0.4 + has-bigints: 1.1.0 + has-symbols: 1.1.0 + which-boxed-primitive: 1.1.1 + undici-types@6.21.0: {} undici-types@7.18.2: {} @@ -6872,6 +8115,19 @@ snapshots: until-async@3.0.2: optional: true + unzipper@0.10.14: + dependencies: + big-integer: 1.6.52 + binary: 0.3.0 + bluebird: 3.4.7 + buffer-indexof-polyfill: 1.0.2 + duplexer2: 0.1.4 + fstream: 1.0.12 + graceful-fs: 4.2.12 + listenercount: 1.0.1 + readable-stream: 2.3.8 + setimmediate: 1.0.5 + use-callback-ref@1.3.3(@types/react@19.2.14)(react@19.2.7): dependencies: react: 19.2.7 @@ -6900,6 +8156,8 @@ snapshots: uuid@11.1.0: {} + uuid@8.3.2: {} + vary@1.1.2: {} vite@8.3.1(@types/node@25.5.0)(esbuild@0.25.12)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.9.0): @@ -6982,6 +8240,47 @@ snapshots: webworkify@1.5.0: {} + which-boxed-primitive@1.1.1: + dependencies: + is-bigint: 1.1.0 + is-boolean-object: 1.2.2 + is-number-object: 1.1.1 + is-string: 1.1.1 + is-symbol: 1.1.1 + + which-builtin-type@1.2.1: + dependencies: + call-bound: 1.0.4 + function.prototype.name: 1.2.0 + has-tostringtag: 1.0.2 + is-async-function: 2.1.1 + is-date-object: 1.1.0 + is-finalizationregistry: 1.1.1 + is-generator-function: 1.1.2 + is-regex: 1.2.1 + is-weakref: 1.1.1 + isarray: 2.0.5 + which-boxed-primitive: 1.1.1 + which-collection: 1.0.2 + which-typed-array: 1.1.24 + + which-collection@1.0.2: + dependencies: + is-map: 2.0.3 + is-set: 2.0.3 + is-weakmap: 2.0.2 + is-weakset: 2.0.4 + + which-typed-array@1.1.24: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.9 + call-bound: 1.0.4 + for-each: 0.3.5 + get-proto: 1.0.1 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + which@2.0.2: dependencies: isexe: 2.0.0 @@ -7011,6 +8310,8 @@ snapshots: ws@8.20.0: {} + xmlchars@2.2.0: {} + xspattern@3.1.0: dependencies: whynot: 5.0.0 @@ -7038,6 +8339,12 @@ snapshots: yoctocolors-cjs@2.1.3: optional: true + zip-stream@4.1.1: + dependencies: + archiver-utils: 3.0.4 + compress-commons: 4.1.2 + readable-stream: 3.6.2 + zod-to-json-schema@3.25.2(zod@4.6.5): dependencies: zod: 4.6.5 From 0788f25b7c987aed19340d6fe598699dd092220c Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:22:31 -0400 Subject: [PATCH 02/11] feat(ui-plugins): add Attendance Report (attendance-report) --- external_plugins/attendance-report/LICENSE | 21 ++++++++ external_plugins/attendance-report/README.md | 52 +++++++++++++++++++ .../attendance-report/README_CN.md | 52 +++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 external_plugins/attendance-report/LICENSE create mode 100644 external_plugins/attendance-report/README.md create mode 100644 external_plugins/attendance-report/README_CN.md diff --git a/external_plugins/attendance-report/LICENSE b/external_plugins/attendance-report/LICENSE new file mode 100644 index 00000000..67e98093 --- /dev/null +++ b/external_plugins/attendance-report/LICENSE @@ -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. diff --git a/external_plugins/attendance-report/README.md b/external_plugins/attendance-report/README.md new file mode 100644 index 00000000..2935dc63 --- /dev/null +++ b/external_plugins/attendance-report/README.md @@ -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.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-.xlsx and people/-.xlsx | + +Output goes to `attendance-report//` 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`. diff --git a/external_plugins/attendance-report/README_CN.md b/external_plugins/attendance-report/README_CN.md new file mode 100644 index 00000000..22c071c5 --- /dev/null +++ b/external_plugins/attendance-report/README_CN.md @@ -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`。 From 3532c449ed0f1dc8c244803398060508ecf1a77c Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:23:05 -0400 Subject: [PATCH 03/11] feat(ui-plugins): add Attendance Report (attendance-report) --- ui-plugins/attendance-report/package.json | 36 +++++++++++++++++++ ui-plugins/attendance-report/tsconfig.json | 14 ++++++++ ui-plugins/attendance-report/vitest.config.ts | 2 ++ 3 files changed, 52 insertions(+) create mode 100644 ui-plugins/attendance-report/package.json create mode 100644 ui-plugins/attendance-report/tsconfig.json create mode 100644 ui-plugins/attendance-report/vitest.config.ts diff --git a/ui-plugins/attendance-report/package.json b/ui-plugins/attendance-report/package.json new file mode 100644 index 00000000..8f200a6d --- /dev/null +++ b/ui-plugins/attendance-report/package.json @@ -0,0 +1,36 @@ +{ + "name": "@penova/plugin-attendance-report", + "version": "0.1.0", + "private": true, + "license": "MIT", + "type": "module", + "scripts": { + "build": "node scripts/build.mjs", + "typecheck": "tsc -p tsconfig.json --noEmit", + "test": "vitest run", + "test:e2e": "node --experimental-strip-types scripts/e2e.mts" + }, + "zcode": { + "title": "Attendance Report", + "stub": [ + "unzipper" + ] + }, + "engines": { + "node": ">=22.0.0" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "1.29.0", + "zod": "^4.6.5", + "exceljs": "4.4.0" + }, + "devDependencies": { + "@modelcontextprotocol/core": "2.0.0", + "@modelcontextprotocol/ext-apps": "2.0.0", + "@types/node": "25.5.0", + "esbuild": "^0.25.12", + "playwright-core": "1.59.1", + "typescript": "6.0.2", + "vitest": "4.1.4" + } +} diff --git a/ui-plugins/attendance-report/tsconfig.json b/ui-plugins/attendance-report/tsconfig.json new file mode 100644 index 00000000..39f7ab60 --- /dev/null +++ b/ui-plugins/attendance-report/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2023", "DOM", "DOM.Iterable"], + "strict": true, + "skipLibCheck": true, + "noEmit": true, + "allowImportingTsExtensions": true, + "types": ["node"] + }, + "include": ["src/**/*.ts", "ui/**/*.ts", "test/**/*.ts"] +} diff --git a/ui-plugins/attendance-report/vitest.config.ts b/ui-plugins/attendance-report/vitest.config.ts new file mode 100644 index 00000000..27153a26 --- /dev/null +++ b/ui-plugins/attendance-report/vitest.config.ts @@ -0,0 +1,2 @@ +import { defineConfig } from "vitest/config"; +export default defineConfig({ test: { include: ["src/**/*.test.ts", "test/**/*.test.ts"], testTimeout: 120000, hookTimeout: 120000 } }); From 3931f540deca98bcf0ab43aa1e1637064cabf4bf Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:23:37 -0400 Subject: [PATCH 04/11] feat(ui-plugins): add Attendance Report (attendance-report) --- .../.zcode-plugin/plugin.json | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 external_plugins/attendance-report/.zcode-plugin/plugin.json diff --git a/external_plugins/attendance-report/.zcode-plugin/plugin.json b/external_plugins/attendance-report/.zcode-plugin/plugin.json new file mode 100644 index 00000000..447d0c01 --- /dev/null +++ b/external_plugins/attendance-report/.zcode-plugin/plugin.json @@ -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" + } + ] + } +} From e7a2a85f1b77241e86feccbe4697b2c640215c50 Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:24:13 -0400 Subject: [PATCH 05/11] feat(ui-plugins): add Attendance Report (attendance-report) --- .../attendance-report/scripts/build.mjs | 74 ++++++++ ui-plugins/attendance-report/scripts/e2e.mts | 87 ++++++++++ .../attendance-report/scripts/harness.mjs | 162 ++++++++++++++++++ .../attendance-report/scripts/licenses.mjs | 43 +++++ 4 files changed, 366 insertions(+) create mode 100644 ui-plugins/attendance-report/scripts/build.mjs create mode 100644 ui-plugins/attendance-report/scripts/e2e.mts create mode 100644 ui-plugins/attendance-report/scripts/harness.mjs create mode 100644 ui-plugins/attendance-report/scripts/licenses.mjs diff --git a/ui-plugins/attendance-report/scripts/build.mjs b/ui-plugins/attendance-report/scripts/build.mjs new file mode 100644 index 00000000..02ff90d4 --- /dev/null +++ b/ui-plugins/attendance-report/scripts/build.mjs @@ -0,0 +1,74 @@ +import { build } from "esbuild"; +import { copyFile, cp, mkdir, readFile, rm, writeFile } from "node:fs/promises"; +import { createRequire } from "node:module"; +import { dirname, join, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import { writeNotices } from "./licenses.mjs"; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const dist = join(root, "dist"); +const pkg = JSON.parse(await readFile(join(root, "package.json"), "utf8")); +await rm(dist, { recursive: true, force: true }); +await mkdir(join(dist, "ui"), { recursive: true }); + +// 宿主只提供 HTML 本身,JS 与 CSS 全部内联到一个页面里。 +const ui = await build({ + metafile: true, + entryPoints: [join(root, "ui/main.ts")], + bundle: true, + format: "iife", + platform: "browser", + target: "es2022", + minify: true, + write: false, + outdir: join(dist, "ui"), + legalComments: "none", + loader: { ".css": "text" }, +}); +const js = ui.outputFiles.find((file) => file.path.endsWith(".js")).text; +const escape = (text) => text.replace(/<\/script/gi, "<\\/script"); +const html = `${pkg.zcode?.title ?? pkg.name}
`; +const htmlBytes = Buffer.byteLength(html); +if (htmlBytes > 4 * 1024 * 1024 - 64 * 1024) throw new Error(`panel.html is ${Math.round(htmlBytes / 1024)} KiB; keep it below 4 MiB`); +await writeFile(join(dist, "ui/panel.html"), html); + +// 用不到、且许可证不明的可选依赖(package.json 的 zcode.stub)替换为空模块。 +const stubs = pkg.zcode?.stub ?? []; +const stubPlugin = { + name: "stub", + setup(b) { + if (!stubs.length) return; + const filter = new RegExp(`^(${stubs.map((s) => s.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&")).join("|")})$`); + b.onResolve({ filter }, (args) => ({ path: args.path, namespace: "stub" })); + b.onLoad({ filter: /.*/, namespace: "stub" }, () => ({ contents: "module.exports = {};", loader: "js" })); + }, +}; + +const server = await build({ + plugins: [stubPlugin], + metafile: true, + entryPoints: [join(root, "src/main.ts")], + outfile: join(dist, "server.mjs"), + bundle: true, + platform: "node", + format: "esm", + target: "node22", + legalComments: "none", + banner: { + js: 'import { createRequire as __createRequire } from "node:module"; const require=__createRequire(import.meta.url);', + }, +}); + +// 运行时需要的 wasm 等文件(package.json 的 zcode.assets:{ 包内路径: 输出文件名 })。 +const require = createRequire(join(root, "package.json")); +for (const [from, to] of Object.entries(pkg.zcode?.assets ?? {})) await copyFile(require.resolve(from), join(dist, to)); + +// 整个目录(package.json 的 zcode.dirs:{ "包名:子目录": 输出目录 }),例如 pdf.js 的 CMap。 +for (const [spec, to] of Object.entries(pkg.zcode?.dirs ?? {})) { + const [name, sub] = spec.split(":"); + const base = dirname(require.resolve(`${name}/package.json`)); + await cp(join(base, sub), join(dist, to), { recursive: true, filter: (path) => !/(_nowasm_fallback\.js|quickjs-eval\.(js|wasm))$/.test(path) }); +} + +await writeNotices([ui.metafile, server.metafile], join(dist, "THIRD_PARTY_NOTICES.txt"), Object.keys(pkg.zcode?.assets ?? {})); +process.stdout.write(`${pkg.name}: panel ${Math.round(htmlBytes / 1024)} KiB, server ${Math.round((await readFile(join(dist, "server.mjs"))).length / 1024)} KiB\n`); diff --git a/ui-plugins/attendance-report/scripts/e2e.mts b/ui-plugins/attendance-report/scripts/e2e.mts new file mode 100644 index 00000000..97575965 --- /dev/null +++ b/ui-plugins/attendance-report/scripts/e2e.mts @@ -0,0 +1,87 @@ +// 浏览器端到端测试:真实打包的 server + 官方 AppBridge 宿主 + 隔离 iframe 中的面板。需要 Chrome。 +// 场景写在 test/e2e.json:用户在面板里选文件打开 → Agent 修改 → 用户在表格里改一格 → 导出。 +import assert from "node:assert/strict"; +import { cp, mkdir, mkdtemp, readFile, stat } from "node:fs/promises"; +import { existsSync } from "node:fs"; +import { execFileSync } from "node:child_process"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import { startHarness } from "./harness.mjs"; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const pkg = JSON.parse(await readFile(join(root, "package.json"), "utf8")); +const name = pkg.name.replace("@penova/plugin-", ""); +const spec = JSON.parse(await readFile(join(root, "test/e2e.json"), "utf8")); +const shots = process.env.E2E_SHOTS ?? join(tmpdir(), `${name}-shots`); +await mkdir(shots, { recursive: true }); +const workspace = await mkdtemp(join(tmpdir(), `${name}-e2e-`)); +const samples = process.env.SAMPLES ?? join(root, "test/samples"); +if (existsSync(samples)) await cp(samples, join(workspace, spec.folder ?? "samples"), { recursive: true }); +// 可选:样例需要现场生成(例如 git 仓库)时,运行 test/ 下的脚本,参数是样例文件夹。 +if (spec.setup) execFileSync(process.execPath, [join(root, spec.setup), join(workspace, spec.folder ?? "samples")], { stdio: "inherit" }); + +const harness = await startHarness({ workspace }); +const step = (text: string) => process.stdout.write(`• ${text}\n`); +let failShot: (() => Promise) | undefined; +try { + const { outer, frame } = await harness.open("?locale=zh-CN", { width: 1400, height: 950 }); + failShot = () => outer.screenshot({ path: join(shots, "failed.png") }); + step("user picks the sample in the panel and opens it"); + await frame.locator(".start").waitFor(); + for (const pick of spec.pick ?? []) await frame.locator("label.file", { hasText: pick }).first().click(); + for (const [key, value] of Object.entries(spec.startSettings ?? {})) { + const el = frame.locator(`.settings [data-key="${key}"]`); + if (typeof value === "boolean") await el.setChecked(value); + else if ((await el.evaluate((e) => e.tagName)) === "SELECT") await el.selectOption(String(value)); + else await el.fill(String(value)); + } + await frame.locator("button.open").click(); + await frame.locator(".project .summary").waitFor(); + const project = (await frame.locator(".pname").textContent())!.trim(); + if (spec.edit) { + step("agent edits the project"); + await harness.agent(outer, `${spec.prefix}_edit`, { project, ...spec.edit }); + } + if (spec.uiEdit) { + step("user edits a cell in the table"); + const cell = frame.locator(`tr[data-row="${spec.uiEdit.row}"] td[data-key="${spec.uiEdit.key}"]`); + if (typeof spec.uiEdit.value === "boolean") await cell.locator("input").setChecked(spec.uiEdit.value); + else if (await cell.locator("select").count()) await cell.locator("select").selectOption(String(spec.uiEdit.value)); + else { + const input = cell.locator("input"); + await input.fill(String(spec.uiEdit.value)); + await input.press("Enter"); + await input.blur(); + } + await frame.waitForTimeout(800); + } + if (spec.expectText) await frame.locator("#root", { hasText: spec.expectText }).waitFor(); + await frame.waitForTimeout(400); + await outer.screenshot({ path: join(shots, "01-panel.png") }); + step("user exports"); + const all = frame.locator("button.expall"); + if (await all.count()) await all.click(); + else await frame.locator("button.exp").first().click(); + await frame.locator(".exported li").first().waitFor({ timeout: 300_000 }); + await frame.waitForTimeout(300); + await outer.screenshot({ path: join(shots, "02-exported.png") }); + const files = await frame.locator(".exported li").allTextContents(); + for (const f of files) assert.ok((await stat(join(workspace, f.trim()))).size > 0, `${f} is empty`); + for (const pattern of spec.expectFiles ?? []) assert.ok(files.some((f) => new RegExp(pattern).test(f)), `expected an exported file matching ${pattern}; got ${files.join(", ")}`); + + step("English panel"); + const en = await harness.open("?locale=en-US&theme=dark", { width: 1400, height: 950 }); + await harness.agent(en.outer, `${spec.prefix}_status`, { project }); + await en.frame.locator(".project .summary").waitFor(); + await en.frame.waitForTimeout(400); + await en.outer.screenshot({ path: join(shots, "03-en-dark.png") }); + assert.deepEqual(harness.errors, []); + step(`ok — ${files.length} file(s) exported; screenshots in ${shots}`); +} catch (error) { + await failShot?.().catch(() => undefined); + console.error("page errors:", harness.errors, harness.stderr.join("")); + throw error; +} finally { + await harness.close(); +} diff --git a/ui-plugins/attendance-report/scripts/harness.mjs b/ui-plugins/attendance-report/scripts/harness.mjs new file mode 100644 index 00000000..a45e6e41 --- /dev/null +++ b/ui-plugins/attendance-report/scripts/harness.mjs @@ -0,0 +1,162 @@ +import assert from "node:assert/strict"; +import { createServer } from "node:http"; +import { readFile } from "node:fs/promises"; +import { dirname, join, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import { build } from "esbuild"; +import { chromium } from "playwright-core"; +import { Client } from "@modelcontextprotocol/sdk/client/index.js"; +import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; +import { ResourceUpdatedNotificationSchema } from "@modelcontextprotocol/sdk/types.js"; + +/** + * 浏览器测试宿主:真实打包的 server(stdio)+ 官方 AppBridge 宿主页 + 隔离 iframe 中的面板。 + * 宿主页用与 ZCode 相同的 CSP 约束面板。测试脚本同时扮演 Agent:经同一个 MCP 连接调用工具, + * 并像宿主一样把结果推给页面。 + */ +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); + +// 与 ZCode 给 MCP App 页面的限制一致:没有网络,允许 wasm(声明了 zcode/csp.wasmUnsafeEval)。 +export const PANEL_CSP = + "default-src 'none'; script-src 'self' 'unsafe-inline' blob: data: 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; media-src 'self' data: blob:; worker-src 'self' blob:; connect-src 'none'; frame-src 'none'; base-uri 'self'; form-action 'none'"; + +/** server:要运行的 server 入口(默认真实打包的 dist/server.mjs)。 */ +export async function startHarness({ env = {}, workspace, server = join(root, "dist/server.mjs") }) { + const client = new Client({ name: "kit-harness", version: "1" }); + const sseClients = new Set(); + client.setNotificationHandler(ResourceUpdatedNotificationSchema, (notification) => { + for (const response of sseClients) response.write(`data: ${JSON.stringify(notification.params)}\n\n`); + }); + const stderr = []; + const transport = new StdioClientTransport({ + command: process.execPath, + args: [server], + cwd: workspace, + env: { ...process.env, ZCODE_WORKSPACE_ROOT: workspace, ...env }, + stderr: "pipe", + }); + transport.stderr?.on("data", (chunk) => stderr.push(String(chunk))); + await client.connect(transport); + const html = await readFile(join(root, "dist/ui/panel.html"), "utf8"); + const hostJs = await build({ + stdin: { + contents: ` +import { AppBridge, PostMessageTransport } from "@modelcontextprotocol/ext-apps/app-bridge"; +import { z } from "zod"; +const WidgetState = z.object({ method: z.literal('ui/set-widget-state'), params: z.object({ widgetState: z.unknown() }) }); +const rpc = async (method, args) => { + const response = await fetch('/rpc', {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify({method,args})}); + const result = await response.json(); if (!response.ok) throw Error(result.error); return result; +}; +const params = new URLSearchParams(location.search); +const context = { theme: params.get('theme') || 'light', locale: params.get('locale') || 'en-US', displayMode: params.get('mode') || 'fullscreen' }; +const bridge = new AppBridge(null, {name:"kit-harness",version:"1"}, { + serverTools:{}, serverResources:{ listChanged: true }, message:{text:{}}, updateModelContext:{text:{}, structuredContent:{}}, openLinks:{}, + experimental: params.get('nosub') ? { "zcode/widgetState": {} } : { "zcode/resourceSubscribe": {}, "zcode/widgetState": {} }, +}, {hostContext:{...context, "zcode/widgetState": JSON.parse(sessionStorage.getItem('widgetState') || 'null')}}); +window.__messages = []; +window.__context = []; +window.__links = []; +window.__calls = []; +window.__initializations = 0; +bridge.oncalltool = (args) => { window.__calls.push(args.name); return rpc('callTool', args); }; +bridge.onreadresource = (args) => rpc('readResource', args); +bridge.onmessage = async (params) => { window.__messages.push(params.content[0].text); return {}; }; +bridge.onupdatemodelcontext = async (params) => { window.__context.push(params); return {}; }; +bridge.onopenlink = async (params) => { window.__links.push(params.url); return {}; }; +bridge.setRequestHandler('resources/subscribe', async (request) => { await rpc('subscribe', { uri: request.params.uri }); return {}; }); +bridge.setRequestHandler('resources/unsubscribe', async (request) => { await rpc('unsubscribe', { uri: request.params.uri }); return {}; }); +bridge.setRequestHandler(WidgetState, async (request) => { sessionStorage.setItem('widgetState', JSON.stringify(request.params.widgetState)); return {}; }); +bridge.oninitialized = () => { window.__initializations++; }; +window.__sendToolResult = (result) => bridge.sendToolResult(result); +window.__setContext = (patch) => bridge.setHostContext({ ...context, ...patch }); +new EventSource('/events').onmessage = (event) => { + bridge.notification({ method: 'notifications/resources/updated', params: JSON.parse(event.data) }); +}; +const frame = document.querySelector('iframe'); +await bridge.connect(new PostMessageTransport(frame.contentWindow, frame.contentWindow)); +frame.src = '/panel'; +`, + resolveDir: root, + sourcefile: "browser-host.mjs", + }, + bundle: true, + format: "esm", + platform: "browser", + write: false, + }); + const http = createServer(async (request, response) => { + try { + const url = new URL(request.url, "http://localhost"); + if (url.pathname === "/") { + response.setHeader("Content-Type", "text/html; charset=utf-8"); + response.end( + '', + ); + } else if (url.pathname === "/host.js") { + response.setHeader("Content-Type", "text/javascript"); + response.end(hostJs.outputFiles[0].text); + } else if (url.pathname === "/panel") { + response.setHeader("Content-Type", "text/html; charset=utf-8"); + response.setHeader("Content-Security-Policy", PANEL_CSP); + response.end(html); + } else if (url.pathname === "/events") { + response.writeHead(200, { "Content-Type": "text/event-stream", "Cache-Control": "no-cache" }); + response.write(": connected\n\n"); + sseClients.add(response); + request.on("close", () => sseClients.delete(response)); + } else if (request.method === "POST" && url.pathname === "/rpc") { + let body = ""; + for await (const chunk of request) body += chunk; + const { method, args } = JSON.parse(body); + const result = + method === "readResource" + ? await client.readResource(args) + : method === "subscribe" + ? await client.subscribeResource(args) + : method === "unsubscribe" + ? await client.unsubscribeResource(args) + : await client.callTool(args, undefined, { timeout: 300_000 }); + response.setHeader("Content-Type", "application/json"); + response.end(JSON.stringify(result ?? {})); + } else if (url.pathname === "/favicon.ico") response.writeHead(204).end(); + else response.writeHead(404).end(); + } catch (error) { + response.writeHead(500, { "Content-Type": "application/json" }).end(JSON.stringify({ error: String(error) })); + } + }); + await new Promise((done) => http.listen(0, "127.0.0.1", done)); + const base = `http://127.0.0.1:${http.address().port}`; + const browser = await chromium.launch(process.env.CHROME_PATH ? { executablePath: process.env.CHROME_PATH } : { channel: "chrome" }); + const errors = []; + const contexts = []; + + const open = async (query = "", viewport = { width: 720, height: 900 }) => { + const context = await browser.newContext({ viewport, deviceScaleFactor: 2 }); + contexts.push(context); + const outer = await context.newPage(); + outer.on("pageerror", (error) => errors.push(String(error))); + outer.on("console", (message) => { + if (message.type() === "error" && !/favicon/.test(message.text())) errors.push(message.text()); + }); + await outer.goto(`${base}/${query}`); + await outer.waitForFunction(() => window.__initializations === 1); + const frame = outer.frames().find((item) => item !== outer.mainFrame()); + assert.ok(frame, "official App iframe exists"); + return { outer, frame, context }; + }; + /** 扮演 Agent:调用工具,再像宿主一样把结果推给页面。 */ + const agent = async (outer, name, args, { expectError = false } = {}) => { + const result = await client.callTool({ name, arguments: args }, undefined, { timeout: 300_000 }); + if (expectError) assert.ok(result.isError, `${name} should fail`); + else assert.ok(!result.isError, `${name}: ${JSON.stringify(result.content)}`); + if (outer) await outer.evaluate((value) => window.__sendToolResult(value), result); + return result; + }; + const close = async () => { + await browser.close().catch(() => undefined); + await client.close().catch(() => undefined); + http.close(); + }; + return { client, open, agent, close, errors, stderr, base, contexts: () => contexts.filter((context) => context.pages().length) }; +} diff --git a/ui-plugins/attendance-report/scripts/licenses.mjs b/ui-plugins/attendance-report/scripts/licenses.mjs new file mode 100644 index 00000000..5107fe7c --- /dev/null +++ b/ui-plugins/attendance-report/scripts/licenses.mjs @@ -0,0 +1,43 @@ +import { readFile, readdir, writeFile } from "node:fs/promises"; +import { dirname, join, resolve } from "node:path"; + +// 从实际参与打包的模块收集许可证,避免只列直接依赖而漏掉 Canvas/SDK 的传递依赖。 +export async function writeNotices(metafiles, destination, extra = []) { + const packages = new Map(); + const { createRequire } = await import("node:module"); + const require = createRequire(resolve("package.json")); + const extraInputs = extra.map((spec) => require.resolve(spec)); + for (const input of [...metafiles.flatMap((meta) => Object.keys(meta.inputs)), ...extraInputs]) { + if (!input.includes("node_modules/")) continue; + let directory = dirname(resolve(input)); + while (directory.includes("node_modules")) { + try { + const pkg = JSON.parse(await readFile(join(directory, "package.json"), "utf8")); + if (pkg.name && pkg.version) { + packages.set(directory, pkg); + break; + } + } catch (error) { + if (error.code !== "ENOENT") throw error; + } + directory = dirname(directory); + } + } + const notices = []; + const seen = new Set(); + for (const [directory, pkg] of [...packages].sort((a, b) => a[1].name.localeCompare(b[1].name))) { + const key = `${pkg.name}@${pkg.version}`; + if (seen.has(key)) continue; + seen.add(key); + const files = (await readdir(directory)).filter((name) => + /^(license|copying|notice)([.-]|$)/i.test(name), + ); + const texts = await Promise.all(files.map((file) => readFile(join(directory, file), "utf8"))); + if (!texts.length && !pkg.license) throw new Error(`Missing license for bundled dependency ${key}`); + if (!texts.length) texts.push(`(No license file is shipped in this package; its package.json declares the ${pkg.license} license.)`); + notices.push( + `${key} — ${typeof pkg.license === "string" ? pkg.license : JSON.stringify(pkg.license)}\n${texts.join("\n\n")}`, + ); + } + await writeFile(destination, notices.join("\n\n----------------------------------------\n\n")); +} From 4f996dda7c910150d697f1728606c25c7278e5d6 Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:24:46 -0400 Subject: [PATCH 06/11] feat(ui-plugins): add Attendance Report (attendance-report) --- ui-plugins/attendance-report/src/att.ts | 70 +++++++ ui-plugins/attendance-report/src/main.ts | 14 ++ ui-plugins/attendance-report/src/server.ts | 216 +++++++++++++++++++++ 3 files changed, 300 insertions(+) create mode 100644 ui-plugins/attendance-report/src/att.ts create mode 100644 ui-plugins/attendance-report/src/main.ts create mode 100644 ui-plugins/attendance-report/src/server.ts diff --git a/ui-plugins/attendance-report/src/att.ts b/ui-plugins/attendance-report/src/att.ts new file mode 100644 index 00000000..cea06b22 --- /dev/null +++ b/ui-plugins/attendance-report/src/att.ts @@ -0,0 +1,70 @@ +/** 考勤规则与按天计算。时间都用“当天第几分钟”表示。 */ +export interface Rules { + start: number; end: number; grace: number; earlyGrace: number; lunch: number; otAfter: number; otMin: number; + elastic: number; // 弹性分钟:晚到不超过这么多、并且相应晚走,就不算迟到 + weekend: number[]; holidays: Set; workdays: Set; +} +export interface DayResult { status: string; late: number; early: number; ot: number; worked: number; missing: number; absent: boolean; excused: boolean; rest: boolean; flags: string[] } + +export const hm = (s: string): number | null => { + const m = /(\d{1,2})[::时](\d{2})/.exec(String(s ?? "")); + return m ? Number(m[1]) * 60 + Number(m[2]) : null; +}; +export const fmt = (n: number | null) => (n === null ? "" : `${String(Math.floor(n / 60)).padStart(2, "0")}:${String(n % 60).padStart(2, "0")}`); +export const weekdayOf = (date: string) => new Date(`${date}T00:00:00Z`).getUTCDay(); +export const WD = ["日", "一", "二", "三", "四", "五", "六"]; + +/** “2026-10-01..2026-10-07, 2026-11-03” → 日期集合。 */ +export function parseDates(text: string): Set { + const out = new Set(); + for (const part of String(text ?? "").split(/[\s,,;;、]+/).filter(Boolean)) { + const m = /^(\d{4}-\d{2}-\d{2})(?:\.\.|~|~|至)(\d{4}-\d{2}-\d{2})$/.exec(part); + if (m) { for (let d = new Date(`${m[1]}T00:00:00Z`); d <= new Date(`${m[2]}T00:00:00Z`); d.setUTCDate(d.getUTCDate() + 1)) out.add(d.toISOString().slice(0, 10)); } + else if (/^\d{4}-\d{2}-\d{2}$/.test(part)) out.add(part); + } + return out; +} + +export function isWorkday(date: string, r: Rules) { + if (r.workdays.has(date)) return true; + if (r.holidays.has(date)) return false; + return !r.weekend.includes(weekdayOf(date)); +} + +const EXCUSE = /请假|事假|病假|年假|婚假|产假|丧假|调休|出差|外出|公出|培训|leave|trip|sick|vacation|off/i; + +export function evaluate(date: string, inT: number | null, outT: number | null, note: string, r: Rules): DayResult { + const rest = !isWorkday(date, r); + const res: DayResult = { status: "", late: 0, early: 0, ot: 0, worked: 0, missing: 0, absent: false, excused: false, rest, flags: [] }; + const excused = EXCUSE.test(note); + if (inT !== null && outT !== null && outT > inT) { + const span = outT - inT; + const lunchOverlap = Math.max(0, Math.min(outT, 13 * 60) - Math.max(inT, 12 * 60)) > 0 ? r.lunch : 0; + res.worked = Math.max(0, span - lunchOverlap); + } + if (rest) { + if (res.worked > 0) { res.ot = res.worked >= r.otMin ? res.worked : 0; res.status = res.ot ? "休息日加班" : "休息日打卡"; } + else res.status = inT !== null || outT !== null ? "休息日打卡" : "休息"; + return res; + } + if (inT === null && outT === null) { + if (excused) { res.excused = true; res.status = note.trim(); return res; } + res.absent = true; res.status = "缺勤"; return res; + } + if (inT === null || outT === null || outT <= inT) { + res.missing = 1; + res.flags.push(inT === null ? "缺上班卡" : "缺下班卡"); + } + let lateBy = inT !== null ? inT - r.start : 0; + let needOut = r.end; + if (inT !== null && r.elastic > 0 && lateBy > 0 && lateBy <= r.elastic) { needOut = r.end + lateBy; lateBy = 0; } + if (inT !== null && lateBy > r.grace) { res.late = lateBy; res.flags.push(`迟到 ${lateBy} 分`); } + if (outT !== null && inT !== null && outT > inT && outT < needOut - r.earlyGrace) { res.early = needOut - outT; res.flags.push(`早退 ${res.early} 分`); } + if (outT !== null && outT > inT! && outT - r.end >= r.otAfter) { + const ot = outT - Math.max(needOut, r.end); + if (ot >= r.otMin) { res.ot = ot; res.flags.push(`加班 ${(ot / 60).toFixed(1)} 时`); } + } + if (excused) { res.excused = true; res.flags.push(note.trim()); res.late = 0; res.early = 0; if (res.missing) { res.missing = 0; res.flags = res.flags.filter((f) => !/^缺/.test(f)); } } + res.status = res.flags.length ? res.flags.join(",") : "正常"; + return res; +} diff --git a/ui-plugins/attendance-report/src/main.ts b/ui-plugins/attendance-report/src/main.ts new file mode 100644 index 00000000..176ad83c --- /dev/null +++ b/ui-plugins/attendance-report/src/main.ts @@ -0,0 +1,14 @@ +import "./kit/console.ts"; +import { dirname, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; +import { createServer } from "./server.ts"; + +const here = dirname(fileURLToPath(import.meta.url)); +const server = createServer({ + workspaceRoot: resolve(process.env.ZCODE_WORKSPACE_ROOT || process.cwd()), + assetRoot: here, + log: (line) => process.stderr.write(`[attendance-report] ${line}\n`), +}); +process.stdin.once("end", () => process.exit(0)); +await server.connect(new StdioServerTransport()); diff --git a/ui-plugins/attendance-report/src/server.ts b/ui-plugins/attendance-report/src/server.ts new file mode 100644 index 00000000..da778af5 --- /dev/null +++ b/ui-plugins/attendance-report/src/server.ts @@ -0,0 +1,216 @@ +import ExcelJS from "exceljs"; +import { createApp, esc, type AppDef, type ExportCtx, type Issue, type Project, type Row } from "./kit/app.ts"; +import { mapHeaders, parseDate } from "./kit/columns.ts"; +import { writeXlsx, type SheetSpec } from "./kit/sheet.ts"; +import { readTable } from "./kit/table.ts"; +import { KitError, safeFileName, type Workspace } from "./kit/workspace.ts"; +import { evaluate, fmt, hm, isWorkday, parseDates, WD, weekdayOf, type DayResult, type Rules } from "./att.ts"; + +export const NAME = "attendance-report"; +export const VERSION = "0.1.0"; + +const s = (v: unknown) => String(v ?? "").trim(); +const pad = (n: number) => String(n).padStart(2, "0"); + +/** 读表:xlsx 里的日期时间单元格保留时分(通用读表只保留日期)。 */ +async function readPunchTable(ws: Workspace, path: string) { + if (!/\.xlsx$/i.test(path)) return readTable(ws, path); + const book = new ExcelJS.Workbook(); + await book.xlsx.load((await ws.read(path, 50 * 1024 * 1024)) as unknown as ArrayBuffer); + const sheet = book.worksheets.find((w) => w.actualRowCount > 0) ?? book.worksheets[0]; + const text = (v: ExcelJS.CellValue): string => { + if (v === null || v === undefined) return ""; + if (v instanceof Date) { + const d = `${v.getUTCFullYear()}-${pad(v.getUTCMonth() + 1)}-${pad(v.getUTCDate())}`; + const t = `${pad(v.getUTCHours())}:${pad(v.getUTCMinutes())}`; + if (v.getUTCFullYear() < 1901) return t; // 只有时间的单元格 + return v.getUTCHours() || v.getUTCMinutes() || v.getUTCSeconds() ? `${d} ${t}` : d; + } + if (typeof v === "object") { + if ("richText" in v) return v.richText.map((p) => p.text).join(""); + if ("text" in v) return String(v.text); + if ("result" in v) return text(v.result as ExcelJS.CellValue); + return ""; + } + return String(v); + }; + const matrix: string[][] = []; + sheet.eachRow({ includeEmpty: false }, (row) => { const cells: string[] = []; for (let c = 1; c <= sheet.columnCount; c++) cells.push(text(row.getCell(c).value).trim()); if (cells.some(Boolean)) matrix.push(cells); }); + if (!matrix.length) throw new KitError("empty_table", "The table has no rows."); + const columns = matrix[0].map((c, i) => c || `列${i + 1}`); + return { columns, rows: matrix.slice(1).map((cells) => Object.fromEntries(columns.map((c, i) => [c, cells[i] ?? ""]))) }; +} + +function rulesOf(st: Record): Rules { + const weekend = s(st.weekend) === "sun" ? [0] : s(st.weekend) === "none" ? [] : [6, 0]; + return { start: hm(s(st.start)) ?? 540, end: hm(s(st.end)) ?? 1080, grace: Number(st.grace) || 0, earlyGrace: Number(st.earlyGrace) || 0, lunch: Number(st.lunch ?? 60) || 0, otAfter: Number(st.otAfter ?? 30) || 0, otMin: Number(st.otMin ?? 30) || 0, elastic: Number(st.elastic) || 0, weekend, holidays: parseDates(s(st.holidays)), workdays: parseDates(s(st.workdays)) }; +} + +function daysOfMonth(month: string) { + const [y, m] = month.split("-").map(Number); + const n = new Date(Date.UTC(y, m, 0)).getUTCDate(); + return Array.from({ length: n }, (_, i) => `${month}-${pad(i + 1)}`); +} + +interface Person { name: string; dept: string; days: number; attended: number; late: number; lateMin: number; early: number; earlyMin: number; missing: number; absent: number; excused: number; otWeekday: number; otRest: number; worked: number } +function evaluateAll(p: Project) { + const r = rulesOf(p.settings); + const results: DayResult[] = p.rows.map((row) => evaluate(s(row.date), hm(s(row.in)), hm(s(row.out)), s(row.note), r)); + const people = new Map(); + p.rows.forEach((row, i) => { + const x = results[i]; + const k = s(row.name); + const pp = people.get(k) ?? { name: k, dept: s(row.dept), days: 0, attended: 0, late: 0, lateMin: 0, early: 0, earlyMin: 0, missing: 0, absent: 0, excused: 0, otWeekday: 0, otRest: 0, worked: 0 }; + if (!x.rest) { pp.days++; if (!x.absent && !(x.excused && !s(row.in) && !s(row.out))) pp.attended++; } + if (x.late) { pp.late++; pp.lateMin += x.late; } + if (x.early) { pp.early++; pp.earlyMin += x.early; } + pp.missing += x.missing; + if (x.absent) pp.absent++; + if (x.excused) pp.excused++; + if (x.rest) pp.otRest += x.ot; else pp.otWeekday += x.ot; + pp.worked += x.worked; + people.set(k, pp); + }); + return { rules: r, results, people: [...people.values()] }; +} +const h1 = (m: number) => Math.round((m / 60) * 10) / 10; + +const def: AppDef = { + name: NAME, + version: VERSION, + prefix: "attend", + title: ["考勤统计", "Attendance Report"], + openDescription: + "Turn raw clock-in records (CSV/XLSX exported from a time clock or attendance app: one row per punch with 姓名/name and 打卡时间/time, or 日期/date + 时间/time columns; 部门/department optional) into a monthly attendance report: for each person and working day the first and last punch, late arrivals, early leaves, missing punches, absences and overtime (weekday and rest-day). Rules: shift start/end, late grace minutes, flexible start (arrive up to N minutes late and leave as much later), lunch break, overtime threshold, weekend days, public holidays and make-up working days. Fix punches or mark leave/business trips in the table, then export a summary workbook and one workbook per person.", + inputs: { exts: [".csv", ".xlsx", ".tsv"], min: 1, max: 1, label: ["选择打卡记录", "Pick the clock-in records"] }, + settings: [ + { key: "month", label: ["月份(YYYY-MM,留空自动)", "Month (YYYY-MM, blank = auto)"], type: "text", default: "", reload: true }, + { key: "start", label: ["上班时间", "Shift start"], type: "text", default: "09:00" }, + { key: "end", label: ["下班时间", "Shift end"], type: "text", default: "18:00" }, + { key: "grace", label: ["迟到宽限(分钟)", "Late grace (min)"], type: "number", default: 5 }, + { key: "earlyGrace", label: ["早退宽限(分钟)", "Early-leave grace (min)"], type: "number", default: 0 }, + { key: "elastic", label: ["弹性上班(分钟,晚到可晚走)", "Flexible start (min, arrive later = leave later)"], type: "number", default: 0 }, + { key: "lunch", label: ["午休(分钟)", "Lunch break (min)"], type: "number", default: 60 }, + { key: "otAfter", label: ["下班后多少分钟起算加班", "Overtime starts after (min past shift end)"], type: "number", default: 30 }, + { key: "otMin", label: ["加班最少计(分钟)", "Minimum overtime counted (min)"], type: "number", default: 30 }, + { key: "weekend", label: ["休息日", "Rest days"], type: "select", default: "sat-sun", options: [{ value: "sat-sun", label: ["周六日", "Sat + Sun"] }, { value: "sun", label: ["仅周日", "Sun only"] }, { value: "none", label: ["无(排班制)", "None"] }] }, + { key: "holidays", label: ["节假日(如 2026-10-01..2026-10-07)", "Holidays (e.g. 2026-10-01..2026-10-07)"], type: "text", default: "" }, + { key: "workdays", label: ["调休上班日", "Make-up working days"], type: "text", default: "" }, + ], + columns: () => [ + { key: "name", label: ["姓名", "Name"] }, + { key: "dept", label: ["部门", "Dept"] }, + { key: "date", label: ["日期", "Date"], readOnly: true }, + { key: "wd", label: ["星期", "Day"], readOnly: true }, + { key: "in", label: ["上班", "In"] }, + { key: "out", label: ["下班", "Out"] }, + { key: "note", label: ["备注(请假/出差…)", "Note (leave/trip…)"] }, + { key: "status", label: ["结果", "Result"], readOnly: true, wide: true }, + ], + async load({ ws, files, settings }) { + const t = await readPunchTable(ws, files[0]); + const m = mapHeaders(t.columns, { name: ["姓名", "名字", "员工", "name", "employee"], dept: ["部门", "department", "dept"], id: ["工号", "编号", "employee id", "id"], datetime: ["打卡时间", "时间", "datetime", "punch time", "timestamp", "check time", "签到时间"], date: ["日期", "打卡日期", "date"], time: ["打卡时刻", "time", "时刻"] }); + if (!m.name) throw new KitError("no_name_column", `Couldn't find a name column (姓名/name). Columns: ${t.columns.join(", ")}`); + const tcol = m.datetime ?? m.time; + if (!tcol) throw new KitError("no_time_column", `Couldn't find a punch time column (打卡时间/time). Columns: ${t.columns.join(", ")}`); + const punches = new Map(); + let bad = 0; + for (const r of t.rows) { + const name = s(r[m.name]); + if (!name) continue; + const raw = s(r[tcol]); + const date = parseDate(m.date && m.date !== tcol ? r[m.date] : raw); + const tm = hm(raw.replace(/^\d{4}[-/.年]\d{1,2}[-/.月]\d{1,2}日?\s*/, "")); + if (!date || tm === null) { bad++; continue; } + const k = `${name}\t${date}`; + const e = punches.get(k) ?? { name, dept: m.dept ? s(r[m.dept]) : "", date, times: [] }; + e.times.push(tm); + punches.set(k, e); + } + if (!punches.size) throw new KitError("no_punches", "No punch records with a readable date and time."); + const months = new Map(); + for (const e of punches.values()) months.set(e.date.slice(0, 7), (months.get(e.date.slice(0, 7)) ?? 0) + 1); + let month = s(settings.month); + if (!/^\d{4}-\d{2}$/.test(month)) { month = [...months].sort((a, b) => b[1] - a[1])[0][0]; settings.month = month; } + const rules = rulesOf(settings); + const names = [...new Map([...punches.values()].map((e) => [e.name, e.dept])).entries()]; + const rows: Row[] = []; + for (const [name, dept] of names) { + for (const date of daysOfMonth(month)) { + const e = punches.get(`${name}\t${date}`); + if (!e && !isWorkday(date, rules)) continue; + const ts = [...new Set(e?.times ?? [])].sort((a, b) => a - b); + let inT: number | null = null, outT: number | null = null; + if (ts.length >= 2) { inT = ts[0]; outT = ts[ts.length - 1]; } + else if (ts.length === 1) { if (ts[0] < (rules.start + rules.end) / 2) inT = ts[0]; else outT = ts[0]; } + rows.push({ name, dept, date, wd: `周${WD[weekdayOf(date)]}`, in: fmt(inT), out: fmt(outT), note: "", status: "", punches: ts.length }); + } + } + return { rows, meta: { month, badRows: bad, otherMonths: [...months.keys()].filter((x) => x !== month) } }; + }, + compute(p) { + const issues: Issue[] = []; + const { results, people } = evaluateAll(p); + const rows = p.rows.map((r, i) => ({ ...r, status: results[i].status })); + p.rows.forEach((r, i) => { + for (const k of ["in", "out"] as const) if (s(r[k]) && hm(s(r[k])) === null) issues.push({ level: "error", row: i, key: k, message: `${r.name} ${r.date}: “${r[k]}” isn't a time (HH:MM).` }); + const x = results[i]; + if (x.missing) issues.push({ level: "warn", row: i, key: s(r.in) ? "out" : "in", message: `${r.name} ${r.date}: ${x.flags.find((f) => f.startsWith("缺")) ?? "missing punch"}.` }); + if (x.absent) issues.push({ level: "warn", row: i, key: "note", message: `${r.name} ${r.date}: no punches (absent) — add 请假/出差 in the note if excused.` }); + }); + const meta = p.meta as { badRows?: number; otherMonths?: string[]; month?: string }; + if (meta.badRows) issues.push({ level: "info", message: `${meta.badRows} record(s) had no readable date/time and were skipped.` }); + if (meta.otherMonths?.length) issues.push({ level: "info", message: `Records from ${meta.otherMonths.join(", ")} were left out (month ${meta.month}).` }); + const tot = people.reduce((a, x) => ({ late: a.late + x.late, missing: a.missing + x.missing, absent: a.absent + x.absent, ot: a.ot + x.otWeekday + x.otRest }), { late: 0, missing: 0, absent: 0, ot: 0 }); + const preview = `${["姓名", "部门", "应出勤", "实出勤", "迟到", "早退", "缺卡", "缺勤", "请假/出差", "加班(时)"].map((x) => ``).join("")}${people.map((x) => `${[x.name, x.dept, x.days, x.attended, x.late ? `${x.late} 次 / ${x.lateMin} 分` : "", x.early ? `${x.early} 次 / ${x.earlyMin} 分` : "", x.missing || "", x.absent || "", x.excused || "", h1(x.otWeekday + x.otRest) || ""].map((v, i) => ``).join("")}`).join("")}
${x}
${esc(String(v))}
`; + return { rows, issues, preview, summary: `${people.length} people · ${meta.month} · ${tot.late} late · ${tot.missing} missing punches · ${tot.absent} absences · ${h1(tot.ot)} h overtime`, stats: { people: people.length, late: tot.late, missing: tot.missing, absent: tot.absent, overtimeHours: h1(tot.ot) } }; + }, + exports: [ + { + id: "summary", label: ["汇总表 Excel", "Summary workbook"], description: "attendance-.xlsx — one line per person plus every day's detail (problems highlighted)", + async run({ project, write, computed }: ExportCtx) { + const errs = (computed.issues ?? []).filter((i) => i.level === "error"); + if (errs.length) throw new KitError("has_errors", `Fix first: ${errs[0].message}`); + const { results, people } = evaluateAll(project); + const month = s(project.meta?.month); + const detail = detailSheet(project.rows, results); + const sheets: SheetSpec[] = [ + { name: `汇总 ${month}`, headers: ["姓名", "部门", "应出勤天数", "实出勤天数", "迟到次数", "迟到分钟", "早退次数", "早退分钟", "缺卡次数", "缺勤天数", "请假/出差", "工作日加班(时)", "休息日加班(时)", "工作时长(时)"], rows: people.map((x) => [x.name, x.dept, x.days, x.attended, x.late, x.lateMin, x.early, x.earlyMin, x.missing, x.absent, x.excused, h1(x.otWeekday), h1(x.otRest), h1(x.worked)]), marks: people.flatMap((x, i) => [x.late ? { row: i, col: 4 } : null, x.missing ? { row: i, col: 8 } : null, x.absent ? { row: i, col: 9, color: "#FECACA" } : null].filter(Boolean) as SheetSpec["marks"] & object) }, + detail, + { name: "规则 Rules", headers: ["项目", "设置"], rows: [["月份", month], ["上班", s(project.settings.start)], ["下班", s(project.settings.end)], ["迟到宽限(分)", Number(project.settings.grace) || 0], ["早退宽限(分)", Number(project.settings.earlyGrace) || 0], ["弹性(分)", Number(project.settings.elastic) || 0], ["午休(分)", Number(project.settings.lunch) || 0], ["加班起算(下班后分钟)", Number(project.settings.otAfter) || 0], ["加班最少(分)", Number(project.settings.otMin) || 0], ["休息日", s(project.settings.weekend)], ["节假日", s(project.settings.holidays)], ["调休上班", s(project.settings.workdays)]] }, + ]; + return [await write(`attendance-${month}.xlsx`, await writeXlsx(sheets))]; + }, + }, + { + id: "people", label: ["每人一份 Excel", "One workbook per person"], description: "people/-.xlsx — each person's days for them to check", + async run({ project, write }: ExportCtx) { + const { results } = evaluateAll(project); + const month = s(project.meta?.month); + const out: string[] = []; + for (const name of [...new Set(project.rows.map((r) => s(r.name)))]) { + const idx = project.rows.map((r, i) => (s(r.name) === name ? i : -1)).filter((i) => i >= 0); + out.push(await write(`people/${safeFileName(name, "person")}-${month}.xlsx`, await writeXlsx([detailSheet(idx.map((i) => project.rows[i]), idx.map((i) => results[i]), `${name} ${month}`)]))); + } + return out; + }, + }, + ], +}; + +function detailSheet(rows: Row[], results: DayResult[], name = "明细 Detail"): SheetSpec { + const marks: NonNullable = []; + rows.forEach((_, i) => { + const x = results[i]; + if (x.late) marks.push({ row: i, col: 4 }); + if (x.early) marks.push({ row: i, col: 5 }); + if (x.missing) marks.push({ row: i, col: s(rows[i].in) ? 5 : 4, color: "#FDBA74" }); + if (x.absent) marks.push({ row: i, col: 7, color: "#FECACA" }); + if (x.ot) marks.push({ row: i, col: 10, color: "#BFDBFE" }); + }); + return { name, headers: ["姓名", "部门", "日期", "星期", "上班", "下班", "备注", "结果", "迟到(分)", "早退(分)", "加班(分)", "工作(分)"], rows: rows.map((r, i) => [s(r.name), s(r.dept), s(r.date), s(r.wd), s(r.in), s(r.out), s(r.note), results[i].status, results[i].late || "", results[i].early || "", results[i].ot || "", results[i].worked || ""]), marks, widths: [10, 10, 12, 6, 7, 7, 14, 30, 8, 8, 8, 8] }; +} + +export function createServer(options: { workspaceRoot: string; assetRoot: string; log?: (line: string) => void }) { + return createApp(def, options).server; +} From a7b020bf413c6ab703a90eea7e688743b0f12545 Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:25:22 -0400 Subject: [PATCH 07/11] feat(ui-plugins): add Attendance Report (attendance-report) --- .../attendance-report/test/app-edit.test.ts | 50 +++++++++++++ .../attendance-report/test/attendance.test.ts | 74 +++++++++++++++++++ ui-plugins/attendance-report/test/e2e.json | 1 + .../test/workspace-links.test.ts | 43 +++++++++++ 4 files changed, 168 insertions(+) create mode 100644 ui-plugins/attendance-report/test/app-edit.test.ts create mode 100644 ui-plugins/attendance-report/test/attendance.test.ts create mode 100644 ui-plugins/attendance-report/test/e2e.json create mode 100644 ui-plugins/attendance-report/test/workspace-links.test.ts diff --git a/ui-plugins/attendance-report/test/app-edit.test.ts b/ui-plugins/attendance-report/test/app-edit.test.ts new file mode 100644 index 00000000..f9fe0f53 --- /dev/null +++ b/ui-plugins/attendance-report/test/app-edit.test.ts @@ -0,0 +1,50 @@ +import { mkdtempSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { describe, expect, it } from "vitest"; +import { createApp, resolveColumnKey, type AppDef } from "../src/kit/app.ts"; +import { connect } from "../src/kit/testing.ts"; + +// 回归测试:_edit 的 set.values 用列标题(如“月薪”)也要能改到对应的列;认不出的列名要明确警告,不能悄悄忽略。 +const cols = [ + { key: "c0", label: ["姓名", "Name"] as [string, string] }, + { key: "c1", label: ["月薪", "Monthly Salary"] as [string, string], type: "number" as const }, + { key: "c2", label: ["合计", "Total"] as [string, string], readOnly: true }, +]; +const def: AppDef = { + name: "edit-test", version: "0.0.1", prefix: "et", title: ["测试", "Test"], openDescription: "test", + inputs: { exts: [".csv"], min: 0, max: 1, label: ["", ""] }, + settings: [], + columns: () => cols, + newRow: () => ({ c0: "", c1: 0, c2: 0 }), + load: async () => ({ rows: [{ c0: "张三", c1: 8000, c2: 0 }, { c0: "李四", c1: 9000, c2: 0 }] }), + compute: (p) => ({ rows: p.rows, issues: [], summary: `${p.rows.length} rows`, stats: {} }), + exports: [{ id: "none", label: ["无", "None"], description: "nothing", run: async () => [] }], +}; + +describe("edit by column label", () => { + it("resolves keys, labels and loose labels", () => { + expect(resolveColumnKey(cols, "c1")).toBe("c1"); + expect(resolveColumnKey(cols, "月薪")).toBe("c1"); + expect(resolveColumnKey(cols, " 月 薪 ")).toBe("c1"); + expect(resolveColumnKey(cols, "monthly salary")).toBe("c1"); + expect(resolveColumnKey(cols, "Name")).toBe("c0"); + expect(resolveColumnKey(cols, "奖金")).toBeUndefined(); + expect(resolveColumnKey(cols, "hidden", { hidden: 1 })).toBe("hidden"); + }); + it("edits through the tool and warns about unknown keys", async () => { + const root = mkdtempSync(join(tmpdir(), "edit-")); + const c = await connect(createApp(def, { workspaceRoot: root, assetRoot: root }).server); + await c.call("et_open", { inputs: [], project: "p" }); + const e = await c.call("et_edit", { project: "p", set: [{ row: 0, values: { 月薪: "12000", " monthly salary ": 1 } }, { row: 1, values: { 姓名: "王五", 奖金: 500, Total: 1 } }], add: [{ Name: "赵六", 月薪: 7000, foo: 1 }] }); + const rows = e.data.rows as Record[]; + expect(rows[0].c1).toBe(1); + expect(rows[1]).toMatchObject({ c0: "王五", c1: 9000, c2: 0 }); + expect(rows[1]).not.toHaveProperty("奖金"); + expect(rows[2]).toMatchObject({ c0: "赵六", c1: 7000 }); + expect(rows[2]).not.toHaveProperty("foo"); + expect(e.text).toContain("Warning: ignored unknown column(s) “奖金”, “foo”"); + expect(e.text).toContain("c1 (月薪 / Monthly Salary)"); + expect(e.text).toContain("c2 is calculated and cannot be edited."); + }); +}); diff --git a/ui-plugins/attendance-report/test/attendance.test.ts b/ui-plugins/attendance-report/test/attendance.test.ts new file mode 100644 index 00000000..129ffe49 --- /dev/null +++ b/ui-plugins/attendance-report/test/attendance.test.ts @@ -0,0 +1,74 @@ +import { cp, mkdtemp } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; +import ExcelJS from "exceljs"; +import { describe, expect, it } from "vitest"; +import { evaluate, parseDates, type Rules } from "../src/att.ts"; +import { connect } from "../src/kit/testing.ts"; +import { createServer } from "../src/server.ts"; + +const HERE = dirname(fileURLToPath(import.meta.url)); +const R = (o: Partial = {}): Rules => ({ start: 540, end: 1080, grace: 5, earlyGrace: 0, lunch: 60, otAfter: 30, otMin: 30, elastic: 0, weekend: [6, 0], holidays: new Set(), workdays: new Set(), ...o }); + +describe("rules", () => { + it("parses date ranges", () => { + expect([...parseDates("2026-10-01..2026-10-03, 2026-11-03")]).toEqual(["2026-10-01", "2026-10-02", "2026-10-03", "2026-11-03"]); + }); + it("judges a day", () => { + expect(evaluate("2026-11-02", 9 * 60 + 4, 18 * 60 + 5, "", R()).status).toBe("正常"); + const late = evaluate("2026-11-02", 9 * 60 + 20, 18 * 60, "", R()); + expect(late.late).toBe(20); + const flex = evaluate("2026-11-02", 9 * 60 + 20, 18 * 60 + 25, "", R({ elastic: 30 })); + expect(flex.late).toBe(0); + expect(flex.early).toBe(0); + expect(evaluate("2026-11-02", 9 * 60 + 20, 18 * 60 + 10, "", R({ elastic: 30 })).early).toBe(10); + const ot = evaluate("2026-11-02", 9 * 60, 20 * 60 + 30, "", R()); + expect(ot.ot).toBe(150); + expect(evaluate("2026-11-02", 9 * 60, 18 * 60 + 20, "", R()).ot).toBe(0); + expect(evaluate("2026-11-02", null, null, "", R()).absent).toBe(true); + expect(evaluate("2026-11-02", null, null, "病假", R())).toMatchObject({ absent: false, excused: true }); + expect(evaluate("2026-11-02", null, 18 * 60, "", R()).missing).toBe(1); + expect(evaluate("2026-11-07", 10 * 60, 15 * 60, "", R())).toMatchObject({ rest: true, ot: 240 }); + expect(evaluate("2026-11-07", null, null, "", R({ workdays: new Set(["2026-11-07"]) })).absent).toBe(true); + }); +}); + +describe("attendance tools", () => { + it("reports a month", async () => { + const root = await mkdtemp(join(tmpdir(), "att-")); + await cp(join(HERE, "samples"), root, { recursive: true }); + const c = await connect(createServer({ workspaceRoot: root, assetRoot: root })); + const o = await c.call("attend_open", { inputs: ["punches.xlsx"], project: "nov" }); + expect(o.data.stats).toMatchObject({ people: 6, late: 4, missing: 2, absent: 3 }); + expect(o.text).toContain("6 people · 2026-11"); + const rows = o.data.rows as Record[]; + expect(rows).toHaveLength(6 * 21 + 2); + const linMissing = rows.find((r) => r.name === "林晓雯" && r.date === "2026-11-09")!; + expect(linMissing).toMatchObject({ in: "", status: "缺上班卡" }); + expect(String(rows.find((r) => r.name === "欧阳明" && r.date === "2026-11-14")!.status)).toBe("休息日加班"); + expect(JSON.stringify(o.data.issues)).toContain("2026-10 were left out"); + const zhao = rows.map((r, i) => ({ r, i })).filter(({ r }) => r.name === "赵小雨" && (r.date === "2026-11-18" || r.date === "2026-11-19")).map(({ i }) => i); + const e = await c.call("attend_edit", { project: "nov", settings: { holidays: "2026-11-12" }, set: zhao.map((row) => ({ row, values: { note: "年假" } })) }); + expect(e.data.stats).toMatchObject({ absent: 0, late: 4 }); + const lin = rows.findIndex((r) => r.name === "林晓雯" && r.date === "2026-11-09"); + const f = await c.call("attend_edit", { project: "nov", set: [{ row: lin, values: { in: "08:55" } }] }); + expect(f.data.stats).toMatchObject({ missing: 1 }); + await c.call("attend_export", { project: "nov" }); + const wb = new ExcelJS.Workbook(); + await wb.xlsx.readFile(join(root, "attendance-report/nov/attendance-2026-11.xlsx")); + const sum = wb.getWorksheet(1)!; + const head = (sum.getRow(1).values as unknown[]).slice(1); + const row = (name: string) => { for (let i = 2; i <= sum.rowCount; i++) if (sum.getRow(i).getCell(1).value === name) return (sum.getRow(i).values as unknown[]).slice(1); return []; }; + const ch = row("陈思"); + expect(ch[head.indexOf("迟到次数")]).toBe(4); + const oy = row("欧阳明"); + expect(oy[head.indexOf("休息日加班(时)")]).toBeGreaterThan(14); // 11-14 周六 + 11-12 设为节假日后整天算休息日加班 + expect(oy[head.indexOf("工作日加班(时)")]).toBeGreaterThan(12); + expect(row("赵小雨")[head.indexOf("请假/出差")]).toBe(2); + expect(row("王磊")[head.indexOf("应出勤天数")]).toBe(20); + const p = new ExcelJS.Workbook(); + await p.xlsx.readFile(join(root, "attendance-report/nov/people/周子涵-2026-11.xlsx")); + expect(p.getWorksheet(1)!.rowCount).toBe(23); + }); +}); diff --git a/ui-plugins/attendance-report/test/e2e.json b/ui-plugins/attendance-report/test/e2e.json new file mode 100644 index 00000000..6c521b74 --- /dev/null +++ b/ui-plugins/attendance-report/test/e2e.json @@ -0,0 +1 @@ +{ "prefix": "attend", "folder": "考勤", "pick": ["punches.xlsx"], "uiEdit": { "row": 0, "key": "note", "value": "出差" }, "expectText": "6 people · 2026-11", "expectFiles": ["attendance-2026-11\\.xlsx$", "people/.+\\.xlsx$"] } diff --git a/ui-plugins/attendance-report/test/workspace-links.test.ts b/ui-plugins/attendance-report/test/workspace-links.test.ts new file mode 100644 index 00000000..f3dae538 --- /dev/null +++ b/ui-plugins/attendance-report/test/workspace-links.test.ts @@ -0,0 +1,43 @@ +import { existsSync, mkdirSync, mkdtempSync, symlinkSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { describe, expect, it } from "vitest"; +import { Workspace } from "../src/kit/workspace.ts"; + +// 回归测试:工作区里的符号链接不能把读写带到工作区之外(TEST-FINDINGS #2) +describe("workspace symlink containment", () => { + const base = mkdtempSync(join(tmpdir(), "wslinks-")); + const root = join(base, "项目 ws"), outside = join(base, "outside"); + mkdirSync(join(root, "inner"), { recursive: true }); + mkdirSync(outside, { recursive: true }); + writeFileSync(join(outside, "secret.txt"), "SECRET"); + writeFileSync(join(root, "inner", "ok.txt"), "ok"); + symlinkSync(outside, join(root, "out-link")); + symlinkSync(join(outside, "secret.txt"), join(root, "secret-link.txt")); + symlinkSync(join(outside, "new-file.txt"), join(root, "dangling.txt")); + symlinkSync(join(root, "inner"), join(root, "inner-link")); + symlinkSync(root, join(base, "root-link")); + const ws = new Workspace(root); + + it("refuses to read through a link to outside (directory and file links)", async () => { + await expect(ws.read("out-link/secret.txt")).rejects.toMatchObject({ code: "outside_workspace" }); + await expect(ws.read("secret-link.txt")).rejects.toMatchObject({ code: "outside_workspace" }); + expect(await ws.exists("out-link/secret.txt")).toBe(false); + }); + it("refuses to write through a link, including to targets that do not exist yet", async () => { + await expect(ws.write("out-link/a/b/new.txt", "x")).rejects.toMatchObject({ code: "outside_workspace" }); + await expect(ws.write("dangling.txt", "x")).rejects.toMatchObject({ code: "outside_workspace" }); + expect(existsSync(join(outside, "a"))).toBe(false); + expect(existsSync(join(outside, "new-file.txt"))).toBe(false); + }); + it("still allows normal paths, new nested files and links that stay inside", async () => { + expect(await ws.write("新 目录/子/文件.txt", "中文")).toBe("新 目录/子/文件.txt"); + expect((await ws.read("inner-link/ok.txt")).toString()).toBe("ok"); + await expect(ws.read("../outside/secret.txt")).rejects.toMatchObject({ code: "outside_workspace" }); + }); + it("works when the workspace root itself is reached through a link", async () => { + const viaLink = new Workspace(join(base, "root-link")); + expect((await viaLink.read("inner/ok.txt")).toString()).toBe("ok"); + await expect(viaLink.read("out-link/secret.txt")).rejects.toMatchObject({ code: "outside_workspace" }); + }); +}); From 8072b2d500d928ef73b12e77faea5eebe10eebd0 Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:26:00 -0400 Subject: [PATCH 08/11] feat(ui-plugins): add Attendance Report (attendance-report) --- ui-plugins/attendance-report/ui/app.css | 39 ++++ ui-plugins/attendance-report/ui/app.ts | 236 +++++++++++++++++++++++ ui-plugins/attendance-report/ui/env.d.ts | 4 + ui-plugins/attendance-report/ui/kit.css | 34 ++++ ui-plugins/attendance-report/ui/kit.ts | 133 +++++++++++++ ui-plugins/attendance-report/ui/main.ts | 3 + 6 files changed, 449 insertions(+) create mode 100644 ui-plugins/attendance-report/ui/app.css create mode 100644 ui-plugins/attendance-report/ui/app.ts create mode 100644 ui-plugins/attendance-report/ui/env.d.ts create mode 100644 ui-plugins/attendance-report/ui/kit.css create mode 100644 ui-plugins/attendance-report/ui/kit.ts create mode 100644 ui-plugins/attendance-report/ui/main.ts diff --git a/ui-plugins/attendance-report/ui/app.css b/ui-plugins/attendance-report/ui/app.css new file mode 100644 index 00000000..19894635 --- /dev/null +++ b/ui-plugins/attendance-report/ui/app.css @@ -0,0 +1,39 @@ +.top { display:flex; align-items:baseline; gap:10px; } +.files { max-height: 260px; overflow:auto; border:1px solid var(--line); border-radius:6px; padding:4px; background:var(--bg); } +.file { padding:2px 4px; font-size:12px; word-break: break-all; } +.filter { width:100%; margin-bottom:6px; } +.settings { display:grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap:6px 12px; } +.set { justify-content: space-between; } +.set span { color: var(--muted); } +.set input[type=text], .set input[type=number], .set select, .set textarea, .set input[type=date] { width: 60%; } +.set-textarea { grid-column: 1 / -1; align-items: flex-start; } +.set-textarea textarea { width: 80%; } +.head .pname { font-weight:600; } +.summary { margin:8px 0 4px; } +.chips { display:flex; flex-wrap:wrap; gap:6px; margin:4px 0 8px; } +.chip { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:1px 8px; font-size:12px; } +.issues { margin:6px 0; } +.issues ul { margin:4px 0; padding-left:18px; max-height:180px; overflow:auto; } +.issues li { cursor:pointer; } +.lvl-error { color: var(--bad); } .lvl-warn { color: var(--warn); } +.split2 { display:grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap:10px; align-items:start; } +.split2 .previewcol:empty { display:none; } +.split2:has(.previewcol:empty) { grid-template-columns: 1fr; } +@media (max-width: 900px) { .split2 { grid-template-columns: 1fr; } } +.tablewrap { overflow:auto; max-height: 60vh; border:1px solid var(--line); border-radius:6px; } +table.edit { font-size:12px; } +table.edit td { padding:1px 2px; } +table.edit th { position: sticky; top: 0; z-index: 1; white-space: nowrap; } +table.edit td input[type=text], table.edit td select { width:100%; min-width:70px; border-color: transparent; background: transparent; padding:2px 4px; } +table.edit td input:focus, table.edit td select:focus { border-color: var(--accent); background: var(--bg); } +table.edit td.wide input { min-width: 200px; } +table.edit td.ro { color: var(--muted); padding: 2px 6px; white-space: nowrap; } +table.edit .num { text-align: right; } +table.edit td.idx { color: var(--muted); text-align: right; padding: 2px 4px; } +table.edit tr.warn td.idx { background: var(--warnbg); } +table.edit tr.err td.idx { background: var(--badbg); color: var(--bad); } +table.edit tr.focus td { outline: 1px solid var(--accent); } +button.del { padding: 0 6px; } +.preview { border:1px solid var(--line); border-radius:6px; padding:8px; background: var(--bg); overflow:auto; max-height: 75vh; } +.preview img, .preview svg { max-width: 100%; height: auto; } +.exported ul { margin: 4px 0; padding-left: 18px; font-size: 12px; } diff --git a/ui-plugins/attendance-report/ui/app.ts b/ui-plugins/attendance-report/ui/app.ts new file mode 100644 index 00000000..dba63195 --- /dev/null +++ b/ui-plugins/attendance-report/ui/app.ts @@ -0,0 +1,236 @@ +import css from "./kit.css"; +import appCss from "./app.css"; +import { applyTheme, call, h, initHost, locale, onHostContext, onToolResult, put, toast, updateContext } from "./kit.ts"; + +type L = [string, string]; +interface Field { key: string; label: L; type: string; options?: { value: string; label: L }[]; default?: unknown; help?: L; min?: number; max?: number } +interface Column { key: string; label: L; type?: string; options?: string[]; readOnly?: boolean; wide?: boolean } +interface Issue { level: string; message: string; row?: number; key?: string } +interface Info { app: string; prefix: string; title: L; inputs: { exts: string[]; min: number; max: number; label: L; folders?: boolean }; settings: Field[]; exports: { id: string; label: L; description: string }[]; files: string[]; folders: string[]; projects: string[] } +interface View { project: string; inputs: string[]; settings: Record; columns: Column[]; rows: Record[]; totalRows: number; canAdd: boolean; issues: Issue[]; summary: string; stats: Record; preview: string; exported: string[]; justExported?: string[] } + +const T = (l: L | undefined) => (l ? (locale() === "zh" ? l[0] : l[1]) : ""); +const t = (zh: string, en: string) => (locale() === "zh" ? zh : en); +const PAGE = 100; + +export function startApp(name: string, version: string) { + const style = document.createElement("style"); + style.textContent = css + appCss; + document.head.append(style); + const root = document.getElementById("root")!; + const state: { info?: Info; view?: View; picked: Set; filter: string; page: number; startSettings: Record; focusRow?: number; mode: "start" | "project" } = { picked: new Set(), filter: "", page: 0, startSettings: {}, mode: "start" }; + + async function busy(work: () => Promise, label: string): Promise { + root.classList.add("busy"); + const st = document.getElementById("status"); + if (st) st.textContent = label; + try { + return await work(); + } catch (error) { + toast(error instanceof Error ? error.message : String(error), "error"); + return undefined; + } finally { + root.classList.remove("busy"); + const s2 = document.getElementById("status"); + if (s2) s2.textContent = ""; + } + } + const P = () => state.info?.prefix ?? name; + function show(v: Record) { + const prev = state.view?.project; + state.view = v as unknown as View; + state.mode = "project"; + if (prev !== state.view.project) state.page = 0; + render(); + } + onToolResult((v) => { + if (v?.kind === "project" && v.app === name) show(v); + }); + + async function refreshInfo() { + const info = await call("app_info", {}); + state.info = info; + render(); + } + + function fieldInput(f: Field, value: unknown, onChange: (v: unknown) => void) { + const v = value ?? f.default ?? ""; + if (f.type === "bool") return h("input", { type: "checkbox", checked: !!v, "data-key": f.key, onchange: (e: Event) => onChange((e.target as HTMLInputElement).checked) }); + if (f.type === "select") + return h("select", { "data-key": f.key, onchange: (e: Event) => onChange((e.target as HTMLSelectElement).value) }, ...(f.options ?? []).map((o) => h("option", { value: o.value, selected: String(v) === o.value }, T(o.label)))); + if (f.type === "textarea") return h("textarea", { rows: 3, "data-key": f.key, value: String(v), onchange: (e: Event) => onChange((e.target as HTMLTextAreaElement).value) }); + return h("input", { + type: f.type === "number" ? "number" : f.type === "color" ? "color" : f.type === "date" ? "date" : "text", + "data-key": f.key, + value: String(v), + min: f.min, + max: f.max, + step: f.type === "number" ? "any" : undefined, + onchange: (e: Event) => onChange(f.type === "number" ? Number((e.target as HTMLInputElement).value) : (e.target as HTMLInputElement).value), + }); + } + function settingsForm(values: Record, onChange: (key: string, v: unknown) => void) { + const fields = state.info?.settings ?? []; + if (!fields.length) return null; + return h("div", { class: "settings" }, ...fields.map((f) => h("label", { class: `set set-${f.type}`, title: T(f.help) }, h("span", {}, T(f.label)), fieldInput(f, values[f.key], (v) => onChange(f.key, v))))); + } + + function renderStart() { + const info = state.info; + if (!info) return h("div", { class: "empty" }, t("正在连接…", "Connecting…")); + const list = info.inputs.folders ? info.folders : info.files; + const shown = list.filter((f) => !state.filter || f.toLowerCase().includes(state.filter.toLowerCase())).slice(0, 400); + const needs = info.inputs.min; + const open = () => + busy(async () => { + const r = await call(`${P()}_open`, { inputs: [...state.picked], settings: state.startSettings }); + show(r); + }, t("正在读取…", "Reading…")); + return h( + "div", + { class: "start" }, + h("div", { class: "card" }, + h("h2", {}, T(info.inputs.label)), + needs === 0 && !list.length ? h("p", { class: "muted" }, t("这个工具不需要输入文件,直接点“开始”。", "No input file needed — just press Start.")) : null, + list.length > 8 ? h("input", { class: "filter", placeholder: t("筛选文件…", "Filter files…"), value: state.filter, oninput: (e: Event) => { state.filter = (e.target as HTMLInputElement).value; render(); } }) : null, + list.length + ? h("div", { class: "files" }, ...shown.map((f) => h("label", { class: "file" }, h("input", { type: info.inputs.max === 1 ? "radio" : "checkbox", name: "pick", checked: state.picked.has(f), onchange: (e: Event) => { if (info.inputs.max === 1) state.picked.clear(); if ((e.target as HTMLInputElement).checked) state.picked.add(f); else state.picked.delete(f); render(); } }), h("span", {}, f)))) + : needs > 0 ? h("div", { class: "empty" }, t(`工作区里没有 ${info.inputs.exts.join(" / ")} 文件。把文件放进项目文件夹,或让助手帮你处理。`, `No ${info.inputs.exts.join(" / ")} files in the workspace yet. Add some to the project folder or ask the assistant.`)) : null, + ), + info.settings.length ? h("div", { class: "card" }, h("h2", {}, t("设置", "Settings")), settingsForm(state.startSettings, (k, v) => { state.startSettings[k] = v; })) : null, + h("div", { class: "row" }, + h("button", { class: "primary open", disabled: state.picked.size < needs || state.picked.size > info.inputs.max, onclick: open }, needs === 0 && !state.picked.size ? t("开始", "Start") : t(`打开(${state.picked.size})`, `Open (${state.picked.size})`)), + h("button", { onclick: () => busy(refreshInfo, "") }, t("刷新文件列表", "Refresh files")), + ), + info.projects.length + ? h("div", { class: "card" }, h("h2", {}, t("已保存的项目", "Saved projects")), h("div", { class: "row" }, ...info.projects.map((p) => h("button", { class: "proj", onclick: () => busy(async () => show(await call(`${P()}_status`, { project: p })), "") }, p)))) + : null, + ); + } + + let editQueue: Promise = Promise.resolve(); + function edit(args: Record) { + const v = state.view!; + editQueue = editQueue + .then(async () => { + const r = await call(`${P()}_edit`, { project: v.project, ...args }); + state.view = r as unknown as View; + renderProjectParts(); + }) + .catch((e) => toast(String((e as Error)?.message ?? e), "error")); + return editQueue; + } + + function cell(c: Column, row: Record, index: number) { + const value = row[c.key]; + if (c.readOnly) return h("td", { "data-key": c.key, class: `ro ${c.type === "number" ? "num" : ""}` }, typeof value === "number" ? fmtNum(value) : String(value ?? "")); + const onChange = (v: unknown) => edit({ set: [{ row: index, values: { [c.key]: v } }] }); + let input: HTMLElement; + if (c.type === "bool") input = h("input", { type: "checkbox", checked: !!value, onchange: (e: Event) => onChange((e.target as HTMLInputElement).checked) }); + else if (c.type === "select") input = h("select", { onchange: (e: Event) => onChange((e.target as HTMLSelectElement).value) }, ...[...new Set([String(value ?? ""), ...(c.options ?? [])])].map((o) => h("option", { value: o, selected: o === String(value ?? "") }, o))); + else input = h("input", { type: "text", class: c.type === "number" ? "num" : "", value: String(value ?? ""), onchange: (e: Event) => onChange((e.target as HTMLInputElement).value) }); + return h("td", { "data-key": c.key, class: c.wide ? "wide" : "" }, input); + } + const fmtNum = (n: number) => (Number.isInteger(n) ? String(n) : n.toFixed(2)); + + function tableEl() { + const v = state.view!; + const issuesByRow = new Map(); + for (const i of v.issues) if (i.row !== undefined) issuesByRow.set(i.row, [...(issuesByRow.get(i.row) ?? []), i]); + const pages = Math.max(1, Math.ceil(v.rows.length / PAGE)); + state.page = Math.min(state.page, pages - 1); + const start = state.page * PAGE; + const slice = v.rows.slice(start, start + PAGE); + if (!v.rows.length) return h("div", { class: "empty" }, t("没有数据行。", "No rows.")); + return h("div", {}, + h("div", { class: "tablewrap" }, + h("table", { class: "data edit" }, + h("thead", {}, h("tr", {}, h("th", {}, "#"), ...v.columns.map((c) => h("th", { class: c.readOnly ? "ro" : "" }, T(c.label))), v.canAdd ? h("th", {}, "") : null)), + h("tbody", {}, ...slice.map((row, k) => { + const index = start + k; + const iss = issuesByRow.get(index); + return h("tr", { class: `${iss?.some((i) => i.level === "error") ? "err" : iss ? "warn" : ""} ${state.focusRow === index ? "focus" : ""}`, "data-row": index, title: iss?.map((i) => i.message).join("\n") }, + h("td", { class: "idx" }, String(index)), ...v.columns.map((c) => cell(c, row, index)), + v.canAdd ? h("td", {}, h("button", { class: "del", title: t("删除这一行", "Delete row"), onclick: () => edit({ remove: [index] }) }, "×")) : null); + })), + ), + ), + h("div", { class: "row" }, + pages > 1 ? h("span", { class: "pager" }, h("button", { disabled: state.page === 0, onclick: () => { state.page--; renderProjectParts(); } }, "‹"), ` ${state.page + 1} / ${pages} `, h("button", { disabled: state.page >= pages - 1, onclick: () => { state.page++; renderProjectParts(); } }, "›")) : null, + v.totalRows > v.rows.length ? h("span", { class: "muted" }, t(`面板显示前 ${v.rows.length} 行,共 ${v.totalRows} 行`, `Showing ${v.rows.length} of ${v.totalRows} rows`)) : null, + v.canAdd ? h("button", { class: "add", onclick: () => edit({ add: [{}] }) }, t("+ 新增一行", "+ Add row")) : null, + ), + ); + } + + function issuesEl() { + const v = state.view!; + if (!v.issues.length) return h("div", { class: "issues ok" }, h("span", { class: "badge ok" }, t("没有发现问题", "No issues"))); + const counts = { error: 0, warn: 0, info: 0 } as Record; + for (const i of v.issues) counts[i.level] = (counts[i.level] ?? 0) + 1; + return h("details", { class: "issues", open: v.issues.length <= 12 }, + h("summary", {}, counts.error ? h("span", { class: "badge bad" }, t(`${counts.error} 个错误`, `${counts.error} error(s)`)) : null, " ", counts.warn ? h("span", { class: "badge" }, t(`${counts.warn} 个提醒`, `${counts.warn} warning(s)`)) : null, " ", counts.info ? h("span", { class: "badge ok" }, t(`${counts.info} 条说明`, `${counts.info} note(s)`)) : null), + h("ul", {}, ...v.issues.slice(0, 200).map((i) => h("li", { class: `lvl-${i.level}`, onclick: () => { if (i.row !== undefined) { state.focusRow = i.row; state.page = Math.floor(i.row / PAGE); renderProjectParts(); document.querySelector(`tr[data-row="${i.row}"]`)?.scrollIntoView({ block: "center" }); } } }, i.row !== undefined ? h("b", {}, `#${i.row} `) : null, i.key ? h("code", {}, i.key) : null, " ", i.message))), + ); + } + + function exportsEl() { + const v = state.view!; + const info = state.info; + const run = (formats?: string[]) => + busy(async () => { + const r = await call(`${P()}_export`, { project: v.project, ...(formats ? { formats } : {}) }, 900_000); + state.view = r as unknown as View; + renderProjectParts(); + toast(t(`已导出 ${state.view.exported.length} 个文件`, `Exported ${state.view.exported.length} file(s)`)); + updateContext(`User exported ${v.project}: ${state.view.exported.join(", ")}`).catch(() => undefined); + }, t("正在导出…", "Exporting…")); + return h("div", { class: "card exports" }, + h("h2", {}, t("导出", "Export")), + h("div", { class: "row" }, ...(info?.exports ?? []).map((e) => h("button", { class: "exp", title: e.description, "data-id": e.id, onclick: () => run([e.id]) }, T(e.label))), (info?.exports.length ?? 0) > 1 ? h("button", { class: "primary expall", onclick: () => run() }, t("全部导出", "Export all")) : null), + v.exported.length ? h("div", { class: "exported" }, h("div", { class: "muted" }, t("已导出:", "Exported:")), h("ul", {}, ...v.exported.map((f) => h("li", {}, h("code", {}, f))))) : null, + ); + } + + function renderProjectParts() { + const v = state.view; + if (!v) return; + const parts: Record Node | null> = { + summary: () => h("div", {}, h("div", { class: "summary" }, v.summary), Object.keys(v.stats).length ? h("div", { class: "chips" }, ...Object.entries(v.stats).map(([k, s]) => h("span", { class: "chip" }, h("b", {}, String(s)), " ", k))) : null), + issues: issuesEl, + table: tableEl, + preview: () => (v.preview ? (() => { const d = h("div", { class: "preview" }); d.innerHTML = v.preview; return d; })() : null), + exports: exportsEl, + }; + for (const [id, make] of Object.entries(parts)) { + const el = document.getElementById(`part-${id}`); + if (el) put(el, make()); + } + } + + function renderProject() { + const v = state.view!; + return h("div", { class: "project" }, + h("div", { class: "row head" }, + h("span", { class: "pname" }, v.project), + v.inputs.length ? h("span", { class: "muted" }, v.inputs.length > 3 ? t(`${v.inputs.length} 个输入`, `${v.inputs.length} inputs`) : v.inputs.join(" · ")) : null, + h("button", { class: "back", onclick: () => { state.mode = "start"; busy(refreshInfo, ""); } }, t("← 换文件", "← Other files")), + ), + state.info?.settings.length ? h("details", { class: "card", open: true }, h("summary", {}, t("设置", "Settings")), settingsForm(v.settings, (k, val) => edit({ settings: { [k]: val } }))) : null, + h("div", { id: "part-summary" }), + h("div", { id: "part-issues" }), + h("div", { class: "split2" }, h("div", { id: "part-table", class: "tablecol" }), h("div", { id: "part-preview", class: "previewcol" })), + h("div", { id: "part-exports" }), + ); + } + + function render() { + const title = state.info ? T(state.info.title) : name; + put(root, h("div", { class: "top" }, h("h1", {}, title), h("span", { id: "status", class: "muted" })), state.mode === "project" && state.view ? renderProject() : renderStart()); + if (state.mode === "project") renderProjectParts(); + } + + onHostContext(() => { applyTheme(); render(); }); + render(); + initHost(name, version).then(() => { applyTheme(); refreshInfo().catch((e) => toast(String(e?.message ?? e), "error")); }); +} diff --git a/ui-plugins/attendance-report/ui/env.d.ts b/ui-plugins/attendance-report/ui/env.d.ts new file mode 100644 index 00000000..4210a464 --- /dev/null +++ b/ui-plugins/attendance-report/ui/env.d.ts @@ -0,0 +1,4 @@ +declare module "*.css" { + const text: string; + export default text; +} diff --git a/ui-plugins/attendance-report/ui/kit.css b/ui-plugins/attendance-report/ui/kit.css new file mode 100644 index 00000000..398bc83a --- /dev/null +++ b/ui-plugins/attendance-report/ui/kit.css @@ -0,0 +1,34 @@ +:root { --bg:#fff; --fg:#1d1f23; --muted:#6b7280; --line:#e5e7eb; --panel:#f7f7f8; --accent:#2563eb; --warn:#b45309; --warnbg:#fef3c7; --bad:#b91c1c; --badbg:#fee2e2; --okbg:#dcfce7; --ok:#15803d; } +[data-theme="dark"] { --bg:#18191b; --fg:#e8e8ea; --muted:#9ca3af; --line:#2e3035; --panel:#222327; --accent:#60a5fa; --warn:#fbbf24; --warnbg:#3b2f10; --bad:#f87171; --badbg:#3b1717; --okbg:#12301d; --ok:#4ade80; } +* { box-sizing: border-box; } +html, body { margin:0; background:var(--bg); color:var(--fg); font:13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; } +#root { padding: 12px; } +h1 { font-size: 15px; margin: 0 0 8px; } +h2 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; text-transform: none; } +button { font: inherit; border:1px solid var(--line); background:var(--panel); color:var(--fg); border-radius:6px; padding:5px 10px; cursor:pointer; } +button.primary { background:var(--accent); border-color:var(--accent); color:#fff; } +button:disabled { opacity:.5; cursor:default; } +input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border:1px solid var(--line); border-radius:5px; padding:4px 6px; } +input[type="color"] { padding: 0; width: 32px; height: 26px; } +input[type="range"] { padding: 0; } +label { display:flex; gap:6px; align-items:center; } +.row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin: 6px 0; } +.muted { color: var(--muted); } +.card { border:1px solid var(--line); border-radius:8px; padding:10px; background:var(--panel); margin: 8px 0; } +.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:8px; } +.thumb { border:1px solid var(--line); border-radius:6px; overflow:hidden; background: var(--bg); cursor:pointer; position:relative; } +.thumb img { width:100%; display:block; aspect-ratio:1; object-fit:contain; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 50% / 16px 16px; } +.thumb .cap { padding:4px 6px; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } +.thumb.selected { outline: 2px solid var(--accent); } +.badge { display:inline-block; font-size:11px; padding:1px 6px; border-radius:10px; background:var(--warnbg); color:var(--warn); } +.badge.bad { background: var(--badbg); color: var(--bad); } +.badge.ok { background: var(--okbg); color: var(--ok); } +table.data { border-collapse: collapse; width: 100%; } +table.data td, table.data th { border:1px solid var(--line); padding:3px 6px; text-align:left; vertical-align:top; } +table.data th { background: var(--panel); } +.toast { position: fixed; right: 12px; bottom: 12px; padding: 8px 12px; border-radius: 6px; background: var(--okbg); color: var(--ok); z-index: 10; max-width: 80%; } +.toast.error { background: var(--badbg); color: var(--bad); } +.empty { padding: 24px; text-align:center; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; } +.busy { opacity:.6; pointer-events:none; } +.split { display:grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; } +@media (max-width: 640px) { .split { grid-template-columns: 1fr; } } diff --git a/ui-plugins/attendance-report/ui/kit.ts b/ui-plugins/attendance-report/ui/kit.ts new file mode 100644 index 00000000..b0646f25 --- /dev/null +++ b/ui-plugins/attendance-report/ui/kit.ts @@ -0,0 +1,133 @@ +import { App } from "@modelcontextprotocol/ext-apps"; + +export class ToolError extends Error { + readonly code: string; + constructor(code: string, message: string) { + super(message); + this.code = code; + } +} + +let app: App | undefined; +let connection: Promise | undefined; +let created!: () => void; +const appCreated = new Promise((resolve) => (created = resolve)); +const resultListeners = new Set<(value: Record | undefined, tool?: string) => void>(); +const contextListeners = new Set<() => void>(); + +export function initHost(name: string, version: string) { + app = new App({ name, version }, { availableDisplayModes: ["inline", "fullscreen"] }); + app.ontoolresult = (result) => { + const content = result.structuredContent as Record | undefined; + resultListeners.forEach((listener) => listener(content)); + }; + app.onhostcontextchanged = () => contextListeners.forEach((listener) => listener()); + created(); + return ready(); +} + +export function ready(): Promise { + if (!app) return appCreated.then(() => ready()); + return (connection ??= app.connect().then(() => contextListeners.forEach((listener) => listener()))); +} + +export function onToolResult(listener: (value: Record | undefined) => void) { + resultListeners.add(listener); +} + +export function onHostContext(listener: () => void) { + contextListeners.add(listener); +} + +export function hostContext() { + return app?.getHostContext(); +} + +export function locale(): "zh" | "en" { + const fromHost = (app?.getHostContext()?.locale as string | undefined) ?? navigator.language ?? "en"; + return /^zh/i.test(fromHost) ? "zh" : "en"; +} + +export async function call>(name: string, args: Record = {}, timeout = 300_000): Promise { + await ready(); + let result; + try { + result = await app!.callServerTool({ name, arguments: args }, { timeout }); + } catch (error) { + throw new ToolError("host_error", error instanceof Error ? error.message : String(error)); + } + const content = result.structuredContent as Record | undefined; + const error = content?.error as { code?: string; message?: string } | undefined; + if (result.isError || error) { + const text = (result.content?.[0] as { text?: string } | undefined)?.text; + throw new ToolError(error?.code ?? "tool_error", error?.message ?? text ?? "The tool failed."); + } + return (content ?? {}) as T; +} + +/** 读取插件资源(二进制)。 */ +export async function readBlob(uri: string): Promise { + await ready(); + const result = await app!.readServerResource({ uri }); + const first = result.contents[0] as { blob?: string; text?: string } | undefined; + if (typeof first?.blob !== "string") throw new ToolError("host_error", first?.text?.slice(0, 300) ?? `Empty resource ${uri}`); + return base64ToBytes(first.blob); +} + +export function base64ToBytes(base64: string): Uint8Array { + const binary = atob(base64); + const bytes = new Uint8Array(binary.length); + for (let index = 0; index < binary.length; index++) bytes[index] = binary.charCodeAt(index); + return bytes; +} + +/** 由用户点击触发:把一句话发到对话里交给 Agent。 */ +export async function sendMessage(text: string) { + await ready(); + return app!.sendMessage({ role: "user", content: [{ type: "text", text }] }); +} + +export async function updateContext(text: string) { + await ready(); + return app!.updateModelContext({ content: [{ type: "text", text }] }); +} + +type Child = Node | string | number | null | undefined | false; +/** 极简 DOM 构建器。 */ +export function h( + tag: K, + props: Record = {}, + ...children: (Child | Child[])[] +): HTMLElementTagNameMap[K] { + const element = document.createElement(tag); + for (const [key, value] of Object.entries(props)) { + if (value === undefined || value === null || value === false) continue; + if (key.startsWith("on") && typeof value === "function") element.addEventListener(key.slice(2).toLowerCase(), value as EventListener); + else if (key === "class") element.className = String(value); + else if (key === "style" && typeof value === "object") Object.assign(element.style, value); + else if (key === "value" || (key in element && typeof value !== "string")) (element as any)[key] = value; + else element.setAttribute(key, value === true ? "" : String(value)); + } + for (const child of children.flat()) { + if (child === null || child === undefined || child === false) continue; + element.append(child instanceof Node ? child : String(child)); + } + return element; +} + +export function toast(message: string, kind: "ok" | "error" = "ok") { + const node = h("div", { class: `toast ${kind}`, role: "status" }, message); + document.body.append(node); + setTimeout(() => node.remove(), kind === "error" ? 6000 : 3000); +} + +/** 主题:跟随宿主的浅色 / 深色。 */ +export function applyTheme() { + const theme = (app?.getHostContext()?.theme as string | undefined) ?? "light"; + document.documentElement.dataset.theme = theme === "dark" ? "dark" : "light"; +} + +/** replaceChildren,跳过 null / false。 */ +export function put(element: Element, ...children: (Node | string | null | undefined | false)[]) { + element.replaceChildren(...(children.filter((c) => c !== null && c !== undefined && c !== false) as (Node | string)[])); +} diff --git a/ui-plugins/attendance-report/ui/main.ts b/ui-plugins/attendance-report/ui/main.ts new file mode 100644 index 00000000..5a9b2408 --- /dev/null +++ b/ui-plugins/attendance-report/ui/main.ts @@ -0,0 +1,3 @@ +import { startApp } from "./app.ts"; + +startApp("attendance-report", "0.1.0"); From 7eabfe978d4fc91d5f26ea200f16d89ad047ec8a Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:26:31 -0400 Subject: [PATCH 09/11] feat(ui-plugins): add Attendance Report (attendance-report) --- .../skills/attendance-report/SKILL.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 external_plugins/attendance-report/skills/attendance-report/SKILL.md diff --git a/external_plugins/attendance-report/skills/attendance-report/SKILL.md b/external_plugins/attendance-report/skills/attendance-report/SKILL.md new file mode 100644 index 00000000..9e3d2f70 --- /dev/null +++ b/external_plugins/attendance-report/skills/attendance-report/SKILL.md @@ -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. 不要替用户编造请假记录;只标注用户明确说过的。 From 21043129b05b92df167ab44a0b49126076d1e139 Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:27:12 -0400 Subject: [PATCH 10/11] feat(ui-plugins): add Attendance Report (attendance-report) --- ui-plugins/attendance-report/src/kit/app.ts | 422 ++++++++++++++++++ .../attendance-report/src/kit/columns.ts | 53 +++ .../attendance-report/src/kit/console.ts | 5 + .../attendance-report/src/kit/server-kit.ts | 84 ++++ ui-plugins/attendance-report/src/kit/sheet.ts | 35 ++ ui-plugins/attendance-report/src/kit/table.ts | 127 ++++++ .../attendance-report/src/kit/testing.ts | 16 + .../attendance-report/src/kit/workspace.ts | 170 +++++++ 8 files changed, 912 insertions(+) create mode 100644 ui-plugins/attendance-report/src/kit/app.ts create mode 100644 ui-plugins/attendance-report/src/kit/columns.ts create mode 100644 ui-plugins/attendance-report/src/kit/console.ts create mode 100644 ui-plugins/attendance-report/src/kit/server-kit.ts create mode 100644 ui-plugins/attendance-report/src/kit/sheet.ts create mode 100644 ui-plugins/attendance-report/src/kit/table.ts create mode 100644 ui-plugins/attendance-report/src/kit/testing.ts create mode 100644 ui-plugins/attendance-report/src/kit/workspace.ts diff --git a/ui-plugins/attendance-report/src/kit/app.ts b/ui-plugins/attendance-report/src/kit/app.ts new file mode 100644 index 00000000..b3c0fc21 --- /dev/null +++ b/ui-plugins/attendance-report/src/kit/app.ts @@ -0,0 +1,422 @@ +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import { z } from "zod"; +import { createKitServer } from "./server-kit.ts"; +import { KitError, safeFileName, Workspace } from "./workspace.ts"; + +/** 双语文案:[中文, English]。 */ +export type L = [string, string]; +export type Row = Record; + +export interface Field { + key: string; + label: L; + type: "text" | "number" | "bool" | "select" | "color" | "textarea" | "date"; + options?: { value: string; label: L }[]; + default?: unknown; + help?: L; + min?: number; + max?: number; + /** 改了需要重新读取输入文件。 */ + reload?: boolean; +} + +export interface Column { + key: string; + label: L; + type?: "text" | "number" | "bool" | "select" | "date"; + options?: string[]; + readOnly?: boolean; + wide?: boolean; +} + +export interface Issue { + level: "error" | "warn" | "info"; + message: string; + row?: number; + key?: string; +} + +export interface Project { + name: string; + inputs: string[]; + settings: Record; + rows: Row[]; + meta: Record; + exported?: string[]; + created: string; + updated: string; +} + +export interface Computed { + /** 与 project.rows 一一对应(同顺序),可附加只读的计算列。 */ + rows?: Row[]; + issues?: Issue[]; + summary: string; + /** 面板预览:由插件生成、已转义的 HTML(可含 data: 图片)。 */ + preview?: string; + stats?: Record; +} + +export interface AppCtx { + ws: Workspace; + assetRoot: string; + log: (line: string) => void; +} + +export interface ExportCtx extends AppCtx { + project: Project; + computed: Computed; + outDir: string; + /** 写入导出目录下的文件,返回工作区相对路径。 */ + write: (name: string, data: Uint8Array | string) => Promise; +} + +export interface ExportDef { + id: string; + label: L; + description: string; + run: (ctx: ExportCtx) => Promise; + /** 不包含在“全部导出”里,只有点名时才运行(例如撤销)。 */ + manual?: boolean; +} + +export interface AppDef { + name: string; + version: string; + /** 工具名前缀,例如 "invoice" → invoice_open。 */ + prefix: string; + title: L; + /** invoice_open 的说明(给 Agent 看)。 */ + openDescription: string; + inputs: { exts: string[]; min: number; max: number; label: L; folders?: boolean }; + settings: Field[]; + columns: (project: Project) => Column[]; + load: (ctx: AppCtx & { files: string[]; settings: Record; previous?: Row[] }) => Promise<{ rows: Row[]; meta?: Record }>; + compute: (project: Project, ctx: AppCtx) => Promise | Computed; + exports: ExportDef[]; + /** 允许在面板 / 工具里新增行时的空白行。 */ + newRow?: (project: Project) => Row; + /** 行描述(给 Agent 的文字列表),默认取前几列。 */ + describeRow?: (row: Row, index: number) => string; + /** 单元格被用户/助手改过之后调用(例如把来源标成“手动”)。 */ + onCellEdit?: (row: Row, key: string) => void; +} + +const MAX_ROWS_PANEL = 3000; + +export function coerceSettings(fields: Field[], input: Record | undefined, base: Record = {}) { + const out: Record = {}; + for (const field of fields) { + let value = input && field.key in input ? input[field.key] : field.key in base ? base[field.key] : field.default; + if (value === undefined || value === null) { + if (field.default !== undefined) out[field.key] = field.default; + continue; + } + if (field.type === "number") { + const n = typeof value === "number" ? value : Number(String(value).trim()); + if (!Number.isFinite(n)) throw new KitError("bad_setting", `${field.key} must be a number (got ${JSON.stringify(value)}).`); + value = Math.min(field.max ?? Infinity, Math.max(field.min ?? -Infinity, n)); + } else if (field.type === "bool") value = value === true || value === "true" || value === 1 || value === "1" || value === "yes"; + else if (field.type === "select") { + value = String(value); + if (field.options && !field.options.some((o) => o.value === value)) throw new KitError("bad_setting", `${field.key} must be one of ${field.options.map((o) => o.value).join(", ")} (got ${value}).`); + } else value = String(value); + out[field.key] = value; + } + return out; +} + +/** + * 把 _edit 里的列名解析成列 key:先精确匹配 key,再精确匹配中/英文标题, + * 最后忽略大小写和空白再比一次;行里已有的字段名也算。找不到返回 undefined。 + */ +export function resolveColumnKey(cols: Column[], name: string, row?: Row): string | undefined { + if (cols.some((c) => c.key === name)) return name; + const exact = cols.find((c) => c.label[0] === name || c.label[1] === name); + if (exact) return exact.key; + const norm = (x: string) => x.normalize("NFKC").replace(/\s+/g, "").toLowerCase(); + const n = norm(name); + const loose = cols.find((c) => norm(c.key) === n || norm(c.label[0]) === n || norm(c.label[1]) === n); + if (loose) return loose.key; + if (row && Object.prototype.hasOwnProperty.call(row, name)) return name; + return undefined; +} + +export function coerceCell(column: Column | undefined, value: unknown): unknown { + if (!column) return value; + if (column.type === "number") { + if (value === "" || value === null || value === undefined) return ""; + const n = typeof value === "number" ? value : Number(String(value).replace(/[,,\s]/g, "")); + return Number.isFinite(n) ? n : String(value); + } + if (column.type === "bool") return value === true || value === "true" || value === 1 || value === "1" || value === "yes"; + return value === null || value === undefined ? "" : String(value); +} + +const stem = (path: string) => (path.split("/").pop() ?? path).replace(/\.[^.]+$/, ""); + +export function createApp(def: AppDef, options: { workspaceRoot: string; assetRoot: string; log?: (line: string) => void }) { + const ws = new Workspace(options.workspaceRoot); + const log = options.log ?? (() => undefined); + const ctx: AppCtx = { ws, assetRoot: options.assetRoot, log }; + const PANEL_URI = `ui://${def.name}/panel.html`; + const { server, tool } = createKitServer({ + name: def.name, + version: def.version, + panelUri: PANEL_URI, + surface: "editor", + panelHtml: () => readFile(join(options.assetRoot, "ui/panel.html"), "utf8"), + log, + }); + const P = def.prefix; + const projectPath = (name: string) => `${def.name}/${safeFileName(name, "project")}.project.json`; + let queue: Promise = Promise.resolve(); + const serial = (work: () => Promise): Promise => { + const job = queue.catch(() => undefined).then(work); + queue = job; + return job; + }; + + async function loadProject(name: string): Promise { + if (!name) throw new KitError("missing_project", "Pass `project` (from the open result)."); + const path = projectPath(name); + if (!(await ws.exists(path))) throw new KitError("no_project", `No project named "${name}". Open input files first with ${P}_open.`); + return JSON.parse(await ws.readText(path)) as Project; + } + async function saveProject(project: Project) { + project.updated = new Date().toISOString(); + await ws.write(projectPath(project.name), JSON.stringify(project, null, 1) + "\n"); + } + async function listProjects() { + const files = await ws.list({ dir: def.name, exts: [".json"], recursive: false, limit: 500 }).catch(() => []); + return files.map((f) => f.path).filter((p) => p.endsWith(".project.json")).map((p) => p.split("/").pop()!.replace(/\.project\.json$/, "")); + } + + async function view(project: Project, extra: Record = {}) { + const computed = await def.compute(project, ctx); + const columns = def.columns(project); + const rows = computed.rows ?? project.rows; + return { + computed, + structured: { + kind: "project", + app: def.name, + project: project.name, + inputs: project.inputs, + settings: project.settings, + columns, + rows: rows.slice(0, MAX_ROWS_PANEL), + totalRows: rows.length, + canAdd: !!def.newRow, + issues: (computed.issues ?? []).slice(0, 500), + summary: computed.summary, + stats: computed.stats ?? {}, + preview: computed.preview ?? "", + exported: project.exported ?? [], + ...extra, + }, + }; + } + function describe(project: Project, computed: Computed, limit = 25) { + const rows = computed.rows ?? project.rows; + const cols = def.columns(project); + const line = def.describeRow ?? ((row: Row, i: number) => `#${i} ` + cols.slice(0, 5).map((c) => `${c.key}=${String(row[c.key] ?? "").slice(0, 40)}`).join(" · ")); + const issues = computed.issues ?? []; + return [ + `Project "${project.name}" (${project.inputs.join(", ") || "no input files"}): ${computed.summary}`, + issues.length ? `Issues (${issues.length}):\n` + issues.slice(0, 30).map((x) => `- [${x.level}]${x.row !== undefined ? ` row #${x.row}` : ""}${x.key ? ` ${x.key}` : ""}: ${x.message}`).join("\n") + (issues.length > 30 ? `\n… ${issues.length - 30} more in the panel.` : "") : "No issues found.", + rows.length ? `Rows (${rows.length}):\n` + rows.slice(0, limit).map((r, i) => line(r, i)).join("\n") + (rows.length > limit ? `\n… ${rows.length - limit} more rows in the panel.` : "") : "", + `Exports: ${def.exports.map((e) => `${e.id} (${e.description})`).join("; ")}. Edit with ${P}_edit, export with ${P}_export.`, + ].filter(Boolean).join("\n\n"); + } + + const settingsDoc = def.settings.map((f) => `${f.key} (${f.type}${f.options ? `: ${f.options.map((o) => o.value).join("|")}` : ""}${f.default !== undefined ? `, default ${JSON.stringify(f.default)}` : ""})${f.help ? ` — ${f.help[1]}` : ""}`).join("; "); + + tool( + `${P}_open`, + { + description: `${def.openDescription} Opens the editing panel. Settings: ${settingsDoc || "none"}. Re-opening the same project name replaces its rows with a fresh read of the inputs.`, + input: { + inputs: z.array(z.string()).describe(`Workspace-relative input paths (${def.inputs.exts.join(", ")}${def.inputs.folders ? " or folders" : ""}); ${def.inputs.min}–${def.inputs.max} item(s).`), + settings: z.record(z.string(), z.unknown()).optional(), + project: z.string().optional().describe("Project name (default: first input's file name)."), + }, + openPanel: true, + timeoutMs: 600_000, + }, + (args) => + serial(async () => { + const inputs: string[] = args.inputs ?? []; + if (inputs.length < def.inputs.min) throw new KitError("missing_input", `Pass at least ${def.inputs.min} input file(s) (${def.inputs.exts.join(", ")}).`); + if (inputs.length > def.inputs.max) throw new KitError("too_many_inputs", `At most ${def.inputs.max} input(s).`); + for (const i of inputs) ws.resolve(i); + const name = safeFileName(args.project || (inputs[0] ? stem(inputs[0]) : def.name), "project"); + const settings = coerceSettings(def.settings, args.settings); + const loaded = await def.load({ ...ctx, files: inputs, settings }); + const now = new Date().toISOString(); + const project: Project = { name, inputs, settings, rows: loaded.rows, meta: loaded.meta ?? {}, created: now, updated: now }; + await saveProject(project); + const v = await view(project); + return { text: describe(project, v.computed), structured: v.structured }; + }), + ); + + tool( + `${P}_edit`, + { + description: `Change a ${def.name} project: update settings, set cell values by row index (from ${P}_open / ${P}_status), add rows${def.newRow ? "" : " (not supported here)"} or remove rows. Changes are saved; returns the updated summary and issues.`, + input: { + project: z.string(), + settings: z.record(z.string(), z.unknown()).optional(), + set: z.array(z.object({ row: z.number().int().min(0), values: z.record(z.string(), z.unknown()) })).optional(), + add: z.array(z.record(z.string(), z.unknown())).optional(), + remove: z.array(z.number().int().min(0)).optional(), + }, + timeoutMs: 600_000, + }, + (args) => + serial(async () => { + const project = await loadProject(args.project); + const notes: string[] = []; + if (args.settings) { + const next = coerceSettings(def.settings, args.settings, project.settings); + const reload = def.settings.some((f) => f.reload && JSON.stringify(next[f.key]) !== JSON.stringify(project.settings[f.key])); + project.settings = next; + if (reload) { + const loaded = await def.load({ ...ctx, files: project.inputs, settings: next, previous: project.rows }); + project.rows = loaded.rows; + project.meta = loaded.meta ?? project.meta; + notes.push("Inputs re-read with the new settings (row edits were reset)."); + } + } + const cols = def.columns(project); + const byKey = new Map(cols.map((c) => [c.key, c])); + const unknown = new Set(); + for (const s of args.set ?? []) { + const row = project.rows[s.row]; + if (!row) { notes.push(`Row #${s.row} does not exist.`); continue; } + for (const [name, v] of Object.entries(s.values)) { + const k = resolveColumnKey(cols, name, row); + if (k === undefined) { unknown.add(name); continue; } + const c = byKey.get(k); + if (c?.readOnly) { notes.push(`${k} is calculated and cannot be edited.`); continue; } + row[k] = coerceCell(c, v); + def.onCellEdit?.(row, k); + } + } + if (args.add?.length) { + if (!def.newRow) throw new KitError("no_add", "This tool does not support adding rows."); + for (const a of args.add) { + const row = def.newRow(project); + for (const [name, v] of Object.entries(a)) { + const k = resolveColumnKey(cols, name, row); + if (k === undefined) { unknown.add(name); continue; } + row[k] = coerceCell(byKey.get(k), v); + } + project.rows.push(row); + } + } + if (unknown.size) notes.push(`Warning: ignored unknown column(s) ${[...unknown].map((u) => `“${u}”`).join(", ")}. Use a column key or its label: ${cols.map((c) => `${c.key} (${c.label[0]} / ${c.label[1]})`).join(", ")}.`); + if (args.remove?.length) { + const drop = new Set(args.remove); + project.rows = project.rows.filter((_, i) => !drop.has(i)); + } + await saveProject(project); + const v = await view(project); + return { text: [notes.join(" "), describe(project, v.computed, 10)].filter(Boolean).join("\n\n"), structured: v.structured }; + }), + ); + + tool( + `${P}_status`, + { description: `Show a ${def.name} project's rows, issues and summary (no changes).`, input: { project: z.string(), limit: z.number().int().min(1).max(500).optional() }, readOnly: true }, + async (args) => { + const project = await loadProject(args.project); + const v = await view(project); + return { text: describe(project, v.computed, args.limit ?? 50), structured: v.structured }; + }, + ); + + tool( + `${P}_export`, + { + description: `Write the finished files for a ${def.name} project into ${def.name}// in the workspace. Formats: ${def.exports.map((e) => `"${e.id}" — ${e.description}`).join("; ")}.`, + input: { project: z.string(), formats: z.array(z.enum(def.exports.map((e) => e.id) as [string, ...string[]])).optional().describe("Default: all formats except manual ones (e.g. undo).") }, + timeoutMs: 900_000, + }, + (args) => + serial(async () => { + const project = await loadProject(args.project); + const computed = await def.compute(project, ctx); + if ((computed.issues ?? []).some((i) => i.level === "error") && !def.exports.length) throw new KitError("has_errors", "Fix the errors first."); + const outDir = `${def.name}/${safeFileName(project.name, "project")}`; + const ids = args.formats?.length ? args.formats : def.exports.filter((e) => !e.manual).map((e) => e.id); + const files: string[] = []; + const notes: string[] = []; + for (const id of ids) { + const ex = def.exports.find((e) => e.id === id)!; + const result = await ex.run({ ...ctx, project, computed, outDir, write: (n, d) => ws.write(`${outDir}/${n}`, d) }); + if (Array.isArray(result)) files.push(...result); + else { files.push(...result.files); if (result.note) notes.push(result.note); } + } + project.exported = files; + await saveProject(project); + const v = await view(project, { justExported: files }); + const errors = (computed.issues ?? []).filter((i) => i.level === "error").length; + return { + text: `Exported ${files.length} file(s):\n${files.map((f) => `- ${f}`).join("\n")}${notes.length ? `\n${notes.join("\n")}` : ""}${errors ? `\nNote: ${errors} error(s) are still open in the project.` : ""}`, + structured: v.structured, + }; + }), + ); + + tool( + "app_info", + { description: "Panel bootstrap: tool definition, workspace files and saved projects.", input: {}, visibility: ["app"], readOnly: true }, + async () => { + const files = (await ws.list({ exts: def.inputs.exts, limit: 3000 })).map((f) => f.path).filter((p) => !p.startsWith(`${def.name}/`)); + const folders = def.inputs.folders ? [...new Set(files.map((f) => f.split("/").slice(0, -1).join("/") || "."))].sort() : []; + return { + text: "", + structured: { + kind: "info", + app: def.name, + prefix: P, + title: def.title, + inputs: def.inputs, + settings: def.settings, + exports: def.exports.map((e) => ({ id: e.id, label: e.label, description: e.description })), + files, + folders, + projects: await listProjects(), + }, + }; + }, + ); + + return { server, ws, PANEL_URI }; +} + +/** HTML 转义。 */ +export const esc = (value: unknown) => + String(value ?? "").replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]!); + +/** 简单 HTML 表格(用于预览与报告)。 */ +export function htmlTable(headers: string[], rows: unknown[][], cls = "data") { + return `${headers.map((h) => ``).join("")}${rows.map((r) => `${r.map((c) => ``).join("")}`).join("")}
${esc(h)}
${esc(c)}
`; +} + +/** 独立 HTML 报告页。 */ +export function htmlPage(title: string, body: string, extraCss = "") { + return `${esc(title)}${body}`; +} + +/** CSV(带 BOM,Excel 打开中文不乱码)。 */ +export function toCsv(headers: string[], rows: unknown[][]) { + const cell = (v: unknown) => { + const s = String(v ?? ""); + return /[",\n\r]/.test(s) ? `"${s.replace(/"/g, '""')}"` : s; + }; + return "\uFEFF" + [headers, ...rows].map((r) => r.map(cell).join(",")).join("\r\n") + "\r\n"; +} diff --git a/ui-plugins/attendance-report/src/kit/columns.ts b/ui-plugins/attendance-report/src/kit/columns.ts new file mode 100644 index 00000000..4cb79023 --- /dev/null +++ b/ui-plugins/attendance-report/src/kit/columns.ts @@ -0,0 +1,53 @@ +/** 表头别名匹配:把用户表格里的中英文列名对应到插件字段。 */ +const norm = (s: string) => s.toLowerCase().replace(/[\s_\-::()().#]/g, ""); + +export function mapHeaders(headers: string[], aliases: Record): Record { + const out: Record = {}; + const used = new Set(); + const nh = headers.map((h) => [h, norm(h)] as const); + for (const [key, names] of Object.entries(aliases)) { + const wanted = [key, ...names].map(norm); + let hit = nh.find(([h, n]) => !used.has(h) && wanted.includes(n)); + hit ??= nh.find(([h, n]) => !used.has(h) && wanted.some((w) => w.length >= 2 && n.includes(w))); + if (hit) { out[key] = hit[0]; used.add(hit[0]); } + } + return out; +} + +/** 解析金额 / 数字:"¥1,234.50"、"12%"、"(3)"、全角数字。失败返回 NaN。 */ +export function num(value: unknown): number { + if (typeof value === "number") return value; + let s = String(value ?? "").trim().replace(/[0-9.-]/g, (c) => String.fromCharCode(c.charCodeAt(0) - 0xfee0)); + if (!s) return NaN; + let neg = false; + if (/^\(.*\)$|^(.*)$/.test(s)) { neg = true; s = s.slice(1, -1); } + s = s.replace(/[¥¥$€£,,\s元]|RMB|CNY|USD|EUR/gi, ""); + if (s.endsWith("%")) s = s.slice(0, -1); + const n = Number(s); + return neg ? -n : n; +} + +export const round2 = (n: number) => Math.round((n + Number.EPSILON) * 100) / 100; + +/** 解析日期:2026-11-25、2026/11/25、2026年11月25日、11/25/2026、Excel 序号。返回 YYYY-MM-DD 或 ""。 */ +export function parseDate(value: unknown): string { + if (value instanceof Date && !isNaN(+value)) return value.toISOString().slice(0, 10); + const s = String(value ?? "").trim(); + if (!s) return ""; + let m = /^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?/.exec(s); + if (m) return `${m[1]}-${m[2].padStart(2, "0")}-${m[3].padStart(2, "0")}`; + m = /^(\d{1,2})\/(\d{1,2})\/(\d{4})/.exec(s); + if (m) return `${m[3]}-${m[1].padStart(2, "0")}-${m[2].padStart(2, "0")}`; + if (/^\d{5}(\.\d+)?$/.test(s)) { + const d = new Date(Date.UTC(1899, 11, 30) + Number(s) * 86400000); + return d.toISOString().slice(0, 10); + } + const d = new Date(s); + return isNaN(+d) ? "" : d.toISOString().slice(0, 10); +} + +export function addDays(date: string, days: number) { + const d = new Date(`${date}T00:00:00Z`); + d.setUTCDate(d.getUTCDate() + days); + return d.toISOString().slice(0, 10); +} diff --git a/ui-plugins/attendance-report/src/kit/console.ts b/ui-plugins/attendance-report/src/kit/console.ts new file mode 100644 index 00000000..f6817656 --- /dev/null +++ b/ui-plugins/attendance-report/src/kit/console.ts @@ -0,0 +1,5 @@ +// stdout 只留给 MCP 协议;依赖库的日志改写到 stderr。 +console.log = (...args: unknown[]) => process.stderr.write(`${args.map(String).join(" ")}\n`); +console.info = console.log; +console.warn = console.log; +console.debug = console.log; diff --git a/ui-plugins/attendance-report/src/kit/server-kit.ts b/ui-plugins/attendance-report/src/kit/server-kit.ts new file mode 100644 index 00000000..6bc31594 --- /dev/null +++ b/ui-plugins/attendance-report/src/kit/server-kit.ts @@ -0,0 +1,84 @@ +import { readFile } from "node:fs/promises"; +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import type { z } from "zod"; +import { KitError } from "./workspace.ts"; + +export const HTML_MIME = "text/html;profile=mcp-app"; +type Visibility = ("model" | "app")[]; +type Content = { type: "text"; text: string } | { type: "image"; data: string; mimeType: string }; + +export interface ToolOutput { + text: string; + structured?: Record; + images?: { data: string; mimeType: string }[]; +} + +export interface KitServerOptions { + name: string; + version: string; + panelUri: string; + surface: string; + panelHtml: () => Promise; + log?: (line: string) => void; + /** 页面资源的额外 _meta,例如 { "zcode/csp": { wasmUnsafeEval: true } }。 */ + panelMeta?: Record; +} + +/** 统一的工具注册:所有工具都关联同一个侧栏面板,错误带 code 返回给 Agent 与页面。 */ +export function createKitServer(options: KitServerOptions) { + const log = options.log ?? (() => undefined); + const server = new McpServer({ name: options.name, version: options.version }, { capabilities: { logging: {} } }); + const panelMeta = { ui: { prefersBorder: false }, ...options.panelMeta }; + server.registerResource("panel", options.panelUri, { mimeType: HTML_MIME, _meta: panelMeta }, async () => ({ + contents: [{ uri: options.panelUri, mimeType: HTML_MIME, _meta: panelMeta, text: await options.panelHtml() }], + })); + + const tool = ( + name: string, + config: { + description: string; + input: Record; + visibility?: Visibility; + openPanel?: boolean; + readOnly?: boolean; + timeoutMs?: number; + }, + run: (input: any) => Promise, + ) => { + server.registerTool( + name, + { + description: config.description, + inputSchema: config.input, + annotations: { readOnlyHint: !!config.readOnly, ...(config.readOnly ? {} : { destructiveHint: false }), openWorldHint: false }, + _meta: { + ui: { resourceUri: options.panelUri, surface: options.surface, visibility: config.visibility ?? ["model", "app"] }, + ...(config.timeoutMs ? { timeoutMs: config.timeoutMs } : {}), + ...(config.openPanel ? { "openai/ui": { preferredModelDisplayMode: "fullscreen" } } : {}), + }, + }, + async (input: unknown) => { + try { + const output = await run(input); + const content: Content[] = [{ type: "text", text: output.text }]; + for (const image of output.images ?? []) content.push({ type: "image", ...image }); + return { content, ...(output.structured ? { structuredContent: output.structured } : {}) }; + } catch (error) { + const code = error instanceof KitError ? error.code : "internal_error"; + const message = error instanceof Error ? error.message : String(error); + if (!(error instanceof KitError)) log(`${name} failed: ${error instanceof Error ? error.stack : message}`); + return { + isError: true, + content: [{ type: "text" as const, text: `[${code}] ${message}` }], + structuredContent: { error: { code, message } }, + }; + } + }, + ); + }; + return { server, tool }; +} + +export async function readPanel(path: string) { + return readFile(path, "utf8"); +} diff --git a/ui-plugins/attendance-report/src/kit/sheet.ts b/ui-plugins/attendance-report/src/kit/sheet.ts new file mode 100644 index 00000000..5956d9a6 --- /dev/null +++ b/ui-plugins/attendance-report/src/kit/sheet.ts @@ -0,0 +1,35 @@ +import ExcelJS from "exceljs"; + +export interface SheetSpec { + name: string; + headers: string[]; + rows: unknown[][]; + /** 需要标色的单元格:row/col 从 0 开始(不含表头)。 */ + marks?: { row: number; col: number; color?: string; note?: string }[]; + widths?: number[]; + numberFormat?: Record; +} + +/** 写出 .xlsx:表头加粗冻结、数字保持数字、可选标色与批注。 */ +export async function writeXlsx(sheets: SheetSpec[]): Promise { + const book = new ExcelJS.Workbook(); + book.creator = "Penova"; + for (const spec of sheets) { + const sheet = book.addWorksheet(spec.name.replace(/[\\/?*[\]:]/g, "_").slice(0, 31) || "Sheet1"); + sheet.addRow(spec.headers); + sheet.getRow(1).font = { bold: true }; + sheet.views = [{ state: "frozen", ySplit: 1 }]; + for (const row of spec.rows) sheet.addRow(row.map((v) => (v === undefined || v === null ? "" : v instanceof Date ? v : typeof v === "number" || typeof v === "boolean" ? v : String(v)))); + spec.headers.forEach((h, i) => { + const width = spec.widths?.[i] ?? Math.min(50, Math.max(8, String(h).length * 2, ...spec.rows.slice(0, 200).map((r) => String(r[i] ?? "").length * 1.2))); + sheet.getColumn(i + 1).width = width; + if (spec.numberFormat?.[i]) sheet.getColumn(i + 1).numFmt = spec.numberFormat[i]; + }); + for (const m of spec.marks ?? []) { + const cell = sheet.getCell(m.row + 2, m.col + 1); + cell.fill = { type: "pattern", pattern: "solid", fgColor: { argb: (m.color ?? "FFFDE68A").replace("#", "FF") } }; + if (m.note) cell.note = m.note; + } + } + return Buffer.from(await book.xlsx.writeBuffer()); +} diff --git a/ui-plugins/attendance-report/src/kit/table.ts b/ui-plugins/attendance-report/src/kit/table.ts new file mode 100644 index 00000000..c047813a --- /dev/null +++ b/ui-plugins/attendance-report/src/kit/table.ts @@ -0,0 +1,127 @@ +import { extname } from "node:path"; +import ExcelJS from "exceljs"; +import { KitError, type Workspace } from "./workspace.ts"; + +export interface TableData { + columns: string[]; + rows: Record[]; + sheets: string[]; + sheet?: string; +} + +/** UTF-8 解码失败(出现替换字符)时按 GB18030 解码:中文版 Excel 导出的 CSV 常是 GBK。 */ +export function decodeText(bytes: Uint8Array): string { + const utf8 = new TextDecoder("utf-8").decode(bytes); + if (!utf8.includes("\uFFFD")) return utf8.replace(/^\uFEFF/, ""); + try { + return new TextDecoder("gb18030").decode(bytes); + } catch { + return utf8; + } +} + +export function parseCsv(text: string): string[][] { + const first = text.split(/\r?\n/, 1)[0] ?? ""; + const delimiter = [",", "\t", ";"].map((d) => [d, first.split(d).length] as const).sort((a, b) => b[1] - a[1])[0][0]; + const rows: string[][] = []; + let row: string[] = []; + let cell = ""; + let quoted = false; + for (let i = 0; i < text.length; i++) { + const ch = text[i]; + if (quoted) { + if (ch === '"') { + if (text[i + 1] === '"') { + cell += '"'; + i++; + } else quoted = false; + } else cell += ch; + } else if (ch === '"' && cell === "") quoted = true; + else if (ch === delimiter) { + row.push(cell); + cell = ""; + } else if (ch === "\n" || ch === "\r") { + if (ch === "\r" && text[i + 1] === "\n") i++; + row.push(cell); + rows.push(row); + row = []; + cell = ""; + } else cell += ch; + } + if (cell !== "" || row.length) { + row.push(cell); + rows.push(row); + } + return rows.filter((r) => r.some((c) => c.trim() !== "")); +} + +function cellText(value: ExcelJS.CellValue): string { + if (value === null || value === undefined) return ""; + if (value instanceof Date) { + const pad = (n: number) => String(n).padStart(2, "0"); + return `${value.getUTCFullYear()}-${pad(value.getUTCMonth() + 1)}-${pad(value.getUTCDate())}`; + } + if (typeof value === "object") { + if ("richText" in value) return value.richText.map((part) => part.text).join(""); + if ("text" in value) return String(value.text); + if ("result" in value) return cellText(value.result as ExcelJS.CellValue); + if ("error" in value) return ""; + } + return String(value); +} + +function toTable(matrix: string[][], sheets: string[], sheet?: string): TableData { + if (!matrix.length) throw new KitError("empty_table", "The table has no rows."); + const seen = new Map(); + const columns = matrix[0].map((raw, index) => { + let name = raw.trim() || `列${index + 1}`; + const count = seen.get(name) ?? 0; + seen.set(name, count + 1); + if (count) name = `${name}_${count + 1}`; + return name; + }); + const rows = matrix.slice(1).map((cells) => Object.fromEntries(columns.map((column, index) => [column, (cells[index] ?? "").trim()]))); + return { columns, rows, sheets, sheet }; +} + +/** 读取 CSV / TSV / XLSX:第一行是表头。 */ +export interface ReadOptions { + /** 表头不在第一行时(例如银行导出前面有说明文字),用它在前 40 行里找表头行。 */ + findHeader?: (cells: string[]) => boolean; +} + +function headerFirst(matrix: string[][], options?: ReadOptions) { + if (!options?.findHeader) return matrix; + const index = matrix.slice(0, 40).findIndex((cells) => options.findHeader!(cells.map((c) => c.trim()))); + return index > 0 ? matrix.slice(index) : matrix; +} + +export async function readTable(ws: Workspace, path: string, sheet?: string, options?: ReadOptions): Promise { + const ext = extname(path).toLowerCase(); + const bytes = await ws.read(path, 50 * 1024 * 1024); + if (ext === ".csv" || ext === ".tsv" || ext === ".txt") return toTable(headerFirst(parseCsv(decodeText(bytes)), options), []); + if (ext === ".xlsx") { + const book = new ExcelJS.Workbook(); + await book.xlsx.load(bytes as unknown as ArrayBuffer); + const sheets = book.worksheets.map((item) => item.name); + const target = sheet ? book.getWorksheet(sheet) : book.worksheets.find((item) => item.actualRowCount > 0) ?? book.worksheets[0]; + if (!target) throw new KitError("sheet_not_found", `Sheet not found: ${sheet}. Sheets: ${sheets.join(", ")}`); + const matrix: string[][] = []; + target.eachRow({ includeEmpty: false }, (row) => { + const cells: string[] = []; + for (let col = 1; col <= target.columnCount; col++) cells.push(cellText(row.getCell(col).value).trim()); + if (cells.some((cell) => cell)) matrix.push(cells); + }); + return toTable(headerFirst(matrix, options), sheets, target.name); + } + throw new KitError("unsupported_table", `Use a .csv, .tsv or .xlsx file (got ${ext || "no extension"}). Save .xls files as .xlsx first.`); +} + +/** 把 "{列名}" 占位符替换成该行的值。 */ +export function renderPattern(pattern: string, row: Record): string { + return pattern.replace(/\{([^{}]+)\}/g, (_, key: string) => row[key.trim()] ?? ""); +} + +export function patternColumns(pattern: string): string[] { + return [...pattern.matchAll(/\{([^{}=]+)\}/g)].map((match) => match[1].trim()); +} diff --git a/ui-plugins/attendance-report/src/kit/testing.ts b/ui-plugins/attendance-report/src/kit/testing.ts new file mode 100644 index 00000000..0d8dc72e --- /dev/null +++ b/ui-plugins/attendance-report/src/kit/testing.ts @@ -0,0 +1,16 @@ +// 仅测试使用:通过内存传输连接 server,像 Agent 一样调用工具。 +import { Client } from "@modelcontextprotocol/sdk/client/index.js"; +import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; + +export async function connect(server: McpServer) { + const [a, b] = InMemoryTransport.createLinkedPair(); + const client = new Client({ name: "test", version: "1" }); + await Promise.all([server.connect(a), client.connect(b)]); + const call = async (name: string, args: Record = {}) => { + const r = (await client.callTool({ name, arguments: args }, undefined, { timeout: 300_000 })) as any; + if (r.isError) throw Object.assign(new Error(r.content?.[0]?.text ?? "tool error"), { code: r.structuredContent?.error?.code }); + return { text: r.content?.[0]?.text as string, data: r.structuredContent as any }; + }; + return { client, call }; +} diff --git a/ui-plugins/attendance-report/src/kit/workspace.ts b/ui-plugins/attendance-report/src/kit/workspace.ts new file mode 100644 index 00000000..7326158b --- /dev/null +++ b/ui-plugins/attendance-report/src/kit/workspace.ts @@ -0,0 +1,170 @@ +import { lstatSync, readlinkSync, realpathSync } from "node:fs"; +import { mkdir, readFile, readdir, rename, stat, writeFile } from "node:fs/promises"; +import { dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path"; + +export class KitError extends Error { + readonly code: string; + constructor(code: string, message: string) { + super(message); + this.code = code; + this.name = "KitError"; + } +} + +const SKIP = new Set(["node_modules", ".git", "dist", "build", ".next", ".cache", "__pycache__"]); + +/** 只允许读写当前工作区内的文件;所有路径都相对工作区根目录。 */ +export class Workspace { + readonly root: string; + constructor(root: string) { + this.root = resolve(root); + } + + resolve(path: string): string { + if (typeof path !== "string" || !path.trim()) throw new KitError("bad_path", "Path is empty."); + const absolute = resolve(this.root, path); + const rel = relative(this.root, absolute); + if (rel === ".." || rel.startsWith(`..${sep}`) || isAbsolute(rel)) + throw new KitError("outside_workspace", `Path is outside the workspace: ${path}`); + this.assertRealInside(absolute, path); + return absolute; + } + + private realRoot?: string; + + /** + * 符号链接不能把读写带出工作区:从目标往上找到第一个已存在的路径,取它的真实路径, + * 必须仍在工作区根目录的真实路径之下。还不存在的写入目标按其已存在的上级目录判断; + * 指向不存在位置的悬空链接一律拒绝(否则 writeFile 会顺着它在外部建文件)。 + */ + private assertRealInside(absolute: string, path: string) { + let realRoot: string; + try { + realRoot = this.realRoot ??= realpathSync(this.root); + } catch { + return; // 根目录本身不存在时,没有可逃出的链接 + } + const outside = (real: string) => { + const rel = relative(realRoot, real); + return rel === ".." || rel.startsWith(`..${sep}`) || isAbsolute(rel); + }; + let probe = absolute; + for (;;) { + let real: string | undefined; + try { + real = realpathSync(probe); + } catch { + let link = false; + try { + link = lstatSync(probe).isSymbolicLink(); + } catch {} + if (link) { + const target = resolve(dirname(probe), readlinkSync(probe)); + throw new KitError("outside_workspace", outside(target) ? `Path leaves the workspace through a link: ${path}` : `Path goes through a broken link: ${path}`); + } + } + if (real !== undefined) { + if (outside(real)) throw new KitError("outside_workspace", `Path leaves the workspace through a link: ${path}`); + return; + } + const parent = dirname(probe); + if (parent === probe) return; + probe = parent; + } + } + + rel(absolute: string): string { + return relative(this.root, absolute).split(sep).join("/") || "."; + } + + async exists(path: string): Promise { + try { + await stat(this.resolve(path)); + return true; + } catch { + return false; + } + } + + async read(path: string, maxBytes = 200 * 1024 * 1024): Promise { + const absolute = this.resolve(path); + let info; + try { + info = await stat(absolute); + } catch { + throw new KitError("not_found", `File not found: ${path}`); + } + if (!info.isFile()) throw new KitError("not_a_file", `Not a file: ${path}`); + if (info.size > maxBytes) throw new KitError("too_large", `File is larger than ${Math.round(maxBytes / 1048576)} MB: ${path}`); + return readFile(absolute); + } + + async readText(path: string): Promise { + return (await this.read(path, 20 * 1024 * 1024)).toString("utf8"); + } + + async write(path: string, data: Uint8Array | string): Promise { + const absolute = this.resolve(path); + await mkdir(dirname(absolute), { recursive: true }); + await writeFile(absolute, data); + return this.rel(absolute); + } + + /** 在工作区内移动 / 重命名文件;目标已存在时拒绝,不覆盖。 */ + async move(from: string, to: string): Promise { + const source = this.resolve(from); + const target = this.resolve(to); + if (!(await this.exists(from))) throw new KitError("not_found", `File not found: ${from}`); + if (await this.exists(to)) throw new KitError("exists", `Target already exists: ${to}`); + await mkdir(dirname(target), { recursive: true }); + await rename(source, target); + return this.rel(target); + } + + async size(path: string): Promise { + return (await stat(this.resolve(path))).size; + } + + async mtime(path: string): Promise { + return (await stat(this.resolve(path))).mtime; + } + + /** 列出文件(默认递归、跳过依赖与构建目录),按路径排序。 */ + async list({ dir = ".", exts, recursive = true, limit = 2000 }: { dir?: string; exts?: string[]; recursive?: boolean; limit?: number } = {}) { + const wanted = exts?.map((ext) => ext.toLowerCase()); + const out: { path: string; size: number }[] = []; + const walk = async (absolute: string, depth: number) => { + if (out.length >= limit || depth > 8) return; + let entries; + try { + entries = await readdir(absolute, { withFileTypes: true }); + } catch { + return; + } + entries.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); + for (const entry of entries) { + if (out.length >= limit) return; + if (entry.name.startsWith(".") && entry.name !== ".") continue; + const child = join(absolute, entry.name); + if (entry.isDirectory()) { + if (recursive && !SKIP.has(entry.name)) await walk(child, depth + 1); + } else if (entry.isFile() && (!wanted?.length || wanted.includes(extname(entry.name).toLowerCase()))) { + out.push({ path: this.rel(child), size: (await stat(child)).size }); + } + } + }; + await walk(this.resolve(dir), 0); + return out; + } +} + +/** 把文件名中不适合的字符替换掉,保留中文。 */ +export function safeFileName(name: string, fallback = "file"): string { + const cleaned = name + .replace(/[\\/:*?"<>|]+/g, "_") + .replace(/\p{Cc}+/gu, "_") + .replace(/\s+/g, " ") + .trim() + .replace(/^\.+/, ""); + return (cleaned || fallback).slice(0, 120); +} From af695da1af9856ef98af5dda4f2b5d3ebe1e8760 Mon Sep 17 00:00:00 2001 From: ppppp2005-p <360128433+ppppp2005-p@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:27:43 -0400 Subject: [PATCH 11/11] feat(ui-plugins): add Attendance Report (attendance-report) --- .../attendance-report/test/samples/punches.xlsx | Bin 0 -> 14233 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ui-plugins/attendance-report/test/samples/punches.xlsx diff --git a/ui-plugins/attendance-report/test/samples/punches.xlsx b/ui-plugins/attendance-report/test/samples/punches.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..fee929ff52be5ccc0bf27977816887f94bf62229 GIT binary patch literal 14233 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 o?=aACaaC`X76Z5Lv2pAU(2?|L64o2M9wrkN^Mx literal 0 HcmV?d00001