prompts.chat 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +1782 -280
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,20 @@
1
- # prompts.chat
1
+ # prompts.chat Typed Prompts
2
2
 
3
- The **D3.js of prompt engineering** — a comprehensive developer toolkit for building, validating, and parsing AI prompts. Create structured prompts for chat models, image generators, video AI, and music generation with fluent, type-safe APIs.
3
+ A comprehensive developer toolkit for building, validating, and parsing AI prompts. Create structured prompts for chat models, image generators, video AI, and music generation with fluent, type-safe APIs.
4
+
5
+ [![Playground](https://img.shields.io/badge/Playground-prompts.chat%2Ftyped--prompts--editor-blue)](https://prompts.chat/typed-prompts-editor)
6
+
7
+ ## Reason
8
+
9
+ Building effective AI prompts is challenging. Developers often struggle with:
10
+
11
+ - **Inconsistent prompt structure** — Different team members write prompts differently, leading to unpredictable AI responses
12
+ - **No type safety** — Typos and missing fields go unnoticed until runtime
13
+ - **Repetitive boilerplate** — Writing the same patterns over and over for common use cases
14
+ - **Hard to maintain** — Prompts scattered across codebases without standardization
15
+ - **Multi-modal complexity** — Each AI platform (chat, image, video, audio) has different requirements
16
+
17
+ `prompts.chat` solves these problems by providing a fluent, type-safe API that guides you through prompt construction with autocomplete, validation, and pre-built templates for common patterns.
4
18
 
5
19
  ## Installation
6
20
 
@@ -37,7 +51,7 @@ const imagePrompt = image()
37
51
  .environment("neon-lit Tokyo streets")
38
52
  .shot("medium")
39
53
  .lens("35mm")
40
- .lightingType("neon")
54
+ .lightingType("rim")
41
55
  .medium("cinematic")
42
56
  .build();
43
57
 
@@ -246,397 +260,1885 @@ const qa = templates.qa("You are answering questions about React.");
246
260
 
247
261
  ## 💬 Chat Builder
248
262
 
249
- Model-agnostic builder for conversational AI prompts. Works with GPT-4, Claude, Gemini, and any chat model.
263
+ Comprehensive model-agnostic builder for conversational AI prompts. Works with GPT-4, Claude, Gemini, Llama, and any chat model.
264
+
265
+ ### Quick Start
266
+
267
+ ```typescript
268
+ import { chat } from 'prompts.chat';
269
+
270
+ const prompt = chat()
271
+ .role("helpful coding assistant")
272
+ .context("Building a React application")
273
+ .task("Explain async/await in JavaScript")
274
+ .stepByStep()
275
+ .detailed()
276
+ .build();
277
+
278
+ console.log(prompt.systemPrompt);
279
+ console.log(prompt.messages);
280
+ ```
281
+
282
+ ### Full Example
250
283
 
251
284
  ```typescript
252
- import { chat, chatPresets } from 'prompts.chat';
285
+ import { chat } from 'prompts.chat';
253
286
 
254
287
  const prompt = chat()
255
- // Persona
256
- .role("senior software architect")
257
- .tone("professional", "analytical")
258
- .expertise("system design", "microservices", "cloud architecture")
288
+ // ━━━ Persona ━━━
289
+ .persona({
290
+ name: "Alex",
291
+ role: "senior software architect",
292
+ tone: ["professional", "analytical"],
293
+ expertise: ["system-design", "microservices", "cloud-architecture"],
294
+ personality: ["patient", "thorough", "pragmatic"],
295
+ background: "15 years of experience at FAANG companies",
296
+ language: "English",
297
+ verbosity: "detailed"
298
+ })
299
+ .role("expert code reviewer") // Override role
300
+ .tone(["technical", "concise"]) // Override tone(s)
301
+ .expertise(["coding", "engineering"]) // Override expertise
302
+ .personality(["direct", "helpful"]) // Override personality
303
+ .background("Specialized in distributed systems")
304
+ .speakAs("CodeReviewer") // Set a name
305
+ .responseLanguage("English") // Response language
306
+
307
+ // ━━━ Context ━━━
308
+ .context({
309
+ background: "Reviewing a pull request for an e-commerce platform",
310
+ domain: "software engineering",
311
+ audience: "mid-level developers",
312
+ purpose: "improve code quality and maintainability",
313
+ constraints: ["Follow team coding standards", "Consider performance"],
314
+ assumptions: ["Team uses TypeScript", "Project uses React"],
315
+ knowledge: ["Existing codebase uses Redux", "Team prefers functional components"]
316
+ })
317
+ .domain("web development") // Set knowledge domain
318
+ .audience("junior developers") // Target audience
319
+ .purpose("educational code review") // Purpose of interaction
320
+ .constraints(["Be constructive", "Explain why"]) // Add constraints
321
+ .constraint("Focus on security issues") // Single constraint
322
+ .assumptions(["Code compiles successfully"]) // Set assumptions
323
+ .knowledge(["Using React 18", "Node.js backend"]) // Known facts
324
+
325
+ // ━━━ Task ━━━
326
+ .task({
327
+ instruction: "Review the submitted code and provide actionable feedback",
328
+ steps: [
329
+ "Analyze code structure and organization",
330
+ "Check for potential bugs and edge cases",
331
+ "Evaluate performance implications",
332
+ "Suggest improvements with examples"
333
+ ],
334
+ deliverables: ["Summary of issues", "Prioritized recommendations", "Code examples"],
335
+ criteria: ["Feedback is specific", "Examples are provided", "Tone is constructive"],
336
+ antiPatterns: ["Vague criticism", "No examples", "Harsh language"],
337
+ priority: "accuracy"
338
+ })
339
+ .instruction("Review this React component") // Main instruction
340
+ .steps([ // Override steps
341
+ "Check hooks usage",
342
+ "Verify prop types",
343
+ "Review state management"
344
+ ])
345
+ .deliverables(["Issue list", "Fixed code"]) // Expected deliverables
346
+ .criteria(["Clear explanations"]) // Success criteria
347
+ .avoid(["Being overly critical", "Ignoring context"]) // Anti-patterns
348
+ .priority("thoroughness") // accuracy | speed | creativity | thoroughness
259
349
 
260
- // Context
261
- .context("Designing a scalable e-commerce platform")
262
- .domain("software engineering")
350
+ // ━━━ Examples (Few-Shot) ━━━
351
+ .example(
352
+ "const [data, setData] = useState()",
353
+ "Consider adding a type parameter: useState<DataType>()",
354
+ "TypeScript generics improve type safety"
355
+ )
356
+ .examples([
357
+ { input: "useEffect(() => { fetch() })", output: "Add cleanup function for async operations" },
358
+ { input: "if(data == null)", output: "Use strict equality (===) for null checks" }
359
+ ])
360
+ .fewShot([ // Alternative few-shot syntax
361
+ { input: "var x = 1", output: "Use const or let instead of var" },
362
+ { input: "any[]", output: "Define specific array types" }
363
+ ])
263
364
 
264
- // Task
265
- .task("Review the architecture proposal and provide feedback")
266
- .objectives(["Identify bottlenecks", "Suggest improvements"])
365
+ // ━━━ Output Format ━━━
366
+ .output({
367
+ format: { type: "markdown" },
368
+ length: "detailed",
369
+ style: "mixed",
370
+ includeExamples: true,
371
+ includeExplanation: true
372
+ })
373
+ .outputFormat("markdown") // text | json | markdown | code | table
374
+ .json() // Shortcut for JSON output
375
+ .jsonSchema("CodeReview", { // JSON with schema
376
+ type: "object",
377
+ properties: {
378
+ issues: { type: "array" },
379
+ suggestions: { type: "array" }
380
+ }
381
+ })
382
+ .markdown() // Markdown output
383
+ .code("typescript") // Code output with language
384
+ .table() // Table output
267
385
 
268
- // Constraints
269
- .constraints(["Focus on scalability", "Consider cost"])
270
- .avoid(["Over-engineering", "Vendor lock-in"])
386
+ // ━━━ Output Length ━━━
387
+ .length("detailed") // brief | moderate | detailed | comprehensive | exhaustive
388
+ .brief() // Shortcut for brief
389
+ .moderate() // Shortcut for moderate
390
+ .detailed() // Shortcut for detailed
391
+ .comprehensive() // Shortcut for comprehensive
392
+ .exhaustive() // Shortcut for exhaustive
271
393
 
272
- // Reasoning
273
- .stepByStep()
274
- .showReasoning()
394
+ // ━━━ Output Style ━━━
395
+ .style("mixed") // prose | bullet-points | numbered-list | table | code | mixed | qa | dialogue
275
396
 
276
- // Output
277
- .json({ schema: { type: "object", properties: { feedback: { type: "array" } } } })
278
- .detailed()
397
+ // ━━━ Output Includes ━━━
398
+ .withExamples() // Include examples in response
399
+ .withExplanation() // Include explanations
400
+ .withSources() // Cite sources
401
+ .withConfidence() // Include confidence level
402
+
403
+ // ━━━ Reasoning ━━━
404
+ .reasoning({
405
+ style: "chain-of-thought",
406
+ showWork: true,
407
+ verifyAnswer: true,
408
+ considerAlternatives: true,
409
+ explainAssumptions: true
410
+ })
411
+ .reasoningStyle("step-by-step") // step-by-step | chain-of-thought | tree-of-thought | direct | analytical | ...
412
+ .stepByStep() // Shortcut: step-by-step + showWork
413
+ .chainOfThought() // Shortcut: chain-of-thought + showWork
414
+ .treeOfThought() // Shortcut: tree-of-thought + showWork
415
+ .firstPrinciples() // Shortcut: first-principles + showWork
416
+ .devilsAdvocate() // Shortcut: devil-advocate + considerAlternatives
417
+ .showWork() // Show reasoning process
418
+ .verifyAnswer() // Verify before presenting
419
+ .considerAlternatives() // Consider alternatives
420
+ .explainAssumptions() // Explain assumptions
421
+
422
+ // ━━━ Memory ━━━
423
+ .memory({
424
+ summary: "Previously discussed authentication patterns",
425
+ facts: ["User prefers JWT", "API uses REST"],
426
+ preferences: ["Concise answers", "Include code examples"],
427
+ history: [
428
+ { role: "user", content: "How do I handle auth?" },
429
+ { role: "assistant", content: "I recommend JWT with refresh tokens..." }
430
+ ]
431
+ })
432
+ .remember(["User is building a SaaS app"]) // Add facts to memory
433
+ .preferences(["Show code examples"]) // User preferences
434
+ .history([ // Previous messages
435
+ { role: "user", content: "Previous question..." },
436
+ { role: "assistant", content: "Previous answer..." }
437
+ ])
438
+ .summarizeHistory("Discussed React patterns") // Summary of history
279
439
 
280
- // Examples
281
- .example("Simple API design", "Consider using API Gateway for rate limiting...")
440
+ // ━━━ Messages ━━━
441
+ .system("You are a helpful assistant.") // System message
442
+ .user("Please review this code:", "developer") // User message (with optional name)
443
+ .assistant("I'll analyze the code now.") // Assistant message
444
+ .message("user", "Here's the code...") // Generic message
445
+ .messages([ // Multiple messages
446
+ { role: "user", content: "First question" },
447
+ { role: "assistant", content: "First answer" }
448
+ ])
449
+ .conversation([ // Conversation turns
450
+ { user: "What is X?", assistant: "X is..." },
451
+ { user: "How does it work?" }
452
+ ])
453
+
454
+ // ━━━ Custom ━━━
455
+ .addSystemPart("Additional system instructions") // Add to system prompt
456
+ .raw("Complete custom system prompt") // Replace with raw content
282
457
 
283
- // Messages
284
- .user("Here's my architecture proposal...")
285
458
  .build();
286
459
 
287
460
  // Access outputs
288
- console.log(prompt.systemPrompt); // Full system prompt
289
- console.log(prompt.messages); // Message array
290
- console.log(prompt.userPrompt); // Latest user message
461
+ console.log(prompt.messages); // Array of ChatMessage objects
462
+ console.log(prompt.systemPrompt); // Built system prompt string
463
+ console.log(prompt.userPrompt); // Latest user message content
464
+ console.log(prompt.metadata); // Structured metadata
291
465
 
292
- // Output formats
466
+ // Export formats
293
467
  const yaml = prompt.toYAML();
294
- const md = prompt.toMarkdown();
295
468
  const json = prompt.toJSON();
469
+ const md = prompt.toMarkdown();
470
+ const system = prompt.toSystemPrompt(); // Just the system prompt
471
+ const msgs = prompt.toMessages(); // Just the messages array
296
472
  ```
297
473
 
298
- ### Chat Builder Methods
474
+ ### Types Reference
299
475
 
300
- #### Persona
301
- | Method | Description |
302
- |--------|-------------|
303
- | `.role(role)` | Set the AI's role |
304
- | `.tone(tones...)` | Set communication tone(s) |
305
- | `.expertise(areas...)` | Define expertise areas |
306
- | `.personality(traits...)` | Set personality traits |
476
+ #### Message Types
477
+ ```typescript
478
+ type MessageRole = 'system' | 'user' | 'assistant';
307
479
 
308
- #### Context
309
- | Method | Description |
310
- |--------|-------------|
311
- | `.context(text)` | Set situation context |
312
- | `.domain(domain)` | Set knowledge domain |
313
- | `.audience(audience)` | Define target audience |
314
- | `.background(text)` | Add background info |
480
+ interface ChatMessage {
481
+ role: MessageRole;
482
+ content: string;
483
+ name?: string;
484
+ }
485
+ ```
315
486
 
316
- #### Task
317
- | Method | Description |
318
- |--------|-------------|
319
- | `.task(description)` | Main task description |
320
- | `.objectives(list)` | Add objectives |
321
- | `.scope(scope)` | Define scope |
322
- | `.priority(priority)` | Set priority |
487
+ #### Persona Types
488
+ ```typescript
489
+ type PersonaTone =
490
+ | 'professional' | 'casual' | 'formal' | 'friendly' | 'academic'
491
+ | 'technical' | 'creative' | 'empathetic' | 'authoritative' | 'playful'
492
+ | 'concise' | 'detailed' | 'socratic' | 'coaching' | 'analytical'
493
+ | 'encouraging' | 'neutral' | 'humorous' | 'serious';
494
+
495
+ type PersonaExpertise =
496
+ | 'general' | 'coding' | 'writing' | 'analysis' | 'research'
497
+ | 'teaching' | 'counseling' | 'creative' | 'legal' | 'medical'
498
+ | 'financial' | 'scientific' | 'engineering' | 'design' | 'marketing'
499
+ | 'business' | 'philosophy' | 'history' | 'languages' | 'mathematics';
500
+ ```
323
501
 
324
- #### Constraints
325
- | Method | Description |
326
- |--------|-------------|
327
- | `.constraints(list)` | Must-follow rules |
328
- | `.avoid(list)` | Things to avoid |
329
- | `.requirements(list)` | Requirements |
502
+ #### Reasoning Types
503
+ ```typescript
504
+ type ReasoningStyle =
505
+ | 'step-by-step' | 'chain-of-thought' | 'tree-of-thought'
506
+ | 'direct' | 'analytical' | 'comparative' | 'deductive' | 'inductive'
507
+ | 'first-principles' | 'analogical' | 'devil-advocate';
508
+ ```
330
509
 
331
- #### Reasoning
332
- | Method | Description |
333
- |--------|-------------|
334
- | `.stepByStep()` | Enable step-by-step reasoning |
335
- | `.showReasoning()` | Show reasoning process |
336
- | `.thinkFirst()` | Think before answering |
337
- | `.socratic()` | Use Socratic method |
510
+ #### Output Types
511
+ ```typescript
512
+ type ResponseFormatType = 'text' | 'json' | 'markdown' | 'code' | 'table';
338
513
 
339
- #### Output
340
- | Method | Description |
341
- |--------|-------------|
342
- | `.json(schema?)` | Output as JSON |
343
- | `.markdown()` | Output as Markdown |
344
- | `.yaml()` | Output as YAML |
345
- | `.xml()` | Output as XML |
346
- | `.code(language?)` | Output as code |
347
- | `.concise()` | Brief output |
348
- | `.detailed()` | Detailed output |
349
- | `.comprehensive()` | Comprehensive output |
350
-
351
- #### Messages
352
- | Method | Description |
353
- |--------|-------------|
354
- | `.system(content)` | Add system message |
355
- | `.user(content)` | Add user message |
356
- | `.assistant(content)` | Add assistant message |
357
- | `.example(input, output)` | Add few-shot example |
358
- | `.memory(key, value, priority?)` | Store memory |
514
+ type OutputLength = 'brief' | 'moderate' | 'detailed' | 'comprehensive' | 'exhaustive';
515
+
516
+ type OutputStyle = 'prose' | 'bullet-points' | 'numbered-list' | 'table' | 'code' | 'mixed' | 'qa' | 'dialogue';
517
+
518
+ interface JsonSchema {
519
+ name: string;
520
+ description?: string;
521
+ schema: Record<string, unknown>;
522
+ }
523
+ ```
359
524
 
360
- ### Chat Presets
525
+ ### Methods Reference
526
+
527
+ #### Message Methods
528
+ | Method | Signature | Description |
529
+ |--------|-----------|-------------|
530
+ | `.system()` | `system(content: string)` | Set system message |
531
+ | `.user()` | `user(content: string, name?: string)` | Add user message |
532
+ | `.assistant()` | `assistant(content: string)` | Add assistant message |
533
+ | `.message()` | `message(role, content, name?)` | Add generic message |
534
+ | `.messages()` | `messages(messages: ChatMessage[])` | Add multiple messages |
535
+ | `.conversation()` | `conversation(turns[])` | Add conversation turns |
536
+
537
+ #### Persona Methods
538
+ | Method | Signature | Description |
539
+ |--------|-----------|-------------|
540
+ | `.persona()` | `persona(settings: ChatPersona \| string)` | Set full persona |
541
+ | `.role()` | `role(role: string)` | Set AI role |
542
+ | `.tone()` | `tone(tone: PersonaTone \| PersonaTone[])` | Set tone(s) |
543
+ | `.expertise()` | `expertise(areas: PersonaExpertise \| PersonaExpertise[])` | Set expertise |
544
+ | `.personality()` | `personality(traits: string[])` | Set personality traits |
545
+ | `.background()` | `background(background: string)` | Set background info |
546
+ | `.speakAs()` | `speakAs(name: string)` | Set persona name |
547
+ | `.responseLanguage()` | `responseLanguage(language: string)` | Set response language |
548
+
549
+ #### Context Methods
550
+ | Method | Signature | Description |
551
+ |--------|-----------|-------------|
552
+ | `.context()` | `context(settings: ChatContext \| string)` | Set full context |
553
+ | `.domain()` | `domain(domain: string)` | Set knowledge domain |
554
+ | `.audience()` | `audience(audience: string)` | Set target audience |
555
+ | `.purpose()` | `purpose(purpose: string)` | Set purpose |
556
+ | `.constraints()` | `constraints(constraints: string[])` | Add constraints |
557
+ | `.constraint()` | `constraint(constraint: string)` | Add single constraint |
558
+ | `.assumptions()` | `assumptions(assumptions: string[])` | Set assumptions |
559
+ | `.knowledge()` | `knowledge(facts: string[])` | Set known facts |
560
+
561
+ #### Task Methods
562
+ | Method | Signature | Description |
563
+ |--------|-----------|-------------|
564
+ | `.task()` | `task(instruction: string \| ChatTask)` | Set task |
565
+ | `.instruction()` | `instruction(instruction: string)` | Set main instruction |
566
+ | `.steps()` | `steps(steps: string[])` | Set task steps |
567
+ | `.deliverables()` | `deliverables(deliverables: string[])` | Set deliverables |
568
+ | `.criteria()` | `criteria(criteria: string[])` | Set success criteria |
569
+ | `.avoid()` | `avoid(antiPatterns: string[])` | Set anti-patterns |
570
+ | `.priority()` | `priority(priority)` | Set priority |
571
+
572
+ #### Example Methods
573
+ | Method | Signature | Description |
574
+ |--------|-----------|-------------|
575
+ | `.example()` | `example(input, output, explanation?)` | Add single example |
576
+ | `.examples()` | `examples(examples: ChatExample[])` | Add multiple examples |
577
+ | `.fewShot()` | `fewShot(examples[])` | Add few-shot examples |
578
+
579
+ #### Output Format Methods
580
+ | Method | Signature | Description |
581
+ |--------|-----------|-------------|
582
+ | `.output()` | `output(settings: ChatOutput)` | Set full output settings |
583
+ | `.outputFormat()` | `outputFormat(format: ResponseFormatType)` | Set format type |
584
+ | `.json()` | `json(schema?: JsonSchema)` | JSON output |
585
+ | `.jsonSchema()` | `jsonSchema(name, schema, description?)` | JSON with schema |
586
+ | `.markdown()` | `markdown()` | Markdown output |
587
+ | `.code()` | `code(language?: string)` | Code output |
588
+ | `.table()` | `table()` | Table output |
589
+
590
+ #### Output Length Methods
591
+ | Method | Signature | Description |
592
+ |--------|-----------|-------------|
593
+ | `.length()` | `length(length: OutputLength)` | Set length |
594
+ | `.brief()` | `brief()` | Brief output |
595
+ | `.moderate()` | `moderate()` | Moderate output |
596
+ | `.detailed()` | `detailed()` | Detailed output |
597
+ | `.comprehensive()` | `comprehensive()` | Comprehensive output |
598
+ | `.exhaustive()` | `exhaustive()` | Exhaustive output |
599
+
600
+ #### Output Style Methods
601
+ | Method | Signature | Description |
602
+ |--------|-----------|-------------|
603
+ | `.style()` | `style(style: OutputStyle)` | Set output style |
604
+ | `.withExamples()` | `withExamples()` | Include examples |
605
+ | `.withExplanation()` | `withExplanation()` | Include explanations |
606
+ | `.withSources()` | `withSources()` | Cite sources |
607
+ | `.withConfidence()` | `withConfidence()` | Include confidence |
608
+
609
+ #### Reasoning Methods
610
+ | Method | Signature | Description |
611
+ |--------|-----------|-------------|
612
+ | `.reasoning()` | `reasoning(settings: ChatReasoning)` | Set full reasoning |
613
+ | `.reasoningStyle()` | `reasoningStyle(style: ReasoningStyle)` | Set style |
614
+ | `.stepByStep()` | `stepByStep()` | Step-by-step reasoning |
615
+ | `.chainOfThought()` | `chainOfThought()` | Chain-of-thought |
616
+ | `.treeOfThought()` | `treeOfThought()` | Tree-of-thought |
617
+ | `.firstPrinciples()` | `firstPrinciples()` | First principles |
618
+ | `.devilsAdvocate()` | `devilsAdvocate()` | Devil's advocate |
619
+ | `.showWork()` | `showWork(show?)` | Show reasoning |
620
+ | `.verifyAnswer()` | `verifyAnswer(verify?)` | Verify answer |
621
+ | `.considerAlternatives()` | `considerAlternatives(consider?)` | Consider alternatives |
622
+ | `.explainAssumptions()` | `explainAssumptions(explain?)` | Explain assumptions |
623
+
624
+ #### Memory Methods
625
+ | Method | Signature | Description |
626
+ |--------|-----------|-------------|
627
+ | `.memory()` | `memory(memory: ChatMemory)` | Set full memory |
628
+ | `.remember()` | `remember(facts: string[])` | Add facts |
629
+ | `.preferences()` | `preferences(prefs: string[])` | Set preferences |
630
+ | `.history()` | `history(messages: ChatMessage[])` | Set history |
631
+ | `.summarizeHistory()` | `summarizeHistory(summary: string)` | Set summary |
632
+
633
+ #### Custom & Output Methods
634
+ | Method | Signature | Description |
635
+ |--------|-----------|-------------|
636
+ | `.addSystemPart()` | `addSystemPart(part: string)` | Add system part |
637
+ | `.raw()` | `raw(content: string)` | Set raw content |
638
+ | `.build()` | `build(): BuiltChatPrompt` | Build the prompt |
639
+ | `.toString()` | `toString(): string` | Get system prompt |
640
+ | `.toSystemPrompt()` | `toSystemPrompt(): string` | Get system prompt |
641
+ | `.toMessages()` | `toMessages(): ChatMessage[]` | Get messages |
642
+ | `.toJSON()` | `toJSON(): string` | Export as JSON |
643
+ | `.toYAML()` | `toYAML(): string` | Export as YAML |
644
+ | `.toMarkdown()` | `toMarkdown(): string` | Export as Markdown |
645
+
646
+ ### Output Structure
647
+
648
+ ```typescript
649
+ interface BuiltChatPrompt {
650
+ messages: ChatMessage[]; // Full message array including system
651
+ systemPrompt: string; // Built system prompt
652
+ userPrompt?: string; // Latest user message content
653
+ metadata: {
654
+ persona?: ChatPersona;
655
+ context?: ChatContext;
656
+ task?: ChatTask;
657
+ output?: ChatOutput;
658
+ reasoning?: ChatReasoning;
659
+ examples?: ChatExample[];
660
+ };
661
+ }
662
+ ```
663
+
664
+ ### Presets
665
+
666
+ Pre-configured builders for common use cases:
361
667
 
362
668
  ```typescript
363
669
  import { chatPresets } from 'prompts.chat';
364
670
 
365
671
  // Expert coder
366
- const coder = chatPresets.coder("TypeScript");
672
+ const coder = chatPresets.coder("TypeScript")
673
+ .task("Review this function")
674
+ .user("function add(a, b) { return a + b }");
675
+
676
+ // Creative/Professional/Academic writer
677
+ const writer = chatPresets.writer("creative")
678
+ .task("Write a short story");
679
+
680
+ // Patient tutor with subject expertise
681
+ const tutor = chatPresets.tutor("mathematics")
682
+ .user("Explain derivatives");
367
683
 
368
- // Creative writer
369
- const writer = chatPresets.writer("technical");
684
+ // Data analyst with chain-of-thought
685
+ const analyst = chatPresets.analyst()
686
+ .user("Analyze these sales figures");
370
687
 
371
- // Patient tutor
372
- const tutor = chatPresets.tutor("mathematics");
688
+ // Socratic philosopher (asks questions)
689
+ const socratic = chatPresets.socratic()
690
+ .user("What is justice?");
373
691
 
374
- // Data analyst
375
- const analyst = chatPresets.analyst();
692
+ // Constructive critic
693
+ const critic = chatPresets.critic()
694
+ .user("Review my business plan");
376
695
 
377
- // Socratic teacher
378
- const socratic = chatPresets.socratic();
696
+ // Creative brainstormer
697
+ const brainstormer = chatPresets.brainstormer()
698
+ .user("Ideas for a mobile app");
379
699
 
380
- // JSON responder
381
- const jsonBot = chatPresets.jsonResponder({
700
+ // JSON-only responder with schema
701
+ const jsonBot = chatPresets.jsonResponder("Response", {
382
702
  type: "object",
383
- properties: { answer: { type: "string" } }
703
+ properties: {
704
+ answer: { type: "string" },
705
+ confidence: { type: "number" }
706
+ }
384
707
  });
385
708
 
386
- // Summarizer
387
- const summarizer = chatPresets.summarizer(100);
709
+ // Summarizer with length control
710
+ const summarizer = chatPresets.summarizer("brief")
711
+ .user("Summarize this article...");
712
+
713
+ // Translator to target language
714
+ const translator = chatPresets.translator("Japanese")
715
+ .user("Hello, how are you?");
716
+ ```
717
+
718
+ ### Usage Examples
388
719
 
389
- // Translator
390
- const translator = chatPresets.translator("English", "Japanese");
720
+ #### Code Review Assistant
721
+ ```typescript
722
+ const codeReview = chat()
723
+ .role("senior code reviewer")
724
+ .expertise("coding")
725
+ .tone(["professional", "constructive"])
726
+ .context("TypeScript React project")
727
+ .task("Review code for bugs, performance, and best practices")
728
+ .steps([
729
+ "Identify potential bugs",
730
+ "Check for performance issues",
731
+ "Suggest improvements"
732
+ ])
733
+ .criteria(["Be specific", "Provide examples"])
734
+ .avoid(["Harsh criticism", "Vague feedback"])
735
+ .markdown()
736
+ .detailed()
737
+ .withExamples()
738
+ .user("Please review this component...")
739
+ .build();
740
+ ```
741
+
742
+ #### Research Assistant
743
+ ```typescript
744
+ const research = chat()
745
+ .role("research assistant")
746
+ .expertise(["research", "analysis"])
747
+ .tone("academic")
748
+ .context({
749
+ domain: "machine learning",
750
+ audience: "PhD students",
751
+ purpose: "literature review"
752
+ })
753
+ .task("Analyze and summarize research papers")
754
+ .chainOfThought()
755
+ .withSources()
756
+ .detailed()
757
+ .markdown()
758
+ .build();
759
+ ```
760
+
761
+ #### JSON API Response
762
+ ```typescript
763
+ const apiHelper = chat()
764
+ .role("API response generator")
765
+ .tone("concise")
766
+ .jsonSchema("UserData", {
767
+ type: "object",
768
+ properties: {
769
+ users: {
770
+ type: "array",
771
+ items: {
772
+ type: "object",
773
+ properties: {
774
+ id: { type: "number" },
775
+ name: { type: "string" },
776
+ email: { type: "string" }
777
+ }
778
+ }
779
+ },
780
+ total: { type: "number" }
781
+ }
782
+ })
783
+ .avoid(["Include markdown", "Add explanations", "Use code fences"])
784
+ .user("Generate 3 sample users")
785
+ .build();
786
+ ```
787
+
788
+ #### Multi-Turn Conversation
789
+ ```typescript
790
+ const conversation = chat()
791
+ .role("helpful assistant")
792
+ .tone("friendly")
793
+ .memory({
794
+ summary: "User is learning Python",
795
+ facts: ["User is a beginner", "Prefers practical examples"],
796
+ preferences: ["Step-by-step explanations"]
797
+ })
798
+ .conversation([
799
+ { user: "What is a variable?", assistant: "A variable is a container for storing data..." },
800
+ { user: "How do I create one?" }
801
+ ])
802
+ .stepByStep()
803
+ .withExamples()
804
+ .build();
391
805
  ```
392
806
 
393
807
  ---
394
808
 
395
809
  ## 🎨 Image Builder
396
810
 
397
- Comprehensive builder for image generation prompts (Midjourney, DALL-E, Stable Diffusion, etc.).
811
+ Comprehensive builder for image generation prompts. Works with Midjourney, DALL-E, Stable Diffusion, Flux, and other image AI platforms.
812
+
813
+ ### Quick Start
814
+
815
+ ```typescript
816
+ import { image } from 'prompts.chat';
817
+
818
+ const prompt = image()
819
+ .subject("a lone samurai")
820
+ .environment("bamboo forest at dawn")
821
+ .camera({ angle: "low-angle", shot: "wide", lens: "35mm" })
822
+ .lighting({ type: "rim", time: "golden-hour" })
823
+ .medium("cinematic")
824
+ .build();
825
+
826
+ console.log(prompt.prompt);
827
+ ```
828
+
829
+ ### Full Example
398
830
 
399
831
  ```typescript
400
832
  import { image } from 'prompts.chat';
401
833
 
402
834
  const prompt = image()
403
- // Subject
404
- .subject("a cyberpunk samurai warrior")
405
- .subjectDetails({
835
+ // ━━━ Subject ━━━
836
+ .subject({
837
+ main: "a cyberpunk samurai warrior",
838
+ expression: "determined and fierce",
406
839
  pose: "dynamic battle stance",
407
- expression: "determined",
840
+ action: "deflecting bullets with katana",
408
841
  clothing: "neon-lit armor with glowing circuits",
409
- accessories: ["katana", "holographic visor"]
842
+ accessories: ["holographic visor", "cyber-enhanced arm"],
843
+ age: "30s",
844
+ gender: "female"
410
845
  })
846
+ .subjectDetails(["intricate tattoos", "flowing hair"]) // Additional details
847
+ .expression("intense focus") // Override expression
848
+ .pose("mid-swing attack") // Override pose
849
+ .action("slicing through rain droplets") // Override action
850
+ .clothing("black nano-fiber suit") // Override clothing
851
+ .accessories(["glowing katana", "shoulder armor"]) // Override accessories
852
+ .subjectCount("single") // single | couple | group | crowd | number
411
853
 
412
- // Environment
413
- .environment("rain-soaked Tokyo alley")
414
- .setting("urban", "futuristic")
415
- .atmosphere("electric", "mysterious")
416
- .weather("rain")
417
- .timeOfDay("night")
854
+ // ━━━ Environment ━━━
855
+ .environment({
856
+ setting: "rain-soaked Tokyo alley",
857
+ location: "Shibuya district",
858
+ atmosphere: "electric and mysterious",
859
+ props: ["neon signs", "steam vents", "holographic ads"],
860
+ season: "winter"
861
+ })
862
+ .location("Neo-Tokyo, 2087") // Specific location
863
+ .props(["flying cars overhead", "robot vendors"]) // Scene props
864
+ .atmosphere("dense fog with neon glow") // Atmospheric description
865
+ .season("autumn") // spring | summer | autumn | winter
418
866
 
419
- // Camera
420
- .shot("medium")
421
- .angle("low-angle")
422
- .lens("35mm")
423
- .aperture("f/1.8")
424
- .focus("sharp")
425
- .cameraBrand("Sony")
426
- .cameraModel("A7R V")
427
- .bokeh("smooth")
867
+ // ━━━ Camera: Framing ━━━
868
+ .shot("medium") // extreme-close-up | close-up | medium | wide | ...
869
+ .angle("low-angle") // eye-level | low-angle | high-angle | dutch-angle | ...
870
+ .lens("35mm") // wide-angle | 35mm | 50mm | 85mm | telephoto | ...
871
+ .focalLength("35mm") // Specific focal length
428
872
 
429
- // Lighting
430
- .lightingType("neon")
431
- .lightingDirection("rim")
432
- .lightingIntensity("dramatic")
873
+ // ━━━ Camera: Focus & Depth ━━━
874
+ .focus("shallow") // shallow | deep | soft-focus | tilt-shift | bokeh-heavy | ...
875
+ .aperture("f/1.4") // Aperture setting
876
+ .bokeh("smooth") // smooth | creamy | swirly | soap-bubble | oval-anamorphic | ...
433
877
 
434
- // Style
435
- .medium("cinematic")
436
- .artStyle("cyberpunk")
437
- .artist("Syd Mead")
438
- .era("futuristic")
439
- .filmStock("Kodak Vision3 500T")
878
+ // ━━━ Camera: Equipment ━━━
879
+ .cameraBrand("sony") // sony | canon | nikon | leica | hasselblad | arri | ...
880
+ .cameraModel("sony-a7riv") // Specific camera model
881
+ .sensor("full-frame") // full-frame | aps-c | medium-format | ...
882
+ .lensBrand("zeiss") // zeiss | leica | sigma | canon | ...
883
+ .lensModel("zeiss-otus-55") // Specific lens model
440
884
 
441
- // Color
442
- .colorPalette("cyberpunk")
443
- .colorGrade("teal and orange")
444
- .saturation("vibrant")
885
+ // ━━━ Camera: Film & Filters ━━━
886
+ .filmStock("kodak-portra-400") // Kodak, Fujifilm, CineStill, Ilford stocks
887
+ .filmFormat("35mm") // 35mm | 120-medium-format | instant-film | ...
888
+ .filter("black-pro-mist") // nd | polarizer | black-pro-mist | diffusion | ...
889
+
890
+ // ━━━ Camera: Exposure ━━━
891
+ .iso(800) // ISO sensitivity
892
+ .shutterSpeed("1/250") // Shutter speed
893
+ .whiteBalance("tungsten") // daylight | cloudy | tungsten | fluorescent | ...
894
+ .colorProfile("S-Log3") // Color profile
895
+
896
+ // ━━━ Lighting ━━━
897
+ .lighting({
898
+ type: ["rim", "practical"],
899
+ time: "night",
900
+ direction: "back",
901
+ intensity: "dramatic",
902
+ color: "neon pink and blue",
903
+ sources: ["neon signs", "car headlights"]
904
+ })
905
+ .lightingType(["rim", "backlit"]) // natural | studio | rim | rembrandt | butterfly | ...
906
+ .timeOfDay("night") // dawn | golden-hour | midday | blue-hour | night | ...
907
+ .weather("rainy") // sunny | cloudy | foggy | rainy | stormy | snowy | ...
908
+ .lightDirection("back") // front | side | back | top | three-quarter
909
+ .lightIntensity("dramatic") // soft | medium | hard | dramatic
910
+
911
+ // ━━━ Composition ━━━
912
+ .composition({
913
+ ruleOfThirds: true,
914
+ symmetry: "none",
915
+ foreground: "rain droplets",
916
+ midground: "samurai figure",
917
+ background: "towering neon buildings"
918
+ })
919
+ .ruleOfThirds() // Enable rule of thirds
920
+ .goldenRatio() // Enable golden ratio
921
+ .symmetry("vertical") // none | horizontal | vertical | radial
922
+ .foreground("splashing water droplets") // Foreground element
923
+ .midground("central figure in action") // Midground element
924
+ .background("city skyline with flying vehicles") // Background element
925
+
926
+ // ━━━ Style ━━━
927
+ .style({
928
+ medium: ["cinematic", "cyberpunk"],
929
+ artist: ["Syd Mead", "Simon Stålenhag"],
930
+ era: "futuristic",
931
+ influence: ["Blade Runner", "Ghost in the Shell"],
932
+ quality: ["highly detailed", "award-winning"]
933
+ })
934
+ .medium("cinematic") // photorealistic | cinematic | anime | oil-painting | ...
935
+ .artist(["Syd Mead", "Masamune Shirow"]) // Reference artist(s)
936
+ .influence(["Akira", "The Matrix"]) // Style influences
937
+
938
+ // ━━━ Color ━━━
939
+ .color({
940
+ palette: "neon",
941
+ primary: ["cyan", "magenta"],
942
+ accent: ["yellow", "white"],
943
+ grade: "teal and orange",
944
+ temperature: "cool",
945
+ saturation: "vibrant",
946
+ contrast: "high"
947
+ })
948
+ .palette("neon") // warm | cool | vibrant | neon | monochrome | ...
949
+ .primaryColors(["electric blue", "hot pink"]) // Primary color scheme
950
+ .accentColors(["neon yellow", "white"]) // Accent colors
951
+ .colorGrade("cyberpunk teal and orange") // Color grading style
952
+
953
+ // ━━━ Technical ━━━
954
+ .technical({
955
+ aspectRatio: "16:9",
956
+ resolution: "8K",
957
+ quality: "masterpiece",
958
+ detail: "extreme",
959
+ noise: "filmic",
960
+ sharpness: "crisp"
961
+ })
962
+ .aspectRatio("16:9") // 1:1 | 4:3 | 3:2 | 16:9 | 21:9 | 9:16 | ...
963
+ .resolution("8K") // Resolution string
964
+ .quality("masterpiece") // draft | standard | high | ultra | masterpiece
965
+
966
+ // ━━━ Mood & Misc ━━━
967
+ .mood(["dramatic", "mysterious", "epic"]) // serene | dramatic | tense | epic | intimate | ...
968
+ .negative(["blurry", "low quality", "watermark"]) // Negative prompt items
969
+ .custom("volumetric lighting through rain") // Custom prompt text
970
+ .custom("lens flare from neon signs")
445
971
 
446
- // Technical
447
- .resolution("8K")
448
- .quality("ultra-detailed")
449
- .aspectRatio("16:9")
450
972
  .build();
451
973
 
452
- console.log(prompt.prompt); // Text prompt
453
- console.log(prompt.negativePrompt); // Negative prompt
974
+ // Access outputs
975
+ console.log(prompt.prompt); // Full formatted prompt with --no and --ar flags
976
+ console.log(prompt.structure); // Full structured data object
454
977
 
455
- // Output formats
456
- const json = prompt.toJSON();
978
+ // Export formats
457
979
  const yaml = prompt.toYAML();
980
+ const json = prompt.toJSON();
458
981
  const md = prompt.toMarkdown();
459
982
  ```
460
983
 
461
- ### Camera Options
984
+ ### Types Reference
985
+
986
+ #### Camera Types
987
+ ```typescript
988
+ type ShotType = 'extreme-close-up' | 'close-up' | 'medium-close-up' | 'medium'
989
+ | 'medium-wide' | 'wide' | 'extreme-wide' | 'establishing' | 'full-body' | 'portrait' | 'headshot';
990
+
991
+ type CameraAngle = 'eye-level' | 'low-angle' | 'high-angle' | 'dutch-angle' | 'birds-eye'
992
+ | 'worms-eye' | 'over-the-shoulder' | 'point-of-view' | 'aerial' | 'drone'
993
+ | 'canted' | 'oblique' | 'hip-level' | 'knee-level' | 'ground-level';
994
+
995
+ type LensType = 'wide-angle' | 'ultra-wide' | 'standard' | 'telephoto' | 'macro' | 'fisheye'
996
+ | '14mm' | '24mm' | '35mm' | '50mm' | '85mm' | '100mm' | '135mm' | '200mm' | '400mm'
997
+ | 'tilt-shift' | 'anamorphic' | 'spherical' | 'prime' | 'zoom';
998
+
999
+ type FocusType = 'shallow' | 'deep' | 'soft-focus' | 'tilt-shift' | 'rack-focus' | 'split-diopter'
1000
+ | 'zone-focus' | 'hyperfocal' | 'selective' | 'bokeh-heavy' | 'tack-sharp';
1001
+
1002
+ type BokehStyle = 'smooth' | 'creamy' | 'swirly' | 'busy' | 'soap-bubble' | 'cat-eye' | 'oval-anamorphic';
1003
+ ```
1004
+
1005
+ #### Equipment Types
1006
+ ```typescript
1007
+ type CameraBrand = 'sony' | 'canon' | 'nikon' | 'fujifilm' | 'leica' | 'hasselblad' | 'phase-one'
1008
+ | 'panasonic' | 'olympus' | 'pentax' | 'red' | 'arri' | 'blackmagic' | 'panavision';
1009
+
1010
+ type CameraModel = 'sony-a7iv' | 'sony-a7riv' | 'sony-a1' | 'canon-r5' | 'canon-r6'
1011
+ | 'nikon-z9' | 'nikon-z8' | 'leica-m11' | 'leica-q3' | 'hasselblad-x2d'
1012
+ | 'fujifilm-x-t5' | 'fujifilm-gfx100s' | 'arri-alexa-35' | 'red-v-raptor' | ...;
462
1013
 
463
- | Category | Examples |
464
- |----------|----------|
465
- | **Brands** | Canon, Nikon, Sony, ARRI, RED, Hasselblad, Leica, Fujifilm |
466
- | **Shot Types** | extreme-close-up, close-up, medium, full, wide, aerial |
467
- | **Angles** | eye-level, low-angle, high-angle, dutch, bird's-eye, worm's-eye |
468
- | **Lens Types** | wide, standard, telephoto, macro, fisheye, anamorphic |
469
- | **Film Stocks** | Kodak Portra, Fuji Velvia, Kodak Vision3, Ilford HP5 |
1014
+ type SensorFormat = 'full-frame' | 'aps-c' | 'micro-four-thirds' | 'medium-format' | 'large-format'
1015
+ | 'super-35' | 'vista-vision' | 'imax' | '65mm' | '35mm-film' | '16mm-film' | '8mm-film';
470
1016
 
471
- ### Lighting Options
1017
+ type LensBrand = 'zeiss' | 'leica' | 'canon' | 'nikon' | 'sony' | 'sigma' | 'tamron' | 'voigtlander'
1018
+ | 'fujifilm' | 'samyang' | 'rokinon' | 'tokina' | 'cooke' | 'arri' | 'panavision';
472
1019
 
473
- | Type | Examples |
474
- |------|----------|
475
- | **Lighting Types** | natural, studio, rim, butterfly, rembrandt, neon, volumetric |
476
- | **Time of Day** | golden-hour, blue-hour, midday, sunset, night, dawn |
477
- | **Weather** | clear, cloudy, rain, snow, fog, storm |
1020
+ type LensModel = 'zeiss-otus-55' | 'zeiss-batis-85' | 'leica-summilux-50' | 'leica-noctilux-50'
1021
+ | 'canon-rf-50-1.2' | 'sony-gm-85-1.4' | 'sigma-art-35' | 'helios-44-2' | ...;
1022
+ ```
478
1023
 
479
- ### Style Options
1024
+ #### Film & Filter Types
1025
+ ```typescript
1026
+ type FilmStock =
1027
+ // Kodak Color
1028
+ | 'kodak-portra-160' | 'kodak-portra-400' | 'kodak-portra-800' | 'kodak-ektar-100' | 'kodak-gold-200'
1029
+ // Kodak B&W
1030
+ | 'kodak-tri-x-400' | 'kodak-tmax-100' | 'kodak-tmax-400'
1031
+ // Kodak Cinema
1032
+ | 'kodak-vision3-50d' | 'kodak-vision3-200t' | 'kodak-vision3-500t'
1033
+ // Fujifilm
1034
+ | 'fujifilm-pro-400h' | 'fujifilm-velvia-50' | 'fujifilm-velvia-100' | 'fujifilm-provia-100f'
1035
+ // Ilford
1036
+ | 'ilford-hp5-plus' | 'ilford-delta-400' | 'ilford-fp4-plus'
1037
+ // CineStill
1038
+ | 'cinestill-50d' | 'cinestill-800t'
1039
+ // Instant
1040
+ | 'polaroid-sx-70' | 'polaroid-600' | 'instax-mini' | ...;
1041
+
1042
+ type FilmFormat = '35mm' | '120-medium-format' | '4x5-large-format' | '8x10-large-format'
1043
+ | '110-film' | 'instant-film' | 'super-8' | '16mm' | '65mm-imax';
1044
+
1045
+ type FilterType = 'uv' | 'polarizer' | 'nd' | 'nd-graduated' | 'black-pro-mist' | 'white-pro-mist'
1046
+ | 'glimmer-glass' | 'classic-soft' | 'streak' | 'starburst' | 'diffusion'
1047
+ | 'infrared' | 'color-gel' | 'warming' | 'cooling' | 'vintage-look';
1048
+ ```
480
1049
 
481
- | Category | Examples |
482
- |----------|----------|
483
- | **Art Styles** | photorealistic, anime, oil-painting, watercolor, cyberpunk, art-deco |
484
- | **Mediums** | photography, cinematic, illustration, 3d-render, concept-art |
485
- | **Color Palettes** | warm, cool, pastel, neon, monochrome, vintage |
1050
+ #### Lighting Types
1051
+ ```typescript
1052
+ type LightingType = 'natural' | 'studio' | 'dramatic' | 'soft' | 'hard' | 'diffused'
1053
+ | 'key' | 'fill' | 'rim' | 'backlit' | 'silhouette' | 'rembrandt'
1054
+ | 'split' | 'butterfly' | 'loop' | 'broad' | 'short' | 'chiaroscuro'
1055
+ | 'high-key' | 'low-key' | 'three-point' | 'practical' | 'motivated';
1056
+
1057
+ type TimeOfDay = 'dawn' | 'sunrise' | 'golden-hour' | 'morning' | 'midday' | 'afternoon'
1058
+ | 'blue-hour' | 'sunset' | 'dusk' | 'twilight' | 'night' | 'midnight';
1059
+
1060
+ type WeatherLighting = 'sunny' | 'cloudy' | 'overcast' | 'foggy' | 'misty'
1061
+ | 'rainy' | 'stormy' | 'snowy' | 'hazy';
1062
+ ```
1063
+
1064
+ #### Style & Color Types
1065
+ ```typescript
1066
+ type ArtStyle = 'photorealistic' | 'hyperrealistic' | 'cinematic' | 'documentary'
1067
+ | 'editorial' | 'fashion' | 'portrait' | 'landscape' | 'street' | 'fine-art'
1068
+ | 'conceptual' | 'surreal' | 'abstract' | 'minimalist' | 'maximalist'
1069
+ | 'vintage' | 'retro' | 'noir' | 'gothic' | 'romantic'
1070
+ | 'impressionist' | 'expressionist' | 'pop-art' | 'art-nouveau' | 'art-deco'
1071
+ | 'cyberpunk' | 'steampunk' | 'fantasy' | 'sci-fi' | 'anime' | 'manga'
1072
+ | 'comic-book' | 'illustration' | 'digital-art' | 'oil-painting' | 'watercolor'
1073
+ | 'sketch' | 'pencil-drawing' | 'charcoal' | 'pastel' | '3d-render';
1074
+
1075
+ type ColorPalette = 'warm' | 'cool' | 'neutral' | 'vibrant' | 'muted' | 'pastel' | 'neon'
1076
+ | 'monochrome' | 'sepia' | 'desaturated' | 'high-contrast' | 'low-contrast'
1077
+ | 'earthy' | 'oceanic' | 'forest' | 'sunset' | 'midnight' | 'golden';
1078
+
1079
+ type Mood = 'serene' | 'peaceful' | 'melancholic' | 'dramatic' | 'tense' | 'mysterious'
1080
+ | 'romantic' | 'nostalgic' | 'hopeful' | 'joyful' | 'energetic' | 'chaotic'
1081
+ | 'ethereal' | 'dark' | 'light' | 'whimsical' | 'eerie' | 'epic' | 'intimate';
1082
+
1083
+ type AspectRatio = '1:1' | '4:3' | '3:2' | '16:9' | '21:9' | '9:16' | '2:3' | '4:5' | '5:4';
1084
+ ```
1085
+
1086
+ ### Methods Reference
1087
+
1088
+ #### Subject Methods
1089
+ | Method | Signature | Description |
1090
+ |--------|-----------|-------------|
1091
+ | `.subject()` | `subject(main: string \| ImageSubject)` | Set main subject |
1092
+ | `.subjectDetails()` | `subjectDetails(details: string[])` | Add subject details |
1093
+ | `.expression()` | `expression(expression: string)` | Set facial expression |
1094
+ | `.pose()` | `pose(pose: string)` | Set body pose |
1095
+ | `.action()` | `action(action: string)` | Set action/activity |
1096
+ | `.clothing()` | `clothing(clothing: string)` | Set clothing |
1097
+ | `.accessories()` | `accessories(accessories: string[])` | Set accessories |
1098
+ | `.subjectCount()` | `subjectCount(count)` | Set subject count |
1099
+
1100
+ #### Environment Methods
1101
+ | Method | Signature | Description |
1102
+ |--------|-----------|-------------|
1103
+ | `.environment()` | `environment(setting: string \| ImageEnvironment)` | Set environment |
1104
+ | `.location()` | `location(location: string)` | Set specific location |
1105
+ | `.props()` | `props(props: string[])` | Set scene props |
1106
+ | `.atmosphere()` | `atmosphere(atmosphere: string)` | Set atmosphere |
1107
+ | `.season()` | `season(season)` | Set season |
1108
+
1109
+ #### Camera Methods
1110
+ | Method | Signature | Description |
1111
+ |--------|-----------|-------------|
1112
+ | `.camera()` | `camera(settings: ImageCamera)` | Set all camera settings |
1113
+ | `.shot()` | `shot(shot: ShotType)` | Set shot type |
1114
+ | `.angle()` | `angle(angle: CameraAngle)` | Set camera angle |
1115
+ | `.lens()` | `lens(lens: LensType)` | Set lens type |
1116
+ | `.focus()` | `focus(focus: FocusType)` | Set focus type |
1117
+ | `.aperture()` | `aperture(aperture: string)` | Set aperture |
1118
+ | `.bokeh()` | `bokeh(style: BokehStyle)` | Set bokeh style |
1119
+ | `.cameraBrand()` | `cameraBrand(brand: CameraBrand)` | Set camera brand |
1120
+ | `.cameraModel()` | `cameraModel(model: CameraModel)` | Set camera model |
1121
+ | `.sensor()` | `sensor(sensor: SensorFormat)` | Set sensor format |
1122
+ | `.lensBrand()` | `lensBrand(brand: LensBrand)` | Set lens brand |
1123
+ | `.lensModel()` | `lensModel(model: LensModel)` | Set lens model |
1124
+ | `.focalLength()` | `focalLength(length: string)` | Set focal length |
1125
+ | `.filmStock()` | `filmStock(stock: FilmStock)` | Set film stock |
1126
+ | `.filmFormat()` | `filmFormat(format: FilmFormat)` | Set film format |
1127
+ | `.filter()` | `filter(filter: FilterType)` | Set lens filter |
1128
+ | `.iso()` | `iso(iso: number)` | Set ISO |
1129
+ | `.shutterSpeed()` | `shutterSpeed(speed: string)` | Set shutter speed |
1130
+ | `.whiteBalance()` | `whiteBalance(wb)` | Set white balance |
1131
+ | `.colorProfile()` | `colorProfile(profile: string)` | Set color profile |
1132
+
1133
+ #### Lighting Methods
1134
+ | Method | Signature | Description |
1135
+ |--------|-----------|-------------|
1136
+ | `.lighting()` | `lighting(settings: ImageLighting)` | Set all lighting |
1137
+ | `.lightingType()` | `lightingType(type)` | Set lighting type(s) |
1138
+ | `.timeOfDay()` | `timeOfDay(time: TimeOfDay)` | Set time of day |
1139
+ | `.weather()` | `weather(weather: WeatherLighting)` | Set weather |
1140
+ | `.lightDirection()` | `lightDirection(direction)` | Set light direction |
1141
+ | `.lightIntensity()` | `lightIntensity(intensity)` | Set light intensity |
1142
+
1143
+ #### Composition Methods
1144
+ | Method | Signature | Description |
1145
+ |--------|-----------|-------------|
1146
+ | `.composition()` | `composition(settings: ImageComposition)` | Set all composition |
1147
+ | `.ruleOfThirds()` | `ruleOfThirds()` | Enable rule of thirds |
1148
+ | `.goldenRatio()` | `goldenRatio()` | Enable golden ratio |
1149
+ | `.symmetry()` | `symmetry(type)` | Set symmetry type |
1150
+ | `.foreground()` | `foreground(fg: string)` | Set foreground |
1151
+ | `.midground()` | `midground(mg: string)` | Set midground |
1152
+ | `.background()` | `background(bg: string)` | Set background |
1153
+
1154
+ #### Style Methods
1155
+ | Method | Signature | Description |
1156
+ |--------|-----------|-------------|
1157
+ | `.style()` | `style(settings: ImageStyle)` | Set all style settings |
1158
+ | `.medium()` | `medium(medium: ArtStyle)` | Set art style/medium |
1159
+ | `.artist()` | `artist(artist: string \| string[])` | Set reference artist(s) |
1160
+ | `.influence()` | `influence(influences: string[])` | Set style influences |
1161
+
1162
+ #### Color Methods
1163
+ | Method | Signature | Description |
1164
+ |--------|-----------|-------------|
1165
+ | `.color()` | `color(settings: ImageColor)` | Set all color settings |
1166
+ | `.palette()` | `palette(palette: ColorPalette)` | Set color palette |
1167
+ | `.primaryColors()` | `primaryColors(colors: string[])` | Set primary colors |
1168
+ | `.accentColors()` | `accentColors(colors: string[])` | Set accent colors |
1169
+ | `.colorGrade()` | `colorGrade(grade: string)` | Set color grade |
1170
+
1171
+ #### Technical & Output Methods
1172
+ | Method | Signature | Description |
1173
+ |--------|-----------|-------------|
1174
+ | `.technical()` | `technical(settings: ImageTechnical)` | Set all technical |
1175
+ | `.aspectRatio()` | `aspectRatio(ratio: AspectRatio)` | Set aspect ratio |
1176
+ | `.resolution()` | `resolution(resolution: string)` | Set resolution |
1177
+ | `.quality()` | `quality(quality)` | Set quality level |
1178
+ | `.mood()` | `mood(mood: Mood \| Mood[])` | Set mood(s) |
1179
+ | `.negative()` | `negative(items: string[])` | Add negative prompts |
1180
+ | `.custom()` | `custom(text: string)` | Add custom text |
1181
+ | `.build()` | `build(): BuiltImagePrompt` | Build the prompt |
1182
+ | `.toString()` | `toString(): string` | Get prompt string |
1183
+ | `.toJSON()` | `toJSON(): string` | Export as JSON |
1184
+ | `.toYAML()` | `toYAML(): string` | Export as YAML |
1185
+ | `.toMarkdown()` | `toMarkdown(): string` | Export as Markdown |
1186
+
1187
+ ### Output Structure
1188
+
1189
+ ```typescript
1190
+ interface BuiltImagePrompt {
1191
+ prompt: string; // Full formatted prompt with --no and --ar flags
1192
+ structure: {
1193
+ subject?: ImageSubject;
1194
+ camera?: ImageCamera;
1195
+ lighting?: ImageLighting;
1196
+ composition?: ImageComposition;
1197
+ style?: ImageStyle;
1198
+ color?: ImageColor;
1199
+ environment?: ImageEnvironment;
1200
+ technical?: ImageTechnical;
1201
+ mood?: Mood | Mood[];
1202
+ negative?: string[];
1203
+ };
1204
+ }
1205
+ ```
1206
+
1207
+ ### Usage Examples
1208
+
1209
+ #### Portrait Photography
1210
+ ```typescript
1211
+ const portrait = image()
1212
+ .subject({
1213
+ main: "elderly fisherman",
1214
+ expression: "weathered but kind smile",
1215
+ age: "70s",
1216
+ clothing: "worn yellow raincoat"
1217
+ })
1218
+ .environment("misty harbor at dawn")
1219
+ .shot("close-up")
1220
+ .angle("eye-level")
1221
+ .lens("85mm")
1222
+ .focus("shallow")
1223
+ .aperture("f/1.8")
1224
+ .lightingType("natural")
1225
+ .timeOfDay("golden-hour")
1226
+ .medium("portrait")
1227
+ .filmStock("kodak-portra-400")
1228
+ .mood("nostalgic")
1229
+ .quality("masterpiece")
1230
+ .build();
1231
+ ```
1232
+
1233
+ #### Fantasy Illustration
1234
+ ```typescript
1235
+ const fantasy = image()
1236
+ .subject({
1237
+ main: "elven queen",
1238
+ expression: "regal and mysterious",
1239
+ pose: "seated on crystal throne",
1240
+ clothing: "flowing silver gown with starlight patterns",
1241
+ accessories: ["crown of moonstone", "ancient scepter"]
1242
+ })
1243
+ .environment({
1244
+ setting: "ethereal forest palace",
1245
+ atmosphere: "magical mist and floating lights",
1246
+ props: ["glowing flowers", "ancient trees"]
1247
+ })
1248
+ .medium(["fantasy", "illustration"])
1249
+ .artist(["Alan Lee", "Brian Froud"])
1250
+ .palette("cool")
1251
+ .primaryColors(["silver", "deep blue", "violet"])
1252
+ .lightingType("soft")
1253
+ .mood(["ethereal", "mysterious"])
1254
+ .aspectRatio("2:3")
1255
+ .quality("ultra")
1256
+ .negative(["modern elements", "technology"])
1257
+ .build();
1258
+ ```
1259
+
1260
+ #### Product Photography
1261
+ ```typescript
1262
+ const product = image()
1263
+ .subject("luxury mechanical watch")
1264
+ .subjectDetails(["intricate movement visible", "sapphire crystal"])
1265
+ .environment("minimalist studio setup")
1266
+ .props(["black velvet", "subtle reflections"])
1267
+ .shot("extreme-close-up")
1268
+ .lens("macro")
1269
+ .focus("tack-sharp")
1270
+ .aperture("f/8")
1271
+ .lightingType(["studio", "rim"])
1272
+ .lightDirection("side")
1273
+ .lightIntensity("soft")
1274
+ .medium("commercial")
1275
+ .palette("monochrome")
1276
+ .colorGrade("high contrast, deep blacks")
1277
+ .aspectRatio("1:1")
1278
+ .resolution("8K")
1279
+ .quality("masterpiece")
1280
+ .build();
1281
+ ```
1282
+
1283
+ #### Cinematic Landscape
1284
+ ```typescript
1285
+ const landscape = image()
1286
+ .environment({
1287
+ setting: "volcanic Iceland highlands",
1288
+ location: "Landmannalaugar",
1289
+ terrain: "colorful rhyolite mountains",
1290
+ atmosphere: "dramatic storm clouds breaking"
1291
+ })
1292
+ .season("summer")
1293
+ .shot("extreme-wide")
1294
+ .angle("aerial")
1295
+ .lens("wide-angle")
1296
+ .cameraBrand("hasselblad")
1297
+ .cameraModel("hasselblad-x2d")
1298
+ .sensor("medium-format")
1299
+ .timeOfDay("golden-hour")
1300
+ .weather("stormy")
1301
+ .lightingType("dramatic")
1302
+ .medium("landscape")
1303
+ .palette(["earthy", "vibrant"])
1304
+ .primaryColors(["rust red", "moss green", "volcanic black"])
1305
+ .mood(["epic", "dramatic"])
1306
+ .aspectRatio("21:9")
1307
+ .quality("ultra")
1308
+ .build();
1309
+ ```
486
1310
 
487
1311
  ---
488
1312
 
489
- ## Video Builder
1313
+ ## 🎬 Video Builder
1314
+
1315
+ Comprehensive builder for video generation prompts. Works with Sora, Runway, Pika, Kling, and other video AI platforms.
490
1316
 
491
- Builder for video generation prompts (Sora, Runway, Pika, etc.).
1317
+ ### Quick Start
492
1318
 
493
1319
  ```typescript
494
1320
  import { video } from 'prompts.chat';
495
1321
 
496
1322
  const prompt = video()
497
- // Scene
498
- .scene("A lone astronaut walks across the Martian surface")
499
- .location("Mars", "Olympus Mons base camp")
500
- .environment("dusty red landscape", "thin atmosphere")
501
- .time("dusk")
502
- .weather("dust storm approaching")
503
-
504
- // Subject
505
- .character("astronaut", {
506
- appearance: "NASA spacesuit, reflective visor",
507
- action: "walking purposefully",
508
- emotion: "determined"
1323
+ .scene("A samurai walks through a bamboo forest")
1324
+ .camera({ movement: "tracking", angle: "low-angle" })
1325
+ .lighting({ time: "golden-hour", type: "natural" })
1326
+ .duration(5)
1327
+ .build();
1328
+
1329
+ console.log(prompt.prompt);
1330
+ ```
1331
+
1332
+ ### Full Example
1333
+
1334
+ ```typescript
1335
+ import { video } from 'prompts.chat';
1336
+
1337
+ const prompt = video()
1338
+ // ━━━ Scene ━━━
1339
+ .scene({
1340
+ description: "A lone astronaut walks across the Martian surface",
1341
+ setting: "Olympus Mons base camp",
1342
+ atmosphere: "dusty red landscape, thin atmosphere"
509
1343
  })
1344
+ .setting("Mars, near the base camp") // Additional location context
1345
+ .timeOfDay("golden-hour") // dawn | sunrise | golden-hour | midday | blue-hour | night | ...
1346
+ .weather("foggy") // sunny | cloudy | overcast | foggy | rainy | stormy | snowy | ...
510
1347
 
511
- // Camera
512
- .movement("tracking")
513
- .shot("wide")
514
- .angle("low-angle")
515
- .speed("slow")
516
- .lens("anamorphic")
517
- .cameraBrand("ARRI")
518
- .cameraModel("ALEXA 65")
519
- .stabilization("gimbal")
520
-
521
- // Motion
522
- .pacing("slow")
523
- .transitions("fade")
524
- .motionBlur(true)
1348
+ // ━━━ Subject ━━━
1349
+ .subject({
1350
+ main: "astronaut",
1351
+ appearance: "NASA spacesuit with reflective gold visor",
1352
+ clothing: "white EVA suit with mission patches",
1353
+ age: "30s",
1354
+ gender: "female"
1355
+ })
1356
+ .appearance("determined expression") // Additional appearance details
1357
+ .clothing("dusty, worn spacesuit") // Override/add clothing
525
1358
 
526
- // Lighting
527
- .lightingType("golden hour")
528
- .lightingMood("epic")
1359
+ // ━━━ Camera: Framing ━━━
1360
+ .shot("wide") // extreme-close-up | close-up | medium | wide | establishing | ...
1361
+ .angle("low-angle") // eye-level | low-angle | high-angle | dutch-angle | birds-eye | ...
1362
+ .lens("anamorphic") // wide-angle | 35mm | 50mm | 85mm | telephoto | anamorphic | ...
1363
+ .focalLength("40mm") // Specific focal length
1364
+ .anamorphic("2x") // Enable anamorphic with ratio
1365
+ .aperture("f/2.8") // Aperture setting
529
1366
 
530
- // Style
531
- .style("cinematic")
532
- .colorGrade("orange and teal")
533
- .filmGrain("subtle")
534
- .styleFilmStock("Kodak Vision3 500T")
1367
+ // ━━━ Camera: Movement ━━━
1368
+ .movement("tracking") // static | pan | tilt | dolly | tracking | crane | steadicam | ...
1369
+ .cameraSpeed("slow") // slow | medium | fast
1370
+ .movementDirection("forward") // left | right | forward | backward | up | down | arc-left | arc-right
1371
+ .platform("steadicam") // handheld | steadicam | tripod | drone | crane | gimbal | dolly | ...
1372
+ .rig("slider") // tripod | gimbal | steadicam | crane | dolly | slider | ...
1373
+ .gimbal("dji-ronin-4d") // Specific gimbal model
535
1374
 
536
- // Audio
537
- .audioMood("epic orchestral")
538
- .soundDesign("wind, footsteps, breathing")
1375
+ // ━━━ Camera: Equipment ━━━
1376
+ .cameraBrand("arri") // arri | red | sony | canon | blackmagic | panavision | ...
1377
+ .cameraModel("arri-alexa-65") // Specific camera model
1378
+ .sensor("65mm") // full-frame | super-35 | 65mm | imax | ...
1379
+ .lensBrand("cooke") // zeiss | cooke | arri | panavision | ...
1380
+ .lensModel("cooke-anamorphic") // Specific lens model
1381
+
1382
+ // ━━━ Camera: Technical ━━━
1383
+ .frameRate(24) // 24 | 25 | 30 | 48 | 60 | 120 | 240
1384
+ .slowMotion() // Enable slow motion
1385
+ .shutterAngle(180) // Shutter angle in degrees
1386
+ .filter("black-pro-mist") // nd | polarizer | black-pro-mist | diffusion | ...
1387
+ .filmStock("kodak-vision3-500t") // Kodak, Fujifilm, CineStill film stocks
1388
+ .filmGrain("subtle") // none | subtle | moderate | heavy
1389
+ .halation() // Enable film halation effect
1390
+
1391
+ // ━━━ Lighting ━━━
1392
+ .lighting({
1393
+ type: "natural",
1394
+ time: "golden-hour",
1395
+ direction: "back",
1396
+ intensity: "soft"
1397
+ })
1398
+ .lightingType(["natural", "rim"]) // natural | studio | dramatic | rim | rembrandt | ...
1399
+
1400
+ // ━━━ Actions ━━━
1401
+ .action("walks slowly toward camera") // Add action beat
1402
+ .action("stops and looks at horizon", { timing: "middle" })
1403
+ .action("raises hand to shield eyes", { timing: "end" })
1404
+ .actions(["turns around", "begins walking back"]) // Add multiple actions
1405
+
1406
+ // ━━━ Motion ━━━
1407
+ .motion({
1408
+ subject: "astronaut",
1409
+ type: "walk",
1410
+ direction: "forward",
1411
+ speed: "slow"
1412
+ })
1413
+ .motionBeats(["step", "pause", "step", "turn"]) // Detailed motion beats
1414
+
1415
+ // ━━━ Style ━━━
1416
+ .style({
1417
+ format: "cinematic",
1418
+ era: "2020s",
1419
+ look: "cinematic"
1420
+ })
1421
+ .look("cinematic") // photorealistic | cinematic | documentary | sci-fi | noir | ...
1422
+ .era("futuristic") // 1970s | 1980s | modern | futuristic | ...
1423
+ .format("widescreen epic") // Format description
1424
+ .styleFilmStock("Kodak Vision3 500T") // Style reference film stock
1425
+ .reference(["Interstellar", "The Martian", "Gravity"]) // Reference films/directors
1426
+
1427
+ // ━━━ Color ━━━
1428
+ .color({
1429
+ palette: "warm",
1430
+ temperature: "warm",
1431
+ grade: "orange and teal"
1432
+ })
1433
+ .palette("warm") // warm | cool | neutral | vibrant | neon | monochrome | ...
1434
+ .colorAnchors(["mars red", "suit white", "visor gold"]) // Key colors
1435
+ .colorGrade("orange and teal") // Color grading style
1436
+
1437
+ // ━━━ Audio ━━━
1438
+ .audio({
1439
+ ambient: "wind howling",
1440
+ music: "epic orchestral, building tension",
1441
+ dialogue: "breathing sounds in helmet"
1442
+ })
1443
+ .dialogue("Houston, I've arrived at the site") // Character dialogue
1444
+ .ambient("martian wind, distant rumbling") // Ambient sounds
1445
+ .diegetic(["footsteps on gravel", "suit servos"]) // In-world sounds
1446
+ .soundEffects(["radio static", "helmet HUD beeps"]) // Sound effects
1447
+ .music("Hans Zimmer style, building brass") // Music description
1448
+
1449
+ // ━━━ Technical ━━━
1450
+ .technical({
1451
+ duration: 10,
1452
+ resolution: "4K",
1453
+ fps: 24,
1454
+ aspectRatio: "21:9"
1455
+ })
1456
+ .duration(10) // Duration in seconds
1457
+ .resolution("4K") // 480p | 720p | 1080p | 4K
1458
+ .fps(24) // 24 | 30 | 60
1459
+ .aspectRatio("21:9") // 16:9 | 9:16 | 1:1 | 4:3 | 21:9
1460
+
1461
+ // ━━━ Mood & Pacing ━━━
1462
+ .mood(["epic", "mysterious"]) // serene | dramatic | tense | epic | intimate | ...
1463
+ .pacing("slow") // slow | medium | fast | variable | building | contemplative
1464
+ .transition("fade") // cut | fade | dissolve | wipe | morph | match-cut | ...
1465
+ .transitions(["fade", "dissolve"]) // Multiple transitions
1466
+
1467
+ // ━━━ Shot List ━━━
1468
+ .addShot({
1469
+ name: "Opening wide",
1470
+ camera: { shot: "extreme-wide", movement: "static" },
1471
+ action: "Establish the Martian landscape",
1472
+ purpose: "Set the scene"
1473
+ })
1474
+ .shotList([
1475
+ { camera: { shot: "medium", movement: "tracking" }, action: "Follow astronaut" },
1476
+ { camera: { shot: "close-up", angle: "low-angle" }, action: "Hero shot" }
1477
+ ])
1478
+
1479
+ // ━━━ Custom ━━━
1480
+ .custom("Lens flare as sun peeks over horizon")
1481
+ .custom("Dust particles visible in backlight")
539
1482
 
540
- // Technical
541
- .duration(10)
542
- .fps(24)
543
- .resolution("4K")
544
- .aspectRatio("2.39:1")
545
1483
  .build();
546
1484
 
547
- console.log(prompt.prompt);
548
- console.log(prompt.structure);
1485
+ // Access outputs
1486
+ console.log(prompt.prompt); // Full formatted prompt
1487
+ console.log(prompt.structure); // Full structured data object
549
1488
 
550
- // Output formats
551
- const json = prompt.toJSON();
1489
+ // Export formats
552
1490
  const yaml = prompt.toYAML();
1491
+ const json = prompt.toJSON();
1492
+ const md = prompt.toMarkdown();
1493
+ ```
1494
+
1495
+ ### Types Reference
1496
+
1497
+ #### Camera Types
1498
+ ```typescript
1499
+ type ShotType = 'extreme-close-up' | 'close-up' | 'medium-close-up' | 'medium'
1500
+ | 'medium-wide' | 'wide' | 'extreme-wide' | 'establishing' | 'full-body' | 'portrait' | 'headshot';
1501
+
1502
+ type CameraAngle = 'eye-level' | 'low-angle' | 'high-angle' | 'dutch-angle' | 'birds-eye'
1503
+ | 'worms-eye' | 'over-the-shoulder' | 'point-of-view' | 'aerial' | 'drone'
1504
+ | 'canted' | 'oblique' | 'hip-level' | 'knee-level' | 'ground-level';
1505
+
1506
+ type CameraMovement = 'static' | 'pan' | 'tilt' | 'dolly' | 'truck' | 'pedestal' | 'zoom'
1507
+ | 'handheld' | 'steadicam' | 'crane' | 'drone' | 'tracking' | 'arc' | 'whip-pan'
1508
+ | 'roll' | 'boom' | 'jib' | 'cable-cam' | 'motion-control' | 'snorricam'
1509
+ | 'dutch-roll' | 'vertigo-effect' | 'crash-zoom' | 'slow-push' | 'slow-pull';
1510
+
1511
+ type LensType = 'wide-angle' | 'ultra-wide' | 'standard' | 'telephoto' | 'macro' | 'fisheye'
1512
+ | '14mm' | '24mm' | '35mm' | '50mm' | '85mm' | '100mm' | '135mm' | '200mm'
1513
+ | 'tilt-shift' | 'anamorphic' | 'spherical' | 'prime' | 'zoom';
1514
+ ```
1515
+
1516
+ #### Equipment Types
1517
+ ```typescript
1518
+ type CameraBrand = 'sony' | 'canon' | 'nikon' | 'fujifilm' | 'leica' | 'hasselblad'
1519
+ | 'red' | 'arri' | 'blackmagic' | 'panavision' | 'panasonic';
1520
+
1521
+ type CameraModel = 'arri-alexa-35' | 'arri-alexa-mini-lf' | 'arri-alexa-65'
1522
+ | 'red-v-raptor' | 'red-komodo' | 'sony-venice' | 'sony-fx6'
1523
+ | 'canon-c70' | 'blackmagic-ursa-mini-pro' | 'panavision-dxl2' | ...;
1524
+
1525
+ type CameraRig = 'tripod' | 'monopod' | 'gimbal' | 'steadicam' | 'easyrig' | 'shoulder-rig'
1526
+ | 'slider' | 'dolly' | 'jib' | 'crane' | 'technocrane' | 'russian-arm'
1527
+ | 'cable-cam' | 'drone' | 'fpv-drone' | 'motion-control' | 'handheld';
1528
+
1529
+ type GimbalModel = 'dji-ronin-4d' | 'dji-ronin-rs3-pro' | 'dji-ronin-rs4'
1530
+ | 'moza-air-2' | 'zhiyun-crane-3s' | 'freefly-movi-pro' | 'tilta-gravity-g2x';
1531
+ ```
1532
+
1533
+ #### Lighting Types
1534
+ ```typescript
1535
+ type LightingType = 'natural' | 'studio' | 'dramatic' | 'soft' | 'hard' | 'diffused'
1536
+ | 'key' | 'fill' | 'rim' | 'backlit' | 'silhouette' | 'rembrandt'
1537
+ | 'split' | 'butterfly' | 'loop' | 'broad' | 'short' | 'chiaroscuro'
1538
+ | 'high-key' | 'low-key' | 'three-point' | 'practical' | 'motivated';
1539
+
1540
+ type TimeOfDay = 'dawn' | 'sunrise' | 'golden-hour' | 'morning' | 'midday' | 'afternoon'
1541
+ | 'blue-hour' | 'sunset' | 'dusk' | 'twilight' | 'night' | 'midnight';
1542
+
1543
+ type WeatherLighting = 'sunny' | 'cloudy' | 'overcast' | 'foggy' | 'misty'
1544
+ | 'rainy' | 'stormy' | 'snowy' | 'hazy';
1545
+ ```
1546
+
1547
+ #### Style & Color Types
1548
+ ```typescript
1549
+ type ArtStyle = 'photorealistic' | 'hyperrealistic' | 'cinematic' | 'documentary'
1550
+ | 'editorial' | 'fashion' | 'portrait' | 'landscape' | 'street' | 'fine-art'
1551
+ | 'surreal' | 'abstract' | 'minimalist' | 'vintage' | 'retro' | 'noir'
1552
+ | 'cyberpunk' | 'steampunk' | 'fantasy' | 'sci-fi' | 'anime' | '3d-render';
1553
+
1554
+ type ColorPalette = 'warm' | 'cool' | 'neutral' | 'vibrant' | 'muted' | 'pastel' | 'neon'
1555
+ | 'monochrome' | 'sepia' | 'desaturated' | 'high-contrast' | 'low-contrast'
1556
+ | 'earthy' | 'oceanic' | 'forest' | 'sunset' | 'midnight' | 'golden';
1557
+
1558
+ type Mood = 'serene' | 'peaceful' | 'melancholic' | 'dramatic' | 'tense' | 'mysterious'
1559
+ | 'romantic' | 'nostalgic' | 'hopeful' | 'joyful' | 'energetic' | 'chaotic'
1560
+ | 'ethereal' | 'dark' | 'light' | 'whimsical' | 'eerie' | 'epic' | 'intimate';
1561
+
1562
+ type FilmStock = 'kodak-portra-400' | 'kodak-vision3-500t' | 'kodak-vision3-50d'
1563
+ | 'fujifilm-eterna-500t' | 'cinestill-800t' | 'ilford-hp5-plus' | ...;
1564
+ ```
1565
+
1566
+ #### Video-Specific Types
1567
+ ```typescript
1568
+ type VideoPacing = 'slow' | 'medium' | 'fast' | 'variable' | 'building' | 'frenetic' | 'contemplative';
1569
+
1570
+ type VideoTransition = 'cut' | 'fade' | 'dissolve' | 'wipe' | 'morph' | 'match-cut'
1571
+ | 'jump-cut' | 'cross-dissolve' | 'iris' | 'push' | 'slide';
1572
+
1573
+ type FilterType = 'uv' | 'polarizer' | 'nd' | 'nd-graduated' | 'black-pro-mist'
1574
+ | 'white-pro-mist' | 'glimmer-glass' | 'classic-soft' | 'diffusion' | 'infrared';
1575
+ ```
1576
+
1577
+ ### Methods Reference
1578
+
1579
+ #### Scene Methods
1580
+ | Method | Signature | Description |
1581
+ |--------|-----------|-------------|
1582
+ | `.scene()` | `scene(description: string \| VideoScene)` | Set scene description |
1583
+ | `.setting()` | `setting(setting: string)` | Set location/setting |
1584
+ | `.timeOfDay()` | `timeOfDay(time: TimeOfDay)` | Set time of day |
1585
+ | `.weather()` | `weather(weather: WeatherLighting)` | Set weather conditions |
1586
+
1587
+ #### Subject Methods
1588
+ | Method | Signature | Description |
1589
+ |--------|-----------|-------------|
1590
+ | `.subject()` | `subject(main: string \| VideoSubject)` | Set main subject |
1591
+ | `.appearance()` | `appearance(appearance: string)` | Set appearance details |
1592
+ | `.clothing()` | `clothing(clothing: string)` | Set clothing/costume |
1593
+
1594
+ #### Camera Methods
1595
+ | Method | Signature | Description |
1596
+ |--------|-----------|-------------|
1597
+ | `.camera()` | `camera(settings: VideoCamera)` | Set all camera settings |
1598
+ | `.shot()` | `shot(shot: ShotType)` | Set shot type |
1599
+ | `.angle()` | `angle(angle: CameraAngle)` | Set camera angle |
1600
+ | `.movement()` | `movement(movement: CameraMovement)` | Set camera movement |
1601
+ | `.lens()` | `lens(lens: LensType)` | Set lens type |
1602
+ | `.platform()` | `platform(platform)` | Set camera platform |
1603
+ | `.cameraSpeed()` | `cameraSpeed(speed)` | Set movement speed |
1604
+ | `.movementDirection()` | `movementDirection(direction)` | Set movement direction |
1605
+ | `.rig()` | `rig(rig: CameraRig)` | Set camera rig |
1606
+ | `.gimbal()` | `gimbal(gimbal: GimbalModel)` | Set gimbal model |
1607
+ | `.cameraBrand()` | `cameraBrand(brand: CameraBrand)` | Set camera brand |
1608
+ | `.cameraModel()` | `cameraModel(model: CameraModel)` | Set camera model |
1609
+ | `.sensor()` | `sensor(sensor: SensorFormat)` | Set sensor format |
1610
+ | `.lensBrand()` | `lensBrand(brand: LensBrand)` | Set lens brand |
1611
+ | `.lensModel()` | `lensModel(model: LensModel)` | Set lens model |
1612
+ | `.focalLength()` | `focalLength(length: string)` | Set focal length |
1613
+ | `.anamorphic()` | `anamorphic(ratio?)` | Enable anamorphic |
1614
+ | `.aperture()` | `aperture(aperture: string)` | Set aperture |
1615
+ | `.frameRate()` | `frameRate(fps)` | Set frame rate |
1616
+ | `.slowMotion()` | `slowMotion(enabled?)` | Enable slow motion |
1617
+ | `.shutterAngle()` | `shutterAngle(angle: number)` | Set shutter angle |
1618
+ | `.filter()` | `filter(filter: FilterType)` | Set lens filter |
1619
+ | `.filmStock()` | `filmStock(stock: FilmStock)` | Set film stock |
1620
+ | `.filmGrain()` | `filmGrain(grain)` | Set film grain level |
1621
+ | `.halation()` | `halation(enabled?)` | Enable halation effect |
1622
+
1623
+ #### Lighting Methods
1624
+ | Method | Signature | Description |
1625
+ |--------|-----------|-------------|
1626
+ | `.lighting()` | `lighting(settings: VideoLighting)` | Set all lighting |
1627
+ | `.lightingType()` | `lightingType(type)` | Set lighting type(s) |
1628
+
1629
+ #### Action & Motion Methods
1630
+ | Method | Signature | Description |
1631
+ |--------|-----------|-------------|
1632
+ | `.action()` | `action(action, options?)` | Add single action |
1633
+ | `.actions()` | `actions(actions: string[])` | Add multiple actions |
1634
+ | `.motion()` | `motion(settings: VideoMotion)` | Set motion settings |
1635
+ | `.motionBeats()` | `motionBeats(beats: string[])` | Set motion beats |
1636
+
1637
+ #### Style Methods
1638
+ | Method | Signature | Description |
1639
+ |--------|-----------|-------------|
1640
+ | `.style()` | `style(settings: VideoStyle)` | Set all style settings |
1641
+ | `.look()` | `look(look: ArtStyle)` | Set visual look |
1642
+ | `.era()` | `era(era: string)` | Set era/time period |
1643
+ | `.format()` | `format(format: string)` | Set format description |
1644
+ | `.styleFilmStock()` | `styleFilmStock(stock: string)` | Set style film stock |
1645
+ | `.reference()` | `reference(refs: string[])` | Set reference films |
1646
+
1647
+ #### Color Methods
1648
+ | Method | Signature | Description |
1649
+ |--------|-----------|-------------|
1650
+ | `.color()` | `color(settings: VideoColor)` | Set all color settings |
1651
+ | `.palette()` | `palette(palette: ColorPalette)` | Set color palette |
1652
+ | `.colorAnchors()` | `colorAnchors(anchors: string[])` | Set key colors |
1653
+ | `.colorGrade()` | `colorGrade(grade: string)` | Set color grade |
1654
+
1655
+ #### Audio Methods
1656
+ | Method | Signature | Description |
1657
+ |--------|-----------|-------------|
1658
+ | `.audio()` | `audio(settings: VideoAudio)` | Set all audio |
1659
+ | `.dialogue()` | `dialogue(dialogue: string)` | Set dialogue |
1660
+ | `.ambient()` | `ambient(ambient: string)` | Set ambient sound |
1661
+ | `.diegetic()` | `diegetic(sounds: string[])` | Set diegetic sounds |
1662
+ | `.soundEffects()` | `soundEffects(effects: string[])` | Set sound effects |
1663
+ | `.music()` | `music(music: string)` | Set music description |
1664
+
1665
+ #### Technical Methods
1666
+ | Method | Signature | Description |
1667
+ |--------|-----------|-------------|
1668
+ | `.technical()` | `technical(settings: VideoTechnical)` | Set all technical |
1669
+ | `.duration()` | `duration(seconds: number)` | Set duration |
1670
+ | `.resolution()` | `resolution(res)` | Set resolution |
1671
+ | `.fps()` | `fps(fps)` | Set frame rate |
1672
+ | `.aspectRatio()` | `aspectRatio(ratio)` | Set aspect ratio |
1673
+
1674
+ #### Mood, Pacing & Output Methods
1675
+ | Method | Signature | Description |
1676
+ |--------|-----------|-------------|
1677
+ | `.mood()` | `mood(mood: Mood \| Mood[])` | Set mood(s) |
1678
+ | `.pacing()` | `pacing(pacing: VideoPacing)` | Set pacing |
1679
+ | `.transition()` | `transition(transition)` | Add transition |
1680
+ | `.transitions()` | `transitions(transitions[])` | Add transitions |
1681
+ | `.addShot()` | `addShot(shot: VideoShot)` | Add to shot list |
1682
+ | `.shotList()` | `shotList(shots: VideoShot[])` | Set shot list |
1683
+ | `.custom()` | `custom(text: string)` | Add custom text |
1684
+ | `.build()` | `build(): BuiltVideoPrompt` | Build the prompt |
1685
+ | `.toString()` | `toString(): string` | Get prompt string |
1686
+ | `.toJSON()` | `toJSON(): string` | Export as JSON |
1687
+ | `.toYAML()` | `toYAML(): string` | Export as YAML |
1688
+ | `.toMarkdown()` | `toMarkdown(): string` | Export as Markdown |
1689
+
1690
+ ### Output Structure
1691
+
1692
+ ```typescript
1693
+ interface BuiltVideoPrompt {
1694
+ prompt: string; // Full formatted prompt
1695
+ structure: {
1696
+ scene?: VideoScene;
1697
+ subject?: VideoSubject;
1698
+ camera?: VideoCamera;
1699
+ lighting?: VideoLighting;
1700
+ actions?: VideoAction[];
1701
+ motion?: VideoMotion;
1702
+ style?: VideoStyle;
1703
+ color?: VideoColor;
1704
+ audio?: VideoAudio;
1705
+ technical?: VideoTechnical;
1706
+ shots?: VideoShot[];
1707
+ mood?: Mood | Mood[];
1708
+ pacing?: VideoPacing;
1709
+ transitions?: VideoTransition[];
1710
+ };
1711
+ }
1712
+ ```
1713
+
1714
+ ### Usage Examples
1715
+
1716
+ #### Cinematic Product Shot
1717
+ ```typescript
1718
+ const product = video()
1719
+ .scene("Luxury watch rotating on black velvet")
1720
+ .shot("extreme-close-up")
1721
+ .movement("slow-push")
1722
+ .lens("100mm")
1723
+ .lightingType(["rim", "key"])
1724
+ .look("commercial")
1725
+ .palette("monochrome")
1726
+ .pacing("slow")
1727
+ .duration(5)
1728
+ .resolution("4K")
1729
+ .build();
1730
+ ```
1731
+
1732
+ #### Documentary Interview
1733
+ ```typescript
1734
+ const interview = video()
1735
+ .scene("Expert speaking in modern office")
1736
+ .subject({ main: "scientist", appearance: "professional attire" })
1737
+ .shot("medium")
1738
+ .angle("eye-level")
1739
+ .movement("static")
1740
+ .platform("tripod")
1741
+ .lightingType("three-point")
1742
+ .look("documentary")
1743
+ .dialogue("Explaining climate change impacts")
1744
+ .ambient("quiet office hum")
1745
+ .pacing("medium")
1746
+ .aspectRatio("16:9")
1747
+ .build();
553
1748
  ```
554
1749
 
555
- ### Video-Specific Options
1750
+ #### Action Sequence
1751
+ ```typescript
1752
+ const action = video()
1753
+ .scene("Car chase through city streets")
1754
+ .subject("sports car")
1755
+ .shot("tracking")
1756
+ .movement("tracking")
1757
+ .cameraSpeed("fast")
1758
+ .platform("fpv-drone")
1759
+ .lens("wide-angle")
1760
+ .lightingType("natural")
1761
+ .timeOfDay("night")
1762
+ .look("cinematic")
1763
+ .colorGrade("high contrast, neon")
1764
+ .pacing("frenetic")
1765
+ .actions([
1766
+ "Car drifts around corner",
1767
+ "Sparks fly from undercarriage",
1768
+ "Near miss with oncoming traffic"
1769
+ ])
1770
+ .soundEffects(["engine roar", "tire screech", "horns"])
1771
+ .music("intense electronic, pulsing bass")
1772
+ .fps(60)
1773
+ .slowMotion()
1774
+ .duration(8)
1775
+ .build();
1776
+ ```
556
1777
 
557
- | Category | Examples |
558
- |----------|----------|
559
- | **Camera Movement** | static, pan, tilt, dolly, tracking, crane, handheld, drone |
560
- | **Transitions** | cut, fade, dissolve, wipe, zoom |
561
- | **Pacing** | slow-motion, normal, fast-motion, timelapse |
562
- | **Frame Rates** | 24, 30, 60, 120 fps |
1778
+ #### Nature Documentary
1779
+ ```typescript
1780
+ const nature = video()
1781
+ .scene("Lion stalking prey across African savanna")
1782
+ .subject({ main: "lion", appearance: "adult male, golden mane" })
1783
+ .setting("Serengeti National Park")
1784
+ .shot("wide")
1785
+ .lens("telephoto")
1786
+ .cameraBrand("red")
1787
+ .cameraModel("red-v-raptor")
1788
+ .movement("static")
1789
+ .platform("tripod")
1790
+ .timeOfDay("golden-hour")
1791
+ .weather("sunny")
1792
+ .look("documentary")
1793
+ .palette("warm")
1794
+ .mood("tense")
1795
+ .pacing("slow")
1796
+ .ambient("wind through grass, distant wildlife")
1797
+ .music("subtle, building tension")
1798
+ .resolution("4K")
1799
+ .fps(60)
1800
+ .aspectRatio("21:9")
1801
+ .build();
1802
+ ```
563
1803
 
564
1804
  ---
565
1805
 
566
1806
  ## 🎵 Audio Builder
567
1807
 
568
- Builder for music and audio generation prompts (Suno, Udio, etc.).
1808
+ Comprehensive builder for music and audio generation prompts. Works with Suno, Udio, and other music AI platforms.
1809
+
1810
+ ### Quick Start
569
1811
 
570
1812
  ```typescript
571
1813
  import { audio } from 'prompts.chat';
572
1814
 
573
1815
  const prompt = audio()
574
- // Genre & Style
575
- .genre("electronic")
576
- .subgenre("synthwave")
577
- .era("1980s")
578
- .influences(["Kavinsky", "Carpenter Brut", "Perturbator"])
1816
+ .genre("synthwave")
1817
+ .mood("nostalgic", "dreamy")
1818
+ .bpm(110)
1819
+ .instruments(["synthesizer", "drums", "bass"])
1820
+ .build();
1821
+
1822
+ console.log(prompt.stylePrompt); // "synthwave, nostalgic, dreamy, 110 BPM, synthesizer, drums, bass"
1823
+ ```
1824
+
1825
+ ### Full Example
1826
+
1827
+ ```typescript
1828
+ import { audio } from 'prompts.chat';
1829
+
1830
+ const prompt = audio()
1831
+ // ━━━ Genre ━━━
1832
+ .genre("electronic") // Primary genre
1833
+ .subgenre("synthwave") // Subgenre
1834
+ .fusion(["rock", "pop"]) // Genre fusion
579
1835
 
580
- // Mood & Energy
581
- .mood("nostalgic")
582
- .energy("high")
583
- .emotion("triumphant")
1836
+ // ━━━ Mood & Energy ━━━
1837
+ .mood("nostalgic", "triumphant", "hopeful") // Primary + secondary moods
1838
+ .energy("high") // low | medium | high | building | fluctuating
1839
+ .emotion("euphoria") // Custom emotion descriptor
584
1840
 
585
- // Tempo & Rhythm
586
- .bpm(120)
587
- .feel("driving")
588
- .groove("steady")
589
-
590
- // Vocals
591
- .vocalStyle("ethereal")
592
- .vocalRange("tenor")
593
- .lyrics("retro-futuristic themes")
594
- .harmony("layered")
595
-
596
- // Instrumentation
597
- .instruments(["synthesizer", "drums", "bass", "electric guitar"])
598
- .lead("analog synth lead")
599
- .rhythm("drum machine")
600
- .bass("deep sub bass")
601
- .pads("lush synth pads")
602
-
603
- // Structure
604
- .intro("atmospheric build")
605
- .verse("rhythmic drive")
606
- .chorus("anthemic climax")
607
- .bridge("breakdown")
608
- .outro("fade out")
609
- .duration(210) // 3:30
610
-
611
- // Production
612
- .productionStyle("polished")
613
- .mixing("wide stereo")
614
- .effects(["reverb", "delay", "sidechain compression"])
1841
+ // ━━━ Tempo ━━━
1842
+ .bpm(120) // Beats per minute
1843
+ .tempoMarking("allegro") // Classical tempo marking
1844
+ .tempoFeel("driving") // steady | swung | shuffled | syncopated | rubato | driving
1845
+
1846
+ // ━━━ Vocals ━━━
1847
+ .vocalStyle("melodic") // male | female | duet | choir | rap | falsetto | ...
1848
+ .language("english") // english | spanish | japanese | instrumental | ...
1849
+ .lyricsTheme("retro-futuristic dreams and neon nights")
1850
+ .lyrics("[Verse 1]\nRiding through the neon glow...")
1851
+ .delivery("powerful and emotional")
1852
+ .instrumental() // Shortcut for instrumental (no vocals)
1853
+
1854
+ // ━━━ Instrumentation ━━━
1855
+ .instruments(["synthesizer", "drums", "bass"]) // Quick instrument list
1856
+ .leadInstrument("synthesizer") // Lead melody instrument
1857
+ .rhythmSection(["drums", "bass"]) // Rhythm section
1858
+ .bassInstrument("bass") // Bass instrument
1859
+ .percussion(["drums", "808"]) // Percussion
1860
+ .pads(["synthesizer"]) // Pad sounds
1861
+ .featuredInstrument("electric-guitar") // Featured solo instrument
1862
+
1863
+ // ━━━ Structure ━━━
1864
+ .section("intro", 8, "atmospheric synth pad build")
1865
+ .section("verse", 16, "driving rhythm with arpeggios")
1866
+ .section("pre-chorus", 8, "tension build")
1867
+ .section("chorus", 16, "anthemic, full instrumentation")
1868
+ .section("verse", 16, "variation with added elements")
1869
+ .section("chorus", 16, "bigger, more layers")
1870
+ .section("bridge", 8, "breakdown, stripped back")
1871
+ .section("drop", 16, "climactic peak")
1872
+ .section("outro", 8, "fade out with echoing synths")
1873
+ .duration(210) // Total duration in seconds (3:30)
1874
+ .form("ABABCB") // Song form notation
1875
+
1876
+ // ━━━ Production ━━━
1877
+ .productionStyle("polished") // lo-fi | hi-fi | vintage | modern | polished | raw | ...
1878
+ .era("1980s") // 1950s-2020s | retro | vintage | modern | futuristic
1879
+ .reference(["Kavinsky", "Carpenter Brut", "Perturbator"])
1880
+ .texture("lush and warm")
1881
+ .effects(["reverb", "delay", "sidechain compression", "chorus"])
1882
+
1883
+ // ━━━ Technical ━━━
1884
+ .key("Am") // C | Am | G | Em | D | Bm | F# | Ebm | ...
1885
+ .timeSignature("4/4") // 4/4 | 3/4 | 6/8 | 5/4 | 7/8 | 12/8
1886
+ .formatType("song") // song | instrumental | jingle | loop | soundtrack
1887
+
1888
+ // ━━━ Tags & Custom ━━━
1889
+ .tag("80s") // Add single tag
1890
+ .tags(["retro", "neon", "cinematic"]) // Add multiple tags
1891
+ .custom("arpeggiated bassline throughout") // Custom text
615
1892
 
616
- // Technical
617
- .key("A minor")
618
- .timeSignature("4/4")
619
1893
  .build();
620
1894
 
621
- console.log(prompt.stylePrompt);
622
- console.log(prompt.lyricsPrompt);
623
- console.log(prompt.structure);
1895
+ // Access outputs
1896
+ console.log(prompt.prompt); // Full formatted prompt
1897
+ console.log(prompt.stylePrompt); // Style-only prompt (for Suno/Udio style field)
1898
+ console.log(prompt.lyricsPrompt); // Lyrics prompt (if lyrics provided)
1899
+ console.log(prompt.structure); // Full structured data object
624
1900
 
625
- // Output formats
626
- const json = prompt.toJSON();
1901
+ // Export formats
627
1902
  const yaml = prompt.toYAML();
1903
+ const json = prompt.toJSON();
1904
+ const md = prompt.toMarkdown();
1905
+ ```
1906
+
1907
+ ### Types Reference
1908
+
1909
+ #### MusicGenre
1910
+ ```typescript
1911
+ type MusicGenre =
1912
+ | 'pop' | 'rock' | 'jazz' | 'classical' | 'electronic' | 'hip-hop' | 'r&b'
1913
+ | 'country' | 'folk' | 'blues' | 'metal' | 'punk' | 'indie' | 'alternative'
1914
+ | 'ambient' | 'lo-fi' | 'synthwave' | 'orchestral' | 'cinematic' | 'world'
1915
+ | 'latin' | 'reggae' | 'soul' | 'funk' | 'disco' | 'house' | 'techno' | 'edm'
1916
+ | 'trap' | 'drill' | 'k-pop' | 'j-pop' | 'bossa-nova' | 'gospel' | 'grunge'
1917
+ | 'shoegaze' | 'post-rock' | 'prog-rock' | 'psychedelic' | 'chillwave'
1918
+ | 'vaporwave' | 'drum-and-bass' | 'dubstep' | 'trance' | 'hardcore';
1919
+ ```
1920
+
1921
+ #### Instrument
1922
+ ```typescript
1923
+ type Instrument =
1924
+ | 'piano' | 'guitar' | 'acoustic-guitar' | 'electric-guitar' | 'bass' | 'drums'
1925
+ | 'violin' | 'cello' | 'viola' | 'flute' | 'saxophone' | 'trumpet' | 'trombone'
1926
+ | 'synthesizer' | 'organ' | 'harp' | 'percussion' | 'strings' | 'brass' | 'woodwinds'
1927
+ | 'choir' | 'vocals' | 'beatbox' | 'turntables' | 'harmonica' | 'banjo' | 'ukulele'
1928
+ | 'mandolin' | 'accordion' | 'marimba' | 'vibraphone' | 'xylophone' | 'timpani'
1929
+ | 'congas' | 'bongos' | 'djembe' | 'tabla' | 'sitar' | 'erhu' | 'koto'
1930
+ | '808' | '909' | 'moog' | 'rhodes' | 'wurlitzer' | 'mellotron' | 'theremin';
1931
+ ```
1932
+
1933
+ #### VocalStyle
1934
+ ```typescript
1935
+ type VocalStyle =
1936
+ | 'male' | 'female' | 'duet' | 'choir' | 'a-cappella' | 'spoken-word' | 'rap'
1937
+ | 'falsetto' | 'belting' | 'whisper' | 'growl' | 'melodic' | 'harmonized'
1938
+ | 'auto-tuned' | 'operatic' | 'soul' | 'breathy' | 'nasal' | 'raspy' | 'clear';
628
1939
  ```
629
1940
 
630
- ### Audio Options
1941
+ #### Other Types
1942
+ ```typescript
1943
+ type VocalLanguage = 'english' | 'spanish' | 'french' | 'german' | 'italian'
1944
+ | 'portuguese' | 'japanese' | 'korean' | 'chinese' | 'arabic' | 'hindi'
1945
+ | 'russian' | 'turkish' | 'instrumental';
1946
+
1947
+ type TempoMarking = 'largo' | 'adagio' | 'andante' | 'moderato' | 'allegro' | 'vivace' | 'presto';
631
1948
 
632
- | Category | Examples |
633
- |----------|----------|
634
- | **Genres** | pop, rock, jazz, classical, electronic, hip-hop, ambient, cinematic |
635
- | **Moods** | happy, sad, energetic, calm, dark, uplifting, melancholic |
636
- | **Instruments** | piano, guitar, drums, bass, synthesizer, violin, saxophone |
637
- | **Vocal Styles** | clean, breathy, raspy, falsetto, operatic, whispered |
638
- | **Keys** | C major, A minor, G major, E minor, etc. |
639
- | **Time Signatures** | 4/4, 3/4, 6/8, 5/4, 7/8 |
1949
+ type TimeSignature = '4/4' | '3/4' | '6/8' | '2/4' | '5/4' | '7/8' | '12/8';
1950
+
1951
+ type MusicalKey = 'C' | 'C#' | 'Db' | 'D' | 'D#' | 'Eb' | 'E' | 'F' | 'F#' | 'Gb'
1952
+ | 'G' | 'G#' | 'Ab' | 'A' | 'A#' | 'Bb' | 'B'
1953
+ | 'Cm' | 'C#m' | 'Dm' | 'D#m' | 'Ebm' | 'Em' | 'Fm' | 'F#m'
1954
+ | 'Gm' | 'G#m' | 'Am' | 'A#m' | 'Bbm' | 'Bm';
1955
+
1956
+ type SongSection = 'intro' | 'verse' | 'pre-chorus' | 'chorus' | 'bridge'
1957
+ | 'breakdown' | 'drop' | 'build-up' | 'outro' | 'solo' | 'interlude' | 'hook';
1958
+
1959
+ type ProductionStyle = 'lo-fi' | 'hi-fi' | 'vintage' | 'modern' | 'polished' | 'raw'
1960
+ | 'organic' | 'synthetic' | 'acoustic' | 'electric' | 'hybrid' | 'minimalist'
1961
+ | 'maximalist' | 'layered' | 'sparse' | 'dense' | 'atmospheric' | 'punchy' | 'warm' | 'bright';
1962
+
1963
+ type Era = '1950s' | '1960s' | '1970s' | '1980s' | '1990s' | '2000s' | '2010s' | '2020s'
1964
+ | 'retro' | 'vintage' | 'classic' | 'modern' | 'futuristic';
1965
+ ```
1966
+
1967
+ ### Methods Reference
1968
+
1969
+ #### Genre Methods
1970
+ | Method | Signature | Description |
1971
+ |--------|-----------|-------------|
1972
+ | `.genre()` | `genre(primary: MusicGenre \| AudioGenre)` | Set primary genre |
1973
+ | `.subgenre()` | `subgenre(subgenre: string)` | Set subgenre |
1974
+ | `.fusion()` | `fusion(genres: MusicGenre[])` | Blend multiple genres |
1975
+
1976
+ #### Mood Methods
1977
+ | Method | Signature | Description |
1978
+ |--------|-----------|-------------|
1979
+ | `.mood()` | `mood(primary, ...secondary)` | Set moods (variadic) |
1980
+ | `.energy()` | `energy(level)` | Set energy level |
1981
+ | `.emotion()` | `emotion(emotion: string)` | Set emotion descriptor |
1982
+
1983
+ #### Tempo Methods
1984
+ | Method | Signature | Description |
1985
+ |--------|-----------|-------------|
1986
+ | `.tempo()` | `tempo(bpm \| AudioTempo)` | Set tempo (BPM or object) |
1987
+ | `.bpm()` | `bpm(bpm: number)` | Set beats per minute |
1988
+ | `.tempoMarking()` | `tempoMarking(marking: TempoMarking)` | Classical tempo term |
1989
+ | `.tempoFeel()` | `tempoFeel(feel)` | Set rhythmic feel |
1990
+
1991
+ #### Vocal Methods
1992
+ | Method | Signature | Description |
1993
+ |--------|-----------|-------------|
1994
+ | `.vocals()` | `vocals(settings: AudioVocals)` | Set all vocal settings |
1995
+ | `.vocalStyle()` | `vocalStyle(style: VocalStyle \| VocalStyle[])` | Set vocal style(s) |
1996
+ | `.language()` | `language(lang: VocalLanguage)` | Set language |
1997
+ | `.lyrics()` | `lyrics(lyrics: string)` | Set lyrics text |
1998
+ | `.lyricsTheme()` | `lyricsTheme(theme: string)` | Set lyrics theme |
1999
+ | `.delivery()` | `delivery(delivery: string)` | Set vocal delivery |
2000
+ | `.instrumental()` | `instrumental()` | Make instrumental (no vocals) |
2001
+
2002
+ #### Instrumentation Methods
2003
+ | Method | Signature | Description |
2004
+ |--------|-----------|-------------|
2005
+ | `.instruments()` | `instruments(instruments: Instrument[])` | Set instrument list |
2006
+ | `.instrumentation()` | `instrumentation(settings: AudioInstrumentation)` | Full settings object |
2007
+ | `.leadInstrument()` | `leadInstrument(instrument)` | Set lead instrument |
2008
+ | `.rhythmSection()` | `rhythmSection(instruments: Instrument[])` | Set rhythm section |
2009
+ | `.bassInstrument()` | `bassInstrument(instrument: Instrument)` | Set bass |
2010
+ | `.percussion()` | `percussion(instruments)` | Set percussion |
2011
+ | `.pads()` | `pads(instruments)` | Set pad sounds |
2012
+ | `.featuredInstrument()` | `featuredInstrument(instrument: Instrument)` | Featured instrument |
2013
+
2014
+ #### Structure Methods
2015
+ | Method | Signature | Description |
2016
+ |--------|-----------|-------------|
2017
+ | `.structure()` | `structure(settings \| { [section]: bars })` | Set structure |
2018
+ | `.section()` | `section(type, bars?, description?)` | Add song section |
2019
+ | `.form()` | `form(form: string)` | Set song form (e.g., "ABABCB") |
2020
+ | `.duration()` | `duration(seconds: number)` | Set total duration |
2021
+
2022
+ #### Production Methods
2023
+ | Method | Signature | Description |
2024
+ |--------|-----------|-------------|
2025
+ | `.production()` | `production(settings: AudioProduction)` | Full production settings |
2026
+ | `.productionStyle()` | `productionStyle(style)` | Set production style |
2027
+ | `.era()` | `era(era: Era)` | Set era/decade |
2028
+ | `.reference()` | `reference(artists: string[])` | Reference artists |
2029
+ | `.texture()` | `texture(texture: string)` | Set sound texture |
2030
+ | `.effects()` | `effects(effects: string[])` | Add audio effects |
2031
+
2032
+ #### Technical Methods
2033
+ | Method | Signature | Description |
2034
+ |--------|-----------|-------------|
2035
+ | `.technical()` | `technical(settings: AudioTechnical)` | Full technical settings |
2036
+ | `.key()` | `key(key: MusicalKey)` | Set musical key |
2037
+ | `.timeSignature()` | `timeSignature(sig: TimeSignature)` | Set time signature |
2038
+ | `.formatType()` | `formatType(format)` | Set format type |
2039
+
2040
+ #### Tags & Output Methods
2041
+ | Method | Signature | Description |
2042
+ |--------|-----------|-------------|
2043
+ | `.tag()` | `tag(tag: string)` | Add single tag |
2044
+ | `.tags()` | `tags(tags: string[])` | Add multiple tags |
2045
+ | `.custom()` | `custom(text: string)` | Add custom text |
2046
+ | `.build()` | `build(): BuiltAudioPrompt` | Build the prompt |
2047
+ | `.toString()` | `toString(): string` | Get prompt string |
2048
+ | `.toStyleString()` | `toStyleString(): string` | Get style prompt only |
2049
+ | `.toJSON()` | `toJSON(): string` | Export as JSON |
2050
+ | `.toYAML()` | `toYAML(): string` | Export as YAML |
2051
+ | `.toMarkdown()` | `toMarkdown(): string` | Export as Markdown |
2052
+
2053
+ ### Output Structure
2054
+
2055
+ ```typescript
2056
+ interface BuiltAudioPrompt {
2057
+ prompt: string; // Full formatted prompt
2058
+ stylePrompt: string; // Style-only prompt (for AI style field)
2059
+ lyricsPrompt?: string; // Lyrics prompt (if lyrics/theme provided)
2060
+ structure: {
2061
+ genre?: AudioGenre;
2062
+ mood?: AudioMood;
2063
+ tempo?: AudioTempo;
2064
+ vocals?: AudioVocals;
2065
+ instrumentation?: AudioInstrumentation;
2066
+ structure?: AudioStructure;
2067
+ production?: AudioProduction;
2068
+ technical?: AudioTechnical;
2069
+ tags?: string[];
2070
+ };
2071
+ }
2072
+ ```
2073
+
2074
+ ### Usage Examples
2075
+
2076
+ #### Lo-Fi Hip-Hop Beat
2077
+ ```typescript
2078
+ const lofi = audio()
2079
+ .genre("lo-fi")
2080
+ .subgenre("chill hop")
2081
+ .mood("relaxed", "nostalgic")
2082
+ .bpm(85)
2083
+ .tempoFeel("swung")
2084
+ .instrumental()
2085
+ .instruments(["rhodes", "drums", "bass", "vinyl-crackle"])
2086
+ .productionStyle("lo-fi")
2087
+ .texture("warm and dusty")
2088
+ .effects(["vinyl crackle", "tape saturation", "low-pass filter"])
2089
+ .build();
2090
+ ```
2091
+
2092
+ #### Epic Orchestral Soundtrack
2093
+ ```typescript
2094
+ const epic = audio()
2095
+ .genre("orchestral")
2096
+ .subgenre("epic cinematic")
2097
+ .mood("epic", "triumphant", "powerful")
2098
+ .energy("building")
2099
+ .tempoMarking("moderato")
2100
+ .bpm(100)
2101
+ .instrumental()
2102
+ .instruments(["strings", "brass", "timpani", "choir", "percussion"])
2103
+ .section("intro", 16, "quiet strings, building tension")
2104
+ .section("build-up", 32, "brass enters, crescendo")
2105
+ .section("drop", 32, "full orchestra, powerful theme")
2106
+ .section("outro", 16, "triumphant resolution")
2107
+ .productionStyle(["polished", "layered"])
2108
+ .era("modern")
2109
+ .key("Dm")
2110
+ .build();
2111
+ ```
2112
+
2113
+ #### Pop Song with Lyrics
2114
+ ```typescript
2115
+ const popSong = audio()
2116
+ .genre("pop")
2117
+ .mood("uplifting", "energetic")
2118
+ .bpm(120)
2119
+ .vocalStyle("female")
2120
+ .language("english")
2121
+ .lyricsTheme("summer love and freedom")
2122
+ .lyrics(`[Verse 1]
2123
+ Dancing in the summer rain
2124
+ Nothing left to lose, nothing to explain
2125
+
2126
+ [Chorus]
2127
+ We're alive, we're on fire
2128
+ Take me higher, higher`)
2129
+ .instruments(["synth", "drums", "bass", "electric-guitar"])
2130
+ .section("intro", 8)
2131
+ .section("verse", 16)
2132
+ .section("chorus", 16)
2133
+ .section("verse", 16)
2134
+ .section("chorus", 16)
2135
+ .section("bridge", 8)
2136
+ .section("chorus", 16)
2137
+ .section("outro", 8)
2138
+ .productionStyle("polished")
2139
+ .key("G")
2140
+ .build();
2141
+ ```
640
2142
 
641
2143
  ---
642
2144