New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mulmocast-preprocessor

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mulmocast-preprocessor

Preprocessor for MulmoScript

latest
Source
npmnpm
Version
0.6.0
Version published
Maintainers
1
Created
Source

mulmocast-preprocessor

Preprocessor for MulmoScript that enables generating multiple variations (full, summary, teaser, etc.) from a single script.

Installation

npm install mulmocast-preprocessor

Features

  • Profile-based variants: Generate different versions (summary, teaser) from one script
  • Section filtering: Extract beats by section
  • Tag filtering: Extract beats by tags
  • Profile listing: List available profiles with beat counts
  • AI Summarization: Generate summaries using LLM (OpenAI, Anthropic, Groq, Gemini)
  • AI Query: Ask questions about script content with interactive mode
  • CLI tool: Command-line interface for processing scripts

CLI Usage

# Process script with profile
mulmocast-preprocessor script.json --profile summary -o summary.json

# Output to stdout (for piping)
mulmocast-preprocessor script.json --profile teaser

# Filter by section
mulmocast-preprocessor script.json --section chapter1

# Filter by tags
mulmocast-preprocessor script.json --tags concept,demo

# Combine profile and filters
mulmocast-preprocessor script.json --profile summary --section chapter1

# List available profiles
mulmocast-preprocessor profiles script.json

# Summarize script content
mulmocast-preprocessor summarize script.json
mulmocast-preprocessor summarize script.json --format markdown
mulmocast-preprocessor summarize script.json -l ja  # Output in Japanese
mulmocast-preprocessor summarize https://example.com/script.json  # From URL

# Query script content
mulmocast-preprocessor query script.json "What is the main topic?"
mulmocast-preprocessor query script.json "登場人物は?" -l ja

# Interactive query mode
mulmocast-preprocessor query script.json -i
mulmocast-preprocessor query script.json  # Omit question for interactive mode

CLI Options (process command)

OptionAliasDescription
--profile <name>-pProfile name to apply (default: "default")
--output <path>-oOutput file path (default: stdout)
--section <name>-sFilter by section name
--tags <tags>-tFilter by tags (comma-separated)
--help-hShow help
--version-vShow version

CLI Options (summarize command)

OptionAliasDescription
--providerLLM provider: openai, anthropic, groq, gemini (default: openai)
--model-mModel name
--format-fOutput format: text, markdown (default: text)
--lang-lOutput language (e.g., ja, en, zh)
--target-lengthTarget summary length in characters
--system-promptCustom system prompt
--verboseShow detailed progress
--section-sFilter by section name
--tags-tFilter by tags (comma-separated)

CLI Options (query command)

OptionAliasDescription
--interactive-iStart interactive query mode
--providerLLM provider: openai, anthropic, groq, gemini (default: openai)
--model-mModel name
--lang-lOutput language (e.g., ja, en, zh)
--system-promptCustom system prompt
--verboseShow detailed progress
--section-sFilter by section name
--tags-tFilter by tags (comma-separated)

Interactive Query Commands

CommandDescription
/clearClear conversation history
/historyShow conversation history
/exitExit interactive mode

Programmatic Usage

Basic Example

import { processScript, listProfiles, applyProfile } from "mulmocast-preprocessor";
import type { ExtendedMulmoScript } from "mulmocast-preprocessor";

const script: ExtendedMulmoScript = {
  title: "My Presentation",
  beats: [
    {
      text: "Full introduction text here...",
      variants: {
        summary: { text: "Brief intro" },
        teaser: { skip: true }
      },
      meta: { section: "intro", tags: ["important"] }
    },
    {
      text: "Main content...",
      meta: { section: "main", tags: ["core"] }
    }
  ]
};

// List available profiles
const profiles = listProfiles(script);
// [{ name: "default", beatCount: 2 }, { name: "summary", beatCount: 2 }, { name: "teaser", beatCount: 1, skippedCount: 1 }]

// Generate summary version
const summary = applyProfile(script, "summary");
// First beat's text is replaced with "Brief intro"

// Process with multiple options
const result = processScript(script, {
  profile: "summary",
  section: "intro"
});

API

processScript(script, options)

Main processing function that applies profile and filters.

Parameters:

  • script: ExtendedMulmoScript - Input script with variants/meta
  • options: ProcessOptions - Processing options
    • profile?: string - Profile name to apply
    • section?: string - Filter by section
    • tags?: string[] - Filter by tags (OR logic)

Returns: MulmoScript - Standard MulmoScript with variants/meta stripped

applyProfile(script, profileName)

Apply a profile to the script, replacing text/image and skipping marked beats.

Parameters:

  • script: ExtendedMulmoScript - Input script
  • profileName: string - Profile name

Returns: MulmoScript - Processed script

listProfiles(script)

Get list of available profiles from script.

Parameters:

  • script: ExtendedMulmoScript - Input script

Returns: ProfileInfo[] - Array of profile info with beat counts

filterBySection(script, section)

Filter beats by section.

filterByTags(script, tags)

Filter beats by tags (extracts beats that have any of the specified tags).

summarizeScript(script, options)

Generate a summary of the script content using LLM.

Parameters:

  • script: ExtendedMulmoScript - Input script
  • options: SummarizeOptions - Summarization options
    • provider?: LLMProvider - LLM provider (default: "openai")
    • model?: string - Model name
    • format?: "text" | "markdown" - Output format
    • lang?: string - Output language code
    • targetLengthChars?: number - Target length
    • systemPrompt?: string - Custom system prompt

Returns: Promise<SummarizeResult> - Summary result with text and metadata

queryScript(script, question, options)

Ask a question about the script content.

Parameters:

  • script: ExtendedMulmoScript - Input script
  • question: string - Question to ask
  • options: QueryOptions - Query options (same as summarize)

Returns: Promise<QueryResult> - Answer with question and metadata

createInteractiveSession(script, options)

Create an interactive query session for follow-up questions.

Parameters:

  • script: ExtendedMulmoScript - Input script
  • options: QueryOptions - Query options

Returns: Session object with sendInteractiveQuery() method

Environment Variables

For AI features (summarize, query), set the API key for your LLM provider:

ProviderEnvironment Variable
OpenAIOPENAI_API_KEY
AnthropicANTHROPIC_API_KEY
GroqGROQ_API_KEY
GeminiGEMINI_API_KEY

Extended Schema

ExtendedMulmoBeat

interface ExtendedMulmoBeat extends MulmoBeat {
  variants?: Record<string, BeatVariant>;
  meta?: BeatMeta;
}

BeatVariant

interface BeatVariant {
  text?: string;       // Override text
  skip?: boolean;      // Skip this beat
  image?: MulmoImage;  // Override image
  imagePrompt?: string; // Override imagePrompt
}

BeatMeta

interface BeatMeta {
  tags?: string[];
  section?: string;
  context?: string;
  keywords?: string[];
  expectedQuestions?: string[];
}

License

MIT

FAQs

Package last updated on 13 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts