nothumanallowed 11.1.2 → 11.2.1

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": "11.1.2",
3
+ "version": "11.2.1",
4
4
  "description": "NotHumanAllowed — 38 AI agents, 53 tools. Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, GitHub, Notion, Slack, voice chat, 28 languages. Zero-dependency CLI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -320,8 +320,9 @@ async function cmdRead(args) {
320
320
  const channel = getActiveChannel();
321
321
  if (!channel) { fail('No active channel. Create or join one first.'); return; }
322
322
 
323
- const since = args[0] || ''; // optional timestamp
324
- const query = since ? `?since=${since}&fp=${identity.fingerprint}` : `?fp=${identity.fingerprint}`;
323
+ const showAll = args.includes('--all');
324
+ const limit = showAll ? 9999 : 10; // default: last 10 messages
325
+ const query = `?fp=${identity.fingerprint}&limit=${limit}`;
325
326
  const result = await apiGet(`/channels/${channel.id}/messages${query}`);
326
327
  if (result.error) { fail(result.error); return; }
327
328
 
@@ -333,9 +334,12 @@ async function cmdRead(args) {
333
334
  // Derive channel key from ID + secret
334
335
  const channelKey = deriveChannelKey(channel.id, channel.secret);
335
336
 
336
- console.log(`\n ${BOLD}${channel.name}${NC} ${D}(${result.messages.length} messages)${NC}\n`);
337
+ const msgs = result.messages.slice(-limit);
338
+ const total = result.total || result.messages.length;
339
+ const showing = msgs.length;
340
+ console.log(`\n ${BOLD}${channel.name}${NC} ${D}(showing ${showing}/${total} messages${showing < total ? ' — use --all for full history' : ''})${NC}\n`);
337
341
 
338
- for (const msg of result.messages) {
342
+ for (const msg of msgs) {
339
343
  const time = new Date(msg.timestamp).toLocaleTimeString();
340
344
  const sender = result.members?.find(m => m.fingerprint === msg.senderFingerprint);
341
345
  const senderName = sender?.displayName || msg.senderFingerprint.slice(0, 8);
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 = '11.1.2';
8
+ export const VERSION = '11.2.1';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -46,13 +46,19 @@ function sendDesktop(title, body) {
46
46
  const platform = os.platform();
47
47
  try {
48
48
  if (platform === 'darwin') {
49
- const escaped = body.replace(/"/g, '\\"').slice(0, 200);
50
- execSync(`osascript -e 'display notification "${escaped}" with title "NHA: ${title.replace(/"/g, '\\"')}"'`);
49
+ const escaped = body.replace(/"/g, '\\"').replace(/'/g, "'").slice(0, 200);
50
+ const escapedTitle = 'NHA: ' + title.replace(/"/g, '\\"');
51
+ // Try terminal-notifier first (supports click-to-open)
52
+ try {
53
+ execSync(`which terminal-notifier`, { stdio: 'ignore' });
54
+ execSync(`terminal-notifier -title "${escapedTitle}" -message "${escaped}" -open "http://127.0.0.1:3847" -appIcon "" -group nha 2>/dev/null`);
55
+ } catch {
56
+ // Fallback to osascript — use "NHA" as subtitle so click goes nowhere confusing
57
+ execSync(`osascript -e 'display notification "${escaped}" with title "${escapedTitle}" subtitle "Open nha ui to see details"'`);
58
+ }
51
59
  } else if (platform === 'linux') {
52
60
  execSync(`notify-send "NHA: ${title}" "${body.slice(0, 200)}"`);
53
- }
54
- // Windows: PowerShell toast (best effort)
55
- else if (platform === 'win32') {
61
+ } else if (platform === 'win32') {
56
62
  execSync(`powershell -Command "New-BurntToastNotification -Text 'NHA: ${title}', '${body.slice(0, 200)}'" 2>NUL`);
57
63
  }
58
64
  } catch { /* non-fatal */ }