@bike4mind/cli 0.20.1 → 0.20.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.
- package/dist/{AgentHistoryStore-BQiATPsQ.mjs → AgentHistoryStore-T7Oh84Yn.mjs} +1174 -313
- package/dist/{ApiClient-BPmlalut.mjs → ApiClient-BopvMmQk.mjs} +5 -5
- package/dist/{ConfigStore-CNfbeaJf.mjs → ConfigStore-cIyF7hDg.mjs} +732 -89
- package/dist/ProxyManager-B1jFWL7b.mjs +3 -0
- package/dist/{buildAgent-DwPvcTpz.mjs → buildAgent-P0tOMLt1.mjs} +3 -3
- package/dist/commands/acpCommand.mjs +4 -4
- package/dist/commands/apiCommand.mjs +1 -1
- package/dist/commands/doctorCommand.mjs +1 -1
- package/dist/commands/envCommand.mjs +1 -1
- package/dist/commands/headlessCommand.mjs +4 -4
- package/dist/commands/mcpCommand.mjs +3 -3
- package/dist/commands/pluginCommand.mjs +1 -1
- package/dist/commands/updateCommand.mjs +1 -1
- package/dist/index.mjs +44 -13
- package/dist/{package-CxHSRXdp.mjs → package-CnVCHR3U.mjs} +1 -1
- package/dist/{serve-Du3HiqAH.mjs → serve-BocVOJ3W.mjs} +2 -2
- package/package.json +8 -8
- package/dist/ProxyManager-Bqr7Lmsd.mjs +0 -3
- package/dist/{ProxyManager-C5H0pUyK.mjs → ProxyManager-C1-lgzEU.mjs} +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as logger, t as ConfigStore } from "./ConfigStore-
|
|
3
|
-
import { t as version } from "./package-
|
|
2
|
+
import { n as logger, t as ConfigStore } from "./ConfigStore-cIyF7hDg.mjs";
|
|
3
|
+
import { t as version } from "./package-CnVCHR3U.mjs";
|
|
4
4
|
import axios, { isAxiosError } from "axios";
|
|
5
5
|
//#region src/auth/OAuthClient.ts
|
|
6
6
|
/**
|
|
@@ -162,8 +162,8 @@ var ApiClient = class {
|
|
|
162
162
|
try {
|
|
163
163
|
const tokens = await this.configStore.getAuthTokens();
|
|
164
164
|
if (!tokens) throw new Error("Not authenticated");
|
|
165
|
-
if (
|
|
166
|
-
logger.debug("AUTH: Access token
|
|
165
|
+
if (new Date(tokens.expiresAt).getTime() > Date.now()) {
|
|
166
|
+
logger.debug("AUTH: Access token has not expired, skipping refresh - 401 is likely transient");
|
|
167
167
|
return Promise.reject(error);
|
|
168
168
|
}
|
|
169
169
|
logger.debug("AUTH: Attempting token refresh");
|
|
@@ -172,7 +172,7 @@ var ApiClient = class {
|
|
|
172
172
|
const expiresAt = new Date(Date.now() + newTokens.expires_in * 1e3).toISOString();
|
|
173
173
|
await this.configStore.setAuthTokens({
|
|
174
174
|
accessToken: newTokens.access_token,
|
|
175
|
-
refreshToken: newTokens.refresh_token,
|
|
175
|
+
refreshToken: newTokens.refresh_token ?? tokens.refreshToken,
|
|
176
176
|
expiresAt,
|
|
177
177
|
userId: tokens.userId
|
|
178
178
|
});
|