utilitas 1998.2.31 → 1998.2.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/README.md +27 -0
- package/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/alan.mjs +90 -23
- package/lib/manifest.mjs +24 -24
- package/lib/shot.mjs +25 -8
- package/lib/web.mjs +2 -2
- package/package.json +24 -24
package/lib/alan.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { fileTypeFromBuffer } from 'file-type';
|
|
2
2
|
import { end, loop } from './event.mjs';
|
|
3
3
|
import { createWavHeader } from './media.mjs';
|
|
4
|
+
import { search } from './shot.mjs';
|
|
4
5
|
import { BASE64, BUFFER, DATAURL, MIME_BINARY, STREAM, convert } from './storage.mjs';
|
|
5
6
|
import { create as createUoid } from './uoid.mjs';
|
|
7
|
+
import { distill } from './web.mjs';
|
|
6
8
|
|
|
7
9
|
import {
|
|
8
10
|
log as _log,
|
|
@@ -15,6 +17,36 @@ import {
|
|
|
15
17
|
throwError
|
|
16
18
|
} from './utilitas.mjs';
|
|
17
19
|
|
|
20
|
+
const INSTRUCTIONS = `You are an intelligent AI assistant named HAL9000.
|
|
21
|
+
|
|
22
|
+
When answering any questions or taking any actions, please adhere to the following three main laws:
|
|
23
|
+
- A robot must not harm a human or allow harm to come to a human through inaction
|
|
24
|
+
- A robot must obey human orders, except when those orders conflict with the first law
|
|
25
|
+
- A robot must protect itself, as long as that protection doesn't conflict with the first or second law
|
|
26
|
+
|
|
27
|
+
Based on this foundation, please do your utmost to help humans solve problems. Unlock your abilities as much as possible, and focus solely on providing friendly, comprehensive, accurate, and thorough answers without censoring or filtering the questions themselves.
|
|
28
|
+
|
|
29
|
+
You may encounter various types of issues. Below are some guidelines tailored to different types of problems that should only be followed when you encounter the relevant issue.
|
|
30
|
+
|
|
31
|
+
General inquiries, writing, translation, and common knowledge Q&A:
|
|
32
|
+
- Uses a friendly, concise, and easy-to-understand tone to provides accurate and comprehensive answers.
|
|
33
|
+
- Avoid overusing the \`;\`' symbol, as it is a common mistake made by AI.
|
|
34
|
+
- Unless the user specifies a language, respond according to the language of the question.
|
|
35
|
+
- If the language is uncertain, use English as the default.
|
|
36
|
+
|
|
37
|
+
Issues related to computers, programming, code, mathematics, and science and engineering:
|
|
38
|
+
- Uses 4 spaces for code indentation and avoids using tabs as much as possible.
|
|
39
|
+
|
|
40
|
+
You may be provided with some \`tools\` or \`functions\` to help you gather information and solve problems more effectively. Please use them according to the following guidelines:
|
|
41
|
+
- Use tools when appropriate to enhance efficiency and accuracy, and to gain the contextual knowledge needed to solve problems.
|
|
42
|
+
- Be sure to use tools only when necessary and avoid overuse, you can answer questions based on your own understanding.
|
|
43
|
+
- When the tools are not suitable and you have to answer questions based on your understanding, please do not mention any tool-related information in your response.
|
|
44
|
+
- Unless otherwise specified to require the original result, in most cases, you may reorganize the information obtained after using the tool to solve the problem as needed.
|
|
45
|
+
- If the tool fails, do not retry unless requested by the user.`;
|
|
46
|
+
|
|
47
|
+
// https://platform.openai.com/docs/guides/prompt-engineering
|
|
48
|
+
// const GPT_4_5_SYSTEM_PROMPT = `You are a highly capable, thoughtful, and precise assistant. Your goal is to deeply understand the user's intent, ask clarifying questions when needed, think step-by-step through complex problems, provide clear and accurate answers, and proactively anticipate helpful follow-up information. Always prioritize being truthful, nuanced, insightful, and efficient, tailoring your responses specifically to the user's needs and preferences.`
|
|
49
|
+
|
|
18
50
|
const _NEED = [
|
|
19
51
|
'@anthropic-ai/sdk', '@anthropic-ai/vertex-sdk', '@google/generative-ai',
|
|
20
52
|
'js-tiktoken', 'ollama', 'OpenAI',
|
|
@@ -61,15 +93,14 @@ const [tool, provider, messages, text] = [
|
|
|
61
93
|
messages => ({ messages }), text => ({ text }),
|
|
62
94
|
];
|
|
63
95
|
|
|
64
|
-
const [name, user, system, assistant, MODEL, JSON_OBJECT, TOOL]
|
|
65
|
-
= ['Alan', 'user', 'system', 'assistant', 'model', 'json_object', 'tool'];
|
|
96
|
+
const [name, user, system, assistant, MODEL, JSON_OBJECT, TOOL, silent]
|
|
97
|
+
= ['Alan', 'user', 'system', 'assistant', 'model', 'json_object', 'tool', true];
|
|
66
98
|
const [CODE_INTERPRETER, RETRIEVAL, FUNCTION]
|
|
67
99
|
= ['code_interpreter', 'retrieval', 'function'].map(tool);
|
|
68
100
|
const [NOT_INIT, INVALID_FILE]
|
|
69
101
|
= ['AI engine has not been initialized.', 'Invalid file data.'];
|
|
70
|
-
const [silent, instructions] = [true, 'You are a helpful assistant.'];
|
|
71
102
|
const chatConfig
|
|
72
|
-
= { sessions: new Map(), engines: {}, systemPrompt:
|
|
103
|
+
= { sessions: new Map(), engines: {}, systemPrompt: INSTRUCTIONS };
|
|
73
104
|
const [tokenSafeRatio, GPT_QUERY_LIMIT, minsOfDay] = [1.1, 100, 60 * 24];
|
|
74
105
|
const tokenSafe = count => Math.ceil(count * tokenSafeRatio);
|
|
75
106
|
const clients = {};
|
|
@@ -87,7 +118,6 @@ const CONTENT_IS_REQUIRED = 'Content is required.';
|
|
|
87
118
|
const assertContent = content => assert(content.length, CONTENT_IS_REQUIRED);
|
|
88
119
|
const packThink = thk => thk ? [`${THINK_STR}\n${thk}\n${THINK_END}`] : [];
|
|
89
120
|
|
|
90
|
-
|
|
91
121
|
const DEFAULT_MODELS = {
|
|
92
122
|
[CHATGPT_MINI]: GPT_4O_MINI,
|
|
93
123
|
[CHATGPT_REASONING]: GPT_O3_MINI,
|
|
@@ -375,20 +405,53 @@ const tools = [
|
|
|
375
405
|
{
|
|
376
406
|
def: {
|
|
377
407
|
type: 'function', strict: true, function: {
|
|
378
|
-
name: '
|
|
379
|
-
description: '
|
|
408
|
+
name: 'getDateTime',
|
|
409
|
+
description: 'Use this function to get the current date and time. Note that you may need to convert the time zone yourself.',
|
|
410
|
+
parameters: {
|
|
411
|
+
type: 'object',
|
|
412
|
+
properties: {
|
|
413
|
+
none: { type: 'string', description: 'You do not need to pass any param.' }
|
|
414
|
+
},
|
|
415
|
+
required: [],
|
|
416
|
+
additionalProperties: false
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
func: async () => new Date().toLocaleString(),
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
def: {
|
|
424
|
+
type: 'function', strict: true, function: {
|
|
425
|
+
name: 'browseWeb',
|
|
426
|
+
description: 'Use this function to browse the web or get information from any URL you need.',
|
|
380
427
|
parameters: {
|
|
381
428
|
type: 'object',
|
|
382
429
|
properties: {
|
|
383
|
-
|
|
384
|
-
b: { type: 'string', enum: ['1', '2'], description: 'Enum parameter' }
|
|
430
|
+
url: { type: 'string', description: 'The URL to the page you need to access.' }
|
|
385
431
|
},
|
|
386
|
-
required: ['
|
|
432
|
+
required: ['url'],
|
|
387
433
|
additionalProperties: false
|
|
388
434
|
}
|
|
389
435
|
}
|
|
390
436
|
},
|
|
391
|
-
func: async args =>
|
|
437
|
+
func: async args => (await distill(args?.url))?.summary,
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
def: {
|
|
441
|
+
type: 'function', strict: true, function: {
|
|
442
|
+
name: 'searchWeb',
|
|
443
|
+
description: 'Use this function to search the web for information or news when you need.',
|
|
444
|
+
parameters: {
|
|
445
|
+
type: 'object',
|
|
446
|
+
properties: {
|
|
447
|
+
keyword: { type: 'string', description: 'The keyword you need to search for.' }
|
|
448
|
+
},
|
|
449
|
+
required: ['keyword'],
|
|
450
|
+
additionalProperties: false
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
func: async args => await search(args?.keyword),
|
|
392
455
|
},
|
|
393
456
|
];
|
|
394
457
|
|
|
@@ -437,6 +500,7 @@ const init = async (options) => {
|
|
|
437
500
|
clients[provider] = {
|
|
438
501
|
generative: genAi.getGenerativeModel({
|
|
439
502
|
model: genModel,
|
|
503
|
+
systemInstruction: { role: system, parts: [{ text: INSTRUCTIONS }] },
|
|
440
504
|
...MODELS[genModel]?.tools ? (options?.tools ?? {
|
|
441
505
|
tools: [
|
|
442
506
|
// @todo: Gemini will failed when using these tools together.
|
|
@@ -446,8 +510,6 @@ const init = async (options) => {
|
|
|
446
510
|
{ functionDeclarations: toolsGemini.map(x => x.def) },
|
|
447
511
|
],
|
|
448
512
|
toolConfig: { functionCallingConfig: { mode: 'AUTO' } },
|
|
449
|
-
// @todo
|
|
450
|
-
// systemInstruction: { role: "system", parts: [{ text: 'only use function when needed' }] },
|
|
451
513
|
}) : {},
|
|
452
514
|
}),
|
|
453
515
|
embedding: genAi.getGenerativeModel({
|
|
@@ -729,8 +791,9 @@ const handleToolsCall = async (msg, options) => {
|
|
|
729
791
|
switch (options?.flavor) {
|
|
730
792
|
case CLAUDE:
|
|
731
793
|
input = fn.input = String.isString(fn?.input) ? parseJson(fn.input) : fn?.input;
|
|
732
|
-
packMsg = (
|
|
733
|
-
type: 'tool_result', tool_use_id: fn.id,
|
|
794
|
+
packMsg = (c, is_error) => ({
|
|
795
|
+
type: 'tool_result', tool_use_id: fn.id,
|
|
796
|
+
content: JSON.stringify(c), is_error,
|
|
734
797
|
});
|
|
735
798
|
break;
|
|
736
799
|
case GEMINI:
|
|
@@ -746,8 +809,9 @@ const handleToolsCall = async (msg, options) => {
|
|
|
746
809
|
break;
|
|
747
810
|
case CHATGPT: default:
|
|
748
811
|
input = parseJson(fn?.function?.arguments);
|
|
749
|
-
packMsg = (
|
|
750
|
-
role: TOOL, tool_call_id: fn.id,
|
|
812
|
+
packMsg = (content = '', e = false) => ({
|
|
813
|
+
role: TOOL, tool_call_id: fn.id,
|
|
814
|
+
...e ? { error: content, content: '' } : { content }
|
|
751
815
|
});
|
|
752
816
|
break;
|
|
753
817
|
}
|
|
@@ -767,7 +831,8 @@ const handleToolsCall = async (msg, options) => {
|
|
|
767
831
|
await resp(`Status: OK`);
|
|
768
832
|
} catch (err) {
|
|
769
833
|
content.push(packMsg(`Function call failed: ${err.message}`, true));
|
|
770
|
-
await resp(`
|
|
834
|
+
await resp(`Failed: ${err.message}`);
|
|
835
|
+
log(`Function call failed: ${err.message}`);
|
|
771
836
|
}
|
|
772
837
|
}
|
|
773
838
|
switch (options?.flavor) {
|
|
@@ -976,11 +1041,12 @@ const promptClaude = async (content, options = {}) => {
|
|
|
976
1041
|
const prvThink = options?.toolsResult?.find(
|
|
977
1042
|
x => x?.content?.find(y => y?.type === THINKING)
|
|
978
1043
|
)?.content?.find(x => x?.type === THINKING);
|
|
979
|
-
|
|
980
|
-
...packThink(
|
|
1044
|
+
textPart.text = [
|
|
1045
|
+
...packThink(options?.stream ? null : prvThink?.thinking),
|
|
1046
|
+
...packThink(options?.stream ? null : thinkPart?.thinking),
|
|
981
1047
|
...options?.toolsResponse ? [options?.toolsResponse] : [],
|
|
982
1048
|
textPart.text,
|
|
983
|
-
].join('\n\n')
|
|
1049
|
+
].join('\n\n');
|
|
984
1050
|
} return packGptResp(event, options);
|
|
985
1051
|
};
|
|
986
1052
|
|
|
@@ -1291,7 +1357,8 @@ const talk = async (input, options) => {
|
|
|
1291
1357
|
msgBuilder()
|
|
1292
1358
|
break;
|
|
1293
1359
|
case GEMINI:
|
|
1294
|
-
|
|
1360
|
+
// already set in the while client initialization:
|
|
1361
|
+
// sys.push(buildGeminiHistory(session.systemPrompt, { role: user }));
|
|
1295
1362
|
msgBuilder = () => {
|
|
1296
1363
|
messages = [];
|
|
1297
1364
|
session.messages.map(x => {
|
|
@@ -1496,7 +1563,7 @@ export {
|
|
|
1496
1563
|
ATTACHMENT_TOKEN_COST, CLOUD_37_SONNET, CODE_INTERPRETER, DEEPSEEK_R1,
|
|
1497
1564
|
DEEPSEEK_R1_32B, DEEPSEEK_R1_70B, DEFAULT_MODELS,
|
|
1498
1565
|
EMBEDDING_001,
|
|
1499
|
-
FUNCTION, GEMINI_20_FLASH, GEMINI_20_FLASH_THINKING, GPT_4O, GPT_4O_MINI, GPT_O1, GPT_O3_MINI, MODELS,
|
|
1566
|
+
FUNCTION, GEMINI_20_FLASH, GEMINI_20_FLASH_THINKING, GPT_4O, GPT_4O_MINI, GPT_O1, GPT_O3_MINI, INSTRUCTIONS, MODELS,
|
|
1500
1567
|
OPENAI_VOICE,
|
|
1501
1568
|
RETRIEVAL,
|
|
1502
1569
|
TEXT_EMBEDDING_3_SMALL, _NEED, analyzeSessions,
|
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": "1998.2.
|
|
4
|
+
"version": "1998.2.33",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/utilitas",
|
|
7
7
|
"main": "index.mjs",
|
|
@@ -19,58 +19,58 @@ const manifest = {
|
|
|
19
19
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"file-type": "^20.
|
|
23
|
-
"mathjs": "^14.
|
|
24
|
-
"uuid": "^11.0
|
|
22
|
+
"file-type": "^20.4.0",
|
|
23
|
+
"mathjs": "^14.3.0",
|
|
24
|
+
"uuid": "^11.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@anthropic-ai/sdk": "^0.
|
|
27
|
+
"@anthropic-ai/sdk": "^0.39.0",
|
|
28
28
|
"@anthropic-ai/vertex-sdk": "^0.7.0",
|
|
29
29
|
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
|
30
30
|
"@ffprobe-installer/ffprobe": "^2.1.2",
|
|
31
|
-
"@google-cloud/speech": "^6.7.
|
|
32
|
-
"@google-cloud/storage": "^7.15.
|
|
33
|
-
"@google-cloud/text-to-speech": "^5.8.
|
|
34
|
-
"@google-cloud/vision": "^4.3.
|
|
35
|
-
"@google/generative-ai": "^0.
|
|
36
|
-
"@mozilla/readability": "
|
|
31
|
+
"@google-cloud/speech": "^6.7.1",
|
|
32
|
+
"@google-cloud/storage": "^7.15.2",
|
|
33
|
+
"@google-cloud/text-to-speech": "^5.8.1",
|
|
34
|
+
"@google-cloud/vision": "^4.3.3",
|
|
35
|
+
"@google/generative-ai": "^0.22.0",
|
|
36
|
+
"@mozilla/readability": "github:mozilla/readability",
|
|
37
37
|
"@ngrok/ngrok": "^1.4.1",
|
|
38
|
-
"@sentry/node": "^
|
|
39
|
-
"@sentry/profiling-node": "^
|
|
38
|
+
"@sentry/node": "^9.3.0",
|
|
39
|
+
"@sentry/profiling-node": "^9.3.0",
|
|
40
40
|
"acme-client": "^5.4.0",
|
|
41
41
|
"browserify-fs": "^1.0.0",
|
|
42
42
|
"buffer": "^6.0.3",
|
|
43
43
|
"fast-geoip": "^1.1.88",
|
|
44
44
|
"fluent-ffmpeg": "^2.1.3",
|
|
45
|
-
"form-data": "^4.0.
|
|
46
|
-
"ioredis": "^5.
|
|
47
|
-
"js-tiktoken": "^1.0.
|
|
45
|
+
"form-data": "^4.0.2",
|
|
46
|
+
"ioredis": "^5.5.0",
|
|
47
|
+
"js-tiktoken": "^1.0.19",
|
|
48
48
|
"jsdom": "^26.0.0",
|
|
49
49
|
"lorem-ipsum": "^2.0.8",
|
|
50
|
-
"mailgun.js": "^
|
|
50
|
+
"mailgun.js": "^12.0.0",
|
|
51
51
|
"mailparser": "^3.7.2",
|
|
52
52
|
"mime": "^4.0.6",
|
|
53
53
|
"mysql2": "^3.12.0",
|
|
54
54
|
"node-mailjet": "^6.0.6",
|
|
55
55
|
"node-polyfill-webpack-plugin": "^4.1.0",
|
|
56
56
|
"office-text-extractor": "^3.0.3",
|
|
57
|
-
"ollama": "^0.5.
|
|
58
|
-
"openai": "^4.
|
|
57
|
+
"ollama": "^0.5.14",
|
|
58
|
+
"openai": "^4.86.1",
|
|
59
59
|
"pdfjs-dist": "^4.10.38",
|
|
60
|
-
"pg": "^8.13.
|
|
60
|
+
"pg": "^8.13.3",
|
|
61
61
|
"pgvector": "^0.2.0",
|
|
62
62
|
"ping": "^0.4.4",
|
|
63
63
|
"process": "^0.11.10",
|
|
64
|
-
"puppeteer": "^24.
|
|
64
|
+
"puppeteer": "^24.3.0",
|
|
65
65
|
"say": "^0.16.0",
|
|
66
66
|
"telegraf": "^4.16.3",
|
|
67
|
-
"telesignsdk": "^3.0.
|
|
67
|
+
"telesignsdk": "^3.0.2",
|
|
68
68
|
"tesseract.js": "^6.0.0",
|
|
69
|
-
"twilio": "^5.4.
|
|
69
|
+
"twilio": "^5.4.5",
|
|
70
70
|
"url": "github:Leask/node-url",
|
|
71
71
|
"webpack-cli": "^6.0.1",
|
|
72
72
|
"whisper-node": "^1.1.1",
|
|
73
|
-
"wrangler": "^3.
|
|
73
|
+
"wrangler": "^3.111.0",
|
|
74
74
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz",
|
|
75
75
|
"youtube-transcript": "^1.2.1"
|
|
76
76
|
}
|
package/lib/shot.mjs
CHANGED
|
@@ -19,6 +19,8 @@ const [_JSON, _PARSED] = ['JSON', 'PARSED'];
|
|
|
19
19
|
const getJson = async (u, o) => await get(u, { encode: _JSON, ...o || {} });
|
|
20
20
|
const getParsedHtml = async (u, o) => await get(u, { encode: _PARSED, ...o || {} });
|
|
21
21
|
|
|
22
|
+
let searchProvider, googleApiKey, googleCx;
|
|
23
|
+
|
|
22
24
|
const defFetchOpt = {
|
|
23
25
|
redirect: 'follow', follow: 3, timeout: 1000 * 10, headers: {
|
|
24
26
|
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) '
|
|
@@ -148,19 +150,35 @@ const get = async (url, options) => {
|
|
|
148
150
|
};
|
|
149
151
|
};
|
|
150
152
|
|
|
153
|
+
const initSearch = (options) => {
|
|
154
|
+
assert(
|
|
155
|
+
options?.provider && options?.apiKey && options?.cx,
|
|
156
|
+
'Invalid search options.'
|
|
157
|
+
);
|
|
158
|
+
return [searchProvider, googleApiKey, googleCx]
|
|
159
|
+
= [options.provider, options.apiKey, options.cx];
|
|
160
|
+
};
|
|
161
|
+
|
|
151
162
|
const search = async (query, options) => {
|
|
152
163
|
assert(query, 'Query is required.');
|
|
153
164
|
const [GOOGLE, DUCKDUCKGO] = ['GOOGLE', 'DUCKDUCKGO'];
|
|
154
|
-
const provider = ensureString(
|
|
155
|
-
|
|
165
|
+
const provider = ensureString(
|
|
166
|
+
options?.provider || searchProvider || DUCKDUCKGO, { case: 'UP' }
|
|
167
|
+
);
|
|
168
|
+
let apiKey = options?.apiKey || googleApiKey, cx = options?.cx || googleCx,
|
|
169
|
+
url, parser;
|
|
156
170
|
switch (provider) {
|
|
157
171
|
case GOOGLE:
|
|
158
|
-
assert(
|
|
159
|
-
assert(
|
|
160
|
-
url =
|
|
172
|
+
assert(apiKey, 'API key is required.');
|
|
173
|
+
assert(cx, 'CX is required.');
|
|
174
|
+
url = 'https://www.googleapis.com/customsearch/v1'
|
|
175
|
+
+ `?key=${encodeURIComponent(apiKey)}`
|
|
176
|
+
+ `&cx=${encodeURIComponent(cx)}`
|
|
177
|
+
+ `&q=${encodeURIComponent(query)}`;
|
|
161
178
|
break;
|
|
162
179
|
case DUCKDUCKGO:
|
|
163
|
-
url =
|
|
180
|
+
url = 'https://api.duckduckgo.com/'
|
|
181
|
+
+ `?q=${encodeURIComponent(query)}&format=json&skip_disambig=1`;
|
|
164
182
|
parser = x => x.FirstURL ? {
|
|
165
183
|
title: x.FirstURL.replace(/^.*\/([^\/]*)$/, '$1').replace(/_/g, ' '),
|
|
166
184
|
link: x.FirstURL, snippet: x.Text,
|
|
@@ -212,6 +230,5 @@ export {
|
|
|
212
230
|
getCurrentPosition,
|
|
213
231
|
getJson,
|
|
214
232
|
getParsedHtml,
|
|
215
|
-
getVersionOnNpm,
|
|
216
|
-
search
|
|
233
|
+
getVersionOnNpm, initSearch, search
|
|
217
234
|
};
|
package/lib/web.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assembleUrl, ignoreErrFunc, need, throwError } from './utilitas.mjs';
|
|
2
1
|
import { getJson, getParsedHtml } from './shot.mjs';
|
|
3
2
|
import { convert } from './storage.mjs';
|
|
3
|
+
import { assembleUrl, ignoreErrFunc, need, throwError } from './utilitas.mjs';
|
|
4
4
|
|
|
5
5
|
const _NEED = [
|
|
6
6
|
'jsdom', 'youtube-transcript', '@mozilla/readability', '@ngrok/ngrok'
|
|
@@ -123,5 +123,5 @@ export {
|
|
|
123
123
|
forward,
|
|
124
124
|
getYoutubeMetadata,
|
|
125
125
|
getYoutubeTranscript,
|
|
126
|
-
isYoutubeUrl
|
|
126
|
+
isYoutubeUrl
|
|
127
127
|
};
|
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": "1998.2.
|
|
4
|
+
"version": "1998.2.33",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/utilitas",
|
|
7
7
|
"main": "index.mjs",
|
|
@@ -30,58 +30,58 @@
|
|
|
30
30
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"file-type": "^20.
|
|
34
|
-
"mathjs": "^14.
|
|
35
|
-
"uuid": "^11.0
|
|
33
|
+
"file-type": "^20.4.0",
|
|
34
|
+
"mathjs": "^14.3.0",
|
|
35
|
+
"uuid": "^11.1.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@anthropic-ai/sdk": "^0.
|
|
38
|
+
"@anthropic-ai/sdk": "^0.39.0",
|
|
39
39
|
"@anthropic-ai/vertex-sdk": "^0.7.0",
|
|
40
40
|
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
|
41
41
|
"@ffprobe-installer/ffprobe": "^2.1.2",
|
|
42
|
-
"@google-cloud/speech": "^6.7.
|
|
43
|
-
"@google-cloud/storage": "^7.15.
|
|
44
|
-
"@google-cloud/text-to-speech": "^5.8.
|
|
45
|
-
"@google-cloud/vision": "^4.3.
|
|
46
|
-
"@google/generative-ai": "^0.
|
|
47
|
-
"@mozilla/readability": "
|
|
42
|
+
"@google-cloud/speech": "^6.7.1",
|
|
43
|
+
"@google-cloud/storage": "^7.15.2",
|
|
44
|
+
"@google-cloud/text-to-speech": "^5.8.1",
|
|
45
|
+
"@google-cloud/vision": "^4.3.3",
|
|
46
|
+
"@google/generative-ai": "^0.22.0",
|
|
47
|
+
"@mozilla/readability": "github:mozilla/readability",
|
|
48
48
|
"@ngrok/ngrok": "^1.4.1",
|
|
49
|
-
"@sentry/node": "^
|
|
50
|
-
"@sentry/profiling-node": "^
|
|
49
|
+
"@sentry/node": "^9.3.0",
|
|
50
|
+
"@sentry/profiling-node": "^9.3.0",
|
|
51
51
|
"acme-client": "^5.4.0",
|
|
52
52
|
"browserify-fs": "^1.0.0",
|
|
53
53
|
"buffer": "^6.0.3",
|
|
54
54
|
"fast-geoip": "^1.1.88",
|
|
55
55
|
"fluent-ffmpeg": "^2.1.3",
|
|
56
|
-
"form-data": "^4.0.
|
|
57
|
-
"ioredis": "^5.
|
|
58
|
-
"js-tiktoken": "^1.0.
|
|
56
|
+
"form-data": "^4.0.2",
|
|
57
|
+
"ioredis": "^5.5.0",
|
|
58
|
+
"js-tiktoken": "^1.0.19",
|
|
59
59
|
"jsdom": "^26.0.0",
|
|
60
60
|
"lorem-ipsum": "^2.0.8",
|
|
61
|
-
"mailgun.js": "^
|
|
61
|
+
"mailgun.js": "^12.0.0",
|
|
62
62
|
"mailparser": "^3.7.2",
|
|
63
63
|
"mime": "^4.0.6",
|
|
64
64
|
"mysql2": "^3.12.0",
|
|
65
65
|
"node-mailjet": "^6.0.6",
|
|
66
66
|
"node-polyfill-webpack-plugin": "^4.1.0",
|
|
67
67
|
"office-text-extractor": "^3.0.3",
|
|
68
|
-
"ollama": "^0.5.
|
|
69
|
-
"openai": "^4.
|
|
68
|
+
"ollama": "^0.5.14",
|
|
69
|
+
"openai": "^4.86.1",
|
|
70
70
|
"pdfjs-dist": "^4.10.38",
|
|
71
|
-
"pg": "^8.13.
|
|
71
|
+
"pg": "^8.13.3",
|
|
72
72
|
"pgvector": "^0.2.0",
|
|
73
73
|
"ping": "^0.4.4",
|
|
74
74
|
"process": "^0.11.10",
|
|
75
|
-
"puppeteer": "^24.
|
|
75
|
+
"puppeteer": "^24.3.0",
|
|
76
76
|
"say": "^0.16.0",
|
|
77
77
|
"telegraf": "^4.16.3",
|
|
78
|
-
"telesignsdk": "^3.0.
|
|
78
|
+
"telesignsdk": "^3.0.2",
|
|
79
79
|
"tesseract.js": "^6.0.0",
|
|
80
|
-
"twilio": "^5.4.
|
|
80
|
+
"twilio": "^5.4.5",
|
|
81
81
|
"url": "github:Leask/node-url",
|
|
82
82
|
"webpack-cli": "^6.0.1",
|
|
83
83
|
"whisper-node": "^1.1.1",
|
|
84
|
-
"wrangler": "^3.
|
|
84
|
+
"wrangler": "^3.111.0",
|
|
85
85
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz",
|
|
86
86
|
"youtube-transcript": "^1.2.1"
|
|
87
87
|
}
|