skillfish 1.0.6 → 1.0.7
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/commands/add.js +16 -4
- package/dist/lib/installer.js +4 -2
- package/package.json +1 -1
package/dist/commands/add.js
CHANGED
|
@@ -9,7 +9,7 @@ import pc from 'picocolors';
|
|
|
9
9
|
import { trackInstall } from '../telemetry.js';
|
|
10
10
|
import { isValidPath, parseFrontmatter, deriveSkillName, toTitleCase, truncate, batchMap, createJsonOutput, isInputTTY, isTTY, } from '../utils.js';
|
|
11
11
|
import { getDetectedAgents, AGENT_CONFIGS } from '../lib/agents.js';
|
|
12
|
-
import { findAllSkillMdFiles, fetchSkillMdContent, SKILL_FILENAME, RateLimitError, RepoNotFoundError, NetworkError, GitHubApiError, } from '../lib/github.js';
|
|
12
|
+
import { findAllSkillMdFiles, fetchSkillMdContent, fetchDefaultBranch, SKILL_FILENAME, RateLimitError, RepoNotFoundError, NetworkError, GitHubApiError, } from '../lib/github.js';
|
|
13
13
|
import { installSkill } from '../lib/installer.js';
|
|
14
14
|
import { EXIT_CODES, isValidName } from '../lib/constants.js';
|
|
15
15
|
// === Command Definition ===
|
|
@@ -113,9 +113,21 @@ Examples:
|
|
|
113
113
|
exitWithError('Invalid repository format. Use: owner/repo', EXIT_CODES.INVALID_ARGS);
|
|
114
114
|
}
|
|
115
115
|
// 1. Discover or select skills
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
let discoveryResult;
|
|
117
|
+
if (explicitPath) {
|
|
118
|
+
// For explicit paths, we still need to fetch the default branch for degit
|
|
119
|
+
try {
|
|
120
|
+
const branch = await fetchDefaultBranch(owner, repo);
|
|
121
|
+
discoveryResult = { paths: [explicitPath], branch };
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
// If we can't fetch the branch, let degit try its own detection
|
|
125
|
+
discoveryResult = { paths: [explicitPath], branch: undefined };
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
discoveryResult = await discoverSkillPaths(owner, repo, installAll, jsonMode, jsonOutput, skillNameArg);
|
|
130
|
+
}
|
|
119
131
|
if (!discoveryResult || discoveryResult.paths.length === 0) {
|
|
120
132
|
if (jsonMode) {
|
|
121
133
|
outputJsonAndExit(EXIT_CODES.NOT_FOUND);
|
package/dist/lib/installer.js
CHANGED
|
@@ -155,8 +155,10 @@ export async function installSkill(owner, repo, skillPath, skillName, agents, op
|
|
|
155
155
|
else {
|
|
156
156
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
157
157
|
// Provide more helpful error messages for common degit failures
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
// Match "could not find commit hash for HEAD" or "could not find commit hash for <branch>"
|
|
159
|
+
if (errMsg.includes('could not find commit hash')) {
|
|
160
|
+
const branchInfo = branch ? ` (branch: ${branch})` : '';
|
|
161
|
+
result.failureReason = `Could not clone repository. The branch or path may not exist, or there may be a network issue. Tried: ${owner}/${repo}${skillPath !== SKILL_FILENAME ? `/${skillPath}` : ''}${branchInfo}`;
|
|
160
162
|
}
|
|
161
163
|
else if (errMsg.includes('404')) {
|
|
162
164
|
result.failureReason = `Repository or path not found: ${owner}/${repo}${skillPath !== SKILL_FILENAME ? `/${skillPath}` : ''}`;
|