@markjaquith/agency 3.9.4 → 3.9.5
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/package.json
CHANGED
|
@@ -116,8 +116,8 @@ const unquote = (value: string) => {
|
|
|
116
116
|
return trimmed
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
const skillInfo = (
|
|
120
|
-
const raw = readFileSync(
|
|
119
|
+
const skillInfo = (path: string) => {
|
|
120
|
+
const raw = readFileSync(path, "utf8")
|
|
121
121
|
const match = raw.match(/^---\\r?\\n([\\s\\S]*?)\\r?\\n---\\r?\\n?/)
|
|
122
122
|
const frontmatter = match?.[1] ?? ""
|
|
123
123
|
const scalar = (name: string) => {
|
|
@@ -126,15 +126,15 @@ const skillInfo = (location: string) => {
|
|
|
126
126
|
))?.[1]
|
|
127
127
|
return value ? unquote(value) : undefined
|
|
128
128
|
}
|
|
129
|
-
const id = basename(
|
|
130
|
-
? basename(dirname(
|
|
131
|
-
: basename(
|
|
129
|
+
const id = basename(path) === "SKILL.md"
|
|
130
|
+
? basename(dirname(path))
|
|
131
|
+
: basename(path, extname(path))
|
|
132
132
|
const description = scalar("description")
|
|
133
133
|
return {
|
|
134
134
|
id,
|
|
135
135
|
name: scalar("name") ?? id,
|
|
136
136
|
...(description === undefined ? {} : { description }),
|
|
137
|
-
|
|
137
|
+
path,
|
|
138
138
|
content: match ? raw.slice(match[0].length) : raw,
|
|
139
139
|
}
|
|
140
140
|
}
|
|
@@ -283,8 +283,8 @@ const setup = async (context: V2PluginContext) => {
|
|
|
283
283
|
)
|
|
284
284
|
await context.skill.transform((skills) => {
|
|
285
285
|
for (const path of paths) {
|
|
286
|
-
for (const
|
|
287
|
-
skills.add(skillInfo(
|
|
286
|
+
for (const skillPath of skillFiles(path)) {
|
|
287
|
+
skills.add(skillInfo(skillPath) as unknown as Parameters<typeof skills.add>[0])
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
})
|