@ui-tars-test/shared 0.3.2
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/base/agent.d.ts +9 -0
- package/dist/base/agent.d.ts.map +1 -0
- package/dist/base/agent.js +54 -0
- package/dist/base/agent.js.map +1 -0
- package/dist/base/agent.mjs +10 -0
- package/dist/base/agent.mjs.map +1 -0
- package/dist/base/index.d.ts +4 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +84 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/index.mjs +7 -0
- package/dist/base/operator.d.ts +140 -0
- package/dist/base/operator.d.ts.map +1 -0
- package/dist/base/operator.js +112 -0
- package/dist/base/operator.js.map +1 -0
- package/dist/base/operator.mjs +75 -0
- package/dist/base/operator.mjs.map +1 -0
- package/dist/base/parser.d.ts +11 -0
- package/dist/base/parser.d.ts.map +1 -0
- package/dist/base/parser.js +43 -0
- package/dist/base/parser.js.map +1 -0
- package/dist/base/parser.mjs +9 -0
- package/dist/base/parser.mjs.map +1 -0
- package/dist/types/actions.d.ts +224 -0
- package/dist/types/actions.d.ts.map +1 -0
- package/dist/types/actions.js +155 -0
- package/dist/types/actions.js.map +1 -0
- package/dist/types/actions.mjs +115 -0
- package/dist/types/actions.mjs.map +1 -0
- package/dist/types/agents.d.ts +108 -0
- package/dist/types/agents.d.ts.map +1 -0
- package/dist/types/agents.js +42 -0
- package/dist/types/agents.js.map +1 -0
- package/dist/types/agents.mjs +8 -0
- package/dist/types/agents.mjs.map +1 -0
- package/dist/types/archived.d.ts +44 -0
- package/dist/types/archived.d.ts.map +1 -0
- package/dist/types/archived.js +86 -0
- package/dist/types/archived.js.map +1 -0
- package/dist/types/archived.mjs +46 -0
- package/dist/types/archived.mjs.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +84 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +7 -0
- package/dist/utils/actions.d.ts +15 -0
- package/dist/utils/actions.d.ts.map +1 -0
- package/dist/utils/actions.js +196 -0
- package/dist/utils/actions.js.map +1 -0
- package/dist/utils/actions.mjs +156 -0
- package/dist/utils/actions.mjs.map +1 -0
- package/dist/utils/coordinateNormalizer.d.ts +10 -0
- package/dist/utils/coordinateNormalizer.d.ts.map +1 -0
- package/dist/utils/coordinateNormalizer.js +59 -0
- package/dist/utils/coordinateNormalizer.js.map +1 -0
- package/dist/utils/coordinateNormalizer.mjs +25 -0
- package/dist/utils/coordinateNormalizer.mjs.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +93 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +8 -0
- package/dist/utils/sleep.d.ts +14 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +45 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/sleep.mjs +11 -0
- package/dist/utils/sleep.mjs.map +1 -0
- package/dist/utils/systemPromptProcessor.d.ts +16 -0
- package/dist/utils/systemPromptProcessor.d.ts.map +1 -0
- package/dist/utils/systemPromptProcessor.js +61 -0
- package/dist/utils/systemPromptProcessor.js.map +1 -0
- package/dist/utils/systemPromptProcessor.mjs +24 -0
- package/dist/utils/systemPromptProcessor.mjs.map +1 -0
- package/package.json +66 -0
- package/src/base/agent.ts +13 -0
- package/src/base/index.ts +7 -0
- package/src/base/operator.ts +221 -0
- package/src/base/parser.ts +16 -0
- package/src/types/actions.ts +382 -0
- package/src/types/agents.ts +128 -0
- package/src/types/archived.ts +55 -0
- package/src/types/index.ts +8 -0
- package/src/utils/actions.ts +244 -0
- package/src/utils/coordinateNormalizer.ts +49 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/sleep.ts +21 -0
- package/src/utils/systemPromptProcessor.ts +48 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sour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
6
|
+
var __webpack_require__ = {};
|
|
7
|
+
(()=>{
|
|
8
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
9
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: definition[key]
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
ACTION_SPACE_PLACEHOLDER: ()=>ACTION_SPACE_PLACEHOLDER
|
|
32
|
+
});
|
|
33
|
+
const ACTION_SPACE_PLACEHOLDER = 'action_space';
|
|
34
|
+
exports.ACTION_SPACE_PLACEHOLDER = __webpack_exports__.ACTION_SPACE_PLACEHOLDER;
|
|
35
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
36
|
+
"ACTION_SPACE_PLACEHOLDER"
|
|
37
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
38
|
+
Object.defineProperty(exports, '__esModule', {
|
|
39
|
+
value: true
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare enum ErrorStatusEnum {
|
|
2
|
+
/** 100000 */
|
|
3
|
+
SCREENSHOT_RETRY_ERROR = -100000,
|
|
4
|
+
/** 100001 */
|
|
5
|
+
INVOKE_RETRY_ERROR = -100001,
|
|
6
|
+
/** 100002 */
|
|
7
|
+
EXECUTE_RETRY_ERROR = -100002,
|
|
8
|
+
/** 100003 */
|
|
9
|
+
MODEL_SERVICE_ERROR = -100003,
|
|
10
|
+
/** 100004 */
|
|
11
|
+
REACH_MAXLOOP_ERROR = -100004,
|
|
12
|
+
/** 100005 */
|
|
13
|
+
ENVIRONMENT_ERROR = -100005,
|
|
14
|
+
/** 100099 */
|
|
15
|
+
UNKNOWN_ERROR = -100099
|
|
16
|
+
}
|
|
17
|
+
export declare class GUIAgentError extends Error {
|
|
18
|
+
status: ErrorStatusEnum;
|
|
19
|
+
message: string;
|
|
20
|
+
stack?: string;
|
|
21
|
+
constructor(status: ErrorStatusEnum, message: string, stack?: string);
|
|
22
|
+
}
|
|
23
|
+
export type Status = `${StatusEnum}`;
|
|
24
|
+
export declare enum StatusEnum {
|
|
25
|
+
INIT = "init",
|
|
26
|
+
RUNNING = "running",
|
|
27
|
+
PAUSE = "pause",
|
|
28
|
+
END = "end",
|
|
29
|
+
CALL_USER = "call_user",
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated kept for backward compatibility
|
|
32
|
+
*/
|
|
33
|
+
MAX_LOOP = "max_loop",
|
|
34
|
+
USER_STOPPED = "user_stopped",
|
|
35
|
+
ERROR = "error"
|
|
36
|
+
}
|
|
37
|
+
export interface VlmResponse {
|
|
38
|
+
generate_resp: {
|
|
39
|
+
input: string;
|
|
40
|
+
prediction: string;
|
|
41
|
+
uid: string;
|
|
42
|
+
}[];
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=archived.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archived.d.ts","sourceRoot":"","sources":["../../src/types/archived.ts"],"names":[],"mappings":"AAIA,oBAAY,eAAe;IACzB,aAAa;IACb,sBAAsB,UAAU;IAChC,aAAa;IACb,kBAAkB,UAAU;IAC5B,aAAa;IACb,mBAAmB,UAAU;IAC7B,aAAa;IACb,mBAAmB,UAAU;IAC7B,aAAa;IACb,mBAAmB,UAAU;IAC7B,aAAa;IACb,iBAAiB,UAAU;IAC3B,aAAa;IACb,aAAa,UAAU;CACxB;AAED,qBAAa,aAAc,SAAQ,KAAK;IACtC,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;gBAEH,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CAMrE;AAED,MAAM,MAAM,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;AACrC,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,SAAS,cAAc;IACvB;;OAEG;IACH,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;CAChB;AACD,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,GAAG,EAAE,MAAM,CAAC;KACb,EAAE,CAAC;CACL"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
"use strict";
|
|
6
|
+
var __webpack_require__ = {};
|
|
7
|
+
(()=>{
|
|
8
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
9
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: definition[key]
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
ErrorStatusEnum: ()=>ErrorStatusEnum,
|
|
32
|
+
GUIAgentError: ()=>GUIAgentError,
|
|
33
|
+
StatusEnum: ()=>StatusEnum
|
|
34
|
+
});
|
|
35
|
+
function _define_property(obj, key, value) {
|
|
36
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
37
|
+
value: value,
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true
|
|
41
|
+
});
|
|
42
|
+
else obj[key] = value;
|
|
43
|
+
return obj;
|
|
44
|
+
}
|
|
45
|
+
var ErrorStatusEnum = /*#__PURE__*/ function(ErrorStatusEnum) {
|
|
46
|
+
ErrorStatusEnum[ErrorStatusEnum["SCREENSHOT_RETRY_ERROR"] = -100000] = "SCREENSHOT_RETRY_ERROR";
|
|
47
|
+
ErrorStatusEnum[ErrorStatusEnum["INVOKE_RETRY_ERROR"] = -100001] = "INVOKE_RETRY_ERROR";
|
|
48
|
+
ErrorStatusEnum[ErrorStatusEnum["EXECUTE_RETRY_ERROR"] = -100002] = "EXECUTE_RETRY_ERROR";
|
|
49
|
+
ErrorStatusEnum[ErrorStatusEnum["MODEL_SERVICE_ERROR"] = -100003] = "MODEL_SERVICE_ERROR";
|
|
50
|
+
ErrorStatusEnum[ErrorStatusEnum["REACH_MAXLOOP_ERROR"] = -100004] = "REACH_MAXLOOP_ERROR";
|
|
51
|
+
ErrorStatusEnum[ErrorStatusEnum["ENVIRONMENT_ERROR"] = -100005] = "ENVIRONMENT_ERROR";
|
|
52
|
+
ErrorStatusEnum[ErrorStatusEnum["UNKNOWN_ERROR"] = -100099] = "UNKNOWN_ERROR";
|
|
53
|
+
return ErrorStatusEnum;
|
|
54
|
+
}({});
|
|
55
|
+
class GUIAgentError extends Error {
|
|
56
|
+
constructor(status, message, stack){
|
|
57
|
+
super(message), _define_property(this, "status", void 0), _define_property(this, "message", void 0), _define_property(this, "stack", void 0);
|
|
58
|
+
this.status = status;
|
|
59
|
+
this.message = message;
|
|
60
|
+
this.stack = stack;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
var StatusEnum = /*#__PURE__*/ function(StatusEnum) {
|
|
64
|
+
StatusEnum["INIT"] = "init";
|
|
65
|
+
StatusEnum["RUNNING"] = "running";
|
|
66
|
+
StatusEnum["PAUSE"] = "pause";
|
|
67
|
+
StatusEnum["END"] = "end";
|
|
68
|
+
StatusEnum["CALL_USER"] = "call_user";
|
|
69
|
+
StatusEnum["MAX_LOOP"] = "max_loop";
|
|
70
|
+
StatusEnum["USER_STOPPED"] = "user_stopped";
|
|
71
|
+
StatusEnum["ERROR"] = "error";
|
|
72
|
+
return StatusEnum;
|
|
73
|
+
}({});
|
|
74
|
+
exports.ErrorStatusEnum = __webpack_exports__.ErrorStatusEnum;
|
|
75
|
+
exports.GUIAgentError = __webpack_exports__.GUIAgentError;
|
|
76
|
+
exports.StatusEnum = __webpack_exports__.StatusEnum;
|
|
77
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
78
|
+
"ErrorStatusEnum",
|
|
79
|
+
"GUIAgentError",
|
|
80
|
+
"StatusEnum"
|
|
81
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
82
|
+
Object.defineProperty(exports, '__esModule', {
|
|
83
|
+
value: true
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=archived.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types/archived.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/archived.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 */\nexport enum ErrorStatusEnum {\n /** 100000 */\n SCREENSHOT_RETRY_ERROR = -100000,\n /** 100001 */\n INVOKE_RETRY_ERROR = -100001,\n /** 100002 */\n EXECUTE_RETRY_ERROR = -100002,\n /** 100003 */\n MODEL_SERVICE_ERROR = -100003,\n /** 100004 */\n REACH_MAXLOOP_ERROR = -100004,\n /** 100005 */\n ENVIRONMENT_ERROR = -100005,\n /** 100099 */\n UNKNOWN_ERROR = -100099,\n}\n\nexport class GUIAgentError extends Error {\n status: ErrorStatusEnum;\n message: string;\n stack?: string;\n\n constructor(status: ErrorStatusEnum, message: string, stack?: string) {\n super(message);\n this.status = status;\n this.message = message;\n this.stack = stack;\n }\n}\n\nexport type Status = `${StatusEnum}`;\nexport enum StatusEnum {\n INIT = 'init',\n RUNNING = 'running',\n PAUSE = 'pause',\n END = 'end',\n CALL_USER = 'call_user',\n /**\n * @deprecated kept for backward compatibility\n */\n MAX_LOOP = 'max_loop',\n USER_STOPPED = 'user_stopped',\n ERROR = 'error',\n}\nexport interface VlmResponse {\n generate_resp: {\n input: string;\n prediction: string;\n uid: string;\n }[];\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","ErrorStatusEnum","GUIAgentError","Error","status","message","stack","StatusEnum"],"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;;;;;;;;;ACHC;;;;;;;;;;AACM,IAAKI,kBAAAA,WAAAA,GAAAA,SAAAA,eAAe;IACd;IAEA;IAEA;IAEA;IAEA;IAEA;IAEA;WAbDA;;AAiBL,MAAMC,sBAAsBC;IAKjC,YAAYC,MAAuB,EAAEC,OAAe,EAAEC,KAAc,CAAE;QACpE,KAAK,CAACD,UALR,0CACA,2CACA;QAIE,IAAI,CAAC,MAAM,GAAGD;QACd,IAAI,CAAC,OAAO,GAAGC;QACf,IAAI,CAAC,KAAK,GAAGC;IACf;AACF;AAGO,IAAKC,aAAAA,WAAAA,GAAAA,SAAAA,UAAU;;;;;;IAQnB;;;WARSA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
function _define_property(obj, key, value) {
|
|
6
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
7
|
+
value: value,
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true
|
|
11
|
+
});
|
|
12
|
+
else obj[key] = value;
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
var archived_ErrorStatusEnum = /*#__PURE__*/ function(ErrorStatusEnum) {
|
|
16
|
+
ErrorStatusEnum[ErrorStatusEnum["SCREENSHOT_RETRY_ERROR"] = -100000] = "SCREENSHOT_RETRY_ERROR";
|
|
17
|
+
ErrorStatusEnum[ErrorStatusEnum["INVOKE_RETRY_ERROR"] = -100001] = "INVOKE_RETRY_ERROR";
|
|
18
|
+
ErrorStatusEnum[ErrorStatusEnum["EXECUTE_RETRY_ERROR"] = -100002] = "EXECUTE_RETRY_ERROR";
|
|
19
|
+
ErrorStatusEnum[ErrorStatusEnum["MODEL_SERVICE_ERROR"] = -100003] = "MODEL_SERVICE_ERROR";
|
|
20
|
+
ErrorStatusEnum[ErrorStatusEnum["REACH_MAXLOOP_ERROR"] = -100004] = "REACH_MAXLOOP_ERROR";
|
|
21
|
+
ErrorStatusEnum[ErrorStatusEnum["ENVIRONMENT_ERROR"] = -100005] = "ENVIRONMENT_ERROR";
|
|
22
|
+
ErrorStatusEnum[ErrorStatusEnum["UNKNOWN_ERROR"] = -100099] = "UNKNOWN_ERROR";
|
|
23
|
+
return ErrorStatusEnum;
|
|
24
|
+
}({});
|
|
25
|
+
class GUIAgentError extends Error {
|
|
26
|
+
constructor(status, message, stack){
|
|
27
|
+
super(message), _define_property(this, "status", void 0), _define_property(this, "message", void 0), _define_property(this, "stack", void 0);
|
|
28
|
+
this.status = status;
|
|
29
|
+
this.message = message;
|
|
30
|
+
this.stack = stack;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
var archived_StatusEnum = /*#__PURE__*/ function(StatusEnum) {
|
|
34
|
+
StatusEnum["INIT"] = "init";
|
|
35
|
+
StatusEnum["RUNNING"] = "running";
|
|
36
|
+
StatusEnum["PAUSE"] = "pause";
|
|
37
|
+
StatusEnum["END"] = "end";
|
|
38
|
+
StatusEnum["CALL_USER"] = "call_user";
|
|
39
|
+
StatusEnum["MAX_LOOP"] = "max_loop";
|
|
40
|
+
StatusEnum["USER_STOPPED"] = "user_stopped";
|
|
41
|
+
StatusEnum["ERROR"] = "error";
|
|
42
|
+
return StatusEnum;
|
|
43
|
+
}({});
|
|
44
|
+
export { archived_ErrorStatusEnum as ErrorStatusEnum, GUIAgentError, archived_StatusEnum as StatusEnum };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=archived.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types/archived.mjs","sources":["webpack://@ui-tars-test/shared/./src/types/archived.ts"],"sourcesContent":["/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\nexport enum ErrorStatusEnum {\n /** 100000 */\n SCREENSHOT_RETRY_ERROR = -100000,\n /** 100001 */\n INVOKE_RETRY_ERROR = -100001,\n /** 100002 */\n EXECUTE_RETRY_ERROR = -100002,\n /** 100003 */\n MODEL_SERVICE_ERROR = -100003,\n /** 100004 */\n REACH_MAXLOOP_ERROR = -100004,\n /** 100005 */\n ENVIRONMENT_ERROR = -100005,\n /** 100099 */\n UNKNOWN_ERROR = -100099,\n}\n\nexport class GUIAgentError extends Error {\n status: ErrorStatusEnum;\n message: string;\n stack?: string;\n\n constructor(status: ErrorStatusEnum, message: string, stack?: string) {\n super(message);\n this.status = status;\n this.message = message;\n this.stack = stack;\n }\n}\n\nexport type Status = `${StatusEnum}`;\nexport enum StatusEnum {\n INIT = 'init',\n RUNNING = 'running',\n PAUSE = 'pause',\n END = 'end',\n CALL_USER = 'call_user',\n /**\n * @deprecated kept for backward compatibility\n */\n MAX_LOOP = 'max_loop',\n USER_STOPPED = 'user_stopped',\n ERROR = 'error',\n}\nexport interface VlmResponse {\n generate_resp: {\n input: string;\n prediction: string;\n uid: string;\n }[];\n}\n"],"names":["ErrorStatusEnum","GUIAgentError","Error","status","message","stack","StatusEnum"],"mappings":";;;;AAGC;;;;;;;;;;AACM,IAAKA,2BAAeA,WAAAA,GAAAA,SAAfA,eAAe;IACd;IAEA;IAEA;IAEA;IAEA;IAEA;IAEA;WAbDA;;AAiBL,MAAMC,sBAAsBC;IAKjC,YAAYC,MAAuB,EAAEC,OAAe,EAAEC,KAAc,CAAE;QACpE,KAAK,CAACD,UALR,0CACA,2CACA;QAIE,IAAI,CAAC,MAAM,GAAGD;QACd,IAAI,CAAC,OAAO,GAAGC;QACf,IAAI,CAAC,KAAK,GAAGC;IACf;AACF;AAGO,IAAKC,sBAAUA,WAAAA,GAAAA,SAAVA,UAAU;;;;;;IAQnB;;;WARSA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
"use strict";
|
|
6
|
+
var __webpack_modules__ = {
|
|
7
|
+
"./actions": function(module) {
|
|
8
|
+
module.exports = require("./actions.js");
|
|
9
|
+
},
|
|
10
|
+
"./agents": function(module) {
|
|
11
|
+
module.exports = require("./agents.js");
|
|
12
|
+
},
|
|
13
|
+
"./archived": function(module) {
|
|
14
|
+
module.exports = require("./archived.js");
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var __webpack_module_cache__ = {};
|
|
18
|
+
function __webpack_require__(moduleId) {
|
|
19
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
20
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
21
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
22
|
+
exports: {}
|
|
23
|
+
};
|
|
24
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
25
|
+
return module.exports;
|
|
26
|
+
}
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.n = (module)=>{
|
|
29
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
30
|
+
__webpack_require__.d(getter, {
|
|
31
|
+
a: getter
|
|
32
|
+
});
|
|
33
|
+
return getter;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
(()=>{
|
|
37
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
38
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: definition[key]
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
(()=>{
|
|
45
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
46
|
+
})();
|
|
47
|
+
(()=>{
|
|
48
|
+
__webpack_require__.r = (exports1)=>{
|
|
49
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
50
|
+
value: 'Module'
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
53
|
+
value: true
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
})();
|
|
57
|
+
var __webpack_exports__ = {};
|
|
58
|
+
(()=>{
|
|
59
|
+
__webpack_require__.r(__webpack_exports__);
|
|
60
|
+
var _archived__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./archived");
|
|
61
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
62
|
+
for(var __WEBPACK_IMPORT_KEY__ in _archived__WEBPACK_IMPORTED_MODULE_0__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
63
|
+
return _archived__WEBPACK_IMPORTED_MODULE_0__[key];
|
|
64
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
65
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
66
|
+
var _actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./actions");
|
|
67
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
68
|
+
for(var __WEBPACK_IMPORT_KEY__ in _actions__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
69
|
+
return _actions__WEBPACK_IMPORTED_MODULE_1__[key];
|
|
70
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
71
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
72
|
+
var _agents__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./agents");
|
|
73
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
74
|
+
for(var __WEBPACK_IMPORT_KEY__ in _agents__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
75
|
+
return _agents__WEBPACK_IMPORTED_MODULE_2__[key];
|
|
76
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
77
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
78
|
+
})();
|
|
79
|
+
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
80
|
+
Object.defineProperty(exports, '__esModule', {
|
|
81
|
+
value: true
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types/index.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"],"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};"],"names":["__webpack_require__","module","getter","definition","key","Object","obj","prop","Symbol"],"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseAction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Serializes a BaseAction into a string representation
|
|
4
|
+
* Format: "actionType(param1='value1', param2='value2', ...)"
|
|
5
|
+
*/
|
|
6
|
+
export declare function serializeAction<T extends string, I extends Record<string, any>>(action: BaseAction<T, I>): string;
|
|
7
|
+
export declare function unifyActionType(name: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Standardizes action input field names using mapping tables
|
|
10
|
+
* @param actionType The type of action being performed
|
|
11
|
+
* @param inputName The original input field name
|
|
12
|
+
* @returns The standardized input field name
|
|
13
|
+
*/
|
|
14
|
+
export declare function unifyActionInputName(actionType: string, inputName: string): string;
|
|
15
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/utils/actions.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7E,MAAM,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GACvB,MAAM,CA4BR;AA+FD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,UAG3C;AAqFD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAWlF"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
"use strict";
|
|
6
|
+
var __webpack_require__ = {};
|
|
7
|
+
(()=>{
|
|
8
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
9
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: definition[key]
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
serializeAction: ()=>serializeAction,
|
|
32
|
+
unifyActionInputName: ()=>unifyActionInputName,
|
|
33
|
+
unifyActionType: ()=>unifyActionType
|
|
34
|
+
});
|
|
35
|
+
function serializeAction(action) {
|
|
36
|
+
const { type, inputs } = action;
|
|
37
|
+
const params = Object.entries(inputs).map(([key, value])=>{
|
|
38
|
+
if ('string' == typeof value) return `${key}='${value}'`;
|
|
39
|
+
if ('object' == typeof value && null !== value) {
|
|
40
|
+
if (value.raw) return `${key}='(${value.raw.x}, ${value.raw.y})'`;
|
|
41
|
+
if (value.referenceBox) return `${key}='<bbox>${value.referenceBox.x1}, ${value.referenceBox.y1}, ${value.referenceBox.x2}, ${value.referenceBox.y2}</bbox>'`;
|
|
42
|
+
if (value.normalized) return `${key}='(${value.normalized.x}, ${value.normalized.y})'`;
|
|
43
|
+
}
|
|
44
|
+
if ('wait' === type && 'number' == typeof value) return `${key}='${value}s'`;
|
|
45
|
+
if ('navigate' === type && 'string' == typeof value) return `url='${value}'`;
|
|
46
|
+
return "unsupported";
|
|
47
|
+
}).join(', ');
|
|
48
|
+
return `${type}(${params})`;
|
|
49
|
+
}
|
|
50
|
+
const actionTypeMap = {
|
|
51
|
+
snapshot: 'screenshot',
|
|
52
|
+
screenshot: 'screenshot',
|
|
53
|
+
take_screenshot: 'screenshot',
|
|
54
|
+
takescreenshot: 'screenshot',
|
|
55
|
+
click: 'click',
|
|
56
|
+
left_click: 'click',
|
|
57
|
+
left_single: 'click',
|
|
58
|
+
leftclick: 'click',
|
|
59
|
+
leftsingle: 'click',
|
|
60
|
+
double_click: 'double_click',
|
|
61
|
+
left_double: 'double_click',
|
|
62
|
+
doubleclick: 'double_click',
|
|
63
|
+
leftdouble: 'double_click',
|
|
64
|
+
right_click: 'right_click',
|
|
65
|
+
right_single: 'right_click',
|
|
66
|
+
rightclick: 'right_click',
|
|
67
|
+
rightsingle: 'right_click',
|
|
68
|
+
middle_click: 'middle_click',
|
|
69
|
+
middle_single: 'middle_click',
|
|
70
|
+
middleclick: 'middle_click',
|
|
71
|
+
middlesingle: 'middle_click',
|
|
72
|
+
move: 'mouse_move',
|
|
73
|
+
move_to: 'mouse_move',
|
|
74
|
+
mouse_move: 'mouse_move',
|
|
75
|
+
moveto: 'mouse_move',
|
|
76
|
+
mousemove: 'mouse_move',
|
|
77
|
+
hover: 'mouse_move',
|
|
78
|
+
mouse_down: 'mouse_down',
|
|
79
|
+
mousedown: 'mouse_down',
|
|
80
|
+
mouse_up: 'mouse_up',
|
|
81
|
+
mouseup: 'mouse_up',
|
|
82
|
+
drag: 'drag',
|
|
83
|
+
select: 'drag',
|
|
84
|
+
left_click_drag: 'drag',
|
|
85
|
+
leftclickdrag: 'drag',
|
|
86
|
+
swipe: 'swipe',
|
|
87
|
+
scroll: 'scroll',
|
|
88
|
+
type: 'type',
|
|
89
|
+
hotkey: 'hotkey',
|
|
90
|
+
press: 'press',
|
|
91
|
+
release: 'release',
|
|
92
|
+
navigate: 'navigate',
|
|
93
|
+
navigate_back: 'navigate_back',
|
|
94
|
+
navigateback: 'navigate_back',
|
|
95
|
+
long_press: 'long_press',
|
|
96
|
+
longpress: 'long_press',
|
|
97
|
+
home: 'press_home',
|
|
98
|
+
press_home: 'press_home',
|
|
99
|
+
presshome: 'press_home',
|
|
100
|
+
back: 'press_back',
|
|
101
|
+
press_back: 'press_back',
|
|
102
|
+
pressback: 'press_back',
|
|
103
|
+
open: 'open_app',
|
|
104
|
+
open_app: 'open_app',
|
|
105
|
+
openapp: 'open_app',
|
|
106
|
+
wait: 'wait',
|
|
107
|
+
finished: 'finished',
|
|
108
|
+
call_user: 'call_user',
|
|
109
|
+
calluser: 'call_user'
|
|
110
|
+
};
|
|
111
|
+
function unifyActionType(name) {
|
|
112
|
+
name = name.toLowerCase();
|
|
113
|
+
return actionTypeMap[name] || name;
|
|
114
|
+
}
|
|
115
|
+
const actionInputNameMap = {
|
|
116
|
+
start: 'start',
|
|
117
|
+
start_box: 'start',
|
|
118
|
+
startbox: 'start',
|
|
119
|
+
start_point: 'start',
|
|
120
|
+
start_position: 'start',
|
|
121
|
+
start_coordinate: 'start',
|
|
122
|
+
start_coordinates: 'start',
|
|
123
|
+
end: 'end',
|
|
124
|
+
end_box: 'end',
|
|
125
|
+
endbox: 'end',
|
|
126
|
+
end_point: 'end',
|
|
127
|
+
end_position: 'end',
|
|
128
|
+
end_coordinate: 'end',
|
|
129
|
+
end_coordinates: 'end',
|
|
130
|
+
point: 'point',
|
|
131
|
+
position: 'point',
|
|
132
|
+
coordinate: 'point',
|
|
133
|
+
coordinates: 'point',
|
|
134
|
+
button: 'button',
|
|
135
|
+
mouse_button: 'button',
|
|
136
|
+
mousebutton: 'button',
|
|
137
|
+
direction: 'direction',
|
|
138
|
+
dir: 'direction',
|
|
139
|
+
scroll_direction: 'direction',
|
|
140
|
+
scrolldirection: 'direction',
|
|
141
|
+
content: 'content',
|
|
142
|
+
text: 'content',
|
|
143
|
+
input_text: 'content',
|
|
144
|
+
inputtext: 'content',
|
|
145
|
+
type: 'content',
|
|
146
|
+
key: 'key',
|
|
147
|
+
keyname: 'key',
|
|
148
|
+
hotkey: 'key',
|
|
149
|
+
keyboard_key: 'key',
|
|
150
|
+
keyboardkey: 'key',
|
|
151
|
+
url: 'url',
|
|
152
|
+
link: 'url',
|
|
153
|
+
website: 'url',
|
|
154
|
+
name: 'name',
|
|
155
|
+
appname: 'name',
|
|
156
|
+
app_name: 'name',
|
|
157
|
+
application: 'name',
|
|
158
|
+
time: 'time',
|
|
159
|
+
duration: 'time',
|
|
160
|
+
wait_time: 'time',
|
|
161
|
+
waittime: 'time',
|
|
162
|
+
delay: 'time'
|
|
163
|
+
};
|
|
164
|
+
const actionTypeSpecificMappings = {
|
|
165
|
+
navigate: {
|
|
166
|
+
content: 'url',
|
|
167
|
+
url: 'url'
|
|
168
|
+
},
|
|
169
|
+
open_app: {
|
|
170
|
+
content: 'name',
|
|
171
|
+
appname: 'name',
|
|
172
|
+
app_name: 'name',
|
|
173
|
+
name: 'name'
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
function unifyActionInputName(actionType, inputName) {
|
|
177
|
+
actionType = actionType.toLowerCase();
|
|
178
|
+
inputName = inputName.toLowerCase();
|
|
179
|
+
actionType = unifyActionType(actionType);
|
|
180
|
+
const typeSpecificMap = actionTypeSpecificMappings[actionType];
|
|
181
|
+
if (typeSpecificMap && typeSpecificMap[inputName]) return typeSpecificMap[inputName];
|
|
182
|
+
return actionInputNameMap[inputName] || inputName;
|
|
183
|
+
}
|
|
184
|
+
exports.serializeAction = __webpack_exports__.serializeAction;
|
|
185
|
+
exports.unifyActionInputName = __webpack_exports__.unifyActionInputName;
|
|
186
|
+
exports.unifyActionType = __webpack_exports__.unifyActionType;
|
|
187
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
188
|
+
"serializeAction",
|
|
189
|
+
"unifyActionInputName",
|
|
190
|
+
"unifyActionType"
|
|
191
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
192
|
+
Object.defineProperty(exports, '__esModule', {
|
|
193
|
+
value: true
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils/actions.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/utils/actions.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 { BaseAction } from '../types';\n\n/**\n * Serializes a BaseAction into a string representation\n * Format: \"actionType(param1='value1', param2='value2', ...)\"\n */\nexport function serializeAction<T extends string, I extends Record<string, any>>(\n action: BaseAction<T, I>,\n): string {\n const { type, inputs } = action;\n const params = Object.entries(inputs)\n .map(([key, value]) => {\n if (typeof value === 'string') {\n return `${key}='${value}'`;\n }\n if (typeof value === 'object' && value !== null) {\n if (value.raw) {\n return `${key}='(${value.raw.x}, ${value.raw.y})'`;\n }\n if (value.referenceBox) {\n return `${key}='<bbox>${value.referenceBox.x1}, ${value.referenceBox.y1}, ${value.referenceBox.x2}, ${value.referenceBox.y2}</bbox>'`;\n }\n if (value.normalized) {\n return `${key}='(${value.normalized.x}, ${value.normalized.y})'`;\n }\n }\n if (type === 'wait' && typeof value === 'number') {\n return `${key}='${value}s'`;\n }\n if (type === 'navigate' && typeof value === 'string') {\n return `url='${value}'`;\n }\n return `unsupported`;\n })\n .join(', ');\n return `${type}(${params})`;\n}\n\nconst actionTypeMap: Record<string, string> = {\n // ---- ScreenShotAction ----\n\n snapshot: 'screenshot',\n screenshot: 'screenshot',\n take_screenshot: 'screenshot',\n takescreenshot: 'screenshot',\n\n // ---- Mouse Actions ----\n\n // click\n click: 'click',\n left_click: 'click',\n left_single: 'click',\n leftclick: 'click',\n leftsingle: 'click',\n // double click\n double_click: 'double_click',\n left_double: 'double_click',\n doubleclick: 'double_click',\n leftdouble: 'double_click',\n // right click\n right_click: 'right_click',\n right_single: 'right_click',\n rightclick: 'right_click',\n rightsingle: 'right_click',\n // middle click\n middle_click: 'middle_click',\n middle_single: 'middle_click',\n middleclick: 'middle_click',\n middlesingle: 'middle_click',\n // mouse move\n move: 'mouse_move',\n move_to: 'mouse_move',\n mouse_move: 'mouse_move',\n moveto: 'mouse_move',\n mousemove: 'mouse_move',\n hover: 'mouse_move',\n // mouse down\n mouse_down: 'mouse_down',\n mousedown: 'mouse_down',\n // mouse up\n mouse_up: 'mouse_up',\n mouseup: 'mouse_up',\n // drag\n drag: 'drag',\n select: 'drag',\n left_click_drag: 'drag',\n leftclickdrag: 'drag',\n // swipe\n swipe: 'swipe',\n // scroll\n scroll: 'scroll',\n\n // ---- Keyboard Actions ----\n\n type: 'type',\n hotkey: 'hotkey',\n press: 'press',\n release: 'release',\n\n // ---- Browser Actions ----\n\n navigate: 'navigate',\n navigate_back: 'navigate_back',\n navigateback: 'navigate_back',\n\n // ---- App Actions ----\n\n // long press\n long_press: 'long_press',\n longpress: 'long_press',\n // home\n home: 'press_home',\n press_home: 'press_home',\n presshome: 'press_home',\n // back\n back: 'press_back',\n press_back: 'press_back',\n pressback: 'press_back',\n // open app\n open: 'open_app',\n open_app: 'open_app',\n openapp: 'open_app',\n\n // ---- Agent Actions ----\n\n wait: 'wait',\n finished: 'finished',\n call_user: 'call_user',\n calluser: 'call_user',\n};\n\nexport function unifyActionType(name: string) {\n name = name.toLowerCase();\n return actionTypeMap[name] || name;\n}\n\nconst actionInputNameMap: Record<string, string> = {\n // ---- Start related fields ----\n start: 'start',\n start_box: 'start',\n startbox: 'start',\n start_point: 'start',\n start_position: 'start',\n start_coordinate: 'start',\n start_coordinates: 'start',\n\n // ---- End related fields ----\n end: 'end',\n end_box: 'end',\n endbox: 'end',\n end_point: 'end',\n end_position: 'end',\n end_coordinate: 'end',\n end_coordinates: 'end',\n\n // ---- Point related fields ----\n point: 'point',\n position: 'point',\n coordinate: 'point',\n coordinates: 'point',\n\n // ---- Button related fields ----\n button: 'button',\n mouse_button: 'button',\n mousebutton: 'button',\n\n // ---- Direction related fields ----\n direction: 'direction',\n dir: 'direction',\n scroll_direction: 'direction',\n scrolldirection: 'direction',\n\n // ---- Content related fields ----\n content: 'content',\n text: 'content',\n input_text: 'content',\n inputtext: 'content',\n type: 'content',\n\n // ---- Key related fields ----\n key: 'key',\n keyname: 'key',\n hotkey: 'key',\n keyboard_key: 'key',\n keyboardkey: 'key',\n\n // ---- URL related fields ----\n url: 'url',\n link: 'url',\n website: 'url',\n\n // ---- Name related fields ----\n name: 'name',\n appname: 'name',\n app_name: 'name',\n application: 'name',\n\n // ---- Time related fields ----\n time: 'time',\n duration: 'time',\n wait_time: 'time',\n waittime: 'time',\n delay: 'time',\n};\n\n// Special mappings based on action type\nconst actionTypeSpecificMappings: Record<string, Record<string, string>> = {\n navigate: {\n content: 'url',\n url: 'url',\n },\n open_app: {\n content: 'name',\n appname: 'name',\n app_name: 'name',\n name: 'name',\n },\n};\n\n/**\n * Standardizes action input field names using mapping tables\n * @param actionType The type of action being performed\n * @param inputName The original input field name\n * @returns The standardized input field name\n */\nexport function unifyActionInputName(actionType: string, inputName: string): string {\n actionType = actionType.toLowerCase();\n inputName = inputName.toLowerCase();\n actionType = unifyActionType(actionType);\n // First check for action type specific mappings\n const typeSpecificMap = actionTypeSpecificMappings[actionType];\n if (typeSpecificMap && typeSpecificMap[inputName]) {\n return typeSpecificMap[inputName];\n }\n // Then check general mappings\n return actionInputNameMap[inputName] || inputName;\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","serializeAction","action","type","inputs","params","value","actionTypeMap","unifyActionType","name","actionInputNameMap","actionTypeSpecificMappings","unifyActionInputName","actionType","inputName","typeSpecificMap"],"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,UAA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