@wayai/cli 0.3.133 → 0.3.135

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
@@ -441,11 +441,11 @@ function captureException2(error, context) {
441
441
  Sentry.captureException(error);
442
442
  });
443
443
  }
444
- function addApiBreadcrumb(method, path30) {
444
+ function addApiBreadcrumb(method, path31) {
445
445
  if (!initialized) return;
446
446
  Sentry.addBreadcrumb({
447
447
  category: "http",
448
- message: `${method} ${path30}`,
448
+ message: `${method} ${path31}`,
449
449
  level: "info"
450
450
  });
451
451
  }
@@ -899,8 +899,8 @@ var init_parseUtil = __esm({
899
899
  init_errors();
900
900
  init_en();
901
901
  makeIssue = (params) => {
902
- const { data, path: path30, errorMaps, issueData } = params;
903
- const fullPath = [...path30, ...issueData.path || []];
902
+ const { data, path: path31, errorMaps, issueData } = params;
903
+ const fullPath = [...path31, ...issueData.path || []];
904
904
  const fullIssue = {
905
905
  ...issueData,
906
906
  path: fullPath
@@ -1211,11 +1211,11 @@ var init_types = __esm({
1211
1211
  init_parseUtil();
1212
1212
  init_util();
1213
1213
  ParseInputLazyPath = class {
1214
- constructor(parent, value, path30, key) {
1214
+ constructor(parent, value, path31, key) {
1215
1215
  this._cachedPath = [];
1216
1216
  this.parent = parent;
1217
1217
  this.data = value;
1218
- this._path = path30;
1218
+ this._path = path31;
1219
1219
  this._key = key;
1220
1220
  }
1221
1221
  get path() {
@@ -4628,12 +4628,12 @@ function validateFollowupLinks(followups, label, ctx) {
4628
4628
  const linkTargets = /* @__PURE__ */ new Set();
4629
4629
  followups.forEach((followup, i) => {
4630
4630
  const ref = followup?.after_followup_id;
4631
- const path30 = ["followups", i, "after_followup_id"];
4631
+ const path31 = ["followups", i, "after_followup_id"];
4632
4632
  if (followup?.type !== "inactivity_after_before_event") {
4633
4633
  if (ref !== void 0) {
4634
4634
  ctx.addIssue({
4635
4635
  code: external_exports.ZodIssueCode.custom,
4636
- path: path30,
4636
+ path: path31,
4637
4637
  message: `kanban status ${label}: after_followup_id is only valid on inactivity_after_before_event followups (this one is ${followup?.type})`
4638
4638
  });
4639
4639
  }
@@ -4642,7 +4642,7 @@ function validateFollowupLinks(followups, label, ctx) {
4642
4642
  if (ref === void 0) {
4643
4643
  ctx.addIssue({
4644
4644
  code: external_exports.ZodIssueCode.custom,
4645
- path: path30,
4645
+ path: path31,
4646
4646
  message: `kanban status ${label}: inactivity_after_before_event requires after_followup_id naming the id of a before_event followup in the same status`
4647
4647
  });
4648
4648
  return;
@@ -4652,7 +4652,7 @@ function validateFollowupLinks(followups, label, ctx) {
4652
4652
  if (matches.length > 1) {
4653
4653
  ctx.addIssue({
4654
4654
  code: external_exports.ZodIssueCode.custom,
4655
- path: path30,
4655
+ path: path31,
4656
4656
  message: `kanban status ${label}: after_followup_id "${ref}" matches ${matches.length} followups \u2014 a link must name exactly one`
4657
4657
  });
4658
4658
  return;
@@ -4664,7 +4664,7 @@ function validateFollowupLinks(followups, label, ctx) {
4664
4664
  );
4665
4665
  ctx.addIssue({
4666
4666
  code: external_exports.ZodIssueCode.custom,
4667
- path: path30,
4667
+ path: path31,
4668
4668
  message: hasIdlessBeforeEvent ? `kanban status ${label}: after_followup_id "${ref}" matches no followup \u2014 a link target must declare an explicit id, and this status has before_event followups without one` : `kanban status ${label}: after_followup_id "${ref}" matches no followup in this status`
4669
4669
  });
4670
4670
  return;
@@ -4672,7 +4672,7 @@ function validateFollowupLinks(followups, label, ctx) {
4672
4672
  if (target.type !== "before_event") {
4673
4673
  ctx.addIssue({
4674
4674
  code: external_exports.ZodIssueCode.custom,
4675
- path: path30,
4675
+ path: path31,
4676
4676
  message: `kanban status ${label}: after_followup_id "${ref}" points at a ${target.type} followup \u2014 only before_event followups can anchor a chain`
4677
4677
  });
4678
4678
  }
@@ -4748,12 +4748,12 @@ function typeMatches(typeField, allowed) {
4748
4748
  if (Array.isArray(typeField)) return typeField.every((t) => typeof t === "string" && allowed.has(t));
4749
4749
  return false;
4750
4750
  }
4751
- function validateSchema(schema, path30, errors, opts = {}) {
4751
+ function validateSchema(schema, path31, errors, opts = {}) {
4752
4752
  if (typeof schema === "boolean") return;
4753
4753
  const depth = opts.depth ?? 0;
4754
4754
  if (depth > MAX_SCHEMA_DEPTH) {
4755
4755
  errors.push({
4756
- path: path30 || "<root>",
4756
+ path: path31 || "<root>",
4757
4757
  message: `schema nesting exceeds ${MAX_SCHEMA_DEPTH} levels`,
4758
4758
  suggestion: "Flatten the schema; LLM providers reject deeply nested tool input_schemas."
4759
4759
  });
@@ -4761,7 +4761,7 @@ function validateSchema(schema, path30, errors, opts = {}) {
4761
4761
  }
4762
4762
  if (!isRecord(schema)) {
4763
4763
  errors.push({
4764
- path: path30,
4764
+ path: path31,
4765
4765
  message: `expected object, got ${schema === null ? "null" : typeof schema}`
4766
4766
  });
4767
4767
  return;
@@ -4769,14 +4769,14 @@ function validateSchema(schema, path30, errors, opts = {}) {
4769
4769
  if (opts.isRoot) {
4770
4770
  if ("type" in schema && schema.type !== "object") {
4771
4771
  errors.push({
4772
- path: path30 ? `${path30}.type` : "type",
4772
+ path: path31 ? `${path31}.type` : "type",
4773
4773
  message: `root type must be 'object', got ${JSON.stringify(schema.type)}`,
4774
4774
  suggestion: "Tool parameters at the root must be an object: `{ type: 'object', properties: { ... } }`."
4775
4775
  });
4776
4776
  }
4777
4777
  } else if ("type" in schema && !typeMatches(schema.type, ALLOWED_TYPES)) {
4778
4778
  errors.push({
4779
- path: `${path30}.type`,
4779
+ path: `${path31}.type`,
4780
4780
  message: `type must be one of ${[...ALLOWED_TYPES].join("/")} or an array of those, got ${JSON.stringify(schema.type)}`
4781
4781
  });
4782
4782
  }
@@ -4786,25 +4786,25 @@ function validateSchema(schema, path30, errors, opts = {}) {
4786
4786
  const isPlaceholder = PLACEHOLDER_TOKENS.includes(e);
4787
4787
  const isOutcomePlaceholder = e === "[KANBAN_OUTCOME_VALUES]";
4788
4788
  errors.push({
4789
- path: `${path30}.enum`,
4789
+ path: `${path31}.enum`,
4790
4790
  message: `enum must be a non-empty array of primitives, got string ${JSON.stringify(e)}`,
4791
4791
  suggestion: isOutcomePlaceholder ? "Declare `outcomes` on the hub's terminal kanban status so the platform can render the placeholder into a valid array; with none configured the platform drops the parameter instead." : isPlaceholder ? "Set `operation: 'update_kanban_status'` on the tool and ensure at least one hub.kanban_status has `allowsAgentUpdate: true` so the platform can render the placeholder into a valid array." : 'Wrap the value in an array: `enum: ["value"]`.'
4792
4792
  });
4793
4793
  } else if (!Array.isArray(e)) {
4794
4794
  errors.push({
4795
- path: `${path30}.enum`,
4795
+ path: `${path31}.enum`,
4796
4796
  message: `enum must be a non-empty array of primitives, got ${typeof e}`
4797
4797
  });
4798
4798
  } else if (e.length === 0) {
4799
4799
  errors.push({
4800
- path: `${path30}.enum`,
4800
+ path: `${path31}.enum`,
4801
4801
  message: "enum must not be empty"
4802
4802
  });
4803
4803
  } else {
4804
4804
  for (let i = 0; i < e.length; i++) {
4805
4805
  if (!isPrimitive(e[i])) {
4806
4806
  errors.push({
4807
- path: `${path30}.enum[${i}]`,
4807
+ path: `${path31}.enum[${i}]`,
4808
4808
  message: `enum entry must be a primitive (string/number/boolean/null), got ${typeof e[i]}`
4809
4809
  });
4810
4810
  }
@@ -4814,7 +4814,7 @@ function validateSchema(schema, path30, errors, opts = {}) {
4814
4814
  for (const key of ["exclusiveMinimum", "exclusiveMaximum"]) {
4815
4815
  if (key in schema && typeof schema[key] === "boolean") {
4816
4816
  errors.push({
4817
- path: `${path30}.${key}`,
4817
+ path: `${path31}.${key}`,
4818
4818
  message: `${key} as boolean is draft-04 syntax; draft 2020-12 requires a numeric value`,
4819
4819
  suggestion: `Replace with the numeric bound, e.g. \`${key}: 0\`.`
4820
4820
  });
@@ -4823,45 +4823,45 @@ function validateSchema(schema, path30, errors, opts = {}) {
4823
4823
  if ("properties" in schema) {
4824
4824
  if (!isRecord(schema.properties)) {
4825
4825
  errors.push({
4826
- path: `${path30}.properties`,
4826
+ path: `${path31}.properties`,
4827
4827
  message: `properties must be an object, got ${Array.isArray(schema.properties) ? "array" : typeof schema.properties}`
4828
4828
  });
4829
4829
  } else {
4830
4830
  for (const [propName, propSchema] of Object.entries(schema.properties)) {
4831
- validateSchema(propSchema, `${path30}.properties.${propName}`, errors, { depth: depth + 1 });
4831
+ validateSchema(propSchema, `${path31}.properties.${propName}`, errors, { depth: depth + 1 });
4832
4832
  }
4833
4833
  }
4834
4834
  }
4835
4835
  if (schemaTypeIncludes(schema, "array") && "items" in schema) {
4836
4836
  if (Array.isArray(schema.items)) {
4837
- schema.items.forEach((sub, i) => validateSchema(sub, `${path30}.items[${i}]`, errors, { depth: depth + 1 }));
4837
+ schema.items.forEach((sub, i) => validateSchema(sub, `${path31}.items[${i}]`, errors, { depth: depth + 1 }));
4838
4838
  } else {
4839
- validateSchema(schema.items, `${path30}.items`, errors, { depth: depth + 1 });
4839
+ validateSchema(schema.items, `${path31}.items`, errors, { depth: depth + 1 });
4840
4840
  }
4841
4841
  }
4842
4842
  for (const key of SUBSCHEMA_OBJECT_KEYWORDS) {
4843
4843
  if (key in schema && isRecord(schema[key])) {
4844
- validateSchema(schema[key], `${path30}.${key}`, errors, { depth: depth + 1 });
4844
+ validateSchema(schema[key], `${path31}.${key}`, errors, { depth: depth + 1 });
4845
4845
  }
4846
4846
  }
4847
4847
  for (const key of SUBSCHEMA_LIST_KEYWORDS) {
4848
4848
  const list = schema[key];
4849
4849
  if (Array.isArray(list)) {
4850
- list.forEach((sub, i) => validateSchema(sub, `${path30}.${key}[${i}]`, errors, { depth: depth + 1 }));
4850
+ list.forEach((sub, i) => validateSchema(sub, `${path31}.${key}[${i}]`, errors, { depth: depth + 1 }));
4851
4851
  }
4852
4852
  }
4853
4853
  for (const key of SUBSCHEMA_MAP_KEYWORDS) {
4854
4854
  const map = schema[key];
4855
4855
  if (isRecord(map)) {
4856
4856
  for (const [name, sub] of Object.entries(map)) {
4857
- validateSchema(sub, `${path30}.${key}.${name}`, errors, { depth: depth + 1 });
4857
+ validateSchema(sub, `${path31}.${key}.${name}`, errors, { depth: depth + 1 });
4858
4858
  }
4859
4859
  }
4860
4860
  }
4861
4861
  const reportedPaths = new Set(errors.map((e) => e.path));
4862
4862
  for (const [k, v] of Object.entries(schema)) {
4863
4863
  if (typeof v !== "string") continue;
4864
- const fieldPath = `${path30}.${k}`;
4864
+ const fieldPath = `${path31}.${k}`;
4865
4865
  if (reportedPaths.has(fieldPath)) continue;
4866
4866
  for (const token of PLACEHOLDER_TOKENS) {
4867
4867
  if (v === token) {
@@ -5006,8 +5006,8 @@ function evalInitialStateError(input) {
5006
5006
  const parsed = evalInitialStateEntry.safeParse(entries[i]);
5007
5007
  if (!parsed.success) {
5008
5008
  const issue = parsed.error.issues[0];
5009
- const path30 = issue?.path.join(".") || "?";
5010
- return `initial_state[${i}].${path30} is invalid: ${issue?.message ?? "malformed"}`;
5009
+ const path31 = issue?.path.join(".") || "?";
5010
+ return `initial_state[${i}].${path31} is invalid: ${issue?.message ?? "malformed"}`;
5011
5011
  }
5012
5012
  if (seenSlugs.has(parsed.data.slug)) {
5013
5013
  return `initial_state[${i}].slug "${parsed.data.slug}" is declared more than once`;
@@ -5195,10 +5195,10 @@ function refineHubAsCodeEvals(config, ctx) {
5195
5195
  function refineHubAsCodeEvalAttachments(config, ctx) {
5196
5196
  const cfg = config;
5197
5197
  const referencedHashes = /* @__PURE__ */ new Set();
5198
- const addTurnIssue = (path30, turn, name) => {
5198
+ const addTurnIssue = (path31, turn, name) => {
5199
5199
  const error = evalTurnAttachmentsError(turn);
5200
5200
  if (error) {
5201
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path30, message: `${name}: ${error}` });
5201
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path31, message: `${name}: ${error}` });
5202
5202
  return;
5203
5203
  }
5204
5204
  for (const hash of collectTurnAttachmentHashes(turn)) referencedHashes.add(hash);
@@ -5344,11 +5344,11 @@ function refineHubAsCodeDelegation(config, ctx) {
5344
5344
  }
5345
5345
  }
5346
5346
  if (del.context_boundary === void 0) return;
5347
- const path30 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
5347
+ const path31 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
5348
5348
  if (del.type !== "hub") {
5349
5349
  ctx.addIssue({
5350
5350
  code: external_exports.ZodIssueCode.custom,
5351
- path: path30,
5351
+ path: path31,
5352
5352
  message: `context_boundary applies only to \`type: hub\` delegations (got type "${String(del.type)}")`
5353
5353
  });
5354
5354
  return;
@@ -5356,14 +5356,14 @@ function refineHubAsCodeDelegation(config, ctx) {
5356
5356
  if (!CONTEXT_BOUNDARIES.includes(del.context_boundary)) {
5357
5357
  ctx.addIssue({
5358
5358
  code: external_exports.ZodIssueCode.custom,
5359
- path: path30,
5359
+ path: path31,
5360
5360
  message: `context_boundary must be one of: ${CONTEXT_BOUNDARIES.join(", ")}`
5361
5361
  });
5362
5362
  }
5363
5363
  });
5364
5364
  });
5365
5365
  }
5366
- var uuidSchema, paginationSchema, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, MAX_AUDIO_FILE_BASE64_BYTES, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, SUMMARIZATION_THRESHOLD_MIN, SUMMARIZATION_THRESHOLD_MAX, PREVIOUS_CONVERSATIONS_MAX, previousConversationsCountField, summarizationThresholdField, monitorConfigField, agentIdParam, listAgentsQuery, agentConnectionsQuery, createAgentBody, updateAgentBody, AGENT_PARAMETER_TYPES, AGENT_PARAMETER_NAME_REGEX, agentParameterCreateSchema, MAX_AGENT_PARAMETERS_PER_REQUEST, createAgentParametersBody, SLUG_REGEX, slugSchema, INVISIBLE_NAME_CHARS, MAX_KANBAN_STATUSES, MAX_FOLLOWUPS_PER_STATUS, MAX_LANES, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES, RESERVED_TEMPLATE_DUMP_NAME, kanbanStatusSlugSchema, followupTypeSchema, EVENT_RELATIVE_FOLLOWUP_TYPES, followupTimeUnitSchema, followupIdSchema, SELECTABLE_FOLLOWUP_TYPES, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS, followupSchema, MAX_OUTCOMES_PER_STATUS, kanbanOutcomeSchema, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, laneSchema, lanesArraySchema, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, previewLabelField, createHubBody, updateHubBody, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery, PLACEHOLDER_TOKENS, ALLOWED_TYPES, SUBSCHEMA_OBJECT_KEYWORDS, SUBSCHEMA_LIST_KEYWORDS, SUBSCHEMA_MAP_KEYWORDS, MAX_SCHEMA_DEPTH, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody, variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody, orgTagIdParam, listOrgTagsQuery, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody, resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery, navItemSchema, hubCountResetBody, navItemCountResetBody, typingBody, analyticsHubIdParam, analyticsVariableIdParam, updateVariablePinBody, updateAnalyticsViewBody, NUMERIC_FILTER_OPS, TEXT_FILTER_OPS, CATEGORICAL_FILTER_OPS, VARIABLE_FILTER_OPS, STRUCTURED_QUERY_OPS, STRUCTURED_QUERY_AGGREGATIONS, filterValueSchema, conversationsBody, analyticsConversationIdParam, messagesQuery, conversationDetailDataQuery, analyticsDataBody, structuredQueryBody, analyticsSqlBody, analyticsSqlTable, analyticsSqlSchemaQuery, EVAL_PACING_PRESET_NAMES, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_MAX_RUNS_PER_SCENARIO, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS, ISO_UTC_RE, paginationSchema2, evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, evalDateContextSchema, EVAL_FIXTURE_NAME_MAX_LENGTH, evalFixtureOverrideSchema, runSessionQuery, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, EVAL_INITIAL_STATE_SCOPES, MAX_INITIAL_STATE_ENTRIES, evalInitialStateEntry, createEvalBody, updateEvalBody, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, EVAL_MAX_SELECTED_SCENARIOS, evalScenarioSelectionEntrySchema, evalScenarioSelectionSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, EVAL_ATTACHMENT_HASH_REGEX, evalAttachmentRef, turnMayCarryAttachments, ATTACHMENTS_USER_ONLY_MESSAGE, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, fixtureField, createJourneyBody, updateJourneyBody, evalSessionConfigResponseSchema, evalSessionResponseSchema, seedReleaseStatusSchema, EVAL_SESSION_NOT_QUIESCENT, getConversationsQuery, getMessagesQuery, appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse, updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, activityQuery, deletionModeSchema, deletionRequestBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, deleteUserConversationsResponse, sendMessageBody, listConversationsQuery, flagSourceSchema, getConversationsResponse, getConversationDetailParams, getConversationDetailQuery, getConversationDetailResponse, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody, copilotSuggestBody, copilotSuggestResponse, CONSULT_THREAD_STATUSES, consultThreadStatus, CONSULT_THREAD_TITLE_MAX, consultThreadTitle, consultThreadSummary, listConsultThreadsQuery, listConsultThreadsResponse, createConsultThreadBody, createConsultThreadResponse, consultThreadIdParam, updateConsultThreadBody, updateConsultThreadResponse, CONSULT_AWAIT_TIMEOUT_MS, billingOrgIdParam, subscriptionItemParams, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, updateBillingCurrencyBody, invoicesQuery, downloadBody, uploadQuery, signUrlBody, outboundSchemaQuery, templateIdParam, listTemplatesQuery, deleteTemplateQuery, templateStatusQuery, createTemplateBody, updateTemplateBody, submitTemplateBody, testTemplateBody, contactIdParam, listContactsQuery, createContactBody, updateContactBody, listIdParam, listListsQuery, listListContactsQuery, createListBody, updateListBody, addListContactsBody, removeListContactsBody, scheduleIdParam, listSchedulesQuery, listExecutionsQuery, createScheduleBody, updateScheduleBody, MAX_RESOURCE_FILE_SIZE, MAX_10MB_BASE64_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_CARRIERS, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES, MAX_RESOURCE_ENCODED_BYTES, MAX_HUB_AS_CODE_RESOURCES, MAX_HUB_AS_CODE_RESOURCE_FILES, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES, MAX_CI_CONFIG_BODY_BYTES, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, boundedHubAsCodeResourcesSchema, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, dataExplorerDebugDoType, DEBUG_READ_MAX_LIMIT, DEBUG_READ_DEFAULT_LIMIT, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, debugHubConvParam, debugMessageIdQuery, sandboxEgressPolicy, SANDBOX_EXEC_MAX_CMD_LENGTH, SANDBOX_EXEC_MAX_ALLOWLIST, SANDBOX_EXEC_MAX_TIMEOUT_MS, adminSandboxExecBody, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, passwordLoginBody, browserParams, browserFoldersQuery, browserFilesQuery, stateOperationBody, conversationListResourcesQuery, conversationReadResourceQuery, listPendingSchedulesQuery, listHubAggregateSchedulesQuery, reportSourceSchema, intakeReportSourceSchema, reportClassificationSchema, reportStatusSchema, reportLocaleSchema, reportMessageAuthorRoleSchema, reportMessageSchema, sentryRefStatusSchema, createReportBody, editReportBody, reporterReportSummarySchema, reporterListResponseSchema, getReportResponseSchema, reporterTransitionResponseSchema, contestReportBody, reporterListQuery, listReportsQuery, GITHUB_ISSUE_URL_REGEX, githubIssueUrlSchema, transitionReportBody, groupReportsBody, holdReportBody, clickhouseReadyResponse, bootstrapQuery, requestSnapshotChunkMessage, MAX_NAME_LENGTH, MAX_VALUE_LENGTH, MAX_TAGS, MAX_TAG_LENGTH, MAX_SCOPE_HUBS, MAX_SCOPE_TAGS, vaultSecretScopeSchema, vaultCreateBody, vaultUpdateBody, PERMISSIONS, MAX_NAME_LENGTH2, MAX_HUBS_PER_GRANT, MAX_HUB_TAGS_PER_GRANT, MAX_GRANTS, permissionEnum, grantScopeSchema, grantSchema, createTokenBody, tokenOrgIdParam, tokenGrantScopeSchema, tokenGrantSchema, tokenMetadataSchema, listTokensResponse, createTokenResponse, orgTokenSummarySchema, listOrgTokensResponse, invitePreviewQuery, invitePreviewResponse, jsonSchemaSchema, hubUserIdentity, stateValueEntry, getHubUserContextResponse, updateHubUserBody, updateHubUserResponse, unlockHubUserNameResponse, stateResetParams, stateResetResponse, hubAlertsParam, hubAlertSeverity, hubAlert, hubAlertsListResponse, noticeSeveritySchema, noticeStatusSchema, NOTICE_SCOPE_REGEX, noticeScopeSchema, noticeLinkSchema, createNoticeBody, updateNoticeBody, listNoticesQuery, noticeIdParamSchema, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam;
5366
+ var uuidSchema, paginationSchema, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, MAX_AUDIO_FILE_BASE64_BYTES, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, SUMMARIZATION_THRESHOLD_MIN, SUMMARIZATION_THRESHOLD_MAX, PREVIOUS_CONVERSATIONS_MAX, previousConversationsCountField, summarizationThresholdField, monitorConfigField, agentIdParam, listAgentsQuery, agentConnectionsQuery, createAgentBody, updateAgentBody, AGENT_PARAMETER_TYPES, AGENT_PARAMETER_NAME_REGEX, agentParameterCreateSchema, MAX_AGENT_PARAMETERS_PER_REQUEST, createAgentParametersBody, SLUG_REGEX, slugSchema, INVISIBLE_NAME_CHARS, MAX_KANBAN_STATUSES, MAX_FOLLOWUPS_PER_STATUS, MAX_LANES, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES, RESERVED_TEMPLATE_DUMP_NAME, kanbanStatusSlugSchema, followupTypeSchema, EVENT_RELATIVE_FOLLOWUP_TYPES, followupTimeUnitSchema, followupIdSchema, SELECTABLE_FOLLOWUP_TYPES, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS, followupSchema, MAX_OUTCOMES_PER_STATUS, kanbanOutcomeSchema, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, laneSchema, lanesArraySchema, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, MAX_EVAL_RETENTION_DAYS, previewLabelField, createHubBody, updateHubBody, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery, PLACEHOLDER_TOKENS, ALLOWED_TYPES, SUBSCHEMA_OBJECT_KEYWORDS, SUBSCHEMA_LIST_KEYWORDS, SUBSCHEMA_MAP_KEYWORDS, MAX_SCHEMA_DEPTH, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody, variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody, orgTagIdParam, listOrgTagsQuery, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody, resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery, navItemSchema, hubCountResetBody, navItemCountResetBody, typingBody, analyticsHubIdParam, analyticsVariableIdParam, updateVariablePinBody, updateAnalyticsViewBody, NUMERIC_FILTER_OPS, TEXT_FILTER_OPS, CATEGORICAL_FILTER_OPS, VARIABLE_FILTER_OPS, STRUCTURED_QUERY_OPS, STRUCTURED_QUERY_AGGREGATIONS, filterValueSchema, conversationsBody, analyticsConversationIdParam, messagesQuery, conversationDetailDataQuery, analyticsDataBody, structuredQueryBody, analyticsSqlBody, analyticsSqlTable, analyticsSqlSchemaQuery, EVAL_PACING_PRESET_NAMES, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_MAX_RUNS_PER_SCENARIO, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS, ISO_UTC_RE, paginationSchema2, evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, evalDateContextSchema, EVAL_FIXTURE_NAME_MAX_LENGTH, evalFixtureOverrideSchema, runSessionQuery, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, EVAL_INITIAL_STATE_SCOPES, MAX_INITIAL_STATE_ENTRIES, evalInitialStateEntry, createEvalBody, updateEvalBody, EVAL_LIST_MAX_LIMIT, evalListLimit, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, EVAL_MAX_SELECTED_SCENARIOS, evalScenarioSelectionEntrySchema, evalScenarioSelectionSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, EVAL_ATTACHMENT_HASH_REGEX, evalAttachmentRef, turnMayCarryAttachments, ATTACHMENTS_USER_ONLY_MESSAGE, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, fixtureField, createJourneyBody, updateJourneyBody, evalSessionConfigResponseSchema, evalSessionResponseSchema, evalSessionListConfigSchema, evalSessionListItemSchema, seedReleaseStatusSchema, EVAL_SESSION_NOT_QUIESCENT, getConversationsQuery, getMessagesQuery, appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse, updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, activityQuery, deletionModeSchema, deletionRequestBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, deleteUserConversationsResponse, sendMessageBody, listConversationsQuery, flagSourceSchema, getConversationsResponse, getConversationDetailParams, getConversationDetailQuery, getConversationDetailResponse, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody, copilotSuggestBody, copilotSuggestResponse, CONSULT_THREAD_STATUSES, consultThreadStatus, CONSULT_THREAD_TITLE_MAX, consultThreadTitle, consultThreadSummary, listConsultThreadsQuery, listConsultThreadsResponse, createConsultThreadBody, createConsultThreadResponse, consultThreadIdParam, updateConsultThreadBody, updateConsultThreadResponse, CONSULT_AWAIT_TIMEOUT_MS, billingOrgIdParam, subscriptionItemParams, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, updateBillingCurrencyBody, invoicesQuery, planKeySchema, billingStatusSchema, REKOR_ENTITLEMENT_CONTRACT_VERSION, entitlementProjectionSchema, rekorEntitlementRefreshMessageSchema, downloadBody, uploadQuery, signUrlBody, outboundSchemaQuery, templateIdParam, listTemplatesQuery, deleteTemplateQuery, templateStatusQuery, createTemplateBody, updateTemplateBody, submitTemplateBody, testTemplateBody, contactIdParam, listContactsQuery, createContactBody, updateContactBody, listIdParam, listListsQuery, listListContactsQuery, createListBody, updateListBody, addListContactsBody, removeListContactsBody, scheduleIdParam, listSchedulesQuery, listExecutionsQuery, createScheduleBody, updateScheduleBody, MAX_RESOURCE_FILE_SIZE, MAX_10MB_BASE64_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_CARRIERS, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES, MAX_RESOURCE_ENCODED_BYTES, MAX_HUB_AS_CODE_RESOURCES, MAX_HUB_AS_CODE_RESOURCE_FILES, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES, MAX_CI_CONFIG_BODY_BYTES, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, boundedHubAsCodeResourcesSchema, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, dataExplorerDebugDoType, DEBUG_READ_MAX_LIMIT, DEBUG_READ_DEFAULT_LIMIT, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, debugHubConvParam, debugMessageIdQuery, sandboxEgressPolicy, SANDBOX_EXEC_MAX_CMD_LENGTH, SANDBOX_EXEC_MAX_ALLOWLIST, SANDBOX_EXEC_MAX_TIMEOUT_MS, adminSandboxExecBody, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, passwordLoginBody, browserParams, browserFoldersQuery, browserFilesQuery, stateOperationBody, conversationListResourcesQuery, conversationReadResourceQuery, listPendingSchedulesQuery, listHubAggregateSchedulesQuery, reportSourceSchema, intakeReportSourceSchema, reportClassificationSchema, reportStatusSchema, reportLocaleSchema, reportMessageAuthorRoleSchema, reportMessageSchema, sentryRefStatusSchema, createReportBody, editReportBody, reporterReportSummarySchema, reporterListResponseSchema, getReportResponseSchema, reporterTransitionResponseSchema, contestReportBody, reporterListQuery, listReportsQuery, GITHUB_ISSUE_URL_REGEX, githubIssueUrlSchema, transitionReportBody, groupReportsBody, holdReportBody, clickhouseReadyResponse, bootstrapQuery, requestSnapshotChunkMessage, MAX_NAME_LENGTH, MAX_VALUE_LENGTH, MAX_TAGS, MAX_TAG_LENGTH, MAX_SCOPE_HUBS, MAX_SCOPE_TAGS, vaultSecretScopeSchema, vaultCreateBody, vaultUpdateBody, PERMISSIONS, MAX_NAME_LENGTH2, MAX_HUBS_PER_GRANT, MAX_HUB_TAGS_PER_GRANT, MAX_GRANTS, permissionEnum, grantScopeSchema, grantSchema, createTokenBody, tokenOrgIdParam, tokenGrantScopeSchema, tokenGrantSchema, tokenMetadataSchema, listTokensResponse, createTokenResponse, orgTokenSummarySchema, listOrgTokensResponse, invitePreviewQuery, invitePreviewResponse, jsonSchemaSchema, hubUserIdentity, stateValueEntry, getHubUserContextResponse, updateHubUserBody, updateHubUserResponse, unlockHubUserNameResponse, stateResetParams, stateResetResponse, hubAlertsParam, hubAlertSeverity, hubAlert, hubAlertsListResponse, noticeSeveritySchema, noticeStatusSchema, NOTICE_SCOPE_REGEX, noticeScopeSchema, noticeLinkSchema, createNoticeBody, updateNoticeBody, listNoticesQuery, noticeIdParamSchema, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam, REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, DATA_PROXY_MOUNT, DATA_PROXY_PREFIX, REKOR_V1_PREFIX, DATA_PROXY_ORG_QUERY_PARAM, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS;
5367
5367
  var init_contracts = __esm({
5368
5368
  "../../packages/core/dist/contracts/index.js"() {
5369
5369
  "use strict";
@@ -5415,6 +5415,7 @@ var init_contracts = __esm({
5415
5415
  init_zod();
5416
5416
  init_zod();
5417
5417
  init_zod();
5418
+ init_zod();
5418
5419
  uuidSchema = external_exports.string().uuid();
5419
5420
  paginationSchema = external_exports.object({
5420
5421
  limit: external_exports.coerce.number().int().min(1).max(100).default(50),
@@ -5909,6 +5910,7 @@ var init_contracts = __esm({
5909
5910
  hubSchemaQuery = external_exports.object({ hub_id: uuidSchema });
5910
5911
  PREVIEW_LABEL_MAX_LENGTH = 60;
5911
5912
  MAX_ENDED_INDEX_RETENTION_DAYS = 730;
5913
+ MAX_EVAL_RETENTION_DAYS = 3650;
5912
5914
  previewLabelField = external_exports.string().max(PREVIEW_LABEL_MAX_LENGTH).optional().nullable().transform((v) => {
5913
5915
  if (v == null) return null;
5914
5916
  const trimmed = v.trim();
@@ -5944,6 +5946,10 @@ var init_contracts = __esm({
5944
5946
  // the cleanup cron reaps its index row. Absent → DEFAULT_ENDED_INDEX_RETENTION_DAYS
5945
5947
  // (365). Re-clamped to the effective storage retention at reap time.
5946
5948
  ended_index_retention_days: external_exports.number().int().min(1).max(MAX_ENDED_INDEX_RETENTION_DAYS).optional(),
5949
+ // Per-hub eval-session retention window (days). null CLEARS the override (back to
5950
+ // the platform default); 0 disables retention for this hub (keep sessions forever).
5951
+ // Nullable — unlike the fields above, "unset" is a meaningful, settable state.
5952
+ eval_retention_days: external_exports.number().int().min(0).max(MAX_EVAL_RETENTION_DAYS).nullable().optional(),
5947
5953
  // Channel contact access control. Enum-validated explicitly (not via passthrough)
5948
5954
  // so `language`/`access_approval_role` can't reach the DB with an invalid value.
5949
5955
  language: external_exports.enum(["en", "pt", "es"]).optional(),
@@ -6524,7 +6530,6 @@ var init_contracts = __esm({
6524
6530
  agent_id: uuidSchema,
6525
6531
  priority: external_exports.number().optional(),
6526
6532
  use_native_integration: external_exports.boolean().optional(),
6527
- include_structure_in_prompt: external_exports.boolean().optional(),
6528
6533
  write_enabled: external_exports.boolean().optional()
6529
6534
  });
6530
6535
  updateAgentResourceBody = external_exports.object({
@@ -6532,7 +6537,6 @@ var init_contracts = __esm({
6532
6537
  resource_id: uuidSchema,
6533
6538
  agent_id: uuidSchema,
6534
6539
  use_native_integration: external_exports.boolean().optional(),
6535
- include_structure_in_prompt: external_exports.boolean().optional(),
6536
6540
  enabled: external_exports.boolean().optional(),
6537
6541
  priority: external_exports.number().optional(),
6538
6542
  write_enabled: external_exports.boolean().optional()
@@ -6716,12 +6720,16 @@ var init_contracts = __esm({
6716
6720
  updateEvalBody = external_exports.object({
6717
6721
  eval: external_exports.record(external_exports.unknown())
6718
6722
  }).superRefine(refineEvalMessageTextRole).superRefine(refineEvalAttachments).superRefine(refineEvalInitialState);
6723
+ EVAL_LIST_MAX_LIMIT = 1e3;
6724
+ evalListLimit = external_exports.string().regex(/^\d+$/).refine((v) => Number(v) <= EVAL_LIST_MAX_LIMIT, {
6725
+ message: `limit must be ${EVAL_LIST_MAX_LIMIT} or less`
6726
+ }).optional();
6719
6727
  getEvalsQuery = external_exports.object({
6720
6728
  hub_id: external_exports.string().uuid(),
6721
6729
  agent_id: external_exports.string().uuid().optional(),
6722
6730
  enabled: external_exports.string().regex(/^(true|false)$/).optional(),
6723
6731
  search: external_exports.string().optional(),
6724
- limit: external_exports.string().regex(/^\d+$/).optional(),
6732
+ limit: evalListLimit,
6725
6733
  offset: external_exports.string().regex(/^\d+$/).optional()
6726
6734
  });
6727
6735
  toggleEvalBody = external_exports.object({
@@ -6776,7 +6784,7 @@ var init_contracts = __esm({
6776
6784
  hub_id: external_exports.string().uuid(),
6777
6785
  status: external_exports.string().optional(),
6778
6786
  search: external_exports.string().optional(),
6779
- limit: external_exports.string().regex(/^\d+$/).optional(),
6787
+ limit: evalListLimit,
6780
6788
  offset: external_exports.string().regex(/^\d+$/).optional()
6781
6789
  });
6782
6790
  getSessionResultsQuery = external_exports.object({
@@ -6955,6 +6963,15 @@ var init_contracts = __esm({
6955
6963
  /** Launch-time snapshot. */
6956
6964
  session_config: evalSessionConfigResponseSchema.optional()
6957
6965
  }).passthrough();
6966
+ evalSessionListConfigSchema = external_exports.object({
6967
+ agent: external_exports.object({
6968
+ agent_id: external_exports.string().nullable().optional(),
6969
+ agent_name: external_exports.string().nullable().optional(),
6970
+ agent_role: external_exports.string().nullable().optional()
6971
+ }).optional(),
6972
+ scenario_set_id: external_exports.string().optional().catch(void 0)
6973
+ });
6974
+ evalSessionListItemSchema = evalSessionResponseSchema.omit({ session_config: true }).extend({ session_config: evalSessionListConfigSchema.optional() }).passthrough();
6958
6975
  seedReleaseStatusSchema = external_exports.enum(["not_applicable", "pending", "releasing"]);
6959
6976
  EVAL_SESSION_NOT_QUIESCENT = "session_not_quiescent";
6960
6977
  getConversationsQuery = external_exports.object({
@@ -7500,6 +7517,42 @@ var init_contracts = __esm({
7500
7517
  invoicesQuery = external_exports.object({
7501
7518
  limit: external_exports.string().regex(/^\d+$/).optional()
7502
7519
  });
7520
+ planKeySchema = external_exports.enum(["free", "solo", "team"]);
7521
+ billingStatusSchema = external_exports.enum(["active", "past_due", "cancelled"]);
7522
+ REKOR_ENTITLEMENT_CONTRACT_VERSION = 1;
7523
+ entitlementProjectionSchema = external_exports.object({
7524
+ contract_version: external_exports.literal(REKOR_ENTITLEMENT_CONTRACT_VERSION),
7525
+ /**
7526
+ * Monotonic per org, WayAI-assigned. An ordering guard for concurrent WayAI
7527
+ * writers (a plan change racing a token mint) — NOT a cross-repo CAS. Gaps are
7528
+ * expected: a version is allocated per push attempt, and an idempotency skip
7529
+ * (§2.4) burns none while a failed KV put burns one.
7530
+ */
7531
+ projection_version: external_exports.number().int().nonnegative(),
7532
+ /** Diagnostic only — never gates. Freshness is `window_resets_at`'s job (§2.2). */
7533
+ written_at: external_exports.string().datetime(),
7534
+ /** The WayAI org UUID. The `account_id` spelling is Rekor's documented carve-out. */
7535
+ account_id: external_exports.string().uuid(),
7536
+ /** The EFFECTIVE plan, not the subscribed one (§2.2.1). Never gates. */
7537
+ plan_key: planKeySchema,
7538
+ /** Informational only (§2.2.1). `cancelled` spelling matches `BillingRecord`. */
7539
+ billing_status: billingStatusSchema,
7540
+ /** Tenths, matching Rekor's meter granularity (write 10, point-read 1, list/SQL 10). */
7541
+ ops_tenths_included: external_exports.number().int().nonnegative(),
7542
+ max_records: external_exports.number().int().nonnegative(),
7543
+ /** Its own field, no longer derived from `max_records` (§2.2). */
7544
+ import_rows_included: external_exports.number().int().nonnegative(),
7545
+ /** REQUIRED — absence is malformed, never coerced to `false` (§2.2.2). */
7546
+ production_bases: external_exports.boolean(),
7547
+ /** Opaque to Rekor; compared for equality only, to reset `usage:` counters (§2.3). */
7548
+ window_key: external_exports.string().min(1),
7549
+ /** The sole staleness authority (§2.3). Never triggers a counter reset. */
7550
+ window_resets_at: external_exports.string().datetime()
7551
+ }).strict();
7552
+ rekorEntitlementRefreshMessageSchema = external_exports.object({
7553
+ org_id: external_exports.string().uuid(),
7554
+ reason: external_exports.enum(["window_elapsed", "projection_missing", "projection_malformed"])
7555
+ });
7503
7556
  downloadBody = external_exports.object({
7504
7557
  type: external_exports.enum(["workspace", "agent_instructions"]),
7505
7558
  agent_id: external_exports.string().uuid().optional(),
@@ -7941,7 +7994,14 @@ var init_contracts = __esm({
7941
7994
  * disable|enable` flips this. The DO's `updatePlatformConfig` allowlist already
7942
7995
  * accepts it; this exposes it on the route.
7943
7996
  */
7944
- harness_enabled: external_exports.number().int().min(0).max(1).optional()
7997
+ harness_enabled: external_exports.number().int().min(0).max(1).optional(),
7998
+ /**
7999
+ * Default eval-session retention window in days, used by every hub that sets no
8000
+ * `eval_retention_days` override. `0` disables eval retention platform-wide.
8001
+ * NOT NULL in the DDL, so the field is non-nullable here — clearing is not a
8002
+ * state; setting 0 is.
8003
+ */
8004
+ default_eval_retention_days: external_exports.number().int().min(0).max(MAX_EVAL_RETENTION_DAYS).optional()
7945
8005
  }).strip().refine(
7946
8006
  (data) => Object.keys(data).length > 0,
7947
8007
  { message: "No fields to update" }
@@ -7985,7 +8045,14 @@ var init_contracts = __esm({
7985
8045
  messages_per_unit: external_exports.number().int().min(1, "messages_per_unit must be a positive integer").optional(),
7986
8046
  seats_per_unit: external_exports.number().int().min(1, "seats_per_unit must be a positive integer").optional(),
7987
8047
  seats_scaling: external_exports.enum(["fixed", "per_quantity"]).optional(),
7988
- is_active: external_exports.boolean().optional()
8048
+ is_active: external_exports.boolean().optional(),
8049
+ // Rekor entitlement allowances (rekor-platform-contracts §2.2). Editable here for the
8050
+ // same reason `messages_per_unit` is: otherwise the only way to change an allowance in
8051
+ // production is a code deploy plus a seed-version bump.
8052
+ rekor_ops_tenths_included: external_exports.number().int().min(0).optional(),
8053
+ rekor_max_records: external_exports.number().int().min(0).optional(),
8054
+ rekor_import_rows_included: external_exports.number().int().min(0).optional(),
8055
+ rekor_production_bases: external_exports.number().int().min(0).max(1).optional()
7989
8056
  }).strip().refine(
7990
8057
  (data) => Object.keys(data).length > 0,
7991
8058
  { message: "No fields to update" }
@@ -8596,6 +8663,34 @@ var init_contracts = __esm({
8596
8663
  adminSkillNameParam = external_exports.object({
8597
8664
  name: external_exports.string().regex(ADMIN_SKILL_NAME_REGEX, "invalid skill name")
8598
8665
  });
8666
+ REKOR_ACTOR_TYPE_HEADER = "X-Rekor-Actor-Type";
8667
+ REKOR_ACTOR_ID_HEADER = "X-Rekor-Actor-Id";
8668
+ REKOR_ACTOR_LABEL_HEADER = "X-Rekor-Actor-Label";
8669
+ REKOR_ACTOR_ORG_HEADER = "X-Rekor-Actor-Org";
8670
+ REKOR_ACTOR_ADMIN_HEADER = "X-Rekor-Actor-Admin";
8671
+ REKOR_CLIENT_HEADER = "X-Rekor-Client";
8672
+ REKOR_TOOL_ID_HEADER = "X-Rekor-Tool-Id";
8673
+ REKOR_CLIENTS = ["api", "cli", "mcp"];
8674
+ rekorClientSchema = external_exports.enum(REKOR_CLIENTS);
8675
+ MAX_REKOR_TOOL_ID_LENGTH = 128;
8676
+ rekorToolIdSchema = external_exports.string().trim().min(1).max(MAX_REKOR_TOOL_ID_LENGTH);
8677
+ DATA_PROXY_MOUNT = "/data";
8678
+ DATA_PROXY_PREFIX = `/api${DATA_PROXY_MOUNT}`;
8679
+ REKOR_V1_PREFIX = "/v1";
8680
+ DATA_PROXY_ORG_QUERY_PARAM = "org_id";
8681
+ dataProxyQuery = external_exports.object({
8682
+ [DATA_PROXY_ORG_QUERY_PARAM]: external_exports.string().uuid().optional()
8683
+ });
8684
+ rekorAttestation = external_exports.object({
8685
+ [REKOR_ACTOR_TYPE_HEADER]: external_exports.enum(["user", "token"]),
8686
+ [REKOR_ACTOR_ID_HEADER]: external_exports.string().min(1),
8687
+ [REKOR_ACTOR_LABEL_HEADER]: external_exports.string(),
8688
+ [REKOR_ACTOR_ORG_HEADER]: external_exports.string().uuid(),
8689
+ [REKOR_ACTOR_ADMIN_HEADER]: external_exports.enum(["0", "1"]),
8690
+ [REKOR_CLIENT_HEADER]: rekorClientSchema,
8691
+ [REKOR_TOOL_ID_HEADER]: rekorToolIdSchema.optional()
8692
+ });
8693
+ REQUIRED_REKOR_ATTESTATION_HEADERS = Object.entries(rekorAttestation.shape).filter(([, field]) => !field.isOptional()).map(([header]) => header);
8599
8694
  }
8600
8695
  });
8601
8696
 
@@ -8603,7 +8698,9 @@ var init_contracts = __esm({
8603
8698
  var api_client_exports = {};
8604
8699
  __export(api_client_exports, {
8605
8700
  ApiClient: () => ApiClient,
8606
- ApiError: () => ApiError
8701
+ ApiError: () => ApiError,
8702
+ dataErrorMessage: () => dataErrorMessage,
8703
+ toDataProxyPath: () => toDataProxyPath
8607
8704
  });
8608
8705
  function isRetryableErrorBody(body) {
8609
8706
  try {
@@ -8613,6 +8710,26 @@ function isRetryableErrorBody(body) {
8613
8710
  return false;
8614
8711
  }
8615
8712
  }
8713
+ function toDataProxyPath(v1Path) {
8714
+ if (!v1Path.startsWith(`${REKOR_V1_PREFIX}/`)) {
8715
+ throw new Error(`Data path must start with ${REKOR_V1_PREFIX}/: ${v1Path}`);
8716
+ }
8717
+ return `${DATA_PROXY_PREFIX}${v1Path.slice(REKOR_V1_PREFIX.length)}`;
8718
+ }
8719
+ function dataErrorMessage(err) {
8720
+ if (!(err instanceof ApiError)) return null;
8721
+ let parsed;
8722
+ try {
8723
+ parsed = JSON.parse(err.body);
8724
+ } catch {
8725
+ return null;
8726
+ }
8727
+ if (err.status === 404 && err.path.startsWith(DATA_PROXY_PREFIX) && typeof parsed?.error === "string") {
8728
+ return "The Data surface is not available on this backend. Update the CLI, or point it at a backend that serves it.";
8729
+ }
8730
+ const message = parsed?.error?.message;
8731
+ return typeof message === "string" && message ? message : null;
8732
+ }
8616
8733
  var RETRYABLE_BACKOFF_MS, delay, ApiError, ApiClient;
8617
8734
  var init_api_client = __esm({
8618
8735
  "src/lib/api-client.ts"() {
@@ -8625,12 +8742,19 @@ var init_api_client = __esm({
8625
8742
  ApiError = class extends Error {
8626
8743
  status;
8627
8744
  body;
8628
- constructor(method, path30, status, body) {
8745
+ /**
8746
+ * The request path that failed. Retained because a body alone cannot say
8747
+ * WHICH surface answered: WayAI and the Data surface both emit 404s, and
8748
+ * telling them apart by body shape misreads one for the other.
8749
+ */
8750
+ path;
8751
+ constructor(method, path31, status, body) {
8629
8752
  const safeBody = maskSecretsInMessage(body);
8630
- super(`API request failed: ${method} ${path30} (${status}): ${safeBody}`);
8753
+ super(`API request failed: ${method} ${path31} (${status}): ${safeBody}`);
8631
8754
  this.name = "ApiError";
8632
8755
  this.status = status;
8633
8756
  this.body = safeBody;
8757
+ this.path = path31;
8634
8758
  }
8635
8759
  /** True when the status code is a 4xx client error (expected user-facing condition, not a bug). */
8636
8760
  get isExpected() {
@@ -8726,8 +8850,8 @@ var init_api_client = __esm({
8726
8850
  ...opts?.check && { check: true }
8727
8851
  });
8728
8852
  }
8729
- async lookup(path30, opts) {
8730
- const params = new URLSearchParams({ path: path30 });
8853
+ async lookup(path31, opts) {
8854
+ const params = new URLSearchParams({ path: path31 });
8731
8855
  if (opts?.organizationId) params.set("organization_id", opts.organizationId);
8732
8856
  return this.request("GET", `/api/ci/lookup?${params.toString()}`);
8733
8857
  }
@@ -9148,9 +9272,9 @@ var init_api_client = __esm({
9148
9272
  * sandbox for this conversation, or the blob was purged).
9149
9273
  */
9150
9274
  async downloadArchiveSandboxFs(hubId, conversationId) {
9151
- const path30 = `/api/archive/${encodeURIComponent(hubId)}/conversations/${encodeURIComponent(conversationId)}/sandbox`;
9152
- addApiBreadcrumb("GET", path30);
9153
- const url = `${this.apiUrl}${path30}`;
9275
+ const path31 = `/api/archive/${encodeURIComponent(hubId)}/conversations/${encodeURIComponent(conversationId)}/sandbox`;
9276
+ addApiBreadcrumb("GET", path31);
9277
+ const url = `${this.apiUrl}${path31}`;
9154
9278
  let response = await this.send(url, "GET");
9155
9279
  if (response.status === 401 && this.onUnauthorized) {
9156
9280
  let refreshed;
@@ -9164,7 +9288,7 @@ var init_api_client = __esm({
9164
9288
  }
9165
9289
  }
9166
9290
  if (!response.ok) {
9167
- throw new ApiError("GET", path30, response.status, await response.text());
9291
+ throw new ApiError("GET", path31, response.status, await response.text());
9168
9292
  }
9169
9293
  return new Uint8Array(await response.arrayBuffer());
9170
9294
  }
@@ -9204,9 +9328,9 @@ var init_api_client = __esm({
9204
9328
  `/api/admin/data-explorer/debug/observability/${encodeURIComponent(hubId)}/conversations/${encodeURIComponent(conversationId)}${qs}`
9205
9329
  );
9206
9330
  }
9207
- async request(method, path30, body) {
9208
- addApiBreadcrumb(method, path30);
9209
- const url = `${this.apiUrl}${path30}`;
9331
+ async request(method, path31, body) {
9332
+ addApiBreadcrumb(method, path31);
9333
+ const url = `${this.apiUrl}${path31}`;
9210
9334
  let refreshedOn401 = false;
9211
9335
  for (let retry = 0; ; retry++) {
9212
9336
  let response = await this.send(url, method, body);
@@ -9223,23 +9347,65 @@ var init_api_client = __esm({
9223
9347
  }
9224
9348
  }
9225
9349
  if (response.ok) {
9226
- return response.json();
9350
+ const okBody = await response.text();
9351
+ return okBody ? JSON.parse(okBody) : void 0;
9227
9352
  }
9228
9353
  const errorBody = await response.text();
9229
9354
  if (method === "GET" && retry < RETRYABLE_BACKOFF_MS.length && isRetryableErrorBody(errorBody)) {
9230
9355
  await delay(RETRYABLE_BACKOFF_MS[retry]);
9231
9356
  continue;
9232
9357
  }
9233
- throw new ApiError(method, path30, response.status, errorBody);
9358
+ throw new ApiError(method, path31, response.status, errorBody);
9234
9359
  }
9235
9360
  }
9361
+ /**
9362
+ * One request against the Data (`/v1`) surface — bases, records, files and the
9363
+ * rest of the Bases namespace.
9364
+ *
9365
+ * `v1Path` is the Data backend's OWN path, verbatim (`/v1/bases`), so every
9366
+ * ported command spells the path the Data Worker documents; only
9367
+ * `toDataProxyPath` knows how WayAI mounts that surface. Identity is the
9368
+ * caller's ordinary WayAI session — there is one keyring login, and the
9369
+ * backend attests the org over its service binding rather than forwarding a
9370
+ * credential (docs/reference/rekor-platform-contracts.md §1).
9371
+ *
9372
+ * Returns the surface's `{ data, meta }` envelope rather than unwrapping, so
9373
+ * cursor-paginated lists can follow `meta.has_more`. A failure throws the same
9374
+ * `ApiError` as every other CLI request, so the top-level handler is unchanged;
9375
+ * `dataErrorMessage` recovers the envelope's own message for display.
9376
+ *
9377
+ * `orgId` is the caller's org SELECTOR (the `--org` flag, else the repo's
9378
+ * `.wayai.yaml`), not an authorization claim: the backend validates it against
9379
+ * the caller's grants and attests only the validated result. A multi-org user
9380
+ * needs it to pick; a single-org user can omit it.
9381
+ *
9382
+ * It travels as the proxy's own query param, whose name is imported rather
9383
+ * than spelled — the handler validates it and strips it before forwarding,
9384
+ * since it is WayAI's selector and not an input Rekor sees.
9385
+ */
9386
+ async dataRequest(method, v1Path, body, orgId) {
9387
+ const separator = v1Path.includes("?") ? "&" : "?";
9388
+ const orgQuery = orgId ? `${separator}${DATA_PROXY_ORG_QUERY_PARAM}=${encodeURIComponent(orgId)}` : "";
9389
+ const envelope = await this.request(
9390
+ method,
9391
+ `${toDataProxyPath(v1Path)}${orgQuery}`,
9392
+ body
9393
+ );
9394
+ return envelope ?? {};
9395
+ }
9236
9396
  /** Issue a single authenticated request with the client's current token. */
9237
9397
  send(url, method, body) {
9238
9398
  return fetch(url, {
9239
9399
  method,
9240
9400
  headers: {
9241
9401
  Authorization: `Bearer ${this.accessToken}`,
9242
- "Content-Type": "application/json"
9402
+ "Content-Type": "application/json",
9403
+ // Names the calling process, on every request. A HINT, not an
9404
+ // authorization input: any client can send it, so the backend must
9405
+ // normalize it against what it knows about its own ingress rather than
9406
+ // trust it. Nothing is granted or denied on its value; the Data Worker's
9407
+ // audit rows are its consumer (contracts §1.4).
9408
+ "X-WayAI-Client": "cli"
9243
9409
  },
9244
9410
  body: body ? JSON.stringify(body) : void 0
9245
9411
  });
@@ -9288,6 +9454,8 @@ function friendlyHint(err) {
9288
9454
  if (err.body.includes("FREE_PLAN_RESTRICTION")) {
9289
9455
  return "Publishing to production requires a paid plan. Upgrade your organization to publish or sync.";
9290
9456
  }
9457
+ const dataMessage = dataErrorMessage(err);
9458
+ if (dataMessage) return dataMessage;
9291
9459
  const { status } = err;
9292
9460
  if (status === 401) return "Your session may have expired. Run `wayai login` to re-authenticate.";
9293
9461
  if (status === 402) return "Quota exceeded for your plan. Review usage or upgrade your plan.";
@@ -9349,12 +9517,12 @@ function validateFollowupLinks2(followups, label, ctx) {
9349
9517
  const linkTargets = /* @__PURE__ */ new Set();
9350
9518
  followups.forEach((followup, i) => {
9351
9519
  const ref = followup?.after_followup_id;
9352
- const path30 = ["followups", i, "after_followup_id"];
9520
+ const path31 = ["followups", i, "after_followup_id"];
9353
9521
  if (followup?.type !== "inactivity_after_before_event") {
9354
9522
  if (ref !== void 0) {
9355
9523
  ctx.addIssue({
9356
9524
  code: external_exports.ZodIssueCode.custom,
9357
- path: path30,
9525
+ path: path31,
9358
9526
  message: `kanban status ${label}: after_followup_id is only valid on inactivity_after_before_event followups (this one is ${followup?.type})`
9359
9527
  });
9360
9528
  }
@@ -9363,7 +9531,7 @@ function validateFollowupLinks2(followups, label, ctx) {
9363
9531
  if (ref === void 0) {
9364
9532
  ctx.addIssue({
9365
9533
  code: external_exports.ZodIssueCode.custom,
9366
- path: path30,
9534
+ path: path31,
9367
9535
  message: `kanban status ${label}: inactivity_after_before_event requires after_followup_id naming the id of a before_event followup in the same status`
9368
9536
  });
9369
9537
  return;
@@ -9373,7 +9541,7 @@ function validateFollowupLinks2(followups, label, ctx) {
9373
9541
  if (matches.length > 1) {
9374
9542
  ctx.addIssue({
9375
9543
  code: external_exports.ZodIssueCode.custom,
9376
- path: path30,
9544
+ path: path31,
9377
9545
  message: `kanban status ${label}: after_followup_id "${ref}" matches ${matches.length} followups \u2014 a link must name exactly one`
9378
9546
  });
9379
9547
  return;
@@ -9385,7 +9553,7 @@ function validateFollowupLinks2(followups, label, ctx) {
9385
9553
  );
9386
9554
  ctx.addIssue({
9387
9555
  code: external_exports.ZodIssueCode.custom,
9388
- path: path30,
9556
+ path: path31,
9389
9557
  message: hasIdlessBeforeEvent ? `kanban status ${label}: after_followup_id "${ref}" matches no followup \u2014 a link target must declare an explicit id, and this status has before_event followups without one` : `kanban status ${label}: after_followup_id "${ref}" matches no followup in this status`
9390
9558
  });
9391
9559
  return;
@@ -9393,7 +9561,7 @@ function validateFollowupLinks2(followups, label, ctx) {
9393
9561
  if (target.type !== "before_event") {
9394
9562
  ctx.addIssue({
9395
9563
  code: external_exports.ZodIssueCode.custom,
9396
- path: path30,
9564
+ path: path31,
9397
9565
  message: `kanban status ${label}: after_followup_id "${ref}" points at a ${target.type} followup \u2014 only before_event followups can anchor a chain`
9398
9566
  });
9399
9567
  }
@@ -9469,12 +9637,12 @@ function typeMatches2(typeField, allowed) {
9469
9637
  if (Array.isArray(typeField)) return typeField.every((t) => typeof t === "string" && allowed.has(t));
9470
9638
  return false;
9471
9639
  }
9472
- function validateSchema2(schema, path30, errors, opts = {}) {
9640
+ function validateSchema2(schema, path31, errors, opts = {}) {
9473
9641
  if (typeof schema === "boolean") return;
9474
9642
  const depth = opts.depth ?? 0;
9475
9643
  if (depth > MAX_SCHEMA_DEPTH2) {
9476
9644
  errors.push({
9477
- path: path30 || "<root>",
9645
+ path: path31 || "<root>",
9478
9646
  message: `schema nesting exceeds ${MAX_SCHEMA_DEPTH2} levels`,
9479
9647
  suggestion: "Flatten the schema; LLM providers reject deeply nested tool input_schemas."
9480
9648
  });
@@ -9482,7 +9650,7 @@ function validateSchema2(schema, path30, errors, opts = {}) {
9482
9650
  }
9483
9651
  if (!isRecord2(schema)) {
9484
9652
  errors.push({
9485
- path: path30,
9653
+ path: path31,
9486
9654
  message: `expected object, got ${schema === null ? "null" : typeof schema}`
9487
9655
  });
9488
9656
  return;
@@ -9490,14 +9658,14 @@ function validateSchema2(schema, path30, errors, opts = {}) {
9490
9658
  if (opts.isRoot) {
9491
9659
  if ("type" in schema && schema.type !== "object") {
9492
9660
  errors.push({
9493
- path: path30 ? `${path30}.type` : "type",
9661
+ path: path31 ? `${path31}.type` : "type",
9494
9662
  message: `root type must be 'object', got ${JSON.stringify(schema.type)}`,
9495
9663
  suggestion: "Tool parameters at the root must be an object: `{ type: 'object', properties: { ... } }`."
9496
9664
  });
9497
9665
  }
9498
9666
  } else if ("type" in schema && !typeMatches2(schema.type, ALLOWED_TYPES2)) {
9499
9667
  errors.push({
9500
- path: `${path30}.type`,
9668
+ path: `${path31}.type`,
9501
9669
  message: `type must be one of ${[...ALLOWED_TYPES2].join("/")} or an array of those, got ${JSON.stringify(schema.type)}`
9502
9670
  });
9503
9671
  }
@@ -9507,25 +9675,25 @@ function validateSchema2(schema, path30, errors, opts = {}) {
9507
9675
  const isPlaceholder = PLACEHOLDER_TOKENS2.includes(e);
9508
9676
  const isOutcomePlaceholder = e === "[KANBAN_OUTCOME_VALUES]";
9509
9677
  errors.push({
9510
- path: `${path30}.enum`,
9678
+ path: `${path31}.enum`,
9511
9679
  message: `enum must be a non-empty array of primitives, got string ${JSON.stringify(e)}`,
9512
9680
  suggestion: isOutcomePlaceholder ? "Declare `outcomes` on the hub's terminal kanban status so the platform can render the placeholder into a valid array; with none configured the platform drops the parameter instead." : isPlaceholder ? "Set `operation: 'update_kanban_status'` on the tool and ensure at least one hub.kanban_status has `allowsAgentUpdate: true` so the platform can render the placeholder into a valid array." : 'Wrap the value in an array: `enum: ["value"]`.'
9513
9681
  });
9514
9682
  } else if (!Array.isArray(e)) {
9515
9683
  errors.push({
9516
- path: `${path30}.enum`,
9684
+ path: `${path31}.enum`,
9517
9685
  message: `enum must be a non-empty array of primitives, got ${typeof e}`
9518
9686
  });
9519
9687
  } else if (e.length === 0) {
9520
9688
  errors.push({
9521
- path: `${path30}.enum`,
9689
+ path: `${path31}.enum`,
9522
9690
  message: "enum must not be empty"
9523
9691
  });
9524
9692
  } else {
9525
9693
  for (let i = 0; i < e.length; i++) {
9526
9694
  if (!isPrimitive2(e[i])) {
9527
9695
  errors.push({
9528
- path: `${path30}.enum[${i}]`,
9696
+ path: `${path31}.enum[${i}]`,
9529
9697
  message: `enum entry must be a primitive (string/number/boolean/null), got ${typeof e[i]}`
9530
9698
  });
9531
9699
  }
@@ -9535,7 +9703,7 @@ function validateSchema2(schema, path30, errors, opts = {}) {
9535
9703
  for (const key of ["exclusiveMinimum", "exclusiveMaximum"]) {
9536
9704
  if (key in schema && typeof schema[key] === "boolean") {
9537
9705
  errors.push({
9538
- path: `${path30}.${key}`,
9706
+ path: `${path31}.${key}`,
9539
9707
  message: `${key} as boolean is draft-04 syntax; draft 2020-12 requires a numeric value`,
9540
9708
  suggestion: `Replace with the numeric bound, e.g. \`${key}: 0\`.`
9541
9709
  });
@@ -9544,45 +9712,45 @@ function validateSchema2(schema, path30, errors, opts = {}) {
9544
9712
  if ("properties" in schema) {
9545
9713
  if (!isRecord2(schema.properties)) {
9546
9714
  errors.push({
9547
- path: `${path30}.properties`,
9715
+ path: `${path31}.properties`,
9548
9716
  message: `properties must be an object, got ${Array.isArray(schema.properties) ? "array" : typeof schema.properties}`
9549
9717
  });
9550
9718
  } else {
9551
9719
  for (const [propName, propSchema] of Object.entries(schema.properties)) {
9552
- validateSchema2(propSchema, `${path30}.properties.${propName}`, errors, { depth: depth + 1 });
9720
+ validateSchema2(propSchema, `${path31}.properties.${propName}`, errors, { depth: depth + 1 });
9553
9721
  }
9554
9722
  }
9555
9723
  }
9556
9724
  if (schemaTypeIncludes2(schema, "array") && "items" in schema) {
9557
9725
  if (Array.isArray(schema.items)) {
9558
- schema.items.forEach((sub, i) => validateSchema2(sub, `${path30}.items[${i}]`, errors, { depth: depth + 1 }));
9726
+ schema.items.forEach((sub, i) => validateSchema2(sub, `${path31}.items[${i}]`, errors, { depth: depth + 1 }));
9559
9727
  } else {
9560
- validateSchema2(schema.items, `${path30}.items`, errors, { depth: depth + 1 });
9728
+ validateSchema2(schema.items, `${path31}.items`, errors, { depth: depth + 1 });
9561
9729
  }
9562
9730
  }
9563
9731
  for (const key of SUBSCHEMA_OBJECT_KEYWORDS2) {
9564
9732
  if (key in schema && isRecord2(schema[key])) {
9565
- validateSchema2(schema[key], `${path30}.${key}`, errors, { depth: depth + 1 });
9733
+ validateSchema2(schema[key], `${path31}.${key}`, errors, { depth: depth + 1 });
9566
9734
  }
9567
9735
  }
9568
9736
  for (const key of SUBSCHEMA_LIST_KEYWORDS2) {
9569
9737
  const list = schema[key];
9570
9738
  if (Array.isArray(list)) {
9571
- list.forEach((sub, i) => validateSchema2(sub, `${path30}.${key}[${i}]`, errors, { depth: depth + 1 }));
9739
+ list.forEach((sub, i) => validateSchema2(sub, `${path31}.${key}[${i}]`, errors, { depth: depth + 1 }));
9572
9740
  }
9573
9741
  }
9574
9742
  for (const key of SUBSCHEMA_MAP_KEYWORDS2) {
9575
9743
  const map = schema[key];
9576
9744
  if (isRecord2(map)) {
9577
9745
  for (const [name, sub] of Object.entries(map)) {
9578
- validateSchema2(sub, `${path30}.${key}.${name}`, errors, { depth: depth + 1 });
9746
+ validateSchema2(sub, `${path31}.${key}.${name}`, errors, { depth: depth + 1 });
9579
9747
  }
9580
9748
  }
9581
9749
  }
9582
9750
  const reportedPaths = new Set(errors.map((e) => e.path));
9583
9751
  for (const [k, v] of Object.entries(schema)) {
9584
9752
  if (typeof v !== "string") continue;
9585
- const fieldPath = `${path30}.${k}`;
9753
+ const fieldPath = `${path31}.${k}`;
9586
9754
  if (reportedPaths.has(fieldPath)) continue;
9587
9755
  for (const token of PLACEHOLDER_TOKENS2) {
9588
9756
  if (v === token) {
@@ -9727,8 +9895,8 @@ function evalInitialStateError2(input) {
9727
9895
  const parsed = evalInitialStateEntry2.safeParse(entries[i]);
9728
9896
  if (!parsed.success) {
9729
9897
  const issue = parsed.error.issues[0];
9730
- const path30 = issue?.path.join(".") || "?";
9731
- return `initial_state[${i}].${path30} is invalid: ${issue?.message ?? "malformed"}`;
9898
+ const path31 = issue?.path.join(".") || "?";
9899
+ return `initial_state[${i}].${path31} is invalid: ${issue?.message ?? "malformed"}`;
9732
9900
  }
9733
9901
  if (seenSlugs.has(parsed.data.slug)) {
9734
9902
  return `initial_state[${i}].slug "${parsed.data.slug}" is declared more than once`;
@@ -9933,10 +10101,10 @@ function refineHubAsCodeEvals2(config, ctx) {
9933
10101
  function refineHubAsCodeEvalAttachments2(config, ctx) {
9934
10102
  const cfg = config;
9935
10103
  const referencedHashes = /* @__PURE__ */ new Set();
9936
- const addTurnIssue = (path30, turn, name) => {
10104
+ const addTurnIssue = (path31, turn, name) => {
9937
10105
  const error = evalTurnAttachmentsError2(turn);
9938
10106
  if (error) {
9939
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path30, message: `${name}: ${error}` });
10107
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path31, message: `${name}: ${error}` });
9940
10108
  return;
9941
10109
  }
9942
10110
  for (const hash of collectTurnAttachmentHashes2(turn)) referencedHashes.add(hash);
@@ -10082,11 +10250,11 @@ function refineHubAsCodeDelegation2(config, ctx) {
10082
10250
  }
10083
10251
  }
10084
10252
  if (del.context_boundary === void 0) return;
10085
- const path30 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
10253
+ const path31 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
10086
10254
  if (del.type !== "hub") {
10087
10255
  ctx.addIssue({
10088
10256
  code: external_exports.ZodIssueCode.custom,
10089
- path: path30,
10257
+ path: path31,
10090
10258
  message: `context_boundary applies only to \`type: hub\` delegations (got type "${String(del.type)}")`
10091
10259
  });
10092
10260
  return;
@@ -10094,7 +10262,7 @@ function refineHubAsCodeDelegation2(config, ctx) {
10094
10262
  if (!CONTEXT_BOUNDARIES2.includes(del.context_boundary)) {
10095
10263
  ctx.addIssue({
10096
10264
  code: external_exports.ZodIssueCode.custom,
10097
- path: path30,
10265
+ path: path31,
10098
10266
  message: `context_boundary must be one of: ${CONTEXT_BOUNDARIES2.join(", ")}`
10099
10267
  });
10100
10268
  }
@@ -10140,7 +10308,7 @@ function findStepBoundaries(transcript) {
10140
10308
  }
10141
10309
  return out;
10142
10310
  }
10143
- var UUID_RE, HEX_RE, WORKOS_ID_RE, OPAQUE_SECRET_RE, BASE64_SECRET_RE, BASE64_MARKER_RE, TOKEN_RE, SENSITIVE_FIELDS, SENSITIVE_KEY_ALTERNATION, SENSITIVE_KEY_PATTERN, JSON_CREDENTIAL_RE, QUERY_CREDENTIAL_RE, REDACTED, PROVIDER_TOKEN_RE, APP_ERROR_BRAND, AppError, LLM_RATE_LIMIT_BRAND, LlmRateLimitError, LLM_PROVIDER_HTTP_BRAND, LlmProviderHttpError, LLM_PROVIDER_CONTENT_BRAND, LlmProviderContentError, LLM_PROVIDER_TIMEOUT_BRAND, LlmProviderTimeoutError, ExternalServiceError, CHANNEL_PROVIDER_HTTP_BRAND, ChannelProviderHttpError, MEDIA_PROVIDER_HTTP_BRAND, MediaProviderHttpError, AUTH_TYPE2, ORG_CREDENTIAL_AUTH_TYPES2, AUTH_TYPE_DISPLAY2, LEGACY_AUTH_TYPE_MAP2, VALID_AUTH_TYPES2, AGENT_ROLES2, SAFE_USER_ID_REGEX2, SUPPORTED_LOCALES2, uuidSchema2, paginationSchema3, timestampSchema2, idParamSchema2, clientOptionalString2, clientOptionalBoolean2, clientOptionalNumber2, messageAttachment2, MAX_MESSAGE_BODY_BYTES2, MAX_ATTACHMENTS_PER_MESSAGE2, MAX_AUDIO_FILE_BASE64_BYTES2, primaryRegionSchema2, placementSourceSchema2, orgIdParam2, orgAdminIdParam2, createOrganizationBody2, updateOrganizationBody2, addOrgAdminBody2, SUMMARIZATION_THRESHOLD_MIN2, SUMMARIZATION_THRESHOLD_MAX2, PREVIOUS_CONVERSATIONS_MAX2, previousConversationsCountField2, summarizationThresholdField2, monitorConfigField2, agentIdParam2, listAgentsQuery2, agentConnectionsQuery2, createAgentBody2, updateAgentBody2, AGENT_PARAMETER_TYPES2, AGENT_PARAMETER_NAME_REGEX2, agentParameterCreateSchema2, MAX_AGENT_PARAMETERS_PER_REQUEST2, createAgentParametersBody2, SLUG_REGEX2, slugSchema2, INVISIBLE_NAME_CHARS2, MAX_KANBAN_STATUSES2, MAX_FOLLOWUPS_PER_STATUS2, MAX_LANES2, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES2, RESERVED_TEMPLATE_DUMP_NAME2, kanbanStatusSlugSchema2, followupTypeSchema2, EVENT_RELATIVE_FOLLOWUP_TYPES2, followupTimeUnitSchema2, followupIdSchema2, SELECTABLE_FOLLOWUP_TYPES2, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS2, followupSchema2, MAX_OUTCOMES_PER_STATUS2, kanbanOutcomeSchema2, EXCLUSIVE_FLAG_PAIRS2, kanbanStatusSchema2, kanbanStatusesArraySchema2, laneSchema2, lanesArraySchema2, hubIdParam2, hubAdminIdParam2, hubUserIdParam2, hubIdentityIdParam2, hubTeamIdParam2, hubTeamUserDeleteParam2, hubSchemaQuery2, PREVIEW_LABEL_MAX_LENGTH2, MAX_ENDED_INDEX_RETENTION_DAYS2, previewLabelField2, createHubBody2, updateHubBody2, addHubAdminBody2, addHubIdentityAuthorizationBody2, contactDecisionBody2, approveContactBody2, listContactAccessQuery2, createHubTeamBody2, updateHubTeamBody2, addHubTeamUserBody2, reassignHubUserBody2, replicatePreviewBody2, updateChannelTestIdentitiesBody2, claimCodeChannelParam2, claimCodeDeleteParam2, connectionIdParam2, connectorIdParam2, listConnectionsQuery2, deleteConnectionQuery2, addConnectionBody2, editConnectionBody2, PRODUCTION_DIRECT_FIELDS2, setProductionCredentialBody2, registerWhatsappQuery2, registerWhatsappBody2, retryProvisioningQuery2, resendDomainStatusQuery2, PLACEHOLDER_TOKENS2, ALLOWED_TYPES2, SUBSCHEMA_OBJECT_KEYWORDS2, SUBSCHEMA_LIST_KEYWORDS2, SUBSCHEMA_MAP_KEYWORDS2, MAX_SCHEMA_DEPTH2, toolIdParam2, listToolsQuery2, toolAgentQuery2, deleteToolQuery2, toolConnectionsQuery2, nativeToolIdSchema2, CONTEXT_BOUNDARIES2, contextBoundarySchema2, addNativeToolBody2, addMcpToolBody2, createCustomToolBody2, updateCustomToolBody2, updateToolExecutionConfigBody2, initialValueCreateSchema2, initialValueUpdateSchema2, stateIdParam2, listStatesQuery2, stateNameSchema2, createStateBody2, updateStateBody2, reorderStatesBody2, variantAiModeSchema2, experimentStatusSchema2, overlayUpdateSchema2, experimentIdParam2, variantIdParam2, listExperimentsQuery2, listVariantsQuery2, listOverridesQuery2, deleteOverrideQuery2, createExperimentBody2, updateExperimentBody2, setExperimentStatusBody2, createVariantBody2, updateVariantBody2, upsertOverrideBody2, orgTagIdParam2, listOrgTagsQuery2, createOrgTagBody2, updateOrgTagBody2, orgCredentialIdParam2, listOrgCredentialsQuery2, createOrgCredentialBody2, updateOrgCredentialBody2, orgResourceIdParam2, orgResourceFileIdParam2, orgResourceFolderIdParam2, hubOrgResourceParam2, listOrgResourcesQuery2, orgIdQuery2, createOrgResourceBody2, updateOrgResourceBody2, createOrgResourceFolderBody2, updateOrgResourceFolderBody2, uploadOrgResourceFileBody2, updateOrgResourceFileBody2, uploadOrgSkillZipBody2, linkOrgResourceBody2, resourceIdParam2, listResourcesQuery2, createResourceBody2, updateResourceBody2, syncSkillsBody2, resourceFileIdParam2, listResourceFilesQuery2, createResourceFileBody2, updateResourceFileBody2, uploadResourceFileBody2, uploadSkillZipBody2, resourceFolderIdParam2, listResourceFoldersQuery2, createResourceFolderBody2, updateResourceFolderBody2, agentResourceQuery2, hubResourceQuery2, linkAgentResourceBody2, updateAgentResourceBody2, unlinkAgentResourceQuery2, navItemSchema2, hubCountResetBody2, navItemCountResetBody2, typingBody2, analyticsHubIdParam2, analyticsVariableIdParam2, updateVariablePinBody2, updateAnalyticsViewBody2, NUMERIC_FILTER_OPS2, TEXT_FILTER_OPS2, CATEGORICAL_FILTER_OPS2, VARIABLE_FILTER_OPS2, STRUCTURED_QUERY_OPS2, STRUCTURED_QUERY_AGGREGATIONS2, filterValueSchema2, conversationsBody2, analyticsConversationIdParam2, messagesQuery2, conversationDetailDataQuery2, analyticsDataBody2, structuredQueryBody2, analyticsSqlBody2, analyticsSqlTable2, analyticsSqlSchemaQuery2, EVAL_PACING_PRESET_NAMES2, PACING_INTERVAL_MIN_MS2, PACING_INTERVAL_MAX_MS2, EVAL_MAX_RUNS_PER_SCENARIO2, EVAL_RUN_DEADLINE_MIN_MS2, EVAL_RUN_DEADLINE_MAX_MS2, ISO_UTC_RE2, paginationSchema22, evalIdParam2, sessionIdParam2, scenarioSetIdParam2, hubIdQuery2, evalDateContextSchema2, EVAL_FIXTURE_NAME_MAX_LENGTH2, evalFixtureOverrideSchema2, runSessionQuery2, EVAL_INPUT_ROLES2, EVAL_INPUT_ROLE_LIST2, ROLE_ECHO_MAX2, EVAL_INITIAL_STATE_SCOPES2, MAX_INITIAL_STATE_ENTRIES2, evalInitialStateEntry2, createEvalBody2, updateEvalBody2, getEvalsQuery2, toggleEvalBody2, bulkToggleEvalsBody2, pacingConfigSchema2, EVAL_MAX_SELECTED_SCENARIOS2, evalScenarioSelectionEntrySchema2, evalScenarioSelectionSchema2, sessionConfigSchema2, createSessionBody2, getSessionsQuery2, getSessionResultsQuery2, getSessionRunsQuery2, evalAnalyticsQuery2, getSessionCostQuery2, compareSessionsQuery2, evalsSqlBody2, evalsSqlSchemaQuery2, exportResultsQuery2, validateEvalBody2, hubAgentsQuery2, createScenarioSetBody2, updateScenarioSetBody2, scenarioSetsHubQuery2, createScenarioFromConversationBody2, createJourneyFromConversationBody2, EVAL_ATTACHMENT_HASH_REGEX2, evalAttachmentRef2, turnMayCarryAttachments2, ATTACHMENTS_USER_ONLY_MESSAGE2, journeyIdParam2, journeyToolCallSchema2, journeyTurnSchema2, journeyStepOverrideSchema2, fixtureField2, createJourneyBody2, updateJourneyBody2, evalSessionConfigResponseSchema2, evalSessionResponseSchema2, seedReleaseStatusSchema2, getConversationsQuery2, getMessagesQuery2, appMessageSenderType2, appMessageReceiverType2, apiChannelMessage2, apiChannelMessageBody2, appMessageBody2, appMessageResponse2, updateUserBody2, updateProfileBody2, pathnameRegex2, updatePreferencesBody2, registerPushTokenBody2, deletePushTokenQuery2, activityQuery2, deletionModeSchema2, deletionRequestBody2, archiveHubIdParam2, archiveConversationParams2, archiveListQuery2, archiveMessageObservabilityParams2, conversationIdParam2, claimBody2, releaseBody2, transferBody2, closeBody2, additionalContextPayloadSchema2, kanbanUpdateBody2, annotateConversationBody2, observabilityParams2, observabilityListParams2, deleteUserConversationsBody2, deleteUserConversationsResponse2, sendMessageBody2, listConversationsQuery2, flagSourceSchema2, getConversationsResponse2, getConversationDetailParams2, getConversationDetailQuery2, getConversationDetailResponse2, listWhatsAppTemplatesQuery2, sendWhatsAppTemplateBody2, copilotSuggestBody2, copilotSuggestResponse2, CONSULT_THREAD_STATUSES2, consultThreadStatus2, CONSULT_THREAD_TITLE_MAX2, consultThreadTitle2, consultThreadSummary2, listConsultThreadsQuery2, listConsultThreadsResponse2, createConsultThreadBody2, createConsultThreadResponse2, consultThreadIdParam2, updateConsultThreadBody2, updateConsultThreadResponse2, CONSULT_AWAIT_TIMEOUT_MS2, billingOrgIdParam2, subscriptionItemParams2, spendCapBody2, growthPacksBody2, portalSessionBody2, checkoutSessionBody2, updateBillingCurrencyBody2, invoicesQuery2, downloadBody2, uploadQuery2, signUrlBody2, outboundSchemaQuery2, templateIdParam2, listTemplatesQuery2, deleteTemplateQuery2, templateStatusQuery2, createTemplateBody2, updateTemplateBody2, submitTemplateBody2, testTemplateBody2, contactIdParam2, listContactsQuery2, createContactBody2, updateContactBody2, listIdParam2, listListsQuery2, listListContactsQuery2, createListBody2, updateListBody2, addListContactsBody2, removeListContactsBody2, scheduleIdParam2, listSchedulesQuery2, listExecutionsQuery2, createScheduleBody2, updateScheduleBody2, MAX_RESOURCE_FILE_SIZE2, MAX_10MB_BASE64_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_CARRIERS2, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES2, MAX_RESOURCE_ENCODED_BYTES2, MAX_HUB_AS_CODE_RESOURCES2, MAX_HUB_AS_CODE_RESOURCE_FILES2, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES2, MAX_CI_CONFIG_BODY_BYTES2, hubAsCodeStateSchema2, hubAsCodeResourceFileSchema2, hubAsCodeResourceSchema2, uuidPattern2, ciUuidSchema2, boundedHubAsCodeResourcesSchema2, hubAsCodeConfigSchema2, ciPullHubIdParam2, ciBranchParam2, ciPullQuery2, ciHubsQuery2, ciLookupQuery2, ciBranchesQuery2, ciSyncBody2, ciPushBody2, ciDiffBody2, ciPublishBody2, ciPublishPreviewBody2, ciSyncMcpBody2, ciOrgResourcesParam2, orgResourcesConfigSchema2, ciOrgResourcesPushBody2, ciOrgResourcesDiffBody2, CI_APPLY_ENTITY_KINDS2, CI_APPLY_OPERATIONS2, ciApplyErrorBaseSchema2, ciApplyErrorSchema2, ciSyncCountSchema2, ciSyncChangesSchema2, ciSyncWarningSchema2, ciSyncResponseSchema2, adminOrgIdParam2, adminOrgAdminIdParam2, adminUserIdParam2, adminPlanIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, adminScopedTargetBody2, updatePricingPlanBody2, dataExplorerSearchQuery2, dataExplorerOrgIdParam2, dataExplorerHubIdParam2, dataExplorerConvIdParam2, dataExplorerDoInstancesQuery2, dataExplorerNsIdParam2, dataExplorerKvKeysBody2, dataExplorerKvKeyBody2, uuidOrHexId2, dataExplorerDeleteOrgParam2, dataExplorerDeleteHubParam2, dataExplorerDeleteConvParam2, dataExplorerDeleteUserParam2, dataExplorerDeleteQuery2, dataExplorerKvDeleteBody2, pitrDoNamespace2, pitrBookmarkParam2, pitrRestoreBody2, healthSamplingTriggerBody2, dataExplorerDebugDoType2, DEBUG_READ_MAX_LIMIT2, DEBUG_READ_DEFAULT_LIMIT2, DEBUG_DO_HEX_PREFIX2, debugDoEntityId2, debugTableName2, dataExplorerDebugTablesParam2, dataExplorerDebugRowsParam2, dataExplorerDebugRowsQuery2, dataExplorerDebugAnalyticsTable2, debugUuid2, dataExplorerDebugAnalyticsRowsParam2, dataExplorerDebugAnalyticsRowsQuery2, debugHubConvParam2, debugMessageIdQuery2, sandboxEgressPolicy2, SANDBOX_EXEC_MAX_CMD_LENGTH2, SANDBOX_EXEC_MAX_ALLOWLIST2, SANDBOX_EXEC_MAX_TIMEOUT_MS2, adminSandboxExecBody2, whatsappCallbackBody2, authMeResponse2, wsTicketResponse2, sessionCheckResponse2, logoutResponse2, magicCodeSendBody2, magicCodeSendResponse2, magicCodeVerifyBody2, magicCodeVerifyResponse2, passwordLoginBody2, browserParams2, browserFoldersQuery2, browserFilesQuery2, stateOperationBody2, conversationListResourcesQuery2, conversationReadResourceQuery2, listPendingSchedulesQuery2, listHubAggregateSchedulesQuery2, reportSourceSchema2, intakeReportSourceSchema2, reportClassificationSchema2, reportStatusSchema2, reportLocaleSchema2, reportMessageAuthorRoleSchema2, reportMessageSchema2, sentryRefStatusSchema2, createReportBody2, editReportBody2, reporterReportSummarySchema2, reporterListResponseSchema2, getReportResponseSchema2, reporterTransitionResponseSchema2, contestReportBody2, reporterListQuery2, listReportsQuery2, GITHUB_ISSUE_URL_REGEX2, githubIssueUrlSchema2, transitionReportBody2, groupReportsBody2, holdReportBody2, clickhouseReadyResponse2, bootstrapQuery2, requestSnapshotChunkMessage2, MAX_NAME_LENGTH3, MAX_VALUE_LENGTH2, MAX_TAGS2, MAX_TAG_LENGTH2, MAX_SCOPE_HUBS2, MAX_SCOPE_TAGS2, vaultSecretScopeSchema2, vaultCreateBody2, vaultUpdateBody2, PERMISSIONS2, MAX_NAME_LENGTH22, MAX_HUBS_PER_GRANT2, MAX_HUB_TAGS_PER_GRANT2, MAX_GRANTS2, permissionEnum2, grantScopeSchema2, grantSchema2, createTokenBody2, tokenOrgIdParam2, tokenGrantScopeSchema2, tokenGrantSchema2, tokenMetadataSchema2, listTokensResponse2, createTokenResponse2, orgTokenSummarySchema2, listOrgTokensResponse2, invitePreviewQuery2, invitePreviewResponse2, jsonSchemaSchema2, hubUserIdentity2, stateValueEntry2, getHubUserContextResponse2, updateHubUserBody2, updateHubUserResponse2, unlockHubUserNameResponse2, stateResetParams2, stateResetResponse2, hubAlertsParam2, hubAlertSeverity2, hubAlert2, hubAlertsListResponse2, noticeSeveritySchema2, noticeStatusSchema2, NOTICE_SCOPE_REGEX2, noticeScopeSchema2, noticeLinkSchema2, createNoticeBody2, updateNoticeBody2, listNoticesQuery2, noticeIdParamSchema2, ADMIN_SKILL_NAME_REGEX2, adminSkillNameParam2, WAYAI_WORKSPACE_LAYOUT;
10311
+ var UUID_RE, HEX_RE, WORKOS_ID_RE, OPAQUE_SECRET_RE, BASE64_SECRET_RE, BASE64_MARKER_RE, TOKEN_RE, SENSITIVE_FIELDS, SENSITIVE_KEY_ALTERNATION, SENSITIVE_KEY_PATTERN, JSON_CREDENTIAL_RE, QUERY_CREDENTIAL_RE, REDACTED, PROVIDER_TOKEN_RE, APP_ERROR_BRAND, AppError, LLM_RATE_LIMIT_BRAND, LlmRateLimitError, LLM_PROVIDER_HTTP_BRAND, LlmProviderHttpError, LLM_PROVIDER_CONTENT_BRAND, LlmProviderContentError, LLM_PROVIDER_TIMEOUT_BRAND, LlmProviderTimeoutError, ExternalServiceError, CHANNEL_PROVIDER_HTTP_BRAND, ChannelProviderHttpError, MEDIA_PROVIDER_HTTP_BRAND, MediaProviderHttpError, REKOR_ACTOR_TYPE_HEADER2, REKOR_ACTOR_ID_HEADER2, REKOR_ACTOR_LABEL_HEADER2, REKOR_ACTOR_ORG_HEADER2, REKOR_ACTOR_ADMIN_HEADER2, REKOR_CLIENT_HEADER2, REKOR_TOOL_ID_HEADER2, REKOR_CLIENTS2, rekorClientSchema2, MAX_REKOR_TOOL_ID_LENGTH2, rekorToolIdSchema2, DATA_PROXY_MOUNT2, DATA_PROXY_PREFIX2, DATA_PROXY_ORG_QUERY_PARAM2, dataProxyQuery2, rekorAttestation2, REQUIRED_REKOR_ATTESTATION_HEADERS2, ENDPOINT_CONFIGS, AUTH_TYPE2, ORG_CREDENTIAL_AUTH_TYPES2, AUTH_TYPE_DISPLAY2, LEGACY_AUTH_TYPE_MAP2, VALID_AUTH_TYPES2, AGENT_ROLES2, SAFE_USER_ID_REGEX2, SUPPORTED_LOCALES2, uuidSchema2, paginationSchema3, timestampSchema2, idParamSchema2, clientOptionalString2, clientOptionalBoolean2, clientOptionalNumber2, messageAttachment2, MAX_MESSAGE_BODY_BYTES2, MAX_ATTACHMENTS_PER_MESSAGE2, MAX_AUDIO_FILE_BASE64_BYTES2, primaryRegionSchema2, placementSourceSchema2, orgIdParam2, orgAdminIdParam2, createOrganizationBody2, updateOrganizationBody2, addOrgAdminBody2, SUMMARIZATION_THRESHOLD_MIN2, SUMMARIZATION_THRESHOLD_MAX2, PREVIOUS_CONVERSATIONS_MAX2, previousConversationsCountField2, summarizationThresholdField2, monitorConfigField2, agentIdParam2, listAgentsQuery2, agentConnectionsQuery2, createAgentBody2, updateAgentBody2, AGENT_PARAMETER_TYPES2, AGENT_PARAMETER_NAME_REGEX2, agentParameterCreateSchema2, MAX_AGENT_PARAMETERS_PER_REQUEST2, createAgentParametersBody2, SLUG_REGEX2, slugSchema2, INVISIBLE_NAME_CHARS2, MAX_KANBAN_STATUSES2, MAX_FOLLOWUPS_PER_STATUS2, MAX_LANES2, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES2, RESERVED_TEMPLATE_DUMP_NAME2, kanbanStatusSlugSchema2, followupTypeSchema2, EVENT_RELATIVE_FOLLOWUP_TYPES2, followupTimeUnitSchema2, followupIdSchema2, SELECTABLE_FOLLOWUP_TYPES2, MAX_LINKED_FOLLOWUP_TARGETS_PER_STATUS2, followupSchema2, MAX_OUTCOMES_PER_STATUS2, kanbanOutcomeSchema2, EXCLUSIVE_FLAG_PAIRS2, kanbanStatusSchema2, kanbanStatusesArraySchema2, laneSchema2, lanesArraySchema2, hubIdParam2, hubAdminIdParam2, hubUserIdParam2, hubIdentityIdParam2, hubTeamIdParam2, hubTeamUserDeleteParam2, hubSchemaQuery2, PREVIEW_LABEL_MAX_LENGTH2, MAX_ENDED_INDEX_RETENTION_DAYS2, MAX_EVAL_RETENTION_DAYS2, previewLabelField2, createHubBody2, updateHubBody2, addHubAdminBody2, addHubIdentityAuthorizationBody2, contactDecisionBody2, approveContactBody2, listContactAccessQuery2, createHubTeamBody2, updateHubTeamBody2, addHubTeamUserBody2, reassignHubUserBody2, replicatePreviewBody2, updateChannelTestIdentitiesBody2, claimCodeChannelParam2, claimCodeDeleteParam2, connectionIdParam2, connectorIdParam2, listConnectionsQuery2, deleteConnectionQuery2, addConnectionBody2, editConnectionBody2, PRODUCTION_DIRECT_FIELDS2, setProductionCredentialBody2, registerWhatsappQuery2, registerWhatsappBody2, retryProvisioningQuery2, resendDomainStatusQuery2, PLACEHOLDER_TOKENS2, ALLOWED_TYPES2, SUBSCHEMA_OBJECT_KEYWORDS2, SUBSCHEMA_LIST_KEYWORDS2, SUBSCHEMA_MAP_KEYWORDS2, MAX_SCHEMA_DEPTH2, toolIdParam2, listToolsQuery2, toolAgentQuery2, deleteToolQuery2, toolConnectionsQuery2, nativeToolIdSchema2, CONTEXT_BOUNDARIES2, contextBoundarySchema2, addNativeToolBody2, addMcpToolBody2, createCustomToolBody2, updateCustomToolBody2, updateToolExecutionConfigBody2, initialValueCreateSchema2, initialValueUpdateSchema2, stateIdParam2, listStatesQuery2, stateNameSchema2, createStateBody2, updateStateBody2, reorderStatesBody2, variantAiModeSchema2, experimentStatusSchema2, overlayUpdateSchema2, experimentIdParam2, variantIdParam2, listExperimentsQuery2, listVariantsQuery2, listOverridesQuery2, deleteOverrideQuery2, createExperimentBody2, updateExperimentBody2, setExperimentStatusBody2, createVariantBody2, updateVariantBody2, upsertOverrideBody2, orgTagIdParam2, listOrgTagsQuery2, createOrgTagBody2, updateOrgTagBody2, orgCredentialIdParam2, listOrgCredentialsQuery2, createOrgCredentialBody2, updateOrgCredentialBody2, orgResourceIdParam2, orgResourceFileIdParam2, orgResourceFolderIdParam2, hubOrgResourceParam2, listOrgResourcesQuery2, orgIdQuery2, createOrgResourceBody2, updateOrgResourceBody2, createOrgResourceFolderBody2, updateOrgResourceFolderBody2, uploadOrgResourceFileBody2, updateOrgResourceFileBody2, uploadOrgSkillZipBody2, linkOrgResourceBody2, resourceIdParam2, listResourcesQuery2, createResourceBody2, updateResourceBody2, syncSkillsBody2, resourceFileIdParam2, listResourceFilesQuery2, createResourceFileBody2, updateResourceFileBody2, uploadResourceFileBody2, uploadSkillZipBody2, resourceFolderIdParam2, listResourceFoldersQuery2, createResourceFolderBody2, updateResourceFolderBody2, agentResourceQuery2, hubResourceQuery2, linkAgentResourceBody2, updateAgentResourceBody2, unlinkAgentResourceQuery2, navItemSchema2, hubCountResetBody2, navItemCountResetBody2, typingBody2, analyticsHubIdParam2, analyticsVariableIdParam2, updateVariablePinBody2, updateAnalyticsViewBody2, NUMERIC_FILTER_OPS2, TEXT_FILTER_OPS2, CATEGORICAL_FILTER_OPS2, VARIABLE_FILTER_OPS2, STRUCTURED_QUERY_OPS2, STRUCTURED_QUERY_AGGREGATIONS2, filterValueSchema2, conversationsBody2, analyticsConversationIdParam2, messagesQuery2, conversationDetailDataQuery2, analyticsDataBody2, structuredQueryBody2, analyticsSqlBody2, analyticsSqlTable2, analyticsSqlSchemaQuery2, EVAL_PACING_PRESET_NAMES2, PACING_INTERVAL_MIN_MS2, PACING_INTERVAL_MAX_MS2, EVAL_MAX_RUNS_PER_SCENARIO2, EVAL_RUN_DEADLINE_MIN_MS2, EVAL_RUN_DEADLINE_MAX_MS2, ISO_UTC_RE2, paginationSchema22, evalIdParam2, sessionIdParam2, scenarioSetIdParam2, hubIdQuery2, evalDateContextSchema2, EVAL_FIXTURE_NAME_MAX_LENGTH2, evalFixtureOverrideSchema2, runSessionQuery2, EVAL_INPUT_ROLES2, EVAL_INPUT_ROLE_LIST2, ROLE_ECHO_MAX2, EVAL_INITIAL_STATE_SCOPES2, MAX_INITIAL_STATE_ENTRIES2, evalInitialStateEntry2, createEvalBody2, updateEvalBody2, EVAL_LIST_MAX_LIMIT2, evalListLimit2, getEvalsQuery2, toggleEvalBody2, bulkToggleEvalsBody2, pacingConfigSchema2, EVAL_MAX_SELECTED_SCENARIOS2, evalScenarioSelectionEntrySchema2, evalScenarioSelectionSchema2, sessionConfigSchema2, createSessionBody2, getSessionsQuery2, getSessionResultsQuery2, getSessionRunsQuery2, evalAnalyticsQuery2, getSessionCostQuery2, compareSessionsQuery2, evalsSqlBody2, evalsSqlSchemaQuery2, exportResultsQuery2, validateEvalBody2, hubAgentsQuery2, createScenarioSetBody2, updateScenarioSetBody2, scenarioSetsHubQuery2, createScenarioFromConversationBody2, createJourneyFromConversationBody2, EVAL_ATTACHMENT_HASH_REGEX2, evalAttachmentRef2, turnMayCarryAttachments2, ATTACHMENTS_USER_ONLY_MESSAGE2, journeyIdParam2, journeyToolCallSchema2, journeyTurnSchema2, journeyStepOverrideSchema2, fixtureField2, createJourneyBody2, updateJourneyBody2, evalSessionConfigResponseSchema2, evalSessionResponseSchema2, evalSessionListConfigSchema2, evalSessionListItemSchema2, seedReleaseStatusSchema2, getConversationsQuery2, getMessagesQuery2, appMessageSenderType2, appMessageReceiverType2, apiChannelMessage2, apiChannelMessageBody2, appMessageBody2, appMessageResponse2, updateUserBody2, updateProfileBody2, pathnameRegex2, updatePreferencesBody2, registerPushTokenBody2, deletePushTokenQuery2, activityQuery2, deletionModeSchema2, deletionRequestBody2, archiveHubIdParam2, archiveConversationParams2, archiveListQuery2, archiveMessageObservabilityParams2, conversationIdParam2, claimBody2, releaseBody2, transferBody2, closeBody2, additionalContextPayloadSchema2, kanbanUpdateBody2, annotateConversationBody2, observabilityParams2, observabilityListParams2, deleteUserConversationsBody2, deleteUserConversationsResponse2, sendMessageBody2, listConversationsQuery2, flagSourceSchema2, getConversationsResponse2, getConversationDetailParams2, getConversationDetailQuery2, getConversationDetailResponse2, listWhatsAppTemplatesQuery2, sendWhatsAppTemplateBody2, copilotSuggestBody2, copilotSuggestResponse2, CONSULT_THREAD_STATUSES2, consultThreadStatus2, CONSULT_THREAD_TITLE_MAX2, consultThreadTitle2, consultThreadSummary2, listConsultThreadsQuery2, listConsultThreadsResponse2, createConsultThreadBody2, createConsultThreadResponse2, consultThreadIdParam2, updateConsultThreadBody2, updateConsultThreadResponse2, CONSULT_AWAIT_TIMEOUT_MS2, billingOrgIdParam2, subscriptionItemParams2, spendCapBody2, growthPacksBody2, portalSessionBody2, checkoutSessionBody2, updateBillingCurrencyBody2, invoicesQuery2, planKeySchema2, billingStatusSchema2, REKOR_ENTITLEMENT_CONTRACT_VERSION2, entitlementProjectionSchema2, rekorEntitlementRefreshMessageSchema2, downloadBody2, uploadQuery2, signUrlBody2, outboundSchemaQuery2, templateIdParam2, listTemplatesQuery2, deleteTemplateQuery2, templateStatusQuery2, createTemplateBody2, updateTemplateBody2, submitTemplateBody2, testTemplateBody2, contactIdParam2, listContactsQuery2, createContactBody2, updateContactBody2, listIdParam2, listListsQuery2, listListContactsQuery2, createListBody2, updateListBody2, addListContactsBody2, removeListContactsBody2, scheduleIdParam2, listSchedulesQuery2, listExecutionsQuery2, createScheduleBody2, updateScheduleBody2, MAX_RESOURCE_FILE_SIZE2, MAX_10MB_BASE64_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_ENCODED_BYTES2, MAX_EVAL_ATTACHMENT_CARRIERS2, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES2, MAX_RESOURCE_ENCODED_BYTES2, MAX_HUB_AS_CODE_RESOURCES2, MAX_HUB_AS_CODE_RESOURCE_FILES2, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES2, MAX_CI_CONFIG_BODY_BYTES2, hubAsCodeStateSchema2, hubAsCodeResourceFileSchema2, hubAsCodeResourceSchema2, uuidPattern2, ciUuidSchema2, boundedHubAsCodeResourcesSchema2, hubAsCodeConfigSchema2, ciPullHubIdParam2, ciBranchParam2, ciPullQuery2, ciHubsQuery2, ciLookupQuery2, ciBranchesQuery2, ciSyncBody2, ciPushBody2, ciDiffBody2, ciPublishBody2, ciPublishPreviewBody2, ciSyncMcpBody2, ciOrgResourcesParam2, orgResourcesConfigSchema2, ciOrgResourcesPushBody2, ciOrgResourcesDiffBody2, CI_APPLY_ENTITY_KINDS2, CI_APPLY_OPERATIONS2, ciApplyErrorBaseSchema2, ciApplyErrorSchema2, ciSyncCountSchema2, ciSyncChangesSchema2, ciSyncWarningSchema2, ciSyncResponseSchema2, adminOrgIdParam2, adminOrgAdminIdParam2, adminUserIdParam2, adminPlanIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, adminScopedTargetBody2, updatePricingPlanBody2, dataExplorerSearchQuery2, dataExplorerOrgIdParam2, dataExplorerHubIdParam2, dataExplorerConvIdParam2, dataExplorerDoInstancesQuery2, dataExplorerNsIdParam2, dataExplorerKvKeysBody2, dataExplorerKvKeyBody2, uuidOrHexId2, dataExplorerDeleteOrgParam2, dataExplorerDeleteHubParam2, dataExplorerDeleteConvParam2, dataExplorerDeleteUserParam2, dataExplorerDeleteQuery2, dataExplorerKvDeleteBody2, pitrDoNamespace2, pitrBookmarkParam2, pitrRestoreBody2, healthSamplingTriggerBody2, dataExplorerDebugDoType2, DEBUG_READ_MAX_LIMIT2, DEBUG_READ_DEFAULT_LIMIT2, DEBUG_DO_HEX_PREFIX2, debugDoEntityId2, debugTableName2, dataExplorerDebugTablesParam2, dataExplorerDebugRowsParam2, dataExplorerDebugRowsQuery2, dataExplorerDebugAnalyticsTable2, debugUuid2, dataExplorerDebugAnalyticsRowsParam2, dataExplorerDebugAnalyticsRowsQuery2, debugHubConvParam2, debugMessageIdQuery2, sandboxEgressPolicy2, SANDBOX_EXEC_MAX_CMD_LENGTH2, SANDBOX_EXEC_MAX_ALLOWLIST2, SANDBOX_EXEC_MAX_TIMEOUT_MS2, adminSandboxExecBody2, whatsappCallbackBody2, authMeResponse2, wsTicketResponse2, sessionCheckResponse2, logoutResponse2, magicCodeSendBody2, magicCodeSendResponse2, magicCodeVerifyBody2, magicCodeVerifyResponse2, passwordLoginBody2, browserParams2, browserFoldersQuery2, browserFilesQuery2, stateOperationBody2, conversationListResourcesQuery2, conversationReadResourceQuery2, listPendingSchedulesQuery2, listHubAggregateSchedulesQuery2, reportSourceSchema2, intakeReportSourceSchema2, reportClassificationSchema2, reportStatusSchema2, reportLocaleSchema2, reportMessageAuthorRoleSchema2, reportMessageSchema2, sentryRefStatusSchema2, createReportBody2, editReportBody2, reporterReportSummarySchema2, reporterListResponseSchema2, getReportResponseSchema2, reporterTransitionResponseSchema2, contestReportBody2, reporterListQuery2, listReportsQuery2, GITHUB_ISSUE_URL_REGEX2, githubIssueUrlSchema2, transitionReportBody2, groupReportsBody2, holdReportBody2, clickhouseReadyResponse2, bootstrapQuery2, requestSnapshotChunkMessage2, MAX_NAME_LENGTH3, MAX_VALUE_LENGTH2, MAX_TAGS2, MAX_TAG_LENGTH2, MAX_SCOPE_HUBS2, MAX_SCOPE_TAGS2, vaultSecretScopeSchema2, vaultCreateBody2, vaultUpdateBody2, PERMISSIONS2, MAX_NAME_LENGTH22, MAX_HUBS_PER_GRANT2, MAX_HUB_TAGS_PER_GRANT2, MAX_GRANTS2, permissionEnum2, grantScopeSchema2, grantSchema2, createTokenBody2, tokenOrgIdParam2, tokenGrantScopeSchema2, tokenGrantSchema2, tokenMetadataSchema2, listTokensResponse2, createTokenResponse2, orgTokenSummarySchema2, listOrgTokensResponse2, invitePreviewQuery2, invitePreviewResponse2, jsonSchemaSchema2, hubUserIdentity2, stateValueEntry2, getHubUserContextResponse2, updateHubUserBody2, updateHubUserResponse2, unlockHubUserNameResponse2, stateResetParams2, stateResetResponse2, hubAlertsParam2, hubAlertSeverity2, hubAlert2, hubAlertsListResponse2, noticeSeveritySchema2, noticeStatusSchema2, NOTICE_SCOPE_REGEX2, noticeScopeSchema2, noticeLinkSchema2, createNoticeBody2, updateNoticeBody2, listNoticesQuery2, noticeIdParamSchema2, ADMIN_SKILL_NAME_REGEX2, adminSkillNameParam2, WAYAI_WORKSPACE_LAYOUT;
10144
10312
  var init_dist = __esm({
10145
10313
  "../../packages/core/dist/index.js"() {
10146
10314
  "use strict";
@@ -10192,6 +10360,7 @@ var init_dist = __esm({
10192
10360
  init_zod();
10193
10361
  init_zod();
10194
10362
  init_zod();
10363
+ init_zod();
10195
10364
  UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
10196
10365
  HEX_RE = /^[0-9a-f]{16,}$/;
10197
10366
  WORKOS_ID_RE = /^(?:user|org)_[0-9A-HJKMNP-TV-Z]{26}$/;
@@ -10349,6 +10518,208 @@ var init_dist = __esm({
10349
10518
  }
10350
10519
  [MEDIA_PROVIDER_HTTP_BRAND] = true;
10351
10520
  };
10521
+ REKOR_ACTOR_TYPE_HEADER2 = "X-Rekor-Actor-Type";
10522
+ REKOR_ACTOR_ID_HEADER2 = "X-Rekor-Actor-Id";
10523
+ REKOR_ACTOR_LABEL_HEADER2 = "X-Rekor-Actor-Label";
10524
+ REKOR_ACTOR_ORG_HEADER2 = "X-Rekor-Actor-Org";
10525
+ REKOR_ACTOR_ADMIN_HEADER2 = "X-Rekor-Actor-Admin";
10526
+ REKOR_CLIENT_HEADER2 = "X-Rekor-Client";
10527
+ REKOR_TOOL_ID_HEADER2 = "X-Rekor-Tool-Id";
10528
+ REKOR_CLIENTS2 = ["api", "cli", "mcp"];
10529
+ rekorClientSchema2 = external_exports.enum(REKOR_CLIENTS2);
10530
+ MAX_REKOR_TOOL_ID_LENGTH2 = 128;
10531
+ rekorToolIdSchema2 = external_exports.string().trim().min(1).max(MAX_REKOR_TOOL_ID_LENGTH2);
10532
+ DATA_PROXY_MOUNT2 = "/data";
10533
+ DATA_PROXY_PREFIX2 = `/api${DATA_PROXY_MOUNT2}`;
10534
+ DATA_PROXY_ORG_QUERY_PARAM2 = "org_id";
10535
+ dataProxyQuery2 = external_exports.object({
10536
+ [DATA_PROXY_ORG_QUERY_PARAM2]: external_exports.string().uuid().optional()
10537
+ });
10538
+ rekorAttestation2 = external_exports.object({
10539
+ [REKOR_ACTOR_TYPE_HEADER2]: external_exports.enum(["user", "token"]),
10540
+ [REKOR_ACTOR_ID_HEADER2]: external_exports.string().min(1),
10541
+ [REKOR_ACTOR_LABEL_HEADER2]: external_exports.string(),
10542
+ [REKOR_ACTOR_ORG_HEADER2]: external_exports.string().uuid(),
10543
+ [REKOR_ACTOR_ADMIN_HEADER2]: external_exports.enum(["0", "1"]),
10544
+ [REKOR_CLIENT_HEADER2]: rekorClientSchema2,
10545
+ [REKOR_TOOL_ID_HEADER2]: rekorToolIdSchema2.optional()
10546
+ });
10547
+ REQUIRED_REKOR_ATTESTATION_HEADERS2 = Object.entries(rekorAttestation2.shape).filter(([, field]) => !field.isOptional()).map(([header]) => header);
10548
+ ENDPOINT_CONFIGS = {
10549
+ // OAuth callbacks - strict, fail-closed (prevent brute force)
10550
+ "/oauth/callback/*": { tier: "STRICT", failClosed: true },
10551
+ // Auth endpoints - strict, fail-closed
10552
+ "/auth/phone": { tier: "STRICT", failClosed: true },
10553
+ "/auth/mcp/exchange": { tier: "MODERATE", failClosed: true },
10554
+ // Native magic-code login (pre-auth) — STRICT per-IP bounds a single host; WorkOS owns
10555
+ // the per-email lockout / TTL / single-use guarantees.
10556
+ "/api/auth/magic-code/*": { tier: "STRICT", failClosed: true },
10557
+ // Native password login (pre-auth) — same posture as magic-code above. STRICT per-IP bounds a
10558
+ // single host but FAILS OPEN on a binding error (like every IP limit); the `failClosed` flag
10559
+ // here is inert on a pre-auth route (it's only enforced on the per-user branch, which needs an
10560
+ // authenticated caller). The fail-CLOSED brute-force guarantee for the static credential comes
10561
+ // from the route's per-email caps (burst + cumulative hourly), not this flag.
10562
+ "/api/auth/password/*": { tier: "STRICT", failClosed: true },
10563
+ // Billing - moderate, fail-closed with user limits
10564
+ "/api/billing/*": { tier: "MODERATE", userLimit: 100, failClosed: true, skipAuthenticatedUsers: true },
10565
+ "/webhooks/stripe": { tier: "MODERATE", failClosed: true },
10566
+ "/webhooks/workos": { tier: "MODERATE", failClosed: true },
10567
+ // API endpoints - standard with user limits
10568
+ "/api/setup/*": { tier: "STANDARD", userLimit: 150, skipAuthenticatedUsers: true },
10569
+ "/api/conversations/*": { tier: "STANDARD", userLimit: 150, skipAuthenticatedUsers: true },
10570
+ "/api/users/*": { tier: "STANDARD", userLimit: 150, skipAuthenticatedUsers: true },
10571
+ "/api/analytics/*": { tier: "STANDARD", userLimit: 150, skipAuthenticatedUsers: true },
10572
+ "/api/evals/*": { tier: "STANDARD", userLimit: 150, skipAuthenticatedUsers: true },
10573
+ "/api/files/*": { tier: "STANDARD", userLimit: 150, skipAuthenticatedUsers: true },
10574
+ "/api/outbound/*": { tier: "STANDARD", userLimit: 150, skipAuthenticatedUsers: true },
10575
+ "/api/live-updates/*": { tier: "STANDARD", userLimit: 150, skipAuthenticatedUsers: true },
10576
+ "/api/hub-users/*": { tier: "STANDARD", userLimit: 150, skipAuthenticatedUsers: true },
10577
+ "/api/conversation-state/*": { tier: "STANDARD", userLimit: 150, skipAuthenticatedUsers: true },
10578
+ // Channel webhooks - high throughput (external systems, never authenticated)
10579
+ "/webhooks/whatsapp/*": { tier: "HIGH" },
10580
+ "/webhooks/instagram/*": { tier: "HIGH" },
10581
+ // Reports (CLI → platform_report triage queue). One per-user budget covers intake
10582
+ // (POST), the content edit (PATCH /:id), the reporter read-back (GET, GET /:id), and the
10583
+ // verification loop (POST /:id/accept, /:id/contest). The limiter is path-based, so a
10584
+ // method-level split (loose reads, strict writes) isn't expressible — GET /:id and PATCH
10585
+ // /:id share a path. So the budget is sized for the read-heavy poll loop (a reporter agent
10586
+ // polling `report get`/`list` while it waits for the fix), at 60/hour. Intake-flooding stays
10587
+ // bounded regardless: identical reports collapse on `fingerprint` (ON CONFLICT DO NOTHING),
10588
+ // so a runaway create loop merges rather than floods. Still STRICT tier + failClosed so a
10589
+ // genuinely runaway distinct-report loop surfaces as 429. The `/*` is load-bearing — an
10590
+ // exact `/api/reports` key would leave the `/:id` paths unmatched (→ unthrottled).
10591
+ // `userLimitKey` is equally load-bearing: without it, middleware falls back to each raw
10592
+ // pathname and report IDs/actions receive independent counters instead of this shared budget.
10593
+ "/api/reports/*": {
10594
+ tier: "STRICT",
10595
+ userLimit: 60,
10596
+ userWindow: 3600,
10597
+ failClosed: true,
10598
+ skipAuthenticatedUsers: true,
10599
+ userLimitKey: "/api/reports/*"
10600
+ },
10601
+ // Admin report mutations (transition/group/ungroup/edit) — platform-admin
10602
+ // gated at the route, rate-limited here as defense-in-depth. Generous STANDARD
10603
+ // cap so legitimate triage bursts aren't throttled (grouping is one request
10604
+ // even for many members); deliberately NOT failClosed so a Redis blip never
10605
+ // blocks an admin's triage. The bare GET reads share this budget harmlessly.
10606
+ "/api/admin/reports/*": { tier: "STANDARD", userLimit: 150 },
10607
+ // GitHub webhook (issues.closed → platform_report addressed). MODERATE +
10608
+ // fail-closed; GitHub retries on transient failures so a brief Redis blip
10609
+ // doesn't lose state.
10610
+ "/webhooks/github": { tier: "MODERATE", failClosed: true },
10611
+ // Account deletion — strict on the destructive POST + public undo. The
10612
+ // /api/users/* default tier above ALSO matches these, but `getEndpointConfig`
10613
+ // returns the longest-prefix match, so the more specific entries here win.
10614
+ // `skipAuthenticatedUsers` deliberately omitted: every caller is authenticated,
10615
+ // so including it would make `userLimit` a no-op — the per-user cap IS the gate.
10616
+ "/api/users/me/deletion": { tier: "STRICT", userLimit: 3, userWindow: 3600, failClosed: true },
10617
+ "/api/users/me/deletion/preflight": { tier: "STANDARD", userLimit: 30, failClosed: true },
10618
+ "/api/users/deletion/undo": { tier: "STRICT", failClosed: true },
10619
+ // Email-invite preview — public, fail-closed. MODERATE (30/min IP) leaves
10620
+ // headroom for the signup-page server-fetch + reloads + prefetches; STRICT
10621
+ // would throttle legitimate users opening the link in multiple tabs.
10622
+ "/api/invites/preview": { tier: "MODERATE", failClosed: true },
10623
+ // Admin DO debug reads — the ONE deliberate deviation from the Data Explorer
10624
+ // catch-all below, and the only reason a per-route key still exists here.
10625
+ // Platform-admin is enforced at the route; this is the independent
10626
+ // defense-in-depth signal so a runaway investigation script surfaces as 429.
10627
+ //
10628
+ // STRICT is kept ON PURPOSE even though the catch-all moved off it, because
10629
+ // `tier` is the only layer that bounds enumeration on this surface: the
10630
+ // per-user cap keys on the RAW pathname (see the CAVEAT below), so sweeping
10631
+ // `/debug/do/hub/<id>/tables` across thousands of ids never trips it. At 5/min
10632
+ // vs STANDARD's 100/min, walking 10k ids takes ~33h instead of ~100min — a
10633
+ // detection window worth keeping on the routes that return RAW DO ROWS.
10634
+ //
10635
+ // The cost, stated rather than elided: STRICT is one bucket shared with
10636
+ // `/oauth/callback/*` and `/api/auth/magic-code/*`, so a debug session from a
10637
+ // NAT'd office IP can 429 a colleague's login for up to a minute. That trade is
10638
+ // accepted for a rare, deliberate investigation surface — and is exactly why the
10639
+ // browse routes below are NOT here.
10640
+ "/api/admin/data-explorer/debug/*": { tier: "STRICT", userLimit: 60, userWindow: 3600, failClosed: true },
10641
+ // Catch-all for the rest of the Data Explorer (`/search`, `/entity/*`, `/do/*`,
10642
+ // `/kv/*`, the DELETE routes). Added as a catch-all rather than another per-route
10643
+ // key because this budget kept lagging behind routes joining the debug boundary:
10644
+ // with no match the path falls to the default, which sets no `userLimit`, so the
10645
+ // per-user layer never runs at all. `getEndpointConfig` takes the longest match,
10646
+ // so `debug/*` above still wins.
10647
+ //
10648
+ // `/entity/*` deliberately has NO key of its own: it needs precisely this config,
10649
+ // and a duplicate entry is how the two drift apart on the next edit.
10650
+ //
10651
+ // `tier` is deliberately STANDARD, not STRICT. `tier` is the per-IP knob and
10652
+ // STRICT is 5/min keyed on IP ALONE — one bucket shared across every STRICT
10653
+ // endpoint. On these browse routes that breaks the console (open Browse KV and
10654
+ // inspect four values = 6 requests; expand six org rows in the search results =
10655
+ // 6 `/entity/org/:id` calls) and would drain the same IP's budget for
10656
+ // `/oauth/callback/*` and `/api/auth/magic-code/*`, which on a NAT'd office IP
10657
+ // means all admins. The per-user hourly cap is the leg that matters here.
10658
+ //
10659
+ // The canonical key is deliberate: raw pathnames contain DO ids and arbitrary
10660
+ // malformed requests can contain credential material. Keying on the raw pathname
10661
+ // both stores that material in Redis/logs and gives every target a fresh counter.
10662
+ // One stable identity makes every browse request consume the same per-admin
10663
+ // budget without storing request targets.
10664
+ //
10665
+ // 600/hour preserves the original pagination requirement (about 30k rows at
10666
+ // 50/page) while now genuinely bounding id/key enumeration across the surface.
10667
+ "/api/admin/data-explorer/*": {
10668
+ tier: "STANDARD",
10669
+ userLimit: 600,
10670
+ userWindow: 3600,
10671
+ failClosed: true,
10672
+ userLimitKey: "/api/admin/data-explorer/*"
10673
+ },
10674
+ // Admin sandbox exec (harness-agents PR 1.5) — this is ARBITRARY CODE EXECUTION,
10675
+ // so it gets the strictest budget on the platform: STRICT tier + a low per-user
10676
+ // hourly cap (well below the 60/hr debug-read cap) + fail-closed. Platform-admin
10677
+ // is enforced at the route; this is the independent defense-in-depth signal so a
10678
+ // runaway exec loop surfaces as 429 instead of silently provisioning sandboxes.
10679
+ "/api/admin/sandbox/*": { tier: "STRICT", userLimit: 20, userWindow: 3600, failClosed: true },
10680
+ // Admin harness incident-response (harness-agents PR 2.9b) — mass-destroy reaps
10681
+ // EVERY live harness sandbox/token/slot in scope, so it gets a strict budget
10682
+ // (STRICT + a low per-user hourly cap + fail-closed). Platform-admin is enforced
10683
+ // at the route; this is the independent defense-in-depth signal so a runaway
10684
+ // reap loop surfaces as 429. The break-glass disable/enable rides through
10685
+ // `/api/admin/config` (its own STANDARD budget), not this key.
10686
+ "/api/admin/harness/*": { tier: "STRICT", userLimit: 10, userWindow: 3600, failClosed: true },
10687
+ // Platform-wide team-orphan repair — a single call can WRITE across every hub of
10688
+ // every org (HubDO purge + UserDO mirror fan-out), so it gets the same strict,
10689
+ // fail-closed budget as the other cross-platform admin write. Exact path (not a
10690
+ // prefix): the sibling `/api/admin/hubs/:hubId/harness` flag flips stay on the
10691
+ // default admin budget. Platform-admin is enforced at the route; this is the
10692
+ // defense-in-depth signal that a repair loop surfaces as 429.
10693
+ "/api/admin/hubs/repair-team-orphans": { tier: "STRICT", userLimit: 10, userWindow: 3600, failClosed: true },
10694
+ // CI/GitOps endpoints - standard with user limits
10695
+ "/api/ci/*": { tier: "STANDARD", userLimit: 100, skipAuthenticatedUsers: true },
10696
+ // Attested `/v1` proxy onto the Rekor Worker. `userLimitKey` is load-bearing here in a
10697
+ // way it is not for the siblings above: the per-user budget defaults to the full request
10698
+ // path, and this surface's paths carry base, record, and file ids — so without a pinned
10699
+ // key every distinct resource would get its own fresh budget and the per-user limit
10700
+ // would bound nothing. One shared budget across the whole data surface is the intent.
10701
+ [`${DATA_PROXY_PREFIX2}/*`]: {
10702
+ tier: "STANDARD",
10703
+ userLimit: 150,
10704
+ skipAuthenticatedUsers: true,
10705
+ userLimitKey: `${DATA_PROXY_PREFIX2}/*`
10706
+ },
10707
+ // App channel - high throughput with user limits
10708
+ "/channels/app/*": { tier: "HIGH", userLimit: 500, skipAuthenticatedUsers: true },
10709
+ // API channel (api-channel-connector) - machine-to-machine, high throughput
10710
+ "/channels/api/*": { tier: "HIGH", userLimit: 500, skipAuthenticatedUsers: true },
10711
+ // System/scheduled - high throughput (internal)
10712
+ "/channels/system/*": { tier: "HIGH", skipAuthenticatedUsers: true },
10713
+ "/scheduled/*": { tier: "HIGH", skipAuthenticatedUsers: true },
10714
+ // WebSocket - standard with user limit to prevent connection spam
10715
+ "/live-updates/ws": { tier: "STANDARD", userLimit: 100, failClosed: true },
10716
+ // WS ticket mint - per-user 60/min accommodates aggressive reconnect patterns
10717
+ // without opening abuse vectors; fail-closed so Redis outages don't let
10718
+ // runaway clients mint unbounded tickets.
10719
+ "/api/auth/ws-ticket": { tier: "MODERATE", userLimit: 60, failClosed: true, skipAuthenticatedUsers: true },
10720
+ "/api/auth/session-check": { tier: "STANDARD", userLimit: 120, skipAuthenticatedUsers: true },
10721
+ "/api/auth/logout": { tier: "MODERATE", userLimit: 10, failClosed: true, skipAuthenticatedUsers: true }
10722
+ };
10352
10723
  AUTH_TYPE2 = {
10353
10724
  OAUTH: "oauth",
10354
10725
  API_KEY: "api_key",
@@ -10843,6 +11214,7 @@ var init_dist = __esm({
10843
11214
  hubSchemaQuery2 = external_exports.object({ hub_id: uuidSchema2 });
10844
11215
  PREVIEW_LABEL_MAX_LENGTH2 = 60;
10845
11216
  MAX_ENDED_INDEX_RETENTION_DAYS2 = 730;
11217
+ MAX_EVAL_RETENTION_DAYS2 = 3650;
10846
11218
  previewLabelField2 = external_exports.string().max(PREVIEW_LABEL_MAX_LENGTH2).optional().nullable().transform((v) => {
10847
11219
  if (v == null) return null;
10848
11220
  const trimmed = v.trim();
@@ -10878,6 +11250,10 @@ var init_dist = __esm({
10878
11250
  // the cleanup cron reaps its index row. Absent → DEFAULT_ENDED_INDEX_RETENTION_DAYS
10879
11251
  // (365). Re-clamped to the effective storage retention at reap time.
10880
11252
  ended_index_retention_days: external_exports.number().int().min(1).max(MAX_ENDED_INDEX_RETENTION_DAYS2).optional(),
11253
+ // Per-hub eval-session retention window (days). null CLEARS the override (back to
11254
+ // the platform default); 0 disables retention for this hub (keep sessions forever).
11255
+ // Nullable — unlike the fields above, "unset" is a meaningful, settable state.
11256
+ eval_retention_days: external_exports.number().int().min(0).max(MAX_EVAL_RETENTION_DAYS2).nullable().optional(),
10881
11257
  // Channel contact access control. Enum-validated explicitly (not via passthrough)
10882
11258
  // so `language`/`access_approval_role` can't reach the DB with an invalid value.
10883
11259
  language: external_exports.enum(["en", "pt", "es"]).optional(),
@@ -11458,7 +11834,6 @@ var init_dist = __esm({
11458
11834
  agent_id: uuidSchema2,
11459
11835
  priority: external_exports.number().optional(),
11460
11836
  use_native_integration: external_exports.boolean().optional(),
11461
- include_structure_in_prompt: external_exports.boolean().optional(),
11462
11837
  write_enabled: external_exports.boolean().optional()
11463
11838
  });
11464
11839
  updateAgentResourceBody2 = external_exports.object({
@@ -11466,7 +11841,6 @@ var init_dist = __esm({
11466
11841
  resource_id: uuidSchema2,
11467
11842
  agent_id: uuidSchema2,
11468
11843
  use_native_integration: external_exports.boolean().optional(),
11469
- include_structure_in_prompt: external_exports.boolean().optional(),
11470
11844
  enabled: external_exports.boolean().optional(),
11471
11845
  priority: external_exports.number().optional(),
11472
11846
  write_enabled: external_exports.boolean().optional()
@@ -11650,12 +12024,16 @@ var init_dist = __esm({
11650
12024
  updateEvalBody2 = external_exports.object({
11651
12025
  eval: external_exports.record(external_exports.unknown())
11652
12026
  }).superRefine(refineEvalMessageTextRole2).superRefine(refineEvalAttachments2).superRefine(refineEvalInitialState2);
12027
+ EVAL_LIST_MAX_LIMIT2 = 1e3;
12028
+ evalListLimit2 = external_exports.string().regex(/^\d+$/).refine((v) => Number(v) <= EVAL_LIST_MAX_LIMIT2, {
12029
+ message: `limit must be ${EVAL_LIST_MAX_LIMIT2} or less`
12030
+ }).optional();
11653
12031
  getEvalsQuery2 = external_exports.object({
11654
12032
  hub_id: external_exports.string().uuid(),
11655
12033
  agent_id: external_exports.string().uuid().optional(),
11656
12034
  enabled: external_exports.string().regex(/^(true|false)$/).optional(),
11657
12035
  search: external_exports.string().optional(),
11658
- limit: external_exports.string().regex(/^\d+$/).optional(),
12036
+ limit: evalListLimit2,
11659
12037
  offset: external_exports.string().regex(/^\d+$/).optional()
11660
12038
  });
11661
12039
  toggleEvalBody2 = external_exports.object({
@@ -11710,7 +12088,7 @@ var init_dist = __esm({
11710
12088
  hub_id: external_exports.string().uuid(),
11711
12089
  status: external_exports.string().optional(),
11712
12090
  search: external_exports.string().optional(),
11713
- limit: external_exports.string().regex(/^\d+$/).optional(),
12091
+ limit: evalListLimit2,
11714
12092
  offset: external_exports.string().regex(/^\d+$/).optional()
11715
12093
  });
11716
12094
  getSessionResultsQuery2 = external_exports.object({
@@ -11889,6 +12267,15 @@ var init_dist = __esm({
11889
12267
  /** Launch-time snapshot. */
11890
12268
  session_config: evalSessionConfigResponseSchema2.optional()
11891
12269
  }).passthrough();
12270
+ evalSessionListConfigSchema2 = external_exports.object({
12271
+ agent: external_exports.object({
12272
+ agent_id: external_exports.string().nullable().optional(),
12273
+ agent_name: external_exports.string().nullable().optional(),
12274
+ agent_role: external_exports.string().nullable().optional()
12275
+ }).optional(),
12276
+ scenario_set_id: external_exports.string().optional().catch(void 0)
12277
+ });
12278
+ evalSessionListItemSchema2 = evalSessionResponseSchema2.omit({ session_config: true }).extend({ session_config: evalSessionListConfigSchema2.optional() }).passthrough();
11892
12279
  seedReleaseStatusSchema2 = external_exports.enum(["not_applicable", "pending", "releasing"]);
11893
12280
  getConversationsQuery2 = external_exports.object({
11894
12281
  nav_item: external_exports.enum(["chat", "task", "support", "chat_task"]),
@@ -12433,6 +12820,42 @@ var init_dist = __esm({
12433
12820
  invoicesQuery2 = external_exports.object({
12434
12821
  limit: external_exports.string().regex(/^\d+$/).optional()
12435
12822
  });
12823
+ planKeySchema2 = external_exports.enum(["free", "solo", "team"]);
12824
+ billingStatusSchema2 = external_exports.enum(["active", "past_due", "cancelled"]);
12825
+ REKOR_ENTITLEMENT_CONTRACT_VERSION2 = 1;
12826
+ entitlementProjectionSchema2 = external_exports.object({
12827
+ contract_version: external_exports.literal(REKOR_ENTITLEMENT_CONTRACT_VERSION2),
12828
+ /**
12829
+ * Monotonic per org, WayAI-assigned. An ordering guard for concurrent WayAI
12830
+ * writers (a plan change racing a token mint) — NOT a cross-repo CAS. Gaps are
12831
+ * expected: a version is allocated per push attempt, and an idempotency skip
12832
+ * (§2.4) burns none while a failed KV put burns one.
12833
+ */
12834
+ projection_version: external_exports.number().int().nonnegative(),
12835
+ /** Diagnostic only — never gates. Freshness is `window_resets_at`'s job (§2.2). */
12836
+ written_at: external_exports.string().datetime(),
12837
+ /** The WayAI org UUID. The `account_id` spelling is Rekor's documented carve-out. */
12838
+ account_id: external_exports.string().uuid(),
12839
+ /** The EFFECTIVE plan, not the subscribed one (§2.2.1). Never gates. */
12840
+ plan_key: planKeySchema2,
12841
+ /** Informational only (§2.2.1). `cancelled` spelling matches `BillingRecord`. */
12842
+ billing_status: billingStatusSchema2,
12843
+ /** Tenths, matching Rekor's meter granularity (write 10, point-read 1, list/SQL 10). */
12844
+ ops_tenths_included: external_exports.number().int().nonnegative(),
12845
+ max_records: external_exports.number().int().nonnegative(),
12846
+ /** Its own field, no longer derived from `max_records` (§2.2). */
12847
+ import_rows_included: external_exports.number().int().nonnegative(),
12848
+ /** REQUIRED — absence is malformed, never coerced to `false` (§2.2.2). */
12849
+ production_bases: external_exports.boolean(),
12850
+ /** Opaque to Rekor; compared for equality only, to reset `usage:` counters (§2.3). */
12851
+ window_key: external_exports.string().min(1),
12852
+ /** The sole staleness authority (§2.3). Never triggers a counter reset. */
12853
+ window_resets_at: external_exports.string().datetime()
12854
+ }).strict();
12855
+ rekorEntitlementRefreshMessageSchema2 = external_exports.object({
12856
+ org_id: external_exports.string().uuid(),
12857
+ reason: external_exports.enum(["window_elapsed", "projection_missing", "projection_malformed"])
12858
+ });
12436
12859
  downloadBody2 = external_exports.object({
12437
12860
  type: external_exports.enum(["workspace", "agent_instructions"]),
12438
12861
  agent_id: external_exports.string().uuid().optional(),
@@ -12874,7 +13297,14 @@ var init_dist = __esm({
12874
13297
  * disable|enable` flips this. The DO's `updatePlatformConfig` allowlist already
12875
13298
  * accepts it; this exposes it on the route.
12876
13299
  */
12877
- harness_enabled: external_exports.number().int().min(0).max(1).optional()
13300
+ harness_enabled: external_exports.number().int().min(0).max(1).optional(),
13301
+ /**
13302
+ * Default eval-session retention window in days, used by every hub that sets no
13303
+ * `eval_retention_days` override. `0` disables eval retention platform-wide.
13304
+ * NOT NULL in the DDL, so the field is non-nullable here — clearing is not a
13305
+ * state; setting 0 is.
13306
+ */
13307
+ default_eval_retention_days: external_exports.number().int().min(0).max(MAX_EVAL_RETENTION_DAYS2).optional()
12878
13308
  }).strip().refine(
12879
13309
  (data) => Object.keys(data).length > 0,
12880
13310
  { message: "No fields to update" }
@@ -12918,7 +13348,14 @@ var init_dist = __esm({
12918
13348
  messages_per_unit: external_exports.number().int().min(1, "messages_per_unit must be a positive integer").optional(),
12919
13349
  seats_per_unit: external_exports.number().int().min(1, "seats_per_unit must be a positive integer").optional(),
12920
13350
  seats_scaling: external_exports.enum(["fixed", "per_quantity"]).optional(),
12921
- is_active: external_exports.boolean().optional()
13351
+ is_active: external_exports.boolean().optional(),
13352
+ // Rekor entitlement allowances (rekor-platform-contracts §2.2). Editable here for the
13353
+ // same reason `messages_per_unit` is: otherwise the only way to change an allowance in
13354
+ // production is a code deploy plus a seed-version bump.
13355
+ rekor_ops_tenths_included: external_exports.number().int().min(0).optional(),
13356
+ rekor_max_records: external_exports.number().int().min(0).optional(),
13357
+ rekor_import_rows_included: external_exports.number().int().min(0).optional(),
13358
+ rekor_production_bases: external_exports.number().int().min(0).max(1).optional()
12922
13359
  }).strip().refine(
12923
13360
  (data) => Object.keys(data).length > 0,
12924
13361
  { message: "No fields to update" }
@@ -13535,7 +13972,9 @@ var init_dist = __esm({
13535
13972
  /** Subdir of `wsDir` holding hub folders. */
13536
13973
  hubsSubdir: "hubs",
13537
13974
  /** Subdir of `wsDir` holding org-as-code. */
13538
- orgSubdir: "org"
13975
+ orgSubdir: "org",
13976
+ /** Subdir of `wsDir` holding base folders. */
13977
+ basesSubdir: "bases"
13539
13978
  };
13540
13979
  }
13541
13980
  });
@@ -13556,10 +13995,12 @@ function resolveLayout(gitRoot, layout = WAYAI_LAYOUT) {
13556
13995
  const legacyOrg = path.join(gitRoot, layout.legacy.orgAtRoot);
13557
13996
  const newExists = isDirectory(newWs);
13558
13997
  const legacyExists = isDirectory(legacyWs) || isDirectory(legacyOrg);
13998
+ const basesDir = path.join(newWs, layout.basesSubdir);
13559
13999
  if (newExists) {
13560
14000
  return {
13561
14001
  hubsDir: path.join(newWs, layout.hubsSubdir),
13562
14002
  orgDir: path.join(newWs, layout.orgSubdir),
14003
+ basesDir,
13563
14004
  isLegacy: false,
13564
14005
  legacyAlsoPresent: legacyExists
13565
14006
  };
@@ -13568,6 +14009,7 @@ function resolveLayout(gitRoot, layout = WAYAI_LAYOUT) {
13568
14009
  return {
13569
14010
  hubsDir: legacyWs,
13570
14011
  orgDir: legacyOrg,
14012
+ basesDir,
13571
14013
  isLegacy: true,
13572
14014
  legacyAlsoPresent: false
13573
14015
  };
@@ -13575,10 +14017,14 @@ function resolveLayout(gitRoot, layout = WAYAI_LAYOUT) {
13575
14017
  return {
13576
14018
  hubsDir: path.join(newWs, layout.hubsSubdir),
13577
14019
  orgDir: path.join(newWs, layout.orgSubdir),
14020
+ basesDir,
13578
14021
  isLegacy: false,
13579
14022
  legacyAlsoPresent: false
13580
14023
  };
13581
14024
  }
14025
+ function resolveBasesDir(gitRoot) {
14026
+ return resolveLayout(gitRoot).basesDir;
14027
+ }
13582
14028
  function hubsDirLabel(gitRoot) {
13583
14029
  if (!gitRoot) return path.join(WAYAI_LAYOUT.wsDir, WAYAI_LAYOUT.hubsSubdir);
13584
14030
  return path.relative(gitRoot, resolveLayout(gitRoot).hubsDir);
@@ -14271,6 +14717,290 @@ var init_utils = __esm({
14271
14717
  }
14272
14718
  });
14273
14719
 
14720
+ // src/data/registry.ts
14721
+ function isDataNamespace(command2) {
14722
+ return command2 !== void 0 && DATA_NAMESPACES.includes(command2);
14723
+ }
14724
+ var COMMAND_SURVIVAL, DATA_NAMESPACES;
14725
+ var init_registry = __esm({
14726
+ "src/data/registry.ts"() {
14727
+ "use strict";
14728
+ COMMAND_SURVIVAL = [
14729
+ // --- Clause 1: deleted. One keyring login, one status, one CLI self-update. ---
14730
+ {
14731
+ original: "login",
14732
+ disposition: "deleted",
14733
+ surviving: null,
14734
+ clause: 1,
14735
+ shipped: true,
14736
+ reason: "One keyring login. WayAI's `login` and `~/.wayai/config.json` are the survivors."
14737
+ },
14738
+ {
14739
+ original: "logout",
14740
+ disposition: "deleted",
14741
+ surviving: null,
14742
+ clause: 1,
14743
+ shipped: true,
14744
+ reason: "One session to clear."
14745
+ },
14746
+ {
14747
+ original: "whoami",
14748
+ disposition: "deleted",
14749
+ surviving: null,
14750
+ clause: 1,
14751
+ shipped: true,
14752
+ reason: "One authenticated identity."
14753
+ },
14754
+ {
14755
+ original: "status",
14756
+ disposition: "deleted",
14757
+ surviving: null,
14758
+ clause: 1,
14759
+ shipped: true,
14760
+ reason: "One auth/connectivity status."
14761
+ },
14762
+ {
14763
+ original: "init",
14764
+ disposition: "deleted",
14765
+ surviving: null,
14766
+ clause: 1,
14767
+ shipped: true,
14768
+ reason: "One root org binding (`.wayai.yaml`), so one `init`."
14769
+ },
14770
+ {
14771
+ original: "update",
14772
+ disposition: "deleted",
14773
+ surviving: null,
14774
+ clause: 1,
14775
+ shipped: true,
14776
+ reason: "One binary, one self-update."
14777
+ },
14778
+ // --- Clause 2: top-level ontology entities WayAI owns no concept of. ---
14779
+ {
14780
+ original: "bases",
14781
+ disposition: "top-level",
14782
+ surviving: "bases",
14783
+ clause: 2,
14784
+ shipped: true,
14785
+ reason: "The ontology root entity. No WayAI command of this name."
14786
+ },
14787
+ {
14788
+ original: "records",
14789
+ disposition: "top-level",
14790
+ surviving: "records",
14791
+ clause: 2,
14792
+ shipped: false,
14793
+ reason: "Ontology entity. No WayAI command of this name."
14794
+ },
14795
+ {
14796
+ original: "record-types",
14797
+ disposition: "top-level",
14798
+ surviving: "record-types",
14799
+ clause: 2,
14800
+ shipped: false,
14801
+ reason: "Ontology entity."
14802
+ },
14803
+ {
14804
+ original: "relationships",
14805
+ disposition: "top-level",
14806
+ surviving: "relationships",
14807
+ clause: 2,
14808
+ shipped: false,
14809
+ reason: "Ontology entity."
14810
+ },
14811
+ {
14812
+ original: "relationship-types",
14813
+ disposition: "top-level",
14814
+ surviving: "relationship-types",
14815
+ clause: 2,
14816
+ shipped: false,
14817
+ reason: "Ontology entity."
14818
+ },
14819
+ {
14820
+ original: "query-relationships",
14821
+ disposition: "top-level",
14822
+ surviving: "query-relationships",
14823
+ clause: 2,
14824
+ shipped: false,
14825
+ reason: "Ontology traversal over relationships."
14826
+ },
14827
+ {
14828
+ original: "files",
14829
+ disposition: "top-level",
14830
+ surviving: "files",
14831
+ clause: 2,
14832
+ shipped: false,
14833
+ reason: "Unambiguous: WayAI has no `files` command \u2014 hub-local resource files are reached through hub config-as-code, and the two file surfaces stay deliberately separate."
14834
+ },
14835
+ {
14836
+ original: "file-types",
14837
+ disposition: "top-level",
14838
+ surviving: "file-types",
14839
+ clause: 2,
14840
+ shipped: false,
14841
+ reason: "Ontology entity."
14842
+ },
14843
+ {
14844
+ original: "attachments",
14845
+ disposition: "top-level",
14846
+ surviving: "attachments",
14847
+ clause: 2,
14848
+ shipped: false,
14849
+ reason: "Ontology entity."
14850
+ },
14851
+ {
14852
+ original: "toolsets",
14853
+ disposition: "top-level",
14854
+ surviving: "toolsets",
14855
+ clause: 2,
14856
+ shipped: false,
14857
+ reason: "Ontology entity."
14858
+ },
14859
+ {
14860
+ original: "actions",
14861
+ disposition: "top-level",
14862
+ surviving: "actions",
14863
+ clause: 2,
14864
+ shipped: false,
14865
+ reason: "Ontology entity."
14866
+ },
14867
+ {
14868
+ original: "triggers",
14869
+ disposition: "top-level",
14870
+ surviving: "triggers",
14871
+ clause: 2,
14872
+ shipped: false,
14873
+ reason: "Ontology entity."
14874
+ },
14875
+ {
14876
+ original: "inbound-webhooks",
14877
+ disposition: "top-level",
14878
+ surviving: "inbound-webhooks",
14879
+ clause: 2,
14880
+ shipped: false,
14881
+ reason: "Ontology entity."
14882
+ },
14883
+ {
14884
+ original: "seed",
14885
+ disposition: "top-level",
14886
+ surviving: "seed",
14887
+ clause: 2,
14888
+ shipped: false,
14889
+ reason: "Ontology entity. `wayai status` vs `wayai seed lease status` differ by depth, not by word."
14890
+ },
14891
+ // --- Clause 3: namespaced. ---
14892
+ {
14893
+ original: "use",
14894
+ disposition: "namespaced",
14895
+ surviving: "bases use",
14896
+ clause: 3,
14897
+ shipped: true,
14898
+ reason: "WayAI's `use` binds a hub; this binds a base."
14899
+ },
14900
+ {
14901
+ original: "unbind",
14902
+ disposition: "namespaced",
14903
+ surviving: "bases unbind",
14904
+ clause: 3,
14905
+ shipped: true,
14906
+ reason: "WayAI's `unbind` clears the hub binding; this clears the base binding."
14907
+ },
14908
+ {
14909
+ original: "bases promote",
14910
+ disposition: "namespaced",
14911
+ surviving: "bases promote",
14912
+ clause: 3,
14913
+ shipped: true,
14914
+ reason: "Already namespaced; kept verbatim. Distinct from `wayai publish` (hub production) \u2014 the two promote words stay distinct."
14915
+ },
14916
+ {
14917
+ original: "tokens",
14918
+ disposition: "namespaced",
14919
+ surviving: "bases tokens",
14920
+ clause: 3,
14921
+ shipped: false,
14922
+ reason: "Mints base tokens; WayAI's own token surface mints platform tokens."
14923
+ },
14924
+ {
14925
+ original: "secrets",
14926
+ disposition: "namespaced",
14927
+ surviving: "bases secrets",
14928
+ clause: 3,
14929
+ shipped: false,
14930
+ reason: "Base org vault; WayAI has connection credentials."
14931
+ },
14932
+ {
14933
+ original: "sql",
14934
+ disposition: "namespaced",
14935
+ surviving: "bases sql",
14936
+ clause: 3,
14937
+ shipped: false,
14938
+ reason: "WayAI already has tenant SQL over conversation analytics."
14939
+ },
14940
+ {
14941
+ original: "import",
14942
+ disposition: "namespaced",
14943
+ surviving: "bases import",
14944
+ clause: 3,
14945
+ shipped: false,
14946
+ reason: "WayAI has outbound-contact import."
14947
+ },
14948
+ {
14949
+ original: "batch",
14950
+ disposition: "namespaced",
14951
+ surviving: "bases batch",
14952
+ clause: 3,
14953
+ shipped: false,
14954
+ reason: "Too generic to stand alone."
14955
+ },
14956
+ {
14957
+ original: "providers",
14958
+ disposition: "namespaced",
14959
+ surviving: "bases providers",
14960
+ clause: 3,
14961
+ shipped: false,
14962
+ reason: "WayAI's provider is a connector."
14963
+ },
14964
+ {
14965
+ original: "admin",
14966
+ disposition: "namespaced",
14967
+ surviving: "admin bases",
14968
+ clause: 3,
14969
+ shipped: false,
14970
+ reason: "Clause 3's group exception: `wayai admin` is an existing group with its own gating and subgroups, so the operator surface joins it as a peer rather than sitting under `bases`."
14971
+ },
14972
+ {
14973
+ original: "report",
14974
+ disposition: "namespaced",
14975
+ surviving: "bases report",
14976
+ clause: 3,
14977
+ shipped: false,
14978
+ reason: "Two report queues still exist, so the merged CLI must be able to file to either. The two collapse when the queues do."
14979
+ },
14980
+ // --- Neither: one verb each, routing by workspace subtree. ---
14981
+ {
14982
+ original: "pull",
14983
+ disposition: "routed",
14984
+ surviving: "pull",
14985
+ clause: null,
14986
+ shipped: false,
14987
+ reason: "One verb, workspace-relative, routing by subtree: `hubs/` targets preview hubs, `bases/` targets preview bases. An invocation spanning both is refused, never merged."
14988
+ },
14989
+ {
14990
+ original: "push",
14991
+ disposition: "routed",
14992
+ surviving: "push",
14993
+ clause: null,
14994
+ shipped: false,
14995
+ reason: "Same as `pull`."
14996
+ }
14997
+ ];
14998
+ DATA_NAMESPACES = COMMAND_SURVIVAL.filter(
14999
+ (c) => c.disposition === "top-level" && c.shipped
15000
+ ).map((c) => c.surviving);
15001
+ }
15002
+ });
15003
+
14274
15004
  // src/lib/version-cache.ts
14275
15005
  import { existsSync as existsSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync2, mkdirSync } from "fs";
14276
15006
  import { dirname as dirname3, join as join6 } from "path";
@@ -14280,9 +15010,9 @@ function getVersionCachePath(filename = CLI_CACHE_FILE) {
14280
15010
  }
14281
15011
  function readVersionCache(filename = CLI_CACHE_FILE) {
14282
15012
  try {
14283
- const path30 = getVersionCachePath(filename);
14284
- if (!existsSync4(path30)) return null;
14285
- const parsed = JSON.parse(readFileSync5(path30, "utf-8"));
15013
+ const path31 = getVersionCachePath(filename);
15014
+ if (!existsSync4(path31)) return null;
15015
+ const parsed = JSON.parse(readFileSync5(path31, "utf-8"));
14286
15016
  if (typeof parsed.lastCheck !== "number") return null;
14287
15017
  if (parsed.latest !== null && typeof parsed.latest !== "string") return null;
14288
15018
  return parsed;
@@ -14302,10 +15032,10 @@ function isVersionCacheStale(filename = CLI_CACHE_FILE, maxAgeMs = MAX_AGE_24H_M
14302
15032
  return Date.now() - cache.lastCheck > maxAgeMs;
14303
15033
  }
14304
15034
  function writeVersionCache(filename, cache) {
14305
- const path30 = getVersionCachePath(filename);
14306
- const dir = dirname3(path30);
15035
+ const path31 = getVersionCachePath(filename);
15036
+ const dir = dirname3(path31);
14307
15037
  if (!existsSync4(dir)) mkdirSync(dir, { recursive: true });
14308
- writeFileSync2(path30, JSON.stringify(cache));
15038
+ writeFileSync2(path31, JSON.stringify(cache));
14309
15039
  }
14310
15040
  function touchVersionCache(filename) {
14311
15041
  writeVersionCache(filename, { lastCheck: Date.now(), latest: readVersionCache(filename)?.latest ?? null });
@@ -14344,14 +15074,14 @@ function parseFrontmatterVersion(content) {
14344
15074
  function findInstalledSkills(projectRoot, paths = SKILL_INSTALL_PATHS) {
14345
15075
  const found = [];
14346
15076
  for (const rel of paths) {
14347
- const path30 = join7(projectRoot, rel);
14348
- if (!existsSync5(path30)) continue;
15077
+ const path31 = join7(projectRoot, rel);
15078
+ if (!existsSync5(path31)) continue;
14349
15079
  let version = null;
14350
15080
  try {
14351
- version = parseFrontmatterVersion(readFileSync6(path30, "utf-8"));
15081
+ version = parseFrontmatterVersion(readFileSync6(path31, "utf-8"));
14352
15082
  } catch {
14353
15083
  }
14354
- found.push({ path: path30, version });
15084
+ found.push({ path: path31, version });
14355
15085
  }
14356
15086
  return found;
14357
15087
  }
@@ -15227,7 +15957,7 @@ var init_logout = __esm({
15227
15957
  }
15228
15958
  });
15229
15959
 
15230
- // src/lib/hub-binding.ts
15960
+ // src/lib/worktree-binding.ts
15231
15961
  import { execFileSync as execFileSync2 } from "child_process";
15232
15962
  import * as fs7 from "fs";
15233
15963
  import * as path7 from "path";
@@ -15248,111 +15978,158 @@ function resolveGitDir() {
15248
15978
  _gitDirCache = { cwd, gitDir };
15249
15979
  return gitDir;
15250
15980
  }
15251
- function getBindingPath() {
15252
- const gitDir = resolveGitDir();
15253
- return gitDir ? path7.join(gitDir, BINDING_FILENAME) : null;
15254
- }
15255
- function getLegacyBindingPath() {
15256
- const gitDir = resolveGitDir();
15257
- return gitDir ? path7.join(gitDir, LEGACY_BINDING_FILENAME) : null;
15258
- }
15259
- function readBinding() {
15260
- for (const bindingPath of [getBindingPath(), getLegacyBindingPath()]) {
15261
- if (!bindingPath) continue;
15262
- let raw;
15981
+ function createWorktreeBinding(descriptor) {
15982
+ const {
15983
+ filename,
15984
+ legacyFilename,
15985
+ isValidId,
15986
+ noun,
15987
+ idLabel,
15988
+ unbindCommand: unbindCommand2,
15989
+ useCommand: useCommand2
15990
+ } = descriptor;
15991
+ function getBindingPath2() {
15992
+ const gitDir = resolveGitDir();
15993
+ return gitDir ? path7.join(gitDir, filename) : null;
15994
+ }
15995
+ function getLegacyBindingPath() {
15996
+ if (!legacyFilename) return null;
15997
+ const gitDir = resolveGitDir();
15998
+ return gitDir ? path7.join(gitDir, legacyFilename) : null;
15999
+ }
16000
+ function readBinding2() {
16001
+ for (const bindingPath of [getBindingPath2(), getLegacyBindingPath()]) {
16002
+ if (!bindingPath) continue;
16003
+ let raw;
16004
+ try {
16005
+ raw = fs7.readFileSync(bindingPath, "utf-8");
16006
+ } catch (err) {
16007
+ if (err.code === "ENOENT") continue;
16008
+ throw err;
16009
+ }
16010
+ const trimmed = raw.trim();
16011
+ return isValidId(trimmed) ? trimmed : null;
16012
+ }
16013
+ return null;
16014
+ }
16015
+ function removeLegacyBinding() {
16016
+ const legacyPath = getLegacyBindingPath();
16017
+ if (!legacyPath) return;
15263
16018
  try {
15264
- raw = fs7.readFileSync(bindingPath, "utf-8");
15265
- } catch (err) {
15266
- if (err.code === "ENOENT") continue;
15267
- throw err;
16019
+ fs7.unlinkSync(legacyPath);
16020
+ } catch {
15268
16021
  }
15269
- const trimmed = raw.trim();
15270
- return UUID_RE2.test(trimmed) ? trimmed : null;
15271
16022
  }
15272
- return null;
15273
- }
15274
- function writeBinding(hubId) {
15275
- if (!UUID_RE2.test(hubId)) {
15276
- throw new Error(`Invalid hub_id (must be a UUID): ${hubId}`);
16023
+ function writeBinding2(id) {
16024
+ if (!isValidId(id)) {
16025
+ throw new Error(`Invalid ${idLabel}: ${id}`);
16026
+ }
16027
+ const bindingPath = getBindingPath2();
16028
+ if (!bindingPath) {
16029
+ throw new Error(`Not inside a git repository \u2014 cannot write ${noun} binding.`);
16030
+ }
16031
+ fs7.writeFileSync(bindingPath, `${id}
16032
+ `, "utf-8");
16033
+ removeLegacyBinding();
15277
16034
  }
15278
- const bindingPath = getBindingPath();
15279
- if (!bindingPath) {
15280
- throw new Error("Not inside a git repository \u2014 cannot write hub binding.");
16035
+ function clearBinding2() {
16036
+ let removed = false;
16037
+ for (const bindingPath of [getBindingPath2(), getLegacyBindingPath()]) {
16038
+ if (!bindingPath) continue;
16039
+ try {
16040
+ fs7.unlinkSync(bindingPath);
16041
+ removed = true;
16042
+ } catch (err) {
16043
+ if (err.code !== "ENOENT") throw err;
16044
+ }
16045
+ }
16046
+ return removed;
15281
16047
  }
15282
- fs7.writeFileSync(bindingPath, `${hubId}
15283
- `, "utf-8");
15284
- removeLegacyBinding();
15285
- }
15286
- function removeLegacyBinding() {
15287
- const legacyPath = getLegacyBindingPath();
15288
- if (!legacyPath) return;
15289
- try {
15290
- fs7.unlinkSync(legacyPath);
15291
- } catch {
16048
+ function assertMatchesBinding(resolvedId, label) {
16049
+ const bound = readBinding2();
16050
+ if (!bound) return;
16051
+ if (bound === resolvedId) return;
16052
+ const target = label ? `${label} (${resolvedId})` : resolvedId;
16053
+ console.error(
16054
+ [
16055
+ `This worktree is bound to ${noun} ${bound}, but the command resolved to ${target}.`,
16056
+ "",
16057
+ "This usually means a prompt was routed to the wrong worktree.",
16058
+ "Confirm with the user before unbinding. To override:",
16059
+ ` ${unbindCommand2} # clear the binding for this worktree`,
16060
+ ` ${useCommand2} ${resolvedId} # rebind this worktree to the new ${noun}`
16061
+ ].join("\n")
16062
+ );
16063
+ process.exit(1);
15292
16064
  }
15293
- }
15294
- function clearBinding() {
15295
- let removed = false;
15296
- for (const bindingPath of [getBindingPath(), getLegacyBindingPath()]) {
15297
- if (!bindingPath) continue;
16065
+ function assertNoBindingBlocksCreation(newName) {
16066
+ const bound = readBinding2();
16067
+ if (!bound) return;
16068
+ console.error(
16069
+ [
16070
+ `This worktree is bound to ${noun} ${bound}, but you're about to create a new ${noun} "${newName}" here.`,
16071
+ "",
16072
+ "This usually means a prompt was routed to the wrong worktree.",
16073
+ "Confirm with the user before unbinding. To override:",
16074
+ ` ${unbindCommand2} # clear the binding for this worktree`
16075
+ ].join("\n")
16076
+ );
16077
+ process.exit(1);
16078
+ }
16079
+ function autoBindIfUnbound2(id) {
15298
16080
  try {
15299
- fs7.unlinkSync(bindingPath);
15300
- removed = true;
16081
+ if (readBinding2()) return false;
16082
+ writeBinding2(id);
16083
+ console.log(`Worktree bound to ${noun} ${id} (run \`${unbindCommand2}\` to clear).`);
16084
+ return true;
15301
16085
  } catch (err) {
15302
- if (err.code !== "ENOENT") throw err;
16086
+ console.warn(
16087
+ ` Warning: could not auto-bind worktree (${err instanceof Error ? err.message : String(err)})`
16088
+ );
16089
+ return false;
15303
16090
  }
15304
16091
  }
15305
- return removed;
15306
- }
15307
- function assertHubMatchesBinding(resolvedHubId, hubLabel) {
15308
- const bound = readBinding();
15309
- if (!bound) return;
15310
- if (bound === resolvedHubId) return;
15311
- const target = hubLabel ? `${hubLabel} (${resolvedHubId})` : resolvedHubId;
15312
- console.error(
15313
- [
15314
- `This worktree is bound to hub ${bound}, but the command resolved to ${target}.`,
15315
- "",
15316
- "This usually means a prompt was routed to the wrong worktree.",
15317
- "Confirm with the user before unbinding. To override:",
15318
- " wayai unbind # clear the binding for this worktree",
15319
- ` wayai use ${resolvedHubId} # rebind this worktree to the new hub`
15320
- ].join("\n")
15321
- );
15322
- process.exit(1);
16092
+ return {
16093
+ getBindingPath: getBindingPath2,
16094
+ readBinding: readBinding2,
16095
+ writeBinding: writeBinding2,
16096
+ clearBinding: clearBinding2,
16097
+ assertMatchesBinding,
16098
+ assertNoBindingBlocksCreation,
16099
+ autoBindIfUnbound: autoBindIfUnbound2
16100
+ };
15323
16101
  }
15324
- function autoBindIfUnbound(hubId) {
15325
- try {
15326
- if (readBinding()) return false;
15327
- writeBinding(hubId);
15328
- console.log(`Worktree bound to hub ${hubId} (run \`wayai unbind\` to clear).`);
15329
- return true;
15330
- } catch (err) {
15331
- console.warn(` Warning: could not auto-bind worktree (${err instanceof Error ? err.message : String(err)})`);
15332
- return false;
16102
+ var _gitDirCache;
16103
+ var init_worktree_binding = __esm({
16104
+ "src/lib/worktree-binding.ts"() {
16105
+ "use strict";
15333
16106
  }
15334
- }
15335
- function assertNoBindingBlocksHubCreation(newHubName) {
15336
- const bound = readBinding();
15337
- if (!bound) return;
15338
- console.error(
15339
- [
15340
- `This worktree is bound to hub ${bound}, but you're about to create a new hub "${newHubName}" here.`,
15341
- "",
15342
- "This usually means a prompt was routed to the wrong worktree.",
15343
- "Confirm with the user before unbinding. To override:",
15344
- " wayai unbind # clear the binding for this worktree"
15345
- ].join("\n")
15346
- );
15347
- process.exit(1);
15348
- }
15349
- var BINDING_FILENAME, LEGACY_BINDING_FILENAME, _gitDirCache;
16107
+ });
16108
+
16109
+ // src/lib/hub-binding.ts
16110
+ var binding, getBindingPath, readBinding, writeBinding, clearBinding, autoBindIfUnbound, assertHubMatchesBinding, assertNoBindingBlocksHubCreation;
15350
16111
  var init_hub_binding = __esm({
15351
16112
  "src/lib/hub-binding.ts"() {
15352
16113
  "use strict";
15353
16114
  init_utils();
15354
- BINDING_FILENAME = "wayai-binding";
15355
- LEGACY_BINDING_FILENAME = "wayai-lock";
16115
+ init_worktree_binding();
16116
+ binding = createWorktreeBinding({
16117
+ filename: "wayai-binding",
16118
+ // Pre-rename filename, from when this was called a "lock".
16119
+ legacyFilename: "wayai-lock",
16120
+ isValidId: (id) => UUID_RE2.test(id),
16121
+ noun: "hub",
16122
+ idLabel: "hub_id (must be a UUID)",
16123
+ unbindCommand: "wayai unbind",
16124
+ useCommand: "wayai use"
16125
+ });
16126
+ getBindingPath = binding.getBindingPath;
16127
+ readBinding = binding.readBinding;
16128
+ writeBinding = binding.writeBinding;
16129
+ clearBinding = binding.clearBinding;
16130
+ autoBindIfUnbound = binding.autoBindIfUnbound;
16131
+ assertHubMatchesBinding = binding.assertMatchesBinding;
16132
+ assertNoBindingBlocksHubCreation = binding.assertNoBindingBlocksCreation;
15356
16133
  }
15357
16134
  });
15358
16135
 
@@ -24050,14 +24827,538 @@ var init_update = __esm({
24050
24827
  }
24051
24828
  });
24052
24829
 
24830
+ // src/data/org-context.ts
24831
+ function setDataOrgOverride(orgId) {
24832
+ override = orgId;
24833
+ }
24834
+ function getDataOrgOverride() {
24835
+ return override;
24836
+ }
24837
+ var override;
24838
+ var init_org_context = __esm({
24839
+ "src/data/org-context.ts"() {
24840
+ "use strict";
24841
+ }
24842
+ });
24843
+
24844
+ // src/data/client.ts
24845
+ async function createDataClient(orgId) {
24846
+ const { config, accessToken } = await requireAuth();
24847
+ const api = new ApiClient({ apiUrl: config.api_url, accessToken });
24848
+ const selected = orgId ?? getDataOrgOverride();
24849
+ if (selected !== void 0 && !UUID_RE2.test(selected)) {
24850
+ throw expected(`Invalid --org: ${JSON.stringify(selected)}. Expected an organization UUID.`);
24851
+ }
24852
+ const org = selected ?? readRepoConfig()?.organization_id;
24853
+ return {
24854
+ async request(method, v1Path, body) {
24855
+ const envelope = await api.dataRequest(method, v1Path, body, org);
24856
+ return envelope.data;
24857
+ },
24858
+ async collectPages(makePath) {
24859
+ const all = [];
24860
+ const seen = /* @__PURE__ */ new Set();
24861
+ let cursor;
24862
+ for (let page = 0; page < MAX_PAGES; page++) {
24863
+ const { data, meta } = await api.dataRequest("GET", makePath(cursor), void 0, org);
24864
+ for (const row of data ?? []) all.push(row);
24865
+ cursor = meta?.has_more ? meta.cursor : void 0;
24866
+ if (cursor === void 0) break;
24867
+ if (seen.has(cursor)) break;
24868
+ seen.add(cursor);
24869
+ }
24870
+ return all;
24871
+ }
24872
+ };
24873
+ }
24874
+ var MAX_PAGES;
24875
+ var init_client = __esm({
24876
+ "src/data/client.ts"() {
24877
+ "use strict";
24878
+ init_auth();
24879
+ init_api_client();
24880
+ init_repo_config();
24881
+ init_utils();
24882
+ init_expected();
24883
+ init_org_context();
24884
+ MAX_PAGES = 1e3;
24885
+ }
24886
+ });
24887
+
24888
+ // src/data/output.ts
24889
+ function printOutput(data, format) {
24890
+ if (format === "json") {
24891
+ console.log(JSON.stringify(data, null, 2));
24892
+ return;
24893
+ }
24894
+ if (Array.isArray(data)) {
24895
+ printRows(data);
24896
+ return;
24897
+ }
24898
+ if (typeof data === "object" && data !== null) {
24899
+ printFields(data);
24900
+ return;
24901
+ }
24902
+ console.log(formatCell2(data));
24903
+ }
24904
+ function printRows(rows) {
24905
+ if (rows.length === 0) {
24906
+ console.log("(no results)");
24907
+ return;
24908
+ }
24909
+ const columns = [];
24910
+ const seen = /* @__PURE__ */ new Set();
24911
+ for (const row of rows) {
24912
+ for (const key of Object.keys(row ?? {})) {
24913
+ if (seen.has(key)) continue;
24914
+ seen.add(key);
24915
+ columns.push(key);
24916
+ }
24917
+ }
24918
+ const headers = columns.map((c) => sanitizeTerminalText(c));
24919
+ const cells = rows.map((row) => columns.map((c) => cellAt(row, c)));
24920
+ const widths = columns.map(
24921
+ (_, i) => cells.reduce((width, row) => Math.max(width, row[i].length), headers[i].length)
24922
+ );
24923
+ console.log(headers.map((c, i) => c.padEnd(widths[i])).join(" "));
24924
+ console.log(widths.map((w) => "-".repeat(w)).join(" "));
24925
+ for (const row of cells) {
24926
+ console.log(row.map((cell, i) => cell.padEnd(widths[i])).join(" "));
24927
+ }
24928
+ }
24929
+ function printFields(obj) {
24930
+ const entries = Object.entries(obj).map(([key, value]) => ({
24931
+ key: sanitizeTerminalText(key),
24932
+ value
24933
+ }));
24934
+ if (entries.length === 0) {
24935
+ console.log("(empty)");
24936
+ return;
24937
+ }
24938
+ const width = entries.reduce((w, e) => Math.max(w, e.key.length), 0);
24939
+ for (const { key, value } of entries) {
24940
+ console.log(`${key.padEnd(width)} ${formatCell2(value)}`);
24941
+ }
24942
+ }
24943
+ function cellAt(row, column) {
24944
+ return formatCell2(row?.[column]);
24945
+ }
24946
+ function formatCell2(value) {
24947
+ if (value === null || value === void 0) return "";
24948
+ if (typeof value === "object") return sanitizeTerminalText(JSON.stringify(value));
24949
+ return sanitizeTerminalText(String(value));
24950
+ }
24951
+ var init_output = __esm({
24952
+ "src/data/output.ts"() {
24953
+ "use strict";
24954
+ init_terminal_output();
24955
+ }
24956
+ });
24957
+
24958
+ // src/lib/base-id.ts
24959
+ function isValidBaseId(id) {
24960
+ return BASE_ID_RE.test(id);
24961
+ }
24962
+ var BASE_ID_RE;
24963
+ var init_base_id = __esm({
24964
+ "src/lib/base-id.ts"() {
24965
+ "use strict";
24966
+ BASE_ID_RE = /^(?!\.\.?$)[A-Za-z0-9._-]{1,256}$/;
24967
+ }
24968
+ });
24969
+
24970
+ // src/data/helpers.ts
24971
+ import { readFileSync as readFileSync19 } from "fs";
24972
+ function pathSegment(id, label = "id") {
24973
+ if (!isValidBaseId(id)) {
24974
+ throw expected(
24975
+ `Invalid ${label}: ${JSON.stringify(id)}. Ids are slugs \u2014 letters, digits, dot, dash and underscore only.`
24976
+ );
24977
+ }
24978
+ return encodeURIComponent(id);
24979
+ }
24980
+ function parseData(data) {
24981
+ if (data.startsWith("@")) {
24982
+ return JSON.parse(readFileSync19(data.slice(1), "utf-8"));
24983
+ }
24984
+ return JSON.parse(data);
24985
+ }
24986
+ function globals(cmd) {
24987
+ let namespace = cmd;
24988
+ while (namespace.parent?.parent) namespace = namespace.parent;
24989
+ return namespace.opts();
24990
+ }
24991
+ function outputFormat(cmd) {
24992
+ const opts = globals(cmd);
24993
+ return opts.json || opts.output === "json" ? "json" : "table";
24994
+ }
24995
+ function splitList(value) {
24996
+ return value.split(",").map((v) => v.trim()).filter((v) => v.length > 0);
24997
+ }
24998
+ var init_helpers = __esm({
24999
+ "src/data/helpers.ts"() {
25000
+ "use strict";
25001
+ init_base_id();
25002
+ init_expected();
25003
+ }
25004
+ });
25005
+
25006
+ // src/lib/base-binding.ts
25007
+ var binding2, getBaseBindingPath, readBaseBinding, writeBaseBinding, clearBaseBinding, autoBindBaseIfUnbound, assertBaseMatchesBinding, assertNoBindingBlocksBaseCreation;
25008
+ var init_base_binding = __esm({
25009
+ "src/lib/base-binding.ts"() {
25010
+ "use strict";
25011
+ init_base_id();
25012
+ init_worktree_binding();
25013
+ binding2 = createWorktreeBinding({
25014
+ filename: "wayai-base-binding",
25015
+ isValidId: isValidBaseId,
25016
+ noun: "base",
25017
+ idLabel: "base id (must be a slug)",
25018
+ unbindCommand: "wayai bases unbind",
25019
+ useCommand: "wayai bases use"
25020
+ });
25021
+ getBaseBindingPath = binding2.getBindingPath;
25022
+ readBaseBinding = binding2.readBinding;
25023
+ writeBaseBinding = binding2.writeBinding;
25024
+ clearBaseBinding = binding2.clearBinding;
25025
+ autoBindBaseIfUnbound = binding2.autoBindIfUnbound;
25026
+ assertBaseMatchesBinding = binding2.assertMatchesBinding;
25027
+ assertNoBindingBlocksBaseCreation = binding2.assertNoBindingBlocksCreation;
25028
+ }
25029
+ });
25030
+
25031
+ // src/data/commands/bases.ts
25032
+ import { Command } from "commander";
25033
+ import * as fs24 from "fs";
25034
+ import * as path30 from "path";
25035
+ import * as yaml9 from "js-yaml";
25036
+ function pageOf(path31, cursor) {
25037
+ if (!cursor) return path31;
25038
+ return `${path31}${path31.includes("?") ? "&" : "?"}cursor=${encodeURIComponent(cursor)}`;
25039
+ }
25040
+ function parseEnum(flag, value, allowed) {
25041
+ if (value === void 0) return void 0;
25042
+ if (!allowed.includes(value)) {
25043
+ throw expected(`${flag} must be one of: ${allowed.join(", ")}.`);
25044
+ }
25045
+ return value;
25046
+ }
25047
+ function buildBasesCommand() {
25048
+ const bases = new Command("bases").description("Manage bases");
25049
+ bases.command("list").description("List all bases").option("--tag <tag>", "Filter by tag").action(async function(opts) {
25050
+ const client = await createDataClient();
25051
+ const qs = opts.tag ? `?tag=${encodeURIComponent(opts.tag)}` : "";
25052
+ printOutput(
25053
+ await client.collectPages((cursor) => pageOf(`/v1/bases${qs}`, cursor)),
25054
+ outputFormat(this)
25055
+ );
25056
+ });
25057
+ bases.command("get <id>").description("Get a base").action(async function(id) {
25058
+ const client = await createDataClient();
25059
+ printOutput(await client.request("GET", `/v1/bases/${pathSegment(id)}`), outputFormat(this));
25060
+ });
25061
+ bases.command("create <id>").description("Create a base").requiredOption("--name <name>", "Base name").option("--description <desc>", "Description").option("--tags <tags>", "Comma-separated tags (e.g. client:acme,billing)").option(
25062
+ "--timezone <tz>",
25063
+ "Default IANA timezone for datetime canonicalization (e.g. America/Sao_Paulo); a record type's own timezone overrides it"
25064
+ ).option(
25065
+ "--environment <env>",
25066
+ "production (default) | preview. Production bases require a paid plan. A preview created here has no production origin and cannot be given one later, so it cannot be promoted directly \u2014 move its config to a linked preview with pull/push when you upgrade"
25067
+ ).action(async function(id, opts) {
25068
+ const environment = parseEnum("--environment", opts.environment, [
25069
+ "production",
25070
+ "preview"
25071
+ ]);
25072
+ const client = await createDataClient();
25073
+ const body = { name: opts.name, description: opts.description };
25074
+ if (environment) body.environment = environment;
25075
+ if (opts.tags) body.tags = splitList(opts.tags);
25076
+ if (opts.timezone) body.settings = { timezone: opts.timezone };
25077
+ printOutput(await client.request("PUT", `/v1/bases/${pathSegment(id)}`, body), outputFormat(this));
25078
+ });
25079
+ bases.command("update <id>").description(
25080
+ "Update a base's mutable config (display name, description, tags, default timezone/settings). The id/slug is immutable."
25081
+ ).option("--name <name>", "New display name").option("--description <desc>", "Description").option("--tags <tags>", "Comma-separated tags \u2014 replaces the existing tags").option(
25082
+ "--timezone <tz>",
25083
+ "Default IANA timezone for datetime canonicalization. Merges into existing settings."
25084
+ ).option(
25085
+ "--settings <json>",
25086
+ "Raw settings JSON object (inline JSON or @file.json) \u2014 replaces the entire settings object"
25087
+ ).option(
25088
+ "--integrations <mode>",
25089
+ "enabled | disabled. Preview-only: `disabled` neutralizes every external integration edge so the seeded preview behaves natively for production-safe agent evals"
25090
+ ).action(async function(id, opts) {
25091
+ const integrations = parseEnum("--integrations", opts.integrations, ["enabled", "disabled"]);
25092
+ if (opts.name === void 0 && opts.description === void 0 && opts.tags === void 0 && opts.timezone === void 0 && opts.settings === void 0 && integrations === void 0) {
25093
+ throw expected(
25094
+ "Nothing to update. Provide at least one of --name, --description, --tags, --timezone, --settings, --integrations."
25095
+ );
25096
+ }
25097
+ const client = await createDataClient();
25098
+ const body = {};
25099
+ if (opts.name !== void 0) body.name = opts.name;
25100
+ if (opts.description !== void 0) body.description = opts.description;
25101
+ if (opts.tags !== void 0) body.tags = splitList(opts.tags);
25102
+ if (integrations !== void 0) body.integrations = integrations;
25103
+ if (opts.settings !== void 0 || opts.timezone !== void 0) {
25104
+ let settings;
25105
+ if (opts.settings !== void 0) {
25106
+ let parsed;
25107
+ try {
25108
+ parsed = parseData(opts.settings);
25109
+ } catch (e) {
25110
+ throw expected(`--settings: ${e instanceof Error ? e.message : "could not be read as JSON"}`);
25111
+ }
25112
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
25113
+ throw expected("--settings must be a valid JSON object");
25114
+ }
25115
+ settings = parsed;
25116
+ } else {
25117
+ const existing = await client.request("GET", `/v1/bases/${pathSegment(id)}`);
25118
+ settings = { ...existing?.settings ?? {} };
25119
+ }
25120
+ if (opts.timezone !== void 0) settings.timezone = opts.timezone;
25121
+ body.settings = settings;
25122
+ }
25123
+ printOutput(await client.request("PUT", `/v1/bases/${pathSegment(id)}`, body), outputFormat(this));
25124
+ });
25125
+ bases.command("rename <id>").description(
25126
+ "Rename a base's display name (the id/slug is immutable \u2014 it scopes token grants, MCP endpoints, and references)"
25127
+ ).requiredOption("--name <name>", "New display name").action(async function(id, opts) {
25128
+ const client = await createDataClient();
25129
+ printOutput(
25130
+ await client.request("PUT", `/v1/bases/${pathSegment(id)}`, { name: opts.name }),
25131
+ outputFormat(this)
25132
+ );
25133
+ });
25134
+ bases.command("tag <id>").description("Set tags on a base").requiredOption("--tags <tags>", "Comma-separated tags (e.g. client:acme,billing)").action(async function(id, opts) {
25135
+ const client = await createDataClient();
25136
+ printOutput(
25137
+ await client.request("PUT", `/v1/bases/${pathSegment(id)}`, { tags: splitList(opts.tags) }),
25138
+ outputFormat(this)
25139
+ );
25140
+ });
25141
+ bases.command("delete <id>").description(
25142
+ "Delete a base. By default this is a tombstone: the base stops being listed, but its storage is retained and recreating the id restores it. Add --purge (preview bases only) to also reclaim the storage"
25143
+ ).option("-y, --yes", "Skip confirmation prompt").option(
25144
+ "--purge",
25145
+ "Preview bases only. Permanently destroy the stored records, relationships, file metadata and config of this base instead of tombstoning it. The id is then retired and cannot be recreated"
25146
+ ).action(async function(id, opts) {
25147
+ const prompt3 = opts.purge ? `Purge base "${id}"? Its records, relationships, file metadata and config are destroyed permanently, and the id "${id}" is retired for good.` : `Delete base "${id}"? This cannot be undone.`;
25148
+ if (!opts.yes && !await confirm(prompt3)) {
25149
+ console.log("Aborted");
25150
+ return;
25151
+ }
25152
+ const client = await createDataClient();
25153
+ await client.request("DELETE", `/v1/bases/${pathSegment(id)}${opts.purge ? "?purge=true" : ""}`);
25154
+ printOutput({ id, deleted: true, purged: opts.purge === true }, outputFormat(this));
25155
+ });
25156
+ bases.command("create-preview <origin-id>").description(
25157
+ "Create a preview base by cloning the config of another base. The origin may be a production base or another preview; the new preview id is <origin-id>--<name>, linked to the origin it was cloned from (so a preview of a preview promotes through that origin, never straight to production)"
25158
+ ).requiredOption("--name <name>", "Preview base name").option("--description <desc>", "Description").option(
25159
+ "--integrations <mode>",
25160
+ "enabled (default) | disabled. `disabled` makes this preview a seeded, production-safe agent-eval target: every external integration edge is inert and it behaves natively"
25161
+ ).option(
25162
+ "--create-only",
25163
+ "Fail with 409 if the derived preview id already exists, instead of re-applying config onto it. Use for per-session ephemeral bases, where landing on a live sibling would corrupt both runs"
25164
+ ).action(async function(originId, opts) {
25165
+ const integrations = parseEnum("--integrations", opts.integrations, ["enabled", "disabled"]);
25166
+ const client = await createDataClient();
25167
+ printOutput(
25168
+ await client.request("POST", `/v1/${pathSegment(originId, "origin base id")}/preview`, {
25169
+ name: opts.name,
25170
+ description: opts.description,
25171
+ ...integrations !== void 0 ? { integrations } : {},
25172
+ ...opts.createOnly ? { create_only: true } : {}
25173
+ }),
25174
+ outputFormat(this)
25175
+ );
25176
+ });
25177
+ bases.command("list-previews <origin-id>").description("List preview bases cloned from a base (production or preview)").action(async function(originId) {
25178
+ const client = await createDataClient();
25179
+ const path31 = `/v1/${pathSegment(originId, "origin base id")}/previews`;
25180
+ printOutput(
25181
+ await client.collectPages((cursor) => pageOf(path31, cursor)),
25182
+ outputFormat(this)
25183
+ );
25184
+ });
25185
+ bases.command("promote <production-id>").description("Promote config from a preview base to production (human-only)").requiredOption("--from <preview-id>", "Source preview base id").option("--dry-run", "Show what would change without applying").option("--record-types <ids>", "Comma-separated record type ids to promote", splitList).option("--triggers <ids>", "Comma-separated trigger ids to promote", splitList).option("--inbound-webhooks <ids>", "Comma-separated inbound webhook ids to promote", splitList).action(async function(productionId, opts) {
25186
+ const client = await createDataClient();
25187
+ const data = await client.request("POST", `/v1/${pathSegment(productionId, "production base id")}/promote`, {
25188
+ source_base_id: opts.from,
25189
+ dry_run: opts.dryRun ?? false,
25190
+ record_types: opts.recordTypes,
25191
+ triggers: opts.triggers,
25192
+ inbound_webhooks: opts.inboundWebhooks
25193
+ });
25194
+ printOutput(data, outputFormat(this));
25195
+ const warnings = data?.source_credential_warnings ?? [];
25196
+ if (warnings.length > 0) {
25197
+ console.warn(
25198
+ "\nExternal source credentials are NOT carried over by promotion \u2014 set these on production before the source will work:"
25199
+ );
25200
+ for (const w of warnings) console.warn(` - ${sanitizeTerminalText(w.message)}`);
25201
+ }
25202
+ });
25203
+ bases.command("rollback <production-id>").description("Roll back a promotion (human-only)").requiredOption("--promotion <promotion-id>", "Promotion id to roll back").action(async function(productionId, opts) {
25204
+ const client = await createDataClient();
25205
+ printOutput(
25206
+ await client.request("POST", `/v1/${pathSegment(productionId, "production base id")}/promote/rollback`, {
25207
+ promotion_id: opts.promotion
25208
+ }),
25209
+ outputFormat(this)
25210
+ );
25211
+ });
25212
+ bases.command("promotions <production-id>").description("List promotion history for a production base").action(async function(productionId) {
25213
+ const client = await createDataClient();
25214
+ const path31 = `/v1/${pathSegment(productionId, "production base id")}/promotions`;
25215
+ printOutput(
25216
+ await client.collectPages((cursor) => pageOf(path31, cursor)),
25217
+ outputFormat(this)
25218
+ );
25219
+ });
25220
+ bases.command("use <base>").description(
25221
+ "Bind this worktree to a base so push/pull refuse to run against a different one"
25222
+ ).action(async function(selector) {
25223
+ const baseId = resolveSelectorToBaseId(selector);
25224
+ const previous = readBaseBinding();
25225
+ if (previous !== baseId) {
25226
+ try {
25227
+ writeBaseBinding(baseId);
25228
+ } catch (err) {
25229
+ throw expected(err instanceof Error ? err.message : String(err));
25230
+ }
25231
+ }
25232
+ if (outputFormat(this) === "json") {
25233
+ printOutput({ base_id: baseId, previous_base_id: previous, changed: previous !== baseId }, "json");
25234
+ return;
25235
+ }
25236
+ if (previous === baseId) {
25237
+ console.log(`Worktree already bound to base ${baseId}.`);
25238
+ } else {
25239
+ console.log(
25240
+ previous ? `Worktree rebound: ${previous} -> ${baseId}.` : `Worktree bound to base ${baseId}.`
25241
+ );
25242
+ }
25243
+ });
25244
+ bases.command("unbind").description("Clear the base binding for this worktree").action(async function() {
25245
+ const previous = readBaseBinding();
25246
+ if (previous) clearBaseBinding();
25247
+ if (outputFormat(this) === "json") {
25248
+ printOutput({ previous_base_id: previous, cleared: previous !== null }, "json");
25249
+ return;
25250
+ }
25251
+ console.log(
25252
+ previous ? `Worktree unbound from base (was: ${previous}).` : "No base binding to clear."
25253
+ );
25254
+ });
25255
+ return bases;
25256
+ }
25257
+ function resolveSelectorToBaseId(selector) {
25258
+ const gitRoot = findGitRoot();
25259
+ if (!gitRoot || selector.includes("/") || selector.includes(path30.sep)) return selector;
25260
+ if (!isValidBaseId(selector)) return selector;
25261
+ const metaPath = path30.join(resolveBasesDir(gitRoot), selector, BASE_META_FILE);
25262
+ let meta;
25263
+ try {
25264
+ meta = yaml9.load(fs24.readFileSync(metaPath, "utf-8"));
25265
+ } catch {
25266
+ return selector;
25267
+ }
25268
+ const id = meta?.[BASE_ID_FIELD];
25269
+ return typeof id === "string" && isValidBaseId(id) ? id : selector;
25270
+ }
25271
+ var BASE_META_FILE, BASE_ID_FIELD;
25272
+ var init_bases = __esm({
25273
+ "src/data/commands/bases.ts"() {
25274
+ "use strict";
25275
+ init_client();
25276
+ init_output();
25277
+ init_helpers();
25278
+ init_utils();
25279
+ init_terminal_output();
25280
+ init_workspace();
25281
+ init_layout();
25282
+ init_base_binding();
25283
+ init_base_id();
25284
+ init_expected();
25285
+ BASE_META_FILE = "base.yaml";
25286
+ BASE_ID_FIELD = "base_id";
25287
+ }
25288
+ });
25289
+
25290
+ // src/data/program.ts
25291
+ var program_exports = {};
25292
+ __export(program_exports, {
25293
+ DATA_NAMESPACES: () => DATA_NAMESPACES,
25294
+ buildDataProgram: () => buildDataProgram,
25295
+ isDataNamespace: () => isDataNamespace,
25296
+ runDataCommand: () => runDataCommand,
25297
+ withBaseOption: () => withBaseOption,
25298
+ withDataGlobals: () => withDataGlobals
25299
+ });
25300
+ import { Command as Command2 } from "commander";
25301
+ function withDataGlobals(command2) {
25302
+ return command2.option("--org <uuid>", "Organization to operate against (overrides .wayai.yaml)").option("--output <format>", "Output format: json or table", "table").option("--json", "Shorthand for --output json");
25303
+ }
25304
+ function withBaseOption(command2) {
25305
+ return command2.option("--base <id>", "Base id (or set WAYAI_BASE)");
25306
+ }
25307
+ function routeErrorsToCli(command2) {
25308
+ command2.exitOverride().configureOutput({ outputError: () => {
25309
+ } });
25310
+ for (const child of command2.commands) routeErrorsToCli(child);
25311
+ return command2;
25312
+ }
25313
+ function buildDataProgram() {
25314
+ const program = new Command2("wayai");
25315
+ program.addCommand(withDataGlobals(buildBasesCommand()));
25316
+ program.hook("preAction", (_thisCommand, actionCommand) => {
25317
+ setDataOrgOverride(globals(actionCommand).org);
25318
+ });
25319
+ return routeErrorsToCli(program);
25320
+ }
25321
+ async function runDataCommand(namespace, args2) {
25322
+ if (!isDataNamespace(namespace)) {
25323
+ throw new Error(`Not a Data command: ${namespace}`);
25324
+ }
25325
+ const program = buildDataProgram();
25326
+ try {
25327
+ await program.parseAsync(["node", "wayai", namespace, ...args2]);
25328
+ } catch (err) {
25329
+ const { code, exitCode } = err ?? {};
25330
+ if (code === "commander.helpDisplayed" || code === "commander.version") return;
25331
+ if (code === "commander.help") {
25332
+ process.exitCode = exitCode || 1;
25333
+ return;
25334
+ }
25335
+ if (typeof code === "string" && code.startsWith("commander.")) {
25336
+ throw expected(err instanceof Error ? err.message : String(err));
25337
+ }
25338
+ throw err;
25339
+ }
25340
+ }
25341
+ var init_program = __esm({
25342
+ "src/data/program.ts"() {
25343
+ "use strict";
25344
+ init_bases();
25345
+ init_helpers();
25346
+ init_expected();
25347
+ init_org_context();
25348
+ init_registry();
25349
+ init_registry();
25350
+ }
25351
+ });
25352
+
24053
25353
  // src/index.ts
24054
25354
  init_sentry();
24055
25355
  init_errors2();
24056
25356
  init_mask_secrets();
24057
25357
  init_utils();
24058
- import { readFileSync as readFileSync19 } from "fs";
25358
+ init_registry();
25359
+ import { readFileSync as readFileSync21 } from "fs";
24059
25360
  import { fileURLToPath as fileURLToPath2 } from "url";
24060
- import { dirname as dirname9, join as join27 } from "path";
25361
+ import { dirname as dirname9, join as join28 } from "path";
24061
25362
 
24062
25363
  // src/lib/version-refresh.ts
24063
25364
  init_version_cache();
@@ -24213,12 +25514,12 @@ Run \`wayai admin skill install\` to update.`);
24213
25514
 
24214
25515
  // src/index.ts
24215
25516
  var __dirname = dirname9(fileURLToPath2(import.meta.url));
24216
- var pkg = JSON.parse(readFileSync19(join27(__dirname, "..", "package.json"), "utf-8"));
25517
+ var pkg = JSON.parse(readFileSync21(join28(__dirname, "..", "package.json"), "utf-8"));
24217
25518
  var [, , command, ...args] = process.argv;
24218
25519
  var isBackgroundRefresh = command === REFRESH_COMMAND;
24219
25520
  if (!isBackgroundRefresh) initSentry(command, pkg.version);
24220
25521
  async function main() {
24221
- if (shouldInterceptHelp(command, args, OWN_HELP_COMMANDS)) {
25522
+ if (shouldInterceptHelp(command, args, /* @__PURE__ */ new Set([...OWN_HELP_COMMANDS, ...DATA_NAMESPACES]))) {
24222
25523
  printHelp3();
24223
25524
  return;
24224
25525
  }
@@ -24417,10 +25718,16 @@ async function main() {
24417
25718
  case "-v":
24418
25719
  console.log(pkg.version);
24419
25720
  break;
24420
- default:
25721
+ default: {
25722
+ const { isDataNamespace: isDataNamespace2, runDataCommand: runDataCommand2 } = await Promise.resolve().then(() => (init_program(), program_exports));
25723
+ if (isDataNamespace2(command)) {
25724
+ await runDataCommand2(command, args);
25725
+ break;
25726
+ }
24421
25727
  console.error(`Unknown command: ${command}`);
24422
25728
  printHelp3();
24423
25729
  process.exit(1);
25730
+ }
24424
25731
  }
24425
25732
  }
24426
25733
  function printHelp3() {
@@ -24471,6 +25778,13 @@ Commands:
24471
25778
  report edit Amend your own pending report (title/description/error/steps/context)
24472
25779
  update Update CLI to the latest version
24473
25780
 
25781
+ Data (bases):
25782
+ bases Manage bases (list/get/create/update/delete, previews, promote)
25783
+ bases promote Promote a preview base to production (distinct from \`publish\`, which promotes a hub)
25784
+ bases use <base> Bind this worktree to a base (\`wayai use\` binds a hub)
25785
+ bases unbind Clear this worktree's base binding
25786
+ Run \`wayai bases --help\` for the full tree.
25787
+
24474
25788
  Flags:
24475
25789
  --yes, -y Skip confirmation prompts (useful for CI and scripting)
24476
25790
  --hub <uuid|name> Target hub when the workspace has more than one (push, pull, diff, replicate, relabel, publish)