@zhin.js/plugin-text-adventure 1.0.0 → 1.0.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 (78) hide show
  1. package/commands/adv/[action:string=].ts +15 -0
  2. package/lib/achievements.d.ts +0 -1
  3. package/lib/adv-command.d.ts +4 -3
  4. package/lib/adv-command.js +5 -1
  5. package/lib/adv-command.js.map +1 -1
  6. package/lib/game-flow.d.ts +5 -6
  7. package/lib/game-flow.js +15 -8
  8. package/lib/game-flow.js.map +1 -1
  9. package/lib/index.d.ts +8 -2
  10. package/lib/index.js +6 -34
  11. package/lib/index.js.map +1 -1
  12. package/lib/memory-db.d.ts +6 -0
  13. package/lib/memory-db.js +18 -0
  14. package/lib/memory-db.js.map +1 -0
  15. package/lib/models.d.ts +5 -4
  16. package/lib/models.js +3 -3
  17. package/lib/models.js.map +1 -1
  18. package/lib/profile-format.d.ts +0 -1
  19. package/lib/profile-parse.d.ts +0 -1
  20. package/lib/profile-service.d.ts +0 -1
  21. package/lib/runtime-store.d.ts +6 -0
  22. package/lib/runtime-store.js +7 -0
  23. package/lib/runtime-store.js.map +1 -0
  24. package/lib/scene-view.d.ts +2 -3
  25. package/lib/scene-view.js +4 -2
  26. package/lib/scene-view.js.map +1 -1
  27. package/lib/session-service.d.ts +1 -3
  28. package/lib/session-service.js +3 -14
  29. package/lib/session-service.js.map +1 -1
  30. package/lib/story-catalog.d.ts +0 -1
  31. package/lib/story-items.d.ts +0 -1
  32. package/lib/story-path.d.ts +0 -1
  33. package/lib/story-scenes.d.ts +0 -1
  34. package/lib/story-transitions.d.ts +0 -1
  35. package/lib/story-types.d.ts +0 -1
  36. package/lib/story.d.ts +0 -1
  37. package/middlewares/adv-alias.ts +18 -0
  38. package/middlewares/adv-choice.ts +70 -0
  39. package/package.json +36 -18
  40. package/plugin.ts +65 -0
  41. package/schema.json +6 -0
  42. package/src/adv-command.ts +12 -3
  43. package/src/game-flow.ts +18 -13
  44. package/src/index.ts +7 -45
  45. package/src/memory-db.ts +22 -0
  46. package/src/models.ts +8 -6
  47. package/src/profile-service.ts +1 -1
  48. package/src/runtime-store.ts +9 -0
  49. package/src/scene-view.ts +5 -2
  50. package/src/session-service.ts +4 -12
  51. package/lib/achievements.d.ts.map +0 -1
  52. package/lib/adv-command.d.ts.map +0 -1
  53. package/lib/commands.d.ts +0 -6
  54. package/lib/commands.d.ts.map +0 -1
  55. package/lib/commands.js +0 -96
  56. package/lib/commands.js.map +0 -1
  57. package/lib/game-flow.d.ts.map +0 -1
  58. package/lib/hub-register.d.ts +0 -5
  59. package/lib/hub-register.d.ts.map +0 -1
  60. package/lib/hub-register.js +0 -25
  61. package/lib/hub-register.js.map +0 -1
  62. package/lib/index.d.ts.map +0 -1
  63. package/lib/models.d.ts.map +0 -1
  64. package/lib/profile-format.d.ts.map +0 -1
  65. package/lib/profile-parse.d.ts.map +0 -1
  66. package/lib/profile-service.d.ts.map +0 -1
  67. package/lib/scene-view.d.ts.map +0 -1
  68. package/lib/session-service.d.ts.map +0 -1
  69. package/lib/story-catalog.d.ts.map +0 -1
  70. package/lib/story-items.d.ts.map +0 -1
  71. package/lib/story-path.d.ts.map +0 -1
  72. package/lib/story-scenes.d.ts.map +0 -1
  73. package/lib/story-transitions.d.ts.map +0 -1
  74. package/lib/story-types.d.ts.map +0 -1
  75. package/lib/story.d.ts.map +0 -1
  76. package/plugin.yml +0 -2
  77. package/src/commands.ts +0 -133
  78. package/src/hub-register.ts +0 -32
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zhin.js/plugin-text-adventure",
3
- "version": "1.0.0",
4
- "description": "Zhin.js 交互式文字冒险 分支剧情与选项按钮",
3
+ "version": "1.0.2",
4
+ "description": "Zhin.js 交互式文字冒险 (Plugin Runtime)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
7
7
  "types": "./lib/index.d.ts",
@@ -14,29 +14,25 @@
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
- "keywords": [
23
- "zhin",
24
- "zhin.js",
25
- "bot",
26
- "plugin",
27
- "game",
28
- "text-adventure"
29
- ],
30
25
  "license": "MIT",
31
- "peerDependencies": {
32
- "zhin.js": "4.1.0"
33
- },
34
26
  "dependencies": {
35
- "@zhin.js/game-shared": "1.0.0"
27
+ "@zhin.js/command": "1.0.1",
28
+ "@zhin.js/core": "1.3.5",
29
+ "@zhin.js/game-kit": "1.0.2",
30
+ "@zhin.js/middleware": "1.0.1",
31
+ "@zhin.js/plugin-runtime": "1.0.1"
36
32
  },
37
33
  "devDependencies": {
38
34
  "typescript": "^6.0.3",
39
- "zhin.js": "4.1.0"
35
+ "vitest": "^4.1.10"
40
36
  },
41
37
  "repository": {
42
38
  "type": "git",
@@ -47,8 +43,30 @@
47
43
  "access": "public",
48
44
  "registry": "https://registry.npmjs.org"
49
45
  },
46
+ "engines": {
47
+ "node": "^20.19.0 || >=22.12.0"
48
+ },
49
+ "zhin": {
50
+ "protocol": 1,
51
+ "type": "plugin",
52
+ "entry": "./plugin.ts",
53
+ "engine": "^1.0.0",
54
+ "runtime": "trusted",
55
+ "features": [
56
+ {
57
+ "package": "@zhin.js/command",
58
+ "api": "^1.0.0"
59
+ },
60
+ {
61
+ "package": "@zhin.js/middleware",
62
+ "api": "^1.0.0"
63
+ }
64
+ ],
65
+ "plugins": []
66
+ },
50
67
  "scripts": {
51
- "build": "tsc --build",
52
- "clean": "rimraf lib"
68
+ "build": "tsc",
69
+ "clean": "rimraf lib",
70
+ "test": "NODE_OPTIONS=--experimental-strip-types vitest run --root ../../.. plugins/games/text-adventure/tests"
53
71
  }
54
72
  }
package/plugin.ts ADDED
@@ -0,0 +1,65 @@
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 { mountAdvHostServices, mountAdvMemoryServices } from './src/memory-db.js';
9
+ import { gameServicesToken } from './src/runtime-store.js';
10
+ import type { GameServices } from './src/session-service.js';
11
+
12
+ /**
13
+ * Plugin Runtime:
14
+ * - Commands under `commands/` are authoritative (help + start/continue/…).
15
+ * - DB: prefer databaseHostToken; else in-memory GameServices.
16
+ * - Choice middleware under `middlewares/` handles adv choice payloads (Sandbox action→text).
17
+ */
18
+ export default definePlugin({
19
+ name: 'text-adventure',
20
+ metadata: {
21
+ displayName: 'Text Adventure',
22
+ },
23
+ setup(context) {
24
+ let services: GameServices;
25
+ if (context.resources.has(databaseHostToken)) {
26
+ const host = context.resources.use(databaseHostToken);
27
+ services = mountAdvHostServices(host);
28
+ context.lifecycle.add(initGameRecordHost(host));
29
+ } else {
30
+ services = mountAdvMemoryServices();
31
+ }
32
+ context.resources.provide(gameServicesToken, services);
33
+ const disposeHub = registerRuntimeGame({
34
+ id: 'adv',
35
+ title: '秘境探险',
36
+ icon: '🗺️',
37
+ description: '文字冒险,31 区域 · 15 结局 · 成就收集',
38
+ commandPrefix: '/冒险',
39
+ quickStart: '开始',
40
+ aliases: ['adv', '秘境'],
41
+ menus: [
42
+ { id: 'start', label: '🚪 开始冒险' },
43
+ { id: 'continue', label: '🔄 继续冒险' },
44
+ { id: 'map', label: '🗺️ 探索进度' },
45
+ { id: 'achievements', label: '🏅 成就' },
46
+ { id: 'help', label: '📖 玩法说明' },
47
+ ],
48
+ });
49
+ context.lifecycle.add(disposeHub);
50
+
51
+ if (context.resources.has(scheduleHostToken)) {
52
+ const schedule = context.resources.use(scheduleHostToken);
53
+ const disposeCron = schedule.register({
54
+ id: 'adv/abort-stale',
55
+ cron: DEFAULT_GAME_STALE_CRON,
56
+ description: 'Abort stale text-adventure sessions',
57
+ async execute() {
58
+ if (!services.sessions.abortStale) return;
59
+ await services.sessions.abortStale(DEFAULT_GAME_STALE_IDLE_MS);
60
+ },
61
+ });
62
+ context.lifecycle.add(disposeCron);
63
+ }
64
+ },
65
+ });
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
+ }
@@ -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 {
4
4
  continueAdventure,
5
5
  sessionSummary,
@@ -21,7 +21,7 @@ export const ADV_HELP = [
21
21
  ].join('\n');
22
22
 
23
23
  export async function runAdvCommand(
24
- plugin: Plugin,
24
+ plugin: Plugin | null,
25
25
  services: GameServices,
26
26
  message: Message<any>,
27
27
  action: string,
@@ -70,3 +70,12 @@ export async function runAdvCommand(
70
70
 
71
71
  return `未知子命令:${action}\n\n${ADV_HELP}`;
72
72
  }
73
+
74
+ /** Plugin Runtime / smoke: text-only, no Adapter.editMessage. */
75
+ export async function runAdvCommandText(
76
+ services: GameServices,
77
+ message: Message<any>,
78
+ action: string,
79
+ ): Promise<string> {
80
+ return (await runAdvCommand(null, services, message, action)) ?? '';
81
+ }
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 type { AdvProfileRow, AdvSessionRow } from './models.js';
3
4
  import { formatNewAchievements } from './profile-format.js';
4
5
  import { buildSceneInteractive } from './scene-view.js';
@@ -11,7 +12,7 @@ import {
11
12
  import type { GameServices } from './session-service.js';
12
13
 
13
14
  export async function sendOrEditScene(
14
- plugin: Plugin,
15
+ plugin: Plugin | null,
15
16
  services: GameServices,
16
17
  message: Message<any>,
17
18
  session: AdvSessionRow,
@@ -20,10 +21,11 @@ export async function sendOrEditScene(
20
21
  ): Promise<string> {
21
22
  const prof = profile
22
23
  ?? await services.profiles.getOrCreate(session.player_id, session.player_name);
23
- const content = buildSceneInteractive(session, extraNarrative, prof);
24
+ const content = buildSceneInteractive(session, extraNarrative, prof, message.$channel.type);
24
25
  if (!content) {
25
26
  return '场景数据异常,请 adv quit 后重新开始。';
26
27
  }
28
+ if (!plugin) return plainTextFromSendContent(content);
27
29
 
28
30
  const adapter = plugin.root.inject(message.$adapter) as Adapter;
29
31
 
@@ -50,7 +52,7 @@ export async function sendOrEditScene(
50
52
  }
51
53
 
52
54
  export async function startAdventure(
53
- plugin: Plugin,
55
+ plugin: Plugin | null,
54
56
  services: GameServices,
55
57
  message: Message<any>,
56
58
  ): Promise<string | undefined> {
@@ -71,12 +73,12 @@ export async function startAdventure(
71
73
  'start',
72
74
  [],
73
75
  );
74
- await sendOrEditScene(plugin, services, message, session);
75
- return undefined;
76
+ const text = await sendOrEditScene(plugin, services, message, session);
77
+ return plugin ? undefined : text;
76
78
  }
77
79
 
78
80
  export async function handleChoice(
79
- plugin: Plugin,
81
+ plugin: Plugin | null,
80
82
  services: GameServices,
81
83
  message: Message<any>,
82
84
  sessionId: string,
@@ -111,8 +113,9 @@ export async function handleChoice(
111
113
  });
112
114
  const updated = (await services.sessions.getById(session.id))!;
113
115
  await services.profiles.onStep(updated.player_id, updated.player_name, 'start', []);
114
- await sendOrEditScene(plugin, services, message, updated);
115
- return null;
116
+ const text = await sendOrEditScene(plugin, services, message, updated);
117
+ // text-only 模式(plugin===null)下 sendOrEditScene 的唯一输出就是返回文本
118
+ return plugin ? null : text;
116
119
  }
117
120
 
118
121
  const result = resolveChoice(state, choiceId);
@@ -160,12 +163,13 @@ export async function handleChoice(
160
163
 
161
164
  const updated = (await services.sessions.getById(session.id))!;
162
165
  const extra = formatNewAchievements(newAchievements);
163
- await sendOrEditScene(plugin, services, message, updated, extra);
164
- return null;
166
+ const text = await sendOrEditScene(plugin, services, message, updated, extra);
167
+ // text-only 模式(plugin===null)下 sendOrEditScene 的唯一输出就是返回文本
168
+ return plugin ? null : text;
165
169
  }
166
170
 
167
171
  export async function continueAdventure(
168
- plugin: Plugin,
172
+ plugin: Plugin | null,
169
173
  services: GameServices,
170
174
  message: Message<any>,
171
175
  ): Promise<string> {
@@ -174,7 +178,8 @@ export async function continueAdventure(
174
178
  message.$sender.id,
175
179
  );
176
180
  if (!session) return '你没有进行中的冒险,发送 adv start 开始。';
177
- await sendOrEditScene(plugin, services, message, session);
181
+ const text = await sendOrEditScene(plugin, services, message, session);
182
+ if (!plugin) return text;
178
183
  return '已刷新当前场景。';
179
184
  }
180
185
 
package/src/index.ts CHANGED
@@ -1,47 +1,9 @@
1
+ export { ADV_HELP } from './adv-command.js';
2
+ export { gameServicesToken, resolveGameServices } from './runtime-store.js';
3
+ export { createInMemoryAdvDb, mountAdvMemoryServices } from './memory-db.js';
4
+
1
5
  /**
2
- * @zhin.js/plugin-text-adventure 交互式文字冒险
3
- *
4
- * ```yaml
5
- * plugins:
6
- * - "@zhin.js/plugin-text-adventure"
7
- * database:
8
- * dialect: sqlite
9
- * storage: ./data/zhin.db
10
- * ```
6
+ * 已由 plugin.ts 接线:commands/ 命令、middlewares/ 文本与选项中间件、
7
+ * 游戏大厅注册(registerRuntimeGame)、过期会话 cron(scheduleHostToken)、
8
+ * host DatabaseHost(databaseHostToken)。仍未接:interactive 按钮回调。
11
9
  */
12
- import { Cron, formatCompact, usePlugin, type DatabaseFeature } from 'zhin.js';
13
- import { registerModels } from './models.js';
14
- import {
15
- createServices,
16
- resolveGameDatabase,
17
- type GameServices,
18
- } from './session-service.js';
19
- import { registerCommands, registerInteractive, registerTextFallback } from './commands.js';
20
- import { registerAdvHub } from './hub-register.js';
21
-
22
- const plugin = usePlugin();
23
- const { logger, useContext, addCron } = plugin;
24
-
25
- registerModels(plugin);
26
-
27
- let services: GameServices | null = null;
28
-
29
- useContext('database', (dbFeature: DatabaseFeature) => {
30
- services = createServices(resolveGameDatabase(dbFeature));
31
- logger.info(formatCompact({ 模块: '文字冒险', 数据模型: '已就绪' }));
32
- });
33
-
34
- registerAdvHub(() => services);
35
- registerCommands(plugin, () => services);
36
- registerInteractive(plugin, () => services);
37
- registerTextFallback(plugin, () => services);
38
-
39
- addCron(
40
- new Cron('0 */15 * * * *', async () => {
41
- if (!services) return;
42
- const n = await services.sessions.abortStale(60 * 60 * 1000);
43
- if (n > 0) logger.debug(formatCompact({ 文字冒险: '清理超时局', count: n }));
44
- }),
45
- );
46
-
47
- logger.info(formatCompact({ 模块: '文字冒险', 状态: '已加载' }));
@@ -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 AdvDatabase, type GameServices } from './session-service.js';
5
+
6
+ const ADV_TABLES = ['adv_sessions', 'adv_profiles'] as const;
7
+
8
+ /** In-memory adv tables for Plugin Runtime slice-2 (no DatabaseFeature). */
9
+ export function createInMemoryAdvDb(): AdvDatabase {
10
+ return createInMemoryGameDb(ADV_TABLES) as unknown as AdvDatabase;
11
+ }
12
+
13
+ export function mountAdvMemoryServices(): GameServices {
14
+ const services = createServices(createInMemoryAdvDb());
15
+ return services;
16
+ }
17
+
18
+ export function mountAdvHostServices(host: DatabaseHost): GameServices {
19
+ defineHostTables(host);
20
+ const services = createServices(createHostGameDb(host, ADV_TABLES) as unknown as AdvDatabase);
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 AdvSessionStatus = 'active' | 'completed' | 'aborted';
4
4
 
5
- declare module 'zhin.js' {
5
+ declare module '@zhin.js/core' {
6
6
  interface Models {
7
7
  adv_sessions: {
8
8
  id: string;
@@ -45,8 +45,11 @@ export type AdvSessionRow = Models['adv_sessions'];
45
45
  export type AdvProfileRow = Models['adv_profiles'];
46
46
  export type AdvModelName = 'adv_sessions' | 'adv_profiles';
47
47
 
48
- export function registerModels(plugin: Plugin): void {
49
- plugin.defineModel('adv_sessions', {
48
+
49
+ export function defineHostTables(
50
+ db: { define: (name: string, definition: Record<string, unknown>) => void },
51
+ ): void {
52
+ db.define('adv_sessions', {
50
53
  id: { type: 'text', primary: true },
51
54
  adapter: { type: 'text', nullable: false },
52
55
  endpoint: { type: 'text', nullable: false },
@@ -66,8 +69,7 @@ export function registerModels(plugin: Plugin): void {
66
69
  updated_at: { type: 'integer', default: 0 },
67
70
  created_at: { type: 'integer', default: 0 },
68
71
  });
69
-
70
- plugin.defineModel('adv_profiles', {
72
+ db.define('adv_profiles', {
71
73
  player_id: { type: 'text', primary: true },
72
74
  player_name: { type: 'text', default: '' },
73
75
  visited_scenes: { type: 'text', default: '[]' },
@@ -1,4 +1,4 @@
1
- import type { Database, Models, RelatedModel } from 'zhin.js';
1
+ import type { Database, Models, RelatedModel } from '@zhin.js/core';
2
2
  import { evaluateAchievements, type AchievementContext } from './achievements.js';
3
3
  import type { AdvModelName, AdvProfileRow } from './models.js';
4
4
  import { parseStringSet, serializeStringSet } from './profile-parse.js';
@@ -0,0 +1,9 @@
1
+ import { createToken } from '@zhin.js/plugin-runtime';
2
+ import type { GameServices } from './session-service.js';
3
+
4
+ /** Owner-scoped service consumed by discovered commands and middleware. */
5
+ export const gameServicesToken = createToken<GameServices>('zhin.game.text-adventure.services');
6
+
7
+ export function resolveGameServices(context: { use<T>(token: typeof gameServicesToken): T }): GameServices {
8
+ return context.use(gameServicesToken) as GameServices;
9
+ }
package/src/scene-view.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { SendContent } from 'zhin.js';
2
- import { buildChoiceKeyboard } from '@zhin.js/game-shared';
1
+ import type { SendContent } from '@zhin.js/core';
2
+ import { buildChoiceKeyboard } from '@zhin.js/game-kit';
3
3
  import type { AdvProfileRow, AdvSessionRow } from './models.js';
4
4
  import { formatProgressCompact } from './profile-format.js';
5
5
  import {
@@ -14,6 +14,7 @@ export function buildSceneInteractive(
14
14
  session: AdvSessionRow,
15
15
  extraNarrative = '',
16
16
  profile?: AdvProfileRow,
17
+ channelType?: string,
17
18
  ): SendContent | null {
18
19
  const scene = getScene(session.scene_id);
19
20
  if (!scene) return null;
@@ -42,5 +43,7 @@ export function buildSceneInteractive(
42
43
  terminal,
43
44
  buttonsPerRow: 2,
44
45
  fallbackHint: '回复数字选择(仅编号)',
46
+ interactionProfile: terminal ? 'terminal' : 'gameplay',
47
+ channelType,
45
48
  });
46
49
  }
@@ -1,5 +1,5 @@
1
- import type { Database, DatabaseFeature, Message, Models, RelatedModel } from 'zhin.js';
2
- import { channelKey, generateSessionId } 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 type { AdvModelName, AdvSessionRow } from './models.js';
4
4
  import { createProfileService, ProfileService } from './profile-service.js';
5
5
 
@@ -40,14 +40,9 @@ export class SessionService {
40
40
 
41
41
  async getActiveByBoardMessageId(messageId: string): Promise<AdvSessionRow | null> {
42
42
  if (!messageId) return null;
43
- const rows = await getModel(this.db, 'adv_sessions').findAll({ status: 'active' });
43
+ const rows = await getModel(this.db, 'adv_sessions').findAll({});
44
44
  for (const row of rows) {
45
- const stored = row.board_message_id;
46
- if (!stored) continue;
47
- if (stored === messageId) return row;
48
- if (stored.endsWith(`:${messageId}`)) return row;
49
- const tail = stored.split(':').pop();
50
- if (tail && messageId.endsWith(tail)) return row;
45
+ if (boardMessageMatches(row.board_message_id ?? '', messageId)) return row;
51
46
  }
52
47
  return null;
53
48
  }
@@ -108,6 +103,3 @@ export function createServices(db: AdvDatabase): GameServices {
108
103
  };
109
104
  }
110
105
 
111
- export function resolveGameDatabase(feature: DatabaseFeature): AdvDatabase {
112
- return feature.db;
113
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"achievements.d.ts","sourceRoot":"","sources":["../src/achievements.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE;QACR,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,YAAY,EAAE,cAAc,EAgBxC,CAAC;AA0BF,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAAE,EAClB,GAAG,EAAE,kBAAkB,GACtB,MAAM,EAAE,CAYV;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEtE;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"adv-command.d.ts","sourceRoot":"","sources":["../src/adv-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAQ/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,eAAO,MAAM,QAAQ,QAUT,CAAC;AAEb,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA4C7B"}
package/lib/commands.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { type Plugin } from 'zhin.js';
2
- import type { GameServices } from './session-service.js';
3
- export declare function registerCommands(plugin: Plugin, getServices: () => GameServices | null): void;
4
- export declare function registerInteractive(plugin: Plugin, getServices: () => GameServices | null): void;
5
- export declare function registerTextFallback(plugin: Plugin, getServices: () => GameServices | 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,EAIL,KAAK,MAAM,EACZ,MAAM,SAAS,CAAC;AAUjB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAqDzD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,YAAY,GAAG,IAAI,GACrC,IAAI,CAIN;AAgBD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,YAAY,GAAG,IAAI,GACrC,IAAI,CAIN;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,YAAY,GAAG,IAAI,GACrC,IAAI,CA4BN"}
package/lib/commands.js DELETED
@@ -1,96 +0,0 @@
1
- import { MessageCommand, getActionFromMessage, } from 'zhin.js';
2
- import { buildChoiceFallbackMap, channelKey, normalizeAdvAction, parseChoicePayload, } from '@zhin.js/game-shared';
3
- import { runAdvCommand } from './adv-command.js';
4
- import { handleChoice } from './game-flow.js';
5
- import { ADV_PREFIX, getScene, stateFromSession, visibleChoices } from './story.js';
6
- function registerAdvPattern(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
- const action = normalizeAdvAction(raw);
15
- return runAdvCommand(plugin, services, message, action);
16
- }));
17
- }
18
- async function resolveAdvChoice(message, services) {
19
- const action = getActionFromMessage(message);
20
- if (!action)
21
- return null;
22
- const fromPayload = parseChoicePayload(action.payload, ADV_PREFIX);
23
- if (fromPayload) {
24
- return { sessionId: fromPayload.sessionId, choiceId: fromPayload.choiceId };
25
- }
26
- const choiceId = action.id || action.payload;
27
- if (!choiceId)
28
- return null;
29
- const ch = channelKey(message);
30
- const session = await services.sessions.getActiveForUser(ch, message.$sender.id)
31
- ?? (action.sourceMessageId
32
- ? await services.sessions.getActiveByBoardMessageId(action.sourceMessageId)
33
- : null);
34
- if (!session || session.channel_key !== ch)
35
- return null;
36
- const scene = getScene(session.scene_id);
37
- if (!scene)
38
- return null;
39
- const state = stateFromSession(session);
40
- const choices = visibleChoices(scene, state);
41
- if (!choices.some((c) => c.id === choiceId))
42
- return null;
43
- return { sessionId: session.id, choiceId };
44
- }
45
- export function registerCommands(plugin, getServices) {
46
- registerAdvPattern(plugin, 'adv [action:word]', '秘境探险(adv)', getServices);
47
- registerAdvPattern(plugin, '冒险 [action:word]', '秘境探险(中文)', getServices);
48
- registerAdvPattern(plugin, '秘境 [action:word]', '秘境探险(简称)', getServices);
49
- }
50
- async function handleAdvAction(plugin, getServices, message) {
51
- const services = getServices();
52
- if (!services)
53
- return false;
54
- const choice = await resolveAdvChoice(message, services);
55
- if (!choice)
56
- return false;
57
- const err = await handleChoice(plugin, services, message, choice.sessionId, choice.choiceId);
58
- if (err)
59
- await message.$reply?.(err);
60
- return true;
61
- }
62
- export function registerInteractive(plugin, getServices) {
63
- plugin.registerInteractiveHandler(`${ADV_PREFIX}:`, (message) => handleAdvAction(plugin, getServices, message));
64
- }
65
- export function registerTextFallback(plugin, getServices) {
66
- plugin.addMiddleware(async (message, next) => {
67
- const services = getServices();
68
- if (!services)
69
- return next();
70
- const action = getActionFromMessage(message);
71
- if (action?.payload.startsWith(`${ADV_PREFIX}:`))
72
- return next();
73
- const ch = channelKey(message);
74
- const session = await services.sessions.getActiveForUser(ch, message.$sender.id);
75
- if (!session)
76
- return next();
77
- const raw = message.$raw?.trim() ?? '';
78
- const n = /^(\d+)$/.exec(raw);
79
- if (!n)
80
- return next();
81
- const scene = getScene(session.scene_id);
82
- if (!scene)
83
- return next();
84
- const state = stateFromSession(session);
85
- const choices = visibleChoices(scene, state);
86
- const map = buildChoiceFallbackMap(ADV_PREFIX, session.id, choices);
87
- const payload = map[n[1]];
88
- const parsed = payload ? parseChoicePayload(payload, ADV_PREFIX) : null;
89
- if (!parsed || parsed.sessionId !== session.id)
90
- return next();
91
- const err = await handleChoice(plugin, services, message, session.id, parsed.choiceId);
92
- if (err)
93
- await message.$reply?.(err);
94
- });
95
- }
96
- //# sourceMappingURL=commands.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,oBAAoB,GAErB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGpF,SAAS,kBAAkB,CACzB,MAAc,EACd,OAAe,EACf,IAAY,EACZ,WAAsC;IAEtC,MAAM,CAAC,UAAU,CACf,IAAI,cAAc,CAAC,OAAO,CAAC;SACxB,IAAI,CAAC,IAAI,CAAC;SACV,MAAM,CAAC,KAAK,EAAE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tB,cAAc,SAAK,EACnB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,MAAM,CAAC,CA8BjB;AAED,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GACpB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAoB7B;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiFxB;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GACpB,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAe7D"}
@@ -1,5 +0,0 @@
1
- import { ADV_HELP } from './adv-command.js';
2
- import type { GameServices } from './session-service.js';
3
- export declare function registerAdvHub(getServices: () => GameServices | null): () => void;
4
- export { ADV_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":"AAEA,OAAO,EAAiB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,IAAI,CAmBjF;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,25 +0,0 @@
1
- import { registerGame } from '@zhin.js/game-shared';
2
- import { runAdvCommand, ADV_HELP } from './adv-command.js';
3
- export function registerAdvHub(getServices) {
4
- return registerGame({
5
- id: 'adv',
6
- title: '秘境探险',
7
- icon: '🗺️',
8
- description: '文字冒险,31 区域 · 15 结局 · 成就收集',
9
- menus: [
10
- { id: 'start', label: '🚪 开始冒险', style: 'primary' },
11
- { id: 'continue', label: '🔄 继续冒险' },
12
- { id: 'map', label: '🗺️ 探索进度' },
13
- { id: 'achievements', label: '🏅 成就' },
14
- { id: 'help', label: '📖 玩法说明' },
15
- ],
16
- runAction: async (actionId, ctx) => {
17
- const services = getServices();
18
- if (!services)
19
- return '文字冒险需要启用 database 配置。';
20
- return runAdvCommand(ctx.plugin, services, ctx.message, actionId);
21
- },
22
- });
23
- }
24
- export { ADV_HELP };
25
- //# sourceMappingURL=hub-register.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hub-register.js","sourceRoot":"","sources":["../src/hub-register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG3D,MAAM,UAAU,cAAc,CAAC,WAAsC;IACnE,OAAO,YAAY,CAAC;QAClB,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,2BAA2B;QACxC,KAAK,EAAE;YACL,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;YACnD,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE;YACpC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE;YAChC,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE;YACtC,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,uBAAuB,CAAC;YAC9C,OAAO,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACpE,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,QAAQ,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,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;AAElE,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,MAAM;QACd,YAAY,EAAE;YACZ,EAAE,EAAE,MAAM,CAAC;YACX,OAAO,EAAE,MAAM,CAAC;YAChB,QAAQ,EAAE,MAAM,CAAC;YACjB,YAAY,EAAE,MAAM,CAAC;YACrB,UAAU,EAAE,MAAM,CAAC;YACnB,WAAW,EAAE,MAAM,CAAC;YACpB,SAAS,EAAE,MAAM,CAAC;YAClB,WAAW,EAAE,MAAM,CAAC;YACpB,QAAQ,EAAE,MAAM,CAAC;YACjB,EAAE,EAAE,MAAM,CAAC;YACX,SAAS,EAAE,MAAM,CAAC;YAClB,KAAK,EAAE,MAAM,CAAC;YACd,SAAS,EAAE,MAAM,CAAC;YAClB,MAAM,EAAE,gBAAgB,CAAC;YACzB,gBAAgB,EAAE,MAAM,CAAC;YACzB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;QACF,YAAY,EAAE;Y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