@nevescloud/pip 3.5.0 → 3.5.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pip-core.esm.js +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nevescloud/pip",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "Floating assistant bubble + panel + chat runtime. ESM, no build.",
5
5
  "type": "module",
6
6
  "main": "pip-core.esm.js",
package/pip-core.esm.js CHANGED
@@ -2085,12 +2085,17 @@ export function createPip(opts = {}) {
2085
2085
  const slice = value.slice(1);
2086
2086
  const sp = slice.indexOf(" ");
2087
2087
  if (sp === -1) {
2088
- // Command-name mode.
2088
+ // Command-name mode. Sort alphabetically — registration order is
2089
+ // arbitrary and a stable A→Z list is easier to scan than a list that
2090
+ // shifts shape per host. Arg mode is NOT sorted: hosts often return
2091
+ // suggestions in deliberate order (most-likely-next first, context-
2092
+ // aware ranking) and that intent shouldn't be overridden here.
2089
2093
  const prefix = slice.toLowerCase();
2090
2094
  const all = getSlashSource();
2091
2095
  slashCurrent = all
2092
2096
  .filter((s) => s.name.toLowerCase().startsWith(prefix))
2093
- .map((s) => ({ name: s.name, description: s.description }));
2097
+ .map((s) => ({ name: s.name, description: s.description }))
2098
+ .sort((a, b) => a.name.localeCompare(b.name));
2094
2099
  slashCmdContext = null;
2095
2100
  } else {
2096
2101
  // Argument mode — look up the selected command and ask its complete().