@klarkxy/dsh-zhihu 0.2.11 → 0.3.0
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.md +2 -7
- package/docs/README.zh-CN.md +2 -7
- package/lib/client.js +3 -1
- package/lib/contracts.d.ts +5 -13
- package/lib/contracts.js +5 -13
- package/lib/contracts.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/open-platform.js.map +1 -1
- package/lib/tools.js +165 -578
- package/lib/tools.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -35,13 +35,8 @@ These model tools are enabled by default in your agent presets:
|
|
|
35
35
|
|
|
36
36
|
| Tool | Purpose |
|
|
37
37
|
| --- | --- |
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `zhihu_knowledge_search` | Search knowledge bases |
|
|
41
|
-
| `zhihu_question_recommendations`, `zhihu_question_answers` | Find questions and read answer summaries |
|
|
42
|
-
| `zhihu_user_content_detail`, `zhihu_user_content_comments` | Read your published content and its comments |
|
|
43
|
-
| `zhihu_creator_account_stats`, `zhihu_creator_content_stats` | Your creator statistics |
|
|
44
|
-
| `zhihu_quota` | Check official quota |
|
|
38
|
+
| `zhihu_research` | Research actions: `search` (site search), `global_search` (web search), `hot_list`, `ask` (Zhida AI answers), `knowledge_search` |
|
|
39
|
+
| `zhihu_account` | Account actions: `question_recommendations`, `question_answers`, `content_detail`/`content_comments` on your posts, `creator_account_stats`, `creator_content_stats`, `quota` |
|
|
45
40
|
| `zhihu_sync` | Save, list, read, and validate drafts or upload images |
|
|
46
41
|
|
|
47
42
|
Site search and web search return an empty list when nothing matches, along with the service's explanation when provided.
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -35,13 +35,8 @@ dsh plugin --profile web add @klarkxy/dsh-zhihu
|
|
|
35
35
|
|
|
36
36
|
| 工具 | 用途 |
|
|
37
37
|
| --- | --- |
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `zhihu_knowledge_search` | 检索知识库 |
|
|
41
|
-
| `zhihu_question_recommendations`、`zhihu_question_answers` | 发现问题、读取回答摘要 |
|
|
42
|
-
| `zhihu_user_content_detail`、`zhihu_user_content_comments` | 读取自己已发布的内容及评论 |
|
|
43
|
-
| `zhihu_creator_account_stats`、`zhihu_creator_content_stats` | 自己的创作数据 |
|
|
44
|
-
| `zhihu_quota` | 查询官方额度 |
|
|
38
|
+
| `zhihu_research` | 调研检索:`search`(站内搜索)、`global_search`(全网搜索)、`hot_list`(热榜)、`ask`(直答)、`knowledge_search`(知识库) |
|
|
39
|
+
| `zhihu_account` | 账号数据:`question_recommendations`(问题推荐)、`question_answers`(回答摘要)、`content_detail`/`content_comments`(本人创作与评论)、`creator_account_stats`/`creator_content_stats`(创作数据)、`quota`(官方额度) |
|
|
45
40
|
| `zhihu_sync` | 保存、列出、读取并校验草稿,上传配图 |
|
|
46
41
|
|
|
47
42
|
站内搜索和全网搜索无匹配内容时返回空列表;服务提供原因说明时会一并显示。
|
package/lib/client.js
CHANGED
|
@@ -266,7 +266,9 @@ Object.values({
|
|
|
266
266
|
"--dsh-scrollbar-thumb-hover",
|
|
267
267
|
"--dsh-content-font-size-secondary",
|
|
268
268
|
"--dsh-content-font-delta",
|
|
269
|
-
"--dsh-frame-top-clearance"
|
|
269
|
+
"--dsh-frame-top-clearance",
|
|
270
|
+
"--dsh-composer-model-icon-display",
|
|
271
|
+
"--dsh-composer-model-text-display"
|
|
270
272
|
]
|
|
271
273
|
}).flat();
|
|
272
274
|
/**
|
package/lib/contracts.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
//#region src/contracts.d.ts
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
declare const ZHIHU_KNOWLEDGE_SEARCH_TOOL_NAME = "zhihu_knowledge_search";
|
|
2
|
+
/** 合并后的模型工具:检索类合并进 zhihu_research,账号/创作类合并进 zhihu_account。 */
|
|
3
|
+
declare const ZHIHU_RESEARCH_TOOL_NAME = "zhihu_research";
|
|
4
|
+
declare const ZHIHU_ACCOUNT_TOOL_NAME = "zhihu_account";
|
|
5
|
+
declare const ZHIHU_SYNC_TOOL_NAME = "zhihu_sync";
|
|
7
6
|
declare const ZHIHU_RPC_CHANNEL = "/zhihu";
|
|
8
7
|
declare const ZHIHU_CREDENTIAL_REF = "ZHIHU_ACCESS_TOKEN";
|
|
9
8
|
declare const ZHIHU_SEARCH_EVENT = "dsh-editor/zhihu-search";
|
|
@@ -18,17 +17,10 @@ type ZhihuRpcResult<T = unknown> = {
|
|
|
18
17
|
details: Record<string, unknown>;
|
|
19
18
|
};
|
|
20
19
|
};
|
|
21
|
-
declare const ZHIHU_QUESTION_RECOMMENDATIONS_TOOL_NAME = "zhihu_question_recommendations";
|
|
22
|
-
declare const ZHIHU_QUESTION_ANSWERS_TOOL_NAME = "zhihu_question_answers";
|
|
23
|
-
declare const ZHIHU_USER_CONTENT_DETAIL_TOOL_NAME = "zhihu_user_content_detail";
|
|
24
|
-
declare const ZHIHU_USER_CONTENT_COMMENTS_TOOL_NAME = "zhihu_user_content_comments";
|
|
25
|
-
declare const ZHIHU_CREATOR_ACCOUNT_STATS_TOOL_NAME = "zhihu_creator_account_stats";
|
|
26
|
-
declare const ZHIHU_CREATOR_CONTENT_STATS_TOOL_NAME = "zhihu_creator_content_stats";
|
|
27
|
-
declare const ZHIHU_QUOTA_TOOL_NAME = "zhihu_quota";
|
|
28
20
|
/** Official quota IDs, not local execution counters or predicted balances. */
|
|
29
21
|
declare const ZHIHU_QUOTA_IDS: readonly ["global_search", "zhihu_search", "hot_list", "question_discovery", "zhida_openai", "tools", "knowledge", "user_data", "creator"];
|
|
30
22
|
declare const normalizeZhihuQuotaId: (value: unknown) => unknown;
|
|
31
23
|
type ZhihuQuotaId = typeof ZHIHU_QUOTA_IDS[number];
|
|
32
24
|
//#endregion
|
|
33
|
-
export {
|
|
25
|
+
export { ZHIHU_ACCOUNT_TOOL_NAME, ZHIHU_CREDENTIAL_REF, ZHIHU_QUOTA_IDS, ZHIHU_RESEARCH_TOOL_NAME, ZHIHU_RPC_CHANNEL, ZHIHU_SEARCH_EVENT, ZHIHU_SYNC_TOOL_NAME, ZhihuQuotaId, ZhihuRpcResult, normalizeZhihuQuotaId };
|
|
34
26
|
//# sourceMappingURL=contracts.d.ts.map
|
package/lib/contracts.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
//#region src/contracts.ts
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const ZHIHU_KNOWLEDGE_SEARCH_TOOL_NAME = "zhihu_knowledge_search";
|
|
2
|
+
/** 合并后的模型工具:检索类合并进 zhihu_research,账号/创作类合并进 zhihu_account。 */
|
|
3
|
+
const ZHIHU_RESEARCH_TOOL_NAME = "zhihu_research";
|
|
4
|
+
const ZHIHU_ACCOUNT_TOOL_NAME = "zhihu_account";
|
|
5
|
+
const ZHIHU_SYNC_TOOL_NAME = "zhihu_sync";
|
|
7
6
|
const ZHIHU_RPC_CHANNEL = "/zhihu";
|
|
8
7
|
const ZHIHU_CREDENTIAL_REF = "ZHIHU_ACCESS_TOKEN";
|
|
9
8
|
const ZHIHU_SEARCH_EVENT = "dsh-editor/zhihu-search";
|
|
10
|
-
const ZHIHU_QUESTION_RECOMMENDATIONS_TOOL_NAME = "zhihu_question_recommendations";
|
|
11
|
-
const ZHIHU_QUESTION_ANSWERS_TOOL_NAME = "zhihu_question_answers";
|
|
12
|
-
const ZHIHU_USER_CONTENT_DETAIL_TOOL_NAME = "zhihu_user_content_detail";
|
|
13
|
-
const ZHIHU_USER_CONTENT_COMMENTS_TOOL_NAME = "zhihu_user_content_comments";
|
|
14
|
-
const ZHIHU_CREATOR_ACCOUNT_STATS_TOOL_NAME = "zhihu_creator_account_stats";
|
|
15
|
-
const ZHIHU_CREATOR_CONTENT_STATS_TOOL_NAME = "zhihu_creator_content_stats";
|
|
16
|
-
const ZHIHU_QUOTA_TOOL_NAME = "zhihu_quota";
|
|
17
9
|
/** Official quota IDs, not local execution counters or predicted balances. */
|
|
18
10
|
const ZHIHU_QUOTA_IDS = [
|
|
19
11
|
"global_search",
|
|
@@ -28,6 +20,6 @@ const ZHIHU_QUOTA_IDS = [
|
|
|
28
20
|
];
|
|
29
21
|
const normalizeZhihuQuotaId = (value) => value === "question_answers" ? "question_discovery" : value;
|
|
30
22
|
//#endregion
|
|
31
|
-
export {
|
|
23
|
+
export { ZHIHU_ACCOUNT_TOOL_NAME, ZHIHU_CREDENTIAL_REF, ZHIHU_QUOTA_IDS, ZHIHU_RESEARCH_TOOL_NAME, ZHIHU_RPC_CHANNEL, ZHIHU_SEARCH_EVENT, ZHIHU_SYNC_TOOL_NAME, normalizeZhihuQuotaId };
|
|
32
24
|
|
|
33
25
|
//# sourceMappingURL=contracts.js.map
|
package/lib/contracts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","names":[],"sources":["../src/contracts.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"contracts.js","names":[],"sources":["../src/contracts.ts"],"sourcesContent":["/** 合并后的模型工具:检索类合并进 zhihu_research,账号/创作类合并进 zhihu_account。 */\nexport const ZHIHU_RESEARCH_TOOL_NAME = 'zhihu_research'\nexport const ZHIHU_ACCOUNT_TOOL_NAME = 'zhihu_account'\nexport const ZHIHU_SYNC_TOOL_NAME = 'zhihu_sync'\nexport const ZHIHU_RPC_CHANNEL = '/zhihu'\nexport const ZHIHU_CREDENTIAL_REF = 'ZHIHU_ACCESS_TOKEN'\nexport const ZHIHU_SEARCH_EVENT = 'dsh-editor/zhihu-search'\nexport type ZhihuRpcResult<T = unknown> = { ok: true; value: T } | { ok: false; error: { code: string; message: string; details: Record<string, unknown> } }\n\n/** Official quota IDs, not local execution counters or predicted balances. */\nexport const ZHIHU_QUOTA_IDS = [\n 'global_search', 'zhihu_search', 'hot_list', 'question_discovery',\n 'zhida_openai', 'tools', 'knowledge', 'user_data', 'creator',\n] as const\nexport const normalizeZhihuQuotaId = (value: unknown): unknown => value === 'question_answers' ? 'question_discovery' : value\nexport type ZhihuQuotaId = typeof ZHIHU_QUOTA_IDS[number]\n"],"mappings":";;AACA,MAAa,2BAA2B;AACxC,MAAa,0BAA0B;AACvC,MAAa,uBAAuB;AACpC,MAAa,oBAAoB;AACjC,MAAa,uBAAuB;AACpC,MAAa,qBAAqB;;AAIlC,MAAa,kBAAkB;CAC7B;CAAiB;CAAgB;CAAY;CAC7C;CAAgB;CAAS;CAAa;CAAa;AACrD;AACA,MAAa,yBAAyB,UAA4B,UAAU,qBAAqB,uBAAuB"}
|
package/lib/index.js
CHANGED
|
@@ -152,7 +152,7 @@ function registerHostRpc(ctx, channel, handler) {
|
|
|
152
152
|
//#region src/web-search-provider.ts
|
|
153
153
|
/**
|
|
154
154
|
* Native ctx.web backend. Configuration and credentials belong to Zhihu.
|
|
155
|
-
* Official model tool remains `web_search`.
|
|
155
|
+
* Official model tool remains `web_search`. The `global_search` action of `zhihu_research` is unchanged.
|
|
156
156
|
*/
|
|
157
157
|
const ZHIHU_WEB_SEARCH_ID = "zhihu-global";
|
|
158
158
|
const ZHIHU_WEB_SEARCH_DESCRIPTOR = {
|