@wayai/cli 0.3.288 → 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
@@ -12553,10 +12553,10 @@ var init_chunk_7CYHPF35 = __esm({
12553
12553
  }
12554
12554
  });
12555
12555
 
12556
- // ../../packages/core/dist/chunk-BPCNB5RT.js
12556
+ // ../../packages/core/dist/chunk-NETRUHZF.js
12557
12557
  var getConversationsQuery, getMessagesQuery;
12558
- var init_chunk_BPCNB5RT = __esm({
12559
- "../../packages/core/dist/chunk-BPCNB5RT.js"() {
12558
+ var init_chunk_NETRUHZF = __esm({
12559
+ "../../packages/core/dist/chunk-NETRUHZF.js"() {
12560
12560
  "use strict";
12561
12561
  init_zod();
12562
12562
  getConversationsQuery = external_exports.object({
@@ -16394,7 +16394,7 @@ var init_contracts = __esm({
16394
16394
  init_chunk_PZPOUXJR();
16395
16395
  init_chunk_E4DIIOOE();
16396
16396
  init_chunk_7CYHPF35();
16397
- init_chunk_BPCNB5RT();
16397
+ init_chunk_NETRUHZF();
16398
16398
  init_chunk_YN7UXGAP();
16399
16399
  init_chunk_YI3ORIXJ();
16400
16400
  init_chunk_HRKVCI5A();
@@ -39064,7 +39064,7 @@ async function runGuideStatus(positional, flagArgs) {
39064
39064
  console.log(`Environment: ${data.hub.hub_environment ?? "unknown"}; type: ${data.hub.hub_type ?? "unknown"}; app channel: ${data.hub.app_channel_enabled ? "enabled" : "DISABLED"}`);
39065
39065
  }
39066
39066
  function vaultGateConnectorName(connectorId) {
39067
- 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;
39068
39068
  return null;
39069
39069
  }
39070
39070
  function describeVaultGateEntry(connectorId) {
@@ -39091,14 +39091,14 @@ function readVaultGateList(data) {
39091
39091
  }
39092
39092
  function resolveVaultGateConnector(arg, usage3) {
39093
39093
  const wanted = (arg ?? "").trim().toLowerCase();
39094
- const id = VAULT_GATE_CONNECTORS.get(wanted) ?? (vaultGateConnectorName(wanted) ? wanted : null);
39095
- if (!id) {
39096
- 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(", ");
39097
39097
  console.error(arg ? `Refused: the credentials vault holds nothing of connector "${arg}". It holds only: ${known}.` : "A connector is required.");
39098
39098
  console.error(usage3);
39099
39099
  process.exit(1);
39100
39100
  }
39101
- return id;
39101
+ return ids;
39102
39102
  }
39103
39103
  async function readVaultGateConfig(client) {
39104
39104
  try {
@@ -39132,25 +39132,25 @@ async function runVaultGateChange(change, positional, flagArgs) {
39132
39132
  console.error(usage3);
39133
39133
  process.exit(1);
39134
39134
  }
39135
- const connectorId = resolveVaultGateConnector(positional[0], usage3);
39136
- const entry = describeVaultGateEntry(connectorId);
39135
+ const connectorIds = resolveVaultGateConnector(positional[0], usage3);
39136
+ const entry = connectorIds.map(describeVaultGateEntry).join(", ");
39137
39137
  const { config, accessToken } = await requireAuth();
39138
39138
  const client = new ApiClient({ apiUrl: config.api_url, accessToken });
39139
39139
  const before = await readVaultGateConfig(client);
39140
- const listed2 = before.includes(connectorId);
39141
- if (listed2 === (change === "add")) {
39140
+ const toChange = connectorIds.filter((id) => before.includes(id) !== (change === "add"));
39141
+ if (toChange.length === 0) {
39142
39142
  if (jsonOutput) {
39143
39143
  console.log(JSON.stringify({ before, after: before, changed: false }, null, 2));
39144
39144
  return;
39145
39145
  }
39146
39146
  console.log(`Before: ${describeVaultGateList(before)}`);
39147
- 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.`);
39148
39148
  return;
39149
39149
  }
39150
- const next = change === "add" ? [...before, connectorId] : before.filter((id) => id !== connectorId);
39150
+ const next = change === "add" ? [...before, ...toChange] : before.filter((id) => !toChange.includes(id));
39151
39151
  if (!jsonOutput) console.log(`Before: ${describeVaultGateList(before)}`);
39152
39152
  if (!yes && !jsonOutput) {
39153
- 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.`);
39154
39154
  const ok = await confirm("Proceed?");
39155
39155
  if (!ok) {
39156
39156
  console.log("Aborted.");
@@ -39819,7 +39819,7 @@ Usage:
39819
39819
 
39820
39820
  wayai admin vault-gate status [--json] Print the connectors whose new credentials go to the credentials vault
39821
39821
  wayai admin vault-gate add <connector> [--yes] [--json]
39822
- 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
39823
39823
  wayai admin vault-gate remove <connector> [--yes] [--json]
39824
39824
  Stop listing it: its new credentials take the existing path again
39825
39825
 
@@ -40006,7 +40006,12 @@ var init_admin = __esm({
40006
40006
  };
40007
40007
  PLATFORM_CONFIG_PROPAGATION_NOTE = "Takes effect within about 60 s (the platform-config cache is dropped; KV deletes propagate eventually).";
40008
40008
  VAULT_GATE_CONNECTORS = /* @__PURE__ */ new Map([
40009
- ["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
+ ]]
40010
40015
  ]);
40011
40016
  VALID_NOTICE_SEVERITIES = ["critical", "warn", "info"];
40012
40017
  }