@wayai/cli 0.3.288 → 0.3.290

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();
@@ -38507,6 +38507,20 @@ async function runVaultImport(flagArgs) {
38507
38507
  console.log(` value ${v.field} \u2192 ${v.secret_id ?? "-"}: ${v.outcome}${v.code ? ` (${v.code})` : ""}`);
38508
38508
  for (const r of v.rows) console.log(` hub=${r.hub_id} connection=${r.connection_id}: ${r.outcome}`);
38509
38509
  }
38510
+ const credentials = data.credentials ?? [];
38511
+ if (credentials.length > 0) {
38512
+ console.log(`org credentials: ${credentials.length} credentials_remaining=${data.credentials_remaining ?? 0}`);
38513
+ for (const r of data.credential_reasons ?? []) console.log(` stays (${r.reason}): ${r.credentials}`);
38514
+ for (const c of credentials) {
38515
+ const reasons = c.reasons.length > 0 ? ` (${c.reasons.join(", ")})` : "";
38516
+ console.log(` credential ${c.credential_id} ${c.field} \u2192 ${c.secret_id ?? "-"}: ${c.outcome}${reasons}${c.code ? ` (${c.code})` : ""}${c.credential_row ? ` credential_row=${c.credential_row}` : ""}`);
38517
+ for (const r of c.rows) console.log(` hub=${r.hub_id} connection=${r.connection_id}: ${r.outcome}`);
38518
+ for (const r of c.stale_rows) console.log(` stale: hub=${r.hub_id} connection=${r.connection_id}`);
38519
+ }
38520
+ if (credentials.some((c) => c.reasons.includes("stale_row"))) {
38521
+ console.log("A credential with a stale row moves once `wayai admin hubs repair-credential-links --org <org_id> --apply` writes its current value.");
38522
+ }
38523
+ }
38510
38524
  printVaultReport(data);
38511
38525
  }
38512
38526
  async function runVaultRevert(flagArgs) {
@@ -38538,6 +38552,10 @@ async function runVaultRevert(flagArgs) {
38538
38552
  console.log(` value ${v.field} \u2190 ${v.secret_id}${v.code ? `: ${v.code}` : ""}`);
38539
38553
  for (const r of v.rows) console.log(` hub=${r.hub_id} connection=${r.connection_id}: ${r.outcome}`);
38540
38554
  }
38555
+ for (const c of data.credentials ?? []) {
38556
+ console.log(` credential ${c.credential_id} ${c.field} \u2190 ${c.secret_id}${c.code ? `: ${c.code}` : ""}${c.credential_row ? ` credential_row=${c.credential_row}` : ""}`);
38557
+ for (const r of c.rows) console.log(` hub=${r.hub_id} connection=${r.connection_id}: ${r.outcome}`);
38558
+ }
38541
38559
  printVaultReport(data);
38542
38560
  }
38543
38561
  async function runRepairBranchingOrphans(flagArgs) {
@@ -39064,7 +39082,7 @@ async function runGuideStatus(positional, flagArgs) {
39064
39082
  console.log(`Environment: ${data.hub.hub_environment ?? "unknown"}; type: ${data.hub.hub_type ?? "unknown"}; app channel: ${data.hub.app_channel_enabled ? "enabled" : "DISABLED"}`);
39065
39083
  }
39066
39084
  function vaultGateConnectorName(connectorId) {
39067
- for (const [name, id] of VAULT_GATE_CONNECTORS) if (id === connectorId) return name;
39085
+ for (const [name, ids] of VAULT_GATE_CONNECTORS) if (ids.includes(connectorId)) return name;
39068
39086
  return null;
39069
39087
  }
39070
39088
  function describeVaultGateEntry(connectorId) {
@@ -39091,14 +39109,14 @@ function readVaultGateList(data) {
39091
39109
  }
39092
39110
  function resolveVaultGateConnector(arg, usage3) {
39093
39111
  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(", ");
39112
+ const ids = VAULT_GATE_CONNECTORS.get(wanted) ?? (vaultGateConnectorName(wanted) ? [wanted] : null);
39113
+ if (!ids) {
39114
+ const known = [...VAULT_GATE_CONNECTORS].map(([name, cids]) => `${name} (${cids.join(", ")})`).join(", ");
39097
39115
  console.error(arg ? `Refused: the credentials vault holds nothing of connector "${arg}". It holds only: ${known}.` : "A connector is required.");
39098
39116
  console.error(usage3);
39099
39117
  process.exit(1);
39100
39118
  }
39101
- return id;
39119
+ return ids;
39102
39120
  }
39103
39121
  async function readVaultGateConfig(client) {
39104
39122
  try {
@@ -39132,25 +39150,25 @@ async function runVaultGateChange(change, positional, flagArgs) {
39132
39150
  console.error(usage3);
39133
39151
  process.exit(1);
39134
39152
  }
39135
- const connectorId = resolveVaultGateConnector(positional[0], usage3);
39136
- const entry = describeVaultGateEntry(connectorId);
39153
+ const connectorIds = resolveVaultGateConnector(positional[0], usage3);
39154
+ const entry = connectorIds.map(describeVaultGateEntry).join(", ");
39137
39155
  const { config, accessToken } = await requireAuth();
39138
39156
  const client = new ApiClient({ apiUrl: config.api_url, accessToken });
39139
39157
  const before = await readVaultGateConfig(client);
39140
- const listed2 = before.includes(connectorId);
39141
- if (listed2 === (change === "add")) {
39158
+ const toChange = connectorIds.filter((id) => before.includes(id) !== (change === "add"));
39159
+ if (toChange.length === 0) {
39142
39160
  if (jsonOutput) {
39143
39161
  console.log(JSON.stringify({ before, after: before, changed: false }, null, 2));
39144
39162
  return;
39145
39163
  }
39146
39164
  console.log(`Before: ${describeVaultGateList(before)}`);
39147
- console.log(`${entry} is ${listed2 ? "already" : "not"} listed; nothing was written.`);
39165
+ console.log(`${entry} ${connectorIds.length === 1 ? "is" : "are"} ${change === "add" ? "already" : "not"} listed; nothing was written.`);
39148
39166
  return;
39149
39167
  }
39150
- const next = change === "add" ? [...before, connectorId] : before.filter((id) => id !== connectorId);
39168
+ const next = change === "add" ? [...before, ...toChange] : before.filter((id) => !toChange.includes(id));
39151
39169
  if (!jsonOutput) console.log(`Before: ${describeVaultGateList(before)}`);
39152
39170
  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.`);
39171
+ 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
39172
  const ok = await confirm("Proceed?");
39155
39173
  if (!ok) {
39156
39174
  console.log("Aborted.");
@@ -39783,7 +39801,7 @@ Usage:
39783
39801
  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
39784
39802
 
39785
39803
  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
39804
+ 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, moves each org credential with the rows it supplies when all of them may move (else names why it stays), and keeps the old ciphertext 30 days for revert. Re-run until values_remaining and credentials_remaining are 0. Lists Telegram bots to enable again
39787
39805
 
39788
39806
  wayai admin vault revert --org <org_id> --connector <connector_id> [--apply] [--yes] [--json]
39789
39807
  Put back what vault import moved, within 30 days, and erase the vault entries no row names. A dry run by default
@@ -39819,7 +39837,7 @@ Usage:
39819
39837
 
39820
39838
  wayai admin vault-gate status [--json] Print the connectors whose new credentials go to the credentials vault
39821
39839
  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
39840
+ 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
39841
  wayai admin vault-gate remove <connector> [--yes] [--json]
39824
39842
  Stop listing it: its new credentials take the existing path again
39825
39843
 
@@ -40006,7 +40024,12 @@ var init_admin = __esm({
40006
40024
  };
40007
40025
  PLATFORM_CONFIG_PROPAGATION_NOTE = "Takes effect within about 60 s (the platform-config cache is dropped; KV deletes propagate eventually).";
40008
40026
  VAULT_GATE_CONNECTORS = /* @__PURE__ */ new Map([
40009
- ["telegram", "a1b2c3d4-e5f6-4a89-b012-3e5e0d000002"]
40027
+ ["telegram", ["a1b2c3d4-e5f6-4a89-b012-3e5e0d000002"]],
40028
+ ["openai", [
40029
+ "0cd6a292-895b-4667-b89e-dd298628c272",
40030
+ "c3d4e5f6-7a8b-4c9d-0e1f-2a3b4c5d6e7f",
40031
+ "b2c3d4e5-f6a7-4b89-c012-3456789abcdf"
40032
+ ]]
40010
40033
  ]);
40011
40034
  VALID_NOTICE_SEVERITIES = ["critical", "warn", "info"];
40012
40035
  }