@indigoai-us/hq-cli 5.103.33 → 5.103.34
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 +22 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/commands/skill.js
CHANGED
|
@@ -136,11 +136,17 @@ export function resolveSkillUid(target, cwd) {
|
|
|
136
136
|
return uid;
|
|
137
137
|
}
|
|
138
138
|
export function canonicalCompanySkillPath(hqRoot, companySlug, skillSlug) {
|
|
139
|
+
// HQ-CLI-17 (Sentry 7699881899): both validators reject CALLER-supplied input
|
|
140
|
+
// — the `--company` slug and the `create <slug>` argument. A malformed value is
|
|
141
|
+
// the caller's request, not an hq-cli defect, so throw `localSkillError`
|
|
142
|
+
// (expected: true) and let the top-level boundary print the remedy and skip
|
|
143
|
+
// Sentry, exactly as the sibling caller-input throws in this module already do.
|
|
144
|
+
// The message text is unchanged; only its CLASS changes.
|
|
139
145
|
if (!COMPANY_SLUG_PATTERN.test(companySlug)) {
|
|
140
|
-
throw
|
|
146
|
+
throw localSkillError("Company slug must start with a lowercase letter or number and contain only lowercase letters, numbers, and hyphens.");
|
|
141
147
|
}
|
|
142
148
|
if (!SKILL_SLUG_PATTERN.test(skillSlug)) {
|
|
143
|
-
throw
|
|
149
|
+
throw localSkillError("Skill slug must start with a lowercase letter or number and contain only lowercase letters, numbers, and hyphens.");
|
|
144
150
|
}
|
|
145
151
|
return path.join(hqRoot, "companies", companySlug, "skills", skillSlug, "SKILL.md");
|
|
146
152
|
}
|
|
@@ -277,7 +283,10 @@ export function registerSkillCommand(program, deps = {}) {
|
|
|
277
283
|
.option("--surface-only", "Refresh local skill discovery without registration or sync")
|
|
278
284
|
.action(async (slug, opts) => {
|
|
279
285
|
if (!SKILL_SLUG_PATTERN.test(slug)) {
|
|
280
|
-
|
|
286
|
+
// HQ-CLI-17: the `create <slug>` argument is caller input; a malformed
|
|
287
|
+
// slug is a correctly-enforced refusal, not a crash. Mark it expected
|
|
288
|
+
// (via localSkillError) so it is printed and skipped for Sentry.
|
|
289
|
+
throw localSkillError("Skill slug must start with a lowercase letter or number and contain only lowercase letters, numbers, and hyphens.");
|
|
281
290
|
}
|
|
282
291
|
const parentOpts = skill.opts();
|
|
283
292
|
const resolvedRoot = path.resolve(parentOpts.hqRoot ?? hqRoot);
|
|
@@ -285,7 +294,13 @@ export function registerSkillCommand(program, deps = {}) {
|
|
|
285
294
|
const filePath = canonicalCompanySkillPath(resolvedRoot, companySlug, slug);
|
|
286
295
|
const legacyPrefix = readCompanyPrefix(resolvedRoot, companySlug);
|
|
287
296
|
if (fs.existsSync(filePath) && !fs.statSync(filePath).isFile()) {
|
|
288
|
-
|
|
297
|
+
// HQ-CLI-17: the target path is derived from caller input and its
|
|
298
|
+
// on-disk shape is the caller's own filesystem, not an hq-cli defect.
|
|
299
|
+
// The bare Error also embedded this absolute (home-relative) path, so it
|
|
300
|
+
// minted a NEW Sentry fingerprint per machine. Mark it expected so it is
|
|
301
|
+
// printed (with the path the caller needs) and never captured. Redaction
|
|
302
|
+
// in localSkillError scrubs credentials but leaves plain paths intact.
|
|
303
|
+
throw localSkillError(`Expected a SKILL.md file at '${filePath}'.`);
|
|
289
304
|
}
|
|
290
305
|
if (opts.surfaceOnly === true) {
|
|
291
306
|
// Discovery wrappers are execution surfaces. Never create one for an
|
|
@@ -396,8 +411,10 @@ export function registerSkillCommand(program, deps = {}) {
|
|
|
396
411
|
.requiredOption("-m, --message <text>", "The improvement to discuss")
|
|
397
412
|
.action(async (target, opts) => {
|
|
398
413
|
const message = opts.message.trim();
|
|
414
|
+
// HQ-CLI-17: a blank `-m/--message` is caller input, not an hq-cli defect.
|
|
415
|
+
// Mark it expected so it is printed and skipped for Sentry.
|
|
399
416
|
if (!message)
|
|
400
|
-
throw
|
|
417
|
+
throw localSkillError("An improvement message is required.");
|
|
401
418
|
const parentOpts = skill.opts();
|
|
402
419
|
const resolvedRoot = path.resolve(parentOpts.hqRoot ?? hqRoot);
|
|
403
420
|
const companySlug = resolveCompanySlug(parentOpts.company, resolvedRoot);
|