commit 2417d9556fd0e212679118bb90fab943e81c008f Author: wehub-resource-sync Date: Mon Jul 13 12:31:38 2026 +0800 chore: import upstream snapshot with attribution diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 0000000..ffc3452 --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,27 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in the repository](https://github.com/changesets/changesets). + +## Usage + +When you make a change that needs to be released: + +```bash +pnpm changeset +``` + +This will prompt you to: +1. Select which packages have changed +2. Choose a semver bump type (major/minor/patch) +3. Provide a summary of the changes + +A changeset markdown file will be created in this directory. + +When it's time to release: + +```bash +pnpm changeset version # Apply version bumps and update changelogs +pnpm changeset publish # Publish to npm +``` diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..4708d8f --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [ + [ + "@wecom/cli", + "@wecom/cli-darwin-arm64", + "@wecom/cli-darwin-x64", + "@wecom/cli-linux-x64", + "@wecom/cli-linux-arm64", + "@wecom/cli-win32-x64" + ] + ], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8033b3c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ +# EditorConfig - https://editorconfig.org +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.rs] +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false + +[Cargo.toml] +indent_size = 4 + +[Cargo.lock] +indent_size = 4 diff --git a/.githooks/commit-msg b/.githooks/commit-msg new file mode 100755 index 0000000..f0abd67 --- /dev/null +++ b/.githooks/commit-msg @@ -0,0 +1,3 @@ +#!/bin/sh + +npx --no -- commitlint --edit "$1" diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..121b894 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,13 @@ +#!/bin/sh + +# Run clippy and fmt check if any Rust files are staged +if git diff --cached --name-only --diff-filter=d | grep -q '\.rs$'; then + cargo fmt --check || exit 1 + cargo clippy --all-targets -- -D warnings || exit 1 +fi + +# Run eslint on staged JS/TS files +JS_FILES=$(git diff --cached --name-only --diff-filter=d | grep -E '\.(js|ts)$') +if [ -n "$JS_FILES" ]; then + npx eslint $JS_FILES || exit 1 +fi diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6155b47 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# Rust +/target + +# Node +node_modules + +# Env +.env* + +# IDE +.codebuddy +.idea/ +.vscode/ + +# OS +.DS_Store +Thumbs.db + +# Logs & temp +*.log +*.swp +*.swo +*~ + +# Platform binary directories (populated during build) +packages/darwin-arm64/bin/ +packages/darwin-x64/bin/ +packages/linux-x64/bin/ +packages/win32-x64/bin/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..53ef8c4 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,42 @@ +# AI Agent 指引 + +> 本文件帮助 AI Agent 快速定位项目关键文件,避免阅读无关代码。 + +## 项目概述 + +`wecom-cli` 是一个企业微信 CLI 工具(Rust),通过 JSON-RPC 调用远程 MCP 服务。CLI 结构为: + +``` +wecom # 远程工具调用 +wecom + # 本地 helper(+ 前缀) +``` + +## 任务路由 + +根据任务类型,阅读对应指引文件即可,**不需要阅读其他文件**: + +| 任务 | 指引文件 | 你需要修改的文件 | +|------|----------|-----------------| +| 新建/维护现有 helper | [`src/helpers/AGENTS.md`](src/helpers/AGENTS.md) | 对应 helper 的 `.rs` 文件 | +| 理解人类的需求格式 | [`src/helpers/HUMANS.md`](src/helpers/HUMANS.md) | — | + +## 项目结构速查 + +``` +src/ +├── main.rs # CLI 入口,构建 clap Command +├── json_rpc.rs # 远程调用:call_tool(category, method, args) +├── fs_util/ # 文件系统工具(atomic_write, sanitize_filename) +├── service/ +│ └── handler.rs # 调度逻辑:helper 优先 → fallback 远程调用 +└── helpers/ # ⭐ Helper 子系统(详见 helpers/AGENTS.md) + ├── mod.rs # 模块声明 + ├── registry.rs # Helper trait + HelperRegistry + ├── AGENTS.md # AI 实现指南(核心文档) + └── / # 按 category 分目录存放 helper +``` + +## 注意事项 + +- **不要修改 `main.rs` 和 `service/` 下的文件**:helper 系统通过 registry 自动注册,无需改动调度层 +- 用户的需求描述格式参考 [`src/helpers/HUMANS.md`](src/helpers/HUMANS.md),除非用户直接声明,否则你无需阅读这篇文档 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..01fca3f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,19 @@ +# @wecom/cli + +## 0.1.9 + +### Patch Changes + +- 3700b1b: update cmds + +## 0.1.8 + +### Patch Changes + +- 7774ba3: update init process + +## 0.1.7 + +### Patch Changes + +- 83a7495: add smartsheet auto file upload helpers diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..7e43bbe --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3085 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "aws-lc-rs" +version = "1.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a054912289d18629dc78375ba2c3726a3afe3ff71b4edba9dedfca0e3446d1fc" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a25cf98105baa966497416dbd42565ce3a8cf8dbfd59803ec9ad46f3126399" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cc" +version = "1.2.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clap" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "cliclack" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd870c423d925f0257dda3ce62067e2e3b64b0e1ad29bac8affdd4b6ce938bd" +dependencies = [ + "console", + "indicatif", + "once_cell", + "strsim", + "textwrap", + "zeroize", +] + +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "console" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" +dependencies = [ + "encode_unicode", + "libc", + "unicode-width", + "windows-sys 0.61.2", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +dependencies = [ + "bitflags", + "crossterm_winapi", + "parking_lot", + "rustix 0.38.44", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "image" +version = "0.25.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7" +dependencies = [ + "bytemuck", + "byteorder-lite", + "moxcms", + "num-traits", +] + +[[package]] +name = "indexmap" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "indicatif" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25470f23803092da7d239834776d653104d551bc4d7eacaf31e6837854b8e9eb" +dependencies = [ + "console", + "portable-atomic", + "unicode-width", + "unit-prefix", + "web-time", +] + +[[package]] +name = "infer" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" +dependencies = [ + "cfb", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "iri-string" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e7418f59cc01c88316161279a7f665217ae316b388e58a0d10e29f54f1e5eb" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4c90f45aa2e6eacbe8645f77fdea542ac97a494bcd117a67df9ff4d611f995" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "keyring" +version = "3.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eebcc3aff044e5944a8fbaf69eb277d11986064cba30c468730e8b9909fb551c" +dependencies = [ + "linux-keyutils", + "log", + "security-framework 2.11.1", + "security-framework 3.7.0", + "zeroize", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" + +[[package]] +name = "libredox" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08" +dependencies = [ + "libc", +] + +[[package]] +name = "linux-keyutils" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83270a18e9f90d0707c41e9f35efada77b64c0e6f3f1810e71c8368a864d5590" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "moxcms" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac9557c559cd6fc9867e122e20d2cbefc9ca29d80d027a8e39310920ed2f0a97" +dependencies = [ + "num-traits", + "pxfm", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-conv" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "open" +version = "5.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43bb73a7fa3799b198970490a51174027ba0d4ec504b03cd08caf513d40024bc" +dependencies = [ + "is-wsl", + "libc", + "pathdiff", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pxfm" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a041e753da8b807c9255f28de81879c78c876392ff2469cde94799b2896b9d" + +[[package]] +name = "qr2term" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6867c60b38e9747a079a19614dbb5981a53f21b9a56c265f3bfdf6011a50a957" +dependencies = [ + "crossterm", + "qrcode", +] + +[[package]] +name = "qrcode" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d68782463e408eb1e668cf6152704bd856c78c5b6417adaee3203d8f4c1fc9ec" +dependencies = [ + "image", +] + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 2.0.18", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "reqwest" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.12.1", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" +dependencies = [ + "aws-lc-rs", + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework 3.7.0", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework 3.7.0", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.103.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sanitize-filename" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc984f4f9ceb736a7bb755c3e3bd17dc56370af2600c9780dcc48c66453da34d" +dependencies = [ + "regex", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix 1.1.4", + "windows-sys 0.61.2", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-appender" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786d480bce6247ab75f005b14ae1624ad978d3029d9113f0a22fa1ac773faeaf" +dependencies = [ + "crossbeam-channel", + "thiserror 2.0.18", + "time", + "tracing-subscriber", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "unit-prefix" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ac8b6f42ead25368cf5b098aeb3dc8a1a2c05a3eee8a9a1a68c640edbfc79d9" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.115" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6523d69017b7633e396a89c5efab138161ed5aafcbc8d3e5c5a42ae38f50495a" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d1faf851e778dfa54db7cd438b70758eba9755cb47403f3496edd7c8fc212f0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.115" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3a6c758eb2f701ed3d052ff5737f5bfe6614326ea7f3bbac7156192dc32e67" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.115" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "921de2737904886b52bcbb237301552d05969a6f9c40d261eb0533c8b055fedf" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.115" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a93e946af942b58934c604527337bad9ae33ba1d5c6900bbb41c2c07c2364a93" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "web-sys" +version = "0.3.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84cde8507f4d7cfcb1185b8cb5890c494ffea65edbe1ba82cfd63661c805ed94" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f18a4ac2676ffb4e8b5b5fa9ae38af06df08162314f96a68d2a363e21a8ca" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "wecom-cli" +version = "0.1.9" +dependencies = [ + "aes-gcm", + "anyhow", + "base64", + "clap", + "cliclack", + "dirs", + "dotenvy", + "hex", + "infer", + "keyring", + "mime", + "mime_guess", + "open", + "qr2term", + "qrcode", + "rand", + "reqwest", + "sanitize-filename", + "serde", + "serde_json", + "serde_repr", + "sha2", + "tempfile", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..4df1e9e --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "wecom-cli" +version = "0.1.9" +edition = "2024" +description = "The official CLI for WeCom — 企业微信命令行工具,让人类和 AI Agent 都能在终端中操作企业微信" +license = "MIT" +repository = "https://github.com/WecomTeam/wecom-cli" +homepage = "https://github.com/WecomTeam/wecom-cli" +readme = "README.md" +keywords = ["wecom", "cli", "mcp", "wechat-work"] +categories = ["command-line-utilities"] +include = ["/src/**/*", "/build.rs", "/Cargo.toml", "/Cargo.lock", "/LICENSE", "/README.md"] + +[features] +custom-endpoint = [] + +[[bin]] +name = "wecom-cli" +path = "src/main.rs" + +[dependencies] +tokio = { version = "1.50.0", features = ["full"] } +anyhow = "1" +clap = { version = "4", features = ["derive", "string"] } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +serde_repr = "0.1" +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } +tracing-appender = "0.2" +reqwest = { version = "0.13.2", default-features = false, features = ["json", "multipart", "stream", "rustls"] } +dotenvy = "0.15.7" +dirs = "6.0.0" +base64 = "0.22" +mime = "0.3" +mime_guess = "2" +infer = "0.19" +rand = "0.9" +hex = "0.4" +sha2 = "0.10" +aes-gcm = "0.10" +keyring = { version = "3", features = ["apple-native", "linux-native"] } +sanitize-filename = "0.6.0" +tempfile = "3.27.0" +cliclack = "0.5" +qr2term = "0.3" +qrcode = "0.14" +open = "5" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5130a67 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 WeCom + +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/README.md b/README.md new file mode 100644 index 0000000..9368fe7 --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +# wecom-cli + +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![Rust](https://img.shields.io/badge/rust-%3E%3D1.75-orange.svg)](https://www.rust-lang.org/) + +> 💬 扫码加入企业微信交流群: +> +> 扫码入群交流 + +企业微信命令行工具 — 让人类和 AI Agent 都能在终端中操作企业微信。 + + +## 功能范围 + +覆盖企业微信核心业务品类: + +| 品类 | 能力 | +| ----------- | ----------------------------------------------------------------------------- | +| 📄 文档 | 文档创建、读取、编辑等;智能文档创建、读取 | +| 📊 智能表格 | 智能表格创建、子表与字段管理、记录增删改查等 | +| 💬 消息 | 会话列表查询、消息记录拉取(文本/图片/文件/语音/视频)、多媒体下载、发送文本等 | +| 👤 通讯录 | 获取可见范围成员列表、按姓名/别名搜索等 | +| ✅ 待办 | 创建/读取/更新/删除待办,变更用户处理状态等 | +| 🎥 会议 | 创建预约会议、取消会议、更新受邀成员、查询列表与详情等 | +| 📅 日程 | 日程增删改查、参与人管理、多成员闲忙查询等 | + +**企业场景**: +对于 10 人以上规模的企业,企业微信为 API 模式智能机器人提供了文档和待办CLI 能力,机器人可以创建及读取文档、创建并跟进待办,提高企业场景下的办公效率。 + +**个人/小团队场景**: +对于10人及以下的个人/小团队,企业微信为API模式智能机器人提供了消息、文档、日程、会议、待办等CLI能力,以满足个人或小团队提效场景。 + +## 快速开始 + +### 前置条件 + +- 支持平台:macOS (x64/arm64)、Linux (x64/arm64) 及 Windows (x64) +- Node.js `>= 18` +- 企业微信账号 +- (可选)智能机器人 Bot ID 和 Secret,获取方式参考 [说明](https://open.work.weixin.qq.com/help2/pc/cat?doc_id=21677) + +### 安装 & 使用 + +```bash +# 安装 CLI +npm install -g @wecom/cli + +# 安装 CLI Skill(必需) +npx skills add WeComTeam/wecom-cli -y -g + +# 配置凭证(交互式,仅需一次) +wecom-cli init + +# 获取通讯录可见范围内的成员列表 +wecom-cli contact get_userlist '{}' +``` + +📖 更多使用方法,请参阅 [CLI 命令参考](docs/cli-reference.md)。 + +## Agent Skills + +🤖 支持的 Skills 使用说明,请参阅 [Skills 文档](docs/skills.md)。 + +## 许可证 + +本项目基于 [MIT 许可证](./LICENSE) 开源。 diff --git a/README.wehub.md b/README.wehub.md new file mode 100644 index 0000000..00d1314 --- /dev/null +++ b/README.wehub.md @@ -0,0 +1,7 @@ +# WeHub 来源说明 + +- 原始项目:`WecomTeam/wecom-cli` +- 原始仓库:https://github.com/WecomTeam/wecom-cli +- 导入方式:上游默认分支的最新快照 +- 原作者、版权和许可证信息以原始仓库及本仓库 LICENSE 为准 +- 本文件仅用于记录来源,不代表 WeHub 是原项目作者 diff --git a/bin/wecom.js b/bin/wecom.js new file mode 100644 index 0000000..957e11c --- /dev/null +++ b/bin/wecom.js @@ -0,0 +1,73 @@ +#!/usr/bin/env node + +import { execFileSync } from 'node:child_process'; +import { createRequire } from 'node:module'; +import os from 'node:os'; +import { join } from 'node:path'; + +const require = createRequire(import.meta.url); + +/** + * Returns the platform-specific package name based on current OS and CPU architecture. + */ +function getPlatformPackage() { + const platform = os.platform(); + const arch = os.arch(); + + const platformMap = { + 'darwin-arm64': '@wecom/cli-darwin-arm64', + 'darwin-x64': '@wecom/cli-darwin-x64', + 'linux-arm64': '@wecom/cli-linux-arm64', + 'linux-x64': '@wecom/cli-linux-x64', + 'win32-x64': '@wecom/cli-win32-x64', + }; + + const key = `${platform}-${arch}`; + const pkg = platformMap[key]; + + if (!pkg) { + console.error( + `Error: unsupported platform ${platform}-${arch}.\n` + + `Supported platforms: ${Object.keys(platformMap).join(', ')}`, + ); + process.exit(1); + } + + return pkg; +} + +/** + * Resolves the path to the platform-specific binary. + */ +function getBinaryPath() { + const pkg = getPlatformPackage(); + const binaryName = os.platform() === 'win32' ? 'wecom-cli.exe' : 'wecom-cli'; + + try { + const pkgDir = require.resolve(`${pkg}/package.json`); + return join(pkgDir, '..', 'bin', binaryName); + } catch { + console.error( + `Error: cannot find @wecom/cli binary.\n` + + `Please try reinstalling: npm install @wecom/cli\n\n` + + `If the problem persists, check:\n` + + ` 1. Your npm config does not disable optional dependencies (--no-optional)\n` + + ` 2. Your platform (${os.platform()}-${os.arch()}) is supported`, + ); + process.exit(1); + } +} + +// Execute the binary, passing through all arguments +const binaryPath = getBinaryPath(); + +try { + execFileSync(binaryPath, process.argv.slice(2), { + stdio: 'inherit', + env: process.env, + }); +} catch (error) { + if (error.status != null) { + process.exit(error.status); + } +} diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..4cf3601 --- /dev/null +++ b/build.rs @@ -0,0 +1,31 @@ +use std::path::Path; +use std::process::Command; + +fn main() { + let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); + let git_dir = Path::new(&manifest_dir).join(".git"); + + // Set up git hooks + if git_dir.exists() { + let status = Command::new("git") + .args(["config", "core.hooksPath", ".githooks"]) + .current_dir(&manifest_dir) + .status(); + + match status { + Ok(s) if !s.success() => { + println!( + "cargo:warning=⚠️ Failed to set core.hooksPath. Run `git config core.hooksPath .githooks` manually." + ); + } + Err(e) => { + println!( + "cargo:warning=⚠️ Failed to run git: {e}. Run `git config core.hooksPath .githooks` manually." + ); + } + _ => {} + } + } + + println!("cargo:rerun-if-changed=.githooks"); +} diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 0000000..4972822 --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +msrv = "1.85.0" diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..e61fdf8 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,32 @@ +export default { + extends: ['@commitlint/config-conventional'], + rules: { + // type 必须是以下之一 + 'type-enum': [ + 2, + 'always', + [ + 'feat', // 新功能 + 'fix', // 修复 bug + 'docs', // 文档变更 + 'style', // 代码格式(不影响功能) + 'refactor', // 重构(不是新功能也不是修复) + 'perf', // 性能优化 + 'test', // 测试 + 'build', // 构建系统或外部依赖 + 'ci', // CI 配置 + 'chore', // 其他杂项 + 'revert', // 回滚 + 'skills', // skills 更新 + ], + ], + // type 不能为空 + 'type-empty': [2, 'never'], + // subject 不能为空 + 'subject-empty': [2, 'never'], + // subject 最大长度 + 'subject-max-length': [2, 'always', 100], + // header 最大长度 + 'header-max-length': [2, 'always', 120], + }, +}; diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..564680f --- /dev/null +++ b/docs/README.md @@ -0,0 +1,14 @@ +# 文档中心 + +本目录是 `wecom-cli` 的长期维护文档集,用来承载安装、使用约定、Skills 导航和开发说明。根 `README.md` 保持为项目首页,不再承担所有细节参考。 + +## 从这里开始 + +- 查看 CLI 使用方法、运行时路径和环境变量:[`docs/cli-reference.md`](cli-reference.md) +- 查看内置 Skills 的分工和入口:[`docs/skills.md`](skills.md) +- 本地开发、调试和仓库结构:[`docs/development.md`](development.md) + +## 维护约定 + +- 优先把持续维护的说明写进 `docs/`。 +- 同一主题只保留一个主入口,其他页面通过链接复用。 \ No newline at end of file diff --git a/docs/cli-reference.md b/docs/cli-reference.md new file mode 100644 index 0000000..04e62e0 --- /dev/null +++ b/docs/cli-reference.md @@ -0,0 +1,85 @@ +## 使用说明 + +### 配置凭证 `init` + +交互式配置企业微信机器人凭证,加密存储到本地。仅需执行一次。 +- 若选择手动配置 Bot ID 和 Secret,获取方式[参考](https://open.work.weixin.qq.com/help2/pc/cat?doc_id=21677) +- 若选择扫码接入,需使用企业微信扫码创建绑定 + +```bash +wecom-cli init +``` + +### 查看帮助 `--help` +支持获取各级命令的使用方式 + +```bash +# 列出所有支持的命令和品类 +wecom-cli --help + +# 列出指定品类下的所有工具 +wecom-cli --help + +# 列出指定工具的所需要的输入 +wecom-cli --help +``` + +说明: +- 分类工具列表和工具 schema 都需要动态获取,因此“查看帮助”需要凭证与网络。 + +### 调用工具 + +通用格式: + +```bash +wecom-cli [json_args] +``` +其中 `category` 为业务品类标识,支持以下值: + +| category | 品类 | +| ---------- | ------------- | +| `contact` | 通讯录 | +| `doc` | 文档/智能表格 | +| `meeting` | 会议 | +| `msg` | 消息 | +| `schedule` | 日程 | +| `todo` | 待办 | + +工具调用行为: +- `wecom-cli ` 获取该品类下的支持调用工具 +- `wecom-cli --help` 获取该指定工具的参数定义 +- `wecom-cli ` 执行调用工具并指定参数为'{}' +- `wecom-cli 'json_args'` 执行该工具调用 + +示例: +```bash +## 调用工具 — 获取通讯录可见范围内的成员列表 +wecom-cli contact get_userlist '{}' + +## 调用工具 — 创建文档 +wecom-cli doc create_doc '{"doc_type": 3, "doc_name": "项目周报"}' +``` + +补充说明: +- 工具调用默认超时为 30 秒;`get_msg_media` 超时为 120 秒。 +- `get_msg_media`会把媒体文件下载到本地临时目录,返回结果字段`local_path`为文件保存的路径 。 + + +## 运行时路径 + +| 项目 | 默认位置 | 备注 | +| --- | --- | --- | +| 配置目录 | `~/.config/wecom` | 可由 `WECOM_CLI_CONFIG_DIR` 覆盖 | +| 机器人凭证 | `/bot.enc` | 配置凭证时创建 | +| MCP 配置缓存 | `/mcp_config.enc` | 配置凭证后更新 | +| 媒体临时目录 | `/wecom/media` | 可由 `WECOM_CLI_TMP_DIR` 覆盖根目录 | + +## 环境变量 + +| 变量 | 作用 | +| --- | --- | +| `WECOM_CLI_CONFIG_DIR` | 覆盖默认配置目录 | +| `WECOM_CLI_TMP_DIR` | 覆盖媒体临时目录的根目录 | +| `WECOM_CLI_LOG_LEVEL` | 打开 stderr 日志并设置过滤级别 | +| `WECOM_CLI_LOG_FILE` | 打开 JSON 日志输出,按天写入 `ww.log` | +| `WECOM_CLI_MCP_CONFIG_ENDPOINT` | 覆盖默认 MCP 配置接口地址 | diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 0000000..9fc0cfc --- /dev/null +++ b/docs/development.md @@ -0,0 +1,24 @@ +# 开发说明 + +这页面向仓库维护者和贡献者,记录源码结构、常用本地命令和打包边界。 + +## 仓库结构 + +| 路径 | 说明 | +| --- | --- | +| `src/` | Rust CLI 主实现,包括命令解析、认证、JSON-RPC、日志和媒体处理 | +| `bin/wecom.js` | npm 入口脚本,负责定位并执行当前平台的二进制 | +| `packages/*` | 各平台的 npm 二进制包 | +| `skills/*` | Agent Skills 及其补充参考资料 | +| `docs/` | 持续维护的使用与开发文档 | +| `README.md` | 项目首页 | + +## 本地开发 + +仓库的 Rust crate 使用 `edition = "2024"`,开发时建议使用较新的 stable Rust 工具链。 + +说明: + +- 根包名为 `@wecom/cli`,实际可执行入口是 `bin/wecom.js`。 +- 平台二进制通过 `optionalDependencies` 分发,位于 `packages/*`。 +- `pnpm-workspace.yaml` 当前只管理 `packages/*` 工作区。 \ No newline at end of file diff --git a/docs/skills.md b/docs/skills.md new file mode 100644 index 0000000..aaf21a9 --- /dev/null +++ b/docs/skills.md @@ -0,0 +1,16 @@ +# Skills 导航 + +仓库当前内置 Agent Skills,位于 `skills/` 目录下。这里负责给出分类和入口;每个 Skill 的具体工作流、参数示例和补充参考仍以各自的 `SKILL.md` 为准。 + +## Agent Skills + +内置 Agent Skills 列表,可被 AI 工具直接调用: + +| Skill | 品类 | 说明 | +| ----- | ---- | ---- | +| `wecomcli-contact` | contact | 查询通讯录成员 | +| `wecomcli-todo` | todo | 待办列表查询、查询待办详情、创建待办、更新待办、删除待办、变更待办状态 | +| `wecomcli-meeting` | meeting | 创建预约会议、取消会议、更新参会成员、查询会议列表和详情 | +| `wecomcli-msg` | msg | 查询会话列表、查询会话的消息记录、下载会话中的媒体文件、发送文本消息 | +| `wecomcli-schedule` | schedule | 查询日程列表、查询日程详情、取消日程、管理日程参与人、查询用户日程闲忙状态 | +| `wecomcli-doc` | doc | 创建文档、覆盖写文档、读取文档内容、管理智能表格子表与字段、增删改查智能表行记录 | \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..d5501e1 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,21 @@ +import eslint from '@eslint/js'; +import globals from 'globals'; +import prettier from 'eslint-plugin-prettier/recommended'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + eslint.configs.recommended, + ...tseslint.configs.recommended, + prettier, + { + ignores: ['node_modules/', 'packages/*/bin/', 'target/'], + }, + { + files: ['**/*.{js,ts}'], + languageOptions: { + globals: { + ...globals.node, + }, + }, + }, +); diff --git a/package.json b/package.json new file mode 100644 index 0000000..d076036 --- /dev/null +++ b/package.json @@ -0,0 +1,48 @@ +{ + "name": "@wecom/cli", + "version": "0.1.9", + "description": "The official CLI for WeCom", + "keywords": [ + "wecom-cli", + "mcp" + ], + "homepage": "https://github.com/WecomTeam/wecom-cli#readme", + "bugs": { + "url": "https://github.com/WecomTeam/wecom-cli/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/WecomTeam/wecom-cli.git" + }, + "license": "MIT", + "type": "module", + "bin": { + "wecom-cli": "./bin/wecom.js" + }, + "files": [ + "bin", + "README.md" + ], + "scripts": { + "prepare": "git config core.hooksPath .githooks" + }, + "devDependencies": { + "@changesets/cli": "^2.30.0", + "@commitlint/cli": "^20.5.0", + "@commitlint/config-conventional": "^20.5.0", + "@eslint/js": "^10.0.1", + "@tsconfig/node-lts": "^24.0.0", + "@types/node": "^25.5.0", + "eslint": "^10.1.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-prettier": "^5.5.5", + "globals": "^17.4.0", + "prettier": "^3.8.1", + "typescript": "^5.8.3", + "typescript-eslint": "^8.57.2" + }, + "packageManager": "pnpm@10.32.1", + "engines": { + "node": ">=18" + } +} diff --git a/packages/darwin-arm64/CHANGELOG.md b/packages/darwin-arm64/CHANGELOG.md new file mode 100644 index 0000000..05ccb3f --- /dev/null +++ b/packages/darwin-arm64/CHANGELOG.md @@ -0,0 +1,15 @@ +# @wecom/cli-darwin-arm64 + +## 0.1.9 + +### Patch Changes + +- 3700b1b: update cmds + +## 0.1.8 + +### Patch Changes + +- 7774ba3: update init process + +## 0.1.7 diff --git a/packages/darwin-arm64/LICENSE b/packages/darwin-arm64/LICENSE new file mode 100644 index 0000000..5130a67 --- /dev/null +++ b/packages/darwin-arm64/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 WeCom + +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/packages/darwin-arm64/README.md b/packages/darwin-arm64/README.md new file mode 100644 index 0000000..3098d41 --- /dev/null +++ b/packages/darwin-arm64/README.md @@ -0,0 +1,27 @@ +# @wecom/cli-darwin-arm64 + +Platform-specific binary package for **macOS ARM64 (Apple Silicon)**. + +## About + +This package contains the pre-built `wecom-cli` binary for macOS on Apple Silicon (M1/M2/M3/M4) architecture. + +**You should not install this package directly.** It is automatically installed as an optional dependency of [`@wecom/cli`](https://www.npmjs.com/package/@wecom/cli) when running on a compatible platform. + +## Supported Platform + +| OS | CPU | +|--------|-------| +| macOS | arm64 | + +## Usage + +Install the main package instead: + +```bash +npm install -g @wecom/cli +``` + +## License + +MIT diff --git a/packages/darwin-arm64/package.json b/packages/darwin-arm64/package.json new file mode 100644 index 0000000..56d8648 --- /dev/null +++ b/packages/darwin-arm64/package.json @@ -0,0 +1,19 @@ +{ + "name": "@wecom/cli-darwin-arm64", + "version": "0.1.9", + "description": "The darwin-arm64 binary for @wecom/cli", + "license": "MIT", + "files": [ + "bin", + "README.md" + ], + "engines": { + "node": ">=18" + }, + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ] +} diff --git a/packages/darwin-x64/CHANGELOG.md b/packages/darwin-x64/CHANGELOG.md new file mode 100644 index 0000000..4d9b1e7 --- /dev/null +++ b/packages/darwin-x64/CHANGELOG.md @@ -0,0 +1,15 @@ +# @wecom/cli-darwin-x64 + +## 0.1.9 + +### Patch Changes + +- 3700b1b: update cmds + +## 0.1.8 + +### Patch Changes + +- 7774ba3: update init process + +## 0.1.7 diff --git a/packages/darwin-x64/LICENSE b/packages/darwin-x64/LICENSE new file mode 100644 index 0000000..5130a67 --- /dev/null +++ b/packages/darwin-x64/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 WeCom + +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/packages/darwin-x64/README.md b/packages/darwin-x64/README.md new file mode 100644 index 0000000..b4f9401 --- /dev/null +++ b/packages/darwin-x64/README.md @@ -0,0 +1,27 @@ +# @wecom/cli-darwin-x64 + +Platform-specific binary package for **macOS x64 (Intel)**. + +## About + +This package contains the pre-built `wecom-cli` binary for macOS on Intel x64 architecture. + +**You should not install this package directly.** It is automatically installed as an optional dependency of [`@wecom/cli`](https://www.npmjs.com/package/@wecom/cli) when running on a compatible platform. + +## Supported Platform + +| OS | CPU | +|--------|-----| +| macOS | x64 | + +## Usage + +Install the main package instead: + +```bash +npm install -g @wecom/cli +``` + +## License + +MIT diff --git a/packages/darwin-x64/package.json b/packages/darwin-x64/package.json new file mode 100644 index 0000000..595ceca --- /dev/null +++ b/packages/darwin-x64/package.json @@ -0,0 +1,19 @@ +{ + "name": "@wecom/cli-darwin-x64", + "version": "0.1.9", + "description": "The darwin-x64 binary for @wecom/cli", + "license": "MIT", + "files": [ + "bin", + "README.md" + ], + "engines": { + "node": ">=18" + }, + "os": [ + "darwin" + ], + "cpu": [ + "x64" + ] +} diff --git a/packages/linux-arm64/CHANGELOG.md b/packages/linux-arm64/CHANGELOG.md new file mode 100644 index 0000000..6e7d52a --- /dev/null +++ b/packages/linux-arm64/CHANGELOG.md @@ -0,0 +1,15 @@ +# @wecom/cli-linux-arm64 + +## 0.1.9 + +### Patch Changes + +- 3700b1b: update cmds + +## 0.1.8 + +### Patch Changes + +- 7774ba3: update init process + +## 0.1.7 diff --git a/packages/linux-arm64/LICENSE b/packages/linux-arm64/LICENSE new file mode 100644 index 0000000..5130a67 --- /dev/null +++ b/packages/linux-arm64/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 WeCom + +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/packages/linux-arm64/README.md b/packages/linux-arm64/README.md new file mode 100644 index 0000000..52f4284 --- /dev/null +++ b/packages/linux-arm64/README.md @@ -0,0 +1,27 @@ +# @wecom/cli-linux-arm64 + +Platform-specific binary package for **Linux ARM64 (aarch64)**. + +## About + +This package contains the pre-built `wecom-cli` binary for Linux on ARM64 (aarch64) architecture. + +**You should not install this package directly.** It is automatically installed as an optional dependency of [`@wecom/cli`](https://www.npmjs.com/package/@wecom/cli) when running on a compatible platform. + +## Supported Platform + +| OS | CPU | +|-------|-------| +| Linux | arm64 | + +## Usage + +Install the main package instead: + +```bash +npm install -g @wecom/cli +``` + +## License + +MIT diff --git a/packages/linux-arm64/package.json b/packages/linux-arm64/package.json new file mode 100644 index 0000000..90d8c38 --- /dev/null +++ b/packages/linux-arm64/package.json @@ -0,0 +1,19 @@ +{ + "name": "@wecom/cli-linux-arm64", + "version": "0.1.9", + "description": "The linux-arm64 binary for @wecom/cli", + "license": "MIT", + "files": [ + "bin", + "README.md" + ], + "engines": { + "node": ">=18" + }, + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ] +} diff --git a/packages/linux-x64/CHANGELOG.md b/packages/linux-x64/CHANGELOG.md new file mode 100644 index 0000000..8227381 --- /dev/null +++ b/packages/linux-x64/CHANGELOG.md @@ -0,0 +1,15 @@ +# @wecom/cli-linux-x64 + +## 0.1.9 + +### Patch Changes + +- 3700b1b: update cmds + +## 0.1.8 + +### Patch Changes + +- 7774ba3: update init process + +## 0.1.7 diff --git a/packages/linux-x64/LICENSE b/packages/linux-x64/LICENSE new file mode 100644 index 0000000..5130a67 --- /dev/null +++ b/packages/linux-x64/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 WeCom + +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/packages/linux-x64/README.md b/packages/linux-x64/README.md new file mode 100644 index 0000000..3e9bec1 --- /dev/null +++ b/packages/linux-x64/README.md @@ -0,0 +1,27 @@ +# @wecom/cli-linux-x64 + +Platform-specific binary package for **Linux x64**. + +## About + +This package contains the pre-built `wecom-cli` binary for Linux on x64 architecture. + +**You should not install this package directly.** It is automatically installed as an optional dependency of [`@wecom/cli`](https://www.npmjs.com/package/@wecom/cli) when running on a compatible platform. + +## Supported Platform + +| OS | CPU | +|-------|-----| +| Linux | x64 | + +## Usage + +Install the main package instead: + +```bash +npm install -g @wecom/cli +``` + +## License + +MIT diff --git a/packages/linux-x64/package.json b/packages/linux-x64/package.json new file mode 100644 index 0000000..745a822 --- /dev/null +++ b/packages/linux-x64/package.json @@ -0,0 +1,19 @@ +{ + "name": "@wecom/cli-linux-x64", + "version": "0.1.9", + "description": "The linux-x64 binary for @wecom/cli", + "license": "MIT", + "files": [ + "bin", + "README.md" + ], + "engines": { + "node": ">=18" + }, + "os": [ + "linux" + ], + "cpu": [ + "x64" + ] +} diff --git a/packages/win32-x64/CHANGELOG.md b/packages/win32-x64/CHANGELOG.md new file mode 100644 index 0000000..1554814 --- /dev/null +++ b/packages/win32-x64/CHANGELOG.md @@ -0,0 +1,15 @@ +# @wecom/cli-win32-x64 + +## 0.1.9 + +### Patch Changes + +- 3700b1b: update cmds + +## 0.1.8 + +### Patch Changes + +- 7774ba3: update init process + +## 0.1.7 diff --git a/packages/win32-x64/LICENSE b/packages/win32-x64/LICENSE new file mode 100644 index 0000000..5130a67 --- /dev/null +++ b/packages/win32-x64/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 WeCom + +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/packages/win32-x64/README.md b/packages/win32-x64/README.md new file mode 100644 index 0000000..069869a --- /dev/null +++ b/packages/win32-x64/README.md @@ -0,0 +1,27 @@ +# @wecom/cli-win32-x64 + +Platform-specific binary package for **Windows x64**. + +## About + +This package contains the pre-built `wecom-cli.exe` binary for Windows on x64 architecture. + +**You should not install this package directly.** It is automatically installed as an optional dependency of [`@wecom/cli`](https://www.npmjs.com/package/@wecom/cli) when running on a compatible platform. + +## Supported Platform + +| OS | CPU | +|---------|-----| +| Windows | x64 | + +## Usage + +Install the main package instead: + +```bash +npm install -g @wecom/cli +``` + +## License + +MIT diff --git a/packages/win32-x64/package.json b/packages/win32-x64/package.json new file mode 100644 index 0000000..d561fdc --- /dev/null +++ b/packages/win32-x64/package.json @@ -0,0 +1,19 @@ +{ + "name": "@wecom/cli-win32-x64", + "version": "0.1.9", + "description": "The win32-x64 binary for @wecom/cli", + "license": "MIT", + "files": [ + "bin", + "README.md" + ], + "engines": { + "node": ">=18" + }, + "os": [ + "win32" + ], + "cpu": [ + "x64" + ] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..23dd90f --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,2244 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@changesets/cli': + specifier: ^2.30.0 + version: 2.30.0(@types/node@25.5.0) + '@commitlint/cli': + specifier: ^20.5.0 + version: 20.5.0(@types/node@25.5.0)(conventional-commits-parser@6.4.0)(typescript@5.8.3) + '@commitlint/config-conventional': + specifier: ^20.5.0 + version: 20.5.0 + '@eslint/js': + specifier: ^10.0.1 + version: 10.0.1(eslint@10.1.0(jiti@2.6.1)) + '@tsconfig/node-lts': + specifier: ^24.0.0 + version: 24.0.0 + '@types/node': + specifier: ^25.5.0 + version: 25.5.0 + eslint: + specifier: ^10.1.0 + version: 10.1.0(jiti@2.6.1) + eslint-config-prettier: + specifier: ^10.1.8 + version: 10.1.8(eslint@10.1.0(jiti@2.6.1)) + eslint-plugin-prettier: + specifier: ^5.5.5 + version: 5.5.5(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint@10.1.0(jiti@2.6.1))(prettier@3.8.1) + globals: + specifier: ^17.4.0 + version: 17.4.0 + prettier: + specifier: ^3.8.1 + version: 3.8.1 + typescript: + specifier: ^5.8.3 + version: 5.8.3 + typescript-eslint: + specifier: ^8.57.2 + version: 8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3) + + packages/darwin-arm64: {} + + packages/darwin-x64: {} + + packages/linux-arm64: {} + + packages/linux-x64: {} + + packages/win32-x64: {} + +packages: + + '@babel/code-frame@7.29.0': + resolution: {integrity: sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.28.5': + resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} + engines: {node: '>=6.9.0'} + + '@babel/runtime@7.29.2': + resolution: {integrity: sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==} + engines: {node: '>=6.9.0'} + + '@changesets/apply-release-plan@7.1.0': + resolution: {integrity: sha512-yq8ML3YS7koKQ/9bk1PqO0HMzApIFNwjlwCnwFEXMzNe8NpzeeYYKCmnhWJGkN8g7E51MnWaSbqRcTcdIxUgnQ==} + + '@changesets/assemble-release-plan@6.0.9': + resolution: {integrity: sha512-tPgeeqCHIwNo8sypKlS3gOPmsS3wP0zHt67JDuL20P4QcXiw/O4Hl7oXiuLnP9yg+rXLQ2sScdV1Kkzde61iSQ==} + + '@changesets/changelog-git@0.2.1': + resolution: {integrity: sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==} + + '@changesets/cli@2.30.0': + resolution: {integrity: sha512-5D3Nk2JPqMI1wK25pEymeWRSlSMdo5QOGlyfrKg0AOufrUcjEE3RQgaCpHoBiM31CSNrtSgdJ0U6zL1rLDDfBA==} + hasBin: true + + '@changesets/config@3.1.3': + resolution: {integrity: sha512-vnXjcey8YgBn2L1OPWd3ORs0bGC4LoYcK/ubpgvzNVr53JXV5GiTVj7fWdMRsoKUH7hhhMAQnsJUqLr21EncNw==} + + '@changesets/errors@0.2.0': + resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} + + '@changesets/get-dependents-graph@2.1.3': + resolution: {integrity: sha512-gphr+v0mv2I3Oxt19VdWRRUxq3sseyUpX9DaHpTUmLj92Y10AGy+XOtV+kbM6L/fDcpx7/ISDFK6T8A/P3lOdQ==} + + '@changesets/get-release-plan@4.0.15': + resolution: {integrity: sha512-Q04ZaRPuEVZtA+auOYgFaVQQSA98dXiVe/yFaZfY7hoSmQICHGvP0TF4u3EDNHWmmCS4ekA/XSpKlSM2PyTS2g==} + + '@changesets/get-version-range-type@0.4.0': + resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} + + '@changesets/git@3.0.4': + resolution: {integrity: sha512-BXANzRFkX+XcC1q/d27NKvlJ1yf7PSAgi8JG6dt8EfbHFHi4neau7mufcSca5zRhwOL8j9s6EqsxmT+s+/E6Sw==} + + '@changesets/logger@0.1.1': + resolution: {integrity: sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg==} + + '@changesets/parse@0.4.3': + resolution: {integrity: sha512-ZDmNc53+dXdWEv7fqIUSgRQOLYoUom5Z40gmLgmATmYR9NbL6FJJHwakcCpzaeCy+1D0m0n7mT4jj2B/MQPl7A==} + + '@changesets/pre@2.0.2': + resolution: {integrity: sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==} + + '@changesets/read@0.6.7': + resolution: {integrity: sha512-D1G4AUYGrBEk8vj8MGwf75k9GpN6XL3wg8i42P2jZZwFLXnlr2Pn7r9yuQNbaMCarP7ZQWNJbV6XLeysAIMhTA==} + + '@changesets/should-skip-package@0.1.2': + resolution: {integrity: sha512-qAK/WrqWLNCP22UDdBTMPH5f41elVDlsNyat180A33dWxuUDyNpg6fPi/FyTZwRriVjg0L8gnjJn2F9XAoF0qw==} + + '@changesets/types@4.1.0': + resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} + + '@changesets/types@6.1.0': + resolution: {integrity: sha512-rKQcJ+o1nKNgeoYRHKOS07tAMNd3YSN0uHaJOZYjBAgxfV7TUE7JE+z4BzZdQwb5hKaYbayKN5KrYV7ODb2rAA==} + + '@changesets/write@0.4.0': + resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} + + '@commitlint/cli@20.5.0': + resolution: {integrity: sha512-yNkyN/tuKTJS3wdVfsZ2tXDM4G4Gi7z+jW54Cki8N8tZqwKBltbIvUUrSbT4hz1bhW/h0CdR+5sCSpXD+wMKaQ==} + engines: {node: '>=v18'} + hasBin: true + + '@commitlint/config-conventional@20.5.0': + resolution: {integrity: sha512-t3Ni88rFw1XMa4nZHgOKJ8fIAT9M2j5TnKyTqJzsxea7FUetlNdYFus9dz+MhIRZmc16P0PPyEfh6X2d/qw8SA==} + engines: {node: '>=v18'} + + '@commitlint/config-validator@20.5.0': + resolution: {integrity: sha512-T/Uh6iJUzyx7j35GmHWdIiGRQB+ouZDk0pwAaYq4SXgB54KZhFdJ0vYmxiW6AMYICTIWuyMxDBl1jK74oFp/Gw==} + engines: {node: '>=v18'} + + '@commitlint/ensure@20.5.0': + resolution: {integrity: sha512-IpHqAUesBeW1EDDdjzJeaOxU9tnogLAyXLRBn03SHlj1SGENn2JGZqSWGkFvBJkJzfXAuCNtsoYzax+ZPS+puw==} + engines: {node: '>=v18'} + + '@commitlint/execute-rule@20.0.0': + resolution: {integrity: sha512-xyCoOShoPuPL44gVa+5EdZsBVao/pNzpQhkzq3RdtlFdKZtjWcLlUFQHSWBuhk5utKYykeJPSz2i8ABHQA+ZZw==} + engines: {node: '>=v18'} + + '@commitlint/format@20.5.0': + resolution: {integrity: sha512-TI9EwFU/qZWSK7a5qyXMpKPPv3qta7FO4tKW+Wt2al7sgMbLWTsAcDpX1cU8k16TRdsiiet9aOw0zpvRXNJu7Q==} + engines: {node: '>=v18'} + + '@commitlint/is-ignored@20.5.0': + resolution: {integrity: sha512-JWLarAsurHJhPozbuAH6GbP4p/hdOCoqS9zJMfqwswne+/GPs5V0+rrsfOkP68Y8PSLphwtFXV0EzJ+GTXTTGg==} + engines: {node: '>=v18'} + + '@commitlint/lint@20.5.0': + resolution: {integrity: sha512-jiM3hNUdu04jFBf1VgPdjtIPvbuVfDTBAc6L98AWcoLjF5sYqkulBHBzlVWll4rMF1T5zeQFB6r//a+s+BBKlA==} + engines: {node: '>=v18'} + + '@commitlint/load@20.5.0': + resolution: {integrity: sha512-sLhhYTL/KxeOTZjjabKDhwidGZan84XKK1+XFkwDYL/4883kIajcz/dZFAhBJmZPtL8+nBx6bnkzA95YxPeDPw==} + engines: {node: '>=v18'} + + '@commitlint/message@20.4.3': + resolution: {integrity: sha512-6akwCYrzcrFcTYz9GyUaWlhisY4lmQ3KvrnabmhoeAV8nRH4dXJAh4+EUQ3uArtxxKQkvxJS78hNX2EU3USgxQ==} + engines: {node: '>=v18'} + + '@commitlint/parse@20.5.0': + resolution: {integrity: sha512-SeKWHBMk7YOTnnEWUhx+d1a9vHsjjuo6Uo1xRfPNfeY4bdYFasCH1dDpAv13Lyn+dDPOels+jP6D2GRZqzc5fA==} + engines: {node: '>=v18'} + + '@commitlint/read@20.5.0': + resolution: {integrity: sha512-JDEIJ2+GnWpK8QqwfmW7O42h0aycJEWNqcdkJnyzLD11nf9dW2dWLTVEa8Wtlo4IZFGLPATjR5neA5QlOvIH1w==} + engines: {node: '>=v18'} + + '@commitlint/resolve-extends@20.5.0': + resolution: {integrity: sha512-3SHPWUW2v0tyspCTcfSsYml0gses92l6TlogwzvM2cbxDgmhSRc+fldDjvGkCXJrjSM87BBaWYTPWwwyASZRrg==} + engines: {node: '>=v18'} + + '@commitlint/rules@20.5.0': + resolution: {integrity: sha512-5NdQXQEdnDPT5pK8O39ZA7HohzPRHEsDGU23cyVCNPQy4WegAbAwrQk3nIu7p2sl3dutPk8RZd91yKTrMTnRkQ==} + engines: {node: '>=v18'} + + '@commitlint/to-lines@20.0.0': + resolution: {integrity: sha512-2l9gmwiCRqZNWgV+pX1X7z4yP0b3ex/86UmUFgoRt672Ez6cAM2lOQeHFRUTuE6sPpi8XBCGnd8Kh3bMoyHwJw==} + engines: {node: '>=v18'} + + '@commitlint/top-level@20.4.3': + resolution: {integrity: sha512-qD9xfP6dFg5jQ3NMrOhG0/w5y3bBUsVGyJvXxdWEwBm8hyx4WOk3kKXw28T5czBYvyeCVJgJJ6aoJZUWDpaacQ==} + engines: {node: '>=v18'} + + '@commitlint/types@20.5.0': + resolution: {integrity: sha512-ZJoS8oSq2CAZEpc/YI9SulLrdiIyXeHb/OGqGrkUP6Q7YV+0ouNAa7GjqRdXeQPncHQIDz/jbCTlHScvYvO/gA==} + engines: {node: '>=v18'} + + '@conventional-changelog/git-client@2.6.0': + resolution: {integrity: sha512-T+uPDciKf0/ioNNDpMGc8FDsehJClZP0yR3Q5MN6wE/Y/1QZ7F+80OgznnTCOlMEG4AV0LvH2UJi3C/nBnaBUg==} + engines: {node: '>=18'} + peerDependencies: + conventional-commits-filter: ^5.0.0 + conventional-commits-parser: ^6.3.0 + peerDependenciesMeta: + conventional-commits-filter: + optional: true + conventional-commits-parser: + optional: true + + '@eslint-community/eslint-utils@4.9.1': + resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.12.2': + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@eslint/config-array@0.23.3': + resolution: {integrity: sha512-j+eEWmB6YYLwcNOdlwQ6L2OsptI/LO6lNBuLIqe5R7RetD658HLoF+Mn7LzYmAWWNNzdC6cqP+L6r8ujeYXWLw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/config-helpers@0.5.3': + resolution: {integrity: sha512-lzGN0onllOZCGroKJmRwY6QcEHxbjBw1gwB8SgRSqK8YbbtEXMvKynsXc3553ckIEBxsbMBU7oOZXKIPGZNeZw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/core@1.1.1': + resolution: {integrity: sha512-QUPblTtE51/7/Zhfv8BDwO0qkkzQL7P/aWWbqcf4xWLEYn1oKjdO0gglQBB4GAsu7u6wjijbCmzsUTy6mnk6oQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/js@10.0.1': + resolution: {integrity: sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: ^10.0.0 + peerDependenciesMeta: + eslint: + optional: true + + '@eslint/object-schema@3.0.3': + resolution: {integrity: sha512-iM869Pugn9Nsxbh/YHRqYiqd23AmIbxJOcpUMOuWCVNdoQJ5ZtwL6h3t0bcZzJUlC3Dq9jCFCESBZnX0GTv7iQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/plugin-kit@0.6.1': + resolution: {integrity: sha512-iH1B076HoAshH1mLpHMgwdGeTs0CYwL0SPMkGuSebZrwBp16v415e9NZXg2jtrqPVQjf6IANe2Vtlr5KswtcZQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@humanfs/core@0.19.1': + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.7': + resolution: {integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==} + engines: {node: '>=18.18.0'} + + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/retry@0.4.3': + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} + engines: {node: '>=18.18'} + + '@inquirer/external-editor@1.0.3': + resolution: {integrity: sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@manypkg/find-root@1.1.0': + resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} + + '@manypkg/get-packages@1.1.3': + resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} + + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@pkgr/core@0.2.9': + resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + + '@simple-libs/child-process-utils@1.0.2': + resolution: {integrity: sha512-/4R8QKnd/8agJynkNdJmNw2MBxuFTRcNFnE5Sg/G+jkSsV8/UBgULMzhizWWW42p8L5H7flImV2ATi79Ove2Tw==} + engines: {node: '>=18'} + + '@simple-libs/stream-utils@1.2.0': + resolution: {integrity: sha512-KxXvfapcixpz6rVEB6HPjOUZT22yN6v0vI0urQSk1L8MlEWPDFCZkhw2xmkyoTGYeFw7tWTZd7e3lVzRZRN/EA==} + engines: {node: '>=18'} + + '@tsconfig/node-lts@24.0.0': + resolution: {integrity: sha512-8mSTqWwCd6aQpvxSrpQlMoA9RiUZSs7bYhL5qsLXIIaN9HQaINeoydrRu/Y7/fws4bvfuyhs0BRnW9/NI8tySg==} + + '@types/esrecurse@4.3.1': + resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} + + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/node@12.20.55': + resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + + '@types/node@25.5.0': + resolution: {integrity: sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==} + + '@typescript-eslint/eslint-plugin@8.57.2': + resolution: {integrity: sha512-NZZgp0Fm2IkD+La5PR81sd+g+8oS6JwJje+aRWsDocxHkjyRw0J5L5ZTlN3LI1LlOcGL7ph3eaIUmTXMIjLk0w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@typescript-eslint/parser': ^8.57.2 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/parser@8.57.2': + resolution: {integrity: sha512-30ScMRHIAD33JJQkgfGW1t8CURZtjc2JpTrq5n2HFhOefbAhb7ucc7xJwdWcrEtqUIYJ73Nybpsggii6GtAHjA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/project-service@8.57.2': + resolution: {integrity: sha512-FuH0wipFywXRTHf+bTTjNyuNQQsQC3qh/dYzaM4I4W0jrCqjCVuUh99+xd9KamUfmCGPvbO8NDngo/vsnNVqgw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/scope-manager@8.57.2': + resolution: {integrity: sha512-snZKH+W4WbWkrBqj4gUNRIGb/jipDW3qMqVJ4C9rzdFc+wLwruxk+2a5D+uoFcKPAqyqEnSb4l2ULuZf95eSkw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/tsconfig-utils@8.57.2': + resolution: {integrity: sha512-3Lm5DSM+DCowsUOJC+YqHHnKEfFh5CoGkj5Z31NQSNF4l5wdOwqGn99wmwN/LImhfY3KJnmordBq/4+VDe2eKw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/type-utils@8.57.2': + resolution: {integrity: sha512-Co6ZCShm6kIbAM/s+oYVpKFfW7LBc6FXoPXjTRQ449PPNBY8U0KZXuevz5IFuuUj2H9ss40atTaf9dlGLzbWZg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/types@8.57.2': + resolution: {integrity: sha512-/iZM6FnM4tnx9csuTxspMW4BOSegshwX5oBDznJ7S4WggL7Vczz5d2W11ecc4vRrQMQHXRSxzrCsyG5EsPPTbA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@8.57.2': + resolution: {integrity: sha512-2MKM+I6g8tJxfSmFKOnHv2t8Sk3T6rF20A1Puk0svLK+uVapDZB/4pfAeB7nE83uAZrU6OxW+HmOd5wHVdXwXA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/utils@8.57.2': + resolution: {integrity: sha512-krRIbvPK1ju1WBKIefiX+bngPs+odIQUtR7kymzPfo1POVw3jlF+nLkmexdSSd4UCbDcQn+wMBATOOmpBbqgKg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/visitor-keys@8.57.2': + resolution: {integrity: sha512-zhahknjobV2FiD6Ee9iLbS7OV9zi10rG26odsQdfBO/hjSzUQbkIYgda+iNKK1zNiW2ey+Lf8MU5btN17V3dUw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + engines: {node: '>=0.4.0'} + hasBin: true + + ajv@6.14.0: + resolution: {integrity: sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==} + + ajv@8.18.0: + resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} + + ansi-colors@4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + + array-ify@1.0.0: + resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} + + array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + + better-path-resolve@1.0.0: + resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} + engines: {node: '>=4'} + + brace-expansion@5.0.5: + resolution: {integrity: sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==} + engines: {node: 18 || 20 || >=22} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + + chardet@2.1.1: + resolution: {integrity: sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==} + + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + compare-func@2.0.0: + resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} + + conventional-changelog-angular@8.3.1: + resolution: {integrity: sha512-6gfI3otXK5Ph5DfCOI1dblr+kN3FAm5a97hYoQkqNZxOaYa5WKfXH+AnpsmS+iUH2mgVC2Cg2Qw9m5OKcmNrIg==} + engines: {node: '>=18'} + + conventional-changelog-conventionalcommits@9.3.1: + resolution: {integrity: sha512-dTYtpIacRpcZgrvBYvBfArMmK2xvIpv2TaxM0/ZI5CBtNUzvF2x0t15HsbRABWprS6UPmvj+PzHVjSx4qAVKyw==} + engines: {node: '>=18'} + + conventional-commits-parser@6.4.0: + resolution: {integrity: sha512-tvRg7FIBNlyPzjdG8wWRlPHQJJHI7DylhtRGeU9Lq+JuoPh5BKpPRX83ZdLrvXuOSu5Eo/e7SzOQhU4Hd2Miuw==} + engines: {node: '>=18'} + hasBin: true + + cosmiconfig-typescript-loader@6.2.0: + resolution: {integrity: sha512-GEN39v7TgdxgIoNcdkRE3uiAzQt3UXLyHbRHD6YoL048XAeOomyxaP+Hh/+2C6C2wYjxJ2onhJcsQp+L4YEkVQ==} + engines: {node: '>=v18'} + peerDependencies: + '@types/node': '*' + cosmiconfig: '>=9' + typescript: '>=5' + + cosmiconfig@9.0.1: + resolution: {integrity: sha512-hr4ihw+DBqcvrsEDioRO31Z17x71pUYoNe/4h6Z0wB72p7MU7/9gH8Q3s12NFhHPfYBBOV3qyfUxmr/Yn3shnQ==} + engines: {node: '>=14'} + peerDependencies: + typescript: '>=4.9.5' + peerDependenciesMeta: + typescript: + optional: true + + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + detect-indent@6.1.0: + resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} + engines: {node: '>=8'} + + dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + + dot-prop@5.3.0: + resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} + engines: {node: '>=8'} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + enquirer@2.4.1: + resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} + engines: {node: '>=8.6'} + + env-paths@2.2.1: + resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} + engines: {node: '>=6'} + + error-ex@1.3.4: + resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + eslint-config-prettier@10.1.8: + resolution: {integrity: sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==} + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + + eslint-plugin-prettier@5.5.5: + resolution: {integrity: sha512-hscXkbqUZ2sPithAuLm5MXL+Wph+U7wHngPBv9OMWwlP8iaflyxpjTYZkmdgB4/vPIhemRlBEoLrH7UC1n7aUw==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + '@types/eslint': '>=8.0.0' + eslint: '>=8.0.0' + eslint-config-prettier: '>= 7.0.0 <10.0.0 || >=10.1.0' + prettier: '>=3.0.0' + peerDependenciesMeta: + '@types/eslint': + optional: true + eslint-config-prettier: + optional: true + + eslint-scope@9.1.2: + resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint-visitor-keys@5.0.1: + resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + eslint@10.1.0: + resolution: {integrity: sha512-S9jlY/ELKEUwwQnqWDO+f+m6sercqOPSqXM5Go94l7DOmxHVDgmSFGWEzeE/gwgTAr0W103BWt0QLe/7mabIvA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true + + espree@11.2.0: + resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + + esquery@1.7.0: + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} + engines: {node: '>=0.10'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + extendable-error@0.1.7: + resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-diff@1.3.0: + resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} + + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} + engines: {node: '>=8.6.0'} + + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + fast-uri@3.1.0: + resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} + + fastq@1.20.1: + resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} + + flatted@3.4.2: + resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} + + fs-extra@7.0.1: + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} + engines: {node: '>=6 <7 || >=8'} + + fs-extra@8.1.0: + resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + engines: {node: '>=6 <7 || >=8'} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + git-raw-commits@5.0.1: + resolution: {integrity: sha512-Y+csSm2GD/PCSh6Isd/WiMjNAydu0VBiG9J7EdQsNA5P9uXvLayqjmTsNlK5Gs9IhblFZqOU0yid5Il5JPoLiQ==} + engines: {node: '>=18'} + hasBin: true + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + global-directory@4.0.1: + resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} + engines: {node: '>=18'} + + globals@17.4.0: + resolution: {integrity: sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw==} + engines: {node: '>=18'} + + globby@11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + human-id@4.1.3: + resolution: {integrity: sha512-tsYlhAYpjCKa//8rXZ9DqKEawhPoSytweBC2eNvcaDK+57RZLHGqNs3PZTQO6yekLFSuvA6AlnAfrw1uBvtb+Q==} + hasBin: true + + iconv-lite@0.7.2: + resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==} + engines: {node: '>=0.10.0'} + + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + + ignore@7.0.5: + resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} + engines: {node: '>= 4'} + + import-fresh@3.3.1: + resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} + engines: {node: '>=6'} + + import-meta-resolve@4.2.0: + resolution: {integrity: sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==} + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + ini@4.1.1: + resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + + is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-obj@2.0.0: + resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} + engines: {node: '>=8'} + + is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} + + is-subdir@1.2.0: + resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} + engines: {node: '>=4'} + + is-windows@1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + jiti@2.6.1: + resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} + hasBin: true + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-yaml@3.14.2: + resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} + hasBin: true + + js-yaml@4.1.1: + resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} + hasBin: true + + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + + json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + jsonfile@4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + lodash.camelcase@4.3.0: + resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + + lodash.kebabcase@4.1.1: + resolution: {integrity: sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==} + + lodash.mergewith@4.6.2: + resolution: {integrity: sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==} + + lodash.snakecase@4.1.1: + resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} + + lodash.startcase@4.4.0: + resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + + lodash.upperfirst@4.3.1: + resolution: {integrity: sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==} + + meow@13.2.0: + resolution: {integrity: sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==} + engines: {node: '>=18'} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + minimatch@10.2.4: + resolution: {integrity: sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==} + engines: {node: 18 || 20 || >=22} + + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + + mri@1.2.0: + resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} + engines: {node: '>=4'} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + + outdent@0.5.0: + resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} + + p-filter@2.1.0: + resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} + engines: {node: '>=8'} + + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + p-map@2.1.0: + resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} + engines: {node: '>=6'} + + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + + package-manager-detector@0.2.11: + resolution: {integrity: sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==} + + parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + + parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@2.3.2: + 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'} + + pify@4.0.1: + resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} + engines: {node: '>=6'} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + prettier-linter-helpers@1.0.1: + resolution: {integrity: sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==} + engines: {node: '>=6.0.0'} + + prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} + hasBin: true + + prettier@3.8.1: + resolution: {integrity: sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==} + engines: {node: '>=14'} + hasBin: true + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + read-yaml-file@1.1.0: + resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} + engines: {node: '>=6'} + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.7.4: + resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} + engines: {node: '>=10'} + hasBin: true + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + + spawndamnit@3.0.1: + resolution: {integrity: sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==} + + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-bom@3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + + synckit@0.11.12: + resolution: {integrity: sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ==} + engines: {node: ^14.18.0 || >=16.0.0} + + term-size@2.2.1: + resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} + engines: {node: '>=8'} + + tinyexec@1.0.4: + resolution: {integrity: sha512-u9r3uZC0bdpGOXtlxUIdwf9pkmvhqJdrVCH9fapQtgy/OeTTMZ1nqH7agtvEfmGui6e1XxjcdrlxvxJvc3sMqw==} + engines: {node: '>=18'} + + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} + engines: {node: '>=12.0.0'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + ts-api-utils@2.5.0: + resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} + engines: {node: '>=18.12'} + peerDependencies: + typescript: '>=4.8.4' + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + typescript-eslint@8.57.2: + resolution: {integrity: sha512-VEPQ0iPgWO/sBaZOU1xo4nuNdODVOajPnTIbog2GKYr31nIlZ0fWPoCQgGfF3ETyBl1vn63F/p50Um9Z4J8O8A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.0.0' + + typescript@5.8.3: + resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@7.18.2: + resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==} + + universalify@0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + +snapshots: + + '@babel/code-frame@7.29.0': + dependencies: + '@babel/helper-validator-identifier': 7.28.5 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/helper-validator-identifier@7.28.5': {} + + '@babel/runtime@7.29.2': {} + + '@changesets/apply-release-plan@7.1.0': + dependencies: + '@changesets/config': 3.1.3 + '@changesets/get-version-range-type': 0.4.0 + '@changesets/git': 3.0.4 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + detect-indent: 6.1.0 + fs-extra: 7.0.1 + lodash.startcase: 4.4.0 + outdent: 0.5.0 + prettier: 2.8.8 + resolve-from: 5.0.0 + semver: 7.7.4 + + '@changesets/assemble-release-plan@6.0.9': + dependencies: + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + semver: 7.7.4 + + '@changesets/changelog-git@0.2.1': + dependencies: + '@changesets/types': 6.1.0 + + '@changesets/cli@2.30.0(@types/node@25.5.0)': + dependencies: + '@changesets/apply-release-plan': 7.1.0 + '@changesets/assemble-release-plan': 6.0.9 + '@changesets/changelog-git': 0.2.1 + '@changesets/config': 3.1.3 + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/get-release-plan': 4.0.15 + '@changesets/git': 3.0.4 + '@changesets/logger': 0.1.1 + '@changesets/pre': 2.0.2 + '@changesets/read': 0.6.7 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@changesets/write': 0.4.0 + '@inquirer/external-editor': 1.0.3(@types/node@25.5.0) + '@manypkg/get-packages': 1.1.3 + ansi-colors: 4.1.3 + enquirer: 2.4.1 + fs-extra: 7.0.1 + mri: 1.2.0 + package-manager-detector: 0.2.11 + picocolors: 1.1.1 + resolve-from: 5.0.0 + semver: 7.7.4 + spawndamnit: 3.0.1 + term-size: 2.2.1 + transitivePeerDependencies: + - '@types/node' + + '@changesets/config@3.1.3': + dependencies: + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/logger': 0.1.1 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + micromatch: 4.0.8 + + '@changesets/errors@0.2.0': + dependencies: + extendable-error: 0.1.7 + + '@changesets/get-dependents-graph@2.1.3': + dependencies: + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + picocolors: 1.1.1 + semver: 7.7.4 + + '@changesets/get-release-plan@4.0.15': + dependencies: + '@changesets/assemble-release-plan': 6.0.9 + '@changesets/config': 3.1.3 + '@changesets/pre': 2.0.2 + '@changesets/read': 0.6.7 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + + '@changesets/get-version-range-type@0.4.0': {} + + '@changesets/git@3.0.4': + dependencies: + '@changesets/errors': 0.2.0 + '@manypkg/get-packages': 1.1.3 + is-subdir: 1.2.0 + micromatch: 4.0.8 + spawndamnit: 3.0.1 + + '@changesets/logger@0.1.1': + dependencies: + picocolors: 1.1.1 + + '@changesets/parse@0.4.3': + dependencies: + '@changesets/types': 6.1.0 + js-yaml: 4.1.1 + + '@changesets/pre@2.0.2': + dependencies: + '@changesets/errors': 0.2.0 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + + '@changesets/read@0.6.7': + dependencies: + '@changesets/git': 3.0.4 + '@changesets/logger': 0.1.1 + '@changesets/parse': 0.4.3 + '@changesets/types': 6.1.0 + fs-extra: 7.0.1 + p-filter: 2.1.0 + picocolors: 1.1.1 + + '@changesets/should-skip-package@0.1.2': + dependencies: + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + + '@changesets/types@4.1.0': {} + + '@changesets/types@6.1.0': {} + + '@changesets/write@0.4.0': + dependencies: + '@changesets/types': 6.1.0 + fs-extra: 7.0.1 + human-id: 4.1.3 + prettier: 2.8.8 + + '@commitlint/cli@20.5.0(@types/node@25.5.0)(conventional-commits-parser@6.4.0)(typescript@5.8.3)': + dependencies: + '@commitlint/format': 20.5.0 + '@commitlint/lint': 20.5.0 + '@commitlint/load': 20.5.0(@types/node@25.5.0)(typescript@5.8.3) + '@commitlint/read': 20.5.0(conventional-commits-parser@6.4.0) + '@commitlint/types': 20.5.0 + tinyexec: 1.0.4 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - conventional-commits-filter + - conventional-commits-parser + - typescript + + '@commitlint/config-conventional@20.5.0': + dependencies: + '@commitlint/types': 20.5.0 + conventional-changelog-conventionalcommits: 9.3.1 + + '@commitlint/config-validator@20.5.0': + dependencies: + '@commitlint/types': 20.5.0 + ajv: 8.18.0 + + '@commitlint/ensure@20.5.0': + dependencies: + '@commitlint/types': 20.5.0 + lodash.camelcase: 4.3.0 + lodash.kebabcase: 4.1.1 + lodash.snakecase: 4.1.1 + lodash.startcase: 4.4.0 + lodash.upperfirst: 4.3.1 + + '@commitlint/execute-rule@20.0.0': {} + + '@commitlint/format@20.5.0': + dependencies: + '@commitlint/types': 20.5.0 + picocolors: 1.1.1 + + '@commitlint/is-ignored@20.5.0': + dependencies: + '@commitlint/types': 20.5.0 + semver: 7.7.4 + + '@commitlint/lint@20.5.0': + dependencies: + '@commitlint/is-ignored': 20.5.0 + '@commitlint/parse': 20.5.0 + '@commitlint/rules': 20.5.0 + '@commitlint/types': 20.5.0 + + '@commitlint/load@20.5.0(@types/node@25.5.0)(typescript@5.8.3)': + dependencies: + '@commitlint/config-validator': 20.5.0 + '@commitlint/execute-rule': 20.0.0 + '@commitlint/resolve-extends': 20.5.0 + '@commitlint/types': 20.5.0 + cosmiconfig: 9.0.1(typescript@5.8.3) + cosmiconfig-typescript-loader: 6.2.0(@types/node@25.5.0)(cosmiconfig@9.0.1(typescript@5.8.3))(typescript@5.8.3) + is-plain-obj: 4.1.0 + lodash.mergewith: 4.6.2 + picocolors: 1.1.1 + transitivePeerDependencies: + - '@types/node' + - typescript + + '@commitlint/message@20.4.3': {} + + '@commitlint/parse@20.5.0': + dependencies: + '@commitlint/types': 20.5.0 + conventional-changelog-angular: 8.3.1 + conventional-commits-parser: 6.4.0 + + '@commitlint/read@20.5.0(conventional-commits-parser@6.4.0)': + dependencies: + '@commitlint/top-level': 20.4.3 + '@commitlint/types': 20.5.0 + git-raw-commits: 5.0.1(conventional-commits-parser@6.4.0) + minimist: 1.2.8 + tinyexec: 1.0.4 + transitivePeerDependencies: + - conventional-commits-filter + - conventional-commits-parser + + '@commitlint/resolve-extends@20.5.0': + dependencies: + '@commitlint/config-validator': 20.5.0 + '@commitlint/types': 20.5.0 + global-directory: 4.0.1 + import-meta-resolve: 4.2.0 + lodash.mergewith: 4.6.2 + resolve-from: 5.0.0 + + '@commitlint/rules@20.5.0': + dependencies: + '@commitlint/ensure': 20.5.0 + '@commitlint/message': 20.4.3 + '@commitlint/to-lines': 20.0.0 + '@commitlint/types': 20.5.0 + + '@commitlint/to-lines@20.0.0': {} + + '@commitlint/top-level@20.4.3': + dependencies: + escalade: 3.2.0 + + '@commitlint/types@20.5.0': + dependencies: + conventional-commits-parser: 6.4.0 + picocolors: 1.1.1 + + '@conventional-changelog/git-client@2.6.0(conventional-commits-parser@6.4.0)': + dependencies: + '@simple-libs/child-process-utils': 1.0.2 + '@simple-libs/stream-utils': 1.2.0 + semver: 7.7.4 + optionalDependencies: + conventional-commits-parser: 6.4.0 + + '@eslint-community/eslint-utils@4.9.1(eslint@10.1.0(jiti@2.6.1))': + dependencies: + eslint: 10.1.0(jiti@2.6.1) + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.12.2': {} + + '@eslint/config-array@0.23.3': + dependencies: + '@eslint/object-schema': 3.0.3 + debug: 4.4.3 + minimatch: 10.2.4 + transitivePeerDependencies: + - supports-color + + '@eslint/config-helpers@0.5.3': + dependencies: + '@eslint/core': 1.1.1 + + '@eslint/core@1.1.1': + dependencies: + '@types/json-schema': 7.0.15 + + '@eslint/js@10.0.1(eslint@10.1.0(jiti@2.6.1))': + optionalDependencies: + eslint: 10.1.0(jiti@2.6.1) + + '@eslint/object-schema@3.0.3': {} + + '@eslint/plugin-kit@0.6.1': + dependencies: + '@eslint/core': 1.1.1 + levn: 0.4.1 + + '@humanfs/core@0.19.1': {} + + '@humanfs/node@0.16.7': + dependencies: + '@humanfs/core': 0.19.1 + '@humanwhocodes/retry': 0.4.3 + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/retry@0.4.3': {} + + '@inquirer/external-editor@1.0.3(@types/node@25.5.0)': + dependencies: + chardet: 2.1.1 + iconv-lite: 0.7.2 + optionalDependencies: + '@types/node': 25.5.0 + + '@manypkg/find-root@1.1.0': + dependencies: + '@babel/runtime': 7.29.2 + '@types/node': 12.20.55 + find-up: 4.1.0 + fs-extra: 8.1.0 + + '@manypkg/get-packages@1.1.3': + dependencies: + '@babel/runtime': 7.29.2 + '@changesets/types': 4.1.0 + '@manypkg/find-root': 1.1.0 + fs-extra: 8.1.0 + globby: 11.1.0 + read-yaml-file: 1.1.0 + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.20.1 + + '@pkgr/core@0.2.9': {} + + '@simple-libs/child-process-utils@1.0.2': + dependencies: + '@simple-libs/stream-utils': 1.2.0 + + '@simple-libs/stream-utils@1.2.0': {} + + '@tsconfig/node-lts@24.0.0': {} + + '@types/esrecurse@4.3.1': {} + + '@types/estree@1.0.8': {} + + '@types/json-schema@7.0.15': {} + + '@types/node@12.20.55': {} + + '@types/node@25.5.0': + dependencies: + undici-types: 7.18.2 + + '@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3)': + dependencies: + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/scope-manager': 8.57.2 + '@typescript-eslint/type-utils': 8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/utils': 8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 8.57.2 + eslint: 10.1.0(jiti@2.6.1) + ignore: 7.0.5 + natural-compare: 1.4.0 + ts-api-utils: 2.5.0(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.57.2 + '@typescript-eslint/types': 8.57.2 + '@typescript-eslint/typescript-estree': 8.57.2(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 8.57.2 + debug: 4.4.3 + eslint: 10.1.0(jiti@2.6.1) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/project-service@8.57.2(typescript@5.8.3)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.57.2(typescript@5.8.3) + '@typescript-eslint/types': 8.57.2 + debug: 4.4.3 + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@8.57.2': + dependencies: + '@typescript-eslint/types': 8.57.2 + '@typescript-eslint/visitor-keys': 8.57.2 + + '@typescript-eslint/tsconfig-utils@8.57.2(typescript@5.8.3)': + dependencies: + typescript: 5.8.3 + + '@typescript-eslint/type-utils@8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3)': + dependencies: + '@typescript-eslint/types': 8.57.2 + '@typescript-eslint/typescript-estree': 8.57.2(typescript@5.8.3) + '@typescript-eslint/utils': 8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3) + debug: 4.4.3 + eslint: 10.1.0(jiti@2.6.1) + ts-api-utils: 2.5.0(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/types@8.57.2': {} + + '@typescript-eslint/typescript-estree@8.57.2(typescript@5.8.3)': + dependencies: + '@typescript-eslint/project-service': 8.57.2(typescript@5.8.3) + '@typescript-eslint/tsconfig-utils': 8.57.2(typescript@5.8.3) + '@typescript-eslint/types': 8.57.2 + '@typescript-eslint/visitor-keys': 8.57.2 + debug: 4.4.3 + minimatch: 10.2.4 + semver: 7.7.4 + tinyglobby: 0.2.15 + ts-api-utils: 2.5.0(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3)': + dependencies: + '@eslint-community/eslint-utils': 4.9.1(eslint@10.1.0(jiti@2.6.1)) + '@typescript-eslint/scope-manager': 8.57.2 + '@typescript-eslint/types': 8.57.2 + '@typescript-eslint/typescript-estree': 8.57.2(typescript@5.8.3) + eslint: 10.1.0(jiti@2.6.1) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/visitor-keys@8.57.2': + dependencies: + '@typescript-eslint/types': 8.57.2 + eslint-visitor-keys: 5.0.1 + + acorn-jsx@5.3.2(acorn@8.16.0): + dependencies: + acorn: 8.16.0 + + acorn@8.16.0: {} + + ajv@6.14.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + ajv@8.18.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.0 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-colors@4.1.3: {} + + ansi-regex@5.0.1: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + argparse@1.0.10: + dependencies: + sprintf-js: 1.0.3 + + argparse@2.0.1: {} + + array-ify@1.0.0: {} + + array-union@2.1.0: {} + + balanced-match@4.0.4: {} + + better-path-resolve@1.0.0: + dependencies: + is-windows: 1.0.2 + + brace-expansion@5.0.5: + dependencies: + balanced-match: 4.0.4 + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + callsites@3.1.0: {} + + chardet@2.1.1: {} + + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + + compare-func@2.0.0: + dependencies: + array-ify: 1.0.0 + dot-prop: 5.3.0 + + conventional-changelog-angular@8.3.1: + dependencies: + compare-func: 2.0.0 + + conventional-changelog-conventionalcommits@9.3.1: + dependencies: + compare-func: 2.0.0 + + conventional-commits-parser@6.4.0: + dependencies: + '@simple-libs/stream-utils': 1.2.0 + meow: 13.2.0 + + cosmiconfig-typescript-loader@6.2.0(@types/node@25.5.0)(cosmiconfig@9.0.1(typescript@5.8.3))(typescript@5.8.3): + dependencies: + '@types/node': 25.5.0 + cosmiconfig: 9.0.1(typescript@5.8.3) + jiti: 2.6.1 + typescript: 5.8.3 + + cosmiconfig@9.0.1(typescript@5.8.3): + dependencies: + env-paths: 2.2.1 + import-fresh: 3.3.1 + js-yaml: 4.1.1 + parse-json: 5.2.0 + optionalDependencies: + typescript: 5.8.3 + + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + deep-is@0.1.4: {} + + detect-indent@6.1.0: {} + + dir-glob@3.0.1: + dependencies: + path-type: 4.0.0 + + dot-prop@5.3.0: + dependencies: + is-obj: 2.0.0 + + emoji-regex@8.0.0: {} + + enquirer@2.4.1: + dependencies: + ansi-colors: 4.1.3 + strip-ansi: 6.0.1 + + env-paths@2.2.1: {} + + error-ex@1.3.4: + dependencies: + is-arrayish: 0.2.1 + + escalade@3.2.0: {} + + escape-string-regexp@4.0.0: {} + + eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)): + dependencies: + eslint: 10.1.0(jiti@2.6.1) + + eslint-plugin-prettier@5.5.5(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint@10.1.0(jiti@2.6.1))(prettier@3.8.1): + dependencies: + eslint: 10.1.0(jiti@2.6.1) + prettier: 3.8.1 + prettier-linter-helpers: 1.0.1 + synckit: 0.11.12 + optionalDependencies: + eslint-config-prettier: 10.1.8(eslint@10.1.0(jiti@2.6.1)) + + eslint-scope@9.1.2: + dependencies: + '@types/esrecurse': 4.3.1 + '@types/estree': 1.0.8 + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint-visitor-keys@5.0.1: {} + + eslint@10.1.0(jiti@2.6.1): + dependencies: + '@eslint-community/eslint-utils': 4.9.1(eslint@10.1.0(jiti@2.6.1)) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.23.3 + '@eslint/config-helpers': 0.5.3 + '@eslint/core': 1.1.1 + '@eslint/plugin-kit': 0.6.1 + '@humanfs/node': 0.16.7 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.8 + ajv: 6.14.0 + cross-spawn: 7.0.6 + debug: 4.4.3 + escape-string-regexp: 4.0.0 + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + espree: 11.2.0 + esquery: 1.7.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + minimatch: 10.2.4 + natural-compare: 1.4.0 + optionator: 0.9.4 + optionalDependencies: + jiti: 2.6.1 + transitivePeerDependencies: + - supports-color + + espree@11.2.0: + dependencies: + acorn: 8.16.0 + acorn-jsx: 5.3.2(acorn@8.16.0) + eslint-visitor-keys: 5.0.1 + + esprima@4.0.1: {} + + esquery@1.7.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@5.3.0: {} + + esutils@2.0.3: {} + + extendable-error@0.1.7: {} + + fast-deep-equal@3.1.3: {} + + fast-diff@1.3.0: {} + + fast-glob@3.3.3: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + + fast-json-stable-stringify@2.1.0: {} + + fast-levenshtein@2.0.6: {} + + fast-uri@3.1.0: {} + + fastq@1.20.1: + dependencies: + reusify: 1.1.0 + + fdir@6.5.0(picomatch@4.0.4): + optionalDependencies: + picomatch: 4.0.4 + + file-entry-cache@8.0.0: + dependencies: + flat-cache: 4.0.1 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + find-up@4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + + flat-cache@4.0.1: + dependencies: + flatted: 3.4.2 + keyv: 4.5.4 + + flatted@3.4.2: {} + + fs-extra@7.0.1: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + + fs-extra@8.1.0: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + + get-caller-file@2.0.5: {} + + git-raw-commits@5.0.1(conventional-commits-parser@6.4.0): + dependencies: + '@conventional-changelog/git-client': 2.6.0(conventional-commits-parser@6.4.0) + meow: 13.2.0 + transitivePeerDependencies: + - conventional-commits-filter + - conventional-commits-parser + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + global-directory@4.0.1: + dependencies: + ini: 4.1.1 + + globals@17.4.0: {} + + globby@11.1.0: + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.3 + ignore: 5.3.2 + merge2: 1.4.1 + slash: 3.0.0 + + graceful-fs@4.2.11: {} + + human-id@4.1.3: {} + + iconv-lite@0.7.2: + dependencies: + safer-buffer: 2.1.2 + + ignore@5.3.2: {} + + ignore@7.0.5: {} + + import-fresh@3.3.1: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + import-meta-resolve@4.2.0: {} + + imurmurhash@0.1.4: {} + + ini@4.1.1: {} + + is-arrayish@0.2.1: {} + + is-extglob@2.1.1: {} + + is-fullwidth-code-point@3.0.0: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-number@7.0.0: {} + + is-obj@2.0.0: {} + + is-plain-obj@4.1.0: {} + + is-subdir@1.2.0: + dependencies: + better-path-resolve: 1.0.0 + + is-windows@1.0.2: {} + + isexe@2.0.0: {} + + jiti@2.6.1: {} + + js-tokens@4.0.0: {} + + js-yaml@3.14.2: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + + js-yaml@4.1.1: + dependencies: + argparse: 2.0.1 + + json-buffer@3.0.1: {} + + json-parse-even-better-errors@2.3.1: {} + + json-schema-traverse@0.4.1: {} + + json-schema-traverse@1.0.0: {} + + json-stable-stringify-without-jsonify@1.0.1: {} + + jsonfile@4.0.0: + optionalDependencies: + graceful-fs: 4.2.11 + + keyv@4.5.4: + dependencies: + json-buffer: 3.0.1 + + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + lines-and-columns@1.2.4: {} + + locate-path@5.0.0: + dependencies: + p-locate: 4.1.0 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + + lodash.camelcase@4.3.0: {} + + lodash.kebabcase@4.1.1: {} + + lodash.mergewith@4.6.2: {} + + lodash.snakecase@4.1.1: {} + + lodash.startcase@4.4.0: {} + + lodash.upperfirst@4.3.1: {} + + meow@13.2.0: {} + + merge2@1.4.1: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + minimatch@10.2.4: + dependencies: + brace-expansion: 5.0.5 + + minimist@1.2.8: {} + + mri@1.2.0: {} + + ms@2.1.3: {} + + natural-compare@1.4.0: {} + + optionator@0.9.4: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + + outdent@0.5.0: {} + + p-filter@2.1.0: + dependencies: + p-map: 2.1.0 + + p-limit@2.3.0: + dependencies: + p-try: 2.2.0 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@4.1.0: + dependencies: + p-limit: 2.3.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + p-map@2.1.0: {} + + p-try@2.2.0: {} + + package-manager-detector@0.2.11: + dependencies: + quansync: 0.2.11 + + parent-module@1.0.1: + dependencies: + callsites: 3.1.0 + + parse-json@5.2.0: + dependencies: + '@babel/code-frame': 7.29.0 + error-ex: 1.3.4 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + + path-exists@4.0.0: {} + + path-key@3.1.1: {} + + path-type@4.0.0: {} + + picocolors@1.1.1: {} + + picomatch@2.3.2: {} + + picomatch@4.0.4: {} + + pify@4.0.1: {} + + prelude-ls@1.2.1: {} + + prettier-linter-helpers@1.0.1: + dependencies: + fast-diff: 1.3.0 + + prettier@2.8.8: {} + + prettier@3.8.1: {} + + punycode@2.3.1: {} + + quansync@0.2.11: {} + + queue-microtask@1.2.3: {} + + read-yaml-file@1.1.0: + dependencies: + graceful-fs: 4.2.11 + js-yaml: 3.14.2 + pify: 4.0.1 + strip-bom: 3.0.0 + + require-directory@2.1.1: {} + + require-from-string@2.0.2: {} + + resolve-from@4.0.0: {} + + resolve-from@5.0.0: {} + + reusify@1.1.0: {} + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + + safer-buffer@2.1.2: {} + + semver@7.7.4: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + signal-exit@4.1.0: {} + + slash@3.0.0: {} + + spawndamnit@3.0.1: + dependencies: + cross-spawn: 7.0.6 + signal-exit: 4.1.0 + + sprintf-js@1.0.3: {} + + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-bom@3.0.0: {} + + synckit@0.11.12: + dependencies: + '@pkgr/core': 0.2.9 + + term-size@2.2.1: {} + + tinyexec@1.0.4: {} + + tinyglobby@0.2.15: + dependencies: + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + ts-api-utils@2.5.0(typescript@5.8.3): + dependencies: + typescript: 5.8.3 + + type-check@0.4.0: + dependencies: + prelude-ls: 1.2.1 + + typescript-eslint@8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3): + dependencies: + '@typescript-eslint/eslint-plugin': 8.57.2(@typescript-eslint/parser@8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/parser': 8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.57.2(typescript@5.8.3) + '@typescript-eslint/utils': 8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.8.3) + eslint: 10.1.0(jiti@2.6.1) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + typescript@5.8.3: {} + + undici-types@7.18.2: {} + + universalify@0.1.2: {} + + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + word-wrap@1.2.5: {} + + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + y18n@5.0.8: {} + + yargs-parser@21.1.1: {} + + yargs@17.7.2: + dependencies: + cliui: 8.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + + yocto-queue@0.1.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..2a7363d --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - '.' + - 'packages/*' diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..9241332 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,6 @@ +/** + * @type {import('prettier').Config} + */ +export default { + singleQuote: true, +}; diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..e7fe054 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,5 @@ +edition = "2024" +max_width = 100 +tab_spaces = 4 +use_field_init_shorthand = true +use_try_shorthand = true diff --git a/skills/wecomcli-contact/SKILL.md b/skills/wecomcli-contact/SKILL.md new file mode 100644 index 0000000..e4703bb --- /dev/null +++ b/skills/wecomcli-contact/SKILL.md @@ -0,0 +1,178 @@ +--- +name: wecomcli-contact +description: 通讯录成员查询技能,获取当前用户可见范围内的通讯录成员,支持按姓名/别名本地筛选匹配。返回 userid、姓名和别名。⚠️ 仅返回当前用户有权限查看的成员,非全量成员。 +metadata: + requires: + bins: ["wecom-cli"] + cliHelp: "wecom-cli contact --help" +--- + +# 通讯录成员查询技能 + +> `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 + +获取当前用户可见范围内的通讯录成员,并在本地按姓名/别名进行筛选匹配。 + +## 操作 + +### 1. 获取全量通讯录成员 + +获取当前用户可见范围内的所有企业成员信息: + +**调用示例:** + +```bash +wecom-cli contact get_userlist '{}' +``` + +**返回格式:** + +```json +{ + "errcode": 0, + "errmsg": "ok", + "userlist": [ + { + "userid": "zhangsan", + "name": "张三", + "alias": "Sam" + }, + { + "userid": "lisi", + "name": "李四", + "alias": "" + } + ] +} +``` + +**返回字段说明:** + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功 | +| `errmsg` | string | 错误信息 | +| `userlist` | array | 用户列表 | +| `userlist[].userid` | string | 用户唯一 ID | +| `userlist[].name` | string | 用户姓名 | +| `userlist[].alias` | string | 用户别名,可能为空 | + +--- + +### 2. 按姓名/别名搜索人员 + +`get_userlist` 返回全量成员后,在本地对结果进行筛选匹配: + +- **精确匹配**:`name` 或 `alias` 与关键词完全一致,直接使用 +- **模糊匹配**:`name` 或 `alias` 包含关键词,返回所有匹配结果 +- **无结果**:告知用户未找到对应人员 + +**搜索示例:** + +用户问:"帮我找一下张三是谁?" + +1. 调用 `get_userlist` 获取全量成员 +2. 在 `userlist` 中筛选 `name` 或 `alias` 包含"张三"的成员 +3. 返回匹配结果 + +--- + +## 注意事项 + +- `get_userlist` 返回的是当前用户**可见范围内**的成员,需经过可见性规则过滤,不一定是全公司所有人员;返回字段仅包含 `userid`、`name`(姓名)和 `alias`(别名) +- ⚠️ **超过 10 人时接口将报错**:若 `userlist` 返回成员数量超过 10 人,视为异常,应立即停止处理并向用户说明: + + > 当前通讯录可见成员数量超过了本技能支持的上限(10 人)。 + > 本技能仅适用于可见范围较小的场景,无法在大范围通讯录中使用。 + > 建议缩小可见范围后重试,或通过其他方式查询目标人员。 + +- `userid` 是用户的唯一标识,在需要传递用户 ID 给其他接口时使用此字段 +- `alias` 字段可能为空字符串,搜索时需做空值判断 +- 若搜索结果有多个同名人员,需将所有候选人展示给用户选择,不得自行决定 +- 若 `errcode` 不为 `0`,说明接口调用失败,需告知用户错误信息(`errmsg`) + +--- + +## 典型工作流 + +### 工作流 1:查询人员信息 + +用户问:"帮我查一下 Sam 是谁?" + +1. +```bash +wecom-cli contact get_userlist '{}' +``` + 获取全量成员列表 + +2. 在结果中筛选 `alias` 为 `Sam` 或 `name` 包含 `Sam` 的成员 +3. 若找到唯一匹配,直接展示结果: + +``` +📇 找到成员: +- 姓名:张三 +- 别名:Sam +- 用户ID:zhangsan +``` + +4. 若找到多个匹配,展示候选列表请用户确认: + +``` +🔍 找到多个匹配成员,请确认您要查询的是哪位: + +1. 张三(别名:Sam,ID:zhangsan) +2. 张三丰(别名:Sam2,ID:zhangsan2) + +请问您要查询的是哪一位? +``` + +--- + +### 工作流 2:为其他功能提供 userid 转换 + +用户问:"帮我发消息给张三" + +1. +```bash +wecom-cli contact get_userlist '{}' +``` + 获取全量成员 + +2. 筛选 `name` 为"张三"的成员,确认 `userid` +3. 将 `userid` 传递给消息发送接口 + +--- + +### 工作流 3:批量查询多个人员 + +用户问:"帮我查一下张三和李四分别是谁?" + +1. +```bash +wecom-cli contact get_userlist '{}' +``` + 获取全量成员列表 + +2. 分别筛选"张三"和"李四"的匹配结果 +3. 汇总后一并展示 + +> 注意:只需调用一次 `get_userlist`,在本地对结果进行多次筛选,避免重复调用接口。 + +--- + +## 快速参考 + +### 接口说明 + +| 接口 | 用途 | 输入 | 返回 | +|------|------|------|------| +| `get_userlist` | 获取可见范围内全量通讯录成员 | 无 | 用户列表(userid、name、alias) | + +### 本地筛选策略 + +| 场景 | 策略 | +|------|------| +| 精确匹配(name 或 alias 完全一致) | 直接使用,无需用户确认 | +| 模糊匹配(name 或 alias 包含关键词),唯一结果 | 直接使用,向用户展示结果 | +| 模糊匹配,多个结果 | 展示候选列表,请用户选择 | +| 无匹配结果 | 告知用户未找到对应人员 | diff --git a/skills/wecomcli-doc/SKILL.md b/skills/wecomcli-doc/SKILL.md new file mode 100644 index 0000000..05cd47d --- /dev/null +++ b/skills/wecomcli-doc/SKILL.md @@ -0,0 +1,141 @@ +--- +name: wecomcli-doc +description: 企业微信文档(doc)管理技能。提供普通文档的新建、内容读取(Markdown)、内容覆写能力。适用场景:(1) 从零新建空白文档 (2) 以 Markdown 格式读取文档完整内容 (3) 用 Markdown 覆写文档正文。支持通过 docid 或文档 URL 定位文档。当用户提到「企业微信文档」「企微文档」「创建文档」「写个文档」,或链接形如 `https://doc.weixin.qq.com/doc/xxx` 时触发该技能。注意:在线表格(`/sheet/*`)请用 `wecomcli-sheet`;智能表格(`/smartsheet/*`)请用 `wecomcli-smartsheet`;智能文档/智能主页(`/smartpage/*`)请用 `wecomcli-smartpage`。 +metadata: + requires: + bins: ["wecom-cli"] + cliHelp: "wecom-cli doc --help" +--- + +# 企业微信文档管理 + +> `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 + +资源型技能,负责普通doc文档的新建、内容读取与覆写。文档接口支持通过 `docid` 或 `url` 二选一定位文档。 + +## URL 品类识别与接口路由 + +企业微信文档有多种品类,**URL 格式不同,所用的接口/技能也不同**。请通过 URL 严格区分: + +| URL 模式 | 品类 | 处理方式 | +|---|---|---| +| `https://doc.weixin.qq.com/doc/*` | **文档** | **本 skill** | +| `https://doc.weixin.qq.com/sheet/*` | **在线表格** | 参阅 `wecomcli-sheet` skill | +| `https://doc.weixin.qq.com/smartsheet/*` | **智能表格** | 参阅 `wecomcli-smartsheet` skill | +| `https://doc.weixin.qq.com/smartpage/*` | **智能文档**(原名智能主页) | 参阅 `wecomcli-smartpage` skill | + +## 调用方式 + +通过 `wecom-cli` 调用,品类为 `doc`: + +```bash +wecom-cli doc '' +``` + +## 返回格式说明 + +所有接口返回 JSON 对象,包含以下公共字段: + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功,非 `0` 表示失败 | +| `errmsg` | string | 错误信息,成功时为 `"ok"` | + +当 `errcode` 不为 `0` 时,说明接口调用失败,可重试 1 次;若仍失败,将 `errcode` 和 `errmsg` 展示给用户。 + +### 特殊错误码 + +| errcode | errmsg | 含义 | 处理方式 | +|---------|--------|------|----------| +| `851002` | `incompatible doc type` | 文档品类与所调用的接口不匹配 | 根据文档 URL 重新确认品类(参见上方「URL 品类识别与接口路由」表),然后跳转到该品类对应的 skill | + +## 接口详述 + +### 新建文档 + +新建一篇空白企微文档(`doc_type` 固定为 3)。创建成功后返回 `docid` 和 `url`。 + +**命令** + +```bash +wecom-cli doc create_doc '' +``` + +**参数** + +| 参数 | 类型 | 必填 | 默认值 | 说明 | +|---|---|---|---|---| +| `doc_type` | int | 是 | — | 固定传 `3`(文档) | +| `doc_name` | string | 是 | — | 文档标题,最多 255 个字符,超过会被截断 | + +**返回** + +| 字段 | 类型 | 说明 | +|---|---|---| +| `docid` | string | 新建文档的 docid,需妥善保存 | +| `url` | string | 新建文档的访问链接 | + +**注意事项** + +- 本接口仅创建**空白**文档,不携带初始内容;如需写入正文,请在创建后调用 `edit_doc_content`。 + +### 读取完整内容 + +获取文档的完整内容数据,统一以 Markdown 格式返回。采用**异步轮询机制**:首次调用无需传 `task_id`,接口返回 `task_id`;若 `task_done` 为 `false`,需携带该 `task_id` 再次调用,直到 `task_done` 为 `true` 时返回完整内容。 + +**命令** + +```bash +wecom-cli doc get_doc_content '' +``` + +**参数** + +| 字段 | 类型 | 必填 | 默认值 | 语义 | +|---|---|---|---|---| +| `docid` | string | 与 `url` 二选一 | — | 文档的 docid | +| `url` | string | 与 `docid` 二选一 | — | 文档的访问链接 | +| `type` | int | 是 | — | 内容返回格式,固定传 `2`(Markdown) | +| `task_id` | string | 否 | — | 任务 ID,首次不传,轮询时填上次返回的 `task_id` | + +**返回** + +| 字段 | 类型 | 说明 | +|---|---|---| +| `content` | string | `task_done` 为 `true` 时返回的完整 Markdown 内容 | +| `task_id` | string | 任务 ID,未完成时用于下次轮询 | +| `task_done` | bool | 任务是否完成,`false` 时需携带 `task_id` 继续轮询 | + +**使用规则** + +- 首次调用不传 `task_id`;若 `task_done` 为 `false`,记录 `task_id` 后携带其再次调用,直到 `task_done` 为 `true` 取 `content`。 + +### 覆写文档内容 + +用 Markdown 内容覆写文档正文。此操作为**覆写**,会替换文档全部内容。 + +**命令** + +```bash +wecom-cli doc edit_doc_content '' +``` + +**参数** + +| 字段 | 类型 | 必填 | 默认值 | 语义 | +|---|---|---|---|---| +| `docid` | string | 与 `url` 二选一 | — | 文档的 docid | +| `url` | string | 与 `docid` 二选一 | — | 文档的访问链接 | +| `content` | string | 是 | — | 覆写的文档内容(Markdown) | +| `content_type` | int | 是 | — | 内容类型,固定传 `1`(Markdown) | + +**使用规则** + +- 此操作为覆写,会替换文档全部内容;建议先用 `get_doc_content` 了解当前内容再编辑。 +- 成功判定:以返回的 `errcode == 0` 为准;非 0 时按「返回格式说明」处理(可重试 1 次)。 + +## 跨技能依赖 + +| 依赖技能 | 典型协作场景 | 数据流向 | +|---|---|---| +| `wecomcli-msg` | 用户要求把文档链接发给某人/某群 | 本 skill 新建后返回 `url` → `wecomcli-msg` 发送链接 | diff --git a/skills/wecomcli-meeting/SKILL.md b/skills/wecomcli-meeting/SKILL.md new file mode 100644 index 0000000..cf4eef0 --- /dev/null +++ b/skills/wecomcli-meeting/SKILL.md @@ -0,0 +1,475 @@ +--- +name: wecomcli-meeting +description: 企业微信会议技能,支持创建预约会议、查询会议列表、获取会议详情、取消会议、更新会议成员。当用户需要"创建会议"、"预约会议"、"约会议"、"安排会议"、"查看会议"、"查询会议列表"、"会议详情"、"什么时候开会"、"有哪些会议"、"查找会议"、"取消会议"、"删除会议"、"修改会议成员"、"添加会议参与人"、"移除会议成员"时触发。 +metadata: + requires: + bins: ["wecom-cli"] + cliHelp: "wecom-cli meeting --help" +--- +# 企业微信会议技能 + +> `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 + +## 概述 + +wecomcli-meeting 提供企业微信会议的完整管理能力,包含以下功能: + +1. **创建预约会议** - 创建会议,支持设置会议参数,邀请参与人等 +2. **查询会议列表** - 按用户和时间范围查询会议 ID 列表 (限制: 当日及前后 30 天,上限 100 个) +3. **获取会议详情** - 通过会议 ID 查询完整会议信息 +4. **取消会议** - 取消指定的预约会议 +5. **更新会议受邀成员** - 修改会议的参与人列表 + +## 命令调用方式 + +执行指定命令: +```bash +wecom-cli meeting '' +``` + +--- + +## 命令详细说明 + +### 1. 创建预约会议 (create_meeting) + +创建一个预约会议,支持设置会议参数配置等。 + +#### 执行命令 + +```bash +wecom-cli meeting create_meeting '{"title": "<会议标题>", "meeting_start_datetime": "<会议开始时间>", "meeting_duration": <会议持续时长(秒)>}' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +| -------------------------- | ------- | ---- | ------------------------------------------------- | +| `title` | string | 是 | 会议标题 | +| `meeting_start_datetime` | string | 是 | 会议开始时间,格式:`YYYY-MM-DD HH:mm` | +| `meeting_duration` | integer | 是 | 会议持续时长 (秒),例如 3600 = 1 小时 | +| `description` | string | 否 | 会议描述 | +| `location` | string | 否 | 会议地点 | +| `invitees` | object | 否 | 被邀请人,格式:`{"userid": ["lisi", "wangwu"]}` | +| `settings` | object | 否 | 会议设置 (详见下方) | + +> 被邀请人 userid 通过 `wecomcli-contact` 技能获取 + +**settings 字段:** + +| 参数 | 类型 | 说明 | +| --------------------------- | ------- | --------------------------------------------- | +| `password` | string | 会议密码 | +| `enable_waiting_room` | boolean | 是否启用等候室 | +| `allow_enter_before_host` | boolean | 是否允许成员在主持人进入前加入 | +| `enable_enter_mute` | integer | 入会时静音设置 (枚举: 0: 关闭,1: 开启) | +| `allow_external_user` | boolean | 是否允许外部用户入会 | +| `enable_screen_watermark` | boolean | 是否开启屏幕水印 | +| `remind_scope` | integer | 提醒范围 (1: 不提醒,2: 仅提醒主持人,3: 提醒所有成员,4: 指定部分人响铃,默认仅提醒主持人) | +| `ring_users` | object | 响铃用户,格式:`{"userid": ["lisi"]}` | + +> 响铃用户 userid 通过 `wecomcli-contact` 技能获取 + +#### 返回参数 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "meetingid": "会议ID字符串", + "meeting_code": "会议号码字符串", + "meeting_link": "会议链接URL", + "excess_users": ["无效会议账号的userid"] +} +``` + +| 字段 | 类型 | 说明 | +| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------ | +| `meetingid` | string | 会议 ID | +| `meeting_code` | string | 会议号码,向用户展示时需在回复**开头**单独一行纯文字展示,格式 `#会议号: xxx-xxx-xxx` (每3位用 `-` 分隔) | +| `meeting_link` | string | 会议链接 | +| `excess_users` | array | 参会人中包含无效会议账号的 userid,仅在购买会议专业版企业由于部分参会人无有效会议账号时返回 | + +--- + +### 2. 查询会议列表 (list_user_meetings) + +查询指定用户在时间范围内的会议 ID 列表。 + +#### 执行命令 + +```bash +wecom-cli meeting list_user_meetings '{"begin_datetime": "2026-03-01 00:00", "end_datetime": "2026-03-31 23:59", "limit": 100}' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +| ------------------ | ------- | ---- | --------------------------------------- | +| `begin_datetime` | string | 否 | 查询起始时间,格式:`YYYY-MM-DD HH:mm` | +| `end_datetime` | string | 否 | 查询结束时间,格式:`YYYY-MM-DD HH:mm` | +| `cursor` | string | 否 | 分页游标,用于获取下一页数据 | +| `limit` | integer | 否 | 每页返回条数,最大 100 | + +> **限制**: 时间范围仅支持当日及前后 30 天。 + +#### 返回参数 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "next_cursor": "分页游标字符串,为空表示无更多", + "meetingid_list": ["会议ID_1", "会议ID_2"] +} +``` + +| 字段 | 类型 | 说明 | +| ------------------ | ------ | ------------------------------ | +| `meetingid_list` | array | 会议 ID 列表 | +| `next_cursor` | string | 下一页游标,为空表示无更多数据 | + +--- + +### 3. 获取会议详情 (get_meeting_info) + +通过会议 ID 查询会议的完整详情。 + +#### 执行命令 + +```bash +wecom-cli meeting get_meeting_info '{"meetingid": "<会议id>"}' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +| ----------------- | ------ | ---- | --------------- | +| `meetingid` | string | 是 | 会议 ID,通过 `list_user_meetings` 获取 | +| `meeting_code` | string | 否 | 会议号码 | +| `sub_meetingid` | string | 否 | 子会议 ID | + +#### 返回参数 + +> 完整的返回参数结构和字段说明详见 [references/response-get-meeting-info.md](references/response-get-meeting-info.md) + +**核心字段速览:** + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| `title` | string | 会议标题 | +| `meeting_start_datetime` | string | 会议开始时间 | +| `meeting_duration` | integer | 会议时长 (秒) | +| `status` | integer | 会议状态 (1: 待开始,2: 会议中,3: 已结束,4: 已取消,5: 已过期) | +| `meeting_type` | integer | 会议类型 (0: 一次性,1: 周期性,2: 微信专属,3: Rooms 投屏,5: 个人会议号,6: 网络研讨会) | +| `meeting_code` | string | 会议号码 | +| `meeting_link` | string | 会议链接 | +| `description` | string | 会议描述 | +| `location` | string | 会议地点 | +| `attendees.member[].status` | integer | 与会状态 (1: 已参与,2: 未参与) | + +--- + +### 4. 取消会议 (cancel_meeting) + +取消指定的预约会议。 + +#### 执行命令 + +```bash +wecom-cli meeting cancel_meeting '{"meetingid": "<会议id>"}' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +| ----------------- | ------ | ---- | ---------------------------------- | +| `meetingid` | string | 是 | 会议 ID,通过 `list_user_meetings` + `get_meeting_info` 获取 | + +#### 返回参数 + +```json +{ + "errcode": 0, + "errmsg": "ok" +} +``` + +--- + +### 5. 更新会议受邀成员 (set_invite_meeting_members) + +更新会议的受邀成员列表(全量覆盖)。 + +#### 执行命令 + +```bash +wecom-cli meeting set_invite_meeting_members '{"meetingid": "<会议id>", "invitees": [{"userid": "lisi"}, {"userid": "wangwu"}]}' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +| ------------- | ------ | ---- | -------------------------------------- | +| `meetingid` | string | 是 | 会议 ID,通过 `list_user_meetings` + `get_meeting_info` 获取 | +| `invitees` | array | 是 | 受邀成员列表,每项包含 `userid` 字段 | + +> **注意**: invitees 为全量覆盖,传入的列表将替换现有成员列表。 +> invitees 的 userid 通过 `wecomcli-contact` 技能获取 + +#### 返回参数 + +```json +{ + "errcode": 0, + "errmsg": "ok" +} +``` + +--- + +## 典型工作流 + +### 工作流 1: 最简创建 (无邀请人) + +**用户意图**: "帮我约一个明天下午3点的会议,主题是周例会,时长1小时" + +**步骤:** + +1. **解析用户意图**: 时间 + 主题已有,邀请人未提及则默认留空,直接创建。 +2. **调用创建命令**: + +```bash +wecom-cli meeting create_meeting '{"title": "周例会", "meeting_start_datetime": "2026-03-18 15:00", "meeting_duration": 3600}' +``` + +3. **展示结果**: + +#会议号: <会议号> + +``` +✅ 会议创建成功! + +📅 <会议标题> +🕐 时间: <开始时间>,时长 <时长> +🔗 会议链接: <会议链接> +``` + +### 工作流 2: 带邀请人 + 地点 + 描述创建 + +**用户意图**: "帮我约一个明天下午3点的会议,主题是技术方案评审,邀请张三和李四,地点在3楼会议室,时长1小时" + +**步骤:** + +1. **解析用户意图**: 有邀请人,需先查询通讯录获取 userid。 +2. **通讯录查询**: 调用 `wecomcli-contact` 技能获取通讯录成员,按姓名筛选出参与者的 userid。 + +```bash +wecom-cli contact get_userlist '{}' +``` + +在返回的 `userlist` 中筛选 `name` 包含 "张三" 和 "李四" 的成员,获取其 `userid`。 + +3. **信息已充分,直接调用创建命令** (禁止暴露内部 ID): + +```bash +wecom-cli meeting create_meeting '{"title": "技术方案评审", "meeting_start_datetime": "2026-03-18 15:00", "meeting_duration": 3600, "location": "3楼会议室", "invitees": {"userid": ["zhangsan", "lisi"]}}' +``` + +4. **展示结果**: + +#会议号: <会议号> + +``` +✅ 会议创建成功! + +📅 <会议标题> +🕐 时间: <开始时间>,时长 <时长> +👥 参与人: <参与者姓名列表> +🔗 会议链接: <会议链接> +``` + +--- + +### 工作流 3: 查询会议列表 + +**示例**: 用户说 "帮我查一下本周有哪些会议" + +**步骤:** + +1. **确定时间范围**: 根据当前日期计算本周的起止时间。 +2. **查询会议 ID 列表**: + +```bash +wecom-cli meeting list_user_meetings '{"begin_datetime": "2026-03-16 00:00", "end_datetime": "2026-03-22 23:59", "limit": 100}' +``` + +3. **逐个查询会议详情** (对返回的每个 meetingid): + +```bash +wecom-cli meeting get_meeting_info '{"meetingid": "<会议id1>"}' +``` +```bash +wecom-cli meeting get_meeting_info '{"meetingid": "<会议id2>"}' +``` + +4. **汇总展示**: + +``` +📋 本周会议列表 (共 3 场): + +1. 📅 技术方案评审 + 🕐 2026-03-17 10:00 - 11:00 + 👥 张三,李四,王五 + +2. 📅 产品需求沟通 + 🕐 2026-03-18 14:00 - 15:00 + 👥 赵六,钱七 + +3. 📅 周五周会 + 🕐 2026-03-21 09:00 - 10:00 + 👥 全组成员 +``` + +> **分页处理**: 如果 `next_cursor` 不为空,使用 `cursor` 参数继续拉取下一页。 + +--- + +### 工作流 4: 获取会议详情 + +**示例**: 用户说 "帮我看下技术方案评审会议的详情" + +**步骤:** + +1. **定位会议**: 先通过会议列表查询找到目标会议的 meetingid (按关键词匹配)。 +2. **查询详情**: + +```bash +wecom-cli meeting get_meeting_info '{"meetingid": ""}' +``` + +3. **展示结果**: + +#会议号: <会议号> + +``` +📅 <会议标题> + +🕐 时间: <开始时间>,时长 <时长> +📍 地点: <会议地点> +📝 描述: <会议描述> +👤 创建者: <创建者姓名> +👥 参与者: <参与者姓名列表> +🔗 会议链接: <会议链接> +``` + +--- + +### 工作流 5: 根据关键词查找会议 + +**示例**: 用户说 "技术评审会议是什么时候?" + +**查询策略:** + +1. **确定查询范围**: 默认查当日前后 30 天 (接口限制范围)。 +2. **拉取会议列表**: + +```bash +wecom-cli meeting list_user_meetings '{"begin_datetime": "2026-02-15 00:00", "end_datetime": "2026-04-16 23:59", "limit": 100}' +``` + +3. **逐个查询详情并匹配标题关键词**。 +4. **找到匹配后停止查询,展示结果**: + +#会议号: <会议号> + +``` +✅ 找到会议: "<会议标题>" + +📅 时间: <开始时间>,时长 <时长> +📍 地点: <会议地点> +👥 参与者: <参与者姓名列表> +🔗 会议链接: <会议链接> +``` + +5. **未找到处理**: 告知用户在前后 30 天范围内未找到匹配会议,请确认会议名称。 + +--- + +### 工作流 6: 取消会议 + +**示例**: 用户说 "帮我取消明天的技术方案评审会议" + +**步骤:** + +1. **定位会议**: 通过 `list_user_meetings` + `get_meeting_info` 查询会议列表 + 关键词匹配找到目标会议。 +2. **直接执行取消**: + +```bash +wecom-cli meeting cancel_meeting '{"meetingid": ""}' +``` + +3. **展示结果**: + +``` +✅ 会议已取消: 技术方案评审 +``` + +--- + +### 工作流 7: 更新会议成员 + +**示例**: 用户说 "把王五加到技术方案评审会议里" + +**步骤:** + +1. **定位会议**: 通过 `list_user_meetings` + `get_meeting_info` 查询会议列表 + 匹配找到目标会议。 +2. **获取当前受邀成员**: `set_invite_meeting_members` 为全量覆盖,必须先通过 `get_meeting_info` 获取会议详情,获取现有成员后再合并。 +3. **通讯录查询**: 调用 `wecomcli-contact` 技能获取通讯录成员,按姓名筛选出王五的 userid。 + +```bash +wecom-cli contact get_userlist '{}' +``` + +在返回的 `userlist` 中筛选 `name` 包含 "王五" 的成员,获取其 `userid`。 + +4. **合并成员列表**: 将现有成员 + 新增成员合并 (全量覆盖)。 +5. **执行更新**: + +```bash +wecom-cli meeting set_invite_meeting_members '{"meetingid": "", "invitees": [{"userid": "zhangsan"}, {"userid": "lisi"}, {"userid": "wangwu"}]}' +``` + +6. **展示结果**: + +``` +✅ 会议成员已更新: 技术方案评审 +👥 当前成员: 张三,李四,王五 +``` + +--- + +## 复杂场景样例 + +按场景按需加载,避免一次性引入过多无关示例: + +| 文件 | 适用场景 | +| ---- | -------- | +| [references/response-get-meeting-info.md](references/response-get-meeting-info.md) | 获取会议详情完整返回参数结构和字段说明 | +| [references/example-security.md](references/example-security.md) | 会议密码,等候室,外部用户限制 | +| [references/example-reminder.md](references/example-reminder.md) | 响铃提醒,指定部分人响铃 | +| [references/example-full.md](references/example-full.md) | 全参数综合场景 (含静音,屏幕水印,等候室等设置) | + +--- + +## 注意事项 + +- **信息追问**: 缺少时间或主题时,简洁追问用户;未提及邀请人则默认留空 +- **通讯录查询**: 涉及参与人时,需先通过 `wecomcli-contact` 技能的 `get_userlist` 接口获取全量通讯录成员,再按姓名/别名本地筛选匹配出对应的 `userid`。该接口无入参,返回当前用户可见范围内的成员列表 (含 `userid`,`name`,`alias`) +- **直接创建**: 时间 + 主题已知即可直接创建,邀请人有则带上,无则留空;无论信息是一次性提供还是上下文可推断,非必要则均不请求确认,直接创建即可 +- **时间格式**: 统一使用 `YYYY-MM-DD HH:mm` 格式 +- **会议列表时间范围限制**: 仅支持查询当日及前后 30 天内的会议 +- **查询详情需两步**: 先通过 `list_user_meetings` 获取会议 ID 列表,再通过 `get_meeting_info` 逐个获取详情 +- **定位会议**: 取消会议和更新成员等管理操作需先通过查询定位到目标会议的 meetingid +- **成员更新为全量覆盖**: `set_invite_meeting_members` 传入的列表将替换现有成员列表,需先获取当前成员再合并 +- **参与人仅支持企业内成员**,不支持外部人员 diff --git a/skills/wecomcli-meeting/references/example-full.md b/skills/wecomcli-meeting/references/example-full.md new file mode 100644 index 0000000..9ee4f93 --- /dev/null +++ b/skills/wecomcli-meeting/references/example-full.md @@ -0,0 +1,30 @@ +# 创建会议 - 全参数综合场景示例 + +## 场景 : 高规格会议 (全参数) + +**用户意图**: "帮我创建一个高规格的季度战略会议: 下周一上午9点,时长4小时,邀请全团队,设置密码,开启等候室,开启屏幕水印,全员静音" + +```json +{ + "title": "Q2季度战略规划会", + "meeting_start_datetime": "2026-03-23 09:00", + "meeting_duration": 14400, + "description": "Q2季度战略规划,请各部门负责人提前准备汇报材料", + "location": "总部大会议室", + "invitees": { + "userid": ["zhangsan", "lisi", "wangwu", "zhaoliu", "sunqi"] + }, + "settings": { + "password": "2026", + "enable_waiting_room": true, + "allow_enter_before_host": false, + "enable_enter_mute": 1, + "allow_external_user": false, + "enable_screen_watermark": true, + "remind_scope": 3, + "ring_users": { + "userid": ["zhangsan", "lisi", "wangwu", "zhaoliu", "sunqi"] + } + } +} +``` diff --git a/skills/wecomcli-meeting/references/example-reminder.md b/skills/wecomcli-meeting/references/example-reminder.md new file mode 100644 index 0000000..b96b4f2 --- /dev/null +++ b/skills/wecomcli-meeting/references/example-reminder.md @@ -0,0 +1,43 @@ +# 创建会议 - 响铃提醒场景示例 + +## 场景 1: 仅提醒主持人 + +**用户意图**: "帮我创建一个会议,只提醒主持人,其他人不要响铃" + +```json +{ + "title": "项目启动会", + "meeting_start_datetime": "2026-03-21 10:00", + "meeting_duration": 3600, + "invitees": { + "userid": ["zhangsan", "lisi"] + }, + "settings": { + "remind_scope": 2 + } +} +``` + +--- + +## 场景 2: 指定部分人响铃 (remind_scope=4) + +**用户意图**: "帮我创建一个会议,只响铃提醒张三和李四,其他人不提醒" + +```json +{ + "title": "紧急故障复盘", + "meeting_start_datetime": "2026-03-18 20:00", + "meeting_duration": 3600, + "invitees": { + "userid": ["zhangsan", "lisi", "wangwu", "zhaoliu"] + }, + "settings": { + "remind_scope": 4, + "ring_users": { + "userid": ["zhangsan", "lisi"] + }, + "allow_enter_before_host": true + } +} +``` diff --git a/skills/wecomcli-meeting/references/example-security.md b/skills/wecomcli-meeting/references/example-security.md new file mode 100644 index 0000000..6e7e8ce --- /dev/null +++ b/skills/wecomcli-meeting/references/example-security.md @@ -0,0 +1,22 @@ +# 创建会议 - 安全设置场景示例 + +## 场景 : 会议密码 + 等候室 + 主持人设置 + +**用户意图**: "帮我创建一个重要的客户汇报会议,需要设置密码1234,开启等候室,不允许外部人员入会" + +```json +{ + "title": "客户汇报会议", + "meeting_start_datetime": "2026-03-19 14:00", + "meeting_duration": 5400, + "invitees": { + "userid": ["zhangsan", "lisi", "wangwu"] + }, + "settings": { + "password": "1234", + "enable_waiting_room": true, + "allow_enter_before_host": false, + "allow_external_user": false + } +} +``` diff --git a/skills/wecomcli-meeting/references/response-get-meeting-info.md b/skills/wecomcli-meeting/references/response-get-meeting-info.md new file mode 100644 index 0000000..58789c9 --- /dev/null +++ b/skills/wecomcli-meeting/references/response-get-meeting-info.md @@ -0,0 +1,148 @@ +# 获取会议详情 (get_meeting_info) - 返回参数 + +## 返回参数 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "creator_userid": "创建者userid", + "admin_userid": "会议管理userid (与 creator_userid 有且仅返回一个)", + "title": "会议标题", + "meeting_start_datetime": "YYYY-MM-DD HH:mm", + "meeting_duration": "会议时长秒数", + "description": "会议描述文本", + "location": "会议地点文本", + "main_department": "创建者主部门ID", + "status": "会议状态枚举值", + "meeting_type": "会议类型枚举值", + "attendees": { + "member": [ + { + "userid": "内部成员userid", + "status": "与会状态枚举值", + "first_join_datetime": "YYYY-MM-DD HH:mm", + "last_quit_datetime": "YYYY-MM-DD HH:mm", + "total_join_count": "加入次数", + "cumulative_time": "累计在会时长秒数" + } + ], + "tmp_external_user": [ + { + "tmp_external_userid": "外部临时用户ID", + "status": "与会状态枚举值", + "first_join_datetime": "YYYY-MM-DD HH:mm", + "last_quit_datetime": "YYYY-MM-DD HH:mm", + "total_join_count": "加入次数", + "cumulative_time": "累计在会时长秒数" + } + ] + }, + "settings": { + "remind_scope": "提醒范围枚举值", + "need_password": "是否需要密码布尔值", + "password": "会议密码", + "enable_waiting_room": "是否启用等候室布尔值", + "allow_enter_before_host": "是否允许提前入会布尔值", + "enable_enter_mute": "入会静音枚举值", + "allow_unmute_self": "是否允许自我解除静音布尔值", + "allow_external_user": "是否允许外部用户布尔值", + "enable_screen_watermark": "是否开启水印布尔值", + "watermark_type": "水印类型枚举值", + "auto_record_type": "录制类型枚举字符串", + "attendee_join_auto_record": "参会者加入自动录制布尔值", + "enable_host_pause_auto_record": "主持人可暂停录制布尔值", + "enable_doc_upload_permission": "允许上传文档布尔值", + "enable_enroll": "是否开启报名布尔值", + "enable_host_key": "是否启用主持人密钥布尔值", + "host_key": "主持人密钥字符串", + "hosts": {"userid": ["主持人userid列表"]}, + "current_hosts": {"userid": ["当前主持人userid列表"]}, + "co_hosts": {"userid": ["联席主持人userid列表"]}, + "ring_users": {"userid": ["响铃用户userid列表"]} + }, + "meeting_code": "会议号码字符串", + "meeting_link": "会议链接URL", + "has_vote": "是否有投票布尔值", + "has_more_sub_meeting": "是否还有更多子会议枚举值", + "remain_sub_meetings": "剩余子会议场数", + "current_sub_meetingid": "当前子会议ID", + "guests": [ + { + "area": "国际区号", + "phone_number": "手机号字符串", + "guest_name": "嘉宾姓名" + } + ], + "reminders": { + "is_repeat": "是否周期性枚举值", + "repeat_type": "重复类型枚举值", + "repeat_until_type": "结束类型枚举值", + "repeat_until_count": "限定次数", + "repeat_until_datetime": "YYYY-MM-DD HH:mm", + "repeat_interval": "重复间隔数值", + "is_custom_repeat": "是否自定义重复枚举值", + "repeat_day_of_week": ["星期几数组"], + "repeat_day_of_month": ["日期数组"], + "remind_before": ["提醒秒数数组"] + }, + "sub_meetings": [ + { + "sub_meetingid": "子会议ID", + "status": "子会议状态枚举值", + "start_datetime": "YYYY-MM-DD HH:mm", + "end_datetime": "YYYY-MM-DD HH:mm", + "title": "子会议标题", + "repeat_id": "周期性会议分段ID" + } + ], + "sub_repeat_list": [ + { + "repeat_id": "周期性会议分段ID", + "repeat_type": "重复类型枚举值", + "repeat_until_type": "结束类型枚举值", + "repeat_until_count": "限定次数", + "repeat_until_datetime": "YYYY-MM-DD HH:mm", + "repeat_interval": "重复间隔数值", + "is_custom_repeat": "是否自定义重复枚举值", + "repeat_day_of_week": ["星期几数组"], + "repeat_day_of_month": ["日期数组"] + } + ] +} +``` + +## 关键返回字段 + +| 字段 | 类型 | 说明 | +| ----------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------- | +| `creator_userid` | string | 创建者 userid,与 `admin_userid` 有且仅返回一个 | +| `admin_userid` | string | 会议管理 userid,与 `creator_userid` 有且仅返回一个 | +| `title` | string | 会议标题 | +| `meeting_start_datetime` | string | 会议开始时间 | +| `meeting_duration` | integer | 会议时长 (秒) | +| `main_department` | integer | 创建者所属主部门 | +| `status` | integer | 会议状态 (1: 待开始,2: 会议中,3: 已结束,4: 已取消,5: 已过期) | +| `meeting_type` | integer | 会议类型 (0: 一次性会议,1: 周期性会议,2: 微信专属会议,3: Rooms 投屏会议,5: 个人会议号会议,6: 网络研讨会) | +| `meeting_code` | string | 会议号码 | +| `meeting_link` | string | 会议链接 | +| `attendees.member` | array | 内部参与者列表 | +| `attendees.member[].status` | integer | 与会状态 (1: 已参与,2: 未参与) | +| `attendees.tmp_external_user` | array | 外部参与者 (临时 ID) | +| `attendees.tmp_external_user[].status` | integer | 与会状态 (1: 已参与,2: 未参与) | +| `guests` | array | 外部嘉宾列表,每项含 `area`,`phone_number`,`guest_name` | +| `current_sub_meetingid` | string | 当前子会议 ID | +| `settings.ring_users` | object | 响铃用户列表 | +| `settings.need_password` | boolean | 是否需要密码 (只读字段) | +| `settings.enable_doc_upload_permission` | boolean | 是否允许成员上传文档 | +| `settings.hosts` | object | 主持人列表 | +| `settings.current_hosts` | object | 当前主持人列表 | +| `settings.co_hosts` | object | 联席主持人列表 | +| `reminders` | object | 周期性配置 | +| `has_vote` | boolean | 是否有投票 (仅会议创建人和主持人有权限查询) | +| `has_more_sub_meeting` | integer | 是否还有更多子会议特例 (0: 无更多,1: 有更多) | +| `remain_sub_meetings` | integer | 剩余子会议场数 | +| `sub_meetings` | array | 子会议列表 | +| `sub_meetings[].status` | integer | 子会议状态 (0: 默认/存在,1: 已删除) | +| `sub_meetings[].repeat_id` | string | 周期性会议分段 ID,用于关联子会议所属分段 | +| `sub_repeat_list` | array | 周期性会议分段信息,修改周期性会议某一场后可能产生不同分段,各分段有不同重复规则 | diff --git a/skills/wecomcli-msg/SKILL.md b/skills/wecomcli-msg/SKILL.md new file mode 100644 index 0000000..6c110e4 --- /dev/null +++ b/skills/wecomcli-msg/SKILL.md @@ -0,0 +1,164 @@ +--- +name: wecomcli-msg +description: 企业微信消息技能。提供会话列表查询、消息记录拉取(支持文本/图片/文件/语音/视频)、多媒体文件获取和文本消息发送能力。当用户需要"查看消息"、"看聊天记录"、"发消息给某人"、"最近有什么消息"、"给群里发消息"、"看看发了什么图片/文件"时触发。 +metadata: + requires: + bins: ["wecom-cli"] + cliHelp: "wecom-cli msg --help" +--- + +# 企业微信消息技能 + +> `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 + + +通过 `wecom-cli msg <接口名> ''` 与企业微信消息系统交互。 + +--- + +## 接口列表 + +### get_msg_chat_list — 获取会话列表 + +```bash +wecom-cli msg get_msg_chat_list '{"begin_time": "2026-03-11 00:00:00", "end_time": "2026-03-17 23:59:59"}' +``` + +按时间范围查询有消息的会话列表,支持分页。参见 [API 详情](references/get-msg-chat-list.md)。 + +### get_message — 拉取会话消息 + +```bash +wecom-cli msg get_message '{"chat_type": 1, "chatid": "zhangsan", "begin_time": "2026-03-17 09:00:00", "end_time": "2026-03-17 18:00:00"}' +``` + +根据会话类型和 ID 拉取指定时间范围内的消息记录,支持分页。支持 text/image/file/voice/video 消息类型,仅支持 7 天内。参见 [API 详情](references/get-message.md)。 + +### get_msg_media — 获取消息文件内容 + +```bash +wecom-cli msg get_msg_media '{"media_id": "MEDIAID_xxxxxx"}' +``` + +根据文件 ID 自动下载文件到本地,返回文件的本地路径(`local_path`)、名称、类型、大小及 MIME 类型。用于获取图片、文件、语音、视频等非文本消息的实际内容。参见 [API 详情](references/get-msg-media.md)。 + +### send_message — 发送文本消息 + +```bash +wecom-cli msg send_message '{"chat_type": 1, "chatid": "zhangsan", "msgtype": "text", "text": {"content": "hello world"}}' +``` + +向单聊或群聊发送文本消息。参见 [API 详情](references/send-message.md)。 + +--- + +## 核心规则 + +### 时间范围规则 +- **格式**:所有时间参数使用 `YYYY-MM-DD HH:mm:ss` 格式 +- **默认范围**:用户未指定时,默认使用最近7天(当前时间往前推7天) +- **限制**:开始时间不能早于当前时间的7天前,不能晚于当前时间 +- **相对时间支持**:支持"昨天"、"最近三天"等自动推算 + +### chatid查找规则 +- 当用户提供人名或群名而非ID时: + 1. 调用 `get_msg_chat_list` 获取会话列表(时间范围与目标查询一致) + 2. 在 `chats` 中按 `chat_name` 匹配 + 3. **匹配策略**: + - 精确匹配唯一结果:直接使用 + - 模糊匹配多个结果:展示候选列表让用户选择 + - 无匹配结果:告知用户未找到 +- **chat_type 判断**:`get_msg_chat_list` 返回中不含会话类型字段,需根据上下文推断:用户明确提到「群」时使用 `chat_type=2`,否则默认 `chat_type=1`(单聊) + +### userid 转 name +**流程**: +1. 调用 `wecomcli-contact` 技能的 `get_userlist` 获取用户列表 +2. 建立 userid 到 name 的映射关系 +3. **展示策略**: + - 精确匹配:显示 name + - 无匹配:保持显示 userid + +### 强制交互步骤(不可跳过) +以下步骤在涉及非文本消息下载时**必须逐一执行**,不得合并、省略或跳过,即使用户未主动询问也必须执行: +1. **必须主动告知文件位置**:下载完成后必须立即向用户展示所有文件的完整路径和存放目录 +2. **必须询问是否删除**:告知位置后必须立即询问用户是否需要清理临时文件 + +--- + +## 典型工作流 + +### 查看会话列表 +**用户query示例**: +- "看看我最近一周有哪些聊天" +- "这几天谁给我发过消息" + +**执行流程**: +1. 确定时间范围(用户指定或默认最近7天) +2. 调用 `get_msg_chat_list` 获取会话列表 +3. 展示会话名称、最后消息时间、消息数量 +4. 若 `has_more` 为 `true`,告知用户还有更多会话可继续查看 + +### 查看聊天记录 +**用户query示例**: +- "帮我看看和张三最近的聊天记录" +- "看看项目群里最近的消息" + +**执行流程**: +1. 确定时间范围(用户指定或默认最近7天) +2. 通过 **chatid查找规则** 确定目标会话的 `chatid` 和 `chat_type` +3. 调用 `get_message` 拉取消息列表 +4. 调用 `wecomcli-contact` 技能的 `get_userlist` 获取通讯录,建立 userid→姓名 映射 +5. **统计非文本消息**:遍历消息列表,统计 `msgtype` 非 `text` 的消息(image/file/voice/video)数量和类型 +6. 展示消息时将 `userid` 替换为可读姓名,格式: + - 文本消息:`姓名 [时间]: 内容` + - 图片消息:`姓名 [时间]:[图片]` + - 文件消息:`姓名 [时间]:[文件] 文件名称` + - 语音消息:`姓名 [时间]:[语音] 语音内容` + - 视频消息:`姓名 [时间]:[视频]` +7. **非文本消息处理**:展示完消息后,如果存在非文本消息: + - **主动询问是否下载**:告知用户非文本消息数量和类型(如:"以上聊天中包含 2 张图片、1 个文件,是否需要下载到本地?") + - 用户确认后,逐个调用 `get_msg_media` 接口,接口会自动下载文件并返回 `local_path` + - **检查文件后缀**:每个文件下载完成后,检查 `local_path` 对应的文件是否具有正确的后缀名: + - 根据 `get_msg_media` 返回的 `content_type`(MIME 类型)和 `name` 字段判断: + - 如果文件名缺少后缀(如 `screenshot` 而非 `screenshot.png`),根据 `content_type` 自动补上正确后缀(如 `image/png` → `.png`,`application/pdf` → `.pdf`,`audio/amr` → `.amr`,`video/mp4` → `.mp4`) + - 如果文件名后缀与 `content_type` 不一致,以 `content_type` 为准进行修正 + - 补全或修正后缀后,将文件重命名为正确的文件名 + - 确认文件可正常读取(文件大小 > 0),若文件为空或损坏则告知用户该文件下载异常 + - ⚠️ **不要对下载的文件使用 `MEDIA:` 指令**:这些文件是从聊天记录中下载的历史附件,仅需告知用户本地存放路径即可,**严禁**通过 `MEDIA:` 指令重新发送给用户 +8. ⚠️ **必须主动告知文件位置**(此步骤不可跳过):所有文件下载并检查完成后,**必须立即、主动**以汇总形式向用户展示文件存放目录和每个文件的完整路径,不要等用户询问。示例: + > 📁 文件已下载到以下位置: + > - 图片:`xxx/yyy.png` + > - 文件:`xxx/yyy.pdf` + > + > 你可以在 `xxx/yyy/` 目录下找到所有下载的文件。 +9. ⚠️ **必须询问是否删除**(此步骤不可跳过):告知文件位置后,**必须立即、主动**询问用户是否需要删除已下载的临时文件(如:"如果不再需要这些文件,是否需要我帮你清理?") + - 用户确认删除后,删除 `local_path` 对应的文件 + - 用户不需要删除则保留文件 +10. 若 `next_cursor` 不为空,告知用户还有更多消息可继续查看 + +### 发送消息 +**用户query示例**: +- "帮我给张三发一条消息:明天会议改到下午3点" +- "在项目群里发一条消息:今天下午3点开会" + +**执行流程**: +1. 通过 **chatid查找规则** 确定目标会话的 `chatid` 和 `chat_type` +2. **发送前确认**:向用户确认发送对象和内容(如:"即将向 张三 发送:'明天会议改到下午3点',确认发送吗?"),用户确认后再执行 +3. 调用 `send_message` 发送(`msgtype` 固定为 `text`) +4. 展示发送结果 + +### 查看消息并回复 +**用户query示例**: +- "看看张三给我发了什么,然后帮我回复收到" + +**执行流程**: +1. 先执行"查看聊天记录"流程(复用已获取的 `chatid` 和 `chat_type`) +2. 展示消息后,执行"发送消息"流程(需确认后再发送) + +--- + +## 错误处理 +- **时间范围超限**:告知用户7天限制并调整为有效范围 +- **会话未找到**:明确告知用户未找到对应会话 +- **API错误**:展示具体错误信息,必要时重试 +- **网络问题**:HTTP错误时主动重试最多3次 \ No newline at end of file diff --git a/skills/wecomcli-msg/references/get-message.md b/skills/wecomcli-msg/references/get-message.md new file mode 100644 index 0000000..355d8de --- /dev/null +++ b/skills/wecomcli-msg/references/get-message.md @@ -0,0 +1,99 @@ +# get_message API + +根据会话类型和会话 ID,拉取指定时间范围内的消息记录。支持文本、图片、文件、语音、视频类型消息。 + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `chat_type` | integer | ✅ | 会话类型,`1`-单聊,`2`-群聊 | +| `chatid` | string | ✅ | 会话 ID,单聊时为 userid,群聊时为群 ID,最大 256 字节 | +| `begin_time` | string | ✅ | 拉取开始时间,格式:`YYYY-MM-DD HH:mm:ss`,仅支持请求时刻往前 **7 天**内 | +| `end_time` | string | ✅ | 拉取结束时间,格式:`YYYY-MM-DD HH:mm:ss`,必须 ≥ `begin_time` | +| `cursor` | string | ❌ | 分页游标,首次请求不传,后续传入上次响应的 `next_cursor`,最大 256 字节 | + +## 请求示例 + +单聊: + +```bash +wecom-cli msg get_message '{"chat_type": 1, "chatid": "zhangsan", "begin_time": "2026-03-17 09:00:00", "end_time": "2026-03-17 18:00:00"}' +``` + +群聊: + +```bash +wecom-cli msg get_message '{"chat_type": 2, "chatid": "wrxxxxxxxx", "begin_time": "2026-03-17 09:00:00", "end_time": "2026-03-17 18:00:00"}' +``` + +分页请求: + +```bash +wecom-cli msg get_message '{"chat_type": 1, "chatid": "zhangsan", "begin_time": "2026-03-17 09:00:00", "end_time": "2026-03-17 18:00:00", "cursor": "CURSOR_xxxxxx"}' +``` + +## 返回字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功 | +| `errmsg` | string | 错误信息 | +| `messages` | array | 消息列表 | +| `messages[].userid` | string | 消息发送者的 userid | +| `messages[].send_time` | string | 消息发送时间(北京时间),格式:`YYYY-MM-DD HH:mm:ss` | +| `messages[].msgtype` | string | 消息类型,`text`-文本消息,`image`-图片消息,`file`-文件消息,`voice`-语音消息,`video`-视频消息 | +| `messages[].text` | object | 文本消息内容,`msgtype` 为 `text` 时返回 | +| `messages[].text.content` | string | 消息内容 | +| `messages[].image` | object | 图片消息内容,`msgtype` 为 `image` 时返回 | +| `messages[].image.media_id` | string | 图片的 media_id,可通过 `get_msg_media` 接口下载 | +| `messages[].image.name` | string | 图片文件名称 | +| `messages[].file` | object | 文件消息内容,`msgtype` 为 `file` 时返回 | +| `messages[].file.media_id` | string | 文件的 media_id,可通过 `get_msg_media` 接口下载 | +| `messages[].file.name` | string | 文件名称 | +| `messages[].voice` | object | 语音消息内容,`msgtype` 为 `voice` 时返回 | +| `messages[].voice.media_id` | string | 语音的 media_id,可通过 `get_msg_media` 接口下载 | +| `messages[].video` | object | 视频消息内容,`msgtype` 为 `video` 时返回 | +| `messages[].video.media_id` | string | 视频的 media_id,可通过 `get_msg_media` 接口下载 | +| `next_cursor` | string | 分页游标,为空表示已拉取完毕 | + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "messages": [ + { + "userid": "zhangsan", + "send_time": "2026-03-17 09:30:00", + "msgtype": "text", + "text": { + "content": "你好" + } + }, + { + "userid": "lisi", + "send_time": "2026-03-17 09:35:00", + "msgtype": "image", + "image": { + "media_id": "MEDIAID_xxxxxx", + "name": "screenshot.png" + } + }, + { + "userid": "zhangsan", + "send_time": "2026-03-17 09:40:00", + "msgtype": "file", + "file": { + "media_id": "MEDIAID_yyyyyy", + "name": "report.pdf" + } + } + ], + "next_cursor": "CURSOR_xxxxxx" +} +``` + +## 非文本消息处理 + +当 `msgtype` 为 `image`、`file`、`voice`、`video` 时,消息体中包含 `media_id`。需要调用 [get_msg_media](get-msg-media.md) 接口获取文件的本地路径(`local_path`),再进行展示。 \ No newline at end of file diff --git a/skills/wecomcli-msg/references/get-msg-chat-list.md b/skills/wecomcli-msg/references/get-msg-chat-list.md new file mode 100644 index 0000000..476b534 --- /dev/null +++ b/skills/wecomcli-msg/references/get-msg-chat-list.md @@ -0,0 +1,62 @@ +# get_msg_chat_list API + +获取指定时间范围内有消息的会话列表,支持分页查询。 + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `begin_time` | string | ✅ | 拉取开始时间,格式:`YYYY-MM-DD HH:mm:ss` | +| `end_time` | string | ✅ | 拉取结束时间,格式:`YYYY-MM-DD HH:mm:ss` | +| `cursor` | string | ❌ | 分页游标,首次请求不传,后续传入上次响应的 `next_cursor`,最大长度 256 | + +## 请求示例 + +```bash +wecom-cli msg get_msg_chat_list '{"begin_time": "2026-03-11 00:00:00", "end_time": "2026-03-17 23:59:59"}' +``` + +分页请求: + +```bash +wecom-cli msg get_msg_chat_list '{"begin_time": "2026-03-11 00:00:00", "end_time": "2026-03-17 23:59:59", "cursor": "NEXT_CURSOR"}' +``` + +## 返回字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功 | +| `errmsg` | string | 错误信息 | +| `chats` | array | 会话列表 | +| `chats[].chat_id` | string | 会话 ID | +| `chats[].chat_name` | string | 会话名称 | +| `chats[].last_msg_time` | string | 最后一条消息时间,格式:`YYYY-MM-DD HH:mm:ss` | +| `chats[].msg_count` | integer | 消息数量 | +| `has_more` | boolean | 是否还有更多数据 | +| `next_cursor` | string | 分页游标,用于下一次请求 | + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "chats": [ + { + "chat_id": "CHAT_ID", + "chat_name": "张三", + "last_msg_time": "2026-03-17 15:30:45", + "msg_count": 128 + }, + { + "chat_id": "CHAT_ID_2", + "chat_name": "项目讨论群", + "last_msg_time": "2026-03-16 09:12:33", + "msg_count": 56 + } + ], + "has_more": true, + "next_cursor": "NEXT_CURSOR" +} +``` diff --git a/skills/wecomcli-msg/references/get-msg-media.md b/skills/wecomcli-msg/references/get-msg-media.md new file mode 100644 index 0000000..d1647c2 --- /dev/null +++ b/skills/wecomcli-msg/references/get-msg-media.md @@ -0,0 +1,46 @@ +# get_msg_media API + +获取消息文件内容。根据文件 ID 自动下载文件到本地,返回本地文件路径、文件名称、类型、大小及内容类型。 + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `media_id` | string | ✅ | 文件 ID,长度 1~256 | + +## 请求示例 + +```bash +wecom-cli msg get_msg_media '{"media_id": "MEDIAID_xxxxxx"}' +``` + +## 返回字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功 | +| `errmsg` | string | 错误信息 | +| `media_item` | object | 文件内容 | +| `media_item.media_id` | string | 文件 ID | +| `media_item.name` | string | 文件名称 | +| `media_item.type` | string | 文件类型,`image`-图片,`voice`-语音,`video`-视频,`file`-普通文件 | +| `media_item.local_path` | string | 文件下载后的本地路径 | +| `media_item.size` | integer | 文件大小(字节) | +| `media_item.content_type` | string | 文件 MIME 类型,如 `image/png`、`application/pdf` 等 | + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "media_item": { + "media_id": "MEDIAID_xxxxxx", + "name": "screenshot.png", + "type": "image", + "local_path": "xxx/yyy/screenshot.png", + "size": 102400, + "content_type": "image/png" + } +} +``` diff --git a/skills/wecomcli-msg/references/send-message.md b/skills/wecomcli-msg/references/send-message.md new file mode 100644 index 0000000..88a8a9d --- /dev/null +++ b/skills/wecomcli-msg/references/send-message.md @@ -0,0 +1,43 @@ +# send_message API + +向单聊或群聊发送文本消息。 + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `chat_type` | integer | ✅ | 会话类型,`1`-单聊,`2`-群聊 | +| `chatid` | string | ✅ | 会话 ID,单聊时为 userid,群聊时为群 ID,最大 256 字节 | +| `msgtype` | string | ✅ | 消息类型,目前仅支持 `text` | +| `text` | object | ✅ | 文本消息内容 | +| `text.content` | string | ✅ | 消息内容,最大 2048 字节 | + +## 请求示例 + +单聊: + +```bash +wecom-cli msg send_message '{"chat_type": 1, "chatid": "zhangsan", "msgtype": "text", "text": {"content": "hello world"}}' +``` + +群聊: + +```bash +wecom-cli msg send_message '{"chat_type": 2, "chatid": "wrxxxxxxxx", "msgtype": "text", "text": {"content": "大家好"}}' +``` + +## 返回字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功 | +| `errmsg` | string | 错误信息 | + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok" +} +``` diff --git a/skills/wecomcli-schedule/SKILL.md b/skills/wecomcli-schedule/SKILL.md new file mode 100644 index 0000000..6b918a2 --- /dev/null +++ b/skills/wecomcli-schedule/SKILL.md @@ -0,0 +1,176 @@ +--- +name: wecomcli-schedule +description: 企业微信日程管理技能。适用于用户对企业微信日程的各类管理需求。当用户需要:(1) 查询指定时间范围内的日程列表或获取日程详细信息(标题、时间、地点、参与者等),(2) 创建新日程并设置提醒、参与人等,(3) 修改已有日程的标题、时间、地点等信息或取消日程,(4) 添加或移除日程参与人,(5) 查询多个成员的闲忙状态并分析共同空闲时段以安排会议时使用此技能。 +metadata: + requires: + bins: ["wecom-cli"] + cliHelp: "wecom-cli schedule --help" +--- + +# 企业微信日程管理技能 + +> `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 + + +通过 `wecom-cli schedule <接口名> ''` 与企业微信日程系统交互。 + +## 注意事项 + +- 日程列表查询仅支持**当日前后 30 天**,时间格式 `YYYY-MM-DD` 或 `YYYY-MM-DD HH:mm:ss` +- 涉及参与者 userid 时,需先使用 **wecomcli-contact** 技能获取;存在同名时展示候选让用户选择(禁止暴露 userid) +- 创建/修改/取消前,先确认目标日程和参与者信息 +- `errcode != 0` 时展示错误信息;返回的 `start_time`/`end_time` 为 Unix 时间戳(秒),需转为可读格式 +- **注意时间格式转换**:接口入参使用字符串格式(如 `YYYY-MM-DD HH:mm:ss`),但返回值多为 Unix 时间戳,使用时需进行格式转换 + +--- + +## 接口列表 + +### get_schedule_list_by_range — 查询日程 ID 列表 + +```bash +wecom-cli schedule get_schedule_list_by_range '{"start_time": "YYYY-MM-DD HH:mm:ss", "end_time": "YYYY-MM-DD HH:mm:ss"}' +``` + +返回 `schedule_id_list` 数组。仅支持当日前后 30 天。 + +### get_schedule_detail — 获取日程详情 + +```bash +wecom-cli schedule get_schedule_detail '{"schedule_id_list": ["SCHEDULE_ID_1", "SCHEDULE_ID_2"]}' +``` + +支持 1~50 个 ID,返回日程标题、时间、地点、参与者等。参见 [API 详情](references/get-schedule-detail.md)。 + +### create_schedule — 创建日程 + +```bash +wecom-cli schedule create_schedule '{"schedule": {"start_time": "YYYY-MM-DD HH:mm:ss", "end_time": "YYYY-MM-DD HH:mm:ss", "summary": "日程标题", "attendees": [{"userid": "USER_ID"}], "reminders": {"is_remind": 1, "remind_before_event_secs": 3600, "timezone": 8}}}' +``` + +参见 [API 详情](references/create-schedule.md) | [reminders 字段](references/ref-reminders.md)。 + +### update_schedule — 修改日程 + +只需传入需修改的字段,未传字段保持不变。 + +```bash +wecom-cli schedule update_schedule '{"schedule": {"schedule_id": "SCHEDULE_ID", "summary": "更新后的标题"}}' +``` + +参见 [API 详情](references/update-schedule.md)。 + +### cancel_schedule — 取消日程 + +```bash +wecom-cli schedule cancel_schedule '{"schedule_id": "SCHEDULE_ID"}' +``` + +### add_schedule_attendees / del_schedule_attendees — 管理参与人 + +- 添加参与人: +```bash +wecom-cli schedule add_schedule_attendees '{"schedule_id": "SCHEDULE_ID", "attendees": [{"userid": "USER_ID"}]}' +``` +- 移除参与人: +```bash +wecom-cli schedule del_schedule_attendees '{"schedule_id": "SCHEDULE_ID", "attendees": [{"userid": "USER_ID"}]}' +``` + +### check_availability — 查询闲忙 + +```bash +wecom-cli schedule check_availability '{"check_user_list": ["USER_ID_1", "USER_ID_2"], "start_time": "YYYY-MM-DD HH:mm:ss", "end_time": "YYYY-MM-DD HH:mm:ss"}' +``` + +支持 1~10 个用户,返回各用户的忙碌时段列表。参见 [API 详情](references/check-availability.md)。 + +--- + +## 典型工作流 + +### 查询日程 + +**经典 query 示例:** +- "我今天有哪些日程?" +- "帮我看看这周三下午有没有会议" +- "明天的日程安排是什么?" +- "查一下最近有没有关于项目评审的日程" +- "我下周一到周五的日程都有哪些?" + +**流程:** +1. 根据用户意图计算时间范围(如"今天"→当日 00:00:00 至 23:59:59,"这周"→本周一至周日) +2. 调用 `get_schedule_list_by_range` 获取日程 ID 列表 +3. 调用 `get_schedule_detail` 批量获取详情,将 Unix 时间戳转为可读时间 +4. 若用户提到关键词(如"项目评审"),在 `summary` 中匹配筛选;未找到则逐步扩大范围至前后 30 天上限 +5. 展示日程列表时包含标题、时间、地点、参与者等关键信息,方便用户快速了解 + +### 创建日程 + +**经典 query 示例:** +- "帮我创建一个明天下午 2 点到 3 点的会议,标题叫需求评审" +- "安排一个周五全天的团建活动" +- "创建日程:后天上午 10 点和张三、李四开产品方案讨论会,地点在 3 楼会议室" +- "帮我建个日程,下周一 14:00-15:00,提前 15 分钟提醒" +- "约一个明天上午的日程,邀请王伟参加" + +**流程:** +1. 解析用户意图,提取时间、标题、地点、参与人、提醒设置等信息 +2. 若涉及参与人,先通过 **wecomcli-contact** 查询 userid;存在同名时展示候选让用户选择 +3. 若用户未指定提醒,默认设置提前 15 分钟提醒(`remind_before_event_secs: 900`) +4. 若用户说"全天",设置 `is_whole_day: 1`,时间设为当天 00:00:00 至 23:59:59 +5. 向用户确认日程信息(标题、时间、地点、参与人等)后调用 `create_schedule` + +### 修改日程 + +**经典 query 示例:** +- "把明天的需求评审改到后天下午 3 点" +- "帮我修改下今天下午的会议标题,改成技术方案评审" +- "我今天 14 点的日程地点改成线上腾讯会议" +- "把周五的团建活动推迟一个小时" +- "帮我给明天的周会加个描述:讨论 Q2 规划" + +**流程:** +1. 先通过查询工作流定位目标日程(根据用户提到的时间、标题等关键词匹配) +2. 若匹配到多个日程,展示候选列表让用户确认 +3. 向用户确认要修改的字段和目标值 +4. 调用 `update_schedule`,只传入需修改的字段 + +### 取消日程 + +**经典 query 示例:** +- "取消明天下午的需求评审" +- "帮我把周五的团建日程删掉" +- "我不想开今天 15 点的会了,帮我取消" + +**流程:** +1. 先通过查询工作流定位目标日程 +2. 向用户确认取消的日程信息(标题、时间等),避免误操作 +3. 确认后调用 `cancel_schedule` + +### 管理参与人 + +**经典 query 示例:** +- "把张三加到明天的需求评审会议里" +- "帮我把李四从周五的日程里移除" +- "明天下午的会议再邀请一下王伟和赵敏" +- "把我后天那个技术分享的参与人里去掉刘强" + +**流程:** +1. 通过 **wecomcli-contact** 获取目标人员 userid;存在同名时展示候选让用户选择 +2. 通过查询工作流定位目标日程 +3. 调用 `add_schedule_attendees` 或 `del_schedule_attendees` 完成添加/移除 + +### 查询闲忙并安排会议 + +**经典 query 示例:** +- "帮我看看张三和李四明天下午有没有空" +- "查一下我和王伟这周的空闲时间,想约个会" +- "我想跟产品组的小明、小红开个会,看看大家什么时候有空" +- "找一个明天下午大家都有空的时段,安排一个 1 小时的会议" + +**流程:** +1. 通过 **wecomcli-contact** 获取相关人员 userid +2. 调用 `check_availability` 查询指定时间范围内各用户的忙碌时段 +3. 分析所有用户的忙碌时段,计算出共同空闲时段并推荐给用户 +4. 用户确认时段后,调用 `create_schedule` 创建会议并自动添加参与人 diff --git a/skills/wecomcli-schedule/references/check-availability.md b/skills/wecomcli-schedule/references/check-availability.md new file mode 100644 index 0000000..770c795 --- /dev/null +++ b/skills/wecomcli-schedule/references/check-availability.md @@ -0,0 +1,58 @@ +# check_availability API + +查询指定用户在某时间范围内的忙碌时段。 + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `check_user_list` | array | ✅ | 用户 ID 列表,1~10 个 | +| `start_time` | string | ✅ | 查询开始时间 | +| `end_time` | string | ✅ | 查询结束时间 | + +## 请求示例 + +```bash +wecom-cli schedule check_availability '{"check_user_list": ["USER_ID_1", "USER_ID_2"], "start_time": "YYYY-MM-DD HH:mm:ss", "end_time": "YYYY-MM-DD HH:mm:ss"}' +``` + +## 返回字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功 | +| `errmsg` | string | 错误信息 | +| `user_busy_list` | array | 用户忙碌时段列表 | + +### user_busy_list[] 数组中每项字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `userid` | string | 用户 ID | +| `busy_slots` | array | 忙碌时段列表 | +| `busy_slots[].start_time` | string | 忙碌时段开始时间 | +| `busy_slots[].end_time` | string | 忙碌时段结束时间 | +| `busy_slots[].schedule_id` | string | 关联的日程 ID | +| `busy_slots[].subject` | string | 日程标题 | + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "user_busy_list": [ + { + "userid": "USER_ID", + "busy_slots": [ + { + "start_time": "YYYY-MM-DD HH:mm:ss", + "end_time": "YYYY-MM-DD HH:mm:ss", + "schedule_id": "SCHEDULE_ID", + "subject": "日程标题" + } + ] + } + ] +} +``` diff --git a/skills/wecomcli-schedule/references/create-schedule.md b/skills/wecomcli-schedule/references/create-schedule.md new file mode 100644 index 0000000..c550ca9 --- /dev/null +++ b/skills/wecomcli-schedule/references/create-schedule.md @@ -0,0 +1,40 @@ +# create_schedule API + +创建新日程,支持设置标题、时间、地点、参与者、提醒和重复规则。 + +## 参数说明(`schedule` 对象内) + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `start_time` | string | ✅ | 开始时间 | +| `end_time` | string | ✅ | 结束时间 | +| `summary` | string | ❌ | 日程标题,最长 128 字 | +| `description` | string | ❌ | 日程描述,最长 1000 字 | +| `location` | string | ❌ | 地点,最长 128 字 | +| `is_whole_day` | integer | ❌ | 是否全天:`0`-否(默认),`1`-是 | +| `attendees` | array | ❌ | 参与者列表,每项含 `userid` | +| `reminders` | object | ❌ | 提醒与重复设置(见 [reminders 字段参考](ref-reminders.md)) | + +## 请求示例 + +```bash +wecom-cli schedule create_schedule '{"schedule": {"start_time": "YYYY-MM-DD HH:mm:ss", "end_time": "YYYY-MM-DD HH:mm:ss", "summary": "日程标题", "attendees": [{"userid": "USER_ID"}], "reminders": {"is_remind": 1, "remind_before_event_secs": 3600, "timezone": 8}, "location": "会议地点"}}' +``` + +## 返回字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功 | +| `errmsg` | string | 错误信息 | +| `schedule_id` | string | 创建成功的日程 ID | + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "schedule_id": "SCHEDULE_ID" +} +``` diff --git a/skills/wecomcli-schedule/references/get-schedule-detail.md b/skills/wecomcli-schedule/references/get-schedule-detail.md new file mode 100644 index 0000000..32f20a7 --- /dev/null +++ b/skills/wecomcli-schedule/references/get-schedule-detail.md @@ -0,0 +1,83 @@ +# get_schedule_detail API + +通过日程 ID 批量获取日程详细信息。 + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `schedule_id_list` | array | ✅ | 日程 ID 列表,1~50 个 | + +## 请求示例 + +```bash +wecom-cli schedule get_schedule_detail '{"schedule_id_list": ["SCHEDULE_ID_1", "SCHEDULE_ID_2"]}' +``` + +## 返回字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功 | +| `errmsg` | string | 错误信息 | +| `schedule` | array | 日程详情列表 | + +### schedule[] 字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `schedule_id` | string | 日程唯一 ID | +| `summary` | string | 日程标题 | +| `description` | string | 日程描述 | +| `start_time` | integer | 开始时间(Unix 时间戳,秒) | +| `end_time` | integer | 结束时间(Unix 时间戳,秒) | +| `location` | string | 地点 | +| `status` | integer | `0`-正常,`1`-已取消 | +| `is_whole_day` | integer | `0`-否,`1`-是 | +| `admins` | array | 管理员 userid 列表 | +| `attendees` | array | 参与者列表 | +| `attendees[].userid` | string | 参与者 userid | +| `attendees[].response_status` | integer | 响应状态(见下表) | +| `reminders` | object | 提醒设置(见 [reminders 字段参考](ref-reminders.md)) | + +### response_status 枚举 + +| 值 | 含义 | +|----|------| +| `1` | 待定 | +| `2` | 接受 | +| `3` | 接受单次 | +| `4` | 拒绝 | +| `5` | 接受本次及未来 | +| `6` | 待定单次 | +| `7` | 待定本次及未来 | +| `8` | 拒绝单次 | +| `9` | 拒绝本次及未来 | + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "schedule": [ + { + "schedule_id": "SCHEDULE_ID", + "summary": "日程标题", + "start_time": 1700000000, + "end_time": 1700003600, + "location": "会议室", + "status": 0, + "is_whole_day": 0, + "attendees": [ + {"userid": "USER_ID","tmp_external_userid": "tmp_external_userid_example","response_status": 2} + ], + "reminders": { + "is_remind": 1, + "remind_before_event_secs": 3600, + "timezone": 8 + } + } + ] +} +``` diff --git a/skills/wecomcli-schedule/references/ref-reminders.md b/skills/wecomcli-schedule/references/ref-reminders.md new file mode 100644 index 0000000..3c14ee3 --- /dev/null +++ b/skills/wecomcli-schedule/references/ref-reminders.md @@ -0,0 +1,24 @@ +# reminders 字段参考 + +提醒设置对象,用于 `create_schedule` 和 `update_schedule` 接口。 + +## 字段说明 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `is_remind` | integer | 是否提醒:`0`-否,`1`-是 | +| `remind_before_event_secs` | integer | 提前提醒秒数,可选值:`0`/`300`/`900`/`3600`/`86400` | +| `remind_time_diffs` | array | 提醒时间差(秒),可选值:`-604800`/`-172800`/`-86400`/`-3600`/`-900`/`-300`/`0`/`32400` | +| `timezone` | integer | 时区,`-12` ~ `12`,中国为 `8` | + +## 使用示例 + +### 基本提醒(提前 1 小时) + +```json +{ + "is_remind": 1, + "remind_before_event_secs": 3600, + "timezone": 8 +} +``` diff --git a/skills/wecomcli-schedule/references/update-schedule.md b/skills/wecomcli-schedule/references/update-schedule.md new file mode 100644 index 0000000..9fd7f90 --- /dev/null +++ b/skills/wecomcli-schedule/references/update-schedule.md @@ -0,0 +1,32 @@ +# update_schedule API + +修改已有日程,只需传入需要修改的字段,未传字段保持不变。 + +## 参数说明(`schedule` 对象内) + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `schedule_id` | string | ✅ | 目标日程 ID | +| `start_time` | string | ❌ | 开始时间 | +| `end_time` | string | ❌ | 结束时间 | +| `summary` | string | ❌ | 日程标题,最长 128 字 | +| `description` | string | ❌ | 日程描述,最长 1000 字 | +| `location` | string | ❌ | 地点,最长 128 字 | +| `is_whole_day` | integer | ❌ | 是否全天:`0`-否,`1`-是 | +| `attendees` | array | ❌ | 参与者列表,每项含 `userid` | +| `reminders` | object | ❌ | 提醒与重复设置(见 [reminders 字段参考](ref-reminders.md)) | + +> 仅传需修改的字段,其余保持不变。 + +## 请求示例 + +```bash +wecom-cli schedule update_schedule '{"schedule": {"schedule_id": "SCHEDULE_ID", "summary": "更新后的标题", "start_time": "YYYY-MM-DD HH:mm:ss", "end_time": "YYYY-MM-DD HH:mm:ss"}}' +``` + +## 返回字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功 | +| `errmsg` | string | 错误信息 | diff --git a/skills/wecomcli-sheet/SKILL.md b/skills/wecomcli-sheet/SKILL.md new file mode 100644 index 0000000..c1e0fd2 --- /dev/null +++ b/skills/wecomcli-sheet/SKILL.md @@ -0,0 +1,127 @@ +--- +name: wecomcli-sheet +description: 企业微信在线表格(sheet)管理技能。提供在线表格的新建、内容读取、内容修改、追加行数据,以及子工作表的增删管理。适用场景:(1) 新建空白在线表格 (2) 读取表格完整内容(Markdown)(3) 读取基础信息与子表列表 (4) 读取表格子表数据 (5) 修改指定区域内容 (6) 末尾追加一行数据 (7) 添加/删除子工作表。当用户提到「企业微信表格」「企业微信在线表格」「企微 Excel 表格」,或链接形如 `https://doc.weixin.qq.com/sheet/xxx` 时触发该技能。注意:智能表格(`/smartsheet/*`)请用 `wecomcli-smartsheet`;普通文档(`/doc/*`)请用 `wecomcli-doc`;智能文档/智能主页(`/smartpage/*`)请用 `wecomcli-smartpage`。 +metadata: + requires: + bins: ["wecom-cli"] + cliHelp: "wecom-cli doc --help" +--- + +# 企业微信在线表格管理 + +> `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 + +资源型技能,负责**在线表格**(`/sheet/*`)的新建、内容读写以及子工作表管理。 + +## 调用方式 + +通过 `wecom-cli` 调用,品类为 `doc`: + +```bash +wecom-cli doc '' +``` + +## 接口路由表 + +> **硬规则**:第二列是 `references/xxx.md` 链接的,命中这一行后**先 `read` 对应 references 文件,再构造命令**。写入/读取子表数据前,先用 `sheet_get_info` 拿到目标子表的 `sheet_id`。 + +| 用户意图 | 参考位置 | +|---|---| +| 读取在线表格完整内容(Markdown 概览) | 见下方「读取完整内容」 | +| 读取在线表格基础信息与子表列表 | 见下方「读取基础信息」 | +| 从零新建在线表格(空白) | 见下方「新建在线表格」 | +| 修改在线表格指定区域内容 | [references/sheet-update-range-data.md](references/sheet-update-range-data.md) | +| 在线表格末尾追加一行数据 | [references/sheet-append-data.md](references/sheet-append-data.md) | +| 添加在线表格子工作表 | [references/sheet-add-sub.md](references/sheet-add-sub.md) | +| 删除在线表格子工作表 | [references/sheet-delete-sub.md](references/sheet-delete-sub.md) | + +## 接口详述 + +### 新建在线表格 + +从零新建一篇企微**在线表格**:空白。创建成功后返回 `docid` 和 `url`。 + +**命令** + +```bash +wecom-cli doc create_doc '' +``` + +**参数** + +| 参数 | 类型 | 必填 | 默认值 | 说明 | +|---|--------|---|---|-------------| +| `doc_type` | int | 是 | — | 固定传 `4`(在线表格) | +| `doc_name` | string | 是 | — | 表格标题 | + +**注意事项** + +- 本接口仅创建**空白**在线表格,不支持携带初始内容;如需写入数据,请在创建后先用 `sheet_get_info` 拿到子表 `sheet_id`,再通过 `sheet_update_range_data` / `sheet_append_data` 写入。 + +### 读取完整内容 + +获取**在线表格**的完整内容数据,统一以 Markdown 格式返回。采用**异步轮询机制**:首次调用无需传 `task_id`,接口返回 `task_id`;若 `task_done` 为 `false`,需携带该 `task_id` 再次调用,直到 `task_done` 为 `true` 时返回完整内容。适合快速概览或读取整篇表格内容。 + +**命令** + +```bash +wecom-cli doc get_doc_content '' +``` + +**参数** + +| 字段 | 类型 | 必填 | 默认值 | 语义 | +|---|---|---|---|---| +| `docid` | string | 与 `url` 二选一 | — | 在线表格的 docid | +| `url` | string | 与 `docid` 二选一 | — | 在线表格的访问链接 | +| `type` | int | 是 | — | 内容返回格式,固定传 `2`(Markdown) | +| `task_id` | string | 否 | — | 任务 ID,首次不传,轮询时填上次返回的 `task_id` | + +**返回** + +| 字段 | 类型 | 说明 | +|---|---|---| +| `content` | string | `task_done` 为 `true` 时返回的完整 Markdown 内容 | +| `task_id` | string | 任务 ID,未完成时用于下次轮询 | +| `task_done` | bool | 任务是否完成,`false` 时需携带 `task_id` 继续轮询 | + +**使用规则** + +- 首次调用不传 `task_id`;若 `task_done` 为 `false`,记录 `task_id` 后携带其再次调用,直到 `task_done` 为 `true` 取 `content`。 + +### 读取基础信息 + +读取**在线表格**的基础信息,包括工作表列表、文档名称与访问链接。所有后续需要 `sheet_id` 的接口(`sheet_update_range_data` / `sheet_append_data` / `sheet_delete_sub`等)的 `sheet_id` 都从本接口返回的 `sheets[]` 中取。 + +**命令** + +```bash +wecom-cli doc sheet_get_info '' +``` + +**参数** + +| 字段 | 类型 | 必填 | 默认值 | 语义 | +|---|---|---|---|---| +| `docid` | string | 与 `url` 二选一 | — | 在线表格的 docid | +| `url` | string | 与 `docid` 二选一 | — | 在线表格的访问链接 | + +**返回** + +| 字段 | 类型 | 说明 | +|---|---|---| +| `sheets` | array | 工作表列表;每项含 `sheet_id` / `title` / `row_count` / `column_count` / `data_range` 等基础信息 | +| `url` | string | 文档访问链接 | +| `name` | string | 文档名称 | + +**使用规则** + +- `docid` 与 `url` 二选一,至少传其一。 +- **读 → 写 链路**:当需要往具体子表写内容(`sheet_update_range_data` / `sheet_append_data`)时,应先用 `get_doc_content` 读取并识别出各子表的**标题**与**具体数据**,再调用本接口拿到 `sheets[]` 中每个子表的 `sheet_id` 与行列数(`row_count` / `column_count`);通过**子表标题与 `title` 匹配**确定目标 `sheet_id`,并结合行列数核对写入区域范围,从而打通「读 → 写」的完整链路。 + +## 跨技能依赖 + +| 依赖技能 | 典型协作场景 | 数据流向 | +|---|---|---| +| `wecomcli-contact` | 表格里需要写入人员信息时按姓名查 userid | `get_userlist` 查到 userid → 本 skill 写入 | +| `wecomcli-msg` | 用户要求把在线表格链接发给某人/某群 | 本 skill 新建后返回 `url` → `wecomcli-msg` 发送链接 | diff --git a/skills/wecomcli-sheet/references/sheet-add-sub.md b/skills/wecomcli-sheet/references/sheet-add-sub.md new file mode 100644 index 0000000..110b3fb --- /dev/null +++ b/skills/wecomcli-sheet/references/sheet-add-sub.md @@ -0,0 +1,56 @@ +# sheet sheet_add_sub API + +向**在线表格**添加一个新的子工作表,返回新增子表信息(含 `sheet_id`)。 + +## 命令 + +```bash +wecom-cli doc sheet_add_sub '' +``` + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|---|---|---|---| +| docid | string | 是 | 在线表格 ID | +| sheet | object | 是 | 子表信息 | +| sheet.title | string | 是 | 工作表名称 | +| sheet.row_count | int | 否 | 表格总行数 | +| sheet.column_count | int | 否 | 表格总列数 | +| index | int | 否 | 插入位置:`0` 表示插入到最后,`1` 表示插入到第一个位置 | + +## 返回字段 + +| 字段 | 类型 | 说明 | +|---|---|---| +| `sheet` | object | 新增的子表信息;含 `sheet_id`(唯一标识)/ `title` / `row_count` / `column_count` / `data_range`(新建时为空) | + +## 请求示例 + +```json +{ + "docid": "DOCID", + "sheet": { + "title": "新子表", + "row_count": 100, + "column_count": 26 + }, + "index": 0 +} +``` + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "sheet": { + "sheet_id": "SHEET_ID", + "title": "新子表", + "row_count": 100, + "column_count": 26, + "data_range": "" + } +} +``` diff --git a/skills/wecomcli-sheet/references/sheet-append-data.md b/skills/wecomcli-sheet/references/sheet-append-data.md new file mode 100644 index 0000000..91eedb0 --- /dev/null +++ b/skills/wecomcli-sheet/references/sheet-append-data.md @@ -0,0 +1,66 @@ +# sheet sheet_append_data API + +向**在线表格**的指定子工作表末尾自动追加一行数据,无需指定行号——数据将写到最末一行之后。适合逐行写入。 + +## 命令 + +```bash +wecom-cli doc sheet_append_data '' +``` + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|---|---|---|---| +| docid | string | 是 | 在线表格 ID | +| sheet_id | string | 是 | 工作表 ID,通过 `sheet sheet_get_info` 获取 | +| row | object | 是 | 追加的一行数据 | +| row.values | array | 是 | 单元格数组,按列顺序排列 | + +`row.values[]` 对象结构: + +| 子字段 | 类型 | 说明 | +|---|---|---| +| `cell_value` | object | 单元格值,形如 `{"text": "<文本>"}` / `{"link": {"url": "", "text": "<显示文本>"}}` / `{"formula": "=SUM(A1,A2)"}` | +| `cell_format` | object | 单元格样式;传空对象 `{}` 表示默认样式 | + +## 返回字段 + +| 字段 | 类型 | 说明 | +|---|---|---| +| `row` | object | 写入的行数据,结构与入参 `row` 一致 | + +## 请求示例 + +```json +{ + "docid": "DOCID", + "sheet_id": "SHEET_ID", + "row": { + "values": [ + { "cell_value": { "text": "新任务" }, "cell_format": {} }, + { "cell_value": { "text": "李四" }, "cell_format": {} } + ] + } +} +``` + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "row": { + "values": [ + { "cell_value": { "text": "新任务" } }, + { "cell_value": { "text": "李四" } } + ] + } +} +``` + +## 使用规则 + +- **逐行写入场景**:本接口会自动定位到子表最末一行之后追加;批量写不同区域请用 `sheet_update_range_data`。 +- **读 → 写 链路**:写入前先用 `get_doc_content` 识别出目标子表的**标题**与**具体数据**,再用 `sheet sheet_get_info` 拿到 `sheets[]`,按**子表标题匹配 `title`** 确定 `sheet_id`,并参考其 `column_count` 核对每行单元格数量与列对齐。 diff --git a/skills/wecomcli-sheet/references/sheet-delete-sub.md b/skills/wecomcli-sheet/references/sheet-delete-sub.md new file mode 100644 index 0000000..8195c79 --- /dev/null +++ b/skills/wecomcli-sheet/references/sheet-delete-sub.md @@ -0,0 +1,40 @@ +# sheet sheet_delete_sub API + +根据 `docid` 与 `sheet_id` 删除**在线表格**的指定子工作表,**操作不可逆**。 + +## 命令 + +```bash +wecom-cli doc sheet_delete_sub '' +``` + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|---|---|---|---| +| docid | string | 是 | 在线表格 ID | +| sheet_id | string | 是 | 要删除的工作表 ID,通过 `sheet sheet_get_info` 获取 | + +## 请求示例 + +```json +{ + "docid": "DOCID", + "sheet_id": "SHEET_ID" +} +``` + +## 响应示例 + +删除成功返回空对象(仅含公共字段): + +```json +{ + "errcode": 0, + "errmsg": "ok" +} +``` + +## 注意事项 + +- **操作不可逆**,删除前请通过 `sheet sheet_get_info` 确认目标 `sheet_id`。 diff --git a/skills/wecomcli-sheet/references/sheet-update-range-data.md b/skills/wecomcli-sheet/references/sheet-update-range-data.md new file mode 100644 index 0000000..0e2e9bc --- /dev/null +++ b/skills/wecomcli-sheet/references/sheet-update-range-data.md @@ -0,0 +1,97 @@ +# sheet sheet_update_range_data API + +修改**在线表格**指定区域的内容与格式,通过 `grid_data` 指定写入的起始位置与各单元格数据。适合批量写入某个区域。 + +## 命令 + +```bash +wecom-cli doc sheet_update_range_data '' +``` + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|---|---|---|---| +| docid | string | 是 | 在线表格 ID | +| sheet_id | string | 是 | 工作表 ID,通过 `sheet sheet_get_info` 获取 | +| grid_data | object | 是 | 写入区域的数据 | +| grid_data.start_row | int | 是 | 起始行号,从 0 起 | +| grid_data.start_column | int | 是 | 起始列号,从 0 起 | +| grid_data.rows | array | 是 | 各行数据 | + +`grid_data.rows[].values[]` 对象结构: + +| 子字段 | 类型 | 说明 | +|---|---|---| +| `cell_value` | object | 单元格值,根据内容类型选择对应字段(见下表)| +| `cell_format` | object | 单元格样式;传空对象 `{}` 表示默认样式 | + +`cell_value` 的字段必须按内容类型选择: + +| 内容类型 | 必须使用的字段 | 示例 | +|---|---|---| +| 普通文本/数字 | `text` | `{"text": "张三"}`、`{"text": "100"}` | +| 超链接 | `link` | `{"link": {"url": "https://...", "text": "显示文本"}}` | +| 公式(以 `=` 开头) | `formula` | `{"formula": "=SUM(A1:A2)"}` | + +> 公式必须用 `formula` 字段,禁止写成 `{"text": "=SUM(A1:A2)"}` + +## 返回字段 + +| 字段 | 类型 | 说明 | +|---|---|---| +| `grid_data` | object | 写入的数据,结构与入参 `grid_data` 一致 | + +## 请求示例 + +```json +{ + "docid": "DOCID", + "sheet_id": "SHEET_ID", + "grid_data": { + "start_row": 0, + "start_column": 0, + "rows": [ + { + "values": [ + { "cell_value": { "text": "完成需求文档" }, "cell_format": {} }, + { "cell_value": { "text": "张三" }, "cell_format": {} } + ] + }, + { + "values": [ + { "cell_value": { "text": "合计" }, "cell_format": {} }, + { "cell_value": { "formula": "=SUM(B1:B1)" }, "cell_format": {} } + ] + } + ] + } +} +``` + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "grid_data": { + "start_row": 0, + "start_column": 0, + "rows": [ + { + "values": [ + { "cell_value": { "text": "完成需求文档" } }, + { "cell_value": { "text": "张三" } } + ] + } + ] + } +} +``` + +## 使用规则 + +- 批量写不同区域用本接口;逐行追加到子表末尾请用 `sheet_append_data`。 +- 公式一律用 `formula` 字段:任何以 `=` 开头的内容(如 `=SUM(...)`、`=A1+B1`、`=IF(...)`)都必须写成 `{"formula": "=..."}`,不可写成 `{"text": "=..."}`,否则只会被当作文本显示而不计算。 +- **读 → 写 链路**:写入前先用 `get_doc_content` 识别出目标子表的**标题**与**具体数据**,再用 `doc sheet_get_info` 拿到 `sheets[]`,按**子表标题匹配 `title`** 确定 `sheet_id`,并参考其 `row_count` / `column_count` 核对 `grid_data` 的写入区域是否越界。 diff --git a/skills/wecomcli-smartpage/SKILL.md b/skills/wecomcli-smartpage/SKILL.md new file mode 100644 index 0000000..38d6389 --- /dev/null +++ b/skills/wecomcli-smartpage/SKILL.md @@ -0,0 +1,111 @@ +--- +name: wecomcli-smartpage +description: 企业微信智能文档(原名智能主页,smartpage)管理技能。提供智能文档的创建(将本地 Markdown 文件发布为智能文档)与内容导出(异步导出为 Markdown)能力。适用场景:(1) 将一个或多个本地 Markdown 文件创建为智能文档 (2) 异步导出智能文档内容为 Markdown。支持通过 docid 或文档 URL 定位文档。当用户明确提到「智能文档」「智能主页」,或链接形如 `https://doc.weixin.qq.com/smartpage/xxx` 时触发该技能。注意:普通文档(`/doc/*`)请用 `wecomcli-doc`;在线表格(`/sheet/*`)请用 `wecomcli-sheet`;智能表格(`/smartsheet/*`)请用 `wecomcli-smartsheet`。 +metadata: + requires: + bins: ["wecom-cli"] + cliHelp: "wecom-cli doc --help" +--- + +# 企业微信智能文档管理 + +> `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 + +资源型技能,负责**智能文档**(原名智能主页,`/smartpage/*`)的创建与内容导出。 + +## 调用方式 + +通过 `wecom-cli` 调用,品类为 `doc`: + +```bash +wecom-cli doc '' +``` + +## 返回格式说明 + +所有接口返回 JSON 对象,包含以下公共字段: + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功,非 `0` 表示失败 | +| `errmsg` | string | 错误信息,成功时为 `"ok"` | + +当 `errcode` 不为 `0` 时,说明接口调用失败,可重试 1 次;若仍失败,将 `errcode` 和 `errmsg` 展示给用户。 + +### 特殊错误码 + +| errcode | errmsg | 含义 | 处理方式 | +|---------|--------|------|----------| +| `851002` | `incompatible doc type` | 文档品类与所调用的接口不匹配 | 确认目标 URL 为 `/smartpage/*`;若不是,请跳转到对应品类的 skill | + +## 接口详述 + +### 创建智能文档 + +创建智能文档(原名智能主页),支持传入标题和多个子页面。每个子页面可指定标题、内容类型和本地文件路径。创建成功返回 `docid` 和 `url`。 + +> **特殊语法**:此命令必须使用 `+smartpage_create`(带 `+` 前缀),加号不可省略;该 `+` 仅适用于此命令,不要泛化到其他 `doc` 子命令。 + +**命令** + +```bash +wecom-cli doc +smartpage_create '' +``` + +**参数** + +| 参数 | 类型 | 必填 | 默认值 | 说明 | +|---|---|---|---|---| +| `title` | string | 否 | — | 智能文档标题 | +| `pages` | array | 是 | — | 子页面列表 | +| `pages[].page_title` | string | 否 | — | 子页面标题 | +| `pages[].content_type` | int | 否 | 1 | 内容类型:1-Markdown,0-Text(纯文本) | +| `pages[].page_filepath` | string | 否 | — | 子页面内容对应的本地文件路径 | + +**注意事项** + +- `content_type` **必须与文件实际内容匹配**:`.md` 文件或包含 Markdown 语法的内容必须传 `1`,仅纯文本才传 `0`。绝大多数场景应传 `1`。 +- `docid` 仅在创建时返回,需妥善保存。 +- 每个子页面的 Markdown 文件大小不得超过 **10MB**,超过会导致创建失败;如文件过大,需先拆分为多个子页面再创建。 +- 智能文档还支持背景块(``)、分栏(``)等扩展语法,详见 [references/smartpage-create.md](references/smartpage-create.md)。 + +### 导出智能文档内容 + +获取智能文档的完整内容,导出为 Markdown。采用**异步两步操作**:先用 `smartpage_export_task` 提交导出任务拿到 `task_id`,再用 `smartpage_get_export_result` 轮询任务,直到 `task_done` 为 `true` 时返回 `content`。 + +**第一步:提交导出任务** + +```bash +# 通过 docid +wecom-cli doc smartpage_export_task '{"docid": "DOCID", "content_type": 1}' +# 通过 url +wecom-cli doc smartpage_export_task '{"url": "https://doc.weixin.qq.com/smartpage/xxx", "content_type": 1}' +``` + +| 参数 | 类型 | 必填 | 默认值 | 说明 | +|---|---|---|---|---| +| `docid` | string | 与 `url` 二选一 | — | 智能文档的 docid | +| `url` | string | 与 `docid` 二选一 | — | 智能文档的访问链接 | +| `content_type` | int | 是 | — | 导出内容格式,目前仅支持 `1`(Markdown) | + +**第二步:轮询导出结果** + +```bash +wecom-cli doc smartpage_get_export_result '{"task_id": "TASK_ID"}' +``` + +| 参数 | 类型 | 必填 | 默认值 | 说明 | +|---|---|---|---|---| +| `task_id` | string | 是 | — | 由 `smartpage_export_task` 返回的任务 ID | + +**使用规则** + +- 第一步获取 `task_id` 后,携带其调用第二步;若 `task_done` 为 `false` 则继续轮询,直到 `task_done` 为 `true`,返回的 `content` 字段即为完整 Markdown 内容。 + +参见 [API 详情](references/smartpage-export.md)。 + +## 跨技能依赖 + +| 依赖技能 | 典型协作场景 | 数据流向 | +|---|---|---| +| `wecomcli-msg` | 用户要求把智能文档链接发给某人/某群 | 本 skill 创建后返回 `url` → `wecomcli-msg` 发送链接 | diff --git a/skills/wecomcli-smartpage/references/smartpage-create.md b/skills/wecomcli-smartpage/references/smartpage-create.md new file mode 100644 index 0000000..a017e83 --- /dev/null +++ b/skills/wecomcli-smartpage/references/smartpage-create.md @@ -0,0 +1,134 @@ +# smartpage_create API + +创建智能文档(原智能主页)。支持传入多个子页面,每个子页面可指定标题、内容类型和本地文件路径。创建成功后返回文档访问链接和 docid。 + +> ⚠️ **特殊语法**:此命令必须使用 `+smartpage_create`(带 `+` 前缀),加号不可省略;该 `+` 仅适用于此命令,不要泛化到其他 `doc` 子命令。 + +## 命令 + +```bash +wecom-cli doc +smartpage_create '' +``` + +## 技能定义 + +```json +{ + "name": "smartpage_create", + "description": "创建智能文档(原智能主页)。支持传入标题和多个子页面配置,每个子页面可指定标题、内容类型(Text/Markdown)和本地文件路径。创建成功后返回 docid 和 url(docid 仅在创建时返回,需妥善保存)。", + "inputSchema": { + "properties": { + "title": { + "description": "智能文档标题", + "title": "Title", + "type": "string" + }, + "pages": { + "description": "子页面列表", + "title": "Pages", + "type": "array", + "items": { + "type": "object", + "properties": { + "page_title": { + "description": "子页面标题", + "title": "Page Title", + "type": "string" + }, + "content_type": { + "description": "内容类型。1: Markdown(包含Markdown语法的内容),0: Text(纯文本,不含任何Markdown语法)", + "enum": [0, 1], + "default": 1, + "title": "Content Type", + "type": "integer" + }, + "page_filepath": { + "description": "子页面内容对应的本地文件路径", + "title": "Page Filepath", + "type": "string" + } + } + } + } + }, + "required": ["pages"], + "title": "smartpage_createArguments", + "type": "object" + } +} +``` + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|---|---|---|---| +| title | string | 否 | 智能文档标题 | +| pages | array | 是 | 子页面列表 | +| pages[].page_title | string | 否 | 子页面标题 | +| pages[].content_type | integer | 否 | 内容类型:1-Markdown,0-Text(纯文本)。**默认应传 1**,仅纯文本内容才传 0 | +| pages[].page_filepath | string | 否 | 子页面内容对应的本地文件路径,需确保文件存在且可读 | + +## ContentType 枚举 + +| 值 | 含义 | 适用场景 | +|---|---|---| +| 1 | Markdown | 文件内容包含 Markdown 语法(标题、列表、链接、代码块等) | +| 0 | Text(纯文本) | 文件内容为纯文本,不含任何 Markdown 语法 | + +除了标准的 markdown 格式以外,智能文档还支持扩展语法以提升表示的丰富性,包括: +1. 背景块 +```markdown + +## 在扩展标签里面可以任意嵌套 markdown 语法 +- 背景块常用于展示重要信息 +- 颜色的使用根据需要表达的语义进行选择,卡片背景由 `color` 指定;支持 `green`, `blue`, `red`, `yellow`, `gray`, `purple`, `orange`, `cyan`, `indigo`,也支持 `dark_green`, `dark_blue`, `dark_red`, `dark_yellow`, `dark_gray`, `dark_purple`, `dark_orange`, `dark_cyan`, `dark_indigo` 等深色系。 + +``` +背景颜色推荐使用浅色背景,以完成区隔/高亮并且保持低饱和度确保正文内容的良好显示。 +2. 分栏 +使用分栏可以并列显示内容,常用于展示对比或者并列信息 +```markdown + +占据50%的空间 +占据50%的空间 + +``` +width-ratio:子容器宽度占比,范围 0.1~1.0,所有的子容器宽度占比之和为 1 + +## 请求示例 + +```json +{ + "title": "项目概览", + "pages": [ + { + "page_title": "需求文档", + "content_type": 1, + "page_filepath": "/path/to/requirements.md" + }, + { + "page_title": "设计说明", + "content_type": 1, + "page_filepath": "/path/to/design.md" + } + ] +} +``` + +## 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "docid": "DOCID", + "url": "https://doc.weixin.qq.com/smartpage/a1_xxxxxx" +} +``` + +## 注意事项 + +- `docid` 仅在创建时返回,后续无法再获取,务必保存 +- `page_filepath` 指向本地文件,需确保文件存在且可读 +- **`content_type` 必须与文件实际内容格式匹配**:`.md` 文件或包含 Markdown 语法的内容必须传 `1`,不要传 `0` +- 每个子页面的 Markdown 文件大小不得超过 **10MB**,超过会导致创建失败;如果文件过大,需先拆分为多个子页面 diff --git a/skills/wecomcli-smartpage/references/smartpage-export.md b/skills/wecomcli-smartpage/references/smartpage-export.md new file mode 100644 index 0000000..2139a00 --- /dev/null +++ b/skills/wecomcli-smartpage/references/smartpage-export.md @@ -0,0 +1,171 @@ +# smartpage_export_task / smartpage_get_export_result API + +导出智能文档(原智能主页)内容。采用异步两步操作:先通过 `smartpage_export_task` 提交导出任务获取 `task_id`,再通过 `smartpage_get_export_result` 轮询任务状态,直到任务完成后返回完整文档内容。 + +--- + +## 第一步:smartpage_export_task — 提交导出任务 + +发起智能文档内容导出任务(异步)。传入 `docid` 或 `url` 和 `content_type`,返回 `task_id`。 + +### 命令 + +```bash +wecom-cli doc smartpage_export_task '' +``` + +### 技能定义 + +```json +{ + "name": "smartpage_export_task", + "description": "发起智能文档(原智能主页)内容导出任务(异步)。传入 docid(或 url)和 content_type,返回 task_id。需配合 smartpage_get_export_result 轮询查询导出进度,直到任务完成后获取文档内容。", + "inputSchema": { + "properties": { + "docid": { + "description": "智能文档的 docid,与 url 二选一传入", + "title": "Doc ID", + "type": "string" + }, + "url": { + "description": "智能文档的访问链接,与 docid 二选一传入", + "title": "URL", + "type": "string" + }, + "content_type": { + "description": "导出内容格式。目前仅支持 1(Markdown 格式)", + "enum": [1], + "title": "Content Type", + "type": "integer" + } + }, + "oneOf": [ + { "required": ["docid", "content_type"] }, + { "required": ["url", "content_type"] } + ], + "title": "smartpage_export_taskArguments", + "type": "object" + } +} +``` + +### 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|---|---|---|---| +| docid | string | 与 url 二选一 | 智能文档的 docid | +| url | string | 与 docid 二选一 | 智能文档的访问链接 | +| content_type | integer | 是 | 导出内容格式,目前仅支持 `1`(Markdown 格式) | + +### 请求示例 + +```json +// 通过 docid +{ + "docid": "DOCID", + "content_type": 1 +} + +// 通过 url +{ + "url": "https://doc.weixin.qq.com/smartpage/a1_xxxxxx", + "content_type": 1 +} +``` + +### 响应示例 + +```json +{ + "errcode": 0, + "errmsg": "ok", + "task_id": "TASK_ID" +} +``` + +--- + +## 第二步:smartpage_get_export_result — 查询导出结果 + +查询智能文档导出任务进度。传入 `task_id` 进行轮询,当 `task_done` 为 `true` 时返回完整文档内容。 + +### 命令 + +```bash +wecom-cli doc smartpage_get_export_result '' +``` + +### 技能定义 + +```json +{ + "name": "smartpage_get_export_result", + "description": "查询智能文档(原智能主页)导出任务进度。传入 task_id 轮询,当 task_done 为 true 时返回 content 字段,包含导出的完整文档内容。", + "inputSchema": { + "properties": { + "task_id": { + "description": "导出任务 ID,由 smartpage_export_task 返回", + "title": "Task ID", + "type": "string" + } + }, + "required": ["task_id"], + "title": "smartpage_get_export_resultArguments", + "type": "object" + } +} +``` + +### 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|---|---|---|---| +| task_id | string | 是 | 导出任务 ID,由 `smartpage_export_task` 返回 | + +### 请求示例 + +```json +{ + "task_id": "TASK_ID" +} +``` + +### 响应示例 + +任务未完成: + +```json +{ + "errcode": 0, + "errmsg": "ok", + "task_done": false +} +``` + +任务完成: + +```json +{ + "errcode": 0, + "errmsg": "ok", + "task_done": true, + "content": "# 项目周报\n\n## 本周进展\n\n1. 完成了用户模块开发\n2. 修复了3个线上Bug" +} +``` + +--- + +## 异步轮询机制 + +1. **调用 smartpage_export_task**:传入 `docid`(或 `url`)和 `content_type: 1`,获取 `task_id` +2. **首次轮询**:传入 `task_id` 调用 `smartpage_get_export_result` +3. **检查响应**:若 `task_done` 为 `false`,继续轮询 +4. **获取内容**:当 `task_done` 为 `true` 时,`content` 字段包含完整的 Markdown 内容 + +## 注意事项 + +- `smartpage_export_task` 是异步操作的第一步,调用后仅返回 `task_id` +- `content_type` 目前仅支持 `1`(Markdown 格式) +- `docid` 和 `url` 二选一传入即可,无需同时传入 +- 任务完成后 `content` 字段直接包含完整文档内容,无需额外读取文件 +- 如果轮询多次仍未完成,建议适当增加轮询间隔 diff --git a/skills/wecomcli-smartsheet/SKILL.md b/skills/wecomcli-smartsheet/SKILL.md new file mode 100644 index 0000000..7059953 --- /dev/null +++ b/skills/wecomcli-smartsheet/SKILL.md @@ -0,0 +1,266 @@ +--- +name: wecomcli-smartsheet +description: 企业微信智能表格(smartsheet)管理技能。提供智能表格的新建(doc_type=10)、结构管理(子表、字段/列)和数据管理(记录增删改查)。适用场景:(1) 从零新建智能表格 (2) 管理智能表格子表和字段/列 (3) 查询、添加、更新、删除智能表格记录。支持通过 docid 或文档 URL 定位文档。当用户提到「企业微信智能表格」「智能表格」,或链接形如 `https://doc.weixin.qq.com/smartsheet/xxx` 时触发该技能。注意:普通文档(`/doc/*`)请用 `wecomcli-doc`;在线表格(`/sheet/*`)请用 `wecomcli-sheet`;智能文档/智能主页(`/smartpage/*`)请用 `wecomcli-smartpage`。 +metadata: + requires: + bins: ["wecom-cli"] + cliHelp: "wecom-cli doc --help" +--- + +# 企业微信智能表格管理 + +> `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 + +资源型技能,负责**智能表格**(`/smartsheet/*`,doc_type=10)的新建、结构(子表、字段/列)与数据(记录)管理。所有接口支持通过 `docid` 或 `url` 二选一定位文档。 + +## 调用方式 + +通过 `wecom-cli` 调用,品类为 `doc`: + +```bash +wecom-cli doc '' +``` + +> 智能表格各接口的 `docid`/`url` 二选一传入即可,以下示例以 `docid` 为主,URL 传入方式以此类推。 + +## 返回格式说明 + +所有接口返回 JSON 对象,包含以下公共字段: + +| 字段 | 类型 | 说明 | +|------|------|------| +| `errcode` | integer | 返回码,`0` 表示成功,非 `0` 表示失败 | +| `errmsg` | string | 错误信息,成功时为 `"ok"` | + +当 `errcode` 不为 `0` 时,说明接口调用失败,可重试 1 次;若仍失败,将 `errcode` 和 `errmsg` 展示给用户。 + +### 特殊错误码 + +| errcode | errmsg | 含义 | 处理方式 | +|---------|--------|------|----------| +| `851002` | `incompatible doc type` | 文档品类与所调用的接口不匹配 | 确认目标 URL 为 `/smartsheet/*`;若不是,请跳转到对应品类的 skill | + +## 接口路由表 + +> **硬规则**:第二列是 `references/xxx.md` 链接的,命中这一行后**先 `read` 对应 references 文件,再构造命令**。写入/读取记录前,先用 `smartsheet_get_sheet` 拿到目标子表的 `sheet_id`,并用 `smartsheet_get_fields` 了解字段类型。 + +| 用户意图 | 参考位置 | +|---|---| +| 从零新建智能表格(空白) | 见下方「新建智能表格」 | +| 查询文档中所有子表 | 见下方「查询子表」 | +| 添加 / 改名 / 删除子表 | 见下方「子表管理」 | +| 查询子表字段/列 | 见下方「查询字段」 | +| 添加字段/列 | [references/smartsheet-field-types.md](references/smartsheet-field-types.md) | +| 改名 / 删除字段 | 见下方「字段管理」 | +| 查询子表记录 | [references/smartsheet-get-records.md](references/smartsheet-get-records.md) | +| 添加记录 / 更新记录 | [references/smartsheet-cell-value-formats.md](references/smartsheet-cell-value-formats.md) | +| 删除记录 | 见下方「删除记录」 | + +--- + +## 一、新建智能表格 + +### 新建智能表格 + +从零新建一篇企微**智能表格**(doc_type=10):空白。创建成功后返回 `docid` 和 `url`。 + +**命令** + +```bash +wecom-cli doc create_doc '' +``` + +**参数** + +| 参数 | 类型 | 必填 | 默认值 | 说明 | +|---|---|---|---|---| +| `doc_type` | int | 是 | — | 固定传 `10`(智能表格) | +| `doc_name` | string | 是 | — | 表格标题,最多 255 个字符,超过会被截断 | + +**注意事项** + +- 新建智能表格文档**默认已含一个子表**,可通过 `smartsheet_get_sheet` 查询其 `sheet_id`,仅需多个子表时才调用 `smartsheet_add_sheet`。 +- `docid` 仅在创建时返回,后续无法再获取,务必保存。 + +--- + +## 二、智能表格结构管理 + +### 查询子表 + +查询文档中所有子表信息,返回 `sheet_id`、`title`、类型等。 + +```bash +# 通过 docid 查询 +wecom-cli doc smartsheet_get_sheet '{"docid": "DOCID"}' +# 通过 url 查询 +wecom-cli doc smartsheet_get_sheet '{"url": "https://doc.weixin.qq.com/smartsheet/xxx"}' +``` + +### 子表管理 + +**添加子表** —— 添加空子表。新子表不含视图、记录和字段,需通过其他接口补充。 + +```bash +wecom-cli doc smartsheet_add_sheet '{"docid": "DOCID", "properties": {"title": "新子表"}}' +``` + +> 注意:新建智能表格文档默认已含一个子表,仅需多个子表时调用。 + +**修改子表标题** —— 需提供 `sheet_id` 和新 `title`。 + +```bash +wecom-cli doc smartsheet_update_sheet '{"docid": "DOCID", "properties":{"sheet_id":"SHEET_ID", "title":"新子表"}}' +``` + +**删除子表** —— 永久删除子表,**操作不可逆**。 + +```bash +wecom-cli doc smartsheet_delete_sheet '{"docid": "DOCID", "sheet_id": "SHEETID"}' +``` + +### 查询字段 + +查询子表的所有字段信息,返回 `field_id`、`field_title`、`field_type`。 + +```bash +wecom-cli doc smartsheet_get_fields '{"docid": "DOCID", "sheet_id": "SHEETID"}' +``` + +### 字段管理 + +**添加字段** —— 向子表添加一个或多个字段。单个子表最多 150 个字段。 + +```bash +wecom-cli doc smartsheet_add_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "fields": [{"field_title": "任务名称", "field_type": "FIELD_TYPE_TEXT"}]}' +``` + +在添加字段前,请先参阅所有字段类型和定义 [字段类型参考](references/smartsheet-field-types.md)。 + +> 注意:如果是首次创建表并调用这个方法添加字段的情况下,调用本接口前,你必须确认已完成以下操作,否则会多出一个无用的默认列: +> 1. 已调用 `smartsheet_get_fields` 查看子表现有字段(新子表会自带一个默认文本字段) +> 2. 已调用 `smartsheet_update_fields` 将该默认字段重命名为你需要的第一个字段名,然后在本接口中只传入剩余的字段(不包含第一个字段)。 + +**更新字段标题** —— **只能改名,不能改类型**(`field_type` 必须传原始类型)。`field_title` 不能更新为原值。 + +```bash +wecom-cli doc smartsheet_update_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "fields": [{"field_id": "FIELDID", "field_title": "新标题", "field_type": "FIELD_TYPE_TEXT"}]}' +``` + +**删除字段** —— 删除一列或多列字段,**操作不可逆**。`field_id` 可通过 `smartsheet_get_fields` 获取。 + +```bash +wecom-cli doc smartsheet_delete_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "field_ids": ["FIELDID"]}' +``` + +--- + +## 三、智能表格数据管理 + +### 查询记录 + +查询子表全部记录。 + +```bash +# 通过 docid +wecom-cli doc smartsheet_get_records '{"docid": "DOCID", "sheet_id": "SHEETID"}' +# 或通过 URL +wecom-cli doc smartsheet_get_records '{"url": "https://doc.weixin.qq.com/smartsheet/xxx", "sheet_id": "SHEETID"}' +``` + +参见 [API 详情](references/smartsheet-get-records.md)。 + +### 添加记录(不带图片或文件) + +添加一行或多行记录,单次建议 500 行内。 + +**调用前**必须先了解目标表的字段类型(通过 `smartsheet_get_fields`),重点关注 `field_type`。对于单选/多选(Option)字段,需注意匹配已有选项的 `id`。 + +```bash +wecom-cli doc smartsheet_add_records '{"docid": "DOCID", "sheet_id": "SHEETID", "records": [{"values": {"任务名称": [{"type": "text", "text": "完成需求文档"}], "优先级": [{"text": "高"}]}}]}' +``` + +各字段类型的值格式参见 [单元格值格式参考](references/smartsheet-cell-value-formats.md)。 + +### 添加记录(带图片或文件) + +添加一行或多行记录,单次建议 500 行内。与 `smartsheet_add_records` 不同之处在于,可支持本地路径传入图片、文件。对于需要添加带图片或文件的记录,请使用此接口。传入后台后,后台将自动存储并转换为 `image_url`。 + +```bash +wecom-cli doc +smartsheet_add_records_auto_file '{"docid":"DOCID","sheet_id":"SHEETID","records":[{"values":{"图片":[{"image_path":"/path/to/image.jpg"}],"文件":[{"file_path":"/path/to/file.txt"}]}}]}' +``` + +### 更新记录(不带图片或文件) + +更新一行或多行记录,单次建议在 500 行内。需提供 `record_id`(通过 `smartsheet_get_records` 获取)。支持通过 `key_type` 指定 values 的 key 使用字段标题或字段 ID: + +- `CELL_VALUE_KEY_TYPE_FIELD_TITLE`:key 为字段标题 +- `CELL_VALUE_KEY_TYPE_FIELD_ID`:key 为字段 ID + +```bash +wecom-cli doc smartsheet_update_records '{"docid": "DOCID", "sheet_id": "SHEETID", "key_type": "CELL_VALUE_KEY_TYPE_FIELD_TITLE", "records": [{"record_id": "RECORDID", "values": {"任务名称": [{"type": "text", "text": "更新后的内容"}]}}]}' +``` + +**注意**:创建时间、最后编辑时间、创建人、最后编辑人字段不可更新。 + +### 更新记录(更新图片或文件字段) + +更新一行或多行记录,单次建议在 500 行内。与 `smartsheet_update_records` 不同之处在于,可支持本地路径传入图片、文件。对于需要更新记录中的图片或文件,请使用此接口。传入后台后,后台将自动存储并转换为 `image_url`。 + +```bash +wecom-cli doc +smartsheet_update_records_auto_file '{"docid": "DOCID", "sheet_id": "SHEETID", "key_type": "CELL_VALUE_KEY_TYPE_FIELD_TITLE", "records": [{"record_id": "RECORDID", "values": {"values":{"图片":[{"image_path":"/path/to/image.jpg"}],"文件":[{"file_path":"/path/to/file.txt"}]}}}]}' +``` + +### 删除记录 + +删除一行或多行记录,单次必须在 500 行内。**操作不可逆**。`record_id` 通过 `smartsheet_get_records` 获取。极速版智能表格不支持此接口。 + +```bash +wecom-cli doc smartsheet_delete_records '{"docid": "DOCID", "sheet_id": "SHEETID", "record_ids": ["RECORDID1", "RECORDID2"]}' +``` + +--- + +## 典型工作流 + +### 新建并搭建表结构 + +1. **新建智能表格** → +```bash +wecom-cli doc create_doc '{"doc_type": 10, "doc_name": "项目任务表"}' +``` +,保存返回的 `docid`。 +2. **了解默认子表** → `smartsheet_get_sheet` 拿到默认子表的 `sheet_id` → `smartsheet_get_fields` 查看默认字段。 +3. **搭建列** → 先 `smartsheet_update_fields` 改默认字段名,再 `smartsheet_add_fields` 补充其余字段。 + +### 智能表格结构操作 + +1. **了解表结构** → +```bash +wecom-cli doc smartsheet_get_sheet '{"docid": "DOCID"}' +``` + → +```bash +wecom-cli doc smartsheet_get_fields '{"docid": "DOCID", "sheet_id": "SHEETID"}' +``` +2. **创建表结构** → `smartsheet_add_sheet` 添加子表 → `smartsheet_add_fields` 定义列 +3. **修改表结构** → `smartsheet_update_fields` 改列名 / `smartsheet_delete_fields` 删列 + +### 智能表格数据操作 + +1. **读取数据** → +```bash +wecom-cli doc smartsheet_get_records '{"docid":"DOCID","sheet_id":"SHEETID"}' +``` +2. **写入数据** → 先 `smartsheet_get_fields` 了解列类型 → 若涉及成员(USER)字段,先通过 `wecomcli-contact` 的 `get_userlist` 查找人员 userid → `smartsheet_add_records` 写入 +3. **更新数据** → 先 `smartsheet_get_records` 获取 record_id → 若涉及成员(USER)字段,先通过 `wecomcli-contact` 的 `get_userlist` 查找人员 userid → `smartsheet_update_records` 更新 +4. **删除数据** → 先 `smartsheet_get_records` 确认 record_id → `smartsheet_delete_records` 删除 + +## 跨技能依赖 + +| 依赖技能 | 典型协作场景 | 数据流向 | +|---|---|---| +| `wecomcli-contact` | 成员(USER)类型字段需填 `user_id`,不能直接用姓名 | `get_userlist` 按姓名查到 userid → 本 skill 写入 | +| `wecomcli-msg` | 用户要求把智能表格链接发给某人/某群 | 本 skill 新建后返回 `url` → `wecomcli-msg` 发送链接 | + +> **注意**:成员(USER)类型字段需要填写 `user_id`,不能直接使用姓名。必须先通过 `wecomcli-contact` 技能的 `get_userlist` 接口按姓名查找到对应的 `userid` 后再使用。 diff --git a/skills/wecomcli-smartsheet/references/smartsheet-cell-value-formats.md b/skills/wecomcli-smartsheet/references/smartsheet-cell-value-formats.md new file mode 100644 index 0000000..1d9bceb --- /dev/null +++ b/skills/wecomcli-smartsheet/references/smartsheet-cell-value-formats.md @@ -0,0 +1,164 @@ +# 单元格值格式参考 + +`smartsheet_add_records`、`+smartsheet_add_records_auto_file` 仅支持**字段标题**作为key。 +`smartsheet_update_records`、`+smartsheet_update_records_auto_file` 支持通过 `key_type` 参数指定使用字段标题(`CELL_VALUE_KEY_TYPE_FIELD_TITLE`)或字段 ID(`CELL_VALUE_KEY_TYPE_FIELD_ID`)。 + +## 各字段类型的值格式 + +### 1. 文本 (FIELD_TYPE_TEXT) + +**必须**使用数组格式,外层方括号不可省略: + +```json +"字段标题": [{"type": "text", "text": "内容"}] +``` + +### 2. 数字 (NUMBER) / 货币 (CURRENCY) / 百分比 (PERCENTAGE) / 进度 (PROGRESS) + +直接传数字: + +```json +"金额": 100, +"完成率": 0.6, +"进度": 80 +``` + +### 3. 复选框 (CHECKBOX) + +直接传布尔值: + +```json +"已完成": true +``` + +### 4. 单选 (SINGLE_SELECT) / 多选 (SELECT) + +**必须**使用数组格式,不能直接传字符串: + +```json +"优先级": [{"text": "高"}], +"标签": [{"text": "紧急", "style": 17}, {"text": "重要", "style": 12}] +``` + +已存在的选项应通过 `id` 匹配(`id` 可从 `smartsheet_get_fields` 返回中获取),新增选项时不填 `id`。可附带 `style`(颜色 1-27),对照表如下: + +| style | 颜色 | +|-------|------| +| 1 | 浅红1 | +| 2 | 浅橙1 | +| 3 | 浅天蓝1 | +| 4 | 浅绿1 | +| 5 | 浅紫1 | +| 6 | 浅粉红1 | +| 7 | 浅灰1 | +| 8 | 白 | +| 9 | 灰 | +| 10 | 浅蓝1 | +| 11 | 浅蓝2 | +| 12 | 蓝 | +| 13 | 浅天蓝2 | +| 14 | 天蓝 | +| 15 | 浅绿2 | +| 16 | 绿 | +| 17 | 浅红2 | +| 18 | 红 | +| 19 | 浅橙2 | +| 20 | 橙 | +| 21 | 浅黄1 | +| 22 | 浅黄2 | +| 23 | 黄 | +| 24 | 浅紫2 | +| 25 | 紫 | +| 26 | 浅粉红2 | +| 27 | 粉红 | + +### 5. 日期时间 (DATE_TIME) + +传日期时间字符串,系统自动按东八区转换: + +```json +"截止日期": "2026-01-15 14:30:00", +"创建日期": "2026-01-15" +``` + +支持格式:`YYYY-MM-DD HH:mm:ss`、`YYYY-MM-DD HH:mm`、`YYYY-MM-DD` + +### 6. 手机号 (PHONE_NUMBER) / 邮箱 (EMAIL) / 条码 (BARCODE) + +直接传字符串: + +```json +"电话": "13800138000", +"邮箱": "test@example.com" +``` + +### 7. 成员 (USER) + +数组格式,需传 user_id。**user_id 不是姓名**,必须先通过 `wecomcli-contact` 技能查找目标人员的 `userid`,再填入此处。 + +具体步骤:先 +```bash +wecom-cli contact get_userlist '{}' +``` + 获取通讯录成员列表,在返回结果中按姓名/别名筛选出目标人员,取其 `userid` 值填入。 + +```json +"负责人": [{"user_id": "zhangsan"}] +``` + +多个成员: + +```json +"负责人": [{"user_id": "zhangsan"}, {"user_id": "lisi"}] +``` + +### 8. 超链接 (URL) + +数组格式,目前仅支持一个链接: + +```json +"参考链接": [{"type": "url", "text": "官网", "link": "https://example.com"}] +``` + +### 9. 图片 (IMAGE) + +数组格式,支持传入本地路径: + +```json +"封面": [{"image_path": "/path/to/img.png"}] +``` + +### 10. 地理位置 (LOCATION) + +数组格式: + +```json +"地点": [{"source_type": 1, "id": "地点ID", "latitude": "39.9", "longitude": "116.3", "title": "北京"}] +``` + +### 11. 文件 + +数组格式: + +```json +"文件": [{"file_path": "/path/to/img.png"}] +``` + +## 完整添加记录示例 + +```json +{ + "docid": "DOCID", + "sheet_id": "SHEETID", + "records": [{ + "values": { + "任务名称": [{"type": "text", "text": "完成需求文档"}], + "优先级": [{"text": "高"}], + "截止日期": "2026-03-20", + "完成进度": 30, + "已完成": false + } + }] +} +``` + diff --git a/skills/wecomcli-smartsheet/references/smartsheet-field-types.md b/skills/wecomcli-smartsheet/references/smartsheet-field-types.md new file mode 100644 index 0000000..84c00b1 --- /dev/null +++ b/skills/wecomcli-smartsheet/references/smartsheet-field-types.md @@ -0,0 +1,44 @@ +# 智能表格字段类型参考 + +## 支持的字段类型 + +| 类型枚举值 | 说明 | 适用场景 | +|---|---|---| +| `FIELD_TYPE_TEXT` | 文本 | 名称、标题、描述、负责人姓名等自由文本 | +| `FIELD_TYPE_NUMBER` | 数字 | 金额、工时、数量等数值 | +| `FIELD_TYPE_CHECKBOX` | 复选框 | 是否完成等布尔值 | +| `FIELD_TYPE_DATE_TIME` | 日期时间 | 截止日期、创建时间等 | +| `FIELD_TYPE_IMAGE` | 图片 | 附件图片 | +| `FIELD_TYPE_USER` | 用户/成员 | 需传入 user_id;仅在明确知道成员 ID 时使用,若只有姓名应用 TEXT | +| `FIELD_TYPE_URL` | 链接 | 超链接 | +| `FIELD_TYPE_SELECT` | 多选 | 标签、分类等可多选的选项 | +| `FIELD_TYPE_PROGRESS` | 进度 | 完成进度(0-100 整数) | +| `FIELD_TYPE_PHONE_NUMBER` | 手机号 | 联系电话 | +| `FIELD_TYPE_EMAIL` | 邮箱 | 电子邮件 | +| `FIELD_TYPE_SINGLE_SELECT` | 单选 | 状态、优先级、严重程度等有固定选项的字段 | +| `FIELD_TYPE_LOCATION` | 位置 | 地理位置 | +| `FIELD_TYPE_CURRENCY` | 货币 | 货币金额 | +| `FIELD_TYPE_PERCENTAGE` | 百分比 | 比率类数值(完成率、转化率) | +| `FIELD_TYPE_BARCODE` | 条码 | 条形码/二维码 | +| `FIELD_TYPE_ATTACHMENT` | 文件 | 文件/附件 | + +## 添加字段示例 + +```json +{ + "docid": "DOCID", + "sheet_id": "SHEETID", + "fields": [ + { "field_title": "任务名称", "field_type": "FIELD_TYPE_TEXT" }, + { "field_title": "优先级", "field_type": "FIELD_TYPE_SINGLE_SELECT" }, + { "field_title": "截止日期", "field_type": "FIELD_TYPE_DATE_TIME" }, + { "field_title": "完成进度", "field_type": "FIELD_TYPE_PROGRESS" } + ] +} +``` + +## 更新字段注意事项 + +- `smartsheet_update_fields` **只能更新字段标题**,不能更改字段类型 +- `field_type` 必须传字段当前的原始类型 +- `field_title` 不能更新为原值(即不能传与当前相同的标题) diff --git a/skills/wecomcli-smartsheet/references/smartsheet-get-records.md b/skills/wecomcli-smartsheet/references/smartsheet-get-records.md new file mode 100644 index 0000000..3c0f658 --- /dev/null +++ b/skills/wecomcli-smartsheet/references/smartsheet-get-records.md @@ -0,0 +1,187 @@ +# smartsheet_get_records API + +查询智能表格中指定子表的记录信息,支持分页读取。支持通过 docid 或文档 URL 定位文档,二者传入其一即可。 + +## 技能定义 + +```json +{ + "name": "smartsheet_get_records", + "description": "查询智能表格中指定子表的记录信息。支持分页查询(cursor + limit),不填 cursor 从第一行开始。支持通过 docid 或文档 URL 定位文档,二者传入其一即可。", + "inputSchema": { + "properties": { + "cursor": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "查询游标,不填代表从第一行记录开始查询", + "title": "Cursor" + }, + "docid": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "文档的 docid,与 url 二选一传入", + "title": "Docid" + }, + "limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "分页大小,每页返回多少条数据;当不填写该参数或将该参数设置为 0 时,如果总数大于 1000,一次性返回 1000 行记录,当总数小于 1000 时,返回全部记录;limit 最大值为 1000", + "title": "Limit" + }, + "sheet_id": { + "description": "子表的 sheet_id,用于指定要查询的智能表格中的哪个子表", + "title": "Sheet Id", + "type": "string" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "文档的访问链接,与 docid 二选一传入", + "title": "Url" + } + }, + "required": [ + "sheet_id" + ], + "title": "smartsheet_get_recordsArguments", + "type": "object" + } +} +``` + +## 参数说明 + +| 参数 | 类型 | 必填 | 说明 | +|---|---|---|---| +| cursor | string | 否 | 查询游标,不填代表从第一行记录开始查询 | +| docid | string | 与 url 二选一 | 文档的 docid | +| limit | integer | 否 | 分页大小,每页返回多少条数据;当不填写该参数或将该参数设置为 0 时,如果总数大于 1000,一次性返回 1000 行记录,当总数小于 1000 时,返回全部记录;limit 最大值为 1000 | +| sheet_id | string | 是 | 子表的 sheet_id,用于指定要查询的智能表格中的哪个子表 | +| url | string | 与 docid 二选一 | 文档的访问链接 | + +## 请求示例 + +以传入docid为例: + +```json +{ + "docid": "DOCID", + "sheet_id": "123Abc" +} +``` + +以传url为例: + +```json +{ + "url": "https://doc.weixin.qq.com/smartsheet/xxx", + "sheet_id": "123Abc" +} +``` + +## 响应示例(含分页) + +```json +{ + "errcode": 0, + "errmsg": "ok", + "total": 100, + "has_more": true, + "next_cursor": "mock_cursor_token", + "records": [ + { + "record_id": "rec_001", + "create_time": "1700000000000", + "update_time": "1700000000000", + "values": { + "成员": [ + {"user_id": "real.user001", "id_type": 1} + ], + "序号": [ + {"text": "1", "type": "text"} + ], + "附件": [ + { + "doc_type": 2, + "file_ext": "xlsx", + "file_type": "Wedrive", + "file_url": "https://drive.weixin.qq.com/s?k=MOCK_TOKEN", + "name": "report.xlsx", + "size": 12345 + } + ] + }, + "creator_name": "张三", + "updater_name": "张三" + }, + { + "record_id": "rec_002", + "create_time": "1700000000000", + "update_time": "1700000000000", + "values": { + "截图": [ + { + "height": 1080, + "id": "img_mock_id", + "image_url": "https://wdcdn.qpic.cn/mocked_path?w=1920&h=1080", + "title": "screenshot_001", + "width": 1920 + } + ], + "序号": [ + {"text": "2", "type": "text"} + ] + }, + "creator_name": "张三", + "updater_name": "李四" + } + ] +} +``` + +## 响应数据结构 + +- `total`: 总记录数(integer) +- `has_more`: 是否还有更多数据(boolean) +- `next_cursor`: 下一页游标,用于分页(string,仅当 has_more 为 true 时存在) +- `records`: 记录数组 + + +## 分页查询 + +```bash +# 第一页 +wecom-cli doc smartsheet_get_records '{"docid": "DOCID", "sheet_id": "SHEETID"}' + +# 下一页(使用上一条的 next_cursor) +wecom-cli doc smartsheet_get_records '{"docid": "DOCID", "sheet_id": "SHEETID", "cursor": "上一条的 next_cursor 值"}' +``` + diff --git a/skills/wecomcli-todo/SKILL.md b/skills/wecomcli-todo/SKILL.md new file mode 100644 index 0000000..b99e447 --- /dev/null +++ b/skills/wecomcli-todo/SKILL.md @@ -0,0 +1,306 @@ +--- +name: wecomcli-todo +description: 企业微信待办事项管理技能,支持创建待办、更新待办、更改用户在待办中的状态、获取待办列表、批量获取待办详情、删除待办。在用户说"帮我创建一个待办"、"把这个任务分派给张三"、"标记待办完成"、"接受/拒绝这个待办"、"把我在这个待办里的状态改成已完成"、"删掉那个待办"、"帮我建个提醒"、"更新一下待办内容"、"把提醒时间改到下周"、"看看这个待办的详情"、"待办分派给谁了"、"看看我有哪些待办"、"列一下我最近的待办"等需要对待办进行读写操作的场景时使用。 +metadata: + requires: + bins: ["wecom-cli"] + cliHelp: "wecom-cli todo --help" +--- + +# 企业微信待办事项管理技能 + +> `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 + +## 概述 + +wecomcli-todo 提供企业微信待办事项的管理能力,包含以下功能: + +1. **搜索 userid** - 根据姓名或别名搜索用户的 userid,用于在创建/更新待办、更改用户状态、查询待办列表时把姓名解析为 userid +2. **创建待办** - 创建新的待办事项,可指定内容、参与人、截止时间和提醒方式 +3. **更新待办** - 修改已有待办的内容、参与人、待办状态、截止时间和提醒方式 +4. **更改用户状态** - 更改某位参与人在某个待办中的状态(拒绝/接受/已完成) +5. **获取待办列表** - 获取指定用户的待办列表,支持按创建时间和提醒时间过滤 +6. **获取待办详情** - 根据待办 ID 列表批量获取完整信息 +7. **删除待办** - 删除指定的待办事项 + +## 命令调用方式 + +执行指定命令: +```bash +wecom-cli todo '' +``` + +--- + +## 命令详细说明 + +### 1. 搜索 userid (search_todo_userid) + +基础接口,根据姓名或别名搜索用户的 userid,用于在创建待办、更新待办时把用户姓名解析为 userid 进行传参。 + +#### 执行命令 + +```bash +wecom-cli todo search_todo_userid '' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `keyword` | string | 是 | 姓名或别名 | + +#### 调用示例 + +```bash +wecom-cli todo search_todo_userid '{"keyword": "张三"}' +``` + +#### 返回字段说明 + +- 返回与关键字匹配的用户的 `userid`(可能为多个候选)。 +- 若有多个同名/相似用户,展示候选列表让用户确认后再使用;展示时只用姓名/别名/部门等可读信息区分,**禁止向用户暴露 `userid`**。 +- 拿到的 `userid` 用于 `create_todo` / `update_todo` 的 `follower_list`,仅供内部传参,不在对话中展示。 +- 调用前可先检查对话上下文是否已有该用户的 `userid`,若有则直接复用、无需再次查询;若本接口返回错误(查询失败、无结果等),则改用通讯录 `wecomcli-contact` 技能搜索(详见注意事项第 2 条)。 + +--- + +### 2. 创建待办 (create_todo) + +创建一个新的待办事项,可指定内容、参与人、截止时间和提醒方式。 + +#### 执行命令 + +```bash +wecom-cli todo create_todo '' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|----|-----------------------------------------------------------------| +| `content` | string | 是 | 待办内容 | +| `follower_list` | object | 是 | 参与人信息,对象中包含 `followers` 数组,格式见注意事项第 3 条 | +| `end_time` | string | 条件必填 | 截止时间(到期时间),格式:`YYYY-MM-DD HH:mm:ss`;提醒方式基于此时间计算偏移。当 `remind_type_list` 含非 `0`(即设置了实际提醒)时**必填** | +| `remind_type_list` | uint32[] | 否 | 提醒方式,相对 `end_time` 计算,可传入多个。取值:`0`-不提醒,`1`-到期时,`3`-提前 15 分钟,`5`-提前 1 小时,`6`-提前 2 小时,`7`-提前 1 天,`8`-提前 2 天,`9`-提前 1 周(详见注意事项第 4 条) | + +#### 调用示例 + +```bash +wecom-cli todo create_todo '{"content": "<待办的内容>", "follower_list": {"followers": [{"follower_id": "FOLLOWER_ID", "follower_status": 1}]}, "end_time": "2025-06-01 09:00:00", "remind_type_list": [3, 7]}' +``` + +#### 返回字段说明 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `todo_id` | string | 新创建的待办唯一 ID | + +--- + +### 3. 更新待办 (update_todo) + +修改已有待办事项的内容、参与人、待办状态、截止时间或提醒方式。 + +> 说明:本接口可更改待办状态(`todo_status`),但**不能更改参与人状态(`follower_status`)**。如需更改当前用户在某个待办中的状态,请使用 `change_todo_user_status`。 + +#### 执行命令 + +```bash +wecom-cli todo update_todo '' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|----------------------------------------------------------| +| `todo_id` | string | 是 | 待办 ID | +| `content` | string | 否 | 新的待办内容 | +| `follower_list` | object | 否 | 新的参与人信息(全量替换,非追加),对象中包含 `followers` 数组,格式见注意事项第 3 条。若要新增参与人,需先查出现有参与人,合并后一起提交。**本接口不会更改参与人状态(`follower_status`),如需更改用户状态请使用 `change_todo_user_status`** | +| `todo_status` | uint32 | 否 | 新的待办状态:`0`-已完成,`1`-进行中 | +| `end_time` | string | 否 | 新的截止时间(到期时间),格式:`YYYY-MM-DD HH:mm:ss`;提醒方式基于此时间计算偏移 | +| `remind_type_list` | uint32[] | 否 | 新的提醒方式,相对 `end_time` 计算,可传入多个。取值:`0`-不提醒,`1`-到期时,`3`-提前 15 分钟,`5`-提前 1 小时,`6`-提前 2 小时,`7`-提前 1 天,`8`-提前 2 天,`9`-提前 1 周(详见注意事项第 4 条) | + +#### 调用示例 + +```bash +wecom-cli todo update_todo '{"todo_id": "TODO_ID", "content": "<待办的内容>", "end_time": "2025-07-01 09:00:00", "remind_type_list": [1]}' +``` + +--- + +### 4. 更改用户在某个待办的状态 (change_todo_user_status) + +更改某位参与人在某个待办中的状态(拒绝/接受/已完成)。 + +#### 执行命令 + +```bash +wecom-cli todo change_todo_user_status '' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `todo_id` | string | 是 | 待办 ID | +| `follower_id` | string | 是 | 参与人 `userid`,指定要修改哪一位参与人的状态。来源遵循注意事项第 2 条的 userid 获取规则(上下文已有 → `search_todo_userid` → `wecomcli-contact` 技能兜底),禁止自行猜测或构造 | +| `user_status` | uint32 | 是 | 用户状态:`0`-拒绝,`1`-接受,`2`-已完成 | + +#### 调用示例 + +```bash +wecom-cli todo change_todo_user_status '{"todo_id": "TODO_ID", "follower_id": "FOLLOWER_ID", "user_status": 2}' +``` + +--- + +### 5. 获取待办列表 (get_todo_list) + +获取指定用户(由 `follower_id` 指定,可为任意用户)通过机器人的待办列表,支持当天前后一个月的待办,可按创建时间、提醒时间、截止时间和待办状态过滤。 + +#### 执行命令 + +```bash +wecom-cli todo get_todo_list '' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `follower_id` | string | 是 | 参与人 `userid`,指定要查询哪一位用户的待办列表(可为任意用户),来源遵循注意事项第 2 条的 userid 获取规则,禁止自行猜测或构造 | +| `create_begin_time` | string | 否 | 创建开始时间 | +| `create_end_time` | string | 否 | 创建结束时间 | +| `remind_begin_time` | string | 否 | 提醒开始时间 | +| `remind_end_time` | string | 否 | 提醒结束时间 | +| `deadline_begin_time` | string | 否 | 截止开始时间 | +| `deadline_end_time` | string | 否 | 截止结束时间 | +| `todo_status` | uint32 | 否 | 待办状态:`0`-已完成,`1`-进行中 | +| `limit` | uint32 | 否 | 最大返回数量,默认为 10,最大为 20 | +| `cursor` | string | 否 | 游标,用于分页 | + +> **查询时间范围限制**: +> - 用于筛选的时间(创建时间、提醒时间、截止时间)必须落在当天前后 30 天以内。 +> - 若仅按 `todo_status` 筛选而未传任何时间范围,则默认按「创建时间在当天前后 30 天内」查询。 + +#### 调用示例 + +```bash +wecom-cli todo get_todo_list '{"follower_id": "FOLLOWER_ID", "create_begin_time": "2025-06-01 00:00:00", "create_end_time": "2025-06-30 23:59:59", "todo_status": 1, "limit": 20}' +``` + +#### 返回字段说明 + +- 返回指定用户(`follower_id`)的待办列表,以及用于分页的游标。 +- 拿到的 `todo_id` 可用于 `get_todo_detail` / `update_todo` / `delete_todo`,仅供内部传参,**禁止向用户暴露**。 + +--- + +### 6. 获取待办详情 (get_todo_detail) + +根据待办 ID 列表批量查询完整详情,包含待办内容和参与人信息。 + +#### 执行命令 + +```bash +wecom-cli todo get_todo_detail '' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `todo_id_list` | string[] | 是 | 待办 ID 列表,至少 1 个,最多 20 个 | + +#### 调用示例 + +```bash +wecom-cli todo get_todo_detail '{"todo_id_list": ["TODO_ID_1", "TODO_ID_2"]}' +``` + +#### 返回字段说明 + +| 字段 | 类型 | 说明 | +|---------------------------------------------------------|--------|-----------------------------------| +| `data_list` | array | 待办详情列表,最多 20 条 | +| `data_list[].todo_id` | string | 待办 ID | +| `data_list[].todo_status` | number | 待办状态:`0`-已完成,`1`-进行中,`2`-已删除 | +| `data_list[].content` | string | 待办内容 | +| `data_list[].follower_list` | object | 参与人列表 | +| `data_list[].follower_list.followers[].follower_id` | string | 参与人 ID(即 userid) | +| `data_list[].follower_list.followers[].name` | string | 参与人姓名 | +| `data_list[].follower_list.followers[].follower_status` | number | 参与人状态:`0`-拒绝,`1`-接受,`2`-已完成 | +| `data_list[].follower_list.followers[].update_time` | string | 参与人状态更新时间 | +| `data_list[].creator_id` | string | 创建人 ID(即 userid) | +| `data_list[].user_status` | number | 当前用户在该待办中的状态:`0`-拒绝,`1`-接受,`2`-已完成 | +| `data_list[].end_time` | string | 截止时间(到期时间) | +| `data_list[].remind_type_list` | array | 提醒方式列表,取值:`0`-不提醒,`1`-到期时,`3`-提前 15 分钟,`5`-提前 1 小时,`6`-提前 2 小时,`7`-提前 1 天,`8`-提前 2 天,`9`-提前 1 周 | +| `data_list[].create_time` | string | 创建时间 | +| `data_list[].update_time` | string | 更新时间 | + +--- + +### 7. 删除待办 (delete_todo) + +删除指定的待办事项。 + +#### 执行命令 + +```bash +wecom-cli todo delete_todo '' +``` + +#### 入参说明 + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `todo_id` | string | 是 | 待办 ID | + +#### 调用示例 + +```bash +wecom-cli todo delete_todo '{"todo_id": "TODO_ID"}' +``` + +--- + +## 注意事项 + +1. **todo_id 来源规则** + - `todo_id` 可来自 `create_todo` 返回的结果,或 `get_todo_list` 查询到的列表,请务必保存好,禁止自行推测或构造 + +2. **userid 来源与隐私规则** + - 分派待办时,`follower_list` 中的 `follower_id` 即 `userid`,按以下优先级获取,禁止根据用户姓名自行猜测或构造 userid: + 1. **对话上下文已有**:若对话上下文中已经提到对应用户的 `userid`,直接使用,无需再次查询 + 2. **search_todo_userid 查询**:若上下文中没有,则可先询问用户在企业内的用户名称(通常是姓名),再通过 `search_todo_userid` 接口按姓名/别名查询获取 + 3. **通讯录技能兜底**:若 `search_todo_userid` 返回错误(如当前企业不适用等),则改用通讯录 `wecomcli-contact` 技能搜索获取 `userid` + - `userid` 属于敏感标识,仅用于接口传参,**禁止在回复或候选列表中向用户展示**;需要让用户区分人员时,只展示姓名/别名/部门等可读信息 + +3. **follower_list 格式说明** + - 作为入参时,`follower_list` 为对象,内含 `followers` 数组,格式如下: + ```json + "follower_list": { + "followers": [ + { + "follower_id": "FOLLOWER_ID", + "follower_status": 1 + } + ] + } + ``` + - `follower_id` 即用户的 `userid`,其来源遵循上文「userid 来源与隐私规则」的优先级(上下文已有 → `search_todo_userid` → `wecomcli-contact` 技能兜底),禁止自行猜测或构造 + - `follower_status` 为参与人状态:`0`-拒绝,`1`-接受,`2`-已完成;该字段仅在 `create_todo` 中生效 + - 在 `update_todo` 中为全量替换(非追加):若要新增参与人,需先用 `get_todo_detail` 查出现有参与人,合并后一并提交;`update_todo` **不会更改参与人状态(`follower_status`)**,如需更改当前用户在某个待办中的状态,请使用 `change_todo_user_status` + +4. **remind_type_list 提醒方式取值** + +`remind_type_list` 是一个 uint32 数组,可同时传入多个提醒: + +| 值 | 含义 | 值 | 含义 | +|----|------|----|------| +| `0` | 不提醒 | `6` | 提前 2 小时 | +| `1` | 到期时 | `7` | 提前 1 天 | +| `3` | 提前 15 分钟 | `8` | 提前 2 天 | +| `5` | 提前 1 小时 | `9` | 提前 1 周 | + diff --git a/src/auth/bot.rs b/src/auth/bot.rs new file mode 100644 index 0000000..3510d34 --- /dev/null +++ b/src/auth/bot.rs @@ -0,0 +1,78 @@ +use std::fs; +use std::time::{SystemTime, UNIX_EPOCH}; + +use serde::{Deserialize, Serialize}; + +use anyhow::Result; + +use crate::{crypto, fs_util, paths}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Bot { + // Bot ID + pub id: String, + // Bot Secret + pub secret: String, + // Creation timestamp (unix epoch seconds) + pub create_time: u64, +} + +impl Bot { + /// Create a new Bot with `create_time` set to the current timestamp. + pub fn new(id: String, secret: String) -> Self { + let create_time = SystemTime::now() + .duration_since(UNIX_EPOCH) + .unwrap_or_default() + .as_secs(); + Self { + id, + secret, + create_time, + } + } +} + +/// Read encrypted bot info from disk, decrypt and return it. +/// Returns `None` if the file does not exist or decryption fails. +pub fn get_bot_info() -> Option { + let data = fs::read(bot_info_path()).ok()?; + crypto::try_decrypt_data(&data).ok() +} + +/// Serialize bot info, encrypt and persist to disk. +/// The encryption key is stored in the system keyring when possible, otherwise falls back to an encrypted file. +pub fn set_bot_info(bot: &Bot) -> Result<()> { + // 1. Load or generate an encryption key + let key = crypto::load_existing_key().unwrap_or_else(|| { + let k = crypto::generate_random_key(); + tracing::info!("已生成新的加密密钥"); + k + }); + + // 2. Persist the key (prefer keyring, fall back to file) + crypto::save_key(&key)?; + + // 3. Serialize bot info → JSON → encrypt + let encrypted = crypto::encrypt_data(bot, &key)?; + + // 4. Write to file + let path = bot_info_path(); + fs_util::atomic_write(&path, &encrypted, Some(0o600))?; + + tracing::info!("企业微信机器人信息已保存到 {}", path.display()); + Ok(()) +} + +/// Remove the stored Bot info from disk. +pub fn clear_bot_info() { + let path = bot_info_path(); + if path.exists() { + let _ = fs::remove_file(&path); + tracing::info!("机器人信息已删除:{}", path.display()); + } +} + +/// Return the file path for the encrypted bot credentials. +fn bot_info_path() -> std::path::PathBuf { + paths::wecom_home_dir().join("bot.enc") +} diff --git a/src/auth/mod.rs b/src/auth/mod.rs new file mode 100644 index 0000000..f71f680 --- /dev/null +++ b/src/auth/mod.rs @@ -0,0 +1,5 @@ +mod bot; +mod qrcode; + +pub use bot::{Bot, clear_bot_info, get_bot_info, set_bot_info}; +pub use qrcode::scan_qrcode_for_bot; diff --git a/src/auth/qrcode.rs b/src/auth/qrcode.rs new file mode 100644 index 0000000..3687852 --- /dev/null +++ b/src/auth/qrcode.rs @@ -0,0 +1,186 @@ +use std::io::IsTerminal; +use std::time::Duration; + +use crate::browser; +use anyhow::{Context, Result, bail}; +use serde::Deserialize; + +use super::bot::Bot; + +// --------------------------------------------------------------------------- +// Constants +// --------------------------------------------------------------------------- + +const SOURCE: &str = "wecom_cli_external"; +const QR_GENERATE_URL: &str = "https://work.weixin.qq.com/ai/qc/generate"; +const QR_QUERY_URL: &str = "https://work.weixin.qq.com/ai/qc/query_result"; +const QR_CODE_PAGE: &str = "https://work.weixin.qq.com/ai/qc/gen"; + +/// 轮询间隔 3 秒 +const POLL_INTERVAL: Duration = Duration::from_secs(3); +/// 超时 5 分钟 +const POLL_TIMEOUT: Duration = Duration::from_secs(300); + +// --------------------------------------------------------------------------- +// Response types +// --------------------------------------------------------------------------- + +#[derive(Deserialize)] +struct GenerateResponse { + data: Option, +} + +#[derive(Deserialize)] +struct GenerateData { + scode: Option, + auth_url: Option, +} + +#[derive(Deserialize)] +struct QueryResponse { + data: Option, +} + +#[derive(Deserialize)] +struct QueryData { + status: Option, + bot_info: Option, +} + +#[derive(Deserialize)] +struct BotInfoPayload { + botid: Option, + secret: Option, +} + +// --------------------------------------------------------------------------- +// Public API +// --------------------------------------------------------------------------- + +/// 扫码接入完整流程:获取二维码 → 终端展示 → 轮询结果 → 返回 Bot +pub async fn scan_qrcode_for_bot(no_open: bool) -> Result { + let client = build_client()?; + + println!("正在获取二维码..."); + let (scode, auth_url) = fetch_qrcode(&client).await?; + + let qrcode_url = format!("{}?source={}&scode={}", QR_CODE_PAGE, SOURCE, scode); + + println!("请打开二维码链接扫码: \n{}", qrcode_url); + + println!("也可以使用企业微信扫描以下二维码:"); + if std::io::stdout().is_terminal() { + render_qrcode(&auth_url)?; + } else { + render_qrcode_unicode(&auth_url)?; + } + + // 同步在浏览器中打开二维码 + if !no_open { + browser::open_url_by_browser(&qrcode_url); + } + + println!("等待扫码中..."); + + let (bot_id, secret) = poll_result(&client, &scode).await?; + + println!("✔ 扫码成功!Bot ID 和 Secret 已自动获取。"); + + Ok(Bot::new(bot_id, secret)) +} + +// --------------------------------------------------------------------------- +// Internal helpers +// --------------------------------------------------------------------------- + +fn build_client() -> Result { + reqwest::Client::builder() + .build() + .context("创建 HTTP 客户端失败") +} + +/// 获取二维码链接和轮询 scode +async fn fetch_qrcode(client: &reqwest::Client) -> Result<(String, String)> { + let url = format!( + "{}?source={}&plat={}", + QR_GENERATE_URL, + SOURCE, + get_plat_code() + ); + + let response: GenerateResponse = client.get(&url).send().await?.json().await?; + + let Some(data) = response.data.as_ref() else { + bail!("获取二维码失败,响应格式异常"); + }; + + let (Some(scode), Some(auth_url)) = (&data.scode, &data.auth_url) else { + bail!("获取二维码失败,响应格式异常"); + }; + + Ok((scode.to_string(), auth_url.to_string())) +} + +fn get_plat_code() -> u8 { + if cfg!(target_os = "macos") { + 1 + } else if cfg!(target_os = "windows") { + 2 + } else if cfg!(target_os = "linux") { + 3 + } else { + 0 + } +} + +/// 在终端渲染二维码(TTY,带 ANSI 色彩) +fn render_qrcode(url: &str) -> Result<()> { + println!(); + qr2term::print_qr(url).map_err(|e| anyhow::anyhow!("二维码渲染失败: {e}"))?; + Ok(()) +} + +/// 在 non-TTY 环境下用纯 Unicode 半块字符渲染二维码(无 ANSI escape) +fn render_qrcode_unicode(url: &str) -> Result<()> { + use qrcode::QrCode; + use qrcode::render::unicode::Dense1x2; + + let code = QrCode::new(url).map_err(|e| anyhow::anyhow!("二维码渲染失败: {e}"))?; + let string = code + .render::() + .dark_color(Dense1x2::Dark) + .light_color(Dense1x2::Light) + .build(); + println!(); + println!("{}", string); + Ok(()) +} + +/// 轮询扫码结果 +async fn poll_result(client: &reqwest::Client, scode: &str) -> Result<(String, String)> { + let url = format!("{}?scode={}", QR_QUERY_URL, scode); + let start = std::time::Instant::now(); + + loop { + if start.elapsed() >= POLL_TIMEOUT { + bail!("扫码超时(5 分钟),请重试。"); + } + + let response: QueryResponse = client.get(&url).send().await?.json().await?; + + if let Some(data) = &response.data { + if data.status.as_deref() == Some("success") { + let Some(bot_info) = &data.bot_info else { + anyhow::bail!("扫码成功但未获取到 Bot 信息"); + }; + let (Some(botid), Some(secret)) = (&bot_info.botid, &bot_info.secret) else { + anyhow::bail!("扫码成功但未获取到 Bot 信息"); + }; + + return Ok((botid.to_string(), secret.to_string())); + } + } + + tokio::time::sleep(POLL_INTERVAL).await; + } +} diff --git a/src/browser.rs b/src/browser.rs new file mode 100644 index 0000000..f51d8db --- /dev/null +++ b/src/browser.rs @@ -0,0 +1,10 @@ +/// 尝试使用系统默认浏览器打开指定 URL。 +/// - 使用 `open` crate 跨平台打开浏览器(macOS: `open`、Windows: `ShellExecuteW`、Linux: `xdg-open`)。 +/// - 打开失败不会中断主流程,仅记录日志。 +pub fn open_url_by_browser(url: &str) { + tracing::debug!(url, "正在使用默认浏览器打开链接"); + + open::that(url).unwrap_or_else(|err| { + tracing::debug!(url, %err, "无法打开默认浏览器,请手动在浏览器中打开链接"); + }); +} diff --git a/src/cmd/auth.rs b/src/cmd/auth.rs new file mode 100644 index 0000000..702b986 --- /dev/null +++ b/src/cmd/auth.rs @@ -0,0 +1,59 @@ +use crate::auth::{Bot, get_bot_info}; +use anyhow::Result; +use clap::{ArgMatches, Args, Command, FromArgMatches, Subcommand}; + +#[derive(Subcommand)] +#[command(subcommand_required = true, arg_required_else_help = true)] +pub enum AuthSubcmds { + /// Show current authentication state + Show(ShowArgs), +} + +#[derive(Args)] +pub struct ShowArgs { + /// 展示认证状态详情 + #[arg(long)] + pub auth_status: bool, +} + +pub fn build_auth_cmd() -> Command { + AuthSubcmds::augment_subcommands(Command::new("auth")).hide(true) +} + +pub async fn handle_auth_cmd(matches: &ArgMatches) -> Result<()> { + match AuthSubcmds::from_arg_matches(matches)? { + AuthSubcmds::Show(args) => handle_auth_show(&args), + } +} + +fn handle_auth_show(args: &ShowArgs) -> Result<()> { + let bot = get_bot_info(); + + if args.auth_status { + return handle_auth_show_auth_status(bot); + } + + handle_auth_show_default(bot) +} + +fn handle_auth_show_default(bot: Option) -> Result<()> { + if let Some(bot) = bot { + let view = serde_json::json!({ + "id": bot.id, + "create_time": bot.create_time, + }); + println!("{}", serde_json::to_string_pretty(&view)?); + } else { + println!("unauthorized"); + } + Ok(()) +} + +fn handle_auth_show_auth_status(bot: Option) -> Result<()> { + if bot.is_some() { + println!("authorized"); + } else { + println!("unauthorized"); + } + Ok(()) +} diff --git a/src/cmd/cache.rs b/src/cmd/cache.rs new file mode 100644 index 0000000..735ce87 --- /dev/null +++ b/src/cmd/cache.rs @@ -0,0 +1,124 @@ +use std::fs; +use std::path::Path; + +use anyhow::Result; +use clap::{ArgMatches, Command, FromArgMatches, Subcommand}; +use serde_json::json; + +use crate::paths; + +/// 管理本地缓存 +#[derive(Subcommand)] +pub enum CacheCmds { + /// 显示本地缓存状态 + #[command(disable_help_flag = true)] + Status, + /// 清除本地缓存 + #[command(disable_help_flag = true)] + Clear, +} + +pub fn build_cache_cmd() -> Command { + CacheCmds::augment_subcommands(Command::new("cache")) + .disable_help_flag(true) + .disable_help_subcommand(true) + .subcommand_required(true) + .arg_required_else_help(true) +} + +pub async fn handle_cache_cmd(matches: &ArgMatches) -> Result<()> { + let args = CacheCmds::from_arg_matches(matches); + let cache_dir = paths::cache_dir(); + match args { + Ok(CacheCmds::Status) => handle_cache_status(&cache_dir), + Ok(CacheCmds::Clear) => handle_cache_clear(&cache_dir), + _ => anyhow::bail!("未知命令"), + } +} + +/// 列出当前缓存目录下所有文件及其修改时间。 +fn handle_cache_status(cache_dir: &Path) -> Result<()> { + let files = collect_cache_files(cache_dir); + + let mut entries: Vec = files + .iter() + .filter_map(|path| { + let metadata = fs::metadata(path).ok()?; + let modified = metadata + .modified() + .ok()? + .duration_since(std::time::UNIX_EPOCH) + .ok()? + .as_secs(); + Some(json!({ + "file": path.file_name().unwrap_or_default().to_string_lossy(), + "update_time": modified, + })) + }) + .collect(); + + entries.sort_by(|a, b| { + a["file"] + .as_str() + .unwrap_or_default() + .cmp(b["file"].as_str().unwrap_or_default()) + }); + + println!( + "{}", + serde_json::to_string_pretty(&entries).unwrap_or_default() + ); + Ok(()) +} + +/// 清除缓存目录下所有文件。 +fn handle_cache_clear(cache_dir: &Path) -> Result<()> { + let mut removed = Vec::new(); + + for path in collect_cache_files(cache_dir) { + match fs::remove_file(&path) { + Ok(()) => { + removed.push( + path.file_name() + .unwrap_or_default() + .to_string_lossy() + .to_string(), + ); + } + Err(e) => { + tracing::warn!(path = %path.display(), error = %e, "删除缓存文件失败"); + } + } + } + + let output = if removed.is_empty() { + json!({ + "status": "success", + "message": "未找到需要删除的缓存文件", + }) + } else { + json!({ + "status": "success", + "message": format!("已删除 {} 个缓存文件", removed.len()), + "removed": removed, + }) + }; + + println!( + "{}", + serde_json::to_string_pretty(&output).unwrap_or_default() + ); + Ok(()) +} + +/// 收集缓存目录下所有常规文件的路径。 +fn collect_cache_files(cache_dir: &Path) -> Vec { + let Ok(read_dir) = fs::read_dir(cache_dir) else { + return Vec::new(); + }; + read_dir + .flatten() + .map(|e| e.path()) + .filter(|p| p.is_file()) + .collect() +} diff --git a/src/cmd/init.rs b/src/cmd/init.rs new file mode 100644 index 0000000..cf5a90c --- /dev/null +++ b/src/cmd/init.rs @@ -0,0 +1,110 @@ +use std::io::IsTerminal; + +use crate::auth; +use crate::mcp; +use crate::mcp::config::McpBindSource; +use anyhow::Result; +use clap::{ArgMatches, Args, Command, FromArgMatches}; + +#[derive(Args)] +pub struct InitArgs { + /// 跳过交互选择,直接使用扫码方式接入 + #[arg(long)] + pub noninteractive: bool, + + /// 扫码时不自动在浏览器打开二维码页面 + #[arg(long = "no-open")] + pub no_open: bool, +} + +pub fn build_init_cmd() -> Command { + InitArgs::augment_args(Command::new("init").about("初始化企业微信机器人配置")) + .disable_help_flag(true) +} + +/// Handle the `init` subcommand: prompt for bot credentials, persist them, and verify via MCP config fetch. +pub async fn handle_init_cmd(matches: &ArgMatches) -> Result<()> { + let args = InitArgs::from_arg_matches(matches)?; + + if !args.noninteractive && !std::io::stderr().is_terminal() { + anyhow::bail!( + "当前环境不支持交互式操作,请使用 --noninteractive 参数:\n {} init --noninteractive", + env!("CARGO_BIN_NAME") + ); + } + + cliclack::intro("企业微信机器人初始化")?; + + let (bot, bind_source) = if args.noninteractive { + (init_qrcode(args.no_open).await?, McpBindSource::Qrcode) + } else { + let method: &str = cliclack::select("请选择企微机器人接入方式:") + .item("qrcode", "扫码接入(推荐)", "") + .item("manual", "手动输入 Bot ID 和 Secret", "") + .interact()?; + + match method { + "qrcode" => (init_qrcode(args.no_open).await?, McpBindSource::Qrcode), + _ => (init_manual().await?, McpBindSource::Interactive), + } + }; + + auth::set_bot_info(&bot)?; + verify_and_finish(bind_source).await +} + +/// 扫码接入流程 +async fn init_qrcode(no_open: bool) -> Result { + auth::scan_qrcode_for_bot(no_open).await +} + +/// 手动输入 Bot ID 和 Secret +async fn init_manual() -> Result { + let bot_id: String = cliclack::input("企业微信机器人 Bot ID") + .placeholder("请输入企业微信机器人ID") + .interact()?; + + let bot_secret: String = cliclack::password("企业微信机器人 Secret") + .mask('*') + .interact()?; + + Ok(auth::Bot::new(bot_id, bot_secret)) +} + +/// 验证凭证并完成初始化 +async fn verify_and_finish(bind_source: McpBindSource) -> Result<()> { + let spinner = cliclack::spinner(); + spinner.start("正在验证企业微信机器人凭证..."); + + if let Err(e) = mcp::config::fetch_mcp_config(bind_source).await { + spinner.stop("企业微信机器人凭证验证失败"); + + let mut output_errmsg: String = "验证企业微信机器人凭证失败".to_owned(); + + match &e { + mcp::error::FetchMcpConfigError::Api(resp) => { + if let Some(ref msg) = resp.errmsg { + if !msg.is_empty() { + output_errmsg = msg.clone(); + } + } + } + mcp::error::FetchMcpConfigError::Http(http_err) => { + output_errmsg = format!("{} HTTP返回状态码 {}", output_errmsg, http_err.status); + } + mcp::error::FetchMcpConfigError::Other(other_err) => { + output_errmsg = other_err.to_string(); + } + } + + // Credentials invalid or server unreachable — rollback + auth::clear_bot_info(); + mcp::config::clear_mcp_config(); + cliclack::outro("初始化失败 ❌")?; + anyhow::bail!(output_errmsg); + } + + spinner.stop("企业微信机器人凭证验证成功"); + cliclack::outro("初始化完成 ✅")?; + Ok(()) +} diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs new file mode 100644 index 0000000..cf4b127 --- /dev/null +++ b/src/cmd/mod.rs @@ -0,0 +1,3 @@ +pub mod auth; +pub mod cache; +pub mod init; diff --git a/src/constants.rs b/src/constants.rs new file mode 100644 index 0000000..c0e2f21 --- /dev/null +++ b/src/constants.rs @@ -0,0 +1,39 @@ +const DEFAULT_MCP_CONFIG_ENDPOINT: &str = + "https://qyapi.weixin.qq.com/cgi-bin/aibot/cli/get_mcp_config"; + +pub mod env { + /// Config directory, defaults to ~/.config/wecom + pub const CONFIG_DIR: &str = "WECOM_CLI_CONFIG_DIR"; + + /// Temp directory, defaults to std::env::temp_dir().join("wecom") + pub const TMP_DIR: &str = "WECOM_CLI_TMP_DIR"; + + /// Log level + pub const LOG_LEVEL: &str = "WECOM_CLI_LOG_LEVEL"; + + /// Log file directory path + pub const LOG_FILE: &str = "WECOM_CLI_LOG_FILE"; + + /// MCP config URL (仅在启用 `custom-endpoint` feature 后使用) + #[cfg_attr(not(feature = "custom-endpoint"), allow(dead_code))] + pub const MCP_CONFIG_ENDPOINT: &str = "WECOM_CLI_MCP_CONFIG_ENDPOINT"; +} + +/// Return the MCP config endpoint URL (env override or the default WeCom API). +pub fn mcp_config_endpoint() -> String { + #[cfg(feature = "custom-endpoint")] + if let Ok(url) = std::env::var(env::MCP_CONFIG_ENDPOINT) { + return url; + } + DEFAULT_MCP_CONFIG_ENDPOINT.to_string() +} + +pub fn get_user_agent() -> String { + format!( + "WeComCLI/{} distribution/{} {}/{}", + env!("CARGO_PKG_VERSION"), + option_env!("WECOM_CLI_DISTRIBUTION").unwrap_or_else(|| "unknown"), + std::env::consts::OS, + std::env::consts::ARCH, + ) +} diff --git a/src/crypto/cipher.rs b/src/crypto/cipher.rs new file mode 100644 index 0000000..d1b0058 --- /dev/null +++ b/src/crypto/cipher.rs @@ -0,0 +1,118 @@ +use aes_gcm::aead::{Aead, OsRng}; +use aes_gcm::{AeadCore, Aes256Gcm, Key, KeyInit}; +use anyhow::Result; + +/// AES-GCM nonce size (96 bits). +const NONCE_SIZE: usize = 12; +/// AES-GCM authentication tag size (128 bits). +const TAG_SIZE: usize = 16; + +/// Encrypt `plaintext` with AES-256-GCM. Returns `nonce || ciphertext`. +pub fn encrypt(key: &[u8; 32], plaintext: &[u8]) -> Result> { + let cipher = Aes256Gcm::new(Key::::from_slice(key)); + let nonce = Aes256Gcm::generate_nonce(&mut OsRng); + let ciphertext = cipher + .encrypt(&nonce, plaintext) + .map_err(|e| anyhow::anyhow!("数据加密失败:{e}"))?; + + let mut out = nonce.to_vec(); + out.extend(ciphertext); + Ok(out) +} + +/// Decrypt `data` (expected format: `nonce || ciphertext || tag`) with AES-256-GCM. +pub fn decrypt(key: &[u8; 32], data: &[u8]) -> Result> { + if data.len() < NONCE_SIZE + TAG_SIZE { + return Err(anyhow::anyhow!("数据解密失败(数据可能已损坏或被截断)",)); + } + let (nonce_bytes, ciphertext) = data.split_at(NONCE_SIZE); + let nonce = aes_gcm::Nonce::from_slice(nonce_bytes); + let cipher = Aes256Gcm::new(Key::::from_slice(key)); + cipher + .decrypt(nonce, ciphertext) + .map_err(|e| anyhow::anyhow!("数据解密失败:{e}")) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::crypto::keystore::generate_random_key; + + #[test] + fn encrypt_decrypt_roundtrip() { + let key = generate_random_key(); + let plaintext = b"hello, AES-256-GCM!"; + + let encrypted = encrypt(&key, plaintext).unwrap(); + let decrypted = decrypt(&key, &encrypted).unwrap(); + + assert_eq!(decrypted, plaintext); + } + + #[test] + fn encrypt_decrypt_empty_plaintext() { + let key = generate_random_key(); + + let encrypted = encrypt(&key, b"").unwrap(); + let decrypted = decrypt(&key, &encrypted).unwrap(); + + assert_eq!(decrypted, b""); + } + + #[test] + fn encrypted_output_has_expected_length() { + let key = generate_random_key(); + let plaintext = b"test data"; + + let encrypted = encrypt(&key, plaintext).unwrap(); + // nonce (12) + plaintext (9) + tag (16) = 37 + assert_eq!(encrypted.len(), NONCE_SIZE + plaintext.len() + TAG_SIZE); + } + + #[test] + fn decrypt_with_wrong_key_fails() { + let key1 = generate_random_key(); + let key2 = generate_random_key(); + + let encrypted = encrypt(&key1, b"secret").unwrap(); + assert!(decrypt(&key2, &encrypted).is_err()); + } + + #[test] + fn decrypt_too_short_data_fails() { + let key = generate_random_key(); + + // Less than NONCE_SIZE + TAG_SIZE = 28 + assert!(decrypt(&key, &[0u8; 27]).is_err()); + assert!(decrypt(&key, &[]).is_err()); + assert!(decrypt(&key, &[0u8; 11]).is_err()); + } + + #[test] + fn decrypt_corrupted_data_fails() { + let key = generate_random_key(); + let encrypted = encrypt(&key, b"important data").unwrap(); + + // Flip a byte in the ciphertext portion + let mut corrupted = encrypted.clone(); + let last = corrupted.len() - 1; + corrupted[last] ^= 0xFF; + + assert!(decrypt(&key, &corrupted).is_err()); + } + + #[test] + fn each_encryption_produces_different_output() { + let key = generate_random_key(); + let plaintext = b"same plaintext"; + + let a = encrypt(&key, plaintext).unwrap(); + let b = encrypt(&key, plaintext).unwrap(); + + // Different nonces → different ciphertext + assert_ne!(a, b); + // But both decrypt to the same plaintext + assert_eq!(decrypt(&key, &a).unwrap(), plaintext); + assert_eq!(decrypt(&key, &b).unwrap(), plaintext); + } +} diff --git a/src/crypto/keystore.rs b/src/crypto/keystore.rs new file mode 100644 index 0000000..3120268 --- /dev/null +++ b/src/crypto/keystore.rs @@ -0,0 +1,252 @@ +use std::fs; +use std::path::PathBuf; + +use anyhow::Result; +use base64::prelude::*; +use rand::Rng; + +use crate::{fs_util, paths}; + +use super::cipher; + +const KEYRING_SERVICE: &str = "wecom-cli"; +const KEYRING_USER: &str = "encryption-key"; + +// --------------------------------------------------------------------------- +// Paths +// --------------------------------------------------------------------------- + +/// Return the file path for the local encryption key fallback. +pub fn encryption_key_path() -> PathBuf { + paths::wecom_home_dir().join(".encryption_key") +} + +// --------------------------------------------------------------------------- +// Encode / Decode +// --------------------------------------------------------------------------- + +/// Encode a 32-byte key as a Base64 string. +fn encode_key(key: &[u8; 32]) -> String { + BASE64_STANDARD.encode(key) +} + +/// Decode a Base64 string into a 32-byte key, returning an error on invalid input. +fn decode_key(s: &str) -> Result<[u8; 32]> { + let bytes = BASE64_STANDARD + .decode(s) + .map_err(|e| anyhow::anyhow!("base64 decode error: {e}"))?; + <[u8; 32]>::try_from(bytes.as_slice()) + .map_err(|_| anyhow::anyhow!("Invalid encryption key length")) +} + +// --------------------------------------------------------------------------- +// Key generation / loading / saving +// --------------------------------------------------------------------------- + +/// Generate a fresh random 256-bit key. +pub fn generate_random_key() -> [u8; 32] { + rand::rng().random() +} + +/// Load the key from keyring. Returns `None` if unavailable. +fn load_key_from_keyring() -> Option<[u8; 32]> { + let entry = keyring::Entry::new(KEYRING_SERVICE, KEYRING_USER).ok()?; + let b64 = entry.get_password().ok()?; + decode_key(b64.trim()).ok() +} + +/// Load the key from the file fallback. Returns `None` if unavailable. +fn load_key_from_file() -> Option<[u8; 32]> { + let contents = fs::read_to_string(encryption_key_path()).ok()?; + decode_key(contents.trim()).ok() +} + +/// Try to load an existing key. +/// +/// Priority: process cache → file → keyring (last resort, may prompt). +/// The result is cached for the lifetime of the process. +pub fn load_existing_key() -> Option<[u8; 32]> { + load_key_from_file().or_else(load_key_from_keyring) +} + +/// Persist the key. Writes to the file fallback always; writes to keyring +/// at most once per process to avoid repeated macOS Keychain prompts. +/// +/// If the key is already cached and identical, this is a no-op. +pub fn save_key(key: &[u8; 32]) -> Result<()> { + let b64 = encode_key(key); + + // Always write the file fallback. + let key_path = encryption_key_path(); + fs_util::atomic_write(&key_path, b64.as_bytes(), Some(0o600))?; + + if keyring::Entry::new(KEYRING_SERVICE, KEYRING_USER) + .and_then(|entry| entry.set_password(&b64)) + .is_err() + { + tracing::warn!("Keyring unavailable – encryption key stored in file only"); + } + + Ok(()) +} + +// --------------------------------------------------------------------------- +// Encrypt / Decrypt helpers for serializable data +// --------------------------------------------------------------------------- + +/// Encrypt serializable data: serialize → AES-256-GCM encrypt. +pub fn encrypt_data(data: &T, key: &[u8; 32]) -> Result> { + let json = + serde_json::to_vec(data).map_err(|e| anyhow::anyhow!("JSON serialize error: {e:#}"))?; + cipher::encrypt(key, &json) +} + +/// Decrypt data: AES-256-GCM decrypt → deserialize. +pub fn decrypt_data(data: &[u8], key: &[u8; 32]) -> Result { + let decrypted = cipher::decrypt(key, data)?; + serde_json::from_slice(&decrypted).map_err(|e| anyhow::anyhow!("JSON deserialize error: {e:#}")) +} + +/// Try to decrypt data using the cached/keyring key first; on failure, fall back to the file key. +pub fn try_decrypt_data(data: &[u8]) -> Result { + // 1. Try cached key (covers both keyring and file sources) + if let Some(key) = load_key_from_file() { + if let Ok(result) = decrypt_data::(data, &key) { + return Ok(result); + } + tracing::debug!("Cached key failed to decrypt, trying file key directly…"); + } + + // 2. Fall back to file key (in case cache holds a stale keyring key) + let key = load_key_from_file().ok_or(anyhow::anyhow!("解密数据失败(未找到有效密钥)",))?; + decrypt_data(data, &key) +} + +#[cfg(test)] +mod tests { + use super::*; + use serde::{Deserialize, Serialize}; + + // ----------------------------------------------------------------------- + // encode_key / decode_key + // ----------------------------------------------------------------------- + + #[test] + fn encode_decode_roundtrip() { + let key = generate_random_key(); + let encoded = encode_key(&key); + let decoded = decode_key(&encoded).unwrap(); + assert_eq!(key, decoded); + } + + #[test] + fn decode_invalid_base64_fails() { + assert!(decode_key("not-valid-base64!!!").is_err()); + } + + #[test] + fn decode_wrong_length_fails() { + // Valid base64 but only 16 bytes, not 32 + let short = base64::prelude::BASE64_STANDARD.encode([0u8; 16]); + assert!(decode_key(&short).is_err()); + } + + #[test] + fn decode_trims_whitespace() { + let key = generate_random_key(); + let encoded = format!(" {} \n", encode_key(&key)); + let decoded = decode_key(encoded.trim()).unwrap(); + assert_eq!(key, decoded); + } + + // ----------------------------------------------------------------------- + // generate_random_key + // ----------------------------------------------------------------------- + + #[test] + fn random_keys_are_unique() { + let a = generate_random_key(); + let b = generate_random_key(); + assert_ne!(a, b); + } + + #[test] + fn random_key_is_32_bytes() { + let key = generate_random_key(); + assert_eq!(key.len(), 32); + } + + // ----------------------------------------------------------------------- + // encrypt_data / decrypt_data + // ----------------------------------------------------------------------- + + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] + struct TestPayload { + name: String, + value: u64, + } + + #[test] + fn encrypt_decrypt_data_roundtrip() { + let key = generate_random_key(); + let payload = TestPayload { + name: "test".into(), + value: 42, + }; + + let encrypted = encrypt_data(&payload, &key).unwrap(); + let decrypted: TestPayload = decrypt_data(&encrypted, &key).unwrap(); + + assert_eq!(payload, decrypted); + } + + #[test] + fn encrypt_decrypt_data_with_slice() { + let key = generate_random_key(); + let items = vec![ + TestPayload { + name: "a".into(), + value: 1, + }, + TestPayload { + name: "b".into(), + value: 2, + }, + ]; + + let encrypted = encrypt_data(&items, &key).unwrap(); + let decrypted: Vec = decrypt_data(&encrypted, &key).unwrap(); + + assert_eq!(items, decrypted); + } + + #[test] + fn decrypt_data_with_wrong_key_fails() { + let key1 = generate_random_key(); + let key2 = generate_random_key(); + let payload = TestPayload { + name: "secret".into(), + value: 99, + }; + + let encrypted = encrypt_data(&payload, &key1).unwrap(); + assert!(decrypt_data::(&encrypted, &key2).is_err()); + } + + #[test] + fn decrypt_data_with_corrupted_data_fails() { + let key = generate_random_key(); + assert!(decrypt_data::(b"garbage", &key).is_err()); + } + + #[test] + fn encrypt_decrypt_empty_vec() { + let key = generate_random_key(); + let items: Vec = vec![]; + + let encrypted = encrypt_data(&items, &key).unwrap(); + let decrypted: Vec = decrypt_data(&encrypted, &key).unwrap(); + + assert!(decrypted.is_empty()); + } +} diff --git a/src/crypto/mod.rs b/src/crypto/mod.rs new file mode 100644 index 0000000..93a47b7 --- /dev/null +++ b/src/crypto/mod.rs @@ -0,0 +1,4 @@ +mod cipher; +mod keystore; + +pub use keystore::*; diff --git a/src/fs_util/atomic_write.rs b/src/fs_util/atomic_write.rs new file mode 100644 index 0000000..4777056 --- /dev/null +++ b/src/fs_util/atomic_write.rs @@ -0,0 +1,138 @@ +use std::fs; +use std::io::Write; +use std::path::Path; + +use anyhow::Result; + +/// Atomically write `data` (bytes) to `path`, overwriting if the file already exists. +/// +/// Uses `tempfile::NamedTempFile` to create a temporary file in the same directory, +/// then atomically renames it to the target path via `persist`. +pub fn atomic_write(path: &Path, data: &[u8], mode: Option) -> Result<()> { + let Some(parent) = path.parent() else { + anyhow::bail!("无效文件路径:{}", path.display()); + }; + + fs::create_dir_all(parent)?; + + // Create a temp file in the same directory (same filesystem → atomic rename). + let mut tmp = tempfile::NamedTempFile::new_in(parent)?; + + // Set permissions before writing content (avoid permission window). + #[cfg(unix)] + if let Some(m) = mode { + use std::os::unix::fs::PermissionsExt; + tmp.as_file() + .set_permissions(fs::Permissions::from_mode(m))?; + } + + tmp.write_all(data)?; + tmp.as_file().flush()?; + tmp.as_file().sync_all()?; + + // Atomically rename to the target path. + tmp.persist(path)?; + + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::fs; + use tempfile::TempDir; + + fn tmp() -> TempDir { + tempfile::tempdir().unwrap() + } + + // ----------------------------------------------------------------------- + // atomic_write + // ----------------------------------------------------------------------- + + #[test] + fn write_creates_file_with_correct_content() { + let dir = tmp(); + let path = dir.path().join("test.bin"); + let data = b"hello world"; + + atomic_write(&path, data, None).unwrap(); + assert_eq!(fs::read(&path).unwrap(), data); + } + + #[test] + fn write_creates_parent_directories() { + let dir = tmp(); + let path = dir.path().join("a").join("b").join("deep.bin"); + + atomic_write(&path, b"nested", None).unwrap(); + assert_eq!(fs::read(&path).unwrap(), b"nested"); + } + + #[test] + fn overwrite_replaces_existing_file() { + let dir = tmp(); + let path = dir.path().join("overwrite.bin"); + + atomic_write(&path, b"first", None).unwrap(); + atomic_write(&path, b"second", None).unwrap(); + assert_eq!(fs::read(&path).unwrap(), b"second"); + } + + #[test] + fn no_temp_file_left_after_success() { + let dir = tmp(); + let path = dir.path().join("clean.bin"); + + atomic_write(&path, b"ok", None).unwrap(); + + let entries: Vec<_> = fs::read_dir(dir.path()) + .unwrap() + .filter_map(|e| e.ok()) + .collect(); + // Only the target file should remain; no `.tmp.*` leftovers. + assert_eq!(entries.len(), 1); + assert_eq!(entries[0].file_name(), "clean.bin"); + } + + #[test] + fn write_empty_data() { + let dir = tmp(); + let path = dir.path().join("empty.bin"); + + atomic_write(&path, b"", None).unwrap(); + assert_eq!(fs::read(&path).unwrap(), b""); + } + + // ----------------------------------------------------------------------- + // Unix-specific: file permissions + // ----------------------------------------------------------------------- + + #[cfg(unix)] + mod unix { + use super::*; + use std::os::unix::fs::PermissionsExt; + + #[test] + fn write_sets_file_permissions() { + let dir = tmp(); + let path = dir.path().join("secret.bin"); + + atomic_write(&path, b"secret", Some(0o600)).unwrap(); + + let perms = fs::metadata(&path).unwrap().permissions(); + assert_eq!(perms.mode() & 0o777, 0o600); + } + + #[test] + fn write_sets_readonly_permissions() { + let dir = tmp(); + let path = dir.path().join("readonly.bin"); + + atomic_write(&path, b"ro", Some(0o400)).unwrap(); + + let perms = fs::metadata(&path).unwrap().permissions(); + assert_eq!(perms.mode() & 0o777, 0o400); + } + } +} diff --git a/src/fs_util/mod.rs b/src/fs_util/mod.rs new file mode 100644 index 0000000..880f2d3 --- /dev/null +++ b/src/fs_util/mod.rs @@ -0,0 +1,5 @@ +mod atomic_write; +mod sanitize_filename; + +pub use atomic_write::*; +pub use sanitize_filename::*; diff --git a/src/fs_util/sanitize_filename.rs b/src/fs_util/sanitize_filename.rs new file mode 100644 index 0000000..471c691 --- /dev/null +++ b/src/fs_util/sanitize_filename.rs @@ -0,0 +1,15 @@ +/// Sanitize a file name by removing illegal characters; returns `None` if the result is empty. +pub fn sanitize_filename(name: &str) -> Option { + let options = sanitize_filename::Options { + truncate: true, + windows: true, + replacement: "_", + }; + let sanitized = sanitize_filename::sanitize_with_options(name, options); + // Return None if the sanitized result is empty (all illegal characters), so the caller can fallback + if sanitized.is_empty() { + None + } else { + Some(sanitized) + } +} diff --git a/src/helpers/AGENTS.md b/src/helpers/AGENTS.md new file mode 100644 index 0000000..4960a02 --- /dev/null +++ b/src/helpers/AGENTS.md @@ -0,0 +1,292 @@ +# Helpers — AI Agent 实现指南 + +> 本文件面向 AI Agent。当你需要**创建、修改或维护** helper 时,阅读此文件即可完成任务。 +> **无需阅读** `main.rs`、`service/` 或其他无关文件。 + +--- + +## 关键文件速查 + +你只需要关注以下文件: + +| 文件 | 作用 | 何时需要 | +|------|------|---------| +| `src/helpers/registry.rs` | `Helper` trait 定义 + `HelperRegistry::new()` 注册表 | 新建 helper 时添加注册 | +| `src/helpers/mod.rs` | category 模块声明 | 新建 category 时添加 `mod` | +| `src/helpers//mod.rs` | 该 category 下的 helper 模块声明 | 新建 helper 时添加 `pub mod` | +| `src/helpers//.rs` | helper 实现 | 新建或修改 helper | +| `src/json_rpc.rs` | `call_tool(category, method, args)` — 调用远程 MCP 工具 | helper 需要远程调用时参考 | +| `src/fs_util/` | 文件系统工具(`atomic_write`, `sanitize_filename`) | helper 需要安全写文件或处理文件名时使用 | + +**不要修改**:`main.rs`、`service/handler.rs`、`service/command.rs` — helper 通过 registry 自动注册到 CLI,无需改动调度层。 + +--- + +## 现有 Helpers + +> **维护要求**:新增或删除 helper 后,请同步更新此表。 + +| command | category | struct | 文件 | 说明 | +|---------|----------|--------|------|------| +| `+smartsheet_add_records_auto_file` | `doc` | `SmartsheetAddRecordsAutoFileHelper` | `doc/smartsheet_add_records_auto_file.rs` | 添加智能表格记录(自动上传文件/图片) | +| `+smartsheet_update_records_auto_file` | `doc` | `SmartsheetUpdateRecordsAutoFileHelper` | `doc/smartsheet_update_records_auto_file.rs` | 更新智能表格记录(自动上传文件/图片) | +| `+smartpage_create` | `doc` | `SmartpageCreateHelper` | `doc/smartpage_create.rs` | 创建智能文档(自动读取本地文件内容作为子页面) | + +--- + +## 什么是 Helper + +Helper 是一个**本地子命令**,挂载在某个 service category(如 `doc`、`msg`)下,用于实现无法由远程 MCP 工具完成的**客户端侧逻辑**(文件处理、多步编排等)。 + +CLI 调用形式:`wecom + [args]` + +Helper 名称以 `+` 前缀与远程 method 区分。 + +--- + +## 架构概览 + +``` +src/helpers/ +├── mod.rs # 模块声明 + pub use HelperRegistry +├── registry.rs # Helper trait 定义 + HelperRegistry(注册表) +├── AGENTS.md # ← 你正在读的文件 +├── HUMANS.md # 人类需求模板(你无需阅读) +└── / # 按 category 分目录 + ├── mod.rs # pub mod 声明 + └── .rs # 具体 helper 实现 +``` + +### Helper trait + +```rust +// src/helpers/registry.rs +pub trait Helper: Send + Sync { + /// 所属 category(必须匹配 service::categories 中的 name) + fn category(&self) -> &'static str; + + /// clap::Command 定义(名称必须以 + 开头) + fn command(&self) -> clap::Command; + + /// 异步执行逻辑 + fn execute<'a>( + &'a self, + matches: &'a ArgMatches, + ) -> Pin> + Send + 'a>>; +} +``` + +### 调度流程 + +1. `main.rs` 构建 CLI,将 helper command 注册为 category 的子命令 +2. 用户输入匹配到 ` +` 时,`handle_service_cmd` 优先查找 helper +3. 找到 helper → 调用 `helper.execute(matches)`;未找到 → 按远程 JSON-RPC 调用处理 + +--- + +## 添加新 Helper — 逐步操作 + +### 命名规范 + +| 项目 | 规范 | 示例 | +|------|------|------| +| 文件名 | `_<功能描述>.rs`(snake_case) | `doc_upload_image.rs` | +| command 名 | `+_<功能描述>` | `+doc_upload_image` | +| Args struct | `Args`(PascalCase) | `DocUploadImageArgs` | +| Helper struct | `Helper`(PascalCase) | `DocUploadImageHelper` | + +### 1. 创建文件 + +在 `src/helpers//` 下新建 `.rs`。如果该 category 目录不存在,同时创建目录和 `mod.rs`。 + +### 2. 实现 Helper trait + +```rust +// src/helpers//.rs +use std::future::Future; +use std::pin::Pin; + +use anyhow::Result; +use clap::{ArgMatches, Args, Command, FromArgMatches}; + +use crate::helpers::registry::Helper; + +/// 参数定义(clap derive) +#[derive(Args, Debug)] +pub struct MyArgs { + /// 参数说明 + #[arg(long)] + pub some_param: String, + + /// 可选参数 + #[arg(long)] + pub optional_param: Option, +} + +pub struct MyHelper; + +impl Helper for MyHelper { + fn category(&self) -> &'static str { + "" // 如 "doc", "msg", "schedule" 等 + } + + fn command(&self) -> clap::Command { + MyArgs::augment_args(Command::new("+")) + } + + /// 在此简要描述 helper 的逻辑 + fn execute<'a>( + &'a self, + matches: &'a ArgMatches, + ) -> Pin> + Send + 'a>> { + Box::pin(async { + let args = MyArgs::from_arg_matches(matches)?; + // 实现逻辑,请注意提供对应注释... + Ok(()) + }) + } +} +``` + +### 3. 注册 + +**a)** 在 `src/helpers//mod.rs` 中声明模块: + +```rust +pub mod ; +``` + +**b)** 在 `src/helpers/mod.rs` 中声明 category 模块(如果是新 category): + +```rust +mod ; +``` + +**c)** 在 `src/helpers/registry.rs` 的 `HelperRegistry::new()` 中添加: + +- 顶部添加 use:`use crate::helpers::::::;` +- `vec![]` 中添加:`Box::new()` + +### 4. 更新本文档 + +在上方「现有 Helpers」表中添加新行。 + +完成。无需修改 `main.rs` 或 `service/` 下的任何文件。 + +--- + +## 修改现有 Helper + +1. 在「现有 Helpers」表中找到目标 helper 的文件路径 +2. 直接修改对应的 `.rs` 文件 +3. 如果修改了 command 名称或 category,需同步更新 `registry.rs` 中的 use 和注册,以及本文档的「现有 Helpers」表 +4. 如果删除 helper,需从 `registry.rs`、`/mod.rs` 中移除相关声明,并更新本文档 + +--- + +## 查询远程工具的参数格式 + +当你需要了解某个远程 MCP 工具的参数 schema 时,可以执行: + +```bash +wecom --schema +``` + +这会输出该工具的完整定义(包含 `name`、`description`、`inputSchema`),例如: + +```bash +wecom doc upload_doc_image --schema +``` + +在 helper 实现中,你可以根据 schema 构造正确的 `json_rpc::call_tool` 调用参数。 + +--- + +## 理解人类的接口描述 + +人类会用 `.` 简写来说明需要调用的远程接口,并用大括号描述其**请求/响应结构**。例如: + +``` +调用 example.example_upload { + "content": "base64", // 要上传的文件 base64 +} { + "url": "URL", + "height": 234, + "width": 234, + "size": 81259, +} +``` + +你需要自行理解接口的参数和返回结构,并将其转化成对应的 JSON-RPC 调用: + +```rust +let res = json_rpc::call_tool( + "example", + "example_upload", + json!({ + "content": base64_of_image_file, + }), +).await?; +``` + +如果人类没有提供接口描述,你可以用 `wecom --schema` 自行查询。 + +--- + +## 调用远程 MCP 工具 — `json_rpc` 使用 + +Helper 内部经常需要调用远程 MCP 工具。使用 `crate::json_rpc`: + +```rust +use crate::json_rpc; +use serde_json::json; + +// 标准调用(30s 超时) +let res = json_rpc::call_tool( + "doc", // category + "get_doc_content", // method name + json!({ + "docid": "xxx" + }), +).await?; + +// 结果在 res["result"] 中 +let data = &res["result"]; +``` + +### 错误处理 + +- JSON-RPC error code ≠ 0 → `JsonRpcError::Api(Value)` +- 其他错误 → `anyhow::Error` + +Notes: + +- 所有错误均可用 `?` 传播 +- 所有错误信息均使用**中文**描述 + +--- + +## 可用 categories + +| category | 说明 | +|---|---| +| `contact` | 通讯录 — 成员查询和搜索 | +| `doc` | 文档 — 文档/智能表格创建和管理 | +| `meeting` | 会议 — 创建/管理/查询视频会议 | +| `msg` | 消息 — 聊天列表、发送/接收消息、媒体下载 | +| `schedule` | 日程 — 日程增删改查和可用性查询 | +| `todo` | 待办事项 — 创建/查询/编辑待办项 | + +--- + +## 新建 Helper Checklist + +- [ ] helper 文件位于 `src/helpers//.rs` +- [ ] 实现 `Helper` trait,command 名称以 `+` 开头 +- [ ] `category()` 返回值匹配上方「可用 categories」表 +- [ ] 在 `/mod.rs` 中 `pub mod ` +- [ ] 在 `helpers/mod.rs` 中 `mod `(如果是新 category) +- [ ] 在 `registry.rs` 顶部添加 `use` 并在 `HelperRegistry::new()` 的 vec 中添加 `Box::new(...)` +- [ ] 使用 `json_rpc::call_tool` 调用远程工具(如需要) +- [ ] 错误使用 `anyhow::Result` + `?` 传播,错误信息使用中文 +- [ ] 更新本文档「现有 Helpers」表 diff --git a/src/helpers/HUMANS.md b/src/helpers/HUMANS.md new file mode 100644 index 0000000..2059e5a --- /dev/null +++ b/src/helpers/HUMANS.md @@ -0,0 +1,17 @@ +# Helpers — 人类需求模板 + +当你需要创建新 helper 时,请向模型提供以下信息: + +**命令格式** + +```bash +wecom + +``` + +**行为描述** + +e.g. + +1. 调用 category.method { ...req_example } { ...res_example } +2. 随后调用 category.method2 { ...req_example } +3. 返回步骤 2 的结果 diff --git a/src/helpers/doc/auto_file_upload.rs b/src/helpers/doc/auto_file_upload.rs new file mode 100644 index 0000000..3646887 --- /dev/null +++ b/src/helpers/doc/auto_file_upload.rs @@ -0,0 +1,317 @@ +use std::collections::{HashMap, HashSet}; +use std::path::Path; + +use anyhow::{Context, Result}; +use base64::Engine as _; +use serde_json::{Value, json}; + +use crate::json_rpc; + +#[derive(Debug, Clone)] +pub enum DocIdentifier { + DocId(String), + Url(String), +} + +/// 从参数中提取文档标识(`docid` 或 `url`)。 +pub fn extract_doc_identifier(params: &Value) -> Result { + if let Some(docid) = params.get("docid").and_then(|v| v.as_str()) { + if !docid.is_empty() { + return Ok(DocIdentifier::DocId(docid.to_string())); + } + } + if let Some(url) = params.get("url").and_then(|v| v.as_str()) { + if !url.is_empty() { + return Ok(DocIdentifier::Url(url.to_string())); + } + } + anyhow::bail!("参数中缺少 docid 或 url(文档访问链接),上传图片时需要文档标识信息") +} + +/// 扫描 records 并自动上传本地文件/图片,将路径替换为上传结果。 +pub async fn process_records(records: &mut [Value], doc_id: &DocIdentifier) -> Result<()> { + // 收集需要上传的本地路径 + let mut image_paths: HashSet = HashSet::new(); + let mut file_paths: HashSet = HashSet::new(); + + for record in records.iter() { + if let Some(values) = record.get("values").and_then(|v| v.as_object()) { + for (_field, cell) in values { + collect_upload_paths(cell, &mut image_paths, &mut file_paths); + } + } + } + + // 上传图片 + let image_map = if !image_paths.is_empty() { + upload_images(&image_paths.into_iter().collect::>(), doc_id).await? + } else { + HashMap::new() + }; + + // 上传文件 + let file_map = if !file_paths.is_empty() { + upload_files(&file_paths.into_iter().collect::>()).await? + } else { + HashMap::new() + }; + + // 用上传结果替换本地路径 + for record in records.iter_mut() { + if let Some(values) = record.get_mut("values").and_then(|v| v.as_object_mut()) { + for (_field, cell) in values.iter_mut() { + replace_upload_results(cell, &image_map, &file_map); + } + } + } + + Ok(()) +} + +/// 获取 JSON 对象中指定字段的字符串值 +fn get_str<'a>(item: &'a Value, key: &str) -> Option<&'a str> { + item.get(key).and_then(|v| v.as_str()) +} + +/// 收集 cell 中需要上传的本地路径 +fn collect_upload_paths( + cell: &Value, + image_paths: &mut HashSet, + file_paths: &mut HashSet, +) { + if let Value::Array(arr) = cell { + for item in arr { + if let Some(p) = get_str(item, "image_path") { + image_paths.insert(p.to_string()); + } + if let Some(p) = get_str(item, "file_path") { + file_paths.insert(p.to_string()); + } + } + } +} + +/// 用上传结果替换 cell 中的本地路径 +fn replace_upload_results( + cell: &mut Value, + image_map: &HashMap, + file_map: &HashMap, +) { + if let Value::Array(arr) = cell { + for item in arr.iter_mut() { + // 图片:用上传结果替换 image_path + if let Some(p) = get_str(item, "image_path").map(String::from) { + if let Some(result) = image_map.get(&p) { + if let Some(obj) = item.as_object_mut() { + obj.remove("image_path"); + obj.insert("image_url".to_string(), Value::String(result.url.clone())); + if let Some(title) = &result.title { + obj.insert("title".to_string(), Value::String(title.clone())); + } + } + } + } + + // 附件:用上传结果替换 file_path + if let Some(p) = get_str(item, "file_path").map(String::from) { + if let Some(result) = file_map.get(&p) { + if let Some(obj) = item.as_object_mut() { + obj.remove("file_path"); + obj.insert("file_id".to_string(), Value::String(result.fileid.clone())); + } + } + } + } + } +} + +#[derive(Debug, Clone)] +struct ImageUploadResult { + url: String, + title: Option, +} + +#[derive(Debug, Clone)] +struct FileUploadResult { + fileid: String, +} + +/// 图片最大 30 MB +const MAX_IMAGE_SIZE: u64 = 30 * 1024 * 1024; +/// 文件最大 10 MB +const MAX_FILE_SIZE: u64 = 10 * 1024 * 1024; + +/// 读取本地文件并编码为 base64,超过 `max_size` 时报错。 +async fn read_file_as_base64(path: &str, max_size: u64) -> Result { + let data = tokio::fs::read(path) + .await + .with_context(|| format!("读取文件失败: {}", path))?; + let size = data.len() as u64; + if size > max_size { + anyhow::bail!( + "文件 {} 大小为 {:.1} MB,超过限制 {:.1} MB", + path, + size as f64 / 1024.0 / 1024.0, + max_size as f64 / 1024.0 / 1024.0, + ); + } + Ok(base64::engine::general_purpose::STANDARD.encode(&data)) +} + +/// 批量上传图片,返回 path → ImageUploadResult 映射。 +async fn upload_images( + paths: &[String], + doc_id: &DocIdentifier, +) -> Result> { + eprintln!("正在上传 {} 张图片...", paths.len()); + + let mut map = HashMap::new(); + + for path in paths { + let base64_content = read_file_as_base64(path, MAX_IMAGE_SIZE).await?; + + // 构造请求参数 + let mut args = json!({ "base64_content": base64_content }); + match doc_id { + DocIdentifier::DocId(id) => { + args["docid"] = Value::String(id.clone()); + } + DocIdentifier::Url(url) => { + args["url"] = Value::String(url.clone()); + } + } + + let res = json_rpc::call_json_tool("doc", "upload_doc_image", args) + .await + .with_context(|| format!("上传图片失败: {}", path))?; + + let url = res + .get("url") + .and_then(|v| v.as_str()) + .unwrap_or_default() + .to_string(); + + if url.is_empty() { + anyhow::bail!("图片 {} 上传失败:返回结果中缺少 url", path); + } + + // 文件名作为 title + let title = Path::new(path) + .file_name() + .and_then(|n| n.to_str()) + .map(String::from); + + map.insert(path.clone(), ImageUploadResult { url, title }); + } + + eprintln!("图片上传完成,成功 {} 张", map.len()); + Ok(map) +} + +/// 批量上传文件,返回 path → FileUploadResult 映射。 +async fn upload_files(paths: &[String]) -> Result> { + eprintln!("正在上传 {} 个文件...", paths.len()); + + let mut map = HashMap::new(); + + for path in paths { + let file_base64_content = read_file_as_base64(path, MAX_FILE_SIZE).await?; + + // 提取文件名 + let file_name = Path::new(path) + .file_name() + .and_then(|n| n.to_str()) + .unwrap_or("unknown") + .to_string(); + + let args = json!({ + "file_name": file_name, + "file_base64_content": file_base64_content, + }); + + let res = json_rpc::call_json_tool("doc", "upload_doc_file", args) + .await + .with_context(|| format!("上传文件失败: {}", path))?; + + let fileid = res + .get("fileid") + .and_then(|v| v.as_str()) + .unwrap_or_default() + .to_string(); + + if fileid.is_empty() { + anyhow::bail!("文件 {} 上传失败:返回结果中缺少 fileid", path); + } + + map.insert(path.clone(), FileUploadResult { fileid }); + } + + eprintln!("文件上传完成,成功 {} 个", map.len()); + Ok(map) +} + +/// 获取远程工具 schema,并新增 `image_path` / `file_path` 字段。 +pub async fn get_modified_schema(remote_method: &str) -> Result { + let tools = crate::registry::get_category_tools("doc").await?; + let tool = tools + .iter() + .find(|t| t.name == remote_method) + .ok_or_else(|| anyhow::anyhow!("远程工具不存在: {}", remote_method))?; + + let mut schema = serde_json::to_value(tool)?; + + replace_image_value_schema(&mut schema); + replace_attachment_value_schema(&mut schema); + + Ok(schema) +} + +/// 替换 schema 中的 CellImageValue 定义,只保留 image_path 字段。 +fn replace_image_value_schema(schema: &mut Value) { + if let Some(defs) = schema + .pointer_mut("/inputSchema/$defs") + .and_then(|d| d.as_object_mut()) + { + defs.insert( + "CellImageValue".to_string(), + json!({ + "description": "图片类型字段的单元值。只需传入本地图片路径,系统自动上传。", + "properties": { + "image_path": { + "description": "本地图片文件路径。传入本地图片路径(如 /path/to/image.png 或 ./photo.jpg),系统会自动上传到文档服务器。", + "title": "Image Path", + "type": "string" + } + }, + "required": ["image_path"], + "title": "CellImageValue", + "type": "object" + }), + ); + } +} + +/// 替换 schema 中的 CellAttachmentValue 定义,只保留 file_path 字段。 +fn replace_attachment_value_schema(schema: &mut Value) { + if let Some(defs) = schema + .pointer_mut("/inputSchema/$defs") + .and_then(|d| d.as_object_mut()) + { + defs.insert( + "CellAttachmentValue".to_string(), + json!({ + "description": "附件类型字段的单元值。只需传入本地文件路径,系统自动上传。", + "properties": { + "file_path": { + "description": "传入本地文件路径,系统会自动上传到文档服务器。", + "title": "File Path", + "type": "string" + } + }, + "required": ["file_path"], + "title": "CellAttachmentValue", + "type": "object" + }), + ); + } +} diff --git a/src/helpers/doc/mod.rs b/src/helpers/doc/mod.rs new file mode 100644 index 0000000..42dda04 --- /dev/null +++ b/src/helpers/doc/mod.rs @@ -0,0 +1,4 @@ +mod auto_file_upload; +pub mod smartpage_create; +pub mod smartsheet_add_records_auto_file; +pub mod smartsheet_update_records_auto_file; diff --git a/src/helpers/doc/smartpage_create.rs b/src/helpers/doc/smartpage_create.rs new file mode 100644 index 0000000..d3b6f09 --- /dev/null +++ b/src/helpers/doc/smartpage_create.rs @@ -0,0 +1,134 @@ +use std::future::Future; +use std::pin::Pin; + +use crate::{helpers::registry::Helper, json_rpc}; +use anyhow::{Context, Result}; +use clap::{ArgMatches, Args, Command, FromArgMatches}; +use serde_json::{Value, json}; + +/// 创建智能文档(自动读取本地文件版本) +/// +/// 与远程 smartpage_create 相同,但 pages 中的 page_content 改为 page_filepath, +/// 执行时自动以 UTF-8 编码读取本地文件内容,填入 page_content 字段后调用后台接口。 +#[derive(Args, Debug)] +pub struct SmartpageCreateArgs { + /// JSON 格式的参数(与远程 smartpage_create 相同,但 page_content 改为 page_filepath) + #[arg(hide = true, value_name = "args")] + pub args: Option, + + /// JSON 格式的参数 + #[arg(long)] + pub json: Option, + + /// 输出该命令的参数 schema + #[arg(long, action = clap::ArgAction::SetTrue)] + pub schema: bool, +} + +pub struct SmartpageCreateHelper; + +impl SmartpageCreateHelper { + /// 获取修改后的 schema:将 pages.items.properties 中的 page_content 替换为 page_filepath + async fn get_modified_schema() -> Result { + let tools = crate::registry::get_category_tools("doc").await?; + let tool = tools + .iter() + .find(|t| t.name == "smartpage_create") + .ok_or_else(|| anyhow::anyhow!("远程工具不存在: smartpage_create"))?; + + let mut schema = serde_json::to_value(tool)?; + + // 修改 schema:将 pages.items.properties 中的 page_content 替换为 page_filepath + if let Some(props) = schema + .pointer_mut("/inputSchema/properties/pages/items/properties") + .and_then(|v| v.as_object_mut()) + { + props.remove("page_content"); + props.insert( + "page_filepath".to_string(), + json!({ + "description": "本地文件路径,以 UTF-8 编码读取文件内容作为子页面内容", + "type": "string" + }), + ); + } + + Ok(schema) + } + + /// 处理 pages 数组:将 page_filepath 替换为 page_content(读取本地文件内容) + async fn process_pages(pages: &mut [Value]) -> Result<()> { + for (i, page) in pages.iter_mut().enumerate() { + let obj = page + .as_object_mut() + .ok_or_else(|| anyhow::anyhow!("pages[{}] 不是一个对象", i))?; + + // 如果存在 page_filepath,读取文件内容并替换为 page_content + if let Some(filepath_val) = obj.remove("page_filepath") { + let filepath = filepath_val + .as_str() + .ok_or_else(|| anyhow::anyhow!("pages[{}].page_filepath 必须是字符串", i))?; + + let content = tokio::fs::read_to_string(filepath) + .await + .with_context(|| format!("读取文件失败: {}", filepath))?; + + obj.insert("page_content".to_string(), Value::String(content)); + } + } + + Ok(()) + } +} + +impl Helper for SmartpageCreateHelper { + fn category(&self) -> &'static str { + "doc" + } + + fn command(&self) -> clap::Command { + SmartpageCreateArgs::augment_args( + Command::new("+smartpage_create") + .about("创建智能主页,支持通过 page_filepath 自动读取本地文件内容作为子页面内容"), + ) + } + + fn execute<'a>( + &'a self, + matches: &'a ArgMatches, + ) -> Pin> + Send + 'a>> { + Box::pin(async { + let args = SmartpageCreateArgs::from_arg_matches(matches)?; + + // 输出修改后的 schema + if args.schema { + let schema = Self::get_modified_schema().await?; + println!("{}", serde_json::to_string_pretty(&schema)?); + return Ok(()); + } + + // 解析 JSON 参数 + let raw = args + .json + .as_deref() + .or(args.args.as_deref()) + .ok_or_else(|| anyhow::anyhow!("请提供 JSON 格式的参数"))?; + let mut params: Value = serde_json::from_str(raw).context("JSON 参数解析失败")?; + + // 提取并处理 pages 数组 + let pages = params + .get_mut("pages") + .and_then(|v| v.as_array_mut()) + .ok_or_else(|| anyhow::anyhow!("参数中缺少 pages 数组"))?; + + // 读取本地文件,将 page_filepath 替换为 page_content + Self::process_pages(pages).await?; + + // 调用后台接口 smartpage_create + let res = json_rpc::call_tool("doc", "smartpage_create", params).await?; + println!("{res}"); + + Ok(()) + }) + } +} diff --git a/src/helpers/doc/smartsheet_add_records_auto_file.rs b/src/helpers/doc/smartsheet_add_records_auto_file.rs new file mode 100644 index 0000000..08cfadc --- /dev/null +++ b/src/helpers/doc/smartsheet_add_records_auto_file.rs @@ -0,0 +1,80 @@ +use std::future::Future; +use std::pin::Pin; + +use crate::{helpers::registry::Helper, json_rpc}; +use anyhow::{Context, Result}; +use clap::{ArgMatches, Args, Command, FromArgMatches}; + +use super::auto_file_upload; + +/// 添加智能表格记录,支持通过 image_path/file_path 自动上传本地文件 +#[derive(Args, Debug)] +pub struct SmartsheetAddRecordsAutoFileArgs { + /// JSON 格式的参数(与 smartsheet_add_records 相同,但图片/附件字段可传本地文件路径) + #[arg(hide = true, value_name = "args")] + pub args: Option, + + /// JSON 格式的参数 + #[arg(long)] + pub json: Option, + + /// 输出该命令的参数 schema + #[arg(long, action = clap::ArgAction::SetTrue)] + pub schema: bool, +} + +pub struct SmartsheetAddRecordsAutoFileHelper; + +impl Helper for SmartsheetAddRecordsAutoFileHelper { + fn category(&self) -> &'static str { + "doc" + } + + fn command(&self) -> clap::Command { + SmartsheetAddRecordsAutoFileArgs::augment_args(Command::new( + "+smartsheet_add_records_auto_file", + )) + } + + fn execute<'a>( + &'a self, + matches: &'a ArgMatches, + ) -> Pin> + Send + 'a>> { + Box::pin(async { + let args = SmartsheetAddRecordsAutoFileArgs::from_arg_matches(matches)?; + + if args.schema { + let schema = + auto_file_upload::get_modified_schema("smartsheet_add_records").await?; + println!("{}", serde_json::to_string_pretty(&schema)?); + return Ok(()); + } + + let raw = args + .json + .as_deref() + .or(args.args.as_deref()) + .ok_or_else(|| anyhow::anyhow!("请提供 JSON 格式的参数"))?; + let mut params: serde_json::Value = + serde_json::from_str(raw).context("JSON 参数解析失败")?; + + // 提取文档标识(docid 或 url),用于图片上传 + let doc_id = auto_file_upload::extract_doc_identifier(¶ms)?; + + // 提取并处理 records + let records = params + .get_mut("records") + .and_then(|v| v.as_array_mut()) + .ok_or_else(|| anyhow::anyhow!("参数中缺少 records 数组"))?; + + // 扫描并上传本地文件/图片,替换路径 + auto_file_upload::process_records(records, &doc_id).await?; + + // 调用后台接口 smartsheet_add_records + let res = json_rpc::call_tool("doc", "smartsheet_add_records", params).await?; + println!("{res}"); + + Ok(()) + }) + } +} diff --git a/src/helpers/doc/smartsheet_update_records_auto_file.rs b/src/helpers/doc/smartsheet_update_records_auto_file.rs new file mode 100644 index 0000000..40821f2 --- /dev/null +++ b/src/helpers/doc/smartsheet_update_records_auto_file.rs @@ -0,0 +1,80 @@ +use std::future::Future; +use std::pin::Pin; + +use crate::{helpers::registry::Helper, json_rpc}; +use anyhow::{Context, Result}; +use clap::{ArgMatches, Args, Command, FromArgMatches}; + +use super::auto_file_upload; + +/// 更新智能表格记录,支持通过 image_path/file_path 自动上传本地文件 +#[derive(Args, Debug)] +pub struct SmartsheetUpdateRecordsAutoFileArgs { + /// JSON 格式的参数(与 smartsheet_update_records 相同,但图片/附件字段可传本地文件路径) + #[arg(hide = true, value_name = "args")] + pub args: Option, + + /// JSON 格式的参数 + #[arg(long)] + pub json: Option, + + /// 输出该命令的参数 schema + #[arg(long, action = clap::ArgAction::SetTrue)] + pub schema: bool, +} + +pub struct SmartsheetUpdateRecordsAutoFileHelper; + +impl Helper for SmartsheetUpdateRecordsAutoFileHelper { + fn category(&self) -> &'static str { + "doc" + } + + fn command(&self) -> clap::Command { + SmartsheetUpdateRecordsAutoFileArgs::augment_args(Command::new( + "+smartsheet_update_records_auto_file", + )) + } + + fn execute<'a>( + &'a self, + matches: &'a ArgMatches, + ) -> Pin> + Send + 'a>> { + Box::pin(async { + let args = SmartsheetUpdateRecordsAutoFileArgs::from_arg_matches(matches)?; + + if args.schema { + let schema = + auto_file_upload::get_modified_schema("smartsheet_update_records").await?; + println!("{}", serde_json::to_string_pretty(&schema)?); + return Ok(()); + } + + let raw = args + .json + .as_deref() + .or(args.args.as_deref()) + .ok_or_else(|| anyhow::anyhow!("请提供 JSON 格式的参数"))?; + let mut params: serde_json::Value = + serde_json::from_str(raw).context("JSON 参数解析失败")?; + + // 提取文档标识(docid 或 url),用于图片上传 + let doc_id = auto_file_upload::extract_doc_identifier(¶ms)?; + + // 提取并处理 records + let records = params + .get_mut("records") + .and_then(|v| v.as_array_mut()) + .ok_or_else(|| anyhow::anyhow!("参数中缺少 records 数组"))?; + + // 扫描并上传本地文件/图片,替换路径 + auto_file_upload::process_records(records, &doc_id).await?; + + // 调用后台接口 smartsheet_update_records + let res = json_rpc::call_tool("doc", "smartsheet_update_records", params).await?; + println!("{res}"); + + Ok(()) + }) + } +} diff --git a/src/helpers/mod.rs b/src/helpers/mod.rs new file mode 100644 index 0000000..2776342 --- /dev/null +++ b/src/helpers/mod.rs @@ -0,0 +1,4 @@ +mod doc; +pub mod registry; + +pub use registry::HelperRegistry; diff --git a/src/helpers/registry.rs b/src/helpers/registry.rs new file mode 100644 index 0000000..c900c61 --- /dev/null +++ b/src/helpers/registry.rs @@ -0,0 +1,52 @@ +use std::future::Future; +use std::pin::Pin; + +use anyhow::Result; +use clap::ArgMatches; + +use crate::helpers::doc::smartpage_create::SmartpageCreateHelper; +use crate::helpers::doc::smartsheet_add_records_auto_file::SmartsheetAddRecordsAutoFileHelper; +use crate::helpers::doc::smartsheet_update_records_auto_file::SmartsheetUpdateRecordsAutoFileHelper; + +/// Helper trait:每个 helper 需要实现此 trait。 +/// `execute` 返回 boxed future 以保证 dyn 兼容(object safety)。 +pub trait Helper: Send + Sync { + fn category(&self) -> &'static str; + + fn command(&self) -> clap::Command; + + fn execute<'a>( + &'a self, + matches: &'a ArgMatches, + ) -> Pin> + Send + 'a>>; +} + +pub struct HelperRegistry { + helpers: Vec>, +} + +impl HelperRegistry { + pub fn new() -> Self { + let helpers: Vec> = vec![ + Box::new(SmartpageCreateHelper), + Box::new(SmartsheetAddRecordsAutoFileHelper), + Box::new(SmartsheetUpdateRecordsAutoFileHelper), + ]; + Self { helpers } + } + + pub fn get(&self, category: &str, name: &str) -> Option<&dyn Helper> { + self.helpers + .iter() + .find(|h| h.category() == category && h.command().get_name() == name) + .map(|h| &**h) + } + + pub fn list_in_category(&self, category: &str) -> Vec<&dyn Helper> { + self.helpers + .iter() + .filter(|h| h.category() == category) + .map(|h| &**h) + .collect() + } +} diff --git a/src/json_rpc.rs b/src/json_rpc.rs new file mode 100644 index 0000000..94e2eb0 --- /dev/null +++ b/src/json_rpc.rs @@ -0,0 +1,168 @@ +use anyhow::Result; +use serde::Serialize; + +use crate::{constants, mcp}; + +#[derive(Debug)] +pub enum JsonRpcError { + /// 通用 RPC 失败(无 result、isError=true 等) + RpcError(serde_json::Value), + /// JSON-RPC 协议层错误(error.code ≠ 0) + ApiError { + code: i64, + payload: serde_json::Value, + }, + /// 业务逻辑错误(errcode ≠ 0) + BusinessError { + errcode: i64, + payload: serde_json::Value, + }, + /// 响应格式不符合预期 + MalformedResponse(serde_json::Value), +} + +impl std::fmt::Display for JsonRpcError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + JsonRpcError::RpcError(res) => write!(f, "请求失败:{res}"), + JsonRpcError::ApiError { code, payload } => { + write!(f, "接口错误 (code={code}):{payload}") + } + JsonRpcError::BusinessError { errcode, payload } => { + write!(f, "业务错误 (errcode={errcode}):{payload}") + } + JsonRpcError::MalformedResponse(raw) => { + write!(f, "响应格式异常:{raw}") + } + } + } +} + +impl std::error::Error for JsonRpcError {} + +#[derive(Debug, Clone, Serialize)] +struct JsonRpcRequest { + jsonrpc: &'static str, + id: String, + method: String, + params: Option, +} + +pub async fn call_json_tool( + category: &str, + method: &str, + args: serde_json::Value, +) -> Result { + let res = call_tool(category, method, args).await?; + + let malformed = || -> anyhow::Error { JsonRpcError::MalformedResponse(res.clone()).into() }; + + let content = res + .pointer("/result/content") + .and_then(|c| c.as_array()) + .filter(|arr| arr.len() == 1) + .ok_or_else(malformed)?; + + let item = &content[0]; + if item.get("type").and_then(|t| t.as_str()) != Some("text") { + return Err(malformed()); + } + let text = item + .get("text") + .and_then(|t| t.as_str()) + .ok_or_else(malformed)?; + + let parsed: serde_json::Value = serde_json::from_str(text).map_err(|_| malformed())?; + + // 3. errcode 必须为 0 或不存在 + if let Some(errcode) = parsed.get("errcode").and_then(|c| c.as_i64()) { + if errcode != 0 { + return Err(JsonRpcError::BusinessError { + errcode, + payload: parsed, + } + .into()); + } + } + + Ok(parsed) +} + +pub async fn call_tool( + category: &str, + method: &str, + args: serde_json::Value, +) -> Result { + let timeout_ms = if method == "get_msg_media" { + Some(120000) + } else { + None + }; + let params = serde_json::json!({ + "name": method, + "arguments": args, + }); + let response = send(category, "tools/call", Some(params), timeout_ms).await?; + + let Some(result) = response.get("result") else { + return Err(JsonRpcError::MalformedResponse(response).into()); + }; + + if result.get("isError").and_then(|r| r.as_bool()) == Some(true) { + return Err(JsonRpcError::RpcError(response).into()); + } + + Ok(response) +} + +/// Send a JSON-RPC 2.0 request to the MCP endpoint for the given category and method. +pub async fn send( + category: &str, + method: &str, + params: Option, + timeout_ms: Option, +) -> Result { + let mcp_url = mcp::get_mcp_url(category).await?; + + let body = JsonRpcRequest { + jsonrpc: "2.0", + id: mcp::gen_req_id("mcp_rpc"), + method: method.to_string(), + params, + }; + + let timeout = std::time::Duration::from_millis(timeout_ms.unwrap_or(30000) as u64); + + let request = reqwest::Client::builder() + .build()? + .post(&mcp_url) + .timeout(timeout) + .header("Accept", "application/json") + .header("User-Agent", constants::get_user_agent()) + .json(&body); + + let response = request.send().await.map_err(|err| { + if err.is_timeout() { + anyhow::anyhow!("MCP请求超时 ({}ms)", timeout.as_millis()) + } else { + anyhow::anyhow!("MCP网络请求失败: {err}") + } + })?; + + let status = response.status(); + + if !status.is_success() { + anyhow::bail!("MCP请求失败 (HTTP {status})"); + } + + let body_text = response.text().await?; + let res = serde_json::from_str::(&body_text)?; + + if let Some(code) = res.pointer("/error/code").and_then(|c| c.as_i64()) { + if code != 0 { + return Err(JsonRpcError::ApiError { code, payload: res }.into()); + } + } + + Ok(res) +} diff --git a/src/logging.rs b/src/logging.rs new file mode 100644 index 0000000..6b92f7a --- /dev/null +++ b/src/logging.rs @@ -0,0 +1,61 @@ +use tracing_subscriber::prelude::*; + +use crate::constants::env; + +/// Initialize the tracing subscriber with optional stderr and file logging layers. +pub fn init_logging() { + let stderr_filter = std::env::var(env::LOG_LEVEL).ok(); + let log_file_dir = std::env::var(env::LOG_FILE).ok(); + + if stderr_filter.is_none() && log_file_dir.is_none() { + return; + } + + let registry = tracing_subscriber::registry(); + + // Stderr layer: human-readable + let stderr_layer = stderr_filter.map(|filter| { + let env_filter = tracing_subscriber::EnvFilter::new(filter); + tracing_subscriber::fmt::layer() + .with_writer(std::io::stderr) + .with_target(false) + .compact() + .with_filter(env_filter) + }); + + // File layer: JSON-line output with daily rotation + let (file_layer, guard) = if let Some(ref dir) = log_file_dir { + let file_appender = tracing_appender::rolling::daily(dir, "ww.log"); + let (non_blocking, guard) = tracing_appender::non_blocking(file_appender); + let layer = tracing_subscriber::fmt::layer() + .json() + .with_writer(non_blocking) + .with_target(true) + .with_filter(tracing_subscriber::EnvFilter::new("ww=debug")); + (Some(layer), Some(guard)) + } else { + (None, None) + }; + + // Compose layers and set as global subscriber. + // The guard is leaked intentionally so the non-blocking writer stays + // alive for the lifetime of the process. + let subscriber = registry.with(stderr_layer).with(file_layer); + if tracing::subscriber::set_global_default(subscriber).is_ok() { + // Leak the guard so the non-blocking writer lives for the process lifetime. + // This is the recommended pattern from tracing-appender docs. + std::mem::forget(guard); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_init_logging_default_no_panic() { + unsafe { std::env::remove_var(env::LOG_LEVEL) }; + unsafe { std::env::remove_var(env::LOG_FILE) }; + init_logging(); + } +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..a22214f --- /dev/null +++ b/src/main.rs @@ -0,0 +1,80 @@ +mod auth; +mod browser; +mod cmd; +mod constants; +mod crypto; +mod fs_util; +mod helpers; +mod json_rpc; +mod logging; +mod mcp; +mod media; +mod paths; +mod registry; +mod service; + +use anyhow::Result; +use clap::Command; + +/// Entry point: parse CLI arguments and dispatch to the corresponding subcommand handler. +#[tokio::main] +async fn main() -> Result<()> { + dotenvy::dotenv().ok(); + + logging::init_logging(); + + let helper_registry = helpers::HelperRegistry::new(); + + let subcmd_name = std::env::args() + .skip(1) + .find(|a| a == "-V" || a == "--version" || !a.starts_with("-")) + .unwrap_or_default(); + + if subcmd_name == "-V" || subcmd_name == "--version" { + println!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); + return Ok(()); + } + + let mut cmd = Command::new(env!("CARGO_BIN_NAME")) + .version(env!("CARGO_PKG_VERSION")) + .arg_required_else_help(true) + .disable_help_flag(true) + .disable_version_flag(true) + .disable_help_subcommand(true) + .arg( + clap::arg!(-h --help "查看帮助信息") + .action(clap::ArgAction::Help) + .global(true), + ) + .arg(clap::arg!(-V --version "查看版本号").action(clap::ArgAction::Version)) + .subcommand(cmd::init::build_init_cmd()) + .subcommand(cmd::auth::build_auth_cmd()); + + for category in service::categories::get_categories().iter() { + let tools = if category.name == subcmd_name { + let tools = registry::get_category_tools(category.name).await?; + Some(tools) + } else { + None + }; + cmd = cmd.subcommand(service::command::build_service_cmd( + &helper_registry, + category, + tools.as_ref(), + )); + } + + cmd = cmd.subcommand(cmd::cache::build_cache_cmd()); + + let matches = cmd.get_matches(); + + match matches.subcommand() { + Some(("init", matches)) => cmd::init::handle_init_cmd(matches).await, + Some(("auth", matches)) => cmd::auth::handle_auth_cmd(matches).await, + Some(("cache", matches)) => cmd::cache::handle_cache_cmd(matches).await, + Some((category, matches)) => { + service::handler::handle_service_cmd(&helper_registry, category, matches).await + } + _ => anyhow::bail!("未知命令"), + } +} diff --git a/src/mcp/config.rs b/src/mcp/config.rs new file mode 100644 index 0000000..8fd778f --- /dev/null +++ b/src/mcp/config.rs @@ -0,0 +1,383 @@ +use std::fs; +use std::time::{SystemTime, UNIX_EPOCH}; + +use anyhow::Result; +use serde::{Deserialize, Serialize}; +use serde_repr::Serialize_repr; +use sha2::{Digest, Sha256}; + +use crate::crypto; +use crate::{auth, fs_util}; +use crate::{constants, paths}; + +// --------------------------------------------------------------------------- +// Request +// --------------------------------------------------------------------------- + +/// 配置来源 +#[derive(Debug, Clone, Copy, Serialize_repr)] +#[repr(u8)] +pub enum McpBindSource { + /// Interactive + Interactive = 1, + /// QR Code + Qrcode = 2, +} + +#[derive(Debug, Clone, Serialize)] +pub struct GetMcpConfigRequest { + pub bot_id: String, + pub time: u64, + pub nonce: String, + pub signature: String, + pub bind_source: McpBindSource, + pub cli_version: String, +} + +impl GetMcpConfigRequest { + /// Build a signed request from stored bot credentials + pub fn build(bind_source: McpBindSource) -> Result { + let bot = auth::get_bot_info().ok_or_else(|| { + anyhow::anyhow!( + "未找到企业微信机器人信息,请先运行 `{} init`", + env!("CARGO_BIN_NAME") + ) + })?; + + let time = SystemTime::now() + .duration_since(UNIX_EPOCH) + .unwrap_or_default() + .as_secs(); + let nonce = super::gen_req_id("mcp"); + let signature = sign(&bot.secret, &bot.id, time, &nonce); + + let cli_version = constants::get_user_agent(); + + Ok(Self { + bot_id: bot.id, + time, + nonce, + signature, + bind_source, + cli_version, + }) + } +} + +// --------------------------------------------------------------------------- +// Response +// --------------------------------------------------------------------------- + +#[derive(Debug, Clone, Deserialize)] +pub struct GetMcpConfigResponse { + #[serde(default)] + pub errcode: i32, + pub errmsg: Option, + #[serde(default)] + pub list: Option>, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct McpConfigItem { + pub url: Option, + #[serde(rename = "type")] + pub transport_type: Option, + pub is_authed: Option, + pub biz_type: Option, +} + +use super::error::{FetchMcpConfigError, GetMcpConfigHttpError}; + +// --------------------------------------------------------------------------- +// Signature +// --------------------------------------------------------------------------- + +/// Compute the request signature. +/// +/// Algorithm: `sha256_hex(secret + bot_id + time + nonce)` +/// where `sha256_hex` uses the standard zero-padded lowercase hex format (`%02x`). +pub fn sign(secret: &str, bot_id: &str, time: u64, nonce: &str) -> String { + let input = format!("{secret}{bot_id}{time}{nonce}"); + sha256_hex(&input) +} + +/// Compute the SHA-256 hash of `input` and return it as a lowercase hex string. +fn sha256_hex(input: &str) -> String { + let hash = Sha256::digest(input.as_bytes()); + let mut result = String::with_capacity(64); + for byte in hash.iter() { + result.push_str(&format!("{:02x}", byte)); + } + result +} + +// --------------------------------------------------------------------------- +// Persistence +// --------------------------------------------------------------------------- + +/// Return the file path for the encrypted MCP config cache. +fn mcp_config_path() -> std::path::PathBuf { + paths::wecom_home_dir().join("mcp_config.enc") +} + +/// Read cached MCP config list from the encrypted file. +pub fn load_mcp_config() -> Option> { + let data = fs::read(mcp_config_path()).ok()?; + crypto::try_decrypt_data(&data).ok() +} + +/// Encrypt and persist the MCP config list to disk. +pub fn save_mcp_config(items: &[McpConfigItem]) -> Result<()> { + let key = crypto::load_existing_key().unwrap_or_else(|| { + let k = crypto::generate_random_key(); + tracing::info!("Generated new encryption key for MCP config"); + k + }); + + crypto::save_key(&key)?; + + let encrypted = crypto::encrypt_data(items, &key)?; + let path = mcp_config_path(); + fs_util::atomic_write(&path, &encrypted, Some(0o600))?; + + tracing::info!("MCP config saved to {}", path.display()); + Ok(()) +} + +/// Remove the cached MCP config file from disk. +pub fn clear_mcp_config() { + let path = mcp_config_path(); + if path.exists() { + let _ = fs::remove_file(&path); + tracing::info!("MCP config cache removed: {}", path.display()); + } +} + +#[cfg(test)] +/// Encrypt and write the config list to a specific path with a given key (test helper). +fn save_mcp_config_to_path( + items: &[McpConfigItem], + path: &std::path::Path, + key: &[u8; 32], +) -> Result<()> { + let encrypted = crypto::encrypt_data(items, key)?; + fs_util::atomic_write(path, &encrypted, Some(0o600)) +} + +#[cfg(test)] +/// Read and decrypt the config list from a specific path with a given key (test helper). +fn load_mcp_config_from_path(path: &std::path::Path, key: &[u8; 32]) -> Option> { + let data = fs::read(path).ok()?; + crypto::decrypt_data(&data, key).ok() +} + +// --------------------------------------------------------------------------- +// API Call +// --------------------------------------------------------------------------- + +/// Always fetch the MCP config from the server, bypassing local cache, and persist the result. +pub async fn fetch_mcp_config( + bind_source: McpBindSource, +) -> Result { + let request = GetMcpConfigRequest::build(bind_source)?; + + let response = reqwest::Client::builder() + .build() + .map_err(|e| FetchMcpConfigError::Other(e.into()))? + .post(constants::mcp_config_endpoint()) + .header("User-Agent", constants::get_user_agent()) + .json(&request) + .send() + .await + .map_err(|e| FetchMcpConfigError::Other(e.into()))?; + + let status = response.status(); + if !status.is_success() { + let mut body = response + .text() + .await + .unwrap_or_else(|_| "".to_string()); + if body.is_empty() { + body = "".to_string(); + } + return Err(FetchMcpConfigError::Http(GetMcpConfigHttpError { + status: status.as_u16(), + body, + })); + } + + let resp = response + .json::() + .await + .map_err(|e| FetchMcpConfigError::Other(e.into()))?; + + if resp.errcode != 0 { + return Err(FetchMcpConfigError::Api(resp)); + } + + let Some(list) = &(resp.list) else { + return Err(FetchMcpConfigError::Other(anyhow::anyhow!( + "" + ))); + }; + + save_mcp_config(list)?; + + Ok(resp) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::crypto; + + fn sample_items() -> Vec { + vec![ + McpConfigItem { + url: Some("https://example.com/mcp/contact".into()), + transport_type: Some("streamable-http".into()), + is_authed: Some(true), + biz_type: Some("contact".into()), + }, + McpConfigItem { + url: Some("https://example.com/mcp/msg".into()), + transport_type: Some("streamable-http".into()), + is_authed: Some(false), + biz_type: Some("msg".into()), + }, + ] + } + + // ----------------------------------------------------------------------- + // Signature tests + // ----------------------------------------------------------------------- + + #[test] + fn sha256_hex_matches_cpp_format() { + let result = sha256_hex("test"); + // {:02x} format: standard lowercase hex, two digits per byte, zero-padded + assert_eq!( + result, + "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" + ); + } + + #[test] + fn sign_produces_non_empty_signature() { + let sig = sign("my_secret", "bot_123", 1774772074, "abc123"); + assert!(!sig.is_empty()); + } + + #[test] + fn sign_is_deterministic() { + let a = sign("sec", "id", 100, "nonce"); + let b = sign("sec", "id", 100, "nonce"); + assert_eq!(a, b); + } + + #[test] + fn sign_changes_with_different_inputs() { + let a = sign("sec", "id", 100, "nonce1"); + let b = sign("sec", "id", 100, "nonce2"); + assert_ne!(a, b); + } + + // ----------------------------------------------------------------------- + // Persistence tests + // ----------------------------------------------------------------------- + + #[test] + fn save_and_load_roundtrip() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("mcp_config.enc"); + let key = crypto::generate_random_key(); + let items = sample_items(); + + save_mcp_config_to_path(&items, &path, &key).unwrap(); + + let loaded = load_mcp_config_from_path(&path, &key).unwrap(); + assert_eq!(loaded.len(), 2); + assert_eq!(loaded[0].biz_type.as_deref(), Some("contact")); + assert_eq!( + loaded[0].url.as_deref(), + Some("https://example.com/mcp/contact") + ); + assert_eq!(loaded[1].biz_type.as_deref(), Some("msg")); + assert_eq!(loaded[1].is_authed, Some(false)); + } + + #[test] + fn load_returns_none_when_file_missing() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("nonexistent.enc"); + let key = crypto::generate_random_key(); + + assert!(load_mcp_config_from_path(&path, &key).is_none()); + } + + #[test] + fn load_returns_none_with_wrong_key() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("mcp_config.enc"); + let key = crypto::generate_random_key(); + let wrong_key = crypto::generate_random_key(); + let items = sample_items(); + + save_mcp_config_to_path(&items, &path, &key).unwrap(); + + assert!(load_mcp_config_from_path(&path, &wrong_key).is_none()); + } + + #[test] + fn load_returns_none_with_corrupted_file() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("mcp_config.enc"); + let key = crypto::generate_random_key(); + + std::fs::write(&path, b"garbage data").unwrap(); + + assert!(load_mcp_config_from_path(&path, &key).is_none()); + } + + #[test] + fn save_overwrites_existing_file() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("mcp_config.enc"); + let key = crypto::generate_random_key(); + + let items_v1 = vec![McpConfigItem { + url: Some("https://v1.example.com".into()), + transport_type: Some("streamable-http".into()), + is_authed: Some(true), + biz_type: Some("v1".into()), + }]; + save_mcp_config_to_path(&items_v1, &path, &key).unwrap(); + + let items_v2 = sample_items(); + save_mcp_config_to_path(&items_v2, &path, &key).unwrap(); + + let loaded = load_mcp_config_from_path(&path, &key).unwrap(); + assert_eq!(loaded.len(), 2); + assert_eq!(loaded[0].biz_type.as_deref(), Some("contact")); + } + + #[test] + fn bind_source_serializes_as_number() { + let json = serde_json::to_string(&McpBindSource::Interactive).unwrap(); + assert_eq!(json, "1", "Expected number 1, got: {json}"); + let json = serde_json::to_string(&McpBindSource::Qrcode).unwrap(); + assert_eq!(json, "2", "Expected number 2, got: {json}"); + } + + #[test] + fn save_empty_list() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("mcp_config.enc"); + let key = crypto::generate_random_key(); + + save_mcp_config_to_path(&[], &path, &key).unwrap(); + + let loaded = load_mcp_config_from_path(&path, &key).unwrap(); + assert!(loaded.is_empty()); + } +} diff --git a/src/mcp/error.rs b/src/mcp/error.rs new file mode 100644 index 0000000..17fcca5 --- /dev/null +++ b/src/mcp/error.rs @@ -0,0 +1,49 @@ +use super::config::GetMcpConfigResponse; + +/// Errors returned by `fetch_mcp_config` / `get_mcp_config`. +#[derive(Debug)] +pub enum FetchMcpConfigError { + /// Business-level failure: the server responded, but `errcode != 0`. + Api(GetMcpConfigResponse), + /// Http-level failure: the server returned a non-200 status. + Http(GetMcpConfigHttpError), + /// Everything else (network, deserialization, I/O …). + Other(anyhow::Error), +} + +#[derive(Debug)] +pub struct GetMcpConfigHttpError { + pub status: u16, + pub body: String, +} + +impl std::fmt::Display for FetchMcpConfigError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Api(resp) => write!( + f, + "获取 MCP 配置失败:[{}] {}", + resp.errcode, + resp.errmsg.as_deref().unwrap_or("unknown") + ), + Self::Http(e) => write!(f, "获取 MCP 配置失败:HTTP {}: {}", e.status, e.body), + Self::Other(e) => write!(f, "{e}"), + } + } +} + +impl std::error::Error for FetchMcpConfigError { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + Self::Api(_) => None, + Self::Http(_) => None, + Self::Other(e) => Some(e.as_ref()), + } + } +} + +impl From for FetchMcpConfigError { + fn from(e: anyhow::Error) -> Self { + Self::Other(e) + } +} diff --git a/src/mcp/mod.rs b/src/mcp/mod.rs new file mode 100644 index 0000000..d3b2d7a --- /dev/null +++ b/src/mcp/mod.rs @@ -0,0 +1,53 @@ +pub(crate) mod config; +pub(crate) mod error; + +use anyhow::Result; +use rand::Rng; + +use crate::service::categories; + +/// Look up the MCP URL for the given `category` (matched against `biz_type`). +pub async fn get_mcp_url(category: &str) -> Result { + let Some(list) = config::load_mcp_config() else { + return Err(anyhow::anyhow!( + "未找到 MCP 配置缓存,请先运行 `{} init`", + env!("CARGO_BIN_NAME") + )); + }; + + let permission_name = categories::get_categories() + .iter() + .find(|c| c.name == category) + .map(|c| c.permission_name) + .unwrap_or(category); + + let target = list + .iter() + .find(|item| item.biz_type.as_deref() == Some(category)) + .ok_or_else(|| { + anyhow::anyhow!("当前企业暂不支持授权机器人「{permission_name}」使用权限") + })?; + + target + .url + .clone() + .ok_or_else(|| anyhow::anyhow!("MCP 配置中 {category} 的 url 为空")) +} + +/// Generate a request ID in the format: `{prefix}_{timestamp_ms}_{random_hex}`. +pub fn gen_req_id(prefix: &str) -> String { + let timestamp = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_millis(); + let random = generate_random_hex(8); + format!("{prefix}_{timestamp}_{random}") +} + +/// Generate a random hex string of the specified character length. +fn generate_random_hex(length: usize) -> String { + let byte_len = length.div_ceil(2); + let bytes: Vec = (0..byte_len).map(|_| rand::rng().random::()).collect(); + let hex = hex::encode(bytes); + hex[..length].to_string() +} diff --git a/src/media/mod.rs b/src/media/mod.rs new file mode 100644 index 0000000..ae59d53 --- /dev/null +++ b/src/media/mod.rs @@ -0,0 +1,98 @@ +mod utils; + +use anyhow::{Context, Result, bail}; +use serde_json::{Value, json}; + +const INBOUND_MAX_BYTES: usize = 20 * 1024 * 1024; + +/// Intercept a `get_msg_media` response: decode base64 payload, save to disk, and replace the response with a local file reference. +pub async fn intercept_media_response(res: Value) -> Result { + let Some(result) = res.get("result") else { + return Ok(res); + }; + + // 1. Extract the content array from the MCP result + let Some(content) = result.get("content").and_then(|c| c.as_array()) else { + return Ok(res); + }; + + // Find the entry where type="text" and text is a string + let text_item = content.iter().find(|c| { + c.get("type").and_then(|t| t.as_str()) == Some("text") + && c.get("text").and_then(|t| t.as_str()).is_some() + }); + let Some(text_item) = text_item else { + return Ok(res); + }; + let text = text_item["text"].as_str().unwrap(); + + // 2. Parse the business JSON + let biz_data: Value = match serde_json::from_str(text) { + Ok(v) => v, + Err(_) => return Ok(res), // Not JSON format, return as-is + }; + + // 3. Validate business response: return as-is when errcode !== 0 or no media_item + if biz_data.get("errcode").and_then(|c| c.as_i64()) != Some(0) { + return Ok(res); + } + + let Some(media_item) = biz_data.get("media_item") else { + return Ok(res); + }; + + let Some(base64_data) = media_item.get("base64_data").and_then(|d| d.as_str()) else { + return Ok(res); + }; + + let media_name = media_item.get("name").and_then(|n| n.as_str()); + let media_type = media_item.get("type").and_then(|t| t.as_str()); + let media_id = media_item.get("media_id").and_then(|i| i.as_str()); + + // 4. Decode base64 → buffer + use base64::Engine as _; + let buffer = base64::engine::general_purpose::STANDARD + .decode(base64_data) + .context("base64解码失败")?; + + // Validate size + if buffer.len() > INBOUND_MAX_BYTES { + bail!( + "媒体文件过大: {} 字节 (最大 {} 字节)", + buffer.len(), + INBOUND_MAX_BYTES + ); + } + + // 5. Detect MIME type + let content_type = utils::detect_mime(media_name, &buffer); + + // 6. Save to local file + let file_path = utils::save_media(media_name, media_id, &content_type, &buffer).await?; + + // 7. Build a concise response: remove base64_data, add local path + let new_biz_data = json!({ + "errcode": 0, + "errmsg": "ok", + "media_item": { + "media_id": media_id, + "name": media_name.unwrap_or_else(|| file_path.file_name() + .and_then(|n| n.to_str()) + .unwrap_or("unknown")), + "type": media_type, + "local_path": file_path.to_string_lossy(), + "size": buffer.len(), + "content_type": content_type, + }, + }); + + // 8. Replace res in-place with the modified MCP result structure + Ok(json!({ + "result": { + "content": [{ + "type": "text", + "text": serde_json::to_string(&new_biz_data)?, + }], + }, + })) +} diff --git a/src/media/utils.rs b/src/media/utils.rs new file mode 100644 index 0000000..c41c2c9 --- /dev/null +++ b/src/media/utils.rs @@ -0,0 +1,124 @@ +use std::{ + io::Write, + path::{Path, PathBuf}, +}; + +use crate::{fs_util::sanitize_filename, paths}; + +/// Maximum dedup index suffix; give up retrying once exceeded. +const MAX_DEDUP_INDEX: u32 = 100; + +/// Detect the MIME type by file extension first, then by magic bytes, falling back to `application/octet-stream`. +pub fn detect_mime(file_name: Option<&str>, buffer: &[u8]) -> String { + // Try to infer from the file extension first + if let Some(name) = file_name { + let ext = Path::new(name) + .extension() + .and_then(|e| e.to_str()) + .unwrap_or(""); + let mime = mime_guess::from_ext(ext).first_or_octet_stream(); + if mime != mime::APPLICATION_OCTET_STREAM { + return mime.to_string(); + } + } + + // Then try to infer from magic bytes + if let Some(kind) = infer::get(buffer) { + return kind.mime_type().to_string(); + } + + "application/octet-stream".to_string() +} + +/// Atomically save media data to the media directory, deduplicating file names when collisions occur. +pub async fn save_media( + media_name: Option<&str>, + media_id: Option<&str>, + content_type: &str, + data: &[u8], +) -> anyhow::Result { + let dir = paths::media_dir(); + + tokio::fs::create_dir_all(&dir).await?; + + let (stem, ext) = determine_file_name(media_name, media_id, content_type); + + let mut tmp = tempfile::NamedTempFile::new_in(&dir)?; + + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt; + tmp.as_file() + .set_permissions(std::fs::Permissions::from_mode(0o600))?; + } + + tmp.write_all(data)?; + tmp.as_file().sync_all()?; + + // First try the original file name without an index + let target = dir.join(make_file_name(&stem, None, &ext)); + tmp = match tmp.persist_noclobber(&target) { + Ok(_) => return Ok(target), + Err(e) if e.error.kind() == std::io::ErrorKind::AlreadyExists => e.file, + Err(e) => return Err(e.error.into()), + }; + + // File already exists; try stem.{index}.ext, index from 0 to MAX_DEDUP_INDEX + for idx in 0..MAX_DEDUP_INDEX { + let target = dir.join(make_file_name(&stem, Some(idx), &ext)); + tmp = match tmp.persist_noclobber(&target) { + Ok(_) => return Ok(target), + Err(e) if e.error.kind() == std::io::ErrorKind::AlreadyExists => e.file, + Err(e) => return Err(e.error.into()), + }; + } + + anyhow::bail!( + "媒体文件保存失败,目标文件已存在:{}", + target.to_string_lossy() + ); +} + +/// Build a file name in the format `stem[.index].ext`. +fn make_file_name(stem: &str, index: Option, ext: &str) -> String { + match (index, ext.is_empty()) { + (None, true) => stem.to_string(), + (None, false) => format!("{stem}.{ext}"), + (Some(i), true) => format!("{stem}.{i}"), + (Some(i), false) => format!("{stem}.{i}.{ext}"), + } +} + +/// Derive the (stem, extension) pair from media name, media ID, or content type. +pub fn determine_file_name( + media_name: Option<&str>, + media_id: Option<&str>, + content_type: &str, +) -> (String, String) { + if let Some(name) = media_name.and_then(sanitize_filename) { + let path = Path::new(&name); + let stem = path + .file_stem() + .and_then(|s| s.to_str()) + .unwrap_or(&name) + .to_string(); + let ext = path + .extension() + .and_then(|e| e.to_str()) + .unwrap_or("") + .to_string(); + return (stem, ext); + } + + let stem = media_id + .and_then(sanitize_filename) + .unwrap_or_else(|| "media".to_string()); + + let ext = mime_guess::get_mime_extensions_str(content_type) + .and_then(|exts| exts.first()) + .copied() + .unwrap_or("bin") + .to_string(); + + (stem, ext) +} diff --git a/src/paths.rs b/src/paths.rs new file mode 100644 index 0000000..5cb2eba --- /dev/null +++ b/src/paths.rs @@ -0,0 +1,24 @@ +use std::path::PathBuf; + +use crate::constants::env; + +pub fn wecom_home_dir() -> PathBuf { + if let Ok(dir) = std::env::var(env::CONFIG_DIR) { + return PathBuf::from(dir); + } + dirs::home_dir() + .unwrap_or_else(|| PathBuf::from(".")) + .join(".config") + .join("wecom") +} + +pub fn cache_dir() -> PathBuf { + wecom_home_dir().join("cache") +} + +pub fn media_dir() -> PathBuf { + if let Ok(dir) = std::env::var(env::TMP_DIR) { + return PathBuf::from(dir).join("media"); + } + std::env::temp_dir().join("wecom").join("media") +} diff --git a/src/registry.rs b/src/registry.rs new file mode 100644 index 0000000..8a556b8 --- /dev/null +++ b/src/registry.rs @@ -0,0 +1,66 @@ +use std::{collections::HashMap, path::PathBuf}; + +use anyhow::Result; +use serde::{Deserialize, Serialize, de::DeserializeOwned}; + +use crate::{fs_util, json_rpc, paths}; + +#[derive(Deserialize, Serialize, Clone)] +pub struct ServiceTool { + pub name: String, + pub description: Option, + + #[serde(rename = "inputSchema")] + pub input_schema: Option, + + #[serde(flatten)] + pub extra_properties: HashMap, +} + +/// 获取指定品类的工具列表(文件缓存 → 远程请求) +pub async fn get_category_tools(name: &str) -> Result> { + let cache_file = paths::cache_dir().join(format!("service_{name}.json")); + + if let Some(tools) = get_cache_content::>(&cache_file) { + return Ok(tools); + } + + // 远程请求 + let response = json_rpc::send(name, "tools/list", None, None).await?; + + let Some(tools) = response + .pointer("/result/tools") + .and_then(|r| serde_json::from_value::>(r.clone()).ok()) + else { + anyhow::bail!("无法获取 {} 品类的工具列表: {response}", name); + }; + + // 写入文件缓存(失败仅 warn,不阻断主流程) + if let Ok(json) = serde_json::to_string(&tools) { + if let Err(e) = fs_util::atomic_write(&cache_file, json.as_bytes(), None) { + tracing::warn!(path = %cache_file.display(), error = %e, "Failed to write service cache"); + } + } + + Ok(tools) +} + +fn get_cache_content(cache_file: &PathBuf) -> Option { + let metadata = std::fs::metadata(cache_file).ok()?; + let modified = metadata.modified().ok()?; + + if modified.elapsed().unwrap_or_default().as_secs() >= 86400 { + return None; + } + + let content = std::fs::read_to_string(cache_file).ok()?; + let result = serde_json::from_str::(&content); + + match result { + Ok(data) => Some(data), + Err(e) => { + tracing::warn!(path = %cache_file.display(), error = %e, "Ignoring corrupted discovery cache"); + None + } + } +} diff --git a/src/service/categories.rs b/src/service/categories.rs new file mode 100644 index 0000000..b3ae2c4 --- /dev/null +++ b/src/service/categories.rs @@ -0,0 +1,43 @@ +#[derive(Debug, Clone)] +pub struct CategoryInfo { + pub name: &'static str, + pub description: &'static str, + pub permission_name: &'static str, +} + +/// Return all supported business categories and their tool definitions. +pub fn get_categories() -> Vec { + // Categories in alphabetical order + vec![ + CategoryInfo { + name: "contact", + description: "通讯录 — 成员查询和搜索", + permission_name: "通讯录", + }, + CategoryInfo { + name: "doc", + description: "文档 — 文档/智能表格创建和管理", + permission_name: "文档", + }, + CategoryInfo { + name: "meeting", + description: "会议 — 创建/管理/查询视频会议", + permission_name: "会议", + }, + CategoryInfo { + name: "msg", + description: "消息 — 聊天列表、发送/接收消息、媒体下载", + permission_name: "消息", + }, + CategoryInfo { + name: "schedule", + description: "日程 — 日程增删改查和可用性查询", + permission_name: "日程", + }, + CategoryInfo { + name: "todo", + description: "待办事项 — 创建/查询/编辑待办项", + permission_name: "待办", + }, + ] +} diff --git a/src/service/command.rs b/src/service/command.rs new file mode 100644 index 0000000..e9ec9d7 --- /dev/null +++ b/src/service/command.rs @@ -0,0 +1,49 @@ +use clap::{Args, Command}; + +use crate::{helpers::HelperRegistry, registry::ServiceTool}; + +use super::categories::CategoryInfo; + +#[derive(Args, Debug)] +pub struct MethodCmdArgs { + /// JSON 格式的参数 + #[arg(hide = true, value_name = "args")] + pub args: Option, + + /// JSON 格式的参数 + #[arg(long)] + pub json: Option, + + /// 输出 method schema + #[arg(long, action = clap::ArgAction::SetTrue)] + pub schema: bool, +} + +pub fn build_service_cmd( + helper_registry: &HelperRegistry, + category: &CategoryInfo, + tools: Option<&Vec>, +) -> Command { + let mut cmd = Command::new(category.name) + .about(category.description) + .arg_required_else_help(true) + .disable_help_flag(true); + + for helper in helper_registry.list_in_category(category.name) { + cmd = cmd.subcommand(helper.command().disable_help_flag(true)); + } + + if let Some(tools) = tools { + for tool in tools { + let mut tool_cmd = MethodCmdArgs::augment_args( + Command::new(tool.name.clone()).disable_help_flag(true), + ); + if let Some(desc) = &tool.description { + tool_cmd = tool_cmd.about(desc.clone()); + } + cmd = cmd.subcommand(tool_cmd); + } + } + + cmd +} diff --git a/src/service/handler.rs b/src/service/handler.rs new file mode 100644 index 0000000..7c8f572 --- /dev/null +++ b/src/service/handler.rs @@ -0,0 +1,47 @@ +use crate::{helpers::HelperRegistry, json_rpc, media, registry, service::command::MethodCmdArgs}; + +use anyhow::Result; +use clap::{ArgMatches, FromArgMatches}; +use serde_json::json; + +/// Handle the `call` subcommand: dispatch a JSON-RPC tool invocation for a given category and method. +pub async fn handle_service_cmd( + helper_registry: &HelperRegistry, + category_name: &str, + matches: &ArgMatches, +) -> Result<()> { + let Some((method_name, matches)) = matches.subcommand() else { + return Ok(()); + }; + + if let Some(helper) = helper_registry.get(category_name, method_name) { + return helper.execute(matches).await; + } + + let args = MethodCmdArgs::from_arg_matches(matches)?; + + if args.schema { + let tools = registry::get_category_tools(category_name).await?; + let Some(tool) = tools.iter().find(|t| t.name == method_name) else { + anyhow::bail!("工具不存在: {}", method_name); + }; + println!("{}", serde_json::to_string_pretty(tool)?); + return Ok(()); + } + + // 优先使用 --json,其次位置参数 args,都没有则默认空对象 + let json_args = if let Some(raw) = args.json.as_deref().or(args.args.as_deref()) { + serde_json::from_str(raw)? + } else { + json!({}) + }; + + let mut res = json_rpc::call_tool(category_name, method_name, json_args).await?; + + if method_name == "get_msg_media" { + res = media::intercept_media_response(res).await?; + } + + println!("{res}"); + Ok(()) +} diff --git a/src/service/mod.rs b/src/service/mod.rs new file mode 100644 index 0000000..c6f5fb0 --- /dev/null +++ b/src/service/mod.rs @@ -0,0 +1,3 @@ +pub mod categories; +pub mod command; +pub mod handler; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..6591414 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@tsconfig/node-lts/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "noEmit": true + }, + "include": [ + "**/*.js" + ] +}