dsh-multi-provider-usage 0.0.0-stage → 0.7.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/lib/util.js ADDED
@@ -0,0 +1,27 @@
1
+ // @ts-check
2
+ /**
3
+ * dsh-multi-provider-usage — tiny shared helpers.
4
+ *
5
+ * Deliberately dependency-free (no Node built-ins, no imports) so both
6
+ * `providers.js` and `opencode-console.js` can use them without an import
7
+ * cycle between the two.
8
+ */
9
+
10
+ /** Deduplicate strings, dropping blanks, preserving first occurrence. */
11
+ export function uniqueStrings(values) {
12
+ const out = [];
13
+ const seen = new Set();
14
+ for (const value of values) {
15
+ if (typeof value !== "string") continue;
16
+ const trimmed = value.trim();
17
+ if (trimmed.length === 0 || seen.has(trimmed)) continue;
18
+ seen.add(trimmed);
19
+ out.push(trimmed);
20
+ }
21
+ return out;
22
+ }
23
+
24
+ /** Whether a string is a valid DSH credential reference. */
25
+ export function isCredentialRefName(value) {
26
+ return typeof value === "string" && /^[A-Za-z_][A-Za-z0-9_]*$/.test(value);
27
+ }
package/package.json CHANGED
@@ -1,6 +1,66 @@
1
1
  {
2
2
  "name": "dsh-multi-provider-usage",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.7.2",
4
+ "description": "DSH (DeepSeek Harness) plugin: one collapsible sidebar widget for OpenCode GO, Command Code and GLM Code Plan quotas plus top-up balances, a periodic balance-change animation, automatic checkout and installed-package updates, same-origin usage proxies, a Plugins-panel settings page and a /provider-usage chat command (DSH 0.1.7+ and 0.2.0 compatible)",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "exports": {
8
+ ".": "./lib/index.js",
9
+ "./client": "./lib/client.js",
10
+ "./package.json": "./package.json"
11
+ },
12
+ "files": [
13
+ "lib",
14
+ "cordis.patch.yml",
15
+ "docs"
16
+ ],
17
+ "scripts": {
18
+ "test": "node test/run.mjs"
19
+ },
20
+ "keywords": [
21
+ "dsh",
22
+ "deepseek-harness",
23
+ "opencode",
24
+ "opencode-go",
25
+ "command-code",
26
+ "commandcode",
27
+ "glm",
28
+ "zai",
29
+ "bigmodel",
30
+ "balance",
31
+ "usage",
32
+ "quota",
33
+ "plugin",
34
+ "cordis"
35
+ ],
36
+ "engines": {
37
+ "node": ">=18"
38
+ },
39
+ "peerDependencies": {
40
+ "@deepseek-ai/schemastery": "^3.18.4",
41
+ "@deepseek-ai/dsh": ">=0.1.7-rc.1 <0.2.0-0 || >=0.2.0-rc.1 <0.2.1-0 || >=0.2.1-rc.1 <0.3.0-0"
42
+ },
43
+ "devDependencies": {
44
+ "@deepseek-ai/schemastery": "^3.18.5"
45
+ },
46
+ "license": "MIT",
47
+ "dsh": {
48
+ "bundle": {
49
+ "patch": "./cordis.patch.yml"
50
+ },
51
+ "client": {
52
+ "platform": "web"
53
+ }
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "git+https://github.com/wjw1-Evan/dsh-provider-usage.git"
61
+ },
62
+ "bugs": {
63
+ "url": "https://github.com/wjw1-Evan/dsh-provider-usage/issues"
64
+ },
65
+ "homepage": "https://github.com/wjw1-Evan/dsh-provider-usage#readme"
66
+ }