pi-sdk-web 0.3.0 → 0.3.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.
- package/dist/static/app.js +13 -6
- package/package.json +1 -1
package/dist/static/app.js
CHANGED
|
@@ -1186,10 +1186,18 @@ class PiWebClient {
|
|
|
1186
1186
|
this.send({ type: 'bash', command: command });
|
|
1187
1187
|
}
|
|
1188
1188
|
} else if (text.startsWith('/')) {
|
|
1189
|
-
//
|
|
1189
|
+
// Skill commands (/skill:name args) go through prompt expansion in Pi -
|
|
1190
|
+
// sent as-is (with the skill: prefix) so session.prompt expands them.
|
|
1191
|
+
if (text.startsWith('/skill:')) {
|
|
1192
|
+
this.send({ type: 'prompt', message: text });
|
|
1193
|
+
this.inputEl.value = '';
|
|
1194
|
+
this.hideCommandMenu();
|
|
1195
|
+
return;
|
|
1196
|
+
}
|
|
1197
|
+
// Other slash commands: builtins are handled locally, everything else is
|
|
1190
1198
|
// executed as an extension command by the server.
|
|
1191
1199
|
const m = text.slice(1).match(/^(\S+)\s*(.*)$/);
|
|
1192
|
-
const name =
|
|
1200
|
+
const name = m ? m[1] : text.slice(1);
|
|
1193
1201
|
const args = m ? m[2] : '';
|
|
1194
1202
|
const builtin = BUILTIN_COMMANDS.find((c) => c.name === name);
|
|
1195
1203
|
if (builtin && builtin.action && !builtin.unsupported) {
|
|
@@ -1707,7 +1715,7 @@ class PiWebClient {
|
|
|
1707
1715
|
.map(
|
|
1708
1716
|
(c, i) =>
|
|
1709
1717
|
`<div class="command-item" data-index="${i}">` +
|
|
1710
|
-
`<span class="command-name">/${this.escapeHtml(c.name
|
|
1718
|
+
`<span class="command-name">/${this.escapeHtml(c.name)}</span>` +
|
|
1711
1719
|
`<span class="command-desc">${this.escapeHtml(c.description || c.source || '')}</span>` +
|
|
1712
1720
|
(c.unsupported ? `<span class="command-unsupported">not supported</span>` : '') +
|
|
1713
1721
|
`</div>`,
|
|
@@ -1758,9 +1766,8 @@ class PiWebClient {
|
|
|
1758
1766
|
return;
|
|
1759
1767
|
}
|
|
1760
1768
|
|
|
1761
|
-
// Regular commands: insert into input
|
|
1762
|
-
|
|
1763
|
-
this.inputEl.value = '/' + name + ' ';
|
|
1769
|
+
// Regular commands: insert into input (keep skill: prefix - Pi expands it)
|
|
1770
|
+
this.inputEl.value = '/' + cmd.name + ' ';
|
|
1764
1771
|
this.inputEl.focus();
|
|
1765
1772
|
this.hideCommandMenu();
|
|
1766
1773
|
}
|