@cravery/core 0.0.32 → 0.0.33
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/core/asset.d.ts +1 -0
- package/dist/types/core/asset.d.ts.map +1 -1
- package/package.json +45 -45
- package/src/config/ai.ts +39 -39
- package/src/types/ai/config.ts +28 -28
- package/src/types/core/asset.ts +1 -0
- package/src/types/recipe/recipe.ts +92 -92
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/types/core/asset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,KAAM,SAAQ,MAAM;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/types/core/asset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,KAAM,SAAQ,MAAM;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cravery/core",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Clean architecture foundation for Cravery",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"default": "./dist/index.js"
|
|
11
|
-
},
|
|
12
|
-
"./types": {
|
|
13
|
-
"types": "./dist/types/index.d.ts",
|
|
14
|
-
"default": "./dist/types/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./config": {
|
|
17
|
-
"types": "./dist/config/index.d.ts",
|
|
18
|
-
"default": "./dist/config/index.js"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"typesVersions": {
|
|
22
|
-
"*": {
|
|
23
|
-
"types": [
|
|
24
|
-
"dist/types/index.d.ts"
|
|
25
|
-
],
|
|
26
|
-
"config": [
|
|
27
|
-
"dist/config/index.d.ts"
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "tsc",
|
|
33
|
-
"build:watch": "tsc --watch",
|
|
34
|
-
"clean": "rimraf dist && npm run build"
|
|
35
|
-
},
|
|
36
|
-
"keywords": [],
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"rimraf": "^6.1.2",
|
|
39
|
-
"typescript": "^5.9.3"
|
|
40
|
-
},
|
|
41
|
-
"files": [
|
|
42
|
-
"dist/**/*",
|
|
43
|
-
"src/**/*"
|
|
44
|
-
]
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@cravery/core",
|
|
3
|
+
"version": "0.0.33",
|
|
4
|
+
"description": "Clean architecture foundation for Cravery",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./types": {
|
|
13
|
+
"types": "./dist/types/index.d.ts",
|
|
14
|
+
"default": "./dist/types/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./config": {
|
|
17
|
+
"types": "./dist/config/index.d.ts",
|
|
18
|
+
"default": "./dist/config/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"typesVersions": {
|
|
22
|
+
"*": {
|
|
23
|
+
"types": [
|
|
24
|
+
"dist/types/index.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"config": [
|
|
27
|
+
"dist/config/index.d.ts"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"build:watch": "tsc --watch",
|
|
34
|
+
"clean": "rimraf dist && npm run build"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [],
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"rimraf": "^6.1.2",
|
|
39
|
+
"typescript": "^5.9.3"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist/**/*",
|
|
43
|
+
"src/**/*"
|
|
44
|
+
]
|
|
45
|
+
}
|
package/src/config/ai.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { AIConfig } from "../types";
|
|
2
|
-
|
|
3
|
-
export const AI_MODELS: AIConfig = {
|
|
4
|
-
Gemini25Flash: {
|
|
5
|
-
id: "vertexai/gemini-2.5-flash",
|
|
6
|
-
alias: "gemini25flash",
|
|
7
|
-
name: "Gemini 2.5 Flash",
|
|
8
|
-
type: "multimodal",
|
|
9
|
-
cost: { input: 0.3, output: 2.5 },
|
|
10
|
-
},
|
|
11
|
-
Gemini25Pro: {
|
|
12
|
-
id: "vertexai/gemini-2.5-pro",
|
|
13
|
-
alias: "gemini25pro",
|
|
14
|
-
name: "Gemini 2.5 Pro",
|
|
15
|
-
type: "multimodal",
|
|
16
|
-
cost: { input: 1.25, output: 10.0 },
|
|
17
|
-
},
|
|
18
|
-
Gemini3Flash: {
|
|
19
|
-
id: "vertexai/gemini-3.0-flash",
|
|
20
|
-
alias: "gemini3flash",
|
|
21
|
-
name: "Gemini 3 Flash",
|
|
22
|
-
type: "multimodal",
|
|
23
|
-
cost: { input: 0.5, output: 3.0 },
|
|
24
|
-
},
|
|
25
|
-
Imagen4Fast: {
|
|
26
|
-
id: "vertexai/imagen-4.0-fast-generate-001",
|
|
27
|
-
alias: "imagen4fast",
|
|
28
|
-
name: "Imagen 4 Fast",
|
|
29
|
-
type: "image",
|
|
30
|
-
cost: { input: 0, output: 0.02 },
|
|
31
|
-
},
|
|
32
|
-
GeminiEmbedding001: {
|
|
33
|
-
id: "vertexai/gemini-embedding-001",
|
|
34
|
-
alias: "geminiembedding001",
|
|
35
|
-
name: "Gemini Embedding 001",
|
|
36
|
-
type: "embedding",
|
|
37
|
-
cost: { input: 0.00015, output: 0 },
|
|
38
|
-
},
|
|
39
|
-
};
|
|
1
|
+
import { AIConfig } from "../types";
|
|
2
|
+
|
|
3
|
+
export const AI_MODELS: AIConfig = {
|
|
4
|
+
Gemini25Flash: {
|
|
5
|
+
id: "vertexai/gemini-2.5-flash",
|
|
6
|
+
alias: "gemini25flash",
|
|
7
|
+
name: "Gemini 2.5 Flash",
|
|
8
|
+
type: "multimodal",
|
|
9
|
+
cost: { input: 0.3, output: 2.5 },
|
|
10
|
+
},
|
|
11
|
+
Gemini25Pro: {
|
|
12
|
+
id: "vertexai/gemini-2.5-pro",
|
|
13
|
+
alias: "gemini25pro",
|
|
14
|
+
name: "Gemini 2.5 Pro",
|
|
15
|
+
type: "multimodal",
|
|
16
|
+
cost: { input: 1.25, output: 10.0 },
|
|
17
|
+
},
|
|
18
|
+
Gemini3Flash: {
|
|
19
|
+
id: "vertexai/gemini-3.0-flash",
|
|
20
|
+
alias: "gemini3flash",
|
|
21
|
+
name: "Gemini 3 Flash",
|
|
22
|
+
type: "multimodal",
|
|
23
|
+
cost: { input: 0.5, output: 3.0 },
|
|
24
|
+
},
|
|
25
|
+
Imagen4Fast: {
|
|
26
|
+
id: "vertexai/imagen-4.0-fast-generate-001",
|
|
27
|
+
alias: "imagen4fast",
|
|
28
|
+
name: "Imagen 4 Fast",
|
|
29
|
+
type: "image",
|
|
30
|
+
cost: { input: 0, output: 0.02 },
|
|
31
|
+
},
|
|
32
|
+
GeminiEmbedding001: {
|
|
33
|
+
id: "vertexai/gemini-embedding-001",
|
|
34
|
+
alias: "geminiembedding001",
|
|
35
|
+
name: "Gemini Embedding 001",
|
|
36
|
+
type: "embedding",
|
|
37
|
+
cost: { input: 0.00015, output: 0 },
|
|
38
|
+
},
|
|
39
|
+
};
|
package/src/types/ai/config.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI model configuration, costs are in USD:
|
|
3
|
-
* - multimodal: cost per 1,000,000 input/output tokens
|
|
4
|
-
* - image: cost per image (stored in cost.output)
|
|
5
|
-
* - embedding: cost per 1,000 input tokens
|
|
6
|
-
*/
|
|
7
|
-
export type AIModel =
|
|
8
|
-
| "Gemini25Flash"
|
|
9
|
-
| "Gemini25Pro"
|
|
10
|
-
| "Gemini3Flash"
|
|
11
|
-
| "Imagen4Fast"
|
|
12
|
-
| "GeminiEmbedding001";
|
|
13
|
-
export type AIModelType = "multimodal" | "image" | "embedding";
|
|
14
|
-
|
|
15
|
-
export interface AIModelCost {
|
|
16
|
-
input: number;
|
|
17
|
-
output: number;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface AIModelConfig {
|
|
21
|
-
id: string;
|
|
22
|
-
alias: string;
|
|
23
|
-
cost: AIModelCost;
|
|
24
|
-
name: string;
|
|
25
|
-
type: AIModelType;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export type AIConfig = Record<AIModel, AIModelConfig>;
|
|
1
|
+
/**
|
|
2
|
+
* AI model configuration, costs are in USD:
|
|
3
|
+
* - multimodal: cost per 1,000,000 input/output tokens
|
|
4
|
+
* - image: cost per image (stored in cost.output)
|
|
5
|
+
* - embedding: cost per 1,000 input tokens
|
|
6
|
+
*/
|
|
7
|
+
export type AIModel =
|
|
8
|
+
| "Gemini25Flash"
|
|
9
|
+
| "Gemini25Pro"
|
|
10
|
+
| "Gemini3Flash"
|
|
11
|
+
| "Imagen4Fast"
|
|
12
|
+
| "GeminiEmbedding001";
|
|
13
|
+
export type AIModelType = "multimodal" | "image" | "embedding";
|
|
14
|
+
|
|
15
|
+
export interface AIModelCost {
|
|
16
|
+
input: number;
|
|
17
|
+
output: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AIModelConfig {
|
|
21
|
+
id: string;
|
|
22
|
+
alias: string;
|
|
23
|
+
cost: AIModelCost;
|
|
24
|
+
name: string;
|
|
25
|
+
type: AIModelType;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type AIConfig = Record<AIModel, AIModelConfig>;
|
package/src/types/core/asset.ts
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import { Entity, Timestamp } from "../core";
|
|
2
|
-
import { Locale } from "../core/locale";
|
|
3
|
-
import { Allergen } from "./allergen";
|
|
4
|
-
import { Cuisine } from "./cuisine";
|
|
5
|
-
import { DietaryTag } from "./dietary_tag";
|
|
6
|
-
import { Difficulty } from "./difficulty";
|
|
7
|
-
import { Equipment, EquipmentContent, EquipmentMeta } from "./equipment";
|
|
8
|
-
import {
|
|
9
|
-
IngredientSection,
|
|
10
|
-
IngredientSectionContent,
|
|
11
|
-
IngredientSectionMeta,
|
|
12
|
-
} from "./ingredient";
|
|
13
|
-
import {
|
|
14
|
-
Instruction,
|
|
15
|
-
InstructionContent,
|
|
16
|
-
InstructionMeta,
|
|
17
|
-
} from "./instruction";
|
|
18
|
-
import { MealType } from "./meal_type";
|
|
19
|
-
import { Nutrition } from "./nutrition";
|
|
20
|
-
import { RecipeSource } from "./recipe_source";
|
|
21
|
-
import { RecipeStatus } from "./recipe_status";
|
|
22
|
-
import { Spiciness } from "./spiciness";
|
|
23
|
-
|
|
24
|
-
export interface RecipeMeta extends Entity {
|
|
25
|
-
allergens: Allergen[];
|
|
26
|
-
confidence: number;
|
|
27
|
-
createdBy: string;
|
|
28
|
-
cuisine: Cuisine;
|
|
29
|
-
deletedAt?: Timestamp;
|
|
30
|
-
dietaryTags: DietaryTag[];
|
|
31
|
-
difficulty: Difficulty;
|
|
32
|
-
equipment?: EquipmentMeta[];
|
|
33
|
-
imageUrl?: string;
|
|
34
|
-
ingredientSections: IngredientSectionMeta[];
|
|
35
|
-
instructions: InstructionMeta[];
|
|
36
|
-
mealTypes: MealType[];
|
|
37
|
-
nutrition?: Nutrition;
|
|
38
|
-
originalLocale: Locale;
|
|
39
|
-
servings: number;
|
|
40
|
-
source: RecipeSource;
|
|
41
|
-
sourceUrl?: string;
|
|
42
|
-
spiciness: Spiciness;
|
|
43
|
-
status: RecipeStatus;
|
|
44
|
-
time: number;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface RecipeContent {
|
|
48
|
-
description: string;
|
|
49
|
-
equipment?: EquipmentContent[];
|
|
50
|
-
ingredientSections: IngredientSectionContent[];
|
|
51
|
-
instructions: InstructionContent[];
|
|
52
|
-
locale: Locale;
|
|
53
|
-
tips?: string[];
|
|
54
|
-
title: string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface Recipe extends Entity {
|
|
58
|
-
allergens: Allergen[];
|
|
59
|
-
confidence: number;
|
|
60
|
-
createdBy: string;
|
|
61
|
-
cuisine: Cuisine;
|
|
62
|
-
deletedAt?: Timestamp;
|
|
63
|
-
description: string;
|
|
64
|
-
dietaryTags: DietaryTag[];
|
|
65
|
-
difficulty: Difficulty;
|
|
66
|
-
equipment?: Equipment[];
|
|
67
|
-
imageUrl?: string;
|
|
68
|
-
ingredientSections: IngredientSection[];
|
|
69
|
-
instructions: Instruction[];
|
|
70
|
-
locale: Locale;
|
|
71
|
-
mealTypes: MealType[];
|
|
72
|
-
nutrition?: Nutrition;
|
|
73
|
-
originalLocale: Locale;
|
|
74
|
-
servings: number;
|
|
75
|
-
source: RecipeSource;
|
|
76
|
-
sourceUrl?: string;
|
|
77
|
-
spiciness: Spiciness;
|
|
78
|
-
status: RecipeStatus;
|
|
79
|
-
time: number;
|
|
80
|
-
tips?: string[];
|
|
81
|
-
title: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface RecipeStats {
|
|
85
|
-
comments: number;
|
|
86
|
-
likes: number;
|
|
87
|
-
rating: number;
|
|
88
|
-
ratingCount: number;
|
|
89
|
-
saves: number;
|
|
90
|
-
updatedAt: number;
|
|
91
|
-
views: number;
|
|
92
|
-
}
|
|
1
|
+
import { Entity, Timestamp } from "../core";
|
|
2
|
+
import { Locale } from "../core/locale";
|
|
3
|
+
import { Allergen } from "./allergen";
|
|
4
|
+
import { Cuisine } from "./cuisine";
|
|
5
|
+
import { DietaryTag } from "./dietary_tag";
|
|
6
|
+
import { Difficulty } from "./difficulty";
|
|
7
|
+
import { Equipment, EquipmentContent, EquipmentMeta } from "./equipment";
|
|
8
|
+
import {
|
|
9
|
+
IngredientSection,
|
|
10
|
+
IngredientSectionContent,
|
|
11
|
+
IngredientSectionMeta,
|
|
12
|
+
} from "./ingredient";
|
|
13
|
+
import {
|
|
14
|
+
Instruction,
|
|
15
|
+
InstructionContent,
|
|
16
|
+
InstructionMeta,
|
|
17
|
+
} from "./instruction";
|
|
18
|
+
import { MealType } from "./meal_type";
|
|
19
|
+
import { Nutrition } from "./nutrition";
|
|
20
|
+
import { RecipeSource } from "./recipe_source";
|
|
21
|
+
import { RecipeStatus } from "./recipe_status";
|
|
22
|
+
import { Spiciness } from "./spiciness";
|
|
23
|
+
|
|
24
|
+
export interface RecipeMeta extends Entity {
|
|
25
|
+
allergens: Allergen[];
|
|
26
|
+
confidence: number;
|
|
27
|
+
createdBy: string;
|
|
28
|
+
cuisine: Cuisine;
|
|
29
|
+
deletedAt?: Timestamp;
|
|
30
|
+
dietaryTags: DietaryTag[];
|
|
31
|
+
difficulty: Difficulty;
|
|
32
|
+
equipment?: EquipmentMeta[];
|
|
33
|
+
imageUrl?: string;
|
|
34
|
+
ingredientSections: IngredientSectionMeta[];
|
|
35
|
+
instructions: InstructionMeta[];
|
|
36
|
+
mealTypes: MealType[];
|
|
37
|
+
nutrition?: Nutrition;
|
|
38
|
+
originalLocale: Locale;
|
|
39
|
+
servings: number;
|
|
40
|
+
source: RecipeSource;
|
|
41
|
+
sourceUrl?: string;
|
|
42
|
+
spiciness: Spiciness;
|
|
43
|
+
status: RecipeStatus;
|
|
44
|
+
time: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface RecipeContent {
|
|
48
|
+
description: string;
|
|
49
|
+
equipment?: EquipmentContent[];
|
|
50
|
+
ingredientSections: IngredientSectionContent[];
|
|
51
|
+
instructions: InstructionContent[];
|
|
52
|
+
locale: Locale;
|
|
53
|
+
tips?: string[];
|
|
54
|
+
title: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface Recipe extends Entity {
|
|
58
|
+
allergens: Allergen[];
|
|
59
|
+
confidence: number;
|
|
60
|
+
createdBy: string;
|
|
61
|
+
cuisine: Cuisine;
|
|
62
|
+
deletedAt?: Timestamp;
|
|
63
|
+
description: string;
|
|
64
|
+
dietaryTags: DietaryTag[];
|
|
65
|
+
difficulty: Difficulty;
|
|
66
|
+
equipment?: Equipment[];
|
|
67
|
+
imageUrl?: string;
|
|
68
|
+
ingredientSections: IngredientSection[];
|
|
69
|
+
instructions: Instruction[];
|
|
70
|
+
locale: Locale;
|
|
71
|
+
mealTypes: MealType[];
|
|
72
|
+
nutrition?: Nutrition;
|
|
73
|
+
originalLocale: Locale;
|
|
74
|
+
servings: number;
|
|
75
|
+
source: RecipeSource;
|
|
76
|
+
sourceUrl?: string;
|
|
77
|
+
spiciness: Spiciness;
|
|
78
|
+
status: RecipeStatus;
|
|
79
|
+
time: number;
|
|
80
|
+
tips?: string[];
|
|
81
|
+
title: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface RecipeStats {
|
|
85
|
+
comments: number;
|
|
86
|
+
likes: number;
|
|
87
|
+
rating: number;
|
|
88
|
+
ratingCount: number;
|
|
89
|
+
saves: number;
|
|
90
|
+
updatedAt: number;
|
|
91
|
+
views: number;
|
|
92
|
+
}
|