@yama662607/agent-config-sync 0.1.0
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/LICENSE +21 -0
- package/README.md +174 -0
- package/dist/catalog.d.ts +65 -0
- package/dist/catalog.js +328 -0
- package/dist/catalog.js.map +1 -0
- package/dist/cli-catalog.d.ts +70 -0
- package/dist/cli-catalog.js +433 -0
- package/dist/cli-catalog.js.map +1 -0
- package/dist/cli-diagnostics.d.ts +14 -0
- package/dist/cli-diagnostics.js +177 -0
- package/dist/cli-diagnostics.js.map +1 -0
- package/dist/cli-init.d.ts +8 -0
- package/dist/cli-init.js +77 -0
- package/dist/cli-init.js.map +1 -0
- package/dist/cli-mcp.d.ts +38 -0
- package/dist/cli-mcp.js +179 -0
- package/dist/cli-mcp.js.map +1 -0
- package/dist/cli-skill.d.ts +51 -0
- package/dist/cli-skill.js +239 -0
- package/dist/cli-skill.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +868 -0
- package/dist/cli.js.map +1 -0
- package/dist/config-adapters.d.ts +32 -0
- package/dist/config-adapters.js +410 -0
- package/dist/config-adapters.js.map +1 -0
- package/dist/fs.d.ts +2 -0
- package/dist/fs.js +20 -0
- package/dist/fs.js.map +1 -0
- package/dist/project-discovery.d.ts +20 -0
- package/dist/project-discovery.js +79 -0
- package/dist/project-discovery.js.map +1 -0
- package/dist/prompts/confirm-prompt.d.ts +9 -0
- package/dist/prompts/confirm-prompt.js +54 -0
- package/dist/prompts/confirm-prompt.js.map +1 -0
- package/dist/prompts/custom-multiselect.d.ts +9 -0
- package/dist/prompts/custom-multiselect.js +28 -0
- package/dist/prompts/custom-multiselect.js.map +1 -0
- package/dist/prompts/index.d.ts +5 -0
- package/dist/prompts/index.js +6 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/mcp-prompt.d.ts +5 -0
- package/dist/prompts/mcp-prompt.js +57 -0
- package/dist/prompts/mcp-prompt.js.map +1 -0
- package/dist/prompts/skill-prompt.d.ts +5 -0
- package/dist/prompts/skill-prompt.js +57 -0
- package/dist/prompts/skill-prompt.js.map +1 -0
- package/dist/prompts/target-prompt.d.ts +7 -0
- package/dist/prompts/target-prompt.js +47 -0
- package/dist/prompts/target-prompt.js.map +1 -0
- package/dist/registry.d.ts +49 -0
- package/dist/registry.js +121 -0
- package/dist/registry.js.map +1 -0
- package/dist/skill-adapters.d.ts +53 -0
- package/dist/skill-adapters.js +183 -0
- package/dist/skill-adapters.js.map +1 -0
- package/dist/types.d.ts +151 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
// @ts-ignore - enquirer uses CommonJS exports
|
|
4
|
+
const Confirm = require('enquirer/lib/prompts/confirm.js');
|
|
5
|
+
/**
|
|
6
|
+
* Prompt user to confirm the selection summary.
|
|
7
|
+
* @param targets - Selected target agents
|
|
8
|
+
* @param mcps - Selected MCP server IDs
|
|
9
|
+
* @param skills - Selected skill IDs
|
|
10
|
+
* @returns True if user confirmed, false otherwise
|
|
11
|
+
*/
|
|
12
|
+
export async function promptConfirm(targets, mcps, skills) {
|
|
13
|
+
console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
14
|
+
console.log('Summary');
|
|
15
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
|
|
16
|
+
console.log(`Targets: ${targets.join(', ')}`);
|
|
17
|
+
if (mcps.length > 0) {
|
|
18
|
+
console.log('\nMCP Servers to add:');
|
|
19
|
+
for (const mcpId of mcps) {
|
|
20
|
+
console.log(` • ${mcpId}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (skills.length > 0) {
|
|
24
|
+
console.log('\nSkills to add:');
|
|
25
|
+
for (const skillId of skills) {
|
|
26
|
+
console.log(` • ${skillId}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (mcps.length === 0 && skills.length === 0) {
|
|
30
|
+
console.log('\nNo items selected. Nothing to add.\n');
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
const prompt = new Confirm({
|
|
34
|
+
name: 'confirm',
|
|
35
|
+
message: 'Add these items to your project?',
|
|
36
|
+
initial: true,
|
|
37
|
+
// Override key actions: Ctrl+n → down, Ctrl+p → up (emacs-style)
|
|
38
|
+
// Note: Confirm only has Yes/No, but this adds consistency
|
|
39
|
+
actions: {
|
|
40
|
+
ctrl: {
|
|
41
|
+
n: 'down',
|
|
42
|
+
p: 'up'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
try {
|
|
47
|
+
return await prompt.run();
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// User cancelled (Ctrl+C)
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=confirm-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-prompt.js","sourceRoot":"","sources":["../../src/prompts/confirm-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,8CAA8C;AAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAAC;AAG3D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAqB,EACrB,IAAc,EACd,MAAgB;IAEhB,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;IAE1D,O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Custom MultiSelect prompt with emacs-style Ctrl+n/p navigation.
|
|
4
|
+
* Extends enquirer's MultiSelect to support both arrow keys and Ctrl+n/p.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CustomMultiSelect extends MultiSelectBase {
|
|
7
|
+
constructor(options: any);
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
// @ts-ignore - enquirer uses CommonJS exports
|
|
4
|
+
const MultiSelectBase = require('enquirer/lib/prompts/multiselect.js');
|
|
5
|
+
/**
|
|
6
|
+
* Custom MultiSelect prompt with emacs-style Ctrl+n/p navigation.
|
|
7
|
+
* Extends enquirer's MultiSelect to support both arrow keys and Ctrl+n/p.
|
|
8
|
+
*/
|
|
9
|
+
export class CustomMultiSelect extends MultiSelectBase {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
// Override key actions: Ctrl+n → down, Ctrl+p → up (emacs-style)
|
|
12
|
+
const customActions = {
|
|
13
|
+
ctrl: {
|
|
14
|
+
...options.actions?.ctrl,
|
|
15
|
+
n: 'down', // Override 'newItem'
|
|
16
|
+
p: 'up' // Override 'search'
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
super({
|
|
20
|
+
...options,
|
|
21
|
+
actions: {
|
|
22
|
+
...options.actions,
|
|
23
|
+
...customActions
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=custom-multiselect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-multiselect.js","sourceRoot":"","sources":["../../src/prompts/custom-multiselect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,8CAA8C;AAC9C,MAAM,eAAe,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,eAAe;IACpD,YAAY,OAAY;QACtB,iEAAiE;QACjE,MAAM,aAAa,GAAG;YACpB,IAAI,EAAE;gBACJ,GAAG,OAAO,CAAC,OAAO,EAAE,IAAI;gBACxB,CAAC,EAAE,MAAM,EAAG,qBAAqB;gBACjC,CAAC,EAAE,IAAI,CAAK,oBAAoB;aACjC;SACF,CAAC;QAEF,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,GAAG,OAAO,CAAC,OAAO;gBAClB,GAAG,aAAa;aACjB;SACF,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { promptTargets } from './target-prompt.js';
|
|
2
|
+
export { promptMcps } from './mcp-prompt.js';
|
|
3
|
+
export { promptSkills } from './skill-prompt.js';
|
|
4
|
+
export { promptConfirm } from './confirm-prompt.js';
|
|
5
|
+
export { CustomMultiSelect } from './custom-multiselect.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
// @ts-ignore - enquirer uses CommonJS exports
|
|
4
|
+
const AutoComplete = require('enquirer/lib/prompts/autocomplete.js');
|
|
5
|
+
import { listMcps } from '../catalog.js';
|
|
6
|
+
/**
|
|
7
|
+
* Prompt user to select MCP servers from catalog.
|
|
8
|
+
* @returns Selected MCP server IDs
|
|
9
|
+
*/
|
|
10
|
+
export async function promptMcps() {
|
|
11
|
+
const mcps = await listMcps();
|
|
12
|
+
if (mcps.length === 0) {
|
|
13
|
+
console.log('No MCP entries in catalog.\n');
|
|
14
|
+
console.log('Tip: Use these commands to add MCPs first:');
|
|
15
|
+
console.log(' acsync catalog mcp add @modelcontextprotocol/server-github');
|
|
16
|
+
console.log(' acsync catalog mcp add @modelcontextprotocol/server-filesystem\n');
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
const choices = mcps.map(mcp => ({
|
|
20
|
+
name: mcp.id,
|
|
21
|
+
message: mcp.displayName || mcp.id,
|
|
22
|
+
value: mcp.id,
|
|
23
|
+
hint: mcp.description.slice(0, 50)
|
|
24
|
+
}));
|
|
25
|
+
const prompt = new AutoComplete({
|
|
26
|
+
name: 'mcps',
|
|
27
|
+
message: 'Select MCP servers (type to search)',
|
|
28
|
+
multiple: true,
|
|
29
|
+
choices: choices,
|
|
30
|
+
limit: 10,
|
|
31
|
+
// Override key actions: Ctrl+n → down, Ctrl+p → up (emacs-style)
|
|
32
|
+
actions: {
|
|
33
|
+
ctrl: {
|
|
34
|
+
n: 'down',
|
|
35
|
+
p: 'up'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
suggest: (input, choices) => {
|
|
39
|
+
// Simple fuzzy search - matches if input is substring of name or message
|
|
40
|
+
const lowerInput = input.toLowerCase();
|
|
41
|
+
return choices.filter(choice => {
|
|
42
|
+
const name = (choice.name || '').toLowerCase();
|
|
43
|
+
const message = (choice.message || '').toLowerCase();
|
|
44
|
+
return name.includes(lowerInput) || message.includes(lowerInput);
|
|
45
|
+
}).slice(0, 10);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
try {
|
|
49
|
+
const result = await prompt.run();
|
|
50
|
+
return result || [];
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// User cancelled (Ctrl+C)
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=mcp-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-prompt.js","sourceRoot":"","sources":["../../src/prompts/mcp-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,8CAA8C;AAC9C,MAAM,YAAY,GAAG,OAAO,CAAC,sCAAsC,CAAC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,IAAI,GAAG,MAAM,QAAQ,EAAE,CAAC;IAE9B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;QAC5E,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/B,IAAI,EAAE,GAAG,CAAC,EAAE;QACZ,OAAO,EAAE,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,EAAE;QAClC,KAAK,EAAE,GAAG,CAAC,EAAE;QACb,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;KACnC,CAAC,CAAC,CAAC;IAEJ,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC;QAC9B,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,qCAAqC;QAC9C,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,EAAE;QACT,iEAAiE;QACjE,OAAO,EAAE;YACP,IAAI,EAAE;gBACJ,CAAC,EAAE,MAAM;gBACT,CAAC,EAAE,IAAI;aACR;SACF;QACD,OAAO,EAAE,CAAC,KAAa,EAAE,OAAc,EAAE,EAAE;YACzC,yEAAyE;YACzE,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;YACvC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;gBAC7B,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;gBAC/C,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;gBACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YACnE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAClB,CAAC;KACF,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;QAClC,OAAO,MAAM,IAAI,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,0BAA0B;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
// @ts-ignore - enquirer uses CommonJS exports
|
|
4
|
+
const AutoComplete = require('enquirer/lib/prompts/autocomplete.js');
|
|
5
|
+
import { listSkills } from '../catalog.js';
|
|
6
|
+
/**
|
|
7
|
+
* Prompt user to select skills from catalog.
|
|
8
|
+
* @returns Selected skill IDs
|
|
9
|
+
*/
|
|
10
|
+
export async function promptSkills() {
|
|
11
|
+
const skills = await listSkills();
|
|
12
|
+
if (skills.length === 0) {
|
|
13
|
+
console.log('No skill entries in catalog.\n');
|
|
14
|
+
console.log('Tip: Use these commands to add skills first:');
|
|
15
|
+
console.log(' acsync catalog skill import ~/.claude/skills/my-skill');
|
|
16
|
+
console.log(' acsync skill install <github-url>\n');
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
const choices = skills.map(skill => ({
|
|
20
|
+
name: skill.id,
|
|
21
|
+
message: skill.displayName || skill.id,
|
|
22
|
+
value: skill.id,
|
|
23
|
+
hint: skill.description.slice(0, 50)
|
|
24
|
+
}));
|
|
25
|
+
const prompt = new AutoComplete({
|
|
26
|
+
name: 'skills',
|
|
27
|
+
message: 'Select skills (type to search)',
|
|
28
|
+
multiple: true,
|
|
29
|
+
choices: choices,
|
|
30
|
+
limit: 10,
|
|
31
|
+
// Override key actions: Ctrl+n → down, Ctrl+p → up (emacs-style)
|
|
32
|
+
actions: {
|
|
33
|
+
ctrl: {
|
|
34
|
+
n: 'down',
|
|
35
|
+
p: 'up'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
suggest: (input, choices) => {
|
|
39
|
+
// Simple fuzzy search - matches if input is substring of name or message
|
|
40
|
+
const lowerInput = input.toLowerCase();
|
|
41
|
+
return choices.filter(choice => {
|
|
42
|
+
const name = (choice.name || '').toLowerCase();
|
|
43
|
+
const message = (choice.message || '').toLowerCase();
|
|
44
|
+
return name.includes(lowerInput) || message.includes(lowerInput);
|
|
45
|
+
}).slice(0, 10);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
try {
|
|
49
|
+
const result = await prompt.run();
|
|
50
|
+
return result || [];
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// User cancelled (Ctrl+C)
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=skill-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-prompt.js","sourceRoot":"","sources":["../../src/prompts/skill-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,8CAA8C;AAC9C,MAAM,YAAY,GAAG,OAAO,CAAC,sCAAsC,CAAC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,MAAM,GAAG,MAAM,UAAU,EAAE,CAAC;IAElC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;QACvE,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;QACrD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACnC,IAAI,EAAE,KAAK,CAAC,EAAE;QACd,OAAO,EAAE,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,EAAE;QACtC,KAAK,EAAE,KAAK,CAAC,EAAE;QACf,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;KACrC,CAAC,CAAC,CAAC;IAEJ,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC;QAC9B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,gCAAgC;QACzC,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,EAAE;QACT,iEAAiE;QACjE,OAAO,EAAE;YACP,IAAI,EAAE;gBACJ,CAAC,EAAE,MAAM;gBACT,CAAC,EAAE,IAAI;aACR;SACF;QACD,OAAO,EAAE,CAAC,KAAa,EAAE,OAAc,EAAE,EAAE;YACzC,yEAAyE;YACzE,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;YACvC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;gBAC7B,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;gBAC/C,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;gBACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YACnE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAClB,CAAC;KACF,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;QAClC,OAAO,MAAM,IAAI,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,0BAA0B;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TargetName } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Prompt user to select target agents.
|
|
4
|
+
* @param preselected - Pre-selected targets (from CLI options)
|
|
5
|
+
* @returns Selected target names
|
|
6
|
+
*/
|
|
7
|
+
export declare function promptTargets(preselected?: TargetName[]): Promise<TargetName[]>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import enquirer from 'enquirer';
|
|
2
|
+
import { CustomMultiSelect } from './custom-multiselect.js';
|
|
3
|
+
/**
|
|
4
|
+
* Prompt user to select target agents.
|
|
5
|
+
* @param preselected - Pre-selected targets (from CLI options)
|
|
6
|
+
* @returns Selected target names
|
|
7
|
+
*/
|
|
8
|
+
export async function promptTargets(preselected = []) {
|
|
9
|
+
const EnquirerClass = enquirer;
|
|
10
|
+
const instance = new EnquirerClass({
|
|
11
|
+
symbols: {
|
|
12
|
+
checked: '◉',
|
|
13
|
+
unchecked: '○'
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
instance.register('multi', CustomMultiSelect);
|
|
17
|
+
// All targets selected if none specified
|
|
18
|
+
const allSelected = preselected.length === 0;
|
|
19
|
+
const result = await instance.prompt({
|
|
20
|
+
type: 'multi',
|
|
21
|
+
name: 'targets',
|
|
22
|
+
message: 'Select target agents',
|
|
23
|
+
choices: [
|
|
24
|
+
{
|
|
25
|
+
name: 'claude',
|
|
26
|
+
message: 'Claude Code',
|
|
27
|
+
hint: '.mcp.json',
|
|
28
|
+
enabled: preselected.includes('claude') || allSelected
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'codex',
|
|
32
|
+
message: 'Codex',
|
|
33
|
+
hint: '.codex/config.toml',
|
|
34
|
+
enabled: preselected.includes('codex') || allSelected
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'gemini',
|
|
38
|
+
message: 'Gemini CLI',
|
|
39
|
+
hint: '.gemini/settings.json',
|
|
40
|
+
enabled: preselected.includes('gemini') || allSelected
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
validate: (value) => value.length > 0 || 'Please select at least one target'
|
|
44
|
+
});
|
|
45
|
+
return result.targets;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=target-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target-prompt.js","sourceRoot":"","sources":["../../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CAAC;IAEH,OAAO,MAAM,CAAC,OAAuB,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search the skills.directory registry for skills.
|
|
3
|
+
*/
|
|
4
|
+
export declare function searchSkills(query: string): Promise<RegistrySkill[]>;
|
|
5
|
+
/**
|
|
6
|
+
* Get detailed information about a skill from the registry.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSkillInfo(skillName: string): Promise<RegistrySkillInfo | null>;
|
|
9
|
+
/**
|
|
10
|
+
* Download a skill's SKILL.md content from GitHub.
|
|
11
|
+
*/
|
|
12
|
+
export declare function downloadSkillContent(githubUrl: string): Promise<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Install a skill from GitHub URL.
|
|
15
|
+
*/
|
|
16
|
+
export declare function installFromGitHub(githubUrl: string, skillName?: string): Promise<{
|
|
17
|
+
name: string;
|
|
18
|
+
content: string;
|
|
19
|
+
}>;
|
|
20
|
+
export interface RegistrySkill {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
version: string;
|
|
24
|
+
author: string;
|
|
25
|
+
verticals: string[];
|
|
26
|
+
stars: number;
|
|
27
|
+
installs: number;
|
|
28
|
+
repo: string;
|
|
29
|
+
skill_md: string;
|
|
30
|
+
}
|
|
31
|
+
export interface RegistrySkillInfo {
|
|
32
|
+
name: string;
|
|
33
|
+
description: string;
|
|
34
|
+
author: string;
|
|
35
|
+
verticals: string[];
|
|
36
|
+
updated: string;
|
|
37
|
+
stars: number;
|
|
38
|
+
installs: number;
|
|
39
|
+
repo: string;
|
|
40
|
+
skill_md: string;
|
|
41
|
+
installation: {
|
|
42
|
+
local: boolean;
|
|
43
|
+
global: string;
|
|
44
|
+
};
|
|
45
|
+
links: {
|
|
46
|
+
repo: string;
|
|
47
|
+
skill_md: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Skills Directory Registry Client
|
|
3
|
+
// ============================================================================
|
|
4
|
+
/** Maximum size for skill content (1MB) */
|
|
5
|
+
const MAX_SKILL_SIZE = 1024 * 1024;
|
|
6
|
+
/**
|
|
7
|
+
* Validate that a URL is from GitHub.
|
|
8
|
+
*/
|
|
9
|
+
function validateGitHubUrl(inputUrl) {
|
|
10
|
+
try {
|
|
11
|
+
const url = new URL(inputUrl);
|
|
12
|
+
const allowedHosts = ['github.com', 'raw.githubusercontent.com', 'www.github.com'];
|
|
13
|
+
return allowedHosts.includes(url.hostname);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Search the skills.directory registry for skills.
|
|
21
|
+
*/
|
|
22
|
+
export async function searchSkills(query) {
|
|
23
|
+
const url = `https://api.skills-directory.com/v1/search?q=${encodeURIComponent(query)}`;
|
|
24
|
+
try {
|
|
25
|
+
const response = await fetch(url);
|
|
26
|
+
if (!response.ok) {
|
|
27
|
+
throw new Error('Registry search failed');
|
|
28
|
+
}
|
|
29
|
+
const data = await response.json();
|
|
30
|
+
return data.skills || [];
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.error('Failed to search registry. Please try again later.');
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get detailed information about a skill from the registry.
|
|
39
|
+
*/
|
|
40
|
+
export async function getSkillInfo(skillName) {
|
|
41
|
+
const url = `https://api.skills-directory.com/v1/skills/${encodeURIComponent(skillName)}`;
|
|
42
|
+
try {
|
|
43
|
+
const response = await fetch(url);
|
|
44
|
+
if (!response.ok) {
|
|
45
|
+
if (response.status === 404) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
throw new Error('Registry fetch failed');
|
|
49
|
+
}
|
|
50
|
+
const data = await response.json();
|
|
51
|
+
return data;
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error('Failed to fetch skill info. Please try again later.');
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Download a skill's SKILL.md content from GitHub.
|
|
60
|
+
*/
|
|
61
|
+
export async function downloadSkillContent(githubUrl) {
|
|
62
|
+
// Validate URL is from GitHub
|
|
63
|
+
if (!validateGitHubUrl(githubUrl)) {
|
|
64
|
+
throw new Error('Only GitHub URLs are allowed');
|
|
65
|
+
}
|
|
66
|
+
// Parse GitHub URL to extract raw content URL
|
|
67
|
+
const rawUrl = githubUrl.replace('github.com', 'raw.githubusercontent.com')
|
|
68
|
+
.replace('/blob/', '/')
|
|
69
|
+
.replace('/tree/', '/');
|
|
70
|
+
// Ensure we point to SKILL.md
|
|
71
|
+
const skillUrl = rawUrl.endsWith('SKILL.md') ? rawUrl : `${rawUrl}/SKILL.md`;
|
|
72
|
+
// Validate final URL is still from GitHub
|
|
73
|
+
if (!validateGitHubUrl(skillUrl)) {
|
|
74
|
+
throw new Error('Invalid GitHub URL structure');
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const response = await fetch(skillUrl);
|
|
78
|
+
if (!response.ok) {
|
|
79
|
+
throw new Error(`Download failed: ${response.status}`);
|
|
80
|
+
}
|
|
81
|
+
// Check content length
|
|
82
|
+
const contentLength = response.headers.get('content-length');
|
|
83
|
+
if (contentLength && parseInt(contentLength, 10) > MAX_SKILL_SIZE) {
|
|
84
|
+
throw new Error('Skill file too large');
|
|
85
|
+
}
|
|
86
|
+
const content = await response.text();
|
|
87
|
+
// Double-check actual content size
|
|
88
|
+
if (content.length > MAX_SKILL_SIZE) {
|
|
89
|
+
throw new Error('Skill file too large');
|
|
90
|
+
}
|
|
91
|
+
return content;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
95
|
+
if (message.includes('Only GitHub') || message.includes('Invalid GitHub')) {
|
|
96
|
+
throw new Error(message);
|
|
97
|
+
}
|
|
98
|
+
throw new Error(`Failed to download skill. Check the URL and try again.`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Install a skill from GitHub URL.
|
|
103
|
+
*/
|
|
104
|
+
export async function installFromGitHub(githubUrl, skillName) {
|
|
105
|
+
// Fetch the repository info to get the default branch if needed
|
|
106
|
+
const content = await downloadSkillContent(githubUrl);
|
|
107
|
+
// Parse the skill name from the content if not provided
|
|
108
|
+
if (!skillName) {
|
|
109
|
+
const nameMatch = content.match(/^name:\s*(.+)$/m);
|
|
110
|
+
if (nameMatch) {
|
|
111
|
+
skillName = nameMatch[1].trim().replace(/^["']|["']$/g, '');
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
// Extract from GitHub URL
|
|
115
|
+
const urlMatch = githubUrl.match(/\/skills\/([^\/]+)/);
|
|
116
|
+
skillName = urlMatch ? urlMatch[1] : 'unknown-skill';
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return { name: skillName, content };
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,mCAAmC;AACnC,+EAA+E;AAE/E,2CAA2C;AAC3C,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnC;;GAEG;AACH,SAAS,iBAAiB,CAAC,QAAgB;IACzC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,2BAA2B,EAAE,gBAAgB,CAAC,CAAC;QACnF,OAAO,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAAC,MAA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CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { TargetName } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validate a skill name to prevent path traversal and injection.
|
|
4
|
+
*/
|
|
5
|
+
export declare function validateSkillName(skillName: string): void;
|
|
6
|
+
/**
|
|
7
|
+
* Get the skills directory path for a target.
|
|
8
|
+
* - Claude: <project>/.claude/skills/
|
|
9
|
+
* - Codex: <project>/.codex/skills/
|
|
10
|
+
* - Gemini: <project>/.gemini/antigravity/skills/
|
|
11
|
+
*/
|
|
12
|
+
export declare function getSkillsDir(projectRoot: string, target: TargetName): string;
|
|
13
|
+
/**
|
|
14
|
+
* Get the skill directory path for a specific skill.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getSkillDir(projectRoot: string, target: TargetName, skillName: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Get the SKILL.md file path for a specific skill.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getSkillFilePath(projectRoot: string, target: TargetName, skillName: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Read a skill file from disk.
|
|
23
|
+
*/
|
|
24
|
+
export declare function readSkill(projectRoot: string, target: TargetName, skillName: string): Promise<{
|
|
25
|
+
exists: boolean;
|
|
26
|
+
content: string | null;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Write a skill file to disk atomically.
|
|
30
|
+
*/
|
|
31
|
+
export declare function writeSkill(projectRoot: string, target: TargetName, skillName: string, content: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Remove a skill directory.
|
|
34
|
+
*/
|
|
35
|
+
export declare function removeSkill(projectRoot: string, target: TargetName, skillName: string): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Add a skill to a project.
|
|
38
|
+
*/
|
|
39
|
+
export declare function addSkillToConfig(projectRoot: string, target: TargetName, skillId: string, content: string): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Remove a skill from a project.
|
|
42
|
+
*/
|
|
43
|
+
export declare function removeSkillFromConfig(projectRoot: string, target: TargetName, skillName: string): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Get all skills from a project's native config directories.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getSkills(projectRoot: string, target: TargetName): Promise<Record<string, {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
}>>;
|
|
50
|
+
/**
|
|
51
|
+
* Check if a skill is enabled for a target.
|
|
52
|
+
*/
|
|
53
|
+
export declare function isSkillEnabled(projectRoot: string, target: TargetName, skillName: string): Promise<boolean>;
|