@wayai/cli 0.3.50 → 0.3.52
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 +247 -121
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -111,8 +111,9 @@ function initSentry(command2) {
|
|
|
111
111
|
initialized = true;
|
|
112
112
|
}
|
|
113
113
|
function shouldReportToSentry(error) {
|
|
114
|
-
if (error instanceof Error
|
|
115
|
-
|
|
114
|
+
if (error instanceof Error) {
|
|
115
|
+
const e = error;
|
|
116
|
+
if (e.isExpected === true || e.isRetryable === true) return false;
|
|
116
117
|
}
|
|
117
118
|
return true;
|
|
118
119
|
}
|
|
@@ -173,12 +174,22 @@ var init_sentry = __esm({
|
|
|
173
174
|
});
|
|
174
175
|
|
|
175
176
|
// src/lib/api-client.ts
|
|
176
|
-
|
|
177
|
+
function isRetryableErrorBody(body) {
|
|
178
|
+
try {
|
|
179
|
+
const parsed = JSON.parse(body);
|
|
180
|
+
return parsed?.details?.retryable === true;
|
|
181
|
+
} catch {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
var RETRYABLE_BACKOFF_MS, delay, ApiError, ApiClient;
|
|
177
186
|
var init_api_client = __esm({
|
|
178
187
|
"src/lib/api-client.ts"() {
|
|
179
188
|
"use strict";
|
|
180
189
|
init_sentry();
|
|
181
190
|
init_redact();
|
|
191
|
+
RETRYABLE_BACKOFF_MS = [500, 1e3, 2e3];
|
|
192
|
+
delay = (ms) => new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
182
193
|
ApiError = class extends Error {
|
|
183
194
|
status;
|
|
184
195
|
body;
|
|
@@ -193,6 +204,17 @@ var init_api_client = __esm({
|
|
|
193
204
|
get isExpected() {
|
|
194
205
|
return this.status >= 400 && this.status < 500;
|
|
195
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* True when the backend flagged this as a safe-to-retry transient via
|
|
209
|
+
* `details.retryable === true` (today: `CLICKHOUSE_COLD` cold-start). The
|
|
210
|
+
* client retries these inline (see `request`); if the retry budget is
|
|
211
|
+
* exhausted and one still surfaces, this lets `shouldReportToSentry` keep it
|
|
212
|
+
* out of Sentry and lets command surfaces render a "warming up" hint rather
|
|
213
|
+
* than a crash — mirroring the backend's `SENTRY_SKIP_CODES` (gh #2883).
|
|
214
|
+
*/
|
|
215
|
+
get isRetryable() {
|
|
216
|
+
return isRetryableErrorBody(this.body);
|
|
217
|
+
}
|
|
196
218
|
};
|
|
197
219
|
ApiClient = class {
|
|
198
220
|
apiUrl;
|
|
@@ -596,23 +618,31 @@ var init_api_client = __esm({
|
|
|
596
618
|
async request(method, path19, body) {
|
|
597
619
|
addApiBreadcrumb(method, path19);
|
|
598
620
|
const url = `${this.apiUrl}${path19}`;
|
|
599
|
-
let
|
|
600
|
-
|
|
601
|
-
let
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
621
|
+
let refreshedOn401 = false;
|
|
622
|
+
for (let retry = 0; ; retry++) {
|
|
623
|
+
let response = await this.send(url, method, body);
|
|
624
|
+
if (response.status === 401 && this.onUnauthorized && !refreshedOn401) {
|
|
625
|
+
refreshedOn401 = true;
|
|
626
|
+
let refreshed;
|
|
627
|
+
try {
|
|
628
|
+
refreshed = await this.onUnauthorized();
|
|
629
|
+
} catch {
|
|
630
|
+
}
|
|
631
|
+
if (refreshed) {
|
|
632
|
+
this.accessToken = refreshed;
|
|
633
|
+
response = await this.send(url, method, body);
|
|
634
|
+
}
|
|
605
635
|
}
|
|
606
|
-
if (
|
|
607
|
-
|
|
608
|
-
response = await this.send(url, method, body);
|
|
636
|
+
if (response.ok) {
|
|
637
|
+
return response.json();
|
|
609
638
|
}
|
|
610
|
-
}
|
|
611
|
-
if (!response.ok) {
|
|
612
639
|
const errorBody = await response.text();
|
|
640
|
+
if (method === "GET" && retry < RETRYABLE_BACKOFF_MS.length && isRetryableErrorBody(errorBody)) {
|
|
641
|
+
await delay(RETRYABLE_BACKOFF_MS[retry]);
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
613
644
|
throw new ApiError(method, path19, response.status, errorBody);
|
|
614
645
|
}
|
|
615
|
-
return response.json();
|
|
616
646
|
}
|
|
617
647
|
/** Issue a single authenticated request with the client's current token. */
|
|
618
648
|
send(url, method, body) {
|
|
@@ -5094,7 +5124,7 @@ function findStepBoundaries(transcript) {
|
|
|
5094
5124
|
}
|
|
5095
5125
|
return out;
|
|
5096
5126
|
}
|
|
5097
|
-
var APP_ERROR_BRAND, AppError, LLM_RATE_LIMIT_BRAND, LlmRateLimitError, LLM_PROVIDER_HTTP_BRAND, LlmProviderHttpError, 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, SLUG_REGEX, slugSchema, INVISIBLE_NAME_CHARS, MAX_KANBAN_STATUSES, MAX_FOLLOWUPS_PER_STATUS, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES, RESERVED_TEMPLATE_DUMP_NAME, kanbanStatusSlugSchema, followupSchema, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, 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, WAYAI_WORKSPACE_LAYOUT, MAX_RESOURCE_FILE_SIZE;
|
|
5127
|
+
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_ADDITIONAL_CONTEXT_SCHEMA_BYTES, RESERVED_TEMPLATE_DUMP_NAME, kanbanStatusSlugSchema, followupSchema, EXCLUSIVE_FLAG_PAIRS, kanbanStatusSchema, kanbanStatusesArraySchema, 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, WAYAI_WORKSPACE_LAYOUT, MAX_RESOURCE_FILE_SIZE;
|
|
5098
5128
|
var init_dist = __esm({
|
|
5099
5129
|
"../../packages/core/dist/index.js"() {
|
|
5100
5130
|
"use strict";
|
|
@@ -5180,6 +5210,15 @@ var init_dist = __esm({
|
|
|
5180
5210
|
}
|
|
5181
5211
|
[LLM_PROVIDER_HTTP_BRAND] = true;
|
|
5182
5212
|
};
|
|
5213
|
+
LLM_PROVIDER_TIMEOUT_BRAND = /* @__PURE__ */ Symbol.for("wayai.LlmProviderTimeoutError");
|
|
5214
|
+
LlmProviderTimeoutError = class extends Error {
|
|
5215
|
+
constructor(message, provider) {
|
|
5216
|
+
super(message);
|
|
5217
|
+
this.provider = provider;
|
|
5218
|
+
this.name = "LlmProviderTimeoutError";
|
|
5219
|
+
}
|
|
5220
|
+
[LLM_PROVIDER_TIMEOUT_BRAND] = true;
|
|
5221
|
+
};
|
|
5183
5222
|
ExternalServiceError = class extends AppError {
|
|
5184
5223
|
constructor(service, originalError) {
|
|
5185
5224
|
super(`External service error: ${service}`, "EXTERNAL_SERVICE_ERROR", 502, {
|
|
@@ -5343,6 +5382,33 @@ var init_dist = __esm({
|
|
|
5343
5382
|
summarization_threshold_tokens: summarizationThresholdField,
|
|
5344
5383
|
monitor_config: monitorConfigField
|
|
5345
5384
|
}).passthrough();
|
|
5385
|
+
AGENT_PARAMETER_TYPES = ["string", "number", "boolean", "integer", "enum"];
|
|
5386
|
+
AGENT_PARAMETER_NAME_REGEX = /^[a-zA-Z_][a-zA-Z0-9_]{0,63}$/;
|
|
5387
|
+
agentParameterCreateSchema = external_exports.object({
|
|
5388
|
+
parameter_name: external_exports.string().regex(
|
|
5389
|
+
AGENT_PARAMETER_NAME_REGEX,
|
|
5390
|
+
"parameter_name must start with a letter or underscore and contain only letters, digits, and underscores (max 64 chars)"
|
|
5391
|
+
),
|
|
5392
|
+
parameter_type: external_exports.enum(AGENT_PARAMETER_TYPES).optional(),
|
|
5393
|
+
// No length caps on the free-text fields below: the agent_parameter columns are
|
|
5394
|
+
// unbounded TEXT and pre-PR rows were never length-validated, so a cap would 422
|
|
5395
|
+
// an unrelated GET→edit→re-save of legitimately-long existing data. The name
|
|
5396
|
+
// regex (above) and the batch cap (below) are the load-bearing guards; total
|
|
5397
|
+
// payload size belongs in a global /api/* body limit, not per field here.
|
|
5398
|
+
parameter_description: external_exports.string().nullable().optional(),
|
|
5399
|
+
parameter_label: external_exports.string().nullable().optional(),
|
|
5400
|
+
parameter_enum: external_exports.array(external_exports.string()).nullable().optional(),
|
|
5401
|
+
parameter_required: external_exports.boolean().optional(),
|
|
5402
|
+
// Free-form analytics grouping label — no DB CHECK and the CI path persists
|
|
5403
|
+
// arbitrary strings, so keep this permissive (not the 4-value UI dropdown enum).
|
|
5404
|
+
variable_category: external_exports.string().nullable().optional(),
|
|
5405
|
+
is_summary: external_exports.boolean().optional()
|
|
5406
|
+
}).strict();
|
|
5407
|
+
MAX_AGENT_PARAMETERS_PER_REQUEST = 100;
|
|
5408
|
+
createAgentParametersBody = external_exports.union([
|
|
5409
|
+
agentParameterCreateSchema,
|
|
5410
|
+
external_exports.array(agentParameterCreateSchema).max(MAX_AGENT_PARAMETERS_PER_REQUEST, `too many parameters (max ${MAX_AGENT_PARAMETERS_PER_REQUEST})`)
|
|
5411
|
+
]);
|
|
5346
5412
|
SLUG_REGEX = /^[a-z][a-z0-9_]{0,49}$/;
|
|
5347
5413
|
slugSchema = external_exports.string().regex(
|
|
5348
5414
|
SLUG_REGEX,
|
|
@@ -8801,111 +8867,132 @@ var init_logout = __esm({
|
|
|
8801
8867
|
}
|
|
8802
8868
|
});
|
|
8803
8869
|
|
|
8804
|
-
// src/lib/hub-
|
|
8870
|
+
// src/lib/hub-binding.ts
|
|
8805
8871
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
8806
8872
|
import * as fs7 from "fs";
|
|
8807
8873
|
import * as path7 from "path";
|
|
8808
|
-
function
|
|
8874
|
+
function resolveGitDir() {
|
|
8809
8875
|
const cwd = process.cwd();
|
|
8810
|
-
if (
|
|
8876
|
+
if (_gitDirCache && _gitDirCache.cwd === cwd) return _gitDirCache.gitDir;
|
|
8811
8877
|
let gitDir;
|
|
8812
8878
|
try {
|
|
8813
|
-
|
|
8879
|
+
const raw = execFileSync2("git", ["rev-parse", "--git-dir"], {
|
|
8814
8880
|
cwd,
|
|
8815
8881
|
encoding: "utf-8",
|
|
8816
8882
|
stdio: ["pipe", "pipe", "pipe"]
|
|
8817
8883
|
}).trim();
|
|
8884
|
+
gitDir = raw ? path7.resolve(cwd, raw) : null;
|
|
8818
8885
|
} catch {
|
|
8819
|
-
|
|
8820
|
-
return null;
|
|
8886
|
+
gitDir = null;
|
|
8821
8887
|
}
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
return lockPath;
|
|
8888
|
+
_gitDirCache = { cwd, gitDir };
|
|
8889
|
+
return gitDir;
|
|
8825
8890
|
}
|
|
8826
|
-
function
|
|
8827
|
-
const
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8891
|
+
function getBindingPath() {
|
|
8892
|
+
const gitDir = resolveGitDir();
|
|
8893
|
+
return gitDir ? path7.join(gitDir, BINDING_FILENAME) : null;
|
|
8894
|
+
}
|
|
8895
|
+
function getLegacyBindingPath() {
|
|
8896
|
+
const gitDir = resolveGitDir();
|
|
8897
|
+
return gitDir ? path7.join(gitDir, LEGACY_BINDING_FILENAME) : null;
|
|
8898
|
+
}
|
|
8899
|
+
function readBinding() {
|
|
8900
|
+
for (const bindingPath of [getBindingPath(), getLegacyBindingPath()]) {
|
|
8901
|
+
if (!bindingPath) continue;
|
|
8902
|
+
let raw;
|
|
8903
|
+
try {
|
|
8904
|
+
raw = fs7.readFileSync(bindingPath, "utf-8");
|
|
8905
|
+
} catch (err) {
|
|
8906
|
+
if (err.code === "ENOENT") continue;
|
|
8907
|
+
throw err;
|
|
8908
|
+
}
|
|
8909
|
+
const trimmed = raw.trim();
|
|
8910
|
+
return UUID_RE.test(trimmed) ? trimmed : null;
|
|
8835
8911
|
}
|
|
8836
|
-
|
|
8837
|
-
return UUID_RE.test(trimmed) ? trimmed : null;
|
|
8912
|
+
return null;
|
|
8838
8913
|
}
|
|
8839
|
-
function
|
|
8914
|
+
function writeBinding(hubId) {
|
|
8840
8915
|
if (!UUID_RE.test(hubId)) {
|
|
8841
8916
|
throw new Error(`Invalid hub_id (must be a UUID): ${hubId}`);
|
|
8842
8917
|
}
|
|
8843
|
-
const
|
|
8844
|
-
if (!
|
|
8845
|
-
throw new Error("Not inside a git repository \u2014 cannot write hub
|
|
8918
|
+
const bindingPath = getBindingPath();
|
|
8919
|
+
if (!bindingPath) {
|
|
8920
|
+
throw new Error("Not inside a git repository \u2014 cannot write hub binding.");
|
|
8846
8921
|
}
|
|
8847
|
-
fs7.writeFileSync(
|
|
8922
|
+
fs7.writeFileSync(bindingPath, `${hubId}
|
|
8848
8923
|
`, "utf-8");
|
|
8924
|
+
removeLegacyBinding();
|
|
8849
8925
|
}
|
|
8850
|
-
function
|
|
8851
|
-
const
|
|
8852
|
-
if (!
|
|
8926
|
+
function removeLegacyBinding() {
|
|
8927
|
+
const legacyPath = getLegacyBindingPath();
|
|
8928
|
+
if (!legacyPath) return;
|
|
8853
8929
|
try {
|
|
8854
|
-
fs7.unlinkSync(
|
|
8855
|
-
|
|
8856
|
-
} catch (err) {
|
|
8857
|
-
if (err.code === "ENOENT") return false;
|
|
8858
|
-
throw err;
|
|
8930
|
+
fs7.unlinkSync(legacyPath);
|
|
8931
|
+
} catch {
|
|
8859
8932
|
}
|
|
8860
8933
|
}
|
|
8861
|
-
function
|
|
8862
|
-
|
|
8863
|
-
|
|
8864
|
-
|
|
8934
|
+
function clearBinding() {
|
|
8935
|
+
let removed = false;
|
|
8936
|
+
for (const bindingPath of [getBindingPath(), getLegacyBindingPath()]) {
|
|
8937
|
+
if (!bindingPath) continue;
|
|
8938
|
+
try {
|
|
8939
|
+
fs7.unlinkSync(bindingPath);
|
|
8940
|
+
removed = true;
|
|
8941
|
+
} catch (err) {
|
|
8942
|
+
if (err.code !== "ENOENT") throw err;
|
|
8943
|
+
}
|
|
8944
|
+
}
|
|
8945
|
+
return removed;
|
|
8946
|
+
}
|
|
8947
|
+
function assertHubMatchesBinding(resolvedHubId, hubLabel) {
|
|
8948
|
+
const bound = readBinding();
|
|
8949
|
+
if (!bound) return;
|
|
8950
|
+
if (bound === resolvedHubId) return;
|
|
8865
8951
|
const target = hubLabel ? `${hubLabel} (${resolvedHubId})` : resolvedHubId;
|
|
8866
8952
|
console.error(
|
|
8867
8953
|
[
|
|
8868
|
-
`This worktree is
|
|
8954
|
+
`This worktree is bound to hub ${bound}, but the command resolved to ${target}.`,
|
|
8869
8955
|
"",
|
|
8870
8956
|
"This usually means a prompt was routed to the wrong worktree.",
|
|
8871
|
-
"Confirm with the user before
|
|
8872
|
-
" wayai
|
|
8957
|
+
"Confirm with the user before unbinding. To override:",
|
|
8958
|
+
" wayai unbind # clear the binding for this worktree",
|
|
8873
8959
|
` wayai use ${resolvedHubId} # rebind this worktree to the new hub`
|
|
8874
8960
|
].join("\n")
|
|
8875
8961
|
);
|
|
8876
8962
|
process.exit(1);
|
|
8877
8963
|
}
|
|
8878
|
-
function
|
|
8964
|
+
function autoBindIfUnbound(hubId) {
|
|
8879
8965
|
try {
|
|
8880
|
-
if (
|
|
8881
|
-
|
|
8882
|
-
console.log(`Worktree
|
|
8966
|
+
if (readBinding()) return false;
|
|
8967
|
+
writeBinding(hubId);
|
|
8968
|
+
console.log(`Worktree bound to hub ${hubId} (run \`wayai unbind\` to clear).`);
|
|
8883
8969
|
return true;
|
|
8884
8970
|
} catch (err) {
|
|
8885
|
-
console.warn(` Warning: could not auto-
|
|
8971
|
+
console.warn(` Warning: could not auto-bind worktree (${err instanceof Error ? err.message : String(err)})`);
|
|
8886
8972
|
return false;
|
|
8887
8973
|
}
|
|
8888
8974
|
}
|
|
8889
|
-
function
|
|
8890
|
-
const
|
|
8891
|
-
if (!
|
|
8975
|
+
function assertNoBindingBlocksHubCreation(newHubName) {
|
|
8976
|
+
const bound = readBinding();
|
|
8977
|
+
if (!bound) return;
|
|
8892
8978
|
console.error(
|
|
8893
8979
|
[
|
|
8894
|
-
`This worktree is
|
|
8980
|
+
`This worktree is bound to hub ${bound}, but you're about to create a new hub "${newHubName}" here.`,
|
|
8895
8981
|
"",
|
|
8896
8982
|
"This usually means a prompt was routed to the wrong worktree.",
|
|
8897
|
-
"Confirm with the user before
|
|
8898
|
-
" wayai
|
|
8983
|
+
"Confirm with the user before unbinding. To override:",
|
|
8984
|
+
" wayai unbind # clear the binding for this worktree"
|
|
8899
8985
|
].join("\n")
|
|
8900
8986
|
);
|
|
8901
8987
|
process.exit(1);
|
|
8902
8988
|
}
|
|
8903
|
-
var
|
|
8904
|
-
var
|
|
8905
|
-
"src/lib/hub-
|
|
8989
|
+
var BINDING_FILENAME, LEGACY_BINDING_FILENAME, _gitDirCache;
|
|
8990
|
+
var init_hub_binding = __esm({
|
|
8991
|
+
"src/lib/hub-binding.ts"() {
|
|
8906
8992
|
"use strict";
|
|
8907
8993
|
init_utils();
|
|
8908
|
-
|
|
8994
|
+
BINDING_FILENAME = "wayai-binding";
|
|
8995
|
+
LEGACY_BINDING_FILENAME = "wayai-lock";
|
|
8909
8996
|
}
|
|
8910
8997
|
});
|
|
8911
8998
|
|
|
@@ -8951,11 +9038,11 @@ async function statusCommand(args2, pkg2) {
|
|
|
8951
9038
|
const cachedCliLatest = readCachedLatest(CLI_CACHE_FILE);
|
|
8952
9039
|
const cliLatest = cachedCliLatest && isNewerVersion(cachedCliLatest, pkg2.version) ? cachedCliLatest : null;
|
|
8953
9040
|
const skill = buildSkillState();
|
|
8954
|
-
let
|
|
9041
|
+
let boundHubId = null;
|
|
8955
9042
|
try {
|
|
8956
|
-
|
|
9043
|
+
boundHubId = readBinding();
|
|
8957
9044
|
} catch {
|
|
8958
|
-
|
|
9045
|
+
boundHubId = null;
|
|
8959
9046
|
}
|
|
8960
9047
|
if (!config) {
|
|
8961
9048
|
const snapshot2 = {
|
|
@@ -8969,7 +9056,8 @@ async function statusCommand(args2, pkg2) {
|
|
|
8969
9056
|
orgs: [],
|
|
8970
9057
|
active_org: null,
|
|
8971
9058
|
workspace,
|
|
8972
|
-
|
|
9059
|
+
worktree_binding: { hub_id: boundHubId },
|
|
9060
|
+
worktree_lock: { hub_id: boundHubId }
|
|
8973
9061
|
};
|
|
8974
9062
|
if (json) {
|
|
8975
9063
|
console.log(JSON.stringify(snapshot2, null, 2));
|
|
@@ -9023,7 +9111,8 @@ async function statusCommand(args2, pkg2) {
|
|
|
9023
9111
|
orgs,
|
|
9024
9112
|
active_org: activeOrg,
|
|
9025
9113
|
workspace,
|
|
9026
|
-
|
|
9114
|
+
worktree_binding: { hub_id: boundHubId },
|
|
9115
|
+
worktree_lock: { hub_id: boundHubId }
|
|
9027
9116
|
};
|
|
9028
9117
|
if (json) {
|
|
9029
9118
|
console.log(JSON.stringify(snapshot, null, 2));
|
|
@@ -9053,8 +9142,8 @@ async function statusCommand(args2, pkg2) {
|
|
|
9053
9142
|
} else {
|
|
9054
9143
|
console.log("No .wayai.yaml found \u2014 run `wayai init` to scope this repo to an organization.");
|
|
9055
9144
|
}
|
|
9056
|
-
if (
|
|
9057
|
-
console.log(`Worktree
|
|
9145
|
+
if (boundHubId) {
|
|
9146
|
+
console.log(`Worktree binding: ${boundHubId} (run \`wayai unbind\` to clear)`);
|
|
9058
9147
|
}
|
|
9059
9148
|
if (tokenValid === true && accessToken) {
|
|
9060
9149
|
await nudgeReportActions(config.api_url, accessToken);
|
|
@@ -9067,7 +9156,7 @@ var init_status = __esm({
|
|
|
9067
9156
|
init_auth();
|
|
9068
9157
|
init_repo_config();
|
|
9069
9158
|
init_workspace();
|
|
9070
|
-
|
|
9159
|
+
init_hub_binding();
|
|
9071
9160
|
init_api_client();
|
|
9072
9161
|
init_version_cache();
|
|
9073
9162
|
init_skill_version();
|
|
@@ -10177,7 +10266,7 @@ async function pullCommand(args2) {
|
|
|
10177
10266
|
}
|
|
10178
10267
|
if (gitRoot) warnLayoutOnce(gitRoot);
|
|
10179
10268
|
const { hubId, hubFolder: existingFolder } = resolveHubTarget(workspaceDir, hubSelector);
|
|
10180
|
-
|
|
10269
|
+
assertHubMatchesBinding(hubId);
|
|
10181
10270
|
console.log("Fetching hub configuration...");
|
|
10182
10271
|
const payload = await client.pull(hubId, organizationId);
|
|
10183
10272
|
if (payload.hub_environment === "production") {
|
|
@@ -10249,7 +10338,7 @@ async function pullCommand(args2) {
|
|
|
10249
10338
|
}
|
|
10250
10339
|
if (cancelled) return;
|
|
10251
10340
|
}
|
|
10252
|
-
if (wroteFiles)
|
|
10341
|
+
if (wroteFiles) autoBindIfUnbound(hubId);
|
|
10253
10342
|
}
|
|
10254
10343
|
async function downloadBinaryResourceFiles(hubFolder, payload) {
|
|
10255
10344
|
const resources = payload.resources || [];
|
|
@@ -10289,7 +10378,7 @@ var init_pull = __esm({
|
|
|
10289
10378
|
init_workspace();
|
|
10290
10379
|
init_layout();
|
|
10291
10380
|
init_repo_config();
|
|
10292
|
-
|
|
10381
|
+
init_hub_binding();
|
|
10293
10382
|
}
|
|
10294
10383
|
});
|
|
10295
10384
|
|
|
@@ -10536,7 +10625,7 @@ async function pushSingleHub(client, hubId, hubFolder, autoConfirm, organization
|
|
|
10536
10625
|
} else {
|
|
10537
10626
|
console.log("No changes to push; folder renamed.");
|
|
10538
10627
|
}
|
|
10539
|
-
|
|
10628
|
+
autoBindIfUnbound(hubId);
|
|
10540
10629
|
return true;
|
|
10541
10630
|
}
|
|
10542
10631
|
console.log("\nChanges to push:");
|
|
@@ -10552,7 +10641,7 @@ async function pushSingleHub(client, hubId, hubFolder, autoConfirm, organization
|
|
|
10552
10641
|
const result = await client.push(hubId, localConfig, organizationId);
|
|
10553
10642
|
printSyncResult(result);
|
|
10554
10643
|
await syncAfterPush(client, hubId, hubFolder, organizationId);
|
|
10555
|
-
|
|
10644
|
+
autoBindIfUnbound(hubId);
|
|
10556
10645
|
return true;
|
|
10557
10646
|
}
|
|
10558
10647
|
function resolveWorkspaceDir() {
|
|
@@ -10611,7 +10700,7 @@ async function pushCommand(args2) {
|
|
|
10611
10700
|
const newHubs = scanNewHubs(workspaceDir);
|
|
10612
10701
|
const existing = selectExistingHub(workspaceDir, existingHubs, hubSelector, wsLabel);
|
|
10613
10702
|
if (existing) {
|
|
10614
|
-
|
|
10703
|
+
assertHubMatchesBinding(existing.hubId, path14.basename(existing.hubFolder));
|
|
10615
10704
|
await pushSingleHub(client, existing.hubId, existing.hubFolder, autoConfirm, organizationId);
|
|
10616
10705
|
return;
|
|
10617
10706
|
}
|
|
@@ -10630,7 +10719,7 @@ async function pushCommand(args2) {
|
|
|
10630
10719
|
}
|
|
10631
10720
|
process.exit(1);
|
|
10632
10721
|
}
|
|
10633
|
-
|
|
10722
|
+
assertNoBindingBlocksHubCreation(newHub.hubName);
|
|
10634
10723
|
const hubType = newHub.hubType || "chat";
|
|
10635
10724
|
console.log(`
|
|
10636
10725
|
New hub detected: "${newHub.hubName}" (${hubType})`);
|
|
@@ -10672,7 +10761,7 @@ hub_environment: preview
|
|
|
10672
10761
|
${content}`;
|
|
10673
10762
|
}
|
|
10674
10763
|
fs12.writeFileSync(hubYamlPath, updated, "utf-8");
|
|
10675
|
-
|
|
10764
|
+
autoBindIfUnbound(hubId);
|
|
10676
10765
|
await pushSingleHub(client, hubId, newHub.hubFolder, autoConfirm, organizationId, { skipAgentRename: true });
|
|
10677
10766
|
}
|
|
10678
10767
|
var init_push = __esm({
|
|
@@ -10688,7 +10777,7 @@ var init_push = __esm({
|
|
|
10688
10777
|
init_workspace();
|
|
10689
10778
|
init_layout();
|
|
10690
10779
|
init_repo_config();
|
|
10691
|
-
|
|
10780
|
+
init_hub_binding();
|
|
10692
10781
|
}
|
|
10693
10782
|
});
|
|
10694
10783
|
|
|
@@ -10726,13 +10815,13 @@ async function useCommand(args2) {
|
|
|
10726
10815
|
}
|
|
10727
10816
|
hubId = match.hubId;
|
|
10728
10817
|
}
|
|
10729
|
-
const previous =
|
|
10818
|
+
const previous = readBinding();
|
|
10730
10819
|
if (previous === hubId) {
|
|
10731
|
-
console.log(`Worktree already
|
|
10820
|
+
console.log(`Worktree already bound to ${hubId}.`);
|
|
10732
10821
|
return;
|
|
10733
10822
|
}
|
|
10734
10823
|
try {
|
|
10735
|
-
|
|
10824
|
+
writeBinding(hubId);
|
|
10736
10825
|
} catch (err) {
|
|
10737
10826
|
console.error(err instanceof Error ? err.message : String(err));
|
|
10738
10827
|
process.exit(1);
|
|
@@ -10740,13 +10829,13 @@ async function useCommand(args2) {
|
|
|
10740
10829
|
if (previous) {
|
|
10741
10830
|
console.log(`Worktree rebound: ${previous} \u2192 ${hubId}`);
|
|
10742
10831
|
} else {
|
|
10743
|
-
console.log(`Worktree
|
|
10832
|
+
console.log(`Worktree bound to hub ${hubId}.`);
|
|
10744
10833
|
}
|
|
10745
10834
|
}
|
|
10746
10835
|
var init_use = __esm({
|
|
10747
10836
|
"src/commands/use.ts"() {
|
|
10748
10837
|
"use strict";
|
|
10749
|
-
|
|
10838
|
+
init_hub_binding();
|
|
10750
10839
|
init_workspace();
|
|
10751
10840
|
init_layout();
|
|
10752
10841
|
init_utils();
|
|
@@ -10846,24 +10935,24 @@ var init_migrate = __esm({
|
|
|
10846
10935
|
}
|
|
10847
10936
|
});
|
|
10848
10937
|
|
|
10849
|
-
// src/commands/
|
|
10850
|
-
var
|
|
10851
|
-
__export(
|
|
10852
|
-
|
|
10938
|
+
// src/commands/unbind.ts
|
|
10939
|
+
var unbind_exports = {};
|
|
10940
|
+
__export(unbind_exports, {
|
|
10941
|
+
unbindCommand: () => unbindCommand
|
|
10853
10942
|
});
|
|
10854
|
-
async function
|
|
10855
|
-
const previous =
|
|
10943
|
+
async function unbindCommand(_args) {
|
|
10944
|
+
const previous = readBinding();
|
|
10856
10945
|
if (!previous) {
|
|
10857
|
-
console.log("No worktree
|
|
10946
|
+
console.log("No worktree binding to clear.");
|
|
10858
10947
|
return;
|
|
10859
10948
|
}
|
|
10860
|
-
|
|
10861
|
-
console.log(`Worktree
|
|
10949
|
+
clearBinding();
|
|
10950
|
+
console.log(`Worktree unbound (was: ${previous}).`);
|
|
10862
10951
|
}
|
|
10863
|
-
var
|
|
10864
|
-
"src/commands/
|
|
10952
|
+
var init_unbind = __esm({
|
|
10953
|
+
"src/commands/unbind.ts"() {
|
|
10865
10954
|
"use strict";
|
|
10866
|
-
|
|
10955
|
+
init_hub_binding();
|
|
10867
10956
|
}
|
|
10868
10957
|
});
|
|
10869
10958
|
|
|
@@ -11130,6 +11219,10 @@ async function conversationsCommand(args2) {
|
|
|
11130
11219
|
console.error("Observability data not found. Either the conversation has no LLM turns yet, or R2 entries were purged.");
|
|
11131
11220
|
process.exit(1);
|
|
11132
11221
|
}
|
|
11222
|
+
if (err instanceof ApiError && err.isRetryable) {
|
|
11223
|
+
console.error("ClickHouse is warming up (cold start); observability is temporarily unavailable. Retry in a few seconds.");
|
|
11224
|
+
process.exit(1);
|
|
11225
|
+
}
|
|
11133
11226
|
throw err;
|
|
11134
11227
|
}
|
|
11135
11228
|
return;
|
|
@@ -12674,7 +12767,7 @@ function refineHubAsCodeKanbanStatuses2(config, ctx) {
|
|
|
12674
12767
|
}
|
|
12675
12768
|
}
|
|
12676
12769
|
}
|
|
12677
|
-
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, SLUG_REGEX2, slugSchema2, INVISIBLE_NAME_CHARS2, MAX_KANBAN_STATUSES2, MAX_FOLLOWUPS_PER_STATUS2, MAX_ADDITIONAL_CONTEXT_SCHEMA_BYTES2, RESERVED_TEMPLATE_DUMP_NAME2, kanbanStatusSlugSchema2, followupSchema2, EXCLUSIVE_FLAG_PAIRS2, kanbanStatusSchema2, kanbanStatusesArraySchema2, 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;
|
|
12770
|
+
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_ADDITIONAL_CONTEXT_SCHEMA_BYTES2, RESERVED_TEMPLATE_DUMP_NAME2, kanbanStatusSlugSchema2, followupSchema2, EXCLUSIVE_FLAG_PAIRS2, kanbanStatusSchema2, kanbanStatusesArraySchema2, 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;
|
|
12678
12771
|
var init_contracts = __esm({
|
|
12679
12772
|
"../../packages/core/dist/contracts/index.js"() {
|
|
12680
12773
|
"use strict";
|
|
@@ -12848,6 +12941,33 @@ var init_contracts = __esm({
|
|
|
12848
12941
|
summarization_threshold_tokens: summarizationThresholdField2,
|
|
12849
12942
|
monitor_config: monitorConfigField2
|
|
12850
12943
|
}).passthrough();
|
|
12944
|
+
AGENT_PARAMETER_TYPES2 = ["string", "number", "boolean", "integer", "enum"];
|
|
12945
|
+
AGENT_PARAMETER_NAME_REGEX2 = /^[a-zA-Z_][a-zA-Z0-9_]{0,63}$/;
|
|
12946
|
+
agentParameterCreateSchema2 = external_exports.object({
|
|
12947
|
+
parameter_name: external_exports.string().regex(
|
|
12948
|
+
AGENT_PARAMETER_NAME_REGEX2,
|
|
12949
|
+
"parameter_name must start with a letter or underscore and contain only letters, digits, and underscores (max 64 chars)"
|
|
12950
|
+
),
|
|
12951
|
+
parameter_type: external_exports.enum(AGENT_PARAMETER_TYPES2).optional(),
|
|
12952
|
+
// No length caps on the free-text fields below: the agent_parameter columns are
|
|
12953
|
+
// unbounded TEXT and pre-PR rows were never length-validated, so a cap would 422
|
|
12954
|
+
// an unrelated GET→edit→re-save of legitimately-long existing data. The name
|
|
12955
|
+
// regex (above) and the batch cap (below) are the load-bearing guards; total
|
|
12956
|
+
// payload size belongs in a global /api/* body limit, not per field here.
|
|
12957
|
+
parameter_description: external_exports.string().nullable().optional(),
|
|
12958
|
+
parameter_label: external_exports.string().nullable().optional(),
|
|
12959
|
+
parameter_enum: external_exports.array(external_exports.string()).nullable().optional(),
|
|
12960
|
+
parameter_required: external_exports.boolean().optional(),
|
|
12961
|
+
// Free-form analytics grouping label — no DB CHECK and the CI path persists
|
|
12962
|
+
// arbitrary strings, so keep this permissive (not the 4-value UI dropdown enum).
|
|
12963
|
+
variable_category: external_exports.string().nullable().optional(),
|
|
12964
|
+
is_summary: external_exports.boolean().optional()
|
|
12965
|
+
}).strict();
|
|
12966
|
+
MAX_AGENT_PARAMETERS_PER_REQUEST2 = 100;
|
|
12967
|
+
createAgentParametersBody2 = external_exports.union([
|
|
12968
|
+
agentParameterCreateSchema2,
|
|
12969
|
+
external_exports.array(agentParameterCreateSchema2).max(MAX_AGENT_PARAMETERS_PER_REQUEST2, `too many parameters (max ${MAX_AGENT_PARAMETERS_PER_REQUEST2})`)
|
|
12970
|
+
]);
|
|
12851
12971
|
SLUG_REGEX2 = /^[a-z][a-z0-9_]{0,49}$/;
|
|
12852
12972
|
slugSchema2 = external_exports.string().regex(
|
|
12853
12973
|
SLUG_REGEX2,
|
|
@@ -16473,7 +16593,11 @@ function exitOnApiError(err) {
|
|
|
16473
16593
|
process.exit(1);
|
|
16474
16594
|
}
|
|
16475
16595
|
if (err.status === 503) {
|
|
16476
|
-
|
|
16596
|
+
if (err.isRetryable) {
|
|
16597
|
+
console.error("ClickHouse is warming up (cold start); the read is temporarily unavailable. Retry in a few seconds.");
|
|
16598
|
+
} else {
|
|
16599
|
+
console.error("Admin debug reads are currently disabled (platform kill switch).");
|
|
16600
|
+
}
|
|
16477
16601
|
process.exit(1);
|
|
16478
16602
|
}
|
|
16479
16603
|
if (err.status === 400) {
|
|
@@ -16926,11 +17050,11 @@ var init_admin = __esm({
|
|
|
16926
17050
|
|
|
16927
17051
|
// src/commands/report-create.ts
|
|
16928
17052
|
import { readFileSync as readFileSync14 } from "fs";
|
|
16929
|
-
import { dirname as dirname7, join as
|
|
17053
|
+
import { dirname as dirname7, join as join20 } from "path";
|
|
16930
17054
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
16931
17055
|
function getCliVersion() {
|
|
16932
17056
|
try {
|
|
16933
|
-
const pkg2 = JSON.parse(readFileSync14(
|
|
17057
|
+
const pkg2 = JSON.parse(readFileSync14(join20(__dirname, "..", "..", "package.json"), "utf-8"));
|
|
16934
17058
|
return `cli@${pkg2.version}`;
|
|
16935
17059
|
} catch {
|
|
16936
17060
|
return "cli@unknown";
|
|
@@ -17314,7 +17438,7 @@ var init_update = __esm({
|
|
|
17314
17438
|
init_sentry();
|
|
17315
17439
|
import { readFileSync as readFileSync15 } from "fs";
|
|
17316
17440
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
17317
|
-
import { dirname as dirname8, join as
|
|
17441
|
+
import { dirname as dirname8, join as join21 } from "path";
|
|
17318
17442
|
|
|
17319
17443
|
// src/lib/errors.ts
|
|
17320
17444
|
init_api_client();
|
|
@@ -17443,7 +17567,7 @@ Run \`npx skills add wayai-pro/wayai-skill -y\` to update.`);
|
|
|
17443
17567
|
|
|
17444
17568
|
// src/index.ts
|
|
17445
17569
|
var __dirname2 = dirname8(fileURLToPath3(import.meta.url));
|
|
17446
|
-
var pkg = JSON.parse(readFileSync15(
|
|
17570
|
+
var pkg = JSON.parse(readFileSync15(join21(__dirname2, "..", "package.json"), "utf-8"));
|
|
17447
17571
|
var [, , command, ...args] = process.argv;
|
|
17448
17572
|
var isBackgroundRefresh = command === REFRESH_COMMAND;
|
|
17449
17573
|
var OWN_HELP_COMMANDS = /* @__PURE__ */ new Set(["eval", "admin", "report"]);
|
|
@@ -17499,9 +17623,11 @@ async function main() {
|
|
|
17499
17623
|
await migrateCommand2(args);
|
|
17500
17624
|
break;
|
|
17501
17625
|
}
|
|
17626
|
+
// `unlock` is the deprecated pre-rename alias for `unbind` (kept for back-compat).
|
|
17627
|
+
case "unbind":
|
|
17502
17628
|
case "unlock": {
|
|
17503
|
-
const {
|
|
17504
|
-
await
|
|
17629
|
+
const { unbindCommand: unbindCommand2 } = await Promise.resolve().then(() => (init_unbind(), unbind_exports));
|
|
17630
|
+
await unbindCommand2(args);
|
|
17505
17631
|
break;
|
|
17506
17632
|
}
|
|
17507
17633
|
case "send-message": {
|
|
@@ -17625,9 +17751,9 @@ Commands:
|
|
|
17625
17751
|
push Parse local files, show diff, sync to preview (creates hub if new)
|
|
17626
17752
|
org create Create a new organization (you become its owner)
|
|
17627
17753
|
org <pull|push|diff> Sync org-scoped resources as code (wayai-ws/org/)
|
|
17628
|
-
use <hub>
|
|
17754
|
+
use <hub> Bind this worktree to a specific hub (UUID or folder name)
|
|
17629
17755
|
migrate Move a legacy repo to the wayai-ws/{hubs,org} layout
|
|
17630
|
-
|
|
17756
|
+
unbind Clear the worktree hub binding
|
|
17631
17757
|
send-message Send a test message to a preview hub
|
|
17632
17758
|
conversations List or inspect conversations
|
|
17633
17759
|
analytics Show analytics summary and metrics (use \`analytics query\` for structured ClickHouse queries)
|
|
@@ -17685,12 +17811,12 @@ Org-scoped mode:
|
|
|
17685
17811
|
pull/push operate on the single hub in the workspace, or pass
|
|
17686
17812
|
\`--hub <uuid|name>\` to disambiguate when multiple hubs exist.
|
|
17687
17813
|
|
|
17688
|
-
Worktree hub
|
|
17689
|
-
Each git checkout (main or linked worktree) can be
|
|
17690
|
-
push/pull refuse to run against a different hub once
|
|
17691
|
-
auto-set on first successful pull (or new-hub creation) into an
|
|
17692
|
-
checkout. Use \`wayai use <hub>\` to bind manually and \`wayai
|
|
17693
|
-
The
|
|
17814
|
+
Worktree hub binding:
|
|
17815
|
+
Each git checkout (main or linked worktree) can be bound to a single hub.
|
|
17816
|
+
push/pull refuse to run against a different hub once bound. The binding is
|
|
17817
|
+
auto-set on first successful pull (or new-hub creation) into an unbound
|
|
17818
|
+
checkout. Use \`wayai use <hub>\` to bind manually and \`wayai unbind\` to clear.
|
|
17819
|
+
The binding lives at \`<git-dir>/wayai-binding\` and is naturally per-checkout.
|
|
17694
17820
|
|
|
17695
17821
|
Examples:
|
|
17696
17822
|
wayai login
|