jfl 0.9.4 → 0.9.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/dist/commands/context-hub.d.ts.map +1 -1
- package/dist/commands/context-hub.js +27 -2
- package/dist/commands/context-hub.js.map +1 -1
- package/dist/lib/memory-db.d.ts +25 -0
- package/dist/lib/memory-db.d.ts.map +1 -1
- package/dist/lib/memory-db.js +91 -0
- package/dist/lib/memory-db.js.map +1 -1
- package/dist/lib/memory-indexer.d.ts +6 -0
- package/dist/lib/memory-indexer.d.ts.map +1 -1
- package/dist/lib/memory-indexer.js +151 -4
- package/dist/lib/memory-indexer.js.map +1 -1
- package/dist/lib/memory-search.d.ts.map +1 -1
- package/dist/lib/memory-search.js +16 -9
- package/dist/lib/memory-search.js.map +1 -1
- package/package.json +1 -1
- package/packages/pi/extensions/onboarding-v2.ts +6 -1
- package/packages/pi/extensions/session.ts +13 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-hub.d.ts","sourceRoot":"","sources":["../../src/commands/context-hub.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"context-hub.d.ts","sourceRoot":"","sources":["../../src/commands/context-hub.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiwFH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAiBjF;AAkMD,wBAAsB,qBAAqB,CAAC,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAiHxF;AAMD,wBAAsB,iBAAiB,CACrC,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,iBA8lBzF"}
|
|
@@ -16,7 +16,7 @@ import { homedir } from "os";
|
|
|
16
16
|
import { fileURLToPath } from "url";
|
|
17
17
|
import { initializeDatabase, getMemoryStats, insertMemory } from "../lib/memory-db.js";
|
|
18
18
|
import { searchMemories } from "../lib/memory-search.js";
|
|
19
|
-
import { indexJournalEntries, startPeriodicIndexing, backfillEmbeddings } from "../lib/memory-indexer.js";
|
|
19
|
+
import { indexJournalEntries, startPeriodicIndexing, backfillEmbeddings, indexCodeHeaders } from "../lib/memory-indexer.js";
|
|
20
20
|
import { getProjectPort } from "../utils/context-hub-port.js";
|
|
21
21
|
import { getConfigValue, setConfig } from "../utils/jfl-config.js";
|
|
22
22
|
import Conf from "conf";
|
|
@@ -1060,8 +1060,33 @@ function createServer(projectRoot, port, eventBus, flowEngine) {
|
|
|
1060
1060
|
if (backfill !== false) {
|
|
1061
1061
|
embeddingStats = await backfillEmbeddings();
|
|
1062
1062
|
}
|
|
1063
|
+
const codeStats = await indexCodeHeaders();
|
|
1063
1064
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
1064
|
-
res.end(JSON.stringify({ ok: true, ...stats, embeddings_backfilled: embeddingStats.updated, embedding_errors: embeddingStats.errors }));
|
|
1065
|
+
res.end(JSON.stringify({ ok: true, ...stats, embeddings_backfilled: embeddingStats.updated, embedding_errors: embeddingStats.errors, code_headers_added: codeStats.added, code_headers_updated: codeStats.updated }));
|
|
1066
|
+
}
|
|
1067
|
+
catch (err) {
|
|
1068
|
+
res.writeHead(500, { "Content-Type": "application/json" });
|
|
1069
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
// POST /api/memory/link — add a graph edge between two memories
|
|
1075
|
+
if (url.pathname === "/api/memory/link" && req.method === "POST") {
|
|
1076
|
+
let body = "";
|
|
1077
|
+
req.on("data", (chunk) => body += chunk);
|
|
1078
|
+
req.on("end", async () => {
|
|
1079
|
+
try {
|
|
1080
|
+
const { from, to, type } = JSON.parse(body || "{}");
|
|
1081
|
+
if (!from || !to || !type) {
|
|
1082
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
1083
|
+
res.end(JSON.stringify({ error: "from, to, and type are required" }));
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
const { addLink } = await import("../lib/memory-db.js");
|
|
1087
|
+
const id = await addLink(from, to, type);
|
|
1088
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
1089
|
+
res.end(JSON.stringify({ ok: true, id }));
|
|
1065
1090
|
}
|
|
1066
1091
|
catch (err) {
|
|
1067
1092
|
res.writeHead(500, { "Content-Type": "application/json" });
|