codemem 0.20.8 → 0.20.10
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/setup.d.ts +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -14
- package/.opencode/entry.js +0 -5
- package/.opencode/lib/compat.js +0 -171
- package/.opencode/package.json +0 -6
- package/.opencode/plugins/codemem.js +0 -1904
package/package.json
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codemem",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.10",
|
|
4
4
|
"description": "Memory layer for AI coding agents — search, recall, and sync context across sessions",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./.opencode/entry.js",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"import": "./.opencode/entry.js"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
6
|
"bin": {
|
|
13
7
|
"codemem": "./dist/index.js"
|
|
14
8
|
},
|
|
15
9
|
"files": [
|
|
16
10
|
"dist/",
|
|
17
|
-
".opencode/entry.js",
|
|
18
|
-
".opencode/package.json",
|
|
19
|
-
".opencode/plugins/",
|
|
20
|
-
".opencode/lib/",
|
|
21
11
|
"README.md",
|
|
22
12
|
"LICENSE"
|
|
23
13
|
],
|
|
@@ -27,9 +17,9 @@
|
|
|
27
17
|
"commander": "^14.0.3",
|
|
28
18
|
"drizzle-orm": "^0.45.1",
|
|
29
19
|
"omelette": "^0.4.17",
|
|
30
|
-
"@codemem/core": "^0.20.
|
|
31
|
-
"@codemem/
|
|
32
|
-
"@codemem/
|
|
20
|
+
"@codemem/core": "^0.20.10",
|
|
21
|
+
"@codemem/server": "^0.20.10",
|
|
22
|
+
"@codemem/mcp": "^0.20.10"
|
|
33
23
|
},
|
|
34
24
|
"devDependencies": {
|
|
35
25
|
"@types/node": "^25.5.0",
|
package/.opencode/entry.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Minimal module entry point for package resolution.
|
|
2
|
-
// OpenCode needs to resolve this package as a module to discover
|
|
3
|
-
// .opencode/plugins/codemem.js — the actual plugin is loaded from there.
|
|
4
|
-
// This file intentionally does nothing; the CLI lives at bin/codemem.
|
|
5
|
-
export const name = "codemem";
|
package/.opencode/lib/compat.js
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
export const parseSemver = (value) => {
|
|
2
|
-
const match = String(value || "").trim().match(/^(\d+)\.(\d+)\.(\d+)(?:-.*)?$/);
|
|
3
|
-
if (!match) return null;
|
|
4
|
-
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export const isVersionAtLeast = (currentVersion, minVersion) => {
|
|
8
|
-
const current = parseSemver(currentVersion);
|
|
9
|
-
const minimum = parseSemver(minVersion);
|
|
10
|
-
if (!current || !minimum) return false;
|
|
11
|
-
for (let i = 0; i < 3; i += 1) {
|
|
12
|
-
if (current[i] > minimum[i]) return true;
|
|
13
|
-
if (current[i] < minimum[i]) return false;
|
|
14
|
-
}
|
|
15
|
-
return true;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const resolveUpgradeGuidance = ({ runner, runnerFrom }) => {
|
|
19
|
-
const normalizedRunner = String(runner || "").trim();
|
|
20
|
-
const normalizedFrom = String(runnerFrom || "").trim();
|
|
21
|
-
|
|
22
|
-
if (normalizedRunner === "node") {
|
|
23
|
-
return {
|
|
24
|
-
mode: "node-dev",
|
|
25
|
-
action: "In your codemem repo, pull latest changes and run `pnpm build`, then restart OpenCode.",
|
|
26
|
-
note: "detected TS dev mode",
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (normalizedRunner === "npx") {
|
|
31
|
-
return {
|
|
32
|
-
mode: "npx",
|
|
33
|
-
action: "Run `npm install -g @codemem/cli` to update, then restart OpenCode.",
|
|
34
|
-
note: "detected npx runner mode",
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (normalizedRunner === "uv") {
|
|
39
|
-
return {
|
|
40
|
-
mode: "uv-dev",
|
|
41
|
-
action: "In your codemem repo, pull latest changes and run `uv sync`, then restart OpenCode.",
|
|
42
|
-
note: "detected dev repo mode",
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (normalizedRunner === "uvx") {
|
|
47
|
-
if (normalizedFrom.startsWith("git+") || normalizedFrom.includes(".git")) {
|
|
48
|
-
return {
|
|
49
|
-
mode: "uvx-git",
|
|
50
|
-
action: "Update CODEMEM_RUNNER_FROM to a newer git ref/source, then restart OpenCode.",
|
|
51
|
-
note: "detected uvx git mode",
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
mode: "uvx-custom",
|
|
56
|
-
action: "Update CODEMEM_RUNNER_FROM to a newer source, then restart OpenCode.",
|
|
57
|
-
note: "detected uvx custom source mode",
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
mode: "generic",
|
|
63
|
-
action: "Run `uv tool install --upgrade codemem`, then restart OpenCode.",
|
|
64
|
-
note: "fallback guidance",
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const parseBackendUpdatePolicy = (value) => {
|
|
69
|
-
const normalized = String(value || "").trim().toLowerCase();
|
|
70
|
-
if (!normalized) return "notify";
|
|
71
|
-
if (["notify", "auto", "off"].includes(normalized)) {
|
|
72
|
-
return normalized;
|
|
73
|
-
}
|
|
74
|
-
if (["1", "true", "yes", "on"].includes(normalized)) {
|
|
75
|
-
return "auto";
|
|
76
|
-
}
|
|
77
|
-
if (["0", "false", "no"].includes(normalized)) {
|
|
78
|
-
return "off";
|
|
79
|
-
}
|
|
80
|
-
return "notify";
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const isPinnedGitSource = (runnerFrom) => {
|
|
84
|
-
const source = String(runnerFrom || "").trim();
|
|
85
|
-
if (!source) return false;
|
|
86
|
-
if (!(source.startsWith("git+") || source.includes(".git"))) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
const withoutQuery = source.replace(/[?#].*$/, "");
|
|
90
|
-
if (withoutQuery.includes(".git@")) {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
if (!withoutQuery.startsWith("git+")) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
const urlValue = withoutQuery.slice(4);
|
|
97
|
-
try {
|
|
98
|
-
const parsed = new URL(urlValue);
|
|
99
|
-
const path = String(parsed.pathname || "");
|
|
100
|
-
if (path.includes(".git@")) {
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
return /@[^/]+$/.test(path);
|
|
104
|
-
} catch {
|
|
105
|
-
return /@[^/]+$/.test(withoutQuery);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const resolveAutoUpdatePlan = ({ runner, runnerFrom }) => {
|
|
110
|
-
const normalizedRunner = String(runner || "").trim();
|
|
111
|
-
const source = String(runnerFrom || "").trim();
|
|
112
|
-
|
|
113
|
-
if (normalizedRunner === "node") {
|
|
114
|
-
return {
|
|
115
|
-
allowed: false,
|
|
116
|
-
reason: "dev-runner",
|
|
117
|
-
command: null,
|
|
118
|
-
commandText: null,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (normalizedRunner === "npx") {
|
|
123
|
-
return {
|
|
124
|
-
allowed: true,
|
|
125
|
-
reason: null,
|
|
126
|
-
command: ["npm", "install", "-g", "@codemem/cli@latest"],
|
|
127
|
-
commandText: "npm install -g @codemem/cli@latest",
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (normalizedRunner === "uv") {
|
|
132
|
-
return {
|
|
133
|
-
allowed: false,
|
|
134
|
-
reason: "dev-runner",
|
|
135
|
-
command: null,
|
|
136
|
-
commandText: null,
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (normalizedRunner === "uvx") {
|
|
141
|
-
if (!source) {
|
|
142
|
-
return {
|
|
143
|
-
allowed: false,
|
|
144
|
-
reason: "missing-source",
|
|
145
|
-
command: null,
|
|
146
|
-
commandText: null,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
if (isPinnedGitSource(source)) {
|
|
150
|
-
return {
|
|
151
|
-
allowed: false,
|
|
152
|
-
reason: "pinned-source",
|
|
153
|
-
command: null,
|
|
154
|
-
commandText: null,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
return {
|
|
158
|
-
allowed: true,
|
|
159
|
-
reason: null,
|
|
160
|
-
command: ["uvx", "--refresh", "--from", source, "codemem", "version"],
|
|
161
|
-
commandText: "uvx --refresh --from <source> codemem version",
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return {
|
|
166
|
-
allowed: true,
|
|
167
|
-
reason: null,
|
|
168
|
-
command: ["uv", "tool", "install", "--upgrade", "codemem"],
|
|
169
|
-
commandText: "uv tool install --upgrade codemem",
|
|
170
|
-
};
|
|
171
|
-
};
|