@zhin.js/plugin-60s 1.1.0 → 1.1.2

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 (171) hide show
  1. package/README.md +2 -0
  2. package/commands/{60s.js → 60s/index.js} +3 -2
  3. package/commands/60s/index.ts +8 -0
  4. package/commands/{bing.js → bing/index.js} +3 -2
  5. package/commands/bing/index.ts +8 -0
  6. package/commands/douyin/{[[limit]].js → [[limit]]/index.js} +3 -2
  7. package/commands/douyin/[[limit]]/index.ts +9 -0
  8. package/commands/{duanzi.js → duanzi/index.js} +3 -2
  9. package/commands/duanzi/index.ts +8 -0
  10. package/commands/{exchange.js → exchange/index.js} +3 -2
  11. package/commands/{exchange.ts → exchange/index.ts} +3 -2
  12. package/commands/fanyi/[text]/index.js +9 -0
  13. package/commands/fanyi/[text]/index.ts +9 -0
  14. package/commands/fuel/[province]/index.js +9 -0
  15. package/commands/fuel/[province]/index.ts +9 -0
  16. package/commands/{gold.js → gold/index.js} +3 -2
  17. package/commands/gold/index.ts +8 -0
  18. package/commands/{history.js → history/index.js} +3 -2
  19. package/commands/history/index.ts +8 -0
  20. package/commands/hitokoto/[type]/index.js +9 -0
  21. package/commands/hitokoto/[type]/index.ts +9 -0
  22. package/commands/ip/[ip]/index.js +9 -0
  23. package/commands/ip/[ip]/index.ts +9 -0
  24. package/commands/{kfc.js → kfc/index.js} +3 -2
  25. package/commands/kfc/index.ts +8 -0
  26. package/commands/{moyu.js → moyu/index.js} +3 -2
  27. package/commands/moyu/index.ts +8 -0
  28. package/commands/toutiao/{[[limit]].js → [[limit]]/index.js} +3 -2
  29. package/commands/toutiao/[[limit]]/index.ts +9 -0
  30. package/commands/weather/{[city].js → [city]/index.js} +3 -2
  31. package/commands/weather/[city]/index.ts +9 -0
  32. package/commands/weibo/{[[limit]].js → [[limit]]/index.js} +3 -2
  33. package/commands/weibo/[[limit]]/index.ts +9 -0
  34. package/commands/zhihu/{[[limit]].js → [[limit]]/index.js} +3 -2
  35. package/commands/zhihu/[[limit]]/index.ts +9 -0
  36. package/lib/api.js +0 -32
  37. package/lib/api.js.map +1 -1
  38. package/lib/client.js +42 -0
  39. package/lib/client.js.map +1 -0
  40. package/lib/handlers/60s-news.js +2 -3
  41. package/lib/handlers/60s-news.js.map +1 -1
  42. package/lib/handlers/bing-image.js +3 -3
  43. package/lib/handlers/bing-image.js.map +1 -1
  44. package/lib/handlers/douyin-hot.js +3 -3
  45. package/lib/handlers/douyin-hot.js.map +1 -1
  46. package/lib/handlers/duanzi.js +2 -3
  47. package/lib/handlers/duanzi.js.map +1 -1
  48. package/lib/handlers/exchange-rate.js +3 -3
  49. package/lib/handlers/exchange-rate.js.map +1 -1
  50. package/lib/handlers/fuel-price.js +3 -3
  51. package/lib/handlers/fuel-price.js.map +1 -1
  52. package/lib/handlers/gold-price.js +3 -3
  53. package/lib/handlers/gold-price.js.map +1 -1
  54. package/lib/handlers/history-today.js +3 -3
  55. package/lib/handlers/history-today.js.map +1 -1
  56. package/lib/handlers/hitokoto.js +2 -3
  57. package/lib/handlers/hitokoto.js.map +1 -1
  58. package/lib/handlers/ip-query.js +2 -3
  59. package/lib/handlers/ip-query.js.map +1 -1
  60. package/lib/handlers/kfc.js +2 -3
  61. package/lib/handlers/kfc.js.map +1 -1
  62. package/lib/handlers/moyu.js +3 -3
  63. package/lib/handlers/moyu.js.map +1 -1
  64. package/lib/handlers/toutiao-hot.js +3 -3
  65. package/lib/handlers/toutiao-hot.js.map +1 -1
  66. package/lib/handlers/translate.js +3 -3
  67. package/lib/handlers/translate.js.map +1 -1
  68. package/lib/handlers/weather.js +3 -3
  69. package/lib/handlers/weather.js.map +1 -1
  70. package/lib/handlers/weibo-hot.js +3 -3
  71. package/lib/handlers/weibo-hot.js.map +1 -1
  72. package/lib/handlers/zhihu-hot.js +3 -3
  73. package/lib/handlers/zhihu-hot.js.map +1 -1
  74. package/lib/index.js +1 -1
  75. package/lib/index.js.map +1 -1
  76. package/package.json +12 -11
  77. package/plugin.js +2 -3
  78. package/skills/60s-life/SKILL.md +22 -0
  79. package/skills/60s-life/tools/duanzi/index.js +14 -0
  80. package/skills/60s-life/tools/duanzi/index.ts +14 -0
  81. package/skills/60s-life/tools/history_today/index.js +14 -0
  82. package/skills/60s-life/tools/history_today/index.ts +14 -0
  83. package/skills/60s-life/tools/hitokoto/index.js +14 -0
  84. package/{agent/tools/hitokoto.ts → skills/60s-life/tools/hitokoto/index.ts} +5 -4
  85. package/skills/60s-life/tools/kfc/index.js +14 -0
  86. package/skills/60s-life/tools/kfc/index.ts +14 -0
  87. package/skills/60s-life/tools/moyu/index.js +14 -0
  88. package/skills/60s-life/tools/moyu/index.ts +14 -0
  89. package/skills/60s-life/tools/weather/index.js +14 -0
  90. package/{agent/tools/weather.ts → skills/60s-life/tools/weather/index.ts} +5 -4
  91. package/skills/60s-market/SKILL.md +17 -0
  92. package/skills/60s-market/tools/exchange_rate/index.js +14 -0
  93. package/{agent/tools/exchange_rate.ts → skills/60s-market/tools/exchange_rate/index.ts} +5 -4
  94. package/skills/60s-market/tools/fuel_price/index.js +14 -0
  95. package/skills/60s-market/tools/fuel_price/index.ts +14 -0
  96. package/skills/60s-market/tools/gold_price/index.js +14 -0
  97. package/skills/60s-market/tools/gold_price/index.ts +14 -0
  98. package/skills/60s-media/SKILL.md +14 -0
  99. package/skills/60s-media/tools/bing_image/index.js +14 -0
  100. package/skills/60s-media/tools/bing_image/index.ts +14 -0
  101. package/skills/60s-news/SKILL.md +21 -0
  102. package/skills/60s-news/tools/60s_news/index.js +14 -0
  103. package/{agent/tools/60s_news.ts → skills/60s-news/tools/60s_news/index.ts} +5 -4
  104. package/skills/60s-news/tools/douyin_hot/index.js +14 -0
  105. package/skills/60s-news/tools/douyin_hot/index.ts +14 -0
  106. package/skills/60s-news/tools/toutiao_hot/index.js +14 -0
  107. package/{agent/tools/toutiao_hot.ts → skills/60s-news/tools/toutiao_hot/index.ts} +5 -4
  108. package/skills/60s-news/tools/weibo_hot/index.js +14 -0
  109. package/skills/60s-news/tools/weibo_hot/index.ts +14 -0
  110. package/skills/60s-news/tools/zhihu_hot/index.js +14 -0
  111. package/skills/60s-news/tools/zhihu_hot/index.ts +14 -0
  112. package/skills/60s-utility/SKILL.md +15 -0
  113. package/skills/60s-utility/tools/ip_query/index.js +14 -0
  114. package/skills/60s-utility/tools/ip_query/index.ts +14 -0
  115. package/skills/60s-utility/tools/translate_60s/index.js +14 -0
  116. package/{agent/tools/translate_60s.ts → skills/60s-utility/tools/translate_60s/index.ts} +5 -4
  117. package/src/api.ts +1 -46
  118. package/src/client.ts +62 -0
  119. package/src/handlers/60s-news.ts +3 -3
  120. package/src/handlers/bing-image.ts +4 -3
  121. package/src/handlers/douyin-hot.ts +4 -3
  122. package/src/handlers/duanzi.ts +3 -3
  123. package/src/handlers/exchange-rate.ts +4 -3
  124. package/src/handlers/fuel-price.ts +4 -3
  125. package/src/handlers/gold-price.ts +4 -3
  126. package/src/handlers/history-today.ts +4 -3
  127. package/src/handlers/hitokoto.ts +3 -3
  128. package/src/handlers/ip-query.ts +3 -3
  129. package/src/handlers/kfc.ts +3 -3
  130. package/src/handlers/moyu.ts +4 -3
  131. package/src/handlers/toutiao-hot.ts +4 -3
  132. package/src/handlers/translate.ts +4 -3
  133. package/src/handlers/weather.ts +4 -3
  134. package/src/handlers/weibo-hot.ts +4 -3
  135. package/src/handlers/zhihu-hot.ts +4 -3
  136. package/src/index.ts +0 -1
  137. package/agent/skills/60s.md +0 -91
  138. package/agent/tools/bing_image.ts +0 -13
  139. package/agent/tools/douyin_hot.ts +0 -13
  140. package/agent/tools/duanzi.ts +0 -13
  141. package/agent/tools/fuel_price.ts +0 -13
  142. package/agent/tools/gold_price.ts +0 -13
  143. package/agent/tools/history_today.ts +0 -13
  144. package/agent/tools/ip_query.ts +0 -13
  145. package/agent/tools/kfc.ts +0 -13
  146. package/agent/tools/moyu.ts +0 -13
  147. package/agent/tools/weibo_hot.ts +0 -13
  148. package/agent/tools/zhihu_hot.ts +0 -13
  149. package/commands/60s.ts +0 -7
  150. package/commands/bing.ts +0 -7
  151. package/commands/douyin/[[limit]].ts +0 -8
  152. package/commands/duanzi.ts +0 -7
  153. package/commands/fanyi/[text].js +0 -8
  154. package/commands/fanyi/[text].ts +0 -8
  155. package/commands/fuel/[province].js +0 -8
  156. package/commands/fuel/[province].ts +0 -8
  157. package/commands/gold.ts +0 -7
  158. package/commands/history.ts +0 -7
  159. package/commands/hitokoto/[type].js +0 -8
  160. package/commands/hitokoto/[type].ts +0 -8
  161. package/commands/ip/[ip].js +0 -8
  162. package/commands/ip/[ip].ts +0 -8
  163. package/commands/kfc.ts +0 -7
  164. package/commands/moyu.ts +0 -7
  165. package/commands/toutiao/[[limit]].ts +0 -8
  166. package/commands/weather/[city].ts +0 -8
  167. package/commands/weibo/[[limit]].ts +0 -8
  168. package/commands/zhihu/[[limit]].ts +0 -8
  169. package/lib/runtime-deps.js +0 -22
  170. package/lib/runtime-deps.js.map +0 -1
  171. package/src/runtime-deps.ts +0 -26
@@ -1,7 +1,8 @@
1
- import { asArray, asRecord, asString, fetchApi, type ApiPayload } from '../api.js';
1
+ import { asArray, asRecord, asString, type ApiPayload } from '../api.js';
2
+ import type { SixtySClient } from '../client.js';
2
3
 
3
- export default async function () {
4
- const data = await fetchApi<ApiPayload | string>('/moyu');
4
+ export default async function (client: SixtySClient) {
5
+ const data = await client.fetch<ApiPayload | string>('/moyu');
5
6
  if (typeof data === 'string') return `🐟 摸鱼日历\n\n${data}`;
6
7
  const lines = ['🐟 摸鱼日历', ''];
7
8
  const date = asRecord(data.date);
@@ -1,6 +1,7 @@
1
- import { fetchApi, formatList, type ListItem } from '../api.js';
1
+ import { formatList, type ListItem } from '../api.js';
2
+ import type { SixtySClient } from '../client.js';
2
3
 
3
- export default async function (args: { limit?: number }) {
4
- const data = await fetchApi<ListItem[]>('/toutiao');
4
+ export default async function (client: SixtySClient, args: { limit?: number }) {
5
+ const data = await client.fetch<ListItem[]>('/toutiao');
5
6
  return ['🔥 头条热搜', '', formatList(data, args.limit || 10)].join('\n');
6
7
  }
@@ -1,9 +1,10 @@
1
- import { asRecord, asString, fetchApi } from '../api.js';
1
+ import { asRecord, asString } from '../api.js';
2
+ import type { SixtySClient } from '../client.js';
2
3
 
3
- export default async function (args: { text: string; to?: string }) {
4
+ export default async function (client: SixtySClient, args: { text: string; to?: string }) {
4
5
  const params: Record<string, string> = { text: args.text };
5
6
  if (args.to) params.to = args.to;
6
- const data = await fetchApi('/fanyi', params);
7
+ const data = await client.fetch('/fanyi', params);
7
8
  const source = asRecord(data.source);
8
9
  const target = asRecord(data.target);
9
10
  const srcText = asString(source.text) || args.text;
@@ -1,7 +1,8 @@
1
- import { asRecord, asString, fetchApi } from '../api.js';
1
+ import { asRecord, asString } from '../api.js';
2
+ import type { SixtySClient } from '../client.js';
2
3
 
3
- export default async function (args: { city: string }) {
4
- const data = await fetchApi('/weather', { query: args.city });
4
+ export default async function (client: SixtySClient, args: { city: string }) {
5
+ const data = await client.fetch('/weather', { query: args.city });
5
6
  const w = asRecord(data.weather);
6
7
  const aq = asRecord(data.air_quality);
7
8
  const loc = asRecord(data.location);
@@ -1,6 +1,7 @@
1
- import { fetchApi, formatList, type ListItem } from '../api.js';
1
+ import { formatList, type ListItem } from '../api.js';
2
+ import type { SixtySClient } from '../client.js';
2
3
 
3
- export default async function (args: { limit?: number }) {
4
- const data = await fetchApi<ListItem[]>('/weibo');
4
+ export default async function (client: SixtySClient, args: { limit?: number }) {
5
+ const data = await client.fetch<ListItem[]>('/weibo');
5
6
  return ['🔥 微博热搜', '', formatList(data, args.limit || 10)].join('\n');
6
7
  }
@@ -1,6 +1,7 @@
1
- import { fetchApi, formatList, type ListItem } from '../api.js';
1
+ import { formatList, type ListItem } from '../api.js';
2
+ import type { SixtySClient } from '../client.js';
2
3
 
3
- export default async function (args: { limit?: number }) {
4
- const data = await fetchApi<ListItem[]>('/zhihu');
4
+ export default async function (client: SixtySClient, args: { limit?: number }) {
5
+ const data = await client.fetch<ListItem[]>('/zhihu');
5
6
  return ['🔥 知乎热榜', '', formatList(data, args.limit || 10)].join('\n');
6
7
  }
package/src/index.ts CHANGED
@@ -2,7 +2,6 @@ export {
2
2
  asArray,
3
3
  asRecord,
4
4
  asString,
5
- fetchApi,
6
5
  formatList,
7
6
  } from './api.js';
8
7
  export type { ApiPayload, ListItem } from './api.js';
@@ -1,91 +0,0 @@
1
- ---
2
- name: "60s"
3
- description: >-
4
- 60s 聚合信息查询能力。当用户请求新闻、天气、热搜(微博/知乎/抖音/头条)、
5
- 金价、油价、汇率、翻译、一言/每日一句、摸鱼日历、KFC 文案、段子、
6
- 历史上的今天、IP 查询、Bing 每日壁纸时使用。即使用户没有提到 60s,
7
- 只要涉及上述日常信息查询,就应触发。
8
- keywords:
9
- - 60s
10
- - 新闻
11
- - 天气
12
- - 微博
13
- - 知乎
14
- - 抖音
15
- - 头条
16
- - 一言
17
- - 摸鱼
18
- - 金价
19
- - 油价
20
- - 汇率
21
- - 翻译
22
- - 历史
23
- - kfc
24
- - 段子
25
- - 壁纸
26
- - bing
27
- - ip
28
- - 热搜
29
- tags:
30
- - 新闻
31
- - 资讯
32
- - 天气
33
- - 热搜
34
- - 生活
35
- - 金融
36
- - 娱乐
37
- - 工具
38
- tools:
39
- - 60s_news
40
- - bing_image
41
- - douyin_hot
42
- - duanzi
43
- - exchange_rate
44
- - fuel_price
45
- - gold_price
46
- - history_today
47
- - hitokoto
48
- - ip_query
49
- - kfc
50
- - moyu
51
- - toutiao_hot
52
- - translate_60s
53
- - weather
54
- - weibo_hot
55
- - zhihu_hot
56
- ---
57
-
58
- # 60s 聚合信息查询技能
59
-
60
- 一站式日常信息查询,覆盖新闻、天气、热搜、金融、娱乐等 17 个工具。
61
-
62
- ## 工具速查
63
-
64
- 根据用户意图选择对应工具:
65
-
66
- | 用户说… | 用这个工具 |
67
- |---------|-----------|
68
- | 今天有什么新闻 / 60s 看世界 | `60s_news` |
69
- | XX 天气怎么样 | `weather` |
70
- | 微博热搜 | `weibo_hot` |
71
- | 知乎热搜 | `zhihu_hot` |
72
- | 抖音热搜 | `douyin_hot` |
73
- | 今日头条 | `toutiao_hot` |
74
- | 金价多少 | `gold_price` |
75
- | 油价多少 | `fuel_price` |
76
- | 美元汇率 / 人民币兑日元 | `exchange_rate` |
77
- | 翻译一下 XX | `translate_60s` |
78
- | 来句一言 / 每日一句 | `hitokoto` |
79
- | 摸鱼日历 / 今天摸鱼 | `moyu` |
80
- | KFC 文案 / 疯狂星期四 | `kfc` |
81
- | 来个段子 | `duanzi` |
82
- | 历史上的今天 | `history_today` |
83
- | 查 IP / 我的 IP | `ip_query` |
84
- | Bing 壁纸 / 每日壁纸 | `bing_image` |
85
-
86
- ## 易错点
87
-
88
- 1. **weather 需要城市名参数**,用户没说城市时需要先确认。
89
- 2. **exchange_rate 需要币种参数**,如 USD、JPY、EUR 等。
90
- 3. **translate_60s 是简易翻译**,对于复杂翻译任务应建议使用专业翻译工具。
91
- 4. **热搜类工具不需要参数**,直接调用即可获取当前热搜列表。
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool({
5
- description: "获取 Bing 每日壁纸图片",
6
- inputSchema: z.object({}),
7
- keywords: ["bing", "必应", "壁纸", "每日壁纸"],
8
- tags: ["图片", "壁纸", "Bing"],
9
- async execute() {
10
- const handler = (await import('../../src/handlers/bing-image.js')).default;
11
- return handler();
12
- },
13
- });
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool<{ limit?: number }>({
5
- description: "获取抖音热搜榜",
6
- inputSchema: z.object({ limit: z.number().optional() }),
7
- keywords: ["抖音", "热搜", "douyin", "dy"],
8
- tags: ["热搜", "短视频", "抖音"],
9
- async execute(input) {
10
- const handler = (await import('../../src/handlers/douyin-hot.js')).default;
11
- return handler(input);
12
- },
13
- });
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool({
5
- description: "获取一个段子",
6
- inputSchema: z.object({}),
7
- keywords: ["段子", "笑话", "搞笑", "joke", "duanzi"],
8
- tags: ["娱乐", "笑话", "段子"],
9
- async execute() {
10
- const handler = (await import('../../src/handlers/duanzi.js')).default;
11
- return handler();
12
- },
13
- });
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool<{ province?: string }>({
5
- description: "查询今日油价",
6
- inputSchema: z.object({ province: z.string().optional() }),
7
- keywords: ["油价", "汽油", "柴油", "fuel"],
8
- tags: ["生活", "油价", "价格"],
9
- async execute(input) {
10
- const handler = (await import('../../src/handlers/fuel-price.js')).default;
11
- return handler(input);
12
- },
13
- });
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool({
5
- description: "查询今日黄金价格",
6
- inputSchema: z.object({}),
7
- keywords: ["金价", "黄金", "黄金价格", "gold"],
8
- tags: ["金融", "黄金", "价格"],
9
- async execute() {
10
- const handler = (await import('../../src/handlers/gold-price.js')).default;
11
- return handler();
12
- },
13
- });
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool({
5
- description: "查看历史上的今天发生了什么",
6
- inputSchema: z.object({}),
7
- keywords: ["历史", "历史上的今天", "今天历史", "history"],
8
- tags: ["历史", "知识", "日历"],
9
- async execute() {
10
- const handler = (await import('../../src/handlers/history-today.js')).default;
11
- return handler();
12
- },
13
- });
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool<{ ip?: string }>({
5
- description: "查询 IP 地址的地理位置信息",
6
- inputSchema: z.object({ ip: z.string().optional() }),
7
- keywords: ["ip", "IP", "IP查询", "ip查询"],
8
- tags: ["网络", "查询", "IP"],
9
- async execute(input) {
10
- const handler = (await import('../../src/handlers/ip-query.js')).default;
11
- return handler(input);
12
- },
13
- });
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool({
5
- description: "获取 KFC 疯狂星期四文案",
6
- inputSchema: z.object({}),
7
- keywords: ["kfc", "KFC", "疯狂星期四", "v50", "肯德基"],
8
- tags: ["娱乐", "KFC", "文案"],
9
- async execute() {
10
- const handler = (await import('../../src/handlers/kfc.js')).default;
11
- return handler();
12
- },
13
- });
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool({
5
- description: "获取摸鱼日历,查看今天适不适合摸鱼",
6
- inputSchema: z.object({}),
7
- keywords: ["摸鱼", "摸鱼日历", "moyu"],
8
- tags: ["生活", "摸鱼", "日历"],
9
- async execute() {
10
- const handler = (await import('../../src/handlers/moyu.js')).default;
11
- return handler();
12
- },
13
- });
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool<{ limit?: number }>({
5
- description: "获取微博热搜榜",
6
- inputSchema: z.object({ limit: z.number().optional() }),
7
- keywords: ["微博", "热搜", "weibo", "wb"],
8
- tags: ["热搜", "社交", "微博"],
9
- async execute(input) {
10
- const handler = (await import('../../src/handlers/weibo-hot.js')).default;
11
- return handler(input);
12
- },
13
- });
@@ -1,13 +0,0 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
2
- import { z } from 'zod';
3
-
4
- export default defineAgentTool<{ limit?: number }>({
5
- description: "获取知乎热榜",
6
- inputSchema: z.object({ limit: z.number().optional() }),
7
- keywords: ["知乎", "热榜", "zhihu", "zh"],
8
- tags: ["热搜", "社交", "知乎"],
9
- async execute(input) {
10
- const handler = (await import('../../src/handlers/zhihu-hot.js')).default;
11
- return handler(input);
12
- },
13
- });
package/commands/60s.ts DELETED
@@ -1,7 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../src/handlers/60s-news.js';
3
-
4
- export default defineCommand({
5
- description: '每日60秒新闻',
6
- execute: () => handler(),
7
- });
package/commands/bing.ts DELETED
@@ -1,7 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../src/handlers/bing-image.js';
3
-
4
- export default defineCommand({
5
- description: 'Bing 每日壁纸',
6
- execute: () => handler(),
7
- });
@@ -1,8 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../../src/handlers/douyin-hot.js';
3
-
4
- export default defineCommand({
5
- description: '抖音热搜',
6
- params: { limit: { type: 'number', default: 10 } },
7
- execute: ({ params }) => handler({ limit: Number(params.limit) }),
8
- });
@@ -1,7 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../src/handlers/duanzi.js';
3
-
4
- export default defineCommand({
5
- description: '随机段子',
6
- execute: () => handler(),
7
- });
@@ -1,8 +0,0 @@
1
- // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
- import { defineCommand } from 'zhin.js/command';
3
- import handler from "../../lib/handlers/translate.js";
4
- export default defineCommand({
5
- description: '文本翻译',
6
- params: { text: { type: 'string' } },
7
- execute: ({ params, args }) => handler({ text: String(params.text), to: args[0] != null ? String(args[0]) : undefined }),
8
- });
@@ -1,8 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../../src/handlers/translate.js';
3
-
4
- export default defineCommand({
5
- description: '文本翻译',
6
- params: { text: { type: 'string' } },
7
- execute: ({ params, args }) => handler({ text: String(params.text), to: args[0] != null ? String(args[0]) : undefined }),
8
- });
@@ -1,8 +0,0 @@
1
- // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
- import { defineCommand } from 'zhin.js/command';
3
- import handler from "../../lib/handlers/fuel-price.js";
4
- export default defineCommand({
5
- description: '今日油价',
6
- params: { province: { type: 'string' } },
7
- execute: ({ params }) => handler({ province: params.province != null ? String(params.province) : undefined }),
8
- });
@@ -1,8 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../../src/handlers/fuel-price.js';
3
-
4
- export default defineCommand({
5
- description: '今日油价',
6
- params: { province: { type: 'string' } },
7
- execute: ({ params }) => handler({ province: params.province != null ? String(params.province) : undefined }),
8
- });
package/commands/gold.ts DELETED
@@ -1,7 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../src/handlers/gold-price.js';
3
-
4
- export default defineCommand({
5
- description: '今日金价',
6
- execute: () => handler(),
7
- });
@@ -1,7 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../src/handlers/history-today.js';
3
-
4
- export default defineCommand({
5
- description: '历史上的今天',
6
- execute: () => handler(),
7
- });
@@ -1,8 +0,0 @@
1
- // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
- import { defineCommand } from 'zhin.js/command';
3
- import handler from "../../lib/handlers/hitokoto.js";
4
- export default defineCommand({
5
- description: '随机一言',
6
- params: { type: { type: 'string' } },
7
- execute: ({ params }) => handler({ type: params.type != null ? String(params.type) : undefined }),
8
- });
@@ -1,8 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../../src/handlers/hitokoto.js';
3
-
4
- export default defineCommand({
5
- description: '随机一言',
6
- params: { type: { type: 'string' } },
7
- execute: ({ params }) => handler({ type: params.type != null ? String(params.type) : undefined }),
8
- });
@@ -1,8 +0,0 @@
1
- // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
- import { defineCommand } from 'zhin.js/command';
3
- import handler from "../../lib/handlers/ip-query.js";
4
- export default defineCommand({
5
- description: 'IP 查询',
6
- params: { ip: { type: 'string' } },
7
- execute: ({ params }) => handler({ ip: params.ip != null ? String(params.ip) : undefined }),
8
- });
@@ -1,8 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../../src/handlers/ip-query.js';
3
-
4
- export default defineCommand({
5
- description: 'IP 查询',
6
- params: { ip: { type: 'string' } },
7
- execute: ({ params }) => handler({ ip: params.ip != null ? String(params.ip) : undefined }),
8
- });
package/commands/kfc.ts DELETED
@@ -1,7 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../src/handlers/kfc.js';
3
-
4
- export default defineCommand({
5
- description: 'KFC 文案',
6
- execute: () => handler(),
7
- });
package/commands/moyu.ts DELETED
@@ -1,7 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../src/handlers/moyu.js';
3
-
4
- export default defineCommand({
5
- description: '摸鱼日历',
6
- execute: () => handler(),
7
- });
@@ -1,8 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../../src/handlers/toutiao-hot.js';
3
-
4
- export default defineCommand({
5
- description: '头条热搜',
6
- params: { limit: { type: 'number', default: 10 } },
7
- execute: ({ params }) => handler({ limit: Number(params.limit) }),
8
- });
@@ -1,8 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../../src/handlers/weather.js';
3
-
4
- export default defineCommand({
5
- description: '查询城市天气',
6
- params: { city: { type: 'string' } },
7
- execute: ({ params }) => handler({ city: String(params.city) }),
8
- });
@@ -1,8 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../../src/handlers/weibo-hot.js';
3
-
4
- export default defineCommand({
5
- description: '微博热搜',
6
- params: { limit: { type: 'number', default: 10 } },
7
- execute: ({ params }) => handler({ limit: Number(params.limit) }),
8
- });
@@ -1,8 +0,0 @@
1
- import { defineCommand } from 'zhin.js/command';
2
- import handler from '../../src/handlers/zhihu-hot.js';
3
-
4
- export default defineCommand({
5
- description: '知乎热榜',
6
- params: { limit: { type: 'number', default: 10 } },
7
- execute: ({ params }) => handler({ limit: Number(params.limit) }),
8
- });
@@ -1,22 +0,0 @@
1
- /**
2
- * 60s apiBase 运行时注入 — plugin setup 注册 getter,fetchApi 每次调用时求值。
3
- * 参考 lottery 的 registerLotteryAgentDeps:registration 模式,卸载时反注册,无 process.env 残留。
4
- */
5
- export const DEFAULT_API_BASE = 'https://60s.viki.moe';
6
- const registrations = [];
7
- /** Generation-owned apiBase binding used by Plugin Runtime setup(). Returns unregister. */
8
- export function registerSixtySApiBase(getter) {
9
- const registration = Object.freeze({ value: getter });
10
- registrations.push(registration);
11
- return () => {
12
- const index = registrations.lastIndexOf(registration);
13
- if (index >= 0)
14
- registrations.splice(index, 1);
15
- };
16
- }
17
- /** Resolve the apiBase at call time so config patches take effect without reload. */
18
- export function resolveApiBase() {
19
- const getter = registrations[registrations.length - 1]?.value;
20
- return getter?.() || DEFAULT_API_BASE;
21
- }
22
- //# sourceMappingURL=runtime-deps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-deps.js","sourceRoot":"","sources":["../src/runtime-deps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAIvD,MAAM,aAAa,GAAmD,EAAE,CAAC;AAEzE,2FAA2F;AAC3F,MAAM,UAAU,qBAAqB,CAAC,MAA2B;IAC/D,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACtD,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,MAAM,KAAK,GAAG,aAAa,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACtD,IAAI,KAAK,IAAI,CAAC;YAAE,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,cAAc;IAC5B,MAAM,MAAM,GAAG,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC;IAC9D,OAAO,MAAM,EAAE,EAAE,IAAI,gBAAgB,CAAC;AACxC,CAAC"}
@@ -1,26 +0,0 @@
1
- /**
2
- * 60s apiBase 运行时注入 — plugin setup 注册 getter,fetchApi 每次调用时求值。
3
- * 参考 lottery 的 registerLotteryAgentDeps:registration 模式,卸载时反注册,无 process.env 残留。
4
- */
5
-
6
- export const DEFAULT_API_BASE = 'https://60s.viki.moe';
7
-
8
- export type SixtySApiBaseGetter = () => string;
9
-
10
- const registrations: Array<{ readonly value: SixtySApiBaseGetter }> = [];
11
-
12
- /** Generation-owned apiBase binding used by Plugin Runtime setup(). Returns unregister. */
13
- export function registerSixtySApiBase(getter: SixtySApiBaseGetter): () => void {
14
- const registration = Object.freeze({ value: getter });
15
- registrations.push(registration);
16
- return () => {
17
- const index = registrations.lastIndexOf(registration);
18
- if (index >= 0) registrations.splice(index, 1);
19
- };
20
- }
21
-
22
- /** Resolve the apiBase at call time so config patches take effect without reload. */
23
- export function resolveApiBase(): string {
24
- const getter = registrations[registrations.length - 1]?.value;
25
- return getter?.() || DEFAULT_API_BASE;
26
- }