@topolo/cli 0.12.1 → 0.12.2

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 +28 -12
  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.21.1/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);
@@ -3342,7 +3342,7 @@ function createTopolo(options) {
3342
3342
  };
3343
3343
  }
3344
3344
 
3345
- // node_modules/@topolo/sdk/dist/node/credential-store.js
3345
+ // node_modules/.pnpm/@topolo+sdk@0.21.1/node_modules/@topolo/sdk/dist/node/credential-store.js
3346
3346
  import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2, chmod as chmod2, rm as rm2, stat } from "fs/promises";
3347
3347
  import { existsSync as existsSync2 } from "fs";
3348
3348
  import { homedir as homedir2, platform } from "os";
@@ -3760,6 +3760,22 @@ function topoloServiceOrigins2(serviceUrls, environment) {
3760
3760
  );
3761
3761
  }
3762
3762
  var KEYCHAIN_SERVICE = "topolo-external-agent-installation";
3763
+ var MACOS_KEYCHAIN_WRITE_SCRIPT = [
3764
+ "log_user 0",
3765
+ "set timeout 10",
3766
+ "set secret [gets stdin]",
3767
+ "spawn -noecho /usr/bin/security add-generic-password -U -a $env(TOPOLO_KEYCHAIN_ACCOUNT) -s $env(TOPOLO_KEYCHAIN_SERVICE) -w",
3768
+ "for {set prompt 0} {$prompt < 2} {incr prompt} {",
3769
+ " expect {",
3770
+ ' -re {(?i)password} { send -- "$secret\\r" }',
3771
+ " timeout { exit 70 }",
3772
+ " eof { exit 71 }",
3773
+ " }",
3774
+ "}",
3775
+ "expect eof",
3776
+ "set result [wait]",
3777
+ "exit [lindex $result 3]"
3778
+ ].join("\n");
3763
3779
  function installationStorePath() {
3764
3780
  const override = process.env.TOPOLO_INSTALLATIONS_PATH?.trim();
3765
3781
  if (override) return override;
@@ -3786,16 +3802,16 @@ function createPlatformInstallationSecretBackend(options = {}) {
3786
3802
  if (platform22 === "darwin") {
3787
3803
  return {
3788
3804
  async set(account, value) {
3789
- runOrThrow(spawn2("security", [
3790
- "add-generic-password",
3791
- "-U",
3792
- "-a",
3793
- account,
3794
- "-s",
3795
- KEYCHAIN_SERVICE,
3796
- "-w"
3797
- ], { input: `${value}
3798
- `, encoding: "utf8" }), "macOS Keychain write");
3805
+ runOrThrow(spawn2("/usr/bin/expect", ["-c", MACOS_KEYCHAIN_WRITE_SCRIPT], {
3806
+ input: `${value}
3807
+ `,
3808
+ encoding: "utf8",
3809
+ env: {
3810
+ ...process.env,
3811
+ TOPOLO_KEYCHAIN_ACCOUNT: account,
3812
+ TOPOLO_KEYCHAIN_SERVICE: KEYCHAIN_SERVICE
3813
+ }
3814
+ }), "macOS Keychain write");
3799
3815
  },
3800
3816
  async get(account) {
3801
3817
  const result = spawn2("security", [
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.1",
5
- "topoloPublishedVersion": "0.12.1",
4
+ "version": "0.12.2",
5
+ "topoloPublishedVersion": "0.12.2",
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.13.0",
32
- "@topolo/sdk": "0.21.0",
31
+ "@topolo/mcp": "0.13.1",
32
+ "@topolo/sdk": "0.21.1",
33
33
  "commander": "^12.1.0"
34
34
  },
35
35
  "devDependencies": {