endfield-mcp
Version:
MCP Server for Arknights: Endfield (TypeScript / stdio + Streamable HTTP)
39 lines (38 loc) • 1.4 kB
TypeScript
/**
* Story scene reader — load and parse one dialogue scene by conv key.
*
* Reads `conv/<key>.json` on-demand from the store. Scenes are not cached —
* they are large and infrequently re-read, so we re-read per call rather
* than hold 97MB of dialogue in memory. Lines are normalized to the
* StoryLine three-state shape. Player choices are extracted from
* optionGroups (a separate structure from the lines array).
*
* Depends on `./storyCore.js` for the store accessor and mission-name map.
*/
import type { StoryLine, StoryScene } from "./storyTypes.js";
interface RawConvLine {
id?: string;
aid?: string;
actor?: string;
text?: string;
hint?: string;
speaker?: string;
cid?: string;
type?: string;
}
/**
* Normalize a raw conv line to the StoryLine three-state shape.
*
* Exported for direct unit testing of the three-state classification
* (speaker→dialog / actor→dialog / text-only→narration / empty→narration).
*/
export declare function normalizeLine(line: RawConvLine): StoryLine;
/**
* Load and parse one dialogue scene by conv key.
*
* Reads conv/<key>.json on-demand (does not cache — scenes are large
* and infrequently re-read). Lines are normalized to the StoryLine
* three-state shape. Player choices are extracted from optionGroups.
*/
export declare function readStory(convKey: string): StoryScene | null;
export {};