@zodic/shared 0.0.252 → 0.0.253

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.252",
3
+ "version": "0.0.253",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -170,7 +170,7 @@ export const astroPrompts = {
170
170
  `.trim();
171
171
 
172
172
  switch (params.featureType) {
173
- case "moon_phase": {
173
+ case 'moon_phase': {
174
174
  const formattedName = params.name
175
175
  .split('-')
176
176
  .map((word: string) => word.charAt(0).toUpperCase() + word.slice(1))
@@ -181,45 +181,58 @@ export const astroPrompts = {
181
181
  `.trim();
182
182
  }
183
183
 
184
- case "element": {
184
+ case 'element': {
185
185
  switch (params.subtype) {
186
- case "balanced":
186
+ case 'balanced':
187
187
  return `
188
188
  Make me an astrological report for a person with a balanced elemental distribution in their birth chart.
189
189
  ${baseFormat}
190
190
  `.trim();
191
- case "pure": {
192
- const dominant = params.dominantElement.charAt(0).toUpperCase() + params.dominantElement.slice(1);
191
+ case 'pure': {
192
+ const dominant =
193
+ params.dominantElement.charAt(0).toUpperCase() +
194
+ params.dominantElement.slice(1);
193
195
  return `
194
196
  Make me an astrological report for a person with a preponderance of the ${dominant} element in their birth chart.
195
197
  ${baseFormat}
196
198
  `.trim();
197
199
  }
198
- case "preponderant_lacking": {
199
- const dominant = params.dominantElement.charAt(0).toUpperCase() + params.dominantElement.slice(1);
200
- const lacking = params.lackingElement.charAt(0).toUpperCase() + params.lackingElement.slice(1);
200
+ case 'preponderant_lacking': {
201
+ const dominant =
202
+ params.dominantElement.charAt(0).toUpperCase() +
203
+ params.dominantElement.slice(1);
204
+ const lacking =
205
+ params.lackingElement.charAt(0).toUpperCase() +
206
+ params.lackingElement.slice(1);
201
207
  return `
202
208
  Make me an astrological report for a person with a preponderance of the ${dominant} element and a lack of the ${lacking} element in their birth chart.
203
209
  ${baseFormat}
204
210
  `.trim();
205
211
  }
206
212
  default:
207
- throw new Error(`Unknown element subtype: ${(params as any).subtype}`);
213
+ throw new Error(
214
+ `Unknown element subtype: ${(params as any).subtype}`
215
+ );
208
216
  }
209
217
  }
210
218
 
211
- case "mode": {
212
- const formattedName = params.name.charAt(0).toUpperCase() + params.name.slice(1);
219
+ case 'mode': {
220
+ const formattedName =
221
+ params.name.charAt(0).toUpperCase() + params.name.slice(1);
213
222
  return `
214
223
  Make me an astrological report for a person with a preponderance of the ${formattedName} mode in their birth chart.
215
224
  ${baseFormat}
216
225
  `.trim();
217
226
  }
218
227
 
219
- case "hemisphere_east_west":
220
- case "hemisphere_north_south": {
221
- const direction = params.name.charAt(0).toUpperCase() + params.name.slice(1);
222
- const hemisphereType = params.featureType === "hemisphere_east_west" ? "East-West" : "North-South";
228
+ case 'hemisphere_east_west':
229
+ case 'hemisphere_north_south': {
230
+ const direction =
231
+ params.name.charAt(0).toUpperCase() + params.name.slice(1);
232
+ const hemisphereType =
233
+ params.featureType === 'hemisphere_east_west'
234
+ ? 'East-West'
235
+ : 'North-South';
223
236
  return `
224
237
  Make me an astrological report for a person with the ${direction}ern hemisphere emphasized in their birth chart, based on the ${hemisphereType} orientation.
225
238
  ${baseFormat}
@@ -231,9 +244,47 @@ export const astroPrompts = {
231
244
  }
232
245
  },
233
246
 
234
- makeIntroDescription: ({ entityType, name, isGeneric }: DescriptionParams): string => {
247
+ makeIntroDescription: ({
248
+ entityType,
249
+ name,
250
+ isGeneric,
251
+ }: DescriptionParams): string => {
252
+ // Format name for human-readable display (capitalize and handle special cases)
253
+ const formatName = (entityType: string, name: string): string => {
254
+ switch (entityType) {
255
+ case 'planet':
256
+ case 'key_point':
257
+ case 'karmic_point':
258
+ case 'arabic_part':
259
+ // Capitalize first letter and handle special cases (e.g., "pars_amoris" -> "Pars Amoris")
260
+ return name
261
+ .split('_')
262
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
263
+ .join(' ');
264
+ case 'house':
265
+ return `House ${name.replace('house_', '')}`; // e.g., "house_1" -> "House 1"
266
+ case 'aspect':
267
+ case 'mode':
268
+ case 'element':
269
+ case 'moon_phase':
270
+ return name
271
+ .split('_')
272
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
273
+ .join(' ');
274
+ case 'hemisphere_east_west':
275
+ case 'hemisphere_north_south':
276
+ return name
277
+ .split('_')
278
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
279
+ .join(' ');
280
+ default:
281
+ return name.charAt(0).toUpperCase() + name.slice(1);
282
+ }
283
+ };
284
+
285
+ const formattedName = formatName(entityType, name);
286
+
235
287
  const baseFormat = `
236
- Make me an introductory, explanatory description of 150 to 180 words about the astrological ${entityType}.
237
288
  The result must have an English version and a Portuguese version.
238
289
  The result format must be exactly like the following:
239
290
  -- EN
@@ -244,10 +295,29 @@ export const astroPrompts = {
244
295
 
245
296
  if (isGeneric) {
246
297
  return `
247
- ${baseFormat.replace("astrological", "astrological concept representing").replace("about the astrological", "about what the")}
298
+ Make me an introductory, explanatory description of 150 to 180 words about the astrological concept of the ${formattedName}.
299
+ ${baseFormat}
248
300
  `.trim();
249
301
  } else {
250
- return `${baseFormat} ${name ? `named ${name}.` : ""}`.trim();
302
+ switch (entityType) {
303
+ case 'planet':
304
+ case 'key_point':
305
+ case 'karmic_point':
306
+ case 'arabic_part':
307
+ return `
308
+ Make me an introductory, explanatory description of 150 to 180 words about what the astrological placement: ${formattedName}.
309
+ ${baseFormat}
310
+ `.trim();
311
+ case 'house':
312
+ return `
313
+ Make me an introductory, explanatory description of 150 to 180 words about the astrological placement: ${formattedName}.
314
+ ${baseFormat}
315
+ `.trim();
316
+ default:
317
+ throw new Error(
318
+ `Unknown entity type for specific description: ${entityType}`
319
+ );
320
+ }
251
321
  }
252
322
  },
253
323
  };