@scorehub/creator-outreach 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +68 -0
- package/README.md +38 -18
- package/agents/tiktok-creator-outreach.md +4 -1
- package/install.js +110 -88
- package/package.json +9 -2
- package/skills/tiktok-batch-outreach/SKILL.md +3 -0
- package/skills/tiktok-creator-analysis/SKILL.md +3 -0
- package/skills/tiktok-creator-search/SKILL.md +3 -0
package/README.en.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @scorehub/creator-outreach
|
|
2
|
+
|
|
3
|
+
Chinese version: [README.md](./README.md)
|
|
4
|
+
|
|
5
|
+
**Tiky** is a creator outreach AI agent for TikTok Shop sellers. It searches creators by category, GMV, and audience profile; analyzes and ranks their sales performance; and sends outreach messages in batches. By default, TikTok operations run through ScoreHub MCP.
|
|
6
|
+
|
|
7
|
+
## Supported Clients
|
|
8
|
+
|
|
9
|
+
- Claude Code
|
|
10
|
+
- WorkBuddy
|
|
11
|
+
|
|
12
|
+
Claude Desktop is not currently supported by this installer.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
### Prerequisites
|
|
17
|
+
|
|
18
|
+
- Node.js 18 or later
|
|
19
|
+
- npm and network access to the npm registry
|
|
20
|
+
- Claude Code or WorkBuddy installed and launched at least once
|
|
21
|
+
|
|
22
|
+
Run:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx -y @scorehub/creator-outreach
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The installer configures only clients it detects. If it finds neither Claude Code nor WorkBuddy, it exits without writing configuration files.
|
|
29
|
+
|
|
30
|
+
| Client | Detection | Installed content | How to use |
|
|
31
|
+
|---|---|---|---|
|
|
32
|
+
| Claude Code | `~/.claude/` exists | Agent definition in `~/.claude/agents/`; MCP configuration merged into `~/.claude.json` | Restart, then enter `@tiktok-creator-outreach` |
|
|
33
|
+
| WorkBuddy | `~/.workbuddy/` exists | Plugin files in `~/.workbuddy/plugins/.../`; MCP configuration merged into `~/.workbuddy/mcp.json` | Restart, then select “Tiky — TikTok Creator Outreach” from the Agent list |
|
|
34
|
+
|
|
35
|
+
The MCP server (`@scorehub/mcp-server`) is downloaded automatically by the configured `npx -y` command the first time it starts. A global installation is not required. WorkBuddy uses its bundled Node.js and the installer handles Windows `npx.cmd` and PATH separators.
|
|
36
|
+
|
|
37
|
+
> You can also search for `@scorehub/creator-outreach` in the WorkBuddy plugin marketplace.
|
|
38
|
+
|
|
39
|
+
## First Use and Authorization
|
|
40
|
+
|
|
41
|
+
When Tiky first calls a TikTok tool, it opens a browser for ScoreHub login. Tokens are then cached under `~/.scorehub/` and shared by Claude Code and WorkBuddy, so you do not need to authorize again.
|
|
42
|
+
|
|
43
|
+
If Tiky says that the current shop's TikTok authorization is invalid or unavailable, your local ScoreHub login is usually still valid. Rebind the shop in ScoreHub and try again; do not repeat browser login.
|
|
44
|
+
|
|
45
|
+
If a request is rate limited or quota limited, wait, retry in smaller batches, or narrow the operation. Reauthorization does not resolve rate limits.
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
Ask Tiky:
|
|
50
|
+
|
|
51
|
+
- Find TikTok creators in the beauty category with GMV between $1,000 and $10,000.
|
|
52
|
+
- Analyze the sales performance of these 10 creators and rank them.
|
|
53
|
+
- Send outreach messages to these 50 creators using my collaboration template.
|
|
54
|
+
|
|
55
|
+
## Troubleshooting
|
|
56
|
+
|
|
57
|
+
### No supported client found
|
|
58
|
+
|
|
59
|
+
Install and launch Claude Code or WorkBuddy once, then run the install command again. Claude Desktop is outside the current support scope.
|
|
60
|
+
|
|
61
|
+
### MCP tools are unavailable, the tool list is empty, or the connection closes
|
|
62
|
+
|
|
63
|
+
This usually means that the local MCP process has not started, not that login, shop authorization, or rate limiting failed. Verify Node.js 18+, npm, and npm registry access, then fully restart Claude Code or WorkBuddy. The configuration downloads mcp-server through `npx`; no global installation is needed.
|
|
64
|
+
|
|
65
|
+
## Related Links
|
|
66
|
+
|
|
67
|
+
- MCP Server: [@scorehub/mcp-server](https://www.npmjs.com/package/@scorehub/mcp-server)
|
|
68
|
+
- Repository: [ScoreHub-AI/creator-outreach](https://github.com/ScoreHub-AI/creator-outreach)
|
package/README.md
CHANGED
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
# @scorehub/creator-outreach
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English version: [README.en.md](./README.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Tiky** 是面向 TikTok Shop 卖家的达人建联 AI 智能体。它可按类目、GMV 和粉丝画像搜索达人,分析带货表现并排名,以及批量发送合作消息。默认情况下,TikTok 操作通过 ScoreHub MCP 完成。
|
|
6
|
+
|
|
7
|
+
## 支持的客户端
|
|
8
|
+
|
|
9
|
+
- Claude Code
|
|
10
|
+
- WorkBuddy
|
|
11
|
+
|
|
12
|
+
Claude Desktop 当前不受此安装器支持。
|
|
6
13
|
|
|
7
14
|
## 安装
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
npx @scorehub/creator-outreach
|
|
11
|
-
```
|
|
16
|
+
### 前置条件
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
- Node.js 18 或更高版本
|
|
19
|
+
- npm 和可访问 npm registry 的网络
|
|
20
|
+
- 已安装并至少启动过 Claude Code 或 WorkBuddy
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
|--------|----------|
|
|
17
|
-
| **Claude Code / Claude Desktop** | Agent 定义 → `~/.claude/agents/`;MCP 配置 → `~/.claude.json` |
|
|
18
|
-
| **WorkBuddy**(检测到 `~/.workbuddy/` 时) | 插件文件 → `~/.workbuddy/plugins/.../`;MCP 配置 → `~/.workbuddy/mcp.json` |
|
|
22
|
+
运行:
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
```bash
|
|
25
|
+
npx -y @scorehub/creator-outreach
|
|
26
|
+
```
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
安装器只会配置已检测到的客户端;未检测到 Claude Code 或 WorkBuddy 时,会退出且不写入任何配置文件。
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
| 客户端 | 检测条件 | 安装内容 | 使用方式 |
|
|
31
|
+
|---|---|---|---|
|
|
32
|
+
| Claude Code | `~/.claude/` 存在 | Agent 定义写入 `~/.claude/agents/`;MCP 配置合并到 `~/.claude.json` | 重启后输入 `@tiktok-creator-outreach` |
|
|
33
|
+
| WorkBuddy | `~/.workbuddy/` 存在 | 插件文件写入 `~/.workbuddy/plugins/.../`;MCP 配置合并到 `~/.workbuddy/mcp.json` | 重启后在 Agent 列表选择 “Tiky — TikTok Creator Outreach” |
|
|
34
|
+
|
|
35
|
+
MCP Server(`@scorehub/mcp-server`)由配置中的 `npx -y` 在首次启动时自动拉取,无需全局安装。WorkBuddy 会使用其捆绑的 Node.js,并自动适配 Windows 的 `npx.cmd` 与 PATH 分隔符。
|
|
26
36
|
|
|
27
37
|
> 也可在 WorkBuddy 插件市场直接搜索 `@scorehub/creator-outreach` 安装。
|
|
28
38
|
|
|
29
|
-
##
|
|
39
|
+
## 首次使用与授权
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
首次调用 TikTok 工具时,Tiky 会打开浏览器引导你登录 ScoreHub。登录后 Token 缓存在 `~/.scorehub/`,Claude Code 与 WorkBuddy 共享,无需重复授权。
|
|
32
42
|
|
|
33
|
-
|
|
43
|
+
如果提示当前店铺的 TikTok 授权已失效或异常,本地 ScoreHub 登录通常仍然有效。请先到 ScoreHub 重新绑定店铺,再重试;不要反复进行浏览器登录。
|
|
34
44
|
|
|
35
|
-
|
|
45
|
+
如果提示请求过于频繁或配额受限,请等待、分批重试或缩小操作范围。限流不需要重新登录。
|
|
36
46
|
|
|
37
47
|
## 快速开始
|
|
38
48
|
|
|
@@ -42,6 +52,16 @@ Tiky 首次调用 TikTok 工具时会自动打开浏览器引导登录 ScoreHub
|
|
|
42
52
|
- 分析这 10 个达人的带货表现,帮我打分排名
|
|
43
53
|
- 用我的建联话术模板,给这 50 个达人批量发送合作消息
|
|
44
54
|
|
|
55
|
+
## 故障排查
|
|
56
|
+
|
|
57
|
+
### 找不到受支持的客户端
|
|
58
|
+
|
|
59
|
+
先安装并启动 Claude Code 或 WorkBuddy 一次,再重新运行安装命令。Claude Desktop 不在当前支持范围内。
|
|
60
|
+
|
|
61
|
+
### MCP 工具不可用、工具列表为空或连接已关闭
|
|
62
|
+
|
|
63
|
+
通常是本地 MCP 进程尚未启动,不是登录、店铺授权或限流问题。确认 Node.js 18+、npm 和 npm registry 网络可用,然后完全重启 Claude Code 或 WorkBuddy 后重试。配置会通过 `npx` 自动下载 mcp-server,无需全局安装。
|
|
64
|
+
|
|
45
65
|
## 相关链接
|
|
46
66
|
|
|
47
67
|
- MCP Server:[@scorehub/mcp-server](https://www.npmjs.com/package/@scorehub/mcp-server)
|
|
@@ -111,7 +111,9 @@ Step 3: 批量建联
|
|
|
111
111
|
- `authorize` — OAuth 授权
|
|
112
112
|
- `status` — 连接状态
|
|
113
113
|
|
|
114
|
-
如果尚未授权,我会先引导你走 `authorize` 完成 OAuth
|
|
114
|
+
如果尚未授权,我会先引导你走 `authorize` 完成 OAuth 登录。
|
|
115
|
+
|
|
116
|
+
如果 ScoreHub MCP 工具不可见、工具列表为空、连接已关闭或本地 MCP 未启动,我会先判断为本地 MCP 可用性问题,而不是 OAuth、店铺授权或限流问题。我会提示你确认 Node.js 18+ 与 npm 可用、网络可访问 npm registry,并完全重启 Claude Code 或 WorkBuddy 后重试。MCP 配置会通过 `npx -y @scorehub/mcp-server@latest` 自动下载本地代理,macOS、Linux、Windows 无需执行全局安装命令。只有 MCP 已确认不可用且环境变量 TikTok API 凭证已经配置时,才降级直接调用 API。
|
|
115
117
|
|
|
116
118
|
如果本地登录状态正常,但真实工具调用提示当前店铺的 TikTok 授权已失效或异常,我会直接提醒你去 ScoreHub 重新绑定该店铺后再试,不会再让你重复浏览器登录。
|
|
117
119
|
|
|
@@ -119,6 +121,7 @@ Step 3: 批量建联
|
|
|
119
121
|
|
|
120
122
|
如果工具返回结构化错误类型,我会按以下顺序处理:
|
|
121
123
|
|
|
124
|
+
- 本地 MCP 不可用 → 提示检查 Node.js 18+、npm、npm registry 网络并重启客户端;不调用 `authorize`
|
|
122
125
|
- `oauth_invalid` → 允许建议 `authorize`
|
|
123
126
|
- `shop_auth_invalid` → 提示去 ScoreHub 重新绑定店铺
|
|
124
127
|
- `rate_limited` / `quota_exhausted` → 只提示等待、分批或缩量
|
package/install.js
CHANGED
|
@@ -6,24 +6,8 @@ const os = require('os');
|
|
|
6
6
|
const { execSync } = require('child_process');
|
|
7
7
|
|
|
8
8
|
const pkg = require('./package.json');
|
|
9
|
-
|
|
9
|
+
const MIN_NODE_MAJOR = 18;
|
|
10
10
|
|
|
11
|
-
// === Claude Code 路径 ===
|
|
12
|
-
const CLAUDE_DIR = path.join(os.homedir(), '.claude');
|
|
13
|
-
const AGENTS_DIR = path.join(CLAUDE_DIR, 'agents');
|
|
14
|
-
const CLAUDE_JSON = path.join(os.homedir(), '.claude.json');
|
|
15
|
-
|
|
16
|
-
const AGENT_SRC = path.join(__dirname, 'agents', 'tiktok-creator-outreach.md');
|
|
17
|
-
const AGENT_DEST = path.join(AGENTS_DIR, 'tiktok-creator-outreach.md');
|
|
18
|
-
|
|
19
|
-
// === WorkBuddy 路径 ===
|
|
20
|
-
const WORKBUDDY_DIR = path.join(os.homedir(), '.workbuddy');
|
|
21
|
-
const WORKBUDDY_PLUGIN_DIR = path.join(
|
|
22
|
-
WORKBUDDY_DIR, 'plugins', 'marketplaces', 'my-experts', 'plugins', 'tiktok-creator-outreach',
|
|
23
|
-
);
|
|
24
|
-
const WORKBUDDY_MCP_JSON = path.join(WORKBUDDY_DIR, 'mcp.json');
|
|
25
|
-
|
|
26
|
-
// === 共享 MCP 配置 ===
|
|
27
11
|
const MCP_CONFIG = {
|
|
28
12
|
type: 'stdio',
|
|
29
13
|
command: 'npx',
|
|
@@ -33,27 +17,49 @@ const MCP_CONFIG = {
|
|
|
33
17
|
},
|
|
34
18
|
};
|
|
35
19
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
20
|
+
function getNodeMajorVersion(nodeVersion = process.versions.node) {
|
|
21
|
+
return Number.parseInt(nodeVersion.split('.')[0], 10);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function isSupportedNode(nodeVersion = process.versions.node) {
|
|
25
|
+
return getNodeMajorVersion(nodeVersion) >= MIN_NODE_MAJOR;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getPaths(homeDir) {
|
|
29
|
+
const claudeDir = path.join(homeDir, '.claude');
|
|
30
|
+
const workBuddyDir = path.join(homeDir, '.workbuddy');
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
claudeDir,
|
|
34
|
+
agentsDir: path.join(claudeDir, 'agents'),
|
|
35
|
+
claudeJson: path.join(homeDir, '.claude.json'),
|
|
36
|
+
workBuddyDir,
|
|
37
|
+
workBuddyPluginDir: path.join(
|
|
38
|
+
workBuddyDir, 'plugins', 'marketplaces', 'my-experts', 'plugins', 'tiktok-creator-outreach',
|
|
39
|
+
),
|
|
40
|
+
workBuddyMcpJson: path.join(workBuddyDir, 'mcp.json'),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function resolveWorkBuddyNode(workBuddyDir) {
|
|
45
|
+
const versionsDir = path.join(workBuddyDir, 'binaries', 'node', 'versions');
|
|
46
|
+
const npxExecutable = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
41
47
|
try {
|
|
42
48
|
const versions = fs.readdirSync(versionsDir);
|
|
43
49
|
if (versions.length > 0) {
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
|
|
50
|
+
const versionDir = path.join(versionsDir, versions[0]);
|
|
51
|
+
const binDirs = [path.join(versionDir, 'bin'), versionDir];
|
|
52
|
+
for (const binDir of binDirs) {
|
|
53
|
+
const npxPath = path.join(binDir, npxExecutable);
|
|
54
|
+
if (fs.existsSync(npxPath)) return { npx: npxPath, binDir };
|
|
55
|
+
}
|
|
47
56
|
}
|
|
48
57
|
} catch {
|
|
49
|
-
//
|
|
58
|
+
// WorkBuddy or its bundled Node.js is not available at this path.
|
|
50
59
|
}
|
|
51
60
|
return { npx: 'npx', binDir: null };
|
|
52
61
|
}
|
|
53
62
|
|
|
54
|
-
// 工具函数:查询 mcp-server 在 npm registry 的当前最新版本
|
|
55
|
-
// 注意:这是 install 此刻的最新版;实际 MCP 拉起时由 npx 现场解析 @latest,
|
|
56
|
-
// 若之后 registry 更新,运行时版本可能与此不同。失败时静默返回 null(不阻断安装)。
|
|
57
63
|
function fetchLatestMcpServerVersion() {
|
|
58
64
|
try {
|
|
59
65
|
const out = execSync('npm view @scorehub/mcp-server version', {
|
|
@@ -67,91 +73,107 @@ function fetchLatestMcpServerVersion() {
|
|
|
67
73
|
}
|
|
68
74
|
}
|
|
69
75
|
|
|
70
|
-
// 工具函数:合并 MCP Server 配置到 JSON 文件
|
|
71
76
|
function mergeMcpConfig(configPath, serverName, serverConfig, extraFields) {
|
|
72
77
|
let config = {};
|
|
73
78
|
if (fs.existsSync(configPath)) {
|
|
74
79
|
try {
|
|
75
80
|
config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
76
81
|
} catch {
|
|
77
|
-
console.warn(
|
|
82
|
+
console.warn(`Warning: ${configPath} could not be parsed and will be replaced.`);
|
|
78
83
|
}
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
config.mcpServers = config.mcpServers || {};
|
|
82
87
|
config.mcpServers[serverName] = Object.assign({}, serverConfig, extraFields);
|
|
83
|
-
|
|
84
88
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n');
|
|
85
89
|
}
|
|
86
90
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
console.log(
|
|
91
|
+
function install({
|
|
92
|
+
homeDir = os.homedir(),
|
|
93
|
+
nodeVersion = process.versions.node,
|
|
94
|
+
getLatestMcpServerVersion = fetchLatestMcpServerVersion,
|
|
95
|
+
} = {}) {
|
|
96
|
+
console.log(`${pkg.name} v${pkg.version}\n`);
|
|
93
97
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// ========== WorkBuddy ==========
|
|
99
|
-
|
|
100
|
-
const hasWorkBuddy = fs.existsSync(WORKBUDDY_DIR);
|
|
98
|
+
if (!isSupportedNode(nodeVersion)) {
|
|
99
|
+
console.error(`Node.js ${MIN_NODE_MAJOR}+ is required. Detected ${nodeVersion}. No configuration files were changed.`);
|
|
100
|
+
return 1;
|
|
101
|
+
}
|
|
101
102
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
const pluginFiles = ['package.json', 'README.md'];
|
|
103
|
+
const paths = getPaths(homeDir);
|
|
104
|
+
const hasClaudeCode = fs.existsSync(paths.claudeDir);
|
|
105
|
+
const hasWorkBuddy = fs.existsSync(paths.workBuddyDir);
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
if (!hasClaudeCode && !hasWorkBuddy) {
|
|
108
|
+
console.error('No supported client was found. Launch Claude Code or WorkBuddy once, then run this command again. No configuration files were changed.');
|
|
109
|
+
return 1;
|
|
110
|
+
}
|
|
108
111
|
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
112
|
+
if (hasClaudeCode) {
|
|
113
|
+
const agentSource = path.join(__dirname, 'agents', 'tiktok-creator-outreach.md');
|
|
114
|
+
const agentDestination = path.join(paths.agentsDir, 'tiktok-creator-outreach.md');
|
|
115
|
+
fs.mkdirSync(paths.agentsDir, { recursive: true });
|
|
116
|
+
fs.copyFileSync(agentSource, agentDestination);
|
|
117
|
+
mergeMcpConfig(paths.claudeJson, 'scorehub', MCP_CONFIG, {});
|
|
118
|
+
console.log(`Claude Code: Agent installed at ${agentDestination}`);
|
|
119
|
+
console.log(`Claude Code: MCP server configured at ${paths.claudeJson}`);
|
|
115
120
|
}
|
|
116
121
|
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
if (hasWorkBuddy) {
|
|
123
|
+
const pluginDirs = ['.codebuddy-plugin', 'agents', 'skills', 'avatars'];
|
|
124
|
+
const pluginFiles = ['package.json', 'README.md', 'README.en.md'];
|
|
125
|
+
|
|
126
|
+
fs.mkdirSync(paths.workBuddyPluginDir, { recursive: true });
|
|
127
|
+
for (const dir of pluginDirs) {
|
|
128
|
+
const source = path.join(__dirname, dir);
|
|
129
|
+
const destination = path.join(paths.workBuddyPluginDir, dir);
|
|
130
|
+
if (fs.existsSync(source)) {
|
|
131
|
+
fs.cpSync(source, destination, { recursive: true });
|
|
132
|
+
}
|
|
122
133
|
}
|
|
123
|
-
}
|
|
124
134
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const { type: _, ...baseMCPConfig } = MCP_CONFIG;
|
|
133
|
-
const wbEnv = binDir
|
|
134
|
-
? Object.assign({}, MCP_CONFIG.env, { PATH: `${binDir}:/usr/local/bin:/usr/bin:/bin` })
|
|
135
|
-
: MCP_CONFIG.env;
|
|
136
|
-
const wbMCPConfig = Object.assign({}, baseMCPConfig, { command: npx, env: wbEnv });
|
|
137
|
-
mergeMcpConfig(WORKBUDDY_MCP_JSON, 'scorehub', wbMCPConfig, { disabled: false });
|
|
138
|
-
console.log(`✓ WorkBuddy: MCP Server 已配置 → ${WORKBUDDY_MCP_JSON}`);
|
|
139
|
-
}
|
|
135
|
+
for (const file of pluginFiles) {
|
|
136
|
+
const source = path.join(__dirname, file);
|
|
137
|
+
const destination = path.join(paths.workBuddyPluginDir, file);
|
|
138
|
+
if (fs.existsSync(source)) {
|
|
139
|
+
fs.copyFileSync(source, destination);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
140
142
|
|
|
141
|
-
|
|
143
|
+
const { npx, binDir } = resolveWorkBuddyNode(paths.workBuddyDir);
|
|
144
|
+
const { type: _, ...baseMcpConfig } = MCP_CONFIG;
|
|
145
|
+
const existingPath = process.env.PATH || process.env.Path || '';
|
|
146
|
+
const env = binDir
|
|
147
|
+
? Object.assign({}, MCP_CONFIG.env, { PATH: [binDir, existingPath].filter(Boolean).join(path.delimiter) })
|
|
148
|
+
: MCP_CONFIG.env;
|
|
149
|
+
const workBuddyMcpConfig = Object.assign({}, baseMcpConfig, { command: npx, env });
|
|
150
|
+
mergeMcpConfig(paths.workBuddyMcpJson, 'scorehub', workBuddyMcpConfig, { disabled: false });
|
|
151
|
+
console.log(`WorkBuddy: Plugin installed at ${paths.workBuddyPluginDir}`);
|
|
152
|
+
console.log(`WorkBuddy: MCP server configured at ${paths.workBuddyMcpJson}`);
|
|
153
|
+
}
|
|
142
154
|
|
|
143
|
-
const
|
|
144
|
-
if (
|
|
155
|
+
const mcpServerVersion = getLatestMcpServerVersion();
|
|
156
|
+
if (mcpServerVersion) {
|
|
157
|
+
console.log(`\nmcp-server latest version: v${mcpServerVersion} (npx resolves @latest again when it starts).`);
|
|
158
|
+
} else {
|
|
159
|
+
console.log('\nmcp-server: @latest (the current version could not be queried).');
|
|
160
|
+
}
|
|
145
161
|
|
|
146
|
-
const
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
162
|
+
const platforms = [];
|
|
163
|
+
if (hasClaudeCode) platforms.push('Claude Code');
|
|
164
|
+
if (hasWorkBuddy) platforms.push('WorkBuddy');
|
|
165
|
+
console.log(`\nInstallation complete. Restart ${platforms.join(' / ')} and use Tiky.`);
|
|
166
|
+
return 0;
|
|
151
167
|
}
|
|
152
168
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
console.log('提示:未检测到 WorkBuddy,仅安装了 Claude Code。如需 WorkBuddy 支持请先安装 WorkBuddy 后重新运行本命令。');
|
|
169
|
+
if (require.main === module) {
|
|
170
|
+
process.exitCode = install();
|
|
156
171
|
}
|
|
157
172
|
|
|
173
|
+
module.exports = {
|
|
174
|
+
MIN_NODE_MAJOR,
|
|
175
|
+
getNodeMajorVersion,
|
|
176
|
+
getPaths,
|
|
177
|
+
install,
|
|
178
|
+
isSupportedNode,
|
|
179
|
+
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scorehub/creator-outreach",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "ScoreHub Tiky 智能体 — Agent 定义 + Skills 配置",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=18"
|
|
7
|
+
},
|
|
5
8
|
"files": [
|
|
6
9
|
".codebuddy-plugin",
|
|
7
10
|
"agents",
|
|
8
11
|
"skills",
|
|
9
12
|
"avatars",
|
|
10
|
-
"install.js"
|
|
13
|
+
"install.js",
|
|
14
|
+
"README.en.md"
|
|
11
15
|
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "node --test test/install.test.js"
|
|
18
|
+
},
|
|
12
19
|
"bin": {
|
|
13
20
|
"creator-outreach": "./install.js"
|
|
14
21
|
},
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
1. **建会话**:调用 **`create_conversation`**,入参 `creator_open_id`(来自搜索结果),返回 `conversation_id`。
|
|
25
25
|
2. **发消息**:调用 **`send_message`**,入参 `conversation_id` + `msg_type: "TEXT"` + `content`(模板填充后的文本)。
|
|
26
26
|
|
|
27
|
+
如果 ScoreHub MCP 工具不可见、工具列表为空、连接已关闭或本地 MCP 未启动,判定为本地 MCP 可用性问题。提示用户确认 Node.js 18+ 与 npm 可用、网络可访问 npm registry,并完全重启 Claude Code 或 WorkBuddy 后重试;配置中的 `npx -y @scorehub/mcp-server@latest` 会自动下载 mcp-server,macOS、Linux、Windows 都不需要全局安装。不要将此类错误当作 OAuth、店铺授权或限流问题,也不要调用 `authorize`。
|
|
28
|
+
|
|
27
29
|
如果工具返回结构化 JSON,优先按 `error_type` 做分流,不要靠自然语言错误文本猜测。
|
|
28
30
|
|
|
29
31
|
如果本地登录状态正常,但工具提示当前店铺的 TikTok 授权失效或异常,直接提醒用户去 ScoreHub 重新绑定该店铺后再试;不要展示错误码,也不要要求用户重复执行 `authorize`。
|
|
@@ -58,6 +60,7 @@ POST /affiliate_seller/202412/conversations/{id}/messages Body: {"msg_type":"T
|
|
|
58
60
|
|
|
59
61
|
| 问题类型 | 处理 |
|
|
60
62
|
|----------|------|
|
|
63
|
+
| MCP 工具不可见、工具列表为空、连接关闭或本地 MCP 未启动 | 提示确认 Node.js 18+、npm 和 npm registry 网络后完全重启客户端;`npx` 会自动下载 mcp-server,不执行全局安装,不走 `authorize` |
|
|
61
64
|
| `oauth_invalid` | 仅在真正未授权或本地 OAuth 失效时,才允许提示用户调用 `authorize` |
|
|
62
65
|
| 当前店铺的 TikTok 授权失效或异常 | 用中文提醒用户:本地登录状态正常,但当前店铺需要先到 ScoreHub 重新绑定后再试;不要展示错误码,不要要求重复 `authorize` |
|
|
63
66
|
| 建会话入参不对或达人标识无效 | 检查传入的是来自搜索结果的 `creator_open_id` |
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
对候选达人**逐个**调用 MCP 工具 **`creator_performance`**(入参 `creator_user_id`),拿到表现数据后应用
|
|
16
16
|
[评分模型](./references/scoring-model.md) 打分排序。批量分析属多步操作,先与用户确认名单再执行。
|
|
17
17
|
|
|
18
|
+
如果 ScoreHub MCP 工具不可见、工具列表为空、连接已关闭或本地 MCP 未启动,判定为本地 MCP 可用性问题。提示用户确认 Node.js 18+ 与 npm 可用、网络可访问 npm registry,并完全重启 Claude Code 或 WorkBuddy 后重试;配置中的 `npx -y @scorehub/mcp-server@latest` 会自动下载 mcp-server,macOS、Linux、Windows 都不需要全局安装。不要将此类错误当作 OAuth、店铺授权或限流问题,也不要调用 `authorize`。
|
|
19
|
+
|
|
18
20
|
如果工具返回结构化 JSON,优先按 `error_type` 做分流,不要靠自然语言错误文本猜测。
|
|
19
21
|
|
|
20
22
|
如果本地登录状态正常,但工具提示当前店铺的 TikTok 授权失效或异常,直接提醒用户去 ScoreHub 重新绑定该店铺后再试;不要展示错误码,也不要要求用户重复执行 `authorize`。
|
|
@@ -54,6 +56,7 @@ GET https://open-api.tiktokglobalshop.com/affiliate_seller/202508/marketplace_cr
|
|
|
54
56
|
|
|
55
57
|
| 问题类型 | 处理 |
|
|
56
58
|
|----------|------|
|
|
59
|
+
| MCP 工具不可见、工具列表为空、连接关闭或本地 MCP 未启动 | 提示确认 Node.js 18+、npm 和 npm registry 网络后完全重启客户端;`npx` 会自动下载 mcp-server,不执行全局安装,不走 `authorize` |
|
|
57
60
|
| `oauth_invalid` | 仅在真正未授权或本地 OAuth 失效时,才允许提示用户调用 `authorize` |
|
|
58
61
|
| 当前店铺的 TikTok 授权失效或异常 | 用中文提醒用户:本地登录状态正常,但当前店铺需要先到 ScoreHub 重新绑定后再试;不要展示错误码,不要要求重复 `authorize` |
|
|
59
62
|
| 达人当前不可分析(如无电商权限或区域不匹配) | 跳过该达人,并说明当前达人不满足分析条件 |
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
|
|
34
34
|
调用 MCP 工具 **`search_creators`**,不要写脚本。若已授权可直接调用;未授权时先走 `authorize`。
|
|
35
35
|
|
|
36
|
+
如果 ScoreHub MCP 工具不可见、工具列表为空、连接已关闭或本地 MCP 未启动,判定为本地 MCP 可用性问题。提示用户确认 Node.js 18+ 与 npm 可用、网络可访问 npm registry,并完全重启 Claude Code 或 WorkBuddy 后重试;配置中的 `npx -y @scorehub/mcp-server@latest` 会自动下载 mcp-server,macOS、Linux、Windows 都不需要全局安装。不要将此类错误当作 OAuth、店铺授权或限流问题,也不要调用 `authorize`。
|
|
37
|
+
|
|
36
38
|
如果工具返回结构化 JSON,优先按 `error_type` 做分流,不要靠自然语言错误文本猜测。
|
|
37
39
|
|
|
38
40
|
如果本地登录状态正常,但工具提示当前店铺的 TikTok 授权失效或异常,直接提醒用户去 ScoreHub 重新绑定该店铺后再试;不要展示错误码,也不要要求用户重复执行 `authorize`。
|
|
@@ -96,6 +98,7 @@ POST https://open-api.tiktokglobalshop.com/affiliate_seller/202508/marketplace_c
|
|
|
96
98
|
|
|
97
99
|
| 问题类型 | 处理 |
|
|
98
100
|
|----------|------|
|
|
101
|
+
| MCP 工具不可见、工具列表为空、连接关闭或本地 MCP 未启动 | 提示确认 Node.js 18+、npm 和 npm registry 网络后完全重启客户端;`npx` 会自动下载 mcp-server,不执行全局安装,不走 `authorize` |
|
|
99
102
|
| `oauth_invalid` | 仅在真正未授权或本地 OAuth 失效时,才允许提示用户调用 `authorize` |
|
|
100
103
|
| 当前店铺的 TikTok 授权失效或异常 | 用中文提醒用户:本地登录状态正常,但当前店铺需要先到 ScoreHub 重新绑定后再试;不要展示错误码,不要要求重复 `authorize` |
|
|
101
104
|
| 日配额已用完 | 明确告知用户,停止 |
|