@rayadesu/dsh-billing 0.1.0-rc.8

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.
Files changed (116) hide show
  1. package/AGENTS.md +54 -0
  2. package/LICENSE +21 -0
  3. package/README.i18n.yaml +6 -0
  4. package/README.md +118 -0
  5. package/README.zh.md +114 -0
  6. package/cordis.patch.yml +20 -0
  7. package/package.json +33 -0
  8. package/packages/llm-billing/README.i18n.yaml +6 -0
  9. package/packages/llm-billing/README.md +44 -0
  10. package/packages/llm-billing/README.zh.md +44 -0
  11. package/packages/llm-billing/lib/index.js +562 -0
  12. package/packages/llm-billing/lib/invariant.js +23 -0
  13. package/packages/llm-billing/lib/tsconfig.tsbuildinfo +1 -0
  14. package/packages/llm-billing/lib/typert.host.d.ts +3 -0
  15. package/packages/llm-billing/lib/typert.host.js +114 -0
  16. package/packages/llm-billing/lib/typert.remote-client.d.ts +27 -0
  17. package/packages/llm-billing/lib/typert.remote-client.d.ts.map +1 -0
  18. package/packages/llm-billing/lib/typert.remote-client.js +108 -0
  19. package/packages/llm-billing/lib/types/balance.d.ts +71 -0
  20. package/packages/llm-billing/lib/types/balance.d.ts.map +1 -0
  21. package/packages/llm-billing/lib/types/balance.js +187 -0
  22. package/packages/llm-billing/lib/types/balance.js.map +1 -0
  23. package/packages/llm-billing/lib/types/billing.d.ts +106 -0
  24. package/packages/llm-billing/lib/types/billing.d.ts.map +1 -0
  25. package/packages/llm-billing/lib/types/billing.js +163 -0
  26. package/packages/llm-billing/lib/types/billing.js.map +1 -0
  27. package/packages/llm-billing/lib/types/index.d.ts +49 -0
  28. package/packages/llm-billing/lib/types/index.d.ts.map +1 -0
  29. package/packages/llm-billing/lib/types/index.js +155 -0
  30. package/packages/llm-billing/lib/types/index.js.map +1 -0
  31. package/packages/llm-billing/lib/types/invariant.d.ts +16 -0
  32. package/packages/llm-billing/lib/types/invariant.d.ts.map +1 -0
  33. package/packages/llm-billing/lib/types/invariant.js +22 -0
  34. package/packages/llm-billing/lib/types/invariant.js.map +1 -0
  35. package/packages/llm-billing/lib/types/types/balance.d.ts +71 -0
  36. package/packages/llm-billing/lib/types/types/balance.d.ts.map +1 -0
  37. package/packages/llm-billing/lib/types/types/balance.js +187 -0
  38. package/packages/llm-billing/lib/types/types/balance.js.map +1 -0
  39. package/packages/llm-billing/lib/types/types/billing.d.ts +106 -0
  40. package/packages/llm-billing/lib/types/types/billing.d.ts.map +1 -0
  41. package/packages/llm-billing/lib/types/types/billing.js +170 -0
  42. package/packages/llm-billing/lib/types/types/billing.js.map +1 -0
  43. package/packages/llm-billing/lib/types/types/index.d.ts +49 -0
  44. package/packages/llm-billing/lib/types/types/index.d.ts.map +1 -0
  45. package/packages/llm-billing/lib/types/types/index.js +156 -0
  46. package/packages/llm-billing/lib/types/types/index.js.map +1 -0
  47. package/packages/llm-billing/lib/types/types/invariant.d.ts +16 -0
  48. package/packages/llm-billing/lib/types/types/invariant.d.ts.map +1 -0
  49. package/packages/llm-billing/lib/types/types/invariant.js +22 -0
  50. package/packages/llm-billing/lib/types/types/invariant.js.map +1 -0
  51. package/packages/llm-billing/lib/types/types/types.d.ts +63 -0
  52. package/packages/llm-billing/lib/types/types/types.d.ts.map +1 -0
  53. package/packages/llm-billing/lib/types/types/types.js +7 -0
  54. package/packages/llm-billing/lib/types/types/types.js.map +1 -0
  55. package/packages/llm-billing/lib/types/types.d.ts +63 -0
  56. package/packages/llm-billing/lib/types/types.d.ts.map +1 -0
  57. package/packages/llm-billing/lib/types/types.js +7 -0
  58. package/packages/llm-billing/lib/types/types.js.map +1 -0
  59. package/packages/llm-billing/node_modules/.bin/cordis +43 -0
  60. package/packages/llm-billing/node_modules/.bin/cordis.CMD +12 -0
  61. package/packages/llm-billing/node_modules/.bin/cordis.ps1 +41 -0
  62. package/packages/llm-billing/package.json +75 -0
  63. package/packages/llm-billing/src/balance.ts +164 -0
  64. package/packages/llm-billing/src/billing.ts +251 -0
  65. package/packages/llm-billing/src/index.ts +219 -0
  66. package/packages/llm-billing/src/invariant.ts +30 -0
  67. package/packages/llm-billing/src/types.ts +67 -0
  68. package/packages/llm-billing/tests/balance.spec.ts +254 -0
  69. package/packages/llm-billing/tests/billing.spec.ts +216 -0
  70. package/packages/llm-billing/tsconfig.json +42 -0
  71. package/packages/ui-billing/README.i18n.yaml +6 -0
  72. package/packages/ui-billing/README.md +30 -0
  73. package/packages/ui-billing/README.zh.md +30 -0
  74. package/packages/ui-billing/lib/client.js +4466 -0
  75. package/packages/ui-billing/lib/client.js.map +1 -0
  76. package/packages/ui-billing/lib/index.js +11 -0
  77. package/packages/ui-billing/lib/invariant.js +25 -0
  78. package/packages/ui-billing/lib/tsconfig.tsbuildinfo +1 -0
  79. package/packages/ui-billing/lib/types/client/BalanceBadge.d.ts +33 -0
  80. package/packages/ui-billing/lib/types/client/BalanceBadge.d.ts.map +1 -0
  81. package/packages/ui-billing/lib/types/client/BalanceBadge.js +166 -0
  82. package/packages/ui-billing/lib/types/client/BalanceBadge.js.map +1 -0
  83. package/packages/ui-billing/lib/types/client/index.d.ts +20 -0
  84. package/packages/ui-billing/lib/types/client/index.d.ts.map +1 -0
  85. package/packages/ui-billing/lib/types/client/index.js +55 -0
  86. package/packages/ui-billing/lib/types/client/index.js.map +1 -0
  87. package/packages/ui-billing/lib/types/client/locales.d.ts +26 -0
  88. package/packages/ui-billing/lib/types/client/locales.d.ts.map +1 -0
  89. package/packages/ui-billing/lib/types/client/locales.js +40 -0
  90. package/packages/ui-billing/lib/types/client/locales.js.map +1 -0
  91. package/packages/ui-billing/lib/types/index.d.ts +9 -0
  92. package/packages/ui-billing/lib/types/index.d.ts.map +1 -0
  93. package/packages/ui-billing/lib/types/index.js +9 -0
  94. package/packages/ui-billing/lib/types/index.js.map +1 -0
  95. package/packages/ui-billing/lib/types/invariant.d.ts +16 -0
  96. package/packages/ui-billing/lib/types/invariant.d.ts.map +1 -0
  97. package/packages/ui-billing/lib/types/invariant.js +24 -0
  98. package/packages/ui-billing/lib/types/invariant.js.map +1 -0
  99. package/packages/ui-billing/node_modules/.bin/cordis +43 -0
  100. package/packages/ui-billing/node_modules/.bin/cordis.CMD +12 -0
  101. package/packages/ui-billing/node_modules/.bin/cordis.ps1 +41 -0
  102. package/packages/ui-billing/node_modules/.bin/vite +43 -0
  103. package/packages/ui-billing/node_modules/.bin/vite.CMD +12 -0
  104. package/packages/ui-billing/node_modules/.bin/vite.ps1 +41 -0
  105. package/packages/ui-billing/package.json +76 -0
  106. package/packages/ui-billing/src/client/BalanceBadge.module.css +184 -0
  107. package/packages/ui-billing/src/client/BalanceBadge.tsx +266 -0
  108. package/packages/ui-billing/src/client/index.ts +80 -0
  109. package/packages/ui-billing/src/client/locales.ts +45 -0
  110. package/packages/ui-billing/src/css-modules.d.ts +6 -0
  111. package/packages/ui-billing/src/index.ts +9 -0
  112. package/packages/ui-billing/src/invariant.ts +32 -0
  113. package/packages/ui-billing/tests/balance-badge.client.spec.tsx +267 -0
  114. package/packages/ui-billing/tests/browser-plugin.client.spec.ts +205 -0
  115. package/packages/ui-billing/tsconfig.json +36 -0
  116. package/packages/ui-billing/tsdown.config.ts +3 -0
@@ -0,0 +1,40 @@
1
+ /** `billing` namespace dictionaries. */
2
+ /** Dictionary namespace owned by this plugin. */
3
+ export const NS = 'billing';
4
+ /** Simplified Chinese dictionary (the key-set source of truth). */
5
+ export const zh = {
6
+ 'trigger.balance': '剩余额度:{amount}',
7
+ 'trigger.conversationSpend': '本轮对话花费:{amount}',
8
+ 'label.amount': 'API 剩余金额:{amount}',
9
+ 'label.sessionSpend': '本会话花费:{amount}',
10
+ 'label.todaySpend': '今日共花费:{amount}',
11
+ 'label.cost.hit': '缓存命中 {amount}',
12
+ 'label.cost.input': '未命中输入 {amount}',
13
+ 'label.cost.output': '输出 {amount}',
14
+ 'stat.none': '暂无消耗记录',
15
+ 'state.unavailable': '额度不可用',
16
+ 'action.refresh': '刷新',
17
+ 'info.aria': '花费说明',
18
+ 'info.hint': '仅能预估 DeepSeek 相关模型。本会话花费按每条消息的发生时刻(北京时间)所在峰谷时段单价计费:缓存命中输入、未命中输入(含缓存写入)、输出(含推理)分别计价。费用按 8 月 17 日实行的标准。',
19
+ 'badge.aria': 'DeepSeek 额度:{amount}',
20
+ 'panel.aria': 'DeepSeek 额度详情',
21
+ };
22
+ /** English dictionary, key-identical to the Chinese source of truth. */
23
+ export const en = {
24
+ 'trigger.balance': 'Balance: {amount}',
25
+ 'trigger.conversationSpend': 'This conversation: {amount}',
26
+ 'label.amount': 'API balance: {amount}',
27
+ 'label.sessionSpend': 'This session: {amount}',
28
+ 'label.todaySpend': 'Today total: {amount}',
29
+ 'label.cost.hit': 'Cache hit {amount}',
30
+ 'label.cost.input': 'Missed input {amount}',
31
+ 'label.cost.output': 'Output {amount}',
32
+ 'stat.none': 'No usage recorded',
33
+ 'state.unavailable': 'Balance unavailable',
34
+ 'action.refresh': 'Refresh',
35
+ 'info.aria': 'About this spend',
36
+ 'info.hint': "Only DeepSeek models are estimated. This session's spend is priced per message at the rate of its Beijing-time peak/off-peak hour: cache-hit input, cache-miss input (including cache writes), and output (including reasoning) are billed separately. Pricing follows the August 17 rates.",
37
+ 'badge.aria': 'DeepSeek balance {amount}',
38
+ 'panel.aria': 'DeepSeek balance details',
39
+ };
40
+ //# sourceMappingURL=locales.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.js","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAExC,iDAAiD;AACjD,MAAM,CAAC,MAAM,EAAE,GAAG,SAAS,CAAA;AAE3B,mEAAmE;AACnE,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,iBAAiB,EAAE,eAAe;IAClC,2BAA2B,EAAE,iBAAiB;IAC9C,cAAc,EAAE,mBAAmB;IACnC,oBAAoB,EAAE,gBAAgB;IACtC,kBAAkB,EAAE,gBAAgB;IACpC,gBAAgB,EAAE,eAAe;IACjC,kBAAkB,EAAE,gBAAgB;IACpC,mBAAmB,EAAE,aAAa;IAClC,WAAW,EAAE,QAAQ;IACrB,mBAAmB,EAAE,OAAO;IAC5B,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,uGAAuG;IACpH,YAAY,EAAE,sBAAsB;IACpC,YAAY,EAAE,eAAe;CACrB,CAAA;AAEV,wEAAwE;AACxE,MAAM,CAAC,MAAM,EAAE,GAA+B;IAC5C,iBAAiB,EAAE,mBAAmB;IACtC,2BAA2B,EAAE,6BAA6B;IAC1D,cAAc,EAAE,uBAAuB;IACvC,oBAAoB,EAAE,wBAAwB;IAC9C,kBAAkB,EAAE,uBAAuB;IAC3C,gBAAgB,EAAE,oBAAoB;IACtC,kBAAkB,EAAE,uBAAuB;IAC3C,mBAAmB,EAAE,iBAAiB;IACtC,WAAW,EAAE,mBAAmB;IAChC,mBAAmB,EAAE,qBAAqB;IAC1C,gBAAgB,EAAE,SAAS;IAC3B,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,6RAA6R;IAC1S,YAAY,EAAE,2BAA2B;IACzC,YAAY,EAAE,0BAA0B;CACzC,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Account-balance badge plugin, node half. Pure UI plugin: the empty apply
3
+ * exists so the plugin appears in the host cordis.yml / Loader; the browser
4
+ * half ships via exports["./client"], discovered through the package.json
5
+ * dshClient declaration.
6
+ */
7
+ /** Host plugin body — no host-side behavior for this source plugin. */
8
+ export declare function apply(): void;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uEAAuE;AACvE,wBAAgB,KAAK,IAAI,IAAI,CAAG"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Account-balance badge plugin, node half. Pure UI plugin: the empty apply
3
+ * exists so the plugin appears in the host cordis.yml / Loader; the browser
4
+ * half ships via exports["./client"], discovered through the package.json
5
+ * dshClient declaration.
6
+ */
7
+ /** Host plugin body — no host-side behavior for this source plugin. */
8
+ export function apply() { }
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uEAAuE;AACvE,MAAM,UAAU,KAAK,KAAU,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Package-owned invariant companion for `@rayadesu/dsh-client-ui-billing`.
3
+ * @module @rayadesu/dsh-client-ui-billing/invariant
4
+ */
5
+ import type { Context } from '@deepseek-ai/cordis';
6
+ /** Cordis companion plugin name. */
7
+ export declare const name = "client-ui-billing-invariant";
8
+ /** Service required before the companion can reserve package ownership. */
9
+ export declare const inject: string[];
10
+ /**
11
+ * Register this package's invariant companion.
12
+ * @param ctx - Cordis context carrying the invariant service.
13
+ * @returns the installed registration's disposer after setup succeeds.
14
+ */
15
+ export declare const apply: (ctx: Context) => Promise<() => void>;
16
+ //# sourceMappingURL=invariant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../src/invariant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,oCAAoC;AACpC,eAAO,MAAM,IAAI,gCAAgC,CAAA;AACjD,2EAA2E;AAC3E,eAAO,MAAM,MAAM,UAAiB,CAAA;AAUpC;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,OAAO,KAAG,OAAO,CAAC,MAAM,IAAI,CACU,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Package-owned invariant companion for `@rayadesu/dsh-client-ui-billing`.
3
+ * @module @rayadesu/dsh-client-ui-billing/invariant
4
+ */
5
+ const PACKAGE_NAME = '@rayadesu/dsh-client-ui-billing';
6
+ /** Cordis companion plugin name. */
7
+ export const name = 'client-ui-billing-invariant';
8
+ /** Service required before the companion can reserve package ownership. */
9
+ export const inject = ['invariants'];
10
+ /**
11
+ * No runtime invariant: this package is a read-only projection of one Remote
12
+ * snapshot onto one header slot entry. It emits no cordis events, owns no
13
+ * cross-plugin mutable state, and its single slot registration proves disposal
14
+ * through the HMR-safety spec.
15
+ */
16
+ const install = () => { };
17
+ /**
18
+ * Register this package's invariant companion.
19
+ * @param ctx - Cordis context carrying the invariant service.
20
+ * @returns the installed registration's disposer after setup succeeds.
21
+ */
22
+ export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
23
+ /* jscpd:ignore-end */
24
+ //# sourceMappingURL=invariant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invariant.js","sourceRoot":"","sources":["../../src/invariant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,YAAY,GAAG,oCAAoC,CAAA;AAEzD,oCAAoC;AACpC,MAAM,CAAC,MAAM,IAAI,GAAG,6BAA6B,CAAA;AACjD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,YAAY,CAAC,CAAA;AAEpC;;;;;GAKG;AACH,MAAM,OAAO,GAAuB,GAAG,EAAE,GAAE,CAAC,CAAA;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAY,EAAuB,EAAE,CACzD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;AACjE,sBAAsB"}
@@ -0,0 +1,43 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+ basedir_win="$basedir"
4
+ exe=""
5
+ msys=""
6
+
7
+ case `uname -a` in
8
+ *CYGWIN*|*MINGW*|*MSYS*)
9
+ if command -v cygpath > /dev/null 2>&1; then
10
+ basedir_win=`cygpath -w "$basedir"`
11
+ fi
12
+ exe=".exe"
13
+ msys="true"
14
+ ;;
15
+ *WSL2*)
16
+ if command -v wslpath > /dev/null 2>&1; then
17
+ basedir_win="$(wslpath -w "$basedir" 2> /dev/null)"
18
+ if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then
19
+ basedir_win="$basedir"
20
+ else
21
+ exe=".exe"
22
+ fi
23
+ fi
24
+ ;;
25
+ esac
26
+
27
+ if [ -z "$NODE_PATH" ]; then
28
+ export NODE_PATH="/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e/node_modules/@deepseek-ai/cordis/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/node_modules"
29
+ else
30
+ export NODE_PATH="/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e/node_modules/@deepseek-ai/cordis/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/node_modules:$NODE_PATH"
31
+ fi
32
+ if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then
33
+ exec "$basedir/node.exe" "$basedir_win/../@deepseek-ai/cordis/bin.js" "$@"
34
+ elif [ -x "$basedir/node" ]; then
35
+ exec "$basedir/node" "$basedir/../@deepseek-ai/cordis/bin.js" "$@"
36
+ elif command -v node >/dev/null 2>&1; then
37
+ exec node "$basedir/../@deepseek-ai/cordis/bin.js" "$@"
38
+ elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then
39
+ exec node.exe "$basedir_win/../@deepseek-ai/cordis/bin.js" "$@"
40
+ else
41
+ exec node "$basedir/../@deepseek-ai/cordis/bin.js" "$@"
42
+ fi
43
+ # cmd-shim-target=D:/code/DeepSeek-Harness-chat-billing/packages/ui-billing/node_modules/@deepseek-ai/cordis/bin.js
@@ -0,0 +1,12 @@
1
+ @SETLOCAL
2
+ @IF NOT DEFINED NODE_PATH (
3
+ @SET "NODE_PATH=D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e\node_modules\@deepseek-ai\cordis\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\node_modules"
4
+ ) ELSE (
5
+ @SET "NODE_PATH=D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e\node_modules\@deepseek-ai\cordis\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\node_modules;%NODE_PATH%"
6
+ )
7
+ @IF EXIST "%~dp0\node.exe" (
8
+ "%~dp0\node.exe" "%~dp0\..\@deepseek-ai\cordis\bin.js" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\@deepseek-ai\cordis\bin.js" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e\node_modules\@deepseek-ai\cordis\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e/node_modules/@deepseek-ai/cordis/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../@deepseek-ai/cordis/bin.js" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../@deepseek-ai/cordis/bin.js" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../@deepseek-ai/cordis/bin.js" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../@deepseek-ai/cordis/bin.js" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -0,0 +1,43 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+ basedir_win="$basedir"
4
+ exe=""
5
+ msys=""
6
+
7
+ case `uname -a` in
8
+ *CYGWIN*|*MINGW*|*MSYS*)
9
+ if command -v cygpath > /dev/null 2>&1; then
10
+ basedir_win=`cygpath -w "$basedir"`
11
+ fi
12
+ exe=".exe"
13
+ msys="true"
14
+ ;;
15
+ *WSL2*)
16
+ if command -v wslpath > /dev/null 2>&1; then
17
+ basedir_win="$(wslpath -w "$basedir" 2> /dev/null)"
18
+ if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then
19
+ basedir_win="$basedir"
20
+ else
21
+ exe=".exe"
22
+ fi
23
+ fi
24
+ ;;
25
+ esac
26
+
27
+ if [ -z "$NODE_PATH" ]; then
28
+ export NODE_PATH="/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/vite@8.2.1/node_modules/vite/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/vite@8.2.1/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/node_modules"
29
+ else
30
+ export NODE_PATH="/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/vite@8.2.1/node_modules/vite/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/vite@8.2.1/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/node_modules:$NODE_PATH"
31
+ fi
32
+ if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then
33
+ exec "$basedir/node.exe" "$basedir_win/../../../../node_modules/.pnpm/vite@8.2.1/node_modules/vite/bin/vite.js" "$@"
34
+ elif [ -x "$basedir/node" ]; then
35
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@8.2.1/node_modules/vite/bin/vite.js" "$@"
36
+ elif command -v node >/dev/null 2>&1; then
37
+ exec node "$basedir/../../../../node_modules/.pnpm/vite@8.2.1/node_modules/vite/bin/vite.js" "$@"
38
+ elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then
39
+ exec node.exe "$basedir_win/../../../../node_modules/.pnpm/vite@8.2.1/node_modules/vite/bin/vite.js" "$@"
40
+ else
41
+ exec node "$basedir/../../../../node_modules/.pnpm/vite@8.2.1/node_modules/vite/bin/vite.js" "$@"
42
+ fi
43
+ # cmd-shim-target=D:/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/vite@8.2.1/node_modules/vite/bin/vite.js
@@ -0,0 +1,12 @@
1
+ @SETLOCAL
2
+ @IF NOT DEFINED NODE_PATH (
3
+ @SET "NODE_PATH=D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\vite@8.2.1\node_modules\vite\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\vite@8.2.1\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\node_modules"
4
+ ) ELSE (
5
+ @SET "NODE_PATH=D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\vite@8.2.1\node_modules\vite\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\vite@8.2.1\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\node_modules;%NODE_PATH%"
6
+ )
7
+ @IF EXIST "%~dp0\node.exe" (
8
+ "%~dp0\node.exe" "%~dp0\..\..\..\..\node_modules\.pnpm\vite@8.2.1\node_modules\vite\bin\vite.js" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\..\..\..\node_modules\.pnpm\vite@8.2.1\node_modules\vite\bin\vite.js" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\vite@8.2.1\node_modules\vite\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\vite@8.2.1\node_modules;D:\code\DeepSeek-Harness-chat-billing\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/vite@8.2.1/node_modules/vite/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/vite@8.2.1/node_modules:/mnt/d/code/DeepSeek-Harness-chat-billing/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../../../../node_modules/.pnpm/vite@8.2.1/node_modules/vite/bin/vite.js" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../../../../node_modules/.pnpm/vite@8.2.1/node_modules/vite/bin/vite.js" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../../../../node_modules/.pnpm/vite@8.2.1/node_modules/vite/bin/vite.js" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../../../../node_modules/.pnpm/vite@8.2.1/node_modules/vite/bin/vite.js" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@rayadesu/dsh-client-ui-billing",
3
+ "description": "Session-header DeepSeek account-balance and conversation-spend badge over the billing Remote",
4
+ "version": "0.1.0-rc.8",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/types/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./invariant": {
14
+ "types": "./lib/types/invariant.d.ts",
15
+ "default": "./lib/invariant.js"
16
+ },
17
+ "./client": {
18
+ "types": "./lib/types/client/index.d.ts",
19
+ "default": "./lib/client.js"
20
+ },
21
+ "./src/*": "./src/*",
22
+ "./package.json": "./package.json"
23
+ },
24
+ "dsh": {
25
+ "client": {
26
+ "inject": [
27
+ "@deepseek-ai/dsh-client-locale",
28
+ "@deepseek-ai/dsh-client-runtime",
29
+ "@deepseek-ai/dsh-client-ui-conversation"
30
+ ],
31
+ "platform": "web"
32
+ }
33
+ },
34
+ "scripts": {
35
+ "bundle": "tsdown",
36
+ "watch": "tsdown --watch"
37
+ },
38
+ "license": "MIT",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/rayadesune/DeepSeek-Harness-chat-billing.git",
42
+ "directory": "packages/ui-billing"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "peerDependencies": {
48
+ "@rayadesu/dsh-llm-billing": "^0.1.0-rc.8",
49
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.8",
50
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.8",
51
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.8",
52
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.8",
53
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8",
54
+ "@deepseek-ai/cordis": "^4.0.1"
55
+ },
56
+ "devDependencies": {
57
+ "@rayadesu/dsh-llm-billing": "^0.1.0-rc.8",
58
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.8",
59
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.8",
60
+ "@deepseek-ai/dsh-client-test-runtime": "^0.1.0-rc.8",
61
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.8",
62
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.8",
63
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.8",
64
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.8",
65
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8",
66
+ "@types/react": "~18.3.1",
67
+ "react": "^18.2.0",
68
+ "@deepseek-ai/cordis": "^4.0.1"
69
+ },
70
+ "files": [
71
+ "lib/index.js",
72
+ "lib/invariant.js",
73
+ "lib/client.js",
74
+ "lib/types/**/*.d.ts"
75
+ ]
76
+ }
@@ -0,0 +1,184 @@
1
+ .root {
2
+ position: relative;
3
+ }
4
+
5
+ .trigger {
6
+ display: inline-flex;
7
+ align-items: center;
8
+ gap: 4px;
9
+ min-height: 32px;
10
+ padding: 4px 8px;
11
+ border: 0;
12
+ border-radius: 8px;
13
+ background: var(--dsw-alias-fill-l2);
14
+ color: var(--dsw-alias-label-secondary);
15
+ cursor: pointer;
16
+ }
17
+
18
+ .trigger:hover,
19
+ .trigger:focus-visible {
20
+ color: var(--dsw-alias-label-primary);
21
+ }
22
+
23
+ .trigger svg {
24
+ transition: transform 120ms ease;
25
+ }
26
+
27
+ .chevronOpen {
28
+ transform: rotate(180deg);
29
+ }
30
+
31
+ .triggerLines {
32
+ display: flex;
33
+ flex-direction: column;
34
+ align-items: flex-start;
35
+ gap: 0;
36
+ text-align: left;
37
+ }
38
+
39
+ .linePrimary {
40
+ font-size: 12px;
41
+ line-height: 16px;
42
+ font-variant-numeric: tabular-nums;
43
+ }
44
+
45
+ .lineSecondary {
46
+ font-size: 11px;
47
+ line-height: 15px;
48
+ color: var(--dsw-alias-label-tertiary);
49
+ font-variant-numeric: tabular-nums;
50
+ }
51
+
52
+ .unavailable {
53
+ color: var(--dsw-alias-label-tertiary);
54
+ }
55
+
56
+ .inlineIcon {
57
+ flex: none;
58
+ color: var(--dsw-alias-label-tertiary);
59
+ }
60
+
61
+ .spinning {
62
+ flex: none;
63
+ color: var(--dsw-alias-label-tertiary);
64
+ animation: spin 800ms linear infinite;
65
+ }
66
+
67
+ @keyframes spin {
68
+ to {
69
+ transform: rotate(360deg);
70
+ }
71
+ }
72
+
73
+ .panel {
74
+ position: absolute;
75
+ top: calc(100% + 6px);
76
+ right: 0;
77
+ z-index: 100;
78
+ box-sizing: border-box;
79
+ display: flex;
80
+ flex-direction: column;
81
+ gap: 2px;
82
+ width: 336px;
83
+ max-width: min(360px, calc(100vw - 32px));
84
+ padding: 6px;
85
+ border: 1px solid var(--dsw-alias-border-l2);
86
+ border-radius: 12px;
87
+ background: var(--dsw-specific-menu);
88
+ box-shadow: var(--dsw-shadow-lv3);
89
+ }
90
+
91
+ .amountRow {
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: space-between;
95
+ gap: 8px;
96
+ padding: 6px 8px;
97
+ border-radius: 8px;
98
+ }
99
+
100
+ .amountLabel {
101
+ color: var(--dsw-alias-label-primary);
102
+ font-size: 13px;
103
+ line-height: 18px;
104
+ font-variant-numeric: tabular-nums;
105
+ }
106
+
107
+ .spendRow {
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: space-between;
111
+ gap: 8px;
112
+ padding: 6px 8px;
113
+ border-top: 1px solid var(--dsw-alias-border-l2);
114
+ border-radius: 0;
115
+ }
116
+
117
+ .costRow {
118
+ display: flex;
119
+ align-items: center;
120
+ padding: 2px 8px 6px;
121
+ }
122
+
123
+ .costBreakdown {
124
+ color: var(--dsw-alias-label-tertiary);
125
+ font-size: 11px;
126
+ line-height: 16px;
127
+ font-variant-numeric: tabular-nums;
128
+ }
129
+
130
+ .amountActions {
131
+ display: inline-flex;
132
+ align-items: center;
133
+ gap: 2px;
134
+ }
135
+
136
+ .infoButton,
137
+ .refreshButton {
138
+ display: inline-flex;
139
+ align-items: center;
140
+ justify-content: center;
141
+ flex: none;
142
+ width: 24px;
143
+ height: 24px;
144
+ padding: 0;
145
+ border: 0;
146
+ border-radius: 6px;
147
+ background: transparent;
148
+ color: var(--dsw-alias-label-tertiary);
149
+ cursor: pointer;
150
+ }
151
+
152
+ .infoButton:hover,
153
+ .infoButton:focus-visible,
154
+ .refreshButton:hover,
155
+ .refreshButton:focus-visible {
156
+ color: var(--dsw-alias-label-secondary);
157
+ background: var(--dsw-alias-fill-l2);
158
+ }
159
+
160
+ .modelRow {
161
+ display: flex;
162
+ align-items: baseline;
163
+ justify-content: space-between;
164
+ gap: 8px;
165
+ padding: 6px 8px;
166
+ border-radius: 8px;
167
+ }
168
+
169
+ .modelName {
170
+ flex: none;
171
+ color: var(--dsw-alias-label-secondary);
172
+ font-size: 12px;
173
+ line-height: 18px;
174
+ }
175
+
176
+ .tasks {
177
+ min-width: 0;
178
+ text-align: right;
179
+ color: var(--dsw-alias-label-tertiary);
180
+ font-size: 12px;
181
+ line-height: 18px;
182
+ font-variant-numeric: tabular-nums;
183
+ overflow-wrap: anywhere;
184
+ }