@wayai/cli 0.3.309 → 0.3.311

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
@@ -6084,7 +6084,7 @@ var init_chunk_T6D3YZ6B = __esm({
6084
6084
  }
6085
6085
  });
6086
6086
 
6087
- // ../../packages/core/dist/chunk-XIVMA3EN.js
6087
+ // ../../packages/core/dist/chunk-U6S4MZGT.js
6088
6088
  function boundCustomerPartyIsValid(audience, parties, customer) {
6089
6089
  return audience !== REKOR_PERSON_AUDIENCE_STAFF && customer < parties.length && Array.isArray(parties[customer]);
6090
6090
  }
@@ -6098,8 +6098,8 @@ function isEncodedBoundPerson(raw) {
6098
6098
  return rekorBoundPersonSchema.safeParse(parsed).success;
6099
6099
  }
6100
6100
  var TOOLSET_SLUG_PATTERN, REKOR_STRUCTURAL_ID_PATTERN, baseEnvironmentSchema, toolsetFileToolSchema, toolsetSurfaceSchema, toolsetConnectionBindingSchema, seedConnectionBindingSchema, rekorSeedBindingSchema, rekorToolsetToolsSchema, rekorPersonIdSchema, rekorPersonAudienceSchema, rekorBoundPersonSchema, STATED_GENERATION_PATTERN, rekorBoundAttestation, rekorSeedAttestation, rekorResolvedToolsetSchema, REKOR_TOOL_KINDS_PARAM, REKOR_TOOL_KINDS_RESOLVE_SEARCH, resolvedRecordTypeSchema, reviewWritersSchema, sharedScopeSchema, resolvedFileToolSchema, rekorToolsetFileSchema, rekorToolsetFileUrlAnswerSchema, rekorToolsetFileListSchema, rekorToolsetFileGetSchema, rekorToolsetFilePutSchema, TOOLSET_CUSTOMER_FACING_REFUSAL_MARK, TOOLSET_CUSTOMER_FACING_REFUSAL, BASE_TOOLSET_ONLY_FOR_CUSTOMER_FACING, GENERIC_DATA_MCP_CUSTOMER_FACING_REFUSAL, GENERIC_DATA_API_CUSTOMER_FACING_REFUSAL;
6101
- var init_chunk_XIVMA3EN = __esm({
6102
- "../../packages/core/dist/chunk-XIVMA3EN.js"() {
6101
+ var init_chunk_U6S4MZGT = __esm({
6102
+ "../../packages/core/dist/chunk-U6S4MZGT.js"() {
6103
6103
  "use strict";
6104
6104
  init_chunk_T6D3YZ6B();
6105
6105
  init_chunk_SDOG6762();
@@ -6185,8 +6185,8 @@ var init_chunk_XIVMA3EN = __esm({
6185
6185
  * The id of the token the binding was resolved from, as its resolve reports it; a bound attested
6186
6186
  * call names it (`REKOR_BOUND_TOKEN_HEADER`), so the data product refuses the binding once the token
6187
6187
  * is revoked or expires (owner decision 41). Absent on a binding recorded before the report carried
6188
- * it: its calls name none until a token save, or a tool sync while the token still stands, records it.
6189
- * One that does not read is dropped rather than failing the binding.
6188
+ * it: its calls name none until a token save records it. One that does not read is dropped rather than
6189
+ * failing the binding.
6190
6190
  */
6191
6191
  token_id: external_exports.string().regex(REKOR_STRUCTURAL_ID_PATTERN).optional().catch(void 0)
6192
6192
  });
@@ -6389,12 +6389,12 @@ var init_chunk_XIVMA3EN = __esm({
6389
6389
  }
6390
6390
  });
6391
6391
 
6392
- // ../../packages/core/dist/chunk-HVYKBO5E.js
6392
+ // ../../packages/core/dist/chunk-JW6QQD5K.js
6393
6393
  var TOOLSET_ANSWER_PERSON_PARTIES, toolsetAnswerPersonSchema, toolsetAnswerPersonsSchema;
6394
- var init_chunk_HVYKBO5E = __esm({
6395
- "../../packages/core/dist/chunk-HVYKBO5E.js"() {
6394
+ var init_chunk_JW6QQD5K = __esm({
6395
+ "../../packages/core/dist/chunk-JW6QQD5K.js"() {
6396
6396
  "use strict";
6397
- init_chunk_XIVMA3EN();
6397
+ init_chunk_U6S4MZGT();
6398
6398
  init_chunk_SDOG6762();
6399
6399
  init_zod();
6400
6400
  TOOLSET_ANSWER_PERSON_PARTIES = ["requester", "originator", "initiator", "delegator"];
@@ -6521,7 +6521,7 @@ var init_chunk_5FO3GNKP = __esm({
6521
6521
  }
6522
6522
  });
6523
6523
 
6524
- // ../../packages/core/dist/chunk-DWJOFJEA.js
6524
+ // ../../packages/core/dist/chunk-SMVVXYHP.js
6525
6525
  function matchPath(pattern, path45) {
6526
6526
  const pathSegments2 = path45.replace(/\/$/, "").split("/");
6527
6527
  const isPrefix = pattern.endsWith("/*");
@@ -6550,8 +6550,8 @@ function getEndpointConfig(path45) {
6550
6550
  return { tier: "STANDARD" };
6551
6551
  }
6552
6552
  var ENDPOINT_CONFIGS, EXCLUDED_PATHS;
6553
- var init_chunk_DWJOFJEA = __esm({
6554
- "../../packages/core/dist/chunk-DWJOFJEA.js"() {
6553
+ var init_chunk_SMVVXYHP = __esm({
6554
+ "../../packages/core/dist/chunk-SMVVXYHP.js"() {
6555
6555
  "use strict";
6556
6556
  init_chunk_5FO3GNKP();
6557
6557
  ENDPOINT_CONFIGS = {
@@ -6881,6 +6881,9 @@ var init_chunk_DWJOFJEA = __esm({
6881
6881
  // takes the same strict, fail-closed budget as the other hub repairs. Exact path, for the same reason.
6882
6882
  "/api/admin/hubs/repair-knowledge-blobs": { tier: "STRICT", userLimit: 10, userWindow: 3600, failClosed: true },
6883
6883
  "/api/admin/hubs/repair-credential-links": { tier: "STRICT", userLimit: 10, userWindow: 3600, failClosed: true },
6884
+ // The WayAI-host token clear (#5644 steps 6–7) deletes connections and org credentials, and its dry run fans out over
6885
+ // every hub of every org: the same strict, fail-closed budget.
6886
+ "/api/admin/hubs/clear-wayai-host-tokens": { tier: "STRICT", userLimit: 10, userWindow: 3600, failClosed: true },
6884
6887
  // The credentials-vault importer (wayai#5644 D2-M6) decrypts and moves an org's credentials, or puts them back:
6885
6888
  // strict and fail-closed like the hub repairs, with room for the re-runs a bounded run takes (`max_puts`).
6886
6889
  "/api/admin/vault-import/*": { tier: "STRICT", userLimit: 60, userWindow: 3600, failClosed: true, userLimitKey: "/api/admin/vault-import/*" },
@@ -7040,7 +7043,7 @@ var init_chunk_DWJOFJEA = __esm({
7040
7043
  }
7041
7044
  });
7042
7045
 
7043
- // ../../packages/core/dist/chunk-UVGO72D6.js
7046
+ // ../../packages/core/dist/chunk-5SG6USCJ.js
7044
7047
  function fileSnapshotChanged(run) {
7045
7048
  return run.written + run.removed > 0;
7046
7049
  }
@@ -7081,10 +7084,10 @@ async function sendWithRetry(opts, cursor) {
7081
7084
  }
7082
7085
  }
7083
7086
  var rekorFileSnapshotAnswerSchema, FILE_SNAPSHOT_MAX_PAGES, FILE_SNAPSHOT_CONFLICT_ATTEMPTS, FILE_SNAPSHOT_PAGE_SPACING_MS, FILE_SNAPSHOT_CONFLICT_STATUS;
7084
- var init_chunk_UVGO72D6 = __esm({
7085
- "../../packages/core/dist/chunk-UVGO72D6.js"() {
7087
+ var init_chunk_5SG6USCJ = __esm({
7088
+ "../../packages/core/dist/chunk-5SG6USCJ.js"() {
7086
7089
  "use strict";
7087
- init_chunk_DWJOFJEA();
7090
+ init_chunk_SMVVXYHP();
7088
7091
  init_chunk_5FO3GNKP();
7089
7092
  init_zod();
7090
7093
  rekorFileSnapshotAnswerSchema = external_exports.object({
@@ -7749,12 +7752,12 @@ var init_chunk_FBV7NLKO = __esm({
7749
7752
  }
7750
7753
  });
7751
7754
 
7752
- // ../../packages/core/dist/chunk-BXX2O5VY.js
7755
+ // ../../packages/core/dist/chunk-TSIH4Y2H.js
7753
7756
  var hubPageWatchParam, pageWatchedBaseSchema, hubPageWatchResponseSchema;
7754
- var init_chunk_BXX2O5VY = __esm({
7755
- "../../packages/core/dist/chunk-BXX2O5VY.js"() {
7757
+ var init_chunk_TSIH4Y2H = __esm({
7758
+ "../../packages/core/dist/chunk-TSIH4Y2H.js"() {
7756
7759
  "use strict";
7757
- init_chunk_XIVMA3EN();
7760
+ init_chunk_U6S4MZGT();
7758
7761
  init_chunk_FBV7NLKO();
7759
7762
  init_chunk_HZ6CADSY();
7760
7763
  init_zod();
@@ -10103,7 +10106,7 @@ var init_chunk_JHUTFQDO = __esm({
10103
10106
  }
10104
10107
  });
10105
10108
 
10106
- // ../../packages/core/dist/chunk-5SDIIQVO.js
10109
+ // ../../packages/core/dist/chunk-7IKO675N.js
10107
10110
  function spokenLineField(label2, description2) {
10108
10111
  return { type: "text", label: label2, maxLength: SPOKEN_LINE_MAX_CHARS, default: "", description: description2 };
10109
10112
  }
@@ -10113,8 +10116,8 @@ function byLowercaseName(a, b) {
10113
10116
  return x < y ? -1 : x > y ? 1 : 0;
10114
10117
  }
10115
10118
  var CALLER_LANGUAGE, GIT_CHECKOUT_MAX_LENGTH, TTS_VOICE_REPLY_ENABLED_FIELD, decisionsImageInputField, COPILOT_TRIGGER_FIELD, SANDBOX_AGENT_FIELDS, AUDIO_LANGUAGE_OPTIONS, WHATSAPP_CONNECTOR, INSTAGRAM_CONNECTOR, whatsapp, instagram, resend, telegram, API_CHANNEL_DELIVERY_EVENTS, apiChannel, OPENAI_REASONING_MODELS, openai, anthropic, googleAiStudio, openRouter, xai, typesafe, groqStt, openaiStt, elevenLabsStt, openaiTts, groqTts, elevenLabsTts, GEMINI_TTS_VOICES, googleTts, wayai, externalResources, restApiTool, mcpServer, REKOR_TOOLSET_SERVICE_NAME, rekorToolset, CLAUDE_HARNESS_MODELS, CLAUDE_HARNESS_MODEL_OPTIONS, HARNESS_EGRESS_FIELDS, claudeManagedAgents, SPOKEN_LINE_MAX_CHARS, gptLive, CONNECTORS;
10116
- var init_chunk_5SDIIQVO = __esm({
10117
- "../../packages/core/dist/chunk-5SDIIQVO.js"() {
10119
+ var init_chunk_7IKO675N = __esm({
10120
+ "../../packages/core/dist/chunk-7IKO675N.js"() {
10118
10121
  "use strict";
10119
10122
  CALLER_LANGUAGE = "caller";
10120
10123
  GIT_CHECKOUT_MAX_LENGTH = 255;
@@ -10996,7 +10999,7 @@ var init_chunk_5SDIIQVO = __esm({
10996
10999
  connector_credential_schema: {
10997
11000
  bearer: {
10998
11001
  connection_display_name: { type: "text", label: "Connection Name", placeholder: "Support knowledge", description: "This name will be used to identify the connection in the system", required: true },
10999
- access_token: { type: "password", label: "Toolset Token", placeholder: "rec_\u2026", description: "An API token bound to this toolset. It must be for a base of this hub's environment: a preview hub holds a preview base's token, a production hub a production base's.", required: true, maskInEdit: true, useExistingPlaceholder: "__USE_EXISTING_ACCESS_TOKEN__" }
11002
+ access_token: { type: "password", label: "Toolset Token", placeholder: "rec_\u2026", description: "An API token bound to this toolset. It must be for a base of this hub's environment: a preview hub takes a preview base's token, a production hub a production base's.", required: true, maskInEdit: true, useExistingPlaceholder: "__USE_EXISTING_ACCESS_TOKEN__" }
11000
11003
  }
11001
11004
  },
11002
11005
  token_refresh_config: { bearer: { strategy: "none" } },
@@ -11132,13 +11135,13 @@ var init_chunk_5SDIIQVO = __esm({
11132
11135
  }
11133
11136
  });
11134
11137
 
11135
- // ../../packages/core/dist/chunk-BFX5K5TT.js
11138
+ // ../../packages/core/dist/chunk-55RZ7YIF.js
11136
11139
  var COUNTER_KEYS, STT_PRICING, CONTAINER_PRICING, connectorById, nativeToolById;
11137
- var init_chunk_BFX5K5TT = __esm({
11138
- "../../packages/core/dist/chunk-BFX5K5TT.js"() {
11140
+ var init_chunk_55RZ7YIF = __esm({
11141
+ "../../packages/core/dist/chunk-55RZ7YIF.js"() {
11139
11142
  "use strict";
11140
11143
  init_chunk_JHUTFQDO();
11141
- init_chunk_5SDIIQVO();
11144
+ init_chunk_7IKO675N();
11142
11145
  init_chunk_MIWZOSPI();
11143
11146
  COUNTER_KEYS = Object.keys({
11144
11147
  input_tokens: true,
@@ -11261,7 +11264,7 @@ var init_chunk_L5F7ZOUJ = __esm({
11261
11264
  }
11262
11265
  });
11263
11266
 
11264
- // ../../packages/core/dist/chunk-R3OKBQMZ.js
11267
+ // ../../packages/core/dist/chunk-7IXDF53E.js
11265
11268
  function normalizeDecisionsModelId(modelId) {
11266
11269
  return modelId.trim().toLowerCase();
11267
11270
  }
@@ -11332,10 +11335,10 @@ function readAgentSettingsModel(agentSettings) {
11332
11335
  return typeof model === "string" ? model : null;
11333
11336
  }
11334
11337
  var DECISIONS_MODEL_PREFIXES, DECISION_CAPABLE_AGENT_ROLES;
11335
- var init_chunk_R3OKBQMZ = __esm({
11336
- "../../packages/core/dist/chunk-R3OKBQMZ.js"() {
11338
+ var init_chunk_7IXDF53E = __esm({
11339
+ "../../packages/core/dist/chunk-7IXDF53E.js"() {
11337
11340
  "use strict";
11338
- init_chunk_BFX5K5TT();
11341
+ init_chunk_55RZ7YIF();
11339
11342
  init_chunk_L5F7ZOUJ();
11340
11343
  DECISIONS_MODEL_PREFIXES = ["typesafe/jev-", "jev-"];
11341
11344
  DECISION_CAPABLE_AGENT_ROLES = [
@@ -11346,7 +11349,7 @@ var init_chunk_R3OKBQMZ = __esm({
11346
11349
  }
11347
11350
  });
11348
11351
 
11349
- // ../../packages/core/dist/chunk-FGNMHILL.js
11352
+ // ../../packages/core/dist/chunk-L4YFOZGK.js
11350
11353
  function resolveMonitorTrigger(monitorConfig) {
11351
11354
  if (!monitorConfig || typeof monitorConfig !== "object") return "idle";
11352
11355
  const raw = monitorConfig.trigger;
@@ -11652,14 +11655,14 @@ function refineMonitorRulesStructuredOutput(body, ctx) {
11652
11655
  if (refusal2) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["response_format"], message: refusal2 });
11653
11656
  }
11654
11657
  var previousConversationsCountField, summarizationThresholdField, flagConditionSchema, MONITOR_TRIGGERS, monitorTriggerSchema, AUTOMATION_GATE_TRIGGERS, NON_FIRING_TRIGGERS, MONITOR_FIRING_TRIGGERS, MONITOR_DELAY_SECONDS_MIN, MONITOR_IDLE_DELAY_REQUIRED_MESSAGE, MONITOR_HISTORY_MESSAGES_MAX, monitorHistoryMessagesSchema, monitorIncludeToolResultsSchema, MONITOR_INPUT_SHAPING_KEYS, MONITOR_INPUT_SHAPING_SCHEMAS, MONITOR_INPUT_SHAPING_IDLE_MESSAGE, monitorArgumentSourceSchema, MONITOR_NOTE_TEMPLATE_MAX, MONITOR_STEER_NOTE_MAX, MONITOR_GATE_AGENT_NAME_MAX, monitorActionSchema, monitorRuleSchema, MONITOR_RULE_KEYS, MONITOR_RULE_SCHEMAS, MONITOR_RULE_TRIGGERS, MONITOR_RULE_TRIGGER_MESSAGE, CALL_UTTERANCE_SPEAKERS, callUtteranceSpeakerSchema, MONITOR_CALL_KEYS, MONITOR_CALL_SCHEMAS, MONITOR_CALL_KEY_MESSAGE, CALL_STEERING_MIN_CONFIDENCE, CALL_UTTERANCE_RULE_NOT_CONFIDENT_MESSAGE, CALL_UTTERANCE_FALLBACK_MESSAGE, CALL_UTTERANCE_FLAG_CONDITIONS_MESSAGE, CALL_STEER_NOTE_BLANK_MESSAGE, MONITOR_USER_MESSAGE_ACTION_KINDS, MONITOR_ASSISTANT_REPLY_ACTION_KINDS, MONITOR_CALL_UTTERANCE_ACTION_KINDS, MONITOR_AUTOMATION_FIRE_ACTION_KINDS, MONITOR_AUTOMATION_ITEM_ACTION_KINDS, INSERT_NOTE_TOOL_NAME, RUN_MONITOR_TOOL_NAME, MONITOR_RULE_ALLOWED_NATIVE_TOOLS, MONITOR_RULE_REENTRY_TOOLS, MONITOR_RULE_REENTRY_TRACKS, AUTOMATION_FIRE_FLAG_CONDITIONS_MESSAGE, AUTOMATION_FIRE_INPUT_SHAPING_MESSAGE, AUTOMATION_ITEM_FLAG_CONDITIONS_MESSAGE, AUTOMATION_ITEM_INPUT_SHAPING_MESSAGE, AUTOMATION_GATE_KEY_MESSAGES, monitorConfigField, flagConditionsField, agentIdParam, listAgentsQuery, agentConnectionsQuery, createAgentBody, updateAgentBody, AGENT_PARAMETER_TYPES, AGENT_PARAMETER_NAME_REGEX, agentParameterCreateSchema, MAX_AGENT_PARAMETERS_PER_REQUEST, createAgentParametersBody;
11655
- var init_chunk_FGNMHILL = __esm({
11656
- "../../packages/core/dist/chunk-FGNMHILL.js"() {
11658
+ var init_chunk_L4YFOZGK = __esm({
11659
+ "../../packages/core/dist/chunk-L4YFOZGK.js"() {
11657
11660
  "use strict";
11658
11661
  init_chunk_IBL7FANV();
11659
11662
  init_chunk_KB5RK3RP();
11660
11663
  init_chunk_C2UEA2KW();
11661
11664
  init_chunk_HZ6CADSY();
11662
- init_chunk_R3OKBQMZ();
11665
+ init_chunk_7IXDF53E();
11663
11666
  init_chunk_JHUTFQDO();
11664
11667
  init_chunk_YROEDMVZ();
11665
11668
  init_chunk_L5F7ZOUJ();
@@ -11877,12 +11880,12 @@ var init_chunk_FGNMHILL = __esm({
11877
11880
  }
11878
11881
  });
11879
11882
 
11880
- // ../../packages/core/dist/chunk-DZ3J5TJT.js
11883
+ // ../../packages/core/dist/chunk-65MH4JRN.js
11881
11884
  var conversationIdParam, conversationHubQuery, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, deleteUserConversationsResponse, sendMessageBody, listConversationsQuery, flagSourceSchema, getConversationsResponse, getConversationDetailParams, getConversationDetailQuery, getConversationDetailResponse, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody;
11882
- var init_chunk_DZ3J5TJT = __esm({
11883
- "../../packages/core/dist/chunk-DZ3J5TJT.js"() {
11885
+ var init_chunk_65MH4JRN = __esm({
11886
+ "../../packages/core/dist/chunk-65MH4JRN.js"() {
11884
11887
  "use strict";
11885
- init_chunk_FGNMHILL();
11888
+ init_chunk_L4YFOZGK();
11886
11889
  init_chunk_HZ6CADSY();
11887
11890
  init_chunk_YROEDMVZ();
11888
11891
  init_zod();
@@ -12411,14 +12414,14 @@ var init_chunk_E4DIIOOE = __esm({
12411
12414
  }
12412
12415
  });
12413
12416
 
12414
- // ../../packages/core/dist/chunk-WEXNHMSJ.js
12417
+ // ../../packages/core/dist/chunk-I2EVH3FR.js
12415
12418
  var evalCallInstant, EVAL_CALL_MIN_SECONDS, EVAL_CALL_MAX_SECONDS, EVAL_CALL_SPOKEN_LINE_MAX_CHARS, hubScoped2, createEvalCallBody, createEvalCallResponse, evalCallConversationQuery, evalCallRecordQuery, evalCallSpeaker, evalCallUtterance, evalCallTurn, evalCallRecording, evalCallRecordResponse, evalCallFinishResponse;
12416
- var init_chunk_WEXNHMSJ = __esm({
12417
- "../../packages/core/dist/chunk-WEXNHMSJ.js"() {
12419
+ var init_chunk_I2EVH3FR = __esm({
12420
+ "../../packages/core/dist/chunk-I2EVH3FR.js"() {
12418
12421
  "use strict";
12419
12422
  init_chunk_E4DIIOOE();
12420
12423
  init_chunk_HZ6CADSY();
12421
- init_chunk_5SDIIQVO();
12424
+ init_chunk_7IKO675N();
12422
12425
  init_chunk_MIWZOSPI();
12423
12426
  init_zod();
12424
12427
  evalCallInstant = timestampSchema.refine(isIsoTimestamp, "Expected a canonical ISO timestamp");
@@ -14395,7 +14398,7 @@ var init_chunk_MO23HUAX = __esm({
14395
14398
  }
14396
14399
  });
14397
14400
 
14398
- // ../../packages/core/dist/chunk-KXYJ46BM.js
14401
+ // ../../packages/core/dist/chunk-KOLSAPLZ.js
14399
14402
  function declaresNoConnection(agent) {
14400
14403
  return agent.connection === null && !agent.connection_id;
14401
14404
  }
@@ -15127,8 +15130,8 @@ function skillSectionsAsResources(scope) {
15127
15130
  };
15128
15131
  }
15129
15132
  var MAX_10MB_BASE64_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_CARRIERS, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES, MAX_RESOURCE_ENCODED_BYTES, MAX_HUB_AS_CODE_RESOURCES, MAX_HUB_AS_CODE_RESOURCE_FILES, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES, MAX_CI_CONFIG_BODY_BYTES, MAX_HUB_AS_CODE_PAGE_MANIFEST_CHARS, hubAsCodePagesSchema, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, HUB_AS_CODE_AGENT_TOOL_KEYS, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, flagEntriesOf, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, MAX_HUB_AS_CODE_DEPTH, NAMED_DEPTH_SEGMENTS, NAMED_DEPTH_KEY_CHARS, fieldName, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema;
15130
- var init_chunk_KXYJ46BM = __esm({
15131
- "../../packages/core/dist/chunk-KXYJ46BM.js"() {
15133
+ var init_chunk_KOLSAPLZ = __esm({
15134
+ "../../packages/core/dist/chunk-KOLSAPLZ.js"() {
15132
15135
  "use strict";
15133
15136
  init_chunk_YI3ORIXJ();
15134
15137
  init_chunk_T6D3YZ6B();
@@ -15138,13 +15141,13 @@ var init_chunk_KXYJ46BM = __esm({
15138
15141
  init_chunk_MO23HUAX();
15139
15142
  init_chunk_X5PZZVTS();
15140
15143
  init_chunk_K5UAZWFF();
15141
- init_chunk_FGNMHILL();
15144
+ init_chunk_L4YFOZGK();
15142
15145
  init_chunk_S4VDZ7PZ();
15143
15146
  init_chunk_C2UEA2KW();
15144
15147
  init_chunk_FBV7NLKO();
15145
15148
  init_chunk_WEXVYJ5H();
15146
15149
  init_chunk_HZ6CADSY();
15147
- init_chunk_R3OKBQMZ();
15150
+ init_chunk_7IXDF53E();
15148
15151
  init_chunk_YROEDMVZ();
15149
15152
  init_zod();
15150
15153
  MAX_10MB_BASE64_ENCODED_BYTES = Math.ceil(MAX_RESOURCE_FILE_SIZE / 3) * 4 + 16;
@@ -15625,7 +15628,7 @@ var init_chunk_OMPT4ZHR = __esm({
15625
15628
  }
15626
15629
  });
15627
15630
 
15628
- // ../../packages/core/dist/chunk-I3PBCSF4.js
15631
+ // ../../packages/core/dist/chunk-7SJEG3UO.js
15629
15632
  function refineScopedTarget(data, ctx) {
15630
15633
  if (data.scope === "org") {
15631
15634
  if (!data.org_id) {
@@ -15650,9 +15653,9 @@ function refineScopedTarget(data, ctx) {
15650
15653
  }
15651
15654
  }
15652
15655
  }
15653
- var adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, AUTOMATION_GATE_EVALUATIONS_PER_OPERATION_BOUND, automationGateEvaluationsPerOperation, AUTOMATION_RUN_RETENTION_DAYS_MAX, automationRunRetentionDays, turnDeadlineSeconds, casesLimit, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetShape, adminScopedTargetBody, adminDryRunByDefaultTargetBody, BRANCHING_ORPHAN_ENTITY_TYPES, BRANCHING_ORPHAN_MAX_TARGETS, adminRepairBranchingOrphansBody, adminRepairLegacyOrgGrantsBody, adminRepairCompedPlansBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, dataExplorerDebugCountsDoType, dataExplorerDebugCountsParam, debugHubConvParam, debugMessageIdQuery;
15654
- var init_chunk_I3PBCSF4 = __esm({
15655
- "../../packages/core/dist/chunk-I3PBCSF4.js"() {
15656
+ var adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, AUTOMATION_GATE_EVALUATIONS_PER_OPERATION_BOUND, automationGateEvaluationsPerOperation, AUTOMATION_RUN_RETENTION_DAYS_MAX, automationRunRetentionDays, turnDeadlineSeconds, casesLimit, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetShape, adminScopedTargetBody, adminDryRunByDefaultTargetBody, WAYAI_HOST_TOKEN_TARGET_KINDS, WAYAI_HOST_TOKEN_MAX_TARGETS, adminClearWayaiHostTokensBody, BRANCHING_ORPHAN_ENTITY_TYPES, BRANCHING_ORPHAN_MAX_TARGETS, adminRepairBranchingOrphansBody, adminRepairLegacyOrgGrantsBody, adminRepairCompedPlansBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, dataExplorerDebugCountsDoType, dataExplorerDebugCountsParam, debugHubConvParam, debugMessageIdQuery;
15657
+ var init_chunk_7SJEG3UO = __esm({
15658
+ "../../packages/core/dist/chunk-7SJEG3UO.js"() {
15656
15659
  "use strict";
15657
15660
  init_chunk_FECLIZTY();
15658
15661
  init_chunk_BFG4ZWR4();
@@ -15844,6 +15847,17 @@ var init_chunk_I3PBCSF4 = __esm({
15844
15847
  });
15845
15848
  adminScopedTargetBody = adminScopedTargetShape.strict().superRefine(refineScopedTarget);
15846
15849
  adminDryRunByDefaultTargetBody = adminScopedTargetShape.extend({ dry_run: external_exports.boolean().optional().default(true) }).strict().superRefine(refineScopedTarget);
15850
+ WAYAI_HOST_TOKEN_TARGET_KINDS = ["toolset", "seed", "connection", "credential"];
15851
+ WAYAI_HOST_TOKEN_MAX_TARGETS = 50;
15852
+ adminClearWayaiHostTokensBody = adminScopedTargetShape.extend({
15853
+ dry_run: external_exports.boolean().optional().default(true),
15854
+ targets: external_exports.array(external_exports.object({ kind: external_exports.enum(WAYAI_HOST_TOKEN_TARGET_KINDS), id: external_exports.string().uuid() }).strict()).min(1).max(WAYAI_HOST_TOKEN_MAX_TARGETS).optional()
15855
+ }).strict().superRefine((data, ctx) => {
15856
+ refineScopedTarget(data, ctx);
15857
+ if (!data.dry_run && !data.targets) {
15858
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "dry_run: false requires targets", path: ["targets"] });
15859
+ }
15860
+ });
15847
15861
  BRANCHING_ORPHAN_ENTITY_TYPES = [
15848
15862
  "agent",
15849
15863
  "agent_parameter",
@@ -16194,16 +16208,16 @@ var init_chunk_R6Y377AW = __esm({
16194
16208
  }
16195
16209
  });
16196
16210
 
16197
- // ../../packages/core/dist/chunk-ELBFOFQD.js
16211
+ // ../../packages/core/dist/chunk-FXIVKOSV.js
16198
16212
  var AUTOMATION_TRIGGER_TYPES, AUTOMATION_EVENT_TYPES, AUTOMATION_TARGET_TYPES, AUTOMATION_ACTION_TYPES, AUTOMATION_CHANNEL_TYPES, AUTOMATION_PURPOSES, AUTOMATION_NAME_MAX, AUTOMATION_DESCRIPTION_MAX, AUTOMATION_INSTRUCTIONS_MAX, AUTOMATION_TEXT_MAX, AUTOMATION_CRON_MAX, AUTOMATION_WEBHOOK_AUTHS, AUTOMATION_WEBHOOK_HEADERS, AUTOMATION_WEBHOOK_BODY_MAX_BYTES, AUTOMATION_WEBHOOK_HEADER_NAME_MAX, WEBHOOK_RESERVED_HEADERS, automationTriggerSchema, automationTargetSchema, automationActionSchema, automationGateSchema, automationName, automationDescription, automationIdParam, automationHubQuery, automationWebhookParams, AUTOMATION_RUNS_PAGE_MAX, listAutomationRunsQuery, createAutomationBody, updateAutomationBody, AUTOMATION_ALERT_CATEGORIES, AUTOMATION_BLOCKED_ALERT_CATEGORY, automationEventSubscriberParam;
16199
- var init_chunk_ELBFOFQD = __esm({
16200
- "../../packages/core/dist/chunk-ELBFOFQD.js"() {
16213
+ var init_chunk_FXIVKOSV = __esm({
16214
+ "../../packages/core/dist/chunk-FXIVKOSV.js"() {
16201
16215
  "use strict";
16202
16216
  init_chunk_R6Y377AW();
16203
16217
  init_chunk_UAOHHCW5();
16204
- init_chunk_FGNMHILL();
16218
+ init_chunk_L4YFOZGK();
16205
16219
  init_chunk_5FO3GNKP();
16206
- init_chunk_R3OKBQMZ();
16220
+ init_chunk_7IXDF53E();
16207
16221
  init_chunk_YROEDMVZ();
16208
16222
  init_zod();
16209
16223
  AUTOMATION_TRIGGER_TYPES = ["schedule", "event", "webhook"];
@@ -16445,15 +16459,15 @@ var init_contracts = __esm({
16445
16459
  init_chunk_MF2VVXBR();
16446
16460
  init_chunk_IPXBFWUU();
16447
16461
  init_chunk_P5GJNS5R();
16448
- init_chunk_HVYKBO5E();
16462
+ init_chunk_JW6QQD5K();
16449
16463
  init_chunk_ZC6YGHNX();
16450
16464
  init_chunk_5DGHIY7L();
16451
- init_chunk_UVGO72D6();
16465
+ init_chunk_5SG6USCJ();
16452
16466
  init_chunk_IPDOHAZ5();
16453
16467
  init_chunk_PFGVH2CX();
16454
16468
  init_chunk_GPM7PE44();
16455
- init_chunk_BXX2O5VY();
16456
- init_chunk_XIVMA3EN();
16469
+ init_chunk_TSIH4Y2H();
16470
+ init_chunk_U6S4MZGT();
16457
16471
  init_chunk_ZXK6N2HN();
16458
16472
  init_chunk_Y7CFCYX4();
16459
16473
  init_chunk_MGBAXT5Y();
@@ -16465,10 +16479,10 @@ var init_contracts = __esm({
16465
16479
  init_chunk_OPETF4GS();
16466
16480
  init_chunk_SY6PLCPK();
16467
16481
  init_chunk_KMAC3O3L();
16468
- init_chunk_DZ3J5TJT();
16482
+ init_chunk_65MH4JRN();
16469
16483
  init_chunk_KSTYTQ7I();
16470
16484
  init_chunk_LKBSHANA();
16471
- init_chunk_WEXNHMSJ();
16485
+ init_chunk_I2EVH3FR();
16472
16486
  init_chunk_C4HEZ7ZI();
16473
16487
  init_chunk_IR2NOSI3();
16474
16488
  init_chunk_UCYWGWQT();
@@ -16483,7 +16497,7 @@ var init_contracts = __esm({
16483
16497
  init_chunk_E4DIIOOE();
16484
16498
  init_chunk_7CYHPF35();
16485
16499
  init_chunk_NETRUHZF();
16486
- init_chunk_KXYJ46BM();
16500
+ init_chunk_KOLSAPLZ();
16487
16501
  init_chunk_YI3ORIXJ();
16488
16502
  init_chunk_T6D3YZ6B();
16489
16503
  init_chunk_66EZQ7Y7();
@@ -16493,7 +16507,7 @@ var init_contracts = __esm({
16493
16507
  init_chunk_4LXDRTO4();
16494
16508
  init_chunk_JDJ4EUOL();
16495
16509
  init_chunk_NVKU5PPQ();
16496
- init_chunk_I3PBCSF4();
16510
+ init_chunk_7SJEG3UO();
16497
16511
  init_chunk_FECLIZTY();
16498
16512
  init_chunk_BFG4ZWR4();
16499
16513
  init_chunk_2R5D4TEX();
@@ -16504,13 +16518,13 @@ var init_contracts = __esm({
16504
16518
  init_chunk_2PZIF56U();
16505
16519
  init_chunk_UEJOG2Q7();
16506
16520
  init_chunk_KEN2DASI();
16507
- init_chunk_ELBFOFQD();
16521
+ init_chunk_FXIVKOSV();
16508
16522
  init_chunk_R6Y377AW();
16509
16523
  init_chunk_UAOHHCW5();
16510
- init_chunk_FGNMHILL();
16524
+ init_chunk_L4YFOZGK();
16511
16525
  init_chunk_ULQGJUXZ();
16512
16526
  init_chunk_OMPT4ZHR();
16513
- init_chunk_DWJOFJEA();
16527
+ init_chunk_SMVVXYHP();
16514
16528
  init_chunk_SOJMWM63();
16515
16529
  init_chunk_WTOA3ANF();
16516
16530
  init_chunk_5FO3GNKP();
@@ -16530,10 +16544,10 @@ var init_contracts = __esm({
16530
16544
  init_chunk_WEXVYJ5H();
16531
16545
  init_chunk_6TSQ5HXC();
16532
16546
  init_chunk_HZ6CADSY();
16533
- init_chunk_R3OKBQMZ();
16534
- init_chunk_BFX5K5TT();
16547
+ init_chunk_7IXDF53E();
16548
+ init_chunk_55RZ7YIF();
16535
16549
  init_chunk_JHUTFQDO();
16536
- init_chunk_5SDIIQVO();
16550
+ init_chunk_7IKO675N();
16537
16551
  init_chunk_MIWZOSPI();
16538
16552
  init_chunk_YROEDMVZ();
16539
16553
  init_chunk_L5F7ZOUJ();
@@ -16674,7 +16688,7 @@ var UUID_RE2, WAYAI_WORKSPACE_LAYOUT;
16674
16688
  var init_dist = __esm({
16675
16689
  "../../packages/core/dist/index.js"() {
16676
16690
  "use strict";
16677
- init_chunk_DWJOFJEA();
16691
+ init_chunk_SMVVXYHP();
16678
16692
  init_chunk_SOJMWM63();
16679
16693
  init_chunk_WTOA3ANF();
16680
16694
  init_chunk_5FO3GNKP();
@@ -16693,10 +16707,10 @@ var init_dist = __esm({
16693
16707
  init_chunk_6TSQ5HXC();
16694
16708
  init_chunk_HZ6CADSY();
16695
16709
  init_chunk_FZ7BJJW7();
16696
- init_chunk_R3OKBQMZ();
16697
- init_chunk_BFX5K5TT();
16710
+ init_chunk_7IXDF53E();
16711
+ init_chunk_55RZ7YIF();
16698
16712
  init_chunk_JHUTFQDO();
16699
- init_chunk_5SDIIQVO();
16713
+ init_chunk_7IKO675N();
16700
16714
  init_chunk_MIWZOSPI();
16701
16715
  init_chunk_YROEDMVZ();
16702
16716
  init_chunk_L5F7ZOUJ();
@@ -17919,6 +17933,7 @@ var init_utils = __esm({
17919
17933
  ["admin hubs repair-branching-orphans", { positionals: 0, values: ["--org", "--hub", "--id"], dryRun: true }],
17920
17934
  ["admin hubs repair-credential-links", { positionals: 0, values: ["--org", "--hub"], dryRun: true }],
17921
17935
  ["admin hubs repair-knowledge-blobs", { positionals: 0, values: ["--org", "--hub"], dryRun: true }],
17936
+ ["admin hubs clear-wayai-host-tokens", { positionals: 0, values: ["--org", "--hub", "--id"], dryRun: true }],
17922
17937
  ["admin orgs repair-legacy-grants", { positionals: 0, values: ["--org"], dryRun: true }],
17923
17938
  ["admin vault import", { positionals: 0, values: ["--org", "--connector", "--max-puts", "--approved"] }],
17924
17939
  ["admin vault revert", { positionals: 0, values: ["--org", "--connector"] }],
@@ -18455,6 +18470,10 @@ var init_api_client = __esm({
18455
18470
  async adminRepairCredentialLinks(body) {
18456
18471
  return this.request("POST", "/api/admin/hubs/repair-credential-links", body);
18457
18472
  }
18473
+ // Used by `wayai admin hubs clear-wayai-host-tokens` (platform-admin gated, wayai#5644 steps 6-7).
18474
+ async adminClearWayaiHostTokens(body) {
18475
+ return this.request("POST", "/api/admin/hubs/clear-wayai-host-tokens", body);
18476
+ }
18458
18477
  // Report twin candidates, or delete named production rows no preview maps (#4577).
18459
18478
  // Used by `wayai admin hubs repair-branching-orphans` (platform-admin gated).
18460
18479
  async adminRepairBranchingOrphans(body) {
@@ -22927,7 +22946,7 @@ var init_hub_materializer = __esm({
22927
22946
  var init_ci = __esm({
22928
22947
  "../../packages/core/dist/contracts/ci.js"() {
22929
22948
  "use strict";
22930
- init_chunk_KXYJ46BM();
22949
+ init_chunk_KOLSAPLZ();
22931
22950
  init_chunk_YI3ORIXJ();
22932
22951
  init_chunk_T6D3YZ6B();
22933
22952
  init_chunk_66EZQ7Y7();
@@ -22939,7 +22958,7 @@ var init_ci = __esm({
22939
22958
  init_chunk_X5PZZVTS();
22940
22959
  init_chunk_D3EP4TDU();
22941
22960
  init_chunk_K5UAZWFF();
22942
- init_chunk_FGNMHILL();
22961
+ init_chunk_L4YFOZGK();
22943
22962
  init_chunk_WTOA3ANF();
22944
22963
  init_chunk_IBL7FANV();
22945
22964
  init_chunk_S4VDZ7PZ();
@@ -22951,10 +22970,10 @@ var init_ci = __esm({
22951
22970
  init_chunk_WEXVYJ5H();
22952
22971
  init_chunk_6TSQ5HXC();
22953
22972
  init_chunk_HZ6CADSY();
22954
- init_chunk_R3OKBQMZ();
22955
- init_chunk_BFX5K5TT();
22973
+ init_chunk_7IXDF53E();
22974
+ init_chunk_55RZ7YIF();
22956
22975
  init_chunk_JHUTFQDO();
22957
- init_chunk_5SDIIQVO();
22976
+ init_chunk_7IKO675N();
22958
22977
  init_chunk_MIWZOSPI();
22959
22978
  init_chunk_YROEDMVZ();
22960
22979
  init_chunk_L5F7ZOUJ();
@@ -38118,6 +38137,9 @@ async function adminCommand(args2) {
38118
38137
  case "repair-knowledge-blobs":
38119
38138
  await runRepairKnowledgeBlobs(flagArgs);
38120
38139
  return;
38140
+ case "clear-wayai-host-tokens":
38141
+ await runClearWayaiHostTokens(flagArgs);
38142
+ return;
38121
38143
  default:
38122
38144
  printHelp2();
38123
38145
  process.exit(1);
@@ -38798,6 +38820,90 @@ async function runRepairCredentialLinks(flagArgs) {
38798
38820
  console.log(` hub=${r.hub_id} connection=${r.connection_id} credential=${r.credential_id}: ${r.outcome}${reason}${stale}${written}`);
38799
38821
  }
38800
38822
  }
38823
+ async function runClearWayaiHostTokens(flagArgs) {
38824
+ const USAGE8 = "wayai admin hubs clear-wayai-host-tokens --all | --org <org_id> | --hub <hub_id> [--id <kind>:<id> ...] [--apply] [--yes] [--json]";
38825
+ const targets = [];
38826
+ const scopeArgs = [];
38827
+ for (let i = 0; i < flagArgs.length; i++) {
38828
+ if (flagArgs[i] !== "--id") {
38829
+ scopeArgs.push(flagArgs[i]);
38830
+ continue;
38831
+ }
38832
+ const raw = requireFlagValue(flagArgs, ++i, "--id");
38833
+ const sep9 = raw.indexOf(":");
38834
+ const kind = raw.slice(0, sep9);
38835
+ const id = raw.slice(sep9 + 1);
38836
+ if (sep9 < 1 || !uuidSchema.safeParse(id).success || !WAYAI_HOST_TOKEN_TARGET_KINDS.includes(kind)) {
38837
+ console.error(`--id takes <kind>:<id>, with kind one of: ${WAYAI_HOST_TOKEN_TARGET_KINDS.join(", ")}. Got: ${raw}`);
38838
+ process.exit(1);
38839
+ }
38840
+ targets.push({ kind, id });
38841
+ }
38842
+ const { body, targetLabel, apply, yes, jsonOutput } = parseApplyTargetFlags(scopeArgs, USAGE8);
38843
+ if (apply && targets.length === 0) {
38844
+ console.error("--apply acts only on the targets named with --id <kind>:<id>, as the dry run lists them.");
38845
+ console.error(USAGE8);
38846
+ process.exit(1);
38847
+ }
38848
+ if (apply && !yes && !jsonOutput) {
38849
+ console.log(`About to clear or DELETE ${targets.length} named target(s) in: ${targetLabel}:`);
38850
+ for (const t of targets) console.log(` ${t.kind}:${t.id}`);
38851
+ console.log("Each is judged again first, and skipped with its reason when it no longer qualifies.");
38852
+ console.log("Run without --apply first to see what each would do.");
38853
+ const ok = await confirm("Proceed?");
38854
+ if (!ok) {
38855
+ console.log("Aborted.");
38856
+ return;
38857
+ }
38858
+ }
38859
+ const { config, accessToken } = await requireAuth();
38860
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
38861
+ let response;
38862
+ try {
38863
+ response = await client.adminClearWayaiHostTokens({ ...body, dry_run: !apply, ...targets.length > 0 ? { targets } : {} });
38864
+ } catch (err) {
38865
+ exitOnApiError(err);
38866
+ throw err;
38867
+ }
38868
+ const data = response.data;
38869
+ if (jsonOutput) {
38870
+ console.log(JSON.stringify(data, null, 2));
38871
+ return;
38872
+ }
38873
+ const mode = data.dry_run ? "DRY RUN \u2014 nothing written" : "written";
38874
+ console.log(
38875
+ `clear-wayai-host-tokens (${data.scope}) \u2014 ${mode}: hubs_scanned=${data.hubs_scanned} candidates=${data.candidates.length} credentials=${data.credentials.length}`
38876
+ );
38877
+ if (data.hubs_errored > 0 || data.orgs_errored > 0) {
38878
+ console.log(
38879
+ `WARNING: ${data.orgs_errored} org(s) and ${data.hubs_errored} hub(s) errored and were SKIPPED \u2014 re-run to cover them.`
38880
+ );
38881
+ }
38882
+ for (const c of data.candidates) {
38883
+ const facts = [
38884
+ c.kind,
38885
+ c.hub_environment ?? "hub?",
38886
+ c.host ? `host=${c.host}` : null,
38887
+ c.stores_ciphertext ? "stores_token" : null,
38888
+ c.organization_credential_id ? `credential=${c.organization_credential_id}` : null,
38889
+ c.linked_credential_ids.length > 0 ? `links=${c.linked_credential_ids.join(",")}` : null,
38890
+ c.seed_base_id ? `bound_base=${c.seed_base_id}` : null,
38891
+ c.seeded_bases.length > 0 ? `seeds=${c.seeded_bases.join(",")}` : null,
38892
+ c.mapped_by.length > 0 ? `mapped_by=${c.mapped_by.join(",")}` : null,
38893
+ c.referenced_by.length > 0 ? `referenced_by=${c.referenced_by.join(",")}` : null
38894
+ ].filter(Boolean).join(" ");
38895
+ console.log(` ${c.target} org=${c.org_id} hub=${c.hub_id} ${facts} -> ${c.action ?? `none (${c.reason})`}`);
38896
+ }
38897
+ for (const c of data.credentials) {
38898
+ console.log(
38899
+ ` ${c.target} org=${c.org_id} named_by=${c.named_by.join(",") || "-"} linked_by=${c.linked_by.join(",") || "-"} base_links=${c.base_links} -> ${c.action ?? `none (${c.reason})`}`
38900
+ );
38901
+ }
38902
+ for (const r of data.results) {
38903
+ const why = r.reason ? ` (${r.reason}${r.detail ? `: ${r.detail}` : ""})` : "";
38904
+ console.log(` ${r.outcome.padEnd(12)} ${r.kind}:${r.id}${why}`);
38905
+ }
38906
+ }
38801
38907
  function printCustomerReport(customer, dryRun) {
38802
38908
  const c = customer.census;
38803
38909
  const auth = Object.entries(c.by_auth).map(([k, n]) => `${k}=${n}`).join(" ") || "-";
@@ -40294,6 +40400,9 @@ Usage:
40294
40400
  wayai admin hubs repair-knowledge-blobs --all | --org <org_id> | --hub <hub_id> [--apply] [--yes] [--json]
40295
40401
  Report, or with --apply delete, the R2 objects under each hub no file row holds (retired knowledge's, #5142), older than a day; never eval attachments or call openings. A dry run by default. Run it once the deploy that retired knowledge is fully live: a hub on older code stops on its first page, as errored
40296
40402
 
40403
+ wayai admin hubs clear-wayai-host-tokens --all | --org <org_id> | --hub <hub_id> [--id <kind>:<id> ...] [--apply] [--yes] [--json]
40404
+ List the WayAI tokens hub connections and org credentials still hold (#5644), each with what --id <kind>:<id> would do: clear a Base Toolset connection's stored token and org credential link (toolset), clear a bound eval seed connection's token (seed), delete another connection to WayAI's data service (connection), delete an org credential nothing links any more (credential). A dry run by default; --apply acts only on the --id targets, each judged again first
40405
+
40297
40406
  wayai admin orgs repair-legacy-grants --all | --org <org_id> [--dry-run] [--yes] [--json]
40298
40407
  Repair org-admin roster rows keyed by email with a NULL user_email (pre-#3922 platform-admin adds): grant the real access they never conferred, or drop the phantom seat. Idempotent \u2014 run --dry-run first
40299
40408
 
@@ -40404,6 +40513,11 @@ Sources:
40404
40513
  \`repair-knowledge-blobs\` sweeps the R2 objects retired hub knowledge left
40405
40514
  behind once its rows were deleted: keys no file row holds, older than a
40406
40515
  day. It reports by default and deletes only with --apply.
40516
+ \`clear-wayai-host-tokens\` clears the WayAI tokens hub connections still store
40517
+ (#5644): it lists every candidate and what it would do, and acts only on
40518
+ the targets --id names, with --apply. A seed's token goes only once it records
40519
+ its binding; a production row goes only once no preview maps it and nothing
40520
+ points at it.
40407
40521
  orgs Org roster repair. \`repair-legacy-grants\` fixes member_grant rows the
40408
40522
  platform-admin org-admin add wrote before #3922: the email landed in the
40409
40523
  user_id column with user_email NULL. Auth reads UserDO, never member_grant,
@@ -40477,6 +40591,8 @@ Examples:
40477
40591
  wayai admin hubs repair-branching-orphans --hub <prod-hub-id> --id connection:<id> --dry-run
40478
40592
  wayai admin hubs repair-knowledge-blobs --all
40479
40593
  wayai admin hubs repair-knowledge-blobs --hub <hub-id> --apply
40594
+ wayai admin hubs clear-wayai-host-tokens --all
40595
+ wayai admin hubs clear-wayai-host-tokens --org <org-id> --id toolset:<connection-id> --id credential:<credential-id> --apply
40480
40596
  wayai admin orgs repair-legacy-grants --all --dry-run
40481
40597
  wayai admin orgs repair-legacy-grants --org <org-id> --yes
40482
40598
  wayai admin harness disable
@@ -42012,7 +42128,7 @@ MCP URL: ${toolsetMcpUrl(slug)}`);
42012
42128
  }
42013
42129
  });
42014
42130
  tokens2.command("prune").description(
42015
- "Revoke stale tokens, selected by staleness only (expired, or unused past --unused-since) \u2014 never by name. Previews by default; revoking requires --yes or an interactive confirmation."
42131
+ "Revoke stale tokens, selected by staleness only (expired, revoked, or unused past --unused-since) \u2014 never by name. Previews by default; revoking requires --yes or an interactive confirmation."
42016
42132
  ).option(
42017
42133
  "--unused-since <duration>",
42018
42134
  "Also prune tokens with no activity for this long (e.g. 30d). Skips toolset-bound and legacy usage-untracked tokens."
@@ -42029,6 +42145,10 @@ MCP URL: ${toolsetMcpUrl(slug)}`);
42029
42145
  targets.push(pruneRow(t, "expired"));
42030
42146
  continue;
42031
42147
  }
42148
+ if (t.status === "revoked") {
42149
+ targets.push(pruneRow(t, "revoked: minted before only the owner could mint a token that writes bases"));
42150
+ continue;
42151
+ }
42032
42152
  if (staleMs === void 0) continue;
42033
42153
  const lastActivity = Date.parse(t.last_used_at ?? t.created_at);
42034
42154
  if (!(now - lastActivity > staleMs)) continue;