dsh-input-traffic 0.7.3 → 0.7.5
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/CHANGELOG.md +4 -0
- package/README.en.md +1 -1
- package/README.ja.md +1 -1
- package/README.ko.md +1 -1
- package/README.md +1 -1
- package/dsh.plugin.json +2 -2
- package/lib/client.js +173 -35
- package/lib/client.js.map +1 -1
- package/lib/types/client/family-host.d.ts +51 -0
- package/lib/types/client/family-host.d.ts.map +1 -0
- package/lib/types/client/family-host.js +147 -0
- package/lib/types/client/family-host.js.map +1 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +18 -8
- package/lib/types/client/index.js.map +1 -1
- package/package.json +9 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.7.5 (2026-10-18)
|
|
4
|
+
|
|
5
|
+
- hosts: 追加 0.2.1-rc.2 声明面枚举(34/34 @deepseek-ai/* 宿主 peer 逐包 npm 实测 rc.2 在版;本插件不触 ctx.web provider 与 conversation.input.model.label 槽,代码零改动,纯元数据发版;农场 rc.2 格挂账待命)
|
|
2
6
|
|
|
3
7
|
所有重要变更与 bug 修复记录于此。版本遵循语义化版本(`dsh plugin --profile web add dsh-input-traffic` 安装)。
|
|
4
8
|
|
package/README.en.md
CHANGED
|
@@ -52,7 +52,7 @@ A cordis client plugin assembled via the `dsh plugin` command and a bundle patch
|
|
|
52
52
|
> **Suggested pairing for now**: use it together with a **reminder** plugin (e.g. [dsh-notify](https://github.com/zhengjy01/dsh-notify), desktop notifications when it is time to freeze/resume) and a **billing/usage** plugin (e.g. [dsh-deepseek-usage](https://github.com/yyb16yyb-hub/dsh-deepseek-usage), [dsh-cost-tracker](https://github.com/yflmq001/dsh-cost-tracker), [dsh-billing-balance](https://github.com/YZz-S/dsh-billing-balance), to verify actual spend around a freeze) — a "remind → freeze → resume off-peak → verify" saving loop.
|
|
53
53
|
|
|
54
54
|
<!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
|
|
55
|
-
- **Supported DSH hosts:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` (
|
|
55
|
+
- **Supported DSH hosts:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` `0.2.1-rc.1` `0.2.1-rc.2` (17 rc releases across lines 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1)
|
|
56
56
|
- **Runtime-verified:** `0.1.0-rc.2`, `0.1.0-rc.3`, `0.1.0-rc.6`, `0.1.0-rc.7`, `0.1.0-rc.8`, `0.1.1-rc.1`, `0.1.1-rc.2`, `0.1.2-rc.1`, `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.5-rc.3`, `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2` — evidence in `.compat-results/`
|
|
57
57
|
<!-- host-compat:end -->
|
|
58
58
|
|
package/README.ja.md
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
> **推奨セットアップ**:**リマインダー**プラグイン([dsh-notify](https://github.com/zhengjy01/dsh-notify) など、凍結/再開のタイミングをデスクトップ通知)と**課金統計**プラグイン([dsh-deepseek-usage](https://github.com/yyb16yyb-hub/dsh-deepseek-usage)、[dsh-cost-tracker](https://github.com/yflmq001/dsh-cost-tracker)、[dsh-billing-balance](https://github.com/YZz-S/dsh-billing-balance) など、凍結前後の実際の支出を確認)を組み合わせ、「リマインド → 凍結 → オフピーク再開 → 精算」の節約ループを実現します。
|
|
36
36
|
|
|
37
37
|
<!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
|
|
38
|
-
- **対応する DSH ホスト:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2`(0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 の
|
|
38
|
+
- **対応する DSH ホスト:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` `0.2.1-rc.1` `0.2.1-rc.2`(0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1 の 17 rc)
|
|
39
39
|
- **ランタイム検証済み:** `0.1.0-rc.2`, `0.1.0-rc.3`, `0.1.0-rc.6`, `0.1.0-rc.7`, `0.1.0-rc.8`, `0.1.1-rc.1`, `0.1.1-rc.2`, `0.1.2-rc.1`, `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.5-rc.3`, `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`(証跡は `.compat-results/`)
|
|
40
40
|
<!-- host-compat:end -->
|
|
41
41
|
|
package/README.ko.md
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
> **권장 구성**: **알림** 플러그인([dsh-notify](https://github.com/zhengjy01/dsh-notify), 동결/재개 시점 데스크톱 알림)과 **과금 통계** 플러그인([dsh-deepseek-usage](https://github.com/yyb16yyb-hub/dsh-deepseek-usage), [dsh-cost-tracker](https://github.com/yflmq001/dsh-cost-tracker), [dsh-billing-balance](https://github.com/YZz-S/dsh-billing-balance), 동결 전후 실제 지출 확인)을 함께 사용하여 "알림 → 동결 → 오피크 재개 → 정산" 절약 루ープ를 실현합니다.
|
|
36
36
|
|
|
37
37
|
<!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
|
|
38
|
-
- **지원하는 DSH 호스트:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` (0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 라인의
|
|
38
|
+
- **지원하는 DSH 호스트:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` `0.2.1-rc.1` `0.2.1-rc.2` (0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1 라인의 17개 rc)
|
|
39
39
|
- **런타임 검증됨:** `0.1.0-rc.2`, `0.1.0-rc.3`, `0.1.0-rc.6`, `0.1.0-rc.7`, `0.1.0-rc.8`, `0.1.1-rc.1`, `0.1.1-rc.2`, `0.1.2-rc.1`, `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.5-rc.3`, `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2` (증적은 `.compat-results/`)
|
|
40
40
|
<!-- host-compat:end -->
|
|
41
41
|
|
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
> **目前建议搭配**:配合**一般提醒**插件(如 [dsh-notify](https://github.com/zhengjy01/dsh-notify),到点桌面提醒「该冻结/该恢复」)与**计费统计**插件(如 [dsh-deepseek-usage](https://github.com/yyb16yyb-hub/dsh-deepseek-usage)、[dsh-cost-tracker](https://github.com/yflmq001/dsh-cost-tracker)、[dsh-billing-balance](https://github.com/YZz-S/dsh-billing-balance),核对冻结前后的实际花费),形成「提醒 → 冻结 → 错峰恢复 → 对账」的省钱闭环。
|
|
58
58
|
|
|
59
59
|
<!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
|
|
60
|
-
- **支持的 DSH 宿主:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2`(覆盖 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0
|
|
60
|
+
- **支持的 DSH 宿主:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` `0.2.1-rc.1` `0.2.1-rc.2`(覆盖 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1 共 7 条线 17 个 rc)
|
|
61
61
|
- **运行时已验证:** `0.1.0-rc.2`, `0.1.0-rc.3`, `0.1.0-rc.6`, `0.1.0-rc.7`, `0.1.0-rc.8`, `0.1.1-rc.1`, `0.1.1-rc.2`, `0.1.2-rc.1`, `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.5-rc.3`, `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`(证据见 `.compat-results/`)
|
|
62
62
|
<!-- host-compat:end -->
|
|
63
63
|
|
package/dsh.plugin.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-input-traffic",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"description": "Busy-time input queue: three-tier planning, drag-to-reorder, interject/interrupt, batch clear, session freeze.",
|
|
6
6
|
"engines": {
|
|
7
|
-
"dsh": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2"
|
|
7
|
+
"dsh": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2"
|
|
8
8
|
},
|
|
9
9
|
"contributes": {
|
|
10
10
|
"tools": [],
|
package/lib/client.js
CHANGED
|
@@ -600,42 +600,42 @@ window.__ModuleLoader__.load({
|
|
|
600
600
|
document.head.appendChild(tag);
|
|
601
601
|
}
|
|
602
602
|
var steer_queue_dock_module_css_default = {
|
|
603
|
+
"action": "FNESVa_action",
|
|
604
|
+
"actions": "FNESVa_actions",
|
|
605
|
+
"badge": "FNESVa_badge",
|
|
603
606
|
"badgeLabel": "FNESVa_badgeLabel",
|
|
604
|
-
"
|
|
605
|
-
"
|
|
606
|
-
"
|
|
607
|
-
"
|
|
608
|
-
"header": "FNESVa_header",
|
|
609
|
-
"preview": "FNESVa_preview",
|
|
610
|
-
"tierNow": "FNESVa_tierNow",
|
|
611
|
-
"frozenRow": "FNESVa_frozenRow",
|
|
607
|
+
"badgeLater": "FNESVa_badgeLater",
|
|
608
|
+
"badgeNext": "FNESVa_badgeNext",
|
|
609
|
+
"badgeNow": "FNESVa_badgeNow",
|
|
610
|
+
"chevron": "FNESVa_chevron",
|
|
612
611
|
"clear": "FNESVa_clear",
|
|
612
|
+
"clearCancel": "FNESVa_clearCancel",
|
|
613
|
+
"clearConfirm": "FNESVa_clearConfirm",
|
|
613
614
|
"clearLabel": "FNESVa_clearLabel",
|
|
614
|
-
"
|
|
615
|
-
"
|
|
616
|
-
"
|
|
617
|
-
"badge": "FNESVa_badge",
|
|
618
|
-
"panel": "FNESVa_panel",
|
|
619
|
-
"actions": "FNESVa_actions",
|
|
620
|
-
"chevron": "FNESVa_chevron",
|
|
621
|
-
"toolbar": "FNESVa_toolbar",
|
|
615
|
+
"count": "FNESVa_count",
|
|
616
|
+
"dock": "FNESVa_dock",
|
|
617
|
+
"dot": "FNESVa_dot",
|
|
622
618
|
"editor": "FNESVa_editor",
|
|
623
|
-
"
|
|
619
|
+
"freeze": "FNESVa_freeze",
|
|
624
620
|
"frozenBanner": "FNESVa_frozenBanner",
|
|
625
|
-
"toolbarActions": "FNESVa_toolbarActions",
|
|
626
621
|
"frozenList": "FNESVa_frozenList",
|
|
627
622
|
"frozenMark": "FNESVa_frozenMark",
|
|
628
|
-
"
|
|
629
|
-
"
|
|
630
|
-
"steeringList": "FNESVa_steeringList",
|
|
623
|
+
"frozenRow": "FNESVa_frozenRow",
|
|
624
|
+
"header": "FNESVa_header",
|
|
631
625
|
"lead": "FNESVa_lead",
|
|
632
|
-
"
|
|
633
|
-
"
|
|
626
|
+
"list": "FNESVa_list",
|
|
627
|
+
"panel": "FNESVa_panel",
|
|
634
628
|
"plan": "FNESVa_plan",
|
|
635
|
-
"
|
|
636
|
-
"
|
|
637
|
-
"
|
|
638
|
-
"
|
|
629
|
+
"preview": "FNESVa_preview",
|
|
630
|
+
"row": "FNESVa_row",
|
|
631
|
+
"rowDragOver": "FNESVa_rowDragOver",
|
|
632
|
+
"steeringList": "FNESVa_steeringList",
|
|
633
|
+
"tier": "FNESVa_tier",
|
|
634
|
+
"tierLater": "FNESVa_tierLater",
|
|
635
|
+
"tierNext": "FNESVa_tierNext",
|
|
636
|
+
"tierNow": "FNESVa_tierNow",
|
|
637
|
+
"toolbar": "FNESVa_toolbar",
|
|
638
|
+
"toolbarActions": "FNESVa_toolbarActions"
|
|
639
639
|
};
|
|
640
640
|
//#endregion
|
|
641
641
|
//#region src/client/steer-queue-dock.tsx
|
|
@@ -1899,6 +1899,139 @@ window.__ModuleLoader__.load({
|
|
|
1899
1899
|
};
|
|
1900
1900
|
}
|
|
1901
1901
|
//#endregion
|
|
1902
|
+
//#region src/client/family-host.ts
|
|
1903
|
+
/**
|
|
1904
|
+
* 家族容器兜底接管(family host backstop)。
|
|
1905
|
+
*
|
|
1906
|
+
* 为什么需要:本插件把设置卡挂在 `dsh-family.tab` 上,而那个子席位由**别的插件**
|
|
1907
|
+
* (thinking-levels / session-guard / session-steward / dsh-mcp-registry)声明。
|
|
1908
|
+
* 宿主的规则是「注册未声明的槽直接抛」,且声明全局唯一、先到先得——所以只要那几家
|
|
1909
|
+
* 全部让位或声明失败,本插件的设置面就整轮启动不可见,而且**不报任何错**
|
|
1910
|
+
* (inject 工厂在槽未声明时压根不跑)。
|
|
1911
|
+
*
|
|
1912
|
+
* 本模块把"看不见"变成"自己上位":延迟到分级时刻检查**自己的 tab 工厂有没有被跑过**
|
|
1913
|
+
* ——那是插件侧唯一合法的「有人声明了吗」探针(宿主只在声明成立后才执行工厂)。
|
|
1914
|
+
* 没跑过 → 自己注册一个通用容器,声明子席位,按账本渲染所有贡献卡(含自己的)。
|
|
1915
|
+
*
|
|
1916
|
+
* declare-or-withdraw:声明子席位失败(别人已持有)时**绝不**退回不带 children 的
|
|
1917
|
+
* 裸注册——残废容器会占住导航行、让后来者按「已有 dsh-family」集体退场,
|
|
1918
|
+
* 这正是 2026-10-14 家族面板丢失的成因。
|
|
1919
|
+
*/
|
|
1920
|
+
/** 家族节固定 id 与子席位 key(与 thinking-levels 的声明严格一致)。 */
|
|
1921
|
+
const FAMILY_SECTION_ID = "dsh-family";
|
|
1922
|
+
const FAMILY_CHILD_KEY = "dsh-family.tab";
|
|
1923
|
+
/** 派生而非硬编码:改 rank 表就自动改时刻。 */
|
|
1924
|
+
const FAMILY_CLAIM_DELAY_MS = 1100;
|
|
1925
|
+
/** 接管行的遮蔽优先级:必须大于任何正牌 owner(TL 无=0、guard=10),
|
|
1926
|
+
* 这样 owner 一旦上位就自然遮蔽本兜底行(宿主规则:同 cell 最低者渲染)。 */
|
|
1927
|
+
const FAMILY_HOST_PRIORITY = 50;
|
|
1928
|
+
const NO_TABS = [];
|
|
1929
|
+
/** 通用容器渲染:按 order 依次画出账本里每张贡献卡,不含任何"本插件特例"。 */
|
|
1930
|
+
function FamilyHostSection(props) {
|
|
1931
|
+
const raw = props.hooks?.tabs;
|
|
1932
|
+
const [polled, setPolled] = (0, react.useState)(() => raw?.getSnapshot() ?? NO_TABS);
|
|
1933
|
+
(0, react.useEffect)(() => {
|
|
1934
|
+
if (props.useTabs !== void 0 || raw === void 0) return;
|
|
1935
|
+
return raw.subscribe(() => setPolled(raw.getSnapshot()));
|
|
1936
|
+
});
|
|
1937
|
+
const tabs = props.useTabs !== void 0 ? props.useTabs((value) => value) : polled;
|
|
1938
|
+
return (0, react.createElement)("div", { style: {
|
|
1939
|
+
display: "grid",
|
|
1940
|
+
gap: "12px"
|
|
1941
|
+
} }, tabs.map((row) => (0, react.createElement)("div", { key: row.id }, props.renderSlot ? props.renderSlot(FAMILY_CHILD_KEY, {}, {
|
|
1942
|
+
only: row.id,
|
|
1943
|
+
fallback: null
|
|
1944
|
+
}) : props.renderContributor?.(row.id) ?? null)));
|
|
1945
|
+
}
|
|
1946
|
+
/** 取条目上的具名面(宿主条目是结构化对象,这里只做安全读取)。 */
|
|
1947
|
+
function face(entry, key) {
|
|
1948
|
+
if (entry === null || typeof entry !== "object") return void 0;
|
|
1949
|
+
return entry[key];
|
|
1950
|
+
}
|
|
1951
|
+
/** 条目的 options 收窄(宿主侧是结构化对象,缺失时当空对象读)。 */
|
|
1952
|
+
function optionsOf(entry) {
|
|
1953
|
+
const raw = face(entry, "options");
|
|
1954
|
+
return raw !== null && typeof raw === "object" ? raw : {};
|
|
1955
|
+
}
|
|
1956
|
+
/** 把账本条目投影成标题行:label 可能是函数,抛错退化成 id,绝不带崩整节。 */
|
|
1957
|
+
function projectLedger(slots) {
|
|
1958
|
+
return slots.entries(FAMILY_CHILD_KEY).map((rawEntry) => {
|
|
1959
|
+
const options = rawEntry.options ?? {};
|
|
1960
|
+
const id = String(options["id"] ?? "");
|
|
1961
|
+
const rawLabel = options["label"];
|
|
1962
|
+
let label = id;
|
|
1963
|
+
if (typeof rawLabel === "function") try {
|
|
1964
|
+
label = String(rawLabel() ?? id);
|
|
1965
|
+
} catch {
|
|
1966
|
+
label = id;
|
|
1967
|
+
}
|
|
1968
|
+
else if (typeof rawLabel === "string") label = rawLabel;
|
|
1969
|
+
return {
|
|
1970
|
+
id,
|
|
1971
|
+
order: Number(options["order"] ?? 0),
|
|
1972
|
+
label
|
|
1973
|
+
};
|
|
1974
|
+
}).sort((a, b) => a.order - b.order);
|
|
1975
|
+
}
|
|
1976
|
+
/**
|
|
1977
|
+
* 若到点仍无人声明子席位,则自己接管容器。
|
|
1978
|
+
* @param slots - 客户端槽门面。
|
|
1979
|
+
* @param isHeld - 探针:本插件的 tab 工厂是否已被执行(= 有人声明了子席位)。
|
|
1980
|
+
* @param label - 导航标题;家族共享节的标题,不是本插件名。
|
|
1981
|
+
* @param log - console 前缀(带插件名)。
|
|
1982
|
+
* @returns 取消定时器与撤销接管注册的 disposer。
|
|
1983
|
+
*/
|
|
1984
|
+
function claimFamilyHostIfOrphaned(slots, isHeld, label, log) {
|
|
1985
|
+
let disposeClaim;
|
|
1986
|
+
let claimed = false;
|
|
1987
|
+
const timer = setTimeout(() => {
|
|
1988
|
+
if (isHeld()) return;
|
|
1989
|
+
const ledger = {
|
|
1990
|
+
getSnapshot: () => projectLedger(slots),
|
|
1991
|
+
subscribe: (listener) => slots.subscribe ? slots.subscribe(FAMILY_CHILD_KEY, listener) : () => void 0
|
|
1992
|
+
};
|
|
1993
|
+
/** ≤0.1.5 壳没有 renderSlot:从账本条目现挂组件,失败一律 null。 */
|
|
1994
|
+
const renderContributor = (id) => {
|
|
1995
|
+
try {
|
|
1996
|
+
const entry = slots.entries(FAMILY_CHILD_KEY).find((candidate) => String(optionsOf(candidate)["id"] ?? "") === id);
|
|
1997
|
+
const component = entry ? face(entry, "component") : void 0;
|
|
1998
|
+
const inject = entry ? face(entry, "inject") : void 0;
|
|
1999
|
+
if (typeof component !== "function") return null;
|
|
2000
|
+
const injected = typeof inject === "function" ? inject() : {};
|
|
2001
|
+
return (0, react.createElement)(component, injected ?? {});
|
|
2002
|
+
} catch {
|
|
2003
|
+
return null;
|
|
2004
|
+
}
|
|
2005
|
+
};
|
|
2006
|
+
try {
|
|
2007
|
+
const dispose = slots.register({
|
|
2008
|
+
name: "settings.section",
|
|
2009
|
+
id: FAMILY_SECTION_ID,
|
|
2010
|
+
order: 40,
|
|
2011
|
+
priority: FAMILY_HOST_PRIORITY,
|
|
2012
|
+
label,
|
|
2013
|
+
inject: () => ({
|
|
2014
|
+
hooks: { tabs: ledger },
|
|
2015
|
+
renderContributor
|
|
2016
|
+
}),
|
|
2017
|
+
children: { [FAMILY_CHILD_KEY]: {
|
|
2018
|
+
kind: "list",
|
|
2019
|
+
scope: "root"
|
|
2020
|
+
} }
|
|
2021
|
+
}, FamilyHostSection);
|
|
2022
|
+
if (typeof dispose === "function") disposeClaim = dispose;
|
|
2023
|
+
claimed = true;
|
|
2024
|
+
console.warn(`${log} family container unclaimed — took it over (children declared)`);
|
|
2025
|
+
} catch (error) {
|
|
2026
|
+
console.warn(`${log} family claim lost — withdrawing (${error instanceof Error ? error.message : String(error)})`);
|
|
2027
|
+
}
|
|
2028
|
+
}, FAMILY_CLAIM_DELAY_MS);
|
|
2029
|
+
return () => {
|
|
2030
|
+
clearTimeout(timer);
|
|
2031
|
+
if (claimed) disposeClaim?.();
|
|
2032
|
+
};
|
|
2033
|
+
}
|
|
2034
|
+
//#endregion
|
|
1902
2035
|
//#region src/client/index.ts
|
|
1903
2036
|
/** Durable conversation settings namespace owned by ui-conversation. */
|
|
1904
2037
|
const CONVERSATION_SETTINGS_NAMESPACE = "ui-conversation";
|
|
@@ -1963,14 +2096,19 @@ window.__ModuleLoader__.load({
|
|
|
1963
2096
|
console.warn("[dsh-input-traffic] bridge busyEnter pin failed:", e);
|
|
1964
2097
|
});
|
|
1965
2098
|
});
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
2099
|
+
let familyTabHeld = false;
|
|
2100
|
+
ctx.slots.inject("dsh-family.tab", () => {
|
|
2101
|
+
familyTabHeld = true;
|
|
2102
|
+
return ctx.slots.register({
|
|
2103
|
+
name: "dsh-family.tab",
|
|
2104
|
+
id: "input-traffic",
|
|
2105
|
+
order: 50,
|
|
2106
|
+
label: () => tFamily("family.title"),
|
|
2107
|
+
locale: NS,
|
|
2108
|
+
inject: () => ({ scope: familyScopeRef.scope ?? bridgeScope })
|
|
2109
|
+
}, InputTrafficFamilyCard);
|
|
2110
|
+
});
|
|
2111
|
+
ctx.effect(() => claimFamilyHostIfOrphaned(ctx.slots, () => familyTabHeld, () => "起子插件设置", "[dsh-input-traffic]"), "dsh-input-traffic: family host backstop");
|
|
1974
2112
|
registerSettingsFaces(ctx, {
|
|
1975
2113
|
namespace: CONVERSATION_SETTINGS_NAMESPACE,
|
|
1976
2114
|
field: BUSY_ENTER_FIELD,
|