@ghl-ai/aw 0.1.35-beta.30 → 0.1.35-beta.31
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/mcp.mjs +12 -6
- package/package.json +1 -1
package/mcp.mjs
CHANGED
|
@@ -207,18 +207,24 @@ async function resolveClickUpToken(silent = false, cwd = process.cwd()) {
|
|
|
207
207
|
|
|
208
208
|
// Validate token against ClickUp API
|
|
209
209
|
try {
|
|
210
|
-
const res = execSync(`curl -
|
|
210
|
+
const res = execSync(`curl -s -H "Authorization: ${token}" "https://api.clickup.com/api/v2/team"`, {
|
|
211
211
|
encoding: 'utf8',
|
|
212
212
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
213
213
|
timeout: 10000,
|
|
214
214
|
});
|
|
215
215
|
const data = JSON.parse(res);
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
if (data.err) {
|
|
217
|
+
fmt.logWarn(`ClickUp token validation failed: ${data.err} — using it anyway`);
|
|
218
|
+
} else {
|
|
219
|
+
const teamName = data.teams?.[0]?.name;
|
|
220
|
+
if (teamName) {
|
|
221
|
+
fmt.logSuccess(`ClickUp token valid — workspace: ${fmt.chalk.cyan(teamName)}`);
|
|
222
|
+
} else {
|
|
223
|
+
fmt.logWarn('ClickUp token accepted but no workspace found — using it anyway');
|
|
224
|
+
}
|
|
219
225
|
}
|
|
220
|
-
} catch {
|
|
221
|
-
fmt.logWarn(
|
|
226
|
+
} catch (e) {
|
|
227
|
+
fmt.logWarn(`ClickUp token validation failed: ${e.message?.split('\n')[0]} — using it anyway`);
|
|
222
228
|
}
|
|
223
229
|
|
|
224
230
|
return token;
|