@ui-tars-test/agent-sdk 0.3.0 → 0.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"defaultImpls.d.ts","sourceRoot":"","sources":["../src/defaultImpls.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEtG;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,oBAYpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,qBAgBrC,CAAC"}
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,oBAYpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,qBAgBrC,CAAC"}
@@ -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 { Coordinates, ImageDetailCalculator, NormalizeCoordinates } 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 normalizedCoords = {\n ...rawCoords,\n normalized: {\n x: rawCoords.raw.x / 1000,\n y: 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 const LOW_DETAIL_THRESHOLD = 1024 * 1024; // 1,048,576 px\n const HIGH_DETAIL_THRESHOLD = 2048 * 1960; // 4,014,080 px\n\n const pixelCount = width * height;\n if (pixelCount <= LOW_DETAIL_THRESHOLD) {\n return 'low';\n } else if (pixelCount <= HIGH_DETAIL_THRESHOLD) {\n return 'high';\n } else {\n // For images larger than high detail threshold, use high detail\n return 'auto';\n }\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","defaultNormalizeCoords","rawCoords","normalizedCoords","defaultDetailCalculator","width","height","LOW_DETAIL_THRESHOLD","HIGH_DETAIL_THRESHOLD","pixelCount"],"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;;;;;;;;ACMO,MAAMI,yBAA+C,CAACC;IAC3D,IAAI,CAACA,UAAU,GAAG,EAChB,OAAO;QAAE,YAAYA;IAAU;IAEjC,MAAMC,mBAAmB;QACvB,GAAGD,SAAS;QACZ,YAAY;YACV,GAAGA,UAAU,GAAG,CAAC,CAAC,GAAG;YACrB,GAAGA,UAAU,GAAG,CAAC,CAAC,GAAG;QACvB;IACF;IACA,OAAO;QAAE,YAAYC;IAAiB;AACxC;AAOO,MAAMC,0BAAiD,CAC5DC,OACAC;IAEA,MAAMC,uBAAuB;IAC7B,MAAMC,wBAAwB;IAE9B,MAAMC,aAAaJ,QAAQC;IAC3B,IAAIG,cAAcF,sBAChB,OAAO;IACF,IAAIE,cAAcD,uBACvB,OAAO;IAGP,OAAO;AAEX"}
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 normalizedCoords = {\n ...rawCoords,\n normalized: {\n x: rawCoords.raw.x / 1000,\n y: 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 const LOW_DETAIL_THRESHOLD = 1024 * 1024; // 1,048,576 px\n const HIGH_DETAIL_THRESHOLD = 2048 * 1960; // 4,014,080 px\n\n const pixelCount = width * height;\n if (pixelCount <= LOW_DETAIL_THRESHOLD) {\n return 'low';\n } else if (pixelCount <= HIGH_DETAIL_THRESHOLD) {\n return 'high';\n } else {\n // For images larger than high detail threshold, use high detail\n return 'auto';\n }\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","defaultNormalizeCoords","rawCoords","normalizedCoords","defaultDetailCalculator","width","height","LOW_DETAIL_THRESHOLD","HIGH_DETAIL_THRESHOLD","pixelCount"],"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,mBAAmB;QACvB,GAAGD,SAAS;QACZ,YAAY;YACV,GAAGA,UAAU,GAAG,CAAC,CAAC,GAAG;YACrB,GAAGA,UAAU,GAAG,CAAC,CAAC,GAAG;QACvB;IACF;IACA,OAAO;QAAE,YAAYC;IAAiB;AACxC;AAOO,MAAMC,0BAAiD,CAC5DC,OACAC;IAEA,MAAMC,uBAAuB;IAC7B,MAAMC,wBAAwB;IAE9B,MAAMC,aAAaJ,QAAQC;IAC3B,IAAIG,cAAcF,sBAChB,OAAO;IACF,IAAIE,cAAcD,uBACvB,OAAO;IAGP,OAAO;AAEX"}
@@ -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 { Coordinates, ImageDetailCalculator, NormalizeCoordinates } 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 normalizedCoords = {\n ...rawCoords,\n normalized: {\n x: rawCoords.raw.x / 1000,\n y: 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 const LOW_DETAIL_THRESHOLD = 1024 * 1024; // 1,048,576 px\n const HIGH_DETAIL_THRESHOLD = 2048 * 1960; // 4,014,080 px\n\n const pixelCount = width * height;\n if (pixelCount <= LOW_DETAIL_THRESHOLD) {\n return 'low';\n } else if (pixelCount <= HIGH_DETAIL_THRESHOLD) {\n return 'high';\n } else {\n // For images larger than high detail threshold, use high detail\n return 'auto';\n }\n};\n"],"names":["defaultNormalizeCoords","rawCoords","normalizedCoords","defaultDetailCalculator","width","height","LOW_DETAIL_THRESHOLD","HIGH_DETAIL_THRESHOLD","pixelCount"],"mappings":";;;;AAYO,MAAMA,yBAA+C,CAACC;IAC3D,IAAI,CAACA,UAAU,GAAG,EAChB,OAAO;QAAE,YAAYA;IAAU;IAEjC,MAAMC,mBAAmB;QACvB,GAAGD,SAAS;QACZ,YAAY;YACV,GAAGA,UAAU,GAAG,CAAC,CAAC,GAAG;YACrB,GAAGA,UAAU,GAAG,CAAC,CAAC,GAAG;QACvB;IACF;IACA,OAAO;QAAE,YAAYC;IAAiB;AACxC;AAOO,MAAMC,0BAAiD,CAC5DC,OACAC;IAEA,MAAMC,uBAAuB;IAC7B,MAAMC,wBAAwB;IAE9B,MAAMC,aAAaJ,QAAQC;IAC3B,IAAIG,cAAcF,sBAChB,OAAO;IACF,IAAIE,cAAcD,uBACvB,OAAO;IAGP,OAAO;AAEX"}
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 normalizedCoords = {\n ...rawCoords,\n normalized: {\n x: rawCoords.raw.x / 1000,\n y: 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 const LOW_DETAIL_THRESHOLD = 1024 * 1024; // 1,048,576 px\n const HIGH_DETAIL_THRESHOLD = 2048 * 1960; // 4,014,080 px\n\n const pixelCount = width * height;\n if (pixelCount <= LOW_DETAIL_THRESHOLD) {\n return 'low';\n } else if (pixelCount <= HIGH_DETAIL_THRESHOLD) {\n return 'high';\n } else {\n // For images larger than high detail threshold, use high detail\n return 'auto';\n }\n};\n"],"names":["defaultNormalizeCoords","rawCoords","normalizedCoords","defaultDetailCalculator","width","height","LOW_DETAIL_THRESHOLD","HIGH_DETAIL_THRESHOLD","pixelCount"],"mappings":";;;;AAgBO,MAAMA,yBAA+C,CAACC;IAC3D,IAAI,CAACA,UAAU,GAAG,EAChB,OAAO;QAAE,YAAYA;IAAU;IAEjC,MAAMC,mBAAmB;QACvB,GAAGD,SAAS;QACZ,YAAY;YACV,GAAGA,UAAU,GAAG,CAAC,CAAC,GAAG;YACrB,GAAGA,UAAU,GAAG,CAAC,CAAC,GAAG;QACvB;IACF;IACA,OAAO;QAAE,YAAYC;IAAiB;AACxC;AAOO,MAAMC,0BAAiD,CAC5DC,OACAC;IAEA,MAAMC,uBAAuB;IAC7B,MAAMC,wBAAwB;IAE9B,MAAMC,aAAaJ,QAAQC;IAC3B,IAAIG,cAAcF,sBAChB,OAAO;IACF,IAAIE,cAAcD,uBACvB,OAAO;IAGP,OAAO;AAEX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui-tars-test/agent-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.3",
4
4
  "description": "GUI Agent",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -35,21 +35,20 @@
35
35
  "@agent-infra/logger": "0.0.2-beta.2",
36
36
  "@agent-infra/media-utils": "0.1.5",
37
37
  "@clack/prompts": "0.11.0",
38
- "@ui-tars-test/action-parser": "workspace:*",
39
- "@ui-tars-test/operator-adb": "workspace:*",
40
- "@ui-tars-test/operator-browser": "workspace:*",
41
- "@ui-tars-test/operator-nutjs": "workspace:*",
42
- "@ui-tars-test/shared": "workspace:*",
43
- "@tarko/agent": "workspace:*",
44
- "@tarko/agent-cli": "workspace:*",
45
- "@tarko/agent-interface": "workspace:*",
38
+ "@ui-tars-test/action-parser": "^0.3.0",
39
+ "@ui-tars-test/operator-adb": "^0.3.0",
40
+ "@ui-tars-test/operator-browser": "^0.3.0",
41
+ "@ui-tars-test/operator-nutjs": "^0.3.0",
42
+ "@ui-tars-test/shared": "^0.3.0",
43
+ "@tarko/agent": "^0.3.0",
44
+ "@tarko/agent-cli": "^0.3.0",
45
+ "@tarko/agent-interface": "^0.3.0",
46
46
  "big.js": "^6.2.2",
47
47
  "commander": "^14.0.0",
48
48
  "dotenv": "^17.2.2",
49
- "jimp": "1.6.0",
50
- "jsonrepair": "3.12.0",
51
- "uuid": "^9.0.0",
52
- "zod-to-json-schema": "3.24.3"
49
+ "fast-xml-parser": "^4.5.1",
50
+ "lodash.isnumber": "3.0.3",
51
+ "zod": "^3.22.4"
53
52
  },
54
53
  "devDependencies": {
55
54
  "@agent-infra/shared": "0.0.2",