agentsmesh 0.26.0 → 0.28.0
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/CHANGELOG.md +38 -0
- package/README.md +10 -10
- package/dist/canonical.js +692 -241
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +196 -192
- package/dist/engine.js +695 -244
- package/dist/engine.js.map +1 -1
- package/dist/index.js +713 -254
- package/dist/index.js.map +1 -1
- package/dist/lessons.js +18 -10
- package/dist/lessons.js.map +1 -1
- package/dist/targets.js +692 -241
- package/dist/targets.js.map +1 -1
- package/package.json +1 -1
package/dist/lessons.js
CHANGED
|
@@ -2401,23 +2401,31 @@ async function stripMarkersInGraph(projectRoot, options = {}) {
|
|
|
2401
2401
|
}
|
|
2402
2402
|
var RECALL_HOOK_COMMAND = "agentsmesh lessons hook";
|
|
2403
2403
|
var RECALL_HOOK_MATCHER = "Edit|Write|Bash";
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
const
|
|
2408
|
-
const
|
|
2409
|
-
const post = existing instanceof YAMLSeq ? existing : new YAMLSeq();
|
|
2410
|
-
const present = post.items.some(
|
|
2404
|
+
var RECALL_EVENTS = ["PreToolUse", "PostToolUse"];
|
|
2405
|
+
function injectEvent(doc, event) {
|
|
2406
|
+
const existing = doc.get(event);
|
|
2407
|
+
const seq = existing instanceof YAMLSeq ? existing : new YAMLSeq();
|
|
2408
|
+
const present = seq.items.some(
|
|
2411
2409
|
(item) => item instanceof YAMLMap && item.get("command") === RECALL_HOOK_COMMAND
|
|
2412
2410
|
);
|
|
2413
2411
|
if (present) return false;
|
|
2414
|
-
|
|
2412
|
+
seq.add(
|
|
2415
2413
|
doc.createNode({ matcher: RECALL_HOOK_MATCHER, type: "command", command: RECALL_HOOK_COMMAND })
|
|
2416
2414
|
);
|
|
2417
|
-
doc.set(
|
|
2418
|
-
writeFileSync(path, String(doc), "utf8");
|
|
2415
|
+
doc.set(event, seq);
|
|
2419
2416
|
return true;
|
|
2420
2417
|
}
|
|
2418
|
+
function injectRecallHook(projectRoot) {
|
|
2419
|
+
const path = join(projectRoot, ".agentsmesh", "hooks.yaml");
|
|
2420
|
+
if (!existsSync(path)) return false;
|
|
2421
|
+
const doc = parseDocument(readFileSync(path, "utf8"));
|
|
2422
|
+
let changed = false;
|
|
2423
|
+
for (const event of RECALL_EVENTS) {
|
|
2424
|
+
if (injectEvent(doc, event)) changed = true;
|
|
2425
|
+
}
|
|
2426
|
+
if (changed) writeFileSync(path, String(doc), "utf8");
|
|
2427
|
+
return changed;
|
|
2428
|
+
}
|
|
2421
2429
|
var UTF8_BOM = "\uFEFF";
|
|
2422
2430
|
var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
2423
2431
|
".md",
|