@topolo/cli 0.12.31 → 0.12.32
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.
- package/dist/index.js +9 -3
- 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.
|
|
12
|
+
// node_modules/.pnpm/@topolo+sdk@0.23.17/node_modules/@topolo/sdk/dist/index.js
|
|
13
13
|
function record(value) {
|
|
14
14
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
15
15
|
}
|
|
@@ -3610,7 +3610,7 @@ async function pollUntilApproved(params) {
|
|
|
3610
3610
|
throw new Error("Device code expired. Run `topolo auth login` again.");
|
|
3611
3611
|
}
|
|
3612
3612
|
|
|
3613
|
-
// node_modules/.pnpm/@topolo+sdk@0.23.
|
|
3613
|
+
// node_modules/.pnpm/@topolo+sdk@0.23.17/node_modules/@topolo/sdk/dist/node/credential-store.js
|
|
3614
3614
|
import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2, chmod as chmod2, rm as rm2, stat } from "fs/promises";
|
|
3615
3615
|
import { existsSync as existsSync2 } from "fs";
|
|
3616
3616
|
import { homedir as homedir2, platform } from "os";
|
|
@@ -4507,7 +4507,9 @@ async function refreshCredentialIfNeeded(environment = selectedEnvironment(), op
|
|
|
4507
4507
|
if (process.env[`${prefix}_API_KEY`] || process.env[`${prefix}_ACCESS_TOKEN`] || environment === "production" && process.env.TOPOLO_API_KEY || environment === "production" && process.env.TOPOLO_ACCESS_TOKEN) {
|
|
4508
4508
|
return resolveCredential(environment);
|
|
4509
4509
|
}
|
|
4510
|
-
const
|
|
4510
|
+
const observedProfile = profileForEnvironment(await readConfig(), environment);
|
|
4511
|
+
const observed = observedProfile.credential;
|
|
4512
|
+
if (!observed || observed.kind !== "access_token" || !observed.refreshToken || !observedProfile.oauthClientId || !options.force && observed.expiresAt && observed.expiresAt - REFRESH_SKEW_SECONDS > Math.floor(Date.now() / 1e3)) return observed ?? null;
|
|
4511
4513
|
return withConfigWriteLock(async () => {
|
|
4512
4514
|
const config = await readConfig();
|
|
4513
4515
|
const profile = profileForEnvironment(config, environment);
|
|
@@ -4561,6 +4563,10 @@ async function refreshCredentialIfNeeded(environment = selectedEnvironment(), op
|
|
|
4561
4563
|
});
|
|
4562
4564
|
}
|
|
4563
4565
|
async function refreshContextCredentialIfNeeded(environment, key, options = {}) {
|
|
4566
|
+
const observedProfile = profileForEnvironment(await readConfig(), environment);
|
|
4567
|
+
const observedContext = observedProfile.contexts?.[key];
|
|
4568
|
+
const observed = observedContext?.credential;
|
|
4569
|
+
if (!observed || observed.kind !== "access_token" || !observed.refreshToken || !(observedContext.oauthClientId ?? observedProfile.oauthClientId) || !options.force && observed.expiresAt && observed.expiresAt - REFRESH_SKEW_SECONDS > Math.floor(Date.now() / 1e3)) return observed ?? null;
|
|
4564
4570
|
return withConfigWriteLock(async () => {
|
|
4565
4571
|
const config = await readConfig();
|
|
4566
4572
|
const profile = profileForEnvironment(config, environment);
|
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.
|
|
5
|
-
"topoloPublishedVersion": "0.12.
|
|
4
|
+
"version": "0.12.32",
|
|
5
|
+
"topoloPublishedVersion": "0.12.32",
|
|
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.
|
|
32
|
-
"@topolo/sdk": "0.23.
|
|
31
|
+
"@topolo/mcp": "0.14.22",
|
|
32
|
+
"@topolo/sdk": "0.23.17",
|
|
33
33
|
"commander": "^12.1.0",
|
|
34
34
|
"undici": "6.29.0"
|
|
35
35
|
},
|