@yagni-app/code-staging 1.2.14-staging.2477.1 → 1.2.14-staging.2481.1

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.
@@ -63,10 +63,55 @@ export function crashReportsSuppressed(env = process.env) {
63
63
  // Mirrors scrubSecrets (backend yagniCode/scrubSecrets.ts and
64
64
  // pi-extension-yagni pipeline/scrubSecrets.ts) — keep in sync.
65
65
  export const SECRET_PATTERNS = [
66
- [/\b([a-z][a-z0-9+.\-]*:\/\/[^\s:@/]+):[^\s:@/]+@/gi, "$1:[REDACTED]@"],
67
- [/\b(sk-[A-Za-z0-9]{16,}|sk_(?:live|test)_[A-Za-z0-9]{16,}|rk_(?:live|test)_[A-Za-z0-9]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|xox[baprs]-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_\-]{20,})\b/g, "[REDACTED]"],
68
- [/\b([A-Za-z0-9_]*(?:secret|password|passwd|api[_-]?key|token|private[_-]?key|access[_-]?key)[A-Za-z0-9_]*)\b(\s*[:=]\s*)("[^"]+"|'[^']+'|`[^`]+`|[^\s"']+)/gi, "$1$2[REDACTED]"],
66
+ // Credentials embedded in connection-string URLs: scheme://user:password@host
67
+ // (the password segment has no secret-named key and is usually too short for the
68
+ // base64 rule, so it would otherwise survive — common in config/env diffs).
69
+ // The user name may be empty (`redis://:pass@cache`) and the password may
70
+ // hold a colon (`alice:a:b@db`); scheme, user and host stay readable
71
+ // (YAG-1324). User info ends before a `?` or `#`, so a port followed by a
72
+ // query or fragment holding an `@` (`https://host:8443?x@y`) is no password.
73
+ [/\b([a-z][a-z0-9+.\-]*:\/\/[^\s:@/?#]*):[^\s@/?#]+@/gi, "$1:[REDACTED]@"],
74
+ // Whole JWTs, base64url segments of any length (`_` and `-` among them), so
75
+ // the long-blob rule's 40 characters is no floor (YAG-1324).
76
+ [/\beyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*/g, "[REDACTED]"],
77
+ // Credential-bearing parameters, in a URL's query or fragment or bare on a
78
+ // line (YAG-1324): the name stays readable, the value goes. A name is a
79
+ // credential when its last `-`/`_`/`.` part is one (`X-Amz-Signature`,
80
+ // `X-Amz-Security-Token`, `client_secret`, `access_token`), never when the
81
+ // word is only inside a part (`design`, `zipcode`, `author`). These match
82
+ // anywhere a name starts, with `=` or, as a header dump or a JSON body
83
+ // writes them, `:` (`X-Amz-Signature: …`, `"client_secret":"…"`). Never a
84
+ // path's last part (`src/auth/token:12:5`) nor a stack frame's bare `line:col`
85
+ // (`at async token:12:5`). Prose after the name (`token: expired.`) is
86
+ // redacted all the same, failing closed; a value never ends in the
87
+ // sentence's `.`, `,`, `;`, `:`, `!`, `?` or `)`, which stays.
88
+ [
89
+ /(?<![A-Za-z0-9_.\-/\\])((?:[A-Za-z0-9]+[_.-])*(?:token|secret|signature|password|passwd|credential|credentials)["']?\s*[:=]\s*["']?)(?!\d+:\d+(?![^\s)]))[^&#\s"'<>]*[^&#\s"'<>.,;:!?)]/gi,
90
+ "$1[REDACTED]",
91
+ ],
92
+ // The short whole names (`sig`, `code`, `key`, `auth`) only behind a URL's
93
+ // `?`, `&`, `#` or `;`: bare, `code=1` is how a line says an exit code.
94
+ [/([?&#;](?:sig|code|key|auth)=)[^&#\s"'<>]*[^&#\s"'<>.,;:!?)]/gi, "$1[REDACTED]"],
95
+ // Provider key prefixes (OpenAI, Stripe secret/restricted, GitHub, Slack, AWS access key id, etc.)
96
+ [
97
+ /\b(sk-[A-Za-z0-9]{16,}|sk_(?:live|test)_[A-Za-z0-9]{16,}|rk_(?:live|test)_[A-Za-z0-9]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|xox[baprs]-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_\-]{20,})\b/g,
98
+ "[REDACTED]",
99
+ ],
100
+ // key = "value" / key: value for secret-named keys, the key quoted as JSON
101
+ // quotes it too (`"password":"…"`, YAG-1324). As the parameter rule above:
102
+ // never a path's last part nor a frame's bare `line:col` (not `12:34:56`), and an unquoted value
103
+ // leaves the sentence's closing punctuation.
104
+ [
105
+ /(?<![/\\])\b([A-Za-z0-9_]*(?:secret|password|passwd|api[_-]?key|token|private[_-]?key|access[_-]?key)[A-Za-z0-9_]*)\b(["']?\s*[:=]\s*)("[^"]+"|'[^']+'|`[^`]+`|(?!\d+:\d+(?![^\s)]))[^\s"']*[^\s"'.,;:!?)])/gi,
106
+ "$1$2[REDACTED]",
107
+ ],
108
+ // Long base64-ish blobs (likely keys/JWTs)
69
109
  [/\b[A-Za-z0-9+/]{40,}={0,2}\b/g, "[REDACTED]"],
110
+ // Opaque bearer tokens in Authorization headers: no provider prefix, no
111
+ // secret-named key, and usually under the base64 length threshold — none of
112
+ // the patterns above catch them. Keep the scheme, redact the token. Header
113
+ // names and auth schemes are case-insensitive (RFC 9110) — hence the flag.
114
+ [/(\bauthorization\s*[:=]\s*["']?bearer\s+)([a-z0-9._~+/=-]+)/gi, "$1[REDACTED]"],
70
115
  ];
71
116
  const HOME_DIR_RE = /(?:\/(?:Users|home)\/|[A-Za-z]:\\Users\\)[^\s/\\]+/g;
72
117
  /**
@@ -15,11 +15,45 @@ const PATTERNS = [
15
15
  // Credentials embedded in connection-string URLs: scheme://user:password@host
16
16
  // (the password segment has no secret-named key and is usually too short for the
17
17
  // base64 rule, so it would otherwise survive — common in config/env diffs).
18
- [/\b([a-z][a-z0-9+.\-]*:\/\/[^\s:@/]+):[^\s:@/]+@/gi, "$1:[REDACTED]@"],
18
+ // The user name may be empty (`redis://:pass@cache`) and the password may
19
+ // hold a colon (`alice:a:b@db`); scheme, user and host stay readable
20
+ // (YAG-1324). User info ends before a `?` or `#`, so a port followed by a
21
+ // query or fragment holding an `@` (`https://host:8443?x@y`) is no password.
22
+ [/\b([a-z][a-z0-9+.\-]*:\/\/[^\s:@/?#]*):[^\s@/?#]+@/gi, "$1:[REDACTED]@"],
23
+ // Whole JWTs, base64url segments of any length (`_` and `-` among them), so
24
+ // the long-blob rule's 40 characters is no floor (YAG-1324).
25
+ [/\beyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*/g, "[REDACTED]"],
26
+ // Credential-bearing parameters, in a URL's query or fragment or bare on a
27
+ // line (YAG-1324): the name stays readable, the value goes. A name is a
28
+ // credential when its last `-`/`_`/`.` part is one (`X-Amz-Signature`,
29
+ // `X-Amz-Security-Token`, `client_secret`, `access_token`), never when the
30
+ // word is only inside a part (`design`, `zipcode`, `author`). These match
31
+ // anywhere a name starts, with `=` or, as a header dump or a JSON body
32
+ // writes them, `:` (`X-Amz-Signature: …`, `"client_secret":"…"`). Never a
33
+ // path's last part (`src/auth/token:12:5`) nor a stack frame's bare `line:col`
34
+ // (`at async token:12:5`). Prose after the name (`token: expired.`) is
35
+ // redacted all the same, failing closed; a value never ends in the
36
+ // sentence's `.`, `,`, `;`, `:`, `!`, `?` or `)`, which stays.
37
+ [
38
+ /(?<![A-Za-z0-9_.\-/\\])((?:[A-Za-z0-9]+[_.-])*(?:token|secret|signature|password|passwd|credential|credentials)["']?\s*[:=]\s*["']?)(?!\d+:\d+(?![^\s)]))[^&#\s"'<>]*[^&#\s"'<>.,;:!?)]/gi,
39
+ "$1[REDACTED]",
40
+ ],
41
+ // The short whole names (`sig`, `code`, `key`, `auth`) only behind a URL's
42
+ // `?`, `&`, `#` or `;`: bare, `code=1` is how a line says an exit code.
43
+ [/([?&#;](?:sig|code|key|auth)=)[^&#\s"'<>]*[^&#\s"'<>.,;:!?)]/gi, "$1[REDACTED]"],
19
44
  // Provider key prefixes (OpenAI, Stripe secret/restricted, GitHub, Slack, AWS access key id, etc.)
20
- [/\b(sk-[A-Za-z0-9]{16,}|sk_(?:live|test)_[A-Za-z0-9]{16,}|rk_(?:live|test)_[A-Za-z0-9]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|xox[baprs]-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_\-]{20,})\b/g, "[REDACTED]"],
21
- // key = "value" / key: value for secret-named keys
22
- [/\b([A-Za-z0-9_]*(?:secret|password|passwd|api[_-]?key|token|private[_-]?key|access[_-]?key)[A-Za-z0-9_]*)\b(\s*[:=]\s*)("[^"]+"|'[^']+'|`[^`]+`|[^\s"']+)/gi, "$1$2[REDACTED]"],
45
+ [
46
+ /\b(sk-[A-Za-z0-9]{16,}|sk_(?:live|test)_[A-Za-z0-9]{16,}|rk_(?:live|test)_[A-Za-z0-9]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|xox[baprs]-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_\-]{20,})\b/g,
47
+ "[REDACTED]",
48
+ ],
49
+ // key = "value" / key: value for secret-named keys, the key quoted as JSON
50
+ // quotes it too (`"password":"…"`, YAG-1324). As the parameter rule above:
51
+ // never a path's last part nor a frame's bare `line:col` (not `12:34:56`), and an unquoted value
52
+ // leaves the sentence's closing punctuation.
53
+ [
54
+ /(?<![/\\])\b([A-Za-z0-9_]*(?:secret|password|passwd|api[_-]?key|token|private[_-]?key|access[_-]?key)[A-Za-z0-9_]*)\b(["']?\s*[:=]\s*)("[^"]+"|'[^']+'|`[^`]+`|(?!\d+:\d+(?![^\s)]))[^\s"']*[^\s"'.,;:!?)])/gi,
55
+ "$1$2[REDACTED]",
56
+ ],
23
57
  // Long base64-ish blobs (likely keys/JWTs)
24
58
  [/\b[A-Za-z0-9+/]{40,}={0,2}\b/g, "[REDACTED]"],
25
59
  // Opaque bearer tokens in Authorization headers: no provider prefix, no
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yagni-app/code-staging",
3
- "version": "1.2.14-staging.2477.1",
3
+ "version": "1.2.14-staging.2481.1",
4
4
  "description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
@@ -58,5 +58,5 @@
58
58
  "turndown": "^7.2.4",
59
59
  "typebox": "^1.3.15"
60
60
  },
61
- "yagniSourceSha": "5c78e3655678cde867260226373cdcf7834906f6"
61
+ "yagniSourceSha": "16158fec6803b7dae644373f3cb4612a11417569"
62
62
  }