@zodic/shared 0.0.248 → 0.0.249
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 +1 -1
- package/utils/buildMessages.ts +84 -0
package/package.json
CHANGED
package/utils/buildMessages.ts
CHANGED
|
@@ -327,7 +327,91 @@ export const buildLLMMessages = (env: BackendBindings) => ({
|
|
|
327
327
|
});
|
|
328
328
|
break;
|
|
329
329
|
|
|
330
|
+
case 'feature':
|
|
331
|
+
if (params.featureType === 'element') {
|
|
332
|
+
if (!('subtype' in params))
|
|
333
|
+
throw new Error('Missing subtype for element feature report');
|
|
334
|
+
switch (params.subtype) {
|
|
335
|
+
case 'balanced':
|
|
336
|
+
prompt = astroPrompts.feature({
|
|
337
|
+
featureType: 'element',
|
|
338
|
+
subtype: 'balanced',
|
|
339
|
+
});
|
|
340
|
+
break;
|
|
341
|
+
case 'pure':
|
|
342
|
+
if (!('dominantElement' in params))
|
|
343
|
+
throw new Error(
|
|
344
|
+
'Missing dominantElement for pure element report'
|
|
345
|
+
);
|
|
346
|
+
prompt = astroPrompts.feature({
|
|
347
|
+
featureType: 'element',
|
|
348
|
+
subtype: 'pure',
|
|
349
|
+
dominantElement: params.dominantElement,
|
|
350
|
+
});
|
|
351
|
+
break;
|
|
352
|
+
case 'preponderant_lacking':
|
|
353
|
+
if (
|
|
354
|
+
!('dominantElement' in params) ||
|
|
355
|
+
!('lackingElement' in params)
|
|
356
|
+
)
|
|
357
|
+
throw new Error(
|
|
358
|
+
'Missing dominantElement or lackingElement for preponderant_lacking element report'
|
|
359
|
+
);
|
|
360
|
+
prompt = astroPrompts.feature({
|
|
361
|
+
featureType: 'element',
|
|
362
|
+
subtype: 'preponderant_lacking',
|
|
363
|
+
dominantElement: params.dominantElement,
|
|
364
|
+
lackingElement: params.lackingElement,
|
|
365
|
+
});
|
|
366
|
+
break;
|
|
367
|
+
default:
|
|
368
|
+
throw new Error(
|
|
369
|
+
`Unknown element subtype: ${(params as any).subtype}`
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
} else {
|
|
373
|
+
if (!('name' in params))
|
|
374
|
+
throw new Error('Missing name for non-element feature report');
|
|
375
|
+
// Narrow featureType to ensure it matches FeatureParams
|
|
376
|
+
switch (params.featureType) {
|
|
377
|
+
case 'moon_phase':
|
|
378
|
+
case 'mode':
|
|
379
|
+
prompt = astroPrompts.feature({
|
|
380
|
+
featureType: params.featureType,
|
|
381
|
+
name: params.name,
|
|
382
|
+
});
|
|
383
|
+
break;
|
|
384
|
+
case 'hemisphere_east_west':
|
|
385
|
+
case 'hemisphere_north_south':
|
|
386
|
+
if (
|
|
387
|
+
!(
|
|
388
|
+
['east', 'west'].includes(params.name) ||
|
|
389
|
+
['north', 'south'].includes(params.name)
|
|
390
|
+
)
|
|
391
|
+
) {
|
|
392
|
+
throw new Error(
|
|
393
|
+
`Invalid name "${params.name}" for ${params.featureType}`
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
prompt = astroPrompts.feature({
|
|
397
|
+
featureType: params.featureType,
|
|
398
|
+
name: params.name as 'east' | 'west' | 'north' | 'south',
|
|
399
|
+
});
|
|
400
|
+
break;
|
|
401
|
+
default:
|
|
402
|
+
throw new Error(
|
|
403
|
+
`Unknown feature type: ${(params as any).featureType}`
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
break;
|
|
408
|
+
|
|
330
409
|
default:
|
|
410
|
+
console.error(
|
|
411
|
+
`❌ Unknown report type: ${
|
|
412
|
+
(params as any).reportType
|
|
413
|
+
}. Params: ${JSON.stringify(params)}`
|
|
414
|
+
);
|
|
331
415
|
throw new Error(`Unknown report type: ${(params as any).reportType}`);
|
|
332
416
|
}
|
|
333
417
|
|