feat: add command module and update action resolvers with GeneralActionResolver implementation

This commit is contained in:
2026-01-02 19:08:11 +00:00
parent f58b8b2553
commit fba363c6ce
11 changed files with 98 additions and 179 deletions
@@ -0,0 +1,18 @@
import type { GeneralActionDefinition } from '../definition.js';
import type { GeneralActionResolver } from '../engine.js';
import type { TurnCommandEnv } from './commandEnv.js';
export interface TurnCommandSpecBase<TKey extends string = string> {
key: TKey;
category: string;
reqArg: boolean;
args: Record<string, unknown>;
createDefinition(env: TurnCommandEnv): GeneralActionDefinition;
}
export interface TurnCommandModule<TSpec extends TurnCommandSpecBase = TurnCommandSpecBase> {
commandSpec: TSpec;
ActionDefinition: new (...args: any[]) => GeneralActionDefinition;
ActionResolver?: new (...args: any[]) => GeneralActionResolver;
CommandResolver?: new (...args: any[]) => unknown;
}