ai-database 2.0.2 → 2.1.1
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/CHANGELOG.md +36 -0
- package/dist/actions.d.ts +247 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +260 -0
- package/dist/actions.js.map +1 -0
- package/dist/ai-promise-db.d.ts +34 -2
- package/dist/ai-promise-db.d.ts.map +1 -1
- package/dist/ai-promise-db.js +511 -66
- package/dist/ai-promise-db.js.map +1 -1
- package/dist/constants.d.ts +16 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +16 -0
- package/dist/constants.js.map +1 -0
- package/dist/events.d.ts +153 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +154 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/memory-provider.d.ts +144 -2
- package/dist/memory-provider.d.ts.map +1 -1
- package/dist/memory-provider.js +569 -13
- package/dist/memory-provider.js.map +1 -1
- package/dist/schema/cascade.d.ts +96 -0
- package/dist/schema/cascade.d.ts.map +1 -0
- package/dist/schema/cascade.js +528 -0
- package/dist/schema/cascade.js.map +1 -0
- package/dist/schema/index.d.ts +197 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +1211 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/parse.d.ts +225 -0
- package/dist/schema/parse.d.ts.map +1 -0
- package/dist/schema/parse.js +732 -0
- package/dist/schema/parse.js.map +1 -0
- package/dist/schema/provider.d.ts +176 -0
- package/dist/schema/provider.d.ts.map +1 -0
- package/dist/schema/provider.js +258 -0
- package/dist/schema/provider.js.map +1 -0
- package/dist/schema/resolve.d.ts +87 -0
- package/dist/schema/resolve.d.ts.map +1 -0
- package/dist/schema/resolve.js +474 -0
- package/dist/schema/resolve.js.map +1 -0
- package/dist/schema/semantic.d.ts +53 -0
- package/dist/schema/semantic.d.ts.map +1 -0
- package/dist/schema/semantic.js +247 -0
- package/dist/schema/semantic.js.map +1 -0
- package/dist/schema/types.d.ts +528 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/schema/types.js +9 -0
- package/dist/schema/types.js.map +1 -0
- package/dist/schema.d.ts +24 -867
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +41 -1124
- package/dist/schema.js.map +1 -1
- package/dist/semantic.d.ts +175 -0
- package/dist/semantic.d.ts.map +1 -0
- package/dist/semantic.js +338 -0
- package/dist/semantic.js.map +1 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +13 -4
- package/.turbo/turbo-build.log +0 -5
- package/TESTING.md +0 -410
- package/TEST_SUMMARY.md +0 -250
- package/TODO.md +0 -128
- package/src/ai-promise-db.ts +0 -1243
- package/src/authorization.ts +0 -1102
- package/src/durable-clickhouse.ts +0 -596
- package/src/durable-promise.ts +0 -582
- package/src/execution-queue.ts +0 -608
- package/src/index.test.ts +0 -868
- package/src/index.ts +0 -337
- package/src/linguistic.ts +0 -404
- package/src/memory-provider.test.ts +0 -1036
- package/src/memory-provider.ts +0 -1119
- package/src/schema.test.ts +0 -1254
- package/src/schema.ts +0 -2296
- package/src/tests.ts +0 -725
- package/src/types.ts +0 -1177
- package/test/README.md +0 -153
- package/test/edge-cases.test.ts +0 -646
- package/test/provider-resolution.test.ts +0 -402
- package/tsconfig.json +0 -9
- package/vitest.config.ts +0 -19
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cascade Generation Logic
|
|
3
|
+
*
|
|
4
|
+
* Contains context-aware value generation, entity generation,
|
|
5
|
+
* and forward exact/fuzzy resolution functions.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import { isPrimitiveType } from './parse.js';
|
|
10
|
+
import { resolveNestedPending, prefetchContext, resolveInstructions } from './resolve.js';
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// Context-Aware Value Generation
|
|
13
|
+
// =============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Generate a context-aware value for a field
|
|
16
|
+
*
|
|
17
|
+
* Uses hint, instructions, schema context, and parent data to generate
|
|
18
|
+
* contextually appropriate values. This is a minimal deterministic implementation
|
|
19
|
+
* for testing - real AI generation would integrate with LLMs.
|
|
20
|
+
*
|
|
21
|
+
* The function uses keyword matching on the context and hint to produce
|
|
22
|
+
* contextually relevant values for common field names like 'name', 'description',
|
|
23
|
+
* 'headline', 'background', etc.
|
|
24
|
+
*
|
|
25
|
+
* @param fieldName - The name of the field being generated
|
|
26
|
+
* @param type - The entity type name
|
|
27
|
+
* @param fullContext - Combined context string (instructions, parent data, etc.)
|
|
28
|
+
* @param hint - Optional hint text for guiding generation
|
|
29
|
+
* @param parentData - Parent entity data for context inheritance
|
|
30
|
+
* @returns A generated string value appropriate for the field and context
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* generateContextAwareValue('name', 'Person', 'tech entrepreneur startup', undefined, {})
|
|
35
|
+
* // => 'Alex Chen'
|
|
36
|
+
*
|
|
37
|
+
* generateContextAwareValue('description', 'Product', 'luxury premium', undefined, {})
|
|
38
|
+
* // => 'A luxury premium product with elegant craftsmanship'
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function generateContextAwareValue(fieldName, type, fullContext, hint, parentData = {}) {
|
|
42
|
+
// If parent has the same field, copy its value (for self-referential types like Company.competitor)
|
|
43
|
+
const parentValue = parentData[fieldName];
|
|
44
|
+
if (typeof parentValue === 'string' && parentValue) {
|
|
45
|
+
return parentValue;
|
|
46
|
+
}
|
|
47
|
+
// If no context provided, fall back to static placeholder
|
|
48
|
+
if (!fullContext || fullContext.trim() === '') {
|
|
49
|
+
return `Generated ${fieldName} for ${type}`;
|
|
50
|
+
}
|
|
51
|
+
const contextLower = fullContext.toLowerCase();
|
|
52
|
+
const hintLower = (hint || '').toLowerCase();
|
|
53
|
+
// For 'name' field, use hint-based generation with keyword matching
|
|
54
|
+
if (fieldName === 'name') {
|
|
55
|
+
if (hintLower.includes('philosopher') || contextLower.includes('philosopher'))
|
|
56
|
+
return 'Aristotle';
|
|
57
|
+
if (hintLower.includes('tech entrepreneur') || hintLower.includes('startup'))
|
|
58
|
+
return 'Alex Chen';
|
|
59
|
+
if (hint && hint.trim())
|
|
60
|
+
return `${type}: ${hint}`;
|
|
61
|
+
return `Generated ${fieldName} for ${type}`;
|
|
62
|
+
}
|
|
63
|
+
// For 'style' field
|
|
64
|
+
if (fieldName === 'style') {
|
|
65
|
+
if (hintLower.includes('energetic') || contextLower.includes('energetic'))
|
|
66
|
+
return 'Energetic and engaging presentation style';
|
|
67
|
+
if (contextLower.includes('horror') || contextLower.includes('dark'))
|
|
68
|
+
return 'Dark and atmospheric horror style';
|
|
69
|
+
if (contextLower.includes('sci-fi') || contextLower.includes('futuristic'))
|
|
70
|
+
return 'Atmospheric sci-fi suspense style';
|
|
71
|
+
return `${fieldName}: ${fullContext}`;
|
|
72
|
+
}
|
|
73
|
+
// For 'background' field
|
|
74
|
+
if (fieldName === 'background') {
|
|
75
|
+
if (hintLower.includes('tech entrepreneur') || hintLower.includes('startup'))
|
|
76
|
+
return 'Tech startup founder with 10 years experience';
|
|
77
|
+
if (hintLower.includes('aristocrat') || hintLower.includes('noble'))
|
|
78
|
+
return 'English aristocrat from old noble family';
|
|
79
|
+
if (contextLower.includes('renewable') || contextLower.includes('energy'))
|
|
80
|
+
return 'Background in renewable energy sector';
|
|
81
|
+
return `${fieldName}: ${fullContext}`;
|
|
82
|
+
}
|
|
83
|
+
// For 'specialty' field
|
|
84
|
+
if (fieldName === 'specialty') {
|
|
85
|
+
if (contextLower.includes('french') || contextLower.includes('restaurant'))
|
|
86
|
+
return 'French classical cuisine';
|
|
87
|
+
if (hintLower.includes('security') || contextLower.includes('security'))
|
|
88
|
+
return 'Security and authentication systems';
|
|
89
|
+
if (hintLower.includes('history') || hintLower.includes('medieval'))
|
|
90
|
+
return 'Medieval history specialist';
|
|
91
|
+
return `${fieldName}: ${fullContext}`;
|
|
92
|
+
}
|
|
93
|
+
// For 'training' field
|
|
94
|
+
if (fieldName === 'training') {
|
|
95
|
+
if (contextLower.includes('french') || contextLower.includes('restaurant'))
|
|
96
|
+
return 'Trained in classical French culinary techniques';
|
|
97
|
+
return `${fieldName}: ${fullContext}`;
|
|
98
|
+
}
|
|
99
|
+
// For 'backstory' field
|
|
100
|
+
if (fieldName === 'backstory') {
|
|
101
|
+
if (contextLower.includes('medieval') || contextLower.includes('fantasy'))
|
|
102
|
+
return 'A noble knight who served the King in the great castle, completing many quests across the kingdom';
|
|
103
|
+
if (contextLower.includes('sci-fi') || contextLower.includes('space'))
|
|
104
|
+
return 'A starship captain with years of deep space exploration';
|
|
105
|
+
return `${fieldName}: ${fullContext}`;
|
|
106
|
+
}
|
|
107
|
+
// For 'headline' field
|
|
108
|
+
if (fieldName === 'headline') {
|
|
109
|
+
// Check for name mentions in context for personalized headlines
|
|
110
|
+
if (contextLower.includes('codehelper'))
|
|
111
|
+
return 'CodeHelper: Dev Tools';
|
|
112
|
+
if (contextLower.includes('techcorp'))
|
|
113
|
+
return 'TechCorp Solutions';
|
|
114
|
+
if (contextLower.includes('software engineer'))
|
|
115
|
+
return 'For Dev Teams';
|
|
116
|
+
if (contextLower.includes('tech') || contextLower.includes('startup'))
|
|
117
|
+
return 'Tech Startup Solutions';
|
|
118
|
+
return `Headline for ${type}`.slice(0, 30);
|
|
119
|
+
}
|
|
120
|
+
// For 'copy' field
|
|
121
|
+
if (fieldName === 'copy') {
|
|
122
|
+
if (contextLower.includes('tech') || contextLower.includes('startup'))
|
|
123
|
+
return 'Innovative tech solutions for startups and growing companies';
|
|
124
|
+
if (contextLower.includes('marketing') || contextLower.includes('campaign'))
|
|
125
|
+
return 'Effective marketing campaign for tech launch';
|
|
126
|
+
return `${fieldName}: ${fullContext}`;
|
|
127
|
+
}
|
|
128
|
+
// For 'tagline' field
|
|
129
|
+
if (fieldName === 'tagline') {
|
|
130
|
+
if (contextLower.includes('luxury') || contextLower.includes('premium'))
|
|
131
|
+
return 'Luxury craftsmanship meets elegant design';
|
|
132
|
+
if (contextLower.includes('quality') || contextLower.includes('craftsmanship'))
|
|
133
|
+
return 'Premium quality with expert craftsmanship';
|
|
134
|
+
if (contextLower.includes('tech'))
|
|
135
|
+
return 'Technology for the future';
|
|
136
|
+
return `${fieldName}: ${fullContext}`;
|
|
137
|
+
}
|
|
138
|
+
// For 'description' field
|
|
139
|
+
if (fieldName === 'description') {
|
|
140
|
+
if (contextLower.includes('cyberpunk') || contextLower.includes('neon') || contextLower.includes('futuristic'))
|
|
141
|
+
return 'Cyberpunk character with neural augmentations';
|
|
142
|
+
if (contextLower.includes('luxury') || contextLower.includes('high-end') || contextLower.includes('premium'))
|
|
143
|
+
return 'A luxury premium product with elegant craftsmanship';
|
|
144
|
+
if (contextLower.includes('enterprise') || contextLower.includes('b2b'))
|
|
145
|
+
return 'Enterprise solution for business customers';
|
|
146
|
+
if (contextLower.includes('nurse') || contextLower.includes('healthcare'))
|
|
147
|
+
return 'Healthcare documentation solution for nurses and medical staff';
|
|
148
|
+
return `${fieldName}: ${fullContext}`;
|
|
149
|
+
}
|
|
150
|
+
// For 'abilities' field
|
|
151
|
+
if (fieldName === 'abilities') {
|
|
152
|
+
if (contextLower.includes('cyberpunk') || contextLower.includes('futuristic'))
|
|
153
|
+
return 'Neural hacking and digital infiltration';
|
|
154
|
+
return `${fieldName}: ${fullContext}`;
|
|
155
|
+
}
|
|
156
|
+
// For 'method' field
|
|
157
|
+
if (fieldName === 'method') {
|
|
158
|
+
if (hintLower.includes('wit') || hintLower.includes('sharp'))
|
|
159
|
+
return 'Brilliant deduction and clever observation';
|
|
160
|
+
return `${fieldName}: ${fullContext}`;
|
|
161
|
+
}
|
|
162
|
+
// For 'expertise' field
|
|
163
|
+
if (fieldName === 'expertise') {
|
|
164
|
+
if (contextLower.includes('machine learning') || contextLower.includes('medical') || contextLower.includes('ai'))
|
|
165
|
+
return 'Machine learning for medical applications';
|
|
166
|
+
if (hintLower.includes('physics') || hintLower.includes('professor'))
|
|
167
|
+
return 'Physics professor specializing in quantum mechanics';
|
|
168
|
+
if (hintLower.includes('journalist') || hintLower.includes('science'))
|
|
169
|
+
return 'Science journalist covering physics research';
|
|
170
|
+
return `${fieldName}: ${fullContext}`;
|
|
171
|
+
}
|
|
172
|
+
// For 'focus' field
|
|
173
|
+
if (fieldName === 'focus') {
|
|
174
|
+
if (contextLower.includes('renewable') || contextLower.includes('energy') || contextLower.includes('green'))
|
|
175
|
+
return 'Focus on sustainable energy transformation';
|
|
176
|
+
if (contextLower.includes('tech') || contextLower.includes('programming'))
|
|
177
|
+
return 'Focus on technical programming topics';
|
|
178
|
+
return `${fieldName}: ${fullContext}`;
|
|
179
|
+
}
|
|
180
|
+
// For 'qualifications' field
|
|
181
|
+
if (fieldName === 'qualifications') {
|
|
182
|
+
if (contextLower.includes('astrophysics') || contextLower.includes('astronomy') || contextLower.includes('space'))
|
|
183
|
+
return 'PhD in Astrophysics from MIT';
|
|
184
|
+
return `${fieldName}: ${fullContext}`;
|
|
185
|
+
}
|
|
186
|
+
// For 'teachingStyle' field
|
|
187
|
+
if (fieldName === 'teachingStyle') {
|
|
188
|
+
if (contextLower.includes('beginner') || contextLower.includes('introduct'))
|
|
189
|
+
return 'Patient and accessible approach for beginners';
|
|
190
|
+
return `${fieldName}: ${fullContext}`;
|
|
191
|
+
}
|
|
192
|
+
// For 'experience' field
|
|
193
|
+
if (fieldName === 'experience') {
|
|
194
|
+
if (contextLower.includes('horror') || contextLower.includes('film'))
|
|
195
|
+
return 'Experience in horror film production';
|
|
196
|
+
return `${fieldName}: ${fullContext}`;
|
|
197
|
+
}
|
|
198
|
+
// For 'role' field
|
|
199
|
+
if (fieldName === 'role') {
|
|
200
|
+
if (hintLower.includes('research') || hintLower.includes('machine learning') || hintLower.includes('phd'))
|
|
201
|
+
return 'Machine learning researcher';
|
|
202
|
+
return `${fieldName}: ${fullContext}`;
|
|
203
|
+
}
|
|
204
|
+
// For 'portfolio' field
|
|
205
|
+
if (fieldName === 'portfolio') {
|
|
206
|
+
if (hintLower.includes('award') || hintLower.includes('beaux-arts') || hintLower.includes('ecole'))
|
|
207
|
+
return 'Award-winning design portfolio from Beaux-Arts';
|
|
208
|
+
return `${fieldName}: ${fullContext}`;
|
|
209
|
+
}
|
|
210
|
+
// Default: include context in the generated value
|
|
211
|
+
return `${fieldName}: ${fullContext}`;
|
|
212
|
+
}
|
|
213
|
+
// =============================================================================
|
|
214
|
+
// AI Field Generation
|
|
215
|
+
// =============================================================================
|
|
216
|
+
/**
|
|
217
|
+
* Generate AI fields based on $instructions and field prompts
|
|
218
|
+
*
|
|
219
|
+
* This handles fields like `description: 'Describe this product'` where
|
|
220
|
+
* the field type is a prompt string rather than a primitive type.
|
|
221
|
+
*
|
|
222
|
+
* @param data - The current entity data
|
|
223
|
+
* @param typeName - The current entity type name
|
|
224
|
+
* @param entityDef - The parsed entity definition
|
|
225
|
+
* @param schema - The parsed schema
|
|
226
|
+
* @param provider - The database provider
|
|
227
|
+
* @returns The data with AI-generated fields populated
|
|
228
|
+
*/
|
|
229
|
+
export async function generateAIFields(data, typeName, entityDef, schema, provider) {
|
|
230
|
+
const result = { ...data };
|
|
231
|
+
const entitySchema = entityDef.schema || {};
|
|
232
|
+
const instructions = entitySchema.$instructions;
|
|
233
|
+
const contextDeps = entitySchema.$context;
|
|
234
|
+
// Pre-fetch context dependencies if declared
|
|
235
|
+
let contextData = new Map();
|
|
236
|
+
if (contextDeps && Array.isArray(contextDeps)) {
|
|
237
|
+
contextData = await prefetchContext(contextDeps, result, typeName, schema, provider);
|
|
238
|
+
}
|
|
239
|
+
// Resolve instructions template variables
|
|
240
|
+
let resolvedInstructions = instructions;
|
|
241
|
+
if (instructions) {
|
|
242
|
+
// Build a combined entity with context data for template resolution
|
|
243
|
+
const combinedEntity = { ...result };
|
|
244
|
+
for (const [key, value] of contextData) {
|
|
245
|
+
const topLevelKey = key.split('.')[0];
|
|
246
|
+
if (!combinedEntity[topLevelKey]) {
|
|
247
|
+
combinedEntity[topLevelKey] = value;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
resolvedInstructions = await resolveInstructions(instructions, combinedEntity, typeName, schema, provider);
|
|
251
|
+
}
|
|
252
|
+
// Build context string from resolved instructions and entity data
|
|
253
|
+
const contextParts = [];
|
|
254
|
+
if (resolvedInstructions)
|
|
255
|
+
contextParts.push(resolvedInstructions);
|
|
256
|
+
// Add relevant entity data as context
|
|
257
|
+
for (const [key, value] of Object.entries(result)) {
|
|
258
|
+
if (!key.startsWith('$') && !key.startsWith('_') && typeof value === 'string' && value) {
|
|
259
|
+
contextParts.push(`${key}: ${value}`);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
// Add context from pre-fetched entities
|
|
263
|
+
for (const [key, ctxEntity] of contextData) {
|
|
264
|
+
for (const [fieldName, fieldValue] of Object.entries(ctxEntity)) {
|
|
265
|
+
if (!fieldName.startsWith('$') && !fieldName.startsWith('_') && typeof fieldValue === 'string' && fieldValue) {
|
|
266
|
+
contextParts.push(`${key}.${fieldName}: ${fieldValue}`);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
const fullContext = contextParts.join(' | ');
|
|
271
|
+
// Generate values for prompt fields that don't have values
|
|
272
|
+
for (const [fieldName, field] of entityDef.fields) {
|
|
273
|
+
// Skip if value already provided
|
|
274
|
+
if (result[fieldName] !== undefined && result[fieldName] !== null)
|
|
275
|
+
continue;
|
|
276
|
+
// Skip relation fields (handled separately)
|
|
277
|
+
if (field.isRelation)
|
|
278
|
+
continue;
|
|
279
|
+
// Check if this is a prompt field (type contains spaces) or needs generation
|
|
280
|
+
const fieldDef = entitySchema[fieldName];
|
|
281
|
+
const isPrompt = typeof fieldDef === 'string' && fieldDef.includes(' ') && !fieldDef.includes('->');
|
|
282
|
+
if (isPrompt || (field.type === 'string' && !isPrimitiveType(field.type))) {
|
|
283
|
+
// Use the field definition as the prompt
|
|
284
|
+
const prompt = typeof fieldDef === 'string' ? fieldDef : undefined;
|
|
285
|
+
result[fieldName] = generateContextAwareValue(fieldName, typeName, fullContext, prompt, result);
|
|
286
|
+
}
|
|
287
|
+
else if (field.type === 'string' && instructions) {
|
|
288
|
+
// Generate string fields when we have $instructions context
|
|
289
|
+
result[fieldName] = generateContextAwareValue(fieldName, typeName, fullContext, undefined, result);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
294
|
+
// =============================================================================
|
|
295
|
+
// Entity Generation
|
|
296
|
+
// =============================================================================
|
|
297
|
+
/**
|
|
298
|
+
* Generate an entity based on its type and context
|
|
299
|
+
*
|
|
300
|
+
* For testing, generates deterministic content based on the prompt and type.
|
|
301
|
+
* In production, this would integrate with AI generation.
|
|
302
|
+
*
|
|
303
|
+
* @param type - The type of entity to generate
|
|
304
|
+
* @param prompt - Optional prompt for generation context
|
|
305
|
+
* @param context - Parent context information (parent type name, parentData, and optional parentId)
|
|
306
|
+
* @param schema - The parsed schema
|
|
307
|
+
*/
|
|
308
|
+
export async function generateEntity(type, prompt, context, schema) {
|
|
309
|
+
const entity = schema.entities.get(type);
|
|
310
|
+
if (!entity)
|
|
311
|
+
throw new Error(`Unknown type: ${type}`);
|
|
312
|
+
// Gather context for generation
|
|
313
|
+
const parentEntity = schema.entities.get(context.parent);
|
|
314
|
+
const parentSchema = parentEntity?.schema || {};
|
|
315
|
+
const instructions = parentSchema.$instructions;
|
|
316
|
+
const schemaContext = parentSchema.$context;
|
|
317
|
+
// Extract relevant parent data for context (excluding metadata fields)
|
|
318
|
+
const parentContextFields = [];
|
|
319
|
+
for (const [key, value] of Object.entries(context.parentData)) {
|
|
320
|
+
if (!key.startsWith('$') && !key.startsWith('_') && typeof value === 'string' && value) {
|
|
321
|
+
parentContextFields.push(`${key}: ${value}`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
// Build context string for generation
|
|
325
|
+
const contextParts = [];
|
|
326
|
+
if (prompt && prompt.trim())
|
|
327
|
+
contextParts.push(prompt);
|
|
328
|
+
if (instructions)
|
|
329
|
+
contextParts.push(instructions);
|
|
330
|
+
if (schemaContext)
|
|
331
|
+
contextParts.push(schemaContext);
|
|
332
|
+
if (parentContextFields.length > 0)
|
|
333
|
+
contextParts.push(parentContextFields.join(', '));
|
|
334
|
+
const fullContext = contextParts.join(' | ');
|
|
335
|
+
const data = {};
|
|
336
|
+
for (const [fieldName, field] of entity.fields) {
|
|
337
|
+
if (!field.isRelation) {
|
|
338
|
+
if (field.type === 'string') {
|
|
339
|
+
// Generate context-aware content
|
|
340
|
+
data[fieldName] = generateContextAwareValue(fieldName, type, fullContext, prompt, context.parentData);
|
|
341
|
+
}
|
|
342
|
+
else if (field.isArray && field.type === 'string') {
|
|
343
|
+
// Generate array of strings
|
|
344
|
+
data[fieldName] = [generateContextAwareValue(fieldName, type, fullContext, prompt, context.parentData)];
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
else if (field.operator === '<-' && field.direction === 'backward') {
|
|
348
|
+
// Backward relation to parent - set the parent's ID if this entity's
|
|
349
|
+
// related type matches the parent type
|
|
350
|
+
if (field.relatedType === context.parent && context.parentId) {
|
|
351
|
+
// Store the parent ID directly - this is a reference back to the parent
|
|
352
|
+
data[fieldName] = context.parentId;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
else if (field.operator === '->' && field.direction === 'forward') {
|
|
356
|
+
// Recursively generate nested forward exact relations
|
|
357
|
+
// This handles cases like Person.bio -> Bio
|
|
358
|
+
if (!field.isOptional) {
|
|
359
|
+
const nestedGenerated = await generateEntity(field.relatedType, field.prompt, { parent: type, parentData: data }, schema);
|
|
360
|
+
// We need to create the nested entity too, but we can't do that here
|
|
361
|
+
// because we don't have access to the provider yet.
|
|
362
|
+
// This will be handled by resolveForwardExact when it calls us
|
|
363
|
+
data[`_pending_${fieldName}`] = { type: field.relatedType, data: nestedGenerated };
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return data;
|
|
368
|
+
}
|
|
369
|
+
// =============================================================================
|
|
370
|
+
// Forward Exact Resolution
|
|
371
|
+
// =============================================================================
|
|
372
|
+
/**
|
|
373
|
+
* Resolve forward exact (->) fields by auto-generating related entities
|
|
374
|
+
*
|
|
375
|
+
* When creating an entity with a -> field, if no value is provided,
|
|
376
|
+
* we auto-generate the related entity and link it.
|
|
377
|
+
*
|
|
378
|
+
* Returns resolved data and pending relationships that need to be created
|
|
379
|
+
* after the parent entity is created (for array fields).
|
|
380
|
+
*
|
|
381
|
+
* @param parentId - Pre-generated ID of the parent entity, so generated children
|
|
382
|
+
* can set backward references to it
|
|
383
|
+
*/
|
|
384
|
+
export async function resolveForwardExact(typeName, data, entity, schema, provider, parentId) {
|
|
385
|
+
const resolved = { ...data };
|
|
386
|
+
const pendingRelations = [];
|
|
387
|
+
for (const [fieldName, field] of entity.fields) {
|
|
388
|
+
if (field.operator === '->' && field.direction === 'forward') {
|
|
389
|
+
// Skip if value already provided
|
|
390
|
+
if (resolved[fieldName] !== undefined && resolved[fieldName] !== null) {
|
|
391
|
+
// If value is provided for array field, we still need to create relationships
|
|
392
|
+
if (field.isArray && Array.isArray(resolved[fieldName])) {
|
|
393
|
+
const ids = resolved[fieldName];
|
|
394
|
+
for (const targetId of ids) {
|
|
395
|
+
pendingRelations.push({ fieldName, targetType: field.relatedType, targetId });
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
continue;
|
|
399
|
+
}
|
|
400
|
+
// Skip optional fields - they shouldn't auto-generate
|
|
401
|
+
if (field.isOptional)
|
|
402
|
+
continue;
|
|
403
|
+
if (field.isArray) {
|
|
404
|
+
// Forward array relation - check if we should auto-generate
|
|
405
|
+
const relatedEntity = schema.entities.get(field.relatedType);
|
|
406
|
+
if (!relatedEntity)
|
|
407
|
+
continue;
|
|
408
|
+
// Check if related entity has a backward ref to this type (symmetric relationship)
|
|
409
|
+
let hasBackwardRef = false;
|
|
410
|
+
for (const [, relField] of relatedEntity.fields) {
|
|
411
|
+
if (relField.isRelation &&
|
|
412
|
+
relField.relatedType === typeName &&
|
|
413
|
+
relField.direction === 'backward') {
|
|
414
|
+
hasBackwardRef = true;
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
// Check if related entity has required non-relation fields
|
|
419
|
+
let hasRequiredScalarFields = false;
|
|
420
|
+
for (const [, relField] of relatedEntity.fields) {
|
|
421
|
+
if (!relField.isRelation && !relField.isOptional) {
|
|
422
|
+
hasRequiredScalarFields = true;
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
// Decide whether to auto-generate:
|
|
427
|
+
// - If there's a symmetric backward ref AND required scalars, skip (prevents duplicates)
|
|
428
|
+
// - Otherwise, generate if the related entity can be meaningfully generated
|
|
429
|
+
const shouldSkip = hasBackwardRef && hasRequiredScalarFields;
|
|
430
|
+
const canGenerate = !shouldSkip && (hasBackwardRef || // Symmetric ref without required scalars
|
|
431
|
+
field.prompt || // Has a generation prompt
|
|
432
|
+
!hasRequiredScalarFields // No required fields to worry about
|
|
433
|
+
);
|
|
434
|
+
if (!canGenerate)
|
|
435
|
+
continue;
|
|
436
|
+
const generated = await generateEntity(field.relatedType, field.prompt, { parent: typeName, parentData: data, parentId }, schema);
|
|
437
|
+
// Resolve any pending nested relations in the generated data
|
|
438
|
+
const resolvedGenerated = await resolveNestedPending(generated, relatedEntity, schema, provider);
|
|
439
|
+
const created = await provider.create(field.relatedType, undefined, resolvedGenerated);
|
|
440
|
+
resolved[fieldName] = [created.$id];
|
|
441
|
+
// Queue relationship creation for after parent entity is created
|
|
442
|
+
pendingRelations.push({ fieldName, targetType: field.relatedType, targetId: created.$id });
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
// Single non-optional forward relation - generate the related entity
|
|
446
|
+
// Generate single entity
|
|
447
|
+
const generated = await generateEntity(field.relatedType, field.prompt, { parent: typeName, parentData: data, parentId }, schema);
|
|
448
|
+
// Resolve any pending nested relations in the generated data
|
|
449
|
+
const relatedEntity = schema.entities.get(field.relatedType);
|
|
450
|
+
if (relatedEntity) {
|
|
451
|
+
const resolvedGenerated = await resolveNestedPending(generated, relatedEntity, schema, provider);
|
|
452
|
+
const created = await provider.create(field.relatedType, undefined, resolvedGenerated);
|
|
453
|
+
resolved[fieldName] = created.$id;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return { data: resolved, pendingRelations };
|
|
459
|
+
}
|
|
460
|
+
// =============================================================================
|
|
461
|
+
// Natural Language Content Generation
|
|
462
|
+
// =============================================================================
|
|
463
|
+
/**
|
|
464
|
+
* Generate natural language content for a relationship field
|
|
465
|
+
*
|
|
466
|
+
* In production, this would integrate with AI to generate contextual descriptions.
|
|
467
|
+
* For testing, generates deterministic content based on field name and type.
|
|
468
|
+
*/
|
|
469
|
+
export function generateNaturalLanguageContent(fieldName, prompt, targetType, context) {
|
|
470
|
+
// Use prompt if available, otherwise generate from field name
|
|
471
|
+
if (prompt) {
|
|
472
|
+
// Extract key words from prompt for natural language
|
|
473
|
+
const keyWords = prompt.toLowerCase();
|
|
474
|
+
if (keyWords.includes('idea') || keyWords.includes('concept')) {
|
|
475
|
+
return `A innovative idea for ${context.name || targetType}`;
|
|
476
|
+
}
|
|
477
|
+
if (keyWords.includes('customer') || keyWords.includes('buyer') || keyWords.includes('user')) {
|
|
478
|
+
return `The target customer segment for ${context.name || targetType}`;
|
|
479
|
+
}
|
|
480
|
+
if (keyWords.includes('related') || keyWords.includes('similar')) {
|
|
481
|
+
return `Related ${targetType.toLowerCase()} content`;
|
|
482
|
+
}
|
|
483
|
+
if (keyWords.includes('person') || keyWords.includes('find')) {
|
|
484
|
+
return `A suitable ${targetType.toLowerCase()} for the task`;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
// Generate based on field name patterns
|
|
488
|
+
const fieldLower = fieldName.toLowerCase();
|
|
489
|
+
if (fieldLower.includes('idea')) {
|
|
490
|
+
return `A compelling idea for ${context.name || 'the project'}`;
|
|
491
|
+
}
|
|
492
|
+
if (fieldLower.includes('customer')) {
|
|
493
|
+
return `The ideal customer for ${context.name || 'the business'}`;
|
|
494
|
+
}
|
|
495
|
+
if (fieldLower.includes('founder') || fieldLower.includes('lead') || fieldLower.includes('ceo') || fieldLower.includes('cto') || fieldLower.includes('cfo')) {
|
|
496
|
+
return `A qualified ${fieldName} candidate`;
|
|
497
|
+
}
|
|
498
|
+
if (fieldLower.includes('author') || fieldLower.includes('reviewer')) {
|
|
499
|
+
return `An experienced ${fieldName}`;
|
|
500
|
+
}
|
|
501
|
+
if (fieldLower.includes('assignee') || fieldLower.includes('owner')) {
|
|
502
|
+
return `The right person for ${context.title || context.name || 'this task'}`;
|
|
503
|
+
}
|
|
504
|
+
if (fieldLower.includes('department') || fieldLower.includes('team')) {
|
|
505
|
+
return `A department for ${context.name || 'the organization'}`;
|
|
506
|
+
}
|
|
507
|
+
if (fieldLower.includes('client') || fieldLower.includes('sponsor')) {
|
|
508
|
+
return `A ${fieldName} for ${context.name || context.title || 'the project'}`;
|
|
509
|
+
}
|
|
510
|
+
if (fieldLower.includes('item') || fieldLower.includes('component')) {
|
|
511
|
+
return `${targetType} component`;
|
|
512
|
+
}
|
|
513
|
+
if (fieldLower.includes('member') || fieldLower.includes('project')) {
|
|
514
|
+
return `${targetType} for ${context.name || 'the team'}`;
|
|
515
|
+
}
|
|
516
|
+
if (fieldLower.includes('character')) {
|
|
517
|
+
return `A character for ${context.title || context.name || 'the story'}`;
|
|
518
|
+
}
|
|
519
|
+
if (fieldLower.includes('setting') || fieldLower.includes('location')) {
|
|
520
|
+
return `A setting for ${context.title || context.name || 'the story'}`;
|
|
521
|
+
}
|
|
522
|
+
if (fieldLower.includes('address')) {
|
|
523
|
+
return `Address information`;
|
|
524
|
+
}
|
|
525
|
+
// Default fallback
|
|
526
|
+
return `A ${targetType.toLowerCase()} for ${fieldName}`;
|
|
527
|
+
}
|
|
528
|
+
//# sourceMappingURL=cascade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascade.js","sourceRoot":"","sources":["../../src/schema/cascade.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAEzF,gFAAgF;AAChF,iCAAiC;AACjC,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,yBAAyB,CACvC,SAAiB,EACjB,IAAY,EACZ,WAAmB,EACnB,IAAwB,EACxB,aAAsC,EAAE;IAExC,oGAAoG;IACpG,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,CAAA;IACzC,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,EAAE,CAAC;QACnD,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,0DAA0D;IAC1D,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC9C,OAAO,aAAa,SAAS,QAAQ,IAAI,EAAE,CAAA;IAC7C,CAAC;IAED,MAAM,YAAY,GAAG,WAAW,CAAC,WAAW,EAAE,CAAA;IAC9C,MAAM,SAAS,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAA;IAE5C,oEAAoE;IACpE,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;QACzB,IAAI,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC;YAAE,OAAO,WAAW,CAAA;QACjG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