Skip to content

feat: add support for custom context files and direction#39

Closed
abubakarsiddik31 wants to merge 1 commit intotsensei:mainfrom
abubakarsiddik31:topic-details
Closed

feat: add support for custom context files and direction#39
abubakarsiddik31 wants to merge 1 commit intotsensei:mainfrom
abubakarsiddik31:topic-details

Conversation

@abubakarsiddik31
Copy link
Copy Markdown
Contributor

@abubakarsiddik31 abubakarsiddik31 commented Apr 8, 2026

This PR introduces a major enhancement to the video generation pipeline: the ability to provide custom context and direction files. Creators can now steer the AI agents with specific angles, key facts, tone preferences, and constraints, ensuring the final output aligns perfectly with their vision.

🌟 Key Features

  • CLI Support: Added a new -c, --context flag to the CLI.
    Reference any local Markdown or text file to inject detailed
    instructions into the generation process.
  • Deep Pipeline Integration: Context is now systematically passed
    through the entire lifecycle:
    • Researcher: Focuses searches on specific angles or data
      points provided.
    • Creative Director: Adheres to the requested tone, hook
      styles, and narrative structure.
    • Critic: Evaluates the plan against the creator's specific
      constraints and gives feedback if they aren't met.
  • API & Worker Support: The /api/v1/jobs endpoint now accepts a
    context string, enabling the same level of control for web-based
    or programmatic integrations.
  • Private Briefing Workflow: Created a topics/ directory
    (automatically gitignored) where users can store their private
    project briefs.

🛠 Technical Changes

  • CLI: Updated args.ts and index.ts to handle file reading and
    validation for context.
  • Agents: Modified research.ts, creative-director.ts, and
    critic.ts to include optional context in system prompts.
  • Server: Updated server.ts and worker.ts schemas to support the
    new context field (with a 5,000-character limit).
  • Documentation: Added a comprehensive usage guide to the README
    and provided a topics/example.md template to help users get
    started.

📖 Usage Example

1 pnpm start "the apollo 13 disaster" --context topics/my-brief.md

Example Brief (topics/my-brief.md):

Focus on the emotional experience of the astronauts rather than
technical details.
Tone: Tense, then hopeful.
Must include: The CO2 scrubber improvisation.


📝 Contributor Note
The topics/ folder is designed to keep your creative briefs local
and private while giving you full control over the AI's output.

@tsensei
Copy link
Copy Markdown
Owner

tsensei commented Apr 8, 2026

@claude review

@claude
Copy link
Copy Markdown

claude Bot commented Apr 8, 2026

Claude Code is working…

I'll analyze this and get back to you.

View job run

@tsensei
Copy link
Copy Markdown
Owner

tsensei commented Apr 10, 2026

Closing in favor of #44 (landed as v0.18.0).

#44 covers the same need with a narrower design: direction only influences the Creative Director (not research/critic), uses free-form markdown parsed by the LLM, and adds score replay (--score) for reusing previous plans when downstream stages fail. Also includes web UI support, 10KB byte-limit validation, and 28 tests.

@tsensei tsensei closed this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants