@wayai/cli 0.3.100 → 0.3.102

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/dist/index.js CHANGED
@@ -26,7 +26,7 @@ function valueEnd(text, from, isEnd) {
26
26
  }
27
27
  return text.length;
28
28
  }
29
- function maskCredentialValues(text, keyRe, isValueEnd) {
29
+ function maskCredentialValues(text, keyRe, resolveValueEnd) {
30
30
  keyRe.lastIndex = 0;
31
31
  let out = "";
32
32
  let copied = 0;
@@ -35,7 +35,7 @@ function maskCredentialValues(text, keyRe, isValueEnd) {
35
35
  const valueStart = match.index + match[0].length;
36
36
  keyRe.lastIndex = valueStart;
37
37
  if (!isCredentialKey(match[1])) continue;
38
- const end = valueEnd(text, valueStart, isValueEnd);
38
+ const end = resolveValueEnd(text, valueStart);
39
39
  const value = text.slice(valueStart, end);
40
40
  if (value.length === 0 || FULLY_MASKED_VALUE_RE.test(value)) continue;
41
41
  out += text.slice(copied, valueStart) + "[REDACTED]";
@@ -44,43 +44,245 @@ function maskCredentialValues(text, keyRe, isValueEnd) {
44
44
  }
45
45
  return out + text.slice(copied);
46
46
  }
47
- function maskSecretsInMessage(text) {
48
- let out = text;
47
+ function maskJwts(text) {
48
+ let out = "";
49
+ let copied = 0;
50
+ let cursor = 0;
51
+ while (cursor < text.length) {
52
+ while (cursor < text.length && !isBase64UrlChar(text[cursor])) cursor++;
53
+ const headerStart = cursor;
54
+ let tokenStart = -1;
55
+ while (cursor < text.length && isBase64UrlChar(text[cursor])) {
56
+ if (tokenStart < 0 && text[cursor] === "e" && text[cursor + 1] === "y" && text[cursor + 2] === "J") {
57
+ tokenStart = cursor;
58
+ }
59
+ cursor++;
60
+ }
61
+ const headerEnd = cursor;
62
+ if (headerStart === headerEnd) continue;
63
+ const hasJwtHeader = tokenStart >= headerStart && tokenStart + 3 < headerEnd;
64
+ if (!hasJwtHeader || text[headerEnd] !== ".") continue;
65
+ const payloadStart = headerEnd + 1;
66
+ cursor = payloadStart;
67
+ while (cursor < text.length && isBase64UrlChar(text[cursor])) cursor++;
68
+ const payloadEnd = cursor;
69
+ if (payloadEnd === payloadStart || text[payloadEnd] !== ".") continue;
70
+ const signatureStart = payloadEnd + 1;
71
+ cursor = signatureStart;
72
+ while (cursor < text.length && isBase64UrlChar(text[cursor])) cursor++;
73
+ if (cursor === signatureStart) continue;
74
+ out += text.slice(copied, tokenStart) + "[REDACTED_JWT]";
75
+ copied = cursor;
76
+ }
77
+ return out + text.slice(copied);
78
+ }
79
+ function jsonContainerEnd(text, from) {
80
+ const opener = text[from];
81
+ if (opener !== "{" && opener !== "[") return null;
82
+ const stack = [opener];
83
+ let inString = false;
84
+ for (let i = from + 1; i < text.length; i++) {
85
+ const char = text[i];
86
+ if (inString) {
87
+ if (char === "\\") {
88
+ i++;
89
+ } else if (char === '"') {
90
+ inString = false;
91
+ }
92
+ continue;
93
+ }
94
+ if (char === '"') {
95
+ inString = true;
96
+ } else if (char === "{" || char === "[") {
97
+ stack.push(char);
98
+ } else if (char === "}" || char === "]") {
99
+ const expected2 = char === "}" ? "{" : "[";
100
+ if (stack.pop() !== expected2) return null;
101
+ if (stack.length === 0) return i + 1;
102
+ }
103
+ }
104
+ return null;
105
+ }
106
+ function jsonNumberEnd(text, from) {
107
+ const match = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/.exec(text.slice(from));
108
+ if (!match) return null;
109
+ const end = from + match[0].length;
110
+ let next = end;
111
+ while (next < text.length && /\s/.test(text[next])) next++;
112
+ return next === text.length || text[next] === "," || text[next] === "}" || text[next] === "]" ? end : null;
113
+ }
114
+ function maskJsonCredentialValues(text) {
115
+ JSON_KEY_RE.lastIndex = 0;
116
+ let out = "";
117
+ let copied = 0;
118
+ let match;
119
+ while ((match = JSON_KEY_RE.exec(text)) !== null) {
120
+ const valueStart = match.index + match[0].length;
121
+ JSON_KEY_RE.lastIndex = valueStart;
122
+ const key = match[1];
123
+ const isNumericCredentialKey = NUMERIC_CREDENTIAL_KEY_RE.test(key);
124
+ if (!isCredentialKey(key) && !isNumericCredentialKey) continue;
125
+ if (text[valueStart] === '"') {
126
+ const contentStart = valueStart + 1;
127
+ const end = valueEnd(text, contentStart, isJsonValueEnd);
128
+ const value = text.slice(contentStart, end);
129
+ if (value.length === 0 || FULLY_MASKED_VALUE_RE.test(value)) continue;
130
+ out += text.slice(copied, contentStart) + "[REDACTED]";
131
+ copied = end;
132
+ JSON_KEY_RE.lastIndex = end;
133
+ continue;
134
+ }
135
+ if (text[valueStart] === "{" || text[valueStart] === "[") {
136
+ const end = jsonContainerEnd(text, valueStart) ?? text.length;
137
+ out += text.slice(copied, valueStart) + '"[REDACTED]"';
138
+ copied = end;
139
+ JSON_KEY_RE.lastIndex = end;
140
+ continue;
141
+ }
142
+ if (isNumericCredentialKey) {
143
+ const end = jsonNumberEnd(text, valueStart);
144
+ if (end !== null) {
145
+ out += text.slice(copied, valueStart) + '"[REDACTED]"';
146
+ copied = end;
147
+ JSON_KEY_RE.lastIndex = end;
148
+ }
149
+ }
150
+ }
151
+ return out + text.slice(copied);
152
+ }
153
+ function headerValueEnd(text, from) {
154
+ for (let i = from; i < text.length; i++) {
155
+ const char = text[i];
156
+ if (char === "\r" || char === "\n") return i;
157
+ if (char === "\\") {
158
+ let afterSlashes = i;
159
+ while (text[afterSlashes] === "\\") afterSlashes++;
160
+ const slashCount = afterSlashes - i;
161
+ if (slashCount % 2 === 1 && (text[afterSlashes] === "r" || text[afterSlashes] === "n")) {
162
+ return i;
163
+ }
164
+ if (slashCount % 2 === 1) afterSlashes++;
165
+ i = afterSlashes - 1;
166
+ continue;
167
+ }
168
+ if (char === '"') {
169
+ let next = i + 1;
170
+ while (next < text.length && /\s/.test(text[next])) next++;
171
+ if (next === text.length || text[next] === "," || text[next] === "}" || text[next] === "]") {
172
+ return i;
173
+ }
174
+ }
175
+ }
176
+ return text.length;
177
+ }
178
+ function isSerializedJsonContainer(text) {
179
+ const trimmed = text.trim();
180
+ if (trimmed[0] !== "{" && trimmed[0] !== "[") return false;
181
+ try {
182
+ const parsed = JSON.parse(trimmed);
183
+ return typeof parsed === "object" && parsed !== null;
184
+ } catch {
185
+ return false;
186
+ }
187
+ }
188
+ function maskNestedJsonStringValues(text, depth) {
189
+ let out = "";
190
+ let copied = 0;
191
+ for (let i = 0; i < text.length; i++) {
192
+ if (text[i] !== '"') continue;
193
+ const contentStart = i + 1;
194
+ const end = valueEnd(text, contentStart, isJsonValueEnd);
195
+ if (end === text.length) break;
196
+ let next = end + 1;
197
+ while (next < text.length && /\s/.test(text[next])) next++;
198
+ if (text[next] === ":") {
199
+ i = end;
200
+ continue;
201
+ }
202
+ const encoded = text.slice(contentStart, end);
203
+ let decoded;
204
+ try {
205
+ decoded = JSON.parse(`"${encoded}"`);
206
+ } catch {
207
+ i = end;
208
+ continue;
209
+ }
210
+ const masked = depth >= MAX_NESTED_JSON_STRING_DEPTH && isSerializedJsonContainer(decoded) ? "[REDACTED]" : maskSecretsInMessageAtDepth(decoded, depth + 1);
211
+ if (masked !== decoded) {
212
+ const reencoded = JSON.stringify(masked).slice(1, -1);
213
+ out += text.slice(copied, contentStart) + reencoded;
214
+ copied = end;
215
+ }
216
+ i = end;
217
+ }
218
+ return out + text.slice(copied);
219
+ }
220
+ function maskSecretsInMessageAtDepth(text, depth) {
221
+ let out = maskJwts(text);
49
222
  for (const [pattern, replacement] of SHAPE_PATTERNS) out = out.replace(pattern, replacement);
50
- out = maskCredentialValues(out, JSON_KEY_RE, isJsonValueEnd);
51
- out = maskCredentialValues(out, QUERY_KEY_RE, isQueryValueEnd);
223
+ out = out.replace(BASIC_CREDENTIAL_RE, maskBasicCredential);
224
+ out = maskJsonCredentialValues(out);
225
+ if (depth <= MAX_NESTED_JSON_STRING_DEPTH) out = maskNestedJsonStringValues(out, depth);
226
+ out = maskCredentialValues(out, QUERY_KEY_RE, queryValueEnd);
227
+ out = maskCredentialValues(out, HEADER_KEY_RE, headerValueEnd);
52
228
  return out.replace(BASE64_RE, maskBase64);
53
229
  }
54
- var CREDENTIAL_KEY_RE, FULLY_MASKED_VALUE_RE, isCredentialKey, SHAPE_PATTERNS, JSON_KEY_RE, isJsonValueEnd, QUERY_KEY_RE, isQueryValueEnd, BASE64_RE, maskBase64;
230
+ function maskSecretsInMessage(text) {
231
+ return maskSecretsInMessageAtDepth(text, 0);
232
+ }
233
+ var CREDENTIAL_KEY_RE, NUMERIC_CREDENTIAL_KEY_RE, FULLY_MASKED_VALUE_RE, isCredentialKey, isBase64UrlChar, SHAPE_PATTERNS, BASIC_CREDENTIAL_RE, maskBasicCredential, JSON_KEY_RE, isJsonValueEnd, QUERY_KEY_RE, isQueryValueEnd, queryValueEnd, HEADER_KEY_RE, BASE64_RE, maskBase64, MAX_NESTED_JSON_STRING_DEPTH;
55
234
  var init_mask_secrets = __esm({
56
235
  "src/lib/mask-secrets.ts"() {
57
236
  "use strict";
58
237
  CREDENTIAL_KEY_RE = /token|secret|credential|password|passwd|api[_-]?key|authorization|private[_-]?key|session[_-]?id|cookie|jwt/i;
59
- FULLY_MASKED_VALUE_RE = /^(?:Bearer\s+)?(?:way_|wst_)?\[REDACTED(?:_JWT|_BASE64)?\]$/;
238
+ NUMERIC_CREDENTIAL_KEY_RE = /(?:password|passwd|pin|token|secret|credential|api[_-]?key|authorization|private[_-]?key|session[_-]?id|cookie|jwt)$/i;
239
+ FULLY_MASKED_VALUE_RE = /^(?:(?:Bearer|Basic)\s+)?(?:way_|wst_)?\[REDACTED(?:_JWT|_BASE64)?\]$/;
60
240
  isCredentialKey = (key) => CREDENTIAL_KEY_RE.test(key);
241
+ isBase64UrlChar = (char) => {
242
+ const code = char.charCodeAt(0);
243
+ return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || char === "-" || char === "_";
244
+ };
61
245
  SHAPE_PATTERNS = [
62
- // JWTs (header.payload.signature) — WorkOS access/refresh tokens, OAuth JWTs.
63
- // Run first so a `Bearer <jwt>` collapses to the JWT placeholder.
64
- //
65
- // Deliberately NOT anchored with the lookbehind the base64 rule uses. It would
66
- // make this linear (this rule is quadratic on a pathological `eyJeyJeyJ…` run),
67
- // but it also NARROWS masking: `refresh-<jwt>` and `way_<jwt>` would stop
68
- // matching and leak the token whole. Correctness of a redaction rule outranks
69
- // its worst case on a body that has to be adversarial to hurt.
70
- [/eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g, "[REDACTED_JWT]"],
71
246
  // way_ scoped API tokens (keyring/CI credentials). Leading \b avoids
72
247
  // over-redacting benign substrings (e.g. `gateway_config`); the charset is
73
248
  // base64url (no `.`) so a trailing sentence period stays outside the match.
74
249
  [/\bway_[A-Za-z0-9_-]{8,}/g, "way_[REDACTED]"],
75
250
  // wst_ single-use WebSocket tickets (same opaque base64url format).
76
251
  [/\bwst_[A-Za-z0-9_-]{8,}/g, "wst_[REDACTED]"],
77
- // Authorization: Bearer <opaque token> (anything not already masked above).
252
+ // Stripe API keys and webhook signing secrets. Keep this aligned with
253
+ // packages/core/src/redact.ts; both modules protect observability sinks.
254
+ [
255
+ /(^|[^A-Za-z0-9])(?:(?:sk|pk|rk)_(?:live|test)_[A-Za-z0-9]{8,}|whsec_[A-Za-z0-9]{8,})/g,
256
+ "$1[REDACTED]"
257
+ ],
258
+ // LLM provider API keys. The captured delimiter is deliberate: `_` may
259
+ // legitimately precede a key, while a letter/digit means the prefix is part
260
+ // of an ordinary identifier (for example `task-...` or `maxai-...`).
261
+ [
262
+ /(^|[^A-Za-z0-9])(?:sk-[A-Za-z0-9_-]{16,}|AIza[A-Za-z0-9_-]{16,}|xai-[A-Za-z0-9_-]{16,})/g,
263
+ "$1[REDACTED]"
264
+ ],
265
+ // Opaque Bearer credentials retain a precision floor. Basic credentials use
266
+ // the validated pass below because a single base64 quad such as `YTpi` is
267
+ // usable, but matching every four-letter word after "Basic" would destroy
268
+ // benign prose.
78
269
  [/(Bearer\s+)[A-Za-z0-9._~+/=-]{8,}/gi, "$1[REDACTED]"]
79
270
  ];
80
- JSON_KEY_RE = /"([A-Za-z0-9_.-]+)"\s*:\s*"/g;
271
+ BASIC_CREDENTIAL_RE = /(Basic\s+)([A-Za-z0-9+/]{4,}={0,2})(?![A-Za-z0-9+/=])/gi;
272
+ maskBasicCredential = (match, prefix, encoded) => {
273
+ try {
274
+ const padded = encoded + "=".repeat((4 - encoded.length % 4) % 4);
275
+ return atob(padded).includes(":") ? `${prefix}[REDACTED]` : match;
276
+ } catch {
277
+ return match;
278
+ }
279
+ };
280
+ JSON_KEY_RE = /"([A-Za-z0-9_.-]+)"\s*:\s*/g;
81
281
  isJsonValueEnd = (char) => char === '"';
82
282
  QUERY_KEY_RE = /(?:^|[?#&;,\s"'])([A-Za-z0-9_.-]+)=/g;
83
283
  isQueryValueEnd = (char) => char === "&" || char === ";" || char === '"' || /\s/.test(char);
284
+ queryValueEnd = (text, from) => valueEnd(text, from, isQueryValueEnd);
285
+ HEADER_KEY_RE = /(?:^|[^A-Za-z0-9_.\/\\-])([A-Za-z0-9_.-]+):[ \t]*/g;
84
286
  BASE64_RE = // Padded base64 bodies (wrapped DEKs, HMAC secrets, service-account material)
85
287
  // appearing outside any credential-named key — the shape the rules above miss.
86
288
  //
@@ -113,6 +315,7 @@ var init_mask_secrets = __esm({
113
315
  // {22,} + 1-2 pad chars => a 24-char floor, i.e. a 16-byte secret.
114
316
  /(?<![A-Za-z0-9+/])(?<![?&])[A-Za-z0-9+/]{22,}={1,2}(?![A-Za-z0-9+/=])/g;
115
317
  maskBase64 = (match) => match.length % 4 === 0 ? "[REDACTED_BASE64]" : match;
318
+ MAX_NESTED_JSON_STRING_DEPTH = 10;
116
319
  }
117
320
  });
118
321
 
@@ -5568,7 +5771,7 @@ function findStepBoundaries(transcript) {
5568
5771
  }
5569
5772
  return out;
5570
5773
  }
5571
- var UUID_RE, HEX_RE, WORKOS_ID_RE, OPAQUE_SECRET_RE, BASE64_SECRET_RE, BASE64_MARKER_RE, TOKEN_RE, SENSITIVE_FIELDS, SENSITIVE_KEY_ALTERNATION, SENSITIVE_KEY_PATTERN, JSON_CREDENTIAL_RE, QUERY_CREDENTIAL_RE, REDACTED, PROVIDER_TOKEN_RE, APP_ERROR_BRAND, AppError, LLM_RATE_LIMIT_BRAND, LlmRateLimitError, LLM_PROVIDER_HTTP_BRAND, LlmProviderHttpError, LLM_PROVIDER_TIMEOUT_BRAND, LlmProviderTimeoutError, ExternalServiceError, CHANNEL_PROVIDER_HTTP_BRAND, ChannelProviderHttpError, MEDIA_PROVIDER_HTTP_BRAND, MediaProviderHttpError, AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, uuidSchema, paginationSchema, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, SUMMARIZATION_THRESHOLD_MIN, SUMMARIZATION_THRESHOLD_MAX, summarizationThresholdField, monitorConfigField, agentIdParam, listAgentsQuery, agentConnectionsQuery, createAgentBody, updateAgentBody, AGENT_PARAMETER_TYPES, AGENT_PARAMETER_NAME_REGEX, agentParameterCreateSchema, MAX_AGENT_PARAMETERS_PER_REQUEST, createAgentParametersBody, SLUG_REGEX, slugSchema, INVISIBLE_NAME_CHARS, MAX_KANBAN_STATUSES, MAX_FOLLOWUPS_PER_STATUS, MAX_LANES, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES, RESERVED_TEMPLATE_DUMP_NAME, kanbanStatusSlugSchema, followupSchema, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, laneSchema, lanesArraySchema, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, previewLabelField, createHubBody, updateHubBody, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery, PLACEHOLDER_TOKENS, ALLOWED_TYPES, SUBSCHEMA_OBJECT_KEYWORDS, SUBSCHEMA_LIST_KEYWORDS, SUBSCHEMA_MAP_KEYWORDS, MAX_SCHEMA_DEPTH, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody, variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody, orgTagIdParam, listOrgTagsQuery, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody, resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery, navItemSchema, hubCountResetBody, navItemCountResetBody, typingBody, analyticsHubIdParam, analyticsVariableIdParam, updateVariablePinBody, updateAnalyticsViewBody, NUMERIC_FILTER_OPS, TEXT_FILTER_OPS, CATEGORICAL_FILTER_OPS, VARIABLE_FILTER_OPS, STRUCTURED_QUERY_OPS, STRUCTURED_QUERY_AGGREGATIONS, filterValueSchema, conversationsBody, analyticsConversationIdParam, messagesQuery, conversationDetailDataQuery, analyticsDataBody, structuredQueryBody, analyticsSqlBody, analyticsSqlSchemaQuery, EVAL_PACING_PRESET_NAMES, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS, paginationSchema2, evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, createEvalBody, updateEvalBody, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, fixtureField, createJourneyBody, updateJourneyBody, getConversationsQuery, getMessagesQuery, appMessageSenderType, appMessageReceiverType, appMessageBody, updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, activityQuery, deletionModeSchema, deletionRequestBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, sendMessageBody, listConversationsQuery, getConversationDetailParams, getConversationDetailQuery, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody, billingOrgIdParam, subscriptionItemParams, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, updateBillingCurrencyBody, invoicesQuery, downloadBody, uploadQuery, signUrlBody, outboundSchemaQuery, templateIdParam, listTemplatesQuery, deleteTemplateQuery, templateStatusQuery, createTemplateBody, updateTemplateBody, submitTemplateBody, testTemplateBody, contactIdParam, listContactsQuery, createContactBody, updateContactBody, listIdParam, listListsQuery, listListContactsQuery, createListBody, updateListBody, addListContactsBody, removeListContactsBody, scheduleIdParam, listSchedulesQuery, listExecutionsQuery, createScheduleBody, updateScheduleBody, uuidPattern, ciUuidSchema, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, adminPlanIdParam, adminHubIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, updatePlatformConfigBody, updateFreeOrgLimitBody, adminSetOrgHarnessBody, adminSetHubHarnessBody, adminScopedTargetBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysQuery, dataExplorerKvKeyParam, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteQuery, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, dataExplorerDebugDoType, DEBUG_READ_MAX_LIMIT, DEBUG_READ_DEFAULT_LIMIT, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, debugHubConvParam, debugMessageIdQuery, sandboxEgressPolicy, SANDBOX_EXEC_MAX_CMD_LENGTH, SANDBOX_EXEC_MAX_ALLOWLIST, SANDBOX_EXEC_MAX_TIMEOUT_MS, adminSandboxExecBody, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, browserParams, browserFoldersQuery, browserFilesQuery, stateOperationBody, conversationListResourcesQuery, conversationReadResourceQuery, listPendingSchedulesQuery, listHubAggregateSchedulesQuery, reportSourceSchema, intakeReportSourceSchema, reportClassificationSchema, reportStatusSchema, reportLocaleSchema, reportMessageAuthorRoleSchema, sentryRefStatusSchema, createReportBody, editReportBody, contestReportBody, reporterListQuery, listReportsQuery, GITHUB_ISSUE_URL_REGEX, githubIssueUrlSchema, transitionReportBody, groupReportsBody, holdReportBody, clickhouseReadyResponse, bootstrapQuery, requestSnapshotChunkMessage, MAX_NAME_LENGTH, MAX_VALUE_LENGTH, MAX_TAGS, MAX_TAG_LENGTH, MAX_SCOPE_HUBS, MAX_SCOPE_TAGS, vaultSecretScopeSchema, vaultCreateBody, vaultUpdateBody, PERMISSIONS, MAX_NAME_LENGTH2, MAX_HUBS_PER_GRANT, MAX_HUB_TAGS_PER_GRANT, MAX_GRANTS, permissionEnum, grantScopeSchema, grantSchema, createTokenBody, tokenOrgIdParam, tokenGrantScopeSchema, tokenGrantSchema, tokenMetadataSchema, listTokensResponse, createTokenResponse, orgTokenSummarySchema, listOrgTokensResponse, invitePreviewQuery, invitePreviewResponse, discordTier, discordBillingCycle, discordMetadata, discordOAuthStartResponse, discordOAuthFinalizeBody, discordOAuthFinalizeResponse, discordDisconnectResponse, jsonSchemaSchema, hubUserIdentity, stateValueEntry, getHubUserContextResponse, updateHubUserBody, updateHubUserResponse, unlockHubUserNameResponse, stateResetParams, stateResetResponse, hubAlertsParam, hubAlertSeverity, hubAlert, hubAlertsListResponse, noticeSeveritySchema, noticeStatusSchema, NOTICE_SCOPE_REGEX, noticeScopeSchema, noticeLinkSchema, createNoticeBody, updateNoticeBody, listNoticesQuery, noticeIdParamSchema, templateLocaleSchema, TEMPLATE_SLUG_REGEX, templateSlugSchema, templateStatusSchema, templateFileMapSchema, templateTextSchema, templateUsesEntrySchema, templateUsesSchema, templateYamlLocaleEntry, templateYamlWayaiBlock, templateTagsSchema, templateYamlSchema, templateHeroSchema, templatePushLocaleSchema, templatePushBody, templateListQuery, templateSlugParam, templateDetailQuery, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam, WAYAI_WORKSPACE_LAYOUT, MAX_RESOURCE_FILE_SIZE;
5774
+ var UUID_RE, HEX_RE, WORKOS_ID_RE, OPAQUE_SECRET_RE, BASE64_SECRET_RE, BASE64_MARKER_RE, TOKEN_RE, SENSITIVE_FIELDS, SENSITIVE_KEY_ALTERNATION, SENSITIVE_KEY_PATTERN, JSON_CREDENTIAL_RE, QUERY_CREDENTIAL_RE, REDACTED, PROVIDER_TOKEN_RE, APP_ERROR_BRAND, AppError, LLM_RATE_LIMIT_BRAND, LlmRateLimitError, LLM_PROVIDER_HTTP_BRAND, LlmProviderHttpError, LLM_PROVIDER_CONTENT_BRAND, LlmProviderContentError, LLM_PROVIDER_TIMEOUT_BRAND, LlmProviderTimeoutError, ExternalServiceError, CHANNEL_PROVIDER_HTTP_BRAND, ChannelProviderHttpError, MEDIA_PROVIDER_HTTP_BRAND, MediaProviderHttpError, AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, uuidSchema, paginationSchema, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, SUMMARIZATION_THRESHOLD_MIN, SUMMARIZATION_THRESHOLD_MAX, summarizationThresholdField, monitorConfigField, agentIdParam, listAgentsQuery, agentConnectionsQuery, createAgentBody, updateAgentBody, AGENT_PARAMETER_TYPES, AGENT_PARAMETER_NAME_REGEX, agentParameterCreateSchema, MAX_AGENT_PARAMETERS_PER_REQUEST, createAgentParametersBody, SLUG_REGEX, slugSchema, INVISIBLE_NAME_CHARS, MAX_KANBAN_STATUSES, MAX_FOLLOWUPS_PER_STATUS, MAX_LANES, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES, RESERVED_TEMPLATE_DUMP_NAME, kanbanStatusSlugSchema, followupSchema, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, laneSchema, lanesArraySchema, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, previewLabelField, createHubBody, updateHubBody, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery, PLACEHOLDER_TOKENS, ALLOWED_TYPES, SUBSCHEMA_OBJECT_KEYWORDS, SUBSCHEMA_LIST_KEYWORDS, SUBSCHEMA_MAP_KEYWORDS, MAX_SCHEMA_DEPTH, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody, variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody, orgTagIdParam, listOrgTagsQuery, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody, resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery, navItemSchema, hubCountResetBody, navItemCountResetBody, typingBody, analyticsHubIdParam, analyticsVariableIdParam, updateVariablePinBody, updateAnalyticsViewBody, NUMERIC_FILTER_OPS, TEXT_FILTER_OPS, CATEGORICAL_FILTER_OPS, VARIABLE_FILTER_OPS, STRUCTURED_QUERY_OPS, STRUCTURED_QUERY_AGGREGATIONS, filterValueSchema, conversationsBody, analyticsConversationIdParam, messagesQuery, conversationDetailDataQuery, analyticsDataBody, structuredQueryBody, analyticsSqlBody, analyticsSqlSchemaQuery, EVAL_PACING_PRESET_NAMES, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS, paginationSchema2, evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, createEvalBody, updateEvalBody, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, fixtureField, createJourneyBody, updateJourneyBody, getConversationsQuery, getMessagesQuery, appMessageSenderType, appMessageReceiverType, appMessageBody, updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, activityQuery, deletionModeSchema, deletionRequestBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, sendMessageBody, listConversationsQuery, getConversationDetailParams, getConversationDetailQuery, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody, billingOrgIdParam, subscriptionItemParams, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, updateBillingCurrencyBody, invoicesQuery, downloadBody, uploadQuery, signUrlBody, outboundSchemaQuery, templateIdParam, listTemplatesQuery, deleteTemplateQuery, templateStatusQuery, createTemplateBody, updateTemplateBody, submitTemplateBody, testTemplateBody, contactIdParam, listContactsQuery, createContactBody, updateContactBody, listIdParam, listListsQuery, listListContactsQuery, createListBody, updateListBody, addListContactsBody, removeListContactsBody, scheduleIdParam, listSchedulesQuery, listExecutionsQuery, createScheduleBody, updateScheduleBody, uuidPattern, ciUuidSchema, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, adminPlanIdParam, adminHubIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, updatePlatformConfigBody, updateFreeOrgLimitBody, adminSetOrgHarnessBody, adminSetHubHarnessBody, adminScopedTargetBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysQuery, dataExplorerKvKeyParam, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteQuery, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, dataExplorerDebugDoType, DEBUG_READ_MAX_LIMIT, DEBUG_READ_DEFAULT_LIMIT, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, debugHubConvParam, debugMessageIdQuery, sandboxEgressPolicy, SANDBOX_EXEC_MAX_CMD_LENGTH, SANDBOX_EXEC_MAX_ALLOWLIST, SANDBOX_EXEC_MAX_TIMEOUT_MS, adminSandboxExecBody, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, browserParams, browserFoldersQuery, browserFilesQuery, stateOperationBody, conversationListResourcesQuery, conversationReadResourceQuery, listPendingSchedulesQuery, listHubAggregateSchedulesQuery, reportSourceSchema, intakeReportSourceSchema, reportClassificationSchema, reportStatusSchema, reportLocaleSchema, reportMessageAuthorRoleSchema, sentryRefStatusSchema, createReportBody, editReportBody, contestReportBody, reporterListQuery, listReportsQuery, GITHUB_ISSUE_URL_REGEX, githubIssueUrlSchema, transitionReportBody, groupReportsBody, holdReportBody, clickhouseReadyResponse, bootstrapQuery, requestSnapshotChunkMessage, MAX_NAME_LENGTH, MAX_VALUE_LENGTH, MAX_TAGS, MAX_TAG_LENGTH, MAX_SCOPE_HUBS, MAX_SCOPE_TAGS, vaultSecretScopeSchema, vaultCreateBody, vaultUpdateBody, PERMISSIONS, MAX_NAME_LENGTH2, MAX_HUBS_PER_GRANT, MAX_HUB_TAGS_PER_GRANT, MAX_GRANTS, permissionEnum, grantScopeSchema, grantSchema, createTokenBody, tokenOrgIdParam, tokenGrantScopeSchema, tokenGrantSchema, tokenMetadataSchema, listTokensResponse, createTokenResponse, orgTokenSummarySchema, listOrgTokensResponse, invitePreviewQuery, invitePreviewResponse, discordTier, discordBillingCycle, discordMetadata, discordOAuthStartResponse, discordOAuthFinalizeBody, discordOAuthFinalizeResponse, discordDisconnectResponse, jsonSchemaSchema, hubUserIdentity, stateValueEntry, getHubUserContextResponse, updateHubUserBody, updateHubUserResponse, unlockHubUserNameResponse, stateResetParams, stateResetResponse, hubAlertsParam, hubAlertSeverity, hubAlert, hubAlertsListResponse, noticeSeveritySchema, noticeStatusSchema, NOTICE_SCOPE_REGEX, noticeScopeSchema, noticeLinkSchema, createNoticeBody, updateNoticeBody, listNoticesQuery, noticeIdParamSchema, templateLocaleSchema, TEMPLATE_SLUG_REGEX, templateSlugSchema, templateStatusSchema, templateFileMapSchema, templateTextSchema, templateUsesEntrySchema, templateUsesSchema, templateYamlLocaleEntry, templateYamlWayaiBlock, templateTagsSchema, templateYamlSchema, templateHeroSchema, templatePushLocaleSchema, templatePushBody, templateListQuery, templateSlugParam, templateDetailQuery, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam, WAYAI_WORKSPACE_LAYOUT, MAX_RESOURCE_FILE_SIZE;
5572
5775
  var init_dist = __esm({
5573
5776
  "../../packages/core/dist/index.js"() {
5574
5777
  "use strict";
@@ -5721,6 +5924,16 @@ var init_dist = __esm({
5721
5924
  }
5722
5925
  [LLM_PROVIDER_HTTP_BRAND] = true;
5723
5926
  };
5927
+ LLM_PROVIDER_CONTENT_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmProviderContentError");
5928
+ LlmProviderContentError = class extends Error {
5929
+ constructor(message, provider, providerError) {
5930
+ super(redactSecrets(message));
5931
+ this.provider = provider;
5932
+ this.providerError = providerError;
5933
+ this.name = "LlmProviderContentError";
5934
+ }
5935
+ [LLM_PROVIDER_CONTENT_BRAND] = true;
5936
+ };
5724
5937
  LLM_PROVIDER_TIMEOUT_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmProviderTimeoutError");
5725
5938
  LlmProviderTimeoutError = class extends Error {
5726
5939
  constructor(message, provider) {