22 ("idle", 0, 6, "calm resting, breathing, and blinking loop"),
23 ("running-right", 1, 8, "rightward drag movement loop"),
24 ("running-left", 2, 8, "leftward drag movement loop"),
25 ("waving", 3, 4, "greeting or attention gesture"),
26 ("jumping", 4, 5, "hover or playful jump"),
27 ("failed", 5, 8, "blocked, failed, or cancelled reaction"),
28 ("waiting", 6, 6, "waiting for approval, help, or user input"),
29 ("running", 7, 6, "active task work or processing"),
30 ("review", 8, 6, "ready or completed output review"),
31]
32
33STATE_PROMPTS = {
34 "idle": "Calm low-distraction resting loop: subtle breathing, tiny blink, slight head/body bob, and only quiet persona-preserving motion.",
35 "running-right": "Dragging-right loop: show directional movement to the right through body and limb poses only.",
36 "running-left": "Dragging-left loop: show directional movement to the left through body and limb poses only.",
37 "waving": "Greeting loop: paw or limb down, raised, tilted, and returning in a friendly attention gesture.",
38 "jumping": "Hover jump loop: anticipation, lift, airborne peak, descent, and settle through body height.",
39 "failed": "Blocked/failed loop: slumped or deflated reaction with sad or closed eyes.",
40 "waiting": "Needs-input loop: expectant asking pose for approval, help, or user input.",
41 "running": "Working loop: focused active-task processing, thinking, typing, scanning, or effortful concentration; not literal foot-running, jogging, sprinting, treadmill motion, raised knees, long steps, pumping arms, or directional travel.",
42 "review": "Ready-review loop: focused inspection of completed output with lean, blink, narrowed eyes, head tilt, or paw pose.",
43}
44
45STATE_REQUIREMENTS = {
46 "idle": [
47 "CRITICAL: idle is the low-distraction baseline state and the first frame is also used as the reduced-motion static pet.",
48 "Use only subtle idle motion: gentle breathing, a tiny blink, a slight head or body bob, a very small material sway, or another quiet motion that fits the pet persona.",
49 "Keep the pet essentially in the same pose, facing direction, silhouette, markings, palette, and prop state across all 6 frames.",
50 "Idle variation must stay calm but still read as animation; do not repeat effectively identical copies across the loop.",
51 "Do not show waving, walking, running, jumping, talking, working, reviewing, emotional reactions, large gestures, item interactions, or new props.",
52 "Feet, base, body, or object anchor should remain planted or nearly planted.",
53 "The first and last frames should be very close visually so the loop feels calm and does not pop.",
54 ],
55 "waving": [
56 "Show the greeting through paw, hand, wing, or limb pose only.",
57 "Do not draw wave marks, motion arcs, lines, sparkles, symbols, or floating effects around the gesture.",
58 ],
59 "jumping": [
60 "Show the jump through pose and vertical body position only: anticipation, lift, airborne peak, descent, settle.",
61 "Do not draw ground shadows, contact shadows, drop shadows, oval shadows, landing marks, dust, smears, bounce pads, or motion marks under the pet.",
62 "Keep the background outside the pet perfectly flat chroma key with no darker key-colored patches.",
63 ],
64 "failed": [
65 "Show failure through slumped pose, drooping ears/limbs, closed or sad eyes, and lower body position.",
66 "Tears, small smoke puffs, or tiny stars are allowed only if attached to or overlapping the pet silhouette and kept inside the same frame slot.",
67 "Do not draw red X marks, floating symbols, detached stars, separated smoke clouds, falling tear drops, dust, or other loose effects.",
68 ],
69 "waiting": [
70 "Show that Codex needs approval, help, or user input through an expectant asking pose.",
71 "Keep the motion patient and readable, without turning it into ordinary idle or review.",
72 ],
73 "running": [
74 "Show the pet actively working or processing, as if running a task: focused posture, busy hands or paws, purposeful bobbing, thinking motion, tool or prop motion only if already part of the pet identity, or other non-locomotion activity.",
75 "Do not show literal foot-running, jogging, sprinting, treadmill motion, raised knees, long steps, pumping arms, directional travel, speed lines, dust clouds, floor shadows, motion trails, or detached motion effects.",
76 ],
77 "review": [
78 "Show review through lean, blink, narrowed eyes, head tilt, or paw/hand position.",
79 "Do not add magnifying glasses, papers, code, UI, punctuation, symbols, or other new props unless they already exist in the base pet identity.",
80 ],
81 "running-right": [
82 "Show directional drag movement to the right through body, limb, and prop movement only.",
83 "The row must unmistakably face and travel right.",
84 "The movement cadence must alternate visibly across the 8 frames instead of repeating one nearly static stride.",
85 "Do not draw speed lines, dust clouds, floor shadows, motion trails, or detached motion effects.",
86 ],
87 "running-left": [
88 "Show directional drag movement to the left through body, limb, and prop movement only.",
89 "The row must unmistakably face and travel left.",
90 "The movement cadence must alternate visibly across the 8 frames instead of repeating one nearly static stride.",
91 "Do not draw speed lines, dust clouds, floor shadows, motion trails, or detached motion effects.",
92 ],
93}
94
95NON_DERIVABLE_STATES = {
96 "waving",
97 "jumping",
98 "failed",
99 "waiting",
100 "running",
101 "review",
102}
103
104PET_SAFE_STYLE = (
105 "Pet-safe sprite: compact full-body mascot, readable in a 192x208 cell, "
491 brand_block = f"\nBrand inspiration: {brand_line}\n" if brand_line else "\n"
492 chroma_key = args.chroma_key["hex"]
493 chroma_name = args.chroma_key["name"]
494 return f"""Create one clean full-body reference sprite for Codex pet {args.display_name}.
495
496Pet identity: {pet_notes}.
497Style: {style_contract}
498{brand_block}
499Place a single centered pose on a perfectly flat pure {chroma_name} {chroma_key} chroma-key background. Keep the full pet visible, compact, readable at 192x208, and easy to animate. Preserve approved reference identity cues. No scenery, text, borders, checkerboard transparency, shadows, glows, detached effects, or extra props. Keep {chroma_key} and close colors out of the pet, props, highlights, and effects."""
510 state_requirements = "\n".join(f"- {line}" for line in STATE_REQUIREMENTS[state])
511 return f"""Create one horizontal animation strip for Codex pet `{args.pet_id}`, state `{state}`.
512
513Use the attached canonical base for identity. Use the attached layout guide only for slot count, spacing, centering, and padding; do not draw the guide.
514
515Output exactly {frames} full-body frames in one left-to-right row on flat pure {chroma_name} {chroma_key}. Treat the row as {frames} invisible equal-width slots: one centered complete pose per slot, evenly spaced, with no overlap, clipping, empty slots, labels, or borders.
516
517Identity: same pet in every frame: {pet_notes}. Preserve silhouette, face, proportions, markings, palette, material, style, and props.
518Style: {style_contract}
519Animation continuity: keep apparent pet scale and baseline stable within the row unless the state itself intentionally changes vertical position, such as `jumping`. Move the pose within the slot instead of redrawing the pet larger or smaller frame to frame.
520
521State action: {state_prompt}
522
523State requirements:
524{state_requirements}
525
526Clean extraction: crisp opaque edges, safe padding, no scenery, text, guide marks, checkerboard, shadows, glows, motion blur, speed lines, dust, detached effects, stray pixels, or chroma-key colors inside the pet."""
532 pet_notes = args.pet_notes or "the canonical base pet"
533 chroma_key = args.chroma_key["hex"]
534 chroma_name = args.chroma_key["name"]
535 state_prompt = STATE_PROMPTS[state]
536 state_requirements = "\n".join(f"- {line}" for line in STATE_REQUIREMENTS[state])
537 return f"""Create Codex pet row `{state}` for `{args.pet_id}`: exactly {frames} full-body frames in one horizontal strip on flat pure {chroma_name} {chroma_key}.
538
539Use the attached canonical base for identity and the layout guide only for spacing. Same pet in every frame: {pet_notes}. Preserve silhouette, face, palette, material, proportions, markings, and props.
540
541Keep apparent pet scale and baseline stable within the row unless the state itself intentionally changes vertical position, such as `jumping`.
542
543Action: {state_prompt}
544
545State requirements:
546{state_requirements}
547
548One centered complete pose per invisible slot. No text, boxes, guide marks, scenery, shadows, glows, motion blur, speed lines, dust, detached effects, stray pixels, or {chroma_key} colors in the pet."""