@zhin.js/plugin-word-riddle 1.0.1 → 1.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.
Files changed (64) hide show
  1. package/commands/riddle/[action:string=].ts +15 -0
  2. package/lib/engine.d.ts +0 -1
  3. package/lib/game-flow.d.ts +6 -7
  4. package/lib/game-flow.js +22 -15
  5. package/lib/game-flow.js.map +1 -1
  6. package/lib/index.d.ts +8 -2
  7. package/lib/index.js +8 -25
  8. package/lib/index.js.map +1 -1
  9. package/lib/memory-db.d.ts +6 -0
  10. package/lib/memory-db.js +18 -0
  11. package/lib/memory-db.js.map +1 -0
  12. package/lib/models.d.ts +5 -4
  13. package/lib/models.js +2 -2
  14. package/lib/models.js.map +1 -1
  15. package/lib/riddle-command.d.ts +4 -3
  16. package/lib/riddle-command.js +5 -1
  17. package/lib/riddle-command.js.map +1 -1
  18. package/lib/riddle-provider.d.ts +0 -1
  19. package/lib/riddle-provider.js +1 -1
  20. package/lib/riddle-provider.js.map +1 -1
  21. package/lib/riddles-catalog.d.ts +0 -1
  22. package/lib/runtime-store.d.ts +6 -0
  23. package/lib/runtime-store.js +7 -0
  24. package/lib/runtime-store.js.map +1 -0
  25. package/lib/session-service.d.ts +1 -3
  26. package/lib/session-service.js +1 -4
  27. package/lib/session-service.js.map +1 -1
  28. package/lib/view.d.ts +1 -2
  29. package/lib/view.js +1 -1
  30. package/lib/view.js.map +1 -1
  31. package/middlewares/riddle-alias.ts +18 -0
  32. package/middlewares/riddle-text.ts +75 -0
  33. package/package.json +36 -10
  34. package/plugin.ts +64 -0
  35. package/schema.json +6 -0
  36. package/src/game-flow.ts +26 -22
  37. package/src/index.ts +9 -30
  38. package/src/memory-db.ts +22 -0
  39. package/src/models.ts +7 -4
  40. package/src/riddle-command.ts +12 -3
  41. package/src/riddle-provider.ts +1 -1
  42. package/src/runtime-store.ts +9 -0
  43. package/src/session-service.ts +2 -5
  44. package/src/view.ts +2 -2
  45. package/lib/commands.d.ts +0 -6
  46. package/lib/commands.d.ts.map +0 -1
  47. package/lib/commands.js +0 -95
  48. package/lib/commands.js.map +0 -1
  49. package/lib/engine.d.ts.map +0 -1
  50. package/lib/game-flow.d.ts.map +0 -1
  51. package/lib/hub-register.d.ts +0 -5
  52. package/lib/hub-register.d.ts.map +0 -1
  53. package/lib/hub-register.js +0 -32
  54. package/lib/hub-register.js.map +0 -1
  55. package/lib/index.d.ts.map +0 -1
  56. package/lib/models.d.ts.map +0 -1
  57. package/lib/riddle-command.d.ts.map +0 -1
  58. package/lib/riddle-provider.d.ts.map +0 -1
  59. package/lib/riddles-catalog.d.ts.map +0 -1
  60. package/lib/session-service.d.ts.map +0 -1
  61. package/lib/view.d.ts.map +0 -1
  62. package/plugin.yml +0 -2
  63. package/src/commands.ts +0 -116
  64. package/src/hub-register.ts +0 -34
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zhin.js/plugin-word-riddle",
3
- "version": "1.0.1",
4
- "description": "Zhin.js 猜谜 — 字谜与猜成语",
3
+ "version": "1.0.3",
4
+ "description": "Zhin.js 猜谜 — 字谜与猜成语 (Plugin Runtime)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
7
7
  "types": "./lib/index.d.ts",
@@ -14,22 +14,26 @@
14
14
  "./package.json": "./package.json"
15
15
  },
16
16
  "files": [
17
+ "plugin.ts",
18
+ "schema.json",
19
+ "commands",
20
+ "middlewares",
17
21
  "src",
18
22
  "lib",
19
- "plugin.yml",
20
23
  "README.md"
21
24
  ],
22
25
  "license": "MIT",
23
- "peerDependencies": {
24
- "zhin.js": "4.1.2"
25
- },
26
26
  "dependencies": {
27
27
  "chinese-idiom-chengyu": "^1.1.0",
28
- "@zhin.js/game-shared": "1.0.1"
28
+ "@zhin.js/command": "1.0.2",
29
+ "@zhin.js/core": "1.4.0",
30
+ "@zhin.js/game-kit": "2.0.0",
31
+ "@zhin.js/middleware": "1.0.2",
32
+ "@zhin.js/plugin-runtime": "1.1.0"
29
33
  },
30
34
  "devDependencies": {
31
35
  "typescript": "^6.0.3",
32
- "zhin.js": "4.1.2"
36
+ "vitest": "^4.1.10"
33
37
  },
34
38
  "repository": {
35
39
  "type": "git",
@@ -40,9 +44,31 @@
40
44
  "access": "public",
41
45
  "registry": "https://registry.npmjs.org"
42
46
  },
47
+ "engines": {
48
+ "node": "^20.19.0 || >=22.12.0"
49
+ },
50
+ "zhin": {
51
+ "protocol": 1,
52
+ "type": "plugin",
53
+ "entry": "./plugin.ts",
54
+ "engine": "^1.0.0",
55
+ "runtime": "trusted",
56
+ "features": [
57
+ {
58
+ "package": "@zhin.js/command",
59
+ "api": "^1.0.0"
60
+ },
61
+ {
62
+ "package": "@zhin.js/middleware",
63
+ "api": "^1.0.0"
64
+ }
65
+ ],
66
+ "plugins": []
67
+ },
43
68
  "scripts": {
44
69
  "build:data": "node scripts/build-char-riddles.mjs",
45
- "build": "pnpm run build:data && tsc --build && node -e \"import('node:fs/promises').then(fs=>fs.mkdir('lib/data',{recursive:true}).then(()=>fs.copyFile('src/data/char-riddles.json','lib/data/char-riddles.json')))\"",
46
- "clean": "rimraf lib"
70
+ "build": "pnpm run build:data && tsc && node -e \"import('node:fs/promises').then(fs=>fs.mkdir('lib/data',{recursive:true}).then(()=>fs.copyFile('src/data/char-riddles.json','lib/data/char-riddles.json')))\"",
71
+ "clean": "rimraf lib",
72
+ "test": "NODE_OPTIONS=--experimental-strip-types vitest run --root ../../.. plugins/games/word-riddle/tests"
47
73
  }
48
74
  }
package/plugin.ts ADDED
@@ -0,0 +1,64 @@
1
+ import { definePlugin, databaseHostToken, scheduleHostToken } from '@zhin.js/plugin-runtime';
2
+ import {
3
+ registerRuntimeGame,
4
+ initGameRecordHost,
5
+ DEFAULT_GAME_STALE_CRON,
6
+ DEFAULT_GAME_STALE_IDLE_MS,
7
+ } from '@zhin.js/game-kit';
8
+ import { mountRiddleHostServices, mountRiddleMemoryServices } from './src/memory-db.js';
9
+ import { gameServicesToken } from './src/runtime-store.js';
10
+ import type { SessionService } from './src/session-service.js';
11
+
12
+ /**
13
+ * Plugin Runtime:
14
+ * - Commands under `commands/` are authoritative (help + start/continue/quit via in-memory DB).
15
+ * - DB: prefer databaseHostToken; else in-memory SessionService.
16
+ * - Text middleware under `middlewares/` handles answer payloads.
17
+ */
18
+ export default definePlugin({
19
+ name: 'word-riddle',
20
+ metadata: {
21
+ displayName: 'Word Riddle',
22
+ },
23
+ setup(context) {
24
+ let services: SessionService;
25
+ if (context.resources.has(databaseHostToken)) {
26
+ const host = context.resources.use(databaseHostToken);
27
+ services = mountRiddleHostServices(host);
28
+ context.lifecycle.add(initGameRecordHost(host));
29
+ } else {
30
+ services = mountRiddleMemoryServices();
31
+ }
32
+ context.resources.provide(gameServicesToken, services);
33
+ const disposeHub = registerRuntimeGame({
34
+ id: 'riddle',
35
+ title: '猜谜',
36
+ icon: '🧩',
37
+ description: '字谜 + 成语猜谜',
38
+ commandPrefix: '/猜谜',
39
+ quickStart: '开始',
40
+ aliases: ['riddle'],
41
+ menus: [
42
+ { id: 'char', label: '🔤 字谜模式' },
43
+ { id: 'idiom', label: '📜 成语模式' },
44
+ { id: 'continue', label: '🔄 继续' },
45
+ { id: 'help', label: '📖 玩法说明' },
46
+ ],
47
+ });
48
+ context.lifecycle.add(disposeHub);
49
+
50
+ if (context.resources.has(scheduleHostToken)) {
51
+ const schedule = context.resources.use(scheduleHostToken);
52
+ const disposeCron = schedule.register({
53
+ id: 'riddle/abort-stale',
54
+ cron: DEFAULT_GAME_STALE_CRON,
55
+ description: 'Abort stale word-riddle sessions',
56
+ async execute() {
57
+ if (!services.abortStale) return;
58
+ await services.abortStale(DEFAULT_GAME_STALE_IDLE_MS);
59
+ },
60
+ });
61
+ context.lifecycle.add(disposeCron);
62
+ }
63
+ },
64
+ });
package/schema.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "properties": {}
6
+ }
package/src/game-flow.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { Adapter, Message, Plugin } from 'zhin.js';
1
+ import type { Adapter, Message, Plugin } from '@zhin.js/core';
2
+ import { plainTextFromSendContent } from '@zhin.js/game-kit';
2
3
  import {
3
4
  checkAnswer,
4
5
  getRiddleById,
@@ -15,17 +16,19 @@ import {
15
16
  import { buildRiddleView, MAX_WRONG } from './view.js';
16
17
 
17
18
  export async function sendOrEditView(
18
- plugin: Plugin,
19
+ plugin: Plugin | null,
19
20
  services: SessionService,
20
21
  message: Message<any>,
21
22
  session: RiddleSessionRow,
22
23
  eventLines: string[] = [],
23
- ): Promise<void> {
24
+ ): Promise<string | void> {
24
25
  const content = buildRiddleView(session, eventLines, message.$channel.type);
25
26
  if (typeof content === 'string') {
27
+ if (!plugin) return content;
26
28
  await message.$reply?.(content);
27
29
  return;
28
30
  }
31
+ if (!plugin) return plainTextFromSendContent(content);
29
32
 
30
33
  const adapter = plugin.root.inject(message.$adapter) as Adapter;
31
34
  if (session.board_message_id) {
@@ -62,7 +65,7 @@ async function advanceQuestion(
62
65
  }
63
66
 
64
67
  export async function startGame(
65
- plugin: Plugin,
68
+ plugin: Plugin | null,
66
69
  services: SessionService,
67
70
  message: Message<any>,
68
71
  mode: RiddleType,
@@ -77,12 +80,12 @@ export async function startGame(
77
80
  }
78
81
 
79
82
  const session = await services.createSession(message, mode);
80
- await sendOrEditView(plugin, services, message, session);
81
- return undefined;
83
+ const text = await sendOrEditView(plugin, services, message, session);
84
+ return typeof text === 'string' ? text : undefined;
82
85
  }
83
86
 
84
87
  export async function continueGame(
85
- plugin: Plugin,
88
+ plugin: Plugin | null,
86
89
  services: SessionService,
87
90
  message: Message<any>,
88
91
  ): Promise<string> {
@@ -91,12 +94,13 @@ export async function continueGame(
91
94
  message.$sender.id,
92
95
  );
93
96
  if (!session) return '你没有进行中的猜谜,发送「猜谜 开始」。';
94
- await sendOrEditView(plugin, services, message, session);
97
+ const text = await sendOrEditView(plugin, services, message, session);
98
+ if (typeof text === 'string') return text;
95
99
  return '已刷新猜谜界面。';
96
100
  }
97
101
 
98
102
  export async function processAnswerText(
99
- plugin: Plugin,
103
+ plugin: Plugin | null,
100
104
  services: SessionService,
101
105
  message: Message<any>,
102
106
  raw: string,
@@ -120,32 +124,29 @@ export async function processAnswerText(
120
124
  });
121
125
  const after = await advanceQuestion(services, (await services.getById(session.id))!);
122
126
  const explain = entry.explanation ? `\n📖 ${entry.explanation}` : '';
123
- await sendOrEditView(plugin, services, message, after, [
127
+ return (await sendOrEditView(plugin, services, message, after, [
124
128
  `✅ 正确!答案:**${entry.answer}**${explain}`,
125
129
  `+${10 + Math.min(streak, 5)} 分`,
126
- ]);
127
- return null;
130
+ ])) ?? null;
128
131
  }
129
132
 
130
133
  const wrong = session.wrong_count + 1;
131
134
  if (wrong >= MAX_WRONG) {
132
135
  await services.updateSession(session.id, { wrong_count: wrong, streak: 0 });
133
136
  const after = await advanceQuestion(services, (await services.getById(session.id))!);
134
- await sendOrEditView(plugin, services, message, after, [
137
+ return (await sendOrEditView(plugin, services, message, after, [
135
138
  `❌ 本题答案:**${entry.answer}**`,
136
139
  '失误过多,自动下一题。',
137
- ]);
138
- return null;
140
+ ])) ?? null;
139
141
  }
140
142
 
141
143
  await services.updateSession(session.id, { wrong_count: wrong, streak: 0 });
142
144
  const updated = (await services.getById(session.id))!;
143
- await sendOrEditView(plugin, services, message, updated, ['❌ 不对,再想想!']);
144
- return null;
145
+ return (await sendOrEditView(plugin, services, message, updated, ['❌ 不对,再想想!'])) ?? null;
145
146
  }
146
147
 
147
148
  export async function handleChoice(
148
- plugin: Plugin,
149
+ plugin: Plugin | null,
149
150
  services: SessionService,
150
151
  message: Message<any>,
151
152
  sessionId: string,
@@ -174,15 +175,18 @@ export async function handleChoice(
174
175
  const hint = entry.hint ?? `答案共 ${entry.answer.length} 个字`;
175
176
  await services.updateSession(session.id, { hints_used: session.hints_used + 1, streak: 0 });
176
177
  const updated = (await services.getById(session.id))!;
177
- await sendOrEditView(plugin, services, message, updated, [`💡 提示:${hint}`, '(连击清零)']);
178
- return null;
178
+ return (await sendOrEditView(plugin, services, message, updated, [
179
+ `💡 提示:${hint}`,
180
+ '(连击清零)',
181
+ ])) ?? null;
179
182
  }
180
183
 
181
184
  if (choiceId === 'skip') {
182
185
  await services.updateSession(session.id, { streak: 0 });
183
186
  const after = await advanceQuestion(services, session);
184
- await sendOrEditView(plugin, services, message, after, [`⏭️ 跳过,答案:**${entry.answer}**`]);
185
- return null;
187
+ return (await sendOrEditView(plugin, services, message, after, [
188
+ `⏭️ 跳过,答案:**${entry.answer}**`,
189
+ ])) ?? null;
186
190
  }
187
191
 
188
192
  if (choiceId === 'quit') {
package/src/index.ts CHANGED
@@ -1,30 +1,9 @@
1
- import { formatCompact, usePlugin, type DatabaseFeature } from 'zhin.js';
2
- import { registerModels } from './models.js';
3
- import { createServices, resolveGameDatabase, type SessionService } from './session-service.js';
4
- import { registerCommands, registerInteractive, registerTextMiddleware } from './commands.js';
5
- import { registerRiddleHub } from './hub-register.js';
6
-
7
- const plugin = usePlugin();
8
- const { logger, useContext, addSchedule } = plugin;
9
-
10
- registerModels(plugin);
11
-
12
- let services: SessionService | null = null;
13
-
14
- useContext('database', (dbFeature: DatabaseFeature) => {
15
- services = createServices(resolveGameDatabase(dbFeature));
16
- logger.debug(formatCompact({ 模块: '猜谜', 数据模型: '已就绪' }));
17
- });
18
-
19
- registerRiddleHub(() => services);
20
- registerCommands(plugin, () => services);
21
- registerInteractive(plugin, () => services);
22
- registerTextMiddleware(plugin, () => services);
23
-
24
- addSchedule({ kind: 'solar', cron: '0 */15 * * * *' }, async () => {
25
- if (!services) return;
26
- const n = await services.abortStale(45 * 60 * 1000);
27
- if (n > 0) logger.debug(formatCompact({ 猜谜: '清理超时局', count: n }));
28
- });
29
-
30
- logger.debug(formatCompact({ 模块: '猜谜', 状态: '已加载' }));
1
+ export { RIDDLE_HELP } from './riddle-command.js';
2
+ export { gameServicesToken, resolveGameServices } from './runtime-store.js';
3
+ export { createInMemoryRiddleDb, mountRiddleMemoryServices } from './memory-db.js';
4
+
5
+ /**
6
+ * 已由 plugin.ts 接线:commands/ 命令、middlewares/ 文本与选项中间件、
7
+ * 游戏大厅注册(registerRuntimeGame)、过期会话 cron(scheduleHostToken)、
8
+ * host DatabaseHost(databaseHostToken)。仍未接:interactive 按钮回调。
9
+ */
@@ -0,0 +1,22 @@
1
+ import { createHostGameDb, createInMemoryGameDb } from '@zhin.js/game-kit';
2
+ import type { DatabaseHost } from '@zhin.js/plugin-runtime';
3
+ import { defineHostTables } from './models.js';
4
+ import { createServices, type RiddleDatabase, type SessionService } from './session-service.js';
5
+
6
+ const RIDDLE_TABLES = ['word_riddle_sessions'] as const;
7
+
8
+ /** In-memory word_riddle_sessions for Plugin Runtime slice-2 (no DatabaseFeature). */
9
+ export function createInMemoryRiddleDb(): RiddleDatabase {
10
+ return createInMemoryGameDb(RIDDLE_TABLES) as unknown as RiddleDatabase;
11
+ }
12
+
13
+ export function mountRiddleMemoryServices(): SessionService {
14
+ const services = createServices(createInMemoryRiddleDb());
15
+ return services;
16
+ }
17
+
18
+ export function mountRiddleHostServices(host: DatabaseHost): SessionService {
19
+ defineHostTables(host);
20
+ const services = createServices(createHostGameDb(host, RIDDLE_TABLES) as unknown as RiddleDatabase);
21
+ return services;
22
+ }
package/src/models.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { Models, Plugin } from 'zhin.js';
1
+ import type { Models } from '@zhin.js/core';
2
2
 
3
3
  export type RiddleSessionStatus = 'active' | 'completed' | 'aborted';
4
4
 
5
- declare module 'zhin.js' {
5
+ declare module '@zhin.js/core' {
6
6
  interface Models {
7
7
  word_riddle_sessions: {
8
8
  id: string;
@@ -31,8 +31,11 @@ declare module 'zhin.js' {
31
31
 
32
32
  export type RiddleSessionRow = Models['word_riddle_sessions'];
33
33
 
34
- export function registerModels(plugin: Plugin): void {
35
- plugin.defineModel('word_riddle_sessions', {
34
+
35
+ export function defineHostTables(
36
+ db: { define: (name: string, definition: Record<string, unknown>) => void },
37
+ ): void {
38
+ db.define('word_riddle_sessions', {
36
39
  id: { type: 'text', primary: true },
37
40
  adapter: { type: 'text', nullable: false },
38
41
  endpoint: { type: 'text', nullable: false },
@@ -1,5 +1,5 @@
1
- import type { Message, Plugin } from 'zhin.js';
2
- import { channelKey } from '@zhin.js/game-shared';
1
+ import type { Message, Plugin } from '@zhin.js/core';
2
+ import { channelKey } from '@zhin.js/game-kit';
3
3
  import { continueGame, startGame } from './game-flow.js';
4
4
  import { riddleCount, type RiddleType } from './riddles-catalog.js';
5
5
 
@@ -29,7 +29,7 @@ function parseMode(action: string): RiddleType | null {
29
29
  }
30
30
 
31
31
  export async function runRiddleCommand(
32
- plugin: Plugin,
32
+ plugin: Plugin | null,
33
33
  services: SessionService,
34
34
  message: Message<any>,
35
35
  action: string,
@@ -64,3 +64,12 @@ export async function runRiddleCommand(
64
64
 
65
65
  return `未知子命令:${action}\n\n${RIDDLE_HELP}`;
66
66
  }
67
+
68
+ /** Plugin Runtime / smoke: text-only, no Adapter.editMessage. */
69
+ export async function runRiddleCommandText(
70
+ services: SessionService,
71
+ message: Message<any>,
72
+ action: string,
73
+ ): Promise<string> {
74
+ return (await runRiddleCommand(null, services, message, action)) ?? '';
75
+ }
@@ -7,7 +7,7 @@ import { readFileSync } from 'node:fs';
7
7
  import { dirname, join } from 'node:path';
8
8
  import { fileURLToPath } from 'node:url';
9
9
  import { createRequire } from 'node:module';
10
- import { secureRandomInt } from '@zhin.js/game-shared';
10
+ import { secureRandomInt } from '@zhin.js/game-kit';
11
11
 
12
12
  export type RiddleType = 'char' | 'idiom';
13
13
 
@@ -0,0 +1,9 @@
1
+ import { createToken } from '@zhin.js/plugin-runtime';
2
+ import type { SessionService } from './session-service.js';
3
+
4
+ /** Owner-scoped service consumed by discovered commands and middleware. */
5
+ export const gameServicesToken = createToken<SessionService>('zhin.game.word-riddle.services');
6
+
7
+ export function resolveGameServices(context: { use<T>(token: typeof gameServicesToken): T }): SessionService {
8
+ return context.use(gameServicesToken) as SessionService;
9
+ }
@@ -1,5 +1,5 @@
1
- import type { Database, DatabaseFeature, Message, Models, RelatedModel } from 'zhin.js';
2
- import { channelKey, generateSessionId, boardMessageMatches } from '@zhin.js/game-shared';
1
+ import type { Database, Message, Models, RelatedModel } from '@zhin.js/core';
2
+ import { channelKey, generateSessionId, boardMessageMatches } from '@zhin.js/game-kit';
3
3
  import { pickRoundQueue, type RiddleType } from './riddles-catalog.js';
4
4
  import type { RiddleSessionRow } from './models.js';
5
5
 
@@ -101,9 +101,6 @@ export function createServices(db: RiddleDatabase): SessionService {
101
101
  return new SessionService(db);
102
102
  }
103
103
 
104
- export function resolveGameDatabase(feature: DatabaseFeature): RiddleDatabase {
105
- return feature.db;
106
- }
107
104
 
108
105
  export function currentRiddleId(session: RiddleSessionRow): string | null {
109
106
  const queue = parseQueue(session.queue);
package/src/view.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { buildChoiceKeyboard } from '@zhin.js/game-shared';
2
- import type { SendContent } from 'zhin.js';
1
+ import { buildChoiceKeyboard } from '@zhin.js/game-kit';
2
+ import type { SendContent } from '@zhin.js/core';
3
3
  import { getRiddleById, RIDDLE_PREFIX, typeLabel } from './engine.js';
4
4
  import type { RiddleSessionRow } from './models.js';
5
5
  import { currentRiddleId, parseQueue } from './session-service.js';
package/lib/commands.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { type Plugin } from 'zhin.js';
2
- import type { SessionService } from './session-service.js';
3
- export declare function registerCommands(plugin: Plugin, getServices: () => SessionService | null): void;
4
- export declare function registerInteractive(plugin: Plugin, getServices: () => SessionService | null): void;
5
- export declare function registerTextMiddleware(plugin: Plugin, getServices: () => SessionService | null): void;
6
- //# sourceMappingURL=commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAYrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAsB3D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAG/F;AAgBD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAUlG;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAkDrG"}
package/lib/commands.js DELETED
@@ -1,95 +0,0 @@
1
- import { MessageCommand, getActionFromMessage } from 'zhin.js';
2
- import { buildChoiceFallbackMap, channelKey, normalizeRiddleAction, parseChoicePayload, registerGameTextMiddleware, resolveGameChoice, resolveGameTextPayload, } from '@zhin.js/game-shared';
3
- import { handleChoice, processAnswerText, RIDDLE_PREFIX } from './game-flow.js';
4
- import { runRiddleCommand } from './riddle-command.js';
5
- const VALID_CHOICES = ['hint', 'skip', 'quit', 'restart_char', 'restart_idiom'];
6
- function registerPattern(plugin, pattern, desc, getServices) {
7
- plugin.addCommand(new MessageCommand(pattern)
8
- .desc(desc)
9
- .action(async (message, result) => {
10
- const services = getServices();
11
- if (!services)
12
- return '猜谜需要启用 database 配置。';
13
- const raw = result.params.action ?? '';
14
- return runRiddleCommand(plugin, services, message, normalizeRiddleAction(raw));
15
- }));
16
- }
17
- export function registerCommands(plugin, getServices) {
18
- registerPattern(plugin, '/riddle [action:word]', '猜谜(riddle)', getServices);
19
- registerPattern(plugin, '/猜谜 [action:word]', '猜谜(中文)', getServices);
20
- }
21
- async function resolveChoice(message, services) {
22
- return resolveGameChoice({
23
- message,
24
- gamePrefix: RIDDLE_PREFIX,
25
- validChoiceIds: VALID_CHOICES,
26
- getById: (id) => services.getById(id),
27
- getActiveForUser: (ch, uid) => services.getActiveForUser(ch, uid),
28
- getByBoardMessageId: (mid) => services.getActiveByBoardMessageId(mid),
29
- });
30
- }
31
- export function registerInteractive(plugin, getServices) {
32
- plugin.registerInteractiveHandler(`${RIDDLE_PREFIX}:`, async (message) => {
33
- const services = getServices();
34
- if (!services)
35
- return false;
36
- const choice = await resolveChoice(message, services);
37
- if (!choice)
38
- return false;
39
- const err = await handleChoice(plugin, services, message, choice.sessionId, choice.choiceId);
40
- if (typeof err === 'string')
41
- await message.$reply?.(err);
42
- return true;
43
- });
44
- }
45
- export function registerTextMiddleware(plugin, getServices) {
46
- registerGameTextMiddleware(plugin, async (message, next) => {
47
- const services = getServices();
48
- if (!services)
49
- return next();
50
- const action = getActionFromMessage(message);
51
- if (action?.payload.startsWith(`${RIDDLE_PREFIX}:`))
52
- return next();
53
- const ch = channelKey(message);
54
- const raw = message.$raw?.trim() ?? '';
55
- if (!raw)
56
- return next();
57
- const payloadFromText = resolveGameTextPayload(raw);
58
- if (payloadFromText?.startsWith(`${RIDDLE_PREFIX}:`)) {
59
- const parsed = parseChoicePayload(payloadFromText, RIDDLE_PREFIX);
60
- if (parsed) {
61
- const session = await services.getById(parsed.sessionId);
62
- if (session?.channel_key === ch) {
63
- const err = await handleChoice(plugin, services, message, parsed.sessionId, parsed.choiceId);
64
- if (typeof err === 'string')
65
- await message.$reply?.(err);
66
- return;
67
- }
68
- }
69
- }
70
- const session = await services.getActiveForUser(ch, message.$sender.id);
71
- if (!session)
72
- return next();
73
- if (session.status === 'active') {
74
- const map = buildChoiceFallbackMap(RIDDLE_PREFIX, session.id, [
75
- { id: 'hint', label: '提示' },
76
- { id: 'skip', label: '跳过' },
77
- { id: 'quit', label: '结束' },
78
- ]);
79
- const payload = resolveGameTextPayload(raw, map);
80
- const parsed = payload ? parseChoicePayload(payload, RIDDLE_PREFIX) : null;
81
- if (parsed?.sessionId === session.id) {
82
- const err = await handleChoice(plugin, services, message, session.id, parsed.choiceId);
83
- if (typeof err === 'string')
84
- await message.$reply?.(err);
85
- return;
86
- }
87
- }
88
- if (/^[\u4e00-\u9fff]{1,8}$/.test(raw)) {
89
- await processAnswerText(plugin, services, message, raw);
90
- return;
91
- }
92
- return next();
93
- }, 'word-riddle:text');
94
- }
95
- //# sourceMappingURL=commands.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,cAAc,EAAE,oBAAoB,EAAe,MAAM,SAAS,CAAC;AACrF,OAAO,EACL,sBAAsB,EACtB,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,0BAA0B,EAC1B,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,CAAU,CAAC;AAEzF,SAAS,eAAe,CACtB,MAAc,EACd,OAAe,EACf,IAAY,EACZ,WAAwC;IAExC,MAAM,CAAC,UAAU,CACf,IAAI,cAAc,CAAC,OAAO,CAAC;SACxB,IAAI,CAAC,IAAI,CAAC;SACV,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;QAChC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,QAAQ;YAAE,OAAO,qBAAqB,CAAC;QAC5C,MAAM,GAAG,GAAI,MAAM,CAAC,MAAM,CAAC,MAA6B,IAAI,EAAE,CAAC;QAC/D,OAAO,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;IACjF,CAAC,CAAC,CACL,CAAC;AACJ,CAAC;AAED,MAAM,UAA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AC;YACxD,OAAO;QACT,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,EAAE,kBAAkB,CAAC,CAAC;AACzB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,eAAO,MAAM,aAAa,WAAW,CAAC;AAEtC,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,EAAE,CAGvD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAIpE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAElD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"game-flow.d.ts","sourceRoot":"","sources":["../src/game-flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAGL,aAAa,EAEd,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAG9B,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,OAAO,EAAE,gBAAgB,EACzB,UAAU,GAAE,MAAM,EAAO,GACxB,OAAO,CAAC,IAAI,CAAC,CAyBf;AAgBD,wBAAsB,SAAS,CAC7B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAa7B;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GACpB,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0CxB;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAyCxB;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,5 +0,0 @@
1
- import { RIDDLE_HELP } from './riddle-command.js';
2
- import type { SessionService } from './session-service.js';
3
- export declare function registerRiddleHub(getServices: () => SessionService | null): () => void;
4
- export { RIDDLE_HELP };
5
- //# sourceMappingURL=hub-register.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hub-register.d.ts","sourceRoot":"","sources":["../src/hub-register.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,cAAc,GAAG,IAAI,GAAG,MAAM,IAAI,CAuBtF;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,32 +0,0 @@
1
- import { getPlugin } from 'zhin.js';
2
- import { ensureGameHubService } from '@zhin.js/game-shared';
3
- import { riddleCount } from './riddles-catalog.js';
4
- import { runRiddleCommand, RIDDLE_HELP } from './riddle-command.js';
5
- const counts = riddleCount();
6
- export function registerRiddleHub(getServices) {
7
- const plugin = getPlugin();
8
- ensureGameHubService(plugin);
9
- return plugin.registerGame({
10
- id: 'riddle',
11
- title: '猜谜',
12
- icon: '🧩',
13
- description: `字谜 ${counts.char.toLocaleString('zh-CN')} 题 + 成语 ${counts.idiom.toLocaleString('zh-CN')} 题`,
14
- commandPrefix: '/猜谜',
15
- quickStart: '开始',
16
- aliases: ['riddle'],
17
- menus: [
18
- { id: 'char', label: '🔤 字谜模式', style: 'primary' },
19
- { id: 'idiom', label: '📜 成语模式' },
20
- { id: 'continue', label: '🔄 继续' },
21
- { id: 'help', label: '📖 玩法说明' },
22
- ],
23
- runAction: async (actionId, ctx) => {
24
- const services = getServices();
25
- if (!services)
26
- return '猜谜需要启用 database 配置。';
27
- return runRiddleCommand(ctx.plugin, services, ctx.message, actionId === 'start' ? 'char' : actionId);
28
- },
29
- });
30
- }
31
- export { RIDDLE_HELP };
32
- //# sourceMappingURL=hub-register.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hub-register.js","sourceRoot":"","sources":["../src/hub-register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGpE,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC;AAE7B,MAAM,UAAU,iBAAiB,CAAC,WAAwC;IACxE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC,YAAY,CAAC;QACzB,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI;QACzG,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,KAAK,EAAE;YACL,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;YAClD,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE;YACjC,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE;YAClC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;SACjC;QACD,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE;YACjC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;YAC/B,IAAI,CAAC,QAAQ;gBAAE,OAAO,qBAAqB,CAAC;YAC5C,OAAO,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACvG,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,O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C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA8B7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"riddle-provider.d.ts","sourceRoot":"","sources":["../src/riddle-provider.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAuDD,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,EAAE,CAE7D;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAIjE;AAED,wBAAgB,WAAW,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAI5E;AAED,sCAAsC;AACtC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,SAAsB,GAAG,WAAW,EAAE,CAU3F"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"riddles-catalog.d.ts","sourceRoot":"","sources":["../src/riddles-catalog.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EACL,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,aAAa,GACd,MAAM,sBAAsB,CAAC"}