@wayai/cli 0.3.57 → 0.3.59
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 +208 -86
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -43,6 +43,37 @@ var init_redact = __esm({
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
+
// src/lib/network-error.ts
|
|
47
|
+
function errorCode(value) {
|
|
48
|
+
if (value && typeof value === "object" && "code" in value) {
|
|
49
|
+
const code = value.code;
|
|
50
|
+
if (typeof code === "string") return code;
|
|
51
|
+
}
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
function isNetworkError(err) {
|
|
55
|
+
if (err instanceof TypeError && err.message === "fetch failed") return true;
|
|
56
|
+
if (!err || typeof err !== "object") return false;
|
|
57
|
+
const code = errorCode(err) ?? errorCode(err.cause);
|
|
58
|
+
return code !== void 0 && NETWORK_ERROR_CODES.has(code);
|
|
59
|
+
}
|
|
60
|
+
var NETWORK_ERROR_CODES;
|
|
61
|
+
var init_network_error = __esm({
|
|
62
|
+
"src/lib/network-error.ts"() {
|
|
63
|
+
"use strict";
|
|
64
|
+
NETWORK_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
65
|
+
"ECONNREFUSED",
|
|
66
|
+
"ENOTFOUND",
|
|
67
|
+
"ETIMEDOUT",
|
|
68
|
+
"ECONNRESET",
|
|
69
|
+
"EAI_AGAIN",
|
|
70
|
+
"ECONNABORTED",
|
|
71
|
+
"EHOSTUNREACH",
|
|
72
|
+
"ENETUNREACH"
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
46
77
|
// src/lib/sentry.ts
|
|
47
78
|
import * as Sentry from "@sentry/node";
|
|
48
79
|
import { readFileSync } from "fs";
|
|
@@ -111,6 +142,7 @@ function initSentry(command2) {
|
|
|
111
142
|
initialized = true;
|
|
112
143
|
}
|
|
113
144
|
function shouldReportToSentry(error) {
|
|
145
|
+
if (isNetworkError(error)) return false;
|
|
114
146
|
if (error instanceof Error) {
|
|
115
147
|
const e = error;
|
|
116
148
|
if (e.isExpected === true || e.isRetryable === true) return false;
|
|
@@ -168,6 +200,7 @@ var init_sentry = __esm({
|
|
|
168
200
|
"src/lib/sentry.ts"() {
|
|
169
201
|
"use strict";
|
|
170
202
|
init_redact();
|
|
203
|
+
init_network_error();
|
|
171
204
|
HARDCODED_DSN = "https://ffe500121277babcabf32e5868f00f9e@o4510669417807872.ingest.us.sentry.io/4510960145465344";
|
|
172
205
|
initialized = false;
|
|
173
206
|
}
|
|
@@ -259,11 +292,15 @@ var init_api_client = __esm({
|
|
|
259
292
|
}
|
|
260
293
|
// --- Templates gallery ---
|
|
261
294
|
// Consumer (any authed user): list the joint template set + pull the wayai slice.
|
|
262
|
-
|
|
263
|
-
|
|
295
|
+
// `locale` is optional — the server resolves to each template's defaultLocale when
|
|
296
|
+
// omitted, and falls back to it (with a resolvedLocale signal) when unauthored.
|
|
297
|
+
async templateList(locale) {
|
|
298
|
+
const qs = locale ? `?${new URLSearchParams({ locale })}` : "";
|
|
299
|
+
return this.request("GET", `/api/ci/templates${qs}`);
|
|
264
300
|
}
|
|
265
|
-
async templatePull(slug) {
|
|
266
|
-
|
|
301
|
+
async templatePull(slug, locale) {
|
|
302
|
+
const qs = locale ? `?${new URLSearchParams({ locale })}` : "";
|
|
303
|
+
return this.request("GET", `/api/ci/templates/${encodeURIComponent(slug)}${qs}`);
|
|
267
304
|
}
|
|
268
305
|
// Author (platform-admin): push a template into the store / pull it for inspection.
|
|
269
306
|
async adminTemplatePush(body) {
|
|
@@ -5211,7 +5248,7 @@ function findStepBoundaries(transcript) {
|
|
|
5211
5248
|
}
|
|
5212
5249
|
return out;
|
|
5213
5250
|
}
|
|
5214
|
-
var APP_ERROR_BRAND, AppError, LLM_RATE_LIMIT_BRAND, LlmRateLimitError, LLM_PROVIDER_HTTP_BRAND, LlmProviderHttpError, LLM_PROVIDER_TIMEOUT_BRAND, LlmProviderTimeoutError, ExternalServiceError, CHANNEL_PROVIDER_HTTP_BRAND, ChannelProviderHttpError, MEDIA_PROVIDER_HTTP_BRAND, MediaProviderHttpError, AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, SAFE_USER_ID_REGEX, uuidSchema, paginationSchema, timestampSchema, idParamSchema, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, 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, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, laneSchema, lanesArraySchema, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, createHubBody, updateHubBody, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, 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, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody, 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, analyticsSqlSchemaQuery, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS, paginationSchema2, evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, createEvalBody, updateEvalBody, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, createJourneyBody, updateJourneyBody, getConversationsQuery, getMessagesQuery, updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, activityQuery, deletionModeSchema, deletionRequestBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, sendMessageBody, listConversationsQuery, getConversationDetailParams, getConversationDetailQuery, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody, billingOrgIdParam, subscriptionItemParams, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, updateBillingCurrencyBody, invoicesQuery, downloadBody, uploadQuery, signUrlBody, completionsBody, 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, uuidPattern, ciUuidSchema, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, updatePlatformConfigBody, updateFreeOrgLimitBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysQuery, dataExplorerKvKeyParam, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteQuery, 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, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, browserParams, browserFoldersQuery, browserFilesQuery, stateOperationBody, conversationListResourcesQuery, conversationReadResourceQuery, listPendingSchedulesQuery, listHubAggregateSchedulesQuery, reportSourceSchema, intakeReportSourceSchema, reportClassificationSchema, reportStatusSchema, reportLocaleSchema, reportMessageAuthorRoleSchema, sentryRefStatusSchema, createReportBody, editReportBody, 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, TEMPLATE_SLUG_REGEX, templateSlugSchema, templateStatusSchema, templateFileMapSchema,
|
|
5251
|
+
var APP_ERROR_BRAND, AppError, LLM_RATE_LIMIT_BRAND, LlmRateLimitError, LLM_PROVIDER_HTTP_BRAND, LlmProviderHttpError, LLM_PROVIDER_TIMEOUT_BRAND, LlmProviderTimeoutError, ExternalServiceError, CHANNEL_PROVIDER_HTTP_BRAND, ChannelProviderHttpError, MEDIA_PROVIDER_HTTP_BRAND, MediaProviderHttpError, AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, uuidSchema, paginationSchema, timestampSchema, idParamSchema, primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody, 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, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, laneSchema, lanesArraySchema, hubIdParam, hubAdminIdParam, hubUserIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, createHubBody, updateHubBody, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, 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, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody, 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, analyticsSqlSchemaQuery, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS, paginationSchema2, evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, createEvalBody, updateEvalBody, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, createJourneyBody, updateJourneyBody, getConversationsQuery, getMessagesQuery, updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, activityQuery, deletionModeSchema, deletionRequestBody, archiveHubIdParam, archiveConversationParams, archiveListQuery, archiveMessageObservabilityParams, conversationIdParam, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, sendMessageBody, listConversationsQuery, getConversationDetailParams, getConversationDetailQuery, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody, billingOrgIdParam, subscriptionItemParams, spendCapBody, growthPacksBody, portalSessionBody, checkoutSessionBody, updateBillingCurrencyBody, invoicesQuery, downloadBody, uploadQuery, signUrlBody, completionsBody, 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, uuidPattern, ciUuidSchema, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, updatePlatformConfigBody, updateFreeOrgLimitBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysQuery, dataExplorerKvKeyParam, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteQuery, 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, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, browserParams, browserFoldersQuery, browserFilesQuery, stateOperationBody, conversationListResourcesQuery, conversationReadResourceQuery, listPendingSchedulesQuery, listHubAggregateSchedulesQuery, reportSourceSchema, intakeReportSourceSchema, reportClassificationSchema, reportStatusSchema, reportLocaleSchema, reportMessageAuthorRoleSchema, sentryRefStatusSchema, createReportBody, editReportBody, 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, templateLocaleSchema, TEMPLATE_SLUG_REGEX, templateSlugSchema, templateStatusSchema, templateFileMapSchema, templateTextSchema, templateRekorPointerSchema, templateYamlLocaleEntry, templateYamlWayaiBlock, templateYamlRekorBlock, templateYamlSchema, templateHeroSchema, templatePushLocaleSchema, templatePushBody, templateListQuery, templateSlugParam, templateDetailQuery, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam, WAYAI_WORKSPACE_LAYOUT, MAX_RESOURCE_FILE_SIZE;
|
|
5215
5252
|
var init_dist = __esm({
|
|
5216
5253
|
"../../packages/core/dist/index.js"() {
|
|
5217
5254
|
"use strict";
|
|
@@ -5387,6 +5424,7 @@ var init_dist = __esm({
|
|
|
5387
5424
|
"summarizer"
|
|
5388
5425
|
];
|
|
5389
5426
|
SAFE_USER_ID_REGEX = /^[A-Za-z0-9_-]{1,64}$/;
|
|
5427
|
+
SUPPORTED_LOCALES = ["en", "pt", "es"];
|
|
5390
5428
|
uuidSchema = external_exports.string().uuid();
|
|
5391
5429
|
paginationSchema = external_exports.object({
|
|
5392
5430
|
limit: external_exports.coerce.number().int().min(1).max(100).default(50),
|
|
@@ -7561,62 +7599,76 @@ var init_dist = __esm({
|
|
|
7561
7599
|
offset: external_exports.coerce.number().int().min(0).optional()
|
|
7562
7600
|
});
|
|
7563
7601
|
noticeIdParamSchema = external_exports.object({ id: external_exports.string().min(1) });
|
|
7602
|
+
templateLocaleSchema = external_exports.enum(SUPPORTED_LOCALES);
|
|
7564
7603
|
TEMPLATE_SLUG_REGEX = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
7565
7604
|
templateSlugSchema = external_exports.string().regex(TEMPLATE_SLUG_REGEX, "slug must be lowercase alphanumeric with hyphens (max 63)");
|
|
7566
7605
|
templateStatusSchema = external_exports.enum(["published", "draft", "internal"]);
|
|
7567
7606
|
templateFileMapSchema = external_exports.record(external_exports.string()).refine((m) => Object.keys(m).every(isSafeTemplatePath), {
|
|
7568
7607
|
message: 'file map contains an unsafe path (no absolute paths, "..", or backslashes)'
|
|
7569
7608
|
});
|
|
7570
|
-
|
|
7609
|
+
templateTextSchema = external_exports.object({
|
|
7571
7610
|
metaTitle: external_exports.string().min(1).max(200),
|
|
7572
|
-
metaDescription: external_exports.string().max(1e3).default("")
|
|
7573
|
-
installCommand: external_exports.string().min(1).max(300)
|
|
7611
|
+
metaDescription: external_exports.string().max(1e3).default("")
|
|
7574
7612
|
});
|
|
7575
|
-
|
|
7613
|
+
templateRekorPointerSchema = external_exports.object({
|
|
7576
7614
|
mcpEndpoint: external_exports.string().url().optional(),
|
|
7577
7615
|
url: external_exports.string().url().optional()
|
|
7578
7616
|
});
|
|
7579
|
-
|
|
7580
|
-
|
|
7617
|
+
templateYamlLocaleEntry = templateTextSchema.extend({ source: external_exports.string().min(1) });
|
|
7618
|
+
templateYamlWayaiBlock = external_exports.object({
|
|
7619
|
+
installCommand: external_exports.string().min(1).max(300),
|
|
7620
|
+
locales: external_exports.record(templateLocaleSchema, templateYamlLocaleEntry)
|
|
7581
7621
|
});
|
|
7582
|
-
templateYamlRekorBlock =
|
|
7583
|
-
|
|
7622
|
+
templateYamlRekorBlock = templateRekorPointerSchema.extend({
|
|
7623
|
+
locales: external_exports.record(templateLocaleSchema, templateYamlLocaleEntry)
|
|
7584
7624
|
});
|
|
7585
7625
|
templateYamlSchema = external_exports.object({
|
|
7586
7626
|
slug: templateSlugSchema,
|
|
7587
7627
|
category: external_exports.string().min(1).max(60),
|
|
7588
7628
|
status: templateStatusSchema.default("draft"),
|
|
7589
7629
|
order: external_exports.number().int().min(0).max(1e5).optional(),
|
|
7630
|
+
defaultLocale: templateLocaleSchema,
|
|
7590
7631
|
hero: external_exports.string().optional(),
|
|
7591
7632
|
// relative path to a hero image inside the template folder
|
|
7592
7633
|
wayai: templateYamlWayaiBlock.optional(),
|
|
7593
7634
|
rekor: templateYamlRekorBlock.optional()
|
|
7594
7635
|
}).refine((c) => Boolean(c.wayai) || Boolean(c.rekor), {
|
|
7595
7636
|
message: "template.yaml must define at least one of `wayai:` or `rekor:`"
|
|
7596
|
-
})
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
order: external_exports.number().int().min(0).max(1e5).default(0),
|
|
7601
|
-
wayai: templateWayaiBlockSchema.optional(),
|
|
7602
|
-
rekor: templateRekorBlockSchema.optional()
|
|
7637
|
+
}).refine((c) => !c.wayai || Boolean(c.wayai.locales[c.defaultLocale]), {
|
|
7638
|
+
message: "`wayai.locales` must include the defaultLocale"
|
|
7639
|
+
}).refine((c) => !c.rekor || Boolean(c.rekor.locales[c.defaultLocale]), {
|
|
7640
|
+
message: "`rekor.locales` must include the defaultLocale"
|
|
7603
7641
|
});
|
|
7604
7642
|
templateHeroSchema = external_exports.object({
|
|
7605
7643
|
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)"),
|
|
7606
|
-
// ~8MB of base64 ≈ a ~6MB image — a generous cap that bounds the inline payload
|
|
7607
|
-
// (the endpoint is platform-admin-only, but an unbounded blob is still avoidable).
|
|
7608
7644
|
dataBase64: external_exports.string().min(1).max(8e6)
|
|
7609
7645
|
});
|
|
7646
|
+
templatePushLocaleSchema = external_exports.object({
|
|
7647
|
+
wayai: templateTextSchema.optional(),
|
|
7648
|
+
rekorText: templateTextSchema.optional(),
|
|
7649
|
+
readmeMarkdown: external_exports.string().default(""),
|
|
7650
|
+
wayaiFiles: templateFileMapSchema.optional()
|
|
7651
|
+
});
|
|
7610
7652
|
templatePushBody = external_exports.object({
|
|
7611
7653
|
slug: templateSlugSchema,
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7654
|
+
defaultLocale: templateLocaleSchema,
|
|
7655
|
+
common: external_exports.object({
|
|
7656
|
+
category: external_exports.string().min(1).max(60),
|
|
7657
|
+
status: templateStatusSchema,
|
|
7658
|
+
order: external_exports.number().int().min(0).max(1e5).default(0),
|
|
7659
|
+
// The WayAI install command — present iff the template has a wayai side; a
|
|
7660
|
+
// Rekor-only template omits it.
|
|
7661
|
+
installCommand: external_exports.string().min(1).max(300).optional(),
|
|
7662
|
+
hero: templateHeroSchema.optional(),
|
|
7663
|
+
rekorPointer: templateRekorPointerSchema.optional()
|
|
7664
|
+
}),
|
|
7665
|
+
locales: external_exports.record(templateLocaleSchema, templatePushLocaleSchema)
|
|
7666
|
+
}).refine((b) => Boolean(b.locales[b.defaultLocale]), {
|
|
7667
|
+
message: "`locales` must include the defaultLocale"
|
|
7618
7668
|
});
|
|
7669
|
+
templateListQuery = external_exports.object({ locale: templateLocaleSchema.optional() });
|
|
7619
7670
|
templateSlugParam = external_exports.object({ slug: templateSlugSchema });
|
|
7671
|
+
templateDetailQuery = external_exports.object({ locale: templateLocaleSchema.optional() });
|
|
7620
7672
|
ADMIN_SKILL_NAME_REGEX = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
7621
7673
|
adminSkillNameParam = external_exports.object({
|
|
7622
7674
|
name: external_exports.string().regex(ADMIN_SKILL_NAME_REGEX, "invalid skill name")
|
|
@@ -13091,7 +13143,7 @@ function isSafeTemplatePath2(path22) {
|
|
|
13091
13143
|
(seg) => seg.length > 0 && seg !== "." && seg !== ".." && /^[A-Za-z0-9._-]+$/.test(seg)
|
|
13092
13144
|
);
|
|
13093
13145
|
}
|
|
13094
|
-
var uuidSchema2, paginationSchema3, timestampSchema2, idParamSchema2, primaryRegionSchema2, placementSourceSchema2, orgIdParam2, orgAdminIdParam2, createOrganizationBody2, updateOrganizationBody2, addOrgAdminBody2, AUTH_TYPE2, ORG_CREDENTIAL_AUTH_TYPES2, AUTH_TYPE_DISPLAY2, LEGACY_AUTH_TYPE_MAP2, VALID_AUTH_TYPES2, AGENT_ROLES2, SAFE_USER_ID_REGEX2, 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, EXCLUSIVE_FLAG_PAIRS2, kanbanStatusSchema2, kanbanStatusesArraySchema2, laneSchema2, lanesArraySchema2, hubIdParam2, hubAdminIdParam2, hubUserIdParam2, hubIdentityIdParam2, hubTeamIdParam2, hubTeamUserDeleteParam2, hubSchemaQuery2, createHubBody2, updateHubBody2, addHubAdminBody2, addHubIdentityAuthorizationBody2, contactDecisionBody2, approveContactBody2, listContactAccessQuery2, createHubTeamBody2, updateHubTeamBody2, addHubTeamUserBody2, reassignHubUserBody2, replicatePreviewBody2, claimCodeChannelParam2, claimCodeDeleteParam2, connectionIdParam2, connectorIdParam2, listConnectionsQuery2, deleteConnectionQuery2, addConnectionBody2, editConnectionBody2, 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, addNativeToolBody2, addMcpToolBody2, createCustomToolBody2, updateCustomToolBody2, updateToolExecutionConfigBody2, initialValueCreateSchema2, initialValueUpdateSchema2, stateIdParam2, listStatesQuery2, stateNameSchema2, createStateBody2, updateStateBody2, reorderStatesBody2, 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, analyticsSqlSchemaQuery2, PACING_INTERVAL_MIN_MS2, PACING_INTERVAL_MAX_MS2, EVAL_RUN_DEADLINE_MIN_MS2, EVAL_RUN_DEADLINE_MAX_MS2, paginationSchema22, evalIdParam2, sessionIdParam2, scenarioSetIdParam2, hubIdQuery2, createEvalBody2, updateEvalBody2, getEvalsQuery2, toggleEvalBody2, bulkToggleEvalsBody2, pacingConfigSchema2, sessionConfigSchema2, createSessionBody2, getSessionsQuery2, getSessionResultsQuery2, getSessionRunsQuery2, evalAnalyticsQuery2, getSessionCostQuery2, compareSessionsQuery2, evalsSqlBody2, evalsSqlSchemaQuery2, exportResultsQuery2, validateEvalBody2, hubAgentsQuery2, createScenarioSetBody2, updateScenarioSetBody2, scenarioSetsHubQuery2, createScenarioFromConversationBody2, createJourneyFromConversationBody2, journeyIdParam2, journeyToolCallSchema2, journeyTurnSchema2, journeyStepOverrideSchema2, createJourneyBody2, updateJourneyBody2, getConversationsQuery2, getMessagesQuery2, updateUserBody2, updateProfileBody2, pathnameRegex2, updatePreferencesBody2, registerPushTokenBody2, deletePushTokenQuery2, activityQuery2, deletionModeSchema2, deletionRequestBody2, archiveHubIdParam2, archiveConversationParams2, archiveListQuery2, archiveMessageObservabilityParams2, conversationIdParam2, claimBody2, releaseBody2, transferBody2, closeBody2, additionalContextPayloadSchema2, kanbanUpdateBody2, observabilityParams2, observabilityListParams2, deleteUserConversationsBody2, sendMessageBody2, listConversationsQuery2, getConversationDetailParams2, getConversationDetailQuery2, listWhatsAppTemplatesQuery2, sendWhatsAppTemplateBody2, billingOrgIdParam2, subscriptionItemParams2, spendCapBody2, growthPacksBody2, portalSessionBody2, checkoutSessionBody2, updateBillingCurrencyBody2, invoicesQuery2, downloadBody2, uploadQuery2, signUrlBody2, completionsBody2, 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, uuidPattern2, ciUuidSchema2, hubAsCodeConfigSchema2, ciPullHubIdParam2, ciBranchParam2, ciPullQuery2, ciHubsQuery2, ciLookupQuery2, ciBranchesQuery2, ciSyncBody2, ciPushBody2, ciDiffBody2, ciPublishBody2, ciPublishPreviewBody2, ciSyncMcpBody2, ciOrgResourcesParam2, orgResourcesConfigSchema2, ciOrgResourcesPushBody2, ciOrgResourcesDiffBody2, adminOrgIdParam2, adminOrgAdminIdParam2, adminUserIdParam2, adminPlanIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, updatePricingPlanBody2, dataExplorerSearchQuery2, dataExplorerOrgIdParam2, dataExplorerHubIdParam2, dataExplorerConvIdParam2, dataExplorerDoInstancesQuery2, dataExplorerNsIdParam2, dataExplorerKvKeysQuery2, dataExplorerKvKeyParam2, uuidOrHexId2, dataExplorerDeleteOrgParam2, dataExplorerDeleteHubParam2, dataExplorerDeleteConvParam2, dataExplorerDeleteUserParam2, dataExplorerDeleteQuery2, dataExplorerKvDeleteQuery2, 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, whatsappCallbackBody2, authMeResponse2, wsTicketResponse2, sessionCheckResponse2, logoutResponse2, magicCodeSendBody2, magicCodeSendResponse2, magicCodeVerifyBody2, magicCodeVerifyResponse2, browserParams2, browserFoldersQuery2, browserFilesQuery2, stateOperationBody2, conversationListResourcesQuery2, conversationReadResourceQuery2, listPendingSchedulesQuery2, listHubAggregateSchedulesQuery2, reportSourceSchema2, intakeReportSourceSchema2, reportClassificationSchema2, reportStatusSchema2, reportLocaleSchema2, reportMessageAuthorRoleSchema2, sentryRefStatusSchema2, createReportBody2, editReportBody2, 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, TEMPLATE_SLUG_REGEX2, templateSlugSchema2, templateStatusSchema2, templateFileMapSchema2,
|
|
13146
|
+
var uuidSchema2, paginationSchema3, timestampSchema2, idParamSchema2, primaryRegionSchema2, placementSourceSchema2, orgIdParam2, orgAdminIdParam2, createOrganizationBody2, updateOrganizationBody2, addOrgAdminBody2, AUTH_TYPE2, ORG_CREDENTIAL_AUTH_TYPES2, AUTH_TYPE_DISPLAY2, LEGACY_AUTH_TYPE_MAP2, VALID_AUTH_TYPES2, AGENT_ROLES2, SAFE_USER_ID_REGEX2, SUPPORTED_LOCALES2, 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, EXCLUSIVE_FLAG_PAIRS2, kanbanStatusSchema2, kanbanStatusesArraySchema2, laneSchema2, lanesArraySchema2, hubIdParam2, hubAdminIdParam2, hubUserIdParam2, hubIdentityIdParam2, hubTeamIdParam2, hubTeamUserDeleteParam2, hubSchemaQuery2, createHubBody2, updateHubBody2, addHubAdminBody2, addHubIdentityAuthorizationBody2, contactDecisionBody2, approveContactBody2, listContactAccessQuery2, createHubTeamBody2, updateHubTeamBody2, addHubTeamUserBody2, reassignHubUserBody2, replicatePreviewBody2, claimCodeChannelParam2, claimCodeDeleteParam2, connectionIdParam2, connectorIdParam2, listConnectionsQuery2, deleteConnectionQuery2, addConnectionBody2, editConnectionBody2, 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, addNativeToolBody2, addMcpToolBody2, createCustomToolBody2, updateCustomToolBody2, updateToolExecutionConfigBody2, initialValueCreateSchema2, initialValueUpdateSchema2, stateIdParam2, listStatesQuery2, stateNameSchema2, createStateBody2, updateStateBody2, reorderStatesBody2, 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, analyticsSqlSchemaQuery2, PACING_INTERVAL_MIN_MS2, PACING_INTERVAL_MAX_MS2, EVAL_RUN_DEADLINE_MIN_MS2, EVAL_RUN_DEADLINE_MAX_MS2, paginationSchema22, evalIdParam2, sessionIdParam2, scenarioSetIdParam2, hubIdQuery2, createEvalBody2, updateEvalBody2, getEvalsQuery2, toggleEvalBody2, bulkToggleEvalsBody2, pacingConfigSchema2, sessionConfigSchema2, createSessionBody2, getSessionsQuery2, getSessionResultsQuery2, getSessionRunsQuery2, evalAnalyticsQuery2, getSessionCostQuery2, compareSessionsQuery2, evalsSqlBody2, evalsSqlSchemaQuery2, exportResultsQuery2, validateEvalBody2, hubAgentsQuery2, createScenarioSetBody2, updateScenarioSetBody2, scenarioSetsHubQuery2, createScenarioFromConversationBody2, createJourneyFromConversationBody2, journeyIdParam2, journeyToolCallSchema2, journeyTurnSchema2, journeyStepOverrideSchema2, createJourneyBody2, updateJourneyBody2, getConversationsQuery2, getMessagesQuery2, updateUserBody2, updateProfileBody2, pathnameRegex2, updatePreferencesBody2, registerPushTokenBody2, deletePushTokenQuery2, activityQuery2, deletionModeSchema2, deletionRequestBody2, archiveHubIdParam2, archiveConversationParams2, archiveListQuery2, archiveMessageObservabilityParams2, conversationIdParam2, claimBody2, releaseBody2, transferBody2, closeBody2, additionalContextPayloadSchema2, kanbanUpdateBody2, observabilityParams2, observabilityListParams2, deleteUserConversationsBody2, sendMessageBody2, listConversationsQuery2, getConversationDetailParams2, getConversationDetailQuery2, listWhatsAppTemplatesQuery2, sendWhatsAppTemplateBody2, billingOrgIdParam2, subscriptionItemParams2, spendCapBody2, growthPacksBody2, portalSessionBody2, checkoutSessionBody2, updateBillingCurrencyBody2, invoicesQuery2, downloadBody2, uploadQuery2, signUrlBody2, completionsBody2, 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, uuidPattern2, ciUuidSchema2, hubAsCodeConfigSchema2, ciPullHubIdParam2, ciBranchParam2, ciPullQuery2, ciHubsQuery2, ciLookupQuery2, ciBranchesQuery2, ciSyncBody2, ciPushBody2, ciDiffBody2, ciPublishBody2, ciPublishPreviewBody2, ciSyncMcpBody2, ciOrgResourcesParam2, orgResourcesConfigSchema2, ciOrgResourcesPushBody2, ciOrgResourcesDiffBody2, adminOrgIdParam2, adminOrgAdminIdParam2, adminUserIdParam2, adminPlanIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, updatePricingPlanBody2, dataExplorerSearchQuery2, dataExplorerOrgIdParam2, dataExplorerHubIdParam2, dataExplorerConvIdParam2, dataExplorerDoInstancesQuery2, dataExplorerNsIdParam2, dataExplorerKvKeysQuery2, dataExplorerKvKeyParam2, uuidOrHexId2, dataExplorerDeleteOrgParam2, dataExplorerDeleteHubParam2, dataExplorerDeleteConvParam2, dataExplorerDeleteUserParam2, dataExplorerDeleteQuery2, dataExplorerKvDeleteQuery2, 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, whatsappCallbackBody2, authMeResponse2, wsTicketResponse2, sessionCheckResponse2, logoutResponse2, magicCodeSendBody2, magicCodeSendResponse2, magicCodeVerifyBody2, magicCodeVerifyResponse2, browserParams2, browserFoldersQuery2, browserFilesQuery2, stateOperationBody2, conversationListResourcesQuery2, conversationReadResourceQuery2, listPendingSchedulesQuery2, listHubAggregateSchedulesQuery2, reportSourceSchema2, intakeReportSourceSchema2, reportClassificationSchema2, reportStatusSchema2, reportLocaleSchema2, reportMessageAuthorRoleSchema2, sentryRefStatusSchema2, createReportBody2, editReportBody2, 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, templateLocaleSchema2, TEMPLATE_SLUG_REGEX2, templateSlugSchema2, templateStatusSchema2, templateFileMapSchema2, templateTextSchema2, templateRekorPointerSchema2, templateYamlLocaleEntry2, templateYamlWayaiBlock2, templateYamlRekorBlock2, templateYamlSchema2, templateHeroSchema2, templatePushLocaleSchema2, templatePushBody2, templateListQuery2, templateSlugParam2, templateDetailQuery2, ADMIN_SKILL_NAME_REGEX2, adminSkillNameParam2;
|
|
13095
13147
|
var init_contracts = __esm({
|
|
13096
13148
|
"../../packages/core/dist/contracts/index.js"() {
|
|
13097
13149
|
"use strict";
|
|
@@ -13232,6 +13284,7 @@ var init_contracts = __esm({
|
|
|
13232
13284
|
"summarizer"
|
|
13233
13285
|
];
|
|
13234
13286
|
SAFE_USER_ID_REGEX2 = /^[A-Za-z0-9_-]{1,64}$/;
|
|
13287
|
+
SUPPORTED_LOCALES2 = ["en", "pt", "es"];
|
|
13235
13288
|
SUMMARIZATION_THRESHOLD_MIN2 = 1e3;
|
|
13236
13289
|
SUMMARIZATION_THRESHOLD_MAX2 = 1e6;
|
|
13237
13290
|
summarizationThresholdField2 = external_exports.number().int().min(SUMMARIZATION_THRESHOLD_MIN2).max(SUMMARIZATION_THRESHOLD_MAX2).nullable().optional();
|
|
@@ -15357,62 +15410,76 @@ var init_contracts = __esm({
|
|
|
15357
15410
|
offset: external_exports.coerce.number().int().min(0).optional()
|
|
15358
15411
|
});
|
|
15359
15412
|
noticeIdParamSchema2 = external_exports.object({ id: external_exports.string().min(1) });
|
|
15413
|
+
templateLocaleSchema2 = external_exports.enum(SUPPORTED_LOCALES2);
|
|
15360
15414
|
TEMPLATE_SLUG_REGEX2 = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
15361
15415
|
templateSlugSchema2 = external_exports.string().regex(TEMPLATE_SLUG_REGEX2, "slug must be lowercase alphanumeric with hyphens (max 63)");
|
|
15362
15416
|
templateStatusSchema2 = external_exports.enum(["published", "draft", "internal"]);
|
|
15363
15417
|
templateFileMapSchema2 = external_exports.record(external_exports.string()).refine((m) => Object.keys(m).every(isSafeTemplatePath2), {
|
|
15364
15418
|
message: 'file map contains an unsafe path (no absolute paths, "..", or backslashes)'
|
|
15365
15419
|
});
|
|
15366
|
-
|
|
15420
|
+
templateTextSchema2 = external_exports.object({
|
|
15367
15421
|
metaTitle: external_exports.string().min(1).max(200),
|
|
15368
|
-
metaDescription: external_exports.string().max(1e3).default("")
|
|
15369
|
-
installCommand: external_exports.string().min(1).max(300)
|
|
15422
|
+
metaDescription: external_exports.string().max(1e3).default("")
|
|
15370
15423
|
});
|
|
15371
|
-
|
|
15424
|
+
templateRekorPointerSchema2 = external_exports.object({
|
|
15372
15425
|
mcpEndpoint: external_exports.string().url().optional(),
|
|
15373
15426
|
url: external_exports.string().url().optional()
|
|
15374
15427
|
});
|
|
15375
|
-
|
|
15376
|
-
|
|
15428
|
+
templateYamlLocaleEntry2 = templateTextSchema2.extend({ source: external_exports.string().min(1) });
|
|
15429
|
+
templateYamlWayaiBlock2 = external_exports.object({
|
|
15430
|
+
installCommand: external_exports.string().min(1).max(300),
|
|
15431
|
+
locales: external_exports.record(templateLocaleSchema2, templateYamlLocaleEntry2)
|
|
15377
15432
|
});
|
|
15378
|
-
templateYamlRekorBlock2 =
|
|
15379
|
-
|
|
15433
|
+
templateYamlRekorBlock2 = templateRekorPointerSchema2.extend({
|
|
15434
|
+
locales: external_exports.record(templateLocaleSchema2, templateYamlLocaleEntry2)
|
|
15380
15435
|
});
|
|
15381
15436
|
templateYamlSchema2 = external_exports.object({
|
|
15382
15437
|
slug: templateSlugSchema2,
|
|
15383
15438
|
category: external_exports.string().min(1).max(60),
|
|
15384
15439
|
status: templateStatusSchema2.default("draft"),
|
|
15385
15440
|
order: external_exports.number().int().min(0).max(1e5).optional(),
|
|
15441
|
+
defaultLocale: templateLocaleSchema2,
|
|
15386
15442
|
hero: external_exports.string().optional(),
|
|
15387
15443
|
// relative path to a hero image inside the template folder
|
|
15388
15444
|
wayai: templateYamlWayaiBlock2.optional(),
|
|
15389
15445
|
rekor: templateYamlRekorBlock2.optional()
|
|
15390
15446
|
}).refine((c) => Boolean(c.wayai) || Boolean(c.rekor), {
|
|
15391
15447
|
message: "template.yaml must define at least one of `wayai:` or `rekor:`"
|
|
15392
|
-
})
|
|
15393
|
-
|
|
15394
|
-
|
|
15395
|
-
|
|
15396
|
-
order: external_exports.number().int().min(0).max(1e5).default(0),
|
|
15397
|
-
wayai: templateWayaiBlockSchema2.optional(),
|
|
15398
|
-
rekor: templateRekorBlockSchema2.optional()
|
|
15448
|
+
}).refine((c) => !c.wayai || Boolean(c.wayai.locales[c.defaultLocale]), {
|
|
15449
|
+
message: "`wayai.locales` must include the defaultLocale"
|
|
15450
|
+
}).refine((c) => !c.rekor || Boolean(c.rekor.locales[c.defaultLocale]), {
|
|
15451
|
+
message: "`rekor.locales` must include the defaultLocale"
|
|
15399
15452
|
});
|
|
15400
15453
|
templateHeroSchema2 = external_exports.object({
|
|
15401
15454
|
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)"),
|
|
15402
|
-
// ~8MB of base64 ≈ a ~6MB image — a generous cap that bounds the inline payload
|
|
15403
|
-
// (the endpoint is platform-admin-only, but an unbounded blob is still avoidable).
|
|
15404
15455
|
dataBase64: external_exports.string().min(1).max(8e6)
|
|
15405
15456
|
});
|
|
15457
|
+
templatePushLocaleSchema2 = external_exports.object({
|
|
15458
|
+
wayai: templateTextSchema2.optional(),
|
|
15459
|
+
rekorText: templateTextSchema2.optional(),
|
|
15460
|
+
readmeMarkdown: external_exports.string().default(""),
|
|
15461
|
+
wayaiFiles: templateFileMapSchema2.optional()
|
|
15462
|
+
});
|
|
15406
15463
|
templatePushBody2 = external_exports.object({
|
|
15407
15464
|
slug: templateSlugSchema2,
|
|
15408
|
-
|
|
15409
|
-
|
|
15410
|
-
|
|
15411
|
-
|
|
15412
|
-
|
|
15413
|
-
|
|
15465
|
+
defaultLocale: templateLocaleSchema2,
|
|
15466
|
+
common: external_exports.object({
|
|
15467
|
+
category: external_exports.string().min(1).max(60),
|
|
15468
|
+
status: templateStatusSchema2,
|
|
15469
|
+
order: external_exports.number().int().min(0).max(1e5).default(0),
|
|
15470
|
+
// The WayAI install command — present iff the template has a wayai side; a
|
|
15471
|
+
// Rekor-only template omits it.
|
|
15472
|
+
installCommand: external_exports.string().min(1).max(300).optional(),
|
|
15473
|
+
hero: templateHeroSchema2.optional(),
|
|
15474
|
+
rekorPointer: templateRekorPointerSchema2.optional()
|
|
15475
|
+
}),
|
|
15476
|
+
locales: external_exports.record(templateLocaleSchema2, templatePushLocaleSchema2)
|
|
15477
|
+
}).refine((b) => Boolean(b.locales[b.defaultLocale]), {
|
|
15478
|
+
message: "`locales` must include the defaultLocale"
|
|
15414
15479
|
});
|
|
15480
|
+
templateListQuery2 = external_exports.object({ locale: templateLocaleSchema2.optional() });
|
|
15415
15481
|
templateSlugParam2 = external_exports.object({ slug: templateSlugSchema2 });
|
|
15482
|
+
templateDetailQuery2 = external_exports.object({ locale: templateLocaleSchema2.optional() });
|
|
15416
15483
|
ADMIN_SKILL_NAME_REGEX2 = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
15417
15484
|
adminSkillNameParam2 = external_exports.object({
|
|
15418
15485
|
name: external_exports.string().regex(ADMIN_SKILL_NAME_REGEX2, "invalid skill name")
|
|
@@ -16703,9 +16770,32 @@ async function runTemplateList() {
|
|
|
16703
16770
|
}
|
|
16704
16771
|
}
|
|
16705
16772
|
async function runTemplatePull(rest) {
|
|
16706
|
-
const
|
|
16773
|
+
const positional = [];
|
|
16774
|
+
let lang;
|
|
16775
|
+
for (let i = 0; i < rest.length; i++) {
|
|
16776
|
+
if (rest[i] === "--lang") {
|
|
16777
|
+
const v = rest[++i];
|
|
16778
|
+
if (!v) {
|
|
16779
|
+
console.error("--lang requires a value");
|
|
16780
|
+
process.exit(1);
|
|
16781
|
+
}
|
|
16782
|
+
const parsed = templateLocaleSchema2.safeParse(v);
|
|
16783
|
+
if (!parsed.success) {
|
|
16784
|
+
console.error(`Invalid --lang "${v}": must be one of ${templateLocaleSchema2.options.join(", ")}.`);
|
|
16785
|
+
process.exit(1);
|
|
16786
|
+
}
|
|
16787
|
+
lang = parsed.data;
|
|
16788
|
+
continue;
|
|
16789
|
+
}
|
|
16790
|
+
if (rest[i].startsWith("--")) {
|
|
16791
|
+
console.error(`Unknown flag: ${rest[i]}`);
|
|
16792
|
+
process.exit(1);
|
|
16793
|
+
}
|
|
16794
|
+
positional.push(rest[i]);
|
|
16795
|
+
}
|
|
16796
|
+
const slug = positional[0];
|
|
16707
16797
|
if (!slug) {
|
|
16708
|
-
console.error("wayai template pull <slug>");
|
|
16798
|
+
console.error("wayai template pull <slug> [--lang <locale>]");
|
|
16709
16799
|
process.exit(1);
|
|
16710
16800
|
}
|
|
16711
16801
|
if (!TEMPLATE_SLUG_REGEX2.test(slug)) {
|
|
@@ -16721,13 +16811,16 @@ async function runTemplatePull(rest) {
|
|
|
16721
16811
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
16722
16812
|
let detail;
|
|
16723
16813
|
try {
|
|
16724
|
-
detail = await client.templatePull(slug);
|
|
16814
|
+
detail = await client.templatePull(slug, lang);
|
|
16725
16815
|
} catch (err) {
|
|
16726
16816
|
exitOnTemplateApiError(err);
|
|
16727
16817
|
throw err;
|
|
16728
16818
|
}
|
|
16819
|
+
if (detail.resolvedLocale !== detail.requestedLocale) {
|
|
16820
|
+
console.log(`Note: "${detail.requestedLocale}" not translated yet \u2014 pulled "${detail.resolvedLocale}" instead.`);
|
|
16821
|
+
}
|
|
16729
16822
|
if (!detail.includes.wayai) {
|
|
16730
|
-
console.log(`Template "${slug}" has no WayAI slice \u2014 run \`rekor template pull ${slug}\` for its data layer.`);
|
|
16823
|
+
console.log(`Template "${slug}" has no WayAI slice \u2014 run \`rekor template pull ${slug}${langFlag(lang)}\` for its data layer.`);
|
|
16731
16824
|
return;
|
|
16732
16825
|
}
|
|
16733
16826
|
const targetDir = path20.join(resolveLayout(gitRoot).hubsDir, slug);
|
|
@@ -16736,15 +16829,21 @@ async function runTemplatePull(rest) {
|
|
|
16736
16829
|
console.log(`Next: \`wayai push\` to deploy it into your own hub.`);
|
|
16737
16830
|
if (detail.includes.rekor) {
|
|
16738
16831
|
console.log(`
|
|
16739
|
-
This template includes a Rekor data layer \u2014 run \`rekor template pull ${slug}\` to add it.`);
|
|
16832
|
+
This template includes a Rekor data layer \u2014 run \`rekor template pull ${slug}${langFlag(lang)}\` to add it.`);
|
|
16740
16833
|
}
|
|
16741
16834
|
}
|
|
16835
|
+
function langFlag(lang) {
|
|
16836
|
+
return lang ? ` --lang ${lang}` : "";
|
|
16837
|
+
}
|
|
16742
16838
|
function printTemplateHelp() {
|
|
16743
16839
|
console.log(`wayai template \u2014 install ready-made hub templates
|
|
16744
16840
|
|
|
16745
16841
|
Usage:
|
|
16746
|
-
wayai template list
|
|
16747
|
-
wayai template pull <slug>
|
|
16842
|
+
wayai template list List available templates
|
|
16843
|
+
wayai template pull <slug> [--lang <l>] Write a template's WayAI slice into wayai-ws/hubs/<slug>/
|
|
16844
|
+
|
|
16845
|
+
--lang selects a localized variant (${templateLocaleSchema2.options.join("|")}); omitted = the template's default
|
|
16846
|
+
language. An untranslated language falls back to the default (with a note).
|
|
16748
16847
|
|
|
16749
16848
|
After pulling, run \`wayai push\` to deploy the template into your own hub.`);
|
|
16750
16849
|
}
|
|
@@ -17224,17 +17323,36 @@ async function runTemplatePush(positional) {
|
|
|
17224
17323
|
console.error(`template.yaml slug "${manifest.slug}" does not match folder "${slug}".`);
|
|
17225
17324
|
process.exit(1);
|
|
17226
17325
|
}
|
|
17227
|
-
|
|
17228
|
-
|
|
17229
|
-
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
|
|
17326
|
+
const authoredLocales = /* @__PURE__ */ new Set([
|
|
17327
|
+
...manifest.wayai ? Object.keys(manifest.wayai.locales) : [],
|
|
17328
|
+
...manifest.rekor ? Object.keys(manifest.rekor.locales) : []
|
|
17329
|
+
]);
|
|
17330
|
+
const locales = {};
|
|
17331
|
+
for (const locale of authoredLocales) {
|
|
17332
|
+
const wayaiEntry = manifest.wayai?.locales[locale];
|
|
17333
|
+
const rekorEntry = manifest.rekor?.locales[locale];
|
|
17334
|
+
let wayaiFiles;
|
|
17335
|
+
if (wayaiEntry) {
|
|
17336
|
+
const sliceDir = path21.resolve(templateDir, wayaiEntry.source);
|
|
17337
|
+
if (!fs17.existsSync(sliceDir)) {
|
|
17338
|
+
console.error(`wayai source not found for ${locale}: ${wayaiEntry.source} (resolved ${sliceDir})`);
|
|
17339
|
+
process.exit(1);
|
|
17340
|
+
}
|
|
17341
|
+
wayaiFiles = readDirToFileMap(sliceDir);
|
|
17233
17342
|
}
|
|
17234
|
-
|
|
17343
|
+
const readmePath = path21.join(templateDir, `README.${locale}.md`);
|
|
17344
|
+
const readmeMarkdown = fs17.existsSync(readmePath) ? fs17.readFileSync(readmePath, "utf-8") : "";
|
|
17345
|
+
locales[locale] = {
|
|
17346
|
+
readmeMarkdown,
|
|
17347
|
+
...wayaiFiles && { wayaiFiles },
|
|
17348
|
+
...wayaiEntry && {
|
|
17349
|
+
wayai: { metaTitle: wayaiEntry.metaTitle, metaDescription: wayaiEntry.metaDescription }
|
|
17350
|
+
},
|
|
17351
|
+
...rekorEntry && {
|
|
17352
|
+
rekorText: { metaTitle: rekorEntry.metaTitle, metaDescription: rekorEntry.metaDescription }
|
|
17353
|
+
}
|
|
17354
|
+
};
|
|
17235
17355
|
}
|
|
17236
|
-
const readmePath = path21.join(templateDir, "README.md");
|
|
17237
|
-
const readmeMarkdown = fs17.existsSync(readmePath) ? fs17.readFileSync(readmePath, "utf-8") : "";
|
|
17238
17356
|
let hero;
|
|
17239
17357
|
if (manifest.hero) {
|
|
17240
17358
|
const heroPath = path21.resolve(templateDir, manifest.hero);
|
|
@@ -17244,27 +17362,27 @@ async function runTemplatePush(positional) {
|
|
|
17244
17362
|
console.error(`Warning: hero not found at ${manifest.hero}; skipping.`);
|
|
17245
17363
|
}
|
|
17246
17364
|
}
|
|
17247
|
-
const
|
|
17248
|
-
|
|
17249
|
-
|
|
17250
|
-
|
|
17251
|
-
|
|
17252
|
-
|
|
17253
|
-
|
|
17254
|
-
|
|
17255
|
-
|
|
17365
|
+
const body = {
|
|
17366
|
+
slug,
|
|
17367
|
+
defaultLocale: manifest.defaultLocale,
|
|
17368
|
+
common: {
|
|
17369
|
+
category: manifest.category,
|
|
17370
|
+
status: manifest.status,
|
|
17371
|
+
order: manifest.order ?? 0,
|
|
17372
|
+
// The install command is the wayai one (locale-agnostic). OMIT it for a
|
|
17373
|
+
// Rekor-only template — the contract requires installCommand be non-empty
|
|
17374
|
+
// when present, so sending '' would 400 the whole push.
|
|
17375
|
+
...manifest.wayai?.installCommand && { installCommand: manifest.wayai.installCommand },
|
|
17376
|
+
...hero && { hero },
|
|
17377
|
+
...manifest.rekor && (manifest.rekor.mcpEndpoint || manifest.rekor.url) && {
|
|
17378
|
+
rekorPointer: {
|
|
17379
|
+
...manifest.rekor.mcpEndpoint && { mcpEndpoint: manifest.rekor.mcpEndpoint },
|
|
17380
|
+
...manifest.rekor.url && { url: manifest.rekor.url }
|
|
17381
|
+
}
|
|
17256
17382
|
}
|
|
17257
17383
|
},
|
|
17258
|
-
|
|
17259
|
-
rekor: {
|
|
17260
|
-
metaTitle: manifest.rekor.metaTitle,
|
|
17261
|
-
metaDescription: manifest.rekor.metaDescription,
|
|
17262
|
-
installCommand: manifest.rekor.installCommand,
|
|
17263
|
-
...manifest.rekor.mcpEndpoint && { mcpEndpoint: manifest.rekor.mcpEndpoint }
|
|
17264
|
-
}
|
|
17265
|
-
}
|
|
17384
|
+
locales
|
|
17266
17385
|
};
|
|
17267
|
-
const body = { slug, metadata, wayaiFiles, readmeMarkdown, hero };
|
|
17268
17386
|
const { config, accessToken } = await requireAuth();
|
|
17269
17387
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
17270
17388
|
let result;
|
|
@@ -18230,7 +18348,11 @@ import { dirname as dirname9, join as join24 } from "path";
|
|
|
18230
18348
|
|
|
18231
18349
|
// src/lib/errors.ts
|
|
18232
18350
|
init_api_client();
|
|
18351
|
+
init_network_error();
|
|
18233
18352
|
function friendlyHint(err) {
|
|
18353
|
+
if (isNetworkError(err)) {
|
|
18354
|
+
return "Couldn't reach WayAI \u2014 check your network connection and try again.";
|
|
18355
|
+
}
|
|
18234
18356
|
if (!(err instanceof ApiError)) return null;
|
|
18235
18357
|
const { status } = err;
|
|
18236
18358
|
if (status === 401) return "Your session may have expired. Run `wayai login` to re-authenticate.";
|