@wayai/cli 0.3.359 → 0.3.361

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,
@@ -15950,10 +16739,10 @@ var init_chunk_VYINA6YP = __esm({
15950
16739
  }
15951
16740
  });
15952
16741
 
15953
- // ../../packages/core/dist/chunk-TYI6QVPX.js
16742
+ // ../../packages/core/dist/chunk-CLGTGGVN.js
15954
16743
  var CASE_SPACE_NAME_MAX_LENGTH, CASE_SPACE_DEFAULT_TIME_ZONE, CASE_TEAM_NAME_MAX_LENGTH, CASE_TEAM_MEMBERS_MAX, CASE_TEAM_SCOPES_MAX, CASE_MEMBERS_PAGE_MAX, CASE_PAGE_CURSOR_MAX_LENGTH, CASE_LEVELS, CASE_TEAM_TARGET_KINDS, CASE_REGISTRY_CLOSED_REASON, caseSpaceNameSchema, caseSpaceTimeZoneSchema, updateCaseSpaceSettingsBody, adminCreateCaseSpaceBody, caseOrgParam, caseSpaceParam, caseMemberParam, caseAdministratorParam, caseTeamParam, casePageQuery, saveCaseMemberBody, caseTeamScopeSchema, caseTeamMemberInput, caseTeamFields, createCaseTeamBody, updateCaseTeamBody;
15955
- var init_chunk_TYI6QVPX = __esm({
15956
- "../../packages/core/dist/chunk-TYI6QVPX.js"() {
16744
+ var init_chunk_CLGTGGVN = __esm({
16745
+ "../../packages/core/dist/chunk-CLGTGGVN.js"() {
15957
16746
  "use strict";
15958
16747
  init_chunk_VYINA6YP();
15959
16748
  init_chunk_ZVXO3XL6();
@@ -16013,13 +16802,13 @@ var init_chunk_TYI6QVPX = __esm({
16013
16802
  }
16014
16803
  });
16015
16804
 
16016
- // ../../packages/core/dist/chunk-AMKBCOOH.js
16805
+ // ../../packages/core/dist/chunk-MQQRYOE6.js
16017
16806
  var CASE_FILE_SHA_PATTERN, caseFileShaSchema, CASE_REVISION_MESSAGE_MAX_LENGTH, CASE_REVISION_SESSION_MAX_LENGTH, CASE_REVISION_ENTRIES_MAX, caseRevisionEntryShape, caseRevisionShape, CASE_FILE_SEALED_REASON, CASE_UPLOAD_BODY_MAX_BYTES, CASE_UPLOAD_REVISION_FIELD, CASE_FILE_CONFLICT_REASON, CASE_FILES_FULL_REASON, CASE_FILES_QUOTA_REASON, CASE_UPLOADS_BUSY_REASON, isBlob, caseUploadForm, CASE_FILES_PAGE_MAX, caseFilesQuery, caseFileReadPath, CASE_FILE_VERSIONS_PAGE_MAX, caseFileVersionsQuery, caseFileContentQuery, CASE_REVISIONS_PAGE_MAX, caseRevisionsQuery, CASE_FILE_COMPARE_MAX_BYTES, caseFileCompareQuery;
16018
- var init_chunk_AMKBCOOH = __esm({
16019
- "../../packages/core/dist/chunk-AMKBCOOH.js"() {
16807
+ var init_chunk_MQQRYOE6 = __esm({
16808
+ "../../packages/core/dist/chunk-MQQRYOE6.js"() {
16020
16809
  "use strict";
16021
16810
  init_chunk_KWRHZBGU();
16022
- init_chunk_TYI6QVPX();
16811
+ init_chunk_CLGTGGVN();
16023
16812
  init_chunk_HZ6CADSY();
16024
16813
  init_zod();
16025
16814
  CASE_FILE_SHA_PATTERN = /^[0-9a-f]{64}$/;
@@ -16183,7 +16972,7 @@ var init_chunk_M2T55BV6 = __esm({
16183
16972
  }
16184
16973
  });
16185
16974
 
16186
- // ../../packages/core/dist/chunk-WLKYA2B2.js
16975
+ // ../../packages/core/dist/chunk-JFD3FZM6.js
16187
16976
  function resolveItemLink(phaseFolder, target) {
16188
16977
  const slash = target.lastIndexOf("/");
16189
16978
  const folder = slash < 0 ? phaseFolder : target.slice(0, slash);
@@ -16408,11 +17197,11 @@ function caseTypeDefinitionReasonOf(error) {
16408
17197
  return first && reason3 ? { reason: reason3, at: first.path.join(".") } : null;
16409
17198
  }
16410
17199
  var CASE_CODE_PATTERN, CASE_PHASE_CODE_PATTERN, CASE_PHASE_FOLDER_PATTERN, CASE_INPUT_KEY_PATTERN, CASE_CALCULATION_CODE_PATTERN, CASE_AGENDA_GROUP_CODE_PATTERN, CASE_DECISION_CODE_PATTERN, CASE_DECISION_OPTION_CODE_PATTERN, CASE_DECISION_EFFECT_PATTERN, FILE_PATH_SEGMENT_PATTERN, CASE_REVIEW_MODES, CASE_OUTPUT_FORMATS, CASE_INPUT_ORIGINS, CASE_TEMPLATE_MODES, CASE_AGENDA_QUORUMS, CASE_DECISION_TYPES, CASE_NUMERIC_DECISION_TYPES, CASE_TYPE_NAME_MAX_LENGTH, CASE_CODE_MAX_LENGTH, CASE_FILE_PATH_MAX_LENGTH, CASE_TASK_NAME_MAX_LENGTH, CASE_TASK_DEPENDENCIES_MAX, CASE_FIXED_TEXT_MAX_LENGTH, CASE_TYPE_DEFINITION_MAX_CHARS, CASE_TYPE_DEFINITION_ROWS_MAX, CASE_TYPE_VERSIONS_MAX, CASE_TYPES_PAGE_MAX, code, phaseCode, inputKey, caseAgendaGroupCodeSchema, caseDecisionCodeSchema, decisionCode, label2, optionalText, itemLinkTarget, filePath, caseTypePartyRoleSchema, caseTypeOutcomeSchema, caseItemRequirementsSchema, caseItemLinksSchema, caseOutputItemSchema, casePhaseOutputSchema, casePhaseInputSchema, caseDecisionOptionSchema, decisionBound, caseAgendaDecisionSchema, caseAgendaGroupSchema, caseTypeTaskSchema, caseTypePhaseSchema, caseTypeDefinitionShape, caseValuesRepeated, CHAPTER_PROBE, caseTypeDefinitionSchema, caseTypeAbbreviationSchema, caseTypeNameSchema, createCaseTypeBody, publishCaseTypeVersionBody, setCaseTypeActiveBody, caseTypeParam, caseTypesPageQuery, caseTypeVersionQuery, CASE_TYPE_VERSION_CONFLICT_REASON;
16411
- var init_chunk_WLKYA2B2 = __esm({
16412
- "../../packages/core/dist/chunk-WLKYA2B2.js"() {
17200
+ var init_chunk_JFD3FZM6 = __esm({
17201
+ "../../packages/core/dist/chunk-JFD3FZM6.js"() {
16413
17202
  "use strict";
16414
17203
  init_chunk_KWRHZBGU();
16415
- init_chunk_TYI6QVPX();
17204
+ init_chunk_CLGTGGVN();
16416
17205
  init_chunk_M2T55BV6();
16417
17206
  init_chunk_HZ6CADSY();
16418
17207
  init_chunk_ZTNFLGW5();
@@ -16624,7 +17413,7 @@ var init_chunk_WLKYA2B2 = __esm({
16624
17413
  }
16625
17414
  });
16626
17415
 
16627
- // ../../packages/core/dist/chunk-S2LXF4LF.js
17416
+ // ../../packages/core/dist/chunk-YFUYMQR2.js
16628
17417
  function openCaseProblem(body) {
16629
17418
  const pairs = /* @__PURE__ */ new Set();
16630
17419
  for (const [index, party] of body.parties.entries()) {
@@ -16637,11 +17426,11 @@ ${party.role}`;
16637
17426
  return null;
16638
17427
  }
16639
17428
  var CASE_RECORD_CODE_PATTERN, CASE_RECORD_CODE_MAX_LENGTH, CASE_RECORD_PARTIES_MAX, CASE_RECORD_INSTRUMENTS_MAX, CASE_RECORD_ROLE_MAX_LENGTH, CASE_RECORDS_PAGE_MAX, CASE_RECORDS_QUERY_MAX_LENGTH, caseRecordPartySchema, openCaseShape, openCaseBody, previewOpenCaseShape, caseRecordParam, CASE_RECORD_STATUSES, caseRecordsQuery, CASE_STATE_SUMMARIES_MAX, caseStatesQuery, CASE_CLOSED_REASON, CASE_CLOSURE_REASON_MAX_LENGTH, closeCaseBody, setCaseConfidentialityBody;
16640
- var init_chunk_S2LXF4LF = __esm({
16641
- "../../packages/core/dist/chunk-S2LXF4LF.js"() {
17429
+ var init_chunk_YFUYMQR2 = __esm({
17430
+ "../../packages/core/dist/chunk-YFUYMQR2.js"() {
16642
17431
  "use strict";
16643
- init_chunk_WLKYA2B2();
16644
- init_chunk_TYI6QVPX();
17432
+ init_chunk_JFD3FZM6();
17433
+ init_chunk_CLGTGGVN();
16645
17434
  init_chunk_HZ6CADSY();
16646
17435
  init_chunk_ZTNFLGW5();
16647
17436
  init_zod();
@@ -16701,14 +17490,14 @@ var init_chunk_S2LXF4LF = __esm({
16701
17490
  }
16702
17491
  });
16703
17492
 
16704
- // ../../packages/core/dist/chunk-VHA3AQE4.js
17493
+ // ../../packages/core/dist/chunk-72TNUJVF.js
16705
17494
  var CASE_OFFICIAL_FILE_KINDS, CASE_OFFICIAL_FILE_NAME_PATTERN, publishCaseSubmissionBody, caseOfficialVersionParam, caseOfficialFileQuery;
16706
- var init_chunk_VHA3AQE4 = __esm({
16707
- "../../packages/core/dist/chunk-VHA3AQE4.js"() {
17495
+ var init_chunk_72TNUJVF = __esm({
17496
+ "../../packages/core/dist/chunk-72TNUJVF.js"() {
16708
17497
  "use strict";
16709
17498
  init_chunk_YR7QALGP();
16710
- init_chunk_AMKBCOOH();
16711
- init_chunk_S2LXF4LF();
17499
+ init_chunk_MQQRYOE6();
17500
+ init_chunk_YFUYMQR2();
16712
17501
  init_chunk_HZ6CADSY();
16713
17502
  init_zod();
16714
17503
  CASE_OFFICIAL_FILE_KINDS = [...CASE_SUBMISSION_ISSUED_KINDS, "file"];
@@ -16722,12 +17511,12 @@ var init_chunk_VHA3AQE4 = __esm({
16722
17511
  }
16723
17512
  });
16724
17513
 
16725
- // ../../packages/core/dist/chunk-2S6LIRGD.js
17514
+ // ../../packages/core/dist/chunk-TRK5L5I5.js
16726
17515
  var casePhaseParam;
16727
- var init_chunk_2S6LIRGD = __esm({
16728
- "../../packages/core/dist/chunk-2S6LIRGD.js"() {
17516
+ var init_chunk_TRK5L5I5 = __esm({
17517
+ "../../packages/core/dist/chunk-TRK5L5I5.js"() {
16729
17518
  "use strict";
16730
- init_chunk_S2LXF4LF();
17519
+ init_chunk_YFUYMQR2();
16731
17520
  init_chunk_HZ6CADSY();
16732
17521
  casePhaseParam = caseRecordParam.extend({ phase_id: uuidSchema });
16733
17522
  }
@@ -16750,18 +17539,18 @@ var init_chunk_K6O2P77D = __esm({
16750
17539
  }
16751
17540
  });
16752
17541
 
16753
- // ../../packages/core/dist/chunk-UAFAJNZ6.js
17542
+ // ../../packages/core/dist/chunk-NUJ5GZHA.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_NUJ5GZHA = __esm({
17545
+ "../../packages/core/dist/chunk-NUJ5GZHA.js"() {
16757
17546
  "use strict";
16758
- init_chunk_VHA3AQE4();
16759
- init_chunk_2S6LIRGD();
17547
+ init_chunk_72TNUJVF();
17548
+ init_chunk_TRK5L5I5();
16760
17549
  init_chunk_K6O2P77D();
16761
17550
  init_chunk_YR7QALGP();
16762
- init_chunk_AMKBCOOH();
16763
- init_chunk_S2LXF4LF();
16764
- init_chunk_TYI6QVPX();
17551
+ init_chunk_MQQRYOE6();
17552
+ init_chunk_YFUYMQR2();
17553
+ init_chunk_CLGTGGVN();
16765
17554
  init_chunk_HZ6CADSY();
16766
17555
  init_zod();
16767
17556
  CASE_REVIEW_DECISIONS = ["sign_off", "approve", "return"];
@@ -16807,23 +17596,23 @@ var init_chunk_K3PD6AOF = __esm({
16807
17596
  }
16808
17597
  });
16809
17598
 
16810
- // ../../packages/core/dist/chunk-F4264AMK.js
17599
+ // ../../packages/core/dist/chunk-JNZVVHKO.js
16811
17600
  var caseTeamPreviewBody;
16812
- var init_chunk_F4264AMK = __esm({
16813
- "../../packages/core/dist/chunk-F4264AMK.js"() {
17601
+ var init_chunk_JNZVVHKO = __esm({
17602
+ "../../packages/core/dist/chunk-JNZVVHKO.js"() {
16814
17603
  "use strict";
16815
- init_chunk_TYI6QVPX();
17604
+ init_chunk_CLGTGGVN();
16816
17605
  init_chunk_HZ6CADSY();
16817
17606
  caseTeamPreviewBody = createCaseTeamBody.pick({ active: true, scopes: true, members: true }).extend({ team_id: uuidSchema.optional() }).strict();
16818
17607
  }
16819
17608
  });
16820
17609
 
16821
- // ../../packages/core/dist/chunk-ZTRVP4OT.js
17610
+ // ../../packages/core/dist/chunk-KY3ZNL3E.js
16822
17611
  var CASE_TIMELINE_PAGE_MAX, caseTimelineQuery;
16823
- var init_chunk_ZTRVP4OT = __esm({
16824
- "../../packages/core/dist/chunk-ZTRVP4OT.js"() {
17612
+ var init_chunk_KY3ZNL3E = __esm({
17613
+ "../../packages/core/dist/chunk-KY3ZNL3E.js"() {
16825
17614
  "use strict";
16826
- init_chunk_TYI6QVPX();
17615
+ init_chunk_CLGTGGVN();
16827
17616
  init_zod();
16828
17617
  CASE_TIMELINE_PAGE_MAX = 100;
16829
17618
  caseTimelineQuery = external_exports.object({
@@ -16834,13 +17623,13 @@ var init_chunk_ZTRVP4OT = __esm({
16834
17623
  }
16835
17624
  });
16836
17625
 
16837
- // ../../packages/core/dist/chunk-5WMOQ5NC.js
17626
+ // ../../packages/core/dist/chunk-4Y76ZGBB.js
16838
17627
  var CASE_RELATION_TYPE_CODE_PATTERN, CASE_RELATION_TYPE_CODE_MAX_LENGTH, CASE_RELATION_TYPE_NAME_MAX_LENGTH, CASE_RELATION_TYPES_PER_SPACE_MAX, CASE_RELATION_DESCRIPTION_MAX_LENGTH, CASE_RELATION_SIDES, CASE_EXTERNAL_SYSTEM_PATTERN, CASE_EXTERNAL_NUMBER_MAX_LENGTH, CASE_EXTERNAL_URL_MAX_LENGTH, trimmedName, relationTypeFields, createCaseRelationTypeBody, updateCaseRelationTypeBody, relateCasesBody, addCaseExternalReferenceBody, caseRelationTypeParam, caseRelationParam, caseExternalReferenceParam, caseRelationTypesQuery;
16839
- var init_chunk_5WMOQ5NC = __esm({
16840
- "../../packages/core/dist/chunk-5WMOQ5NC.js"() {
17628
+ var init_chunk_4Y76ZGBB = __esm({
17629
+ "../../packages/core/dist/chunk-4Y76ZGBB.js"() {
16841
17630
  "use strict";
16842
- init_chunk_S2LXF4LF();
16843
- init_chunk_TYI6QVPX();
17631
+ init_chunk_YFUYMQR2();
17632
+ init_chunk_CLGTGGVN();
16844
17633
  init_chunk_HZ6CADSY();
16845
17634
  init_zod();
16846
17635
  CASE_RELATION_TYPE_CODE_PATTERN = /^[a-z0-9]+(_[a-z0-9]+)*$/;
@@ -16880,12 +17669,12 @@ var init_chunk_5WMOQ5NC = __esm({
16880
17669
  }
16881
17670
  });
16882
17671
 
16883
- // ../../packages/core/dist/chunk-UPGAWPE2.js
17672
+ // ../../packages/core/dist/chunk-SC6HGQ5X.js
16884
17673
  var CASE_CHANGE_TOPICS, caseChangedFrameSchema;
16885
- var init_chunk_UPGAWPE2 = __esm({
16886
- "../../packages/core/dist/chunk-UPGAWPE2.js"() {
17674
+ var init_chunk_SC6HGQ5X = __esm({
17675
+ "../../packages/core/dist/chunk-SC6HGQ5X.js"() {
16887
17676
  "use strict";
16888
- init_chunk_S2LXF4LF();
17677
+ init_chunk_YFUYMQR2();
16889
17678
  init_chunk_HZ6CADSY();
16890
17679
  init_zod();
16891
17680
  CASE_CHANGE_TOPICS = ["submission", "agenda", "access"];
@@ -16899,12 +17688,12 @@ var init_chunk_UPGAWPE2 = __esm({
16899
17688
  }
16900
17689
  });
16901
17690
 
16902
- // ../../packages/core/dist/chunk-3EEL6BQ7.js
17691
+ // ../../packages/core/dist/chunk-KIJJEAS2.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_KIJJEAS2 = __esm({
17694
+ "../../packages/core/dist/chunk-KIJJEAS2.js"() {
16906
17695
  "use strict";
16907
- init_chunk_TYI6QVPX();
17696
+ init_chunk_CLGTGGVN();
16908
17697
  init_zod();
16909
17698
  CASE_MEMBER_CASES_PAGE_MAX = 50;
16910
17699
  caseMemberReachQuery = casePageQuery.extend({
@@ -16913,7 +17702,7 @@ var init_chunk_3EEL6BQ7 = __esm({
16913
17702
  }
16914
17703
  });
16915
17704
 
16916
- // ../../packages/core/dist/chunk-ATX6AHPZ.js
17705
+ // ../../packages/core/dist/chunk-3SZD2H6D.js
16917
17706
  function withProblem(shape, problemOf) {
16918
17707
  return shape.superRefine((value, ctx) => {
16919
17708
  const found = problemOf(value);
@@ -16950,10 +17739,10 @@ ${party.role}`);
16950
17739
  return new Set(keys).size === keys.length ? null : { reason: "instrument_party_repeated", at: "parties" };
16951
17740
  }
16952
17741
  var CASE_REGISTRY_TYPE_CODE_PATTERN, CASE_REGISTRY_TYPE_CODE_MAX_LENGTH, CASE_REGISTRY_NAME_MAX_LENGTH, CASE_REGISTRY_TYPE_SCHEMA_MAX_CHARS, CASE_PARTY_ABBREVIATION_PATTERN, CASE_PARTY_PERSON_KINDS, CASE_PARTY_DOCUMENT_KINDS, CASE_PARTY_DOCUMENT_MAX_LENGTH, CASE_PARTY_GROUP_MEMBERS_MAX, CASE_INSTRUMENT_NUMBER_MAX_LENGTH, CASE_INSTRUMENT_ROLE_MAX_LENGTH, CASE_INSTRUMENT_PARTIES_MAX, CASE_REGISTRY_PAGE_MAX, CASE_REGISTRY_QUERY_MAX_LENGTH, trimmedName2, dateSchema, attributesValues, registryTypeFields, createCaseRegistryTypeShape, updateCaseRegistryTypeShape, createCaseRegistryTypeBody, updateCaseRegistryTypeBody, saveCasePartyShape, saveCasePartyBody, saveCasePartyGroupShape, saveCasePartyGroupBody, caseInstrumentPartyInput, saveCaseInstrumentShape, saveCaseInstrumentBody, registryPage, searchText, casePartiesQuery, casePartyGroupsQuery, caseInstrumentsQuery, caseRegistryTypeParam, casePartyParam, casePartyGroupParam, caseInstrumentParam;
16953
- var init_chunk_ATX6AHPZ = __esm({
16954
- "../../packages/core/dist/chunk-ATX6AHPZ.js"() {
17742
+ var init_chunk_3SZD2H6D = __esm({
17743
+ "../../packages/core/dist/chunk-3SZD2H6D.js"() {
16955
17744
  "use strict";
16956
- init_chunk_TYI6QVPX();
17745
+ init_chunk_CLGTGGVN();
16957
17746
  init_chunk_M2T55BV6();
16958
17747
  init_chunk_HZ6CADSY();
16959
17748
  init_zod();
@@ -17045,13 +17834,13 @@ var init_chunk_ATX6AHPZ = __esm({
17045
17834
  }
17046
17835
  });
17047
17836
 
17048
- // ../../packages/core/dist/chunk-NKJ2DQCV.js
17837
+ // ../../packages/core/dist/chunk-A5TJEV6T.js
17049
17838
  var CASE_STYLE_KINDS, caseStyleParam, CASE_STYLE_VERSIONS_PAGE_MAX, caseStyleVersionsQuery, caseStyleContentQuery, CASE_STYLE_UPLOAD_BODY_MAX_BYTES, CASE_STYLE_FILE_FIELD, CASE_STYLE_EXPECT_FIELD, caseStyleUploadForm;
17050
- var init_chunk_NKJ2DQCV = __esm({
17051
- "../../packages/core/dist/chunk-NKJ2DQCV.js"() {
17839
+ var init_chunk_A5TJEV6T = __esm({
17840
+ "../../packages/core/dist/chunk-A5TJEV6T.js"() {
17052
17841
  "use strict";
17053
- init_chunk_AMKBCOOH();
17054
- init_chunk_TYI6QVPX();
17842
+ init_chunk_MQQRYOE6();
17843
+ init_chunk_CLGTGGVN();
17055
17844
  init_chunk_HZ6CADSY();
17056
17845
  init_zod();
17057
17846
  CASE_STYLE_KINDS = ["pdf_stylesheet", "word_reference"];
@@ -17072,7 +17861,7 @@ var init_chunk_NKJ2DQCV = __esm({
17072
17861
  }
17073
17862
  });
17074
17863
 
17075
- // ../../packages/core/dist/chunk-ZZZ65EIA.js
17864
+ // ../../packages/core/dist/chunk-7Y3IO67N.js
17076
17865
  function collectionUploadForm(field, shape) {
17077
17866
  return external_exports.record(external_exports.string(), external_exports.unknown()).transform((form2, ctx) => {
17078
17867
  const refuse2 = (message, path55) => {
@@ -17112,13 +17901,13 @@ function caseCollectionFileName(sent) {
17112
17901
  return name || "document";
17113
17902
  }
17114
17903
  var CASE_COLLECTION_FOLDERS, CASE_COLLECTION_PARTS, isCaseCollectionPart, CASE_COLLECTION_TITLE_MAX_LENGTH, CASE_COLLECTION_TYPE_MAX_LENGTH, CASE_COLLECTION_REASON_MAX_LENGTH, CASE_COLLECTION_FILE_NAME_MAX_LENGTH, caseCollectionDocumentParam, dateOnly, title, registerCaseCollectionDocumentShape, addCaseCollectionVersionShape, CASE_COLLECTION_UPLOAD_BODY_MAX_BYTES, CASE_COLLECTION_DOCUMENT_FIELD, CASE_COLLECTION_VERSION_FIELD, caseCollectionDocumentUploadForm, caseCollectionVersionUploadForm, CASE_COLLECTION_PAGE_MAX, CASE_COLLECTION_CURSOR_MAX_LENGTH, caseCollectionQuery, CASE_COLLECTION_VERSIONS_PAGE_MAX, caseCollectionVersionsQuery, caseCollectionContentQuery;
17115
- var init_chunk_ZZZ65EIA = __esm({
17116
- "../../packages/core/dist/chunk-ZZZ65EIA.js"() {
17904
+ var init_chunk_7Y3IO67N = __esm({
17905
+ "../../packages/core/dist/chunk-7Y3IO67N.js"() {
17117
17906
  "use strict";
17118
- init_chunk_ATX6AHPZ();
17119
- init_chunk_NKJ2DQCV();
17120
- init_chunk_AMKBCOOH();
17121
- init_chunk_TYI6QVPX();
17907
+ init_chunk_3SZD2H6D();
17908
+ init_chunk_A5TJEV6T();
17909
+ init_chunk_MQQRYOE6();
17910
+ init_chunk_CLGTGGVN();
17122
17911
  init_chunk_M2T55BV6();
17123
17912
  init_chunk_HZ6CADSY();
17124
17913
  init_zod();
@@ -17178,7 +17967,7 @@ var init_chunk_ZZZ65EIA = __esm({
17178
17967
  }
17179
17968
  });
17180
17969
 
17181
- // ../../packages/core/dist/chunk-WJJJFHIA.js
17970
+ // ../../packages/core/dist/chunk-TRBCWOW2.js
17182
17971
  function caseReceivedFormat(fileName) {
17183
17972
  const dot = fileName.lastIndexOf(".");
17184
17973
  if (dot < 0) return null;
@@ -17186,14 +17975,14 @@ function caseReceivedFormat(fileName) {
17186
17975
  return isCaseReceivedFormat(extension) ? extension : null;
17187
17976
  }
17188
17977
  var ZIP_SIGNATURE, CASE_RECEIVED_FORMATS, isCaseReceivedFormat, CASE_RECEIVED_PARTS, CASE_RECEIVED_TITLE_MAX_LENGTH, CASE_RECEIVED_TYPE_MAX_LENGTH, CASE_RECEIVED_TEXT_MAX_BYTES, CASE_RECEIVED_UPLOAD_BODY_MAX_BYTES, CASE_RECEIVED_DOCUMENT_FIELD, caseReceivedParam, registerCaseReceivedDocumentShape, caseReceivedUploadForm, caseReceivedFileName, ZIP_DIRECTORY_MAX_BYTES, CONTENT_TYPES_MAX_BYTES, CONTENT_TYPES_INFLATED_MAX_BYTES, CASE_RECEIVED_PAGE_MAX, caseReceivedQuery, caseReceivedContentQuery;
17189
- var init_chunk_WJJJFHIA = __esm({
17190
- "../../packages/core/dist/chunk-WJJJFHIA.js"() {
17191
- "use strict";
17192
- init_chunk_ZZZ65EIA();
17193
- init_chunk_NKJ2DQCV();
17194
- init_chunk_AMKBCOOH();
17195
- init_chunk_S2LXF4LF();
17196
- init_chunk_TYI6QVPX();
17978
+ var init_chunk_TRBCWOW2 = __esm({
17979
+ "../../packages/core/dist/chunk-TRBCWOW2.js"() {
17980
+ "use strict";
17981
+ init_chunk_7Y3IO67N();
17982
+ init_chunk_A5TJEV6T();
17983
+ init_chunk_MQQRYOE6();
17984
+ init_chunk_YFUYMQR2();
17985
+ init_chunk_CLGTGGVN();
17197
17986
  init_chunk_HZ6CADSY();
17198
17987
  init_zod();
17199
17988
  ZIP_SIGNATURE = [80, 75, 3, 4];
@@ -17267,16 +18056,16 @@ var init_chunk_WJJJFHIA = __esm({
17267
18056
  }
17268
18057
  });
17269
18058
 
17270
- // ../../packages/core/dist/chunk-74HGW6HA.js
18059
+ // ../../packages/core/dist/chunk-6GSDWCB5.js
17271
18060
  function addCaseNoteProblem(note) {
17272
18061
  return note.origin !== null && note.kind !== "contribution" ? { reason: "origin_not_contribution", at: "origin" } : null;
17273
18062
  }
17274
18063
  var CASE_NOTE_KINDS, CASE_NOTE_TEXT_MAX_LENGTH, CASE_NOTE_ORIGIN_MAX_LENGTH, CASE_NOTES_PAGE_MAX, addCaseNoteShape, addCaseNoteBody, caseNoteParam, caseTaskParam, caseNotesQuery;
17275
- var init_chunk_74HGW6HA = __esm({
17276
- "../../packages/core/dist/chunk-74HGW6HA.js"() {
18064
+ var init_chunk_6GSDWCB5 = __esm({
18065
+ "../../packages/core/dist/chunk-6GSDWCB5.js"() {
17277
18066
  "use strict";
17278
- init_chunk_S2LXF4LF();
17279
- init_chunk_TYI6QVPX();
18067
+ init_chunk_YFUYMQR2();
18068
+ init_chunk_CLGTGGVN();
17280
18069
  init_chunk_HZ6CADSY();
17281
18070
  init_zod();
17282
18071
  CASE_NOTE_KINDS = ["observation", "next_step", "pending", "contribution"];
@@ -17305,19 +18094,19 @@ var init_chunk_74HGW6HA = __esm({
17305
18094
  }
17306
18095
  });
17307
18096
 
17308
- // ../../packages/core/dist/chunk-LU4T7K5F.js
18097
+ // ../../packages/core/dist/chunk-27IZMIGG.js
17309
18098
  function casePassageLines(text5) {
17310
18099
  const lines2 = text5.replace(/\r\n/g, "\n").split("\n");
17311
18100
  if (lines2.at(-1) === "") lines2.pop();
17312
18101
  return lines2;
17313
18102
  }
17314
18103
  var CASE_COMMENT_TEXT_MAX_LENGTH, CASE_COMMENTS_PAGE_MAX, CASE_COMMENT_LINE_MAX, casePassageLineSchema, lineNumber, addCaseCommentShape, CASE_COMMENT_REVERSED_REASON, addCaseCommentBody, caseCommentsQuery, CASE_COMMENT_OUT_OF_RANGE_REASON, CASE_COMMENT_NOT_TEXT_REASON, CASE_COMMENT_DOCUMENT_TOO_LARGE_REASON;
17315
- var init_chunk_LU4T7K5F = __esm({
17316
- "../../packages/core/dist/chunk-LU4T7K5F.js"() {
18104
+ var init_chunk_27IZMIGG = __esm({
18105
+ "../../packages/core/dist/chunk-27IZMIGG.js"() {
17317
18106
  "use strict";
17318
- init_chunk_74HGW6HA();
17319
- init_chunk_AMKBCOOH();
17320
- init_chunk_TYI6QVPX();
18107
+ init_chunk_6GSDWCB5();
18108
+ init_chunk_MQQRYOE6();
18109
+ init_chunk_CLGTGGVN();
17321
18110
  init_chunk_HZ6CADSY();
17322
18111
  init_zod();
17323
18112
  CASE_COMMENT_TEXT_MAX_LENGTH = CASE_NOTE_TEXT_MAX_LENGTH;
@@ -17354,12 +18143,12 @@ var init_chunk_LU4T7K5F = __esm({
17354
18143
  }
17355
18144
  });
17356
18145
 
17357
- // ../../packages/core/dist/chunk-I6CZPDXO.js
18146
+ // ../../packages/core/dist/chunk-JAR3LH7D.js
17358
18147
  var CASE_VERSION_DECISION_REASON_MAX_LENGTH, CASE_VERSION_DECISIONS, caseVersionDecisionReason, reason, lineNumber2, recordCaseReferenceBody, CASE_PASSAGE_REVERSED_REASON, citeCasePassageBody, decideCaseVersionBody, CASE_PASSAGE_LINK_REQUIRED_REASON, CASE_PASSAGE_LINK_CHANGED_REASON, CASE_PASSAGE_NO_TEXT_REASON, CASE_PASSAGE_TEXT_TOO_LARGE_REASON, CASE_PASSAGE_NOT_TEXT_REASON, CASE_PASSAGE_OUT_OF_RANGE_REASON;
17359
- var init_chunk_I6CZPDXO = __esm({
17360
- "../../packages/core/dist/chunk-I6CZPDXO.js"() {
18148
+ var init_chunk_JAR3LH7D = __esm({
18149
+ "../../packages/core/dist/chunk-JAR3LH7D.js"() {
17361
18150
  "use strict";
17362
- init_chunk_LU4T7K5F();
18151
+ init_chunk_27IZMIGG();
17363
18152
  init_chunk_HZ6CADSY();
17364
18153
  init_zod();
17365
18154
  CASE_VERSION_DECISION_REASON_MAX_LENGTH = 2e3;
@@ -17398,15 +18187,15 @@ var init_chunk_I6CZPDXO = __esm({
17398
18187
  }
17399
18188
  });
17400
18189
 
17401
- // ../../packages/core/dist/chunk-FPFUDA22.js
18190
+ // ../../packages/core/dist/chunk-N4CTQNZE.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_N4CTQNZE = __esm({
18193
+ "../../packages/core/dist/chunk-N4CTQNZE.js"() {
17405
18194
  "use strict";
17406
- init_chunk_ZZZ65EIA();
17407
- init_chunk_I6CZPDXO();
17408
- init_chunk_S2LXF4LF();
17409
- init_chunk_TYI6QVPX();
18195
+ init_chunk_7Y3IO67N();
18196
+ init_chunk_JAR3LH7D();
18197
+ init_chunk_YFUYMQR2();
18198
+ init_chunk_CLGTGGVN();
17410
18199
  init_chunk_HZ6CADSY();
17411
18200
  init_zod();
17412
18201
  caseInputLinkParam = caseRecordParam.extend({ input_id: uuidSchema });
@@ -17437,7 +18226,7 @@ var init_chunk_FPFUDA22 = __esm({
17437
18226
  }
17438
18227
  });
17439
18228
 
17440
- // ../../packages/core/dist/chunk-NVZB33EA.js
18229
+ // ../../packages/core/dist/chunk-DFKHVG4Q.js
17441
18230
  function isCaseDueDate(value) {
17442
18231
  const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
17443
18232
  if (!match) return false;
@@ -17455,10 +18244,10 @@ function setCaseDeadlinesProblem(body) {
17455
18244
  return null;
17456
18245
  }
17457
18246
  var CASE_DUE_DATE_MIN_YEAR, CASE_DUE_DATE_MAX_YEAR, CASE_DEADLINES_PHASES_MAX, CASE_OVERDUE_CASES_MAX, caseDueDateSchema, setCaseDeadlinesShape, setCaseDeadlinesBody, setCaseTaskPlanBody, setCaseOwnerBody, caseOverdueQuery;
17458
- var init_chunk_NVZB33EA = __esm({
17459
- "../../packages/core/dist/chunk-NVZB33EA.js"() {
18247
+ var init_chunk_DFKHVG4Q = __esm({
18248
+ "../../packages/core/dist/chunk-DFKHVG4Q.js"() {
17460
18249
  "use strict";
17461
- init_chunk_TYI6QVPX();
18250
+ init_chunk_CLGTGGVN();
17462
18251
  init_chunk_HZ6CADSY();
17463
18252
  init_zod();
17464
18253
  CASE_DUE_DATE_MIN_YEAR = 2e3;
@@ -17486,12 +18275,12 @@ var init_chunk_NVZB33EA = __esm({
17486
18275
  }
17487
18276
  });
17488
18277
 
17489
- // ../../packages/core/dist/chunk-7QN6QYGN.js
18278
+ // ../../packages/core/dist/chunk-26PIYACX.js
17490
18279
  var CASE_GUEST_EMAIL_MAX, CASE_GUEST_INVITATIONS_PAGE_MAX, CASE_GUEST_INVITE_TOKEN_LENGTH, caseGuestEmailSchema, caseGuestInviteTokenSchema, inviteCaseGuestBody, caseGuestInvitationParam, caseGuestInvitationsQuery, joinCaseSpaceBody, caseJoinSearchParams;
17491
- var init_chunk_7QN6QYGN = __esm({
17492
- "../../packages/core/dist/chunk-7QN6QYGN.js"() {
18280
+ var init_chunk_26PIYACX = __esm({
18281
+ "../../packages/core/dist/chunk-26PIYACX.js"() {
17493
18282
  "use strict";
17494
- init_chunk_TYI6QVPX();
18283
+ init_chunk_CLGTGGVN();
17495
18284
  init_chunk_HZ6CADSY();
17496
18285
  init_zod();
17497
18286
  CASE_GUEST_EMAIL_MAX = 320;
@@ -17509,13 +18298,13 @@ var init_chunk_7QN6QYGN = __esm({
17509
18298
  }
17510
18299
  });
17511
18300
 
17512
- // ../../packages/core/dist/chunk-7RWVVW7T.js
18301
+ // ../../packages/core/dist/chunk-NCOSWD3P.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_NCOSWD3P = __esm({
18304
+ "../../packages/core/dist/chunk-NCOSWD3P.js"() {
17516
18305
  "use strict";
17517
- init_chunk_I6CZPDXO();
17518
- init_chunk_LU4T7K5F();
18306
+ init_chunk_JAR3LH7D();
18307
+ init_chunk_27IZMIGG();
17519
18308
  init_chunk_HZ6CADSY();
17520
18309
  init_zod();
17521
18310
  lines = { line_start: casePassageLineSchema, line_end: casePassageLineSchema };
@@ -17544,12 +18333,12 @@ var init_chunk_AF2RCYPB = __esm({
17544
18333
  }
17545
18334
  });
17546
18335
 
17547
- // ../../packages/core/dist/chunk-2KOYNTE2.js
18336
+ // ../../packages/core/dist/chunk-6TYCOJ5O.js
17548
18337
  var CASE_ADJUSTMENT_REASON_MAX_LENGTH, CASE_ADJUSTMENT_DISPENSATION_KINDS, reason2, activateCasePhaseBody, dispenseCaseBody, addCaseTaskBody, addCaseInputBody, caseOwnItemSchema, addCaseItemBody;
17549
- var init_chunk_2KOYNTE2 = __esm({
17550
- "../../packages/core/dist/chunk-2KOYNTE2.js"() {
18338
+ var init_chunk_6TYCOJ5O = __esm({
18339
+ "../../packages/core/dist/chunk-6TYCOJ5O.js"() {
17551
18340
  "use strict";
17552
- init_chunk_WLKYA2B2();
18341
+ init_chunk_JFD3FZM6();
17553
18342
  init_chunk_HZ6CADSY();
17554
18343
  init_zod();
17555
18344
  CASE_ADJUSTMENT_REASON_MAX_LENGTH = 2e3;
@@ -17580,14 +18369,14 @@ var init_chunk_2KOYNTE2 = __esm({
17580
18369
  }
17581
18370
  });
17582
18371
 
17583
- // ../../packages/core/dist/chunk-E66NXU3F.js
18372
+ // ../../packages/core/dist/chunk-G5S7KI42.js
17584
18373
  var CASE_AGENDA_VALUE_MAX_LENGTH, CASE_AGENDA_JUSTIFICATION_MAX_LENGTH, CASE_AGENDA_EVIDENCE_MAX_LENGTH, CASE_AGENDA_COMMENT_MAX_LENGTH, CASE_AGENDA_VERDICTS, comment, caseAgendaGroupParam, caseAgendaDecisionParam, caseAgendaQuery, caseApprovedDecisionsQuery, proposeCaseAgendaValueBody, decideCaseAgendaBody, dispenseCaseAgendaBody, addCaseDecisionBody;
17585
- var init_chunk_E66NXU3F = __esm({
17586
- "../../packages/core/dist/chunk-E66NXU3F.js"() {
18374
+ var init_chunk_G5S7KI42 = __esm({
18375
+ "../../packages/core/dist/chunk-G5S7KI42.js"() {
17587
18376
  "use strict";
17588
- init_chunk_S2LXF4LF();
17589
- init_chunk_WLKYA2B2();
17590
- init_chunk_TYI6QVPX();
18377
+ init_chunk_YFUYMQR2();
18378
+ init_chunk_JFD3FZM6();
18379
+ init_chunk_CLGTGGVN();
17591
18380
  init_chunk_M2T55BV6();
17592
18381
  init_chunk_HZ6CADSY();
17593
18382
  init_zod();
@@ -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();
@@ -18005,10 +18794,10 @@ var init_chunk_UY32MQHG = __esm({
18005
18794
  }
18006
18795
  });
18007
18796
 
18008
- // ../../packages/core/dist/chunk-OMPT4ZHR.js
18797
+ // ../../packages/core/dist/chunk-AZOWABU5.js
18009
18798
  var billingOrgIdParam, subscriptionItemParams, planKeySchema, billingStatusSchema, paidTierSchema, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, changeTierBody, updateBillingCurrencyBody, invoicesQuery, billingPlanTypeSchema, dataUsageCountersSchema, REKOR_ENTITLEMENT_CONTRACT_VERSION, entitlementProjectionSchema, rekorEntitlementRefreshMessageSchema;
18010
- var init_chunk_OMPT4ZHR = __esm({
18011
- "../../packages/core/dist/chunk-OMPT4ZHR.js"() {
18799
+ var init_chunk_AZOWABU5 = __esm({
18800
+ "../../packages/core/dist/chunk-AZOWABU5.js"() {
18012
18801
  "use strict";
18013
18802
  init_zod();
18014
18803
  billingOrgIdParam = external_exports.object({
@@ -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-KFELNP4O.js
18111
18900
  function refineScopedTarget(data, ctx) {
18112
18901
  if (data.scope === "org") {
18113
18902
  if (!data.org_id) {
@@ -18133,14 +18922,14 @@ 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_KFELNP4O = __esm({
18926
+ "../../packages/core/dist/chunk-KFELNP4O.js"() {
18138
18927
  "use strict";
18139
18928
  init_chunk_FECLIZTY();
18140
18929
  init_chunk_BFG4ZWR4();
18141
18930
  init_chunk_UY32MQHG();
18142
- init_chunk_4NZTCAY5();
18143
- init_chunk_OMPT4ZHR();
18931
+ init_chunk_25BLQS73();
18932
+ init_chunk_AZOWABU5();
18144
18933
  init_chunk_MIWZOSPI();
18145
18934
  init_chunk_HZ6CADSY();
18146
18935
  init_zod();
@@ -18320,6 +19109,13 @@ var init_chunk_HLSE7OOG = __esm({
18320
19109
  * already stored keeps working when its org leaves the list. The route stores it as JSON.
18321
19110
  */
18322
19111
  base_credential_org_ids: external_exports.array(uuidSchema).max(200).optional(),
19112
+ /**
19113
+ * The organizations whose case work is metered (wayai#5921 D9): org ids, replacing the whole list; empty, the default,
19114
+ * meters none. A listed org is billed one operation per revision of a case's files and one per render that issued files,
19115
+ * and the operations gate refuses its case tokens' revisions and its renders at quota
19116
+ * (`apps/backend/src/billing/case-operations.ts`). The route stores it as JSON.
19117
+ */
19118
+ cases_metering_org_ids: external_exports.array(uuidSchema).max(200).optional(),
18323
19119
  /**
18324
19120
  * The mobile app version policy (`MOBILE_VERSION_POLICY_COLUMNS`), per platform: an install
18325
19121
  * below the minimum is blocked until it updates from the store; one below the recommended
@@ -18702,7 +19498,7 @@ var init_contracts = __esm({
18702
19498
  "../../packages/core/dist/contracts/index.js"() {
18703
19499
  "use strict";
18704
19500
  init_chunk_VXEAR36B();
18705
- init_chunk_RACEDHG6();
19501
+ init_chunk_2ZBLI7IH();
18706
19502
  init_chunk_Q7KIQHAZ();
18707
19503
  init_chunk_IPXBFWUU();
18708
19504
  init_chunk_63UWXV4T();
@@ -18737,7 +19533,7 @@ var init_contracts = __esm({
18737
19533
  init_chunk_SY6PLCPK();
18738
19534
  init_chunk_ACGAI25T();
18739
19535
  init_chunk_MH4O3YEX();
18740
- init_chunk_QEEQN2NE();
19536
+ init_chunk_V2CXEU5X();
18741
19537
  init_chunk_KSTYTQ7I();
18742
19538
  init_chunk_LKBSHANA();
18743
19539
  init_chunk_LX3D5LCB();
@@ -18747,58 +19543,58 @@ var init_contracts = __esm({
18747
19543
  init_chunk_YULHXJ5M();
18748
19544
  init_chunk_V4FRPRH5();
18749
19545
  init_chunk_LWMLR2WI();
18750
- init_chunk_ME6NL7FI();
19546
+ init_chunk_X4IDZLLS();
18751
19547
  init_chunk_7CYHPF35();
18752
19548
  init_chunk_NETRUHZF();
18753
- init_chunk_A3KD6FK4();
19549
+ init_chunk_JTG72ANZ();
18754
19550
  init_chunk_QG3XMUEN();
18755
19551
  init_chunk_EBUWHIFV();
18756
19552
  init_chunk_5YZ3R7KF();
18757
19553
  init_chunk_2YEGUQR7();
18758
19554
  init_chunk_AHISKXHA();
18759
- init_chunk_UAFAJNZ6();
19555
+ init_chunk_NUJ5GZHA();
18760
19556
  init_chunk_K3PD6AOF();
18761
- init_chunk_F4264AMK();
18762
- init_chunk_ZTRVP4OT();
18763
- init_chunk_5WMOQ5NC();
18764
- init_chunk_UPGAWPE2();
18765
- init_chunk_3EEL6BQ7();
18766
- init_chunk_VHA3AQE4();
18767
- init_chunk_2S6LIRGD();
18768
- init_chunk_WJJJFHIA();
18769
- init_chunk_FPFUDA22();
18770
- init_chunk_ZZZ65EIA();
18771
- init_chunk_ATX6AHPZ();
18772
- init_chunk_NKJ2DQCV();
18773
- init_chunk_NVZB33EA();
18774
- init_chunk_7QN6QYGN();
18775
- init_chunk_7RWVVW7T();
19557
+ init_chunk_JNZVVHKO();
19558
+ init_chunk_KY3ZNL3E();
19559
+ init_chunk_4Y76ZGBB();
19560
+ init_chunk_SC6HGQ5X();
19561
+ init_chunk_KIJJEAS2();
19562
+ init_chunk_72TNUJVF();
19563
+ init_chunk_TRK5L5I5();
19564
+ init_chunk_TRBCWOW2();
19565
+ init_chunk_N4CTQNZE();
19566
+ init_chunk_7Y3IO67N();
19567
+ init_chunk_3SZD2H6D();
19568
+ init_chunk_A5TJEV6T();
19569
+ init_chunk_DFKHVG4Q();
19570
+ init_chunk_26PIYACX();
19571
+ init_chunk_NCOSWD3P();
18776
19572
  init_chunk_5PKKFSSF();
18777
19573
  init_chunk_AF2RCYPB();
18778
- init_chunk_2KOYNTE2();
18779
- init_chunk_E66NXU3F();
18780
- init_chunk_I6CZPDXO();
19574
+ init_chunk_6TYCOJ5O();
19575
+ init_chunk_G5S7KI42();
19576
+ init_chunk_JAR3LH7D();
18781
19577
  init_chunk_UEJOG2Q7();
18782
19578
  init_chunk_KEN2DASI();
18783
- init_chunk_L5GC53VI();
19579
+ init_chunk_JQRL355P();
18784
19580
  init_chunk_R6Y377AW();
18785
19581
  init_chunk_UAOHHCW5();
18786
- init_chunk_QMQGGR7Q();
19582
+ init_chunk_OLBDDBKV();
18787
19583
  init_chunk_ULQGJUXZ();
18788
19584
  init_chunk_YWZFB34T();
18789
19585
  init_chunk_PZPOUXJR();
18790
19586
  init_chunk_LBDH7LCG();
18791
19587
  init_chunk_4LXDRTO4();
18792
19588
  init_chunk_NVKU5PPQ();
18793
- init_chunk_HLSE7OOG();
19589
+ init_chunk_KFELNP4O();
18794
19590
  init_chunk_FECLIZTY();
18795
19591
  init_chunk_BFG4ZWR4();
18796
19592
  init_chunk_UY32MQHG();
18797
- init_chunk_4NZTCAY5();
19593
+ init_chunk_25BLQS73();
18798
19594
  init_chunk_D3EP4TDU();
18799
- init_chunk_JP42Y3U2();
19595
+ init_chunk_ZANBA4K4();
18800
19596
  init_chunk_QT7R3TGR();
18801
- init_chunk_OMPT4ZHR();
19597
+ init_chunk_AZOWABU5();
18802
19598
  init_chunk_2PZIF56U();
18803
19599
  init_chunk_6J742GLA();
18804
19600
  init_chunk_ZRXP6OOJ();
@@ -18823,13 +19619,13 @@ var init_contracts = __esm({
18823
19619
  init_chunk_C2UEA2KW();
18824
19620
  init_chunk_K6O2P77D();
18825
19621
  init_chunk_YR7QALGP();
18826
- init_chunk_LU4T7K5F();
18827
- init_chunk_74HGW6HA();
18828
- init_chunk_AMKBCOOH();
18829
- init_chunk_S2LXF4LF();
18830
- init_chunk_WLKYA2B2();
19622
+ init_chunk_27IZMIGG();
19623
+ init_chunk_6GSDWCB5();
19624
+ init_chunk_MQQRYOE6();
19625
+ init_chunk_YFUYMQR2();
19626
+ init_chunk_JFD3FZM6();
18831
19627
  init_chunk_KWRHZBGU();
18832
- init_chunk_TYI6QVPX();
19628
+ init_chunk_CLGTGGVN();
18833
19629
  init_chunk_M2T55BV6();
18834
19630
  init_chunk_VYINA6YP();
18835
19631
  init_chunk_ZVXO3XL6();
@@ -20275,6 +21071,9 @@ var init_utils = __esm({
20275
21071
  ["admin base-credential-orgs status", { positionals: 0 }],
20276
21072
  ["admin base-credential-orgs add", { positionals: 1 }],
20277
21073
  ["admin base-credential-orgs remove", { positionals: 1 }],
21074
+ ["admin cases-metering-orgs status", { positionals: 0 }],
21075
+ ["admin cases-metering-orgs add", { positionals: 1 }],
21076
+ ["admin cases-metering-orgs remove", { positionals: 1 }],
20278
21077
  ["admin voice-calls enable", { positionals: 0 }],
20279
21078
  ["admin voice-calls disable", { positionals: 0 }],
20280
21079
  ["admin voice-calls status", { positionals: 0 }],
@@ -20632,10 +21431,10 @@ var CASE_TYPE_PACKAGE_REVISIONS_MAX, caseTypeSourceQuery, caseTypePackageParam,
20632
21431
  var init_case_type_drafts = __esm({
20633
21432
  "../../packages/core/dist/contracts/case-type-drafts.js"() {
20634
21433
  "use strict";
20635
- init_chunk_AMKBCOOH();
20636
- init_chunk_WLKYA2B2();
21434
+ init_chunk_MQQRYOE6();
21435
+ init_chunk_JFD3FZM6();
20637
21436
  init_chunk_KWRHZBGU();
20638
- init_chunk_TYI6QVPX();
21437
+ init_chunk_CLGTGGVN();
20639
21438
  init_chunk_M2T55BV6();
20640
21439
  init_chunk_VYINA6YP();
20641
21440
  init_chunk_ZVXO3XL6();
@@ -20708,15 +21507,15 @@ var init_case_type_drafts = __esm({
20708
21507
  var init_case_received_documents = __esm({
20709
21508
  "../../packages/core/dist/contracts/case-received-documents.js"() {
20710
21509
  "use strict";
20711
- init_chunk_WJJJFHIA();
20712
- init_chunk_ZZZ65EIA();
20713
- init_chunk_ATX6AHPZ();
20714
- init_chunk_NKJ2DQCV();
20715
- init_chunk_AMKBCOOH();
20716
- init_chunk_S2LXF4LF();
20717
- init_chunk_WLKYA2B2();
21510
+ init_chunk_TRBCWOW2();
21511
+ init_chunk_7Y3IO67N();
21512
+ init_chunk_3SZD2H6D();
21513
+ init_chunk_A5TJEV6T();
21514
+ init_chunk_MQQRYOE6();
21515
+ init_chunk_YFUYMQR2();
21516
+ init_chunk_JFD3FZM6();
20718
21517
  init_chunk_KWRHZBGU();
20719
- init_chunk_TYI6QVPX();
21518
+ init_chunk_CLGTGGVN();
20720
21519
  init_chunk_M2T55BV6();
20721
21520
  init_chunk_VYINA6YP();
20722
21521
  init_chunk_ZVXO3XL6();
@@ -20733,9 +21532,9 @@ var init_case_received_documents = __esm({
20733
21532
  var init_case_files = __esm({
20734
21533
  "../../packages/core/dist/contracts/case-files.js"() {
20735
21534
  "use strict";
20736
- init_chunk_AMKBCOOH();
21535
+ init_chunk_MQQRYOE6();
20737
21536
  init_chunk_KWRHZBGU();
20738
- init_chunk_TYI6QVPX();
21537
+ init_chunk_CLGTGGVN();
20739
21538
  init_chunk_VYINA6YP();
20740
21539
  init_chunk_ZVXO3XL6();
20741
21540
  init_chunk_FBV7NLKO();
@@ -25605,18 +26404,18 @@ var init_hub_materializer = __esm({
25605
26404
  var init_ci = __esm({
25606
26405
  "../../packages/core/dist/contracts/ci.js"() {
25607
26406
  "use strict";
25608
- init_chunk_A3KD6FK4();
26407
+ init_chunk_JTG72ANZ();
25609
26408
  init_chunk_QG3XMUEN();
25610
26409
  init_chunk_EBUWHIFV();
25611
26410
  init_chunk_5YZ3R7KF();
25612
26411
  init_chunk_2YEGUQR7();
25613
26412
  init_chunk_AHISKXHA();
25614
- init_chunk_QMQGGR7Q();
26413
+ init_chunk_OLBDDBKV();
25615
26414
  init_chunk_LBDH7LCG();
25616
26415
  init_chunk_4LXDRTO4();
25617
- init_chunk_4NZTCAY5();
26416
+ init_chunk_25BLQS73();
25618
26417
  init_chunk_D3EP4TDU();
25619
- init_chunk_JP42Y3U2();
26418
+ init_chunk_ZANBA4K4();
25620
26419
  init_chunk_QT7R3TGR();
25621
26420
  init_chunk_AMMLEB4T();
25622
26421
  init_chunk_IBL7FANV();
@@ -31083,9 +31882,9 @@ var init_case_type_packages = __esm({
31083
31882
  var init_case_types = __esm({
31084
31883
  "../../packages/core/dist/contracts/case-types.js"() {
31085
31884
  "use strict";
31086
- init_chunk_WLKYA2B2();
31885
+ init_chunk_JFD3FZM6();
31087
31886
  init_chunk_KWRHZBGU();
31088
- init_chunk_TYI6QVPX();
31887
+ init_chunk_CLGTGGVN();
31089
31888
  init_chunk_M2T55BV6();
31090
31889
  init_chunk_VYINA6YP();
31091
31890
  init_chunk_ZVXO3XL6();
@@ -41880,10 +42679,10 @@ var CASE_AGENT_REQUEST_TTL_MS, CASE_AGENT_REQUESTS_PER_PERSON_MAX, CASE_AGENT_MA
41880
42679
  var init_case_agents = __esm({
41881
42680
  "../../packages/core/dist/contracts/case-agents.js"() {
41882
42681
  "use strict";
41883
- init_chunk_S2LXF4LF();
41884
- init_chunk_WLKYA2B2();
42682
+ init_chunk_YFUYMQR2();
42683
+ init_chunk_JFD3FZM6();
41885
42684
  init_chunk_KWRHZBGU();
41886
- init_chunk_TYI6QVPX();
42685
+ init_chunk_CLGTGGVN();
41887
42686
  init_chunk_M2T55BV6();
41888
42687
  init_chunk_VYINA6YP();
41889
42688
  init_chunk_ZVXO3XL6();
@@ -41918,10 +42717,10 @@ var init_case_agents = __esm({
41918
42717
  var init_case_records = __esm({
41919
42718
  "../../packages/core/dist/contracts/case-records.js"() {
41920
42719
  "use strict";
41921
- init_chunk_S2LXF4LF();
41922
- init_chunk_WLKYA2B2();
42720
+ init_chunk_YFUYMQR2();
42721
+ init_chunk_JFD3FZM6();
41923
42722
  init_chunk_KWRHZBGU();
41924
- init_chunk_TYI6QVPX();
42723
+ init_chunk_CLGTGGVN();
41925
42724
  init_chunk_M2T55BV6();
41926
42725
  init_chunk_VYINA6YP();
41927
42726
  init_chunk_ZVXO3XL6();
@@ -41939,10 +42738,10 @@ var CASE_REVIEW_ROUNDS_MAX, CASE_REVIEW_REASON_MAX_LENGTH, CASE_REVIEW_PAIR_UNKN
41939
42738
  var init_case_review = __esm({
41940
42739
  "../../packages/core/dist/contracts/case-review.js"() {
41941
42740
  "use strict";
41942
- init_chunk_AMKBCOOH();
41943
- init_chunk_WLKYA2B2();
42741
+ init_chunk_MQQRYOE6();
42742
+ init_chunk_JFD3FZM6();
41944
42743
  init_chunk_KWRHZBGU();
41945
- init_chunk_TYI6QVPX();
42744
+ init_chunk_CLGTGGVN();
41946
42745
  init_chunk_M2T55BV6();
41947
42746
  init_chunk_VYINA6YP();
41948
42747
  init_chunk_ZVXO3XL6();
@@ -42073,13 +42872,13 @@ var init_case_session = __esm({
42073
42872
  var init_case_comments = __esm({
42074
42873
  "../../packages/core/dist/contracts/case-comments.js"() {
42075
42874
  "use strict";
42076
- init_chunk_LU4T7K5F();
42077
- init_chunk_74HGW6HA();
42078
- init_chunk_AMKBCOOH();
42079
- init_chunk_S2LXF4LF();
42080
- init_chunk_WLKYA2B2();
42875
+ init_chunk_27IZMIGG();
42876
+ init_chunk_6GSDWCB5();
42877
+ init_chunk_MQQRYOE6();
42878
+ init_chunk_YFUYMQR2();
42879
+ init_chunk_JFD3FZM6();
42081
42880
  init_chunk_KWRHZBGU();
42082
- init_chunk_TYI6QVPX();
42881
+ init_chunk_CLGTGGVN();
42083
42882
  init_chunk_M2T55BV6();
42084
42883
  init_chunk_VYINA6YP();
42085
42884
  init_chunk_ZVXO3XL6();
@@ -42096,14 +42895,14 @@ var init_case_comments = __esm({
42096
42895
  var init_case_collection_citations = __esm({
42097
42896
  "../../packages/core/dist/contracts/case-collection-citations.js"() {
42098
42897
  "use strict";
42099
- init_chunk_I6CZPDXO();
42100
- init_chunk_LU4T7K5F();
42101
- init_chunk_74HGW6HA();
42102
- init_chunk_AMKBCOOH();
42103
- init_chunk_S2LXF4LF();
42104
- init_chunk_WLKYA2B2();
42898
+ init_chunk_JAR3LH7D();
42899
+ init_chunk_27IZMIGG();
42900
+ init_chunk_6GSDWCB5();
42901
+ init_chunk_MQQRYOE6();
42902
+ init_chunk_YFUYMQR2();
42903
+ init_chunk_JFD3FZM6();
42105
42904
  init_chunk_KWRHZBGU();
42106
- init_chunk_TYI6QVPX();
42905
+ init_chunk_CLGTGGVN();
42107
42906
  init_chunk_M2T55BV6();
42108
42907
  init_chunk_VYINA6YP();
42109
42908
  init_chunk_ZVXO3XL6();
@@ -42120,18 +42919,18 @@ var init_case_collection_citations = __esm({
42120
42919
  var init_case_collection_links = __esm({
42121
42920
  "../../packages/core/dist/contracts/case-collection-links.js"() {
42122
42921
  "use strict";
42123
- init_chunk_FPFUDA22();
42124
- init_chunk_ZZZ65EIA();
42125
- init_chunk_ATX6AHPZ();
42126
- init_chunk_NKJ2DQCV();
42127
- init_chunk_I6CZPDXO();
42128
- init_chunk_LU4T7K5F();
42129
- init_chunk_74HGW6HA();
42130
- init_chunk_AMKBCOOH();
42131
- init_chunk_S2LXF4LF();
42132
- init_chunk_WLKYA2B2();
42922
+ init_chunk_N4CTQNZE();
42923
+ init_chunk_7Y3IO67N();
42924
+ init_chunk_3SZD2H6D();
42925
+ init_chunk_A5TJEV6T();
42926
+ init_chunk_JAR3LH7D();
42927
+ init_chunk_27IZMIGG();
42928
+ init_chunk_6GSDWCB5();
42929
+ init_chunk_MQQRYOE6();
42930
+ init_chunk_YFUYMQR2();
42931
+ init_chunk_JFD3FZM6();
42133
42932
  init_chunk_KWRHZBGU();
42134
- init_chunk_TYI6QVPX();
42933
+ init_chunk_CLGTGGVN();
42135
42934
  init_chunk_M2T55BV6();
42136
42935
  init_chunk_VYINA6YP();
42137
42936
  init_chunk_ZVXO3XL6();
@@ -42899,7 +43698,7 @@ exec wayai cases pull --mirror-only --dir "$(dirname "$0")/.."
42899
43698
  }
42900
43699
  });
42901
43700
 
42902
- // ../../packages/core/dist/chunk-CVJWAW7Y.js
43701
+ // ../../packages/core/dist/chunk-KOPPBU54.js
42903
43702
  function firstAtOrAfter(sorted, from) {
42904
43703
  let lo = 0;
42905
43704
  let hi = sorted.length;
@@ -43314,11 +44113,11 @@ function readItems(text5, state) {
43314
44113
  };
43315
44114
  }
43316
44115
  var CASE_COMPOSED_COVER, CASE_ITEM_READER_MAX_CHARS, FENCE_OPEN, BLANK_AFTER, CASE_FRONT_MATTER, FRONT_MATTER_OPENING, withoutBom, FENCE, SETEXT_UNDERLINE, DASHES, COLUMNS, patternBody, CALCULATION_MARKER, DECISION_MARKER, DOCUMENT_MARKER, INPUT_MARKER, isSpace, isTabOrSpace, once, OPENS_FRONT_MATTER;
43317
- var init_chunk_CVJWAW7Y = __esm({
43318
- "../../packages/core/dist/chunk-CVJWAW7Y.js"() {
44116
+ var init_chunk_KOPPBU54 = __esm({
44117
+ "../../packages/core/dist/chunk-KOPPBU54.js"() {
43319
44118
  "use strict";
43320
- init_chunk_LU4T7K5F();
43321
- init_chunk_WLKYA2B2();
44119
+ init_chunk_27IZMIGG();
44120
+ init_chunk_JFD3FZM6();
43322
44121
  CASE_COMPOSED_COVER = "00-cover.md";
43323
44122
  CASE_ITEM_READER_MAX_CHARS = 4 * 1024 * 1024;
43324
44123
  FENCE_OPEN = / {0,3}(`{3,}|~{3,})([^\n]*)(?:\n|$)/y;
@@ -43348,14 +44147,14 @@ var init_chunk_CVJWAW7Y = __esm({
43348
44147
  var init_case_item_reader = __esm({
43349
44148
  "../../packages/core/dist/case-item-reader.js"() {
43350
44149
  "use strict";
43351
- init_chunk_CVJWAW7Y();
43352
- init_chunk_LU4T7K5F();
43353
- init_chunk_74HGW6HA();
43354
- init_chunk_AMKBCOOH();
43355
- init_chunk_S2LXF4LF();
43356
- init_chunk_WLKYA2B2();
44150
+ init_chunk_KOPPBU54();
44151
+ init_chunk_27IZMIGG();
44152
+ init_chunk_6GSDWCB5();
44153
+ init_chunk_MQQRYOE6();
44154
+ init_chunk_YFUYMQR2();
44155
+ init_chunk_JFD3FZM6();
43357
44156
  init_chunk_KWRHZBGU();
43358
- init_chunk_TYI6QVPX();
44157
+ init_chunk_CLGTGGVN();
43359
44158
  init_chunk_M2T55BV6();
43360
44159
  init_chunk_VYINA6YP();
43361
44160
  init_chunk_ZVXO3XL6();
@@ -43666,15 +44465,15 @@ ${line}`).join("");
43666
44465
  var init_case_input_sources = __esm({
43667
44466
  "../../packages/core/dist/contracts/case-input-sources.js"() {
43668
44467
  "use strict";
43669
- init_chunk_7RWVVW7T();
43670
- init_chunk_I6CZPDXO();
43671
- init_chunk_LU4T7K5F();
43672
- init_chunk_74HGW6HA();
43673
- init_chunk_AMKBCOOH();
43674
- init_chunk_S2LXF4LF();
43675
- init_chunk_WLKYA2B2();
44468
+ init_chunk_NCOSWD3P();
44469
+ init_chunk_JAR3LH7D();
44470
+ init_chunk_27IZMIGG();
44471
+ init_chunk_6GSDWCB5();
44472
+ init_chunk_MQQRYOE6();
44473
+ init_chunk_YFUYMQR2();
44474
+ init_chunk_JFD3FZM6();
43676
44475
  init_chunk_KWRHZBGU();
43677
- init_chunk_TYI6QVPX();
44476
+ init_chunk_CLGTGGVN();
43678
44477
  init_chunk_M2T55BV6();
43679
44478
  init_chunk_VYINA6YP();
43680
44479
  init_chunk_ZVXO3XL6();
@@ -43691,11 +44490,11 @@ var init_case_input_sources = __esm({
43691
44490
  var init_case_notes = __esm({
43692
44491
  "../../packages/core/dist/contracts/case-notes.js"() {
43693
44492
  "use strict";
43694
- init_chunk_74HGW6HA();
43695
- init_chunk_S2LXF4LF();
43696
- init_chunk_WLKYA2B2();
44493
+ init_chunk_6GSDWCB5();
44494
+ init_chunk_YFUYMQR2();
44495
+ init_chunk_JFD3FZM6();
43697
44496
  init_chunk_KWRHZBGU();
43698
- init_chunk_TYI6QVPX();
44497
+ init_chunk_CLGTGGVN();
43699
44498
  init_chunk_M2T55BV6();
43700
44499
  init_chunk_VYINA6YP();
43701
44500
  init_chunk_ZVXO3XL6();
@@ -46873,13 +47672,33 @@ async function adminCommand(args2) {
46873
47672
  }
46874
47673
  switch (sub) {
46875
47674
  case "status":
46876
- await runBaseCredentialOrgsStatus(positional, flagArgs);
47675
+ await runOrgListStatus(BASE_CREDENTIAL_ORGS, positional, flagArgs);
46877
47676
  return;
46878
47677
  case "add":
46879
- await runBaseCredentialOrgsChange("add", positional, flagArgs);
47678
+ await runOrgListChange(BASE_CREDENTIAL_ORGS, "add", positional, flagArgs);
46880
47679
  return;
46881
47680
  case "remove":
46882
- await runBaseCredentialOrgsChange("remove", positional, flagArgs);
47681
+ await runOrgListChange(BASE_CREDENTIAL_ORGS, "remove", positional, flagArgs);
47682
+ return;
47683
+ default:
47684
+ printHelp2();
47685
+ process.exit(1);
47686
+ }
47687
+ }
47688
+ if (group === "cases-metering-orgs") {
47689
+ if (!sub) {
47690
+ printHelp2();
47691
+ process.exit(1);
47692
+ }
47693
+ switch (sub) {
47694
+ case "status":
47695
+ await runOrgListStatus(CASES_METERING_ORGS, positional, flagArgs);
47696
+ return;
47697
+ case "add":
47698
+ await runOrgListChange(CASES_METERING_ORGS, "add", positional, flagArgs);
47699
+ return;
47700
+ case "remove":
47701
+ await runOrgListChange(CASES_METERING_ORGS, "remove", positional, flagArgs);
46883
47702
  return;
46884
47703
  default:
46885
47704
  printHelp2();
@@ -48228,22 +49047,22 @@ async function runVaultGateChange(change, positional, flagArgs) {
48228
49047
  console.log(`After: ${describeVaultGateList(after)}`);
48229
49048
  console.log(PLATFORM_CONFIG_PROPAGATION_NOTE);
48230
49049
  }
48231
- function readBaseCredentialOrgList(data) {
48232
- return readUuidListColumn(data, "base_credential_org_ids", "org ids");
49050
+ function readOrgList(column, data) {
49051
+ return readUuidListColumn(data, column.key, "org ids");
48233
49052
  }
48234
- function describeBaseCredentialOrgList(ids) {
48235
- return ids.length === 0 ? "(none listed: no org may store a base credential)" : ids.join(", ");
49053
+ function describeOrgList(column, ids) {
49054
+ return ids.length === 0 ? column.none : ids.join(", ");
48236
49055
  }
48237
- async function readBaseCredentialOrgConfig(client) {
49056
+ async function readOrgListConfig(column, client) {
48238
49057
  try {
48239
- return readBaseCredentialOrgList((await client.adminGetConfig()).data);
49058
+ return readOrgList(column, (await client.adminGetConfig()).data);
48240
49059
  } catch (err) {
48241
49060
  exitOnApiError(err);
48242
49061
  throw err;
48243
49062
  }
48244
49063
  }
48245
- async function runBaseCredentialOrgsStatus(positional, flagArgs) {
48246
- const usage4 = "wayai admin base-credential-orgs status [--json]";
49064
+ async function runOrgListStatus(column, positional, flagArgs) {
49065
+ const usage4 = `wayai admin ${column.group} status [--json]`;
48247
49066
  if (positional.length > 0) {
48248
49067
  console.error(usage4);
48249
49068
  process.exit(1);
@@ -48251,15 +49070,15 @@ async function runBaseCredentialOrgsStatus(positional, flagArgs) {
48251
49070
  const { jsonOutput } = parseBooleanFlags(flagArgs, usage4, ["--json"]);
48252
49071
  const { config, accessToken } = await requireAuth();
48253
49072
  const client = new ApiClient({ apiUrl: config.api_url, accessToken });
48254
- const ids = await readBaseCredentialOrgConfig(client);
49073
+ const ids = await readOrgListConfig(column, client);
48255
49074
  if (jsonOutput) {
48256
- console.log(JSON.stringify({ base_credential_org_ids: ids }, null, 2));
49075
+ console.log(JSON.stringify({ [column.key]: ids }, null, 2));
48257
49076
  return;
48258
49077
  }
48259
- console.log(`base_credential_org_ids (platform): ${describeBaseCredentialOrgList(ids)}`);
49078
+ console.log(`${column.key} (platform): ${describeOrgList(column, ids)}`);
48260
49079
  }
48261
- async function runBaseCredentialOrgsChange(change, positional, flagArgs) {
48262
- const usage4 = `wayai admin base-credential-orgs ${change} <org_id> [--yes] [--json]`;
49080
+ async function runOrgListChange(column, change, positional, flagArgs) {
49081
+ const usage4 = `wayai admin ${column.group} ${change} <org_id> [--yes] [--json]`;
48263
49082
  const { yes, jsonOutput } = parseBooleanFlags(flagArgs, usage4, ["--yes", "--json"]);
48264
49083
  if (positional.length !== 1) {
48265
49084
  console.error("Name one org id.");
@@ -48274,21 +49093,21 @@ async function runBaseCredentialOrgsChange(change, positional, flagArgs) {
48274
49093
  }
48275
49094
  const { config, accessToken } = await requireAuth();
48276
49095
  const client = new ApiClient({ apiUrl: config.api_url, accessToken });
48277
- const before = await readBaseCredentialOrgConfig(client);
49096
+ const before = await readOrgListConfig(column, client);
48278
49097
  const listed3 = before.some((id) => id.toLowerCase() === orgId);
48279
49098
  if (listed3 === (change === "add")) {
48280
49099
  if (jsonOutput) {
48281
49100
  console.log(JSON.stringify({ before, after: before, changed: false }, null, 2));
48282
49101
  return;
48283
49102
  }
48284
- console.log(`Before: ${describeBaseCredentialOrgList(before)}`);
49103
+ console.log(`Before: ${describeOrgList(column, before)}`);
48285
49104
  console.log(`${orgId} is ${change === "add" ? "already" : "not"} listed; nothing was written.`);
48286
49105
  return;
48287
49106
  }
48288
49107
  const next = change === "add" ? [...before, orgId] : before.filter((id) => id.toLowerCase() !== orgId);
48289
- if (!jsonOutput) console.log(`Before: ${describeBaseCredentialOrgList(before)}`);
49108
+ if (!jsonOutput) console.log(`Before: ${describeOrgList(column, before)}`);
48290
49109
  if (!yes && !jsonOutput) {
48291
- console.log(change === "add" ? `About to add ${orgId}: its bases may store base credentials in the credentials vault while base credentials' vault gate is open.` : `About to remove ${orgId}: its bases can no longer store or rotate a base credential; the credentials they stored keep working and can be deleted.`);
49110
+ console.log(change === "add" ? column.adding(orgId) : column.removing(orgId));
48292
49111
  const ok = await confirm("Proceed?");
48293
49112
  if (!ok) {
48294
49113
  console.log("Aborted.");
@@ -48297,7 +49116,7 @@ async function runBaseCredentialOrgsChange(change, positional, flagArgs) {
48297
49116
  }
48298
49117
  let after;
48299
49118
  try {
48300
- after = readBaseCredentialOrgList((await client.adminUpdateConfig({ base_credential_org_ids: next })).data);
49119
+ after = readOrgList(column, (await client.adminUpdateConfig({ [column.key]: next })).data);
48301
49120
  } catch (err) {
48302
49121
  exitOnApiError(err);
48303
49122
  throw err;
@@ -48306,7 +49125,7 @@ async function runBaseCredentialOrgsChange(change, positional, flagArgs) {
48306
49125
  if (jsonOutput) {
48307
49126
  console.log(JSON.stringify({ before, after, changed: stored }, null, 2));
48308
49127
  } else {
48309
- console.log(`After: ${describeBaseCredentialOrgList(after)}`);
49128
+ console.log(`After: ${describeOrgList(column, after)}`);
48310
49129
  }
48311
49130
  if (!stored) {
48312
49131
  console.error(`The platform config answered without the change: ${orgId} was not ${change === "add" ? "added" : "removed"}. A deploy may be in progress; run the command again in a few minutes.`);
@@ -48979,6 +49798,12 @@ Usage:
48979
49798
  wayai admin base-credential-orgs remove <org_id> [--yes] [--json]
48980
49799
  Stop admitting it: no new value or rotation; what it stored keeps working and can be deleted
48981
49800
 
49801
+ wayai admin cases-metering-orgs status [--json] Print the orgs whose case work is metered (cases_metering_org_ids)
49802
+ wayai admin cases-metering-orgs add <org_id> [--yes] [--json]
49803
+ Meter an org's case work: one operation per revision and per render that issues files, its case tokens' revisions and its renders refused at quota; prints before and after, confirms unless --yes
49804
+ wayai admin cases-metering-orgs remove <org_id> [--yes] [--json]
49805
+ Stop metering it: its case work bills nothing and is never refused by the operations gate
49806
+
48982
49807
  Sources:
48983
49808
  do Live DO SQLite (existing conversation, hub config, etc.).
48984
49809
  analytics ClickHouse projections (conversation, message, schedule_event).
@@ -49110,6 +49935,13 @@ Sources:
49110
49935
  (vault-gate add base_source) by every create and rotation, on every environment.
49111
49936
  Empty, the default, admits none. An org removed keeps the credentials it stored:
49112
49937
  they still send and can be deleted. Changes land within about 60 s.
49938
+ cases-metering-orgs
49939
+ The orgs whose case work is metered: the PLATFORM-wide cases_metering_org_ids list,
49940
+ read before each revision of a case's files, each submit and each render's settling.
49941
+ A listed org is billed one operation per revision and per render that issues files,
49942
+ and at its operations quota its case tokens' revisions and its renders are refused;
49943
+ a person's own revision never is. Empty, the default, meters none; work done while
49944
+ an org was not listed is never billed later. Changes land within about 60 s.
49113
49945
 
49114
49946
  Types (do): ${VALID_TYPES.join(" | ")}
49115
49947
  Tables (analytics): ${VALID_ANALYTICS_TABLES.join(" | ")}
@@ -49151,7 +49983,7 @@ Audit + rate limit:
49151
49983
  across all sources. Platform-admin grant required.
49152
49984
  `.trim());
49153
49985
  }
49154
- var VALID_TYPES, VALID_ANALYTICS_TABLES, HARNESS_GATE, VOICE_CALLS_GATE, THREADS_GATE, COMMUNITIES_GATE, CASES_GATE, PLATFORM_CONFIG_PROPAGATION_NOTE, VAULT_GATE_CONNECTORS, VAULT_GATE_BY_ID_ONLY, VALID_NOTICE_SEVERITIES;
49986
+ var VALID_TYPES, VALID_ANALYTICS_TABLES, HARNESS_GATE, VOICE_CALLS_GATE, THREADS_GATE, COMMUNITIES_GATE, CASES_GATE, PLATFORM_CONFIG_PROPAGATION_NOTE, VAULT_GATE_CONNECTORS, VAULT_GATE_BY_ID_ONLY, BASE_CREDENTIAL_ORGS, CASES_METERING_ORGS, VALID_NOTICE_SEVERITIES;
49155
49987
  var init_admin = __esm({
49156
49988
  "src/commands/admin.ts"() {
49157
49989
  "use strict";
@@ -49239,6 +50071,20 @@ var init_admin = __esm({
49239
50071
  VAULT_GATE_BY_ID_ONLY = /* @__PURE__ */ new Map([
49240
50072
  ["01e7b19c-bc94-43f4-a780-ad5a22fb7127", "openai"]
49241
50073
  ]);
50074
+ BASE_CREDENTIAL_ORGS = {
50075
+ group: "base-credential-orgs",
50076
+ key: "base_credential_org_ids",
50077
+ none: "(none listed: no org may store a base credential)",
50078
+ adding: (orgId) => `About to add ${orgId}: its bases may store base credentials in the credentials vault while base credentials' vault gate is open.`,
50079
+ removing: (orgId) => `About to remove ${orgId}: its bases can no longer store or rotate a base credential; the credentials they stored keep working and can be deleted.`
50080
+ };
50081
+ CASES_METERING_ORGS = {
50082
+ group: "cases-metering-orgs",
50083
+ key: "cases_metering_org_ids",
50084
+ none: "(none listed: no org's case work is metered)",
50085
+ adding: (orgId) => `About to add ${orgId}: each revision of its cases' files and each render that issues files bills one operation, and at its operations quota its case tokens' revisions and its renders are refused.`,
50086
+ removing: (orgId) => `About to remove ${orgId}: its case work stops billing, and the operations gate stops refusing it.`
50087
+ };
49242
50088
  VALID_NOTICE_SEVERITIES = ["critical", "warn", "info"];
49243
50089
  }
49244
50090
  });