@wipcomputer/memory-crystal 0.7.34-alpha.3 → 0.7.34-alpha.4
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/package.json +7 -4
- package/dist/chunk-25LXQJ4Z.js +0 -110
- package/dist/chunk-2DRXIRQW.js +0 -97
- package/dist/chunk-2GBYLMEF.js +0 -1385
- package/dist/chunk-2ZNH5F6E.js +0 -1281
- package/dist/chunk-3G3SFYYI.js +0 -288
- package/dist/chunk-3RG5ZIWI.js +0 -10
- package/dist/chunk-3S6TI23B.js +0 -97
- package/dist/chunk-3VFIJYS4.js +0 -818
- package/dist/chunk-437F27T6.js +0 -97
- package/dist/chunk-52QE3YI3.js +0 -1169
- package/dist/chunk-57RP3DIN.js +0 -1205
- package/dist/chunk-5HSZ4W2P.js +0 -62
- package/dist/chunk-5I7GMRDN.js +0 -146
- package/dist/chunk-645IPXW3.js +0 -290
- package/dist/chunk-7A7ELD4C.js +0 -1205
- package/dist/chunk-7FYY4GZM.js +0 -1205
- package/dist/chunk-7IUE7ODU.js +0 -254
- package/dist/chunk-7RMLKZIS.js +0 -108
- package/dist/chunk-AA3OPP4Z.js +0 -432
- package/dist/chunk-AEWLSYPH.js +0 -72
- package/dist/chunk-ASSZDR6I.js +0 -108
- package/dist/chunk-AYRJVWUC.js +0 -1205
- package/dist/chunk-CCYI5O3D.js +0 -148
- package/dist/chunk-CGIDSAJB.js +0 -288
- package/dist/chunk-D3I3ZSE2.js +0 -411
- package/dist/chunk-D3MACYZ4.js +0 -108
- package/dist/chunk-DACSKLY6.js +0 -219
- package/dist/chunk-DFQ72B7M.js +0 -248
- package/dist/chunk-DW5B4BL7.js +0 -108
- package/dist/chunk-EKSACBTJ.js +0 -1070
- package/dist/chunk-EXEZZADG.js +0 -248
- package/dist/chunk-F3Y7EL7K.js +0 -83
- package/dist/chunk-FBQWSDPC.js +0 -1328
- package/dist/chunk-FHRZNOMW.js +0 -1205
- package/dist/chunk-IM7N24MT.js +0 -129
- package/dist/chunk-IPNYIXFK.js +0 -1178
- package/dist/chunk-J7MRSZIO.js +0 -167
- package/dist/chunk-JITKI2OI.js +0 -106
- package/dist/chunk-JWZXYVET.js +0 -1068
- package/dist/chunk-KCQUXVYT.js +0 -108
- package/dist/chunk-KOQ43OX6.js +0 -1281
- package/dist/chunk-KYVWO6ZM.js +0 -1069
- package/dist/chunk-L3VHARQH.js +0 -413
- package/dist/chunk-LBWDS6BE.js +0 -288
- package/dist/chunk-LOVAHSQV.js +0 -411
- package/dist/chunk-LQOYCAGG.js +0 -446
- package/dist/chunk-LWAIPJ2W.js +0 -146
- package/dist/chunk-M5DHKW7M.js +0 -127
- package/dist/chunk-MBKCIJHM.js +0 -1328
- package/dist/chunk-MK42FMEG.js +0 -147
- package/dist/chunk-MOBMYHKL.js +0 -1205
- package/dist/chunk-MPLTNMRG.js +0 -67
- package/dist/chunk-NIJCVN3O.js +0 -147
- package/dist/chunk-NX647OM3.js +0 -310
- package/dist/chunk-NZCFSZQ7.js +0 -1205
- package/dist/chunk-O2UITJGH.js +0 -465
- package/dist/chunk-OCRA44AZ.js +0 -108
- package/dist/chunk-P3KJR66H.js +0 -117
- package/dist/chunk-PEK6JH65.js +0 -432
- package/dist/chunk-PJ6FFKEX.js +0 -77
- package/dist/chunk-PLUBBZYR.js +0 -800
- package/dist/chunk-PNKVD2UK.js +0 -26
- package/dist/chunk-PSQZURHO.js +0 -229
- package/dist/chunk-SGL6ISBJ.js +0 -1061
- package/dist/chunk-SJABZZT5.js +0 -97
- package/dist/chunk-TD3P3K32.js +0 -1199
- package/dist/chunk-TMDZJJKV.js +0 -288
- package/dist/chunk-UNHVZB5G.js +0 -411
- package/dist/chunk-VAFTWSTE.js +0 -1061
- package/dist/chunk-VNFXFQBB.js +0 -217
- package/dist/chunk-X3GVFKSJ.js +0 -1205
- package/dist/chunk-XZ3S56RQ.js +0 -1061
- package/dist/chunk-Y72C7F6O.js +0 -148
- package/dist/chunk-YLICP577.js +0 -1205
- package/dist/chunk-YX6AXLVK.js +0 -159
- package/dist/chunk-ZCQYHTNU.js +0 -146
- package/dist/cloud-crystal.js +0 -6
- package/dist/dev-update-SZ2Z4WCQ.js +0 -6
- package/dist/llm-XXLYPIOF.js +0 -16
- package/dist/mlx-setup-XKU67WCT.js +0 -289
- package/dist/search-pipeline-4K4OJSSS.js +0 -255
- package/dist/search-pipeline-4PRS6LI7.js +0 -280
- package/dist/search-pipeline-7UJMXPLO.js +0 -280
- package/dist/search-pipeline-CBV25NX7.js +0 -99
- package/dist/search-pipeline-DQTRLGBH.js +0 -74
- package/dist/search-pipeline-HNG37REH.js +0 -282
- package/dist/search-pipeline-IZFPLBUB.js +0 -280
- package/dist/search-pipeline-MID6F26Q.js +0 -73
- package/dist/search-pipeline-N52JZFNN.js +0 -282
- package/dist/search-pipeline-OPB2PRQQ.js +0 -280
- package/dist/search-pipeline-VXTE5HAD.js +0 -262
- package/dist/search-pipeline-XHFKADRG.js +0 -73
- package/dist/worker-demo.js +0 -186
- package/dist/worker-mcp.js +0 -404
- package/scripts/crystal-capture 2.sh +0 -29
- package/scripts/deploy-cloud 2.sh +0 -153
package/dist/chunk-IM7N24MT.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
// src/ldm.ts
|
|
2
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync, copyFileSync, chmodSync } from "fs";
|
|
3
|
-
import { join, dirname } from "path";
|
|
4
|
-
import { execSync } from "child_process";
|
|
5
|
-
import { fileURLToPath } from "url";
|
|
6
|
-
var HOME = process.env.HOME || "";
|
|
7
|
-
var LDM_ROOT = join(HOME, ".ldm");
|
|
8
|
-
function getAgentId() {
|
|
9
|
-
return process.env.CRYSTAL_AGENT_ID || "cc-mini";
|
|
10
|
-
}
|
|
11
|
-
function ldmPaths(agentId) {
|
|
12
|
-
const id = agentId || getAgentId();
|
|
13
|
-
const agentRoot = join(LDM_ROOT, "agents", id);
|
|
14
|
-
return {
|
|
15
|
-
root: LDM_ROOT,
|
|
16
|
-
bin: join(LDM_ROOT, "bin"),
|
|
17
|
-
config: join(LDM_ROOT, "config.json"),
|
|
18
|
-
crystalDb: join(LDM_ROOT, "memory", "crystal.db"),
|
|
19
|
-
crystalLance: join(LDM_ROOT, "memory", "lance"),
|
|
20
|
-
agentRoot,
|
|
21
|
-
transcripts: join(agentRoot, "memory", "transcripts"),
|
|
22
|
-
sessions: join(agentRoot, "memory", "sessions"),
|
|
23
|
-
daily: join(agentRoot, "memory", "daily"),
|
|
24
|
-
journals: join(agentRoot, "memory", "journals")
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function loadConfig() {
|
|
28
|
-
const configPath = join(LDM_ROOT, "config.json");
|
|
29
|
-
try {
|
|
30
|
-
if (existsSync(configPath)) {
|
|
31
|
-
return JSON.parse(readFileSync(configPath, "utf-8"));
|
|
32
|
-
}
|
|
33
|
-
} catch {
|
|
34
|
-
}
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
function saveConfig(config) {
|
|
38
|
-
const configPath = join(LDM_ROOT, "config.json");
|
|
39
|
-
writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
40
|
-
}
|
|
41
|
-
function scaffoldLdm(agentId) {
|
|
42
|
-
const paths = ldmPaths(agentId);
|
|
43
|
-
mkdirSync(join(paths.root, "memory"), { recursive: true });
|
|
44
|
-
mkdirSync(paths.crystalLance, { recursive: true });
|
|
45
|
-
mkdirSync(paths.bin, { recursive: true });
|
|
46
|
-
mkdirSync(paths.transcripts, { recursive: true });
|
|
47
|
-
mkdirSync(paths.sessions, { recursive: true });
|
|
48
|
-
mkdirSync(paths.daily, { recursive: true });
|
|
49
|
-
mkdirSync(paths.journals, { recursive: true });
|
|
50
|
-
const id = agentId || getAgentId();
|
|
51
|
-
let config = loadConfig();
|
|
52
|
-
if (!config) {
|
|
53
|
-
config = {
|
|
54
|
-
version: "1.0.0",
|
|
55
|
-
agents: [id],
|
|
56
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
57
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
58
|
-
};
|
|
59
|
-
} else {
|
|
60
|
-
if (!config.agents.includes(id)) {
|
|
61
|
-
config.agents.push(id);
|
|
62
|
-
}
|
|
63
|
-
config.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
64
|
-
}
|
|
65
|
-
saveConfig(config);
|
|
66
|
-
return paths;
|
|
67
|
-
}
|
|
68
|
-
function deployCaptureScript() {
|
|
69
|
-
const paths = ldmPaths();
|
|
70
|
-
mkdirSync(paths.bin, { recursive: true });
|
|
71
|
-
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
72
|
-
let scriptSrc = join(thisDir, "crystal-capture.sh");
|
|
73
|
-
if (!existsSync(scriptSrc)) {
|
|
74
|
-
scriptSrc = join(thisDir, "..", "scripts", "crystal-capture.sh");
|
|
75
|
-
}
|
|
76
|
-
const scriptDest = join(paths.bin, "crystal-capture.sh");
|
|
77
|
-
if (!existsSync(scriptSrc)) {
|
|
78
|
-
throw new Error(`crystal-capture.sh not found at ${scriptSrc}`);
|
|
79
|
-
}
|
|
80
|
-
copyFileSync(scriptSrc, scriptDest);
|
|
81
|
-
chmodSync(scriptDest, 493);
|
|
82
|
-
return scriptDest;
|
|
83
|
-
}
|
|
84
|
-
var CRON_TAG = "# crystal-capture";
|
|
85
|
-
var CRON_ENTRY = "* * * * * ~/.ldm/bin/crystal-capture.sh >> /tmp/ldm-dev-tools/crystal-capture.log 2>&1";
|
|
86
|
-
function isCrystalCaptureLine(line) {
|
|
87
|
-
return line === CRON_TAG || line.includes("crystal-capture.sh") && line.startsWith("*");
|
|
88
|
-
}
|
|
89
|
-
function installCron() {
|
|
90
|
-
mkdirSync("/tmp/ldm-dev-tools", { recursive: true });
|
|
91
|
-
let existing = "";
|
|
92
|
-
try {
|
|
93
|
-
existing = execSync("crontab -l 2>/dev/null", { encoding: "utf8" });
|
|
94
|
-
} catch {
|
|
95
|
-
}
|
|
96
|
-
const lines = existing.split("\n").filter((line) => !isCrystalCaptureLine(line));
|
|
97
|
-
lines.push(CRON_TAG);
|
|
98
|
-
lines.push(CRON_ENTRY);
|
|
99
|
-
const newCrontab = lines.filter((l, i, arr) => !(l === "" && i === arr.length - 1)).join("\n") + "\n";
|
|
100
|
-
execSync("crontab -", { input: newCrontab, encoding: "utf8" });
|
|
101
|
-
}
|
|
102
|
-
function removeCron() {
|
|
103
|
-
let existing = "";
|
|
104
|
-
try {
|
|
105
|
-
existing = execSync("crontab -l 2>/dev/null", { encoding: "utf8" });
|
|
106
|
-
} catch {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const lines = existing.split("\n").filter((line) => !isCrystalCaptureLine(line));
|
|
110
|
-
const newCrontab = lines.join("\n");
|
|
111
|
-
execSync("crontab -", { input: newCrontab, encoding: "utf8" });
|
|
112
|
-
}
|
|
113
|
-
function ensureLdm(agentId) {
|
|
114
|
-
const paths = ldmPaths(agentId);
|
|
115
|
-
if (existsSync(paths.transcripts) && existsSync(paths.config)) {
|
|
116
|
-
return paths;
|
|
117
|
-
}
|
|
118
|
-
return scaffoldLdm(agentId);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export {
|
|
122
|
-
getAgentId,
|
|
123
|
-
ldmPaths,
|
|
124
|
-
scaffoldLdm,
|
|
125
|
-
deployCaptureScript,
|
|
126
|
-
installCron,
|
|
127
|
-
removeCron,
|
|
128
|
-
ensureLdm
|
|
129
|
-
};
|