@girardmedia/bootspring 2.5.8 → 2.5.9

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/cli/index.js CHANGED
@@ -48530,6 +48530,34 @@ init_src();
48530
48530
  // src/middleware.ts
48531
48531
  init_cjs_shims();
48532
48532
  init_src2();
48533
+ function levenshtein(a, b) {
48534
+ const m = a.length, n = b.length;
48535
+ const dp = Array.from({ length: m + 1 }, () => Array(n + 1).fill(0));
48536
+ for (let i2 = 0; i2 <= m; i2++) dp[i2][0] = i2;
48537
+ for (let j = 0; j <= n; j++) dp[0][j] = j;
48538
+ for (let i2 = 1; i2 <= m; i2++)
48539
+ for (let j = 1; j <= n; j++)
48540
+ dp[i2][j] = Math.min(
48541
+ dp[i2 - 1][j] + 1,
48542
+ dp[i2][j - 1] + 1,
48543
+ dp[i2 - 1][j - 1] + (a[i2 - 1] !== b[j - 1] ? 1 : 0)
48544
+ );
48545
+ return dp[m][n];
48546
+ }
48547
+ function suggestSubcommand(typed, cmd) {
48548
+ const names = cmd.commands.flatMap((c) => [c.name(), ...c.aliases()]);
48549
+ let best = "";
48550
+ let bestDist = Infinity;
48551
+ for (const name of names) {
48552
+ const d = levenshtein(typed.toLowerCase(), name.toLowerCase());
48553
+ if (d < bestDist) {
48554
+ bestDist = d;
48555
+ best = name;
48556
+ }
48557
+ }
48558
+ const threshold = Math.ceil(Math.max(typed.length, best.length) * 0.4);
48559
+ return bestDist <= threshold ? best : null;
48560
+ }
48533
48561
  function applyHealingMiddleware(program3) {
48534
48562
  wrapCommand(program3);
48535
48563
  }
@@ -48539,10 +48567,16 @@ function wrapCommand(cmd) {
48539
48567
  const originalAction = listeners;
48540
48568
  const hasSubcommands = cmd.commands.length > 0;
48541
48569
  cmd._actionHandler = async (...args) => {
48542
- if (hasSubcommands && args.length > 0 && typeof args[0] === "string") {
48543
- console.error(`error: unknown command '${args[0]}'. See 'bootspring ${cmd.name()} --help'.`);
48544
- process.exitCode = 1;
48545
- return;
48570
+ if (hasSubcommands && cmd.args?.length > 0) {
48571
+ const unknownArg = cmd.args[0];
48572
+ if (typeof unknownArg === "string") {
48573
+ const suggestion = suggestSubcommand(unknownArg, cmd);
48574
+ const hint = suggestion ? `
48575
+ (Did you mean ${suggestion}?)` : "";
48576
+ console.error(`error: unknown command '${unknownArg}'${hint}`);
48577
+ process.exitCode = 1;
48578
+ return;
48579
+ }
48546
48580
  }
48547
48581
  const commandName = cmd.name();
48548
48582
  presence_exports.sendHeartbeat({ activity: `bootspring ${commandName}` });
package/dist/core.js CHANGED
@@ -21625,7 +21625,7 @@ var require_package = __commonJS({
21625
21625
  "../../../package.json"(exports2, module2) {
21626
21626
  module2.exports = {
21627
21627
  name: "bootspring-workspace",
21628
- version: "2.5.8",
21628
+ version: "2.5.9",
21629
21629
  private: true,
21630
21630
  description: "Workspace tooling for the Bootspring monorepo",
21631
21631
  keywords: [
@@ -52219,7 +52219,7 @@ var require_package = __commonJS({
52219
52219
  "../../../package.json"(exports2, module2) {
52220
52220
  module2.exports = {
52221
52221
  name: "bootspring-workspace",
52222
- version: "2.5.8",
52222
+ version: "2.5.9",
52223
52223
  private: true,
52224
52224
  description: "Workspace tooling for the Bootspring monorepo",
52225
52225
  keywords: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girardmedia/bootspring",
3
- "version": "2.5.8",
3
+ "version": "2.5.9",
4
4
  "description": "Thin client for Bootspring cloud MCP, hosted agents, and paywalled workflow intelligence",
5
5
  "keywords": [
6
6
  "ai",