agent-mp 0.4.8 → 0.4.9

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.
@@ -225,6 +225,9 @@ export async function qwenAuthStatus() {
225
225
  const token = await loadToken();
226
226
  if (!token)
227
227
  return { authenticated: false };
228
+ // Verify token is not expired (loadToken already refreshes if close to expiry)
229
+ if (token.expiresAt > 0 && token.expiresAt < Date.now())
230
+ return { authenticated: false };
228
231
  return { authenticated: true };
229
232
  }
230
233
  export async function fetchQwenModels() {
@@ -232,7 +235,8 @@ export async function fetchQwenModels() {
232
235
  if (!token)
233
236
  return [];
234
237
  try {
235
- const res = await fetch('https://chat.qwen.ai/api/models', {
238
+ const host = token.resourceUrl ? `https://${token.resourceUrl}` : 'https://chat.qwen.ai';
239
+ const res = await fetch(`${host}/api/models`, {
236
240
  headers: { Authorization: `Bearer ${token.accessToken}` },
237
241
  });
238
242
  if (!res.ok)
@@ -249,7 +253,8 @@ export async function getQwenAccessToken() {
249
253
  return token?.accessToken || null;
250
254
  }
251
255
  async function callQwenAPIWithToken(token, prompt, model, onData) {
252
- const baseUrl = 'https://chat.qwen.ai/api/v1';
256
+ const host = token.resourceUrl ? `https://${token.resourceUrl}` : 'https://chat.qwen.ai';
257
+ const baseUrl = `${host}/api/v1`;
253
258
  const useStream = !!onData;
254
259
  const response = await fetch(`${baseUrl}/chat/completions`, {
255
260
  method: 'POST',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-mp",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "Deterministic multi-agent CLI orchestrator — plan, code, review",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",