claude-mem-lite 2.12.2 → 2.12.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/dispatch-inject.mjs +2 -2
- package/install.mjs +43 -8
- package/package.json +1 -1
- package/server.mjs +1 -1
package/dispatch-inject.mjs
CHANGED
|
@@ -122,7 +122,7 @@ function injectSkillManaged(resource, reason) {
|
|
|
122
122
|
function injectAgent(resource, reason) {
|
|
123
123
|
if (!isAllowedPath(resource.local_path)) {
|
|
124
124
|
const lines = [`[Recommended] ${leadLine(resource, reason)}`];
|
|
125
|
-
lines.push(`→
|
|
125
|
+
lines.push(`→ Invoke: Agent tool with subagent_type="${resource.invocation_name || resource.name}"`);
|
|
126
126
|
if (reason && resource.capability_summary) {
|
|
127
127
|
lines.push(`Capability: ${truncate(resource.capability_summary, 100)}`);
|
|
128
128
|
}
|
|
@@ -153,7 +153,7 @@ function injectAgent(resource, reason) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
const lines = [`[Recommended] ${leadLine(resource, reason)}`];
|
|
156
|
-
lines.push(`→
|
|
156
|
+
lines.push(`→ Invoke: Agent tool with subagent_type="${resource.invocation_name || resource.name}"`);
|
|
157
157
|
if (reason && resource.capability_summary) {
|
|
158
158
|
lines.push(`Capability: ${truncate(resource.capability_summary, 100)}`);
|
|
159
159
|
}
|
package/install.mjs
CHANGED
|
@@ -27,9 +27,23 @@ const NPM_INSTALL_CMD = 'npm install --omit=dev --no-audit --no-fund';
|
|
|
27
27
|
|
|
28
28
|
import { RESOURCE_METADATA } from './install-metadata.mjs';
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Derive invocation_name from resource name when metadata doesn't provide one.
|
|
32
|
+
* Rules:
|
|
33
|
+
* "parent/child" → "parent:child" (plugin:resource format)
|
|
34
|
+
* "simple-name" → "simple-name" (standalone resource)
|
|
35
|
+
* @param {string} name Resource name
|
|
36
|
+
* @returns {string} Derived invocation name
|
|
37
|
+
*/
|
|
38
|
+
function deriveInvocationName(name) {
|
|
39
|
+
if (name.includes('/')) return name.replace('/', ':');
|
|
40
|
+
return name;
|
|
41
|
+
}
|
|
42
|
+
|
|
30
43
|
/**
|
|
31
44
|
* Apply curated metadata to existing resource DB entries.
|
|
32
45
|
* Fixes existing installs that have generic name-echo metadata.
|
|
46
|
+
* Also syncs keywords, tech_stack, use_cases and auto-derives invocation_name.
|
|
33
47
|
* @param {Database} rdb Registry database handle
|
|
34
48
|
*/
|
|
35
49
|
function reindexKnownResources(rdb) {
|
|
@@ -37,10 +51,13 @@ function reindexKnownResources(rdb) {
|
|
|
37
51
|
UPDATE resources SET
|
|
38
52
|
intent_tags = ?, domain_tags = ?,
|
|
39
53
|
capability_summary = ?, trigger_patterns = ?,
|
|
40
|
-
invocation_name = CASE WHEN ? != '' THEN ? ELSE invocation_name END,
|
|
41
|
-
recommendation_mode = CASE WHEN ? != '' THEN ? ELSE recommendation_mode END,
|
|
54
|
+
invocation_name = CASE WHEN ?1 != '' THEN ?1 ELSE invocation_name END,
|
|
55
|
+
recommendation_mode = CASE WHEN ?2 != '' THEN ?2 ELSE recommendation_mode END,
|
|
56
|
+
keywords = CASE WHEN ?3 != '' THEN ?3 ELSE keywords END,
|
|
57
|
+
tech_stack = CASE WHEN ?4 != '' THEN ?4 ELSE tech_stack END,
|
|
58
|
+
use_cases = CASE WHEN ?5 != '' THEN ?5 ELSE use_cases END,
|
|
42
59
|
updated_at = datetime('now')
|
|
43
|
-
WHERE type = ? AND name = ?
|
|
60
|
+
WHERE type = ?6 AND name = ?7
|
|
44
61
|
`);
|
|
45
62
|
|
|
46
63
|
rdb.transaction(() => {
|
|
@@ -49,13 +66,16 @@ function reindexKnownResources(rdb) {
|
|
|
49
66
|
if (sep < 0) continue; // skip malformed keys without type:name separator
|
|
50
67
|
const type = key.slice(0, sep);
|
|
51
68
|
const name = key.slice(sep + 1);
|
|
52
|
-
const invName = meta.invocation_name ||
|
|
69
|
+
const invName = meta.invocation_name || deriveInvocationName(name);
|
|
53
70
|
const recMode = meta.recommendation_mode || '';
|
|
54
71
|
update.run(
|
|
55
72
|
meta.intent_tags, meta.domain_tags,
|
|
56
73
|
meta.capability_summary, meta.trigger_patterns,
|
|
57
|
-
invName,
|
|
58
|
-
recMode,
|
|
74
|
+
invName,
|
|
75
|
+
recMode,
|
|
76
|
+
meta.keywords || '',
|
|
77
|
+
meta.tech_stack || '',
|
|
78
|
+
meta.use_cases || '',
|
|
59
79
|
type, name
|
|
60
80
|
);
|
|
61
81
|
}
|
|
@@ -98,7 +118,7 @@ function registerVirtualResources(rdb) {
|
|
|
98
118
|
const name = key.slice(sep + 1);
|
|
99
119
|
const { changes } = insert.run(
|
|
100
120
|
name, type,
|
|
101
|
-
meta.invocation_name ||
|
|
121
|
+
meta.invocation_name || deriveInvocationName(name),
|
|
102
122
|
meta.intent_tags || name.replace(/-/g, ' '),
|
|
103
123
|
meta.domain_tags || '',
|
|
104
124
|
meta.capability_summary || `${type}: ${name.replace(/-/g, ' ')}`,
|
|
@@ -133,6 +153,21 @@ function registerVirtualResources(rdb) {
|
|
|
133
153
|
`);
|
|
134
154
|
backfill.run();
|
|
135
155
|
} catch {}
|
|
156
|
+
|
|
157
|
+
// Backfill invocation_name for resources that still have it empty
|
|
158
|
+
// Derive from name: "parent/child" → "parent:child", otherwise use name as-is
|
|
159
|
+
try {
|
|
160
|
+
const emptyInvoc = rdb.prepare(`
|
|
161
|
+
SELECT id, name FROM resources
|
|
162
|
+
WHERE status = 'active' AND (invocation_name IS NULL OR invocation_name = '')
|
|
163
|
+
`).all();
|
|
164
|
+
if (emptyInvoc.length > 0) {
|
|
165
|
+
const setInvoc = rdb.prepare('UPDATE resources SET invocation_name = ? WHERE id = ?');
|
|
166
|
+
for (const r of emptyInvoc) {
|
|
167
|
+
setInvoc.run(deriveInvocationName(r.name), r.id);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
} catch {}
|
|
136
171
|
})();
|
|
137
172
|
return count;
|
|
138
173
|
}
|
|
@@ -583,7 +618,7 @@ async function install() {
|
|
|
583
618
|
repo_stars: res.repoStars || 0,
|
|
584
619
|
local_path: res.localPath,
|
|
585
620
|
file_hash: res.fileHash,
|
|
586
|
-
invocation_name: meta?.invocation_name ||
|
|
621
|
+
invocation_name: meta?.invocation_name || deriveInvocationName(res.name),
|
|
587
622
|
intent_tags: meta?.intent_tags || res.name.replace(/-/g, ' '),
|
|
588
623
|
domain_tags: meta?.domain_tags || '',
|
|
589
624
|
trigger_patterns: meta?.trigger_patterns || `when user needs ${res.name.replace(/-/g, ' ')}`,
|
package/package.json
CHANGED
package/server.mjs
CHANGED
|
@@ -1293,7 +1293,7 @@ server.registerTool(
|
|
|
1293
1293
|
const categoryLabel = r.category ? ` [${r.category}]` : '';
|
|
1294
1294
|
const howToUse = r.type === 'skill'
|
|
1295
1295
|
? (r.invocation_name ? `Skill tool: skill="${r.invocation_name}"` : `Community skill: ${r.name}`)
|
|
1296
|
-
: `Agent tool: subagent_type="${r.name}"`;
|
|
1296
|
+
: `Agent tool: subagent_type="${r.invocation_name || r.name}"`;
|
|
1297
1297
|
return `${qualityBadge} ${r.type === 'skill' ? 'S' : 'A'} **${r.name}**${categoryLabel} — ${truncate(r.capability_summary || '', 80)}\n Use: ${howToUse}`;
|
|
1298
1298
|
});
|
|
1299
1299
|
return { content: [{ type: 'text', text: `Found ${results.length} resource(s) for "${args.query}":\n\n${lines.join('\n\n')}` }] };
|