@devkitvault/recall 1.2.4 → 1.2.5
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 +3 -2
- package/dist/commands/repl.js +2 -2
- package/dist/lib/source-label.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ recall playbook run deploy --dry-run
|
|
|
39
39
|
|
|
40
40
|
`recall playbook run` executes steps. Ask never does.
|
|
41
41
|
|
|
42
|
-
Ask prints a suggestion (`source` is `vault`, `cache`, or `
|
|
42
|
+
Ask prints a suggestion (`source` is `vault`, `cache`, or `recall agent` for a generated answer). Copy or save it yourself.
|
|
43
43
|
|
|
44
44
|
```sh
|
|
45
45
|
recall save "docker compose up -d" --name docker --tags docker
|
package/dist/commands/ask.js
CHANGED
|
@@ -18,6 +18,7 @@ const auth_1 = require("../lib/auth");
|
|
|
18
18
|
const events_1 = require("../lib/events");
|
|
19
19
|
const project_1 = require("../lib/project");
|
|
20
20
|
const runtime_1 = require("../lib/runtime");
|
|
21
|
+
const source_label_1 = require("../lib/source-label");
|
|
21
22
|
const spinner_1 = require("../lib/spinner");
|
|
22
23
|
const tags_1 = require("../lib/tags");
|
|
23
24
|
function riskColor(risk) {
|
|
@@ -36,7 +37,7 @@ function printSuggestion(result) {
|
|
|
36
37
|
console.log(` ${chalk_1.default.dim(result.explanation)}`);
|
|
37
38
|
}
|
|
38
39
|
console.log();
|
|
39
|
-
console.log(` ${chalk_1.default.dim('shell:')} ${result.shell} ${chalk_1.default.dim('risk:')} ${riskColor(result.risk)} ${chalk_1.default.dim('source:')} ${result.source}`);
|
|
40
|
+
console.log(` ${chalk_1.default.dim('shell:')} ${result.shell} ${chalk_1.default.dim('risk:')} ${riskColor(result.risk)} ${chalk_1.default.dim('source:')} ${(0, source_label_1.sourceLabel)(result.source)}`);
|
|
40
41
|
if (result.source === 'vault') {
|
|
41
42
|
const playbook = result.explanation?.includes('playbooks');
|
|
42
43
|
console.log(chalk_1.default.dim(playbook ? ' from your playbooks' : ' from your vault'));
|
|
@@ -148,7 +149,7 @@ async function runAsk(query) {
|
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
exports.askCommand = new commander_1.Command('ask')
|
|
151
|
-
.description('Suggest a command
|
|
152
|
+
.description('Suggest a terminal command. Ask is for terminal commands only and does not run them.')
|
|
152
153
|
.argument('<query...>', 'What you want to do')
|
|
153
154
|
.action(async (parts) => {
|
|
154
155
|
await runAsk(parts.join(' '));
|
package/dist/commands/repl.js
CHANGED
|
@@ -11,7 +11,7 @@ const events_1 = require("../lib/events");
|
|
|
11
11
|
const turns_1 = require("../lib/turns");
|
|
12
12
|
const ask_1 = require("./ask");
|
|
13
13
|
function printReplHelp() {
|
|
14
|
-
console.log(chalk_1.default.dim(' Ask prints a command
|
|
14
|
+
console.log(chalk_1.default.dim(' Ask is for terminal commands only. It prints a command and does not run it.'));
|
|
15
15
|
console.log(chalk_1.default.dim(' /save [name] save the last suggestion (asks for tags)'));
|
|
16
16
|
console.log(chalk_1.default.dim(' /clear forget this session'));
|
|
17
17
|
console.log(chalk_1.default.dim(' /exit leave'));
|
|
@@ -29,7 +29,7 @@ async function runRepl() {
|
|
|
29
29
|
let turnIndex = 0;
|
|
30
30
|
let busy = false;
|
|
31
31
|
let open = true;
|
|
32
|
-
console.log(chalk_1.default.dim(' Ask
|
|
32
|
+
console.log(chalk_1.default.dim(' Ask is for terminal commands only. Prints only. /help for commands.'));
|
|
33
33
|
rl.prompt();
|
|
34
34
|
async function handleLine(raw) {
|
|
35
35
|
const line = raw.trim();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sourceLabel = sourceLabel;
|
|
4
|
+
/** Printed Ask source. API/DB still use `llm` for generated answers. */
|
|
5
|
+
function sourceLabel(source) {
|
|
6
|
+
return source === 'llm' ? 'recall agent' : source;
|
|
7
|
+
}
|