dsh-browser-cdp 0.17.3 → 0.17.4
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/lib/client.js +567 -30
- package/package.json +99 -99
package/lib/client.js
CHANGED
|
@@ -691,6 +691,331 @@ function mountFamilySettingsCard(ctx) {
|
|
|
691
691
|
}, FamilySettingsCard);
|
|
692
692
|
}, "dsh-browser-cdp: family settings tab");
|
|
693
693
|
}
|
|
694
|
+
var FAM_FIELD_GROUPS = [
|
|
695
|
+
{
|
|
696
|
+
gk: "gBasic",
|
|
697
|
+
en: "Basics",
|
|
698
|
+
zh: "基础",
|
|
699
|
+
fields: [
|
|
700
|
+
{
|
|
701
|
+
k: "isolateSpaces",
|
|
702
|
+
kind: "bool",
|
|
703
|
+
en: ["Space isolation", "Off = persistent profile (logins survive restarts); on = isolated sandbox"],
|
|
704
|
+
zh: ["空间隔离", "关 = 持久化配置(重启保留登录态);开 = 每次隔离沙箱"]
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
k: "idleTimeoutMin",
|
|
708
|
+
kind: "num",
|
|
709
|
+
min: 0,
|
|
710
|
+
max: 1440,
|
|
711
|
+
step: 1,
|
|
712
|
+
en: ["Auto-stop idle browser (minutes, 0 = off)", "Stops the backing browser after N minutes without a bcdp_* call; relaunches on demand"],
|
|
713
|
+
zh: ["空闲自动停止(分钟,0 = 不停)", "超过 N 分钟没有 bcdp_* 调用即停止后台浏览器,下次调用按需重启"]
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
k: "cdpMode",
|
|
717
|
+
kind: "sel",
|
|
718
|
+
options: [
|
|
719
|
+
"auto",
|
|
720
|
+
"local",
|
|
721
|
+
"remote"
|
|
722
|
+
],
|
|
723
|
+
en: ["Connection mode", "auto = activated target only; remote = never start a local browser; local = always local control"],
|
|
724
|
+
zh: ["连接模式", "auto = 只用已激活目标;remote = 绝不静默启动本地浏览器;local = 始终本地控制"]
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
k: "remoteEnabled",
|
|
728
|
+
kind: "bool",
|
|
729
|
+
en: ["Remote attach master switch", "Off = the target sequence is preserved but inert; does not affect local mode"],
|
|
730
|
+
zh: ["远程接管总开关", "关 = 目标序列保留但不生效;不影响 local 模式"]
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
k: "allowLocalFallback",
|
|
734
|
+
kind: "bool",
|
|
735
|
+
en: ["Allow local fallback in auto mode", "auto may launch a local browser when the activated target is unreachable"],
|
|
736
|
+
zh: ["auto 模式允许本地回退", "已激活目标不可达时允许自动拉起本地浏览器"]
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
k: "chromePath",
|
|
740
|
+
kind: "str",
|
|
741
|
+
en: ["Chrome/Chromium path", "Empty = auto-detect"],
|
|
742
|
+
zh: ["Chrome/Chromium 路径", "留空 = 自动探测"]
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
k: "localHeadless",
|
|
746
|
+
kind: "bool",
|
|
747
|
+
en: ["Launch local browser headless", "Applies to the locally launched browser"],
|
|
748
|
+
zh: ["本地浏览器无头启动", "仅作用于本地拉起的浏览器"]
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
k: "localUserDataDir",
|
|
752
|
+
kind: "str",
|
|
753
|
+
en: ["Local profile dir", "Empty = managed dir; never point at your daily Chrome profile"],
|
|
754
|
+
zh: ["本地浏览器 Profile 目录", "留空 = 托管目录;不要指向日常使用的 Chrome 配置"]
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
k: "legacyEgoToolNames",
|
|
758
|
+
kind: "bool",
|
|
759
|
+
en: ["Also register legacy ego_* tool names", "For scripts written before the bcdp_* rename; conflicts with the upstream ego-browser plugin"],
|
|
760
|
+
zh: ["同时注册旧版 ego_* 工具名", "给 bcdp_* 更名前的脚本用;与上游 ego-browser 插件互斥"]
|
|
761
|
+
}
|
|
762
|
+
]
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
gk: "gCapture",
|
|
766
|
+
en: "Capture & streaming",
|
|
767
|
+
zh: "截图与推流",
|
|
768
|
+
fields: [
|
|
769
|
+
{
|
|
770
|
+
k: "captureBackend",
|
|
771
|
+
kind: "sel",
|
|
772
|
+
options: [
|
|
773
|
+
"auto",
|
|
774
|
+
"cdp",
|
|
775
|
+
"ffmpeg"
|
|
776
|
+
],
|
|
777
|
+
en: ["Capture backend", "auto, cdp, or ffmpeg"],
|
|
778
|
+
zh: ["截取后端", "auto / cdp / ffmpeg"]
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
k: "streamProfile",
|
|
782
|
+
kind: "sel",
|
|
783
|
+
options: [
|
|
784
|
+
"low",
|
|
785
|
+
"balanced",
|
|
786
|
+
"high"
|
|
787
|
+
],
|
|
788
|
+
en: ["Capture quality profile", "Overall quality preset"],
|
|
789
|
+
zh: ["画质档位", "整体画质预设"]
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
k: "cdpFps",
|
|
793
|
+
kind: "num",
|
|
794
|
+
min: 5,
|
|
795
|
+
max: 30,
|
|
796
|
+
step: 1,
|
|
797
|
+
en: ["CDP preview FPS", ""],
|
|
798
|
+
zh: ["CDP 预览帧率", ""]
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
k: "cdpQuality",
|
|
802
|
+
kind: "num",
|
|
803
|
+
min: 1,
|
|
804
|
+
max: 100,
|
|
805
|
+
step: 1,
|
|
806
|
+
en: ["CDP JPEG quality", ""],
|
|
807
|
+
zh: ["CDP JPEG 质量", ""]
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
k: "cdpMaxWidth",
|
|
811
|
+
kind: "num",
|
|
812
|
+
min: 320,
|
|
813
|
+
max: 1920,
|
|
814
|
+
step: 40,
|
|
815
|
+
en: ["CDP frame max width", ""],
|
|
816
|
+
zh: ["CDP 帧最大宽度", ""]
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
k: "cdpBackstopIntervalMs",
|
|
820
|
+
kind: "num",
|
|
821
|
+
min: 1e3,
|
|
822
|
+
max: 1e4,
|
|
823
|
+
step: 100,
|
|
824
|
+
en: ["CDP recovery interval (ms)", ""],
|
|
825
|
+
zh: ["CDP 恢复截图间隔(ms)", ""]
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
k: "ffmpegFps",
|
|
829
|
+
kind: "num",
|
|
830
|
+
min: 5,
|
|
831
|
+
max: 30,
|
|
832
|
+
step: 1,
|
|
833
|
+
en: ["FFmpeg video FPS", ""],
|
|
834
|
+
zh: ["FFmpeg 视频帧率", ""]
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
k: "ffmpegMaxWidth",
|
|
838
|
+
kind: "num",
|
|
839
|
+
min: 320,
|
|
840
|
+
max: 1920,
|
|
841
|
+
step: 40,
|
|
842
|
+
en: ["FFmpeg max width", ""],
|
|
843
|
+
zh: ["FFmpeg 最大宽度", ""]
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
k: "ffmpegBitrateKbps",
|
|
847
|
+
kind: "num",
|
|
848
|
+
min: 500,
|
|
849
|
+
max: 2e4,
|
|
850
|
+
step: 250,
|
|
851
|
+
en: ["FFmpeg bitrate (kbps)", ""],
|
|
852
|
+
zh: ["FFmpeg 码率(kbps)", ""]
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
k: "ffmpegEncoder",
|
|
856
|
+
kind: "sel",
|
|
857
|
+
options: [
|
|
858
|
+
"auto",
|
|
859
|
+
"software",
|
|
860
|
+
"h264_mf",
|
|
861
|
+
"h264_nvenc",
|
|
862
|
+
"h264_qsv",
|
|
863
|
+
"h264_amf",
|
|
864
|
+
"h264_videotoolbox",
|
|
865
|
+
"h264_vaapi"
|
|
866
|
+
],
|
|
867
|
+
en: ["FFmpeg H.264 encoder", ""],
|
|
868
|
+
zh: ["FFmpeg H.264 编码器", ""]
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
k: "ffmpegPath",
|
|
872
|
+
kind: "str",
|
|
873
|
+
en: ["FFmpeg path", "Empty = detect PATH or managed install"],
|
|
874
|
+
zh: ["FFmpeg 路径", "留空 = 探测 PATH 或托管安装"]
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
k: "cursorHud",
|
|
878
|
+
kind: "bool",
|
|
879
|
+
en: ["Draw cursor HUD into screenshots", ""],
|
|
880
|
+
zh: ["截图绘制光标 HUD", ""]
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
k: "cursorName",
|
|
884
|
+
kind: "str",
|
|
885
|
+
en: ["Cursor HUD label", ""],
|
|
886
|
+
zh: ["光标 HUD 名称", ""]
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
k: "githubMirror",
|
|
890
|
+
kind: "str",
|
|
891
|
+
en: ["GitHub download mirror", "HTTPS base replacing https://github.com for managed downloads"],
|
|
892
|
+
zh: ["GitHub 下载镜像", "托管下载时替换 https://github.com 的 HTTPS 前缀"]
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
k: "runtimeArgs",
|
|
896
|
+
kind: "str",
|
|
897
|
+
en: ["Extra runtime args", "Appended to the vendored runtime argv; next bcdp_* call"],
|
|
898
|
+
zh: ["运行时附加参数", "追加到托管运行时 argv;下次 bcdp_* 调用生效"]
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
k: "chromeArgs",
|
|
902
|
+
kind: "str",
|
|
903
|
+
en: ["Extra Chrome args", "Appended to the Chrome launch argv; next cold start"],
|
|
904
|
+
zh: ["Chrome 附加启动参数", "追加到 Chrome 启动 argv;下次冷启动生效"]
|
|
905
|
+
}
|
|
906
|
+
]
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
gk: "gJudge",
|
|
910
|
+
en: "Judgement (JEV / Laya)",
|
|
911
|
+
zh: "评审(JEV / Laya)",
|
|
912
|
+
fields: [
|
|
913
|
+
{
|
|
914
|
+
k: "judgePrefer",
|
|
915
|
+
kind: "str",
|
|
916
|
+
en: ["Judge hop order", "Comma separated; defaults to \"laya,rule\""],
|
|
917
|
+
zh: ["评审跳序", "逗号分隔;默认 \"laya,rule\""]
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
k: "jevUrl",
|
|
921
|
+
kind: "str",
|
|
922
|
+
en: ["JEV base URL", "Leave empty to skip the jev hop"],
|
|
923
|
+
zh: ["JEV 基础 URL", "留空 = 跳过 jev 跳"]
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
k: "jevKey",
|
|
927
|
+
kind: "secret",
|
|
928
|
+
en: ["JEV bearer key", "Empty = the jev hop is skipped"],
|
|
929
|
+
zh: ["JEV Bearer Key", "留空 = 跳过 jev 跳"]
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
k: "jevModel",
|
|
933
|
+
kind: "str",
|
|
934
|
+
en: ["JEV model", ""],
|
|
935
|
+
zh: ["JEV 模型名", ""]
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
k: "jevChunkSize",
|
|
939
|
+
kind: "num",
|
|
940
|
+
min: 1,
|
|
941
|
+
max: 255,
|
|
942
|
+
step: 1,
|
|
943
|
+
en: ["JEV candidates per round", ""],
|
|
944
|
+
zh: ["JEV 每轮候选上限", ""]
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
k: "jevMaxImageBytes",
|
|
948
|
+
kind: "num",
|
|
949
|
+
min: 0,
|
|
950
|
+
step: 1024,
|
|
951
|
+
en: ["JEV frame byte budget (0 = unbounded)", ""],
|
|
952
|
+
zh: ["JEV 单帧字节预算(0 = 不限)", ""]
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
k: "jevHistoryLimit",
|
|
956
|
+
kind: "num",
|
|
957
|
+
min: 0,
|
|
958
|
+
max: 20,
|
|
959
|
+
step: 1,
|
|
960
|
+
en: ["JEV recent-step window", ""],
|
|
961
|
+
zh: ["JEV 近期步数窗口", ""]
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
k: "jevArchiveImage",
|
|
965
|
+
kind: "bool",
|
|
966
|
+
en: ["Embed screenshot in archived bundle", ""],
|
|
967
|
+
zh: ["归档包内嵌截图", ""]
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
k: "jevEvaluate",
|
|
971
|
+
kind: "bool",
|
|
972
|
+
en: ["Evaluate every action with the judge", "Costs one judgement call per action"],
|
|
973
|
+
zh: ["每步动作都过评审", "每步多花一次评审调用"]
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
k: "jevStepBudget",
|
|
977
|
+
kind: "num",
|
|
978
|
+
min: 1,
|
|
979
|
+
max: 200,
|
|
980
|
+
step: 1,
|
|
981
|
+
en: ["Rounds per bcdp_jev_run", ""],
|
|
982
|
+
zh: ["单次 bcdp_jev_run 轮数上限", ""]
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
k: "jevWallMs",
|
|
986
|
+
kind: "num",
|
|
987
|
+
min: 1e3,
|
|
988
|
+
max: 36e5,
|
|
989
|
+
step: 1e3,
|
|
990
|
+
en: ["Wall-clock ceiling per run (ms)", ""],
|
|
991
|
+
zh: ["单次运行墙钟上限(ms)", ""]
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
k: "layaUrl",
|
|
995
|
+
kind: "str",
|
|
996
|
+
en: ["Laya base URL", "The sidecar serves 8000"],
|
|
997
|
+
zh: ["Laya 基础 URL", "sidecar 服务 8000 端口"]
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
k: "layaKey",
|
|
1001
|
+
kind: "secret",
|
|
1002
|
+
en: ["Laya key (required)", "Keyless calls are a guaranteed 401"],
|
|
1003
|
+
zh: ["Laya Key(必填)", "无 Key 必然 401"]
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
k: "layaModel",
|
|
1007
|
+
kind: "str",
|
|
1008
|
+
en: ["Laya model", ""],
|
|
1009
|
+
zh: ["Laya 模型名", ""]
|
|
1010
|
+
}
|
|
1011
|
+
]
|
|
1012
|
+
}
|
|
1013
|
+
];
|
|
1014
|
+
function famText(item, kind) {
|
|
1015
|
+
var pair = _egoLocale === "zh" ? item.zh : item.en;
|
|
1016
|
+
if (kind === "title") return pair[0];
|
|
1017
|
+
return pair[1] || "";
|
|
1018
|
+
}
|
|
694
1019
|
function FamilySettingsCard(props) {
|
|
695
1020
|
var scope = props.scope;
|
|
696
1021
|
var snapshot = React.useSyncExternalStore(function(listener) {
|
|
@@ -701,57 +1026,269 @@ function FamilySettingsCard(props) {
|
|
|
701
1026
|
var value = snapshot.value || {};
|
|
702
1027
|
var writable = snapshot.writable === true;
|
|
703
1028
|
var h = React.createElement;
|
|
1029
|
+
return h("div", { style: {
|
|
1030
|
+
display: "grid",
|
|
1031
|
+
gap: "8px"
|
|
1032
|
+
} }, FAM_FIELD_GROUPS.map(function(group) {
|
|
1033
|
+
return h(FamGroup, {
|
|
1034
|
+
key: group.gk,
|
|
1035
|
+
group,
|
|
1036
|
+
value,
|
|
1037
|
+
writable,
|
|
1038
|
+
scope
|
|
1039
|
+
});
|
|
1040
|
+
}), h(FamLinks, {
|
|
1041
|
+
key: "links",
|
|
1042
|
+
value,
|
|
1043
|
+
writable,
|
|
1044
|
+
scope
|
|
1045
|
+
}));
|
|
1046
|
+
}
|
|
1047
|
+
function FamGroup(props) {
|
|
1048
|
+
var group = props.group;
|
|
1049
|
+
var h = React.createElement;
|
|
1050
|
+
return h("div", { style: {
|
|
1051
|
+
borderTop: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.25))",
|
|
1052
|
+
paddingTop: "6px"
|
|
1053
|
+
} }, h("div", { style: {
|
|
1054
|
+
fontSize: "12px",
|
|
1055
|
+
fontWeight: 600,
|
|
1056
|
+
color: "var(--dsw-alias-label-secondary, rgba(127,127,127,.9))",
|
|
1057
|
+
padding: "2px 0 4px"
|
|
1058
|
+
} }, _egoLocale === "zh" ? group.zh : group.en), group.fields.map(function(f) {
|
|
1059
|
+
return h(FamField, {
|
|
1060
|
+
key: f.k,
|
|
1061
|
+
f,
|
|
1062
|
+
group,
|
|
1063
|
+
...props
|
|
1064
|
+
});
|
|
1065
|
+
}));
|
|
1066
|
+
}
|
|
1067
|
+
function FamField(props) {
|
|
1068
|
+
var f = props.f;
|
|
1069
|
+
var value = props.value;
|
|
1070
|
+
var writable = props.writable;
|
|
1071
|
+
var scope = props.scope;
|
|
1072
|
+
var h = React.createElement;
|
|
704
1073
|
var rowStyle = {
|
|
705
1074
|
display: "flex",
|
|
706
1075
|
alignItems: "center",
|
|
707
1076
|
justifyContent: "space-between",
|
|
708
1077
|
gap: "12px",
|
|
709
|
-
padding: "
|
|
1078
|
+
padding: "6px 0"
|
|
710
1079
|
};
|
|
711
|
-
var
|
|
1080
|
+
var label = h("div", { style: {
|
|
712
1081
|
display: "flex",
|
|
713
1082
|
flexDirection: "column",
|
|
714
|
-
gap: "2px"
|
|
715
|
-
|
|
716
|
-
|
|
1083
|
+
gap: "2px",
|
|
1084
|
+
minWidth: 0
|
|
1085
|
+
} }, h("span", { style: {
|
|
717
1086
|
fontSize: "13px",
|
|
718
1087
|
color: "var(--dsw-alias-label-primary, inherit)"
|
|
719
|
-
}
|
|
720
|
-
var descStyle = {
|
|
1088
|
+
} }, famText(f, "title")), f.desc === false || !famText(f, "desc") ? null : h("span", { style: {
|
|
721
1089
|
fontSize: "12px",
|
|
722
1090
|
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.8))",
|
|
723
1091
|
lineHeight: 1.5
|
|
724
|
-
};
|
|
725
|
-
|
|
726
|
-
var idle = idleDraft[0], setIdle = idleDraft[1];
|
|
727
|
-
React.useEffect(function() {
|
|
728
|
-
setIdle(typeof value.idleTimeoutMin === "number" ? value.idleTimeoutMin : 0);
|
|
729
|
-
}, [value.idleTimeoutMin]);
|
|
730
|
-
return h("div", { style: {
|
|
731
|
-
display: "grid",
|
|
732
|
-
gap: "4px"
|
|
733
|
-
} }, h("div", { style: rowStyle }, h("div", { style: textCol }, h("span", { style: titleStyle }, wt("famIsolate")), h("span", { style: descStyle }, wt("famIsolateDesc"))), h("input", {
|
|
1092
|
+
} }, famText(f, "desc")));
|
|
1093
|
+
if (f.kind === "bool") return h("div", { style: rowStyle }, label, h("input", {
|
|
734
1094
|
type: "checkbox",
|
|
735
|
-
checked: value.
|
|
1095
|
+
checked: value[f.k] === true,
|
|
736
1096
|
disabled: !writable,
|
|
737
1097
|
onChange: function(e) {
|
|
738
|
-
scope.set(
|
|
1098
|
+
scope.set(f.k, e.target.checked);
|
|
739
1099
|
}
|
|
740
|
-
}))
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
1100
|
+
}));
|
|
1101
|
+
if (f.kind === "num") return h("div", { style: rowStyle }, label, h(FamNumInput, {
|
|
1102
|
+
f,
|
|
1103
|
+
v: value[f.k],
|
|
1104
|
+
writable,
|
|
1105
|
+
scope
|
|
1106
|
+
}));
|
|
1107
|
+
if (f.kind === "sel") return h("div", { style: rowStyle }, label, h("select", {
|
|
1108
|
+
value: String(value[f.k] ?? f.options[0]),
|
|
745
1109
|
disabled: !writable,
|
|
746
|
-
style: {
|
|
747
|
-
|
|
748
|
-
|
|
1110
|
+
style: {
|
|
1111
|
+
font: "inherit",
|
|
1112
|
+
color: "inherit",
|
|
1113
|
+
background: "var(--dsw-alias-bg-module-platform, rgba(127,127,127,.08))",
|
|
1114
|
+
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35))",
|
|
1115
|
+
borderRadius: "8px",
|
|
1116
|
+
padding: "4px 8px"
|
|
749
1117
|
},
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
scope.set("idleTimeoutMin", n);
|
|
1118
|
+
onChange: function(e) {
|
|
1119
|
+
scope.set(f.k, e.target.value);
|
|
753
1120
|
}
|
|
1121
|
+
}, f.options.map(function(o) {
|
|
1122
|
+
return h("option", {
|
|
1123
|
+
key: o,
|
|
1124
|
+
value: o
|
|
1125
|
+
}, o);
|
|
754
1126
|
})));
|
|
1127
|
+
return h("div", { style: {
|
|
1128
|
+
display: "grid",
|
|
1129
|
+
gap: "2px",
|
|
1130
|
+
padding: "6px 0"
|
|
1131
|
+
} }, label, h(FamStrInput, {
|
|
1132
|
+
f,
|
|
1133
|
+
v: value[f.k],
|
|
1134
|
+
writable,
|
|
1135
|
+
scope
|
|
1136
|
+
}));
|
|
1137
|
+
}
|
|
1138
|
+
function FamNumInput(props) {
|
|
1139
|
+
var f = props.f;
|
|
1140
|
+
var h = React.createElement;
|
|
1141
|
+
var draft = React.useState(props.v === void 0 || props.v === null ? "" : String(props.v));
|
|
1142
|
+
var v = draft[0], setV = draft[1];
|
|
1143
|
+
React.useEffect(function() {
|
|
1144
|
+
setV(props.v === void 0 || props.v === null ? "" : String(props.v));
|
|
1145
|
+
}, [props.v]);
|
|
1146
|
+
return h("input", {
|
|
1147
|
+
type: "number",
|
|
1148
|
+
min: f.min,
|
|
1149
|
+
max: f.max,
|
|
1150
|
+
step: f.step,
|
|
1151
|
+
value: v,
|
|
1152
|
+
disabled: !props.writable,
|
|
1153
|
+
style: {
|
|
1154
|
+
width: "96px",
|
|
1155
|
+
font: "inherit",
|
|
1156
|
+
color: "inherit",
|
|
1157
|
+
background: "var(--dsw-alias-bg-module-platform, rgba(127,127,127,.08))",
|
|
1158
|
+
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35))",
|
|
1159
|
+
borderRadius: "8px",
|
|
1160
|
+
padding: "4px 8px"
|
|
1161
|
+
},
|
|
1162
|
+
onChange: function(e) {
|
|
1163
|
+
setV(e.target.value);
|
|
1164
|
+
},
|
|
1165
|
+
onBlur: function() {
|
|
1166
|
+
if (v === "") return;
|
|
1167
|
+
var n = Number(v);
|
|
1168
|
+
if (!isFinite(n)) return;
|
|
1169
|
+
n = Math.round(n / (f.step || 1)) * (f.step || 1);
|
|
1170
|
+
if (f.min !== void 0) n = Math.max(f.min, n);
|
|
1171
|
+
if (f.max !== void 0) n = Math.min(f.max, n);
|
|
1172
|
+
props.scope.set(f.k, n);
|
|
1173
|
+
}
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
function FamStrInput(props) {
|
|
1177
|
+
var f = props.f;
|
|
1178
|
+
var h = React.createElement;
|
|
1179
|
+
var draft = React.useState(props.v === void 0 || props.v === null ? "" : String(props.v));
|
|
1180
|
+
var v = draft[0], setV = draft[1];
|
|
1181
|
+
React.useEffect(function() {
|
|
1182
|
+
setV(props.v === void 0 || props.v === null ? "" : String(props.v));
|
|
1183
|
+
}, [props.v]);
|
|
1184
|
+
return h("input", {
|
|
1185
|
+
type: f.kind === "secret" ? "password" : "text",
|
|
1186
|
+
value: v,
|
|
1187
|
+
disabled: !props.writable,
|
|
1188
|
+
style: {
|
|
1189
|
+
width: "100%",
|
|
1190
|
+
font: "inherit",
|
|
1191
|
+
color: "inherit",
|
|
1192
|
+
background: "var(--dsw-alias-bg-module-platform, rgba(127,127,127,.08))",
|
|
1193
|
+
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35))",
|
|
1194
|
+
borderRadius: "8px",
|
|
1195
|
+
padding: "5px 10px",
|
|
1196
|
+
boxSizing: "border-box"
|
|
1197
|
+
},
|
|
1198
|
+
onChange: function(e) {
|
|
1199
|
+
setV(e.target.value);
|
|
1200
|
+
},
|
|
1201
|
+
onBlur: function() {
|
|
1202
|
+
props.scope.set(f.k, v);
|
|
1203
|
+
},
|
|
1204
|
+
onKeyDown: function(e) {
|
|
1205
|
+
if (e.key === "Enter") props.scope.set(f.k, v);
|
|
1206
|
+
}
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
function FamLinks(props) {
|
|
1210
|
+
var value = props.value;
|
|
1211
|
+
var writable = props.writable;
|
|
1212
|
+
var scope = props.scope;
|
|
1213
|
+
var h = React.createElement;
|
|
1214
|
+
var links = Array.isArray(value.links) ? value.links : [];
|
|
1215
|
+
var activeId = typeof value.activeTargetId === "string" ? value.activeTargetId : "";
|
|
1216
|
+
function setEnabled(idx, on) {
|
|
1217
|
+
var next = links.map(function(row, i) {
|
|
1218
|
+
return i === idx ? {
|
|
1219
|
+
...row,
|
|
1220
|
+
enabled: on
|
|
1221
|
+
} : row;
|
|
1222
|
+
});
|
|
1223
|
+
scope.set("links", next);
|
|
1224
|
+
}
|
|
1225
|
+
return h("div", { style: {
|
|
1226
|
+
borderTop: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.25))",
|
|
1227
|
+
paddingTop: "6px"
|
|
1228
|
+
} }, h("div", { style: {
|
|
1229
|
+
fontSize: "12px",
|
|
1230
|
+
fontWeight: 600,
|
|
1231
|
+
color: "var(--dsw-alias-label-secondary, rgba(127,127,127,.9))",
|
|
1232
|
+
padding: "2px 0 4px"
|
|
1233
|
+
} }, _egoLocale === "zh" ? "连接目标(顺序即优先级)" : "Connection targets (order = priority)"), links.length === 0 ? h("div", { style: {
|
|
1234
|
+
fontSize: "12px",
|
|
1235
|
+
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.8))",
|
|
1236
|
+
padding: "4px 0"
|
|
1237
|
+
} }, _egoLocale === "zh" ? "暂无目标 —— 连接序列在 profile 的 cordis.patch.yml links 中维护" : "No targets — maintain the sequence in the profile cordis.patch.yml links") : links.map(function(row, idx) {
|
|
1238
|
+
var label = row.label || row.id || "#" + idx;
|
|
1239
|
+
var detail = row.kind === "ego-cli" ? row.cliPath || "" : row.endpoint || "";
|
|
1240
|
+
var isActive = row.id !== void 0 && row.id === activeId;
|
|
1241
|
+
return h("div", {
|
|
1242
|
+
key: row.id || idx,
|
|
1243
|
+
style: {
|
|
1244
|
+
display: "flex",
|
|
1245
|
+
alignItems: "center",
|
|
1246
|
+
gap: "8px",
|
|
1247
|
+
padding: "5px 0",
|
|
1248
|
+
flexWrap: "wrap"
|
|
1249
|
+
}
|
|
1250
|
+
}, h("input", {
|
|
1251
|
+
type: "checkbox",
|
|
1252
|
+
checked: row.enabled === true,
|
|
1253
|
+
disabled: !writable,
|
|
1254
|
+
title: _egoLocale === "zh" ? "启用" : "Enabled",
|
|
1255
|
+
onChange: function(e) {
|
|
1256
|
+
setEnabled(idx, e.target.checked);
|
|
1257
|
+
}
|
|
1258
|
+
}), h("span", { style: {
|
|
1259
|
+
fontSize: "13px",
|
|
1260
|
+
color: "var(--dsw-alias-label-primary, inherit)"
|
|
1261
|
+
} }, label), h("span", { style: {
|
|
1262
|
+
fontSize: "11px",
|
|
1263
|
+
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.7))",
|
|
1264
|
+
minWidth: 0,
|
|
1265
|
+
overflow: "hidden",
|
|
1266
|
+
textOverflow: "ellipsis",
|
|
1267
|
+
whiteSpace: "nowrap",
|
|
1268
|
+
flex: "1 1 120px"
|
|
1269
|
+
} }, detail), isActive ? h("span", { style: {
|
|
1270
|
+
fontSize: "11px",
|
|
1271
|
+
color: "#30d158",
|
|
1272
|
+
flex: "0 0 auto"
|
|
1273
|
+
} }, _egoLocale === "zh" ? "已激活" : "active") : h("button", {
|
|
1274
|
+
type: "button",
|
|
1275
|
+
disabled: !writable,
|
|
1276
|
+
style: {
|
|
1277
|
+
font: "inherit",
|
|
1278
|
+
fontSize: "12px",
|
|
1279
|
+
cursor: writable ? "pointer" : "not-allowed",
|
|
1280
|
+
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35))",
|
|
1281
|
+
background: "none",
|
|
1282
|
+
color: "var(--dsw-alias-label-primary, inherit)",
|
|
1283
|
+
borderRadius: "8px",
|
|
1284
|
+
padding: "2px 10px",
|
|
1285
|
+
flex: "0 0 auto"
|
|
1286
|
+
},
|
|
1287
|
+
onClick: function() {
|
|
1288
|
+
scope.set("activeTargetId", row.id);
|
|
1289
|
+
}
|
|
1290
|
+
}, _egoLocale === "zh" ? "激活" : "activate"));
|
|
1291
|
+
}));
|
|
755
1292
|
}
|
|
756
1293
|
function apply(ctx) {
|
|
757
1294
|
mountFamilySettingsCard(ctx);
|
package/package.json
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-browser-cdp",
|
|
3
|
-
"version": "0.17.
|
|
4
|
-
"description": "dsh-browser-cdp: DSH browser plugin — attach to a running Chrome/Edge over CDP (no bundled browser needed); structured browser-automation tools (30+ bcdp_*) that drive the vendored ego runtime through ctx.subprocess, plus a realtime watch panel (live SSE screencast + direct mouse interaction + download capture + human-verification notice). Web shell: floating watch panel without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.1.7+ line: declarative settings via Config .volatile() fields; for DSH 0.1.2-rc.1 ~ 0.1.6 use the 0.16.x line]",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./lib/index.js",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": "./lib/index.js",
|
|
9
|
-
"./client": "./lib/client.js",
|
|
10
|
-
"./dsh-plugin.json": "./dsh-plugin.json",
|
|
11
|
-
"./package.json": "./package.json"
|
|
12
|
-
},
|
|
13
|
-
"files": [
|
|
14
|
-
"lib/",
|
|
15
|
-
"bin/",
|
|
16
|
-
"runtime/",
|
|
17
|
-
"cordis.patch.yml",
|
|
18
|
-
"dsh-plugin.json",
|
|
19
|
-
"THIRD_PARTY_NOTICES.md",
|
|
20
|
-
"!**/*.map"
|
|
21
|
-
],
|
|
22
|
-
"dsh": {
|
|
23
|
-
"engines": {
|
|
24
|
-
"dsh": ">=0.1.7-rc.1 <0.1.8-0"
|
|
25
|
-
},
|
|
26
|
-
"bundle": {
|
|
27
|
-
"patch": "./cordis.patch.yml"
|
|
28
|
-
},
|
|
29
|
-
"client": {
|
|
30
|
-
"platform": "web",
|
|
31
|
-
"inject": []
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.client.json",
|
|
36
|
-
"test": "vitest run",
|
|
37
|
-
"build": "tsdown -c tsdown.config.ts"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@deepseek-ai/schemastery": "^3.18.4"
|
|
41
|
-
},
|
|
42
|
-
"peerDependencies": {
|
|
43
|
-
"@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1 <0.1.8-0",
|
|
44
|
-
"@deepseek-ai/dsh-client-store": ">=0.1.7-rc.1 <0.1.8-0",
|
|
45
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.7-rc.1 <0.1.8-0",
|
|
46
|
-
"@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-rc.1 <0.1.8-0",
|
|
47
|
-
"@deepseek-ai/dsh-settings": ">=0.1.7-rc.1 <0.1.8-0",
|
|
48
|
-
"@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0",
|
|
49
|
-
"react": "^18.2.0"
|
|
50
|
-
},
|
|
51
|
-
"peerDependenciesMeta": {
|
|
52
|
-
"@deepseek-ai/dsh-client-locale": {
|
|
53
|
-
"optional": true
|
|
54
|
-
},
|
|
55
|
-
"@deepseek-ai/dsh-client-store": {
|
|
56
|
-
"optional": true
|
|
57
|
-
},
|
|
58
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins": {
|
|
59
|
-
"optional": true
|
|
60
|
-
},
|
|
61
|
-
"@deepseek-ai/dsh-client-ui-slots": {
|
|
62
|
-
"optional": true
|
|
63
|
-
},
|
|
64
|
-
"@deepseek-ai/dsh-settings": {
|
|
65
|
-
"optional": true
|
|
66
|
-
},
|
|
67
|
-
"@deepseek-ai/dsh-tools": {
|
|
68
|
-
"optional": true
|
|
69
|
-
},
|
|
70
|
-
"react": {
|
|
71
|
-
"optional": true
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
"devDependencies": {
|
|
75
|
-
"@deepseek-ai/cosmokit": "^1.8.5",
|
|
76
|
-
"@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0",
|
|
77
|
-
"@types/node": "^22.20.1",
|
|
78
|
-
"@types/react": "~18.3.31",
|
|
79
|
-
"@types/ws": "^8.5.10",
|
|
80
|
-
"jsdom": "^26.0.0",
|
|
81
|
-
"tsdown": "^0.15.0",
|
|
82
|
-
"typescript": "^5.9.0",
|
|
83
|
-
"vitest": "^3.2.0",
|
|
84
|
-
"ws": "^8.18.0",
|
|
85
|
-
"@deepseek-ai/dsh-sandbox": "^0.1.7-rc.1"
|
|
86
|
-
},
|
|
87
|
-
"engines": {
|
|
88
|
-
"node": ">=22",
|
|
89
|
-
"dsh": ">=0.1.7-rc.1 <0.1.8-0"
|
|
90
|
-
},
|
|
91
|
-
"license": "MIT",
|
|
92
|
-
"repository": {
|
|
93
|
-
"type": "git",
|
|
94
|
-
"url": "git+https://github.com/drscrewdriver/dsh-browser-cdp.git"
|
|
95
|
-
},
|
|
96
|
-
"publishConfig": {
|
|
97
|
-
"tag": "dsh-0.1.7"
|
|
98
|
-
}
|
|
99
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-browser-cdp",
|
|
3
|
+
"version": "0.17.4",
|
|
4
|
+
"description": "dsh-browser-cdp: DSH browser plugin — attach to a running Chrome/Edge over CDP (no bundled browser needed); structured browser-automation tools (30+ bcdp_*) that drive the vendored ego runtime through ctx.subprocess, plus a realtime watch panel (live SSE screencast + direct mouse interaction + download capture + human-verification notice). Web shell: floating watch panel without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.1.7+ line: declarative settings via Config .volatile() fields; for DSH 0.1.2-rc.1 ~ 0.1.6 use the 0.16.x line]",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./lib/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./lib/index.js",
|
|
9
|
+
"./client": "./lib/client.js",
|
|
10
|
+
"./dsh-plugin.json": "./dsh-plugin.json",
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"lib/",
|
|
15
|
+
"bin/",
|
|
16
|
+
"runtime/",
|
|
17
|
+
"cordis.patch.yml",
|
|
18
|
+
"dsh-plugin.json",
|
|
19
|
+
"THIRD_PARTY_NOTICES.md",
|
|
20
|
+
"!**/*.map"
|
|
21
|
+
],
|
|
22
|
+
"dsh": {
|
|
23
|
+
"engines": {
|
|
24
|
+
"dsh": ">=0.1.7-rc.1 <0.1.8-0"
|
|
25
|
+
},
|
|
26
|
+
"bundle": {
|
|
27
|
+
"patch": "./cordis.patch.yml"
|
|
28
|
+
},
|
|
29
|
+
"client": {
|
|
30
|
+
"platform": "web",
|
|
31
|
+
"inject": []
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.client.json",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"build": "tsdown -c tsdown.config.ts"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1 <0.1.8-0",
|
|
44
|
+
"@deepseek-ai/dsh-client-store": ">=0.1.7-rc.1 <0.1.8-0",
|
|
45
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.7-rc.1 <0.1.8-0",
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-rc.1 <0.1.8-0",
|
|
47
|
+
"@deepseek-ai/dsh-settings": ">=0.1.7-rc.1 <0.1.8-0",
|
|
48
|
+
"@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0",
|
|
49
|
+
"react": "^18.2.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"@deepseek-ai/dsh-client-locale": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
55
|
+
"@deepseek-ai/dsh-client-store": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": {
|
|
59
|
+
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-slots": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"@deepseek-ai/dsh-settings": {
|
|
65
|
+
"optional": true
|
|
66
|
+
},
|
|
67
|
+
"@deepseek-ai/dsh-tools": {
|
|
68
|
+
"optional": true
|
|
69
|
+
},
|
|
70
|
+
"react": {
|
|
71
|
+
"optional": true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@deepseek-ai/cosmokit": "^1.8.5",
|
|
76
|
+
"@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0",
|
|
77
|
+
"@types/node": "^22.20.1",
|
|
78
|
+
"@types/react": "~18.3.31",
|
|
79
|
+
"@types/ws": "^8.5.10",
|
|
80
|
+
"jsdom": "^26.0.0",
|
|
81
|
+
"tsdown": "^0.15.0",
|
|
82
|
+
"typescript": "^5.9.0",
|
|
83
|
+
"vitest": "^3.2.0",
|
|
84
|
+
"ws": "^8.18.0",
|
|
85
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.7-rc.1"
|
|
86
|
+
},
|
|
87
|
+
"engines": {
|
|
88
|
+
"node": ">=22",
|
|
89
|
+
"dsh": ">=0.1.7-rc.1 <0.1.8-0"
|
|
90
|
+
},
|
|
91
|
+
"license": "MIT",
|
|
92
|
+
"repository": {
|
|
93
|
+
"type": "git",
|
|
94
|
+
"url": "git+https://github.com/drscrewdriver/dsh-browser-cdp.git"
|
|
95
|
+
},
|
|
96
|
+
"publishConfig": {
|
|
97
|
+
"tag": "dsh-0.1.7"
|
|
98
|
+
}
|
|
99
|
+
}
|