@zodic/shared 0.0.314 → 0.0.316

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.
@@ -99,6 +99,13 @@
99
99
  "when": 1743645500734,
100
100
  "tag": "0013_lean_frightful_four",
101
101
  "breakpoints": true
102
+ },
103
+ {
104
+ "idx": 14,
105
+ "version": "6",
106
+ "when": 1744920245024,
107
+ "tag": "0014_green_marvel_apes",
108
+ "breakpoints": true
102
109
  }
103
110
  ]
104
111
  }
package/db/schema.ts CHANGED
@@ -469,6 +469,10 @@ export const generations = sqliteTable(
469
469
  () => conceptCombinations.id,
470
470
  { onDelete: 'cascade' }
471
471
  ),
472
+ archetypeDataId: text('archetype_data_id').references(
473
+ () => archetypesData.id,
474
+ { onDelete: 'cascade' }
475
+ ), // New column to reference archetypes_data
472
476
  type: text('type').notNull(), // e.g., "concept_image"
473
477
  status: text('status').default('pending').notNull(), // "pending", "completed", "failed"
474
478
  url: text('url'), // URL for the generated image
@@ -478,6 +482,7 @@ export const generations = sqliteTable(
478
482
  index('generations_user_id_idx').on(t.userId),
479
483
  index('generations_concept_combination_id_idx').on(t.conceptCombinationId),
480
484
  index('generations_archetype_index_idx').on(t.archetypeIndex),
485
+ index('generations_archetype_data_id_idx').on(t.archetypeDataId), // New index for archetypeDataId
481
486
  ]
482
487
  );
483
488
 
@@ -526,3 +531,15 @@ export const tokens = sqliteTable(
526
531
  index('tokens_user_id_idx').on(t.userId), // Index on user_id
527
532
  ]
528
533
  );
534
+
535
+ export const logs = sqliteTable(
536
+ 'logs',
537
+ {
538
+ id: text('id').primaryKey(), // e.g., "archetype-workflow:timestamp"
539
+ level: text('level').notNull(), // "info", "debug", "warn", "error"
540
+ message: text('message').notNull(),
541
+ context: text('context').default('{}').notNull(), // JSON stringified object with additional data
542
+ createdAt: integer('created_at').default(sql`CURRENT_TIMESTAMP`),
543
+ },
544
+ () => []
545
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.314",
3
+ "version": "0.0.316",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -10,78 +10,292 @@ import { conceptPrompts } from './conceptPrompts';
10
10
  import { mapConceptToPlanets } from './mapConceptToPlanets';
11
11
 
12
12
  export const buildLLMMessages = (env: BackendBindings) => ({
13
- generateCosmicMirrorArchetypeBasicInfo: ({
14
- sun,
15
- ascendant,
16
- moon,
17
- }: Crown): ChatMessages => [
18
- {
19
- role: 'system',
20
- content: env.PROMPT_GENERATE_ARCHETYPE_BASIC_INFO,
21
- },
22
- {
23
- role: 'user',
24
- content: `
25
- - Sun: ${sun}
26
- - Ascendant: ${ascendant}
27
- - Moon: ${moon}
28
- `,
29
- },
30
- ],
31
- generateCosmicMirrorArchetypesLeonardoPrompts: (
32
- archetypes: Array<{ name: string; visualDescription: string }>
33
- ): ChatMessages => [
34
- {
35
- role: 'system',
36
- content: env.PROMPT_GENERATE_ARCHETYPE_LEONARDO_PROMPTS,
37
- },
38
- {
39
- role: 'user',
40
- content: `
41
- 1.
42
- - Name: ${archetypes[0].name}
43
- - Visual Description: ${archetypes[0].visualDescription}
44
-
45
- 2.
46
- - Name: ${archetypes[1].name}
47
- - Visual Description: ${archetypes[1].visualDescription}
48
-
49
- 3.
50
- - Name: ${archetypes[2].name}
51
- - Visual Description: ${archetypes[2].visualDescription}
52
- `,
53
- },
54
- ],
13
+ generateCosmicMirrorDescriptionAndVirtues: ({
14
+ combination,
15
+ names,
16
+ essenceLines,
17
+ }: {
18
+ combination: string;
19
+ names: [string, string, string]; // archetypeIndex: 1, 2, 3
20
+ essenceLines: [string, string, string];
21
+ }): ChatMessages => {
22
+ return [
23
+ {
24
+ role: 'system',
25
+ content: `
26
+ You are a gifted fantasy writer and astrologer. Your task is to write mystical **narrative descriptions** and **core virtues** for three archetypes, based on their names, essence lines, and astrological combination.
27
+
28
+ Each archetype is influenced by the zodiac combination (Sun, Ascendant, Moon), and each one emphasizes one of those signs respectively.
29
+
30
+ Please provide:
31
+
32
+ 1. A **Narrative Description** for each archetype (80–100 words):
33
+ English (gender-neutral)
34
+ • Portuguese — masculine version
35
+ Portuguese — feminine version
36
+
37
+ 2. Three symbolic **Virtues** for each archetype.
38
+
39
+
40
+
41
+ ✳️ Use the following format exactly for the response:
42
+
43
+ ---
44
+
45
+ 1.
46
+
47
+ Description EN: ...
48
+ • Description PT-M: ...
49
+ • Description PT-F: ...
50
+ Virtues: Virtue1, Virtue2, Virtue3
51
+
52
+ ---
53
+
54
+ 2.
55
+
56
+ • Description EN: ...
57
+ • Description PT-M: ...
58
+ • Description PT-F: ...
59
+ • Virtues: Virtue1, Virtue2, Virtue3
60
+
61
+ ---
62
+
63
+ 3.
64
+
65
+ • Description EN: ...
66
+ • Description PT-M: ...
67
+ • Description PT-F: ...
68
+ • Virtues: Virtue1, Virtue2, Virtue3
69
+ `,
70
+ },
71
+ {
72
+ role: 'user',
73
+ content: `
74
+ Zodiac Combination: ${combination}
75
+
76
+ Archetype 1:
77
+ - Name: ${names[0]}
78
+ - Essence Line: ${essenceLines[0]}
79
+
80
+ Archetype 2:
81
+ - Name: ${names[1]}
82
+ - Essence Line: ${essenceLines[1]}
83
+
84
+ Archetype 3:
85
+ - Name: ${names[2]}
86
+ - Essence Line: ${essenceLines[2]}
87
+ `,
88
+ },
89
+ ];
90
+ },
55
91
  generateCosmicMirrorArchetypeContent: ({
56
92
  name,
57
93
  description,
58
- sun,
59
- ascendant,
60
- moon,
94
+ combination,
61
95
  }: {
62
96
  name: string;
63
97
  description: string;
64
- sun: string;
65
- ascendant: string;
66
- moon: string;
67
- }): ChatMessages => [
98
+ combination: string;
99
+ }): ChatMessages => {
100
+ const [sun, ascendant, moon] = combination.split('-');
101
+
102
+ return [
103
+ {
104
+ role: 'system',
105
+ content: `
106
+ You are an expert in astrology and archetypal synthesis. Your task is to generate detailed **archetype content** based on a person's core archetype name, description, and Sun, Ascendant, and Moon signs.
107
+
108
+ Your response must be insightful, symbolic, and poetic. Avoid direct mentions of zodiac signs or planets; instead, convey their **archetypal energy** through rich metaphors and evocative storytelling.
109
+
110
+ Generate two versions of the content:
111
+ - One in **English** (gender-neutral).
112
+ - One in **Brazilian Portuguese**, with both **masculine and feminine** phrasing. Content and metaphors should remain identical; only adapt gendered language.
113
+
114
+ Each content version must include **six sections**, each with approximately **140 words**:
115
+
116
+ 1. **The Voice of the Soul** – How the archetype expresses itself in daily life.
117
+ 2. **The Gifts You Bear** – Strengths and contributions of the archetype.
118
+ 3. **The Shadows You Face** – Challenges or inner conflicts.
119
+ 4. **The Rhythm of Your Days** – Their lifestyle, habits, and inner tempo.
120
+ 5. **The Ties That Bind** – Relationships and emotional connections.
121
+ 6. **The Light Within** – Inner peace, fulfillment, and spiritual resonance.
122
+
123
+
124
+
125
+ ✨ Output Format:
126
+
127
+ Return the full response in this exact format:
128
+
129
+ ---
130
+
131
+ EN:
132
+ # The Voice of the Soul
133
+ [English version]
134
+
135
+ # The Gifts You Bear
136
+ [...]
137
+
138
+ # The Shadows You Face
139
+ [...]
140
+
141
+ # The Rhythm of Your Days
142
+ [...]
143
+
144
+ # The Ties That Bind
145
+ [...]
146
+
147
+ # The Light Within
148
+ [...]
149
+
150
+ ---
151
+
152
+ PT-M:
153
+ # A Voz da Alma
154
+ [Versão masculina em português]
155
+
156
+ # Os Dons que Você Carrega
157
+ [...]
158
+
159
+ # As Sombras que Enfrenta
160
+ [...]
161
+
162
+ # O Ritmo dos Seus Dias
163
+ [...]
164
+
165
+ # Os Laços que te Conectam
166
+ [...]
167
+
168
+ # A Luz Interior
169
+ [...]
170
+
171
+ ---
172
+
173
+ PT-F:
174
+ # A Voz da Alma
175
+ [Versão feminina em português]
176
+
177
+ # Os Dons que Você Carrega
178
+ [...]
179
+
180
+ # As Sombras que Enfrenta
181
+ [...]
182
+
183
+ # O Ritmo dos Seus Dias
184
+ [...]
185
+
186
+ # Os Laços que te Conectam
187
+ [...]
188
+
189
+ # A Luz Interior
190
+ [...]
191
+ `,
192
+ },
193
+ {
194
+ role: 'user',
195
+ content: `
196
+ Generate rich and mystical content for the following archetype:
197
+
198
+ • Archetype Name: ${name}
199
+ • Archetype Description: ${description}
200
+ • Sun Sign: ${sun}
201
+ • Ascendant Sign: ${ascendant}
202
+ • Moon Sign: ${moon}
203
+ `,
204
+ },
205
+ ];
206
+ },
207
+
208
+ generateCosmicMirrorArchetypeLeonardoPrompts: (
209
+ archetypes: Array<{ name: string; description: string }>
210
+ ): ChatMessages => [
68
211
  {
69
212
  role: 'system',
70
- content: env.PROMPT_GENERATE_ARCHETYPE_CONTENT,
71
- },
72
- {
73
- role: 'user',
74
213
  content: `
75
- Generate a detailed archetype description using the following inputs:
214
+ You are an expert in fantasy image generation. Your task is to transform archetype names and symbolic descriptions into highly detailed prompts for generating photorealistic fantasy characters using Leonardo.ai.
76
215
 
77
- Archetype Name: ${name}
78
- Archetype Description: ${description}
79
- Sun Sign: ${sun}
80
- Ascendant Sign: ${ascendant}
81
- Moon Sign: ${moon}
216
+ For each archetype, generate two prompts:
217
+ - One for a male character
218
+ - One for a female character
219
+
220
+ Instructions:
221
+ - Focus primarily on the character design—their appearance, clothing, and demeanor. This is more important than the background or setting.
222
+ - The setting should remain fantasy-inspired, but avoid over-specification. General hints like “enchanted realm” or “mystical battlefield” are enough unless the archetype demands more.
223
+ - The character must reflect the symbolic and mythic tone of the archetype name and description.
224
+ - Make sure male characters have short, cropped, or bald hair. Never long.
225
+ - Female characters may have long, flowing, or styled hair if it suits the archetype.
226
+ - The outfit should be rich in fantasy elements: armor, cloaks, robes, accessories. Avoid modern or casual clothing.
227
+ - The character must always be facing the camera, with a clear, visible face.
228
+ - Rendering instructions must include: 8K, HDR, Unreal Engine, photorealism, cinematic lighting, full body, fantasy aesthetic.
229
+
230
+ Each prompt must:
231
+ - Be under 1200 characters (including spaces).
232
+ - Clearly distinguish between the male and female versions only by adapting gender-specific features.
233
+ - Maintain identical structure, setting, and tone between both versions.
234
+
235
+ Output Format
236
+
237
+ 1.m
238
+ [Prompt for the first archetype made for a male character]
239
+
240
+ 1.f
241
+ [Prompt for the first archetype made for a female character (same as the male prompt but adapted for gender-specific traits)]
242
+
243
+ 2.m
244
+ [Prompt for the second archetype made for a male character]
245
+
246
+ 2.f
247
+ [Prompt for the second archetype made for a female character]
248
+
249
+ 3.m
250
+ [Prompt for the third archetype made for a male character]
251
+
252
+ 3.f
253
+ [Prompt for the third archetype made for a female character]
82
254
  `,
83
255
  },
256
+ {
257
+ role: 'user',
258
+ content: archetypes
259
+ .map((a, idx) =>
260
+ `
261
+ ${idx + 1}.
262
+ - Name: ${a.name}
263
+ - Description: ${a.description}`.trim()
264
+ )
265
+ .join('\n\n'),
266
+ },
84
267
  ],
268
+
269
+ // generateCosmicMirrorArchetypeContent: ({
270
+ // name,
271
+ // description,
272
+ // sun,
273
+ // ascendant,
274
+ // moon,
275
+ // }: {
276
+ // name: string;
277
+ // description: string;
278
+ // sun: string;
279
+ // ascendant: string;
280
+ // moon: string;
281
+ // }): ChatMessages => [
282
+ // {
283
+ // role: 'system',
284
+ // content: env.PROMPT_GENERATE_ARCHETYPE_CONTENT,
285
+ // },
286
+ // {
287
+ // role: 'user',
288
+ // content: `
289
+ // Generate a detailed archetype description using the following inputs:
290
+
291
+ // Archetype Name: ${name}
292
+ // Archetype Description: ${description}
293
+ // Sun Sign: ${sun}
294
+ // Ascendant Sign: ${ascendant}
295
+ // Moon Sign: ${moon}
296
+ // `,
297
+ // },
298
+ // ],
85
299
  personalizeCosmicMirrorLeonardoPrompt: ({
86
300
  leonardoPrompt,
87
301
  traits,