@tinyclaw/plugin-channel-friends 2.0.0-dev.d9e0a41 → 2.0.0-dev.e2d9b28

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/dist/index.js CHANGED
@@ -19,10 +19,10 @@
19
19
  *
20
20
  * userId format: "friend:<username>"
21
21
  */
22
+ import { readFileSync } from 'node:fs';
23
+ import { dirname, join } from 'node:path';
24
+ import { fileURLToPath } from 'node:url';
22
25
  import { logger } from '@tinyclaw/logger';
23
- import { readFileSync } from 'fs';
24
- import { dirname, join } from 'path';
25
- import { fileURLToPath } from 'url';
26
26
  import { createFriendsServer } from './server.js';
27
27
  import { InviteStore } from './store.js';
28
28
  import { createFriendsTools, FRIENDS_ENABLED_CONFIG_KEY, FRIENDS_PLUGIN_ID, FRIENDS_PORT_CONFIG_KEY, } from './tools.js';
package/dist/server.js CHANGED
@@ -182,7 +182,8 @@ export function createFriendsServer(config) {
182
182
  if (!pushClients.has(username)) {
183
183
  pushClients.set(username, new Set());
184
184
  }
185
- pushClients.get(username).add(pushClient);
185
+ const clients = pushClients.get(username);
186
+ clients.add(pushClient);
186
187
  // Heartbeat to keep connection alive
187
188
  const heartbeat = setInterval(() => {
188
189
  try {
package/dist/tools.js CHANGED
@@ -150,7 +150,7 @@ export function createFriendsTools(store, configManager) {
150
150
  const lines = friends.map((f) => {
151
151
  const status = f.sessionToken ? 'active' : f.inviteCode ? 'invite pending' : 'revoked';
152
152
  const lastSeenDate = new Date(f.lastSeen);
153
- const lastSeen = f.lastSeen && !isNaN(lastSeenDate.getTime())
153
+ const lastSeen = f.lastSeen && !Number.isNaN(lastSeenDate.getTime())
154
154
  ? lastSeenDate.toLocaleString()
155
155
  : 'Unknown';
156
156
  return `- **${f.nickname}** (@${f.username}) — ${status}, last seen: ${lastSeen}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinyclaw/plugin-channel-friends",
3
- "version": "2.0.0-dev.d9e0a41",
3
+ "version": "2.0.0-dev.e2d9b28",
4
4
  "description": "Friends web chat channel plugin for Tiny Claw",
5
5
  "license": "GPL-3.0",
6
6
  "author": "Waren Gonzaga",