@galaxy-stack/blackhole-cli 2.1.32 → 2.1.35
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/package.json +1 -1
- package/web/brand/client.template.js +143 -4
- package/web/brand/dsh-locale-keys.json +4630 -1
- package/web/brand/lib/client.js +962 -389
- package/web/brand/lib/index.js +73 -1
- package/web/brand/vi-same-by-design.json +112 -0
- package/web/brand/vi.locales.json +815 -381
- package/web/patches/gbh-ui.patch.yml +15 -4
package/package.json
CHANGED
|
@@ -755,6 +755,93 @@ window.__ModuleLoader__.load({
|
|
|
755
755
|
}
|
|
756
756
|
/* Tab "Thông tin" trong Cài đặt: tác giả, liên hệ, ảnh Zalo và dòng phiên bản; nút ⤓ chỉ hiện
|
|
757
757
|
khi npm có bản mới và in % ngay trên nút trong lúc cập nhật, xong thì tải lại trang. */
|
|
758
|
+
/*
|
|
759
|
+
* Tab Tinh nang trong Cai dat: hai tinh nang thu nghiem cua DSH. Chung khong nam trong ban dung mac dinh.
|
|
760
|
+
* Bat hay tat o day ghi vao profile, dung cho ma trinh quan ly plugin cua DSH ghi, nen khong can trang do.
|
|
761
|
+
*/
|
|
762
|
+
var GBH_FEATURE_ROWS = [
|
|
763
|
+
{ id: "agentTeams", title: "Agent Teams",
|
|
764
|
+
body: "Nhóm agent cùng làm một việc: danh sách thành viên, hộp thư giữa các agent, và bảng việc chung. " +
|
|
765
|
+
"Bật lên sẽ thay bốn công cụ Subagent hiện có bằng công cụ của nhóm." },
|
|
766
|
+
{ id: "automationTasks", title: "Tác vụ tự động",
|
|
767
|
+
body: "Chạy tác vụ trong phiên của bạn theo giờ đặt trước hoặc theo lịch lặp lại, kèm một trang lịch ở sidebar." },
|
|
768
|
+
];
|
|
769
|
+
|
|
770
|
+
function GbhSwitch(props) {
|
|
771
|
+
return react_jsx_runtime.jsx("button", {
|
|
772
|
+
type: "button",
|
|
773
|
+
role: "switch",
|
|
774
|
+
"aria-checked": props.on === true,
|
|
775
|
+
"aria-label": props.label,
|
|
776
|
+
disabled: props.disabled === true,
|
|
777
|
+
onClick: props.onToggle,
|
|
778
|
+
style: {
|
|
779
|
+
width: "40px", height: "22px", borderRadius: "11px", border: "none", padding: "2px",
|
|
780
|
+
cursor: props.disabled === true ? "default" : "pointer",
|
|
781
|
+
display: "inline-flex", alignItems: "center", flex: "0 0 auto",
|
|
782
|
+
justifyContent: props.on === true ? "flex-end" : "flex-start",
|
|
783
|
+
background: props.on === true ? "var(--dsw-alias-state-business-primary, #4c8dff)" : "rgba(255,255,255,.18)",
|
|
784
|
+
},
|
|
785
|
+
children: react_jsx_runtime.jsx("span", { style: { width: "18px", height: "18px", borderRadius: "50%", background: "#fff", display: "block" } }),
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
function GbhFeaturesSection() {
|
|
790
|
+
const state = react.useState({ loading: true, features: {}, busy: null, error: "" });
|
|
791
|
+
const view = state[0];
|
|
792
|
+
const setView = state[1];
|
|
793
|
+
react.useEffect(function () {
|
|
794
|
+
var alive = true;
|
|
795
|
+
fetch("/api/galaxy/features").then(function (r) { return r.json(); }).then(function (data) {
|
|
796
|
+
if (!alive) return;
|
|
797
|
+
setView(function (p) { return Object.assign({}, p, { loading: false, features: (data && data.features) || {} }); });
|
|
798
|
+
}, function () {
|
|
799
|
+
if (alive) setView(function (p) { return Object.assign({}, p, { loading: false, failed: true, error: "Không đọc được trạng thái tính năng. Nếu bạn vừa cập nhật, hãy khởi động lại blackhole web." }); });
|
|
800
|
+
});
|
|
801
|
+
return function () { alive = false; };
|
|
802
|
+
}, []);
|
|
803
|
+
var toggle = function (row) {
|
|
804
|
+
if (view.busy !== null) return;
|
|
805
|
+
var body = { features: {} };
|
|
806
|
+
body.features[row.id] = !(view.features[row.id] === true);
|
|
807
|
+
setView(function (p) { return Object.assign({}, p, { busy: row.id, error: "" }); });
|
|
808
|
+
fetch("/api/galaxy/features", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) })
|
|
809
|
+
.then(function (r) { return r.json(); })
|
|
810
|
+
.then(function (data) {
|
|
811
|
+
setView(function (p) { return Object.assign({}, p, { busy: null, features: (data && data.features) || p.features }); });
|
|
812
|
+
}, function () {
|
|
813
|
+
setView(function (p) { return Object.assign({}, p, { busy: null, error: "Không lưu được. Hãy thử lại." }); });
|
|
814
|
+
});
|
|
815
|
+
};
|
|
816
|
+
var rows = GBH_FEATURE_ROWS.map(function (row) {
|
|
817
|
+
return react_jsx_runtime.jsxs("div", {
|
|
818
|
+
key: row.id,
|
|
819
|
+
style: {
|
|
820
|
+
display: "flex", alignItems: "flex-start", gap: "16px", padding: "16px",
|
|
821
|
+
border: "0.5px solid var(--dsw-alias-border-l2, rgba(255,255,255,.12))", borderRadius: "12px",
|
|
822
|
+
},
|
|
823
|
+
children: [react_jsx_runtime.jsxs("div", { style: { flex: "1 1 auto", minWidth: "0" }, children: [
|
|
824
|
+
react_jsx_runtime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexWrap: "wrap" }, children: [
|
|
825
|
+
react_jsx_runtime.jsx("strong", { style: { fontSize: "15px" }, children: row.title }),
|
|
826
|
+
react_jsx_runtime.jsx("span", { style: {
|
|
827
|
+
fontSize: "11px", padding: "2px 8px", borderRadius: "999px",
|
|
828
|
+
background: "rgba(76,141,255,.16)", color: "var(--dsw-alias-label-secondary, #c9d4e6)",
|
|
829
|
+
}, children: "Thử nghiệm" }),
|
|
830
|
+
]}),
|
|
831
|
+
react_jsx_runtime.jsx("p", { style: { margin: "6px 0 0", fontSize: "13px", lineHeight: "20px", color: "var(--dsw-alias-label-secondary, #a9b4c4)" }, children: row.body }),
|
|
832
|
+
]}),
|
|
833
|
+
react_jsx_runtime.jsx(GbhSwitch, { on: view.features[row.id] === true, disabled: view.busy !== null || view.failed === true, label: row.title, onToggle: function () { toggle(row); } }),
|
|
834
|
+
],
|
|
835
|
+
});
|
|
836
|
+
});
|
|
837
|
+
return react_jsx_runtime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px", maxWidth: "620px" }, children: [
|
|
838
|
+
react_jsx_runtime.jsx("p", { style: { margin: "0 0 4px", fontSize: "13px", color: "var(--dsw-alias-label-secondary, #a9b4c4)" },
|
|
839
|
+
children: view.loading ? "Đang đọc trạng thái…" : "Bật hoặc tắt các tính năng đang thử nghiệm. Thay đổi có hiệu lực từ lần khởi động sau." }),
|
|
840
|
+
rows,
|
|
841
|
+
view.error === "" ? null : react_jsx_runtime.jsx("p", { style: { margin: "0", fontSize: "13px", color: "var(--dsw-alias-state-error-primary, #ff7a7a)" }, children: view.error }),
|
|
842
|
+
]});
|
|
843
|
+
}
|
|
844
|
+
|
|
758
845
|
function GbhInfoSection(props) {
|
|
759
846
|
const version = props.version;
|
|
760
847
|
const zalo = props.zalo;
|
|
@@ -831,6 +918,20 @@ window.__ModuleLoader__.load({
|
|
|
831
918
|
/* The preset card's view affordance is an icon carrying its label in data-tip/aria-label rather than in
|
|
832
919
|
text, so a rule on those attributes survives the re-renders an inline style does not. */
|
|
833
920
|
'[data-tip="Xem"],[data-tip="View"],[aria-label^="Xem:"],[aria-label^="View:"]{display:none !important}',
|
|
921
|
+
/* Rows the brand marks for removal; the attribute survives a re-render better than an inline style. */
|
|
922
|
+
"[data-gbh-hidden]{display:none !important}",
|
|
923
|
+
/* DSH marks the rows a plugin page is built from, so these need no scripting and cannot flicker. */
|
|
924
|
+
'[class*="_versionTag"]{display:none !important}',
|
|
925
|
+
'code[data-plugin-name="true"]{display:none !important}',
|
|
926
|
+
'section[data-plugin-rows="true"]{display:none !important}',
|
|
927
|
+
/*
|
|
928
|
+
* The stock provider editor offers a 'Customized settings' disclosure, and DSH opens it for a frame while a
|
|
929
|
+
* route loads. A stylesheet applies from the first paint, which no script-driven hide can promise, so this
|
|
930
|
+
* is a rule rather than a marker. The add-provider surfaces keep the disclosure.
|
|
931
|
+
*/
|
|
932
|
+
'[class*="_customized"]{display:none !important}',
|
|
933
|
+
'[class*="_addCard"] [class*="_customized"],[class*="_addPanel"] [class*="_customized"],' +
|
|
934
|
+
'[class*="_addBlock"] [class*="_customized"],[class*="_setupCard"] [class*="_customized"]{display:revert !important}',
|
|
834
935
|
].join("\n");
|
|
835
936
|
document.head.appendChild(style);
|
|
836
937
|
} catch (error) { /* A page without a head must not break the rest of the brand. */ }
|
|
@@ -846,6 +947,8 @@ window.__ModuleLoader__.load({
|
|
|
846
947
|
*
|
|
847
948
|
* Both run on a debounced observer because the settings panel mounts long after the brand is applied.
|
|
848
949
|
*/
|
|
950
|
+
|
|
951
|
+
|
|
849
952
|
function tidySettingsSurfaces() {
|
|
850
953
|
try {
|
|
851
954
|
var nodes = document.querySelectorAll("div, span, p, li");
|
|
@@ -853,14 +956,35 @@ window.__ModuleLoader__.load({
|
|
|
853
956
|
var node = nodes[i];
|
|
854
957
|
if (node.children.length !== 0) continue;
|
|
855
958
|
var text = node.textContent || "";
|
|
856
|
-
if (text.indexOf("Phiên bản hiện tại:")
|
|
857
|
-
|
|
858
|
-
|
|
959
|
+
if (text.indexOf("Phiên bản hiện tại:") === 0 || text.indexOf("Current version:") === 0) {
|
|
960
|
+
var label = text.indexOf("Current version:") === 0 ? "Current version: " : "Phiên bản hiện tại: ";
|
|
961
|
+
node.textContent = label + CLI_VERSION;
|
|
962
|
+
continue;
|
|
963
|
+
}
|
|
964
|
+
/*
|
|
965
|
+
* The session-log upload setting writes its own copy straight into the bundle instead of going through the
|
|
966
|
+
* dictionary, so it needs a rewrite here. The product is Galaxy, so its wording names Galaxy too.
|
|
967
|
+
*/
|
|
968
|
+
if (text === "Upload Session Log when using the official model API") {
|
|
969
|
+
node.textContent = "Tải log phiên lên khi dùng API model chính thức";
|
|
970
|
+
continue;
|
|
971
|
+
}
|
|
972
|
+
if (text === "Help improve DeepSeek models and products.") {
|
|
973
|
+
node.textContent = "Giúp cải thiện model và sản phẩm Galaxy.";
|
|
974
|
+
continue;
|
|
975
|
+
}
|
|
976
|
+
/* The module row names an internal npm package; it is the one line there a user cannot act on. */
|
|
977
|
+
if (text === "Mô-đun" || text === "Module") {
|
|
978
|
+
var row = node.parentElement;
|
|
979
|
+
if (row !== null) row.setAttribute("data-gbh-hidden", "");
|
|
980
|
+
}
|
|
859
981
|
}
|
|
860
982
|
|
|
861
983
|
} catch (error) { /* A DOM we do not recognise must not break the brand. */ }
|
|
862
984
|
}
|
|
863
985
|
|
|
986
|
+
/* The disclosure is hidden by a stylesheet rule; no marker pass exists any more. */
|
|
987
|
+
|
|
864
988
|
/*
|
|
865
989
|
* The row-menu probe already observes the document, so this rides on it: a second observer would be one
|
|
866
990
|
* more thing watching every mutation, and the brand is supposed to stay the only two it has.
|
|
@@ -904,6 +1028,16 @@ window.__ModuleLoader__.load({
|
|
|
904
1028
|
inject: function () { return { version: CLI_VERSION, zalo: ZALO }; }
|
|
905
1029
|
}, GbhInfoSection);
|
|
906
1030
|
});
|
|
1031
|
+
/* Tab Tinh nang: bat/tat hai tinh nang thu nghiem cua DSH ngay trong Cai dat. */
|
|
1032
|
+
ctx.slots.inject("settings.section", function () {
|
|
1033
|
+
return ctx.slots.register({
|
|
1034
|
+
name: "settings.section",
|
|
1035
|
+
id: "gbh-features",
|
|
1036
|
+
order: 65,
|
|
1037
|
+
label: function () { return "Tính năng"; },
|
|
1038
|
+
inject: function () { return {}; }
|
|
1039
|
+
}, GbhFeaturesSection);
|
|
1040
|
+
});
|
|
907
1041
|
/* Row menus: the stock Session menu exposes no slot, so the entry is injected on open. */
|
|
908
1042
|
var sessionsT = function (key) { return key; };
|
|
909
1043
|
try { sessionsT = ctx.locale.bind(GBH_SESSIONS_NS); } catch (error) { /* the namespace registers just above */ }
|
|
@@ -954,7 +1088,12 @@ window.__ModuleLoader__.load({
|
|
|
954
1088
|
t: journeyT,
|
|
955
1089
|
api: journeyApi
|
|
956
1090
|
});
|
|
957
|
-
|
|
1091
|
+
/*
|
|
1092
|
+
* The journey panel is still being built, and a release should not carry a surface that is not finished. The
|
|
1093
|
+
* code below stays whole; flip this to true to seat it back on the conversation view.
|
|
1094
|
+
*/
|
|
1095
|
+
var GBH_JOURNEY_ENABLED = false;
|
|
1096
|
+
if (GBH_JOURNEY_ENABLED) ctx.slots.inject("conversation.view", function () {
|
|
958
1097
|
return ctx.slots.register({
|
|
959
1098
|
name: "conversation.view",
|
|
960
1099
|
id: "journey",
|