@intuned/browser-dev 0.1.6-dev.1 → 0.1.8-dev.0
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/ai/export.d.ts +11 -160
- package/dist/ai/extractStructuredData.js +4 -4
- package/dist/ai/index.d.ts +11 -160
- package/dist/ai/tests/testExtractFromContent.spec.js +2 -2
- package/dist/ai/tests/testIsPageLoaded.spec.js +2 -2
- package/dist/ai/validators.js +2 -3
- package/dist/helpers/export.d.ts +4 -5
- package/dist/helpers/frame_utils/tests/testFindAllIframes.spec.js +2 -2
- package/dist/helpers/gotoUrl.js +51 -51
- package/dist/helpers/index.d.ts +4 -5
- package/dist/helpers/tests/testClickUntilExhausted.spec.js +4 -3
- package/dist/helpers/tests/testDownloadFile.spec.js +3 -3
- package/dist/helpers/tests/testGoToUrl.spec.js +2 -2
- package/dist/helpers/tests/testScrollToLoadContent.spec.js +2 -2
- package/dist/helpers/tests/testWithDomSettledWait.spec.js +2 -2
- package/dist/{common → optimized-extractors/common}/aiModelsValidations.js +4 -2
- package/dist/optimized-extractors/common/extractStructuredDataUsingClaude.js +1 -1
- package/dist/optimized-extractors/common/extractStructuredDataUsingGoogle.js +1 -1
- package/dist/optimized-extractors/common/extractStructuredDataUsingOpenAi.js +1 -1
- package/dist/optimized-extractors/export.d.ts +1 -1
- package/dist/optimized-extractors/index.d.ts +1 -1
- package/dist/optimized-extractors/types/aiModelsValidation.js +3 -1
- package/package.json +4 -3
- package/dist/ai/types/models.js +0 -42
- package/generated-docs/ai/functions/extractStructuredData.mdx +0 -255
- package/generated-docs/ai/functions/isPageLoaded.mdx +0 -89
- package/generated-docs/ai/interfaces/ArraySchema.mdx +0 -36
- package/generated-docs/ai/interfaces/BasicSchema.mdx +0 -14
- package/generated-docs/ai/interfaces/BooleanSchema.mdx +0 -28
- package/generated-docs/ai/interfaces/ImageBufferContentItem.mdx +0 -16
- package/generated-docs/ai/interfaces/ImageUrlContentItem.mdx +0 -16
- package/generated-docs/ai/interfaces/NumberSchema.mdx +0 -35
- package/generated-docs/ai/interfaces/ObjectSchema.mdx +0 -39
- package/generated-docs/ai/interfaces/StringSchema.mdx +0 -35
- package/generated-docs/ai/interfaces/TextContentItem.mdx +0 -14
- package/generated-docs/ai/type-aliases/ContentItem.mdx +0 -12
- package/generated-docs/ai/type-aliases/JsonSchema.mdx +0 -47
- package/generated-docs/ai/type-aliases/SUPPORTED_MODELS.mdx +0 -85
- package/generated-docs/helpers/functions/clickButtonAndWait.mdx +0 -63
- package/generated-docs/helpers/functions/clickUntilExhausted.mdx +0 -112
- package/generated-docs/helpers/functions/downloadFile.mdx +0 -99
- package/generated-docs/helpers/functions/extractMarkdown.mdx +0 -56
- package/generated-docs/helpers/functions/filterEmptyValues.mdx +0 -51
- package/generated-docs/helpers/functions/goToUrl.mdx +0 -124
- package/generated-docs/helpers/functions/processDate.mdx +0 -55
- package/generated-docs/helpers/functions/resolveUrl.mdx +0 -165
- package/generated-docs/helpers/functions/sanitizeHtml.mdx +0 -113
- package/generated-docs/helpers/functions/saveFileToS3.mdx +0 -127
- package/generated-docs/helpers/functions/scrollToLoadContent.mdx +0 -83
- package/generated-docs/helpers/functions/uploadFileToS3.mdx +0 -121
- package/generated-docs/helpers/functions/validateDataUsingSchema.mdx +0 -90
- package/generated-docs/helpers/functions/waitForDomSettled.mdx +0 -91
- package/generated-docs/helpers/functions/withNetworkSettledWait.mdx +0 -76
- package/generated-docs/helpers/interfaces/Attachment.mdx +0 -56
- package/generated-docs/helpers/interfaces/S3Configs.mdx +0 -52
- package/generated-docs/helpers/interfaces/SanitizeHtmlOptions.mdx +0 -22
- package/generated-docs/helpers/type-aliases/AttachmentType.mdx +0 -10
- package/generated-docs/helpers/type-aliases/FileType.mdx +0 -61
- package/generated-docs/helpers/type-aliases/Trigger.mdx +0 -62
package/dist/helpers/gotoUrl.js
CHANGED
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.goToUrl = void 0;
|
|
7
7
|
var _promises = require("timers/promises");
|
|
8
8
|
var _asyncRetry = _interopRequireDefault(require("async-retry"));
|
|
9
|
-
var
|
|
9
|
+
var _playwright = require("playwright");
|
|
10
10
|
var _isPageLoaded = require("../ai/isPageLoaded");
|
|
11
11
|
var _Logger = require("../common/Logger");
|
|
12
|
-
var
|
|
12
|
+
var _withNetworkSettledWait = require("./withNetworkSettledWait");
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
const DEFAULT_PLAYWRIGHT_TIMEOUT = 30000;
|
|
15
15
|
const TIMEOUT_PADDING = 3000;
|
|
@@ -17,7 +17,7 @@ const goToUrl = async input => {
|
|
|
17
17
|
const {
|
|
18
18
|
page,
|
|
19
19
|
url,
|
|
20
|
-
throwOnTimeout =
|
|
20
|
+
throwOnTimeout = false,
|
|
21
21
|
waitForLoadingStateUsingAi = false,
|
|
22
22
|
retries = 3,
|
|
23
23
|
model = "gpt-5-mini-2025-08-07",
|
|
@@ -28,62 +28,62 @@ const goToUrl = async input => {
|
|
|
28
28
|
const timeoutInMs = getPageGotoTimeout(page, {
|
|
29
29
|
timeoutInMs: input.timeoutInMs
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
return await (0, _withNetworkSettledWait.withNetworkSettledWait)(async () => {
|
|
32
|
+
let responseOrTimeout;
|
|
33
|
+
try {
|
|
34
|
+
await (0, _asyncRetry.default)(async () => {
|
|
35
|
+
const promises = [page.goto(url, {
|
|
36
|
+
waitUntil: waitForLoadState,
|
|
37
|
+
timeout: timeoutInMs !== undefined ? timeoutInMs : undefined
|
|
38
|
+
})];
|
|
39
|
+
if (timeoutInMs !== undefined) {
|
|
40
|
+
promises.push((0, _promises.setTimeout)(timeoutInMs + TIMEOUT_PADDING, timeoutSymbol));
|
|
41
|
+
}
|
|
42
|
+
responseOrTimeout = await Promise.race(promises);
|
|
43
|
+
if (responseOrTimeout === timeoutSymbol) {
|
|
44
|
+
throw new _playwright.errors.TimeoutError("Page.goto timed out but did not throw an error. Consider using a proxy.\n" + `(URL: ${url}, timeout: ${timeoutInMs}ms)`);
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
retries,
|
|
48
|
+
factor: 2,
|
|
49
|
+
minTimeout: 1000
|
|
50
|
+
});
|
|
51
|
+
} catch (error) {
|
|
52
|
+
if (!throwOnTimeout) {
|
|
53
|
+
return;
|
|
44
54
|
}
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
if (!waitForLoadingStateUsingAi) {
|
|
58
|
+
return responseOrTimeout;
|
|
59
|
+
}
|
|
60
|
+
for (let i = 0; i < retries; i++) {
|
|
61
|
+
let isLoaded = false;
|
|
45
62
|
try {
|
|
46
|
-
await
|
|
47
|
-
|
|
63
|
+
isLoaded = await (0, _isPageLoaded.isPageLoaded)({
|
|
64
|
+
page,
|
|
65
|
+
timeoutInMs,
|
|
66
|
+
model,
|
|
67
|
+
apiKey: apiKey ? apiKey : undefined
|
|
48
68
|
});
|
|
69
|
+
if (isLoaded === true) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
49
72
|
} catch (error) {
|
|
50
|
-
_Logger.logger.
|
|
73
|
+
_Logger.logger.debug(`Failed to check if page is loaded: ${url}. Error: ${error}`);
|
|
74
|
+
isLoaded = false;
|
|
51
75
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
factor: 2,
|
|
55
|
-
minTimeout: 1000
|
|
56
|
-
});
|
|
57
|
-
} catch (error) {
|
|
58
|
-
if (!throwOnTimeout) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
63
|
-
if (!waitForLoadingStateUsingAi && !(0, _utils.isGenerateCodeMode)()) {
|
|
64
|
-
return responseOrTimeout;
|
|
65
|
-
}
|
|
66
|
-
for (let i = 0; i < retries; i++) {
|
|
67
|
-
let isLoaded = false;
|
|
68
|
-
try {
|
|
69
|
-
isLoaded = await (0, _isPageLoaded.isPageLoaded)({
|
|
70
|
-
page,
|
|
71
|
-
timeoutInMs,
|
|
72
|
-
model,
|
|
73
|
-
apiKey: apiKey ? apiKey : undefined
|
|
74
|
-
});
|
|
75
|
-
if (isLoaded === true) {
|
|
76
|
+
if (i === retries - 1) {
|
|
77
|
+
_Logger.logger.warn("Page never loaded, url: " + url);
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
|
-
|
|
79
|
-
_Logger.logger.debug(`Failed to check if page is loaded: ${url}. Error: ${error}`);
|
|
80
|
-
isLoaded = false;
|
|
80
|
+
await (0, _promises.setTimeout)(5000);
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
82
|
+
}, {
|
|
83
|
+
page,
|
|
84
|
+
maxInflightRequests: 0,
|
|
85
|
+
timeoutInMs: 30000
|
|
86
|
+
});
|
|
87
87
|
};
|
|
88
88
|
exports.goToUrl = goToUrl;
|
|
89
89
|
function getPageGotoTimeout(page, options) {
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/* eslint-disable prettier/prettier */
|
|
2
2
|
// prettier-ignore-file
|
|
3
|
-
import type { Locator, Page, ElementHandle } from "playwright
|
|
3
|
+
import type { Locator, Page, ElementHandle } from "playwright";
|
|
4
4
|
import type { ReadStream } from "fs";
|
|
5
|
-
import { Download } from "playwright
|
|
6
|
-
import { SUPPORTED_MODELS } from "../ai/export";
|
|
5
|
+
import { Download } from "playwright";
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Configuration options for sanitizing HTML content.
|
|
@@ -204,7 +203,7 @@ export declare function filterEmptyValues<T>(input: { data: T }): T;
|
|
|
204
203
|
* @param {string} [input.waitForLoadState="load"] - When to consider navigation succeeded. Options: "load", "domcontentloaded", "networkidle", "commit". Defaults to "load"
|
|
205
204
|
* @param {boolean} [input.throwOnTimeout=true] - Whether to throw an error if navigation times out. When false, the function returns without throwing, allowing continued execution. Defaults to true.
|
|
206
205
|
* @param {boolean} [input.waitForLoadingStateUsingAi=false] - When true, uses AI vision to verify the page is fully loaded by checking for loading spinners, blank content, or incomplete states. Retries up to 4 times with 5-second delays. Defaults to false
|
|
207
|
-
* @param {
|
|
206
|
+
* @param {string} [input.model="gpt-5-mini-2025-08-07"] - AI model to use for loading verification. Defaults to "gpt-5-mini-2025-08-07"
|
|
208
207
|
* @param {string} [input.apiKey] - Optional API key for the AI service (if provided, will not be billed to your account)
|
|
209
208
|
* @returns {Promise<void>} Promise that resolves when navigation completes successfully. If the operation fails and `throwOnTimeout` is false, resolves without error
|
|
210
209
|
*
|
|
@@ -261,7 +260,7 @@ export declare function goToUrl(input: {
|
|
|
261
260
|
throwOnTimeout?: boolean;
|
|
262
261
|
waitForLoadState?: "load" | "domcontentloaded" | "networkidle";
|
|
263
262
|
waitForLoadingStateUsingAi?: boolean;
|
|
264
|
-
model?:
|
|
263
|
+
model?: string;
|
|
265
264
|
apiKey?: string;
|
|
266
265
|
}): Promise<void>;
|
|
267
266
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _extendedTest = require("../../common/extendedTest");
|
|
4
4
|
var _ = require("..");
|
|
5
|
-
var
|
|
5
|
+
var _playwright = require("playwright");
|
|
6
6
|
var _dotenv = require("dotenv");
|
|
7
7
|
(0, _dotenv.config)();
|
|
8
8
|
const basicClickHtml = `
|
|
@@ -210,7 +210,7 @@ const noChangeThresholdHtml = `
|
|
|
210
210
|
let browser;
|
|
211
211
|
let page;
|
|
212
212
|
(0, _extendedTest.beforeAll)(async () => {
|
|
213
|
-
browser = await
|
|
213
|
+
browser = await _playwright.chromium.launch({
|
|
214
214
|
headless: true
|
|
215
215
|
});
|
|
216
216
|
});
|
|
@@ -231,7 +231,8 @@ const noChangeThresholdHtml = `
|
|
|
231
231
|
const buttonLocator = page.locator("#load-more");
|
|
232
232
|
await (0, _.clickUntilExhausted)({
|
|
233
233
|
page,
|
|
234
|
-
buttonLocator
|
|
234
|
+
buttonLocator,
|
|
235
|
+
maxClicks: 10
|
|
235
236
|
});
|
|
236
237
|
const finalCount = await page.locator(".item").count();
|
|
237
238
|
(0, _extendedTest.expect)(finalCount).toBe(10);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _extendedTest = require("../../common/extendedTest");
|
|
4
|
-
var
|
|
4
|
+
var _playwright = require("playwright");
|
|
5
5
|
var _fs = _interopRequireDefault(require("fs"));
|
|
6
6
|
var _ = require("..");
|
|
7
7
|
var _promises = require("fs/promises");
|
|
@@ -72,7 +72,7 @@ _extendedTest.describe.skip("TestNotInGeneration", () => {
|
|
|
72
72
|
(0, _extendedTest.beforeAll)(async () => {
|
|
73
73
|
const dir = await createUserDirWithPreferences();
|
|
74
74
|
process.env.MODE = "";
|
|
75
|
-
context = await
|
|
75
|
+
context = await _playwright.chromium.launchPersistentContext(dir, {
|
|
76
76
|
headless: true,
|
|
77
77
|
args: ["--no-first-run", "--disable-sync", "--disable-translate", "--disable-features=TranslateUI", "--disable-features=NetworkService", "--lang=en", "--disable-blink-features=AutomationControlled"],
|
|
78
78
|
acceptDownloads: true
|
|
@@ -161,7 +161,7 @@ _extendedTest.describe.skip("TestNotInGeneration", () => {
|
|
|
161
161
|
(0, _extendedTest.beforeAll)(async () => {
|
|
162
162
|
process.env.MODE = "generate_code";
|
|
163
163
|
const dir = await createUserDirWithPreferences();
|
|
164
|
-
context = await
|
|
164
|
+
context = await _playwright.chromium.launchPersistentContext(dir, {
|
|
165
165
|
headless: true,
|
|
166
166
|
userAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36",
|
|
167
167
|
args: ["--no-first-run", "--disable-sync", "--disable-translate", "--disable-features=TranslateUI", "--disable-features=NetworkService", "--lang=en", "--disable-blink-features=AutomationControlled"],
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var _extendedTest = require("../../common/extendedTest");
|
|
4
4
|
var _ = require("..");
|
|
5
|
-
var
|
|
5
|
+
var _playwright = require("playwright");
|
|
6
6
|
var _dotenv = require("dotenv");
|
|
7
7
|
(0, _dotenv.config)();
|
|
8
8
|
_extendedTest.describe.skip("goToUrl E2E Tests", () => {
|
|
9
9
|
let browser;
|
|
10
10
|
let page;
|
|
11
11
|
(0, _extendedTest.beforeAll)(async () => {
|
|
12
|
-
browser = await
|
|
12
|
+
browser = await _playwright.chromium.launch({
|
|
13
13
|
headless: true
|
|
14
14
|
});
|
|
15
15
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _extendedTest = require("../../common/extendedTest");
|
|
4
4
|
var _ = require("..");
|
|
5
|
-
var
|
|
5
|
+
var _playwright = require("playwright");
|
|
6
6
|
var _dotenv = require("dotenv");
|
|
7
7
|
(0, _dotenv.config)();
|
|
8
8
|
const scrollWholePageHtml = `
|
|
@@ -92,7 +92,7 @@ const scrollSpecificContainerHtml = `
|
|
|
92
92
|
let browser;
|
|
93
93
|
let page;
|
|
94
94
|
(0, _extendedTest.beforeAll)(async () => {
|
|
95
|
-
browser = await
|
|
95
|
+
browser = await _playwright.chromium.launch({
|
|
96
96
|
headless: true
|
|
97
97
|
});
|
|
98
98
|
});
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var _extendedTest = require("../../common/extendedTest");
|
|
4
4
|
var _ = require("..");
|
|
5
|
-
var
|
|
5
|
+
var _playwright = require("playwright");
|
|
6
6
|
var _waitForDomSettled = require("../waitForDomSettled");
|
|
7
7
|
(0, _extendedTest.describe)("Test waitForDomSettled", () => {
|
|
8
8
|
let browser;
|
|
9
9
|
let page;
|
|
10
10
|
(0, _extendedTest.beforeAll)(async () => {
|
|
11
|
-
browser = await
|
|
11
|
+
browser = await _playwright.chromium.launch({
|
|
12
12
|
headless: true
|
|
13
13
|
});
|
|
14
14
|
});
|
|
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SUPPPORTED_GPT_MODELS = exports.SUPPPORTED_CLAUDE_MODELS = exports.SUPPORTED_MODELS = exports.MODELS_MAPPINGS = exports.MAX_TOKENS_OVERRIDES = exports.GPT_MODELS = exports.GOOGLE_MODELS = exports.CLAUDE_VISION_SUPPORTED_MODELS = exports.CLAUDE_MODELS_MAPPINGS = exports.CLAUDE_MODELS = void 0;
|
|
7
|
-
const CLAUDE_MODELS = exports.CLAUDE_MODELS = ["claude-opus-4-20250514", "claude-sonnet-4-20250514", "claude-3-7-sonnet-20250219", "claude-3-5-haiku-20241022", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307"];
|
|
7
|
+
const CLAUDE_MODELS = exports.CLAUDE_MODELS = ["claude-opus-4-20250514", "claude-sonnet-4-20250514", "claude-3-7-sonnet-20250219", "claude-3-5-sonnet-20241022", "claude-3-5-sonnet-20240620", "claude-3-5-haiku-20241022", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307"];
|
|
8
8
|
const MAX_TOKENS_OVERRIDES = exports.MAX_TOKENS_OVERRIDES = {
|
|
9
|
+
"claude-3-5-sonnet-20240620": 8192,
|
|
9
10
|
"gemini-1.5-pro-002": 8192,
|
|
10
11
|
"gemini-1.5-flash-8b-002": 8192,
|
|
11
12
|
"gemini-1.5-flash-002": 8192,
|
|
@@ -17,6 +18,7 @@ const CLAUDE_MODELS_MAPPINGS = exports.CLAUDE_MODELS_MAPPINGS = {
|
|
|
17
18
|
"claude-3-5-haiku": "claude-3-5-haiku-20241022",
|
|
18
19
|
"claude-3-opus": "claude-3-opus-20240229",
|
|
19
20
|
"claude-3-sonnet": "claude-3-sonnet-20240229",
|
|
21
|
+
"claude-3.5-sonnet": "claude-3-5-sonnet-20241022",
|
|
20
22
|
"claude-4-sonnet": "claude-sonnet-4-20250514",
|
|
21
23
|
"claude-4-opus": "claude-opus-4-20250514"
|
|
22
24
|
};
|
|
@@ -25,6 +27,6 @@ const GOOGLE_MODELS = exports.GOOGLE_MODELS = ["gemini-2.5-pro", "gemini-2.5-fla
|
|
|
25
27
|
const MODELS_MAPPINGS = exports.MODELS_MAPPINGS = {
|
|
26
28
|
...CLAUDE_MODELS_MAPPINGS
|
|
27
29
|
};
|
|
28
|
-
const SUPPPORTED_CLAUDE_MODELS = exports.SUPPPORTED_CLAUDE_MODELS = ["claude-3-5-haiku-20241022", "claude-3-5-haiku-latest", "claude-3-7-sonnet-20250219", "claude-3-7-sonnet-latest", "claude-3-haiku-20240307", "claude-4-opus-20250514", "claude-4-sonnet-20250514", "claude-opus-4-1", "claude-opus-4-1-20250805", "claude-opus-4-20250514", "claude-sonnet-4-20250514"];
|
|
30
|
+
const SUPPPORTED_CLAUDE_MODELS = exports.SUPPPORTED_CLAUDE_MODELS = ["claude-3-5-haiku-20241022", "claude-3-5-haiku-latest", "claude-3-5-sonnet-20240620", "claude-3-5-sonnet-20241022", "claude-3-5-sonnet-latest", "claude-3-7-sonnet-20250219", "claude-3-7-sonnet-latest", "claude-3-haiku-20240307", "claude-4-opus-20250514", "claude-4-sonnet-20250514", "claude-opus-4-1", "claude-opus-4-1-20250805", "claude-opus-4-20250514", "claude-sonnet-4-20250514"];
|
|
29
31
|
const SUPPPORTED_GPT_MODELS = exports.SUPPPORTED_GPT_MODELS = ["gpt-3.5-turbo", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-16k-0613", "gpt-3.5-turbo-instruct", "gpt-3.5-turbo-instruct-0914", "gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-0613", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4.1", "gpt-4.1-2025-04-14", "gpt-4.1-mini", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano", "gpt-4.1-nano-2025-04-14", "gpt-4o", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-2024-11-20", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-5", "gpt-5-2025-08-07", "gpt-5-chat", "gpt-5-chat-latest", "gpt-5-mini", "gpt-5-mini-2025-08-07", "gpt-5-nano", "gpt-5-nano-2025-08-07", "o1", "o1-2024-12-17", "o1-mini", "o1-mini-2024-09-12", "o1-pro", "o1-pro-2025-03-19", "o3", "o3-2025-04-16", "o3-deep-research", "o3-deep-research-2025-06-26", "o3-mini", "o3-mini-2025-01-31", "o3-pro", "o3-pro-2025-06-10", "o4-mini", "o4-mini-2025-04-16", "o4-mini-deep-research", "o4-mini-deep-research-2025-06-26"];
|
|
30
32
|
const SUPPORTED_MODELS = exports.SUPPORTED_MODELS = [...SUPPPORTED_CLAUDE_MODELS, ...SUPPPORTED_GPT_MODELS];
|
|
@@ -9,7 +9,7 @@ var _neverthrow = require("neverthrow");
|
|
|
9
9
|
var Errors = _interopRequireWildcard(require("../types/errors"));
|
|
10
10
|
var _utils = require("./utils");
|
|
11
11
|
var _Logger = require("../../common/Logger");
|
|
12
|
-
var _aiModelsValidations = require("
|
|
12
|
+
var _aiModelsValidations = require("../common/aiModelsValidations");
|
|
13
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
14
|
async function extractStructuredDataUsingClaude(input) {
|
|
15
15
|
const {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.extractStructuredDataUsingGoogle = extractStructuredDataUsingGoogle;
|
|
7
|
-
var _aiModelsValidations = require("
|
|
7
|
+
var _aiModelsValidations = require("../common/aiModelsValidations");
|
|
8
8
|
var _extractStrucutredDataUsingAiInstance = require("./extractStrucutredDataUsingAiInstance");
|
|
9
9
|
var Errors = _interopRequireWildcard(require("../types/errors"));
|
|
10
10
|
var _neverthrow = require("neverthrow");
|
|
@@ -8,7 +8,7 @@ var _neverthrow = require("neverthrow");
|
|
|
8
8
|
var Errors = _interopRequireWildcard(require("../types/errors"));
|
|
9
9
|
var _utils = require("./utils");
|
|
10
10
|
var _Logger = require("../../common/Logger");
|
|
11
|
-
var _aiModelsValidations = require("
|
|
11
|
+
var _aiModelsValidations = require("../common/aiModelsValidations");
|
|
12
12
|
var _openaiModel = require("../models/openaiModel");
|
|
13
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
14
|
async function extractStructuredDataUsingOpenAi(input) {
|
|
@@ -5,11 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SUPPORTED_VISION_MODELS = exports.SUPPORTED_TEXT_MODELS = exports.SUPPORTED_GPT_MODELS = exports.SUPPORTED_GOOGLE_MODELS = exports.SUPPORTED_CLAUDE_MODELS = exports.MODELS_MAPPINGS = exports.MAX_TOKENS_OVERRIDES = exports.GPT_MODELS_MAPPINGS = exports.GOOGLE_MODELS_MAPPINGS = exports.CLAUDE_VISION_SUPPORTED_MODELS = exports.CLAUDE_ONLY_TEXT_MODELS = exports.CLAUDE_MODELS_MAPPINGS = void 0;
|
|
7
7
|
const CLAUDE_ONLY_TEXT_MODELS = exports.CLAUDE_ONLY_TEXT_MODELS = ["claude-3-5-haiku", "claude-3-5-haiku-20241022"];
|
|
8
|
-
const CLAUDE_VISION_SUPPORTED_MODELS = exports.CLAUDE_VISION_SUPPORTED_MODELS = ["claude-3-haiku", "claude-3-haiku-20240307", "claude-opus-4", "claude-opus-4-20250514", "claude-sonnet-4", "claude-sonnet-4-20250514"];
|
|
8
|
+
const CLAUDE_VISION_SUPPORTED_MODELS = exports.CLAUDE_VISION_SUPPORTED_MODELS = ["claude-3-haiku", "claude-3-haiku-20240307", "claude-3.5-sonnet", "claude-3-5-sonnet-20240620", "claude-3-5-sonnet-20241022", "claude-opus-4", "claude-opus-4-20250514", "claude-sonnet-4", "claude-sonnet-4-20250514"];
|
|
9
9
|
const SUPPORTED_CLAUDE_MODELS = exports.SUPPORTED_CLAUDE_MODELS = [...CLAUDE_ONLY_TEXT_MODELS, ...CLAUDE_VISION_SUPPORTED_MODELS];
|
|
10
10
|
const CLAUDE_MODELS_MAPPINGS = exports.CLAUDE_MODELS_MAPPINGS = {
|
|
11
11
|
"claude-3-haiku": "claude-3-haiku-20240307",
|
|
12
12
|
"claude-3-5-haiku": "claude-3-5-haiku-20241022",
|
|
13
|
+
"claude-3.5-sonnet": "claude-3-5-sonnet-20241022",
|
|
13
14
|
"claude-opus-4": "claude-opus-4-20250514",
|
|
14
15
|
"claude-sonnet-4": "claude-sonnet-4-20250514"
|
|
15
16
|
};
|
|
@@ -36,6 +37,7 @@ const MODELS_MAPPINGS = exports.MODELS_MAPPINGS = {
|
|
|
36
37
|
...GOOGLE_MODELS_MAPPINGS
|
|
37
38
|
};
|
|
38
39
|
const MAX_TOKENS_OVERRIDES = exports.MAX_TOKENS_OVERRIDES = {
|
|
40
|
+
"claude-3-5-sonnet-20240620": 8192,
|
|
39
41
|
"gemini-1.5-pro-002": 8192,
|
|
40
42
|
"gemini-1.5-flash-8b-002": 8192,
|
|
41
43
|
"gemini-1.5-flash-002": 8192,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/browser-dev",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8-dev.0",
|
|
4
4
|
"description": "runner package for intuned functions",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"typesVersions": {
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"eslint-plugin-prettier": "^4.2.1",
|
|
107
107
|
"jest": "^30.0.4",
|
|
108
108
|
"msw": "^2.1.2",
|
|
109
|
-
"playwright": "
|
|
109
|
+
"playwright": ">=1.46.0 <1.57",
|
|
110
110
|
"prettier": "^2.8.8",
|
|
111
111
|
"rollup": "3.26.2",
|
|
112
112
|
"ts-jest": "^29.4.0",
|
|
@@ -116,7 +116,8 @@
|
|
|
116
116
|
"vitest": "^1.1.3"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
|
-
"@intuned/runtime": "*"
|
|
119
|
+
"@intuned/runtime": "*",
|
|
120
|
+
"playwright": ">=1.46.0 <1.57"
|
|
120
121
|
},
|
|
121
122
|
"peerDependenciesMeta": {
|
|
122
123
|
"@intuned/runtime": {
|
package/dist/ai/types/models.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SUPPORTED_VISION_MODELS = exports.SUPPORTED_TEXT_MODELS = exports.SUPPORTED_GPT_MODELS = exports.SUPPORTED_GOOGLE_MODELS = exports.SUPPORTED_CLAUDE_MODELS = exports.MODELS_MAPPINGS = exports.MAX_TOKENS_OVERRIDES = exports.GPT_MODELS_MAPPINGS = exports.GOOGLE_MODELS_MAPPINGS = exports.CLAUDE_VISION_SUPPORTED_MODELS = exports.CLAUDE_ONLY_TEXT_MODELS = exports.CLAUDE_MODELS_MAPPINGS = void 0;
|
|
7
|
-
const CLAUDE_ONLY_TEXT_MODELS = exports.CLAUDE_ONLY_TEXT_MODELS = ["claude-3-5-haiku", "claude-3-5-haiku-20241022"];
|
|
8
|
-
const CLAUDE_VISION_SUPPORTED_MODELS = exports.CLAUDE_VISION_SUPPORTED_MODELS = ["claude-3.7-sonnet-latest"];
|
|
9
|
-
const SUPPORTED_CLAUDE_MODELS = exports.SUPPORTED_CLAUDE_MODELS = [...CLAUDE_ONLY_TEXT_MODELS, ...CLAUDE_VISION_SUPPORTED_MODELS];
|
|
10
|
-
const CLAUDE_MODELS_MAPPINGS = exports.CLAUDE_MODELS_MAPPINGS = {
|
|
11
|
-
"claude-3-haiku": "claude-3-haiku-20240307",
|
|
12
|
-
"claude-3-5-haiku": "claude-3-5-haiku-20241022",
|
|
13
|
-
"claude-3-opus": "claude-3-opus-20240229"
|
|
14
|
-
};
|
|
15
|
-
const GPT_ONLY_TEXT_GPT_MODELS = ["gpt3.5-turbo", "gpt-3.5-turbo-0125"];
|
|
16
|
-
const GPT_VISION_SUPPORTED_MODELS = ["gpt4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4o", "gpt-4o-2024-05-13", "gpt-4o-mini", "gpt-4o-mini-2024-07-18"];
|
|
17
|
-
const SUPPORTED_GPT_MODELS = exports.SUPPORTED_GPT_MODELS = [...GPT_ONLY_TEXT_GPT_MODELS, ...GPT_VISION_SUPPORTED_MODELS];
|
|
18
|
-
const GPT_MODELS_MAPPINGS = exports.GPT_MODELS_MAPPINGS = {
|
|
19
|
-
"gpt4-turbo": "gpt-4-turbo-2024-04-09",
|
|
20
|
-
"gpt3.5-turbo": "gpt-3.5-turbo-0125",
|
|
21
|
-
"gpt-4o": "gpt-4o-2024-05-13",
|
|
22
|
-
"gpt-4o-mini": "gpt-4o-mini-2024-07-18"
|
|
23
|
-
};
|
|
24
|
-
const SUPPORTED_GOOGLE_MODELS = exports.SUPPORTED_GOOGLE_MODELS = ["gemini-1.5-pro", "gemini-1.5-pro-002", "gemini-1.5-flash-8b", "gemini-1.5-flash-8b-002", "gemini-1.5-flash", "gemini-1.5-flash-002", "gemini-2.0-flash-exp"];
|
|
25
|
-
const GOOGLE_MODELS_MAPPINGS = exports.GOOGLE_MODELS_MAPPINGS = {
|
|
26
|
-
"gemini-1.5-pro": "gemini-1.5-pro-002",
|
|
27
|
-
"gemini-1.5-flash-8b": "gemini-1.5-flash-8b-002",
|
|
28
|
-
"gemini-1.5-flash": "gemini-1.5-flash-002"
|
|
29
|
-
};
|
|
30
|
-
const SUPPORTED_TEXT_MODELS = exports.SUPPORTED_TEXT_MODELS = [...SUPPORTED_CLAUDE_MODELS, ...SUPPORTED_GPT_MODELS, ...SUPPORTED_GOOGLE_MODELS];
|
|
31
|
-
const SUPPORTED_VISION_MODELS = exports.SUPPORTED_VISION_MODELS = [...CLAUDE_VISION_SUPPORTED_MODELS, ...GPT_VISION_SUPPORTED_MODELS, ...SUPPORTED_GOOGLE_MODELS];
|
|
32
|
-
const MODELS_MAPPINGS = exports.MODELS_MAPPINGS = {
|
|
33
|
-
...GPT_MODELS_MAPPINGS,
|
|
34
|
-
...CLAUDE_MODELS_MAPPINGS,
|
|
35
|
-
...GOOGLE_MODELS_MAPPINGS
|
|
36
|
-
};
|
|
37
|
-
const MAX_TOKENS_OVERRIDES = exports.MAX_TOKENS_OVERRIDES = {
|
|
38
|
-
"gemini-1.5-pro-002": 8192,
|
|
39
|
-
"gemini-1.5-flash-8b-002": 8192,
|
|
40
|
-
"gemini-1.5-flash-002": 8192,
|
|
41
|
-
"gemini-2.0-flash-exp": 8192
|
|
42
|
-
};
|