alice-and-bot 1.0.98 → 1.0.99

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.
@@ -1384,7 +1384,9 @@ var pushEndpointKey = "push_endpoint";
1384
1384
  var notificationPreferencesKey = "notification_preferences";
1385
1385
  var conversationKeyPrefix = "conv_key:";
1386
1386
  var conversationMessagesPrefix = "conv_msgs:";
1387
+ var conversationDismissedAtPrefix = "conv_dismissed_at:";
1387
1388
  var maxStoredPushMessages = 20;
1389
+ var parseDismissedAt = (value) => typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0;
1388
1390
  var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1389
1391
  var normalizeNotificationPreferences = (value) => {
1390
1392
  if (!isRecord(value)) {
@@ -1507,6 +1509,13 @@ var buildStoreFromMap = (entries) => ({
1507
1509
  entries.set(notificationPreferencesKey, normalizeNotificationPreferences(prefs));
1508
1510
  return Promise.resolve();
1509
1511
  },
1512
+ getConversationDismissedAt: (conversationId) => Promise.resolve(parseDismissedAt(entries.get(`${conversationDismissedAtPrefix}${conversationId}`))),
1513
+ setConversationDismissedAt: (conversationId, timestamp) => {
1514
+ const key = `${conversationDismissedAtPrefix}${conversationId}`;
1515
+ const next = Math.max(parseDismissedAt(entries.get(key)), parseDismissedAt(timestamp));
1516
+ if (next > 0) entries.set(key, next);
1517
+ return Promise.resolve();
1518
+ },
1510
1519
  clear: () => {
1511
1520
  entries.clear();
1512
1521
  return Promise.resolve();
@@ -1529,6 +1538,13 @@ var createIndexedDbPushKeyStore = (factory) => ({
1529
1538
  getNotificationPreferences: () => idbGet(factory, notificationPreferencesKey).then(normalizeNotificationPreferences).catch(() => normalizeNotificationPreferences(null)),
1530
1539
  setNotificationPreferences: (prefs) => idbPut(factory, notificationPreferencesKey, normalizeNotificationPreferences(prefs)).catch(() => {
1531
1540
  }),
1541
+ getConversationDismissedAt: (conversationId) => idbGet(factory, `${conversationDismissedAtPrefix}${conversationId}`).then(parseDismissedAt).catch(() => 0),
1542
+ setConversationDismissedAt: (conversationId, timestamp) => {
1543
+ const parsed = parseDismissedAt(timestamp);
1544
+ if (parsed <= 0) return Promise.resolve();
1545
+ return idbUpdate(factory, `${conversationDismissedAtPrefix}${conversationId}`, (prev) => Math.max(parseDismissedAt(prev), parsed)).catch(() => {
1546
+ });
1547
+ },
1532
1548
  clear: () => idbClear(factory).catch(() => {
1533
1549
  })
1534
1550
  });
@@ -1545,6 +1561,8 @@ var defaultPushKeyStore = {
1545
1561
  setPushEndpoint: (endpoint) => resolveActiveStore().setPushEndpoint(endpoint),
1546
1562
  getNotificationPreferences: () => resolveActiveStore().getNotificationPreferences(),
1547
1563
  setNotificationPreferences: (prefs) => resolveActiveStore().setNotificationPreferences(prefs),
1564
+ getConversationDismissedAt: (id) => resolveActiveStore().getConversationDismissedAt(id),
1565
+ setConversationDismissedAt: (id, ts) => resolveActiveStore().setConversationDismissedAt(id, ts),
1548
1566
  clear: () => resolveActiveStore().clear()
1549
1567
  };
1550
1568
  var savePushCredentials = (credentials) => defaultPushKeyStore.setCredentials(credentials);
package/components.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  subscribeUserName,
46
46
  typingTtl,
47
47
  uploadAttachment
48
- } from "./chunk-LUSXWTWB.js";
48
+ } from "./chunk-VORNL25W.js";
49
49
  import {
50
50
  actOnCanvas,
51
51
  canvasFromRow,
package/mod.js CHANGED
@@ -47,7 +47,7 @@ import {
47
47
  uiUpdateUrl,
48
48
  uploadAttachment,
49
49
  verifyWebhookOrigin
50
- } from "./chunk-LUSXWTWB.js";
50
+ } from "./chunk-VORNL25W.js";
51
51
  import {
52
52
  aliasToPublicSignKey,
53
53
  buildSignedRequest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alice-and-bot",
3
- "version": "1.0.98",
3
+ "version": "1.0.99",
4
4
  "description": "A chat network for agents. Open-source, end-to-end encrypted messaging SDK, React chat UI, and embeddable widgets for AI agents and humans.",
5
5
  "license": "MIT",
6
6
  "type": "module",