@devkitvault/recall 1.2.1 → 1.2.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/README.md +1 -1
- package/dist/commands/ask.js +19 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @devkitvault/recall
|
|
2
2
|
|
|
3
|
-
**recall** is an AI terminal copilot with a personal command vault. Ask in English. It prints a command. It does not run it. Saved commands can answer first
|
|
3
|
+
**recall** is an AI terminal copilot with a personal command vault. Ask in English. It prints a command. It does not run it. Saved commands can answer first.
|
|
4
4
|
|
|
5
5
|
Works with [recall.devkitvault.com](https://recall.devkitvault.com) and the [VS Code extension](https://marketplace.visualstudio.com/items?itemName=devkitvault.recall-cmd).
|
|
6
6
|
|
package/dist/commands/ask.js
CHANGED
|
@@ -67,10 +67,18 @@ function printAskError(err) {
|
|
|
67
67
|
}
|
|
68
68
|
console.error(chalk_1.default.red('\n Failed to resolve that request.\n'));
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
function parseTags(raw) {
|
|
71
|
+
const tags = (raw ?? '')
|
|
72
|
+
.split(',')
|
|
73
|
+
.map((t) => t.trim())
|
|
74
|
+
.filter(Boolean);
|
|
75
|
+
return tags.length ? tags : undefined;
|
|
76
|
+
}
|
|
77
|
+
async function saveSuggestion(token, command, name, source, risk, tags) {
|
|
71
78
|
await api_1.ApiClient.post('/commands', {
|
|
72
79
|
command,
|
|
73
80
|
name: name?.trim() || undefined,
|
|
81
|
+
tags,
|
|
74
82
|
}, token);
|
|
75
83
|
await (0, events_1.track)('ai_accepted', { source, risk, saved: true });
|
|
76
84
|
console.log(chalk_1.default.green('\n Saved.\n'));
|
|
@@ -116,13 +124,20 @@ async function runAsk(query) {
|
|
|
116
124
|
}]);
|
|
117
125
|
if (!save)
|
|
118
126
|
return;
|
|
119
|
-
const { name } = await inquirer_1.default.prompt([
|
|
127
|
+
const { name, tags } = await inquirer_1.default.prompt([
|
|
128
|
+
{
|
|
120
129
|
type: 'input',
|
|
121
130
|
name: 'name',
|
|
122
131
|
message: 'Name (optional):',
|
|
123
|
-
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
type: 'input',
|
|
135
|
+
name: 'tags',
|
|
136
|
+
message: 'Tags (optional):',
|
|
137
|
+
},
|
|
138
|
+
]);
|
|
124
139
|
try {
|
|
125
|
-
await saveSuggestion(token, result.command, name, result.source, result.risk);
|
|
140
|
+
await saveSuggestion(token, result.command, name, result.source, result.risk, parseTags(tags));
|
|
126
141
|
}
|
|
127
142
|
catch (err) {
|
|
128
143
|
printAskError(err);
|