@wayai/cli 0.3.199 → 0.3.200

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
@@ -6920,7 +6920,7 @@ var init_chunk_T7KQKDET = __esm({
6920
6920
  }
6921
6921
  });
6922
6922
 
6923
- // ../../packages/core/dist/chunk-6SBJQYK2.js
6923
+ // ../../packages/core/dist/chunk-T2RKGBYS.js
6924
6924
  function containsKanbanPlaceholders(value) {
6925
6925
  if (value == null) return false;
6926
6926
  const serialized = typeof value === "string" ? value : JSON.stringify(value);
@@ -7236,6 +7236,23 @@ function refineToolConfig(value, ctx) {
7236
7236
  }
7237
7237
  }
7238
7238
  }
7239
+ function byLocale(entry) {
7240
+ const shape = Object.fromEntries(SUPPORTED_LOCALES.map((locale) => [locale, entry.optional()]));
7241
+ return external_exports.object(shape).strict();
7242
+ }
7243
+ function writeField(map) {
7244
+ return map.nullable().optional().transform(
7245
+ (value) => value && Object.keys(value).length === 0 ? null : value
7246
+ );
7247
+ }
7248
+ function refineLaneReferences(val, ctx) {
7249
+ const lanes = val.lanes;
7250
+ const statuses = val.kanban_statuses;
7251
+ if (lanes == null || statuses == null) return;
7252
+ for (const issue of validateLaneReferences(lanes, statuses)) {
7253
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["kanban_statuses", ...issue.path], message: issue.message });
7254
+ }
7255
+ }
7239
7256
  function resolveMonitorTrigger(monitorConfig) {
7240
7257
  if (!monitorConfig || typeof monitorConfig !== "object") return "idle";
7241
7258
  const raw = monitorConfig.trigger;
@@ -7793,6 +7810,20 @@ function refineHubAsCodeLanes(config, ctx) {
7793
7810
  }
7794
7811
  }
7795
7812
  }
7813
+ function refineHubAsCodePresentation(config, ctx) {
7814
+ const hub = config.hub;
7815
+ if (hub == null) return;
7816
+ for (const field of HUB_PRESENTATION_FIELDS) {
7817
+ const value = hub[field];
7818
+ if (value == null) continue;
7819
+ const result = HUB_PRESENTATION_SCHEMAS[field].safeParse(value);
7820
+ if (!result.success) {
7821
+ for (const issue of result.error.issues) {
7822
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["hub", field, ...issue.path], message: issue.message });
7823
+ }
7824
+ }
7825
+ }
7826
+ }
7796
7827
  function refineHubAsCodeEvals(config, ctx) {
7797
7828
  const evals = config.evals;
7798
7829
  if (!Array.isArray(evals)) return;
@@ -8198,9 +8229,9 @@ function refineHubAsCodeMonitorRulesOutput(config, ctx) {
8198
8229
  }
8199
8230
  });
8200
8231
  }
8201
- var PLACEHOLDER_TOKENS, ALLOWED_TYPES, SUBSCHEMA_OBJECT_KEYWORDS, SUBSCHEMA_LIST_KEYWORDS, SUBSCHEMA_MAP_KEYWORDS, MAX_SCHEMA_DEPTH, uuidSchema, USER_ID_REGEX, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, MESSAGE_ENVELOPE_HEADROOM_BYTES, MAX_AUDIO_FILE_BASE64_BYTES, 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, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, PREVIOUS_CONVERSATIONS_MAX, NATIVE_TOOL_NAMES, previousConversationsCountField, summarizationThresholdField, flagConditionSchema, MONITOR_TRIGGERS, monitorTriggerSchema, AUTOMATION_GATE_TRIGGERS, NON_FIRING_TRIGGERS, 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, MONITOR_GATE_AGENT_NAME_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, MONITOR_AUTOMATION_FIRE_ACTION_KINDS, MONITOR_AUTOMATION_ITEM_ACTION_KINDS, INSERT_NOTE_TOOL_NAME, RUN_MONITOR_TOOL_NAME, MONITOR_RULE_ALLOWED_NATIVE_TOOLS, MONITOR_RULE_REENTRY_TOOLS, MONITOR_RULE_REENTRY_TRACKS, AUTOMATION_FIRE_FLAG_CONDITIONS_MESSAGE, AUTOMATION_FIRE_INPUT_SHAPING_MESSAGE, AUTOMATION_ITEM_FLAG_CONDITIONS_MESSAGE, AUTOMATION_ITEM_INPUT_SHAPING_MESSAGE, AUTOMATION_GATE_KEY_MESSAGES, monitorConfigField, flagConditionsField, agentIdParam, listAgentsQuery, agentConnectionsQuery, createAgentBody, updateAgentBody, AGENT_PARAMETER_TYPES, AGENT_PARAMETER_NAME_REGEX, agentParameterCreateSchema, MAX_AGENT_PARAMETERS_PER_REQUEST, createAgentParametersBody, 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, MAX_RESOURCE_FILE_SIZE, 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, 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;
8202
- var init_chunk_6SBJQYK2 = __esm({
8203
- "../../packages/core/dist/chunk-6SBJQYK2.js"() {
8232
+ var PLACEHOLDER_TOKENS, ALLOWED_TYPES, SUBSCHEMA_OBJECT_KEYWORDS, SUBSCHEMA_LIST_KEYWORDS, SUBSCHEMA_MAP_KEYWORDS, MAX_SCHEMA_DEPTH, uuidSchema, USER_ID_REGEX, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, MESSAGE_ENVELOPE_HEADROOM_BYTES, MAX_AUDIO_FILE_BASE64_BYTES, 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, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, HUB_DISPLAY_NAME_MAX_CHARS, HUB_WELCOME_MESSAGE_MAX_CHARS, HUB_STARTER_QUESTIONS_MAX, HUB_STARTER_QUESTION_MAX_CHARS, displayName, welcomeMessage, starterQuestions, hubDisplayNamesSchema, hubWelcomeMessagesSchema, hubStarterQuestionsSchema, hubDisplayNamesField, hubWelcomeMessagesField, hubStarterQuestionsField, HUB_PRESENTATION_FIELDS, HUB_PRESENTATION_SCHEMAS, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, HUB_USERS_PAGE_SIZE_MAX, HUB_USERS_SEARCH_MAX, HUB_USERS_CHANNEL_TYPES, getHubUsersQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, MAX_EVAL_RETENTION_DAYS, MAX_END_USER_DAILY_MESSAGE_LIMIT, endUserDailyMessageLimitField, previewLabelField, hubTagsField, createHubBody, updateHubBody, HUB_TAG_CHANGE_REFUSED, hubTagChangeRefusalSchema, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, HUB_DIFF_SECTION_SET, HUB_DIFF_SECTIONS, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam, PREVIOUS_CONVERSATIONS_MAX, NATIVE_TOOL_NAMES, previousConversationsCountField, summarizationThresholdField, flagConditionSchema, MONITOR_TRIGGERS, monitorTriggerSchema, AUTOMATION_GATE_TRIGGERS, NON_FIRING_TRIGGERS, 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, MONITOR_GATE_AGENT_NAME_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, MONITOR_AUTOMATION_FIRE_ACTION_KINDS, MONITOR_AUTOMATION_ITEM_ACTION_KINDS, INSERT_NOTE_TOOL_NAME, RUN_MONITOR_TOOL_NAME, MONITOR_RULE_ALLOWED_NATIVE_TOOLS, MONITOR_RULE_REENTRY_TOOLS, MONITOR_RULE_REENTRY_TRACKS, AUTOMATION_FIRE_FLAG_CONDITIONS_MESSAGE, AUTOMATION_FIRE_INPUT_SHAPING_MESSAGE, AUTOMATION_ITEM_FLAG_CONDITIONS_MESSAGE, AUTOMATION_ITEM_INPUT_SHAPING_MESSAGE, AUTOMATION_GATE_KEY_MESSAGES, monitorConfigField, flagConditionsField, agentIdParam, listAgentsQuery, agentConnectionsQuery, createAgentBody, updateAgentBody, AGENT_PARAMETER_TYPES, AGENT_PARAMETER_NAME_REGEX, agentParameterCreateSchema, MAX_AGENT_PARAMETERS_PER_REQUEST, createAgentParametersBody, 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, MAX_RESOURCE_FILE_SIZE, 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, 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;
8233
+ var init_chunk_T2RKGBYS = __esm({
8234
+ "../../packages/core/dist/chunk-T2RKGBYS.js"() {
8204
8235
  "use strict";
8205
8236
  init_chunk_SNA2DXAC();
8206
8237
  init_chunk_MIWZOSPI();
@@ -8218,6 +8249,9 @@ var init_chunk_6SBJQYK2 = __esm({
8218
8249
  init_zod();
8219
8250
  init_zod();
8220
8251
  init_zod();
8252
+ init_zod();
8253
+ init_zod();
8254
+ init_zod();
8221
8255
  PLACEHOLDER_TOKENS = [
8222
8256
  "[KANBAN_STATUS_VALUES]",
8223
8257
  "[KANBAN_STATUS_NAMES]",
@@ -8618,6 +8652,250 @@ var init_chunk_6SBJQYK2 = __esm({
8618
8652
  keep_in_history: external_exports.boolean().optional()
8619
8653
  }).nullable()
8620
8654
  });
8655
+ primaryRegionSchema = external_exports.enum([
8656
+ "wnam",
8657
+ "enam",
8658
+ "sam",
8659
+ "weur",
8660
+ "eeur",
8661
+ "apac",
8662
+ "oc",
8663
+ "afr",
8664
+ "me"
8665
+ ]);
8666
+ placementSourceSchema = external_exports.enum([
8667
+ "hub_config",
8668
+ "org_config",
8669
+ "parent_cascade",
8670
+ "cf_colo",
8671
+ "country",
8672
+ "fallback"
8673
+ ]);
8674
+ orgIdParam = external_exports.object({
8675
+ id: uuidSchema
8676
+ });
8677
+ orgAdminIdParam = external_exports.object({
8678
+ id: uuidSchema,
8679
+ adminId: external_exports.string().min(1)
8680
+ });
8681
+ createOrganizationBody = external_exports.object({
8682
+ organization_name: external_exports.string().min(1, "organization_name is required"),
8683
+ // Write-once at creation; updateOrganizationBody does not accept this.
8684
+ primary_region: primaryRegionSchema.optional()
8685
+ });
8686
+ updateOrganizationBody = external_exports.object({
8687
+ organization_name: external_exports.string().min(1).optional(),
8688
+ organization_avatar_url: external_exports.string().url().nullable().optional(),
8689
+ timezone: external_exports.string().optional(),
8690
+ business_hours: external_exports.unknown().optional()
8691
+ }).passthrough();
8692
+ addOrgAdminBody = external_exports.object({
8693
+ user_email: external_exports.string().email("valid email is required")
8694
+ });
8695
+ HUB_DISPLAY_NAME_MAX_CHARS = 120;
8696
+ HUB_WELCOME_MESSAGE_MAX_CHARS = 1e3;
8697
+ HUB_STARTER_QUESTIONS_MAX = 4;
8698
+ HUB_STARTER_QUESTION_MAX_CHARS = 120;
8699
+ displayName = external_exports.string().trim().min(1).max(HUB_DISPLAY_NAME_MAX_CHARS);
8700
+ welcomeMessage = external_exports.string().trim().min(1).max(HUB_WELCOME_MESSAGE_MAX_CHARS);
8701
+ starterQuestions = external_exports.array(external_exports.string().trim().min(1).max(HUB_STARTER_QUESTION_MAX_CHARS)).min(1).max(HUB_STARTER_QUESTIONS_MAX);
8702
+ hubDisplayNamesSchema = byLocale(displayName);
8703
+ hubWelcomeMessagesSchema = byLocale(welcomeMessage);
8704
+ hubStarterQuestionsSchema = byLocale(starterQuestions);
8705
+ hubDisplayNamesField = writeField(hubDisplayNamesSchema);
8706
+ hubWelcomeMessagesField = writeField(hubWelcomeMessagesSchema);
8707
+ hubStarterQuestionsField = writeField(hubStarterQuestionsSchema);
8708
+ HUB_PRESENTATION_FIELDS = ["display_names", "welcome_messages", "starter_questions"];
8709
+ HUB_PRESENTATION_SCHEMAS = {
8710
+ display_names: hubDisplayNamesSchema,
8711
+ welcome_messages: hubWelcomeMessagesSchema,
8712
+ starter_questions: hubStarterQuestionsSchema
8713
+ };
8714
+ hubIdParam = external_exports.object({ id: uuidSchema });
8715
+ hubAdminIdParam = external_exports.object({ id: uuidSchema, adminId: uuidSchema });
8716
+ hubUserIdParam = external_exports.object({ id: uuidSchema, hubUserId: uuidSchema });
8717
+ hubIdentityIdParam = external_exports.object({ id: uuidSchema, identityId: uuidSchema });
8718
+ hubTeamIdParam = external_exports.object({ id: uuidSchema, teamId: uuidSchema });
8719
+ hubTeamUserDeleteParam = external_exports.object({ id: uuidSchema, teamUserId: uuidSchema });
8720
+ hubSchemaQuery = external_exports.object({ hub_id: uuidSchema });
8721
+ HUB_USERS_PAGE_SIZE_MAX = 200;
8722
+ HUB_USERS_SEARCH_MAX = 200;
8723
+ HUB_USERS_CHANNEL_TYPES = ["app", "whatsapp", "instagram", "telegram"];
8724
+ getHubUsersQuery = external_exports.object({
8725
+ cursor: external_exports.string().regex(/^[1-9][0-9]{0,14}$/, "Invalid cursor").optional(),
8726
+ page_size: external_exports.coerce.number().int().min(1).max(HUB_USERS_PAGE_SIZE_MAX).optional(),
8727
+ channel_type: external_exports.enum(HUB_USERS_CHANNEL_TYPES).optional(),
8728
+ search: external_exports.string().max(HUB_USERS_SEARCH_MAX).optional()
8729
+ });
8730
+ PREVIEW_LABEL_MAX_LENGTH = 60;
8731
+ MAX_ENDED_INDEX_RETENTION_DAYS = 730;
8732
+ MAX_EVAL_RETENTION_DAYS = 3650;
8733
+ MAX_END_USER_DAILY_MESSAGE_LIMIT = 1e4;
8734
+ endUserDailyMessageLimitField = external_exports.number().int().min(1).max(MAX_END_USER_DAILY_MESSAGE_LIMIT).nullable().optional();
8735
+ previewLabelField = external_exports.string().max(PREVIEW_LABEL_MAX_LENGTH).optional().nullable().transform((v) => {
8736
+ if (v == null) return null;
8737
+ const trimmed = v.trim();
8738
+ return trimmed || null;
8739
+ });
8740
+ hubTagsField = external_exports.array(external_exports.string()).nullable().optional();
8741
+ createHubBody = external_exports.object({
8742
+ organization_id: uuidSchema,
8743
+ hub_name: external_exports.string().min(1, "hub_name is required"),
8744
+ hub_description: external_exports.string().optional(),
8745
+ kanban_statuses: kanbanStatusesArraySchema.nullable().optional(),
8746
+ lanes: lanesArraySchema.nullable().optional(),
8747
+ // Optional preview label for the first preview. Server-owned thereafter
8748
+ // (change via `wayai relabel` / replicate); the push diff never writes it.
8749
+ preview_label: previewLabelField,
8750
+ // Write-once at creation; updateHubBody does not accept this.
8751
+ primary_region: primaryRegionSchema.optional(),
8752
+ // Org tag ids. Ids that name none of the org's tags are dropped; a hub created with
8753
+ // any is a tag change (`hubTagChangeRefusalSchema`).
8754
+ tags: hubTagsField,
8755
+ // Localized end-user presentation (`hub-presentation.ts`). Validated here too: the body is
8756
+ // `.passthrough()` and `createHub` writes all three, so an unvalidated map would persist.
8757
+ display_names: hubDisplayNamesField,
8758
+ welcome_messages: hubWelcomeMessagesField,
8759
+ starter_questions: hubStarterQuestionsField,
8760
+ // Validated here for the same reason: `createHub` writes it.
8761
+ end_user_daily_message_limit: endUserDailyMessageLimitField
8762
+ }).passthrough().superRefine(refineLaneReferences);
8763
+ updateHubBody = external_exports.object({
8764
+ support_model: external_exports.enum(["conversation", "account"]).optional(),
8765
+ unassigned_policy: external_exports.enum(["default_team", "auto_assign_random", "auto_assign_round_robin", "pull_queue"]).optional(),
8766
+ default_hub_team_id: uuidSchema.nullable().optional(),
8767
+ kanban_statuses: kanbanStatusesArraySchema.nullable().optional(),
8768
+ lanes: lanesArraySchema.nullable().optional(),
8769
+ // summarization_threshold_tokens relocated to the summarizer AGENT (PR4) — validated/
8770
+ // persisted via the agent path (.passthrough() agent body → HubDO column), not here.
8771
+ auto_close_inactive_days: external_exports.number().int().min(1).max(180).optional(),
8772
+ // Per-hub ConversationDO retention window (days) — keeps an ended conversation's DO
8773
+ // alive for post-hoc annotation. Default 7, max 30 — the floor of the retention
8774
+ // chain (≤ ended_index_retention_days ≤ effective storage retention).
8775
+ conversation_retention_days: external_exports.number().int().min(1).max(30).optional(),
8776
+ // Per-hub ended-conversation index retention window (days) — how long the warm
8777
+ // "Ended" tab + chat-hub continuous history serve a closed conversation before
8778
+ // the cleanup cron reaps its index row. Absent → DEFAULT_ENDED_INDEX_RETENTION_DAYS
8779
+ // (365). Re-clamped to the effective storage retention at reap time.
8780
+ ended_index_retention_days: external_exports.number().int().min(1).max(MAX_ENDED_INDEX_RETENTION_DAYS).optional(),
8781
+ // Per-hub eval-session retention window (days). null CLEARS the override (back to
8782
+ // the platform default); 0 disables retention for this hub (keep sessions forever).
8783
+ // Nullable — unlike the fields above, "unset" is a meaningful, settable state.
8784
+ eval_retention_days: external_exports.number().int().min(0).max(MAX_EVAL_RETENTION_DAYS).nullable().optional(),
8785
+ // Channel contact access control. Enum-validated explicitly (not via passthrough)
8786
+ // so `language`/`access_approval_role` can't reach the DB with an invalid value.
8787
+ language: external_exports.enum(["en", "pt", "es"]).optional(),
8788
+ access_request_message: external_exports.string().max(1e3).nullable().optional(),
8789
+ access_approval_role: external_exports.enum(["admin", "team"]).optional(),
8790
+ // AI-failure escalation. When an LLM provider outage persists past this many
8791
+ // minutes the conversation escalates to the team; null → code default. The two
8792
+ // message fields override the localized (hub.language) delay / hand-off notices;
8793
+ // null → localized default. Bounds validated here so out-of-range never persists.
8794
+ ai_failure_escalation_minutes: external_exports.number().int().min(1).max(60).nullable().optional(),
8795
+ ai_delay_message: external_exports.string().max(1e3).nullable().optional(),
8796
+ ai_handoff_message: external_exports.string().max(1e3).nullable().optional(),
8797
+ // Native-completion fallback connection for a degraded harness turn (PR 2.10b).
8798
+ // A NATIVE LLM (Agent) connection id on this hub; validated at set-time on the REST
8799
+ // PATCH (setup/hubs.ts rejects a non-existent / non-Agent / harness id) and re-checked
8800
+ // at fallback time in the turn seam (a stale/missing id simply no-ops). Nullable to clear it.
8801
+ fallback_connection_id: uuidSchema.nullable().optional(),
8802
+ // Rekor API connection used to reset/clear eval seed fixtures (gh #3090). A
8803
+ // connection id on this hub (a REST API (custom tool) connection whose base_url
8804
+ // is the Rekor API origin + a bearer/api_key `write:seeds` token). Validated at
8805
+ // set-time on the REST PATCH (setup/hubs.ts). Nullable to clear it.
8806
+ seed_connection_id: uuidSchema.nullable().optional(),
8807
+ // Org tag ids, replacing the hub's; null clears them. A change is refused to anyone
8808
+ // but an org admin (`hubTagChangeRefusalSchema`).
8809
+ tags: hubTagsField,
8810
+ // Localized end-user presentation (`hub-presentation.ts`): keys are supported locales only,
8811
+ // each map replaces the stored one, and null or an empty map clears it.
8812
+ display_names: hubDisplayNamesField,
8813
+ welcome_messages: hubWelcomeMessagesField,
8814
+ starter_questions: hubStarterQuestionsField,
8815
+ // Messages one end user may send the hub on the app channel per 24 hours; null removes it.
8816
+ end_user_daily_message_limit: endUserDailyMessageLimitField
8817
+ }).passthrough().superRefine(refineLaneReferences);
8818
+ HUB_TAG_CHANGE_REFUSED = "hub_tag_change_requires_org_admin";
8819
+ hubTagChangeRefusalSchema = external_exports.object({
8820
+ reason: external_exports.literal(HUB_TAG_CHANGE_REFUSED),
8821
+ operation: external_exports.enum(["update", "publish"]),
8822
+ hub_id: external_exports.string(),
8823
+ tags_added: external_exports.array(external_exports.string()),
8824
+ tags_removed: external_exports.array(external_exports.string())
8825
+ });
8826
+ addHubAdminBody = external_exports.object({
8827
+ user_email: external_exports.string().email("valid email is required")
8828
+ });
8829
+ addHubIdentityAuthorizationBody = external_exports.object({
8830
+ identity_value: external_exports.string().min(1),
8831
+ identity_type: external_exports.string().min(1),
8832
+ channel_type: external_exports.string().min(1)
8833
+ });
8834
+ contactDecisionBody = external_exports.object({
8835
+ contact_access_id: uuidSchema.optional(),
8836
+ identity_type: external_exports.string().min(1).optional(),
8837
+ identity_value: external_exports.string().min(1).optional(),
8838
+ channel_type: external_exports.string().min(1).optional(),
8839
+ channel_id: uuidSchema.optional(),
8840
+ connection_id: uuidSchema.optional(),
8841
+ user_id: uuidSchema.optional(),
8842
+ sender_display_name: external_exports.string().max(200).optional()
8843
+ });
8844
+ approveContactBody = contactDecisionBody.extend({
8845
+ user_name: external_exports.string().min(1).max(120).optional()
8846
+ });
8847
+ listContactAccessQuery = external_exports.object({
8848
+ status: external_exports.enum(["pending", "blocked"]).optional()
8849
+ });
8850
+ createHubTeamBody = external_exports.object({
8851
+ team_name: external_exports.string().min(1, "team_name is required")
8852
+ }).strict();
8853
+ updateHubTeamBody = external_exports.object({
8854
+ team_name: external_exports.string().min(1).optional(),
8855
+ conversation_display_only_if_claimed: external_exports.boolean().optional(),
8856
+ team_access_rule: external_exports.string().optional(),
8857
+ initial_team: external_exports.boolean().optional()
8858
+ }).strict();
8859
+ addHubTeamUserBody = external_exports.object({
8860
+ user_email: external_exports.string().email("valid email is required")
8861
+ });
8862
+ reassignHubUserBody = external_exports.object({
8863
+ hub_team_id: uuidSchema.nullable()
8864
+ });
8865
+ replicatePreviewBody = external_exports.object({
8866
+ preview_label: previewLabelField
8867
+ });
8868
+ HUB_DIFF_SECTION_SET = {
8869
+ agents: true,
8870
+ agent_parameters: true,
8871
+ connections: true,
8872
+ mcp_tools: true,
8873
+ tools: true,
8874
+ channels: true,
8875
+ states: true,
8876
+ teams: true,
8877
+ resources: true,
8878
+ resource_folders: true,
8879
+ resource_files: true,
8880
+ agent_resources: true,
8881
+ message_templates: true,
8882
+ contact_lists: true,
8883
+ automations: true,
8884
+ evals: true
8885
+ };
8886
+ HUB_DIFF_SECTIONS = Object.keys(HUB_DIFF_SECTION_SET);
8887
+ updateChannelTestIdentitiesBody = external_exports.object({
8888
+ test_identities: external_exports.array(external_exports.string().max(320)).max(1e3)
8889
+ });
8890
+ claimCodeChannelParam = external_exports.object({
8891
+ id: uuidSchema,
8892
+ channelId: uuidSchema
8893
+ });
8894
+ claimCodeDeleteParam = external_exports.object({
8895
+ id: uuidSchema,
8896
+ channelId: uuidSchema,
8897
+ code: external_exports.string().regex(/^[A-Za-z0-9]{6}$/, "Invalid claim code format").transform((s) => s.toUpperCase())
8898
+ });
8621
8899
  PREVIOUS_CONVERSATIONS_MAX = 20;
8622
8900
  NATIVE_TOOL_NAMES = new Set(NATIVE_TOOLS.map((t) => t.tool_name));
8623
8901
  previousConversationsCountField = external_exports.number().int().min(0).max(PREVIOUS_CONVERSATIONS_MAX).nullable().optional();
@@ -9266,7 +9544,9 @@ var init_chunk_6SBJQYK2 = __esm({
9266
9544
  hubAsCodeConfigSchema = external_exports.object({
9267
9545
  version: external_exports.literal(1),
9268
9546
  hub: external_exports.object({
9269
- name: external_exports.string().min(1, "config.hub.name is required")
9547
+ name: external_exports.string().min(1, "config.hub.name is required"),
9548
+ // Apply writes it as it comes, so this is its validation on push and diff.
9549
+ end_user_daily_message_limit: endUserDailyMessageLimitField
9270
9550
  }).passthrough(),
9271
9551
  states: external_exports.array(hubAsCodeStateSchema).optional(),
9272
9552
  resources: boundedHubAsCodeResourcesSchema.optional()
@@ -9274,6 +9554,7 @@ var init_chunk_6SBJQYK2 = __esm({
9274
9554
  refineHubAsCodeCustomTools(config, ctx);
9275
9555
  refineHubAsCodeKanbanStatuses(config, ctx);
9276
9556
  refineHubAsCodeLanes(config, ctx);
9557
+ refineHubAsCodePresentation(config, ctx);
9277
9558
  refineHubAsCodeEvals(config, ctx);
9278
9559
  refineHubAsCodeEvalAttachments(config, ctx);
9279
9560
  refineHubAsCodeCallOpenings(config, ctx);
@@ -9443,15 +9724,7 @@ var init_chunk_6SBJQYK2 = __esm({
9443
9724
  }
9444
9725
  });
9445
9726
 
9446
- // ../../packages/core/dist/chunk-Z6GC65RQ.js
9447
- function refineLaneReferences(val, ctx) {
9448
- const lanes = val.lanes;
9449
- const statuses = val.kanban_statuses;
9450
- if (lanes == null || statuses == null) return;
9451
- for (const issue of validateLaneReferences(lanes, statuses)) {
9452
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["kanban_statuses", ...issue.path], message: issue.message });
9453
- }
9454
- }
9727
+ // ../../packages/core/dist/chunk-FRU7E62M.js
9455
9728
  function cacheReconcileIdCount(body) {
9456
9729
  return body.conversations.length + body.histories.reduce((n, history) => n + history.conversation_ids.length, 0) + body.threads.length;
9457
9730
  }
@@ -9511,13 +9784,13 @@ function parseCommunityLessonVideoUrl(url) {
9511
9784
  }
9512
9785
  return id !== void 0 && YOUTUBE_ID.test(id) ? { provider: "youtube", id } : null;
9513
9786
  }
9514
- var primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, MAX_EVAL_RETENTION_DAYS, previewLabelField, hubTagsField, createHubBody, updateHubBody, HUB_TAG_CHANGE_REFUSED, hubTagChangeRefusalSchema, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, HUB_DIFF_SECTION_SET, HUB_DIFF_SECTIONS, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery, 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, 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, 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, recordAiDisclosureAcceptanceBody, activityQuery, deletionModeSchema, deletionRequestBody, CACHE_RECONCILE_MAX_IDS, CACHE_RECONCILE_MAX_HUBS, cacheReconcileScopeSchema, cachedConversationPageSchema, cachedHistoryThreadSchema, cachedPeopleThreadSchema, cacheReconcileBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, conversationHubQuery, 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, SIGN_URL_MAX_EXPIRES_IN_SECONDS, signUrlBody, templateIdParam, listTemplatesQuery, deleteTemplateQuery, templateStatusQuery, createTemplateBody, updateTemplateBody, submitTemplateBody, testTemplateBody, CONTACT_ENVIRONMENTS, CONTACT_NAME_MAX, CONTACT_EMAIL_MAX, CONTACT_PHONE_INPUT_MAX, CONTACT_INSTAGRAM_SID_MAX, CONTACT_METADATA_MAX_BYTES, CONTACT_LABEL_MAX, CONTACT_LABELS_MAX, CONTACT_SCOPE_TAGS_MAX, CONTACT_PAGE_MAX, CONTACT_IMPORT_BATCH_MAX, CONTACT_SEARCH_MAX, CONTACT_LIST_NAME_MAX, CONTACT_LIST_NAME_REGEX, CONTACT_LIST_DESCRIPTION_MAX, CONTACT_LIST_FILTER_MAX, CONTACT_LIST_PINS_PER_REQUEST_MAX, SUPPRESSION_SCOPES, SUPPRESSION_ID_REGEX, contactName, contactPhone, contactEmail, contactInstagramSid, contactLabel, contactLabels, contactMetadata, scopeTagIds, contactVisibilitySchema, hasIdentity, IDENTITY_REQUIRED, contactBookOrgQuery, contactBookContactParam, contactBookListParam, contactBookHubParam, contactBookPageQuery, listContactBookContactsQuery, listHubContactBookContactsQuery, contactBookLinkCandidatesQuery, listContactBookListMembersQuery, contactRowFields, createContactBookContactBody, updateContactBookContactBody, contactImportRowSchema, importContactBookContactsBody, linkContactBookContactBody, listName, contactListFilterSchema, createContactBookListBody, updateContactBookListBody, updateContactBookListPinsBody, suppressionIdentitySchema, createContactBookSuppressionBody, contactBookSuppressionParam, listContactBookSuppressionsQuery, CONTACT_BOOK_EMAIL_UNSUBSCRIBE_PATH, contactBookEmailUnsubscribeTokenSchema, contactBookEmailUnsubscribeQuery, orgListReferenceSchema, hubListNameSchema, HUB_LIST_FILTER_REQUIRED, hubContactListFilterSchema, hubContactListIdParam, hubContactListHubQuery, description, createHubContactListBody, updateHubContactListBody, AUTOMATION_TRIGGER_TYPES, AUTOMATION_EVENT_TYPES, AUTOMATION_TARGET_TYPES, AUTOMATION_ACTION_TYPES, AUTOMATION_CHANNEL_TYPES, AUTOMATION_PURPOSES, AUTOMATION_NAME_MAX, AUTOMATION_DESCRIPTION_MAX, AUTOMATION_INSTRUCTIONS_MAX, AUTOMATION_TEXT_MAX, AUTOMATION_CRON_MAX, AUTOMATION_WEBHOOK_AUTHS, AUTOMATION_WEBHOOK_HEADERS, AUTOMATION_WEBHOOK_BODY_MAX_BYTES, AUTOMATION_WEBHOOK_HEADER_NAME_MAX, AUTOMATION_WEBHOOK_MOUNT, WEBHOOK_RESERVED_HEADERS, automationTriggerSchema, automationTargetSchema, automationActionSchema, automationGateSchema, automationName, automationDescription, automationIdParam, automationHubQuery, automationWebhookParams, AUTOMATION_RUNS_PAGE_MAX, listAutomationRunsQuery, createAutomationBody, updateAutomationBody, AUTOMATION_ALERT_CATEGORIES, AUTOMATION_BLOCKED_ALERT_CATEGORY, VERSION_PART, MOBILE_APP_VERSION_RE, mobileAppVersionSchema, MOBILE_PLATFORMS, mobilePlatformSchema, mobileVersionPolicyQuery, mobileVersionPolicySchema, mobileVersionPolicyResponse, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, AUTOMATION_GATE_EVALUATIONS_PER_OPERATION_BOUND, automationGateEvaluationsPerOperation, 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, 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, MAX_NAME_LENGTH, MAX_VALUE_LENGTH, MAX_TAGS, MAX_TAG_LENGTH, MAX_SCOPE_HUBS, MAX_SCOPE_TAGS, vaultSecretScopeSchema, vaultCreateBody, vaultUpdateBody, MAX_NAME_LENGTH2, MAX_HUBS_PER_GRANT, MAX_HUB_TAGS_PER_GRANT, MAX_GRANTS, permissionEnum, grantScopeSchema, grantSchema, createTokenBody, tokenOrgIdParam, invitePreviewQuery, inviteRolePreviewResponse, inviteContactPreviewResponse, invitePreviewResponse, inviteUnsubscribeBody, 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, PEOPLE_CONTACT_PAGE_MAX, PEOPLE_CONTACT_PAGE_DEFAULT, PEOPLE_CONTACT_EMAIL_MAX_LENGTH, peopleUserIdSchema, peopleInviteEmailSchema, peopleContactInviteBody, peopleContactInviteIdParam, peopleContactUserIdParam, peopleContactBlockBody, peopleContactPageQuery, peopleOutgoingInviteSchema, peopleContactPersonSchema, peopleContactSchema, peopleIncomingInviteSchema, peopleBlockedUserSchema, PEOPLE_THREAD_MESSAGE_MAX_LENGTH, PEOPLE_THREAD_MESSAGES_PAGE_MAX, PEOPLE_THREAD_PAGE_MAX, PEOPLE_THREAD_PAGE_DEFAULT, PEOPLE_GROUP_NAME_MAX_LENGTH, PEOPLE_GROUP_AVATAR_URL_MAX_LENGTH, PEOPLE_THREAD_ATTACHMENT_MAX_BYTES, PEOPLE_THREAD_ATTACHMENT_NAME_MAX_LENGTH, PEOPLE_ATTACHMENT_STORAGE_PER_USER_BYTES, PEOPLE_THREAD_ATTACHMENT_MAX_MB, PEOPLE_THREAD_ATTACHMENT_URL_TTL_SECONDS, PEOPLE_THREAD_ATTACHMENT_URLS_MAX, peopleThreadIdParam, peopleThreadMessageIdParam, peopleThreadListQuery, peopleThreadMessagesQuery, peopleThreadAttachmentUploadSchema, peopleThreadSendBody, peopleThreadAttachmentUrlsBody, peopleThreadReadBody, peopleThreadSettingsBody, peopleGroupNameSchema, peopleGroupAvatarUrlSchema, peopleGroupCreateBody, peopleOrgDirectBody, peopleGroupUpdateBody, peopleGroupInviteBody, peopleOrgErasureBody, peopleGroupLeaveBody, peopleGroupInviteIdParam, peopleGroupIncomingInviteIdParam, peopleGroupMemberParam, peopleThreadKindSchema, peopleThreadMemberSchema, peopleThreadLastMessageSchema, peopleGroupRoleSchema, peopleGroupSummarySchema, peopleThreadSummarySchema, peopleThreadAttachmentSchema, peopleThreadMessageSchema, peopleGroupMemberSchema, peopleGroupSentInviteSchema, peopleGroupIncomingInviteSchema, PEOPLE_REPORT_DETAILS_MAX_LENGTH, peopleReportReasonSchema, reportDetailsSchema, reportFields, peopleReportBody, PEOPLE_MODERATION_NOTE_MAX_LENGTH, ADMIN_PEOPLE_REPORTS_PAGE_MAX, ADMIN_PEOPLE_REPORTS_PAGE_DEFAULT, peopleModerationActionSchema, moderationNoteSchema, adminPeopleReportListQuery, adminPeopleReportIdParam, adminPeopleMessageRemovalBody, adminPeopleSuspendBody, adminPeopleNoteBody, COMMUNITIES_PER_ORG_MAX, COMMUNITY_NAME_MAX_LENGTH, COMMUNITY_REGISTRY_CLOSED_REASON, COMMUNITY_JOIN_SOURCE_MAX_LENGTH, COMMUNITY_JOIN_FLOW_TOKEN_MAX_LENGTH, COMMUNITY_ROOM_NAME_MAX_LENGTH, COMMUNITY_MESSAGE_MAX_LENGTH, COMMUNITY_MESSAGES_PAGE_SIZE, COMMUNITY_ATTACHMENT_URLS_MAX, COMMUNITY_POST_TITLE_MAX_LENGTH, COMMUNITY_POST_SEARCH_MAX_LENGTH, COMMUNITY_RULES_MAX_LENGTH, COMMUNITY_SLOW_MODE_MAX_SECONDS, COMMUNITY_COURSES_LABEL_MAX_LENGTH, COMMUNITY_LIVE_TICKET_PREFIX, communityNameSchema, adminCreateCommunityBody, communityIdParam, communityJoinTokenSchema, communityJoinSourceSchema, communityJoinPreviewQuery, communityJoinBody, communityRoomKindSchema, communityRoomNameSchema, communityRoomIdParam, communityMessageIdParam, communityRoomCreateBody, communityRoomUpdateBody, communityMessagesQuery, communityMessageBodySchema, communityPostTitleSchema, communityAttachmentUploadSchema, communitySendBody, communityEditBody, communityPostIdParam, communityPostsQuery, communityAnswerBody, communityReadBody, communityAttachmentUrlsBody, communityPersonParam, communityOrgParam, communityPeopleQuery, communityCoursesLabelSchema, communitySettingsBody, communityBanBody, communityLockBody, communityPinBody, communityModLogQuery, communityReportsQuery, communityReportIdParam, communityLiveTicketSchema, communityLiveQuery, communityMuteBody, communityEmailUnsubscribeTokenSchema, COMMUNITY_EMAIL_UNSUBSCRIBE_PATH, communityEmailUnsubscribeQuery, COMMUNITY_COURSE_TITLE_MAX_LENGTH, COMMUNITY_COURSE_DESCRIPTION_MAX_LENGTH, COMMUNITY_LESSON_BODY_MAX_LENGTH, COMMUNITY_LESSON_LINKS_MAX, COMMUNITY_LESSON_URL_MAX_LENGTH, YOUTUBE_ID, YOUTUBE_HOSTS, YOUTU_BE, YOUTUBE_ID_PATH, communityCourseIdParam, communityCourseModuleIdParam, communityLessonIdParam, communityCourseTitleSchema, communityCourseDescriptionSchema, communityCoursePositionSchema, communityLessonVideoUrlSchema, communityLessonLinkSchema, communityLessonLinksSchema, communityLessonBodySchema, communityCourseCreateBody, communityCourseUpdateBody, communityModuleCreateBody, communityModuleUpdateBody, communityLessonCreateBody, communityLessonUpdateBody, COMMUNITY_LESSON_TREE_MAX_BYTES, COMMUNITY_LESSON_LINK_PROTOCOLS, LINK_SCHEME;
9515
- var init_chunk_Z6GC65RQ = __esm({
9516
- "../../packages/core/dist/chunk-Z6GC65RQ.js"() {
9787
+ var connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery, 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, 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, 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, recordAiDisclosureAcceptanceBody, activityQuery, deletionModeSchema, deletionRequestBody, CACHE_RECONCILE_MAX_IDS, CACHE_RECONCILE_MAX_HUBS, cacheReconcileScopeSchema, cachedConversationPageSchema, cachedHistoryThreadSchema, cachedPeopleThreadSchema, cacheReconcileBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, conversationHubQuery, 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, SIGN_URL_MAX_EXPIRES_IN_SECONDS, signUrlBody, templateIdParam, listTemplatesQuery, deleteTemplateQuery, templateStatusQuery, createTemplateBody, updateTemplateBody, submitTemplateBody, testTemplateBody, CONTACT_ENVIRONMENTS, CONTACT_NAME_MAX, CONTACT_EMAIL_MAX, CONTACT_PHONE_INPUT_MAX, CONTACT_INSTAGRAM_SID_MAX, CONTACT_METADATA_MAX_BYTES, CONTACT_LABEL_MAX, CONTACT_LABELS_MAX, CONTACT_SCOPE_TAGS_MAX, CONTACT_PAGE_MAX, CONTACT_IMPORT_BATCH_MAX, CONTACT_SEARCH_MAX, CONTACT_LIST_NAME_MAX, CONTACT_LIST_NAME_REGEX, CONTACT_LIST_DESCRIPTION_MAX, CONTACT_LIST_FILTER_MAX, CONTACT_LIST_PINS_PER_REQUEST_MAX, SUPPRESSION_SCOPES, SUPPRESSION_ID_REGEX, contactName, contactPhone, contactEmail, contactInstagramSid, contactLabel, contactLabels, contactMetadata, scopeTagIds, contactVisibilitySchema, hasIdentity, IDENTITY_REQUIRED, contactBookOrgQuery, contactBookContactParam, contactBookListParam, contactBookHubParam, contactBookPageQuery, listContactBookContactsQuery, listHubContactBookContactsQuery, contactBookLinkCandidatesQuery, listContactBookListMembersQuery, contactRowFields, createContactBookContactBody, updateContactBookContactBody, contactImportRowSchema, importContactBookContactsBody, linkContactBookContactBody, listName, contactListFilterSchema, createContactBookListBody, updateContactBookListBody, updateContactBookListPinsBody, suppressionIdentitySchema, createContactBookSuppressionBody, contactBookSuppressionParam, listContactBookSuppressionsQuery, CONTACT_BOOK_EMAIL_UNSUBSCRIBE_PATH, contactBookEmailUnsubscribeTokenSchema, contactBookEmailUnsubscribeQuery, orgListReferenceSchema, hubListNameSchema, HUB_LIST_FILTER_REQUIRED, hubContactListFilterSchema, hubContactListIdParam, hubContactListHubQuery, description, createHubContactListBody, updateHubContactListBody, AUTOMATION_TRIGGER_TYPES, AUTOMATION_EVENT_TYPES, AUTOMATION_TARGET_TYPES, AUTOMATION_ACTION_TYPES, AUTOMATION_CHANNEL_TYPES, AUTOMATION_PURPOSES, AUTOMATION_NAME_MAX, AUTOMATION_DESCRIPTION_MAX, AUTOMATION_INSTRUCTIONS_MAX, AUTOMATION_TEXT_MAX, AUTOMATION_CRON_MAX, AUTOMATION_WEBHOOK_AUTHS, AUTOMATION_WEBHOOK_HEADERS, AUTOMATION_WEBHOOK_BODY_MAX_BYTES, AUTOMATION_WEBHOOK_HEADER_NAME_MAX, AUTOMATION_WEBHOOK_MOUNT, WEBHOOK_RESERVED_HEADERS, automationTriggerSchema, automationTargetSchema, automationActionSchema, automationGateSchema, automationName, automationDescription, automationIdParam, automationHubQuery, automationWebhookParams, AUTOMATION_RUNS_PAGE_MAX, listAutomationRunsQuery, createAutomationBody, updateAutomationBody, AUTOMATION_ALERT_CATEGORIES, AUTOMATION_BLOCKED_ALERT_CATEGORY, automationEventSubscriberParam, VERSION_PART, MOBILE_APP_VERSION_RE, mobileAppVersionSchema, MOBILE_PLATFORMS, mobilePlatformSchema, mobileVersionPolicyQuery, mobileVersionPolicySchema, mobileVersionPolicyResponse, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, AUTOMATION_GATE_EVALUATIONS_PER_OPERATION_BOUND, automationGateEvaluationsPerOperation, AUTOMATION_RUN_RETENTION_DAYS_MAX, automationRunRetentionDays, 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, 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, MAX_NAME_LENGTH, MAX_VALUE_LENGTH, MAX_TAGS, MAX_TAG_LENGTH, MAX_SCOPE_HUBS, MAX_SCOPE_TAGS, vaultSecretScopeSchema, vaultCreateBody, vaultUpdateBody, MAX_NAME_LENGTH2, MAX_HUBS_PER_GRANT, MAX_HUB_TAGS_PER_GRANT, MAX_GRANTS, permissionEnum, grantScopeSchema, grantSchema, createTokenBody, tokenOrgIdParam, invitePreviewQuery, inviteRolePreviewResponse, inviteContactPreviewResponse, invitePreviewResponse, inviteUnsubscribeBody, 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, PEOPLE_CONTACT_PAGE_MAX, PEOPLE_CONTACT_PAGE_DEFAULT, PEOPLE_CONTACT_EMAIL_MAX_LENGTH, peopleUserIdSchema, peopleInviteEmailSchema, peopleContactInviteBody, peopleContactInviteIdParam, peopleContactUserIdParam, peopleContactBlockBody, peopleContactPageQuery, peopleOutgoingInviteSchema, peopleContactPersonSchema, peopleContactSchema, peopleIncomingInviteSchema, peopleBlockedUserSchema, PEOPLE_THREAD_MESSAGE_MAX_LENGTH, PEOPLE_THREAD_MESSAGES_PAGE_MAX, PEOPLE_THREAD_PAGE_MAX, PEOPLE_THREAD_PAGE_DEFAULT, PEOPLE_GROUP_NAME_MAX_LENGTH, PEOPLE_GROUP_AVATAR_URL_MAX_LENGTH, PEOPLE_THREAD_ATTACHMENT_MAX_BYTES, PEOPLE_THREAD_ATTACHMENT_NAME_MAX_LENGTH, PEOPLE_ATTACHMENT_STORAGE_PER_USER_BYTES, PEOPLE_THREAD_ATTACHMENT_MAX_MB, PEOPLE_THREAD_ATTACHMENT_URL_TTL_SECONDS, PEOPLE_THREAD_ATTACHMENT_URLS_MAX, peopleThreadIdParam, peopleThreadMessageIdParam, peopleThreadListQuery, peopleThreadMessagesQuery, peopleThreadAttachmentUploadSchema, peopleThreadSendBody, peopleThreadAttachmentUrlsBody, peopleThreadReadBody, peopleThreadSettingsBody, peopleGroupNameSchema, peopleGroupAvatarUrlSchema, peopleGroupCreateBody, peopleOrgDirectBody, peopleGroupUpdateBody, peopleGroupInviteBody, peopleOrgErasureBody, peopleGroupLeaveBody, peopleGroupInviteIdParam, peopleGroupIncomingInviteIdParam, peopleGroupMemberParam, peopleThreadKindSchema, peopleThreadMemberSchema, peopleThreadLastMessageSchema, peopleGroupRoleSchema, peopleGroupSummarySchema, peopleThreadSummarySchema, peopleThreadAttachmentSchema, peopleThreadMessageSchema, peopleGroupMemberSchema, peopleGroupSentInviteSchema, peopleGroupIncomingInviteSchema, PEOPLE_REPORT_DETAILS_MAX_LENGTH, peopleReportReasonSchema, reportDetailsSchema, reportFields, peopleReportBody, PEOPLE_MODERATION_NOTE_MAX_LENGTH, ADMIN_PEOPLE_REPORTS_PAGE_MAX, ADMIN_PEOPLE_REPORTS_PAGE_DEFAULT, peopleModerationActionSchema, moderationNoteSchema, adminPeopleReportListQuery, adminPeopleReportIdParam, adminPeopleMessageRemovalBody, adminPeopleSuspendBody, adminPeopleNoteBody, COMMUNITIES_PER_ORG_MAX, COMMUNITY_NAME_MAX_LENGTH, COMMUNITY_REGISTRY_CLOSED_REASON, COMMUNITY_JOIN_SOURCE_MAX_LENGTH, COMMUNITY_JOIN_FLOW_TOKEN_MAX_LENGTH, COMMUNITY_ROOM_NAME_MAX_LENGTH, COMMUNITY_MESSAGE_MAX_LENGTH, COMMUNITY_MESSAGES_PAGE_SIZE, COMMUNITY_ATTACHMENT_URLS_MAX, COMMUNITY_POST_TITLE_MAX_LENGTH, COMMUNITY_POST_SEARCH_MAX_LENGTH, COMMUNITY_RULES_MAX_LENGTH, COMMUNITY_SLOW_MODE_MAX_SECONDS, COMMUNITY_COURSES_LABEL_MAX_LENGTH, COMMUNITY_LIVE_TICKET_PREFIX, communityNameSchema, adminCreateCommunityBody, communityIdParam, communityJoinTokenSchema, communityJoinSourceSchema, communityJoinPreviewQuery, communityJoinBody, communityRoomKindSchema, communityRoomNameSchema, communityRoomIdParam, communityMessageIdParam, communityRoomCreateBody, communityRoomUpdateBody, communityMessagesQuery, communityMessageBodySchema, communityPostTitleSchema, communityAttachmentUploadSchema, communitySendBody, communityEditBody, communityPostIdParam, communityPostsQuery, communityAnswerBody, communityReadBody, communityAttachmentUrlsBody, communityPersonParam, communityOrgParam, communityPeopleQuery, communityCoursesLabelSchema, communitySettingsBody, communityBanBody, communityLockBody, communityPinBody, communityModLogQuery, communityReportsQuery, communityReportIdParam, communityLiveTicketSchema, communityLiveQuery, communityMuteBody, communityEmailUnsubscribeTokenSchema, COMMUNITY_EMAIL_UNSUBSCRIBE_PATH, communityEmailUnsubscribeQuery, COMMUNITY_COURSE_TITLE_MAX_LENGTH, COMMUNITY_COURSE_DESCRIPTION_MAX_LENGTH, COMMUNITY_LESSON_BODY_MAX_LENGTH, COMMUNITY_LESSON_LINKS_MAX, COMMUNITY_LESSON_URL_MAX_LENGTH, YOUTUBE_ID, YOUTUBE_HOSTS, YOUTU_BE, YOUTUBE_ID_PATH, communityCourseIdParam, communityCourseModuleIdParam, communityLessonIdParam, communityCourseTitleSchema, communityCourseDescriptionSchema, communityCoursePositionSchema, communityLessonVideoUrlSchema, communityLessonLinkSchema, communityLessonLinksSchema, communityLessonBodySchema, communityCourseCreateBody, communityCourseUpdateBody, communityModuleCreateBody, communityModuleUpdateBody, communityLessonCreateBody, communityLessonUpdateBody, COMMUNITY_LESSON_TREE_MAX_BYTES, COMMUNITY_LESSON_LINK_PROTOCOLS, LINK_SCHEME, adminSetGuideHubBody, GUIDE_HUB_INELIGIBLE_REASON;
9788
+ var init_chunk_FRU7E62M = __esm({
9789
+ "../../packages/core/dist/chunk-FRU7E62M.js"() {
9517
9790
  "use strict";
9518
9791
  init_chunk_VORPHGDT();
9519
9792
  init_chunk_POL7B3EM();
9520
- init_chunk_6SBJQYK2();
9793
+ init_chunk_T2RKGBYS();
9521
9794
  init_chunk_MIWZOSPI();
9522
9795
  init_chunk_3NS3HULK();
9523
9796
  init_chunk_JWPRTSIB();
@@ -9575,207 +9848,6 @@ var init_chunk_Z6GC65RQ = __esm({
9575
9848
  init_zod();
9576
9849
  init_zod();
9577
9850
  init_zod();
9578
- init_zod();
9579
- primaryRegionSchema = external_exports.enum([
9580
- "wnam",
9581
- "enam",
9582
- "sam",
9583
- "weur",
9584
- "eeur",
9585
- "apac",
9586
- "oc",
9587
- "afr",
9588
- "me"
9589
- ]);
9590
- placementSourceSchema = external_exports.enum([
9591
- "hub_config",
9592
- "org_config",
9593
- "parent_cascade",
9594
- "cf_colo",
9595
- "country",
9596
- "fallback"
9597
- ]);
9598
- orgIdParam = external_exports.object({
9599
- id: uuidSchema
9600
- });
9601
- orgAdminIdParam = external_exports.object({
9602
- id: uuidSchema,
9603
- adminId: external_exports.string().min(1)
9604
- });
9605
- createOrganizationBody = external_exports.object({
9606
- organization_name: external_exports.string().min(1, "organization_name is required"),
9607
- // Write-once at creation; updateOrganizationBody does not accept this.
9608
- primary_region: primaryRegionSchema.optional()
9609
- });
9610
- updateOrganizationBody = external_exports.object({
9611
- organization_name: external_exports.string().min(1).optional(),
9612
- organization_avatar_url: external_exports.string().url().nullable().optional(),
9613
- timezone: external_exports.string().optional(),
9614
- business_hours: external_exports.unknown().optional()
9615
- }).passthrough();
9616
- addOrgAdminBody = external_exports.object({
9617
- user_email: external_exports.string().email("valid email is required")
9618
- });
9619
- hubIdParam = external_exports.object({ id: uuidSchema });
9620
- hubAdminIdParam = external_exports.object({ id: uuidSchema, adminId: uuidSchema });
9621
- hubUserIdParam = external_exports.object({ id: uuidSchema, hubUserId: uuidSchema });
9622
- hubIdentityIdParam = external_exports.object({ id: uuidSchema, identityId: uuidSchema });
9623
- hubTeamIdParam = external_exports.object({ id: uuidSchema, teamId: uuidSchema });
9624
- hubTeamUserDeleteParam = external_exports.object({ id: uuidSchema, teamUserId: uuidSchema });
9625
- hubSchemaQuery = external_exports.object({ hub_id: uuidSchema });
9626
- PREVIEW_LABEL_MAX_LENGTH = 60;
9627
- MAX_ENDED_INDEX_RETENTION_DAYS = 730;
9628
- MAX_EVAL_RETENTION_DAYS = 3650;
9629
- previewLabelField = external_exports.string().max(PREVIEW_LABEL_MAX_LENGTH).optional().nullable().transform((v) => {
9630
- if (v == null) return null;
9631
- const trimmed = v.trim();
9632
- return trimmed || null;
9633
- });
9634
- hubTagsField = external_exports.array(external_exports.string()).nullable().optional();
9635
- createHubBody = external_exports.object({
9636
- organization_id: uuidSchema,
9637
- hub_name: external_exports.string().min(1, "hub_name is required"),
9638
- hub_description: external_exports.string().optional(),
9639
- kanban_statuses: kanbanStatusesArraySchema.nullable().optional(),
9640
- lanes: lanesArraySchema.nullable().optional(),
9641
- // Optional preview label for the first preview. Server-owned thereafter
9642
- // (change via `wayai relabel` / replicate); the push diff never writes it.
9643
- preview_label: previewLabelField,
9644
- // Write-once at creation; updateHubBody does not accept this.
9645
- primary_region: primaryRegionSchema.optional(),
9646
- // Org tag ids. Ids that name none of the org's tags are dropped; a hub created with
9647
- // any is a tag change (`hubTagChangeRefusalSchema`).
9648
- tags: hubTagsField
9649
- }).passthrough().superRefine(refineLaneReferences);
9650
- updateHubBody = external_exports.object({
9651
- support_model: external_exports.enum(["conversation", "account"]).optional(),
9652
- unassigned_policy: external_exports.enum(["default_team", "auto_assign_random", "auto_assign_round_robin", "pull_queue"]).optional(),
9653
- default_hub_team_id: uuidSchema.nullable().optional(),
9654
- kanban_statuses: kanbanStatusesArraySchema.nullable().optional(),
9655
- lanes: lanesArraySchema.nullable().optional(),
9656
- // summarization_threshold_tokens relocated to the summarizer AGENT (PR4) — validated/
9657
- // persisted via the agent path (.passthrough() agent body → HubDO column), not here.
9658
- auto_close_inactive_days: external_exports.number().int().min(1).max(180).optional(),
9659
- // Per-hub ConversationDO retention window (days) — keeps an ended conversation's DO
9660
- // alive for post-hoc annotation. Default 7, max 30 — the floor of the retention
9661
- // chain (≤ ended_index_retention_days ≤ effective storage retention).
9662
- conversation_retention_days: external_exports.number().int().min(1).max(30).optional(),
9663
- // Per-hub ended-conversation index retention window (days) — how long the warm
9664
- // "Ended" tab + chat-hub continuous history serve a closed conversation before
9665
- // the cleanup cron reaps its index row. Absent → DEFAULT_ENDED_INDEX_RETENTION_DAYS
9666
- // (365). Re-clamped to the effective storage retention at reap time.
9667
- ended_index_retention_days: external_exports.number().int().min(1).max(MAX_ENDED_INDEX_RETENTION_DAYS).optional(),
9668
- // Per-hub eval-session retention window (days). null CLEARS the override (back to
9669
- // the platform default); 0 disables retention for this hub (keep sessions forever).
9670
- // Nullable — unlike the fields above, "unset" is a meaningful, settable state.
9671
- eval_retention_days: external_exports.number().int().min(0).max(MAX_EVAL_RETENTION_DAYS).nullable().optional(),
9672
- // Channel contact access control. Enum-validated explicitly (not via passthrough)
9673
- // so `language`/`access_approval_role` can't reach the DB with an invalid value.
9674
- language: external_exports.enum(["en", "pt", "es"]).optional(),
9675
- access_request_message: external_exports.string().max(1e3).nullable().optional(),
9676
- access_approval_role: external_exports.enum(["admin", "team"]).optional(),
9677
- // AI-failure escalation. When an LLM provider outage persists past this many
9678
- // minutes the conversation escalates to the team; null → code default. The two
9679
- // message fields override the localized (hub.language) delay / hand-off notices;
9680
- // null → localized default. Bounds validated here so out-of-range never persists.
9681
- ai_failure_escalation_minutes: external_exports.number().int().min(1).max(60).nullable().optional(),
9682
- ai_delay_message: external_exports.string().max(1e3).nullable().optional(),
9683
- ai_handoff_message: external_exports.string().max(1e3).nullable().optional(),
9684
- // Native-completion fallback connection for a degraded harness turn (PR 2.10b).
9685
- // A NATIVE LLM (Agent) connection id on this hub; validated at set-time on the REST
9686
- // PATCH (setup/hubs.ts rejects a non-existent / non-Agent / harness id) and re-checked
9687
- // at fallback time in the turn seam (a stale/missing id simply no-ops). Nullable to clear it.
9688
- fallback_connection_id: uuidSchema.nullable().optional(),
9689
- // Rekor API connection used to reset/clear eval seed fixtures (gh #3090). A
9690
- // connection id on this hub (a REST API (custom tool) connection whose base_url
9691
- // is the Rekor API origin + a bearer/api_key `write:seeds` token). Validated at
9692
- // set-time on the REST PATCH (setup/hubs.ts). Nullable to clear it.
9693
- seed_connection_id: uuidSchema.nullable().optional(),
9694
- // Org tag ids, replacing the hub's; null clears them. A change is refused to anyone
9695
- // but an org admin (`hubTagChangeRefusalSchema`).
9696
- tags: hubTagsField
9697
- }).passthrough().superRefine(refineLaneReferences);
9698
- HUB_TAG_CHANGE_REFUSED = "hub_tag_change_requires_org_admin";
9699
- hubTagChangeRefusalSchema = external_exports.object({
9700
- reason: external_exports.literal(HUB_TAG_CHANGE_REFUSED),
9701
- operation: external_exports.enum(["update", "publish"]),
9702
- hub_id: external_exports.string(),
9703
- tags_added: external_exports.array(external_exports.string()),
9704
- tags_removed: external_exports.array(external_exports.string())
9705
- });
9706
- addHubAdminBody = external_exports.object({
9707
- user_email: external_exports.string().email("valid email is required")
9708
- });
9709
- addHubIdentityAuthorizationBody = external_exports.object({
9710
- identity_value: external_exports.string().min(1),
9711
- identity_type: external_exports.string().min(1),
9712
- channel_type: external_exports.string().min(1)
9713
- });
9714
- contactDecisionBody = external_exports.object({
9715
- contact_access_id: uuidSchema.optional(),
9716
- identity_type: external_exports.string().min(1).optional(),
9717
- identity_value: external_exports.string().min(1).optional(),
9718
- channel_type: external_exports.string().min(1).optional(),
9719
- channel_id: uuidSchema.optional(),
9720
- connection_id: uuidSchema.optional(),
9721
- user_id: uuidSchema.optional(),
9722
- sender_display_name: external_exports.string().max(200).optional()
9723
- });
9724
- approveContactBody = contactDecisionBody.extend({
9725
- user_name: external_exports.string().min(1).max(120).optional()
9726
- });
9727
- listContactAccessQuery = external_exports.object({
9728
- status: external_exports.enum(["pending", "blocked"]).optional()
9729
- });
9730
- createHubTeamBody = external_exports.object({
9731
- team_name: external_exports.string().min(1, "team_name is required")
9732
- }).strict();
9733
- updateHubTeamBody = external_exports.object({
9734
- team_name: external_exports.string().min(1).optional(),
9735
- conversation_display_only_if_claimed: external_exports.boolean().optional(),
9736
- team_access_rule: external_exports.string().optional(),
9737
- initial_team: external_exports.boolean().optional()
9738
- }).strict();
9739
- addHubTeamUserBody = external_exports.object({
9740
- user_email: external_exports.string().email("valid email is required")
9741
- });
9742
- reassignHubUserBody = external_exports.object({
9743
- hub_team_id: uuidSchema.nullable()
9744
- });
9745
- replicatePreviewBody = external_exports.object({
9746
- preview_label: previewLabelField
9747
- });
9748
- HUB_DIFF_SECTION_SET = {
9749
- agents: true,
9750
- agent_parameters: true,
9751
- connections: true,
9752
- mcp_tools: true,
9753
- tools: true,
9754
- channels: true,
9755
- states: true,
9756
- teams: true,
9757
- resources: true,
9758
- resource_folders: true,
9759
- resource_files: true,
9760
- agent_resources: true,
9761
- message_templates: true,
9762
- contact_lists: true,
9763
- automations: true,
9764
- evals: true
9765
- };
9766
- HUB_DIFF_SECTIONS = Object.keys(HUB_DIFF_SECTION_SET);
9767
- updateChannelTestIdentitiesBody = external_exports.object({
9768
- test_identities: external_exports.array(external_exports.string().max(320)).max(1e3)
9769
- });
9770
- claimCodeChannelParam = external_exports.object({
9771
- id: uuidSchema,
9772
- channelId: uuidSchema
9773
- });
9774
- claimCodeDeleteParam = external_exports.object({
9775
- id: uuidSchema,
9776
- channelId: uuidSchema,
9777
- code: external_exports.string().regex(/^[A-Za-z0-9]{6}$/, "Invalid claim code format").transform((s) => s.toUpperCase())
9778
- });
9779
9851
  connectionIdParam = external_exports.object({ id: uuidSchema });
9780
9852
  connectorIdParam = external_exports.object({ id: uuidSchema });
9781
9853
  listConnectionsQuery = external_exports.object({ hub_id: uuidSchema });
@@ -11551,6 +11623,8 @@ var init_chunk_Z6GC65RQ = __esm({
11551
11623
  cron: external_exports.string().trim().min(1).max(AUTOMATION_CRON_MAX).optional(),
11552
11624
  timezone: external_exports.string().trim().min(1).optional(),
11553
11625
  event: external_exports.enum(AUTOMATION_EVENT_TYPES).optional(),
11626
+ /** The production hub whose events an `event` trigger listens to; absent: this hub's own. */
11627
+ source_hub: external_exports.string().uuid().optional(),
11554
11628
  auth: external_exports.enum(AUTOMATION_WEBHOOK_AUTHS).optional(),
11555
11629
  header: external_exports.string().trim().min(1).max(AUTOMATION_WEBHOOK_HEADER_NAME_MAX).optional()
11556
11630
  }).strict();
@@ -11616,6 +11690,9 @@ var init_chunk_Z6GC65RQ = __esm({
11616
11690
  list_over_cap: "automation_list_over_cap"
11617
11691
  };
11618
11692
  AUTOMATION_BLOCKED_ALERT_CATEGORY = "automation_blocked";
11693
+ automationEventSubscriberParam = external_exports.object({
11694
+ subscriber_hub_id: external_exports.string().uuid()
11695
+ });
11619
11696
  VERSION_PART = "(0|[1-9][0-9]{0,5})";
11620
11697
  MOBILE_APP_VERSION_RE = new RegExp(`^${VERSION_PART}\\.${VERSION_PART}\\.${VERSION_PART}$`);
11621
11698
  mobileAppVersionSchema = external_exports.string().regex(MOBILE_APP_VERSION_RE, "must be a MAJOR.MINOR.PATCH version, e.g. 1.0.0");
@@ -11718,6 +11795,8 @@ var init_chunk_Z6GC65RQ = __esm({
11718
11795
  voiceCallMinuteOps = external_exports.number().int().min(0).max(MAX_VOICE_CALL_MINUTE_OPS);
11719
11796
  AUTOMATION_GATE_EVALUATIONS_PER_OPERATION_BOUND = 1e3;
11720
11797
  automationGateEvaluationsPerOperation = external_exports.number().int().min(1).max(AUTOMATION_GATE_EVALUATIONS_PER_OPERATION_BOUND);
11798
+ AUTOMATION_RUN_RETENTION_DAYS_MAX = 3650;
11799
+ automationRunRetentionDays = external_exports.number().int().min(1).max(AUTOMATION_RUN_RETENTION_DAYS_MAX);
11721
11800
  updatePlatformConfigBody = external_exports.object({
11722
11801
  free_plan_max_free_orgs_per_user: external_exports.number().int().min(0).optional(),
11723
11802
  /** Kill switch for admin debug-read endpoints. 0 = off, 1 = on. */
@@ -11759,6 +11838,8 @@ var init_chunk_Z6GC65RQ = __esm({
11759
11838
  communities_enabled: external_exports.number().int().min(0).max(1).optional(),
11760
11839
  /** How many automation gate evaluations bill one operation (`automationGateEvaluationsPerOperation`). */
11761
11840
  automation_gate_evaluations_per_operation: automationGateEvaluationsPerOperation.optional(),
11841
+ /** How many days a hub keeps an automation's runs (`automationRunRetentionDays`). */
11842
+ automation_run_retention_days: automationRunRetentionDays.optional(),
11762
11843
  /**
11763
11844
  * The mobile app version policy (`MOBILE_VERSION_POLICY_COLUMNS`), per platform: an install
11764
11845
  * below the minimum is blocked until it updates from the store; one below the recommended
@@ -12866,6 +12947,11 @@ var init_chunk_Z6GC65RQ = __esm({
12866
12947
  COMMUNITY_LESSON_TREE_MAX_BYTES = 512 * 1024;
12867
12948
  COMMUNITY_LESSON_LINK_PROTOCOLS = ["http", "https", "mailto"];
12868
12949
  LINK_SCHEME = new RegExp(`^(${COMMUNITY_LESSON_LINK_PROTOCOLS.join("|")}):`, "i");
12950
+ adminSetGuideHubBody = external_exports.object({
12951
+ hub_id: uuidSchema,
12952
+ dry_run: external_exports.boolean().optional()
12953
+ }).strict();
12954
+ GUIDE_HUB_INELIGIBLE_REASON = "guide_hub_ineligible";
12869
12955
  }
12870
12956
  });
12871
12957
 
@@ -12964,77 +13050,282 @@ var init_chunk_LKBSHANA = __esm({
12964
13050
  }
12965
13051
  });
12966
13052
 
12967
- // ../../packages/core/dist/contracts/index.js
12968
- var init_contracts = __esm({
12969
- "../../packages/core/dist/contracts/index.js"() {
12970
- "use strict";
12971
- init_chunk_Z6GC65RQ();
12972
- init_chunk_VORPHGDT();
12973
- init_chunk_POL7B3EM();
12974
- init_chunk_6SBJQYK2();
12975
- init_chunk_SNA2DXAC();
12976
- init_chunk_MIWZOSPI();
12977
- init_chunk_LKBSHANA();
12978
- init_chunk_IBL7FANV();
12979
- init_chunk_2ISUBJG7();
12980
- init_chunk_C2UEA2KW();
12981
- init_chunk_3NS3HULK();
12982
- init_chunk_JWPRTSIB();
12983
- init_chunk_T7KQKDET();
12984
- init_chunk_L5F7ZOUJ();
12985
- }
12986
- });
12987
-
12988
- // src/lib/api-client.ts
12989
- var api_client_exports = {};
12990
- __export(api_client_exports, {
12991
- ApiClient: () => ApiClient,
12992
- ApiError: () => ApiError,
12993
- dataErrorMessage: () => dataErrorMessage,
12994
- toDataProxyPath: () => toDataProxyPath,
12995
- withOrgSelector: () => withOrgSelector
12996
- });
12997
- function isRetryableErrorBody(body) {
12998
- try {
12999
- const parsed = JSON.parse(body);
13000
- return parsed?.details?.retryable === true;
13001
- } catch {
13002
- return false;
13003
- }
13004
- }
13005
- function toDataProxyPath(v1Path) {
13006
- if (!v1Path.startsWith(`${REKOR_V1_PREFIX}/`)) {
13007
- throw new Error(`Data path must start with ${REKOR_V1_PREFIX}/: ${v1Path}`);
13008
- }
13009
- return `${DATA_PROXY_PREFIX}${v1Path.slice(REKOR_V1_PREFIX.length)}`;
13053
+ // ../../packages/core/dist/chunk-R7VSUKKX.js
13054
+ function isPublicIdentifier(value) {
13055
+ return UUID_RE.test(value) || HEX_RE.test(value) || WORKOS_ID_RE.test(value) || TRACE_HEADER_RE.test(value);
13010
13056
  }
13011
- function withOrgSelector(path36, orgId) {
13012
- if (!orgId) return path36;
13013
- const separator = path36.includes("?") ? "&" : "?";
13014
- return `${path36}${separator}${DATA_PROXY_ORG_QUERY_PARAM}=${encodeURIComponent(orgId)}`;
13057
+ function redactTokenShapes(input) {
13058
+ return input.replace(TOKEN_RE, REDACTED).replace(PROVIDER_TOKEN_RE, `$1${REDACTED}`).replace(JSON_CREDENTIAL_RE, `$1"${REDACTED}"`).replace(QUERY_CREDENTIAL_RE, `$1${REDACTED}`);
13015
13059
  }
13016
- function dataErrorMessage(err) {
13017
- if (!(err instanceof ApiError)) return null;
13018
- let parsed;
13019
- try {
13020
- parsed = JSON.parse(err.body);
13021
- } catch {
13022
- return null;
13060
+ function redactSecrets(value) {
13061
+ if (isPublicIdentifier(value)) {
13062
+ return value;
13023
13063
  }
13024
- if (err.status === 404 && err.path.startsWith(DATA_PROXY_PREFIX) && typeof parsed?.error === "string") {
13025
- return "The Data surface is not available on this backend. Update the CLI, or point it at a backend that serves it.";
13064
+ if (OPAQUE_SECRET_RE.test(value)) {
13065
+ return REDACTED;
13026
13066
  }
13027
- const message = parsed?.error?.message;
13028
- return typeof message === "string" && message ? message : null;
13067
+ if (BASE64_SECRET_RE.test(value) && BASE64_MARKER_RE.test(value)) {
13068
+ return REDACTED;
13069
+ }
13070
+ return redactTokenShapes(value);
13029
13071
  }
13030
- var RETRYABLE_BACKOFF_MS, delay, ApiError, ApiClient;
13031
- var init_api_client = __esm({
13032
- "src/lib/api-client.ts"() {
13072
+ var UUID_RE, HEX_RE, WORKOS_ID_RE, TRACE_HEADER_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;
13073
+ var init_chunk_R7VSUKKX = __esm({
13074
+ "../../packages/core/dist/chunk-R7VSUKKX.js"() {
13033
13075
  "use strict";
13034
- init_contracts();
13035
- init_sentry();
13036
- init_mask_secrets();
13037
- RETRYABLE_BACKOFF_MS = [500, 1e3, 2e3];
13076
+ UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
13077
+ HEX_RE = /^[0-9a-f]{16,}$/;
13078
+ WORKOS_ID_RE = /^(?:user|org)_[0-9A-HJKMNP-TV-Z]{26}$/;
13079
+ TRACE_HEADER_RE = /^(?:[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}|[0-9a-f]{32}-[0-9a-f]{16}(?:-[01])?)$/;
13080
+ OPAQUE_SECRET_RE = /^[A-Za-z0-9_-]{21,}$/;
13081
+ BASE64_SECRET_RE = /^[A-Za-z0-9+/]{20,}={0,2}$/;
13082
+ BASE64_MARKER_RE = /[+=]/;
13083
+ TOKEN_RE = new RegExp(
13084
+ [
13085
+ // WayAI API tokens and WebSocket tickets.
13086
+ "(?:way|wst)_[A-Za-z0-9._-]{8,}",
13087
+ // Authorization header values, including base64 Basic credentials.
13088
+ "(?:Bearer|Basic)\\s+[A-Za-z0-9._~+/=-]{8,}",
13089
+ // JWTs — WorkOS session/access tokens. `eyJ` is base64 for `{"`.
13090
+ "eyJ[A-Za-z0-9._-]{10,}",
13091
+ // Stripe secret/publishable/restricted keys and webhook signing secrets.
13092
+ "(?:sk|pk|rk)_(?:live|test)_[A-Za-z0-9]{8,}",
13093
+ "whsec_[A-Za-z0-9]{8,}",
13094
+ // Telegram bot tokens as the Bot API takes them, in the URL path: `/bot<id>:<secret>/`.
13095
+ "bot[0-9]{5,}:[A-Za-z0-9_-]{30,}"
13096
+ // NOTE: LLM provider keys are NOT here — they need a delimiter-preserving
13097
+ // boundary, so they live in PROVIDER_TOKEN_RE below.
13098
+ ].join("|"),
13099
+ "g"
13100
+ );
13101
+ SENSITIVE_FIELDS = [
13102
+ "password",
13103
+ "token",
13104
+ "secret",
13105
+ "api_key",
13106
+ "apikey",
13107
+ "api-key",
13108
+ "authorization",
13109
+ "auth",
13110
+ "credential",
13111
+ "private_key",
13112
+ "privatekey",
13113
+ "access_token",
13114
+ "refresh_token",
13115
+ "session_id",
13116
+ "sessionid",
13117
+ "cookie",
13118
+ "jwt"
13119
+ ];
13120
+ SENSITIVE_KEY_ALTERNATION = SENSITIVE_FIELDS.map(
13121
+ (field) => field.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
13122
+ ).join("|");
13123
+ SENSITIVE_KEY_PATTERN = `[A-Za-z0-9_.-]*(?:${SENSITIVE_KEY_ALTERNATION})[A-Za-z0-9_.-]*`;
13124
+ JSON_CREDENTIAL_RE = new RegExp(
13125
+ `("${SENSITIVE_KEY_PATTERN}"\\s*:\\s*)"(?:[^"\\\\]|\\\\.)*"`,
13126
+ "gi"
13127
+ );
13128
+ QUERY_CREDENTIAL_RE = new RegExp(
13129
+ `((?:^|[?&#;\\s])${SENSITIVE_KEY_PATTERN}=)[^&;\\s"']+`,
13130
+ "gi"
13131
+ );
13132
+ REDACTED = "[REDACTED]";
13133
+ PROVIDER_TOKEN_RE = new RegExp(
13134
+ "(^|[^A-Za-z0-9])(?:" + [
13135
+ "sk-[A-Za-z0-9_-]{16,}",
13136
+ "AIza[A-Za-z0-9_-]{16,}",
13137
+ "xai-[A-Za-z0-9_-]{16,}"
13138
+ ].join("|") + ")",
13139
+ "g"
13140
+ );
13141
+ }
13142
+ });
13143
+
13144
+ // ../../packages/core/dist/chunk-BPDC67ML.js
13145
+ var 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;
13146
+ var init_chunk_BPDC67ML = __esm({
13147
+ "../../packages/core/dist/chunk-BPDC67ML.js"() {
13148
+ "use strict";
13149
+ init_chunk_R7VSUKKX();
13150
+ APP_ERROR_BRAND = /* @__PURE__ */ Symbol.for("wayai.AppError");
13151
+ AppError = class extends Error {
13152
+ constructor(message, code, statusCode = 500, details) {
13153
+ super(message);
13154
+ this.code = code;
13155
+ this.statusCode = statusCode;
13156
+ this.details = details;
13157
+ this.name = "AppError";
13158
+ }
13159
+ [APP_ERROR_BRAND] = true;
13160
+ toJSON() {
13161
+ return {
13162
+ error: this.code,
13163
+ message: this.message,
13164
+ ...this.details && { details: this.details }
13165
+ };
13166
+ }
13167
+ };
13168
+ LLM_RATE_LIMIT_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmRateLimitError");
13169
+ LlmRateLimitError = class extends Error {
13170
+ constructor(provider, retryAfterMs) {
13171
+ super(`${provider} rate limited; retry after ${retryAfterMs}ms`);
13172
+ this.provider = provider;
13173
+ this.retryAfterMs = retryAfterMs;
13174
+ this.name = "LlmRateLimitError";
13175
+ }
13176
+ [LLM_RATE_LIMIT_BRAND] = true;
13177
+ };
13178
+ LLM_PROVIDER_HTTP_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmProviderHttpError");
13179
+ LlmProviderHttpError = class extends Error {
13180
+ constructor(message, status, provider, providerError) {
13181
+ super(redactSecrets(message));
13182
+ this.status = status;
13183
+ this.provider = provider;
13184
+ this.providerError = providerError;
13185
+ this.name = "LlmProviderHttpError";
13186
+ }
13187
+ [LLM_PROVIDER_HTTP_BRAND] = true;
13188
+ };
13189
+ LLM_PROVIDER_CONTENT_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmProviderContentError");
13190
+ LlmProviderContentError = class extends Error {
13191
+ constructor(message, provider, providerError) {
13192
+ super(redactSecrets(message));
13193
+ this.provider = provider;
13194
+ this.providerError = providerError;
13195
+ this.name = "LlmProviderContentError";
13196
+ }
13197
+ [LLM_PROVIDER_CONTENT_BRAND] = true;
13198
+ };
13199
+ LLM_PROVIDER_TIMEOUT_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmProviderTimeoutError");
13200
+ LlmProviderTimeoutError = class extends Error {
13201
+ constructor(message, provider) {
13202
+ super(message);
13203
+ this.provider = provider;
13204
+ this.name = "LlmProviderTimeoutError";
13205
+ }
13206
+ [LLM_PROVIDER_TIMEOUT_BRAND] = true;
13207
+ };
13208
+ ExternalServiceError = class extends AppError {
13209
+ constructor(service, originalError) {
13210
+ super(`External service error: ${service}`, "EXTERNAL_SERVICE_ERROR", 502, {
13211
+ service,
13212
+ originalMessage: originalError?.message
13213
+ });
13214
+ this.name = "ExternalServiceError";
13215
+ }
13216
+ };
13217
+ CHANNEL_PROVIDER_HTTP_BRAND = /* @__PURE__ */ Symbol.for("wayai.ChannelProviderHttpError");
13218
+ ChannelProviderHttpError = class extends ExternalServiceError {
13219
+ [CHANNEL_PROVIDER_HTTP_BRAND] = true;
13220
+ status;
13221
+ provider;
13222
+ /** Provider numeric error code (Meta `error.code`) — body-free. */
13223
+ providerCode;
13224
+ /** Provider numeric error subcode (Meta `error.error_subcode`) — body-free. */
13225
+ providerSubcode;
13226
+ constructor(provider, status, providerCode, providerSubcode) {
13227
+ super(provider);
13228
+ this.name = "ChannelProviderHttpError";
13229
+ this.status = status;
13230
+ this.provider = provider;
13231
+ this.providerCode = providerCode;
13232
+ this.providerSubcode = providerSubcode;
13233
+ }
13234
+ };
13235
+ MEDIA_PROVIDER_HTTP_BRAND = /* @__PURE__ */ Symbol.for("wayai.MediaProviderHttpError");
13236
+ MediaProviderHttpError = class extends Error {
13237
+ constructor(provider, status, options = {}) {
13238
+ super(`${provider} API error (${status})`);
13239
+ this.provider = provider;
13240
+ this.status = status;
13241
+ this.name = "MediaProviderHttpError";
13242
+ this.credentialRejected = options.credentialRejected ?? false;
13243
+ }
13244
+ [MEDIA_PROVIDER_HTTP_BRAND] = true;
13245
+ /**
13246
+ * The provider said the credential itself was rejected, under a status that does not say so
13247
+ * (Google answers an invalid or expired key with 400 `API_KEY_INVALID`, not 401). Read off
13248
+ * the body at the throw site, which carries only this flag on. Alerting keys on it so the
13249
+ * admin is told to re-enter the key, not that the key is fine.
13250
+ */
13251
+ credentialRejected;
13252
+ };
13253
+ }
13254
+ });
13255
+
13256
+ // ../../packages/core/dist/contracts/index.js
13257
+ var init_contracts = __esm({
13258
+ "../../packages/core/dist/contracts/index.js"() {
13259
+ "use strict";
13260
+ init_chunk_FRU7E62M();
13261
+ init_chunk_VORPHGDT();
13262
+ init_chunk_POL7B3EM();
13263
+ init_chunk_T2RKGBYS();
13264
+ init_chunk_SNA2DXAC();
13265
+ init_chunk_MIWZOSPI();
13266
+ init_chunk_LKBSHANA();
13267
+ init_chunk_IBL7FANV();
13268
+ init_chunk_2ISUBJG7();
13269
+ init_chunk_C2UEA2KW();
13270
+ init_chunk_3NS3HULK();
13271
+ init_chunk_JWPRTSIB();
13272
+ init_chunk_T7KQKDET();
13273
+ init_chunk_L5F7ZOUJ();
13274
+ init_chunk_BPDC67ML();
13275
+ init_chunk_R7VSUKKX();
13276
+ }
13277
+ });
13278
+
13279
+ // src/lib/api-client.ts
13280
+ var api_client_exports = {};
13281
+ __export(api_client_exports, {
13282
+ ApiClient: () => ApiClient,
13283
+ ApiError: () => ApiError,
13284
+ dataErrorMessage: () => dataErrorMessage,
13285
+ toDataProxyPath: () => toDataProxyPath,
13286
+ withOrgSelector: () => withOrgSelector
13287
+ });
13288
+ function isRetryableErrorBody(body) {
13289
+ try {
13290
+ const parsed = JSON.parse(body);
13291
+ return parsed?.details?.retryable === true;
13292
+ } catch {
13293
+ return false;
13294
+ }
13295
+ }
13296
+ function toDataProxyPath(v1Path) {
13297
+ if (!v1Path.startsWith(`${REKOR_V1_PREFIX}/`)) {
13298
+ throw new Error(`Data path must start with ${REKOR_V1_PREFIX}/: ${v1Path}`);
13299
+ }
13300
+ return `${DATA_PROXY_PREFIX}${v1Path.slice(REKOR_V1_PREFIX.length)}`;
13301
+ }
13302
+ function withOrgSelector(path36, orgId) {
13303
+ if (!orgId) return path36;
13304
+ const separator = path36.includes("?") ? "&" : "?";
13305
+ return `${path36}${separator}${DATA_PROXY_ORG_QUERY_PARAM}=${encodeURIComponent(orgId)}`;
13306
+ }
13307
+ function dataErrorMessage(err) {
13308
+ if (!(err instanceof ApiError)) return null;
13309
+ let parsed;
13310
+ try {
13311
+ parsed = JSON.parse(err.body);
13312
+ } catch {
13313
+ return null;
13314
+ }
13315
+ if (err.status === 404 && err.path.startsWith(DATA_PROXY_PREFIX) && typeof parsed?.error === "string") {
13316
+ return "The Data surface is not available on this backend. Update the CLI, or point it at a backend that serves it.";
13317
+ }
13318
+ const message = parsed?.error?.message;
13319
+ return typeof message === "string" && message ? message : null;
13320
+ }
13321
+ var RETRYABLE_BACKOFF_MS, delay, ApiError, ApiClient;
13322
+ var init_api_client = __esm({
13323
+ "src/lib/api-client.ts"() {
13324
+ "use strict";
13325
+ init_contracts();
13326
+ init_sentry();
13327
+ init_mask_secrets();
13328
+ RETRYABLE_BACKOFF_MS = [500, 1e3, 2e3];
13038
13329
  delay = (ms) => new Promise((resolve11) => setTimeout(resolve11, ms));
13039
13330
  ApiError = class extends Error {
13040
13331
  status;
@@ -13156,6 +13447,20 @@ var init_api_client = __esm({
13156
13447
  async adminDestroyCommunity(communityId) {
13157
13448
  return this.request("DELETE", `/api/admin/communities/${encodeURIComponent(communityId)}`);
13158
13449
  }
13450
+ // Read which hub is the WayAI Guide (platform-admin gated, wayai#4948). Used by
13451
+ // `wayai admin guide status`.
13452
+ async adminGetGuide() {
13453
+ return this.request("GET", "/api/admin/guide");
13454
+ }
13455
+ // Make a hub the WayAI Guide, or with `dry_run` only check it (platform-admin gated,
13456
+ // wayai#4948). Used by `wayai admin guide set-hub`.
13457
+ async adminSetGuideHub(body) {
13458
+ return this.request("PUT", "/api/admin/guide", body);
13459
+ }
13460
+ // Turn the WayAI Guide off (platform-admin gated, wayai#4948). Used by `wayai admin guide clear`.
13461
+ async adminClearGuideHub() {
13462
+ return this.request("DELETE", "/api/admin/guide");
13463
+ }
13159
13464
  /**
13160
13465
  * Re-discover an MCP connection's tool/resource catalog (refreshes stale
13161
13466
  * input schemas that `push` leaves untouched). `connection` is the display
@@ -13962,274 +14267,71 @@ function identifyTokenType(token) {
13962
14267
  var init_chunk_WSROLRJN = __esm({
13963
14268
  "../../packages/core/dist/chunk-WSROLRJN.js"() {
13964
14269
  "use strict";
13965
- init_chunk_VORPHGDT();
13966
- }
13967
- });
13968
-
13969
- // ../../packages/core/dist/chunk-ERFR7IRY.js
13970
- function findStepBoundaries(transcript) {
13971
- const out = [];
13972
- const n = transcript.length;
13973
- let i = 0;
13974
- while (i < n) {
13975
- if (transcript[i].role !== "assistant") {
13976
- i++;
13977
- continue;
13978
- }
13979
- let triggerIdx = -1;
13980
- for (let j = i - 1; j >= 0; j--) {
13981
- if (transcript[j].role === "user") {
13982
- triggerIdx = j;
13983
- break;
13984
- }
13985
- }
13986
- let runEnd = i;
13987
- while (runEnd + 1 < n && (transcript[runEnd + 1].role === "assistant" || transcript[runEnd + 1].role === "tool")) {
13988
- runEnd++;
13989
- }
13990
- let concludingIdx = -1;
13991
- for (let j = runEnd; j >= i; j--) {
13992
- if (transcript[j].role === "assistant") {
13993
- concludingIdx = j;
13994
- break;
13995
- }
13996
- }
13997
- if (triggerIdx !== -1 && concludingIdx !== -1) {
13998
- out.push({ triggerIdx, concludingIdx });
13999
- }
14000
- i = runEnd + 1;
14001
- }
14002
- return out;
14003
- }
14004
- var init_chunk_ERFR7IRY = __esm({
14005
- "../../packages/core/dist/chunk-ERFR7IRY.js"() {
14006
- "use strict";
14007
- init_chunk_2ISUBJG7();
14008
- }
14009
- });
14010
-
14011
- // ../../packages/core/dist/chunk-FEOO3UPS.js
14012
- var init_chunk_FEOO3UPS = __esm({
14013
- "../../packages/core/dist/chunk-FEOO3UPS.js"() {
14014
- "use strict";
14015
- }
14016
- });
14017
-
14018
- // ../../packages/core/dist/chunk-RPGBR5IN.js
14019
- var init_chunk_RPGBR5IN = __esm({
14020
- "../../packages/core/dist/chunk-RPGBR5IN.js"() {
14021
- "use strict";
14022
- init_chunk_C2UEA2KW();
14023
- }
14024
- });
14025
-
14026
- // ../../packages/core/dist/chunk-BF4WRSOQ.js
14027
- var init_chunk_BF4WRSOQ = __esm({
14028
- "../../packages/core/dist/chunk-BF4WRSOQ.js"() {
14029
- "use strict";
14030
- }
14031
- });
14032
-
14033
- // ../../packages/core/dist/chunk-R7VSUKKX.js
14034
- function isPublicIdentifier(value) {
14035
- return UUID_RE.test(value) || HEX_RE.test(value) || WORKOS_ID_RE.test(value) || TRACE_HEADER_RE.test(value);
14036
- }
14037
- function redactTokenShapes(input) {
14038
- return input.replace(TOKEN_RE, REDACTED).replace(PROVIDER_TOKEN_RE, `$1${REDACTED}`).replace(JSON_CREDENTIAL_RE, `$1"${REDACTED}"`).replace(QUERY_CREDENTIAL_RE, `$1${REDACTED}`);
14039
- }
14040
- function redactSecrets(value) {
14041
- if (isPublicIdentifier(value)) {
14042
- return value;
14043
- }
14044
- if (OPAQUE_SECRET_RE.test(value)) {
14045
- return REDACTED;
14046
- }
14047
- if (BASE64_SECRET_RE.test(value) && BASE64_MARKER_RE.test(value)) {
14048
- return REDACTED;
14049
- }
14050
- return redactTokenShapes(value);
14051
- }
14052
- var UUID_RE, HEX_RE, WORKOS_ID_RE, TRACE_HEADER_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;
14053
- var init_chunk_R7VSUKKX = __esm({
14054
- "../../packages/core/dist/chunk-R7VSUKKX.js"() {
14055
- "use strict";
14056
- UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
14057
- HEX_RE = /^[0-9a-f]{16,}$/;
14058
- WORKOS_ID_RE = /^(?:user|org)_[0-9A-HJKMNP-TV-Z]{26}$/;
14059
- TRACE_HEADER_RE = /^(?:[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}|[0-9a-f]{32}-[0-9a-f]{16}(?:-[01])?)$/;
14060
- OPAQUE_SECRET_RE = /^[A-Za-z0-9_-]{21,}$/;
14061
- BASE64_SECRET_RE = /^[A-Za-z0-9+/]{20,}={0,2}$/;
14062
- BASE64_MARKER_RE = /[+=]/;
14063
- TOKEN_RE = new RegExp(
14064
- [
14065
- // WayAI API tokens and WebSocket tickets.
14066
- "(?:way|wst)_[A-Za-z0-9._-]{8,}",
14067
- // Authorization header values, including base64 Basic credentials.
14068
- "(?:Bearer|Basic)\\s+[A-Za-z0-9._~+/=-]{8,}",
14069
- // JWTs — WorkOS session/access tokens. `eyJ` is base64 for `{"`.
14070
- "eyJ[A-Za-z0-9._-]{10,}",
14071
- // Stripe secret/publishable/restricted keys and webhook signing secrets.
14072
- "(?:sk|pk|rk)_(?:live|test)_[A-Za-z0-9]{8,}",
14073
- "whsec_[A-Za-z0-9]{8,}",
14074
- // Telegram bot tokens as the Bot API takes them, in the URL path: `/bot<id>:<secret>/`.
14075
- "bot[0-9]{5,}:[A-Za-z0-9_-]{30,}"
14076
- // NOTE: LLM provider keys are NOT here — they need a delimiter-preserving
14077
- // boundary, so they live in PROVIDER_TOKEN_RE below.
14078
- ].join("|"),
14079
- "g"
14080
- );
14081
- SENSITIVE_FIELDS = [
14082
- "password",
14083
- "token",
14084
- "secret",
14085
- "api_key",
14086
- "apikey",
14087
- "api-key",
14088
- "authorization",
14089
- "auth",
14090
- "credential",
14091
- "private_key",
14092
- "privatekey",
14093
- "access_token",
14094
- "refresh_token",
14095
- "session_id",
14096
- "sessionid",
14097
- "cookie",
14098
- "jwt"
14099
- ];
14100
- SENSITIVE_KEY_ALTERNATION = SENSITIVE_FIELDS.map(
14101
- (field) => field.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
14102
- ).join("|");
14103
- SENSITIVE_KEY_PATTERN = `[A-Za-z0-9_.-]*(?:${SENSITIVE_KEY_ALTERNATION})[A-Za-z0-9_.-]*`;
14104
- JSON_CREDENTIAL_RE = new RegExp(
14105
- `("${SENSITIVE_KEY_PATTERN}"\\s*:\\s*)"(?:[^"\\\\]|\\\\.)*"`,
14106
- "gi"
14107
- );
14108
- QUERY_CREDENTIAL_RE = new RegExp(
14109
- `((?:^|[?&#;\\s])${SENSITIVE_KEY_PATTERN}=)[^&;\\s"']+`,
14110
- "gi"
14111
- );
14112
- REDACTED = "[REDACTED]";
14113
- PROVIDER_TOKEN_RE = new RegExp(
14114
- "(^|[^A-Za-z0-9])(?:" + [
14115
- "sk-[A-Za-z0-9_-]{16,}",
14116
- "AIza[A-Za-z0-9_-]{16,}",
14117
- "xai-[A-Za-z0-9_-]{16,}"
14118
- ].join("|") + ")",
14119
- "g"
14120
- );
14270
+ init_chunk_VORPHGDT();
14121
14271
  }
14122
14272
  });
14123
14273
 
14124
- // ../../packages/core/dist/chunk-4MBOLX7Q.js
14125
- var 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;
14126
- var init_chunk_4MBOLX7Q = __esm({
14127
- "../../packages/core/dist/chunk-4MBOLX7Q.js"() {
14128
- "use strict";
14129
- init_chunk_R7VSUKKX();
14130
- APP_ERROR_BRAND = /* @__PURE__ */ Symbol.for("wayai.AppError");
14131
- AppError = class extends Error {
14132
- constructor(message, code, statusCode = 500, details) {
14133
- super(message);
14134
- this.code = code;
14135
- this.statusCode = statusCode;
14136
- this.details = details;
14137
- this.name = "AppError";
14138
- }
14139
- [APP_ERROR_BRAND] = true;
14140
- toJSON() {
14141
- return {
14142
- error: this.code,
14143
- message: this.message,
14144
- ...this.details && { details: this.details }
14145
- };
14146
- }
14147
- };
14148
- LLM_RATE_LIMIT_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmRateLimitError");
14149
- LlmRateLimitError = class extends Error {
14150
- constructor(provider, retryAfterMs) {
14151
- super(`${provider} rate limited; retry after ${retryAfterMs}ms`);
14152
- this.provider = provider;
14153
- this.retryAfterMs = retryAfterMs;
14154
- this.name = "LlmRateLimitError";
14155
- }
14156
- [LLM_RATE_LIMIT_BRAND] = true;
14157
- };
14158
- LLM_PROVIDER_HTTP_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmProviderHttpError");
14159
- LlmProviderHttpError = class extends Error {
14160
- constructor(message, status, provider, providerError) {
14161
- super(redactSecrets(message));
14162
- this.status = status;
14163
- this.provider = provider;
14164
- this.providerError = providerError;
14165
- this.name = "LlmProviderHttpError";
14166
- }
14167
- [LLM_PROVIDER_HTTP_BRAND] = true;
14168
- };
14169
- LLM_PROVIDER_CONTENT_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmProviderContentError");
14170
- LlmProviderContentError = class extends Error {
14171
- constructor(message, provider, providerError) {
14172
- super(redactSecrets(message));
14173
- this.provider = provider;
14174
- this.providerError = providerError;
14175
- this.name = "LlmProviderContentError";
14176
- }
14177
- [LLM_PROVIDER_CONTENT_BRAND] = true;
14178
- };
14179
- LLM_PROVIDER_TIMEOUT_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmProviderTimeoutError");
14180
- LlmProviderTimeoutError = class extends Error {
14181
- constructor(message, provider) {
14182
- super(message);
14183
- this.provider = provider;
14184
- this.name = "LlmProviderTimeoutError";
14185
- }
14186
- [LLM_PROVIDER_TIMEOUT_BRAND] = true;
14187
- };
14188
- ExternalServiceError = class extends AppError {
14189
- constructor(service, originalError) {
14190
- super(`External service error: ${service}`, "EXTERNAL_SERVICE_ERROR", 502, {
14191
- service,
14192
- originalMessage: originalError?.message
14193
- });
14194
- this.name = "ExternalServiceError";
14195
- }
14196
- };
14197
- CHANNEL_PROVIDER_HTTP_BRAND = /* @__PURE__ */ Symbol.for("wayai.ChannelProviderHttpError");
14198
- ChannelProviderHttpError = class extends ExternalServiceError {
14199
- [CHANNEL_PROVIDER_HTTP_BRAND] = true;
14200
- status;
14201
- provider;
14202
- /** Provider numeric error code (Meta `error.code`) — body-free. */
14203
- providerCode;
14204
- /** Provider numeric error subcode (Meta `error.error_subcode`) — body-free. */
14205
- providerSubcode;
14206
- constructor(provider, status, providerCode, providerSubcode) {
14207
- super(provider);
14208
- this.name = "ChannelProviderHttpError";
14209
- this.status = status;
14210
- this.provider = provider;
14211
- this.providerCode = providerCode;
14212
- this.providerSubcode = providerSubcode;
14274
+ // ../../packages/core/dist/chunk-ERFR7IRY.js
14275
+ function findStepBoundaries(transcript) {
14276
+ const out = [];
14277
+ const n = transcript.length;
14278
+ let i = 0;
14279
+ while (i < n) {
14280
+ if (transcript[i].role !== "assistant") {
14281
+ i++;
14282
+ continue;
14283
+ }
14284
+ let triggerIdx = -1;
14285
+ for (let j = i - 1; j >= 0; j--) {
14286
+ if (transcript[j].role === "user") {
14287
+ triggerIdx = j;
14288
+ break;
14213
14289
  }
14214
- };
14215
- MEDIA_PROVIDER_HTTP_BRAND = /* @__PURE__ */ Symbol.for("wayai.MediaProviderHttpError");
14216
- MediaProviderHttpError = class extends Error {
14217
- constructor(provider, status, options = {}) {
14218
- super(`${provider} API error (${status})`);
14219
- this.provider = provider;
14220
- this.status = status;
14221
- this.name = "MediaProviderHttpError";
14222
- this.credentialRejected = options.credentialRejected ?? false;
14290
+ }
14291
+ let runEnd = i;
14292
+ while (runEnd + 1 < n && (transcript[runEnd + 1].role === "assistant" || transcript[runEnd + 1].role === "tool")) {
14293
+ runEnd++;
14294
+ }
14295
+ let concludingIdx = -1;
14296
+ for (let j = runEnd; j >= i; j--) {
14297
+ if (transcript[j].role === "assistant") {
14298
+ concludingIdx = j;
14299
+ break;
14223
14300
  }
14224
- [MEDIA_PROVIDER_HTTP_BRAND] = true;
14225
- /**
14226
- * The provider said the credential itself was rejected, under a status that does not say so
14227
- * (Google answers an invalid or expired key with 400 `API_KEY_INVALID`, not 401). Read off
14228
- * the body at the throw site, which carries only this flag on. Alerting keys on it so the
14229
- * admin is told to re-enter the key, not that the key is fine.
14230
- */
14231
- credentialRejected;
14232
- };
14301
+ }
14302
+ if (triggerIdx !== -1 && concludingIdx !== -1) {
14303
+ out.push({ triggerIdx, concludingIdx });
14304
+ }
14305
+ i = runEnd + 1;
14306
+ }
14307
+ return out;
14308
+ }
14309
+ var init_chunk_ERFR7IRY = __esm({
14310
+ "../../packages/core/dist/chunk-ERFR7IRY.js"() {
14311
+ "use strict";
14312
+ init_chunk_2ISUBJG7();
14313
+ }
14314
+ });
14315
+
14316
+ // ../../packages/core/dist/chunk-FEOO3UPS.js
14317
+ var init_chunk_FEOO3UPS = __esm({
14318
+ "../../packages/core/dist/chunk-FEOO3UPS.js"() {
14319
+ "use strict";
14320
+ }
14321
+ });
14322
+
14323
+ // ../../packages/core/dist/chunk-RPGBR5IN.js
14324
+ var init_chunk_RPGBR5IN = __esm({
14325
+ "../../packages/core/dist/chunk-RPGBR5IN.js"() {
14326
+ "use strict";
14327
+ init_chunk_C2UEA2KW();
14328
+ }
14329
+ });
14330
+
14331
+ // ../../packages/core/dist/chunk-BF4WRSOQ.js
14332
+ var init_chunk_BF4WRSOQ = __esm({
14333
+ "../../packages/core/dist/chunk-BF4WRSOQ.js"() {
14334
+ "use strict";
14233
14335
  }
14234
14336
  });
14235
14337
 
@@ -14255,10 +14357,10 @@ var init_dist = __esm({
14255
14357
  "../../packages/core/dist/index.js"() {
14256
14358
  "use strict";
14257
14359
  init_chunk_WSROLRJN();
14258
- init_chunk_Z6GC65RQ();
14360
+ init_chunk_FRU7E62M();
14259
14361
  init_chunk_VORPHGDT();
14260
14362
  init_chunk_POL7B3EM();
14261
- init_chunk_6SBJQYK2();
14363
+ init_chunk_T2RKGBYS();
14262
14364
  init_chunk_SNA2DXAC();
14263
14365
  init_chunk_MIWZOSPI();
14264
14366
  init_chunk_LKBSHANA();
@@ -14273,7 +14375,7 @@ var init_dist = __esm({
14273
14375
  init_chunk_BF4WRSOQ();
14274
14376
  init_chunk_T7KQKDET();
14275
14377
  init_chunk_L5F7ZOUJ();
14276
- init_chunk_4MBOLX7Q();
14378
+ init_chunk_BPDC67ML();
14277
14379
  init_chunk_R7VSUKKX();
14278
14380
  ENDPOINT_CONFIGS = {
14279
14381
  // OAuth callbacks - strict, fail-closed (prevent brute force)
@@ -14713,6 +14815,17 @@ var init_dist = __esm({
14713
14815
  // many members' clicks share, and STRICT's 5/min bucket is shared with sign-in. An exact key, so
14714
14816
  // it wins over the wildcard above.
14715
14817
  [COMMUNITY_EMAIL_UNSUBSCRIBE_PATH]: { tier: "MODERATE" },
14818
+ // The WayAI Guide's help entry (wayai#4948, `routes/api/guide.ts`): one POST per click by a viewer
14819
+ // the snapshot does not show enrolled, which reads the person's row on the Guide hub and writes only
14820
+ // what is missing (an enrolled viewer's click opens the hub without a request). Every caller is
14821
+ // signed in, so the per-IP tier is skipped; 10 a minute per person on the native binding (fails
14822
+ // open, like every 60 s budget) bounds what a looping client costs the one Guide HubDO.
14823
+ "/api/guide/access": {
14824
+ tier: "STANDARD",
14825
+ userLimit: 10,
14826
+ skipAuthenticatedUsers: true,
14827
+ userLimitKey: "/api/guide/access"
14828
+ },
14716
14829
  // App channel - high throughput with user limits
14717
14830
  "/channels/app/*": { tier: "HIGH", userLimit: 500, skipAuthenticatedUsers: true },
14718
14831
  // API channel (api-channel-connector) - machine-to-machine, high throughput
@@ -28240,6 +28353,26 @@ async function adminCommand(args2) {
28240
28353
  process.exit(1);
28241
28354
  }
28242
28355
  }
28356
+ if (group === "guide") {
28357
+ if (!sub) {
28358
+ printHelp2();
28359
+ process.exit(1);
28360
+ }
28361
+ switch (sub) {
28362
+ case "set-hub":
28363
+ await runGuideSetHub(positional, flagArgs);
28364
+ return;
28365
+ case "clear":
28366
+ await runGuideClear(positional, flagArgs);
28367
+ return;
28368
+ case "status":
28369
+ await runGuideStatus(positional, flagArgs);
28370
+ return;
28371
+ default:
28372
+ printHelp2();
28373
+ process.exit(1);
28374
+ }
28375
+ }
28243
28376
  if (group === "voice-calls") {
28244
28377
  if (!sub) {
28245
28378
  printHelp2();
@@ -29152,6 +29285,121 @@ async function runCommunitiesDestroy(positional, flagArgs) {
29152
29285
  }
29153
29286
  console.log(`Destroyed community ${data.community_id} \u2014 "${data.name}", owned by ${data.org_name} (${data.org_id}), at ${data.destroyed_at}.`);
29154
29287
  }
29288
+ function describeGuideHub(hub) {
29289
+ return `${hub.hub_name ?? "(unnamed)"} (${hub.hub_id}), owned by ${hub.organization_name ?? "(unnamed org)"} (${hub.organization_id})`;
29290
+ }
29291
+ function parseGuideFlags(flagArgs, usage3, allowed) {
29292
+ for (const flag of flagArgs) {
29293
+ if (!allowed.includes(flag)) {
29294
+ console.error(`Unknown flag: ${flag}`);
29295
+ console.error(usage3);
29296
+ process.exit(1);
29297
+ }
29298
+ }
29299
+ return { yes: flagArgs.includes("--yes"), jsonOutput: flagArgs.includes("--json") };
29300
+ }
29301
+ async function runGuideSetHub(positional, flagArgs) {
29302
+ const usage3 = "wayai admin guide set-hub <hub_id> [--yes] [--json]";
29303
+ const { yes, jsonOutput } = parseGuideFlags(flagArgs, usage3, ["--yes", "--json"]);
29304
+ const parsed = adminSetGuideHubBody.safeParse({ hub_id: positional[0] });
29305
+ if (positional.length !== 1 || !parsed.success) {
29306
+ console.error("<hub_id> must be one hub id (a UUID).");
29307
+ console.error(usage3);
29308
+ process.exit(1);
29309
+ }
29310
+ const hubId = parsed.data.hub_id;
29311
+ const { config, accessToken } = await requireAuth();
29312
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
29313
+ const put = async (dryRun) => {
29314
+ try {
29315
+ return (await client.adminSetGuideHub({ hub_id: hubId, dry_run: dryRun })).data;
29316
+ } catch (err) {
29317
+ if (err instanceof ApiError && err.status === 404) {
29318
+ console.error(`Hub ${hubId} not found (never created, or deleted).`);
29319
+ process.exit(1);
29320
+ }
29321
+ if (err instanceof ApiError && err.status === 409 && conflictReasonOf(err) === GUIDE_HUB_INELIGIBLE_REASON) {
29322
+ console.error(`Refused: ${extractApiMessage(err)}.`);
29323
+ process.exit(1);
29324
+ }
29325
+ exitOnApiError(err);
29326
+ throw err;
29327
+ }
29328
+ };
29329
+ if (!yes && !jsonOutput) {
29330
+ const checked = await put(true);
29331
+ console.log(`The Guide will be ${describeGuideHub(checked.hub)}.`);
29332
+ console.log("Every account provisioned from now on is enrolled in it as an end user, and the");
29333
+ console.log("owning org pays for every Guide conversation.");
29334
+ const ok = await confirm("Proceed?");
29335
+ if (!ok) {
29336
+ console.log("Aborted.");
29337
+ return;
29338
+ }
29339
+ }
29340
+ const written = await put(false);
29341
+ if (jsonOutput) {
29342
+ console.log(JSON.stringify(written, null, 2));
29343
+ return;
29344
+ }
29345
+ console.log(`The Guide is ${describeGuideHub(written.hub)}.`);
29346
+ console.log(PLATFORM_CONFIG_PROPAGATION_NOTE);
29347
+ }
29348
+ async function runGuideClear(positional, flagArgs) {
29349
+ const usage3 = "wayai admin guide clear [--json]";
29350
+ if (positional.length > 0) {
29351
+ console.error(usage3);
29352
+ process.exit(1);
29353
+ }
29354
+ const { jsonOutput } = parseGuideFlags(flagArgs, usage3, ["--json"]);
29355
+ const { config, accessToken } = await requireAuth();
29356
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
29357
+ try {
29358
+ const { data } = await client.adminClearGuideHub();
29359
+ if (jsonOutput) {
29360
+ console.log(JSON.stringify(data, null, 2));
29361
+ return;
29362
+ }
29363
+ } catch (err) {
29364
+ exitOnApiError(err);
29365
+ throw err;
29366
+ }
29367
+ console.log("The Guide is off: nobody new is enrolled, and the help entry is hidden.");
29368
+ console.log("People already enrolled keep their row on the Guide hub.");
29369
+ console.log(PLATFORM_CONFIG_PROPAGATION_NOTE);
29370
+ }
29371
+ async function runGuideStatus(positional, flagArgs) {
29372
+ const usage3 = "wayai admin guide status [--json]";
29373
+ if (positional.length > 0) {
29374
+ console.error(usage3);
29375
+ process.exit(1);
29376
+ }
29377
+ const { jsonOutput } = parseGuideFlags(flagArgs, usage3, ["--json"]);
29378
+ const { config, accessToken } = await requireAuth();
29379
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
29380
+ let data;
29381
+ try {
29382
+ data = (await client.adminGetGuide()).data;
29383
+ } catch (err) {
29384
+ exitOnApiError(err);
29385
+ throw err;
29386
+ }
29387
+ if (jsonOutput) {
29388
+ console.log(JSON.stringify(data, null, 2));
29389
+ return;
29390
+ }
29391
+ if (!data.guide_hub_id) {
29392
+ console.log("guide_hub_id (platform): not set \u2014 the Guide is off.");
29393
+ return;
29394
+ }
29395
+ console.log(`guide_hub_id (platform): ${data.guide_hub_id}`);
29396
+ if (!data.hub) {
29397
+ console.log("The hub cannot be read (deleted?). Run `wayai admin guide clear`.");
29398
+ return;
29399
+ }
29400
+ console.log(`Hub: ${describeGuideHub(data.hub)}`);
29401
+ console.log(`Environment: ${data.hub.hub_environment ?? "unknown"}; type: ${data.hub.hub_type ?? "unknown"}; app channel: ${data.hub.app_channel_enabled ? "enabled" : "DISABLED"}`);
29402
+ }
29155
29403
  function conflictReasonOf(err) {
29156
29404
  try {
29157
29405
  const reason = JSON.parse(err.body).details?.reason;
@@ -29770,6 +30018,11 @@ Usage:
29770
30018
  wayai admin communities destroy <community_id> [--yes] [--json]
29771
30019
  Destroy a community: its members' lists drop it and its storage is deleted (DESTRUCTIVE; confirms unless --yes)
29772
30020
 
30021
+ wayai admin guide set-hub <hub_id> [--yes] [--json]
30022
+ Make a production chat hub with an enabled app channel the WayAI Guide (prints its owning org and confirms, unless --yes or --json)
30023
+ wayai admin guide clear [--json] Turn the Guide off: nobody new is enrolled and the help entry is hidden
30024
+ wayai admin guide status [--json] Print which hub is the Guide, and its facts
30025
+
29773
30026
  Sources:
29774
30027
  do Live DO SQLite (existing conversation, hub config, etc.).
29775
30028
  analytics ClickHouse projections (conversation, message, schedule_event).
@@ -29859,6 +30112,12 @@ Sources:
29859
30112
  community for an org and \`destroy\` removes one, whichever way the switch
29860
30113
  is set; deleting an org destroys its communities too. Changes to the
29861
30114
  switch land within about 60 s.
30115
+ guide The WayAI Guide: ONE production chat hub, owned by WayAI, whose agent answers
30116
+ questions about the platform. While \`set-hub\` has named it, every account
30117
+ provisioned is enrolled in it as an end user and every signed-in person reaches
30118
+ it from the help entry ("Ask WayAI"); its owning org pays. \`clear\` stops new
30119
+ enrollment and hides the help entry; people already enrolled keep their row.
30120
+ Changes land within about 60 s.
29862
30121
 
29863
30122
  Types (do): ${VALID_TYPES.join(" | ")}
29864
30123
  Tables (analytics): ${VALID_ANALYTICS_TABLES.join(" | ")}
@@ -29909,6 +30168,7 @@ var init_admin = __esm({
29909
30168
  init_workspace();
29910
30169
  init_skill_version();
29911
30170
  init_file_map();
30171
+ init_errors2();
29912
30172
  init_contracts();
29913
30173
  VALID_TYPES = dataExplorerDebugDoType.options;
29914
30174
  VALID_ANALYTICS_TABLES = dataExplorerDebugAnalyticsTable.options;