@ui-tars-test/shared 0.3.6 → 0.3.9

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,4 +1,4 @@
1
- import Agent from '@tarko/agent';
1
+ import Agent from '@ui-tars-test/tarko-agent';
2
2
  /**
3
3
  * @abstract
4
4
  * @class BaseGUIAgent
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/base/agent.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,cAAc,CAAC;AAEjC;;;;GAIG;AACH,8BAAsB,YAAa,SAAQ,KAAK;CAAG"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/base/agent.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,2BAA2B,CAAC;AAE9C;;;;GAIG;AACH,8BAAsB,YAAa,SAAQ,KAAK;CAAG"}
@@ -39,9 +39,9 @@ __webpack_require__.r(__webpack_exports__);
39
39
  __webpack_require__.d(__webpack_exports__, {
40
40
  BaseGUIAgent: ()=>BaseGUIAgent
41
41
  });
42
- const agent_namespaceObject = require("@tarko/agent");
43
- var agent_default = /*#__PURE__*/ __webpack_require__.n(agent_namespaceObject);
44
- class BaseGUIAgent extends agent_default() {
42
+ const tarko_agent_namespaceObject = require("@ui-tars-test/tarko-agent");
43
+ var tarko_agent_default = /*#__PURE__*/ __webpack_require__.n(tarko_agent_namespaceObject);
44
+ class BaseGUIAgent extends tarko_agent_default() {
45
45
  }
46
46
  exports.BaseGUIAgent = __webpack_exports__.BaseGUIAgent;
47
47
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
@@ -1 +1 @@
1
- {"version":3,"file":"base/agent.js","sources":["webpack://@ui-tars-test/shared/webpack/runtime/compat_get_default_export","webpack://@ui-tars-test/shared/webpack/runtime/define_property_getters","webpack://@ui-tars-test/shared/webpack/runtime/has_own_property","webpack://@ui-tars-test/shared/webpack/runtime/make_namespace_object","webpack://@ui-tars-test/shared/./src/base/agent.ts"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__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 */\n\nimport Agent from '@tarko/agent';\n\n/**\n * @abstract\n * @class BaseGUIAgent\n * @classdesc Abstract base class for GUI Agents.\n */\nexport abstract class BaseGUIAgent extends Agent {}\n"],"names":["__webpack_require__","module","getter","definition","key","Object","obj","prop","Symbol","BaseGUIAgent","Agent"],"mappings":";;;;;;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAJ,oBAAoB,CAAC,GAAG,CAACM,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFP,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOQ,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,MAAeI,qBAAqBC;AAAO"}
1
+ {"version":3,"file":"base/agent.js","sources":["webpack://@ui-tars-test/shared/webpack/runtime/compat_get_default_export","webpack://@ui-tars-test/shared/webpack/runtime/define_property_getters","webpack://@ui-tars-test/shared/webpack/runtime/has_own_property","webpack://@ui-tars-test/shared/webpack/runtime/make_namespace_object","webpack://@ui-tars-test/shared/./src/base/agent.ts"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__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 */\n\nimport Agent from '@ui-tars-test/tarko-agent';\n\n/**\n * @abstract\n * @class BaseGUIAgent\n * @classdesc Abstract base class for GUI Agents.\n */\nexport abstract class BaseGUIAgent extends Agent {}\n"],"names":["__webpack_require__","module","getter","definition","key","Object","obj","prop","Symbol","BaseGUIAgent","Agent"],"mappings":";;;;;;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAJ,oBAAoB,CAAC,GAAG,CAACM,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFP,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOQ,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,MAAeI,qBAAqBC;AAAO"}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) 2025 Bytedance, Inc. and its affiliates.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import agent from "@tarko/agent";
6
- class BaseGUIAgent extends agent {
5
+ import tarko_agent from "@ui-tars-test/tarko-agent";
6
+ class BaseGUIAgent extends tarko_agent {
7
7
  }
8
8
  export { BaseGUIAgent };
9
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"base/agent.mjs","sources":["webpack://@ui-tars-test/shared/./src/base/agent.ts"],"sourcesContent":["/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport Agent from '@tarko/agent';\n\n/**\n * @abstract\n * @class BaseGUIAgent\n * @classdesc Abstract base class for GUI Agents.\n */\nexport abstract class BaseGUIAgent extends Agent {}\n"],"names":["BaseGUIAgent","Agent"],"mappings":";;;;;AAYO,MAAeA,qBAAqBC;AAAO"}
1
+ {"version":3,"file":"base/agent.mjs","sources":["webpack://@ui-tars-test/shared/./src/base/agent.ts"],"sourcesContent":["/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport Agent from '@ui-tars-test/tarko-agent';\n\n/**\n * @abstract\n * @class BaseGUIAgent\n * @classdesc Abstract base class for GUI Agents.\n */\nexport abstract class BaseGUIAgent extends Agent {}\n"],"names":["BaseGUIAgent","Agent"],"mappings":";;;;;AAYO,MAAeA,qBAAqBC;AAAO"}
@@ -1,4 +1,4 @@
1
- import { AgentOptions } from '@tarko/agent-interface';
1
+ import { AgentOptions } from '@ui-tars-test/tarko-agent-interface';
2
2
  import { Factors, BaseAction, Coordinates, SupportedActionType } from './actions';
3
3
  /**
4
4
  * Type definition for parsed GUI response structure
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/types/agents.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAkB,MAAM,WAAW,CAAC;AAElG;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B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vC;AAED,MAAM,WAAW,cAAc,CAAC,SAAS,CAAE,SAAQ,YAAY;IAC7D,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,oBAAoB,CAAC;IACjG,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,kBAAkB,CAAC;IACzC,gDAAgD;IAChD,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;IACzC,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"types/agents.js","sources":["webpack://@ui-tars-test/shared/webpack/runtime/define_property_getters","webpack://@ui-tars-test/shared/webpack/runtime/has_own_property","webpack://@ui-tars-test/shared/webpack/runtime/make_namespace_object","webpack://@ui-tars-test/shared/./src/types/agents.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 */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { AgentOptions } from '@tarko/agent-interface';\nimport { Factors, BaseAction, Coordinates, SupportedActionType, ActionMetadata } from './actions';\n\n/**\n * Type definition for parsed GUI response structure\n * Represents the components extracted from a model's output string\n * Aligned with tarko's web UI design\n */\nexport interface ParsedGUIResponse {\n /** raw prediction string */\n rawContent: string;\n /** parsed from Thought: `<thought>` */\n reasoningContent?: string;\n /** parsed from Action: action(params=`action`) */\n rawActionStrings?: string[];\n /** parsed from Action: action(params=`action`) */\n actions: BaseAction[];\n /** error message to feedback to LLM */\n errorMessage?: string;\n}\n\n/**\n * Type definition for function to normalize raw coordinates\n * Converts raw pixel coordinates to normalized coordinates (0-1)\n * @param rawX - Raw X coordinate in pixels\n * @param rawY - Raw Y coordinate in pixels\n * @returns Normalized coordinates {x, y} with values between 0 and 1\n */\nexport type NormalizeCoordinates = (\n rawCoords: Coordinates,\n factors?: Factors,\n) => { normalized: Coordinates };\n\n/**\n * Type definition for handler function to parse model output into ParsedGUIResponse object\n * @param prediction - The raw output from the model to be parsed\n * @returns ParsedGUIResponse object if parsing is successful, null otherwise\n */\nexport type CustomActionParser = (prediction: string) => ParsedGUIResponse | null;\n\n/**\n * Function type for serializing supported actions to string format\n * @param actions - Array of supported action types\n * @returns String representation of the actions for agent processing\n */\nexport type SerializeSupportedActions = (actions: Array<SupportedActionType>) => string;\n\nexport type ExecuteParams = {\n /** Required actions to execute */\n actions: BaseAction[];\n} & Partial<Omit<ParsedGUIResponse, 'actions'>> &\n Record<string, any>;\n\nexport type ExecuteOutput = {\n status: 'success' | 'failed';\n errorMessage?: string;\n url?: string; // url of the page\n} & Record<string, any>;\n\n/**\n * Function type for calculating detail level based on image dimensions\n */\nexport type ImageDetailCalculator = (width: number, height: number) => 'low' | 'high' | 'auto';\n\nexport interface ScreenshotOutput extends ExecuteOutput {\n /** screenshot base64, `keep screenshot size as physical pixels` */\n base64: string;\n}\n\n/**\n * Reserved placeholder name for action space in system prompt template\n */\nexport const ACTION_SPACE_PLACEHOLDER = 'action_space';\n\n/**\n * Interface for system prompt template configuration\n */\nexport interface SystemPromptTemplate {\n /**\n * Template string with placeholders. Must include an action space placeholder\n * `{{${ACTION_SPACE_PLACEHOLDER}}}` that will be replaced with the string representation of available actions\n */\n template: string;\n\n /**\n * Function to convert BaseAction array to string representation for the action space\n * This will be used to fill the action space placeholder in the template\n */\n actionsToString?: SerializeSupportedActions;\n\n /**\n * Optional map of additional placeholder values to be replaced in the template\n * Keys are placeholder names, values are the replacement strings\n * Note: '${ACTION_SPACE_PLACEHOLDER}' is a reserved placeholder and should NOT be included here\n * as it will be automatically filled using the actionsToString function\n */\n // placeholders?: Omit<Record<string, string>, typeof ACTION_SPACE_PLACEHOLDER>;\n placeholders?: Record<string, string>;\n}\n\nexport interface GUIAgentConfig<TOperator> extends AgentOptions {\n operator: TOperator;\n // ===== Optional =====\n /**\n * System prompt configuration. Can be either:\n * - A simple string (legacy mode)\n * - An array of strings or chat messages (will be concatenated)\n * - A SystemPromptTemplate object with template and actionsToString function\n */\n systemPrompt?: string | Array<string | { role: string; content: string }> | SystemPromptTemplate;\n /** The handler function to parse model output into PredictionParsed object */\n customeActionParser?: CustomActionParser;\n /** The function to normalize raw coordinates */\n normalizeCoordinates?: NormalizeCoordinates;\n /** The function to calculate detail level based on image dimensions */\n detailCalculator?: ImageDetailCalculator;\n /** Maximum number of turns for Agent to execute, @default 1000 */\n maxLoopCount?: number;\n /** Time interval between two loop iterations (in milliseconds), @default 0 */\n loopIntervalInMs?: number;\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","ACTION_SPACE_PLACEHOLDER"],"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;;;;;;;ACyEO,MAAMI,2BAA2B"}
1
+ {"version":3,"file":"types/agents.js","sources":["webpack://@ui-tars-test/shared/webpack/runtime/define_property_getters","webpack://@ui-tars-test/shared/webpack/runtime/has_own_property","webpack://@ui-tars-test/shared/webpack/runtime/make_namespace_object","webpack://@ui-tars-test/shared/./src/types/agents.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 */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { AgentOptions } from '@ui-tars-test/tarko-agent-interface';\nimport { Factors, BaseAction, Coordinates, SupportedActionType, ActionMetadata } from './actions';\n\n/**\n * Type definition for parsed GUI response structure\n * Represents the components extracted from a model's output string\n * Aligned with tarko's web UI design\n */\nexport interface ParsedGUIResponse {\n /** raw prediction string */\n rawContent: string;\n /** parsed from Thought: `<thought>` */\n reasoningContent?: string;\n /** parsed from Action: action(params=`action`) */\n rawActionStrings?: string[];\n /** parsed from Action: action(params=`action`) */\n actions: BaseAction[];\n /** error message to feedback to LLM */\n errorMessage?: string;\n}\n\n/**\n * Type definition for function to normalize raw coordinates\n * Converts raw pixel coordinates to normalized coordinates (0-1)\n * @param rawX - Raw X coordinate in pixels\n * @param rawY - Raw Y coordinate in pixels\n * @returns Normalized coordinates {x, y} with values between 0 and 1\n */\nexport type NormalizeCoordinates = (\n rawCoords: Coordinates,\n factors?: Factors,\n) => { normalized: Coordinates };\n\n/**\n * Type definition for handler function to parse model output into ParsedGUIResponse object\n * @param prediction - The raw output from the model to be parsed\n * @returns ParsedGUIResponse object if parsing is successful, null otherwise\n */\nexport type CustomActionParser = (prediction: string) => ParsedGUIResponse | null;\n\n/**\n * Function type for serializing supported actions to string format\n * @param actions - Array of supported action types\n * @returns String representation of the actions for agent processing\n */\nexport type SerializeSupportedActions = (actions: Array<SupportedActionType>) => string;\n\nexport type ExecuteParams = {\n /** Required actions to execute */\n actions: BaseAction[];\n} & Partial<Omit<ParsedGUIResponse, 'actions'>> &\n Record<string, any>;\n\nexport type ExecuteOutput = {\n status: 'success' | 'failed';\n errorMessage?: string;\n url?: string; // url of the page\n} & Record<string, any>;\n\n/**\n * Function type for calculating detail level based on image dimensions\n */\nexport type ImageDetailCalculator = (width: number, height: number) => 'low' | 'high' | 'auto';\n\nexport interface ScreenshotOutput extends ExecuteOutput {\n /** screenshot base64, `keep screenshot size as physical pixels` */\n base64: string;\n}\n\n/**\n * Reserved placeholder name for action space in system prompt template\n */\nexport const ACTION_SPACE_PLACEHOLDER = 'action_space';\n\n/**\n * Interface for system prompt template configuration\n */\nexport interface SystemPromptTemplate {\n /**\n * Template string with placeholders. Must include an action space placeholder\n * `{{${ACTION_SPACE_PLACEHOLDER}}}` that will be replaced with the string representation of available actions\n */\n template: string;\n\n /**\n * Function to convert BaseAction array to string representation for the action space\n * This will be used to fill the action space placeholder in the template\n */\n actionsToString?: SerializeSupportedActions;\n\n /**\n * Optional map of additional placeholder values to be replaced in the template\n * Keys are placeholder names, values are the replacement strings\n * Note: '${ACTION_SPACE_PLACEHOLDER}' is a reserved placeholder and should NOT be included here\n * as it will be automatically filled using the actionsToString function\n */\n // placeholders?: Omit<Record<string, string>, typeof ACTION_SPACE_PLACEHOLDER>;\n placeholders?: Record<string, string>;\n}\n\nexport interface GUIAgentConfig<TOperator> extends AgentOptions {\n operator: TOperator;\n // ===== Optional =====\n /**\n * System prompt configuration. Can be either:\n * - A simple string (legacy mode)\n * - An array of strings or chat messages (will be concatenated)\n * - A SystemPromptTemplate object with template and actionsToString function\n */\n systemPrompt?: string | Array<string | { role: string; content: string }> | SystemPromptTemplate;\n /** The handler function to parse model output into PredictionParsed object */\n customeActionParser?: CustomActionParser;\n /** The function to normalize raw coordinates */\n normalizeCoordinates?: NormalizeCoordinates;\n /** The function to calculate detail level based on image dimensions */\n detailCalculator?: ImageDetailCalculator;\n /** Maximum number of turns for Agent to execute, @default 1000 */\n maxLoopCount?: number;\n /** Time interval between two loop iterations (in milliseconds), @default 0 */\n loopIntervalInMs?: number;\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","ACTION_SPACE_PLACEHOLDER"],"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;;;;;;;ACyEO,MAAMI,2BAA2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"types/agents.mjs","sources":["webpack://@ui-tars-test/shared/./src/types/agents.ts"],"sourcesContent":["/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { AgentOptions } from '@tarko/agent-interface';\nimport { Factors, BaseAction, Coordinates, SupportedActionType, ActionMetadata } from './actions';\n\n/**\n * Type definition for parsed GUI response structure\n * Represents the components extracted from a model's output string\n * Aligned with tarko's web UI design\n */\nexport interface ParsedGUIResponse {\n /** raw prediction string */\n rawContent: string;\n /** parsed from Thought: `<thought>` */\n reasoningContent?: string;\n /** parsed from Action: action(params=`action`) */\n rawActionStrings?: string[];\n /** parsed from Action: action(params=`action`) */\n actions: BaseAction[];\n /** error message to feedback to LLM */\n errorMessage?: string;\n}\n\n/**\n * Type definition for function to normalize raw coordinates\n * Converts raw pixel coordinates to normalized coordinates (0-1)\n * @param rawX - Raw X coordinate in pixels\n * @param rawY - Raw Y coordinate in pixels\n * @returns Normalized coordinates {x, y} with values between 0 and 1\n */\nexport type NormalizeCoordinates = (\n rawCoords: Coordinates,\n factors?: Factors,\n) => { normalized: Coordinates };\n\n/**\n * Type definition for handler function to parse model output into ParsedGUIResponse object\n * @param prediction - The raw output from the model to be parsed\n * @returns ParsedGUIResponse object if parsing is successful, null otherwise\n */\nexport type CustomActionParser = (prediction: string) => ParsedGUIResponse | null;\n\n/**\n * Function type for serializing supported actions to string format\n * @param actions - Array of supported action types\n * @returns String representation of the actions for agent processing\n */\nexport type SerializeSupportedActions = (actions: Array<SupportedActionType>) => string;\n\nexport type ExecuteParams = {\n /** Required actions to execute */\n actions: BaseAction[];\n} & Partial<Omit<ParsedGUIResponse, 'actions'>> &\n Record<string, any>;\n\nexport type ExecuteOutput = {\n status: 'success' | 'failed';\n errorMessage?: string;\n url?: string; // url of the page\n} & Record<string, any>;\n\n/**\n * Function type for calculating detail level based on image dimensions\n */\nexport type ImageDetailCalculator = (width: number, height: number) => 'low' | 'high' | 'auto';\n\nexport interface ScreenshotOutput extends ExecuteOutput {\n /** screenshot base64, `keep screenshot size as physical pixels` */\n base64: string;\n}\n\n/**\n * Reserved placeholder name for action space in system prompt template\n */\nexport const ACTION_SPACE_PLACEHOLDER = 'action_space';\n\n/**\n * Interface for system prompt template configuration\n */\nexport interface SystemPromptTemplate {\n /**\n * Template string with placeholders. Must include an action space placeholder\n * `{{${ACTION_SPACE_PLACEHOLDER}}}` that will be replaced with the string representation of available actions\n */\n template: string;\n\n /**\n * Function to convert BaseAction array to string representation for the action space\n * This will be used to fill the action space placeholder in the template\n */\n actionsToString?: SerializeSupportedActions;\n\n /**\n * Optional map of additional placeholder values to be replaced in the template\n * Keys are placeholder names, values are the replacement strings\n * Note: '${ACTION_SPACE_PLACEHOLDER}' is a reserved placeholder and should NOT be included here\n * as it will be automatically filled using the actionsToString function\n */\n // placeholders?: Omit<Record<string, string>, typeof ACTION_SPACE_PLACEHOLDER>;\n placeholders?: Record<string, string>;\n}\n\nexport interface GUIAgentConfig<TOperator> extends AgentOptions {\n operator: TOperator;\n // ===== Optional =====\n /**\n * System prompt configuration. Can be either:\n * - A simple string (legacy mode)\n * - An array of strings or chat messages (will be concatenated)\n * - A SystemPromptTemplate object with template and actionsToString function\n */\n systemPrompt?: string | Array<string | { role: string; content: string }> | SystemPromptTemplate;\n /** The handler function to parse model output into PredictionParsed object */\n customeActionParser?: CustomActionParser;\n /** The function to normalize raw coordinates */\n normalizeCoordinates?: NormalizeCoordinates;\n /** The function to calculate detail level based on image dimensions */\n detailCalculator?: ImageDetailCalculator;\n /** Maximum number of turns for Agent to execute, @default 1000 */\n maxLoopCount?: number;\n /** Time interval between two loop iterations (in milliseconds), @default 0 */\n loopIntervalInMs?: number;\n}\n"],"names":["ACTION_SPACE_PLACEHOLDER"],"mappings":";;;;AA+EO,MAAMA,2BAA2B"}
1
+ {"version":3,"file":"types/agents.mjs","sources":["webpack://@ui-tars-test/shared/./src/types/agents.ts"],"sourcesContent":["/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { AgentOptions } from '@ui-tars-test/tarko-agent-interface';\nimport { Factors, BaseAction, Coordinates, SupportedActionType, ActionMetadata } from './actions';\n\n/**\n * Type definition for parsed GUI response structure\n * Represents the components extracted from a model's output string\n * Aligned with tarko's web UI design\n */\nexport interface ParsedGUIResponse {\n /** raw prediction string */\n rawContent: string;\n /** parsed from Thought: `<thought>` */\n reasoningContent?: string;\n /** parsed from Action: action(params=`action`) */\n rawActionStrings?: string[];\n /** parsed from Action: action(params=`action`) */\n actions: BaseAction[];\n /** error message to feedback to LLM */\n errorMessage?: string;\n}\n\n/**\n * Type definition for function to normalize raw coordinates\n * Converts raw pixel coordinates to normalized coordinates (0-1)\n * @param rawX - Raw X coordinate in pixels\n * @param rawY - Raw Y coordinate in pixels\n * @returns Normalized coordinates {x, y} with values between 0 and 1\n */\nexport type NormalizeCoordinates = (\n rawCoords: Coordinates,\n factors?: Factors,\n) => { normalized: Coordinates };\n\n/**\n * Type definition for handler function to parse model output into ParsedGUIResponse object\n * @param prediction - The raw output from the model to be parsed\n * @returns ParsedGUIResponse object if parsing is successful, null otherwise\n */\nexport type CustomActionParser = (prediction: string) => ParsedGUIResponse | null;\n\n/**\n * Function type for serializing supported actions to string format\n * @param actions - Array of supported action types\n * @returns String representation of the actions for agent processing\n */\nexport type SerializeSupportedActions = (actions: Array<SupportedActionType>) => string;\n\nexport type ExecuteParams = {\n /** Required actions to execute */\n actions: BaseAction[];\n} & Partial<Omit<ParsedGUIResponse, 'actions'>> &\n Record<string, any>;\n\nexport type ExecuteOutput = {\n status: 'success' | 'failed';\n errorMessage?: string;\n url?: string; // url of the page\n} & Record<string, any>;\n\n/**\n * Function type for calculating detail level based on image dimensions\n */\nexport type ImageDetailCalculator = (width: number, height: number) => 'low' | 'high' | 'auto';\n\nexport interface ScreenshotOutput extends ExecuteOutput {\n /** screenshot base64, `keep screenshot size as physical pixels` */\n base64: string;\n}\n\n/**\n * Reserved placeholder name for action space in system prompt template\n */\nexport const ACTION_SPACE_PLACEHOLDER = 'action_space';\n\n/**\n * Interface for system prompt template configuration\n */\nexport interface SystemPromptTemplate {\n /**\n * Template string with placeholders. Must include an action space placeholder\n * `{{${ACTION_SPACE_PLACEHOLDER}}}` that will be replaced with the string representation of available actions\n */\n template: string;\n\n /**\n * Function to convert BaseAction array to string representation for the action space\n * This will be used to fill the action space placeholder in the template\n */\n actionsToString?: SerializeSupportedActions;\n\n /**\n * Optional map of additional placeholder values to be replaced in the template\n * Keys are placeholder names, values are the replacement strings\n * Note: '${ACTION_SPACE_PLACEHOLDER}' is a reserved placeholder and should NOT be included here\n * as it will be automatically filled using the actionsToString function\n */\n // placeholders?: Omit<Record<string, string>, typeof ACTION_SPACE_PLACEHOLDER>;\n placeholders?: Record<string, string>;\n}\n\nexport interface GUIAgentConfig<TOperator> extends AgentOptions {\n operator: TOperator;\n // ===== Optional =====\n /**\n * System prompt configuration. Can be either:\n * - A simple string (legacy mode)\n * - An array of strings or chat messages (will be concatenated)\n * - A SystemPromptTemplate object with template and actionsToString function\n */\n systemPrompt?: string | Array<string | { role: string; content: string }> | SystemPromptTemplate;\n /** The handler function to parse model output into PredictionParsed object */\n customeActionParser?: CustomActionParser;\n /** The function to normalize raw coordinates */\n normalizeCoordinates?: NormalizeCoordinates;\n /** The function to calculate detail level based on image dimensions */\n detailCalculator?: ImageDetailCalculator;\n /** Maximum number of turns for Agent to execute, @default 1000 */\n maxLoopCount?: number;\n /** Time interval between two loop iterations (in milliseconds), @default 0 */\n loopIntervalInMs?: number;\n}\n"],"names":["ACTION_SPACE_PLACEHOLDER"],"mappings":";;;;AA+EO,MAAMA,2BAA2B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui-tars-test/shared",
3
- "version": "0.3.6",
3
+ "version": "0.3.9",
4
4
  "description": "Shared types for GUI-Agent",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,8 +55,8 @@
55
55
  ],
56
56
  "dependencies": {
57
57
  "@agent-infra/logger": "0.0.2-beta.2",
58
- "@tarko/agent": "^0.3.1",
59
- "@tarko/agent-interface": "^0.3.0"
58
+ "@ui-tars-test/tarko-agent": "^0.3.1",
59
+ "@ui-tars-test/tarko-agent-interface": "^0.3.1"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@rslib/core": "0.10.0",
package/src/base/agent.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
 
6
- import Agent from '@tarko/agent';
6
+ import Agent from '@ui-tars-test/tarko-agent';
7
7
 
8
8
  /**
9
9
  * @abstract
@@ -5,7 +5,7 @@
5
5
 
6
6
  /* eslint-disable @typescript-eslint/no-explicit-any */
7
7
 
8
- import { AgentOptions } from '@tarko/agent-interface';
8
+ import { AgentOptions } from '@ui-tars-test/tarko-agent-interface';
9
9
  import { Factors, BaseAction, Coordinates, SupportedActionType, ActionMetadata } from './actions';
10
10
 
11
11
  /**