bfi-cli 0.1.97 → 0.1.99

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.
@@ -82,7 +82,6 @@ const symbol = (o) => {
82
82
  case "cancel": return styleText("red", S_STEP_CANCEL);
83
83
  case "error": return styleText("yellow", S_STEP_ERROR);
84
84
  case "submit": return styleText("green", S_STEP_SUBMIT);
85
- case "validating": return styleText("dim", S_STEP_ACTIVE);
86
85
  }
87
86
  };
88
87
  const symbolBar = (o) => {
@@ -123,7 +122,7 @@ const limitOptions = ({ cursor: l, options: e, style: w, output: p = process.std
123
122
  d && g++, c && g++;
124
123
  const T = f + (d ? 1 : 0), y = W - (c ? 1 : 0);
125
124
  for (let t = T; t < y; t++) {
126
- const n = e[t], o = n ? w(n, t === l) : "", h = wrapAnsi(o, i, {
125
+ const n = e[t], h = wrapAnsi(n ? w(n, t === l) : "", i, {
127
126
  hard: true,
128
127
  trim: false
129
128
  }).split(`
@@ -142,28 +141,28 @@ const limitOptions = ({ cursor: l, options: e, style: w, output: p = process.std
142
141
  for (const t of s) for (const n of t) x.push(n);
143
142
  return c && x.push(M), x;
144
143
  };
145
- const confirm = (e) => {
146
- const a = e.active ?? "Yes", o = e.inactive ?? "No";
144
+ const confirm = (i) => {
145
+ const a = i.active ?? "Yes", s = i.inactive ?? "No";
147
146
  return new r({
148
147
  active: a,
149
- inactive: o,
150
- signal: e.signal,
151
- input: e.input,
152
- output: e.output,
153
- initialValue: e.initialValue ?? true,
148
+ inactive: s,
149
+ signal: i.signal,
150
+ input: i.input,
151
+ output: i.output,
152
+ initialValue: i.initialValue ?? true,
154
153
  render() {
155
- const i = e.withGuide ?? settings.withGuide, u = `${symbol(this.state)} `, l = i ? `${styleText("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(e.output, e.message, l, u), s = `${i ? `${styleText("gray", S_BAR)}
154
+ const e = i.withGuide ?? settings.withGuide, u = `${symbol(this.state)} `, l = e ? `${styleText("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(i.output, i.message, l, u), o = `${e ? `${styleText("gray", S_BAR)}
156
155
  ` : ""}${f}
157
- `, c = this.value ? a : o;
156
+ `, c = this.value ? a : s;
158
157
  switch (this.state) {
159
- case "submit": return `${s}${i ? `${styleText("gray", S_BAR)} ` : ""}${styleText("dim", c)}`;
160
- case "cancel": return `${s}${i ? `${styleText("gray", S_BAR)} ` : ""}${styleText(["strikethrough", "dim"], c)}${i ? `
158
+ case "submit": return `${o}${e ? `${styleText("gray", S_BAR)} ` : ""}${styleText("dim", c)}`;
159
+ case "cancel": return `${o}${e ? `${styleText("gray", S_BAR)} ` : ""}${styleText(["strikethrough", "dim"], c)}${e ? `
161
160
  ${styleText("gray", S_BAR)}` : ""}`;
162
161
  default: {
163
- const r = i ? `${styleText("cyan", S_BAR)} ` : "", g = i ? styleText("cyan", S_BAR_END) : "";
164
- return `${s}${r}${this.value ? `${styleText("green", S_RADIO_ACTIVE)} ${a}` : `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", a)}`}${e.vertical ? i ? `
162
+ const r = e ? `${styleText("cyan", S_BAR)} ` : "", g = e ? styleText("cyan", S_BAR_END) : "";
163
+ return `${o}${r}${this.value ? `${styleText("green", S_RADIO_ACTIVE)} ${a}` : `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", a)}`}${i.vertical ? e ? `
165
164
  ${styleText("cyan", S_BAR)} ` : `
166
- ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", o)}` : `${styleText("green", S_RADIO_ACTIVE)} ${o}`}
165
+ ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", s)}` : `${styleText("green", S_RADIO_ACTIVE)} ${s}`}
167
166
  ${g}
168
167
  `;
169
168
  }
@@ -183,7 +182,7 @@ const multiselect = (i) => {
183
182
  const u = (t, a) => {
184
183
  const r = t.label ?? String(t.value);
185
184
  return a === "disabled" ? `${styleText("gray", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText(["strikethrough", "gray"], o))}${t.hint ? ` ${styleText("dim", `(${t.hint ?? "disabled"})`)}` : ""}` : a === "active" ? `${styleText("cyan", S_CHECKBOX_ACTIVE)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${m(r, (o) => styleText("dim", o))}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "cancelled" ? `${m(r, (o) => styleText(["strikethrough", "dim"], o))}` : a === "active-selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "submitted" ? `${m(r, (o) => styleText("dim", o))}` : `${styleText("dim", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText("dim", o))}`;
186
- }, d = i.required ?? true, x = i.showInstructions ?? true;
185
+ }, d = i.required ?? true, v = i.showInstructions ?? true;
187
186
  return new a({
188
187
  options: i.options,
189
188
  signal: i.signal,
@@ -203,7 +202,7 @@ ${styleText("reset", styleText("dim", `Press ${styleText([
203
202
  render() {
204
203
  const t = i.withGuide ?? settings.withGuide, a = wrapTextWithPrefix(i.output, i.message, t ? `${symbolBar(this.state)} ` : "", `${symbol(this.state)} `), r = `${t ? `${styleText("gray", S_BAR)}
205
204
  ` : ""}${a}
206
- `, o = this.value ?? [], g = (n, l) => {
205
+ `, o = this.value ?? [], p = (n, l) => {
207
206
  if (n.disabled) return u(n, "disabled");
208
207
  const s = o.includes(n.value);
209
208
  return l && s ? u(n, "active-selected") : s ? u(n, "selected") : u(n, l ? "active" : "inactive");
@@ -221,7 +220,7 @@ ${styleText("gray", S_BAR)}` : ""}`;
221
220
  }
222
221
  case "error": {
223
222
  const n = t ? `${styleText("yellow", S_BAR)} ` : "", l = this.error.split(`
224
- `).map(($, v) => v === 0 ? `${t ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", $)}` : ` ${$}`).join(`
223
+ `).map(($, C) => C === 0 ? `${t ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", $)}` : ` ${$}`).join(`
225
224
  `), s = r.split(`
226
225
  `).length, h = l.split(`
227
226
  `).length + 1;
@@ -232,7 +231,7 @@ ${styleText("gray", S_BAR)}` : ""}`;
232
231
  maxItems: i.maxItems,
233
232
  columnPadding: n.length,
234
233
  rowPadding: s + h,
235
- style: g
234
+ style: p
236
235
  }).join(`
237
236
  ${n}`)}
238
237
  ${l}
@@ -240,7 +239,7 @@ ${l}
240
239
  }
241
240
  default: {
242
241
  const n = t ? `${styleText("cyan", S_BAR)} ` : "", l = r.split(`
243
- `).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t) : t ? [styleText("cyan", S_BAR_END)] : [], h = s.join(`
242
+ `).length, s = v ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t) : t ? [styleText("cyan", S_BAR_END)] : [], h = s.join(`
244
243
  `), $ = s.length + 1;
245
244
  return `${r}${n}${limitOptions({
246
245
  output: i.output,
@@ -249,7 +248,7 @@ ${l}
249
248
  maxItems: i.maxItems,
250
249
  columnPadding: n.length,
251
250
  rowPadding: l + $,
252
- style: g
251
+ style: p
253
252
  }).join(`
254
253
  ${n}`)}
255
254
  ${h}
@@ -260,25 +259,25 @@ ${h}
260
259
  }).prompt();
261
260
  };
262
261
  const groupMultiselect = (o) => {
263
- const { selectableGroups: f = true, groupSpacing: x = 0 } = o, d = (n, l, p = []) => {
264
- const a = n.label ?? String(n.value), t = typeof n.group == "string", s = t && (p[p.indexOf(n) + 1] ?? { group: true }), u = t && s && s.group === true;
262
+ const { selectableGroups: h = true, groupSpacing: x = 0 } = o, m = (n, l, g = []) => {
263
+ const a = n.label ?? String(n.value), t = typeof n.group == "string", s = t && (g[g.indexOf(n) + 1] ?? { group: true }), u = t && s && s.group === true;
265
264
  let r = "", c = "";
266
- t && (f ? (r = u ? `${S_BAR_END} ` : `${S_BAR} `, c = u ? " " : `${S_BAR} `) : r = " ");
265
+ t && (h ? (r = u ? `${S_BAR_END} ` : `${S_BAR} `, c = u ? " " : `${S_BAR} `) : r = " ");
267
266
  let i = "";
268
267
  if (x > 0 && !t && (i = `
269
268
  `.repeat(x)), l === "active") return wrapTextWithPrefix(o.output, `${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`, `${i}${styleText("dim", r)} `, `${i}${styleText("dim", r)}${styleText("cyan", S_CHECKBOX_ACTIVE)} `, `${i}${styleText("dim", c)} `);
270
- if (l === "group-active") return wrapTextWithPrefix(o.output, a, `${i}${r} `, `${i}${r}${styleText("cyan", S_CHECKBOX_ACTIVE)} `, `${i}${c} `, (m) => styleText("dim", m));
271
- if (l === "group-active-selected") return wrapTextWithPrefix(o.output, a, `${i}${r} `, `${i}${r}${styleText("green", S_CHECKBOX_SELECTED)} `, `${i}${c} `, (m) => styleText("dim", m));
269
+ if (l === "group-active") return wrapTextWithPrefix(o.output, a, `${i}${r} `, `${i}${r}${styleText("cyan", S_CHECKBOX_ACTIVE)} `, `${i}${c} `, (d) => styleText("dim", d));
270
+ if (l === "group-active-selected") return wrapTextWithPrefix(o.output, a, `${i}${r} `, `${i}${r}${styleText("green", S_CHECKBOX_SELECTED)} `, `${i}${c} `, (d) => styleText("dim", d));
272
271
  if (l === "selected") {
273
- const m = t || f ? styleText("green", S_CHECKBOX_SELECTED) : "";
274
- return wrapTextWithPrefix(o.output, `${a}${n.hint ? ` (${n.hint})` : ""}`, `${i}${styleText("dim", r)} `, `${i}${styleText("dim", r)}${m} `, `${i}${styleText("dim", c)} `, (I) => styleText("dim", I));
272
+ const d = t || h ? styleText("green", S_CHECKBOX_SELECTED) : "";
273
+ return wrapTextWithPrefix(o.output, `${a}${n.hint ? ` (${n.hint})` : ""}`, `${i}${styleText("dim", r)} `, `${i}${styleText("dim", r)}${d} `, `${i}${styleText("dim", c)} `, (S) => styleText("dim", S));
275
274
  }
276
275
  if (l === "cancelled") return `${styleText(["strikethrough", "dim"], a)}`;
277
276
  if (l === "active-selected") return wrapTextWithPrefix(o.output, `${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`, `${i}${styleText("dim", r)} `, `${i}${styleText("dim", r)}${styleText("green", S_CHECKBOX_SELECTED)} `, `${i}${styleText("dim", c)} `);
278
277
  if (l === "submitted") return `${styleText("dim", a)}`;
279
- const h = t || f ? styleText("dim", S_CHECKBOX_INACTIVE) : "";
280
- return wrapTextWithPrefix(o.output, a, `${i}${styleText("dim", r)} `, `${i}${styleText("dim", r)}${h} `, `${i}${styleText("dim", c)} `, (m) => styleText("dim", m));
281
- }, y = o.required ?? true, S = o.showInstructions ?? true;
278
+ const f = t || h ? styleText("dim", S_CHECKBOX_INACTIVE) : "";
279
+ return wrapTextWithPrefix(o.output, a, `${i}${styleText("dim", r)} `, `${i}${styleText("dim", r)}${f} `, `${i}${styleText("dim", c)} `, (d) => styleText("dim", d));
280
+ }, y = o.required ?? true, I = o.showInstructions ?? true;
282
281
  return new u$2({
283
282
  options: o.options,
284
283
  signal: o.signal,
@@ -287,7 +286,7 @@ const groupMultiselect = (o) => {
287
286
  initialValues: o.initialValues,
288
287
  required: y,
289
288
  cursorAt: o.cursorAt,
290
- selectableGroups: f,
289
+ selectableGroups: h,
291
290
  validate(n) {
292
291
  if (y && (n === void 0 || n.length === 0)) return `Please select at least one option.
293
292
  ${styleText("reset", styleText("dim", `Press ${styleText([
@@ -299,23 +298,23 @@ ${styleText("reset", styleText("dim", `Press ${styleText([
299
298
  render() {
300
299
  const n = o.withGuide ?? settings.withGuide, l = `${n ? `${styleText("gray", S_BAR)}
301
300
  ` : ""}${symbol(this.state)} ${o.message}
302
- `, p = this.value ?? [], a = (t, s) => {
303
- const u = this.options, r = p.includes(t.value) || t.group === true && this.isGroupSelected(`${t.value}`);
304
- return !s && typeof t.group == "string" && this.options[this.cursor]?.value === t.group ? d(t, r ? "group-active-selected" : "group-active", u) : s && r ? d(t, "active-selected", u) : r ? d(t, "selected", u) : d(t, s ? "active" : "inactive", u);
301
+ `, g = this.value ?? [], a = (t, s) => {
302
+ const u = this.options, r = g.includes(t.value) || t.group === true && this.isGroupSelected(`${t.value}`);
303
+ return !s && typeof t.group == "string" && this.options[this.cursor]?.value === t.group ? m(t, r ? "group-active-selected" : "group-active", u) : s && r ? m(t, "active-selected", u) : r ? m(t, "selected", u) : m(t, s ? "active" : "inactive", u);
305
304
  };
306
305
  switch (this.state) {
307
306
  case "submit": {
308
- const t = this.options.filter(({ value: u }) => p.includes(u)).map((u) => d(u, "submitted")), s = t.length === 0 ? "" : ` ${t.join(styleText("dim", ", "))}`;
307
+ const t = this.options.filter(({ value: u }) => g.includes(u)).map((u) => m(u, "submitted")), s = t.length === 0 ? "" : ` ${t.join(styleText("dim", ", "))}`;
309
308
  return `${l}${n ? styleText("gray", S_BAR) : ""}${s}`;
310
309
  }
311
310
  case "cancel": {
312
- const t = this.options.filter(({ value: s }) => p.includes(s)).map((s) => d(s, "cancelled")).join(styleText("dim", ", "));
311
+ const t = this.options.filter(({ value: s }) => g.includes(s)).map((s) => m(s, "cancelled")).join(styleText("dim", ", "));
313
312
  return `${l}${n ? `${styleText("gray", S_BAR)} ` : ""}${t.trim() ? `${t}${n ? `
314
313
  ${styleText("gray", S_BAR)}` : ""}` : ""}`;
315
314
  }
316
315
  case "error": {
317
316
  const t = n ? `${styleText("yellow", S_BAR)} ` : "", s = this.error.split(`
318
- `).map((i, h) => h === 0 ? `${n ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", i)}` : ` ${i}`).join(`
317
+ `).map((i, f) => f === 0 ? `${n ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", i)}` : ` ${i}`).join(`
319
318
  `), u = l.split(`
320
319
  `).length, r = s.split(`
321
320
  `).length + 1;
@@ -334,7 +333,7 @@ ${s}
334
333
  }
335
334
  default: {
336
335
  const t = n ? `${styleText("cyan", S_BAR)} ` : "", s = l.split(`
337
- `).length, u = S ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], r = u.join(`
336
+ `).length, u = I ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], r = u.join(`
338
337
  `), c = u.length + 1;
339
338
  return `${l}${t}${limitOptions({
340
339
  output: o.output,
@@ -426,8 +425,8 @@ const C = (o, e, s) => {
426
425
  hard: true,
427
426
  trim: false
428
427
  }, i = wrapAnsi(o, e, a).split(`
429
- `), c = i.reduce((n, t) => Math.max(fastStringWidth(t), n), 0), g = e - (i.map(s).reduce((n, t) => Math.max(fastStringWidth(t), n), 0) - c);
430
- return wrapAnsi(o, g, a);
428
+ `), c = i.reduce((n, t) => Math.max(fastStringWidth(t), n), 0);
429
+ return wrapAnsi(o, e - (i.map(s).reduce((n, t) => Math.max(fastStringWidth(t), n), 0) - c), a);
431
430
  };
432
431
  const note = (o = "", e = "", s) => {
433
432
  const a = s?.output ?? process$1.stdout, i = s?.withGuide ?? settings.withGuide, c = s?.format ?? W$1, g = [
@@ -562,19 +561,19 @@ ${styleText("gray", S_BAR)}` : ""}`;
562
561
  }
563
562
  default: {
564
563
  const r = n ? `${styleText("cyan", S_BAR)} ` : "", a = u.split(`
565
- `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], f = p.join(`
566
- `), b = p.length + 1;
564
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], b = p.join(`
565
+ `), f = p.length + 1;
567
566
  return `${u}${r}${limitOptions({
568
567
  output: t.output,
569
568
  cursor: this.cursor,
570
569
  options: this.options,
571
570
  maxItems: t.maxItems,
572
571
  columnPadding: r.length,
573
- rowPadding: a + b,
572
+ rowPadding: a + f,
574
573
  style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
575
574
  }).join(`
576
575
  ${r}`)}
577
- ${f}
576
+ ${b}
578
577
  `;
579
578
  }
580
579
  }
@@ -173,16 +173,15 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports, module) => {
173
173
  let templateIndex = 0;
174
174
  let starIndex = -1;
175
175
  let matchIndex = 0;
176
- while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
177
- if (template[templateIndex] === "*") {
178
- starIndex = templateIndex;
179
- matchIndex = searchIndex;
180
- templateIndex++;
181
- } else {
182
- searchIndex++;
183
- templateIndex++;
184
- }
185
- } else if (starIndex !== -1) {
176
+ while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) if (template[templateIndex] === "*") {
177
+ starIndex = templateIndex;
178
+ matchIndex = searchIndex;
179
+ templateIndex++;
180
+ } else {
181
+ searchIndex++;
182
+ templateIndex++;
183
+ }
184
+ else if (starIndex !== -1) {
186
185
  templateIndex = starIndex + 1;
187
186
  matchIndex++;
188
187
  searchIndex = matchIndex;
@@ -3404,10 +3404,8 @@ function isBadArgument(arg) {
3404
3404
  }
3405
3405
  function toBinaryConfig(input, allowUnsafe) {
3406
3406
  if (input.length < 1 || input.length > 2) throw new GitPluginError(void 0, "binary", WRONG_NUMBER_ERR);
3407
- if (input.some(isBadArgument)) {
3408
- if (allowUnsafe) console.warn(WRONG_CHARS_ERR);
3409
- else throw new GitPluginError(void 0, "binary", WRONG_CHARS_ERR);
3410
- }
3407
+ if (input.some(isBadArgument)) if (allowUnsafe) console.warn(WRONG_CHARS_ERR);
3408
+ else throw new GitPluginError(void 0, "binary", WRONG_CHARS_ERR);
3411
3409
  const [binary, prefix] = input;
3412
3410
  return {
3413
3411
  binary,
@@ -25,7 +25,7 @@ var __copyProps = (to, from, except, desc) => {
25
25
  }
26
26
  return to;
27
27
  };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
29
  value: mod,
30
30
  enumerable: true
31
31
  }) : target, mod));
@@ -127,8 +127,7 @@ async function readSkillLock() {
127
127
  async function writeSkillLock(lock) {
128
128
  const lockPath = getSkillLockPath();
129
129
  await mkdir(dirname(lockPath), { recursive: true });
130
- const content = JSON.stringify(lock, null, 2);
131
- await writeFile(lockPath, content, "utf-8");
130
+ await writeFile(lockPath, JSON.stringify(lock, null, 2), "utf-8");
132
131
  }
133
132
  let _ghWarningShown = false;
134
133
  function getGitHubToken() {
@@ -221,8 +220,7 @@ async function writeLocalLock(lock, cwd) {
221
220
  version: lock.version,
222
221
  skills: sortedSkills
223
222
  };
224
- const content = JSON.stringify(sorted, null, 2) + "\n";
225
- await writeFile(lockPath, content, "utf-8");
223
+ await writeFile(lockPath, JSON.stringify(sorted, null, 2) + "\n", "utf-8");
226
224
  }
227
225
  async function computeSkillFolderHash(skillDir) {
228
226
  const files = [];
@@ -310,8 +308,7 @@ function shouldInstallInternalSkills() {
310
308
  }
311
309
  async function hasSkillMd(dir) {
312
310
  try {
313
- const skillPath = join(dir, "SKILL.md");
314
- return (await stat(skillPath)).isFile();
311
+ return (await stat(join(dir, "SKILL.md"))).isFile();
315
312
  } catch {
316
313
  return false;
317
314
  }
package/dist/cli.d.mts CHANGED
@@ -1 +1 @@
1
- export {}
1
+ export { };