@chuzi/shared 1.3.41 → 1.3.43

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.
package/dist/index.js CHANGED
@@ -28,6 +28,86 @@ function formatCreditPrice(cents) {
28
28
  return `$${(cents / 100).toFixed(2)}`;
29
29
  }
30
30
 
31
+ // src/config/chuzi-ai-prompts.ts
32
+ var CHUZI_AI_PROMPT_STEPS = [
33
+ {
34
+ key: "hero",
35
+ lexicon_title: "chuzi_ai_step_hero",
36
+ lexicon_hint: "chuzi_ai_step_hero_hint",
37
+ monomyth_ref: "chuzi_ai_monomyth_hero",
38
+ required: true
39
+ },
40
+ {
41
+ key: "world",
42
+ lexicon_title: "chuzi_ai_step_world",
43
+ lexicon_hint: "chuzi_ai_step_world_hint",
44
+ monomyth_ref: "chuzi_ai_monomyth_world",
45
+ required: true
46
+ },
47
+ {
48
+ key: "you",
49
+ lexicon_title: "chuzi_ai_step_you",
50
+ lexicon_hint: "chuzi_ai_step_you_hint",
51
+ monomyth_ref: "chuzi_ai_monomyth_you",
52
+ required: true
53
+ },
54
+ {
55
+ key: "need",
56
+ lexicon_title: "chuzi_ai_step_need",
57
+ lexicon_hint: "chuzi_ai_step_need_hint",
58
+ monomyth_ref: "chuzi_ai_monomyth_need",
59
+ required: true
60
+ },
61
+ {
62
+ key: "go",
63
+ lexicon_title: "chuzi_ai_step_go",
64
+ lexicon_hint: "chuzi_ai_step_go_hint",
65
+ monomyth_ref: "chuzi_ai_monomyth_go",
66
+ required: true
67
+ },
68
+ {
69
+ key: "search",
70
+ lexicon_title: "chuzi_ai_step_search",
71
+ lexicon_hint: "chuzi_ai_step_search_hint",
72
+ monomyth_ref: "chuzi_ai_monomyth_search",
73
+ required: false
74
+ },
75
+ {
76
+ key: "find",
77
+ lexicon_title: "chuzi_ai_step_find",
78
+ lexicon_hint: "chuzi_ai_step_find_hint",
79
+ monomyth_ref: "chuzi_ai_monomyth_find",
80
+ required: false
81
+ },
82
+ {
83
+ key: "take",
84
+ lexicon_title: "chuzi_ai_step_take",
85
+ lexicon_hint: "chuzi_ai_step_take_hint",
86
+ monomyth_ref: "chuzi_ai_monomyth_take",
87
+ required: false
88
+ },
89
+ {
90
+ key: "return",
91
+ lexicon_title: "chuzi_ai_step_return",
92
+ lexicon_hint: "chuzi_ai_step_return_hint",
93
+ monomyth_ref: "chuzi_ai_monomyth_return",
94
+ required: false
95
+ },
96
+ {
97
+ key: "change",
98
+ lexicon_title: "chuzi_ai_step_change",
99
+ lexicon_hint: "chuzi_ai_step_change_hint",
100
+ monomyth_ref: "chuzi_ai_monomyth_change",
101
+ required: false
102
+ },
103
+ {
104
+ key: "tone",
105
+ lexicon_title: "chuzi_ai_step_tone",
106
+ lexicon_hint: "chuzi_ai_step_tone_hint",
107
+ required: false
108
+ }
109
+ ];
110
+
31
111
  // src/config/index.ts
32
112
  var REALM_IDS = ["cosmos", "wilds"];
33
113
  var SUPPORTED_LOCALES = [
@@ -161,7 +241,7 @@ var REALMS = {
161
241
  select_genre: "Select galaxy",
162
242
  genre_field_aria: "Galaxy",
163
243
  delete_story_verb: "Delete star system",
164
- title_scene_default: "Title planet",
244
+ title_scene_default: "Launch",
165
245
  choices_made_stat: "trajectories taken",
166
246
  content_rating: "Audience Class",
167
247
  content_rating_field_aria: "Audience class",
@@ -174,10 +254,10 @@ var REALMS = {
174
254
  editor_alt_media: "Effects",
175
255
  editor_choices: "Choices",
176
256
  editor_scene_settings: "Star Settings",
177
- editor_title_scene: "Title Star",
257
+ editor_title_scene: "Start",
178
258
  editor_film_title: "Star System Title",
179
259
  editor_film_title_hint: "Click to rename this star system",
180
- editor_ending_scene: "Final Star",
260
+ editor_ending_scene: "End",
181
261
  editor_play: "Engage",
182
262
  editor_pause: "Hold",
183
263
  editor_prev_frame: "Previous Frame",
@@ -194,8 +274,61 @@ var REALMS = {
194
274
  editor_create_scene_cost: "1 Stardust",
195
275
  editor_delete_scene_cta: "Delete Scene",
196
276
  editor_delete_scene_confirm: "Click again to confirm",
197
- editor_scene_locked_delete: "Title and end scenes cannot be deleted.",
277
+ editor_scene_locked_delete: "Start and end scenes cannot be deleted.",
198
278
  editor_scene_color: "Star Hue",
279
+ chuzi_ai_name: "Chuzi AI",
280
+ chuzi_ai_create_with: "Create with Chuzi AI",
281
+ chuzi_ai_create_manual: "Enter title manually",
282
+ chuzi_ai_intro: "Answer story-circle prompts and Chuzi AI will chart your short story.",
283
+ chuzi_ai_step_of: "Step",
284
+ chuzi_ai_back: "Back",
285
+ chuzi_ai_next: "Next",
286
+ chuzi_ai_scenes_label: "scenes",
287
+ chuzi_ai_creating: "Creating\u2026",
288
+ chuzi_ai_generate_failed: "Story generation failed.",
289
+ chuzi_ai_build_failed: "Failed to build story.",
290
+ chuzi_ai_generate: "Generate story",
291
+ chuzi_ai_generating: "Generating\u2026",
292
+ chuzi_ai_token_in: "Tokens in",
293
+ chuzi_ai_token_out: "Tokens out",
294
+ chuzi_ai_credits_cost: "AI credits",
295
+ chuzi_ai_scene_credits: "Scene credits",
296
+ chuzi_ai_total_cost: "Total create credits",
297
+ chuzi_ai_insufficient: "Not enough create credits for this generation.",
298
+ chuzi_ai_apply: "Build story",
299
+ chuzi_ai_applying: "Building scenes\u2026",
300
+ chuzi_ai_step_hero: "Hero",
301
+ chuzi_ai_step_hero_hint: "Who is your protagonist? Name, age, personality, and what makes them relatable.",
302
+ chuzi_ai_step_world: "Ordinary world",
303
+ chuzi_ai_step_world_hint: "Where does the story begin? Describe the setting and daily life before adventure calls.",
304
+ chuzi_ai_step_you: "You",
305
+ chuzi_ai_step_you_hint: "The character in a zone of comfort. What is their normal life like right now?",
306
+ chuzi_ai_step_need: "Need",
307
+ chuzi_ai_step_need_hint: "Something isn\u2019t right. What problem, longing, or imbalance disrupts their comfort?",
308
+ chuzi_ai_step_go: "Go",
309
+ chuzi_ai_step_go_hint: "Crossing the threshold. What event pushes them into the unknown?",
310
+ chuzi_ai_step_search: "Search",
311
+ chuzi_ai_step_search_hint: "Trials, growth, and exploration. What challenges and discoveries shape them?",
312
+ chuzi_ai_step_find: "Find",
313
+ chuzi_ai_step_find_hint: "The thing is found or revealed. What truth, object, or insight do they uncover?",
314
+ chuzi_ai_step_take: "Take",
315
+ chuzi_ai_step_take_hint: "Pay the price. What must they sacrifice or confront to claim their goal?",
316
+ chuzi_ai_step_return: "Return",
317
+ chuzi_ai_step_return_hint: "Back to the known world. How do they bring what they learned home?",
318
+ chuzi_ai_step_change: "Change",
319
+ chuzi_ai_step_change_hint: "Transformation achieved. How is the hero different from who they were at the start?",
320
+ chuzi_ai_step_tone: "Tone & mood",
321
+ chuzi_ai_step_tone_hint: "Genre, mood, and atmosphere (e.g. bittersweet sci-fi, cozy mystery, epic fantasy).",
322
+ chuzi_ai_monomyth_hero: "Hero\u2019s Journey: the protagonist",
323
+ chuzi_ai_monomyth_world: "Monomyth: ordinary world",
324
+ chuzi_ai_monomyth_you: "Story Circle: zone of comfort",
325
+ chuzi_ai_monomyth_need: "Story Circle: something isn\u2019t right",
326
+ chuzi_ai_monomyth_go: "Monomyth: crossing the first threshold",
327
+ chuzi_ai_monomyth_search: "Monomyth: road of trials",
328
+ chuzi_ai_monomyth_find: "Monomyth: the ultimate boon",
329
+ chuzi_ai_monomyth_take: "Monomyth: atonement with the father",
330
+ chuzi_ai_monomyth_return: "Monomyth: crossing the return threshold",
331
+ chuzi_ai_monomyth_change: "Monomyth: freedom to live",
199
332
  editor_ai_generate: "Generate Transmission",
200
333
  editor_ai_generating: "Transmitting Signal\u2026",
201
334
  editor_ai_mood_question: "What energy should this planet radiate?",
@@ -493,7 +626,7 @@ var REALMS = {
493
626
  select_genre: "Select biome",
494
627
  genre_field_aria: "Biome",
495
628
  delete_story_verb: "Delete grove",
496
- title_scene_default: "Title clearing",
629
+ title_scene_default: "Trailhead",
497
630
  choices_made_stat: "trails taken",
498
631
  content_rating: "Field Guide",
499
632
  content_rating_field_aria: "Field guide",
@@ -506,10 +639,10 @@ var REALMS = {
506
639
  editor_alt_media: "Effects",
507
640
  editor_choices: "Choices",
508
641
  editor_scene_settings: "Clearing Settings",
509
- editor_title_scene: "Title Clearing",
642
+ editor_title_scene: "Start",
510
643
  editor_film_title: "Grove Title",
511
644
  editor_film_title_hint: "Click to rename this grove",
512
- editor_ending_scene: "Roots",
645
+ editor_ending_scene: "End",
513
646
  editor_play: "Unfurl",
514
647
  editor_pause: "Rest",
515
648
  editor_prev_frame: "Previous Frame",
@@ -526,8 +659,61 @@ var REALMS = {
526
659
  editor_create_scene_cost: "1 Pollen",
527
660
  editor_delete_scene_cta: "Delete Scene",
528
661
  editor_delete_scene_confirm: "Click again to confirm",
529
- editor_scene_locked_delete: "Title and end scenes cannot be deleted.",
662
+ editor_scene_locked_delete: "Start and end scenes cannot be deleted.",
530
663
  editor_scene_color: "Clearing Tint",
664
+ chuzi_ai_name: "Chuzi AI",
665
+ chuzi_ai_create_with: "Create with Chuzi AI",
666
+ chuzi_ai_create_manual: "Enter title manually",
667
+ chuzi_ai_intro: "Answer story-circle prompts and Chuzi AI will grow your short story.",
668
+ chuzi_ai_step_of: "Step",
669
+ chuzi_ai_back: "Back",
670
+ chuzi_ai_next: "Next",
671
+ chuzi_ai_scenes_label: "scenes",
672
+ chuzi_ai_creating: "Creating\u2026",
673
+ chuzi_ai_generate_failed: "Story generation failed.",
674
+ chuzi_ai_build_failed: "Failed to build story.",
675
+ chuzi_ai_generate: "Generate story",
676
+ chuzi_ai_generating: "Generating\u2026",
677
+ chuzi_ai_token_in: "Tokens in",
678
+ chuzi_ai_token_out: "Tokens out",
679
+ chuzi_ai_credits_cost: "AI credits",
680
+ chuzi_ai_scene_credits: "Scene credits",
681
+ chuzi_ai_total_cost: "Total create credits",
682
+ chuzi_ai_insufficient: "Not enough create credits for this generation.",
683
+ chuzi_ai_apply: "Build story",
684
+ chuzi_ai_applying: "Building scenes\u2026",
685
+ chuzi_ai_step_hero: "Hero",
686
+ chuzi_ai_step_hero_hint: "Who is your protagonist? Name, age, personality, and what makes them relatable.",
687
+ chuzi_ai_step_world: "Ordinary world",
688
+ chuzi_ai_step_world_hint: "Where does the story begin? Describe the setting and daily life before adventure calls.",
689
+ chuzi_ai_step_you: "You",
690
+ chuzi_ai_step_you_hint: "The character in a zone of comfort. What is their normal life like right now?",
691
+ chuzi_ai_step_need: "Need",
692
+ chuzi_ai_step_need_hint: "Something isn\u2019t right. What problem, longing, or imbalance disrupts their comfort?",
693
+ chuzi_ai_step_go: "Go",
694
+ chuzi_ai_step_go_hint: "Crossing the threshold. What event pushes them into the unknown?",
695
+ chuzi_ai_step_search: "Search",
696
+ chuzi_ai_step_search_hint: "Trials, growth, and exploration. What challenges and discoveries shape them?",
697
+ chuzi_ai_step_find: "Find",
698
+ chuzi_ai_step_find_hint: "The thing is found or revealed. What truth, object, or insight do they uncover?",
699
+ chuzi_ai_step_take: "Take",
700
+ chuzi_ai_step_take_hint: "Pay the price. What must they sacrifice or confront to claim their goal?",
701
+ chuzi_ai_step_return: "Return",
702
+ chuzi_ai_step_return_hint: "Back to the known world. How do they bring what they learned home?",
703
+ chuzi_ai_step_change: "Change",
704
+ chuzi_ai_step_change_hint: "Transformation achieved. How is the hero different from who they were at the start?",
705
+ chuzi_ai_step_tone: "Tone & mood",
706
+ chuzi_ai_step_tone_hint: "Genre, mood, and atmosphere (e.g. bittersweet sci-fi, cozy mystery, epic fantasy).",
707
+ chuzi_ai_monomyth_hero: "Hero\u2019s Journey: the protagonist",
708
+ chuzi_ai_monomyth_world: "Monomyth: ordinary world",
709
+ chuzi_ai_monomyth_you: "Story Circle: zone of comfort",
710
+ chuzi_ai_monomyth_need: "Story Circle: something isn\u2019t right",
711
+ chuzi_ai_monomyth_go: "Monomyth: crossing the first threshold",
712
+ chuzi_ai_monomyth_search: "Monomyth: road of trials",
713
+ chuzi_ai_monomyth_find: "Monomyth: the ultimate boon",
714
+ chuzi_ai_monomyth_take: "Monomyth: atonement with the father",
715
+ chuzi_ai_monomyth_return: "Monomyth: crossing the return threshold",
716
+ chuzi_ai_monomyth_change: "Monomyth: freedom to live",
531
717
  editor_ai_generate: "Grow Bloom",
532
718
  editor_ai_generating: "Seed Sprouting\u2026",
533
719
  editor_ai_mood_question: "What feeling should this clearing evoke?",
@@ -823,7 +1009,7 @@ var FALLBACK_LEXICON = {
823
1009
  select_genre: "Select genre",
824
1010
  genre_field_aria: "Film genre",
825
1011
  delete_story_verb: "Delete film",
826
- title_scene_default: "Title Scene",
1012
+ title_scene_default: "Start",
827
1013
  choices_made_stat: "choices made",
828
1014
  content_rating: "Rating",
829
1015
  content_rating_field_aria: "Content rating",
@@ -836,10 +1022,10 @@ var FALLBACK_LEXICON = {
836
1022
  editor_alt_media: "Effects",
837
1023
  editor_choices: "Choices",
838
1024
  editor_scene_settings: "Scene Settings",
839
- editor_title_scene: "Title Scene",
1025
+ editor_title_scene: "Start",
840
1026
  editor_film_title: "Film Title",
841
1027
  editor_film_title_hint: "Click to rename this film",
842
- editor_ending_scene: "Ending Scene",
1028
+ editor_ending_scene: "End",
843
1029
  editor_play: "Play",
844
1030
  editor_pause: "Pause",
845
1031
  editor_prev_frame: "Previous Frame",
@@ -856,8 +1042,61 @@ var FALLBACK_LEXICON = {
856
1042
  editor_create_scene_cost: "1 credit",
857
1043
  editor_delete_scene_cta: "Delete Scene",
858
1044
  editor_delete_scene_confirm: "Click again to confirm",
859
- editor_scene_locked_delete: "Title and end scenes cannot be deleted.",
1045
+ editor_scene_locked_delete: "Start and end scenes cannot be deleted.",
860
1046
  editor_scene_color: "Scene Color",
1047
+ chuzi_ai_name: "Chuzi AI",
1048
+ chuzi_ai_create_with: "Create with Chuzi AI",
1049
+ chuzi_ai_create_manual: "Enter title manually",
1050
+ chuzi_ai_intro: "Answer a few story-circle prompts and Chuzi AI will draft your short story.",
1051
+ chuzi_ai_step_of: "Step",
1052
+ chuzi_ai_back: "Back",
1053
+ chuzi_ai_next: "Next",
1054
+ chuzi_ai_scenes_label: "scenes",
1055
+ chuzi_ai_creating: "Creating\u2026",
1056
+ chuzi_ai_generate_failed: "Story generation failed.",
1057
+ chuzi_ai_build_failed: "Failed to build story.",
1058
+ chuzi_ai_generate: "Generate story",
1059
+ chuzi_ai_generating: "Generating\u2026",
1060
+ chuzi_ai_token_in: "Tokens in",
1061
+ chuzi_ai_token_out: "Tokens out",
1062
+ chuzi_ai_credits_cost: "AI credits",
1063
+ chuzi_ai_scene_credits: "Scene credits",
1064
+ chuzi_ai_total_cost: "Total create credits",
1065
+ chuzi_ai_insufficient: "Not enough create credits for this generation.",
1066
+ chuzi_ai_apply: "Build story",
1067
+ chuzi_ai_applying: "Building scenes\u2026",
1068
+ chuzi_ai_step_hero: "Hero",
1069
+ chuzi_ai_step_hero_hint: "Who is your protagonist? Name, age, personality, and what makes them relatable.",
1070
+ chuzi_ai_step_world: "Ordinary world",
1071
+ chuzi_ai_step_world_hint: "Where does the story begin? Describe the setting and daily life before adventure calls.",
1072
+ chuzi_ai_step_you: "You",
1073
+ chuzi_ai_step_you_hint: "The character in a zone of comfort. What is their normal life like right now?",
1074
+ chuzi_ai_step_need: "Need",
1075
+ chuzi_ai_step_need_hint: "Something isn\u2019t right. What problem, longing, or imbalance disrupts their comfort?",
1076
+ chuzi_ai_step_go: "Go",
1077
+ chuzi_ai_step_go_hint: "Crossing the threshold. What event pushes them into the unknown?",
1078
+ chuzi_ai_step_search: "Search",
1079
+ chuzi_ai_step_search_hint: "Trials, growth, and exploration. What challenges and discoveries shape them?",
1080
+ chuzi_ai_step_find: "Find",
1081
+ chuzi_ai_step_find_hint: "The thing is found or revealed. What truth, object, or insight do they uncover?",
1082
+ chuzi_ai_step_take: "Take",
1083
+ chuzi_ai_step_take_hint: "Pay the price. What must they sacrifice or confront to claim their goal?",
1084
+ chuzi_ai_step_return: "Return",
1085
+ chuzi_ai_step_return_hint: "Back to the known world. How do they bring what they learned home?",
1086
+ chuzi_ai_step_change: "Change",
1087
+ chuzi_ai_step_change_hint: "Transformation achieved. How is the hero different from who they were at the start?",
1088
+ chuzi_ai_step_tone: "Tone & mood",
1089
+ chuzi_ai_step_tone_hint: "Genre, mood, and atmosphere (e.g. bittersweet sci-fi, cozy mystery, epic fantasy).",
1090
+ chuzi_ai_monomyth_hero: "Hero\u2019s Journey: the protagonist",
1091
+ chuzi_ai_monomyth_world: "Monomyth: ordinary world",
1092
+ chuzi_ai_monomyth_you: "Story Circle: zone of comfort",
1093
+ chuzi_ai_monomyth_need: "Story Circle: something isn\u2019t right",
1094
+ chuzi_ai_monomyth_go: "Monomyth: crossing the first threshold",
1095
+ chuzi_ai_monomyth_search: "Monomyth: road of trials",
1096
+ chuzi_ai_monomyth_find: "Monomyth: the ultimate boon",
1097
+ chuzi_ai_monomyth_take: "Monomyth: atonement with the father",
1098
+ chuzi_ai_monomyth_return: "Monomyth: crossing the return threshold",
1099
+ chuzi_ai_monomyth_change: "Monomyth: freedom to live",
861
1100
  editor_ai_generate: "Generate with AI",
862
1101
  editor_ai_generating: "Generating\u2026",
863
1102
  editor_ai_mood_question: "What mood should this scene convey?",
@@ -1411,7 +1650,9 @@ function createChuziClient(config) {
1411
1650
  show: (id, opts) => request("GET", `/api/v1/ai/generations/${encodeURIComponent(id)}`, opts),
1412
1651
  accept: (id, req) => request("POST", `/api/v1/ai/generations/${encodeURIComponent(id)}/accept`, { body: req }),
1413
1652
  reject: (id, req) => request("POST", `/api/v1/ai/generations/${encodeURIComponent(id)}/reject`, { body: req }),
1414
- storyStyle: (storyId, opts) => request("GET", `/api/v1/ai/stories/${encodeURIComponent(storyId)}/style`, opts)
1653
+ storyStyle: (storyId, opts) => request("GET", `/api/v1/ai/stories/${encodeURIComponent(storyId)}/style`, opts),
1654
+ storyEstimate: (req) => request("POST", "/api/v1/ai/story/estimate", { body: req }),
1655
+ storyGenerate: (req) => request("POST", "/api/v1/ai/story/generate", { body: req })
1415
1656
  }
1416
1657
  };
1417
1658
  }
@@ -1526,6 +1767,6 @@ function isLikelyVideoUrl(url, mediaType) {
1526
1767
  return /\.(mp4|webm|mov|m3u8)(\?|$)/i.test(url);
1527
1768
  }
1528
1769
 
1529
- export { CONTENT_RATINGS, CONTENT_RATING_IDS, CREDITS_PER_DOLLAR, CREDIT_CENTS_PER_UNIT, ChuziApiError, DEFAULT_LOCALE, FALLBACK_LEXICON, FALLBACK_LOCALES, Intent, LOCALE_LABELS, REALMS, REALM_IDS, SCENE_TREE_THEMES, SUPPORTED_LOCALES, THEME_TOKENS, computeScenePreviewMs, computeSceneVisibility, createChuziClient, defaultFocusSnap, defaultPurchaseCredits, formatCreditPrice, getRealmLexiconOverrides, getSceneTreeTheme, getThemeTokens, insufficientCreditsPool, isContentRating, isInsufficientCreditsError, isLikelyImageUrl, isLikelyVideoUrl, isSupportedLocale, lexiconForRealm, matchAcceptLanguage, mergeIntentSources, normalizeLocale, previewMsWhenVisible, priceCentsForCredits, resolveChoiceTiming, setRealmLexiconOverrides, t };
1770
+ export { CHUZI_AI_PROMPT_STEPS, CONTENT_RATINGS, CONTENT_RATING_IDS, CREDITS_PER_DOLLAR, CREDIT_CENTS_PER_UNIT, ChuziApiError, DEFAULT_LOCALE, FALLBACK_LEXICON, FALLBACK_LOCALES, Intent, LOCALE_LABELS, REALMS, REALM_IDS, SCENE_TREE_THEMES, SUPPORTED_LOCALES, THEME_TOKENS, computeScenePreviewMs, computeSceneVisibility, createChuziClient, defaultFocusSnap, defaultPurchaseCredits, formatCreditPrice, getRealmLexiconOverrides, getSceneTreeTheme, getThemeTokens, insufficientCreditsPool, isContentRating, isInsufficientCreditsError, isLikelyImageUrl, isLikelyVideoUrl, isSupportedLocale, lexiconForRealm, matchAcceptLanguage, mergeIntentSources, normalizeLocale, previewMsWhenVisible, priceCentsForCredits, resolveChoiceTiming, setRealmLexiconOverrides, t };
1530
1771
  //# sourceMappingURL=index.js.map
1531
1772
  //# sourceMappingURL=index.js.map