@linxin666/dsh-usage 0.3.13 → 0.3.15
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/lib/index.js +18 -8
- package/package.json +14 -14
- package/src/index.ts +15 -4
package/lib/index.js
CHANGED
|
@@ -45,7 +45,7 @@ function mountOnce(packageName, fn) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-brand@0.1.2-
|
|
48
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-brand@0.1.2-rc.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-brand/lib/index.js
|
|
49
49
|
/**
|
|
50
50
|
* Duplicate-install-safe nominal primitive helpers.
|
|
51
51
|
*
|
|
@@ -68,7 +68,7 @@ function brandString(value) {
|
|
|
68
68
|
return value;
|
|
69
69
|
}
|
|
70
70
|
//#endregion
|
|
71
|
-
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-credentials@0.1.2-
|
|
71
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-credentials@0.1.2-rc.1_@deepseek-ai+cordis@4.0.2_@deepseek-ai+dsh-inva_7154e6091d592d1e221d261808e96e55/node_modules/@deepseek-ai/dsh-credentials/lib/index.js
|
|
72
72
|
/**
|
|
73
73
|
* Service Definition for the credential-reference capability seam (`ctx.credentials`). Settings and composition files carry
|
|
74
74
|
* *references* to secrets — environment-variable names — while providers own
|
|
@@ -1668,13 +1668,23 @@ const apply = mountOnce("@linxin666/dsh-usage", (ctx, config) => {
|
|
|
1668
1668
|
} else service.applyOptions(value);
|
|
1669
1669
|
};
|
|
1670
1670
|
ctx.inject(["settings"], (settingsCtx) => {
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1671
|
+
try {
|
|
1672
|
+
if (typeof settingsCtx.settings?.installSection === "function") settingsCtx.settings.installSection(ctx, USAGE_SETTINGS_NAMESPACE, Config, config ?? {}, {
|
|
1673
|
+
setSource: (next) => {
|
|
1674
|
+
source = next;
|
|
1675
|
+
rearm();
|
|
1676
|
+
},
|
|
1677
|
+
onChange: rearm
|
|
1678
|
+
});
|
|
1679
|
+
else if (typeof settingsCtx.settings?.register === "function") {
|
|
1680
|
+
const scope = settingsCtx.settings.register(USAGE_SETTINGS_NAMESPACE, Config, { base: config ?? {} });
|
|
1681
|
+
source = () => scope?.get?.() ?? config ?? {};
|
|
1682
|
+
scope?.watch?.(() => {
|
|
1683
|
+
rearm();
|
|
1684
|
+
});
|
|
1674
1685
|
rearm();
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
});
|
|
1686
|
+
}
|
|
1687
|
+
} catch {}
|
|
1678
1688
|
});
|
|
1679
1689
|
ctx.effect(() => {
|
|
1680
1690
|
rearm();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxin666/dsh-usage",
|
|
3
3
|
"description": "Usage statistics plugin for the dsh web GUI: per-provider balance and coding-plan quota detection plus a live token usage ledger, with a dedicated pet bubble for the current provider",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": "^22.19.0 || >=24.0.0"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"license": "Apache-2.0",
|
|
32
32
|
"dsh": {
|
|
33
33
|
"engines": {
|
|
34
|
-
"dsh": ">=0.1.2-
|
|
34
|
+
"dsh": ">=0.1.2-rc.1"
|
|
35
35
|
},
|
|
36
36
|
"bundle": {
|
|
37
37
|
"patch": "./cordis.patch.yml"
|
|
@@ -55,18 +55,18 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
58
|
-
"@deepseek-ai/dsh-credentials": "^0.1.2-
|
|
59
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.2-
|
|
60
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.2-
|
|
61
|
-
"@deepseek-ai/dsh-client-store": "^0.1.2-
|
|
62
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-
|
|
63
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.1.2-
|
|
64
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.2-
|
|
65
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.2-
|
|
66
|
-
"@deepseek-ai/dsh-llm": "^0.1.2-
|
|
67
|
-
"@deepseek-ai/dsh-session": "^0.1.2-
|
|
68
|
-
"@deepseek-ai/dsh-settings": "^0.1.2-
|
|
69
|
-
"@linxin666/dsh-pet": "0.3.
|
|
58
|
+
"@deepseek-ai/dsh-credentials": "^0.1.2-rc.1",
|
|
59
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.2-rc.1",
|
|
60
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.2-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-client-store": "^0.1.2-rc.1",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-rc.1",
|
|
63
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.2-rc.1",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.2-rc.1",
|
|
65
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.2-rc.1",
|
|
66
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-rc.1",
|
|
67
|
+
"@deepseek-ai/dsh-session": "^0.1.2-rc.1",
|
|
68
|
+
"@deepseek-ai/dsh-settings": "^0.1.2-rc.1",
|
|
69
|
+
"@linxin666/dsh-pet": "0.3.15",
|
|
70
70
|
"@testing-library/dom": "^10.4.1",
|
|
71
71
|
"@testing-library/react": "^16.3.2",
|
|
72
72
|
"@types/node": "^22.20.0",
|
package/src/index.ts
CHANGED
|
@@ -86,10 +86,21 @@ export const apply = mountOnce('@linxin666/dsh-usage', (ctx: Context, config?: C
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
ctx.inject(['settings'], (settingsCtx) => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
try {
|
|
90
|
+
if (typeof settingsCtx.settings?.installSection === 'function') {
|
|
91
|
+
settingsCtx.settings.installSection(ctx, USAGE_SETTINGS_NAMESPACE, Config, config ?? {}, {
|
|
92
|
+
setSource: (next) => { source = next; rearm() },
|
|
93
|
+
onChange: rearm,
|
|
94
|
+
})
|
|
95
|
+
} else if (typeof settingsCtx.settings?.register === 'function') {
|
|
96
|
+
const scope = settingsCtx.settings.register(USAGE_SETTINGS_NAMESPACE, Config, { base: config ?? {} })
|
|
97
|
+
source = () => scope?.get?.() ?? (config ?? {})
|
|
98
|
+
scope?.watch?.(() => { rearm() })
|
|
99
|
+
rearm()
|
|
100
|
+
}
|
|
101
|
+
} catch {
|
|
102
|
+
// Defensive fallback against settings registration differences
|
|
103
|
+
}
|
|
93
104
|
})
|
|
94
105
|
|
|
95
106
|
ctx.effect(() => {
|