@gringow/gringow 0.1.1 → 0.1.3

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.
Files changed (56) hide show
  1. package/README.md +82 -40
  2. package/dist/browser.d.mts +2 -1
  3. package/dist/browser.mjs +61 -4
  4. package/dist/config.d.mts +3 -3
  5. package/dist/config.mjs +30 -30
  6. package/dist/config.test.mjs +77 -94
  7. package/dist/{data/create-cache-id.d.mts → create-cache-id.d.mts} +2 -2
  8. package/dist/create-cache-id.mjs +54 -0
  9. package/dist/create-cache-id.test.d.mts +2 -0
  10. package/dist/create-cache-id.test.mjs +18464 -0
  11. package/dist/data/check-cache.d.mts +1 -1
  12. package/dist/data/check-cache.mjs +39 -34
  13. package/dist/data/clear-cache.mjs +39 -34
  14. package/dist/data/create-cache-dir.mjs +30 -30
  15. package/dist/data/delete-cache-item.d.mts +1 -1
  16. package/dist/data/delete-cache-item.mjs +39 -34
  17. package/dist/data/get-cache.mjs +30 -30
  18. package/dist/data/get-or-create-cache.d.mts +1 -1
  19. package/dist/data/get-or-create-cache.mjs +39 -34
  20. package/dist/data/md5.d.mts +13 -0
  21. package/dist/data/md5.mjs +47 -0
  22. package/dist/data/md5.test.d.mts +2 -0
  23. package/dist/data/md5.test.mjs +18457 -0
  24. package/dist/data/save-cache.d.mts +2 -2
  25. package/dist/data/save-cache.mjs +39 -34
  26. package/dist/data/write-cache-to-disk.d.mts +1 -1
  27. package/dist/data/write-cache-to-disk.mjs +39 -34
  28. package/dist/flat-template-string.test.mjs +10 -10
  29. package/dist/gringow.d.mts +1 -1
  30. package/dist/gringow.mjs +127 -58
  31. package/dist/index.d.mts +1 -1
  32. package/dist/index.mjs +127 -58
  33. package/dist/interpolate-template.d.mts +3 -0
  34. package/dist/interpolate-template.mjs +14 -0
  35. package/dist/io/anthropic/ask.mjs +30 -30
  36. package/dist/io/anthropic/commit-response.d.mts +1 -1
  37. package/dist/io/anthropic/index.d.mts +1 -1
  38. package/dist/io/anthropic/index.mjs +30 -30
  39. package/dist/io/anthropic/parse.d.mts +1 -1
  40. package/dist/io/ask-llm.d.mts +1 -1
  41. package/dist/io/ask-llm.mjs +65 -47
  42. package/dist/io/gemini/ask.mjs +65 -47
  43. package/dist/io/gemini/index.d.mts +1 -1
  44. package/dist/io/gemini/index.mjs +65 -47
  45. package/dist/io/gemini/parse.d.mts +1 -1
  46. package/dist/io/huggingface/ask.d.mts +1 -1
  47. package/dist/io/huggingface/ask.mjs +30 -30
  48. package/dist/io/huggingface/commit-response.d.mts +1 -1
  49. package/dist/io/huggingface/index.d.mts +1 -1
  50. package/dist/io/huggingface/index.mjs +30 -30
  51. package/dist/io/huggingface/parse.d.mts +1 -1
  52. package/dist/logger.test.mjs +10 -10
  53. package/dist/schemas/config.shcema.d.mts +12 -12
  54. package/dist/types/index.d.mts +1 -1
  55. package/package.json +10 -10
  56. package/dist/data/create-cache-id.mjs +0 -10
@@ -53,10 +53,10 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
53
53
  }, "strip", z.ZodTypeAny, {
54
54
  choice: "gemini" | "anthropic" | "huggingface";
55
55
  model: string | null;
56
- prePrompt?: string | undefined;
57
- postPrompt?: string | undefined;
58
56
  temperature?: number | undefined;
59
57
  sleep?: number | undefined;
58
+ prePrompt?: string | undefined;
59
+ postPrompt?: string | undefined;
60
60
  prePromptReplace?: string | undefined;
61
61
  postPromptReplace?: string | undefined;
62
62
  prePromptAppend?: string | undefined;
@@ -64,10 +64,10 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
64
64
  }, {
65
65
  choice: "gemini" | "anthropic" | "huggingface";
66
66
  model: string | null;
67
- prePrompt?: string | undefined;
68
- postPrompt?: string | undefined;
69
67
  temperature?: number | undefined;
70
68
  sleep?: number | undefined;
69
+ prePrompt?: string | undefined;
70
+ postPrompt?: string | undefined;
71
71
  prePromptReplace?: string | undefined;
72
72
  postPromptReplace?: string | undefined;
73
73
  prePromptAppend?: string | undefined;
@@ -93,10 +93,10 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
93
93
  llm: {
94
94
  choice: "gemini" | "anthropic" | "huggingface";
95
95
  model: string | null;
96
- prePrompt?: string | undefined;
97
- postPrompt?: string | undefined;
98
96
  temperature?: number | undefined;
99
97
  sleep?: number | undefined;
98
+ prePrompt?: string | undefined;
99
+ postPrompt?: string | undefined;
100
100
  prePromptReplace?: string | undefined;
101
101
  postPromptReplace?: string | undefined;
102
102
  prePromptAppend?: string | undefined;
@@ -123,10 +123,10 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
123
123
  llm: {
124
124
  choice: "gemini" | "anthropic" | "huggingface";
125
125
  model: string | null;
126
- prePrompt?: string | undefined;
127
- postPrompt?: string | undefined;
128
126
  temperature?: number | undefined;
129
127
  sleep?: number | undefined;
128
+ prePrompt?: string | undefined;
129
+ postPrompt?: string | undefined;
130
130
  prePromptReplace?: string | undefined;
131
131
  postPromptReplace?: string | undefined;
132
132
  prePromptAppend?: string | undefined;
@@ -153,10 +153,10 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
153
153
  llm: {
154
154
  choice: "gemini" | "anthropic" | "huggingface";
155
155
  model: string | null;
156
- prePrompt?: string | undefined;
157
- postPrompt?: string | undefined;
158
156
  temperature?: number | undefined;
159
157
  sleep?: number | undefined;
158
+ prePrompt?: string | undefined;
159
+ postPrompt?: string | undefined;
160
160
  prePromptReplace?: string | undefined;
161
161
  postPromptReplace?: string | undefined;
162
162
  prePromptAppend?: string | undefined;
@@ -183,10 +183,10 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
183
183
  llm: {
184
184
  choice: "gemini" | "anthropic" | "huggingface";
185
185
  model: string | null;
186
- prePrompt?: string | undefined;
187
- postPrompt?: string | undefined;
188
186
  temperature?: number | undefined;
189
187
  sleep?: number | undefined;
188
+ prePrompt?: string | undefined;
189
+ postPrompt?: string | undefined;
190
190
  prePromptReplace?: string | undefined;
191
191
  postPromptReplace?: string | undefined;
192
192
  prePromptAppend?: string | undefined;
@@ -3,8 +3,8 @@ import { GringowTranslation, GringowCacheItem } from '../index.mjs';
3
3
  import { llmOptionsSchema } from '../schemas/config.shcema.mjs';
4
4
  import '../config.mjs';
5
5
  import '../constants/default-config.mjs';
6
+ import '../create-cache-id.mjs';
6
7
  import '../data/clear-cache.mjs';
7
- import '../data/create-cache-id.mjs';
8
8
  import '../data/get-cache.mjs';
9
9
  import '../flat-template-string.mjs';
10
10
 
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@gringow/gringow",
3
- "version": "0.1.1",
4
- "main": "./dist/index.js",
3
+ "version": "0.1.3",
4
+ "main": "./dist/index.mjs",
5
5
  "module": "./dist/index.mjs",
6
- "types": "./dist/index.d.ts",
6
+ "types": "./dist/index.d.mts",
7
7
  "exports": {
8
8
  ".": {
9
- "types": "./dist/index.d.ts",
10
- "require": "./dist/index.js",
9
+ "types": "./dist/index.d.mts",
10
+ "require": "./dist/index.mjs",
11
11
  "import": "./dist/index.mjs"
12
12
  },
13
13
  "./flat-template-string": {
14
- "types": "./dist/flat-template-string.d.ts",
15
- "require": "./dist/flat-template-string.js",
14
+ "types": "./dist/flat-template-string.d.mts",
15
+ "require": "./dist/flat-template-string.mjs",
16
16
  "import": "./dist/flat-template-string.mjs"
17
17
  },
18
18
  "./browser": {
19
- "types": "./dist/browser.d.ts",
20
- "require": "./dist/browser.js",
19
+ "types": "./dist/browser.d.mts",
20
+ "require": "./dist/browser.mjs",
21
21
  "import": "./dist/browser.mjs"
22
22
  }
23
23
  },
@@ -70,8 +70,8 @@
70
70
  "@google/generative-ai": "^0.24.1",
71
71
  "@huggingface/transformers": "^3.6.3",
72
72
  "@types/lodash.merge": "^4.6.9",
73
+ "@types/md5": "^2.3.6",
73
74
  "cosmiconfig": "^9.0.0",
74
- "crypto-js": "^4.2.0",
75
75
  "lodash.merge": "^4.6.2",
76
76
  "onnxruntime-node": "1.22.0-rev",
77
77
  "zod": "^3.25.76"
@@ -1,10 +0,0 @@
1
- import CryptoJS from 'crypto-js';
2
-
3
- // src/data/create-cache-id.ts
4
- function createCacheId(text) {
5
- const hexHash = CryptoJS.MD5(text).toString();
6
- const cacheId = `gid_${hexHash}`;
7
- return cacheId;
8
- }
9
-
10
- export { createCacheId };