@nevescloud/pip 3.8.0 → 3.8.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/runtime.esm.js +15 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nevescloud/pip",
3
- "version": "3.8.0",
3
+ "version": "3.8.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/runtime.esm.js CHANGED
@@ -236,20 +236,19 @@ export function createRuntime({
236
236
  return { clearedUI: true };
237
237
  }
238
238
  if (cmd === 'tools') {
239
- const list = Array.from(registeredTools.values())
240
- .map((t) => `\`${t.name}\` ${t.description || ''}`)
241
- .join('\n');
242
- return { reply: list ? '**Tools:**\n' + list : 'No tools registered.' };
239
+ // The slash autocomplete dropdown enumerates registered tools via
240
+ // complete() listing them as a chat turn duplicates that surface
241
+ // and pollutes history. Reopen the dropdown in arg-mode instead;
242
+ // same primitive /help and /model adopted via openCompletions.
243
+ if (registeredTools.size === 0) return { reply: 'No tools registered.' };
244
+ return { openCompletions: true };
243
245
  }
244
246
  if (cmd === 'model' && models.length) {
245
247
  const arg = args.trim();
246
248
  if (!arg) {
247
- const cur = currentModelName ? `\`${currentModelName}\`` : '(unknown)';
248
- const others = models
249
- .filter((m) => m.name !== currentModelName)
250
- .map((m) => `\`${m.name}\``);
251
- const tail = others.length ? ` Switch with \`/model <name>\` — try ${others.join(', ')}.` : '';
252
- return { reply: `Current model: ${cur}.${tail}` };
249
+ // Same sub-menu pattern as /tools open the dropdown for the user
250
+ // to pick a model, instead of logging "Current model: …" to chat.
251
+ return { openCompletions: true };
253
252
  }
254
253
  const target = models.find((m) => m.name.toLowerCase() === arg.toLowerCase());
255
254
  if (!target) {
@@ -294,7 +293,12 @@ export function createRuntime({
294
293
  function builtinSlash() {
295
294
  const out = [
296
295
  { name: 'clear', description: 'reset conversation' },
297
- { name: 'tools', description: 'list registered tools' },
296
+ {
297
+ name: 'tools',
298
+ description: 'list registered tools',
299
+ complete: (partial) => Array.from(registeredTools.keys())
300
+ .filter((n) => n.toLowerCase().startsWith(partial.toLowerCase())),
301
+ },
298
302
  ];
299
303
  if (models.length) {
300
304
  out.push({