@midscene/visualizer 0.28.2-beta-20250910032414.0 → 0.28.2-beta-20250910035416.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 (134) hide show
  1. package/dist/es/component/{blackboard.mjs → blackboard/index.mjs} +3 -3
  2. package/dist/es/component/{playground/ConfigSelector.mjs → config-selector/index.mjs} +2 -3
  3. package/dist/es/component/{playground/ContextPreview.mjs → context-preview/index.mjs} +3 -4
  4. package/dist/es/component/{env-config.mjs → env-config/index.mjs} +1 -1
  5. package/dist/es/component/{github-star.mjs → github-star/index.mjs} +1 -1
  6. package/dist/es/component/history-selector/index.css +132 -0
  7. package/dist/es/component/{playground/HistorySelector.mjs → history-selector/index.mjs} +1 -1
  8. package/dist/es/component/index.mjs +1 -0
  9. package/dist/es/component/{logo.mjs → logo/index.mjs} +1 -1
  10. package/dist/es/component/{misc.mjs → misc/index.mjs} +42 -2
  11. package/dist/es/component/{player.mjs → player/index.mjs} +8 -8
  12. package/dist/es/component/playground/index.css +29 -161
  13. package/dist/es/component/playground/index.mjs +8 -0
  14. package/dist/es/component/playground-result/index.css +29 -0
  15. package/dist/es/component/{playground/PlaygroundResult.mjs → playground-result/index.mjs} +3 -4
  16. package/dist/es/component/prompt-input/index.css +330 -0
  17. package/dist/es/component/{playground/PromptInput.mjs → prompt-input/index.mjs} +9 -9
  18. package/dist/es/component/{playground/ServiceModeControl.mjs → service-mode-control/index.mjs} +4 -5
  19. package/dist/es/component/{shiny-text.mjs → shiny-text/index.mjs} +1 -1
  20. package/dist/es/component/universal-playground/index.css +341 -0
  21. package/dist/es/component/universal-playground/index.mjs +273 -0
  22. package/dist/es/component/universal-playground/providers/context-provider.mjs +52 -0
  23. package/dist/es/component/universal-playground/providers/storage-provider.mjs +107 -0
  24. package/dist/es/hooks/usePlaygroundExecution.mjs +168 -0
  25. package/dist/es/hooks/usePlaygroundState.mjs +176 -0
  26. package/dist/es/icons/avatar.mjs +28 -0
  27. package/dist/es/index.mjs +22 -18
  28. package/dist/es/{component/playground/playground-constants.mjs → utils/constants.mjs} +23 -43
  29. package/dist/es/{component/playground → utils}/playground-utils.mjs +1 -1
  30. package/dist/es/{component → utils}/replay-scripts.mjs +1 -2
  31. package/dist/lib/component/{blackboard.js → blackboard/index.js} +5 -5
  32. package/dist/lib/component/{playground/ConfigSelector.js → config-selector/index.js} +6 -7
  33. package/dist/lib/component/{playground/ContextPreview.js → context-preview/index.js} +8 -9
  34. package/dist/lib/component/{env-config.js → env-config/index.js} +1 -1
  35. package/dist/lib/component/{github-star.js → github-star/index.js} +1 -1
  36. package/dist/lib/component/history-selector/index.css +132 -0
  37. package/dist/lib/component/{playground/HistorySelector.js → history-selector/index.js} +1 -1
  38. package/dist/lib/component/index.js +60 -0
  39. package/dist/lib/component/{logo.js → logo/index.js} +1 -1
  40. package/dist/lib/component/{misc.js → misc/index.js} +60 -1
  41. package/dist/lib/component/{player.js → player/index.js} +23 -23
  42. package/dist/lib/component/playground/index.css +29 -161
  43. package/dist/lib/component/playground/index.js +113 -0
  44. package/dist/lib/component/playground-result/index.css +29 -0
  45. package/dist/lib/component/{playground/PlaygroundResult.js → playground-result/index.js} +8 -9
  46. package/dist/lib/component/prompt-input/index.css +330 -0
  47. package/dist/lib/component/{playground/PromptInput.js → prompt-input/index.js} +37 -37
  48. package/dist/lib/component/{playground/ServiceModeControl.js → service-mode-control/index.js} +8 -9
  49. package/dist/lib/component/{shiny-text.js → shiny-text/index.js} +1 -1
  50. package/dist/lib/component/universal-playground/index.css +341 -0
  51. package/dist/lib/component/universal-playground/index.js +321 -0
  52. package/dist/lib/component/universal-playground/providers/context-provider.js +95 -0
  53. package/dist/lib/component/universal-playground/providers/storage-provider.js +147 -0
  54. package/dist/lib/hooks/usePlaygroundExecution.js +202 -0
  55. package/dist/lib/hooks/usePlaygroundState.js +210 -0
  56. package/dist/lib/icons/avatar.js +62 -0
  57. package/dist/lib/index.js +66 -34
  58. package/dist/lib/{component/playground/playground-constants.js → utils/constants.js} +31 -64
  59. package/dist/lib/{component/playground → utils}/playground-utils.js +1 -1
  60. package/dist/lib/{component → utils}/replay-scripts.js +3 -4
  61. package/dist/types/component/{blackboard.d.ts → blackboard/index.d.ts} +2 -2
  62. package/dist/types/component/{playground/ConfigSelector.d.ts → config-selector/index.d.ts} +0 -1
  63. package/dist/types/component/{playground/ContextPreview.d.ts → context-preview/index.d.ts} +0 -1
  64. package/dist/types/component/{github-star.d.ts → github-star/index.d.ts} +1 -1
  65. package/dist/types/component/{playground/HistorySelector.d.ts → history-selector/index.d.ts} +1 -1
  66. package/dist/types/component/index.d.ts +1 -0
  67. package/dist/types/component/{logo.d.ts → logo/index.d.ts} +1 -1
  68. package/dist/types/component/misc/index.d.ts +6 -0
  69. package/dist/types/component/{player.d.ts → player/index.d.ts} +2 -2
  70. package/dist/types/component/playground/index.d.ts +7 -0
  71. package/dist/types/component/{playground/PlaygroundResult.d.ts → playground-result/index.d.ts} +3 -4
  72. package/dist/types/component/{playground/PromptInput.d.ts → prompt-input/index.d.ts} +3 -2
  73. package/dist/types/component/{playground/ServiceModeControl.d.ts → service-mode-control/index.d.ts} +0 -1
  74. package/dist/types/component/{shiny-text.d.ts → shiny-text/index.d.ts} +1 -1
  75. package/dist/types/component/universal-playground/index.d.ts +4 -0
  76. package/dist/types/component/universal-playground/providers/context-provider.d.ts +37 -0
  77. package/dist/types/component/universal-playground/providers/storage-provider.d.ts +33 -0
  78. package/dist/types/hooks/usePlaygroundExecution.d.ts +10 -0
  79. package/dist/types/hooks/usePlaygroundState.d.ts +26 -0
  80. package/dist/types/index.d.ts +15 -10
  81. package/dist/types/types.d.ts +164 -0
  82. package/dist/types/{component/playground/playground-constants.d.ts → utils/constants.d.ts} +3 -5
  83. package/dist/types/{component → utils}/replay-scripts.d.ts +0 -1
  84. package/package.json +5 -5
  85. package/dist/es/blank_polyfill.mjs +0 -2
  86. package/dist/es/component/describer.css +0 -25
  87. package/dist/es/component/playground/playground-types.mjs +0 -0
  88. package/dist/es/init.mjs +0 -10
  89. package/dist/lib/blank_polyfill.js +0 -36
  90. package/dist/lib/component/describer.css +0 -25
  91. package/dist/lib/component/playground/playground-types.js +0 -18
  92. package/dist/lib/init.js +0 -44
  93. package/dist/types/blank_polyfill.d.ts +0 -2
  94. package/dist/types/component/misc.d.ts +0 -2
  95. package/dist/types/component/playground/playground-types.d.ts +0 -19
  96. package/dist/types/component/playground/types.d.ts +0 -72
  97. package/dist/types/init.d.ts +0 -1
  98. /package/dist/es/component/{blackboard.css → blackboard/index.css} +0 -0
  99. /package/dist/es/component/{playground/FormField.mjs → form-field/index.mjs} +0 -0
  100. /package/dist/es/component/{github-star.css → github-star/index.css} +0 -0
  101. /package/dist/es/component/{logo.css → logo/index.css} +0 -0
  102. /package/dist/es/component/{player.css → player/index.css} +0 -0
  103. /package/dist/es/component/{playground-demo-ui-context.json → playground/playground-demo-ui-context.json} +0 -0
  104. /package/dist/es/component/{shiny-text.css → shiny-text/index.css} +0 -0
  105. /package/dist/es/{component/playground → hooks}/useServerValid.mjs +0 -0
  106. /package/dist/es/{component/store → store}/history.mjs +0 -0
  107. /package/dist/es/{component/store → store}/store.mjs +0 -0
  108. /package/dist/es/{component/playground/types.mjs → types.mjs} +0 -0
  109. /package/dist/es/{component → utils}/color.mjs +0 -0
  110. /package/dist/es/{utils.mjs → utils/index.mjs} +0 -0
  111. /package/dist/es/{component → utils}/pixi-loader.mjs +0 -0
  112. /package/dist/lib/component/{blackboard.css → blackboard/index.css} +0 -0
  113. /package/dist/lib/component/{playground/FormField.js → form-field/index.js} +0 -0
  114. /package/dist/lib/component/{github-star.css → github-star/index.css} +0 -0
  115. /package/dist/lib/component/{logo.css → logo/index.css} +0 -0
  116. /package/dist/lib/component/{player.css → player/index.css} +0 -0
  117. /package/dist/lib/component/{playground-demo-ui-context.json → playground/playground-demo-ui-context.json} +0 -0
  118. /package/dist/lib/component/{shiny-text.css → shiny-text/index.css} +0 -0
  119. /package/dist/lib/{component/playground → hooks}/useServerValid.js +0 -0
  120. /package/dist/lib/{component/store → store}/history.js +0 -0
  121. /package/dist/lib/{component/store → store}/store.js +0 -0
  122. /package/dist/lib/{component/playground/types.js → types.js} +0 -0
  123. /package/dist/lib/{component → utils}/color.js +0 -0
  124. /package/dist/lib/{utils.js → utils/index.js} +0 -0
  125. /package/dist/lib/{component → utils}/pixi-loader.js +0 -0
  126. /package/dist/types/component/{env-config.d.ts → env-config/index.d.ts} +0 -0
  127. /package/dist/types/component/{playground/FormField.d.ts → form-field/index.d.ts} +0 -0
  128. /package/dist/types/{component/playground → hooks}/useServerValid.d.ts +0 -0
  129. /package/dist/types/{component/store → store}/history.d.ts +0 -0
  130. /package/dist/types/{component/store → store}/store.d.ts +0 -0
  131. /package/dist/types/{component → utils}/color.d.ts +0 -0
  132. /package/dist/types/{utils.d.ts → utils/index.d.ts} +0 -0
  133. /package/dist/types/{component → utils}/pixi-loader.d.ts +0 -0
  134. /package/dist/types/{component/playground → utils}/playground-utils.d.ts +0 -0
@@ -0,0 +1,62 @@
1
+ "use strict";
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
+ default: ()=>avatar
28
+ });
29
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
+ require("react");
31
+ const SvgAvatar = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("svg", {
32
+ xmlns: "http://www.w3.org/2000/svg",
33
+ width: 20,
34
+ height: 20,
35
+ fill: "none",
36
+ "aria-label": "Playground",
37
+ viewBox: "0 0 20 20",
38
+ ...props,
39
+ children: [
40
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("rect", {
41
+ width: 20,
42
+ height: 20,
43
+ fill: "#2B83FF",
44
+ rx: 10
45
+ }),
46
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
47
+ fill: "#2B83FF",
48
+ stroke: "#fff",
49
+ strokeLinejoin: "round",
50
+ strokeWidth: 1.125,
51
+ d: "M6.866 5.882a.56.56 0 0 1 .667-.078l3.248 1.875 3.247 1.875a.563.563 0 0 1 0 .974l-3.247 1.875-3.248 1.875a.563.563 0 0 1-.784-.74l1.749-3.497-1.75-3.498a.56.56 0 0 1 .118-.661Z"
52
+ })
53
+ ]
54
+ });
55
+ const avatar = SvgAvatar;
56
+ exports["default"] = __webpack_exports__["default"];
57
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
58
+ "default"
59
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
60
+ Object.defineProperty(exports, '__esModule', {
61
+ value: true
62
+ });
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: ()=>misc_js_namespaceObject.timeCostStrElement,
36
+ timeCostStrElement: ()=>misc_index_js_namespaceObject.timeCostStrElement,
37
37
  actionNameForType: ()=>playground_utils_js_namespaceObject.actionNameForType,
38
- PlaygroundResultView: ()=>PlaygroundResult_js_namespaceObject.PlaygroundResultView,
39
- timeStr: ()=>external_utils_js_namespaceObject.timeStr,
40
- EnvConfig: ()=>env_config_js_namespaceObject.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
- PromptInput: ()=>PromptInput_js_namespaceObject.PromptInput,
43
- ContextPreview: ()=>ContextPreview_js_namespaceObject.ContextPreview,
42
+ LocalStorageProvider: ()=>storage_provider_js_namespaceObject.LocalStorageProvider,
43
+ UniversalPlaygroundDefault: ()=>universal_playground_index_js_default(),
44
44
  generateAnimationScripts: ()=>replay_scripts_js_namespaceObject.generateAnimationScripts,
45
- ShinyText: ()=>shiny_text_js_default(),
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
- Player: ()=>player_js_namespaceObject.Player,
52
- ServiceModeControl: ()=>ServiceModeControl_js_namespaceObject.ServiceModeControl,
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: ()=>github_star_js_namespaceObject.GithubStar,
56
- Logo: ()=>logo_js_namespaceObject.Logo,
57
- globalThemeConfig: ()=>color_js_namespaceObject.globalThemeConfig,
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: ()=>misc_js_namespaceObject.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
- const replay_scripts_js_namespaceObject = require("./component/replay-scripts.js");
63
- const store_js_namespaceObject = require("./component/store/store.js");
64
- const color_js_namespaceObject = require("./component/color.js");
65
- const env_config_js_namespaceObject = require("./component/env-config.js");
66
- const logo_js_namespaceObject = require("./component/logo.js");
67
- const misc_js_namespaceObject = require("./component/misc.js");
68
- const useServerValid_js_namespaceObject = require("./component/playground/useServerValid.js");
69
- const PlaygroundResult_js_namespaceObject = require("./component/playground/PlaygroundResult.js");
70
- const ServiceModeControl_js_namespaceObject = require("./component/playground/ServiceModeControl.js");
71
- const ContextPreview_js_namespaceObject = require("./component/playground/ContextPreview.js");
72
- const PromptInput_js_namespaceObject = require("./component/playground/PromptInput.js");
73
- const player_js_namespaceObject = require("./component/player.js");
74
- const blackboard_js_namespaceObject = require("./component/blackboard.js");
75
- const github_star_js_namespaceObject = require("./component/github-star.js");
76
- const playground_utils_js_namespaceObject = require("./component/playground/playground-utils.js");
77
- const external_utils_js_namespaceObject = require("./utils.js");
78
- const shiny_text_js_namespaceObject = require("./component/shiny-text.js");
79
- var shiny_text_js_default = /*#__PURE__*/ __webpack_require__.n(shiny_text_js_namespaceObject);
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",
@@ -1,14 +1,5 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = (module)=>{
5
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
- __webpack_require__.d(getter, {
7
- a: getter
8
- });
9
- return getter;
10
- };
11
- })();
12
3
  (()=>{
13
4
  __webpack_require__.d = (exports1, definition)=>{
14
5
  for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
@@ -33,58 +24,14 @@ var __webpack_require__ = {};
33
24
  var __webpack_exports__ = {};
34
25
  __webpack_require__.r(__webpack_exports__);
35
26
  __webpack_require__.d(__webpack_exports__, {
36
- screenshotIncludedTip: ()=>screenshotIncludedTip,
37
- errorMessageServerNotReady: ()=>errorMessageServerNotReady,
38
- serverLaunchTip: ()=>serverLaunchTip,
39
- defaultMainButtons: ()=>defaultMainButtons,
27
+ BLANK_RESULT: ()=>BLANK_RESULT,
28
+ WELCOME_MESSAGE_TEMPLATE: ()=>WELCOME_MESSAGE_TEMPLATE,
40
29
  apiMetadata: ()=>apiMetadata,
41
- trackingTip: ()=>trackingTip,
42
30
  deepThinkTip: ()=>deepThinkTip,
31
+ defaultMainButtons: ()=>defaultMainButtons,
43
32
  domIncludedTip: ()=>domIncludedTip,
44
- emptyResultTip: ()=>emptyResultTip
45
- });
46
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
47
- const external_antd_namespaceObject = require("antd");
48
- const external_shiny_text_js_namespaceObject = require("../shiny-text.js");
49
- var external_shiny_text_js_default = /*#__PURE__*/ __webpack_require__.n(external_shiny_text_js_namespaceObject);
50
- require("./index.css");
51
- const errorMessageServerNotReady = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
52
- children: [
53
- "Don't worry, just one more step to launch the playground server.",
54
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("br", {}),
55
- "Please run one of the commands under the midscene project directory:",
56
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("br", {}),
57
- "a. ",
58
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("strong", {
59
- children: "npx midscene-playground"
60
- }),
61
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("br", {}),
62
- "b. ",
63
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("strong", {
64
- children: "npx --yes @midscene/web"
65
- })
66
- ]
67
- });
68
- const serverLaunchTip = function() {
69
- let notReadyMessage = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : errorMessageServerNotReady;
70
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
71
- className: "server-tip",
72
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Alert, {
73
- message: "Playground Server Not Ready",
74
- description: notReadyMessage,
75
- type: "warning"
76
- })
77
- });
78
- };
79
- const emptyResultTip = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
80
- className: "result-empty-tip",
81
- style: {
82
- textAlign: 'center'
83
- },
84
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_shiny_text_js_default(), {
85
- disabled: true,
86
- text: "The result will be shown here"
87
- })
33
+ screenshotIncludedTip: ()=>screenshotIncludedTip,
34
+ trackingTip: ()=>trackingTip
88
35
  });
89
36
  const trackingTip = 'limit popup to current tab';
90
37
  const deepThinkTip = 'deep think';
@@ -162,24 +109,44 @@ const defaultMainButtons = [
162
109
  'aiQuery',
163
110
  'aiAssert'
164
111
  ];
112
+ const WELCOME_MESSAGE_TEMPLATE = {
113
+ type: 'system',
114
+ content: `
115
+ Welcome to Midscene.js Playground!
116
+
117
+ 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.
118
+
119
+ Please enter your instructions in the input box below to start experiencing.
120
+ `,
121
+ loading: false,
122
+ result: void 0,
123
+ replayScriptsInfo: null,
124
+ replayCounter: 0,
125
+ loadingProgressText: '',
126
+ verticalMode: false
127
+ };
128
+ const BLANK_RESULT = {
129
+ result: void 0,
130
+ dump: null,
131
+ reportHTML: null,
132
+ error: null
133
+ };
134
+ exports.BLANK_RESULT = __webpack_exports__.BLANK_RESULT;
135
+ exports.WELCOME_MESSAGE_TEMPLATE = __webpack_exports__.WELCOME_MESSAGE_TEMPLATE;
165
136
  exports.apiMetadata = __webpack_exports__.apiMetadata;
166
137
  exports.deepThinkTip = __webpack_exports__.deepThinkTip;
167
138
  exports.defaultMainButtons = __webpack_exports__.defaultMainButtons;
168
139
  exports.domIncludedTip = __webpack_exports__.domIncludedTip;
169
- exports.emptyResultTip = __webpack_exports__.emptyResultTip;
170
- exports.errorMessageServerNotReady = __webpack_exports__.errorMessageServerNotReady;
171
140
  exports.screenshotIncludedTip = __webpack_exports__.screenshotIncludedTip;
172
- exports.serverLaunchTip = __webpack_exports__.serverLaunchTip;
173
141
  exports.trackingTip = __webpack_exports__.trackingTip;
174
142
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
143
+ "BLANK_RESULT",
144
+ "WELCOME_MESSAGE_TEMPLATE",
175
145
  "apiMetadata",
176
146
  "deepThinkTip",
177
147
  "defaultMainButtons",
178
148
  "domIncludedTip",
179
- "emptyResultTip",
180
- "errorMessageServerNotReady",
181
149
  "screenshotIncludedTip",
182
- "serverLaunchTip",
183
150
  "trackingTip"
184
151
  ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
185
152
  Object.defineProperty(exports, '__esModule', {
@@ -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("./types.js");
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("./player.css");
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(external_utils_js_namespaceObject.mousePointer, title, subTitle));
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(external_utils_js_namespaceObject.mousePointer, title, subTitle));
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,
@@ -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 type { BaseElement, Rect, UIContext } from '../../../core';
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,5 +1,4 @@
1
1
  import type React from 'react';
2
- import './index.less';
3
2
  interface ConfigSelectorProps {
4
3
  showDeepThinkOption: boolean;
5
4
  enableTracking: boolean;
@@ -1,6 +1,5 @@
1
1
  import type { UIContext } from '@midscene/core';
2
2
  import type React from 'react';
3
- import './index.less';
4
3
  interface ContextPreviewProps {
5
4
  uiContextPreview: UIContext | undefined;
6
5
  setUiContextPreview: (context: UIContext) => void;
@@ -1,2 +1,2 @@
1
- import './github-star.less';
1
+ import './index.less';
2
2
  export declare const GithubStar: () => import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import type React from 'react';
2
- import type { HistoryItem } from '../store/history';
2
+ import type { HistoryItem } from '../../store/history';
3
3
  import './index.less';
4
4
  interface HistorySelectorProps {
5
5
  onSelect: (history: HistoryItem) => void;
@@ -0,0 +1 @@
1
+ export * from '../types';
@@ -1,4 +1,4 @@
1
- import './logo.less';
1
+ import './index.less';
2
2
  export declare const LogoUrl = "https://lf3-static.bytednsdoc.com/obj/eden-cn/vhaeh7vhabf/Midscene.png";
3
3
  export declare const Logo: ({ hideLogo }: {
4
4
  hideLogo?: boolean;
@@ -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 './player.less';
3
- import type { AnimationScript } from './replay-scripts';
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';
@@ -1,8 +1,7 @@
1
1
  import type React from 'react';
2
- import type { ReplayScriptsInfo } from '../replay-scripts';
3
- import type { PlaygroundResult as PlaygroundResultType } from './playground-types';
4
- import type { ServiceModeType } from './playground-types';
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 './playground-types';
3
- import type { ServiceModeType } from './playground-types';
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 {
@@ -1,5 +1,4 @@
1
1
  import type React from 'react';
2
- import './index.less';
3
2
  interface ServiceModeControlProps {
4
3
  serviceMode: 'Server' | 'In-Browser';
5
4
  }
@@ -1,5 +1,5 @@
1
1
  import type React from 'react';
2
- import './shiny-text.less';
2
+ import './index.less';
3
3
  type ColorTheme = 'blue' | 'purple' | 'green' | 'rainbow';
4
4
  interface ShinyTextProps {
5
5
  text: string;
@@ -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
+ };