@wayai/cli 0.3.82 → 0.3.84
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 +390 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -318,6 +318,52 @@ var init_api_client = __esm({
|
|
|
318
318
|
async adminSandboxExec(body) {
|
|
319
319
|
return this.request("POST", "/api/admin/sandbox/exec", body);
|
|
320
320
|
}
|
|
321
|
+
// Reap every live harness sandbox / token / slot in scope (platform-admin gated
|
|
322
|
+
// — the harness-agents PR 2.9b incident-response surface). Never carries tokens.
|
|
323
|
+
async adminHarnessMassDestroy(body) {
|
|
324
|
+
return this.request("POST", "/api/admin/harness/mass-destroy", body);
|
|
325
|
+
}
|
|
326
|
+
// Read the platform config (platform-admin gated). Used by `wayai admin harness status`.
|
|
327
|
+
async adminGetConfig() {
|
|
328
|
+
return this.request("GET", "/api/admin/config");
|
|
329
|
+
}
|
|
330
|
+
// Patch the platform config (platform-admin gated). Used by `wayai admin harness
|
|
331
|
+
// disable|enable` to flip `harness_enabled`.
|
|
332
|
+
async adminUpdateConfig(body) {
|
|
333
|
+
return this.request("PATCH", "/api/admin/config", body);
|
|
334
|
+
}
|
|
335
|
+
// Flip the ORG-layer harness rollout gate (platform-admin gated — harness-agents
|
|
336
|
+
// PR 2.9a-2 staged rollout). Used by `wayai admin harness enable|disable --org <id>`.
|
|
337
|
+
async adminSetOrgHarness(orgId, enabled) {
|
|
338
|
+
return this.request(
|
|
339
|
+
"PATCH",
|
|
340
|
+
`/api/admin/organizations/${encodeURIComponent(orgId)}/harness`,
|
|
341
|
+
{ harness_enabled: enabled }
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
// Read the ORG-layer harness rollout gate. Used by `wayai admin harness status --org <id>`.
|
|
345
|
+
async adminGetOrgHarness(orgId) {
|
|
346
|
+
return this.request(
|
|
347
|
+
"GET",
|
|
348
|
+
`/api/admin/organizations/${encodeURIComponent(orgId)}/harness`
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
// Flip the HUB-layer harness rollout gate (platform-admin gated — harness-agents
|
|
352
|
+
// PR 2.9a-2 staged rollout). Used by `wayai admin harness enable|disable --hub <id>`.
|
|
353
|
+
async adminSetHubHarness(hubId, enabled) {
|
|
354
|
+
return this.request(
|
|
355
|
+
"PATCH",
|
|
356
|
+
`/api/admin/hubs/${encodeURIComponent(hubId)}/harness`,
|
|
357
|
+
{ harness_enabled: enabled }
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
// Read the HUB-layer harness rollout gate. Used by `wayai admin harness status --hub <id>`.
|
|
361
|
+
async adminGetHubHarness(hubId) {
|
|
362
|
+
return this.request(
|
|
363
|
+
"GET",
|
|
364
|
+
`/api/admin/hubs/${encodeURIComponent(hubId)}/harness`
|
|
365
|
+
);
|
|
366
|
+
}
|
|
321
367
|
/**
|
|
322
368
|
* Re-discover an MCP connection's tool/resource catalog (refreshes stale
|
|
323
369
|
* input schemas that `push` leaves untouched). `connection` is the display
|
|
@@ -5318,7 +5364,7 @@ function findStepBoundaries(transcript) {
|
|
|
5318
5364
|
}
|
|
5319
5365
|
return out;
|
|
5320
5366
|
}
|
|
5321
|
-
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, PREVIEW_LABEL_MAX_LENGTH, previewLabelField, createHubBody, updateHubBody, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery, PLACEHOLDER_TOKENS, ALLOWED_TYPES, SUBSCHEMA_OBJECT_KEYWORDS, SUBSCHEMA_LIST_KEYWORDS, SUBSCHEMA_MAP_KEYWORDS, MAX_SCHEMA_DEPTH, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody, variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody, orgTagIdParam, listOrgTagsQuery, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody, resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery, navItemSchema, hubCountResetBody, navItemCountResetBody, typingBody, analyticsHubIdParam, analyticsVariableIdParam, updateVariablePinBody, updateAnalyticsViewBody, NUMERIC_FILTER_OPS, TEXT_FILTER_OPS, CATEGORICAL_FILTER_OPS, VARIABLE_FILTER_OPS, STRUCTURED_QUERY_OPS, STRUCTURED_QUERY_AGGREGATIONS, filterValueSchema, conversationsBody, analyticsConversationIdParam, messagesQuery, conversationDetailDataQuery, analyticsDataBody, structuredQueryBody, analyticsSqlBody, analyticsSqlSchemaQuery, EVAL_PACING_PRESET_NAMES, 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, annotateConversationBody, 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, sandboxEgressPolicy, SANDBOX_EXEC_MAX_CMD_LENGTH, SANDBOX_EXEC_MAX_ALLOWLIST, SANDBOX_EXEC_MAX_TIMEOUT_MS, adminSandboxExecBody, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, 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, templateUsesEntrySchema, templateUsesSchema, templateYamlLocaleEntry, templateYamlWayaiBlock, templateTagsSchema, templateYamlSchema, templateHeroSchema, templatePushLocaleSchema, templatePushBody, templateListQuery, templateSlugParam, templateDetailQuery, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam, WAYAI_WORKSPACE_LAYOUT, MAX_RESOURCE_FILE_SIZE;
|
|
5367
|
+
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, PREVIEW_LABEL_MAX_LENGTH, previewLabelField, createHubBody, updateHubBody, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, claimCodeChannelParam, claimCodeDeleteParam, connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery, PLACEHOLDER_TOKENS, ALLOWED_TYPES, SUBSCHEMA_OBJECT_KEYWORDS, SUBSCHEMA_LIST_KEYWORDS, SUBSCHEMA_MAP_KEYWORDS, MAX_SCHEMA_DEPTH, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, addNativeToolBody, addMcpToolBody, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody, initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody, variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody, orgTagIdParam, listOrgTagsQuery, createOrgTagBody, updateOrgTagBody, orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody, orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody, resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery, navItemSchema, hubCountResetBody, navItemCountResetBody, typingBody, analyticsHubIdParam, analyticsVariableIdParam, updateVariablePinBody, updateAnalyticsViewBody, NUMERIC_FILTER_OPS, TEXT_FILTER_OPS, CATEGORICAL_FILTER_OPS, VARIABLE_FILTER_OPS, STRUCTURED_QUERY_OPS, STRUCTURED_QUERY_AGGREGATIONS, filterValueSchema, conversationsBody, analyticsConversationIdParam, messagesQuery, conversationDetailDataQuery, analyticsDataBody, structuredQueryBody, analyticsSqlBody, analyticsSqlSchemaQuery, EVAL_PACING_PRESET_NAMES, 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, annotateConversationBody, 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, adminHubIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, updatePlatformConfigBody, updateFreeOrgLimitBody, adminSetOrgHarnessBody, adminSetHubHarnessBody, adminHarnessMassDestroyBody, 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, sandboxEgressPolicy, SANDBOX_EXEC_MAX_CMD_LENGTH, SANDBOX_EXEC_MAX_ALLOWLIST, SANDBOX_EXEC_MAX_TIMEOUT_MS, adminSandboxExecBody, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, 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, templateUsesEntrySchema, templateUsesSchema, templateYamlLocaleEntry, templateYamlWayaiBlock, templateTagsSchema, templateYamlSchema, templateHeroSchema, templatePushLocaleSchema, templatePushBody, templateListQuery, templateSlugParam, templateDetailQuery, ADMIN_SKILL_NAME_REGEX, adminSkillNameParam, WAYAI_WORKSPACE_LAYOUT, MAX_RESOURCE_FILE_SIZE;
|
|
5322
5368
|
var init_dist = __esm({
|
|
5323
5369
|
"../../packages/core/dist/index.js"() {
|
|
5324
5370
|
"use strict";
|
|
@@ -7185,6 +7231,9 @@ var init_dist = __esm({
|
|
|
7185
7231
|
adminPlanIdParam = external_exports.object({
|
|
7186
7232
|
planId: uuidSchema
|
|
7187
7233
|
});
|
|
7234
|
+
adminHubIdParam = external_exports.object({
|
|
7235
|
+
hubId: uuidSchema
|
|
7236
|
+
});
|
|
7188
7237
|
adminOrganizationsQuery = external_exports.object({
|
|
7189
7238
|
page: external_exports.coerce.number().int().min(1).default(1),
|
|
7190
7239
|
limit: external_exports.coerce.number().int().min(1).max(100).default(20),
|
|
@@ -7210,7 +7259,14 @@ var init_dist = __esm({
|
|
|
7210
7259
|
updatePlatformConfigBody = external_exports.object({
|
|
7211
7260
|
free_plan_max_free_orgs_per_user: external_exports.number().int().min(0).optional(),
|
|
7212
7261
|
/** Kill switch for admin debug-read endpoints. 0 = off, 1 = on. */
|
|
7213
|
-
debug_read_enabled: external_exports.number().int().min(0).max(1).optional()
|
|
7262
|
+
debug_read_enabled: external_exports.number().int().min(0).max(1).optional(),
|
|
7263
|
+
/**
|
|
7264
|
+
* Harness-agents rollout gate + kill switch (harness-agents PR 2.9a/2.9b). 0 = off
|
|
7265
|
+
* (default-deny — the per-turn kill switch aborts every harness turn on its next
|
|
7266
|
+
* invocation), 1 = on. `wayai admin harness disable|enable` flips this. The DO's
|
|
7267
|
+
* `updatePlatformConfig` allowlist already accepts it; this exposes it on the route.
|
|
7268
|
+
*/
|
|
7269
|
+
harness_enabled: external_exports.number().int().min(0).max(1).optional()
|
|
7214
7270
|
}).strip().refine(
|
|
7215
7271
|
(data) => Object.keys(data).length > 0,
|
|
7216
7272
|
{ message: "No fields to update" }
|
|
@@ -7218,6 +7274,41 @@ var init_dist = __esm({
|
|
|
7218
7274
|
updateFreeOrgLimitBody = external_exports.object({
|
|
7219
7275
|
max_free_orgs_override: external_exports.number().int().min(0).nullable()
|
|
7220
7276
|
});
|
|
7277
|
+
adminSetOrgHarnessBody = external_exports.object({
|
|
7278
|
+
harness_enabled: external_exports.number().int().min(0).max(1)
|
|
7279
|
+
}).strict();
|
|
7280
|
+
adminSetHubHarnessBody = external_exports.object({
|
|
7281
|
+
harness_enabled: external_exports.number().int().min(0).max(1)
|
|
7282
|
+
}).strict();
|
|
7283
|
+
adminHarnessMassDestroyBody = external_exports.object({
|
|
7284
|
+
scope: external_exports.enum(["all", "org", "hub"]),
|
|
7285
|
+
org_id: external_exports.string().uuid().optional(),
|
|
7286
|
+
hub_id: external_exports.string().optional(),
|
|
7287
|
+
dry_run: external_exports.boolean().optional().default(false)
|
|
7288
|
+
}).strict().superRefine((data, ctx) => {
|
|
7289
|
+
if (data.scope === "org") {
|
|
7290
|
+
if (!data.org_id) {
|
|
7291
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org requires org_id", path: ["org_id"] });
|
|
7292
|
+
}
|
|
7293
|
+
if (data.hub_id) {
|
|
7294
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org must not include hub_id", path: ["hub_id"] });
|
|
7295
|
+
}
|
|
7296
|
+
} else if (data.scope === "hub") {
|
|
7297
|
+
if (!data.hub_id) {
|
|
7298
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub requires hub_id", path: ["hub_id"] });
|
|
7299
|
+
}
|
|
7300
|
+
if (data.org_id) {
|
|
7301
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub must not include org_id", path: ["org_id"] });
|
|
7302
|
+
}
|
|
7303
|
+
} else {
|
|
7304
|
+
if (data.org_id) {
|
|
7305
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include org_id", path: ["org_id"] });
|
|
7306
|
+
}
|
|
7307
|
+
if (data.hub_id) {
|
|
7308
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include hub_id", path: ["hub_id"] });
|
|
7309
|
+
}
|
|
7310
|
+
}
|
|
7311
|
+
});
|
|
7221
7312
|
updatePricingPlanBody = external_exports.object({
|
|
7222
7313
|
display_name: external_exports.string().min(1).optional(),
|
|
7223
7314
|
stripe_product_id: external_exports.string().optional(),
|
|
@@ -7374,7 +7465,12 @@ var init_dist = __esm({
|
|
|
7374
7465
|
user_id: external_exports.string(),
|
|
7375
7466
|
email: external_exports.string(),
|
|
7376
7467
|
org_id: external_exports.string().nullable(),
|
|
7377
|
-
is_platform_admin: external_exports.boolean()
|
|
7468
|
+
is_platform_admin: external_exports.boolean(),
|
|
7469
|
+
// Present so the MCP server can conversation-scope + harness-gate the wayai-conversation
|
|
7470
|
+
// control surface (harness-agents PR 2.7c): session_id = conversation_id for a harness
|
|
7471
|
+
// token; is_harness marks the synthetic in-sandbox principal. Optional/back-compat.
|
|
7472
|
+
session_id: external_exports.string().optional(),
|
|
7473
|
+
is_harness: external_exports.boolean().optional()
|
|
7378
7474
|
});
|
|
7379
7475
|
wsTicketResponse = external_exports.object({
|
|
7380
7476
|
ticket: external_exports.string(),
|
|
@@ -11960,7 +12056,7 @@ function isSanitizableSliceFile(path25) {
|
|
|
11960
12056
|
function distinctUsesBackends(uses) {
|
|
11961
12057
|
return [...new Set((uses ?? []).map((u) => u.backend))];
|
|
11962
12058
|
}
|
|
11963
|
-
var uuidSchema2, paginationSchema3, timestampSchema2, idParamSchema2, primaryRegionSchema2, placementSourceSchema2, orgIdParam2, orgAdminIdParam2, createOrganizationBody2, updateOrganizationBody2, addOrgAdminBody2, AUTH_TYPE3, ORG_CREDENTIAL_AUTH_TYPES3, AUTH_TYPE_DISPLAY3, LEGACY_AUTH_TYPE_MAP3, VALID_AUTH_TYPES3, 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, PREVIEW_LABEL_MAX_LENGTH2, previewLabelField2, createHubBody2, updateHubBody2, addHubAdminBody2, addHubIdentityAuthorizationBody2, contactDecisionBody2, approveContactBody2, listContactAccessQuery2, createHubTeamBody2, updateHubTeamBody2, addHubTeamUserBody2, reassignHubUserBody2, replicatePreviewBody2, claimCodeChannelParam2, claimCodeDeleteParam2, connectionIdParam2, connectorIdParam2, listConnectionsQuery2, deleteConnectionQuery2, addConnectionBody2, editConnectionBody2, PRODUCTION_DIRECT_FIELDS2, setProductionCredentialBody2, registerWhatsappQuery2, registerWhatsappBody2, retryProvisioningQuery2, resendDomainStatusQuery2, PLACEHOLDER_TOKENS2, ALLOWED_TYPES2, SUBSCHEMA_OBJECT_KEYWORDS2, SUBSCHEMA_LIST_KEYWORDS2, SUBSCHEMA_MAP_KEYWORDS2, MAX_SCHEMA_DEPTH2, toolIdParam2, listToolsQuery2, toolAgentQuery2, deleteToolQuery2, toolConnectionsQuery2, nativeToolIdSchema2, addNativeToolBody2, addMcpToolBody2, createCustomToolBody2, updateCustomToolBody2, updateToolExecutionConfigBody2, initialValueCreateSchema2, initialValueUpdateSchema2, stateIdParam2, listStatesQuery2, stateNameSchema2, createStateBody2, updateStateBody2, reorderStatesBody2, variantAiModeSchema2, experimentStatusSchema2, overlayUpdateSchema2, experimentIdParam2, variantIdParam2, listExperimentsQuery2, listVariantsQuery2, listOverridesQuery2, deleteOverrideQuery2, createExperimentBody2, updateExperimentBody2, setExperimentStatusBody2, createVariantBody2, updateVariantBody2, upsertOverrideBody2, orgTagIdParam2, listOrgTagsQuery2, createOrgTagBody2, updateOrgTagBody2, orgCredentialIdParam2, listOrgCredentialsQuery2, createOrgCredentialBody2, updateOrgCredentialBody2, orgResourceIdParam2, orgResourceFileIdParam2, orgResourceFolderIdParam2, hubOrgResourceParam2, listOrgResourcesQuery2, orgIdQuery2, createOrgResourceBody2, updateOrgResourceBody2, createOrgResourceFolderBody2, updateOrgResourceFolderBody2, uploadOrgResourceFileBody2, updateOrgResourceFileBody2, uploadOrgSkillZipBody2, linkOrgResourceBody2, resourceIdParam2, listResourcesQuery2, createResourceBody2, updateResourceBody2, syncSkillsBody2, resourceFileIdParam2, listResourceFilesQuery2, createResourceFileBody2, updateResourceFileBody2, uploadResourceFileBody2, uploadSkillZipBody2, resourceFolderIdParam2, listResourceFoldersQuery2, createResourceFolderBody2, updateResourceFolderBody2, agentResourceQuery2, hubResourceQuery2, linkAgentResourceBody2, updateAgentResourceBody2, unlinkAgentResourceQuery2, navItemSchema2, hubCountResetBody2, navItemCountResetBody2, typingBody2, analyticsHubIdParam2, analyticsVariableIdParam2, updateVariablePinBody2, updateAnalyticsViewBody2, NUMERIC_FILTER_OPS2, TEXT_FILTER_OPS2, CATEGORICAL_FILTER_OPS2, VARIABLE_FILTER_OPS2, STRUCTURED_QUERY_OPS2, STRUCTURED_QUERY_AGGREGATIONS2, filterValueSchema2, conversationsBody2, analyticsConversationIdParam2, messagesQuery2, conversationDetailDataQuery2, analyticsDataBody2, structuredQueryBody2, analyticsSqlBody2, analyticsSqlSchemaQuery2, EVAL_PACING_PRESET_NAMES2, 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, annotateConversationBody2, 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, sandboxEgressPolicy2, SANDBOX_EXEC_MAX_CMD_LENGTH2, SANDBOX_EXEC_MAX_ALLOWLIST2, SANDBOX_EXEC_MAX_TIMEOUT_MS2, adminSandboxExecBody2, whatsappCallbackBody2, authMeResponse2, wsTicketResponse2, sessionCheckResponse2, logoutResponse2, magicCodeSendBody2, magicCodeSendResponse2, magicCodeVerifyBody2, magicCodeVerifyResponse2, 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, TEMPLATE_INSTANCE_ID_KEYS, TEMPLATE_OPAQUE_BLOB_KEYS, TEMPLATE_AUTHOR_DATA_KEYS, templateTextSchema2, templateUsesEntrySchema2, templateUsesSchema2, templateYamlLocaleEntry2, templateYamlWayaiBlock2, templateTagsSchema2, templateYamlSchema2, templateHeroSchema2, templatePushLocaleSchema2, templatePushBody2, templateListQuery2, templateSlugParam2, templateDetailQuery2, ADMIN_SKILL_NAME_REGEX2, adminSkillNameParam2;
|
|
12059
|
+
var uuidSchema2, paginationSchema3, timestampSchema2, idParamSchema2, primaryRegionSchema2, placementSourceSchema2, orgIdParam2, orgAdminIdParam2, createOrganizationBody2, updateOrganizationBody2, addOrgAdminBody2, AUTH_TYPE3, ORG_CREDENTIAL_AUTH_TYPES3, AUTH_TYPE_DISPLAY3, LEGACY_AUTH_TYPE_MAP3, VALID_AUTH_TYPES3, 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, PREVIEW_LABEL_MAX_LENGTH2, previewLabelField2, createHubBody2, updateHubBody2, addHubAdminBody2, addHubIdentityAuthorizationBody2, contactDecisionBody2, approveContactBody2, listContactAccessQuery2, createHubTeamBody2, updateHubTeamBody2, addHubTeamUserBody2, reassignHubUserBody2, replicatePreviewBody2, claimCodeChannelParam2, claimCodeDeleteParam2, connectionIdParam2, connectorIdParam2, listConnectionsQuery2, deleteConnectionQuery2, addConnectionBody2, editConnectionBody2, PRODUCTION_DIRECT_FIELDS2, setProductionCredentialBody2, registerWhatsappQuery2, registerWhatsappBody2, retryProvisioningQuery2, resendDomainStatusQuery2, PLACEHOLDER_TOKENS2, ALLOWED_TYPES2, SUBSCHEMA_OBJECT_KEYWORDS2, SUBSCHEMA_LIST_KEYWORDS2, SUBSCHEMA_MAP_KEYWORDS2, MAX_SCHEMA_DEPTH2, toolIdParam2, listToolsQuery2, toolAgentQuery2, deleteToolQuery2, toolConnectionsQuery2, nativeToolIdSchema2, addNativeToolBody2, addMcpToolBody2, createCustomToolBody2, updateCustomToolBody2, updateToolExecutionConfigBody2, initialValueCreateSchema2, initialValueUpdateSchema2, stateIdParam2, listStatesQuery2, stateNameSchema2, createStateBody2, updateStateBody2, reorderStatesBody2, variantAiModeSchema2, experimentStatusSchema2, overlayUpdateSchema2, experimentIdParam2, variantIdParam2, listExperimentsQuery2, listVariantsQuery2, listOverridesQuery2, deleteOverrideQuery2, createExperimentBody2, updateExperimentBody2, setExperimentStatusBody2, createVariantBody2, updateVariantBody2, upsertOverrideBody2, orgTagIdParam2, listOrgTagsQuery2, createOrgTagBody2, updateOrgTagBody2, orgCredentialIdParam2, listOrgCredentialsQuery2, createOrgCredentialBody2, updateOrgCredentialBody2, orgResourceIdParam2, orgResourceFileIdParam2, orgResourceFolderIdParam2, hubOrgResourceParam2, listOrgResourcesQuery2, orgIdQuery2, createOrgResourceBody2, updateOrgResourceBody2, createOrgResourceFolderBody2, updateOrgResourceFolderBody2, uploadOrgResourceFileBody2, updateOrgResourceFileBody2, uploadOrgSkillZipBody2, linkOrgResourceBody2, resourceIdParam2, listResourcesQuery2, createResourceBody2, updateResourceBody2, syncSkillsBody2, resourceFileIdParam2, listResourceFilesQuery2, createResourceFileBody2, updateResourceFileBody2, uploadResourceFileBody2, uploadSkillZipBody2, resourceFolderIdParam2, listResourceFoldersQuery2, createResourceFolderBody2, updateResourceFolderBody2, agentResourceQuery2, hubResourceQuery2, linkAgentResourceBody2, updateAgentResourceBody2, unlinkAgentResourceQuery2, navItemSchema2, hubCountResetBody2, navItemCountResetBody2, typingBody2, analyticsHubIdParam2, analyticsVariableIdParam2, updateVariablePinBody2, updateAnalyticsViewBody2, NUMERIC_FILTER_OPS2, TEXT_FILTER_OPS2, CATEGORICAL_FILTER_OPS2, VARIABLE_FILTER_OPS2, STRUCTURED_QUERY_OPS2, STRUCTURED_QUERY_AGGREGATIONS2, filterValueSchema2, conversationsBody2, analyticsConversationIdParam2, messagesQuery2, conversationDetailDataQuery2, analyticsDataBody2, structuredQueryBody2, analyticsSqlBody2, analyticsSqlSchemaQuery2, EVAL_PACING_PRESET_NAMES2, 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, annotateConversationBody2, 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, adminHubIdParam2, adminOrganizationsQuery2, adminUserSearchQuery2, kanbanSlugMigrationQuery2, adjustQuotaBody2, updatePlanBody2, addAdminUserBody2, updatePlatformConfigBody2, updateFreeOrgLimitBody2, adminSetOrgHarnessBody2, adminSetHubHarnessBody2, adminHarnessMassDestroyBody2, 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, sandboxEgressPolicy2, SANDBOX_EXEC_MAX_CMD_LENGTH2, SANDBOX_EXEC_MAX_ALLOWLIST2, SANDBOX_EXEC_MAX_TIMEOUT_MS2, adminSandboxExecBody2, whatsappCallbackBody2, authMeResponse2, wsTicketResponse2, sessionCheckResponse2, logoutResponse2, magicCodeSendBody2, magicCodeSendResponse2, magicCodeVerifyBody2, magicCodeVerifyResponse2, 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, TEMPLATE_INSTANCE_ID_KEYS, TEMPLATE_OPAQUE_BLOB_KEYS, TEMPLATE_AUTHOR_DATA_KEYS, templateTextSchema2, templateUsesEntrySchema2, templateUsesSchema2, templateYamlLocaleEntry2, templateYamlWayaiBlock2, templateTagsSchema2, templateYamlSchema2, templateHeroSchema2, templatePushLocaleSchema2, templatePushBody2, templateListQuery2, templateSlugParam2, templateDetailQuery2, ADMIN_SKILL_NAME_REGEX2, adminSkillNameParam2;
|
|
11964
12060
|
var init_contracts = __esm({
|
|
11965
12061
|
"../../packages/core/dist/contracts/index.js"() {
|
|
11966
12062
|
"use strict";
|
|
@@ -13743,6 +13839,9 @@ var init_contracts = __esm({
|
|
|
13743
13839
|
adminPlanIdParam2 = external_exports.object({
|
|
13744
13840
|
planId: uuidSchema2
|
|
13745
13841
|
});
|
|
13842
|
+
adminHubIdParam2 = external_exports.object({
|
|
13843
|
+
hubId: uuidSchema2
|
|
13844
|
+
});
|
|
13746
13845
|
adminOrganizationsQuery2 = external_exports.object({
|
|
13747
13846
|
page: external_exports.coerce.number().int().min(1).default(1),
|
|
13748
13847
|
limit: external_exports.coerce.number().int().min(1).max(100).default(20),
|
|
@@ -13768,7 +13867,14 @@ var init_contracts = __esm({
|
|
|
13768
13867
|
updatePlatformConfigBody2 = external_exports.object({
|
|
13769
13868
|
free_plan_max_free_orgs_per_user: external_exports.number().int().min(0).optional(),
|
|
13770
13869
|
/** Kill switch for admin debug-read endpoints. 0 = off, 1 = on. */
|
|
13771
|
-
debug_read_enabled: external_exports.number().int().min(0).max(1).optional()
|
|
13870
|
+
debug_read_enabled: external_exports.number().int().min(0).max(1).optional(),
|
|
13871
|
+
/**
|
|
13872
|
+
* Harness-agents rollout gate + kill switch (harness-agents PR 2.9a/2.9b). 0 = off
|
|
13873
|
+
* (default-deny — the per-turn kill switch aborts every harness turn on its next
|
|
13874
|
+
* invocation), 1 = on. `wayai admin harness disable|enable` flips this. The DO's
|
|
13875
|
+
* `updatePlatformConfig` allowlist already accepts it; this exposes it on the route.
|
|
13876
|
+
*/
|
|
13877
|
+
harness_enabled: external_exports.number().int().min(0).max(1).optional()
|
|
13772
13878
|
}).strip().refine(
|
|
13773
13879
|
(data) => Object.keys(data).length > 0,
|
|
13774
13880
|
{ message: "No fields to update" }
|
|
@@ -13776,6 +13882,41 @@ var init_contracts = __esm({
|
|
|
13776
13882
|
updateFreeOrgLimitBody2 = external_exports.object({
|
|
13777
13883
|
max_free_orgs_override: external_exports.number().int().min(0).nullable()
|
|
13778
13884
|
});
|
|
13885
|
+
adminSetOrgHarnessBody2 = external_exports.object({
|
|
13886
|
+
harness_enabled: external_exports.number().int().min(0).max(1)
|
|
13887
|
+
}).strict();
|
|
13888
|
+
adminSetHubHarnessBody2 = external_exports.object({
|
|
13889
|
+
harness_enabled: external_exports.number().int().min(0).max(1)
|
|
13890
|
+
}).strict();
|
|
13891
|
+
adminHarnessMassDestroyBody2 = external_exports.object({
|
|
13892
|
+
scope: external_exports.enum(["all", "org", "hub"]),
|
|
13893
|
+
org_id: external_exports.string().uuid().optional(),
|
|
13894
|
+
hub_id: external_exports.string().optional(),
|
|
13895
|
+
dry_run: external_exports.boolean().optional().default(false)
|
|
13896
|
+
}).strict().superRefine((data, ctx) => {
|
|
13897
|
+
if (data.scope === "org") {
|
|
13898
|
+
if (!data.org_id) {
|
|
13899
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org requires org_id", path: ["org_id"] });
|
|
13900
|
+
}
|
|
13901
|
+
if (data.hub_id) {
|
|
13902
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org must not include hub_id", path: ["hub_id"] });
|
|
13903
|
+
}
|
|
13904
|
+
} else if (data.scope === "hub") {
|
|
13905
|
+
if (!data.hub_id) {
|
|
13906
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub requires hub_id", path: ["hub_id"] });
|
|
13907
|
+
}
|
|
13908
|
+
if (data.org_id) {
|
|
13909
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub must not include org_id", path: ["org_id"] });
|
|
13910
|
+
}
|
|
13911
|
+
} else {
|
|
13912
|
+
if (data.org_id) {
|
|
13913
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include org_id", path: ["org_id"] });
|
|
13914
|
+
}
|
|
13915
|
+
if (data.hub_id) {
|
|
13916
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include hub_id", path: ["hub_id"] });
|
|
13917
|
+
}
|
|
13918
|
+
}
|
|
13919
|
+
});
|
|
13779
13920
|
updatePricingPlanBody2 = external_exports.object({
|
|
13780
13921
|
display_name: external_exports.string().min(1).optional(),
|
|
13781
13922
|
stripe_product_id: external_exports.string().optional(),
|
|
@@ -13932,7 +14073,12 @@ var init_contracts = __esm({
|
|
|
13932
14073
|
user_id: external_exports.string(),
|
|
13933
14074
|
email: external_exports.string(),
|
|
13934
14075
|
org_id: external_exports.string().nullable(),
|
|
13935
|
-
is_platform_admin: external_exports.boolean()
|
|
14076
|
+
is_platform_admin: external_exports.boolean(),
|
|
14077
|
+
// Present so the MCP server can conversation-scope + harness-gate the wayai-conversation
|
|
14078
|
+
// control surface (harness-agents PR 2.7c): session_id = conversation_id for a harness
|
|
14079
|
+
// token; is_harness marks the synthetic in-sandbox principal. Optional/back-compat.
|
|
14080
|
+
session_id: external_exports.string().optional(),
|
|
14081
|
+
is_harness: external_exports.boolean().optional()
|
|
13936
14082
|
});
|
|
13937
14083
|
wsTicketResponse2 = external_exports.object({
|
|
13938
14084
|
ticket: external_exports.string(),
|
|
@@ -18442,6 +18588,29 @@ async function adminCommand(args2) {
|
|
|
18442
18588
|
process.exit(1);
|
|
18443
18589
|
}
|
|
18444
18590
|
}
|
|
18591
|
+
if (group === "harness") {
|
|
18592
|
+
if (!sub) {
|
|
18593
|
+
printHelp2();
|
|
18594
|
+
process.exit(1);
|
|
18595
|
+
}
|
|
18596
|
+
switch (sub) {
|
|
18597
|
+
case "mass-destroy":
|
|
18598
|
+
await runHarnessMassDestroy(flagArgs);
|
|
18599
|
+
return;
|
|
18600
|
+
case "disable":
|
|
18601
|
+
await runHarnessToggle(false, flagArgs);
|
|
18602
|
+
return;
|
|
18603
|
+
case "enable":
|
|
18604
|
+
await runHarnessToggle(true, flagArgs);
|
|
18605
|
+
return;
|
|
18606
|
+
case "status":
|
|
18607
|
+
await runHarnessStatus(flagArgs);
|
|
18608
|
+
return;
|
|
18609
|
+
default:
|
|
18610
|
+
printHelp2();
|
|
18611
|
+
process.exit(1);
|
|
18612
|
+
}
|
|
18613
|
+
}
|
|
18445
18614
|
printHelp2();
|
|
18446
18615
|
process.exit(1);
|
|
18447
18616
|
}
|
|
@@ -19055,9 +19224,198 @@ async function runSandboxExec(positional, flagArgs) {
|
|
|
19055
19224
|
process.exit(data.exit_code);
|
|
19056
19225
|
}
|
|
19057
19226
|
}
|
|
19227
|
+
async function runHarnessMassDestroy(flagArgs) {
|
|
19228
|
+
const USAGE = "wayai admin harness mass-destroy --all | --org <org_id> | --hub <hub_id> [--dry-run] [--yes] [--json]";
|
|
19229
|
+
let all = false;
|
|
19230
|
+
let orgId;
|
|
19231
|
+
let hubId;
|
|
19232
|
+
let dryRun = false;
|
|
19233
|
+
let yes = false;
|
|
19234
|
+
let jsonOutput = false;
|
|
19235
|
+
for (let i = 0; i < flagArgs.length; i++) {
|
|
19236
|
+
const arg = flagArgs[i];
|
|
19237
|
+
switch (arg) {
|
|
19238
|
+
case "--all":
|
|
19239
|
+
all = true;
|
|
19240
|
+
break;
|
|
19241
|
+
case "--dry-run":
|
|
19242
|
+
dryRun = true;
|
|
19243
|
+
break;
|
|
19244
|
+
case "--yes":
|
|
19245
|
+
yes = true;
|
|
19246
|
+
break;
|
|
19247
|
+
case "--json":
|
|
19248
|
+
jsonOutput = true;
|
|
19249
|
+
break;
|
|
19250
|
+
case "--org":
|
|
19251
|
+
orgId = requireFlagValue(flagArgs, ++i, "--org");
|
|
19252
|
+
break;
|
|
19253
|
+
case "--hub":
|
|
19254
|
+
hubId = requireFlagValue(flagArgs, ++i, "--hub");
|
|
19255
|
+
break;
|
|
19256
|
+
default:
|
|
19257
|
+
console.error(`Unknown flag: ${arg}`);
|
|
19258
|
+
process.exit(1);
|
|
19259
|
+
}
|
|
19260
|
+
}
|
|
19261
|
+
const selectorCount = (all ? 1 : 0) + (orgId ? 1 : 0) + (hubId ? 1 : 0);
|
|
19262
|
+
if (selectorCount !== 1) {
|
|
19263
|
+
console.error("Provide exactly ONE of --all, --org <org_id>, or --hub <hub_id>.");
|
|
19264
|
+
console.error(USAGE);
|
|
19265
|
+
process.exit(1);
|
|
19266
|
+
}
|
|
19267
|
+
let body;
|
|
19268
|
+
let targetLabel;
|
|
19269
|
+
if (all) {
|
|
19270
|
+
body = { scope: "all", dry_run: dryRun };
|
|
19271
|
+
targetLabel = "ALL hubs (platform-wide)";
|
|
19272
|
+
} else if (orgId) {
|
|
19273
|
+
body = { scope: "org", org_id: orgId, dry_run: dryRun };
|
|
19274
|
+
targetLabel = `org ${orgId}`;
|
|
19275
|
+
} else {
|
|
19276
|
+
body = { scope: "hub", hub_id: hubId, dry_run: dryRun };
|
|
19277
|
+
targetLabel = `hub ${hubId}`;
|
|
19278
|
+
}
|
|
19279
|
+
if (!dryRun && !yes && !jsonOutput) {
|
|
19280
|
+
console.log(`About to REAP every live harness sandbox / token / slot in: ${targetLabel}.`);
|
|
19281
|
+
console.log("This destroys running sandboxes and revokes their tokens. Run with --dry-run first to see the blast radius.");
|
|
19282
|
+
const ok = await confirm("Proceed?");
|
|
19283
|
+
if (!ok) {
|
|
19284
|
+
console.log("Aborted.");
|
|
19285
|
+
return;
|
|
19286
|
+
}
|
|
19287
|
+
}
|
|
19288
|
+
const { config, accessToken } = await requireAuth();
|
|
19289
|
+
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
19290
|
+
let response;
|
|
19291
|
+
try {
|
|
19292
|
+
response = await client.adminHarnessMassDestroy(body);
|
|
19293
|
+
} catch (err) {
|
|
19294
|
+
exitOnApiError(err);
|
|
19295
|
+
throw err;
|
|
19296
|
+
}
|
|
19297
|
+
const data = response.data;
|
|
19298
|
+
if (jsonOutput) {
|
|
19299
|
+
console.log(JSON.stringify(data, null, 2));
|
|
19300
|
+
return;
|
|
19301
|
+
}
|
|
19302
|
+
const mode = data.dry_run ? "DRY RUN \u2014 no reap performed" : "reaped";
|
|
19303
|
+
console.log(
|
|
19304
|
+
`harness mass-destroy (${data.scope}) \u2014 ${mode}: hubs_scanned=${data.hubs_scanned} sessions_found=${data.sessions_found} sessions_reaped=${data.sessions_reaped} sandboxes_destroyed=${data.sandboxes_destroyed}`
|
|
19305
|
+
);
|
|
19306
|
+
if (data.hubs_errored > 0 || data.sessions_errored > 0) {
|
|
19307
|
+
console.log(
|
|
19308
|
+
`WARNING: ${data.hubs_errored} hub(s) and ${data.sessions_errored} session(s) errored and were SKIPPED \u2014 re-run to cover them.`
|
|
19309
|
+
);
|
|
19310
|
+
}
|
|
19311
|
+
if (data.details.length === 0) {
|
|
19312
|
+
console.log("(no live harness sessions in scope)");
|
|
19313
|
+
return;
|
|
19314
|
+
}
|
|
19315
|
+
console.log("");
|
|
19316
|
+
console.log("hub_id | conversation_id | had_sandbox | sandbox_destroyed | reaped");
|
|
19317
|
+
console.log("-------+-----------------+-------------+-------------------+-------");
|
|
19318
|
+
for (const d of data.details) {
|
|
19319
|
+
console.log(
|
|
19320
|
+
`${d.hub_id} | ${d.conversation_id} | ${d.had_sandbox} | ${d.sandbox_destroyed} | ${d.reaped}`
|
|
19321
|
+
);
|
|
19322
|
+
}
|
|
19323
|
+
}
|
|
19324
|
+
function resolveHarnessLayer(flagArgs, usage2) {
|
|
19325
|
+
let orgId;
|
|
19326
|
+
let hubId;
|
|
19327
|
+
for (let i = 0; i < flagArgs.length; i++) {
|
|
19328
|
+
const arg = flagArgs[i];
|
|
19329
|
+
switch (arg) {
|
|
19330
|
+
case "--org":
|
|
19331
|
+
orgId = requireFlagValue(flagArgs, ++i, "--org");
|
|
19332
|
+
break;
|
|
19333
|
+
case "--hub":
|
|
19334
|
+
hubId = requireFlagValue(flagArgs, ++i, "--hub");
|
|
19335
|
+
break;
|
|
19336
|
+
default:
|
|
19337
|
+
console.error(`Unknown flag: ${arg}`);
|
|
19338
|
+
console.error(usage2);
|
|
19339
|
+
process.exit(1);
|
|
19340
|
+
}
|
|
19341
|
+
}
|
|
19342
|
+
if (orgId && hubId) {
|
|
19343
|
+
console.error("Provide at most ONE of --org <org_id> or --hub <hub_id> (or neither for the platform layer).");
|
|
19344
|
+
console.error(usage2);
|
|
19345
|
+
process.exit(1);
|
|
19346
|
+
}
|
|
19347
|
+
if (orgId) return { kind: "org", orgId };
|
|
19348
|
+
if (hubId) return { kind: "hub", hubId };
|
|
19349
|
+
return { kind: "platform" };
|
|
19350
|
+
}
|
|
19351
|
+
async function runHarnessToggle(enable, flagArgs) {
|
|
19352
|
+
const USAGE = "wayai admin harness enable|disable [--org <org_id> | --hub <hub_id>]";
|
|
19353
|
+
const layer = resolveHarnessLayer(flagArgs, USAGE);
|
|
19354
|
+
const { config, accessToken } = await requireAuth();
|
|
19355
|
+
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
19356
|
+
let value;
|
|
19357
|
+
let scopeLabel;
|
|
19358
|
+
try {
|
|
19359
|
+
if (layer.kind === "org") {
|
|
19360
|
+
const res = await client.adminSetOrgHarness(layer.orgId, enable ? 1 : 0);
|
|
19361
|
+
value = res.data.harness_enabled;
|
|
19362
|
+
scopeLabel = `org ${layer.orgId}`;
|
|
19363
|
+
} else if (layer.kind === "hub") {
|
|
19364
|
+
const res = await client.adminSetHubHarness(layer.hubId, enable ? 1 : 0);
|
|
19365
|
+
value = res.data.harness_enabled;
|
|
19366
|
+
scopeLabel = `hub ${layer.hubId}`;
|
|
19367
|
+
} else {
|
|
19368
|
+
const res = await client.adminUpdateConfig({ harness_enabled: enable ? 1 : 0 });
|
|
19369
|
+
value = res.data.harness_enabled;
|
|
19370
|
+
scopeLabel = "platform";
|
|
19371
|
+
}
|
|
19372
|
+
} catch (err) {
|
|
19373
|
+
exitOnApiError(err);
|
|
19374
|
+
throw err;
|
|
19375
|
+
}
|
|
19376
|
+
const state = enable ? "ENABLED" : "DISABLED";
|
|
19377
|
+
console.log(`Harness ${state} for ${scopeLabel} (harness_enabled=${value ?? (enable ? 1 : 0)}).`);
|
|
19378
|
+
if (layer.kind === "platform") {
|
|
19379
|
+
if (enable) {
|
|
19380
|
+
console.log("New harness turns may run again (subject to each hub's + org's own flag).");
|
|
19381
|
+
} else {
|
|
19382
|
+
console.log("The per-turn kill switch now aborts every harness turn on its next invocation.");
|
|
19383
|
+
console.log("Next: run `wayai admin harness mass-destroy --all --dry-run` to see what is still live, then reap it.");
|
|
19384
|
+
}
|
|
19385
|
+
} else {
|
|
19386
|
+
console.log("Reminder: a harness agent is creatable only when the platform, org, AND hub flags are ALL on.");
|
|
19387
|
+
}
|
|
19388
|
+
}
|
|
19389
|
+
async function runHarnessStatus(flagArgs) {
|
|
19390
|
+
const USAGE = "wayai admin harness status [--org <org_id> | --hub <hub_id>]";
|
|
19391
|
+
const layer = resolveHarnessLayer(flagArgs, USAGE);
|
|
19392
|
+
const { config, accessToken } = await requireAuth();
|
|
19393
|
+
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
19394
|
+
let value = 0;
|
|
19395
|
+
let scopeLabel;
|
|
19396
|
+
try {
|
|
19397
|
+
if (layer.kind === "org") {
|
|
19398
|
+
const res = await client.adminGetOrgHarness(layer.orgId);
|
|
19399
|
+
value = res.data.harness_enabled;
|
|
19400
|
+
scopeLabel = `org ${layer.orgId}`;
|
|
19401
|
+
} else if (layer.kind === "hub") {
|
|
19402
|
+
const res = await client.adminGetHubHarness(layer.hubId);
|
|
19403
|
+
value = res.data.harness_enabled;
|
|
19404
|
+
scopeLabel = `hub ${layer.hubId}`;
|
|
19405
|
+
} else {
|
|
19406
|
+
const res = await client.adminGetConfig();
|
|
19407
|
+
value = res.data.harness_enabled ?? 0;
|
|
19408
|
+
scopeLabel = "platform";
|
|
19409
|
+
}
|
|
19410
|
+
} catch (err) {
|
|
19411
|
+
exitOnApiError(err);
|
|
19412
|
+
throw err;
|
|
19413
|
+
}
|
|
19414
|
+
console.log(`harness_enabled (${scopeLabel}): ${value} (${value ? "ENABLED" : "DISABLED"})`);
|
|
19415
|
+
}
|
|
19058
19416
|
function requireFlagValue(flagArgs, index, flag) {
|
|
19059
19417
|
const v = flagArgs[index];
|
|
19060
|
-
if (v === void 0 || v.startsWith("--")) {
|
|
19418
|
+
if (v === void 0 || v === "" || v.startsWith("--")) {
|
|
19061
19419
|
console.error(`${flag} requires a value`);
|
|
19062
19420
|
process.exit(1);
|
|
19063
19421
|
}
|
|
@@ -19484,6 +19842,15 @@ Usage:
|
|
|
19484
19842
|
wayai admin sandbox exec [--cmd "<c>" | <c>] --hub <id> --connection <id> [--egress open|allowlist|isolated] [--allow <host> ...] [--timeout <ms>] [--json]
|
|
19485
19843
|
Run one shell command in a fresh E2B sandbox (create \u2192 run \u2192 destroy) to test the sandbox driver + egress gate
|
|
19486
19844
|
|
|
19845
|
+
wayai admin harness disable [--org <org_id> | --hub <hub_id>]
|
|
19846
|
+
Flip harness_enabled OFF. No scope = platform (break-glass: per-turn kill switch aborts each harness turn on its next invocation); --org/--hub target that layer of the three-layer rollout gate
|
|
19847
|
+
wayai admin harness enable [--org <org_id> | --hub <hub_id>]
|
|
19848
|
+
Flip harness_enabled ON. No scope = platform; --org/--hub stage the org/hub layer (a harness agent is creatable only when platform AND org AND hub are ALL on)
|
|
19849
|
+
wayai admin harness status [--org <org_id> | --hub <hub_id>]
|
|
19850
|
+
Print the harness_enabled flag for the chosen layer (platform by default)
|
|
19851
|
+
wayai admin harness mass-destroy --all | --org <org_id> | --hub <hub_id> [--dry-run] [--yes] [--json]
|
|
19852
|
+
Reap every live harness sandbox/token/slot in scope (run --dry-run first to see the blast radius)
|
|
19853
|
+
|
|
19487
19854
|
Sources:
|
|
19488
19855
|
do Live DO SQLite (existing conversation, hub config, etc.).
|
|
19489
19856
|
analytics ClickHouse projections (conversation, message, billing_event, schedule_event).
|
|
@@ -19510,6 +19877,17 @@ Sources:
|
|
|
19510
19877
|
command, and destroys it. Egress omitted \u21D2 deny-all (fail-closed); opt up
|
|
19511
19878
|
with --egress + --allow. The E2B key never leaves the backend. Capped at
|
|
19512
19879
|
20 execs/hour/user (the strictest tier \u2014 this is arbitrary code execution).
|
|
19880
|
+
harness Incident response + staged rollout for harness agents. \`disable\`/\`enable\`
|
|
19881
|
+
flip the harness_enabled flag; \`status\` prints it. With no scope they
|
|
19882
|
+
target the PLATFORM flag (disable = break-glass: the per-turn kill switch
|
|
19883
|
+
then aborts each harness turn on its next invocation). With --org <id> or
|
|
19884
|
+
--hub <id> they target that layer of the three-layer rollout gate (PR
|
|
19885
|
+
2.9a-2): a harness agent is creatable only when platform AND org AND hub
|
|
19886
|
+
are ALL on \u2014 flip platform on, then enable per org/hub to stage. The
|
|
19887
|
+
per-turn kill switch stays platform-only. \`mass-destroy\` reaps every
|
|
19888
|
+
harness sandbox/token/slot that is live NOW (scope: --hub < --org < --all,
|
|
19889
|
+
prefer the narrowest). Run \`mass-destroy --dry-run\` first to see the blast
|
|
19890
|
+
radius. See docs/runbooks/harness-incident-response.md.
|
|
19513
19891
|
|
|
19514
19892
|
Types (do): ${VALID_TYPES.join(" | ")}
|
|
19515
19893
|
Tables (analytics): ${VALID_ANALYTICS_TABLES.join(" | ")}
|
|
@@ -19533,6 +19911,10 @@ Examples:
|
|
|
19533
19911
|
wayai admin observability <hub-id> <conv-id> --message-id <msg-id> --json
|
|
19534
19912
|
wayai admin sandbox exec "echo hi" --hub <hub-id> --connection <conn-id>
|
|
19535
19913
|
wayai admin sandbox exec --cmd "curl -s https://api.github.com" --hub <hub-id> --connection <conn-id> --egress allowlist --allow api.github.com
|
|
19914
|
+
wayai admin harness disable
|
|
19915
|
+
wayai admin harness mass-destroy --all --dry-run
|
|
19916
|
+
wayai admin harness mass-destroy --hub <hub-id> --yes
|
|
19917
|
+
wayai admin harness enable
|
|
19536
19918
|
|
|
19537
19919
|
Audit + rate limit:
|
|
19538
19920
|
Every successful read is logged as admin_debug_read (queryable in Grafana
|
|
@@ -19546,6 +19928,7 @@ var init_admin = __esm({
|
|
|
19546
19928
|
"use strict";
|
|
19547
19929
|
init_auth();
|
|
19548
19930
|
init_api_client();
|
|
19931
|
+
init_utils();
|
|
19549
19932
|
init_observability();
|
|
19550
19933
|
init_report_edit_args();
|
|
19551
19934
|
init_workspace();
|