@wayai/cli 0.3.285 → 0.3.287

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
@@ -6255,10 +6255,10 @@ var init_chunk_5DGHIY7L = __esm({
6255
6255
  }
6256
6256
  });
6257
6257
 
6258
- // ../../packages/core/dist/chunk-5XEJSR22.js
6259
- var DATA_PROXY_MOUNT, DATA_PROXY_PREFIX, BASE_DESTRUCTION_MOUNT, BASE_DESTRUCTION_PREFIX, BASE_DESTRUCTION_CONFIRM_PATH, COMMUNITY_EMAIL_UNSUBSCRIBE_PATH, CONTACT_BOOK_EMAIL_UNSUBSCRIBE_PATH, AUTOMATION_WEBHOOK_MOUNT, MANAGED_AGENTS_WEBHOOK_MOUNT;
6260
- var init_chunk_5XEJSR22 = __esm({
6261
- "../../packages/core/dist/chunk-5XEJSR22.js"() {
6258
+ // ../../packages/core/dist/chunk-5FO3GNKP.js
6259
+ var DATA_PROXY_MOUNT, DATA_PROXY_PREFIX, BASE_DESTRUCTION_MOUNT, BASE_DESTRUCTION_PREFIX, BASE_DESTRUCTION_CONFIRM_PATH, COMMUNITY_EMAIL_UNSUBSCRIBE_PATH, CONTACT_BOOK_EMAIL_UNSUBSCRIBE_PATH, AUTOMATION_WEBHOOK_MOUNT, MANAGED_AGENTS_WEBHOOK_MOUNT, TELEGRAM_VAULT_WEBHOOK_PATH;
6260
+ var init_chunk_5FO3GNKP = __esm({
6261
+ "../../packages/core/dist/chunk-5FO3GNKP.js"() {
6262
6262
  "use strict";
6263
6263
  DATA_PROXY_MOUNT = "/data";
6264
6264
  DATA_PROXY_PREFIX = `/api${DATA_PROXY_MOUNT}`;
@@ -6269,10 +6269,11 @@ var init_chunk_5XEJSR22 = __esm({
6269
6269
  CONTACT_BOOK_EMAIL_UNSUBSCRIBE_PATH = "/api/contact-book/email-unsubscribe";
6270
6270
  AUTOMATION_WEBHOOK_MOUNT = "/webhooks/automations";
6271
6271
  MANAGED_AGENTS_WEBHOOK_MOUNT = "/webhooks/managed-agents";
6272
+ TELEGRAM_VAULT_WEBHOOK_PATH = "/webhooks/telegram/vault";
6272
6273
  }
6273
6274
  });
6274
6275
 
6275
- // ../../packages/core/dist/chunk-3VCB2RTC.js
6276
+ // ../../packages/core/dist/chunk-JSLX2PRT.js
6276
6277
  function matchPath(pattern, path45) {
6277
6278
  const pathSegments2 = path45.replace(/\/$/, "").split("/");
6278
6279
  const isPrefix = pattern.endsWith("/*");
@@ -6301,10 +6302,10 @@ function getEndpointConfig(path45) {
6301
6302
  return { tier: "STANDARD" };
6302
6303
  }
6303
6304
  var ENDPOINT_CONFIGS, EXCLUDED_PATHS;
6304
- var init_chunk_3VCB2RTC = __esm({
6305
- "../../packages/core/dist/chunk-3VCB2RTC.js"() {
6305
+ var init_chunk_JSLX2PRT = __esm({
6306
+ "../../packages/core/dist/chunk-JSLX2PRT.js"() {
6306
6307
  "use strict";
6307
- init_chunk_5XEJSR22();
6308
+ init_chunk_5FO3GNKP();
6308
6309
  ENDPOINT_CONFIGS = {
6309
6310
  // OAuth callbacks - strict, fail-closed (prevent brute force)
6310
6311
  "/oauth/callback/*": { tier: "STRICT", failClosed: true },
@@ -6463,6 +6464,9 @@ var init_chunk_3VCB2RTC = __esm({
6463
6464
  // vendor address carries every tenant's, so BULK. The per-connection budget is
6464
6465
  // `MANAGED_AGENTS_WEBHOOK_PER_CONNECTION_LIMIT`, counted after the delivery is verified.
6465
6466
  [`${MANAGED_AGENTS_WEBHOOK_MOUNT}/*`]: { tier: "BULK" },
6467
+ // Telegram updates the credentials vault forwards for the bots whose tokens it holds (wayai#5644):
6468
+ // the vault's egress carries every such bot's, so BULK. Its signature is checked after this.
6469
+ [TELEGRAM_VAULT_WEBHOOK_PATH]: { tier: "BULK" },
6466
6470
  // Reports (CLI → platform_report triage queue). One per-user budget covers intake
6467
6471
  // (POST), the content edit (PATCH /:id), the reporter read-back (GET, GET /:id), and the
6468
6472
  // verification loop (POST /:id/accept, /:id/contest). The limiter is path-based, so a
@@ -6781,7 +6785,7 @@ var init_chunk_3VCB2RTC = __esm({
6781
6785
  }
6782
6786
  });
6783
6787
 
6784
- // ../../packages/core/dist/chunk-S447DV3E.js
6788
+ // ../../packages/core/dist/chunk-YFHL2BKN.js
6785
6789
  function fileSnapshotChanged(run) {
6786
6790
  return run.written + run.removed > 0;
6787
6791
  }
@@ -6822,11 +6826,11 @@ async function sendWithRetry(opts, cursor) {
6822
6826
  }
6823
6827
  }
6824
6828
  var rekorFileSnapshotAnswerSchema, FILE_SNAPSHOT_MAX_PAGES, FILE_SNAPSHOT_CONFLICT_ATTEMPTS, FILE_SNAPSHOT_PAGE_SPACING_MS, FILE_SNAPSHOT_CONFLICT_STATUS;
6825
- var init_chunk_S447DV3E = __esm({
6826
- "../../packages/core/dist/chunk-S447DV3E.js"() {
6829
+ var init_chunk_YFHL2BKN = __esm({
6830
+ "../../packages/core/dist/chunk-YFHL2BKN.js"() {
6827
6831
  "use strict";
6828
- init_chunk_3VCB2RTC();
6829
- init_chunk_5XEJSR22();
6832
+ init_chunk_JSLX2PRT();
6833
+ init_chunk_5FO3GNKP();
6830
6834
  init_zod();
6831
6835
  rekorFileSnapshotAnswerSchema = external_exports.object({
6832
6836
  data: external_exports.object({
@@ -8707,7 +8711,7 @@ var init_chunk_C2UEA2KW = __esm({
8707
8711
  }
8708
8712
  });
8709
8713
 
8710
- // ../../packages/core/dist/chunk-GYSQV2DS.js
8714
+ // ../../packages/core/dist/chunk-JHUTFQDO.js
8711
8715
  function isNativeToolName(name) {
8712
8716
  return NATIVE_TOOL_NAMES.has(name);
8713
8717
  }
@@ -8726,8 +8730,8 @@ function idempotencyHeaderRefusal(value) {
8726
8730
  return null;
8727
8731
  }
8728
8732
  var NATIVE_TOOL_SCHEMAS, WAYAI_CONNECTOR, SANDBOX_AGENT_ROLES, BASE_NATIVE_TOOLS, NATIVE_TOOLS, NATIVE_TOOL_NAMES, CATALOG_SIDE_EFFECTS, CATALOG_REPLAY, REPLAY_OVERRIDES, RESERVED_HEADERS;
8729
- var init_chunk_GYSQV2DS = __esm({
8730
- "../../packages/core/dist/chunk-GYSQV2DS.js"() {
8733
+ var init_chunk_JHUTFQDO = __esm({
8734
+ "../../packages/core/dist/chunk-JHUTFQDO.js"() {
8731
8735
  "use strict";
8732
8736
  init_chunk_YROEDMVZ();
8733
8737
  NATIVE_TOOL_SCHEMAS = {
@@ -10776,12 +10780,12 @@ var init_chunk_I42QJGJF = __esm({
10776
10780
  }
10777
10781
  });
10778
10782
 
10779
- // ../../packages/core/dist/chunk-VSSZVDBU.js
10783
+ // ../../packages/core/dist/chunk-DOGCOC6X.js
10780
10784
  var COUNTER_KEYS, STT_PRICING, CONTAINER_PRICING, connectorById, nativeToolById;
10781
- var init_chunk_VSSZVDBU = __esm({
10782
- "../../packages/core/dist/chunk-VSSZVDBU.js"() {
10785
+ var init_chunk_DOGCOC6X = __esm({
10786
+ "../../packages/core/dist/chunk-DOGCOC6X.js"() {
10783
10787
  "use strict";
10784
- init_chunk_GYSQV2DS();
10788
+ init_chunk_JHUTFQDO();
10785
10789
  init_chunk_I42QJGJF();
10786
10790
  init_chunk_MIWZOSPI();
10787
10791
  COUNTER_KEYS = Object.keys({
@@ -10905,7 +10909,7 @@ var init_chunk_L5F7ZOUJ = __esm({
10905
10909
  }
10906
10910
  });
10907
10911
 
10908
- // ../../packages/core/dist/chunk-J75LDBC2.js
10912
+ // ../../packages/core/dist/chunk-BLPYDZAO.js
10909
10913
  function normalizeDecisionsModelId(modelId) {
10910
10914
  return modelId.trim().toLowerCase();
10911
10915
  }
@@ -10976,10 +10980,10 @@ function readAgentSettingsModel(agentSettings) {
10976
10980
  return typeof model === "string" ? model : null;
10977
10981
  }
10978
10982
  var DECISIONS_MODEL_PREFIXES, DECISION_CAPABLE_AGENT_ROLES;
10979
- var init_chunk_J75LDBC2 = __esm({
10980
- "../../packages/core/dist/chunk-J75LDBC2.js"() {
10983
+ var init_chunk_BLPYDZAO = __esm({
10984
+ "../../packages/core/dist/chunk-BLPYDZAO.js"() {
10981
10985
  "use strict";
10982
- init_chunk_VSSZVDBU();
10986
+ init_chunk_DOGCOC6X();
10983
10987
  init_chunk_L5F7ZOUJ();
10984
10988
  DECISIONS_MODEL_PREFIXES = ["typesafe/jev-", "jev-"];
10985
10989
  DECISION_CAPABLE_AGENT_ROLES = [
@@ -10990,7 +10994,7 @@ var init_chunk_J75LDBC2 = __esm({
10990
10994
  }
10991
10995
  });
10992
10996
 
10993
- // ../../packages/core/dist/chunk-OXVMTY3G.js
10997
+ // ../../packages/core/dist/chunk-OAWG66J3.js
10994
10998
  function resolveMonitorTrigger(monitorConfig) {
10995
10999
  if (!monitorConfig || typeof monitorConfig !== "object") return "idle";
10996
11000
  const raw = monitorConfig.trigger;
@@ -11296,15 +11300,15 @@ function refineMonitorRulesStructuredOutput(body, ctx) {
11296
11300
  if (refusal2) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["response_format"], message: refusal2 });
11297
11301
  }
11298
11302
  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;
11299
- var init_chunk_OXVMTY3G = __esm({
11300
- "../../packages/core/dist/chunk-OXVMTY3G.js"() {
11303
+ var init_chunk_OAWG66J3 = __esm({
11304
+ "../../packages/core/dist/chunk-OAWG66J3.js"() {
11301
11305
  "use strict";
11302
11306
  init_chunk_IBL7FANV();
11303
11307
  init_chunk_KB5RK3RP();
11304
11308
  init_chunk_C2UEA2KW();
11305
11309
  init_chunk_HZ6CADSY();
11306
- init_chunk_J75LDBC2();
11307
- init_chunk_GYSQV2DS();
11310
+ init_chunk_BLPYDZAO();
11311
+ init_chunk_JHUTFQDO();
11308
11312
  init_chunk_YROEDMVZ();
11309
11313
  init_chunk_L5F7ZOUJ();
11310
11314
  init_zod();
@@ -11521,12 +11525,12 @@ var init_chunk_OXVMTY3G = __esm({
11521
11525
  }
11522
11526
  });
11523
11527
 
11524
- // ../../packages/core/dist/chunk-CQTU636K.js
11528
+ // ../../packages/core/dist/chunk-HL6QCLLK.js
11525
11529
  var conversationIdParam, conversationHubQuery, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, deleteUserConversationsResponse, sendMessageBody, listConversationsQuery, flagSourceSchema, getConversationsResponse, getConversationDetailParams, getConversationDetailQuery, getConversationDetailResponse, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody;
11526
- var init_chunk_CQTU636K = __esm({
11527
- "../../packages/core/dist/chunk-CQTU636K.js"() {
11530
+ var init_chunk_HL6QCLLK = __esm({
11531
+ "../../packages/core/dist/chunk-HL6QCLLK.js"() {
11528
11532
  "use strict";
11529
- init_chunk_OXVMTY3G();
11533
+ init_chunk_OAWG66J3();
11530
11534
  init_chunk_HZ6CADSY();
11531
11535
  init_chunk_YROEDMVZ();
11532
11536
  init_zod();
@@ -12610,7 +12614,7 @@ var init_chunk_BPCNB5RT = __esm({
12610
12614
  }
12611
12615
  });
12612
12616
 
12613
- // ../../packages/core/dist/chunk-NEIVT3KL.js
12617
+ // ../../packages/core/dist/chunk-KVOFZ5RY.js
12614
12618
  function toolParametersViolations(params) {
12615
12619
  try {
12616
12620
  if (containsKanbanPlaceholders(params)) return [];
@@ -12634,28 +12638,30 @@ function toolConfigDescription(config) {
12634
12638
  function offeredToolDescription(config, toolDescription) {
12635
12639
  return toolConfigDescription(config) ?? nonBlank(toolDescription);
12636
12640
  }
12637
- function refineToolConfig(value, ctx) {
12638
- const raw = value.tool_config;
12639
- if (raw == null) return;
12640
- const params = extractToolParameters(raw);
12641
- if (params === void 0) {
12642
- const looksLikeObject = raw !== null && typeof raw === "object" && !Array.isArray(raw) || typeof raw === "string" && (() => {
12643
- try {
12644
- const parsed = JSON.parse(raw);
12645
- return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed);
12646
- } catch {
12647
- return false;
12648
- }
12649
- })();
12650
- if (!looksLikeObject) {
12651
- ctx.addIssue({
12652
- code: external_exports.ZodIssueCode.custom,
12653
- path: ["tool_config"],
12654
- message: "tool_config must be an object"
12655
- });
12641
+ function customToolConfigObject(config) {
12642
+ let read = config;
12643
+ for (let layer = 0; layer < MAX_CUSTOM_TOOL_CONFIG_TEXT_LAYERS && typeof read === "string"; layer++) {
12644
+ try {
12645
+ read = JSON.parse(read);
12646
+ } catch {
12647
+ return read;
12656
12648
  }
12649
+ }
12650
+ return read;
12651
+ }
12652
+ function refineToolConfig(value, ctx) {
12653
+ if (value.tool_config == null) return;
12654
+ const config = customToolConfigObject(value.tool_config);
12655
+ if (config === null || typeof config !== "object" || Array.isArray(config)) {
12656
+ ctx.addIssue({
12657
+ code: external_exports.ZodIssueCode.custom,
12658
+ path: ["tool_config"],
12659
+ message: "tool_config must be an object"
12660
+ });
12657
12661
  return;
12658
12662
  }
12663
+ const params = extractToolParameters(config);
12664
+ if (params === void 0) return;
12659
12665
  for (const err of toolParametersViolations(params)) {
12660
12666
  ctx.addIssue({
12661
12667
  code: external_exports.ZodIssueCode.custom,
@@ -12664,16 +12670,17 @@ function refineToolConfig(value, ctx) {
12664
12670
  });
12665
12671
  }
12666
12672
  }
12667
- var nonBlank, DEFAULT_TOOL_CONFIG_DESCRIPTION, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, toolReplaySettingsFields, toolReplaySettingsSchema, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody;
12668
- var init_chunk_NEIVT3KL = __esm({
12669
- "../../packages/core/dist/chunk-NEIVT3KL.js"() {
12673
+ 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"() {
12670
12676
  "use strict";
12671
12677
  init_chunk_WEXVYJ5H();
12672
12678
  init_chunk_HZ6CADSY();
12673
- init_chunk_GYSQV2DS();
12679
+ init_chunk_JHUTFQDO();
12674
12680
  init_zod();
12675
12681
  nonBlank = (text4) => typeof text4 === "string" && text4.trim() !== "" ? text4 : void 0;
12676
12682
  DEFAULT_TOOL_CONFIG_DESCRIPTION = "Function description";
12683
+ MAX_CUSTOM_TOOL_CONFIG_TEXT_LAYERS = 16;
12677
12684
  toolIdParam = external_exports.object({ id: uuidSchema });
12678
12685
  listToolsQuery = external_exports.object({ agent_id: uuidSchema, hub_id: uuidSchema });
12679
12686
  toolAgentQuery = external_exports.object({ agent_id: uuidSchema, hub_id: uuidSchema });
@@ -14036,7 +14043,7 @@ var init_chunk_7NQZRSSJ = __esm({
14036
14043
  }
14037
14044
  });
14038
14045
 
14039
- // ../../packages/core/dist/chunk-4WB5E53T.js
14046
+ // ../../packages/core/dist/chunk-UCPEWP5G.js
14040
14047
  function declaresNoConnection(agent) {
14041
14048
  return agent.connection === null && !agent.connection_id;
14042
14049
  }
@@ -14049,14 +14056,6 @@ function customToolConnectionRefusal(agentName, tool) {
14049
14056
  if (tool.connection || tool.connection_id) return null;
14050
14057
  return `Agent "${agentName}", tool "${tool.name}": connection is required. A custom tool calls through one of the hub's connections: name it.`;
14051
14058
  }
14052
- function customToolConfigObject(config) {
14053
- if (typeof config !== "string") return config;
14054
- try {
14055
- return JSON.parse(config);
14056
- } catch {
14057
- return config;
14058
- }
14059
- }
14060
14059
  function customToolDescriptionAfterPush(entry, row, writtenConfig) {
14061
14060
  const written = row ? writtenConfig : entry.config;
14062
14061
  const stated = toolConfigDescription(written);
@@ -14095,27 +14094,18 @@ function refineHubAsCodeCustomTools(config, ctx) {
14095
14094
  message: `custom tool "${printableName(tool?.name)}": ${issue.path.join(".")}: ${issue.message}`
14096
14095
  });
14097
14096
  }
14098
- const raw = tool?.config;
14099
- if (raw == null) continue;
14100
- const params = extractToolParameters(raw);
14101
- if (params === void 0) {
14102
- const looksLikeObject = raw !== null && typeof raw === "object" && !Array.isArray(raw) || typeof raw === "string" && (() => {
14103
- try {
14104
- const parsed = JSON.parse(raw);
14105
- return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed);
14106
- } catch {
14107
- return false;
14108
- }
14109
- })();
14110
- if (!looksLikeObject) {
14111
- ctx.addIssue({
14112
- code: external_exports.ZodIssueCode.custom,
14113
- path: ["agents", a, "tools", "custom", c, "config"],
14114
- message: `custom tool "${printableName(tool?.name)}": config must be an object`
14115
- });
14116
- }
14097
+ if (tool?.config == null) continue;
14098
+ const raw = customToolConfigObject(tool.config);
14099
+ if (!isPlainObject(raw)) {
14100
+ ctx.addIssue({
14101
+ code: external_exports.ZodIssueCode.custom,
14102
+ path: ["agents", a, "tools", "custom", c, "config"],
14103
+ message: `custom tool "${printableName(tool?.name)}": config must be an object`
14104
+ });
14117
14105
  continue;
14118
14106
  }
14107
+ const params = extractToolParameters(raw);
14108
+ if (params === void 0) continue;
14119
14109
  for (const err of toolParametersViolations(params)) {
14120
14110
  const tail = err.path.split(".").filter(Boolean);
14121
14111
  ctx.addIssue({
@@ -14717,13 +14707,7 @@ function refusedStringConfigNesting(config, ctx) {
14717
14707
  const custom2 = isPlainObject(agent) && isPlainObject(agent.tools) ? agent.tools.custom : void 0;
14718
14708
  return Array.isArray(custom2) && custom2.some((tool, t) => {
14719
14709
  if (!isPlainObject(tool) || typeof tool.config !== "string") return false;
14720
- let parsed;
14721
- try {
14722
- parsed = JSON.parse(tool.config);
14723
- } catch {
14724
- return false;
14725
- }
14726
- return refusedNesting(parsed, ["agents", a, "tools", "custom", t, "config"], ctx);
14710
+ return refusedNesting(customToolConfigObject(tool.config), ["agents", a, "tools", "custom", t, "config"], ctx);
14727
14711
  });
14728
14712
  });
14729
14713
  }
@@ -14791,10 +14775,10 @@ function skillSectionsAsResources(scope) {
14791
14775
  };
14792
14776
  }
14793
14777
  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;
14794
- var init_chunk_4WB5E53T = __esm({
14795
- "../../packages/core/dist/chunk-4WB5E53T.js"() {
14778
+ var init_chunk_UCPEWP5G = __esm({
14779
+ "../../packages/core/dist/chunk-UCPEWP5G.js"() {
14796
14780
  "use strict";
14797
- init_chunk_NEIVT3KL();
14781
+ init_chunk_KVOFZ5RY();
14798
14782
  init_chunk_HRKVCI5A();
14799
14783
  init_chunk_CZEJR5UE();
14800
14784
  init_chunk_LBDH7LCG();
@@ -14802,13 +14786,13 @@ var init_chunk_4WB5E53T = __esm({
14802
14786
  init_chunk_7NQZRSSJ();
14803
14787
  init_chunk_X5PZZVTS();
14804
14788
  init_chunk_K5UAZWFF();
14805
- init_chunk_OXVMTY3G();
14789
+ init_chunk_OAWG66J3();
14806
14790
  init_chunk_S4VDZ7PZ();
14807
14791
  init_chunk_C2UEA2KW();
14808
14792
  init_chunk_FBV7NLKO();
14809
14793
  init_chunk_WEXVYJ5H();
14810
14794
  init_chunk_HZ6CADSY();
14811
- init_chunk_J75LDBC2();
14795
+ init_chunk_BLPYDZAO();
14812
14796
  init_chunk_YROEDMVZ();
14813
14797
  init_zod();
14814
14798
  MAX_10MB_BASE64_ENCODED_BYTES = Math.ceil(MAX_RESOURCE_FILE_SIZE / 3) * 4 + 16;
@@ -15175,10 +15159,10 @@ var init_chunk_BFG4ZWR4 = __esm({
15175
15159
  }
15176
15160
  });
15177
15161
 
15178
- // ../../packages/core/dist/chunk-SAMZLA2A.js
15162
+ // ../../packages/core/dist/chunk-4J5DPB3X.js
15179
15163
  var dataExplorerDebugDoType, DEBUG_READ_MAX_LIMIT, DEBUG_READ_DEFAULT_LIMIT;
15180
- var init_chunk_SAMZLA2A = __esm({
15181
- "../../packages/core/dist/chunk-SAMZLA2A.js"() {
15164
+ var init_chunk_4J5DPB3X = __esm({
15165
+ "../../packages/core/dist/chunk-4J5DPB3X.js"() {
15182
15166
  "use strict";
15183
15167
  init_zod();
15184
15168
  dataExplorerDebugDoType = external_exports.enum(["hub", "org", "conversation", "user", "platform", "thread", "community", "contact_book", "batch"]);
@@ -15289,7 +15273,7 @@ var init_chunk_OMPT4ZHR = __esm({
15289
15273
  }
15290
15274
  });
15291
15275
 
15292
- // ../../packages/core/dist/chunk-3QME565M.js
15276
+ // ../../packages/core/dist/chunk-2IAHI2UA.js
15293
15277
  function refineScopedTarget(data, ctx) {
15294
15278
  if (data.scope === "org") {
15295
15279
  if (!data.org_id) {
@@ -15315,12 +15299,12 @@ function refineScopedTarget(data, ctx) {
15315
15299
  }
15316
15300
  }
15317
15301
  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;
15318
- var init_chunk_3QME565M = __esm({
15319
- "../../packages/core/dist/chunk-3QME565M.js"() {
15302
+ var init_chunk_2IAHI2UA = __esm({
15303
+ "../../packages/core/dist/chunk-2IAHI2UA.js"() {
15320
15304
  "use strict";
15321
15305
  init_chunk_FECLIZTY();
15322
15306
  init_chunk_BFG4ZWR4();
15323
- init_chunk_SAMZLA2A();
15307
+ init_chunk_4J5DPB3X();
15324
15308
  init_chunk_7NQZRSSJ();
15325
15309
  init_chunk_OMPT4ZHR();
15326
15310
  init_chunk_HZ6CADSY();
@@ -15915,16 +15899,16 @@ var init_chunk_R6Y377AW = __esm({
15915
15899
  }
15916
15900
  });
15917
15901
 
15918
- // ../../packages/core/dist/chunk-AHOE4ZHH.js
15902
+ // ../../packages/core/dist/chunk-3QU3I3BQ.js
15919
15903
  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;
15920
- var init_chunk_AHOE4ZHH = __esm({
15921
- "../../packages/core/dist/chunk-AHOE4ZHH.js"() {
15904
+ var init_chunk_3QU3I3BQ = __esm({
15905
+ "../../packages/core/dist/chunk-3QU3I3BQ.js"() {
15922
15906
  "use strict";
15923
15907
  init_chunk_R6Y377AW();
15924
15908
  init_chunk_UAOHHCW5();
15925
- init_chunk_OXVMTY3G();
15926
- init_chunk_5XEJSR22();
15927
- init_chunk_J75LDBC2();
15909
+ init_chunk_OAWG66J3();
15910
+ init_chunk_5FO3GNKP();
15911
+ init_chunk_BLPYDZAO();
15928
15912
  init_chunk_YROEDMVZ();
15929
15913
  init_zod();
15930
15914
  AUTOMATION_TRIGGER_TYPES = ["schedule", "event", "webhook"];
@@ -16243,10 +16227,10 @@ var init_chunk_WFQDSQJK = __esm({
16243
16227
  }
16244
16228
  });
16245
16229
 
16246
- // ../../packages/core/dist/chunk-EV3MAOEX.js
16230
+ // ../../packages/core/dist/chunk-M53YHYIG.js
16247
16231
  var APP_ERROR_BRAND, AppError, PAGE_CUSTOMER_UNAVAILABLE_CODE, LLM_RATE_LIMIT_BRAND, LlmRateLimitError, LLM_PROVIDER_HTTP_BRAND, LlmProviderHttpError, LLM_PROVIDER_CONTENT_BRAND, LlmProviderContentError, LLM_PROVIDER_TIMEOUT_BRAND, LlmProviderTimeoutError, ExternalServiceError, CHANNEL_PROVIDER_HTTP_BRAND, ChannelProviderHttpError, MEDIA_PROVIDER_HTTP_BRAND, MediaProviderHttpError;
16248
- var init_chunk_EV3MAOEX = __esm({
16249
- "../../packages/core/dist/chunk-EV3MAOEX.js"() {
16232
+ var init_chunk_M53YHYIG = __esm({
16233
+ "../../packages/core/dist/chunk-M53YHYIG.js"() {
16250
16234
  "use strict";
16251
16235
  init_chunk_WFQDSQJK();
16252
16236
  APP_ERROR_BRAND = /* @__PURE__ */ Symbol.for("wayai.AppError");
@@ -16374,7 +16358,7 @@ var init_contracts = __esm({
16374
16358
  init_chunk_5YNUTCJ2();
16375
16359
  init_chunk_ZC6YGHNX();
16376
16360
  init_chunk_5DGHIY7L();
16377
- init_chunk_S447DV3E();
16361
+ init_chunk_YFHL2BKN();
16378
16362
  init_chunk_IPDOHAZ5();
16379
16363
  init_chunk_GPM7PE44();
16380
16364
  init_chunk_NZ6RQW6R();
@@ -16390,7 +16374,7 @@ var init_contracts = __esm({
16390
16374
  init_chunk_OPETF4GS();
16391
16375
  init_chunk_SY6PLCPK();
16392
16376
  init_chunk_KMAC3O3L();
16393
- init_chunk_CQTU636K();
16377
+ init_chunk_HL6QCLLK();
16394
16378
  init_chunk_KSTYTQ7I();
16395
16379
  init_chunk_LKBSHANA();
16396
16380
  init_chunk_Y6NC5CH5();
@@ -16408,8 +16392,8 @@ var init_contracts = __esm({
16408
16392
  init_chunk_E4DIIOOE();
16409
16393
  init_chunk_7CYHPF35();
16410
16394
  init_chunk_BPCNB5RT();
16411
- init_chunk_4WB5E53T();
16412
- init_chunk_NEIVT3KL();
16395
+ init_chunk_UCPEWP5G();
16396
+ init_chunk_KVOFZ5RY();
16413
16397
  init_chunk_HRKVCI5A();
16414
16398
  init_chunk_CZEJR5UE();
16415
16399
  init_chunk_4D6K4P4K();
@@ -16418,10 +16402,10 @@ var init_contracts = __esm({
16418
16402
  init_chunk_4LXDRTO4();
16419
16403
  init_chunk_JDJ4EUOL();
16420
16404
  init_chunk_NVKU5PPQ();
16421
- init_chunk_3QME565M();
16405
+ init_chunk_2IAHI2UA();
16422
16406
  init_chunk_FECLIZTY();
16423
16407
  init_chunk_BFG4ZWR4();
16424
- init_chunk_SAMZLA2A();
16408
+ init_chunk_4J5DPB3X();
16425
16409
  init_chunk_7NQZRSSJ();
16426
16410
  init_chunk_D3EP4TDU();
16427
16411
  init_chunk_X5PZZVTS();
@@ -16429,16 +16413,16 @@ var init_contracts = __esm({
16429
16413
  init_chunk_2PZIF56U();
16430
16414
  init_chunk_UEJOG2Q7();
16431
16415
  init_chunk_JO53JB35();
16432
- init_chunk_AHOE4ZHH();
16416
+ init_chunk_3QU3I3BQ();
16433
16417
  init_chunk_R6Y377AW();
16434
16418
  init_chunk_UAOHHCW5();
16435
- init_chunk_OXVMTY3G();
16419
+ init_chunk_OAWG66J3();
16436
16420
  init_chunk_IG6QBZMA();
16437
16421
  init_chunk_OMPT4ZHR();
16438
- init_chunk_3VCB2RTC();
16422
+ init_chunk_JSLX2PRT();
16439
16423
  init_chunk_SOJMWM63();
16440
16424
  init_chunk_WTOA3ANF();
16441
- init_chunk_5XEJSR22();
16425
+ init_chunk_5FO3GNKP();
16442
16426
  init_chunk_IBL7FANV();
16443
16427
  init_chunk_S4VDZ7PZ();
16444
16428
  init_chunk_KB5RK3RP();
@@ -16455,14 +16439,14 @@ var init_contracts = __esm({
16455
16439
  init_chunk_WEXVYJ5H();
16456
16440
  init_chunk_6TSQ5HXC();
16457
16441
  init_chunk_HZ6CADSY();
16458
- init_chunk_J75LDBC2();
16459
- init_chunk_VSSZVDBU();
16460
- init_chunk_GYSQV2DS();
16442
+ init_chunk_BLPYDZAO();
16443
+ init_chunk_DOGCOC6X();
16444
+ init_chunk_JHUTFQDO();
16461
16445
  init_chunk_I42QJGJF();
16462
16446
  init_chunk_MIWZOSPI();
16463
16447
  init_chunk_YROEDMVZ();
16464
16448
  init_chunk_L5F7ZOUJ();
16465
- init_chunk_EV3MAOEX();
16449
+ init_chunk_M53YHYIG();
16466
16450
  init_chunk_WFQDSQJK();
16467
16451
  }
16468
16452
  });
@@ -16537,10 +16521,10 @@ var init_chunk_RPGBR5IN = __esm({
16537
16521
  }
16538
16522
  });
16539
16523
 
16540
- // ../../packages/core/dist/chunk-MYPAFWEY.js
16524
+ // ../../packages/core/dist/chunk-FZ7BJJW7.js
16541
16525
  var ENVELOPE_PREFIX, CREDENTIAL_REFERENCE_PREFIX;
16542
- var init_chunk_MYPAFWEY = __esm({
16543
- "../../packages/core/dist/chunk-MYPAFWEY.js"() {
16526
+ var init_chunk_FZ7BJJW7 = __esm({
16527
+ "../../packages/core/dist/chunk-FZ7BJJW7.js"() {
16544
16528
  "use strict";
16545
16529
  ENVELOPE_PREFIX = "enc:v1:";
16546
16530
  CREDENTIAL_REFERENCE_PREFIX = `${ENVELOPE_PREFIX}vault:`;
@@ -16599,10 +16583,10 @@ var UUID_RE2, WAYAI_WORKSPACE_LAYOUT;
16599
16583
  var init_dist = __esm({
16600
16584
  "../../packages/core/dist/index.js"() {
16601
16585
  "use strict";
16602
- init_chunk_3VCB2RTC();
16586
+ init_chunk_JSLX2PRT();
16603
16587
  init_chunk_SOJMWM63();
16604
16588
  init_chunk_WTOA3ANF();
16605
- init_chunk_5XEJSR22();
16589
+ init_chunk_5FO3GNKP();
16606
16590
  init_chunk_IBL7FANV();
16607
16591
  init_chunk_S4VDZ7PZ();
16608
16592
  init_chunk_KB5RK3RP();
@@ -16617,15 +16601,15 @@ var init_dist = __esm({
16617
16601
  init_chunk_WEXVYJ5H();
16618
16602
  init_chunk_6TSQ5HXC();
16619
16603
  init_chunk_HZ6CADSY();
16620
- init_chunk_MYPAFWEY();
16621
- init_chunk_J75LDBC2();
16622
- init_chunk_VSSZVDBU();
16623
- init_chunk_GYSQV2DS();
16604
+ init_chunk_FZ7BJJW7();
16605
+ init_chunk_BLPYDZAO();
16606
+ init_chunk_DOGCOC6X();
16607
+ init_chunk_JHUTFQDO();
16624
16608
  init_chunk_I42QJGJF();
16625
16609
  init_chunk_MIWZOSPI();
16626
16610
  init_chunk_YROEDMVZ();
16627
16611
  init_chunk_L5F7ZOUJ();
16628
- init_chunk_EV3MAOEX();
16612
+ init_chunk_M53YHYIG();
16629
16613
  init_chunk_WFQDSQJK();
16630
16614
  UUID_RE2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
16631
16615
  WAYAI_WORKSPACE_LAYOUT = {
@@ -17858,6 +17842,9 @@ var init_utils = __esm({
17858
17842
  ["admin guide set-hub", { positionals: 1 }],
17859
17843
  ["admin guide clear", { positionals: 0 }],
17860
17844
  ["admin guide status", { positionals: 0 }],
17845
+ ["admin vault-gate status", { positionals: 0 }],
17846
+ ["admin vault-gate add", { positionals: 1 }],
17847
+ ["admin vault-gate remove", { positionals: 1 }],
17861
17848
  ["admin voice-calls enable", { positionals: 0 }],
17862
17849
  ["admin voice-calls disable", { positionals: 0 }],
17863
17850
  ["admin voice-calls status", { positionals: 0 }],
@@ -21678,7 +21665,7 @@ var init_pages = __esm({
21678
21665
  init_chunk_FBV7NLKO();
21679
21666
  init_chunk_WEXVYJ5H();
21680
21667
  init_chunk_HZ6CADSY();
21681
- init_chunk_EV3MAOEX();
21668
+ init_chunk_M53YHYIG();
21682
21669
  init_chunk_WFQDSQJK();
21683
21670
  }
21684
21671
  });
@@ -22772,8 +22759,8 @@ var init_hub_materializer = __esm({
22772
22759
  var init_ci = __esm({
22773
22760
  "../../packages/core/dist/contracts/ci.js"() {
22774
22761
  "use strict";
22775
- init_chunk_4WB5E53T();
22776
- init_chunk_NEIVT3KL();
22762
+ init_chunk_UCPEWP5G();
22763
+ init_chunk_KVOFZ5RY();
22777
22764
  init_chunk_HRKVCI5A();
22778
22765
  init_chunk_CZEJR5UE();
22779
22766
  init_chunk_4D6K4P4K();
@@ -22784,7 +22771,7 @@ var init_ci = __esm({
22784
22771
  init_chunk_D3EP4TDU();
22785
22772
  init_chunk_X5PZZVTS();
22786
22773
  init_chunk_K5UAZWFF();
22787
- init_chunk_OXVMTY3G();
22774
+ init_chunk_OAWG66J3();
22788
22775
  init_chunk_WTOA3ANF();
22789
22776
  init_chunk_IBL7FANV();
22790
22777
  init_chunk_S4VDZ7PZ();
@@ -22796,14 +22783,14 @@ var init_ci = __esm({
22796
22783
  init_chunk_WEXVYJ5H();
22797
22784
  init_chunk_6TSQ5HXC();
22798
22785
  init_chunk_HZ6CADSY();
22799
- init_chunk_J75LDBC2();
22800
- init_chunk_VSSZVDBU();
22801
- init_chunk_GYSQV2DS();
22786
+ init_chunk_BLPYDZAO();
22787
+ init_chunk_DOGCOC6X();
22788
+ init_chunk_JHUTFQDO();
22802
22789
  init_chunk_I42QJGJF();
22803
22790
  init_chunk_MIWZOSPI();
22804
22791
  init_chunk_YROEDMVZ();
22805
22792
  init_chunk_L5F7ZOUJ();
22806
- init_chunk_EV3MAOEX();
22793
+ init_chunk_M53YHYIG();
22807
22794
  init_chunk_WFQDSQJK();
22808
22795
  }
22809
22796
  });
@@ -37897,6 +37884,26 @@ async function adminCommand(args2) {
37897
37884
  process.exit(1);
37898
37885
  }
37899
37886
  }
37887
+ if (group === "vault-gate") {
37888
+ if (!sub) {
37889
+ printHelp2();
37890
+ process.exit(1);
37891
+ }
37892
+ switch (sub) {
37893
+ case "status":
37894
+ await runVaultGateStatus(positional, flagArgs);
37895
+ return;
37896
+ case "add":
37897
+ await runVaultGateChange("add", positional, flagArgs);
37898
+ return;
37899
+ case "remove":
37900
+ await runVaultGateChange("remove", positional, flagArgs);
37901
+ return;
37902
+ default:
37903
+ printHelp2();
37904
+ process.exit(1);
37905
+ }
37906
+ }
37900
37907
  if (group === "voice-calls") {
37901
37908
  if (!sub) {
37902
37909
  printHelp2();
@@ -38810,7 +38817,7 @@ async function runCommunitiesDestroy(positional, flagArgs) {
38810
38817
  function describeGuideHub(hub) {
38811
38818
  return `${hub.hub_name ?? "(unnamed)"} (${hub.hub_id}), owned by ${hub.organization_name ?? "(unnamed org)"} (${hub.organization_id})`;
38812
38819
  }
38813
- function parseGuideFlags(flagArgs, usage3, allowed) {
38820
+ function parseBooleanFlags(flagArgs, usage3, allowed) {
38814
38821
  for (const flag of flagArgs) {
38815
38822
  if (!allowed.includes(flag)) {
38816
38823
  console.error(`Unknown flag: ${flag}`);
@@ -38822,7 +38829,7 @@ function parseGuideFlags(flagArgs, usage3, allowed) {
38822
38829
  }
38823
38830
  async function runGuideSetHub(positional, flagArgs) {
38824
38831
  const usage3 = "wayai admin guide set-hub <hub_id> [--yes] [--json]";
38825
- const { yes, jsonOutput } = parseGuideFlags(flagArgs, usage3, ["--yes", "--json"]);
38832
+ const { yes, jsonOutput } = parseBooleanFlags(flagArgs, usage3, ["--yes", "--json"]);
38826
38833
  const parsed = adminSetGuideHubBody.safeParse({ hub_id: positional[0] });
38827
38834
  if (positional.length !== 1 || !parsed.success) {
38828
38835
  console.error("<hub_id> must be one hub id (a UUID).");
@@ -38873,7 +38880,7 @@ async function runGuideClear(positional, flagArgs) {
38873
38880
  console.error(usage3);
38874
38881
  process.exit(1);
38875
38882
  }
38876
- const { jsonOutput } = parseGuideFlags(flagArgs, usage3, ["--json"]);
38883
+ const { jsonOutput } = parseBooleanFlags(flagArgs, usage3, ["--json"]);
38877
38884
  const { config, accessToken } = await requireAuth();
38878
38885
  const client = new ApiClient({ apiUrl: config.api_url, accessToken });
38879
38886
  try {
@@ -38896,7 +38903,7 @@ async function runGuideStatus(positional, flagArgs) {
38896
38903
  console.error(usage3);
38897
38904
  process.exit(1);
38898
38905
  }
38899
- const { jsonOutput } = parseGuideFlags(flagArgs, usage3, ["--json"]);
38906
+ const { jsonOutput } = parseBooleanFlags(flagArgs, usage3, ["--json"]);
38900
38907
  const { config, accessToken } = await requireAuth();
38901
38908
  const client = new ApiClient({ apiUrl: config.api_url, accessToken });
38902
38909
  let data;
@@ -38922,6 +38929,114 @@ async function runGuideStatus(positional, flagArgs) {
38922
38929
  console.log(`Hub: ${describeGuideHub(data.hub)}`);
38923
38930
  console.log(`Environment: ${data.hub.hub_environment ?? "unknown"}; type: ${data.hub.hub_type ?? "unknown"}; app channel: ${data.hub.app_channel_enabled ? "enabled" : "DISABLED"}`);
38924
38931
  }
38932
+ function vaultGateConnectorName(connectorId) {
38933
+ for (const [name, id] of VAULT_GATE_CONNECTORS) if (id === connectorId) return name;
38934
+ return null;
38935
+ }
38936
+ function describeVaultGateEntry(connectorId) {
38937
+ const name = vaultGateConnectorName(connectorId);
38938
+ return name ? `${name} (${connectorId})` : `${connectorId} (no connector the vault holds)`;
38939
+ }
38940
+ function describeVaultGateList(ids) {
38941
+ return ids.length === 0 ? "(none: every connector's new credentials take the existing path)" : ids.map(describeVaultGateEntry).join(", ");
38942
+ }
38943
+ function readVaultGateList(data) {
38944
+ const raw = data.vault_connector_ids;
38945
+ if (raw === void 0 || raw === null) return [];
38946
+ let parsed;
38947
+ try {
38948
+ parsed = typeof raw === "string" ? JSON.parse(raw) : raw;
38949
+ } catch {
38950
+ parsed = void 0;
38951
+ }
38952
+ if (!Array.isArray(parsed) || !parsed.every((id) => uuidSchema.safeParse(id).success)) {
38953
+ console.error(`vault_connector_ids cannot be read as a list of connector ids: ${JSON.stringify(raw)}`);
38954
+ process.exit(1);
38955
+ }
38956
+ return parsed;
38957
+ }
38958
+ function resolveVaultGateConnector(arg, usage3) {
38959
+ 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(", ");
38963
+ console.error(arg ? `Refused: the credentials vault holds nothing of connector "${arg}". It holds only: ${known}.` : "A connector is required.");
38964
+ console.error(usage3);
38965
+ process.exit(1);
38966
+ }
38967
+ return id;
38968
+ }
38969
+ async function readVaultGateConfig(client) {
38970
+ try {
38971
+ return readVaultGateList((await client.adminGetConfig()).data);
38972
+ } catch (err) {
38973
+ exitOnApiError(err);
38974
+ throw err;
38975
+ }
38976
+ }
38977
+ async function runVaultGateStatus(positional, flagArgs) {
38978
+ const usage3 = "wayai admin vault-gate status [--json]";
38979
+ if (positional.length > 0) {
38980
+ console.error(usage3);
38981
+ process.exit(1);
38982
+ }
38983
+ const { jsonOutput } = parseBooleanFlags(flagArgs, usage3, ["--json"]);
38984
+ const { config, accessToken } = await requireAuth();
38985
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
38986
+ const ids = await readVaultGateConfig(client);
38987
+ if (jsonOutput) {
38988
+ console.log(JSON.stringify({ vault_connector_ids: ids }, null, 2));
38989
+ return;
38990
+ }
38991
+ console.log(`vault_connector_ids (platform): ${describeVaultGateList(ids)}`);
38992
+ }
38993
+ async function runVaultGateChange(change, positional, flagArgs) {
38994
+ const usage3 = `wayai admin vault-gate ${change} <connector> [--yes] [--json]`;
38995
+ const { yes, jsonOutput } = parseBooleanFlags(flagArgs, usage3, ["--yes", "--json"]);
38996
+ if (positional.length !== 1) {
38997
+ console.error("Name one connector.");
38998
+ console.error(usage3);
38999
+ process.exit(1);
39000
+ }
39001
+ const connectorId = resolveVaultGateConnector(positional[0], usage3);
39002
+ const entry = describeVaultGateEntry(connectorId);
39003
+ const { config, accessToken } = await requireAuth();
39004
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
39005
+ const before = await readVaultGateConfig(client);
39006
+ const listed2 = before.includes(connectorId);
39007
+ if (listed2 === (change === "add")) {
39008
+ if (jsonOutput) {
39009
+ console.log(JSON.stringify({ before, after: before, changed: false }, null, 2));
39010
+ return;
39011
+ }
39012
+ console.log(`Before: ${describeVaultGateList(before)}`);
39013
+ console.log(`${entry} is ${listed2 ? "already" : "not"} listed; nothing was written.`);
39014
+ return;
39015
+ }
39016
+ const next = change === "add" ? [...before, connectorId] : before.filter((id) => id !== connectorId);
39017
+ if (!jsonOutput) console.log(`Before: ${describeVaultGateList(before)}`);
39018
+ 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.`);
39020
+ const ok = await confirm("Proceed?");
39021
+ if (!ok) {
39022
+ console.log("Aborted.");
39023
+ return;
39024
+ }
39025
+ }
39026
+ let after;
39027
+ try {
39028
+ after = readVaultGateList((await client.adminUpdateConfig({ vault_connector_ids: next })).data);
39029
+ } catch (err) {
39030
+ exitOnApiError(err);
39031
+ throw err;
39032
+ }
39033
+ if (jsonOutput) {
39034
+ console.log(JSON.stringify({ before, after, changed: true }, null, 2));
39035
+ return;
39036
+ }
39037
+ console.log(`After: ${describeVaultGateList(after)}`);
39038
+ console.log(PLATFORM_CONFIG_PROPAGATION_NOTE);
39039
+ }
38925
39040
  function conflictReasonOf(err) {
38926
39041
  try {
38927
39042
  const reason = JSON.parse(err.body).details?.reason;
@@ -39479,7 +39594,7 @@ Usage:
39479
39594
  wayai admin do tables <type> <id>
39480
39595
  wayai admin do read <type> <id> <table> [--limit N] [--id X] [--json]
39481
39596
  wayai admin do counts <hub|org> <id> [--json] Numbers, no text: a hub's toolset connections, knowledge placeholders per stored
39482
- text, summary schemas' invariant verdicts, secret columns' shapes and
39597
+ text, summary and kanban context schemas' verdicts, secret columns' shapes and
39483
39598
  (production) publish state; an org's
39484
39599
  skills, hub links, moved-knowledge registry and credentials' shapes
39485
39600
 
@@ -39562,6 +39677,12 @@ Usage:
39562
39677
  wayai admin guide clear [--json] Turn the Guide off: nobody new is enrolled and the help entry is hidden
39563
39678
  wayai admin guide status [--json] Print which hub is the Guide, and its facts
39564
39679
 
39680
+ wayai admin vault-gate status [--json] Print the connectors whose new credentials go to the credentials vault
39681
+ 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
39683
+ wayai admin vault-gate remove <connector> [--yes] [--json]
39684
+ Stop listing it: its new credentials take the existing path again
39685
+
39565
39686
  Sources:
39566
39687
  do Live DO SQLite (existing conversation, hub config, etc.).
39567
39688
  analytics ClickHouse projections (conversation, message, schedule_event).
@@ -39661,6 +39782,11 @@ Sources:
39661
39782
  it from the help entry ("Ask WayAI"); its owning org pays. \`clear\` stops new
39662
39783
  enrollment and hides the help entry; people already enrolled keep their row.
39663
39784
  Changes land within about 60 s.
39785
+ vault-gate The credentials vault's gate, per connector and never per org: the PLATFORM-wide
39786
+ vault_connector_ids list. A listed connector's new credentials go to the vault,
39787
+ the row keeping only a reference; credentials the vault already holds stay there
39788
+ whichever way the gate is set. Only connectors the vault holds anything of are
39789
+ taken: ${[...VAULT_GATE_CONNECTORS.keys()].join(", ")}. Changes land within about 60 s.
39664
39790
 
39665
39791
  Types (do): ${VALID_TYPES.join(" | ")}
39666
39792
  Tables (analytics): ${VALID_ANALYTICS_TABLES.join(" | ")}
@@ -39698,7 +39824,7 @@ Audit + rate limit:
39698
39824
  across all sources. Platform-admin grant required.
39699
39825
  `.trim());
39700
39826
  }
39701
- var VALID_TYPES, VALID_ANALYTICS_TABLES, HARNESS_GATE, VOICE_CALLS_GATE, THREADS_GATE, COMMUNITIES_GATE, PLATFORM_CONFIG_PROPAGATION_NOTE, VALID_NOTICE_SEVERITIES;
39827
+ var VALID_TYPES, VALID_ANALYTICS_TABLES, HARNESS_GATE, VOICE_CALLS_GATE, THREADS_GATE, COMMUNITIES_GATE, PLATFORM_CONFIG_PROPAGATION_NOTE, VAULT_GATE_CONNECTORS, VALID_NOTICE_SEVERITIES;
39702
39828
  var init_admin = __esm({
39703
39829
  "src/commands/admin.ts"() {
39704
39830
  "use strict";
@@ -39739,6 +39865,9 @@ var init_admin = __esm({
39739
39865
  displayName: "Communities"
39740
39866
  };
39741
39867
  PLATFORM_CONFIG_PROPAGATION_NOTE = "Takes effect within about 60 s (the platform-config cache is dropped; KV deletes propagate eventually).";
39868
+ VAULT_GATE_CONNECTORS = /* @__PURE__ */ new Map([
39869
+ ["telegram", "a1b2c3d4-e5f6-4a89-b012-3e5e0d000002"]
39870
+ ]);
39742
39871
  VALID_NOTICE_SEVERITIES = ["critical", "warn", "info"];
39743
39872
  }
39744
39873
  });