@galaxy-stack/blackhole-cli 2.1.34 → 2.1.36
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 +121 -13
- package/web/brand/dsh-locale-keys.json +2102 -1
- package/web/brand/lib/client.js +126 -18
- package/web/brand/lib/index.js +73 -1
- package/web/brand/vi.locales.json +1 -1
- package/web/patches/gbh-ui.patch.yml +5 -0
- package/web/patches/gbh-web.patch.yml +6 -0
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;
|
|
@@ -874,6 +961,18 @@ window.__ModuleLoader__.load({
|
|
|
874
961
|
node.textContent = label + CLI_VERSION;
|
|
875
962
|
continue;
|
|
876
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
|
+
}
|
|
877
976
|
/* The module row names an internal npm package; it is the one line there a user cannot act on. */
|
|
878
977
|
if (text === "Mô-đun" || text === "Module") {
|
|
879
978
|
var row = node.parentElement;
|
|
@@ -929,6 +1028,16 @@ window.__ModuleLoader__.load({
|
|
|
929
1028
|
inject: function () { return { version: CLI_VERSION, zalo: ZALO }; }
|
|
930
1029
|
}, GbhInfoSection);
|
|
931
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
|
+
});
|
|
932
1041
|
/* Row menus: the stock Session menu exposes no slot, so the entry is injected on open. */
|
|
933
1042
|
var sessionsT = function (key) { return key; };
|
|
934
1043
|
try { sessionsT = ctx.locale.bind(GBH_SESSIONS_NS); } catch (error) { /* the namespace registers just above */ }
|
|
@@ -979,7 +1088,12 @@ window.__ModuleLoader__.load({
|
|
|
979
1088
|
t: journeyT,
|
|
980
1089
|
api: journeyApi
|
|
981
1090
|
});
|
|
982
|
-
|
|
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 () {
|
|
983
1097
|
return ctx.slots.register({
|
|
984
1098
|
name: "conversation.view",
|
|
985
1099
|
id: "journey",
|
|
@@ -989,18 +1103,12 @@ window.__ModuleLoader__.load({
|
|
|
989
1103
|
inject: function (sessionId) { return { sessionId: sessionId, api: journeyApi, t: journeyT }; }
|
|
990
1104
|
}, journeyPanel.JourneyPanel);
|
|
991
1105
|
});
|
|
992
|
-
/*
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
id: "gbh-feedback",
|
|
999
|
-
order: 60,
|
|
1000
|
-
locale: GBH_FEEDBACK_NS,
|
|
1001
|
-
inject: function () { return { ctx: ctx, feedbackT: feedbackT }; }
|
|
1002
|
-
}, GbhFeedbackAction);
|
|
1003
|
-
});
|
|
1106
|
+
/*
|
|
1107
|
+
* Nothing seats in the session header for feedback. Feedback is a Settings section now, and the header
|
|
1108
|
+
* action this call site used to pass was renamed out from under it: the name was never defined, so the
|
|
1109
|
+
* throw landed inside the entry's activation and the GUI booted into "Failed to load plugins".
|
|
1110
|
+
* GbhFeedbackSection is the live surface; it has no header face.
|
|
1111
|
+
*/
|
|
1004
1112
|
try {
|
|
1005
1113
|
ctx.locale.addLanguage({ id: "vi", label: "Tiếng Việt", fallback: "en" });
|
|
1006
1114
|
} catch (error) {
|