@noir-ai/cli 1.9.0 → 1.9.1

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/bin.js CHANGED
@@ -1466,7 +1466,7 @@ async function home(opts, deps) {
1466
1466
  await deps.dispatch(["status"]);
1467
1467
  }
1468
1468
  async function pickSection(clack, sections, opts) {
1469
- const result = await clack.selectKey({
1469
+ const result = await clack.select({
1470
1470
  message: "What would you like to do?",
1471
1471
  options: [
1472
1472
  ...sections.map((s) => ({
@@ -1517,7 +1517,8 @@ async function collectArg(clack, action, opts) {
1517
1517
  if (!action.needsArg) return null;
1518
1518
  const value = await clack.text({
1519
1519
  message: action.needsArg.prompt,
1520
- placeholder: action.needsArg.placeholder
1520
+ placeholder: action.needsArg.placeholder,
1521
+ validate: (v) => !v || v.trim().length === 0 ? "Please enter a value." : void 0
1521
1522
  });
1522
1523
  if (clack.isCancel(value)) {
1523
1524
  clack.cancel("Cancelled.");
@@ -1535,7 +1536,8 @@ async function argvForAction(clack, action, opts) {
1535
1536
  }
1536
1537
  if (action.destructive || isDestructive(argv)) {
1537
1538
  const confirmed = await clack.confirm({
1538
- message: `Run \`noir ${argv.join(" ")}\`? This may modify project files / the store.`
1539
+ message: `Run \`noir ${argv.join(" ")}\`? This may modify project files / the store.`,
1540
+ initialValue: false
1539
1541
  });
1540
1542
  if (clack.isCancel(confirmed) || !confirmed) return null;
1541
1543
  }
@@ -1765,7 +1767,7 @@ async function resolveContent(opts) {
1765
1767
  const value = await clack.text({
1766
1768
  message: "Memory to save:",
1767
1769
  placeholder: "the insight / decision / pattern to remember",
1768
- validate: (v) => v.trim().length === 0 ? "content cannot be empty" : void 0
1770
+ validate: (v) => !v || v.trim().length === 0 ? "content cannot be empty" : void 0
1769
1771
  });
1770
1772
  if (clack.isCancel(value)) {
1771
1773
  clack.cancel("Cancelled.");