@midscene/visualizer 0.26.2 → 0.26.3-beta-20250813075706.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/blank_polyfill.mjs +2 -0
- package/dist/es/component/blackboard.css +12 -5
- package/dist/es/component/blackboard.mjs +266 -0
- package/dist/es/component/color.mjs +35 -0
- package/dist/es/component/describer.css +9 -5
- package/dist/es/component/describer.mjs +128 -0
- package/dist/es/component/env-config.mjs +112 -0
- package/dist/es/component/github-star.css +1 -0
- package/dist/es/component/github-star.mjs +20 -0
- package/dist/es/component/logo.css +5 -3
- package/dist/es/component/logo.mjs +20 -0
- package/dist/es/component/misc.mjs +54 -0
- package/dist/es/component/pixi-loader.mjs +16 -0
- package/dist/es/component/player.css +88 -70
- package/dist/es/component/player.mjs +628 -0
- package/dist/es/component/playground/ConfigSelector.mjs +53 -0
- package/dist/es/component/playground/ContextPreview.mjs +39 -0
- package/dist/es/component/playground/HistorySelector.mjs +193 -0
- package/dist/es/component/playground/PlaygroundResult.mjs +60 -0
- package/dist/es/component/playground/PromptInput.mjs +225 -0
- package/dist/es/component/playground/ServiceModeControl.mjs +100 -0
- package/dist/es/component/playground/index.css +140 -98
- package/dist/es/component/playground/playground-constants.mjs +45 -0
- package/dist/es/component/playground/playground-utils.mjs +89 -0
- package/dist/es/component/playground/useServerValid.mjs +27 -0
- package/dist/es/component/playground/useStaticPageAgent.mjs +12 -0
- package/dist/es/component/replay-scripts.mjs +271 -0
- package/dist/es/component/shiny-text.css +33 -22
- package/dist/es/component/shiny-text.mjs +15 -0
- package/dist/es/component/store/history.mjs +55 -0
- package/dist/es/component/store/store.mjs +128 -0
- package/dist/es/icons/close.mjs +19 -0
- package/dist/es/icons/history.mjs +30 -0
- package/dist/es/icons/magnifying-glass.mjs +39 -0
- package/dist/es/icons/setting.mjs +20 -0
- package/dist/es/index.mjs +21 -0
- package/dist/es/init.mjs +10 -0
- package/dist/es/{utils.js → utils.mjs} +51 -75
- package/dist/lib/blank_polyfill.js +34 -38
- package/dist/lib/component/blackboard.css +12 -5
- package/dist/lib/component/blackboard.js +293 -306
- package/dist/lib/component/color.js +64 -74
- package/dist/lib/component/describer.css +9 -5
- package/dist/lib/component/describer.js +158 -198
- package/dist/lib/component/env-config.js +142 -147
- package/dist/lib/component/github-star.css +1 -0
- package/dist/lib/component/github-star.js +51 -62
- package/dist/lib/component/logo.css +5 -3
- package/dist/lib/component/logo.js +53 -56
- package/dist/lib/component/misc.js +85 -84
- package/dist/lib/component/pixi-loader.js +49 -80
- package/dist/lib/component/player.css +88 -70
- package/dist/lib/component/player.js +627 -738
- package/dist/lib/component/playground/ConfigSelector.js +91 -92
- package/dist/lib/component/playground/ContextPreview.js +80 -72
- package/dist/lib/component/playground/HistorySelector.js +234 -197
- package/dist/lib/component/playground/PlaygroundResult.js +100 -103
- package/dist/lib/component/playground/PromptInput.js +250 -237
- package/dist/lib/component/playground/ServiceModeControl.js +124 -124
- package/dist/lib/component/playground/index.css +140 -98
- package/dist/lib/component/playground/playground-constants.js +97 -73
- package/dist/lib/component/playground/playground-types.js +17 -31
- package/dist/lib/component/playground/playground-utils.js +140 -168
- package/dist/lib/component/playground/useServerValid.js +55 -86
- package/dist/lib/component/playground/useStaticPageAgent.js +45 -51
- package/dist/lib/component/replay-scripts.js +291 -373
- package/dist/lib/component/shiny-text.css +33 -22
- package/dist/lib/component/shiny-text.js +46 -57
- package/dist/lib/component/store/history.js +58 -64
- package/dist/lib/component/store/store.js +132 -128
- package/dist/lib/icons/close.js +53 -0
- package/dist/lib/icons/history.js +64 -0
- package/dist/lib/icons/magnifying-glass.js +73 -0
- package/dist/lib/icons/setting.js +54 -0
- package/dist/lib/index.js +158 -124
- package/dist/lib/init.js +39 -46
- package/dist/lib/utils.js +105 -109
- package/dist/types/blank_polyfill.d.ts +2 -2
- package/dist/types/component/playground/ConfigSelector.d.ts +1 -0
- package/dist/types/component/playground/ContextPreview.d.ts +1 -0
- package/dist/types/component/playground/HistorySelector.d.ts +1 -0
- package/dist/types/component/playground/PlaygroundResult.d.ts +1 -0
- package/dist/types/component/playground/PromptInput.d.ts +1 -0
- package/dist/types/component/playground/ServiceModeControl.d.ts +1 -0
- package/package.json +16 -19
- package/dist/es/assets/close.909351c0.svg +0 -4
- package/dist/es/assets/history.164a4eab.svg +0 -4
- package/dist/es/assets/magnifying-glass.9498e70e.svg +0 -12
- package/dist/es/assets/setting.80ab7285.svg +0 -11
- package/dist/es/blank_polyfill.js +0 -10
- package/dist/es/component/blackboard.js +0 -286
- package/dist/es/component/color.js +0 -49
- package/dist/es/component/describer.js +0 -173
- package/dist/es/component/env-config.js +0 -117
- package/dist/es/component/github-star.js +0 -31
- package/dist/es/component/logo.js +0 -25
- package/dist/es/component/misc.js +0 -63
- package/dist/es/component/pixi-loader.js +0 -51
- package/dist/es/component/player.js +0 -746
- package/dist/es/component/playground/ConfigSelector.js +0 -64
- package/dist/es/component/playground/ContextPreview.js +0 -42
- package/dist/es/component/playground/HistorySelector.js +0 -168
- package/dist/es/component/playground/PlaygroundResult.js +0 -73
- package/dist/es/component/playground/PromptInput.js +0 -212
- package/dist/es/component/playground/ServiceModeControl.js +0 -100
- package/dist/es/component/playground/playground-constants.js +0 -39
- package/dist/es/component/playground/playground-types.js +0 -6
- package/dist/es/component/playground/playground-utils.js +0 -141
- package/dist/es/component/playground/useServerValid.js +0 -58
- package/dist/es/component/playground/useStaticPageAgent.js +0 -20
- package/dist/es/component/replay-scripts.js +0 -361
- package/dist/es/component/shiny-text.js +0 -30
- package/dist/es/component/store/history.js +0 -34
- package/dist/es/component/store/store.js +0 -99
- package/dist/es/index.js +0 -79
- package/dist/es/init.js +0 -17
- package/dist/index.css +0 -595
- package/dist/index.js +0 -1
- package/dist/lib/assets/close.909351c0.svg +0 -4
- package/dist/lib/assets/history.164a4eab.svg +0 -4
- package/dist/lib/assets/magnifying-glass.9498e70e.svg +0 -12
- package/dist/lib/assets/setting.80ab7285.svg +0 -11
- package/dist/lib/component/common.css +0 -0
- /package/dist/es/component/{common.css → playground/playground-types.mjs} +0 -0
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import Buffer from "buffer";
|
|
2
|
-
import processBrowser from "process/browser";
|
|
3
|
-
import console from "console-browserify";
|
|
4
|
-
var buffer = {
|
|
5
|
-
Buffer
|
|
6
|
-
};
|
|
7
|
-
import * as Z from "zustand";
|
|
8
|
-
const { create } = Z;
|
|
9
|
-
const useBlackboardPreference = create((set) => ({
|
|
10
|
-
markerVisible: true,
|
|
11
|
-
elementsVisible: true,
|
|
12
|
-
setMarkerVisible: (visible) => {
|
|
13
|
-
set({ markerVisible: visible });
|
|
14
|
-
},
|
|
15
|
-
setTextsVisible: (visible) => {
|
|
16
|
-
set({ elementsVisible: visible });
|
|
17
|
-
}
|
|
18
|
-
}));
|
|
19
|
-
const CONFIG_KEY = "midscene-env-config";
|
|
20
|
-
const SERVICE_MODE_KEY = "midscene-service-mode";
|
|
21
|
-
const TRACKING_ACTIVE_TAB_KEY = "midscene-tracking-active-tab";
|
|
22
|
-
const DEEP_THINK_KEY = "midscene-deep-think";
|
|
23
|
-
const getConfigStringFromLocalStorage = () => {
|
|
24
|
-
const configString = localStorage.getItem(CONFIG_KEY);
|
|
25
|
-
return configString || "";
|
|
26
|
-
};
|
|
27
|
-
const parseConfig = (configString) => {
|
|
28
|
-
const lines = configString.split("\n");
|
|
29
|
-
const config = {};
|
|
30
|
-
lines.forEach((line) => {
|
|
31
|
-
const trimmed = line.trim();
|
|
32
|
-
if (trimmed.startsWith("#"))
|
|
33
|
-
return;
|
|
34
|
-
const cleanLine = trimmed.replace(/^export\s+/i, "").replace(/;$/, "").trim();
|
|
35
|
-
const match = cleanLine.match(/^(\w+)=(.*)$/);
|
|
36
|
-
if (match) {
|
|
37
|
-
const [, key, value] = match;
|
|
38
|
-
let parsedValue = value.trim();
|
|
39
|
-
if (parsedValue.startsWith("'") && parsedValue.endsWith("'") || parsedValue.startsWith('"') && parsedValue.endsWith('"')) {
|
|
40
|
-
parsedValue = parsedValue.slice(1, -1);
|
|
41
|
-
}
|
|
42
|
-
config[key] = parsedValue;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
return config;
|
|
46
|
-
};
|
|
47
|
-
const useEnvConfig = create((set, get) => {
|
|
48
|
-
const configString = getConfigStringFromLocalStorage();
|
|
49
|
-
const config = parseConfig(configString);
|
|
50
|
-
const ifInExtension = window.location.href.startsWith("chrome-extension");
|
|
51
|
-
const savedServiceMode = localStorage.getItem(
|
|
52
|
-
SERVICE_MODE_KEY
|
|
53
|
-
);
|
|
54
|
-
const savedForceSameTabNavigation = localStorage.getItem(TRACKING_ACTIVE_TAB_KEY) !== "false";
|
|
55
|
-
const savedDeepThink = localStorage.getItem(DEEP_THINK_KEY) === "true";
|
|
56
|
-
return {
|
|
57
|
-
serviceMode: ifInExtension ? "In-Browser-Extension" : savedServiceMode || "Server",
|
|
58
|
-
setServiceMode: (serviceMode) => {
|
|
59
|
-
if (ifInExtension)
|
|
60
|
-
throw new Error("serviceMode cannot be set in extension");
|
|
61
|
-
set({ serviceMode });
|
|
62
|
-
localStorage.setItem(SERVICE_MODE_KEY, serviceMode);
|
|
63
|
-
},
|
|
64
|
-
config,
|
|
65
|
-
configString,
|
|
66
|
-
setConfig: (config2) => set({ config: config2 }),
|
|
67
|
-
loadConfig: (configString2) => {
|
|
68
|
-
const config2 = parseConfig(configString2);
|
|
69
|
-
set({ config: config2, configString: configString2 });
|
|
70
|
-
localStorage.setItem(CONFIG_KEY, configString2);
|
|
71
|
-
},
|
|
72
|
-
syncFromStorage: () => {
|
|
73
|
-
const latestConfigString = getConfigStringFromLocalStorage();
|
|
74
|
-
const latestConfig = parseConfig(latestConfigString);
|
|
75
|
-
set({ config: latestConfig, configString: latestConfigString });
|
|
76
|
-
},
|
|
77
|
-
forceSameTabNavigation: savedForceSameTabNavigation,
|
|
78
|
-
setForceSameTabNavigation: (forceSameTabNavigation) => {
|
|
79
|
-
set({ forceSameTabNavigation });
|
|
80
|
-
localStorage.setItem(
|
|
81
|
-
TRACKING_ACTIVE_TAB_KEY,
|
|
82
|
-
forceSameTabNavigation.toString()
|
|
83
|
-
);
|
|
84
|
-
},
|
|
85
|
-
deepThink: savedDeepThink,
|
|
86
|
-
setDeepThink: (deepThink) => {
|
|
87
|
-
set({ deepThink });
|
|
88
|
-
localStorage.setItem(DEEP_THINK_KEY, deepThink.toString());
|
|
89
|
-
},
|
|
90
|
-
popupTab: "playground",
|
|
91
|
-
setPopupTab: (tab) => {
|
|
92
|
-
set({ popupTab: tab });
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
});
|
|
96
|
-
export {
|
|
97
|
-
useBlackboardPreference,
|
|
98
|
-
useEnvConfig
|
|
99
|
-
};
|
package/dist/es/index.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import Buffer from "buffer";
|
|
2
|
-
import processBrowser from "process/browser";
|
|
3
|
-
import console from "console-browserify";
|
|
4
|
-
var buffer = {
|
|
5
|
-
Buffer
|
|
6
|
-
};
|
|
7
|
-
import { useStaticPageAgent } from "./component/playground/useStaticPageAgent";
|
|
8
|
-
import "./component/playground/index.css";
|
|
9
|
-
import {
|
|
10
|
-
allScriptsFromDump,
|
|
11
|
-
generateAnimationScripts
|
|
12
|
-
} from "./component/replay-scripts";
|
|
13
|
-
import { useEnvConfig } from "./component/store/store";
|
|
14
|
-
import {
|
|
15
|
-
colorForName,
|
|
16
|
-
highlightColorForType,
|
|
17
|
-
globalThemeConfig
|
|
18
|
-
} from "./component/color";
|
|
19
|
-
import { EnvConfig } from "./component/env-config";
|
|
20
|
-
import { Logo } from "./component/logo";
|
|
21
|
-
import { iconForStatus, timeCostStrElement } from "./component/misc";
|
|
22
|
-
import { useServerValid } from "./component/playground/useServerValid";
|
|
23
|
-
import { PlaygroundResultView } from "./component/playground/PlaygroundResult";
|
|
24
|
-
import { ServiceModeControl } from "./component/playground/ServiceModeControl";
|
|
25
|
-
import { ContextPreview } from "./component/playground/ContextPreview";
|
|
26
|
-
import { PromptInput } from "./component/playground/PromptInput";
|
|
27
|
-
import { Player } from "./component/player";
|
|
28
|
-
import { Blackboard } from "./component/blackboard";
|
|
29
|
-
import { GithubStar } from "./component/github-star";
|
|
30
|
-
import { Describer } from "./component/describer";
|
|
31
|
-
import {
|
|
32
|
-
requestPlaygroundServer,
|
|
33
|
-
cancelTask,
|
|
34
|
-
overrideServerConfig,
|
|
35
|
-
getTaskProgress,
|
|
36
|
-
checkServerStatus,
|
|
37
|
-
actionNameForType,
|
|
38
|
-
staticAgentFromContext,
|
|
39
|
-
formatErrorMessage,
|
|
40
|
-
getPlaceholderForType,
|
|
41
|
-
blankResult
|
|
42
|
-
} from "./component/playground/playground-utils";
|
|
43
|
-
import { timeStr, filterBase64Value } from "./utils";
|
|
44
|
-
import { default as default2 } from "./component/shiny-text";
|
|
45
|
-
export {
|
|
46
|
-
Blackboard,
|
|
47
|
-
ContextPreview,
|
|
48
|
-
Describer,
|
|
49
|
-
EnvConfig,
|
|
50
|
-
GithubStar,
|
|
51
|
-
Logo,
|
|
52
|
-
Player,
|
|
53
|
-
PlaygroundResultView,
|
|
54
|
-
PromptInput,
|
|
55
|
-
ServiceModeControl,
|
|
56
|
-
default2 as ShinyText,
|
|
57
|
-
actionNameForType,
|
|
58
|
-
allScriptsFromDump,
|
|
59
|
-
blankResult,
|
|
60
|
-
cancelTask,
|
|
61
|
-
checkServerStatus,
|
|
62
|
-
colorForName,
|
|
63
|
-
filterBase64Value,
|
|
64
|
-
formatErrorMessage,
|
|
65
|
-
generateAnimationScripts,
|
|
66
|
-
getPlaceholderForType,
|
|
67
|
-
getTaskProgress,
|
|
68
|
-
globalThemeConfig,
|
|
69
|
-
highlightColorForType,
|
|
70
|
-
iconForStatus,
|
|
71
|
-
overrideServerConfig,
|
|
72
|
-
requestPlaygroundServer,
|
|
73
|
-
staticAgentFromContext,
|
|
74
|
-
timeCostStrElement,
|
|
75
|
-
timeStr,
|
|
76
|
-
useEnvConfig,
|
|
77
|
-
useServerValid,
|
|
78
|
-
useStaticPageAgent
|
|
79
|
-
};
|
package/dist/es/init.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import Buffer from "buffer";
|
|
2
|
-
import processBrowser from "process/browser";
|
|
3
|
-
import console from "console-browserify";
|
|
4
|
-
var buffer = {
|
|
5
|
-
Buffer
|
|
6
|
-
};
|
|
7
|
-
import { Buffer as Buffer2 } from "buffer";
|
|
8
|
-
window.global || (window.global = window);
|
|
9
|
-
window.Buffer = Buffer2;
|
|
10
|
-
let sideEffect = 0;
|
|
11
|
-
const setSideEffect = () => {
|
|
12
|
-
sideEffect++;
|
|
13
|
-
return sideEffect;
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
setSideEffect
|
|
17
|
-
};
|