@claudeink/mcp-server 0.0.4 → 0.0.5
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/package.json +1 -1
- package/workflow/CLAUDE.md +86 -10
package/package.json
CHANGED
package/workflow/CLAUDE.md
CHANGED
|
@@ -133,24 +133,100 @@ tags:
|
|
|
133
133
|
|
|
134
134
|
工作流支持将元数据同步到 ClaudeInk 云端控制台(https://app.claudeink.com),在 Dashboard 中查看数据概览。
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
**核心原则**:只上传**元数据**(标题、标签、状态、字数),**全文内容不上传**,保留在本地。
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
### 凭证
|
|
139
|
+
|
|
140
|
+
凭证存储在 `.claudeink/credentials.json`,激活时自动生成。同步时从中读取 `token` 字段作为 Bearer Token。
|
|
140
141
|
|
|
141
|
-
###
|
|
142
|
+
### 同步协议
|
|
142
143
|
|
|
143
|
-
|
|
144
|
+
执行 `/同步` 时,按以下步骤操作:
|
|
144
145
|
|
|
146
|
+
**第一步:读取凭证**
|
|
145
147
|
```bash
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
TOKEN=$(cat .claudeink/credentials.json | grep -o '"token":"[^"]*"' | cut -d'"' -f4)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**第二步:扫描本地账号**
|
|
152
|
+
读取 `accounts/*.yaml`(跳过 `_template.yaml`),提取每个账号的 `name`、`id`、`platform`。
|
|
153
|
+
|
|
154
|
+
**第三步:扫描素材元数据**
|
|
155
|
+
扫描 `sources/` 下所有 `.md` 文件,从 YAML front matter 中提取:
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"id": "文件名(不含.md)",
|
|
159
|
+
"title": "frontmatter.title",
|
|
160
|
+
"tags": ["frontmatter.tags"],
|
|
161
|
+
"createdAt": "frontmatter.published",
|
|
162
|
+
"sourceUrl": "frontmatter.url"
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**第四步:扫描草稿元数据**
|
|
167
|
+
扫描所有账号的 `drafts/` 目录下 `.md` 文件,从 front matter 中提取:
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"id": "文件名",
|
|
171
|
+
"account": "所属账号名",
|
|
172
|
+
"title": "frontmatter.title",
|
|
173
|
+
"status": "frontmatter.status 或 draft",
|
|
174
|
+
"wordCount": "正文字数",
|
|
175
|
+
"tags": ["frontmatter.tags"],
|
|
176
|
+
"createdAt": "frontmatter.created 或文件创建时间",
|
|
177
|
+
"updatedAt": "文件修改时间"
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**第五步:扫描已发布**
|
|
182
|
+
扫描所有账号的 `published/` 目录,提取:
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"id": "文件名",
|
|
186
|
+
"account": "所属账号名",
|
|
187
|
+
"platform": "账号 yaml 中的 platform",
|
|
188
|
+
"title": "frontmatter.title",
|
|
189
|
+
"platformUrl": "frontmatter.url",
|
|
190
|
+
"publishedAt": "frontmatter.published_at"
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**第六步:推送到云端**
|
|
195
|
+
```bash
|
|
196
|
+
curl -s -X POST https://app.claudeink.com/api/sync/batch \
|
|
197
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
149
198
|
-H "Content-Type: application/json" \
|
|
150
|
-
-d '{
|
|
199
|
+
-d '{
|
|
200
|
+
"sources": [扫描结果],
|
|
201
|
+
"drafts": [扫描结果],
|
|
202
|
+
"published": [扫描结果],
|
|
203
|
+
"analytics": []
|
|
204
|
+
}'
|
|
151
205
|
```
|
|
152
206
|
|
|
153
|
-
|
|
207
|
+
**第七步:报告结果**
|
|
208
|
+
告知用户同步了多少条素材、草稿、已发布文章。
|
|
209
|
+
|
|
210
|
+
### 同步指令
|
|
211
|
+
|
|
212
|
+
- `/同步`:立即执行上述同步协议
|
|
213
|
+
- `/报告`:从云端拉取数据分析报告
|
|
214
|
+
|
|
215
|
+
### 定时同步
|
|
216
|
+
|
|
217
|
+
本工作流配置了 Cowork 定时任务,自动同步本地数据到云端。
|
|
218
|
+
|
|
219
|
+
**任务名称**:ClaudeInk 数据同步
|
|
220
|
+
**执行频率**:每 4 小时
|
|
221
|
+
**任务内容**:
|
|
222
|
+
|
|
223
|
+
> 执行 /同步 指令,将本地素材、草稿、已发布文章的元数据同步到 ClaudeInk 云端。
|
|
224
|
+
> 读取 .claudeink/credentials.json 获取认证 token。
|
|
225
|
+
> 扫描 sources/、各账号 drafts/、published/ 目录。
|
|
226
|
+
> POST 到 https://app.claudeink.com/api/sync/batch。
|
|
227
|
+
> 同步完成后记录日志到 .claudeink/sync-log.md(追加一行:日期时间 + 同步数量)。
|
|
228
|
+
|
|
229
|
+
用户也可以随时使用 `/同步` 手动触发。
|
|
154
230
|
|
|
155
231
|
## 指令速查
|
|
156
232
|
|