@a1hvdy/cc-openclaw 0.9.1 → 0.9.2
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.
|
@@ -18,12 +18,24 @@
|
|
|
18
18
|
* gets forwarded to Claude CLI via sessionConfig.tools (R3). Both fire,
|
|
19
19
|
* neither blocks the other.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* v0.9.2 (2026-05-11): SKILL.md **bodies** are re-read from disk on
|
|
22
|
+
* every slash invocation; only the directory listing (filename →
|
|
23
|
+
* frontmatter `name:` mapping) is cached, keyed by directory mtime.
|
|
24
|
+
* Pre-v0.9.2 the body was also cached, which surfaced stale content
|
|
25
|
+
* when a user edited a SKILL.md file in place (the dir mtime stayed
|
|
26
|
+
* unchanged, so the cache wasn't refreshed). Analogous in spirit to
|
|
27
|
+
* the upstream OpenClaw 2026.5.7 "clear cached skills snapshots on
|
|
28
|
+
* /new" fix, but narrower. SKILL.md files are small (~few KB); a
|
|
29
|
+
* per-invocation read is ~1ms, well-bounded against rare slash usage.
|
|
24
30
|
*
|
|
25
31
|
* Override path with OPENCLAW_WORKSPACE_SKILLS_DIR env var.
|
|
26
32
|
*/
|
|
33
|
+
/**
|
|
34
|
+
* Public shape returned by `resolveSkillForSlash`. Caller (`maybeInlineSkill`)
|
|
35
|
+
* consumes `fullText` and `body`. Both are re-read fresh on every invocation
|
|
36
|
+
* from v0.9.2 onward — previously cached, now fresh-from-disk so in-place
|
|
37
|
+
* SKILL.md edits surface immediately.
|
|
38
|
+
*/
|
|
27
39
|
interface SkillEntry {
|
|
28
40
|
skillDir: string;
|
|
29
41
|
skillMd: string;
|
|
@@ -18,9 +18,15 @@
|
|
|
18
18
|
* gets forwarded to Claude CLI via sessionConfig.tools (R3). Both fire,
|
|
19
19
|
* neither blocks the other.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* v0.9.2 (2026-05-11): SKILL.md **bodies** are re-read from disk on
|
|
22
|
+
* every slash invocation; only the directory listing (filename →
|
|
23
|
+
* frontmatter `name:` mapping) is cached, keyed by directory mtime.
|
|
24
|
+
* Pre-v0.9.2 the body was also cached, which surfaced stale content
|
|
25
|
+
* when a user edited a SKILL.md file in place (the dir mtime stayed
|
|
26
|
+
* unchanged, so the cache wasn't refreshed). Analogous in spirit to
|
|
27
|
+
* the upstream OpenClaw 2026.5.7 "clear cached skills snapshots on
|
|
28
|
+
* /new" fix, but narrower. SKILL.md files are small (~few KB); a
|
|
29
|
+
* per-invocation read is ~1ms, well-bounded against rare slash usage.
|
|
24
30
|
*
|
|
25
31
|
* Override path with OPENCLAW_WORKSPACE_SKILLS_DIR env var.
|
|
26
32
|
*/
|
|
@@ -55,6 +61,9 @@ function parseFrontmatter(text) {
|
|
|
55
61
|
}
|
|
56
62
|
return { frontmatter: fm, body: text.slice(m[0].length) };
|
|
57
63
|
}
|
|
64
|
+
/** Build the filename ↔ name index by scanning the workspace skills dir.
|
|
65
|
+
* Reads each SKILL.md only to extract its frontmatter `name:` field — does
|
|
66
|
+
* NOT cache the body. */
|
|
58
67
|
function rebuildIndex() {
|
|
59
68
|
const byName = new Map();
|
|
60
69
|
let mtimeMs = 0;
|
|
@@ -79,11 +88,11 @@ function rebuildIndex() {
|
|
|
79
88
|
catch {
|
|
80
89
|
continue;
|
|
81
90
|
}
|
|
82
|
-
const { frontmatter
|
|
91
|
+
const { frontmatter } = parseFrontmatter(fullText);
|
|
83
92
|
const name = String(frontmatter.name || entry).toLowerCase().trim();
|
|
84
93
|
if (!name)
|
|
85
94
|
continue;
|
|
86
|
-
byName.set(name, { skillDir, skillMd
|
|
95
|
+
byName.set(name, { skillDir, skillMd });
|
|
87
96
|
}
|
|
88
97
|
return { mtimeMs, dir, byName };
|
|
89
98
|
}
|
|
@@ -105,7 +114,22 @@ export function resolveSkillForSlash(name) {
|
|
|
105
114
|
if (!cache || dirMtime > cache.mtimeMs || cache.dir !== currentDir) {
|
|
106
115
|
cache = rebuildIndex();
|
|
107
116
|
}
|
|
108
|
-
|
|
117
|
+
const ref = cache.byName.get(normalized);
|
|
118
|
+
if (!ref)
|
|
119
|
+
return null;
|
|
120
|
+
// v0.9.2: read the SKILL.md body fresh from disk so in-place edits to
|
|
121
|
+
// an existing SKILL.md (no add/remove, dir mtime unchanged) surface
|
|
122
|
+
// immediately. Pre-v0.9.2 the cache stored a stale body until process
|
|
123
|
+
// restart or skill add/remove.
|
|
124
|
+
let fullText;
|
|
125
|
+
try {
|
|
126
|
+
fullText = fs.readFileSync(ref.skillMd, 'utf8');
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
const { body } = parseFrontmatter(fullText);
|
|
132
|
+
return { skillDir: ref.skillDir, skillMd: ref.skillMd, body, fullText };
|
|
109
133
|
}
|
|
110
134
|
export function maybeInlineSkill(userText) {
|
|
111
135
|
if (typeof userText !== 'string')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-resolver.js","sourceRoot":"","sources":["../../../src/openai-compat/skill-resolver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"skill-resolver.js","sourceRoot":"","sources":["../../../src/openai-compat/skill-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;;GAOG;AACH,SAAS,qBAAqB;IAC5B,OAAO,IAAI,CAAC,OAAO,CACjB,OAAO,CAAC,GAAG,CAAC,6BAA6B;QACvC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,4BAA4B,CAAC,CACxD,CAAC;AACJ,CAAC;AA2BD,IAA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