@wayai/cli 0.3.287 → 0.3.289

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
@@ -6273,7 +6273,7 @@ var init_chunk_5FO3GNKP = __esm({
6273
6273
  }
6274
6274
  });
6275
6275
 
6276
- // ../../packages/core/dist/chunk-JSLX2PRT.js
6276
+ // ../../packages/core/dist/chunk-WWLNKL2W.js
6277
6277
  function matchPath(pattern, path45) {
6278
6278
  const pathSegments2 = path45.replace(/\/$/, "").split("/");
6279
6279
  const isPrefix = pattern.endsWith("/*");
@@ -6302,8 +6302,8 @@ function getEndpointConfig(path45) {
6302
6302
  return { tier: "STANDARD" };
6303
6303
  }
6304
6304
  var ENDPOINT_CONFIGS, EXCLUDED_PATHS;
6305
- var init_chunk_JSLX2PRT = __esm({
6306
- "../../packages/core/dist/chunk-JSLX2PRT.js"() {
6305
+ var init_chunk_WWLNKL2W = __esm({
6306
+ "../../packages/core/dist/chunk-WWLNKL2W.js"() {
6307
6307
  "use strict";
6308
6308
  init_chunk_5FO3GNKP();
6309
6309
  ENDPOINT_CONFIGS = {
@@ -6629,6 +6629,9 @@ var init_chunk_JSLX2PRT = __esm({
6629
6629
  // takes the same strict, fail-closed budget as the other hub repairs. Exact path, for the same reason.
6630
6630
  "/api/admin/hubs/repair-knowledge-blobs": { tier: "STRICT", userLimit: 10, userWindow: 3600, failClosed: true },
6631
6631
  "/api/admin/hubs/repair-credential-links": { tier: "STRICT", userLimit: 10, userWindow: 3600, failClosed: true },
6632
+ // The credentials-vault importer (wayai#5644 D2-M6) decrypts and moves an org's credentials, or puts them back:
6633
+ // strict and fail-closed like the hub repairs, with room for the re-runs a bounded run takes (`max_puts`).
6634
+ "/api/admin/vault-import/*": { tier: "STRICT", userLimit: 60, userWindow: 3600, failClosed: true, userLimitKey: "/api/admin/vault-import/*" },
6632
6635
  // CI/GitOps endpoints - standard with user limits. 500 because `wayai push` makes four requests
6633
6636
  // (pull, diff, push, pull) and a GitOps job may push every hub at once with one token; when
6634
6637
  // each path held its own 100, that ran to 100 hubs a minute.
@@ -6785,7 +6788,7 @@ var init_chunk_JSLX2PRT = __esm({
6785
6788
  }
6786
6789
  });
6787
6790
 
6788
- // ../../packages/core/dist/chunk-YFHL2BKN.js
6791
+ // ../../packages/core/dist/chunk-LQ37IULI.js
6789
6792
  function fileSnapshotChanged(run) {
6790
6793
  return run.written + run.removed > 0;
6791
6794
  }
@@ -6826,10 +6829,10 @@ async function sendWithRetry(opts, cursor) {
6826
6829
  }
6827
6830
  }
6828
6831
  var rekorFileSnapshotAnswerSchema, FILE_SNAPSHOT_MAX_PAGES, FILE_SNAPSHOT_CONFLICT_ATTEMPTS, FILE_SNAPSHOT_PAGE_SPACING_MS, FILE_SNAPSHOT_CONFLICT_STATUS;
6829
- var init_chunk_YFHL2BKN = __esm({
6830
- "../../packages/core/dist/chunk-YFHL2BKN.js"() {
6832
+ var init_chunk_LQ37IULI = __esm({
6833
+ "../../packages/core/dist/chunk-LQ37IULI.js"() {
6831
6834
  "use strict";
6832
- init_chunk_JSLX2PRT();
6835
+ init_chunk_WWLNKL2W();
6833
6836
  init_chunk_5FO3GNKP();
6834
6837
  init_zod();
6835
6838
  rekorFileSnapshotAnswerSchema = external_exports.object({
@@ -12550,10 +12553,10 @@ var init_chunk_7CYHPF35 = __esm({
12550
12553
  }
12551
12554
  });
12552
12555
 
12553
- // ../../packages/core/dist/chunk-BPCNB5RT.js
12556
+ // ../../packages/core/dist/chunk-NETRUHZF.js
12554
12557
  var getConversationsQuery, getMessagesQuery;
12555
- var init_chunk_BPCNB5RT = __esm({
12556
- "../../packages/core/dist/chunk-BPCNB5RT.js"() {
12558
+ var init_chunk_NETRUHZF = __esm({
12559
+ "../../packages/core/dist/chunk-NETRUHZF.js"() {
12557
12560
  "use strict";
12558
12561
  init_zod();
12559
12562
  getConversationsQuery = external_exports.object({
@@ -12614,7 +12617,7 @@ var init_chunk_BPCNB5RT = __esm({
12614
12617
  }
12615
12618
  });
12616
12619
 
12617
- // ../../packages/core/dist/chunk-KVOFZ5RY.js
12620
+ // ../../packages/core/dist/chunk-YI3ORIXJ.js
12618
12621
  function toolParametersViolations(params) {
12619
12622
  try {
12620
12623
  if (containsKanbanPlaceholders(params)) return [];
@@ -12671,8 +12674,8 @@ function refineToolConfig(value, ctx) {
12671
12674
  }
12672
12675
  }
12673
12676
  var nonBlank, DEFAULT_TOOL_CONFIG_DESCRIPTION, MAX_CUSTOM_TOOL_CONFIG_TEXT_LAYERS, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, toolReplaySettingsFields, toolReplaySettingsSchema, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody;
12674
- var init_chunk_KVOFZ5RY = __esm({
12675
- "../../packages/core/dist/chunk-KVOFZ5RY.js"() {
12677
+ var init_chunk_YI3ORIXJ = __esm({
12678
+ "../../packages/core/dist/chunk-YI3ORIXJ.js"() {
12676
12679
  "use strict";
12677
12680
  init_chunk_WEXVYJ5H();
12678
12681
  init_chunk_HZ6CADSY();
@@ -13332,57 +13335,6 @@ var init_chunk_LBDH7LCG = __esm({
13332
13335
  }
13333
13336
  });
13334
13337
 
13335
- // ../../packages/core/dist/chunk-D3EP4TDU.js
13336
- var primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody;
13337
- var init_chunk_D3EP4TDU = __esm({
13338
- "../../packages/core/dist/chunk-D3EP4TDU.js"() {
13339
- "use strict";
13340
- init_chunk_HZ6CADSY();
13341
- init_zod();
13342
- primaryRegionSchema = external_exports.enum([
13343
- "wnam",
13344
- "enam",
13345
- "sam",
13346
- "weur",
13347
- "eeur",
13348
- "apac",
13349
- "oc",
13350
- "afr",
13351
- "me"
13352
- ]);
13353
- placementSourceSchema = external_exports.enum([
13354
- "hub_config",
13355
- "org_config",
13356
- "parent_cascade",
13357
- "cf_colo",
13358
- "country",
13359
- "fallback",
13360
- "unpinned"
13361
- ]);
13362
- orgIdParam = external_exports.object({
13363
- id: uuidSchema
13364
- });
13365
- orgAdminIdParam = external_exports.object({
13366
- id: uuidSchema,
13367
- adminId: external_exports.string().min(1)
13368
- });
13369
- createOrganizationBody = external_exports.object({
13370
- organization_name: external_exports.string().min(1, "organization_name is required"),
13371
- // Write-once at creation; updateOrganizationBody does not accept this.
13372
- primary_region: primaryRegionSchema.optional()
13373
- });
13374
- updateOrganizationBody = external_exports.object({
13375
- organization_name: external_exports.string().min(1).optional(),
13376
- organization_avatar_url: external_exports.string().url().nullable().optional(),
13377
- timezone: external_exports.string().optional(),
13378
- business_hours: external_exports.unknown().optional()
13379
- }).passthrough();
13380
- addOrgAdminBody = external_exports.object({
13381
- user_email: external_exports.string().email("valid email is required")
13382
- });
13383
- }
13384
- });
13385
-
13386
13338
  // ../../packages/core/dist/chunk-X5PZZVTS.js
13387
13339
  function isEventRelativeFollowupType(type) {
13388
13340
  return typeof type === "string" && EVENT_RELATIVE_FOLLOWUP_TYPES.includes(type);
@@ -13781,6 +13733,57 @@ var init_chunk_X5PZZVTS = __esm({
13781
13733
  }
13782
13734
  });
13783
13735
 
13736
+ // ../../packages/core/dist/chunk-D3EP4TDU.js
13737
+ var primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody;
13738
+ var init_chunk_D3EP4TDU = __esm({
13739
+ "../../packages/core/dist/chunk-D3EP4TDU.js"() {
13740
+ "use strict";
13741
+ init_chunk_HZ6CADSY();
13742
+ init_zod();
13743
+ primaryRegionSchema = external_exports.enum([
13744
+ "wnam",
13745
+ "enam",
13746
+ "sam",
13747
+ "weur",
13748
+ "eeur",
13749
+ "apac",
13750
+ "oc",
13751
+ "afr",
13752
+ "me"
13753
+ ]);
13754
+ placementSourceSchema = external_exports.enum([
13755
+ "hub_config",
13756
+ "org_config",
13757
+ "parent_cascade",
13758
+ "cf_colo",
13759
+ "country",
13760
+ "fallback",
13761
+ "unpinned"
13762
+ ]);
13763
+ orgIdParam = external_exports.object({
13764
+ id: uuidSchema
13765
+ });
13766
+ orgAdminIdParam = external_exports.object({
13767
+ id: uuidSchema,
13768
+ adminId: external_exports.string().min(1)
13769
+ });
13770
+ createOrganizationBody = external_exports.object({
13771
+ organization_name: external_exports.string().min(1, "organization_name is required"),
13772
+ // Write-once at creation; updateOrganizationBody does not accept this.
13773
+ primary_region: primaryRegionSchema.optional()
13774
+ });
13775
+ updateOrganizationBody = external_exports.object({
13776
+ organization_name: external_exports.string().min(1).optional(),
13777
+ organization_avatar_url: external_exports.string().url().nullable().optional(),
13778
+ timezone: external_exports.string().optional(),
13779
+ business_hours: external_exports.unknown().optional()
13780
+ }).passthrough();
13781
+ addOrgAdminBody = external_exports.object({
13782
+ user_email: external_exports.string().email("valid email is required")
13783
+ });
13784
+ }
13785
+ });
13786
+
13784
13787
  // ../../packages/core/dist/chunk-K5UAZWFF.js
13785
13788
  function byLocale(entry) {
13786
13789
  const shape = Object.fromEntries(SUPPORTED_LOCALES.map((locale) => [locale, entry.optional()]));
@@ -13819,7 +13822,7 @@ var init_chunk_K5UAZWFF = __esm({
13819
13822
  }
13820
13823
  });
13821
13824
 
13822
- // ../../packages/core/dist/chunk-7NQZRSSJ.js
13825
+ // ../../packages/core/dist/chunk-MO23HUAX.js
13823
13826
  function refineLaneReferences(val, ctx) {
13824
13827
  const lanes = val.lanes;
13825
13828
  const statuses = val.kanban_statuses;
@@ -13843,11 +13846,11 @@ function describeSyncWarning(warning) {
13843
13846
  return `${label2}: ${parts.join("; ")}. Promote the base so production's tools match the preview's.`;
13844
13847
  }
13845
13848
  var hubIdParam, hubAdminIdParam, hubUserIdParam, hubAgentIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, HUB_USERS_PAGE_SIZE_MAX, HUB_USERS_SEARCH_MAX, HUB_USERS_CHANNEL_TYPES, getHubUsersQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, MAX_EVAL_RETENTION_DAYS, MAX_END_USER_DAILY_MESSAGE_LIMIT, endUserDailyMessageLimitField, previewLabelField, hubTagsField, createHubBody, updateHubBody, HUB_TAG_CHANGE_REFUSED, hubTagChangeRefusalSchema, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, CONTACT_ACCESS_PAGE_SIZE_MAX, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, HUB_DIFF_SECTION_SET, HUB_DIFF_SECTIONS, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam;
13846
- var init_chunk_7NQZRSSJ = __esm({
13847
- "../../packages/core/dist/chunk-7NQZRSSJ.js"() {
13849
+ var init_chunk_MO23HUAX = __esm({
13850
+ "../../packages/core/dist/chunk-MO23HUAX.js"() {
13848
13851
  "use strict";
13849
- init_chunk_D3EP4TDU();
13850
13852
  init_chunk_X5PZZVTS();
13853
+ init_chunk_D3EP4TDU();
13851
13854
  init_chunk_K5UAZWFF();
13852
13855
  init_chunk_HZ6CADSY();
13853
13856
  init_zod();
@@ -14043,7 +14046,7 @@ var init_chunk_7NQZRSSJ = __esm({
14043
14046
  }
14044
14047
  });
14045
14048
 
14046
- // ../../packages/core/dist/chunk-UCPEWP5G.js
14049
+ // ../../packages/core/dist/chunk-YN7UXGAP.js
14047
14050
  function declaresNoConnection(agent) {
14048
14051
  return agent.connection === null && !agent.connection_id;
14049
14052
  }
@@ -14775,15 +14778,15 @@ function skillSectionsAsResources(scope) {
14775
14778
  };
14776
14779
  }
14777
14780
  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;
14778
- var init_chunk_UCPEWP5G = __esm({
14779
- "../../packages/core/dist/chunk-UCPEWP5G.js"() {
14781
+ var init_chunk_YN7UXGAP = __esm({
14782
+ "../../packages/core/dist/chunk-YN7UXGAP.js"() {
14780
14783
  "use strict";
14781
- init_chunk_KVOFZ5RY();
14784
+ init_chunk_YI3ORIXJ();
14782
14785
  init_chunk_HRKVCI5A();
14783
14786
  init_chunk_CZEJR5UE();
14784
14787
  init_chunk_LBDH7LCG();
14785
14788
  init_chunk_4LXDRTO4();
14786
- init_chunk_7NQZRSSJ();
14789
+ init_chunk_MO23HUAX();
14787
14790
  init_chunk_X5PZZVTS();
14788
14791
  init_chunk_K5UAZWFF();
14789
14792
  init_chunk_OAWG66J3();
@@ -15159,10 +15162,10 @@ var init_chunk_BFG4ZWR4 = __esm({
15159
15162
  }
15160
15163
  });
15161
15164
 
15162
- // ../../packages/core/dist/chunk-4J5DPB3X.js
15165
+ // ../../packages/core/dist/chunk-HNVURBF4.js
15163
15166
  var dataExplorerDebugDoType, DEBUG_READ_MAX_LIMIT, DEBUG_READ_DEFAULT_LIMIT;
15164
- var init_chunk_4J5DPB3X = __esm({
15165
- "../../packages/core/dist/chunk-4J5DPB3X.js"() {
15167
+ var init_chunk_HNVURBF4 = __esm({
15168
+ "../../packages/core/dist/chunk-HNVURBF4.js"() {
15166
15169
  "use strict";
15167
15170
  init_zod();
15168
15171
  dataExplorerDebugDoType = external_exports.enum(["hub", "org", "conversation", "user", "platform", "thread", "community", "contact_book", "batch"]);
@@ -15273,7 +15276,7 @@ var init_chunk_OMPT4ZHR = __esm({
15273
15276
  }
15274
15277
  });
15275
15278
 
15276
- // ../../packages/core/dist/chunk-2IAHI2UA.js
15279
+ // ../../packages/core/dist/chunk-GMCS4EDW.js
15277
15280
  function refineScopedTarget(data, ctx) {
15278
15281
  if (data.scope === "org") {
15279
15282
  if (!data.org_id) {
@@ -15299,13 +15302,13 @@ function refineScopedTarget(data, ctx) {
15299
15302
  }
15300
15303
  }
15301
15304
  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, 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;
15302
- var init_chunk_2IAHI2UA = __esm({
15303
- "../../packages/core/dist/chunk-2IAHI2UA.js"() {
15305
+ var init_chunk_GMCS4EDW = __esm({
15306
+ "../../packages/core/dist/chunk-GMCS4EDW.js"() {
15304
15307
  "use strict";
15305
15308
  init_chunk_FECLIZTY();
15306
15309
  init_chunk_BFG4ZWR4();
15307
- init_chunk_4J5DPB3X();
15308
- init_chunk_7NQZRSSJ();
15310
+ init_chunk_HNVURBF4();
15311
+ init_chunk_MO23HUAX();
15309
15312
  init_chunk_OMPT4ZHR();
15310
15313
  init_chunk_HZ6CADSY();
15311
15314
  init_chunk_MIWZOSPI();
@@ -16358,7 +16361,7 @@ var init_contracts = __esm({
16358
16361
  init_chunk_5YNUTCJ2();
16359
16362
  init_chunk_ZC6YGHNX();
16360
16363
  init_chunk_5DGHIY7L();
16361
- init_chunk_YFHL2BKN();
16364
+ init_chunk_LQ37IULI();
16362
16365
  init_chunk_IPDOHAZ5();
16363
16366
  init_chunk_GPM7PE44();
16364
16367
  init_chunk_NZ6RQW6R();
@@ -16391,9 +16394,9 @@ var init_contracts = __esm({
16391
16394
  init_chunk_PZPOUXJR();
16392
16395
  init_chunk_E4DIIOOE();
16393
16396
  init_chunk_7CYHPF35();
16394
- init_chunk_BPCNB5RT();
16395
- init_chunk_UCPEWP5G();
16396
- init_chunk_KVOFZ5RY();
16397
+ init_chunk_NETRUHZF();
16398
+ init_chunk_YN7UXGAP();
16399
+ init_chunk_YI3ORIXJ();
16397
16400
  init_chunk_HRKVCI5A();
16398
16401
  init_chunk_CZEJR5UE();
16399
16402
  init_chunk_4D6K4P4K();
@@ -16402,13 +16405,13 @@ var init_contracts = __esm({
16402
16405
  init_chunk_4LXDRTO4();
16403
16406
  init_chunk_JDJ4EUOL();
16404
16407
  init_chunk_NVKU5PPQ();
16405
- init_chunk_2IAHI2UA();
16408
+ init_chunk_GMCS4EDW();
16406
16409
  init_chunk_FECLIZTY();
16407
16410
  init_chunk_BFG4ZWR4();
16408
- init_chunk_4J5DPB3X();
16409
- init_chunk_7NQZRSSJ();
16410
- init_chunk_D3EP4TDU();
16411
+ init_chunk_HNVURBF4();
16412
+ init_chunk_MO23HUAX();
16411
16413
  init_chunk_X5PZZVTS();
16414
+ init_chunk_D3EP4TDU();
16412
16415
  init_chunk_K5UAZWFF();
16413
16416
  init_chunk_2PZIF56U();
16414
16417
  init_chunk_UEJOG2Q7();
@@ -16419,7 +16422,7 @@ var init_contracts = __esm({
16419
16422
  init_chunk_OAWG66J3();
16420
16423
  init_chunk_IG6QBZMA();
16421
16424
  init_chunk_OMPT4ZHR();
16422
- init_chunk_JSLX2PRT();
16425
+ init_chunk_WWLNKL2W();
16423
16426
  init_chunk_SOJMWM63();
16424
16427
  init_chunk_WTOA3ANF();
16425
16428
  init_chunk_5FO3GNKP();
@@ -16583,7 +16586,7 @@ var UUID_RE2, WAYAI_WORKSPACE_LAYOUT;
16583
16586
  var init_dist = __esm({
16584
16587
  "../../packages/core/dist/index.js"() {
16585
16588
  "use strict";
16586
- init_chunk_JSLX2PRT();
16589
+ init_chunk_WWLNKL2W();
16587
16590
  init_chunk_SOJMWM63();
16588
16591
  init_chunk_WTOA3ANF();
16589
16592
  init_chunk_5FO3GNKP();
@@ -17827,6 +17830,8 @@ var init_utils = __esm({
17827
17830
  ["admin hubs repair-credential-links", { positionals: 0, values: ["--org", "--hub"], dryRun: true }],
17828
17831
  ["admin hubs repair-knowledge-blobs", { positionals: 0, values: ["--org", "--hub"], dryRun: true }],
17829
17832
  ["admin orgs repair-legacy-grants", { positionals: 0, values: ["--org"], dryRun: true }],
17833
+ ["admin vault import", { positionals: 0, values: ["--org", "--connector", "--max-puts"] }],
17834
+ ["admin vault revert", { positionals: 0, values: ["--org", "--connector"] }],
17830
17835
  ["admin harness mass-destroy", { positionals: 0, values: ["--org", "--hub"], dryRun: true }],
17831
17836
  ["admin harness disable", { positionals: 0 }],
17832
17837
  ["admin harness enable", { positionals: 0 }],
@@ -18344,6 +18349,14 @@ var init_api_client = __esm({
18344
18349
  async adminRepairKnowledgeBlobs(body) {
18345
18350
  return this.request("POST", "/api/admin/hubs/repair-knowledge-blobs", body);
18346
18351
  }
18352
+ // Used by `wayai admin vault import` (platform-admin gated, wayai#5644).
18353
+ async adminVaultImportRun(body) {
18354
+ return this.request("POST", "/api/admin/vault-import/run", body);
18355
+ }
18356
+ // Used by `wayai admin vault revert` (platform-admin gated, wayai#5644).
18357
+ async adminVaultImportRevert(body) {
18358
+ return this.request("POST", "/api/admin/vault-import/revert", body);
18359
+ }
18347
18360
  // Used by `wayai admin hubs repair-credential-links` (platform-admin gated).
18348
18361
  async adminRepairCredentialLinks(body) {
18349
18362
  return this.request("POST", "/api/admin/hubs/repair-credential-links", body);
@@ -22759,17 +22772,17 @@ var init_hub_materializer = __esm({
22759
22772
  var init_ci = __esm({
22760
22773
  "../../packages/core/dist/contracts/ci.js"() {
22761
22774
  "use strict";
22762
- init_chunk_UCPEWP5G();
22763
- init_chunk_KVOFZ5RY();
22775
+ init_chunk_YN7UXGAP();
22776
+ init_chunk_YI3ORIXJ();
22764
22777
  init_chunk_HRKVCI5A();
22765
22778
  init_chunk_CZEJR5UE();
22766
22779
  init_chunk_4D6K4P4K();
22767
22780
  init_chunk_2YEGUQR7();
22768
22781
  init_chunk_LBDH7LCG();
22769
22782
  init_chunk_4LXDRTO4();
22770
- init_chunk_7NQZRSSJ();
22771
- init_chunk_D3EP4TDU();
22783
+ init_chunk_MO23HUAX();
22772
22784
  init_chunk_X5PZZVTS();
22785
+ init_chunk_D3EP4TDU();
22773
22786
  init_chunk_K5UAZWFF();
22774
22787
  init_chunk_OAWG66J3();
22775
22788
  init_chunk_WTOA3ANF();
@@ -37795,6 +37808,23 @@ async function adminCommand(args2) {
37795
37808
  process.exit(1);
37796
37809
  }
37797
37810
  }
37811
+ if (group === "vault") {
37812
+ if (!sub) {
37813
+ printHelp2();
37814
+ process.exit(1);
37815
+ }
37816
+ switch (sub) {
37817
+ case "import":
37818
+ await runVaultImport(flagArgs);
37819
+ return;
37820
+ case "revert":
37821
+ await runVaultRevert(flagArgs);
37822
+ return;
37823
+ default:
37824
+ printHelp2();
37825
+ process.exit(1);
37826
+ }
37827
+ }
37798
37828
  if (group === "harness") {
37799
37829
  if (!sub) {
37800
37830
  printHelp2();
@@ -38406,6 +38436,110 @@ async function runRepairCredentialLinks(flagArgs) {
38406
38436
  console.log(` hub=${r.hub_id} connection=${r.connection_id} credential=${r.credential_id}: ${r.outcome}${reason}${stale}${written}`);
38407
38437
  }
38408
38438
  }
38439
+ function printVaultReport(data) {
38440
+ if (data.hubs_errored.length > 0) console.log(`WARNING: ${data.hubs_errored.length} hub(s) could not be read and were SKIPPED \u2014 re-run to cover them: ${data.hubs_errored.join(", ")}`);
38441
+ if (data.reenable.length === 0) return;
38442
+ console.log(`${data.dry_run ? "Would need" : "Need"} their channel enabled again, on the preview hub (${data.reenable.length}):`);
38443
+ for (const r of data.reenable) console.log(` hub=${r.hub_id}${r.preview ? " (preview)" : ""} connection=${r.connection_id} bot=${r.bot_username ?? "-"}${r.enabled ? "" : " (disabled)"}`);
38444
+ }
38445
+ function parseVaultFlags(flagArgs, usage3, allowMaxPuts) {
38446
+ let orgId;
38447
+ let connectorId;
38448
+ let maxPuts;
38449
+ let apply = false;
38450
+ let yes = false;
38451
+ let jsonOutput = false;
38452
+ for (let i = 0; i < flagArgs.length; i++) {
38453
+ const flag = flagArgs[i];
38454
+ if (flag === "--org") {
38455
+ orgId = requireFlagValue(flagArgs, ++i, "--org");
38456
+ } else if (flag === "--connector") {
38457
+ connectorId = requireFlagValue(flagArgs, ++i, "--connector");
38458
+ } else if (flag === "--max-puts" && allowMaxPuts) {
38459
+ maxPuts = parsePositiveIntFlag("--max-puts", flagArgs[++i]);
38460
+ } else if (flag === "--apply") {
38461
+ apply = true;
38462
+ } else if (flag === "--yes" || flag === "-y") {
38463
+ yes = true;
38464
+ } else if (flag === "--json") {
38465
+ jsonOutput = true;
38466
+ } else {
38467
+ console.error(`Unknown flag: ${flag}`);
38468
+ console.error(usage3);
38469
+ process.exit(1);
38470
+ }
38471
+ }
38472
+ if (!orgId || !connectorId) {
38473
+ console.error("--org and --connector are required.");
38474
+ console.error(usage3);
38475
+ process.exit(1);
38476
+ }
38477
+ return { orgId, connectorId, maxPuts, apply, yes, jsonOutput };
38478
+ }
38479
+ async function runVaultImport(flagArgs) {
38480
+ const USAGE8 = "wayai admin vault import --org <org_id> --connector <connector_id> [--max-puts <n>] [--apply] [--yes] [--json]";
38481
+ const { orgId, connectorId, maxPuts, apply, yes, jsonOutput } = parseVaultFlags(flagArgs, USAGE8, true);
38482
+ if (apply && !yes && !jsonOutput) {
38483
+ console.log(`About to MOVE organization ${orgId}'s credentials of connector ${connectorId} into the credentials vault.`);
38484
+ console.log("Run without --apply first to see what would move.");
38485
+ if (!await confirm("Proceed?")) {
38486
+ console.log("Aborted.");
38487
+ return;
38488
+ }
38489
+ }
38490
+ const { config, accessToken } = await requireAuth();
38491
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
38492
+ let data;
38493
+ try {
38494
+ data = (await client.adminVaultImportRun({ org_id: orgId, connector_id: connectorId, dry_run: !apply, ...maxPuts ? { max_puts: maxPuts } : {} })).data;
38495
+ } catch (err) {
38496
+ exitOnApiError(err);
38497
+ throw err;
38498
+ }
38499
+ if (jsonOutput) {
38500
+ console.log(JSON.stringify(data, null, 2));
38501
+ return;
38502
+ }
38503
+ console.log(`vault import (${data.connector}) \u2014 ${data.dry_run ? "DRY RUN \u2014 nothing written" : "written"}: gate=${data.gate_open ? "open" : "CLOSED"} hubs_scanned=${data.hubs_scanned} values_remaining=${data.values_remaining}`);
38504
+ if (data.rate_limited) console.log("The vault's per-org rate limit stopped the run \u2014 re-run in a minute.");
38505
+ for (const c of data.counts) console.log(` ${c.field} ${c.link} ${c.stored}: rows=${c.rows} values=${c.values}`);
38506
+ for (const v of data.values) {
38507
+ console.log(` value ${v.field} \u2192 ${v.secret_id ?? "-"}: ${v.outcome}${v.code ? ` (${v.code})` : ""}`);
38508
+ for (const r of v.rows) console.log(` hub=${r.hub_id} connection=${r.connection_id}: ${r.outcome}`);
38509
+ }
38510
+ printVaultReport(data);
38511
+ }
38512
+ async function runVaultRevert(flagArgs) {
38513
+ const USAGE8 = "wayai admin vault revert --org <org_id> --connector <connector_id> [--apply] [--yes] [--json]";
38514
+ const { orgId, connectorId, apply, yes, jsonOutput } = parseVaultFlags(flagArgs, USAGE8, false);
38515
+ if (apply && !yes && !jsonOutput) {
38516
+ console.log(`About to PUT BACK organization ${orgId}'s moved credentials of connector ${connectorId}, and erase their vault entries.`);
38517
+ console.log("Run without --apply first to see what would go back.");
38518
+ if (!await confirm("Proceed?")) {
38519
+ console.log("Aborted.");
38520
+ return;
38521
+ }
38522
+ }
38523
+ const { config, accessToken } = await requireAuth();
38524
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
38525
+ let data;
38526
+ try {
38527
+ data = (await client.adminVaultImportRevert({ org_id: orgId, connector_id: connectorId, dry_run: !apply })).data;
38528
+ } catch (err) {
38529
+ exitOnApiError(err);
38530
+ throw err;
38531
+ }
38532
+ if (jsonOutput) {
38533
+ console.log(JSON.stringify(data, null, 2));
38534
+ return;
38535
+ }
38536
+ console.log(`vault revert (${data.connector}) \u2014 ${data.dry_run ? "DRY RUN \u2014 nothing written" : "written"}: hubs_scanned=${data.hubs_scanned} undo_rows=${data.undo_rows}`);
38537
+ for (const v of data.values) {
38538
+ console.log(` value ${v.field} \u2190 ${v.secret_id}${v.code ? `: ${v.code}` : ""}`);
38539
+ for (const r of v.rows) console.log(` hub=${r.hub_id} connection=${r.connection_id}: ${r.outcome}`);
38540
+ }
38541
+ printVaultReport(data);
38542
+ }
38409
38543
  async function runRepairBranchingOrphans(flagArgs) {
38410
38544
  const USAGE8 = "wayai admin hubs repair-branching-orphans --all | --org <org_id> | --hub <hub_id> [--id <type>:<id> ...] [--dry-run] [--yes] [--json]";
38411
38545
  const targets = [];
@@ -38930,7 +39064,7 @@ async function runGuideStatus(positional, flagArgs) {
38930
39064
  console.log(`Environment: ${data.hub.hub_environment ?? "unknown"}; type: ${data.hub.hub_type ?? "unknown"}; app channel: ${data.hub.app_channel_enabled ? "enabled" : "DISABLED"}`);
38931
39065
  }
38932
39066
  function vaultGateConnectorName(connectorId) {
38933
- for (const [name, id] of VAULT_GATE_CONNECTORS) if (id === connectorId) return name;
39067
+ for (const [name, ids] of VAULT_GATE_CONNECTORS) if (ids.includes(connectorId)) return name;
38934
39068
  return null;
38935
39069
  }
38936
39070
  function describeVaultGateEntry(connectorId) {
@@ -38957,14 +39091,14 @@ function readVaultGateList(data) {
38957
39091
  }
38958
39092
  function resolveVaultGateConnector(arg, usage3) {
38959
39093
  const wanted = (arg ?? "").trim().toLowerCase();
38960
- const id = VAULT_GATE_CONNECTORS.get(wanted) ?? (vaultGateConnectorName(wanted) ? wanted : null);
38961
- if (!id) {
38962
- const known = [...VAULT_GATE_CONNECTORS].map(([name, cid]) => `${name} (${cid})`).join(", ");
39094
+ const ids = VAULT_GATE_CONNECTORS.get(wanted) ?? (vaultGateConnectorName(wanted) ? [wanted] : null);
39095
+ if (!ids) {
39096
+ const known = [...VAULT_GATE_CONNECTORS].map(([name, cids]) => `${name} (${cids.join(", ")})`).join(", ");
38963
39097
  console.error(arg ? `Refused: the credentials vault holds nothing of connector "${arg}". It holds only: ${known}.` : "A connector is required.");
38964
39098
  console.error(usage3);
38965
39099
  process.exit(1);
38966
39100
  }
38967
- return id;
39101
+ return ids;
38968
39102
  }
38969
39103
  async function readVaultGateConfig(client) {
38970
39104
  try {
@@ -38998,25 +39132,25 @@ async function runVaultGateChange(change, positional, flagArgs) {
38998
39132
  console.error(usage3);
38999
39133
  process.exit(1);
39000
39134
  }
39001
- const connectorId = resolveVaultGateConnector(positional[0], usage3);
39002
- const entry = describeVaultGateEntry(connectorId);
39135
+ const connectorIds = resolveVaultGateConnector(positional[0], usage3);
39136
+ const entry = connectorIds.map(describeVaultGateEntry).join(", ");
39003
39137
  const { config, accessToken } = await requireAuth();
39004
39138
  const client = new ApiClient({ apiUrl: config.api_url, accessToken });
39005
39139
  const before = await readVaultGateConfig(client);
39006
- const listed2 = before.includes(connectorId);
39007
- if (listed2 === (change === "add")) {
39140
+ const toChange = connectorIds.filter((id) => before.includes(id) !== (change === "add"));
39141
+ if (toChange.length === 0) {
39008
39142
  if (jsonOutput) {
39009
39143
  console.log(JSON.stringify({ before, after: before, changed: false }, null, 2));
39010
39144
  return;
39011
39145
  }
39012
39146
  console.log(`Before: ${describeVaultGateList(before)}`);
39013
- console.log(`${entry} is ${listed2 ? "already" : "not"} listed; nothing was written.`);
39147
+ console.log(`${entry} ${connectorIds.length === 1 ? "is" : "are"} ${change === "add" ? "already" : "not"} listed; nothing was written.`);
39014
39148
  return;
39015
39149
  }
39016
- const next = change === "add" ? [...before, connectorId] : before.filter((id) => id !== connectorId);
39150
+ const next = change === "add" ? [...before, ...toChange] : before.filter((id) => !toChange.includes(id));
39017
39151
  if (!jsonOutput) console.log(`Before: ${describeVaultGateList(before)}`);
39018
39152
  if (!yes && !jsonOutput) {
39019
- console.log(change === "add" ? `About to add ${entry}: its connections' new credentials go to the credentials vault.` : `About to remove ${entry}: its connections' new credentials take the existing path again; ones the vault already holds stay there.`);
39153
+ console.log(change === "add" ? `About to add ${toChange.map(describeVaultGateEntry).join(", ")}: their connections' new credentials go to the credentials vault.` : `About to remove ${toChange.map(describeVaultGateEntry).join(", ")}: their connections' new credentials take the existing path again; ones the vault already holds stay there.`);
39020
39154
  const ok = await confirm("Proceed?");
39021
39155
  if (!ok) {
39022
39156
  console.log("Aborted.");
@@ -39648,6 +39782,12 @@ Usage:
39648
39782
  wayai admin orgs repair-legacy-grants --all | --org <org_id> [--dry-run] [--yes] [--json]
39649
39783
  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
39650
39784
 
39785
+ wayai admin vault import --org <org_id> --connector <connector_id> [--max-puts <n>] [--apply] [--yes] [--json]
39786
+ Move one org's stored credentials of one connector into the credentials vault, no re-entry (#5644). A dry run by default (counts by field, link kind and form); --apply needs the connector's gate open, puts each distinct value once for the direct rows holding it (a field an org credential supplies stays), and keeps the old ciphertext 30 days for revert. Re-run until values_remaining is 0. Lists Telegram bots to enable again
39787
+
39788
+ wayai admin vault revert --org <org_id> --connector <connector_id> [--apply] [--yes] [--json]
39789
+ Put back what vault import moved, within 30 days, and erase the vault entries no row names. A dry run by default
39790
+
39651
39791
  wayai admin harness disable Flip the platform harness_enabled flag OFF (break-glass: blocks harness-agent writes and the per-turn kill switch aborts each harness turn on its next invocation)
39652
39792
  wayai admin harness enable Flip the platform harness_enabled flag ON
39653
39793
  wayai admin harness status Print the platform harness_enabled flag
@@ -39679,7 +39819,7 @@ Usage:
39679
39819
 
39680
39820
  wayai admin vault-gate status [--json] Print the connectors whose new credentials go to the credentials vault
39681
39821
  wayai admin vault-gate add <connector> [--yes] [--json]
39682
- List a connector (a vault connector's name, e.g. telegram, or its catalog id); prints before and after, confirms unless --yes
39822
+ List a connector: a vault connector's name (e.g. telegram, or openai for each of its catalog ids) or one catalog id; prints before and after, confirms unless --yes
39683
39823
  wayai admin vault-gate remove <connector> [--yes] [--json]
39684
39824
  Stop listing it: its new credentials take the existing path again
39685
39825
 
@@ -39866,7 +40006,12 @@ var init_admin = __esm({
39866
40006
  };
39867
40007
  PLATFORM_CONFIG_PROPAGATION_NOTE = "Takes effect within about 60 s (the platform-config cache is dropped; KV deletes propagate eventually).";
39868
40008
  VAULT_GATE_CONNECTORS = /* @__PURE__ */ new Map([
39869
- ["telegram", "a1b2c3d4-e5f6-4a89-b012-3e5e0d000002"]
40009
+ ["telegram", ["a1b2c3d4-e5f6-4a89-b012-3e5e0d000002"]],
40010
+ ["openai", [
40011
+ "0cd6a292-895b-4667-b89e-dd298628c272",
40012
+ "c3d4e5f6-7a8b-4c9d-0e1f-2a3b4c5d6e7f",
40013
+ "b2c3d4e5-f6a7-4b89-c012-3456789abcdf"
40014
+ ]]
39870
40015
  ]);
39871
40016
  VALID_NOTICE_SEVERITIES = ["critical", "warn", "info"];
39872
40017
  }