@wayai/cli 0.3.81 → 0.3.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -313,6 +313,25 @@ var init_api_client = __esm({
313
313
  async adminSkillInstall(name) {
314
314
  return this.request("GET", `/api/admin/skills/${encodeURIComponent(name)}`);
315
315
  }
316
+ // Run a shell command in a fresh E2B sandbox (platform-admin gated — the
317
+ // harness-agents PR 1.5 isolation surface). Never carries the E2B key.
318
+ async adminSandboxExec(body) {
319
+ return this.request("POST", "/api/admin/sandbox/exec", body);
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
+ }
316
335
  /**
317
336
  * Re-discover an MCP connection's tool/resource catalog (refreshes stale
318
337
  * input schemas that `push` leaves untouched). `connection` is the display
@@ -5313,7 +5332,7 @@ function findStepBoundaries(transcript) {
5313
5332
  }
5314
5333
  return out;
5315
5334
  }
5316
- 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, 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;
5335
+ 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, 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;
5317
5336
  var init_dist = __esm({
5318
5337
  "../../packages/core/dist/index.js"() {
5319
5338
  "use strict";
@@ -5364,6 +5383,7 @@ var init_dist = __esm({
5364
5383
  init_zod();
5365
5384
  init_zod();
5366
5385
  init_zod();
5386
+ init_zod();
5367
5387
  APP_ERROR_BRAND = /* @__PURE__ */ Symbol.for("wayai.AppError");
5368
5388
  AppError = class extends Error {
5369
5389
  constructor(message, code, statusCode = 500, details) {
@@ -7204,7 +7224,14 @@ var init_dist = __esm({
7204
7224
  updatePlatformConfigBody = external_exports.object({
7205
7225
  free_plan_max_free_orgs_per_user: external_exports.number().int().min(0).optional(),
7206
7226
  /** Kill switch for admin debug-read endpoints. 0 = off, 1 = on. */
7207
- debug_read_enabled: external_exports.number().int().min(0).max(1).optional()
7227
+ debug_read_enabled: external_exports.number().int().min(0).max(1).optional(),
7228
+ /**
7229
+ * Harness-agents rollout gate + kill switch (harness-agents PR 2.9a/2.9b). 0 = off
7230
+ * (default-deny — the per-turn kill switch aborts every harness turn on its next
7231
+ * invocation), 1 = on. `wayai admin harness disable|enable` flips this. The DO's
7232
+ * `updatePlatformConfig` allowlist already accepts it; this exposes it on the route.
7233
+ */
7234
+ harness_enabled: external_exports.number().int().min(0).max(1).optional()
7208
7235
  }).strip().refine(
7209
7236
  (data) => Object.keys(data).length > 0,
7210
7237
  { message: "No fields to update" }
@@ -7212,6 +7239,35 @@ var init_dist = __esm({
7212
7239
  updateFreeOrgLimitBody = external_exports.object({
7213
7240
  max_free_orgs_override: external_exports.number().int().min(0).nullable()
7214
7241
  });
7242
+ adminHarnessMassDestroyBody = external_exports.object({
7243
+ scope: external_exports.enum(["all", "org", "hub"]),
7244
+ org_id: external_exports.string().uuid().optional(),
7245
+ hub_id: external_exports.string().optional(),
7246
+ dry_run: external_exports.boolean().optional().default(false)
7247
+ }).strict().superRefine((data, ctx) => {
7248
+ if (data.scope === "org") {
7249
+ if (!data.org_id) {
7250
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org requires org_id", path: ["org_id"] });
7251
+ }
7252
+ if (data.hub_id) {
7253
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org must not include hub_id", path: ["hub_id"] });
7254
+ }
7255
+ } else if (data.scope === "hub") {
7256
+ if (!data.hub_id) {
7257
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub requires hub_id", path: ["hub_id"] });
7258
+ }
7259
+ if (data.org_id) {
7260
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub must not include org_id", path: ["org_id"] });
7261
+ }
7262
+ } else {
7263
+ if (data.org_id) {
7264
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include org_id", path: ["org_id"] });
7265
+ }
7266
+ if (data.hub_id) {
7267
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include hub_id", path: ["hub_id"] });
7268
+ }
7269
+ }
7270
+ });
7215
7271
  updatePricingPlanBody = external_exports.object({
7216
7272
  display_name: external_exports.string().min(1).optional(),
7217
7273
  stripe_product_id: external_exports.string().optional(),
@@ -7330,6 +7386,31 @@ var init_dist = __esm({
7330
7386
  debugMessageIdQuery = external_exports.object({
7331
7387
  message_id: debugUuid.optional()
7332
7388
  });
7389
+ sandboxEgressPolicy = external_exports.enum(["open", "allowlist", "isolated"]);
7390
+ SANDBOX_EXEC_MAX_CMD_LENGTH = 4096;
7391
+ SANDBOX_EXEC_MAX_ALLOWLIST = 64;
7392
+ SANDBOX_EXEC_MAX_TIMEOUT_MS = 3e5;
7393
+ adminSandboxExecBody = external_exports.object({
7394
+ /** Hub owning the E2B Sandbox connection whose credential we resolve. */
7395
+ hub_id: uuidSchema,
7396
+ /** The Sandbox (E2B) connection to source the api_key from. */
7397
+ connection_id: uuidSchema,
7398
+ /** Shell command to run in the sandbox. Required, bounded length. */
7399
+ cmd: external_exports.string().min(1, "cmd is required").max(SANDBOX_EXEC_MAX_CMD_LENGTH, `cmd must be <= ${SANDBOX_EXEC_MAX_CMD_LENGTH} chars`),
7400
+ /**
7401
+ * Egress posture. Omitted ⇒ the driver fails closed to deny-all outbound (the
7402
+ * §4 safe default). The route re-validates the (policy, allowlist) pair via
7403
+ * `validateEgressConfig`.
7404
+ */
7405
+ egress_policy: sandboxEgressPolicy.optional(),
7406
+ /**
7407
+ * Hosts/CIDRs reachable under `allowlist` (or the single control host under
7408
+ * `isolated`). Ignored under `open`. Bounded count.
7409
+ */
7410
+ egress_allowlist: external_exports.array(external_exports.string().min(1).max(253)).max(SANDBOX_EXEC_MAX_ALLOWLIST, `at most ${SANDBOX_EXEC_MAX_ALLOWLIST} allowlist entries`).optional(),
7411
+ /** Sandbox wall-clock lifetime in ms (bounded). */
7412
+ timeout_ms: external_exports.number().int().min(1).max(SANDBOX_EXEC_MAX_TIMEOUT_MS).optional()
7413
+ });
7333
7414
  whatsappCallbackBody = external_exports.object({
7334
7415
  state: external_exports.string().min(1, "state is required"),
7335
7416
  code: external_exports.string().optional(),
@@ -7343,7 +7424,12 @@ var init_dist = __esm({
7343
7424
  user_id: external_exports.string(),
7344
7425
  email: external_exports.string(),
7345
7426
  org_id: external_exports.string().nullable(),
7346
- is_platform_admin: external_exports.boolean()
7427
+ is_platform_admin: external_exports.boolean(),
7428
+ // Present so the MCP server can conversation-scope + harness-gate the wayai-conversation
7429
+ // control surface (harness-agents PR 2.7c): session_id = conversation_id for a harness
7430
+ // token; is_harness marks the synthetic in-sandbox principal. Optional/back-compat.
7431
+ session_id: external_exports.string().optional(),
7432
+ is_harness: external_exports.boolean().optional()
7347
7433
  });
7348
7434
  wsTicketResponse = external_exports.object({
7349
7435
  ticket: external_exports.string(),
@@ -11929,7 +12015,7 @@ function isSanitizableSliceFile(path25) {
11929
12015
  function distinctUsesBackends(uses) {
11930
12016
  return [...new Set((uses ?? []).map((u) => u.backend))];
11931
12017
  }
11932
- 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, 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;
12018
+ 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, 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;
11933
12019
  var init_contracts = __esm({
11934
12020
  "../../packages/core/dist/contracts/index.js"() {
11935
12021
  "use strict";
@@ -11980,6 +12066,7 @@ var init_contracts = __esm({
11980
12066
  init_zod();
11981
12067
  init_zod();
11982
12068
  init_zod();
12069
+ init_zod();
11983
12070
  uuidSchema2 = external_exports.string().uuid();
11984
12071
  paginationSchema3 = external_exports.object({
11985
12072
  limit: external_exports.coerce.number().int().min(1).max(100).default(50),
@@ -13736,7 +13823,14 @@ var init_contracts = __esm({
13736
13823
  updatePlatformConfigBody2 = external_exports.object({
13737
13824
  free_plan_max_free_orgs_per_user: external_exports.number().int().min(0).optional(),
13738
13825
  /** Kill switch for admin debug-read endpoints. 0 = off, 1 = on. */
13739
- debug_read_enabled: external_exports.number().int().min(0).max(1).optional()
13826
+ debug_read_enabled: external_exports.number().int().min(0).max(1).optional(),
13827
+ /**
13828
+ * Harness-agents rollout gate + kill switch (harness-agents PR 2.9a/2.9b). 0 = off
13829
+ * (default-deny — the per-turn kill switch aborts every harness turn on its next
13830
+ * invocation), 1 = on. `wayai admin harness disable|enable` flips this. The DO's
13831
+ * `updatePlatformConfig` allowlist already accepts it; this exposes it on the route.
13832
+ */
13833
+ harness_enabled: external_exports.number().int().min(0).max(1).optional()
13740
13834
  }).strip().refine(
13741
13835
  (data) => Object.keys(data).length > 0,
13742
13836
  { message: "No fields to update" }
@@ -13744,6 +13838,35 @@ var init_contracts = __esm({
13744
13838
  updateFreeOrgLimitBody2 = external_exports.object({
13745
13839
  max_free_orgs_override: external_exports.number().int().min(0).nullable()
13746
13840
  });
13841
+ adminHarnessMassDestroyBody2 = external_exports.object({
13842
+ scope: external_exports.enum(["all", "org", "hub"]),
13843
+ org_id: external_exports.string().uuid().optional(),
13844
+ hub_id: external_exports.string().optional(),
13845
+ dry_run: external_exports.boolean().optional().default(false)
13846
+ }).strict().superRefine((data, ctx) => {
13847
+ if (data.scope === "org") {
13848
+ if (!data.org_id) {
13849
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org requires org_id", path: ["org_id"] });
13850
+ }
13851
+ if (data.hub_id) {
13852
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=org must not include hub_id", path: ["hub_id"] });
13853
+ }
13854
+ } else if (data.scope === "hub") {
13855
+ if (!data.hub_id) {
13856
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub requires hub_id", path: ["hub_id"] });
13857
+ }
13858
+ if (data.org_id) {
13859
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=hub must not include org_id", path: ["org_id"] });
13860
+ }
13861
+ } else {
13862
+ if (data.org_id) {
13863
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include org_id", path: ["org_id"] });
13864
+ }
13865
+ if (data.hub_id) {
13866
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "scope=all must not include hub_id", path: ["hub_id"] });
13867
+ }
13868
+ }
13869
+ });
13747
13870
  updatePricingPlanBody2 = external_exports.object({
13748
13871
  display_name: external_exports.string().min(1).optional(),
13749
13872
  stripe_product_id: external_exports.string().optional(),
@@ -13862,6 +13985,31 @@ var init_contracts = __esm({
13862
13985
  debugMessageIdQuery2 = external_exports.object({
13863
13986
  message_id: debugUuid2.optional()
13864
13987
  });
13988
+ sandboxEgressPolicy2 = external_exports.enum(["open", "allowlist", "isolated"]);
13989
+ SANDBOX_EXEC_MAX_CMD_LENGTH2 = 4096;
13990
+ SANDBOX_EXEC_MAX_ALLOWLIST2 = 64;
13991
+ SANDBOX_EXEC_MAX_TIMEOUT_MS2 = 3e5;
13992
+ adminSandboxExecBody2 = external_exports.object({
13993
+ /** Hub owning the E2B Sandbox connection whose credential we resolve. */
13994
+ hub_id: uuidSchema2,
13995
+ /** The Sandbox (E2B) connection to source the api_key from. */
13996
+ connection_id: uuidSchema2,
13997
+ /** Shell command to run in the sandbox. Required, bounded length. */
13998
+ cmd: external_exports.string().min(1, "cmd is required").max(SANDBOX_EXEC_MAX_CMD_LENGTH2, `cmd must be <= ${SANDBOX_EXEC_MAX_CMD_LENGTH2} chars`),
13999
+ /**
14000
+ * Egress posture. Omitted ⇒ the driver fails closed to deny-all outbound (the
14001
+ * §4 safe default). The route re-validates the (policy, allowlist) pair via
14002
+ * `validateEgressConfig`.
14003
+ */
14004
+ egress_policy: sandboxEgressPolicy2.optional(),
14005
+ /**
14006
+ * Hosts/CIDRs reachable under `allowlist` (or the single control host under
14007
+ * `isolated`). Ignored under `open`. Bounded count.
14008
+ */
14009
+ egress_allowlist: external_exports.array(external_exports.string().min(1).max(253)).max(SANDBOX_EXEC_MAX_ALLOWLIST2, `at most ${SANDBOX_EXEC_MAX_ALLOWLIST2} allowlist entries`).optional(),
14010
+ /** Sandbox wall-clock lifetime in ms (bounded). */
14011
+ timeout_ms: external_exports.number().int().min(1).max(SANDBOX_EXEC_MAX_TIMEOUT_MS2).optional()
14012
+ });
13865
14013
  whatsappCallbackBody2 = external_exports.object({
13866
14014
  state: external_exports.string().min(1, "state is required"),
13867
14015
  code: external_exports.string().optional(),
@@ -13875,7 +14023,12 @@ var init_contracts = __esm({
13875
14023
  user_id: external_exports.string(),
13876
14024
  email: external_exports.string(),
13877
14025
  org_id: external_exports.string().nullable(),
13878
- is_platform_admin: external_exports.boolean()
14026
+ is_platform_admin: external_exports.boolean(),
14027
+ // Present so the MCP server can conversation-scope + harness-gate the wayai-conversation
14028
+ // control surface (harness-agents PR 2.7c): session_id = conversation_id for a harness
14029
+ // token; is_harness marks the synthetic in-sandbox principal. Optional/back-compat.
14030
+ session_id: external_exports.string().optional(),
14031
+ is_harness: external_exports.boolean().optional()
13879
14032
  });
13880
14033
  wsTicketResponse2 = external_exports.object({
13881
14034
  ticket: external_exports.string(),
@@ -18370,6 +18523,44 @@ async function adminCommand(args2) {
18370
18523
  process.exit(1);
18371
18524
  }
18372
18525
  }
18526
+ if (group === "sandbox") {
18527
+ if (!sub) {
18528
+ printHelp2();
18529
+ process.exit(1);
18530
+ }
18531
+ switch (sub) {
18532
+ // The command is positional after `exec`; the rest are flags.
18533
+ case "exec":
18534
+ await runSandboxExec(positional, flagArgs);
18535
+ return;
18536
+ default:
18537
+ printHelp2();
18538
+ process.exit(1);
18539
+ }
18540
+ }
18541
+ if (group === "harness") {
18542
+ if (!sub) {
18543
+ printHelp2();
18544
+ process.exit(1);
18545
+ }
18546
+ switch (sub) {
18547
+ case "mass-destroy":
18548
+ await runHarnessMassDestroy(flagArgs);
18549
+ return;
18550
+ case "disable":
18551
+ await runHarnessToggle(false);
18552
+ return;
18553
+ case "enable":
18554
+ await runHarnessToggle(true);
18555
+ return;
18556
+ case "status":
18557
+ await runHarnessStatus();
18558
+ return;
18559
+ default:
18560
+ printHelp2();
18561
+ process.exit(1);
18562
+ }
18563
+ }
18373
18564
  printHelp2();
18374
18565
  process.exit(1);
18375
18566
  }
@@ -18877,6 +19068,248 @@ async function runSkillInstall(positional) {
18877
19068
  console.log(`Installed skill "${name}" (${fileCount} file${fileCount === 1 ? "" : "s"}) \u2192 ${relDirs.join(", ")}`);
18878
19069
  console.log("Reload your agent (e.g. restart Claude Code) to pick up the skill.");
18879
19070
  }
19071
+ async function runSandboxExec(positional, flagArgs) {
19072
+ const USAGE = 'wayai admin sandbox exec [--cmd "<command>" | <command>] --hub <hub_id> --connection <connection_id> [--egress open|allowlist|isolated] [--allow <host> ...] [--timeout <ms>] [--json]';
19073
+ let hubId;
19074
+ let connectionId;
19075
+ let egress;
19076
+ let cmdFlag;
19077
+ let timeoutMs;
19078
+ let jsonOutput = false;
19079
+ const allow = [];
19080
+ for (let i = 0; i < flagArgs.length; i++) {
19081
+ const arg = flagArgs[i];
19082
+ switch (arg) {
19083
+ case "--json":
19084
+ jsonOutput = true;
19085
+ break;
19086
+ case "--hub":
19087
+ hubId = requireFlagValue(flagArgs, ++i, "--hub");
19088
+ break;
19089
+ case "--connection":
19090
+ connectionId = requireFlagValue(flagArgs, ++i, "--connection");
19091
+ break;
19092
+ case "--cmd":
19093
+ cmdFlag = requireFlagValue(flagArgs, ++i, "--cmd");
19094
+ break;
19095
+ case "--egress": {
19096
+ const v = requireFlagValue(flagArgs, ++i, "--egress");
19097
+ const parsed = sandboxEgressPolicy2.safeParse(v);
19098
+ if (!parsed.success) {
19099
+ console.error(`--egress must be one of: ${sandboxEgressPolicy2.options.join(", ")}`);
19100
+ process.exit(1);
19101
+ }
19102
+ egress = parsed.data;
19103
+ break;
19104
+ }
19105
+ case "--allow":
19106
+ allow.push(requireFlagValue(flagArgs, ++i, "--allow"));
19107
+ break;
19108
+ case "--timeout": {
19109
+ const v = requireFlagValue(flagArgs, ++i, "--timeout");
19110
+ const n = Number.parseInt(v, 10);
19111
+ if (!Number.isFinite(n) || n < 1) {
19112
+ console.error("--timeout must be a positive integer (milliseconds)");
19113
+ process.exit(1);
19114
+ }
19115
+ timeoutMs = n;
19116
+ break;
19117
+ }
19118
+ default:
19119
+ console.error(`Unknown flag: ${arg}`);
19120
+ process.exit(1);
19121
+ }
19122
+ }
19123
+ const positionalCmd = positional[0];
19124
+ if (positional.length > 1) {
19125
+ console.error("Provide the command as a single quoted argument (or use --cmd).");
19126
+ console.error(USAGE);
19127
+ process.exit(1);
19128
+ }
19129
+ if (positionalCmd && cmdFlag) {
19130
+ console.error("Provide the command EITHER positionally OR via --cmd, not both.");
19131
+ process.exit(1);
19132
+ }
19133
+ const cmd = cmdFlag ?? positionalCmd;
19134
+ if (!cmd || !hubId || !connectionId) {
19135
+ console.error(USAGE);
19136
+ process.exit(1);
19137
+ }
19138
+ const body = {
19139
+ hub_id: hubId,
19140
+ connection_id: connectionId,
19141
+ cmd,
19142
+ ...egress ? { egress_policy: egress } : {},
19143
+ ...allow.length > 0 ? { egress_allowlist: allow } : {},
19144
+ ...timeoutMs !== void 0 ? { timeout_ms: timeoutMs } : {}
19145
+ };
19146
+ const { config, accessToken } = await requireAuth();
19147
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
19148
+ let response;
19149
+ try {
19150
+ response = await client.adminSandboxExec(body);
19151
+ } catch (err) {
19152
+ exitOnApiError(err);
19153
+ throw err;
19154
+ }
19155
+ const data = response.data;
19156
+ if (jsonOutput) {
19157
+ console.log(JSON.stringify(data, null, 2));
19158
+ return;
19159
+ }
19160
+ console.log(`exit_code: ${data.exit_code}`);
19161
+ console.log(`sandbox_id: ${data.sandbox_id}`);
19162
+ if (!data.destroyed) {
19163
+ console.log("warning: sandbox destroy failed on the backend (leak logged; cron will reap it)");
19164
+ }
19165
+ if (data.stdout) {
19166
+ console.log("--- stdout ---");
19167
+ console.log(data.stdout.replace(/\n$/, ""));
19168
+ }
19169
+ if (data.stderr) {
19170
+ console.log("--- stderr ---");
19171
+ console.log(data.stderr.replace(/\n$/, ""));
19172
+ }
19173
+ if (data.exit_code !== 0) {
19174
+ process.exit(data.exit_code);
19175
+ }
19176
+ }
19177
+ async function runHarnessMassDestroy(flagArgs) {
19178
+ const USAGE = "wayai admin harness mass-destroy --all | --org <org_id> | --hub <hub_id> [--dry-run] [--yes] [--json]";
19179
+ let all = false;
19180
+ let orgId;
19181
+ let hubId;
19182
+ let dryRun = false;
19183
+ let yes = false;
19184
+ let jsonOutput = false;
19185
+ for (let i = 0; i < flagArgs.length; i++) {
19186
+ const arg = flagArgs[i];
19187
+ switch (arg) {
19188
+ case "--all":
19189
+ all = true;
19190
+ break;
19191
+ case "--dry-run":
19192
+ dryRun = true;
19193
+ break;
19194
+ case "--yes":
19195
+ yes = true;
19196
+ break;
19197
+ case "--json":
19198
+ jsonOutput = true;
19199
+ break;
19200
+ case "--org":
19201
+ orgId = requireFlagValue(flagArgs, ++i, "--org");
19202
+ break;
19203
+ case "--hub":
19204
+ hubId = requireFlagValue(flagArgs, ++i, "--hub");
19205
+ break;
19206
+ default:
19207
+ console.error(`Unknown flag: ${arg}`);
19208
+ process.exit(1);
19209
+ }
19210
+ }
19211
+ const selectorCount = (all ? 1 : 0) + (orgId ? 1 : 0) + (hubId ? 1 : 0);
19212
+ if (selectorCount !== 1) {
19213
+ console.error("Provide exactly ONE of --all, --org <org_id>, or --hub <hub_id>.");
19214
+ console.error(USAGE);
19215
+ process.exit(1);
19216
+ }
19217
+ let body;
19218
+ let targetLabel;
19219
+ if (all) {
19220
+ body = { scope: "all", dry_run: dryRun };
19221
+ targetLabel = "ALL hubs (platform-wide)";
19222
+ } else if (orgId) {
19223
+ body = { scope: "org", org_id: orgId, dry_run: dryRun };
19224
+ targetLabel = `org ${orgId}`;
19225
+ } else {
19226
+ body = { scope: "hub", hub_id: hubId, dry_run: dryRun };
19227
+ targetLabel = `hub ${hubId}`;
19228
+ }
19229
+ if (!dryRun && !yes && !jsonOutput) {
19230
+ console.log(`About to REAP every live harness sandbox / token / slot in: ${targetLabel}.`);
19231
+ console.log("This destroys running sandboxes and revokes their tokens. Run with --dry-run first to see the blast radius.");
19232
+ const ok = await confirm("Proceed?");
19233
+ if (!ok) {
19234
+ console.log("Aborted.");
19235
+ return;
19236
+ }
19237
+ }
19238
+ const { config, accessToken } = await requireAuth();
19239
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
19240
+ let response;
19241
+ try {
19242
+ response = await client.adminHarnessMassDestroy(body);
19243
+ } catch (err) {
19244
+ exitOnApiError(err);
19245
+ throw err;
19246
+ }
19247
+ const data = response.data;
19248
+ if (jsonOutput) {
19249
+ console.log(JSON.stringify(data, null, 2));
19250
+ return;
19251
+ }
19252
+ const mode = data.dry_run ? "DRY RUN \u2014 no reap performed" : "reaped";
19253
+ console.log(
19254
+ `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}`
19255
+ );
19256
+ if (data.hubs_errored > 0 || data.sessions_errored > 0) {
19257
+ console.log(
19258
+ `WARNING: ${data.hubs_errored} hub(s) and ${data.sessions_errored} session(s) errored and were SKIPPED \u2014 re-run to cover them.`
19259
+ );
19260
+ }
19261
+ if (data.details.length === 0) {
19262
+ console.log("(no live harness sessions in scope)");
19263
+ return;
19264
+ }
19265
+ console.log("");
19266
+ console.log("hub_id | conversation_id | had_sandbox | sandbox_destroyed | reaped");
19267
+ console.log("-------+-----------------+-------------+-------------------+-------");
19268
+ for (const d of data.details) {
19269
+ console.log(
19270
+ `${d.hub_id} | ${d.conversation_id} | ${d.had_sandbox} | ${d.sandbox_destroyed} | ${d.reaped}`
19271
+ );
19272
+ }
19273
+ }
19274
+ async function runHarnessToggle(enable) {
19275
+ const { config, accessToken } = await requireAuth();
19276
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
19277
+ let response;
19278
+ try {
19279
+ response = await client.adminUpdateConfig({ harness_enabled: enable ? 1 : 0 });
19280
+ } catch (err) {
19281
+ exitOnApiError(err);
19282
+ throw err;
19283
+ }
19284
+ const value = response.data.harness_enabled;
19285
+ console.log(
19286
+ enable ? `Harness ENABLED (harness_enabled=${value ?? 1}). New harness turns may run again.` : `Harness DISABLED (harness_enabled=${value ?? 0}). The per-turn kill switch now aborts every harness turn on its next invocation.`
19287
+ );
19288
+ if (!enable) {
19289
+ console.log("Next: run `wayai admin harness mass-destroy --all --dry-run` to see what is still live, then reap it.");
19290
+ }
19291
+ }
19292
+ async function runHarnessStatus() {
19293
+ const { config, accessToken } = await requireAuth();
19294
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
19295
+ let response;
19296
+ try {
19297
+ response = await client.adminGetConfig();
19298
+ } catch (err) {
19299
+ exitOnApiError(err);
19300
+ throw err;
19301
+ }
19302
+ const value = response.data.harness_enabled ?? 0;
19303
+ console.log(`harness_enabled: ${value} (${value ? "ENABLED" : "DISABLED"})`);
19304
+ }
19305
+ function requireFlagValue(flagArgs, index, flag) {
19306
+ const v = flagArgs[index];
19307
+ if (v === void 0 || v.startsWith("--")) {
19308
+ console.error(`${flag} requires a value`);
19309
+ process.exit(1);
19310
+ }
19311
+ return v;
19312
+ }
18880
19313
  function exitOnApiError(err) {
18881
19314
  if (err instanceof ApiError) {
18882
19315
  if (err.status === 401) {
@@ -19295,6 +19728,15 @@ Usage:
19295
19728
 
19296
19729
  wayai admin skill install [name] Install a private operator skill (default: wayai-admin) into each present harness's skills/ dir
19297
19730
 
19731
+ wayai admin sandbox exec [--cmd "<c>" | <c>] --hub <id> --connection <id> [--egress open|allowlist|isolated] [--allow <host> ...] [--timeout <ms>] [--json]
19732
+ Run one shell command in a fresh E2B sandbox (create \u2192 run \u2192 destroy) to test the sandbox driver + egress gate
19733
+
19734
+ wayai admin harness disable Break-glass: flip platform harness_enabled OFF (per-turn kill switch aborts each harness turn on its next invocation)
19735
+ wayai admin harness enable Re-arm: flip platform harness_enabled ON
19736
+ wayai admin harness status Print the current harness_enabled flag
19737
+ wayai admin harness mass-destroy --all | --org <org_id> | --hub <hub_id> [--dry-run] [--yes] [--json]
19738
+ Reap every live harness sandbox/token/slot in scope (run --dry-run first to see the blast radius)
19739
+
19298
19740
  Sources:
19299
19741
  do Live DO SQLite (existing conversation, hub config, etc.).
19300
19742
  analytics ClickHouse projections (conversation, message, billing_event, schedule_event).
@@ -19316,6 +19758,18 @@ Sources:
19316
19758
  "Gemini degraded" / "Analytics delayed" notices. \`create\` authors one
19317
19759
  (severity defaults to info, scope to global); \`list\` reads them
19318
19760
  (--status active|resolved); \`resolve\` ends an active notice.
19761
+ sandbox Run arbitrary code in a fresh E2B sandbox (harness-agents isolation surface).
19762
+ \`exec\` provisions a sandbox from a named Sandbox connection, runs one
19763
+ command, and destroys it. Egress omitted \u21D2 deny-all (fail-closed); opt up
19764
+ with --egress + --allow. The E2B key never leaves the backend. Capped at
19765
+ 20 execs/hour/user (the strictest tier \u2014 this is arbitrary code execution).
19766
+ harness Incident response for harness agents (harness-agents PR 2.9b). \`disable\`
19767
+ flips the platform harness_enabled flag OFF (the per-turn kill switch then
19768
+ aborts each harness turn on its next invocation); \`enable\` re-arms;
19769
+ \`status\` prints the flag. \`mass-destroy\` reaps every harness sandbox/
19770
+ token/slot that is live NOW (scope: --hub < --org < --all, prefer the
19771
+ narrowest). Run \`mass-destroy --dry-run\` first to see the blast radius.
19772
+ See docs/runbooks/harness-incident-response.md.
19319
19773
 
19320
19774
  Types (do): ${VALID_TYPES.join(" | ")}
19321
19775
  Tables (analytics): ${VALID_ANALYTICS_TABLES.join(" | ")}
@@ -19337,6 +19791,12 @@ Examples:
19337
19791
  wayai admin archive <hub-id> <conv-id> --message-id <msg-id> --json
19338
19792
  wayai admin observability <hub-id> <conv-id>
19339
19793
  wayai admin observability <hub-id> <conv-id> --message-id <msg-id> --json
19794
+ wayai admin sandbox exec "echo hi" --hub <hub-id> --connection <conn-id>
19795
+ wayai admin sandbox exec --cmd "curl -s https://api.github.com" --hub <hub-id> --connection <conn-id> --egress allowlist --allow api.github.com
19796
+ wayai admin harness disable
19797
+ wayai admin harness mass-destroy --all --dry-run
19798
+ wayai admin harness mass-destroy --hub <hub-id> --yes
19799
+ wayai admin harness enable
19340
19800
 
19341
19801
  Audit + rate limit:
19342
19802
  Every successful read is logged as admin_debug_read (queryable in Grafana
@@ -19350,6 +19810,7 @@ var init_admin = __esm({
19350
19810
  "use strict";
19351
19811
  init_auth();
19352
19812
  init_api_client();
19813
+ init_utils();
19353
19814
  init_observability();
19354
19815
  init_report_edit_args();
19355
19816
  init_workspace();