@topolo/cli 0.12.16 → 0.12.18

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 +22 -2
  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/.pnpm/@topolo+sdk@0.23.3/node_modules/@topolo/sdk/dist/index.js
12
+ // 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);
@@ -692,6 +692,9 @@ var SUPPORTED_SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
692
692
  "allOf",
693
693
  "anyOf",
694
694
  "oneOf",
695
+ "if",
696
+ "then",
697
+ "else",
695
698
  "properties",
696
699
  "required",
697
700
  "additionalProperties",
@@ -731,6 +734,11 @@ function inspectSchema(schema, path, root, depth) {
731
734
  if (typeof schema.$ref === "string" && !resolveLocalReference(root, schema.$ref)) {
732
735
  return { path, code: "unsupported_schema_ref", message: `Cannot resolve schema reference ${schema.$ref}.` };
733
736
  }
737
+ for (const keyword of ["if", "then", "else"]) {
738
+ if (Object.prototype.hasOwnProperty.call(schema, keyword) && typeof schema[keyword] !== "boolean" && !isRecord2(schema[keyword])) {
739
+ return { path: `${path}.${keyword}`, code: "invalid_conditional_schema", message: "Conditional schemas must be objects or booleans." };
740
+ }
741
+ }
734
742
  const children = [];
735
743
  if (isRecord2(schema.properties)) children.push(...Object.entries(schema.properties));
736
744
  if (isRecord2(schema.$defs)) children.push(...Object.entries(schema.$defs));
@@ -739,6 +747,9 @@ function inspectSchema(schema, path, root, depth) {
739
747
  ["additionalProperties", schema.additionalProperties],
740
748
  ["propertyNames", schema.propertyNames],
741
749
  ["items", schema.items],
750
+ ["if", schema.if],
751
+ ["then", schema.then],
752
+ ["else", schema.else],
742
753
  ...arraySchemaEntries("allOf", schema.allOf),
743
754
  ...arraySchemaEntries("anyOf", schema.anyOf),
744
755
  ...arraySchemaEntries("oneOf", schema.oneOf)
@@ -771,6 +782,15 @@ function validateNode(schema, value, path, root, errors, depth) {
771
782
  if (isRecord2(candidate)) validateNode(candidate, value, path, root, errors, depth + 1);
772
783
  }
773
784
  }
785
+ if (Object.prototype.hasOwnProperty.call(schema, "if")) {
786
+ const matches = schema.if === true || isRecord2(schema.if) && candidateMatches(schema.if, value, root, depth);
787
+ const selected = matches ? schema.then : schema.else;
788
+ if (selected === false) {
789
+ errors.push({ path, code: "conditional_schema", message: "Value is rejected by the selected conditional schema." });
790
+ } else if (isRecord2(selected)) {
791
+ validateNode(selected, value, path, root, errors, depth + 1);
792
+ }
793
+ }
774
794
  if (Array.isArray(schema.anyOf) && !schema.anyOf.some((candidate) => candidateMatches(candidate, value, root, depth))) {
775
795
  errors.push({ path, code: "any_of", message: "Value does not match any allowed schema." });
776
796
  return;
@@ -3497,7 +3517,7 @@ function createTopolo(options) {
3497
3517
  };
3498
3518
  }
3499
3519
 
3500
- // node_modules/.pnpm/@topolo+sdk@0.23.3/node_modules/@topolo/sdk/dist/node/credential-store.js
3520
+ // node_modules/@topolo/sdk/dist/node/credential-store.js
3501
3521
  import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2, chmod as chmod2, rm as rm2, stat } from "fs/promises";
3502
3522
  import { existsSync as existsSync2 } from "fs";
3503
3523
  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.16",
5
- "topoloPublishedVersion": "0.12.16",
4
+ "version": "0.12.18",
5
+ "topoloPublishedVersion": "0.12.18",
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.8",
32
- "@topolo/sdk": "0.23.3",
31
+ "@topolo/mcp": "0.14.10",
32
+ "@topolo/sdk": "0.23.5",
33
33
  "commander": "^12.1.0"
34
34
  },
35
35
  "devDependencies": {