@wayai/cli 0.3.56 → 0.3.58
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 +270 -99
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -174,6 +174,11 @@ var init_sentry = __esm({
|
|
|
174
174
|
});
|
|
175
175
|
|
|
176
176
|
// src/lib/api-client.ts
|
|
177
|
+
var api_client_exports = {};
|
|
178
|
+
__export(api_client_exports, {
|
|
179
|
+
ApiClient: () => ApiClient,
|
|
180
|
+
ApiError: () => ApiError
|
|
181
|
+
});
|
|
177
182
|
function isRetryableErrorBody(body) {
|
|
178
183
|
try {
|
|
179
184
|
const parsed = JSON.parse(body);
|
|
@@ -254,11 +259,15 @@ var init_api_client = __esm({
|
|
|
254
259
|
}
|
|
255
260
|
// --- Templates gallery ---
|
|
256
261
|
// Consumer (any authed user): list the joint template set + pull the wayai slice.
|
|
257
|
-
|
|
258
|
-
|
|
262
|
+
// `locale` is optional — the server resolves to each template's defaultLocale when
|
|
263
|
+
// omitted, and falls back to it (with a resolvedLocale signal) when unauthored.
|
|
264
|
+
async templateList(locale) {
|
|
265
|
+
const qs = locale ? `?${new URLSearchParams({ locale })}` : "";
|
|
266
|
+
return this.request("GET", `/api/ci/templates${qs}`);
|
|
259
267
|
}
|
|
260
|
-
async templatePull(slug) {
|
|
261
|
-
|
|
268
|
+
async templatePull(slug, locale) {
|
|
269
|
+
const qs = locale ? `?${new URLSearchParams({ locale })}` : "";
|
|
270
|
+
return this.request("GET", `/api/ci/templates/${encodeURIComponent(slug)}${qs}`);
|
|
262
271
|
}
|
|
263
272
|
// Author (platform-admin): push a template into the store / pull it for inspection.
|
|
264
273
|
async adminTemplatePush(body) {
|
|
@@ -5206,7 +5215,7 @@ function findStepBoundaries(transcript) {
|
|
|
5206
5215
|
}
|
|
5207
5216
|
return out;
|
|
5208
5217
|
}
|
|
5209
|
-
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,
|
|
5218
|
+
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;
|
|
5210
5219
|
var init_dist = __esm({
|
|
5211
5220
|
"../../packages/core/dist/index.js"() {
|
|
5212
5221
|
"use strict";
|
|
@@ -5382,6 +5391,7 @@ var init_dist = __esm({
|
|
|
5382
5391
|
"summarizer"
|
|
5383
5392
|
];
|
|
5384
5393
|
SAFE_USER_ID_REGEX = /^[A-Za-z0-9_-]{1,64}$/;
|
|
5394
|
+
SUPPORTED_LOCALES = ["en", "pt", "es"];
|
|
5385
5395
|
uuidSchema = external_exports.string().uuid();
|
|
5386
5396
|
paginationSchema = external_exports.object({
|
|
5387
5397
|
limit: external_exports.coerce.number().int().min(1).max(100).default(50),
|
|
@@ -7556,62 +7566,76 @@ var init_dist = __esm({
|
|
|
7556
7566
|
offset: external_exports.coerce.number().int().min(0).optional()
|
|
7557
7567
|
});
|
|
7558
7568
|
noticeIdParamSchema = external_exports.object({ id: external_exports.string().min(1) });
|
|
7569
|
+
templateLocaleSchema = external_exports.enum(SUPPORTED_LOCALES);
|
|
7559
7570
|
TEMPLATE_SLUG_REGEX = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
7560
7571
|
templateSlugSchema = external_exports.string().regex(TEMPLATE_SLUG_REGEX, "slug must be lowercase alphanumeric with hyphens (max 63)");
|
|
7561
7572
|
templateStatusSchema = external_exports.enum(["published", "draft", "internal"]);
|
|
7562
7573
|
templateFileMapSchema = external_exports.record(external_exports.string()).refine((m) => Object.keys(m).every(isSafeTemplatePath), {
|
|
7563
7574
|
message: 'file map contains an unsafe path (no absolute paths, "..", or backslashes)'
|
|
7564
7575
|
});
|
|
7565
|
-
|
|
7576
|
+
templateTextSchema = external_exports.object({
|
|
7566
7577
|
metaTitle: external_exports.string().min(1).max(200),
|
|
7567
|
-
metaDescription: external_exports.string().max(1e3).default("")
|
|
7568
|
-
installCommand: external_exports.string().min(1).max(300)
|
|
7578
|
+
metaDescription: external_exports.string().max(1e3).default("")
|
|
7569
7579
|
});
|
|
7570
|
-
|
|
7580
|
+
templateRekorPointerSchema = external_exports.object({
|
|
7571
7581
|
mcpEndpoint: external_exports.string().url().optional(),
|
|
7572
7582
|
url: external_exports.string().url().optional()
|
|
7573
7583
|
});
|
|
7574
|
-
|
|
7575
|
-
|
|
7584
|
+
templateYamlLocaleEntry = templateTextSchema.extend({ source: external_exports.string().min(1) });
|
|
7585
|
+
templateYamlWayaiBlock = external_exports.object({
|
|
7586
|
+
installCommand: external_exports.string().min(1).max(300),
|
|
7587
|
+
locales: external_exports.record(templateLocaleSchema, templateYamlLocaleEntry)
|
|
7576
7588
|
});
|
|
7577
|
-
templateYamlRekorBlock =
|
|
7578
|
-
|
|
7589
|
+
templateYamlRekorBlock = templateRekorPointerSchema.extend({
|
|
7590
|
+
locales: external_exports.record(templateLocaleSchema, templateYamlLocaleEntry)
|
|
7579
7591
|
});
|
|
7580
7592
|
templateYamlSchema = external_exports.object({
|
|
7581
7593
|
slug: templateSlugSchema,
|
|
7582
7594
|
category: external_exports.string().min(1).max(60),
|
|
7583
7595
|
status: templateStatusSchema.default("draft"),
|
|
7584
7596
|
order: external_exports.number().int().min(0).max(1e5).optional(),
|
|
7597
|
+
defaultLocale: templateLocaleSchema,
|
|
7585
7598
|
hero: external_exports.string().optional(),
|
|
7586
7599
|
// relative path to a hero image inside the template folder
|
|
7587
7600
|
wayai: templateYamlWayaiBlock.optional(),
|
|
7588
7601
|
rekor: templateYamlRekorBlock.optional()
|
|
7589
7602
|
}).refine((c) => Boolean(c.wayai) || Boolean(c.rekor), {
|
|
7590
7603
|
message: "template.yaml must define at least one of `wayai:` or `rekor:`"
|
|
7591
|
-
})
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
order: external_exports.number().int().min(0).max(1e5).default(0),
|
|
7596
|
-
wayai: templateWayaiBlockSchema.optional(),
|
|
7597
|
-
rekor: templateRekorBlockSchema.optional()
|
|
7604
|
+
}).refine((c) => !c.wayai || Boolean(c.wayai.locales[c.defaultLocale]), {
|
|
7605
|
+
message: "`wayai.locales` must include the defaultLocale"
|
|
7606
|
+
}).refine((c) => !c.rekor || Boolean(c.rekor.locales[c.defaultLocale]), {
|
|
7607
|
+
message: "`rekor.locales` must include the defaultLocale"
|
|
7598
7608
|
});
|
|
7599
7609
|
templateHeroSchema = external_exports.object({
|
|
7600
7610
|
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)"),
|
|
7601
|
-
// ~8MB of base64 ≈ a ~6MB image — a generous cap that bounds the inline payload
|
|
7602
|
-
// (the endpoint is platform-admin-only, but an unbounded blob is still avoidable).
|
|
7603
7611
|
dataBase64: external_exports.string().min(1).max(8e6)
|
|
7604
7612
|
});
|
|
7613
|
+
templatePushLocaleSchema = external_exports.object({
|
|
7614
|
+
wayai: templateTextSchema.optional(),
|
|
7615
|
+
rekorText: templateTextSchema.optional(),
|
|
7616
|
+
readmeMarkdown: external_exports.string().default(""),
|
|
7617
|
+
wayaiFiles: templateFileMapSchema.optional()
|
|
7618
|
+
});
|
|
7605
7619
|
templatePushBody = external_exports.object({
|
|
7606
7620
|
slug: templateSlugSchema,
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7621
|
+
defaultLocale: templateLocaleSchema,
|
|
7622
|
+
common: external_exports.object({
|
|
7623
|
+
category: external_exports.string().min(1).max(60),
|
|
7624
|
+
status: templateStatusSchema,
|
|
7625
|
+
order: external_exports.number().int().min(0).max(1e5).default(0),
|
|
7626
|
+
// The WayAI install command — present iff the template has a wayai side; a
|
|
7627
|
+
// Rekor-only template omits it.
|
|
7628
|
+
installCommand: external_exports.string().min(1).max(300).optional(),
|
|
7629
|
+
hero: templateHeroSchema.optional(),
|
|
7630
|
+
rekorPointer: templateRekorPointerSchema.optional()
|
|
7631
|
+
}),
|
|
7632
|
+
locales: external_exports.record(templateLocaleSchema, templatePushLocaleSchema)
|
|
7633
|
+
}).refine((b) => Boolean(b.locales[b.defaultLocale]), {
|
|
7634
|
+
message: "`locales` must include the defaultLocale"
|
|
7613
7635
|
});
|
|
7636
|
+
templateListQuery = external_exports.object({ locale: templateLocaleSchema.optional() });
|
|
7614
7637
|
templateSlugParam = external_exports.object({ slug: templateSlugSchema });
|
|
7638
|
+
templateDetailQuery = external_exports.object({ locale: templateLocaleSchema.optional() });
|
|
7615
7639
|
ADMIN_SKILL_NAME_REGEX = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
7616
7640
|
adminSkillNameParam = external_exports.object({
|
|
7617
7641
|
name: external_exports.string().regex(ADMIN_SKILL_NAME_REGEX, "invalid skill name")
|
|
@@ -8230,13 +8254,14 @@ function writeVersionCache(filename, cache) {
|
|
|
8230
8254
|
function touchVersionCache(filename) {
|
|
8231
8255
|
writeVersionCache(filename, { lastCheck: Date.now(), latest: readVersionCache(filename)?.latest ?? null });
|
|
8232
8256
|
}
|
|
8233
|
-
var MAX_AGE_24H_MS, CLI_CACHE_FILE, SKILL_CACHE_FILE;
|
|
8257
|
+
var MAX_AGE_24H_MS, CLI_CACHE_FILE, SKILL_CACHE_FILE, ADMIN_SKILL_CACHE_FILE;
|
|
8234
8258
|
var init_version_cache = __esm({
|
|
8235
8259
|
"src/lib/version-cache.ts"() {
|
|
8236
8260
|
"use strict";
|
|
8237
8261
|
MAX_AGE_24H_MS = 24 * 60 * 60 * 1e3;
|
|
8238
8262
|
CLI_CACHE_FILE = "update-check.json";
|
|
8239
8263
|
SKILL_CACHE_FILE = "skill-update-check.json";
|
|
8264
|
+
ADMIN_SKILL_CACHE_FILE = "admin-skill-update-check.json";
|
|
8240
8265
|
}
|
|
8241
8266
|
});
|
|
8242
8267
|
|
|
@@ -8244,6 +8269,9 @@ var init_version_cache = __esm({
|
|
|
8244
8269
|
import { existsSync as existsSync5, readFileSync as readFileSync6 } from "fs";
|
|
8245
8270
|
import { join as join7 } from "path";
|
|
8246
8271
|
import * as yaml3 from "js-yaml";
|
|
8272
|
+
function skillInstallPaths(skillName) {
|
|
8273
|
+
return HARNESS_SKILL_DIRS.map((dir) => `${dir}/skills/${skillName}/${SKILL_FILENAME}`);
|
|
8274
|
+
}
|
|
8247
8275
|
function parseFrontmatterVersion(content) {
|
|
8248
8276
|
const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(content);
|
|
8249
8277
|
if (!match) return null;
|
|
@@ -8257,9 +8285,9 @@ function parseFrontmatterVersion(content) {
|
|
|
8257
8285
|
const v = parsed.version;
|
|
8258
8286
|
return typeof v === "string" ? v : null;
|
|
8259
8287
|
}
|
|
8260
|
-
function findInstalledSkills(projectRoot) {
|
|
8288
|
+
function findInstalledSkills(projectRoot, paths = SKILL_INSTALL_PATHS) {
|
|
8261
8289
|
const found = [];
|
|
8262
|
-
for (const rel of
|
|
8290
|
+
for (const rel of paths) {
|
|
8263
8291
|
const path22 = join7(projectRoot, rel);
|
|
8264
8292
|
if (!existsSync5(path22)) continue;
|
|
8265
8293
|
let version = null;
|
|
@@ -8276,20 +8304,28 @@ function lowestInstalledVersion(installs) {
|
|
|
8276
8304
|
if (versions.length === 0) return null;
|
|
8277
8305
|
return versions.reduce((lowest, v) => isNewerVersion(lowest, v) ? v : lowest);
|
|
8278
8306
|
}
|
|
8279
|
-
var DEFAULT_SKILL_RAW_URL, HARNESS_SKILL_DIRS, SKILL_INSTALL_PATHS;
|
|
8307
|
+
var DEFAULT_SKILL_RAW_URL, HARNESS_SKILL_DIRS, SKILL_FILENAME, SKILL_INSTALL_PATHS, ADMIN_SKILL_NAME, ADMIN_SKILL_INSTALL_PATHS;
|
|
8280
8308
|
var init_skill_version = __esm({
|
|
8281
8309
|
"src/lib/skill-version.ts"() {
|
|
8282
8310
|
"use strict";
|
|
8283
8311
|
init_utils();
|
|
8284
8312
|
DEFAULT_SKILL_RAW_URL = "https://raw.githubusercontent.com/wayai-pro/wayai-skill/main/skills/wayai/SKILL.md";
|
|
8285
8313
|
HARNESS_SKILL_DIRS = [".claude", ".opencode", ".agents"];
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8314
|
+
SKILL_FILENAME = "SKILL.md";
|
|
8315
|
+
SKILL_INSTALL_PATHS = skillInstallPaths("wayai");
|
|
8316
|
+
ADMIN_SKILL_NAME = "wayai-admin";
|
|
8317
|
+
ADMIN_SKILL_INSTALL_PATHS = skillInstallPaths(ADMIN_SKILL_NAME);
|
|
8289
8318
|
}
|
|
8290
8319
|
});
|
|
8291
8320
|
|
|
8292
8321
|
// src/lib/config.ts
|
|
8322
|
+
var config_exports = {};
|
|
8323
|
+
__export(config_exports, {
|
|
8324
|
+
deleteConfig: () => deleteConfig,
|
|
8325
|
+
getConfigPath: () => getConfigPath,
|
|
8326
|
+
readConfig: () => readConfig,
|
|
8327
|
+
writeConfig: () => writeConfig
|
|
8328
|
+
});
|
|
8293
8329
|
import * as fs5 from "fs";
|
|
8294
8330
|
import * as path5 from "path";
|
|
8295
8331
|
import * as os from "os";
|
|
@@ -8299,6 +8335,9 @@ function configDir() {
|
|
|
8299
8335
|
function configPath() {
|
|
8300
8336
|
return path5.join(configDir(), "config.json");
|
|
8301
8337
|
}
|
|
8338
|
+
function getConfigPath() {
|
|
8339
|
+
return configPath();
|
|
8340
|
+
}
|
|
8302
8341
|
function readConfig() {
|
|
8303
8342
|
if (!fs5.existsSync(configPath())) return null;
|
|
8304
8343
|
try {
|
|
@@ -8334,6 +8373,11 @@ function writeConfig(config) {
|
|
|
8334
8373
|
// owner-only read/write
|
|
8335
8374
|
});
|
|
8336
8375
|
}
|
|
8376
|
+
function deleteConfig() {
|
|
8377
|
+
if (fs5.existsSync(configPath())) {
|
|
8378
|
+
fs5.unlinkSync(configPath());
|
|
8379
|
+
}
|
|
8380
|
+
}
|
|
8337
8381
|
var init_config = __esm({
|
|
8338
8382
|
"src/lib/config.ts"() {
|
|
8339
8383
|
"use strict";
|
|
@@ -8628,6 +8672,22 @@ var init_token_store = __esm({
|
|
|
8628
8672
|
});
|
|
8629
8673
|
|
|
8630
8674
|
// src/lib/auth.ts
|
|
8675
|
+
var auth_exports = {};
|
|
8676
|
+
__export(auth_exports, {
|
|
8677
|
+
OAUTH_CALLBACK_PORT: () => OAUTH_CALLBACK_PORT,
|
|
8678
|
+
exchangeCodeForTokens: () => exchangeCodeForTokens,
|
|
8679
|
+
expiresInToIso: () => expiresInToIso,
|
|
8680
|
+
generateCodeChallenge: () => generateCodeChallenge,
|
|
8681
|
+
generateCodeVerifier: () => generateCodeVerifier,
|
|
8682
|
+
generateState: () => generateState,
|
|
8683
|
+
getAccessToken: () => getAccessToken,
|
|
8684
|
+
getAuthKitClientId: () => getAuthKitClientId,
|
|
8685
|
+
getAuthKitDomain: () => getAuthKitDomain,
|
|
8686
|
+
refreshAccessToken: () => refreshAccessToken,
|
|
8687
|
+
requireAuth: () => requireAuth,
|
|
8688
|
+
startCallbackServer: () => startCallbackServer,
|
|
8689
|
+
validateToken: () => validateToken
|
|
8690
|
+
});
|
|
8631
8691
|
import * as crypto2 from "crypto";
|
|
8632
8692
|
import * as http from "http";
|
|
8633
8693
|
function generateCodeVerifier() {
|
|
@@ -13050,7 +13110,7 @@ function isSafeTemplatePath2(path22) {
|
|
|
13050
13110
|
(seg) => seg.length > 0 && seg !== "." && seg !== ".." && /^[A-Za-z0-9._-]+$/.test(seg)
|
|
13051
13111
|
);
|
|
13052
13112
|
}
|
|
13053
|
-
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,
|
|
13113
|
+
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;
|
|
13054
13114
|
var init_contracts = __esm({
|
|
13055
13115
|
"../../packages/core/dist/contracts/index.js"() {
|
|
13056
13116
|
"use strict";
|
|
@@ -13191,6 +13251,7 @@ var init_contracts = __esm({
|
|
|
13191
13251
|
"summarizer"
|
|
13192
13252
|
];
|
|
13193
13253
|
SAFE_USER_ID_REGEX2 = /^[A-Za-z0-9_-]{1,64}$/;
|
|
13254
|
+
SUPPORTED_LOCALES2 = ["en", "pt", "es"];
|
|
13194
13255
|
SUMMARIZATION_THRESHOLD_MIN2 = 1e3;
|
|
13195
13256
|
SUMMARIZATION_THRESHOLD_MAX2 = 1e6;
|
|
13196
13257
|
summarizationThresholdField2 = external_exports.number().int().min(SUMMARIZATION_THRESHOLD_MIN2).max(SUMMARIZATION_THRESHOLD_MAX2).nullable().optional();
|
|
@@ -15316,62 +15377,76 @@ var init_contracts = __esm({
|
|
|
15316
15377
|
offset: external_exports.coerce.number().int().min(0).optional()
|
|
15317
15378
|
});
|
|
15318
15379
|
noticeIdParamSchema2 = external_exports.object({ id: external_exports.string().min(1) });
|
|
15380
|
+
templateLocaleSchema2 = external_exports.enum(SUPPORTED_LOCALES2);
|
|
15319
15381
|
TEMPLATE_SLUG_REGEX2 = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
15320
15382
|
templateSlugSchema2 = external_exports.string().regex(TEMPLATE_SLUG_REGEX2, "slug must be lowercase alphanumeric with hyphens (max 63)");
|
|
15321
15383
|
templateStatusSchema2 = external_exports.enum(["published", "draft", "internal"]);
|
|
15322
15384
|
templateFileMapSchema2 = external_exports.record(external_exports.string()).refine((m) => Object.keys(m).every(isSafeTemplatePath2), {
|
|
15323
15385
|
message: 'file map contains an unsafe path (no absolute paths, "..", or backslashes)'
|
|
15324
15386
|
});
|
|
15325
|
-
|
|
15387
|
+
templateTextSchema2 = external_exports.object({
|
|
15326
15388
|
metaTitle: external_exports.string().min(1).max(200),
|
|
15327
|
-
metaDescription: external_exports.string().max(1e3).default("")
|
|
15328
|
-
installCommand: external_exports.string().min(1).max(300)
|
|
15389
|
+
metaDescription: external_exports.string().max(1e3).default("")
|
|
15329
15390
|
});
|
|
15330
|
-
|
|
15391
|
+
templateRekorPointerSchema2 = external_exports.object({
|
|
15331
15392
|
mcpEndpoint: external_exports.string().url().optional(),
|
|
15332
15393
|
url: external_exports.string().url().optional()
|
|
15333
15394
|
});
|
|
15334
|
-
|
|
15335
|
-
|
|
15395
|
+
templateYamlLocaleEntry2 = templateTextSchema2.extend({ source: external_exports.string().min(1) });
|
|
15396
|
+
templateYamlWayaiBlock2 = external_exports.object({
|
|
15397
|
+
installCommand: external_exports.string().min(1).max(300),
|
|
15398
|
+
locales: external_exports.record(templateLocaleSchema2, templateYamlLocaleEntry2)
|
|
15336
15399
|
});
|
|
15337
|
-
templateYamlRekorBlock2 =
|
|
15338
|
-
|
|
15400
|
+
templateYamlRekorBlock2 = templateRekorPointerSchema2.extend({
|
|
15401
|
+
locales: external_exports.record(templateLocaleSchema2, templateYamlLocaleEntry2)
|
|
15339
15402
|
});
|
|
15340
15403
|
templateYamlSchema2 = external_exports.object({
|
|
15341
15404
|
slug: templateSlugSchema2,
|
|
15342
15405
|
category: external_exports.string().min(1).max(60),
|
|
15343
15406
|
status: templateStatusSchema2.default("draft"),
|
|
15344
15407
|
order: external_exports.number().int().min(0).max(1e5).optional(),
|
|
15408
|
+
defaultLocale: templateLocaleSchema2,
|
|
15345
15409
|
hero: external_exports.string().optional(),
|
|
15346
15410
|
// relative path to a hero image inside the template folder
|
|
15347
15411
|
wayai: templateYamlWayaiBlock2.optional(),
|
|
15348
15412
|
rekor: templateYamlRekorBlock2.optional()
|
|
15349
15413
|
}).refine((c) => Boolean(c.wayai) || Boolean(c.rekor), {
|
|
15350
15414
|
message: "template.yaml must define at least one of `wayai:` or `rekor:`"
|
|
15351
|
-
})
|
|
15352
|
-
|
|
15353
|
-
|
|
15354
|
-
|
|
15355
|
-
order: external_exports.number().int().min(0).max(1e5).default(0),
|
|
15356
|
-
wayai: templateWayaiBlockSchema2.optional(),
|
|
15357
|
-
rekor: templateRekorBlockSchema2.optional()
|
|
15415
|
+
}).refine((c) => !c.wayai || Boolean(c.wayai.locales[c.defaultLocale]), {
|
|
15416
|
+
message: "`wayai.locales` must include the defaultLocale"
|
|
15417
|
+
}).refine((c) => !c.rekor || Boolean(c.rekor.locales[c.defaultLocale]), {
|
|
15418
|
+
message: "`rekor.locales` must include the defaultLocale"
|
|
15358
15419
|
});
|
|
15359
15420
|
templateHeroSchema2 = external_exports.object({
|
|
15360
15421
|
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)"),
|
|
15361
|
-
// ~8MB of base64 ≈ a ~6MB image — a generous cap that bounds the inline payload
|
|
15362
|
-
// (the endpoint is platform-admin-only, but an unbounded blob is still avoidable).
|
|
15363
15422
|
dataBase64: external_exports.string().min(1).max(8e6)
|
|
15364
15423
|
});
|
|
15424
|
+
templatePushLocaleSchema2 = external_exports.object({
|
|
15425
|
+
wayai: templateTextSchema2.optional(),
|
|
15426
|
+
rekorText: templateTextSchema2.optional(),
|
|
15427
|
+
readmeMarkdown: external_exports.string().default(""),
|
|
15428
|
+
wayaiFiles: templateFileMapSchema2.optional()
|
|
15429
|
+
});
|
|
15365
15430
|
templatePushBody2 = external_exports.object({
|
|
15366
15431
|
slug: templateSlugSchema2,
|
|
15367
|
-
|
|
15368
|
-
|
|
15369
|
-
|
|
15370
|
-
|
|
15371
|
-
|
|
15372
|
-
|
|
15432
|
+
defaultLocale: templateLocaleSchema2,
|
|
15433
|
+
common: external_exports.object({
|
|
15434
|
+
category: external_exports.string().min(1).max(60),
|
|
15435
|
+
status: templateStatusSchema2,
|
|
15436
|
+
order: external_exports.number().int().min(0).max(1e5).default(0),
|
|
15437
|
+
// The WayAI install command — present iff the template has a wayai side; a
|
|
15438
|
+
// Rekor-only template omits it.
|
|
15439
|
+
installCommand: external_exports.string().min(1).max(300).optional(),
|
|
15440
|
+
hero: templateHeroSchema2.optional(),
|
|
15441
|
+
rekorPointer: templateRekorPointerSchema2.optional()
|
|
15442
|
+
}),
|
|
15443
|
+
locales: external_exports.record(templateLocaleSchema2, templatePushLocaleSchema2)
|
|
15444
|
+
}).refine((b) => Boolean(b.locales[b.defaultLocale]), {
|
|
15445
|
+
message: "`locales` must include the defaultLocale"
|
|
15373
15446
|
});
|
|
15447
|
+
templateListQuery2 = external_exports.object({ locale: templateLocaleSchema2.optional() });
|
|
15374
15448
|
templateSlugParam2 = external_exports.object({ slug: templateSlugSchema2 });
|
|
15449
|
+
templateDetailQuery2 = external_exports.object({ locale: templateLocaleSchema2.optional() });
|
|
15375
15450
|
ADMIN_SKILL_NAME_REGEX2 = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
15376
15451
|
adminSkillNameParam2 = external_exports.object({
|
|
15377
15452
|
name: external_exports.string().regex(ADMIN_SKILL_NAME_REGEX2, "invalid skill name")
|
|
@@ -16662,9 +16737,32 @@ async function runTemplateList() {
|
|
|
16662
16737
|
}
|
|
16663
16738
|
}
|
|
16664
16739
|
async function runTemplatePull(rest) {
|
|
16665
|
-
const
|
|
16740
|
+
const positional = [];
|
|
16741
|
+
let lang;
|
|
16742
|
+
for (let i = 0; i < rest.length; i++) {
|
|
16743
|
+
if (rest[i] === "--lang") {
|
|
16744
|
+
const v = rest[++i];
|
|
16745
|
+
if (!v) {
|
|
16746
|
+
console.error("--lang requires a value");
|
|
16747
|
+
process.exit(1);
|
|
16748
|
+
}
|
|
16749
|
+
const parsed = templateLocaleSchema2.safeParse(v);
|
|
16750
|
+
if (!parsed.success) {
|
|
16751
|
+
console.error(`Invalid --lang "${v}": must be one of ${templateLocaleSchema2.options.join(", ")}.`);
|
|
16752
|
+
process.exit(1);
|
|
16753
|
+
}
|
|
16754
|
+
lang = parsed.data;
|
|
16755
|
+
continue;
|
|
16756
|
+
}
|
|
16757
|
+
if (rest[i].startsWith("--")) {
|
|
16758
|
+
console.error(`Unknown flag: ${rest[i]}`);
|
|
16759
|
+
process.exit(1);
|
|
16760
|
+
}
|
|
16761
|
+
positional.push(rest[i]);
|
|
16762
|
+
}
|
|
16763
|
+
const slug = positional[0];
|
|
16666
16764
|
if (!slug) {
|
|
16667
|
-
console.error("wayai template pull <slug>");
|
|
16765
|
+
console.error("wayai template pull <slug> [--lang <locale>]");
|
|
16668
16766
|
process.exit(1);
|
|
16669
16767
|
}
|
|
16670
16768
|
if (!TEMPLATE_SLUG_REGEX2.test(slug)) {
|
|
@@ -16680,13 +16778,16 @@ async function runTemplatePull(rest) {
|
|
|
16680
16778
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
16681
16779
|
let detail;
|
|
16682
16780
|
try {
|
|
16683
|
-
detail = await client.templatePull(slug);
|
|
16781
|
+
detail = await client.templatePull(slug, lang);
|
|
16684
16782
|
} catch (err) {
|
|
16685
16783
|
exitOnTemplateApiError(err);
|
|
16686
16784
|
throw err;
|
|
16687
16785
|
}
|
|
16786
|
+
if (detail.resolvedLocale !== detail.requestedLocale) {
|
|
16787
|
+
console.log(`Note: "${detail.requestedLocale}" not translated yet \u2014 pulled "${detail.resolvedLocale}" instead.`);
|
|
16788
|
+
}
|
|
16688
16789
|
if (!detail.includes.wayai) {
|
|
16689
|
-
console.log(`Template "${slug}" has no WayAI slice \u2014 run \`rekor template pull ${slug}\` for its data layer.`);
|
|
16790
|
+
console.log(`Template "${slug}" has no WayAI slice \u2014 run \`rekor template pull ${slug}${langFlag(lang)}\` for its data layer.`);
|
|
16690
16791
|
return;
|
|
16691
16792
|
}
|
|
16692
16793
|
const targetDir = path20.join(resolveLayout(gitRoot).hubsDir, slug);
|
|
@@ -16695,15 +16796,21 @@ async function runTemplatePull(rest) {
|
|
|
16695
16796
|
console.log(`Next: \`wayai push\` to deploy it into your own hub.`);
|
|
16696
16797
|
if (detail.includes.rekor) {
|
|
16697
16798
|
console.log(`
|
|
16698
|
-
This template includes a Rekor data layer \u2014 run \`rekor template pull ${slug}\` to add it.`);
|
|
16799
|
+
This template includes a Rekor data layer \u2014 run \`rekor template pull ${slug}${langFlag(lang)}\` to add it.`);
|
|
16699
16800
|
}
|
|
16700
16801
|
}
|
|
16802
|
+
function langFlag(lang) {
|
|
16803
|
+
return lang ? ` --lang ${lang}` : "";
|
|
16804
|
+
}
|
|
16701
16805
|
function printTemplateHelp() {
|
|
16702
16806
|
console.log(`wayai template \u2014 install ready-made hub templates
|
|
16703
16807
|
|
|
16704
16808
|
Usage:
|
|
16705
|
-
wayai template list
|
|
16706
|
-
wayai template pull <slug>
|
|
16809
|
+
wayai template list List available templates
|
|
16810
|
+
wayai template pull <slug> [--lang <l>] Write a template's WayAI slice into wayai-ws/hubs/<slug>/
|
|
16811
|
+
|
|
16812
|
+
--lang selects a localized variant (${templateLocaleSchema2.options.join("|")}); omitted = the template's default
|
|
16813
|
+
language. An untranslated language falls back to the default (with a note).
|
|
16707
16814
|
|
|
16708
16815
|
After pulling, run \`wayai push\` to deploy the template into your own hub.`);
|
|
16709
16816
|
}
|
|
@@ -17183,17 +17290,36 @@ async function runTemplatePush(positional) {
|
|
|
17183
17290
|
console.error(`template.yaml slug "${manifest.slug}" does not match folder "${slug}".`);
|
|
17184
17291
|
process.exit(1);
|
|
17185
17292
|
}
|
|
17186
|
-
|
|
17187
|
-
|
|
17188
|
-
|
|
17189
|
-
|
|
17190
|
-
|
|
17191
|
-
|
|
17293
|
+
const authoredLocales = /* @__PURE__ */ new Set([
|
|
17294
|
+
...manifest.wayai ? Object.keys(manifest.wayai.locales) : [],
|
|
17295
|
+
...manifest.rekor ? Object.keys(manifest.rekor.locales) : []
|
|
17296
|
+
]);
|
|
17297
|
+
const locales = {};
|
|
17298
|
+
for (const locale of authoredLocales) {
|
|
17299
|
+
const wayaiEntry = manifest.wayai?.locales[locale];
|
|
17300
|
+
const rekorEntry = manifest.rekor?.locales[locale];
|
|
17301
|
+
let wayaiFiles;
|
|
17302
|
+
if (wayaiEntry) {
|
|
17303
|
+
const sliceDir = path21.resolve(templateDir, wayaiEntry.source);
|
|
17304
|
+
if (!fs17.existsSync(sliceDir)) {
|
|
17305
|
+
console.error(`wayai source not found for ${locale}: ${wayaiEntry.source} (resolved ${sliceDir})`);
|
|
17306
|
+
process.exit(1);
|
|
17307
|
+
}
|
|
17308
|
+
wayaiFiles = readDirToFileMap(sliceDir);
|
|
17192
17309
|
}
|
|
17193
|
-
|
|
17310
|
+
const readmePath = path21.join(templateDir, `README.${locale}.md`);
|
|
17311
|
+
const readmeMarkdown = fs17.existsSync(readmePath) ? fs17.readFileSync(readmePath, "utf-8") : "";
|
|
17312
|
+
locales[locale] = {
|
|
17313
|
+
readmeMarkdown,
|
|
17314
|
+
...wayaiFiles && { wayaiFiles },
|
|
17315
|
+
...wayaiEntry && {
|
|
17316
|
+
wayai: { metaTitle: wayaiEntry.metaTitle, metaDescription: wayaiEntry.metaDescription }
|
|
17317
|
+
},
|
|
17318
|
+
...rekorEntry && {
|
|
17319
|
+
rekorText: { metaTitle: rekorEntry.metaTitle, metaDescription: rekorEntry.metaDescription }
|
|
17320
|
+
}
|
|
17321
|
+
};
|
|
17194
17322
|
}
|
|
17195
|
-
const readmePath = path21.join(templateDir, "README.md");
|
|
17196
|
-
const readmeMarkdown = fs17.existsSync(readmePath) ? fs17.readFileSync(readmePath, "utf-8") : "";
|
|
17197
17323
|
let hero;
|
|
17198
17324
|
if (manifest.hero) {
|
|
17199
17325
|
const heroPath = path21.resolve(templateDir, manifest.hero);
|
|
@@ -17203,27 +17329,27 @@ async function runTemplatePush(positional) {
|
|
|
17203
17329
|
console.error(`Warning: hero not found at ${manifest.hero}; skipping.`);
|
|
17204
17330
|
}
|
|
17205
17331
|
}
|
|
17206
|
-
const
|
|
17207
|
-
|
|
17208
|
-
|
|
17209
|
-
|
|
17210
|
-
|
|
17211
|
-
|
|
17212
|
-
|
|
17213
|
-
|
|
17214
|
-
|
|
17332
|
+
const body = {
|
|
17333
|
+
slug,
|
|
17334
|
+
defaultLocale: manifest.defaultLocale,
|
|
17335
|
+
common: {
|
|
17336
|
+
category: manifest.category,
|
|
17337
|
+
status: manifest.status,
|
|
17338
|
+
order: manifest.order ?? 0,
|
|
17339
|
+
// The install command is the wayai one (locale-agnostic). OMIT it for a
|
|
17340
|
+
// Rekor-only template — the contract requires installCommand be non-empty
|
|
17341
|
+
// when present, so sending '' would 400 the whole push.
|
|
17342
|
+
...manifest.wayai?.installCommand && { installCommand: manifest.wayai.installCommand },
|
|
17343
|
+
...hero && { hero },
|
|
17344
|
+
...manifest.rekor && (manifest.rekor.mcpEndpoint || manifest.rekor.url) && {
|
|
17345
|
+
rekorPointer: {
|
|
17346
|
+
...manifest.rekor.mcpEndpoint && { mcpEndpoint: manifest.rekor.mcpEndpoint },
|
|
17347
|
+
...manifest.rekor.url && { url: manifest.rekor.url }
|
|
17348
|
+
}
|
|
17215
17349
|
}
|
|
17216
17350
|
},
|
|
17217
|
-
|
|
17218
|
-
rekor: {
|
|
17219
|
-
metaTitle: manifest.rekor.metaTitle,
|
|
17220
|
-
metaDescription: manifest.rekor.metaDescription,
|
|
17221
|
-
installCommand: manifest.rekor.installCommand,
|
|
17222
|
-
...manifest.rekor.mcpEndpoint && { mcpEndpoint: manifest.rekor.mcpEndpoint }
|
|
17223
|
-
}
|
|
17224
|
-
}
|
|
17351
|
+
locales
|
|
17225
17352
|
};
|
|
17226
|
-
const body = { slug, metadata, wayaiFiles, readmeMarkdown, hero };
|
|
17227
17353
|
const { config, accessToken } = await requireAuth();
|
|
17228
17354
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
17229
17355
|
let result;
|
|
@@ -18245,10 +18371,39 @@ async function refreshSkillCache() {
|
|
|
18245
18371
|
clearTimeout(timer);
|
|
18246
18372
|
}
|
|
18247
18373
|
}
|
|
18374
|
+
async function refreshAdminSkillCache() {
|
|
18375
|
+
let timer;
|
|
18376
|
+
const deadline = new Promise((resolve5) => {
|
|
18377
|
+
timer = setTimeout(resolve5, REFRESH_TIMEOUT_MS);
|
|
18378
|
+
});
|
|
18379
|
+
await Promise.race([deadline, fetchAndCacheAdminSkillVersion().catch(() => {
|
|
18380
|
+
})]);
|
|
18381
|
+
if (timer) clearTimeout(timer);
|
|
18382
|
+
}
|
|
18383
|
+
async function fetchAndCacheAdminSkillVersion() {
|
|
18384
|
+
const [{ readConfig: readConfig2 }, { getAccessToken: getAccessToken2 }, { ApiClient: ApiClient2 }] = await Promise.all([
|
|
18385
|
+
Promise.resolve().then(() => (init_config(), config_exports)),
|
|
18386
|
+
Promise.resolve().then(() => (init_auth(), auth_exports)),
|
|
18387
|
+
Promise.resolve().then(() => (init_api_client(), api_client_exports))
|
|
18388
|
+
]);
|
|
18389
|
+
const config = readConfig2();
|
|
18390
|
+
if (!config) return;
|
|
18391
|
+
const accessToken = await getAccessToken2(config);
|
|
18392
|
+
const client = new ApiClient2({ apiUrl: config.api_url, accessToken });
|
|
18393
|
+
const res = await client.adminSkillInstall(ADMIN_SKILL_NAME);
|
|
18394
|
+
const latest = parseFrontmatterVersion(res.files[SKILL_FILENAME] ?? "");
|
|
18395
|
+
if (latest) {
|
|
18396
|
+
try {
|
|
18397
|
+
writeVersionCache(ADMIN_SKILL_CACHE_FILE, { lastCheck: Date.now(), latest });
|
|
18398
|
+
} catch {
|
|
18399
|
+
}
|
|
18400
|
+
}
|
|
18401
|
+
}
|
|
18248
18402
|
async function refreshVersionCaches(opts) {
|
|
18249
18403
|
await Promise.all([
|
|
18250
18404
|
opts.cli ? refreshCliCache() : Promise.resolve(),
|
|
18251
|
-
opts.skill ? refreshSkillCache() : Promise.resolve()
|
|
18405
|
+
opts.skill ? refreshSkillCache() : Promise.resolve(),
|
|
18406
|
+
opts.adminSkill ? refreshAdminSkillCache() : Promise.resolve()
|
|
18252
18407
|
]);
|
|
18253
18408
|
}
|
|
18254
18409
|
|
|
@@ -18261,6 +18416,7 @@ import { spawn } from "child_process";
|
|
|
18261
18416
|
var REFRESH_COMMAND = "__refresh-version-cache";
|
|
18262
18417
|
var ENV_REFRESH_CLI = "WAYAI_REFRESH_CLI";
|
|
18263
18418
|
var ENV_REFRESH_SKILL = "WAYAI_REFRESH_SKILL";
|
|
18419
|
+
var ENV_REFRESH_ADMIN_SKILL = "WAYAI_REFRESH_ADMIN_SKILL";
|
|
18264
18420
|
function isUpdateCheckDisabled() {
|
|
18265
18421
|
return Boolean(
|
|
18266
18422
|
process.env.NO_UPDATE_NOTIFIER || process.env.WAYAI_NO_UPDATE_CHECK || process.env.CI
|
|
@@ -18270,6 +18426,7 @@ function scheduleVersionRefresh(opts, entryPath) {
|
|
|
18270
18426
|
try {
|
|
18271
18427
|
if (opts.cli) touchVersionCache(CLI_CACHE_FILE);
|
|
18272
18428
|
if (opts.skill) touchVersionCache(SKILL_CACHE_FILE);
|
|
18429
|
+
if (opts.adminSkill) touchVersionCache(ADMIN_SKILL_CACHE_FILE);
|
|
18273
18430
|
spawn(process.execPath, [entryPath, REFRESH_COMMAND], {
|
|
18274
18431
|
detached: true,
|
|
18275
18432
|
stdio: "ignore",
|
|
@@ -18278,7 +18435,8 @@ function scheduleVersionRefresh(opts, entryPath) {
|
|
|
18278
18435
|
env: {
|
|
18279
18436
|
...process.env,
|
|
18280
18437
|
[ENV_REFRESH_CLI]: opts.cli ? "1" : "",
|
|
18281
|
-
[ENV_REFRESH_SKILL]: opts.skill ? "1" : ""
|
|
18438
|
+
[ENV_REFRESH_SKILL]: opts.skill ? "1" : "",
|
|
18439
|
+
[ENV_REFRESH_ADMIN_SKILL]: opts.adminSkill ? "1" : ""
|
|
18282
18440
|
}
|
|
18283
18441
|
}).unref();
|
|
18284
18442
|
} catch {
|
|
@@ -18293,7 +18451,8 @@ function showUpdateNudges(currentVersion, entryPath) {
|
|
|
18293
18451
|
Update available: ${currentVersion} \u2192 ${cliLatest}
|
|
18294
18452
|
Run \`wayai update\` to update.`);
|
|
18295
18453
|
}
|
|
18296
|
-
const
|
|
18454
|
+
const repoRoot = findRepoRootSync() ?? process.cwd();
|
|
18455
|
+
const installs = findInstalledSkills(repoRoot);
|
|
18297
18456
|
const localSkillVersion = installs.length > 0 ? lowestInstalledVersion(installs) : null;
|
|
18298
18457
|
if (localSkillVersion) {
|
|
18299
18458
|
const skillLatest = readVersionCache(SKILL_CACHE_FILE)?.latest ?? null;
|
|
@@ -18303,10 +18462,21 @@ Skill update available: ${localSkillVersion} \u2192 ${skillLatest}
|
|
|
18303
18462
|
Run \`npx skills add wayai-pro/wayai-skill -y\` to update.`);
|
|
18304
18463
|
}
|
|
18305
18464
|
}
|
|
18465
|
+
const adminInstalls = findInstalledSkills(repoRoot, ADMIN_SKILL_INSTALL_PATHS);
|
|
18466
|
+
const localAdminVersion = adminInstalls.length > 0 ? lowestInstalledVersion(adminInstalls) : null;
|
|
18467
|
+
if (localAdminVersion) {
|
|
18468
|
+
const adminLatest = readVersionCache(ADMIN_SKILL_CACHE_FILE)?.latest ?? null;
|
|
18469
|
+
if (adminLatest && isNewerVersion(adminLatest, localAdminVersion)) {
|
|
18470
|
+
console.error(`
|
|
18471
|
+
Admin skill update available: ${localAdminVersion} \u2192 ${adminLatest}
|
|
18472
|
+
Run \`wayai admin skill install\` to update.`);
|
|
18473
|
+
}
|
|
18474
|
+
}
|
|
18306
18475
|
const cliStale = isVersionCacheStale(CLI_CACHE_FILE);
|
|
18307
18476
|
const skillStale = localSkillVersion !== null && isVersionCacheStale(SKILL_CACHE_FILE);
|
|
18308
|
-
|
|
18309
|
-
|
|
18477
|
+
const adminSkillStale = localAdminVersion !== null && isVersionCacheStale(ADMIN_SKILL_CACHE_FILE);
|
|
18478
|
+
if (cliStale || skillStale || adminSkillStale) {
|
|
18479
|
+
scheduleVersionRefresh({ cli: cliStale, skill: skillStale, adminSkill: adminSkillStale }, entryPath);
|
|
18310
18480
|
}
|
|
18311
18481
|
} catch {
|
|
18312
18482
|
}
|
|
@@ -18601,7 +18771,8 @@ async function runForeground() {
|
|
|
18601
18771
|
if (isBackgroundRefresh) {
|
|
18602
18772
|
void refreshVersionCaches({
|
|
18603
18773
|
cli: process.env[ENV_REFRESH_CLI] === "1",
|
|
18604
|
-
skill: process.env[ENV_REFRESH_SKILL] === "1"
|
|
18774
|
+
skill: process.env[ENV_REFRESH_SKILL] === "1",
|
|
18775
|
+
adminSkill: process.env[ENV_REFRESH_ADMIN_SKILL] === "1"
|
|
18605
18776
|
}).finally(() => process.exit(0));
|
|
18606
18777
|
} else {
|
|
18607
18778
|
void runForeground();
|