@inupedia/spotlight-memory 0.1.7 → 0.1.8
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,60 @@
|
|
|
1
|
+
export declare const FILE_MEMORY_ENTRYPOINT = "MEMORY.md";
|
|
2
|
+
export type SpotlightFileMemoryScope = "managed" | "user" | "project" | "local" | "auto" | "agent-user" | "agent-project" | "agent-local" | "session";
|
|
3
|
+
export interface SpotlightFileMemoryInfo {
|
|
4
|
+
path: string;
|
|
5
|
+
type: SpotlightFileMemoryScope;
|
|
6
|
+
content: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SpotlightFileMemoryPaths {
|
|
9
|
+
baseDir: string;
|
|
10
|
+
projectDir: string;
|
|
11
|
+
autoDir: string;
|
|
12
|
+
autoEntrypoint: string;
|
|
13
|
+
sessionDir?: string;
|
|
14
|
+
sessionEntrypoint?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ResolveSpotlightFileMemoryPathsOptions {
|
|
17
|
+
projectId: string;
|
|
18
|
+
baseDir?: string;
|
|
19
|
+
sessionId?: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface LoadSpotlightFileMemoryOptions extends ResolveSpotlightFileMemoryPathsOptions {
|
|
22
|
+
cwd?: string;
|
|
23
|
+
includeProjectFiles?: boolean;
|
|
24
|
+
includeAutoMemory?: boolean;
|
|
25
|
+
includeSessionMemory?: boolean;
|
|
26
|
+
agent?: {
|
|
27
|
+
type: string;
|
|
28
|
+
scope: "user" | "project" | "local";
|
|
29
|
+
};
|
|
30
|
+
maxFileChars?: number;
|
|
31
|
+
maxTotalChars?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface BuildSpotlightFileMemoryPromptOptions extends LoadSpotlightFileMemoryOptions {
|
|
34
|
+
emptyText?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function resolveSpotlightFileMemoryPaths(options: ResolveSpotlightFileMemoryPathsOptions): SpotlightFileMemoryPaths;
|
|
37
|
+
export declare function resolveAgentMemoryDir(options: {
|
|
38
|
+
projectId: string;
|
|
39
|
+
agentType: string;
|
|
40
|
+
scope: "user" | "project" | "local";
|
|
41
|
+
baseDir?: string;
|
|
42
|
+
cwd?: string;
|
|
43
|
+
}): string;
|
|
44
|
+
export declare function resolveAgentMemoryEntrypoint(options: {
|
|
45
|
+
projectId: string;
|
|
46
|
+
agentType: string;
|
|
47
|
+
scope: "user" | "project" | "local";
|
|
48
|
+
baseDir?: string;
|
|
49
|
+
cwd?: string;
|
|
50
|
+
}): string;
|
|
51
|
+
export declare function ensureSpotlightFileMemoryEntrypoints(options: ResolveSpotlightFileMemoryPathsOptions): Promise<SpotlightFileMemoryPaths>;
|
|
52
|
+
export declare function appendSpotlightFileMemory(options: {
|
|
53
|
+
filePath: string;
|
|
54
|
+
content: string;
|
|
55
|
+
heading?: string;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
export declare function loadSpotlightFileMemories(options: LoadSpotlightFileMemoryOptions): Promise<SpotlightFileMemoryInfo[]>;
|
|
58
|
+
export declare function buildSpotlightFileMemoryPrompt(options: BuildSpotlightFileMemoryPromptOptions): Promise<string>;
|
|
59
|
+
export declare function isSpotlightFileMemoryPath(absolutePath: string, options: ResolveSpotlightFileMemoryPathsOptions): boolean;
|
|
60
|
+
//# sourceMappingURL=fileMemory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileMemory.d.ts","sourceRoot":"","sources":["../../src/node/fileMemory.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAChC,SAAS,GACT,MAAM,GACN,SAAS,GACT,OAAO,GACP,MAAM,GACN,YAAY,GACZ,eAAe,GACf,aAAa,GACb,SAAS,CAAC;AAEd,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE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pD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,CAET;AAED,wBAAsB,oCAAoC,CACxD,OAAO,EAAE,sCAAsC,GAC9C,OAAO,CAAC,wBAAwB,CAAC,CAanC;AAED,wBAAsB,yBAAyB,CAAC,OAAO,EAAE;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAehB;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,uBAAuB,EAAE,CAAC,CA2DpC;AAyBD,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,qCAAqC,GAC7C,OAAO,CAAC,MAAM,CAAC,CA0BjB;AAED,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,sCAAsC,GAC9C,OAAO,CAQT"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { mkdir, readdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { dirname, isAbsolute, join, resolve, sep } from "node:path";
|
|
4
|
+
export const FILE_MEMORY_ENTRYPOINT = "MEMORY.md";
|
|
5
|
+
function normalizeDir(path) {
|
|
6
|
+
const resolved = resolve(path);
|
|
7
|
+
return resolved.endsWith(sep) ? resolved : `${resolved}${sep}`;
|
|
8
|
+
}
|
|
9
|
+
function sanitizePathSegment(value) {
|
|
10
|
+
return (value
|
|
11
|
+
.trim()
|
|
12
|
+
.replace(/[/\\:]/g, "-")
|
|
13
|
+
.replace(/\s+/g, "-")
|
|
14
|
+
.replace(/[^a-zA-Z0-9._-]/g, "_")
|
|
15
|
+
.slice(0, 160) || "default");
|
|
16
|
+
}
|
|
17
|
+
function resolveBaseDir(baseDir) {
|
|
18
|
+
const raw = baseDir?.trim() ||
|
|
19
|
+
process.env.SPOTLIGHT_MEMORY_DIR?.trim() ||
|
|
20
|
+
join(homedir(), ".spotlight");
|
|
21
|
+
return resolve(raw);
|
|
22
|
+
}
|
|
23
|
+
function truncate(text, maxChars) {
|
|
24
|
+
if (text.length <= maxChars)
|
|
25
|
+
return text;
|
|
26
|
+
return `${text.slice(0, Math.max(0, maxChars - 80)).trimEnd()}\n\n<!-- truncated by Spotlight memory: ${text.length - maxChars} chars omitted -->`;
|
|
27
|
+
}
|
|
28
|
+
async function readUtf8File(path) {
|
|
29
|
+
try {
|
|
30
|
+
return await readFile(path, "utf8");
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
const code = error.code;
|
|
34
|
+
if (code === "ENOENT" || code === "EISDIR")
|
|
35
|
+
return null;
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function readMemoryFile(path, type, maxChars) {
|
|
40
|
+
const content = await readUtf8File(path);
|
|
41
|
+
if (content == null)
|
|
42
|
+
return null;
|
|
43
|
+
const trimmed = content.trim();
|
|
44
|
+
if (!trimmed)
|
|
45
|
+
return null;
|
|
46
|
+
return { path, type, content: truncate(trimmed, maxChars) };
|
|
47
|
+
}
|
|
48
|
+
function uniquePaths(paths) {
|
|
49
|
+
const seen = new Set();
|
|
50
|
+
const result = [];
|
|
51
|
+
for (const path of paths) {
|
|
52
|
+
const normalized = resolve(path);
|
|
53
|
+
if (seen.has(normalized))
|
|
54
|
+
continue;
|
|
55
|
+
seen.add(normalized);
|
|
56
|
+
result.push(normalized);
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
function parentDirsFromRoot(cwd) {
|
|
61
|
+
const dirs = [];
|
|
62
|
+
let current = resolve(cwd);
|
|
63
|
+
while (true) {
|
|
64
|
+
dirs.unshift(current);
|
|
65
|
+
const parent = dirname(current);
|
|
66
|
+
if (parent === current)
|
|
67
|
+
break;
|
|
68
|
+
current = parent;
|
|
69
|
+
}
|
|
70
|
+
return dirs;
|
|
71
|
+
}
|
|
72
|
+
async function listRulesFiles(dir) {
|
|
73
|
+
try {
|
|
74
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
75
|
+
return entries
|
|
76
|
+
.filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
|
|
77
|
+
.map((entry) => join(dir, entry.name))
|
|
78
|
+
.sort();
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
const code = error.code;
|
|
82
|
+
if (code === "ENOENT" || code === "ENOTDIR")
|
|
83
|
+
return [];
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export function resolveSpotlightFileMemoryPaths(options) {
|
|
88
|
+
const baseDir = resolveBaseDir(options.baseDir);
|
|
89
|
+
const projectDir = join(baseDir, "projects", sanitizePathSegment(options.projectId));
|
|
90
|
+
const autoDir = join(projectDir, "memory");
|
|
91
|
+
const paths = {
|
|
92
|
+
baseDir,
|
|
93
|
+
projectDir,
|
|
94
|
+
autoDir: normalizeDir(autoDir),
|
|
95
|
+
autoEntrypoint: join(autoDir, FILE_MEMORY_ENTRYPOINT),
|
|
96
|
+
};
|
|
97
|
+
const sessionId = options.sessionId?.trim();
|
|
98
|
+
if (sessionId) {
|
|
99
|
+
const sessionDir = join(projectDir, "sessions", sanitizePathSegment(sessionId), "memory");
|
|
100
|
+
paths.sessionDir = normalizeDir(sessionDir);
|
|
101
|
+
paths.sessionEntrypoint = join(sessionDir, FILE_MEMORY_ENTRYPOINT);
|
|
102
|
+
}
|
|
103
|
+
return paths;
|
|
104
|
+
}
|
|
105
|
+
export function resolveAgentMemoryDir(options) {
|
|
106
|
+
const agentType = sanitizePathSegment(options.agentType);
|
|
107
|
+
if (options.scope === "project") {
|
|
108
|
+
return normalizeDir(join(resolve(options.cwd ?? process.cwd()), ".spotlight", "agent-memory", agentType));
|
|
109
|
+
}
|
|
110
|
+
if (options.scope === "local") {
|
|
111
|
+
return normalizeDir(join(resolve(options.cwd ?? process.cwd()), ".spotlight", "agent-memory-local", agentType));
|
|
112
|
+
}
|
|
113
|
+
return normalizeDir(join(resolveBaseDir(options.baseDir), "agent-memory", agentType));
|
|
114
|
+
}
|
|
115
|
+
export function resolveAgentMemoryEntrypoint(options) {
|
|
116
|
+
return join(resolveAgentMemoryDir(options), FILE_MEMORY_ENTRYPOINT);
|
|
117
|
+
}
|
|
118
|
+
export async function ensureSpotlightFileMemoryEntrypoints(options) {
|
|
119
|
+
const paths = resolveSpotlightFileMemoryPaths(options);
|
|
120
|
+
await mkdir(paths.autoDir, { recursive: true });
|
|
121
|
+
if (!(await readUtf8File(paths.autoEntrypoint))) {
|
|
122
|
+
await writeFile(paths.autoEntrypoint, "", "utf8");
|
|
123
|
+
}
|
|
124
|
+
if (paths.sessionDir && paths.sessionEntrypoint) {
|
|
125
|
+
await mkdir(paths.sessionDir, { recursive: true });
|
|
126
|
+
if (!(await readUtf8File(paths.sessionEntrypoint))) {
|
|
127
|
+
await writeFile(paths.sessionEntrypoint, "", "utf8");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return paths;
|
|
131
|
+
}
|
|
132
|
+
export async function appendSpotlightFileMemory(options) {
|
|
133
|
+
const content = options.content.trim();
|
|
134
|
+
if (!content)
|
|
135
|
+
return;
|
|
136
|
+
await mkdir(dirname(options.filePath), { recursive: true });
|
|
137
|
+
const existing = (await readUtf8File(options.filePath)) ?? "";
|
|
138
|
+
const heading = options.heading?.trim();
|
|
139
|
+
const next = [
|
|
140
|
+
existing.trimEnd(),
|
|
141
|
+
heading ? `\n\n## ${heading}` : "",
|
|
142
|
+
`\n\n${content}`,
|
|
143
|
+
"\n",
|
|
144
|
+
]
|
|
145
|
+
.join("")
|
|
146
|
+
.replace(/^\n+/, "");
|
|
147
|
+
await writeFile(options.filePath, next, "utf8");
|
|
148
|
+
}
|
|
149
|
+
export async function loadSpotlightFileMemories(options) {
|
|
150
|
+
const maxFileChars = options.maxFileChars ?? 8_000;
|
|
151
|
+
const paths = resolveSpotlightFileMemoryPaths(options);
|
|
152
|
+
const candidates = [];
|
|
153
|
+
if (options.includeProjectFiles !== false) {
|
|
154
|
+
const cwd = resolve(options.cwd ?? process.cwd());
|
|
155
|
+
const homeMemory = join(resolveBaseDir(options.baseDir), FILE_MEMORY_ENTRYPOINT);
|
|
156
|
+
candidates.push({ path: homeMemory, type: "user" });
|
|
157
|
+
for (const dir of parentDirsFromRoot(cwd)) {
|
|
158
|
+
candidates.push({ path: join(dir, "CLAUDE.md"), type: "project" });
|
|
159
|
+
candidates.push({ path: join(dir, "SPOTLIGHT.md"), type: "project" });
|
|
160
|
+
candidates.push({ path: join(dir, ".claude", "CLAUDE.md"), type: "project" });
|
|
161
|
+
candidates.push({ path: join(dir, ".spotlight", FILE_MEMORY_ENTRYPOINT), type: "project" });
|
|
162
|
+
for (const rulesFile of await listRulesFiles(join(dir, ".claude", "rules"))) {
|
|
163
|
+
candidates.push({ path: rulesFile, type: "project" });
|
|
164
|
+
}
|
|
165
|
+
candidates.push({ path: join(dir, "CLAUDE.local.md"), type: "local" });
|
|
166
|
+
candidates.push({ path: join(dir, "SPOTLIGHT.local.md"), type: "local" });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (options.includeAutoMemory !== false) {
|
|
170
|
+
candidates.push({ path: paths.autoEntrypoint, type: "auto" });
|
|
171
|
+
}
|
|
172
|
+
if (options.includeSessionMemory !== false &&
|
|
173
|
+
paths.sessionEntrypoint &&
|
|
174
|
+
paths.sessionDir) {
|
|
175
|
+
candidates.push({ path: paths.sessionEntrypoint, type: "session" });
|
|
176
|
+
}
|
|
177
|
+
if (options.agent) {
|
|
178
|
+
const agentPath = resolveAgentMemoryEntrypoint({
|
|
179
|
+
projectId: options.projectId,
|
|
180
|
+
agentType: options.agent.type,
|
|
181
|
+
scope: options.agent.scope,
|
|
182
|
+
baseDir: options.baseDir,
|
|
183
|
+
cwd: options.cwd,
|
|
184
|
+
});
|
|
185
|
+
const type = options.agent.scope === "user"
|
|
186
|
+
? "agent-user"
|
|
187
|
+
: options.agent.scope === "project"
|
|
188
|
+
? "agent-project"
|
|
189
|
+
: "agent-local";
|
|
190
|
+
candidates.push({ path: agentPath, type });
|
|
191
|
+
}
|
|
192
|
+
const result = [];
|
|
193
|
+
for (const path of uniquePaths(candidates.map((item) => item.path))) {
|
|
194
|
+
const candidate = candidates.find((item) => resolve(item.path) === path);
|
|
195
|
+
if (!candidate)
|
|
196
|
+
continue;
|
|
197
|
+
const memory = await readMemoryFile(path, candidate.type, maxFileChars);
|
|
198
|
+
if (memory)
|
|
199
|
+
result.push(memory);
|
|
200
|
+
}
|
|
201
|
+
return result;
|
|
202
|
+
}
|
|
203
|
+
function typeLabel(type) {
|
|
204
|
+
switch (type) {
|
|
205
|
+
case "managed":
|
|
206
|
+
return "Managed";
|
|
207
|
+
case "user":
|
|
208
|
+
return "User";
|
|
209
|
+
case "project":
|
|
210
|
+
return "Project";
|
|
211
|
+
case "local":
|
|
212
|
+
return "Local";
|
|
213
|
+
case "auto":
|
|
214
|
+
return "Auto";
|
|
215
|
+
case "agent-user":
|
|
216
|
+
return "Agent/User";
|
|
217
|
+
case "agent-project":
|
|
218
|
+
return "Agent/Project";
|
|
219
|
+
case "agent-local":
|
|
220
|
+
return "Agent/Local";
|
|
221
|
+
case "session":
|
|
222
|
+
return "Session";
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
export async function buildSpotlightFileMemoryPrompt(options) {
|
|
226
|
+
const maxTotalChars = options.maxTotalChars ?? 24_000;
|
|
227
|
+
const memories = await loadSpotlightFileMemories(options);
|
|
228
|
+
if (memories.length === 0) {
|
|
229
|
+
return options.emptyText ?? "";
|
|
230
|
+
}
|
|
231
|
+
const body = memories
|
|
232
|
+
.map((memory) => `### ${typeLabel(memory.type)} Memory\nPath: ${memory.path}\n\n${memory.content}`)
|
|
233
|
+
.join("\n\n");
|
|
234
|
+
return truncate([
|
|
235
|
+
"【长期记忆】",
|
|
236
|
+
"下面内容来自 Spotlight 的持久文件记忆系统。它们是项目规则、用户偏好、agent 经验与会话摘要,不是用户当前这句话本身。",
|
|
237
|
+
"使用原则:",
|
|
238
|
+
"- 与用户当前请求冲突时,以当前请求为准。",
|
|
239
|
+
"- 不要凭记忆编造实时数据;实时状态必须调用工具确认。",
|
|
240
|
+
"- 当用户明确要求记住偏好、事实或项目约定时,应写入对应 memory 文件,而不是只放在本轮回答里。",
|
|
241
|
+
"",
|
|
242
|
+
body,
|
|
243
|
+
].join("\n"), maxTotalChars);
|
|
244
|
+
}
|
|
245
|
+
export function isSpotlightFileMemoryPath(absolutePath, options) {
|
|
246
|
+
if (!isAbsolute(absolutePath))
|
|
247
|
+
return false;
|
|
248
|
+
const paths = resolveSpotlightFileMemoryPaths(options);
|
|
249
|
+
const normalized = resolve(absolutePath);
|
|
250
|
+
return (normalized.startsWith(paths.autoDir) ||
|
|
251
|
+
Boolean(paths.sessionDir && normalized.startsWith(paths.sessionDir)));
|
|
252
|
+
}
|
package/dist/node/index.d.ts
CHANGED
|
@@ -22,4 +22,5 @@ export { createMemoryGate, type MemoryGate, type MemoryGateConfig, type MemorySt
|
|
|
22
22
|
export { defaultPackMemoryMeta, resolvePackMemoryDir, type PackMemoryMeta, type PackMemoryPaths, } from "./paths.js";
|
|
23
23
|
export { readPackMemoryMeta, refreshPackMemoryMeta, writePackMemoryMeta, } from "./meta.js";
|
|
24
24
|
export { type EmbeddingProvider, resolveEmbeddingProviderFromEnv, } from "./embeddingProvider.js";
|
|
25
|
+
export { FILE_MEMORY_ENTRYPOINT, appendSpotlightFileMemory, buildSpotlightFileMemoryPrompt, ensureSpotlightFileMemoryEntrypoints, isSpotlightFileMemoryPath, loadSpotlightFileMemories, resolveAgentMemoryDir, resolveAgentMemoryEntrypoint, resolveSpotlightFileMemoryPaths, type BuildSpotlightFileMemoryPromptOptions, type LoadSpotlightFileMemoryOptions, type ResolveSpotlightFileMemoryPathsOptions, type SpotlightFileMemoryInfo, type SpotlightFileMemoryPaths, type SpotlightFileMemoryScope, } from "./fileMemory.js";
|
|
25
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,IAAI,EAAE,UAAU,CAAC;CAClB;AAgCD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,gBAAgB,CAiBnB;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,aAAa,EACb,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,K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gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,iBAAiB,EACtB,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,EAC9B,oCAAoC,EACpC,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,4BAA4B,EAC5B,+BAA+B,EAC/B,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EACnC,KAAK,sCAAsC,EAC3C,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,iBAAiB,CAAC"}
|
package/dist/node/index.js
CHANGED
|
@@ -46,3 +46,4 @@ export { createMemoryGate, } from "./gate.js";
|
|
|
46
46
|
export { defaultPackMemoryMeta, resolvePackMemoryDir, } from "./paths.js";
|
|
47
47
|
export { readPackMemoryMeta, refreshPackMemoryMeta, writePackMemoryMeta, } from "./meta.js";
|
|
48
48
|
export { resolveEmbeddingProviderFromEnv, } from "./embeddingProvider.js";
|
|
49
|
+
export { FILE_MEMORY_ENTRYPOINT, appendSpotlightFileMemory, buildSpotlightFileMemoryPrompt, ensureSpotlightFileMemoryEntrypoints, isSpotlightFileMemoryPath, loadSpotlightFileMemories, resolveAgentMemoryDir, resolveAgentMemoryEntrypoint, resolveSpotlightFileMemoryPaths, } from "./fileMemory.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inupedia/spotlight-memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Memory Gate, exact/semantic cache stores for Inupedia Spotlight",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@inupedia/spotlight-protocol": "0.1.
|
|
27
|
+
"@inupedia/spotlight-protocol": "0.1.8"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^22.10.0",
|