skillfish 1.0.28 → 1.0.29
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/lib/agents.d.ts +3 -0
- package/dist/lib/agents.js +6 -2
- package/dist/lib/installer.d.ts +1 -1
- package/dist/lib/installer.js +4 -2
- package/package.json +1 -1
package/dist/lib/agents.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export interface AgentConfig {
|
|
10
10
|
readonly name: string;
|
|
11
11
|
readonly dir: string;
|
|
12
|
+
readonly globalDir?: string;
|
|
12
13
|
readonly homePaths: readonly string[];
|
|
13
14
|
readonly cwdPaths: readonly string[];
|
|
14
15
|
}
|
|
@@ -32,6 +33,7 @@ export declare function detectAgent(config: AgentConfig, projectDir?: string): b
|
|
|
32
33
|
export interface Agent {
|
|
33
34
|
readonly name: string;
|
|
34
35
|
readonly dir: string;
|
|
36
|
+
readonly globalDir?: string;
|
|
35
37
|
readonly detect: () => boolean;
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
@@ -47,5 +49,6 @@ export type DetectionLocation = 'global' | 'project' | 'both';
|
|
|
47
49
|
export declare function getDetectedAgentsForLocation(location: DetectionLocation, projectDir?: string): readonly Agent[];
|
|
48
50
|
/**
|
|
49
51
|
* Get the skill directory path for an agent.
|
|
52
|
+
* Uses globalDir (if defined) when baseDir is the home directory.
|
|
50
53
|
*/
|
|
51
54
|
export declare function getAgentSkillDir(agent: Agent | AgentConfig, baseDir: string): string;
|
package/dist/lib/agents.js
CHANGED
|
@@ -10,7 +10,7 @@ export const AGENT_CONFIGS = [
|
|
|
10
10
|
{
|
|
11
11
|
name: 'Claude Code',
|
|
12
12
|
dir: '.claude/skills',
|
|
13
|
-
homePaths: ['.claude
|
|
13
|
+
homePaths: ['.claude'],
|
|
14
14
|
cwdPaths: ['.claude'],
|
|
15
15
|
},
|
|
16
16
|
{
|
|
@@ -34,6 +34,7 @@ export const AGENT_CONFIGS = [
|
|
|
34
34
|
{
|
|
35
35
|
name: 'GitHub Copilot',
|
|
36
36
|
dir: '.github/skills',
|
|
37
|
+
globalDir: '.copilot/skills',
|
|
37
38
|
homePaths: ['.copilot/config.json', '.copilot'],
|
|
38
39
|
cwdPaths: ['.github/skills', '.github/copilot-instructions.md'],
|
|
39
40
|
},
|
|
@@ -243,12 +244,15 @@ export function getDetectedAgentsForLocation(location, projectDir) {
|
|
|
243
244
|
}).map((config) => ({
|
|
244
245
|
name: config.name,
|
|
245
246
|
dir: config.dir,
|
|
247
|
+
...(config.globalDir && { globalDir: config.globalDir }),
|
|
246
248
|
detect: () => detectAgent(config, cwd),
|
|
247
249
|
}));
|
|
248
250
|
}
|
|
249
251
|
/**
|
|
250
252
|
* Get the skill directory path for an agent.
|
|
253
|
+
* Uses globalDir (if defined) when baseDir is the home directory.
|
|
251
254
|
*/
|
|
252
255
|
export function getAgentSkillDir(agent, baseDir) {
|
|
253
|
-
|
|
256
|
+
const isGlobal = 'globalDir' in agent && agent.globalDir && baseDir === homedir();
|
|
257
|
+
return join(baseDir, isGlobal ? agent.globalDir : agent.dir);
|
|
254
258
|
}
|
package/dist/lib/installer.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Skill installation logic.
|
|
3
3
|
* Handles downloading, validating, and installing skills to agent directories.
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
5
|
+
import { type Agent } from './agents.js';
|
|
6
6
|
import { type SkillSource } from './manifest.js';
|
|
7
7
|
export interface InstallResult {
|
|
8
8
|
installed: {
|
package/dist/lib/installer.js
CHANGED
|
@@ -7,6 +7,7 @@ import { homedir } from 'os';
|
|
|
7
7
|
import { join } from 'path';
|
|
8
8
|
import { randomUUID } from 'crypto';
|
|
9
9
|
import { downloadTemplate } from 'giget';
|
|
10
|
+
import { getAgentSkillDir } from './agents.js';
|
|
10
11
|
import { SKILL_FILENAME } from './github.js';
|
|
11
12
|
import { writeManifest, MANIFEST_VERSION, } from './manifest.js';
|
|
12
13
|
/**
|
|
@@ -128,7 +129,8 @@ export async function installSkill(owner, repo, skillPath, skillName, agents, op
|
|
|
128
129
|
}
|
|
129
130
|
// Copy to each agent directory
|
|
130
131
|
for (const agent of agents) {
|
|
131
|
-
const
|
|
132
|
+
const agentSkillDir = getAgentSkillDir(agent, baseDir);
|
|
133
|
+
const destDir = join(agentSkillDir, skillName);
|
|
132
134
|
if (existsSync(destDir) && !force) {
|
|
133
135
|
result.skipped.push({
|
|
134
136
|
skill: skillName,
|
|
@@ -138,7 +140,7 @@ export async function installSkill(owner, repo, skillPath, skillName, agents, op
|
|
|
138
140
|
continue;
|
|
139
141
|
}
|
|
140
142
|
// Create parent directory
|
|
141
|
-
mkdirSync(
|
|
143
|
+
mkdirSync(agentSkillDir, { recursive: true, mode: 0o700 });
|
|
142
144
|
// Atomic install: backup existing directory before overwrite (allows rollback on failure)
|
|
143
145
|
const backupDir = `${destDir}.skillfish-backup`;
|
|
144
146
|
let hasBackup = false;
|
package/package.json
CHANGED