api-config.json 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. {
  2. "name": "brand-context-builder",
  3. "displayName": "品牌上下文建档",
  4. "description": "VOC工作坊品牌建档技能,通过结构化问答采集客户品牌信息,验证格式,生成并持久化品牌上下文文件供后续分析技能引用。",
  5. "category": "workshop",
  6. "version": "1.0.0",
  7. "type": "conversational",
  8. "parameters": {
  9. "type": "object",
  10. "required": [],
  11. "properties": {
  12. "mode": {
  13. "type": "string",
  14. "description": "建档模式: full=完整建档(默认), update=增量更新",
  15. "enum": [
  16. "full",
  17. "update"
  18. ],
  19. "default": "full"
  20. },
  21. "brandName": {
  22. "type": "string",
  23. "description": "品牌英文名称"
  24. },
  25. "categoryKeywords": {
  26. "type": "array",
  27. "items": {
  28. "type": "string"
  29. },
  30. "description": "品类核心英文关键词,至少1个,建议2-3个"
  31. },
  32. "amazonDomain": {
  33. "type": "integer",
  34. "description": "Amazon站点: 1=US(默认) 2=UK 3=DE 4=JP",
  35. "default": 1,
  36. "enum": [
  37. 1,
  38. 2,
  39. 3,
  40. 4
  41. ]
  42. },
  43. "brandAsins": {
  44. "type": "array",
  45. "items": {
  46. "type": "string",
  47. "pattern": "^B0[A-Z0-9]{8}$"
  48. },
  49. "description": "品牌代表性ASIN列表,3-5个,B0开头10位"
  50. },
  51. "knownCompetitors": {
  52. "type": "array",
  53. "items": {
  54. "type": "string"
  55. },
  56. "description": "已知竞品品牌名(可选)"
  57. },
  58. "competitorAsins": {
  59. "type": "array",
  60. "items": {
  61. "type": "string"
  62. },
  63. "description": "已知竞品ASIN(可选)"
  64. },
  65. "tiktokKeywords": {
  66. "type": "array",
  67. "items": {
  68. "type": "string"
  69. },
  70. "description": "TikTok搜索关键词(可选,Session 4补充)"
  71. },
  72. "douyinKeywords": {
  73. "type": "array",
  74. "items": {
  75. "type": "string"
  76. },
  77. "description": "抖音搜索关键词(可选,Session 4补充)"
  78. },
  79. "workshopGoal": {
  80. "type": "string",
  81. "description": "客户希望通过分析解决的核心问题"
  82. }
  83. }
  84. },
  85. "validation": {
  86. "asinFormat": {
  87. "pattern": "^B0[A-Z0-9]{8}$",
  88. "errorMessage": "ASIN格式不正确,应为B0开头的10位字母数字组合,如 B0CJ5K1234"
  89. },
  90. "domainMapping": {
  91. "1": "amazon.com",
  92. "2": "amazon.co.uk",
  93. "3": "amazon.de",
  94. "4": "amazon.co.jp"
  95. }
  96. },
  97. "output": {
  98. "type": "object",
  99. "description": "品牌上下文对象,写入 memory/brand-context.json",
  100. "properties": {
  101. "success": {
  102. "type": "boolean"
  103. },
  104. "brandContext": {
  105. "type": "object"
  106. },
  107. "readyForSession1": {
  108. "type": "boolean"
  109. },
  110. "missingFields": {
  111. "type": "array"
  112. }
  113. }
  114. },
  115. "memoryFiles": {
  116. "write": [
  117. "memory/brand-context.json",
  118. "memory/workshop-progress.json",
  119. "memory/calibration-notes.json"
  120. ],
  121. "read": []
  122. },
  123. "usageExamples": [
  124. {
  125. "name": "完整建档",
  126. "input": {
  127. "mode": "full",
  128. "brandName": "COCORRINA",
  129. "categoryKeywords": [
  130. "reed diffuser",
  131. "aroma diffuser"
  132. ],
  133. "amazonDomain": 1,
  134. "brandAsins": [
  135. "B0CJ5KXXXX",
  136. "B0DJ6LYYYY",
  137. "B0EK7MZZZZ"
  138. ],
  139. "workshopGoal": "想了解品类机会和用户真正在意什么"
  140. },
  141. "description": "新客户首次建档,采集全部必要信息"
  142. },
  143. {
  144. "name": "增量更新-补充竞品",
  145. "input": {
  146. "mode": "update",
  147. "knownCompetitors": [
  148. "NEST New York",
  149. "Yankee Candle"
  150. ],
  151. "competitorAsins": [
  152. "B0AAAA1111",
  153. "B0BBBB2222"
  154. ]
  155. },
  156. "description": "Session 2 后补充确认的竞品信息"
  157. },
  158. {
  159. "name": "增量更新-补充社媒关键词",
  160. "input": {
  161. "mode": "update",
  162. "tiktokKeywords": [
  163. "reed diffuser",
  164. "#homedecor"
  165. ],
  166. "douyinKeywords": [
  167. "香薰",
  168. "无火香薰"
  169. ]
  170. },
  171. "description": "Session 4 前补充社媒搜索关键词"
  172. }
  173. ],
  174. "reportMapping": {
  175. "brandName": "品牌名称",
  176. "categoryKeywords": "品类关键词",
  177. "amazonDomain": "Amazon站点",
  178. "brandAsins": "品牌ASIN",
  179. "workshopGoal": "分析目标",
  180. "completeness": "建档完整度"
  181. },
  182. "tokenConfig": {
  183. "type": "bearer",
  184. "configFile": "~/.openclaw/voc-credentials.json",
  185. "tokenField": "vocToken",
  186. "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
  187. "resolutionOrder": [
  188. "configFile",
  189. "currentToken"
  190. ],
  191. "apigId": "Vo3ROWEvDy",
  192. "paymentUrlResolution": {
  193. "description": "动态构建充值URL:通过当前token查出用户objectId,拼接到充值页面",
  194. "steps": [
  195. "1. 从 voc-credentials.json 或 currentToken 获取当前 session token",
  196. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  197. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  198. "4. 将该URL展示给用户,引导扫码支付"
  199. ],
  200. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  201. "userResolveHeaders": {
  202. "X-Parse-Application-Id": "ncloudmaster",
  203. "X-Parse-Session-Token": "{vocToken}"
  204. },
  205. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  206. "paymentParams": {
  207. "user": "{resolvedUserId}",
  208. "apigid": "Vo3ROWEvDy",
  209. "fun_id": "HOkkX72PMF"
  210. },
  211. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  212. },
  213. "onMissing": {
  214. "action": "resolveUserThenShowPayment",
  215. "title": "扫码开通 VOC-AI 数据服务",
  216. "message": "此 Skill 需要有效的 API Token。请按以下步骤操作:\n1. 如果你已有 Token,请告诉我,我会保存到 ~/.openclaw/voc-credentials.json\n2. 如果没有 Token,我会引导你扫码充值开通"
  217. },
  218. "onBalanceInsufficient": {
  219. "action": "resolveUserThenShowPayment",
  220. "title": "VOC-AI Token 余额不足,请扫码充值",
  221. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  222. }
  223. },
  224. "errorHandling": {
  225. "balanceInsufficient": {
  226. "conditions": [
  227. {
  228. "responseField": "code",
  229. "operator": "in",
  230. "value": [
  231. -2,
  232. -3,
  233. -10,
  234. 402,
  235. 429
  236. ]
  237. },
  238. {
  239. "responseField": "msg",
  240. "operator": "contains",
  241. "value": [
  242. "余额不足",
  243. "insufficient",
  244. "balance",
  245. "quota"
  246. ]
  247. },
  248. {
  249. "responseField": "message",
  250. "operator": "contains",
  251. "value": [
  252. "余额不足",
  253. "insufficient",
  254. "balance"
  255. ]
  256. }
  257. ],
  258. "matchMode": "any",
  259. "trigger": "tokenConfig.onBalanceInsufficient"
  260. },
  261. "unauthorized": {
  262. "conditions": [
  263. {
  264. "responseField": "code",
  265. "operator": "in",
  266. "value": [
  267. 401,
  268. 403
  269. ]
  270. },
  271. {
  272. "responseField": "msg",
  273. "operator": "contains",
  274. "value": [
  275. "unauthorized",
  276. "token",
  277. "invalid",
  278. "auth"
  279. ]
  280. }
  281. ],
  282. "matchMode": "any",
  283. "trigger": "tokenConfig.onMissing"
  284. }
  285. }
  286. }