@cofy-x/dsh-console 0.1.0-alpha.0 → 0.1.0-alpha.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.
@@ -1585,24 +1585,52 @@ var NEVER_ALLOWED_NAME_PATTERNS = [
1585
1585
  var NEVER_ALLOWED_VALUE_PATTERNS = [
1586
1586
  /-----BEGIN (RSA|OPENSSH|EC|PGP) PRIVATE KEY-----/i,
1587
1587
  /-----BEGIN CERTIFICATE-----/i,
1588
- // Credentials in URL
1589
- /(https?|ftp|smtp):\/\/[^:]+:[^@]+@/i,
1590
1588
  // GitHub tokens (classic, fine-grained, OAuth, etc.)
1591
1589
  /(ghp|gho|ghu|ghs|ghr|github_pat)_[a-zA-Z0-9_]{36,}/i,
1592
1590
  // Google API keys
1593
1591
  /AIzaSy[a-zA-Z0-9_\\-]{33}/i,
1594
1592
  // Amazon AWS Access Key ID
1595
1593
  /AKIA[A-Z0-9]{16}/i,
1596
- // Generic OAuth/JWT tokens
1597
- /eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]*/i,
1598
1594
  // Stripe API keys
1599
1595
  /(s|r)k_(live|test)_[0-9a-zA-Z]{24}/i,
1600
1596
  // Slack tokens (bot, user, etc.)
1601
1597
  /xox[abpr]-[a-zA-Z0-9-]+/i
1602
1598
  ];
1599
+ var CREDENTIAL_URL_PROTOCOLS = /* @__PURE__ */ new Set([
1600
+ "http:",
1601
+ "https:",
1602
+ "ftp:",
1603
+ "smtp:"
1604
+ ]);
1605
+ function containsUrlCredentials(value) {
1606
+ try {
1607
+ const url = new URL(value);
1608
+ return CREDENTIAL_URL_PROTOCOLS.has(url.protocol) && (url.username.length > 0 || url.password.length > 0);
1609
+ } catch {
1610
+ return false;
1611
+ }
1612
+ }
1613
+ function isBase64UrlSegment(value) {
1614
+ if (value.length === 0) {
1615
+ return false;
1616
+ }
1617
+ for (const character of value) {
1618
+ const code = character.charCodeAt(0);
1619
+ const isDigit = code >= 48 && code <= 57;
1620
+ const isUppercase = code >= 65 && code <= 90;
1621
+ const isLowercase = code >= 97 && code <= 122;
1622
+ if (!isDigit && !isUppercase && !isLowercase && character !== "_" && character !== "-") {
1623
+ return false;
1624
+ }
1625
+ }
1626
+ return true;
1627
+ }
1628
+ function looksLikeJwt(value) {
1629
+ const segments = value.split(".");
1630
+ return segments.length === 3 && segments[0].startsWith("eyJ") && segments.every(isBase64UrlSegment);
1631
+ }
1603
1632
  function shouldRedactEnvironmentVariable(key, value, allowedSet, blockedSet, isStrictSanitization = false) {
1604
1633
  key = key.toUpperCase();
1605
- value = value?.toUpperCase();
1606
1634
  if (allowedSet?.has(key)) {
1607
1635
  return false;
1608
1636
  }
@@ -1624,6 +1652,9 @@ function shouldRedactEnvironmentVariable(key, value, allowedSet, blockedSet, isS
1624
1652
  }
1625
1653
  }
1626
1654
  if (value) {
1655
+ if (containsUrlCredentials(value) || looksLikeJwt(value)) {
1656
+ return true;
1657
+ }
1627
1658
  for (const pattern of NEVER_ALLOWED_VALUE_PATTERNS) {
1628
1659
  if (pattern.test(value)) {
1629
1660
  return true;
package/dist/dsh/index.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  apply,
4
4
  inject,
5
5
  name
6
- } from "../chunk-Z7RUTXMO.js";
7
- import "../chunk-YNJGTXFJ.js";
6
+ } from "../chunk-JFPTU3O3.js";
7
+ import "../chunk-N3EQS35J.js";
8
8
  export {
9
9
  Config,
10
10
  apply,
package/dist/index.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  Config,
3
3
  apply,
4
4
  name
5
- } from "./chunk-Z7RUTXMO.js";
6
- import "./chunk-YNJGTXFJ.js";
5
+ } from "./chunk-JFPTU3O3.js";
6
+ import "./chunk-N3EQS35J.js";
7
7
  export {
8
8
  Config,
9
9
  apply,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  registerExtensionContentRenderer
3
- } from "../chunk-YNJGTXFJ.js";
3
+ } from "../chunk-N3EQS35J.js";
4
4
  export {
5
5
  registerExtensionContentRenderer
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofy-x/dsh-console",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.2",
4
4
  "description": "A TypeScript and React/Ink terminal frontend for DeepSeek Harness.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,7 +35,8 @@
35
35
  "lint": "eslint . --ext .ts,.tsx",
36
36
  "format": "prettier --write .",
37
37
  "test": "vitest run",
38
- "test:ci": "vitest run --coverage",
38
+ "test:ci": "vitest run --coverage --exclude '**/*.performance.test.ts'",
39
+ "test:performance": "vitest run --coverage.enabled=false --maxWorkers=1 src/ui/hooks/input/use-text-buffer.performance.test.ts",
39
40
  "typecheck": "tsc --noEmit",
40
41
  "example": "tsx --tsconfig examples/tsconfig.run.json",
41
42
  "example:debug": "TSX_TSCONFIG_PATH=examples/tsconfig.run.json node --inspect-brk --import tsx/esm",
@@ -78,13 +79,13 @@
78
79
  "ink-spinner": "^5.0.0",
79
80
  "lowlight": "^3.3.0",
80
81
  "mnemonist": "^0.40.3",
81
- "picomatch": "^4.0.3",
82
+ "picomatch": "^4.0.7",
82
83
  "react": "^19.2.8",
83
84
  "string-width": "^8.1.0",
84
85
  "strip-ansi": "^7.1.2",
85
86
  "strip-json-comments": "^5.0.3",
86
87
  "tinygradient": "^2.0.1",
87
- "undici": "^7.16.0",
88
+ "undici": "^7.29.0",
88
89
  "yargs": "^18.0.0",
89
90
  "zod": "^3.25.76"
90
91
  },
@@ -95,11 +96,13 @@
95
96
  "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
96
97
  "@deepseek-ai/dsh-agent-default-model": "0.1.1-rc.2",
97
98
  "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
99
+ "@deepseek-ai/dsh-credentials": "0.1.1-rc.2",
98
100
  "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
99
101
  "@deepseek-ai/dsh-permission-presets": "0.1.1-rc.2",
100
102
  "@deepseek-ai/dsh-session": "0.1.1-rc.2",
101
103
  "@deepseek-ai/dsh-session-projection": "0.1.1-rc.2",
102
104
  "@deepseek-ai/dsh-session-query": "0.1.1-rc.2",
105
+ "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
103
106
  "@deepseek-ai/dsh-tools": "0.1.1-rc.2",
104
107
  "@deepseek-ai/dsh-user-approval": "0.1.1-rc.2",
105
108
  "@deepseek-ai/dsh-user-questions": "0.1.1-rc.2",
@@ -128,7 +131,9 @@
128
131
  "@deepseek-ai/dsh-tools": ">=0.1.0-rc.3 <0.2.0",
129
132
  "@deepseek-ai/dsh-user-approval": ">=0.1.0-rc.3 <0.2.0",
130
133
  "@deepseek-ai/dsh-user-questions": ">=0.1.0-rc.3 <0.2.0",
131
- "@deepseek-ai/dsh-commands": ">=0.1.0-rc.3 <0.2.0"
134
+ "@deepseek-ai/dsh-commands": ">=0.1.0-rc.3 <0.2.0",
135
+ "@deepseek-ai/dsh-credentials": ">=0.1.0-rc.3 <0.2.0",
136
+ "@deepseek-ai/dsh-settings": ">=0.1.0-rc.3 <0.2.0"
132
137
  },
133
138
  "peerDependenciesMeta": {
134
139
  "@deepseek-ai/cordis": {
@@ -172,11 +177,16 @@
172
177
  },
173
178
  "@deepseek-ai/dsh-commands": {
174
179
  "optional": true
180
+ },
181
+ "@deepseek-ai/dsh-credentials": {
182
+ "optional": true
183
+ },
184
+ "@deepseek-ai/dsh-settings": {
185
+ "optional": true
175
186
  }
176
187
  },
177
188
  "license": "Apache-2.0",
178
189
  "publishConfig": {
179
- "access": "public",
180
- "tag": "alpha"
190
+ "access": "public"
181
191
  }
182
192
  }