@desplega.ai/agent-swarm 1.95.0 → 1.96.0

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.
@@ -93,42 +93,63 @@ const MIN_VALUE_LENGTH = 12;
93
93
  * Order matters when one pattern is a prefix of another (e.g. `sk-ant-` must
94
94
  * match before the more general `sk-`).
95
95
  */
96
+
97
+ // Leading word boundary that also matches after JSON escape sequences (\n, \t,
98
+ // \r, etc.) where the trailing char is alphanumeric and defeats standard \b.
99
+ const TB = String.raw`(?:(?<=\\[nrtbfu0])|(?<!\w))`;
100
+
96
101
  const TOKEN_REGEXES: ReadonlyArray<{ name: string; re: RegExp }> = [
97
102
  // GitHub fine-grained PATs
98
103
  { name: "github_pat", re: /github_pat_[A-Za-z0-9_]{20,}/g },
99
104
  // GitHub classic/OAuth tokens (ghp_, gho_, ghu_, ghs_, ghr_)
100
- { name: "github_token", re: /\bgh[pousr]_[A-Za-z0-9]{20,}\b/g },
105
+ { name: "github_token", re: new RegExp(String.raw`${TB}gh[pousr]_[A-Za-z0-9]{20,}\b`, "g") },
101
106
  // GitLab personal access tokens
102
- { name: "gitlab_pat", re: /\bglpat-[A-Za-z0-9_-]{20,}\b/g },
107
+ { name: "gitlab_pat", re: new RegExp(String.raw`${TB}glpat-[A-Za-z0-9_-]{20,}\b`, "g") },
103
108
  // Anthropic API keys (must match before the generic sk- rule below)
104
- { name: "anthropic_key", re: /\bsk-ant-[A-Za-z0-9_-]{20,}\b/g },
109
+ { name: "anthropic_key", re: new RegExp(String.raw`${TB}sk-ant-[A-Za-z0-9_-]{20,}\b`, "g") },
105
110
  // OpenAI project keys
106
- { name: "openai_proj_key", re: /\bsk-proj-[A-Za-z0-9_-]{20,}\b/g },
111
+ { name: "openai_proj_key", re: new RegExp(String.raw`${TB}sk-proj-[A-Za-z0-9_-]{20,}\b`, "g") },
107
112
  // OpenRouter keys
108
- { name: "openrouter_key", re: /\bsk-or-(?:v1-)?[A-Za-z0-9_-]{20,}\b/g },
113
+ {
114
+ name: "openrouter_key",
115
+ re: new RegExp(String.raw`${TB}sk-or-(?:v1-)?[A-Za-z0-9_-]{20,}\b`, "g"),
116
+ },
109
117
  // Generic sk- legacy OpenAI keys (must come AFTER the ant/proj/or variants)
110
- { name: "sk_key", re: /\bsk-[A-Za-z0-9]{20,}\b/g },
118
+ { name: "sk_key", re: new RegExp(String.raw`${TB}sk-[A-Za-z0-9]{20,}\b`, "g") },
111
119
  // Slack tokens
112
- { name: "slack_token", re: /\bxox[baprseo]-[A-Za-z0-9-]{10,}\b/g },
120
+ { name: "slack_token", re: new RegExp(String.raw`${TB}xox[baprseo]-[A-Za-z0-9-]{10,}\b`, "g") },
113
121
  // AWS access key IDs
114
- { name: "aws_access_key", re: /\bAKIA[0-9A-Z]{16}\b/g },
122
+ { name: "aws_access_key", re: new RegExp(String.raw`${TB}AKIA[0-9A-Z]{16}\b`, "g") },
115
123
  // Google API keys
116
- { name: "google_api_key", re: /\bAIza[A-Za-z0-9_-]{35}\b/g },
124
+ { name: "google_api_key", re: new RegExp(String.raw`${TB}AIza[A-Za-z0-9_-]{35}\b`, "g") },
117
125
  // JWTs (3 dot-separated base64url segments)
118
126
  {
119
127
  name: "jwt",
120
- re: /\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,
128
+ re: new RegExp(
129
+ String.raw`${TB}eyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b`,
130
+ "g",
131
+ ),
121
132
  },
122
133
  // SigNoz Cloud OTLP auth header values.
123
134
  {
124
135
  name: "signoz_ingestion_key",
125
- re: /\bsignoz-ingestion-key=[A-Za-z0-9._~+/-]{20,}={0,2}\b/g,
136
+ re: new RegExp(String.raw`${TB}signoz-ingestion-key=[A-Za-z0-9._~+/-]{20,}={0,2}\b`, "g"),
137
+ },
138
+ // Linear OAuth tokens and API keys
139
+ { name: "linear_oauth", re: new RegExp(String.raw`${TB}lin_oauth_[A-Za-z0-9_-]{10,}\b`, "g") },
140
+ { name: "linear_api", re: new RegExp(String.raw`${TB}lin_api_[A-Za-z0-9_-]{10,}\b`, "g") },
141
+ // npm tokens
142
+ { name: "npm_token", re: new RegExp(String.raw`${TB}npm_[A-Za-z0-9_-]{20,}\b`, "g") },
143
+ // Jira API tokens (Atlassian cloud)
144
+ {
145
+ name: "atlassian_token",
146
+ re: new RegExp(String.raw`${TB}ATATT[A-Za-z0-9_-]{20,}\b`, "g"),
126
147
  },
127
148
  // Agent-swarm MCP user tokens (`aswt_<base62-20+>`). Schema lands in
128
149
  // migration 064; mint/revoke endpoints ship with the MCP-token plan.
129
150
  // Rule lives here now so plaintexts never leak into logs once endpoints
130
151
  // come online.
131
- { name: "mcp_token", re: /\baswt_[A-Za-z0-9]{20,}\b/g },
152
+ { name: "mcp_token", re: new RegExp(String.raw`${TB}aswt_[A-Za-z0-9]{20,}\b`, "g") },
132
153
  ];
133
154
 
134
155
  interface EnvValueEntry {