Provides a mechanism to reduce a Scrydex CardDB to a simplified form suitable for AI / LLM consumption. This process removes the CardDB metadata and outputs a LLMDB which is a basic JSON array of LLMCard entries that has just necessary data about the card to reduce token count / costs enabling more reliable parsing by LLMs.

Index

Methods

Methods

  • Exports a single Scrydex CardDB to a reduced LLMDB JSON file.

    Parameters

    • options: {
          db: CardDB.Stream.Reader;
          filepath: string;
          oracleText?: boolean;
          streamOptions?: CardDB.Stream.StreamOptions;
      }

      Options.

      • db: CardDB.Stream.Reader

        Source CardDB stream reader instance.

      • filepath: string

        Output file path for simplified LLM export JSON file.

      • OptionaloracleText?: boolean

        When false, card rules oracle text is removed.

      • OptionalstreamOptions?: CardDB.Stream.StreamOptions

        Optional stream options for potentially filtering the CardDB.

    Returns Promise<number>

    Estimated token count for LLM consumption of output LLMDB.

  • Writes the TypeScript declaration file describing the LLMDB JSON schema.

    The generated types provide structural context for LLMs and tooling and correspond exactly to the data produced by ExportLLM.cardDB.

    Parameters

    • options: { filepath: string }

      Options

      • filepath: string

        Output file path. Must end in .d.ts file extension.

    Returns Promise<number>

    Estimated token count for LLM consumption of type declaration file.