@wayai/cli 0.3.130 → 0.3.132

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, path31) {
444
+ function addApiBreadcrumb(method, path30) {
445
445
  if (!initialized) return;
446
446
  Sentry.addBreadcrumb({
447
447
  category: "http",
448
- message: `${method} ${path31}`,
448
+ message: `${method} ${path30}`,
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: path31, errorMaps, issueData } = params;
903
- const fullPath = [...path31, ...issueData.path || []];
902
+ const { data, path: path30, errorMaps, issueData } = params;
903
+ const fullPath = [...path30, ...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, path31, key) {
1214
+ constructor(parent, value, path30, key) {
1215
1215
  this._cachedPath = [];
1216
1216
  this.parent = parent;
1217
1217
  this.data = value;
1218
- this._path = path31;
1218
+ this._path = path30;
1219
1219
  this._key = key;
1220
1220
  }
1221
1221
  get path() {
@@ -4684,12 +4684,12 @@ function typeMatches(typeField, allowed) {
4684
4684
  if (Array.isArray(typeField)) return typeField.every((t) => typeof t === "string" && allowed.has(t));
4685
4685
  return false;
4686
4686
  }
4687
- function validateSchema(schema, path31, errors, opts = {}) {
4687
+ function validateSchema(schema, path30, errors, opts = {}) {
4688
4688
  if (typeof schema === "boolean") return;
4689
4689
  const depth = opts.depth ?? 0;
4690
4690
  if (depth > MAX_SCHEMA_DEPTH) {
4691
4691
  errors.push({
4692
- path: path31 || "<root>",
4692
+ path: path30 || "<root>",
4693
4693
  message: `schema nesting exceeds ${MAX_SCHEMA_DEPTH} levels`,
4694
4694
  suggestion: "Flatten the schema; LLM providers reject deeply nested tool input_schemas."
4695
4695
  });
@@ -4697,7 +4697,7 @@ function validateSchema(schema, path31, errors, opts = {}) {
4697
4697
  }
4698
4698
  if (!isRecord(schema)) {
4699
4699
  errors.push({
4700
- path: path31,
4700
+ path: path30,
4701
4701
  message: `expected object, got ${schema === null ? "null" : typeof schema}`
4702
4702
  });
4703
4703
  return;
@@ -4705,14 +4705,14 @@ function validateSchema(schema, path31, errors, opts = {}) {
4705
4705
  if (opts.isRoot) {
4706
4706
  if ("type" in schema && schema.type !== "object") {
4707
4707
  errors.push({
4708
- path: path31 ? `${path31}.type` : "type",
4708
+ path: path30 ? `${path30}.type` : "type",
4709
4709
  message: `root type must be 'object', got ${JSON.stringify(schema.type)}`,
4710
4710
  suggestion: "Tool parameters at the root must be an object: `{ type: 'object', properties: { ... } }`."
4711
4711
  });
4712
4712
  }
4713
4713
  } else if ("type" in schema && !typeMatches(schema.type, ALLOWED_TYPES)) {
4714
4714
  errors.push({
4715
- path: `${path31}.type`,
4715
+ path: `${path30}.type`,
4716
4716
  message: `type must be one of ${[...ALLOWED_TYPES].join("/")} or an array of those, got ${JSON.stringify(schema.type)}`
4717
4717
  });
4718
4718
  }
@@ -4722,25 +4722,25 @@ function validateSchema(schema, path31, errors, opts = {}) {
4722
4722
  const isPlaceholder = PLACEHOLDER_TOKENS.includes(e);
4723
4723
  const isOutcomePlaceholder = e === "[KANBAN_OUTCOME_VALUES]";
4724
4724
  errors.push({
4725
- path: `${path31}.enum`,
4725
+ path: `${path30}.enum`,
4726
4726
  message: `enum must be a non-empty array of primitives, got string ${JSON.stringify(e)}`,
4727
4727
  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"]`.'
4728
4728
  });
4729
4729
  } else if (!Array.isArray(e)) {
4730
4730
  errors.push({
4731
- path: `${path31}.enum`,
4731
+ path: `${path30}.enum`,
4732
4732
  message: `enum must be a non-empty array of primitives, got ${typeof e}`
4733
4733
  });
4734
4734
  } else if (e.length === 0) {
4735
4735
  errors.push({
4736
- path: `${path31}.enum`,
4736
+ path: `${path30}.enum`,
4737
4737
  message: "enum must not be empty"
4738
4738
  });
4739
4739
  } else {
4740
4740
  for (let i = 0; i < e.length; i++) {
4741
4741
  if (!isPrimitive(e[i])) {
4742
4742
  errors.push({
4743
- path: `${path31}.enum[${i}]`,
4743
+ path: `${path30}.enum[${i}]`,
4744
4744
  message: `enum entry must be a primitive (string/number/boolean/null), got ${typeof e[i]}`
4745
4745
  });
4746
4746
  }
@@ -4750,7 +4750,7 @@ function validateSchema(schema, path31, errors, opts = {}) {
4750
4750
  for (const key of ["exclusiveMinimum", "exclusiveMaximum"]) {
4751
4751
  if (key in schema && typeof schema[key] === "boolean") {
4752
4752
  errors.push({
4753
- path: `${path31}.${key}`,
4753
+ path: `${path30}.${key}`,
4754
4754
  message: `${key} as boolean is draft-04 syntax; draft 2020-12 requires a numeric value`,
4755
4755
  suggestion: `Replace with the numeric bound, e.g. \`${key}: 0\`.`
4756
4756
  });
@@ -4759,45 +4759,45 @@ function validateSchema(schema, path31, errors, opts = {}) {
4759
4759
  if ("properties" in schema) {
4760
4760
  if (!isRecord(schema.properties)) {
4761
4761
  errors.push({
4762
- path: `${path31}.properties`,
4762
+ path: `${path30}.properties`,
4763
4763
  message: `properties must be an object, got ${Array.isArray(schema.properties) ? "array" : typeof schema.properties}`
4764
4764
  });
4765
4765
  } else {
4766
4766
  for (const [propName, propSchema] of Object.entries(schema.properties)) {
4767
- validateSchema(propSchema, `${path31}.properties.${propName}`, errors, { depth: depth + 1 });
4767
+ validateSchema(propSchema, `${path30}.properties.${propName}`, errors, { depth: depth + 1 });
4768
4768
  }
4769
4769
  }
4770
4770
  }
4771
4771
  if (schemaTypeIncludes(schema, "array") && "items" in schema) {
4772
4772
  if (Array.isArray(schema.items)) {
4773
- schema.items.forEach((sub, i) => validateSchema(sub, `${path31}.items[${i}]`, errors, { depth: depth + 1 }));
4773
+ schema.items.forEach((sub, i) => validateSchema(sub, `${path30}.items[${i}]`, errors, { depth: depth + 1 }));
4774
4774
  } else {
4775
- validateSchema(schema.items, `${path31}.items`, errors, { depth: depth + 1 });
4775
+ validateSchema(schema.items, `${path30}.items`, errors, { depth: depth + 1 });
4776
4776
  }
4777
4777
  }
4778
4778
  for (const key of SUBSCHEMA_OBJECT_KEYWORDS) {
4779
4779
  if (key in schema && isRecord(schema[key])) {
4780
- validateSchema(schema[key], `${path31}.${key}`, errors, { depth: depth + 1 });
4780
+ validateSchema(schema[key], `${path30}.${key}`, errors, { depth: depth + 1 });
4781
4781
  }
4782
4782
  }
4783
4783
  for (const key of SUBSCHEMA_LIST_KEYWORDS) {
4784
4784
  const list = schema[key];
4785
4785
  if (Array.isArray(list)) {
4786
- list.forEach((sub, i) => validateSchema(sub, `${path31}.${key}[${i}]`, errors, { depth: depth + 1 }));
4786
+ list.forEach((sub, i) => validateSchema(sub, `${path30}.${key}[${i}]`, errors, { depth: depth + 1 }));
4787
4787
  }
4788
4788
  }
4789
4789
  for (const key of SUBSCHEMA_MAP_KEYWORDS) {
4790
4790
  const map = schema[key];
4791
4791
  if (isRecord(map)) {
4792
4792
  for (const [name, sub] of Object.entries(map)) {
4793
- validateSchema(sub, `${path31}.${key}.${name}`, errors, { depth: depth + 1 });
4793
+ validateSchema(sub, `${path30}.${key}.${name}`, errors, { depth: depth + 1 });
4794
4794
  }
4795
4795
  }
4796
4796
  }
4797
4797
  const reportedPaths = new Set(errors.map((e) => e.path));
4798
4798
  for (const [k, v] of Object.entries(schema)) {
4799
4799
  if (typeof v !== "string") continue;
4800
- const fieldPath = `${path31}.${k}`;
4800
+ const fieldPath = `${path30}.${k}`;
4801
4801
  if (reportedPaths.has(fieldPath)) continue;
4802
4802
  for (const token of PLACEHOLDER_TOKENS) {
4803
4803
  if (v === token) {
@@ -4942,8 +4942,8 @@ function evalInitialStateError(input) {
4942
4942
  const parsed = evalInitialStateEntry.safeParse(entries[i]);
4943
4943
  if (!parsed.success) {
4944
4944
  const issue = parsed.error.issues[0];
4945
- const path31 = issue?.path.join(".") || "?";
4946
- return `initial_state[${i}].${path31} is invalid: ${issue?.message ?? "malformed"}`;
4945
+ const path30 = issue?.path.join(".") || "?";
4946
+ return `initial_state[${i}].${path30} is invalid: ${issue?.message ?? "malformed"}`;
4947
4947
  }
4948
4948
  if (seenSlugs.has(parsed.data.slug)) {
4949
4949
  return `initial_state[${i}].slug "${parsed.data.slug}" is declared more than once`;
@@ -5013,44 +5013,6 @@ function unprovenRunCount(counts) {
5013
5013
  function terminalRunCount(counts) {
5014
5014
  return counts.successful_runs + counts.failed_runs;
5015
5015
  }
5016
- function isSafeTemplatePath(path31) {
5017
- if (path31.length === 0 || path31.length > 300) return false;
5018
- if (path31.startsWith("/") || path31.includes("\\")) return false;
5019
- const segments = path31.split("/");
5020
- return segments.every(
5021
- (seg) => seg.length > 0 && seg !== "." && seg !== ".." && /^[A-Za-z0-9._-]+$/.test(seg)
5022
- );
5023
- }
5024
- function dropTemplateKeys(value, drop) {
5025
- if (Array.isArray(value)) return value.map((v) => dropTemplateKeys(v, drop));
5026
- if (isPlainObject(value)) {
5027
- const out = {};
5028
- for (const [key, child] of Object.entries(value)) {
5029
- if (drop.has(key)) continue;
5030
- out[key] = TEMPLATE_OPAQUE_BLOB_KEYS.has(key) ? child : dropTemplateKeys(child, drop);
5031
- }
5032
- return out;
5033
- }
5034
- return value;
5035
- }
5036
- function stripTemplateInstanceIds(value) {
5037
- return dropTemplateKeys(value, TEMPLATE_INSTANCE_ID_KEYS);
5038
- }
5039
- function excludeTemplateAuthorData(value) {
5040
- return dropTemplateKeys(value, TEMPLATE_AUTHOR_DATA_KEYS);
5041
- }
5042
- function isPlainObject(value) {
5043
- if (value === null || typeof value !== "object") return false;
5044
- const proto = Object.getPrototypeOf(value);
5045
- return proto === Object.prototype || proto === null;
5046
- }
5047
- function isSanitizableSliceFile(path31) {
5048
- if (!/\.ya?ml$/i.test(path31)) return false;
5049
- return path31 !== "resources" && !path31.startsWith("resources/");
5050
- }
5051
- function distinctUsesBackends(uses) {
5052
- return [...new Set((uses ?? []).map((u) => u.backend))];
5053
- }
5054
5016
  function refineHubAsCodeCustomTools(config, ctx) {
5055
5017
  const agents = config.agents;
5056
5018
  if (!Array.isArray(agents)) return;
@@ -5169,10 +5131,10 @@ function refineHubAsCodeEvals(config, ctx) {
5169
5131
  function refineHubAsCodeEvalAttachments(config, ctx) {
5170
5132
  const cfg = config;
5171
5133
  const referencedHashes = /* @__PURE__ */ new Set();
5172
- const addTurnIssue = (path31, turn, name) => {
5134
+ const addTurnIssue = (path30, turn, name) => {
5173
5135
  const error = evalTurnAttachmentsError(turn);
5174
5136
  if (error) {
5175
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path31, message: `${name}: ${error}` });
5137
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path30, message: `${name}: ${error}` });
5176
5138
  return;
5177
5139
  }
5178
5140
  for (const hash of collectTurnAttachmentHashes(turn)) referencedHashes.add(hash);
@@ -5318,11 +5280,11 @@ function refineHubAsCodeDelegation(config, ctx) {
5318
5280
  }
5319
5281
  }
5320
5282
  if (del.context_boundary === void 0) return;
5321
- const path31 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
5283
+ const path30 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
5322
5284
  if (del.type !== "hub") {
5323
5285
  ctx.addIssue({
5324
5286
  code: external_exports.ZodIssueCode.custom,
5325
- path: path31,
5287
+ path: path30,
5326
5288
  message: `context_boundary applies only to \`type: hub\` delegations (got type "${String(del.type)}")`
5327
5289
  });
5328
5290
  return;
@@ -5330,14 +5292,14 @@ function refineHubAsCodeDelegation(config, ctx) {
5330
5292
  if (!CONTEXT_BOUNDARIES.includes(del.context_boundary)) {
5331
5293
  ctx.addIssue({
5332
5294
  code: external_exports.ZodIssueCode.custom,
5333
- path: path31,
5295
+ path: path30,
5334
5296
  message: `context_boundary must be one of: ${CONTEXT_BOUNDARIES.join(", ")}`
5335
5297
  });
5336
5298
  }
5337
5299
  });
5338
5300
  });
5339
5301
  }
5340
- 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, 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, 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, templateLocaleSchema, TEMPLATE_SLUG_REGEX, templateSlugSchema, templateStatusSchema, templateFileMapSchema, TEMPLATE_INSTANCE_ID_KEYS, TEMPLATE_OPAQUE_BLOB_KEYS, TEMPLATE_AUTHOR_DATA_KEYS, templateTextSchema, templateUsesEntrySchema, templateUsesSchema, templateYamlLocaleEntry, templateYamlWayaiBlock, templateTagsSchema, templateYamlSchema, templateHeroSchema, templatePushLocaleSchema, templatePushBody, templateListQuery, templateSlugParam, templateDetailQuery, courseQuizScoreSchema, upsertCourseLessonBody, linkCourseCapstoneBody, 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, discordTier, discordBillingCycle, discordMetadata, discordOAuthStartResponse, discordOAuthFinalizeBody, discordOAuthFinalizeResponse, discordDisconnectResponse, 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;
5302
+ 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, 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;
5341
5303
  var init_contracts = __esm({
5342
5304
  "../../packages/core/dist/contracts/index.js"() {
5343
5305
  "use strict";
@@ -5389,9 +5351,6 @@ var init_contracts = __esm({
5389
5351
  init_zod();
5390
5352
  init_zod();
5391
5353
  init_zod();
5392
- init_zod();
5393
- init_zod();
5394
- init_zod();
5395
5354
  uuidSchema = external_exports.string().uuid();
5396
5355
  paginationSchema = external_exports.object({
5397
5356
  limit: external_exports.coerce.number().int().min(1).max(100).default(50),
@@ -5512,6 +5471,8 @@ var init_contracts = __esm({
5512
5471
  SUPPORTED_LOCALES = ["en", "pt", "es"];
5513
5472
  SUMMARIZATION_THRESHOLD_MIN = 1e3;
5514
5473
  SUMMARIZATION_THRESHOLD_MAX = 1e6;
5474
+ PREVIOUS_CONVERSATIONS_MAX = 20;
5475
+ previousConversationsCountField = external_exports.number().int().min(0).max(PREVIOUS_CONVERSATIONS_MAX).nullable().optional();
5515
5476
  summarizationThresholdField = external_exports.number().int().min(SUMMARIZATION_THRESHOLD_MIN).max(SUMMARIZATION_THRESHOLD_MAX).nullable().optional();
5516
5477
  monitorConfigField = external_exports.object({
5517
5478
  delay_seconds: external_exports.number().int().min(10),
@@ -5538,11 +5499,13 @@ var init_contracts = __esm({
5538
5499
  agent_role: external_exports.enum(AGENT_ROLES),
5539
5500
  additional_context_template: external_exports.string().max(2e4).optional(),
5540
5501
  summarization_threshold_tokens: summarizationThresholdField,
5502
+ previous_conversations_count: previousConversationsCountField,
5541
5503
  monitor_config: monitorConfigField
5542
5504
  }).passthrough();
5543
5505
  updateAgentBody = external_exports.object({
5544
5506
  additional_context_template: external_exports.string().max(2e4).optional(),
5545
5507
  summarization_threshold_tokens: summarizationThresholdField,
5508
+ previous_conversations_count: previousConversationsCountField,
5546
5509
  monitor_config: monitorConfigField
5547
5510
  }).passthrough();
5548
5511
  AGENT_PARAMETER_TYPES = ["string", "number", "boolean", "integer", "enum"];
@@ -7091,153 +7054,6 @@ var init_contracts = __esm({
7091
7054
  /** Type-to-confirm value; must equal the user's email (constant-time compared). */
7092
7055
  email_confirmation: external_exports.string().min(1).max(320)
7093
7056
  });
7094
- templateLocaleSchema = external_exports.enum(SUPPORTED_LOCALES);
7095
- TEMPLATE_SLUG_REGEX = /^[a-z0-9][a-z0-9-]{0,62}$/;
7096
- templateSlugSchema = external_exports.string().regex(TEMPLATE_SLUG_REGEX, "slug must be lowercase alphanumeric with hyphens (max 63)");
7097
- templateStatusSchema = external_exports.enum(["published", "draft", "internal"]);
7098
- templateFileMapSchema = external_exports.record(external_exports.string()).refine((m) => Object.keys(m).every(isSafeTemplatePath), {
7099
- message: 'file map contains an unsafe path (no absolute paths, "..", or backslashes)'
7100
- });
7101
- TEMPLATE_INSTANCE_ID_KEYS = /* @__PURE__ */ new Set([
7102
- // Top-level hub instance metadata (hub.yaml) — set by `wayai pull`, never authored.
7103
- "hub_id",
7104
- "hub_environment",
7105
- "preview_label",
7106
- "branch_name",
7107
- // Per-entity row id + cross-entity reference UUIDs (each has a portable name twin).
7108
- "id",
7109
- "connection_id",
7110
- "target_id",
7111
- "agent_id",
7112
- "resource_id",
7113
- "list_id",
7114
- // Account-scoped Meta WhatsApp template id (name twin: `template_whatsapp`).
7115
- "template_whatsapp_id"
7116
- ]);
7117
- TEMPLATE_OPAQUE_BLOB_KEYS = /* @__PURE__ */ new Set([
7118
- "settings",
7119
- // agent + connection connector settings
7120
- "schema_json",
7121
- // agent response_format JSON Schema
7122
- "json_schema",
7123
- // state JSON Schema
7124
- "initial_value",
7125
- // state seed value
7126
- "additional_context_schema",
7127
- // kanban-status transition-form schema
7128
- "config",
7129
- // custom-tool OpenAI function schema
7130
- "headers",
7131
- "query_params",
7132
- "body_params",
7133
- // custom-tool HTTP shaping
7134
- "mappings",
7135
- // composed-tool argument mappings
7136
- "input",
7137
- "expected",
7138
- "history",
7139
- // eval message fixtures (tool_calls carry their own `id`)
7140
- "transcript",
7141
- "step_config"
7142
- // journey fixtures (transcript carries `step_id`; step_config is keyed by it)
7143
- ]);
7144
- TEMPLATE_AUTHOR_DATA_KEYS = /* @__PURE__ */ new Set([
7145
- // Outbound campaign subsystem (hub.yaml top-level). `outbound_contacts` is the
7146
- // author's real leads — `phone`/`email`/`instagram_sid` + the required `name` are
7147
- // GDPR-grade PII. `outbound_lists` group those contacts by real name. `outbound_schedules`
7148
- // bind to the (now-absent) lists and carry the author's campaign cadence + message
7149
- // copy — operationally tied to the author's customers; a consumer builds their own.
7150
- "outbound_contacts",
7151
- "outbound_lists",
7152
- "outbound_schedules",
7153
- // Account-scoped channel identifier on a connection (Twilio SID / WhatsApp number /
7154
- // IG username / from-email, per connector). The connection stays as portable
7155
- // structure re-bound by name on push; this author-account value carries no blueprint
7156
- // value. A dedicated top-level column — never nested in the `settings` opaque blob.
7157
- "account_sid"
7158
- ]);
7159
- templateTextSchema = external_exports.object({
7160
- metaTitle: external_exports.string().min(1).max(200),
7161
- metaDescription: external_exports.string().max(1e3).default("")
7162
- });
7163
- templateUsesEntrySchema = external_exports.object({
7164
- backend: templateSlugSchema,
7165
- endpoint: templateSlugSchema
7166
- });
7167
- templateUsesSchema = external_exports.array(templateUsesEntrySchema).max(24).default([]);
7168
- templateYamlLocaleEntry = templateTextSchema.extend({ source: external_exports.string().min(1) });
7169
- templateYamlWayaiBlock = external_exports.object({
7170
- installCommand: external_exports.string().min(1).max(300),
7171
- locales: external_exports.record(templateLocaleSchema, templateYamlLocaleEntry)
7172
- });
7173
- templateTagsSchema = external_exports.array(external_exports.string().min(1).max(30)).max(12).default([]).transform((tags) => [...new Set(tags.map((t) => t.trim().toLowerCase()).filter(Boolean))]);
7174
- templateYamlSchema = external_exports.object({
7175
- slug: templateSlugSchema,
7176
- category: external_exports.string().min(1).max(60),
7177
- tags: templateTagsSchema,
7178
- status: templateStatusSchema.default("draft"),
7179
- order: external_exports.number().int().min(0).max(1e5).optional(),
7180
- defaultLocale: templateLocaleSchema,
7181
- hero: external_exports.string().optional(),
7182
- // relative path to a hero image inside the template folder
7183
- // The Rekor backend(s) this channel runs on (gh #2955). Locale-agnostic. The
7184
- // cross-link + MCP endpoint are derived from each entry's slugs, never authored.
7185
- uses: templateUsesSchema,
7186
- // A WayAI template IS a WayAI channel — the wayai slice is required. (The old
7187
- // Rekor-only store entry is gone: a pure Rekor backend lives only in Rekor's store.)
7188
- wayai: templateYamlWayaiBlock
7189
- }).refine((c) => Boolean(c.wayai.locales[c.defaultLocale]), {
7190
- message: "`wayai.locales` must include the defaultLocale"
7191
- });
7192
- templateHeroSchema = external_exports.object({
7193
- filename: external_exports.string().min(1).max(200).regex(/\.(png|jpe?g|webp|gif)$/i, "hero must be a raster image (png/jpg/webp/gif)"),
7194
- dataBase64: external_exports.string().min(1).max(8e6)
7195
- });
7196
- templatePushLocaleSchema = external_exports.object({
7197
- wayai: templateTextSchema.optional(),
7198
- readmeMarkdown: external_exports.string().default(""),
7199
- wayaiFiles: templateFileMapSchema.optional()
7200
- });
7201
- templatePushBody = external_exports.object({
7202
- slug: templateSlugSchema,
7203
- defaultLocale: templateLocaleSchema,
7204
- common: external_exports.object({
7205
- category: external_exports.string().min(1).max(60),
7206
- tags: templateTagsSchema,
7207
- status: templateStatusSchema,
7208
- order: external_exports.number().int().min(0).max(1e5).default(0),
7209
- // The WayAI install command (a WayAI template always has a wayai side). Kept
7210
- // optional on the wire so a malformed manifest 400s on the field, not the body.
7211
- installCommand: external_exports.string().min(1).max(300).optional(),
7212
- hero: templateHeroSchema.optional(),
7213
- // The channel→backend edge (gh #2955), locale-agnostic.
7214
- uses: templateUsesSchema
7215
- }),
7216
- locales: external_exports.record(templateLocaleSchema, templatePushLocaleSchema)
7217
- }).refine((b) => Boolean(b.locales[b.defaultLocale]), {
7218
- message: "`locales` must include the defaultLocale"
7219
- });
7220
- templateListQuery = external_exports.object({ locale: templateLocaleSchema.optional() });
7221
- templateSlugParam = external_exports.object({ slug: templateSlugSchema });
7222
- templateDetailQuery = external_exports.object({ locale: templateLocaleSchema.optional() });
7223
- courseQuizScoreSchema = external_exports.object({
7224
- correct: external_exports.number().int().min(0).max(50),
7225
- total: external_exports.number().int().min(1).max(50),
7226
- /** Chosen choice index per question; -1 = unanswered. */
7227
- answers: external_exports.array(external_exports.number().int().min(-1).max(50)).max(50).optional()
7228
- });
7229
- upsertCourseLessonBody = external_exports.object({
7230
- quiz_passed: external_exports.boolean().optional(),
7231
- quiz_score: courseQuizScoreSchema.optional(),
7232
- content_version: external_exports.number().int().min(1)
7233
- }).strict();
7234
- linkCourseCapstoneBody = external_exports.object({
7235
- hub_id: external_exports.string().min(1).max(128),
7236
- // A capstone's slug IS a canonical template slug — reuse the one validator
7237
- // the template pipeline (CLI, admin, gallery) already enforces, so course
7238
- // linking can't drift from how real template slugs are shaped.
7239
- template_slug: templateSlugSchema.optional()
7240
- }).strict();
7241
7057
  archiveHubIdParam = external_exports.object({
7242
7058
  hubId: external_exports.string().uuid()
7243
7059
  });
@@ -8572,35 +8388,6 @@ var init_contracts = __esm({
8572
8388
  role: external_exports.enum(["org_admin", "admin", "team_user", "user"]),
8573
8389
  expires_at: external_exports.string().datetime()
8574
8390
  });
8575
- discordTier = external_exports.enum(["free", "pro", "pro_plus"]);
8576
- discordBillingCycle = external_exports.enum(["monthly", "annual"]);
8577
- discordMetadata = external_exports.object({
8578
- tier: discordTier,
8579
- billing_cycle: discordBillingCycle,
8580
- is_admin: external_exports.boolean()
8581
- });
8582
- discordOAuthStartResponse = external_exports.object({
8583
- url: external_exports.string().url()
8584
- });
8585
- discordOAuthFinalizeBody = external_exports.object({
8586
- code: external_exports.string().min(1, "code is required"),
8587
- state: external_exports.string().min(1, "state is required")
8588
- });
8589
- discordOAuthFinalizeResponse = external_exports.discriminatedUnion("ok", [
8590
- external_exports.object({
8591
- ok: external_exports.literal(true),
8592
- discord_user_id: external_exports.string(),
8593
- metadata: discordMetadata
8594
- }),
8595
- external_exports.object({
8596
- ok: external_exports.literal(false),
8597
- push_error: external_exports.literal("discord_unreachable"),
8598
- metadata: discordMetadata
8599
- })
8600
- ]);
8601
- discordDisconnectResponse = external_exports.object({
8602
- ok: external_exports.literal(true)
8603
- });
8604
8391
  jsonSchemaSchema = external_exports.record(external_exports.unknown());
8605
8392
  hubUserIdentity = external_exports.object({
8606
8393
  user_id: external_exports.string().nullable(),
@@ -8739,13 +8526,13 @@ var init_api_client = __esm({
8739
8526
  init_sentry();
8740
8527
  init_mask_secrets();
8741
8528
  RETRYABLE_BACKOFF_MS = [500, 1e3, 2e3];
8742
- delay = (ms) => new Promise((resolve6) => setTimeout(resolve6, ms));
8529
+ delay = (ms) => new Promise((resolve5) => setTimeout(resolve5, ms));
8743
8530
  ApiError = class extends Error {
8744
8531
  status;
8745
8532
  body;
8746
- constructor(method, path31, status, body) {
8533
+ constructor(method, path30, status, body) {
8747
8534
  const safeBody = maskSecretsInMessage(body);
8748
- super(`API request failed: ${method} ${path31} (${status}): ${safeBody}`);
8535
+ super(`API request failed: ${method} ${path30} (${status}): ${safeBody}`);
8749
8536
  this.name = "ApiError";
8750
8537
  this.status = status;
8751
8538
  this.body = safeBody;
@@ -8802,25 +8589,6 @@ var init_api_client = __esm({
8802
8589
  commit_sha: commitSha
8803
8590
  });
8804
8591
  }
8805
- // --- Templates gallery ---
8806
- // Consumer (any authed user): list the joint template set + pull the wayai slice.
8807
- // `locale` is optional — the server resolves to each template's defaultLocale when
8808
- // omitted, and falls back to it (with a resolvedLocale signal) when unauthored.
8809
- async templateList(locale) {
8810
- const qs = locale ? `?${new URLSearchParams({ locale })}` : "";
8811
- return this.request("GET", `/api/ci/templates${qs}`);
8812
- }
8813
- async templatePull(slug, locale) {
8814
- const qs = locale ? `?${new URLSearchParams({ locale })}` : "";
8815
- return this.request("GET", `/api/ci/templates/${encodeURIComponent(slug)}${qs}`);
8816
- }
8817
- // Author (platform-admin): push a template into the store / pull it for inspection.
8818
- async adminTemplatePush(body) {
8819
- return this.request("POST", "/api/admin/templates/push", body);
8820
- }
8821
- async adminTemplatePull(slug) {
8822
- return this.request("GET", `/api/admin/templates/${encodeURIComponent(slug)}`);
8823
- }
8824
8592
  // Download a private operator skill (platform-admin gated) for local install.
8825
8593
  async adminSkillInstall(name) {
8826
8594
  return this.request("GET", `/api/admin/skills/${encodeURIComponent(name)}`);
@@ -8863,8 +8631,8 @@ var init_api_client = __esm({
8863
8631
  ...opts?.check && { check: true }
8864
8632
  });
8865
8633
  }
8866
- async lookup(path31, opts) {
8867
- const params = new URLSearchParams({ path: path31 });
8634
+ async lookup(path30, opts) {
8635
+ const params = new URLSearchParams({ path: path30 });
8868
8636
  if (opts?.organizationId) params.set("organization_id", opts.organizationId);
8869
8637
  return this.request("GET", `/api/ci/lookup?${params.toString()}`);
8870
8638
  }
@@ -9285,9 +9053,9 @@ var init_api_client = __esm({
9285
9053
  * sandbox for this conversation, or the blob was purged).
9286
9054
  */
9287
9055
  async downloadArchiveSandboxFs(hubId, conversationId) {
9288
- const path31 = `/api/archive/${encodeURIComponent(hubId)}/conversations/${encodeURIComponent(conversationId)}/sandbox`;
9289
- addApiBreadcrumb("GET", path31);
9290
- const url = `${this.apiUrl}${path31}`;
9056
+ const path30 = `/api/archive/${encodeURIComponent(hubId)}/conversations/${encodeURIComponent(conversationId)}/sandbox`;
9057
+ addApiBreadcrumb("GET", path30);
9058
+ const url = `${this.apiUrl}${path30}`;
9291
9059
  let response = await this.send(url, "GET");
9292
9060
  if (response.status === 401 && this.onUnauthorized) {
9293
9061
  let refreshed;
@@ -9301,7 +9069,7 @@ var init_api_client = __esm({
9301
9069
  }
9302
9070
  }
9303
9071
  if (!response.ok) {
9304
- throw new ApiError("GET", path31, response.status, await response.text());
9072
+ throw new ApiError("GET", path30, response.status, await response.text());
9305
9073
  }
9306
9074
  return new Uint8Array(await response.arrayBuffer());
9307
9075
  }
@@ -9341,9 +9109,9 @@ var init_api_client = __esm({
9341
9109
  `/api/admin/data-explorer/debug/observability/${encodeURIComponent(hubId)}/conversations/${encodeURIComponent(conversationId)}${qs}`
9342
9110
  );
9343
9111
  }
9344
- async request(method, path31, body) {
9345
- addApiBreadcrumb(method, path31);
9346
- const url = `${this.apiUrl}${path31}`;
9112
+ async request(method, path30, body) {
9113
+ addApiBreadcrumb(method, path30);
9114
+ const url = `${this.apiUrl}${path30}`;
9347
9115
  let refreshedOn401 = false;
9348
9116
  for (let retry = 0; ; retry++) {
9349
9117
  let response = await this.send(url, method, body);
@@ -9367,7 +9135,7 @@ var init_api_client = __esm({
9367
9135
  await delay(RETRYABLE_BACKOFF_MS[retry]);
9368
9136
  continue;
9369
9137
  }
9370
- throw new ApiError(method, path31, response.status, errorBody);
9138
+ throw new ApiError(method, path30, response.status, errorBody);
9371
9139
  }
9372
9140
  }
9373
9141
  /** Issue a single authenticated request with the client's current token. */
@@ -9542,12 +9310,12 @@ function typeMatches2(typeField, allowed) {
9542
9310
  if (Array.isArray(typeField)) return typeField.every((t) => typeof t === "string" && allowed.has(t));
9543
9311
  return false;
9544
9312
  }
9545
- function validateSchema2(schema, path31, errors, opts = {}) {
9313
+ function validateSchema2(schema, path30, errors, opts = {}) {
9546
9314
  if (typeof schema === "boolean") return;
9547
9315
  const depth = opts.depth ?? 0;
9548
9316
  if (depth > MAX_SCHEMA_DEPTH2) {
9549
9317
  errors.push({
9550
- path: path31 || "<root>",
9318
+ path: path30 || "<root>",
9551
9319
  message: `schema nesting exceeds ${MAX_SCHEMA_DEPTH2} levels`,
9552
9320
  suggestion: "Flatten the schema; LLM providers reject deeply nested tool input_schemas."
9553
9321
  });
@@ -9555,7 +9323,7 @@ function validateSchema2(schema, path31, errors, opts = {}) {
9555
9323
  }
9556
9324
  if (!isRecord2(schema)) {
9557
9325
  errors.push({
9558
- path: path31,
9326
+ path: path30,
9559
9327
  message: `expected object, got ${schema === null ? "null" : typeof schema}`
9560
9328
  });
9561
9329
  return;
@@ -9563,14 +9331,14 @@ function validateSchema2(schema, path31, errors, opts = {}) {
9563
9331
  if (opts.isRoot) {
9564
9332
  if ("type" in schema && schema.type !== "object") {
9565
9333
  errors.push({
9566
- path: path31 ? `${path31}.type` : "type",
9334
+ path: path30 ? `${path30}.type` : "type",
9567
9335
  message: `root type must be 'object', got ${JSON.stringify(schema.type)}`,
9568
9336
  suggestion: "Tool parameters at the root must be an object: `{ type: 'object', properties: { ... } }`."
9569
9337
  });
9570
9338
  }
9571
9339
  } else if ("type" in schema && !typeMatches2(schema.type, ALLOWED_TYPES2)) {
9572
9340
  errors.push({
9573
- path: `${path31}.type`,
9341
+ path: `${path30}.type`,
9574
9342
  message: `type must be one of ${[...ALLOWED_TYPES2].join("/")} or an array of those, got ${JSON.stringify(schema.type)}`
9575
9343
  });
9576
9344
  }
@@ -9580,25 +9348,25 @@ function validateSchema2(schema, path31, errors, opts = {}) {
9580
9348
  const isPlaceholder = PLACEHOLDER_TOKENS2.includes(e);
9581
9349
  const isOutcomePlaceholder = e === "[KANBAN_OUTCOME_VALUES]";
9582
9350
  errors.push({
9583
- path: `${path31}.enum`,
9351
+ path: `${path30}.enum`,
9584
9352
  message: `enum must be a non-empty array of primitives, got string ${JSON.stringify(e)}`,
9585
9353
  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"]`.'
9586
9354
  });
9587
9355
  } else if (!Array.isArray(e)) {
9588
9356
  errors.push({
9589
- path: `${path31}.enum`,
9357
+ path: `${path30}.enum`,
9590
9358
  message: `enum must be a non-empty array of primitives, got ${typeof e}`
9591
9359
  });
9592
9360
  } else if (e.length === 0) {
9593
9361
  errors.push({
9594
- path: `${path31}.enum`,
9362
+ path: `${path30}.enum`,
9595
9363
  message: "enum must not be empty"
9596
9364
  });
9597
9365
  } else {
9598
9366
  for (let i = 0; i < e.length; i++) {
9599
9367
  if (!isPrimitive2(e[i])) {
9600
9368
  errors.push({
9601
- path: `${path31}.enum[${i}]`,
9369
+ path: `${path30}.enum[${i}]`,
9602
9370
  message: `enum entry must be a primitive (string/number/boolean/null), got ${typeof e[i]}`
9603
9371
  });
9604
9372
  }
@@ -9608,7 +9376,7 @@ function validateSchema2(schema, path31, errors, opts = {}) {
9608
9376
  for (const key of ["exclusiveMinimum", "exclusiveMaximum"]) {
9609
9377
  if (key in schema && typeof schema[key] === "boolean") {
9610
9378
  errors.push({
9611
- path: `${path31}.${key}`,
9379
+ path: `${path30}.${key}`,
9612
9380
  message: `${key} as boolean is draft-04 syntax; draft 2020-12 requires a numeric value`,
9613
9381
  suggestion: `Replace with the numeric bound, e.g. \`${key}: 0\`.`
9614
9382
  });
@@ -9617,45 +9385,45 @@ function validateSchema2(schema, path31, errors, opts = {}) {
9617
9385
  if ("properties" in schema) {
9618
9386
  if (!isRecord2(schema.properties)) {
9619
9387
  errors.push({
9620
- path: `${path31}.properties`,
9388
+ path: `${path30}.properties`,
9621
9389
  message: `properties must be an object, got ${Array.isArray(schema.properties) ? "array" : typeof schema.properties}`
9622
9390
  });
9623
9391
  } else {
9624
9392
  for (const [propName, propSchema] of Object.entries(schema.properties)) {
9625
- validateSchema2(propSchema, `${path31}.properties.${propName}`, errors, { depth: depth + 1 });
9393
+ validateSchema2(propSchema, `${path30}.properties.${propName}`, errors, { depth: depth + 1 });
9626
9394
  }
9627
9395
  }
9628
9396
  }
9629
9397
  if (schemaTypeIncludes2(schema, "array") && "items" in schema) {
9630
9398
  if (Array.isArray(schema.items)) {
9631
- schema.items.forEach((sub, i) => validateSchema2(sub, `${path31}.items[${i}]`, errors, { depth: depth + 1 }));
9399
+ schema.items.forEach((sub, i) => validateSchema2(sub, `${path30}.items[${i}]`, errors, { depth: depth + 1 }));
9632
9400
  } else {
9633
- validateSchema2(schema.items, `${path31}.items`, errors, { depth: depth + 1 });
9401
+ validateSchema2(schema.items, `${path30}.items`, errors, { depth: depth + 1 });
9634
9402
  }
9635
9403
  }
9636
9404
  for (const key of SUBSCHEMA_OBJECT_KEYWORDS2) {
9637
9405
  if (key in schema && isRecord2(schema[key])) {
9638
- validateSchema2(schema[key], `${path31}.${key}`, errors, { depth: depth + 1 });
9406
+ validateSchema2(schema[key], `${path30}.${key}`, errors, { depth: depth + 1 });
9639
9407
  }
9640
9408
  }
9641
9409
  for (const key of SUBSCHEMA_LIST_KEYWORDS2) {
9642
9410
  const list = schema[key];
9643
9411
  if (Array.isArray(list)) {
9644
- list.forEach((sub, i) => validateSchema2(sub, `${path31}.${key}[${i}]`, errors, { depth: depth + 1 }));
9412
+ list.forEach((sub, i) => validateSchema2(sub, `${path30}.${key}[${i}]`, errors, { depth: depth + 1 }));
9645
9413
  }
9646
9414
  }
9647
9415
  for (const key of SUBSCHEMA_MAP_KEYWORDS2) {
9648
9416
  const map = schema[key];
9649
9417
  if (isRecord2(map)) {
9650
9418
  for (const [name, sub] of Object.entries(map)) {
9651
- validateSchema2(sub, `${path31}.${key}.${name}`, errors, { depth: depth + 1 });
9419
+ validateSchema2(sub, `${path30}.${key}.${name}`, errors, { depth: depth + 1 });
9652
9420
  }
9653
9421
  }
9654
9422
  }
9655
9423
  const reportedPaths = new Set(errors.map((e) => e.path));
9656
9424
  for (const [k, v] of Object.entries(schema)) {
9657
9425
  if (typeof v !== "string") continue;
9658
- const fieldPath = `${path31}.${k}`;
9426
+ const fieldPath = `${path30}.${k}`;
9659
9427
  if (reportedPaths.has(fieldPath)) continue;
9660
9428
  for (const token of PLACEHOLDER_TOKENS2) {
9661
9429
  if (v === token) {
@@ -9800,8 +9568,8 @@ function evalInitialStateError2(input) {
9800
9568
  const parsed = evalInitialStateEntry2.safeParse(entries[i]);
9801
9569
  if (!parsed.success) {
9802
9570
  const issue = parsed.error.issues[0];
9803
- const path31 = issue?.path.join(".") || "?";
9804
- return `initial_state[${i}].${path31} is invalid: ${issue?.message ?? "malformed"}`;
9571
+ const path30 = issue?.path.join(".") || "?";
9572
+ return `initial_state[${i}].${path30} is invalid: ${issue?.message ?? "malformed"}`;
9805
9573
  }
9806
9574
  if (seenSlugs.has(parsed.data.slug)) {
9807
9575
  return `initial_state[${i}].slug "${parsed.data.slug}" is declared more than once`;
@@ -9862,14 +9630,6 @@ function collectTurnAttachmentHashes2(turn) {
9862
9630
  }
9863
9631
  return hashes;
9864
9632
  }
9865
- function isSafeTemplatePath2(path31) {
9866
- if (path31.length === 0 || path31.length > 300) return false;
9867
- if (path31.startsWith("/") || path31.includes("\\")) return false;
9868
- const segments = path31.split("/");
9869
- return segments.every(
9870
- (seg) => seg.length > 0 && seg !== "." && seg !== ".." && /^[A-Za-z0-9._-]+$/.test(seg)
9871
- );
9872
- }
9873
9633
  function foldDiacritics(input) {
9874
9634
  return input.normalize("NFKD").replace(/[̀-ͯ]/g, "");
9875
9635
  }
@@ -10014,10 +9774,10 @@ function refineHubAsCodeEvals2(config, ctx) {
10014
9774
  function refineHubAsCodeEvalAttachments2(config, ctx) {
10015
9775
  const cfg = config;
10016
9776
  const referencedHashes = /* @__PURE__ */ new Set();
10017
- const addTurnIssue = (path31, turn, name) => {
9777
+ const addTurnIssue = (path30, turn, name) => {
10018
9778
  const error = evalTurnAttachmentsError2(turn);
10019
9779
  if (error) {
10020
- ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path31, message: `${name}: ${error}` });
9780
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path30, message: `${name}: ${error}` });
10021
9781
  return;
10022
9782
  }
10023
9783
  for (const hash of collectTurnAttachmentHashes2(turn)) referencedHashes.add(hash);
@@ -10163,11 +9923,11 @@ function refineHubAsCodeDelegation2(config, ctx) {
10163
9923
  }
10164
9924
  }
10165
9925
  if (del.context_boundary === void 0) return;
10166
- const path31 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
9926
+ const path30 = ["agents", agentIndex, "tools", "delegation", delIndex, "context_boundary"];
10167
9927
  if (del.type !== "hub") {
10168
9928
  ctx.addIssue({
10169
9929
  code: external_exports.ZodIssueCode.custom,
10170
- path: path31,
9930
+ path: path30,
10171
9931
  message: `context_boundary applies only to \`type: hub\` delegations (got type "${String(del.type)}")`
10172
9932
  });
10173
9933
  return;
@@ -10175,7 +9935,7 @@ function refineHubAsCodeDelegation2(config, ctx) {
10175
9935
  if (!CONTEXT_BOUNDARIES2.includes(del.context_boundary)) {
10176
9936
  ctx.addIssue({
10177
9937
  code: external_exports.ZodIssueCode.custom,
10178
- path: path31,
9938
+ path: path30,
10179
9939
  message: `context_boundary must be one of: ${CONTEXT_BOUNDARIES2.join(", ")}`
10180
9940
  });
10181
9941
  }
@@ -10221,7 +9981,7 @@ function findStepBoundaries(transcript) {
10221
9981
  }
10222
9982
  return out;
10223
9983
  }
10224
- 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, 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, 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, templateLocaleSchema2, TEMPLATE_SLUG_REGEX2, templateSlugSchema2, templateStatusSchema2, templateFileMapSchema2, templateTextSchema2, templateUsesEntrySchema2, templateUsesSchema2, templateYamlLocaleEntry2, templateYamlWayaiBlock2, templateTagsSchema2, templateYamlSchema2, templateHeroSchema2, templatePushLocaleSchema2, templatePushBody2, templateListQuery2, templateSlugParam2, templateDetailQuery2, courseQuizScoreSchema2, upsertCourseLessonBody2, linkCourseCapstoneBody2, 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, discordTier2, discordBillingCycle2, discordMetadata2, discordOAuthStartResponse2, discordOAuthFinalizeBody2, discordOAuthFinalizeResponse2, discordDisconnectResponse2, 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;
9984
+ 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, 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;
10225
9985
  var init_dist = __esm({
10226
9986
  "../../packages/core/dist/index.js"() {
10227
9987
  "use strict";
@@ -10273,9 +10033,6 @@ var init_dist = __esm({
10273
10033
  init_zod();
10274
10034
  init_zod();
10275
10035
  init_zod();
10276
- init_zod();
10277
- init_zod();
10278
- init_zod();
10279
10036
  UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
10280
10037
  HEX_RE = /^[0-9a-f]{16,}$/;
10281
10038
  WORKOS_ID_RE = /^(?:user|org)_[0-9A-HJKMNP-TV-Z]{26}$/;
@@ -10553,6 +10310,8 @@ var init_dist = __esm({
10553
10310
  });
10554
10311
  SUMMARIZATION_THRESHOLD_MIN2 = 1e3;
10555
10312
  SUMMARIZATION_THRESHOLD_MAX2 = 1e6;
10313
+ PREVIOUS_CONVERSATIONS_MAX2 = 20;
10314
+ previousConversationsCountField2 = external_exports.number().int().min(0).max(PREVIOUS_CONVERSATIONS_MAX2).nullable().optional();
10556
10315
  summarizationThresholdField2 = external_exports.number().int().min(SUMMARIZATION_THRESHOLD_MIN2).max(SUMMARIZATION_THRESHOLD_MAX2).nullable().optional();
10557
10316
  monitorConfigField2 = external_exports.object({
10558
10317
  delay_seconds: external_exports.number().int().min(10),
@@ -10579,11 +10338,13 @@ var init_dist = __esm({
10579
10338
  agent_role: external_exports.enum(AGENT_ROLES2),
10580
10339
  additional_context_template: external_exports.string().max(2e4).optional(),
10581
10340
  summarization_threshold_tokens: summarizationThresholdField2,
10341
+ previous_conversations_count: previousConversationsCountField2,
10582
10342
  monitor_config: monitorConfigField2
10583
10343
  }).passthrough();
10584
10344
  updateAgentBody2 = external_exports.object({
10585
10345
  additional_context_template: external_exports.string().max(2e4).optional(),
10586
10346
  summarization_threshold_tokens: summarizationThresholdField2,
10347
+ previous_conversations_count: previousConversationsCountField2,
10587
10348
  monitor_config: monitorConfigField2
10588
10349
  }).passthrough();
10589
10350
  AGENT_PARAMETER_TYPES2 = ["string", "number", "boolean", "integer", "enum"];
@@ -12131,95 +11892,6 @@ var init_dist = __esm({
12131
11892
  /** Type-to-confirm value; must equal the user's email (constant-time compared). */
12132
11893
  email_confirmation: external_exports.string().min(1).max(320)
12133
11894
  });
12134
- templateLocaleSchema2 = external_exports.enum(SUPPORTED_LOCALES2);
12135
- TEMPLATE_SLUG_REGEX2 = /^[a-z0-9][a-z0-9-]{0,62}$/;
12136
- templateSlugSchema2 = external_exports.string().regex(TEMPLATE_SLUG_REGEX2, "slug must be lowercase alphanumeric with hyphens (max 63)");
12137
- templateStatusSchema2 = external_exports.enum(["published", "draft", "internal"]);
12138
- templateFileMapSchema2 = external_exports.record(external_exports.string()).refine((m) => Object.keys(m).every(isSafeTemplatePath2), {
12139
- message: 'file map contains an unsafe path (no absolute paths, "..", or backslashes)'
12140
- });
12141
- templateTextSchema2 = external_exports.object({
12142
- metaTitle: external_exports.string().min(1).max(200),
12143
- metaDescription: external_exports.string().max(1e3).default("")
12144
- });
12145
- templateUsesEntrySchema2 = external_exports.object({
12146
- backend: templateSlugSchema2,
12147
- endpoint: templateSlugSchema2
12148
- });
12149
- templateUsesSchema2 = external_exports.array(templateUsesEntrySchema2).max(24).default([]);
12150
- templateYamlLocaleEntry2 = templateTextSchema2.extend({ source: external_exports.string().min(1) });
12151
- templateYamlWayaiBlock2 = external_exports.object({
12152
- installCommand: external_exports.string().min(1).max(300),
12153
- locales: external_exports.record(templateLocaleSchema2, templateYamlLocaleEntry2)
12154
- });
12155
- templateTagsSchema2 = external_exports.array(external_exports.string().min(1).max(30)).max(12).default([]).transform((tags) => [...new Set(tags.map((t) => t.trim().toLowerCase()).filter(Boolean))]);
12156
- templateYamlSchema2 = external_exports.object({
12157
- slug: templateSlugSchema2,
12158
- category: external_exports.string().min(1).max(60),
12159
- tags: templateTagsSchema2,
12160
- status: templateStatusSchema2.default("draft"),
12161
- order: external_exports.number().int().min(0).max(1e5).optional(),
12162
- defaultLocale: templateLocaleSchema2,
12163
- hero: external_exports.string().optional(),
12164
- // relative path to a hero image inside the template folder
12165
- // The Rekor backend(s) this channel runs on (gh #2955). Locale-agnostic. The
12166
- // cross-link + MCP endpoint are derived from each entry's slugs, never authored.
12167
- uses: templateUsesSchema2,
12168
- // A WayAI template IS a WayAI channel — the wayai slice is required. (The old
12169
- // Rekor-only store entry is gone: a pure Rekor backend lives only in Rekor's store.)
12170
- wayai: templateYamlWayaiBlock2
12171
- }).refine((c) => Boolean(c.wayai.locales[c.defaultLocale]), {
12172
- message: "`wayai.locales` must include the defaultLocale"
12173
- });
12174
- templateHeroSchema2 = external_exports.object({
12175
- filename: external_exports.string().min(1).max(200).regex(/\.(png|jpe?g|webp|gif)$/i, "hero must be a raster image (png/jpg/webp/gif)"),
12176
- dataBase64: external_exports.string().min(1).max(8e6)
12177
- });
12178
- templatePushLocaleSchema2 = external_exports.object({
12179
- wayai: templateTextSchema2.optional(),
12180
- readmeMarkdown: external_exports.string().default(""),
12181
- wayaiFiles: templateFileMapSchema2.optional()
12182
- });
12183
- templatePushBody2 = external_exports.object({
12184
- slug: templateSlugSchema2,
12185
- defaultLocale: templateLocaleSchema2,
12186
- common: external_exports.object({
12187
- category: external_exports.string().min(1).max(60),
12188
- tags: templateTagsSchema2,
12189
- status: templateStatusSchema2,
12190
- order: external_exports.number().int().min(0).max(1e5).default(0),
12191
- // The WayAI install command (a WayAI template always has a wayai side). Kept
12192
- // optional on the wire so a malformed manifest 400s on the field, not the body.
12193
- installCommand: external_exports.string().min(1).max(300).optional(),
12194
- hero: templateHeroSchema2.optional(),
12195
- // The channel→backend edge (gh #2955), locale-agnostic.
12196
- uses: templateUsesSchema2
12197
- }),
12198
- locales: external_exports.record(templateLocaleSchema2, templatePushLocaleSchema2)
12199
- }).refine((b) => Boolean(b.locales[b.defaultLocale]), {
12200
- message: "`locales` must include the defaultLocale"
12201
- });
12202
- templateListQuery2 = external_exports.object({ locale: templateLocaleSchema2.optional() });
12203
- templateSlugParam2 = external_exports.object({ slug: templateSlugSchema2 });
12204
- templateDetailQuery2 = external_exports.object({ locale: templateLocaleSchema2.optional() });
12205
- courseQuizScoreSchema2 = external_exports.object({
12206
- correct: external_exports.number().int().min(0).max(50),
12207
- total: external_exports.number().int().min(1).max(50),
12208
- /** Chosen choice index per question; -1 = unanswered. */
12209
- answers: external_exports.array(external_exports.number().int().min(-1).max(50)).max(50).optional()
12210
- });
12211
- upsertCourseLessonBody2 = external_exports.object({
12212
- quiz_passed: external_exports.boolean().optional(),
12213
- quiz_score: courseQuizScoreSchema2.optional(),
12214
- content_version: external_exports.number().int().min(1)
12215
- }).strict();
12216
- linkCourseCapstoneBody2 = external_exports.object({
12217
- hub_id: external_exports.string().min(1).max(128),
12218
- // A capstone's slug IS a canonical template slug — reuse the one validator
12219
- // the template pipeline (CLI, admin, gallery) already enforces, so course
12220
- // linking can't drift from how real template slugs are shaped.
12221
- template_slug: templateSlugSchema2.optional()
12222
- }).strict();
12223
11895
  archiveHubIdParam2 = external_exports.object({
12224
11896
  hubId: external_exports.string().uuid()
12225
11897
  });
@@ -13554,35 +13226,6 @@ var init_dist = __esm({
13554
13226
  role: external_exports.enum(["org_admin", "admin", "team_user", "user"]),
13555
13227
  expires_at: external_exports.string().datetime()
13556
13228
  });
13557
- discordTier2 = external_exports.enum(["free", "pro", "pro_plus"]);
13558
- discordBillingCycle2 = external_exports.enum(["monthly", "annual"]);
13559
- discordMetadata2 = external_exports.object({
13560
- tier: discordTier2,
13561
- billing_cycle: discordBillingCycle2,
13562
- is_admin: external_exports.boolean()
13563
- });
13564
- discordOAuthStartResponse2 = external_exports.object({
13565
- url: external_exports.string().url()
13566
- });
13567
- discordOAuthFinalizeBody2 = external_exports.object({
13568
- code: external_exports.string().min(1, "code is required"),
13569
- state: external_exports.string().min(1, "state is required")
13570
- });
13571
- discordOAuthFinalizeResponse2 = external_exports.discriminatedUnion("ok", [
13572
- external_exports.object({
13573
- ok: external_exports.literal(true),
13574
- discord_user_id: external_exports.string(),
13575
- metadata: discordMetadata2
13576
- }),
13577
- external_exports.object({
13578
- ok: external_exports.literal(false),
13579
- push_error: external_exports.literal("discord_unreachable"),
13580
- metadata: discordMetadata2
13581
- })
13582
- ]);
13583
- discordDisconnectResponse2 = external_exports.object({
13584
- ok: external_exports.literal(true)
13585
- });
13586
13229
  jsonSchemaSchema2 = external_exports.record(external_exports.unknown());
13587
13230
  hubUserIdentity2 = external_exports.object({
13588
13231
  user_id: external_exports.string().nullable(),
@@ -13746,12 +13389,6 @@ function resolveLayout(gitRoot, layout = WAYAI_LAYOUT) {
13746
13389
  legacyAlsoPresent: false
13747
13390
  };
13748
13391
  }
13749
- function resolveHubsDir(gitRoot) {
13750
- return resolveLayout(gitRoot).hubsDir;
13751
- }
13752
- function resolveTemplatesDir(gitRoot) {
13753
- return path.join(gitRoot, TEMPLATES_AUTHORING_SUBDIR);
13754
- }
13755
13392
  function hubsDirLabel(gitRoot) {
13756
13393
  if (!gitRoot) return path.join(WAYAI_LAYOUT.wsDir, WAYAI_LAYOUT.hubsSubdir);
13757
13394
  return path.relative(gitRoot, resolveLayout(gitRoot).hubsDir);
@@ -13777,7 +13414,7 @@ function warnLayoutOnce(gitRoot) {
13777
13414
  );
13778
13415
  }
13779
13416
  }
13780
- var WAYAI_LAYOUT, TEMPLATES_AUTHORING_SUBDIR, _layoutWarned;
13417
+ var WAYAI_LAYOUT, _layoutWarned;
13781
13418
  var init_layout = __esm({
13782
13419
  "src/lib/layout.ts"() {
13783
13420
  "use strict";
@@ -13786,7 +13423,6 @@ var init_layout = __esm({
13786
13423
  ...WAYAI_WORKSPACE_LAYOUT,
13787
13424
  legacy: { wsDir: "workspace", orgAtRoot: "org" }
13788
13425
  };
13789
- TEMPLATES_AUTHORING_SUBDIR = "wayai-templates";
13790
13426
  _layoutWarned = false;
13791
13427
  }
13792
13428
  });
@@ -13810,7 +13446,6 @@ __export(workspace_exports, {
13810
13446
  resolveActiveHubId: () => resolveActiveHubId,
13811
13447
  resolveExplicitHubPath: () => resolveExplicitHubPath,
13812
13448
  resolveHubFolder: () => resolveHubFolder,
13813
- resolveHubFolderBySelector: () => resolveHubFolderBySelector,
13814
13449
  resolveNewHubForCreate: () => resolveNewHubForCreate,
13815
13450
  resolvePushTarget: () => resolvePushTarget,
13816
13451
  resolveWorkspaceDir: () => resolveWorkspaceDir,
@@ -14012,16 +13647,6 @@ function findHubByFolderName(workspaceDir, hubFolderName) {
14012
13647
  const all = scanWorkspaceHubs(workspaceDir);
14013
13648
  return all.find((h) => path2.basename(h.hubFolder) === hubFolderName) ?? null;
14014
13649
  }
14015
- function resolveHubFolderBySelector(hubsDir, selector) {
14016
- const asPath = path2.resolve(selector);
14017
- if (isDirectory(asPath) && fs2.existsSync(path2.join(asPath, "hub.yaml"))) return asPath;
14018
- if (UUID_RE2.test(selector)) {
14019
- const match = scanWorkspaceHubs(hubsDir).find((h) => h.hubId === selector);
14020
- return match ? match.hubFolder : null;
14021
- }
14022
- const byName = findHubByFolderName(hubsDir, selector);
14023
- return byName ? byName.hubFolder : null;
14024
- }
14025
13650
  function autoRenameHubFolder(currentFolder, hubName, hubEnvironment, hubId, previewLabel, branchName) {
14026
13651
  const expectedSlug = getHubFolderSlug(hubName, hubEnvironment, hubId, previewLabel, branchName);
14027
13652
  const currentSlug = path2.basename(currentFolder);
@@ -14259,24 +13884,24 @@ import * as path4 from "path";
14259
13884
  import * as readline from "readline";
14260
13885
  function prompt(question) {
14261
13886
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
14262
- return new Promise((resolve6) => {
13887
+ return new Promise((resolve5) => {
14263
13888
  rl.question(question, (answer) => {
14264
13889
  rl.close();
14265
- resolve6(answer.trim());
13890
+ resolve5(answer.trim());
14266
13891
  });
14267
13892
  });
14268
13893
  }
14269
13894
  function confirm(question) {
14270
13895
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
14271
- return new Promise((resolve6) => {
13896
+ return new Promise((resolve5) => {
14272
13897
  rl.question(`${question} [y/N]: `, (answer) => {
14273
13898
  rl.close();
14274
- resolve6(answer.trim().toLowerCase() === "y");
13899
+ resolve5(answer.trim().toLowerCase() === "y");
14275
13900
  });
14276
13901
  });
14277
13902
  }
14278
13903
  function promptSecret(question) {
14279
- return new Promise((resolve6) => {
13904
+ return new Promise((resolve5) => {
14280
13905
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
14281
13906
  const originalWrite = rl._writeToOutput;
14282
13907
  let firstWrite = true;
@@ -14292,18 +13917,18 @@ function promptSecret(question) {
14292
13917
  rl._writeToOutput = originalWrite;
14293
13918
  process.stdout.write("\n");
14294
13919
  rl.close();
14295
- resolve6(answer);
13920
+ resolve5(answer);
14296
13921
  });
14297
13922
  });
14298
13923
  }
14299
13924
  function readStdin() {
14300
- return new Promise((resolve6, reject) => {
13925
+ return new Promise((resolve5, reject) => {
14301
13926
  let data = "";
14302
13927
  process.stdin.setEncoding("utf-8");
14303
13928
  process.stdin.on("data", (chunk) => {
14304
13929
  data += chunk;
14305
13930
  });
14306
- process.stdin.on("end", () => resolve6(data.trim()));
13931
+ process.stdin.on("end", () => resolve5(data.trim()));
14307
13932
  process.stdin.on("error", reject);
14308
13933
  });
14309
13934
  }
@@ -14465,9 +14090,9 @@ function getVersionCachePath(filename = CLI_CACHE_FILE) {
14465
14090
  }
14466
14091
  function readVersionCache(filename = CLI_CACHE_FILE) {
14467
14092
  try {
14468
- const path31 = getVersionCachePath(filename);
14469
- if (!existsSync4(path31)) return null;
14470
- const parsed = JSON.parse(readFileSync5(path31, "utf-8"));
14093
+ const path30 = getVersionCachePath(filename);
14094
+ if (!existsSync4(path30)) return null;
14095
+ const parsed = JSON.parse(readFileSync5(path30, "utf-8"));
14471
14096
  if (typeof parsed.lastCheck !== "number") return null;
14472
14097
  if (parsed.latest !== null && typeof parsed.latest !== "string") return null;
14473
14098
  return parsed;
@@ -14487,10 +14112,10 @@ function isVersionCacheStale(filename = CLI_CACHE_FILE, maxAgeMs = MAX_AGE_24H_M
14487
14112
  return Date.now() - cache.lastCheck > maxAgeMs;
14488
14113
  }
14489
14114
  function writeVersionCache(filename, cache) {
14490
- const path31 = getVersionCachePath(filename);
14491
- const dir = dirname3(path31);
14115
+ const path30 = getVersionCachePath(filename);
14116
+ const dir = dirname3(path30);
14492
14117
  if (!existsSync4(dir)) mkdirSync(dir, { recursive: true });
14493
- writeFileSync2(path31, JSON.stringify(cache));
14118
+ writeFileSync2(path30, JSON.stringify(cache));
14494
14119
  }
14495
14120
  function touchVersionCache(filename) {
14496
14121
  writeVersionCache(filename, { lastCheck: Date.now(), latest: readVersionCache(filename)?.latest ?? null });
@@ -14529,14 +14154,14 @@ function parseFrontmatterVersion(content) {
14529
14154
  function findInstalledSkills(projectRoot, paths = SKILL_INSTALL_PATHS) {
14530
14155
  const found = [];
14531
14156
  for (const rel of paths) {
14532
- const path31 = join7(projectRoot, rel);
14533
- if (!existsSync5(path31)) continue;
14157
+ const path30 = join7(projectRoot, rel);
14158
+ if (!existsSync5(path30)) continue;
14534
14159
  let version = null;
14535
14160
  try {
14536
- version = parseFrontmatterVersion(readFileSync6(path31, "utf-8"));
14161
+ version = parseFrontmatterVersion(readFileSync6(path30, "utf-8"));
14537
14162
  } catch {
14538
14163
  }
14539
- found.push({ path: path31, version });
14164
+ found.push({ path: path30, version });
14540
14165
  }
14541
14166
  return found;
14542
14167
  }
@@ -15009,7 +14634,7 @@ async function validateToken(apiUrl, token) {
15009
14634
  }
15010
14635
  }
15011
14636
  function startCallbackServer(port, expectedState, timeoutMs = 12e4) {
15012
- return new Promise((resolve6, reject) => {
14637
+ return new Promise((resolve5, reject) => {
15013
14638
  const server = http.createServer((req, res) => {
15014
14639
  const url = new URL(req.url || "/", `http://127.0.0.1:${port}`);
15015
14640
  if (url.pathname === "/callback") {
@@ -15035,7 +14660,7 @@ function startCallbackServer(port, expectedState, timeoutMs = 12e4) {
15035
14660
  res.writeHead(200, { "Content-Type": "text/html" });
15036
14661
  res.end("<html><body><h2>Login successful!</h2><p>You can close this tab and return to your terminal.</p></body></html>");
15037
14662
  server.close();
15038
- resolve6({ code, port });
14663
+ resolve5({ code, port });
15039
14664
  } else {
15040
14665
  res.writeHead(400, { "Content-Type": "text/html" });
15041
14666
  res.end("<html><body><h2>Login failed</h2><p>No authorization code received</p></body></html>");
@@ -15246,10 +14871,10 @@ import * as readline2 from "readline";
15246
14871
  function prompt2(question, defaultValue) {
15247
14872
  const rl = readline2.createInterface({ input: process.stdin, output: process.stdout });
15248
14873
  const display = defaultValue ? `${question} [${defaultValue}]: ` : `${question}: `;
15249
- return new Promise((resolve6) => {
14874
+ return new Promise((resolve5) => {
15250
14875
  rl.question(display, (answer) => {
15251
14876
  rl.close();
15252
- resolve6(answer.trim() || defaultValue || "");
14877
+ resolve5(answer.trim() || defaultValue || "");
15253
14878
  });
15254
14879
  });
15255
14880
  }
@@ -15367,8 +14992,8 @@ async function tryOpenBrowser(url) {
15367
14992
  cmd = "xdg-open";
15368
14993
  args2 = [url];
15369
14994
  }
15370
- return new Promise((resolve6) => {
15371
- execFile(cmd, args2, (err) => resolve6(!err));
14995
+ return new Promise((resolve5) => {
14996
+ execFile(cmd, args2, (err) => resolve5(!err));
15372
14997
  });
15373
14998
  } catch {
15374
14999
  return false;
@@ -19991,8 +19616,8 @@ function installEvalSignalHandlers(input) {
19991
19616
  let signalCount = 0;
19992
19617
  let disposed = false;
19993
19618
  let settle;
19994
- const settled = new Promise((resolve6) => {
19995
- settle = resolve6;
19619
+ const settled = new Promise((resolve5) => {
19620
+ settle = resolve5;
19996
19621
  });
19997
19622
  const listeners = /* @__PURE__ */ new Map();
19998
19623
  const dispose = () => {
@@ -20342,7 +19967,7 @@ Timeout after ${timeoutSeconds}s${queuedSeconds > 0 ? ` (${queuedSeconds}s of it
20342
19967
  process.exit(1);
20343
19968
  }
20344
19969
  function sleep(ms) {
20345
- return new Promise((resolve6) => setTimeout(resolve6, ms));
19970
+ return new Promise((resolve5) => setTimeout(resolve5, ms));
20346
19971
  }
20347
19972
  function parseRunNumbers(raw) {
20348
19973
  if (!raw || raw.startsWith("--")) {
@@ -22388,276 +22013,6 @@ var init_list = __esm({
22388
22013
  }
22389
22014
  });
22390
22015
 
22391
- // src/lib/template-files.ts
22392
- import * as fs22 from "fs";
22393
- import * as path28 from "path";
22394
- function readDirToFileMap(rootDir) {
22395
- const out = {};
22396
- function walk(dir, prefix) {
22397
- const entries = fs22.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
22398
- for (const entry of entries) {
22399
- const abs = path28.join(dir, entry.name);
22400
- const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
22401
- if (entry.isDirectory()) walk(abs, rel);
22402
- else if (entry.isFile()) out[rel] = fs22.readFileSync(abs, "utf-8");
22403
- }
22404
- }
22405
- if (fs22.existsSync(rootDir)) walk(rootDir, "");
22406
- return out;
22407
- }
22408
- function detectCollisions(targetDir, files) {
22409
- const collisions = [];
22410
- for (const rel of Object.keys(files)) {
22411
- if (!isSafeTemplatePath(rel)) {
22412
- throw new Error(`Refusing to inspect unsafe template path: ${rel}`);
22413
- }
22414
- if (fs22.existsSync(path28.join(targetDir, rel))) collisions.push(rel);
22415
- }
22416
- return collisions.sort((a, b) => a.localeCompare(b));
22417
- }
22418
- function writeFileMap(targetDir, files) {
22419
- const written = [];
22420
- for (const [rel, body] of Object.entries(files)) {
22421
- if (!isSafeTemplatePath(rel)) {
22422
- throw new Error(`Refusing to write unsafe template path: ${rel}`);
22423
- }
22424
- const abs = path28.join(targetDir, rel);
22425
- fs22.mkdirSync(path28.dirname(abs), { recursive: true });
22426
- fs22.writeFileSync(abs, body, "utf-8");
22427
- written.push(rel);
22428
- }
22429
- return written;
22430
- }
22431
- function listDirRelFiles(dir) {
22432
- const out = [];
22433
- function walk(d, prefix) {
22434
- for (const entry of fs22.readdirSync(d, { withFileTypes: true })) {
22435
- const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
22436
- if (entry.isDirectory()) walk(path28.join(d, entry.name), rel);
22437
- else if (entry.isFile()) out.push(rel);
22438
- }
22439
- }
22440
- if (fs22.existsSync(dir)) walk(dir, "");
22441
- return out;
22442
- }
22443
- function writeSliceSnapshot(targetDir, files) {
22444
- const keep = new Set(Object.keys(files));
22445
- const removed = listDirRelFiles(targetDir).filter((rel) => !keep.has(rel)).sort((a, b) => a.localeCompare(b));
22446
- const written = writeFileMap(targetDir, files).sort((a, b) => a.localeCompare(b));
22447
- if (fs22.existsSync(targetDir)) cleanOrphanFiles(targetDir, "", keep);
22448
- return { written, removed };
22449
- }
22450
- var init_template_files = __esm({
22451
- "src/lib/template-files.ts"() {
22452
- "use strict";
22453
- init_contracts();
22454
- init_resource_files();
22455
- }
22456
- });
22457
-
22458
- // src/commands/templates.ts
22459
- var templates_exports = {};
22460
- __export(templates_exports, {
22461
- templateCommand: () => templateCommand
22462
- });
22463
- import * as path29 from "path";
22464
- async function templateCommand(args2) {
22465
- const [sub, ...rest] = args2;
22466
- switch (sub) {
22467
- case "list":
22468
- await runTemplateList();
22469
- return;
22470
- case "pull":
22471
- await runTemplatePull(rest);
22472
- return;
22473
- case void 0:
22474
- case "help":
22475
- case "--help":
22476
- case "-h":
22477
- printTemplateHelp();
22478
- return;
22479
- default:
22480
- console.error(`Unknown template subcommand: ${sub}`);
22481
- printTemplateHelp();
22482
- process.exit(1);
22483
- }
22484
- }
22485
- function includesLabel(item) {
22486
- const parts = [];
22487
- if (item.includes.wayai) parts.push("wayai agent");
22488
- if (item.uses?.length) parts.push("rekor backend");
22489
- return parts.length ? parts.join(" + ") : "(none)";
22490
- }
22491
- async function runTemplateList() {
22492
- const { config, accessToken } = await requireAuth();
22493
- const client = new ApiClient({ apiUrl: config.api_url, accessToken });
22494
- let response;
22495
- try {
22496
- response = await client.templateList();
22497
- } catch (err) {
22498
- exitOnTemplateApiError(err);
22499
- throw err;
22500
- }
22501
- const { templates } = response;
22502
- if (templates.length === 0) {
22503
- console.log("(no templates published yet)");
22504
- return;
22505
- }
22506
- const slugWidth = Math.max(4, ...templates.map((t) => t.slug.length));
22507
- const catWidth = Math.max(8, ...templates.map((t) => t.category.length));
22508
- console.log(`${"SLUG".padEnd(slugWidth)} ${"CATEGORY".padEnd(catWidth)} INCLUDES`);
22509
- for (const t of templates) {
22510
- console.log(`${t.slug.padEnd(slugWidth)} ${t.category.padEnd(catWidth)} ${includesLabel(t)}`);
22511
- }
22512
- }
22513
- async function runTemplatePull(rest) {
22514
- const positional = [];
22515
- let lang;
22516
- let force = false;
22517
- let dryRun = false;
22518
- for (let i = 0; i < rest.length; i++) {
22519
- if (rest[i] === "--force") {
22520
- force = true;
22521
- continue;
22522
- }
22523
- if (rest[i] === "--dry-run") {
22524
- dryRun = true;
22525
- continue;
22526
- }
22527
- if (rest[i] === "--lang") {
22528
- const v = rest[++i];
22529
- if (!v) {
22530
- console.error("--lang requires a value");
22531
- process.exit(1);
22532
- }
22533
- const parsed = templateLocaleSchema.safeParse(v);
22534
- if (!parsed.success) {
22535
- console.error(`Invalid --lang "${v}": must be one of ${templateLocaleSchema.options.join(", ")}.`);
22536
- process.exit(1);
22537
- }
22538
- lang = parsed.data;
22539
- continue;
22540
- }
22541
- if (rest[i].startsWith("--")) {
22542
- console.error(`Unknown flag: ${rest[i]}`);
22543
- process.exit(1);
22544
- }
22545
- positional.push(rest[i]);
22546
- }
22547
- const slug = positional[0];
22548
- if (!slug) {
22549
- console.error("wayai template pull <slug> [--lang <locale>]");
22550
- process.exit(1);
22551
- }
22552
- if (!TEMPLATE_SLUG_REGEX.test(slug)) {
22553
- console.error(`Invalid template slug: ${slug}`);
22554
- process.exit(1);
22555
- }
22556
- const gitRoot = findGitRoot();
22557
- if (!gitRoot) {
22558
- console.error("Not in a git repository. Run `wayai template pull` inside your project repo.");
22559
- process.exit(1);
22560
- }
22561
- const { config, accessToken } = await requireAuth();
22562
- const client = new ApiClient({ apiUrl: config.api_url, accessToken });
22563
- let detail;
22564
- try {
22565
- detail = await client.templatePull(slug, lang);
22566
- } catch (err) {
22567
- exitOnTemplateApiError(err);
22568
- throw err;
22569
- }
22570
- if (detail.resolvedLocale !== detail.requestedLocale) {
22571
- console.log(`Note: "${detail.requestedLocale}" not translated yet \u2014 pulled "${detail.resolvedLocale}" instead.`);
22572
- }
22573
- if (!detail.includes.wayai) {
22574
- const backends2 = distinctUsesBackends(detail.uses);
22575
- const hint = backends2.length ? ` \u2014 run ${backends2.map((b) => `\`rekor template pull ${b}${langFlag(lang)}\``).join(" and ")} for its data layer.` : ".";
22576
- console.log(`Template "${slug}" has no WayAI slice${hint}`);
22577
- return;
22578
- }
22579
- const targetDir = path29.join(resolveLayout(gitRoot).hubsDir, slug);
22580
- const relTarget = path29.relative(gitRoot, targetDir);
22581
- const collisions = detectCollisions(targetDir, detail.files);
22582
- if (dryRun) {
22583
- const planned = Object.keys(detail.files).sort((a, b) => a.localeCompare(b));
22584
- const collisionSet = new Set(collisions);
22585
- console.log(`Dry run \u2014 would write ${planned.length} file${planned.length === 1 ? "" : "s"} into ${relTarget}/:`);
22586
- for (const rel of planned) {
22587
- console.log(` ${collisionSet.has(rel) ? "overwrite" : "create"} ${rel}`);
22588
- }
22589
- if (collisions.length > 0) {
22590
- console.log(`
22591
- ${collisions.length} existing file${collisions.length === 1 ? "" : "s"} would be overwritten \u2014 re-run with --force to proceed.`);
22592
- }
22593
- return;
22594
- }
22595
- if (collisions.length > 0 && !force) {
22596
- console.error(`Refusing to overwrite ${collisions.length} existing file${collisions.length === 1 ? "" : "s"} in ${relTarget}/:`);
22597
- for (const rel of collisions) console.error(` ${rel}`);
22598
- console.error(`
22599
- Commit or move your changes and re-run with --force to overwrite, or pull into a fresh slug dir.`);
22600
- console.error(`Preview the full file map first with --dry-run.`);
22601
- process.exit(1);
22602
- }
22603
- const written = writeFileMap(targetDir, detail.files);
22604
- console.log(`Pulled template "${slug}" \u2192 ${relTarget}/ (${written.length} file${written.length === 1 ? "" : "s"}).`);
22605
- console.log(`Next: \`wayai push\` to deploy it into your own hub.`);
22606
- const backends = distinctUsesBackends(detail.uses);
22607
- if (backends.length) {
22608
- const cmds = backends.map((b) => `\`rekor template pull ${b}${langFlag(lang)}\``).join(" and ");
22609
- const noun = backends.length === 1 ? "a Rekor backend" : "Rekor backends";
22610
- const obj = backends.length === 1 ? "it" : "them";
22611
- console.log(`
22612
- This channel runs on ${noun} \u2014 run ${cmds} to add ${obj}.`);
22613
- }
22614
- }
22615
- function langFlag(lang) {
22616
- return lang ? ` --lang ${lang}` : "";
22617
- }
22618
- function printTemplateHelp() {
22619
- console.log(`wayai template \u2014 install ready-made hub templates
22620
-
22621
- Usage:
22622
- wayai template list List available templates
22623
- wayai template pull <slug> [--lang <l>] [--force] [--dry-run]
22624
- Write a template's WayAI slice into wayai-ws/hubs/<slug>/
22625
-
22626
- --lang selects a localized variant (${templateLocaleSchema.options.join("|")}); omitted = the template's default
22627
- language. An untranslated language falls back to the default (with a note).
22628
- --dry-run previews the file map (marking files that would be overwritten) without writing.
22629
- A pull refuses to overwrite existing files in the target dir; pass --force to overwrite them.
22630
-
22631
- After pulling, run \`wayai push\` to deploy the template into your own hub.`);
22632
- }
22633
- function exitOnTemplateApiError(err) {
22634
- if (err instanceof ApiError) {
22635
- if (err.status === 401) {
22636
- console.error("Authentication failed. Run `wayai login` again.");
22637
- } else if (err.status === 404) {
22638
- console.error("Template not found. Run `wayai template list` to see available templates.");
22639
- } else if (err.status === 429) {
22640
- console.error("Rate limited. Please retry in a moment.");
22641
- } else {
22642
- console.error(err.message);
22643
- }
22644
- process.exit(1);
22645
- }
22646
- console.error(err instanceof Error ? err.message : String(err));
22647
- process.exit(1);
22648
- }
22649
- var init_templates = __esm({
22650
- "src/commands/templates.ts"() {
22651
- "use strict";
22652
- init_auth();
22653
- init_api_client();
22654
- init_workspace();
22655
- init_layout();
22656
- init_template_files();
22657
- init_contracts();
22658
- }
22659
- });
22660
-
22661
22016
  // src/lib/report-edit-args.ts
22662
22017
  function parseReportEditArgs(args2) {
22663
22018
  const patch = {};
@@ -22698,66 +22053,32 @@ var init_report_edit_args = __esm({
22698
22053
  }
22699
22054
  });
22700
22055
 
22701
- // src/lib/template-sanitize.ts
22702
- import * as yaml9 from "js-yaml";
22703
- function sanitizeWayaiSliceFiles(files) {
22704
- const out = {};
22705
- for (const [filePath, body] of Object.entries(files)) {
22706
- out[filePath] = isSanitizableSliceFile(filePath) ? sanitizeOne(filePath, body) : body;
22707
- }
22708
- return out;
22709
- }
22710
- function sanitizeOne(filePath, body) {
22711
- let parsed;
22712
- try {
22713
- parsed = yaml9.load(body);
22714
- } catch {
22715
- return body;
22716
- }
22717
- const scrubbed = stripEvalAttachments(filePath, excludeTemplateAuthorData(stripTemplateInstanceIds(parsed)));
22718
- if (JSON.stringify(parsed) === JSON.stringify(scrubbed)) return body;
22719
- return yaml9.dump(scrubbed, YAML_DUMP_OPTIONS);
22720
- }
22721
- function stripEvalAttachments(filePath, value) {
22722
- if (!value || typeof value !== "object" || Array.isArray(value)) return value;
22723
- const doc = { ...value };
22724
- const dropOnTurn = (turn) => {
22725
- if (!turn || typeof turn !== "object" || Array.isArray(turn) || !("attachments" in turn)) return turn;
22726
- const { attachments: _drop, ...rest } = turn;
22727
- return rest;
22728
- };
22729
- if (/^evals\//.test(filePath)) {
22730
- if ("input" in doc) doc.input = dropOnTurn(doc.input);
22731
- if (Array.isArray(doc.history)) doc.history = doc.history.map(dropOnTurn);
22732
- } else if (/^journeys\//.test(filePath)) {
22733
- if (Array.isArray(doc.transcript)) doc.transcript = doc.transcript.map(dropOnTurn);
22734
- }
22735
- return doc;
22056
+ // src/lib/file-map.ts
22057
+ import * as fs22 from "fs";
22058
+ import * as path28 from "path";
22059
+ function isSafeRelPath(rel) {
22060
+ if (rel.length === 0 || rel.length > 300) return false;
22061
+ if (rel.startsWith("/") || rel.includes("\\")) return false;
22062
+ const segments = rel.split("/");
22063
+ return segments.every(
22064
+ (seg) => seg.length > 0 && seg !== "." && seg !== ".." && /^[A-Za-z0-9._-]+$/.test(seg)
22065
+ );
22736
22066
  }
22737
- var init_template_sanitize = __esm({
22738
- "src/lib/template-sanitize.ts"() {
22739
- "use strict";
22740
- init_contracts();
22741
- init_yaml_writer();
22067
+ function writeFileMap(targetDir, files) {
22068
+ const written = [];
22069
+ for (const [rel, body] of Object.entries(files)) {
22070
+ if (!isSafeRelPath(rel)) {
22071
+ throw new Error(`Refusing to write unsafe path: ${rel}`);
22072
+ }
22073
+ const abs = path28.join(targetDir, rel);
22074
+ fs22.mkdirSync(path28.dirname(abs), { recursive: true });
22075
+ fs22.writeFileSync(abs, body, "utf-8");
22076
+ written.push(rel);
22742
22077
  }
22743
- });
22744
-
22745
- // src/lib/template-manifest.ts
22746
- function buildTemplatePushCommon(manifest, hero) {
22747
- return {
22748
- category: manifest.category,
22749
- tags: manifest.tags,
22750
- status: manifest.status,
22751
- order: manifest.order ?? 0,
22752
- installCommand: manifest.wayai.installCommand,
22753
- ...hero && { hero },
22754
- // The channel→backend edge (locale-agnostic). The store persists it verbatim; the
22755
- // website derives the "runs on backend X" cross-link + MCP endpoint from the slugs.
22756
- uses: manifest.uses
22757
- };
22078
+ return written;
22758
22079
  }
22759
- var init_template_manifest = __esm({
22760
- "src/lib/template-manifest.ts"() {
22080
+ var init_file_map = __esm({
22081
+ "src/lib/file-map.ts"() {
22761
22082
  "use strict";
22762
22083
  }
22763
22084
  });
@@ -22768,8 +22089,7 @@ __export(admin_exports, {
22768
22089
  adminCommand: () => adminCommand
22769
22090
  });
22770
22091
  import * as fs23 from "fs";
22771
- import * as path30 from "path";
22772
- import * as yaml10 from "js-yaml";
22092
+ import * as path29 from "path";
22773
22093
  async function adminCommand(args2) {
22774
22094
  const [group, ...afterGroup] = args2;
22775
22095
  if (!group) {
@@ -22883,26 +22203,6 @@ async function adminCommand(args2) {
22883
22203
  process.exit(1);
22884
22204
  }
22885
22205
  }
22886
- if (group === "template") {
22887
- if (!sub) {
22888
- printHelp2();
22889
- process.exit(1);
22890
- }
22891
- switch (sub) {
22892
- case "push":
22893
- await runTemplatePush(positional);
22894
- return;
22895
- case "pull":
22896
- await runTemplatePull2(positional, flagArgs);
22897
- return;
22898
- case "freeze":
22899
- await runTemplateFreeze(positional, flagArgs);
22900
- return;
22901
- default:
22902
- printHelp2();
22903
- process.exit(1);
22904
- }
22905
- }
22906
22206
  if (group === "skill") {
22907
22207
  if (!sub) {
22908
22208
  printHelp2();
@@ -23216,262 +22516,6 @@ function parseFlags2(flagArgs, allowed) {
23216
22516
  }
23217
22517
  return out;
23218
22518
  }
23219
- function loadTemplateManifest(slug) {
23220
- const gitRoot = findGitRoot();
23221
- if (!gitRoot) {
23222
- console.error("Not in a git repository. Run from the templates authoring repo (wayai-pro/templates).");
23223
- process.exit(1);
23224
- }
23225
- const templateDir = path30.join(resolveTemplatesDir(gitRoot), slug);
23226
- const manifestPath = path30.join(templateDir, "template.yaml");
23227
- if (!fs23.existsSync(manifestPath)) {
23228
- console.error(`template.yaml not found at ${path30.relative(gitRoot, manifestPath)}`);
23229
- process.exit(1);
23230
- }
23231
- let manifest;
23232
- try {
23233
- manifest = templateYamlSchema.parse(yaml10.load(fs23.readFileSync(manifestPath, "utf-8")));
23234
- } catch (err) {
23235
- console.error(`Invalid template.yaml: ${err instanceof Error ? err.message : String(err)}`);
23236
- process.exit(1);
23237
- }
23238
- if (manifest.slug !== slug) {
23239
- console.error(`template.yaml slug "${manifest.slug}" does not match folder "${slug}".`);
23240
- process.exit(1);
23241
- }
23242
- return { gitRoot, templateDir, manifest };
23243
- }
23244
- async function runTemplatePush(positional) {
23245
- const slug = positional[0];
23246
- if (!slug) {
23247
- console.error("wayai admin template push <slug>");
23248
- process.exit(1);
23249
- }
23250
- if (!TEMPLATE_SLUG_REGEX.test(slug)) {
23251
- console.error(`Invalid template slug: ${slug}`);
23252
- process.exit(1);
23253
- }
23254
- const { templateDir, manifest } = loadTemplateManifest(slug);
23255
- const authoredLocales = new Set(
23256
- Object.keys(manifest.wayai.locales)
23257
- );
23258
- const locales = {};
23259
- for (const locale of authoredLocales) {
23260
- const wayaiEntry = manifest.wayai.locales[locale];
23261
- let wayaiFiles;
23262
- if (wayaiEntry) {
23263
- const sliceDir = path30.resolve(templateDir, wayaiEntry.source);
23264
- if (!fs23.existsSync(sliceDir)) {
23265
- console.error(`wayai source not found for ${locale}: ${wayaiEntry.source} (resolved ${sliceDir})`);
23266
- process.exit(1);
23267
- }
23268
- if (!isInsideTemplateDir(sliceDir, templateDir)) {
23269
- console.warn(
23270
- `Note: ${locale} source points at a live hub (${wayaiEntry.source}); it can go stale on a hub recreate. Run \`wayai admin template freeze ${slug} --locale ${locale} --from ${path30.basename(sliceDir)}\` to commit a stable frozen slice.`
23271
- );
23272
- }
23273
- wayaiFiles = readDirToFileMap(sliceDir);
23274
- }
23275
- const readmePath = path30.join(templateDir, `README.${locale}.md`);
23276
- const readmeMarkdown = fs23.existsSync(readmePath) ? fs23.readFileSync(readmePath, "utf-8") : "";
23277
- locales[locale] = {
23278
- readmeMarkdown,
23279
- ...wayaiFiles && { wayaiFiles },
23280
- ...wayaiEntry && {
23281
- wayai: { metaTitle: wayaiEntry.metaTitle, metaDescription: wayaiEntry.metaDescription }
23282
- }
23283
- };
23284
- }
23285
- let hero;
23286
- if (manifest.hero) {
23287
- const heroPath = path30.resolve(templateDir, manifest.hero);
23288
- if (fs23.existsSync(heroPath)) {
23289
- hero = { filename: path30.basename(heroPath), dataBase64: fs23.readFileSync(heroPath).toString("base64") };
23290
- } else {
23291
- console.error(`Warning: hero not found at ${manifest.hero}; skipping.`);
23292
- }
23293
- }
23294
- const body = {
23295
- slug,
23296
- defaultLocale: manifest.defaultLocale,
23297
- common: buildTemplatePushCommon(manifest, hero),
23298
- locales
23299
- };
23300
- const { config, accessToken } = await requireAuth();
23301
- const client = new ApiClient({ apiUrl: config.api_url, accessToken });
23302
- let result;
23303
- try {
23304
- result = await client.adminTemplatePush(body);
23305
- } catch (err) {
23306
- exitOnApiError(err);
23307
- throw err;
23308
- }
23309
- console.log(`Template "${result.slug}": ${result.action} (${result.filesWritten} written, ${result.filesDeleted} deleted).`);
23310
- if (manifest.status !== "published") {
23311
- console.log(`(status=${manifest.status} \u2192 unpublished from the store)`);
23312
- }
23313
- }
23314
- function isInsideTemplateDir(dest, templateDir) {
23315
- return dest === templateDir || dest.startsWith(templateDir + path30.sep);
23316
- }
23317
- async function runTemplateFreeze(positional, flagArgs) {
23318
- const slug = positional[0];
23319
- if (!slug) {
23320
- console.error("wayai admin template freeze <slug> [--locale <l>] [--from <hub>] [--dry-run]");
23321
- process.exit(1);
23322
- }
23323
- if (!TEMPLATE_SLUG_REGEX.test(slug)) {
23324
- console.error(`Invalid template slug: ${slug}`);
23325
- process.exit(1);
23326
- }
23327
- let locale;
23328
- let from;
23329
- let dryRun = false;
23330
- for (let i = 0; i < flagArgs.length; i++) {
23331
- if (flagArgs[i] === "--dry-run") {
23332
- dryRun = true;
23333
- continue;
23334
- }
23335
- if (flagArgs[i] === "--locale") {
23336
- const v = flagArgs[++i];
23337
- if (!v) {
23338
- console.error("--locale requires a value");
23339
- process.exit(1);
23340
- }
23341
- const parsed = templateLocaleSchema.safeParse(v);
23342
- if (!parsed.success) {
23343
- console.error(`Invalid --locale "${v}": must be one of ${templateLocaleSchema.options.join(", ")}.`);
23344
- process.exit(1);
23345
- }
23346
- locale = parsed.data;
23347
- continue;
23348
- }
23349
- if (flagArgs[i] === "--from") {
23350
- from = flagArgs[++i];
23351
- if (!from) {
23352
- console.error("--from requires a value");
23353
- process.exit(1);
23354
- }
23355
- continue;
23356
- }
23357
- console.error(`Unknown flag: ${flagArgs[i]}`);
23358
- process.exit(1);
23359
- }
23360
- const { gitRoot, templateDir, manifest } = loadTemplateManifest(slug);
23361
- const authored = Object.keys(manifest.wayai.locales);
23362
- let targetLocale;
23363
- if (locale) {
23364
- if (!manifest.wayai.locales[locale]) {
23365
- console.error(`Locale "${locale}" is not authored in ${slug}/template.yaml (have: ${authored.join(", ")}).`);
23366
- process.exit(1);
23367
- }
23368
- targetLocale = locale;
23369
- } else if (authored.length === 1) {
23370
- targetLocale = authored[0];
23371
- } else {
23372
- console.error(`Template "${slug}" authors ${authored.length} locales (${authored.join(", ")}). Pass --locale <l> \u2014 each freezes from its own hub.`);
23373
- process.exit(1);
23374
- }
23375
- const entry = manifest.wayai.locales[targetLocale];
23376
- const dest = path30.resolve(templateDir, entry.source);
23377
- if (!isInsideTemplateDir(dest, templateDir) || dest === templateDir) {
23378
- console.error(
23379
- `source for "${targetLocale}" must be a committed path inside ${slug}/ (e.g. "./${targetLocale}/slice"), but resolved to:
23380
- ${entry.source} \u2192 ${dest}
23381
- Set it to a subdir of the template folder and re-run freeze.`
23382
- );
23383
- process.exit(1);
23384
- }
23385
- const hubsDir = resolveHubsDir(gitRoot);
23386
- const selector = from ?? readBinding();
23387
- const hubFolder = selector ? resolveHubFolderBySelector(hubsDir, selector) : null;
23388
- if (!hubFolder) {
23389
- console.error(
23390
- selector ? `Could not resolve a source hub matching "${selector}" in ${hubsDirLabel(gitRoot)}/.` : "No --from given and this worktree has no `wayai use` binding."
23391
- );
23392
- const hubs = scanWorkspaceHubs(hubsDir);
23393
- if (hubs.length) {
23394
- console.error("Available hubs:");
23395
- for (const h of hubs) console.error(` ${path30.basename(h.hubFolder)} (${h.hubId})`);
23396
- }
23397
- console.error(`
23398
- Pass --from <folder|uuid>${selector ? "." : " or run `wayai use <hub>` first."}`);
23399
- process.exit(1);
23400
- }
23401
- const liveFiles = readDirToFileMap(hubFolder);
23402
- if (Object.keys(liveFiles).length === 0) {
23403
- console.error(`Source hub folder has no files to freeze: ${path30.relative(gitRoot, hubFolder)}`);
23404
- process.exit(1);
23405
- }
23406
- const sanitized = sanitizeWayaiSliceFiles(liveFiles);
23407
- const relDest = path30.relative(gitRoot, dest);
23408
- const relSrc = path30.relative(gitRoot, hubFolder);
23409
- if (dryRun) {
23410
- const existing = new Set(listDirRelFiles(dest));
23411
- const nextKeys = new Set(Object.keys(sanitized));
23412
- console.log(`Dry run \u2014 would freeze ${relSrc}/ \u2192 ${relDest}/ (locale ${targetLocale}):`);
23413
- for (const rel of Object.keys(sanitized).sort((a, b) => a.localeCompare(b))) {
23414
- console.log(` ${existing.has(rel) ? "update" : "create"} ${rel}`);
23415
- }
23416
- for (const rel of [...existing].filter((k) => !nextKeys.has(k)).sort((a, b) => a.localeCompare(b))) {
23417
- console.log(` remove ${rel}`);
23418
- }
23419
- return;
23420
- }
23421
- const { written, removed } = writeSliceSnapshot(dest, sanitized);
23422
- console.log(
23423
- `Froze ${relSrc}/ \u2192 ${relDest}/ (locale ${targetLocale}): ${written.length} file${written.length === 1 ? "" : "s"} written${removed.length ? `, ${removed.length} removed` : ""}.`
23424
- );
23425
- console.log(`The slice is committed \u2014 re-push is stable across hub recreates. Next: \`wayai admin template push ${slug}\`.`);
23426
- }
23427
- async function runTemplatePull2(positional, flagArgs) {
23428
- const slug = positional[0];
23429
- if (!slug) {
23430
- console.error("wayai admin template pull <slug> [--out DIR] [--json]");
23431
- process.exit(1);
23432
- }
23433
- if (!TEMPLATE_SLUG_REGEX.test(slug)) {
23434
- console.error(`Invalid template slug: ${slug}`);
23435
- process.exit(1);
23436
- }
23437
- let outDir;
23438
- let jsonOutput = false;
23439
- for (let i = 0; i < flagArgs.length; i++) {
23440
- if (flagArgs[i] === "--json") {
23441
- jsonOutput = true;
23442
- continue;
23443
- }
23444
- if (flagArgs[i] === "--out") {
23445
- outDir = flagArgs[++i];
23446
- if (!outDir) {
23447
- console.error("--out requires a value");
23448
- process.exit(1);
23449
- }
23450
- continue;
23451
- }
23452
- console.error(`Unknown flag: ${flagArgs[i]}`);
23453
- process.exit(1);
23454
- }
23455
- const { config, accessToken } = await requireAuth();
23456
- const client = new ApiClient({ apiUrl: config.api_url, accessToken });
23457
- let detail;
23458
- try {
23459
- detail = await client.adminTemplatePull(slug);
23460
- } catch (err) {
23461
- exitOnApiError(err);
23462
- throw err;
23463
- }
23464
- if (jsonOutput) {
23465
- console.log(JSON.stringify(detail, null, 2));
23466
- return;
23467
- }
23468
- const target = outDir ? path30.resolve(outDir) : path30.join(process.cwd(), "template-store-pull", slug);
23469
- const written = writeFileMap(target, detail.files);
23470
- console.log(`Pulled "${slug}" from the store \u2192 ${target} (${written.length} file${written.length === 1 ? "" : "s"}).`);
23471
- const uses = detail.uses ?? [];
23472
- const usesLabel = uses.length ? uses.map((u) => `${u.backend}/${u.endpoint}`).join(", ") : "(none)";
23473
- console.log(`includes: wayai=${detail.includes.wayai} | uses: ${usesLabel}`);
23474
- }
23475
22519
  async function runSkillInstall(positional) {
23476
22520
  const name = positional[0] ?? "wayai-admin";
23477
22521
  if (!ADMIN_SKILL_NAME_REGEX.test(name)) {
@@ -23488,13 +22532,13 @@ async function runSkillInstall(positional) {
23488
22532
  throw err;
23489
22533
  }
23490
22534
  const root = findGitRoot() ?? process.cwd();
23491
- const present = HARNESS_SKILL_DIRS.filter((dir) => fs23.existsSync(path30.join(root, dir)));
22535
+ const present = HARNESS_SKILL_DIRS.filter((dir) => fs23.existsSync(path29.join(root, dir)));
23492
22536
  const targets = present.length > 0 ? present : HARNESS_SKILL_DIRS;
23493
22537
  const fileCount = Object.keys(res.files).length;
23494
22538
  const relDirs = targets.map((harness) => {
23495
- const targetDir = path30.join(root, harness, "skills", name);
22539
+ const targetDir = path29.join(root, harness, "skills", name);
23496
22540
  writeFileMap(targetDir, res.files);
23497
- return `${path30.relative(root, targetDir)}/`;
22541
+ return `${path29.relative(root, targetDir)}/`;
23498
22542
  });
23499
22543
  console.log(`Installed skill "${name}" (${fileCount} file${fileCount === 1 ? "" : "s"}) \u2192 ${relDirs.join(", ")}`);
23500
22544
  console.log("Reload your agent (e.g. restart Claude Code) to pick up the skill.");
@@ -24213,11 +23257,6 @@ Usage:
24213
23257
  wayai admin notice list [--status active|resolved] [--limit N] [--offset N] [--json]
24214
23258
  wayai admin notice resolve <notice_id>
24215
23259
 
24216
- wayai admin template push <slug> Publish a template from wayai-templates/<slug>/ into the store
24217
- wayai admin template pull <slug> [--out DIR] [--json] Pull a published template from the store for inspection
24218
- wayai admin template freeze <slug> [--locale <l>] [--from <hub>] [--dry-run]
24219
- Snapshot a live hub into the template's committed slice (id/PII-scrubbed)
24220
-
24221
23260
  wayai admin skill install [name] Install a private operator skill (default: wayai-admin) into each present harness's skills/ dir
24222
23261
 
24223
23262
  wayai admin sandbox exec [--cmd "<c>" | <c>] --hub <id> --connection <id> [--egress open|allowlist|isolated] [--allow <host> ...] [--timeout <ms>] [--json]
@@ -24319,12 +23358,8 @@ var init_admin = __esm({
24319
23358
  init_observability();
24320
23359
  init_report_edit_args();
24321
23360
  init_workspace();
24322
- init_hub_binding();
24323
23361
  init_skill_version();
24324
- init_layout();
24325
- init_template_files();
24326
- init_template_sanitize();
24327
- init_template_manifest();
23362
+ init_file_map();
24328
23363
  init_contracts();
24329
23364
  VALID_TYPES = dataExplorerDebugDoType.options;
24330
23365
  VALID_ANALYTICS_TABLES = dataExplorerDebugAnalyticsTable.options;
@@ -24814,9 +23849,9 @@ init_sentry();
24814
23849
  init_errors2();
24815
23850
  init_mask_secrets();
24816
23851
  init_utils();
24817
- import { readFileSync as readFileSync21 } from "fs";
23852
+ import { readFileSync as readFileSync19 } from "fs";
24818
23853
  import { fileURLToPath as fileURLToPath2 } from "url";
24819
- import { dirname as dirname9, join as join28 } from "path";
23854
+ import { dirname as dirname9, join as join27 } from "path";
24820
23855
 
24821
23856
  // src/lib/version-refresh.ts
24822
23857
  init_version_cache();
@@ -24824,7 +23859,7 @@ init_skill_version();
24824
23859
  import { exec } from "child_process";
24825
23860
  var REFRESH_TIMEOUT_MS = 1e4;
24826
23861
  function refreshCliCache() {
24827
- return new Promise((resolve6) => {
23862
+ return new Promise((resolve5) => {
24828
23863
  exec("npm view @wayai/cli version", { timeout: REFRESH_TIMEOUT_MS }, (err, stdout) => {
24829
23864
  if (!err) {
24830
23865
  const latest = stdout.trim();
@@ -24835,7 +23870,7 @@ function refreshCliCache() {
24835
23870
  }
24836
23871
  }
24837
23872
  }
24838
- resolve6();
23873
+ resolve5();
24839
23874
  });
24840
23875
  });
24841
23876
  }
@@ -24861,8 +23896,8 @@ async function refreshSkillCache() {
24861
23896
  }
24862
23897
  async function refreshAdminSkillCache() {
24863
23898
  let timer;
24864
- const deadline = new Promise((resolve6) => {
24865
- timer = setTimeout(resolve6, REFRESH_TIMEOUT_MS);
23899
+ const deadline = new Promise((resolve5) => {
23900
+ timer = setTimeout(resolve5, REFRESH_TIMEOUT_MS);
24866
23901
  });
24867
23902
  await Promise.race([deadline, fetchAndCacheAdminSkillVersion().catch(() => {
24868
23903
  })]);
@@ -24972,7 +24007,7 @@ Run \`wayai admin skill install\` to update.`);
24972
24007
 
24973
24008
  // src/index.ts
24974
24009
  var __dirname = dirname9(fileURLToPath2(import.meta.url));
24975
- var pkg = JSON.parse(readFileSync21(join28(__dirname, "..", "package.json"), "utf-8"));
24010
+ var pkg = JSON.parse(readFileSync19(join27(__dirname, "..", "package.json"), "utf-8"));
24976
24011
  var [, , command, ...args] = process.argv;
24977
24012
  var isBackgroundRefresh = command === REFRESH_COMMAND;
24978
24013
  if (!isBackgroundRefresh) initSentry(command, pkg.version);
@@ -25151,11 +24186,6 @@ async function main() {
25151
24186
  await listCommand2(args);
25152
24187
  break;
25153
24188
  }
25154
- case "template": {
25155
- const { templateCommand: templateCommand2 } = await Promise.resolve().then(() => (init_templates(), templates_exports));
25156
- await templateCommand2(args);
25157
- break;
25158
- }
25159
24189
  case "admin": {
25160
24190
  const { adminCommand: adminCommand2 } = await Promise.resolve().then(() => (init_admin(), admin_exports));
25161
24191
  await adminCommand2(args);
@@ -25231,8 +24261,6 @@ Commands:
25231
24261
  sync-skills Sync skills to Anthropic/OpenAI provider connections
25232
24262
  sync-mcp Re-discover an MCP connection's tools (refresh stale schemas)
25233
24263
  list List organizations and hubs
25234
- template list List ready-made hub templates
25235
- template pull Write a template's WayAI slice into wayai-ws/hubs/<slug>/
25236
24264
  report create Report a platform bug (submits to the triage queue)
25237
24265
  report edit Amend your own pending report (title/description/error/steps/context)
25238
24266
  update Update CLI to the latest version