@hongymagic/q 2026.307.1 → 2026.310.0-next.90edad3

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/q.js +23 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -83,7 +83,7 @@ q providers # List configured providers
83
83
 
84
84
  Config is loaded from (later overrides earlier):
85
85
 
86
- 1. `~/.config/q/config.toml`
86
+ 1. `$XDG_CONFIG_HOME/q/config.toml` (or `~/.config/q/config.toml`)
87
87
  2. `./config.toml` (project-specific)
88
88
  3. Environment: `Q_PROVIDER`, `Q_MODEL`, `Q_COPY`
89
89
 
package/dist/q.js CHANGED
@@ -14711,7 +14711,7 @@ import { parseArgs } from "node:util";
14711
14711
  // package.json
14712
14712
  var package_default = {
14713
14713
  name: "@hongymagic/q",
14714
- version: "2026.307.1",
14714
+ version: "2026.310.0-next.90edad3",
14715
14715
  description: "Quick AI answers from the command line",
14716
14716
  main: "dist/q.js",
14717
14717
  type: "module",
@@ -29591,7 +29591,7 @@ function formatUnknownValue(value, depth = 0) {
29591
29591
  if (properties.length > 0) {
29592
29592
  lines.push(`${prefix}properties:`);
29593
29593
  for (const [key, propertyValue] of properties) {
29594
- lines.push(`${prefix} ${key}: ${formatValue(propertyValue)}`);
29594
+ lines.push(`${prefix} ${key}: ${formatPropertyValue(key, propertyValue)}`);
29595
29595
  }
29596
29596
  }
29597
29597
  if (value.cause !== undefined) {
@@ -29615,11 +29615,29 @@ function formatValue(value) {
29615
29615
  return String(value);
29616
29616
  }
29617
29617
  try {
29618
- return JSON.stringify(value, null, 2);
29618
+ return JSON.stringify(value, (k, v) => {
29619
+ if (!k) {
29620
+ return v;
29621
+ }
29622
+ return isSensitiveKey(k) ? redactValue(v) : v;
29623
+ }, 2);
29619
29624
  } catch {
29620
29625
  return String(value);
29621
29626
  }
29622
29627
  }
29628
+ function formatPropertyValue(key, value) {
29629
+ return isSensitiveKey(key) ? String(redactValue(value)) : formatValue(value);
29630
+ }
29631
+ function isSensitiveKey(key) {
29632
+ const lowerKey = key.toLowerCase();
29633
+ return lowerKey === "authorization" || lowerKey === "password" || lowerKey === "token" || lowerKey.endsWith("_key");
29634
+ }
29635
+ function redactValue(value) {
29636
+ if (typeof value === "string") {
29637
+ return value.length > 12 ? `${value.substring(0, 8)}...${value.substring(value.length - 4)}` : "********";
29638
+ }
29639
+ return "********";
29640
+ }
29623
29641
  function indentBlock(value, depth) {
29624
29642
  const prefix = " ".repeat(depth);
29625
29643
  return value.split(`
@@ -63399,14 +63417,14 @@ var SENSITIVE_FIELD_PATTERNS = [
63399
63417
  "auth",
63400
63418
  "credential"
63401
63419
  ];
63402
- function isSensitiveKey(key) {
63420
+ function isSensitiveKey2(key) {
63403
63421
  const lowerKey = key.toLowerCase();
63404
63422
  return SENSITIVE_FIELD_PATTERNS.some((pattern) => lowerKey.includes(pattern));
63405
63423
  }
63406
63424
  function filterSensitiveFields(config2) {
63407
63425
  const result = {};
63408
63426
  for (const [key, value] of Object.entries(config2)) {
63409
- if (isSensitiveKey(key)) {
63427
+ if (isSensitiveKey2(key)) {
63410
63428
  continue;
63411
63429
  }
63412
63430
  if (value && typeof value === "object" && !Array.isArray(value)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hongymagic/q",
3
- "version": "2026.307.1",
3
+ "version": "2026.310.0-next.90edad3",
4
4
  "description": "Quick AI answers from the command line",
5
5
  "main": "dist/q.js",
6
6
  "type": "module",