@elyracode/coding-agent 0.6.1 → 0.6.2

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.
@@ -1964,6 +1964,11 @@ export class InteractiveMode {
1964
1964
  this.handleHelpCommand();
1965
1965
  return;
1966
1966
  }
1967
+ if (text === "/init") {
1968
+ this.editor.setText("");
1969
+ await this.handleInitCommand();
1970
+ return;
1971
+ }
1967
1972
  if (text === "/settings") {
1968
1973
  this.showSettingsSelector();
1969
1974
  this.editor.setText("");
@@ -3322,6 +3327,64 @@ export class InteractiveMode {
3322
3327
  return { component: selector, focus: selector.getSettingsList() };
3323
3328
  });
3324
3329
  }
3330
+ async handleInitCommand() {
3331
+ const cwd = this.sessionManager.getCwd();
3332
+ const elyraDir = path.join(cwd, ".elyra");
3333
+ if (fs.existsSync(elyraDir)) {
3334
+ this.showStatus(".elyra/ already exists in this project");
3335
+ return;
3336
+ }
3337
+ // Detect stack
3338
+ const stackResult = detectStack(cwd);
3339
+ // Create .elyra/ directory
3340
+ fs.mkdirSync(elyraDir, { recursive: true });
3341
+ // Create AGENTS.md with project context
3342
+ const agentsLines = [
3343
+ "# Project Rules",
3344
+ "",
3345
+ "## Overview",
3346
+ "",
3347
+ "<!-- Describe your project here. The agent reads this on every session. -->",
3348
+ "",
3349
+ ];
3350
+ if (stackResult.summary) {
3351
+ agentsLines.push(`## Stack`, "", stackResult.summary, "");
3352
+ }
3353
+ agentsLines.push("## Conventions", "", "<!-- Add coding conventions, patterns, and preferences here. -->", "");
3354
+ fs.writeFileSync(path.join(elyraDir, "AGENTS.md"), agentsLines.join("\n"), "utf-8");
3355
+ // Create blueprints directory
3356
+ fs.mkdirSync(path.join(elyraDir, "blueprints"), { recursive: true });
3357
+ // Build status message
3358
+ const parts = [];
3359
+ parts.push(theme.bold("Project initialized"));
3360
+ parts.push("");
3361
+ parts.push(` ${theme.fg("success", "Created")} .elyra/AGENTS.md`);
3362
+ parts.push(` ${theme.fg("success", "Created")} .elyra/blueprints/`);
3363
+ // Suggest extensions based on detected stack
3364
+ if (stackResult.stack) {
3365
+ const pkg = getSuggestedPackage(stackResult.stack);
3366
+ parts.push("");
3367
+ parts.push(` ${theme.fg("accent", "Detected:")} ${stackResult.stack} stack`);
3368
+ parts.push(` ${theme.fg("dim", "Install:")} elyra install npm:${pkg}`);
3369
+ }
3370
+ if (stackResult.frameworks.some((f) => f.name === "Filament")) {
3371
+ parts.push(` ${theme.fg("dim", "Install:")} elyra install npm:@elyracode/stack-filament`);
3372
+ }
3373
+ if (stackResult.frameworks.some((f) => f.name === "Laravel AI SDK")) {
3374
+ parts.push(` ${theme.fg("dim", "Install:")} elyra install npm:@elyracode/stack-laravel-ai`);
3375
+ }
3376
+ // Check for Docker
3377
+ if (fs.existsSync(path.join(cwd, "docker-compose.yml")) || fs.existsSync(path.join(cwd, "compose.yml"))) {
3378
+ parts.push(` ${theme.fg("dim", "Install:")} elyra install npm:@elyracode/docker`);
3379
+ }
3380
+ // Always suggest useful general extensions
3381
+ parts.push("");
3382
+ parts.push(theme.fg("dim", "Edit .elyra/AGENTS.md to add project rules and conventions."));
3383
+ parts.push(theme.fg("dim", "Browse all extensions with /ext."));
3384
+ this.chatContainer.addChild(new Spacer(1));
3385
+ this.chatContainer.addChild(new Text(parts.join("\n"), 1, 0));
3386
+ this.ui.requestRender();
3387
+ }
3325
3388
  handleHelpCommand() {
3326
3389
  const help = [
3327
3390
  theme.bold("Elyra"),