cdspec 0.1.1 → 0.1.4
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/cli.js +1 -40
- package/dist/config/default.js +1 -48
- package/dist/config/loader.js +1 -30
- package/dist/config/path.js +1 -11
- package/dist/config/types.js +1 -1
- package/dist/skill-core/adapters/claudecode-adapter.js +1 -35
- package/dist/skill-core/adapters/codex-adapter.js +1 -28
- package/dist/skill-core/adapters/iflow-adapter.js +1 -39
- package/dist/skill-core/adapters/index.js +1 -34
- package/dist/skill-core/adapters/shared.js +1 -36
- package/dist/skill-core/manifest-loader.js +1 -60
- package/dist/skill-core/scaffold.js +1 -169
- package/dist/skill-core/service.js +1 -109
- package/dist/skill-core/tool-interactions.js +1 -70
- package/dist/skill-core/types.js +1 -1
- package/dist/skill-core/validator.js +1 -25
- package/dist/utils/frontmatter.js +1 -40
- package/dist/utils/fs.js +1 -37
- package/package.json +11 -2
- package/templates/{standards-backend → backend-standard}/SKILL.md +55 -55
- package/templates/backend-standard/agents/openai.yaml +4 -0
- package/templates/{standards-backend → backend-standard}/references/DDD/346/236/266/346/236/204/347/272/246/346/235/237.md +103 -103
- package/templates/{standards-backend → backend-standard}/references/JUC/345/271/266/345/217/221/350/247/204/350/214/203.md +232 -232
- package/templates/{standards-backend → backend-standard}/references//344/274/240/347/273/237/344/270/211/345/261/202/346/236/266/346/236/204/347/272/246/346/235/237.md +35 -35
- package/templates/{standards-backend → backend-standard}/references//345/220/216/347/253/257/345/274/200/345/217/221/350/247/204/350/214/203.md +49 -49
- package/templates/{standards-backend → backend-standard}/references//346/225/260/346/215/256/345/272/223/350/256/276/350/256/241/350/247/204/350/214/203.md +116 -116
- package/templates/{standards-backend → backend-standard}/references//350/256/276/350/256/241/346/250/241/345/274/217/350/220/275/345/234/260/346/211/213/345/206/214.md +395 -395
- package/templates/{frontend-develop-standard → frontend-standard}/SKILL.md +63 -63
- package/templates/frontend-standard/agents/openai.yaml +4 -0
- package/templates/{frontend-develop-standard/references/frontend_develop_standard.md → frontend-standard/references/frontend_standard.md} +28 -321
- package/cdspec.config.yaml +0 -34
- package/dist/skill-core/agent-config.js +0 -40
- package/dist/task-core/parser.js +0 -70
- package/dist/task-core/service.js +0 -28
- package/dist/task-core/storage.js +0 -159
- package/dist/task-core/types.js +0 -1
- package/src/cli.ts +0 -44
- package/src/config/default.ts +0 -51
- package/src/config/loader.ts +0 -37
- package/src/config/path.ts +0 -13
- package/src/config/types.ts +0 -22
- package/src/skill-core/adapters/claudecode-adapter.ts +0 -45
- package/src/skill-core/adapters/codex-adapter.ts +0 -36
- package/src/skill-core/adapters/iflow-adapter.ts +0 -49
- package/src/skill-core/adapters/index.ts +0 -39
- package/src/skill-core/adapters/shared.ts +0 -45
- package/src/skill-core/manifest-loader.ts +0 -72
- package/src/skill-core/scaffold.ts +0 -192
- package/src/skill-core/service.ts +0 -137
- package/src/skill-core/tool-interactions.ts +0 -95
- package/src/skill-core/types.ts +0 -22
- package/src/skill-core/validator.ts +0 -28
- package/src/types/yaml.d.ts +0 -4
- package/src/utils/frontmatter.ts +0 -55
- package/src/utils/fs.ts +0 -41
- package/templates/frontend-develop-standard/agents/openai.yaml +0 -4
- package/templates/standards-backend/agents/openai.yaml +0 -4
- package/tests/init.test.ts +0 -63
- package/tsconfig.json +0 -16
- package/vitest.config.ts +0 -9
package/dist/cli.js
CHANGED
|
@@ -1,41 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import process from 'node:process';
|
|
6
|
-
import { initSkills } from './skill-core/service.js';
|
|
7
|
-
const program = new Command();
|
|
8
|
-
program.name('cdspec').description('Skill init CLI').version('0.1.0');
|
|
9
|
-
program
|
|
10
|
-
.command('init')
|
|
11
|
-
.description('Initialize skills for selected coding agents')
|
|
12
|
-
.option('--agents <agents>', 'codex|claudecode|iflow|all or comma-separated')
|
|
13
|
-
.action(async (options) => {
|
|
14
|
-
const selected = options.agents ?? (await askAgentsSelection());
|
|
15
|
-
const files = await initSkills(process.cwd(), selected, true);
|
|
16
|
-
console.log(`Initialized setup for "${selected}".`);
|
|
17
|
-
console.log(`Generated files: ${files.map(x => path.relative(process.cwd(), x)).join(', ')}`);
|
|
18
|
-
});
|
|
19
|
-
program.parseAsync(process.argv).catch((error) => {
|
|
20
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
21
|
-
console.error(message);
|
|
22
|
-
process.exitCode = 1;
|
|
23
|
-
});
|
|
24
|
-
async function askAgentsSelection() {
|
|
25
|
-
if (!process.stdin.isTTY)
|
|
26
|
-
return 'all';
|
|
27
|
-
const values = await checkbox({
|
|
28
|
-
message: 'Select coding agents',
|
|
29
|
-
choices: [
|
|
30
|
-
{ name: 'codex', value: 'codex', checked: true },
|
|
31
|
-
{ name: 'claudecode', value: 'claudecode' },
|
|
32
|
-
{ name: 'iflow', value: 'iflow' },
|
|
33
|
-
{ name: 'all', value: 'all' }
|
|
34
|
-
]
|
|
35
|
-
});
|
|
36
|
-
if (values.length === 0)
|
|
37
|
-
return 'all';
|
|
38
|
-
if (values.includes('all'))
|
|
39
|
-
return 'all';
|
|
40
|
-
return values.join(',');
|
|
41
|
-
}
|
|
2
|
+
const _0x1e5646=_0x3b05;(function(_0x4ee451,_0x3569b9){const _0x1f05e0=_0x3b05,_0x5d1dc1=_0x4ee451();while(!![]){try{const _0x5179be=-parseInt(_0x1f05e0(0x84))/(-0x2001+-0x67*0x3d+-0x1*-0x388d)+parseInt(_0x1f05e0(0x96))/(0x12bf*-0x1+-0x1ecb+-0xc63*-0x4)+parseInt(_0x1f05e0(0x89))/(-0x1a5*0x16+0x287+0x3e*0x8b)*(-parseInt(_0x1f05e0(0x79))/(-0x1*0xc3b+-0x293*0x2+0x1165))+-parseInt(_0x1f05e0(0x7e))/(0x6*0x60a+-0x25c9+0x192)+-parseInt(_0x1f05e0(0xa4))/(-0x1615+0x5*0x449+0xae)*(-parseInt(_0x1f05e0(0x95))/(0x182+-0x3d*0x11+0x1*0x292))+-parseInt(_0x1f05e0(0x80))/(-0x1a10+-0xb7*-0x2e+-0x6ca)+parseInt(_0x1f05e0(0x8b))/(0x9*-0x47+-0x1020+0x12a8);if(_0x5179be===_0x3569b9)break;else _0x5d1dc1['push'](_0x5d1dc1['shift']());}catch(_0x8383ab){_0x5d1dc1['push'](_0x5d1dc1['shift']());}}}(_0xa98e,0xd687e+0x161f1+-0x11*0x357b));import _0x3e267c from'@inquirer/checkbox';import _0x263e5c from'@inquirer/select';import{Command}from'commander';function _0x3b05(_0xcb0c9b,_0x9f3b86){_0xcb0c9b=_0xcb0c9b-(-0x258d+-0x1382*0x1+-0x3988*-0x1);const _0x13c83a=_0xa98e();let _0x480847=_0x13c83a[_0xcb0c9b];return _0x480847;}import _0x4bde05 from'node:path';import _0xfd157b from'node:process';import{initSkills}from'./skill-core/service.js';const program=new Command();function _0xa98e(){const _0x22b31c=['默认路径(按配置)','argv','error','log','init','description','isTTY','command','message','67165ufSaFf','39170BEPBmB','length','iflow','toLowerCase','default|project','project','cdspec','join','[✓]','trim','--agents\x20<agents>','codex','0.1.0','agents','606RkbENY','exitCode','未知路径模式:\x20','claudecode','cwd','请选择编程智能体','[\x20]','48520pUTxzg','default','已完成初始化:','string','Skill\x20init\x20CLI','4843425GemgOe','已生成技能包:','11307288EXYiAg','stdin','请选择生成路径','version','1381099RrvMmJ','--path-mode\x20<mode>','当前项目路径','codex|claudecode|iflow|all\x20or\x20comma-separated','pathMode','3ozXreL','action','31709025QlVAEB'];_0xa98e=function(){return _0x22b31c;};return _0xa98e();}program['name'](_0x1e5646(0x9c))[_0x1e5646(0x91)](_0x1e5646(0x7d))[_0x1e5646(0x83)](_0x1e5646(0xa2)),program[_0x1e5646(0x93)](_0x1e5646(0x90))[_0x1e5646(0x91)]('为所选编程智能体初始化技能')['option'](_0x1e5646(0xa0),_0x1e5646(0x87))['option'](_0x1e5646(0x85),_0x1e5646(0x9a))[_0x1e5646(0x8a)](async _0x57c25b=>{const _0x1ec360=_0x1e5646,_0x57561a=_0x57c25b[_0x1ec360(0xa3)]??await askAgentsSelection(),_0x109d41=normalizePathMode(_0x57c25b[_0x1ec360(0x88)])??await askPathModeSelection(),_0x56cb02=await initSkills(_0xfd157b[_0x1ec360(0xa8)](),_0x57561a,!![],_0x109d41);console[_0x1ec360(0x8f)](_0x1ec360(0x7b)+_0x57561a),console['log']('生成路径模式:'+(_0x109d41==='project'?_0x1ec360(0x86):_0x1ec360(0x8c))),console[_0x1ec360(0x8f)](_0x1ec360(0x7f));for(const _0x268481 of _0x56cb02){console[_0x1ec360(0x8f)](_0x4bde05['resolve'](_0x268481));}}),program['parseAsync'](_0xfd157b[_0x1e5646(0x8d)])['catch'](_0x5aeae6=>{const _0x47bc0d=_0x1e5646,_0x8873c7=_0x5aeae6 instanceof Error?_0x5aeae6[_0x47bc0d(0x94)]:String(_0x5aeae6);console[_0x47bc0d(0x8e)](_0x8873c7),_0xfd157b[_0x47bc0d(0xa5)]=0x13f2*0x1+-0x1b59+0x768;});async function askAgentsSelection(){const _0x1abd93=_0x1e5646;if(!_0xfd157b['stdin'][_0x1abd93(0x92)])return _0x1abd93(0xa1);const _0x330887=await _0x3e267c({'message':_0x1abd93(0xa9),'required':!![],'theme':{'icon':{'checked':_0x1abd93(0x9e),'unchecked':_0x1abd93(0xaa),'cursor':'>'}},'choices':[{'name':'codex','value':'codex','checked':!![]},{'name':'claudecode','value':_0x1abd93(0xa7)},{'name':_0x1abd93(0x98),'value':'iflow'}]});if(_0x330887[_0x1abd93(0x97)]===0x21d9+-0x125a+-0xf7f)return'codex';return _0x330887[_0x1abd93(0x9d)](',');}async function askPathModeSelection(){const _0x5c279c=_0x1e5646;if(!_0xfd157b[_0x5c279c(0x81)][_0x5c279c(0x92)])return _0x5c279c(0x7a);return _0x263e5c({'message':_0x5c279c(0x82),'choices':[{'name':_0x5c279c(0x8c),'value':_0x5c279c(0x7a)},{'name':_0x5c279c(0x86),'value':_0x5c279c(0x9b)}],'default':_0x5c279c(0x7a)});}function normalizePathMode(_0x11ee60){const _0x42cee6=_0x1e5646;if(typeof _0x11ee60!==_0x42cee6(0x7c))return undefined;const _0x194e87=_0x11ee60[_0x42cee6(0x9f)]()[_0x42cee6(0x99)]();if(_0x194e87===_0x42cee6(0x7a)||_0x194e87==='project')return _0x194e87;throw new Error(_0x42cee6(0xa6)+_0x11ee60+',可选值:\x20default\x20|\x20project');}
|
package/dist/config/default.js
CHANGED
|
@@ -1,48 +1 @@
|
|
|
1
|
-
|
|
2
|
-
commandBindings: [
|
|
3
|
-
{
|
|
4
|
-
id: "propose",
|
|
5
|
-
skill: "openspec-core",
|
|
6
|
-
description: "Create a change proposal with scope and impacted specs."
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
id: "explore",
|
|
10
|
-
skill: "openspec-core",
|
|
11
|
-
description: "Analyze existing specs and produce planned deltas."
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
id: "apply",
|
|
15
|
-
skill: "openspec-core",
|
|
16
|
-
description: "Implement approved tasks and keep spec updates in sync."
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
id: "archive",
|
|
20
|
-
skill: "openspec-core",
|
|
21
|
-
description: "Archive completed changes and update baseline specs."
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
agents: {
|
|
25
|
-
codex: {
|
|
26
|
-
rootDir: ".codex",
|
|
27
|
-
commandsDir: "prompts",
|
|
28
|
-
commandFilePattern: "opsx-{id}.md",
|
|
29
|
-
slashPattern: "/opsx-{id}",
|
|
30
|
-
guideFile: "AGENTS.md"
|
|
31
|
-
},
|
|
32
|
-
claudecode: {
|
|
33
|
-
rootDir: ".claude",
|
|
34
|
-
commandsDir: "commands/opsx",
|
|
35
|
-
commandFilePattern: "{id}.md",
|
|
36
|
-
slashPattern: "/opsx:{id}",
|
|
37
|
-
guideFile: "CLAUDE.md",
|
|
38
|
-
guideAtProjectRoot: true
|
|
39
|
-
},
|
|
40
|
-
iflow: {
|
|
41
|
-
rootDir: ".iflow",
|
|
42
|
-
commandsDir: "commands",
|
|
43
|
-
commandFilePattern: "opsx-{id}.md",
|
|
44
|
-
slashPattern: "/opsx-{id}",
|
|
45
|
-
guideFile: "IFLOW.md"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
1
|
+
const _0x5373db=_0x2664;function _0x204d(){const _0x30cd4d=['3047364SjbeaV','explore','7837760tIKVPn','718dLzuZp','/opsx:{id}','{id}.md','archive','IFLOW.md','2875jSExhy','~/.iflow','Archive\x20completed\x20changes\x20and\x20update\x20baseline\x20specs.','Implement\x20approved\x20tasks\x20and\x20keep\x20spec\x20updates\x20in\x20sync.','AGENTS.md','10116320bxqRUa','opsx-{id}.md','apply','commands','.codex','1311985awSZdh','openspec-core','/opsx-{id}','Create\x20a\x20change\x20proposal\x20with\x20scope\x20and\x20impacted\x20specs.','CLAUDE.md','2974380IIcmfp','Analyze\x20existing\x20specs\x20and\x20produce\x20planned\x20deltas.','2708970Woprdq'];_0x204d=function(){return _0x30cd4d;};return _0x204d();}(function(_0x271c5e,_0x3be773){const _0x2d6a9f=_0x2664,_0x8ce1ea=_0x271c5e();while(!![]){try{const _0x310d9c=-parseInt(_0x2d6a9f(0x8e))/(0x3d7*0x5+-0xf*-0xa3+-0x1cbf)*(-parseInt(_0x2d6a9f(0x89))/(0x21e5*0x1+0x1*0x1135+-0x663*0x8))+parseInt(_0x2d6a9f(0x83))/(0x141*0x13+0x9b9+-0x2189)+parseInt(_0x2d6a9f(0x86))/(0x90+0x2089+-0x2115)+-parseInt(_0x2d6a9f(0x7e))/(-0x722+-0x6a3+0xdca*0x1)+parseInt(_0x2d6a9f(0x85))/(-0x1ff0+0x1487+0xb6f)+-parseInt(_0x2d6a9f(0x88))/(0x909+-0xb06+0x204)+-parseInt(_0x2d6a9f(0x93))/(0x100f+-0x1633*0x1+-0x62c*-0x1);if(_0x310d9c===_0x3be773)break;else _0x8ce1ea['push'](_0x8ce1ea['shift']());}catch(_0x25c475){_0x8ce1ea['push'](_0x8ce1ea['shift']());}}}(_0x204d,-0x843a6+0x9de20+-0x863*-0xe2));function _0x2664(_0x243ab2,_0x16c0f0){_0x243ab2=_0x243ab2-(0x1000+0x4f8+-0x147e);const _0x1be26f=_0x204d();let _0x11deeb=_0x1be26f[_0x243ab2];return _0x11deeb;}export const defaultConfig={'commandBindings':[{'id':'propose','skill':_0x5373db(0x7f),'description':_0x5373db(0x81)},{'id':_0x5373db(0x87),'skill':_0x5373db(0x7f),'description':_0x5373db(0x84)},{'id':_0x5373db(0x7b),'skill':_0x5373db(0x7f),'description':_0x5373db(0x91)},{'id':_0x5373db(0x8c),'skill':'openspec-core','description':_0x5373db(0x90)}],'agents':{'codex':{'rootDir':_0x5373db(0x7d),'commandsDir':'prompts','commandFilePattern':_0x5373db(0x7a),'slashPattern':_0x5373db(0x80),'guideFile':_0x5373db(0x92)},'claudecode':{'rootDir':'~/.claude','commandsDir':'commands/opsx','commandFilePattern':_0x5373db(0x8b),'slashPattern':_0x5373db(0x8a),'guideFile':_0x5373db(0x82),'guideAtProjectRoot':!![]},'iflow':{'rootDir':_0x5373db(0x8f),'commandsDir':_0x5373db(0x7c),'commandFilePattern':_0x5373db(0x7a),'slashPattern':'/opsx-{id}','guideFile':_0x5373db(0x8d)}}};
|
package/dist/config/loader.js
CHANGED
|
@@ -1,30 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { readFile } from "node:fs/promises";
|
|
3
|
-
import { parse } from "yaml";
|
|
4
|
-
import { pathExists } from "../utils/fs.js";
|
|
5
|
-
import { defaultConfig } from "./default.js";
|
|
6
|
-
const CONFIG_FILE = "cdspec.config.yaml";
|
|
7
|
-
export async function loadConfig(cwd) {
|
|
8
|
-
const configPath = path.join(cwd, CONFIG_FILE);
|
|
9
|
-
if (!(await pathExists(configPath))) {
|
|
10
|
-
return defaultConfig;
|
|
11
|
-
}
|
|
12
|
-
const raw = await readFile(configPath, "utf8");
|
|
13
|
-
const parsed = parse(raw);
|
|
14
|
-
if (!parsed)
|
|
15
|
-
return defaultConfig;
|
|
16
|
-
const merged = {
|
|
17
|
-
commandBindings: parsed.commandBindings && parsed.commandBindings.length > 0
|
|
18
|
-
? parsed.commandBindings
|
|
19
|
-
: defaultConfig.commandBindings,
|
|
20
|
-
agents: {
|
|
21
|
-
codex: { ...defaultConfig.agents.codex, ...(parsed.agents?.codex || {}) },
|
|
22
|
-
claudecode: {
|
|
23
|
-
...defaultConfig.agents.claudecode,
|
|
24
|
-
...(parsed.agents?.claudecode || {})
|
|
25
|
-
},
|
|
26
|
-
iflow: { ...defaultConfig.agents.iflow, ...(parsed.agents?.iflow || {}) }
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
return merged;
|
|
30
|
-
}
|
|
1
|
+
const _0x5222ab=_0x477f;(function(_0x135e07,_0x1b59d6){const _0x1bacdf=_0x477f,_0x37dfd2=_0x135e07();while(!![]){try{const _0x273373=parseInt(_0x1bacdf(0xc2))/(-0x10af+0x1fe5+-0xf35)+-parseInt(_0x1bacdf(0xc0))/(-0x21e1+0x161e+0xbc5)+-parseInt(_0x1bacdf(0xba))/(-0x1*-0x565+0x13f*0xa+-0x11d8)+-parseInt(_0x1bacdf(0xbc))/(0xd8d+-0x3c7*-0x2+-0x1517)+parseInt(_0x1bacdf(0xc4))/(-0x1fc0+-0x2*0x135a+0x1*0x4679)*(-parseInt(_0x1bacdf(0xc3))/(-0x19fe+-0x1da3+0x37a7))+parseInt(_0x1bacdf(0xc5))/(0x1ba1+0x2*0xd+-0x1bb4)+parseInt(_0x1bacdf(0xbb))/(-0x1*-0x758+-0x8a0+0x150)*(parseInt(_0x1bacdf(0xbf))/(-0x1731+-0x1aa0+0x31da));if(_0x273373===_0x1b59d6)break;else _0x37dfd2['push'](_0x37dfd2['shift']());}catch(_0x272f06){_0x37dfd2['push'](_0x37dfd2['shift']());}}}(_0x3771,0x1*-0x2aa43+0x14d*0x329+0xfcd*0xa));import _0x23dbf5 from'node:path';import{readFile}from'node:fs/promises';function _0x3771(){const _0x4c74fd=['538178SJbJiK','cdspec.config.yaml','205467lVGERH','1177158FJpbOt','5CAoiib','1866403rEdAWu','commandBindings','agents','claudecode','704997JfvrUd','542928nozQrv','446756ihDaxE','length','codex','63STNbVH'];_0x3771=function(){return _0x4c74fd;};return _0x3771();}import{parse}from'yaml';function _0x477f(_0x1cd539,_0x35e5c6){_0x1cd539=_0x1cd539-(0x4*-0x745+0x545*-0x6+0x3d6b);const _0x8f2e21=_0x3771();let _0x5f5a82=_0x8f2e21[_0x1cd539];return _0x5f5a82;}import{pathExists}from'../utils/fs.js';import{defaultConfig}from'./default.js';const CONFIG_FILE=_0x5222ab(0xc1);export async function loadConfig(_0x15af00){const _0x38535b=_0x5222ab,_0x196ed5=_0x23dbf5['join'](_0x15af00,CONFIG_FILE);if(!await pathExists(_0x196ed5))return defaultConfig;const _0x3ef151=await readFile(_0x196ed5,'utf8'),_0x31dfbb=parse(_0x3ef151);if(!_0x31dfbb)return defaultConfig;const _0x489231={'commandBindings':_0x31dfbb[_0x38535b(0xc6)]&&_0x31dfbb[_0x38535b(0xc6)][_0x38535b(0xbd)]>-0x2*-0x1387+0x3*-0x611+-0x119*0x13?_0x31dfbb[_0x38535b(0xc6)]:defaultConfig[_0x38535b(0xc6)],'agents':{'codex':{...defaultConfig['agents'][_0x38535b(0xbe)],..._0x31dfbb[_0x38535b(0xc7)]?.['codex']||{}},'claudecode':{...defaultConfig['agents'][_0x38535b(0xb9)],..._0x31dfbb[_0x38535b(0xc7)]?.[_0x38535b(0xb9)]||{}},'iflow':{...defaultConfig[_0x38535b(0xc7)]['iflow'],..._0x31dfbb[_0x38535b(0xc7)]?.['iflow']||{}}}};return _0x489231;}
|
package/dist/config/path.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
export function resolveAgentRoot(cwd, rootDir) {
|
|
4
|
-
if (rootDir.startsWith("~/") || rootDir.startsWith("~\\")) {
|
|
5
|
-
return path.join(os.homedir(), rootDir.slice(2));
|
|
6
|
-
}
|
|
7
|
-
if (path.win32.isAbsolute(rootDir) || path.posix.isAbsolute(rootDir)) {
|
|
8
|
-
return path.normalize(rootDir);
|
|
9
|
-
}
|
|
10
|
-
return path.join(cwd, rootDir);
|
|
11
|
-
}
|
|
1
|
+
function _0x2efe(_0xe98e69,_0x2b944b){_0xe98e69=_0xe98e69-(-0xbda+0x14b1+-0x821);var _0x56d631=_0x43b5();var _0x147f7e=_0x56d631[_0xe98e69];return _0x147f7e;}(function(_0x1bc325,_0x31ea4d){var _0x30c9a0=_0x2efe,_0x3b774e=_0x1bc325();while(!![]){try{var _0x9074ec=-parseInt(_0x30c9a0(0xc2))/(-0x74+0x985*0x1+0x244*-0x4)+-parseInt(_0x30c9a0(0xbb))/(0x1*0x1097+-0x1*-0x2547+-0x35dc)*(parseInt(_0x30c9a0(0xb6))/(0x62b*-0x1+0x515+0x119))+parseInt(_0x30c9a0(0xb9))/(-0xc99+-0x40a+-0x1*-0x10a7)*(parseInt(_0x30c9a0(0xbe))/(0x1aad*-0x1+-0xd3b+0x3*0xd4f))+-parseInt(_0x30c9a0(0xb7))/(0x10c*-0x1e+0x19c9+0x5a5)*(-parseInt(_0x30c9a0(0xbd))/(-0x228f+0xd96*0x1+0x1500))+parseInt(_0x30c9a0(0xbf))/(0x35b+-0x16*0x167+-0x105*-0x1b)+parseInt(_0x30c9a0(0xc1))/(-0x3*-0x3cb+-0x1a1*-0x16+-0x44a*0xb)+-parseInt(_0x30c9a0(0xc0))/(0x1943*-0x1+0xaea+0xe63);if(_0x9074ec===_0x31ea4d)break;else _0x3b774e['push'](_0x3b774e['shift']());}catch(_0x2b8dd1){_0x3b774e['push'](_0x3b774e['shift']());}}}(_0x43b5,0x1fd7d+-0xbf5f+0x10f52));import _0x4e12ac from'node:os';import _0x4887c8 from'node:path';function _0x43b5(){var _0x12ee88=['1300600McCJTH','125000pMidWb','774054KSPpIq','239904uyFnPm','slice','win32','1116IZitzT','12858WFaYbK','normalize','46680oxHyGa','isAbsolute','346uawZEa','join','525kQLTeK','25jbLieR'];_0x43b5=function(){return _0x12ee88;};return _0x43b5();}export function resolveAgentRoot(_0x4e9a55,_0x333d68){var _0x2e9e4c=_0x2efe;if(_0x333d68['startsWith']('~/')||_0x333d68['startsWith']('~\x5c'))return _0x4887c8[_0x2e9e4c(0xbc)](_0x4e12ac['homedir'](),_0x333d68[_0x2e9e4c(0xc3)](-0x1b6d*0x1+-0x26ba*0x1+0x1*0x4229));if(_0x4887c8[_0x2e9e4c(0xc4)][_0x2e9e4c(0xba)](_0x333d68)||_0x4887c8['posix'][_0x2e9e4c(0xba)](_0x333d68))return _0x4887c8[_0x2e9e4c(0xb8)](_0x333d68);return _0x4887c8[_0x2e9e4c(0xbc)](_0x4e9a55,_0x333d68);}
|
package/dist/config/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{};
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { emptyDir, pathExists } from "../../utils/fs.js";
|
|
3
|
-
import { emitWithLayout } from "./shared.js";
|
|
4
|
-
export class ClaudeCodeAdapter {
|
|
5
|
-
target = "claudecode";
|
|
6
|
-
validate(manifest) {
|
|
7
|
-
const diagnostics = [];
|
|
8
|
-
if (!manifest.name) {
|
|
9
|
-
diagnostics.push({ level: "error", message: "[claudecode] name is required." });
|
|
10
|
-
}
|
|
11
|
-
return diagnostics;
|
|
12
|
-
}
|
|
13
|
-
async emit(manifest, outDir, force) {
|
|
14
|
-
if ((await pathExists(outDir)) && !force) {
|
|
15
|
-
throw new Error(`Target already exists for skill "${manifest.name}" at ${outDir}. Use --force to overwrite.`);
|
|
16
|
-
}
|
|
17
|
-
if (force) {
|
|
18
|
-
await emptyDir(outDir);
|
|
19
|
-
}
|
|
20
|
-
const meta = {
|
|
21
|
-
name: manifest.name,
|
|
22
|
-
description: manifest.description,
|
|
23
|
-
entry: "SKILL.md"
|
|
24
|
-
};
|
|
25
|
-
await emitWithLayout(manifest, outDir, true, [
|
|
26
|
-
{
|
|
27
|
-
relativePath: "claudecode.skill.json",
|
|
28
|
-
content: `${JSON.stringify(meta, null, 2)}\n`
|
|
29
|
-
}
|
|
30
|
-
]);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export function claudecodeSkillPath(baseOutDir, skillName) {
|
|
34
|
-
return path.join(baseOutDir, "claudecode", skillName);
|
|
35
|
-
}
|
|
1
|
+
const _0x2a6c01=_0x15a7;function _0x2407(){const _0x1100a3=['348720nlbjxM','target','15ClPMUe','Target\x20already\x20exists\x20for\x20skill\x20\x22','name','108240nbuvNF','join','SKILL.md','109499ZgkGod','claudecode','[claudecode]\x20name\x20is\x20required.','2ruECuI','.\x20Use\x20--force\x20to\x20overwrite.','stringify','78zBYise','444710dcqaFK','741vaQexO','11wKmBMF','5909270jBgQeS','emit','push','\x22\x20at\x20','validate','claudecode.skill.json','1871748NKbSrI','16YcrsTi','795048wfKsQw'];_0x2407=function(){return _0x1100a3;};return _0x2407();}(function(_0x50f9d5,_0x437a96){const _0x130558=_0x15a7,_0x1b73fe=_0x50f9d5();while(!![]){try{const _0x4a6baf=-parseInt(_0x130558(0x17d))/(0xf*-0x2+-0x5*-0x5c6+-0x1cbf)*(parseInt(_0x130558(0x180))/(0xb07*-0x3+0x12*-0x47+0x2615))+parseInt(_0x130558(0x177))/(-0xb87+0x1cb+0x9bf)*(-parseInt(_0x130558(0x174))/(0x1fbe+-0x31d*-0x3+-0x2911))+-parseInt(_0x130558(0x17a))/(0x7cb*-0x1+0x66c+0x1*0x164)*(parseInt(_0x130558(0x183))/(-0x118c+-0x13d3+0x1*0x2565))+parseInt(_0x130558(0x184))/(-0x1fd9+0x1e7d+0x163)*(-parseInt(_0x130558(0x173))/(0xce+0x1*-0xdd3+0x1*0xd0d))+-parseInt(_0x130558(0x172))/(-0x2*0x1235+0x3*-0x79d+0x3b4a)+parseInt(_0x130558(0x187))/(0x3d*0x46+-0x2157+0x5f*0x2d)*(parseInt(_0x130558(0x186))/(0x1*0x188f+-0x2d0*0x6+-0x7a4))+-parseInt(_0x130558(0x175))/(0x1c0*0x4+0x1818+0xf86*-0x2)*(-parseInt(_0x130558(0x185))/(-0x12b8+-0x26e8+0x39ad*0x1));if(_0x4a6baf===_0x437a96)break;else _0x1b73fe['push'](_0x1b73fe['shift']());}catch(_0x3f00ed){_0x1b73fe['push'](_0x1b73fe['shift']());}}}(_0x2407,-0x357ca*0x2+0x6*-0x1a315+0xc4778*0x2));import _0x358ded from'node:path';function _0x15a7(_0x88f7a5,_0x4c7d31){_0x88f7a5=_0x88f7a5-(-0x1ac+-0x1b88+0x1ea5);const _0x8023fe=_0x2407();let _0x2418d3=_0x8023fe[_0x88f7a5];return _0x2418d3;}import{emptyDir,pathExists}from'../../utils/fs.js';import{emitWithLayout}from'./shared.js';export class ClaudeCodeAdapter{[_0x2a6c01(0x176)]=_0x2a6c01(0x17e);[_0x2a6c01(0x18b)](_0x5261a9){const _0x4588e2=_0x2a6c01,_0xe186a1=[];return!_0x5261a9[_0x4588e2(0x179)]&&_0xe186a1[_0x4588e2(0x189)]({'level':'error','message':_0x4588e2(0x17f)}),_0xe186a1;}async[_0x2a6c01(0x188)](_0xd12cbc,_0x17dec4,_0x25c009){const _0x328baf=_0x2a6c01;if(await pathExists(_0x17dec4)&&!_0x25c009)throw new Error(_0x328baf(0x178)+_0xd12cbc[_0x328baf(0x179)]+_0x328baf(0x18a)+_0x17dec4+_0x328baf(0x181));_0x25c009&&await emptyDir(_0x17dec4);const _0x2f702f={'name':_0xd12cbc[_0x328baf(0x179)],'description':_0xd12cbc['description'],'entry':_0x328baf(0x17c)};await emitWithLayout(_0xd12cbc,_0x17dec4,!![],[{'relativePath':_0x328baf(0x171),'content':JSON[_0x328baf(0x182)](_0x2f702f,null,0x1*-0x2627+-0x1c81+0x42aa)+'\x0a'}]);}}export function claudecodeSkillPath(_0x432baa,_0x394bfd){const _0x2a3ccc=_0x2a6c01;return _0x358ded[_0x2a3ccc(0x17b)](_0x432baa,_0x2a3ccc(0x17e),_0x394bfd);}
|
|
@@ -1,28 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { emptyDir, pathExists } from "../../utils/fs.js";
|
|
3
|
-
import { emitWithLayout } from "./shared.js";
|
|
4
|
-
export class CodexAdapter {
|
|
5
|
-
target = "codex";
|
|
6
|
-
validate(manifest) {
|
|
7
|
-
const diagnostics = [];
|
|
8
|
-
if (!manifest.description) {
|
|
9
|
-
diagnostics.push({
|
|
10
|
-
level: "error",
|
|
11
|
-
message: `[codex] ${manifest.name}: description is required.`
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return diagnostics;
|
|
15
|
-
}
|
|
16
|
-
async emit(manifest, outDir, force) {
|
|
17
|
-
if ((await pathExists(outDir)) && !force) {
|
|
18
|
-
throw new Error(`Target already exists for skill "${manifest.name}" at ${outDir}. Use --force to overwrite.`);
|
|
19
|
-
}
|
|
20
|
-
if (force) {
|
|
21
|
-
await emptyDir(outDir);
|
|
22
|
-
}
|
|
23
|
-
await emitWithLayout(manifest, outDir, true, []);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export function codexSkillPath(baseOutDir, skillName) {
|
|
27
|
-
return path.join(baseOutDir, "codex", skillName);
|
|
28
|
-
}
|
|
1
|
+
const _0xd84d7b=_0x2076;function _0x3f89(){const _0x94c4a0=['1410bmyBee','2WXhTda','join','3189033CPIAFd','48wdWMPR',':\x20description\x20is\x20required.','15bmBeWb','10HKECTM','205172HGPHPL','14zLMrjG','5645GwgQhk','3674856PxegjN','[codex]\x20','22183oJnmXy','11ObrmQz','emit','.\x20Use\x20--force\x20to\x20overwrite.','1595009XxJuqE','202431LRHcrI','Target\x20already\x20exists\x20for\x20skill\x20\x22','name','target','codex'];_0x3f89=function(){return _0x94c4a0;};return _0x3f89();}(function(_0x433ecb,_0x5c7a1a){const _0x47bd68=_0x2076,_0xb76c9c=_0x433ecb();while(!![]){try{const _0x40f5c9=parseInt(_0x47bd68(0xf3))/(0x153d+0x4a0*0x8+0xe8f*-0x4)*(parseInt(_0x47bd68(0xe2))/(-0x1df6+-0x1a87*-0x1+0x371))+parseInt(_0x47bd68(0xe7))/(0x20c5*-0x1+-0xd*-0x209+0x653*0x1)*(parseInt(_0x47bd68(0xe9))/(-0x44f+0xe2b+-0x9d8))+-parseInt(_0x47bd68(0xeb))/(-0x248f*0x1+-0x17f9+0x3c8d)*(parseInt(_0x47bd68(0xe1))/(0x86b+-0x20ac+-0x235*-0xb))+parseInt(_0x47bd68(0xee))/(0x606+-0x80f+0x210)*(parseInt(_0x47bd68(0xe5))/(0x23c9*0x1+0x17ea+-0x497*0xd))+parseInt(_0x47bd68(0xe4))/(-0x2*-0x1163+-0x111f+0xa*-0x1c3)*(parseInt(_0x47bd68(0xe8))/(-0x1*0x143b+0x87d+0xbc8))+-parseInt(_0x47bd68(0xef))/(-0x1f3b+-0x34b*0x1+-0x1*-0x2291)*(parseInt(_0x47bd68(0xec))/(-0x730+0x7a7+-0x6b))+parseInt(_0x47bd68(0xf2))/(-0xa9d+-0x1*0x18cd+-0x511*-0x7)*(parseInt(_0x47bd68(0xea))/(0x191+-0xbdf*-0x1+-0xd62));if(_0x40f5c9===_0x5c7a1a)break;else _0xb76c9c['push'](_0xb76c9c['shift']());}catch(_0x41d1fc){_0xb76c9c['push'](_0xb76c9c['shift']());}}}(_0x3f89,-0x89aa+-0x3821a+0x9e55f));import _0x5a9c81 from'node:path';import{emptyDir,pathExists}from'../../utils/fs.js';function _0x2076(_0x49f9c6,_0x1df850){_0x49f9c6=_0x49f9c6-(-0xb*-0x1c6+0xa77+0x2*-0xe8c);const _0x1001a1=_0x3f89();let _0x5a9c81=_0x1001a1[_0x49f9c6];return _0x5a9c81;}import{emitWithLayout}from'./shared.js';export class CodexAdapter{[_0xd84d7b(0xf6)]=_0xd84d7b(0xf7);['validate'](_0x9edd07){const _0x51e51e=_0xd84d7b,_0x126c50=[];return!_0x9edd07['description']&&_0x126c50['push']({'level':'error','message':_0x51e51e(0xed)+_0x9edd07[_0x51e51e(0xf5)]+_0x51e51e(0xe6)}),_0x126c50;}async[_0xd84d7b(0xf0)](_0x22cb9c,_0x229ef9,_0x29cdf9){const _0x28b673=_0xd84d7b;if(await pathExists(_0x229ef9)&&!_0x29cdf9)throw new Error(_0x28b673(0xf4)+_0x22cb9c[_0x28b673(0xf5)]+'\x22\x20at\x20'+_0x229ef9+_0x28b673(0xf1));_0x29cdf9&&await emptyDir(_0x229ef9),await emitWithLayout(_0x22cb9c,_0x229ef9,!![],[]);}}export function codexSkillPath(_0x376cb6,_0x4b554e){const _0x43cf9a=_0xd84d7b;return _0x5a9c81[_0x43cf9a(0xe3)](_0x376cb6,_0x43cf9a(0xf7),_0x4b554e);}
|
|
@@ -1,39 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { emptyDir, pathExists } from "../../utils/fs.js";
|
|
3
|
-
import { emitWithLayout } from "./shared.js";
|
|
4
|
-
export class IFlowAdapter {
|
|
5
|
-
target = "iflow";
|
|
6
|
-
validate(manifest) {
|
|
7
|
-
const diagnostics = [];
|
|
8
|
-
if (!manifest.description) {
|
|
9
|
-
diagnostics.push({
|
|
10
|
-
level: "warning",
|
|
11
|
-
message: `[iflow] ${manifest.name}: description is empty.`
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return diagnostics;
|
|
15
|
-
}
|
|
16
|
-
async emit(manifest, outDir, force) {
|
|
17
|
-
if ((await pathExists(outDir)) && !force) {
|
|
18
|
-
throw new Error(`Target already exists for skill "${manifest.name}" at ${outDir}. Use --force to overwrite.`);
|
|
19
|
-
}
|
|
20
|
-
if (force) {
|
|
21
|
-
await emptyDir(outDir);
|
|
22
|
-
}
|
|
23
|
-
const skillYaml = [
|
|
24
|
-
`name: "${manifest.name}"`,
|
|
25
|
-
`description: "${manifest.description.replace(/"/g, '\\"')}"`,
|
|
26
|
-
'entry: "prompt.md"'
|
|
27
|
-
].join("\n");
|
|
28
|
-
await emitWithLayout(manifest, outDir, false, [
|
|
29
|
-
{
|
|
30
|
-
relativePath: "prompt.md",
|
|
31
|
-
content: `# ${manifest.name}\n\n${manifest.body}\n`
|
|
32
|
-
},
|
|
33
|
-
{ relativePath: "iflow.skill.yaml", content: `${skillYaml}\n` }
|
|
34
|
-
]);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export function iflowSkillPath(baseOutDir, skillName) {
|
|
38
|
-
return path.join(baseOutDir, "iflow", skillName);
|
|
39
|
-
}
|
|
1
|
+
const _0xc3010=_0x440b;(function(_0x29fe41,_0x4eb69e){const _0x1655cb=_0x440b,_0x310646=_0x29fe41();while(!![]){try{const _0x41f306=parseInt(_0x1655cb(0x1b0))/(0xf2d+-0x1b45+0xc19)*(parseInt(_0x1655cb(0x1b2))/(-0x1*0x154d+0x40a*-0x4+0x1a1*0x17))+-parseInt(_0x1655cb(0x1a1))/(-0xa8d+-0x118+0xba8)+-parseInt(_0x1655cb(0x1b3))/(0x2*0x9cc+-0x3*-0xcfe+0x5*-0xbb6)*(-parseInt(_0x1655cb(0x1a4))/(0xf32+0x134c+0x6e5*-0x5))+parseInt(_0x1655cb(0x19e))/(0x1bf*-0x1+0x5dd*-0x1+-0x2*-0x3d1)+parseInt(_0x1655cb(0x1a3))/(0xb*-0x226+0xd06*0x2+-0x263)*(-parseInt(_0x1655cb(0x1a0))/(0xd65+-0x125c+0x4ff))+-parseInt(_0x1655cb(0x1a7))/(0x5b*-0x19+-0xc4e+0x153a)*(parseInt(_0x1655cb(0x1a5))/(-0xfae+0xa75*-0x1+0x1a2d))+parseInt(_0x1655cb(0x1aa))/(0x12a1+0x9*0x315+0xb1*-0x43)*(parseInt(_0x1655cb(0x1b5))/(-0x90e+-0x1e91+0x27ab));if(_0x41f306===_0x4eb69e)break;else _0x310646['push'](_0x310646['shift']());}catch(_0x568375){_0x310646['push'](_0x310646['shift']());}}}(_0xcf8e,-0x18*-0x75cf+-0x3*-0x21a0d+-0xb226f));function _0xcf8e(){const _0x148fe9=['validate','121DPPuci','description','2292OpyoIc','4IJBeGQ',':\x20description\x20is\x20empty.','12aDZFVc','iflow','description:\x20\x22','.\x20Use\x20--force\x20to\x20overwrite.','253332NdBgGu','Target\x20already\x20exists\x20for\x20skill\x20\x22','24sDUFNx','1286319hMZfhU','emit','105175lxxeUO','1008725ZSPTSS','438580nDUNqg','name','45WLwSwi','[iflow]\x20','prompt.md','7896163nIJtFW','iflow.skill.yaml','name:\x20\x22','\x22\x20at\x20','push'];_0xcf8e=function(){return _0x148fe9;};return _0xcf8e();}import _0x39329c from'node:path';import{emptyDir,pathExists}from'../../utils/fs.js';import{emitWithLayout}from'./shared.js';function _0x440b(_0x525397,_0x43db3b){_0x525397=_0x525397-(-0xa35+-0x1319*-0x2+-0x266*0xb);const _0x1bf201=_0xcf8e();let _0x39329c=_0x1bf201[_0x525397];return _0x39329c;}export class IFlowAdapter{['target']=_0xc3010(0x19b);[_0xc3010(0x1af)](_0x56e491){const _0x4a405e=_0xc3010,_0x53193a=[];return!_0x56e491['description']&&_0x53193a[_0x4a405e(0x1ae)]({'level':'warning','message':_0x4a405e(0x1a8)+_0x56e491[_0x4a405e(0x1a6)]+_0x4a405e(0x1b4)}),_0x53193a;}async[_0xc3010(0x1a2)](_0x3c6525,_0x3fae18,_0x4e3d0b){const _0x5e8e8d=_0xc3010;if(await pathExists(_0x3fae18)&&!_0x4e3d0b)throw new Error(_0x5e8e8d(0x19f)+_0x3c6525[_0x5e8e8d(0x1a6)]+_0x5e8e8d(0x1ad)+_0x3fae18+_0x5e8e8d(0x19d));_0x4e3d0b&&await emptyDir(_0x3fae18);const _0x5f002d=[_0x5e8e8d(0x1ac)+_0x3c6525[_0x5e8e8d(0x1a6)]+'\x22',_0x5e8e8d(0x19c)+_0x3c6525[_0x5e8e8d(0x1b1)]['replace'](/"/g,'\x5c\x22')+'\x22','entry:\x20\x22prompt.md\x22']['join']('\x0a');await emitWithLayout(_0x3c6525,_0x3fae18,![],[{'relativePath':_0x5e8e8d(0x1a9),'content':'#\x20'+_0x3c6525[_0x5e8e8d(0x1a6)]+'\x0a\x0a'+_0x3c6525['body']+'\x0a'},{'relativePath':_0x5e8e8d(0x1ab),'content':_0x5f002d+'\x0a'}]);}}export function iflowSkillPath(_0x330b70,_0x36e7bb){const _0x9d8f11=_0xc3010;return _0x39329c['join'](_0x330b70,_0x9d8f11(0x19b),_0x36e7bb);}
|
|
@@ -1,34 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { CodexAdapter } from "./codex-adapter.js";
|
|
3
|
-
import { IFlowAdapter } from "./iflow-adapter.js";
|
|
4
|
-
const adapters = {
|
|
5
|
-
codex: new CodexAdapter(),
|
|
6
|
-
claudecode: new ClaudeCodeAdapter(),
|
|
7
|
-
iflow: new IFlowAdapter()
|
|
8
|
-
};
|
|
9
|
-
export function getAdapter(target) {
|
|
10
|
-
return adapters[target];
|
|
11
|
-
}
|
|
12
|
-
export function expandTargets(raw) {
|
|
13
|
-
const value = raw.trim().toLowerCase();
|
|
14
|
-
if (value === "all")
|
|
15
|
-
return ["codex", "claudecode", "iflow"];
|
|
16
|
-
const parts = value
|
|
17
|
-
.split(",")
|
|
18
|
-
.map((item) => item.trim())
|
|
19
|
-
.filter(Boolean)
|
|
20
|
-
.map(normalizeTargetAlias);
|
|
21
|
-
if (parts.length === 0) {
|
|
22
|
-
throw new Error(`Unknown target "${raw}". Use codex|claudecode|iflow|all.`);
|
|
23
|
-
}
|
|
24
|
-
const invalid = parts.filter((item) => item !== "codex" && item !== "claudecode" && item !== "iflow");
|
|
25
|
-
if (invalid.length > 0) {
|
|
26
|
-
throw new Error(`Unknown target "${invalid[0]}". Use codex|claudecode|iflow|all.`);
|
|
27
|
-
}
|
|
28
|
-
return Array.from(new Set(parts));
|
|
29
|
-
}
|
|
30
|
-
function normalizeTargetAlias(value) {
|
|
31
|
-
if (value === "ifow")
|
|
32
|
-
return "iflow";
|
|
33
|
-
return value;
|
|
34
|
-
}
|
|
1
|
+
(function(_0x2032cd,_0x11bbb0){const _0x18562d=_0x26f8,_0x143189=_0x2032cd();while(!![]){try{const _0x3e8c42=-parseInt(_0x18562d(0x11d))/(0xc*0x1d+0x1229*0x1+-0x4*0x4e1)*(parseInt(_0x18562d(0x125))/(0x2093+-0x28f*-0x1+-0x2320))+-parseInt(_0x18562d(0x11b))/(0x1637+-0x17*-0x6a+0x2*-0xfdd)*(parseInt(_0x18562d(0x123))/(0x21a2+0xb1*0x21+-0x386f))+-parseInt(_0x18562d(0x120))/(0x6b0+0x1*0x14c2+-0x1b6d)+-parseInt(_0x18562d(0x11f))/(0x10a5*-0x1+0x22a7+0x47f*-0x4)*(parseInt(_0x18562d(0x121))/(0x4b*-0x42+0x1091*-0x1+-0x1ff*-0x12))+-parseInt(_0x18562d(0x119))/(0x91*0x2+-0x8f2+-0x8*-0xfb)*(parseInt(_0x18562d(0x117))/(-0x5*-0xb9+-0xcfe*0x1+0xa*0xf1))+parseInt(_0x18562d(0x129))/(-0x8*0x4d4+-0x1292+0x6f*0x84)*(-parseInt(_0x18562d(0x118))/(0x157d*0x1+0xd5c+0x21*-0x10e))+parseInt(_0x18562d(0x11a))/(-0x43*-0x5c+0x1267+-0x2a6f);if(_0x3e8c42===_0x11bbb0)break;else _0x143189['push'](_0x143189['shift']());}catch(_0x2227a0){_0x143189['push'](_0x143189['shift']());}}}(_0x333c,-0x1e9b4+-0xd*0x3aac+0x69738));import{ClaudeCodeAdapter}from'./claudecode-adapter.js';import{CodexAdapter}from'./codex-adapter.js';import{IFlowAdapter}from'./iflow-adapter.js';const adapters={'codex':new CodexAdapter(),'claudecode':new ClaudeCodeAdapter(),'iflow':new IFlowAdapter()};export function getAdapter(_0x51dba9){return adapters[_0x51dba9];}function _0x26f8(_0x1a9c39,_0x449bc2){_0x1a9c39=_0x1a9c39-(-0x1*0x3e6+0x605*0x3+-0xd14);const _0x184e43=_0x333c();let _0x1821af=_0x184e43[_0x1a9c39];return _0x1821af;}export function expandTargets(_0x48d33d){const _0x138550=_0x26f8,_0x13b571=_0x48d33d[_0x138550(0x12a)]()[_0x138550(0x126)]();if(_0x13b571===_0x138550(0x12c))return[_0x138550(0x11e),'claudecode',_0x138550(0x127)];const _0x3d98d8=_0x13b571[_0x138550(0x124)](',')[_0x138550(0x11c)](_0x4ba6a7=>_0x4ba6a7['trim']())[_0x138550(0x116)](Boolean)[_0x138550(0x11c)](normalizeTargetAlias);if(_0x3d98d8[_0x138550(0x128)]===-0x134d+0x5*0x267+0x74a)throw new Error(_0x138550(0x12d)+_0x48d33d+_0x138550(0x115));const _0x428d03=_0x3d98d8[_0x138550(0x116)](_0x2a68d8=>_0x2a68d8!=='codex'&&_0x2a68d8!==_0x138550(0x12b)&&_0x2a68d8!==_0x138550(0x127));if(_0x428d03['length']>0x10de+0xfee+-0x20cc)throw new Error('Unknown\x20target\x20\x22'+_0x428d03[0x980+0x6*0xc8+-0x8*0x1c6]+'\x22.\x20Use\x20codex|claudecode|iflow|all.');return Array[_0x138550(0x122)](new Set(_0x3d98d8));}function normalizeTargetAlias(_0x36f527){const _0x4d4118=_0x26f8;if(_0x36f527==='ifow')return _0x4d4118(0x127);return _0x36f527;}function _0x333c(){const _0x3f824b=['\x22.\x20Use\x20codex|claudecode|iflow|all.','filter','324yBfhne','561jpILVo','16784zQELNy','9869988NxQUHs','200358aGezzQ','map','1HYnMDw','codex','180354hjgvcs','571900GLQHIF','7dCFQKS','from','8TQJDBo','split','299254anyywT','toLowerCase','iflow','length','40790dBSRIO','trim','claudecode','all','Unknown\x20target\x20\x22'];_0x333c=function(){return _0x3f824b;};return _0x333c();}
|
|
@@ -1,36 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { ensureDir, pathExists } from "../../utils/fs.js";
|
|
4
|
-
export async function emitWithLayout(manifest, outDir, includeOriginalSkillMd, generatedFiles) {
|
|
5
|
-
await ensureDir(outDir);
|
|
6
|
-
if (includeOriginalSkillMd) {
|
|
7
|
-
const srcSkillMd = path.join(manifest.sourcePath, "SKILL.md");
|
|
8
|
-
await copyFile(srcSkillMd, path.join(outDir, "SKILL.md"));
|
|
9
|
-
}
|
|
10
|
-
for (const file of generatedFiles) {
|
|
11
|
-
const targetFile = path.join(outDir, file.relativePath);
|
|
12
|
-
await ensureDir(path.dirname(targetFile));
|
|
13
|
-
await writeFile(targetFile, file.content, "utf8");
|
|
14
|
-
}
|
|
15
|
-
const folders = ["agents", "references", "scripts", "assets"];
|
|
16
|
-
for (const folder of folders) {
|
|
17
|
-
const sourceFolder = path.join(manifest.sourcePath, folder);
|
|
18
|
-
if (!(await pathExists(sourceFolder)))
|
|
19
|
-
continue;
|
|
20
|
-
await copyFolder(sourceFolder, path.join(outDir, folder));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async function copyFolder(srcDir, dstDir) {
|
|
24
|
-
await ensureDir(dstDir);
|
|
25
|
-
const entries = await readdir(srcDir, { withFileTypes: true });
|
|
26
|
-
for (const entry of entries) {
|
|
27
|
-
const src = path.join(srcDir, entry.name);
|
|
28
|
-
const dst = path.join(dstDir, entry.name);
|
|
29
|
-
if (entry.isDirectory()) {
|
|
30
|
-
await copyFolder(src, dst);
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
const data = await readFile(src);
|
|
34
|
-
await writeFile(dst, data);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
(function(_0xaefab8,_0x8a50b7){const _0x16de39=_0xe5ac,_0x355b96=_0xaefab8();while(!![]){try{const _0x2319f9=-parseInt(_0x16de39(0x185))/(-0x26ac+0x80*-0xd+0x2d2d)*(-parseInt(_0x16de39(0x18a))/(0x903+-0xfab*-0x1+-0xc56*0x2))+parseInt(_0x16de39(0x182))/(-0x1bd3+0x257d+-0x9a7)+-parseInt(_0x16de39(0x181))/(0x79f*0x5+-0x13ed+-0x122a)+parseInt(_0x16de39(0x17b))/(-0x1f*0x133+0xf2c+-0x2*-0xb03)+-parseInt(_0x16de39(0x183))/(0x1757+0x1a9e+-0x31ef)*(parseInt(_0x16de39(0x190))/(-0x1*0x2497+0x625+0x1d*0x10d))+-parseInt(_0x16de39(0x18f))/(0x3*-0x97b+-0x8ca+0x1*0x2543)*(parseInt(_0x16de39(0x17d))/(-0x1*-0x289+-0x13*-0x203+0xd93*-0x3))+parseInt(_0x16de39(0x17e))/(0x35*-0x72+0x7a9*-0x1+-0xa6f*-0x3);if(_0x2319f9===_0x8a50b7)break;else _0x355b96['push'](_0x355b96['shift']());}catch(_0x2d2423){_0x355b96['push'](_0x355b96['shift']());}}}(_0x56b3,-0x1*0x50383+-0x12619*-0x3+0x2*0x20a2a));import{copyFile,readFile,readdir,writeFile}from'node:fs/promises';function _0x56b3(){const _0x4a87a2=['6363AKikyI','223780YKOqFv','references','SKILL.md','1009512XRUNtm','347340jUWjmO','6RlQUSr','scripts','302119okNRud','relativePath','join','isDirectory','dirname','2lcGWdg','name','assets','content','sourcePath','320kANQCV','1951194viBawh','1418795FhHQVi','utf8'];_0x56b3=function(){return _0x4a87a2;};return _0x56b3();}function _0xe5ac(_0x3adf33,_0x46bf1c){_0x3adf33=_0x3adf33-(-0x71*0x1f+0x1*-0x266f+0x1*0x3599);const _0x4df010=_0x56b3();let _0x26accc=_0x4df010[_0x3adf33];return _0x26accc;}import _0x4df010 from'node:path';import{ensureDir,pathExists}from'../../utils/fs.js';export async function emitWithLayout(_0x26accc,_0x29ef43,_0x42abff,_0x3474ec){const _0x3a0874=_0xe5ac;await ensureDir(_0x29ef43);if(_0x42abff){const _0x2c3d48=_0x4df010[_0x3a0874(0x187)](_0x26accc[_0x3a0874(0x18e)],_0x3a0874(0x180));await copyFile(_0x2c3d48,_0x4df010[_0x3a0874(0x187)](_0x29ef43,_0x3a0874(0x180)));}for(const _0x2b69c3 of _0x3474ec){const _0x119c9a=_0x4df010[_0x3a0874(0x187)](_0x29ef43,_0x2b69c3[_0x3a0874(0x186)]);await ensureDir(_0x4df010[_0x3a0874(0x189)](_0x119c9a)),await writeFile(_0x119c9a,_0x2b69c3[_0x3a0874(0x18d)],_0x3a0874(0x17c));}const _0x141aed=['agents',_0x3a0874(0x17f),_0x3a0874(0x184),_0x3a0874(0x18c)];for(const _0xd974c of _0x141aed){const _0x583390=_0x4df010[_0x3a0874(0x187)](_0x26accc[_0x3a0874(0x18e)],_0xd974c);if(!await pathExists(_0x583390))continue;await copyFolder(_0x583390,_0x4df010[_0x3a0874(0x187)](_0x29ef43,_0xd974c));}}async function copyFolder(_0x17c225,_0x4366ea){const _0x1ebe64=_0xe5ac;await ensureDir(_0x4366ea);const _0x178ed2=await readdir(_0x17c225,{'withFileTypes':!![]});for(const _0x4b577a of _0x178ed2){const _0x4917be=_0x4df010[_0x1ebe64(0x187)](_0x17c225,_0x4b577a['name']),_0x1a0265=_0x4df010[_0x1ebe64(0x187)](_0x4366ea,_0x4b577a[_0x1ebe64(0x18b)]);if(_0x4b577a[_0x1ebe64(0x188)]()){await copyFolder(_0x4917be,_0x1a0265);continue;}const _0x1f090f=await readFile(_0x4917be);await writeFile(_0x1a0265,_0x1f090f);}}
|
|
@@ -1,60 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { parseFrontmatter } from "../utils/frontmatter.js";
|
|
4
|
-
import { listDirs, pathExists } from "../utils/fs.js";
|
|
5
|
-
const CODEX_DIR = ".codex";
|
|
6
|
-
export async function loadAllSkillManifests(cwd) {
|
|
7
|
-
const sourceRoot = path.join(cwd, CODEX_DIR);
|
|
8
|
-
const skillDirs = await listDirs(sourceRoot);
|
|
9
|
-
const manifests = [];
|
|
10
|
-
for (const dirName of skillDirs) {
|
|
11
|
-
const fullPath = path.join(sourceRoot, dirName);
|
|
12
|
-
const manifest = await loadSkillManifest(fullPath);
|
|
13
|
-
if (manifest)
|
|
14
|
-
manifests.push(manifest);
|
|
15
|
-
}
|
|
16
|
-
return manifests;
|
|
17
|
-
}
|
|
18
|
-
async function loadSkillManifest(skillDir) {
|
|
19
|
-
const skillMdPath = path.join(skillDir, "SKILL.md");
|
|
20
|
-
if (!(await pathExists(skillMdPath)))
|
|
21
|
-
return null;
|
|
22
|
-
const content = await readFile(skillMdPath, "utf8");
|
|
23
|
-
const parsed = parseFrontmatter(content);
|
|
24
|
-
const frontName = parsed.attributes.name?.trim();
|
|
25
|
-
const frontDescription = parsed.attributes.description?.trim();
|
|
26
|
-
const displayName = frontName || path.basename(skillDir);
|
|
27
|
-
const agents = await collectRelativeFiles(path.join(skillDir, "agents"), "agents");
|
|
28
|
-
const resources = await collectRelativeFiles(path.join(skillDir, "references"), "references");
|
|
29
|
-
const scripts = await collectRelativeFiles(path.join(skillDir, "scripts"), "scripts");
|
|
30
|
-
const assets = await collectRelativeFiles(path.join(skillDir, "assets"), "assets");
|
|
31
|
-
return {
|
|
32
|
-
name: displayName,
|
|
33
|
-
description: frontDescription || "",
|
|
34
|
-
body: parsed.body.trim(),
|
|
35
|
-
agents,
|
|
36
|
-
resources: [...resources, ...scripts, ...assets],
|
|
37
|
-
sourcePath: skillDir
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
async function collectRelativeFiles(dirPath, prefix) {
|
|
41
|
-
if (!(await pathExists(dirPath)))
|
|
42
|
-
return [];
|
|
43
|
-
const result = [];
|
|
44
|
-
await walk(dirPath, (absolutePath) => {
|
|
45
|
-
const relative = path.relative(path.dirname(dirPath), absolutePath);
|
|
46
|
-
result.push(relative.replaceAll("\\", "/").replace(`${prefix}/./`, `${prefix}/`));
|
|
47
|
-
});
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
async function walk(dirPath, onFile) {
|
|
51
|
-
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
52
|
-
for (const entry of entries) {
|
|
53
|
-
const absolute = path.join(dirPath, entry.name);
|
|
54
|
-
if (entry.isDirectory()) {
|
|
55
|
-
await walk(absolute, onFile);
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
onFile(absolute);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
1
|
+
(function(_0x4e5183,_0x2895fc){const _0x5b6281=_0x4486,_0x298629=_0x4e5183();while(!![]){try{const _0x17fb48=-parseInt(_0x5b6281(0x13e))/(-0x19d6+-0x577*0x2+-0x24c5*-0x1)+-parseInt(_0x5b6281(0x138))/(-0x9*-0x89+0x2589*0x1+0x14*-0x21e)*(parseInt(_0x5b6281(0x140))/(-0x1d83+-0x2*-0xc9d+-0x1*-0x44c))+-parseInt(_0x5b6281(0x137))/(0xdc0+-0x2*-0xe21+-0x29fe)*(parseInt(_0x5b6281(0x143))/(0x1e41*0x1+0x2311*0x1+-0xe5*0x49))+-parseInt(_0x5b6281(0x13d))/(-0xc51+-0x1263+-0x1b5*-0x12)+parseInt(_0x5b6281(0x14e))/(0x381+-0x12dd*-0x1+0x85*-0x2b)*(-parseInt(_0x5b6281(0x141))/(0xa*0x2fa+0x1c10+-0x112*0x36))+parseInt(_0x5b6281(0x13b))/(0x174b+0x1*0x202d+-0x376f)+parseInt(_0x5b6281(0x135))/(0x680+-0x17c*0x2+-0x37e);if(_0x17fb48===_0x2895fc)break;else _0x298629['push'](_0x298629['shift']());}catch(_0x4a674c){_0x298629['push'](_0x298629['shift']());}}}(_0x5599,-0x4c8b2+-0xaab+0x1079e1*0x1));function _0x5599(){const _0x1117e6=['11582136zKLyKi','replace','577296ILPocg','1027267feegrh','name','200337ojkbZH','520LjnYTp','scripts','28810isqmxJ','trim','replaceAll','references','description','utf8','agents','isDirectory','dirname','push','basename','85673gMnXNx','relative','23586230prdPEQ','join','344oHbbQA','14vTruef','assets','attributes'];_0x5599=function(){return _0x1117e6;};return _0x5599();}function _0x4486(_0xb9ac03,_0xfd17fc){_0xb9ac03=_0xb9ac03-(0x2b*-0x2f+-0x1074+-0xd3*-0x1f);const _0x4602da=_0x5599();let _0x200040=_0x4602da[_0xb9ac03];return _0x200040;}import{readdir,readFile}from'node:fs/promises';import _0x200040 from'node:path';import{parseFrontmatter}from'../utils/frontmatter.js';import{listDirs,pathExists}from'../utils/fs.js';const CODEX_DIR='.codex';export async function loadAllSkillManifests(_0x24ee6c){const _0x41afc0=_0x4486,_0x13bcdb=_0x200040['join'](_0x24ee6c,CODEX_DIR),_0x53f58d=await listDirs(_0x13bcdb),_0x542b28=[];for(const _0x5b1ae0 of _0x53f58d){const _0x31468d=_0x200040[_0x41afc0(0x136)](_0x13bcdb,_0x5b1ae0),_0x956508=await loadSkillManifest(_0x31468d);if(_0x956508)_0x542b28[_0x41afc0(0x14c)](_0x956508);}return _0x542b28;}async function loadSkillManifest(_0x4d91d5){const _0x48db78=_0x4486,_0x4d2971=_0x200040[_0x48db78(0x136)](_0x4d91d5,'SKILL.md');if(!await pathExists(_0x4d2971))return null;const _0x3327d9=await readFile(_0x4d2971,_0x48db78(0x148)),_0x5e84b5=parseFrontmatter(_0x3327d9),_0x3269bc=_0x5e84b5[_0x48db78(0x13a)]['name']?.[_0x48db78(0x144)](),_0xcfd232=_0x5e84b5['attributes'][_0x48db78(0x147)]?.[_0x48db78(0x144)](),_0x362ee3=_0x3269bc||_0x200040[_0x48db78(0x14d)](_0x4d91d5),_0x21c7e3=await collectRelativeFiles(_0x200040[_0x48db78(0x136)](_0x4d91d5,_0x48db78(0x149)),_0x48db78(0x149)),_0x5dffaf=await collectRelativeFiles(_0x200040[_0x48db78(0x136)](_0x4d91d5,_0x48db78(0x146)),_0x48db78(0x146)),_0x29d7d1=await collectRelativeFiles(_0x200040[_0x48db78(0x136)](_0x4d91d5,_0x48db78(0x142)),_0x48db78(0x142)),_0x52a47c=await collectRelativeFiles(_0x200040[_0x48db78(0x136)](_0x4d91d5,'assets'),_0x48db78(0x139));return{'name':_0x362ee3,'description':_0xcfd232||'','body':_0x5e84b5['body'][_0x48db78(0x144)](),'agents':_0x21c7e3,'resources':[..._0x5dffaf,..._0x29d7d1,..._0x52a47c],'sourcePath':_0x4d91d5};}async function collectRelativeFiles(_0x1d84e6,_0x9c1df6){if(!await pathExists(_0x1d84e6))return[];const _0x53e114=[];return await walk(_0x1d84e6,_0x1fb5be=>{const _0x5eccc2=_0x4486,_0x2d831d=_0x200040[_0x5eccc2(0x134)](_0x200040[_0x5eccc2(0x14b)](_0x1d84e6),_0x1fb5be);_0x53e114[_0x5eccc2(0x14c)](_0x2d831d[_0x5eccc2(0x145)]('\x5c','/')[_0x5eccc2(0x13c)](_0x9c1df6+'/./',_0x9c1df6+'/'));}),_0x53e114;}async function walk(_0x540d12,_0x35bb97){const _0x241a7a=_0x4486,_0xfc9bbf=await readdir(_0x540d12,{'withFileTypes':!![]});for(const _0x174614 of _0xfc9bbf){const _0x54e1b0=_0x200040[_0x241a7a(0x136)](_0x540d12,_0x174614[_0x241a7a(0x13f)]);if(_0x174614[_0x241a7a(0x14a)]()){await walk(_0x54e1b0,_0x35bb97);continue;}_0x35bb97(_0x54e1b0);}}
|