@cravery/core 0.0.22 → 0.0.23
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/dist/types/ai/recipe.d.ts.map +1 -1
- package/dist/types/ai/recipe.js +17 -10
- package/dist/types/ai/recipe.js.map +1 -1
- package/dist/types/recipe/equipment.d.ts.map +1 -1
- package/dist/types/recipe/equipment.js +4 -5
- package/dist/types/recipe/equipment.js.map +1 -1
- package/dist/types/recipe/ingredient.d.ts.map +1 -1
- package/dist/types/recipe/ingredient.js +13 -14
- package/dist/types/recipe/ingredient.js.map +1 -1
- package/dist/types/recipe/instruction.js +4 -4
- package/dist/types/recipe/instruction.js.map +1 -1
- package/dist/types/recipe/nutrition.js +9 -9
- package/dist/types/recipe/nutrition.js.map +1 -1
- package/package.json +1 -1
- package/src/types/ai/recipe.ts +17 -10
- package/src/types/recipe/equipment.ts +4 -5
- package/src/types/recipe/ingredient.ts +13 -14
- package/src/types/recipe/instruction.ts +4 -4
- package/src/types/recipe/nutrition.ts +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../../src/types/ai/recipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAWL,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,UAAU,EAAE,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b,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AASD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBK,CAAC"}
|
package/dist/types/ai/recipe.js
CHANGED
|
@@ -3,22 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AIRecipeSchema = void 0;
|
|
4
4
|
const genkit_1 = require("genkit");
|
|
5
5
|
const recipe_1 = require("../recipe");
|
|
6
|
+
// Simplified schema for Gemini structured output
|
|
7
|
+
// Removed complex constraints that cause "too many states" errors:
|
|
8
|
+
// - Regex patterns on slugs (removed from nested schemas)
|
|
9
|
+
// - High array max limits (instructions max 50, equipment max 20, etc)
|
|
10
|
+
// - Numeric min/max bounds (confidence 0-1, servings 1-100, time 1-1440, etc)
|
|
11
|
+
// - String length constraints (description 10-2000, title 3-200, etc)
|
|
12
|
+
// These validations should be done in application logic if needed
|
|
6
13
|
exports.AIRecipeSchema = genkit_1.z.object({
|
|
7
14
|
allergens: genkit_1.z.array(recipe_1.AllergenSchema),
|
|
8
|
-
confidence: genkit_1.z.number()
|
|
15
|
+
confidence: genkit_1.z.number(),
|
|
9
16
|
cuisine: recipe_1.CuisineSchema,
|
|
10
|
-
description: genkit_1.z.string()
|
|
17
|
+
description: genkit_1.z.string(),
|
|
11
18
|
dietaryTags: genkit_1.z.array(recipe_1.DietaryTagSchema),
|
|
12
19
|
difficulty: recipe_1.DifficultySchema,
|
|
13
|
-
equipment: genkit_1.z.array(recipe_1.EquipmentSchema).
|
|
14
|
-
ingredientSections: genkit_1.z.array(recipe_1.IngredientSectionSchema)
|
|
15
|
-
instructions: genkit_1.z.array(recipe_1.InstructionSchema)
|
|
16
|
-
mealTypes: genkit_1.z.array(recipe_1.MealTypeSchema)
|
|
20
|
+
equipment: genkit_1.z.array(recipe_1.EquipmentSchema).optional(),
|
|
21
|
+
ingredientSections: genkit_1.z.array(recipe_1.IngredientSectionSchema),
|
|
22
|
+
instructions: genkit_1.z.array(recipe_1.InstructionSchema),
|
|
23
|
+
mealTypes: genkit_1.z.array(recipe_1.MealTypeSchema),
|
|
17
24
|
nutrition: recipe_1.NutritionSchema.optional(),
|
|
18
|
-
servings: genkit_1.z.number()
|
|
25
|
+
servings: genkit_1.z.number(),
|
|
19
26
|
spiciness: recipe_1.SpicinessSchema,
|
|
20
|
-
time: genkit_1.z.number()
|
|
21
|
-
tips: genkit_1.z.array(genkit_1.z.string()
|
|
22
|
-
title: genkit_1.z.string()
|
|
27
|
+
time: genkit_1.z.number(),
|
|
28
|
+
tips: genkit_1.z.array(genkit_1.z.string()).optional(),
|
|
29
|
+
title: genkit_1.z.string(),
|
|
23
30
|
});
|
|
24
31
|
//# sourceMappingURL=recipe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe.js","sourceRoot":"","sources":["../../../src/types/ai/recipe.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAC3B,sCAqBmB;
|
|
1
|
+
{"version":3,"file":"recipe.js","sourceRoot":"","sources":["../../../src/types/ai/recipe.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAC3B,sCAqBmB;AAqBnB,iDAAiD;AACjD,mEAAmE;AACnE,0DAA0D;AAC1D,uEAAuE;AACvE,8EAA8E;AAC9E,sEAAsE;AACtE,kEAAkE;AACrD,QAAA,cAAc,GAAG,UAAC,CAAC,MAAM,CAAC;IACrC,SAAS,EAAE,UAAC,CAAC,KAAK,CAAC,uBAAc,CAAC;IAClC,UAAU,EAAE,UAAC,CAAC,MAAM,EAAE;IACtB,OAAO,EAAE,sBAAa;IACtB,WAAW,EAAE,UAAC,CAAC,MAAM,EAAE;IACvB,WAAW,EAAE,UAAC,CAAC,KAAK,CAAC,yBAAgB,CAAC;IACtC,UAAU,EAAE,yBAAgB;IAC5B,SAAS,EAAE,UAAC,CAAC,KAAK,CAAC,wBAAe,CAAC,CAAC,QAAQ,EAAE;IAC9C,kBAAkB,EAAE,UAAC,CAAC,KAAK,CAAC,gCAAuB,CAAC;IACpD,YAAY,EAAE,UAAC,CAAC,KAAK,CAAC,0BAAiB,CAAC;IACxC,SAAS,EAAE,UAAC,CAAC,KAAK,CAAC,uBAAc,CAAC;IAClC,SAAS,EAAE,wBAAe,CAAC,QAAQ,EAAE;IACrC,QAAQ,EAAE,UAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,wBAAe;IAC1B,IAAI,EAAE,UAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,UAAC,CAAC,KAAK,CAAC,UAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpC,KAAK,EAAE,UAAC,CAAC,MAAM,EAAE;CAClB,CAA+B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equipment.d.ts","sourceRoot":"","sources":["../../../src/types/recipe/equipment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"equipment.d.ts","sourceRoot":"","sources":["../../../src/types/recipe/equipment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;EAGK,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAIK,CAAC;AAEzC,MAAM,WAAW,SAAU,SAAQ,aAAa,EAAE,gBAAgB;CAAG;AAErE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAGK,CAAC"}
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EquipmentSchema = exports.EquipmentContentSchema = exports.EquipmentMetaSchema = void 0;
|
|
4
4
|
const genkit_1 = require("genkit");
|
|
5
|
-
const config_1 = require("../../config");
|
|
6
5
|
exports.EquipmentMetaSchema = genkit_1.z.object({
|
|
7
6
|
required: genkit_1.z.boolean().optional(),
|
|
8
|
-
slug: genkit_1.z.string()
|
|
7
|
+
slug: genkit_1.z.string(),
|
|
9
8
|
});
|
|
10
9
|
exports.EquipmentContentSchema = genkit_1.z.object({
|
|
11
|
-
name: genkit_1.z.string()
|
|
12
|
-
notes: genkit_1.z.string().
|
|
13
|
-
slug: genkit_1.z.string()
|
|
10
|
+
name: genkit_1.z.string(),
|
|
11
|
+
notes: genkit_1.z.string().optional(),
|
|
12
|
+
slug: genkit_1.z.string(),
|
|
14
13
|
});
|
|
15
14
|
exports.EquipmentSchema = genkit_1.z.object(Object.assign(Object.assign({}, exports.EquipmentMetaSchema.shape), exports.EquipmentContentSchema.shape));
|
|
16
15
|
//# sourceMappingURL=equipment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equipment.js","sourceRoot":"","sources":["../../../src/types/recipe/equipment.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;
|
|
1
|
+
{"version":3,"file":"equipment.js","sourceRoot":"","sources":["../../../src/types/recipe/equipment.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAOd,QAAA,mBAAmB,GAAG,UAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,UAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,UAAC,CAAC,MAAM,EAAE;CACjB,CAAoC,CAAC;AAQzB,QAAA,sBAAsB,GAAG,UAAC,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,UAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,UAAC,CAAC,MAAM,EAAE;CACjB,CAAuC,CAAC;AAI5B,QAAA,eAAe,GAAG,UAAC,CAAC,MAAM,iCAClC,2BAAmB,CAAC,KAAK,GACzB,8BAAsB,CAAC,KAAK,EACA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingredient.d.ts","sourceRoot":"","sources":["../../../src/types/recipe/ingredient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ingredient.d.ts","sourceRoot":"","sources":["../../../src/types/recipe/ingredient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AAEhD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAKK,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;EAIK,CAAC;AAE1C,MAAM,WAAW,UAAW,SAAQ,cAAc,EAAE,iBAAiB;CAAG;AAExE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;EAGK,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGK,CAAC;AAE9C,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIK,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIK,CAAC"}
|
|
@@ -2,32 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IngredientSectionSchema = exports.IngredientSectionContentSchema = exports.IngredientSectionMetaSchema = exports.IngredientSchema = exports.IngredientContentSchema = exports.IngredientMetaSchema = void 0;
|
|
4
4
|
const genkit_1 = require("genkit");
|
|
5
|
-
const config_1 = require("../../config");
|
|
6
5
|
const enums_1 = require("./enums");
|
|
7
6
|
exports.IngredientMetaSchema = genkit_1.z.object({
|
|
8
|
-
quantity: genkit_1.z.number().
|
|
7
|
+
quantity: genkit_1.z.number().optional(),
|
|
9
8
|
required: genkit_1.z.boolean().optional(),
|
|
10
|
-
slug: genkit_1.z.string()
|
|
9
|
+
slug: genkit_1.z.string(),
|
|
11
10
|
unit: enums_1.UnitSchema.optional(),
|
|
12
11
|
});
|
|
13
12
|
exports.IngredientContentSchema = genkit_1.z.object({
|
|
14
|
-
name: genkit_1.z.string()
|
|
15
|
-
notes: genkit_1.z.string().
|
|
16
|
-
slug: genkit_1.z.string()
|
|
13
|
+
name: genkit_1.z.string(),
|
|
14
|
+
notes: genkit_1.z.string().optional(),
|
|
15
|
+
slug: genkit_1.z.string(),
|
|
17
16
|
});
|
|
18
17
|
exports.IngredientSchema = genkit_1.z.object(Object.assign(Object.assign({}, exports.IngredientMetaSchema.shape), exports.IngredientContentSchema.shape));
|
|
19
18
|
exports.IngredientSectionMetaSchema = genkit_1.z.object({
|
|
20
|
-
ingredients: genkit_1.z.array(exports.IngredientMetaSchema)
|
|
21
|
-
slug: genkit_1.z.string()
|
|
19
|
+
ingredients: genkit_1.z.array(exports.IngredientMetaSchema),
|
|
20
|
+
slug: genkit_1.z.string(),
|
|
22
21
|
});
|
|
23
22
|
exports.IngredientSectionContentSchema = genkit_1.z.object({
|
|
24
|
-
ingredients: genkit_1.z.array(exports.IngredientContentSchema)
|
|
25
|
-
slug: genkit_1.z.string()
|
|
26
|
-
title: genkit_1.z.string().
|
|
23
|
+
ingredients: genkit_1.z.array(exports.IngredientContentSchema),
|
|
24
|
+
slug: genkit_1.z.string(),
|
|
25
|
+
title: genkit_1.z.string().optional(),
|
|
27
26
|
});
|
|
28
27
|
exports.IngredientSectionSchema = genkit_1.z.object({
|
|
29
|
-
ingredients: genkit_1.z.array(exports.IngredientSchema)
|
|
30
|
-
slug: genkit_1.z.string()
|
|
31
|
-
title: genkit_1.z.string().
|
|
28
|
+
ingredients: genkit_1.z.array(exports.IngredientSchema),
|
|
29
|
+
slug: genkit_1.z.string(),
|
|
30
|
+
title: genkit_1.z.string().optional(),
|
|
32
31
|
});
|
|
33
32
|
//# sourceMappingURL=ingredient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingredient.js","sourceRoot":"","sources":["../../../src/types/recipe/ingredient.ts"],"names":[],"mappings":";;;AAA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AC,CAAC,KAAK,CAAC,wBAAgB,CAAC;IACtC,IAAI,EAAE,UAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAwC,CAAC"}
|
|
@@ -4,13 +4,13 @@ exports.InstructionSchema = exports.InstructionContentSchema = exports.Instructi
|
|
|
4
4
|
const genkit_1 = require("genkit");
|
|
5
5
|
const temperature_1 = require("./temperature");
|
|
6
6
|
exports.InstructionMetaSchema = genkit_1.z.object({
|
|
7
|
-
duration: genkit_1.z.number().
|
|
8
|
-
step: genkit_1.z.number()
|
|
7
|
+
duration: genkit_1.z.number().optional(),
|
|
8
|
+
step: genkit_1.z.number(),
|
|
9
9
|
temperature: temperature_1.TemperatureSchema.optional(),
|
|
10
10
|
});
|
|
11
11
|
exports.InstructionContentSchema = genkit_1.z.object({
|
|
12
|
-
step: genkit_1.z.number()
|
|
13
|
-
text: genkit_1.z.string()
|
|
12
|
+
step: genkit_1.z.number(),
|
|
13
|
+
text: genkit_1.z.string(),
|
|
14
14
|
});
|
|
15
15
|
exports.InstructionSchema = genkit_1.z.object(Object.assign(Object.assign({}, exports.InstructionMetaSchema.shape), exports.InstructionContentSchema.shape));
|
|
16
16
|
//# sourceMappingURL=instruction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instruction.js","sourceRoot":"","sources":["../../../src/types/recipe/instruction.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAC3B,+CAAoE;AAQvD,QAAA,qBAAqB,GAAG,UAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"instruction.js","sourceRoot":"","sources":["../../../src/types/recipe/instruction.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAC3B,+CAAoE;AAQvD,QAAA,qBAAqB,GAAG,UAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,IAAI,EAAE,UAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,+BAAiB,CAAC,QAAQ,EAAE;CAC1C,CAAsC,CAAC;AAO3B,QAAA,wBAAwB,GAAG,UAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,UAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,UAAC,CAAC,MAAM,EAAE;CACjB,CAAyC,CAAC;AAI9B,QAAA,iBAAiB,GAAG,UAAC,CAAC,MAAM,iCACpC,6BAAqB,CAAC,KAAK,GAC3B,gCAAwB,CAAC,KAAK,EACA,CAAC"}
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NutritionSchema = void 0;
|
|
4
4
|
const genkit_1 = require("genkit");
|
|
5
5
|
exports.NutritionSchema = genkit_1.z.object({
|
|
6
|
-
calories: genkit_1.z.number()
|
|
7
|
-
carbs: genkit_1.z.number().
|
|
8
|
-
cholesterol: genkit_1.z.number().
|
|
9
|
-
fat: genkit_1.z.number().
|
|
10
|
-
fiber: genkit_1.z.number().
|
|
11
|
-
protein: genkit_1.z.number().
|
|
12
|
-
saturatedFat: genkit_1.z.number().
|
|
13
|
-
sodium: genkit_1.z.number().
|
|
14
|
-
sugar: genkit_1.z.number().
|
|
6
|
+
calories: genkit_1.z.number(),
|
|
7
|
+
carbs: genkit_1.z.number().optional(),
|
|
8
|
+
cholesterol: genkit_1.z.number().optional(),
|
|
9
|
+
fat: genkit_1.z.number().optional(),
|
|
10
|
+
fiber: genkit_1.z.number().optional(),
|
|
11
|
+
protein: genkit_1.z.number().optional(),
|
|
12
|
+
saturatedFat: genkit_1.z.number().optional(),
|
|
13
|
+
sodium: genkit_1.z.number().optional(),
|
|
14
|
+
sugar: genkit_1.z.number().optional(),
|
|
15
15
|
});
|
|
16
16
|
//# sourceMappingURL=nutrition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nutrition.js","sourceRoot":"","sources":["../../../src/types/recipe/nutrition.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAkBd,QAAA,eAAe,GAAG,UAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,UAAC,CAAC,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"nutrition.js","sourceRoot":"","sources":["../../../src/types/recipe/nutrition.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAkBd,QAAA,eAAe,GAAG,UAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,UAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,GAAG,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,KAAK,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,OAAO,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,YAAY,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,MAAM,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,UAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAgC,CAAC"}
|
package/package.json
CHANGED
package/src/types/ai/recipe.ts
CHANGED
|
@@ -41,21 +41,28 @@ export interface AIRecipe {
|
|
|
41
41
|
title: string;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
// Simplified schema for Gemini structured output
|
|
45
|
+
// Removed complex constraints that cause "too many states" errors:
|
|
46
|
+
// - Regex patterns on slugs (removed from nested schemas)
|
|
47
|
+
// - High array max limits (instructions max 50, equipment max 20, etc)
|
|
48
|
+
// - Numeric min/max bounds (confidence 0-1, servings 1-100, time 1-1440, etc)
|
|
49
|
+
// - String length constraints (description 10-2000, title 3-200, etc)
|
|
50
|
+
// These validations should be done in application logic if needed
|
|
44
51
|
export const AIRecipeSchema = z.object({
|
|
45
52
|
allergens: z.array(AllergenSchema),
|
|
46
|
-
confidence: z.number()
|
|
53
|
+
confidence: z.number(),
|
|
47
54
|
cuisine: CuisineSchema,
|
|
48
|
-
description: z.string()
|
|
55
|
+
description: z.string(),
|
|
49
56
|
dietaryTags: z.array(DietaryTagSchema),
|
|
50
57
|
difficulty: DifficultySchema,
|
|
51
|
-
equipment: z.array(EquipmentSchema).
|
|
52
|
-
ingredientSections: z.array(IngredientSectionSchema)
|
|
53
|
-
instructions: z.array(InstructionSchema)
|
|
54
|
-
mealTypes: z.array(MealTypeSchema)
|
|
58
|
+
equipment: z.array(EquipmentSchema).optional(),
|
|
59
|
+
ingredientSections: z.array(IngredientSectionSchema),
|
|
60
|
+
instructions: z.array(InstructionSchema),
|
|
61
|
+
mealTypes: z.array(MealTypeSchema),
|
|
55
62
|
nutrition: NutritionSchema.optional(),
|
|
56
|
-
servings: z.number()
|
|
63
|
+
servings: z.number(),
|
|
57
64
|
spiciness: SpicinessSchema,
|
|
58
|
-
time: z.number()
|
|
59
|
-
tips: z.array(z.string()
|
|
60
|
-
title: z.string()
|
|
65
|
+
time: z.number(),
|
|
66
|
+
tips: z.array(z.string()).optional(),
|
|
67
|
+
title: z.string(),
|
|
61
68
|
}) satisfies z.ZodType<AIRecipe>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "genkit";
|
|
2
|
-
import { SLUG_REGEX } from "../../config";
|
|
3
2
|
|
|
4
3
|
export interface EquipmentMeta {
|
|
5
4
|
required?: boolean;
|
|
@@ -8,7 +7,7 @@ export interface EquipmentMeta {
|
|
|
8
7
|
|
|
9
8
|
export const EquipmentMetaSchema = z.object({
|
|
10
9
|
required: z.boolean().optional(),
|
|
11
|
-
slug: z.string()
|
|
10
|
+
slug: z.string(),
|
|
12
11
|
}) satisfies z.ZodType<EquipmentMeta>;
|
|
13
12
|
|
|
14
13
|
export interface EquipmentContent {
|
|
@@ -18,9 +17,9 @@ export interface EquipmentContent {
|
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export const EquipmentContentSchema = z.object({
|
|
21
|
-
name: z.string()
|
|
22
|
-
notes: z.string().
|
|
23
|
-
slug: z.string()
|
|
20
|
+
name: z.string(),
|
|
21
|
+
notes: z.string().optional(),
|
|
22
|
+
slug: z.string(),
|
|
24
23
|
}) satisfies z.ZodType<EquipmentContent>;
|
|
25
24
|
|
|
26
25
|
export interface Equipment extends EquipmentMeta, EquipmentContent {}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "genkit";
|
|
2
|
-
import { SLUG_REGEX } from "../../config";
|
|
3
2
|
import { UnitSchema, type Unit } from "./enums";
|
|
4
3
|
|
|
5
4
|
export interface IngredientMeta {
|
|
@@ -10,9 +9,9 @@ export interface IngredientMeta {
|
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
export const IngredientMetaSchema = z.object({
|
|
13
|
-
quantity: z.number().
|
|
12
|
+
quantity: z.number().optional(),
|
|
14
13
|
required: z.boolean().optional(),
|
|
15
|
-
slug: z.string()
|
|
14
|
+
slug: z.string(),
|
|
16
15
|
unit: UnitSchema.optional(),
|
|
17
16
|
}) satisfies z.ZodType<IngredientMeta>;
|
|
18
17
|
|
|
@@ -23,9 +22,9 @@ export interface IngredientContent {
|
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
export const IngredientContentSchema = z.object({
|
|
26
|
-
name: z.string()
|
|
27
|
-
notes: z.string().
|
|
28
|
-
slug: z.string()
|
|
25
|
+
name: z.string(),
|
|
26
|
+
notes: z.string().optional(),
|
|
27
|
+
slug: z.string(),
|
|
29
28
|
}) satisfies z.ZodType<IngredientContent>;
|
|
30
29
|
|
|
31
30
|
export interface Ingredient extends IngredientMeta, IngredientContent {}
|
|
@@ -41,8 +40,8 @@ export interface IngredientSectionMeta {
|
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
export const IngredientSectionMetaSchema = z.object({
|
|
44
|
-
ingredients: z.array(IngredientMetaSchema)
|
|
45
|
-
slug: z.string()
|
|
43
|
+
ingredients: z.array(IngredientMetaSchema),
|
|
44
|
+
slug: z.string(),
|
|
46
45
|
}) satisfies z.ZodType<IngredientSectionMeta>;
|
|
47
46
|
|
|
48
47
|
export interface IngredientSectionContent {
|
|
@@ -52,9 +51,9 @@ export interface IngredientSectionContent {
|
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
export const IngredientSectionContentSchema = z.object({
|
|
55
|
-
ingredients: z.array(IngredientContentSchema)
|
|
56
|
-
slug: z.string()
|
|
57
|
-
title: z.string().
|
|
54
|
+
ingredients: z.array(IngredientContentSchema),
|
|
55
|
+
slug: z.string(),
|
|
56
|
+
title: z.string().optional(),
|
|
58
57
|
}) satisfies z.ZodType<IngredientSectionContent>;
|
|
59
58
|
|
|
60
59
|
export interface IngredientSection {
|
|
@@ -64,7 +63,7 @@ export interface IngredientSection {
|
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
export const IngredientSectionSchema = z.object({
|
|
67
|
-
ingredients: z.array(IngredientSchema)
|
|
68
|
-
slug: z.string()
|
|
69
|
-
title: z.string().
|
|
66
|
+
ingredients: z.array(IngredientSchema),
|
|
67
|
+
slug: z.string(),
|
|
68
|
+
title: z.string().optional(),
|
|
70
69
|
}) satisfies z.ZodType<IngredientSection>;
|
|
@@ -8,8 +8,8 @@ export interface InstructionMeta {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const InstructionMetaSchema = z.object({
|
|
11
|
-
duration: z.number().
|
|
12
|
-
step: z.number()
|
|
11
|
+
duration: z.number().optional(),
|
|
12
|
+
step: z.number(),
|
|
13
13
|
temperature: TemperatureSchema.optional(),
|
|
14
14
|
}) satisfies z.ZodType<InstructionMeta>;
|
|
15
15
|
|
|
@@ -19,8 +19,8 @@ export interface InstructionContent {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const InstructionContentSchema = z.object({
|
|
22
|
-
step: z.number()
|
|
23
|
-
text: z.string()
|
|
22
|
+
step: z.number(),
|
|
23
|
+
text: z.string(),
|
|
24
24
|
}) satisfies z.ZodType<InstructionContent>;
|
|
25
25
|
|
|
26
26
|
export interface Instruction extends InstructionMeta, InstructionContent {}
|
|
@@ -17,13 +17,13 @@ export interface Nutrition {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const NutritionSchema = z.object({
|
|
20
|
-
calories: z.number()
|
|
21
|
-
carbs: z.number().
|
|
22
|
-
cholesterol: z.number().
|
|
23
|
-
fat: z.number().
|
|
24
|
-
fiber: z.number().
|
|
25
|
-
protein: z.number().
|
|
26
|
-
saturatedFat: z.number().
|
|
27
|
-
sodium: z.number().
|
|
28
|
-
sugar: z.number().
|
|
20
|
+
calories: z.number(),
|
|
21
|
+
carbs: z.number().optional(),
|
|
22
|
+
cholesterol: z.number().optional(),
|
|
23
|
+
fat: z.number().optional(),
|
|
24
|
+
fiber: z.number().optional(),
|
|
25
|
+
protein: z.number().optional(),
|
|
26
|
+
saturatedFat: z.number().optional(),
|
|
27
|
+
sodium: z.number().optional(),
|
|
28
|
+
sugar: z.number().optional(),
|
|
29
29
|
}) satisfies z.ZodType<Nutrition>;
|