@topolo/cli 0.8.5 → 0.8.6

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 +16 -8
  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.11.3/node_modules/@topolo/sdk/dist/index.js
12
+ // ../../node_modules/.pnpm/@topolo+sdk@0.11.4/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);
@@ -2010,11 +2010,12 @@ function compactExample(input2) {
2010
2010
  function compactActionValidation(actionId, validation) {
2011
2011
  return { actionId, valid: validation.valid, errors: validation.errors };
2012
2012
  }
2013
- var ACTION_RESULT_MAX_DEPTH = 4;
2014
- var ACTION_RESULT_MAX_KEYS = 16;
2015
- var ACTION_RESULT_MAX_ITEMS = 5;
2016
- var ACTION_RESULT_MAX_SCALARS = 120;
2017
- var ACTION_RESULT_MAX_STRING = 512;
2013
+ var ACTION_RESULT_MAX_DEPTH = 3;
2014
+ var ACTION_RESULT_MAX_KEYS = 12;
2015
+ var ACTION_RESULT_MAX_ORDINARY_KEYS = 5;
2016
+ var ACTION_RESULT_MAX_ITEMS = 3;
2017
+ var ACTION_RESULT_MAX_SCALARS = 60;
2018
+ var ACTION_RESULT_MAX_STRING = 256;
2018
2019
  function resultKeyPriority(key) {
2019
2020
  if (/^(id|requestId|status|state|url|slug|name|title|version)$/i.test(key)) return 0;
2020
2021
  if (/(Id|Ids|Url|Uri|Status|State|Count|Total|Version|CreatedAt|UpdatedAt)$/i.test(key)) return 1;
@@ -2040,7 +2041,14 @@ function compactResultValue(value, depth, budget) {
2040
2041
  if (typeof value === "object") {
2041
2042
  const record = value;
2042
2043
  const allKeys = Object.keys(record);
2043
- const keys = allKeys.sort((left, right) => resultKeyPriority(left) - resultKeyPriority(right)).slice(0, ACTION_RESULT_MAX_KEYS);
2044
+ const ranked = allKeys.sort((left, right) => resultKeyPriority(left) - resultKeyPriority(right));
2045
+ const prioritized = ranked.filter((key) => resultKeyPriority(key) < 2);
2046
+ const ordinary = ranked.filter((key) => resultKeyPriority(key) === 2);
2047
+ const ordinaryLimit = depth === 0 ? ACTION_RESULT_MAX_ORDINARY_KEYS : prioritized.length ? 1 : ACTION_RESULT_MAX_ORDINARY_KEYS;
2048
+ const keys = [
2049
+ ...prioritized,
2050
+ ...ordinary.slice(0, ordinaryLimit)
2051
+ ].slice(0, ACTION_RESULT_MAX_KEYS);
2044
2052
  const compact = Object.fromEntries(keys.map((key) => [key, compactResultValue(record[key], depth + 1, budget)]));
2045
2053
  if (allKeys.length > keys.length) compact["_omittedKeys"] = allKeys.length - keys.length;
2046
2054
  return compact;
@@ -2350,7 +2358,7 @@ function createTopolo(options) {
2350
2358
  };
2351
2359
  }
2352
2360
 
2353
- // ../../node_modules/.pnpm/@topolo+sdk@0.11.3/node_modules/@topolo/sdk/dist/node/credential-store.js
2361
+ // ../../node_modules/.pnpm/@topolo+sdk@0.11.4/node_modules/@topolo/sdk/dist/node/credential-store.js
2354
2362
  import { mkdir, readFile, writeFile, chmod, rm, stat } from "fs/promises";
2355
2363
  import { existsSync } from "fs";
2356
2364
  import { homedir, platform } from "os";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@topolo/cli",
3
- "version": "0.8.5",
4
- "topoloPublishedVersion": "0.8.5",
3
+ "version": "0.8.6",
4
+ "topoloPublishedVersion": "0.8.6",
5
5
  "description": "Public command-line interface for Topolo customer organizations, developers, and agents.",
6
6
  "license": "UNLICENSED",
7
7
  "author": "Topolo",
@@ -25,8 +25,8 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@modelcontextprotocol/sdk": "^1.0.0",
28
- "@topolo/mcp": "0.11.3",
29
- "@topolo/sdk": "0.11.3",
28
+ "@topolo/mcp": "0.11.4",
29
+ "@topolo/sdk": "0.11.4",
30
30
  "commander": "^12.1.0"
31
31
  },
32
32
  "devDependencies": {