@sonnechasser/ntrp 1.5.1 → 1.5.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.
package/dist/index.js CHANGED
@@ -9438,6 +9438,8 @@ var init_repl_globals = __esm({
9438
9438
  var prompts_exports = {};
9439
9439
  __export(prompts_exports, {
9440
9440
  createPromptSession: () => createPromptSession,
9441
+ formatConfirmDefaultHint: () => formatConfirmDefaultHint,
9442
+ formatEnterDefaultHint: () => formatEnterDefaultHint,
9441
9443
  presentRecommendedFirst: () => presentRecommendedFirst,
9442
9444
  presentRecommendedMultiFirst: () => presentRecommendedMultiFirst,
9443
9445
  resolveAskMultiInput: () => resolveAskMultiInput,
@@ -9458,17 +9460,29 @@ function secretPromptLine(question) {
9458
9460
  function stripTerminalArtifacts(input) {
9459
9461
  return input.replace(/\x1b\[[0-9;]*[a-zA-Z~]/g, "").replace(/\x1b\][^\x07]*(\x07|\x1b\\)/g, "").replace(/\x1b\[200~/g, "").replace(/\x1b\[201~/g, "");
9460
9462
  }
9463
+ function formatEnterDefaultHint(defaultValue) {
9464
+ const lower = defaultValue.trim().toLowerCase();
9465
+ if (lower === "y" || lower === "yes") return "\u23CE yes";
9466
+ if (lower === "n" || lower === "no") return "\u23CE no";
9467
+ return defaultValue;
9468
+ }
9469
+ function formatConfirmDefaultHint(defaultYes = true) {
9470
+ return formatEnterDefaultHint(defaultYes ? "yes" : "no");
9471
+ }
9461
9472
  function renderQuestion(question, defaultValue) {
9462
9473
  const base = ` ${marker()}${bold(question)}`;
9463
9474
  if (defaultValue !== void 0 && defaultValue !== "") {
9464
- return `${base} ${chalk4.dim(`[${defaultValue}]`)} `;
9475
+ return `${base} ${chalk4.dim(`[${formatEnterDefaultHint(defaultValue)}]`)} `;
9465
9476
  }
9466
9477
  return `${base} `;
9467
9478
  }
9468
9479
  function resolveConfirmInput(raw, defaultYes = true) {
9469
9480
  const answer = raw.trim().toLowerCase();
9470
9481
  if (!answer) return defaultYes;
9471
- return answer === "y" || answer === "yes";
9482
+ if (answer === "y" || answer === "yes" || answer === "yeah" || answer === "yep") {
9483
+ return true;
9484
+ }
9485
+ return false;
9472
9486
  }
9473
9487
  function presentRecommendedFirst(choices, recommended) {
9474
9488
  if (choices.length === 0) return [];
@@ -9543,8 +9557,7 @@ function createPromptSession(existing, ctx) {
9543
9557
  }
9544
9558
  }
9545
9559
  async function confirm(question, defaultYes = true) {
9546
- const hint = defaultYes ? "Y/n" : "y/N";
9547
- const raw = (await rl.question(renderQuestion(question, hint))).trim();
9560
+ const raw = (await rl.question(renderQuestion(question, defaultYes ? "yes" : "no"))).trim();
9548
9561
  assertNotGlobalReplCommand(raw);
9549
9562
  return resolveConfirmInput(raw, defaultYes);
9550
9563
  }
@@ -12346,6 +12359,8 @@ var init_guide_slides = __esm({
12346
12359
  lines: [
12347
12360
  `We designed the conversation so you don't need a slash to start. Type the question you actually need \u2014 "is our retention real for the board?" or "pipeline health" \u2014 and NTRP restates it as a scope card so you can confirm we're answering the right thing.`,
12348
12361
  "",
12362
+ "Same navigational toolkit everywhere: when yes is the default, bare Enter accepts it (\u23CE yes on scope and strategy cards; \u23CE yes on wizard confirms). Type something else \u2014 b/back, adjust, n, or a restated focus \u2014 for another path.",
12363
+ "",
12349
12364
  "Hit Enter by accident on \u23CE yes? Type b or back \u2014 that rewinds to the focus card. The same word leaves a strategy or think overlay. It does not unload demo data or undo compute; /scratch or a new session is the blunt reset.",
12350
12365
  "",
12351
12366
  "Empty dataset? Load a sample with \u23CE use demo data, paste a CSV path, or /ingest. When the gap card says the formulas can compute, \u23CE go ahead runs the local math.",
@@ -25929,18 +25944,22 @@ async function reviewLoop(session, initial) {
25929
25944
  let candidate = initial;
25930
25945
  for (; ; ) {
25931
25946
  renderProfile(candidate);
25932
- const action = (await session.ask("Is this profile correct? Type Y, edit, or redraft", { default: "Y" })).toLowerCase();
25933
- if (action === "y" || action === "yes" || action === "") break;
25947
+ const action = await session.choose(
25948
+ "Is this profile correct?",
25949
+ [
25950
+ { value: "yes", label: "Yes \u2014 save this profile" },
25951
+ { value: "edit", label: "Edit fields" },
25952
+ { value: "redraft", label: "Redraft from scratch" }
25953
+ ],
25954
+ { default: "yes" }
25955
+ );
25956
+ if (action === "yes") break;
25934
25957
  if (action === "redraft") {
25935
25958
  const fresh = await fillMissingFields(session, { company_url: candidate.company_url }, null);
25936
25959
  candidate = applyDraft(candidate, fresh);
25937
25960
  continue;
25938
25961
  }
25939
- if (action === "edit" || action === "e") {
25940
- candidate = await editLoop(session, candidate);
25941
- continue;
25942
- }
25943
- console.log(" " + chalk25.red(`Unknown choice: ${action}. Type Y, edit, or redraft.`));
25962
+ candidate = await editLoop(session, candidate);
25944
25963
  }
25945
25964
  return candidate;
25946
25965
  }
@@ -26760,7 +26779,7 @@ async function pickUp(idArg, ctx) {
26760
26779
  if (session.strategist && session.strategist.step !== "awaiting_analysis") {
26761
26780
  const objective = session.strategist.objective;
26762
26781
  console.log(
26763
- " " + chalk28.yellow("Resuming mid-strategy") + (objective ? chalk28.dim(`: "${objective}"`) : "") + chalk28.dim(" \u2014 say ") + chalk28.cyan("yes") + chalk28.dim(" to continue or ") + chalk28.cyan("cancel") + chalk28.dim(" to drop it.")
26782
+ " " + chalk28.yellow("Resuming mid-strategy") + (objective ? chalk28.dim(`: "${objective}"`) : "") + chalk28.dim(" \u2014 Confirm? ") + chalk28.cyan("\u23CE yes") + chalk28.dim(" \xB7 ") + chalk28.cyan("cancel") + chalk28.dim(" to drop it.")
26764
26783
  );
26765
26784
  }
26766
26785
  if (session.think && session.think.step === "active") {
@@ -30449,7 +30468,7 @@ async function handleStrategizeFlow(input, ctx) {
30449
30468
  " " + chalk37.dim("That looks like a question. A strategy objective is waiting.")
30450
30469
  );
30451
30470
  console.log(
30452
- " " + chalk37.dim("Type ") + chalk37.cyan("yes") + chalk37.dim(" to make the plan. Type ") + chalk37.cyan("b") + chalk37.dim(" / ") + chalk37.cyan("adjust") + chalk37.dim(" to change the objective. Type ") + chalk37.cyan("cancel") + chalk37.dim(" to answer questions first.")
30471
+ " " + chalk37.dim("Confirm? ") + chalk37.cyan("\u23CE yes") + chalk37.dim(" \xB7 ") + chalk37.cyan("b back") + chalk37.dim(" / ") + chalk37.cyan("adjust") + chalk37.dim(" \xB7 ") + chalk37.cyan("cancel") + chalk37.dim(" to answer questions first.")
30453
30472
  );
30454
30473
  console.log();
30455
30474
  return "Awaiting confirm";
@@ -30462,7 +30481,7 @@ async function handleStrategizeFlow(input, ctx) {
30462
30481
  }
30463
30482
  console.log();
30464
30483
  console.log(
30465
- " " + chalk37.dim("Type ") + chalk37.cyan("yes") + chalk37.dim(" to make the plan. Type ") + chalk37.cyan("b") + chalk37.dim(" / ") + chalk37.cyan("adjust") + chalk37.dim(" to change the objective. Type ") + chalk37.cyan("cancel") + chalk37.dim(" to stop.")
30484
+ " " + chalk37.dim("Confirm? ") + chalk37.cyan("\u23CE yes") + chalk37.dim(" \xB7 ") + chalk37.cyan("b back") + chalk37.dim(" / ") + chalk37.cyan("adjust") + chalk37.dim(" \xB7 ") + chalk37.cyan("cancel")
30466
30485
  );
30467
30486
  console.log();
30468
30487
  return "Awaiting confirm";
@@ -37582,7 +37601,7 @@ hidden: true
37582
37601
  ---
37583
37602
 
37584
37603
  Mark every in-progress session as ended. Transcripts and dataset files stay.
37585
- Interactive ntrp only. Confirm with y/N, or pass \`--confirm\` in one-shot.`
37604
+ Interactive ntrp only. Confirm with \u23CE no (type yes to proceed), or pass \`--confirm\` in one-shot.`
37586
37605
  },
37587
37606
  {
37588
37607
  name: "deactivate-demo",
@@ -39456,9 +39475,37 @@ async function conversationRouter(input, ctx) {
39456
39475
  const line = input.trim();
39457
39476
  if (!line) return { handled: true };
39458
39477
  if (FRESH_START_RE.test(line)) {
39478
+ if (ctx.rl) {
39479
+ const { createPromptSession: createPromptSession2 } = await Promise.resolve().then(() => (init_prompts(), prompts_exports));
39480
+ const prompts = createPromptSession2(ctx.rl, ctx);
39481
+ let ok = false;
39482
+ try {
39483
+ ok = await prompts.confirm(
39484
+ "Start a fresh analysis? Prior sessions stay saved.",
39485
+ true
39486
+ );
39487
+ } finally {
39488
+ prompts.close();
39489
+ }
39490
+ if (!ok) {
39491
+ console.log();
39492
+ console.log(
39493
+ " " + chalk84.dim("Staying on this session. Type ") + chalk84.cyan("/home") + chalk84.dim(" for the dashboard.")
39494
+ );
39495
+ console.log();
39496
+ return { handled: true };
39497
+ }
39498
+ recordMessage(ctx, "user", line);
39499
+ const { handler: handler51 } = await Promise.resolve().then(() => (init_new(), new_exports));
39500
+ const summary = await handler51([], ctx);
39501
+ return {
39502
+ handled: true,
39503
+ summary: typeof summary === "string" ? summary : "New analysis"
39504
+ };
39505
+ }
39459
39506
  console.log();
39460
39507
  console.log(
39461
- " " + chalk84.dim("Start a fresh analysis? This keeps prior sessions \u2014 say ") + chalk84.cyan("yes") + chalk84.dim(" to confirm or ") + chalk84.cyan("/home") + chalk84.dim(" for the dashboard.")
39508
+ " " + chalk84.dim("Start a fresh analysis with ") + chalk84.cyan("/new") + chalk84.dim(" \u2014 or ") + chalk84.cyan("/home") + chalk84.dim(" for the dashboard.")
39462
39509
  );
39463
39510
  console.log();
39464
39511
  return { handled: true };
@@ -40750,7 +40797,14 @@ function printHelp() {
40750
40797
  console.log();
40751
40798
  console.log(" " + sectionHeading("Keys"));
40752
40799
  console.log(
40753
- " " + paint("accent", "\u23CE") + chalk88.dim(" Runs the armed action shown at the prompt (yes, use demo data, go ahead, /connect).")
40800
+ " " + paint("accent", "\u23CE") + chalk88.dim(
40801
+ " Accepts the default. At the main prompt it runs the armed action (yes, use demo data, go ahead, /connect)."
40802
+ )
40803
+ );
40804
+ console.log(
40805
+ " " + chalk88.dim(
40806
+ " On yes/no questions and menus it accepts yes (or the recommended option). Type something else to decline or pick another path."
40807
+ )
40754
40808
  );
40755
40809
  console.log(
40756
40810
  " " + paint("accent", "b") + chalk88.dim(" / ") + paint("accent", "back") + chalk88.dim(" Steps back one confirm gate, or leaves a modal. Does not unload data or undo compute.")
@@ -10379,7 +10379,7 @@ hidden: true
10379
10379
  ---
10380
10380
 
10381
10381
  Mark every in-progress session as ended. Transcripts and dataset files stay.
10382
- Interactive ntrp only. Confirm with y/N, or pass \`--confirm\` in one-shot.`
10382
+ Interactive ntrp only. Confirm with \u23CE no (type yes to proceed), or pass \`--confirm\` in one-shot.`
10383
10383
  },
10384
10384
  {
10385
10385
  name: "deactivate-demo",
@@ -13812,6 +13812,8 @@ var init_repl_globals = __esm({
13812
13812
  var prompts_exports = {};
13813
13813
  __export(prompts_exports, {
13814
13814
  createPromptSession: () => createPromptSession,
13815
+ formatConfirmDefaultHint: () => formatConfirmDefaultHint,
13816
+ formatEnterDefaultHint: () => formatEnterDefaultHint,
13815
13817
  presentRecommendedFirst: () => presentRecommendedFirst,
13816
13818
  presentRecommendedMultiFirst: () => presentRecommendedMultiFirst,
13817
13819
  resolveAskMultiInput: () => resolveAskMultiInput,
@@ -13832,17 +13834,29 @@ function secretPromptLine(question) {
13832
13834
  function stripTerminalArtifacts(input) {
13833
13835
  return input.replace(/\x1b\[[0-9;]*[a-zA-Z~]/g, "").replace(/\x1b\][^\x07]*(\x07|\x1b\\)/g, "").replace(/\x1b\[200~/g, "").replace(/\x1b\[201~/g, "");
13834
13836
  }
13837
+ function formatEnterDefaultHint(defaultValue) {
13838
+ const lower = defaultValue.trim().toLowerCase();
13839
+ if (lower === "y" || lower === "yes") return "\u23CE yes";
13840
+ if (lower === "n" || lower === "no") return "\u23CE no";
13841
+ return defaultValue;
13842
+ }
13843
+ function formatConfirmDefaultHint(defaultYes = true) {
13844
+ return formatEnterDefaultHint(defaultYes ? "yes" : "no");
13845
+ }
13835
13846
  function renderQuestion(question, defaultValue) {
13836
13847
  const base = ` ${marker()}${bold(question)}`;
13837
13848
  if (defaultValue !== void 0 && defaultValue !== "") {
13838
- return `${base} ${chalk5.dim(`[${defaultValue}]`)} `;
13849
+ return `${base} ${chalk5.dim(`[${formatEnterDefaultHint(defaultValue)}]`)} `;
13839
13850
  }
13840
13851
  return `${base} `;
13841
13852
  }
13842
13853
  function resolveConfirmInput(raw, defaultYes = true) {
13843
13854
  const answer = raw.trim().toLowerCase();
13844
13855
  if (!answer) return defaultYes;
13845
- return answer === "y" || answer === "yes";
13856
+ if (answer === "y" || answer === "yes" || answer === "yeah" || answer === "yep") {
13857
+ return true;
13858
+ }
13859
+ return false;
13846
13860
  }
13847
13861
  function presentRecommendedFirst(choices, recommended) {
13848
13862
  if (choices.length === 0) return [];
@@ -13917,8 +13931,7 @@ function createPromptSession(existing, ctx) {
13917
13931
  }
13918
13932
  }
13919
13933
  async function confirm(question, defaultYes = true) {
13920
- const hint = defaultYes ? "Y/n" : "y/N";
13921
- const raw = (await rl2.question(renderQuestion(question, hint))).trim();
13934
+ const raw = (await rl2.question(renderQuestion(question, defaultYes ? "yes" : "no"))).trim();
13922
13935
  assertNotGlobalReplCommand(raw);
13923
13936
  return resolveConfirmInput(raw, defaultYes);
13924
13937
  }
@@ -18853,7 +18866,7 @@ async function handleStrategizeFlow(input, ctx) {
18853
18866
  " " + chalk17.dim("That looks like a question. A strategy objective is waiting.")
18854
18867
  );
18855
18868
  console.log(
18856
- " " + chalk17.dim("Type ") + chalk17.cyan("yes") + chalk17.dim(" to make the plan. Type ") + chalk17.cyan("b") + chalk17.dim(" / ") + chalk17.cyan("adjust") + chalk17.dim(" to change the objective. Type ") + chalk17.cyan("cancel") + chalk17.dim(" to answer questions first.")
18869
+ " " + chalk17.dim("Confirm? ") + chalk17.cyan("\u23CE yes") + chalk17.dim(" \xB7 ") + chalk17.cyan("b back") + chalk17.dim(" / ") + chalk17.cyan("adjust") + chalk17.dim(" \xB7 ") + chalk17.cyan("cancel") + chalk17.dim(" to answer questions first.")
18857
18870
  );
18858
18871
  console.log();
18859
18872
  return "Awaiting confirm";
@@ -18866,7 +18879,7 @@ async function handleStrategizeFlow(input, ctx) {
18866
18879
  }
18867
18880
  console.log();
18868
18881
  console.log(
18869
- " " + chalk17.dim("Type ") + chalk17.cyan("yes") + chalk17.dim(" to make the plan. Type ") + chalk17.cyan("b") + chalk17.dim(" / ") + chalk17.cyan("adjust") + chalk17.dim(" to change the objective. Type ") + chalk17.cyan("cancel") + chalk17.dim(" to stop.")
18882
+ " " + chalk17.dim("Confirm? ") + chalk17.cyan("\u23CE yes") + chalk17.dim(" \xB7 ") + chalk17.cyan("b back") + chalk17.dim(" / ") + chalk17.cyan("adjust") + chalk17.dim(" \xB7 ") + chalk17.cyan("cancel")
18870
18883
  );
18871
18884
  console.log();
18872
18885
  return "Awaiting confirm";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonnechasser/ntrp",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "GTM Health Diagnostic CLI — local pipeline analysis tool",
5
5
  "homepage": "https://ntrp.sonnechasser.com",
6
6
  "repository": {