nothumanallowed 13.5.124 → 13.5.125

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": "13.5.124",
3
+ "version": "13.5.125",
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": {
@@ -259,6 +259,22 @@ export async function cmdUI(args) {
259
259
  `Never output raw JSON to the user.`;
260
260
  const chatSystemPrompt = await buildSystemPrompt('NHA UI', UI_PERSONA, config);
261
261
 
262
+ // Returns a live IMAP accounts block to append to any system prompt
263
+ async function getImapAccountsContext() {
264
+ try {
265
+ const { listAccounts } = await import('../services/email-db.mjs');
266
+ const accs = listAccounts();
267
+ if (!accs.length) return '';
268
+ let ctx = '\n\n--- IMAP EMAIL ACCOUNTS (custom, already configured) ---\n';
269
+ ctx += 'Use these accountIds directly in imap_* tools — do NOT call imap_accounts() first.\n';
270
+ for (const a of accs) {
271
+ ctx += `accountId: "${a.id}" | email: ${a.email_address} | name: "${a.display_name}" | status: ${a.sync_status}\n`;
272
+ }
273
+ ctx += 'When the user mentions their company name, email domain, or display name, map it to the correct accountId above.';
274
+ return ctx;
275
+ } catch { return ''; }
276
+ }
277
+
262
278
  // ── Route Handlers ──────────────────────────────────────────────────────
263
279
 
264
280
  async function handleRequest(req, res) {
@@ -1817,13 +1833,17 @@ export async function cmdUI(args) {
1817
1833
  parts.push(`[User] ${body.message}`);
1818
1834
  let userMessage = parts.join('\n\n');
1819
1835
 
1820
- // Inject episodic memory context into the system prompt
1836
+ // Inject episodic memory + live IMAP accounts into the system prompt
1821
1837
  const basePrompt = effectiveSystemPrompt || chatSystemPrompt;
1822
1838
  let enrichedSystemPrompt = basePrompt;
1823
1839
  try {
1824
1840
  const memCtx = buildMemoryContext('chat', body.message);
1825
1841
  if (memCtx) enrichedSystemPrompt = basePrompt + memCtx;
1826
1842
  } catch { /* memory unavailable */ }
1843
+ try {
1844
+ const imapCtx = await getImapAccountsContext();
1845
+ if (imapCtx) enrichedSystemPrompt += imapCtx;
1846
+ } catch { /* imap context unavailable */ }
1827
1847
 
1828
1848
  // Handle image attachment — vision API
1829
1849
  if (body.imageBase64 && body.imageMimeType) {
@@ -2277,6 +2297,7 @@ export async function cmdUI(args) {
2277
2297
  const basePrompt = effectiveSystemPrompt || chatSystemPrompt;
2278
2298
  let enrichedPrompt = basePrompt;
2279
2299
  try { const m = buildMemoryContext('chat', effectiveMsg); if (m) enrichedPrompt = basePrompt + m; } catch {}
2300
+ try { const ic = await getImapAccountsContext(); if (ic) enrichedPrompt += ic; } catch {}
2280
2301
 
2281
2302
  // Build message with rolling context window:
2282
2303
  // - Recent messages (last 6): full content up to 2000 chars
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 = '13.5.124';
8
+ export const VERSION = '13.5.125';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11