@topolo/cli 0.12.24 → 0.12.26

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -5
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -487,20 +487,26 @@ async function protectActionResult(value, store, options = {}) {
487
487
  if (options.preserveActionContracts === true && ["agentContract", "agent_contract"].includes(key) && isRecord(item)) return true;
488
488
  return options.preserveAgentGuidance === true && key === "agentGuidance" && isRecord(item) && item.schemaVersion === 1 && typeof item.kind === "string" && ["action-guide", "product-guide", "concept"].includes(item.kind);
489
489
  }
490
- async function protect(item, key = "") {
490
+ function localizationMap(path) {
491
+ const location = path.join("/");
492
+ if (options.localizationAction === "sources.verify") return location === "data/hashes";
493
+ if (options.localizationAction === "values.bulk_upsert") return location === "data/sourceHashes";
494
+ return ["translation.release.prepare", "translation.release.import", "translation.release.get"].includes(options.localizationAction ?? "") && /^data\/bundle\/catalogs\/\*\/(sources|(?:packs|provenance)\/[^/]+)$/.test(location);
495
+ }
496
+ async function protect(item, key = "", path = []) {
491
497
  if (documentation(item, key)) return item;
492
498
  if (isActionSecretReference(item)) return item;
493
499
  if (Array.isArray(item) && /(?:backup|recovery)codes$/.test(key.toLowerCase().replace(/[^a-z0-9]/g, ""))) {
494
- return Promise.all(item.map((child) => protect(child, key)));
500
+ return Promise.all(item.map((child) => protect(child, key, [...path, "*"])));
495
501
  }
496
502
  if (sensitive(key, item)) {
497
503
  const reference = store ? await store.save(item) : "[REDACTED]";
498
504
  if (typeof item === "string" && item) secrets.set(item, reference);
499
505
  return reference;
500
506
  }
501
- if (Array.isArray(item)) return Promise.all(item.map((child) => protect(child)));
507
+ if (Array.isArray(item)) return Promise.all(item.map((child) => protect(child, "", [...path, "*"])));
502
508
  if (!isRecord(item)) return item;
503
- return Object.fromEntries(await Promise.all(Object.entries(item).map(async ([name, child]) => [name, await protect(child, name)])));
509
+ return Object.fromEntries(await Promise.all(Object.entries(item).map(async ([name, child]) => [name, await protect(child, localizationMap(path) ? "" : name, [...path, name])])));
504
510
  }
505
511
  const protectedValue = await protect(value);
506
512
  async function protectEmbedded(item, key = "") {
@@ -2244,7 +2250,8 @@ var TopoloClient = class _TopoloClient {
2244
2250
  return preserveSensitiveResult ? result : await protectActionResult(result, this.actionSecretStore, {
2245
2251
  preserveAgentGuidance: entry.appId === "app_topolo_docs",
2246
2252
  preserveActionSchemas: entry.appId === "app_topolo_developers" && entry.name === "apps.actions.list",
2247
- preserveActionContracts: entry.appId === "app_topolo_developers" && entry.name === "apps.actions.list"
2253
+ preserveActionContracts: entry.appId === "app_topolo_developers" && entry.name === "apps.actions.list",
2254
+ localizationAction: entry.appId === "app_topolo_localize" ? entry.name : void 0
2248
2255
  });
2249
2256
  }
2250
2257
  async releaseActionSecret(reference) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@topolo/cli",
3
3
  "packageManager": "pnpm@10.17.1",
4
- "version": "0.12.24",
5
- "topoloPublishedVersion": "0.12.24",
4
+ "version": "0.12.26",
5
+ "topoloPublishedVersion": "0.12.26",
6
6
  "description": "Public command-line interface for Topolo customer organizations, developers, and agents.",
7
7
  "license": "UNLICENSED",
8
8
  "author": "Topolo",
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@modelcontextprotocol/sdk": "^1.0.0",
31
- "@topolo/mcp": "0.14.15",
32
- "@topolo/sdk": "0.23.11",
31
+ "@topolo/mcp": "0.14.17",
32
+ "@topolo/sdk": "0.23.13",
33
33
  "commander": "^12.1.0"
34
34
  },
35
35
  "devDependencies": {