MCPcopy Create free account

hub / github.com/WecomTeam/wecom-cli / functions

Functions147 in github.com/WecomTeam/wecom-cli

↓ 28 callersFunctiongenerate_random_key
Generate a fresh random 256-bit key.
src/crypto/keystore.rs:47
↓ 26 callersMethodget
(&self, category: &str, name: &str)
src/helpers/registry.rs:38
↓ 13 callersFunctionatomic_write
Atomically write `data` (bytes) to `path`, overwriting if the file already exists. Uses `tempfile::NamedTempFile` to create a temporary file in the s
src/fs_util/atomic_write.rs:11
↓ 8 callersFunctionencrypt
Encrypt `plaintext` with AES-256-GCM. Returns `nonce || ciphertext`.
src/crypto/cipher.rs:11
↓ 7 callersFunctionencrypt_data
Encrypt serializable data: serialize → AES-256-GCM encrypt.
src/crypto/keystore.rs:98
↓ 7 callersFunctiontmp
()
src/fs_util/atomic_write.rs:45
↓ 6 callersFunctionsign
Compute the request signature. Algorithm: `sha256_hex(secret + bot_id + time + nonce)` where `sha256_hex` uses the standard zero-padded lowercase hex
src/mcp/config.rs:99
↓ 5 callersFunctioncall_tool
( category: &str, method: &str, args: serde_json::Value, )
src/json_rpc.rs:91
↓ 5 callersFunctiondecrypt_data
Decrypt data: AES-256-GCM decrypt → deserialize.
src/crypto/keystore.rs:105
↓ 5 callersFunctionsave_mcp_config_to_path
Encrypt and write the config list to a specific path with a given key (test helper).
src/mcp/config.rs:158
↓ 4 callersMethodbuild
Build a signed request from stored bot credentials
src/mcp/config.rs:39
↓ 4 callersFunctiondecode_key
Decode a Base64 string into a 32-byte key, returning an error on invalid input.
src/crypto/keystore.rs:34
↓ 4 callersFunctionget_category_tools
获取指定品类的工具列表(文件缓存 → 远程请求)
src/registry.rs:21
↓ 4 callersFunctionget_str
获取 JSON 对象中指定字段的字符串值
src/helpers/doc/auto_file_upload.rs:72
↓ 4 callersFunctionwecom_home_dir
()
src/paths.rs:5
↓ 3 callersFunctionbot_info_path
Return the file path for the encrypted bot credentials.
src/auth/bot.rs:76
↓ 3 callersFunctiondecrypt
Decrypt `data` (expected format: `nonce || ciphertext || tag`) with AES-256-GCM.
src/crypto/cipher.rs:24
↓ 3 callersFunctionget_modified_schema
获取远程工具 schema,并新增 `image_path` / `file_path` 字段。
src/helpers/doc/auto_file_upload.rs:254
↓ 3 callersFunctionget_user_agent
()
src/constants.rs:31
↓ 3 callersFunctionload_key_from_file
Load the key from the file fallback. Returns `None` if unavailable.
src/crypto/keystore.rs:59
↓ 3 callersFunctionload_mcp_config_from_path
Read and decrypt the config list from a specific path with a given key (test helper).
src/mcp/config.rs:169
↓ 3 callersFunctionmcp_config_path
Return the file path for the encrypted MCP config cache.
src/mcp/config.rs:119
↓ 3 callersFunctionsample_items
()
src/mcp/config.rs:234
↓ 2 callersFunctioncache_dir
()
src/paths.rs:15
↓ 2 callersFunctioncall_json_tool
( category: &str, method: &str, args: serde_json::Value, )
src/json_rpc.rs:51
↓ 2 callersMethodcategory
(&self)
src/helpers/doc/smartpage_create.rs:85
↓ 2 callersFunctioncollect_cache_files
收集缓存目录下所有常规文件的路径。
src/cmd/cache.rs:115
↓ 2 callersMethodcommand
(&self)
src/helpers/doc/smartpage_create.rs:89
↓ 2 callersFunctionencode_key
Encode a 32-byte key as a Base64 string.
src/crypto/keystore.rs:29
↓ 2 callersFunctionencryption_key_path
Return the file path for the local encryption key fallback.
src/crypto/keystore.rs:20
↓ 2 callersFunctionextract_doc_identifier
从参数中提取文档标识(`docid` 或 `url`)。
src/helpers/doc/auto_file_upload.rs:17
↓ 2 callersFunctiongen_req_id
Generate a request ID in the format: `{prefix}_{timestamp_ms}_{random_hex}`.
src/mcp/mod.rs:38
↓ 2 callersFunctionget_bot_info
Read encrypted bot info from disk, decrypt and return it. Returns `None` if the file does not exist or decryption fails.
src/auth/bot.rs:37
↓ 2 callersFunctionget_categories
Return all supported business categories and their tool definitions.
src/service/categories.rs:9
↓ 2 callersFunctioninit_logging
Initialize the tracing subscriber with optional stderr and file logging layers.
src/logging.rs:6
↓ 2 callersFunctioninit_qrcode
扫码接入流程
src/cmd/init.rs:57
↓ 2 callersFunctionload_existing_key
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
src/crypto/keystore.rs:68
↓ 2 callersFunctionmake_file_name
Build a file name in the format `stem[.index].ext`.
src/media/utils.rs:83
↓ 2 callersFunctionprocess_records
扫描 records 并自动上传本地文件/图片,将路径替换为上传结果。
src/helpers/doc/auto_file_upload.rs:32
↓ 2 callersFunctionread_file_as_base64
读取本地文件并编码为 base64,超过 `max_size` 时报错。
src/helpers/doc/auto_file_upload.rs:145
↓ 2 callersFunctionsave_key
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
src/crypto/keystore.rs:76
↓ 2 callersFunctionsend
Send a JSON-RPC 2.0 request to the MCP endpoint for the given category and method.
src/json_rpc.rs:119
↓ 2 callersFunctionsha256_hex
Compute the SHA-256 hash of `input` and return it as a lowercase hex string.
src/mcp/config.rs:105
↓ 2 callersFunctiontry_decrypt_data
Try to decrypt data using the cached/keyring key first; on failure, fall back to the file key.
src/crypto/keystore.rs:111
↓ 1 callersFunctionbuild_auth_cmd
()
src/cmd/auth.rs:19
↓ 1 callersFunctionbuild_cache_cmd
()
src/cmd/cache.rs:21
↓ 1 callersFunctionbuild_client
()
src/auth/qrcode.rs:96
↓ 1 callersFunctionbuild_init_cmd
()
src/cmd/init.rs:20
↓ 1 callersFunctionbuild_service_cmd
( helper_registry: &HelperRegistry, category: &CategoryInfo, tools: Option<&Vec<ServiceTool>>, )
src/service/command.rs:22
↓ 1 callersFunctionclear_bot_info
Remove the stored Bot info from disk.
src/auth/bot.rs:67
↓ 1 callersFunctionclear_mcp_config
Remove the cached MCP config file from disk.
src/mcp/config.rs:148
↓ 1 callersFunctioncollect_upload_paths
收集 cell 中需要上传的本地路径
src/helpers/doc/auto_file_upload.rs:77
↓ 1 callersFunctiondetect_mime
Detect the MIME type by file extension first, then by magic bytes, falling back to `application/octet-stream`.
src/media/utils.rs:12
↓ 1 callersFunctiondetermine_file_name
Derive the (stem, extension) pair from media name, media ID, or content type.
src/media/utils.rs:93
↓ 1 callersMethodexecute
( &'a self, matches: &'a ArgMatches, )
src/helpers/doc/smartpage_create.rs:96
↓ 1 callersFunctionfetch_mcp_config
Always fetch the MCP config from the server, bypassing local cache, and persist the result.
src/mcp/config.rs:179
↓ 1 callersFunctionfetch_qrcode
获取二维码链接和轮询 scode
src/auth/qrcode.rs:103
↓ 1 callersFunctiongenerate_random_hex
Generate a random hex string of the specified character length.
src/mcp/mod.rs:48
↓ 1 callersFunctiongetBinaryPath
* Resolves the path to the platform-specific binary.
bin/wecom.js:42
↓ 1 callersFunctiongetPlatformPackage
* Returns the platform-specific package name based on current OS and CPU architecture.
bin/wecom.js:13
↓ 1 callersFunctionget_mcp_url
Look up the MCP URL for the given `category` (matched against `biz_type`).
src/mcp/mod.rs:10
↓ 1 callersFunctionhandle_auth_cmd
(matches: &ArgMatches)
src/cmd/auth.rs:23
↓ 1 callersFunctionhandle_auth_show
(args: &ShowArgs)
src/cmd/auth.rs:29
↓ 1 callersFunctionhandle_auth_show_auth_status
(bot: Option<Bot>)
src/cmd/auth.rs:52
↓ 1 callersFunctionhandle_auth_show_default
(bot: Option<Bot>)
src/cmd/auth.rs:39
↓ 1 callersFunctionhandle_cache_clear
清除缓存目录下所有文件。
src/cmd/cache.rs:75
↓ 1 callersFunctionhandle_cache_cmd
(matches: &ArgMatches)
src/cmd/cache.rs:29
↓ 1 callersFunctionhandle_cache_status
列出当前缓存目录下所有文件及其修改时间。
src/cmd/cache.rs:40
↓ 1 callersFunctionhandle_init_cmd
Handle the `init` subcommand: prompt for bot credentials, persist them, and verify via MCP config fetch.
src/cmd/init.rs:26
↓ 1 callersFunctionhandle_service_cmd
Handle the `call` subcommand: dispatch a JSON-RPC tool invocation for a given category and method.
src/service/handler.rs:8
↓ 1 callersFunctioninit_manual
手动输入 Bot ID 和 Secret
src/cmd/init.rs:62
↓ 1 callersFunctionintercept_media_response
Intercept a `get_msg_media` response: decode base64 payload, save to disk, and replace the response with a local file reference.
src/media/mod.rs:9
↓ 1 callersMethodlist_in_category
(&self, category: &str)
src/helpers/registry.rs:45
↓ 1 callersFunctionload_mcp_config
Read cached MCP config list from the encrypted file.
src/mcp/config.rs:124
↓ 1 callersFunctionmcp_config_endpoint
Return the MCP config endpoint URL (env override or the default WeCom API).
src/constants.rs:23
↓ 1 callersFunctionmedia_dir
()
src/paths.rs:19
↓ 1 callersFunctionopen_url_by_browser
尝试使用系统默认浏览器打开指定 URL。 - 使用 `open` crate 跨平台打开浏览器(macOS: `open`、Windows: `ShellExecuteW`、Linux: `xdg-open`)。 - 打开失败不会中断主流程,仅记录日志。
src/browser.rs:4
↓ 1 callersFunctionpoll_result
轮询扫码结果
src/auth/qrcode.rs:160
↓ 1 callersFunctionrender_qrcode
在终端渲染二维码(TTY,带 ANSI 色彩)
src/auth/qrcode.rs:137
↓ 1 callersFunctionrender_qrcode_unicode
在 non-TTY 环境下用纯 Unicode 半块字符渲染二维码(无 ANSI escape)
src/auth/qrcode.rs:144
↓ 1 callersFunctionreplace_attachment_value_schema
替换 schema 中的 CellAttachmentValue 定义,只保留 file_path 字段。
src/helpers/doc/auto_file_upload.rs:295
↓ 1 callersFunctionreplace_image_value_schema
替换 schema 中的 CellImageValue 定义,只保留 image_path 字段。
src/helpers/doc/auto_file_upload.rs:270
↓ 1 callersFunctionreplace_upload_results
用上传结果替换 cell 中的本地路径
src/helpers/doc/auto_file_upload.rs:95
↓ 1 callersFunctionsave_mcp_config
Encrypt and persist the MCP config list to disk.
src/mcp/config.rs:130
↓ 1 callersFunctionsave_media
Atomically save media data to the media directory, deduplicating file names when collisions occur.
src/media/utils.rs:34
↓ 1 callersFunctionscan_qrcode_for_bot
扫码接入完整流程:获取二维码 → 终端展示 → 轮询结果 → 返回 Bot
src/auth/qrcode.rs:61
↓ 1 callersFunctionset_bot_info
Serialize bot info, encrypt and persist to disk. The encryption key is stored in the system keyring when possible, otherwise falls back to an encrypte
src/auth/bot.rs:44
↓ 1 callersFunctionupload_files
批量上传文件,返回 path → FileUploadResult 映射。
src/helpers/doc/auto_file_upload.rs:212
↓ 1 callersFunctionupload_images
批量上传图片,返回 path → ImageUploadResult 映射。
src/helpers/doc/auto_file_upload.rs:162
↓ 1 callersFunctionverify_and_finish
验证凭证并完成初始化
src/cmd/init.rs:75
Functionbind_source_serializes_as_number
()
src/mcp/config.rs:365
Methodcategory
(&self)
src/helpers/doc/smartsheet_update_records_auto_file.rs:29
Methodcategory
(&self)
src/helpers/doc/smartsheet_add_records_auto_file.rs:29
Methodcommand
(&self)
src/helpers/doc/smartsheet_update_records_auto_file.rs:33
Methodcommand
(&self)
src/helpers/doc/smartsheet_add_records_auto_file.rs:33
Functiondecode_invalid_base64_fails
()
src/crypto/keystore.rs:143
Functiondecode_trims_whitespace
()
src/crypto/keystore.rs:155
Functiondecode_wrong_length_fails
()
src/crypto/keystore.rs:148
Functiondecrypt_corrupted_data_fails
()
src/crypto/cipher.rs:92
Functiondecrypt_data_with_corrupted_data_fails
()
src/crypto/keystore.rs:237
next →1–100 of 147, ranked by callers