@zhin.js/plugin-blackjack 0.0.10 → 0.0.13

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.
@@ -20,7 +20,7 @@ export default defineCommand({
20
20
  const action = normalizeBjAction(String(params.action ?? ''));
21
21
  if (!action || action === 'help')
22
22
  return BJ_HELP;
23
- const services = resolveGameServices({ use, owner });
23
+ const services = resolveGameServices({ use });
24
24
  const message = messageFromCommandInput(input);
25
25
  return runBjCommand(services, message, action);
26
26
  },
@@ -17,7 +17,7 @@ export default defineCommand({
17
17
  async execute({ params, input, use, owner }) {
18
18
  const action = normalizeBjAction(String(params.action ?? ''));
19
19
  if (!action || action === 'help') return BJ_HELP;
20
- const services = resolveGameServices({ use, owner });
20
+ const services = resolveGameServices({ use });
21
21
  const message = messageFromCommandInput(input);
22
22
  return runBjCommand(services, message, action);
23
23
  },
@@ -1,6 +1,7 @@
1
+ import { type Token } from '@zhin.js/plugin-runtime';
1
2
  import type { SessionService } from './session-service.js';
2
3
  /** Owner-scoped service consumed by discovered commands and middleware. */
3
- export declare const gameServicesToken: import("@zhin.js/plugin-runtime").Token<SessionService>;
4
+ export declare const gameServicesToken: Token<SessionService>;
4
5
  export declare function resolveGameServices(context: {
5
- use<T>(token: typeof gameServicesToken): T;
6
+ use<T>(token: Token<T>): T;
6
7
  }): SessionService;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-store.js","sourceRoot":"","sources":["../src/runtime-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAiB,8BAA8B,CAAC,CAAC;AAE7F,MAAM,UAAU,mBAAmB,CAAC,OAAuD;IACzF,OAAO,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAmB,CAAC;AAC1D,CAAC"}
1
+ {"version":3,"file":"runtime-store.js","sourceRoot":"","sources":["../src/runtime-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,yBAAyB,CAAC;AAGlE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAiB,8BAA8B,CAAC,CAAC;AAE7F,MAAM,UAAU,mBAAmB,CAAC,OAAuC;IACzE,OAAO,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AACxC,CAAC"}
package/lib/view.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { SendContent } from '@zhin.js/core';
1
+ import type { SendContent } from '@zhin.js/core/runtime';
2
2
  import type { BjSessionRow } from './models.js';
3
3
  export declare function buildBjView(session: BjSessionRow, terminal?: boolean, revealDealer?: boolean, channelType?: string): SendContent;
4
4
  export declare function checkNaturalBlackjack(session: BjSessionRow): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/plugin-blackjack",
3
- "version": "0.0.10",
3
+ "version": "0.0.13",
4
4
  "description": "Zhin.js 21 点(Blackjack)(Plugin Runtime)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -24,11 +24,11 @@
24
24
  ],
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
- "@zhin.js/command": "1.0.7",
28
- "@zhin.js/core": "1.5.2",
29
- "@zhin.js/game-kit": "3.0.2",
30
- "@zhin.js/middleware": "1.0.6",
31
- "@zhin.js/plugin-runtime": "1.1.3"
27
+ "@zhin.js/command": "1.0.10",
28
+ "@zhin.js/core": "1.5.5",
29
+ "@zhin.js/game-kit": "3.0.5",
30
+ "@zhin.js/middleware": "1.0.8",
31
+ "@zhin.js/plugin-runtime": "1.1.5"
32
32
  },
33
33
  "devDependencies": {
34
34
  "typescript": "^6.0.3",
@@ -1,9 +1,9 @@
1
- import { createToken } from '@zhin.js/plugin-runtime';
1
+ import { createToken, type Token } from '@zhin.js/plugin-runtime';
2
2
  import type { SessionService } from './session-service.js';
3
3
 
4
4
  /** Owner-scoped service consumed by discovered commands and middleware. */
5
5
  export const gameServicesToken = createToken<SessionService>('zhin.game.blackjack.services');
6
6
 
7
- export function resolveGameServices(context: { use<T>(token: typeof gameServicesToken): T }): SessionService {
8
- return context.use(gameServicesToken) as SessionService;
7
+ export function resolveGameServices(context: { use<T>(token: Token<T>): T }): SessionService {
8
+ return context.use(gameServicesToken);
9
9
  }
package/src/view.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { buildChoiceKeyboard } from '@zhin.js/game-kit';
2
- import type { SendContent } from '@zhin.js/core';
2
+ import type { SendContent } from '@zhin.js/core/runtime';
3
3
  import { BJ_PREFIX, formatHand, handValue, isBlackjack, TARGET } from './engine.js';
4
4
  import type { BjSessionRow } from './models.js';
5
5
  import { parseCards } from './session-service.js';