@zhin.js/plugin-60s 3.0.2 → 3.0.3
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/agent/tools/60s_news.ts +3 -3
- package/agent/tools/bing_image.ts +3 -3
- package/agent/tools/douyin_hot.ts +3 -3
- package/agent/tools/duanzi.ts +3 -3
- package/agent/tools/exchange_rate.ts +3 -3
- package/agent/tools/fuel_price.ts +3 -3
- package/agent/tools/gold_price.ts +3 -3
- package/agent/tools/history_today.ts +3 -3
- package/agent/tools/hitokoto.ts +3 -3
- package/agent/tools/ip_query.ts +3 -3
- package/agent/tools/kfc.ts +3 -3
- package/agent/tools/moyu.ts +3 -3
- package/agent/tools/toutiao_hot.ts +3 -3
- package/agent/tools/translate_60s.ts +3 -3
- package/agent/tools/weather.ts +3 -3
- package/agent/tools/weibo_hot.ts +3 -3
- package/agent/tools/zhihu_hot.ts +3 -3
- package/commands/60s.ts +7 -0
- package/commands/bing.ts +7 -0
- package/commands/douyin/[limit:number=10].ts +7 -0
- package/commands/duanzi.ts +7 -0
- package/commands/exchange.ts +10 -0
- package/commands/fanyi/[text:string].ts +7 -0
- package/commands/fuel/[province:string].ts +7 -0
- package/commands/gold.ts +7 -0
- package/commands/history.ts +7 -0
- package/commands/hitokoto/[type:string].ts +7 -0
- package/commands/ip/[ip:string].ts +7 -0
- package/commands/kfc.ts +7 -0
- package/commands/moyu.ts +7 -0
- package/commands/toutiao/[limit:number=10].ts +7 -0
- package/commands/weather/[city:string].ts +7 -0
- package/commands/weibo/[limit:number=10].ts +7 -0
- package/commands/zhihu/[limit:number=10].ts +7 -0
- package/lib/api.js.map +1 -0
- package/lib/{tools/60s-news/handler.js → handlers/60s-news.js} +1 -1
- package/lib/handlers/60s-news.js.map +1 -0
- package/lib/{tools/bing-image/handler.js → handlers/bing-image.js} +1 -1
- package/lib/handlers/bing-image.js.map +1 -0
- package/lib/{tools/douyin-hot/handler.js → handlers/douyin-hot.js} +1 -1
- package/lib/handlers/douyin-hot.js.map +1 -0
- package/lib/{tools/duanzi/handler.js → handlers/duanzi.js} +1 -1
- package/lib/handlers/duanzi.js.map +1 -0
- package/lib/{tools/exchange-rate/handler.js → handlers/exchange-rate.js} +1 -1
- package/lib/handlers/exchange-rate.js.map +1 -0
- package/lib/{tools/fuel-price/handler.js → handlers/fuel-price.js} +1 -1
- package/lib/handlers/fuel-price.js.map +1 -0
- package/lib/{tools/gold-price/handler.js → handlers/gold-price.js} +1 -1
- package/lib/handlers/gold-price.js.map +1 -0
- package/lib/{tools/history-today/handler.js → handlers/history-today.js} +1 -1
- package/lib/handlers/history-today.js.map +1 -0
- package/lib/{tools/hitokoto/handler.js → handlers/hitokoto.js} +1 -1
- package/lib/handlers/hitokoto.js.map +1 -0
- package/lib/{tools/ip-query/handler.js → handlers/ip-query.js} +1 -1
- package/lib/handlers/ip-query.js.map +1 -0
- package/lib/{tools/kfc/handler.js → handlers/kfc.js} +1 -1
- package/lib/handlers/kfc.js.map +1 -0
- package/lib/{tools/moyu/handler.js → handlers/moyu.js} +1 -1
- package/lib/handlers/moyu.js.map +1 -0
- package/lib/{tools/toutiao-hot/handler.js → handlers/toutiao-hot.js} +1 -1
- package/lib/{tools/toutiao-hot/handler.js.map → handlers/toutiao-hot.js.map} +1 -1
- package/lib/{tools/translate/handler.js → handlers/translate.js} +1 -1
- package/lib/handlers/translate.js.map +1 -0
- package/lib/{tools/weather/handler.js → handlers/weather.js} +1 -1
- package/lib/handlers/weather.js.map +1 -0
- package/lib/{tools/weibo-hot/handler.js → handlers/weibo-hot.js} +1 -1
- package/lib/handlers/weibo-hot.js.map +1 -0
- package/lib/{tools/zhihu-hot/handler.js → handlers/zhihu-hot.js} +1 -1
- package/lib/handlers/zhihu-hot.js.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/package.json +42 -16
- package/plugin.ts +18 -0
- package/schema.json +12 -0
- package/src/index.ts +8 -44
- package/lib/agent/tools/60s_news.js +0 -13
- package/lib/agent/tools/60s_news.js.map +0 -1
- package/lib/agent/tools/bing_image.js +0 -13
- package/lib/agent/tools/bing_image.js.map +0 -1
- package/lib/agent/tools/douyin_hot.js +0 -13
- package/lib/agent/tools/douyin_hot.js.map +0 -1
- package/lib/agent/tools/duanzi.js +0 -13
- package/lib/agent/tools/duanzi.js.map +0 -1
- package/lib/agent/tools/exchange_rate.js +0 -13
- package/lib/agent/tools/exchange_rate.js.map +0 -1
- package/lib/agent/tools/fuel_price.js +0 -13
- package/lib/agent/tools/fuel_price.js.map +0 -1
- package/lib/agent/tools/gold_price.js +0 -13
- package/lib/agent/tools/gold_price.js.map +0 -1
- package/lib/agent/tools/history_today.js +0 -13
- package/lib/agent/tools/history_today.js.map +0 -1
- package/lib/agent/tools/hitokoto.js +0 -13
- package/lib/agent/tools/hitokoto.js.map +0 -1
- package/lib/agent/tools/ip_query.js +0 -13
- package/lib/agent/tools/ip_query.js.map +0 -1
- package/lib/agent/tools/kfc.js +0 -13
- package/lib/agent/tools/kfc.js.map +0 -1
- package/lib/agent/tools/moyu.js +0 -13
- package/lib/agent/tools/moyu.js.map +0 -1
- package/lib/agent/tools/toutiao_hot.js +0 -13
- package/lib/agent/tools/toutiao_hot.js.map +0 -1
- package/lib/agent/tools/translate_60s.js +0 -13
- package/lib/agent/tools/translate_60s.js.map +0 -1
- package/lib/agent/tools/weather.js +0 -13
- package/lib/agent/tools/weather.js.map +0 -1
- package/lib/agent/tools/weibo_hot.js +0 -13
- package/lib/agent/tools/weibo_hot.js.map +0 -1
- package/lib/agent/tools/zhihu_hot.js +0 -13
- package/lib/agent/tools/zhihu_hot.js.map +0 -1
- package/lib/src/index.js +0 -35
- package/lib/src/index.js.map +0 -1
- package/lib/tools/60s-news/handler.js.map +0 -1
- package/lib/tools/api.js.map +0 -1
- package/lib/tools/bing-image/handler.js.map +0 -1
- package/lib/tools/douyin-hot/handler.js.map +0 -1
- package/lib/tools/duanzi/handler.js.map +0 -1
- package/lib/tools/exchange-rate/handler.js.map +0 -1
- package/lib/tools/fuel-price/handler.js.map +0 -1
- package/lib/tools/gold-price/handler.js.map +0 -1
- package/lib/tools/history-today/handler.js.map +0 -1
- package/lib/tools/hitokoto/handler.js.map +0 -1
- package/lib/tools/ip-query/handler.js.map +0 -1
- package/lib/tools/kfc/handler.js.map +0 -1
- package/lib/tools/moyu/handler.js.map +0 -1
- package/lib/tools/translate/handler.js.map +0 -1
- package/lib/tools/weather/handler.js.map +0 -1
- package/lib/tools/weibo-hot/handler.js.map +0 -1
- package/lib/tools/zhihu-hot/handler.js.map +0 -1
- package/plugin.yml +0 -3
- /package/lib/{tools/api.js → api.js} +0 -0
- /package/{tools → src}/api.ts +0 -0
- /package/{tools/60s-news/handler.ts → src/handlers/60s-news.ts} +0 -0
- /package/{tools/bing-image/handler.ts → src/handlers/bing-image.ts} +0 -0
- /package/{tools/douyin-hot/handler.ts → src/handlers/douyin-hot.ts} +0 -0
- /package/{tools/duanzi/handler.ts → src/handlers/duanzi.ts} +0 -0
- /package/{tools/exchange-rate/handler.ts → src/handlers/exchange-rate.ts} +0 -0
- /package/{tools/fuel-price/handler.ts → src/handlers/fuel-price.ts} +0 -0
- /package/{tools/gold-price/handler.ts → src/handlers/gold-price.ts} +0 -0
- /package/{tools/history-today/handler.ts → src/handlers/history-today.ts} +0 -0
- /package/{tools/hitokoto/handler.ts → src/handlers/hitokoto.ts} +0 -0
- /package/{tools/ip-query/handler.ts → src/handlers/ip-query.ts} +0 -0
- /package/{tools/kfc/handler.ts → src/handlers/kfc.ts} +0 -0
- /package/{tools/moyu/handler.ts → src/handlers/moyu.ts} +0 -0
- /package/{tools/toutiao-hot/handler.ts → src/handlers/toutiao-hot.ts} +0 -0
- /package/{tools/translate/handler.ts → src/handlers/translate.ts} +0 -0
- /package/{tools/weather/handler.ts → src/handlers/weather.ts} +0 -0
- /package/{tools/weibo-hot/handler.ts → src/handlers/weibo-hot.ts} +0 -0
- /package/{tools/zhihu-hot/handler.ts → src/handlers/zhih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.js","sourceRoot":"","sources":["../../src/handlers/toutiao-hot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAiB,MAAM,WAAW,CAAC;AAEhE,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,IAAwB;IACrD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAa,UAAU,CAAC,CAAC;IACpD,OAAO,CAAC,SAAS,EAAE,EAAE,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.js","sourceRoot":"","sources":["../../src/handlers/translate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEzD,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,IAAmC;IAChE,MAAM,MAAM,GAA2B,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC3D,IAAI,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACjC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC;IACnD,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpE,MAAM,OAAO,GACX,QAAQ,CAAC,MAAM,C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AClD,OAAO,CAAC,SAAS,EAAE,EAAE,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zhihu-hot.js","sourceRoot":"","sources":["../../src/handlers/zhihu-hot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAiB,MAAM,WAAW,CAAC;AAEhE,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,IAAwB;IACrD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAa,QAAQ,CAAC,CAAC;IAClD,OAAO,CAAC,SAAS,EAAE,EAAE,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
|
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,GACX,MAAM,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/plugin-60s",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "60s API aggregation plugin for Zhin.js — news, weather, hot searches, utilities
|
|
3
|
+
"version": "3.0.3",
|
|
4
|
+
"description": "60s API aggregation plugin for Zhin.js — news, weather, hot searches, utilities (Plugin Runtime)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
"./package.json": "./package.json"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
+
"plugin.ts",
|
|
18
|
+
"schema.json",
|
|
19
|
+
"commands",
|
|
17
20
|
"src",
|
|
18
21
|
"lib",
|
|
19
22
|
"agent",
|
|
20
|
-
"tools",
|
|
21
|
-
"plugin.yml",
|
|
22
23
|
"README.md"
|
|
23
24
|
],
|
|
24
25
|
"keywords": [
|
|
@@ -43,16 +44,28 @@
|
|
|
43
44
|
"url": "https://github.com/lc-cn"
|
|
44
45
|
},
|
|
45
46
|
"license": "MIT",
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@zhin.js/command": "1.0.1",
|
|
49
|
+
"@zhin.js/plugin-runtime": "1.0.1",
|
|
50
|
+
"@zhin.js/tool": "1.0.1"
|
|
51
|
+
},
|
|
46
52
|
"devDependencies": {
|
|
47
53
|
"typescript": "^6.0.3",
|
|
54
|
+
"vitest": "^4.1.10",
|
|
48
55
|
"zod": "^4.4.3",
|
|
49
|
-
"zhin.js": "
|
|
50
|
-
"@zhin.js/agent": "1.0.3"
|
|
56
|
+
"@zhin.js/agent": "1.0.4"
|
|
51
57
|
},
|
|
52
58
|
"peerDependencies": {
|
|
53
59
|
"zod": "^4.0.0",
|
|
54
|
-
"zhin.js": "
|
|
55
|
-
|
|
60
|
+
"@zhin.js/agent": "1.0.4"
|
|
61
|
+
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"@zhin.js/agent": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
66
|
+
"zod": {
|
|
67
|
+
"optional": true
|
|
68
|
+
}
|
|
56
69
|
},
|
|
57
70
|
"repository": {
|
|
58
71
|
"type": "git",
|
|
@@ -63,17 +76,30 @@
|
|
|
63
76
|
"access": "public",
|
|
64
77
|
"registry": "https://registry.npmjs.org"
|
|
65
78
|
},
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
81
|
+
},
|
|
82
|
+
"zhin": {
|
|
83
|
+
"protocol": 1,
|
|
84
|
+
"type": "plugin",
|
|
85
|
+
"entry": "./plugin.ts",
|
|
86
|
+
"engine": "^1.0.0",
|
|
87
|
+
"runtime": "trusted",
|
|
88
|
+
"features": [
|
|
89
|
+
{
|
|
90
|
+
"package": "@zhin.js/command",
|
|
91
|
+
"api": "^1.0.0"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"package": "@zhin.js/tool",
|
|
95
|
+
"api": "^1.0.0"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"plugins": []
|
|
73
99
|
},
|
|
74
100
|
"scripts": {
|
|
75
101
|
"build": "tsc",
|
|
76
102
|
"clean": "rimraf lib",
|
|
77
|
-
"test": "
|
|
103
|
+
"test": "NODE_OPTIONS=--experimental-strip-types vitest run --root ../../.. plugins/utils/60s/tests"
|
|
78
104
|
}
|
|
79
105
|
}
|
package/plugin.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { definePlugin } from '@zhin.js/plugin-runtime';
|
|
2
|
+
|
|
3
|
+
export interface SixtySConfig {
|
|
4
|
+
readonly apiBase?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const DEFAULT_API_BASE = 'https://60s.viki.moe';
|
|
8
|
+
|
|
9
|
+
export default definePlugin<SixtySConfig>({
|
|
10
|
+
name: 'sixty-s',
|
|
11
|
+
metadata: {
|
|
12
|
+
displayName: '60s API',
|
|
13
|
+
},
|
|
14
|
+
setup(context) {
|
|
15
|
+
const apiBase = context.config.get().apiBase?.trim() || DEFAULT_API_BASE;
|
|
16
|
+
process.env.ZHIN_60S_API = apiBase;
|
|
17
|
+
},
|
|
18
|
+
});
|
package/schema.json
ADDED
package/src/index.ts
CHANGED
|
@@ -1,44 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
* 功能列表:
|
|
11
|
-
* 60s新闻 · 天气 · 微博热搜 · 知乎热榜 · 抖音热搜 · 头条热搜
|
|
12
|
-
* 一言 · 摸鱼日历 · IP查询 · Bing壁纸 · 金价 · 油价
|
|
13
|
-
* 汇率 · 翻译 · 历史上的今天 · KFC文案 · 段子
|
|
14
|
-
*
|
|
15
|
-
* 所有工具定义在 tools/ 目录下,框架自动发现注册。
|
|
16
|
-
*
|
|
17
|
-
* 配置方式(zhin.config.yml):
|
|
18
|
-
* ```yaml
|
|
19
|
-
* plugins:
|
|
20
|
-
* 60s:
|
|
21
|
-
* apiBase: https://60s.viki.moe
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
import { usePlugin } from 'zhin.js';
|
|
25
|
-
|
|
26
|
-
const plugin = usePlugin();
|
|
27
|
-
const { root } = plugin;
|
|
28
|
-
|
|
29
|
-
// ─── 配置 ────────────────────────────────────────────────────────────────────
|
|
30
|
-
|
|
31
|
-
interface Config {
|
|
32
|
-
apiBase?: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const configService = root.inject('config');
|
|
36
|
-
const appConfig = configService?.getPrimary<{ '60s'?: Config }>() || {};
|
|
37
|
-
const config: Config = {
|
|
38
|
-
apiBase: 'https://60s.viki.moe',
|
|
39
|
-
...appConfig['60s'],
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// 将 API 地址写入环境变量,供 tool handler 使用
|
|
43
|
-
process.env.ZHIN_60S_API = config.apiBase || 'https://60s.viki.moe';
|
|
44
|
-
|
|
1
|
+
export {
|
|
2
|
+
asArray,
|
|
3
|
+
asRecord,
|
|
4
|
+
asString,
|
|
5
|
+
fetchApi,
|
|
6
|
+
formatList,
|
|
7
|
+
} from './api.js';
|
|
8
|
+
export type { ApiPayload, ListItem } from './api.js';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "获取每日60秒新闻,快速了解今日要闻",
|
|
5
|
-
inputSchema: z.object({}),
|
|
6
|
-
keywords: ["60s", "新闻", "今日新闻", "60秒", "每日新闻", "读懂世界"],
|
|
7
|
-
tags: ["新闻", "资讯", "60s"],
|
|
8
|
-
async execute() {
|
|
9
|
-
const handler = (await import('../../tools/60s-news/handler.js')).default;
|
|
10
|
-
return handler();
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=60s_news.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"60s_news.js","sourceRoot":"","sources":["../../../agent/tools/60s_news.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAC;IACxB,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IACtD,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;IACzB,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1E,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "获取 Bing 每日壁纸图片",
|
|
5
|
-
inputSchema: z.object({}),
|
|
6
|
-
keywords: ["bing", "必应", "壁纸", "每日壁纸"],
|
|
7
|
-
tags: ["图片", "壁纸", "Bing"],
|
|
8
|
-
async execute() {
|
|
9
|
-
const handler = (await import('../../tools/bing-image/handler.js')).default;
|
|
10
|
-
return handler();
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=bing_image.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bing_image.js","sourceRoot":"","sources":["../../../agent/tools/bing_image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAC;IACxB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC5E,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "获取抖音热搜榜",
|
|
5
|
-
inputSchema: z.object({ limit: z.number().optional() }),
|
|
6
|
-
keywords: ["抖音", "热搜", "douyin", "dy"],
|
|
7
|
-
tags: ["热搜", "短视频", "抖音"],
|
|
8
|
-
async execute(input) {
|
|
9
|
-
const handler = (await import('../../tools/douyin-hot/handler.js')).default;
|
|
10
|
-
return handler(input);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=douyin_hot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"douyin_hot.js","sourceRoot":"","sources":["../../../agent/tools/douyin_hot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAqB;IAC5C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;IACvD,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC;IACtC,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC;IACzB,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC5E,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "获取一个段子",
|
|
5
|
-
inputSchema: z.object({}),
|
|
6
|
-
keywords: ["段子", "笑话", "搞笑", "joke", "duanzi"],
|
|
7
|
-
tags: ["娱乐", "笑话", "段子"],
|
|
8
|
-
async execute() {
|
|
9
|
-
const handler = (await import('../../tools/duanzi/handler.js')).default;
|
|
10
|
-
return handler();
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=duanzi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"duanzi.js","sourceRoot":"","sources":["../../../agent/tools/duanzi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAC;IACxB,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC;IAC9C,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC,CAAC,OAAO,CAAC;QACxE,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "查询货币汇率",
|
|
5
|
-
inputSchema: z.object({ from: z.string().optional(), to: z.string().optional() }),
|
|
6
|
-
keywords: ["汇率", "兑换", "外汇", "exchange", "rate"],
|
|
7
|
-
tags: ["金融", "汇率", "查询"],
|
|
8
|
-
async execute(input) {
|
|
9
|
-
const handler = (await import('../../tools/exchange-rate/handler.js')).default;
|
|
10
|
-
return handler(input);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=exchange_rate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exchange_rate.js","sourceRoot":"","sources":["../../../agent/tools/exchange_rate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAiC;IACxD,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;IACjF,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC;IAChD,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,sCAAsC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC/E,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "查询今日油价",
|
|
5
|
-
inputSchema: z.object({ province: z.string().optional() }),
|
|
6
|
-
keywords: ["油价", "汽油", "柴油", "fuel"],
|
|
7
|
-
tags: ["生活", "油价", "价格"],
|
|
8
|
-
async execute(input) {
|
|
9
|
-
const handler = (await import('../../tools/fuel-price/handler.js')).default;
|
|
10
|
-
return handler(input);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=fuel_price.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fuel_price.js","sourceRoot":"","sources":["../../../agent/tools/fuel_price.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAwB;IAC/C,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC1D,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC5E,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "查询今日黄金价格",
|
|
5
|
-
inputSchema: z.object({}),
|
|
6
|
-
keywords: ["金价", "黄金", "黄金价格", "gold"],
|
|
7
|
-
tags: ["金融", "黄金", "价格"],
|
|
8
|
-
async execute() {
|
|
9
|
-
const handler = (await import('../../tools/gold-price/handler.js')).default;
|
|
10
|
-
return handler();
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=gold_price.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gold_price.js","sourceRoot":"","sources":["../../../agent/tools/gold_price.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAC;IACxB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC5E,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "查看历史上的今天发生了什么",
|
|
5
|
-
inputSchema: z.object({}),
|
|
6
|
-
keywords: ["历史", "历史上的今天", "今天历史", "history"],
|
|
7
|
-
tags: ["历史", "知识", "日历"],
|
|
8
|
-
async execute() {
|
|
9
|
-
const handler = (await import('../../tools/history-today/handler.js')).default;
|
|
10
|
-
return handler();
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=history_today.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"history_today.js","sourceRoot":"","sources":["../../../agent/tools/history_today.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAC;IACxB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC;IAC7C,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,sCAAsC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC/E,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "获取一言/每日一句,随机返回一条语句",
|
|
5
|
-
inputSchema: z.object({ type: z.string().optional() }),
|
|
6
|
-
keywords: ["一言", "每日一句", "语录", "名言", "hitokoto"],
|
|
7
|
-
tags: ["语录", "文学", "随机"],
|
|
8
|
-
async execute(input) {
|
|
9
|
-
const handler = (await import('../../tools/hitokoto/handler.js')).default;
|
|
10
|
-
return handler(input);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=hitokoto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hitokoto.js","sourceRoot":"","sources":["../../../agent/tools/hitokoto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAoB;IAC3C,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;IACtD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC;IAChD,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1E,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "查询 IP 地址的地理位置信息",
|
|
5
|
-
inputSchema: z.object({ ip: z.string().optional() }),
|
|
6
|
-
keywords: ["ip", "IP", "IP查询", "ip查询"],
|
|
7
|
-
tags: ["网络", "查询", "IP"],
|
|
8
|
-
async execute(input) {
|
|
9
|
-
const handler = (await import('../../tools/ip-query/handler.js')).default;
|
|
10
|
-
return handler(input);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=ip_query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ip_query.js","sourceRoot":"","sources":["../../../agent/tools/ip_query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAkB;IACzC,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;IACpD,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1E,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
package/lib/agent/tools/kfc.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "获取 KFC 疯狂星期四文案",
|
|
5
|
-
inputSchema: z.object({}),
|
|
6
|
-
keywords: ["kfc", "KFC", "疯狂星期四", "v50", "肯德基"],
|
|
7
|
-
tags: ["娱乐", "KFC", "文案"],
|
|
8
|
-
async execute() {
|
|
9
|
-
const handler = (await import('../../tools/kfc/handler.js')).default;
|
|
10
|
-
return handler();
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=kfc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kfc.js","sourceRoot":"","sources":["../../../agent/tools/kfc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAC;IACxB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC;IAC/C,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC;IACzB,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC,CAAC,OAAO,CAAC;QACrE,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC;CACF,CAAC,CAAC"}
|
package/lib/agent/tools/moyu.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "获取摸鱼日历,查看今天适不适合摸鱼",
|
|
5
|
-
inputSchema: z.object({}),
|
|
6
|
-
keywords: ["摸鱼", "摸鱼日历", "moyu"],
|
|
7
|
-
tags: ["生活", "摸鱼", "日历"],
|
|
8
|
-
async execute() {
|
|
9
|
-
const handler = (await import('../../tools/moyu/handler.js')).default;
|
|
10
|
-
return handler();
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=moyu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"moyu.js","sourceRoot":"","sources":["../../../agent/tools/moyu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAC;IACxB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC;IAChC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC,OAAO,CAAC;QACtE,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "获取今日头条热搜榜",
|
|
5
|
-
inputSchema: z.object({ limit: z.number().optional() }),
|
|
6
|
-
keywords: ["头条", "今日头条", "热搜", "toutiao", "tt"],
|
|
7
|
-
tags: ["热搜", "资讯", "头条"],
|
|
8
|
-
async execute(input) {
|
|
9
|
-
const handler = (await import('../../tools/toutiao-hot/handler.js')).default;
|
|
10
|
-
return handler(input);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=toutiao_hot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toutiao_hot.js","sourceRoot":"","sources":["../../../agent/tools/toutiao_hot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAqB;IAC5C,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;IACvD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC;IAC/C,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,oCAAoC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC7E,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "翻译文本",
|
|
5
|
-
inputSchema: z.object({ text: z.string().min(1), to: z.string().optional() }),
|
|
6
|
-
keywords: ["翻译", "英文", "中文", "日文", "translate", "译"],
|
|
7
|
-
tags: ["工具", "翻译", "语言"],
|
|
8
|
-
async execute(input) {
|
|
9
|
-
const handler = (await import('../../tools/translate/handler.js')).default;
|
|
10
|
-
return handler(input);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=translate_60s.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"translate_60s.js","sourceRoot":"","sources":["../../../agent/tools/translate_60s.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAgC;IACvD,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC7E,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,CAAC;IACpD,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC3E,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "查询指定城市的当前天气信息",
|
|
5
|
-
inputSchema: z.object({ city: z.string() }),
|
|
6
|
-
keywords: ["天气", "气温", "温度", "下雨", "晴天", "阴天", "weather"],
|
|
7
|
-
tags: ["天气", "生活", "查询"],
|
|
8
|
-
async execute(input) {
|
|
9
|
-
const handler = (await import('../../tools/weather/handler.js')).default;
|
|
10
|
-
return handler(input);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=weather.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"weather.js","sourceRoot":"","sources":["../../../agent/tools/weather.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAmB;IAC1C,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IAC3C,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC;IACzD,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,gCAAgC,CAAC,CAAC,CAAC,OAAO,CAAC;QACzE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "获取微博热搜榜",
|
|
5
|
-
inputSchema: z.object({ limit: z.number().optional() }),
|
|
6
|
-
keywords: ["微博", "热搜", "weibo", "wb"],
|
|
7
|
-
tags: ["热搜", "社交", "微博"],
|
|
8
|
-
async execute(input) {
|
|
9
|
-
const handler = (await import('../../tools/weibo-hot/handler.js')).default;
|
|
10
|
-
return handler(input);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=weibo_hot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"weibo_hot.js","sourceRoot":"","sources":["../../../agent/tools/weibo_hot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAqB;IAC5C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;IACvD,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC;IACrC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC3E,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineTool } from '@zhin.js/agent/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export default defineTool({
|
|
4
|
-
description: "获取知乎热榜",
|
|
5
|
-
inputSchema: z.object({ limit: z.number().optional() }),
|
|
6
|
-
keywords: ["知乎", "热榜", "zhihu", "zh"],
|
|
7
|
-
tags: ["热搜", "社交", "知乎"],
|
|
8
|
-
async execute(input) {
|
|
9
|
-
const handler = (await import('../../tools/zhihu-hot/handler.js')).default;
|
|
10
|
-
return handler(input);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=zhihu_hot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zhihu_hot.js","sourceRoot":"","sources":["../../../agent/tools/zhihu_hot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,UAAU,CAAqB;IAC5C,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;IACvD,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC;IACrC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACxB,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC3E,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
package/lib/src/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @zhin.js/plugin-60s
|
|
3
|
-
*
|
|
4
|
-
* 60s API 聚合插件 —— 基于 https://github.com/vikiboss/60s
|
|
5
|
-
*
|
|
6
|
-
* 提供多种实用 API 功能,每个功能通过 tools/*.tool.md 文件定义:
|
|
7
|
-
* - 聊天命令(/60s, /天气 北京, /微博 …)
|
|
8
|
-
* - AI 工具(Agent 可通过关键词自动匹配并调用)
|
|
9
|
-
*
|
|
10
|
-
* 功能列表:
|
|
11
|
-
* 60s新闻 · 天气 · 微博热搜 · 知乎热榜 · 抖音热搜 · 头条热搜
|
|
12
|
-
* 一言 · 摸鱼日历 · IP查询 · Bing壁纸 · 金价 · 油价
|
|
13
|
-
* 汇率 · 翻译 · 历史上的今天 · KFC文案 · 段子
|
|
14
|
-
*
|
|
15
|
-
* 所有工具定义在 tools/ 目录下,框架自动发现注册。
|
|
16
|
-
*
|
|
17
|
-
* 配置方式(zhin.config.yml):
|
|
18
|
-
* ```yaml
|
|
19
|
-
* plugins:
|
|
20
|
-
* 60s:
|
|
21
|
-
* apiBase: https://60s.viki.moe
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
import { usePlugin } from 'zhin.js';
|
|
25
|
-
const plugin = usePlugin();
|
|
26
|
-
const { root } = plugin;
|
|
27
|
-
const configService = root.inject('config');
|
|
28
|
-
const appConfig = configService?.getPrimary() || {};
|
|
29
|
-
const config = {
|
|
30
|
-
apiBase: 'https://60s.viki.moe',
|
|
31
|
-
...appConfig['60s'],
|
|
32
|
-
};
|
|
33
|
-
// 将 API 地址写入环境变量,供 tool handler 使用
|
|
34
|
-
process.env.ZHIN_60S_API = config.apiBase || 'https://60s.viki.moe';
|
|
35
|
-
//# sourceMappingURL=index.js.map
|