dsh-lowtide 0.2.1 → 0.2.3
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/LICENSE +21 -0
- package/README.md +168 -166
- package/cordis.patch.yml +47 -39
- package/lib/client.js +1519 -287
- package/lib/client.js.map +1 -1
- package/lib/index.js +199 -67
- package/lib/types/client/api.d.ts +3 -1
- package/lib/types/client/components/InterceptCard.d.ts +3 -0
- package/lib/types/client/components/atoms.d.ts +7 -0
- package/lib/types/client/i18n.d.ts +4 -0
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/lib/tierClock.d.ts +81 -0
- package/lib/types/client/store.d.ts +34 -1
- package/lib/types/src/models.d.ts +5 -1
- package/lib/types/src/routes.d.ts +8 -0
- package/lib/types/src/runner.d.ts +3 -3
- package/package.json +36 -37
package/lib/client.js
CHANGED
|
@@ -7,7 +7,6 @@ window.__ModuleLoader__.load({
|
|
|
7
7
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
8
8
|
let react = require("react");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
-
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
|
11
10
|
//#region client/i18n.ts
|
|
12
11
|
/**
|
|
13
12
|
* dsh-lowtide client dictionaries (zh / en).
|
|
@@ -30,6 +29,7 @@ window.__ModuleLoader__.load({
|
|
|
30
29
|
"pill.off": "闲时",
|
|
31
30
|
"pill.custom": "闲时×{multiplier}",
|
|
32
31
|
"pill.running": "执行中 {running}/{total}",
|
|
32
|
+
"pill.stale": "数据同步于 {minutes} 分钟前 · 正在重连(忙/闲仍按本机时间判定)",
|
|
33
33
|
"tooltip.time": "当前:{tier}({window})",
|
|
34
34
|
"tooltip.timeNoWindow": "当前:{tier}",
|
|
35
35
|
"tooltip.queue": "队列 {total} 项 · {pending} 待裁定",
|
|
@@ -120,6 +120,7 @@ window.__ModuleLoader__.load({
|
|
|
120
120
|
"modal.editDesc": "原地修改,任务状态保持不变 · {id}",
|
|
121
121
|
"modal.saveEdit": "保存修改",
|
|
122
122
|
"modal.cancel": "取消",
|
|
123
|
+
"modal.close": "关闭",
|
|
123
124
|
"modal.submit": "投递",
|
|
124
125
|
"modal.promptPlaceholderSingle": "给 src/auth 模块补全所有边界情况的单元测试,描述内容越详细越好|||给 UserService 的 CRUD 接口写完整的集成测试套件,描述内容越详细越好|||给这个 REST API 端点写完整的 OpenAPI 3.0 文档,描述内容越详细越好|||把现有的 Jenkinsfile 迁移到 GitHub Actions workflow,描述内容越详细越好|||分析这段 N+1 查询日志,给出索引优化建议,描述内容越详细越好",
|
|
125
126
|
"modal.promptPlaceholderIterative": "重构用户权限中间件,每轮审查安全性直到可上线,描述内容越详细越好|||补齐支付模块的边界测试,每轮跑通再加新 case,描述内容越详细越好|||写消息队列选型的技术方案 RFC,迭代到可评审状态,描述内容越详细越好|||写 Terraform 模块管理 EKS 集群,每轮 apply 验证,描述内容越详细越好|||优化首页接口的 TTFB,每轮 profile 后针对性改进,描述内容越详细越好",
|
|
@@ -281,7 +282,9 @@ window.__ModuleLoader__.load({
|
|
|
281
282
|
"settings.priceTierPeak": "忙时",
|
|
282
283
|
"settings.priceTierOff": "闲时",
|
|
283
284
|
"settings.officialTitle": "官方定价说明",
|
|
284
|
-
"settings.officialBody": "DeepSeek
|
|
285
|
+
"settings.officialBody": "DeepSeek 峰谷定价:工作日 09:00–12:00、14:00–18:00(北京时间)为高峰时段,其余时间为非高峰,闲时价为高峰价的一半;周末(周六、周日)全天按闲时价。2026-09-10 起 V4.1-Flash 上线并降价,模型名改为 deepseek-flash(旧名 deepseek-v4-flash、deepseek-v4-flash-vision-exp 仍可调用,但按 Flash 价计费);V4 Pro 于北京时间 2026-09-14 12:00 起下线,请求与计费均转为 V4.1-Flash。官方所说的「高峰 / 非高峰」,就是本插件的「忙时 / 闲时」。",
|
|
286
|
+
"settings.officialDrift": "官方忙时段已更新,与你保存的窗口不一致——点下面「一键采用」即可对齐。",
|
|
287
|
+
"settings.modelRetiring": "该模型已下线或即将下线,实际按 deepseek-flash 计费:{note}",
|
|
285
288
|
"settings.localTz": "你的本地时区:{tz}",
|
|
286
289
|
"settings.officialPeakLocal": "官方忙时在你本地(仅工作日):{range}",
|
|
287
290
|
"settings.officialWeekend": "周末(周六、周日)全天按闲时价,不分峰谷。",
|
|
@@ -354,6 +357,7 @@ window.__ModuleLoader__.load({
|
|
|
354
357
|
"pill.off": "Off-peak",
|
|
355
358
|
"pill.custom": "Off ×{multiplier}",
|
|
356
359
|
"pill.running": "Running {running}/{total}",
|
|
360
|
+
"pill.stale": "Data synced {minutes} min ago · reconnecting (busy/idle still follows this machine's clock)",
|
|
357
361
|
"tooltip.time": "Now: {tier} ({window})",
|
|
358
362
|
"tooltip.timeNoWindow": "Now: {tier}",
|
|
359
363
|
"tooltip.queue": "Queue {total} · {pending} to review",
|
|
@@ -444,6 +448,7 @@ window.__ModuleLoader__.load({
|
|
|
444
448
|
"modal.editDesc": "Edits in place — task status is preserved · {id}",
|
|
445
449
|
"modal.saveEdit": "Save changes",
|
|
446
450
|
"modal.cancel": "Cancel",
|
|
451
|
+
"modal.close": "Close",
|
|
447
452
|
"modal.submit": "Submit",
|
|
448
453
|
"modal.promptPlaceholderSingle": "Write full unit tests for src/auth covering all edge cases — be as detailed as possible|||Write a complete integration test suite for the UserService CRUD API — be as detailed as possible|||Write full OpenAPI 3.0 docs for this REST endpoint — be as detailed as possible|||Migrate the existing Jenkinsfile to a GitHub Actions workflow — be as detailed as possible|||Analyze this N+1 query log and suggest index optimizations — be as detailed as possible",
|
|
449
454
|
"modal.promptPlaceholderIterative": "Refactor the auth middleware error handling, review security each round until shippable — be as detailed as possible|||Fill in edge-case tests for the payment module, pass all tests each round before adding new ones — be as detailed as possible|||Draft an RFC for message queue selection, iterate until review-ready — be as detailed as possible|||Write a Terraform module for the EKS cluster, apply and verify each round — be as detailed as possible|||Optimize the homepage TTFB, profile and improve targeted areas each round — be as detailed as possible",
|
|
@@ -605,7 +610,9 @@ window.__ModuleLoader__.load({
|
|
|
605
610
|
"settings.priceTierPeak": "Peak",
|
|
606
611
|
"settings.priceTierOff": "Off",
|
|
607
612
|
"settings.officialTitle": "About the official pricing",
|
|
608
|
-
"settings.officialBody": "DeepSeek
|
|
613
|
+
"settings.officialBody": "DeepSeek peak/valley pricing: weekdays 09:00–12:00 and 14:00–18:00 Beijing time are peak hours, everything else is off-peak at exactly half the peak price, and weekends (Saturday & Sunday) are off-peak all day. On 2026-09-10 DeepSeek-V4.1-Flash shipped with a price cut and the model was renamed to deepseek-flash — the legacy names deepseek-v4-flash and deepseek-v4-flash-vision-exp are still accepted but billed at the Flash price; V4 Pro retires at 12:00 Beijing time on 2026-09-14 and its requests are routed to (and billed as) V4.1-Flash. The official \"peak / off-peak\" is exactly this plugin's \"busy / idle\".",
|
|
614
|
+
"settings.officialDrift": "The official peak hours changed and no longer match your saved windows — click \"Adopt\" below to realign.",
|
|
615
|
+
"settings.modelRetiring": "This model is retired or retiring and is billed as deepseek-flash: {note}",
|
|
609
616
|
"settings.localTz": "Your local timezone: {tz}",
|
|
610
617
|
"settings.officialPeakLocal": "Official peak hours in your local time (weekdays only): {range}",
|
|
611
618
|
"settings.officialWeekend": "Weekends (Saturday & Sunday) are off-peak all day — no peak/valley split.",
|
|
@@ -673,8 +680,8 @@ window.__ModuleLoader__.load({
|
|
|
673
680
|
}
|
|
674
681
|
};
|
|
675
682
|
//#endregion
|
|
676
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
677
|
-
const css$13 = ".
|
|
683
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\atoms.module.css.mjs
|
|
684
|
+
const css$13 = ".grgw_q_money,.grgw_q_countdown{font-family:var(--ds-font-family-code);font-variant-numeric:tabular-nums;font-size:inherit;line-height:inherit}.grgw_q_modelBadge{border:1px solid var(--dsw-alias-border-l3);color:var(--dsw-alias-label-secondary);font-family:var(--ds-font-family-code);white-space:nowrap;border-radius:4px;flex:none;align-items:center;gap:2px;padding:1px 6px;font-size:11px;line-height:16px;display:inline-flex}.grgw_q_modelBadgeUnknown{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary)}.grgw_q_modelBadgeQ{font-weight:600}";
|
|
678
685
|
const tagId$13 = "dsh-lowtide/atoms.module.css";
|
|
679
686
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$13) + "]") === null) {
|
|
680
687
|
const tag = document.createElement("style");
|
|
@@ -684,11 +691,11 @@ window.__ModuleLoader__.load({
|
|
|
684
691
|
document.head.appendChild(tag);
|
|
685
692
|
}
|
|
686
693
|
var atoms_module_css_default = {
|
|
687
|
-
"
|
|
688
|
-
"
|
|
689
|
-
"
|
|
690
|
-
"
|
|
691
|
-
"
|
|
694
|
+
"modelBadgeUnknown": "grgw_q_modelBadgeUnknown",
|
|
695
|
+
"modelBadge": "grgw_q_modelBadge",
|
|
696
|
+
"money": "grgw_q_money",
|
|
697
|
+
"modelBadgeQ": "grgw_q_modelBadgeQ",
|
|
698
|
+
"countdown": "grgw_q_countdown"
|
|
692
699
|
};
|
|
693
700
|
//#endregion
|
|
694
701
|
//#region client/components/atoms.tsx
|
|
@@ -696,6 +703,20 @@ window.__ModuleLoader__.load({
|
|
|
696
703
|
* Atomic presentational pieces (PLAN §3.6/§3.7): money with tabular nums,
|
|
697
704
|
* live countdown, status dot. Only §4 tokens.
|
|
698
705
|
*/
|
|
706
|
+
/**
|
|
707
|
+
* Wall-clock tick for "now" markers (v0.2.2): re-renders every `periodMs`
|
|
708
|
+
* (default 30s) and on mount. The 24h band's marker used to be computed once
|
|
709
|
+
* per render with no timer, so it never moved on its own — the same class of
|
|
710
|
+
* staleness the tier clock fixes for the pill.
|
|
711
|
+
*/
|
|
712
|
+
function useWallClock(periodMs = 3e4) {
|
|
713
|
+
const [now, setNow] = (0, react.useState)(() => Date.now());
|
|
714
|
+
(0, react.useEffect)(() => {
|
|
715
|
+
const timer = setInterval(() => setNow(Date.now()), periodMs);
|
|
716
|
+
return () => clearInterval(timer);
|
|
717
|
+
}, [periodMs]);
|
|
718
|
+
return now;
|
|
719
|
+
}
|
|
699
720
|
/** ¥3.82 two-decimals; ¥123 without decimals at ≥¥100; <¥0.01 for dust (PLAN §3.6). */
|
|
700
721
|
function Money({ yuan, className }) {
|
|
701
722
|
const text = yuan >= 100 ? `¥${Math.round(yuan)}` : yuan < .005 ? "<¥0.01" : `¥${yuan.toFixed(2)}`;
|
|
@@ -730,13 +751,1036 @@ window.__ModuleLoader__.load({
|
|
|
730
751
|
});
|
|
731
752
|
}
|
|
732
753
|
//#endregion
|
|
754
|
+
//#region ../../node_modules/.pnpm/zustand@4.4.7_@types+react@18.3.31_immer@10.1.1_react@18.2.0/node_modules/zustand/esm/vanilla.mjs
|
|
755
|
+
const createStoreImpl = (createState) => {
|
|
756
|
+
let state;
|
|
757
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
758
|
+
const setState = (partial, replace) => {
|
|
759
|
+
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
760
|
+
if (!Object.is(nextState, state)) {
|
|
761
|
+
const previousState = state;
|
|
762
|
+
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
|
763
|
+
listeners.forEach((listener) => listener(state, previousState));
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
const getState = () => state;
|
|
767
|
+
const subscribe = (listener) => {
|
|
768
|
+
listeners.add(listener);
|
|
769
|
+
return () => listeners.delete(listener);
|
|
770
|
+
};
|
|
771
|
+
const destroy = () => {
|
|
772
|
+
listeners.clear();
|
|
773
|
+
};
|
|
774
|
+
const api = {
|
|
775
|
+
setState,
|
|
776
|
+
getState,
|
|
777
|
+
subscribe,
|
|
778
|
+
destroy
|
|
779
|
+
};
|
|
780
|
+
state = createState(setState, getState, api);
|
|
781
|
+
return api;
|
|
782
|
+
};
|
|
783
|
+
const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
784
|
+
//#endregion
|
|
785
|
+
//#region ../../node_modules/.pnpm/zustand@4.4.7_@types+react@18.3.31_immer@10.1.1_react@18.2.0/node_modules/zustand/esm/middleware.mjs
|
|
786
|
+
const subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
|
787
|
+
const origSubscribe = api.subscribe;
|
|
788
|
+
api.subscribe = (selector, optListener, options) => {
|
|
789
|
+
let listener = selector;
|
|
790
|
+
if (optListener) {
|
|
791
|
+
const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;
|
|
792
|
+
let currentSlice = selector(api.getState());
|
|
793
|
+
listener = (state) => {
|
|
794
|
+
const nextSlice = selector(state);
|
|
795
|
+
if (!equalityFn(currentSlice, nextSlice)) {
|
|
796
|
+
const previousSlice = currentSlice;
|
|
797
|
+
optListener(currentSlice = nextSlice, previousSlice);
|
|
798
|
+
}
|
|
799
|
+
};
|
|
800
|
+
if (options == null ? void 0 : options.fireImmediately) optListener(currentSlice, currentSlice);
|
|
801
|
+
}
|
|
802
|
+
return origSubscribe(listener);
|
|
803
|
+
};
|
|
804
|
+
return fn(set, get, api);
|
|
805
|
+
};
|
|
806
|
+
const subscribeWithSelector = subscribeWithSelectorImpl;
|
|
807
|
+
//#endregion
|
|
808
|
+
//#region ../../node_modules/.pnpm/immer@10.1.1/node_modules/immer/dist/immer.mjs
|
|
809
|
+
var NOTHING = Symbol.for("immer-nothing");
|
|
810
|
+
var DRAFTABLE = Symbol.for("immer-draftable");
|
|
811
|
+
var DRAFT_STATE = Symbol.for("immer-state");
|
|
812
|
+
function die(error, ...args) {
|
|
813
|
+
throw new Error(`[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`);
|
|
814
|
+
}
|
|
815
|
+
var getPrototypeOf = Object.getPrototypeOf;
|
|
816
|
+
function isDraft(value) {
|
|
817
|
+
return !!value && !!value[DRAFT_STATE];
|
|
818
|
+
}
|
|
819
|
+
function isDraftable(value) {
|
|
820
|
+
if (!value) return false;
|
|
821
|
+
return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);
|
|
822
|
+
}
|
|
823
|
+
var objectCtorString = Object.prototype.constructor.toString();
|
|
824
|
+
function isPlainObject(value) {
|
|
825
|
+
if (!value || typeof value !== "object") return false;
|
|
826
|
+
const proto = getPrototypeOf(value);
|
|
827
|
+
if (proto === null) return true;
|
|
828
|
+
const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
829
|
+
if (Ctor === Object) return true;
|
|
830
|
+
return typeof Ctor == "function" && Function.toString.call(Ctor) === objectCtorString;
|
|
831
|
+
}
|
|
832
|
+
function each(obj, iter) {
|
|
833
|
+
if (getArchtype(obj) === 0) Reflect.ownKeys(obj).forEach((key) => {
|
|
834
|
+
iter(key, obj[key], obj);
|
|
835
|
+
});
|
|
836
|
+
else obj.forEach((entry, index) => iter(index, entry, obj));
|
|
837
|
+
}
|
|
838
|
+
function getArchtype(thing) {
|
|
839
|
+
const state = thing[DRAFT_STATE];
|
|
840
|
+
return state ? state.type_ : Array.isArray(thing) ? 1 : isMap(thing) ? 2 : isSet(thing) ? 3 : 0;
|
|
841
|
+
}
|
|
842
|
+
function has(thing, prop) {
|
|
843
|
+
return getArchtype(thing) === 2 ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);
|
|
844
|
+
}
|
|
845
|
+
function set(thing, propOrOldValue, value) {
|
|
846
|
+
const t = getArchtype(thing);
|
|
847
|
+
if (t === 2) thing.set(propOrOldValue, value);
|
|
848
|
+
else if (t === 3) thing.add(value);
|
|
849
|
+
else thing[propOrOldValue] = value;
|
|
850
|
+
}
|
|
851
|
+
function is(x, y) {
|
|
852
|
+
if (x === y) return x !== 0 || 1 / x === 1 / y;
|
|
853
|
+
else return x !== x && y !== y;
|
|
854
|
+
}
|
|
855
|
+
function isMap(target) {
|
|
856
|
+
return target instanceof Map;
|
|
857
|
+
}
|
|
858
|
+
function isSet(target) {
|
|
859
|
+
return target instanceof Set;
|
|
860
|
+
}
|
|
861
|
+
function latest(state) {
|
|
862
|
+
return state.copy_ || state.base_;
|
|
863
|
+
}
|
|
864
|
+
function shallowCopy(base, strict) {
|
|
865
|
+
if (isMap(base)) return new Map(base);
|
|
866
|
+
if (isSet(base)) return new Set(base);
|
|
867
|
+
if (Array.isArray(base)) return Array.prototype.slice.call(base);
|
|
868
|
+
const isPlain = isPlainObject(base);
|
|
869
|
+
if (strict === true || strict === "class_only" && !isPlain) {
|
|
870
|
+
const descriptors = Object.getOwnPropertyDescriptors(base);
|
|
871
|
+
delete descriptors[DRAFT_STATE];
|
|
872
|
+
let keys = Reflect.ownKeys(descriptors);
|
|
873
|
+
for (let i = 0; i < keys.length; i++) {
|
|
874
|
+
const key = keys[i];
|
|
875
|
+
const desc = descriptors[key];
|
|
876
|
+
if (desc.writable === false) {
|
|
877
|
+
desc.writable = true;
|
|
878
|
+
desc.configurable = true;
|
|
879
|
+
}
|
|
880
|
+
if (desc.get || desc.set) descriptors[key] = {
|
|
881
|
+
configurable: true,
|
|
882
|
+
writable: true,
|
|
883
|
+
enumerable: desc.enumerable,
|
|
884
|
+
value: base[key]
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
return Object.create(getPrototypeOf(base), descriptors);
|
|
888
|
+
} else {
|
|
889
|
+
const proto = getPrototypeOf(base);
|
|
890
|
+
if (proto !== null && isPlain) return { ...base };
|
|
891
|
+
const obj = Object.create(proto);
|
|
892
|
+
return Object.assign(obj, base);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
function freeze(obj, deep = false) {
|
|
896
|
+
if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj;
|
|
897
|
+
if (getArchtype(obj) > 1) obj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections;
|
|
898
|
+
Object.freeze(obj);
|
|
899
|
+
if (deep) Object.entries(obj).forEach(([key, value]) => freeze(value, true));
|
|
900
|
+
return obj;
|
|
901
|
+
}
|
|
902
|
+
function dontMutateFrozenCollections() {
|
|
903
|
+
die(2);
|
|
904
|
+
}
|
|
905
|
+
function isFrozen(obj) {
|
|
906
|
+
return Object.isFrozen(obj);
|
|
907
|
+
}
|
|
908
|
+
var plugins = {};
|
|
909
|
+
function getPlugin(pluginKey) {
|
|
910
|
+
const plugin = plugins[pluginKey];
|
|
911
|
+
if (!plugin) die(0, pluginKey);
|
|
912
|
+
return plugin;
|
|
913
|
+
}
|
|
914
|
+
var currentScope;
|
|
915
|
+
function getCurrentScope() {
|
|
916
|
+
return currentScope;
|
|
917
|
+
}
|
|
918
|
+
function createScope(parent_, immer_) {
|
|
919
|
+
return {
|
|
920
|
+
drafts_: [],
|
|
921
|
+
parent_,
|
|
922
|
+
immer_,
|
|
923
|
+
canAutoFreeze_: true,
|
|
924
|
+
unfinalizedDrafts_: 0
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
function usePatchesInScope(scope, patchListener) {
|
|
928
|
+
if (patchListener) {
|
|
929
|
+
getPlugin("Patches");
|
|
930
|
+
scope.patches_ = [];
|
|
931
|
+
scope.inversePatches_ = [];
|
|
932
|
+
scope.patchListener_ = patchListener;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
function revokeScope(scope) {
|
|
936
|
+
leaveScope(scope);
|
|
937
|
+
scope.drafts_.forEach(revokeDraft);
|
|
938
|
+
scope.drafts_ = null;
|
|
939
|
+
}
|
|
940
|
+
function leaveScope(scope) {
|
|
941
|
+
if (scope === currentScope) currentScope = scope.parent_;
|
|
942
|
+
}
|
|
943
|
+
function enterScope(immer2) {
|
|
944
|
+
return currentScope = createScope(currentScope, immer2);
|
|
945
|
+
}
|
|
946
|
+
function revokeDraft(draft) {
|
|
947
|
+
const state = draft[DRAFT_STATE];
|
|
948
|
+
if (state.type_ === 0 || state.type_ === 1) state.revoke_();
|
|
949
|
+
else state.revoked_ = true;
|
|
950
|
+
}
|
|
951
|
+
function processResult(result, scope) {
|
|
952
|
+
scope.unfinalizedDrafts_ = scope.drafts_.length;
|
|
953
|
+
const baseDraft = scope.drafts_[0];
|
|
954
|
+
if (result !== void 0 && result !== baseDraft) {
|
|
955
|
+
if (baseDraft[DRAFT_STATE].modified_) {
|
|
956
|
+
revokeScope(scope);
|
|
957
|
+
die(4);
|
|
958
|
+
}
|
|
959
|
+
if (isDraftable(result)) {
|
|
960
|
+
result = finalize(scope, result);
|
|
961
|
+
if (!scope.parent_) maybeFreeze(scope, result);
|
|
962
|
+
}
|
|
963
|
+
if (scope.patches_) getPlugin("Patches").generateReplacementPatches_(baseDraft[DRAFT_STATE].base_, result, scope.patches_, scope.inversePatches_);
|
|
964
|
+
} else result = finalize(scope, baseDraft, []);
|
|
965
|
+
revokeScope(scope);
|
|
966
|
+
if (scope.patches_) scope.patchListener_(scope.patches_, scope.inversePatches_);
|
|
967
|
+
return result !== NOTHING ? result : void 0;
|
|
968
|
+
}
|
|
969
|
+
function finalize(rootScope, value, path) {
|
|
970
|
+
if (isFrozen(value)) return value;
|
|
971
|
+
const state = value[DRAFT_STATE];
|
|
972
|
+
if (!state) {
|
|
973
|
+
each(value, (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path));
|
|
974
|
+
return value;
|
|
975
|
+
}
|
|
976
|
+
if (state.scope_ !== rootScope) return value;
|
|
977
|
+
if (!state.modified_) {
|
|
978
|
+
maybeFreeze(rootScope, state.base_, true);
|
|
979
|
+
return state.base_;
|
|
980
|
+
}
|
|
981
|
+
if (!state.finalized_) {
|
|
982
|
+
state.finalized_ = true;
|
|
983
|
+
state.scope_.unfinalizedDrafts_--;
|
|
984
|
+
const result = state.copy_;
|
|
985
|
+
let resultEach = result;
|
|
986
|
+
let isSet2 = false;
|
|
987
|
+
if (state.type_ === 3) {
|
|
988
|
+
resultEach = new Set(result);
|
|
989
|
+
result.clear();
|
|
990
|
+
isSet2 = true;
|
|
991
|
+
}
|
|
992
|
+
each(resultEach, (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2));
|
|
993
|
+
maybeFreeze(rootScope, result, false);
|
|
994
|
+
if (path && rootScope.patches_) getPlugin("Patches").generatePatches_(state, path, rootScope.patches_, rootScope.inversePatches_);
|
|
995
|
+
}
|
|
996
|
+
return state.copy_;
|
|
997
|
+
}
|
|
998
|
+
function finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {
|
|
999
|
+
if (isDraft(childValue)) {
|
|
1000
|
+
const res = finalize(rootScope, childValue, rootPath && parentState && parentState.type_ !== 3 && !has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0);
|
|
1001
|
+
set(targetObject, prop, res);
|
|
1002
|
+
if (isDraft(res)) rootScope.canAutoFreeze_ = false;
|
|
1003
|
+
else return;
|
|
1004
|
+
} else if (targetIsSet) targetObject.add(childValue);
|
|
1005
|
+
if (isDraftable(childValue) && !isFrozen(childValue)) {
|
|
1006
|
+
if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) return;
|
|
1007
|
+
finalize(rootScope, childValue);
|
|
1008
|
+
if ((!parentState || !parentState.scope_.parent_) && typeof prop !== "symbol" && Object.prototype.propertyIsEnumerable.call(targetObject, prop)) maybeFreeze(rootScope, childValue);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
function maybeFreeze(scope, value, deep = false) {
|
|
1012
|
+
if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) freeze(value, deep);
|
|
1013
|
+
}
|
|
1014
|
+
function createProxyProxy(base, parent) {
|
|
1015
|
+
const isArray = Array.isArray(base);
|
|
1016
|
+
const state = {
|
|
1017
|
+
type_: isArray ? 1 : 0,
|
|
1018
|
+
scope_: parent ? parent.scope_ : getCurrentScope(),
|
|
1019
|
+
modified_: false,
|
|
1020
|
+
finalized_: false,
|
|
1021
|
+
assigned_: {},
|
|
1022
|
+
parent_: parent,
|
|
1023
|
+
base_: base,
|
|
1024
|
+
draft_: null,
|
|
1025
|
+
copy_: null,
|
|
1026
|
+
revoke_: null,
|
|
1027
|
+
isManual_: false
|
|
1028
|
+
};
|
|
1029
|
+
let target = state;
|
|
1030
|
+
let traps = objectTraps;
|
|
1031
|
+
if (isArray) {
|
|
1032
|
+
target = [state];
|
|
1033
|
+
traps = arrayTraps;
|
|
1034
|
+
}
|
|
1035
|
+
const { revoke, proxy } = Proxy.revocable(target, traps);
|
|
1036
|
+
state.draft_ = proxy;
|
|
1037
|
+
state.revoke_ = revoke;
|
|
1038
|
+
return proxy;
|
|
1039
|
+
}
|
|
1040
|
+
var objectTraps = {
|
|
1041
|
+
get(state, prop) {
|
|
1042
|
+
if (prop === DRAFT_STATE) return state;
|
|
1043
|
+
const source = latest(state);
|
|
1044
|
+
if (!has(source, prop)) return readPropFromProto(state, source, prop);
|
|
1045
|
+
const value = source[prop];
|
|
1046
|
+
if (state.finalized_ || !isDraftable(value)) return value;
|
|
1047
|
+
if (value === peek(state.base_, prop)) {
|
|
1048
|
+
prepareCopy(state);
|
|
1049
|
+
return state.copy_[prop] = createProxy(value, state);
|
|
1050
|
+
}
|
|
1051
|
+
return value;
|
|
1052
|
+
},
|
|
1053
|
+
has(state, prop) {
|
|
1054
|
+
return prop in latest(state);
|
|
1055
|
+
},
|
|
1056
|
+
ownKeys(state) {
|
|
1057
|
+
return Reflect.ownKeys(latest(state));
|
|
1058
|
+
},
|
|
1059
|
+
set(state, prop, value) {
|
|
1060
|
+
const desc = getDescriptorFromProto(latest(state), prop);
|
|
1061
|
+
if (desc?.set) {
|
|
1062
|
+
desc.set.call(state.draft_, value);
|
|
1063
|
+
return true;
|
|
1064
|
+
}
|
|
1065
|
+
if (!state.modified_) {
|
|
1066
|
+
const current2 = peek(latest(state), prop);
|
|
1067
|
+
const currentState = current2?.[DRAFT_STATE];
|
|
1068
|
+
if (currentState && currentState.base_ === value) {
|
|
1069
|
+
state.copy_[prop] = value;
|
|
1070
|
+
state.assigned_[prop] = false;
|
|
1071
|
+
return true;
|
|
1072
|
+
}
|
|
1073
|
+
if (is(value, current2) && (value !== void 0 || has(state.base_, prop))) return true;
|
|
1074
|
+
prepareCopy(state);
|
|
1075
|
+
markChanged(state);
|
|
1076
|
+
}
|
|
1077
|
+
if (state.copy_[prop] === value && (value !== void 0 || prop in state.copy_) || Number.isNaN(value) && Number.isNaN(state.copy_[prop])) return true;
|
|
1078
|
+
state.copy_[prop] = value;
|
|
1079
|
+
state.assigned_[prop] = true;
|
|
1080
|
+
return true;
|
|
1081
|
+
},
|
|
1082
|
+
deleteProperty(state, prop) {
|
|
1083
|
+
if (peek(state.base_, prop) !== void 0 || prop in state.base_) {
|
|
1084
|
+
state.assigned_[prop] = false;
|
|
1085
|
+
prepareCopy(state);
|
|
1086
|
+
markChanged(state);
|
|
1087
|
+
} else delete state.assigned_[prop];
|
|
1088
|
+
if (state.copy_) delete state.copy_[prop];
|
|
1089
|
+
return true;
|
|
1090
|
+
},
|
|
1091
|
+
getOwnPropertyDescriptor(state, prop) {
|
|
1092
|
+
const owner = latest(state);
|
|
1093
|
+
const desc = Reflect.getOwnPropertyDescriptor(owner, prop);
|
|
1094
|
+
if (!desc) return desc;
|
|
1095
|
+
return {
|
|
1096
|
+
writable: true,
|
|
1097
|
+
configurable: state.type_ !== 1 || prop !== "length",
|
|
1098
|
+
enumerable: desc.enumerable,
|
|
1099
|
+
value: owner[prop]
|
|
1100
|
+
};
|
|
1101
|
+
},
|
|
1102
|
+
defineProperty() {
|
|
1103
|
+
die(11);
|
|
1104
|
+
},
|
|
1105
|
+
getPrototypeOf(state) {
|
|
1106
|
+
return getPrototypeOf(state.base_);
|
|
1107
|
+
},
|
|
1108
|
+
setPrototypeOf() {
|
|
1109
|
+
die(12);
|
|
1110
|
+
}
|
|
1111
|
+
};
|
|
1112
|
+
var arrayTraps = {};
|
|
1113
|
+
each(objectTraps, (key, fn) => {
|
|
1114
|
+
arrayTraps[key] = function() {
|
|
1115
|
+
arguments[0] = arguments[0][0];
|
|
1116
|
+
return fn.apply(this, arguments);
|
|
1117
|
+
};
|
|
1118
|
+
});
|
|
1119
|
+
arrayTraps.deleteProperty = function(state, prop) {
|
|
1120
|
+
return arrayTraps.set.call(this, state, prop, void 0);
|
|
1121
|
+
};
|
|
1122
|
+
arrayTraps.set = function(state, prop, value) {
|
|
1123
|
+
return objectTraps.set.call(this, state[0], prop, value, state[0]);
|
|
1124
|
+
};
|
|
1125
|
+
function peek(draft, prop) {
|
|
1126
|
+
const state = draft[DRAFT_STATE];
|
|
1127
|
+
return (state ? latest(state) : draft)[prop];
|
|
1128
|
+
}
|
|
1129
|
+
function readPropFromProto(state, source, prop) {
|
|
1130
|
+
const desc = getDescriptorFromProto(source, prop);
|
|
1131
|
+
return desc ? `value` in desc ? desc.value : desc.get?.call(state.draft_) : void 0;
|
|
1132
|
+
}
|
|
1133
|
+
function getDescriptorFromProto(source, prop) {
|
|
1134
|
+
if (!(prop in source)) return void 0;
|
|
1135
|
+
let proto = getPrototypeOf(source);
|
|
1136
|
+
while (proto) {
|
|
1137
|
+
const desc = Object.getOwnPropertyDescriptor(proto, prop);
|
|
1138
|
+
if (desc) return desc;
|
|
1139
|
+
proto = getPrototypeOf(proto);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
function markChanged(state) {
|
|
1143
|
+
if (!state.modified_) {
|
|
1144
|
+
state.modified_ = true;
|
|
1145
|
+
if (state.parent_) markChanged(state.parent_);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
function prepareCopy(state) {
|
|
1149
|
+
if (!state.copy_) state.copy_ = shallowCopy(state.base_, state.scope_.immer_.useStrictShallowCopy_);
|
|
1150
|
+
}
|
|
1151
|
+
var Immer2 = class {
|
|
1152
|
+
constructor(config) {
|
|
1153
|
+
this.autoFreeze_ = true;
|
|
1154
|
+
this.useStrictShallowCopy_ = false;
|
|
1155
|
+
/**
|
|
1156
|
+
* The `produce` function takes a value and a "recipe function" (whose
|
|
1157
|
+
* return value often depends on the base state). The recipe function is
|
|
1158
|
+
* free to mutate its first argument however it wants. All mutations are
|
|
1159
|
+
* only ever applied to a __copy__ of the base state.
|
|
1160
|
+
*
|
|
1161
|
+
* Pass only a function to create a "curried producer" which relieves you
|
|
1162
|
+
* from passing the recipe function every time.
|
|
1163
|
+
*
|
|
1164
|
+
* Only plain objects and arrays are made mutable. All other objects are
|
|
1165
|
+
* considered uncopyable.
|
|
1166
|
+
*
|
|
1167
|
+
* Note: This function is __bound__ to its `Immer` instance.
|
|
1168
|
+
*
|
|
1169
|
+
* @param {any} base - the initial state
|
|
1170
|
+
* @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified
|
|
1171
|
+
* @param {Function} patchListener - optional function that will be called with all the patches produced here
|
|
1172
|
+
* @returns {any} a new state, or the initial state if nothing was modified
|
|
1173
|
+
*/
|
|
1174
|
+
this.produce = (base, recipe, patchListener) => {
|
|
1175
|
+
if (typeof base === "function" && typeof recipe !== "function") {
|
|
1176
|
+
const defaultBase = recipe;
|
|
1177
|
+
recipe = base;
|
|
1178
|
+
const self = this;
|
|
1179
|
+
return function curriedProduce(base2 = defaultBase, ...args) {
|
|
1180
|
+
return self.produce(base2, (draft) => recipe.call(this, draft, ...args));
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
if (typeof recipe !== "function") die(6);
|
|
1184
|
+
if (patchListener !== void 0 && typeof patchListener !== "function") die(7);
|
|
1185
|
+
let result;
|
|
1186
|
+
if (isDraftable(base)) {
|
|
1187
|
+
const scope = enterScope(this);
|
|
1188
|
+
const proxy = createProxy(base, void 0);
|
|
1189
|
+
let hasError = true;
|
|
1190
|
+
try {
|
|
1191
|
+
result = recipe(proxy);
|
|
1192
|
+
hasError = false;
|
|
1193
|
+
} finally {
|
|
1194
|
+
if (hasError) revokeScope(scope);
|
|
1195
|
+
else leaveScope(scope);
|
|
1196
|
+
}
|
|
1197
|
+
usePatchesInScope(scope, patchListener);
|
|
1198
|
+
return processResult(result, scope);
|
|
1199
|
+
} else if (!base || typeof base !== "object") {
|
|
1200
|
+
result = recipe(base);
|
|
1201
|
+
if (result === void 0) result = base;
|
|
1202
|
+
if (result === NOTHING) result = void 0;
|
|
1203
|
+
if (this.autoFreeze_) freeze(result, true);
|
|
1204
|
+
if (patchListener) {
|
|
1205
|
+
const p = [];
|
|
1206
|
+
const ip = [];
|
|
1207
|
+
getPlugin("Patches").generateReplacementPatches_(base, result, p, ip);
|
|
1208
|
+
patchListener(p, ip);
|
|
1209
|
+
}
|
|
1210
|
+
return result;
|
|
1211
|
+
} else die(1, base);
|
|
1212
|
+
};
|
|
1213
|
+
this.produceWithPatches = (base, recipe) => {
|
|
1214
|
+
if (typeof base === "function") return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));
|
|
1215
|
+
let patches, inversePatches;
|
|
1216
|
+
return [
|
|
1217
|
+
this.produce(base, recipe, (p, ip) => {
|
|
1218
|
+
patches = p;
|
|
1219
|
+
inversePatches = ip;
|
|
1220
|
+
}),
|
|
1221
|
+
patches,
|
|
1222
|
+
inversePatches
|
|
1223
|
+
];
|
|
1224
|
+
};
|
|
1225
|
+
if (typeof config?.autoFreeze === "boolean") this.setAutoFreeze(config.autoFreeze);
|
|
1226
|
+
if (typeof config?.useStrictShallowCopy === "boolean") this.setUseStrictShallowCopy(config.useStrictShallowCopy);
|
|
1227
|
+
}
|
|
1228
|
+
createDraft(base) {
|
|
1229
|
+
if (!isDraftable(base)) die(8);
|
|
1230
|
+
if (isDraft(base)) base = current(base);
|
|
1231
|
+
const scope = enterScope(this);
|
|
1232
|
+
const proxy = createProxy(base, void 0);
|
|
1233
|
+
proxy[DRAFT_STATE].isManual_ = true;
|
|
1234
|
+
leaveScope(scope);
|
|
1235
|
+
return proxy;
|
|
1236
|
+
}
|
|
1237
|
+
finishDraft(draft, patchListener) {
|
|
1238
|
+
const state = draft && draft[DRAFT_STATE];
|
|
1239
|
+
if (!state || !state.isManual_) die(9);
|
|
1240
|
+
const { scope_: scope } = state;
|
|
1241
|
+
usePatchesInScope(scope, patchListener);
|
|
1242
|
+
return processResult(void 0, scope);
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Pass true to automatically freeze all copies created by Immer.
|
|
1246
|
+
*
|
|
1247
|
+
* By default, auto-freezing is enabled.
|
|
1248
|
+
*/
|
|
1249
|
+
setAutoFreeze(value) {
|
|
1250
|
+
this.autoFreeze_ = value;
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* Pass true to enable strict shallow copy.
|
|
1254
|
+
*
|
|
1255
|
+
* By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
|
|
1256
|
+
*/
|
|
1257
|
+
setUseStrictShallowCopy(value) {
|
|
1258
|
+
this.useStrictShallowCopy_ = value;
|
|
1259
|
+
}
|
|
1260
|
+
applyPatches(base, patches) {
|
|
1261
|
+
let i;
|
|
1262
|
+
for (i = patches.length - 1; i >= 0; i--) {
|
|
1263
|
+
const patch = patches[i];
|
|
1264
|
+
if (patch.path.length === 0 && patch.op === "replace") {
|
|
1265
|
+
base = patch.value;
|
|
1266
|
+
break;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
if (i > -1) patches = patches.slice(i + 1);
|
|
1270
|
+
const applyPatchesImpl = getPlugin("Patches").applyPatches_;
|
|
1271
|
+
if (isDraft(base)) return applyPatchesImpl(base, patches);
|
|
1272
|
+
return this.produce(base, (draft) => applyPatchesImpl(draft, patches));
|
|
1273
|
+
}
|
|
1274
|
+
};
|
|
1275
|
+
function createProxy(value, parent) {
|
|
1276
|
+
const draft = isMap(value) ? getPlugin("MapSet").proxyMap_(value, parent) : isSet(value) ? getPlugin("MapSet").proxySet_(value, parent) : createProxyProxy(value, parent);
|
|
1277
|
+
(parent ? parent.scope_ : getCurrentScope()).drafts_.push(draft);
|
|
1278
|
+
return draft;
|
|
1279
|
+
}
|
|
1280
|
+
function current(value) {
|
|
1281
|
+
if (!isDraft(value)) die(10, value);
|
|
1282
|
+
return currentImpl(value);
|
|
1283
|
+
}
|
|
1284
|
+
function currentImpl(value) {
|
|
1285
|
+
if (!isDraftable(value) || isFrozen(value)) return value;
|
|
1286
|
+
const state = value[DRAFT_STATE];
|
|
1287
|
+
let copy;
|
|
1288
|
+
if (state) {
|
|
1289
|
+
if (!state.modified_) return state.base_;
|
|
1290
|
+
state.finalized_ = true;
|
|
1291
|
+
copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);
|
|
1292
|
+
} else copy = shallowCopy(value, true);
|
|
1293
|
+
each(copy, (key, childValue) => {
|
|
1294
|
+
set(copy, key, currentImpl(childValue));
|
|
1295
|
+
});
|
|
1296
|
+
if (state) state.finalized_ = false;
|
|
1297
|
+
return copy;
|
|
1298
|
+
}
|
|
1299
|
+
var immer = new Immer2();
|
|
1300
|
+
var produce = immer.produce;
|
|
1301
|
+
immer.produceWithPatches.bind(immer);
|
|
1302
|
+
immer.setAutoFreeze.bind(immer);
|
|
1303
|
+
immer.setUseStrictShallowCopy.bind(immer);
|
|
1304
|
+
immer.applyPatches.bind(immer);
|
|
1305
|
+
immer.createDraft.bind(immer);
|
|
1306
|
+
immer.finishDraft.bind(immer);
|
|
1307
|
+
//#endregion
|
|
1308
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-sto_4dc585899bc1cce22770d5d315f9a979/node_modules/@deepseek-ai/dsh-client-store/lib/index.js
|
|
1309
|
+
/**
|
|
1310
|
+
* React-free snapshot store engine (zustand vanilla + immer + subscribeWithSelector +
|
|
1311
|
+
* rafFlush middleware + opt-in persist + dev freeze) plus the declarative
|
|
1312
|
+
* shell over it: {@link defineStore} bakes an init/persist/actions literal
|
|
1313
|
+
* into a {@link StoreHandle}, the registration-side store seat of slot
|
|
1314
|
+
* terminals. Engine products are bare observables — subscribe/getSnapshot/
|
|
1315
|
+
* update/set, NO selector hook. Hook synthesis is ui-renderer's (the one
|
|
1316
|
+
* uSES bridge, cached per source at the binding site).
|
|
1317
|
+
*/
|
|
1318
|
+
/**
|
|
1319
|
+
* Notify an observer set without allowing one callback to starve the rest.
|
|
1320
|
+
* @param listeners - current observer callbacks; copied before dispatch.
|
|
1321
|
+
* @param label - diagnostic owner prefix.
|
|
1322
|
+
* @param args - callback arguments.
|
|
1323
|
+
*/
|
|
1324
|
+
function notifySubscribers(listeners, label, ...args) {
|
|
1325
|
+
for (const listener of [...listeners]) try {
|
|
1326
|
+
listener(...args);
|
|
1327
|
+
} catch (error) {
|
|
1328
|
+
console.error(`${label} subscriber failed:`, error);
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
/** Batches subscriber notification into one flush per animation frame. */
|
|
1332
|
+
function rafBatch(notify) {
|
|
1333
|
+
const schedule = typeof requestAnimationFrame === "function" ? (fn) => {
|
|
1334
|
+
requestAnimationFrame(() => {
|
|
1335
|
+
fn();
|
|
1336
|
+
});
|
|
1337
|
+
} : (fn) => {
|
|
1338
|
+
queueMicrotask(fn);
|
|
1339
|
+
};
|
|
1340
|
+
let scheduled = false;
|
|
1341
|
+
return () => {
|
|
1342
|
+
if (scheduled) return;
|
|
1343
|
+
scheduled = true;
|
|
1344
|
+
schedule(() => {
|
|
1345
|
+
scheduled = false;
|
|
1346
|
+
notify();
|
|
1347
|
+
});
|
|
1348
|
+
};
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Create a snapshot store.
|
|
1352
|
+
*
|
|
1353
|
+
* Flush default is 'sync' (controlled inputs need same-tick echo); frame-driven
|
|
1354
|
+
* stores opt into 'raf', where a frame's worth of updates coalesces into one
|
|
1355
|
+
* notification. Known raf-mode tradeoff: a component mounting mid-frame reads
|
|
1356
|
+
* fresh state while existing subscribers hear it next flush — transient
|
|
1357
|
+
* frame-level skew, same nature as the object layer's microtask batching.
|
|
1358
|
+
*
|
|
1359
|
+
* @param init - initial state.
|
|
1360
|
+
* @param opts - flush mode and opt-in persistence (localStorage, keyed by name).
|
|
1361
|
+
* @returns the store.
|
|
1362
|
+
*/
|
|
1363
|
+
function createSnapshotStore(init, opts) {
|
|
1364
|
+
const withSelector = subscribeWithSelector(() => init);
|
|
1365
|
+
const api = createStore()(withSelector);
|
|
1366
|
+
if (opts?.persist) attachPersistence(api, opts.persist.name);
|
|
1367
|
+
let subscribe = (fn) => api.subscribe(() => {
|
|
1368
|
+
notifySubscribers([fn], "[client-store]");
|
|
1369
|
+
});
|
|
1370
|
+
if (opts?.flush === "raf") {
|
|
1371
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
1372
|
+
const flush = rafBatch(() => {
|
|
1373
|
+
notifySubscribers(listeners, "[client-store]");
|
|
1374
|
+
});
|
|
1375
|
+
api.subscribe(flush);
|
|
1376
|
+
subscribe = (fn) => {
|
|
1377
|
+
listeners.add(fn);
|
|
1378
|
+
return () => {
|
|
1379
|
+
listeners.delete(fn);
|
|
1380
|
+
};
|
|
1381
|
+
};
|
|
1382
|
+
}
|
|
1383
|
+
return {
|
|
1384
|
+
getSnapshot: () => api.getState(),
|
|
1385
|
+
subscribe: (fn) => subscribe(fn),
|
|
1386
|
+
update: (mutator) => {
|
|
1387
|
+
api.setState(produce(api.getState(), (draft) => {
|
|
1388
|
+
mutator(draft);
|
|
1389
|
+
}), true);
|
|
1390
|
+
},
|
|
1391
|
+
set: (next) => {
|
|
1392
|
+
api.setState(devFreeze(next), true);
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* Whole-value JSON persistence to localStorage. Hand-rolled instead of the
|
|
1398
|
+
* zustand persist middleware: its write path spreads state into an object
|
|
1399
|
+
* (`partialize({ ...get() })`), exploding primitive state (a persisted string
|
|
1400
|
+
* draft becomes {0:'h',1:'e',...}) — not fixable via merge/deserialize options
|
|
1401
|
+
* because the corruption happens before serialization. Storage failures
|
|
1402
|
+
* (quota, private mode) only disable persistence, never break the store.
|
|
1403
|
+
*/
|
|
1404
|
+
function attachPersistence(api, name) {
|
|
1405
|
+
if (typeof localStorage === "undefined") return;
|
|
1406
|
+
try {
|
|
1407
|
+
const raw = localStorage.getItem(name);
|
|
1408
|
+
if (raw !== null) api.setState(devFreeze(JSON.parse(raw)), true);
|
|
1409
|
+
} catch (error) {
|
|
1410
|
+
console.error(`snapshot store '${name}' rehydration failed:`, error);
|
|
1411
|
+
}
|
|
1412
|
+
api.subscribe((state) => {
|
|
1413
|
+
try {
|
|
1414
|
+
localStorage.setItem(name, JSON.stringify(state));
|
|
1415
|
+
} catch (error) {
|
|
1416
|
+
console.error(`snapshot store '${name}' persistence failed:`, error);
|
|
1417
|
+
}
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
/** Deep-freeze draftable wholesale-set state outside production: set() bypasses immer's freeze. */
|
|
1421
|
+
function devFreeze(value) {
|
|
1422
|
+
return freeze(value, true);
|
|
1423
|
+
}
|
|
1424
|
+
//#endregion
|
|
1425
|
+
//#region ../core/src/windows.ts
|
|
1426
|
+
const DEFAULT_MULTIPLIER = {
|
|
1427
|
+
peak: 2,
|
|
1428
|
+
off: 1,
|
|
1429
|
+
custom: 1
|
|
1430
|
+
};
|
|
1431
|
+
function systemTimeZone() {
|
|
1432
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1433
|
+
}
|
|
1434
|
+
function minutesOf$1(hhmm) {
|
|
1435
|
+
const match = /^(\d{1,2}):(\d{2})$/.exec(hhmm);
|
|
1436
|
+
if (match === null) throw new Error(`invalid HH:MM time "${hhmm}"`);
|
|
1437
|
+
const h = Number(match[1]);
|
|
1438
|
+
const m = Number(match[2]);
|
|
1439
|
+
if (h > 23 || m > 59) throw new Error(`invalid HH:MM time "${hhmm}"`);
|
|
1440
|
+
return h * 60 + m;
|
|
1441
|
+
}
|
|
1442
|
+
/** Local HH:MM minutes + ISO weekday of a Date in an IANA timezone. */
|
|
1443
|
+
function localParts(when, tz) {
|
|
1444
|
+
let parts;
|
|
1445
|
+
try {
|
|
1446
|
+
parts = new Intl.DateTimeFormat("en-US", {
|
|
1447
|
+
timeZone: tz,
|
|
1448
|
+
hour: "2-digit",
|
|
1449
|
+
minute: "2-digit",
|
|
1450
|
+
weekday: "short",
|
|
1451
|
+
hourCycle: "h23",
|
|
1452
|
+
hour12: false
|
|
1453
|
+
}).formatToParts(when);
|
|
1454
|
+
} catch {
|
|
1455
|
+
parts = new Intl.DateTimeFormat("en-US", {
|
|
1456
|
+
timeZone: systemTimeZone(),
|
|
1457
|
+
hour: "2-digit",
|
|
1458
|
+
minute: "2-digit",
|
|
1459
|
+
weekday: "short",
|
|
1460
|
+
hourCycle: "h23",
|
|
1461
|
+
hour12: false
|
|
1462
|
+
}).formatToParts(when);
|
|
1463
|
+
}
|
|
1464
|
+
let hour = 0;
|
|
1465
|
+
let minute = 0;
|
|
1466
|
+
let weekday = 1;
|
|
1467
|
+
for (const part of parts) {
|
|
1468
|
+
if (part.type === "hour") {
|
|
1469
|
+
const h = Number(part.value);
|
|
1470
|
+
hour = Number.isFinite(h) ? h === 24 ? 0 : h : 0;
|
|
1471
|
+
}
|
|
1472
|
+
if (part.type === "minute") {
|
|
1473
|
+
const m = Number(part.value);
|
|
1474
|
+
minute = Number.isFinite(m) ? m : 0;
|
|
1475
|
+
}
|
|
1476
|
+
if (part.type === "weekday") weekday = {
|
|
1477
|
+
Mon: 1,
|
|
1478
|
+
Tue: 2,
|
|
1479
|
+
Wed: 3,
|
|
1480
|
+
Thu: 4,
|
|
1481
|
+
Fri: 5,
|
|
1482
|
+
Sat: 6,
|
|
1483
|
+
Sun: 7
|
|
1484
|
+
}[part.value] ?? 1;
|
|
1485
|
+
}
|
|
1486
|
+
return {
|
|
1487
|
+
minutes: hour * 60 + minute,
|
|
1488
|
+
weekday
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
function matchesDays(days, weekday) {
|
|
1492
|
+
if (days === void 0 || days.length === 0) return true;
|
|
1493
|
+
return days.includes(weekday);
|
|
1494
|
+
}
|
|
1495
|
+
/** Whether `minutes` falls inside [start, end), with midnight-crossing support. */
|
|
1496
|
+
function inRange(minutes, start, end) {
|
|
1497
|
+
if (end > start) return minutes >= start && minutes < end;
|
|
1498
|
+
if (end < start) return minutes >= start || minutes < end;
|
|
1499
|
+
return true;
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* Resolve the active window at `when` (array order = precedence).
|
|
1503
|
+
* Returns null when no window covers the moment.
|
|
1504
|
+
*/
|
|
1505
|
+
function levelAt(when, windows, defaultTz = systemTimeZone()) {
|
|
1506
|
+
for (const window of windows) {
|
|
1507
|
+
const { minutes, weekday } = localParts(when, window.tz ?? defaultTz);
|
|
1508
|
+
if (!matchesDays(window.days, weekday)) continue;
|
|
1509
|
+
if (inRange(minutes, minutesOf$1(window.start), minutesOf$1(window.end))) return {
|
|
1510
|
+
level: window.level,
|
|
1511
|
+
multiplier: window.multiplier ?? DEFAULT_MULTIPLIER[window.level],
|
|
1512
|
+
window
|
|
1513
|
+
};
|
|
1514
|
+
}
|
|
1515
|
+
return null;
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* The next moment the active level may change after `when`: the earliest
|
|
1519
|
+
* future boundary among every window's start and end (calendar-based, per
|
|
1520
|
+
* window tz, weekday-aware).
|
|
1521
|
+
*
|
|
1522
|
+
* The client tier clock uses this to flip a displayed 闲时/忙时 exactly at the
|
|
1523
|
+
* boundary — even when no host frame ever arrives (a stalled push stream must
|
|
1524
|
+
* never freeze the indicator). Scanning mirrors `nextOffPeakStart`: day steps
|
|
1525
|
+
* go through `addDaysInTz` so DST/midnight-crossing windows stay correct.
|
|
1526
|
+
*
|
|
1527
|
+
* Returns null when no boundary is reachable within 8 days (e.g. no windows).
|
|
1528
|
+
*/
|
|
1529
|
+
function nextLevelChangeAt(when, windows, defaultTz = systemTimeZone()) {
|
|
1530
|
+
let best = null;
|
|
1531
|
+
for (let day = 0; day < 8; day++) {
|
|
1532
|
+
for (const window of windows) {
|
|
1533
|
+
const tz = window.tz ?? defaultTz;
|
|
1534
|
+
const probe = addDaysInTz(when, tz, day);
|
|
1535
|
+
const { minutes, weekday } = localParts(probe, tz);
|
|
1536
|
+
if (!matchesDays(window.days, weekday)) continue;
|
|
1537
|
+
const start = minutesOf$1(window.start);
|
|
1538
|
+
const end = minutesOf$1(window.end);
|
|
1539
|
+
const boundaries = end === start ? [start] : [start, end];
|
|
1540
|
+
for (const boundary of boundaries) {
|
|
1541
|
+
const candidate = new Date(probe.getTime() + (boundary - minutes) * 6e4);
|
|
1542
|
+
if (candidate.getTime() > when.getTime() && (best === null || candidate.getTime() < best.getTime())) best = candidate;
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
if (best !== null) break;
|
|
1546
|
+
}
|
|
1547
|
+
return best;
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* The instant when the calendar day containing `probe` (in `tz`) begins.
|
|
1551
|
+
*
|
|
1552
|
+
* Wall-clock subtraction breaks on DST spring-forward days (23h): walking
|
|
1553
|
+
* back N minutes from 05:00 PDT lands at 23:00 PST the previous day. Instead
|
|
1554
|
+
* we binary-search the earliest UTC instant whose tz calendar day equals the
|
|
1555
|
+
* probe's — the tz day is monotonic in UTC, so the boundary IS local 00:00.
|
|
1556
|
+
*/
|
|
1557
|
+
function dayStartInTz(probe, tz) {
|
|
1558
|
+
const targetDay = daySerial(probe, tz);
|
|
1559
|
+
let lo = /* @__PURE__ */ new Date(probe.getTime() - 936e5);
|
|
1560
|
+
let hi = probe;
|
|
1561
|
+
for (let i = 0; i < 32; i++) {
|
|
1562
|
+
const mid = /* @__PURE__ */ new Date((lo.getTime() + hi.getTime()) / 2);
|
|
1563
|
+
if (daySerial(mid, tz) === targetDay) hi = mid;
|
|
1564
|
+
else lo = mid;
|
|
1565
|
+
}
|
|
1566
|
+
return hi;
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* The calendar-day start `days` days after/before the day containing `probe`
|
|
1570
|
+
* (in `tz`). Steps via a noon-ish probe so DST ±1h days cannot misalign.
|
|
1571
|
+
*/
|
|
1572
|
+
function addDaysInTz(probe, tz, days) {
|
|
1573
|
+
const day0 = dayStartInTz(probe, tz);
|
|
1574
|
+
return dayStartInTz(new Date(day0.getTime() + (days * 24 + 12) * 36e5), tz);
|
|
1575
|
+
}
|
|
1576
|
+
/** Calendar-day serial (YYYY-MM-DD) of an instant in a tz. */
|
|
1577
|
+
function daySerial(when, tz) {
|
|
1578
|
+
try {
|
|
1579
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
1580
|
+
timeZone: tz,
|
|
1581
|
+
year: "numeric",
|
|
1582
|
+
month: "2-digit",
|
|
1583
|
+
day: "2-digit"
|
|
1584
|
+
}).format(when);
|
|
1585
|
+
} catch {
|
|
1586
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
1587
|
+
timeZone: systemTimeZone(),
|
|
1588
|
+
year: "numeric",
|
|
1589
|
+
month: "2-digit",
|
|
1590
|
+
day: "2-digit"
|
|
1591
|
+
}).format(when);
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
//#endregion
|
|
1595
|
+
//#region ../core/src/pricing.ts
|
|
1596
|
+
/** Canonical id of the current official flash model (V4.1-Flash, multimodal). */
|
|
1597
|
+
const FLASH_MODEL_ID = "deepseek-flash";
|
|
1598
|
+
const OFFICIAL_PRICES = {
|
|
1599
|
+
[FLASH_MODEL_ID]: {
|
|
1600
|
+
peak: {
|
|
1601
|
+
input: 2,
|
|
1602
|
+
inputCached: .04,
|
|
1603
|
+
output: 8
|
|
1604
|
+
},
|
|
1605
|
+
off: {
|
|
1606
|
+
input: 1,
|
|
1607
|
+
inputCached: .02,
|
|
1608
|
+
output: 4
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1611
|
+
"deepseek-v4-pro": {
|
|
1612
|
+
peak: {
|
|
1613
|
+
input: 9,
|
|
1614
|
+
inputCached: .3,
|
|
1615
|
+
output: 27
|
|
1616
|
+
},
|
|
1617
|
+
off: {
|
|
1618
|
+
input: 4.5,
|
|
1619
|
+
inputCached: .15,
|
|
1620
|
+
output: 13.5
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
/**
|
|
1625
|
+
* Legacy model ids that DeepSeek still accepts but has retired: requests are
|
|
1626
|
+
* served by DeepSeek-V4.1-Flash and billed at the Flash price (official docs,
|
|
1627
|
+
* 2026-09-10). Mapping them keeps old persisted tasks and existing Harness
|
|
1628
|
+
* catalogs priced instead of silently falling back to "价格未知".
|
|
1629
|
+
*/
|
|
1630
|
+
const PRICE_ALIASES = {
|
|
1631
|
+
"deepseek-v4-flash": FLASH_MODEL_ID,
|
|
1632
|
+
"deepseek-v4-flash-vision-exp": FLASH_MODEL_ID
|
|
1633
|
+
};
|
|
1634
|
+
OFFICIAL_PRICES[FLASH_MODEL_ID];
|
|
1635
|
+
//#endregion
|
|
1636
|
+
//#region client/lib/tierClock.ts
|
|
1637
|
+
/**
|
|
1638
|
+
* Client-side tier clock (v0.2.2): derives the displayed 闲时/忙时 from the
|
|
1639
|
+
* CONFIGURED windows and the LOCAL clock, using the very same pure `levelAt`
|
|
1640
|
+
* the host uses (imported from lowtide-core, which is inlined into the client
|
|
1641
|
+
* bundle — it is not a `@deepseek-ai/*` platform module).
|
|
1642
|
+
*
|
|
1643
|
+
* Why this exists — the reported bug:
|
|
1644
|
+
* The price pill used to be a pure mirror of the host's pushed state. The
|
|
1645
|
+
* client disables its 4s polling as soon as the EventSource reports `open`
|
|
1646
|
+
* and had no freshness check, so ONE silently stalled stream (host restart
|
|
1647
|
+
* leaving a half-open socket, a hidden/frozen Electron window, system sleep,
|
|
1648
|
+
* a swapped SSE client) froze 闲时/忙时 forever — and `connected === false`
|
|
1649
|
+
* was invisible while a host snapshot existed. The pill simply stopped
|
|
1650
|
+
* following the clock.
|
|
1651
|
+
*
|
|
1652
|
+
* This module makes the tier a function of time, never of stream liveness:
|
|
1653
|
+
* - recomputed on every state frame (host config may change),
|
|
1654
|
+
* - recomputed on a 30s heartbeat (covers suspend/resume and clock jumps),
|
|
1655
|
+
* - recomputed exactly at the next window boundary (+1s), so a 12:00 or
|
|
1656
|
+
* 18:00 flip is visible even with zero server traffic.
|
|
1657
|
+
*/
|
|
1658
|
+
/** Longest timeout we ever arm (24.8 days is the setTimeout ceiling). */
|
|
1659
|
+
const MAX_TIMEOUT_MS = 2147483647;
|
|
1660
|
+
/**
|
|
1661
|
+
* How long the UI tolerates silence from the push stream before it stops
|
|
1662
|
+
* trusting it. The host heartbeats every 15s, so 45s = three missed frames.
|
|
1663
|
+
*/
|
|
1664
|
+
const SSE_STALE_MS = 45e3;
|
|
1665
|
+
/**
|
|
1666
|
+
* Freshness predicate for the live state stream: an OPEN EventSource is not a
|
|
1667
|
+
* HEALTHY one. `lastFrameAt === 0` means no frame has ever arrived.
|
|
1668
|
+
*/
|
|
1669
|
+
function isStreamFresh(lastFrameAt, nowMs, staleMs = SSE_STALE_MS) {
|
|
1670
|
+
return lastFrameAt > 0 && nowMs - lastFrameAt <= staleMs;
|
|
1671
|
+
}
|
|
1672
|
+
/** The off-peak fallback snapshot (also used before the first host frame). */
|
|
1673
|
+
const OFF_TIER = {
|
|
1674
|
+
level: "off",
|
|
1675
|
+
multiplier: 1,
|
|
1676
|
+
window: null
|
|
1677
|
+
};
|
|
1678
|
+
/**
|
|
1679
|
+
* Derive the tier at `now` from raw windows (own `tz`/`days` preserved — the
|
|
1680
|
+
* host sends them verbatim precisely so this stays timezone-correct for
|
|
1681
|
+
* west-hemisphere users with day-shifted windows).
|
|
1682
|
+
*/
|
|
1683
|
+
function deriveTier(windows, tz, now) {
|
|
1684
|
+
const match = levelAt(now, windows, tz);
|
|
1685
|
+
if (match === null) return OFF_TIER;
|
|
1686
|
+
return {
|
|
1687
|
+
level: match.level,
|
|
1688
|
+
multiplier: match.multiplier,
|
|
1689
|
+
window: {
|
|
1690
|
+
id: match.window.id,
|
|
1691
|
+
...match.window.label !== void 0 ? { label: match.window.label } : {},
|
|
1692
|
+
start: match.window.start,
|
|
1693
|
+
end: match.window.end
|
|
1694
|
+
}
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
/** Epoch ms of the next boundary that can change the level (null = none). */
|
|
1698
|
+
function nextBoundaryAt(windows, tz, now) {
|
|
1699
|
+
const next = nextLevelChangeAt(now, windows, tz);
|
|
1700
|
+
return next === null ? null : next.getTime();
|
|
1701
|
+
}
|
|
1702
|
+
/** Resolve the timezone to evaluate windows in (host-provided wins). */
|
|
1703
|
+
function tierTimeZone(hostTz) {
|
|
1704
|
+
if (typeof hostTz === "string" && hostTz !== "") return hostTz;
|
|
1705
|
+
return systemTimeZone();
|
|
1706
|
+
}
|
|
1707
|
+
function sameTier(a, b) {
|
|
1708
|
+
return a.level === b.level && a.multiplier === b.multiplier && (a.window?.id ?? "") === (b.window?.id ?? "") && (a.window?.start ?? "") === (b.window?.start ?? "") && (a.window?.end ?? "") === (b.window?.end ?? "");
|
|
1709
|
+
}
|
|
1710
|
+
/**
|
|
1711
|
+
* Start the tier clock. Returns a handle whose `refresh()` is called whenever a
|
|
1712
|
+
* host frame arrives; `stop()` clears both timers (wired into `ctx.effect`).
|
|
1713
|
+
*/
|
|
1714
|
+
function startTierClock(options) {
|
|
1715
|
+
const tickMs = options.tickMs ?? 3e4;
|
|
1716
|
+
const now = options.now ?? (() => Date.now());
|
|
1717
|
+
let last = OFF_TIER;
|
|
1718
|
+
let boundaryTimer = null;
|
|
1719
|
+
let stopped = false;
|
|
1720
|
+
function armBoundary() {
|
|
1721
|
+
if (boundaryTimer !== null) {
|
|
1722
|
+
clearTimeout(boundaryTimer);
|
|
1723
|
+
boundaryTimer = null;
|
|
1724
|
+
}
|
|
1725
|
+
const windows = options.getWindows();
|
|
1726
|
+
if (windows === null || windows.length === 0) return;
|
|
1727
|
+
const at = nextBoundaryAt(windows, options.getTimeZone(), new Date(now()));
|
|
1728
|
+
if (at === null) return;
|
|
1729
|
+
const delay = Math.min(Math.max(at - now() + 1e3, 250), MAX_TIMEOUT_MS);
|
|
1730
|
+
boundaryTimer = setTimeout(() => {
|
|
1731
|
+
boundaryTimer = null;
|
|
1732
|
+
refresh();
|
|
1733
|
+
}, delay);
|
|
1734
|
+
}
|
|
1735
|
+
function refresh() {
|
|
1736
|
+
if (stopped) return last;
|
|
1737
|
+
const windows = options.getWindows();
|
|
1738
|
+
if (windows === null || windows.length === 0) {
|
|
1739
|
+
armBoundary();
|
|
1740
|
+
return last;
|
|
1741
|
+
}
|
|
1742
|
+
const next = deriveTier(windows, options.getTimeZone(), new Date(now()));
|
|
1743
|
+
if (!sameTier(next, last)) {
|
|
1744
|
+
last = next;
|
|
1745
|
+
if (!stopped) options.onChange(next);
|
|
1746
|
+
}
|
|
1747
|
+
armBoundary();
|
|
1748
|
+
return last;
|
|
1749
|
+
}
|
|
1750
|
+
const heartbeat = setInterval(() => {
|
|
1751
|
+
refresh();
|
|
1752
|
+
}, tickMs);
|
|
1753
|
+
refresh();
|
|
1754
|
+
return {
|
|
1755
|
+
refresh,
|
|
1756
|
+
current: () => last,
|
|
1757
|
+
stop() {
|
|
1758
|
+
stopped = true;
|
|
1759
|
+
clearInterval(heartbeat);
|
|
1760
|
+
if (boundaryTimer !== null) {
|
|
1761
|
+
clearTimeout(boundaryTimer);
|
|
1762
|
+
boundaryTimer = null;
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1767
|
+
//#endregion
|
|
733
1768
|
//#region client/store.ts
|
|
734
1769
|
/**
|
|
735
1770
|
* Client entry store: the host state aggregate mirror + UI state.
|
|
736
1771
|
* Plain snapshot store from the runtime engine; components subscribe with
|
|
737
|
-
* useSyncExternalStore.
|
|
1772
|
+
* useSyncExternalStore.
|
|
1773
|
+
*
|
|
1774
|
+
* Live data path (v0.2.2): SSE first, 4s polling as a *freshness-gated*
|
|
1775
|
+
* fallback. `lastFrameAt` records the newest state frame from either path; a
|
|
1776
|
+
* watchdog demotes a silent-but-open stream back to polling and reconnects
|
|
1777
|
+
* with backoff, so the UI can never freeze on a half-open socket.
|
|
1778
|
+
*
|
|
1779
|
+
* The displayed 闲时/忙时 additionally comes from the local tier clock
|
|
1780
|
+
* (lib/tierClock.ts), so it keeps following the wall clock even if every
|
|
1781
|
+
* network path is down.
|
|
738
1782
|
*/
|
|
739
|
-
const lowtideStore =
|
|
1783
|
+
const lowtideStore = createSnapshotStore({
|
|
740
1784
|
host: null,
|
|
741
1785
|
connected: false,
|
|
742
1786
|
error: null,
|
|
@@ -746,7 +1790,11 @@ window.__ModuleLoader__.load({
|
|
|
746
1790
|
reportUnread: false,
|
|
747
1791
|
toast: null,
|
|
748
1792
|
lastReportId: null,
|
|
749
|
-
activeLocale: "zh"
|
|
1793
|
+
activeLocale: "zh",
|
|
1794
|
+
tier: OFF_TIER,
|
|
1795
|
+
tierAt: 0,
|
|
1796
|
+
lastFrameAt: 0,
|
|
1797
|
+
sseHealthy: false
|
|
750
1798
|
});
|
|
751
1799
|
function showToast(text) {
|
|
752
1800
|
lowtideStore.update((draft) => {
|
|
@@ -761,30 +1809,87 @@ window.__ModuleLoader__.load({
|
|
|
761
1809
|
draft.toast = null;
|
|
762
1810
|
});
|
|
763
1811
|
}
|
|
1812
|
+
/** Reset the UI slice (plugin unload) — the full field list lives here so a
|
|
1813
|
+
* new field can never be forgotten by a caller's hand-written literal. */
|
|
1814
|
+
function resetUiState() {
|
|
1815
|
+
lowtideStore.set({
|
|
1816
|
+
host: null,
|
|
1817
|
+
connected: false,
|
|
1818
|
+
error: null,
|
|
1819
|
+
queueOpen: false,
|
|
1820
|
+
reportOpen: false,
|
|
1821
|
+
reportHistoryOpen: false,
|
|
1822
|
+
reportUnread: false,
|
|
1823
|
+
toast: null,
|
|
1824
|
+
lastReportId: null,
|
|
1825
|
+
activeLocale: "zh",
|
|
1826
|
+
tier: OFF_TIER,
|
|
1827
|
+
tierAt: 0,
|
|
1828
|
+
lastFrameAt: 0,
|
|
1829
|
+
sseHealthy: false
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
764
1832
|
/** Poll the host aggregate every 4s; returns the stop function. */
|
|
765
1833
|
let pollNow = null;
|
|
766
1834
|
/** Trigger one immediate poll (used after write actions for fast refresh). */
|
|
767
1835
|
function refreshNow() {
|
|
768
1836
|
if (pollNow !== null) pollNow();
|
|
769
1837
|
}
|
|
1838
|
+
/** The tier clock started by `startPolling` (module-level so actions can poke it). */
|
|
1839
|
+
let tierClock = null;
|
|
1840
|
+
/** Re-derive the displayed tier right now (after a window edit, say). */
|
|
1841
|
+
function refreshTier() {
|
|
1842
|
+
tierClock?.refresh();
|
|
1843
|
+
}
|
|
1844
|
+
/** The windows the tier clock evaluates: host payload first, else the config
|
|
1845
|
+
* fetched by the caller (settings page), else nothing yet. */
|
|
1846
|
+
let tierWindows = null;
|
|
1847
|
+
let tierTz = null;
|
|
1848
|
+
/** Feed the clock from a config payload when no host frame is available yet. */
|
|
1849
|
+
function setTierWindows(windows, tz) {
|
|
1850
|
+
tierWindows = windows;
|
|
1851
|
+
if (tz !== void 0) tierTz = tz;
|
|
1852
|
+
tierClock?.refresh();
|
|
1853
|
+
}
|
|
770
1854
|
function applyState(state) {
|
|
1855
|
+
const frameAt = Date.now();
|
|
1856
|
+
if (Array.isArray(state.windows) && state.windows.length > 0) tierWindows = state.windows;
|
|
1857
|
+
if (typeof state.systemTz === "string" && state.systemTz !== "") tierTz = state.systemTz;
|
|
771
1858
|
lowtideStore.update((draft) => {
|
|
772
1859
|
const previous = draft.host;
|
|
773
1860
|
draft.host = state;
|
|
774
1861
|
draft.connected = true;
|
|
775
1862
|
draft.error = null;
|
|
1863
|
+
draft.lastFrameAt = frameAt;
|
|
1864
|
+
draft.sseHealthy = true;
|
|
776
1865
|
const latestId = state.latestReport?.id ?? null;
|
|
777
1866
|
if (latestId !== null && latestId !== draft.lastReportId) draft.reportUnread = true;
|
|
778
1867
|
if (latestId !== null && latestId !== draft.lastReportId && previous !== null) draft.reportUnread = true;
|
|
779
1868
|
draft.lastReportId = latestId ?? draft.lastReportId;
|
|
780
1869
|
});
|
|
1870
|
+
tierClock?.refresh();
|
|
781
1871
|
}
|
|
1872
|
+
/** How long without a state frame before the push stream counts as stale. */
|
|
1873
|
+
const WATCHDOG_MS = 5e3;
|
|
1874
|
+
/** Reconnect backoff bounds for the event stream. */
|
|
1875
|
+
const RECONNECT_MIN_MS = 5e3;
|
|
1876
|
+
const RECONNECT_MAX_MS = 6e4;
|
|
782
1877
|
function startPolling() {
|
|
783
1878
|
let stopped = false;
|
|
784
1879
|
let esOk = false;
|
|
785
1880
|
let es = null;
|
|
1881
|
+
let reconnectDelay = RECONNECT_MIN_MS;
|
|
1882
|
+
let reconnectTimer = null;
|
|
1883
|
+
/** Freshness: an OPEN stream is not a HEALTHY stream. */
|
|
1884
|
+
function fresh() {
|
|
1885
|
+
return isStreamFresh(lowtideStore.getSnapshot().lastFrameAt, Date.now());
|
|
1886
|
+
}
|
|
1887
|
+
/** Whether the 4s poll fallback should carry the UI right now. */
|
|
1888
|
+
function shouldPoll() {
|
|
1889
|
+
return !esOk || !fresh();
|
|
1890
|
+
}
|
|
786
1891
|
async function poll() {
|
|
787
|
-
if (stopped ||
|
|
1892
|
+
if (stopped || !shouldPoll()) return;
|
|
788
1893
|
try {
|
|
789
1894
|
const res = await fetch("/ds-lowtide/state", { cache: "no-store" });
|
|
790
1895
|
if (!res.ok) throw new Error(`state ${res.status}`);
|
|
@@ -796,41 +1901,97 @@ window.__ModuleLoader__.load({
|
|
|
796
1901
|
});
|
|
797
1902
|
}
|
|
798
1903
|
}
|
|
1904
|
+
function scheduleReconnect() {
|
|
1905
|
+
if (stopped || reconnectTimer !== null) return;
|
|
1906
|
+
reconnectTimer = setTimeout(() => {
|
|
1907
|
+
reconnectTimer = null;
|
|
1908
|
+
reconnectDelay = Math.min(reconnectDelay * 2, RECONNECT_MAX_MS);
|
|
1909
|
+
connectSSE();
|
|
1910
|
+
}, reconnectDelay);
|
|
1911
|
+
}
|
|
799
1912
|
function connectSSE() {
|
|
800
1913
|
if (stopped || typeof EventSource === "undefined") return;
|
|
1914
|
+
if (es !== null) {
|
|
1915
|
+
try {
|
|
1916
|
+
es.close();
|
|
1917
|
+
} catch {}
|
|
1918
|
+
es = null;
|
|
1919
|
+
}
|
|
801
1920
|
const source = new EventSource("/ds-lowtide/events");
|
|
802
1921
|
es = source;
|
|
803
1922
|
source.addEventListener("state", (event) => {
|
|
804
1923
|
try {
|
|
805
1924
|
applyState(JSON.parse(event.data));
|
|
1925
|
+
reconnectDelay = RECONNECT_MIN_MS;
|
|
806
1926
|
} catch {}
|
|
807
1927
|
});
|
|
808
1928
|
source.onopen = () => {
|
|
809
1929
|
esOk = true;
|
|
810
1930
|
lowtideStore.update((draft) => {
|
|
811
1931
|
draft.connected = true;
|
|
812
|
-
draft.error = null;
|
|
813
1932
|
});
|
|
814
1933
|
};
|
|
815
1934
|
source.onerror = () => {
|
|
816
1935
|
esOk = false;
|
|
817
1936
|
lowtideStore.update((draft) => {
|
|
818
1937
|
draft.connected = false;
|
|
1938
|
+
draft.sseHealthy = false;
|
|
819
1939
|
draft.error = "实时连接断开,已切换轮询重连…";
|
|
820
1940
|
});
|
|
1941
|
+
scheduleReconnect();
|
|
821
1942
|
};
|
|
822
1943
|
}
|
|
1944
|
+
/**
|
|
1945
|
+
* Watchdog: an EventSource can stay "open" forever after the peer vanished
|
|
1946
|
+
* (half-open socket following a host restart, sleep/resume, a frozen
|
|
1947
|
+
* renderer). Without this, polling stayed disabled and the pill froze —
|
|
1948
|
+
* the reported bug. Demote the stream, let polling carry the UI, reconnect.
|
|
1949
|
+
*/
|
|
1950
|
+
function watchdog() {
|
|
1951
|
+
if (stopped) return;
|
|
1952
|
+
if (!esOk || fresh()) return;
|
|
1953
|
+
lowtideStore.update((draft) => {
|
|
1954
|
+
draft.sseHealthy = false;
|
|
1955
|
+
draft.error = "实时推送已停止,正在重连…";
|
|
1956
|
+
});
|
|
1957
|
+
esOk = false;
|
|
1958
|
+
if (es !== null) {
|
|
1959
|
+
try {
|
|
1960
|
+
es.close();
|
|
1961
|
+
} catch {}
|
|
1962
|
+
es = null;
|
|
1963
|
+
}
|
|
1964
|
+
scheduleReconnect();
|
|
1965
|
+
}
|
|
823
1966
|
pollNow = poll;
|
|
1967
|
+
tierClock = startTierClock({
|
|
1968
|
+
getWindows: () => tierWindows,
|
|
1969
|
+
getTimeZone: () => tierTimeZone(tierTz),
|
|
1970
|
+
onChange: (tier) => {
|
|
1971
|
+
lowtideStore.update((draft) => {
|
|
1972
|
+
draft.tier = tier;
|
|
1973
|
+
draft.tierAt = Date.now();
|
|
1974
|
+
});
|
|
1975
|
+
}
|
|
1976
|
+
});
|
|
824
1977
|
poll();
|
|
825
1978
|
const timer = setInterval(() => {
|
|
826
1979
|
poll();
|
|
827
1980
|
}, 4e3);
|
|
1981
|
+
const watchdogTimer = setInterval(watchdog, WATCHDOG_MS);
|
|
828
1982
|
connectSSE();
|
|
829
1983
|
return () => {
|
|
830
1984
|
stopped = true;
|
|
831
1985
|
esOk = false;
|
|
832
1986
|
pollNow = null;
|
|
833
1987
|
clearInterval(timer);
|
|
1988
|
+
clearInterval(watchdogTimer);
|
|
1989
|
+
if (reconnectTimer !== null) {
|
|
1990
|
+
clearTimeout(reconnectTimer);
|
|
1991
|
+
reconnectTimer = null;
|
|
1992
|
+
}
|
|
1993
|
+
tierClock?.stop();
|
|
1994
|
+
tierClock = null;
|
|
834
1995
|
if (es !== null) {
|
|
835
1996
|
es.close();
|
|
836
1997
|
es = null;
|
|
@@ -950,7 +2111,8 @@ window.__ModuleLoader__.load({
|
|
|
950
2111
|
return await (await fetch("/ds-lowtide/config", { cache: "no-store" })).json();
|
|
951
2112
|
}
|
|
952
2113
|
/** Settings-page meta from the live state: system timezone + official peak
|
|
953
|
-
* windows converted to the local clock (explainer + one-click adopt)
|
|
2114
|
+
* windows converted to the local clock (explainer + one-click adopt), plus
|
|
2115
|
+
* whether the saved windows drifted from the official schedule. */
|
|
954
2116
|
async function getStateMeta() {
|
|
955
2117
|
try {
|
|
956
2118
|
const res = await fetch("/ds-lowtide/state", { cache: "no-store" });
|
|
@@ -962,7 +2124,8 @@ window.__ModuleLoader__.load({
|
|
|
962
2124
|
return {
|
|
963
2125
|
ok: true,
|
|
964
2126
|
systemTz: typeof body.systemTz === "string" ? body.systemTz : "",
|
|
965
|
-
officialInLocal: Array.isArray(body.officialInLocal) ? body.officialInLocal : []
|
|
2127
|
+
officialInLocal: Array.isArray(body.officialInLocal) ? body.officialInLocal : [],
|
|
2128
|
+
officialDrift: body.officialDrift === true
|
|
966
2129
|
};
|
|
967
2130
|
} catch (error) {
|
|
968
2131
|
return {
|
|
@@ -994,8 +2157,8 @@ window.__ModuleLoader__.load({
|
|
|
994
2157
|
} catch {}
|
|
995
2158
|
}
|
|
996
2159
|
//#endregion
|
|
997
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
998
|
-
const css$12 = ".
|
|
2160
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\PriceBand.module.css.mjs
|
|
2161
|
+
const css$12 = ".EUchIG_bandWrap{flex-direction:column;gap:2px;display:flex}.EUchIG_bandAxis{justify-content:space-between;padding:0 2px;display:flex}.EUchIG_bandAxisLabel{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);font-variant-numeric:tabular-nums}.EUchIG_band{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:8px;gap:1px;height:32px;padding:4px;display:flex}.EUchIG_bandCell{border-radius:2px;flex:1}.EUchIG_bandPeak{background:var(--dsw-alias-state-error-primary);opacity:.85}.EUchIG_bandOff{background:var(--dsw-alias-state-success-primary);opacity:.85}.EUchIG_bandCustom{background:var(--dsw-alias-state-warn-primary);opacity:.85}.EUchIG_bandNow{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-1px}";
|
|
999
2162
|
const tagId$12 = "dsh-lowtide/PriceBand.module.css";
|
|
1000
2163
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$12) + "]") === null) {
|
|
1001
2164
|
const tag = document.createElement("style");
|
|
@@ -1005,15 +2168,15 @@ window.__ModuleLoader__.load({
|
|
|
1005
2168
|
document.head.appendChild(tag);
|
|
1006
2169
|
}
|
|
1007
2170
|
var PriceBand_module_css_default = {
|
|
1008
|
-
"
|
|
1009
|
-
"
|
|
1010
|
-
"
|
|
1011
|
-
"
|
|
1012
|
-
"
|
|
1013
|
-
"
|
|
1014
|
-
"
|
|
1015
|
-
"
|
|
1016
|
-
"
|
|
2171
|
+
"bandWrap": "EUchIG_bandWrap",
|
|
2172
|
+
"band": "EUchIG_band",
|
|
2173
|
+
"bandCell": "EUchIG_bandCell",
|
|
2174
|
+
"bandOff": "EUchIG_bandOff",
|
|
2175
|
+
"bandNow": "EUchIG_bandNow",
|
|
2176
|
+
"bandPeak": "EUchIG_bandPeak",
|
|
2177
|
+
"bandAxis": "EUchIG_bandAxis",
|
|
2178
|
+
"bandCustom": "EUchIG_bandCustom",
|
|
2179
|
+
"bandAxisLabel": "EUchIG_bandAxisLabel"
|
|
1017
2180
|
};
|
|
1018
2181
|
//#endregion
|
|
1019
2182
|
//#region client/components/PriceBand.tsx
|
|
@@ -1067,8 +2230,8 @@ window.__ModuleLoader__.load({
|
|
|
1067
2230
|
});
|
|
1068
2231
|
}
|
|
1069
2232
|
//#endregion
|
|
1070
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
1071
|
-
const css$11 = ".
|
|
2233
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\WindowEditorModal.module.css.mjs
|
|
2234
|
+
const css$11 = ".qLyHCq_wide{width:min(560px,100%)}.qLyHCq_body{flex-direction:column;gap:8px;display:flex}.qLyHCq_tzLine{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13)}.qLyHCq_hint{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);line-height:1.5}.qLyHCq_error{color:var(--dsw-alias-state-error-primary);font:var(--dsw-font-xxs-12);background:var(--dsw-alias-interactive-bg-hover);border-radius:6px;padding:6px 8px}.qLyHCq_empty{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);padding:10px 0}.qLyHCq_row{align-items:center;gap:6px;display:flex}.qLyHCq_input{box-sizing:border-box;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);height:32px;color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code);border-radius:8px;outline:none;padding:0 8px;font-size:13px}.qLyHCq_input:focus{border-color:var(--dsw-alias-brand-primary)}.qLyHCq_row select.qLyHCq_input{font-family:var(--dsw-font-family);flex:0 0 96px}.qLyHCq_row input.qLyHCq_input{flex:1;min-width:0}.qLyHCq_dash{color:var(--dsw-alias-label-tertiary)}.qLyHCq_daysBadge{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);white-space:nowrap;background:var(--dsw-alias-interactive-bg-hover);border-radius:999px;flex:none;padding:2px 8px}.qLyHCq_footer{align-items:center;gap:8px;display:flex}.qLyHCq_footerSpacer{flex:1}";
|
|
1072
2235
|
const tagId$11 = "dsh-lowtide/WindowEditorModal.module.css";
|
|
1073
2236
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$11) + "]") === null) {
|
|
1074
2237
|
const tag = document.createElement("style");
|
|
@@ -1078,18 +2241,18 @@ window.__ModuleLoader__.load({
|
|
|
1078
2241
|
document.head.appendChild(tag);
|
|
1079
2242
|
}
|
|
1080
2243
|
var WindowEditorModal_module_css_default = {
|
|
1081
|
-
"
|
|
1082
|
-
"
|
|
1083
|
-
"
|
|
1084
|
-
"
|
|
1085
|
-
"
|
|
1086
|
-
"
|
|
1087
|
-
"
|
|
1088
|
-
"footer": "
|
|
1089
|
-
"
|
|
1090
|
-
"
|
|
1091
|
-
"
|
|
1092
|
-
"
|
|
2244
|
+
"footerSpacer": "qLyHCq_footerSpacer",
|
|
2245
|
+
"wide": "qLyHCq_wide",
|
|
2246
|
+
"row": "qLyHCq_row",
|
|
2247
|
+
"body": "qLyHCq_body",
|
|
2248
|
+
"error": "qLyHCq_error",
|
|
2249
|
+
"hint": "qLyHCq_hint",
|
|
2250
|
+
"dash": "qLyHCq_dash",
|
|
2251
|
+
"footer": "qLyHCq_footer",
|
|
2252
|
+
"daysBadge": "qLyHCq_daysBadge",
|
|
2253
|
+
"tzLine": "qLyHCq_tzLine",
|
|
2254
|
+
"input": "qLyHCq_input",
|
|
2255
|
+
"empty": "qLyHCq_empty"
|
|
1093
2256
|
};
|
|
1094
2257
|
//#endregion
|
|
1095
2258
|
//#region client/components/WindowEditorModal.tsx
|
|
@@ -1128,6 +2291,7 @@ window.__ModuleLoader__.load({
|
|
|
1128
2291
|
const [systemTz, setSystemTz] = (0, react.useState)("");
|
|
1129
2292
|
const [saving, setSaving] = (0, react.useState)(false);
|
|
1130
2293
|
const [error, setError] = (0, react.useState)(null);
|
|
2294
|
+
const nowMs = useWallClock(3e4);
|
|
1131
2295
|
(0, react.useEffect)(() => {
|
|
1132
2296
|
if (!open) return;
|
|
1133
2297
|
let alive = true;
|
|
@@ -1156,6 +2320,13 @@ window.__ModuleLoader__.load({
|
|
|
1156
2320
|
}));
|
|
1157
2321
|
const hasAdvanced = windows.some((w) => !isBase(w));
|
|
1158
2322
|
setSegments(base.length > 0 || hasAdvanced ? base : []);
|
|
2323
|
+
if (base.length > 0) setTierWindows(base.map((s, i) => ({
|
|
2324
|
+
id: `editor-${i}`,
|
|
2325
|
+
level: s.level,
|
|
2326
|
+
start: s.start,
|
|
2327
|
+
end: s.end,
|
|
2328
|
+
...s.days !== void 0 ? { days: s.days } : {}
|
|
2329
|
+
})), typeof c.batch?.tz === "string" && c.batch.tz !== "" ? c.batch.tz : null);
|
|
1159
2330
|
}).catch((reason) => {
|
|
1160
2331
|
if (alive) setError(t("settings.configError", { error: reason instanceof Error ? reason.message : String(reason) }));
|
|
1161
2332
|
});
|
|
@@ -1209,15 +2380,24 @@ window.__ModuleLoader__.load({
|
|
|
1209
2380
|
const windows = Array.isArray(c.windows) ? c.windows : [];
|
|
1210
2381
|
const isBase = (w) => (w.level === "peak" || w.level === "off") && (w.tz === void 0 || w.tz === "") && w.multiplier === void 0;
|
|
1211
2382
|
const advanced = windows.filter((w) => !isBase(w));
|
|
1212
|
-
const
|
|
2383
|
+
const editedBase = segments.map((s, i) => ({
|
|
1213
2384
|
id: `win-${Date.now().toString(36)}-${i}-${Math.random().toString(36).slice(2, 7)}`,
|
|
1214
2385
|
level: s.level,
|
|
1215
2386
|
start: s.start,
|
|
1216
2387
|
end: s.end,
|
|
1217
2388
|
...s.days !== void 0 && s.days.length > 0 ? { days: s.days } : {}
|
|
1218
|
-
}))
|
|
2389
|
+
}));
|
|
2390
|
+
const res = await updateConfig({ windows: [...editedBase, ...advanced] });
|
|
1219
2391
|
setSaving(false);
|
|
1220
2392
|
if (res.ok) {
|
|
2393
|
+
setTierWindows(editedBase.map((w) => ({
|
|
2394
|
+
id: w.id,
|
|
2395
|
+
level: w.level,
|
|
2396
|
+
start: w.start,
|
|
2397
|
+
end: w.end,
|
|
2398
|
+
..."days" in w && w.days !== void 0 ? { days: w.days } : {}
|
|
2399
|
+
})), typeof c.batch?.tz === "string" && c.batch.tz !== "" ? c.batch.tz : null);
|
|
2400
|
+
refreshTier();
|
|
1221
2401
|
showToast(t("toast.windowsSaved"));
|
|
1222
2402
|
refreshNow();
|
|
1223
2403
|
onClose();
|
|
@@ -1227,11 +2407,12 @@ window.__ModuleLoader__.load({
|
|
|
1227
2407
|
setError(t("toast.saveFailed", { error: reason instanceof Error ? reason.message : String(reason) }));
|
|
1228
2408
|
}
|
|
1229
2409
|
}
|
|
1230
|
-
const nowIndex = Math.floor((
|
|
2410
|
+
const nowIndex = Math.floor((new Date(nowMs).getHours() * 60 + new Date(nowMs).getMinutes()) / 30) % 48;
|
|
1231
2411
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
1232
2412
|
open,
|
|
1233
2413
|
onClose,
|
|
1234
2414
|
title: t("editor.title"),
|
|
2415
|
+
closeLabel: t("modal.close"),
|
|
1235
2416
|
className: WindowEditorModal_module_css_default.wide,
|
|
1236
2417
|
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1237
2418
|
className: WindowEditorModal_module_css_default.footer,
|
|
@@ -1346,8 +2527,8 @@ window.__ModuleLoader__.load({
|
|
|
1346
2527
|
});
|
|
1347
2528
|
}
|
|
1348
2529
|
//#endregion
|
|
1349
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
1350
|
-
const css$10 = ".
|
|
2530
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\PricePill.module.css.mjs
|
|
2531
|
+
const css$10 = ".oHcJEa_pill{cursor:pointer;align-items:center;gap:6px;display:inline-flex}.oHcJEa_dot{display:inline-flex}.oHcJEa_pillStale .oHcJEa_label{color:var(--dsw-alias-label-tertiary)}.oHcJEa_label{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);font-variant-numeric:tabular-nums}.oHcJEa_count{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);font-variant-numeric:tabular-nums}.oHcJEa_queueIcon{color:var(--dsw-alias-label-tertiary)}.oHcJEa_badge{background:var(--dsw-alias-state-warn-primary);border-radius:999px;width:6px;height:6px}.oHcJEa_saved{color:var(--dsw-alias-state-success-primary)}";
|
|
1351
2532
|
const tagId$10 = "dsh-lowtide/PricePill.module.css";
|
|
1352
2533
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$10) + "]") === null) {
|
|
1353
2534
|
const tag = document.createElement("style");
|
|
@@ -1357,13 +2538,14 @@ window.__ModuleLoader__.load({
|
|
|
1357
2538
|
document.head.appendChild(tag);
|
|
1358
2539
|
}
|
|
1359
2540
|
var PricePill_module_css_default = {
|
|
1360
|
-
"
|
|
1361
|
-
"
|
|
1362
|
-
"
|
|
1363
|
-
"
|
|
1364
|
-
"
|
|
1365
|
-
"
|
|
1366
|
-
"
|
|
2541
|
+
"label": "oHcJEa_label",
|
|
2542
|
+
"pill": "oHcJEa_pill",
|
|
2543
|
+
"queueIcon": "oHcJEa_queueIcon",
|
|
2544
|
+
"badge": "oHcJEa_badge",
|
|
2545
|
+
"pillStale": "oHcJEa_pillStale",
|
|
2546
|
+
"count": "oHcJEa_count",
|
|
2547
|
+
"dot": "oHcJEa_dot",
|
|
2548
|
+
"saved": "oHcJEa_saved"
|
|
1367
2549
|
};
|
|
1368
2550
|
//#endregion
|
|
1369
2551
|
//#region client/components/PricePill.tsx
|
|
@@ -1376,19 +2558,33 @@ window.__ModuleLoader__.load({
|
|
|
1376
2558
|
* the decision happens. The tooltip keeps the full price detail.
|
|
1377
2559
|
* (The "starts at" countdown was removed — no action value for the user.)
|
|
1378
2560
|
* Click toggles the queue dock. All copy rides the `t` seat (i18n).
|
|
2561
|
+
*
|
|
2562
|
+
* v0.2.2 (bug fix): the displayed 闲时/忙时 comes from the LOCAL tier clock
|
|
2563
|
+
* (`store.tier`, derived from the host's windows + this machine's clock), not
|
|
2564
|
+
* from the last pushed snapshot. A silently stalled SSE stream used to freeze
|
|
2565
|
+
* this indicator forever; now it keeps following the clock and the pill says
|
|
2566
|
+
* how stale the pushed data is.
|
|
1379
2567
|
*/
|
|
1380
2568
|
function PricePill({ t }) {
|
|
1381
2569
|
const state = useLowtide((s) => s.host);
|
|
1382
2570
|
const connected = useLowtide((s) => s.connected);
|
|
2571
|
+
const tier = useLowtide((s) => s.tier);
|
|
2572
|
+
const tierAt = useLowtide((s) => s.tierAt);
|
|
2573
|
+
const lastFrameAt = useLowtide((s) => s.lastFrameAt);
|
|
2574
|
+
const sseHealthy = useLowtide((s) => s.sseHealthy);
|
|
1383
2575
|
const [editorOpen, setEditorOpen] = (0, react.useState)(false);
|
|
1384
2576
|
if (state === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Pill, { children: connected ? t("pill.loading") : t("pill.disconnected") });
|
|
1385
|
-
const
|
|
1386
|
-
const
|
|
2577
|
+
const shownLevel = tierAt > 0 ? tier.level : state.price.tier;
|
|
2578
|
+
const shownMultiplier = tierAt > 0 ? tier.multiplier : state.price.multiplier;
|
|
2579
|
+
const isPeak = shownLevel === "peak";
|
|
2580
|
+
const isCustom = shownLevel === "custom";
|
|
1387
2581
|
const isRunning = state.batch.running;
|
|
1388
|
-
const
|
|
2582
|
+
const staleMs = lastFrameAt > 0 ? Date.now() - lastFrameAt : 0;
|
|
2583
|
+
const stale = !sseHealthy && staleMs > 45e3;
|
|
2584
|
+
const dotState = isRunning ? "running" : stale ? "ending" : isPeak || isCustom ? "peak" : "off";
|
|
1389
2585
|
const pending = state.queue.pendingReview;
|
|
1390
2586
|
const todo = state.queue.queued + pending + state.queue.running;
|
|
1391
|
-
const tierText = isPeak ? t("pill.peak") : isCustom ? t("pill.custom", { multiplier:
|
|
2587
|
+
const tierText = isPeak ? t("pill.peak") : isCustom ? t("pill.custom", { multiplier: shownMultiplier }) : t("pill.off");
|
|
1392
2588
|
let label;
|
|
1393
2589
|
if (isRunning) label = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t("pill.running", {
|
|
1394
2590
|
running: state.queue.running,
|
|
@@ -1402,7 +2598,8 @@ window.__ModuleLoader__.load({
|
|
|
1402
2598
|
t("pill.queued")
|
|
1403
2599
|
] });
|
|
1404
2600
|
else label = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: tierText });
|
|
1405
|
-
const
|
|
2601
|
+
const shownWindow = tierAt > 0 ? tier.window : state.level?.window ?? null;
|
|
2602
|
+
const windowHint = shownWindow !== null ? `${shownWindow.start}–${shownWindow.end}` : "";
|
|
1406
2603
|
const tooltipLines = [];
|
|
1407
2604
|
tooltipLines.push(windowHint !== "" ? t("tooltip.time", {
|
|
1408
2605
|
tier: tierText,
|
|
@@ -1425,11 +2622,15 @@ window.__ModuleLoader__.load({
|
|
|
1425
2622
|
}));
|
|
1426
2623
|
else if (saved > 0) tooltipLines.push(t("tooltip.ledgerSaved", { saved: saved.toFixed(2) }));
|
|
1427
2624
|
else if (spent > 0) tooltipLines.push(t("tooltip.ledgerSpent", { spent: spent.toFixed(2) }));
|
|
2625
|
+
if (stale) {
|
|
2626
|
+
const minutes = Math.max(1, Math.round(staleMs / 6e4));
|
|
2627
|
+
tooltipLines.push(t("pill.stale", { minutes }));
|
|
2628
|
+
}
|
|
1428
2629
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
1429
2630
|
label: tooltipLines.join("\n"),
|
|
1430
2631
|
side: "bottom",
|
|
1431
2632
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Pill, {
|
|
1432
|
-
className: PricePill_module_css_default.pill,
|
|
2633
|
+
className: stale ? `${PricePill_module_css_default.pill} ${PricePill_module_css_default.pillStale}` : PricePill_module_css_default.pill,
|
|
1433
2634
|
active: editorOpen,
|
|
1434
2635
|
onClick: () => setEditorOpen(true),
|
|
1435
2636
|
children: [
|
|
@@ -1513,8 +2714,8 @@ window.__ModuleLoader__.load({
|
|
|
1513
2714
|
}
|
|
1514
2715
|
}
|
|
1515
2716
|
//#endregion
|
|
1516
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
1517
|
-
const css$9 = ".
|
|
2717
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\TaskForm.module.css.mjs
|
|
2718
|
+
const css$9 = ".kjcGda_modal{flex-direction:column;gap:10px;display:flex}.kjcGda_compact{flex-direction:column;gap:8px;display:flex}.kjcGda_prompt{box-sizing:border-box;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);width:100%;color:var(--dsw-alias-label-primary);font:var(--dsw-font-base-16);resize:vertical;border-radius:8px;outline:none;padding:8px 12px}.kjcGda_prompt:focus{border-color:var(--dsw-alias-brand-primary)}.kjcGda_guidanceInput{box-sizing:border-box;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);width:100%;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);resize:vertical;border-radius:8px;outline:none;padding:6px 10px}.kjcGda_guidanceInput:focus{border-color:var(--dsw-alias-brand-primary)}.kjcGda_field{flex-direction:column;gap:4px;display:flex}.kjcGda_fieldLabel{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13)}.kjcGda_fieldInput{box-sizing:border-box;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);width:100%;height:32px;color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code);border-radius:8px;outline:none;padding:0 8px;font-size:12px}.kjcGda_fieldInput:focus{border-color:var(--dsw-alias-brand-primary)}.kjcGda_compactRow{align-items:center;gap:8px;display:flex}.kjcGda_compactLabel{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);white-space:nowrap}.kjcGda_compactInput{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);height:28px;color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code);border-radius:6px;outline:none;flex:1;padding:0 8px;font-size:12px}.kjcGda_compactInput:focus{border-color:var(--dsw-alias-brand-primary)}.kjcGda_warning{color:var(--dsw-alias-state-warn-primary);font:var(--dsw-font-xxs-12);align-items:center;gap:4px;display:inline-flex}.kjcGda_warningIcon{color:var(--dsw-alias-state-warn-primary)}.kjcGda_pillRow{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.kjcGda_autonomyBtn{display:inline-flex}.kjcGda_sessionPickRow{flex-direction:column;gap:6px;display:flex}.kjcGda_strategyPill{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);cursor:pointer;user-select:none;border-radius:999px;align-items:center;gap:4px;padding:4px 12px;display:inline-flex}.kjcGda_strategyPill:hover{background:var(--dsw-alias-interactive-bg-hover)}.kjcGda_strategyActive{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary);font-weight:600}.kjcGda_costTag{color:var(--dsw-alias-label-tertiary);margin-left:2px;font-size:10px;font-weight:400}.kjcGda_strategyHint{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);line-height:1.5}.kjcGda_advancedBtn{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);cursor:pointer;background:0 0;border-radius:8px;align-self:flex-start;align-items:center;gap:6px;padding:5px 12px;display:inline-flex}.kjcGda_advancedBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.kjcGda_advancedBody{flex-direction:column;gap:12px;display:flex}.kjcGda_advancedIcon{vertical-align:-2px;color:var(--dsw-alias-label-tertiary);margin-right:5px}.kjcGda_modelFallbackRow{grid-template-columns:1fr 1fr;gap:8px;display:grid}";
|
|
1518
2719
|
const tagId$9 = "dsh-lowtide/TaskForm.module.css";
|
|
1519
2720
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$9) + "]") === null) {
|
|
1520
2721
|
const tag = document.createElement("style");
|
|
@@ -1524,29 +2725,29 @@ window.__ModuleLoader__.load({
|
|
|
1524
2725
|
document.head.appendChild(tag);
|
|
1525
2726
|
}
|
|
1526
2727
|
var TaskForm_module_css_default = {
|
|
1527
|
-
"
|
|
1528
|
-
"
|
|
1529
|
-
"
|
|
1530
|
-
"
|
|
1531
|
-
"
|
|
1532
|
-
"
|
|
1533
|
-
"
|
|
1534
|
-
"
|
|
1535
|
-
"
|
|
1536
|
-
"
|
|
1537
|
-
"
|
|
1538
|
-
"
|
|
1539
|
-
"
|
|
1540
|
-
"
|
|
1541
|
-
"
|
|
1542
|
-
"
|
|
1543
|
-
"
|
|
1544
|
-
"
|
|
1545
|
-
"
|
|
1546
|
-
"modelFallbackRow": "
|
|
1547
|
-
"
|
|
1548
|
-
"
|
|
1549
|
-
"
|
|
2728
|
+
"modal": "kjcGda_modal",
|
|
2729
|
+
"compactInput": "kjcGda_compactInput",
|
|
2730
|
+
"strategyActive": "kjcGda_strategyActive",
|
|
2731
|
+
"warning": "kjcGda_warning",
|
|
2732
|
+
"strategyHint": "kjcGda_strategyHint",
|
|
2733
|
+
"advancedBtn": "kjcGda_advancedBtn",
|
|
2734
|
+
"strategyPill": "kjcGda_strategyPill",
|
|
2735
|
+
"warningIcon": "kjcGda_warningIcon",
|
|
2736
|
+
"autonomyBtn": "kjcGda_autonomyBtn",
|
|
2737
|
+
"field": "kjcGda_field",
|
|
2738
|
+
"compact": "kjcGda_compact",
|
|
2739
|
+
"sessionPickRow": "kjcGda_sessionPickRow",
|
|
2740
|
+
"costTag": "kjcGda_costTag",
|
|
2741
|
+
"advancedIcon": "kjcGda_advancedIcon",
|
|
2742
|
+
"guidanceInput": "kjcGda_guidanceInput",
|
|
2743
|
+
"pillRow": "kjcGda_pillRow",
|
|
2744
|
+
"compactRow": "kjcGda_compactRow",
|
|
2745
|
+
"compactLabel": "kjcGda_compactLabel",
|
|
2746
|
+
"advancedBody": "kjcGda_advancedBody",
|
|
2747
|
+
"modelFallbackRow": "kjcGda_modelFallbackRow",
|
|
2748
|
+
"fieldInput": "kjcGda_fieldInput",
|
|
2749
|
+
"fieldLabel": "kjcGda_fieldLabel",
|
|
2750
|
+
"prompt": "kjcGda_prompt"
|
|
1550
2751
|
};
|
|
1551
2752
|
//#endregion
|
|
1552
2753
|
//#region client/components/TaskForm.tsx
|
|
@@ -1838,6 +3039,7 @@ window.__ModuleLoader__.load({
|
|
|
1838
3039
|
open: props.advancedOpen ?? false,
|
|
1839
3040
|
onClose: () => props.onAdvancedOpenChange?.(false),
|
|
1840
3041
|
title: t("modal.advancedTitle"),
|
|
3042
|
+
closeLabel: t("modal.close"),
|
|
1841
3043
|
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1842
3044
|
variant: "primary",
|
|
1843
3045
|
size: "md",
|
|
@@ -2093,8 +3295,8 @@ window.__ModuleLoader__.load({
|
|
|
2093
3295
|
});
|
|
2094
3296
|
}
|
|
2095
3297
|
//#endregion
|
|
2096
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
2097
|
-
const css$8 = ".
|
|
3298
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\InterceptCard.module.css.mjs
|
|
3299
|
+
const css$8 = "._9OZWeG_card{background:var(--dsw-specific-input-major);border:1px solid var(--dsw-alias-border-l2-darkmode-thin);box-shadow:var(--dsw-shadow-lv2);border-radius:22px;flex-direction:column;gap:8px;padding:16px 20px;display:flex}._9OZWeG_header{justify-content:space-between;align-items:center;gap:8px;display:flex}._9OZWeG_title{color:var(--dsw-alias-label-primary);font:var(--dsw-font-s-strong-14);align-items:center;gap:6px;display:inline-flex}._9OZWeG_dot{display:inline-flex}._9OZWeG_close{width:28px;height:28px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:999px;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._9OZWeG_close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}._9OZWeG_compare{gap:16px;display:flex}._9OZWeG_priceLabel{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12)}._9OZWeG_row{align-items:center;gap:8px;display:flex}._9OZWeG_dismiss{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);cursor:pointer;white-space:nowrap;background:0 0;border:none;margin-left:auto;padding:0 4px}._9OZWeG_dismiss:hover{color:var(--dsw-alias-label-secondary)}._9OZWeG_queueStatus{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);align-items:center;gap:4px;display:inline-flex}._9OZWeG_queueIcon{color:var(--dsw-alias-label-tertiary)}";
|
|
2098
3300
|
const tagId$8 = "dsh-lowtide/InterceptCard.module.css";
|
|
2099
3301
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$8) + "]") === null) {
|
|
2100
3302
|
const tag = document.createElement("style");
|
|
@@ -2104,17 +3306,17 @@ window.__ModuleLoader__.load({
|
|
|
2104
3306
|
document.head.appendChild(tag);
|
|
2105
3307
|
}
|
|
2106
3308
|
var InterceptCard_module_css_default = {
|
|
2107
|
-
"
|
|
2108
|
-
"
|
|
2109
|
-
"
|
|
2110
|
-
"
|
|
2111
|
-
"
|
|
2112
|
-
"row": "
|
|
2113
|
-
"
|
|
2114
|
-
"compare": "
|
|
2115
|
-
"
|
|
2116
|
-
"
|
|
2117
|
-
"
|
|
3309
|
+
"queueIcon": "_9OZWeG_queueIcon",
|
|
3310
|
+
"close": "_9OZWeG_close",
|
|
3311
|
+
"header": "_9OZWeG_header",
|
|
3312
|
+
"title": "_9OZWeG_title",
|
|
3313
|
+
"priceLabel": "_9OZWeG_priceLabel",
|
|
3314
|
+
"row": "_9OZWeG_row",
|
|
3315
|
+
"dismiss": "_9OZWeG_dismiss",
|
|
3316
|
+
"compare": "_9OZWeG_compare",
|
|
3317
|
+
"card": "_9OZWeG_card",
|
|
3318
|
+
"queueStatus": "_9OZWeG_queueStatus",
|
|
3319
|
+
"dot": "_9OZWeG_dot"
|
|
2118
3320
|
};
|
|
2119
3321
|
//#endregion
|
|
2120
3322
|
//#region client/components/InterceptCard.tsx
|
|
@@ -2141,11 +3343,18 @@ window.__ModuleLoader__.load({
|
|
|
2141
3343
|
* Pure chain routing: priced window ∧ not dismissed ∧ session present ∧
|
|
2142
3344
|
* draft non-empty. The draft condition keeps the native bar (and the queue
|
|
2143
3345
|
* dock) visible until the user actually starts typing (PLAN §6.2).
|
|
3346
|
+
*
|
|
3347
|
+
* v0.2.2: the tier comes from the local clock (`store.tier`), so a stalled
|
|
3348
|
+
* push stream can neither hide nor freeze the intercept card at a boundary.
|
|
2144
3349
|
*/
|
|
2145
3350
|
function selectIntercept(owner) {
|
|
2146
|
-
const
|
|
3351
|
+
const snapshot = lowtideStore.getSnapshot();
|
|
3352
|
+
const host = snapshot.host;
|
|
2147
3353
|
if (host === null) return null;
|
|
2148
|
-
|
|
3354
|
+
const tier = snapshot.tierAt > 0 ? snapshot.tier : null;
|
|
3355
|
+
const level = tier?.level ?? host.price.tier;
|
|
3356
|
+
const multiplier = tier?.multiplier ?? host.price.multiplier;
|
|
3357
|
+
if (!(level === "peak" || level === "custom" && multiplier > 1)) return null;
|
|
2149
3358
|
if (host.dismissedPeakToday) return null;
|
|
2150
3359
|
if (readInterceptDraft().trim() === "") return null;
|
|
2151
3360
|
if (isInterceptSessionDismissed()) return null;
|
|
@@ -2156,11 +3365,16 @@ window.__ModuleLoader__.load({
|
|
|
2156
3365
|
const { t } = props;
|
|
2157
3366
|
const draft = props.useInput((input) => input.draft);
|
|
2158
3367
|
const host = useLowtide((s) => s.host);
|
|
3368
|
+
const tier = useLowtide((s) => s.tier);
|
|
3369
|
+
const tierAt = useLowtide((s) => s.tierAt);
|
|
2159
3370
|
const [workspace, setWorkspace] = (0, react.useState)(() => lastWorkspace());
|
|
2160
3371
|
const [submitting, setSubmitting] = (0, react.useState)(false);
|
|
2161
3372
|
const [estimateResult, setEstimateResult] = (0, react.useState)(null);
|
|
2162
|
-
const
|
|
2163
|
-
const
|
|
3373
|
+
const shownLevel = tierAt > 0 ? tier.level : host?.price.tier ?? "off";
|
|
3374
|
+
const shownMultiplier = tierAt > 0 ? tier.multiplier : host?.price.multiplier ?? 1;
|
|
3375
|
+
const shownWindow = tierAt > 0 ? tier.window : host?.level?.window ?? null;
|
|
3376
|
+
const peakWindow = shownWindow !== null ? `${shownWindow.start}–${shownWindow.end}` : "";
|
|
3377
|
+
const customMultiplier = shownLevel === "custom" ? shownMultiplier : null;
|
|
2164
3378
|
const tierText = customMultiplier !== null && customMultiplier > 1 ? t("intercept.tierCustom", { multiplier: customMultiplier }) : t("intercept.tierPeak");
|
|
2165
3379
|
const formValues = {
|
|
2166
3380
|
prompt: draft,
|
|
@@ -2170,7 +3384,7 @@ window.__ModuleLoader__.load({
|
|
|
2170
3384
|
priority: 1,
|
|
2171
3385
|
files: "",
|
|
2172
3386
|
reasoning: "follow",
|
|
2173
|
-
model: host?.price.model ?? "
|
|
3387
|
+
model: host?.price.model ?? "",
|
|
2174
3388
|
modelProvider: "",
|
|
2175
3389
|
strategyHint: "",
|
|
2176
3390
|
autonomy: host?.autonomy === "l1" || host?.autonomy === "l3" ? host.autonomy : "l2",
|
|
@@ -2348,8 +3562,8 @@ window.__ModuleLoader__.load({
|
|
|
2348
3562
|
return "";
|
|
2349
3563
|
}
|
|
2350
3564
|
//#endregion
|
|
2351
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
2352
|
-
const css$7 = ".
|
|
3565
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\TaskRow.module.css.mjs
|
|
3566
|
+
const css$7 = ".ovX5jq_taskRow{border-left:2px solid #0000;border-radius:8px;align-items:center;gap:8px;min-height:36px;padding:4px 5px 4px 12px;display:flex}.ovX5jq_taskRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.ovX5jq_amber{border-left-color:var(--dsw-alias-state-warn-primary)}.ovX5jq_green{border-left-color:var(--dsw-alias-state-success-primary)}.ovX5jq_blue{border-left-color:var(--dsw-alias-state-business-primary)}.ovX5jq_red{border-left-color:var(--dsw-alias-state-error-primary)}.ovX5jq_taskMain{cursor:pointer;flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.ovX5jq_taskMain:hover .ovX5jq_taskPrompt{color:var(--dsw-alias-brand-primary)}.ovX5jq_taskPrompt{color:var(--dsw-alias-label-primary);font:var(--dsw-font-s-14);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ovX5jq_taskMeta{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ovX5jq_rowActions{gap:2px;display:flex}.ovX5jq_iconBtn{width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:999px;font-size:13px}.ovX5jq_iconBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.ovX5jq_iconBtn:disabled{opacity:.4;cursor:not-allowed}.ovX5jq_iconBtn:disabled:hover{color:var(--dsw-alias-label-secondary);background:0 0}.ovX5jq_confirming{color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-interactive-bg-hover);font-weight:600}.ovX5jq_confirming:hover{color:var(--dsw-alias-state-error-primary)}.ovX5jq_droppedRow{opacity:.75}.ovX5jq_droppedRow:hover{opacity:1}";
|
|
2353
3567
|
const tagId$7 = "dsh-lowtide/TaskRow.module.css";
|
|
2354
3568
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$7) + "]") === null) {
|
|
2355
3569
|
const tag = document.createElement("style");
|
|
@@ -2359,18 +3573,18 @@ window.__ModuleLoader__.load({
|
|
|
2359
3573
|
document.head.appendChild(tag);
|
|
2360
3574
|
}
|
|
2361
3575
|
var TaskRow_module_css_default = {
|
|
2362
|
-
"
|
|
2363
|
-
"
|
|
2364
|
-
"
|
|
2365
|
-
"
|
|
2366
|
-
"green": "
|
|
2367
|
-
"
|
|
2368
|
-
"
|
|
2369
|
-
"rowActions": "
|
|
2370
|
-
"
|
|
2371
|
-
"
|
|
2372
|
-
"
|
|
2373
|
-
"
|
|
3576
|
+
"red": "ovX5jq_red",
|
|
3577
|
+
"taskMeta": "ovX5jq_taskMeta",
|
|
3578
|
+
"amber": "ovX5jq_amber",
|
|
3579
|
+
"blue": "ovX5jq_blue",
|
|
3580
|
+
"green": "ovX5jq_green",
|
|
3581
|
+
"droppedRow": "ovX5jq_droppedRow",
|
|
3582
|
+
"taskRow": "ovX5jq_taskRow",
|
|
3583
|
+
"rowActions": "ovX5jq_rowActions",
|
|
3584
|
+
"taskPrompt": "ovX5jq_taskPrompt",
|
|
3585
|
+
"iconBtn": "ovX5jq_iconBtn",
|
|
3586
|
+
"confirming": "ovX5jq_confirming",
|
|
3587
|
+
"taskMain": "ovX5jq_taskMain"
|
|
2374
3588
|
};
|
|
2375
3589
|
//#endregion
|
|
2376
3590
|
//#region client/components/TaskRow.tsx
|
|
@@ -2543,8 +3757,8 @@ window.__ModuleLoader__.load({
|
|
|
2543
3757
|
});
|
|
2544
3758
|
}
|
|
2545
3759
|
//#endregion
|
|
2546
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
2547
|
-
const css$6 = ".
|
|
3760
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\CandidatesView.module.css.mjs
|
|
3761
|
+
const css$6 = ".j6P39W_wrap{flex-direction:column;gap:4px;margin-top:4px;display:flex}.j6P39W_toggle{color:var(--dsw-alias-brand-primary);font:var(--dsw-font-xxs-strong-12);cursor:pointer;background:0 0;border:none;border-radius:6px;align-self:flex-start;align-items:center;gap:4px;padding:2px 4px;display:inline-flex}.j6P39W_toggle:hover{background:var(--dsw-alias-interactive-bg-hover)}.j6P39W_candidate{border:1px solid var(--dsw-alias-border-l1);border-radius:8px;flex-direction:column;gap:3px;padding:6px 8px;display:flex}.j6P39W_picked{border-color:var(--dsw-alias-state-success-primary);background:var(--dsw-alias-interactive-bg-hover)}.j6P39W_head{align-items:center;gap:8px;display:flex}.j6P39W_title{color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-strong-13)}.j6P39W_pickedTag{color:var(--dsw-alias-state-success-primary);font:var(--dsw-font-xxs-12);margin-left:6px}.j6P39W_meta{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);font-variant-numeric:tabular-nums;margin-left:auto}.j6P39W_excerpt{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);white-space:pre-wrap;word-break:break-word;max-height:160px;line-height:1.6;overflow-y:auto}";
|
|
2548
3762
|
const tagId$6 = "dsh-lowtide/CandidatesView.module.css";
|
|
2549
3763
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$6) + "]") === null) {
|
|
2550
3764
|
const tag = document.createElement("style");
|
|
@@ -2554,15 +3768,15 @@ window.__ModuleLoader__.load({
|
|
|
2554
3768
|
document.head.appendChild(tag);
|
|
2555
3769
|
}
|
|
2556
3770
|
var CandidatesView_module_css_default = {
|
|
2557
|
-
"
|
|
2558
|
-
"
|
|
2559
|
-
"
|
|
2560
|
-
"
|
|
2561
|
-
"
|
|
2562
|
-
"
|
|
2563
|
-
"
|
|
2564
|
-
"
|
|
2565
|
-
"
|
|
3771
|
+
"title": "j6P39W_title",
|
|
3772
|
+
"excerpt": "j6P39W_excerpt",
|
|
3773
|
+
"pickedTag": "j6P39W_pickedTag",
|
|
3774
|
+
"meta": "j6P39W_meta",
|
|
3775
|
+
"head": "j6P39W_head",
|
|
3776
|
+
"picked": "j6P39W_picked",
|
|
3777
|
+
"wrap": "j6P39W_wrap",
|
|
3778
|
+
"toggle": "j6P39W_toggle",
|
|
3779
|
+
"candidate": "j6P39W_candidate"
|
|
2566
3780
|
};
|
|
2567
3781
|
//#endregion
|
|
2568
3782
|
//#region client/components/CandidatesView.tsx
|
|
@@ -2624,8 +3838,8 @@ window.__ModuleLoader__.load({
|
|
|
2624
3838
|
});
|
|
2625
3839
|
}
|
|
2626
3840
|
//#endregion
|
|
2627
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
2628
|
-
const css$5 = ".
|
|
3841
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\TaskDetail.module.css.mjs
|
|
3842
|
+
const css$5 = ".bhvrsW_modalBody{flex-direction:column;gap:10px;display:flex}.bhvrsW_modalFooter{justify-content:flex-end;gap:8px;display:flex}.bhvrsW_detailPrompt{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);white-space:pre-wrap;word-break:break-word;border-radius:8px;padding:8px 10px;line-height:1.6}.bhvrsW_detailGrid{grid-template-columns:1fr 1fr;gap:6px 12px;display:grid}.bhvrsW_detailItem{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12)}.bhvrsW_detailValue{color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code);word-break:break-all}.bhvrsW_detailSection{flex-direction:column;gap:3px;display:flex}.bhvrsW_detailLabel{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12)}.bhvrsW_detailFile{color:var(--dsw-alias-label-secondary);font-family:var(--ds-font-family-code);word-break:break-all;font-size:11px}.bhvrsW_detailRun{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);font-variant-numeric:tabular-nums}.bhvrsW_detailError{color:var(--dsw-alias-state-error-primary);font:var(--dsw-font-xxs-12);background:var(--dsw-alias-interactive-bg-hover);word-break:break-word;border-radius:6px;padding:6px 8px}.bhvrsW_detailResumed{color:var(--dsw-alias-state-success-primary);font:var(--dsw-font-xxs-12);background:var(--dsw-alias-interactive-bg-hover);word-break:break-word;border-radius:6px;padding:6px 8px}.bhvrsW_detailResumeWarn{color:var(--dsw-alias-state-warn-primary);font:var(--dsw-font-xxs-12);background:var(--dsw-alias-interactive-bg-hover);word-break:break-word;border-radius:6px;padding:6px 8px}.bhvrsW_detailReview{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13)}.bhvrsW_detailReview summary{cursor:pointer;color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);user-select:none}.bhvrsW_detailReviewBody{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);white-space:pre-wrap;word-break:break-word;border-radius:6px;margin-top:4px;padding:6px 8px;line-height:1.6}";
|
|
2629
3843
|
const tagId$5 = "dsh-lowtide/TaskDetail.module.css";
|
|
2630
3844
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) {
|
|
2631
3845
|
const tag = document.createElement("style");
|
|
@@ -2635,21 +3849,21 @@ window.__ModuleLoader__.load({
|
|
|
2635
3849
|
document.head.appendChild(tag);
|
|
2636
3850
|
}
|
|
2637
3851
|
var TaskDetail_module_css_default = {
|
|
2638
|
-
"
|
|
2639
|
-
"
|
|
2640
|
-
"
|
|
2641
|
-
"
|
|
2642
|
-
"detailGrid": "
|
|
2643
|
-
"
|
|
2644
|
-
"
|
|
2645
|
-
"
|
|
2646
|
-
"
|
|
2647
|
-
"
|
|
2648
|
-
"
|
|
2649
|
-
"
|
|
2650
|
-
"
|
|
2651
|
-
"
|
|
2652
|
-
"
|
|
3852
|
+
"detailReviewBody": "bhvrsW_detailReviewBody",
|
|
3853
|
+
"detailItem": "bhvrsW_detailItem",
|
|
3854
|
+
"modalBody": "bhvrsW_modalBody",
|
|
3855
|
+
"detailError": "bhvrsW_detailError",
|
|
3856
|
+
"detailGrid": "bhvrsW_detailGrid",
|
|
3857
|
+
"detailReview": "bhvrsW_detailReview",
|
|
3858
|
+
"detailFile": "bhvrsW_detailFile",
|
|
3859
|
+
"detailValue": "bhvrsW_detailValue",
|
|
3860
|
+
"detailRun": "bhvrsW_detailRun",
|
|
3861
|
+
"detailResumed": "bhvrsW_detailResumed",
|
|
3862
|
+
"detailPrompt": "bhvrsW_detailPrompt",
|
|
3863
|
+
"modalFooter": "bhvrsW_modalFooter",
|
|
3864
|
+
"detailSection": "bhvrsW_detailSection",
|
|
3865
|
+
"detailResumeWarn": "bhvrsW_detailResumeWarn",
|
|
3866
|
+
"detailLabel": "bhvrsW_detailLabel"
|
|
2653
3867
|
};
|
|
2654
3868
|
//#endregion
|
|
2655
3869
|
//#region client/components/TaskDetail.tsx
|
|
@@ -2664,6 +3878,7 @@ window.__ModuleLoader__.load({
|
|
|
2664
3878
|
open: true,
|
|
2665
3879
|
onClose,
|
|
2666
3880
|
title: t("detail.title"),
|
|
3881
|
+
closeLabel: t("detail.close"),
|
|
2667
3882
|
description: `${statusLabel(t, task.status)} · ${task.id}`,
|
|
2668
3883
|
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2669
3884
|
className: TaskDetail_module_css_default.modalFooter,
|
|
@@ -2872,8 +4087,8 @@ window.__ModuleLoader__.load({
|
|
|
2872
4087
|
});
|
|
2873
4088
|
}
|
|
2874
4089
|
//#endregion
|
|
2875
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
2876
|
-
const css$4 = ".
|
|
4090
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\NewTaskModal.module.css.mjs
|
|
4091
|
+
const css$4 = ".QIpxNq_wide{width:min(560px,100%)}.QIpxNq_modalBody{flex-direction:column;gap:10px;display:flex}.QIpxNq_modalFooter{justify-content:flex-end;gap:8px;display:flex}";
|
|
2877
4092
|
const tagId$4 = "dsh-lowtide/NewTaskModal.module.css";
|
|
2878
4093
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) {
|
|
2879
4094
|
const tag = document.createElement("style");
|
|
@@ -2883,9 +4098,9 @@ window.__ModuleLoader__.load({
|
|
|
2883
4098
|
document.head.appendChild(tag);
|
|
2884
4099
|
}
|
|
2885
4100
|
var NewTaskModal_module_css_default = {
|
|
2886
|
-
"wide": "
|
|
2887
|
-
"modalBody": "
|
|
2888
|
-
"modalFooter": "
|
|
4101
|
+
"wide": "QIpxNq_wide",
|
|
4102
|
+
"modalBody": "QIpxNq_modalBody",
|
|
4103
|
+
"modalFooter": "QIpxNq_modalFooter"
|
|
2889
4104
|
};
|
|
2890
4105
|
//#endregion
|
|
2891
4106
|
//#region client/components/NewTaskModal.tsx
|
|
@@ -2910,8 +4125,8 @@ window.__ModuleLoader__.load({
|
|
|
2910
4125
|
priority: 3,
|
|
2911
4126
|
files: "",
|
|
2912
4127
|
reasoning: "follow",
|
|
2913
|
-
model: "
|
|
2914
|
-
modelProvider: "
|
|
4128
|
+
model: "",
|
|
4129
|
+
modelProvider: "",
|
|
2915
4130
|
strategyHint: "",
|
|
2916
4131
|
autonomy: defaultAutonomy,
|
|
2917
4132
|
sessionMode: "new",
|
|
@@ -3002,6 +4217,7 @@ window.__ModuleLoader__.load({
|
|
|
3002
4217
|
open,
|
|
3003
4218
|
onClose: mainOnClose,
|
|
3004
4219
|
title: t("modal.title"),
|
|
4220
|
+
closeLabel: t("modal.close"),
|
|
3005
4221
|
description: t("modal.desc"),
|
|
3006
4222
|
className: NewTaskModal_module_css_default.wide,
|
|
3007
4223
|
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -3139,6 +4355,7 @@ window.__ModuleLoader__.load({
|
|
|
3139
4355
|
open: true,
|
|
3140
4356
|
onClose: mainOnClose,
|
|
3141
4357
|
title: t("modal.editTitle"),
|
|
4358
|
+
closeLabel: t("modal.close"),
|
|
3142
4359
|
description: t("modal.editDesc", { id: task.id }),
|
|
3143
4360
|
className: NewTaskModal_module_css_default.wide,
|
|
3144
4361
|
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -3174,8 +4391,8 @@ window.__ModuleLoader__.load({
|
|
|
3174
4391
|
});
|
|
3175
4392
|
}
|
|
3176
4393
|
//#endregion
|
|
3177
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
3178
|
-
const css$3 = ".
|
|
4394
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\QueueDock.module.css.mjs
|
|
4395
|
+
const css$3 = "._2DjDSq_dock{flex-direction:column;gap:4px;width:calc(100% - 16px);margin:0 8px -3px;display:flex}._2DjDSq_dockRow{background:var(--dsw-specific-tip);border-radius:12px 12px 0 0;justify-content:space-between;align-items:center;gap:8px;height:36px;padding:4px 12px;display:flex}._2DjDSq_dockTitle{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-s-14);font-variant-numeric:tabular-nums;font-weight:500}._2DjDSq_pending{color:var(--dsw-alias-state-warn-primary);font:var(--dsw-font-xxs-12)}._2DjDSq_dockActions{align-items:center;gap:4px;display:flex}._2DjDSq_reportBtn{align-items:center;gap:4px;display:inline-flex;position:relative}._2DjDSq_reportDot{background:var(--dsw-alias-state-warn-primary);border-radius:999px;width:6px;height:6px;position:absolute;top:-2px;right:-4px}._2DjDSq_sectionHead{justify-content:space-between;align-items:center;gap:8px;display:flex}._2DjDSq_sectionToggle{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-strong-12);cursor:pointer;text-align:left;background:0 0;border:none;flex:1;align-items:center;gap:4px;padding:4px;display:flex}._2DjDSq_sectionToggle:hover{color:var(--dsw-alias-label-primary)}._2DjDSq_clearBtn{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);cursor:pointer;background:0 0;border:none;border-radius:999px;flex-shrink:0;padding:3px 8px}._2DjDSq_clearBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}._2DjDSq_clearArmed{color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-interactive-bg-hover);font-weight:600}._2DjDSq_clearArmed:hover{color:var(--dsw-alias-state-error-primary)}._2DjDSq_approveArmed{font-weight:600;color:var(--dsw-alias-state-error-primary)!important;background:var(--dsw-alias-interactive-bg-hover)!important}._2DjDSq_drawer{background:var(--dsw-specific-tip);border-top:none;flex-direction:column;gap:4px;max-height:320px;padding:4px 8px 8px;display:flex;overflow-y:auto}._2DjDSq_group{flex-direction:column;gap:2px;display:flex}._2DjDSq_groupHeader{justify-content:space-between;align-items:center;padding:4px 4px 2px;display:flex}._2DjDSq_groupPath{color:var(--dsw-alias-label-tertiary);font-family:var(--ds-font-family-code);font-size:11px}._2DjDSq_onboarding{box-sizing:border-box;background:var(--dsw-specific-tip);border:1px solid var(--dsw-alias-border-l1);width:calc(100% - 16px);color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);border-radius:10px;justify-content:space-between;align-items:center;gap:8px;margin:0 8px;padding:6px 10px;line-height:1.5;display:flex}._2DjDSq_onboarding b{color:var(--dsw-alias-label-primary)}._2DjDSq_onboardingDismiss{background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-label-primary-foreground);font:var(--dsw-font-xxs-12);cursor:pointer;border:none;border-radius:999px;flex-shrink:0;padding:3px 10px}._2DjDSq_onboardingDismiss:hover{opacity:.9}._2DjDSq_footer{border-top:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:8px;padding:6px 4px 2px;display:flex}._2DjDSq_footerActions{gap:4px;display:flex}._2DjDSq_empty{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);flex-direction:column;align-items:center;gap:8px;padding:16px 0;display:flex}";
|
|
3179
4396
|
const tagId$3 = "dsh-lowtide/QueueDock.module.css";
|
|
3180
4397
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
|
|
3181
4398
|
const tag = document.createElement("style");
|
|
@@ -3185,27 +4402,27 @@ window.__ModuleLoader__.load({
|
|
|
3185
4402
|
document.head.appendChild(tag);
|
|
3186
4403
|
}
|
|
3187
4404
|
var QueueDock_module_css_default = {
|
|
3188
|
-
"
|
|
3189
|
-
"
|
|
3190
|
-
"
|
|
3191
|
-
"
|
|
3192
|
-
"
|
|
3193
|
-
"
|
|
3194
|
-
"
|
|
3195
|
-
"
|
|
3196
|
-
"
|
|
3197
|
-
"
|
|
3198
|
-
"
|
|
3199
|
-
"
|
|
3200
|
-
"
|
|
3201
|
-
"
|
|
3202
|
-
"
|
|
3203
|
-
"
|
|
3204
|
-
"
|
|
3205
|
-
"
|
|
3206
|
-
"
|
|
3207
|
-
"
|
|
3208
|
-
"
|
|
4405
|
+
"clearBtn": "_2DjDSq_clearBtn",
|
|
4406
|
+
"approveArmed": "_2DjDSq_approveArmed",
|
|
4407
|
+
"footer": "_2DjDSq_footer",
|
|
4408
|
+
"dockRow": "_2DjDSq_dockRow",
|
|
4409
|
+
"group": "_2DjDSq_group",
|
|
4410
|
+
"clearArmed": "_2DjDSq_clearArmed",
|
|
4411
|
+
"groupHeader": "_2DjDSq_groupHeader",
|
|
4412
|
+
"reportBtn": "_2DjDSq_reportBtn",
|
|
4413
|
+
"drawer": "_2DjDSq_drawer",
|
|
4414
|
+
"footerActions": "_2DjDSq_footerActions",
|
|
4415
|
+
"pending": "_2DjDSq_pending",
|
|
4416
|
+
"dock": "_2DjDSq_dock",
|
|
4417
|
+
"dockActions": "_2DjDSq_dockActions",
|
|
4418
|
+
"onboardingDismiss": "_2DjDSq_onboardingDismiss",
|
|
4419
|
+
"groupPath": "_2DjDSq_groupPath",
|
|
4420
|
+
"sectionHead": "_2DjDSq_sectionHead",
|
|
4421
|
+
"onboarding": "_2DjDSq_onboarding",
|
|
4422
|
+
"sectionToggle": "_2DjDSq_sectionToggle",
|
|
4423
|
+
"reportDot": "_2DjDSq_reportDot",
|
|
4424
|
+
"dockTitle": "_2DjDSq_dockTitle",
|
|
4425
|
+
"empty": "_2DjDSq_empty"
|
|
3209
4426
|
};
|
|
3210
4427
|
//#endregion
|
|
3211
4428
|
//#region client/components/QueueDock.tsx
|
|
@@ -3525,8 +4742,8 @@ window.__ModuleLoader__.load({
|
|
|
3525
4742
|
});
|
|
3526
4743
|
}
|
|
3527
4744
|
//#endregion
|
|
3528
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
3529
|
-
const css$2 = ".
|
|
4745
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\MorningReport.module.css.mjs
|
|
4746
|
+
const css$2 = ".x0rCEq_historyList{flex-direction:column;gap:4px;max-height:360px;display:flex;overflow-y:auto}.x0rCEq_historyRow{color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);cursor:pointer;text-align:left;background:0 0;border:none;border-radius:8px;justify-content:space-between;align-items:center;gap:8px;padding:8px 10px;display:flex}.x0rCEq_historyRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.x0rCEq_historyDate{font-weight:600}.x0rCEq_historyMeta{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums}.x0rCEq_historyEmpty{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);padding:12px}.x0rCEq_historyHeader{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);padding:0 10px 2px}.x0rCEq_historyRowWrap{border-radius:8px;align-items:center;gap:4px;display:flex}.x0rCEq_historyRowWrap:hover{background:var(--dsw-alias-interactive-bg-hover)}.x0rCEq_historyRowWrap .x0rCEq_historyRow{flex:1;min-width:0}.x0rCEq_historyRowWrap .x0rCEq_historyRow:hover{background:0 0}.x0rCEq_historyDelete{width:24px;height:24px;color:var(--dsw-alias-label-tertiary);cursor:pointer;opacity:0;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;margin-right:4px;font-size:12px;display:inline-flex}.x0rCEq_historyRowWrap:hover .x0rCEq_historyDelete{opacity:1}.x0rCEq_historyDelete:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-error-primary)}.x0rCEq_historyFooter{border-top:1px solid var(--dsw-alias-border-l1);justify-content:flex-end;padding-top:6px;display:flex}.x0rCEq_clearBtn{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);cursor:pointer;background:0 0;border:none;border-radius:6px;padding:4px 8px}.x0rCEq_clearBtn:hover{color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-interactive-bg-hover)}.x0rCEq_clearArmed{border:1px solid var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary);font:var(--dsw-font-xxs-12);cursor:pointer;background:0 0;border-radius:6px;padding:4px 8px;font-weight:600}.x0rCEq_body{flex-direction:column;gap:8px;display:flex}.x0rCEq_headline{flex-direction:column;align-items:center;gap:2px;display:flex}.x0rCEq_headlineLabel{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-s-14)}.x0rCEq_headlineValue{color:var(--dsw-alias-state-success-primary);font-family:var(--ds-font-family-code);font-variant-numeric:tabular-nums;font-size:32px;font-weight:700;line-height:40px}.x0rCEq_headlineMeta{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);font-variant-numeric:tabular-nums}.x0rCEq_divider{background:var(--dsw-alias-border-l1);height:1px}.x0rCEq_taskRow{border-left:2px solid #0000;gap:8px;padding:4px 0 4px 8px;display:flex}.x0rCEq_doneRow{border-left-color:var(--dsw-alias-state-success-primary)}.x0rCEq_badRow{border-left-color:var(--dsw-alias-state-error-primary)}.x0rCEq_taskMain{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.x0rCEq_taskPrompt{color:var(--dsw-alias-label-primary);font:var(--dsw-font-s-14)}.x0rCEq_taskMeta{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.x0rCEq_more{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);padding-left:8px}.x0rCEq_reviewExcerpt{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12)}.x0rCEq_reviewExcerpt summary{cursor:pointer;color:var(--dsw-alias-label-tertiary);user-select:none}.x0rCEq_reviewExcerptBody{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);white-space:pre-wrap;word-break:break-word;border-radius:6px;margin-top:4px;padding:6px 8px;line-height:1.6}.x0rCEq_footer{justify-content:space-between;align-items:center;display:flex}.x0rCEq_modalFooter{justify-content:flex-end;display:flex}";
|
|
3530
4747
|
const tagId$2 = "dsh-lowtide/MorningReport.module.css";
|
|
3531
4748
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
|
3532
4749
|
const tag = document.createElement("style");
|
|
@@ -3536,34 +4753,34 @@ window.__ModuleLoader__.load({
|
|
|
3536
4753
|
document.head.appendChild(tag);
|
|
3537
4754
|
}
|
|
3538
4755
|
var MorningReport_module_css_default = {
|
|
3539
|
-
"
|
|
3540
|
-
"
|
|
3541
|
-
"
|
|
3542
|
-
"
|
|
3543
|
-
"
|
|
3544
|
-
"
|
|
3545
|
-
"
|
|
3546
|
-
"
|
|
3547
|
-
"
|
|
3548
|
-
"
|
|
3549
|
-
"
|
|
3550
|
-
"
|
|
3551
|
-
"
|
|
3552
|
-
"
|
|
3553
|
-
"
|
|
3554
|
-
"
|
|
3555
|
-
"
|
|
3556
|
-
"
|
|
3557
|
-
"
|
|
3558
|
-
"
|
|
3559
|
-
"
|
|
3560
|
-
"
|
|
3561
|
-
"
|
|
3562
|
-
"
|
|
3563
|
-
"
|
|
3564
|
-
"
|
|
3565
|
-
"
|
|
3566
|
-
"
|
|
4756
|
+
"reviewExcerptBody": "x0rCEq_reviewExcerptBody",
|
|
4757
|
+
"headline": "x0rCEq_headline",
|
|
4758
|
+
"headlineValue": "x0rCEq_headlineValue",
|
|
4759
|
+
"taskMain": "x0rCEq_taskMain",
|
|
4760
|
+
"historyMeta": "x0rCEq_historyMeta",
|
|
4761
|
+
"historyDate": "x0rCEq_historyDate",
|
|
4762
|
+
"historyList": "x0rCEq_historyList",
|
|
4763
|
+
"taskRow": "x0rCEq_taskRow",
|
|
4764
|
+
"badRow": "x0rCEq_badRow",
|
|
4765
|
+
"more": "x0rCEq_more",
|
|
4766
|
+
"reviewExcerpt": "x0rCEq_reviewExcerpt",
|
|
4767
|
+
"historyFooter": "x0rCEq_historyFooter",
|
|
4768
|
+
"clearBtn": "x0rCEq_clearBtn",
|
|
4769
|
+
"headlineMeta": "x0rCEq_headlineMeta",
|
|
4770
|
+
"clearArmed": "x0rCEq_clearArmed",
|
|
4771
|
+
"body": "x0rCEq_body",
|
|
4772
|
+
"divider": "x0rCEq_divider",
|
|
4773
|
+
"historyRowWrap": "x0rCEq_historyRowWrap",
|
|
4774
|
+
"historyDelete": "x0rCEq_historyDelete",
|
|
4775
|
+
"taskMeta": "x0rCEq_taskMeta",
|
|
4776
|
+
"historyEmpty": "x0rCEq_historyEmpty",
|
|
4777
|
+
"headlineLabel": "x0rCEq_headlineLabel",
|
|
4778
|
+
"taskPrompt": "x0rCEq_taskPrompt",
|
|
4779
|
+
"footer": "x0rCEq_footer",
|
|
4780
|
+
"historyHeader": "x0rCEq_historyHeader",
|
|
4781
|
+
"modalFooter": "x0rCEq_modalFooter",
|
|
4782
|
+
"doneRow": "x0rCEq_doneRow",
|
|
4783
|
+
"historyRow": "x0rCEq_historyRow"
|
|
3567
4784
|
};
|
|
3568
4785
|
//#endregion
|
|
3569
4786
|
//#region client/components/MorningReport.tsx
|
|
@@ -3768,6 +4985,7 @@ window.__ModuleLoader__.load({
|
|
|
3768
4985
|
open: true,
|
|
3769
4986
|
onClose: close,
|
|
3770
4987
|
title: t("report.history"),
|
|
4988
|
+
closeLabel: t("report.close"),
|
|
3771
4989
|
description: t("report.historyDesc", { count: history.length }),
|
|
3772
4990
|
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3773
4991
|
className: MorningReport_module_css_default.modalFooter,
|
|
@@ -3851,6 +5069,7 @@ window.__ModuleLoader__.load({
|
|
|
3851
5069
|
open: true,
|
|
3852
5070
|
onClose: close,
|
|
3853
5071
|
title: t("report.title", { date: reportDateLabel(current.date) }),
|
|
5072
|
+
closeLabel: t("report.close"),
|
|
3854
5073
|
description: current.summary,
|
|
3855
5074
|
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3856
5075
|
className: MorningReport_module_css_default.modalFooter,
|
|
@@ -3884,8 +5103,8 @@ window.__ModuleLoader__.load({
|
|
|
3884
5103
|
});
|
|
3885
5104
|
}
|
|
3886
5105
|
//#endregion
|
|
3887
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
3888
|
-
const css$1 = ".
|
|
5106
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\ConfirmGate.module.css.mjs
|
|
5107
|
+
const css$1 = ".se0mvq_card{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);width:480px;max-width:calc(100vw - 32px);box-shadow:var(--dsw-shadow-lv3);color:var(--dsw-alias-label-primary);z-index:60;border-radius:14px;flex-direction:column;gap:8px;padding:14px 16px;display:flex;position:fixed;top:80px;left:50%;transform:translate(-50%)}.se0mvq_header{justify-content:space-between;align-items:center;display:flex}.se0mvq_title{font:var(--dsw-font-s-14);font-weight:600}.se0mvq_close{width:24px;height:24px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:999px;justify-content:center;align-items:center;font-size:13px;display:inline-flex}.se0mvq_close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.se0mvq_meta{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12)}.se0mvq_list{flex-direction:column;gap:2px;max-height:200px;display:flex;overflow-y:auto}.se0mvq_row{border-radius:8px;justify-content:space-between;align-items:center;gap:8px;padding:5px 6px;display:flex}.se0mvq_row:hover{background:var(--dsw-alias-interactive-bg-hover)}.se0mvq_prompt{min-width:0;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);white-space:nowrap;text-overflow:ellipsis;flex:1;overflow:hidden}.se0mvq_remove{width:24px;height:24px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:999px;flex-shrink:0;justify-content:center;align-items:center;font-size:12px;display:inline-flex}.se0mvq_remove:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-error-primary)}.se0mvq_more{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);padding:4px 6px}.se0mvq_footer{border-top:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:8px;padding-top:8px;display:flex}.se0mvq_releaseLabel{align-items:center;gap:4px;display:inline-flex}.se0mvq_defer{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);cursor:pointer;background:0 0;border:none;text-decoration:underline}.se0mvq_defer:hover{color:var(--dsw-alias-label-secondary)}";
|
|
3889
5108
|
const tagId$1 = "dsh-lowtide/ConfirmGate.module.css";
|
|
3890
5109
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
3891
5110
|
const tag = document.createElement("style");
|
|
@@ -3895,19 +5114,19 @@ window.__ModuleLoader__.load({
|
|
|
3895
5114
|
document.head.appendChild(tag);
|
|
3896
5115
|
}
|
|
3897
5116
|
var ConfirmGate_module_css_default = {
|
|
3898
|
-
"
|
|
3899
|
-
"
|
|
3900
|
-
"
|
|
3901
|
-
"remove": "
|
|
3902
|
-
"
|
|
3903
|
-
"
|
|
3904
|
-
"
|
|
3905
|
-
"
|
|
3906
|
-
"
|
|
3907
|
-
"meta": "
|
|
3908
|
-
"
|
|
3909
|
-
"close": "
|
|
3910
|
-
"releaseLabel": "
|
|
5117
|
+
"prompt": "se0mvq_prompt",
|
|
5118
|
+
"list": "se0mvq_list",
|
|
5119
|
+
"more": "se0mvq_more",
|
|
5120
|
+
"remove": "se0mvq_remove",
|
|
5121
|
+
"footer": "se0mvq_footer",
|
|
5122
|
+
"card": "se0mvq_card",
|
|
5123
|
+
"defer": "se0mvq_defer",
|
|
5124
|
+
"title": "se0mvq_title",
|
|
5125
|
+
"header": "se0mvq_header",
|
|
5126
|
+
"meta": "se0mvq_meta",
|
|
5127
|
+
"row": "se0mvq_row",
|
|
5128
|
+
"close": "se0mvq_close",
|
|
5129
|
+
"releaseLabel": "se0mvq_releaseLabel"
|
|
3911
5130
|
};
|
|
3912
5131
|
//#endregion
|
|
3913
5132
|
//#region client/components/ConfirmGate.tsx
|
|
@@ -4047,8 +5266,8 @@ window.__ModuleLoader__.load({
|
|
|
4047
5266
|
});
|
|
4048
5267
|
}
|
|
4049
5268
|
//#endregion
|
|
4050
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
4051
|
-
const css = ".
|
|
5269
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\settings.module.css.mjs
|
|
5270
|
+
const css = "._9UODyG_page{flex-direction:column;gap:14px;padding:4px 2px 16px;display:flex}._9UODyG_loading{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);padding:12px 0}._9UODyG_onboarding{background:var(--dsw-specific-tip);border:1px solid var(--dsw-alias-border-l1);border-radius:10px;flex-direction:column;gap:6px;padding:12px 14px;display:flex}._9UODyG_onboardingTitle{color:var(--dsw-alias-brand-primary);font:var(--dsw-font-s-14);font-weight:600}._9UODyG_onboardingSteps{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);margin:0;padding-left:18px;line-height:1.7}._9UODyG_onboardingSteps b{color:var(--dsw-alias-label-primary)}._9UODyG_langRow{justify-content:space-between;align-items:center;gap:8px;padding:8px 0;display:flex}._9UODyG_langLabel{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13)}._9UODyG_error{color:var(--dsw-alias-state-error-primary);font:var(--dsw-font-xs-13);background:var(--dsw-alias-interactive-bg-hover);border-radius:8px;padding:8px 12px}._9UODyG_section{flex-direction:column;gap:8px;display:flex}._9UODyG_sectionHead{justify-content:space-between;align-items:center;display:flex}._9UODyG_sectionTitle{color:var(--dsw-alias-label-primary);font:var(--dsw-font-s-14);margin:0;font-weight:600}._9UODyG_grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;display:grid}._9UODyG_field{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);flex-direction:column;gap:4px;display:flex}._9UODyG_fieldLabel{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13)}._9UODyG_strategyHint{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);line-height:1.5}._9UODyG_input{box-sizing:border-box;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);width:100%;height:32px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);border-radius:8px;outline:none;padding:0 8px}._9UODyG_input:focus{border-color:var(--dsw-alias-brand-primary)}._9UODyG_checkbox{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);align-items:center;gap:6px;display:flex}._9UODyG_pillRow{gap:6px;display:flex}._9UODyG_autonomyPill{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);cursor:pointer;user-select:none;border-radius:999px;padding:4px 12px}._9UODyG_autonomyPill:hover{background:var(--dsw-alias-interactive-bg-hover)}._9UODyG_autonomyActive{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary);font-weight:600}._9UODyG_confirmBox{color:var(--dsw-alias-state-warn-primary);font:var(--dsw-font-xxs-12);background:var(--dsw-specific-tip);border-radius:8px;align-items:center;gap:8px;padding:8px 10px;display:flex}._9UODyG_confirmBtn{background:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-label-primary-foreground);font:var(--dsw-font-xxs-12);cursor:pointer;border:none;border-radius:999px;padding:3px 10px}._9UODyG_confirmCancel{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);cursor:pointer;background:0 0;border:none;padding:3px 8px}._9UODyG_hint{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);margin:0;line-height:1.6}._9UODyG_windowRow{flex-wrap:wrap;align-items:center;gap:6px;display:flex}._9UODyG_windowRow ._9UODyG_input{flex:0 150px}._9UODyG_dayRow{gap:4px;display:flex}._9UODyG_dayBtn{border:1px solid var(--dsw-alias-border-l2);width:24px;height:24px;color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);cursor:pointer;background:0 0;border-radius:999px;justify-content:center;align-items:center;display:inline-flex}._9UODyG_dayBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}._9UODyG_dayActive{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary);font-weight:600}._9UODyG_noWindows{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);background:var(--dsw-specific-tip);border-radius:8px;padding:10px 12px}._9UODyG_footer{justify-content:flex-end;display:flex}._9UODyG_footerLeft{gap:8px;margin-right:auto;display:flex}._9UODyG_officialCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:10px;flex-direction:column;gap:6px;padding:10px 12px;display:flex}._9UODyG_officialTitle{color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-strong-13)}._9UODyG_officialBody{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);line-height:1.6}._9UODyG_officialActions{align-items:center;gap:8px;margin-top:2px;display:flex}._9UODyG_legend{gap:14px;display:flex}._9UODyG_bandPeak{background:var(--dsw-alias-state-error-primary);opacity:.85}._9UODyG_bandOff{background:var(--dsw-alias-state-success-primary);opacity:.85}._9UODyG_bandCustom{background:var(--dsw-alias-state-warn-primary);opacity:.85}._9UODyG_legendItem{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12);align-items:center;gap:5px;display:flex}._9UODyG_legendDot{opacity:.9;border-radius:2px;width:10px;height:10px}._9UODyG_priceTable{flex-direction:column;gap:3px;display:flex}._9UODyG_priceHead,._9UODyG_priceRow{grid-template-columns:1.4fr .6fr 1fr 1fr 1fr;align-items:center;gap:6px;display:grid}._9UODyG_priceHead{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xxs-12)}._9UODyG_priceRow ._9UODyG_input{height:28px}._9UODyG_priceModel{color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code);font-size:12px}._9UODyG_priceTier{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13)}";
|
|
4052
5271
|
const tagId = "dsh-lowtide/settings.module.css";
|
|
4053
5272
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
4054
5273
|
const tag = document.createElement("style");
|
|
@@ -4058,52 +5277,52 @@ window.__ModuleLoader__.load({
|
|
|
4058
5277
|
document.head.appendChild(tag);
|
|
4059
5278
|
}
|
|
4060
5279
|
var settings_module_css_default = {
|
|
4061
|
-
"
|
|
4062
|
-
"
|
|
4063
|
-
"
|
|
4064
|
-
"
|
|
4065
|
-
"
|
|
4066
|
-
"
|
|
4067
|
-
"
|
|
4068
|
-
"
|
|
4069
|
-
"
|
|
4070
|
-
"
|
|
4071
|
-
"
|
|
4072
|
-
"
|
|
4073
|
-
"
|
|
4074
|
-
"
|
|
4075
|
-
"
|
|
4076
|
-
"
|
|
4077
|
-
"
|
|
4078
|
-
"
|
|
4079
|
-
"
|
|
4080
|
-
"
|
|
4081
|
-
"
|
|
4082
|
-
"
|
|
4083
|
-
"
|
|
4084
|
-
"
|
|
4085
|
-
"legendDot": "
|
|
4086
|
-
"
|
|
4087
|
-
"
|
|
4088
|
-
"
|
|
4089
|
-
"
|
|
4090
|
-
"
|
|
4091
|
-
"
|
|
4092
|
-
"
|
|
4093
|
-
"
|
|
4094
|
-
"
|
|
4095
|
-
"
|
|
4096
|
-
"
|
|
4097
|
-
"
|
|
4098
|
-
"
|
|
4099
|
-
"
|
|
4100
|
-
"
|
|
4101
|
-
"
|
|
4102
|
-
"onboardingSteps": "
|
|
4103
|
-
"
|
|
4104
|
-
"
|
|
4105
|
-
"
|
|
4106
|
-
"
|
|
5280
|
+
"officialActions": "_9UODyG_officialActions",
|
|
5281
|
+
"legendItem": "_9UODyG_legendItem",
|
|
5282
|
+
"priceTable": "_9UODyG_priceTable",
|
|
5283
|
+
"priceModel": "_9UODyG_priceModel",
|
|
5284
|
+
"page": "_9UODyG_page",
|
|
5285
|
+
"noWindows": "_9UODyG_noWindows",
|
|
5286
|
+
"autonomyActive": "_9UODyG_autonomyActive",
|
|
5287
|
+
"officialCard": "_9UODyG_officialCard",
|
|
5288
|
+
"onboardingTitle": "_9UODyG_onboardingTitle",
|
|
5289
|
+
"dayActive": "_9UODyG_dayActive",
|
|
5290
|
+
"footerLeft": "_9UODyG_footerLeft",
|
|
5291
|
+
"bandCustom": "_9UODyG_bandCustom",
|
|
5292
|
+
"fieldLabel": "_9UODyG_fieldLabel",
|
|
5293
|
+
"hint": "_9UODyG_hint",
|
|
5294
|
+
"dayRow": "_9UODyG_dayRow",
|
|
5295
|
+
"onboarding": "_9UODyG_onboarding",
|
|
5296
|
+
"sectionTitle": "_9UODyG_sectionTitle",
|
|
5297
|
+
"input": "_9UODyG_input",
|
|
5298
|
+
"confirmCancel": "_9UODyG_confirmCancel",
|
|
5299
|
+
"confirmBox": "_9UODyG_confirmBox",
|
|
5300
|
+
"officialTitle": "_9UODyG_officialTitle",
|
|
5301
|
+
"priceHead": "_9UODyG_priceHead",
|
|
5302
|
+
"priceRow": "_9UODyG_priceRow",
|
|
5303
|
+
"pillRow": "_9UODyG_pillRow",
|
|
5304
|
+
"legendDot": "_9UODyG_legendDot",
|
|
5305
|
+
"sectionHead": "_9UODyG_sectionHead",
|
|
5306
|
+
"checkbox": "_9UODyG_checkbox",
|
|
5307
|
+
"bandOff": "_9UODyG_bandOff",
|
|
5308
|
+
"officialBody": "_9UODyG_officialBody",
|
|
5309
|
+
"legend": "_9UODyG_legend",
|
|
5310
|
+
"langRow": "_9UODyG_langRow",
|
|
5311
|
+
"strategyHint": "_9UODyG_strategyHint",
|
|
5312
|
+
"langLabel": "_9UODyG_langLabel",
|
|
5313
|
+
"field": "_9UODyG_field",
|
|
5314
|
+
"loading": "_9UODyG_loading",
|
|
5315
|
+
"error": "_9UODyG_error",
|
|
5316
|
+
"priceTier": "_9UODyG_priceTier",
|
|
5317
|
+
"footer": "_9UODyG_footer",
|
|
5318
|
+
"grid": "_9UODyG_grid",
|
|
5319
|
+
"confirmBtn": "_9UODyG_confirmBtn",
|
|
5320
|
+
"bandPeak": "_9UODyG_bandPeak",
|
|
5321
|
+
"onboardingSteps": "_9UODyG_onboardingSteps",
|
|
5322
|
+
"windowRow": "_9UODyG_windowRow",
|
|
5323
|
+
"dayBtn": "_9UODyG_dayBtn",
|
|
5324
|
+
"autonomyPill": "_9UODyG_autonomyPill",
|
|
5325
|
+
"section": "_9UODyG_section"
|
|
4107
5326
|
};
|
|
4108
5327
|
//#endregion
|
|
4109
5328
|
//#region client/settings.tsx
|
|
@@ -4114,6 +5333,8 @@ window.__ModuleLoader__.load({
|
|
|
4114
5333
|
* Saves through PUT /ds-lowtide/config and takes effect immediately
|
|
4115
5334
|
* (next scheduler tick). All copy rides the `t` seat.
|
|
4116
5335
|
*/
|
|
5336
|
+
/** Editable price-table rows: canonical official ids plus legacy aliases. */
|
|
5337
|
+
const OFFICIAL_PRICE_MODELS = [.../* @__PURE__ */ new Set([...Object.keys(OFFICIAL_PRICES), ...Object.keys(PRICE_ALIASES)])];
|
|
4117
5338
|
/** 当前本地时区的 UTC 偏移标签,如 "UTC+8" / "UTC-5"。 */
|
|
4118
5339
|
function utcOffsetLabel() {
|
|
4119
5340
|
const minutes = -(/* @__PURE__ */ new Date()).getTimezoneOffset();
|
|
@@ -4187,13 +5408,21 @@ window.__ModuleLoader__.load({
|
|
|
4187
5408
|
const [pricesExpanded, setPricesExpanded] = (0, react.useState)(false);
|
|
4188
5409
|
const activeLocale = useLowtide((s) => s.activeLocale);
|
|
4189
5410
|
const [meta, setMeta] = (0, react.useState)(null);
|
|
5411
|
+
const [hostModels, setHostModels] = (0, react.useState)(null);
|
|
5412
|
+
const nowMs = useWallClock(3e4);
|
|
5413
|
+
const nowIndex = Math.floor((new Date(nowMs).getHours() * 60 + new Date(nowMs).getMinutes()) / 30) % 48;
|
|
4190
5414
|
(0, react.useEffect)(() => {
|
|
4191
5415
|
let alive = true;
|
|
5416
|
+
getModels().then((res) => {
|
|
5417
|
+
if (!alive || !res.ok || res.providers === void 0) return;
|
|
5418
|
+
setHostModels(res.providers.flatMap((p) => p.models.map((m) => m.id)));
|
|
5419
|
+
}).catch(() => {});
|
|
4192
5420
|
getStateMeta().then((res) => {
|
|
4193
5421
|
if (!alive) return;
|
|
4194
5422
|
if (res.ok) setMeta({
|
|
4195
5423
|
systemTz: res.systemTz ?? "",
|
|
4196
|
-
officialInLocal: res.officialInLocal ?? []
|
|
5424
|
+
officialInLocal: res.officialInLocal ?? [],
|
|
5425
|
+
officialDrift: res.officialDrift === true
|
|
4197
5426
|
});
|
|
4198
5427
|
}).catch(() => {});
|
|
4199
5428
|
getConfig().then((res) => {
|
|
@@ -4233,6 +5462,16 @@ window.__ModuleLoader__.load({
|
|
|
4233
5462
|
windows: Array.isArray(c.windows) ? c.windows.map(windowToDraft) : [],
|
|
4234
5463
|
prices
|
|
4235
5464
|
});
|
|
5465
|
+
if (Array.isArray(c.windows) && c.windows.length > 0) setTierWindows(c.windows.map((w) => ({
|
|
5466
|
+
id: String(w.id ?? ""),
|
|
5467
|
+
...typeof w.label === "string" && w.label !== "" ? { label: w.label } : {},
|
|
5468
|
+
level: w.level === "peak" || w.level === "custom" ? w.level : "off",
|
|
5469
|
+
start: String(w.start ?? "00:00"),
|
|
5470
|
+
end: String(w.end ?? "00:00"),
|
|
5471
|
+
...Array.isArray(w.days) && w.days.length > 0 ? { days: w.days } : {},
|
|
5472
|
+
...typeof w.tz === "string" && w.tz !== "" ? { tz: w.tz } : {},
|
|
5473
|
+
...typeof w.multiplier === "number" ? { multiplier: w.multiplier } : {}
|
|
5474
|
+
})), typeof batch.tz === "string" && batch.tz !== "" ? batch.tz : null);
|
|
4236
5475
|
}).catch((reason) => {
|
|
4237
5476
|
if (alive) setError(t("settings.configError", { error: reason instanceof Error ? reason.message : String(reason) }));
|
|
4238
5477
|
});
|
|
@@ -4328,11 +5567,11 @@ window.__ModuleLoader__.load({
|
|
|
4328
5567
|
});
|
|
4329
5568
|
showToast(t("toast.restoredDefaults"));
|
|
4330
5569
|
}
|
|
4331
|
-
const priceModels = [.../* @__PURE__ */ new Set([
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
]
|
|
5570
|
+
const priceModels = [.../* @__PURE__ */ new Set([
|
|
5571
|
+
...OFFICIAL_PRICE_MODELS,
|
|
5572
|
+
...hostModels ?? [],
|
|
5573
|
+
...Object.keys(draft.prices)
|
|
5574
|
+
])].sort();
|
|
4336
5575
|
const save = async () => {
|
|
4337
5576
|
setSaving(true);
|
|
4338
5577
|
setError(null);
|
|
@@ -4655,6 +5894,10 @@ window.__ModuleLoader__.load({
|
|
|
4655
5894
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4656
5895
|
className: settings_module_css_default.officialBody,
|
|
4657
5896
|
children: t("settings.officialWeekend")
|
|
5897
|
+
}),
|
|
5898
|
+
meta.officialDrift && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5899
|
+
className: settings_module_css_default.officialBody,
|
|
5900
|
+
children: t("settings.officialDrift")
|
|
4658
5901
|
})
|
|
4659
5902
|
] }),
|
|
4660
5903
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -4779,7 +6022,7 @@ window.__ModuleLoader__.load({
|
|
|
4779
6022
|
start: w.start,
|
|
4780
6023
|
end: w.end
|
|
4781
6024
|
})),
|
|
4782
|
-
nowIndex
|
|
6025
|
+
nowIndex,
|
|
4783
6026
|
t
|
|
4784
6027
|
}),
|
|
4785
6028
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -4981,18 +6224,7 @@ window.__ModuleLoader__.load({
|
|
|
4981
6224
|
}, LowtideSettings));
|
|
4982
6225
|
ctx.effect(() => () => {
|
|
4983
6226
|
stop();
|
|
4984
|
-
|
|
4985
|
-
host: null,
|
|
4986
|
-
connected: false,
|
|
4987
|
-
error: null,
|
|
4988
|
-
queueOpen: false,
|
|
4989
|
-
reportOpen: false,
|
|
4990
|
-
reportHistoryOpen: false,
|
|
4991
|
-
reportUnread: false,
|
|
4992
|
-
toast: null,
|
|
4993
|
-
lastReportId: null,
|
|
4994
|
-
activeLocale: "zh"
|
|
4995
|
-
});
|
|
6227
|
+
resetUiState();
|
|
4996
6228
|
});
|
|
4997
6229
|
}
|
|
4998
6230
|
//#endregion
|