agent-ctrl-cli 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +39 -22
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8403,45 +8403,62 @@ class QwenAdapter {
8403
8403
  // src/infrastructure/features/kilo/adapters/KiloAdapter.ts
8404
8404
  import { homedir as homedir15 } from "node:os";
8405
8405
  import { resolve as resolve26 } from "node:path";
8406
+ import { mkdir as mkdir8 } from "node:fs/promises";
8407
+ var KILO_VSCODE_DIR = ".kilo";
8408
+ var KILO_CLI_DIR = ".kilocode";
8409
+ function getKiloConfigRoots(basePath) {
8410
+ return [resolve26(basePath, KILO_VSCODE_DIR), resolve26(basePath, KILO_CLI_DIR)];
8411
+ }
8412
+ async function ensureDirExists(path) {
8413
+ await mkdir8(path, { recursive: true });
8414
+ }
8415
+
8406
8416
  class KiloAdapter {
8407
8417
  platformName = "kilo";
8408
8418
  sourceLoader = new ApplySourceLoader;
8409
8419
  async resolveTarget(projectPath, request) {
8410
8420
  const scope = resolveApplyScope(request?.targetScope, "user", true);
8411
- const userRoot = request?.userConfigRootPath ? resolve26(request.userConfigRootPath) : resolve26(homedir15(), ".kilocode");
8421
+ const targetPath = scope === "project" ? projectPath : request?.userConfigRootPath ?? resolve26(homedir15());
8422
+ const [vscodeRoot, cliRoot] = getKiloConfigRoots(targetPath);
8423
+ await ensureDirExists(vscodeRoot);
8424
+ await ensureDirExists(cliRoot);
8412
8425
  return {
8413
- configPath: scope === "project" ? resolve26(projectPath, ".kilocode") : userRoot,
8426
+ configPath: vscodeRoot,
8414
8427
  scope,
8415
8428
  surface: "rules-workflows-skills-agents-mcp"
8416
8429
  };
8417
8430
  }
8418
8431
  async applyAppyIntegration(request) {
8419
- const target = await this.resolveTarget(request.projectPath, request);
8432
+ const scope = resolveApplyScope(request?.targetScope, "user", true);
8433
+ const targetPath = scope === "project" ? request.projectPath : request?.userConfigRootPath ?? resolve26(homedir15());
8434
+ const targetRoots = getKiloConfigRoots(targetPath);
8420
8435
  const source = await this.sourceLoader.load(request.projectPath);
8421
8436
  let changed = false;
8422
8437
  const fileChanges = [];
8423
- const rulesResult = await syncRulesAsFiles(source.rules, resolve26(target.configPath, "rules"), (rule, content) => ({ relativePath: `${rule.id}.md`, content: content.trimEnd() }), Boolean(request.dryRun));
8424
- changed = rulesResult.changed || changed;
8425
- fileChanges.push(...rulesResult.paths);
8426
- const workflowsResult = await syncCommandsAsMarkdown(source.commands, resolve26(target.configPath, "workflows"), Boolean(request.dryRun), CommandRendererFactory.getRenderer("workflow"), "-");
8427
- changed = workflowsResult.changed || changed;
8428
- fileChanges.push(...workflowsResult.paths);
8429
- const skillsResult = await syncSkills(source.skills, resolve26(target.configPath, "skills"), Boolean(request.dryRun));
8430
- changed = skillsResult.changed || changed;
8431
- fileChanges.push(...skillsResult.paths);
8432
- const agentsResult = await syncAgentsAsMarkdown(source.agents, resolve26(target.configPath, "agents"), Boolean(request.dryRun), true);
8433
- changed = agentsResult.changed || changed;
8434
- fileChanges.push(...agentsResult.paths);
8435
- const mcpResult = await mergeJsonObjectFile(resolve26(target.configPath, "kilo.json"), (existing) => renderOpencodeMcpConfig(existing, source.mcpServers), Boolean(request.dryRun));
8436
- changed = mcpResult.changed || changed;
8437
- fileChanges.push(...mcpResult.paths);
8438
+ for (const targetRoot of targetRoots) {
8439
+ const rulesResult = await syncRulesAsFiles(source.rules, resolve26(targetRoot, "rules"), (rule, content) => ({ relativePath: `${rule.id}.md`, content: content.trimEnd() }), Boolean(request.dryRun));
8440
+ changed = rulesResult.changed || changed;
8441
+ fileChanges.push(...rulesResult.paths);
8442
+ const workflowsResult = await syncCommandsAsMarkdown(source.commands, resolve26(targetRoot, "commands"), Boolean(request.dryRun), CommandRendererFactory.getRenderer("workflow"), ":");
8443
+ changed = workflowsResult.changed || changed;
8444
+ fileChanges.push(...workflowsResult.paths);
8445
+ const skillsResult = await syncSkills(source.skills, resolve26(targetRoot, "skills"), Boolean(request.dryRun));
8446
+ changed = skillsResult.changed || changed;
8447
+ fileChanges.push(...skillsResult.paths);
8448
+ const agentsResult = await syncAgentsAsMarkdown(source.agents, resolve26(targetRoot, "agents"), Boolean(request.dryRun), true);
8449
+ changed = agentsResult.changed || changed;
8450
+ fileChanges.push(...agentsResult.paths);
8451
+ const mcpResult = await mergeJsonObjectFile(resolve26(targetRoot, "kilo.json"), (existing) => renderOpencodeMcpConfig(existing, source.mcpServers), Boolean(request.dryRun));
8452
+ changed = mcpResult.changed || changed;
8453
+ fileChanges.push(...mcpResult.paths);
8454
+ }
8438
8455
  return {
8439
8456
  platform: this.platformName,
8440
- configPath: target.configPath,
8441
- scope: target.scope,
8442
- surface: target.surface,
8457
+ configPath: targetRoots.join(", "),
8458
+ scope,
8459
+ surface: "rules-workflows-skills-agents-mcp",
8443
8460
  status: toStatus(changed),
8444
- message: "Applied Kilo rules, workflows, skills, agents, and MCP servers.",
8461
+ message: "Applied Kilo rules, workflows, skills, agents, and MCP servers to both .kilo and .kilocode directories.",
8445
8462
  fileChanges,
8446
8463
  warnings: source.warnings
8447
8464
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-ctrl-cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "A centralized CLI tool for managing AI agent configurations with standard directory-based patterns.",
5
5
  "author": "Ahmet Cetinkaya <ahmetcetinkaya@tutamail.com> (https://github.com/ahmet-cetinkaya)",
6
6
  "license": "GPL-3.0",