nothumanallowed 14.3.6 → 14.3.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nothumanallowed",
3
- "version": "14.3.6",
3
+ "version": "14.3.7",
4
4
  "description": "NotHumanAllowed — 38 AI agents, 80 tools, Studio (visual agentic workflows). Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, Alexandria E2E messaging, GitHub, Notion, Slack, voice chat, free AI (Liara), 28 languages. Zero-dependency CLI.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/constants.mjs CHANGED
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
5
5
  const __filename = fileURLToPath(import.meta.url);
6
6
  const __dirname = path.dirname(__filename);
7
7
 
8
- export const VERSION = '14.3.6';
8
+ export const VERSION = '14.3.7';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -24,13 +24,26 @@ export function register(router) {
24
24
 
25
25
  router.get('/api/github', async (req, res) => {
26
26
  try {
27
- const { listNotificationsRaw } = await import('../../services/github.mjs');
27
+ const gh = await import('../../services/github.mjs');
28
28
  const config = loadConfig();
29
- const notifications = await listNotificationsRaw(config);
30
- sendJSON(res, 200, { notifications: Array.isArray(notifications) ? notifications : [] });
29
+ // Fetch user info + notifications + repos in parallel
30
+ const [userResp, notifications, repos] = await Promise.all([
31
+ gh.ghFetch ? gh.ghFetch(config, '/user').catch(() => null) : Promise.resolve(null),
32
+ gh.listNotificationsRaw(config).catch(() => []),
33
+ gh.listUserRepos ? gh.listUserRepos(config).catch(() => []) : Promise.resolve([]),
34
+ ]);
35
+ const user = userResp ? {
36
+ login: userResp.login,
37
+ name: userResp.name,
38
+ avatar: userResp.avatar_url,
39
+ repos: Array.isArray(repos) ? repos.slice(0, 20).map((r) => ({
40
+ full_name: r.full_name, description: r.description, open_issues: r.open_issues_count, private: r.private,
41
+ })) : [],
42
+ } : null;
43
+ sendJSON(res, 200, { user, notifications: Array.isArray(notifications) ? notifications : [] });
31
44
  } catch (e) {
32
45
  if (e.message?.includes('token') || e.message?.includes('not configured') || e.message?.includes('401')) {
33
- return sendJSON(res, 200, { notifications: [], error: 'GitHub token not configured or expired. Run: nha config set github-token YOUR_PAT' });
46
+ return sendJSON(res, 200, { notifications: [], error: 'GitHub token not configured or expired.' });
34
47
  }
35
48
  sendJSON(res, 200, { notifications: [], error: e.message });
36
49
  }
@@ -9,7 +9,7 @@ const GITHUB_API = 'https://api.github.com';
9
9
  /**
10
10
  * Authenticated fetch to GitHub API.
11
11
  */
12
- async function ghFetch(config, urlPath, options = {}) {
12
+ export async function ghFetch(config, urlPath, options = {}) {
13
13
  const token = config.github?.token;
14
14
  if (!token) throw new Error('GitHub token not configured. Run: nha config set github-token YOUR_PAT');
15
15