@indigoai-us/hq-cli 5.103.30 → 5.103.31
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 +2 -0
- package/dist/commands/skill.js +17 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/commands/skill.js
CHANGED
|
@@ -97,6 +97,21 @@ export function readCompanyPrefix(hqRoot, companySlug) {
|
|
|
97
97
|
return undefined;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* A caller-input condition inside `resolveSkillUid` — the target has no
|
|
102
|
+
* SKILL.md, or the resolved SKILL.md carries no registered skill_uid — is the
|
|
103
|
+
* user's request/state, not an hq-cli defect. Mark it `expected` so the
|
|
104
|
+
* top-level boundary prints the actionable message and skips Sentry, exactly as
|
|
105
|
+
* `skillApiError` does for the remote 4xx siblings (HQ-CLI-Z). Redact at the
|
|
106
|
+
* throw site: the boundary's expected branch prints `err.message` verbatim, so
|
|
107
|
+
* these caller-supplied paths must be scrubbed here, not only on the fallback
|
|
108
|
+
* path they use today.
|
|
109
|
+
*/
|
|
110
|
+
function localSkillError(message) {
|
|
111
|
+
return Object.assign(new Error(redactErrorText(message) || message), {
|
|
112
|
+
expected: true,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
100
115
|
/** Resolve a UID directly, or read the immutable UID from a local SKILL.md. */
|
|
101
116
|
export function resolveSkillUid(target, cwd) {
|
|
102
117
|
if (SKILL_UID_PATTERN.test(target))
|
|
@@ -106,11 +121,11 @@ export function resolveSkillUid(target, cwd) {
|
|
|
106
121
|
filePath = path.join(filePath, "SKILL.md");
|
|
107
122
|
}
|
|
108
123
|
if (!fs.existsSync(filePath)) {
|
|
109
|
-
throw
|
|
124
|
+
throw localSkillError(`No SKILL.md found at '${target}'. Pass a SKILL.md path, its directory, or a skl_… uid.`);
|
|
110
125
|
}
|
|
111
126
|
const uid = parseSkillUid(fs.readFileSync(filePath, "utf8"));
|
|
112
127
|
if (!uid) {
|
|
113
|
-
throw
|
|
128
|
+
throw localSkillError(`The SKILL.md at '${filePath}' has no registered skill_uid. Register and stamp it with 'hq skill create <slug> --company <company>', then retry.`);
|
|
114
129
|
}
|
|
115
130
|
return uid;
|
|
116
131
|
}
|