@ui-tars-test/agent-sdk 0.3.18 → 0.3.19
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultImpls.d.ts","sourceRoot":"","sources":["../src/defaultImpls.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,oBAapC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"defaultImpls.d.ts","sourceRoot":"","sources":["../src/defaultImpls.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,oBAapC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,qBAQrC,CAAC"}
|
package/dist/defaultImpls.js
CHANGED
|
@@ -47,14 +47,7 @@ const defaultNormalizeCoords = (rawCoords)=>{
|
|
|
47
47
|
normalized: normalizedCoords
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
const defaultDetailCalculator = (width, height)=>
|
|
51
|
-
const LOW_DETAIL_THRESHOLD = 1048576;
|
|
52
|
-
const HIGH_DETAIL_THRESHOLD = 4014080;
|
|
53
|
-
const pixelCount = width * height;
|
|
54
|
-
if (pixelCount <= LOW_DETAIL_THRESHOLD) return 'low';
|
|
55
|
-
if (pixelCount <= HIGH_DETAIL_THRESHOLD) return 'high';
|
|
56
|
-
return 'auto';
|
|
57
|
-
};
|
|
50
|
+
const defaultDetailCalculator = (width, height)=>'high';
|
|
58
51
|
exports.defaultDetailCalculator = __webpack_exports__.defaultDetailCalculator;
|
|
59
52
|
exports.defaultNormalizeCoords = __webpack_exports__.defaultNormalizeCoords;
|
|
60
53
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
package/dist/defaultImpls.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultImpls.js","sources":["webpack://@ui-tars-test/agent-sdk/webpack/runtime/define_property_getters","webpack://@ui-tars-test/agent-sdk/webpack/runtime/has_own_property","webpack://@ui-tars-test/agent-sdk/webpack/runtime/make_namespace_object","webpack://@ui-tars-test/agent-sdk/./src/defaultImpls.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n Coordinates,\n ImageDetailCalculator,\n NormalizeCoordinates,\n} from '@ui-tars-test/shared/types';\n\n/**\n * Default coordinate normalization function\n * Normalizes raw coordinates by dividing by 1000 (simple scaling)\n * @param rawCoords - The raw coordinates to normalize\n * @returns Object containing normalized coordinates\n */\nexport const defaultNormalizeCoords: NormalizeCoordinates = (rawCoords: Coordinates) => {\n if (!rawCoords.raw) {\n return { normalized: rawCoords };\n }\n const clamp01 = (value: number): number => Math.min(1, Math.max(0, value));\n const normalizedCoords = {\n ...rawCoords,\n normalized: {\n x: clamp01(rawCoords.raw.x / 1000),\n y: clamp01(rawCoords.raw.y / 1000),\n },\n };\n return { normalized: normalizedCoords };\n};\n\n/**\n * Default implementation for detail calculation based on pixel count\n * detail:low mode: 1,048,576 px (1024×1024)\n * detail:high mode: 4,014,080 px (2048×1960)\n */\nexport const defaultDetailCalculator: ImageDetailCalculator = (\n width: number,\n height: number,\n): 'low' | 'high' | 'auto' => {\n
|
|
1
|
+
{"version":3,"file":"defaultImpls.js","sources":["webpack://@ui-tars-test/agent-sdk/webpack/runtime/define_property_getters","webpack://@ui-tars-test/agent-sdk/webpack/runtime/has_own_property","webpack://@ui-tars-test/agent-sdk/webpack/runtime/make_namespace_object","webpack://@ui-tars-test/agent-sdk/./src/defaultImpls.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n Coordinates,\n ImageDetailCalculator,\n NormalizeCoordinates,\n} from '@ui-tars-test/shared/types';\n\n/**\n * Default coordinate normalization function\n * Normalizes raw coordinates by dividing by 1000 (simple scaling)\n * @param rawCoords - The raw coordinates to normalize\n * @returns Object containing normalized coordinates\n */\nexport const defaultNormalizeCoords: NormalizeCoordinates = (rawCoords: Coordinates) => {\n if (!rawCoords.raw) {\n return { normalized: rawCoords };\n }\n const clamp01 = (value: number): number => Math.min(1, Math.max(0, value));\n const normalizedCoords = {\n ...rawCoords,\n normalized: {\n x: clamp01(rawCoords.raw.x / 1000),\n y: clamp01(rawCoords.raw.y / 1000),\n },\n };\n return { normalized: normalizedCoords };\n};\n\n/**\n * Default implementation for detail calculation based on pixel count\n * detail:low mode: 1,048,576 px (1024×1024)\n * detail:high mode: 4,014,080 px (2048×1960)\n */\nexport const defaultDetailCalculator: ImageDetailCalculator = (\n width: number,\n height: number,\n): 'low' | 'high' | 'auto' => {\n // Always use 'high' detail for GUI tasks to ensure text and small elements are visible\n // 'low' detail (512x512) is too small for screen reading\n // 'auto' might choose 'low' for smaller screens incorrectly\n return 'high';\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","defaultNormalizeCoords","rawCoords","clamp01","value","Math","normalizedCoords","defaultDetailCalculator","width","height"],"mappings":";;;;;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;ACUO,MAAMI,yBAA+C,CAACC;IAC3D,IAAI,CAACA,UAAU,GAAG,EAChB,OAAO;QAAE,YAAYA;IAAU;IAEjC,MAAMC,UAAU,CAACC,QAA0BC,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC,GAAGD;IACnE,MAAME,mBAAmB;QACvB,GAAGJ,SAAS;QACZ,YAAY;YACV,GAAGC,QAAQD,UAAU,GAAG,CAAC,CAAC,GAAG;YAC7B,GAAGC,QAAQD,UAAU,GAAG,CAAC,CAAC,GAAG;QAC/B;IACF;IACA,OAAO;QAAE,YAAYI;IAAiB;AACxC;AAOO,MAAMC,0BAAiD,CAC5DC,OACAC,SAKO"}
|
package/dist/defaultImpls.mjs
CHANGED
|
@@ -18,14 +18,7 @@ const defaultNormalizeCoords = (rawCoords)=>{
|
|
|
18
18
|
normalized: normalizedCoords
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
const defaultDetailCalculator = (width, height)=>
|
|
22
|
-
const LOW_DETAIL_THRESHOLD = 1048576;
|
|
23
|
-
const HIGH_DETAIL_THRESHOLD = 4014080;
|
|
24
|
-
const pixelCount = width * height;
|
|
25
|
-
if (pixelCount <= LOW_DETAIL_THRESHOLD) return 'low';
|
|
26
|
-
if (pixelCount <= HIGH_DETAIL_THRESHOLD) return 'high';
|
|
27
|
-
return 'auto';
|
|
28
|
-
};
|
|
21
|
+
const defaultDetailCalculator = (width, height)=>'high';
|
|
29
22
|
export { defaultDetailCalculator, defaultNormalizeCoords };
|
|
30
23
|
|
|
31
24
|
//# sourceMappingURL=defaultImpls.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultImpls.mjs","sources":["webpack://@ui-tars-test/agent-sdk/./src/defaultImpls.ts"],"sourcesContent":["/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n Coordinates,\n ImageDetailCalculator,\n NormalizeCoordinates,\n} from '@ui-tars-test/shared/types';\n\n/**\n * Default coordinate normalization function\n * Normalizes raw coordinates by dividing by 1000 (simple scaling)\n * @param rawCoords - The raw coordinates to normalize\n * @returns Object containing normalized coordinates\n */\nexport const defaultNormalizeCoords: NormalizeCoordinates = (rawCoords: Coordinates) => {\n if (!rawCoords.raw) {\n return { normalized: rawCoords };\n }\n const clamp01 = (value: number): number => Math.min(1, Math.max(0, value));\n const normalizedCoords = {\n ...rawCoords,\n normalized: {\n x: clamp01(rawCoords.raw.x / 1000),\n y: clamp01(rawCoords.raw.y / 1000),\n },\n };\n return { normalized: normalizedCoords };\n};\n\n/**\n * Default implementation for detail calculation based on pixel count\n * detail:low mode: 1,048,576 px (1024×1024)\n * detail:high mode: 4,014,080 px (2048×1960)\n */\nexport const defaultDetailCalculator: ImageDetailCalculator = (\n width: number,\n height: number,\n): 'low' | 'high' | 'auto' => {\n
|
|
1
|
+
{"version":3,"file":"defaultImpls.mjs","sources":["webpack://@ui-tars-test/agent-sdk/./src/defaultImpls.ts"],"sourcesContent":["/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n Coordinates,\n ImageDetailCalculator,\n NormalizeCoordinates,\n} from '@ui-tars-test/shared/types';\n\n/**\n * Default coordinate normalization function\n * Normalizes raw coordinates by dividing by 1000 (simple scaling)\n * @param rawCoords - The raw coordinates to normalize\n * @returns Object containing normalized coordinates\n */\nexport const defaultNormalizeCoords: NormalizeCoordinates = (rawCoords: Coordinates) => {\n if (!rawCoords.raw) {\n return { normalized: rawCoords };\n }\n const clamp01 = (value: number): number => Math.min(1, Math.max(0, value));\n const normalizedCoords = {\n ...rawCoords,\n normalized: {\n x: clamp01(rawCoords.raw.x / 1000),\n y: clamp01(rawCoords.raw.y / 1000),\n },\n };\n return { normalized: normalizedCoords };\n};\n\n/**\n * Default implementation for detail calculation based on pixel count\n * detail:low mode: 1,048,576 px (1024×1024)\n * detail:high mode: 4,014,080 px (2048×1960)\n */\nexport const defaultDetailCalculator: ImageDetailCalculator = (\n width: number,\n height: number,\n): 'low' | 'high' | 'auto' => {\n // Always use 'high' detail for GUI tasks to ensure text and small elements are visible\n // 'low' detail (512x512) is too small for screen reading\n // 'auto' might choose 'low' for smaller screens incorrectly\n return 'high';\n};\n"],"names":["defaultNormalizeCoords","rawCoords","clamp01","value","Math","normalizedCoords","defaultDetailCalculator","width","height"],"mappings":";;;;AAgBO,MAAMA,yBAA+C,CAACC;IAC3D,IAAI,CAACA,UAAU,GAAG,EAChB,OAAO;QAAE,YAAYA;IAAU;IAEjC,MAAMC,UAAU,CAACC,QAA0BC,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC,GAAGD;IACnE,MAAME,mBAAmB;QACvB,GAAGJ,SAAS;QACZ,YAAY;YACV,GAAGC,QAAQD,UAAU,GAAG,CAAC,CAAC,GAAG;YAC7B,GAAGC,QAAQD,UAAU,GAAG,CAAC,CAAC,GAAG;QAC/B;IACF;IACA,OAAO;QAAE,YAAYI;IAAiB;AACxC;AAOO,MAAMC,0BAAiD,CAC5DC,OACAC,SAKO"}
|