dsh-plugin-agent-memory 0.1.2 → 0.1.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/client.js +17 -17
- package/index.js +3 -1
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -229,12 +229,12 @@ window.__ModuleLoader__.load({
|
|
|
229
229
|
.finally(() => setBusy(false));
|
|
230
230
|
}, []);
|
|
231
231
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
232
|
+
// Only agents this user key owns can serve as an expert; the Hub refuses cross-owner
|
|
233
|
+
// memory reads, so listing the rest would only offer dead entries.
|
|
234
|
+
const visibleAgents = React.useMemo(
|
|
235
|
+
() => agents.filter((agent) => agent.owned !== false),
|
|
236
|
+
[agents],
|
|
237
|
+
);
|
|
238
238
|
|
|
239
239
|
const choose = React.useCallback(
|
|
240
240
|
(agent) => {
|
|
@@ -456,32 +456,32 @@ window.__ModuleLoader__.load({
|
|
|
456
456
|
? null
|
|
457
457
|
: h('div', { style: { ...mutedStyle, marginTop: '4px' } }, 'Agent / 专家'),
|
|
458
458
|
busy ? h('div', { style: mutedStyle }, '加载中…') : null,
|
|
459
|
-
...
|
|
459
|
+
...visibleAgents.map((agent) =>
|
|
460
460
|
h(
|
|
461
461
|
'button',
|
|
462
462
|
{
|
|
463
463
|
key: agent.agentId,
|
|
464
464
|
type: 'button',
|
|
465
|
-
|
|
466
|
-
title: agent.owned === false ? '这是他人的 agent,你的 userkey 无权读写其记忆' : agent.description,
|
|
465
|
+
title: agent.description,
|
|
467
466
|
style: {
|
|
468
467
|
...rowStyle,
|
|
469
|
-
opacity: agent.
|
|
470
|
-
cursor:
|
|
468
|
+
opacity: agent.status === 'active' ? 1 : 0.5,
|
|
469
|
+
cursor: 'pointer',
|
|
471
470
|
},
|
|
472
471
|
onClick: () => choose(agent),
|
|
473
472
|
},
|
|
474
|
-
agent.
|
|
473
|
+
agent.name,
|
|
475
474
|
agent.description
|
|
476
475
|
? h('span', { style: { display: 'block', opacity: 0.6, fontSize: '11px' } }, agent.description)
|
|
477
476
|
: null,
|
|
478
477
|
),
|
|
479
478
|
),
|
|
480
|
-
|
|
481
|
-
? h(
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
479
|
+
visibleAgents.length === 0 && !busy && teams.length > 0
|
|
480
|
+
? h(
|
|
481
|
+
'div',
|
|
482
|
+
{ style: mutedStyle },
|
|
483
|
+
agents.length === 0 ? '该团队下没有 agent' : '该团队下没有属于你的 agent,无法作为专家',
|
|
484
|
+
)
|
|
485
485
|
: null,
|
|
486
486
|
selection
|
|
487
487
|
? h(
|
package/index.js
CHANGED
|
@@ -283,7 +283,9 @@ export function apply(ctx, config) {
|
|
|
283
283
|
debug({ at: 'skip-no-selection', sessionId });
|
|
284
284
|
return decision;
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
// The expert is part of the key: switching experts mid-session must re-recall even
|
|
287
|
+
// when the user repeats the same question.
|
|
288
|
+
const dedupeKey = `${sessionId}:${selection.agentId}:${query}`;
|
|
287
289
|
if (state.lastInjection.get(sessionId) === dedupeKey) return decision;
|
|
288
290
|
const hits = await recall(selection, query);
|
|
289
291
|
debug({ at: 'recall', sessionId, agent: selection.agentId, query: query.slice(0, 60), hits: hits.length });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-agent-memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Tencent agent-memory integration: pick a team agent as an expert at the composer and its long-term memories are recalled into each turn.",
|
|
6
6
|
"license": "MIT",
|