@agent-profile/cli 0.3.1 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +42 -10
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -7383,11 +7383,30 @@ function formatWizardClientSelectionQuestion(defaults) {
7383
7383
  return ` ${index + 1}) ${id}${enabled ? " (default)" : ""}`;
7384
7384
  }).join("\n");
7385
7385
  const fallback = defaults.length > 0 ? defaults.join(",") : "none";
7386
- return `Which clients should this profile enable?
7386
+ return `${formatWizardSectionTitle("Choose clients")}
7387
+ Which clients should this profile enable?
7387
7388
  ${summary}
7388
7389
  Select multiple with commas or semicolons, for example 2,3.
7389
7390
  Enter numbers or names, or press enter for defaults [${fallback}]: `;
7390
7391
  }
7392
+ function formatWizardStrategyQuestion(def) {
7393
+ return `${formatWizardSectionTitle("Choose strategy")}
7394
+ How should existing agent instruction files be handled?
7395
+ 1) Preserve existing files${def === "preserve" ? " (default)" : ""}
7396
+ 2) Add generated regions${def === "regions" ? " (default)" : ""}
7397
+ Choose [1/2]: `;
7398
+ }
7399
+ function formatWizardGitignoreQuestion() {
7400
+ return `${formatWizardSectionTitle("Optional .gitignore update")}
7401
+ Add recommended local-runtime ignore entries to .gitignore?`;
7402
+ }
7403
+ function formatWizardWriteConfirmationQuestion() {
7404
+ return `${formatWizardSectionTitle("Choose run mode")}
7405
+ How should this plan run?
7406
+ 1) Dry run preview (default) - write nothing
7407
+ 2) Write files now (--write)
7408
+ Choose [1/2]: `;
7409
+ }
7391
7410
  function recommendStrategy(report) {
7392
7411
  const warnings = [];
7393
7412
  const rootFiles = report.files.filter(
@@ -7445,7 +7464,7 @@ function recommendStrategy(report) {
7445
7464
  function formatWizardIntro(context, recommendation) {
7446
7465
  const lines = [];
7447
7466
  lines.push("Agent Profile Init", "");
7448
- lines.push("Detected:");
7467
+ lines.push(formatWizardSectionTitle("Detected"));
7449
7468
  lines.push(`- languages: ${formatList(context.stack.languages)}`);
7450
7469
  lines.push(
7451
7470
  `- package managers: ${formatList(context.stack.packageManagers)}`
@@ -7465,6 +7484,7 @@ function formatWizardIntro(context, recommendation) {
7465
7484
  lines.push(`- foreign skills/subagents: ${formatList(foreign)}`);
7466
7485
  }
7467
7486
  lines.push("");
7487
+ lines.push(formatWizardSectionTitle("Recommendation"));
7468
7488
  lines.push(`Recommended strategy: ${formatStrategyLabel(recommendation.strategy)}`);
7469
7489
  lines.push(`Reason: ${recommendation.reason}`);
7470
7490
  const conflictRows = context.report.files.filter(
@@ -7488,7 +7508,7 @@ function formatWizardIntro(context, recommendation) {
7488
7508
  }
7489
7509
  function formatWizardPlan(context, outcome) {
7490
7510
  const lines = [];
7491
- lines.push("Write plan:");
7511
+ lines.push(formatWizardSectionTitle("Write plan"));
7492
7512
  if (!context.hasExistingProfile) {
7493
7513
  lines.push("- create ai-profile.yaml");
7494
7514
  } else {
@@ -7546,8 +7566,9 @@ function formatWizardPlan(context, outcome) {
7546
7566
  }
7547
7567
  function formatWizardDeclined() {
7548
7568
  return [
7569
+ "Dry-run selected.",
7549
7570
  "No files written.",
7550
- "Re-run with --write or confirm in the wizard to write.",
7571
+ "Re-run with --write or choose 2 in the wizard to write.",
7551
7572
  ""
7552
7573
  ].join("\n");
7553
7574
  }
@@ -7620,10 +7641,7 @@ function createDefaultPrompts(io) {
7620
7641
  return {
7621
7642
  async selectStrategy({ default: def }) {
7622
7643
  const raw = await ask(
7623
- `How should existing agent instruction files be handled?
7624
- 1) Preserve existing files${def === "preserve" ? " (default)" : ""}
7625
- 2) Add generated regions${def === "regions" ? " (default)" : ""}
7626
- Choose [1/2]: `,
7644
+ formatWizardStrategyQuestion(def),
7627
7645
  def === "preserve" ? "1" : "2"
7628
7646
  );
7629
7647
  if (raw === "2" || raw.toLowerCase().startsWith("r")) return "regions";
@@ -7639,13 +7657,24 @@ Choose [1/2]: `,
7639
7657
  },
7640
7658
  async confirmGitignore({ default: def }) {
7641
7659
  return confirm(
7642
- "Add recommended local-runtime ignore entries to .gitignore?",
7660
+ formatWizardGitignoreQuestion(),
7643
7661
  def
7644
7662
  );
7645
7663
  },
7646
7664
  async confirmWritePlan({ default: def }) {
7647
7665
  try {
7648
- return await confirm("Write this plan?", def);
7666
+ const raw = await ask(
7667
+ formatWizardWriteConfirmationQuestion(),
7668
+ def ? "2" : "1"
7669
+ );
7670
+ const normalized = raw.trim().toLowerCase();
7671
+ if (normalized === "2" || normalized === "write" || normalized === "--write" || normalized === "w" || normalized === "y" || normalized === "yes") {
7672
+ return true;
7673
+ }
7674
+ if (normalized === "1" || normalized === "dry-run" || normalized === "dryrun" || normalized === "dry run" || normalized === "preview" || normalized === "n" || normalized === "no") {
7675
+ return false;
7676
+ }
7677
+ return def;
7649
7678
  } finally {
7650
7679
  rl.close();
7651
7680
  }
@@ -7658,6 +7687,9 @@ function formatList(values) {
7658
7687
  function formatStrategyLabel(strategy) {
7659
7688
  return strategy === "regions" ? "Add generated regions" : "Preserve existing files";
7660
7689
  }
7690
+ function formatWizardSectionTitle(title) {
7691
+ return `== ${title} ==`;
7692
+ }
7661
7693
  function existingRootInstructions(report) {
7662
7694
  return report.files.filter((file) => file.kind === "root-instructions" && file.exists).map((file) => file.path);
7663
7695
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-profile/cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Command-line interface for Agent Profile Compiler.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "@agent-profile/core": "0.2.0",
27
27
  "@agent-profile/doctor": "0.3.0",
28
28
  "@agent-profile/scanner": "0.2.0",
29
- "@agent-profile/web": "0.3.1"
29
+ "@agent-profile/web": "0.3.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "esbuild": "^0.28.0"