@cfio/cohort-sync 0.34.5 → 0.34.6
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/dist/index.js +9 -2
- package/dist/openclaw.plugin.json +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2853,7 +2853,8 @@ function parseSkillFrontmatter(text) {
|
|
|
2853
2853
|
if (!closed) return null;
|
|
2854
2854
|
const name = fields.name;
|
|
2855
2855
|
if (!name) return null;
|
|
2856
|
-
|
|
2856
|
+
const description = fields.description ?? "";
|
|
2857
|
+
return { name, description, triggers: extractSkillTriggers(description || text) };
|
|
2857
2858
|
}
|
|
2858
2859
|
function stripScalar(value) {
|
|
2859
2860
|
const v2 = value.trim();
|
|
@@ -2862,6 +2863,11 @@ function stripScalar(value) {
|
|
|
2862
2863
|
}
|
|
2863
2864
|
return v2;
|
|
2864
2865
|
}
|
|
2866
|
+
function extractSkillTriggers(text) {
|
|
2867
|
+
const match = text.match(/\btriggers?\s+on\s*:\s*([^.\n]+)/i) ?? text.match(/\btriggers?\s*:\s*([^.\n]+)/i);
|
|
2868
|
+
if (!match?.[1]) return [];
|
|
2869
|
+
return match[1].split(/[,;]| or | and /i).map((trigger) => trigger.trim()).filter((trigger) => trigger.length > 0).slice(0, 50);
|
|
2870
|
+
}
|
|
2865
2871
|
function enumerateSkills(skillsDir2, source = "hermes") {
|
|
2866
2872
|
const byName = /* @__PURE__ */ new Map();
|
|
2867
2873
|
const visit = (dir) => {
|
|
@@ -2897,6 +2903,7 @@ function enumerateSkills(skillsDir2, source = "hermes") {
|
|
|
2897
2903
|
name: parsed.name,
|
|
2898
2904
|
description: parsed.description,
|
|
2899
2905
|
source,
|
|
2906
|
+
triggers: parsed.triggers,
|
|
2900
2907
|
body: text,
|
|
2901
2908
|
location: path.relative(skillsDir2, full)
|
|
2902
2909
|
});
|
|
@@ -14316,7 +14323,7 @@ function dumpEvent(event) {
|
|
|
14316
14323
|
function positiveNumber(value) {
|
|
14317
14324
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
14318
14325
|
}
|
|
14319
|
-
var PLUGIN_VERSION = true ? "0.34.
|
|
14326
|
+
var PLUGIN_VERSION = true ? "0.34.6" : "unknown";
|
|
14320
14327
|
var PRESENCE_PING_INTERVAL_MS = 12e4;
|
|
14321
14328
|
function resolveGatewayToken(api) {
|
|
14322
14329
|
const token2 = api.config?.gateway?.auth?.token;
|
package/dist/package.json
CHANGED
package/package.json
CHANGED