@wayai/cli 0.3.176 → 0.3.178

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
@@ -6022,7 +6022,31 @@ function refineHubAsCodeMonitorRulesOutput(config, ctx) {
6022
6022
  }
6023
6023
  });
6024
6024
  }
6025
- var uuidSchema, paginationSchema, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, MAX_AUDIO_FILE_BASE64_BYTES, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, SUMMARIZATION_THRESHOLD_MIN, SUMMARIZATION_THRESHOLD_MAX, PREVIOUS_CONVERSATIONS_MAX, FLAG_CONDITION_OPERATORS, CONFIDENCE_VARIABLE_SUFFIX, DECISION_SCORE_MIN_LEVELS, DECISION_SCORE_MAX_LEVELS, DECISIONS_MODEL_PREFIXES, DECISION_CAPABLE_AGENT_ROLES, NATIVE_TOOL_SCHEMAS, WAYAI_CONNECTOR, BASE_NATIVE_TOOLS, NATIVE_TOOLS, CATALOG_SIDE_EFFECTS, NATIVE_TOOL_NAMES, previousConversationsCountField, summarizationThresholdField, flagConditionSchema, MONITOR_TRIGGERS, monitorTriggerSchema, MONITOR_FIRING_TRIGGERS, MONITOR_DELAY_SECONDS_MIN, MONITOR_IDLE_DELAY_REQUIRED_MESSAGE, MONITOR_HISTORY_MESSAGES_MAX, monitorHistoryMessagesSchema, monitorIncludeToolResultsSchema, MONITOR_INPUT_SHAPING_KEYS, MONITOR_INPUT_SHAPING_SCHEMAS, MONITOR_INPUT_SHAPING_IDLE_MESSAGE, monitorArgumentSourceSchema, MONITOR_NOTE_TEMPLATE_MAX, MONITOR_STEER_NOTE_MAX, monitorActionSchema, monitorRuleSchema, MONITOR_RULE_KEYS, MONITOR_RULE_SCHEMAS, MONITOR_RULE_TRIGGERS, MONITOR_RULE_TRIGGER_MESSAGE, CALL_UTTERANCE_SPEAKERS, callUtteranceSpeakerSchema, MONITOR_CALL_KEYS, MONITOR_CALL_SCHEMAS, MONITOR_CALL_KEY_MESSAGE, CALL_STEERING_MIN_CONFIDENCE, CALL_UTTERANCE_RULE_NOT_CONFIDENT_MESSAGE, CALL_UTTERANCE_FALLBACK_MESSAGE, CALL_UTTERANCE_FLAG_CONDITIONS_MESSAGE, CALL_STEER_NOTE_BLANK_MESSAGE, MONITOR_USER_MESSAGE_ACTION_KINDS, MONITOR_ASSISTANT_REPLY_ACTION_KINDS, MONITOR_CALL_UTTERANCE_ACTION_KINDS, INSERT_NOTE_TOOL_NAME, RUN_MONITOR_TOOL_NAME, MONITOR_RULE_ALLOWED_NATIVE_TOOLS, MONITOR_RULE_REENTRY_TOOLS, MONITOR_RULE_REENTRY_TRACKS, monitorConfigField, flagConditionsField, 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, followupTypeSchema, EVENT_RELATIVE_FOLLOWUP_TYPES, followupTimeUnitSchema, followupIdSchema, SELECTABLE_FOLLOWUP_TYPES, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS, followupSchema, MAX_OUTCOMES_PER_STATUS, kanbanOutcomeSchema, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, laneSchema, lanesArraySchema, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, MAX_EVAL_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, CONTEXT_BOUNDARIES, contextBoundarySchema, 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, ORG_TAG_NAME_REGEX, ORG_TAG_NAME_MAX_LENGTH, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, BASE_CREDENTIAL_MANAGED_BY, BASE_CREDENTIAL_NAME_MAX, baseCredentialNameSchema, createBaseCredentialLinkBody, baseCredentialLinkParams, baseCredentialLinkQuery, 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, analyticsSqlTable, analyticsSqlSchemaQuery, EVAL_PACING_PRESET_NAMES, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_MAX_RUNS_PER_SCENARIO, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS, ISO_UTC_RE, paginationSchema2, evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, evalDateContextSchema, EVAL_FIXTURE_NAME_MAX_LENGTH, evalFixtureOverrideSchema, runSessionQuery, runJourneyQuery, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, EVAL_INITIAL_STATE_SCOPES, MAX_INITIAL_STATE_ENTRIES, evalInitialStateEntry, evalBody, EVAL_LIST_MAX_LIMIT, evalListLimit, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, EVAL_MAX_SELECTED_SCENARIOS, evalScenarioSelectionEntrySchema, evalScenarioSelectionSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, EVAL_ATTACHMENT_HASH_REGEX, evalAttachmentRef, turnMayCarryAttachments, ATTACHMENTS_USER_ONLY_MESSAGE, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, fixtureField, createJourneyBody, updateJourneyBody, evalSessionConfigResponseSchema, evalSessionResponseSchema, evalSessionListConfigSchema, evalSessionListItemSchema, seedReleaseStatusSchema, EVAL_SESSION_NOT_QUIESCENT, getConversationsQuery, getMessagesQuery, appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse, CALL_STATUSES, callStatus, CALL_END_REASONS, callEndReason, CALL_TRANSPORTS, callTransport, CALL_PARTICIPANT_TYPES, callParticipantType, callInstant, MAX_SDP_OFFER_LENGTH, sdpDescription, sdpOffer, MAX_CALL_REQUEST_BODY_BYTES, hubScoped, callSummaryFields, callSummary, callIdParam, createCallBody, createCallResponse, callReadyBody, callHangupBody, callStatusQuery, MAX_REPORTED_DELEGATION_IDS, callDelegationId, callDelegationsBody, callResponse, MAX_CALL_RECORDING_GAPS, callRecordingGap, callRecordingNoteMetadata, CALL_OPENING_LANGUAGES, callOpeningLanguage, CALL_OPENING_MAX_DURATION_MS, CALL_OPENING_MAX_BYTES, CALL_OPENING_CAPTION_MAX_CHARS, CALL_OPENING_CONTENT_TYPES, callOpeningContentType, CALL_OPENING_HASH_REGEX, callOpeningHash, callOpeningCaption, storedCallOpening, MAX_CALL_OPENING_ENCODED_BYTES, MAX_CALL_OPENING_BODY_BYTES, agentCallOpeningParams, putAgentCallOpeningBody, deleteAgentCallOpeningQuery, callOpeningParam, callOpeningQuery, TTS_VOICE_REPLY_ENABLED_FIELD, COPILOT_TRIGGER_FIELD, AUDIO_LANGUAGE_OPTIONS, whatsapp, instagram, resend, telegram, API_CHANNEL_DELIVERY_EVENTS, apiChannel, OPENAI_REASONING_MODELS, openai, anthropic, googleAiStudio, openRouter, xai, groqStt, openaiStt, elevenLabsStt, openaiTts, groqTts, elevenLabsTts, GEMINI_TTS_VOICES, googleTts, wayai, externalResources, restApiTool, mcpServer, e2b, CLAUDE_HARNESS_MODELS, CLAUDE_HARNESS_MODEL_OPTIONS, HARNESS_MCP_SERVERS_FIELD, HARNESS_EGRESS_FIELDS, claudeAgentSdk, claudeManagedAgents, rekorMemory, SPOKEN_LINE_MAX_CHARS, gptLive, CONNECTORS, evalCallInstant, EVAL_CALL_MIN_SECONDS, EVAL_CALL_MAX_SECONDS, EVAL_CALL_SPOKEN_LINE_MAX_CHARS, hubScoped2, createEvalCallBody, createEvalCallResponse, evalCallConversationQuery, evalCallRecordQuery, evalCallSpeaker, evalCallUtterance, evalCallTurn, evalCallRecording, evalCallRecordResponse, evalCallFinishResponse, updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, activityQuery, deletionModeSchema, deletionRequestBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, deleteUserConversationsResponse, sendMessageBody, listConversationsQuery, flagSourceSchema, getConversationsResponse, getConversationDetailParams, getConversationDetailQuery, getConversationDetailResponse, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody, copilotSuggestBody, copilotSuggestResponse, CONSULT_THREAD_STATUSES, consultThreadStatus, CONSULT_THREAD_TITLE_MAX, consultThreadTitle, consultThreadSummary, listConsultThreadsQuery, listConsultThreadsResponse, createConsultThreadBody, createConsultThreadResponse, consultThreadIdParam, updateConsultThreadBody, updateConsultThreadResponse, CONSULT_AWAIT_TIMEOUT_MS, billingOrgIdParam, subscriptionItemParams, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, updateBillingCurrencyBody, invoicesQuery, planKeySchema, billingStatusSchema, billingPlanTypeSchema, dataUsageCountersSchema, REKOR_ENTITLEMENT_CONTRACT_VERSION, entitlementProjectionSchema, rekorEntitlementRefreshMessageSchema, 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, MAX_RESOURCE_FILE_SIZE, MAX_10MB_BASE64_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_CARRIERS, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES, MAX_RESOURCE_ENCODED_BYTES, MAX_HUB_AS_CODE_RESOURCES, MAX_HUB_AS_CODE_RESOURCE_FILES, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES, MAX_CI_CONFIG_BODY_BYTES, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, boundedHubAsCodeResourcesSchema, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetBody, adminRepairLegacyOrgGrantsBody, adminRepairCompedPlansBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, 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, META_ENTITY_ID_PATTERN, metaEntityId, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, passwordLoginBody, browserParams, browserFoldersQuery, browserFilesQuery, stateOperationBody, conversationListResourcesQuery, conversationReadResourceQuery, listPendingSchedulesQuery, listHubAggregateSchedulesQuery, reportSourceSchema, intakeReportSourceSchema, reportClassificationSchema, reportStatusSchema, reportLocaleSchema, reportMessageAuthorRoleSchema, reportMessageSchema, sentryRefStatusSchema, createReportBody, editReportBody, reporterReportSummarySchema, reporterListResponseSchema, getReportResponseSchema, reporterTransitionResponseSchema, 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, jsonSchemaSchema, hubUserIdentity, stateValueEntry, getHubUserContextResponse, updateHubUserBody, updateHubUserResponse, unlockHubUserNameResponse, stateResetParams, stateResetResponse, hubAlertsParam, hubAlertSeverity, hubAlert, hubAlertsListResponse, noticeSeveritySchema, noticeStatusSchema, NOTICE_SCOPE_REGEX, noticeScopeSchema, noticeLinkSchema, createNoticeBody, updateNoticeBody, listNoticesQuery, noticeIdParamSchema, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam, REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, DATA_PROXY_MOUNT, DATA_PROXY_PREFIX, REKOR_V1_PREFIX, DATA_PROXY_ORG_QUERY_PARAM, MAX_PROVISIONING_BODY_BYTES, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS, BASE_DESTRUCTION_MOUNT, BASE_DESTRUCTION_PREFIX, BASE_DESTRUCTION_CONFIRM_PATH, baseDestructionConfirmBody, BASE_DESTRUCTION_GRACE_MS, BASE_DESTRUCTION_CONFIRM_TTL_MS, BASE_DESTRUCTION_ORG_QUERY_PARAM, baseDestructionQuery, baseDestructionParam, baseDestructionInitiateBody, baseDestructionStatus, baseDestructionRequest, baseDestructionListResponse, baseDestructionInitiateResponse, baseDestructionConfirmResponse, baseDestructionCancelResponse, rekorBaseChangeMessageSchema;
6025
+ function refineScopedTarget(data, ctx) {
6026
+ if (data.scope === "org") {
6027
+ if (!data.org_id) {
6028
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org requires org_id", path: ["org_id"] });
6029
+ }
6030
+ if (data.hub_id) {
6031
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org must not include hub_id", path: ["hub_id"] });
6032
+ }
6033
+ } else if (data.scope === "hub") {
6034
+ if (!data.hub_id) {
6035
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub requires hub_id", path: ["hub_id"] });
6036
+ }
6037
+ if (data.org_id) {
6038
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub must not include org_id", path: ["org_id"] });
6039
+ }
6040
+ } else {
6041
+ if (data.org_id) {
6042
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include org_id", path: ["org_id"] });
6043
+ }
6044
+ if (data.hub_id) {
6045
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include hub_id", path: ["hub_id"] });
6046
+ }
6047
+ }
6048
+ }
6049
+ var uuidSchema, paginationSchema, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, MAX_AUDIO_FILE_BASE64_BYTES, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, SUMMARIZATION_THRESHOLD_MIN, SUMMARIZATION_THRESHOLD_MAX, PREVIOUS_CONVERSATIONS_MAX, FLAG_CONDITION_OPERATORS, CONFIDENCE_VARIABLE_SUFFIX, DECISION_SCORE_MIN_LEVELS, DECISION_SCORE_MAX_LEVELS, DECISIONS_MODEL_PREFIXES, DECISION_CAPABLE_AGENT_ROLES, NATIVE_TOOL_SCHEMAS, WAYAI_CONNECTOR, BASE_NATIVE_TOOLS, NATIVE_TOOLS, CATALOG_SIDE_EFFECTS, NATIVE_TOOL_NAMES, previousConversationsCountField, summarizationThresholdField, flagConditionSchema, MONITOR_TRIGGERS, monitorTriggerSchema, MONITOR_FIRING_TRIGGERS, MONITOR_DELAY_SECONDS_MIN, MONITOR_IDLE_DELAY_REQUIRED_MESSAGE, MONITOR_HISTORY_MESSAGES_MAX, monitorHistoryMessagesSchema, monitorIncludeToolResultsSchema, MONITOR_INPUT_SHAPING_KEYS, MONITOR_INPUT_SHAPING_SCHEMAS, MONITOR_INPUT_SHAPING_IDLE_MESSAGE, monitorArgumentSourceSchema, MONITOR_NOTE_TEMPLATE_MAX, MONITOR_STEER_NOTE_MAX, monitorActionSchema, monitorRuleSchema, MONITOR_RULE_KEYS, MONITOR_RULE_SCHEMAS, MONITOR_RULE_TRIGGERS, MONITOR_RULE_TRIGGER_MESSAGE, CALL_UTTERANCE_SPEAKERS, callUtteranceSpeakerSchema, MONITOR_CALL_KEYS, MONITOR_CALL_SCHEMAS, MONITOR_CALL_KEY_MESSAGE, CALL_STEERING_MIN_CONFIDENCE, CALL_UTTERANCE_RULE_NOT_CONFIDENT_MESSAGE, CALL_UTTERANCE_FALLBACK_MESSAGE, CALL_UTTERANCE_FLAG_CONDITIONS_MESSAGE, CALL_STEER_NOTE_BLANK_MESSAGE, MONITOR_USER_MESSAGE_ACTION_KINDS, MONITOR_ASSISTANT_REPLY_ACTION_KINDS, MONITOR_CALL_UTTERANCE_ACTION_KINDS, INSERT_NOTE_TOOL_NAME, RUN_MONITOR_TOOL_NAME, MONITOR_RULE_ALLOWED_NATIVE_TOOLS, MONITOR_RULE_REENTRY_TOOLS, MONITOR_RULE_REENTRY_TRACKS, monitorConfigField, flagConditionsField, 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, followupTypeSchema, EVENT_RELATIVE_FOLLOWUP_TYPES, followupTimeUnitSchema, followupIdSchema, SELECTABLE_FOLLOWUP_TYPES, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS, followupSchema, MAX_OUTCOMES_PER_STATUS, kanbanOutcomeSchema, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, laneSchema, lanesArraySchema, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, MAX_EVAL_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, CONTEXT_BOUNDARIES, contextBoundarySchema, 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, ORG_TAG_NAME_REGEX, ORG_TAG_NAME_MAX_LENGTH, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, BASE_CREDENTIAL_MANAGED_BY, BASE_CREDENTIAL_NAME_MAX, baseCredentialNameSchema, createBaseCredentialLinkBody, baseCredentialLinkParams, baseCredentialLinkQuery, 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, analyticsSqlTable, analyticsSqlSchemaQuery, EVAL_PACING_PRESET_NAMES, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_MAX_RUNS_PER_SCENARIO, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS, ISO_UTC_RE, paginationSchema2, evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, evalDateContextSchema, EVAL_FIXTURE_NAME_MAX_LENGTH, evalFixtureOverrideSchema, runSessionQuery, runJourneyQuery, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, EVAL_INITIAL_STATE_SCOPES, MAX_INITIAL_STATE_ENTRIES, evalInitialStateEntry, evalBody, EVAL_LIST_MAX_LIMIT, evalListLimit, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, EVAL_MAX_SELECTED_SCENARIOS, evalScenarioSelectionEntrySchema, evalScenarioSelectionSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, EVAL_ATTACHMENT_HASH_REGEX, evalAttachmentRef, turnMayCarryAttachments, ATTACHMENTS_USER_ONLY_MESSAGE, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, fixtureField, createJourneyBody, updateJourneyBody, evalSessionConfigResponseSchema, evalSessionResponseSchema, evalSessionListConfigSchema, evalSessionListItemSchema, seedReleaseStatusSchema, EVAL_SESSION_NOT_QUIESCENT, getConversationsQuery, getMessagesQuery, appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse, CALL_STATUSES, callStatus, CALL_END_REASONS, callEndReason, CALL_TRANSPORTS, callTransport, CALL_PARTICIPANT_TYPES, callParticipantType, callInstant, MAX_SDP_OFFER_LENGTH, sdpDescription, sdpOffer, MAX_CALL_REQUEST_BODY_BYTES, hubScoped, callSummaryFields, callSummary, callIdParam, createCallBody, createCallResponse, callReadyBody, callHangupBody, callStatusQuery, MAX_REPORTED_DELEGATION_IDS, callDelegationId, callDelegationsBody, callResponse, MAX_CALL_RECORDING_GAPS, callRecordingGap, callRecordingNoteMetadata, CALL_OPENING_LANGUAGES, callOpeningLanguage, CALL_OPENING_MAX_DURATION_MS, CALL_OPENING_MAX_BYTES, CALL_OPENING_CAPTION_MAX_CHARS, CALL_OPENING_CONTENT_TYPES, callOpeningContentType, CALL_OPENING_HASH_REGEX, callOpeningHash, callOpeningCaption, storedCallOpening, MAX_CALL_OPENING_ENCODED_BYTES, MAX_CALL_OPENING_BODY_BYTES, agentCallOpeningParams, putAgentCallOpeningBody, deleteAgentCallOpeningQuery, callOpeningParam, callOpeningQuery, TTS_VOICE_REPLY_ENABLED_FIELD, COPILOT_TRIGGER_FIELD, AUDIO_LANGUAGE_OPTIONS, whatsapp, instagram, resend, telegram, API_CHANNEL_DELIVERY_EVENTS, apiChannel, OPENAI_REASONING_MODELS, openai, anthropic, googleAiStudio, openRouter, xai, groqStt, openaiStt, elevenLabsStt, openaiTts, groqTts, elevenLabsTts, GEMINI_TTS_VOICES, googleTts, wayai, externalResources, restApiTool, mcpServer, e2b, CLAUDE_HARNESS_MODELS, CLAUDE_HARNESS_MODEL_OPTIONS, HARNESS_MCP_SERVERS_FIELD, HARNESS_EGRESS_FIELDS, claudeAgentSdk, claudeManagedAgents, rekorMemory, SPOKEN_LINE_MAX_CHARS, gptLive, CONNECTORS, evalCallInstant, EVAL_CALL_MIN_SECONDS, EVAL_CALL_MAX_SECONDS, EVAL_CALL_SPOKEN_LINE_MAX_CHARS, hubScoped2, createEvalCallBody, createEvalCallResponse, evalCallConversationQuery, evalCallRecordQuery, evalCallSpeaker, evalCallUtterance, evalCallTurn, evalCallRecording, evalCallRecordResponse, evalCallFinishResponse, updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, activityQuery, deletionModeSchema, deletionRequestBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, deleteUserConversationsResponse, sendMessageBody, listConversationsQuery, flagSourceSchema, getConversationsResponse, getConversationDetailParams, getConversationDetailQuery, getConversationDetailResponse, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody, copilotSuggestBody, copilotSuggestResponse, CONSULT_THREAD_STATUSES, consultThreadStatus, CONSULT_THREAD_TITLE_MAX, consultThreadTitle, consultThreadSummary, listConsultThreadsQuery, listConsultThreadsResponse, createConsultThreadBody, createConsultThreadResponse, consultThreadIdParam, updateConsultThreadBody, updateConsultThreadResponse, CONSULT_AWAIT_TIMEOUT_MS, billingOrgIdParam, subscriptionItemParams, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, updateBillingCurrencyBody, invoicesQuery, planKeySchema, billingStatusSchema, billingPlanTypeSchema, dataUsageCountersSchema, REKOR_ENTITLEMENT_CONTRACT_VERSION, entitlementProjectionSchema, rekorEntitlementRefreshMessageSchema, 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, MAX_RESOURCE_FILE_SIZE, MAX_10MB_BASE64_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_CARRIERS, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES, MAX_RESOURCE_ENCODED_BYTES, MAX_HUB_AS_CODE_RESOURCES, MAX_HUB_AS_CODE_RESOURCE_FILES, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES, MAX_CI_CONFIG_BODY_BYTES, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, boundedHubAsCodeResourcesSchema, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetShape, adminScopedTargetBody, BRANCHING_ORPHAN_ENTITY_TYPES, BRANCHING_ORPHAN_MAX_TARGETS, adminRepairBranchingOrphansBody, adminRepairLegacyOrgGrantsBody, adminRepairCompedPlansBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, 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, META_ENTITY_ID_PATTERN, metaEntityId, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, passwordLoginBody, browserParams, browserFoldersQuery, browserFilesQuery, stateOperationBody, conversationListResourcesQuery, conversationReadResourceQuery, listPendingSchedulesQuery, listHubAggregateSchedulesQuery, reportSourceSchema, intakeReportSourceSchema, reportClassificationSchema, reportStatusSchema, reportLocaleSchema, reportMessageAuthorRoleSchema, reportMessageSchema, sentryRefStatusSchema, createReportBody, editReportBody, reporterReportSummarySchema, reporterListResponseSchema, getReportResponseSchema, reporterTransitionResponseSchema, 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, jsonSchemaSchema, hubUserIdentity, stateValueEntry, getHubUserContextResponse, updateHubUserBody, updateHubUserResponse, unlockHubUserNameResponse, stateResetParams, stateResetResponse, hubAlertsParam, hubAlertSeverity, hubAlert, hubAlertsListResponse, noticeSeveritySchema, noticeStatusSchema, NOTICE_SCOPE_REGEX, noticeScopeSchema, noticeLinkSchema, createNoticeBody, updateNoticeBody, listNoticesQuery, noticeIdParamSchema, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam, REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, DATA_PROXY_MOUNT, DATA_PROXY_PREFIX, REKOR_V1_PREFIX, DATA_PROXY_ORG_QUERY_PARAM, MAX_PROVISIONING_BODY_BYTES, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS, BASE_DESTRUCTION_MOUNT, BASE_DESTRUCTION_PREFIX, BASE_DESTRUCTION_CONFIRM_PATH, baseDestructionConfirmBody, BASE_DESTRUCTION_GRACE_MS, BASE_DESTRUCTION_CONFIRM_TTL_MS, BASE_DESTRUCTION_ORG_QUERY_PARAM, baseDestructionQuery, baseDestructionParam, baseDestructionInitiateBody, baseDestructionStatus, baseDestructionRequest, baseDestructionListResponse, baseDestructionInitiateResponse, baseDestructionConfirmResponse, baseDestructionCancelResponse, rekorBaseChangeMessageSchema;
6026
6050
  var init_contracts = __esm({
6027
6051
  "../../packages/core/dist/contracts/index.js"() {
6028
6052
  "use strict";
@@ -11175,33 +11199,39 @@ var init_contracts = __esm({
11175
11199
  updateFreeOrgLimitBody = external_exports.object({
11176
11200
  max_free_orgs_override: external_exports.number().int().min(0).nullable()
11177
11201
  });
11178
- adminScopedTargetBody = external_exports.object({
11202
+ adminScopedTargetShape = external_exports.object({
11179
11203
  scope: external_exports.enum(["all", "org", "hub"]),
11180
11204
  org_id: external_exports.string().uuid().optional(),
11181
11205
  hub_id: external_exports.string().optional(),
11182
11206
  dry_run: external_exports.boolean().optional().default(false)
11207
+ });
11208
+ adminScopedTargetBody = adminScopedTargetShape.strict().superRefine(refineScopedTarget);
11209
+ BRANCHING_ORPHAN_ENTITY_TYPES = [
11210
+ "agent",
11211
+ "agent_parameter",
11212
+ "agent_resource",
11213
+ "channel",
11214
+ "connection",
11215
+ "eval",
11216
+ "mcp_tool",
11217
+ "outbound_contact",
11218
+ "outbound_schedule",
11219
+ "resource",
11220
+ "resource_folder",
11221
+ "tool"
11222
+ ];
11223
+ BRANCHING_ORPHAN_MAX_TARGETS = 50;
11224
+ adminRepairBranchingOrphansBody = adminScopedTargetShape.extend({
11225
+ targets: external_exports.array(
11226
+ external_exports.object({
11227
+ entity_type: external_exports.enum(BRANCHING_ORPHAN_ENTITY_TYPES),
11228
+ entity_id: external_exports.string().min(1)
11229
+ }).strict()
11230
+ ).min(1).max(BRANCHING_ORPHAN_MAX_TARGETS).optional()
11183
11231
  }).strict().superRefine((data, ctx) => {
11184
- if (data.scope === "org") {
11185
- if (!data.org_id) {
11186
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org requires org_id", path: ["org_id"] });
11187
- }
11188
- if (data.hub_id) {
11189
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org must not include hub_id", path: ["hub_id"] });
11190
- }
11191
- } else if (data.scope === "hub") {
11192
- if (!data.hub_id) {
11193
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub requires hub_id", path: ["hub_id"] });
11194
- }
11195
- if (data.org_id) {
11196
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub must not include org_id", path: ["org_id"] });
11197
- }
11198
- } else {
11199
- if (data.org_id) {
11200
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include org_id", path: ["org_id"] });
11201
- }
11202
- if (data.hub_id) {
11203
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include hub_id", path: ["hub_id"] });
11204
- }
11232
+ refineScopedTarget(data, ctx);
11233
+ if (data.targets && data.scope !== "hub") {
11234
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "targets requires scope=hub", path: ["targets"] });
11205
11235
  }
11206
11236
  });
11207
11237
  adminRepairLegacyOrgGrantsBody = external_exports.object({
@@ -12115,6 +12145,11 @@ var init_api_client = __esm({
12115
12145
  async adminRepairTeamOrphans(body) {
12116
12146
  return this.request("POST", "/api/admin/hubs/repair-team-orphans", body);
12117
12147
  }
12148
+ // Report twin candidates, or delete named production rows no preview maps (#4577).
12149
+ // Used by `wayai admin hubs repair-branching-orphans` (platform-admin gated).
12150
+ async adminRepairBranchingOrphans(body) {
12151
+ return this.request("POST", "/api/admin/hubs/repair-branching-orphans", body);
12152
+ }
12118
12153
  // Repair the roster rows the pre-#3922 platform-admin add wrote (email in the
12119
12154
  // `user_id` column, `user_email` NULL) — each one an inert phantom seat.
12120
12155
  // Used by `wayai admin orgs repair-legacy-grants` (platform-admin gated).
@@ -14349,6 +14384,30 @@ function refineHubAsCodeMonitorRulesOutput2(config, ctx) {
14349
14384
  }
14350
14385
  });
14351
14386
  }
14387
+ function refineScopedTarget2(data, ctx) {
14388
+ if (data.scope === "org") {
14389
+ if (!data.org_id) {
14390
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org requires org_id", path: ["org_id"] });
14391
+ }
14392
+ if (data.hub_id) {
14393
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org must not include hub_id", path: ["hub_id"] });
14394
+ }
14395
+ } else if (data.scope === "hub") {
14396
+ if (!data.hub_id) {
14397
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub requires hub_id", path: ["hub_id"] });
14398
+ }
14399
+ if (data.org_id) {
14400
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub must not include org_id", path: ["org_id"] });
14401
+ }
14402
+ } else {
14403
+ if (data.org_id) {
14404
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include org_id", path: ["org_id"] });
14405
+ }
14406
+ if (data.hub_id) {
14407
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include hub_id", path: ["hub_id"] });
14408
+ }
14409
+ }
14410
+ }
14352
14411
  function identifyTokenType(token) {
14353
14412
  if (token.startsWith("way_")) return "way_token";
14354
14413
  if (token.startsWith("eyJ")) return "jwt";
@@ -14404,7 +14463,7 @@ function findStepBoundaries(transcript) {
14404
14463
  }
14405
14464
  return out;
14406
14465
  }
14407
- 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, REKOR_ACTOR_TYPE_HEADER2, REKOR_ACTOR_ID_HEADER2, REKOR_ACTOR_LABEL_HEADER2, REKOR_ACTOR_ORG_HEADER2, REKOR_ACTOR_ADMIN_HEADER2, REKOR_CLIENT_HEADER2, REKOR_TOOL_ID_HEADER2, REKOR_CLIENTS2, rekorClientSchema2, MAX_REKOR_TOOL_ID_LENGTH2, rekorToolIdSchema2, DATA_PROXY_MOUNT2, DATA_PROXY_PREFIX2, DATA_PROXY_ORG_QUERY_PARAM2, MAX_PROVISIONING_BODY_BYTES2, dataProxyQuery2, rekorAttestation2, REQUIRED_REKOR_ATTESTATION_HEADERS2, BASE_DESTRUCTION_MOUNT2, BASE_DESTRUCTION_PREFIX2, BASE_DESTRUCTION_CONFIRM_PATH2, baseDestructionConfirmBody2, BASE_DESTRUCTION_GRACE_MS2, BASE_DESTRUCTION_CONFIRM_TTL_MS2, BASE_DESTRUCTION_ORG_QUERY_PARAM2, baseDestructionQuery2, baseDestructionParam2, baseDestructionInitiateBody2, baseDestructionStatus2, baseDestructionRequest2, baseDestructionListResponse2, baseDestructionInitiateResponse2, baseDestructionConfirmResponse2, baseDestructionCancelResponse2, ENDPOINT_CONFIGS, AUTH_TYPE2, ORG_CREDENTIAL_AUTH_TYPES2, AUTH_TYPE_DISPLAY2, LEGACY_AUTH_TYPE_MAP2, VALID_AUTH_TYPES2, AGENT_ROLES2, SAFE_USER_ID_REGEX2, SUPPORTED_LOCALES2, uuidSchema2, paginationSchema3, timestampSchema2, idParamSchema2, clientOptionalString2, clientOptionalBoolean2, clientOptionalNumber2, messageAttachment2, MAX_MESSAGE_BODY_BYTES2, MAX_ATTACHMENTS_PER_MESSAGE2, MAX_AUDIO_FILE_BASE64_BYTES2, primaryRegionSchema2, placementSourceSchema2, orgIdParam2, orgAdminIdParam2, createOrganizationBody2, updateOrganizationBody2, addOrgAdminBody2, SUMMARIZATION_THRESHOLD_MIN2, SUMMARIZATION_THRESHOLD_MAX2, PREVIOUS_CONVERSATIONS_MAX2, FLAG_CONDITION_OPERATORS2, CONFIDENCE_VARIABLE_SUFFIX2, DECISION_SCORE_MIN_LEVELS2, DECISION_SCORE_MAX_LEVELS2, DECISIONS_MODEL_PREFIXES2, DECISION_CAPABLE_AGENT_ROLES2, NATIVE_TOOL_SCHEMAS2, WAYAI_CONNECTOR2, BASE_NATIVE_TOOLS2, NATIVE_TOOLS2, CATALOG_SIDE_EFFECTS2, NATIVE_TOOL_NAMES2, previousConversationsCountField2, summarizationThresholdField2, flagConditionSchema2, MONITOR_TRIGGERS2, monitorTriggerSchema2, MONITOR_FIRING_TRIGGERS2, MONITOR_DELAY_SECONDS_MIN2, MONITOR_IDLE_DELAY_REQUIRED_MESSAGE2, MONITOR_HISTORY_MESSAGES_MAX2, monitorHistoryMessagesSchema2, monitorIncludeToolResultsSchema2, MONITOR_INPUT_SHAPING_KEYS2, MONITOR_INPUT_SHAPING_SCHEMAS2, MONITOR_INPUT_SHAPING_IDLE_MESSAGE2, monitorArgumentSourceSchema2, MONITOR_NOTE_TEMPLATE_MAX2, MONITOR_STEER_NOTE_MAX2, monitorActionSchema2, monitorRuleSchema2, MONITOR_RULE_KEYS2, MONITOR_RULE_SCHEMAS2, MONITOR_RULE_TRIGGERS2, MONITOR_RULE_TRIGGER_MESSAGE2, CALL_UTTERANCE_SPEAKERS2, callUtteranceSpeakerSchema2, MONITOR_CALL_KEYS2, MONITOR_CALL_SCHEMAS2, MONITOR_CALL_KEY_MESSAGE2, CALL_STEERING_MIN_CONFIDENCE2, CALL_UTTERANCE_RULE_NOT_CONFIDENT_MESSAGE2, CALL_UTTERANCE_FALLBACK_MESSAGE2, CALL_UTTERANCE_FLAG_CONDITIONS_MESSAGE2, CALL_STEER_NOTE_BLANK_MESSAGE2, MONITOR_USER_MESSAGE_ACTION_KINDS2, MONITOR_ASSISTANT_REPLY_ACTION_KINDS2, MONITOR_CALL_UTTERANCE_ACTION_KINDS2, INSERT_NOTE_TOOL_NAME2, RUN_MONITOR_TOOL_NAME2, MONITOR_RULE_ALLOWED_NATIVE_TOOLS2, MONITOR_RULE_REENTRY_TOOLS2, MONITOR_RULE_REENTRY_TRACKS2, monitorConfigField2, flagConditionsField2, agentIdParam2, listAgentsQuery2, agentConnectionsQuery2, createAgentBody2, updateAgentBody2, AGENT_PARAMETER_TYPES2, AGENT_PARAMETER_NAME_REGEX2, agentParameterCreateSchema2, MAX_AGENT_PARAMETERS_PER_REQUEST2, createAgentParametersBody2, SLUG_REGEX2, slugSchema2, INVISIBLE_NAME_CHARS2, MAX_KANBAN_STATUSES2, MAX_FOLLOWUPS_PER_STATUS2, MAX_LANES2, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES2, RESERVED_TEMPLATE_DUMP_NAME2, kanbanStatusSlugSchema2, followupTypeSchema2, EVENT_RELATIVE_FOLLOWUP_TYPES2, followupTimeUnitSchema2, followupIdSchema2, SELECTABLE_FOLLOWUP_TYPES2, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS2, followupSchema2, MAX_OUTCOMES_PER_STATUS2, kanbanOutcomeSchema2, EXCLUSIVE_FLAG_PAIRS2, kanbanStatusSchema2, kanbanStatusesArraySchema2, laneSchema2, lanesArraySchema2, hubIdParam2, hubAdminIdParam2, hubUserIdParam2, hubIdentityIdParam2, hubTeamIdParam2, hubTeamUserDeleteParam2, hubSchemaQuery2, PREVIEW_LABEL_MAX_LENGTH2, MAX_ENDED_INDEX_RETENTION_DAYS2, MAX_EVAL_RETENTION_DAYS2, previewLabelField2, createHubBody2, updateHubBody2, addHubAdminBody2, addHubIdentityAuthorizationBody2, contactDecisionBody2, approveContactBody2, listContactAccessQuery2, createHubTeamBody2, updateHubTeamBody2, addHubTeamUserBody2, reassignHubUserBody2, replicatePreviewBody2, updateChannelTestIdentitiesBody2, claimCodeChannelParam2, claimCodeDeleteParam2, connectionIdParam2, connectorIdParam2, listConnectionsQuery2, deleteConnectionQuery2, addConnectionBody2, editConnectionBody2, PRODUCTION_DIRECT_FIELDS2, setProductionCredentialBody2, registerWhatsappQuery2, registerWhatsappBody2, retryProvisioningQuery2, resendDomainStatusQuery2, PLACEHOLDER_TOKENS2, ALLOWED_TYPES2, SUBSCHEMA_OBJECT_KEYWORDS2, SUBSCHEMA_LIST_KEYWORDS2, SUBSCHEMA_MAP_KEYWORDS2, MAX_SCHEMA_DEPTH2, toolIdParam2, listToolsQuery2, toolAgentQuery2, deleteToolQuery2, toolConnectionsQuery2, nativeToolIdSchema2, CONTEXT_BOUNDARIES2, contextBoundarySchema2, addNativeToolBody2, addMcpToolBody2, createCustomToolBody2, updateCustomToolBody2, updateToolExecutionConfigBody2, initialValueCreateSchema2, initialValueUpdateSchema2, stateIdParam2, listStatesQuery2, stateNameSchema2, createStateBody2, updateStateBody2, reorderStatesBody2, variantAiModeSchema2, experimentStatusSchema2, overlayUpdateSchema2, experimentIdParam2, variantIdParam2, listExperimentsQuery2, listVariantsQuery2, listOverridesQuery2, deleteOverrideQuery2, createExperimentBody2, updateExperimentBody2, setExperimentStatusBody2, createVariantBody2, updateVariantBody2, upsertOverrideBody2, orgTagIdParam2, listOrgTagsQuery2, ORG_TAG_NAME_REGEX2, ORG_TAG_NAME_MAX_LENGTH2, createOrgTagBody2, updateOrgTagBody2, orgCredentialIdParam2, listOrgCredentialsQuery2, createOrgCredentialBody2, updateOrgCredentialBody2, BASE_CREDENTIAL_NAME_MAX2, baseCredentialNameSchema2, createBaseCredentialLinkBody2, baseCredentialLinkParams2, baseCredentialLinkQuery2, orgResourceIdParam2, orgResourceFileIdParam2, orgResourceFolderIdParam2, hubOrgResourceParam2, listOrgResourcesQuery2, orgIdQuery2, createOrgResourceBody2, updateOrgResourceBody2, createOrgResourceFolderBody2, updateOrgResourceFolderBody2, uploadOrgResourceFileBody2, updateOrgResourceFileBody2, uploadOrgSkillZipBody2, linkOrgResourceBody2, resourceIdParam2, listResourcesQuery2, createResourceBody2, updateResourceBody2, syncSkillsBody2, resourceFileIdParam2, listResourceFilesQuery2, createResourceFileBody2, updateResourceFileBody2, uploadResourceFileBody2, uploadSkillZipBody2, resourceFolderIdParam2, listResourceFoldersQuery2, createResourceFolderBody2, updateResourceFolderBody2, agentResourceQuery2, hubResourceQuery2, linkAgentResourceBody2, updateAgentResourceBody2, unlinkAgentResourceQuery2, navItemSchema2, hubCountResetBody2, navItemCountResetBody2, typingBody2, analyticsHubIdParam2, analyticsVariableIdParam2, updateVariablePinBody2, updateAnalyticsViewBody2, NUMERIC_FILTER_OPS2, TEXT_FILTER_OPS2, CATEGORICAL_FILTER_OPS2, VARIABLE_FILTER_OPS2, STRUCTURED_QUERY_OPS2, STRUCTURED_QUERY_AGGREGATIONS2, filterValueSchema2, conversationsBody2, analyticsConversationIdParam2, messagesQuery2, conversationDetailDataQuery2, analyticsDataBody2, structuredQueryBody2, analyticsSqlBody2, analyticsSqlTable2, analyticsSqlSchemaQuery2, EVAL_PACING_PRESET_NAMES2, PACING_INTERVAL_MIN_MS2, PACING_INTERVAL_MAX_MS2, EVAL_MAX_RUNS_PER_SCENARIO2, EVAL_RUN_DEADLINE_MIN_MS2, EVAL_RUN_DEADLINE_MAX_MS2, ISO_UTC_RE2, paginationSchema22, evalIdParam2, sessionIdParam2, scenarioSetIdParam2, hubIdQuery2, evalDateContextSchema2, EVAL_FIXTURE_NAME_MAX_LENGTH2, evalFixtureOverrideSchema2, runSessionQuery2, runJourneyQuery2, EVAL_INPUT_ROLES2, EVAL_INPUT_ROLE_LIST2, ROLE_ECHO_MAX2, EVAL_INITIAL_STATE_SCOPES2, MAX_INITIAL_STATE_ENTRIES2, evalInitialStateEntry2, evalBody2, EVAL_LIST_MAX_LIMIT2, evalListLimit2, getEvalsQuery2, toggleEvalBody2, bulkToggleEvalsBody2, pacingConfigSchema2, EVAL_MAX_SELECTED_SCENARIOS2, evalScenarioSelectionEntrySchema2, evalScenarioSelectionSchema2, sessionConfigSchema2, createSessionBody2, getSessionsQuery2, getSessionResultsQuery2, getSessionRunsQuery2, evalAnalyticsQuery2, getSessionCostQuery2, compareSessionsQuery2, evalsSqlBody2, evalsSqlSchemaQuery2, exportResultsQuery2, validateEvalBody2, hubAgentsQuery2, createScenarioSetBody2, updateScenarioSetBody2, scenarioSetsHubQuery2, createScenarioFromConversationBody2, createJourneyFromConversationBody2, EVAL_ATTACHMENT_HASH_REGEX2, evalAttachmentRef2, turnMayCarryAttachments2, ATTACHMENTS_USER_ONLY_MESSAGE2, journeyIdParam2, journeyToolCallSchema2, journeyTurnSchema2, journeyStepOverrideSchema2, fixtureField2, createJourneyBody2, updateJourneyBody2, evalSessionConfigResponseSchema2, evalSessionResponseSchema2, evalSessionListConfigSchema2, evalSessionListItemSchema2, seedReleaseStatusSchema2, getConversationsQuery2, getMessagesQuery2, appMessageSenderType2, appMessageReceiverType2, apiChannelMessage2, apiChannelMessageBody2, appMessageBody2, appMessageResponse2, CALL_STATUSES2, callStatus2, CALL_END_REASONS2, callEndReason2, CALL_TRANSPORTS2, callTransport2, CALL_PARTICIPANT_TYPES2, callParticipantType2, callInstant2, MAX_SDP_OFFER_LENGTH2, sdpDescription2, sdpOffer2, MAX_CALL_REQUEST_BODY_BYTES2, hubScoped3, callSummaryFields2, callSummary2, callIdParam2, createCallBody2, createCallResponse2, callReadyBody2, callHangupBody2, callStatusQuery2, MAX_REPORTED_DELEGATION_IDS2, callDelegationId2, callDelegationsBody2, callResponse2, MAX_CALL_RECORDING_GAPS2, callRecordingGap2, callRecordingNoteMetadata2, CALL_OPENING_LANGUAGES2, callOpeningLanguage2, CALL_OPENING_MAX_DURATION_MS2, CALL_OPENING_MAX_BYTES2, CALL_OPENING_CAPTION_MAX_CHARS2, CALL_OPENING_CONTENT_TYPES2, callOpeningContentType2, CALL_OPENING_HASH_REGEX2, callOpeningHash2, callOpeningCaption2, storedCallOpening2, MAX_CALL_OPENING_ENCODED_BYTES2, MAX_CALL_OPENING_BODY_BYTES2, agentCallOpeningParams2, putAgentCallOpeningBody2, deleteAgentCallOpeningQuery2, callOpeningParam2, callOpeningQuery2, TTS_VOICE_REPLY_ENABLED_FIELD2, COPILOT_TRIGGER_FIELD2, AUDIO_LANGUAGE_OPTIONS2, whatsapp2, instagram2, resend2, telegram2, API_CHANNEL_DELIVERY_EVENTS2, apiChannel2, OPENAI_REASONING_MODELS2, openai2, anthropic2, googleAiStudio2, openRouter2, xai2, groqStt2, openaiStt2, elevenLabsStt2, openaiTts2, groqTts2, elevenLabsTts2, GEMINI_TTS_VOICES2, googleTts2, wayai2, externalResources2, restApiTool2, mcpServer2, e2b2, CLAUDE_HARNESS_MODELS2, CLAUDE_HARNESS_MODEL_OPTIONS2, HARNESS_MCP_SERVERS_FIELD2, HARNESS_EGRESS_FIELDS2, claudeAgentSdk2, claudeManagedAgents2, rekorMemory2, SPOKEN_LINE_MAX_CHARS2, gptLive2, CONNECTORS2, evalCallInstant2, EVAL_CALL_MIN_SECONDS2, EVAL_CALL_MAX_SECONDS2, EVAL_CALL_SPOKEN_LINE_MAX_CHARS2, hubScoped22, createEvalCallBody2, createEvalCallResponse2, evalCallConversationQuery2, evalCallRecordQuery2, evalCallSpeaker2, evalCallUtterance2, evalCallTurn2, evalCallRecording2, evalCallRecordResponse2, evalCallFinishResponse2, updateUserBody2, updateProfileBody2, pathnameRegex2, updatePreferencesBody2, registerPushTokenBody2, deletePushTokenQuery2, activityQuery2, deletionModeSchema2, deletionRequestBody2, archiveHubIdParam2, archiveConversationParams2, archiveListQuery2, archiveMessageObservabilityParams2, conversationIdParam2, claimBody2, releaseBody2, transferBody2, closeBody2, additionalContextPayloadSchema2, kanbanUpdateBody2, annotateConversationBody2, observabilityParams2, observabilityListParams2, deleteUserConversationsBody2, deleteUserConversationsResponse2, sendMessageBody2, listConversationsQuery2, flagSourceSchema2, getConversationsResponse2, getConversationDetailParams2, getConversationDetailQuery2, getConversationDetailResponse2, listWhatsAppTemplatesQuery2, sendWhatsAppTemplateBody2, copilotSuggestBody2, copilotSuggestResponse2, CONSULT_THREAD_STATUSES2, consultThreadStatus2, CONSULT_THREAD_TITLE_MAX2, consultThreadTitle2, consultThreadSummary2, listConsultThreadsQuery2, listConsultThreadsResponse2, createConsultThreadBody2, createConsultThreadResponse2, consultThreadIdParam2, updateConsultThreadBody2, updateConsultThreadResponse2, CONSULT_AWAIT_TIMEOUT_MS2, billingOrgIdParam2, subscriptionItemParams2, spendCapBody2, growthPacksBody2, portalSessionBody2, checkoutSessionBody2, updateBillingCurrencyBody2, invoicesQuery2, planKeySchema2, billingStatusSchema2, billingPlanTypeSchema2, dataUsageCountersSchema2, REKOR_ENTITLEMENT_CONTRACT_VERSION2, entitlementProjectionSchema2, rekorEntitlementRefreshMessageSchema2, downloadBody2, uploadQuery2, signUrlBody2, outboundSchemaQuery2, templateIdParam2, listTemplatesQuery2, deleteTemplateQuery2, templateStatusQuery2, createTemplateBody2, updateTemplateBody2, submitTemplateBody2, testTemplateBody2, contactIdParam2, listContactsQuery2, createContactBody2, updateContactBody2, listIdParam2, listListsQuery2, listListContactsQuery2, createListBody2, updateListBody2, addListContactsBody2, removeListContactsBody2, scheduleIdParam2, listSchedulesQuery2, listExecutionsQuery2, createScheduleBody2, updateScheduleBody2, MAX_RESOURCE_FILE_SIZE2, MAX_10MB_BASE64_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_CARRIERS2, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES2, MAX_RESOURCE_ENCODED_BYTES2, MAX_HUB_AS_CODE_RESOURCES2, MAX_HUB_AS_CODE_RESOURCE_FILES2, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES2, MAX_CI_CONFIG_BODY_BYTES2, MAX_CALL_OPENING_CARRIERS2, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES2, hubAsCodeStateSchema2, hubAsCodeResourceFileSchema2, hubAsCodeResourceSchema2, uuidPattern2, ciUuidSchema2, boundedHubAsCodeResourcesSchema2, hubAsCodeConfigSchema2, ciPullHubIdParam2, ciBranchParam2, ciPullQuery2, ciHubsQuery2, ciLookupQuery2, ciBranchesQuery2, ciSyncBody2, ciPushBody2, ciDiffBody2, ciPublishBody2, ciPublishPreviewBody2, ciSyncMcpBody2, ciOrgResourcesParam2, orgResourcesConfigSchema2, ciOrgResourcesPushBody2, ciOrgResourcesDiffBody2, CI_APPLY_ENTITY_KINDS2, CI_APPLY_OPERATIONS2, ciApplyErrorBaseSchema2, ciApplyErrorSchema2, ciSyncCountSchema2, ciSyncChangesSchema2, ciSyncWarningSchema2, ciSyncResponseSchema2, adminOrgIdParam2, adminOrgAdminIdParam2, adminUserIdParam2, PRICING_PLAN_ID_RE2, adminPlanIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, MAX_VOICE_CALL_MINUTE_OPS2, voiceCallMinuteOps2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, adminScopedTargetBody2, adminRepairLegacyOrgGrantsBody2, adminRepairCompedPlansBody2, updatePricingPlanBody2, dataExplorerSearchQuery2, dataExplorerOrgIdParam2, dataExplorerHubIdParam2, dataExplorerConvIdParam2, dataExplorerDoInstancesQuery2, dataExplorerNsIdParam2, dataExplorerKvKeysBody2, dataExplorerKvKeyBody2, uuidOrHexId2, dataExplorerDeleteOrgParam2, dataExplorerDeleteHubParam2, dataExplorerDeleteConvParam2, dataExplorerDeleteUserParam2, dataExplorerDeleteQuery2, dataExplorerKvDeleteBody2, pitrDoNamespace2, pitrBookmarkParam2, pitrRestoreBody2, healthSamplingTriggerBody2, dataExplorerDebugDoType2, DEBUG_READ_MAX_LIMIT2, DEBUG_READ_DEFAULT_LIMIT2, DEBUG_DO_HEX_PREFIX2, debugDoEntityId2, debugTableName2, dataExplorerDebugTablesParam2, dataExplorerDebugRowsParam2, dataExplorerDebugRowsQuery2, dataExplorerDebugAnalyticsTable2, debugUuid2, dataExplorerDebugAnalyticsRowsParam2, dataExplorerDebugAnalyticsRowsQuery2, debugHubConvParam2, debugMessageIdQuery2, sandboxEgressPolicy2, SANDBOX_EXEC_MAX_CMD_LENGTH2, SANDBOX_EXEC_MAX_ALLOWLIST2, SANDBOX_EXEC_MAX_TIMEOUT_MS2, adminSandboxExecBody2, META_ENTITY_ID_PATTERN2, metaEntityId2, whatsappCallbackBody2, authMeResponse2, wsTicketResponse2, sessionCheckResponse2, logoutResponse2, magicCodeSendBody2, magicCodeSendResponse2, magicCodeVerifyBody2, magicCodeVerifyResponse2, passwordLoginBody2, browserParams2, browserFoldersQuery2, browserFilesQuery2, stateOperationBody2, conversationListResourcesQuery2, conversationReadResourceQuery2, listPendingSchedulesQuery2, listHubAggregateSchedulesQuery2, reportSourceSchema2, intakeReportSourceSchema2, reportClassificationSchema2, reportStatusSchema2, reportLocaleSchema2, reportMessageAuthorRoleSchema2, reportMessageSchema2, sentryRefStatusSchema2, createReportBody2, editReportBody2, reporterReportSummarySchema2, reporterListResponseSchema2, getReportResponseSchema2, reporterTransitionResponseSchema2, contestReportBody2, reporterListQuery2, listReportsQuery2, GITHUB_ISSUE_URL_REGEX2, githubIssueUrlSchema2, transitionReportBody2, groupReportsBody2, holdReportBody2, clickhouseReadyResponse2, bootstrapQuery2, requestSnapshotChunkMessage2, MAX_NAME_LENGTH3, MAX_VALUE_LENGTH2, MAX_TAGS2, MAX_TAG_LENGTH2, MAX_SCOPE_HUBS2, MAX_SCOPE_TAGS2, vaultSecretScopeSchema2, vaultCreateBody2, vaultUpdateBody2, PERMISSIONS2, MAX_NAME_LENGTH22, MAX_HUBS_PER_GRANT2, MAX_HUB_TAGS_PER_GRANT2, MAX_GRANTS2, permissionEnum2, grantScopeSchema2, grantSchema2, createTokenBody2, tokenOrgIdParam2, tokenGrantScopeSchema2, tokenGrantSchema2, tokenMetadataSchema2, listTokensResponse2, createTokenResponse2, orgTokenSummarySchema2, listOrgTokensResponse2, invitePreviewQuery2, invitePreviewResponse2, jsonSchemaSchema2, hubUserIdentity2, stateValueEntry2, getHubUserContextResponse2, updateHubUserBody2, updateHubUserResponse2, unlockHubUserNameResponse2, stateResetParams2, stateResetResponse2, hubAlertsParam2, hubAlertSeverity2, hubAlert2, hubAlertsListResponse2, noticeSeveritySchema2, noticeStatusSchema2, NOTICE_SCOPE_REGEX2, noticeScopeSchema2, noticeLinkSchema2, createNoticeBody2, updateNoticeBody2, listNoticesQuery2, noticeIdParamSchema2, ADMIN_SKILL_NAME_REGEX2, adminSkillNameParam2, rekorBaseChangeMessageSchema2, WAYAI_WORKSPACE_LAYOUT, decisionAnswerSchema, decisionsResponseSchema;
14466
+ 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, REKOR_ACTOR_TYPE_HEADER2, REKOR_ACTOR_ID_HEADER2, REKOR_ACTOR_LABEL_HEADER2, REKOR_ACTOR_ORG_HEADER2, REKOR_ACTOR_ADMIN_HEADER2, REKOR_CLIENT_HEADER2, REKOR_TOOL_ID_HEADER2, REKOR_CLIENTS2, rekorClientSchema2, MAX_REKOR_TOOL_ID_LENGTH2, rekorToolIdSchema2, DATA_PROXY_MOUNT2, DATA_PROXY_PREFIX2, DATA_PROXY_ORG_QUERY_PARAM2, MAX_PROVISIONING_BODY_BYTES2, dataProxyQuery2, rekorAttestation2, REQUIRED_REKOR_ATTESTATION_HEADERS2, BASE_DESTRUCTION_MOUNT2, BASE_DESTRUCTION_PREFIX2, BASE_DESTRUCTION_CONFIRM_PATH2, baseDestructionConfirmBody2, BASE_DESTRUCTION_GRACE_MS2, BASE_DESTRUCTION_CONFIRM_TTL_MS2, BASE_DESTRUCTION_ORG_QUERY_PARAM2, baseDestructionQuery2, baseDestructionParam2, baseDestructionInitiateBody2, baseDestructionStatus2, baseDestructionRequest2, baseDestructionListResponse2, baseDestructionInitiateResponse2, baseDestructionConfirmResponse2, baseDestructionCancelResponse2, ENDPOINT_CONFIGS, AUTH_TYPE2, ORG_CREDENTIAL_AUTH_TYPES2, AUTH_TYPE_DISPLAY2, LEGACY_AUTH_TYPE_MAP2, VALID_AUTH_TYPES2, AGENT_ROLES2, SAFE_USER_ID_REGEX2, SUPPORTED_LOCALES2, uuidSchema2, paginationSchema3, timestampSchema2, idParamSchema2, clientOptionalString2, clientOptionalBoolean2, clientOptionalNumber2, messageAttachment2, MAX_MESSAGE_BODY_BYTES2, MAX_ATTACHMENTS_PER_MESSAGE2, MAX_AUDIO_FILE_BASE64_BYTES2, primaryRegionSchema2, placementSourceSchema2, orgIdParam2, orgAdminIdParam2, createOrganizationBody2, updateOrganizationBody2, addOrgAdminBody2, SUMMARIZATION_THRESHOLD_MIN2, SUMMARIZATION_THRESHOLD_MAX2, PREVIOUS_CONVERSATIONS_MAX2, FLAG_CONDITION_OPERATORS2, CONFIDENCE_VARIABLE_SUFFIX2, DECISION_SCORE_MIN_LEVELS2, DECISION_SCORE_MAX_LEVELS2, DECISIONS_MODEL_PREFIXES2, DECISION_CAPABLE_AGENT_ROLES2, NATIVE_TOOL_SCHEMAS2, WAYAI_CONNECTOR2, BASE_NATIVE_TOOLS2, NATIVE_TOOLS2, CATALOG_SIDE_EFFECTS2, NATIVE_TOOL_NAMES2, previousConversationsCountField2, summarizationThresholdField2, flagConditionSchema2, MONITOR_TRIGGERS2, monitorTriggerSchema2, MONITOR_FIRING_TRIGGERS2, MONITOR_DELAY_SECONDS_MIN2, MONITOR_IDLE_DELAY_REQUIRED_MESSAGE2, MONITOR_HISTORY_MESSAGES_MAX2, monitorHistoryMessagesSchema2, monitorIncludeToolResultsSchema2, MONITOR_INPUT_SHAPING_KEYS2, MONITOR_INPUT_SHAPING_SCHEMAS2, MONITOR_INPUT_SHAPING_IDLE_MESSAGE2, monitorArgumentSourceSchema2, MONITOR_NOTE_TEMPLATE_MAX2, MONITOR_STEER_NOTE_MAX2, monitorActionSchema2, monitorRuleSchema2, MONITOR_RULE_KEYS2, MONITOR_RULE_SCHEMAS2, MONITOR_RULE_TRIGGERS2, MONITOR_RULE_TRIGGER_MESSAGE2, CALL_UTTERANCE_SPEAKERS2, callUtteranceSpeakerSchema2, MONITOR_CALL_KEYS2, MONITOR_CALL_SCHEMAS2, MONITOR_CALL_KEY_MESSAGE2, CALL_STEERING_MIN_CONFIDENCE2, CALL_UTTERANCE_RULE_NOT_CONFIDENT_MESSAGE2, CALL_UTTERANCE_FALLBACK_MESSAGE2, CALL_UTTERANCE_FLAG_CONDITIONS_MESSAGE2, CALL_STEER_NOTE_BLANK_MESSAGE2, MONITOR_USER_MESSAGE_ACTION_KINDS2, MONITOR_ASSISTANT_REPLY_ACTION_KINDS2, MONITOR_CALL_UTTERANCE_ACTION_KINDS2, INSERT_NOTE_TOOL_NAME2, RUN_MONITOR_TOOL_NAME2, MONITOR_RULE_ALLOWED_NATIVE_TOOLS2, MONITOR_RULE_REENTRY_TOOLS2, MONITOR_RULE_REENTRY_TRACKS2, monitorConfigField2, flagConditionsField2, agentIdParam2, listAgentsQuery2, agentConnectionsQuery2, createAgentBody2, updateAgentBody2, AGENT_PARAMETER_TYPES2, AGENT_PARAMETER_NAME_REGEX2, agentParameterCreateSchema2, MAX_AGENT_PARAMETERS_PER_REQUEST2, createAgentParametersBody2, SLUG_REGEX2, slugSchema2, INVISIBLE_NAME_CHARS2, MAX_KANBAN_STATUSES2, MAX_FOLLOWUPS_PER_STATUS2, MAX_LANES2, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES2, RESERVED_TEMPLATE_DUMP_NAME2, kanbanStatusSlugSchema2, followupTypeSchema2, EVENT_RELATIVE_FOLLOWUP_TYPES2, followupTimeUnitSchema2, followupIdSchema2, SELECTABLE_FOLLOWUP_TYPES2, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS2, followupSchema2, MAX_OUTCOMES_PER_STATUS2, kanbanOutcomeSchema2, EXCLUSIVE_FLAG_PAIRS2, kanbanStatusSchema2, kanbanStatusesArraySchema2, laneSchema2, lanesArraySchema2, hubIdParam2, hubAdminIdParam2, hubUserIdParam2, hubIdentityIdParam2, hubTeamIdParam2, hubTeamUserDeleteParam2, hubSchemaQuery2, PREVIEW_LABEL_MAX_LENGTH2, MAX_ENDED_INDEX_RETENTION_DAYS2, MAX_EVAL_RETENTION_DAYS2, previewLabelField2, createHubBody2, updateHubBody2, addHubAdminBody2, addHubIdentityAuthorizationBody2, contactDecisionBody2, approveContactBody2, listContactAccessQuery2, createHubTeamBody2, updateHubTeamBody2, addHubTeamUserBody2, reassignHubUserBody2, replicatePreviewBody2, updateChannelTestIdentitiesBody2, claimCodeChannelParam2, claimCodeDeleteParam2, connectionIdParam2, connectorIdParam2, listConnectionsQuery2, deleteConnectionQuery2, addConnectionBody2, editConnectionBody2, PRODUCTION_DIRECT_FIELDS2, setProductionCredentialBody2, registerWhatsappQuery2, registerWhatsappBody2, retryProvisioningQuery2, resendDomainStatusQuery2, PLACEHOLDER_TOKENS2, ALLOWED_TYPES2, SUBSCHEMA_OBJECT_KEYWORDS2, SUBSCHEMA_LIST_KEYWORDS2, SUBSCHEMA_MAP_KEYWORDS2, MAX_SCHEMA_DEPTH2, toolIdParam2, listToolsQuery2, toolAgentQuery2, deleteToolQuery2, toolConnectionsQuery2, nativeToolIdSchema2, CONTEXT_BOUNDARIES2, contextBoundarySchema2, addNativeToolBody2, addMcpToolBody2, createCustomToolBody2, updateCustomToolBody2, updateToolExecutionConfigBody2, initialValueCreateSchema2, initialValueUpdateSchema2, stateIdParam2, listStatesQuery2, stateNameSchema2, createStateBody2, updateStateBody2, reorderStatesBody2, variantAiModeSchema2, experimentStatusSchema2, overlayUpdateSchema2, experimentIdParam2, variantIdParam2, listExperimentsQuery2, listVariantsQuery2, listOverridesQuery2, deleteOverrideQuery2, createExperimentBody2, updateExperimentBody2, setExperimentStatusBody2, createVariantBody2, updateVariantBody2, upsertOverrideBody2, orgTagIdParam2, listOrgTagsQuery2, ORG_TAG_NAME_REGEX2, ORG_TAG_NAME_MAX_LENGTH2, createOrgTagBody2, updateOrgTagBody2, orgCredentialIdParam2, listOrgCredentialsQuery2, createOrgCredentialBody2, updateOrgCredentialBody2, BASE_CREDENTIAL_NAME_MAX2, baseCredentialNameSchema2, createBaseCredentialLinkBody2, baseCredentialLinkParams2, baseCredentialLinkQuery2, orgResourceIdParam2, orgResourceFileIdParam2, orgResourceFolderIdParam2, hubOrgResourceParam2, listOrgResourcesQuery2, orgIdQuery2, createOrgResourceBody2, updateOrgResourceBody2, createOrgResourceFolderBody2, updateOrgResourceFolderBody2, uploadOrgResourceFileBody2, updateOrgResourceFileBody2, uploadOrgSkillZipBody2, linkOrgResourceBody2, resourceIdParam2, listResourcesQuery2, createResourceBody2, updateResourceBody2, syncSkillsBody2, resourceFileIdParam2, listResourceFilesQuery2, createResourceFileBody2, updateResourceFileBody2, uploadResourceFileBody2, uploadSkillZipBody2, resourceFolderIdParam2, listResourceFoldersQuery2, createResourceFolderBody2, updateResourceFolderBody2, agentResourceQuery2, hubResourceQuery2, linkAgentResourceBody2, updateAgentResourceBody2, unlinkAgentResourceQuery2, navItemSchema2, hubCountResetBody2, navItemCountResetBody2, typingBody2, analyticsHubIdParam2, analyticsVariableIdParam2, updateVariablePinBody2, updateAnalyticsViewBody2, NUMERIC_FILTER_OPS2, TEXT_FILTER_OPS2, CATEGORICAL_FILTER_OPS2, VARIABLE_FILTER_OPS2, STRUCTURED_QUERY_OPS2, STRUCTURED_QUERY_AGGREGATIONS2, filterValueSchema2, conversationsBody2, analyticsConversationIdParam2, messagesQuery2, conversationDetailDataQuery2, analyticsDataBody2, structuredQueryBody2, analyticsSqlBody2, analyticsSqlTable2, analyticsSqlSchemaQuery2, EVAL_PACING_PRESET_NAMES2, PACING_INTERVAL_MIN_MS2, PACING_INTERVAL_MAX_MS2, EVAL_MAX_RUNS_PER_SCENARIO2, EVAL_RUN_DEADLINE_MIN_MS2, EVAL_RUN_DEADLINE_MAX_MS2, ISO_UTC_RE2, paginationSchema22, evalIdParam2, sessionIdParam2, scenarioSetIdParam2, hubIdQuery2, evalDateContextSchema2, EVAL_FIXTURE_NAME_MAX_LENGTH2, evalFixtureOverrideSchema2, runSessionQuery2, runJourneyQuery2, EVAL_INPUT_ROLES2, EVAL_INPUT_ROLE_LIST2, ROLE_ECHO_MAX2, EVAL_INITIAL_STATE_SCOPES2, MAX_INITIAL_STATE_ENTRIES2, evalInitialStateEntry2, evalBody2, EVAL_LIST_MAX_LIMIT2, evalListLimit2, getEvalsQuery2, toggleEvalBody2, bulkToggleEvalsBody2, pacingConfigSchema2, EVAL_MAX_SELECTED_SCENARIOS2, evalScenarioSelectionEntrySchema2, evalScenarioSelectionSchema2, sessionConfigSchema2, createSessionBody2, getSessionsQuery2, getSessionResultsQuery2, getSessionRunsQuery2, evalAnalyticsQuery2, getSessionCostQuery2, compareSessionsQuery2, evalsSqlBody2, evalsSqlSchemaQuery2, exportResultsQuery2, validateEvalBody2, hubAgentsQuery2, createScenarioSetBody2, updateScenarioSetBody2, scenarioSetsHubQuery2, createScenarioFromConversationBody2, createJourneyFromConversationBody2, EVAL_ATTACHMENT_HASH_REGEX2, evalAttachmentRef2, turnMayCarryAttachments2, ATTACHMENTS_USER_ONLY_MESSAGE2, journeyIdParam2, journeyToolCallSchema2, journeyTurnSchema2, journeyStepOverrideSchema2, fixtureField2, createJourneyBody2, updateJourneyBody2, evalSessionConfigResponseSchema2, evalSessionResponseSchema2, evalSessionListConfigSchema2, evalSessionListItemSchema2, seedReleaseStatusSchema2, getConversationsQuery2, getMessagesQuery2, appMessageSenderType2, appMessageReceiverType2, apiChannelMessage2, apiChannelMessageBody2, appMessageBody2, appMessageResponse2, CALL_STATUSES2, callStatus2, CALL_END_REASONS2, callEndReason2, CALL_TRANSPORTS2, callTransport2, CALL_PARTICIPANT_TYPES2, callParticipantType2, callInstant2, MAX_SDP_OFFER_LENGTH2, sdpDescription2, sdpOffer2, MAX_CALL_REQUEST_BODY_BYTES2, hubScoped3, callSummaryFields2, callSummary2, callIdParam2, createCallBody2, createCallResponse2, callReadyBody2, callHangupBody2, callStatusQuery2, MAX_REPORTED_DELEGATION_IDS2, callDelegationId2, callDelegationsBody2, callResponse2, MAX_CALL_RECORDING_GAPS2, callRecordingGap2, callRecordingNoteMetadata2, CALL_OPENING_LANGUAGES2, callOpeningLanguage2, CALL_OPENING_MAX_DURATION_MS2, CALL_OPENING_MAX_BYTES2, CALL_OPENING_CAPTION_MAX_CHARS2, CALL_OPENING_CONTENT_TYPES2, callOpeningContentType2, CALL_OPENING_HASH_REGEX2, callOpeningHash2, callOpeningCaption2, storedCallOpening2, MAX_CALL_OPENING_ENCODED_BYTES2, MAX_CALL_OPENING_BODY_BYTES2, agentCallOpeningParams2, putAgentCallOpeningBody2, deleteAgentCallOpeningQuery2, callOpeningParam2, callOpeningQuery2, TTS_VOICE_REPLY_ENABLED_FIELD2, COPILOT_TRIGGER_FIELD2, AUDIO_LANGUAGE_OPTIONS2, whatsapp2, instagram2, resend2, telegram2, API_CHANNEL_DELIVERY_EVENTS2, apiChannel2, OPENAI_REASONING_MODELS2, openai2, anthropic2, googleAiStudio2, openRouter2, xai2, groqStt2, openaiStt2, elevenLabsStt2, openaiTts2, groqTts2, elevenLabsTts2, GEMINI_TTS_VOICES2, googleTts2, wayai2, externalResources2, restApiTool2, mcpServer2, e2b2, CLAUDE_HARNESS_MODELS2, CLAUDE_HARNESS_MODEL_OPTIONS2, HARNESS_MCP_SERVERS_FIELD2, HARNESS_EGRESS_FIELDS2, claudeAgentSdk2, claudeManagedAgents2, rekorMemory2, SPOKEN_LINE_MAX_CHARS2, gptLive2, CONNECTORS2, evalCallInstant2, EVAL_CALL_MIN_SECONDS2, EVAL_CALL_MAX_SECONDS2, EVAL_CALL_SPOKEN_LINE_MAX_CHARS2, hubScoped22, createEvalCallBody2, createEvalCallResponse2, evalCallConversationQuery2, evalCallRecordQuery2, evalCallSpeaker2, evalCallUtterance2, evalCallTurn2, evalCallRecording2, evalCallRecordResponse2, evalCallFinishResponse2, updateUserBody2, updateProfileBody2, pathnameRegex2, updatePreferencesBody2, registerPushTokenBody2, deletePushTokenQuery2, activityQuery2, deletionModeSchema2, deletionRequestBody2, archiveHubIdParam2, archiveConversationParams2, archiveListQuery2, archiveMessageObservabilityParams2, conversationIdParam2, claimBody2, releaseBody2, transferBody2, closeBody2, additionalContextPayloadSchema2, kanbanUpdateBody2, annotateConversationBody2, observabilityParams2, observabilityListParams2, deleteUserConversationsBody2, deleteUserConversationsResponse2, sendMessageBody2, listConversationsQuery2, flagSourceSchema2, getConversationsResponse2, getConversationDetailParams2, getConversationDetailQuery2, getConversationDetailResponse2, listWhatsAppTemplatesQuery2, sendWhatsAppTemplateBody2, copilotSuggestBody2, copilotSuggestResponse2, CONSULT_THREAD_STATUSES2, consultThreadStatus2, CONSULT_THREAD_TITLE_MAX2, consultThreadTitle2, consultThreadSummary2, listConsultThreadsQuery2, listConsultThreadsResponse2, createConsultThreadBody2, createConsultThreadResponse2, consultThreadIdParam2, updateConsultThreadBody2, updateConsultThreadResponse2, CONSULT_AWAIT_TIMEOUT_MS2, billingOrgIdParam2, subscriptionItemParams2, spendCapBody2, growthPacksBody2, portalSessionBody2, checkoutSessionBody2, updateBillingCurrencyBody2, invoicesQuery2, planKeySchema2, billingStatusSchema2, billingPlanTypeSchema2, dataUsageCountersSchema2, REKOR_ENTITLEMENT_CONTRACT_VERSION2, entitlementProjectionSchema2, rekorEntitlementRefreshMessageSchema2, downloadBody2, uploadQuery2, signUrlBody2, outboundSchemaQuery2, templateIdParam2, listTemplatesQuery2, deleteTemplateQuery2, templateStatusQuery2, createTemplateBody2, updateTemplateBody2, submitTemplateBody2, testTemplateBody2, contactIdParam2, listContactsQuery2, createContactBody2, updateContactBody2, listIdParam2, listListsQuery2, listListContactsQuery2, createListBody2, updateListBody2, addListContactsBody2, removeListContactsBody2, scheduleIdParam2, listSchedulesQuery2, listExecutionsQuery2, createScheduleBody2, updateScheduleBody2, MAX_RESOURCE_FILE_SIZE2, MAX_10MB_BASE64_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_CARRIERS2, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES2, MAX_RESOURCE_ENCODED_BYTES2, MAX_HUB_AS_CODE_RESOURCES2, MAX_HUB_AS_CODE_RESOURCE_FILES2, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES2, MAX_CI_CONFIG_BODY_BYTES2, MAX_CALL_OPENING_CARRIERS2, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES2, hubAsCodeStateSchema2, hubAsCodeResourceFileSchema2, hubAsCodeResourceSchema2, uuidPattern2, ciUuidSchema2, boundedHubAsCodeResourcesSchema2, hubAsCodeConfigSchema2, ciPullHubIdParam2, ciBranchParam2, ciPullQuery2, ciHubsQuery2, ciLookupQuery2, ciBranchesQuery2, ciSyncBody2, ciPushBody2, ciDiffBody2, ciPublishBody2, ciPublishPreviewBody2, ciSyncMcpBody2, ciOrgResourcesParam2, orgResourcesConfigSchema2, ciOrgResourcesPushBody2, ciOrgResourcesDiffBody2, CI_APPLY_ENTITY_KINDS2, CI_APPLY_OPERATIONS2, ciApplyErrorBaseSchema2, ciApplyErrorSchema2, ciSyncCountSchema2, ciSyncChangesSchema2, ciSyncWarningSchema2, ciSyncResponseSchema2, adminOrgIdParam2, adminOrgAdminIdParam2, adminUserIdParam2, PRICING_PLAN_ID_RE2, adminPlanIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, MAX_VOICE_CALL_MINUTE_OPS2, voiceCallMinuteOps2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, adminScopedTargetShape2, adminScopedTargetBody2, BRANCHING_ORPHAN_ENTITY_TYPES2, BRANCHING_ORPHAN_MAX_TARGETS2, adminRepairBranchingOrphansBody2, adminRepairLegacyOrgGrantsBody2, adminRepairCompedPlansBody2, updatePricingPlanBody2, dataExplorerSearchQuery2, dataExplorerOrgIdParam2, dataExplorerHubIdParam2, dataExplorerConvIdParam2, dataExplorerDoInstancesQuery2, dataExplorerNsIdParam2, dataExplorerKvKeysBody2, dataExplorerKvKeyBody2, uuidOrHexId2, dataExplorerDeleteOrgParam2, dataExplorerDeleteHubParam2, dataExplorerDeleteConvParam2, dataExplorerDeleteUserParam2, dataExplorerDeleteQuery2, dataExplorerKvDeleteBody2, pitrDoNamespace2, pitrBookmarkParam2, pitrRestoreBody2, healthSamplingTriggerBody2, dataExplorerDebugDoType2, DEBUG_READ_MAX_LIMIT2, DEBUG_READ_DEFAULT_LIMIT2, DEBUG_DO_HEX_PREFIX2, debugDoEntityId2, debugTableName2, dataExplorerDebugTablesParam2, dataExplorerDebugRowsParam2, dataExplorerDebugRowsQuery2, dataExplorerDebugAnalyticsTable2, debugUuid2, dataExplorerDebugAnalyticsRowsParam2, dataExplorerDebugAnalyticsRowsQuery2, debugHubConvParam2, debugMessageIdQuery2, sandboxEgressPolicy2, SANDBOX_EXEC_MAX_CMD_LENGTH2, SANDBOX_EXEC_MAX_ALLOWLIST2, SANDBOX_EXEC_MAX_TIMEOUT_MS2, adminSandboxExecBody2, META_ENTITY_ID_PATTERN2, metaEntityId2, whatsappCallbackBody2, authMeResponse2, wsTicketResponse2, sessionCheckResponse2, logoutResponse2, magicCodeSendBody2, magicCodeSendResponse2, magicCodeVerifyBody2, magicCodeVerifyResponse2, passwordLoginBody2, browserParams2, browserFoldersQuery2, browserFilesQuery2, stateOperationBody2, conversationListResourcesQuery2, conversationReadResourceQuery2, listPendingSchedulesQuery2, listHubAggregateSchedulesQuery2, reportSourceSchema2, intakeReportSourceSchema2, reportClassificationSchema2, reportStatusSchema2, reportLocaleSchema2, reportMessageAuthorRoleSchema2, reportMessageSchema2, sentryRefStatusSchema2, createReportBody2, editReportBody2, reporterReportSummarySchema2, reporterListResponseSchema2, getReportResponseSchema2, reporterTransitionResponseSchema2, contestReportBody2, reporterListQuery2, listReportsQuery2, GITHUB_ISSUE_URL_REGEX2, githubIssueUrlSchema2, transitionReportBody2, groupReportsBody2, holdReportBody2, clickhouseReadyResponse2, bootstrapQuery2, requestSnapshotChunkMessage2, MAX_NAME_LENGTH3, MAX_VALUE_LENGTH2, MAX_TAGS2, MAX_TAG_LENGTH2, MAX_SCOPE_HUBS2, MAX_SCOPE_TAGS2, vaultSecretScopeSchema2, vaultCreateBody2, vaultUpdateBody2, PERMISSIONS2, MAX_NAME_LENGTH22, MAX_HUBS_PER_GRANT2, MAX_HUB_TAGS_PER_GRANT2, MAX_GRANTS2, permissionEnum2, grantScopeSchema2, grantSchema2, createTokenBody2, tokenOrgIdParam2, tokenGrantScopeSchema2, tokenGrantSchema2, tokenMetadataSchema2, listTokensResponse2, createTokenResponse2, orgTokenSummarySchema2, listOrgTokensResponse2, invitePreviewQuery2, invitePreviewResponse2, jsonSchemaSchema2, hubUserIdentity2, stateValueEntry2, getHubUserContextResponse2, updateHubUserBody2, updateHubUserResponse2, unlockHubUserNameResponse2, stateResetParams2, stateResetResponse2, hubAlertsParam2, hubAlertSeverity2, hubAlert2, hubAlertsListResponse2, noticeSeveritySchema2, noticeStatusSchema2, NOTICE_SCOPE_REGEX2, noticeScopeSchema2, noticeLinkSchema2, createNoticeBody2, updateNoticeBody2, listNoticesQuery2, noticeIdParamSchema2, ADMIN_SKILL_NAME_REGEX2, adminSkillNameParam2, rekorBaseChangeMessageSchema2, WAYAI_WORKSPACE_LAYOUT, decisionAnswerSchema, decisionsResponseSchema;
14408
14467
  var init_dist = __esm({
14409
14468
  "../../packages/core/dist/index.js"() {
14410
14469
  "use strict";
@@ -14889,6 +14948,10 @@ var init_dist = __esm({
14889
14948
  // default admin budget. Platform-admin is enforced at the route; this is the
14890
14949
  // defense-in-depth signal that a repair loop surfaces as 429.
14891
14950
  "/api/admin/hubs/repair-team-orphans": { tier: "STRICT", userLimit: 10, userWindow: 3600, failClosed: true },
14951
+ // Branching-orphan repair (#4577) — deletes named production rows, and its report mode
14952
+ // fans out over every production hub of every org, so it takes the same strict,
14953
+ // fail-closed budget as the team-orphan repair. Exact path, for the same reason.
14954
+ "/api/admin/hubs/repair-branching-orphans": { tier: "STRICT", userLimit: 10, userWindow: 3600, failClosed: true },
14892
14955
  // CI/GitOps endpoints - standard with user limits
14893
14956
  "/api/ci/*": { tier: "STANDARD", userLimit: 100, skipAuthenticatedUsers: true },
14894
14957
  // Attested `/v1` proxy onto the Rekor Worker. `userLimitKey` is load-bearing here in a
@@ -20035,33 +20098,39 @@ var init_dist = __esm({
20035
20098
  updateFreeOrgLimitBody2 = external_exports.object({
20036
20099
  max_free_orgs_override: external_exports.number().int().min(0).nullable()
20037
20100
  });
20038
- adminScopedTargetBody2 = external_exports.object({
20101
+ adminScopedTargetShape2 = external_exports.object({
20039
20102
  scope: external_exports.enum(["all", "org", "hub"]),
20040
20103
  org_id: external_exports.string().uuid().optional(),
20041
20104
  hub_id: external_exports.string().optional(),
20042
20105
  dry_run: external_exports.boolean().optional().default(false)
20106
+ });
20107
+ adminScopedTargetBody2 = adminScopedTargetShape2.strict().superRefine(refineScopedTarget2);
20108
+ BRANCHING_ORPHAN_ENTITY_TYPES2 = [
20109
+ "agent",
20110
+ "agent_parameter",
20111
+ "agent_resource",
20112
+ "channel",
20113
+ "connection",
20114
+ "eval",
20115
+ "mcp_tool",
20116
+ "outbound_contact",
20117
+ "outbound_schedule",
20118
+ "resource",
20119
+ "resource_folder",
20120
+ "tool"
20121
+ ];
20122
+ BRANCHING_ORPHAN_MAX_TARGETS2 = 50;
20123
+ adminRepairBranchingOrphansBody2 = adminScopedTargetShape2.extend({
20124
+ targets: external_exports.array(
20125
+ external_exports.object({
20126
+ entity_type: external_exports.enum(BRANCHING_ORPHAN_ENTITY_TYPES2),
20127
+ entity_id: external_exports.string().min(1)
20128
+ }).strict()
20129
+ ).min(1).max(BRANCHING_ORPHAN_MAX_TARGETS2).optional()
20043
20130
  }).strict().superRefine((data, ctx) => {
20044
- if (data.scope === "org") {
20045
- if (!data.org_id) {
20046
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org requires org_id", path: ["org_id"] });
20047
- }
20048
- if (data.hub_id) {
20049
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org must not include hub_id", path: ["hub_id"] });
20050
- }
20051
- } else if (data.scope === "hub") {
20052
- if (!data.hub_id) {
20053
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub requires hub_id", path: ["hub_id"] });
20054
- }
20055
- if (data.org_id) {
20056
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub must not include org_id", path: ["org_id"] });
20057
- }
20058
- } else {
20059
- if (data.org_id) {
20060
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include org_id", path: ["org_id"] });
20061
- }
20062
- if (data.hub_id) {
20063
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include hub_id", path: ["hub_id"] });
20064
- }
20131
+ refineScopedTarget2(data, ctx);
20132
+ if (data.targets && data.scope !== "hub") {
20133
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "targets requires scope=hub", path: ["targets"] });
20065
20134
  }
20066
20135
  });
20067
20136
  adminRepairLegacyOrgGrantsBody2 = external_exports.object({
@@ -23934,7 +24003,9 @@ function guessMimeType(filename) {
23934
24003
  function computeHash(data) {
23935
24004
  return crypto3.createHash("sha256").update(data).digest("hex");
23936
24005
  }
23937
- function scanResourceFiles(dir, prefix = "") {
24006
+ function scanResourceFiles(dir, prefix = "", onOversized = (relPath, reason) => {
24007
+ console.warn(` Warning: skipping ${relPath} (${reason})`);
24008
+ }) {
23938
24009
  const files = [];
23939
24010
  const entries = fs9.readdirSync(dir, { withFileTypes: true });
23940
24011
  for (const entry of entries) {
@@ -23942,12 +24013,12 @@ function scanResourceFiles(dir, prefix = "") {
23942
24013
  if (entry.isSymbolicLink()) {
23943
24014
  throw symlinkRefusal(relPath, "file or folder");
23944
24015
  } else if (entry.isDirectory()) {
23945
- files.push(...scanResourceFiles(path11.join(dir, entry.name), relPath));
24016
+ files.push(...scanResourceFiles(path11.join(dir, entry.name), relPath, onOversized));
23946
24017
  } else if (entry.isFile()) {
23947
24018
  const fullPath = path11.join(dir, entry.name);
23948
24019
  const stat2 = fs9.statSync(fullPath);
23949
24020
  if (stat2.size > MAX_RESOURCE_FILE_SIZE3) {
23950
- console.warn(` Warning: skipping ${relPath} (${(stat2.size / 1024 / 1024).toFixed(1)}MB exceeds 10MB limit)`);
24021
+ onOversized(relPath, `${(stat2.size / 1024 / 1024).toFixed(1)}MB exceeds 10MB limit`);
23951
24022
  continue;
23952
24023
  }
23953
24024
  const fileEntry = {
@@ -24469,7 +24540,11 @@ function parseHubFolder(hubFolder, opts) {
24469
24540
  throw expected(`Missing hub_environment in ${yamlPath}`);
24470
24541
  }
24471
24542
  }
24472
- const agentYamlFiles = scanAgentYamlFiles(hubFolder);
24543
+ const unreadable = (relPath, reason, unreadableOpts) => {
24544
+ if (opts?.strict) throw expected(`${relPath}: ${reason}`);
24545
+ if (!unreadableOpts?.silent) console.warn(` Warning: skipping ${relPath} (${reason})`);
24546
+ };
24547
+ const agentYamlFiles = scanAgentYamlFiles(hubFolder, unreadable);
24473
24548
  const rawAgents = agentYamlFiles.length > 0 ? agentYamlFiles : config.agents;
24474
24549
  const agents = rawAgents?.map((agent) => {
24475
24550
  const resolved = { ...agent };
@@ -24496,7 +24571,7 @@ function parseHubFolder(hubFolder, opts) {
24496
24571
  }
24497
24572
  return resolved;
24498
24573
  });
24499
- const resources = parseResources(hubFolder, config.resources || []);
24574
+ const resources = parseResources(hubFolder, config.resources || [], unreadable);
24500
24575
  const payload = {
24501
24576
  version: config.version || 1,
24502
24577
  hub_id: config.hub_id || "",
@@ -24532,11 +24607,11 @@ function parseHubFolder(hubFolder, opts) {
24532
24607
  payload.outbound_schedules = config.outbound_schedules;
24533
24608
  }
24534
24609
  const bytesByHash = /* @__PURE__ */ new Map();
24535
- const evals = scanEvalYamlFiles(hubFolder, bytesByHash);
24610
+ const evals = scanEvalYamlFiles(hubFolder, bytesByHash, unreadable);
24536
24611
  if (evals.length > 0) {
24537
24612
  payload.evals = evals;
24538
24613
  }
24539
- const journeys = scanJourneyYamlFiles(hubFolder, bytesByHash);
24614
+ const journeys = scanJourneyYamlFiles(hubFolder, bytesByHash, unreadable);
24540
24615
  if (journeys.length > 0) {
24541
24616
  payload.journeys = journeys;
24542
24617
  }
@@ -24545,7 +24620,7 @@ function parseHubFolder(hubFolder, opts) {
24545
24620
  }
24546
24621
  return payload;
24547
24622
  }
24548
- function scanEvalYamlFiles(hubFolder, bytesByHash) {
24623
+ function scanEvalYamlFiles(hubFolder, bytesByHash, unreadable) {
24549
24624
  const evalsDir = path14.join(hubFolder, "evals");
24550
24625
  if (!fs12.existsSync(evalsDir)) return [];
24551
24626
  const evals = [];
@@ -24554,7 +24629,7 @@ function scanEvalYamlFiles(hubFolder, bytesByHash) {
24554
24629
  for (const entry of topEntries) {
24555
24630
  refuseConsumedLink(hubFolder, evalsDir, entry);
24556
24631
  if (entry.isFile() && entry.name.endsWith(".yaml")) {
24557
- collectEval(evals, seen, path14.join(evalsDir, entry.name), `evals/${entry.name}`, null, hubFolder, bytesByHash);
24632
+ collectEval(evals, seen, path14.join(evalsDir, entry.name), `evals/${entry.name}`, null, hubFolder, bytesByHash, unreadable);
24558
24633
  } else if (entry.isDirectory()) {
24559
24634
  const setName = entry.name;
24560
24635
  const setDir = path14.join(evalsDir, setName);
@@ -24567,16 +24642,19 @@ function scanEvalYamlFiles(hubFolder, bytesByHash) {
24567
24642
  );
24568
24643
  }
24569
24644
  if (sub.isFile() && sub.name.endsWith(".yaml")) {
24570
- collectEval(evals, seen, path14.join(setDir, sub.name), `evals/${setName}/${sub.name}`, setName, hubFolder, bytesByHash);
24645
+ collectEval(evals, seen, path14.join(setDir, sub.name), `evals/${setName}/${sub.name}`, setName, hubFolder, bytesByHash, unreadable);
24571
24646
  }
24572
24647
  }
24573
24648
  }
24574
24649
  }
24575
24650
  return evals;
24576
24651
  }
24577
- function collectEval(evals, seen, filePath, relPath, setName, hubFolder, bytesByHash) {
24652
+ function collectEval(evals, seen, filePath, relPath, setName, hubFolder, bytesByHash, unreadable) {
24578
24653
  const evalEntry = parseEvalYaml(filePath, relPath, setName, hubFolder, bytesByHash);
24579
- if (!evalEntry) return;
24654
+ if (!evalEntry) {
24655
+ unreadable(relPath, NOT_A_YAML_OBJECT);
24656
+ return;
24657
+ }
24580
24658
  const key = `${evalEntry.name}|${setName ?? ""}`;
24581
24659
  if (seen.has(key)) {
24582
24660
  const where = setName ? `scenario set "${setName}"` : "root";
@@ -24598,10 +24676,7 @@ function parseEvalYaml(filePath, relPath, setName, hubFolder, bytesByHash) {
24598
24676
  }
24599
24677
  throw err;
24600
24678
  }
24601
- if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
24602
- console.warn(` Warning: skipping ${relPath} (not a YAML object)`);
24603
- return null;
24604
- }
24679
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
24605
24680
  const data = raw;
24606
24681
  const fileSlug = path14.basename(filePath, ".yaml");
24607
24682
  const evalName = typeof data.name === "string" && data.name.trim().length > 0 ? data.name : fileSlug;
@@ -24689,7 +24764,7 @@ function parseFixtureField(raw, label, key) {
24689
24764
  const trimmed = raw.trim();
24690
24765
  return trimmed.length > 0 ? trimmed : void 0;
24691
24766
  }
24692
- function scanJourneyYamlFiles(hubFolder, bytesByHash) {
24767
+ function scanJourneyYamlFiles(hubFolder, bytesByHash, unreadable) {
24693
24768
  const journeysDir = path14.join(hubFolder, "journeys");
24694
24769
  if (!fs12.existsSync(journeysDir)) return [];
24695
24770
  const journeys = [];
@@ -24704,7 +24779,10 @@ function scanJourneyYamlFiles(hubFolder, bytesByHash) {
24704
24779
  }
24705
24780
  if (!entry.isFile() || !entry.name.endsWith(".yaml")) continue;
24706
24781
  const journeyEntry = parseJourneyYaml(path14.join(journeysDir, entry.name), `journeys/${entry.name}`, hubFolder, bytesByHash);
24707
- if (!journeyEntry) continue;
24782
+ if (!journeyEntry) {
24783
+ unreadable(`journeys/${entry.name}`, NOT_A_YAML_OBJECT);
24784
+ continue;
24785
+ }
24708
24786
  if (seen.has(journeyEntry.name)) {
24709
24787
  throw expected(
24710
24788
  `Duplicate journey: "${journeyEntry.name}" (in ${entry.name}). Each journey name must be unique.`
@@ -24726,10 +24804,7 @@ function parseJourneyYaml(filePath, relPath, hubFolder, bytesByHash) {
24726
24804
  }
24727
24805
  throw err;
24728
24806
  }
24729
- if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
24730
- console.warn(` Warning: skipping ${relPath} (not a YAML object)`);
24731
- return null;
24732
- }
24807
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
24733
24808
  const data = raw;
24734
24809
  const fileSlug = path14.basename(filePath, ".yaml");
24735
24810
  const journeyName = typeof data.name === "string" && data.name.trim().length > 0 ? data.name : fileSlug;
@@ -24770,7 +24845,7 @@ function parseJourneyYaml(filePath, relPath, hubFolder, bytesByHash) {
24770
24845
  if (targetBase) journeyEntry.target_base = targetBase;
24771
24846
  return journeyEntry;
24772
24847
  }
24773
- function scanAgentYamlFiles(hubFolder) {
24848
+ function scanAgentYamlFiles(hubFolder, unreadable) {
24774
24849
  const agentsDir = path14.join(hubFolder, "agents");
24775
24850
  if (!fs12.existsSync(agentsDir)) return [];
24776
24851
  const yamlFiles = fs12.readdirSync(agentsDir).filter((f) => f.endsWith(".yaml")).sort();
@@ -24788,16 +24863,19 @@ function scanAgentYamlFiles(hubFolder) {
24788
24863
  }
24789
24864
  throw err;
24790
24865
  }
24791
- if (!agent || typeof agent !== "object") continue;
24866
+ if (!agent || typeof agent !== "object") {
24867
+ unreadable(`agents/${file}`, NOT_A_YAML_OBJECT, { silent: true });
24868
+ continue;
24869
+ }
24792
24870
  if (!agent.name) {
24793
- console.warn(` Warning: skipping ${file} (missing 'name' field)`);
24871
+ unreadable(`agents/${file}`, "missing 'name' field");
24794
24872
  continue;
24795
24873
  }
24796
24874
  agents.push(agent);
24797
24875
  }
24798
24876
  return agents;
24799
24877
  }
24800
- function parseResources(hubFolder, configResources) {
24878
+ function parseResources(hubFolder, configResources, unreadable) {
24801
24879
  const resourcesDir = path14.join(hubFolder, "resources");
24802
24880
  const results = [];
24803
24881
  for (const res of configResources) {
@@ -24815,7 +24893,7 @@ function parseResources(hubFolder, configResources) {
24815
24893
  const resDir = path14.join(resourcesDir, resSlug);
24816
24894
  requireRealSubdirNoSymlink(hubFolder, resDir, false);
24817
24895
  if (fs12.existsSync(resDir)) {
24818
- const files = scanResourceFiles(resDir, "");
24896
+ const files = scanResourceFiles(resDir, "", (relPath, reason) => unreadable(`resources/${resSlug}/${relPath}`, reason));
24819
24897
  if (files.length > 0) {
24820
24898
  resource.files = files;
24821
24899
  }
@@ -24824,6 +24902,7 @@ function parseResources(hubFolder, configResources) {
24824
24902
  }
24825
24903
  return results;
24826
24904
  }
24905
+ var NOT_A_YAML_OBJECT;
24827
24906
  var init_parser = __esm({
24828
24907
  "src/lib/parser.ts"() {
24829
24908
  "use strict";
@@ -24833,6 +24912,7 @@ var init_parser = __esm({
24833
24912
  init_call_openings();
24834
24913
  init_expected();
24835
24914
  init_fs_safety();
24915
+ NOT_A_YAML_OBJECT = "not a YAML object";
24836
24916
  }
24837
24917
  });
24838
24918
 
@@ -27018,17 +27098,16 @@ async function pullCommand(args2) {
27018
27098
  return;
27019
27099
  }
27020
27100
  assertInScope("hubs", hubId);
27021
- let hubFolder = existingFolder;
27101
+ const hubFolder = existingFolder ?? resolveHubFolder(
27102
+ workspaceDir,
27103
+ hubId,
27104
+ payload.hub.name,
27105
+ payload.hub_environment,
27106
+ payload.preview_label,
27107
+ payload.branch_name
27108
+ );
27022
27109
  let wroteFiles = false;
27023
- if (!hubFolder) {
27024
- hubFolder = resolveHubFolder(
27025
- workspaceDir,
27026
- hubId,
27027
- payload.hub.name,
27028
- payload.hub_environment,
27029
- payload.preview_label,
27030
- payload.branch_name
27031
- );
27110
+ if (!existingFolder && !resolveHubYamlPath(hubFolder)) {
27032
27111
  fs18.mkdirSync(path24.dirname(hubFolder), { recursive: true });
27033
27112
  console.log("Writing hub configuration...");
27034
27113
  await materializeHubFolder(hubFolder, payload);
@@ -27037,18 +27116,23 @@ async function pullCommand(args2) {
27037
27116
  wroteFiles = true;
27038
27117
  } else {
27039
27118
  let action = "overwrite";
27119
+ const replaceWithoutDiff = (why, err) => confirmReplaceWithoutDiff(why, err, hubFolder, hubId, autoConfirm);
27040
27120
  let localPayload;
27041
27121
  try {
27042
- localPayload = parseHubFolder(hubFolder);
27122
+ localPayload = parseHubFolder(hubFolder, { strict: true });
27043
27123
  } catch (err) {
27044
27124
  if (isWorkspaceRefusal(err)) throw err;
27125
+ if (!await replaceWithoutDiff(UNREADABLE_LOCAL, err)) {
27126
+ console.log("Cancelled.");
27127
+ return;
27128
+ }
27045
27129
  }
27046
27130
  let diffResult;
27047
27131
  if (localPayload) {
27048
27132
  try {
27049
27133
  diffResult = await client.diff(hubId, prepareResourcePayload(localPayload, payload), "pull", organizationId);
27050
27134
  } catch (err) {
27051
- if (!await confirmReplaceWithoutDiff(err, hubFolder, hubId, autoConfirm)) {
27135
+ if (!await replaceWithoutDiff(UNCOMPARABLE_LOCAL, err)) {
27052
27136
  console.log("Cancelled.");
27053
27137
  return;
27054
27138
  }
@@ -27095,8 +27179,9 @@ async function pullCommand(args2) {
27095
27179
  await mirrorLinkedProduction2(client, workspaceDir, payload.production_hub_id, organizationId);
27096
27180
  }
27097
27181
  }
27098
- async function confirmReplaceWithoutDiff(err, hubFolder, hubId, autoConfirm) {
27099
- console.log("\nThe platform could not compare your local files, so the changes cannot be listed:");
27182
+ async function confirmReplaceWithoutDiff(why, err, hubFolder, hubId, autoConfirm) {
27183
+ console.log(`
27184
+ ${why}`);
27100
27185
  console.log(` ${err instanceof Error ? err.message : String(err)}`);
27101
27186
  if (!autoConfirm) {
27102
27187
  return confirm("Replace the local files with the platform configuration, discarding any local edits?");
@@ -27147,7 +27232,7 @@ function connectionsEqual(a, b) {
27147
27232
  }
27148
27233
  return true;
27149
27234
  }
27150
- var MIRROR_MARKER_PREFIX2;
27235
+ var UNREADABLE_LOCAL, UNCOMPARABLE_LOCAL, MIRROR_MARKER_PREFIX2;
27151
27236
  var init_pull = __esm({
27152
27237
  "src/commands/pull.ts"() {
27153
27238
  "use strict";
@@ -27165,6 +27250,8 @@ var init_pull = __esm({
27165
27250
  init_repo_config();
27166
27251
  init_worktree_scope();
27167
27252
  init_subtree_routing();
27253
+ UNREADABLE_LOCAL = "The CLI could not read your local files, so the changes cannot be listed:";
27254
+ UNCOMPARABLE_LOCAL = "The platform could not compare your local files, so the changes cannot be listed:";
27168
27255
  MIRROR_MARKER_PREFIX2 = "# Read-only mirror of production hub";
27169
27256
  }
27170
27257
  });
@@ -34218,6 +34305,9 @@ async function adminCommand(args2) {
34218
34305
  case "repair-team-orphans":
34219
34306
  await runRepairTeamOrphans(flagArgs);
34220
34307
  return;
34308
+ case "repair-branching-orphans":
34309
+ await runRepairBranchingOrphans(flagArgs);
34310
+ return;
34221
34311
  default:
34222
34312
  printHelp2();
34223
34313
  process.exit(1);
@@ -34764,6 +34854,89 @@ async function runRepairTeamOrphans(flagArgs) {
34764
34854
  console.log(`${d.hub_id} | ${d.dangling_team_ids.join(",")} | ${d.team_users_removed}`);
34765
34855
  }
34766
34856
  }
34857
+ async function runRepairBranchingOrphans(flagArgs) {
34858
+ const USAGE2 = "wayai admin hubs repair-branching-orphans --all | --org <org_id> | --hub <hub_id> [--id <type>:<id> ...] [--dry-run] [--yes] [--json]";
34859
+ const targets = [];
34860
+ const scopeArgs = [];
34861
+ for (let i = 0; i < flagArgs.length; i++) {
34862
+ if (flagArgs[i] !== "--id") {
34863
+ scopeArgs.push(flagArgs[i]);
34864
+ continue;
34865
+ }
34866
+ const raw = requireFlagValue(flagArgs, ++i, "--id");
34867
+ const sep8 = raw.indexOf(":");
34868
+ const entityType = raw.slice(0, sep8);
34869
+ const entityId = raw.slice(sep8 + 1);
34870
+ if (sep8 < 1 || !entityId || !BRANCHING_ORPHAN_ENTITY_TYPES.includes(entityType)) {
34871
+ console.error(`--id takes <type>:<id>, with type one of: ${BRANCHING_ORPHAN_ENTITY_TYPES.join(", ")}. Got: ${raw}`);
34872
+ process.exit(1);
34873
+ }
34874
+ targets.push({ entity_type: entityType, entity_id: entityId });
34875
+ }
34876
+ const { body, targetLabel, dryRun, yes, jsonOutput } = parseScopedTargetFlags(scopeArgs, USAGE2);
34877
+ if (targets.length > 0 && body.scope !== "hub") {
34878
+ console.error("--id deletes rows of ONE production hub: combine it with --hub <hub_id>.");
34879
+ console.error(USAGE2);
34880
+ process.exit(1);
34881
+ }
34882
+ if (targets.length > 0 && !dryRun && !yes && !jsonOutput) {
34883
+ console.log(`About to DELETE ${targets.length} named row(s) from production ${targetLabel}:`);
34884
+ for (const t of targets) console.log(` ${t.entity_type}:${t.entity_id}`);
34885
+ console.log("Each goes only if no live preview maps it and nothing in production references it.");
34886
+ console.log("Run with --dry-run first to see what would change.");
34887
+ const ok = await confirm("Proceed?");
34888
+ if (!ok) {
34889
+ console.log("Aborted.");
34890
+ return;
34891
+ }
34892
+ }
34893
+ const { config, accessToken } = await requireAuth();
34894
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
34895
+ let response;
34896
+ try {
34897
+ response = await client.adminRepairBranchingOrphans(targets.length > 0 ? { ...body, targets } : body);
34898
+ } catch (err) {
34899
+ exitOnApiError(err);
34900
+ throw err;
34901
+ }
34902
+ const data = response.data;
34903
+ if (jsonOutput) {
34904
+ console.log(JSON.stringify(data, null, 2));
34905
+ return;
34906
+ }
34907
+ const mode = data.mode === "report" ? "REPORT \u2014 nothing written" : data.dry_run ? "DRY RUN \u2014 nothing written" : "deleted";
34908
+ console.log(
34909
+ `repair-branching-orphans (${data.scope}) \u2014 ${mode}: hubs_scanned=${data.hubs_scanned} hubs_blocked=${data.hubs_blocked} ` + (data.mode === "report" ? `twin_candidates=${data.twin_candidates}` : `rows_deleted=${data.rows_deleted}`)
34910
+ );
34911
+ if (data.hubs_errored > 0 || data.orgs_errored > 0) {
34912
+ console.log(
34913
+ `WARNING: ${data.orgs_errored} org(s) and ${data.hubs_errored} hub(s) errored and were SKIPPED \u2014 re-run to cover them.`
34914
+ );
34915
+ }
34916
+ if (data.details.length === 0) {
34917
+ console.log("(no twin candidates in scope)");
34918
+ return;
34919
+ }
34920
+ for (const d of data.details) {
34921
+ console.log("");
34922
+ console.log(`hub ${d.hub_id} (live previews: ${d.live_preview_ids.join(", ") || "none"})`);
34923
+ if (d.blocked) {
34924
+ console.log(` BLOCKED: ${d.blocked} \u2014 no row on this hub can be verified, so none is deleted`);
34925
+ }
34926
+ for (const c of d.twin_candidates) {
34927
+ const refs = c.referenced_by.length > 0 ? ` referenced_by=${c.referenced_by.join(",")}` : "";
34928
+ console.log(` ${c.entity_type}:${c.entity_id} twin of ${c.twin_id} [${c.identity}]${refs}`);
34929
+ }
34930
+ for (const t of d.targets) {
34931
+ const why = t.reason ? ` ${t.reason}` + (t.mapped_by.length > 0 ? ` by ${t.mapped_by.join(",")}` : "") + (t.referenced_by.length > 0 ? ` by ${t.referenced_by.join(",")}` : "") + (t.detail ? ` (${t.detail})` : "") : "";
34932
+ console.log(` ${t.outcome.padEnd(12)} ${t.entity_type}:${t.entity_id}${why}`);
34933
+ }
34934
+ }
34935
+ if (data.mode === "report" && data.twin_candidates > 0) {
34936
+ console.log("");
34937
+ console.log("Review each candidate, then delete it with: --hub <hub_id> --id <type>:<id> --dry-run, then --yes.");
34938
+ }
34939
+ }
34767
34940
  async function runRepairLegacyOrgGrants(flagArgs) {
34768
34941
  const USAGE2 = "wayai admin orgs repair-legacy-grants --all | --org <org_id> [--dry-run] [--yes] [--json]";
34769
34942
  const scoped = parseScopedTargetFlags(flagArgs, USAGE2, {
@@ -35398,6 +35571,9 @@ Usage:
35398
35571
  wayai admin hubs repair-team-orphans --all | --org <org_id> | --hub <hub_id> [--dry-run] [--yes] [--json]
35399
35572
  Purge hub_team_id references left dangling by a pre-cascade team deletion (silently empties a support agent's queue). Idempotent \u2014 run --dry-run first
35400
35573
 
35574
+ wayai admin hubs repair-branching-orphans --all | --org <org_id> | --hub <hub_id> [--id <type>:<id> ...] [--dry-run] [--yes] [--json]
35575
+ Without --id: report unmapped production rows that duplicate a mapped one (#4577). With --id: delete exactly those rows of one production hub, each only if no live preview maps it and nothing references it
35576
+
35401
35577
  wayai admin orgs repair-legacy-grants --all | --org <org_id> [--dry-run] [--yes] [--json]
35402
35578
  Repair org-admin roster rows keyed by email with a NULL user_email (pre-#3922 platform-admin adds): grant the real access they never conferred, or drop the phantom seat. Idempotent \u2014 run --dry-run first
35403
35579
 
@@ -35445,6 +35621,11 @@ Sources:
35445
35621
  its owner's Support list silently goes blank; a conversation pinned to a
35446
35622
  deleted team goes invisible to everyone. Idempotent \u2014 a healthy hub writes
35447
35623
  nothing, so re-running and --all are both safe.
35624
+ \`repair-branching-orphans\` handles the second copies overlapping publishes
35625
+ left in production (#4577): no mapping reaches them, so no later publish or
35626
+ diff sees them. It never picks rows itself \u2014 a deleted preview leaves live
35627
+ rows unmapped too \u2014 so without --id it only reports candidates, and with
35628
+ --id it deletes the named rows that pass its checks.
35448
35629
  orgs Org roster repair. \`repair-legacy-grants\` fixes member_grant rows the
35449
35630
  platform-admin org-admin add wrote before #3922: the email landed in the
35450
35631
  user_id column with user_email NULL. Auth reads UserDO, never member_grant,
@@ -35497,6 +35678,8 @@ Examples:
35497
35678
  wayai admin observability <hub-id> <conv-id> --message-id <msg-id> --json
35498
35679
  wayai admin sandbox exec "echo hi" --hub <hub-id> --connection <conn-id>
35499
35680
  wayai admin sandbox exec --cmd "curl -s https://api.github.com" --hub <hub-id> --connection <conn-id> --egress allowlist --allow api.github.com
35681
+ wayai admin hubs repair-branching-orphans --hub <prod-hub-id>
35682
+ wayai admin hubs repair-branching-orphans --hub <prod-hub-id> --id connection:<id> --dry-run
35500
35683
  wayai admin orgs repair-legacy-grants --all --dry-run
35501
35684
  wayai admin orgs repair-legacy-grants --org <org-id> --yes
35502
35685
  wayai admin harness disable