@midscene/visualizer 0.26.2-beta-20250812091127.0 → 0.26.3-beta-20250813021342.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/es/blank_polyfill.mjs +2 -0
  2. package/dist/es/component/blackboard.css +12 -5
  3. package/dist/es/component/blackboard.mjs +266 -0
  4. package/dist/es/component/color.mjs +35 -0
  5. package/dist/es/component/describer.css +9 -5
  6. package/dist/es/component/describer.mjs +128 -0
  7. package/dist/es/component/env-config.mjs +112 -0
  8. package/dist/es/component/github-star.css +1 -0
  9. package/dist/es/component/github-star.mjs +20 -0
  10. package/dist/es/component/logo.css +5 -3
  11. package/dist/es/component/logo.mjs +20 -0
  12. package/dist/es/component/misc.mjs +54 -0
  13. package/dist/es/component/pixi-loader.mjs +16 -0
  14. package/dist/es/component/player.css +88 -70
  15. package/dist/es/component/player.mjs +628 -0
  16. package/dist/es/component/playground/ConfigSelector.mjs +53 -0
  17. package/dist/es/component/playground/ContextPreview.mjs +39 -0
  18. package/dist/es/component/playground/HistorySelector.mjs +193 -0
  19. package/dist/es/component/playground/PlaygroundResult.mjs +60 -0
  20. package/dist/es/component/playground/PromptInput.mjs +225 -0
  21. package/dist/es/component/playground/ServiceModeControl.mjs +100 -0
  22. package/dist/es/component/playground/index.css +140 -98
  23. package/dist/es/component/playground/playground-constants.mjs +45 -0
  24. package/dist/es/component/playground/playground-utils.mjs +89 -0
  25. package/dist/es/component/playground/useServerValid.mjs +27 -0
  26. package/dist/es/component/playground/useStaticPageAgent.mjs +12 -0
  27. package/dist/es/component/replay-scripts.mjs +271 -0
  28. package/dist/es/component/shiny-text.css +33 -22
  29. package/dist/es/component/shiny-text.mjs +15 -0
  30. package/dist/es/component/store/history.mjs +55 -0
  31. package/dist/es/component/store/store.mjs +128 -0
  32. package/dist/es/icons/close.mjs +19 -0
  33. package/dist/es/icons/history.mjs +30 -0
  34. package/dist/es/icons/magnifying-glass.mjs +39 -0
  35. package/dist/es/icons/setting.mjs +20 -0
  36. package/dist/es/index.mjs +21 -0
  37. package/dist/es/init.mjs +10 -0
  38. package/dist/es/{utils.js → utils.mjs} +51 -75
  39. package/dist/lib/blank_polyfill.js +34 -38
  40. package/dist/lib/component/blackboard.css +12 -5
  41. package/dist/lib/component/blackboard.js +293 -306
  42. package/dist/lib/component/color.js +64 -74
  43. package/dist/lib/component/describer.css +9 -5
  44. package/dist/lib/component/describer.js +158 -198
  45. package/dist/lib/component/env-config.js +142 -147
  46. package/dist/lib/component/github-star.css +1 -0
  47. package/dist/lib/component/github-star.js +51 -62
  48. package/dist/lib/component/logo.css +5 -3
  49. package/dist/lib/component/logo.js +53 -56
  50. package/dist/lib/component/misc.js +85 -84
  51. package/dist/lib/component/pixi-loader.js +49 -80
  52. package/dist/lib/component/player.css +88 -70
  53. package/dist/lib/component/player.js +627 -738
  54. package/dist/lib/component/playground/ConfigSelector.js +91 -92
  55. package/dist/lib/component/playground/ContextPreview.js +80 -72
  56. package/dist/lib/component/playground/HistorySelector.js +234 -197
  57. package/dist/lib/component/playground/PlaygroundResult.js +100 -103
  58. package/dist/lib/component/playground/PromptInput.js +250 -237
  59. package/dist/lib/component/playground/ServiceModeControl.js +124 -124
  60. package/dist/lib/component/playground/index.css +140 -98
  61. package/dist/lib/component/playground/playground-constants.js +97 -73
  62. package/dist/lib/component/playground/playground-types.js +17 -31
  63. package/dist/lib/component/playground/playground-utils.js +140 -168
  64. package/dist/lib/component/playground/useServerValid.js +55 -86
  65. package/dist/lib/component/playground/useStaticPageAgent.js +45 -51
  66. package/dist/lib/component/replay-scripts.js +291 -373
  67. package/dist/lib/component/shiny-text.css +33 -22
  68. package/dist/lib/component/shiny-text.js +46 -57
  69. package/dist/lib/component/store/history.js +58 -64
  70. package/dist/lib/component/store/store.js +132 -128
  71. package/dist/lib/icons/close.js +53 -0
  72. package/dist/lib/icons/history.js +64 -0
  73. package/dist/lib/icons/magnifying-glass.js +73 -0
  74. package/dist/lib/icons/setting.js +54 -0
  75. package/dist/lib/index.js +158 -124
  76. package/dist/lib/init.js +39 -46
  77. package/dist/lib/utils.js +105 -109
  78. package/dist/types/blank_polyfill.d.ts +2 -2
  79. package/dist/types/component/playground/ConfigSelector.d.ts +1 -0
  80. package/dist/types/component/playground/ContextPreview.d.ts +1 -0
  81. package/dist/types/component/playground/HistorySelector.d.ts +1 -0
  82. package/dist/types/component/playground/PlaygroundResult.d.ts +1 -0
  83. package/dist/types/component/playground/PromptInput.d.ts +1 -0
  84. package/dist/types/component/playground/ServiceModeControl.d.ts +1 -0
  85. package/package.json +16 -18
  86. package/dist/es/assets/close.909351c0.svg +0 -4
  87. package/dist/es/assets/history.164a4eab.svg +0 -4
  88. package/dist/es/assets/magnifying-glass.9498e70e.svg +0 -12
  89. package/dist/es/assets/setting.80ab7285.svg +0 -11
  90. package/dist/es/blank_polyfill.js +0 -10
  91. package/dist/es/component/blackboard.js +0 -286
  92. package/dist/es/component/color.js +0 -49
  93. package/dist/es/component/describer.js +0 -173
  94. package/dist/es/component/env-config.js +0 -117
  95. package/dist/es/component/github-star.js +0 -31
  96. package/dist/es/component/logo.js +0 -25
  97. package/dist/es/component/misc.js +0 -63
  98. package/dist/es/component/pixi-loader.js +0 -51
  99. package/dist/es/component/player.js +0 -746
  100. package/dist/es/component/playground/ConfigSelector.js +0 -64
  101. package/dist/es/component/playground/ContextPreview.js +0 -42
  102. package/dist/es/component/playground/HistorySelector.js +0 -168
  103. package/dist/es/component/playground/PlaygroundResult.js +0 -73
  104. package/dist/es/component/playground/PromptInput.js +0 -212
  105. package/dist/es/component/playground/ServiceModeControl.js +0 -100
  106. package/dist/es/component/playground/playground-constants.js +0 -39
  107. package/dist/es/component/playground/playground-types.js +0 -6
  108. package/dist/es/component/playground/playground-utils.js +0 -141
  109. package/dist/es/component/playground/useServerValid.js +0 -58
  110. package/dist/es/component/playground/useStaticPageAgent.js +0 -20
  111. package/dist/es/component/replay-scripts.js +0 -361
  112. package/dist/es/component/shiny-text.js +0 -30
  113. package/dist/es/component/store/history.js +0 -34
  114. package/dist/es/component/store/store.js +0 -99
  115. package/dist/es/index.js +0 -79
  116. package/dist/es/init.js +0 -17
  117. package/dist/index.css +0 -595
  118. package/dist/index.js +0 -1
  119. package/dist/lib/assets/close.909351c0.svg +0 -4
  120. package/dist/lib/assets/history.164a4eab.svg +0 -4
  121. package/dist/lib/assets/magnifying-glass.9498e70e.svg +0 -12
  122. package/dist/lib/assets/setting.80ab7285.svg +0 -11
  123. package/dist/lib/component/common.css +0 -0
  124. /package/dist/es/component/{common.css → playground/playground-types.mjs} +0 -0
@@ -1,246 +1,259 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var PromptInput_exports = {};
30
- __export(PromptInput_exports, {
31
- PromptInput: () => PromptInput
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ PromptInput: ()=>PromptInput
32
28
  });
33
- module.exports = __toCommonJS(PromptInput_exports);
34
- var import_buffer = __toESM(require("buffer"));
35
- var import_browser = __toESM(require("process/browser"));
36
- var import_console_browserify = __toESM(require("console-browserify"));
37
- var buffer = {
38
- Buffer: import_buffer.default
39
- };
40
- var import_jsx_runtime = require("react/jsx-runtime");
41
- var import_icons = require("@ant-design/icons");
42
- var import_antd = require("antd");
43
- var import_react = require("react");
44
- var import_history = require("../store/history");
45
- var import_ConfigSelector = require("./ConfigSelector");
46
- var import_HistorySelector = require("./HistorySelector");
47
- var import_playground_utils = require("./playground-utils");
48
- const { TextArea } = import_antd.Input;
49
- const PromptInput = ({
50
- runButtonEnabled,
51
- form,
52
- serviceMode,
53
- selectedType,
54
- dryMode,
55
- stoppable,
56
- loading,
57
- onRun,
58
- onStop,
59
- clearPromptAfterRun = true
60
- }) => {
61
- const [hoveringSettings, setHoveringSettings] = (0, import_react.useState)(false);
62
- const [promptValue, setPromptValue] = (0, import_react.useState)("");
63
- const placeholder = (0, import_playground_utils.getPlaceholderForType)(selectedType);
64
- const textAreaRef = (0, import_react.useRef)(null);
65
- const history = (0, import_history.useHistoryStore)((state) => state.history);
66
- const addHistory = (0, import_history.useHistoryStore)((state) => state.addHistory);
67
- const lastHistory = history[0];
68
- (0, import_react.useEffect)(() => {
69
- if (lastHistory) {
70
- form.setFieldsValue({
71
- type: lastHistory.type || "aiAction",
72
- prompt: lastHistory.prompt || ""
73
- });
74
- setPromptValue(lastHistory.prompt || "");
75
- } else {
76
- form.setFieldsValue({
77
- type: "aiAction",
78
- prompt: ""
79
- });
80
- setPromptValue("");
81
- }
82
- }, []);
83
- const handleSelectHistory = (0, import_react.useCallback)(
84
- (historyItem) => {
85
- form.setFieldsValue({
86
- prompt: historyItem.prompt,
87
- type: historyItem.type
88
- });
89
- setPromptValue(historyItem.prompt);
90
- },
91
- [form]
92
- );
93
- const handlePromptChange = (0, import_react.useCallback)(
94
- (e) => {
95
- const value = e.target.value;
96
- setPromptValue(value);
97
- form.setFieldValue("prompt", value);
98
- },
99
- [form]
100
- );
101
- const isRunButtonEnabled = runButtonEnabled && promptValue.trim().length > 0;
102
- const handleRunWithHistory = (0, import_react.useCallback)(() => {
103
- const values = form.getFieldsValue();
104
- if (values.prompt) {
105
- addHistory({
106
- type: values.type,
107
- prompt: values.prompt,
108
- timestamp: Date.now()
109
- });
110
- }
111
- onRun();
112
- if (clearPromptAfterRun) {
113
- setPromptValue("");
114
- form.setFieldValue("prompt", "");
115
- }
116
- }, [form, addHistory, onRun]);
117
- const handleKeyDown = (0, import_react.useCallback)(
118
- (e) => {
119
- if (e.key === "Enter" && e.metaKey && isRunButtonEnabled) {
120
- handleRunWithHistory();
121
- e.preventDefault();
122
- e.stopPropagation();
123
- } else if (e.key === "Enter") {
124
- setTimeout(() => {
125
- if (textAreaRef.current) {
126
- const textarea = textAreaRef.current.resizableTextArea.textArea;
127
- const selectionStart = textarea.selectionStart;
128
- const value = textarea.value;
129
- const lastNewlineIndex = value.lastIndexOf("\n");
130
- const isAtLastLine = lastNewlineIndex === -1 || selectionStart > lastNewlineIndex;
131
- if (isAtLastLine) {
132
- textarea.scrollTop = textarea.scrollHeight;
29
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
+ const icons_namespaceObject = require("@ant-design/icons");
31
+ const external_antd_namespaceObject = require("antd");
32
+ const external_react_namespaceObject = require("react");
33
+ const history_js_namespaceObject = require("../store/history.js");
34
+ const external_ConfigSelector_js_namespaceObject = require("./ConfigSelector.js");
35
+ const external_HistorySelector_js_namespaceObject = require("./HistorySelector.js");
36
+ const external_playground_utils_js_namespaceObject = require("./playground-utils.js");
37
+ require("./index.css");
38
+ const { TextArea } = external_antd_namespaceObject.Input;
39
+ const PromptInput = (param)=>{
40
+ let { runButtonEnabled, form, serviceMode, selectedType, dryMode, stoppable, loading, onRun, onStop, clearPromptAfterRun = true } = param;
41
+ const [hoveringSettings, setHoveringSettings] = (0, external_react_namespaceObject.useState)(false);
42
+ const [promptValue, setPromptValue] = (0, external_react_namespaceObject.useState)('');
43
+ const placeholder = (0, external_playground_utils_js_namespaceObject.getPlaceholderForType)(selectedType);
44
+ const textAreaRef = (0, external_react_namespaceObject.useRef)(null);
45
+ const history = (0, history_js_namespaceObject.useHistoryStore)((state)=>state.history);
46
+ const addHistory = (0, history_js_namespaceObject.useHistoryStore)((state)=>state.addHistory);
47
+ const lastHistory = history[0];
48
+ (0, external_react_namespaceObject.useEffect)(()=>{
49
+ if (lastHistory) {
50
+ form.setFieldsValue({
51
+ type: lastHistory.type || 'aiAction',
52
+ prompt: lastHistory.prompt || ''
53
+ });
54
+ setPromptValue(lastHistory.prompt || '');
55
+ } else {
56
+ form.setFieldsValue({
57
+ type: 'aiAction',
58
+ prompt: ''
59
+ });
60
+ setPromptValue('');
61
+ }
62
+ }, []);
63
+ const handleSelectHistory = (0, external_react_namespaceObject.useCallback)((historyItem)=>{
64
+ form.setFieldsValue({
65
+ prompt: historyItem.prompt,
66
+ type: historyItem.type
67
+ });
68
+ setPromptValue(historyItem.prompt);
69
+ }, [
70
+ form
71
+ ]);
72
+ const handlePromptChange = (0, external_react_namespaceObject.useCallback)((e)=>{
73
+ const value = e.target.value;
74
+ setPromptValue(value);
75
+ form.setFieldValue('prompt', value);
76
+ }, [
77
+ form
78
+ ]);
79
+ const isRunButtonEnabled = runButtonEnabled && promptValue.trim().length > 0;
80
+ const handleRunWithHistory = (0, external_react_namespaceObject.useCallback)(()=>{
81
+ const values = form.getFieldsValue();
82
+ if (values.prompt) addHistory({
83
+ type: values.type,
84
+ prompt: values.prompt,
85
+ timestamp: Date.now()
86
+ });
87
+ onRun();
88
+ if (clearPromptAfterRun) {
89
+ setPromptValue('');
90
+ form.setFieldValue('prompt', '');
91
+ }
92
+ }, [
93
+ form,
94
+ addHistory,
95
+ onRun
96
+ ]);
97
+ const handleKeyDown = (0, external_react_namespaceObject.useCallback)((e)=>{
98
+ if ('Enter' === e.key && e.metaKey && isRunButtonEnabled) {
99
+ handleRunWithHistory();
100
+ e.preventDefault();
101
+ e.stopPropagation();
102
+ } else if ('Enter' === e.key) setTimeout(()=>{
103
+ if (textAreaRef.current) {
104
+ const textarea = textAreaRef.current.resizableTextArea.textArea;
105
+ const selectionStart = textarea.selectionStart;
106
+ const value = textarea.value;
107
+ const lastNewlineIndex = value.lastIndexOf('\n');
108
+ const isAtLastLine = -1 === lastNewlineIndex || selectionStart > lastNewlineIndex;
109
+ if (isAtLastLine) textarea.scrollTop = textarea.scrollHeight;
133
110
  }
134
- }
135
111
  }, 0);
136
- }
137
- },
138
- [handleRunWithHistory, isRunButtonEnabled]
139
- );
140
- const handleMouseEnter = (0, import_react.useCallback)(() => {
141
- setHoveringSettings(true);
142
- }, []);
143
- const handleMouseLeave = (0, import_react.useCallback)(() => {
144
- setHoveringSettings(false);
145
- }, []);
146
- const renderActionButton = (0, import_react.useCallback)(() => {
147
- const runButton = (text) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
148
- import_antd.Button,
149
- {
150
- type: "primary",
151
- icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SendOutlined, {}),
152
- style: { borderRadius: 20, zIndex: 999 },
153
- onClick: handleRunWithHistory,
154
- disabled: !isRunButtonEnabled,
112
+ }, [
113
+ handleRunWithHistory,
114
+ isRunButtonEnabled
115
+ ]);
116
+ const handleMouseEnter = (0, external_react_namespaceObject.useCallback)(()=>{
117
+ setHoveringSettings(true);
118
+ }, []);
119
+ const handleMouseLeave = (0, external_react_namespaceObject.useCallback)(()=>{
120
+ setHoveringSettings(false);
121
+ }, []);
122
+ const renderActionButton = (0, external_react_namespaceObject.useCallback)(()=>{
123
+ const runButton = (text)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
124
+ type: "primary",
125
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.SendOutlined, {}),
126
+ style: {
127
+ borderRadius: 20,
128
+ zIndex: 999
129
+ },
130
+ onClick: handleRunWithHistory,
131
+ disabled: !isRunButtonEnabled,
132
+ loading: loading,
133
+ children: text
134
+ });
135
+ if (dryMode) return 'aiAction' === selectedType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Tooltip, {
136
+ title: "Start executing until some interaction actions need to be performed. You can see the process of planning and locating.",
137
+ children: runButton('Dry Run')
138
+ }) : runButton('Run');
139
+ if (stoppable) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
140
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.BorderOutlined, {}),
141
+ onClick: onStop,
142
+ style: {
143
+ borderRadius: 20,
144
+ zIndex: 999
145
+ },
146
+ children: "Stop"
147
+ });
148
+ return runButton('Run');
149
+ }, [
150
+ dryMode,
155
151
  loading,
156
- children: text
157
- }
158
- );
159
- if (dryMode) {
160
- return selectedType === "aiAction" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { title: "Start executing until some interaction actions need to be performed. You can see the process of planning and locating.", children: runButton("Dry Run") }) : runButton("Run");
161
- }
162
- if (stoppable) {
163
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
164
- import_antd.Button,
165
- {
166
- icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.BorderOutlined, {}),
167
- onClick: onStop,
168
- style: { borderRadius: 20, zIndex: 999 },
169
- children: "Stop"
170
- }
171
- );
172
- }
173
- return runButton("Run");
174
- }, [
175
- dryMode,
176
- loading,
177
- handleRunWithHistory,
178
- onStop,
179
- isRunButtonEnabled,
180
- selectedType,
181
- stoppable
182
- ]);
183
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "prompt-input-wrapper", children: [
184
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { className: "mode-radio-group-wrapper", children: [
185
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { name: "type", style: { margin: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
186
- import_antd.Radio.Group,
187
- {
188
- buttonStyle: "solid",
189
- disabled: !runButtonEnabled,
190
- className: "mode-radio-group",
191
- children: [
192
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { title: "Auto Planning: plan the steps and execute", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Radio.Button, { value: "aiAction", children: (0, import_playground_utils.actionNameForType)("aiAction") }) }),
193
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { title: "Extract data directly from the UI", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Radio.Button, { value: "aiQuery", children: (0, import_playground_utils.actionNameForType)("aiQuery") }) }),
194
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { title: "Understand the UI and determine if the assertion is true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Radio.Button, { value: "aiAssert", children: (0, import_playground_utils.actionNameForType)("aiAssert") }) }),
195
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { title: "Instant Action: click something", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Radio.Button, { value: "aiTap", children: (0, import_playground_utils.actionNameForType)("aiTap") }) })
196
- ]
197
- }
198
- ) }),
199
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "action-icons", children: [
200
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_HistorySelector.HistorySelector, { onSelect: handleSelectHistory }),
201
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
202
- "div",
203
- {
204
- className: hoveringSettings ? "settings-wrapper settings-wrapper-hover" : "settings-wrapper",
205
- onMouseEnter: handleMouseEnter,
206
- onMouseLeave: handleMouseLeave,
207
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
208
- import_ConfigSelector.ConfigSelector,
209
- {
210
- enableTracking: serviceMode === "In-Browser-Extension",
211
- showDeepThinkOption: selectedType === "aiTap"
212
- }
213
- )
214
- }
215
- )
216
- ] })
217
- ] }),
218
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
219
- "div",
220
- {
221
- className: `main-side-console-input ${!runButtonEnabled ? "disabled" : ""} ${loading ? "loading" : ""}`,
152
+ handleRunWithHistory,
153
+ onStop,
154
+ isRunButtonEnabled,
155
+ selectedType,
156
+ stoppable
157
+ ]);
158
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
159
+ className: "prompt-input-wrapper",
222
160
  children: [
223
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { name: "prompt", style: { margin: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
224
- TextArea,
225
- {
226
- className: "main-side-console-input-textarea",
227
- disabled: !runButtonEnabled,
228
- rows: 4,
229
- placeholder,
230
- autoFocus: true,
231
- onKeyDown: handleKeyDown,
232
- onChange: handlePromptChange,
233
- value: promptValue,
234
- ref: textAreaRef
235
- }
236
- ) }),
237
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-controller-wrapper", children: renderActionButton() })
161
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Space, {
162
+ className: "mode-radio-group-wrapper",
163
+ children: [
164
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
165
+ name: "type",
166
+ style: {
167
+ margin: 0
168
+ },
169
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Radio.Group, {
170
+ buttonStyle: "solid",
171
+ disabled: !runButtonEnabled,
172
+ className: "mode-radio-group",
173
+ children: [
174
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Tooltip, {
175
+ title: "Auto Planning: plan the steps and execute",
176
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio.Button, {
177
+ value: "aiAction",
178
+ children: (0, external_playground_utils_js_namespaceObject.actionNameForType)('aiAction')
179
+ })
180
+ }),
181
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Tooltip, {
182
+ title: "Extract data directly from the UI",
183
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio.Button, {
184
+ value: "aiQuery",
185
+ children: (0, external_playground_utils_js_namespaceObject.actionNameForType)('aiQuery')
186
+ })
187
+ }),
188
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Tooltip, {
189
+ title: "Understand the UI and determine if the assertion is true",
190
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio.Button, {
191
+ value: "aiAssert",
192
+ children: (0, external_playground_utils_js_namespaceObject.actionNameForType)('aiAssert')
193
+ })
194
+ }),
195
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Tooltip, {
196
+ title: "Instant Action: click something",
197
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio.Button, {
198
+ value: "aiTap",
199
+ children: (0, external_playground_utils_js_namespaceObject.actionNameForType)('aiTap')
200
+ })
201
+ })
202
+ ]
203
+ })
204
+ }),
205
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
206
+ className: "action-icons",
207
+ children: [
208
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HistorySelector_js_namespaceObject.HistorySelector, {
209
+ onSelect: handleSelectHistory
210
+ }),
211
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
212
+ className: hoveringSettings ? 'settings-wrapper settings-wrapper-hover' : 'settings-wrapper',
213
+ onMouseEnter: handleMouseEnter,
214
+ onMouseLeave: handleMouseLeave,
215
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ConfigSelector_js_namespaceObject.ConfigSelector, {
216
+ enableTracking: 'In-Browser-Extension' === serviceMode,
217
+ showDeepThinkOption: 'aiTap' === selectedType
218
+ })
219
+ })
220
+ ]
221
+ })
222
+ ]
223
+ }),
224
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
225
+ className: `main-side-console-input ${!runButtonEnabled ? 'disabled' : ''} ${loading ? 'loading' : ''}`,
226
+ children: [
227
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
228
+ name: "prompt",
229
+ style: {
230
+ margin: 0
231
+ },
232
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TextArea, {
233
+ className: "main-side-console-input-textarea",
234
+ disabled: !runButtonEnabled,
235
+ rows: 4,
236
+ placeholder: placeholder,
237
+ autoFocus: true,
238
+ onKeyDown: handleKeyDown,
239
+ onChange: handlePromptChange,
240
+ value: promptValue,
241
+ ref: textAreaRef
242
+ })
243
+ }),
244
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
245
+ className: "form-controller-wrapper",
246
+ children: renderActionButton()
247
+ })
248
+ ]
249
+ })
238
250
  ]
239
- }
240
- )
241
- ] });
251
+ });
242
252
  };
243
- // Annotate the CommonJS export names for ESM import in node:
244
- 0 && (module.exports = {
245
- PromptInput
253
+ exports.PromptInput = __webpack_exports__.PromptInput;
254
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
255
+ "PromptInput"
256
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
257
+ Object.defineProperty(exports, '__esModule', {
258
+ value: true
246
259
  });