@wayai/cli 0.3.359 → 0.3.360

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
@@ -5204,10 +5204,10 @@ var init_chunk_HZ6CADSY = __esm({
5204
5204
  }
5205
5205
  });
5206
5206
 
5207
- // ../../packages/core/dist/chunk-RACEDHG6.js
5208
- var resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery;
5209
- var init_chunk_RACEDHG6 = __esm({
5210
- "../../packages/core/dist/chunk-RACEDHG6.js"() {
5207
+ // ../../packages/core/dist/chunk-2ZBLI7IH.js
5208
+ var resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery, syncSkillsResultItemSchema, syncSkillsResponseSchema;
5209
+ var init_chunk_2ZBLI7IH = __esm({
5210
+ "../../packages/core/dist/chunk-2ZBLI7IH.js"() {
5211
5211
  "use strict";
5212
5212
  init_chunk_HZ6CADSY();
5213
5213
  init_zod();
@@ -5344,6 +5344,18 @@ var init_chunk_RACEDHG6 = __esm({
5344
5344
  resource_id: uuidSchema,
5345
5345
  agent_id: uuidSchema
5346
5346
  });
5347
+ syncSkillsResultItemSchema = external_exports.object({
5348
+ connection_id: external_exports.string().min(1),
5349
+ connection_name: external_exports.string(),
5350
+ uploaded: external_exports.number().int().nonnegative(),
5351
+ failed: external_exports.number().int().nonnegative(),
5352
+ errors: external_exports.array(external_exports.string())
5353
+ });
5354
+ syncSkillsResponseSchema = external_exports.object({
5355
+ success: external_exports.literal(true),
5356
+ message: external_exports.string(),
5357
+ results: external_exports.array(syncSkillsResultItemSchema)
5358
+ });
5347
5359
  }
5348
5360
  });
5349
5361
 
@@ -11588,7 +11600,7 @@ var init_chunk_C2UEA2KW = __esm({
11588
11600
  }
11589
11601
  });
11590
11602
 
11591
- // ../../packages/core/dist/chunk-QMQGGR7Q.js
11603
+ // ../../packages/core/dist/chunk-OLBDDBKV.js
11592
11604
  function resolveMonitorTrigger(monitorConfig) {
11593
11605
  if (!monitorConfig || typeof monitorConfig !== "object") return "idle";
11594
11606
  const raw = monitorConfig.trigger;
@@ -11894,8 +11906,8 @@ function refineMonitorRulesStructuredOutput(body, ctx) {
11894
11906
  if (refusal2) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["response_format"], message: refusal2 });
11895
11907
  }
11896
11908
  var 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;
11897
- var init_chunk_QMQGGR7Q = __esm({
11898
- "../../packages/core/dist/chunk-QMQGGR7Q.js"() {
11909
+ var init_chunk_OLBDDBKV = __esm({
11910
+ "../../packages/core/dist/chunk-OLBDDBKV.js"() {
11899
11911
  "use strict";
11900
11912
  init_chunk_IBL7FANV();
11901
11913
  init_chunk_KB5RK3RP();
@@ -12119,12 +12131,12 @@ var init_chunk_QMQGGR7Q = __esm({
12119
12131
  }
12120
12132
  });
12121
12133
 
12122
- // ../../packages/core/dist/chunk-QEEQN2NE.js
12134
+ // ../../packages/core/dist/chunk-V2CXEU5X.js
12123
12135
  var conversationIdParam, conversationHubQuery, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, deleteUserConversationsResponse, sendMessageBody, listConversationsQuery, flagSourceSchema, getConversationsResponse, getConversationDetailParams, getConversationDetailQuery, getConversationDetailResponse, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody;
12124
- var init_chunk_QEEQN2NE = __esm({
12125
- "../../packages/core/dist/chunk-QEEQN2NE.js"() {
12136
+ var init_chunk_V2CXEU5X = __esm({
12137
+ "../../packages/core/dist/chunk-V2CXEU5X.js"() {
12126
12138
  "use strict";
12127
- init_chunk_QMQGGR7Q();
12139
+ init_chunk_OLBDDBKV();
12128
12140
  init_chunk_HZ6CADSY();
12129
12141
  init_chunk_ZTNFLGW5();
12130
12142
  init_zod();
@@ -12920,10 +12932,10 @@ var init_chunk_YR7QALGP = __esm({
12920
12932
  }
12921
12933
  });
12922
12934
 
12923
- // ../../packages/core/dist/chunk-ME6NL7FI.js
12935
+ // ../../packages/core/dist/chunk-X4IDZLLS.js
12924
12936
  var caseVerifyQuery;
12925
- var init_chunk_ME6NL7FI = __esm({
12926
- "../../packages/core/dist/chunk-ME6NL7FI.js"() {
12937
+ var init_chunk_X4IDZLLS = __esm({
12938
+ "../../packages/core/dist/chunk-X4IDZLLS.js"() {
12927
12939
  "use strict";
12928
12940
  init_chunk_YR7QALGP();
12929
12941
  init_zod();
@@ -13876,7 +13888,7 @@ var init_chunk_D3EP4TDU = __esm({
13876
13888
  }
13877
13889
  });
13878
13890
 
13879
- // ../../packages/core/dist/chunk-JP42Y3U2.js
13891
+ // ../../packages/core/dist/chunk-ZANBA4K4.js
13880
13892
  function isEventRelativeFollowupType(type) {
13881
13893
  return typeof type === "string" && EVENT_RELATIVE_FOLLOWUP_TYPES.includes(type);
13882
13894
  }
@@ -13970,8 +13982,8 @@ function validateLaneReferences(lanes, statuses) {
13970
13982
  return issues;
13971
13983
  }
13972
13984
  var 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, kanbanLintWarningSchema;
13973
- var init_chunk_JP42Y3U2 = __esm({
13974
- "../../packages/core/dist/chunk-JP42Y3U2.js"() {
13985
+ var init_chunk_ZANBA4K4 = __esm({
13986
+ "../../packages/core/dist/chunk-ZANBA4K4.js"() {
13975
13987
  "use strict";
13976
13988
  init_chunk_6TSQ5HXC();
13977
13989
  init_chunk_HZ6CADSY();
@@ -14330,7 +14342,7 @@ var init_chunk_QT7R3TGR = __esm({
14330
14342
  }
14331
14343
  });
14332
14344
 
14333
- // ../../packages/core/dist/chunk-4NZTCAY5.js
14345
+ // ../../packages/core/dist/chunk-25BLQS73.js
14334
14346
  function refineLaneReferences(val, ctx) {
14335
14347
  const lanes = val.lanes;
14336
14348
  const statuses = val.kanban_statuses;
@@ -14354,11 +14366,11 @@ function describeSyncWarning(warning) {
14354
14366
  return `${label3}: ${parts.join("; ")}. Promote the base so production's tools match the preview's.`;
14355
14367
  }
14356
14368
  var hubIdParam, hubAdminIdParam, hubUserIdParam, hubAgentIdParam, 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, hubTypeSchema, supportModelSchema, unassignedPolicySchema, hubLanguageSchema, accessApprovalRoleSchema, createHubBody, updateHubBody, HUB_TAG_CHANGE_REFUSED, hubTagChangeRefusalSchema, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, CONTACT_ACCESS_PAGE_SIZE_MAX, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, hubRowObjectListSchema, createdHubRowSchema, createHubResponseSchema, diffEntrySchema, diffEntriesSchema, hubDiffResultSchema, HUB_DIFF_SECTION_SET, HUB_DIFF_SECTIONS, getHubDiffResponseSchema, publishHubResponseSchema, syncWarningSchema, syncHubResponseSchema, replicatePreviewHubResponseSchema, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam;
14357
- var init_chunk_4NZTCAY5 = __esm({
14358
- "../../packages/core/dist/chunk-4NZTCAY5.js"() {
14369
+ var init_chunk_25BLQS73 = __esm({
14370
+ "../../packages/core/dist/chunk-25BLQS73.js"() {
14359
14371
  "use strict";
14360
14372
  init_chunk_D3EP4TDU();
14361
- init_chunk_JP42Y3U2();
14373
+ init_chunk_ZANBA4K4();
14362
14374
  init_chunk_QT7R3TGR();
14363
14375
  init_chunk_HZ6CADSY();
14364
14376
  init_chunk_ZTNFLGW5();
@@ -14681,7 +14693,7 @@ var init_chunk_4NZTCAY5 = __esm({
14681
14693
  }
14682
14694
  });
14683
14695
 
14684
- // ../../packages/core/dist/chunk-A3KD6FK4.js
14696
+ // ../../packages/core/dist/chunk-JTG72ANZ.js
14685
14697
  function declaresNoConnection(agent) {
14686
14698
  return agent.connection === null && !agent.connection_id;
14687
14699
  }
@@ -15412,21 +15424,22 @@ function skillSectionsAsResources(scope) {
15412
15424
  return out;
15413
15425
  };
15414
15426
  }
15415
- var 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_HUB_AS_CODE_PAGE_MANIFEST_CHARS, hubAsCodePagesSchema, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, HUB_AS_CODE_AGENT_TOOL_KEYS, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, flagEntriesOf, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, MAX_HUB_AS_CODE_DEPTH, NAMED_DEPTH_SEGMENTS, NAMED_DEPTH_KEY_CHARS, fieldName, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciDiffDirectionSchema, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, ciDiffResponseSchema, ciHubIdentitySchema, ciLookupResponseSchema, ciOrganizationsResponseSchema, ciCreateOrganizationResponseSchema, ciHubListItemSchema, ciHubListResponseSchema, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema, ciOrgResourcesPushResponseSchema;
15416
- var init_chunk_A3KD6FK4 = __esm({
15417
- "../../packages/core/dist/chunk-A3KD6FK4.js"() {
15427
+ var 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, hubAsCodeKanbanFollowupSchema, hubAsCodeKanbanOutcomeSchema, hubAsCodeKanbanStatusSchema, hubAsCodeLaneSchema, hubAsCodePageSchema, MAX_HUB_AS_CODE_PAGE_MANIFEST_CHARS, hubAsCodePagesSchema, hubAsCodeCallOpeningSchema, hubAsCodeCallOpeningFileSchema, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, hubAsCodeEvaluationVariableSchema, hubAsCodeNativeToolSchema, hubAsCodeMcpToolSchema, hubAsCodeCustomToolSchema, hubAsCodeStateSchema, hubAsCodeTeamSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, hubAsCodeAgentResourceSchema, hubAsCodeDelegationToolSchema, hubAsCodeAgentSchema, HUB_AS_CODE_AGENT_KEYS, HUB_AS_CODE_AGENT_TOOL_KEYS, orgAsCodeResourceFolderSchema, orgAsCodeResourceSchema, orgResourcesPayloadSchema, hubAsCodeAutomationSchema, HUB_AS_CODE_AUTOMATION_KEYS, HUB_AS_CODE_AUTOMATION_TRIGGER_KEYS, HUB_AS_CODE_AUTOMATION_TARGET_KEYS, HUB_AS_CODE_AUTOMATION_ACTION_KEYS, HUB_AS_CODE_AUTOMATION_GATE_KEYS, hubAsCodeContactListSchema, HUB_AS_CODE_CONTACT_LIST_KEYS, HUB_AS_CODE_CONTACT_LIST_FILTER_KEYS, hubAsCodeEvalMessageFields, hubAsCodeHistoryTurnSchema, hubAsCodeEvalSchema, hubAsCodeEvalAttachmentFileSchema, hubAsCodeJourneyTurnSchema, hubAsCodeJourneyStepOverrideSchema, hubAsCodeJourneySchema, uuidPattern, ciUuidSchema, flagEntriesOf, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, MAX_HUB_AS_CODE_DEPTH, NAMED_DEPTH_SEGMENTS, NAMED_DEPTH_KEY_CHARS, fieldName, hubAsCodeConfigObjectSchema, hubAsCodeConfigSchema, hubAsCodeConnectionSchema, hubAsCodePayloadSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciDiffDirectionSchema, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, ciDiffResponseSchema, ciHubIdentitySchema, ciLookupResponseSchema, ciOrganizationsResponseSchema, ciCreateOrganizationResponseSchema, ciHubListItemSchema, ciHubListResponseSchema, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema, ciPublishResponseSchema, ciMcpDriftEntrySchema, ciSyncMcpResponseSchema, ciPublishPreviewResponseSchema, ciBranchInfoSchema, ciBranchListResponseSchema, ciBranchDeleteResponseSchema, ciOrgResourcesPullFileSchema, ciOrgResourcesPullFolderSchema, ciOrgResourcesPullResourceSchema, ciOrgResourcesPullResponseSchema, ciOrgResourcesPushResponseSchema;
15428
+ var init_chunk_JTG72ANZ = __esm({
15429
+ "../../packages/core/dist/chunk-JTG72ANZ.js"() {
15418
15430
  "use strict";
15419
15431
  init_chunk_QG3XMUEN();
15420
15432
  init_chunk_EBUWHIFV();
15421
15433
  init_chunk_5YZ3R7KF();
15422
- init_chunk_QMQGGR7Q();
15434
+ init_chunk_OLBDDBKV();
15423
15435
  init_chunk_LBDH7LCG();
15424
15436
  init_chunk_4LXDRTO4();
15425
- init_chunk_4NZTCAY5();
15426
- init_chunk_JP42Y3U2();
15437
+ init_chunk_25BLQS73();
15438
+ init_chunk_ZANBA4K4();
15427
15439
  init_chunk_QT7R3TGR();
15428
15440
  init_chunk_S4VDZ7PZ();
15429
15441
  init_chunk_ZDTX3DG5();
15442
+ init_chunk_JP7XIMUA();
15430
15443
  init_chunk_C2UEA2KW();
15431
15444
  init_chunk_FBV7NLKO();
15432
15445
  init_chunk_WEXVYJ5H();
@@ -15442,6 +15455,92 @@ var init_chunk_A3KD6FK4 = __esm({
15442
15455
  MAX_HUB_AS_CODE_RESOURCE_FILES = 5e3;
15443
15456
  MAX_RESOURCE_AGGREGATE_ENCODED_BYTES = 32 * 1024 * 1024;
15444
15457
  MAX_CI_CONFIG_BODY_BYTES = 64 * 1024 * 1024;
15458
+ hubAsCodeKanbanFollowupSchema = external_exports.object({
15459
+ id: external_exports.string().optional(),
15460
+ order: external_exports.number(),
15461
+ type: followupTypeSchema,
15462
+ threshold: external_exports.number(),
15463
+ timeUnit: followupTimeUnitSchema,
15464
+ instructions: external_exports.string(),
15465
+ excludedWeekDays: external_exports.array(external_exports.number()).optional(),
15466
+ excludeHolidays: external_exports.boolean().optional(),
15467
+ excludedTimeStart: external_exports.string().optional(),
15468
+ excludedTimeEnd: external_exports.string().optional(),
15469
+ /** 'agent_generated' (default) feeds `instructions` to the LLM; 'direct' sends `direct_text` verbatim. */
15470
+ delivery_mode: external_exports.enum(["agent_generated", "direct"]).optional(),
15471
+ /** Verbatim user-facing text. Required when `delivery_mode='direct'`. */
15472
+ direct_text: external_exports.string().optional(),
15473
+ /** Approved Meta WhatsApp template id; consulted only outside the WA 24h window. */
15474
+ template_whatsapp_id: external_exports.string().nullable().optional(),
15475
+ /** Default `'route_to_team'` when omitted. Only consulted on `direct` mode + windowed channels outside the window. */
15476
+ outside_window_policy: external_exports.enum(["route_to_team", "skip"]).optional(),
15477
+ /** Default true — followup turn includes tool schemas. Set to false to strip them and save tokens. No effect on `direct` mode. */
15478
+ include_tools: external_exports.boolean().optional(),
15479
+ /** `inactivity_after_before_event` only: the `id` of the `before_event` followup in
15480
+ * this status whose fire anchors this chain. */
15481
+ after_followup_id: external_exports.string().optional()
15482
+ });
15483
+ hubAsCodeKanbanOutcomeSchema = external_exports.object({
15484
+ slug: external_exports.string(),
15485
+ name: external_exports.string(),
15486
+ color: external_exports.string().optional(),
15487
+ from_statuses: external_exports.array(external_exports.string()).optional()
15488
+ });
15489
+ hubAsCodeKanbanStatusSchema = external_exports.object({
15490
+ /** Stable identifier — set once at create, never edited. Lowercase slug, used in
15491
+ * `conversation.kanban_status`, ClickHouse `data.meta.kanban_status`, tool params,
15492
+ * and `allowed_next_statuses` references. */
15493
+ slug: external_exports.string(),
15494
+ /** Display label — shown in UI and tool descriptions. Freely editable. */
15495
+ name: external_exports.string(),
15496
+ order: external_exports.number().optional(),
15497
+ color: external_exports.string().optional(),
15498
+ isInitialStatus: external_exports.boolean().optional(),
15499
+ triggersAgentResponse: external_exports.boolean().optional(),
15500
+ allowsAgentUpdate: external_exports.boolean().optional(),
15501
+ isTerminalStatus: external_exports.boolean().optional(),
15502
+ isSchedulingStatus: external_exports.boolean().optional(),
15503
+ eventName: external_exports.string().optional(),
15504
+ /** Minutes after the scheduled event date at which the conversation is flagged
15505
+ * `event_due` for the support team. Scheduling statuses only. */
15506
+ event_due_delay_minutes: external_exports.number().optional(),
15507
+ /** Template prose injected into the agent turn on transition. Supports
15508
+ * `{{path.to.field}}` placeholders (dotted, whitespace-tolerant) and the
15509
+ * reserved `{{additional_data}}` placeholder which expands to the full
15510
+ * payload as 2-space-indented JSON. */
15511
+ additional_instructions: external_exports.string().optional(),
15512
+ /** JSON Schema (Draft 2020-12) defining the form fields collected at
15513
+ * transition time. The collected payload is interpolated into
15514
+ * `additional_instructions` and emitted to the agent as a
15515
+ * `<system_additional_instructions>` block. Top-level property name
15516
+ * `additional_data` is reserved (collides with the dump placeholder).
15517
+ * Capped at 16 KB when JSON-serialized. */
15518
+ additional_context_schema: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
15519
+ followups: external_exports.array(hubAsCodeKanbanFollowupSchema).optional(),
15520
+ /** Slugs this status can transition to. `undefined` = unrestricted (any next).
15521
+ * Empty array is rejected by the validator — use `isTerminalStatus: true` for
15522
+ * no outbound transitions. */
15523
+ allowed_next_statuses: external_exports.array(external_exports.string()).optional(),
15524
+ /** Optional presentational lane this status belongs to (slug of a hub `lanes[]`
15525
+ * entry). Board-grouping only; not a transition constraint, not agent-visible.
15526
+ * The initial status must not set this. */
15527
+ lane_slug: external_exports.string().optional(),
15528
+ /** Closing outcomes offered when a conversation enters this status. Only valid
15529
+ * on the terminal status (`isTerminalStatus: true`); rejected elsewhere. When
15530
+ * present, choosing one is required on the terminal transition, and the chosen
15531
+ * slug is stored on the conversation and ingested to ClickHouse `data.meta.outcome`. */
15532
+ outcomes: external_exports.array(hubAsCodeKanbanOutcomeSchema).optional()
15533
+ });
15534
+ hubAsCodeLaneSchema = external_exports.object({
15535
+ slug: external_exports.string(),
15536
+ name: external_exports.string(),
15537
+ color: external_exports.string().optional(),
15538
+ order: external_exports.number().optional()
15539
+ });
15540
+ hubAsCodePageSchema = external_exports.object({
15541
+ manifest: external_exports.record(external_exports.string(), external_exports.unknown()),
15542
+ html: external_exports.string()
15543
+ });
15445
15544
  MAX_HUB_AS_CODE_PAGE_MANIFEST_CHARS = 64 * 1024;
15446
15545
  hubAsCodePagesSchema = external_exports.array(external_exports.object({
15447
15546
  manifest: external_exports.record(external_exports.unknown()).superRefine((manifest, ctx) => {
@@ -15451,14 +15550,101 @@ var init_chunk_A3KD6FK4 = __esm({
15451
15550
  }),
15452
15551
  html: external_exports.string().max(PAGE_HTML_MAX_BYTES, `a page's HTML is at most ${PAGE_HTML_MAX_BYTES / 1024} KiB`)
15453
15552
  }).strict()).max(PAGES_PER_HUB_MAX, `a hub holds at most ${PAGES_PER_HUB_MAX} pages`);
15553
+ hubAsCodeCallOpeningSchema = external_exports.object({
15554
+ hash: external_exports.string().optional(),
15555
+ file: external_exports.string().optional(),
15556
+ caption: external_exports.string()
15557
+ });
15558
+ hubAsCodeCallOpeningFileSchema = external_exports.object({
15559
+ hash: external_exports.string(),
15560
+ content_base64: external_exports.string().optional(),
15561
+ // push only
15562
+ download_url: external_exports.string().optional(),
15563
+ // pull only (signed R2 URL)
15564
+ content_type: external_exports.string().optional()
15565
+ // pull only: `audio/mpeg` or `audio/mp4`, which names the local file
15566
+ });
15454
15567
  MAX_CALL_OPENING_CARRIERS = 30;
15455
15568
  MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES = 8 * 1024 * 1024;
15456
- HUB_AS_CODE_AGENT_TOOL_KEYS = [
15457
- "native",
15458
- "delegation",
15459
- "custom",
15460
- "mcp"
15461
- ];
15569
+ hubAsCodeEvaluationVariableSchema = external_exports.object({
15570
+ /** Variable name the agent writes — unique within the agent. Required. */
15571
+ name: external_exports.string(),
15572
+ /** 'string' (default) | 'number' | 'boolean' | 'integer' | 'enum'. */
15573
+ type: external_exports.string().optional(),
15574
+ description: external_exports.string().optional(),
15575
+ /** Human-facing display label (Analytics columns, UI). */
15576
+ label: external_exports.string().optional(),
15577
+ /** Allowed values when `type: enum`. Ignored for other types. */
15578
+ enum: external_exports.array(external_exports.string()).optional(),
15579
+ /** Defaults to true when omitted (mirrors the UI's new-variable default). */
15580
+ required: external_exports.boolean().optional(),
15581
+ /**
15582
+ * Analytics grouping. Conventional values: quality | satisfaction |
15583
+ * compliance | categorization. Free-form to preserve system-internal
15584
+ * markers (e.g. `eval` on message-evaluator defaults) across round-trips.
15585
+ */
15586
+ category: external_exports.string().nullable().optional(),
15587
+ /**
15588
+ * Marks the rolling conversation-summary field. Only honored for
15589
+ * `type: string`; coerced to false otherwise.
15590
+ */
15591
+ is_summary: external_exports.boolean().optional()
15592
+ });
15593
+ hubAsCodeNativeToolSchema = external_exports.object({
15594
+ id: external_exports.string().optional(),
15595
+ name: external_exports.string(),
15596
+ keep_in_history: external_exports.boolean().optional(),
15597
+ expose_schema_to_llm: external_exports.boolean().optional(),
15598
+ /**
15599
+ * Whether the tool runs. A pull writes it only as `false`. Omitted leaves the row as it is, unlike a
15600
+ * custom tool's: a file pulled before a pull wrote this key holds none on a row that is off.
15601
+ */
15602
+ enabled: external_exports.boolean().optional()
15603
+ });
15604
+ hubAsCodeMcpToolSchema = external_exports.object({
15605
+ id: external_exports.string().optional(),
15606
+ name: external_exports.string(),
15607
+ connection: external_exports.string().optional(),
15608
+ connection_id: external_exports.string().optional(),
15609
+ /** As {@link HubAsCodeNativeTool}'s `enabled`. */
15610
+ enabled: external_exports.boolean().optional()
15611
+ });
15612
+ hubAsCodeCustomToolSchema = external_exports.object({
15613
+ id: external_exports.string().optional(),
15614
+ name: external_exports.string(),
15615
+ description: external_exports.string().optional(),
15616
+ method: external_exports.string().optional(),
15617
+ path: external_exports.string().optional(),
15618
+ body_format: external_exports.string().optional(),
15619
+ connection: external_exports.string().optional(),
15620
+ connection_id: external_exports.string().optional(),
15621
+ headers: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
15622
+ query_params: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
15623
+ body_params: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
15624
+ /**
15625
+ * The OpenAI function schema (`tool_config`). A pull answers it as stored, so a row a write stored as
15626
+ * JSON text holding the object comes back as that text (`customToolConfigObject` reads it).
15627
+ */
15628
+ config: external_exports.union([external_exports.record(external_exports.string(), external_exports.unknown()), external_exports.string()]).optional(),
15629
+ keep_in_history: external_exports.boolean().optional(),
15630
+ // default false; controls whether tool call+result remain in LLM history
15631
+ instructions: external_exports.string().optional(),
15632
+ composed_tools: external_exports.array(external_exports.object({
15633
+ tool_name: external_exports.string(),
15634
+ mappings: external_exports.record(external_exports.string(), external_exports.union([
15635
+ external_exports.string(),
15636
+ external_exports.object({ source: external_exports.string(), type: external_exports.string().optional(), description: external_exports.string().optional() })
15637
+ ])),
15638
+ appended_description: external_exports.string().optional(),
15639
+ success_path: external_exports.string().optional()
15640
+ })).nullable().optional(),
15641
+ enabled: external_exports.boolean().optional(),
15642
+ expose_schema_to_llm: external_exports.boolean().optional(),
15643
+ /** The hub's replay settings on the tool (wayai#5083; `withToolReplaySettings`). Absent: unset. */
15644
+ replay_override: external_exports.enum(REPLAY_OVERRIDES).optional(),
15645
+ idempotency_header: external_exports.string().optional(),
15646
+ irreversible: external_exports.boolean().optional()
15647
+ });
15462
15648
  hubAsCodeStateSchema = external_exports.object({
15463
15649
  id: external_exports.string().min(1).optional(),
15464
15650
  slug: external_exports.string().optional(),
@@ -15470,6 +15656,16 @@ var init_chunk_A3KD6FK4 = __esm({
15470
15656
  json_schema: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
15471
15657
  initial_value: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional()
15472
15658
  }).passthrough();
15659
+ hubAsCodeTeamSchema = external_exports.object({
15660
+ id: external_exports.string().optional(),
15661
+ // hub_team_id (stable, set by pull)
15662
+ name: external_exports.string(),
15663
+ // team_name
15664
+ access_rule: external_exports.enum(["anytime", "anytime_if_delegated_once", "only_while_delegated"]).optional(),
15665
+ initial_team: external_exports.boolean().optional(),
15666
+ display_only_if_claimed: external_exports.boolean().optional()
15667
+ // conversation_display_only_if_claimed
15668
+ });
15473
15669
  hubAsCodeResourceFileSchema = external_exports.object({
15474
15670
  id: external_exports.string().min(1).optional(),
15475
15671
  // resource_file_id (stable, set by pull)
@@ -15501,6 +15697,380 @@ var init_chunk_A3KD6FK4 = __esm({
15501
15697
  // skill-only; auto-derived when omitted
15502
15698
  files: external_exports.array(hubAsCodeResourceFileSchema).optional()
15503
15699
  }).passthrough();
15700
+ hubAsCodeAgentResourceSchema = external_exports.object({
15701
+ name: external_exports.string(),
15702
+ // resource display name
15703
+ resource_id: external_exports.string().optional(),
15704
+ // stable ID
15705
+ priority: external_exports.number().optional(),
15706
+ enabled: external_exports.boolean().optional(),
15707
+ // `include_structure_in_prompt` was removed here in PR 5 — structure is now
15708
+ // asked for per call with `{{files('tree')}}`. `hubAsCodeConfigSchema` is
15709
+ // `.passthrough()`, so YAML pulled before that still parses; the diff engine
15710
+ // simply ignores the key.
15711
+ use_native_integration: external_exports.boolean().optional()
15712
+ // skill-only: tool-based (false) vs provider-native (true)
15713
+ // `write_enabled` was retired with knowledge (wayai-pro/wayai#5142 step 5 C1); YAML pulled before
15714
+ // that still parses (passthrough), and the diff engine ignores the key.
15715
+ });
15716
+ hubAsCodeDelegationToolSchema = external_exports.object({
15717
+ id: external_exports.string().optional(),
15718
+ type: external_exports.string(),
15719
+ tool: external_exports.string(),
15720
+ target: external_exports.string(),
15721
+ target_id: external_exports.string().optional(),
15722
+ /** Only for `type: 'hub'` (`delegate_to_hub`, H1.5) — the admin's
15723
+ * data-boundary choice (`instruction` | `summary` | `transcript`). */
15724
+ context_boundary: external_exports.string().optional(),
15725
+ /** Only for `tool: start_consult_thread` (H1.7b) — the EXPLICIT
15726
+ * consultant→consultant chain opt-in. Chains are off by default. */
15727
+ allow_consultant_chain: external_exports.boolean().optional(),
15728
+ /** As {@link HubAsCodeNativeTool}'s `enabled`. */
15729
+ enabled: external_exports.boolean().optional()
15730
+ });
15731
+ hubAsCodeAgentSchema = external_exports.object({
15732
+ id: external_exports.string().optional(),
15733
+ name: external_exports.string(),
15734
+ role: external_exports.string(),
15735
+ /** The connection's name. `null` for an agent whose row stores none (`declaresNoConnection`): a pull writes it. */
15736
+ connection: external_exports.string().nullable(),
15737
+ /** The connection's id; `null` beside a `null` connection on a pull. */
15738
+ connection_id: external_exports.string().nullable().optional(),
15739
+ instructions: external_exports.string().optional(),
15740
+ additional_context_template: external_exports.string().optional(),
15741
+ enabled: external_exports.boolean().optional(),
15742
+ include_message_timestamps: external_exports.boolean().optional(),
15743
+ settings: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
15744
+ response_format: external_exports.object({
15745
+ type: external_exports.string(),
15746
+ schema_name: external_exports.string(),
15747
+ schema_json: external_exports.record(external_exports.string(), external_exports.unknown())
15748
+ }).optional(),
15749
+ tools: external_exports.object({
15750
+ native: external_exports.array(external_exports.union([external_exports.string(), hubAsCodeNativeToolSchema])).optional(),
15751
+ delegation: external_exports.array(hubAsCodeDelegationToolSchema).optional(),
15752
+ custom: external_exports.array(hubAsCodeCustomToolSchema).optional(),
15753
+ /**
15754
+ * MCP tools discovered from an MCP Server connection, assigned to this agent.
15755
+ * Identity key is `(connection, name)` (an MCP tool name is unique per server).
15756
+ *
15757
+ * **Omitted vs present (mirrors `evaluation_variables`):** when the `mcp` key
15758
+ * is OMITTED, existing MCP tool rows on the agent are left untouched (so tools
15759
+ * assigned in the Platform UI survive a push that doesn't manage them). When
15760
+ * PRESENT (even as `[]`), the list is AUTHORITATIVE — listed-but-missing tools
15761
+ * are created, unlisted MCP tools are removed, matched ones kept. This differs
15762
+ * from `native`/`custom` (whose absence deletes them) because MCP tools are
15763
+ * dual-origin (UI + GitOps).
15764
+ *
15765
+ * Push discovers the connection's tools on demand (equivalent to the UI's
15766
+ * "Sync MCP tools" action), so a single push can create the connection AND
15767
+ * assign its tools — the MCP server must be reachable.
15768
+ */
15769
+ mcp: external_exports.array(hubAsCodeMcpToolSchema).optional()
15770
+ }).optional(),
15771
+ resources: external_exports.array(hubAsCodeAgentResourceSchema).optional(),
15772
+ /**
15773
+ * Evaluation variables (a.k.a. agent parameters) — the structured fields an
15774
+ * evaluator agent writes per conversation/message. Round-trippable via
15775
+ * pull/push. Identity key is `name` (unique per agent). When the key is
15776
+ * OMITTED from YAML, existing variables are left untouched; when PRESENT
15777
+ * (even as `[]`), the list is treated as authoritative and replaces the
15778
+ * agent's current variables. Primarily used by `conversation_evaluator` /
15779
+ * `message_evaluator` agents.
15780
+ */
15781
+ evaluation_variables: external_exports.array(hubAsCodeEvaluationVariableSchema).optional(),
15782
+ /**
15783
+ * Conversation-flagging conditions evaluated post-close (OR semantics). A true
15784
+ * agent parameter on the `conversation_evaluator` agent (relocated from the hub
15785
+ * section). Round-trippable via pull/push. Meaningful only on the
15786
+ * `conversation_evaluator` agent; ignored elsewhere.
15787
+ */
15788
+ flag_conditions: external_exports.array(flagConditionSchema).optional(),
15789
+ /**
15790
+ * Token threshold that fires the rolling summarizer (effective tokens =
15791
+ * input + cache_read + cache_creation; default 120000). A true agent parameter
15792
+ * on the `summarizer` agent (relocated from the hub section). Round-trippable via
15793
+ * pull/push. Meaningful only on the `summarizer` agent; ignored elsewhere.
15794
+ */
15795
+ summarization_threshold_tokens: external_exports.number().optional(),
15796
+ /**
15797
+ * How many of the user's most recent ended conversations this agent receives as
15798
+ * context, injected into the conversation's first user message and frozen there for
15799
+ * the life of that conversation. `0` = off; bounded by `PREVIOUS_CONVERSATIONS_MAX`.
15800
+ * Ignored on background roles (monitor, evaluators, summarizer), which never address
15801
+ * the end user.
15802
+ *
15803
+ * Round-trippable via pull/push with the same patch semantics as every other optional
15804
+ * agent key: absent on CREATE is off, absent on UPDATE leaves the stored value alone,
15805
+ * and `0` is what clears one.
15806
+ */
15807
+ previous_conversations_count: external_exports.number().optional(),
15808
+ /**
15809
+ * Monitor scheduling + flagging config. A true agent parameter on the `monitor`
15810
+ * agent (relocated from the hub section). Round-trippable via pull/push.
15811
+ * Meaningful only on the `monitor` agent; ignored elsewhere.
15812
+ *
15813
+ * `trigger` says WHEN the monitor runs and defaults to `idle` when absent.
15814
+ * `delay_seconds` describes the `idle` fire alone, so it is required exactly
15815
+ * when the effective trigger is `idle`, and floored at
15816
+ * `MONITOR_DELAY_SECONDS_MIN` — both enforced by
15817
+ * `refineHubAsCodeMonitorConfig` and the apply/diff normalization, because
15818
+ * agents carry no Zod object schema on this path.
15819
+ *
15820
+ * Any object, typed `MonitorConfig`: a pull answers the column as stored, which may carry keys
15821
+ * that type does not name (`monitorConfigField` is `.passthrough()`).
15822
+ */
15823
+ monitor_config: external_exports.custom((value) => isPlainObject(value)).nullable().optional(),
15824
+ /**
15825
+ * The voice agent's own call openings, by language (`agent.call_openings`, gh #4418):
15826
+ * meaningful only on a `pilot_voice` agent. A language left out plays the platform's
15827
+ * opening. Round-trippable via pull/push. **Omitted vs present (mirrors
15828
+ * `evaluation_variables`):** OMITTED leaves the stored openings alone, so openings set in
15829
+ * the web editor survive a push that doesn't manage them; PRESENT (even `{}` or `null`) is
15830
+ * authoritative — every language it lists is set, and every other one is cleared.
15831
+ */
15832
+ call_openings: external_exports.record(callOpeningLanguage, hubAsCodeCallOpeningSchema).nullable().optional(),
15833
+ /**
15834
+ * The agent's access values (`agent.access_values`, wayai#5358): per dimension of the org, the
15835
+ * value ids it may read and write, checked against the org's dimensions on push, which narrow its turns
15836
+ * on the record types that enforce a dimension. **Omitted vs present (mirrors `call_openings`):** OMITTED leaves the stored
15837
+ * values alone; `null` clears them, so the agent narrows nothing; an object replaces them whole.
15838
+ * Changing them takes `hub:admin` on the hub, and an agent holding them that can run code must use
15839
+ * its own sandbox (`sandbox_scope: agent`). A pull answers them as held, `$person` included.
15840
+ */
15841
+ access_values: heldAccessAssignmentSchema.nullable().optional()
15842
+ });
15843
+ HUB_AS_CODE_AGENT_KEYS = hubAsCodeAgentSchema.keyof().options;
15844
+ HUB_AS_CODE_AGENT_TOOL_KEYS = hubAsCodeAgentSchema.shape.tools.unwrap().keyof().options;
15845
+ orgAsCodeResourceFolderSchema = external_exports.object({
15846
+ id: external_exports.string().min(1).optional(),
15847
+ // org_resource_folder_id (stable, set by pull)
15848
+ path: external_exports.string(),
15849
+ // folder path relative to resource root, e.g. "docs/guides"
15850
+ description: external_exports.string().optional()
15851
+ // folder_description
15852
+ });
15853
+ orgAsCodeResourceSchema = external_exports.object({
15854
+ id: external_exports.string().min(1).optional(),
15855
+ // org_resource_id (stable, set by pull)
15856
+ name: external_exports.string(),
15857
+ description: external_exports.string().optional(),
15858
+ enabled: external_exports.boolean().optional(),
15859
+ // No `user_browsable` (retired, wayai#4710): the org config schema passes it through
15860
+ // like the hub one, and the org diff and apply ignore it.
15861
+ skill_name: external_exports.string().optional(),
15862
+ // skill-only: slugified unique name (auto-derived from name if omitted)
15863
+ environment: external_exports.enum(["all", "preview", "production"]).optional(),
15864
+ // which hub environments may link this resource
15865
+ tags: external_exports.array(external_exports.string()).optional(),
15866
+ // org_tag UUIDs gating hub eligibility
15867
+ folders: external_exports.array(orgAsCodeResourceFolderSchema).optional(),
15868
+ // explicit folders (preserves empty/described folders)
15869
+ files: external_exports.array(hubAsCodeResourceFileSchema).optional()
15870
+ // identical shape to hub resource files
15871
+ });
15872
+ orgResourcesPayloadSchema = external_exports.object({
15873
+ version: external_exports.literal(1),
15874
+ organization_id: external_exports.string().optional(),
15875
+ resources: external_exports.array(orgAsCodeResourceSchema).optional()
15876
+ });
15877
+ hubAsCodeAutomationSchema = external_exports.object({
15878
+ id: external_exports.string().optional(),
15879
+ name: external_exports.string(),
15880
+ description: external_exports.string().optional(),
15881
+ purpose: external_exports.string().optional(),
15882
+ // marketing | operational; absent is marketing (`AUTOMATION_PURPOSES`)
15883
+ enabled: external_exports.boolean().optional(),
15884
+ trigger: external_exports.object({
15885
+ type: external_exports.string(),
15886
+ cron: external_exports.string().optional(),
15887
+ timezone: external_exports.string().optional(),
15888
+ event: external_exports.string().optional(),
15889
+ // an `event` trigger's event (`AUTOMATION_EVENT_TYPES`)
15890
+ source_hub: external_exports.string().optional(),
15891
+ // the production hub (id) whose events it listens to; absent: this hub's
15892
+ auth: external_exports.string().optional(),
15893
+ // webhook: hmac | static_header (`AUTOMATION_WEBHOOK_AUTHS`)
15894
+ header: external_exports.string().optional()
15895
+ // webhook, static_header: the header that carries the secret
15896
+ }),
15897
+ target: external_exports.object({
15898
+ type: external_exports.string(),
15899
+ list: external_exports.string().optional(),
15900
+ // hub contact list name (this hub's `contact_lists:`)
15901
+ org_list: external_exports.string().optional()
15902
+ // org contact list name (the org contact book's, never the hub's)
15903
+ }),
15904
+ action: external_exports.object({
15905
+ type: external_exports.string(),
15906
+ channel: external_exports.string().optional(),
15907
+ connection: external_exports.string().optional(),
15908
+ // connection display name
15909
+ connection_id: external_exports.string().optional(),
15910
+ template: external_exports.string().optional(),
15911
+ // WhatsApp template name, on the action's connection
15912
+ template_id: external_exports.string().optional(),
15913
+ text: external_exports.string().optional(),
15914
+ agent: external_exports.string().optional(),
15915
+ // agent name
15916
+ agent_id: external_exports.string().optional(),
15917
+ instructions: external_exports.string().optional()
15918
+ }),
15919
+ gate: external_exports.object({
15920
+ monitor: external_exports.string()
15921
+ }).nullable().optional()
15922
+ });
15923
+ HUB_AS_CODE_AUTOMATION_KEYS = hubAsCodeAutomationSchema.keyof().options;
15924
+ HUB_AS_CODE_AUTOMATION_TRIGGER_KEYS = hubAsCodeAutomationSchema.shape.trigger.keyof().options;
15925
+ HUB_AS_CODE_AUTOMATION_TARGET_KEYS = hubAsCodeAutomationSchema.shape.target.keyof().options;
15926
+ HUB_AS_CODE_AUTOMATION_ACTION_KEYS = hubAsCodeAutomationSchema.shape.action.keyof().options;
15927
+ HUB_AS_CODE_AUTOMATION_GATE_KEYS = hubAsCodeAutomationSchema.shape.gate.unwrap().unwrap().keyof().options;
15928
+ hubAsCodeContactListSchema = external_exports.object({
15929
+ id: external_exports.string().optional(),
15930
+ name: external_exports.string(),
15931
+ description: external_exports.string().optional(),
15932
+ filter: external_exports.object({
15933
+ labels: external_exports.array(external_exports.string()).optional(),
15934
+ scope_tags: external_exports.array(external_exports.string()).optional()
15935
+ // org tag names
15936
+ })
15937
+ });
15938
+ HUB_AS_CODE_CONTACT_LIST_KEYS = hubAsCodeContactListSchema.keyof().options;
15939
+ HUB_AS_CODE_CONTACT_LIST_FILTER_KEYS = hubAsCodeContactListSchema.shape.filter.keyof().options;
15940
+ hubAsCodeEvalMessageFields = {
15941
+ role: external_exports.string(),
15942
+ content: external_exports.string().nullable().optional(),
15943
+ tool_calls: external_exports.unknown().optional()
15944
+ };
15945
+ hubAsCodeHistoryTurnSchema = external_exports.object({
15946
+ ...hubAsCodeEvalMessageFields,
15947
+ tool_call_id: external_exports.string().optional(),
15948
+ /** User-turn-only file references — see `EvalAttachmentRef` (gh #3365). */
15949
+ attachments: external_exports.array(evalAttachmentRef).optional()
15950
+ });
15951
+ hubAsCodeEvalSchema = external_exports.object({
15952
+ id: external_exports.string().optional(),
15953
+ name: external_exports.string(),
15954
+ path: external_exports.string().nullable().optional(),
15955
+ agent: external_exports.string(),
15956
+ // agent display name
15957
+ agent_id: external_exports.string().optional(),
15958
+ // stable agent UUID
15959
+ runs: external_exports.number().optional(),
15960
+ // default 1
15961
+ enabled: external_exports.boolean().optional(),
15962
+ // default true
15963
+ history: external_exports.array(hubAsCodeHistoryTurnSchema).optional(),
15964
+ input: external_exports.object({ ...hubAsCodeEvalMessageFields, attachments: external_exports.array(evalAttachmentRef).optional() }),
15965
+ expected: external_exports.object(hubAsCodeEvalMessageFields),
15966
+ evaluator_instructions: external_exports.string().optional(),
15967
+ /**
15968
+ * Per-run variables (gh #3007): a map of author-provided arrays. Run i of
15969
+ * `runs` resolves `{{var(NAME)}}` / `{{var(NAME).field}}` in input/history/
15970
+ * expected/evaluator_instructions against `variables.NAME[i-1]`, so a
15971
+ * data-mutating eval leases a disjoint fixture per run. Each array MUST cover
15972
+ * `runs` (validated at run-launch). Values may be objects (one index → a
15973
+ * coherent bundle).
15974
+ */
15975
+ variables: external_exports.record(external_exports.string(), external_exports.array(external_exports.unknown())).optional(),
15976
+ /**
15977
+ * Eval-session seed fixture (gh #3090): the named Rekor fixture this scenario's
15978
+ * set depends on. At run-start `run-eval` resets it before the session and
15979
+ * clears it after (try/finally). All enabled scenarios in a set MUST agree on
15980
+ * one fixture (2+ distinct → the run is rejected). Absent → no seeding (today's
15981
+ * behavior). Pairs with `variables` for parallel-safe MUTATING evals.
15982
+ */
15983
+ fixture: external_exports.string().optional(),
15984
+ /**
15985
+ * The Rekor base the fixture is seeded against (gh #3090). REQUIRED whenever
15986
+ * `fixture` is declared: the hub seed connection supplies the API origin +
15987
+ * token, this supplies the base. A `fixture` with no `target_base` resolves to
15988
+ * `incomplete_seed_config` (`resolveEvalFixtureTarget`) and aborts the session
15989
+ * with `fixture_seed_failed` (no runs scored) — there is no derived-base
15990
+ * fallback. Must agree across a set, same as `fixture`.
15991
+ */
15992
+ target_base: external_exports.string().optional(),
15993
+ /**
15994
+ * User-scope state to seed before this scenario's trigger runs (gh #3430). Each
15995
+ * entry `{ slug, scope: 'user', value }` writes `value` to an EXISTING user-scope
15996
+ * state definition (`slug`) for the eval's synthetic per-run user, so behavior that
15997
+ * depends on memory of prior conversations (a recurring-user shortcut, a "confirmed"
15998
+ * flag) is testable. Isolated + torn down per session, like `fixture`. A slug the
15999
+ * hub doesn't define, or a value its `json_schema` rejects, degrades the run with a
16000
+ * warning — it never poisons shared state.
16001
+ */
16002
+ initial_state: external_exports.array(external_exports.object({
16003
+ slug: external_exports.string(),
16004
+ scope: external_exports.enum(EVAL_INITIAL_STATE_SCOPES).optional(),
16005
+ value: external_exports.record(external_exports.string(), external_exports.unknown())
16006
+ })).optional(),
16007
+ /**
16008
+ * The persons this scenario's runs are for (wayai-pro/wayai#5473 2-eval): person ids or contact ids, named by
16009
+ * every Base Toolset call of a run as its customer. Honoured on a preview hub only; a production hub's eval
16010
+ * names none. See `evalPersonSchema`. Its retired alias `customer_contact_id` is refused on push, diff and sync
16011
+ * (`evalPersonIssue`, #5473 3c).
16012
+ */
16013
+ person: external_exports.array(external_exports.string()).nullable().optional()
16014
+ });
16015
+ hubAsCodeEvalAttachmentFileSchema = external_exports.object({
16016
+ hash: external_exports.string(),
16017
+ content_base64: external_exports.string().optional(),
16018
+ // push only
16019
+ download_url: external_exports.string().optional(),
16020
+ // pull only (signed R2 URL)
16021
+ file_name: external_exports.string().optional(),
16022
+ mime_type: external_exports.string().optional(),
16023
+ file_size: external_exports.number().optional()
16024
+ });
16025
+ hubAsCodeJourneyTurnSchema = hubAsCodeHistoryTurnSchema.extend({
16026
+ step_id: external_exports.string().optional()
16027
+ });
16028
+ hubAsCodeJourneyStepOverrideSchema = external_exports.object({
16029
+ runs: external_exports.number().optional(),
16030
+ evaluator_instructions: external_exports.string().nullable().optional()
16031
+ });
16032
+ hubAsCodeJourneySchema = external_exports.object({
16033
+ id: external_exports.string().optional(),
16034
+ // journey_id (stable, set by pull; primary match key)
16035
+ name: external_exports.string(),
16036
+ // journey_name
16037
+ agent: external_exports.string(),
16038
+ // responder_agent_id, resolved by display name
16039
+ agent_id: external_exports.string().optional(),
16040
+ // stable agent UUID
16041
+ enabled: external_exports.boolean().optional(),
16042
+ // default true
16043
+ evaluator_instructions: external_exports.string().optional(),
16044
+ transcript: external_exports.array(hubAsCodeJourneyTurnSchema).optional(),
16045
+ /** Per-step overrides keyed by `step_id`. */
16046
+ step_config: external_exports.record(external_exports.string(), hubAsCodeJourneyStepOverrideSchema).optional(),
16047
+ /**
16048
+ * Per-run variables (gh #3007): a map of author-provided arrays, propagated to
16049
+ * every derived step eval. Run i of the whole journey resolves `{{var(NAME)}}`
16050
+ * against `variables.NAME[i-1]`, so the journey run leases one coherent fixture.
16051
+ * Each array MUST cover the step's `runs` (validated at run-launch).
16052
+ */
16053
+ variables: external_exports.record(external_exports.string(), external_exports.array(external_exports.unknown())).optional(),
16054
+ /**
16055
+ * The persons this journey's steps are for (#5473 2-eval; a journey's by owner decision 141): propagated to
16056
+ * every derived step eval as `variables` is, so each step's runs name them as a scenario's do
16057
+ * (`HubAsCodeEval.person`). Honoured on a preview hub only; its retired alias is refused as a scenario's is.
16058
+ */
16059
+ person: external_exports.array(external_exports.string()).nullable().optional(),
16060
+ /**
16061
+ * Eval-session seed fixture (gh #3090): the named Rekor fixture this journey
16062
+ * depends on. A journey owns its managed set, so this is the set-level fixture —
16063
+ * reset before / cleared after the journey run (try/finally). Absent → no
16064
+ * seeding. Pairs with `variables` for parallel-safe MUTATING journeys.
16065
+ */
16066
+ fixture: external_exports.string().optional(),
16067
+ /**
16068
+ * The Rekor base the fixture is seeded against — REQUIRED alongside `fixture`
16069
+ * (absence aborts the run with `fixture_seed_failed`). See
16070
+ * `HubAsCodeEval.target_base`.
16071
+ */
16072
+ target_base: external_exports.string().optional()
16073
+ });
15504
16074
  uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
15505
16075
  ciUuidSchema = external_exports.string().regex(uuidPattern, "must be a valid UUID");
15506
16076
  flagEntriesOf = (list2) => Array.isArray(list2) ? list2.map((entry) => entry ?? {}) : [];
@@ -15539,10 +16109,7 @@ var init_chunk_A3KD6FK4 = __esm({
15539
16109
  (name, key) => typeof key === "number" ? `${name}[${key}]` : name ? `${name}.${key}` : key,
15540
16110
  ""
15541
16111
  );
15542
- hubAsCodeConfigSchema = external_exports.preprocess((config, ctx) => {
15543
- if (refusedNesting(config, [], ctx) || refusedStringConfigNesting(config, ctx) || refusedUnreadableSection(config, ctx)) return config;
15544
- return skillSectionsAsResources("hub")(config, ctx);
15545
- }, external_exports.object({
16112
+ hubAsCodeConfigObjectSchema = external_exports.object({
15546
16113
  version: external_exports.literal(1),
15547
16114
  hub: external_exports.object({
15548
16115
  name: external_exports.string().min(1, "config.hub.name is required"),
@@ -15552,7 +16119,11 @@ var init_chunk_A3KD6FK4 = __esm({
15552
16119
  states: external_exports.array(hubAsCodeStateSchema).optional(),
15553
16120
  resources: boundedHubAsCodeResourcesSchema.optional(),
15554
16121
  pages: hubAsCodePagesSchema.optional()
15555
- }).passthrough().superRefine((config, ctx) => {
16122
+ }).passthrough();
16123
+ hubAsCodeConfigSchema = external_exports.preprocess((config, ctx) => {
16124
+ if (refusedNesting(config, [], ctx) || refusedStringConfigNesting(config, ctx) || refusedUnreadableSection(config, ctx)) return config;
16125
+ return skillSectionsAsResources("hub")(config, ctx);
16126
+ }, hubAsCodeConfigObjectSchema.superRefine((config, ctx) => {
15556
16127
  refineHubAsCodeCustomTools(config, ctx);
15557
16128
  refineHubAsCodeKanbanStatuses(config, ctx);
15558
16129
  refineHubAsCodeLanes(config, ctx);
@@ -15570,6 +16141,164 @@ var init_chunk_A3KD6FK4 = __esm({
15570
16141
  refineHubAsCodeDecisionsModel(config, ctx);
15571
16142
  refineHubAsCodeMonitorRulesOutput(config, ctx);
15572
16143
  }));
16144
+ hubAsCodeConnectionSchema = external_exports.object({
16145
+ id: external_exports.string().optional(),
16146
+ name: external_exports.string(),
16147
+ type: external_exports.string(),
16148
+ service: external_exports.string().optional(),
16149
+ /** Pin an org credential by display name (round-trips on pull). */
16150
+ credential: external_exports.string().optional(),
16151
+ /** Bearer Token org credential for dual-credential (API Key + access token)
16152
+ * connectors. Push-only: not round-tripped on pull (the connection row stores
16153
+ * a single credential id, so only the primary `credential` is re-emitted). */
16154
+ access_token_credential: external_exports.string().optional(),
16155
+ /** Opt into a deliberately unauthenticated connection for optional-auth connectors
16156
+ * (e.g. a no-auth MCP server), or a REST API or External Resources connection to an
16157
+ * API that takes no key. Suppresses the "created without" push warning. Must not be
16158
+ * combined with `credential`. */
16159
+ no_auth: external_exports.boolean().optional(),
16160
+ base_url: external_exports.string().optional(),
16161
+ /** Push-only: a pull never answers the stored headers, which may hold a key. */
16162
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
16163
+ settings: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
16164
+ account_sid: external_exports.string().optional(),
16165
+ enabled: external_exports.boolean().optional(),
16166
+ authentication_type: external_exports.string().optional(),
16167
+ /** Opt out of copying this connection's credential into production on publish/sync.
16168
+ * Defaults to true. Round-trips on pull (emitted only when false). */
16169
+ sync_credentials_to_production: external_exports.boolean().optional()
16170
+ });
16171
+ hubAsCodePayloadSchema = hubAsCodeConfigObjectSchema.extend({
16172
+ /** A pull answers `1`. A number: a CLI sends the version its folder states, for the push to judge. */
16173
+ version: external_exports.number(),
16174
+ hub_id: external_exports.string().min(1),
16175
+ hub_environment: external_exports.string(),
16176
+ preview_label: external_exports.string().nullable().optional(),
16177
+ branch_name: external_exports.string().nullable().optional(),
16178
+ /**
16179
+ * For a preview hub, the id of its linked production hub (null until first
16180
+ * publish). Lets the CLI mirror production read-only on every preview pull.
16181
+ * Always null on a production hub's own payload (it has no parent).
16182
+ */
16183
+ production_hub_id: external_exports.string().nullable().optional(),
16184
+ /**
16185
+ * The hub's settings — and its localized end-user presentation (`Partial<HubPresentationColumns>`,
16186
+ * `hub-presentation.ts`): its name, welcome message and starter questions as its end users see
16187
+ * them, keyed by supported locale. A presentation map left out leaves the stored one unchanged;
16188
+ * `null` or `{}` clears it. Pull emits each only when set.
16189
+ */
16190
+ hub: hubAsCodeConfigObjectSchema.shape.hub.extend({
16191
+ description: external_exports.string().optional(),
16192
+ hub_type: external_exports.string().optional(),
16193
+ ai_mode: external_exports.string().optional(),
16194
+ timezone: external_exports.string().optional(),
16195
+ /** Hub language (en|pt|es) — localizes the channel-contact-access pending notice. */
16196
+ language: external_exports.string().optional(),
16197
+ /** Gate for who may approve/block channel contacts: 'admin' (default) | 'team'. */
16198
+ access_approval_role: external_exports.string().optional(),
16199
+ /** Override text for the one-time "your access is pending" notice (else localized default). */
16200
+ access_request_message: external_exports.string().nullable().optional(),
16201
+ /** Minutes of sustained LLM-provider failure before escalating to the team (null → code default). */
16202
+ ai_failure_escalation_minutes: external_exports.number().nullable().optional(),
16203
+ /** Override text for the mid-outage "we're delayed" notice (else localized default). */
16204
+ ai_delay_message: external_exports.string().nullable().optional(),
16205
+ /** Override text for the escalation hand-off notice (else localized default). */
16206
+ ai_handoff_message: external_exports.string().nullable().optional(),
16207
+ non_app_permission: external_exports.string().optional(),
16208
+ kanban_statuses: external_exports.array(hubAsCodeKanbanStatusSchema).optional(),
16209
+ /** Presentational lane definitions for board grouping (see HubAsCodeLane). A
16210
+ * hub-config field, NOT a separate YAML entity like `journeys`. */
16211
+ lanes: external_exports.array(hubAsCodeLaneSchema).optional(),
16212
+ // flag_conditions relocated to the conversation_evaluator AGENT (see HubAsCodeAgent.flag_conditions).
16213
+ // summarization_threshold_tokens relocated to the summarizer AGENT (see HubAsCodeAgent.summarization_threshold_tokens).
16214
+ // monitor_config relocated to the monitor AGENT (see HubAsCodeAgent.monitor_config).
16215
+ /** Days of inactivity (no user/team messages) before a conversation is force-closed.
16216
+ * Range 1..180, default 7. Mandatory across every hub. */
16217
+ auto_close_inactive_days: external_exports.number().optional(),
16218
+ /** Days an ended conversation's ConversationDO is kept alive so it can still receive
16219
+ * post-hoc annotations before the cleanup cron deletes it. Range 1..30, default 7.
16220
+ * Archival is unaffected (still at close). */
16221
+ conversation_retention_days: external_exports.number().optional(),
16222
+ /** Days an ended conversation's `conversation_index` row is retained warm (Ended tab +
16223
+ * chat-hub continuous history) before the cleanup cron reaps it. Range 1..730,
16224
+ * default 365. Emitted only when non-default. Re-clamped to the effective storage
16225
+ * retention at reap time so an index row never outlives its archive. */
16226
+ ended_index_retention_days: external_exports.number().optional(),
16227
+ /** Days a terminal eval session (its runs, results and eval conversations) is retained
16228
+ * in HubDO before the weekly retention cron retires it. Range 0..3650; `0` disables
16229
+ * retention (keep forever). Emitted only when the hub sets an explicit override —
16230
+ * omission means "inherit `platform_config.default_eval_retention_days`", so pushing
16231
+ * a config without this field never clears an override set elsewhere — an explicit
16232
+ * `null` is what clears it. Retirement destroys transcripts (HubDO-only);
16233
+ * ClickHouse eval scores survive. */
16234
+ eval_retention_days: external_exports.number().nullable().optional(),
16235
+ // `end_user_daily_message_limit` is the push body's own: messages one end user may send the hub
16236
+ // on the app channel per 24 hours, 1..10000. Emitted only when set; omission leaves the stored
16237
+ // limit unchanged, and an explicit `null` removes it.
16238
+ /** Org tag slug names (not UUIDs). Resolved against OrgDO `org_tag` on push;
16239
+ * unknown names are rejected. Hub tags gate which org credentials this hub
16240
+ * can resolve via the symmetric overlap rule (see SKILL connections doc). */
16241
+ tags: external_exports.array(external_exports.string()).optional(),
16242
+ /** Eval-session seed connection, bound BY NAME (gh #3097). References a
16243
+ * connection declared in this hub's `connections:` — a REST API (custom tool)
16244
+ * connection whose `base_url` is the data API's origin, bound to its base with no token stored
16245
+ * (`wayai bind-seed-connection`, wayai#5644).
16246
+ * Resolved name→id on push (base_url validated for parity with the setup PATCH);
16247
+ * round-trips as the connection's display name on pull. Absent = leave unchanged;
16248
+ * explicit `null` = clear (omission does NOT unbind, matching `tags`). */
16249
+ seed_connection: external_exports.string().nullable().optional()
16250
+ }).merge(hubPresentationColumnsSchema.partial()).strip(),
16251
+ agents: external_exports.array(hubAsCodeAgentSchema).optional(),
16252
+ /** The hub's skills, by the wire's name; unbounded, unlike a push's (`boundedHubAsCodeResourcesSchema`). */
16253
+ resources: external_exports.array(hubAsCodeResourceSchema.extend({
16254
+ files: external_exports.array(hubAsCodeResourceFileSchema.strip()).optional()
16255
+ }).strip()).optional(),
16256
+ states: external_exports.array(hubAsCodeStateSchema.strip()).optional(),
16257
+ teams: external_exports.array(hubAsCodeTeamSchema).optional(),
16258
+ evals: external_exports.array(hubAsCodeEvalSchema).optional(),
16259
+ journeys: external_exports.array(hubAsCodeJourneySchema).optional(),
16260
+ /**
16261
+ * Byte carrier for eval/journey attachments (gh #3365) — deduped by `hash`,
16262
+ * PUSH-ONLY, never stored and never diffed (the turn refs are what persist and
16263
+ * diff). Kept off the turn objects on purpose: base64 on a turn would ride every
16264
+ * frozen `scenario_snapshot` and poison the JSON-stringify diff engine. Apply
16265
+ * uploads any hash whose R2 object is missing (re-hashing to verify the bytes
16266
+ * match the declared hash — content-addressing must not be poisonable). On pull,
16267
+ * `download_url` carries a signed link per referenced hash instead.
16268
+ */
16269
+ eval_attachment_files: external_exports.array(hubAsCodeEvalAttachmentFileSchema).optional(),
16270
+ /**
16271
+ * Byte carrier for the voice agents' call openings (gh #4418), deduped by `hash` — the
16272
+ * `eval_attachment_files` split: the agents' `call_openings` persist and diff, this carries
16273
+ * only bytes. A push may leave out the bytes of an opening the hub already holds. On pull,
16274
+ * `download_url` carries a signed link per opening instead.
16275
+ */
16276
+ call_opening_files: external_exports.array(hubAsCodeCallOpeningFileSchema).optional(),
16277
+ /**
16278
+ * The hub's automations (wayai#4931). An ABSENT key changes nothing; `[]` deletes every
16279
+ * automation. While the key is absent, the stored automations still count wherever another key
16280
+ * is checked against them — a connection they use is never deleted as unreferenced.
16281
+ */
16282
+ automations: external_exports.array(hubAsCodeAutomationSchema).optional(),
16283
+ /**
16284
+ * The hub's own contact lists (wayai#4931 D6a): filters over the org contact book's labels and
16285
+ * scope tags, which an automation names by `target.list`. An ABSENT key changes nothing; `[]`
16286
+ * deletes every list. While the key is absent, the stored lists still count wherever an
16287
+ * automation is checked against them.
16288
+ */
16289
+ contact_lists: external_exports.array(hubAsCodeContactListSchema).optional(),
16290
+ /**
16291
+ * The hub's pages (wayai-pro/wayai#5333): each its manifest (`pageManifestSchema`) and its HTML.
16292
+ * An ABSENT key changes nothing; `[]` deletes every page. A pull answers every page the hub
16293
+ * holds, the stored manifest with every default filled. Unbounded, unlike a push's (`hubAsCodePagesSchema`).
16294
+ */
16295
+ pages: external_exports.array(hubAsCodePageSchema).optional(),
16296
+ /** Connections serve as reference targets for `connection_id` fields on agents
16297
+ * and custom tools. Non-secret configuration fields (base_url, settings,
16298
+ * etc.) are round-trippable via pull/push. The bound org credential round-trips
16299
+ * by name via `credential`; the raw secret is never exported. */
16300
+ connections: external_exports.array(hubAsCodeConnectionSchema).optional()
16301
+ }).strip();
15573
16302
  ciPullHubIdParam = external_exports.object({
15574
16303
  hub_id: ciUuidSchema
15575
16304
  });
@@ -15643,8 +16372,10 @@ var init_chunk_A3KD6FK4 = __esm({
15643
16372
  direction: ciDiffDirectionSchema,
15644
16373
  summary: external_exports.string(),
15645
16374
  /**
15646
- * The diff engine's own result (`DiffResult` for a hub, the org skills diff for an org), as
15647
- * computed. Not part of the contract yet: no client reads it, and its shape is the engine's.
16375
+ * The diff engine's own result (`DiffResult` for a hub, the org skills diff for an org). A hub's
16376
+ * answers each stored connection in `connections.delete` with its header values hidden
16377
+ * (`hideConnectionValues`, wayai#6077), never as stored: the engine carries those rows whole for
16378
+ * apply's teardown. Not part of the contract yet: no client reads it, and its shape is the engine's.
15648
16379
  */
15649
16380
  diff: external_exports.unknown(),
15650
16381
  /**
@@ -15789,6 +16520,64 @@ var init_chunk_A3KD6FK4 = __esm({
15789
16520
  apply_errors: external_exports.array(ciApplyErrorSchema).optional(),
15790
16521
  warnings: external_exports.array(ciSyncWarningSchema).optional()
15791
16522
  });
16523
+ ciPublishResponseSchema = external_exports.object({
16524
+ synced: external_exports.boolean(),
16525
+ production_hub_id: external_exports.string().min(1),
16526
+ /** The sync's warnings (`SyncHubResponse`); absent when there are none. */
16527
+ warnings: external_exports.array(syncWarningSchema).optional()
16528
+ });
16529
+ ciMcpDriftEntrySchema = external_exports.object({
16530
+ tool_name: external_exports.string(),
16531
+ kind: external_exports.enum(["added", "changed", "removed"]),
16532
+ detail: external_exports.string().optional()
16533
+ });
16534
+ ciSyncMcpResponseSchema = external_exports.object({
16535
+ success: external_exports.boolean(),
16536
+ connection_id: external_exports.string().min(1),
16537
+ connection_name: external_exports.string(),
16538
+ tools_count: external_exports.number().int().nonnegative().optional(),
16539
+ resources_count: external_exports.number().int().nonnegative().optional(),
16540
+ message: external_exports.string().optional(),
16541
+ warnings: external_exports.array(external_exports.string()).optional(),
16542
+ // Drift-check mode (`check: true`) only. `drift` is present (possibly empty)
16543
+ // when the catalog was compared to the live server and NOTHING was written;
16544
+ // an empty array means "verified in sync". `reachable: false` means the server
16545
+ // or its credentials couldn't be contacted, so drift could NOT be verified —
16546
+ // distinct from "verified, no drift".
16547
+ drift: external_exports.array(ciMcpDriftEntrySchema).optional(),
16548
+ reachable: external_exports.boolean().optional()
16549
+ });
16550
+ ciPublishPreviewResponseSchema = ciPublishResponseSchema.partial({ production_hub_id: true });
16551
+ ciBranchInfoSchema = external_exports.object({
16552
+ branch_name: external_exports.string().min(1),
16553
+ preview_hub_id: external_exports.string().min(1),
16554
+ last_ci_activity_at: external_exports.string().nullable(),
16555
+ ci_commit_sha: external_exports.string().nullable()
16556
+ });
16557
+ ciBranchListResponseSchema = external_exports.object({
16558
+ branches: external_exports.array(ciBranchInfoSchema)
16559
+ });
16560
+ ciBranchDeleteResponseSchema = external_exports.object({
16561
+ deleted: external_exports.boolean(),
16562
+ message: external_exports.string().optional()
16563
+ });
16564
+ ciOrgResourcesPullFileSchema = hubAsCodeResourceFileSchema.strip().extend({
16565
+ id: external_exports.string().min(1),
16566
+ title: external_exports.string()
16567
+ });
16568
+ ciOrgResourcesPullFolderSchema = orgAsCodeResourceFolderSchema.extend({ id: external_exports.string().min(1) });
16569
+ ciOrgResourcesPullResourceSchema = orgAsCodeResourceSchema.extend({
16570
+ id: external_exports.string().min(1),
16571
+ enabled: external_exports.boolean(),
16572
+ environment: orgAsCodeResourceSchema.shape.environment.unwrap(),
16573
+ tags: external_exports.array(external_exports.string()),
16574
+ folders: external_exports.array(ciOrgResourcesPullFolderSchema).optional(),
16575
+ files: external_exports.array(ciOrgResourcesPullFileSchema).optional()
16576
+ });
16577
+ ciOrgResourcesPullResponseSchema = orgResourcesPayloadSchema.extend({
16578
+ organization_id: external_exports.string().min(1),
16579
+ resources: external_exports.array(ciOrgResourcesPullResourceSchema)
16580
+ });
15792
16581
  ciOrgResourcesPushResponseSchema = external_exports.object({
15793
16582
  changes: external_exports.object({
15794
16583
  resources_created: ciSyncCountSchema,
@@ -16750,10 +17539,10 @@ var init_chunk_K6O2P77D = __esm({
16750
17539
  }
16751
17540
  });
16752
17541
 
16753
- // ../../packages/core/dist/chunk-UAFAJNZ6.js
17542
+ // ../../packages/core/dist/chunk-AQRCKNQP.js
16754
17543
  var CASE_REVIEW_DECISIONS, CASE_ISSUED_FORMATS, CASE_REVIEW_COMMENT_MAX_LENGTH, CASE_REVIEW_JUSTIFICATION_MAX_LENGTH, text2, caseSubmissionParam, decideCaseSubmissionBody, caseIssuedQuery, CASE_APPROVALS_STATES, caseApprovalsQuery, caseCompareDefaultQuery, caseApprovalsAgendaQuery;
16755
- var init_chunk_UAFAJNZ6 = __esm({
16756
- "../../packages/core/dist/chunk-UAFAJNZ6.js"() {
17544
+ var init_chunk_AQRCKNQP = __esm({
17545
+ "../../packages/core/dist/chunk-AQRCKNQP.js"() {
16757
17546
  "use strict";
16758
17547
  init_chunk_VHA3AQE4();
16759
17548
  init_chunk_2S6LIRGD();
@@ -16899,10 +17688,10 @@ var init_chunk_UPGAWPE2 = __esm({
16899
17688
  }
16900
17689
  });
16901
17690
 
16902
- // ../../packages/core/dist/chunk-3EEL6BQ7.js
17691
+ // ../../packages/core/dist/chunk-AKG7A2TR.js
16903
17692
  var CASE_MEMBER_CASES_PAGE_MAX, caseMemberReachQuery;
16904
- var init_chunk_3EEL6BQ7 = __esm({
16905
- "../../packages/core/dist/chunk-3EEL6BQ7.js"() {
17693
+ var init_chunk_AKG7A2TR = __esm({
17694
+ "../../packages/core/dist/chunk-AKG7A2TR.js"() {
16906
17695
  "use strict";
16907
17696
  init_chunk_TYI6QVPX();
16908
17697
  init_zod();
@@ -17398,10 +18187,10 @@ var init_chunk_I6CZPDXO = __esm({
17398
18187
  }
17399
18188
  });
17400
18189
 
17401
- // ../../packages/core/dist/chunk-FPFUDA22.js
18190
+ // ../../packages/core/dist/chunk-M7BXKCNK.js
17402
18191
  var caseInputLinkParam, caseCollectionDocumentOfCaseParam, linkCaseCollectionInputBody, linkCasePreviousOutputInputBody, linkCaseReceivedInputBody, linkCaseInputBody, CASE_LINK_OFFICIAL_VERSION_UNKNOWN_REASON, CASE_LINK_OUTPUT_NOT_PRIOR_REASON, CASE_LINK_RECEIVED_UNKNOWN_REASON, CASE_LINK_DOCUMENT_TYPE_MISMATCH_REASON, CASE_LINK_VERSION_NOT_CURRENT_REASON, CASE_COLLECTION_CASES_PAGE_MAX, caseCollectionCasesQuery, CASE_REFERENCES_PAGE_MAX, caseReferencesQuery;
17403
- var init_chunk_FPFUDA22 = __esm({
17404
- "../../packages/core/dist/chunk-FPFUDA22.js"() {
18192
+ var init_chunk_M7BXKCNK = __esm({
18193
+ "../../packages/core/dist/chunk-M7BXKCNK.js"() {
17405
18194
  "use strict";
17406
18195
  init_chunk_ZZZ65EIA();
17407
18196
  init_chunk_I6CZPDXO();
@@ -17509,10 +18298,10 @@ var init_chunk_7QN6QYGN = __esm({
17509
18298
  }
17510
18299
  });
17511
18300
 
17512
- // ../../packages/core/dist/chunk-7RWVVW7T.js
18301
+ // ../../packages/core/dist/chunk-CUBLS2GW.js
17513
18302
  var lines, ordered, citeCaseOfficialVersionPassageBody, citeCaseReceivedPassageBody, citeCaseSourcePassageBody, citeCaseInputPassageBody, caseSourceRefSchema;
17514
- var init_chunk_7RWVVW7T = __esm({
17515
- "../../packages/core/dist/chunk-7RWVVW7T.js"() {
18303
+ var init_chunk_CUBLS2GW = __esm({
18304
+ "../../packages/core/dist/chunk-CUBLS2GW.js"() {
17516
18305
  "use strict";
17517
18306
  init_chunk_I6CZPDXO();
17518
18307
  init_chunk_LU4T7K5F();
@@ -17687,14 +18476,14 @@ var init_chunk_R6Y377AW = __esm({
17687
18476
  }
17688
18477
  });
17689
18478
 
17690
- // ../../packages/core/dist/chunk-L5GC53VI.js
18479
+ // ../../packages/core/dist/chunk-JQRL355P.js
17691
18480
  var 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, 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;
17692
- var init_chunk_L5GC53VI = __esm({
17693
- "../../packages/core/dist/chunk-L5GC53VI.js"() {
18481
+ var init_chunk_JQRL355P = __esm({
18482
+ "../../packages/core/dist/chunk-JQRL355P.js"() {
17694
18483
  "use strict";
17695
18484
  init_chunk_R6Y377AW();
17696
18485
  init_chunk_UAOHHCW5();
17697
- init_chunk_QMQGGR7Q();
18486
+ init_chunk_OLBDDBKV();
17698
18487
  init_chunk_5FO3GNKP();
17699
18488
  init_chunk_ZDTX3DG5();
17700
18489
  init_chunk_ZTNFLGW5();
@@ -18107,7 +18896,7 @@ var init_chunk_OMPT4ZHR = __esm({
18107
18896
  }
18108
18897
  });
18109
18898
 
18110
- // ../../packages/core/dist/chunk-HLSE7OOG.js
18899
+ // ../../packages/core/dist/chunk-SUDGFYG2.js
18111
18900
  function refineScopedTarget(data, ctx) {
18112
18901
  if (data.scope === "org") {
18113
18902
  if (!data.org_id) {
@@ -18133,13 +18922,13 @@ function refineScopedTarget(data, ctx) {
18133
18922
  }
18134
18923
  }
18135
18924
  var 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, turnDeadlineSeconds, casesLimit, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetShape, adminScopedTargetBody, adminDryRunByDefaultTargetBody, WAYAI_HOST_TOKEN_TARGET_KINDS, WAYAI_HOST_TOKEN_MAX_TARGETS, adminClearWayaiHostTokensBody, BRANCHING_ORPHAN_ENTITY_TYPES, BRANCHING_ORPHAN_MAX_TARGETS, adminRepairBranchingOrphansBody, adminRepairLegacyOrgGrantsBody, adminRepairCredentialServicesBody, adminRepairCompedPlansBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, dataExplorerDebugCountsDoType, dataExplorerDebugCountsParam, debugHubConvParam, debugMessageIdQuery;
18136
- var init_chunk_HLSE7OOG = __esm({
18137
- "../../packages/core/dist/chunk-HLSE7OOG.js"() {
18925
+ var init_chunk_SUDGFYG2 = __esm({
18926
+ "../../packages/core/dist/chunk-SUDGFYG2.js"() {
18138
18927
  "use strict";
18139
18928
  init_chunk_FECLIZTY();
18140
18929
  init_chunk_BFG4ZWR4();
18141
18930
  init_chunk_UY32MQHG();
18142
- init_chunk_4NZTCAY5();
18931
+ init_chunk_25BLQS73();
18143
18932
  init_chunk_OMPT4ZHR();
18144
18933
  init_chunk_MIWZOSPI();
18145
18934
  init_chunk_HZ6CADSY();
@@ -18702,7 +19491,7 @@ var init_contracts = __esm({
18702
19491
  "../../packages/core/dist/contracts/index.js"() {
18703
19492
  "use strict";
18704
19493
  init_chunk_VXEAR36B();
18705
- init_chunk_RACEDHG6();
19494
+ init_chunk_2ZBLI7IH();
18706
19495
  init_chunk_Q7KIQHAZ();
18707
19496
  init_chunk_IPXBFWUU();
18708
19497
  init_chunk_63UWXV4T();
@@ -18737,7 +19526,7 @@ var init_contracts = __esm({
18737
19526
  init_chunk_SY6PLCPK();
18738
19527
  init_chunk_ACGAI25T();
18739
19528
  init_chunk_MH4O3YEX();
18740
- init_chunk_QEEQN2NE();
19529
+ init_chunk_V2CXEU5X();
18741
19530
  init_chunk_KSTYTQ7I();
18742
19531
  init_chunk_LKBSHANA();
18743
19532
  init_chunk_LX3D5LCB();
@@ -18747,32 +19536,32 @@ var init_contracts = __esm({
18747
19536
  init_chunk_YULHXJ5M();
18748
19537
  init_chunk_V4FRPRH5();
18749
19538
  init_chunk_LWMLR2WI();
18750
- init_chunk_ME6NL7FI();
19539
+ init_chunk_X4IDZLLS();
18751
19540
  init_chunk_7CYHPF35();
18752
19541
  init_chunk_NETRUHZF();
18753
- init_chunk_A3KD6FK4();
19542
+ init_chunk_JTG72ANZ();
18754
19543
  init_chunk_QG3XMUEN();
18755
19544
  init_chunk_EBUWHIFV();
18756
19545
  init_chunk_5YZ3R7KF();
18757
19546
  init_chunk_2YEGUQR7();
18758
19547
  init_chunk_AHISKXHA();
18759
- init_chunk_UAFAJNZ6();
19548
+ init_chunk_AQRCKNQP();
18760
19549
  init_chunk_K3PD6AOF();
18761
19550
  init_chunk_F4264AMK();
18762
19551
  init_chunk_ZTRVP4OT();
18763
19552
  init_chunk_5WMOQ5NC();
18764
19553
  init_chunk_UPGAWPE2();
18765
- init_chunk_3EEL6BQ7();
19554
+ init_chunk_AKG7A2TR();
18766
19555
  init_chunk_VHA3AQE4();
18767
19556
  init_chunk_2S6LIRGD();
18768
19557
  init_chunk_WJJJFHIA();
18769
- init_chunk_FPFUDA22();
19558
+ init_chunk_M7BXKCNK();
18770
19559
  init_chunk_ZZZ65EIA();
18771
19560
  init_chunk_ATX6AHPZ();
18772
19561
  init_chunk_NKJ2DQCV();
18773
19562
  init_chunk_NVZB33EA();
18774
19563
  init_chunk_7QN6QYGN();
18775
- init_chunk_7RWVVW7T();
19564
+ init_chunk_CUBLS2GW();
18776
19565
  init_chunk_5PKKFSSF();
18777
19566
  init_chunk_AF2RCYPB();
18778
19567
  init_chunk_2KOYNTE2();
@@ -18780,23 +19569,23 @@ var init_contracts = __esm({
18780
19569
  init_chunk_I6CZPDXO();
18781
19570
  init_chunk_UEJOG2Q7();
18782
19571
  init_chunk_KEN2DASI();
18783
- init_chunk_L5GC53VI();
19572
+ init_chunk_JQRL355P();
18784
19573
  init_chunk_R6Y377AW();
18785
19574
  init_chunk_UAOHHCW5();
18786
- init_chunk_QMQGGR7Q();
19575
+ init_chunk_OLBDDBKV();
18787
19576
  init_chunk_ULQGJUXZ();
18788
19577
  init_chunk_YWZFB34T();
18789
19578
  init_chunk_PZPOUXJR();
18790
19579
  init_chunk_LBDH7LCG();
18791
19580
  init_chunk_4LXDRTO4();
18792
19581
  init_chunk_NVKU5PPQ();
18793
- init_chunk_HLSE7OOG();
19582
+ init_chunk_SUDGFYG2();
18794
19583
  init_chunk_FECLIZTY();
18795
19584
  init_chunk_BFG4ZWR4();
18796
19585
  init_chunk_UY32MQHG();
18797
- init_chunk_4NZTCAY5();
19586
+ init_chunk_25BLQS73();
18798
19587
  init_chunk_D3EP4TDU();
18799
- init_chunk_JP42Y3U2();
19588
+ init_chunk_ZANBA4K4();
18800
19589
  init_chunk_QT7R3TGR();
18801
19590
  init_chunk_OMPT4ZHR();
18802
19591
  init_chunk_2PZIF56U();
@@ -25605,18 +26394,18 @@ var init_hub_materializer = __esm({
25605
26394
  var init_ci = __esm({
25606
26395
  "../../packages/core/dist/contracts/ci.js"() {
25607
26396
  "use strict";
25608
- init_chunk_A3KD6FK4();
26397
+ init_chunk_JTG72ANZ();
25609
26398
  init_chunk_QG3XMUEN();
25610
26399
  init_chunk_EBUWHIFV();
25611
26400
  init_chunk_5YZ3R7KF();
25612
26401
  init_chunk_2YEGUQR7();
25613
26402
  init_chunk_AHISKXHA();
25614
- init_chunk_QMQGGR7Q();
26403
+ init_chunk_OLBDDBKV();
25615
26404
  init_chunk_LBDH7LCG();
25616
26405
  init_chunk_4LXDRTO4();
25617
- init_chunk_4NZTCAY5();
26406
+ init_chunk_25BLQS73();
25618
26407
  init_chunk_D3EP4TDU();
25619
- init_chunk_JP42Y3U2();
26408
+ init_chunk_ZANBA4K4();
25620
26409
  init_chunk_QT7R3TGR();
25621
26410
  init_chunk_AMMLEB4T();
25622
26411
  init_chunk_IBL7FANV();
@@ -42120,7 +42909,7 @@ var init_case_collection_citations = __esm({
42120
42909
  var init_case_collection_links = __esm({
42121
42910
  "../../packages/core/dist/contracts/case-collection-links.js"() {
42122
42911
  "use strict";
42123
- init_chunk_FPFUDA22();
42912
+ init_chunk_M7BXKCNK();
42124
42913
  init_chunk_ZZZ65EIA();
42125
42914
  init_chunk_ATX6AHPZ();
42126
42915
  init_chunk_NKJ2DQCV();
@@ -43666,7 +44455,7 @@ ${line}`).join("");
43666
44455
  var init_case_input_sources = __esm({
43667
44456
  "../../packages/core/dist/contracts/case-input-sources.js"() {
43668
44457
  "use strict";
43669
- init_chunk_7RWVVW7T();
44458
+ init_chunk_CUBLS2GW();
43670
44459
  init_chunk_I6CZPDXO();
43671
44460
  init_chunk_LU4T7K5F();
43672
44461
  init_chunk_74HGW6HA();