@midscene/visualizer 0.28.1-beta-20250909063633.0 → 0.28.2-beta-20250909133629.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.
- package/dist/es/browser.mjs +18 -0
- package/dist/es/component/{blackboard.mjs → blackboard/index.mjs} +3 -3
- package/dist/es/component/{playground/ConfigSelector.mjs → config-selector/index.mjs} +2 -3
- package/dist/es/component/{playground/ContextPreview.mjs → context-preview/index.mjs} +3 -4
- package/dist/es/component/{env-config.mjs → env-config/index.mjs} +1 -1
- package/dist/es/component/{github-star.mjs → github-star/index.mjs} +1 -1
- package/dist/es/component/history-selector/index.css +132 -0
- package/dist/es/component/{playground/HistorySelector.mjs → history-selector/index.mjs} +1 -1
- package/dist/es/component/index.mjs +1 -0
- package/dist/es/component/{logo.mjs → logo/index.mjs} +1 -1
- package/dist/es/component/{misc.mjs → misc/index.mjs} +42 -2
- package/dist/es/component/{player.mjs → player/index.mjs} +8 -8
- package/dist/es/component/playground/index.css +29 -161
- package/dist/es/component/playground/index.mjs +8 -0
- package/dist/es/component/playground-result/index.css +29 -0
- package/dist/es/component/{playground/PlaygroundResult.mjs → playground-result/index.mjs} +3 -4
- package/dist/es/component/prompt-input/index.css +330 -0
- package/dist/es/component/{playground/PromptInput.mjs → prompt-input/index.mjs} +9 -9
- package/dist/es/component/{playground/ServiceModeControl.mjs → service-mode-control/index.mjs} +4 -5
- package/dist/es/component/{shiny-text.mjs → shiny-text/index.mjs} +1 -1
- package/dist/es/component/universal-playground/index.css +341 -0
- package/dist/es/component/universal-playground/index.mjs +273 -0
- package/dist/es/component/universal-playground/providers/context-provider.mjs +52 -0
- package/dist/es/component/universal-playground/providers/storage-provider.mjs +107 -0
- package/dist/es/hooks/usePlaygroundExecution.mjs +170 -0
- package/dist/es/hooks/usePlaygroundState.mjs +173 -0
- package/dist/es/icons/avatar.mjs +14 -0
- package/dist/es/index.mjs +22 -18
- package/dist/es/{component/playground/types.mjs → types.mjs} +23 -1
- package/dist/es/{component/playground/playground-constants.mjs → utils/constants.mjs} +1 -2
- package/dist/es/{component/playground → utils}/playground-utils.mjs +1 -1
- package/dist/es/{component → utils}/replay-scripts.mjs +1 -2
- package/dist/lib/browser.js +132 -0
- package/dist/lib/component/{blackboard.js → blackboard/index.js} +5 -5
- package/dist/lib/component/{playground/ConfigSelector.js → config-selector/index.js} +6 -7
- package/dist/lib/component/{playground/ContextPreview.js → context-preview/index.js} +8 -9
- package/dist/lib/component/{env-config.js → env-config/index.js} +1 -1
- package/dist/lib/component/{github-star.js → github-star/index.js} +1 -1
- package/dist/lib/component/history-selector/index.css +132 -0
- package/dist/lib/component/{playground/HistorySelector.js → history-selector/index.js} +1 -1
- package/dist/lib/component/index.js +60 -0
- package/dist/lib/component/{logo.js → logo/index.js} +1 -1
- package/dist/lib/component/{misc.js → misc/index.js} +60 -1
- package/dist/lib/component/{player.js → player/index.js} +23 -23
- package/dist/lib/component/playground/index.css +29 -161
- package/dist/lib/component/playground/index.js +113 -0
- package/dist/lib/component/playground-result/index.css +29 -0
- package/dist/lib/component/{playground/PlaygroundResult.js → playground-result/index.js} +8 -9
- package/dist/lib/component/prompt-input/index.css +330 -0
- package/dist/lib/component/{playground/PromptInput.js → prompt-input/index.js} +37 -37
- package/dist/lib/component/{playground/ServiceModeControl.js → service-mode-control/index.js} +8 -9
- package/dist/lib/component/{shiny-text.js → shiny-text/index.js} +1 -1
- package/dist/lib/component/universal-playground/index.css +341 -0
- package/dist/lib/component/universal-playground/index.js +321 -0
- package/dist/lib/component/universal-playground/providers/context-provider.js +95 -0
- package/dist/lib/component/universal-playground/providers/storage-provider.js +147 -0
- package/dist/lib/hooks/usePlaygroundExecution.js +204 -0
- package/dist/lib/hooks/usePlaygroundState.js +207 -0
- package/dist/lib/{init.js → icons/avatar.js} +16 -12
- package/dist/lib/index.js +66 -34
- package/dist/lib/{component/playground/types.js → types.js} +28 -0
- package/dist/lib/{component/playground/playground-constants.js → utils/constants.js} +3 -4
- package/dist/lib/{component/playground → utils}/playground-utils.js +1 -1
- package/dist/lib/{component → utils}/replay-scripts.js +3 -4
- package/dist/types/browser.d.ts +19 -0
- package/dist/types/component/{blackboard.d.ts → blackboard/index.d.ts} +2 -2
- package/dist/types/component/{playground/ConfigSelector.d.ts → config-selector/index.d.ts} +0 -1
- package/dist/types/component/{playground/ContextPreview.d.ts → context-preview/index.d.ts} +0 -1
- package/dist/types/component/{github-star.d.ts → github-star/index.d.ts} +1 -1
- package/dist/types/component/{playground/HistorySelector.d.ts → history-selector/index.d.ts} +1 -1
- package/dist/types/component/index.d.ts +1 -0
- package/dist/types/component/{logo.d.ts → logo/index.d.ts} +1 -1
- package/dist/types/component/misc/index.d.ts +6 -0
- package/dist/types/component/{player.d.ts → player/index.d.ts} +2 -2
- package/dist/types/component/playground/index.d.ts +7 -0
- package/dist/types/component/{playground/PlaygroundResult.d.ts → playground-result/index.d.ts} +3 -4
- package/dist/types/component/{playground/PromptInput.d.ts → prompt-input/index.d.ts} +3 -2
- package/dist/types/component/{playground/ServiceModeControl.d.ts → service-mode-control/index.d.ts} +0 -1
- package/dist/types/component/{shiny-text.d.ts → shiny-text/index.d.ts} +1 -1
- package/dist/types/component/universal-playground/index.d.ts +4 -0
- package/dist/types/component/universal-playground/providers/context-provider.d.ts +37 -0
- package/dist/types/component/universal-playground/providers/storage-provider.d.ts +33 -0
- package/dist/types/hooks/usePlaygroundExecution.d.ts +10 -0
- package/dist/types/hooks/usePlaygroundState.d.ts +26 -0
- package/dist/types/index.d.ts +15 -10
- package/dist/types/types.d.ts +166 -0
- package/dist/types/{component/playground/playground-constants.d.ts → utils/constants.d.ts} +0 -1
- package/dist/types/{component → utils}/replay-scripts.d.ts +0 -1
- package/package.json +10 -5
- package/dist/es/component/describer.css +0 -25
- package/dist/es/component/playground/playground-types.mjs +0 -0
- package/dist/es/init.mjs +0 -10
- package/dist/lib/component/describer.css +0 -25
- package/dist/lib/component/playground/playground-types.js +0 -18
- package/dist/types/component/misc.d.ts +0 -2
- package/dist/types/component/playground/playground-types.d.ts +0 -19
- package/dist/types/component/playground/types.d.ts +0 -72
- package/dist/types/init.d.ts +0 -1
- /package/dist/es/component/{blackboard.css → blackboard/index.css} +0 -0
- /package/dist/es/component/{playground/FormField.mjs → form-field/index.mjs} +0 -0
- /package/dist/es/component/{github-star.css → github-star/index.css} +0 -0
- /package/dist/es/component/{logo.css → logo/index.css} +0 -0
- /package/dist/es/component/{player.css → player/index.css} +0 -0
- /package/dist/es/component/{playground-demo-ui-context.json → playground/playground-demo-ui-context.json} +0 -0
- /package/dist/es/component/{shiny-text.css → shiny-text/index.css} +0 -0
- /package/dist/es/{component/playground → hooks}/useServerValid.mjs +0 -0
- /package/dist/es/{component/store → store}/history.mjs +0 -0
- /package/dist/es/{component/store → store}/store.mjs +0 -0
- /package/dist/es/{component → utils}/color.mjs +0 -0
- /package/dist/es/{utils.mjs → utils/index.mjs} +0 -0
- /package/dist/es/{component → utils}/pixi-loader.mjs +0 -0
- /package/dist/lib/component/{blackboard.css → blackboard/index.css} +0 -0
- /package/dist/lib/component/{playground/FormField.js → form-field/index.js} +0 -0
- /package/dist/lib/component/{github-star.css → github-star/index.css} +0 -0
- /package/dist/lib/component/{logo.css → logo/index.css} +0 -0
- /package/dist/lib/component/{player.css → player/index.css} +0 -0
- /package/dist/lib/component/{playground-demo-ui-context.json → playground/playground-demo-ui-context.json} +0 -0
- /package/dist/lib/component/{shiny-text.css → shiny-text/index.css} +0 -0
- /package/dist/lib/{component/playground → hooks}/useServerValid.js +0 -0
- /package/dist/lib/{component/store → store}/history.js +0 -0
- /package/dist/lib/{component/store → store}/store.js +0 -0
- /package/dist/lib/{component → utils}/color.js +0 -0
- /package/dist/lib/{utils.js → utils/index.js} +0 -0
- /package/dist/lib/{component → utils}/pixi-loader.js +0 -0
- /package/dist/types/component/{env-config.d.ts → env-config/index.d.ts} +0 -0
- /package/dist/types/component/{playground/FormField.d.ts → form-field/index.d.ts} +0 -0
- /package/dist/types/{component/playground → hooks}/useServerValid.d.ts +0 -0
- /package/dist/types/{component/store → store}/history.d.ts +0 -0
- /package/dist/types/{component/store → store}/store.d.ts +0 -0
- /package/dist/types/{component → utils}/color.d.ts +0 -0
- /package/dist/types/{utils.d.ts → utils/index.d.ts} +0 -0
- /package/dist/types/{component → utils}/pixi-loader.d.ts +0 -0
- /package/dist/types/{component/playground → utils}/playground-utils.d.ts +0 -0
package/dist/lib/index.js
CHANGED
|
@@ -33,60 +33,83 @@ var __webpack_require__ = {};
|
|
|
33
33
|
var __webpack_exports__ = {};
|
|
34
34
|
__webpack_require__.r(__webpack_exports__);
|
|
35
35
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
timeCostStrElement: ()=>
|
|
36
|
+
timeCostStrElement: ()=>misc_index_js_namespaceObject.timeCostStrElement,
|
|
37
37
|
actionNameForType: ()=>playground_utils_js_namespaceObject.actionNameForType,
|
|
38
|
-
PlaygroundResultView: ()=>
|
|
39
|
-
timeStr: ()=>
|
|
40
|
-
EnvConfig: ()=>
|
|
38
|
+
PlaygroundResultView: ()=>playground_result_index_js_namespaceObject.PlaygroundResultView,
|
|
39
|
+
timeStr: ()=>external_utils_index_js_namespaceObject.timeStr,
|
|
40
|
+
EnvConfig: ()=>index_js_namespaceObject.EnvConfig,
|
|
41
41
|
allScriptsFromDump: ()=>replay_scripts_js_namespaceObject.allScriptsFromDump,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
LocalStorageProvider: ()=>storage_provider_js_namespaceObject.LocalStorageProvider,
|
|
43
|
+
UniversalPlaygroundDefault: ()=>universal_playground_index_js_default(),
|
|
44
44
|
generateAnimationScripts: ()=>replay_scripts_js_namespaceObject.generateAnimationScripts,
|
|
45
|
-
ShinyText: ()=>
|
|
46
|
-
Blackboard: ()=>blackboard_js_namespaceObject.Blackboard,
|
|
45
|
+
ShinyText: ()=>shiny_text_index_js_default(),
|
|
47
46
|
getPlaceholderForType: ()=>playground_utils_js_namespaceObject.getPlaceholderForType,
|
|
48
47
|
staticAgentFromContext: ()=>playground_utils_js_namespaceObject.staticAgentFromContext,
|
|
49
|
-
useEnvConfig: ()=>store_js_namespaceObject.useEnvConfig,
|
|
50
48
|
useServerValid: ()=>useServerValid_js_namespaceObject.useServerValid,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
filterBase64Value: ()=>external_utils_js_namespaceObject.filterBase64Value,
|
|
49
|
+
ServiceModeControl: ()=>service_mode_control_index_js_namespaceObject.ServiceModeControl,
|
|
50
|
+
BaseContextProvider: ()=>context_provider_js_namespaceObject.BaseContextProvider,
|
|
54
51
|
colorForName: ()=>color_js_namespaceObject.colorForName,
|
|
55
|
-
GithubStar: ()=>
|
|
56
|
-
Logo: ()=>
|
|
57
|
-
|
|
52
|
+
GithubStar: ()=>github_star_index_js_namespaceObject.GithubStar,
|
|
53
|
+
Logo: ()=>logo_index_js_namespaceObject.Logo,
|
|
54
|
+
UniversalPlayground: ()=>universal_playground_index_js_namespaceObject.UniversalPlayground,
|
|
55
|
+
useEnvConfig: ()=>store_js_namespaceObject.useEnvConfig,
|
|
56
|
+
PromptInput: ()=>prompt_input_index_js_namespaceObject.PromptInput,
|
|
57
|
+
ContextPreview: ()=>context_preview_index_js_namespaceObject.ContextPreview,
|
|
58
|
+
NoOpStorageProvider: ()=>storage_provider_js_namespaceObject.NoOpStorageProvider,
|
|
59
|
+
StaticContextProvider: ()=>context_provider_js_namespaceObject.StaticContextProvider,
|
|
60
|
+
Blackboard: ()=>blackboard_index_js_namespaceObject.Blackboard,
|
|
61
|
+
Player: ()=>player_index_js_namespaceObject.Player,
|
|
62
|
+
AgentContextProvider: ()=>context_provider_js_namespaceObject.AgentContextProvider,
|
|
63
|
+
filterBase64Value: ()=>external_utils_index_js_namespaceObject.filterBase64Value,
|
|
64
|
+
NoOpContextProvider: ()=>context_provider_js_namespaceObject.NoOpContextProvider,
|
|
58
65
|
highlightColorForType: ()=>color_js_namespaceObject.highlightColorForType,
|
|
59
|
-
iconForStatus: ()=>
|
|
66
|
+
iconForStatus: ()=>misc_index_js_namespaceObject.iconForStatus,
|
|
67
|
+
globalThemeConfig: ()=>color_js_namespaceObject.globalThemeConfig,
|
|
68
|
+
MemoryStorageProvider: ()=>storage_provider_js_namespaceObject.MemoryStorageProvider
|
|
60
69
|
});
|
|
61
70
|
require("./component/playground/index.css");
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
|
|
71
|
+
require("./component/universal-playground/index.css");
|
|
72
|
+
const replay_scripts_js_namespaceObject = require("./utils/replay-scripts.js");
|
|
73
|
+
const store_js_namespaceObject = require("./store/store.js");
|
|
74
|
+
const color_js_namespaceObject = require("./utils/color.js");
|
|
75
|
+
const index_js_namespaceObject = require("./component/env-config/index.js");
|
|
76
|
+
const logo_index_js_namespaceObject = require("./component/logo/index.js");
|
|
77
|
+
const misc_index_js_namespaceObject = require("./component/misc/index.js");
|
|
78
|
+
const useServerValid_js_namespaceObject = require("./hooks/useServerValid.js");
|
|
79
|
+
const playground_result_index_js_namespaceObject = require("./component/playground-result/index.js");
|
|
80
|
+
const service_mode_control_index_js_namespaceObject = require("./component/service-mode-control/index.js");
|
|
81
|
+
const context_preview_index_js_namespaceObject = require("./component/context-preview/index.js");
|
|
82
|
+
const prompt_input_index_js_namespaceObject = require("./component/prompt-input/index.js");
|
|
83
|
+
const player_index_js_namespaceObject = require("./component/player/index.js");
|
|
84
|
+
const blackboard_index_js_namespaceObject = require("./component/blackboard/index.js");
|
|
85
|
+
const github_star_index_js_namespaceObject = require("./component/github-star/index.js");
|
|
86
|
+
const playground_utils_js_namespaceObject = require("./utils/playground-utils.js");
|
|
87
|
+
const external_utils_index_js_namespaceObject = require("./utils/index.js");
|
|
88
|
+
const shiny_text_index_js_namespaceObject = require("./component/shiny-text/index.js");
|
|
89
|
+
var shiny_text_index_js_default = /*#__PURE__*/ __webpack_require__.n(shiny_text_index_js_namespaceObject);
|
|
90
|
+
const universal_playground_index_js_namespaceObject = require("./component/universal-playground/index.js");
|
|
91
|
+
var universal_playground_index_js_default = /*#__PURE__*/ __webpack_require__.n(universal_playground_index_js_namespaceObject);
|
|
92
|
+
const storage_provider_js_namespaceObject = require("./component/universal-playground/providers/storage-provider.js");
|
|
93
|
+
const context_provider_js_namespaceObject = require("./component/universal-playground/providers/context-provider.js");
|
|
94
|
+
exports.AgentContextProvider = __webpack_exports__.AgentContextProvider;
|
|
95
|
+
exports.BaseContextProvider = __webpack_exports__.BaseContextProvider;
|
|
80
96
|
exports.Blackboard = __webpack_exports__.Blackboard;
|
|
81
97
|
exports.ContextPreview = __webpack_exports__.ContextPreview;
|
|
82
98
|
exports.EnvConfig = __webpack_exports__.EnvConfig;
|
|
83
99
|
exports.GithubStar = __webpack_exports__.GithubStar;
|
|
100
|
+
exports.LocalStorageProvider = __webpack_exports__.LocalStorageProvider;
|
|
84
101
|
exports.Logo = __webpack_exports__.Logo;
|
|
102
|
+
exports.MemoryStorageProvider = __webpack_exports__.MemoryStorageProvider;
|
|
103
|
+
exports.NoOpContextProvider = __webpack_exports__.NoOpContextProvider;
|
|
104
|
+
exports.NoOpStorageProvider = __webpack_exports__.NoOpStorageProvider;
|
|
85
105
|
exports.Player = __webpack_exports__.Player;
|
|
86
106
|
exports.PlaygroundResultView = __webpack_exports__.PlaygroundResultView;
|
|
87
107
|
exports.PromptInput = __webpack_exports__.PromptInput;
|
|
88
108
|
exports.ServiceModeControl = __webpack_exports__.ServiceModeControl;
|
|
89
109
|
exports.ShinyText = __webpack_exports__.ShinyText;
|
|
110
|
+
exports.StaticContextProvider = __webpack_exports__.StaticContextProvider;
|
|
111
|
+
exports.UniversalPlayground = __webpack_exports__.UniversalPlayground;
|
|
112
|
+
exports.UniversalPlaygroundDefault = __webpack_exports__.UniversalPlaygroundDefault;
|
|
90
113
|
exports.actionNameForType = __webpack_exports__.actionNameForType;
|
|
91
114
|
exports.allScriptsFromDump = __webpack_exports__.allScriptsFromDump;
|
|
92
115
|
exports.colorForName = __webpack_exports__.colorForName;
|
|
@@ -102,16 +125,25 @@ exports.timeStr = __webpack_exports__.timeStr;
|
|
|
102
125
|
exports.useEnvConfig = __webpack_exports__.useEnvConfig;
|
|
103
126
|
exports.useServerValid = __webpack_exports__.useServerValid;
|
|
104
127
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
128
|
+
"AgentContextProvider",
|
|
129
|
+
"BaseContextProvider",
|
|
105
130
|
"Blackboard",
|
|
106
131
|
"ContextPreview",
|
|
107
132
|
"EnvConfig",
|
|
108
133
|
"GithubStar",
|
|
134
|
+
"LocalStorageProvider",
|
|
109
135
|
"Logo",
|
|
136
|
+
"MemoryStorageProvider",
|
|
137
|
+
"NoOpContextProvider",
|
|
138
|
+
"NoOpStorageProvider",
|
|
110
139
|
"Player",
|
|
111
140
|
"PlaygroundResultView",
|
|
112
141
|
"PromptInput",
|
|
113
142
|
"ServiceModeControl",
|
|
114
143
|
"ShinyText",
|
|
144
|
+
"StaticContextProvider",
|
|
145
|
+
"UniversalPlayground",
|
|
146
|
+
"UniversalPlaygroundDefault",
|
|
115
147
|
"actionNameForType",
|
|
116
148
|
"allScriptsFromDump",
|
|
117
149
|
"colorForName",
|
|
@@ -24,7 +24,9 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
BLANK_RESULT: ()=>BLANK_RESULT,
|
|
27
28
|
VALIDATION_CONSTANTS: ()=>VALIDATION_CONSTANTS,
|
|
29
|
+
WELCOME_MESSAGE_TEMPLATE: ()=>WELCOME_MESSAGE_TEMPLATE,
|
|
28
30
|
extractDefaultValue: ()=>extractDefaultValue,
|
|
29
31
|
isLocateField: ()=>isLocateField,
|
|
30
32
|
isZodObjectSchema: ()=>isZodObjectSchema,
|
|
@@ -99,13 +101,39 @@ const extractDefaultValue = (field)=>{
|
|
|
99
101
|
currentField = currentField._def.innerType;
|
|
100
102
|
}
|
|
101
103
|
};
|
|
104
|
+
const WELCOME_MESSAGE_TEMPLATE = {
|
|
105
|
+
type: 'system',
|
|
106
|
+
content: `
|
|
107
|
+
Welcome to Midscene.js Playground!
|
|
108
|
+
|
|
109
|
+
This is a panel for experimenting and testing Midscene.js features. You can use natural language instructions to operate the web page, such as clicking buttons, filling in forms, querying information, etc.
|
|
110
|
+
|
|
111
|
+
Please enter your instructions in the input box below to start experiencing.
|
|
112
|
+
`,
|
|
113
|
+
loading: false,
|
|
114
|
+
result: void 0,
|
|
115
|
+
replayScriptsInfo: null,
|
|
116
|
+
replayCounter: 0,
|
|
117
|
+
loadingProgressText: '',
|
|
118
|
+
verticalMode: false
|
|
119
|
+
};
|
|
120
|
+
const BLANK_RESULT = {
|
|
121
|
+
result: void 0,
|
|
122
|
+
dump: null,
|
|
123
|
+
reportHTML: null,
|
|
124
|
+
error: null
|
|
125
|
+
};
|
|
126
|
+
exports.BLANK_RESULT = __webpack_exports__.BLANK_RESULT;
|
|
102
127
|
exports.VALIDATION_CONSTANTS = __webpack_exports__.VALIDATION_CONSTANTS;
|
|
128
|
+
exports.WELCOME_MESSAGE_TEMPLATE = __webpack_exports__.WELCOME_MESSAGE_TEMPLATE;
|
|
103
129
|
exports.extractDefaultValue = __webpack_exports__.extractDefaultValue;
|
|
104
130
|
exports.isLocateField = __webpack_exports__.isLocateField;
|
|
105
131
|
exports.isZodObjectSchema = __webpack_exports__.isZodObjectSchema;
|
|
106
132
|
exports.unwrapZodType = __webpack_exports__.unwrapZodType;
|
|
107
133
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
134
|
+
"BLANK_RESULT",
|
|
108
135
|
"VALIDATION_CONSTANTS",
|
|
136
|
+
"WELCOME_MESSAGE_TEMPLATE",
|
|
109
137
|
"extractDefaultValue",
|
|
110
138
|
"isLocateField",
|
|
111
139
|
"isZodObjectSchema",
|
|
@@ -45,9 +45,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
45
45
|
});
|
|
46
46
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
47
47
|
const external_antd_namespaceObject = require("antd");
|
|
48
|
-
const
|
|
49
|
-
var
|
|
50
|
-
require("./index.css");
|
|
48
|
+
const index_js_namespaceObject = require("../component/shiny-text/index.js");
|
|
49
|
+
var index_js_default = /*#__PURE__*/ __webpack_require__.n(index_js_namespaceObject);
|
|
51
50
|
const errorMessageServerNotReady = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
52
51
|
children: [
|
|
53
52
|
"Don't worry, just one more step to launch the playground server.",
|
|
@@ -81,7 +80,7 @@ const emptyResultTip = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div",
|
|
|
81
80
|
style: {
|
|
82
81
|
textAlign: 'center'
|
|
83
82
|
},
|
|
84
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
83
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_default(), {
|
|
85
84
|
disabled: true,
|
|
86
85
|
text: "The result will be shown here"
|
|
87
86
|
})
|
|
@@ -30,7 +30,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30
30
|
getPlaceholderForType: ()=>getPlaceholderForType
|
|
31
31
|
});
|
|
32
32
|
const static_namespaceObject = require("@midscene/web/static");
|
|
33
|
-
const external_types_js_namespaceObject = require("
|
|
33
|
+
const external_types_js_namespaceObject = require("../types.js");
|
|
34
34
|
const actionNameForType = (type)=>{
|
|
35
35
|
const typeWithoutAi = type.startsWith('ai') ? type.slice(2) : type;
|
|
36
36
|
const fullName = typeWithoutAi.replace(/([A-Z])/g, ' $1').trim();
|
|
@@ -30,8 +30,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30
30
|
generateAnimationScripts: ()=>generateAnimationScripts,
|
|
31
31
|
allScriptsFromDump: ()=>allScriptsFromDump
|
|
32
32
|
});
|
|
33
|
-
require("./
|
|
34
|
-
const external_utils_js_namespaceObject = require("../utils.js");
|
|
33
|
+
const external_index_js_namespaceObject = require("./index.js");
|
|
35
34
|
const agent_namespaceObject = require("@midscene/core/agent");
|
|
36
35
|
const extractor_namespaceObject = require("@midscene/shared/extractor");
|
|
37
36
|
const stillDuration = 900;
|
|
@@ -234,7 +233,7 @@ const generateAnimationScripts = (execution, task, imageWidth, imageHeight)=>{
|
|
|
234
233
|
var _task_recorder_, _task_recorder, _task_recorder_1, _task_recorder1;
|
|
235
234
|
const title = (0, agent_namespaceObject.typeStr)(task);
|
|
236
235
|
const subTitle = (0, agent_namespaceObject.paramStr)(task);
|
|
237
|
-
scripts.push(pointerScript(
|
|
236
|
+
scripts.push(pointerScript(external_index_js_namespaceObject.mousePointer, title, subTitle));
|
|
238
237
|
currentCameraState = null != insightCameraState ? insightCameraState : fullPageCameraState;
|
|
239
238
|
scripts.push({
|
|
240
239
|
type: 'img',
|
|
@@ -262,7 +261,7 @@ const generateAnimationScripts = (execution, task, imageWidth, imageHeight)=>{
|
|
|
262
261
|
title,
|
|
263
262
|
subTitle
|
|
264
263
|
});
|
|
265
|
-
scripts.push(pointerScript(
|
|
264
|
+
scripts.push(pointerScript(external_index_js_namespaceObject.mousePointer, title, subTitle));
|
|
266
265
|
scripts.push({
|
|
267
266
|
type: 'img',
|
|
268
267
|
img: null == (_task_recorder2 = task.recorder) ? void 0 : null == (_task_recorder_2 = _task_recorder2[1]) ? void 0 : _task_recorder_2.screenshot,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import './component/index.less';
|
|
2
|
+
import './component/universal-playground/index.less';
|
|
3
|
+
export { useEnvConfig } from './store/store';
|
|
4
|
+
export { colorForName, highlightColorForType, globalThemeConfig, } from './utils/color';
|
|
5
|
+
export { EnvConfig } from './component/env-config';
|
|
6
|
+
export { Logo } from './component/logo';
|
|
7
|
+
export { iconForStatus, timeCostStrElement } from './component/misc';
|
|
8
|
+
export { PlaygroundResultView } from './component/playground-result';
|
|
9
|
+
export type { PlaygroundResult } from './types';
|
|
10
|
+
export { ContextPreview } from './component/context-preview';
|
|
11
|
+
export { Player } from './component/player';
|
|
12
|
+
export { Blackboard } from './component/blackboard';
|
|
13
|
+
export { GithubStar } from './component/github-star';
|
|
14
|
+
export { timeStr, filterBase64Value } from './utils';
|
|
15
|
+
export { default as ShinyText } from './component/shiny-text';
|
|
16
|
+
export { UniversalPlayground, default as UniversalPlaygroundDefault, } from './component/universal-playground';
|
|
17
|
+
export type { UniversalPlaygroundProps, PlaygroundSDKLike, StorageProvider, ContextProvider, UniversalPlaygroundConfig, PlaygroundBranding, InfoListItem, FormValue, ExecutionOptions, ProgressCallback, } from './types';
|
|
18
|
+
export { LocalStorageProvider, MemoryStorageProvider, NoOpStorageProvider, } from './component/universal-playground/providers/storage-provider';
|
|
19
|
+
export { BaseContextProvider, StaticContextProvider, NoOpContextProvider, } from './component/universal-playground/providers/context-provider';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'pixi.js/unsafe-eval';
|
|
2
|
+
import type { BaseElement, Rect, UIContext } from '@midscene/core';
|
|
2
3
|
import * as PIXI from 'pixi.js';
|
|
3
|
-
import
|
|
4
|
-
import './blackboard.less';
|
|
4
|
+
import './index.less';
|
|
5
5
|
export declare const pointMarkForItem: (point: [number, number], type: "highlightPoint") => PIXI.Graphics;
|
|
6
6
|
export declare const rectMarkForItem: (rect: Rect, name: string, type: "element" | "searchArea" | "highlight") => (PIXI.Graphics | PIXI.Text)[];
|
|
7
7
|
export declare const Blackboard: (props: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './index.less';
|
|
2
2
|
export declare const GithubStar: () => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../types';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare function timeCostStrElement(timeCost?: number): React.JSX.Element;
|
|
3
|
+
export declare const iconForStatus: (status: string) => React.JSX.Element;
|
|
4
|
+
export declare const errorMessageServerNotReady: React.JSX.Element;
|
|
5
|
+
export declare const serverLaunchTip: (notReadyMessage?: React.ReactNode | string) => React.JSX.Element;
|
|
6
|
+
export declare const emptyResultTip: React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'pixi.js/unsafe-eval';
|
|
2
|
-
import './
|
|
3
|
-
import type { AnimationScript } from '
|
|
2
|
+
import './index.less';
|
|
3
|
+
import type { AnimationScript } from '../../utils/replay-scripts';
|
|
4
4
|
export declare function Player(props?: {
|
|
5
5
|
replayScripts?: AnimationScript[];
|
|
6
6
|
imageWidth?: number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ContextPreview } from '../context-preview';
|
|
2
|
+
export { PlaygroundResultView } from '../playground-result';
|
|
3
|
+
export { PromptInput } from '../prompt-input';
|
|
4
|
+
export { useServerValid } from '../../hooks/useServerValid';
|
|
5
|
+
export { ServiceModeControl } from '../service-mode-control';
|
|
6
|
+
export * from '../../types';
|
|
7
|
+
export { useEnvConfig } from '../../store/store';
|
package/dist/types/component/{playground/PlaygroundResult.d.ts → playground-result/index.d.ts}
RENAMED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import './index.less';
|
|
2
|
+
import type { PlaygroundResult as PlaygroundResultType } from '../../types';
|
|
3
|
+
import type { ServiceModeType } from '../../types';
|
|
4
|
+
import type { ReplayScriptsInfo } from '../../utils/replay-scripts';
|
|
6
5
|
interface PlaygroundResultProps {
|
|
7
6
|
result: PlaygroundResultType | null;
|
|
8
7
|
loading: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import './index.less';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import type { RunType } from '
|
|
3
|
-
import type { ServiceModeType } from '
|
|
3
|
+
import type { RunType } from '../../types';
|
|
4
|
+
import type { ServiceModeType } from '../../types';
|
|
4
5
|
import './index.less';
|
|
5
6
|
import type { DeviceAction } from '@midscene/core';
|
|
6
7
|
interface PromptInputProps {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { UniversalPlaygroundProps } from '../../types';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare function UniversalPlayground({ playgroundSDK, storage, contextProvider, config: componentConfig, branding, className, dryMode, showContextPreview, }: UniversalPlaygroundProps): import("react").JSX.Element;
|
|
4
|
+
export default UniversalPlayground;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { UIContext } from '@midscene/core';
|
|
2
|
+
import type { ContextProvider } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Base context provider implementation
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class BaseContextProvider implements ContextProvider {
|
|
7
|
+
protected cachedContext?: UIContext;
|
|
8
|
+
abstract getUIContext(): Promise<UIContext>;
|
|
9
|
+
refreshContext(): Promise<UIContext>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Agent-based context provider for local execution modes
|
|
13
|
+
*/
|
|
14
|
+
export declare class AgentContextProvider extends BaseContextProvider {
|
|
15
|
+
private getAgent;
|
|
16
|
+
private options?;
|
|
17
|
+
constructor(getAgent: () => any, options?: {
|
|
18
|
+
forceSameTabNavigation?: boolean;
|
|
19
|
+
} | undefined);
|
|
20
|
+
getUIContext(): Promise<UIContext>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Static context provider for pre-determined UI contexts
|
|
24
|
+
*/
|
|
25
|
+
export declare class StaticContextProvider extends BaseContextProvider {
|
|
26
|
+
private context;
|
|
27
|
+
constructor(context: UIContext);
|
|
28
|
+
getUIContext(): Promise<UIContext>;
|
|
29
|
+
refreshContext(): Promise<UIContext>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* No-op context provider for cases where context preview is disabled
|
|
33
|
+
*/
|
|
34
|
+
export declare class NoOpContextProvider implements ContextProvider {
|
|
35
|
+
getUIContext(): Promise<UIContext>;
|
|
36
|
+
refreshContext(): Promise<UIContext>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { InfoListItem, StorageProvider } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Local Storage implementation for playground message persistence
|
|
4
|
+
*/
|
|
5
|
+
export declare class LocalStorageProvider implements StorageProvider {
|
|
6
|
+
private readonly messagesKey;
|
|
7
|
+
private readonly resultsKey;
|
|
8
|
+
constructor(namespace?: string);
|
|
9
|
+
saveMessages(messages: InfoListItem[]): Promise<void>;
|
|
10
|
+
loadMessages(): Promise<InfoListItem[]>;
|
|
11
|
+
clearMessages(): Promise<void>;
|
|
12
|
+
saveResult(id: string, result: InfoListItem): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Memory-only storage implementation for non-persistent scenarios
|
|
16
|
+
*/
|
|
17
|
+
export declare class MemoryStorageProvider implements StorageProvider {
|
|
18
|
+
private messages;
|
|
19
|
+
private results;
|
|
20
|
+
saveMessages(messages: InfoListItem[]): Promise<void>;
|
|
21
|
+
loadMessages(): Promise<InfoListItem[]>;
|
|
22
|
+
clearMessages(): Promise<void>;
|
|
23
|
+
saveResult(id: string, result: InfoListItem): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* No-op storage implementation for cases where persistence is disabled
|
|
27
|
+
*/
|
|
28
|
+
export declare class NoOpStorageProvider implements StorageProvider {
|
|
29
|
+
saveMessages(_messages: InfoListItem[]): Promise<void>;
|
|
30
|
+
loadMessages(): Promise<InfoListItem[]>;
|
|
31
|
+
clearMessages(): Promise<void>;
|
|
32
|
+
saveResult(_id: string, _result: InfoListItem): Promise<void>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DeviceAction } from '@midscene/core';
|
|
2
|
+
import type { FormValue, InfoListItem, PlaygroundSDKLike, StorageProvider } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Hook for handling playground execution logic
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePlaygroundExecution(playgroundSDK: PlaygroundSDKLike, storage: StorageProvider | undefined, actionSpace: DeviceAction<unknown>[], loading: boolean, setLoading: (loading: boolean) => void, infoList: InfoListItem[], setInfoList: React.Dispatch<React.SetStateAction<InfoListItem[]>>, replayCounter: number, setReplayCounter: React.Dispatch<React.SetStateAction<number>>, verticalMode: boolean, currentRunningIdRef: React.MutableRefObject<number | null>, interruptedFlagRef: React.MutableRefObject<Record<number, boolean>>): {
|
|
7
|
+
handleRun: (value: FormValue) => Promise<void>;
|
|
8
|
+
handleStop: () => Promise<void>;
|
|
9
|
+
canStop: boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DeviceAction, UIContext } from '@midscene/core';
|
|
2
|
+
import type { ContextProvider, InfoListItem, PlaygroundSDKLike, StorageProvider } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Hook for managing playground state
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePlaygroundState(playgroundSDK: PlaygroundSDKLike, storage?: StorageProvider, contextProvider?: ContextProvider): {
|
|
7
|
+
loading: boolean;
|
|
8
|
+
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
9
|
+
infoList: InfoListItem[];
|
|
10
|
+
setInfoList: import("react").Dispatch<import("react").SetStateAction<InfoListItem[]>>;
|
|
11
|
+
actionSpace: DeviceAction<unknown>[];
|
|
12
|
+
actionSpaceLoading: boolean;
|
|
13
|
+
uiContextPreview: UIContext<import("@midscene/core").BaseElement> | undefined;
|
|
14
|
+
setUiContextPreview: import("react").Dispatch<import("react").SetStateAction<UIContext<import("@midscene/core").BaseElement> | undefined>>;
|
|
15
|
+
showScrollToBottomButton: boolean;
|
|
16
|
+
verticalMode: boolean;
|
|
17
|
+
replayCounter: number;
|
|
18
|
+
setReplayCounter: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
19
|
+
infoListRef: import("react").RefObject<HTMLDivElement>;
|
|
20
|
+
currentRunningIdRef: import("react").MutableRefObject<number | null>;
|
|
21
|
+
interruptedFlagRef: import("react").MutableRefObject<Record<number, boolean>>;
|
|
22
|
+
clearInfoList: () => Promise<void>;
|
|
23
|
+
refreshContext: () => Promise<void>;
|
|
24
|
+
handleScrollToBottom: () => void;
|
|
25
|
+
scrollToBottom: () => void;
|
|
26
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import './component/playground/index.less';
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
2
|
+
import './component/universal-playground/index.less';
|
|
3
|
+
export { type AnimationScript, type ReplayScriptsInfo, allScriptsFromDump, generateAnimationScripts, } from './utils/replay-scripts';
|
|
4
|
+
export { useEnvConfig } from './store/store';
|
|
5
|
+
export { colorForName, highlightColorForType, globalThemeConfig, } from './utils/color';
|
|
5
6
|
export { EnvConfig } from './component/env-config';
|
|
6
7
|
export { Logo } from './component/logo';
|
|
7
8
|
export { iconForStatus, timeCostStrElement } from './component/misc';
|
|
8
|
-
export { useServerValid } from './
|
|
9
|
-
export { PlaygroundResultView } from './component/playground
|
|
10
|
-
export type { PlaygroundResult } from './
|
|
11
|
-
export { ServiceModeControl } from './component/
|
|
12
|
-
export { ContextPreview } from './component/
|
|
13
|
-
export { PromptInput } from './component/
|
|
9
|
+
export { useServerValid } from './hooks/useServerValid';
|
|
10
|
+
export { PlaygroundResultView } from './component/playground-result';
|
|
11
|
+
export type { PlaygroundResult } from './types';
|
|
12
|
+
export { ServiceModeControl } from './component/service-mode-control';
|
|
13
|
+
export { ContextPreview } from './component/context-preview';
|
|
14
|
+
export { PromptInput } from './component/prompt-input';
|
|
14
15
|
export { Player } from './component/player';
|
|
15
16
|
export { Blackboard } from './component/blackboard';
|
|
16
17
|
export { GithubStar } from './component/github-star';
|
|
17
|
-
export { actionNameForType, staticAgentFromContext, getPlaceholderForType, } from './
|
|
18
|
+
export { actionNameForType, staticAgentFromContext, getPlaceholderForType, } from './utils/playground-utils';
|
|
18
19
|
export { timeStr, filterBase64Value } from './utils';
|
|
19
20
|
export { default as ShinyText } from './component/shiny-text';
|
|
21
|
+
export { UniversalPlayground, default as UniversalPlaygroundDefault, } from './component/universal-playground';
|
|
22
|
+
export type { UniversalPlaygroundProps, PlaygroundSDKLike, StorageProvider, ContextProvider, UniversalPlaygroundConfig, PlaygroundBranding, InfoListItem, FormValue, ExecutionOptions, ProgressCallback, } from './types';
|
|
23
|
+
export { LocalStorageProvider, MemoryStorageProvider, NoOpStorageProvider, } from './component/universal-playground/providers/storage-provider';
|
|
24
|
+
export { BaseContextProvider, AgentContextProvider, StaticContextProvider, NoOpContextProvider, } from './component/universal-playground/providers/context-provider';
|