@inline-chat/hermes-agent-adapter 0.0.5-alpha.2 → 0.0.5-alpha.3
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": "@inline-chat/hermes-agent-adapter",
|
|
3
|
-
"version": "0.0.5-alpha.
|
|
3
|
+
"version": "0.0.5-alpha.3",
|
|
4
4
|
"description": "Hermes Agent platform adapter for Inline, with a native Python plugin and bundled Inline realtime sidecar.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
package/plugin/inline/adapter.py
CHANGED
|
@@ -1390,6 +1390,12 @@ class InlineAdapter(BasePlatformAdapter):
|
|
|
1390
1390
|
event = json.loads(line)
|
|
1391
1391
|
except json.JSONDecodeError:
|
|
1392
1392
|
return
|
|
1393
|
+
# Chat snapshots include mutable dialog and routing fields such as
|
|
1394
|
+
# followMode and lastMsgId. Invalidating here intentionally makes the
|
|
1395
|
+
# next group-message dispatch perform an extra GET_CHAT; correctness
|
|
1396
|
+
# across missed/reordered updates is worth that fetch until the sidecar
|
|
1397
|
+
# owns a coherent client-state cache.
|
|
1398
|
+
self._invalidate_chat_info(event.get("chatId"))
|
|
1393
1399
|
kind = event.get("kind")
|
|
1394
1400
|
if kind == "message.action.invoke":
|
|
1395
1401
|
if await self._handle_action(event):
|
|
@@ -2438,6 +2444,11 @@ class InlineAdapter(BasePlatformAdapter):
|
|
|
2438
2444
|
if len(self._visible_reply_thread_targets) > _CHAT_INFO_CACHE_MAX_SIZE:
|
|
2439
2445
|
self._visible_reply_thread_targets.popitem(last=False)
|
|
2440
2446
|
|
|
2447
|
+
def _invalidate_chat_info(self, chat_id: Any) -> None:
|
|
2448
|
+
key = self._chat_key(chat_id)
|
|
2449
|
+
if key:
|
|
2450
|
+
self._chat_info_cache.pop(key, None)
|
|
2451
|
+
|
|
2441
2452
|
def _reply_to_for_target(self, reply_to: Optional[str], target: Dict[str, str]) -> Optional[str]:
|
|
2442
2453
|
if not reply_to:
|
|
2443
2454
|
return None
|
|
@@ -3511,6 +3522,9 @@ class InlineAdapter(BasePlatformAdapter):
|
|
|
3511
3522
|
try:
|
|
3512
3523
|
data = await self._sidecar_call(path, body)
|
|
3513
3524
|
result = data.get("result") or {}
|
|
3525
|
+
target = body.get("target")
|
|
3526
|
+
if isinstance(target, dict):
|
|
3527
|
+
self._invalidate_chat_info(target.get("chatId"))
|
|
3514
3528
|
return _send_result(
|
|
3515
3529
|
success=True,
|
|
3516
3530
|
message_id=str(result.get("messageId") or "") or None,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
name: inline-platform
|
|
2
2
|
label: Inline
|
|
3
3
|
kind: platform
|
|
4
|
-
version: 0.0.5-alpha.
|
|
4
|
+
version: 0.0.5-alpha.3
|
|
5
5
|
description: >
|
|
6
6
|
Inline platform adapter for Hermes Agent. The adapter runs as a native
|
|
7
7
|
Hermes Python platform plugin and supervises a local Node sidecar that uses
|