dsh-lowtide 0.2.0 → 0.2.2
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 +838 -285
- package/lib/client.js.map +1 -1
- package/lib/index.js +170 -56
- 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 +3 -0
- package/lib/types/client/lib/tierClock.d.ts +81 -0
- package/lib/types/client/store.d.ts +33 -0
- 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 +11 -11
package/lib/client.js
CHANGED
|
@@ -30,6 +30,7 @@ window.__ModuleLoader__.load({
|
|
|
30
30
|
"pill.off": "闲时",
|
|
31
31
|
"pill.custom": "闲时×{multiplier}",
|
|
32
32
|
"pill.running": "执行中 {running}/{total}",
|
|
33
|
+
"pill.stale": "数据同步于 {minutes} 分钟前 · 正在重连(忙/闲仍按本机时间判定)",
|
|
33
34
|
"tooltip.time": "当前:{tier}({window})",
|
|
34
35
|
"tooltip.timeNoWindow": "当前:{tier}",
|
|
35
36
|
"tooltip.queue": "队列 {total} 项 · {pending} 待裁定",
|
|
@@ -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",
|
|
@@ -605,7 +609,9 @@ window.__ModuleLoader__.load({
|
|
|
605
609
|
"settings.priceTierPeak": "Peak",
|
|
606
610
|
"settings.priceTierOff": "Off",
|
|
607
611
|
"settings.officialTitle": "About the official pricing",
|
|
608
|
-
"settings.officialBody": "DeepSeek
|
|
612
|
+
"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\".",
|
|
613
|
+
"settings.officialDrift": "The official peak hours changed and no longer match your saved windows — click \"Adopt\" below to realign.",
|
|
614
|
+
"settings.modelRetiring": "This model is retired or retiring and is billed as deepseek-flash: {note}",
|
|
609
615
|
"settings.localTz": "Your local timezone: {tz}",
|
|
610
616
|
"settings.officialPeakLocal": "Official peak hours in your local time (weekdays only): {range}",
|
|
611
617
|
"settings.officialWeekend": "Weekends (Saturday & Sunday) are off-peak all day — no peak/valley split.",
|
|
@@ -673,8 +679,8 @@ window.__ModuleLoader__.load({
|
|
|
673
679
|
}
|
|
674
680
|
};
|
|
675
681
|
//#endregion
|
|
676
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
677
|
-
const css$13 = ".
|
|
682
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\atoms.module.css.mjs
|
|
683
|
+
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
684
|
const tagId$13 = "dsh-lowtide/atoms.module.css";
|
|
679
685
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$13) + "]") === null) {
|
|
680
686
|
const tag = document.createElement("style");
|
|
@@ -684,11 +690,11 @@ window.__ModuleLoader__.load({
|
|
|
684
690
|
document.head.appendChild(tag);
|
|
685
691
|
}
|
|
686
692
|
var atoms_module_css_default = {
|
|
687
|
-
"
|
|
688
|
-
"
|
|
689
|
-
"
|
|
690
|
-
"
|
|
691
|
-
"
|
|
693
|
+
"modelBadgeQ": "grgw_q_modelBadgeQ",
|
|
694
|
+
"modelBadge": "grgw_q_modelBadge",
|
|
695
|
+
"modelBadgeUnknown": "grgw_q_modelBadgeUnknown",
|
|
696
|
+
"countdown": "grgw_q_countdown",
|
|
697
|
+
"money": "grgw_q_money"
|
|
692
698
|
};
|
|
693
699
|
//#endregion
|
|
694
700
|
//#region client/components/atoms.tsx
|
|
@@ -696,6 +702,20 @@ window.__ModuleLoader__.load({
|
|
|
696
702
|
* Atomic presentational pieces (PLAN §3.6/§3.7): money with tabular nums,
|
|
697
703
|
* live countdown, status dot. Only §4 tokens.
|
|
698
704
|
*/
|
|
705
|
+
/**
|
|
706
|
+
* Wall-clock tick for "now" markers (v0.2.2): re-renders every `periodMs`
|
|
707
|
+
* (default 30s) and on mount. The 24h band's marker used to be computed once
|
|
708
|
+
* per render with no timer, so it never moved on its own — the same class of
|
|
709
|
+
* staleness the tier clock fixes for the pill.
|
|
710
|
+
*/
|
|
711
|
+
function useWallClock(periodMs = 3e4) {
|
|
712
|
+
const [now, setNow] = (0, react.useState)(() => Date.now());
|
|
713
|
+
(0, react.useEffect)(() => {
|
|
714
|
+
const timer = setInterval(() => setNow(Date.now()), periodMs);
|
|
715
|
+
return () => clearInterval(timer);
|
|
716
|
+
}, [periodMs]);
|
|
717
|
+
return now;
|
|
718
|
+
}
|
|
699
719
|
/** ¥3.82 two-decimals; ¥123 without decimals at ≥¥100; <¥0.01 for dust (PLAN §3.6). */
|
|
700
720
|
function Money({ yuan, className }) {
|
|
701
721
|
const text = yuan >= 100 ? `¥${Math.round(yuan)}` : yuan < .005 ? "<¥0.01" : `¥${yuan.toFixed(2)}`;
|
|
@@ -730,11 +750,363 @@ window.__ModuleLoader__.load({
|
|
|
730
750
|
});
|
|
731
751
|
}
|
|
732
752
|
//#endregion
|
|
753
|
+
//#region ../core/src/windows.ts
|
|
754
|
+
const DEFAULT_MULTIPLIER = {
|
|
755
|
+
peak: 2,
|
|
756
|
+
off: 1,
|
|
757
|
+
custom: 1
|
|
758
|
+
};
|
|
759
|
+
function systemTimeZone() {
|
|
760
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
761
|
+
}
|
|
762
|
+
function minutesOf$1(hhmm) {
|
|
763
|
+
const match = /^(\d{1,2}):(\d{2})$/.exec(hhmm);
|
|
764
|
+
if (match === null) throw new Error(`invalid HH:MM time "${hhmm}"`);
|
|
765
|
+
const h = Number(match[1]);
|
|
766
|
+
const m = Number(match[2]);
|
|
767
|
+
if (h > 23 || m > 59) throw new Error(`invalid HH:MM time "${hhmm}"`);
|
|
768
|
+
return h * 60 + m;
|
|
769
|
+
}
|
|
770
|
+
/** Local HH:MM minutes + ISO weekday of a Date in an IANA timezone. */
|
|
771
|
+
function localParts(when, tz) {
|
|
772
|
+
let parts;
|
|
773
|
+
try {
|
|
774
|
+
parts = new Intl.DateTimeFormat("en-US", {
|
|
775
|
+
timeZone: tz,
|
|
776
|
+
hour: "2-digit",
|
|
777
|
+
minute: "2-digit",
|
|
778
|
+
weekday: "short",
|
|
779
|
+
hourCycle: "h23",
|
|
780
|
+
hour12: false
|
|
781
|
+
}).formatToParts(when);
|
|
782
|
+
} catch {
|
|
783
|
+
parts = new Intl.DateTimeFormat("en-US", {
|
|
784
|
+
timeZone: systemTimeZone(),
|
|
785
|
+
hour: "2-digit",
|
|
786
|
+
minute: "2-digit",
|
|
787
|
+
weekday: "short",
|
|
788
|
+
hourCycle: "h23",
|
|
789
|
+
hour12: false
|
|
790
|
+
}).formatToParts(when);
|
|
791
|
+
}
|
|
792
|
+
let hour = 0;
|
|
793
|
+
let minute = 0;
|
|
794
|
+
let weekday = 1;
|
|
795
|
+
for (const part of parts) {
|
|
796
|
+
if (part.type === "hour") {
|
|
797
|
+
const h = Number(part.value);
|
|
798
|
+
hour = Number.isFinite(h) ? h === 24 ? 0 : h : 0;
|
|
799
|
+
}
|
|
800
|
+
if (part.type === "minute") {
|
|
801
|
+
const m = Number(part.value);
|
|
802
|
+
minute = Number.isFinite(m) ? m : 0;
|
|
803
|
+
}
|
|
804
|
+
if (part.type === "weekday") weekday = {
|
|
805
|
+
Mon: 1,
|
|
806
|
+
Tue: 2,
|
|
807
|
+
Wed: 3,
|
|
808
|
+
Thu: 4,
|
|
809
|
+
Fri: 5,
|
|
810
|
+
Sat: 6,
|
|
811
|
+
Sun: 7
|
|
812
|
+
}[part.value] ?? 1;
|
|
813
|
+
}
|
|
814
|
+
return {
|
|
815
|
+
minutes: hour * 60 + minute,
|
|
816
|
+
weekday
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
function matchesDays(days, weekday) {
|
|
820
|
+
if (days === void 0 || days.length === 0) return true;
|
|
821
|
+
return days.includes(weekday);
|
|
822
|
+
}
|
|
823
|
+
/** Whether `minutes` falls inside [start, end), with midnight-crossing support. */
|
|
824
|
+
function inRange(minutes, start, end) {
|
|
825
|
+
if (end > start) return minutes >= start && minutes < end;
|
|
826
|
+
if (end < start) return minutes >= start || minutes < end;
|
|
827
|
+
return true;
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Resolve the active window at `when` (array order = precedence).
|
|
831
|
+
* Returns null when no window covers the moment.
|
|
832
|
+
*/
|
|
833
|
+
function levelAt(when, windows, defaultTz = systemTimeZone()) {
|
|
834
|
+
for (const window of windows) {
|
|
835
|
+
const { minutes, weekday } = localParts(when, window.tz ?? defaultTz);
|
|
836
|
+
if (!matchesDays(window.days, weekday)) continue;
|
|
837
|
+
if (inRange(minutes, minutesOf$1(window.start), minutesOf$1(window.end))) return {
|
|
838
|
+
level: window.level,
|
|
839
|
+
multiplier: window.multiplier ?? DEFAULT_MULTIPLIER[window.level],
|
|
840
|
+
window
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
return null;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* The next moment the active level may change after `when`: the earliest
|
|
847
|
+
* future boundary among every window's start and end (calendar-based, per
|
|
848
|
+
* window tz, weekday-aware).
|
|
849
|
+
*
|
|
850
|
+
* The client tier clock uses this to flip a displayed 闲时/忙时 exactly at the
|
|
851
|
+
* boundary — even when no host frame ever arrives (a stalled push stream must
|
|
852
|
+
* never freeze the indicator). Scanning mirrors `nextOffPeakStart`: day steps
|
|
853
|
+
* go through `addDaysInTz` so DST/midnight-crossing windows stay correct.
|
|
854
|
+
*
|
|
855
|
+
* Returns null when no boundary is reachable within 8 days (e.g. no windows).
|
|
856
|
+
*/
|
|
857
|
+
function nextLevelChangeAt(when, windows, defaultTz = systemTimeZone()) {
|
|
858
|
+
let best = null;
|
|
859
|
+
for (let day = 0; day < 8; day++) {
|
|
860
|
+
for (const window of windows) {
|
|
861
|
+
const tz = window.tz ?? defaultTz;
|
|
862
|
+
const probe = addDaysInTz(when, tz, day);
|
|
863
|
+
const { minutes, weekday } = localParts(probe, tz);
|
|
864
|
+
if (!matchesDays(window.days, weekday)) continue;
|
|
865
|
+
const start = minutesOf$1(window.start);
|
|
866
|
+
const end = minutesOf$1(window.end);
|
|
867
|
+
const boundaries = end === start ? [start] : [start, end];
|
|
868
|
+
for (const boundary of boundaries) {
|
|
869
|
+
const candidate = new Date(probe.getTime() + (boundary - minutes) * 6e4);
|
|
870
|
+
if (candidate.getTime() > when.getTime() && (best === null || candidate.getTime() < best.getTime())) best = candidate;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
if (best !== null) break;
|
|
874
|
+
}
|
|
875
|
+
return best;
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* The instant when the calendar day containing `probe` (in `tz`) begins.
|
|
879
|
+
*
|
|
880
|
+
* Wall-clock subtraction breaks on DST spring-forward days (23h): walking
|
|
881
|
+
* back N minutes from 05:00 PDT lands at 23:00 PST the previous day. Instead
|
|
882
|
+
* we binary-search the earliest UTC instant whose tz calendar day equals the
|
|
883
|
+
* probe's — the tz day is monotonic in UTC, so the boundary IS local 00:00.
|
|
884
|
+
*/
|
|
885
|
+
function dayStartInTz(probe, tz) {
|
|
886
|
+
const targetDay = daySerial(probe, tz);
|
|
887
|
+
let lo = /* @__PURE__ */ new Date(probe.getTime() - 936e5);
|
|
888
|
+
let hi = probe;
|
|
889
|
+
for (let i = 0; i < 32; i++) {
|
|
890
|
+
const mid = /* @__PURE__ */ new Date((lo.getTime() + hi.getTime()) / 2);
|
|
891
|
+
if (daySerial(mid, tz) === targetDay) hi = mid;
|
|
892
|
+
else lo = mid;
|
|
893
|
+
}
|
|
894
|
+
return hi;
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* The calendar-day start `days` days after/before the day containing `probe`
|
|
898
|
+
* (in `tz`). Steps via a noon-ish probe so DST ±1h days cannot misalign.
|
|
899
|
+
*/
|
|
900
|
+
function addDaysInTz(probe, tz, days) {
|
|
901
|
+
const day0 = dayStartInTz(probe, tz);
|
|
902
|
+
return dayStartInTz(new Date(day0.getTime() + (days * 24 + 12) * 36e5), tz);
|
|
903
|
+
}
|
|
904
|
+
/** Calendar-day serial (YYYY-MM-DD) of an instant in a tz. */
|
|
905
|
+
function daySerial(when, tz) {
|
|
906
|
+
try {
|
|
907
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
908
|
+
timeZone: tz,
|
|
909
|
+
year: "numeric",
|
|
910
|
+
month: "2-digit",
|
|
911
|
+
day: "2-digit"
|
|
912
|
+
}).format(when);
|
|
913
|
+
} catch {
|
|
914
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
915
|
+
timeZone: systemTimeZone(),
|
|
916
|
+
year: "numeric",
|
|
917
|
+
month: "2-digit",
|
|
918
|
+
day: "2-digit"
|
|
919
|
+
}).format(when);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
//#endregion
|
|
923
|
+
//#region ../core/src/pricing.ts
|
|
924
|
+
/** Canonical id of the current official flash model (V4.1-Flash, multimodal). */
|
|
925
|
+
const FLASH_MODEL_ID = "deepseek-flash";
|
|
926
|
+
const OFFICIAL_PRICES = {
|
|
927
|
+
[FLASH_MODEL_ID]: {
|
|
928
|
+
peak: {
|
|
929
|
+
input: 2,
|
|
930
|
+
inputCached: .04,
|
|
931
|
+
output: 8
|
|
932
|
+
},
|
|
933
|
+
off: {
|
|
934
|
+
input: 1,
|
|
935
|
+
inputCached: .02,
|
|
936
|
+
output: 4
|
|
937
|
+
}
|
|
938
|
+
},
|
|
939
|
+
"deepseek-v4-pro": {
|
|
940
|
+
peak: {
|
|
941
|
+
input: 9,
|
|
942
|
+
inputCached: .3,
|
|
943
|
+
output: 27
|
|
944
|
+
},
|
|
945
|
+
off: {
|
|
946
|
+
input: 4.5,
|
|
947
|
+
inputCached: .15,
|
|
948
|
+
output: 13.5
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
/**
|
|
953
|
+
* Legacy model ids that DeepSeek still accepts but has retired: requests are
|
|
954
|
+
* served by DeepSeek-V4.1-Flash and billed at the Flash price (official docs,
|
|
955
|
+
* 2026-09-10). Mapping them keeps old persisted tasks and existing Harness
|
|
956
|
+
* catalogs priced instead of silently falling back to "价格未知".
|
|
957
|
+
*/
|
|
958
|
+
const PRICE_ALIASES = {
|
|
959
|
+
"deepseek-v4-flash": FLASH_MODEL_ID,
|
|
960
|
+
"deepseek-v4-flash-vision-exp": FLASH_MODEL_ID
|
|
961
|
+
};
|
|
962
|
+
OFFICIAL_PRICES[FLASH_MODEL_ID];
|
|
963
|
+
//#endregion
|
|
964
|
+
//#region client/lib/tierClock.ts
|
|
965
|
+
/**
|
|
966
|
+
* Client-side tier clock (v0.2.2): derives the displayed 闲时/忙时 from the
|
|
967
|
+
* CONFIGURED windows and the LOCAL clock, using the very same pure `levelAt`
|
|
968
|
+
* the host uses (imported from lowtide-core, which is inlined into the client
|
|
969
|
+
* bundle — it is not a `@deepseek-ai/*` platform module).
|
|
970
|
+
*
|
|
971
|
+
* Why this exists — the reported bug:
|
|
972
|
+
* The price pill used to be a pure mirror of the host's pushed state. The
|
|
973
|
+
* client disables its 4s polling as soon as the EventSource reports `open`
|
|
974
|
+
* and had no freshness check, so ONE silently stalled stream (host restart
|
|
975
|
+
* leaving a half-open socket, a hidden/frozen Electron window, system sleep,
|
|
976
|
+
* a swapped SSE client) froze 闲时/忙时 forever — and `connected === false`
|
|
977
|
+
* was invisible while a host snapshot existed. The pill simply stopped
|
|
978
|
+
* following the clock.
|
|
979
|
+
*
|
|
980
|
+
* This module makes the tier a function of time, never of stream liveness:
|
|
981
|
+
* - recomputed on every state frame (host config may change),
|
|
982
|
+
* - recomputed on a 30s heartbeat (covers suspend/resume and clock jumps),
|
|
983
|
+
* - recomputed exactly at the next window boundary (+1s), so a 12:00 or
|
|
984
|
+
* 18:00 flip is visible even with zero server traffic.
|
|
985
|
+
*/
|
|
986
|
+
/** Longest timeout we ever arm (24.8 days is the setTimeout ceiling). */
|
|
987
|
+
const MAX_TIMEOUT_MS = 2147483647;
|
|
988
|
+
/**
|
|
989
|
+
* How long the UI tolerates silence from the push stream before it stops
|
|
990
|
+
* trusting it. The host heartbeats every 15s, so 45s = three missed frames.
|
|
991
|
+
*/
|
|
992
|
+
const SSE_STALE_MS = 45e3;
|
|
993
|
+
/**
|
|
994
|
+
* Freshness predicate for the live state stream: an OPEN EventSource is not a
|
|
995
|
+
* HEALTHY one. `lastFrameAt === 0` means no frame has ever arrived.
|
|
996
|
+
*/
|
|
997
|
+
function isStreamFresh(lastFrameAt, nowMs, staleMs = SSE_STALE_MS) {
|
|
998
|
+
return lastFrameAt > 0 && nowMs - lastFrameAt <= staleMs;
|
|
999
|
+
}
|
|
1000
|
+
/** The off-peak fallback snapshot (also used before the first host frame). */
|
|
1001
|
+
const OFF_TIER = {
|
|
1002
|
+
level: "off",
|
|
1003
|
+
multiplier: 1,
|
|
1004
|
+
window: null
|
|
1005
|
+
};
|
|
1006
|
+
/**
|
|
1007
|
+
* Derive the tier at `now` from raw windows (own `tz`/`days` preserved — the
|
|
1008
|
+
* host sends them verbatim precisely so this stays timezone-correct for
|
|
1009
|
+
* west-hemisphere users with day-shifted windows).
|
|
1010
|
+
*/
|
|
1011
|
+
function deriveTier(windows, tz, now) {
|
|
1012
|
+
const match = levelAt(now, windows, tz);
|
|
1013
|
+
if (match === null) return OFF_TIER;
|
|
1014
|
+
return {
|
|
1015
|
+
level: match.level,
|
|
1016
|
+
multiplier: match.multiplier,
|
|
1017
|
+
window: {
|
|
1018
|
+
id: match.window.id,
|
|
1019
|
+
...match.window.label !== void 0 ? { label: match.window.label } : {},
|
|
1020
|
+
start: match.window.start,
|
|
1021
|
+
end: match.window.end
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
/** Epoch ms of the next boundary that can change the level (null = none). */
|
|
1026
|
+
function nextBoundaryAt(windows, tz, now) {
|
|
1027
|
+
const next = nextLevelChangeAt(now, windows, tz);
|
|
1028
|
+
return next === null ? null : next.getTime();
|
|
1029
|
+
}
|
|
1030
|
+
/** Resolve the timezone to evaluate windows in (host-provided wins). */
|
|
1031
|
+
function tierTimeZone(hostTz) {
|
|
1032
|
+
if (typeof hostTz === "string" && hostTz !== "") return hostTz;
|
|
1033
|
+
return systemTimeZone();
|
|
1034
|
+
}
|
|
1035
|
+
function sameTier(a, b) {
|
|
1036
|
+
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 ?? "");
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* Start the tier clock. Returns a handle whose `refresh()` is called whenever a
|
|
1040
|
+
* host frame arrives; `stop()` clears both timers (wired into `ctx.effect`).
|
|
1041
|
+
*/
|
|
1042
|
+
function startTierClock(options) {
|
|
1043
|
+
const tickMs = options.tickMs ?? 3e4;
|
|
1044
|
+
const now = options.now ?? (() => Date.now());
|
|
1045
|
+
let last = OFF_TIER;
|
|
1046
|
+
let boundaryTimer = null;
|
|
1047
|
+
let stopped = false;
|
|
1048
|
+
function armBoundary() {
|
|
1049
|
+
if (boundaryTimer !== null) {
|
|
1050
|
+
clearTimeout(boundaryTimer);
|
|
1051
|
+
boundaryTimer = null;
|
|
1052
|
+
}
|
|
1053
|
+
const windows = options.getWindows();
|
|
1054
|
+
if (windows === null || windows.length === 0) return;
|
|
1055
|
+
const at = nextBoundaryAt(windows, options.getTimeZone(), new Date(now()));
|
|
1056
|
+
if (at === null) return;
|
|
1057
|
+
const delay = Math.min(Math.max(at - now() + 1e3, 250), MAX_TIMEOUT_MS);
|
|
1058
|
+
boundaryTimer = setTimeout(() => {
|
|
1059
|
+
boundaryTimer = null;
|
|
1060
|
+
refresh();
|
|
1061
|
+
}, delay);
|
|
1062
|
+
}
|
|
1063
|
+
function refresh() {
|
|
1064
|
+
if (stopped) return last;
|
|
1065
|
+
const windows = options.getWindows();
|
|
1066
|
+
if (windows === null || windows.length === 0) {
|
|
1067
|
+
armBoundary();
|
|
1068
|
+
return last;
|
|
1069
|
+
}
|
|
1070
|
+
const next = deriveTier(windows, options.getTimeZone(), new Date(now()));
|
|
1071
|
+
if (!sameTier(next, last)) {
|
|
1072
|
+
last = next;
|
|
1073
|
+
if (!stopped) options.onChange(next);
|
|
1074
|
+
}
|
|
1075
|
+
armBoundary();
|
|
1076
|
+
return last;
|
|
1077
|
+
}
|
|
1078
|
+
const heartbeat = setInterval(() => {
|
|
1079
|
+
refresh();
|
|
1080
|
+
}, tickMs);
|
|
1081
|
+
refresh();
|
|
1082
|
+
return {
|
|
1083
|
+
refresh,
|
|
1084
|
+
current: () => last,
|
|
1085
|
+
stop() {
|
|
1086
|
+
stopped = true;
|
|
1087
|
+
clearInterval(heartbeat);
|
|
1088
|
+
if (boundaryTimer !== null) {
|
|
1089
|
+
clearTimeout(boundaryTimer);
|
|
1090
|
+
boundaryTimer = null;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
//#endregion
|
|
733
1096
|
//#region client/store.ts
|
|
734
1097
|
/**
|
|
735
1098
|
* Client entry store: the host state aggregate mirror + UI state.
|
|
736
1099
|
* Plain snapshot store from the runtime engine; components subscribe with
|
|
737
|
-
* useSyncExternalStore.
|
|
1100
|
+
* useSyncExternalStore.
|
|
1101
|
+
*
|
|
1102
|
+
* Live data path (v0.2.2): SSE first, 4s polling as a *freshness-gated*
|
|
1103
|
+
* fallback. `lastFrameAt` records the newest state frame from either path; a
|
|
1104
|
+
* watchdog demotes a silent-but-open stream back to polling and reconnects
|
|
1105
|
+
* with backoff, so the UI can never freeze on a half-open socket.
|
|
1106
|
+
*
|
|
1107
|
+
* The displayed 闲时/忙时 additionally comes from the local tier clock
|
|
1108
|
+
* (lib/tierClock.ts), so it keeps following the wall clock even if every
|
|
1109
|
+
* network path is down.
|
|
738
1110
|
*/
|
|
739
1111
|
const lowtideStore = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)({
|
|
740
1112
|
host: null,
|
|
@@ -746,7 +1118,11 @@ window.__ModuleLoader__.load({
|
|
|
746
1118
|
reportUnread: false,
|
|
747
1119
|
toast: null,
|
|
748
1120
|
lastReportId: null,
|
|
749
|
-
activeLocale: "zh"
|
|
1121
|
+
activeLocale: "zh",
|
|
1122
|
+
tier: OFF_TIER,
|
|
1123
|
+
tierAt: 0,
|
|
1124
|
+
lastFrameAt: 0,
|
|
1125
|
+
sseHealthy: false
|
|
750
1126
|
});
|
|
751
1127
|
function showToast(text) {
|
|
752
1128
|
lowtideStore.update((draft) => {
|
|
@@ -761,30 +1137,87 @@ window.__ModuleLoader__.load({
|
|
|
761
1137
|
draft.toast = null;
|
|
762
1138
|
});
|
|
763
1139
|
}
|
|
1140
|
+
/** Reset the UI slice (plugin unload) — the full field list lives here so a
|
|
1141
|
+
* new field can never be forgotten by a caller's hand-written literal. */
|
|
1142
|
+
function resetUiState() {
|
|
1143
|
+
lowtideStore.set({
|
|
1144
|
+
host: null,
|
|
1145
|
+
connected: false,
|
|
1146
|
+
error: null,
|
|
1147
|
+
queueOpen: false,
|
|
1148
|
+
reportOpen: false,
|
|
1149
|
+
reportHistoryOpen: false,
|
|
1150
|
+
reportUnread: false,
|
|
1151
|
+
toast: null,
|
|
1152
|
+
lastReportId: null,
|
|
1153
|
+
activeLocale: "zh",
|
|
1154
|
+
tier: OFF_TIER,
|
|
1155
|
+
tierAt: 0,
|
|
1156
|
+
lastFrameAt: 0,
|
|
1157
|
+
sseHealthy: false
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
764
1160
|
/** Poll the host aggregate every 4s; returns the stop function. */
|
|
765
1161
|
let pollNow = null;
|
|
766
1162
|
/** Trigger one immediate poll (used after write actions for fast refresh). */
|
|
767
1163
|
function refreshNow() {
|
|
768
1164
|
if (pollNow !== null) pollNow();
|
|
769
1165
|
}
|
|
1166
|
+
/** The tier clock started by `startPolling` (module-level so actions can poke it). */
|
|
1167
|
+
let tierClock = null;
|
|
1168
|
+
/** Re-derive the displayed tier right now (after a window edit, say). */
|
|
1169
|
+
function refreshTier() {
|
|
1170
|
+
tierClock?.refresh();
|
|
1171
|
+
}
|
|
1172
|
+
/** The windows the tier clock evaluates: host payload first, else the config
|
|
1173
|
+
* fetched by the caller (settings page), else nothing yet. */
|
|
1174
|
+
let tierWindows = null;
|
|
1175
|
+
let tierTz = null;
|
|
1176
|
+
/** Feed the clock from a config payload when no host frame is available yet. */
|
|
1177
|
+
function setTierWindows(windows, tz) {
|
|
1178
|
+
tierWindows = windows;
|
|
1179
|
+
if (tz !== void 0) tierTz = tz;
|
|
1180
|
+
tierClock?.refresh();
|
|
1181
|
+
}
|
|
770
1182
|
function applyState(state) {
|
|
1183
|
+
const frameAt = Date.now();
|
|
1184
|
+
if (Array.isArray(state.windows) && state.windows.length > 0) tierWindows = state.windows;
|
|
1185
|
+
if (typeof state.systemTz === "string" && state.systemTz !== "") tierTz = state.systemTz;
|
|
771
1186
|
lowtideStore.update((draft) => {
|
|
772
1187
|
const previous = draft.host;
|
|
773
1188
|
draft.host = state;
|
|
774
1189
|
draft.connected = true;
|
|
775
1190
|
draft.error = null;
|
|
1191
|
+
draft.lastFrameAt = frameAt;
|
|
1192
|
+
draft.sseHealthy = true;
|
|
776
1193
|
const latestId = state.latestReport?.id ?? null;
|
|
777
1194
|
if (latestId !== null && latestId !== draft.lastReportId) draft.reportUnread = true;
|
|
778
1195
|
if (latestId !== null && latestId !== draft.lastReportId && previous !== null) draft.reportUnread = true;
|
|
779
1196
|
draft.lastReportId = latestId ?? draft.lastReportId;
|
|
780
1197
|
});
|
|
1198
|
+
tierClock?.refresh();
|
|
781
1199
|
}
|
|
1200
|
+
/** How long without a state frame before the push stream counts as stale. */
|
|
1201
|
+
const WATCHDOG_MS = 5e3;
|
|
1202
|
+
/** Reconnect backoff bounds for the event stream. */
|
|
1203
|
+
const RECONNECT_MIN_MS = 5e3;
|
|
1204
|
+
const RECONNECT_MAX_MS = 6e4;
|
|
782
1205
|
function startPolling() {
|
|
783
1206
|
let stopped = false;
|
|
784
1207
|
let esOk = false;
|
|
785
1208
|
let es = null;
|
|
1209
|
+
let reconnectDelay = RECONNECT_MIN_MS;
|
|
1210
|
+
let reconnectTimer = null;
|
|
1211
|
+
/** Freshness: an OPEN stream is not a HEALTHY stream. */
|
|
1212
|
+
function fresh() {
|
|
1213
|
+
return isStreamFresh(lowtideStore.getSnapshot().lastFrameAt, Date.now());
|
|
1214
|
+
}
|
|
1215
|
+
/** Whether the 4s poll fallback should carry the UI right now. */
|
|
1216
|
+
function shouldPoll() {
|
|
1217
|
+
return !esOk || !fresh();
|
|
1218
|
+
}
|
|
786
1219
|
async function poll() {
|
|
787
|
-
if (stopped ||
|
|
1220
|
+
if (stopped || !shouldPoll()) return;
|
|
788
1221
|
try {
|
|
789
1222
|
const res = await fetch("/ds-lowtide/state", { cache: "no-store" });
|
|
790
1223
|
if (!res.ok) throw new Error(`state ${res.status}`);
|
|
@@ -796,41 +1229,97 @@ window.__ModuleLoader__.load({
|
|
|
796
1229
|
});
|
|
797
1230
|
}
|
|
798
1231
|
}
|
|
1232
|
+
function scheduleReconnect() {
|
|
1233
|
+
if (stopped || reconnectTimer !== null) return;
|
|
1234
|
+
reconnectTimer = setTimeout(() => {
|
|
1235
|
+
reconnectTimer = null;
|
|
1236
|
+
reconnectDelay = Math.min(reconnectDelay * 2, RECONNECT_MAX_MS);
|
|
1237
|
+
connectSSE();
|
|
1238
|
+
}, reconnectDelay);
|
|
1239
|
+
}
|
|
799
1240
|
function connectSSE() {
|
|
800
1241
|
if (stopped || typeof EventSource === "undefined") return;
|
|
1242
|
+
if (es !== null) {
|
|
1243
|
+
try {
|
|
1244
|
+
es.close();
|
|
1245
|
+
} catch {}
|
|
1246
|
+
es = null;
|
|
1247
|
+
}
|
|
801
1248
|
const source = new EventSource("/ds-lowtide/events");
|
|
802
1249
|
es = source;
|
|
803
1250
|
source.addEventListener("state", (event) => {
|
|
804
1251
|
try {
|
|
805
1252
|
applyState(JSON.parse(event.data));
|
|
1253
|
+
reconnectDelay = RECONNECT_MIN_MS;
|
|
806
1254
|
} catch {}
|
|
807
1255
|
});
|
|
808
1256
|
source.onopen = () => {
|
|
809
1257
|
esOk = true;
|
|
810
1258
|
lowtideStore.update((draft) => {
|
|
811
1259
|
draft.connected = true;
|
|
812
|
-
draft.error = null;
|
|
813
1260
|
});
|
|
814
1261
|
};
|
|
815
1262
|
source.onerror = () => {
|
|
816
1263
|
esOk = false;
|
|
817
1264
|
lowtideStore.update((draft) => {
|
|
818
1265
|
draft.connected = false;
|
|
1266
|
+
draft.sseHealthy = false;
|
|
819
1267
|
draft.error = "实时连接断开,已切换轮询重连…";
|
|
820
1268
|
});
|
|
1269
|
+
scheduleReconnect();
|
|
821
1270
|
};
|
|
822
1271
|
}
|
|
1272
|
+
/**
|
|
1273
|
+
* Watchdog: an EventSource can stay "open" forever after the peer vanished
|
|
1274
|
+
* (half-open socket following a host restart, sleep/resume, a frozen
|
|
1275
|
+
* renderer). Without this, polling stayed disabled and the pill froze —
|
|
1276
|
+
* the reported bug. Demote the stream, let polling carry the UI, reconnect.
|
|
1277
|
+
*/
|
|
1278
|
+
function watchdog() {
|
|
1279
|
+
if (stopped) return;
|
|
1280
|
+
if (!esOk || fresh()) return;
|
|
1281
|
+
lowtideStore.update((draft) => {
|
|
1282
|
+
draft.sseHealthy = false;
|
|
1283
|
+
draft.error = "实时推送已停止,正在重连…";
|
|
1284
|
+
});
|
|
1285
|
+
esOk = false;
|
|
1286
|
+
if (es !== null) {
|
|
1287
|
+
try {
|
|
1288
|
+
es.close();
|
|
1289
|
+
} catch {}
|
|
1290
|
+
es = null;
|
|
1291
|
+
}
|
|
1292
|
+
scheduleReconnect();
|
|
1293
|
+
}
|
|
823
1294
|
pollNow = poll;
|
|
1295
|
+
tierClock = startTierClock({
|
|
1296
|
+
getWindows: () => tierWindows,
|
|
1297
|
+
getTimeZone: () => tierTimeZone(tierTz),
|
|
1298
|
+
onChange: (tier) => {
|
|
1299
|
+
lowtideStore.update((draft) => {
|
|
1300
|
+
draft.tier = tier;
|
|
1301
|
+
draft.tierAt = Date.now();
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
824
1305
|
poll();
|
|
825
1306
|
const timer = setInterval(() => {
|
|
826
1307
|
poll();
|
|
827
1308
|
}, 4e3);
|
|
1309
|
+
const watchdogTimer = setInterval(watchdog, WATCHDOG_MS);
|
|
828
1310
|
connectSSE();
|
|
829
1311
|
return () => {
|
|
830
1312
|
stopped = true;
|
|
831
1313
|
esOk = false;
|
|
832
1314
|
pollNow = null;
|
|
833
1315
|
clearInterval(timer);
|
|
1316
|
+
clearInterval(watchdogTimer);
|
|
1317
|
+
if (reconnectTimer !== null) {
|
|
1318
|
+
clearTimeout(reconnectTimer);
|
|
1319
|
+
reconnectTimer = null;
|
|
1320
|
+
}
|
|
1321
|
+
tierClock?.stop();
|
|
1322
|
+
tierClock = null;
|
|
834
1323
|
if (es !== null) {
|
|
835
1324
|
es.close();
|
|
836
1325
|
es = null;
|
|
@@ -950,7 +1439,8 @@ window.__ModuleLoader__.load({
|
|
|
950
1439
|
return await (await fetch("/ds-lowtide/config", { cache: "no-store" })).json();
|
|
951
1440
|
}
|
|
952
1441
|
/** Settings-page meta from the live state: system timezone + official peak
|
|
953
|
-
* windows converted to the local clock (explainer + one-click adopt)
|
|
1442
|
+
* windows converted to the local clock (explainer + one-click adopt), plus
|
|
1443
|
+
* whether the saved windows drifted from the official schedule. */
|
|
954
1444
|
async function getStateMeta() {
|
|
955
1445
|
try {
|
|
956
1446
|
const res = await fetch("/ds-lowtide/state", { cache: "no-store" });
|
|
@@ -962,7 +1452,8 @@ window.__ModuleLoader__.load({
|
|
|
962
1452
|
return {
|
|
963
1453
|
ok: true,
|
|
964
1454
|
systemTz: typeof body.systemTz === "string" ? body.systemTz : "",
|
|
965
|
-
officialInLocal: Array.isArray(body.officialInLocal) ? body.officialInLocal : []
|
|
1455
|
+
officialInLocal: Array.isArray(body.officialInLocal) ? body.officialInLocal : [],
|
|
1456
|
+
officialDrift: body.officialDrift === true
|
|
966
1457
|
};
|
|
967
1458
|
} catch (error) {
|
|
968
1459
|
return {
|
|
@@ -994,8 +1485,8 @@ window.__ModuleLoader__.load({
|
|
|
994
1485
|
} catch {}
|
|
995
1486
|
}
|
|
996
1487
|
//#endregion
|
|
997
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
998
|
-
const css$12 = ".
|
|
1488
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\PriceBand.module.css.mjs
|
|
1489
|
+
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
1490
|
const tagId$12 = "dsh-lowtide/PriceBand.module.css";
|
|
1000
1491
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$12) + "]") === null) {
|
|
1001
1492
|
const tag = document.createElement("style");
|
|
@@ -1005,15 +1496,15 @@ window.__ModuleLoader__.load({
|
|
|
1005
1496
|
document.head.appendChild(tag);
|
|
1006
1497
|
}
|
|
1007
1498
|
var PriceBand_module_css_default = {
|
|
1008
|
-
"
|
|
1009
|
-
"bandWrap": "
|
|
1010
|
-
"
|
|
1011
|
-
"
|
|
1012
|
-
"
|
|
1013
|
-
"
|
|
1014
|
-
"bandPeak": "
|
|
1015
|
-
"
|
|
1016
|
-
"bandCustom": "
|
|
1499
|
+
"bandNow": "EUchIG_bandNow",
|
|
1500
|
+
"bandWrap": "EUchIG_bandWrap",
|
|
1501
|
+
"bandAxis": "EUchIG_bandAxis",
|
|
1502
|
+
"band": "EUchIG_band",
|
|
1503
|
+
"bandOff": "EUchIG_bandOff",
|
|
1504
|
+
"bandAxisLabel": "EUchIG_bandAxisLabel",
|
|
1505
|
+
"bandPeak": "EUchIG_bandPeak",
|
|
1506
|
+
"bandCell": "EUchIG_bandCell",
|
|
1507
|
+
"bandCustom": "EUchIG_bandCustom"
|
|
1017
1508
|
};
|
|
1018
1509
|
//#endregion
|
|
1019
1510
|
//#region client/components/PriceBand.tsx
|
|
@@ -1067,8 +1558,8 @@ window.__ModuleLoader__.load({
|
|
|
1067
1558
|
});
|
|
1068
1559
|
}
|
|
1069
1560
|
//#endregion
|
|
1070
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
1071
|
-
const css$11 = ".
|
|
1561
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\WindowEditorModal.module.css.mjs
|
|
1562
|
+
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
1563
|
const tagId$11 = "dsh-lowtide/WindowEditorModal.module.css";
|
|
1073
1564
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$11) + "]") === null) {
|
|
1074
1565
|
const tag = document.createElement("style");
|
|
@@ -1078,18 +1569,18 @@ window.__ModuleLoader__.load({
|
|
|
1078
1569
|
document.head.appendChild(tag);
|
|
1079
1570
|
}
|
|
1080
1571
|
var WindowEditorModal_module_css_default = {
|
|
1081
|
-
"
|
|
1082
|
-
"
|
|
1083
|
-
"
|
|
1084
|
-
"
|
|
1085
|
-
"
|
|
1086
|
-
"
|
|
1087
|
-
"
|
|
1088
|
-
"
|
|
1089
|
-
"
|
|
1090
|
-
"
|
|
1091
|
-
"
|
|
1092
|
-
"
|
|
1572
|
+
"footerSpacer": "qLyHCq_footerSpacer",
|
|
1573
|
+
"row": "qLyHCq_row",
|
|
1574
|
+
"dash": "qLyHCq_dash",
|
|
1575
|
+
"footer": "qLyHCq_footer",
|
|
1576
|
+
"error": "qLyHCq_error",
|
|
1577
|
+
"wide": "qLyHCq_wide",
|
|
1578
|
+
"body": "qLyHCq_body",
|
|
1579
|
+
"tzLine": "qLyHCq_tzLine",
|
|
1580
|
+
"input": "qLyHCq_input",
|
|
1581
|
+
"daysBadge": "qLyHCq_daysBadge",
|
|
1582
|
+
"hint": "qLyHCq_hint",
|
|
1583
|
+
"empty": "qLyHCq_empty"
|
|
1093
1584
|
};
|
|
1094
1585
|
//#endregion
|
|
1095
1586
|
//#region client/components/WindowEditorModal.tsx
|
|
@@ -1128,6 +1619,7 @@ window.__ModuleLoader__.load({
|
|
|
1128
1619
|
const [systemTz, setSystemTz] = (0, react.useState)("");
|
|
1129
1620
|
const [saving, setSaving] = (0, react.useState)(false);
|
|
1130
1621
|
const [error, setError] = (0, react.useState)(null);
|
|
1622
|
+
const nowMs = useWallClock(3e4);
|
|
1131
1623
|
(0, react.useEffect)(() => {
|
|
1132
1624
|
if (!open) return;
|
|
1133
1625
|
let alive = true;
|
|
@@ -1156,6 +1648,13 @@ window.__ModuleLoader__.load({
|
|
|
1156
1648
|
}));
|
|
1157
1649
|
const hasAdvanced = windows.some((w) => !isBase(w));
|
|
1158
1650
|
setSegments(base.length > 0 || hasAdvanced ? base : []);
|
|
1651
|
+
if (base.length > 0) setTierWindows(base.map((s, i) => ({
|
|
1652
|
+
id: `editor-${i}`,
|
|
1653
|
+
level: s.level,
|
|
1654
|
+
start: s.start,
|
|
1655
|
+
end: s.end,
|
|
1656
|
+
...s.days !== void 0 ? { days: s.days } : {}
|
|
1657
|
+
})), typeof c.batch?.tz === "string" && c.batch.tz !== "" ? c.batch.tz : null);
|
|
1159
1658
|
}).catch((reason) => {
|
|
1160
1659
|
if (alive) setError(t("settings.configError", { error: reason instanceof Error ? reason.message : String(reason) }));
|
|
1161
1660
|
});
|
|
@@ -1209,15 +1708,24 @@ window.__ModuleLoader__.load({
|
|
|
1209
1708
|
const windows = Array.isArray(c.windows) ? c.windows : [];
|
|
1210
1709
|
const isBase = (w) => (w.level === "peak" || w.level === "off") && (w.tz === void 0 || w.tz === "") && w.multiplier === void 0;
|
|
1211
1710
|
const advanced = windows.filter((w) => !isBase(w));
|
|
1212
|
-
const
|
|
1711
|
+
const editedBase = segments.map((s, i) => ({
|
|
1213
1712
|
id: `win-${Date.now().toString(36)}-${i}-${Math.random().toString(36).slice(2, 7)}`,
|
|
1214
1713
|
level: s.level,
|
|
1215
1714
|
start: s.start,
|
|
1216
1715
|
end: s.end,
|
|
1217
1716
|
...s.days !== void 0 && s.days.length > 0 ? { days: s.days } : {}
|
|
1218
|
-
}))
|
|
1717
|
+
}));
|
|
1718
|
+
const res = await updateConfig({ windows: [...editedBase, ...advanced] });
|
|
1219
1719
|
setSaving(false);
|
|
1220
1720
|
if (res.ok) {
|
|
1721
|
+
setTierWindows(editedBase.map((w) => ({
|
|
1722
|
+
id: w.id,
|
|
1723
|
+
level: w.level,
|
|
1724
|
+
start: w.start,
|
|
1725
|
+
end: w.end,
|
|
1726
|
+
..."days" in w && w.days !== void 0 ? { days: w.days } : {}
|
|
1727
|
+
})), typeof c.batch?.tz === "string" && c.batch.tz !== "" ? c.batch.tz : null);
|
|
1728
|
+
refreshTier();
|
|
1221
1729
|
showToast(t("toast.windowsSaved"));
|
|
1222
1730
|
refreshNow();
|
|
1223
1731
|
onClose();
|
|
@@ -1227,7 +1735,7 @@ window.__ModuleLoader__.load({
|
|
|
1227
1735
|
setError(t("toast.saveFailed", { error: reason instanceof Error ? reason.message : String(reason) }));
|
|
1228
1736
|
}
|
|
1229
1737
|
}
|
|
1230
|
-
const nowIndex = Math.floor((
|
|
1738
|
+
const nowIndex = Math.floor((new Date(nowMs).getHours() * 60 + new Date(nowMs).getMinutes()) / 30) % 48;
|
|
1231
1739
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
1232
1740
|
open,
|
|
1233
1741
|
onClose,
|
|
@@ -1346,8 +1854,8 @@ window.__ModuleLoader__.load({
|
|
|
1346
1854
|
});
|
|
1347
1855
|
}
|
|
1348
1856
|
//#endregion
|
|
1349
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
1350
|
-
const css$10 = ".
|
|
1857
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\PricePill.module.css.mjs
|
|
1858
|
+
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
1859
|
const tagId$10 = "dsh-lowtide/PricePill.module.css";
|
|
1352
1860
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$10) + "]") === null) {
|
|
1353
1861
|
const tag = document.createElement("style");
|
|
@@ -1357,13 +1865,14 @@ window.__ModuleLoader__.load({
|
|
|
1357
1865
|
document.head.appendChild(tag);
|
|
1358
1866
|
}
|
|
1359
1867
|
var PricePill_module_css_default = {
|
|
1360
|
-
"
|
|
1361
|
-
"
|
|
1362
|
-
"
|
|
1363
|
-
"saved": "
|
|
1364
|
-
"
|
|
1365
|
-
"
|
|
1366
|
-
"
|
|
1868
|
+
"pillStale": "oHcJEa_pillStale",
|
|
1869
|
+
"badge": "oHcJEa_badge",
|
|
1870
|
+
"queueIcon": "oHcJEa_queueIcon",
|
|
1871
|
+
"saved": "oHcJEa_saved",
|
|
1872
|
+
"count": "oHcJEa_count",
|
|
1873
|
+
"pill": "oHcJEa_pill",
|
|
1874
|
+
"dot": "oHcJEa_dot",
|
|
1875
|
+
"label": "oHcJEa_label"
|
|
1367
1876
|
};
|
|
1368
1877
|
//#endregion
|
|
1369
1878
|
//#region client/components/PricePill.tsx
|
|
@@ -1376,19 +1885,33 @@ window.__ModuleLoader__.load({
|
|
|
1376
1885
|
* the decision happens. The tooltip keeps the full price detail.
|
|
1377
1886
|
* (The "starts at" countdown was removed — no action value for the user.)
|
|
1378
1887
|
* Click toggles the queue dock. All copy rides the `t` seat (i18n).
|
|
1888
|
+
*
|
|
1889
|
+
* v0.2.2 (bug fix): the displayed 闲时/忙时 comes from the LOCAL tier clock
|
|
1890
|
+
* (`store.tier`, derived from the host's windows + this machine's clock), not
|
|
1891
|
+
* from the last pushed snapshot. A silently stalled SSE stream used to freeze
|
|
1892
|
+
* this indicator forever; now it keeps following the clock and the pill says
|
|
1893
|
+
* how stale the pushed data is.
|
|
1379
1894
|
*/
|
|
1380
1895
|
function PricePill({ t }) {
|
|
1381
1896
|
const state = useLowtide((s) => s.host);
|
|
1382
1897
|
const connected = useLowtide((s) => s.connected);
|
|
1898
|
+
const tier = useLowtide((s) => s.tier);
|
|
1899
|
+
const tierAt = useLowtide((s) => s.tierAt);
|
|
1900
|
+
const lastFrameAt = useLowtide((s) => s.lastFrameAt);
|
|
1901
|
+
const sseHealthy = useLowtide((s) => s.sseHealthy);
|
|
1383
1902
|
const [editorOpen, setEditorOpen] = (0, react.useState)(false);
|
|
1384
1903
|
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
|
|
1904
|
+
const shownLevel = tierAt > 0 ? tier.level : state.price.tier;
|
|
1905
|
+
const shownMultiplier = tierAt > 0 ? tier.multiplier : state.price.multiplier;
|
|
1906
|
+
const isPeak = shownLevel === "peak";
|
|
1907
|
+
const isCustom = shownLevel === "custom";
|
|
1387
1908
|
const isRunning = state.batch.running;
|
|
1388
|
-
const
|
|
1909
|
+
const staleMs = lastFrameAt > 0 ? Date.now() - lastFrameAt : 0;
|
|
1910
|
+
const stale = !sseHealthy && staleMs > 45e3;
|
|
1911
|
+
const dotState = isRunning ? "running" : stale ? "ending" : isPeak || isCustom ? "peak" : "off";
|
|
1389
1912
|
const pending = state.queue.pendingReview;
|
|
1390
1913
|
const todo = state.queue.queued + pending + state.queue.running;
|
|
1391
|
-
const tierText = isPeak ? t("pill.peak") : isCustom ? t("pill.custom", { multiplier:
|
|
1914
|
+
const tierText = isPeak ? t("pill.peak") : isCustom ? t("pill.custom", { multiplier: shownMultiplier }) : t("pill.off");
|
|
1392
1915
|
let label;
|
|
1393
1916
|
if (isRunning) label = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t("pill.running", {
|
|
1394
1917
|
running: state.queue.running,
|
|
@@ -1402,7 +1925,8 @@ window.__ModuleLoader__.load({
|
|
|
1402
1925
|
t("pill.queued")
|
|
1403
1926
|
] });
|
|
1404
1927
|
else label = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: tierText });
|
|
1405
|
-
const
|
|
1928
|
+
const shownWindow = tierAt > 0 ? tier.window : state.level?.window ?? null;
|
|
1929
|
+
const windowHint = shownWindow !== null ? `${shownWindow.start}–${shownWindow.end}` : "";
|
|
1406
1930
|
const tooltipLines = [];
|
|
1407
1931
|
tooltipLines.push(windowHint !== "" ? t("tooltip.time", {
|
|
1408
1932
|
tier: tierText,
|
|
@@ -1425,11 +1949,15 @@ window.__ModuleLoader__.load({
|
|
|
1425
1949
|
}));
|
|
1426
1950
|
else if (saved > 0) tooltipLines.push(t("tooltip.ledgerSaved", { saved: saved.toFixed(2) }));
|
|
1427
1951
|
else if (spent > 0) tooltipLines.push(t("tooltip.ledgerSpent", { spent: spent.toFixed(2) }));
|
|
1952
|
+
if (stale) {
|
|
1953
|
+
const minutes = Math.max(1, Math.round(staleMs / 6e4));
|
|
1954
|
+
tooltipLines.push(t("pill.stale", { minutes }));
|
|
1955
|
+
}
|
|
1428
1956
|
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
1957
|
label: tooltipLines.join("\n"),
|
|
1430
1958
|
side: "bottom",
|
|
1431
1959
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Pill, {
|
|
1432
|
-
className: PricePill_module_css_default.pill,
|
|
1960
|
+
className: stale ? `${PricePill_module_css_default.pill} ${PricePill_module_css_default.pillStale}` : PricePill_module_css_default.pill,
|
|
1433
1961
|
active: editorOpen,
|
|
1434
1962
|
onClick: () => setEditorOpen(true),
|
|
1435
1963
|
children: [
|
|
@@ -1513,8 +2041,8 @@ window.__ModuleLoader__.load({
|
|
|
1513
2041
|
}
|
|
1514
2042
|
}
|
|
1515
2043
|
//#endregion
|
|
1516
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
1517
|
-
const css$9 = ".
|
|
2044
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\TaskForm.module.css.mjs
|
|
2045
|
+
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
2046
|
const tagId$9 = "dsh-lowtide/TaskForm.module.css";
|
|
1519
2047
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$9) + "]") === null) {
|
|
1520
2048
|
const tag = document.createElement("style");
|
|
@@ -1524,29 +2052,29 @@ window.__ModuleLoader__.load({
|
|
|
1524
2052
|
document.head.appendChild(tag);
|
|
1525
2053
|
}
|
|
1526
2054
|
var TaskForm_module_css_default = {
|
|
1527
|
-
"
|
|
1528
|
-
"
|
|
1529
|
-
"
|
|
1530
|
-
"
|
|
1531
|
-
"
|
|
1532
|
-
"
|
|
1533
|
-
"
|
|
1534
|
-
"
|
|
1535
|
-
"
|
|
1536
|
-
"
|
|
1537
|
-
"pillRow": "
|
|
1538
|
-
"
|
|
1539
|
-
"
|
|
1540
|
-
"
|
|
1541
|
-
"
|
|
1542
|
-
"
|
|
1543
|
-
"
|
|
1544
|
-
"
|
|
1545
|
-
"
|
|
1546
|
-
"
|
|
1547
|
-
"
|
|
1548
|
-
"
|
|
1549
|
-
"
|
|
2055
|
+
"fieldInput": "kjcGda_fieldInput",
|
|
2056
|
+
"advancedBtn": "kjcGda_advancedBtn",
|
|
2057
|
+
"sessionPickRow": "kjcGda_sessionPickRow",
|
|
2058
|
+
"strategyPill": "kjcGda_strategyPill",
|
|
2059
|
+
"fieldLabel": "kjcGda_fieldLabel",
|
|
2060
|
+
"costTag": "kjcGda_costTag",
|
|
2061
|
+
"compactInput": "kjcGda_compactInput",
|
|
2062
|
+
"field": "kjcGda_field",
|
|
2063
|
+
"advancedBody": "kjcGda_advancedBody",
|
|
2064
|
+
"compactRow": "kjcGda_compactRow",
|
|
2065
|
+
"pillRow": "kjcGda_pillRow",
|
|
2066
|
+
"modelFallbackRow": "kjcGda_modelFallbackRow",
|
|
2067
|
+
"compactLabel": "kjcGda_compactLabel",
|
|
2068
|
+
"modal": "kjcGda_modal",
|
|
2069
|
+
"advancedIcon": "kjcGda_advancedIcon",
|
|
2070
|
+
"guidanceInput": "kjcGda_guidanceInput",
|
|
2071
|
+
"warning": "kjcGda_warning",
|
|
2072
|
+
"compact": "kjcGda_compact",
|
|
2073
|
+
"autonomyBtn": "kjcGda_autonomyBtn",
|
|
2074
|
+
"strategyActive": "kjcGda_strategyActive",
|
|
2075
|
+
"prompt": "kjcGda_prompt",
|
|
2076
|
+
"strategyHint": "kjcGda_strategyHint",
|
|
2077
|
+
"warningIcon": "kjcGda_warningIcon"
|
|
1550
2078
|
};
|
|
1551
2079
|
//#endregion
|
|
1552
2080
|
//#region client/components/TaskForm.tsx
|
|
@@ -2093,8 +2621,8 @@ window.__ModuleLoader__.load({
|
|
|
2093
2621
|
});
|
|
2094
2622
|
}
|
|
2095
2623
|
//#endregion
|
|
2096
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
2097
|
-
const css$8 = ".
|
|
2624
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\InterceptCard.module.css.mjs
|
|
2625
|
+
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
2626
|
const tagId$8 = "dsh-lowtide/InterceptCard.module.css";
|
|
2099
2627
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$8) + "]") === null) {
|
|
2100
2628
|
const tag = document.createElement("style");
|
|
@@ -2104,17 +2632,17 @@ window.__ModuleLoader__.load({
|
|
|
2104
2632
|
document.head.appendChild(tag);
|
|
2105
2633
|
}
|
|
2106
2634
|
var InterceptCard_module_css_default = {
|
|
2107
|
-
"
|
|
2108
|
-
"
|
|
2109
|
-
"
|
|
2110
|
-
"
|
|
2111
|
-
"
|
|
2112
|
-
"
|
|
2113
|
-
"
|
|
2114
|
-
"
|
|
2115
|
-
"
|
|
2116
|
-
"
|
|
2117
|
-
"
|
|
2635
|
+
"header": "_9OZWeG_header",
|
|
2636
|
+
"close": "_9OZWeG_close",
|
|
2637
|
+
"queueStatus": "_9OZWeG_queueStatus",
|
|
2638
|
+
"priceLabel": "_9OZWeG_priceLabel",
|
|
2639
|
+
"queueIcon": "_9OZWeG_queueIcon",
|
|
2640
|
+
"card": "_9OZWeG_card",
|
|
2641
|
+
"title": "_9OZWeG_title",
|
|
2642
|
+
"dismiss": "_9OZWeG_dismiss",
|
|
2643
|
+
"row": "_9OZWeG_row",
|
|
2644
|
+
"dot": "_9OZWeG_dot",
|
|
2645
|
+
"compare": "_9OZWeG_compare"
|
|
2118
2646
|
};
|
|
2119
2647
|
//#endregion
|
|
2120
2648
|
//#region client/components/InterceptCard.tsx
|
|
@@ -2141,11 +2669,18 @@ window.__ModuleLoader__.load({
|
|
|
2141
2669
|
* Pure chain routing: priced window ∧ not dismissed ∧ session present ∧
|
|
2142
2670
|
* draft non-empty. The draft condition keeps the native bar (and the queue
|
|
2143
2671
|
* dock) visible until the user actually starts typing (PLAN §6.2).
|
|
2672
|
+
*
|
|
2673
|
+
* v0.2.2: the tier comes from the local clock (`store.tier`), so a stalled
|
|
2674
|
+
* push stream can neither hide nor freeze the intercept card at a boundary.
|
|
2144
2675
|
*/
|
|
2145
2676
|
function selectIntercept(owner) {
|
|
2146
|
-
const
|
|
2677
|
+
const snapshot = lowtideStore.getSnapshot();
|
|
2678
|
+
const host = snapshot.host;
|
|
2147
2679
|
if (host === null) return null;
|
|
2148
|
-
|
|
2680
|
+
const tier = snapshot.tierAt > 0 ? snapshot.tier : null;
|
|
2681
|
+
const level = tier?.level ?? host.price.tier;
|
|
2682
|
+
const multiplier = tier?.multiplier ?? host.price.multiplier;
|
|
2683
|
+
if (!(level === "peak" || level === "custom" && multiplier > 1)) return null;
|
|
2149
2684
|
if (host.dismissedPeakToday) return null;
|
|
2150
2685
|
if (readInterceptDraft().trim() === "") return null;
|
|
2151
2686
|
if (isInterceptSessionDismissed()) return null;
|
|
@@ -2156,11 +2691,16 @@ window.__ModuleLoader__.load({
|
|
|
2156
2691
|
const { t } = props;
|
|
2157
2692
|
const draft = props.useInput((input) => input.draft);
|
|
2158
2693
|
const host = useLowtide((s) => s.host);
|
|
2694
|
+
const tier = useLowtide((s) => s.tier);
|
|
2695
|
+
const tierAt = useLowtide((s) => s.tierAt);
|
|
2159
2696
|
const [workspace, setWorkspace] = (0, react.useState)(() => lastWorkspace());
|
|
2160
2697
|
const [submitting, setSubmitting] = (0, react.useState)(false);
|
|
2161
2698
|
const [estimateResult, setEstimateResult] = (0, react.useState)(null);
|
|
2162
|
-
const
|
|
2163
|
-
const
|
|
2699
|
+
const shownLevel = tierAt > 0 ? tier.level : host?.price.tier ?? "off";
|
|
2700
|
+
const shownMultiplier = tierAt > 0 ? tier.multiplier : host?.price.multiplier ?? 1;
|
|
2701
|
+
const shownWindow = tierAt > 0 ? tier.window : host?.level?.window ?? null;
|
|
2702
|
+
const peakWindow = shownWindow !== null ? `${shownWindow.start}–${shownWindow.end}` : "";
|
|
2703
|
+
const customMultiplier = shownLevel === "custom" ? shownMultiplier : null;
|
|
2164
2704
|
const tierText = customMultiplier !== null && customMultiplier > 1 ? t("intercept.tierCustom", { multiplier: customMultiplier }) : t("intercept.tierPeak");
|
|
2165
2705
|
const formValues = {
|
|
2166
2706
|
prompt: draft,
|
|
@@ -2170,7 +2710,7 @@ window.__ModuleLoader__.load({
|
|
|
2170
2710
|
priority: 1,
|
|
2171
2711
|
files: "",
|
|
2172
2712
|
reasoning: "follow",
|
|
2173
|
-
model: host?.price.model ?? "
|
|
2713
|
+
model: host?.price.model ?? "",
|
|
2174
2714
|
modelProvider: "",
|
|
2175
2715
|
strategyHint: "",
|
|
2176
2716
|
autonomy: host?.autonomy === "l1" || host?.autonomy === "l3" ? host.autonomy : "l2",
|
|
@@ -2348,8 +2888,8 @@ window.__ModuleLoader__.load({
|
|
|
2348
2888
|
return "";
|
|
2349
2889
|
}
|
|
2350
2890
|
//#endregion
|
|
2351
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
2352
|
-
const css$7 = ".
|
|
2891
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\TaskRow.module.css.mjs
|
|
2892
|
+
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
2893
|
const tagId$7 = "dsh-lowtide/TaskRow.module.css";
|
|
2354
2894
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$7) + "]") === null) {
|
|
2355
2895
|
const tag = document.createElement("style");
|
|
@@ -2359,18 +2899,18 @@ window.__ModuleLoader__.load({
|
|
|
2359
2899
|
document.head.appendChild(tag);
|
|
2360
2900
|
}
|
|
2361
2901
|
var TaskRow_module_css_default = {
|
|
2362
|
-
"
|
|
2363
|
-
"
|
|
2364
|
-
"
|
|
2365
|
-
"
|
|
2366
|
-
"
|
|
2367
|
-
"
|
|
2368
|
-
"
|
|
2369
|
-
"rowActions": "
|
|
2370
|
-
"
|
|
2371
|
-
"
|
|
2372
|
-
"
|
|
2373
|
-
"
|
|
2902
|
+
"green": "ovX5jq_green",
|
|
2903
|
+
"taskMain": "ovX5jq_taskMain",
|
|
2904
|
+
"taskMeta": "ovX5jq_taskMeta",
|
|
2905
|
+
"taskRow": "ovX5jq_taskRow",
|
|
2906
|
+
"amber": "ovX5jq_amber",
|
|
2907
|
+
"blue": "ovX5jq_blue",
|
|
2908
|
+
"red": "ovX5jq_red",
|
|
2909
|
+
"rowActions": "ovX5jq_rowActions",
|
|
2910
|
+
"confirming": "ovX5jq_confirming",
|
|
2911
|
+
"droppedRow": "ovX5jq_droppedRow",
|
|
2912
|
+
"taskPrompt": "ovX5jq_taskPrompt",
|
|
2913
|
+
"iconBtn": "ovX5jq_iconBtn"
|
|
2374
2914
|
};
|
|
2375
2915
|
//#endregion
|
|
2376
2916
|
//#region client/components/TaskRow.tsx
|
|
@@ -2543,8 +3083,8 @@ window.__ModuleLoader__.load({
|
|
|
2543
3083
|
});
|
|
2544
3084
|
}
|
|
2545
3085
|
//#endregion
|
|
2546
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
2547
|
-
const css$6 = ".
|
|
3086
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\CandidatesView.module.css.mjs
|
|
3087
|
+
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
3088
|
const tagId$6 = "dsh-lowtide/CandidatesView.module.css";
|
|
2549
3089
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$6) + "]") === null) {
|
|
2550
3090
|
const tag = document.createElement("style");
|
|
@@ -2554,15 +3094,15 @@ window.__ModuleLoader__.load({
|
|
|
2554
3094
|
document.head.appendChild(tag);
|
|
2555
3095
|
}
|
|
2556
3096
|
var CandidatesView_module_css_default = {
|
|
2557
|
-
"
|
|
2558
|
-
"
|
|
2559
|
-
"
|
|
2560
|
-
"
|
|
2561
|
-
"
|
|
2562
|
-
"
|
|
2563
|
-
"
|
|
2564
|
-
"
|
|
2565
|
-
"
|
|
3097
|
+
"picked": "j6P39W_picked",
|
|
3098
|
+
"pickedTag": "j6P39W_pickedTag",
|
|
3099
|
+
"meta": "j6P39W_meta",
|
|
3100
|
+
"excerpt": "j6P39W_excerpt",
|
|
3101
|
+
"head": "j6P39W_head",
|
|
3102
|
+
"title": "j6P39W_title",
|
|
3103
|
+
"wrap": "j6P39W_wrap",
|
|
3104
|
+
"candidate": "j6P39W_candidate",
|
|
3105
|
+
"toggle": "j6P39W_toggle"
|
|
2566
3106
|
};
|
|
2567
3107
|
//#endregion
|
|
2568
3108
|
//#region client/components/CandidatesView.tsx
|
|
@@ -2624,8 +3164,8 @@ window.__ModuleLoader__.load({
|
|
|
2624
3164
|
});
|
|
2625
3165
|
}
|
|
2626
3166
|
//#endregion
|
|
2627
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
2628
|
-
const css$5 = ".
|
|
3167
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\TaskDetail.module.css.mjs
|
|
3168
|
+
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
3169
|
const tagId$5 = "dsh-lowtide/TaskDetail.module.css";
|
|
2630
3170
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) {
|
|
2631
3171
|
const tag = document.createElement("style");
|
|
@@ -2635,21 +3175,21 @@ window.__ModuleLoader__.load({
|
|
|
2635
3175
|
document.head.appendChild(tag);
|
|
2636
3176
|
}
|
|
2637
3177
|
var TaskDetail_module_css_default = {
|
|
2638
|
-
"
|
|
2639
|
-
"
|
|
2640
|
-
"
|
|
2641
|
-
"
|
|
2642
|
-
"
|
|
2643
|
-
"
|
|
2644
|
-
"
|
|
2645
|
-
"
|
|
2646
|
-
"
|
|
2647
|
-
"
|
|
2648
|
-
"
|
|
2649
|
-
"
|
|
2650
|
-
"detailResumed": "
|
|
2651
|
-
"
|
|
2652
|
-
"
|
|
3178
|
+
"detailReview": "bhvrsW_detailReview",
|
|
3179
|
+
"modalBody": "bhvrsW_modalBody",
|
|
3180
|
+
"modalFooter": "bhvrsW_modalFooter",
|
|
3181
|
+
"detailSection": "bhvrsW_detailSection",
|
|
3182
|
+
"detailItem": "bhvrsW_detailItem",
|
|
3183
|
+
"detailValue": "bhvrsW_detailValue",
|
|
3184
|
+
"detailResumeWarn": "bhvrsW_detailResumeWarn",
|
|
3185
|
+
"detailLabel": "bhvrsW_detailLabel",
|
|
3186
|
+
"detailError": "bhvrsW_detailError",
|
|
3187
|
+
"detailPrompt": "bhvrsW_detailPrompt",
|
|
3188
|
+
"detailRun": "bhvrsW_detailRun",
|
|
3189
|
+
"detailGrid": "bhvrsW_detailGrid",
|
|
3190
|
+
"detailResumed": "bhvrsW_detailResumed",
|
|
3191
|
+
"detailReviewBody": "bhvrsW_detailReviewBody",
|
|
3192
|
+
"detailFile": "bhvrsW_detailFile"
|
|
2653
3193
|
};
|
|
2654
3194
|
//#endregion
|
|
2655
3195
|
//#region client/components/TaskDetail.tsx
|
|
@@ -2872,8 +3412,8 @@ window.__ModuleLoader__.load({
|
|
|
2872
3412
|
});
|
|
2873
3413
|
}
|
|
2874
3414
|
//#endregion
|
|
2875
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
2876
|
-
const css$4 = ".
|
|
3415
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\NewTaskModal.module.css.mjs
|
|
3416
|
+
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
3417
|
const tagId$4 = "dsh-lowtide/NewTaskModal.module.css";
|
|
2878
3418
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) {
|
|
2879
3419
|
const tag = document.createElement("style");
|
|
@@ -2883,9 +3423,9 @@ window.__ModuleLoader__.load({
|
|
|
2883
3423
|
document.head.appendChild(tag);
|
|
2884
3424
|
}
|
|
2885
3425
|
var NewTaskModal_module_css_default = {
|
|
2886
|
-
"modalFooter": "
|
|
2887
|
-
"
|
|
2888
|
-
"
|
|
3426
|
+
"modalFooter": "QIpxNq_modalFooter",
|
|
3427
|
+
"wide": "QIpxNq_wide",
|
|
3428
|
+
"modalBody": "QIpxNq_modalBody"
|
|
2889
3429
|
};
|
|
2890
3430
|
//#endregion
|
|
2891
3431
|
//#region client/components/NewTaskModal.tsx
|
|
@@ -2910,8 +3450,8 @@ window.__ModuleLoader__.load({
|
|
|
2910
3450
|
priority: 3,
|
|
2911
3451
|
files: "",
|
|
2912
3452
|
reasoning: "follow",
|
|
2913
|
-
model: "
|
|
2914
|
-
modelProvider: "
|
|
3453
|
+
model: "",
|
|
3454
|
+
modelProvider: "",
|
|
2915
3455
|
strategyHint: "",
|
|
2916
3456
|
autonomy: defaultAutonomy,
|
|
2917
3457
|
sessionMode: "new",
|
|
@@ -3174,8 +3714,8 @@ window.__ModuleLoader__.load({
|
|
|
3174
3714
|
});
|
|
3175
3715
|
}
|
|
3176
3716
|
//#endregion
|
|
3177
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
3178
|
-
const css$3 = ".
|
|
3717
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\QueueDock.module.css.mjs
|
|
3718
|
+
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
3719
|
const tagId$3 = "dsh-lowtide/QueueDock.module.css";
|
|
3180
3720
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
|
|
3181
3721
|
const tag = document.createElement("style");
|
|
@@ -3185,27 +3725,27 @@ window.__ModuleLoader__.load({
|
|
|
3185
3725
|
document.head.appendChild(tag);
|
|
3186
3726
|
}
|
|
3187
3727
|
var QueueDock_module_css_default = {
|
|
3188
|
-
"
|
|
3189
|
-
"
|
|
3190
|
-
"
|
|
3191
|
-
"
|
|
3192
|
-
"
|
|
3193
|
-
"
|
|
3194
|
-
"
|
|
3195
|
-
"
|
|
3196
|
-
"
|
|
3197
|
-
"
|
|
3198
|
-
"
|
|
3199
|
-
"
|
|
3200
|
-
"
|
|
3201
|
-
"
|
|
3202
|
-
"dockActions": "
|
|
3203
|
-
"
|
|
3204
|
-
"
|
|
3205
|
-
"
|
|
3206
|
-
"
|
|
3207
|
-
"
|
|
3208
|
-
"
|
|
3728
|
+
"sectionToggle": "_2DjDSq_sectionToggle",
|
|
3729
|
+
"empty": "_2DjDSq_empty",
|
|
3730
|
+
"footerActions": "_2DjDSq_footerActions",
|
|
3731
|
+
"reportDot": "_2DjDSq_reportDot",
|
|
3732
|
+
"onboardingDismiss": "_2DjDSq_onboardingDismiss",
|
|
3733
|
+
"dock": "_2DjDSq_dock",
|
|
3734
|
+
"dockTitle": "_2DjDSq_dockTitle",
|
|
3735
|
+
"dockRow": "_2DjDSq_dockRow",
|
|
3736
|
+
"clearBtn": "_2DjDSq_clearBtn",
|
|
3737
|
+
"drawer": "_2DjDSq_drawer",
|
|
3738
|
+
"groupHeader": "_2DjDSq_groupHeader",
|
|
3739
|
+
"onboarding": "_2DjDSq_onboarding",
|
|
3740
|
+
"sectionHead": "_2DjDSq_sectionHead",
|
|
3741
|
+
"pending": "_2DjDSq_pending",
|
|
3742
|
+
"dockActions": "_2DjDSq_dockActions",
|
|
3743
|
+
"groupPath": "_2DjDSq_groupPath",
|
|
3744
|
+
"approveArmed": "_2DjDSq_approveArmed",
|
|
3745
|
+
"group": "_2DjDSq_group",
|
|
3746
|
+
"clearArmed": "_2DjDSq_clearArmed",
|
|
3747
|
+
"footer": "_2DjDSq_footer",
|
|
3748
|
+
"reportBtn": "_2DjDSq_reportBtn"
|
|
3209
3749
|
};
|
|
3210
3750
|
//#endregion
|
|
3211
3751
|
//#region client/components/QueueDock.tsx
|
|
@@ -3525,8 +4065,8 @@ window.__ModuleLoader__.load({
|
|
|
3525
4065
|
});
|
|
3526
4066
|
}
|
|
3527
4067
|
//#endregion
|
|
3528
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
3529
|
-
const css$2 = ".
|
|
4068
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\MorningReport.module.css.mjs
|
|
4069
|
+
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
4070
|
const tagId$2 = "dsh-lowtide/MorningReport.module.css";
|
|
3531
4071
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
|
3532
4072
|
const tag = document.createElement("style");
|
|
@@ -3536,34 +4076,34 @@ window.__ModuleLoader__.load({
|
|
|
3536
4076
|
document.head.appendChild(tag);
|
|
3537
4077
|
}
|
|
3538
4078
|
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
|
-
"
|
|
4079
|
+
"footer": "x0rCEq_footer",
|
|
4080
|
+
"divider": "x0rCEq_divider",
|
|
4081
|
+
"taskRow": "x0rCEq_taskRow",
|
|
4082
|
+
"doneRow": "x0rCEq_doneRow",
|
|
4083
|
+
"historyList": "x0rCEq_historyList",
|
|
4084
|
+
"historyRowWrap": "x0rCEq_historyRowWrap",
|
|
4085
|
+
"clearBtn": "x0rCEq_clearBtn",
|
|
4086
|
+
"clearArmed": "x0rCEq_clearArmed",
|
|
4087
|
+
"historyRow": "x0rCEq_historyRow",
|
|
4088
|
+
"historyMeta": "x0rCEq_historyMeta",
|
|
4089
|
+
"historyFooter": "x0rCEq_historyFooter",
|
|
4090
|
+
"body": "x0rCEq_body",
|
|
4091
|
+
"headlineMeta": "x0rCEq_headlineMeta",
|
|
4092
|
+
"badRow": "x0rCEq_badRow",
|
|
4093
|
+
"taskMain": "x0rCEq_taskMain",
|
|
4094
|
+
"taskPrompt": "x0rCEq_taskPrompt",
|
|
4095
|
+
"headlineLabel": "x0rCEq_headlineLabel",
|
|
4096
|
+
"historyHeader": "x0rCEq_historyHeader",
|
|
4097
|
+
"historyEmpty": "x0rCEq_historyEmpty",
|
|
4098
|
+
"historyDate": "x0rCEq_historyDate",
|
|
4099
|
+
"taskMeta": "x0rCEq_taskMeta",
|
|
4100
|
+
"reviewExcerpt": "x0rCEq_reviewExcerpt",
|
|
4101
|
+
"reviewExcerptBody": "x0rCEq_reviewExcerptBody",
|
|
4102
|
+
"historyDelete": "x0rCEq_historyDelete",
|
|
4103
|
+
"headlineValue": "x0rCEq_headlineValue",
|
|
4104
|
+
"headline": "x0rCEq_headline",
|
|
4105
|
+
"modalFooter": "x0rCEq_modalFooter",
|
|
4106
|
+
"more": "x0rCEq_more"
|
|
3567
4107
|
};
|
|
3568
4108
|
//#endregion
|
|
3569
4109
|
//#region client/components/MorningReport.tsx
|
|
@@ -3884,8 +4424,8 @@ window.__ModuleLoader__.load({
|
|
|
3884
4424
|
});
|
|
3885
4425
|
}
|
|
3886
4426
|
//#endregion
|
|
3887
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
3888
|
-
const css$1 = ".
|
|
4427
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\components\ConfirmGate.module.css.mjs
|
|
4428
|
+
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
4429
|
const tagId$1 = "dsh-lowtide/ConfirmGate.module.css";
|
|
3890
4430
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
3891
4431
|
const tag = document.createElement("style");
|
|
@@ -3895,19 +4435,19 @@ window.__ModuleLoader__.load({
|
|
|
3895
4435
|
document.head.appendChild(tag);
|
|
3896
4436
|
}
|
|
3897
4437
|
var ConfirmGate_module_css_default = {
|
|
3898
|
-
"
|
|
3899
|
-
"
|
|
3900
|
-
"
|
|
3901
|
-
"
|
|
3902
|
-
"
|
|
3903
|
-
"
|
|
3904
|
-
"
|
|
3905
|
-
"
|
|
3906
|
-
"
|
|
3907
|
-
"
|
|
3908
|
-
"
|
|
3909
|
-
"defer": "
|
|
3910
|
-
"
|
|
4438
|
+
"remove": "se0mvq_remove",
|
|
4439
|
+
"list": "se0mvq_list",
|
|
4440
|
+
"prompt": "se0mvq_prompt",
|
|
4441
|
+
"close": "se0mvq_close",
|
|
4442
|
+
"row": "se0mvq_row",
|
|
4443
|
+
"card": "se0mvq_card",
|
|
4444
|
+
"meta": "se0mvq_meta",
|
|
4445
|
+
"more": "se0mvq_more",
|
|
4446
|
+
"footer": "se0mvq_footer",
|
|
4447
|
+
"releaseLabel": "se0mvq_releaseLabel",
|
|
4448
|
+
"title": "se0mvq_title",
|
|
4449
|
+
"defer": "se0mvq_defer",
|
|
4450
|
+
"header": "se0mvq_header"
|
|
3911
4451
|
};
|
|
3912
4452
|
//#endregion
|
|
3913
4453
|
//#region client/components/ConfirmGate.tsx
|
|
@@ -4047,8 +4587,8 @@ window.__ModuleLoader__.load({
|
|
|
4047
4587
|
});
|
|
4048
4588
|
}
|
|
4049
4589
|
//#endregion
|
|
4050
|
-
//#region \0dsh-css:C:\Users\胡克劳\
|
|
4051
|
-
const css = ".
|
|
4590
|
+
//#region \0dsh-css:C:\Users\胡克劳\lowtide\work\dsh-lowtide-0.2.2\packages\dsh-lowtide\client\settings.module.css.mjs
|
|
4591
|
+
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
4592
|
const tagId = "dsh-lowtide/settings.module.css";
|
|
4053
4593
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
4054
4594
|
const tag = document.createElement("style");
|
|
@@ -4058,52 +4598,52 @@ window.__ModuleLoader__.load({
|
|
|
4058
4598
|
document.head.appendChild(tag);
|
|
4059
4599
|
}
|
|
4060
4600
|
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
|
-
"
|
|
4086
|
-
"
|
|
4087
|
-
"
|
|
4088
|
-
"
|
|
4089
|
-
"
|
|
4090
|
-
"
|
|
4091
|
-
"
|
|
4092
|
-
"
|
|
4093
|
-
"
|
|
4094
|
-
"
|
|
4095
|
-
"
|
|
4096
|
-
"
|
|
4097
|
-
"
|
|
4098
|
-
"
|
|
4099
|
-
"
|
|
4100
|
-
"
|
|
4101
|
-
"
|
|
4102
|
-
"
|
|
4103
|
-
"
|
|
4104
|
-
"
|
|
4105
|
-
"
|
|
4106
|
-
"
|
|
4601
|
+
"strategyHint": "_9UODyG_strategyHint",
|
|
4602
|
+
"hint": "_9UODyG_hint",
|
|
4603
|
+
"confirmBox": "_9UODyG_confirmBox",
|
|
4604
|
+
"noWindows": "_9UODyG_noWindows",
|
|
4605
|
+
"officialActions": "_9UODyG_officialActions",
|
|
4606
|
+
"legendDot": "_9UODyG_legendDot",
|
|
4607
|
+
"legend": "_9UODyG_legend",
|
|
4608
|
+
"sectionTitle": "_9UODyG_sectionTitle",
|
|
4609
|
+
"loading": "_9UODyG_loading",
|
|
4610
|
+
"footer": "_9UODyG_footer",
|
|
4611
|
+
"officialTitle": "_9UODyG_officialTitle",
|
|
4612
|
+
"onboardingSteps": "_9UODyG_onboardingSteps",
|
|
4613
|
+
"langLabel": "_9UODyG_langLabel",
|
|
4614
|
+
"autonomyActive": "_9UODyG_autonomyActive",
|
|
4615
|
+
"bandPeak": "_9UODyG_bandPeak",
|
|
4616
|
+
"input": "_9UODyG_input",
|
|
4617
|
+
"error": "_9UODyG_error",
|
|
4618
|
+
"officialBody": "_9UODyG_officialBody",
|
|
4619
|
+
"dayBtn": "_9UODyG_dayBtn",
|
|
4620
|
+
"priceHead": "_9UODyG_priceHead",
|
|
4621
|
+
"confirmBtn": "_9UODyG_confirmBtn",
|
|
4622
|
+
"windowRow": "_9UODyG_windowRow",
|
|
4623
|
+
"fieldLabel": "_9UODyG_fieldLabel",
|
|
4624
|
+
"priceTable": "_9UODyG_priceTable",
|
|
4625
|
+
"onboardingTitle": "_9UODyG_onboardingTitle",
|
|
4626
|
+
"priceRow": "_9UODyG_priceRow",
|
|
4627
|
+
"confirmCancel": "_9UODyG_confirmCancel",
|
|
4628
|
+
"section": "_9UODyG_section",
|
|
4629
|
+
"sectionHead": "_9UODyG_sectionHead",
|
|
4630
|
+
"field": "_9UODyG_field",
|
|
4631
|
+
"onboarding": "_9UODyG_onboarding",
|
|
4632
|
+
"pillRow": "_9UODyG_pillRow",
|
|
4633
|
+
"dayRow": "_9UODyG_dayRow",
|
|
4634
|
+
"dayActive": "_9UODyG_dayActive",
|
|
4635
|
+
"officialCard": "_9UODyG_officialCard",
|
|
4636
|
+
"footerLeft": "_9UODyG_footerLeft",
|
|
4637
|
+
"grid": "_9UODyG_grid",
|
|
4638
|
+
"checkbox": "_9UODyG_checkbox",
|
|
4639
|
+
"bandCustom": "_9UODyG_bandCustom",
|
|
4640
|
+
"legendItem": "_9UODyG_legendItem",
|
|
4641
|
+
"bandOff": "_9UODyG_bandOff",
|
|
4642
|
+
"langRow": "_9UODyG_langRow",
|
|
4643
|
+
"priceTier": "_9UODyG_priceTier",
|
|
4644
|
+
"page": "_9UODyG_page",
|
|
4645
|
+
"priceModel": "_9UODyG_priceModel",
|
|
4646
|
+
"autonomyPill": "_9UODyG_autonomyPill"
|
|
4107
4647
|
};
|
|
4108
4648
|
//#endregion
|
|
4109
4649
|
//#region client/settings.tsx
|
|
@@ -4114,6 +4654,8 @@ window.__ModuleLoader__.load({
|
|
|
4114
4654
|
* Saves through PUT /ds-lowtide/config and takes effect immediately
|
|
4115
4655
|
* (next scheduler tick). All copy rides the `t` seat.
|
|
4116
4656
|
*/
|
|
4657
|
+
/** Editable price-table rows: canonical official ids plus legacy aliases. */
|
|
4658
|
+
const OFFICIAL_PRICE_MODELS = [.../* @__PURE__ */ new Set([...Object.keys(OFFICIAL_PRICES), ...Object.keys(PRICE_ALIASES)])];
|
|
4117
4659
|
/** 当前本地时区的 UTC 偏移标签,如 "UTC+8" / "UTC-5"。 */
|
|
4118
4660
|
function utcOffsetLabel() {
|
|
4119
4661
|
const minutes = -(/* @__PURE__ */ new Date()).getTimezoneOffset();
|
|
@@ -4187,13 +4729,21 @@ window.__ModuleLoader__.load({
|
|
|
4187
4729
|
const [pricesExpanded, setPricesExpanded] = (0, react.useState)(false);
|
|
4188
4730
|
const activeLocale = useLowtide((s) => s.activeLocale);
|
|
4189
4731
|
const [meta, setMeta] = (0, react.useState)(null);
|
|
4732
|
+
const [hostModels, setHostModels] = (0, react.useState)(null);
|
|
4733
|
+
const nowMs = useWallClock(3e4);
|
|
4734
|
+
const nowIndex = Math.floor((new Date(nowMs).getHours() * 60 + new Date(nowMs).getMinutes()) / 30) % 48;
|
|
4190
4735
|
(0, react.useEffect)(() => {
|
|
4191
4736
|
let alive = true;
|
|
4737
|
+
getModels().then((res) => {
|
|
4738
|
+
if (!alive || !res.ok || res.providers === void 0) return;
|
|
4739
|
+
setHostModels(res.providers.flatMap((p) => p.models.map((m) => m.id)));
|
|
4740
|
+
}).catch(() => {});
|
|
4192
4741
|
getStateMeta().then((res) => {
|
|
4193
4742
|
if (!alive) return;
|
|
4194
4743
|
if (res.ok) setMeta({
|
|
4195
4744
|
systemTz: res.systemTz ?? "",
|
|
4196
|
-
officialInLocal: res.officialInLocal ?? []
|
|
4745
|
+
officialInLocal: res.officialInLocal ?? [],
|
|
4746
|
+
officialDrift: res.officialDrift === true
|
|
4197
4747
|
});
|
|
4198
4748
|
}).catch(() => {});
|
|
4199
4749
|
getConfig().then((res) => {
|
|
@@ -4233,6 +4783,16 @@ window.__ModuleLoader__.load({
|
|
|
4233
4783
|
windows: Array.isArray(c.windows) ? c.windows.map(windowToDraft) : [],
|
|
4234
4784
|
prices
|
|
4235
4785
|
});
|
|
4786
|
+
if (Array.isArray(c.windows) && c.windows.length > 0) setTierWindows(c.windows.map((w) => ({
|
|
4787
|
+
id: String(w.id ?? ""),
|
|
4788
|
+
...typeof w.label === "string" && w.label !== "" ? { label: w.label } : {},
|
|
4789
|
+
level: w.level === "peak" || w.level === "custom" ? w.level : "off",
|
|
4790
|
+
start: String(w.start ?? "00:00"),
|
|
4791
|
+
end: String(w.end ?? "00:00"),
|
|
4792
|
+
...Array.isArray(w.days) && w.days.length > 0 ? { days: w.days } : {},
|
|
4793
|
+
...typeof w.tz === "string" && w.tz !== "" ? { tz: w.tz } : {},
|
|
4794
|
+
...typeof w.multiplier === "number" ? { multiplier: w.multiplier } : {}
|
|
4795
|
+
})), typeof batch.tz === "string" && batch.tz !== "" ? batch.tz : null);
|
|
4236
4796
|
}).catch((reason) => {
|
|
4237
4797
|
if (alive) setError(t("settings.configError", { error: reason instanceof Error ? reason.message : String(reason) }));
|
|
4238
4798
|
});
|
|
@@ -4328,11 +4888,11 @@ window.__ModuleLoader__.load({
|
|
|
4328
4888
|
});
|
|
4329
4889
|
showToast(t("toast.restoredDefaults"));
|
|
4330
4890
|
}
|
|
4331
|
-
const priceModels = [.../* @__PURE__ */ new Set([
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
]
|
|
4891
|
+
const priceModels = [.../* @__PURE__ */ new Set([
|
|
4892
|
+
...OFFICIAL_PRICE_MODELS,
|
|
4893
|
+
...hostModels ?? [],
|
|
4894
|
+
...Object.keys(draft.prices)
|
|
4895
|
+
])].sort();
|
|
4336
4896
|
const save = async () => {
|
|
4337
4897
|
setSaving(true);
|
|
4338
4898
|
setError(null);
|
|
@@ -4655,6 +5215,10 @@ window.__ModuleLoader__.load({
|
|
|
4655
5215
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4656
5216
|
className: settings_module_css_default.officialBody,
|
|
4657
5217
|
children: t("settings.officialWeekend")
|
|
5218
|
+
}),
|
|
5219
|
+
meta.officialDrift && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5220
|
+
className: settings_module_css_default.officialBody,
|
|
5221
|
+
children: t("settings.officialDrift")
|
|
4658
5222
|
})
|
|
4659
5223
|
] }),
|
|
4660
5224
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -4779,7 +5343,7 @@ window.__ModuleLoader__.load({
|
|
|
4779
5343
|
start: w.start,
|
|
4780
5344
|
end: w.end
|
|
4781
5345
|
})),
|
|
4782
|
-
nowIndex
|
|
5346
|
+
nowIndex,
|
|
4783
5347
|
t
|
|
4784
5348
|
}),
|
|
4785
5349
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -4981,18 +5545,7 @@ window.__ModuleLoader__.load({
|
|
|
4981
5545
|
}, LowtideSettings));
|
|
4982
5546
|
ctx.effect(() => () => {
|
|
4983
5547
|
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
|
-
});
|
|
5548
|
+
resetUiState();
|
|
4996
5549
|
});
|
|
4997
5550
|
}
|
|
4998
5551
|
//#endregion
|