@wayai/cli 0.3.310 → 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-HBWJDXLP.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_HBWJDXLP = __esm({
6102
- "../../packages/core/dist/chunk-HBWJDXLP.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();
@@ -6389,12 +6389,12 @@ var init_chunk_HBWJDXLP = __esm({
6389
6389
  }
6390
6390
  });
6391
6391
 
6392
- // ../../packages/core/dist/chunk-CLYMQMQH.js
6392
+ // ../../packages/core/dist/chunk-JW6QQD5K.js
6393
6393
  var TOOLSET_ANSWER_PERSON_PARTIES, toolsetAnswerPersonSchema, toolsetAnswerPersonsSchema;
6394
- var init_chunk_CLYMQMQH = __esm({
6395
- "../../packages/core/dist/chunk-CLYMQMQH.js"() {
6394
+ var init_chunk_JW6QQD5K = __esm({
6395
+ "../../packages/core/dist/chunk-JW6QQD5K.js"() {
6396
6396
  "use strict";
6397
- init_chunk_HBWJDXLP();
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-CHXSDXBE.js
7755
+ // ../../packages/core/dist/chunk-TSIH4Y2H.js
7753
7756
  var hubPageWatchParam, pageWatchedBaseSchema, hubPageWatchResponseSchema;
7754
- var init_chunk_CHXSDXBE = __esm({
7755
- "../../packages/core/dist/chunk-CHXSDXBE.js"() {
7757
+ var init_chunk_TSIH4Y2H = __esm({
7758
+ "../../packages/core/dist/chunk-TSIH4Y2H.js"() {
7756
7759
  "use strict";
7757
- init_chunk_HBWJDXLP();
7760
+ init_chunk_U6S4MZGT();
7758
7761
  init_chunk_FBV7NLKO();
7759
7762
  init_chunk_HZ6CADSY();
7760
7763
  init_zod();
@@ -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",
@@ -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_CLYMQMQH();
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_CHXSDXBE();
16456
- init_chunk_HBWJDXLP();
16469
+ init_chunk_TSIH4Y2H();
16470
+ init_chunk_U6S4MZGT();
16457
16471
  init_chunk_ZXK6N2HN();
16458
16472
  init_chunk_Y7CFCYX4();
16459
16473
  init_chunk_MGBAXT5Y();
@@ -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();
@@ -16510,7 +16524,7 @@ var init_contracts = __esm({
16510
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();
@@ -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();
@@ -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) {
@@ -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