@kenz1117/dsh-ui-usage-billing 1.8.9 → 1.8.11
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/README.en.md +5 -5
- package/README.md +15 -14
- package/lib/client.js +5 -5
- package/lib/index.js +195 -1
- package/lib/types/client/footer-lane.d.ts +72 -0
- package/lib/types/guard.d.ts +17 -0
- package/package.json +68 -65
package/lib/index.js
CHANGED
|
@@ -1022,6 +1022,18 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1022
1022
|
output: 7
|
|
1023
1023
|
}
|
|
1024
1024
|
},
|
|
1025
|
+
{
|
|
1026
|
+
key: "glm-5.3-flashx-legal",
|
|
1027
|
+
name: "GLM-5.3-FlashX-Legal",
|
|
1028
|
+
provider: "智谱 AI",
|
|
1029
|
+
colorVar: "dsw-static-blue-300",
|
|
1030
|
+
price: {
|
|
1031
|
+
currency: "CNY",
|
|
1032
|
+
input: 2,
|
|
1033
|
+
cacheHit: .57,
|
|
1034
|
+
output: 7
|
|
1035
|
+
}
|
|
1036
|
+
},
|
|
1025
1037
|
{
|
|
1026
1038
|
key: "glm-4.6",
|
|
1027
1039
|
name: "GLM-4.6",
|
|
@@ -1095,6 +1107,18 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1095
1107
|
output: 22
|
|
1096
1108
|
}
|
|
1097
1109
|
},
|
|
1110
|
+
{
|
|
1111
|
+
key: "qwen4-max",
|
|
1112
|
+
name: "Qwen4 Max",
|
|
1113
|
+
provider: "阿里通义",
|
|
1114
|
+
colorVar: "dsw-static-blue-600",
|
|
1115
|
+
price: {
|
|
1116
|
+
currency: "CNY",
|
|
1117
|
+
input: 10,
|
|
1118
|
+
cacheHit: .5,
|
|
1119
|
+
output: 30
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
1098
1122
|
{
|
|
1099
1123
|
key: "qwen-3.8-max",
|
|
1100
1124
|
name: "Qwen3.8 Max",
|
|
@@ -1882,6 +1906,78 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1882
1906
|
output: .5
|
|
1883
1907
|
}
|
|
1884
1908
|
},
|
|
1909
|
+
{
|
|
1910
|
+
key: "gpt-6.2-sol",
|
|
1911
|
+
name: "GPT-6.2 Sol",
|
|
1912
|
+
provider: "OpenAI",
|
|
1913
|
+
colorVar: "ds-green",
|
|
1914
|
+
price: {
|
|
1915
|
+
currency: "USD",
|
|
1916
|
+
input: 2,
|
|
1917
|
+
cacheHit: .1,
|
|
1918
|
+
output: 10
|
|
1919
|
+
}
|
|
1920
|
+
},
|
|
1921
|
+
{
|
|
1922
|
+
key: "gpt-6.2-astra",
|
|
1923
|
+
name: "GPT-6.2 Astra",
|
|
1924
|
+
provider: "OpenAI",
|
|
1925
|
+
colorVar: "ds-green",
|
|
1926
|
+
price: {
|
|
1927
|
+
currency: "USD",
|
|
1928
|
+
input: 8,
|
|
1929
|
+
cacheHit: .4,
|
|
1930
|
+
output: 40
|
|
1931
|
+
}
|
|
1932
|
+
},
|
|
1933
|
+
{
|
|
1934
|
+
key: "gpt-6.2-astra-healthcare",
|
|
1935
|
+
name: "GPT-6.2 Astra Healthcare",
|
|
1936
|
+
provider: "OpenAI",
|
|
1937
|
+
colorVar: "ds-green",
|
|
1938
|
+
price: {
|
|
1939
|
+
currency: "USD",
|
|
1940
|
+
input: 8,
|
|
1941
|
+
cacheHit: .4,
|
|
1942
|
+
output: 40
|
|
1943
|
+
}
|
|
1944
|
+
},
|
|
1945
|
+
{
|
|
1946
|
+
key: "gpt-6-astra-healthcare",
|
|
1947
|
+
name: "GPT-6 Astra Healthcare",
|
|
1948
|
+
provider: "OpenAI",
|
|
1949
|
+
colorVar: "ds-green",
|
|
1950
|
+
price: {
|
|
1951
|
+
currency: "USD",
|
|
1952
|
+
input: 10,
|
|
1953
|
+
cacheHit: 1,
|
|
1954
|
+
output: 50
|
|
1955
|
+
}
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
key: "gpt-6.2-sol-healthcare",
|
|
1959
|
+
name: "GPT-6.2 Sol Healthcare",
|
|
1960
|
+
provider: "OpenAI",
|
|
1961
|
+
colorVar: "ds-green",
|
|
1962
|
+
price: {
|
|
1963
|
+
currency: "USD",
|
|
1964
|
+
input: 2,
|
|
1965
|
+
cacheHit: .1,
|
|
1966
|
+
output: 10
|
|
1967
|
+
}
|
|
1968
|
+
},
|
|
1969
|
+
{
|
|
1970
|
+
key: "gpt-6.1-sol-healthcare",
|
|
1971
|
+
name: "GPT-6.1 Sol Healthcare",
|
|
1972
|
+
provider: "OpenAI",
|
|
1973
|
+
colorVar: "ds-green",
|
|
1974
|
+
price: {
|
|
1975
|
+
currency: "USD",
|
|
1976
|
+
input: 2,
|
|
1977
|
+
cacheHit: .1,
|
|
1978
|
+
output: 10
|
|
1979
|
+
}
|
|
1980
|
+
},
|
|
1885
1981
|
{
|
|
1886
1982
|
key: "gpt-5.6-sol",
|
|
1887
1983
|
name: "GPT-5.6 Sol",
|
|
@@ -2543,6 +2639,42 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
2543
2639
|
output: 10
|
|
2544
2640
|
}
|
|
2545
2641
|
},
|
|
2642
|
+
{
|
|
2643
|
+
key: "gemini-4-neon",
|
|
2644
|
+
name: "Gemini 4 Neon",
|
|
2645
|
+
provider: "Google",
|
|
2646
|
+
colorVar: "dsw-static-blue-600",
|
|
2647
|
+
price: {
|
|
2648
|
+
currency: "USD",
|
|
2649
|
+
input: 3,
|
|
2650
|
+
cacheHit: .15,
|
|
2651
|
+
output: 15
|
|
2652
|
+
}
|
|
2653
|
+
},
|
|
2654
|
+
{
|
|
2655
|
+
key: "gemini-4-hydrogen",
|
|
2656
|
+
name: "Gemini 4 Hydrogen",
|
|
2657
|
+
provider: "Google",
|
|
2658
|
+
colorVar: "dsw-static-blue-600",
|
|
2659
|
+
price: {
|
|
2660
|
+
currency: "USD",
|
|
2661
|
+
input: 1.5,
|
|
2662
|
+
cacheHit: .075,
|
|
2663
|
+
output: 7.5
|
|
2664
|
+
}
|
|
2665
|
+
},
|
|
2666
|
+
{
|
|
2667
|
+
key: "gemini-4-carbon",
|
|
2668
|
+
name: "Gemini 4 Carbon",
|
|
2669
|
+
provider: "Google",
|
|
2670
|
+
colorVar: "dsw-static-blue-600",
|
|
2671
|
+
price: {
|
|
2672
|
+
currency: "USD",
|
|
2673
|
+
input: 2,
|
|
2674
|
+
cacheHit: .1,
|
|
2675
|
+
output: 10
|
|
2676
|
+
}
|
|
2677
|
+
},
|
|
2546
2678
|
{
|
|
2547
2679
|
key: "gemini-flash-latest",
|
|
2548
2680
|
name: "Gemini Flash Latest",
|
|
@@ -2795,6 +2927,18 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
2795
2927
|
output: 4.25
|
|
2796
2928
|
}
|
|
2797
2929
|
},
|
|
2930
|
+
{
|
|
2931
|
+
key: "muse-ember-1.0",
|
|
2932
|
+
name: "Muse Ember 1.0",
|
|
2933
|
+
provider: "Meta",
|
|
2934
|
+
colorVar: "ds-red",
|
|
2935
|
+
price: {
|
|
2936
|
+
currency: "USD",
|
|
2937
|
+
input: .1,
|
|
2938
|
+
cacheHit: .004,
|
|
2939
|
+
output: .5
|
|
2940
|
+
}
|
|
2941
|
+
},
|
|
2798
2942
|
{
|
|
2799
2943
|
key: "muse-spark-1.2",
|
|
2800
2944
|
name: "Muse Spark 1.2",
|
|
@@ -2951,6 +3095,18 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
2951
3095
|
output: 50
|
|
2952
3096
|
}
|
|
2953
3097
|
},
|
|
3098
|
+
{
|
|
3099
|
+
key: "claude-fable-5-2",
|
|
3100
|
+
name: "Claude Fable 5.2",
|
|
3101
|
+
provider: "Anthropic",
|
|
3102
|
+
colorVar: "ds-red",
|
|
3103
|
+
price: {
|
|
3104
|
+
currency: "USD",
|
|
3105
|
+
input: 8,
|
|
3106
|
+
cacheHit: .2,
|
|
3107
|
+
output: 40
|
|
3108
|
+
}
|
|
3109
|
+
},
|
|
2954
3110
|
{
|
|
2955
3111
|
key: "claude-fable-5",
|
|
2956
3112
|
name: "Claude Fable 5",
|
|
@@ -4327,7 +4483,20 @@ const BUILTIN_MODEL_KEY_ALIASES = {
|
|
|
4327
4483
|
"grok-4-6": "grok",
|
|
4328
4484
|
"gpt-image-2": "gpt-image-2",
|
|
4329
4485
|
"gpt-image-2.5-sunburst": "gpt-image-2.5-sunburst",
|
|
4330
|
-
"gpt-image-2-5-sunburst": "gpt-image-2.5-sunburst"
|
|
4486
|
+
"gpt-image-2-5-sunburst": "gpt-image-2.5-sunburst",
|
|
4487
|
+
"qwen4-max": "qwen4-max",
|
|
4488
|
+
"gpt-6.2-sol": "gpt-6.2-sol",
|
|
4489
|
+
"gpt-6.2-astra": "gpt-6.2-astra",
|
|
4490
|
+
"gpt-6.2-astra-healthcare": "gpt-6.2-astra-healthcare",
|
|
4491
|
+
"gpt-6-astra-healthcare": "gpt-6-astra-healthcare",
|
|
4492
|
+
"gpt-6.2-sol-healthcare": "gpt-6.2-sol-healthcare",
|
|
4493
|
+
"gpt-6.1-sol-healthcare": "gpt-6.1-sol-healthcare",
|
|
4494
|
+
"gemini-4-neon": "gemini-4-neon",
|
|
4495
|
+
"gemini-4-hydrogen": "gemini-4-hydrogen",
|
|
4496
|
+
"gemini-4-carbon": "gemini-4-carbon",
|
|
4497
|
+
"claude-fable-5-2": "claude-fable-5-2",
|
|
4498
|
+
"glm-5.3-flashx-legal": "glm-5.3-flashx-legal",
|
|
4499
|
+
"muse-ember-1.0": "muse-ember-1.0"
|
|
4331
4500
|
};
|
|
4332
4501
|
//#endregion
|
|
4333
4502
|
//#region lib/types/aggregate.js
|
|
@@ -9467,6 +9636,21 @@ function isLoopbackOrigin(origin) {
|
|
|
9467
9636
|
}
|
|
9468
9637
|
}
|
|
9469
9638
|
/**
|
|
9639
|
+
* 路由准入声明(宿主 0.2.3-alpha.1 起必需)。
|
|
9640
|
+
*
|
|
9641
|
+
* 宿主把 Web 路由的 `auth` 默认值从「无鉴权」改成了 `'required'`:未通过宿主
|
|
9642
|
+
* 连接层鉴权的请求在进入 handler **之前**就被拒(401/503),插件自带的守卫
|
|
9643
|
+
* 根本没机会执行——面板会静默变成一片 0。本插件的端点只服务本机浏览器,安全
|
|
9644
|
+
* 边界是 {@link guardLoopback}(peer 回环 socket + Host 头精确字面量 +
|
|
9645
|
+
* trustedHosts 白名单 + Origin 校验),因此显式声明匿名准入。
|
|
9646
|
+
*
|
|
9647
|
+
* 宿主的可信主机栅栏仍然生效(Host 必须是回环/可信主机、Origin 必须同源),
|
|
9648
|
+
* 这里只放宽「需要 peer 凭据」这一层,不放宽来源校验。
|
|
9649
|
+
*
|
|
9650
|
+
* 老宿主(≤0.2.2-rc.5)没有 `auth` 字段,多余字段被忽略,行为与从前一致。
|
|
9651
|
+
*/
|
|
9652
|
+
const ANONYMOUS_ROUTE_AUTH = { auth: "anonymous" };
|
|
9653
|
+
/**
|
|
9470
9654
|
* 回环防护守卫:仅接受回环 GET 请求(peer socket 地址 + Host 头同时校验)。
|
|
9471
9655
|
* 不满足时返回 403 并结束响应;调用方在 handler 顶部调用,返回 false 即已拒绝。
|
|
9472
9656
|
* @param req - 当前请求。
|
|
@@ -9511,6 +9695,7 @@ function registerNotifyClaimRoute(ctx, deps) {
|
|
|
9511
9695
|
ctx.effect(() => ctx.webServer.register({
|
|
9512
9696
|
kind: "exact",
|
|
9513
9697
|
path: "/api/billing/notify-claim",
|
|
9698
|
+
...ANONYMOUS_ROUTE_AUTH,
|
|
9514
9699
|
handler: async (req, res) => {
|
|
9515
9700
|
if (!guardLoopback(req, res, deps.trustedHosts)) return;
|
|
9516
9701
|
if (req.method !== "POST") {
|
|
@@ -9589,6 +9774,7 @@ function registerGetRoute(ctx, deps) {
|
|
|
9589
9774
|
ctx.effect(() => ctx.webServer.register({
|
|
9590
9775
|
kind: "exact",
|
|
9591
9776
|
path: "/api/billing/pricing",
|
|
9777
|
+
...ANONYMOUS_ROUTE_AUTH,
|
|
9592
9778
|
handler: async (req, res) => {
|
|
9593
9779
|
if (!guardLoopback(req, res, deps.trustedHosts)) return;
|
|
9594
9780
|
res.writeHead(200, { "content-type": "application/json; charset=utf-8" });
|
|
@@ -9601,6 +9787,7 @@ function registerRefreshRoute(ctx, deps) {
|
|
|
9601
9787
|
ctx.effect(() => ctx.webServer.register({
|
|
9602
9788
|
kind: "exact",
|
|
9603
9789
|
path: "/api/billing/pricing/refresh",
|
|
9790
|
+
...ANONYMOUS_ROUTE_AUTH,
|
|
9604
9791
|
handler: async (req, res) => {
|
|
9605
9792
|
if (!guardLoopback(req, res, deps.trustedHosts)) return;
|
|
9606
9793
|
if (req.method !== "POST") {
|
|
@@ -9648,6 +9835,7 @@ function registerBalanceRoute(ctx, deps) {
|
|
|
9648
9835
|
ctx.effect(() => ctx.webServer.register({
|
|
9649
9836
|
kind: "exact",
|
|
9650
9837
|
path: "/api/billing/balance",
|
|
9838
|
+
...ANONYMOUS_ROUTE_AUTH,
|
|
9651
9839
|
handler: async (req, res) => {
|
|
9652
9840
|
if (!guardLoopback(req, res, deps.trustedHosts)) return;
|
|
9653
9841
|
res.writeHead(200, { "content-type": "application/json; charset=utf-8" });
|
|
@@ -9695,6 +9883,7 @@ function registerUsageToolRoute(ctx, deps) {
|
|
|
9695
9883
|
ctx.effect(() => ctx.webServer.register({
|
|
9696
9884
|
kind: "exact",
|
|
9697
9885
|
path: "/api/billing/usage-tool",
|
|
9886
|
+
...ANONYMOUS_ROUTE_AUTH,
|
|
9698
9887
|
handler: async (req, res) => {
|
|
9699
9888
|
if (!guardLoopback(req, res, deps.trustedHosts)) return;
|
|
9700
9889
|
if (req.method !== "GET" && req.method !== "POST") {
|
|
@@ -9771,6 +9960,7 @@ function registerSubscriptionsRoute(ctx, deps) {
|
|
|
9771
9960
|
ctx.effect(() => ctx.webServer.register({
|
|
9772
9961
|
kind: "exact",
|
|
9773
9962
|
path: "/api/billing/subscriptions",
|
|
9963
|
+
...ANONYMOUS_ROUTE_AUTH,
|
|
9774
9964
|
handler: async (req, res) => {
|
|
9775
9965
|
if (!guardLoopback(req, res, deps.trustedHosts)) return;
|
|
9776
9966
|
res.writeHead(200, { "content-type": "application/json; charset=utf-8" });
|
|
@@ -9806,6 +9996,7 @@ function registerRelayQuotasRoute(ctx, deps) {
|
|
|
9806
9996
|
ctx.effect(() => ctx.webServer.register({
|
|
9807
9997
|
kind: "exact",
|
|
9808
9998
|
path: "/api/billing/relay-quotas",
|
|
9999
|
+
...ANONYMOUS_ROUTE_AUTH,
|
|
9809
10000
|
handler: async (req, res) => {
|
|
9810
10001
|
if (!guardLoopback(req, res, deps.trustedHosts)) return;
|
|
9811
10002
|
res.writeHead(200, { "content-type": "application/json; charset=utf-8" });
|
|
@@ -9939,6 +10130,7 @@ function registerUsageStatsRoute(ctx, deps) {
|
|
|
9939
10130
|
ctx.effect(() => ctx.webServer.register({
|
|
9940
10131
|
kind: "exact",
|
|
9941
10132
|
path: "/api/billing/usage-stats",
|
|
10133
|
+
...ANONYMOUS_ROUTE_AUTH,
|
|
9942
10134
|
handler: async (req, res) => {
|
|
9943
10135
|
if (!guardLoopback(req, res, deps.trustedHosts)) return;
|
|
9944
10136
|
res.writeHead(200, { "content-type": "application/json; charset=utf-8" });
|
|
@@ -10571,6 +10763,7 @@ function registerTaskQueueRoute(ctx, deps) {
|
|
|
10571
10763
|
ctx.effect(() => ctx.webServer.register({
|
|
10572
10764
|
kind: "exact",
|
|
10573
10765
|
path: "/api/billing/task-queue",
|
|
10766
|
+
...ANONYMOUS_ROUTE_AUTH,
|
|
10574
10767
|
handler: async (req, res) => {
|
|
10575
10768
|
if (!guardLoopback(req, res, deps.trustedHosts)) return;
|
|
10576
10769
|
if (req.method !== "GET" && req.method !== "POST") {
|
|
@@ -10643,6 +10836,7 @@ function registerTaskQueueRoute(ctx, deps) {
|
|
|
10643
10836
|
ctx.effect(() => ctx.webServer.register({
|
|
10644
10837
|
kind: "exact",
|
|
10645
10838
|
path: "/api/billing/task-queue-summary",
|
|
10839
|
+
...ANONYMOUS_ROUTE_AUTH,
|
|
10646
10840
|
handler: async (req, res) => {
|
|
10647
10841
|
if (!guardLoopback(req, res, deps.trustedHosts)) return;
|
|
10648
10842
|
if (req.method !== "GET") {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 侧栏 footer 同槽占位测量(社区约定 §20.4 / §25「卡片型占用者」)。
|
|
3
|
+
*
|
|
4
|
+
* 背景:宿主的 `sidebar.footer.action` 是一个**无 wrap 的横向 flex 行**
|
|
5
|
+
* (`.footerActions{display:flex}`,无 gap/padding)。本插件的触发卡是**宽卡**
|
|
6
|
+
* (`width:100%`),同槽有别的插件时会把它们推到面板右边界之外——用户看到的
|
|
7
|
+
* 现象是「别的插件像没加载」(社区 issue #237)。纵向栈(手机端侧栏浮层)
|
|
8
|
+
* 下宽卡则会把同列的其它入口挤到下方(§25.6)。
|
|
9
|
+
*
|
|
10
|
+
* 宿主**不**向占位者暴露同槽邻居信息:owner props 只有 `{ wide }`,register
|
|
11
|
+
* 选项里也没有「占用者」字段(对比 `sidebar.panellist.actions` 才带 entries)。
|
|
12
|
+
* 因此按社区约定 §20.4 的测量算法从 DOM 反推:
|
|
13
|
+
* - 向上找到「真正的行」:跳过 `display:contents` 的槽位外壳;
|
|
14
|
+
* - 数同排的可见占位者(展开 display:contents 的子项,排除自己与不可见元素);
|
|
15
|
+
* - 读行的 `flex-direction`(`column` = 纵向栈)。
|
|
16
|
+
*
|
|
17
|
+
* 判定(§25 方案 A:卡片型占用者有邻居时降级为按钮形态):
|
|
18
|
+
* - 横向行且有邻居 → 收成 36×36 图标钮(此时禁止 `width:100%`);
|
|
19
|
+
* - 纵向座位 → 只有「放不下宽卡」的窄座才收成图标钮;**整行宽座**(第三方
|
|
20
|
+
* 皮肤显式给出的宽座,客人被拉满整行、宽卡放得下)保留宽卡(issue #140);
|
|
21
|
+
* - 其余(独占一行 / 测不到行)→ 保持宽卡。
|
|
22
|
+
*
|
|
23
|
+
* 本模块只做测量与判定,不碰宿主容器(不得注入 `flex-wrap` /
|
|
24
|
+
* `flex-direction` / `order`,见 §25 硬规则 2)。
|
|
25
|
+
*/
|
|
26
|
+
/** 同槽占位事实。 */
|
|
27
|
+
export interface FooterLaneFacts {
|
|
28
|
+
/** 真正的行容器(最近的 flex 祖先);找不到时为 null(此时没有横向挤占问题)。 */
|
|
29
|
+
row: HTMLElement | null;
|
|
30
|
+
/** 行是纵向列(手机端侧栏浮层 / 皮肤改写的竖座)而非横向行。 */
|
|
31
|
+
stacked: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 纵向座位是「整行宽座」:客人被拉满整行宽度(`align-items` 拉伸)且座位
|
|
34
|
+
* 放得下宽卡。第三方皮肤(如 dsh-islands-ui 的工作区底部宽座)这样声明
|
|
35
|
+
* 「这里要放得下宽插件」;手机端的窄竖条不是(issue #140 现象二)。
|
|
36
|
+
*/
|
|
37
|
+
wideSeat: boolean;
|
|
38
|
+
/** 同行可见占位者数量(不含自己)。 */
|
|
39
|
+
neighbors: number;
|
|
40
|
+
}
|
|
41
|
+
/** 触发卡形态:宽卡(独占一行)/ 图标钮(与邻居共存)。 */
|
|
42
|
+
export type TriggerForm = 'card' | 'icon';
|
|
43
|
+
/** 观察句柄。 */
|
|
44
|
+
export interface FooterLaneWatch {
|
|
45
|
+
/** 停止观察。 */
|
|
46
|
+
dispose(): void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 测量同槽占位事实。
|
|
50
|
+
* @param self - 本插件在行内的元素(触发卡外壳)。
|
|
51
|
+
* @returns 行容器 / 是否纵向栈 / 是否宽座 / 邻居数量。
|
|
52
|
+
*/
|
|
53
|
+
export declare function measureFooterLane(self: HTMLElement): FooterLaneFacts;
|
|
54
|
+
/**
|
|
55
|
+
* 由占位事实判定触发卡形态(社区约定 §25 方案 A)。
|
|
56
|
+
* @param facts - 同槽占位事实。
|
|
57
|
+
* @returns `icon` = 收成 36×36 图标钮;`card` = 保持宽卡。
|
|
58
|
+
*/
|
|
59
|
+
export declare function resolveTriggerForm(facts: FooterLaneFacts): TriggerForm;
|
|
60
|
+
/**
|
|
61
|
+
* 观察同槽占位变化,形态变化时回调。
|
|
62
|
+
*
|
|
63
|
+
* 三路触发源缺一不可(§20.4):`ResizeObserver`(侧栏拖拽改宽 / 折叠)、
|
|
64
|
+
* `MutationObserver`(邻居插件注册、卸载、隐藏)、`window` `resize`。
|
|
65
|
+
* 只在**形态真的变了**时回调,避免自触发成环。
|
|
66
|
+
*
|
|
67
|
+
* @param self - 本插件在行内的元素。
|
|
68
|
+
* @param onForm - 形态变化回调。
|
|
69
|
+
* @returns 观察句柄。
|
|
70
|
+
*/
|
|
71
|
+
export declare function watchFooterLane(self: HTMLElement, onForm: (form: TriggerForm) => void): FooterLaneWatch;
|
|
72
|
+
//# sourceMappingURL=footer-lane.d.ts.map
|
package/lib/types/guard.d.ts
CHANGED
|
@@ -38,6 +38,23 @@ export declare function isLoopbackHost(req: IncomingMessage, trustedHosts?: Read
|
|
|
38
38
|
* (curl 或同源 fetch 不带)视为放行,交给下方的 Content-Type 校验兜底;Origin 存在
|
|
39
39
|
* 但主机非回环则拒绝——跨站脚本发起的写请求必带攻击者域名的 Origin。 */
|
|
40
40
|
export declare function isLoopbackOrigin(origin: string | undefined): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 路由准入声明(宿主 0.2.3-alpha.1 起必需)。
|
|
43
|
+
*
|
|
44
|
+
* 宿主把 Web 路由的 `auth` 默认值从「无鉴权」改成了 `'required'`:未通过宿主
|
|
45
|
+
* 连接层鉴权的请求在进入 handler **之前**就被拒(401/503),插件自带的守卫
|
|
46
|
+
* 根本没机会执行——面板会静默变成一片 0。本插件的端点只服务本机浏览器,安全
|
|
47
|
+
* 边界是 {@link guardLoopback}(peer 回环 socket + Host 头精确字面量 +
|
|
48
|
+
* trustedHosts 白名单 + Origin 校验),因此显式声明匿名准入。
|
|
49
|
+
*
|
|
50
|
+
* 宿主的可信主机栅栏仍然生效(Host 必须是回环/可信主机、Origin 必须同源),
|
|
51
|
+
* 这里只放宽「需要 peer 凭据」这一层,不放宽来源校验。
|
|
52
|
+
*
|
|
53
|
+
* 老宿主(≤0.2.2-rc.5)没有 `auth` 字段,多余字段被忽略,行为与从前一致。
|
|
54
|
+
*/
|
|
55
|
+
export declare const ANONYMOUS_ROUTE_AUTH: {
|
|
56
|
+
readonly auth: "anonymous";
|
|
57
|
+
};
|
|
41
58
|
/**
|
|
42
59
|
* 回环防护守卫:仅接受回环 GET 请求(peer socket 地址 + Host 头同时校验)。
|
|
43
60
|
* 不满足时返回 403 并结束响应;调用方在 handler 顶部调用,返回 false 即已拒绝。
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenz1117/dsh-ui-usage-billing",
|
|
3
3
|
"description": "Usage billing dashboard for DeepSeek Harness: sidebar cost metrics plus a full dashboard modal, priced from a current multi-provider catalog with real usage aggregated from session logs.",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.11",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
7
7
|
"deepseek",
|
|
@@ -91,7 +91,10 @@
|
|
|
91
91
|
"0.2.2-rc.2": "compatible",
|
|
92
92
|
"0.2.2-rc.3": "compatible",
|
|
93
93
|
"0.2.2-rc.4": "compatible",
|
|
94
|
-
"0.2.2-rc.5": "compatible"
|
|
94
|
+
"0.2.2-rc.5": "compatible",
|
|
95
|
+
"0.2.3-alpha.1": "compatible",
|
|
96
|
+
"0.2.3-alpha.2": "compatible",
|
|
97
|
+
"0.2.3-alpha.3": "compatible"
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
},
|
|
@@ -140,70 +143,70 @@
|
|
|
140
143
|
"clsx": "^2.1.1"
|
|
141
144
|
},
|
|
142
145
|
"devDependencies": {
|
|
143
|
-
"@deepseek-ai/cordis": "4.
|
|
144
|
-
"@deepseek-ai/cordis-plugin-group": "1.
|
|
145
|
-
"@deepseek-ai/cordis-plugin-include": "1.
|
|
146
|
-
"@deepseek-ai/cordis-plugin-loader": "1.
|
|
147
|
-
"@deepseek-ai/dsh-agent": "0.2.
|
|
148
|
-
"@deepseek-ai/dsh-agent-default-model": "0.2.
|
|
149
|
-
"@deepseek-ai/dsh-agent-preset-registry": "0.2.
|
|
150
|
-
"@deepseek-ai/dsh-api-gateway": "0.2.
|
|
151
|
-
"@deepseek-ai/dsh-api-remotes": "0.2.
|
|
152
|
-
"@deepseek-ai/dsh-api-session-controller": "0.2.
|
|
153
|
-
"@deepseek-ai/dsh-app-boot": "0.2.
|
|
154
|
-
"@deepseek-ai/dsh-atomic-write": "0.2.
|
|
155
|
-
"@deepseek-ai/dsh-attachment": "0.2.
|
|
156
|
-
"@deepseek-ai/dsh-client-connection": "0.2.
|
|
157
|
-
"@deepseek-ai/dsh-client-file-upload": "0.2.
|
|
158
|
-
"@deepseek-ai/dsh-client-locale": "0.2.
|
|
159
|
-
"@deepseek-ai/dsh-client-shortcuts": "0.2.
|
|
160
|
-
"@deepseek-ai/dsh-client-store": "0.2.
|
|
161
|
-
"@deepseek-ai/dsh-client-ui-commands": "0.2.
|
|
162
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.
|
|
163
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.
|
|
164
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.
|
|
165
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.2.
|
|
166
|
-
"@deepseek-ai/dsh-client-ui-sidebar": "0.2.
|
|
167
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.
|
|
168
|
-
"@deepseek-ai/dsh-client-ui-workspace": "0.2.
|
|
169
|
-
"@deepseek-ai/dsh-commands": "0.2.
|
|
170
|
-
"@deepseek-ai/dsh-compaction": "0.2.
|
|
171
|
-
"@deepseek-ai/dsh-credentials": "0.2.
|
|
172
|
-
"@deepseek-ai/dsh-error": "0.2.
|
|
173
|
-
"@deepseek-ai/dsh-file-reference": "0.2.
|
|
174
|
-
"@deepseek-ai/dsh-fs": "0.2.
|
|
175
|
-
"@deepseek-ai/dsh-home-paths": "0.2.
|
|
176
|
-
"@deepseek-ai/dsh-host-webserver": "0.2.
|
|
146
|
+
"@deepseek-ai/cordis": "4.2.0-alpha.2",
|
|
147
|
+
"@deepseek-ai/cordis-plugin-group": "1.2.0-alpha.2",
|
|
148
|
+
"@deepseek-ai/cordis-plugin-include": "1.2.0-alpha.2",
|
|
149
|
+
"@deepseek-ai/cordis-plugin-loader": "1.2.0-alpha.2",
|
|
150
|
+
"@deepseek-ai/dsh-agent": "0.2.3-alpha.3",
|
|
151
|
+
"@deepseek-ai/dsh-agent-default-model": "0.2.3-alpha.3",
|
|
152
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.3-alpha.3",
|
|
153
|
+
"@deepseek-ai/dsh-api-gateway": "0.2.3-alpha.3",
|
|
154
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.3-alpha.3",
|
|
155
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.3-alpha.3",
|
|
156
|
+
"@deepseek-ai/dsh-app-boot": "0.2.3-alpha.3",
|
|
157
|
+
"@deepseek-ai/dsh-atomic-write": "0.2.3-alpha.3",
|
|
158
|
+
"@deepseek-ai/dsh-attachment": "0.2.3-alpha.3",
|
|
159
|
+
"@deepseek-ai/dsh-client-connection": "0.2.3-alpha.3",
|
|
160
|
+
"@deepseek-ai/dsh-client-file-upload": "0.2.3-alpha.3",
|
|
161
|
+
"@deepseek-ai/dsh-client-locale": "0.2.3-alpha.3",
|
|
162
|
+
"@deepseek-ai/dsh-client-shortcuts": "0.2.3-alpha.3",
|
|
163
|
+
"@deepseek-ai/dsh-client-store": "0.2.3-alpha.3",
|
|
164
|
+
"@deepseek-ai/dsh-client-ui-commands": "0.2.3-alpha.3",
|
|
165
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.3-alpha.3",
|
|
166
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.3-alpha.3",
|
|
167
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.3-alpha.3",
|
|
168
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.3-alpha.3",
|
|
169
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "0.2.3-alpha.3",
|
|
170
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.3-alpha.3",
|
|
171
|
+
"@deepseek-ai/dsh-client-ui-workspace": "0.2.3-alpha.3",
|
|
172
|
+
"@deepseek-ai/dsh-commands": "0.2.3-alpha.3",
|
|
173
|
+
"@deepseek-ai/dsh-compaction": "0.2.3-alpha.3",
|
|
174
|
+
"@deepseek-ai/dsh-credentials": "0.2.3-alpha.3",
|
|
175
|
+
"@deepseek-ai/dsh-error": "0.2.3-alpha.3",
|
|
176
|
+
"@deepseek-ai/dsh-file-reference": "0.2.3-alpha.3",
|
|
177
|
+
"@deepseek-ai/dsh-fs": "0.2.3-alpha.3",
|
|
178
|
+
"@deepseek-ai/dsh-home-paths": "0.2.3-alpha.3",
|
|
179
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.3-alpha.3",
|
|
177
180
|
"@deepseek-ai/dsh-invariants": "0.2.0-rc.2",
|
|
178
|
-
"@deepseek-ai/dsh-launch-environment": "0.2.
|
|
179
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
180
|
-
"@deepseek-ai/dsh-native-command": "0.2.
|
|
181
|
-
"@deepseek-ai/dsh-ptc-runtime": "0.2.
|
|
182
|
-
"@deepseek-ai/dsh-sandbox": "0.2.
|
|
183
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.2.
|
|
184
|
-
"@deepseek-ai/dsh-scope": "0.2.
|
|
185
|
-
"@deepseek-ai/dsh-session": "0.2.
|
|
186
|
-
"@deepseek-ai/dsh-session-persistence": "0.2.
|
|
187
|
-
"@deepseek-ai/dsh-session-projection": "0.2.
|
|
188
|
-
"@deepseek-ai/dsh-session-query": "0.2.
|
|
189
|
-
"@deepseek-ai/dsh-session-title": "0.2.
|
|
190
|
-
"@deepseek-ai/dsh-settings": "0.2.
|
|
191
|
-
"@deepseek-ai/dsh-skill": "0.2.
|
|
192
|
-
"@deepseek-ai/dsh-storage": "0.2.
|
|
193
|
-
"@deepseek-ai/dsh-storage-domain": "0.2.
|
|
194
|
-
"@deepseek-ai/dsh-subagent": "0.2.
|
|
195
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.
|
|
196
|
-
"@deepseek-ai/dsh-tool-todo": "0.2.
|
|
197
|
-
"@deepseek-ai/dsh-tools": "0.2.
|
|
198
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.
|
|
199
|
-
"@deepseek-ai/dsh-typert-registry": "0.2.
|
|
200
|
-
"@deepseek-ai/dsh-user-approval": "0.2.
|
|
201
|
-
"@deepseek-ai/dsh-util-code-language": "0.2.
|
|
202
|
-
"@deepseek-ai/dsh-util-time": "0.2.
|
|
203
|
-
"@deepseek-ai/dsh-util-workspace-path": "0.2.
|
|
204
|
-
"@deepseek-ai/dsh-working-directory": "0.2.
|
|
205
|
-
"@deepseek-ai/dsh-workspace": "0.2.
|
|
206
|
-
"@deepseek-ai/schemastery": "3.
|
|
181
|
+
"@deepseek-ai/dsh-launch-environment": "0.2.3-alpha.3",
|
|
182
|
+
"@deepseek-ai/dsh-llm": "0.2.3-alpha.3",
|
|
183
|
+
"@deepseek-ai/dsh-native-command": "0.2.3-alpha.3",
|
|
184
|
+
"@deepseek-ai/dsh-ptc-runtime": "0.2.3-alpha.3",
|
|
185
|
+
"@deepseek-ai/dsh-sandbox": "0.2.3-alpha.3",
|
|
186
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.3-alpha.3",
|
|
187
|
+
"@deepseek-ai/dsh-scope": "0.2.3-alpha.3",
|
|
188
|
+
"@deepseek-ai/dsh-session": "0.2.3-alpha.3",
|
|
189
|
+
"@deepseek-ai/dsh-session-persistence": "0.2.3-alpha.3",
|
|
190
|
+
"@deepseek-ai/dsh-session-projection": "0.2.3-alpha.3",
|
|
191
|
+
"@deepseek-ai/dsh-session-query": "0.2.3-alpha.3",
|
|
192
|
+
"@deepseek-ai/dsh-session-title": "0.2.3-alpha.3",
|
|
193
|
+
"@deepseek-ai/dsh-settings": "0.2.3-alpha.3",
|
|
194
|
+
"@deepseek-ai/dsh-skill": "0.2.3-alpha.3",
|
|
195
|
+
"@deepseek-ai/dsh-storage": "0.2.3-alpha.3",
|
|
196
|
+
"@deepseek-ai/dsh-storage-domain": "0.2.3-alpha.3",
|
|
197
|
+
"@deepseek-ai/dsh-subagent": "0.2.3-alpha.3",
|
|
198
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.3-alpha.3",
|
|
199
|
+
"@deepseek-ai/dsh-tool-todo": "0.2.3-alpha.3",
|
|
200
|
+
"@deepseek-ai/dsh-tools": "0.2.3-alpha.3",
|
|
201
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.3-alpha.3",
|
|
202
|
+
"@deepseek-ai/dsh-typert-registry": "0.2.3-alpha.3",
|
|
203
|
+
"@deepseek-ai/dsh-user-approval": "0.2.3-alpha.3",
|
|
204
|
+
"@deepseek-ai/dsh-util-code-language": "0.2.3-alpha.3",
|
|
205
|
+
"@deepseek-ai/dsh-util-time": "0.2.3-alpha.3",
|
|
206
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.2.3-alpha.3",
|
|
207
|
+
"@deepseek-ai/dsh-working-directory": "0.2.3-alpha.3",
|
|
208
|
+
"@deepseek-ai/dsh-workspace": "0.2.3-alpha.3",
|
|
209
|
+
"@deepseek-ai/schemastery": "3.20.0-alpha.2",
|
|
207
210
|
"@playwright/test": "^1.64.1",
|
|
208
211
|
"@shikijs/langs": "^4.3.1",
|
|
209
212
|
"@testing-library/dom": "^10.4.1",
|