@rynx-ai/skills 0.1.10 → 0.1.11-beta.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.
- package/dist/artifact.d.ts +2 -0
- package/dist/artifact.js +5 -1
- package/package.json +2 -2
package/dist/artifact.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export interface SkillReceipt {
|
|
|
25
25
|
}
|
|
26
26
|
/** Receipt file written next to a skill at install time. */
|
|
27
27
|
export declare const SKILL_RECEIPT_FILE = ".rynx-skill.json";
|
|
28
|
+
/** A skill name is also used as a filesystem entry by provider adapters. */
|
|
29
|
+
export declare const SAFE_SKILL_NAME: RegExp;
|
|
28
30
|
/** The raw YAML frontmatter block of a `SKILL.md` (between the leading `---`s), or null. */
|
|
29
31
|
export declare function extractSkillFrontmatter(content: string): string | null;
|
|
30
32
|
/** Parse a `SKILL.md` body's leading YAML frontmatter for name + description. */
|
package/dist/artifact.js
CHANGED
|
@@ -11,6 +11,8 @@ import { readFile, readdir } from "node:fs/promises";
|
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
/** Receipt file written next to a skill at install time. */
|
|
13
13
|
export const SKILL_RECEIPT_FILE = ".rynx-skill.json";
|
|
14
|
+
/** A skill name is also used as a filesystem entry by provider adapters. */
|
|
15
|
+
export const SAFE_SKILL_NAME = /^[a-z0-9][a-z0-9-]{0,127}$/;
|
|
14
16
|
/** The raw YAML frontmatter block of a `SKILL.md` (between the leading `---`s), or null. */
|
|
15
17
|
export function extractSkillFrontmatter(content) {
|
|
16
18
|
const match = content.match(/^---\s*\r?\n([\s\S]*?)\r?\n---\s*(?:\r?\n|$)/);
|
|
@@ -69,6 +71,8 @@ export async function readSkillMeta(skillDir) {
|
|
|
69
71
|
const fm = parseSkillFrontmatter(content);
|
|
70
72
|
if (!fm)
|
|
71
73
|
return null;
|
|
74
|
+
if (!SAFE_SKILL_NAME.test(fm.name) || fm.name !== path.basename(skillDir))
|
|
75
|
+
return null;
|
|
72
76
|
const ref = await readReceiptRef(skillDir);
|
|
73
77
|
return { ...fm, dir: skillDir, ...(ref ? { ref } : {}) };
|
|
74
78
|
}
|
|
@@ -104,7 +108,7 @@ export function parseSkillRefValue(value) {
|
|
|
104
108
|
if (typeof value !== "object" || value === null)
|
|
105
109
|
return null;
|
|
106
110
|
const v = value;
|
|
107
|
-
if (typeof v.name !== "string" || !v.name
|
|
111
|
+
if (typeof v.name !== "string" || !SAFE_SKILL_NAME.test(v.name))
|
|
108
112
|
return null;
|
|
109
113
|
const install = v.install;
|
|
110
114
|
if (typeof install !== "object" || install === null)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rynx-ai/skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11-beta.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/rynx-ai/rynx.git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@rynx-ai/protocol": "0.1.
|
|
29
|
+
"@rynx-ai/protocol": "0.1.11-beta.2"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "rm -rf dist && tsc -p tsconfig.json"
|