@zodic/shared 0.0.302 → 0.0.303
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.
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { and, eq, sql } from 'drizzle-orm';
|
|
2
2
|
import { inject, injectable } from 'inversify';
|
|
3
|
-
import { ChatMessages, schema } from '../..';
|
|
3
|
+
import { ChatMessages, Composition, schema } from '../..';
|
|
4
4
|
import { KVArchetype, ZodiacSignSlug } from '../../types/scopes/legacy';
|
|
5
|
-
import {
|
|
6
|
-
Composition,
|
|
7
|
-
generateArchetypePrompt,
|
|
8
|
-
} from '../../utils/archetypeNamesMessages';
|
|
5
|
+
import { generateArchetypePrompt } from '../../utils/archetypeNamesMessages';
|
|
9
6
|
import { buildCosmicMirrorArchetypeKVKey } from '../../utils/KVKeysBuilders';
|
|
10
7
|
import { AppContext } from '../base';
|
|
11
8
|
|
|
@@ -800,12 +797,12 @@ export class ArchetypeService {
|
|
|
800
797
|
async fetchMissingArchetypeCompositions(): Promise<Composition[]> {
|
|
801
798
|
const db = this.context.drizzle();
|
|
802
799
|
const incomplete = await this.findIncompleteCombinations();
|
|
803
|
-
|
|
800
|
+
|
|
804
801
|
const compositions: Composition[] = [];
|
|
805
|
-
|
|
802
|
+
|
|
806
803
|
for (const { combination } of incomplete) {
|
|
807
804
|
const [sun, ascendant, moon] = combination.split('-') as ZodiacSignSlug[];
|
|
808
|
-
|
|
805
|
+
|
|
809
806
|
const existing = await db
|
|
810
807
|
.select({
|
|
811
808
|
archetypeIndex: schema.archetypesData.archetypeIndex,
|
|
@@ -815,15 +812,16 @@ export class ArchetypeService {
|
|
|
815
812
|
.from(schema.archetypesData)
|
|
816
813
|
.where(eq(schema.archetypesData.combination, combination))
|
|
817
814
|
.execute();
|
|
818
|
-
|
|
815
|
+
|
|
819
816
|
const indexesToGenerate: number[] = [];
|
|
820
|
-
|
|
817
|
+
|
|
821
818
|
for (let i = 1; i <= 3; i++) {
|
|
822
819
|
const hasAll =
|
|
823
|
-
existing.filter((e) => e.archetypeIndex === i.toString()).length ===
|
|
820
|
+
existing.filter((e) => e.archetypeIndex === i.toString()).length ===
|
|
821
|
+
4;
|
|
824
822
|
if (!hasAll) indexesToGenerate.push(i);
|
|
825
823
|
}
|
|
826
|
-
|
|
824
|
+
|
|
827
825
|
if (indexesToGenerate.length > 0) {
|
|
828
826
|
compositions.push({
|
|
829
827
|
sun,
|
|
@@ -833,11 +831,11 @@ export class ArchetypeService {
|
|
|
833
831
|
});
|
|
834
832
|
}
|
|
835
833
|
}
|
|
836
|
-
|
|
834
|
+
|
|
837
835
|
console.log(
|
|
838
836
|
`🧩 [Fetch] Missing archetype compositions to regenerate: ${compositions.length}`
|
|
839
837
|
);
|
|
840
|
-
|
|
838
|
+
|
|
841
839
|
return compositions;
|
|
842
840
|
}
|
|
843
841
|
}
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Composition } from '../types';
|
|
1
2
|
import { ZodiacSignSlug } from '../types/scopes/legacy';
|
|
2
3
|
|
|
3
4
|
export type Planet = 'sun' | 'ascendant' | 'moon';
|
|
@@ -196,8 +197,6 @@ export const influenceMap: Record<Planet, Record<ZodiacSignSlug, Trait>> = {
|
|
|
196
197
|
},
|
|
197
198
|
};
|
|
198
199
|
|
|
199
|
-
|
|
200
|
-
|
|
201
200
|
export function generateArchetypePrompt(compositions: Composition[]): string {
|
|
202
201
|
const promptHeader = `You are a creative writer specializing in astrology, archetypes, and symbolic storytelling.
|
|
203
202
|
|