@nevescloud/pip 3.8.2 → 3.8.3
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/package.json +1 -1
- package/runtime.esm.js +20 -5
package/package.json
CHANGED
package/runtime.esm.js
CHANGED
|
@@ -236,12 +236,27 @@ export function createRuntime({
|
|
|
236
236
|
return { clearedUI: true };
|
|
237
237
|
}
|
|
238
238
|
if (cmd === 'tools') {
|
|
239
|
-
//
|
|
240
|
-
//
|
|
241
|
-
//
|
|
242
|
-
//
|
|
239
|
+
// No-arg form opens the autocomplete dropdown (same surface /help and
|
|
240
|
+
// /model adopted via openCompletions) so users can browse without
|
|
241
|
+
// polluting chat history. With an arg the user picked a specific
|
|
242
|
+
// tool — render its description + schema as a reply so the dropdown
|
|
243
|
+
// selection has a meaningful outcome instead of looping back.
|
|
243
244
|
if (registeredTools.size === 0) return { reply: 'No tools registered.' };
|
|
244
|
-
|
|
245
|
+
const arg = args.trim();
|
|
246
|
+
if (!arg) return { openCompletions: true };
|
|
247
|
+
const tool = registeredTools.get(arg);
|
|
248
|
+
if (!tool) {
|
|
249
|
+
const all = Array.from(registeredTools.keys()).map((n) => `\`${n}\``).join(', ');
|
|
250
|
+
return { reply: `Unknown tool \`${arg}\`. Available: ${all}` };
|
|
251
|
+
}
|
|
252
|
+
const lines = [`**\`${tool.name}\`** — ${tool.description || '(no description)'}`];
|
|
253
|
+
const schema = tool.schema || tool.input_schema;
|
|
254
|
+
if (schema && Object.keys(schema.properties || {}).length > 0) {
|
|
255
|
+
lines.push('', '```json', JSON.stringify(schema, null, 2), '```');
|
|
256
|
+
} else if (schema) {
|
|
257
|
+
lines.push('', '(no arguments)');
|
|
258
|
+
}
|
|
259
|
+
return { reply: lines.join('\n') };
|
|
245
260
|
}
|
|
246
261
|
if (cmd === 'model' && models.length) {
|
|
247
262
|
const arg = args.trim();
|