oneagent 0.2.4 → 0.2.5
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/index.js +89 -75
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1290,6 +1290,57 @@ var init_dist3 = __esm(() => {
|
|
|
1290
1290
|
zt = { light: C("─", "-"), heavy: C("━", "="), block: C("█", "#") };
|
|
1291
1291
|
Qt = `${import_picocolors2.default.gray(d)} `;
|
|
1292
1292
|
});
|
|
1293
|
+
// ../core/src/agents.ts
|
|
1294
|
+
var AGENT_DEFINITIONS;
|
|
1295
|
+
var init_agents = __esm(() => {
|
|
1296
|
+
AGENT_DEFINITIONS = [
|
|
1297
|
+
{
|
|
1298
|
+
target: "claude",
|
|
1299
|
+
displayName: "Claude Code",
|
|
1300
|
+
hint: "CLAUDE.md + .claude/rules/",
|
|
1301
|
+
detectIndicators: ["CLAUDE.md", ".claude"],
|
|
1302
|
+
mainFile: "CLAUDE.md",
|
|
1303
|
+
rulesDir: ".claude/rules",
|
|
1304
|
+
skillsDir: ".claude/skills"
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
target: "cursor",
|
|
1308
|
+
displayName: "Cursor",
|
|
1309
|
+
hint: "AGENTS.md + .cursor/rules/",
|
|
1310
|
+
detectIndicators: [".cursor", ".cursorrules"],
|
|
1311
|
+
mainFile: "AGENTS.md",
|
|
1312
|
+
rulesDir: ".cursor/rules",
|
|
1313
|
+
skillsDir: ".cursor/skills",
|
|
1314
|
+
deprecatedFiles: [".cursorrules"]
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
target: "windsurf",
|
|
1318
|
+
displayName: "Windsurf",
|
|
1319
|
+
hint: "AGENTS.md + .windsurf/rules/",
|
|
1320
|
+
detectIndicators: [".windsurf", ".windsurfrules"],
|
|
1321
|
+
mainFile: "AGENTS.md",
|
|
1322
|
+
rulesDir: ".windsurf/rules",
|
|
1323
|
+
skillsDir: ".windsurf/skills",
|
|
1324
|
+
deprecatedFiles: [".windsurfrules"]
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
target: "opencode",
|
|
1328
|
+
displayName: "OpenCode",
|
|
1329
|
+
hint: "AGENTS.md + opencode.json",
|
|
1330
|
+
detectIndicators: ["opencode.json", ".opencode"],
|
|
1331
|
+
mainFile: "AGENTS.md"
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
target: "copilot",
|
|
1335
|
+
displayName: "GitHub Copilot",
|
|
1336
|
+
hint: ".github/instructions/*.instructions.md",
|
|
1337
|
+
detectIndicators: [".github/copilot-instructions.md", ".github"],
|
|
1338
|
+
mainFile: ".github/copilot-instructions.md",
|
|
1339
|
+
skillsDir: ".github/skills"
|
|
1340
|
+
}
|
|
1341
|
+
];
|
|
1342
|
+
});
|
|
1343
|
+
|
|
1293
1344
|
// ../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.js
|
|
1294
1345
|
var require_identity = __commonJS((exports) => {
|
|
1295
1346
|
var ALIAS = Symbol.for("yaml.alias");
|
|
@@ -8324,6 +8375,7 @@ async function detectDeprecatedCommandFiles(root) {
|
|
|
8324
8375
|
}
|
|
8325
8376
|
var AGENT_FILES, DEPRECATED_FILES;
|
|
8326
8377
|
var init_detect = __esm(() => {
|
|
8378
|
+
init_agents();
|
|
8327
8379
|
AGENT_FILES = [
|
|
8328
8380
|
"CLAUDE.md",
|
|
8329
8381
|
"AGENTS.md",
|
|
@@ -8331,7 +8383,7 @@ var init_detect = __esm(() => {
|
|
|
8331
8383
|
".windsurfrules",
|
|
8332
8384
|
".github/copilot-instructions.md"
|
|
8333
8385
|
];
|
|
8334
|
-
DEPRECATED_FILES = [
|
|
8386
|
+
DEPRECATED_FILES = AGENT_DEFINITIONS.flatMap((d2) => d2.deprecatedFiles ?? []);
|
|
8335
8387
|
});
|
|
8336
8388
|
|
|
8337
8389
|
// ../core/src/rules.ts
|
|
@@ -8422,24 +8474,8 @@ function buildMainSymlinks(root, targets) {
|
|
|
8422
8474
|
const instructionsAbs = path5.join(root, ".oneagent/instructions.md");
|
|
8423
8475
|
const seen = new Map;
|
|
8424
8476
|
for (const target of targets) {
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
case "claude":
|
|
8428
|
-
symlinkPath = path5.join(root, "CLAUDE.md");
|
|
8429
|
-
break;
|
|
8430
|
-
case "cursor":
|
|
8431
|
-
symlinkPath = path5.join(root, "AGENTS.md");
|
|
8432
|
-
break;
|
|
8433
|
-
case "windsurf":
|
|
8434
|
-
symlinkPath = path5.join(root, ".windsurfrules");
|
|
8435
|
-
break;
|
|
8436
|
-
case "opencode":
|
|
8437
|
-
symlinkPath = path5.join(root, "AGENTS.md");
|
|
8438
|
-
break;
|
|
8439
|
-
case "copilot":
|
|
8440
|
-
symlinkPath = path5.join(root, ".github/copilot-instructions.md");
|
|
8441
|
-
break;
|
|
8442
|
-
}
|
|
8477
|
+
const def = AGENT_DEFINITIONS.find((d2) => d2.target === target);
|
|
8478
|
+
const symlinkPath = path5.join(root, def.mainFile);
|
|
8443
8479
|
if (!seen.has(symlinkPath)) {
|
|
8444
8480
|
seen.set(symlinkPath, {
|
|
8445
8481
|
symlinkPath,
|
|
@@ -8450,51 +8486,19 @@ function buildMainSymlinks(root, targets) {
|
|
|
8450
8486
|
}
|
|
8451
8487
|
return Array.from(seen.values());
|
|
8452
8488
|
}
|
|
8453
|
-
function buildRulesSymlinks(root, targets
|
|
8454
|
-
const
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
rulesDir = path5.join(root, ".claude/rules");
|
|
8460
|
-
break;
|
|
8461
|
-
case "cursor":
|
|
8462
|
-
rulesDir = path5.join(root, ".cursor/rules");
|
|
8463
|
-
break;
|
|
8464
|
-
case "windsurf":
|
|
8465
|
-
rulesDir = path5.join(root, ".windsurf/rules");
|
|
8466
|
-
break;
|
|
8467
|
-
case "opencode":
|
|
8468
|
-
case "copilot":
|
|
8469
|
-
rulesDir = null;
|
|
8470
|
-
break;
|
|
8471
|
-
}
|
|
8472
|
-
if (!rulesDir)
|
|
8473
|
-
continue;
|
|
8474
|
-
for (const rule of rules) {
|
|
8475
|
-
const symlinkPath = path5.join(rulesDir, `${rule.name}.md`);
|
|
8476
|
-
entries.push({
|
|
8477
|
-
symlinkPath,
|
|
8478
|
-
target: relativeTarget(symlinkPath, rule.path),
|
|
8479
|
-
label: path5.relative(root, symlinkPath)
|
|
8480
|
-
});
|
|
8481
|
-
}
|
|
8482
|
-
}
|
|
8483
|
-
return entries;
|
|
8489
|
+
function buildRulesSymlinks(root, targets) {
|
|
8490
|
+
const targetAbs = path5.join(root, ".oneagent/rules");
|
|
8491
|
+
return AGENT_DEFINITIONS.filter((d2) => targets.includes(d2.target) && d2.rulesDir).map((d2) => {
|
|
8492
|
+
const symlinkPath = path5.join(root, d2.rulesDir);
|
|
8493
|
+
return { symlinkPath, target: relativeTarget(symlinkPath, targetAbs), label: d2.rulesDir };
|
|
8494
|
+
});
|
|
8484
8495
|
}
|
|
8485
8496
|
function buildSkillSymlinks(root, targets) {
|
|
8486
8497
|
const targetAbs = path5.join(root, ".oneagent/skills");
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
copilot: path5.join(root, ".github/skills")
|
|
8492
|
-
};
|
|
8493
|
-
return Object.entries(agentDirs).filter(([target]) => targets.includes(target)).map(([, dir]) => ({
|
|
8494
|
-
symlinkPath: dir,
|
|
8495
|
-
target: relativeTarget(dir, targetAbs),
|
|
8496
|
-
label: path5.relative(root, dir)
|
|
8497
|
-
}));
|
|
8498
|
+
return AGENT_DEFINITIONS.filter((d2) => targets.includes(d2.target) && d2.skillsDir).map((d2) => {
|
|
8499
|
+
const symlinkPath = path5.join(root, d2.skillsDir);
|
|
8500
|
+
return { symlinkPath, target: relativeTarget(symlinkPath, targetAbs), label: d2.skillsDir };
|
|
8501
|
+
});
|
|
8498
8502
|
}
|
|
8499
8503
|
function buildAgentsDirSymlinks(root) {
|
|
8500
8504
|
const symlinkPath = path5.join(root, ".agents/skills");
|
|
@@ -8571,7 +8575,9 @@ async function checkSymlink(entry) {
|
|
|
8571
8575
|
return { ...entry, exists: false, valid: false };
|
|
8572
8576
|
}
|
|
8573
8577
|
}
|
|
8574
|
-
var init_symlinks = () => {
|
|
8578
|
+
var init_symlinks = __esm(() => {
|
|
8579
|
+
init_agents();
|
|
8580
|
+
});
|
|
8575
8581
|
|
|
8576
8582
|
// ../core/src/copilot.ts
|
|
8577
8583
|
import path6 from "path";
|
|
@@ -8647,7 +8653,7 @@ async function detectGenerateCollisions(root, config) {
|
|
|
8647
8653
|
const targets = activeTargets(config);
|
|
8648
8654
|
const mainEntries = buildMainSymlinks(root, targets);
|
|
8649
8655
|
const ruleSkillEntries = [
|
|
8650
|
-
...buildRulesSymlinks(root, targets
|
|
8656
|
+
...buildRulesSymlinks(root, targets),
|
|
8651
8657
|
...buildSkillSymlinks(root, targets)
|
|
8652
8658
|
];
|
|
8653
8659
|
const [mainCollisions, ruleSkillSymlinkCollisions] = await Promise.all([
|
|
@@ -8694,7 +8700,7 @@ async function generate(root, config) {
|
|
|
8694
8700
|
const targets = activeTargets(config);
|
|
8695
8701
|
await migrateRuleAndSkillFiles(root);
|
|
8696
8702
|
const mainSymlinks = buildMainSymlinks(root, targets);
|
|
8697
|
-
const rulesSymlinks = buildRulesSymlinks(root, targets
|
|
8703
|
+
const rulesSymlinks = buildRulesSymlinks(root, targets);
|
|
8698
8704
|
const skillSymlinks = await buildSkillSymlinks(root, targets);
|
|
8699
8705
|
await createAllSymlinks([...mainSymlinks, ...rulesSymlinks, ...skillSymlinks, ...buildAgentsDirSymlinks(root)]);
|
|
8700
8706
|
if (targets.includes("copilot")) {
|
|
@@ -8747,7 +8753,7 @@ async function checkStatus(root, config) {
|
|
|
8747
8753
|
const targets = activeTargets(config);
|
|
8748
8754
|
const allEntries = [
|
|
8749
8755
|
...buildMainSymlinks(root, targets),
|
|
8750
|
-
...buildRulesSymlinks(root, targets
|
|
8756
|
+
...buildRulesSymlinks(root, targets),
|
|
8751
8757
|
...buildSkillSymlinks(root, targets),
|
|
8752
8758
|
...buildAgentsDirSymlinks(root)
|
|
8753
8759
|
];
|
|
@@ -8862,6 +8868,7 @@ var init_apply_template = __esm(() => {
|
|
|
8862
8868
|
|
|
8863
8869
|
// ../core/src/index.ts
|
|
8864
8870
|
var init_src = __esm(() => {
|
|
8871
|
+
init_agents();
|
|
8865
8872
|
init_config();
|
|
8866
8873
|
init_detect();
|
|
8867
8874
|
init_rules();
|
|
@@ -9011,18 +9018,24 @@ async function chooseContent(detected) {
|
|
|
9011
9018
|
const index = parseInt(result.replace("file:", ""), 10);
|
|
9012
9019
|
return detected[index].content;
|
|
9013
9020
|
}
|
|
9014
|
-
async function
|
|
9021
|
+
async function detectPresentTargets(root) {
|
|
9022
|
+
const results = await Promise.all(AGENT_DEFINITIONS.map(async (def) => {
|
|
9023
|
+
for (const indicator of def.detectIndicators) {
|
|
9024
|
+
try {
|
|
9025
|
+
await fs12.access(path11.join(root, indicator));
|
|
9026
|
+
return def.target;
|
|
9027
|
+
} catch {}
|
|
9028
|
+
}
|
|
9029
|
+
return null;
|
|
9030
|
+
}));
|
|
9031
|
+
return results.filter((t) => t !== null);
|
|
9032
|
+
}
|
|
9033
|
+
async function pickTargets(initialValues) {
|
|
9015
9034
|
const result = await je({
|
|
9016
9035
|
message: `Which AI agents do you want to support?
|
|
9017
9036
|
\x1B[90m · Space to toggle · Enter to confirm\x1B[39m`,
|
|
9018
|
-
options:
|
|
9019
|
-
|
|
9020
|
-
{ value: "cursor", label: "Cursor", hint: "AGENTS.md + .cursor/rules/" },
|
|
9021
|
-
{ value: "windsurf", label: "Windsurf", hint: ".windsurfrules + .windsurf/rules/" },
|
|
9022
|
-
{ value: "opencode", label: "OpenCode", hint: "AGENTS.md + opencode.json" },
|
|
9023
|
-
{ value: "copilot", label: "GitHub Copilot", hint: ".github/instructions/*.instructions.md" }
|
|
9024
|
-
],
|
|
9025
|
-
initialValues: ["claude"],
|
|
9037
|
+
options: AGENT_DEFINITIONS.map((d2) => ({ value: d2.target, label: d2.displayName, hint: d2.hint })),
|
|
9038
|
+
initialValues,
|
|
9026
9039
|
required: true
|
|
9027
9040
|
});
|
|
9028
9041
|
if (Ct(result))
|
|
@@ -9113,7 +9126,8 @@ var init_init = __esm(() => {
|
|
|
9113
9126
|
} else {
|
|
9114
9127
|
importedContent = await chooseContent(detected);
|
|
9115
9128
|
}
|
|
9116
|
-
const
|
|
9129
|
+
const presentTargets = await detectPresentTargets(root);
|
|
9130
|
+
const selectedTargets = await pickTargets(presentTargets);
|
|
9117
9131
|
const s = bt2();
|
|
9118
9132
|
s.start("Setting up .oneagent/ directory...");
|
|
9119
9133
|
await fs12.mkdir(path11.join(root, ".oneagent/rules"), { recursive: true });
|
package/package.json
CHANGED