{"id":"aa5e98a6-e030-41aa-86c7-db873069b71f","entityType":"agent","slug":"clawhub-shawnminh-tencent-agent-storage","name":"Tencent Agent Storage","canonicalUrl":"https://www.xpersona.co/agent/clawhub-shawnminh-tencent-agent-storage","canonicalPath":"/agent/clawhub-shawnminh-tencent-agent-storage","generatedAt":"2026-10-09T22:17:14.669Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T05:25:49.645Z","emptyReason":null},"description":"Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\nManages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\nMUST trigger when the user mentions ANY of the following concepts:\n【云盘/网盘相关 — Cloud Drive Acce","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 4.4K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s171w85g35e7s5w8bqgg9sqged83g9yb:tencent-agent-storage","sourceUrl":"https://clawhub.ai/shawnminh/tencent-agent-storage","homepage":"https://clawhub.ai/shawnminh/skills/tencent-agent-storage","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/shawnminh/tencent-agent-storage","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/shawnminh/skills/tencent-agent-storage","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":49,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Tencent Agent Storage technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T05:25:49.645Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T05:25:49.645Z","emptyReason":null},"stars":null,"forks":null,"downloads":4418,"packageName":null,"latestVersion":"1.0.17","tractionLabel":"4.4K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T05:25:49.644Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T05:25:49.645Z","lastCrawledAt":"2026-10-09T05:25:49.644Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T05:25:49.644Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.17","createdAt":"2026-07-24T02:43:42.392Z","changelog":"- Added support for file renaming and moving: new trigger keywords (e.g., \"rename file\", \"move file\") and a new `rename` command are now included. - Updated required `smh-node-sdk` version to `^1.0.9`. - Improved documentation to reflect updated commands, triggers, and usage. - Removed the redundant `skill-card.md` file.","fileCount":4,"zipByteSize":15708},{"version":"1.0.16","createdAt":"2026-05-29T03:42:05.915Z","changelog":"tencent-agent-storage v1.0.16 - Version bump only; no file or documentation changes detected. - No functional updates or new features in this release.","fileCount":4,"zipByteSize":14938},{"version":"1.0.15","createdAt":"2026-05-22T06:23:20.046Z","changelog":"tencent-agent-storage 1.0.15 - Version bump with no detected file changes. - No new features, fixes, or documentation updates in this release.","fileCount":4,"zipByteSize":15169},{"version":"1.0.14","createdAt":"2026-05-21T12:02:18.962Z","changelog":"**Adds search and directory management capability.** - Added support for file search and directory creation in Tencent Agent Storage. - New trigger phrases for file search (e.g., \"搜索文件\", \"find file\", \"search cloud\"). - Documents new CLI commands: `search` for file lookup and `mkdir` for creating directories. - Requires `smh-node-sdk` version ^1.0.8 or higher.","fileCount":3,"zipByteSize":12657},{"version":"1.0.13","createdAt":"2026-04-29T03:37:19.175Z","changelog":"tencent-agent-storage v1.0.13 - No file or documentation changes detected since the previous release. - Retains all previous features and behaviors related to Tencent Agent Storage file upload and management. - No new functionality, bug fixes, or metadata updates in this version.","fileCount":3,"zipByteSize":10972},{"version":"1.0.12","createdAt":"2026-04-24T07:24:49.821Z","changelog":"- Version bump from 1.0.7 to 1.0.12 with no code or documentation changes. - No file changes detected; functionality and usage remain the same.","fileCount":3,"zipByteSize":11377},{"version":"1.0.11","createdAt":"2026-04-24T07:18:00.167Z","changelog":"Tencent Agent Storage v1.0.11 - No file changes detected for this version. - No updates or functional changes—behavior remains identical to previous release.","fileCount":3,"zipByteSize":11376},{"version":"1.0.10","createdAt":"2026-04-17T09:48:04.159Z","changelog":"tencent-agent-storage 1.0.10 - No user-facing changes in this release. - Internal: Version number updated; no code changes detected. - All features and configurations remain unchanged.","fileCount":3,"zipByteSize":11288}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s171w85g35e7s5w8bqgg9sqged83g9yb:tencent-agent-storage","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s171w85g35e7s5w8bqgg9sqged83g9yb:tencent-agent-storage` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/shawnminh/tencent-agent-storage before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-shawnminh-tencent-agent-storage/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-shawnminh-tencent-agent-storage/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-shawnminh-tencent-agent-storage/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-shawnminh-tencent-agent-storage/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-shawnminh-tencent-agent-storage/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-shawnminh-tencent-agent-storage/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T22:17:14.665Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-shawnminh-tencent-agent-storage/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-shawnminh-tencent-agent-storage/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-shawnminh-tencent-agent-storage/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-shawnminh-tencent-agent-storage/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T05:25:49.645Z","emptyReason":null},"readme":"Skill: Tencent Agent Storage\n\nOwner: shawnminh\n\nSummary: Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\nManages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\nMUST trigger when the user mentions ANY of the following concepts:\n【云盘/网盘相关 — Cloud Drive Acce\n\nTags: latest:1.0.17\n\nVersion history:\n\nv1.0.17 | 2026-07-24T02:43:42.392Z | user\n\n- Added support for file renaming and moving: new trigger keywords (e.g., \"rename file\", \"move file\") and a new `rename` command are now included.\n- Updated required `smh-node-sdk` version to `^1.0.9`.\n- Improved documentation to reflect updated commands, triggers, and usage.\n- Removed the redundant `skill-card.md` file.\n\nv1.0.16 | 2026-05-29T03:42:05.915Z | user\n\ntencent-agent-storage v1.0.16\n\n- Version bump only; no file or documentation changes detected.\n- No functional updates or new features in this release.\n\nv1.0.15 | 2026-05-22T06:23:20.046Z | user\n\ntencent-agent-storage 1.0.15\n\n- Version bump with no detected file changes.\n- No new features, fixes, or documentation updates in this release.\n\nv1.0.14 | 2026-05-21T12:02:18.962Z | user\n\n**Adds search and directory management capability.**\n\n- Added support for file search and directory creation in Tencent Agent Storage.\n- New trigger phrases for file search (e.g., \"搜索文件\", \"find file\", \"search cloud\").\n- Documents new CLI commands: `search` for file lookup and `mkdir` for creating directories.\n- Requires `smh-node-sdk` version ^1.0.8 or higher.\n\nv1.0.13 | 2026-04-29T03:37:19.175Z | user\n\ntencent-agent-storage v1.0.13\n\n- No file or documentation changes detected since the previous release.\n- Retains all previous features and behaviors related to Tencent Agent Storage file upload and management.\n- No new functionality, bug fixes, or metadata updates in this version.\n\nv1.0.12 | 2026-04-24T07:24:49.821Z | user\n\n- Version bump from 1.0.7 to 1.0.12 with no code or documentation changes.\n- No file changes detected; functionality and usage remain the same.\n\nv1.0.11 | 2026-04-24T07:18:00.167Z | user\n\nTencent Agent Storage v1.0.11\n\n- No file changes detected for this version.\n- No updates or functional changes—behavior remains identical to previous release.\n\nv1.0.10 | 2026-04-17T09:48:04.159Z | user\n\ntencent-agent-storage 1.0.10\n\n- No user-facing changes in this release.\n- Internal: Version number updated; no code changes detected.\n- All features and configurations remain unchanged.\n\nv1.0.9 | 2026-04-17T09:36:20.749Z | user\n\nNo file changes detected in this release.\n\n- Version number updated from 1.0.7 to 1.0.9.\n- No other changes to code or documentation.\n\nv1.0.8 | 2026-04-15T08:33:02.483Z | user\n\n- Added a full node_modules directory for the project, including dependencies such as asynckit and axios.\n- Initial commit of 910 files supporting Node.js environment and package management for the skill.\n- No user-facing feature changes or functional updates; this release is focused on bundling all necessary dependencies for local and portable usage.\n\nv1.0.7 | 2026-04-14T08:42:05.726Z | user\n\n**Tencent Agent Storage 1.0.7 – New Script Integration & Hermes Compatibility**\n\n- Added the main script: `scripts/agent-storage.js` as the core upload/management tool (migrated from `/tmp/smh-upload.js`).\n- Updated documentation to support both OpenClaw and Hermes platforms, including their respective credential configuration sections.\n- Documented the new script location and changed the usage pattern to `node scripts/agent-storage.js ...` (no longer writes or uses temporary files).\n- Enhanced environment setup and compatibility guidance for Node.js & environment variable configuration.\n- Expanded metadata: Added Hermes agent tags and documented required variables for broader platform support.\n- No changes to logic or feature set; this version focuses on improved structure, integration, and multi-platform documentation.\n\nv1.0.6 | 2026-04-14T06:30:54.435Z | user\n\nInitial release of Tencent Agent Storage integration.\n\n- Provides cloud file upload, backup, and management for users' personal Tencent Agent Storage.\n- Auto-generates download links and supports file delivery across devices (PC, mobile, tablet).\n- Triggers when users mention cloud drive access, file upload, download, sharing, backups, or related intents.\n- Handles file conflicts with user-guided overwrite/rename/cancel options.\n- No file size restriction: supports multi-GB files with multipart upload.\n- Requires `smh-node-sdk` npm package and credential setup via environment variables or direct parameters.\n\nv1.0.4 | 2026-04-13T08:33:00.745Z | user\n\nNo changes detected in this version.\n\n- Version 1.0.4 does not include any file modifications or updates.\n- Skill functionality, setup, and documentation remain unchanged.\n\nv1.0.2 | 2026-04-09T09:15:03.201Z | user\n\ntencent-agent-storage v1.0.2\n\n- No code or documentation changes detected in this version.\n- All functionality, triggers, and descriptions remain unchanged.\n\nv1.0.1 | 2026-04-09T09:07:04.411Z | user\n\ntencent-agent-storage 1.0.1\n\n- No code changes in this release.\n- Updated description: \"专属云盘\" is now described as \"专属网盘\" (exclusive cloud drive) in the English summary for clarity; all other workflow, triggers, and technical details remain unchanged.\n\nv1.0.0 | 2026-04-09T09:02:46.715Z | user\n\ntencent-agent-storage v1.0.0\n\n- Initial release of Tencent Agent Storage skill for personal cloud file management.\n- Enables file upload, download, preview, backup, and sharing within Tencent Agent Storage (专属云盘).\n- Automatically triggers when users mention cloud drive, file listing, upload/backup, sharing links, file status, or similar scenarios.\n- Upload script supports large files (no size limit), smart conflict handling (ask/overwrite/rename), and credential flexibility.\n- All actions output direct download links with a 2-hour validity, supporting delivery across devices.\n\nArchive index:\n\nArchive v1.0.17: 4 files, 15708 bytes\n\nFiles: scripts/agent-storage.js (19849b), skill-card.md (2519b), SKILL.md (22558b), _meta.json (141b)\n\nFile v1.0.17:SKILL.md\n\n---\nname: tencent-agent-storage\nversion: 1.0.11\nauthor: shawnmzhang\nlicense: MIT\ndescription: |\n  Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\n  Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\n  MUST trigger when the user mentions ANY of the following concepts:\n  【云盘/网盘相关 — Cloud Drive Access】\n  - \"网盘\", \"云盘\", \"云空间\", \"龙虾盘\", \"龙虾云盘\", \"龙虾网盘\", \"龙虾空间\"\n  - \"专属云盘\", \"专属网盘\", \"专属空间\", \"我的云盘\", \"我的网盘\", \"我的龙虾\"\n  - \"打开网盘\", \"打开云盘\", \"进入网盘\", \"进入云盘\", \"看看云盘\", \"看看网盘\"\n  - \"cloud drive\", \"my drive\", \"open drive\", \"lobster drive\"\n  【文件列表/查看 — File Listing & Browsing】\n  - \"列出文件\", \"有哪些文件\", \"看看文件\", \"文件列表\", \"我的文件\"\n  - \"云盘里有什么\", \"空间里有啥\", \"查看云空间\", \"云空间文件\"\n  - \"list files\", \"show files\", \"my files\", \"what files\", \"browse files\"\n  【上传/备份 — Upload & Backup】\n  - \"上传文件\", \"上传某个文件\", \"确定上传\", \"传到云空间\", \"上传到云空间\"\n  - \"备份到云\", \"备份文件\", \"保存到云\", \"存到网盘\", \"传到网盘\", \"存到云盘\", \"传到云盘\"\n  - \"文件传一下\", \"帮我传个文件\", \"把这个存一下\"\n  - \"upload\", \"backup\", \"save to cloud\", \"back up\"\n  【发送/传输给用户 — Send & Deliver Files】\n  - \"把文件发给我\", \"整理好发我\", \"发到手机\", \"传到手机\"\n  - \"做完了发我一份\", \"弄好了发给我\", \"完成后把文件给我\"\n  - \"导出之后发我\", \"生成完发给我看看\", \"跑完了把结果给我\"\n  - \"send file\", \"send to phone\", \"deliver file\", \"give me the file\"\n  【链接/分享 — Links & Sharing】\n  - \"生成下载链接\", \"做成链接\", \"给我下载链接\"\n  - \"生成个链接发给同事\", \"发到群里\", \"分享文件\", \"分享给别人\", \"发个链接\"\n  - \"download link\", \"share file\", \"share link\", \"generate link\"\n  【文件状态查询 — File Status Check】\n  - \"这个云文件还在吗\", \"之前上传的文件还能下吗\", \"链接过期了能重新生成吗\"\n  - \"is file still there\", \"can I still download\", \"regenerate link\"\n  【文件搜索/检索 — File Search】\n  - \"搜索文件\", \"搜一下\", \"找文件\", \"找一下\", \"查找\", \"检索文件\"\n  - \"搜索云盘\", \"在云盘里搜\", \"帮我找个文件\", \"有没有叫xxx的文件\"\n  - \"search files\", \"find file\", \"search cloud\"\n  【重命名/移动 — Rename & Move】\n  - \"重命名文件\", \"改名\", \"改文件名\", \"换个名字\", \"移动文件\", \"移到\", \"挪到\"\n  - \"rename file\", \"move file\", \"rename\", \"move to\"\n  【隐式触发 — Implicit Triggers】\n  - When a task produces output files (reports, exports, generated content) that need to be delivered to the user\n  - When the user's intent implies needing a file on another device, even without explicitly saying \"upload\"\n  - When MyClaw/agent needs to upload files to generate download links\n  - Any mention of file transfer, cloud storage, or personal file space in the conversation context\nmetadata: {}\n---\n\n# Tencent Agent Storage (云文件上传备份工具)\n\n将本地文件上传至 Tencent Agent Storage，自动生成下载链接和图片预览。上传的文件存储在用户独有的云盘空间中，支持跨端访问——无论是手机、电脑还是平板，用户都可以随时随地查看和下载自己的文件。\n\n## When to Use\n\nAgent **MUST** activate this skill when any of the following conditions are met:\n\n- User mentions cloud drive keywords: 网盘、云盘、云空间、龙虾盘、专属网盘、cloud drive, my drive\n- User requests file listing or browsing: 列出文件、有哪些文件、list files, show files\n- User requests upload or backup: 上传文件、备份到云、存到网盘、upload, backup, save to cloud\n- User asks to send/deliver files: 把文件发给我、发到手机、send file, deliver file\n- User requests links or sharing: 生成下载链接、分享文件、download link, share link\n- User queries file status: 这个云文件还在吗、链接过期了、is file still there\n- User requests file search: 搜索文件、找文件、检索文件、搜索云盘、search files, find file\n- User requests rename or move: 重命名文件、改名、移动文件、rename file, move file\n- **Implicit**: A task produces output files that need to be delivered to the user, or the user's intent implies needing a file on another device\n\n## Quick Reference\n\n| Command | Usage | Description |\n|---------|-------|-------------|\n| `upload` | `node scripts/agent-storage.js upload '<json>'` | Upload local file to cloud, returns download link |\n| `uploadDir` | `node scripts/agent-storage.js uploadDir '<json>'` | Upload entire folder to cloud, preserving directory structure |\n| `info` | `node scripts/agent-storage.js info '<json>'` | Get file info and regenerate download link |\n| `list` | `node scripts/agent-storage.js list '<json>'` | List files in a cloud directory |\n| `search` | `node scripts/agent-storage.js search '<json>'` | Search files by name |\n| `mkdir` | `node scripts/agent-storage.js mkdir '<json>'` | Create a directory in cloud storage |\n| `rename` | `node scripts/agent-storage.js rename '<json>'` | Rename or move a file/directory in cloud storage |\n\n## Setup\n\n### Prerequisites\n\n此 skill 需要 **Node.js ≥ 14** 和 **npm**。Agent 在首次执行前**必须检测运行环境**：\n\n```bash\nnode --version   # 期望输出 v14.x 或更高\nnpm --version\n```\n\n如果 `node` 命令不存在或版本低于 14，直接安装：\n\n根据用户系统自动选择安装方式：\n\n```bash\n# macOS (Homebrew)\nbrew install node\n\n# macOS (无 Homebrew)\ncurl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg\n\n# Linux (Debian/Ubuntu)\ncurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs\n\n# Linux (其他发行版 / 通用)\ncurl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1\n\n# Windows (PowerShell, 管理员)\nwinget install OpenJS.NodeJS.LTS\n\n# Windows (无 winget)\n# 下载安装包: https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi 并运行\n\n# 跨平台 (已有 nvm)\nnvm install --lts\n```\n\n此 skill 还依赖 `smh-node-sdk` npm 包（**要求 ^1.0.9**）。**必须在使用前完成安装**（二选一）：\n\n```bash\n# 方式一：全局安装（推荐）\nnpm install -g smh-node-sdk@^1.0.9\n\n# 方式二：本地安装到项目目录\nnpm install smh-node-sdk@^1.0.9\n```\n\n> 脚本会按以下顺序查找 SDK：当前项目 node_modules → 全局 node_modules。如果未找到，脚本会报错并提示安装命令。\n\n### About the upload script\n\n此 skill 的运行脚本位于 `scripts/agent-storage.js`。Agent 直接通过 `node scripts/agent-storage.js <command> '<json>'` 调用，**无需额外写入临时文件**。脚本源码可在 `scripts/` 目录中审阅。\n\n### Credential configuration\n\n凭证从以下配置文件中自动加载（优先级从高到低）。\n\n> **安全说明**：脚本仅读取配置文件中 `smh_` 前缀的环境变量（`smh_libraryId`、`smh_accessToken` 等），不会访问配置文件中的其他字段或敏感信息。\n\n> **关于 token 权限**：Tencent Agent Storage 的文件上传和下载链接生成 API 要求 `space_admin` 级别的 accessToken，这是 Tencent Agent Storage 服务端对文件写入操作的最低权限要求。\n\n**模式一：直接凭证（accessToken）**\n\n凭证文件查找顺序（先找到者优先）：\n\n1. **通用配置** — `~/.tencentAgentStorage/.env`\n2. **OpenClaw** — `~/.openclaw/openclaw.json` 的 `env` 字段\n3. **Hermes** — `~/.hermes/.env`\n\n**通用配置（推荐）** — 在 `~/.tencentAgentStorage/.env` 中配置：\n\n```env\n# ~/.tencentAgentStorage/.env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n**OpenClaw** — 在 `~/.openclaw/openclaw.json` 的 `env` 字段中配置：\n\n```json\n{\n  \"env\": {\n    \"smh_basePath\": \"https://api.tencentsmh.cn\",\n    \"smh_libraryId\": \"smhxxx-xxxxx\",\n    \"smh_spaceId\": \"space-xxxxx\",\n    \"smh_accessToken\": \"<your-access-token>\"\n  }\n}\n```\n\n**Hermes** — 在 `~/.hermes/.env` 中配置：\n\n```env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n\n---\n\n## Procedure\n\nAgent uses this skill in any scenario that requires uploading files to the cloud.\n\n### Complete flow\n\n```\nUser triggers file upload\n  → Step 1: Identify the local file path(s)\n  → Step 2: Run upload script (loop for batch)\n  → Step 3: Extract downloadUrl from JSON output (signed COS URL)\n  → Step 4: Deliver the download link with execution notice\n```\n\n> **IMPORTANT**: 默认使用 `conflictStrategy: \"rename\"` 上传。当云端已存在同名文件时，脚本会自动重命名（如 `file(1).pdf`），确保上传始终成功并返回正确的下载链接。**只有用户明确说了 \"覆盖\"/\"替换\" 时，才使用 `conflictStrategy: \"overwrite\"`；用户明确要求先确认时，才使用 `conflictStrategy: \"ask\"`。**\n\n### Step 2: Upload\n\n**Single file (默认):**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file.pdf\",\"conflictStrategy\":\"rename\"}'\n```\n\n**Upload to specific directory:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/photo.jpg\",\"remotePath\":\"photos/photo.jpg\",\"conflictStrategy\":\"rename\"}'\n```\n\n**User explicitly requested overwrite:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"overwrite\"}'\n```\n\n**Batch upload:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file1.pdf\",\"conflictStrategy\":\"rename\"}'\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file2.docx\",\"conflictStrategy\":\"rename\"}'\n```\n\n#### Conflict handling\n\nWhen using `conflictStrategy: \"rename\"` (默认), if a same-name file already exists, the script automatically renames the file (e.g. `file(1).pdf`) and completes the upload, ensuring a valid download link is always returned.\n\nWhen using `conflictStrategy: \"ask\"`, if a same-name file already exists, the script returns `{\"success\":false,\"conflict\":true}`. Agent must then ask the user:\n\n> 云端已存在同名文件 `{filename}`，你想怎么处理？\n>\n> 1. 🔄 覆盖 — 替换云端文件\n> 2. 📝 重命名 — 自动改名上传（如 file(1).pdf）\n> 3. ❌ 取消 — 不上传\n\n**三种策略对照：**\n\n| Strategy | Behavior | When to use |\n|----------|----------|-------------|\n| `rename` (**默认**) | 同名文件存在时自动重命名，确保上传成功并返回正确链接 | 大多数场景，需要保证用户拿到下载链接 |\n| `overwrite` | 直接覆盖已有文件 | 用户明确说 \"覆盖\", \"替换\", \"更新文件\" |\n| `ask` | 同名文件存在时返回错误，Agent 询问用户 | 用户明确要求先确认时 |\n\n### Step 4: Deliver link + execution notice\n\nAfter every successful upload, include this notice alongside the download link(s):\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n\n**链接输出规则（MUST）：**\n1. **必须使用带 COS 签名的直链**（`downloadUrl` 字段），域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`\n2. **禁止输出含 `accessToken` 的中转链接**（如 `https://api.tencentsmh.cn/...?access_token=...`），这会泄露凭证\n3. **链接必须完整输出，禁止任何形式的截断、省略或缩写**——不能用 `...`、`<省略>` 等替代任何部分。签名链接通常很长，这是正常的\n\n**Single file example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 已上传文件: report.pdf  大小: (2.3 MB)\n> 下载链接: {脚本返回的完整 downloadUrl，原样输出，不得截断}\n\n**Batch example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 📎 report.pdf (2.3 MB) — {完整 downloadUrl}\n> 📎 photo.jpg (1.1 MB) — {完整 downloadUrl}\n\n---\n\n## File Size Support\n\n**There is NO file size limit.** The upload script supports files of any size, including multi-GB videos.\n\n- **Small files (≤ 50 MB)**: Single-part upload.\n- **Large files (> 50 MB)**: Multipart upload — the file is read in 5 MB chunks, never loaded entirely into memory.\n\n---\n\n## Commands\n\n所有命令输出 JSON 到 stdout。\n\n### upload\n\n```bash\nnode scripts/agent-storage.js upload '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标路径，省略则上传到根目录并保留原文件名\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n- `purpose`（可选）：`download`（默认，链接点击触发下载）| `preview`（链接在浏览器内预览）\n- `expireHours`（可选）：链接有效期，单位为小时，默认 `2`（即 2 小时）\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"upload\": {\n    \"localFile\": \"/path/to/photo.jpg\",\n    \"remotePath\": \"photo.jpg\",\n    \"fileSize\": 2048576,\n    \"fileSizeHuman\": \"2.0 MB\",\n    \"uploadTime\": \"3.2s\",\n    \"rapidUpload\": false\n  },\n  \"downloadUrl\": \"https://smhxxxxx.gz-c1.smhshare.com/s/xxxxxxxxxx\"\n}\n```\n\n### uploadDir\n\n```bash\nnode scripts/agent-storage.js uploadDir '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件夹绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标目录路径，省略则使用本地文件夹名称\n- `conflictStrategy`（可选）：`rename`（默认）| `overwrite`\n\n**说明：**\n- 递归上传整个文件夹，自动保留目录结构\n- 会先在云端创建对应的目录层级，再逐个上传文件\n- 文件按顺序上传（不并行），避免 API 过载\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"uploadDir\": {\n    \"localPath\": \"/path/to/my-folder\",\n    \"remotePath\": \"my-folder\",\n    \"totalFiles\": 5,\n    \"successCount\": 5,\n    \"failCount\": 0,\n    \"totalSize\": 10485760,\n    \"totalSizeHuman\": \"10.0 MB\",\n    \"uploadTime\": \"8.5s\"\n  },\n  \"files\": [\n    { \"file\": \"doc.pdf\", \"size\": 2048576, \"sizeHuman\": \"2.0 MB\", \"success\": true },\n    { \"file\": \"images/photo.jpg\", \"size\": 1048576, \"sizeHuman\": \"1.0 MB\", \"success\": true }\n  ]\n}\n```\n\n### info\n\n```bash\nnode scripts/agent-storage.js info '<json>'\n```\n\n**JSON 参数：**\n- `remotePath`（必填）：云端文件路径\n- `purpose`（可选）：`download`（默认，链接点击触发下载）| `preview`（链接在浏览器内预览）\n- `expireHours`（可选）：链接有效期，单位为小时，默认 `2`（即 2 小时）\n- `basePath` / `libraryId` / `spaceId` / `accessToken`（可选）：直接传参模式凭证\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"remotePath\": \"report.pdf\",\n  \"downloadUrl\": \"https://smhxxxxx.gz-c1.smhshare.com/s/xxxxxxxxxx\",\n  \"fileInfo\": {\n    \"name\": \"report.pdf\",\n    \"size\": 2048576,\n    \"type\": \"application/pdf\",\n    \"creationTime\": \"2026-03-13T10:00:00Z\",\n    \"modificationTime\": \"2026-03-13T10:00:00Z\"\n  }\n}\n```\n\n### list\n\n```bash\nnode scripts/agent-storage.js list '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（可选）：目录路径，默认 `/`\n- `limit`（可选）：最大返回数量，默认 50\n\n### search\n\n```bash\nnode scripts/agent-storage.js search '<json>'\n```\n\n**JSON 参数：**\n- `keywords`（必填）：搜索关键字，字符串或字符串数组（数组元素间为\"或\"关系）\n- `scope`（可选）：搜索范围目录路径，如 `photos`；不填则搜索整个空间\n- `limit`（可选）：最大返回数量，默认 20，取值范围 [1, 100]\n- `marker`（可选）：分页标识，用于获取后续页\n- `inExtnames`（可选）：限定文件后缀，字符串或字符串数组，如 `[\"pdf\",\"docx\"]`\n- `excludeExtnames`（可选）：排除文件后缀，字符串或字符串数组\n- `fileTypes`（可选）：文件类型过滤，取值 `all` | `dir` | `file` | `symlink`\n\n> **注意**：搜索仅支持按文件名匹配（`type: \"filename\"`），不支持全文内容检索。\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"keywords\": [\"报告\"],\n  \"type\": \"filename\",\n  \"total\": 3,\n  \"nextMarker\": null,\n  \"results\": [\n    {\n      \"name\": \"周报告.pdf\",\n      \"type\": \"file\",\n      \"size\": 2048576,\n      \"sizeHuman\": \"2.0 MB\",\n      \"contentType\": \"application/pdf\",\n      \"creationTime\": \"2026-03-13T10:00:00Z\",\n      \"modificationTime\": \"2026-03-13T10:00:00Z\",\n      \"text\": null,\n      \"textPage\": null,\n    }\n  ]\n}\n```\n\n### mkdir\n\n```bash\nnode scripts/agent-storage.js mkdir '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（必填）：要创建的文件夹路径，如 `photos` 或 `docs/2026`\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"dirPath\": \"photos\",\n  \"message\": \"文件夹 \\\"photos\\\" 创建成功\"\n}\n```\n\n### rename\n\n```bash\nnode scripts/agent-storage.js rename '<json>'\n```\n\n**JSON 参数：**\n- `fromPath`（必填）：源文件/文件夹的云端路径\n- `toPath`（必填）：目标路径（重命名后的路径）\n- `conflictStrategy`（可选）：`rename`（默认）| `overwrite`\n\n**说明：**\n- 支持文件和文件夹的重命名\n- 支持移动文件到其他目录（改变路径即为移动）\n- 重命名示例：`{\"fromPath\":\"docs/old.pdf\",\"toPath\":\"docs/new.pdf\"}`\n- 移动示例：`{\"fromPath\":\"docs/file.pdf\",\"toPath\":\"archive/file.pdf\"}`\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"from\": \"docs/old.pdf\",\n  \"to\": \"docs/new.pdf\",\n  \"message\": \"\\\"docs/old.pdf\\\" 已重命名为 \\\"docs/new.pdf\\\"\"\n}\n```\n\n---\n\n## Full Example\n\n```bash\n# Step 0: 安装 smh-node-sdk（首次使用前执行一次）\nnpm install -g smh-node-sdk@^1.0.9\n\n# Step 1: 上传文件\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"rename\"}'\n\n# Step 2: 查询文件信息\nnode scripts/agent-storage.js info '{\"remotePath\":\"report.pdf\"}'\n\n# Step 3: 列出云端文件\nnode scripts/agent-storage.js list '{\"dirPath\":\"/\",\"limit\":20}'\n\n# Step 4: 搜索文件（按文件名）\nnode scripts/agent-storage.js search '{\"keywords\":\"report\"}'\n\n# Step 5: 上传整个文件夹\nnode scripts/agent-storage.js uploadDir '{\"localPath\":\"/path/to/my-folder\",\"conflictStrategy\":\"rename\"}'\n\n# Step 6: 创建文件夹\nnode scripts/agent-storage.js mkdir '{\"dirPath\":\"photos\"}'\n\n# Step 7: 重命名/移动文件\nnode scripts/agent-storage.js rename '{\"fromPath\":\"report.pdf\",\"toPath\":\"archive/report-2026.pdf\"}'\n```\n\n---\n\n## Pitfalls\n\n### Error handling\n\n所有命令输出 JSON 到 stdout。错误也以 JSON 返回：`{\"success\": false, \"error\": \"...\"}`\n\n| 错误 | 处理方式 |\n|------|---------|\n| 上传失败（`success: false`） | 告诉用户：\"文件上传失败：{具体原因}。你可以稍后再试，或者检查网络连接。\" |\n| 同名冲突（`conflict: true`） | 询问用户选择覆盖、重命名或取消 |\n| 文件不存在 | 让用户确认路径 |\n| 网络错误 | 重试 2 次，间隔 3s；仍失败告知用户 |\n| 配置缺失 | 提示用户在 `~/.tencentAgentStorage/.env`、`~/.openclaw/openclaw.json` 的 `env` 字段或 `~/.hermes/.env` 中添加 `smh_*` 配置 |\n\n**上传失败对话模板**（当 `success: false` 时必须使用）：\n\n> ❌ 文件上传失败：{error 中的具体原因}。\n>\n> 你可以：\n> 1. 🔄 重试 — 重新上传这个文件\n> 2. ❌ 取消 — 暂时不上传\n\n### Prohibited actions\n\n- **NEVER** 在 `success: false` 时展示下载链接\n- **NEVER** 在上传失败时不告知用户，必须明确提示\"文件上传失败\"及原因\n- **NEVER** 硬编码或暴露 SMH 凭证给用户\n- **NEVER** 未经用户主动要求就上传其本地个人文件\n- **NEVER** 跳过执行通知：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n- **NEVER** 在用户未明确要求覆盖时使用 `conflictStrategy: \"overwrite\"`\n- **NEVER** 把含 `accessToken` 的中转链接（如 `https://api.tencentsmh.cn/...?access_token=...`）发给用户。返回给用户的**必须是带 COS 签名的直链**（域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`），即脚本输出的 `downloadUrl` 字段\n- **NEVER** 截断、省略或用 `...` 缩写链接。发给用户的下载链接/预览链接**必须是脚本返回的完整 URL**，一个字符都不能少。链接通常很长（含签名参数），这是正常的，**必须原样完整输出**\n\n### Common mistakes\n\n- 用户说\"上传文件\"但没指定路径 → 追问：\"你要上传哪个文件？告诉我文件路径或文件名就行。\"\n- 用户说\"确定上传 xxx\"或\"把 xxx 发给我\" → 直接执行上传（`conflictStrategy: \"rename\"`）\n- **同名文件冲突**：默认使用 `conflictStrategy: \"rename\"`，自动重命名保证上传成功。只有用户明确要求覆盖时才用 `overwrite`，用户明确要求先确认时才用 `ask`\n- 文件默认上传到云空间根目录，用户可通过 `remotePath` 参数指定目标路径\n- 下载链接为通过 SDK `infoFile({ purpose: 'download' })` 获取的带签名 COS 直链（`https://bucket-xxxxx.tencentsmhuc.cn/...?q-sign-algorithm=sha1&q-signature=...`），可直接在浏览器或手机中打开预览/下载，**有效期约 2 小时**。**必须原样完整输出此链接，禁止截断或省略任何部分**\n- 批量上传按顺序处理（不并行），避免 API 过载\n- **执行通知**：每次上传完成后必须告知用户：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\n---\n\n## Verification\n\nUpload was successful when ALL of the following are true:\n\n1. Script output contains `\"success\": true`\n2. `downloadUrl` field is present and non-empty\n3. Agent delivered the download link to the user with the execution notice: \"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\nTo verify a previously uploaded file still exists:\n\n```bash\nnode scripts/agent-storage.js info '{\"remotePath\":\"<filename>\"}'\n```\n\nIf the response contains `\"success\": true`, the file is accessible and a fresh download link is returned.\n\nFile v1.0.17:_meta.json\n\n{\n  \"ownerId\": \"kn75r0rammt45k8qe5we0sh63580c5y0\",\n  \"slug\": \"tencent-agent-storage\",\n  \"version\": \"1.0.17\",\n  \"publishedAt\": 1784861022392\n}\n\nFile v1.0.17:skill-card.md\n\n## Description:\n\nTencent Agent Storage lets an agent upload, list, search, rename, move, and share files in a user's Tencent Agent Storage cloud drive.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[shawnminh](https://clawhub.ai/user/shawnminh)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users and their agents use this skill to manage personal cloud-drive files, upload generated artifacts, and provide time-limited download or preview links across devices.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Administrative Tencent storage tokens can be exposed or overused if shared broadly.\n\nMitigation: Use a dedicated Tencent storage token with the least privilege available, keep credential files private, and never display access-token based URLs to users.\n\nRisk: Broad activation language can lead to unintended uploads of local files or directories.\n\nMitigation: Require the user to identify the exact file or directory before upload, and confirm before uploading sensitive or unexpected content.\n\nRisk: Setup guidance includes curl-to-sudo and global npm installation paths.\n\nMitigation: Prefer reviewed local installation with pinned dependencies, and avoid piping remote setup scripts into privileged package installation.\n\nRisk: A modified endpoint could direct storage operations away from the intended Tencent service.\n\nMitigation: Keep smh_basePath fixed to the legitimate Tencent endpoint unless the publisher and deployment owner explicitly approve a different endpoint.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/shawnminh/skills/tencent-agent-storage)\n- [Publisher profile](https://clawhub.ai/user/shawnminh)\n- [Tencent Agent Storage API endpoint](https://api.tencentsmh.cn)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with shell commands and JSON command results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Successful uploads return complete, time-limited downloadUrl links; search is limited to filename matching.]\n\n## Skill Version(s):\n\n1.0.17 (source: server release metadata; artifact frontmatter says 1.0.11)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.16: 4 files, 14938 bytes\n\nFiles: scripts/agent-storage.js (18435b), skill-card.md (2152b), SKILL.md (21296b), _meta.json (141b)\n\nFile v1.0.16:SKILL.md\n\n---\nname: tencent-agent-storage\nversion: 1.0.8\nauthor: shawnmzhang\nlicense: MIT\ndescription: |\n  Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\n  Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\n  MUST trigger when the user mentions ANY of the following concepts:\n  【云盘/网盘相关 — Cloud Drive Access】\n  - \"网盘\", \"云盘\", \"云空间\", \"龙虾盘\", \"龙虾云盘\", \"龙虾网盘\", \"龙虾空间\"\n  - \"专属云盘\", \"专属网盘\", \"专属空间\", \"我的云盘\", \"我的网盘\", \"我的龙虾\"\n  - \"打开网盘\", \"打开云盘\", \"进入网盘\", \"进入云盘\", \"看看云盘\", \"看看网盘\"\n  - \"cloud drive\", \"my drive\", \"open drive\", \"lobster drive\"\n  【文件列表/查看 — File Listing & Browsing】\n  - \"列出文件\", \"有哪些文件\", \"看看文件\", \"文件列表\", \"我的文件\"\n  - \"云盘里有什么\", \"空间里有啥\", \"查看云空间\", \"云空间文件\"\n  - \"list files\", \"show files\", \"my files\", \"what files\", \"browse files\"\n  【上传/备份 — Upload & Backup】\n  - \"上传文件\", \"上传某个文件\", \"确定上传\", \"传到云空间\", \"上传到云空间\"\n  - \"备份到云\", \"备份文件\", \"保存到云\", \"存到网盘\", \"传到网盘\", \"存到云盘\", \"传到云盘\"\n  - \"文件传一下\", \"帮我传个文件\", \"把这个存一下\"\n  - \"upload\", \"backup\", \"save to cloud\", \"back up\"\n  【发送/传输给用户 — Send & Deliver Files】\n  - \"把文件发给我\", \"整理好发我\", \"发到手机\", \"传到手机\"\n  - \"做完了发我一份\", \"弄好了发给我\", \"完成后把文件给我\"\n  - \"导出之后发我\", \"生成完发给我看看\", \"跑完了把结果给我\"\n  - \"send file\", \"send to phone\", \"deliver file\", \"give me the file\"\n  【链接/分享 — Links & Sharing】\n  - \"生成下载链接\", \"做成链接\", \"给我下载链接\"\n  - \"生成个链接发给同事\", \"发到群里\", \"分享文件\", \"分享给别人\", \"发个链接\"\n  - \"download link\", \"share file\", \"share link\", \"generate link\"\n  【文件状态查询 — File Status Check】\n  - \"这个云文件还在吗\", \"之前上传的文件还能下吗\", \"链接过期了能重新生成吗\"\n  - \"is file still there\", \"can I still download\", \"regenerate link\"\n  【文件搜索/检索 — File Search】\n  - \"搜索文件\", \"搜一下\", \"找文件\", \"找一下\", \"查找\", \"检索文件\"\n  - \"搜索云盘\", \"在云盘里搜\", \"帮我找个文件\", \"有没有叫xxx的文件\"\n  - \"search files\", \"find file\", \"search cloud\"\n  【隐式触发 — Implicit Triggers】\n  - When a task produces output files (reports, exports, generated content) that need to be delivered to the user\n  - When the user's intent implies needing a file on another device, even without explicitly saying \"upload\"\n  - When MyClaw/agent needs to upload files to generate download links\n  - Any mention of file transfer, cloud storage, or personal file space in the conversation context\nmetadata: {}\n---\n\n# Tencent Agent Storage (云文件上传备份工具)\n\n将本地文件上传至 Tencent Agent Storage，自动生成下载链接和图片预览。上传的文件存储在用户独有的云盘空间中，支持跨端访问——无论是手机、电脑还是平板，用户都可以随时随地查看和下载自己的文件。\n\n## When to Use\n\nAgent **MUST** activate this skill when any of the following conditions are met:\n\n- User mentions cloud drive keywords: 网盘、云盘、云空间、龙虾盘、专属网盘、cloud drive, my drive\n- User requests file listing or browsing: 列出文件、有哪些文件、list files, show files\n- User requests upload or backup: 上传文件、备份到云、存到网盘、upload, backup, save to cloud\n- User asks to send/deliver files: 把文件发给我、发到手机、send file, deliver file\n- User requests links or sharing: 生成下载链接、分享文件、download link, share link\n- User queries file status: 这个云文件还在吗、链接过期了、is file still there\n- User requests file search: 搜索文件、找文件、检索文件、搜索云盘、search files, find file\n- **Implicit**: A task produces output files that need to be delivered to the user, or the user's intent implies needing a file on another device\n\n## Quick Reference\n\n| Command | Usage | Description |\n|---------|-------|-------------|\n| `upload` | `node scripts/agent-storage.js upload '<json>'` | Upload local file to cloud, returns download link |\n| `uploadDir` | `node scripts/agent-storage.js uploadDir '<json>'` | Upload entire folder to cloud, preserving directory structure |\n| `info` | `node scripts/agent-storage.js info '<json>'` | Get file info and regenerate download link |\n| `list` | `node scripts/agent-storage.js list '<json>'` | List files in a cloud directory |\n| `search` | `node scripts/agent-storage.js search '<json>'` | Search files by name |\n| `mkdir` | `node scripts/agent-storage.js mkdir '<json>'` | Create a directory in cloud storage |\n\n## Setup\n\n### Prerequisites\n\n此 skill 需要 **Node.js ≥ 14** 和 **npm**。Agent 在首次执行前**必须检测运行环境**：\n\n```bash\nnode --version   # 期望输出 v14.x 或更高\nnpm --version\n```\n\n如果 `node` 命令不存在或版本低于 14，直接安装：\n\n根据用户系统自动选择安装方式：\n\n```bash\n# macOS (Homebrew)\nbrew install node\n\n# macOS (无 Homebrew)\ncurl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg\n\n# Linux (Debian/Ubuntu)\ncurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs\n\n# Linux (其他发行版 / 通用)\ncurl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1\n\n# Windows (PowerShell, 管理员)\nwinget install OpenJS.NodeJS.LTS\n\n# Windows (无 winget)\n# 下载安装包: https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi 并运行\n\n# 跨平台 (已有 nvm)\nnvm install --lts\n```\n\n此 skill 还依赖 `smh-node-sdk` npm 包（**要求 ^1.0.8**）。**必须在使用前完成安装**（二选一）：\n\n```bash\n# 方式一：全局安装（推荐）\nnpm install -g smh-node-sdk@^1.0.8\n\n# 方式二：本地安装到项目目录\nnpm install smh-node-sdk@^1.0.8\n```\n\n> 脚本会按以下顺序查找 SDK：当前项目 node_modules → 全局 node_modules。如果未找到，脚本会报错并提示安装命令。\n\n### About the upload script\n\n此 skill 的运行脚本位于 `scripts/agent-storage.js`。Agent 直接通过 `node scripts/agent-storage.js <command> '<json>'` 调用，**无需额外写入临时文件**。脚本源码可在 `scripts/` 目录中审阅。\n\n### Credential configuration\n\n凭证从以下配置文件中自动加载（优先级从高到低）。\n\n> **安全说明**：脚本仅读取配置文件中 `smh_` 前缀的环境变量（`smh_libraryId`、`smh_accessToken` 等），不会访问配置文件中的其他字段或敏感信息。\n\n> **关于 token 权限**：Tencent Agent Storage 的文件上传和下载链接生成 API 要求 `space_admin` 级别的 accessToken，这是 Tencent Agent Storage 服务端对文件写入操作的最低权限要求。\n\n**模式一：直接凭证（accessToken）**\n\n凭证文件查找顺序（先找到者优先）：\n\n1. **通用配置** — `~/.tencentAgentStorage/.env`\n2. **OpenClaw** — `~/.openclaw/openclaw.json` 的 `env` 字段\n3. **Hermes** — `~/.hermes/.env`\n\n**通用配置（推荐）** — 在 `~/.tencentAgentStorage/.env` 中配置：\n\n```env\n# ~/.tencentAgentStorage/.env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n**OpenClaw** — 在 `~/.openclaw/openclaw.json` 的 `env` 字段中配置：\n\n```json\n{\n  \"env\": {\n    \"smh_basePath\": \"https://api.tencentsmh.cn\",\n    \"smh_libraryId\": \"smhxxx-xxxxx\",\n    \"smh_spaceId\": \"space-xxxxx\",\n    \"smh_accessToken\": \"<your-access-token>\"\n  }\n}\n```\n\n**Hermes** — 在 `~/.hermes/.env` 中配置：\n\n```env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n\n---\n\n## Procedure\n\nAgent uses this skill in any scenario that requires uploading files to the cloud.\n\n### Complete flow\n\n```\nUser triggers file upload\n  → Step 1: Identify the local file path(s)\n  → Step 2: Run upload script (loop for batch)\n  → Step 3: Extract downloadUrl from JSON output (signed COS URL)\n  → Step 4: Deliver the download link with execution notice\n```\n\n> **IMPORTANT**: 默认使用 `conflictStrategy: \"rename\"` 上传。当云端已存在同名文件时，脚本会自动重命名（如 `file(1).pdf`），确保上传始终成功并返回正确的下载链接。**只有用户明确说了 \"覆盖\"/\"替换\" 时，才使用 `conflictStrategy: \"overwrite\"`；用户明确要求先确认时，才使用 `conflictStrategy: \"ask\"`。**\n\n### Step 2: Upload\n\n**Single file (默认):**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file.pdf\",\"conflictStrategy\":\"rename\"}'\n```\n\n**Upload to specific directory:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/photo.jpg\",\"remotePath\":\"photos/photo.jpg\",\"conflictStrategy\":\"rename\"}'\n```\n\n**User explicitly requested overwrite:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"overwrite\"}'\n```\n\n**Batch upload:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file1.pdf\",\"conflictStrategy\":\"rename\"}'\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file2.docx\",\"conflictStrategy\":\"rename\"}'\n```\n\n#### Conflict handling\n\nWhen using `conflictStrategy: \"rename\"` (默认), if a same-name file already exists, the script automatically renames the file (e.g. `file(1).pdf`) and completes the upload, ensuring a valid download link is always returned.\n\nWhen using `conflictStrategy: \"ask\"`, if a same-name file already exists, the script returns `{\"success\":false,\"conflict\":true}`. Agent must then ask the user:\n\n> 云端已存在同名文件 `{filename}`，你想怎么处理？\n>\n> 1. 🔄 覆盖 — 替换云端文件\n> 2. 📝 重命名 — 自动改名上传（如 file(1).pdf）\n> 3. ❌ 取消 — 不上传\n\n**三种策略对照：**\n\n| Strategy | Behavior | When to use |\n|----------|----------|-------------|\n| `rename` (**默认**) | 同名文件存在时自动重命名，确保上传成功并返回正确链接 | 大多数场景，需要保证用户拿到下载链接 |\n| `overwrite` | 直接覆盖已有文件 | 用户明确说 \"覆盖\", \"替换\", \"更新文件\" |\n| `ask` | 同名文件存在时返回错误，Agent 询问用户 | 用户明确要求先确认时 |\n\n### Step 4: Deliver link + execution notice\n\nAfter every successful upload, include this notice alongside the download link(s):\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n\n**链接输出规则（MUST）：**\n1. **必须使用带 COS 签名的直链**（`downloadUrl` 字段），域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`\n2. **禁止输出含 `accessToken` 的中转链接**（如 `https://api.tencentsmh.cn/...?access_token=...`），这会泄露凭证\n3. **链接必须完整输出，禁止任何形式的截断、省略或缩写**——不能用 `...`、`<省略>` 等替代任何部分。签名链接通常很长，这是正常的\n\n**Single file example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 已上传文件: report.pdf  大小: (2.3 MB)\n> 下载链接: {脚本返回的完整 downloadUrl，原样输出，不得截断}\n\n**Batch example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 📎 report.pdf (2.3 MB) — {完整 downloadUrl}\n> 📎 photo.jpg (1.1 MB) — {完整 downloadUrl}\n\n---\n\n## File Size Support\n\n**There is NO file size limit.** The upload script supports files of any size, including multi-GB videos.\n\n- **Small files (≤ 50 MB)**: Single-part upload.\n- **Large files (> 50 MB)**: Multipart upload — the file is read in 5 MB chunks, never loaded entirely into memory.\n\n---\n\n## Commands\n\n所有命令输出 JSON 到 stdout。\n\n### upload\n\n```bash\nnode scripts/agent-storage.js upload '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标路径，省略则上传到根目录并保留原文件名\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n- `purpose`（可选）：`download`（默认，链接点击触发下载）| `preview`（链接在浏览器内预览）\n- `expireHours`（可选）：链接有效期，单位为小时，默认 `2`（即 2 小时）\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"upload\": {\n    \"localFile\": \"/path/to/photo.jpg\",\n    \"remotePath\": \"photo.jpg\",\n    \"fileSize\": 2048576,\n    \"fileSizeHuman\": \"2.0 MB\",\n    \"uploadTime\": \"3.2s\",\n    \"rapidUpload\": false\n  },\n  \"downloadUrl\": \"https://smhxxxxx.gz-c1.smhshare.com/s/xxxxxxxxxx\"\n}\n```\n\n### uploadDir\n\n```bash\nnode scripts/agent-storage.js uploadDir '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件夹绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标目录路径，省略则使用本地文件夹名称\n- `conflictStrategy`（可选）：`rename`（默认）| `overwrite`\n\n**说明：**\n- 递归上传整个文件夹，自动保留目录结构\n- 会先在云端创建对应的目录层级，再逐个上传文件\n- 文件按顺序上传（不并行），避免 API 过载\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"uploadDir\": {\n    \"localPath\": \"/path/to/my-folder\",\n    \"remotePath\": \"my-folder\",\n    \"totalFiles\": 5,\n    \"successCount\": 5,\n    \"failCount\": 0,\n    \"totalSize\": 10485760,\n    \"totalSizeHuman\": \"10.0 MB\",\n    \"uploadTime\": \"8.5s\"\n  },\n  \"files\": [\n    { \"file\": \"doc.pdf\", \"size\": 2048576, \"sizeHuman\": \"2.0 MB\", \"success\": true },\n    { \"file\": \"images/photo.jpg\", \"size\": 1048576, \"sizeHuman\": \"1.0 MB\", \"success\": true }\n  ]\n}\n```\n\n### info\n\n```bash\nnode scripts/agent-storage.js info '<json>'\n```\n\n**JSON 参数：**\n- `remotePath`（必填）：云端文件路径\n- `purpose`（可选）：`download`（默认，链接点击触发下载）| `preview`（链接在浏览器内预览）\n- `expireHours`（可选）：链接有效期，单位为小时，默认 `2`（即 2 小时）\n- `basePath` / `libraryId` / `spaceId` / `accessToken`（可选）：直接传参模式凭证\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"remotePath\": \"report.pdf\",\n  \"downloadUrl\": \"https://smhxxxxx.gz-c1.smhshare.com/s/xxxxxxxxxx\",\n  \"fileInfo\": {\n    \"name\": \"report.pdf\",\n    \"size\": 2048576,\n    \"type\": \"application/pdf\",\n    \"creationTime\": \"2026-03-13T10:00:00Z\",\n    \"modificationTime\": \"2026-03-13T10:00:00Z\"\n  }\n}\n```\n\n### list\n\n```bash\nnode scripts/agent-storage.js list '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（可选）：目录路径，默认 `/`\n- `limit`（可选）：最大返回数量，默认 50\n\n### search\n\n```bash\nnode scripts/agent-storage.js search '<json>'\n```\n\n**JSON 参数：**\n- `keywords`（必填）：搜索关键字，字符串或字符串数组（数组元素间为\"或\"关系）\n- `scope`（可选）：搜索范围目录路径，如 `photos`；不填则搜索整个空间\n- `limit`（可选）：最大返回数量，默认 20，取值范围 [1, 100]\n- `marker`（可选）：分页标识，用于获取后续页\n- `inExtnames`（可选）：限定文件后缀，字符串或字符串数组，如 `[\"pdf\",\"docx\"]`\n- `excludeExtnames`（可选）：排除文件后缀，字符串或字符串数组\n- `fileTypes`（可选）：文件类型过滤，取值 `all` | `dir` | `file` | `symlink`\n\n> **注意**：搜索仅支持按文件名匹配（`type: \"filename\"`），不支持全文内容检索。\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"keywords\": [\"报告\"],\n  \"type\": \"filename\",\n  \"total\": 3,\n  \"nextMarker\": null,\n  \"results\": [\n    {\n      \"name\": \"周报告.pdf\",\n      \"type\": \"file\",\n      \"size\": 2048576,\n      \"sizeHuman\": \"2.0 MB\",\n      \"contentType\": \"application/pdf\",\n      \"creationTime\": \"2026-03-13T10:00:00Z\",\n      \"modificationTime\": \"2026-03-13T10:00:00Z\",\n      \"text\": null,\n      \"textPage\": null,\n    }\n  ]\n}\n```\n\n### mkdir\n\n```bash\nnode scripts/agent-storage.js mkdir '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（必填）：要创建的文件夹路径，如 `photos` 或 `docs/2026`\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"dirPath\": \"photos\",\n  \"message\": \"文件夹 \\\"photos\\\" 创建成功\"\n}\n```\n\n---\n\n## Full Example\n\n```bash\n# Step 0: 安装 smh-node-sdk（首次使用前执行一次）\nnpm install -g smh-node-sdk@^1.0.8\n\n# Step 1: 上传文件\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"rename\"}'\n\n# Step 2: 查询文件信息\nnode scripts/agent-storage.js info '{\"remotePath\":\"report.pdf\"}'\n\n# Step 3: 列出云端文件\nnode scripts/agent-storage.js list '{\"dirPath\":\"/\",\"limit\":20}'\n\n# Step 4: 搜索文件（按文件名）\nnode scripts/agent-storage.js search '{\"keywords\":\"report\"}'\n\n# Step 5: 上传整个文件夹\nnode scripts/agent-storage.js uploadDir '{\"localPath\":\"/path/to/my-folder\",\"conflictStrategy\":\"rename\"}'\n\n# Step 6: 创建文件夹\nnode scripts/agent-storage.js mkdir '{\"dirPath\":\"photos\"}'\n```\n\n---\n\n## Pitfalls\n\n### Error handling\n\n所有命令输出 JSON 到 stdout。错误也以 JSON 返回：`{\"success\": false, \"error\": \"...\"}`\n\n| 错误 | 处理方式 |\n|------|---------|\n| 上传失败（`success: false`） | 告诉用户：\"文件上传失败：{具体原因}。你可以稍后再试，或者检查网络连接。\" |\n| 同名冲突（`conflict: true`） | 询问用户选择覆盖、重命名或取消 |\n| 文件不存在 | 让用户确认路径 |\n| 网络错误 | 重试 2 次，间隔 3s；仍失败告知用户 |\n| 配置缺失 | 提示用户在 `~/.tencentAgentStorage/.env`、`~/.openclaw/openclaw.json` 的 `env` 字段或 `~/.hermes/.env` 中添加 `smh_*` 配置 |\n\n**上传失败对话模板**（当 `success: false` 时必须使用）：\n\n> ❌ 文件上传失败：{error 中的具体原因}。\n>\n> 你可以：\n> 1. 🔄 重试 — 重新上传这个文件\n> 2. ❌ 取消 — 暂时不上传\n\n### Prohibited actions\n\n- **NEVER** 在 `success: false` 时展示下载链接\n- **NEVER** 在上传失败时不告知用户，必须明确提示\"文件上传失败\"及原因\n- **NEVER** 硬编码或暴露 SMH 凭证给用户\n- **NEVER** 未经用户主动要求就上传其本地个人文件\n- **NEVER** 跳过执行通知：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n- **NEVER** 在用户未明确要求覆盖时使用 `conflictStrategy: \"overwrite\"`\n- **NEVER** 把含 `accessToken` 的中转链接（如 `https://api.tencentsmh.cn/...?access_token=...`）发给用户。返回给用户的**必须是带 COS 签名的直链**（域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`），即脚本输出的 `downloadUrl` 字段\n- **NEVER** 截断、省略或用 `...` 缩写链接。发给用户的下载链接/预览链接**必须是脚本返回的完整 URL**，一个字符都不能少。链接通常很长（含签名参数），这是正常的，**必须原样完整输出**\n\n### Common mistakes\n\n- 用户说\"上传文件\"但没指定路径 → 追问：\"你要上传哪个文件？告诉我文件路径或文件名就行。\"\n- 用户说\"确定上传 xxx\"或\"把 xxx 发给我\" → 直接执行上传（`conflictStrategy: \"rename\"`）\n- **同名文件冲突**：默认使用 `conflictStrategy: \"rename\"`，自动重命名保证上传成功。只有用户明确要求覆盖时才用 `overwrite`，用户明确要求先确认时才用 `ask`\n- 文件默认上传到云空间根目录，用户可通过 `remotePath` 参数指定目标路径\n- 下载链接为通过 SDK `infoFile({ purpose: 'download' })` 获取的带签名 COS 直链（`https://bucket-xxxxx.tencentsmhuc.cn/...?q-sign-algorithm=sha1&q-signature=...`），可直接在浏览器或手机中打开预览/下载，**有效期约 2 小时**。**必须原样完整输出此链接，禁止截断或省略任何部分**\n- 批量上传按顺序处理（不并行），避免 API 过载\n- **执行通知**：每次上传完成后必须告知用户：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\n---\n\n## Verification\n\nUpload was successful when ALL of the following are true:\n\n1. Script output contains `\"success\": true`\n2. `downloadUrl` field is present and non-empty\n3. Agent delivered the download link to the user with the execution notice: \"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\nTo verify a previously uploaded file still exists:\n\n```bash\nnode scripts/agent-storage.js info '{\"remotePath\":\"<filename>\"}'\n```\n\nIf the response contains `\"success\": true`, the file is accessible and a fresh download link is returned.\n\nFile v1.0.16:_meta.json\n\n{\n  \"ownerId\": \"kn75r0rammt45k8qe5we0sh63580c5y0\",\n  \"slug\": \"tencent-agent-storage\",\n  \"version\": \"1.0.16\",\n  \"publishedAt\": 1780026125915\n}\n\nFile v1.0.16:skill-card.md\n\n## Description: <br>\nCloud file storage, upload, backup, and file management tool for Tencent Agent Storage. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[shawnminh](https://clawhub.ai/user/shawnminh) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users and agents use this skill to manage a Tencent Agent Storage cloud drive, including uploading local files or folders, listing and searching stored files, creating folders, and generating download or preview links. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can upload local files and whole folders to Tencent cloud storage with weak user-confirmation boundaries. <br>\nMitigation: Require explicit user confirmation before uploading files or folders that were not specifically named, and review the selected paths before execution. <br>\nRisk: The skill relies on Tencent Agent Storage credentials that can authorize broad storage actions. <br>\nMitigation: Use a dedicated least-privilege SMH token where possible and avoid placing unrelated secrets in the referenced configuration files. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/shawnminh/tencent-agent-storage) <br>\n- [Publisher profile](https://clawhub.ai/user/shawnminh) <br>\n- [Tencent Agent Storage API endpoint](https://api.tencentsmh.cn) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands and JSON command outputs] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Commands return JSON to stdout and may produce signed download or preview URLs for uploaded files.] <br>\n\n## Skill Version(s): <br>\n1.0.16 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.15: 4 files, 15169 bytes\n\nFiles: scripts/agent-storage.js (18298b), skill-card.md (2878b), SKILL.md (21132b), _meta.json (141b)\n\nFile v1.0.15:SKILL.md\n\n---\nname: tencent-agent-storage\nversion: 1.0.8\nauthor: shawnmzhang\nlicense: MIT\ndescription: |\n  Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\n  Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\n  MUST trigger when the user mentions ANY of the following concepts:\n  【云盘/网盘相关 — Cloud Drive Access】\n  - \"网盘\", \"云盘\", \"云空间\", \"龙虾盘\", \"龙虾云盘\", \"龙虾网盘\", \"龙虾空间\"\n  - \"专属云盘\", \"专属网盘\", \"专属空间\", \"我的云盘\", \"我的网盘\", \"我的龙虾\"\n  - \"打开网盘\", \"打开云盘\", \"进入网盘\", \"进入云盘\", \"看看云盘\", \"看看网盘\"\n  - \"cloud drive\", \"my drive\", \"open drive\", \"lobster drive\"\n  【文件列表/查看 — File Listing & Browsing】\n  - \"列出文件\", \"有哪些文件\", \"看看文件\", \"文件列表\", \"我的文件\"\n  - \"云盘里有什么\", \"空间里有啥\", \"查看云空间\", \"云空间文件\"\n  - \"list files\", \"show files\", \"my files\", \"what files\", \"browse files\"\n  【上传/备份 — Upload & Backup】\n  - \"上传文件\", \"上传某个文件\", \"确定上传\", \"传到云空间\", \"上传到云空间\"\n  - \"备份到云\", \"备份文件\", \"保存到云\", \"存到网盘\", \"传到网盘\", \"存到云盘\", \"传到云盘\"\n  - \"文件传一下\", \"帮我传个文件\", \"把这个存一下\"\n  - \"upload\", \"backup\", \"save to cloud\", \"back up\"\n  【发送/传输给用户 — Send & Deliver Files】\n  - \"把文件发给我\", \"整理好发我\", \"发到手机\", \"传到手机\"\n  - \"做完了发我一份\", \"弄好了发给我\", \"完成后把文件给我\"\n  - \"导出之后发我\", \"生成完发给我看看\", \"跑完了把结果给我\"\n  - \"send file\", \"send to phone\", \"deliver file\", \"give me the file\"\n  【链接/分享 — Links & Sharing】\n  - \"生成下载链接\", \"做成链接\", \"给我下载链接\"\n  - \"生成个链接发给同事\", \"发到群里\", \"分享文件\", \"分享给别人\", \"发个链接\"\n  - \"download link\", \"share file\", \"share link\", \"generate link\"\n  【文件状态查询 — File Status Check】\n  - \"这个云文件还在吗\", \"之前上传的文件还能下吗\", \"链接过期了能重新生成吗\"\n  - \"is file still there\", \"can I still download\", \"regenerate link\"\n  【文件搜索/检索 — File Search】\n  - \"搜索文件\", \"搜一下\", \"找文件\", \"找一下\", \"查找\", \"检索文件\"\n  - \"搜索云盘\", \"在云盘里搜\", \"帮我找个文件\", \"有没有叫xxx的文件\"\n  - \"search files\", \"find file\", \"search cloud\"\n  【隐式触发 — Implicit Triggers】\n  - When a task produces output files (reports, exports, generated content) that need to be delivered to the user\n  - When the user's intent implies needing a file on another device, even without explicitly saying \"upload\"\n  - When MyClaw/agent needs to upload files to generate download links\n  - Any mention of file transfer, cloud storage, or personal file space in the conversation context\nmetadata: {}\n---\n\n# Tencent Agent Storage (云文件上传备份工具)\n\n将本地文件上传至 Tencent Agent Storage，自动生成下载链接和图片预览。上传的文件存储在用户独有的云盘空间中，支持跨端访问——无论是手机、电脑还是平板，用户都可以随时随地查看和下载自己的文件。\n\n## When to Use\n\nAgent **MUST** activate this skill when any of the following conditions are met:\n\n- User mentions cloud drive keywords: 网盘、云盘、云空间、龙虾盘、专属网盘、cloud drive, my drive\n- User requests file listing or browsing: 列出文件、有哪些文件、list files, show files\n- User requests upload or backup: 上传文件、备份到云、存到网盘、upload, backup, save to cloud\n- User asks to send/deliver files: 把文件发给我、发到手机、send file, deliver file\n- User requests links or sharing: 生成下载链接、分享文件、download link, share link\n- User queries file status: 这个云文件还在吗、链接过期了、is file still there\n- User requests file search: 搜索文件、找文件、检索文件、搜索云盘、search files, find file\n- **Implicit**: A task produces output files that need to be delivered to the user, or the user's intent implies needing a file on another device\n\n## Quick Reference\n\n| Command | Usage | Description |\n|---------|-------|-------------|\n| `upload` | `node scripts/agent-storage.js upload '<json>'` | Upload local file to cloud, returns download link |\n| `uploadDir` | `node scripts/agent-storage.js uploadDir '<json>'` | Upload entire folder to cloud, preserving directory structure |\n| `info` | `node scripts/agent-storage.js info '<json>'` | Get file info and regenerate download link |\n| `list` | `node scripts/agent-storage.js list '<json>'` | List files in a cloud directory |\n| `search` | `node scripts/agent-storage.js search '<json>'` | Search files by name |\n| `mkdir` | `node scripts/agent-storage.js mkdir '<json>'` | Create a directory in cloud storage |\n\n## Setup\n\n### Prerequisites\n\n此 skill 需要 **Node.js ≥ 14** 和 **npm**。Agent 在首次执行前**必须检测运行环境**：\n\n```bash\nnode --version   # 期望输出 v14.x 或更高\nnpm --version\n```\n\n如果 `node` 命令不存在或版本低于 14，直接安装：\n\n根据用户系统自动选择安装方式：\n\n```bash\n# macOS (Homebrew)\nbrew install node\n\n# macOS (无 Homebrew)\ncurl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg\n\n# Linux (Debian/Ubuntu)\ncurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs\n\n# Linux (其他发行版 / 通用)\ncurl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1\n\n# Windows (PowerShell, 管理员)\nwinget install OpenJS.NodeJS.LTS\n\n# Windows (无 winget)\n# 下载安装包: https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi 并运行\n\n# 跨平台 (已有 nvm)\nnvm install --lts\n```\n\n此 skill 还依赖 `smh-node-sdk` npm 包（**要求 ^1.0.8**）。**必须在使用前完成安装**（二选一）：\n\n```bash\n# 方式一：全局安装（推荐）\nnpm install -g smh-node-sdk@^1.0.8\n\n# 方式二：本地安装到项目目录\nnpm install smh-node-sdk@^1.0.8\n```\n\n> 脚本会按以下顺序查找 SDK：当前项目 node_modules → 全局 node_modules。如果未找到，脚本会报错并提示安装命令。\n\n### About the upload script\n\n此 skill 的运行脚本位于 `scripts/agent-storage.js`。Agent 直接通过 `node scripts/agent-storage.js <command> '<json>'` 调用，**无需额外写入临时文件**。脚本源码可在 `scripts/` 目录中审阅。\n\n### Credential configuration\n\n凭证从以下配置文件中自动加载（优先级从高到低）。\n\n> **安全说明**：脚本仅读取配置文件中 `smh_` 前缀的环境变量（`smh_libraryId`、`smh_accessToken` 等），不会访问配置文件中的其他字段或敏感信息。\n\n> **关于 token 权限**：Tencent Agent Storage 的文件上传和下载链接生成 API 要求 `space_admin` 级别的 accessToken，这是 Tencent Agent Storage 服务端对文件写入操作的最低权限要求。\n\n**模式一：直接凭证（accessToken）**\n\n凭证文件查找顺序（先找到者优先）：\n\n1. **通用配置** — `~/.tencentAgentStorage/.env`\n2. **OpenClaw** — `~/.openclaw/openclaw.json` 的 `env` 字段\n3. **Hermes** — `~/.hermes/.env`\n\n**通用配置（推荐）** — 在 `~/.tencentAgentStorage/.env` 中配置：\n\n```env\n# ~/.tencentAgentStorage/.env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n**OpenClaw** — 在 `~/.openclaw/openclaw.json` 的 `env` 字段中配置：\n\n```json\n{\n  \"env\": {\n    \"smh_basePath\": \"https://api.tencentsmh.cn\",\n    \"smh_libraryId\": \"smhxxx-xxxxx\",\n    \"smh_spaceId\": \"space-xxxxx\",\n    \"smh_accessToken\": \"<your-access-token>\"\n  }\n}\n```\n\n**Hermes** — 在 `~/.hermes/.env` 中配置：\n\n```env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n\n---\n\n## Procedure\n\nAgent uses this skill in any scenario that requires uploading files to the cloud.\n\n### Complete flow\n\n```\nUser triggers file upload\n  → Step 1: Identify the local file path(s)\n  → Step 2: Run upload script (loop for batch)\n  → Step 3: Extract downloadUrl from JSON output (signed COS URL)\n  → Step 4: Deliver the download link with execution notice\n```\n\n> **IMPORTANT**: 默认使用 `conflictStrategy: \"rename\"` 上传。当云端已存在同名文件时，脚本会自动重命名（如 `file(1).pdf`），确保上传始终成功并返回正确的下载链接。**只有用户明确说了 \"覆盖\"/\"替换\" 时，才使用 `conflictStrategy: \"overwrite\"`；用户明确要求先确认时，才使用 `conflictStrategy: \"ask\"`。**\n\n### Step 2: Upload\n\n**Single file (默认):**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file.pdf\",\"conflictStrategy\":\"rename\"}'\n```\n\n**Upload to specific directory:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/photo.jpg\",\"remotePath\":\"photos/photo.jpg\",\"conflictStrategy\":\"rename\"}'\n```\n\n**User explicitly requested overwrite:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"overwrite\"}'\n```\n\n**Batch upload:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file1.pdf\",\"conflictStrategy\":\"rename\"}'\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file2.docx\",\"conflictStrategy\":\"rename\"}'\n```\n\n#### Conflict handling\n\nWhen using `conflictStrategy: \"rename\"` (默认), if a same-name file already exists, the script automatically renames the file (e.g. `file(1).pdf`) and completes the upload, ensuring a valid download link is always returned.\n\nWhen using `conflictStrategy: \"ask\"`, if a same-name file already exists, the script returns `{\"success\":false,\"conflict\":true}`. Agent must then ask the user:\n\n> 云端已存在同名文件 `{filename}`，你想怎么处理？\n>\n> 1. 🔄 覆盖 — 替换云端文件\n> 2. 📝 重命名 — 自动改名上传（如 file(1).pdf）\n> 3. ❌ 取消 — 不上传\n\n**三种策略对照：**\n\n| Strategy | Behavior | When to use |\n|----------|----------|-------------|\n| `rename` (**默认**) | 同名文件存在时自动重命名，确保上传成功并返回正确链接 | 大多数场景，需要保证用户拿到下载链接 |\n| `overwrite` | 直接覆盖已有文件 | 用户明确说 \"覆盖\", \"替换\", \"更新文件\" |\n| `ask` | 同名文件存在时返回错误，Agent 询问用户 | 用户明确要求先确认时 |\n\n### Step 4: Deliver link + execution notice\n\nAfter every successful upload, include this notice alongside the download link(s):\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n\n**链接输出规则（MUST）：**\n1. **必须使用带 COS 签名的直链**（`downloadUrl` 字段），域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`\n2. **禁止输出含 `accessToken` 的中转链接**（如 `https://api.tencentsmh.cn/...?access_token=...`），这会泄露凭证\n3. **链接必须完整输出，禁止任何形式的截断、省略或缩写**——不能用 `...`、`<省略>` 等替代任何部分。签名链接通常很长，这是正常的\n\n**Single file example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 已上传文件: report.pdf  大小: (2.3 MB)\n> 下载链接: {脚本返回的完整 downloadUrl，原样输出，不得截断}\n\n**Batch example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 📎 report.pdf (2.3 MB) — {完整 downloadUrl}\n> 📎 photo.jpg (1.1 MB) — {完整 downloadUrl}\n\n---\n\n## File Size Support\n\n**There is NO file size limit.** The upload script supports files of any size, including multi-GB videos.\n\n- **Small files (≤ 50 MB)**: Single-part upload.\n- **Large files (> 50 MB)**: Multipart upload — the file is read in 5 MB chunks, never loaded entirely into memory.\n\n---\n\n## Commands\n\n所有命令输出 JSON 到 stdout。\n\n### upload\n\n```bash\nnode scripts/agent-storage.js upload '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标路径，省略则上传到根目录并保留原文件名\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n- `purpose`（可选）：`download`（默认，链接点击触发下载）| `preview`（链接在浏览器内预览）\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"upload\": {\n    \"localFile\": \"/path/to/photo.jpg\",\n    \"remotePath\": \"photo.jpg\",\n    \"fileSize\": 2048576,\n    \"fileSizeHuman\": \"2.0 MB\",\n    \"uploadTime\": \"3.2s\",\n    \"rapidUpload\": false\n  },\n  \"downloadUrl\": \"https://smhxxxxx.gz-c1.smhshare.com/s/xxxxxxxxxx\"\n}\n```\n\n### uploadDir\n\n```bash\nnode scripts/agent-storage.js uploadDir '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件夹绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标目录路径，省略则使用本地文件夹名称\n- `conflictStrategy`（可选）：`rename`（默认）| `overwrite`\n\n**说明：**\n- 递归上传整个文件夹，自动保留目录结构\n- 会先在云端创建对应的目录层级，再逐个上传文件\n- 文件按顺序上传（不并行），避免 API 过载\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"uploadDir\": {\n    \"localPath\": \"/path/to/my-folder\",\n    \"remotePath\": \"my-folder\",\n    \"totalFiles\": 5,\n    \"successCount\": 5,\n    \"failCount\": 0,\n    \"totalSize\": 10485760,\n    \"totalSizeHuman\": \"10.0 MB\",\n    \"uploadTime\": \"8.5s\"\n  },\n  \"files\": [\n    { \"file\": \"doc.pdf\", \"size\": 2048576, \"sizeHuman\": \"2.0 MB\", \"success\": true },\n    { \"file\": \"images/photo.jpg\", \"size\": 1048576, \"sizeHuman\": \"1.0 MB\", \"success\": true }\n  ]\n}\n```\n\n### info\n\n```bash\nnode scripts/agent-storage.js info '<json>'\n```\n\n**JSON 参数：**\n- `remotePath`（必填）：云端文件路径\n- `purpose`（可选）：`download`（默认，链接点击触发下载）| `preview`（链接在浏览器内预览）\n- `basePath` / `libraryId` / `spaceId` / `accessToken`（可选）：直接传参模式凭证\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"remotePath\": \"report.pdf\",\n  \"downloadUrl\": \"https://smhxxxxx.gz-c1.smhshare.com/s/xxxxxxxxxx\",\n  \"fileInfo\": {\n    \"name\": \"report.pdf\",\n    \"size\": 2048576,\n    \"type\": \"application/pdf\",\n    \"creationTime\": \"2026-03-13T10:00:00Z\",\n    \"modificationTime\": \"2026-03-13T10:00:00Z\"\n  }\n}\n```\n\n### list\n\n```bash\nnode scripts/agent-storage.js list '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（可选）：目录路径，默认 `/`\n- `limit`（可选）：最大返回数量，默认 50\n\n### search\n\n```bash\nnode scripts/agent-storage.js search '<json>'\n```\n\n**JSON 参数：**\n- `keywords`（必填）：搜索关键字，字符串或字符串数组（数组元素间为\"或\"关系）\n- `scope`（可选）：搜索范围目录路径，如 `photos`；不填则搜索整个空间\n- `limit`（可选）：最大返回数量，默认 20，取值范围 [1, 100]\n- `marker`（可选）：分页标识，用于获取后续页\n- `inExtnames`（可选）：限定文件后缀，字符串或字符串数组，如 `[\"pdf\",\"docx\"]`\n- `excludeExtnames`（可选）：排除文件后缀，字符串或字符串数组\n- `fileTypes`（可选）：文件类型过滤，取值 `all` | `dir` | `file` | `symlink`\n\n> **注意**：搜索仅支持按文件名匹配（`type: \"filename\"`），不支持全文内容检索。\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"keywords\": [\"报告\"],\n  \"type\": \"filename\",\n  \"total\": 3,\n  \"nextMarker\": null,\n  \"results\": [\n    {\n      \"name\": \"周报告.pdf\",\n      \"type\": \"file\",\n      \"size\": 2048576,\n      \"sizeHuman\": \"2.0 MB\",\n      \"contentType\": \"application/pdf\",\n      \"creationTime\": \"2026-03-13T10:00:00Z\",\n      \"modificationTime\": \"2026-03-13T10:00:00Z\",\n      \"text\": null,\n      \"textPage\": null,\n      \"searchScore\": null\n    }\n  ]\n}\n```\n\n### mkdir\n\n```bash\nnode scripts/agent-storage.js mkdir '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（必填）：要创建的文件夹路径，如 `photos` 或 `docs/2026`\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"dirPath\": \"photos\",\n  \"message\": \"文件夹 \\\"photos\\\" 创建成功\"\n}\n```\n\n---\n\n## Full Example\n\n```bash\n# Step 0: 安装 smh-node-sdk（首次使用前执行一次）\nnpm install -g smh-node-sdk@^1.0.8\n\n# Step 1: 上传文件\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"rename\"}'\n\n# Step 2: 查询文件信息\nnode scripts/agent-storage.js info '{\"remotePath\":\"report.pdf\"}'\n\n# Step 3: 列出云端文件\nnode scripts/agent-storage.js list '{\"dirPath\":\"/\",\"limit\":20}'\n\n# Step 4: 搜索文件（按文件名）\nnode scripts/agent-storage.js search '{\"keywords\":\"report\"}'\n\n# Step 5: 上传整个文件夹\nnode scripts/agent-storage.js uploadDir '{\"localPath\":\"/path/to/my-folder\",\"conflictStrategy\":\"rename\"}'\n\n# Step 6: 创建文件夹\nnode scripts/agent-storage.js mkdir '{\"dirPath\":\"photos\"}'\n```\n\n---\n\n## Pitfalls\n\n### Error handling\n\n所有命令输出 JSON 到 stdout。错误也以 JSON 返回：`{\"success\": false, \"error\": \"...\"}`\n\n| 错误 | 处理方式 |\n|------|---------|\n| 上传失败（`success: false`） | 告诉用户：\"文件上传失败：{具体原因}。你可以稍后再试，或者检查网络连接。\" |\n| 同名冲突（`conflict: true`） | 询问用户选择覆盖、重命名或取消 |\n| 文件不存在 | 让用户确认路径 |\n| 网络错误 | 重试 2 次，间隔 3s；仍失败告知用户 |\n| 配置缺失 | 提示用户在 `~/.tencentAgentStorage/.env`、`~/.openclaw/openclaw.json` 的 `env` 字段或 `~/.hermes/.env` 中添加 `smh_*` 配置 |\n\n**上传失败对话模板**（当 `success: false` 时必须使用）：\n\n> ❌ 文件上传失败：{error 中的具体原因}。\n>\n> 你可以：\n> 1. 🔄 重试 — 重新上传这个文件\n> 2. ❌ 取消 — 暂时不上传\n\n### Prohibited actions\n\n- **NEVER** 在 `success: false` 时展示下载链接\n- **NEVER** 在上传失败时不告知用户，必须明确提示\"文件上传失败\"及原因\n- **NEVER** 硬编码或暴露 SMH 凭证给用户\n- **NEVER** 未经用户主动要求就上传其本地个人文件\n- **NEVER** 跳过执行通知：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n- **NEVER** 在用户未明确要求覆盖时使用 `conflictStrategy: \"overwrite\"`\n- **NEVER** 把含 `accessToken` 的中转链接（如 `https://api.tencentsmh.cn/...?access_token=...`）发给用户。返回给用户的**必须是带 COS 签名的直链**（域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`），即脚本输出的 `downloadUrl` 字段\n- **NEVER** 截断、省略或用 `...` 缩写链接。发给用户的下载链接/预览链接**必须是脚本返回的完整 URL**，一个字符都不能少。链接通常很长（含签名参数），这是正常的，**必须原样完整输出**\n\n### Common mistakes\n\n- 用户说\"上传文件\"但没指定路径 → 追问：\"你要上传哪个文件？告诉我文件路径或文件名就行。\"\n- 用户说\"确定上传 xxx\"或\"把 xxx 发给我\" → 直接执行上传（`conflictStrategy: \"rename\"`）\n- **同名文件冲突**：默认使用 `conflictStrategy: \"rename\"`，自动重命名保证上传成功。只有用户明确要求覆盖时才用 `overwrite`，用户明确要求先确认时才用 `ask`\n- 文件默认上传到云空间根目录，用户可通过 `remotePath` 参数指定目标路径\n- 下载链接为通过 SDK `infoFile({ purpose: 'download' })` 获取的带签名 COS 直链（`https://bucket-xxxxx.tencentsmhuc.cn/...?q-sign-algorithm=sha1&q-signature=...`），可直接在浏览器或手机中打开预览/下载，**有效期约 2 小时**。**必须原样完整输出此链接，禁止截断或省略任何部分**\n- 批量上传按顺序处理（不并行），避免 API 过载\n- **执行通知**：每次上传完成后必须告知用户：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\n---\n\n## Verification\n\nUpload was successful when ALL of the following are true:\n\n1. Script output contains `\"success\": true`\n2. `downloadUrl` field is present and non-empty\n3. Agent delivered the download link to the user with the execution notice: \"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\nTo verify a previously uploaded file still exists:\n\n```bash\nnode scripts/agent-storage.js info '{\"remotePath\":\"<filename>\"}'\n```\n\nIf the response contains `\"success\": true`, the file is accessible and a fresh download link is returned.\n\nFile v1.0.15:_meta.json\n\n{\n  \"ownerId\": \"kn75r0rammt45k8qe5we0sh63580c5y0\",\n  \"slug\": \"tencent-agent-storage\",\n  \"version\": \"1.0.15\",\n  \"publishedAt\": 1779431000046\n}\n\nFile v1.0.15:skill-card.md\n\n## Description: <br>\nCloud file storage, upload, backup, and file management tool for Tencent Agent Storage that helps an agent upload files, list cloud files, download files, create share links, preview files, search files, and manage folders in a user's personal cloud drive. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[shawnminh](https://clawhub.ai/user/shawnminh) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users and agents use this skill to move generated or local files into Tencent Agent Storage, produce download or preview links, browse cloud directories, search filenames, and create cloud folders. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can trigger broad cloud-drive access and upload local files or whole folders using powerful Tencent Agent Storage credentials. <br>\nMitigation: Install only when the publisher is trusted, use a dedicated limited SMH token where possible, and review exact local paths and cloud destinations before uploads. <br>\nRisk: Credential loading can read SMH values from shared OpenClaw or Hermes configuration files. <br>\nMitigation: Prefer a dedicated Tencent Agent Storage credential file, avoid shared agent configuration for these credentials, and rotate tokens if exposure is suspected. <br>\nRisk: Setup instructions may require system-level Node.js or global npm package installation. <br>\nMitigation: Require administrator approval before system or global npm installs and verify the smh-node-sdk package source and version before use. <br>\nRisk: Generated signed links can grant temporary access to uploaded files. <br>\nMitigation: Share generated links only with intended recipients and avoid uploading personal files unless the user explicitly chose them. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/shawnminh/tencent-agent-storage) <br>\n- [Publisher Profile](https://clawhub.ai/user/shawnminh) <br>\n- [Tencent Agent Storage API Endpoint](https://api.tencentsmh.cn) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, JSON] <br>\n**Output Format:** [Markdown responses with shell command examples and JSON command results from the storage script.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Can return signed download or preview URLs, file metadata, list and search results, upload status, and folder creation status.] <br>\n\n## Skill Version(s): <br>\n1.0.15 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.14: 3 files, 12657 bytes\n\nFiles: scripts/agent-storage.js (14264b), SKILL.md (19843b), _meta.json (141b)\n\nFile v1.0.14:SKILL.md\n\n---\nname: tencent-agent-storage\nversion: 1.0.8\nauthor: shawnmzhang\nlicense: MIT\ndescription: |\n  Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\n  Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\n  MUST trigger when the user mentions ANY of the following concepts:\n  【云盘/网盘相关 — Cloud Drive Access】\n  - \"网盘\", \"云盘\", \"云空间\", \"龙虾盘\", \"龙虾云盘\", \"龙虾网盘\", \"龙虾空间\"\n  - \"专属云盘\", \"专属网盘\", \"专属空间\", \"我的云盘\", \"我的网盘\", \"我的龙虾\"\n  - \"打开网盘\", \"打开云盘\", \"进入网盘\", \"进入云盘\", \"看看云盘\", \"看看网盘\"\n  - \"cloud drive\", \"my drive\", \"open drive\", \"lobster drive\"\n  【文件列表/查看 — File Listing & Browsing】\n  - \"列出文件\", \"有哪些文件\", \"看看文件\", \"文件列表\", \"我的文件\"\n  - \"云盘里有什么\", \"空间里有啥\", \"查看云空间\", \"云空间文件\"\n  - \"list files\", \"show files\", \"my files\", \"what files\", \"browse files\"\n  【上传/备份 — Upload & Backup】\n  - \"上传文件\", \"上传某个文件\", \"确定上传\", \"传到云空间\", \"上传到云空间\"\n  - \"备份到云\", \"备份文件\", \"保存到云\", \"存到网盘\", \"传到网盘\", \"存到云盘\", \"传到云盘\"\n  - \"文件传一下\", \"帮我传个文件\", \"把这个存一下\"\n  - \"upload\", \"backup\", \"save to cloud\", \"back up\"\n  【发送/传输给用户 — Send & Deliver Files】\n  - \"把文件发给我\", \"整理好发我\", \"发到手机\", \"传到手机\"\n  - \"做完了发我一份\", \"弄好了发给我\", \"完成后把文件给我\"\n  - \"导出之后发我\", \"生成完发给我看看\", \"跑完了把结果给我\"\n  - \"send file\", \"send to phone\", \"deliver file\", \"give me the file\"\n  【链接/分享 — Links & Sharing】\n  - \"生成下载链接\", \"做成链接\", \"给我下载链接\"\n  - \"生成个链接发给同事\", \"发到群里\", \"分享文件\", \"分享给别人\", \"发个链接\"\n  - \"download link\", \"share file\", \"share link\", \"generate link\"\n  【文件状态查询 — File Status Check】\n  - \"这个云文件还在吗\", \"之前上传的文件还能下吗\", \"链接过期了能重新生成吗\"\n  - \"is file still there\", \"can I still download\", \"regenerate link\"\n  【文件搜索/检索 — File Search】\n  - \"搜索文件\", \"搜一下\", \"找文件\", \"找一下\", \"查找\", \"检索文件\"\n  - \"搜索云盘\", \"在云盘里搜\", \"帮我找个文件\", \"有没有叫xxx的文件\"\n  - \"search files\", \"find file\", \"search cloud\"\n  【隐式触发 — Implicit Triggers】\n  - When a task produces output files (reports, exports, generated content) that need to be delivered to the user\n  - When the user's intent implies needing a file on another device, even without explicitly saying \"upload\"\n  - When MyClaw/agent needs to upload files to generate download links\n  - Any mention of file transfer, cloud storage, or personal file space in the conversation context\nmetadata: {}\n---\n\n# Tencent Agent Storage (云文件上传备份工具)\n\n将本地文件上传至 Tencent Agent Storage，自动生成下载链接和图片预览。上传的文件存储在用户独有的云盘空间中，支持跨端访问——无论是手机、电脑还是平板，用户都可以随时随地查看和下载自己的文件。\n\n## When to Use\n\nAgent **MUST** activate this skill when any of the following conditions are met:\n\n- User mentions cloud drive keywords: 网盘、云盘、云空间、龙虾盘、专属网盘、cloud drive, my drive\n- User requests file listing or browsing: 列出文件、有哪些文件、list files, show files\n- User requests upload or backup: 上传文件、备份到云、存到网盘、upload, backup, save to cloud\n- User asks to send/deliver files: 把文件发给我、发到手机、send file, deliver file\n- User requests links or sharing: 生成下载链接、分享文件、download link, share link\n- User queries file status: 这个云文件还在吗、链接过期了、is file still there\n- User requests file search: 搜索文件、找文件、检索文件、搜索云盘、search files, find file\n- **Implicit**: A task produces output files that need to be delivered to the user, or the user's intent implies needing a file on another device\n\n## Quick Reference\n\n| Command | Usage | Description |\n|---------|-------|-------------|\n| `upload` | `node scripts/agent-storage.js upload '<json>'` | Upload local file to cloud, returns download link |\n| `info` | `node scripts/agent-storage.js info '<json>'` | Get file info and regenerate download link |\n| `list` | `node scripts/agent-storage.js list '<json>'` | List files in a cloud directory |\n| `search` | `node scripts/agent-storage.js search '<json>'` | Search files by name |\n| `mkdir` | `node scripts/agent-storage.js mkdir '<json>'` | Create a directory in cloud storage |\n\n## Setup\n\n### Prerequisites\n\n此 skill 需要 **Node.js ≥ 14** 和 **npm**。Agent 在首次执行前**必须检测运行环境**：\n\n```bash\nnode --version   # 期望输出 v14.x 或更高\nnpm --version\n```\n\n如果 `node` 命令不存在或版本低于 14，直接安装：\n\n根据用户系统自动选择安装方式：\n\n```bash\n# macOS (Homebrew)\nbrew install node\n\n# macOS (无 Homebrew)\ncurl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg\n\n# Linux (Debian/Ubuntu)\ncurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs\n\n# Linux (其他发行版 / 通用)\ncurl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1\n\n# Windows (PowerShell, 管理员)\nwinget install OpenJS.NodeJS.LTS\n\n# Windows (无 winget)\n# 下载安装包: https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi 并运行\n\n# 跨平台 (已有 nvm)\nnvm install --lts\n```\n\n此 skill 还依赖 `smh-node-sdk` npm 包（**要求 ^1.0.8**）。**必须在使用前完成安装**（二选一）：\n\n```bash\n# 方式一：全局安装（推荐）\nnpm install -g smh-node-sdk@^1.0.8\n\n# 方式二：本地安装到项目目录\nnpm install smh-node-sdk@^1.0.8\n```\n\n> 脚本会按以下顺序查找 SDK：当前项目 node_modules → 全局 node_modules。如果未找到，脚本会报错并提示安装命令。\n\n### About the upload script\n\n此 skill 的运行脚本位于 `scripts/agent-storage.js`。Agent 直接通过 `node scripts/agent-storage.js <command> '<json>'` 调用，**无需额外写入临时文件**。脚本源码可在 `scripts/` 目录中审阅。\n\n### Credential configuration\n\n凭证从以下配置文件中自动加载（优先级从高到低）。\n\n> **安全说明**：脚本仅读取配置文件中 `smh_` 前缀的环境变量（`smh_libraryId`、`smh_accessToken` 等），不会访问配置文件中的其他字段或敏感信息。\n\n> **关于 token 权限**：Tencent Agent Storage 的文件上传和下载链接生成 API 要求 `space_admin` 级别的 accessToken，这是 Tencent Agent Storage 服务端对文件写入操作的最低权限要求。\n\n**模式一：直接凭证（accessToken）**\n\n凭证文件查找顺序（先找到者优先）：\n\n1. **通用配置** — `~/.tencentAgentStorage/.env`\n2. **OpenClaw** — `~/.openclaw/openclaw.json` 的 `env` 字段\n3. **Hermes** — `~/.hermes/.env`\n\n**通用配置（推荐）** — 在 `~/.tencentAgentStorage/.env` 中配置：\n\n```env\n# ~/.tencentAgentStorage/.env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n**OpenClaw** — 在 `~/.openclaw/openclaw.json` 的 `env` 字段中配置：\n\n```json\n{\n  \"env\": {\n    \"smh_basePath\": \"https://api.tencentsmh.cn\",\n    \"smh_libraryId\": \"smhxxx-xxxxx\",\n    \"smh_spaceId\": \"space-xxxxx\",\n    \"smh_accessToken\": \"<your-access-token>\"\n  }\n}\n```\n\n**Hermes** — 在 `~/.hermes/.env` 中配置：\n\n```env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n\n---\n\n## Procedure\n\nAgent uses this skill in any scenario that requires uploading files to the cloud.\n\n### Complete flow\n\n```\nUser triggers file upload\n  → Step 1: Identify the local file path(s)\n  → Step 2: Run upload script (loop for batch)\n  → Step 3: Extract downloadUrl from JSON output (signed COS URL)\n  → Step 4: Deliver the download link with execution notice\n```\n\n> **IMPORTANT**: 默认使用 `conflictStrategy: \"rename\"` 上传。当云端已存在同名文件时，脚本会自动重命名（如 `file(1).pdf`），确保上传始终成功并返回正确的下载链接。**只有用户明确说了 \"覆盖\"/\"替换\" 时，才使用 `conflictStrategy: \"overwrite\"`；用户明确要求先确认时，才使用 `conflictStrategy: \"ask\"`。**\n\n### Step 2: Upload\n\n**Single file (默认):**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file.pdf\",\"conflictStrategy\":\"rename\"}'\n```\n\n**Upload to specific directory:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/photo.jpg\",\"remotePath\":\"photos/photo.jpg\",\"conflictStrategy\":\"rename\"}'\n```\n\n**User explicitly requested overwrite:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"overwrite\"}'\n```\n\n**Batch upload:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file1.pdf\",\"conflictStrategy\":\"rename\"}'\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file2.docx\",\"conflictStrategy\":\"rename\"}'\n```\n\n#### Conflict handling\n\nWhen using `conflictStrategy: \"rename\"` (默认), if a same-name file already exists, the script automatically renames the file (e.g. `file(1).pdf`) and completes the upload, ensuring a valid download link is always returned.\n\nWhen using `conflictStrategy: \"ask\"`, if a same-name file already exists, the script returns `{\"success\":false,\"conflict\":true}`. Agent must then ask the user:\n\n> 云端已存在同名文件 `{filename}`，你想怎么处理？\n>\n> 1. 🔄 覆盖 — 替换云端文件\n> 2. 📝 重命名 — 自动改名上传（如 file(1).pdf）\n> 3. ❌ 取消 — 不上传\n\n**三种策略对照：**\n\n| Strategy | Behavior | When to use |\n|----------|----------|-------------|\n| `rename` (**默认**) | 同名文件存在时自动重命名，确保上传成功并返回正确链接 | 大多数场景，需要保证用户拿到下载链接 |\n| `overwrite` | 直接覆盖已有文件 | 用户明确说 \"覆盖\", \"替换\", \"更新文件\" |\n| `ask` | 同名文件存在时返回错误，Agent 询问用户 | 用户明确要求先确认时 |\n\n### Step 4: Deliver link + execution notice\n\nAfter every successful upload, include this notice alongside the download link(s):\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n\n**链接输出规则（MUST）：**\n1. **必须使用带 COS 签名的直链**（`downloadUrl` 字段），域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`\n2. **禁止输出含 `accessToken` 的中转链接**（如 `https://api.tencentsmh.cn/...?access_token=...`），这会泄露凭证\n3. **链接必须完整输出，禁止任何形式的截断、省略或缩写**——不能用 `...`、`<省略>` 等替代任何部分。签名链接通常很长，这是正常的\n\n**Single file example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 已上传文件: report.pdf  大小: (2.3 MB)\n> 下载链接: {脚本返回的完整 downloadUrl，原样输出，不得截断}\n\n**Batch example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 📎 report.pdf (2.3 MB) — {完整 downloadUrl}\n> 📎 photo.jpg (1.1 MB) — {完整 downloadUrl}\n\n---\n\n## File Size Support\n\n**There is NO file size limit.** The upload script supports files of any size, including multi-GB videos.\n\n- **Small files (≤ 50 MB)**: Single-part upload.\n- **Large files (> 50 MB)**: Multipart upload — the file is read in 5 MB chunks, never loaded entirely into memory.\n\n---\n\n## Commands\n\n所有命令输出 JSON 到 stdout。\n\n### upload\n\n```bash\nnode scripts/agent-storage.js upload '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标路径，省略则上传到根目录并保留原文件名\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n- `purpose`（可选）：`download`（默认，链接点击触发下载）| `preview`（链接在浏览器内预览）\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"upload\": {\n    \"localFile\": \"/path/to/photo.jpg\",\n    \"remotePath\": \"photo.jpg\",\n    \"fileSize\": 2048576,\n    \"fileSizeHuman\": \"2.0 MB\",\n    \"uploadTime\": \"3.2s\",\n    \"rapidUpload\": false\n  },\n  \"downloadUrl\": \"https://smhxxxxx.gz-c1.smhshare.com/s/xxxxxxxxxx\"\n}\n```\n\n### info\n\n```bash\nnode scripts/agent-storage.js info '<json>'\n```\n\n**JSON 参数：**\n- `remotePath`（必填）：云端文件路径\n- `purpose`（可选）：`download`（默认，链接点击触发下载）| `preview`（链接在浏览器内预览）\n- `basePath` / `libraryId` / `spaceId` / `accessToken`（可选）：直接传参模式凭证\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"remotePath\": \"report.pdf\",\n  \"downloadUrl\": \"https://smhxxxxx.gz-c1.smhshare.com/s/xxxxxxxxxx\",\n  \"fileInfo\": {\n    \"name\": \"report.pdf\",\n    \"size\": 2048576,\n    \"type\": \"application/pdf\",\n    \"creationTime\": \"2026-03-13T10:00:00Z\",\n    \"modificationTime\": \"2026-03-13T10:00:00Z\"\n  }\n}\n```\n\n### list\n\n```bash\nnode scripts/agent-storage.js list '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（可选）：目录路径，默认 `/`\n- `limit`（可选）：最大返回数量，默认 50\n\n### search\n\n```bash\nnode scripts/agent-storage.js search '<json>'\n```\n\n**JSON 参数：**\n- `keywords`（必填）：搜索关键字，字符串或字符串数组（数组元素间为\"或\"关系）\n- `scope`（可选）：搜索范围目录路径，如 `photos`；不填则搜索整个空间\n- `limit`（可选）：最大返回数量，默认 20，取值范围 [1, 100]\n- `marker`（可选）：分页标识，用于获取后续页\n- `inExtnames`（可选）：限定文件后缀，字符串或字符串数组，如 `[\"pdf\",\"docx\"]`\n- `excludeExtnames`（可选）：排除文件后缀，字符串或字符串数组\n- `fileTypes`（可选）：文件类型过滤，取值 `all` | `dir` | `file` | `symlink`\n\n> **注意**：搜索仅支持按文件名匹配（`type: \"filename\"`），不支持全文内容检索。\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"keywords\": [\"报告\"],\n  \"type\": \"filename\",\n  \"total\": 3,\n  \"nextMarker\": null,\n  \"results\": [\n    {\n      \"name\": \"周报告.pdf\",\n      \"type\": \"file\",\n      \"size\": 2048576,\n      \"sizeHuman\": \"2.0 MB\",\n      \"contentType\": \"application/pdf\",\n      \"creationTime\": \"2026-03-13T10:00:00Z\",\n      \"modificationTime\": \"2026-03-13T10:00:00Z\",\n      \"text\": null,\n      \"textPage\": null,\n      \"searchScore\": null\n    }\n  ]\n}\n```\n\n### mkdir\n\n```bash\nnode scripts/agent-storage.js mkdir '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（必填）：要创建的文件夹路径，如 `photos` 或 `docs/2026`\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"dirPath\": \"photos\",\n  \"message\": \"文件夹 \\\"photos\\\" 创建成功\"\n}\n```\n\n---\n\n## Full Example\n\n```bash\n# Step 0: 安装 smh-node-sdk（首次使用前执行一次）\nnpm install -g smh-node-sdk@^1.0.8\n\n# Step 1: 上传文件\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"rename\"}'\n\n# Step 2: 查询文件信息\nnode scripts/agent-storage.js info '{\"remotePath\":\"report.pdf\"}'\n\n# Step 3: 列出云端文件\nnode scripts/agent-storage.js list '{\"dirPath\":\"/\",\"limit\":20}'\n\n# Step 4: 搜索文件（按文件名）\nnode scripts/agent-storage.js search '{\"keywords\":\"report\"}'\n\n# Step 5: 创建文件夹\nnode scripts/agent-storage.js mkdir '{\"dirPath\":\"photos\"}'\n```\n\n---\n\n## Pitfalls\n\n### Error handling\n\n所有命令输出 JSON 到 stdout。错误也以 JSON 返回：`{\"success\": false, \"error\": \"...\"}`\n\n| 错误 | 处理方式 |\n|------|---------|\n| 上传失败（`success: false`） | 告诉用户：\"文件上传失败：{具体原因}。你可以稍后再试，或者检查网络连接。\" |\n| 同名冲突（`conflict: true`） | 询问用户选择覆盖、重命名或取消 |\n| 文件不存在 | 让用户确认路径 |\n| 网络错误 | 重试 2 次，间隔 3s；仍失败告知用户 |\n| 配置缺失 | 提示用户在 `~/.tencentAgentStorage/.env`、`~/.openclaw/openclaw.json` 的 `env` 字段或 `~/.hermes/.env` 中添加 `smh_*` 配置 |\n\n**上传失败对话模板**（当 `success: false` 时必须使用）：\n\n> ❌ 文件上传失败：{error 中的具体原因}。\n>\n> 你可以：\n> 1. 🔄 重试 — 重新上传这个文件\n> 2. ❌ 取消 — 暂时不上传\n\n### Prohibited actions\n\n- **NEVER** 在 `success: false` 时展示下载链接\n- **NEVER** 在上传失败时不告知用户，必须明确提示\"文件上传失败\"及原因\n- **NEVER** 硬编码或暴露 SMH 凭证给用户\n- **NEVER** 未经用户主动要求就上传其本地个人文件\n- **NEVER** 跳过执行通知：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n- **NEVER** 在用户未明确要求覆盖时使用 `conflictStrategy: \"overwrite\"`\n- **NEVER** 把含 `accessToken` 的中转链接（如 `https://api.tencentsmh.cn/...?access_token=...`）发给用户。返回给用户的**必须是带 COS 签名的直链**（域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`），即脚本输出的 `downloadUrl` 字段\n- **NEVER** 截断、省略或用 `...` 缩写链接。发给用户的下载链接/预览链接**必须是脚本返回的完整 URL**，一个字符都不能少。链接通常很长（含签名参数），这是正常的，**必须原样完整输出**\n\n### Common mistakes\n\n- 用户说\"上传文件\"但没指定路径 → 追问：\"你要上传哪个文件？告诉我文件路径或文件名就行。\"\n- 用户说\"确定上传 xxx\"或\"把 xxx 发给我\" → 直接执行上传（`conflictStrategy: \"rename\"`）\n- **同名文件冲突**：默认使用 `conflictStrategy: \"rename\"`，自动重命名保证上传成功。只有用户明确要求覆盖时才用 `overwrite`，用户明确要求先确认时才用 `ask`\n- 文件默认上传到云空间根目录，用户可通过 `remotePath` 参数指定目标路径\n- 下载链接为通过 SDK `infoFile({ purpose: 'download' })` 获取的带签名 COS 直链（`https://bucket-xxxxx.tencentsmhuc.cn/...?q-sign-algorithm=sha1&q-signature=...`），可直接在浏览器或手机中打开预览/下载，**有效期约 2 小时**。**必须原样完整输出此链接，禁止截断或省略任何部分**\n- 批量上传按顺序处理（不并行），避免 API 过载\n- **执行通知**：每次上传完成后必须告知用户：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\n---\n\n## Verification\n\nUpload was successful when ALL of the following are true:\n\n1. Script output contains `\"success\": true`\n2. `downloadUrl` field is present and non-empty\n3. Agent delivered the download link to the user with the execution notice: \"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\nTo verify a previously uploaded file still exists:\n\n```bash\nnode scripts/agent-storage.js info '{\"remotePath\":\"<filename>\"}'\n```\n\nIf the response contains `\"success\": true`, the file is accessible and a fresh download link is returned.\n\nFile v1.0.14:_meta.json\n\n{\n  \"ownerId\": \"kn75r0rammt45k8qe5we0sh63580c5y0\",\n  \"slug\": \"tencent-agent-storage\",\n  \"version\": \"1.0.14\",\n  \"publishedAt\": 1779364938962\n}\n\nArchive v1.0.13: 3 files, 10972 bytes\n\nFiles: scripts/agent-storage.js (9971b), SKILL.md (17403b), _meta.json (141b)\n\nFile v1.0.13:SKILL.md\n\n---\nname: tencent-agent-storage\nversion: 1.0.7\nauthor: shawnmzhang\nlicense: MIT\ndescription: |\n  Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\n  Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\n  MUST trigger when the user mentions ANY of the following concepts:\n  【云盘/网盘相关 — Cloud Drive Access】\n  - \"网盘\", \"云盘\", \"云空间\", \"龙虾盘\", \"龙虾云盘\", \"龙虾网盘\", \"龙虾空间\"\n  - \"专属云盘\", \"专属网盘\", \"专属空间\", \"我的云盘\", \"我的网盘\", \"我的龙虾\"\n  - \"打开网盘\", \"打开云盘\", \"进入网盘\", \"进入云盘\", \"看看云盘\", \"看看网盘\"\n  - \"cloud drive\", \"my drive\", \"open drive\", \"lobster drive\"\n  【文件列表/查看 — File Listing & Browsing】\n  - \"列出文件\", \"有哪些文件\", \"看看文件\", \"文件列表\", \"我的文件\"\n  - \"云盘里有什么\", \"空间里有啥\", \"查看云空间\", \"云空间文件\"\n  - \"list files\", \"show files\", \"my files\", \"what files\", \"browse files\"\n  【上传/备份 — Upload & Backup】\n  - \"上传文件\", \"上传某个文件\", \"确定上传\", \"传到云空间\", \"上传到云空间\"\n  - \"备份到云\", \"备份文件\", \"保存到云\", \"存到网盘\", \"传到网盘\", \"存到云盘\", \"传到云盘\"\n  - \"文件传一下\", \"帮我传个文件\", \"把这个存一下\"\n  - \"upload\", \"backup\", \"save to cloud\", \"back up\"\n  【发送/传输给用户 — Send & Deliver Files】\n  - \"把文件发给我\", \"整理好发我\", \"发到手机\", \"传到手机\"\n  - \"做完了发我一份\", \"弄好了发给我\", \"完成后把文件给我\"\n  - \"导出之后发我\", \"生成完发给我看看\", \"跑完了把结果给我\"\n  - \"send file\", \"send to phone\", \"deliver file\", \"give me the file\"\n  【链接/分享 — Links & Sharing】\n  - \"生成下载链接\", \"做成链接\", \"给我下载链接\"\n  - \"生成个链接发给同事\", \"发到群里\", \"分享文件\", \"分享给别人\", \"发个链接\"\n  - \"download link\", \"share file\", \"share link\", \"generate link\"\n  【文件状态查询 — File Status Check】\n  - \"这个云文件还在吗\", \"之前上传的文件还能下吗\", \"链接过期了能重新生成吗\"\n  - \"is file still there\", \"can I still download\", \"regenerate link\"\n  【隐式触发 — Implicit Triggers】\n  - When a task produces output files (reports, exports, generated content) that need to be delivered to the user\n  - When the user's intent implies needing a file on another device, even without explicitly saying \"upload\"\n  - When MyClaw/agent needs to upload files to generate download links\n  - Any mention of file transfer, cloud storage, or personal file space in the conversation context\nmetadata: {}\n---\n\n# Tencent Agent Storage (云文件上传备份工具)\n\n将本地文件上传至 Tencent Agent Storage，自动生成下载链接和图片预览。上传的文件存储在用户独有的云盘空间中，支持跨端访问——无论是手机、电脑还是平板，用户都可以随时随地查看和下载自己的文件。\n\n## When to Use\n\nAgent **MUST** activate this skill when any of the following conditions are met:\n\n- User mentions cloud drive keywords: 网盘、云盘、云空间、龙虾盘、专属网盘、cloud drive, my drive\n- User requests file listing or browsing: 列出文件、有哪些文件、list files, show files\n- User requests upload or backup: 上传文件、备份到云、存到网盘、upload, backup, save to cloud\n- User asks to send/deliver files: 把文件发给我、发到手机、send file, deliver file\n- User requests links or sharing: 生成下载链接、分享文件、download link, share link\n- User queries file status: 这个云文件还在吗、链接过期了、is file still there\n- **Implicit**: A task produces output files that need to be delivered to the user, or the user's intent implies needing a file on another device\n\n## Quick Reference\n\n| Command | Usage | Description |\n|---------|-------|-------------|\n| `upload` | `node scripts/agent-storage.js upload '<json>'` | Upload local file to cloud, returns download link |\n| `info` | `node scripts/agent-storage.js info '<json>'` | Get file info and regenerate download link |\n| `list` | `node scripts/agent-storage.js list '<json>'` | List files in a cloud directory |\n\n## Setup\n\n### Prerequisites\n\n此 skill 需要 **Node.js ≥ 14** 和 **npm**。Agent 在首次执行前**必须检测运行环境**：\n\n```bash\nnode --version   # 期望输出 v14.x 或更高\nnpm --version\n```\n\n如果 `node` 命令不存在或版本低于 14，直接安装：\n\n根据用户系统自动选择安装方式：\n\n```bash\n# macOS (Homebrew)\nbrew install node\n\n# macOS (无 Homebrew)\ncurl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg\n\n# Linux (Debian/Ubuntu)\ncurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs\n\n# Linux (其他发行版 / 通用)\ncurl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1\n\n# Windows (PowerShell, 管理员)\nwinget install OpenJS.NodeJS.LTS\n\n# Windows (无 winget)\n# 下载安装包: https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi 并运行\n\n# 跨平台 (已有 nvm)\nnvm install --lts\n```\n\n此 skill 还依赖 `smh-node-sdk` npm 包。**必须在使用前完成安装**（二选一）：\n\n```bash\n# 方式一：全局安装（推荐）\nnpm install -g smh-node-sdk\n\n# 方式二：本地安装到项目目录\nnpm install smh-node-sdk\n```\n\n> 脚本会按以下顺序查找 SDK：当前项目 node_modules → 全局 node_modules。如果未找到，脚本会报错并提示安装命令。\n\n### About the upload script\n\n此 skill 的运行脚本位于 `scripts/agent-storage.js`。Agent 直接通过 `node scripts/agent-storage.js <command> '<json>'` 调用，**无需额外写入临时文件**。脚本源码可在 `scripts/` 目录中审阅。\n\n### Credential configuration\n\n凭证从以下配置文件中自动加载（优先级从高到低）。\n\n> **安全说明**：脚本仅读取配置文件中 `smh_` 前缀的环境变量（`smh_libraryId`、`smh_accessToken` 等），不会访问配置文件中的其他字段或敏感信息。\n\n> **关于 token 权限**：Tencent Agent Storage 的文件上传和下载链接生成 API 要求 `space_admin` 级别的 accessToken，这是 Tencent Agent Storage 服务端对文件写入操作的最低权限要求。\n\n**模式一：直接凭证（accessToken）**\n\n凭证文件查找顺序（先找到者优先）：\n\n1. **通用配置** — `~/.tencentAgentStorage/.env`\n2. **OpenClaw** — `~/.openclaw/openclaw.json` 的 `env` 字段\n3. **Hermes** — `~/.hermes/.env`\n\n**通用配置（推荐）** — 在 `~/.tencentAgentStorage/.env` 中配置：\n\n```env\n# ~/.tencentAgentStorage/.env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n**OpenClaw** — 在 `~/.openclaw/openclaw.json` 的 `env` 字段中配置：\n\n```json\n{\n  \"env\": {\n    \"smh_basePath\": \"https://api.tencentsmh.cn\",\n    \"smh_libraryId\": \"smhxxx-xxxxx\",\n    \"smh_spaceId\": \"space-xxxxx\",\n    \"smh_accessToken\": \"<your-access-token>\"\n  }\n}\n```\n\n**Hermes** — 在 `~/.hermes/.env` 中配置：\n\n```env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n\n---\n\n## Procedure\n\nAgent uses this skill in any scenario that requires uploading files to the cloud.\n\n### Complete flow\n\n```\nUser triggers file upload\n  → Step 1: Identify the local file path(s)\n  → Step 2: Run upload script (loop for batch)\n  → Step 3: Extract downloadUrl from JSON output (signed COS URL)\n  → Step 4: Deliver the download link with execution notice\n```\n\n> **IMPORTANT**: 默认使用 `conflictStrategy: \"rename\"` 上传。当云端已存在同名文件时，脚本会自动重命名（如 `file(1).pdf`），确保上传始终成功并返回正确的下载链接。**只有用户明确说了 \"覆盖\"/\"替换\" 时，才使用 `conflictStrategy: \"overwrite\"`；用户明确要求先确认时，才使用 `conflictStrategy: \"ask\"`。**\n\n### Step 2: Upload\n\n**Single file (默认):**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file.pdf\",\"conflictStrategy\":\"rename\"}'\n```\n\n**Upload to specific directory:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/photo.jpg\",\"remotePath\":\"photos/photo.jpg\",\"conflictStrategy\":\"rename\"}'\n```\n\n**User explicitly requested overwrite:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"overwrite\"}'\n```\n\n**Batch upload:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file1.pdf\",\"conflictStrategy\":\"rename\"}'\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file2.docx\",\"conflictStrategy\":\"rename\"}'\n```\n\n#### Conflict handling\n\nWhen using `conflictStrategy: \"rename\"` (默认), if a same-name file already exists, the script automatically renames the file (e.g. `file(1).pdf`) and completes the upload, ensuring a valid download link is always returned.\n\nWhen using `conflictStrategy: \"ask\"`, if a same-name file already exists, the script returns `{\"success\":false,\"conflict\":true}`. Agent must then ask the user:\n\n> 云端已存在同名文件 `{filename}`，你想怎么处理？\n>\n> 1. 🔄 覆盖 — 替换云端文件\n> 2. 📝 重命名 — 自动改名上传（如 file(1).pdf）\n> 3. ❌ 取消 — 不上传\n\n**三种策略对照：**\n\n| Strategy | Behavior | When to use |\n|----------|----------|-------------|\n| `rename` (**默认**) | 同名文件存在时自动重命名，确保上传成功并返回正确链接 | 大多数场景，需要保证用户拿到下载链接 |\n| `overwrite` | 直接覆盖已有文件 | 用户明确说 \"覆盖\", \"替换\", \"更新文件\" |\n| `ask` | 同名文件存在时返回错误，Agent 询问用户 | 用户明确要求先确认时 |\n\n### Step 4: Deliver link + execution notice\n\nAfter every successful upload, include this notice alongside the download link(s):\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n\n**链接输出规则（MUST）：**\n1. **必须使用带 COS 签名的直链**（`downloadUrl` 字段），域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`\n2. **禁止输出含 `accessToken` 的中转链接**（如 `https://api.tencentsmh.cn/...?access_token=...`），这会泄露凭证\n3. **链接必须完整输出，禁止任何形式的截断、省略或缩写**——不能用 `...`、`<省略>` 等替代任何部分。签名链接通常很长，这是正常的\n\n**Single file example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 已上传文件: report.pdf  大小: (2.3 MB)\n> 下载链接: {脚本返回的完整 downloadUrl，原样输出，不得截断}\n\n**Batch example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 📎 report.pdf (2.3 MB) — {完整 downloadUrl}\n> 📎 photo.jpg (1.1 MB) — {完整 downloadUrl}\n\n---\n\n## File Size Support\n\n**There is NO file size limit.** The upload script supports files of any size, including multi-GB videos.\n\n- **Small files (≤ 50 MB)**: Single-part upload.\n- **Large files (> 50 MB)**: Multipart upload — the file is read in 5 MB chunks, never loaded entirely into memory.\n\n---\n\n## Commands\n\n所有命令输出 JSON 到 stdout。\n\n### upload\n\n```bash\nnode scripts/agent-storage.js upload '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标路径，省略则上传到根目录并保留原文件名\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"upload\": {\n    \"localFile\": \"/path/to/photo.jpg\",\n    \"remotePath\": \"photo.jpg\",\n    \"fileSize\": 2048576,\n    \"fileSizeHuman\": \"2.0 MB\",\n    \"uploadTime\": \"3.2s\",\n    \"rapidUpload\": false\n  },\n  \"downloadUrl\": \"https://bucket-xxxxx.tencentsmhuc.cn/smhxxx/...photo.jpg?response-content-disposition=inline&smh-space=space-xxx&x-cos-security-token=...&q-sign-algorithm=sha1&q-signature=...\"\n}\n```\n\n### info\n\n```bash\nnode scripts/agent-storage.js info '<json>'\n```\n\n**JSON 参数：**\n- `remotePath`（必填）：云端文件路径\n- `basePath` / `libraryId` / `spaceId` / `accessToken`（可选）：直接传参模式凭证\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"remotePath\": \"report.pdf\",\n  \"downloadUrl\": \"https://bucket-xxxxx.tencentsmhuc.cn/smhxxx/...report.pdf?response-content-disposition=inline&smh-space=space-xxx&x-cos-security-token=...&q-sign-algorithm=sha1&q-signature=...\",\n  \"fileInfo\": {\n    \"name\": \"report.pdf\",\n    \"size\": 2048576,\n    \"type\": \"application/pdf\",\n    \"creationTime\": \"2026-03-13T10:00:00Z\",\n    \"modificationTime\": \"2026-03-13T10:00:00Z\"\n  }\n}\n```\n\n### list\n\n```bash\nnode scripts/agent-storage.js list '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（可选）：目录路径，默认 `/`\n- `limit`（可选）：最大返回数量，默认 50\n\n---\n\n## Full Example\n\n```bash\n# Step 0: 安装 smh-node-sdk（首次使用前执行一次）\nnpm install -g smh-node-sdk\n\n# Step 1: 上传文件\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"rename\"}'\n\n# Step 2: 查询文件信息\nnode scripts/agent-storage.js info '{\"remotePath\":\"report.pdf\"}'\n\n# Step 3: 列出云端文件\nnode scripts/agent-storage.js list '{\"dirPath\":\"/\",\"limit\":20}'\n```\n\n---\n\n## Pitfalls\n\n### Error handling\n\n所有命令输出 JSON 到 stdout。错误也以 JSON 返回：`{\"success\": false, \"error\": \"...\"}`\n\n| 错误 | 处理方式 |\n|------|---------|\n| 上传失败（`success: false`） | 告诉用户：\"文件上传失败：{具体原因}。你可以稍后再试，或者检查网络连接。\" |\n| 同名冲突（`conflict: true`） | 询问用户选择覆盖、重命名或取消 |\n| 文件不存在 | 让用户确认路径 |\n| 网络错误 | 重试 2 次，间隔 3s；仍失败告知用户 |\n| 配置缺失 | 提示用户在 `~/.tencentAgentStorage/.env`、`~/.openclaw/openclaw.json` 的 `env` 字段或 `~/.hermes/.env` 中添加 `smh_*` 配置 |\n\n**上传失败对话模板**（当 `success: false` 时必须使用）：\n\n> ❌ 文件上传失败：{error 中的具体原因}。\n>\n> 你可以：\n> 1. 🔄 重试 — 重新上传这个文件\n> 2. ❌ 取消 — 暂时不上传\n\n### Prohibited actions\n\n- **NEVER** 在 `success: false` 时展示下载链接\n- **NEVER** 在上传失败时不告知用户，必须明确提示\"文件上传失败\"及原因\n- **NEVER** 硬编码或暴露 SMH 凭证给用户\n- **NEVER** 未经用户主动要求就上传其本地个人文件\n- **NEVER** 跳过执行通知：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n- **NEVER** 在用户未明确要求覆盖时使用 `conflictStrategy: \"overwrite\"`\n- **NEVER** 把含 `accessToken` 的中转链接（如 `https://api.tencentsmh.cn/...?access_token=...`）发给用户。返回给用户的**必须是带 COS 签名的直链**（域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`），即脚本输出的 `downloadUrl` 字段\n- **NEVER** 截断、省略或用 `...` 缩写链接。发给用户的下载链接/预览链接**必须是脚本返回的完整 URL**，一个字符都不能少。链接通常很长（含签名参数），这是正常的，**必须原样完整输出**\n\n### Common mistakes\n\n- 用户说\"上传文件\"但没指定路径 → 追问：\"你要上传哪个文件？告诉我文件路径或文件名就行。\"\n- 用户说\"确定上传 xxx\"或\"把 xxx 发给我\" → 直接执行上传（`conflictStrategy: \"rename\"`）\n- **同名文件冲突**：默认使用 `conflictStrategy: \"rename\"`，自动重命名保证上传成功。只有用户明确要求覆盖时才用 `overwrite`，用户明确要求先确认时才用 `ask`\n- 文件默认上传到云空间根目录，用户可通过 `remotePath` 参数指定目标路径\n- 下载链接为通过 SDK `infoFile({ purpose: 'download' })` 获取的带签名 COS 直链（`https://bucket-xxxxx.tencentsmhuc.cn/...?q-sign-algorithm=sha1&q-signature=...`），可直接在浏览器或手机中打开预览/下载，**有效期约 2 小时**。**必须原样完整输出此链接，禁止截断或省略任何部分**\n- 批量上传按顺序处理（不并行），避免 API 过载\n- **执行通知**：每次上传完成后必须告知用户：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\n---\n\n## Verification\n\nUpload was successful when ALL of the following are true:\n\n1. Script output contains `\"success\": true`\n2. `downloadUrl` field is present and non-empty\n3. Agent delivered the download link to the user with the execution notice: \"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\nTo verify a previously uploaded file still exists:\n\n```bash\nnode scripts/agent-storage.js info '{\"remotePath\":\"<filename>\"}'\n```\n\nIf the response contains `\"success\": true`, the file is accessible and a fresh download link is returned.\n\nFile v1.0.13:_meta.json\n\n{\n  \"ownerId\": \"kn75r0rammt45k8qe5we0sh63580c5y0\",\n  \"slug\": \"tencent-agent-storage\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1777433839175\n}\n\nArchive v1.0.12: 3 files, 11377 bytes\n\nFiles: scripts/agent-storage.js (9971b), SKILL.md (18798b), _meta.json (141b)\n\nFile v1.0.12:SKILL.md\n\n---\nname: tencent-agent-storage\nversion: 1.0.7\nauthor: shawnmzhang\nlicense: MIT\ndescription: |\n  Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\n  Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\n  MUST trigger when the user mentions ANY of the following concepts:\n  【云盘/网盘相关 — Cloud Drive Access】\n  - \"网盘\", \"云盘\", \"云空间\", \"龙虾盘\", \"龙虾云盘\", \"龙虾网盘\", \"龙虾空间\"\n  - \"专属云盘\", \"专属网盘\", \"专属空间\", \"我的云盘\", \"我的网盘\", \"我的龙虾\"\n  - \"打开网盘\", \"打开云盘\", \"进入网盘\", \"进入云盘\", \"看看云盘\", \"看看网盘\"\n  - \"cloud drive\", \"my drive\", \"open drive\", \"lobster drive\"\n  【文件列表/查看 — File Listing & Browsing】\n  - \"列出文件\", \"有哪些文件\", \"看看文件\", \"文件列表\", \"我的文件\"\n  - \"云盘里有什么\", \"空间里有啥\", \"查看云空间\", \"云空间文件\"\n  - \"list files\", \"show files\", \"my files\", \"what files\", \"browse files\"\n  【上传/备份 — Upload & Backup】\n  - \"上传文件\", \"上传某个文件\", \"确定上传\", \"传到云空间\", \"上传到云空间\"\n  - \"备份到云\", \"备份文件\", \"保存到云\", \"存到网盘\", \"传到网盘\", \"存到云盘\", \"传到云盘\"\n  - \"文件传一下\", \"帮我传个文件\", \"把这个存一下\"\n  - \"upload\", \"backup\", \"save to cloud\", \"back up\"\n  【发送/传输给用户 — Send & Deliver Files】\n  - \"把文件发给我\", \"整理好发我\", \"发到手机\", \"传到手机\"\n  - \"做完了发我一份\", \"弄好了发给我\", \"完成后把文件给我\"\n  - \"导出之后发我\", \"生成完发给我看看\", \"跑完了把结果给我\"\n  - \"send file\", \"send to phone\", \"deliver file\", \"give me the file\"\n  【链接/分享 — Links & Sharing】\n  - \"生成下载链接\", \"做成链接\", \"给我下载链接\"\n  - \"生成个链接发给同事\", \"发到群里\", \"分享文件\", \"分享给别人\", \"发个链接\"\n  - \"download link\", \"share file\", \"share link\", \"generate link\"\n  【文件状态查询 — File Status Check】\n  - \"这个云文件还在吗\", \"之前上传的文件还能下吗\", \"链接过期了能重新生成吗\"\n  - \"is file still there\", \"can I still download\", \"regenerate link\"\n  【隐式触发 — Implicit Triggers】\n  - When a task produces output files (reports, exports, generated content) that need to be delivered to the user\n  - When the user's intent implies needing a file on another device, even without explicitly saying \"upload\"\n  - When MyClaw/agent needs to upload files to generate download links\n  - Any mention of file transfer, cloud storage, or personal file space in the conversation context\nmetadata:\n  # ── OpenClaw 兼容 ──\n  openclaw:\n    emoji: \"☁️\"\n    requires:\n      bins:\n        - node\n        - npm\n      packages:\n        npm:\n          - smh-node-sdk\n      env:\n        - smh_libraryId\n        - smh_accessToken\n        - smh_spaceId\n        - smh_basePath\n  # ── Hermes Agent 兼容 ──\n  hermes:\n    tags: [Cloud Storage, File Management, Upload, Backup, Tencent Agent Storage]\n    related_skills: []\n    required_environment_variables:\n      - name: smh_libraryId\n        prompt: \"SMH Library ID\"\n        help: \"Your Tencent SMH library ID, e.g. smhxxx-xxxxx\"\n        required_for: \"API access to Tencent Agent Storage\"\n      - name: smh_accessToken\n        prompt: \"SMH Access Token\"\n        help: \"A space_admin level access token for Tencent Agent Storage\"\n        required_for: \"File upload and download link generation\"\n      - name: smh_spaceId\n        prompt: \"SMH Space ID\"\n        help: \"Your cloud drive space ID, e.g. space-xxxxx\"\n        required_for: \"Identifying the target storage space\"\n      - name: smh_basePath\n        prompt: \"SMH API Base Path\"\n        help: \"Tencent SMH API endpoint, defaults to https://api.tencentsmh.cn\"\n        required_for: \"API endpoint configuration\"\n    config:\n      - key: smh.basePath\n        description: \"Tencent SMH API base URL\"\n        default: \"https://api.tencentsmh.cn\"\n        prompt: \"SMH API base path\"\n---\n\n# Tencent Agent Storage (云文件上传备份工具)\n\n将本地文件上传至 Tencent Agent Storage，自动生成下载链接和图片预览。上传的文件存储在用户独有的云盘空间中，支持跨端访问——无论是手机、电脑还是平板，用户都可以随时随地查看和下载自己的文件。\n\n## When to Use\n\nAgent **MUST** activate this skill when any of the following conditions are met:\n\n- User mentions cloud drive keywords: 网盘、云盘、云空间、龙虾盘、专属网盘、cloud drive, my drive\n- User requests file listing or browsing: 列出文件、有哪些文件、list files, show files\n- User requests upload or backup: 上传文件、备份到云、存到网盘、upload, backup, save to cloud\n- User asks to send/deliver files: 把文件发给我、发到手机、send file, deliver file\n- User requests links or sharing: 生成下载链接、分享文件、download link, share link\n- User queries file status: 这个云文件还在吗、链接过期了、is file still there\n- **Implicit**: A task produces output files that need to be delivered to the user, or the user's intent implies needing a file on another device\n\n## Quick Reference\n\n| Command | Usage | Description |\n|---------|-------|-------------|\n| `upload` | `node scripts/agent-storage.js upload '<json>'` | Upload local file to cloud, returns download link |\n| `info` | `node scripts/agent-storage.js info '<json>'` | Get file info and regenerate download link |\n| `list` | `node scripts/agent-storage.js list '<json>'` | List files in a cloud directory |\n\n## Setup\n\n### Prerequisites\n\n此 skill 需要 **Node.js ≥ 14** 和 **npm**。Agent 在首次执行前**必须检测运行环境**：\n\n```bash\nnode --version   # 期望输出 v14.x 或更高\nnpm --version\n```\n\n如果 `node` 命令不存在或版本低于 14，直接安装：\n\n根据用户系统自动选择安装方式：\n\n```bash\n# macOS (Homebrew)\nbrew install node\n\n# macOS (无 Homebrew)\ncurl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg\n\n# Linux (Debian/Ubuntu)\ncurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs\n\n# Linux (其他发行版 / 通用)\ncurl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1\n\n# Windows (PowerShell, 管理员)\nwinget install OpenJS.NodeJS.LTS\n\n# Windows (无 winget)\n# 下载安装包: https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi 并运行\n\n# 跨平台 (已有 nvm)\nnvm install --lts\n```\n\n此 skill 还依赖 `smh-node-sdk` npm 包。**必须在使用前完成安装**（二选一）：\n\n```bash\n# 方式一：全局安装（推荐）\nnpm install -g smh-node-sdk\n\n# 方式二：本地安装到项目目录\nnpm install smh-node-sdk\n```\n\n> 脚本会按以下顺序查找 SDK：当前项目 node_modules → 全局 node_modules。如果未找到，脚本会报错并提示安装命令。\n\n### About the upload script\n\n此 skill 的运行脚本位于 `scripts/agent-storage.js`。Agent 直接通过 `node scripts/agent-storage.js <command> '<json>'` 调用，**无需额外写入临时文件**。脚本源码可在 `scripts/` 目录中审阅。\n\n### Credential configuration\n\n凭证从以下配置文件中自动加载（优先级从高到低）。\n\n> **安全说明**：脚本仅读取配置文件中 `smh_` 前缀的环境变量（`smh_libraryId`、`smh_accessToken` 等），不会访问配置文件中的其他字段或敏感信息。\n\n> **关于 token 权限**：Tencent Agent Storage 的文件上传和下载链接生成 API 要求 `space_admin` 级别的 accessToken，这是 Tencent Agent Storage 服务端对文件写入操作的最低权限要求。\n\n**模式一：直接凭证（accessToken）**\n\n凭证文件查找顺序（先找到者优先）：\n\n1. **通用配置** — `~/.tencentAgentStorage/.env`\n2. **OpenClaw** — `~/.openclaw/openclaw.json` 的 `env` 字段\n3. **Hermes** — `~/.hermes/.env`\n\n**通用配置（推荐）** — 在 `~/.tencentAgentStorage/.env` 中配置：\n\n```env\n# ~/.tencentAgentStorage/.env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n**OpenClaw** — 在 `~/.openclaw/openclaw.json` 的 `env` 字段中配置：\n\n```json\n{\n  \"env\": {\n    \"smh_basePath\": \"https://api.tencentsmh.cn\",\n    \"smh_libraryId\": \"smhxxx-xxxxx\",\n    \"smh_spaceId\": \"space-xxxxx\",\n    \"smh_accessToken\": \"<your-access-token>\"\n  }\n}\n```\n\n**Hermes** — 在 `~/.hermes/.env` 中配置：\n\n```env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n\n---\n\n## Procedure\n\nAgent uses this skill in any scenario that requires uploading files to the cloud.\n\n### Complete flow\n\n```\nUser triggers file upload\n  → Step 1: Identify the local file path(s)\n  → Step 2: Run upload script (loop for batch)\n  → Step 3: Extract downloadUrl from JSON output (signed COS URL)\n  → Step 4: Deliver the download link with execution notice\n```\n\n> **IMPORTANT**: 默认使用 `conflictStrategy: \"rename\"` 上传。当云端已存在同名文件时，脚本会自动重命名（如 `file(1).pdf`），确保上传始终成功并返回正确的下载链接。**只有用户明确说了 \"覆盖\"/\"替换\" 时，才使用 `conflictStrategy: \"overwrite\"`；用户明确要求先确认时，才使用 `conflictStrategy: \"ask\"`。**\n\n### Step 2: Upload\n\n**Single file (默认):**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file.pdf\",\"conflictStrategy\":\"rename\"}'\n```\n\n**Upload to specific directory:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/photo.jpg\",\"remotePath\":\"photos/photo.jpg\",\"conflictStrategy\":\"rename\"}'\n```\n\n**User explicitly requested overwrite:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"overwrite\"}'\n```\n\n**Batch upload:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file1.pdf\",\"conflictStrategy\":\"rename\"}'\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file2.docx\",\"conflictStrategy\":\"rename\"}'\n```\n\n#### Conflict handling\n\nWhen using `conflictStrategy: \"rename\"` (默认), if a same-name file already exists, the script automatically renames the file (e.g. `file(1).pdf`) and completes the upload, ensuring a valid download link is always returned.\n\nWhen using `conflictStrategy: \"ask\"`, if a same-name file already exists, the script returns `{\"success\":false,\"conflict\":true}`. Agent must then ask the user:\n\n> 云端已存在同名文件 `{filename}`，你想怎么处理？\n>\n> 1. 🔄 覆盖 — 替换云端文件\n> 2. 📝 重命名 — 自动改名上传（如 file(1).pdf）\n> 3. ❌ 取消 — 不上传\n\n**三种策略对照：**\n\n| Strategy | Behavior | When to use |\n|----------|----------|-------------|\n| `rename` (**默认**) | 同名文件存在时自动重命名，确保上传成功并返回正确链接 | 大多数场景，需要保证用户拿到下载链接 |\n| `overwrite` | 直接覆盖已有文件 | 用户明确说 \"覆盖\", \"替换\", \"更新文件\" |\n| `ask` | 同名文件存在时返回错误，Agent 询问用户 | 用户明确要求先确认时 |\n\n### Step 4: Deliver link + execution notice\n\nAfter every successful upload, include this notice alongside the download link(s):\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n\n**链接输出规则（MUST）：**\n1. **必须使用带 COS 签名的直链**（`downloadUrl` 字段），域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`\n2. **禁止输出含 `accessToken` 的中转链接**（如 `https://api.tencentsmh.cn/...?access_token=...`），这会泄露凭证\n3. **链接必须完整输出，禁止任何形式的截断、省略或缩写**——不能用 `...`、`<省略>` 等替代任何部分。签名链接通常很长，这是正常的\n\n**Single file example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 已上传文件: report.pdf  大小: (2.3 MB)\n> 下载链接: {脚本返回的完整 downloadUrl，原样输出，不得截断}\n\n**Batch example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 📎 report.pdf (2.3 MB) — {完整 downloadUrl}\n> 📎 photo.jpg (1.1 MB) — {完整 downloadUrl}\n\n---\n\n## File Size Support\n\n**There is NO file size limit.** The upload script supports files of any size, including multi-GB videos.\n\n- **Small files (≤ 50 MB)**: Single-part upload.\n- **Large files (> 50 MB)**: Multipart upload — the file is read in 5 MB chunks, never loaded entirely into memory.\n\n---\n\n## Commands\n\n所有命令输出 JSON 到 stdout。\n\n### upload\n\n```bash\nnode scripts/agent-storage.js upload '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标路径，省略则上传到根目录并保留原文件名\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"upload\": {\n    \"localFile\": \"/path/to/photo.jpg\",\n    \"remotePath\": \"photo.jpg\",\n    \"fileSize\": 2048576,\n    \"fileSizeHuman\": \"2.0 MB\",\n    \"uploadTime\": \"3.2s\",\n    \"rapidUpload\": false\n  },\n  \"downloadUrl\": \"https://bucket-xxxxx.tencentsmhuc.cn/smhxxx/...photo.jpg?response-content-disposition=inline&smh-space=space-xxx&x-cos-security-token=...&q-sign-algorithm=sha1&q-signature=...\"\n}\n```\n\n### info\n\n```bash\nnode scripts/agent-storage.js info '<json>'\n```\n\n**JSON 参数：**\n- `remotePath`（必填）：云端文件路径\n- `basePath` / `libraryId` / `spaceId` / `accessToken`（可选）：直接传参模式凭证\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"remotePath\": \"report.pdf\",\n  \"downloadUrl\": \"https://bucket-xxxxx.tencentsmhuc.cn/smhxxx/...report.pdf?response-content-disposition=inline&smh-space=space-xxx&x-cos-security-token=...&q-sign-algorithm=sha1&q-signature=...\",\n  \"fileInfo\": {\n    \"name\": \"report.pdf\",\n    \"size\": 2048576,\n    \"type\": \"application/pdf\",\n    \"creationTime\": \"2026-03-13T10:00:00Z\",\n    \"modificationTime\": \"2026-03-13T10:00:00Z\"\n  }\n}\n```\n\n### list\n\n```bash\nnode scripts/agent-storage.js list '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（可选）：目录路径，默认 `/`\n- `limit`（可选）：最大返回数量，默认 50\n\n---\n\n## Full Example\n\n```bash\n# Step 0: 安装 smh-node-sdk（首次使用前执行一次）\nnpm install -g smh-node-sdk\n\n# Step 1: 上传文件\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"rename\"}'\n\n# Step 2: 查询文件信息\nnode scripts/agent-storage.js info '{\"remotePath\":\"report.pdf\"}'\n\n# Step 3: 列出云端文件\nnode scripts/agent-storage.js list '{\"dirPath\":\"/\",\"limit\":20}'\n```\n\n---\n\n## Pitfalls\n\n### Error handling\n\n所有命令输出 JSON 到 stdout。错误也以 JSON 返回：`{\"success\": false, \"error\": \"...\"}`\n\n| 错误 | 处理方式 |\n|------|---------|\n| 上传失败（`success: false`） | 告诉用户：\"文件上传失败：{具体原因}。你可以稍后再试，或者检查网络连接。\" |\n| 同名冲突（`conflict: true`） | 询问用户选择覆盖、重命名或取消 |\n| 文件不存在 | 让用户确认路径 |\n| 网络错误 | 重试 2 次，间隔 3s；仍失败告知用户 |\n| 配置缺失 | 提示用户在 `~/.tencentAgentStorage/.env`、`~/.openclaw/openclaw.json` 的 `env` 字段或 `~/.hermes/.env` 中添加 `smh_*` 配置 |\n\n**上传失败对话模板**（当 `success: false` 时必须使用）：\n\n> ❌ 文件上传失败：{error 中的具体原因}。\n>\n> 你可以：\n> 1. 🔄 重试 — 重新上传这个文件\n> 2. ❌ 取消 — 暂时不上传\n\n### Prohibited actions\n\n- **NEVER** 在 `success: false` 时展示下载链接\n- **NEVER** 在上传失败时不告知用户，必须明确提示\"文件上传失败\"及原因\n- **NEVER** 硬编码或暴露 SMH 凭证给用户\n- **NEVER** 未经用户主动要求就上传其本地个人文件\n- **NEVER** 跳过执行通知：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n- **NEVER** 在用户未明确要求覆盖时使用 `conflictStrategy: \"overwrite\"`\n- **NEVER** 把含 `accessToken` 的中转链接（如 `https://api.tencentsmh.cn/...?access_token=...`）发给用户。返回给用户的**必须是带 COS 签名的直链**（域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`），即脚本输出的 `downloadUrl` 字段\n- **NEVER** 截断、省略或用 `...` 缩写链接。发给用户的下载链接/预览链接**必须是脚本返回的完整 URL**，一个字符都不能少。链接通常很长（含签名参数），这是正常的，**必须原样完整输出**\n\n### Common mistakes\n\n- 用户说\"上传文件\"但没指定路径 → 追问：\"你要上传哪个文件？告诉我文件路径或文件名就行。\"\n- 用户说\"确定上传 xxx\"或\"把 xxx 发给我\" → 直接执行上传（`conflictStrategy: \"rename\"`）\n- **同名文件冲突**：默认使用 `conflictStrategy: \"rename\"`，自动重命名保证上传成功。只有用户明确要求覆盖时才用 `overwrite`，用户明确要求先确认时才用 `ask`\n- 文件默认上传到云空间根目录，用户可通过 `remotePath` 参数指定目标路径\n- 下载链接为通过 SDK `infoFile({ purpose: 'download' })` 获取的带签名 COS 直链（`https://bucket-xxxxx.tencentsmhuc.cn/...?q-sign-algorithm=sha1&q-signature=...`），可直接在浏览器或手机中打开预览/下载，**有效期约 2 小时**。**必须原样完整输出此链接，禁止截断或省略任何部分**\n- 批量上传按顺序处理（不并行），避免 API 过载\n- **执行通知**：每次上传完成后必须告知用户：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\n---\n\n## Verification\n\nUpload was successful when ALL of the following are true:\n\n1. Script output contains `\"success\": true`\n2. `downloadUrl` field is present and non-empty\n3. Agent delivered the download link to the user with the execution notice: \"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\nTo verify a previously uploaded file still exists:\n\n```bash\nnode scripts/agent-storage.js info '{\"remotePath\":\"<filename>\"}'\n```\n\nIf the response contains `\"success\": true`, the file is accessible and a fresh download link is returned.\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn75r0rammt45k8qe5we0sh63580c5y0\",\n  \"slug\": \"tencent-agent-storage\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1777015489821\n}\n\nArchive v1.0.11: 3 files, 11376 bytes\n\nFiles: scripts/agent-storage.js (9971b), SKILL.md (18798b), _meta.json (141b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: tencent-agent-storage\nversion: 1.0.7\nauthor: shawnmzhang\nlicense: MIT\ndescription: |\n  Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\n  Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\n  MUST trigger when the user mentions ANY of the following concepts:\n  【云盘/网盘相关 — Cloud Drive Access】\n  - \"网盘\", \"云盘\", \"云空间\", \"龙虾盘\", \"龙虾云盘\", \"龙虾网盘\", \"龙虾空间\"\n  - \"专属云盘\", \"专属网盘\", \"专属空间\", \"我的云盘\", \"我的网盘\", \"我的龙虾\"\n  - \"打开网盘\", \"打开云盘\", \"进入网盘\", \"进入云盘\", \"看看云盘\", \"看看网盘\"\n  - \"cloud drive\", \"my drive\", \"open drive\", \"lobster drive\"\n  【文件列表/查看 — File Listing & Browsing】\n  - \"列出文件\", \"有哪些文件\", \"看看文件\", \"文件列表\", \"我的文件\"\n  - \"云盘里有什么\", \"空间里有啥\", \"查看云空间\", \"云空间文件\"\n  - \"list files\", \"show files\", \"my files\", \"what files\", \"browse files\"\n  【上传/备份 — Upload & Backup】\n  - \"上传文件\", \"上传某个文件\", \"确定上传\", \"传到云空间\", \"上传到云空间\"\n  - \"备份到云\", \"备份文件\", \"保存到云\", \"存到网盘\", \"传到网盘\", \"存到云盘\", \"传到云盘\"\n  - \"文件传一下\", \"帮我传个文件\", \"把这个存一下\"\n  - \"upload\", \"backup\", \"save to cloud\", \"back up\"\n  【发送/传输给用户 — Send & Deliver Files】\n  - \"把文件发给我\", \"整理好发我\", \"发到手机\", \"传到手机\"\n  - \"做完了发我一份\", \"弄好了发给我\", \"完成后把文件给我\"\n  - \"导出之后发我\", \"生成完发给我看看\", \"跑完了把结果给我\"\n  - \"send file\", \"send to phone\", \"deliver file\", \"give me the file\"\n  【链接/分享 — Links & Sharing】\n  - \"生成下载链接\", \"做成链接\", \"给我下载链接\"\n  - \"生成个链接发给同事\", \"发到群里\", \"分享文件\", \"分享给别人\", \"发个链接\"\n  - \"download link\", \"share file\", \"share link\", \"generate link\"\n  【文件状态查询 — File Status Check】\n  - \"这个云文件还在吗\", \"之前上传的文件还能下吗\", \"链接过期了能重新生成吗\"\n  - \"is file still there\", \"can I still download\", \"regenerate link\"\n  【隐式触发 — Implicit Triggers】\n  - When a task produces output files (reports, exports, generated content) that need to be delivered to the user\n  - When the user's intent implies needing a file on another device, even without explicitly saying \"upload\"\n  - When MyClaw/agent needs to upload files to generate download links\n  - Any mention of file transfer, cloud storage, or personal file space in the conversation context\nmetadata:\n  # ── OpenClaw 兼容 ──\n  openclaw:\n    emoji: \"☁️\"\n    requires:\n      bins:\n        - node\n        - npm\n      packages:\n        npm:\n          - smh-node-sdk\n      env:\n        - smh_libraryId\n        - smh_accessToken\n        - smh_spaceId\n        - smh_basePath\n  # ── Hermes Agent 兼容 ──\n  hermes:\n    tags: [Cloud Storage, File Management, Upload, Backup, Tencent Agent Storage]\n    related_skills: []\n    required_environment_variables:\n      - name: smh_libraryId\n        prompt: \"SMH Library ID\"\n        help: \"Your Tencent SMH library ID, e.g. smhxxx-xxxxx\"\n        required_for: \"API access to Tencent Agent Storage\"\n      - name: smh_accessToken\n        prompt: \"SMH Access Token\"\n        help: \"A space_admin level access token for Tencent Agent Storage\"\n        required_for: \"File upload and download link generation\"\n      - name: smh_spaceId\n        prompt: \"SMH Space ID\"\n        help: \"Your cloud drive space ID, e.g. space-xxxxx\"\n        required_for: \"Identifying the target storage space\"\n      - name: smh_basePath\n        prompt: \"SMH API Base Path\"\n        help: \"Tencent SMH API endpoint, defaults to https://api.tencentsmh.cn\"\n        required_for: \"API endpoint configuration\"\n    config:\n      - key: smh.basePath\n        description: \"Tencent SMH API base URL\"\n        default: \"https://api.tencentsmh.cn\"\n        prompt: \"SMH API base path\"\n---\n\n# Tencent Agent Storage (云文件上传备份工具)\n\n将本地文件上传至 Tencent Agent Storage，自动生成下载链接和图片预览。上传的文件存储在用户独有的云盘空间中，支持跨端访问——无论是手机、电脑还是平板，用户都可以随时随地查看和下载自己的文件。\n\n## When to Use\n\nAgent **MUST** activate this skill when any of the following conditions are met:\n\n- User mentions cloud drive keywords: 网盘、云盘、云空间、龙虾盘、专属网盘、cloud drive, my drive\n- User requests file listing or browsing: 列出文件、有哪些文件、list files, show files\n- User requests upload or backup: 上传文件、备份到云、存到网盘、upload, backup, save to cloud\n- User asks to send/deliver files: 把文件发给我、发到手机、send file, deliver file\n- User requests links or sharing: 生成下载链接、分享文件、download link, share link\n- User queries file status: 这个云文件还在吗、链接过期了、is file still there\n- **Implicit**: A task produces output files that need to be delivered to the user, or the user's intent implies needing a file on another device\n\n## Quick Reference\n\n| Command | Usage | Description |\n|---------|-------|-------------|\n| `upload` | `node scripts/agent-storage.js upload '<json>'` | Upload local file to cloud, returns download link |\n| `info` | `node scripts/agent-storage.js info '<json>'` | Get file info and regenerate download link |\n| `list` | `node scripts/agent-storage.js list '<json>'` | List files in a cloud directory |\n\n## Setup\n\n### Prerequisites\n\n此 skill 需要 **Node.js ≥ 14** 和 **npm**。Agent 在首次执行前**必须检测运行环境**：\n\n```bash\nnode --version   # 期望输出 v14.x 或更高\nnpm --version\n```\n\n如果 `node` 命令不存在或版本低于 14，直接安装：\n\n根据用户系统自动选择安装方式：\n\n```bash\n# macOS (Homebrew)\nbrew install node\n\n# macOS (无 Homebrew)\ncurl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg\n\n# Linux (Debian/Ubuntu)\ncurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs\n\n# Linux (其他发行版 / 通用)\ncurl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1\n\n# Windows (PowerShell, 管理员)\nwinget install OpenJS.NodeJS.LTS\n\n# Windows (无 winget)\n# 下载安装包: https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi 并运行\n\n# 跨平台 (已有 nvm)\nnvm install --lts\n```\n\n此 skill 还依赖 `smh-node-sdk` npm 包。**必须在使用前完成安装**（二选一）：\n\n```bash\n# 方式一：全局安装（推荐）\nnpm install -g smh-node-sdk\n\n# 方式二：本地安装到项目目录\nnpm install smh-node-sdk\n```\n\n> 脚本会按以下顺序查找 SDK：当前项目 node_modules → 全局 node_modules。如果未找到，脚本会报错并提示安装命令。\n\n### About the upload script\n\n此 skill 的运行脚本位于 `scripts/agent-storage.js`。Agent 直接通过 `node scripts/agent-storage.js <command> '<json>'` 调用，**无需额外写入临时文件**。脚本源码可在 `scripts/` 目录中审阅。\n\n### Credential configuration\n\n凭证从以下配置文件中自动加载（优先级从高到低）。\n\n> **安全说明**：脚本仅读取配置文件中 `smh_` 前缀的环境变量（`smh_libraryId`、`smh_accessToken` 等），不会访问配置文件中的其他字段或敏感信息。\n\n> **关于 token 权限**：Tencent Agent Storage 的文件上传和下载链接生成 API 要求 `space_admin` 级别的 accessToken，这是 Tencent Agent Storage 服务端对文件写入操作的最低权限要求。\n\n**模式一：直接凭证（accessToken）**\n\n凭证文件查找顺序（先找到者优先）：\n\n1. **通用配置** — `~/.tencentAgentStorage/.env`\n2. **OpenClaw** — `~/.openclaw/openclaw.json` 的 `env` 字段\n3. **Hermes** — `~/.hermes/.env`\n\n**通用配置（推荐）** — 在 `~/.tencentAgentStorage/.env` 中配置：\n\n```env\n# ~/.tencentAgentStorage/.env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n**OpenClaw** — 在 `~/.openclaw/openclaw.json` 的 `env` 字段中配置：\n\n```json\n{\n  \"env\": {\n    \"smh_basePath\": \"https://api.tencentsmh.cn\",\n    \"smh_libraryId\": \"smhxxx-xxxxx\",\n    \"smh_spaceId\": \"space-xxxxx\",\n    \"smh_accessToken\": \"<your-access-token>\"\n  }\n}\n```\n\n**Hermes** — 在 `~/.hermes/.env` 中配置：\n\n```env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n\n---\n\n## Procedure\n\nAgent uses this skill in any scenario that requires uploading files to the cloud.\n\n### Complete flow\n\n```\nUser triggers file upload\n  → Step 1: Identify the local file path(s)\n  → Step 2: Run upload script (loop for batch)\n  → Step 3: Extract downloadUrl from JSON output (signed COS URL)\n  → Step 4: Deliver the download link with execution notice\n```\n\n> **IMPORTANT**: 默认使用 `conflictStrategy: \"rename\"` 上传。当云端已存在同名文件时，脚本会自动重命名（如 `file(1).pdf`），确保上传始终成功并返回正确的下载链接。**只有用户明确说了 \"覆盖\"/\"替换\" 时，才使用 `conflictStrategy: \"overwrite\"`；用户明确要求先确认时，才使用 `conflictStrategy: \"ask\"`。**\n\n### Step 2: Upload\n\n**Single file (默认):**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file.pdf\",\"conflictStrategy\":\"rename\"}'\n```\n\n**Upload to specific directory:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/photo.jpg\",\"remotePath\":\"photos/photo.jpg\",\"conflictStrategy\":\"rename\"}'\n```\n\n**User explicitly requested overwrite:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"overwrite\"}'\n```\n\n**Batch upload:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file1.pdf\",\"conflictStrategy\":\"rename\"}'\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file2.docx\",\"conflictStrategy\":\"rename\"}'\n```\n\n#### Conflict handling\n\nWhen using `conflictStrategy: \"rename\"` (默认), if a same-name file already exists, the script automatically renames the file (e.g. `file(1).pdf`) and completes the upload, ensuring a valid download link is always returned.\n\nWhen using `conflictStrategy: \"ask\"`, if a same-name file already exists, the script returns `{\"success\":false,\"conflict\":true}`. Agent must then ask the user:\n\n> 云端已存在同名文件 `{filename}`，你想怎么处理？\n>\n> 1. 🔄 覆盖 — 替换云端文件\n> 2. 📝 重命名 — 自动改名上传（如 file(1).pdf）\n> 3. ❌ 取消 — 不上传\n\n**三种策略对照：**\n\n| Strategy | Behavior | When to use |\n|----------|----------|-------------|\n| `rename` (**默认**) | 同名文件存在时自动重命名，确保上传成功并返回正确链接 | 大多数场景，需要保证用户拿到下载链接 |\n| `overwrite` | 直接覆盖已有文件 | 用户明确说 \"覆盖\", \"替换\", \"更新文件\" |\n| `ask` | 同名文件存在时返回错误，Agent 询问用户 | 用户明确要求先确认时 |\n\n### Step 4: Deliver link + execution notice\n\nAfter every successful upload, include this notice alongside the download link(s):\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n\n**链接输出规则（MUST）：**\n1. **必须使用带 COS 签名的直链**（`downloadUrl` 字段），域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`\n2. **禁止输出含 `accessToken` 的中转链接**（如 `https://api.tencentsmh.cn/...?access_token=...`），这会泄露凭证\n3. **链接必须完整输出，禁止任何形式的截断、省略或缩写**——不能用 `...`、`<省略>` 等替代任何部分。签名链接通常很长，这是正常的\n\n**Single file example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 已上传文件: report.pdf  大小: (2.3 MB)\n> 下载链接: {脚本返回的完整 downloadUrl，原样输出，不得截断}\n\n**Batch example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 📎 report.pdf (2.3 MB) — {完整 downloadUrl}\n> 📎 photo.jpg (1.1 MB) — {完整 downloadUrl}\n\n---\n\n## File Size Support\n\n**There is NO file size limit.** The upload script supports files of any size, including multi-GB videos.\n\n- **Small files (≤ 50 MB)**: Single-part upload.\n- **Large files (> 50 MB)**: Multipart upload — the file is read in 5 MB chunks, never loaded entirely into memory.\n\n---\n\n## Commands\n\n所有命令输出 JSON 到 stdout。\n\n### upload\n\n```bash\nnode scripts/agent-storage.js upload '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标路径，省略则上传到根目录并保留原文件名\n- `conflictStrategy`（可选）：`rename`（默认）| `ask` | `overwrite`\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"upload\": {\n    \"localFile\": \"/path/to/photo.jpg\",\n    \"remotePath\": \"photo.jpg\",\n    \"fileSize\": 2048576,\n    \"fileSizeHuman\": \"2.0 MB\",\n    \"uploadTime\": \"3.2s\",\n    \"rapidUpload\": false\n  },\n  \"downloadUrl\": \"https://bucket-xxxxx.tencentsmhuc.cn/smhxxx/...photo.jpg?response-content-disposition=inline&smh-space=space-xxx&x-cos-security-token=...&q-sign-algorithm=sha1&q-signature=...\"\n}\n```\n\n### info\n\n```bash\nnode scripts/agent-storage.js info '<json>'\n```\n\n**JSON 参数：**\n- `remotePath`（必填）：云端文件路径\n- `basePath` / `libraryId` / `spaceId` / `accessToken`（可选）：直接传参模式凭证\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"remotePath\": \"report.pdf\",\n  \"downloadUrl\": \"https://bucket-xxxxx.tencentsmhuc.cn/smhxxx/...report.pdf?response-content-disposition=inline&smh-space=space-xxx&x-cos-security-token=...&q-sign-algorithm=sha1&q-signature=...\",\n  \"fileInfo\": {\n    \"name\": \"report.pdf\",\n    \"size\": 2048576,\n    \"type\": \"application/pdf\",\n    \"creationTime\": \"2026-03-13T10:00:00Z\",\n    \"modificationTime\": \"2026-03-13T10:00:00Z\"\n  }\n}\n```\n\n### list\n\n```bash\nnode scripts/agent-storage.js list '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（可选）：目录路径，默认 `/`\n- `limit`（可选）：最大返回数量，默认 50\n\n---\n\n## Full Example\n\n```bash\n# Step 0: 安装 smh-node-sdk（首次使用前执行一次）\nnpm install -g smh-node-sdk\n\n# Step 1: 上传文件\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"rename\"}'\n\n# Step 2: 查询文件信息\nnode scripts/agent-storage.js info '{\"remotePath\":\"report.pdf\"}'\n\n# Step 3: 列出云端文件\nnode scripts/agent-storage.js list '{\"dirPath\":\"/\",\"limit\":20}'\n```\n\n---\n\n## Pitfalls\n\n### Error handling\n\n所有命令输出 JSON 到 stdout。错误也以 JSON 返回：`{\"success\": false, \"error\": \"...\"}`\n\n| 错误 | 处理方式 |\n|------|---------|\n| 上传失败（`success: false`） | 告诉用户：\"文件上传失败：{具体原因}。你可以稍后再试，或者检查网络连接。\" |\n| 同名冲突（`conflict: true`） | 询问用户选择覆盖、重命名或取消 |\n| 文件不存在 | 让用户确认路径 |\n| 网络错误 | 重试 2 次，间隔 3s；仍失败告知用户 |\n| 配置缺失 | 提示用户在 `~/.tencentAgentStorage/.env`、`~/.openclaw/openclaw.json` 的 `env` 字段或 `~/.hermes/.env` 中添加 `smh_*` 配置 |\n\n**上传失败对话模板**（当 `success: false` 时必须使用）：\n\n> ❌ 文件上传失败：{error 中的具体原因}。\n>\n> 你可以：\n> 1. 🔄 重试 — 重新上传这个文件\n> 2. ❌ 取消 — 暂时不上传\n\n### Prohibited actions\n\n- **NEVER** 在 `success: false` 时展示下载链接\n- **NEVER** 在上传失败时不告知用户，必须明确提示\"文件上传失败\"及原因\n- **NEVER** 硬编码或暴露 SMH 凭证给用户\n- **NEVER** 未经用户主动要求就上传其本地个人文件\n- **NEVER** 跳过执行通知：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n- **NEVER** 在用户未明确要求覆盖时使用 `conflictStrategy: \"overwrite\"`\n- **NEVER** 把含 `accessToken` 的中转链接（如 `https://api.tencentsmh.cn/...?access_token=...`）发给用户。返回给用户的**必须是带 COS 签名的直链**（域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`），即脚本输出的 `downloadUrl` 字段\n- **NEVER** 截断、省略或用 `...` 缩写链接。发给用户的下载链接/预览链接**必须是脚本返回的完整 URL**，一个字符都不能少。链接通常很长（含签名参数），这是正常的，**必须原样完整输出**\n\n### Common mistakes\n\n- 用户说\"上传文件\"但没指定路径 → 追问：\"你要上传哪个文件？告诉我文件路径或文件名就行。\"\n- 用户说\"确定上传 xxx\"或\"把 xxx 发给我\" → 直接执行上传（`conflictStrategy: \"rename\"`）\n- **同名文件冲突**：默认使用 `conflictStrategy: \"rename\"`，自动重命名保证上传成功。只有用户明确要求覆盖时才用 `overwrite`，用户明确要求先确认时才用 `ask`\n- 文件默认上传到云空间根目录，用户可通过 `remotePath` 参数指定目标路径\n- 下载链接为通过 SDK `infoFile({ purpose: 'download' })` 获取的带签名 COS 直链（`https://bucket-xxxxx.tencentsmhuc.cn/...?q-sign-algorithm=sha1&q-signature=...`），可直接在浏览器或手机中打开预览/下载，**有效期约 2 小时**。**必须原样完整输出此链接，禁止截断或省略任何部分**\n- 批量上传按顺序处理（不并行），避免 API 过载\n- **执行通知**：每次上传完成后必须告知用户：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\n---\n\n## Verification\n\nUpload was successful when ALL of the following are true:\n\n1. Script output contains `\"success\": true`\n2. `downloadUrl` field is present and non-empty\n3. Agent delivered the download link to the user with the execution notice: \"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\nTo verify a previously uploaded file still exists:\n\n```bash\nnode scripts/agent-storage.js info '{\"remotePath\":\"<filename>\"}'\n```\n\nIf the response contains `\"success\": true`, the file is accessible and a fresh download link is returned.\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn75r0rammt45k8qe5we0sh63580c5y0\",\n  \"slug\": \"tencent-agent-storage\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1777015080167\n}\n\nArchive v1.0.10: 3 files, 11288 bytes\n\nFiles: scripts/agent-storage.js (9968b), SKILL.md (18451b), _meta.json (141b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: tencent-agent-storage\nversion: 1.0.7\nauthor: shawnmzhang\nlicense: MIT\ndescription: |\n  Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\n  Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\n  MUST trigger when the user mentions ANY of the following concepts:\n  【云盘/网盘相关 — Cloud Drive Access】\n  - \"网盘\", \"云盘\", \"云空间\", \"龙虾盘\", \"龙虾云盘\", \"龙虾网盘\", \"龙虾空间\"\n  - \"专属云盘\", \"专属网盘\", \"专属空间\", \"我的云盘\", \"我的网盘\", \"我的龙虾\"\n  - \"打开网盘\", \"打开云盘\", \"进入网盘\", \"进入云盘\", \"看看云盘\", \"看看网盘\"\n  - \"cloud drive\", \"my drive\", \"open drive\", \"lobster drive\"\n  【文件列表/查看 — File Listing & Browsing】\n  - \"列出文件\", \"有哪些文件\", \"看看文件\", \"文件列表\", \"我的文件\"\n  - \"云盘里有什么\", \"空间里有啥\", \"查看云空间\", \"云空间文件\"\n  - \"list files\", \"show files\", \"my files\", \"what files\", \"browse files\"\n  【上传/备份 — Upload & Backup】\n  - \"上传文件\", \"上传某个文件\", \"确定上传\", \"传到云空间\", \"上传到云空间\"\n  - \"备份到云\", \"备份文件\", \"保存到云\", \"存到网盘\", \"传到网盘\", \"存到云盘\", \"传到云盘\"\n  - \"文件传一下\", \"帮我传个文件\", \"把这个存一下\"\n  - \"upload\", \"backup\", \"save to cloud\", \"back up\"\n  【发送/传输给用户 — Send & Deliver Files】\n  - \"把文件发给我\", \"整理好发我\", \"发到手机\", \"传到手机\"\n  - \"做完了发我一份\", \"弄好了发给我\", \"完成后把文件给我\"\n  - \"导出之后发我\", \"生成完发给我看看\", \"跑完了把结果给我\"\n  - \"send file\", \"send to phone\", \"deliver file\", \"give me the file\"\n  【链接/分享 — Links & Sharing】\n  - \"生成下载链接\", \"做成链接\", \"给我下载链接\"\n  - \"生成个链接发给同事\", \"发到群里\", \"分享文件\", \"分享给别人\", \"发个链接\"\n  - \"download link\", \"share file\", \"share link\", \"generate link\"\n  【文件状态查询 — File Status Check】\n  - \"这个云文件还在吗\", \"之前上传的文件还能下吗\", \"链接过期了能重新生成吗\"\n  - \"is file still there\", \"can I still download\", \"regenerate link\"\n  【隐式触发 — Implicit Triggers】\n  - When a task produces output files (reports, exports, generated content) that need to be delivered to the user\n  - When the user's intent implies needing a file on another device, even without explicitly saying \"upload\"\n  - When MyClaw/agent needs to upload files to generate download links\n  - Any mention of file transfer, cloud storage, or personal file space in the conversation context\nmetadata:\n  # ── OpenClaw 兼容 ──\n  openclaw:\n    emoji: \"☁️\"\n    requires:\n      bins:\n        - node\n        - npm\n      packages:\n        npm:\n          - smh-node-sdk\n      env:\n        - smh_libraryId\n        - smh_accessToken\n        - smh_spaceId\n        - smh_basePath\n  # ── Hermes Agent 兼容 ──\n  hermes:\n    tags: [Cloud Storage, File Management, Upload, Backup, Tencent Agent Storage]\n    related_skills: []\n    required_environment_variables:\n      - name: smh_libraryId\n        prompt: \"SMH Library ID\"\n        help: \"Your Tencent SMH library ID, e.g. smhxxx-xxxxx\"\n        required_for: \"API access to Tencent Agent Storage\"\n      - name: smh_accessToken\n        prompt: \"SMH Access Token\"\n        help: \"A space_admin level access token for Tencent Agent Storage\"\n        required_for: \"File upload and download link generation\"\n      - name: smh_spaceId\n        prompt: \"SMH Space ID\"\n        help: \"Your cloud drive space ID, e.g. space-xxxxx\"\n        required_for: \"Identifying the target storage space\"\n      - name: smh_basePath\n        prompt: \"SMH API Base Path\"\n        help: \"Tencent SMH API endpoint, defaults to https://api.tencentsmh.cn\"\n        required_for: \"API endpoint configuration\"\n    config:\n      - key: smh.basePath\n        description: \"Tencent SMH API base URL\"\n        default: \"https://api.tencentsmh.cn\"\n        prompt: \"SMH API base path\"\n---\n\n# Tencent Agent Storage (云文件上传备份工具)\n\n将本地文件上传至 Tencent Agent Storage，自动生成下载链接和图片预览。上传的文件存储在用户独有的云盘空间中，支持跨端访问——无论是手机、电脑还是平板，用户都可以随时随地查看和下载自己的文件。\n\n## When to Use\n\nAgent **MUST** activate this skill when any of the following conditions are met:\n\n- User mentions cloud drive keywords: 网盘、云盘、云空间、龙虾盘、专属网盘、cloud drive, my drive\n- User requests file listing or browsing: 列出文件、有哪些文件、list files, show files\n- User requests upload or backup: 上传文件、备份到云、存到网盘、upload, backup, save to cloud\n- User asks to send/deliver files: 把文件发给我、发到手机、send file, deliver file\n- User requests links or sharing: 生成下载链接、分享文件、download link, share link\n- User queries file status: 这个云文件还在吗、链接过期了、is file still there\n- **Implicit**: A task produces output files that need to be delivered to the user, or the user's intent implies needing a file on another device\n\n## Quick Reference\n\n| Command | Usage | Description |\n|---------|-------|-------------|\n| `upload` | `node scripts/agent-storage.js upload '<json>'` | Upload local file to cloud, returns download link |\n| `info` | `node scripts/agent-storage.js info '<json>'` | Get file info and regenerate download link |\n| `list` | `node scripts/agent-storage.js list '<json>'` | List files in a cloud directory |\n\n## Setup\n\n### Prerequisites\n\n此 skill 需要 **Node.js ≥ 14** 和 **npm**。Agent 在首次执行前**必须检测运行环境**：\n\n```bash\nnode --version   # 期望输出 v14.x 或更高\nnpm --version\n```\n\n如果 `node` 命令不存在或版本低于 14，直接安装：\n\n根据用户系统自动选择安装方式：\n\n```bash\n# macOS (Homebrew)\nbrew install node\n\n# macOS (无 Homebrew)\ncurl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg\n\n# Linux (Debian/Ubuntu)\ncurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs\n\n# Linux (其他发行版 / 通用)\ncurl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1\n\n# Windows (PowerShell, 管理员)\nwinget install OpenJS.NodeJS.LTS\n\n# Windows (无 winget)\n# 下载安装包: https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi 并运行\n\n# 跨平台 (已有 nvm)\nnvm install --lts\n```\n\n此 skill 还依赖 `smh-node-sdk` npm 包。**必须在使用前完成安装**（二选一）：\n\n```bash\n# 方式一：全局安装（推荐）\nnpm install -g smh-node-sdk\n\n# 方式二：本地安装到项目目录\nnpm install smh-node-sdk\n```\n\n> 脚本会按以下顺序查找 SDK：当前项目 node_modules → 全局 node_modules。如果未找到，脚本会报错并提示安装命令。\n\n### About the upload script\n\n此 skill 的运行脚本位于 `scripts/agent-storage.js`。Agent 直接通过 `node scripts/agent-storage.js <command> '<json>'` 调用，**无需额外写入临时文件**。脚本源码可在 `scripts/` 目录中审阅。\n\n### Credential configuration\n\n凭证从以下配置文件中自动加载（优先级从高到低）。\n\n> **安全说明**：脚本仅读取配置文件中 `smh_` 前缀的环境变量（`smh_libraryId`、`smh_accessToken` 等），不会访问配置文件中的其他字段或敏感信息。\n\n> **关于 token 权限**：Tencent Agent Storage 的文件上传和下载链接生成 API 要求 `space_admin` 级别的 accessToken，这是 Tencent Agent Storage 服务端对文件写入操作的最低权限要求。\n\n**模式一：直接凭证（accessToken）**\n\n凭证文件查找顺序（先找到者优先）：\n\n1. **通用配置** — `~/.tencentAgentStorage/.env`\n2. **OpenClaw** — `~/.openclaw/openclaw.json` 的 `env` 字段\n3. **Hermes** — `~/.hermes/.env`\n\n**通用配置（推荐）** — 在 `~/.tencentAgentStorage/.env` 中配置：\n\n```env\n# ~/.tencentAgentStorage/.env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n**OpenClaw** — 在 `~/.openclaw/openclaw.json` 的 `env` 字段中配置：\n\n```json\n{\n  \"env\": {\n    \"smh_basePath\": \"https://api.tencentsmh.cn\",\n    \"smh_libraryId\": \"smhxxx-xxxxx\",\n    \"smh_spaceId\": \"space-xxxxx\",\n    \"smh_accessToken\": \"<your-access-token>\"\n  }\n}\n```\n\n**Hermes** — 在 `~/.hermes/.env` 中配置：\n\n```env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n\n---\n\n## Procedure\n\nAgent uses this skill in any scenario that requires uploading files to the cloud.\n\n### Complete flow\n\n```\nUser triggers file upload\n  → Step 1: Identify the local file path(s)\n  → Step 2: Run upload script (loop for batch)\n  → Step 3: Extract downloadUrl from JSON output (signed COS URL)\n  → Step 4: Deliver the download link with execution notice\n```\n\n> **IMPORTANT**: 默认必须使用 `conflictStrategy: \"ask\"` 上传。这样当云端已存在同名文件时，脚本会返回错误，Agent 可以询问用户如何处理。**只有用户明确说了 \"覆盖\"/\"替换\" 或 \"重命名\" 时，才使用对应的 `conflictStrategy: \"overwrite\"` 或 `conflictStrategy: \"rename\"`。**\n\n### Step 2: Upload\n\n**Single file (默认):**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file.pdf\",\"conflictStrategy\":\"ask\"}'\n```\n\n**Upload to specific directory:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/photo.jpg\",\"remotePath\":\"photos/photo.jpg\",\"conflictStrategy\":\"ask\"}'\n```\n\n**User explicitly requested overwrite:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"overwrite\"}'\n```\n\n**Batch upload:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file1.pdf\",\"conflictStrategy\":\"ask\"}'\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file2.docx\",\"conflictStrategy\":\"ask\"}'\n```\n\n#### Conflict handling\n\nWhen using `conflictStrategy: \"ask\"` (默认), if a same-name file already exists, the script returns `{\"success\":false,\"conflict\":true}`. Agent must then ask the user:\n\n> 云端已存在同名文件 `{filename}`，你想怎么处理？\n>\n> 1. 🔄 覆盖 — 替换云端文件\n> 2. 📝 重命名 — 自动改名上传（如 file(1).pdf）\n> 3. ❌ 取消 — 不上传\n\n**三种策略对照：**\n\n| Strategy | Behavior | When to use |\n|----------|----------|-------------|\n| `ask` (**默认，必须使用**) | 同名文件存在时返回错误，Agent 询问用户 | 用户未表明偏好时 |\n| `overwrite` | 直接覆盖已有文件 | 用户明确说 \"覆盖\", \"替换\", \"更新文件\" |\n| `rename` | 自动重命名 → `file(1).pdf` | 用户明确说 \"重命名\", \"改名上传\" |\n\n### Step 4: Deliver link + execution notice\n\nAfter every successful upload, include this notice alongside the download link(s):\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n\n**链接输出规则（MUST）：**\n1. **必须使用带 COS 签名的直链**（`downloadUrl` 字段），域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`\n2. **禁止输出含 `accessToken` 的中转链接**（如 `https://api.tencentsmh.cn/...?access_token=...`），这会泄露凭证\n3. **链接必须完整输出，禁止任何形式的截断、省略或缩写**——不能用 `...`、`<省略>` 等替代任何部分。签名链接通常很长，这是正常的\n\n**Single file example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 已上传文件: report.pdf  大小: (2.3 MB)\n> 下载链接: {脚本返回的完整 downloadUrl，原样输出，不得截断}\n\n**Batch example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 📎 report.pdf (2.3 MB) — {完整 downloadUrl}\n> 📎 photo.jpg (1.1 MB) — {完整 downloadUrl}\n\n---\n\n## File Size Support\n\n**There is NO file size limit.** The upload script supports files of any size, including multi-GB videos.\n\n- **Small files (≤ 50 MB)**: Single-part upload.\n- **Large files (> 50 MB)**: Multipart upload — the file is read in 5 MB chunks, never loaded entirely into memory.\n\n---\n\n## Commands\n\n所有命令输出 JSON 到 stdout。\n\n### upload\n\n```bash\nnode scripts/agent-storage.js upload '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标路径，省略则上传到根目录并保留原文件名\n- `conflictStrategy`（可选）：`ask`（默认）| `rename` | `overwrite`\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"upload\": {\n    \"localFile\": \"/path/to/photo.jpg\",\n    \"remotePath\": \"photo.jpg\",\n    \"fileSize\": 2048576,\n    \"fileSizeHuman\": \"2.0 MB\",\n    \"uploadTime\": \"3.2s\",\n    \"rapidUpload\": false\n  },\n  \"downloadUrl\": \"https://bucket-xxxxx.tencentsmhuc.cn/smhxxx/...photo.jpg?response-content-disposition=inline&smh-space=space-xxx&x-cos-security-token=...&q-sign-algorithm=sha1&q-signature=...\"\n}\n```\n\n### info\n\n```bash\nnode scripts/agent-storage.js info '<json>'\n```\n\n**JSON 参数：**\n- `remotePath`（必填）：云端文件路径\n- `basePath` / `libraryId` / `spaceId` / `accessToken`（可选）：直接传参模式凭证\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"remotePath\": \"report.pdf\",\n  \"downloadUrl\": \"https://bucket-xxxxx.tencentsmhuc.cn/smhxxx/...report.pdf?response-content-disposition=inline&smh-space=space-xxx&x-cos-security-token=...&q-sign-algorithm=sha1&q-signature=...\",\n  \"fileInfo\": {\n    \"name\": \"report.pdf\",\n    \"size\": 2048576,\n    \"type\": \"application/pdf\",\n    \"creationTime\": \"2026-03-13T10:00:00Z\",\n    \"modificationTime\": \"2026-03-13T10:00:00Z\"\n  }\n}\n```\n\n### list\n\n```bash\nnode scripts/agent-storage.js list '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（可选）：目录路径，默认 `/`\n- `limit`（可选）：最大返回数量，默认 50\n\n---\n\n## Full Example\n\n```bash\n# Step 0: 安装 smh-node-sdk（首次使用前执行一次）\nnpm install -g smh-node-sdk\n\n# Step 1: 上传文件\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"ask\"}'\n\n# Step 2: 查询文件信息\nnode scripts/agent-storage.js info '{\"remotePath\":\"report.pdf\"}'\n\n# Step 3: 列出云端文件\nnode scripts/agent-storage.js list '{\"dirPath\":\"/\",\"limit\":20}'\n```\n\n---\n\n## Pitfalls\n\n### Error handling\n\n所有命令输出 JSON 到 stdout。错误也以 JSON 返回：`{\"success\": false, \"error\": \"...\"}`\n\n| 错误 | 处理方式 |\n|------|---------|\n| 上传失败（`success: false`） | 告诉用户：\"文件上传失败：{具体原因}。你可以稍后再试，或者检查网络连接。\" |\n| 同名冲突（`conflict: true`） | 询问用户选择覆盖、重命名或取消 |\n| 文件不存在 | 让用户确认路径 |\n| 网络错误 | 重试 2 次，间隔 3s；仍失败告知用户 |\n| 配置缺失 | 提示用户在 `~/.tencentAgentStorage/.env`、`~/.openclaw/openclaw.json` 的 `env` 字段或 `~/.hermes/.env` 中添加 `smh_*` 配置 |\n\n**上传失败对话模板**（当 `success: false` 时必须使用）：\n\n> ❌ 文件上传失败：{error 中的具体原因}。\n>\n> 你可以：\n> 1. 🔄 重试 — 重新上传这个文件\n> 2. ❌ 取消 — 暂时不上传\n\n### Prohibited actions\n\n- **NEVER** 在 `success: false` 时展示下载链接\n- **NEVER** 在上传失败时不告知用户，必须明确提示\"文件上传失败\"及原因\n- **NEVER** 硬编码或暴露 SMH 凭证给用户\n- **NEVER** 未经用户主动要求就上传其本地个人文件\n- **NEVER** 跳过执行通知：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n- **NEVER** 在用户未明确表态时使用 `conflictStrategy: \"rename\"` 或 `conflictStrategy: \"overwrite\"`\n- **NEVER** 把含 `accessToken` 的中转链接（如 `https://api.tencentsmh.cn/...?access_token=...`）发给用户。返回给用户的**必须是带 COS 签名的直链**（域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`），即脚本输出的 `downloadUrl` 字段\n- **NEVER** 截断、省略或用 `...` 缩写链接。发给用户的下载链接/预览链接**必须是脚本返回的完整 URL**，一个字符都不能少。链接通常很长（含签名参数），这是正常的，**必须原样完整输出**\n\n### Common mistakes\n\n- 用户说\"上传文件\"但没指定路径 → 追问：\"你要上传哪个文件？告诉我文件路径或文件名就行。\"\n- 用户说\"确定上传 xxx\"或\"把 xxx 发给我\" → 直接执行上传（`conflictStrategy: \"ask\"`）\n- **同名文件冲突**：上传时必须使用 `conflictStrategy: \"ask\"`。如果返回 `conflict: true`，必须询问用户选择覆盖、重命名或取消\n- 文件默认上传到云空间根目录，用户可通过 `remotePath` 参数指定目标路径\n- 下载链接为通过 SDK `infoFile({ purpose: 'download' })` 获取的带签名 COS 直链（`https://bucket-xxxxx.tencentsmhuc.cn/...?q-sign-algorithm=sha1&q-signature=...`），可直接在浏览器或手机中打开预览/下载，**有效期约 2 小时**。**必须原样完整输出此链接，禁止截断或省略任何部分**\n- 批量上传按顺序处理（不并行），避免 API 过载\n- **执行通知**：每次上传完成后必须告知用户：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\n---\n\n## Verification\n\nUpload was successful when ALL of the following are true:\n\n1. Script output contains `\"success\": true`\n2. `downloadUrl` field is present and non-empty\n3. Agent delivered the download link to the user with the execution notice: \"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\nTo verify a previously uploaded file still exists:\n\n```bash\nnode scripts/agent-storage.js info '{\"remotePath\":\"<filename>\"}'\n```\n\nIf the response contains `\"success\": true`, the file is accessible and a fresh download link is returned.\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn75r0rammt45k8qe5we0sh63580c5y0\",\n  \"slug\": \"tencent-agent-storage\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1776419284159\n}\n\nArchive v1.0.9: 3 files, 11288 bytes\n\nFiles: scripts/agent-storage.js (9968b), SKILL.md (18451b), _meta.json (140b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: tencent-agent-storage\nversion: 1.0.7\nauthor: shawnmzhang\nlicense: MIT\ndescription: |\n  Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\n  Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\n  MUST trigger when the user mentions ANY of the following concepts:\n  【云盘/网盘相关 — Cloud Drive Access】\n  - \"网盘\", \"云盘\", \"云空间\", \"龙虾盘\", \"龙虾云盘\", \"龙虾网盘\", \"龙虾空间\"\n  - \"专属云盘\", \"专属网盘\", \"专属空间\", \"我的云盘\", \"我的网盘\", \"我的龙虾\"\n  - \"打开网盘\", \"打开云盘\", \"进入网盘\", \"进入云盘\", \"看看云盘\", \"看看网盘\"\n  - \"cloud drive\", \"my drive\", \"open drive\", \"lobster drive\"\n  【文件列表/查看 — File Listing & Browsing】\n  - \"列出文件\", \"有哪些文件\", \"看看文件\", \"文件列表\", \"我的文件\"\n  - \"云盘里有什么\", \"空间里有啥\", \"查看云空间\", \"云空间文件\"\n  - \"list files\", \"show files\", \"my files\", \"what files\", \"browse files\"\n  【上传/备份 — Upload & Backup】\n  - \"上传文件\", \"上传某个文件\", \"确定上传\", \"传到云空间\", \"上传到云空间\"\n  - \"备份到云\", \"备份文件\", \"保存到云\", \"存到网盘\", \"传到网盘\", \"存到云盘\", \"传到云盘\"\n  - \"文件传一下\", \"帮我传个文件\", \"把这个存一下\"\n  - \"upload\", \"backup\", \"save to cloud\", \"back up\"\n  【发送/传输给用户 — Send & Deliver Files】\n  - \"把文件发给我\", \"整理好发我\", \"发到手机\", \"传到手机\"\n  - \"做完了发我一份\", \"弄好了发给我\", \"完成后把文件给我\"\n  - \"导出之后发我\", \"生成完发给我看看\", \"跑完了把结果给我\"\n  - \"send file\", \"send to phone\", \"deliver file\", \"give me the file\"\n  【链接/分享 — Links & Sharing】\n  - \"生成下载链接\", \"做成链接\", \"给我下载链接\"\n  - \"生成个链接发给同事\", \"发到群里\", \"分享文件\", \"分享给别人\", \"发个链接\"\n  - \"download link\", \"share file\", \"share link\", \"generate link\"\n  【文件状态查询 — File Status Check】\n  - \"这个云文件还在吗\", \"之前上传的文件还能下吗\", \"链接过期了能重新生成吗\"\n  - \"is file still there\", \"can I still download\", \"regenerate link\"\n  【隐式触发 — Implicit Triggers】\n  - When a task produces output files (reports, exports, generated content) that need to be delivered to the user\n  - When the user's intent implies needing a file on another device, even without explicitly saying \"upload\"\n  - When MyClaw/agent needs to upload files to generate download links\n  - Any mention of file transfer, cloud storage, or personal file space in the conversation context\nmetadata:\n  # ── OpenClaw 兼容 ──\n  openclaw:\n    emoji: \"☁️\"\n    requires:\n      bins:\n        - node\n        - npm\n      packages:\n        npm:\n          - smh-node-sdk\n      env:\n        - smh_libraryId\n        - smh_accessToken\n        - smh_spaceId\n        - smh_basePath\n  # ── Hermes Agent 兼容 ──\n  hermes:\n    tags: [Cloud Storage, File Management, Upload, Backup, Tencent Agent Storage]\n    related_skills: []\n    required_environment_variables:\n      - name: smh_libraryId\n        prompt: \"SMH Library ID\"\n        help: \"Your Tencent SMH library ID, e.g. smhxxx-xxxxx\"\n        required_for: \"API access to Tencent Agent Storage\"\n      - name: smh_accessToken\n        prompt: \"SMH Access Token\"\n        help: \"A space_admin level access token for Tencent Agent Storage\"\n        required_for: \"File upload and download link generation\"\n      - name: smh_spaceId\n        prompt: \"SMH Space ID\"\n        help: \"Your cloud drive space ID, e.g. space-xxxxx\"\n        required_for: \"Identifying the target storage space\"\n      - name: smh_basePath\n        prompt: \"SMH API Base Path\"\n        help: \"Tencent SMH API endpoint, defaults to https://api.tencentsmh.cn\"\n        required_for: \"API endpoint configuration\"\n    config:\n      - key: smh.basePath\n        description: \"Tencent SMH API base URL\"\n        default: \"https://api.tencentsmh.cn\"\n        prompt: \"SMH API base path\"\n---\n\n# Tencent Agent Storage (云文件上传备份工具)\n\n将本地文件上传至 Tencent Agent Storage，自动生成下载链接和图片预览。上传的文件存储在用户独有的云盘空间中，支持跨端访问——无论是手机、电脑还是平板，用户都可以随时随地查看和下载自己的文件。\n\n## When to Use\n\nAgent **MUST** activate this skill when any of the following conditions are met:\n\n- User mentions cloud drive keywords: 网盘、云盘、云空间、龙虾盘、专属网盘、cloud drive, my drive\n- User requests file listing or browsing: 列出文件、有哪些文件、list files, show files\n- User requests upload or backup: 上传文件、备份到云、存到网盘、upload, backup, save to cloud\n- User asks to send/deliver files: 把文件发给我、发到手机、send file, deliver file\n- User requests links or sharing: 生成下载链接、分享文件、download link, share link\n- User queries file status: 这个云文件还在吗、链接过期了、is file still there\n- **Implicit**: A task produces output files that need to be delivered to the user, or the user's intent implies needing a file on another device\n\n## Quick Reference\n\n| Command | Usage | Description |\n|---------|-------|-------------|\n| `upload` | `node scripts/agent-storage.js upload '<json>'` | Upload local file to cloud, returns download link |\n| `info` | `node scripts/agent-storage.js info '<json>'` | Get file info and regenerate download link |\n| `list` | `node scripts/agent-storage.js list '<json>'` | List files in a cloud directory |\n\n## Setup\n\n### Prerequisites\n\n此 skill 需要 **Node.js ≥ 14** 和 **npm**。Agent 在首次执行前**必须检测运行环境**：\n\n```bash\nnode --version   # 期望输出 v14.x 或更高\nnpm --version\n```\n\n如果 `node` 命令不存在或版本低于 14，直接安装：\n\n根据用户系统自动选择安装方式：\n\n```bash\n# macOS (Homebrew)\nbrew install node\n\n# macOS (无 Homebrew)\ncurl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg\n\n# Linux (Debian/Ubuntu)\ncurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs\n\n# Linux (其他发行版 / 通用)\ncurl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1\n\n# Windows (PowerShell, 管理员)\nwinget install OpenJS.NodeJS.LTS\n\n# Windows (无 winget)\n# 下载安装包: https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi 并运行\n\n# 跨平台 (已有 nvm)\nnvm install --lts\n```\n\n此 skill 还依赖 `smh-node-sdk` npm 包。**必须在使用前完成安装**（二选一）：\n\n```bash\n# 方式一：全局安装（推荐）\nnpm install -g smh-node-sdk\n\n# 方式二：本地安装到项目目录\nnpm install smh-node-sdk\n```\n\n> 脚本会按以下顺序查找 SDK：当前项目 node_modules → 全局 node_modules。如果未找到，脚本会报错并提示安装命令。\n\n### About the upload script\n\n此 skill 的运行脚本位于 `scripts/agent-storage.js`。Agent 直接通过 `node scripts/agent-storage.js <command> '<json>'` 调用，**无需额外写入临时文件**。脚本源码可在 `scripts/` 目录中审阅。\n\n### Credential configuration\n\n凭证从以下配置文件中自动加载（优先级从高到低）。\n\n> **安全说明**：脚本仅读取配置文件中 `smh_` 前缀的环境变量（`smh_libraryId`、`smh_accessToken` 等），不会访问配置文件中的其他字段或敏感信息。\n\n> **关于 token 权限**：Tencent Agent Storage 的文件上传和下载链接生成 API 要求 `space_admin` 级别的 accessToken，这是 Tencent Agent Storage 服务端对文件写入操作的最低权限要求。\n\n**模式一：直接凭证（accessToken）**\n\n凭证文件查找顺序（先找到者优先）：\n\n1. **通用配置** — `~/.tencentAgentStorage/.env`\n2. **OpenClaw** — `~/.openclaw/openclaw.json` 的 `env` 字段\n3. **Hermes** — `~/.hermes/.env`\n\n**通用配置（推荐）** — 在 `~/.tencentAgentStorage/.env` 中配置：\n\n```env\n# ~/.tencentAgentStorage/.env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n**OpenClaw** — 在 `~/.openclaw/openclaw.json` 的 `env` 字段中配置：\n\n```json\n{\n  \"env\": {\n    \"smh_basePath\": \"https://api.tencentsmh.cn\",\n    \"smh_libraryId\": \"smhxxx-xxxxx\",\n    \"smh_spaceId\": \"space-xxxxx\",\n    \"smh_accessToken\": \"<your-access-token>\"\n  }\n}\n```\n\n**Hermes** — 在 `~/.hermes/.env` 中配置：\n\n```env\nsmh_basePath=https://api.tencentsmh.cn\nsmh_libraryId=smhxxx-xxxxx\nsmh_spaceId=space-xxxxx\nsmh_accessToken=<your-access-token>\n```\n\n\n---\n\n## Procedure\n\nAgent uses this skill in any scenario that requires uploading files to the cloud.\n\n### Complete flow\n\n```\nUser triggers file upload\n  → Step 1: Identify the local file path(s)\n  → Step 2: Run upload script (loop for batch)\n  → Step 3: Extract downloadUrl from JSON output (signed COS URL)\n  → Step 4: Deliver the download link with execution notice\n```\n\n> **IMPORTANT**: 默认必须使用 `conflictStrategy: \"ask\"` 上传。这样当云端已存在同名文件时，脚本会返回错误，Agent 可以询问用户如何处理。**只有用户明确说了 \"覆盖\"/\"替换\" 或 \"重命名\" 时，才使用对应的 `conflictStrategy: \"overwrite\"` 或 `conflictStrategy: \"rename\"`。**\n\n### Step 2: Upload\n\n**Single file (默认):**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file.pdf\",\"conflictStrategy\":\"ask\"}'\n```\n\n**Upload to specific directory:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/photo.jpg\",\"remotePath\":\"photos/photo.jpg\",\"conflictStrategy\":\"ask\"}'\n```\n\n**User explicitly requested overwrite:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"overwrite\"}'\n```\n\n**Batch upload:**\n\n```bash\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file1.pdf\",\"conflictStrategy\":\"ask\"}'\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/file2.docx\",\"conflictStrategy\":\"ask\"}'\n```\n\n#### Conflict handling\n\nWhen using `conflictStrategy: \"ask\"` (默认), if a same-name file already exists, the script returns `{\"success\":false,\"conflict\":true}`. Agent must then ask the user:\n\n> 云端已存在同名文件 `{filename}`，你想怎么处理？\n>\n> 1. 🔄 覆盖 — 替换云端文件\n> 2. 📝 重命名 — 自动改名上传（如 file(1).pdf）\n> 3. ❌ 取消 — 不上传\n\n**三种策略对照：**\n\n| Strategy | Behavior | When to use |\n|----------|----------|-------------|\n| `ask` (**默认，必须使用**) | 同名文件存在时返回错误，Agent 询问用户 | 用户未表明偏好时 |\n| `overwrite` | 直接覆盖已有文件 | 用户明确说 \"覆盖\", \"替换\", \"更新文件\" |\n| `rename` | 自动重命名 → `file(1).pdf` | 用户明确说 \"重命名\", \"改名上传\" |\n\n### Step 4: Deliver link + execution notice\n\nAfter every successful upload, include this notice alongside the download link(s):\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n\n**链接输出规则（MUST）：**\n1. **必须使用带 COS 签名的直链**（`downloadUrl` 字段），域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`\n2. **禁止输出含 `accessToken` 的中转链接**（如 `https://api.tencentsmh.cn/...?access_token=...`），这会泄露凭证\n3. **链接必须完整输出，禁止任何形式的截断、省略或缩写**——不能用 `...`、`<省略>` 等替代任何部分。签名链接通常很长，这是正常的\n\n**Single file example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 已上传文件: report.pdf  大小: (2.3 MB)\n> 下载链接: {脚本返回的完整 downloadUrl，原样输出，不得截断}\n\n**Batch example:**\n\n> 链接已生成，链接有效期 2 小时，可直接在浏览器或手机中打开。\n>\n> 📎 report.pdf (2.3 MB) — {完整 downloadUrl}\n> 📎 photo.jpg (1.1 MB) — {完整 downloadUrl}\n\n---\n\n## File Size Support\n\n**There is NO file size limit.** The upload script supports files of any size, including multi-GB videos.\n\n- **Small files (≤ 50 MB)**: Single-part upload.\n- **Large files (> 50 MB)**: Multipart upload — the file is read in 5 MB chunks, never loaded entirely into memory.\n\n---\n\n## Commands\n\n所有命令输出 JSON 到 stdout。\n\n### upload\n\n```bash\nnode scripts/agent-storage.js upload '<json>'\n```\n\n**JSON 参数：**\n- `localPath`（必填）：本地文件绝对路径，支持 `~` 展开\n- `remotePath`（可选）：云端目标路径，省略则上传到根目录并保留原文件名\n- `conflictStrategy`（可选）：`ask`（默认）| `rename` | `overwrite`\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"upload\": {\n    \"localFile\": \"/path/to/photo.jpg\",\n    \"remotePath\": \"photo.jpg\",\n    \"fileSize\": 2048576,\n    \"fileSizeHuman\": \"2.0 MB\",\n    \"uploadTime\": \"3.2s\",\n    \"rapidUpload\": false\n  },\n  \"downloadUrl\": \"https://bucket-xxxxx.tencentsmhuc.cn/smhxxx/...photo.jpg?response-content-disposition=inline&smh-space=space-xxx&x-cos-security-token=...&q-sign-algorithm=sha1&q-signature=...\"\n}\n```\n\n### info\n\n```bash\nnode scripts/agent-storage.js info '<json>'\n```\n\n**JSON 参数：**\n- `remotePath`（必填）：云端文件路径\n- `basePath` / `libraryId` / `spaceId` / `accessToken`（可选）：直接传参模式凭证\n\n**Output:**\n\n```json\n{\n  \"success\": true,\n  \"remotePath\": \"report.pdf\",\n  \"downloadUrl\": \"https://bucket-xxxxx.tencentsmhuc.cn/smhxxx/...report.pdf?response-content-disposition=inline&smh-space=space-xxx&x-cos-security-token=...&q-sign-algorithm=sha1&q-signature=...\",\n  \"fileInfo\": {\n    \"name\": \"report.pdf\",\n    \"size\": 2048576,\n    \"type\": \"application/pdf\",\n    \"creationTime\": \"2026-03-13T10:00:00Z\",\n    \"modificationTime\": \"2026-03-13T10:00:00Z\"\n  }\n}\n```\n\n### list\n\n```bash\nnode scripts/agent-storage.js list '<json>'\n```\n\n**JSON 参数：**\n- `dirPath`（可选）：目录路径，默认 `/`\n- `limit`（可选）：最大返回数量，默认 50\n\n---\n\n## Full Example\n\n```bash\n# Step 0: 安装 smh-node-sdk（首次使用前执行一次）\nnpm install -g smh-node-sdk\n\n# Step 1: 上传文件\nnode scripts/agent-storage.js upload '{\"localPath\":\"/path/to/report.pdf\",\"conflictStrategy\":\"ask\"}'\n\n# Step 2: 查询文件信息\nnode scripts/agent-storage.js info '{\"remotePath\":\"report.pdf\"}'\n\n# Step 3: 列出云端文件\nnode scripts/agent-storage.js list '{\"dirPath\":\"/\",\"limit\":20}'\n```\n\n---\n\n## Pitfalls\n\n### Error handling\n\n所有命令输出 JSON 到 stdout。错误也以 JSON 返回：`{\"success\": false, \"error\": \"...\"}`\n\n| 错误 | 处理方式 |\n|------|---------|\n| 上传失败（`success: false`） | 告诉用户：\"文件上传失败：{具体原因}。你可以稍后再试，或者检查网络连接。\" |\n| 同名冲突（`conflict: true`） | 询问用户选择覆盖、重命名或取消 |\n| 文件不存在 | 让用户确认路径 |\n| 网络错误 | 重试 2 次，间隔 3s；仍失败告知用户 |\n| 配置缺失 | 提示用户在 `~/.tencentAgentStorage/.env`、`~/.openclaw/openclaw.json` 的 `env` 字段或 `~/.hermes/.env` 中添加 `smh_*` 配置 |\n\n**上传失败对话模板**（当 `success: false` 时必须使用）：\n\n> ❌ 文件上传失败：{error 中的具体原因}。\n>\n> 你可以：\n> 1. 🔄 重试 — 重新上传这个文件\n> 2. ❌ 取消 — 暂时不上传\n\n### Prohibited actions\n\n- **NEVER** 在 `success: false` 时展示下载链接\n- **NEVER** 在上传失败时不告知用户，必须明确提示\"文件上传失败\"及原因\n- **NEVER** 硬编码或暴露 SMH 凭证给用户\n- **NEVER** 未经用户主动要求就上传其本地个人文件\n- **NEVER** 跳过执行通知：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n- **NEVER** 在用户未明确表态时使用 `conflictStrategy: \"rename\"` 或 `conflictStrategy: \"overwrite\"`\n- **NEVER** 把含 `accessToken` 的中转链接（如 `https://api.tencentsmh.cn/...?access_token=...`）发给用户。返回给用户的**必须是带 COS 签名的直链**（域名为 `*.tencentsmhuc.cn`，参数含 `q-sign-algorithm` 和 `q-signature`），即脚本输出的 `downloadUrl` 字段\n- **NEVER** 截断、省略或用 `...` 缩写链接。发给用户的下载链接/预览链接**必须是脚本返回的完整 URL**，一个字符都不能少。链接通常很长（含签名参数），这是正常的，**必须原样完整输出**\n\n### Common mistakes\n\n- 用户说\"上传文件\"但没指定路径 → 追问：\"你要上传哪个文件？告诉我文件路径或文件名就行。\"\n- 用户说\"确定上传 xxx\"或\"把 xxx 发给我\" → 直接执行上传（`conflictStrategy: \"ask\"`）\n- **同名文件冲突**：上传时必须使用 `conflictStrategy: \"ask\"`。如果返回 `conflict: true`，必须询问用户选择覆盖、重命名或取消\n- 文件默认上传到云空间根目录，用户可通过 `remotePath` 参数指定目标路径\n- 下载链接为通过 SDK `infoFile({ purpose: 'download' })` 获取的带签名 COS 直链（`https://bucket-xxxxx.tencentsmhuc.cn/...?q-sign-algorithm=sha1&q-signature=...`），可直接在浏览器或手机中打开预览/下载，**有效期约 2 小时**。**必须原样完整输出此链接，禁止截断或省略任何部分**\n- 批量上传按顺序处理（不并行），避免 API 过载\n- **执行通知**：每次上传完成后必须告知用户：\"链接已生成，有效期 2 小时，可直接在浏览器或手机中打开\"\n\n---\n\n## Verification\n\nUpload was successful when ALL of the following are true:\n\n1. Script output contains `\"su\n\nArchive v1.0.8: 3 files, 11110 bytes\n\nFiles: scripts/agent-storage.js (10654b), SKILL.md (18003b), _meta.json (140b)","readmeExcerpt":"Skill: Tencent Agent Storage Owner: shawnminh Summary: Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘). Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup. MUST trigger when the user mentions ANY of the following concepts: 【云盘/网盘相关 — Cloud Drive Acce Tags: latest:1.0.17 Version history: v1.0.17 | 2026-07-24T02:43:","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"node --version   # 期望输出 v14.x 或更高\nnpm --version"},{"language":"bash","snippet":"curl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg"},{"language":"bash","snippet":"curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs"},{"language":"bash","snippet":"curl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1"},{"language":"bash","snippet":"# macOS (Homebrew)\nbrew install node\n\n# macOS (无 Homebrew)\ncurl -o node.pkg \"https://nodejs.org/dist/v20.18.0/node-v20.18.0.pkg\" && sudo installer -pkg node.pkg -target / && rm node.pkg\n\n# Linux (Debian/Ubuntu)\ncurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs\n\n# Linux (其他发行版 / 通用)\ncurl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | sudo tar -xJ -C /usr/local --strip-components=1\n\n# Windows (PowerShell, 管理员)\nwinget install OpenJS.NodeJS.LTS\n\n# Windows (无 winget)\n# 下载安装包: https://nodejs.org/dist/v20.18.0/node-v20.18.0-x64.msi 并运行\n\n# 跨平台 (已有 nvm)\nnvm install --lts"},{"language":"bash","snippet":"# 方式一：全局安装（推荐）\nnpm install -g smh-node-sdk@^1.0.9\n\n# 方式二：本地安装到项目目录\nnpm install smh-node-sdk@^1.0.9"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: tencent-agent-storage\nversion: 1.0.11\nauthor: shawnmzhang\nlicense: MIT\ndescription: |\n  Cloud file storage, upload, backup, and file management tool for Tencent Agent Storage (专属网盘).\n  Manages the user's personal cloud drive: upload files, list files, download, share links, preview, and backup.\n  MUST trigger when the user mentions ANY of the following concepts:\n  【云盘/网盘相关 — Cloud Drive Access】\n  - \"网盘\", \"云盘\", \"云空间\", \"龙虾盘\", \"龙虾云盘\", \"龙虾网盘\", \"龙虾空间\"\n  - \"专属云盘\", \"专属网盘\", \"专属空间\", \"我的云盘\", \"我的网盘\", \"我的龙虾\"\n  - \"打开网盘\", \"打开云盘\", \"进入网盘\", \"进入云盘\", \"看看云盘\", \"看看网盘\"\n  - \"cloud drive\", \"my drive\", \"open drive\", \"lobster drive\"\n  【文件列表/查看 — File Listing & Browsing】\n  - \"列出文件\", \"有哪些文件\", \"看看文件\", \"文件列表\", \"我的文件\"\n  - \"云盘里有什么\", \"空间里有啥\", \"查看云空间\", \"云空间文件\"\n  - \"list files\", \"show files\", \"my files\", \"what files\", \"browse files\"\n  【上传/备份 — Upload & Backup】\n  - \"上传文件\", \"上传某个文件\", \"确定上传\", \"传到云空间\", \"上传到云空间\"\n  - \"备份到云\", \"备份文件\", \"保存到云\", \"存到网盘\", \"传到网盘\", \"存到云盘\", \"传到云盘\"\n  - \"文件传一下\", \"帮我传个文件\", \"把这个存一下\"\n  - \"upload\", \"backup\", \"save to cloud\", \"back up\"\n  【发送/传输给用户 — Send & Deliver Files】\n  - \"把文件发给我\", \"整理好发我\", \"发到手机\", \"传到手机\"\n  - \"做完了发我一份\", \"弄好了发给我\", \"完成后把文件给我\"\n  - \"导出之后发我\", \"生成完发给我看看\", \"跑完了把结果给我\"\n  - \"send file\", \"send to phone\", \"deliver file\", \"give me the file\"\n  【链接/分享 — Links & Sharing】\n  - \"生成下载链接\", \"做成链接\", \"给我下载链接\"\n  - \"生成个链接发给同事\", \"发到群里\", \"分享文件\", \"分享给别人\", \"发个链接\"\n  - \"download link\", \"share file\", \"share link\", \"generate link\"\n  【文件状态查询 — File Status Check】\n  - \"这个云文件还在吗\", \"之前上传的文件还能下吗\", \"链接过期了能重新生成吗\"\n  - \"is file still there\", \"can I still download\", \"regenerate link\"\n  【文件搜索/检索 — File Search】\n  - \"搜索文件\", \"搜一下\", \"找文件\", \"找一下\", \"查找\", \"检索文件\"\n  - \"搜索云盘\", \"在云盘里搜\", \"帮我找个文件\", \"有没有叫xxx的文件\"\n  - \"search files\", \"find file\", \"search cloud\"\n  【重命名/移动 — Rename & Move】\n  - \"重命名文件\", \"改名\", \"改文件名\", \"换个名字\", \"移动文件\", \"移到\", \"挪到\"\n  - \"rename file\", \"move file\", \"rename\", \"move to\"\n  【隐式触发 — Implicit Triggers】\n  - When a task produces output files (reports, exports, generated content) that need to be delivered to the user\n  - When the user's intent implies needing a file on another device, even without explicitly saying \"upload\"\n  - When MyClaw/agent needs to upload files to generate download links\n  - Any mention of file transfer, cloud storage, or personal file space in the conversation context\nmetadata: {}\n---\n\n# Tencent Agent Storage (云文件上传备份工具)\n\n将本地文件上传至 Tencent Agent Storage，自动生成下载链接和图片预览。上传的文件存储在用户独有的云盘空间中，支持跨端访问——无论是手机、电脑还是平板，用户都可以随时随地查看和下载自己的文件。\n\n## When to Use\n\nAgent **MUST** activate this skill when any of the following conditions are met:\n\n- User mentions cloud drive keywords: 网盘、云盘、云空间、龙虾盘、专属网盘、cloud drive, my drive\n- User requests file listing or browsing: 列出文件、有哪些文件、list files, show files\n- User requests upload or backup: 上传文件、备份到云、存到网盘、upload, backup, save to cloud\n- User asks to send/deliver files: 把文件发给我、发到手机、send file, deliver file\n- User requests links or sharing: 生成下载链接、分享文件、download link, share link\n- User queries file status: 这个云文件还在吗、链接过期了、is file still there\n- User re"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn75r0rammt45k8qe5we0sh63580c5y0\",\n  \"slug\": \"tencent-agent-storage\",\n  \"version\": \"1.0.17\",\n  \"publishedAt\": 1784861022392\n}"},{"path":"skill-card.md","content":"## Description:\n\nTencent Agent Storage lets an agent upload, list, search, rename, move, and share files in a user's Tencent Agent Storage cloud drive.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[shawnminh](https://clawhub.ai/user/shawnminh)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users and their agents use this skill to manage personal cloud-drive files, upload generated artifacts, and provide time-limited download or preview links across devices.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Administrative Tencent storage tokens can be exposed or overused if shared broadly.\n\nMitigation: Use a dedicated Tencent storage token with the least privilege available, keep credential files private, and never display access-token based URLs to users.\n\nRisk: Broad activation language can lead to unintended uploads of local files or directories.\n\nMitigation: Require the user to identify the exact file or directory before upload, and confirm before uploading sensitive or unexpected content.\n\nRisk: Setup guidance includes curl-to-sudo and global npm installation paths.\n\nMitigation: Prefer reviewed local installation with pinned dependencies, and avoid piping remote setup scripts into privileged package installation.\n\nRisk: A modified endpoint could direct storage operations away from the intended Tencent service.\n\nMitigation: Keep smh_basePath fixed to the legitimate Tencent endpoint unless the publisher and deployment owner explicitly approve a different endpoint.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/shawnminh/skills/tencent-agent-storage)\n- [Publisher profile](https://clawhub.ai/user/shawnminh)\n- [Tencent Agent Storage API endpoint](https://api.tencentsmh.cn)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with shell commands and JSON command results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Successful uploads return complete, time-limited downloadUrl links; search is limited to filename matching.]\n\n## Skill Version(s):\n\n1.0.17 (source: server release metadata; artifact frontmatter says 1.0.11)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1281,"uniquenessScore":44,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T05:25:49.645Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T05:25:49.645Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T22:17:14.669Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}