@zhin.js/plugin-60s 1.0.1 → 1.1.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.
Files changed (141) hide show
  1. package/README.md +1 -1
  2. package/agent/tools/60s_news.ts +13 -0
  3. package/agent/tools/bing_image.ts +13 -0
  4. package/agent/tools/douyin_hot.ts +13 -0
  5. package/agent/tools/duanzi.ts +13 -0
  6. package/agent/tools/exchange_rate.ts +13 -0
  7. package/agent/tools/fuel_price.ts +13 -0
  8. package/agent/tools/gold_price.ts +13 -0
  9. package/agent/tools/history_today.ts +13 -0
  10. package/agent/tools/hitokoto.ts +13 -0
  11. package/agent/tools/ip_query.ts +13 -0
  12. package/agent/tools/kfc.ts +13 -0
  13. package/agent/tools/moyu.ts +13 -0
  14. package/agent/tools/toutiao_hot.ts +13 -0
  15. package/agent/tools/translate_60s.ts +13 -0
  16. package/agent/tools/weather.ts +13 -0
  17. package/agent/tools/weibo_hot.ts +13 -0
  18. package/agent/tools/zhihu_hot.ts +13 -0
  19. package/commands/60s.js +7 -0
  20. package/commands/60s.ts +7 -0
  21. package/commands/bing.js +7 -0
  22. package/commands/bing.ts +7 -0
  23. package/commands/douyin/[[limit]].js +8 -0
  24. package/commands/douyin/[[limit]].ts +8 -0
  25. package/commands/duanzi.js +7 -0
  26. package/commands/duanzi.ts +7 -0
  27. package/commands/exchange.js +10 -0
  28. package/commands/exchange.ts +10 -0
  29. package/commands/fanyi/[text].js +8 -0
  30. package/commands/fanyi/[text].ts +8 -0
  31. package/commands/fuel/[province].js +8 -0
  32. package/commands/fuel/[province].ts +8 -0
  33. package/commands/gold.js +7 -0
  34. package/commands/gold.ts +7 -0
  35. package/commands/history.js +7 -0
  36. package/commands/history.ts +7 -0
  37. package/commands/hitokoto/[type].js +8 -0
  38. package/commands/hitokoto/[type].ts +8 -0
  39. package/commands/ip/[ip].js +8 -0
  40. package/commands/ip/[ip].ts +8 -0
  41. package/commands/kfc.js +7 -0
  42. package/commands/kfc.ts +7 -0
  43. package/commands/moyu.js +7 -0
  44. package/commands/moyu.ts +7 -0
  45. package/commands/toutiao/[[limit]].js +8 -0
  46. package/commands/toutiao/[[limit]].ts +8 -0
  47. package/commands/weather/[city].js +8 -0
  48. package/commands/weather/[city].ts +8 -0
  49. package/commands/weibo/[[limit]].js +8 -0
  50. package/commands/weibo/[[limit]].ts +8 -0
  51. package/commands/zhihu/[[limit]].js +8 -0
  52. package/commands/zhihu/[[limit]].ts +8 -0
  53. package/lib/api.js +59 -0
  54. package/lib/api.js.map +1 -0
  55. package/lib/handlers/60s-news.js +12 -0
  56. package/lib/handlers/60s-news.js.map +1 -0
  57. package/lib/handlers/bing-image.js +18 -0
  58. package/lib/handlers/bing-image.js.map +1 -0
  59. package/lib/handlers/douyin-hot.js +6 -0
  60. package/lib/handlers/douyin-hot.js.map +1 -0
  61. package/lib/handlers/duanzi.js +6 -0
  62. package/lib/handlers/duanzi.js.map +1 -0
  63. package/lib/handlers/exchange-rate.js +28 -0
  64. package/lib/handlers/exchange-rate.js.map +1 -0
  65. package/lib/handlers/fuel-price.js +21 -0
  66. package/lib/handlers/fuel-price.js.map +1 -0
  67. package/lib/handlers/gold-price.js +24 -0
  68. package/lib/handlers/gold-price.js.map +1 -0
  69. package/lib/handlers/history-today.js +16 -0
  70. package/lib/handlers/history-today.js.map +1 -0
  71. package/lib/handlers/hitokoto.js +16 -0
  72. package/lib/handlers/hitokoto.js.map +1 -0
  73. package/lib/handlers/ip-query.js +17 -0
  74. package/lib/handlers/ip-query.js.map +1 -0
  75. package/lib/handlers/kfc.js +6 -0
  76. package/lib/handlers/kfc.js.map +1 -0
  77. package/lib/handlers/moyu.js +39 -0
  78. package/lib/handlers/moyu.js.map +1 -0
  79. package/lib/handlers/toutiao-hot.js +6 -0
  80. package/lib/handlers/toutiao-hot.js.map +1 -0
  81. package/lib/handlers/translate.js +26 -0
  82. package/lib/handlers/translate.js.map +1 -0
  83. package/lib/handlers/weather.js +22 -0
  84. package/lib/handlers/weather.js.map +1 -0
  85. package/lib/handlers/weibo-hot.js +6 -0
  86. package/lib/handlers/weibo-hot.js.map +1 -0
  87. package/lib/handlers/zhihu-hot.js +6 -0
  88. package/lib/handlers/zhihu-hot.js.map +1 -0
  89. package/lib/index.js +1 -34
  90. package/lib/index.js.map +1 -1
  91. package/lib/runtime-deps.js +22 -0
  92. package/lib/runtime-deps.js.map +1 -0
  93. package/package.json +52 -12
  94. package/plugin.js +13 -0
  95. package/schema.json +12 -0
  96. package/src/api.ts +79 -0
  97. package/{tools/60s-news/handler.ts → src/handlers/60s-news.ts} +1 -1
  98. package/{tools/bing-image/handler.ts → src/handlers/bing-image.ts} +4 -4
  99. package/{tools/douyin-hot/handler.ts → src/handlers/douyin-hot.ts} +2 -2
  100. package/{tools/duanzi/handler.ts → src/handlers/duanzi.ts} +1 -1
  101. package/{tools/exchange-rate/handler.ts → src/handlers/exchange-rate.ts} +8 -6
  102. package/{tools/fuel-price/handler.ts → src/handlers/fuel-price.ts} +5 -4
  103. package/{tools/gold-price/handler.ts → src/handlers/gold-price.ts} +8 -7
  104. package/src/handlers/history-today.ts +16 -0
  105. package/{tools/hitokoto/handler.ts → src/handlers/hitokoto.ts} +1 -1
  106. package/{tools/ip-query/handler.ts → src/handlers/ip-query.ts} +1 -1
  107. package/{tools/kfc/handler.ts → src/handlers/kfc.ts} +1 -1
  108. package/src/handlers/moyu.ts +35 -0
  109. package/{tools/toutiao-hot/handler.ts → src/handlers/toutiao-hot.ts} +2 -2
  110. package/src/handlers/translate.ts +25 -0
  111. package/src/handlers/weather.ts +22 -0
  112. package/{tools/weibo-hot/handler.ts → src/handlers/weibo-hot.ts} +2 -2
  113. package/{tools/zhihu-hot/handler.ts → src/handlers/zhihu-hot.ts} +2 -2
  114. package/src/index.ts +8 -44
  115. package/src/runtime-deps.ts +26 -0
  116. package/lib/index.d.ts +0 -2
  117. package/lib/index.d.ts.map +0 -1
  118. package/plugin.yml +0 -3
  119. package/tools/60s-news/60s-news.tool.md +0 -8
  120. package/tools/api.ts +0 -34
  121. package/tools/bing-image/bing-image.tool.md +0 -8
  122. package/tools/douyin-hot/douyin-hot.tool.md +0 -12
  123. package/tools/duanzi/duanzi.tool.md +0 -8
  124. package/tools/exchange-rate/exchange-rate.tool.md +0 -14
  125. package/tools/fuel-price/fuel-price.tool.md +0 -11
  126. package/tools/gold-price/gold-price.tool.md +0 -8
  127. package/tools/history-today/handler.ts +0 -15
  128. package/tools/history-today/history-today.tool.md +0 -8
  129. package/tools/hitokoto/hitokoto.tool.md +0 -12
  130. package/tools/ip-query/ip-query.tool.md +0 -12
  131. package/tools/kfc/kfc.tool.md +0 -8
  132. package/tools/moyu/handler.ts +0 -28
  133. package/tools/moyu/moyu.tool.md +0 -8
  134. package/tools/toutiao-hot/toutiao-hot.tool.md +0 -12
  135. package/tools/translate/handler.ts +0 -19
  136. package/tools/translate/translate.tool.md +0 -15
  137. package/tools/weather/handler.ts +0 -22
  138. package/tools/weather/weather.tool.md +0 -12
  139. package/tools/weibo-hot/weibo-hot.tool.md +0 -12
  140. package/tools/zhihu-hot/zhihu-hot.tool.md +0 -12
  141. /package/{skills/60s/SKILL.md → agent/skills/60s.md} +0 -0
@@ -1,12 +0,0 @@
1
- ---
2
- name: hitokoto
3
- description: 获取一言/每日一句,随机返回一条语句
4
- tags: [语录, 文学, 随机]
5
- keywords: [一言, 每日一句, 语录, 名言, hitokoto]
6
- preExecutable: true
7
- parameters:
8
- type:
9
- type: string
10
- description: "类型:a=动画, b=漫画, c=游戏, d=文学, e=原创, f=网络, g=其他, h=影视, i=诗词, j=网易云, k=哲学, l=抖机灵"
11
- handler: ./handler.ts
12
- ---
@@ -1,12 +0,0 @@
1
- ---
2
- name: ip_query
3
- description: 查询 IP 地址的地理位置信息
4
- tags: [网络, 查询, IP]
5
- keywords: [ip, IP, IP查询, ip查询]
6
- preExecutable: true
7
- parameters:
8
- ip:
9
- type: string
10
- description: IP 地址,不填则查询当前 IP
11
- handler: ./handler.ts
12
- ---
@@ -1,8 +0,0 @@
1
- ---
2
- name: kfc
3
- description: 获取 KFC 疯狂星期四文案
4
- tags: [娱乐, KFC, 文案]
5
- keywords: [kfc, KFC, 疯狂星期四, v50, 肯德基]
6
- preExecutable: true
7
- handler: ./handler.ts
8
- ---
@@ -1,28 +0,0 @@
1
- import { fetchApi } from '../api.js';
2
-
3
- export default async function () {
4
- const data = await fetchApi<any>('/moyu');
5
- if (typeof data === 'string') return `🐟 摸鱼日历\n\n${data}`;
6
- const lines = ['🐟 摸鱼日历', ''];
7
- if (data.date?.gregorian) lines.push(`📅 ${data.date.gregorian} ${data.date.weekday || ''}`);
8
- if (data.date?.lunar) {
9
- const l = data.date.lunar;
10
- lines.push(`🌙 农历${l.monthCN || ''}${l.dayCN || ''} ${l.yearGanZhi || ''}年`);
11
- }
12
- if (data.today) {
13
- const t = data.today;
14
- if (t.holidayName) lines.push(`🎉 ${t.holidayName}`);
15
- if (t.solarTerm) lines.push(`🌿 ${t.solarTerm}`);
16
- lines.push(t.isWorkday ? '💼 今天是工作日' : '🎮 今天不上班');
17
- }
18
- if (data.festivals && Array.isArray(data.festivals)) {
19
- data.festivals.forEach((f: any) => lines.push(`🎊 ${f.name || f}`));
20
- }
21
- if (data.countdown && Array.isArray(data.countdown)) {
22
- lines.push('');
23
- data.countdown.forEach((c: any) => {
24
- if (c.name && c.days !== undefined) lines.push(`⏳ 距 ${c.name} 还有 ${c.days} 天`);
25
- });
26
- }
27
- return lines.join('\n');
28
- }
@@ -1,8 +0,0 @@
1
- ---
2
- name: moyu
3
- description: 获取摸鱼日历,查看今天适不适合摸鱼
4
- tags: [生活, 摸鱼, 日历]
5
- keywords: [摸鱼, 摸鱼日历, moyu]
6
- preExecutable: true
7
- handler: ./handler.ts
8
- ---
@@ -1,12 +0,0 @@
1
- ---
2
- name: toutiao_hot
3
- description: 获取今日头条热搜榜
4
- tags: [热搜, 资讯, 头条]
5
- keywords: [头条, 今日头条, 热搜, toutiao, tt]
6
- preExecutable: true
7
- parameters:
8
- limit:
9
- type: number
10
- description: 返回条数,默认10条
11
- handler: ./handler.ts
12
- ---
@@ -1,19 +0,0 @@
1
- import { fetchApi } from '../api.js';
2
-
3
- export default async function (args: { text: string; to?: string }) {
4
- const params: Record<string, string> = { text: args.text };
5
- if (args.to) params.to = args.to;
6
- const data = await fetchApi<any>('/fanyi', params);
7
- const srcText = data.source?.text || args.text;
8
- const srcLang = data.source?.type_desc || data.source?.type || '';
9
- const tgtText = data.target?.text || data.result || data.translation || (typeof data === 'string' ? data : '');
10
- const tgtLang = data.target?.type_desc || data.target?.type || '';
11
- const lines = [
12
- '🌐 翻译结果',
13
- '',
14
- `原文${srcLang ? ` (${srcLang})` : ''}: ${srcText}`,
15
- `译文${tgtLang ? ` (${tgtLang})` : ''}: ${tgtText}`,
16
- ];
17
- if (data.target?.pronounce) lines.push(`发音: ${data.target.pronounce}`);
18
- return lines.join('\n');
19
- }
@@ -1,15 +0,0 @@
1
- ---
2
- name: translate_60s
3
- description: 翻译文本
4
- tags: [工具, 翻译, 语言]
5
- keywords: [翻译, 英文, 中文, 日文, translate, 译]
6
- parameters:
7
- text:
8
- type: string
9
- description: 要翻译的文本
10
- required: true
11
- to:
12
- type: string
13
- description: 目标语言,如 en, zh, ja
14
- handler: ./handler.ts
15
- ---
@@ -1,22 +0,0 @@
1
- import { fetchApi } from '../api.js';
2
-
3
- export default async function (args: { city: string }) {
4
- const data = await fetchApi<any>('/weather', { query: args.city });
5
- const w = data.weather;
6
- const aq = data.air_quality;
7
- const loc = data.location;
8
- const cityName = loc?.city || loc?.name || args.city;
9
- const lines = [
10
- `🌤️ ${cityName} 天气`,
11
- '',
12
- `🌡️ 温度: ${w.temperature}°C`,
13
- `☁️ 天气: ${w.condition}`,
14
- `💧 湿度: ${w.humidity}%`,
15
- `💨 风: ${w.wind_direction} ${w.wind_power}`,
16
- ];
17
- if (aq) {
18
- const quality = aq.quality || '';
19
- lines.push(`🌬️ 空气: ${quality}${aq.aqi ? ` (AQI ${aq.aqi})` : ''}`);
20
- }
21
- return lines.join('\n');
22
- }
@@ -1,12 +0,0 @@
1
- ---
2
- name: weather
3
- description: 查询指定城市的当前天气信息
4
- tags: [天气, 生活, 查询]
5
- keywords: [天气, 气温, 温度, 下雨, 晴天, 阴天, weather]
6
- parameters:
7
- city:
8
- type: string
9
- description: 城市名称,如"成都"、"北京"
10
- required: true
11
- handler: ./handler.ts
12
- ---
@@ -1,12 +0,0 @@
1
- ---
2
- name: weibo_hot
3
- description: 获取微博热搜榜
4
- tags: [热搜, 社交, 微博]
5
- keywords: [微博, 热搜, weibo, wb]
6
- preExecutable: true
7
- parameters:
8
- limit:
9
- type: number
10
- description: 返回条数,默认10条
11
- handler: ./handler.ts
12
- ---
@@ -1,12 +0,0 @@
1
- ---
2
- name: zhihu_hot
3
- description: 获取知乎热榜
4
- tags: [热搜, 社交, 知乎]
5
- keywords: [知乎, 热榜, zhihu, zh]
6
- preExecutable: true
7
- parameters:
8
- limit:
9
- type: number
10
- description: 返回条数,默认10条
11
- handler: ./handler.ts
12
- ---
File without changes