@zodic/shared 0.0.302 → 0.0.304
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
|
|
|
@@ -796,16 +793,18 @@ export class ArchetypeService {
|
|
|
796
793
|
`🎉 [Batch] Completed regenerating ${compositions.length} combinations`
|
|
797
794
|
);
|
|
798
795
|
}
|
|
799
|
-
|
|
796
|
+
|
|
800
797
|
async fetchMissingArchetypeCompositions(): Promise<Composition[]> {
|
|
801
798
|
const db = this.context.drizzle();
|
|
802
799
|
const incomplete = await this.findIncompleteCombinations();
|
|
803
|
-
|
|
800
|
+
console.log(`🔎 [Fetch] Retrieved ${incomplete.length} incomplete combinations`);
|
|
801
|
+
|
|
804
802
|
const compositions: Composition[] = [];
|
|
805
|
-
|
|
803
|
+
|
|
806
804
|
for (const { combination } of incomplete) {
|
|
805
|
+
console.log(`🔍 [Fetch] Processing combination: ${combination}`);
|
|
807
806
|
const [sun, ascendant, moon] = combination.split('-') as ZodiacSignSlug[];
|
|
808
|
-
|
|
807
|
+
|
|
809
808
|
const existing = await db
|
|
810
809
|
.select({
|
|
811
810
|
archetypeIndex: schema.archetypesData.archetypeIndex,
|
|
@@ -815,15 +814,16 @@ export class ArchetypeService {
|
|
|
815
814
|
.from(schema.archetypesData)
|
|
816
815
|
.where(eq(schema.archetypesData.combination, combination))
|
|
817
816
|
.execute();
|
|
818
|
-
|
|
817
|
+
|
|
819
818
|
const indexesToGenerate: number[] = [];
|
|
820
|
-
|
|
819
|
+
|
|
821
820
|
for (let i = 1; i <= 3; i++) {
|
|
822
821
|
const hasAll =
|
|
823
|
-
existing.filter((e) => e.archetypeIndex === i.toString()).length ===
|
|
822
|
+
existing.filter((e) => e.archetypeIndex === i.toString()).length ===
|
|
823
|
+
4;
|
|
824
824
|
if (!hasAll) indexesToGenerate.push(i);
|
|
825
825
|
}
|
|
826
|
-
|
|
826
|
+
|
|
827
827
|
if (indexesToGenerate.length > 0) {
|
|
828
828
|
compositions.push({
|
|
829
829
|
sun,
|
|
@@ -831,12 +831,12 @@ export class ArchetypeService {
|
|
|
831
831
|
moon,
|
|
832
832
|
indexesToGenerate,
|
|
833
833
|
});
|
|
834
|
+
console.log(`✅ [Fetch] Will regenerate indexes [${indexesToGenerate.join(', ')}] for ${combination}`);
|
|
834
835
|
}
|
|
835
836
|
}
|
|
836
|
-
|
|
837
|
-
console.log(
|
|
838
|
-
|
|
839
|
-
);
|
|
837
|
+
|
|
838
|
+
console.log(`📦 [Fetch] Total compositions to regenerate: ${compositions.length}`);
|
|
839
|
+
|
|
840
840
|
|
|
841
841
|
return compositions;
|
|
842
842
|
}
|
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
|
|