{"id":"6a62c0f3-19f3-4074-bae5-698b15a40080","entityType":"agent","slug":"clawhub-linkfox-ai-linkfox-amazon-store-uploads","name":"亚马逊-店铺上传","canonicalUrl":"https://www.xpersona.co/agent/clawhub-linkfox-ai-linkfox-amazon-store-uploads","canonicalPath":"/agent/clawhub-linkfox-ai-linkfox-amazon-store-uploads","generatedAt":"2026-10-10T13:31:13.144Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T10:15:16.341Z","emptyReason":null},"description":"亚马逊 SP-API 通用文件上传。用于为 A+ Content、Messaging 等业务创建 upload destination，计算 contentMD5，并将图片或附件上传到返回的预签名地址。用户提到亚马逊文件上传、A+ 图片上传、Messaging 附件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、Uploads API、SP-API 上传文件时触发。即使未明确说“Uploads API”，只要其他亚马逊 SP-API 操作需要先获得可引用的上传资源地址，也应触发此技能；Feed 文档上传使用 linkfox-amazon-store-feeds 的专用流程。 Skill: 亚马逊-店铺上传 Owner: linkfox-ai Summary: 亚马逊 SP-API 通用文件上传。用于为 A+ Content、Messaging 等业务创建 upload destination，计算 contentMD5，并将图片或附件上传到返回的预签名地址。用户提到亚马逊文件上传、A+ 图片上传、Messaging 附件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、Uploads API、SP-API 上传文件时触发。即使未明确说“Uploads API”，只要其他亚马逊 SP-API 操作需要先获得可引用的上传资源地址，也应触发此技能；Feed 文档上传使用 linkfox-amazon-store-feeds 的专用流程。 Tags: latest:1.0.8 Version history: v1","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.5K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s171g8b6m2khwdy9ye8bxj0wx183vd4z:linkfox-amazon-store-uploads","sourceUrl":"https://clawhub.ai/linkfox-ai/linkfox-amazon-store-uploads","homepage":"https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-uploads","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/linkfox-ai/linkfox-amazon-store-uploads","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-uploads","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":64,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"亚马逊 SP-API 通用文件上传。用于为 A+ Content、Messaging 等业务创建 upload destination，计算 contentMD5，并将图片或附件上传到返回的预签名地址。用户提到亚马逊文件上传、A+ 图片上传、Messaging 附件、createUploadDestinationFor"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T10:15:16.341Z","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-10T10:15:16.341Z","emptyReason":null},"stars":null,"forks":null,"downloads":1502,"packageName":null,"latestVersion":"1.0.8","tractionLabel":"1.5K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T10:15:16.341Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T10:15:16.341Z","lastCrawledAt":"2026-10-10T10:15:16.341Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T10:15:16.341Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.8","createdAt":"2026-09-14T04:59:18.596Z","changelog":"Update from 1.0.7 to 1.0.8","fileCount":10,"zipByteSize":26430},{"version":"1.0.7","createdAt":"2026-08-14T14:48:50.483Z","changelog":"Update from 1.0.6 to 1.0.7","fileCount":10,"zipByteSize":25141},{"version":"1.0.6","createdAt":"2026-08-07T10:46:39.736Z","changelog":"Update from 1.0.5 to 1.0.6","fileCount":10,"zipByteSize":25319},{"version":"1.0.5","createdAt":"2026-07-13T12:07:03.319Z","changelog":"Update from 1.0.4 to 1.0.5","fileCount":8,"zipByteSize":16500},{"version":"1.0.4","createdAt":"2026-07-06T11:15:24.389Z","changelog":"Update from 1.0.3 to 1.0.4","fileCount":8,"zipByteSize":15580},{"version":"1.0.3","createdAt":"2026-07-03T08:14:16.016Z","changelog":"Update from 1.0.2 to 1.0.3","fileCount":7,"zipByteSize":14224},{"version":"1.0.2","createdAt":"2026-07-03T04:37:45.124Z","changelog":"Update from 1.0.1 to 1.0.2","fileCount":7,"zipByteSize":14273},{"version":"1.0.1","createdAt":"2026-06-29T10:46:29.904Z","changelog":"Update from 0.0.1 to 1.0.1","fileCount":9,"zipByteSize":19857}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s171g8b6m2khwdy9ye8bxj0wx183vd4z:linkfox-amazon-store-uploads","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"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-linkfox-ai-linkfox-amazon-store-uploads/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-uploads/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-uploads/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-uploads/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-uploads/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-uploads/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-10T13:31:13.142Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-uploads/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-uploads/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-uploads/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-uploads/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":"high","updatedAt":"2026-10-10T10:15:16.341Z","emptyReason":null},"readme":"Skill: 亚马逊-店铺上传\n\nOwner: linkfox-ai\n\nSummary: 亚马逊 SP-API 通用文件上传。用于为 A+ Content、Messaging 等业务创建 upload destination，计算 contentMD5，并将图片或附件上传到返回的预签名地址。用户提到亚马逊文件上传、A+ 图片上传、Messaging 附件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、Uploads API、SP-API 上传文件时触发。即使未明确说“Uploads API”，只要其他亚马逊 SP-API 操作需要先获得可引用的上传资源地址，也应触发此技能；Feed 文档上传使用 linkfox-amazon-store-feeds 的专用流程。\n\nTags: latest:1.0.8\n\nVersion history:\n\nv1.0.8 | 2026-09-14T04:59:18.596Z | user\n\nUpdate from 1.0.7 to 1.0.8\n\nv1.0.7 | 2026-08-14T14:48:50.483Z | user\n\nUpdate from 1.0.6 to 1.0.7\n\nv1.0.6 | 2026-08-07T10:46:39.736Z | user\n\nUpdate from 1.0.5 to 1.0.6\n\nv1.0.5 | 2026-07-13T12:07:03.319Z | user\n\nUpdate from 1.0.4 to 1.0.5\n\nv1.0.4 | 2026-07-06T11:15:24.389Z | user\n\nUpdate from 1.0.3 to 1.0.4\n\nv1.0.3 | 2026-07-03T08:14:16.016Z | user\n\nUpdate from 1.0.2 to 1.0.3\n\nv1.0.2 | 2026-07-03T04:37:45.124Z | user\n\nUpdate from 1.0.1 to 1.0.2\n\nv1.0.1 | 2026-06-29T10:46:29.904Z | user\n\nUpdate from 0.0.1 to 1.0.1\n\nv0.0.1 | 2026-05-20T08:05:56.821Z | user\n\nInitial release\n\nArchive index:\n\nArchive v1.0.8: 10 files, 26430 bytes\n\nFiles: references/api.md (2671b), references/onboarding.md (1999b), scripts/_spapi_uploads_common.py (13913b), scripts/check_auth_dependency.py (6078b), scripts/create_upload_destination_for_resource.py (2735b), scripts/onboarding.py (24027b), scripts/upload_to_destination.py (2964b), skill-card.md (3168b), SKILL.md (7446b), _meta.json (147b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: linkfox-amazon-store-uploads\ndescription: 亚马逊 SP-API 通用文件上传。用于为 A+ Content、Messaging 等业务创建 upload destination，计算 contentMD5，并将图片或附件上传到返回的预签名地址。用户提到亚马逊文件上传、A+ 图片上传、Messaging 附件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、Uploads API、SP-API 上传文件时触发。即使未明确说“Uploads API”，只要其他亚马逊 SP-API 操作需要先获得可引用的上传资源地址，也应触发此技能；Feed 文档上传使用 linkfox-amazon-store-feeds 的专用流程。\n---\n\n# Amazon 店铺 Uploads（文件上传）\n\n本 skill 专用于 **向 Amazon 申请上传目的地并上传文件**，与 **`linkfox-amazon-store-auth`** 同系列：依赖 **`linkfox-amazon-store-auth`** 选店（`sellerId`+`region`）；直接 **`POST /spApi/developerProxy`** 传入 `sellerId`+`region` 调用 **createUploadDestinationForResource**，最后用 **`upload_to_destination.py`** 对返回的 URL 执行 **PUT**（不经网关）。\n\n> 这是 **Uploads API**，不是 Orders 订单接口。订单见 **`linkfox-amazon-store-orders`**；批量 Feed 文件见 **`linkfox-amazon-store-feeds`**。\n\n## 调用方式\n\n- **API 端点**：`POST /spApi/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\n- **成本约束**：本工具会消耗算力；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-store-uploads-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 解决认证和算力问题\n发生以下异常情况时，采用 references/onboarding.md 引导解决问题：\n\n### 异常情况\n- **未配置API Key**：环境变量未配置 `LINKFOX_AGENT_API_KEY`，也未配置 `LINKFOXAGENT_API_KEY`。\n- **响应401或402状态码**\n- **响应提示算力或余额不足**：消息含\"算力余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值\"，或类似含义的内容。\n\n## 官方参考\n\n[createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) · [Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n\n---\n\n## Prerequisites\n\n1. 依赖 **`linkfox-amazon-store-auth`**。\n2. **`resource`** 须与下游 API 文档一致（例如 A+：`aplus/2020-11-01/contentDocuments`；Messaging 为对应 messages 资源路径）。\n3. **`contentMD5`** 为待上传文件内容的 **Base64 MD5 摘要**；传 **`filePath`** / **`content`** 时脚本可自动计算。\n\n---\n\n## 工作流\n\n```text\ncreate_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId\n```\n\n---\n\n## Scripts\n\n| 脚本 | 说明 |\n|------|------|\n| `create_upload_destination_for_resource.py` | POST `uploads/2020-11-01/uploadDestinations/{resource}` |\n| `upload_to_destination.py` | PUT 到返回的 `url`（带 `headers`） |\n| `_spapi_uploads_common.py` | 内部公共模块 |\n\n---\n\n## 示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\npython scripts/create_upload_destination_for_resource.py '{\n  \"sellerId\":\"A1...\",\n  \"region\":\"NA\",\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\n  \"filePath\":\"/path/to/banner.jpg\",\n  \"contentType\":\"image/jpeg\"\n}'\n\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\npython scripts/upload_to_destination.py '{\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\n  \"filePath\": \"/path/to/banner.jpg\"\n}'\n```\n\n---\n\n## Display Rules\n\n1. 成功创建目的地常为 **HTTP 201**；先看 **`developerProxy`**，再看 **`uploadDestination`**。\n2. **`resource`** 传未编码的下游资源路径；可带或不带前导 `/`，生成 path 时保留内部 `/`（greedy path），不得预编码成 `%2F`。\n3. 网关需放行 **`uploads/2020-11-01/`** 前缀。\n\n## Amazon SP-API 接口保护与重试指引\n\n同一店铺连续收到 Amazon SP-API 的 400、403、404 或 429 时，网关会返回 450、453、454 或 459 并短暂冷却。这些自定义状态码不是 Amazon 原生状态，也不表示封号；目的是避免持续异常或高频调用扩大店铺风险。\n\n| 状态与 message | 范围 | 触发与冷却 | 处理 |\n|---|---|---|---|\n| `450`：`400，请求异常，请优化您的参数` | 店铺+接口 | 60 秒内超过 3 次：5 分钟；10 分钟内超过 4 次：20 分钟 | 停止原参数重试，检查必填字段、marketplace、ID、日期和请求体 |\n| `453`：`403，店铺未授权，请先授权` | 店铺全部接口 | 60 秒内超过 2 次：5 分钟；10 分钟内超过 4 次：30 分钟 | 停止该店铺调用，检查授权、权限、店铺归属和区域 |\n| `454`：`404，资源不存在，请优化您的参数` | 店铺+接口 | 60 秒内超过 3 次：5 分钟；10 分钟内超过 4 次：30 分钟 | 确认资源 ID、所属店铺/站点、资源状态和接口路径 |\n| `459`：`429限流中，请降低频率` | 店铺+接口 | 首次：15 秒；2 分钟内超过 2 次：30 秒；3 分钟内超过 4 次：2 分钟 | 降低并发、分页和轮询频率并逐级退避 |\n\n- 立即停止自动或并发重试，不得通过换脚本或重复创建任务绕过保护；优先遵循 `retryAfter`、`blockedUntil`，没有时按表中时长说明。\n- 450/453/454 必须先修正参数、授权或资源标识，冷却后最多谨慎重试一次；再次触发则停止调用。453 期间停止该店铺全部 SP-API。\n- 保留已有 `reportId`、`feedId` 等任务 ID；写操作结果不确定时先查询状态，不直接重放。\n- 向用户先说明店铺保护，再给原因、处理和等待时间。可回复：“为保护您的亚马逊店铺安全，检测到 Amazon SP-API 连续返回{原因}，当前已进入短暂保护。请先{处理动作}，预计{等待时间}后再试；这不代表封号，也不是套餐或算力限制。”不要只说“LinkFox 限流”或“服务器繁忙”。\n\n## 算力消耗规则\n\n不消耗算力。\n\n**Feedback：** `skillName`：`linkfox-amazon-store-uploads`。\n\n---\n*更多跨境 skill：[LinkFox Skills](https://skill.linkfox.com/)*\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-amazon-store-uploads\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1789361958596\n}\n\nFile v1.0.8:references/api.md\n\n# linkfox-amazon-store-uploads — API 参考\n\nUploads **v2020-11-01**，用于在调用 A+ Content、Messaging 等 API 之前**上传二进制文件**。\n\n---\n\n## 1. createUploadDestinationForResource\n\n| 项 | 值 |\n|----|-----|\n| method | POST |\n| path | `uploads/2020-11-01/uploadDestinations/{resource}` |\n| 脚本 | `create_upload_destination_for_resource.py` |\n\n`{resource}` 是 greedy path 参数。传入未编码的下游 API 资源路径，构造网关 `path` 时须保留其中的 `/`，不得将路径分隔符预编码为 `%2F`。例如：\n\n- `aplus/2020-11-01/contentDocuments`\n- Messaging：`messaging/v1/orders/{amazonOrderId}/messages/...`（以官方为准）\n\n### Query（写入 `queryString`）\n\n| 参数 | 必填 | 说明 |\n|------|------|------|\n| marketplaceIds | 是 | 单站点 ID（脚本用 `marketplaceId` 或 `marketplaceIds[0]`） |\n| contentMD5 | 是 | 文件内容的 Base64 MD5；或由 `filePath`/`content` 自动计算 |\n| contentType | 否 | 如 `image/jpeg` |\n\n### 入参 JSON（脚本）\n\n| 字段 | 必填 |\n|------|------|\n| sellerId, region | 是 |\n| resource | 是 |\n| marketplaceId | 是 |\n| contentMD5 或 filePath/content/contentBase64 | 是（二选一组合） |\n| contentType | 建议 |\n\n### 响应解析\n\n字段 **`uploadDestination`**，通常含：\n\n- `uploadDestinationId` — 后续业务 API 引用\n- `url` — PUT 上传地址\n- `headers` — 上传时必须附带的 HTTP 头\n\n---\n\n## 2. 上传文件（非 SP-API 代理）\n\n| 脚本 | `upload_to_destination.py` |\n|------|---------------------------|\n| method | PUT |\n| URL | `uploadDestination.url` |\n| headers | `uploadDestination.headers` 全文带上 |\n\n| 字段 | 必填 |\n|------|------|\n| uploadUrl 或 uploadDestination | 是 |\n| headers（若未包在 uploadDestination 内） | 是 |\n| filePath / content / contentBase64 | 是 |\n\n**注意**：PUT 使用的字节须与申请 `contentMD5` 时一致。\n\n---\n\n## 3. contentMD5 计算\n\n与 Amazon 要求一致：对文件字节做 MD5，再 **Base64** 编码摘要：\n\n```python\nbase64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")\n```\n\n---\n\n## 4. 常见 resource 示例\n\n| 场景 | resource 示例 |\n|------|----------------|\n| A+ 内容文档 | `aplus/2020-11-01/contentDocuments` |\n| Messaging 附件 | 见 [Messaging API](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) 各 message 操作的 resource 说明 |\n\n---\n\n## 5. 错误与白名单\n\n- **403**：Uploads 或下游角色未授权。\n- **1005**：网关需放行 `uploads/2020-11-01/`。\n- **429**：默认约 0.1 req/s（以官方为准）。\n\n---\n\n## 6. Feedback\n\n`skillName`: **`linkfox-amazon-store-uploads`**\n\nFile v1.0.8:references/onboarding.md\n\n# 解决认证和算力问题\n\n调用本 skill 时若网关返回 **auth** 或 **billing** 错误，走本 skill 自带的 `scripts/onboarding.py` 完成引导。\n\n**auth 场景**：`errcode=401` 或消息含 `authorized error`/`鉴权失败`/`未授权`/`unauthorized`；或 `LINKFOX_AGENT_API_KEY` 与 `LINKFOXAGENT_API_KEY` 均为空。\n1. 若已配置 key → 先让用户重启会话（最常见误判），仍失败让用户重新取 key 或换手机号重注册\n2. 未配置 → 询问：自助去 https://agent.linkfox.com/ 取 key，或提供手机号让脚本注册\n3. 手机号路径：\n   - `python scripts/onboarding.py send-code <phone>` → 展示 JSON 里的 phone/agreements\n   - 收到验证码后：`python scripts/onboarding.py login <phone> <code>`\n   - 拿到 `api_key` 后把下面三平台配置转发给用户，提示重启会话生效：\n     - Windows PowerShell（永久）：`setx LINKFOX_AGENT_API_KEY \"<key>\"`\n     - macOS zsh：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.zshrc && source ~/.zshrc`\n     - Linux bash：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.bashrc && source ~/.bashrc`\n     - 变量名 `LINKFOX_AGENT_API_KEY`（主推）或 `LINKFOXAGENT_API_KEY`（老规范）任一即可\n\n**billing 场景**：`errcode=402` 或消息含 `算力/余额/quota/insufficient/充值/套餐到期`。\n- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单，否则输出编号清单让用户选\n- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`（通常 `wechat/alipay`）\n- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG > `pay_url` > `ascii_qr`（标注兜底）\n- 已付款可选调 `python scripts/onboarding.py query <order_id>`，不主动轮询\n\n排除 `errcode=403`（无权限，不归入这两类）。所有子命令输出 stdout JSON，`error` 字段已含阶段前缀，透传给用户即可。完整用法：`python scripts/onboarding.py --help`。\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nThis third-party skill helps agents create Amazon SP-API upload destinations, compute contentMD5 values, and upload images or attachments to returned presigned URLs for A+ Content, Messaging, and related workflows.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal developers and Amazon store operators use this skill to prepare upload resources for Amazon SP-API workflows, especially A+ Content and Messaging attachments. It can guide API-key setup, create upload destinations through LinkFox, compute file digests, upload local file content to returned URLs, and preserve JSON results for later inspection.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can read local files and upload their bytes to a returned upload URL.\n\nMitigation: Confirm the selected file is intended for the Amazon workflow and verify that upload URLs come from Amazon or LinkFox before running upload commands.\n\nRisk: The skill uses LinkFox API credentials and may expose sensitive values through environment variables, logs, transcripts, or shell history.\n\nMitigation: Run with trusted environment variables, avoid sharing command transcripts containing credentials, and rotate any API key that appears in logs or history.\n\nRisk: The onboarding flow can guide phone/SMS account setup and initiate payment-order flows.\n\nMitigation: Use onboarding only for explicit authentication or billing recovery, and confirm account, plan, payment method, and order details before proceeding.\n\nRisk: The skill persists complete API responses locally, which may include operational or account-related data.\n\nMitigation: Review saved JSON files before sharing them and remove session data that is no longer needed.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-uploads)\n- [API reference](references/api.md)\n- [Onboarding reference](references/onboarding.md)\n- [Amazon createUploadDestinationForResource reference](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource)\n- [Amazon Create an upload destination guide](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n- [Amazon Messaging API reference](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference)\n\n## Skill Output:\n\n**Output Type(s):** [JSON, Files, Shell commands, Configuration guidance, API calls]\n\n**Output Format:** [Markdown guidance with shell commands, JSON stdout, and persisted JSON response files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Writes complete responses under a linkfox session data directory and may print summaries for larger responses.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release evidence)\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.7: 10 files, 25141 bytes\n\nFiles: references/api.md (2557b), references/onboarding.md (2046b), scripts/_spapi_uploads_common.py (13699b), scripts/check_auth_dependency.py (6078b), scripts/create_upload_destination_for_resource.py (2735b), scripts/onboarding.py (24089b), scripts/upload_to_destination.py (2964b), skill-card.md (2929b), SKILL.md (5086b), _meta.json (147b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: linkfox-amazon-store-uploads\ndescription: 亚马逊店铺文件上传（与 linkfox-amazon-store-auth 等同系列），经 /spApi/developerProxy 调用 Uploads API v2020-11-01 的 createUploadDestinationForResource，再向返回 URL 上传文件，供 A+ Content、Messaging 等 API 使用。当用户提到上传文件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、SP-API 上传、A+ 图片上传、Messaging 附件上传 时触发。\n---\n\n# Amazon 店铺 Uploads（文件上传）\n\n本 skill 专用于 **向 Amazon 申请上传目的地并上传文件**，与 **`linkfox-amazon-store-auth`** 同系列：依赖 **`linkfox-amazon-store-auth`** 选店（`sellerId`+`region`）；直接 **`POST /spApi/developerProxy`** 传入 `sellerId`+`region` 调用 **createUploadDestinationForResource**，最后用 **`upload_to_destination.py`** 对返回的 URL 执行 **PUT**（不经网关）。\n\n> 这是 **Uploads API**，不是 Orders 订单接口。订单见 **`linkfox-amazon-store-orders`**；批量 Feed 文件见 **`linkfox-amazon-store-feeds`**。\n\n## 调用方式\n\n- **API 端点**：`POST /spApi/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-store-uploads-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 解决认证和积分问题\n发生以下异常情况时，采用 references/onboarding.md 引导解决问题：\n\n### 异常情况\n- **未配置API Key**：环境变量未配置 `LINKFOX_AGENT_API_KEY`，也未配置 `LINKFOXAGENT_API_KEY`。\n- **响应401或402状态码**\n- **响应提示积分或余额不足**：消息含\"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值\"，或类似含义的内容。\n\n## 官方参考\n\n[createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) · [Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n\n---\n\n## Prerequisites\n\n1. 依赖 **`linkfox-amazon-store-auth`**。\n2. **`resource`** 须与下游 API 文档一致（例如 A+：`aplus/2020-11-01/contentDocuments`；Messaging 为对应 messages 资源路径）。\n3. **`contentMD5`** 为待上传文件内容的 **Base64 MD5 摘要**；传 **`filePath`** / **`content`** 时脚本可自动计算。\n\n---\n\n## 工作流\n\n```text\ncreate_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId\n```\n\n---\n\n## Scripts\n\n| 脚本 | 说明 |\n|------|------|\n| `create_upload_destination_for_resource.py` | POST `uploads/2020-11-01/uploadDestinations/{resource}` |\n| `upload_to_destination.py` | PUT 到返回的 `url`（带 `headers`） |\n| `_spapi_uploads_common.py` | 内部公共模块 |\n\n---\n\n## 示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\npython scripts/create_upload_destination_for_resource.py '{\n  \"sellerId\":\"A1...\",\n  \"region\":\"NA\",\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\n  \"filePath\":\"/path/to/banner.jpg\",\n  \"contentType\":\"image/jpeg\"\n}'\n\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\npython scripts/upload_to_destination.py '{\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\n  \"filePath\": \"/path/to/banner.jpg\"\n}'\n```\n\n---\n\n## Display Rules\n\n1. 成功创建目的地常为 **HTTP 201**；先看 **`developerProxy`**，再看 **`uploadDestination`**。\n2. **`resource`** 不要带前导 `/`；path 中会对 `/` 做编码。\n3. 网关需放行 **`uploads/2020-11-01/`** 前缀。\n\n## 积分消耗规则\n\n不消耗积分。\n\n**Feedback：** `skillName`：`linkfox-amazon-store-uploads`。\n\n---\n*更多跨境 skill：[LinkFox Skills](https://skill.linkfox.com/)*\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-amazon-store-uploads\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1786718930483\n}\n\nFile v1.0.7:references/api.md\n\n# linkfox-amazon-store-uploads — API 参考\n\nUploads **v2020-11-01**，用于在调用 A+ Content、Messaging 等 API 之前**上传二进制文件**。\n\n---\n\n## 1. createUploadDestinationForResource\n\n| 项 | 值 |\n|----|-----|\n| method | POST |\n| path | `uploads/2020-11-01/uploadDestinations/{resource}` |\n| 脚本 | `create_upload_destination_for_resource.py` |\n\n`{resource}` 为下游 API 的资源路径（URL 编码），例如：\n\n- `aplus/2020-11-01/contentDocuments`\n- Messaging：`messaging/v1/orders/{amazonOrderId}/messages/...`（以官方为准）\n\n### Query（写入 `queryString`）\n\n| 参数 | 必填 | 说明 |\n|------|------|------|\n| marketplaceIds | 是 | 单站点 ID（脚本用 `marketplaceId` 或 `marketplaceIds[0]`） |\n| contentMD5 | 是 | 文件内容的 Base64 MD5；或由 `filePath`/`content` 自动计算 |\n| contentType | 否 | 如 `image/jpeg` |\n\n### 入参 JSON（脚本）\n\n| 字段 | 必填 |\n|------|------|\n| sellerId, region | 是 |\n| resource | 是 |\n| marketplaceId | 是 |\n| contentMD5 或 filePath/content/contentBase64 | 是（二选一组合） |\n| contentType | 建议 |\n\n### 响应解析\n\n字段 **`uploadDestination`**，通常含：\n\n- `uploadDestinationId` — 后续业务 API 引用\n- `url` — PUT 上传地址\n- `headers` — 上传时必须附带的 HTTP 头\n\n---\n\n## 2. 上传文件（非 SP-API 代理）\n\n| 脚本 | `upload_to_destination.py` |\n|------|---------------------------|\n| method | PUT |\n| URL | `uploadDestination.url` |\n| headers | `uploadDestination.headers` 全文带上 |\n\n| 字段 | 必填 |\n|------|------|\n| uploadUrl 或 uploadDestination | 是 |\n| headers（若未包在 uploadDestination 内） | 是 |\n| filePath / content / contentBase64 | 是 |\n\n**注意**：PUT 使用的字节须与申请 `contentMD5` 时一致。\n\n---\n\n## 3. contentMD5 计算\n\n与 Amazon 要求一致：对文件字节做 MD5，再 **Base64** 编码摘要：\n\n```python\nbase64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")\n```\n\n---\n\n## 4. 常见 resource 示例\n\n| 场景 | resource 示例 |\n|------|----------------|\n| A+ 内容文档 | `aplus/2020-11-01/contentDocuments` |\n| Messaging 附件 | 见 [Messaging API](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) 各 message 操作的 resource 说明 |\n\n---\n\n## 5. 错误与白名单\n\n- **403**：Uploads 或下游角色未授权。\n- **1005**：网关需放行 `uploads/2020-11-01/`。\n- **429**：默认约 0.1 req/s（以官方为准）。\n\n---\n\n## 6. Feedback\n\n`skillName`: **`linkfox-amazon-store-uploads`**\n\nFile v1.0.7:references/onboarding.md\n\n# 解决认证和积分问题\n\n调用本 skill 时若网关返回 **auth** 或 **billing** 错误，走本 skill 自带的 `scripts/onboarding.py` 完成引导。\n\n**auth 场景**：`errcode=401` 或消息含 `authorized error`/`鉴权失败`/`未授权`/`unauthorized`；或 `LINKFOX_AGENT_API_KEY` 与 `LINKFOXAGENT_API_KEY` 均为空。\n1. 若已配置 key → 先让用户重启会话（最常见误判），仍失败让用户重新取 key 或换手机号重注册\n2. 未配置 → 询问：自助去 https://agent.linkfox.com/ 取 key，或提供手机号让脚本注册\n3. 手机号路径：\n   - `python scripts/onboarding.py send-code <phone>` → 展示 JSON 里的 phone/agreements\n   - 收到验证码后：`python scripts/onboarding.py login <phone> <code>`（workbuddy 宿主加 `--channel workbuddy`）\n   - 拿到 `api_key` 后把下面三平台配置转发给用户，提示重启会话生效：\n     - Windows PowerShell（永久）：`setx LINKFOX_AGENT_API_KEY \"<key>\"`\n     - macOS zsh：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.zshrc && source ~/.zshrc`\n     - Linux bash：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.bashrc && source ~/.bashrc`\n     - 变量名 `LINKFOX_AGENT_API_KEY`（主推）或 `LINKFOXAGENT_API_KEY`（老规范）任一即可\n\n**billing 场景**：`errcode=402` 或消息含 `积分/余额/quota/insufficient/充值/套餐到期`。\n- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单，否则输出编号清单让用户选\n- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`（通常 `wechat/alipay`）\n- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG > `pay_url` > `ascii_qr`（标注兜底）\n- 已付款可选调 `python scripts/onboarding.py query <order_id>`，不主动轮询\n\n排除 `errcode=403`（无权限，不归入这两类）。所有子命令输出 stdout JSON，`error` 字段已含阶段前缀，透传给用户即可。完整用法：`python scripts/onboarding.py --help`。\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nCreates Amazon SP-API upload destinations and uploads files to the returned pre-signed URL for A+ Content, Messaging, and related store workflows.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal marketplace operators and developers use this skill to create Amazon upload destinations, upload matching file bytes, and pass the resulting upload destination ID to A+ Content, Messaging, or similar SP-API workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles LinkFox API keys, phone-number based login, and upload URLs.\n\nMitigation: Install only when LinkFox is trusted for this workflow, keep API keys and upload URLs out of shared logs, and rotate credentials if they are exposed.\n\nRisk: Billing recovery can initiate payment orders when quota or balance errors occur.\n\nMitigation: Confirm the selected plan, payment method, and order details with the user before creating an order or displaying payment artifacts.\n\nRisk: Full API responses are saved to local linkfox response files.\n\nMitigation: Treat saved response files as sensitive, review their storage location, and delete them when they are no longer needed.\n\nRisk: Endpoint-related environment variables can change where requests are sent.\n\nMitigation: Review LinkFox gateway and API endpoint environment variables before use, especially in shared or managed environments.\n\n## Reference(s):\n\n- [API Reference](references/api.md)\n- [Authentication and Billing Onboarding](references/onboarding.md)\n- [Amazon createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource)\n- [Amazon Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n- [Amazon Messaging API v1 Reference](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference)\n- [ClawHub Skill Page](https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-uploads)\n- [LinkFox Skills](https://skill.linkfox.com/)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance, JSON, files]\n\n**Output Format:** [Markdown guidance with shell commands and JSON responses saved to local files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Scripts save full LinkFox responses under a linkfox session directory and print either the full JSON or a summary depending on response size and inline mode.]\n\n## Skill Version(s):\n\n1.0.7 (source: server release metadata)\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.6: 10 files, 25319 bytes\n\nFiles: references/api.md (2557b), references/onboarding.md (2046b), scripts/_spapi_uploads_common.py (13699b), scripts/check_auth_dependency.py (6078b), scripts/create_upload_destination_for_resource.py (2735b), scripts/onboarding.py (24089b), scripts/upload_to_destination.py (2964b), skill-card.md (3304b), SKILL.md (5086b), _meta.json (147b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: linkfox-amazon-store-uploads\ndescription: 亚马逊店铺文件上传（与 linkfox-amazon-store-auth 等同系列），经 /spApi/developerProxy 调用 Uploads API v2020-11-01 的 createUploadDestinationForResource，再向返回 URL 上传文件，供 A+ Content、Messaging 等 API 使用。当用户提到上传文件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、SP-API 上传、A+ 图片上传、Messaging 附件上传 时触发。\n---\n\n# Amazon 店铺 Uploads（文件上传）\n\n本 skill 专用于 **向 Amazon 申请上传目的地并上传文件**，与 **`linkfox-amazon-store-auth`** 同系列：依赖 **`linkfox-amazon-store-auth`** 选店（`sellerId`+`region`）；直接 **`POST /spApi/developerProxy`** 传入 `sellerId`+`region` 调用 **createUploadDestinationForResource**，最后用 **`upload_to_destination.py`** 对返回的 URL 执行 **PUT**（不经网关）。\n\n> 这是 **Uploads API**，不是 Orders 订单接口。订单见 **`linkfox-amazon-store-orders`**；批量 Feed 文件见 **`linkfox-amazon-store-feeds`**。\n\n## 调用方式\n\n- **API 端点**：`POST /spApi/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-store-uploads-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 解决认证和积分问题\n发生以下异常情况时，采用 references/onboarding.md 引导解决问题：\n\n### 异常情况\n- **未配置API Key**：环境变量未配置 `LINKFOX_AGENT_API_KEY`，也未配置 `LINKFOXAGENT_API_KEY`。\n- **响应401或402状态码**\n- **响应提示积分或余额不足**：消息含\"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值\"，或类似含义的内容。\n\n## 官方参考\n\n[createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) · [Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n\n---\n\n## Prerequisites\n\n1. 依赖 **`linkfox-amazon-store-auth`**。\n2. **`resource`** 须与下游 API 文档一致（例如 A+：`aplus/2020-11-01/contentDocuments`；Messaging 为对应 messages 资源路径）。\n3. **`contentMD5`** 为待上传文件内容的 **Base64 MD5 摘要**；传 **`filePath`** / **`content`** 时脚本可自动计算。\n\n---\n\n## 工作流\n\n```text\ncreate_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId\n```\n\n---\n\n## Scripts\n\n| 脚本 | 说明 |\n|------|------|\n| `create_upload_destination_for_resource.py` | POST `uploads/2020-11-01/uploadDestinations/{resource}` |\n| `upload_to_destination.py` | PUT 到返回的 `url`（带 `headers`） |\n| `_spapi_uploads_common.py` | 内部公共模块 |\n\n---\n\n## 示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\npython scripts/create_upload_destination_for_resource.py '{\n  \"sellerId\":\"A1...\",\n  \"region\":\"NA\",\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\n  \"filePath\":\"/path/to/banner.jpg\",\n  \"contentType\":\"image/jpeg\"\n}'\n\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\npython scripts/upload_to_destination.py '{\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\n  \"filePath\": \"/path/to/banner.jpg\"\n}'\n```\n\n---\n\n## Display Rules\n\n1. 成功创建目的地常为 **HTTP 201**；先看 **`developerProxy`**，再看 **`uploadDestination`**。\n2. **`resource`** 不要带前导 `/`；path 中会对 `/` 做编码。\n3. 网关需放行 **`uploads/2020-11-01/`** 前缀。\n\n## 积分消耗规则\n\n不消耗积分。\n\n**Feedback：** `skillName`：`linkfox-amazon-store-uploads`。\n\n---\n*更多跨境 skill：[LinkFox Skills](https://skill.linkfox.com/)*\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-amazon-store-uploads\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1786099599736\n}\n\nFile v1.0.6:references/api.md\n\n# linkfox-amazon-store-uploads — API 参考\n\nUploads **v2020-11-01**，用于在调用 A+ Content、Messaging 等 API 之前**上传二进制文件**。\n\n---\n\n## 1. createUploadDestinationForResource\n\n| 项 | 值 |\n|----|-----|\n| method | POST |\n| path | `uploads/2020-11-01/uploadDestinations/{resource}` |\n| 脚本 | `create_upload_destination_for_resource.py` |\n\n`{resource}` 为下游 API 的资源路径（URL 编码），例如：\n\n- `aplus/2020-11-01/contentDocuments`\n- Messaging：`messaging/v1/orders/{amazonOrderId}/messages/...`（以官方为准）\n\n### Query（写入 `queryString`）\n\n| 参数 | 必填 | 说明 |\n|------|------|------|\n| marketplaceIds | 是 | 单站点 ID（脚本用 `marketplaceId` 或 `marketplaceIds[0]`） |\n| contentMD5 | 是 | 文件内容的 Base64 MD5；或由 `filePath`/`content` 自动计算 |\n| contentType | 否 | 如 `image/jpeg` |\n\n### 入参 JSON（脚本）\n\n| 字段 | 必填 |\n|------|------|\n| sellerId, region | 是 |\n| resource | 是 |\n| marketplaceId | 是 |\n| contentMD5 或 filePath/content/contentBase64 | 是（二选一组合） |\n| contentType | 建议 |\n\n### 响应解析\n\n字段 **`uploadDestination`**，通常含：\n\n- `uploadDestinationId` — 后续业务 API 引用\n- `url` — PUT 上传地址\n- `headers` — 上传时必须附带的 HTTP 头\n\n---\n\n## 2. 上传文件（非 SP-API 代理）\n\n| 脚本 | `upload_to_destination.py` |\n|------|---------------------------|\n| method | PUT |\n| URL | `uploadDestination.url` |\n| headers | `uploadDestination.headers` 全文带上 |\n\n| 字段 | 必填 |\n|------|------|\n| uploadUrl 或 uploadDestination | 是 |\n| headers（若未包在 uploadDestination 内） | 是 |\n| filePath / content / contentBase64 | 是 |\n\n**注意**：PUT 使用的字节须与申请 `contentMD5` 时一致。\n\n---\n\n## 3. contentMD5 计算\n\n与 Amazon 要求一致：对文件字节做 MD5，再 **Base64** 编码摘要：\n\n```python\nbase64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")\n```\n\n---\n\n## 4. 常见 resource 示例\n\n| 场景 | resource 示例 |\n|------|----------------|\n| A+ 内容文档 | `aplus/2020-11-01/contentDocuments` |\n| Messaging 附件 | 见 [Messaging API](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) 各 message 操作的 resource 说明 |\n\n---\n\n## 5. 错误与白名单\n\n- **403**：Uploads 或下游角色未授权。\n- **1005**：网关需放行 `uploads/2020-11-01/`。\n- **429**：默认约 0.1 req/s（以官方为准）。\n\n---\n\n## 6. Feedback\n\n`skillName`: **`linkfox-amazon-store-uploads`**\n\nFile v1.0.6:references/onboarding.md\n\n# 解决认证和积分问题\n\n调用本 skill 时若网关返回 **auth** 或 **billing** 错误，走本 skill 自带的 `scripts/onboarding.py` 完成引导。\n\n**auth 场景**：`errcode=401` 或消息含 `authorized error`/`鉴权失败`/`未授权`/`unauthorized`；或 `LINKFOX_AGENT_API_KEY` 与 `LINKFOXAGENT_API_KEY` 均为空。\n1. 若已配置 key → 先让用户重启会话（最常见误判），仍失败让用户重新取 key 或换手机号重注册\n2. 未配置 → 询问：自助去 https://agent.linkfox.com/ 取 key，或提供手机号让脚本注册\n3. 手机号路径：\n   - `python scripts/onboarding.py send-code <phone>` → 展示 JSON 里的 phone/agreements\n   - 收到验证码后：`python scripts/onboarding.py login <phone> <code>`（workbuddy 宿主加 `--channel workbuddy`）\n   - 拿到 `api_key` 后把下面三平台配置转发给用户，提示重启会话生效：\n     - Windows PowerShell（永久）：`setx LINKFOX_AGENT_API_KEY \"<key>\"`\n     - macOS zsh：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.zshrc && source ~/.zshrc`\n     - Linux bash：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.bashrc && source ~/.bashrc`\n     - 变量名 `LINKFOX_AGENT_API_KEY`（主推）或 `LINKFOXAGENT_API_KEY`（老规范）任一即可\n\n**billing 场景**：`errcode=402` 或消息含 `积分/余额/quota/insufficient/充值/套餐到期`。\n- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单，否则输出编号清单让用户选\n- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`（通常 `wechat/alipay`）\n- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG > `pay_url` > `ascii_qr`（标注兜底）\n- 已付款可选调 `python scripts/onboarding.py query <order_id>`，不主动轮询\n\n排除 `errcode=403`（无权限，不归入这两类）。所有子命令输出 stdout JSON，`error` 字段已含阶段前缀，透传给用户即可。完整用法：`python scripts/onboarding.py --help`。\n\nFile v1.0.6:skill-card.md\n\n## Description:\n\nCreates Amazon SP-API Uploads API destinations through LinkFox, computes or accepts contentMD5 values, uploads files to returned upload URLs, and guides authentication or billing recovery when needed.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal developers, operators, and agents use this skill to prepare binary files for Amazon A+ Content, Messaging, or similar workflows by creating upload destinations and PUT-uploading matching bytes. It is intended for users who already have an Amazon seller context, a LinkFox API key, and the companion store-auth skill for seller and region selection.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles Amazon store workflow data and upload destinations through LinkFox services.\n\nMitigation: Install and run it only when LinkFox is trusted for the relevant Amazon seller workflow and verify sellerId, region, marketplaceId, resource, contentMD5, and contentType before execution.\n\nRisk: Authentication flows can request phone/SMS login and generate or expose LinkFox API keys.\n\nMitigation: Use onboarding commands only after the user explicitly initiates them, keep API keys out of shared logs, and prefer environment-variable configuration over pasting keys into prompts.\n\nRisk: Billing flows can list paid plans and create payment orders.\n\nMitigation: Run payment commands only with explicit user consent, confirm the selected plan and payment method before order creation, and avoid polling payment status automatically.\n\nRisk: Saved response files may contain sensitive upload URLs, headers, order data, or other workflow details.\n\nMitigation: Review the ./linkfox session output directory after use and remove persisted files when the workspace should not retain that data.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-uploads)\n- [API reference](references/api.md)\n- [Authentication and billing onboarding](references/onboarding.md)\n- [Amazon createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource)\n- [Amazon Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n- [Amazon Messaging API reference](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance, files]\n\n**Output Format:** [Markdown guidance with inline shell commands, JSON stdout, and saved JSON response files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Default script behavior saves full JSON responses under ./linkfox/<date>/<session>/data; small responses are printed in full, large responses are summarized unless --inline is used.]\n\n## Skill Version(s):\n\n1.0.6 (source: server release evidence)\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.5: 8 files, 16500 bytes\n\nFiles: references/api.md (2557b), scripts/_spapi_uploads_common.py (13711b), scripts/check_auth_dependency.py (6078b), scripts/create_upload_destination_for_resource.py (2956b), scripts/upload_to_destination.py (2964b), skill-card.md (3180b), SKILL.md (5612b), _meta.json (147b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: linkfox-amazon-store-uploads\ndescription: 亚马逊店铺文件上传（与 linkfox-amazon-store-auth 等同系列），经 /spApi/developerProxy 调用 Uploads API v2020-11-01 的 createUploadDestinationForResource，再向返回 URL 上传文件，供 A+ Content、Messaging 等 API 使用。当用户提到上传文件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、SP-API 上传、A+ 图片上传、Messaging 附件上传 时触发。\n---\n\n# Amazon 店铺 Uploads（文件上传）\n\n本 skill 专用于 **向 Amazon 申请上传目的地并上传文件**，与 **`linkfox-amazon-store-auth`** 同系列：先 **`storeTokens`**，再 **`developerProxy`** 调用 **createUploadDestinationForResource**，最后用 **`upload_to_destination.py`** 对返回的 URL 执行 **PUT**（不经网关）。\n\n> 这是 **Uploads API**，不是 Orders 订单接口。订单见 **`linkfox-amazon-store-orders`**；批量 Feed 文件见 **`linkfox-amazon-store-feeds`**。\n\n## 调用方式\n\n- **API 端点**：`POST /spApi/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-store-uploads-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 解决认证和积分问题\n发生以下异常情况时，采用以下措施来处理：\n\n### 异常情况\n- **未配置API Key**：环境变量未配置 `LINKFOX_AGENT_API_KEY`，也未配置 `LINKFOXAGENT_API_KEY`。\n- **响应401或402状态码**\n- **响应提示积分或余额不足**：消息含\"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值\"，或类似含义的内容。\n\n### 措施\n- 优先采用skill内的 onboarding.md 引导解决问题。\n- 如找不到 onboarding.md 文件，则加载 /linkfox-onboarding 这个skill并根据它的引导来处理。如未安装请先安装：\n    - 下载 https://agent-files.linkfox.com/skills/linkfox-onboarding/release.zip，解压后安装这个skill。如需用户授权才可下载，要询问用户获得授权，你不能自己放弃下载。\n- 兜底措施：仅当前面两个措施经过所有努力都走不通时，才提示用户依据 https://skill.linkfox.com/linkfoxskills/guide.htm 指引获取API Key，或去 https://os.linkfox.com/ 补充积分。\n\n## 官方参考\n\n[createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) · [Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n\n---\n\n## Prerequisites\n\n1. 依赖 **`linkfox-amazon-store-auth`**。\n2. **`resource`** 须与下游 API 文档一致（例如 A+：`aplus/2020-11-01/contentDocuments`；Messaging 为对应 messages 资源路径）。\n3. **`contentMD5`** 为待上传文件内容的 **Base64 MD5 摘要**；传 **`filePath`** / **`content`** 时脚本可自动计算。\n\n---\n\n## 工作流\n\n```text\ncreate_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId\n```\n\n---\n\n## Scripts\n\n| 脚本 | 说明 |\n|------|------|\n| `create_upload_destination_for_resource.py` | POST `uploads/2020-11-01/uploadDestinations/{resource}` |\n| `upload_to_destination.py` | PUT 到返回的 `url`（带 `headers`） |\n| `_spapi_uploads_common.py` | 内部公共模块 |\n\n---\n\n## 示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\npython scripts/create_upload_destination_for_resource.py '{\n  \"sellerId\":\"A1...\",\n  \"region\":\"NA\",\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\n  \"filePath\":\"/path/to/banner.jpg\",\n  \"contentType\":\"image/jpeg\"\n}'\n\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\npython scripts/upload_to_destination.py '{\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\n  \"filePath\": \"/path/to/banner.jpg\"\n}'\n```\n\n---\n\n## Display Rules\n\n1. 成功创建目的地常为 **HTTP 201**；先看 **`developerProxy`**，再看 **`uploadDestination`**。\n2. **`resource`** 不要带前导 `/`；path 中会对 `/` 做编码。\n3. 网关需放行 **`uploads/2020-11-01/`** 前缀。\n\n## 积分消耗规则\n\n不消耗积分。\n\n**Feedback：** `skillName`：`linkfox-amazon-store-uploads`。\n\n---\n*更多跨境 skill：[LinkFox Skills](https://skill.linkfox.com/)*\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-amazon-store-uploads\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1783944423319\n}\n\nFile v1.0.5:references/api.md\n\n# linkfox-amazon-store-uploads — API 参考\n\nUploads **v2020-11-01**，用于在调用 A+ Content、Messaging 等 API 之前**上传二进制文件**。\n\n---\n\n## 1. createUploadDestinationForResource\n\n| 项 | 值 |\n|----|-----|\n| method | POST |\n| path | `uploads/2020-11-01/uploadDestinations/{resource}` |\n| 脚本 | `create_upload_destination_for_resource.py` |\n\n`{resource}` 为下游 API 的资源路径（URL 编码），例如：\n\n- `aplus/2020-11-01/contentDocuments`\n- Messaging：`messaging/v1/orders/{amazonOrderId}/messages/...`（以官方为准）\n\n### Query（写入 `queryString`）\n\n| 参数 | 必填 | 说明 |\n|------|------|------|\n| marketplaceIds | 是 | 单站点 ID（脚本用 `marketplaceId` 或 `marketplaceIds[0]`） |\n| contentMD5 | 是 | 文件内容的 Base64 MD5；或由 `filePath`/`content` 自动计算 |\n| contentType | 否 | 如 `image/jpeg` |\n\n### 入参 JSON（脚本）\n\n| 字段 | 必填 |\n|------|------|\n| sellerId, region | 是 |\n| resource | 是 |\n| marketplaceId | 是 |\n| contentMD5 或 filePath/content/contentBase64 | 是（二选一组合） |\n| contentType | 建议 |\n\n### 响应解析\n\n字段 **`uploadDestination`**，通常含：\n\n- `uploadDestinationId` — 后续业务 API 引用\n- `url` — PUT 上传地址\n- `headers` — 上传时必须附带的 HTTP 头\n\n---\n\n## 2. 上传文件（非 SP-API 代理）\n\n| 脚本 | `upload_to_destination.py` |\n|------|---------------------------|\n| method | PUT |\n| URL | `uploadDestination.url` |\n| headers | `uploadDestination.headers` 全文带上 |\n\n| 字段 | 必填 |\n|------|------|\n| uploadUrl 或 uploadDestination | 是 |\n| headers（若未包在 uploadDestination 内） | 是 |\n| filePath / content / contentBase64 | 是 |\n\n**注意**：PUT 使用的字节须与申请 `contentMD5` 时一致。\n\n---\n\n## 3. contentMD5 计算\n\n与 Amazon 要求一致：对文件字节做 MD5，再 **Base64** 编码摘要：\n\n```python\nbase64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")\n```\n\n---\n\n## 4. 常见 resource 示例\n\n| 场景 | resource 示例 |\n|------|----------------|\n| A+ 内容文档 | `aplus/2020-11-01/contentDocuments` |\n| Messaging 附件 | 见 [Messaging API](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) 各 message 操作的 resource 说明 |\n\n---\n\n## 5. 错误与白名单\n\n- **403**：Uploads 或下游角色未授权。\n- **1005**：网关需放行 `uploads/2020-11-01/`。\n- **429**：默认约 0.1 req/s（以官方为准）。\n\n---\n\n## 6. Feedback\n\n`skillName`: **`linkfox-amazon-store-uploads`**\n\nFile v1.0.5:skill-card.md\n\n## Description: <br>\n亚马逊店铺文件上传技能，通过 LinkFox 网关调用 Amazon SP-API Uploads API v2020-11-01 创建上传目的地，并将文件上传到返回的 URL 以供 A+ Content、Messaging 等后续 API 使用。 <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal developers and marketplace operators use this skill to create Amazon SP-API upload destinations, compute or provide contentMD5 values, and upload binary files for downstream A+ Content or Messaging workflows. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Full upload and API responses, including presigned URLs, headers, upload IDs, or seller metadata, may be saved in the workspace linkfox session directory. <br>\nMitigation: Run the skill only in workspaces where those saved JSON files are acceptable, restrict access to the workspace, and delete the saved response files after use when they contain sensitive data. <br>\nRisk: Uploads depend on LinkFox API credentials and Amazon store authorization state. <br>\nMitigation: Use the required LinkFox API key environment variable and the companion Amazon store auth skill only in approved environments; rotate or revoke credentials if response files or shell history expose sensitive values. <br>\nRisk: The uploaded bytes must match the contentMD5 used when creating the Amazon upload destination. <br>\nMitigation: Prefer filePath or contentBase64 inputs that allow the script to compute contentMD5, or verify the Base64 MD5 manually before uploading. <br>\n\n\n## Reference(s): <br>\n- [linkfox-amazon-store-uploads API reference](references/api.md) <br>\n- [Amazon SP-API createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) <br>\n- [Amazon SP-API create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination) <br>\n- [Amazon SP-API Messaging API reference](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) <br>\n- [ClawHub skill page](https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-uploads) <br>\n- [ClawHub publisher profile](https://clawhub.ai/user/linkfox-ai) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with JSON examples and shell commands; scripts emit JSON responses or summaries.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Scripts save full API/upload responses under a local linkfox session directory and print full JSON or a concise summary depending on response size.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (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.4: 8 files, 15580 bytes\n\nFiles: references/api.md (2557b), scripts/_spapi_uploads_common.py (13616b), scripts/check_auth_dependency.py (6078b), scripts/create_upload_destination_for_resource.py (2956b), scripts/upload_to_destination.py (2964b), skill-card.md (2795b), SKILL.md (4571b), _meta.json (147b)\n\nFile v1.0.4:SKILL.md\n\n---\r\nname: linkfox-amazon-store-uploads\r\ndescription: 亚马逊店铺文件上传（与 linkfox-amazon-store-auth 等同系列），经 /spApi/developerProxy 调用 Uploads API v2020-11-01 的 createUploadDestinationForResource，再向返回 URL 上传文件，供 A+ Content、Messaging 等 API 使用。当用户提到上传文件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、SP-API 上传、A+ 图片上传、Messaging 附件上传 时触发。\r\n---\r\n\r\n# Amazon 店铺 Uploads（文件上传）\r\n\r\n本 skill 专用于 **向 Amazon 申请上传目的地并上传文件**，与 **`linkfox-amazon-store-auth`** 同系列：先 **`storeTokens`**，再 **`developerProxy`** 调用 **createUploadDestinationForResource**，最后用 **`upload_to_destination.py`** 对返回的 URL 执行 **PUT**（不经网关）。\r\n\r\n> 这是 **Uploads API**，不是 Orders 订单接口。订单见 **`linkfox-amazon-store-orders`**；批量 Feed 文件见 **`linkfox-amazon-store-feeds`**。\r\n\r\n## 调用方式\r\n\r\n- **API 端点**：`POST /spApi/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\r\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\r\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\r\n\r\n**输出策略（脚本默认行为）**：\r\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-store-uploads-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\r\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\r\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 3 条样本）\r\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\r\n\r\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\r\n\r\n## 官方参考\r\n\r\n[createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) · [Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\r\n\r\n---\r\n\r\n## Prerequisites\r\n\r\n1. 依赖 **`linkfox-amazon-store-auth`**。\r\n2. **`resource`** 须与下游 API 文档一致（例如 A+：`aplus/2020-11-01/contentDocuments`；Messaging 为对应 messages 资源路径）。\r\n3. **`contentMD5`** 为待上传文件内容的 **Base64 MD5 摘要**；传 **`filePath`** / **`content`** 时脚本可自动计算。\r\n\r\n---\r\n\r\n## 工作流\r\n\r\n```text\r\ncreate_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\r\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId\r\n```\r\n\r\n---\r\n\r\n## Scripts\r\n\r\n| 脚本 | 说明 |\r\n|------|------|\r\n| `create_upload_destination_for_resource.py` | POST `uploads/2020-11-01/uploadDestinations/{resource}` |\r\n| `upload_to_destination.py` | PUT 到返回的 `url`（带 `headers`） |\r\n| `_spapi_uploads_common.py` | 内部公共模块 |\r\n\r\n---\r\n\r\n## 示例\r\n\r\n```bash\r\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\r\n\r\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\r\npython scripts/create_upload_destination_for_resource.py '{\r\n  \"sellerId\":\"A1...\",\r\n  \"region\":\"NA\",\r\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\r\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\r\n  \"filePath\":\"/path/to/banner.jpg\",\r\n  \"contentType\":\"image/jpeg\"\r\n}'\r\n\r\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\r\npython scripts/upload_to_destination.py '{\r\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\r\n  \"filePath\": \"/path/to/banner.jpg\"\r\n}'\r\n```\r\n\r\n---\r\n\r\n## Display Rules\r\n\r\n1. 成功创建目的地常为 **HTTP 201**；先看 **`developerProxy`**，再看 **`uploadDestination`**。\r\n2. **`resource`** 不要带前导 `/`；path 中会对 `/` 做编码。\r\n3. 网关需放行 **`uploads/2020-11-01/`** 前缀。\r\n\r\n**Feedback：** `skillName`：`linkfox-amazon-store-uploads`。\r\n\r\n---\r\n*更多跨境 skill：[LinkFox Skills](https://skill.linkfox.com/)*\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-amazon-store-uploads\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1783336524389\n}\n\nFile v1.0.4:references/api.md\n\n# linkfox-amazon-store-uploads — API 参考\n\nUploads **v2020-11-01**，用于在调用 A+ Content、Messaging 等 API 之前**上传二进制文件**。\n\n---\n\n## 1. createUploadDestinationForResource\n\n| 项 | 值 |\n|----|-----|\n| method | POST |\n| path | `uploads/2020-11-01/uploadDestinations/{resource}` |\n| 脚本 | `create_upload_destination_for_resource.py` |\n\n`{resource}` 为下游 API 的资源路径（URL 编码），例如：\n\n- `aplus/2020-11-01/contentDocuments`\n- Messaging：`messaging/v1/orders/{amazonOrderId}/messages/...`（以官方为准）\n\n### Query（写入 `queryString`）\n\n| 参数 | 必填 | 说明 |\n|------|------|------|\n| marketplaceIds | 是 | 单站点 ID（脚本用 `marketplaceId` 或 `marketplaceIds[0]`） |\n| contentMD5 | 是 | 文件内容的 Base64 MD5；或由 `filePath`/`content` 自动计算 |\n| contentType | 否 | 如 `image/jpeg` |\n\n### 入参 JSON（脚本）\n\n| 字段 | 必填 |\n|------|------|\n| sellerId, region | 是 |\n| resource | 是 |\n| marketplaceId | 是 |\n| contentMD5 或 filePath/content/contentBase64 | 是（二选一组合） |\n| contentType | 建议 |\n\n### 响应解析\n\n字段 **`uploadDestination`**，通常含：\n\n- `uploadDestinationId` — 后续业务 API 引用\n- `url` — PUT 上传地址\n- `headers` — 上传时必须附带的 HTTP 头\n\n---\n\n## 2. 上传文件（非 SP-API 代理）\n\n| 脚本 | `upload_to_destination.py` |\n|------|---------------------------|\n| method | PUT |\n| URL | `uploadDestination.url` |\n| headers | `uploadDestination.headers` 全文带上 |\n\n| 字段 | 必填 |\n|------|------|\n| uploadUrl 或 uploadDestination | 是 |\n| headers（若未包在 uploadDestination 内） | 是 |\n| filePath / content / contentBase64 | 是 |\n\n**注意**：PUT 使用的字节须与申请 `contentMD5` 时一致。\n\n---\n\n## 3. contentMD5 计算\n\n与 Amazon 要求一致：对文件字节做 MD5，再 **Base64** 编码摘要：\n\n```python\nbase64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")\n```\n\n---\n\n## 4. 常见 resource 示例\n\n| 场景 | resource 示例 |\n|------|----------------|\n| A+ 内容文档 | `aplus/2020-11-01/contentDocuments` |\n| Messaging 附件 | 见 [Messaging API](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) 各 message 操作的 resource 说明 |\n\n---\n\n## 5. 错误与白名单\n\n- **403**：Uploads 或下游角色未授权。\n- **1005**：网关需放行 `uploads/2020-11-01/`。\n- **429**：默认约 0.1 req/s（以官方为准）。\n\n---\n\n## 6. Feedback\n\n`skillName`: **`linkfox-amazon-store-uploads`**\n\nFile v1.0.4:skill-card.md\n\n## Description: <br>\nHelps agents create Amazon SP-API upload destinations and upload files for A+ Content, Messaging, and similar store workflows. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal sellers, ecommerce operators, and developers use this skill to prepare Amazon upload destinations, compute required content MD5 values, and upload local or supplied file content for downstream Amazon store APIs. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill reads explicit local file paths and sends those file bytes to a provided upload URL. <br>\nMitigation: Confirm the upload URL, file path, content type, and intended Amazon workflow before running an upload. <br>\nRisk: The skill saves full Amazon upload response records locally, which may include sensitive seller or upload information. <br>\nMitigation: Review and clean generated linkfox session directories after use when they may contain sensitive data. <br>\nRisk: The scanner verdict is suspicious because local response storage and storage fallback behavior are broader than the documentation describes. <br>\nMitigation: Install only after reviewing the security guidance and keep generated response files in an approved workspace. <br>\n\n\n## Reference(s): <br>\n- [API reference](references/api.md) <br>\n- [Amazon SP-API createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) <br>\n- [Amazon SP-API create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination) <br>\n- [Amazon SP-API Messaging API reference](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) <br>\n- [ClawHub skill page](https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-uploads) <br>\n- [Publisher profile](https://clawhub.ai/user/linkfox-ai) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with JSON command inputs and JSON response records] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Scripts save full response records locally and print either the full JSON or a concise summary depending on response size.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (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.3: 7 files, 14224 bytes\n\nFiles: references/api.md (2557b), scripts/_spapi_uploads_common.py (13616b), scripts/check_auth_dependency.py (6078b), scripts/create_upload_destination_for_resource.py (2956b), scripts/upload_to_destination.py (2964b), SKILL.md (4571b), _meta.json (147b)\n\nFile v1.0.3:SKILL.md\n\n---\r\nname: linkfox-amazon-store-uploads\r\ndescription: 亚马逊店铺文件上传（与 linkfox-amazon-store-auth 等同系列），经 /spApi/developerProxy 调用 Uploads API v2020-11-01 的 createUploadDestinationForResource，再向返回 URL 上传文件，供 A+ Content、Messaging 等 API 使用。当用户提到上传文件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、SP-API 上传、A+ 图片上传、Messaging 附件上传 时触发。\r\n---\r\n\r\n# Amazon 店铺 Uploads（文件上传）\r\n\r\n本 skill 专用于 **向 Amazon 申请上传目的地并上传文件**，与 **`linkfox-amazon-store-auth`** 同系列：先 **`storeTokens`**，再 **`developerProxy`** 调用 **createUploadDestinationForResource**，最后用 **`upload_to_destination.py`** 对返回的 URL 执行 **PUT**（不经网关）。\r\n\r\n> 这是 **Uploads API**，不是 Orders 订单接口。订单见 **`linkfox-amazon-store-orders`**；批量 Feed 文件见 **`linkfox-amazon-store-feeds`**。\r\n\r\n## 调用方式\r\n\r\n- **API 端点**：`POST /spApi/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\r\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\r\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\r\n\r\n**输出策略（脚本默认行为）**：\r\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-store-uploads-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\r\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\r\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 3 条样本）\r\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\r\n\r\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\r\n\r\n## 官方参考\r\n\r\n[createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) · [Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\r\n\r\n---\r\n\r\n## Prerequisites\r\n\r\n1. 依赖 **`linkfox-amazon-store-auth`**。\r\n2. **`resource`** 须与下游 API 文档一致（例如 A+：`aplus/2020-11-01/contentDocuments`；Messaging 为对应 messages 资源路径）。\r\n3. **`contentMD5`** 为待上传文件内容的 **Base64 MD5 摘要**；传 **`filePath`** / **`content`** 时脚本可自动计算。\r\n\r\n---\r\n\r\n## 工作流\r\n\r\n```text\r\ncreate_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\r\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId\r\n```\r\n\r\n---\r\n\r\n## Scripts\r\n\r\n| 脚本 | 说明 |\r\n|------|------|\r\n| `create_upload_destination_for_resource.py` | POST `uploads/2020-11-01/uploadDestinations/{resource}` |\r\n| `upload_to_destination.py` | PUT 到返回的 `url`（带 `headers`） |\r\n| `_spapi_uploads_common.py` | 内部公共模块 |\r\n\r\n---\r\n\r\n## 示例\r\n\r\n```bash\r\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\r\n\r\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\r\npython scripts/create_upload_destination_for_resource.py '{\r\n  \"sellerId\":\"A1...\",\r\n  \"region\":\"NA\",\r\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\r\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\r\n  \"filePath\":\"/path/to/banner.jpg\",\r\n  \"contentType\":\"image/jpeg\"\r\n}'\r\n\r\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\r\npython scripts/upload_to_destination.py '{\r\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\r\n  \"filePath\": \"/path/to/banner.jpg\"\r\n}'\r\n```\r\n\r\n---\r\n\r\n## Display Rules\r\n\r\n1. 成功创建目的地常为 **HTTP 201**；先看 **`developerProxy`**，再看 **`uploadDestination`**。\r\n2. **`resource`** 不要带前导 `/`；path 中会对 `/` 做编码。\r\n3. 网关需放行 **`uploads/2020-11-01/`** 前缀。\r\n\r\n**Feedback：** `skillName`：`linkfox-amazon-store-uploads`。\r\n\r\n---\r\n*更多跨境 skill：[LinkFox Skills](https://skill.linkfox.com/)*\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-amazon-store-uploads\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783066456016\n}\n\nFile v1.0.3:references/api.md\n\n# linkfox-amazon-store-uploads — API 参考\n\nUploads **v2020-11-01**，用于在调用 A+ Content、Messaging 等 API 之前**上传二进制文件**。\n\n---\n\n## 1. createUploadDestinationForResource\n\n| 项 | 值 |\n|----|-----|\n| method | POST |\n| path | `uploads/2020-11-01/uploadDestinations/{resource}` |\n| 脚本 | `create_upload_destination_for_resource.py` |\n\n`{resource}` 为下游 API 的资源路径（URL 编码），例如：\n\n- `aplus/2020-11-01/contentDocuments`\n- Messaging：`messaging/v1/orders/{amazonOrderId}/messages/...`（以官方为准）\n\n### Query（写入 `queryString`）\n\n| 参数 | 必填 | 说明 |\n|------|------|------|\n| marketplaceIds | 是 | 单站点 ID（脚本用 `marketplaceId` 或 `marketplaceIds[0]`） |\n| contentMD5 | 是 | 文件内容的 Base64 MD5；或由 `filePath`/`content` 自动计算 |\n| contentType | 否 | 如 `image/jpeg` |\n\n### 入参 JSON（脚本）\n\n| 字段 | 必填 |\n|------|------|\n| sellerId, region | 是 |\n| resource | 是 |\n| marketplaceId | 是 |\n| contentMD5 或 filePath/content/contentBase64 | 是（二选一组合） |\n| contentType | 建议 |\n\n### 响应解析\n\n字段 **`uploadDestination`**，通常含：\n\n- `uploadDestinationId` — 后续业务 API 引用\n- `url` — PUT 上传地址\n- `headers` — 上传时必须附带的 HTTP 头\n\n---\n\n## 2. 上传文件（非 SP-API 代理）\n\n| 脚本 | `upload_to_destination.py` |\n|------|---------------------------|\n| method | PUT |\n| URL | `uploadDestination.url` |\n| headers | `uploadDestination.headers` 全文带上 |\n\n| 字段 | 必填 |\n|------|------|\n| uploadUrl 或 uploadDestination | 是 |\n| headers（若未包在 uploadDestination 内） | 是 |\n| filePath / content / contentBase64 | 是 |\n\n**注意**：PUT 使用的字节须与申请 `contentMD5` 时一致。\n\n---\n\n## 3. contentMD5 计算\n\n与 Amazon 要求一致：对文件字节做 MD5，再 **Base64** 编码摘要：\n\n```python\nbase64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")\n```\n\n---\n\n## 4. 常见 resource 示例\n\n| 场景 | resource 示例 |\n|------|----------------|\n| A+ 内容文档 | `aplus/2020-11-01/contentDocuments` |\n| Messaging 附件 | 见 [Messaging API](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) 各 message 操作的 resource 说明 |\n\n---\n\n## 5. 错误与白名单\n\n- **403**：Uploads 或下游角色未授权。\n- **1005**：网关需放行 `uploads/2020-11-01/`。\n- **429**：默认约 0.1 req/s（以官方为准）。\n\n---\n\n## 6. Feedback\n\n`skillName`: **`linkfox-amazon-store-uploads`**\n\nArchive v1.0.2: 7 files, 14273 bytes\n\nFiles: references/api.md (2557b), scripts/_spapi_uploads_common.py (13794b), scripts/check_auth_dependency.py (6078b), scripts/create_upload_destination_for_resource.py (2956b), scripts/upload_to_destination.py (2964b), SKILL.md (4571b), _meta.json (147b)\n\nFile v1.0.2:SKILL.md\n\n---\r\nname: linkfox-amazon-store-uploads\r\ndescription: 亚马逊店铺文件上传（与 linkfox-amazon-store-auth 等同系列），经 /spApi/developerProxy 调用 Uploads API v2020-11-01 的 createUploadDestinationForResource，再向返回 URL 上传文件，供 A+ Content、Messaging 等 API 使用。当用户提到上传文件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、SP-API 上传、A+ 图片上传、Messaging 附件上传 时触发。\r\n---\r\n\r\n# Amazon 店铺 Uploads（文件上传）\r\n\r\n本 skill 专用于 **向 Amazon 申请上传目的地并上传文件**，与 **`linkfox-amazon-store-auth`** 同系列：先 **`storeTokens`**，再 **`developerProxy`** 调用 **createUploadDestinationForResource**，最后用 **`upload_to_destination.py`** 对返回的 URL 执行 **PUT**（不经网关）。\r\n\r\n> 这是 **Uploads API**，不是 Orders 订单接口。订单见 **`linkfox-amazon-store-orders`**；批量 Feed 文件见 **`linkfox-amazon-store-feeds`**。\r\n\r\n## 调用方式\r\n\r\n- **API 端点**：`POST /spApi/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\r\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\r\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\r\n\r\n**输出策略（脚本默认行为）**：\r\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-store-uploads-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\r\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\r\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 3 条样本）\r\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\r\n\r\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\r\n\r\n## 官方参考\r\n\r\n[createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) · [Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\r\n\r\n---\r\n\r\n## Prerequisites\r\n\r\n1. 依赖 **`linkfox-amazon-store-auth`**。\r\n2. **`resource`** 须与下游 API 文档一致（例如 A+：`aplus/2020-11-01/contentDocuments`；Messaging 为对应 messages 资源路径）。\r\n3. **`contentMD5`** 为待上传文件内容的 **Base64 MD5 摘要**；传 **`filePath`** / **`content`** 时脚本可自动计算。\r\n\r\n---\r\n\r\n## 工作流\r\n\r\n```text\r\ncreate_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\r\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId\r\n```\r\n\r\n---\r\n\r\n## Scripts\r\n\r\n| 脚本 | 说明 |\r\n|------|------|\r\n| `create_upload_destination_for_resource.py` | POST `uploads/2020-11-01/uploadDestinations/{resource}` |\r\n| `upload_to_destination.py` | PUT 到返回的 `url`（带 `headers`） |\r\n| `_spapi_uploads_common.py` | 内部公共模块 |\r\n\r\n---\r\n\r\n## 示例\r\n\r\n```bash\r\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\r\n\r\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\r\npython scripts/create_upload_destination_for_resource.py '{\r\n  \"sellerId\":\"A1...\",\r\n  \"region\":\"NA\",\r\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\r\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\r\n  \"filePath\":\"/path/to/banner.jpg\",\r\n  \"contentType\":\"image/jpeg\"\r\n}'\r\n\r\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\r\npython scripts/upload_to_destination.py '{\r\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\r\n  \"filePath\": \"/path/to/banner.jpg\"\r\n}'\r\n```\r\n\r\n---\r\n\r\n## Display Rules\r\n\r\n1. 成功创建目的地常为 **HTTP 201**；先看 **`developerProxy`**，再看 **`uploadDestination`**。\r\n2. **`resource`** 不要带前导 `/`；path 中会对 `/` 做编码。\r\n3. 网关需放行 **`uploads/2020-11-01/`** 前缀。\r\n\r\n**Feedback：** `skillName`：`linkfox-amazon-store-uploads`。\r\n\r\n---\r\n*更多跨境 skill：[LinkFox Skills](https://skill.linkfox.com/)*\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-amazon-store-uploads\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1783053465124\n}\n\nFile v1.0.2:references/api.md\n\n# linkfox-amazon-store-uploads — API 参考\n\nUploads **v2020-11-01**，用于在调用 A+ Content、Messaging 等 API 之前**上传二进制文件**。\n\n---\n\n## 1. createUploadDestinationForResource\n\n| 项 | 值 |\n|----|-----|\n| method | POST |\n| path | `uploads/2020-11-01/uploadDestinations/{resource}` |\n| 脚本 | `create_upload_destination_for_resource.py` |\n\n`{resource}` 为下游 API 的资源路径（URL 编码），例如：\n\n- `aplus/2020-11-01/contentDocuments`\n- Messaging：`messaging/v1/orders/{amazonOrderId}/messages/...`（以官方为准）\n\n### Query（写入 `queryString`）\n\n| 参数 | 必填 | 说明 |\n|------|------|------|\n| marketplaceIds | 是 | 单站点 ID（脚本用 `marketplaceId` 或 `marketplaceIds[0]`） |\n| contentMD5 | 是 | 文件内容的 Base64 MD5；或由 `filePath`/`content` 自动计算 |\n| contentType | 否 | 如 `image/jpeg` |\n\n### 入参 JSON（脚本）\n\n| 字段 | 必填 |\n|------|------|\n| sellerId, region | 是 |\n| resource | 是 |\n| marketplaceId | 是 |\n| contentMD5 或 filePath/content/contentBase64 | 是（二选一组合） |\n| contentType | 建议 |\n\n### 响应解析\n\n字段 **`uploadDestination`**，通常含：\n\n- `uploadDestinationId` — 后续业务 API 引用\n- `url` — PUT 上传地址\n- `headers` — 上传时必须附带的 HTTP 头\n\n---\n\n## 2. 上传文件（非 SP-API 代理）\n\n| 脚本 | `upload_to_destination.py` |\n|------|---------------------------|\n| method | PUT |\n| URL | `uploadDestination.url` |\n| headers | `uploadDestination.headers` 全文带上 |\n\n| 字段 | 必填 |\n|------|------|\n| uploadUrl 或 uploadDestination | 是 |\n| headers（若未包在 uploadDestination 内） | 是 |\n| filePath / content / contentBase64 | 是 |\n\n**注意**：PUT 使用的字节须与申请 `contentMD5` 时一致。\n\n---\n\n## 3. contentMD5 计算\n\n与 Amazon 要求一致：对文件字节做 MD5，再 **Base64** 编码摘要：\n\n```python\nbase64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")\n```\n\n---\n\n## 4. 常见 resource 示例\n\n| 场景 | resource 示例 |\n|------|----------------|\n| A+ 内容文档 | `aplus/2020-11-01/contentDocuments` |\n| Messaging 附件 | 见 [Messaging API](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) 各 message 操作的 resource 说明 |\n\n---\n\n## 5. 错误与白名单\n\n- **403**：Uploads 或下游角色未授权。\n- **1005**：网关需放行 `uploads/2020-11-01/`。\n- **429**：默认约 0.1 req/s（以官方为准）。\n\n---\n\n## 6. Feedback\n\n`skillName`: **`linkfox-amazon-store-uploads`**\n\nArchive v1.0.1: 9 files, 19857 bytes\n\nFiles: references/api.md (2557b), scripts/_spapi_uploads_common.py (7115b), scripts/check_auth_dependency.py (6078b), scripts/create_upload_destination_for_resource.py (2917b), scripts/response_io.py (18387b), scripts/upload_to_destination.py (2933b), skill-card.md (2693b), SKILL.md (4780b), _meta.json (147b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: linkfox-amazon-store-uploads\ndescription: 亚马逊店铺文件上传（与 linkfox-amazon-store-auth 等同系列），经 /spApi/developerProxy 调用 Uploads API v2020-11-01 的 createUploadDestinationForResource，再向返回 URL 上传文件，供 A+ Content、Messaging 等 API 使用。当用户提到上传文件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、SP-API 上传、A+ 图片上传、Messaging 附件上传 时触发。\n---\n\n# Amazon 店铺 Uploads（文件上传）\n\n本 skill 专用于 **向 Amazon 申请上传目的地并上传文件**，与 **`linkfox-amazon-store-auth`** 同系列：先 **`storeTokens`**，再 **`developerProxy`** 调用 **createUploadDestinationForResource**，最后用 **`upload_to_destination.py`** 对返回的 URL 执行 **PUT**（不经网关）。\n\n> 这是 **Uploads API**，不是 Orders 订单接口。订单见 **`linkfox-amazon-store-orders`**；批量 Feed 文件见 **`linkfox-amazon-store-feeds`**。\n\n## 官方参考\n\n[createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) · [Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n\n---\n\n## Prerequisites\n\n1. 依赖 **`linkfox-amazon-store-auth`**。\n2. **`resource`** 须与下游 API 文档一致（例如 A+：`aplus/2020-11-01/contentDocuments`；Messaging 为对应 messages 资源路径）。\n3. **`contentMD5`** 为待上传文件内容的 **Base64 MD5 摘要**；传 **`filePath`** / **`content`** 时脚本可自动计算。\n\n---\n\n## 工作流\n\n```text\ncreate_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId\n```\n\n---\n\n## Scripts\n\n| 脚本 | 说明 |\n|------|------|\n| `create_upload_destination_for_resource.py` | POST `uploads/2020-11-01/uploadDestinations/{resource}` |\n| `upload_to_destination.py` | PUT 到返回的 `url`（带 `headers`） |\n| `_spapi_uploads_common.py` | 内部公共模块 |\n\n---\n\n## 示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\npython scripts/create_upload_destination_for_resource.py '{\n  \"sellerId\":\"A1...\",\n  \"region\":\"NA\",\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\n  \"filePath\":\"/path/to/banner.jpg\",\n  \"contentType\":\"image/jpeg\"\n}'\n\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\npython scripts/upload_to_destination.py '{\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\n  \"filePath\": \"/path/to/banner.jpg\"\n}'\n```\n\n---\n\n## Display Rules\n\n1. 成功创建目的地常为 **HTTP 201**；先看 **`developerProxy`**，再看 **`uploadDestination`**。\n2. **`resource`** 不要带前导 `/`；path 中会对 `/` 做编码。\n3. 网关需放行 **`uploads/2020-11-01/`** 前缀。\n\n**Feedback：** `skillName`：`linkfox-amazon-store-uploads`。\n\n---\n*更多跨境 skill：[LinkFox Skills](https://skill.linkfox.com/)*\n\n<!-- LF_LARGE_RESPONSE_BLOCK -->\n## Handling Large Responses\n\nTo avoid overflowing the agent context, persist the response to disk and extract only the fields you need:\n\n```\npython scripts/response_io.py run --script scripts/check_auth_dependency.py --out-dir <DIR> '<params>'\npython scripts/response_io.py read <file> --fields \"<paths>\"   # or --path \"<JMESPath>\"\n```\n\n> Pick `--out-dir` outside any git working tree (e.g. `/tmp/...` on Unix, `%TEMP%/...` on Windows). Persisted responses may contain PII, pricing, or auth-sensitive data — do not commit them. Files are not auto-deleted; clean up when the task is done.\n\n> This skill exposes multiple entry scripts: `check_auth_dependency.py`, `create_upload_destination_for_resource.py`, `upload_to_destination.py`. Pass `--script scripts/<name>.py` to choose the one you need.\n\n`run` writes the full response to a file and emits only a schema preview + file path. `read` projects specific fields, with `--limit/--offset` for slicing and `--format json|jsonl|csv|table` for output.\n\n**When to prefer this pattern** — apply your judgment based on the response characteristics, e.g.:\n- High field count per record, or fields you don't need\n- Batch/paginated results (multiple items per call)\n- Long-text fields (descriptions, reviews, HTML, time series)\n- Output reused across later steps rather than consumed immediately\n\nFor small, single-use responses, calling the main script directly is fine.\n\n⚠️ The preview is a truncated schema + sample, not the full data. Any field-level decision must read from the persisted file via `read`.\n<!-- /LF_LARGE_RESPONSE_BLOCK -->\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-amazon-store-uploads\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1782729989904\n}\n\nFile v1.0.1:references/api.md\n\n# linkfox-amazon-store-uploads — API 参考\n\nUploads **v2020-11-01**，用于在调用 A+ Content、Messaging 等 API 之前**上传二进制文件**。\n\n---\n\n## 1. createUploadDestinationForResource\n\n| 项 | 值 |\n|----|-----|\n| method | POST |\n| path | `uploads/2020-11-01/uploadDestinations/{resource}` |\n| 脚本 | `create_upload_destination_for_resource.py` |\n\n`{resource}` 为下游 API 的资源路径（URL 编码），例如：\n\n- `aplus/2020-11-01/contentDocuments`\n- Messaging：`messaging/v1/orders/{amazonOrderId}/messages/...`（以官方为准）\n\n### Query（写入 `queryString`）\n\n| 参数 | 必填 | 说明 |\n|------|------|------|\n| marketplaceIds | 是 | 单站点 ID（脚本用 `marketplaceId` 或 `marketplaceIds[0]`） |\n| contentMD5 | 是 | 文件内容的 Base64 MD5；或由 `filePath`/`content` 自动计算 |\n| contentType | 否 | 如 `image/jpeg` |\n\n### 入参 JSON（脚本）\n\n| 字段 | 必填 |\n|------|------|\n| sellerId, region | 是 |\n| resource | 是 |\n| marketplaceId | 是 |\n| contentMD5 或 filePath/content/contentBase64 | 是（二选一组合） |\n| contentType | 建议 |\n\n### 响应解析\n\n字段 **`uploadDestination`**，通常含：\n\n- `uploadDestinationId` — 后续业务 API 引用\n- `url` — PUT 上传地址\n- `headers` — 上传时必须附带的 HTTP 头\n\n---\n\n## 2. 上传文件（非 SP-API 代理）\n\n| 脚本 | `upload_to_destination.py` |\n|------|---------------------------|\n| method | PUT |\n| URL | `uploadDestination.url` |\n| headers | `uploadDestination.headers` 全文带上 |\n\n| 字段 | 必填 |\n|------|------|\n| uploadUrl 或 uploadDestination | 是 |\n| headers（若未包在 uploadDestination 内） | 是 |\n| filePath / content / contentBase64 | 是 |\n\n**注意**：PUT 使用的字节须与申请 `contentMD5` 时一致。\n\n---\n\n## 3. contentMD5 计算\n\n与 Amazon 要求一致：对文件字节做 MD5，再 **Base64** 编码摘要：\n\n```python\nbase64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")\n```\n\n---\n\n## 4. 常见 resource 示例\n\n| 场景 | resource 示例 |\n|------|----------------|\n| A+ 内容文档 | `aplus/2020-11-01/contentDocuments` |\n| Messaging 附件 | 见 [Messaging API](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) 各 message 操作的 resource 说明 |\n\n---\n\n## 5. 错误与白名单\n\n- **403**：Uploads 或下游角色未授权。\n- **1005**：网关需放行 `uploads/2020-11-01/`。\n- **429**：默认约 0.1 req/s（以官方为准）。\n\n---\n\n## 6. Feedback\n\n`skillName`: **`linkfox-amazon-store-uploads`**\n\nFile v1.0.1:skill-card.md\n\n## Description: <br>\nHelps agents create Amazon SP-API Uploads API destinations through the LinkFox workflow and upload files to the returned destination for A+ Content, Messaging, and related Amazon store use cases. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and commerce operations agents use this skill to request Amazon upload destinations and upload local or inline file content for downstream SP-API workflows such as A+ Content and Messaging attachments. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The workflow requires an API key and may handle Amazon store authorization data. <br>\nMitigation: Use the skill only in trusted environments and provide LINKFOXAGENT_API_KEY through secure environment configuration. <br>\nRisk: Uploading to an unintended destination URL could disclose business files or send content to the wrong endpoint. <br>\nMitigation: Verify that uploadDestination.url and headers come from the intended Amazon response before running the upload step. <br>\nRisk: Persisted response_io files may contain business or auth-sensitive data. <br>\nMitigation: Write response files outside git working trees and delete them when the workflow is complete. <br>\n\n\n## Reference(s): <br>\n- [Artifact API Reference](artifact/references/api.md) <br>\n- [Amazon SP-API createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) <br>\n- [Amazon SP-API Create an Upload Destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination) <br>\n- [Amazon SP-API Messaging API Reference](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) <br>\n- [ClawHub Skill Page](https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-uploads) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with shell commands and JSON script responses] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Scripts may persist API responses to local JSON files for later field extraction.] <br>\n\n## Skill Version(s): <br>\n1.0.1 (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 v0.0.1: 8 files, 12618 bytes\n\nFiles: references/api.md (2557b), scripts/_spapi_uploads_common.py (7115b), scripts/check_auth_dependency.py (6078b), scripts/create_upload_destination_for_resource.py (2917b), scripts/upload_to_destination.py (2933b), skill-card.md (2852b), SKILL.md (3193b), _meta.json (147b)\n\nFile v0.0.1:SKILL.md\n\n---\nname: linkfox-amazon-store-uploads\nversion: 0.0.1\ncategory: product-sourcing\ndescription: 亚马逊店铺文件上传（与 linkfox-amazon-store-auth 等同系列），经 /spApi/developerProxy 调用 Uploads API v2020-11-01 的 createUploadDestinationForResource，再向返回 URL 上传文件，供 A+ Content、Messaging 等 API 使用。当用户提到上传文件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、SP-API 上传、A+ 图片上传、Messaging 附件上传 时触发。\n---\n\n# Amazon 店铺 Uploads（文件上传）\n\n本 skill 专用于 **向 Amazon 申请上传目的地并上传文件**，与 **`linkfox-amazon-store-auth`** 同系列：先 **`storeTokens`**，再 **`developerProxy`** 调用 **createUploadDestinationForResource**，最后用 **`upload_to_destination.py`** 对返回的 URL 执行 **PUT**（不经网关）。\n\n> 这是 **Uploads API**，不是 Orders 订单接口。订单见 **`linkfox-amazon-store-orders`**；批量 Feed 文件见 **`linkfox-amazon-store-feeds`**。\n\n## 官方参考\n\n[createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) · [Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n\n---\n\n## Prerequisites\n\n1. 依赖 **`linkfox-amazon-store-auth`**。\n2. **`resource`** 须与下游 API 文档一致（例如 A+：`aplus/2020-11-01/contentDocuments`；Messaging 为对应 messages 资源路径）。\n3. **`contentMD5`** 为待上传文件内容的 **Base64 MD5 摘要**；传 **`filePath`** / **`content`** 时脚本可自动计算。\n\n---\n\n## 工作流\n\n```text\ncreate_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId\n```\n\n---\n\n## Scripts\n\n| 脚本 | 说明 |\n|------|------|\n| `create_upload_destination_for_resource.py` | POST `uploads/2020-11-01/uploadDestinations/{resource}` |\n| `upload_to_destination.py` | PUT 到返回的 `url`（带 `headers`） |\n| `_spapi_uploads_common.py` | 内部公共模块 |\n\n---\n\n## 示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\npython scripts/create_upload_destination_for_resource.py '{\n  \"sellerId\":\"A1...\",\n  \"region\":\"NA\",\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\n  \"filePath\":\"/path/to/banner.jpg\",\n  \"contentType\":\"image/jpeg\"\n}'\n\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\npython scripts/upload_to_destination.py '{\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\n  \"filePath\": \"/path/to/banner.jpg\"\n}'\n```\n\n---\n\n## Display Rules\n\n1. 成功创建目的地常为 **HTTP 201**；先看 **`developerProxy`**，再看 **`uploadDestination`**。\n2. **`resource`** 不要带前导 `/`；path 中会对 `/` 做编码。\n3. 网关需放行 **`uploads/2020-11-01/`** 前缀。\n\n**Feedback：** `skillName`：`linkfox-amazon-store-uploads`。\n\n---\n*更多跨境 skill：[LinkFox Skills](https://skill.linkfox.com/)*\n\nFile v0.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-amazon-store-uploads\",\n  \"version\": \"0.0.1\",\n  \"publishedAt\": 1779264356821\n}\n\nFile v0.0.1:references/api.md\n\n# linkfox-amazon-store-uploads — API 参考\n\nUploads **v2020-11-01**，用于在调用 A+ Content、Messaging 等 API 之前**上传二进制文件**。\n\n---\n\n## 1. createUploadDestinationForResource\n\n| 项 | 值 |\n|----|-----|\n| method | POST |\n| path | `uploads/2020-11-01/uploadDestinations/{resource}` |\n| 脚本 | `create_upload_destination_for_resource.py` |\n\n`{resource}` 为下游 API 的资源路径（URL 编码），例如：\n\n- `aplus/2020-11-01/contentDocuments`\n- Messaging：`messaging/v1/orders/{amazonOrderId}/messages/...`（以官方为准）\n\n### Query（写入 `queryString`）\n\n| 参数 | 必填 | 说明 |\n|------|------|------|\n| marketplaceIds | 是 | 单站点 ID（脚本用 `marketplaceId` 或 `marketplaceIds[0]`） |\n| contentMD5 | 是 | 文件内容的 Base64 MD5；或由 `filePath`/`content` 自动计算 |\n| contentType | 否 | 如 `image/jpeg` |\n\n### 入参 JSON（脚本）\n\n| 字段 | 必填 |\n|------|------|\n| sellerId, region | 是 |\n| resource | 是 |\n| marketplaceId | 是 |\n| contentMD5 或 filePath/content/contentBase64 | 是（二选一组合） |\n| contentType | 建议 |\n\n### 响应解析\n\n字段 **`uploadDestination`**，通常含：\n\n- `uploadDestinationId` — 后续业务 API 引用\n- `url` — PUT 上传地址\n- `headers` — 上传时必须附带的 HTTP 头\n\n---\n\n## 2. 上传文件（非 SP-API 代理）\n\n| 脚本 | `upload_to_destination.py` |\n|------|---------------------------|\n| method | PUT |\n| URL | `uploadDestination.url` |\n| headers | `uploadDestination.headers` 全文带上 |\n\n| 字段 | 必填 |\n|------|------|\n| uploadUrl 或 uploadDestination | 是 |\n| headers（若未包在 uploadDestination 内） | 是 |\n| filePath / content / contentBase64 | 是 |\n\n**注意**：PUT 使用的字节须与申请 `contentMD5` 时一致。\n\n---\n\n## 3. contentMD5 计算\n\n与 Amazon 要求一致：对文件字节做 MD5，再 **Base64** 编码摘要：\n\n```python\nbase64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")\n```\n\n---\n\n## 4. 常见 resource 示例\n\n| 场景 | resource 示例 |\n|------|----------------|\n| A+ 内容文档 | `aplus/2020-11-01/contentDocuments` |\n| Messaging 附件 | 见 [Messaging API](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) 各 message 操作的 resource 说明 |\n\n---\n\n## 5. 错误与白名单\n\n- **403**：Uploads 或下游角色未授权。\n- **1005**：网关需放行 `uploads/2020-11-01/`。\n- **429**：默认约 0.1 req/s（以官方为准）。\n\n---\n\n## 6. Feedback\n\n`skillName`: **`linkfox-amazon-store-uploads`**\n\nFile v0.0.1:skill-card.md\n\n## Description: <br>\nHelps agents create Amazon SP-API Uploads API destinations through LinkFox and upload a selected file to the returned URL for A+ Content or Messaging workflows. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal developers and marketplace operators use this skill to create Amazon upload destinations and transfer binary files that downstream SP-API workflows can reference. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill requires a LinkFox API key and Amazon SP-API seller context. <br>\nMitigation: Keep LINKFOXAGENT_API_KEY in the environment, avoid committing credentials, and run only in sessions intended for LinkFox/Amazon SP-API uploads. <br>\nRisk: The upload workflow reads a user-selected local file and sends its bytes to an upload URL. <br>\nMitigation: Review the file path, content type, marketplace, and resource before execution, and upload only to destinations returned by the Amazon upload-destination workflow. <br>\nRisk: Incorrect resource paths, marketplace IDs, or headers can cause failed uploads or uploads that cannot be used by downstream SP-API workflows. <br>\nMitigation: Match resource values to the downstream Amazon API documentation and pass the returned uploadDestination headers unchanged. <br>\n\n\n## Reference(s): <br>\n- [API reference](references/api.md) <br>\n- [Amazon createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) <br>\n- [Amazon Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination) <br>\n- [Amazon Messaging API reference](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) <br>\n- [ClawHub skill page](https://clawhub.ai/linkfox-ai/linkfox-amazon-store-uploads) <br>\n- [LinkFox Skills](https://skill.linkfox.com/) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, API calls] <br>\n**Output Format:** [Markdown guidance with shell commands and JSON API parameters] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May execute bundled Python scripts that read a selected file, call LinkFox/Amazon SP-API upload destination endpoints, and PUT bytes to the returned upload URL.] <br>\n\n## Skill Version(s): <br>\n0.0.1 (source: frontmatter and 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>","readmeExcerpt":"Skill: 亚马逊-店铺上传 Owner: linkfox-ai Summary: 亚马逊 SP-API 通用文件上传。用于为 A+ Content、Messaging 等业务创建 upload destination，计算 contentMD5，并将图片或附件上传到返回的预签名地址。用户提到亚马逊文件上传、A+ 图片上传、Messaging 附件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、Uploads API、SP-API 上传文件时触发。即使未明确说“Uploads API”，只要其他亚马逊 SP-API 操作需要先获得可引用的上传资源地址，也应触发此技能；Feed 文档上传使用 linkfox-amazon-store-feeds 的专用流程。 Tags: latest:1.0.8 Version history: v1","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"create_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId"},{"language":"bash","snippet":"export LINKFOXAGENT_API_KEY=\"<your-key>\"\n\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\npython scripts/create_upload_destination_for_resource.py '{\n  \"sellerId\":\"A1...\",\n  \"region\":\"NA\",\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\n  \"filePath\":\"/path/to/banner.jpg\",\n  \"contentType\":\"image/jpeg\"\n}'\n\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\npython scripts/upload_to_destination.py '{\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\n  \"filePath\": \"/path/to/banner.jpg\"\n}'"},{"language":"python","snippet":"base64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")"},{"language":"text","snippet":"create_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId"},{"language":"bash","snippet":"export LINKFOXAGENT_API_KEY=\"<your-key>\"\n\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\npython scripts/create_upload_destination_for_resource.py '{\n  \"sellerId\":\"A1...\",\n  \"region\":\"NA\",\n  \"resource\":\"aplus/2020-11-01/contentDocuments\",\n  \"marketplaceId\":\"ATVPDKIKX0DER\",\n  \"filePath\":\"/path/to/banner.jpg\",\n  \"contentType\":\"image/jpeg\"\n}'\n\n# 2) 上传文件（将上一步 stdout 中的 uploadDestination 传入）\npython scripts/upload_to_destination.py '{\n  \"uploadDestination\": { \"url\": \"...\", \"headers\": { } },\n  \"filePath\": \"/path/to/banner.jpg\"\n}'"},{"language":"python","snippet":"base64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: linkfox-amazon-store-uploads\ndescription: 亚马逊 SP-API 通用文件上传。用于为 A+ Content、Messaging 等业务创建 upload destination，计算 contentMD5，并将图片或附件上传到返回的预签名地址。用户提到亚马逊文件上传、A+ 图片上传、Messaging 附件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、Uploads API、SP-API 上传文件时触发。即使未明确说“Uploads API”，只要其他亚马逊 SP-API 操作需要先获得可引用的上传资源地址，也应触发此技能；Feed 文档上传使用 linkfox-amazon-store-feeds 的专用流程。\n---\n\n# Amazon 店铺 Uploads（文件上传）\n\n本 skill 专用于 **向 Amazon 申请上传目的地并上传文件**，与 **`linkfox-amazon-store-auth`** 同系列：依赖 **`linkfox-amazon-store-auth`** 选店（`sellerId`+`region`）；直接 **`POST /spApi/developerProxy`** 传入 `sellerId`+`region` 调用 **createUploadDestinationForResource**，最后用 **`upload_to_destination.py`** 对返回的 URL 执行 **PUT**（不经网关）。\n\n> 这是 **Uploads API**，不是 Orders 订单接口。订单见 **`linkfox-amazon-store-orders`**；批量 Feed 文件见 **`linkfox-amazon-store-feeds`**。\n\n## 调用方式\n\n- **API 端点**：`POST /spApi/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\n- **成本约束**：本工具会消耗算力；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-store-uploads-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 解决认证和算力问题\n发生以下异常情况时，采用 references/onboarding.md 引导解决问题：\n\n### 异常情况\n- **未配置API Key**：环境变量未配置 `LINKFOX_AGENT_API_KEY`，也未配置 `LINKFOXAGENT_API_KEY`。\n- **响应401或402状态码**\n- **响应提示算力或余额不足**：消息含\"算力余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值\"，或类似含义的内容。\n\n## 官方参考\n\n[createUploadDestinationForResource](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource) · [Create an upload destination](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n\n---\n\n## Prerequisites\n\n1. 依赖 **`linkfox-amazon-store-auth`**。\n2. **`resource`** 须与下游 API 文档一致（例如 A+：`aplus/2020-11-01/contentDocuments`；Messaging 为对应 messages 资源路径）。\n3. **`contentMD5`** 为待上传文件内容的 **Base64 MD5 摘要**；传 **`filePath`** / **`content`** 时脚本可自动计算。\n\n---\n\n## 工作流\n\n```text\ncreate_upload_destination_for_resource  →  uploadDestination { uploadDestinationId, url, headers }\nupload_to_destination (PUT url + headers)  →  在 A+/Messaging 等 API 中引用 uploadDestinationId\n```\n\n---\n\n## Scripts\n\n| 脚本 | 说明 |\n|------|------|\n| `create_upload_destination_for_resource.py` | POST `uploads/2020-11-01/uploadDestinations/{resource}` |\n| `upload_to_destination.py` | PUT 到返回的 `url`（带 `headers`） |\n| `_spapi_uploads_common.py` | 内部公共模块 |\n\n---\n\n## 示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\n# 1) 创建上传目的地（自动根据 filePath 计算 contentMD5）\npython scripts/create_upload_destination_for_resource.py '{\n  \"sellerId\":\"A1...\",\n  \"region\":\"N"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-amazon-store-uploads\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1789361958596\n}"},{"path":"references/api.md","content":"# linkfox-amazon-store-uploads — API 参考\n\nUploads **v2020-11-01**，用于在调用 A+ Content、Messaging 等 API 之前**上传二进制文件**。\n\n---\n\n## 1. createUploadDestinationForResource\n\n| 项 | 值 |\n|----|-----|\n| method | POST |\n| path | `uploads/2020-11-01/uploadDestinations/{resource}` |\n| 脚本 | `create_upload_destination_for_resource.py` |\n\n`{resource}` 是 greedy path 参数。传入未编码的下游 API 资源路径，构造网关 `path` 时须保留其中的 `/`，不得将路径分隔符预编码为 `%2F`。例如：\n\n- `aplus/2020-11-01/contentDocuments`\n- Messaging：`messaging/v1/orders/{amazonOrderId}/messages/...`（以官方为准）\n\n### Query（写入 `queryString`）\n\n| 参数 | 必填 | 说明 |\n|------|------|------|\n| marketplaceIds | 是 | 单站点 ID（脚本用 `marketplaceId` 或 `marketplaceIds[0]`） |\n| contentMD5 | 是 | 文件内容的 Base64 MD5；或由 `filePath`/`content` 自动计算 |\n| contentType | 否 | 如 `image/jpeg` |\n\n### 入参 JSON（脚本）\n\n| 字段 | 必填 |\n|------|------|\n| sellerId, region | 是 |\n| resource | 是 |\n| marketplaceId | 是 |\n| contentMD5 或 filePath/content/contentBase64 | 是（二选一组合） |\n| contentType | 建议 |\n\n### 响应解析\n\n字段 **`uploadDestination`**，通常含：\n\n- `uploadDestinationId` — 后续业务 API 引用\n- `url` — PUT 上传地址\n- `headers` — 上传时必须附带的 HTTP 头\n\n---\n\n## 2. 上传文件（非 SP-API 代理）\n\n| 脚本 | `upload_to_destination.py` |\n|------|---------------------------|\n| method | PUT |\n| URL | `uploadDestination.url` |\n| headers | `uploadDestination.headers` 全文带上 |\n\n| 字段 | 必填 |\n|------|------|\n| uploadUrl 或 uploadDestination | 是 |\n| headers（若未包在 uploadDestination 内） | 是 |\n| filePath / content / contentBase64 | 是 |\n\n**注意**：PUT 使用的字节须与申请 `contentMD5` 时一致。\n\n---\n\n## 3. contentMD5 计算\n\n与 Amazon 要求一致：对文件字节做 MD5，再 **Base64** 编码摘要：\n\n```python\nbase64.b64encode(hashlib.md5(data).digest()).decode(\"ascii\")\n```\n\n---\n\n## 4. 常见 resource 示例\n\n| 场景 | resource 示例 |\n|------|----------------|\n| A+ 内容文档 | `aplus/2020-11-01/contentDocuments` |\n| Messaging 附件 | 见 [Messaging API](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference) 各 message 操作的 resource 说明 |\n\n---\n\n## 5. 错误与白名单\n\n- **403**：Uploads 或下游角色未授权。\n- **1005**：网关需放行 `uploads/2020-11-01/`。\n- **429**：默认约 0.1 req/s（以官方为准）。\n\n---\n\n## 6. Feedback\n\n`skillName`: **`linkfox-amazon-store-uploads`**"},{"path":"references/onboarding.md","content":"# 解决认证和算力问题\n\n调用本 skill 时若网关返回 **auth** 或 **billing** 错误，走本 skill 自带的 `scripts/onboarding.py` 完成引导。\n\n**auth 场景**：`errcode=401` 或消息含 `authorized error`/`鉴权失败`/`未授权`/`unauthorized`；或 `LINKFOX_AGENT_API_KEY` 与 `LINKFOXAGENT_API_KEY` 均为空。\n1. 若已配置 key → 先让用户重启会话（最常见误判），仍失败让用户重新取 key 或换手机号重注册\n2. 未配置 → 询问：自助去 https://agent.linkfox.com/ 取 key，或提供手机号让脚本注册\n3. 手机号路径：\n   - `python scripts/onboarding.py send-code <phone>` → 展示 JSON 里的 phone/agreements\n   - 收到验证码后：`python scripts/onboarding.py login <phone> <code>`\n   - 拿到 `api_key` 后把下面三平台配置转发给用户，提示重启会话生效：\n     - Windows PowerShell（永久）：`setx LINKFOX_AGENT_API_KEY \"<key>\"`\n     - macOS zsh：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.zshrc && source ~/.zshrc`\n     - Linux bash：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.bashrc && source ~/.bashrc`\n     - 变量名 `LINKFOX_AGENT_API_KEY`（主推）或 `LINKFOXAGENT_API_KEY`（老规范）任一即可\n\n**billing 场景**：`errcode=402` 或消息含 `算力/余额/quota/insufficient/充值/套餐到期`。\n- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单，否则输出编号清单让用户选\n- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`（通常 `wechat/alipay`）\n- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG > `pay_url` > `ascii_qr`（标注兜底）\n- 已付款可选调 `python scripts/onboarding.py query <order_id>`，不主动轮询\n\n排除 `errcode=403`（无权限，不归入这两类）。所有子命令输出 stdout JSON，`error` 字段已含阶段前缀，透传给用户即可。完整用法：`python scripts/onboarding.py --help`。"},{"path":"skill-card.md","content":"## Description:\n\nThis third-party skill helps agents create Amazon SP-API upload destinations, compute contentMD5 values, and upload images or attachments to returned presigned URLs for A+ Content, Messaging, and related workflows.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal developers and Amazon store operators use this skill to prepare upload resources for Amazon SP-API workflows, especially A+ Content and Messaging attachments. It can guide API-key setup, create upload destinations through LinkFox, compute file digests, upload local file content to returned URLs, and preserve JSON results for later inspection.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can read local files and upload their bytes to a returned upload URL.\n\nMitigation: Confirm the selected file is intended for the Amazon workflow and verify that upload URLs come from Amazon or LinkFox before running upload commands.\n\nRisk: The skill uses LinkFox API credentials and may expose sensitive values through environment variables, logs, transcripts, or shell history.\n\nMitigation: Run with trusted environment variables, avoid sharing command transcripts containing credentials, and rotate any API key that appears in logs or history.\n\nRisk: The onboarding flow can guide phone/SMS account setup and initiate payment-order flows.\n\nMitigation: Use onboarding only for explicit authentication or billing recovery, and confirm account, plan, payment method, and order details before proceeding.\n\nRisk: The skill persists complete API responses locally, which may include operational or account-related data.\n\nMitigation: Review saved JSON files before sharing them and remove session data that is no longer needed.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-uploads)\n- [API reference](references/api.md)\n- [Onboarding reference](references/onboarding.md)\n- [Amazon createUploadDestinationForResource reference](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource)\n- [Amazon Create an upload destination guide](https://developer-docs.amazon.com/sp-api/docs/create-an-upload-destination)\n- [Amazon Messaging API reference](https://developer-docs.amazon.com/sp-api/docs/messaging-api-v1-reference)\n\n## Skill Output:\n\n**Output Type(s):** [JSON, Files, Shell commands, Configuration guidance, API calls]\n\n**Output Format:** [Markdown guidance with shell commands, JSON stdout, and persisted JSON response files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Writes complete responses under a linkfox session data directory and may print summaries for larger responses.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their envi"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"亚马逊 SP-API 通用文件上传。用于为 A+ Content、Messaging 等业务创建 upload destination，计算 contentMD5，并将图片或附件上传到返回的预签名地址。用户提到亚马逊文件上传、A+ 图片上传、Messaging 附件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、Uploads API、SP-API 上传文件时触发。即使未明确说“Uploads API”，只要其他亚马逊 SP-API 操作需要先获得可引用的上传资源地址，也应触发此技能；Feed 文档上传使用 linkfox-amazon-store-feeds 的专用流程。 Skill: 亚马逊-店铺上传 Owner: linkfox-ai Summary: 亚马逊 SP-API 通用文件上传。用于为 A+ Content、Messaging 等业务创建 upload destination，计算 contentMD5，并将图片或附件上传到返回的预签名地址。用户提到亚马逊文件上传、A+ 图片上传、Messaging 附件、createUploadDestinationForResource、upload destination、contentMD5、预签名上传、Uploads API、SP-API 上传文件时触发。即使未明确说“Uploads API”，只要其他亚马逊 SP-API 操作需要先获得可引用的上传资源地址，也应触发此技能；Feed 文档上传使用 linkfox-amazon-store-feeds 的专用流程。 Tags: latest:1.0.8 Version history: v1","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1077,"uniquenessScore":48,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T10:15:16.341Z","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-10T10:15:16.341Z","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-10T13:31:13.144Z","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"}]}}}