@haus-tech/haus-workflow 0.13.0 → 0.13.1
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 +6 -0
- package/dist/cli.js +23 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.13.1](https://github.com/WeAreHausTech/haus-workflow/compare/v0.13.0...v0.13.1) (2026-06-03)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
- **catalog:** download skill reference files into cache ([#63](https://github.com/WeAreHausTech/haus-workflow/issues/63)) ([db67180](https://github.com/WeAreHausTech/haus-workflow/commit/db671807273a45e97d5f5cd9505b43284d7b7389))
|
|
8
|
+
|
|
3
9
|
## [0.13.0](https://github.com/WeAreHausTech/haus-workflow/compare/v0.12.1...v0.13.0) (2026-06-03)
|
|
4
10
|
|
|
5
11
|
### Features
|
package/dist/cli.js
CHANGED
|
@@ -75,6 +75,27 @@ function safeJoin(base, itemPath) {
|
|
|
75
75
|
const resolved = path.resolve(base, itemPath);
|
|
76
76
|
return resolved.startsWith(base + path.sep) || resolved === base ? resolved : null;
|
|
77
77
|
}
|
|
78
|
+
function isExternalReference(ref) {
|
|
79
|
+
return /^[a-z][a-z0-9+.-]*:\/\//i.test(ref);
|
|
80
|
+
}
|
|
81
|
+
async function downloadSkillReferences(item, destDir) {
|
|
82
|
+
for (const ref of item.references ?? []) {
|
|
83
|
+
if (isExternalReference(ref)) continue;
|
|
84
|
+
const refDest = safeJoin(destDir, ref);
|
|
85
|
+
if (!refDest) {
|
|
86
|
+
warn(`Skipping reference "${ref}" for ${item.id}: path traversal detected`);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (await fs.pathExists(refDest)) continue;
|
|
90
|
+
const text = await fetchText(`${REMOTE_BASE}/${item.path}/${ref}`);
|
|
91
|
+
if (text === null) {
|
|
92
|
+
warn(`Failed to fetch reference "${ref}" for ${item.id}`);
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
await fs.ensureDir(path.dirname(refDest));
|
|
96
|
+
await fs.writeFile(refDest, text, "utf8");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
78
99
|
async function syncRemoteCatalog() {
|
|
79
100
|
const items = await fetchRemoteManifest();
|
|
80
101
|
if (!items) {
|
|
@@ -108,6 +129,7 @@ async function syncRemoteCatalog() {
|
|
|
108
129
|
}
|
|
109
130
|
const dest = path.join(destDir, "SKILL.md");
|
|
110
131
|
if (await fs.pathExists(dest)) {
|
|
132
|
+
await downloadSkillReferences(item, destDir);
|
|
111
133
|
unchanged++;
|
|
112
134
|
continue;
|
|
113
135
|
}
|
|
@@ -120,6 +142,7 @@ async function syncRemoteCatalog() {
|
|
|
120
142
|
}
|
|
121
143
|
await fs.ensureDir(path.dirname(dest));
|
|
122
144
|
await fs.writeFile(dest, text, "utf8");
|
|
145
|
+
await downloadSkillReferences(item, destDir);
|
|
123
146
|
newItems.push(item.id);
|
|
124
147
|
} else {
|
|
125
148
|
const dest = safeJoin(CACHE_DIR, item.path);
|