@topolo/cli 0.12.19 → 0.12.20

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 +35 -10
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { platform as platform2 } from "os";
9
9
  import { createInterface } from "readline/promises";
10
10
  import { stdin as input } from "process";
11
11
 
12
- // node_modules/@topolo/sdk/dist/index.js
12
+ // node_modules/.pnpm/@topolo+sdk@0.23.8/node_modules/@topolo/sdk/dist/index.js
13
13
  function applyAuthHeaders(headers, credential) {
14
14
  if (credential.kind === "api_key") {
15
15
  headers.set("X-Api-Key", credential.apiKey);
@@ -466,6 +466,7 @@ async function resolveActionSecrets(value, store, secrets) {
466
466
  async function protectActionResult(value, store, options = {}) {
467
467
  const secrets = /* @__PURE__ */ new Map();
468
468
  function documentation(item, key) {
469
+ if (options.preserveActionSchemas === true && ["inputSchema", "outputSchema", "input_schema", "output_schema"].includes(key) && isRecord(item)) return true;
469
470
  return options.preserveAgentGuidance === true && key === "agentGuidance" && isRecord(item) && item.schemaVersion === 1 && typeof item.kind === "string" && ["action-guide", "product-guide", "concept"].includes(item.kind);
470
471
  }
471
472
  async function protect(item, key = "") {
@@ -796,14 +797,25 @@ function validateNode(schema, value, path, root, errors, depth) {
796
797
  validateNode(selected, value, path, root, errors, depth + 1);
797
798
  }
798
799
  }
799
- if (Array.isArray(schema.anyOf) && !schema.anyOf.some((candidate) => candidateMatches(candidate, value, root, depth))) {
800
- errors.push({ path, code: "any_of", message: "Value does not match any allowed schema." });
801
- return;
800
+ if (Array.isArray(schema.anyOf)) {
801
+ const alternatives = [];
802
+ const matches = schema.anyOf.some((candidate) => {
803
+ const issues = candidateIssues(candidate, value, path, root, depth);
804
+ alternatives.push(issues);
805
+ return issues?.length === 0;
806
+ });
807
+ if (!matches) {
808
+ errors.push({ path, code: "any_of", message: "Value does not match any allowed schema." });
809
+ appendAlternativeIssues(alternatives, errors);
810
+ return;
811
+ }
802
812
  }
803
813
  if (Array.isArray(schema.oneOf)) {
804
- const matches = schema.oneOf.filter((candidate) => candidateMatches(candidate, value, root, depth)).length;
814
+ const alternatives = schema.oneOf.map((candidate) => candidateIssues(candidate, value, path, root, depth));
815
+ const matches = alternatives.filter((issues) => issues?.length === 0).length;
805
816
  if (matches !== 1) {
806
817
  errors.push({ path, code: "one_of", message: "Value must match exactly one allowed schema." });
818
+ if (matches === 0) appendAlternativeIssues(alternatives, errors);
807
819
  return;
808
820
  }
809
821
  }
@@ -905,10 +917,22 @@ function validateNumber(schema, value, path, errors) {
905
917
  }
906
918
  }
907
919
  function candidateMatches(candidate, value, root, depth) {
908
- if (!isRecord2(candidate)) return false;
920
+ return candidateIssues(candidate, value, "$", root, depth)?.length === 0;
921
+ }
922
+ function candidateIssues(candidate, value, path, root, depth) {
923
+ if (!isRecord2(candidate)) return null;
909
924
  const issues = [];
910
- validateNode(candidate, value, "$", root, issues, depth + 1);
911
- return issues.length === 0;
925
+ validateNode(candidate, value, path, root, issues, depth + 1);
926
+ return issues;
927
+ }
928
+ function appendAlternativeIssues(alternatives, errors) {
929
+ const seen = /* @__PURE__ */ new Set();
930
+ for (const issue22 of alternatives.flatMap((issues) => issues ?? [])) {
931
+ const key = JSON.stringify(issue22);
932
+ if (seen.has(key)) continue;
933
+ seen.add(key);
934
+ errors.push(issue22);
935
+ }
912
936
  }
913
937
  function resolveLocalReference(root, reference) {
914
938
  if (!reference.startsWith("#/")) return null;
@@ -2200,7 +2224,8 @@ var TopoloClient = class _TopoloClient {
2200
2224
  throw maskActionSecretError(error, this.actionSecrets);
2201
2225
  }
2202
2226
  return preserveSensitiveResult ? result : await protectActionResult(result, this.actionSecretStore, {
2203
- preserveAgentGuidance: entry.appId === "app_topolo_docs"
2227
+ preserveAgentGuidance: entry.appId === "app_topolo_docs",
2228
+ preserveActionSchemas: entry.appId === "app_topolo_developers" && entry.name === "apps.actions.list"
2204
2229
  });
2205
2230
  }
2206
2231
  async releaseActionSecret(reference) {
@@ -3524,7 +3549,7 @@ function createTopolo(options) {
3524
3549
  };
3525
3550
  }
3526
3551
 
3527
- // node_modules/@topolo/sdk/dist/node/credential-store.js
3552
+ // node_modules/.pnpm/@topolo+sdk@0.23.8/node_modules/@topolo/sdk/dist/node/credential-store.js
3528
3553
  import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2, chmod as chmod2, rm as rm2, stat } from "fs/promises";
3529
3554
  import { existsSync as existsSync2 } from "fs";
3530
3555
  import { homedir as homedir2, platform } from "os";
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.19",
5
- "topoloPublishedVersion": "0.12.19",
4
+ "version": "0.12.20",
5
+ "topoloPublishedVersion": "0.12.20",
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.11",
32
- "@topolo/sdk": "0.23.6",
31
+ "@topolo/mcp": "0.14.12",
32
+ "@topolo/sdk": "0.23.8",
33
33
  "commander": "^12.1.0"
34
34
  },
35
35
  "devDependencies": {