@cleocode/adapters 2026.4.24 → 2026.4.26

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 CHANGED
@@ -387,9 +387,21 @@ var init_hooks = __esm({
387
387
  });
388
388
 
389
389
  // packages/adapters/src/providers/claude-code/install.ts
390
- import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
390
+ import {
391
+ copyFileSync,
392
+ existsSync as existsSync2,
393
+ mkdirSync,
394
+ readdirSync,
395
+ readFileSync as readFileSync2,
396
+ writeFileSync as writeFileSync2
397
+ } from "node:fs";
391
398
  import { homedir as homedir3 } from "node:os";
392
- import { join as join4 } from "node:path";
399
+ import { dirname as dirname2, join as join4 } from "node:path";
400
+ import { fileURLToPath } from "node:url";
401
+ function getAdapterCommandsDir() {
402
+ const thisDir = dirname2(fileURLToPath(import.meta.url));
403
+ return join4(thisDir, "commands");
404
+ }
393
405
  var INSTRUCTION_REFERENCES, ClaudeCodeInstallProvider;
394
406
  var init_install = __esm({
395
407
  "packages/adapters/src/providers/claude-code/install.ts"() {
@@ -411,6 +423,10 @@ var init_install = __esm({
411
423
  if (instructionFileUpdated) {
412
424
  details.instructionFile = join4(projectDir, "CLAUDE.md");
413
425
  }
426
+ const commandsInstalled = this.installCommands(projectDir);
427
+ if (commandsInstalled.length > 0) {
428
+ details.commands = commandsInstalled;
429
+ }
414
430
  const pluginResult = this.registerPlugin();
415
431
  if (pluginResult) {
416
432
  details.plugin = pluginResult;
@@ -485,6 +501,32 @@ var init_install = __esm({
485
501
  writeFileSync2(claudeMdPath, content, "utf-8");
486
502
  return true;
487
503
  }
504
+ /**
505
+ * Install Claude Code-specific commands to .claude/commands/ in the project.
506
+ *
507
+ * These commands extend CLEO's provider-neutral skills with Claude Code-specific
508
+ * operational patterns (Agent tool spawn templates, model assignment, context guardrails).
509
+ *
510
+ * @param projectDir - Project root directory
511
+ * @returns Array of installed command filenames
512
+ */
513
+ installCommands(projectDir) {
514
+ const adapterCommandsDir = getAdapterCommandsDir();
515
+ if (!existsSync2(adapterCommandsDir)) {
516
+ return [];
517
+ }
518
+ const targetDir = join4(projectDir, ".claude", "commands");
519
+ mkdirSync(targetDir, { recursive: true });
520
+ const installed = [];
521
+ const files = readdirSync(adapterCommandsDir).filter((f) => f.endsWith(".md"));
522
+ for (const file of files) {
523
+ const src = join4(adapterCommandsDir, file);
524
+ const dest = join4(targetDir, file);
525
+ copyFileSync(src, dest);
526
+ installed.push(file);
527
+ }
528
+ return installed;
529
+ }
488
530
  /**
489
531
  * Register the CLEO brain plugin in ~/.claude/settings.json.
490
532
  *
@@ -3175,12 +3217,12 @@ init_opencode();
3175
3217
 
3176
3218
  // packages/adapters/src/registry.ts
3177
3219
  import { readFileSync as readFileSync9 } from "node:fs";
3178
- import { dirname as dirname2, join as join22, resolve } from "node:path";
3179
- import { fileURLToPath } from "node:url";
3220
+ import { dirname as dirname3, join as join22, resolve } from "node:path";
3221
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
3180
3222
  var PROVIDER_IDS = ["claude-code", "opencode", "cursor"];
3181
3223
  function getProviderManifests() {
3182
3224
  const manifests = [];
3183
- const baseDir = resolve(dirname2(fileURLToPath(import.meta.url)), "providers");
3225
+ const baseDir = resolve(dirname3(fileURLToPath2(import.meta.url)), "providers");
3184
3226
  for (const providerId of PROVIDER_IDS) {
3185
3227
  try {
3186
3228
  const manifestPath = join22(baseDir, providerId, "manifest.json");