diff --git a/external_plugins/sheet-to-app/.zcode-plugin/plugin.json b/external_plugins/sheet-to-app/.zcode-plugin/plugin.json new file mode 100644 index 00000000..c57e70ca --- /dev/null +++ b/external_plugins/sheet-to-app/.zcode-plugin/plugin.json @@ -0,0 +1,60 @@ +{ + "name": "sheet-to-app", + "version": "0.1.0", + "description": "Turn an inventory, booking or customer spreadsheet (.xlsx / .csv) into a small offline web app: infers field types, required fields, options and a key column, lists data problems in the sheet, and writes one HTML file with search, filters, sorting, add / edit / delete forms with validation, a highlight rule (e.g. low stock), CSV import / export and JSON backup. Data stays in the browser. The mapping is saved, so when the sheet changes the app is rebuilt with your settings kept. No server, no network.", + "description_i18n": { + "en": "Turn an inventory, booking or customer spreadsheet (.xlsx / .csv) into a small offline web app: infers field types, required fields, options and a key column, lists data problems in the sheet, and writes one HTML file with search, filters, sorting, add / edit / delete forms with validation, a highlight rule (e.g. low stock), CSV import / export and JSON backup. Data stays in the browser. The mapping is saved, so when the sheet changes the app is rebuilt with your settings kept. No server, no network.", + "zh-CN": "把库存、预约、客户等表格(.xlsx / .csv)变成一个离线小应用:自动识别字段类型、必填、选项和唯一编号列,列出表格里的数据问题,生成一个 HTML 文件,带搜索、筛选、排序、新增/修改/删除(含校验)、高亮规则(如库存不足)、CSV 导入导出和 JSON 备份。数据存在浏览器本地。字段映射会保存,表格更新后一键重新生成并保留设置。不需要服务器,不联网。" + }, + "author": { + "name": "Penova", + "url": "https://github.com/ppppp2005-p" + }, + "license": "MIT", + "keywords": [ + "spreadsheet", + "excel", + "csv", + "app", + "inventory", + "booking", + "crud", + "no-code", + "offline", + "表格", + "小应用", + "库存", + "预约", + "客户管理" + ], + "skills": "skills", + "mcpServers": { + "sheet-to-app": { + "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": "Sheet To App" + }, + "icon": "table", + "server": "sheet-to-app", + "resourceUri": "ui://sheet-to-app/panel.html", + "availability": "session" + } + ] + } +} diff --git a/external_plugins/sheet-to-app/LICENSE b/external_plugins/sheet-to-app/LICENSE new file mode 100644 index 00000000..67e98093 --- /dev/null +++ b/external_plugins/sheet-to-app/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/sheet-to-app/README.md b/external_plugins/sheet-to-app/README.md new file mode 100644 index 00000000..c31869af --- /dev/null +++ b/external_plugins/sheet-to-app/README.md @@ -0,0 +1,53 @@ +# Sheet To App + +Turn an **inventory, booking or customer spreadsheet** (.xlsx / .csv / .tsv) into a small web app: **one HTML file** that opens by double-clicking, with search, filters and forms. No server, no account, no internet. + +## What it does + +- **Field mapping**: reads the header row and the data, then guesses each column's type: text, long text, number, money, date, email, phone, link, options (select) or yes/no. It also guesses which columns are required, the options of a select column, a unique key column (SKU, ID, 编号…) and the record title. Every guess can be changed in the panel or by asking the agent. +- **Data problems**: lists rows where a required value is missing, a value has the wrong type ("十" in a number column, a bad email or date), a value is not one of the options, or a key is duplicated, with sheet row numbers. These rows are still imported and shown in red in the app. +- **The app** (`apps//index.html`): + - Search across text columns, a filter for each options / yes-no column, click a header to sort, and pages of rows. + - Add, edit and delete records in a form with validation (required, number, date, email, link, unique key). + - An optional highlight rule, for example `库存 ≤ 5 → 库存不足`. + - CSV export (opens in Excel with Chinese text intact) and import (append or replace), plus JSON backup and restore. + - Chinese or English interface and an accent colour. + - Data is saved in the browser that opened the file (localStorage). +- **When the sheet changes**: `app_refresh` re-reads it, keeps your field settings, adds new columns, drops removed ones and rebuilds. Anyone who already used the app sees a banner offering to load the new data; their own edits stay until they choose. + +## Usage + +Ask the agent in ZCode Desktop: + +- "Turn inventory.xlsx into a small app I can search and edit" +- "Make a booking tracker from this CSV" +- "The sheet changed — rebuild the app and keep my settings" + +Or use the panel: pick the spreadsheet, click **Make app**, adjust field types, labels and the highlight rule, then **Apply & rebuild**. The right side shows a static preview. + +## Tools + +| Tool | Purpose | +|---|---| +| `app_new` | Read a sheet, infer the mapping, write the app and list data problems | +| `app_update` | Change fields (type, label, required, options, list / filter / hide, key, title) and settings (title, language, colour, page size, sort, highlight), then rebuild | +| `app_refresh` | Re-read the changed sheet, keep the settings and rebuild | +| `app_check` | List data problems without rebuilding | +| `app_list` | List the apps in this workspace | + +## Scope (v0.1) + +- One sheet per app. The first row holds the headers. Up to 20,000 rows. +- Data lives in one browser on one computer; there is no sync between people. Use **Backup** / **Export CSV** to move it, and keep the spreadsheet as the master copy. +- Edits made in the app are not written back to the spreadsheet. Export a CSV if you want them there. +- No hosting is included. The `apps//` folder is a plain static site, so you can upload it later to any static host such as Cloudflare Pages. Data would still stay per browser. +- Formulas are read as their last calculated values. .xls files must be saved as .xlsx first. + +## Privacy, network and files + +- Runs locally with no network access and no API keys. The generated app loads nothing from the internet. +- Reads the spreadsheet. Writes `apps//index.html` and `.sheet-to-app/apps.json` (the saved mappings). The spreadsheet is never changed. + +## License + +MIT. Uses [ExcelJS](https://github.com/exceljs/exceljs) (MIT) to read .xlsx files. diff --git a/external_plugins/sheet-to-app/README_CN.md b/external_plugins/sheet-to-app/README_CN.md new file mode 100644 index 00000000..730dc14d --- /dev/null +++ b/external_plugins/sheet-to-app/README_CN.md @@ -0,0 +1,53 @@ +# 表格转小应用 + +把**库存、预约、客户等表格**(.xlsx / .csv / .tsv)变成一个小网页应用:**只有一个 HTML 文件**,双击就能打开,能搜索、筛选、用表单增删改。不需要服务器,不用注册账号,也不联网。 + +## 功能 + +- **字段映射**:读取表头和数据,自动判断每一列的类型:文本、长文本、数字、金额、日期、邮箱、电话、链接、选项、是/否。同时判断哪些列必填、选项列有哪些选项、哪一列是唯一编号(SKU、ID、编号…)、哪一列是记录标题。所有判断都可以在面板里改,也可以直接让助手改。 +- **数据问题**:列出必填却为空、类型不对(数字列里写了“十”、邮箱或日期格式不对)、不在选项里、编号重复的行,并标出表格行号。这些行仍会导入,在应用里标红显示。 +- **生成的应用**(`apps//index.html`): + - 在文本类列里搜索;每个选项列、是/否列都有筛选;点表头排序;分页显示。 + - 用表单新增、修改、删除记录,带校验(必填、数字、日期、邮箱、链接、编号不能重复)。 + - 可选的高亮规则,例如“库存 ≤ 5 → 库存不足”。 + - 导出 CSV(用 Excel 打开中文不乱码)、导入 CSV(追加或替换)、JSON 备份与恢复。 + - 界面可选中文或英文,可设置主题色。 + - 数据保存在打开这个文件的浏览器里(localStorage)。 +- **表格更新后**:`app_refresh` 重新读取表格,保留你的字段设置,新增的列自动加上,删掉的列自动去掉,然后重新生成。已经用过这个应用的人会看到提示条,可以选择载入新数据;在他们选择之前,自己做的修改都会保留。 + +## 使用 + +在 ZCode Desktop 里对助手说: + +- “把库存表.xlsx 做成一个能查询、能修改的小应用” +- “用这个预约表 CSV 生成一个预约管理页面” +- “表格更新了,重新生成应用,保留我的设置” + +也可以用面板:选择表格,点 **生成应用**,调整字段类型、显示名和高亮规则,再点 **应用修改并重新生成**。右侧是静态预览。 + +## 工具 + +| 工具 | 作用 | +|---|---| +| `app_new` | 读取表格、推断字段映射、生成应用并列出数据问题 | +| `app_update` | 修改字段(类型、显示名、必填、选项、列表/筛选/隐藏、编号列、标题列)和设置(标题、语言、颜色、每页行数、排序、高亮),然后重新生成 | +| `app_refresh` | 表格改了以后重新读取,保留设置并重新生成 | +| `app_check` | 只检查数据问题,不重新生成 | +| `app_list` | 列出这个工作区里的应用 | + +## 范围(v0.1) + +- 一个应用对应一张工作表,第一行是表头,最多 20,000 行。 +- 数据只保存在一台电脑的一个浏览器里,多人之间不同步。要换电脑,请用 **备份** 或 **导出 CSV**;以表格为准。 +- 在应用里做的修改不会写回原表格;需要的话,导出 CSV 即可。 +- 不包含托管。`apps//` 是普通静态网站,以后可以上传到 Cloudflare Pages 等静态托管,但数据仍然按浏览器各自保存。 +- 公式按最近一次计算的结果读取。.xls 文件需要先另存为 .xlsx。 + +## 隐私、网络与文件 + +- 全部在本地运行,不联网,不需要 API Key。生成的应用也不加载任何网络资源。 +- 读取表格,写入 `apps//index.html` 和 `.sheet-to-app/apps.json`(保存的字段映射)。原表格不会被改动。 + +## 许可证 + +MIT。读取 .xlsx 用的是 [ExcelJS](https://github.com/exceljs/exceljs)(MIT)。 diff --git a/external_plugins/sheet-to-app/skills/sheet-to-app/SKILL.md b/external_plugins/sheet-to-app/skills/sheet-to-app/SKILL.md new file mode 100644 index 00000000..36c7b0a4 --- /dev/null +++ b/external_plugins/sheet-to-app/skills/sheet-to-app/SKILL.md @@ -0,0 +1,13 @@ +--- +name: sheet-to-app +description: 把库存、预约、客户等表格(xlsx/csv)生成单文件离线小应用(搜索、筛选、增删改带校验、高亮规则、CSV 导入导出、备份),保存字段映射,表格更新后重新生成。用户提到“表格做成应用 / 管理页面 / 库存管理 / 预约管理 / 把 Excel 变成系统”时使用。 +--- + +# 表格转小应用 + +1. 找到表格(.xlsx / .csv / .tsv,第一行是表头)。工作簿有多张表时,问清楚用哪一张,用 `sheet` 参数指定。 +2. 调用 `app_new({source, title?, lang?})`。它会推断字段类型、必填项、选项和编号列,写出 `apps//index.html`,并列出表格里的数据问题。 +3. 向用户说明:识别出的字段(类型不对的要指出),以及数据问题(第几行、哪一列、什么问题)。问题行仍会导入并标红,用户可以在应用里改,也可以先改原表格。 +4. 按用户的要求用 `app_update` 调整:字段类型、显示名、必填、选项、哪些列显示、筛选或隐藏,编号列、标题列,以及标题、语言、主题色、默认排序、高亮规则(例如 `{column:"库存", op:"<=", value:5, label:"库存不足"}`)。 +5. 表格更新后,调用 `app_refresh({id})`,设置会保留,然后把新增和删除的列告诉用户。 +6. 告诉用户:用浏览器打开 `apps//index.html` 就能用;数据保存在这个浏览器里,换电脑前请先“备份”或“导出 CSV”;应用里的修改不会写回原表格。以后要放到网上,可以把 `apps//` 文件夹上传到 Cloudflare Pages 等静态托管。 diff --git a/marketplace.json b/marketplace.json index 32e8c8ef..8c52ad6e 100644 --- a/marketplace.json +++ b/marketplace.json @@ -1673,6 +1673,58 @@ "把上一个 Hi3D 任务生成的模型按角色拆分成部件" ] } + }, + { + "name": "sheet-to-app", + "componentTypes": [ + "ui" + ], + "source": "./external_plugins/sheet-to-app", + "displayName": "Sheet To App", + "displayName_i18n": { + "en": "Sheet To App", + "zh-CN": "表格转小应用" + }, + "description": "Turn an inventory, booking or customer spreadsheet (.xlsx / .csv) into a small offline web app: infers field types, required fields, options and a key column, lists data problems in the sheet, and writes one HTML file with search, filters, sorting, add / edit / delete forms with validation, a highlight rule (e.g. low stock), CSV import / export and JSON backup. Data stays in the browser. The mapping is saved, so when the sheet changes the app is rebuilt with your settings kept. No server, no network.", + "description_i18n": { + "en": "Turn an inventory, booking or customer spreadsheet (.xlsx / .csv) into a small offline web app: infers field types, required fields, options and a key column, lists data problems in the sheet, and writes one HTML file with search, filters, sorting, add / edit / delete forms with validation, a highlight rule (e.g. low stock), CSV import / export and JSON backup. Data stays in the browser. The mapping is saved, so when the sheet changes the app is rebuilt with your settings kept. No server, no network.", + "zh-CN": "把库存、预约、客户等表格(.xlsx / .csv)变成一个离线小应用:自动识别字段类型、必填、选项和唯一编号列,列出表格里的数据问题,生成一个 HTML 文件,带搜索、筛选、排序、新增/修改/删除(含校验)、高亮规则(如库存不足)、CSV 导入导出和 JSON 备份。数据存在浏览器本地。字段映射会保存,表格更新后一键重新生成并保留设置。不需要服务器,不联网。" + }, + "version": "0.1.0", + "author": { + "name": "Penova", + "url": "https://github.com/ppppp2005-p" + }, + "license": "MIT", + "category": "productivity", + "keywords": [ + "spreadsheet", + "excel", + "csv", + "app", + "inventory", + "booking", + "crud", + "no-code", + "offline", + "表格", + "小应用", + "库存", + "预约", + "客户管理" + ], + "examplePrompts": [ + "Turn inventory.xlsx into a small app I can search and edit", + "Make a booking tracker from this CSV", + "The sheet changed — rebuild the app and keep my settings" + ], + "examplePrompts_i18n": { + "zh-CN": [ + "把库存表.xlsx 做成一个能查询、能修改的小应用", + "用这个预约表 CSV 生成一个预约管理页面", + "表格更新了,重新生成应用,保留我的设置" + ] + } } ] } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 14b35f76..7d491c38 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -224,6 +224,40 @@ importers: ui-plugins/photocraft: {} + ui-plugins/sheet-to-app: + 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/soundcraft: {} ui-plugins/typst-workbench: @@ -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 diff --git a/ui-plugins/sheet-to-app/package.json b/ui-plugins/sheet-to-app/package.json new file mode 100644 index 00000000..fbeb3a2c --- /dev/null +++ b/ui-plugins/sheet-to-app/package.json @@ -0,0 +1,36 @@ +{ + "name": "@penova/plugin-sheet-to-app", + "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": "Sheet To App", + "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/sheet-to-app/scripts/build.mjs b/ui-plugins/sheet-to-app/scripts/build.mjs new file mode 100644 index 00000000..02ff90d4 --- /dev/null +++ b/ui-plugins/sheet-to-app/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/sheet-to-app/scripts/e2e.mts b/ui-plugins/sheet-to-app/scripts/e2e.mts new file mode 100644 index 00000000..b7d1d036 --- /dev/null +++ b/ui-plugins/sheet-to-app/scripts/e2e.mts @@ -0,0 +1,126 @@ +// 浏览器端到端测试:真实打包的 server + 官方 AppBridge 宿主 + 隔离 iframe 中的面板; +// 然后用 Chrome 以 file:// 打开生成的单文件应用:搜索、筛选、排序、新增/编辑校验、刷新后数据保留、CSV 导出、表格更新提示。需要 Chrome。 +import assert from "node:assert/strict"; +import { execFileSync } from "node:child_process"; +import { copyFileSync, mkdirSync } from "node:fs"; +import { mkdtemp, readFile, rename } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { pathToFileURL } from "node:url"; +import { startHarness } from "./harness.mjs"; + +const shots = process.env.E2E_SHOTS ?? join(tmpdir(), "sheet-to-app-shots"); +mkdirSync(shots, { recursive: true }); +const workspace = await mkdtemp(join(tmpdir(), "sta-e2e-")); +const local = join(import.meta.dirname, "../node_modules/.sheet-sample.mjs"); +copyFileSync(process.env.SHEET_SAMPLE ?? "/workspace/zcode-new-plugins/samples/sheet/make-sheets.mjs", local); +mkdirSync(join(workspace, "data")); +execFileSync(process.execPath, [local, join(workspace, "data")]); +const harness = await startHarness({ workspace }); +const step = (t: string) => process.stdout.write(`• ${t}\n`); +try { + const { outer, frame, context } = await harness.open("?locale=zh-CN", { width: 1440, height: 950 }); + step("user picks the inventory sheet and makes the app"); + await frame.locator("select.src").selectOption("data/库存表.csv"); + await frame.locator("button.make").click(); + await frame.locator(".done", { hasText: "index.html" }).waitFor({ timeout: 30_000 }); + await frame.locator(".issue", { hasText: "不是数字" }).waitFor(); + assert.equal(await frame.locator("tr[data-col='库存'] select.ty").inputValue(), "number"); + assert.equal(await frame.locator("tr[data-col='在售'] select.ty").inputValue(), "boolean"); + await outer.screenshot({ path: join(shots, "01-mapping.png") }); + + step("user renames the app, hides 供应商 and adds a low-stock highlight"); + await frame.locator("input.title").fill("门店物料库存"); + await frame.locator("tr[data-col='供应商'] input[data-k='hidden']").check(); + await frame.locator("select.hlcol").selectOption("库存"); + await frame.locator("select.hlop").selectOption("<="); + await frame.locator("input.hlval").fill("5"); + await frame.locator("input.hllab").fill("库存不足"); + await frame.locator("button.apply").click(); + await frame.locator(".done", { hasText: "已生成" }).waitFor(); + await frame.frameLocator("iframe.pv").locator(".tag", { hasText: "库存不足" }).first().waitFor({ timeout: 15_000 }); + await outer.screenshot({ path: join(shots, "02-settings-preview.png") }); + const id = (await harness.agent(outer, "app_list", {})).structuredContent.apps[0].id; + const appFile = join(workspace, `apps/${id}/index.html`); + + step("open the generated app from disk (file://)"); + const page = await context.newPage(); + const errs: string[] = []; + page.on("pageerror", (e) => errs.push(String(e))); + page.on("console", (m) => { if (m.type() === "error") errs.push(m.text()); }); + page.on("dialog", (d) => void d.accept()); + await page.setViewportSize({ width: 1280, height: 820 }); + await page.goto(pathToFileURL(appFile).href); + await page.locator("h1", { hasText: "门店物料库存" }).waitFor(); + await page.locator("#count", { hasText: "共 15 条" }).waitFor(); + assert.equal(await page.locator("th", { hasText: "供应商" }).count(), 0, "hidden column not shown"); + assert.ok((await page.locator("tr.hl").count()) >= 3, "low-stock rows highlighted"); + await page.locator("td.bad", { hasText: "十" }).waitFor(); + + step("search, filter and sort"); + await page.locator("#q").fill("滤"); + await page.locator("#count", { hasText: "共 2 条" }).waitFor(); + await page.locator("#q").fill(""); + await page.locator("select[data-f]").first().selectOption("器具"); + await page.locator("#count", { hasText: "共 4 条" }).waitFor(); + await page.locator("th[data-k]", { hasText: "库存" }).click(); + const firstStock = await page.locator("tbody tr").first().locator("td").nth(3).textContent(); + assert.equal(firstStock?.trim(), "2", "sorted by stock ascending"); + await page.locator("select[data-f]").first().selectOption(""); + await page.locator("#count", { hasText: "共 15 条" }).waitFor(); + + step("add a record: required + duplicate-key validation, then save"); + await page.locator("#add").click(); + await page.locator("#f_sku").fill("HB-001"); + await page.locator("#frm button[type=submit]").click(); + await page.locator(".fld .err", { hasText: "必填" }).first().waitFor(); + await page.locator(".fld .err", { hasText: "已存在相同的SKU" }).waitFor(); + await page.screenshot({ path: join(shots, "03-form-validation.png") }); + await page.locator("#f_sku").fill("HB-040"); + await page.locator("#f_f2").fill("冷萃滤袋 20只"); + await page.locator("#f_f3").selectOption("耗材"); + await page.locator("#f_f4").fill("3"); + await page.locator("#f_f5").fill("32.5"); + await page.locator("#f_f7").fill("2026-11-24"); + await page.locator("#frm button[type=submit]").click(); + await page.locator("#count", { hasText: "共 16 条" }).waitFor(); + await page.locator("tbody tr.hl", { hasText: "HB-040" }).waitFor(); + + step("edit the bad row (十 → 10) and check it persists after reload"); + await page.locator("tbody tr", { hasText: "HB-022" }).click(); + await page.locator("#f_f4").fill("10"); + await page.locator("#frm button[type=submit]").click(); + await page.reload(); + await page.locator("#count", { hasText: "共 16 条" }).waitFor(); + assert.equal(await page.locator("td.bad", { hasText: "十" }).count(), 0); + await page.locator("tbody tr", { hasText: "HB-022" }).locator("td", { hasText: /^10$/ }).waitFor(); + await page.screenshot({ path: join(shots, "04-app.png") }); + + step("export CSV"); + const [dl] = await Promise.all([page.waitForEvent("download"), page.locator("#exp").click()]); + const csv = await readFile((await dl.path())!, "utf8"); + assert.ok(csv.startsWith("\uFEFFSKU,商品名称"), "BOM + Chinese headers"); + assert.match(csv, /HB-040,冷萃滤袋 20只,耗材,3,32.5,2026-11-24,否/); + + step("delete a record"); + await page.locator("tbody tr", { hasText: "HB-040" }).click(); + await page.locator("#del").click(); + await page.locator("#count", { hasText: "共 15 条" }).waitFor(); + + step("sheet updated → app_refresh → open copy shows the banner and loads the new data"); + await rename(join(workspace, "data/库存表-更新.csv"), join(workspace, "data/库存表.csv")); + const r = await harness.agent(outer, "app_refresh", { id }); + assert.match(r.content[0].text, /new columns: 货架位置/); + await page.reload(); + await page.locator(".banner", { hasText: "表格已更新" }).waitFor(); + await page.evaluate(() => window.scrollTo(0, 0)); + await page.screenshot({ path: join(shots, "05-sheet-updated.png") }); + await page.locator("#loadNew").click(); + await page.locator("#count", { hasText: "共 16 条" }).waitFor(); + await page.locator("tbody tr", { hasText: "HB-032" }).waitFor(); + assert.deepEqual(errs, [], "no script errors in the generated app"); + assert.deepEqual(harness.errors, []); + step(`ok — screenshots in ${shots}`); +} finally { + await harness.close(); +} diff --git a/ui-plugins/sheet-to-app/scripts/harness.mjs b/ui-plugins/sheet-to-app/scripts/harness.mjs new file mode 100644 index 00000000..a45e6e41 --- /dev/null +++ b/ui-plugins/sheet-to-app/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/sheet-to-app/scripts/licenses.mjs b/ui-plugins/sheet-to-app/scripts/licenses.mjs new file mode 100644 index 00000000..5107fe7c --- /dev/null +++ b/ui-plugins/sheet-to-app/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")); +} diff --git a/ui-plugins/sheet-to-app/src/app.ts b/ui-plugins/sheet-to-app/src/app.ts new file mode 100644 index 00000000..37439ea9 --- /dev/null +++ b/ui-plugins/sheet-to-app/src/app.ts @@ -0,0 +1,137 @@ +import type { Field } from "./schema.ts"; + +export interface AppSettings { + title: string; + lang: "zh" | "en"; + accent: string; + pageSize: number; + sort?: { key: string; dir: "asc" | "desc" }; + /** 高亮规则,例如 库存 <= 5 → “库存不足” */ + highlight?: { key: string; op: "<=" | ">=" | "=" | "empty"; value?: string | number; label: string }; +} +export interface AppConfig extends AppSettings { id: string; fields: Field[]; keyField?: string; titleField?: string; source: string; generatedAt: string } + +const json = (v: unknown) => JSON.stringify(v).replace(/"]/g,function(c){return{"&":"&","<":"<",">":">",'"':"""}[c]})} +function fmt(f,v){if(v==null||v==="")return"";if(f.type==="boolean")return v===true?S.yes:v===false?S.no:String(v);if(f.type==="money"&&typeof v==="number")return v.toLocaleString(ZH?"zh-CN":"en-US",{minimumFractionDigits:2,maximumFractionDigits:2});if(f.type==="number"&&typeof v==="number")return v.toLocaleString(ZH?"zh-CN":"en-US");return String(v)} +function invalid(f,v){if(v==null||v===""||(f.type==="boolean"&&v===false))return f.required&&f.type!=="boolean"?S.required:"";if((f.type==="number"||f.type==="money")&&typeof v!=="number")return S.num;if(f.type==="date"&&!/^\d{4}-\d{2}-\d{2}$/.test(v))return S.date;if(f.type==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(v))return S.email;if(f.type==="url"&&!/^https?:\/\//i.test(v))return S.url;return""} +function hl(r){var h=CFG.highlight;if(!h)return false;var v=r[h.key];if(h.op==="empty")return v==null||v==="";var x=Number(v),y=Number(h.value);if(h.op==="<=")return typeof v==="number"&&x<=y;if(h.op===">=")return typeof v==="number"&&x>=y;return String(v)===String(h.value)} +function view(){var q=st.q.trim().toLowerCase(),rows=store.rows.filter(function(r){for(var k in st.filters){var fv=st.filters[k];if(fv==="")continue;var f=F.find(function(x){return x.key===k});if(f.type==="boolean"){if(String(r[k]===true)!==fv)return false}else if(String(r[k]==null?"":r[k])!==fv)return false} +if(!q)return true;return F.some(function(f){return f.search&&String(r[f.key]==null?"":r[f.key]).toLowerCase().indexOf(q)>=0})}); +if(st.sort){var k=st.sort.key,d=st.sort.dir==="desc"?-1:1;rows.sort(function(a,b){var x=a[k],y=b[k];if(x==null||x==="")return 1;if(y==null||y==="")return -1;return(typeof x==="number"&&typeof y==="number"?x-y:String(x).localeCompare(String(y),ZH?"zh":"en",{numeric:true}))*d})}return rows} +function render(){var rows=view(),ps=CFG.pageSize||20,pages=Math.max(1,Math.ceil(rows.length/ps));if(st.page>=pages)st.page=pages-1;var page=rows.slice(st.page*ps,st.page*ps+ps); +$("#thead").innerHTML=""+LIST.map(function(f){var a=st.sort&&st.sort.key===f.key?(st.sort.dir==="asc"?" ▲":" ▼"):"";return''+esc(f.label)+''+a+""}).join("")+""; +$("#tbody").innerHTML=page.length?page.map(function(r){return'"+LIST.map(function(f,i){var v=r[f.key],bad=invalid(f,v);return'"+esc(fmt(f,v))+(i===0&&hl(r)?''+esc(CFG.highlight.label)+"":"")+""}).join("")+""}).join(""):''+S.none+""; +$("#count").textContent=(rows.length?(st.page*ps+1)+"–"+(st.page*ps+page.length):"0")+" / "+S.of+" "+rows.length+" "+S.rows;$("#prev").disabled=st.page===0;$("#next").disabled=st.page>=pages-1} +function toast(t){var e=$(".toast");e.textContent=t;e.classList.add("on");clearTimeout(e._t);e._t=setTimeout(function(){e.classList.remove("on")},1800)} +function input(f,v){var id="f_"+f.key,req=f.required?' *':"",h='
"; +if(f.type==="longtext")h+='"; +else if(f.type==="select")h+='"; +else if(f.type==="boolean")h+='"; +else{var t={number:"number",money:"number",date:"date",email:"email",phone:"tel",url:"url"}[f.type]||"text";h+=''} +return h+'
'} +var editing=null; +function openForm(r){editing=r;var d=$("#dlg");$("#dlgT").textContent=r?S.edit+(CFG.titleField&&r[CFG.titleField]?" · "+r[CFG.titleField]:""):S.newT;$("#fields").innerHTML=F.map(function(f){return input(f,r?r[f.key]:f.type==="boolean"?false:"")}).join("");$("#del").style.display=r?"":"none";d.showModal()} +function readForm(){var o={},ok=true;F.forEach(function(f){var el=$("[name='"+f.key+"']",$("#dlg")),v;if(f.type==="boolean")v=el.checked;else{v=el.value.trim();if((f.type==="number"||f.type==="money")&&v!=="")v=isNaN(Number(v))?v:Number(v)}if(v==="")v=null;var bad=invalid(f,v); +if(!bad&&CFG.keyField===f.key&&v!=null&&store.rows.some(function(x){return x!==editing&&String(x[f.key])===String(v)}))bad=S.dupKey+f.label;el.parentNode.querySelector(".err").textContent=bad;if(bad)ok=false;o[f.key]=v});return ok?o:null} +function csvCell(v){v=v==null?"":String(v);return/[",\n\r]/.test(v)?'"'+v.replace(/"/g,'""')+'"':v} +function download(name,text,type){var a=document.createElement("a");a.href=URL.createObjectURL(new Blob([text],{type:type}));a.download=name;document.body.appendChild(a);a.click();setTimeout(function(){URL.revokeObjectURL(a.href);a.remove()},500)} +function parseCsv(t){t=t.replace(/^\uFEFF/,"");var first=t.split(/\r?\n/,1)[0]||"",dl=[",","\t",";"].sort(function(a,b){return first.split(b).length-first.split(a).length})[0],rows=[],row=[],c="",q=false; +for(var i=0;i"+opts.map(function(o){return'"}).join("")+""}).join(""); +$("#filters").addEventListener("change",function(e){st.filters[e.target.dataset.f]=e.target.value;st.page=0;render()}); +$("#add").onclick=function(){openForm(null)};$("#prev").onclick=function(){st.page--;render()};$("#next").onclick=function(){st.page++;render()}; +$("#cancel").onclick=function(){$("#dlg").close()}; +$("#del").onclick=function(){if(editing&&confirm(S.confirmDel)){store.rows=store.rows.filter(function(r){return r!==editing});persist();$("#dlg").close();render();toast(S.deleted)}}; +$("#frm").addEventListener("submit",function(e){e.preventDefault();var o=readForm();if(!o)return;if(editing){for(var k in o)editing[k]=o[k]}else{o._id=uid();store.rows.unshift(o)}persist();$("#dlg").close();render();toast(S.saved)}); +$("#exp").onclick=function(){var lines=[F.map(function(f){return csvCell(f.label)}).join(",")].concat(store.rows.map(function(r){return F.map(function(f){var v=r[f.key];return csvCell(f.type==="boolean"?(v?S.yes:S.no):v)}).join(",")}));download(CFG.title+".csv","\uFEFF"+lines.join("\r\n")+"\r\n","text/csv")}; +$("#imp").onclick=function(){$("#file").dataset.mode="csv";$("#file").accept=".csv,.tsv,.txt";$("#file").click()}; +$("#restore").onclick=function(){$("#file").dataset.mode="json";$("#file").accept=".json";$("#file").click()}; +$("#backup").onclick=function(){download(CFG.title+"-backup.json",JSON.stringify({app:CFG.id,exported:new Date().toISOString(),store:store},null,1),"application/json")}; +$("#file").addEventListener("change",function(e){var file=e.target.files[0];if(!file)return;file.text().then(function(t){if(e.target.dataset.mode==="json"){var b=JSON.parse(t);if(b&&b.store&&Array.isArray(b.store.rows)){store=b.store;persist();render();toast(S.restored)}} +else{var m=parseCsv(t),head=m[0]||[],idx=F.map(function(f){var i=head.findIndex(function(h){h=h.trim();return h===f.label||h===f.column||h===f.key});return i}),rows=m.slice(1).map(function(c){var o={_id:uid()};F.forEach(function(f,j){o[f.key]=idx[j]>=0?fromCell(f,c[idx[j]]):(f.type==="boolean"?false:null)});return o}); +if(confirm(S.importMode))store.rows=store.rows.concat(rows);else store.rows=rows;persist();render();toast(S.imported+" "+rows.length)}e.target.value=""})}); +$("#reset").onclick=function(){if(confirm(S.confirmReset)){store=fresh();persist();render()}}; +if(stale){var b=$("#banner");b.style.display="";b.innerHTML=""+S.updated+esc(new Date(SEED.date).toLocaleString(ZH?"zh-CN":"en-US",{dateStyle:"medium",timeStyle:"short"}))+S.updated2+'"; +$("#loadNew").onclick=function(){store=fresh();persist();b.style.display="none";render()};$("#keepMine").onclick=function(){store.seedVersion=SEED.version;persist();b.style.display="none"}} +render(); +})();`; + +export function renderApp(cfg: AppConfig, seed: { version: string; date: string; rows: Record[] }): string { + const zh = cfg.lang === "zh"; + const t = (a: string, b: string) => (zh ? a : b); + const e = (s: string) => s.replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c]!); + return ` + +${e(cfg.title)} + + + +

${e(cfg.title)}

+ + +
+
+ +
+
+
+

${t("数据保存在这台电脑的浏览器里。换电脑或清除浏览器数据前,请先“备份”或“导出 CSV”。", "Data is stored in this browser on this computer. Use Backup or Export CSV before switching computers or clearing browser data.")}

+
+

+
+
+ + + + +`; +} + +/** 面板里用的静态预览(无脚本):前 15 行。 */ +export function staticPreview(cfg: AppConfig, rows: Record[]): string { + const e = (s: unknown) => String(s ?? "").replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c]!); + const list = cfg.fields.filter((f) => f.list && !f.hidden); + const fmt = (f: Field, v: unknown) => (v == null ? "" : f.type === "boolean" ? (v === true ? (cfg.lang === "zh" ? "是" : "Yes") : (cfg.lang === "zh" ? "否" : "No")) : f.type === "money" && typeof v === "number" ? v.toFixed(2) : String(v)); + const hl = (r: Record) => { const h = cfg.highlight; if (!h) return false; const v = r[h.key]; if (h.op === "empty") return v == null || v === ""; if (typeof v !== "number") return h.op === "=" && String(v) === String(h.value); return h.op === "<=" ? v <= Number(h.value) : h.op === ">=" ? v >= Number(h.value) : String(v) === String(h.value); }; + return `

${e(cfg.title)}

+
${cfg.fields.filter((f) => f.filter && !f.hidden).map((f) => ``).join("")}
+
${list.map((f) => ``).join("")}${rows.slice(0, 15).map((r) => `${list.map((f, i) => ``).join("")}`).join("")}
${e(f.label)}
${e(fmt(f, r[f.key]))}${i === 0 && hl(r) ? `${e(cfg.highlight!.label)}` : ""}
+
1–${Math.min(15, rows.length)} / ${rows.length}
`; +} diff --git a/ui-plugins/sheet-to-app/src/kit/console.ts b/ui-plugins/sheet-to-app/src/kit/console.ts new file mode 100644 index 00000000..f6817656 --- /dev/null +++ b/ui-plugins/sheet-to-app/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/sheet-to-app/src/kit/server-kit.ts b/ui-plugins/sheet-to-app/src/kit/server-kit.ts new file mode 100644 index 00000000..6bc31594 --- /dev/null +++ b/ui-plugins/sheet-to-app/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/sheet-to-app/src/kit/table.ts b/ui-plugins/sheet-to-app/src/kit/table.ts new file mode 100644 index 00000000..37a36b83 --- /dev/null +++ b/ui-plugins/sheet-to-app/src/kit/table.ts @@ -0,0 +1,120 @@ +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 async function readTable(ws: Workspace, path: string, sheet?: string): Promise { + const ext = extname(path).toLowerCase(); + const bytes = await ws.read(path, 50 * 1024 * 1024); + if (ext === ".csv" || ext === ".tsv" || ext === ".txt") return toTable(parseCsv(decodeText(bytes)), []); + if (ext === ".xlsx") { + const book = new ExcelJS.Workbook(); + try { + await book.xlsx.load(bytes as unknown as ArrayBuffer); + } catch { + throw new KitError("bad_xlsx", `${path} is not a readable .xlsx file (empty, damaged, or an old .xls renamed). Re-save it from Excel/WPS as .xlsx, or export it as CSV.`); + } + 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(matrix, 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/sheet-to-app/src/kit/workspace.ts b/ui-plugins/sheet-to-app/src/kit/workspace.ts new file mode 100644 index 00000000..f02c4fcb --- /dev/null +++ b/ui-plugins/sheet-to-app/src/kit/workspace.ts @@ -0,0 +1,151 @@ +import { lstatSync, readlinkSync, realpathSync } from "node:fs"; +import { mkdir, readFile, readdir, 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 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 || 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); +} diff --git a/ui-plugins/sheet-to-app/src/main.ts b/ui-plugins/sheet-to-app/src/main.ts new file mode 100644 index 00000000..c5242dc3 --- /dev/null +++ b/ui-plugins/sheet-to-app/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(`[sheet-to-app] ${line}\n`), +}); +process.stdin.once("end", () => process.exit(0)); +await server.connect(new StdioServerTransport()); diff --git a/ui-plugins/sheet-to-app/src/schema.ts b/ui-plugins/sheet-to-app/src/schema.ts new file mode 100644 index 00000000..0f3cf791 --- /dev/null +++ b/ui-plugins/sheet-to-app/src/schema.ts @@ -0,0 +1,101 @@ +// 字段映射:从表格推断字段类型、必填、选项;校验每一行;把单元格转换成应用里的值。 +export const TYPES = ["text", "longtext", "number", "money", "date", "email", "phone", "url", "select", "boolean"] as const; +export type FieldType = (typeof TYPES)[number]; +export interface Field { + column: string; // 表格里的列名 + key: string; // 应用内部的字段名 + label: string; // 显示名 + type: FieldType; + required: boolean; + options?: string[]; // select 的选项 + list: boolean; // 显示在列表里 + filter: boolean; // 作为筛选条件 + search: boolean; // 参与搜索 + hidden?: boolean; // 完全不在应用里出现 +} +export interface Mapping { fields: Field[]; keyField?: string; titleField?: string } +export interface DataIssue { row: number; column: string; value: string; message: string } + +const TRUE = new Set(["是", "yes", "y", "true", "1", "✓", "✔", "对", "有"]); +const FALSE = new Set(["否", "no", "n", "false", "0", "✗", "✘", "", "无"]); +const num = (v: string) => { const s = v.replace(/[,\s¥$€£¥]/g, ""); return s !== "" && Number.isFinite(Number(s)) ? Number(s) : undefined; }; +const dateRe = /^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?$/; +export const normDate = (v: string) => { const m = dateRe.exec(v.trim()); if (!m) return undefined; const [y, mo, d] = [Number(m[1]), Number(m[2]), Number(m[3])]; const dt = new Date(Date.UTC(y, mo - 1, d)); return dt.getUTCMonth() === mo - 1 && dt.getUTCDate() === d ? `${y}-${String(mo).padStart(2, "0")}-${String(d).padStart(2, "0")}` : undefined; }; +const emailRe = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/; +const phoneRe = /^\+?[\d\s\-().]{6,20}$/; +const urlRe = /^https?:\/\/\S+$/i; + +export const fieldKey = (column: string, i: number) => { + const ascii = column.normalize("NFKD").replace(/[^\w]+/g, "_").replace(/^_+|_+$/g, "").toLowerCase(); + return /^[a-z]/.test(ascii) ? ascii.slice(0, 32) : `f${i + 1}`; +}; + +export function inferField(column: string, values: string[], i: number): Field { + const filled = values.map((v) => v.trim()).filter(Boolean); + const n = filled.length; + const share = (ok: (v: string) => boolean) => (n ? filled.filter(ok).length / n : 0); + const name = column.toLowerCase(); + let type: FieldType = "text"; + if (n && filled.every((v) => TRUE.has(v.toLowerCase()) || FALSE.has(v.toLowerCase())) && !filled.every((v) => /^\d+$/.test(v) && Number(v) > 1)) type = "boolean"; + else if (/phone|tel|mobile|电话|手机/.test(name) && share((v) => phoneRe.test(v)) >= 0.8) type = "phone"; + else if (/e-?mail|邮箱/.test(name) && share((v) => emailRe.test(v)) >= 0.5) type = "email"; + else if (share((v) => num(v) !== undefined) >= 0.85) type = /价|金额|费|price|amount|cost|total|revenue|fee|salary/.test(name) ? "money" : "number"; + else if (share((v) => !!normDate(v)) >= 0.85) type = "date"; + else if (/mail|邮箱/.test(name) || share((v) => emailRe.test(v)) >= 0.8) type = "email"; + else if (/phone|tel|mobile|电话|手机/.test(name) || (share((v) => phoneRe.test(v) && /\d{6}/.test(v.replace(/\D/g, ""))) >= 0.9 && !/id|sku|code|编号/.test(name))) type = "phone"; + else if (share((v) => urlRe.test(v)) >= 0.8) type = "url"; + else { + const distinct = new Set(filled); + const avg = n ? filled.reduce((a, v) => a + v.length, 0) / n : 0; + if (avg > 60) type = "longtext"; + else if (n >= 4 && distinct.size <= Math.min(12, Math.ceil(n / 2)) && avg <= 24 && !/name|名称|姓名|title|标题|备注|note/.test(name)) type = "select"; + } + const f: Field = { column, key: fieldKey(column, i), label: column, type, required: type !== "boolean" && n >= 3 && (n === values.length || (values.length >= 8 && n / values.length >= 0.9)), list: false, filter: type === "select" || type === "boolean", search: ["text", "longtext", "email", "phone", "select"].includes(type) }; + if (type === "select") f.options = [...new Set(filled)].sort((a, b) => a.localeCompare(b, "zh")); + return f; +} + +export function inferMapping(columns: string[], rows: Record[]): Mapping { + const fields = columns.map((c, i) => inferField(c, rows.map((r) => r[c] ?? ""), i)); + const used = new Set(); + for (const f of fields) { let k = f.key, j = 2; while (used.has(k)) k = `${f.key}_${j++}`; f.key = k; used.add(k); } + const unique = (f: Field) => { const vals = rows.map((r) => (r[f.column] ?? "").trim()); return vals.filter(Boolean).length >= vals.length - 1 && new Set(vals.filter(Boolean)).size === vals.filter(Boolean).length; }; + const keyF = fields.find((f) => /^(id|sku|编号|编码|code|no\.?|序号)$/i.test(f.column)) ?? fields.find((f) => f.type === "text" && unique(f) && rows.every((r) => (r[f.column] ?? "").length <= 16)); + const titleF = fields.find((f) => f !== keyF && f.type === "text" && /name|名称|姓名|客户|title|标题|商品|customer/i.test(f.column)) ?? fields.find((f) => f !== keyF && f.type === "text"); + let shown = 0; + for (const f of fields) if (f.type !== "longtext" && shown < 7) { f.list = true; shown++; } + return { fields, keyField: keyF?.key, titleField: titleF?.key }; +} + +/** 单元格 → 应用值;返回问题(不改原表)。 */ +export function convert(f: Field, raw: string): { value: string | number | boolean | null; problem?: string } { + const v = (raw ?? "").trim(); + if (!v) return { value: f.type === "boolean" ? false : null, problem: f.required ? "required" : undefined }; + switch (f.type) { + case "number": case "money": { const x = num(v); return x === undefined ? { value: v, problem: "not a number" } : { value: x }; } + case "date": { const d = normDate(v); return d ? { value: d } : { value: v, problem: "not a date (YYYY-MM-DD)" }; } + case "boolean": { const l = v.toLowerCase(); return TRUE.has(l) ? { value: true } : FALSE.has(l) ? { value: false } : { value: false, problem: "not yes/no" }; } + case "email": return emailRe.test(v) ? { value: v } : { value: v, problem: "not an email address" }; + case "phone": return phoneRe.test(v) ? { value: v } : { value: v, problem: "not a phone number" }; + case "url": return urlRe.test(v) ? { value: v } : { value: v, problem: "not a http(s) URL" }; + case "select": return f.options?.length && !f.options.includes(v) ? { value: v, problem: `not one of the options (${f.options.join(", ")})` } : { value: v }; + default: return { value: v }; + } +} + +export function toRecords(m: Mapping, rows: Record[]) { + const issues: DataIssue[] = []; + const records = rows.map((r, i) => { + const rec: Record = {}; + for (const f of m.fields) { + if (f.hidden) continue; + const c = convert(f, r[f.column] ?? ""); + rec[f.key] = c.value; + if (c.problem) issues.push({ row: i + 2, column: f.column, value: r[f.column] ?? "", message: c.problem }); + } + return rec; + }); + const key = m.fields.find((f) => f.key === m.keyField); + if (key) { const seen = new Map(); rows.forEach((r, i) => { const v = (r[key.column] ?? "").trim(); if (!v) { if (!key.required) issues.push({ row: i + 2, column: key.column, value: "", message: "missing key" }); return; } if (seen.has(v)) issues.push({ row: i + 2, column: key.column, value: v, message: `duplicate key (also row ${seen.get(v)})` }); else seen.set(v, i + 2); }); } + return { records, issues }; +} diff --git a/ui-plugins/sheet-to-app/src/server.ts b/ui-plugins/sheet-to-app/src/server.ts new file mode 100644 index 00000000..f86c7679 --- /dev/null +++ b/ui-plugins/sheet-to-app/src/server.ts @@ -0,0 +1,197 @@ +import { createHash } from "node:crypto"; +import { readFile } from "node:fs/promises"; +import { basename, extname, join } from "node:path"; +import { z } from "zod"; +import { createKitServer } from "./kit/server-kit.ts"; +import { readTable } from "./kit/table.ts"; +import { KitError, Workspace } from "./kit/workspace.ts"; +import { type AppConfig, type AppSettings, renderApp, staticPreview } from "./app.ts"; +import { type DataIssue, type Field, type Mapping, TYPES, inferField, inferMapping, toRecords } from "./schema.ts"; + +export const NAME = "sheet-to-app"; +export const VERSION = "0.1.0"; +export const PANEL_URI = `ui://${NAME}/panel.html`; +const STORE = ".sheet-to-app/apps.json"; +const MAX_ROWS = 20000; + +export interface Project { id: string; source: string; sheet?: string; columns: string[]; mapping: Mapping; settings: AppSettings; out: string; seedVersion?: string; rows?: number; builtAt?: string } +export interface ServerOptions { workspaceRoot: string; assetRoot: string; log?: (line: string) => void } + +export const slugify = (s: string) => s.normalize("NFKD").replace(/[^\w-]+/g, "-").replace(/^-+|-+$/g, "").toLowerCase().slice(0, 40); +const hasCjk = (s: string) => /[\u3400-\u9fff]/.test(s); + +export function createServer(options: ServerOptions) { + const ws = new Workspace(options.workspaceRoot); + const { server, tool } = createKitServer({ name: NAME, version: VERSION, panelUri: PANEL_URI, surface: "editor", panelHtml: () => readFile(join(options.assetRoot, "ui/panel.html"), "utf8"), log: options.log }); + + const load = async (): Promise> => ((await ws.exists(STORE)) ? JSON.parse(await ws.readText(STORE)).apps ?? {} : {}); + const save = async (apps: Record) => ws.write(STORE, JSON.stringify({ version: 1, apps }, null, 1) + "\n"); + const get = async (id: string) => { const apps = await load(); const p = apps[id]; if (!p) throw new KitError("not_found", `No app “${id}”. Apps: ${Object.keys(apps).join(", ") || "none — use app_new"}.`); return { apps, p }; }; + + async function read(p: Pick) { + if (!(await ws.exists(p.source))) throw new KitError("not_found", `${p.source} not found.`); + const t = await readTable(ws, p.source, p.sheet); + if (t.rows.length > MAX_ROWS) throw new KitError("too_big", `${t.rows.length} rows; this local app keeps data in the browser and handles up to ${MAX_ROWS}.`); + return t; + } + + async function build(p: Project, rows: Record[]) { + const { records, issues } = toRecords(p.mapping, rows); + const fields = p.mapping.fields.filter((f) => !f.hidden); + const version = createHash("sha1").update(JSON.stringify([fields.map((f) => [f.key, f.type]), records])).digest("hex").slice(0, 12); + const now = new Date(); + const cfg: AppConfig = { ...p.settings, id: p.id, fields, keyField: p.mapping.keyField, titleField: p.mapping.titleField, source: p.source, generatedAt: now.toISOString() }; + await ws.write(p.out, renderApp(cfg, { version, date: now.toISOString(), rows: records })); + const changed = p.seedVersion !== undefined && p.seedVersion !== version; + p.seedVersion = version; p.rows = records.length; p.builtAt = now.toISOString(); + return { cfg, records, issues, changed }; + } + + const describe = (p: Project, issues: DataIssue[], extra: string[] = []) => { + const m = p.mapping; + const lines = [ + `App “${p.settings.title}” (${p.id}) → ${p.out} — ${p.rows} row(s) from ${p.source}${p.sheet ? ` [${p.sheet}]` : ""}. Open the file in a browser; edits are saved in that browser (localStorage).`, + ...extra, + `Fields:`, + ...m.fields.map((f) => ` ${f.hidden ? "(hidden) " : ""}${f.column} → ${f.type}${f.required ? ", required" : ""}${f.options ? ` [${f.options.join(" | ")}]` : ""}${f.list ? ", list" : ""}${f.filter ? ", filter" : ""}${f.key === m.keyField ? ", KEY" : ""}${f.key === m.titleField ? ", title" : ""}`), + `Data issues in the sheet (${issues.length})${issues.length ? ":" : ": none"}`, + ...issues.slice(0, 40).map((i) => ` row ${i.row}, ${i.column}: “${i.value}” — ${i.message}`), + ]; + if (issues.length > 40) lines.push(` … ${issues.length - 40} more`); + lines.push(`To publish later: upload the ${p.out.replace(/\/index\.html$/, "/")} folder to any static host (e.g. Cloudflare Pages). Data stays per browser either way.`); + return lines.join("\n"); + }; + const result = async (p: Project, b: Awaited>, extra: string[] = []) => ({ + text: describe(p, b.issues, extra), + structured: { kind: "app", project: p, issues: b.issues, preview: staticPreview(b.cfg, b.records), apps: Object.values(await load()).map((x) => ({ id: x.id, title: x.settings.title, out: x.out, rows: x.rows })) }, + }); + + tool("app_new", { + description: "Turn a spreadsheet (.xlsx/.csv/.tsv, first row = headers) into a small offline web app: one HTML file with a searchable, filterable, sortable table, add/edit/delete forms with validation, CSV import/export and JSON backup. Infers each column's type (text, longtext, number, money, date, email, phone, url, select, boolean), required fields, select options and a key column, and lists data problems found in the sheet. Writes apps//index.html and remembers the mapping so app_update / app_refresh can change it.", + input: { + source: z.string().describe("Workspace path of the spreadsheet"), + sheet: z.string().optional().describe("Worksheet name for .xlsx (default: first non-empty)"), + title: z.string().optional().describe("App title (default: file name)"), + lang: z.enum(["zh", "en"]).optional().describe("App UI language (default: Chinese if the headers are Chinese)"), + id: z.string().optional().describe("Short id used for the folder name"), + }, + openPanel: true, + }, async (i) => { + const t = await read(i); + const title = i.title?.trim() || basename(i.source, extname(i.source)); + const apps = await load(); + let id = slugify(i.id || title) || slugify(basename(i.source, extname(i.source))) || "app"; + if (/^\d*$/.test(id) || id.length < 2) id = `app-${createHash("sha1").update(i.source).digest("hex").slice(0, 6)}`; + for (let n = 2; apps[id] && apps[id].source !== i.source; n++) id = `${id.replace(/-\d+$/, "")}-${n}`; + const mapping = inferMapping(t.columns, t.rows); + const p: Project = { id, source: i.source, sheet: i.sheet ?? (t.sheets.length > 1 ? t.sheet : undefined), columns: t.columns, mapping, settings: { title, lang: i.lang ?? (hasCjk(t.columns.join("")) ? "zh" : "en"), accent: "#2563eb", pageSize: 20 }, out: `apps/${id}/index.html` }; + const b = await build(p, t.rows); + apps[id] = p; await save(apps); + return result(p, b, apps[id] && t.sheets.length > 1 ? [`Workbook sheets: ${t.sheets.join(", ")} (used ${t.sheet}).`] : []); + }); + + const fieldPatch = z.object({ + column: z.string().describe("Column name in the sheet"), + label: z.string().optional(), type: z.enum(TYPES).optional(), required: z.boolean().optional(), + options: z.array(z.string()).optional().describe("Options for a select field"), + list: z.boolean().optional().describe("Show as a table column"), filter: z.boolean().optional(), search: z.boolean().optional(), hidden: z.boolean().optional().describe("Leave this column out of the app"), + }); + tool("app_update", { + description: "Change an app's field mapping (type, label, required, options, which columns show / filter / search, hide a column, key and title field) and settings (title, language, accent colour, page size, default sort, a highlight rule such as stock <= 5 → 'Low stock'), then rebuild its HTML.", + input: { + id: z.string(), + fields: z.array(fieldPatch).optional(), + keyField: z.string().optional().describe("Column whose values must be unique ('' for none)"), + titleField: z.string().optional().describe("Column used as the record title in the edit form"), + title: z.string().optional(), lang: z.enum(["zh", "en"]).optional(), + accent: z.string().regex(/^#[0-9a-fA-F]{6}$/).optional(), pageSize: z.number().int().min(5).max(200).optional(), + sort: z.object({ column: z.string(), dir: z.enum(["asc", "desc"]) }).nullable().optional(), + highlight: z.object({ column: z.string(), op: z.enum(["<=", ">=", "=", "empty"]), value: z.union([z.string(), z.number()]).optional(), label: z.string() }).nullable().optional().describe("Highlight rows matching a rule; null removes it"), + }, + openPanel: true, + }, async (i) => { + const { apps, p } = await get(i.id); + const byCol = (c: string) => { const f = p.mapping.fields.find((x) => x.column === c || x.key === c || x.label === c); if (!f) throw new KitError("bad_column", `No column “${c}”. Columns: ${p.mapping.fields.map((x) => x.column).join(", ")}`); return f; }; + const changes: string[] = []; + for (const patch of i.fields ?? []) { + const f = byCol(patch.column); + for (const k of ["label", "type", "required", "options", "list", "filter", "search", "hidden"] as const) if (patch[k] !== undefined) { (f as unknown as Record)[k] = patch[k]; changes.push(`${f.column}.${k}`); } + if (patch.type && patch.type !== "select" && !patch.options) delete f.options; + if (patch.type === "select" && !f.options?.length) throw new KitError("bad_options", `Give options for select field ${f.column}.`); + } + if (i.keyField !== undefined) p.mapping.keyField = i.keyField ? byCol(i.keyField).key : undefined; + if (i.titleField !== undefined) p.mapping.titleField = i.titleField ? byCol(i.titleField).key : undefined; + const s = p.settings; + if (i.title) s.title = i.title; if (i.lang) s.lang = i.lang; if (i.accent) s.accent = i.accent; if (i.pageSize) s.pageSize = i.pageSize; + if (i.sort !== undefined) s.sort = i.sort ? { key: byCol(i.sort.column).key, dir: i.sort.dir } : undefined; + if (i.highlight !== undefined) { + if (i.highlight === null) delete s.highlight; + else { const f = byCol(i.highlight.column); if ((i.highlight.op === "<=" || i.highlight.op === ">=") && !(f.type === "number" || f.type === "money")) throw new KitError("bad_rule", `${f.column} is not a number field.`); s.highlight = { key: f.key, op: i.highlight.op, value: i.highlight.value, label: i.highlight.label }; } + } + const t = await read(p); + const b = await build(p, t.rows); + apps[p.id] = p; await save(apps); + return result(p, b, [`Updated: ${changes.join(", ") || "settings"}.`]); + }); + + tool("app_refresh", { + description: "Re-read an app's spreadsheet after it changed and rebuild: keeps your field mapping and settings, adds new columns (type inferred), drops removed ones, and reports the changes and data issues. People who already opened the app see a banner offering to load the new data (their own edits are kept until they choose).", + input: { id: z.string() }, openPanel: true, + }, async (i) => { + const { apps, p } = await get(i.id); + const t = await read(p); + const old = new Map(p.mapping.fields.map((f) => [f.column, f])); + const added = t.columns.filter((c) => !old.has(c)), removed = p.columns.filter((c) => !t.columns.includes(c)); + const used = new Set(p.mapping.fields.map((f) => f.key)); + const fields: Field[] = t.columns.map((c, n) => { + const f = old.get(c); if (f) return f; + const nf = inferField(c, t.rows.map((r) => r[c] ?? ""), n); + let k = nf.key, j = 2; while (used.has(k)) k = `${nf.key}_${j++}`; nf.key = k; used.add(k); + nf.list = p.mapping.fields.filter((x) => x.list).length < 7 && nf.type !== "longtext"; + return nf; + }); + p.mapping.fields = fields; p.columns = t.columns; + const keys = new Set(fields.map((f) => f.key)); + if (p.mapping.keyField && !keys.has(p.mapping.keyField)) p.mapping.keyField = undefined; + if (p.mapping.titleField && !keys.has(p.mapping.titleField)) p.mapping.titleField = undefined; + if (p.settings.highlight && !keys.has(p.settings.highlight.key)) delete p.settings.highlight; + if (p.settings.sort && !keys.has(p.settings.sort.key)) delete p.settings.sort; + const before = p.rows; + const b = await build(p, t.rows); + apps[p.id] = p; await save(apps); + return result(p, b, [`Refreshed: ${before} → ${p.rows} row(s); new columns: ${added.join(", ") || "none"}; removed columns: ${removed.join(", ") || "none"}; ${b.changed ? "data changed — open copies will offer to load it" : "data unchanged"}.`]); + }); + + tool("app_check", { + description: "Check an app's spreadsheet against its field mapping without rebuilding: lists rows with missing required values, wrong types (number, date, email, phone, url, yes/no), values outside the select options and duplicate keys, with sheet row numbers.", + input: { id: z.string() }, readOnly: true, + }, async (i) => { + const { p } = await get(i.id); + const t = await read(p); + const { issues } = toRecords(p.mapping, t.rows); + return { text: `${p.source}: ${t.rows.length} row(s), ${issues.length} issue(s).\n${issues.map((x) => ` row ${x.row}, ${x.column}: “${x.value}” — ${x.message}`).join("\n")}`, structured: { issues } }; + }); + + tool("app_list", { description: "List the apps made from spreadsheets in this workspace.", input: {}, readOnly: true }, async () => { + const apps = Object.values(await load()); + return { text: apps.length ? apps.map((p) => `${p.id}: “${p.settings.title}” ← ${p.source} → ${p.out} (${p.rows} rows, built ${p.builtAt})`).join("\n") : "No apps yet.", structured: { apps: apps.map((x) => ({ id: x.id, title: x.settings.title, out: x.out, rows: x.rows })) } }; + }); + + tool("app_state", { description: "Panel state for one app (or the list).", input: { id: z.string().optional() }, visibility: ["app"], readOnly: true }, async (i) => { + const apps = await load(); + const list = Object.values(apps).map((x) => ({ id: x.id, title: x.settings.title, out: x.out, rows: x.rows })); + const p = i.id ? apps[i.id] : Object.values(apps).sort((a, b) => (b.builtAt ?? "").localeCompare(a.builtAt ?? ""))[0]; + if (!p) return { text: "", structured: { kind: "none", apps: list } }; + const t = await read(p).catch(() => undefined); + if (!t) return { text: "", structured: { kind: "app", project: p, issues: [], preview: "", apps: list, missing: true } }; + const { records, issues } = toRecords(p.mapping, t.rows); + const cfg: AppConfig = { ...p.settings, id: p.id, fields: p.mapping.fields.filter((f) => !f.hidden), keyField: p.mapping.keyField, titleField: p.mapping.titleField, source: p.source, generatedAt: p.builtAt ?? "" }; + return { text: "", structured: { kind: "app", project: p, issues, preview: staticPreview(cfg, records), apps: list } }; + }); + + tool("app_sheets", { description: "Spreadsheets in the workspace.", input: {}, visibility: ["app"], readOnly: true }, async () => { + const paths = (await ws.list({ exts: [".xlsx", ".csv", ".tsv"] })).map((f) => f.path).filter((f) => !f.startsWith("apps/")); + return { text: "", structured: { files: paths.sort() } }; + }); + return server; +} diff --git a/ui-plugins/sheet-to-app/test/bad-xlsx.test.ts b/ui-plugins/sheet-to-app/test/bad-xlsx.test.ts new file mode 100644 index 00000000..4194844d --- /dev/null +++ b/ui-plugins/sheet-to-app/test/bad-xlsx.test.ts @@ -0,0 +1,23 @@ +import { mkdtempSync, writeFileSync } from "node:fs"; +import { randomBytes } from "node:crypto"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { describe, expect, it } from "vitest"; +import { Workspace } from "../src/kit/workspace.ts"; +import { readTable } from "../src/kit/table.ts"; + +// 回归测试:空的、损坏的 .xlsx 给出可读的 bad_xlsx,而不是 JSZip 原始报错(TEST-FINDINGS #4) +describe("damaged xlsx", () => { + const root = mkdtempSync(join(tmpdir(), "badxlsx-")); + writeFileSync(join(root, "空.xlsx"), ""); + writeFileSync(join(root, "坏 文件.xlsx"), randomBytes(4096)); + writeFileSync(join(root, "旧格式.xlsx"), Buffer.from("D0CF11E0A1B11AE1", "hex")); + const ws = new Workspace(root); + for (const f of ["空.xlsx", "坏 文件.xlsx", "旧格式.xlsx"]) + it(`explains ${f}`, async () => { + const e = await readTable(ws, f).then(() => null, (x) => x); + expect(e).toMatchObject({ code: "bad_xlsx" }); + expect(String(e.message)).toContain(f); + expect(String(e.message)).not.toMatch(/jszip|central directory|Corrupted zip/i); + }); +}); diff --git a/ui-plugins/sheet-to-app/test/tools.test.ts b/ui-plugins/sheet-to-app/test/tools.test.ts new file mode 100644 index 00000000..041e1b21 --- /dev/null +++ b/ui-plugins/sheet-to-app/test/tools.test.ts @@ -0,0 +1,130 @@ +import { execFileSync } from "node:child_process"; +import { copyFileSync, mkdirSync, mkdtempSync } from "node:fs"; +import { readFile, rename, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { Client } from "@modelcontextprotocol/sdk/client/index.js"; +import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js"; +import { beforeAll, describe, expect, it } from "vitest"; +import { inferField, inferMapping, normDate, toRecords } from "../src/schema.ts"; +import { createServer } from "../src/server.ts"; + +// 虚构样例(samples/sheet/make-sheets.mjs):咖啡馆物料库存表(中文表头,预置问题)、它的更新版、课程预约表 .xlsx。 +export const MAKE = process.env.SHEET_SAMPLE ?? "/workspace/zcode-new-plugins/samples/sheet/make-sheets.mjs"; +export function makeSheets(dir: string) { + const local = join(import.meta.dirname, "../node_modules/.sheet-sample.mjs"); // 放进 node_modules 以解析 exceljs + copyFileSync(MAKE, local); + mkdirSync(dir, { recursive: true }); + execFileSync(process.execPath, [local, dir]); +} +let ws: string; +let call: (name: string, args: Record) => Promise; +const seed = (html: string) => JSON.parse(/