utilitas 1999.1.89 → 1999.1.91

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/lib/alan.mjs CHANGED
@@ -58,27 +58,27 @@ const [
58
58
  v8k, ais, MAX_TOOL_RECURSION, LOG, name, user, system, assistant, MODEL,
59
59
  JSON_OBJECT, TOOL, silent, GEMINI_EMBEDDING_M, INVALID_FILE, tokenSafeRatio,
60
60
  GPT_QUERY_LIMIT, CONTENT_IS_REQUIRED, OPENAI_HI_RES_SIZE, k, kT, m,
61
- minute, hour, gb, trimTailing, EBD, GEMINI_20_FLASH, IMAGE, JINA,
61
+ minute, hour, gb, trimTailing, EBD, GEMINI_25_FLASH_IMAGE, IMAGE, JINA,
62
62
  JINA_DEEPSEARCH, JINA_CLIP, VERTEX, GEMINI_25_PRO, SILICONFLOW,
63
63
  SF_DEEPSEEK_R1, MAX_TIRE,
64
64
  ] = [
65
- 'OpenAI', 'Gemini', 'OPENAI_TRAINING', 'Ollama', 'gemini-2.5-flash',
66
- 'nova', 'deepseek-r1', '```', 'text-embedding-3-small',
67
- 'text-embedding-3-large', 'claude-opus-4-1@20250805', 'audio', 'wav',
68
- '[ATTACHMENTS]', 'CHAT', 'OPENAI_VOICE', 'medium', 'low', 'high',
69
- 'medium', 'think', '<think>', '</think>', 'AZURE', '<tools>',
70
- '</tools>', 'tools', 'text', 'thinking', 'OK', 'function', 'gpt-5',
71
- 'gpt-5-mini', 'redacted_thinking', 'gemma3:27b', 'Azure Openai',
72
- 'Anthropic', 'Vertex Anthropic', 7680 * 4320, [], 30, { log: true },
73
- 'Alan', 'user', 'system', 'assistant', 'model', 'json_object', 'tool',
74
- true, 'gemini-embedding-001', 'Invalid file data.', 1.1, 100,
65
+ 'OpenAI', 'Gemini', 'OPENAI_TRAINING', 'Ollama',
66
+ 'gemini-2.5-flash-preview-09-2025', 'nova', 'deepseek-r1', '```',
67
+ 'text-embedding-3-small', 'text-embedding-3-large',
68
+ 'claude-opus-4-1@20250805', 'audio', 'wav', '[ATTACHMENTS]', 'CHAT',
69
+ 'OPENAI_VOICE', 'medium', 'low', 'high', 'medium', 'think', '<think>',
70
+ '</think>', 'AZURE', '<tools>', '</tools>', 'tools', 'text', 'thinking',
71
+ 'OK', 'function', 'gpt-5', 'gpt-5-mini', 'redacted_thinking',
72
+ 'gemma3:27b', 'Azure Openai', 'Anthropic', 'Vertex Anthropic',
73
+ 7680 * 4320, [], 30, { log: true }, 'Alan', 'user', 'system',
74
+ 'assistant', 'model', 'json_object', 'tool', true,
75
+ 'gemini-embedding-001', 'Invalid file data.', 1.1, 100,
75
76
  'Content is required.', 2048 * 2048, x => 1024 * x, x => 1000 * x,
76
77
  x => 1024 * 1024 * x, x => 60 * x, x => 60 * 60 * x,
77
78
  x => 1024 * 1024 * 1024 * x, x => x.replace(/[\.\s]*$/, ''),
78
- { embedding: true }, 'gemini-2.0-flash-preview-image-generation',
79
- 'image', 'Jina', 'jina-deepsearch-v1', 'jina-clip-v2', 'Vertex',
80
- 'gemini-2.5-pro', 'SiliconFlow', 'Pro/deepseek-ai/DeepSeek-R1',
81
- 768 * 768,
79
+ { embedding: true }, 'gemini-2.5-flash-image', 'image', 'Jina',
80
+ 'jina-deepsearch-v1', 'jina-clip-v2', 'Vertex', 'gemini-2.5-pro',
81
+ 'SiliconFlow', 'Pro/deepseek-ai/DeepSeek-R1', 768 * 768,
82
82
  ];
83
83
 
84
84
  const [tool, messages, text]
@@ -113,8 +113,7 @@ const OPENAI_RULES = {
113
113
  };
114
114
 
115
115
  const GEMINI_RULES = {
116
- contextWindow: m(1), json: true,
117
- audioCostTokens: 1000 * 1000 * 1, // 8.4 hours => 1 million tokens
116
+ json: true, audioCostTokens: 1000 * 1000 * 1, // 8.4 hours => 1 million tokens
118
117
  imageCostTokens: ~~(v8k / MAX_TIRE * 258), maxAudioLength: hour(8.4),
119
118
  maxAudioPerPrompt: 1, maxFileSize: m(20), maxImagePerPrompt: 3000,
120
119
  maxImageSize: Infinity, maxUrlSize: gb(2), maxVideoLength: minute(45),
@@ -124,9 +123,9 @@ const GEMINI_RULES = {
124
123
  MIME_MP3, MIME_MPEGA, MIME_M4A, MIME_MPGA, MIME_OPUS, MIME_PCM,
125
124
  MIME_WAV, MIME_WEBM, MIME_TGPP,
126
125
  ], supportedAudioTypes: [MIME_WAV, MIME_OGG, MIME_OPUS],
127
- audio: 'gemini-2.5-flash-exp-native-audio-thinking-dialog',
128
- defaultProvider: GEMINI,
126
+ // audio: 'gemini-2.5-flash-exp-native-audio-thinking-dialog',
129
127
  // gemini-2.5-flash-preview-native-audio-dialog
128
+ defaultProvider: GEMINI,
130
129
  };
131
130
 
132
131
  const DEEPSEEK_R1_RULES = {
@@ -139,16 +138,16 @@ const DEEPSEEK_R1_RULES = {
139
138
  const MODELS = {
140
139
  [GPT_5]: { ...OPENAI_RULES, },
141
140
  [GPT_5_MINI]: { ...OPENAI_RULES, fast: true },
142
- [GEMINI_20_FLASH]: {
143
- ...GEMINI_RULES, maxOutputTokens: k(8),
144
- fast: true, image: true, tools: false,
141
+ [GEMINI_25_FLASH_IMAGE]: {
142
+ ...GEMINI_RULES, contextWindow: k(64), maxOutputTokens: k(32),
143
+ fast: true, image: true,
145
144
  },
146
145
  [GEMINI_25_FLASH]: {
147
- ...GEMINI_RULES, maxOutputTokens: k(64),
146
+ ...GEMINI_RULES, contextWindow: m(1), maxOutputTokens: k(64),
148
147
  fast: true, reasoning: true, tools: true,
149
148
  },
150
149
  [GEMINI_25_PRO]: {
151
- ...GEMINI_RULES, maxOutputTokens: k(64),
150
+ ...GEMINI_RULES, contextWindow: m(1), maxOutputTokens: k(64),
152
151
  reasoning: true, tools: true,
153
152
  },
154
153
  [GEMMA_3_27B]: {
@@ -840,7 +839,8 @@ const buildPrompts = async (model, input, options = {}) => {
840
839
  break;
841
840
  case GEMINI:
842
841
  const _role = {
843
- role: [GEMINI_20_FLASH].includes(options.model) ? user : system
842
+ role: [GEMINI_25_FLASH_IMAGE].includes(options.model)
843
+ ? user : system
844
844
  };
845
845
  systemPrompt = buildGeminiHistory(options.systemPrompt, _role);
846
846
  break;
@@ -907,7 +907,7 @@ const buildPrompts = async (model, input, options = {}) => {
907
907
  } // @todo: audioCostTokens (needs to calculate the audio length):
908
908
  }, model.maxInputTokens - options.attachments?.length * model.imageCostTokens);
909
909
  if ([OPENAI].includes(options.flavor)
910
- || [GEMINI_20_FLASH].includes(options.model)) {
910
+ || [GEMINI_25_FLASH_IMAGE].includes(options.model)) {
911
911
  systemPrompt = null;
912
912
  }
913
913
  return { systemPrompt, history, prompt };
@@ -1221,7 +1221,7 @@ const promptGemini = async (aiId, content, options = {}) => {
1221
1221
  thinkingConfig: { includeThoughts: true },
1222
1222
  } : {}, systemInstruction, responseModalities,
1223
1223
  ...options?.config || {}, ...model?.tools && !options.jsonMode
1224
- && ![GEMINI_20_FLASH].includes(options.model)
1224
+ && ![GEMINI_25_FLASH_IMAGE].includes(options.model)
1225
1225
  ? (options.tools ?? {
1226
1226
  tools: [
1227
1227
  // @todo: Gemini will failed when using these tools together.
@@ -1593,8 +1593,8 @@ export {
1593
1593
  DEFAULT_MODELS,
1594
1594
  FEATURE_ICONS,
1595
1595
  FUNCTION,
1596
- GEMINI_20_FLASH,
1597
1596
  GEMINI_25_FLASH,
1597
+ GEMINI_25_FLASH_IMAGE,
1598
1598
  GPT_5,
1599
1599
  INSTRUCTIONS,
1600
1600
  MODELS,
package/lib/gen.mjs CHANGED
@@ -14,7 +14,7 @@ const [
14
14
  ] = [
15
15
  {}, 'OPENAI', 'GEMINI', 'BASE64', 'FILE', 'BUFFER',
16
16
  'Error generating media.', 'imagen-4.0-ultra-generate-001',
17
- 'gpt-image-1', 'veo-3.0-generate-preview',
17
+ 'gpt-image-1', 'veo-3.1-generate-preview',
18
18
  ];
19
19
 
20
20
  const init = async (options) => {
package/lib/manifest.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const manifest = {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1999.1.89",
4
+ "version": "1999.1.91",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
@@ -20,54 +20,54 @@ const manifest = {
20
20
  },
21
21
  "dependencies": {
22
22
  "file-type": "^21.0.0",
23
- "mathjs": "^14.5.2",
23
+ "mathjs": "^14.6.0",
24
24
  "uuid": "^11.1.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@anthropic-ai/sdk": "^0.54.0",
28
- "@anthropic-ai/vertex-sdk": "^0.11.4",
27
+ "@anthropic-ai/sdk": "^0.60.0",
28
+ "@anthropic-ai/vertex-sdk": "^0.13.1",
29
29
  "@ffmpeg-installer/ffmpeg": "^1.1.0",
30
30
  "@ffprobe-installer/ffprobe": "^2.1.2",
31
- "@google-cloud/speech": "^7.1.0",
32
- "@google-cloud/storage": "^7.16.0",
33
- "@google-cloud/vision": "^5.2.0",
34
- "@google/genai": "^1.5.1",
31
+ "@google-cloud/speech": "^7.2.0",
32
+ "@google-cloud/storage": "^7.17.0",
33
+ "@google-cloud/vision": "^5.3.3",
34
+ "@google/genai": "^1.16.0",
35
35
  "@mozilla/readability": "github:mozilla/readability",
36
- "@sentry/node": "^9.30.0",
37
- "@sentry/profiling-node": "^9.30.0",
36
+ "@sentry/node": "^10.7.0",
37
+ "@sentry/profiling-node": "^10.7.0",
38
38
  "acme-client": "^5.4.0",
39
39
  "browserify-fs": "^1.0.0",
40
40
  "buffer": "^6.0.3",
41
41
  "fast-geoip": "^1.1.88",
42
42
  "fluent-ffmpeg": "^2.1.3",
43
- "form-data": "^4.0.3",
44
- "ioredis": "^5.6.1",
45
- "js-tiktoken": "^1.0.20",
43
+ "form-data": "^4.0.4",
44
+ "ioredis": "^5.7.0",
45
+ "js-tiktoken": "^1.0.21",
46
46
  "jsdom": "^26.1.0",
47
47
  "lorem-ipsum": "^2.0.8",
48
48
  "mailgun.js": "^12.0.3",
49
- "mailparser": "^3.7.3",
49
+ "mailparser": "^3.7.4",
50
50
  "mime": "^4.0.7",
51
- "mysql2": "^3.14.1",
52
- "node-mailjet": "^6.0.8",
51
+ "mysql2": "^3.14.3",
52
+ "node-mailjet": "^6.0.9",
53
53
  "node-polyfill-webpack-plugin": "^4.1.0",
54
54
  "office-text-extractor": "^3.0.3",
55
- "openai": "^5.5.1",
56
- "pdfjs-dist": "^5.3.31",
57
- "pg": "^8.16.2",
55
+ "openai": "^5.16.0",
56
+ "pdfjs-dist": "^5.4.54",
57
+ "pg": "^8.16.3",
58
58
  "pgvector": "^0.2.1",
59
59
  "ping": "^0.4.4",
60
60
  "process": "^0.11.10",
61
- "puppeteer": "^24.10.2",
61
+ "puppeteer": "^24.17.1",
62
62
  "say": "^0.16.0",
63
63
  "telegraf": "^4.16.3",
64
64
  "telesignsdk": "^3.0.4",
65
65
  "tesseract.js": "^6.0.1",
66
- "twilio": "^5.7.1",
66
+ "twilio": "^5.8.2",
67
67
  "url": "github:Leask/node-url",
68
68
  "webpack-cli": "^6.0.1",
69
69
  "whisper-node": "^1.1.1",
70
- "wrangler": "^4.20.5",
70
+ "wrangler": "^4.33.1",
71
71
  "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz",
72
72
  "youtube-transcript": "^1.2.1"
73
73
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1999.1.89",
4
+ "version": "1999.1.91",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
@@ -31,54 +31,54 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "file-type": "^21.0.0",
34
- "mathjs": "^14.5.2",
34
+ "mathjs": "^14.6.0",
35
35
  "uuid": "^11.1.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@anthropic-ai/sdk": "^0.54.0",
39
- "@anthropic-ai/vertex-sdk": "^0.11.4",
38
+ "@anthropic-ai/sdk": "^0.60.0",
39
+ "@anthropic-ai/vertex-sdk": "^0.13.1",
40
40
  "@ffmpeg-installer/ffmpeg": "^1.1.0",
41
41
  "@ffprobe-installer/ffprobe": "^2.1.2",
42
- "@google-cloud/speech": "^7.1.0",
43
- "@google-cloud/storage": "^7.16.0",
44
- "@google-cloud/vision": "^5.2.0",
45
- "@google/genai": "^1.5.1",
42
+ "@google-cloud/speech": "^7.2.0",
43
+ "@google-cloud/storage": "^7.17.0",
44
+ "@google-cloud/vision": "^5.3.3",
45
+ "@google/genai": "^1.16.0",
46
46
  "@mozilla/readability": "github:mozilla/readability",
47
- "@sentry/node": "^9.30.0",
48
- "@sentry/profiling-node": "^9.30.0",
47
+ "@sentry/node": "^10.7.0",
48
+ "@sentry/profiling-node": "^10.7.0",
49
49
  "acme-client": "^5.4.0",
50
50
  "browserify-fs": "^1.0.0",
51
51
  "buffer": "^6.0.3",
52
52
  "fast-geoip": "^1.1.88",
53
53
  "fluent-ffmpeg": "^2.1.3",
54
- "form-data": "^4.0.3",
55
- "ioredis": "^5.6.1",
56
- "js-tiktoken": "^1.0.20",
54
+ "form-data": "^4.0.4",
55
+ "ioredis": "^5.7.0",
56
+ "js-tiktoken": "^1.0.21",
57
57
  "jsdom": "^26.1.0",
58
58
  "lorem-ipsum": "^2.0.8",
59
59
  "mailgun.js": "^12.0.3",
60
- "mailparser": "^3.7.3",
60
+ "mailparser": "^3.7.4",
61
61
  "mime": "^4.0.7",
62
- "mysql2": "^3.14.1",
63
- "node-mailjet": "^6.0.8",
62
+ "mysql2": "^3.14.3",
63
+ "node-mailjet": "^6.0.9",
64
64
  "node-polyfill-webpack-plugin": "^4.1.0",
65
65
  "office-text-extractor": "^3.0.3",
66
- "openai": "^5.5.1",
67
- "pdfjs-dist": "^5.3.31",
68
- "pg": "^8.16.2",
66
+ "openai": "^5.16.0",
67
+ "pdfjs-dist": "^5.4.54",
68
+ "pg": "^8.16.3",
69
69
  "pgvector": "^0.2.1",
70
70
  "ping": "^0.4.4",
71
71
  "process": "^0.11.10",
72
- "puppeteer": "^24.10.2",
72
+ "puppeteer": "^24.17.1",
73
73
  "say": "^0.16.0",
74
74
  "telegraf": "^4.16.3",
75
75
  "telesignsdk": "^3.0.4",
76
76
  "tesseract.js": "^6.0.1",
77
- "twilio": "^5.7.1",
77
+ "twilio": "^5.8.2",
78
78
  "url": "github:Leask/node-url",
79
79
  "webpack-cli": "^6.0.1",
80
80
  "whisper-node": "^1.1.1",
81
- "wrangler": "^4.20.5",
81
+ "wrangler": "^4.33.1",
82
82
  "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz",
83
83
  "youtube-transcript": "^1.2.1"
84
84
  }