@bli-cockpit/cli 0.2.185 → 0.2.186
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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Cross-project search always names the project, after the date and before the author. */
|
|
2
|
+
export function memoryProjectPrefix(row) {
|
|
3
|
+
if (typeof row["project"] !== "string" || !row["project"])
|
|
4
|
+
return "";
|
|
5
|
+
const date = typeof row["createdAt"] === "string" ? new Date(row["createdAt"]) : null;
|
|
6
|
+
const day = date && !Number.isNaN(date.getTime()) ? `[${date.toISOString().slice(0, 10)}] ` : "";
|
|
7
|
+
const author = typeof row["savedBy"] === "string" && row["savedBy"] ? `(from ${row["savedBy"]}) ` : "";
|
|
8
|
+
return `${day}[${row["project"]}] ${author}`;
|
|
9
|
+
}
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
* `ps` shows an argument list, shell history keeps it, and a memory with a
|
|
43
43
|
* newline in it cannot be quoted correctly anyway.
|
|
44
44
|
*/
|
|
45
|
+
import { memoryProjectPrefix } from "./memory-project-label.js";
|
|
45
46
|
import { resolveContainerTag } from "@bli-cockpit/memory-mcp/dist/container-tag.js";
|
|
46
47
|
import { askAgentDoor, emitAgentDoor, failAgentDoor, openAgentDoor, } from "./agent-door.js";
|
|
47
48
|
import { isInteractiveStdin, readPipedText, writeLine } from "./cli-io.js";
|
|
@@ -208,7 +209,7 @@ async function searchMemory(command, door) {
|
|
|
208
209
|
}
|
|
209
210
|
else {
|
|
210
211
|
for (const row of results) {
|
|
211
|
-
writeLine(door.io.stdout, `${similarityLabel(row)}${oneLine(row["memory"])}`);
|
|
212
|
+
writeLine(door.io.stdout, `${similarityLabel(row)}${memoryProjectPrefix(row)}${oneLine(row["memory"])}`);
|
|
212
213
|
writeLine(door.io.stdout, ` ${String(row["id"] ?? "")} ${String(row["containerTag"] ?? "")}${filedByLabel(row)}`);
|
|
213
214
|
}
|
|
214
215
|
}
|
|
@@ -217,7 +218,7 @@ async function searchMemory(command, door) {
|
|
|
217
218
|
writeLine(door.io.stdout, "Recent context:");
|
|
218
219
|
for (const row of recent) {
|
|
219
220
|
const author = typeof row["savedBy"] === "string" && row["savedBy"] ? `(from ${row["savedBy"]}) ` : "";
|
|
220
|
-
writeLine(door.io.stdout, ` - ${author}${oneLine(row["preview"] ?? row["memory"])}`);
|
|
221
|
+
writeLine(door.io.stdout, ` - ${memoryProjectPrefix(row)}${row["project"] ? "" : author}${oneLine(row["preview"] ?? row["memory"])}`);
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
if (body.degraded) {
|
|
@@ -301,7 +301,8 @@ async function waitForTranscription(door, noteId, background = false) {
|
|
|
301
301
|
if (!door.json)
|
|
302
302
|
writeLine(door.io.stderr, lastDetail);
|
|
303
303
|
}
|
|
304
|
-
|
|
304
|
+
const pause = Math.min(intervalMs, Math.max(0, deadline - Date.now()));
|
|
305
|
+
await (door.io.sleep ? door.io.sleep(pause) : new Promise((resolve) => setTimeout(resolve, pause)));
|
|
305
306
|
}
|
|
306
307
|
return { status: "failed", reason: "transcription_wait_timeout" };
|
|
307
308
|
}
|
|
@@ -21,7 +21,7 @@ export async function runCockpitCli(argv, io) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
if (command === "--version" || command === "-V" || command === "version") {
|
|
24
|
-
writeLine(io?.stdout ?? process.stdout, "0.2.
|
|
24
|
+
writeLine(io?.stdout ?? process.stdout, "0.2.186");
|
|
25
25
|
return 0;
|
|
26
26
|
}
|
|
27
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bli-cockpit/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.186",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"test": "node dist/cli.js --help && node ../../scripts/assert-public-cli-routing.mjs && node ../../scripts/assert-public-cli-verb-help.mjs && node ../../scripts/assert-public-cli-surface-doors.mjs && node ../../scripts/assert-public-cli-runtime-files.mjs && node ../../scripts/assert-public-cli-exit-contract.mjs && node ../../scripts/assert-public-cli-no-fleet-posts.mjs && node ../../scripts/assert-public-cli-doctor-json.mjs && node ../../scripts/assert-public-package-pack.mjs --workspace=@bli-cockpit/cli"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@bli-cockpit/memory-mcp": "0.1.
|
|
30
|
+
"@bli-cockpit/memory-mcp": "0.1.56",
|
|
31
31
|
"@bli-cockpit/mcp": "0.1.99",
|
|
32
32
|
"@bli-cockpit/telemetry-core": "0.1.66"
|
|
33
33
|
},
|