@loreai/core 0.16.0 → 0.17.1
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/README.md +11 -0
- package/dist/bun/agents-file.d.ts +13 -1
- package/dist/bun/agents-file.d.ts.map +1 -1
- package/dist/bun/config.d.ts +20 -1
- package/dist/bun/config.d.ts.map +1 -1
- package/dist/bun/data.d.ts +174 -0
- package/dist/bun/data.d.ts.map +1 -0
- package/dist/bun/db.d.ts +65 -0
- package/dist/bun/db.d.ts.map +1 -1
- package/dist/bun/distillation.d.ts +49 -6
- package/dist/bun/distillation.d.ts.map +1 -1
- package/dist/bun/embedding-vendor.d.ts +66 -0
- package/dist/bun/embedding-vendor.d.ts.map +1 -0
- package/dist/bun/embedding-worker-types.d.ts +66 -0
- package/dist/bun/embedding-worker-types.d.ts.map +1 -0
- package/dist/bun/embedding-worker.d.ts +16 -0
- package/dist/bun/embedding-worker.d.ts.map +1 -0
- package/dist/bun/embedding-worker.js +100 -0
- package/dist/bun/embedding-worker.js.map +7 -0
- package/dist/bun/embedding.d.ts +91 -8
- package/dist/bun/embedding.d.ts.map +1 -1
- package/dist/bun/git.d.ts +47 -0
- package/dist/bun/git.d.ts.map +1 -0
- package/dist/bun/gradient.d.ts +19 -1
- package/dist/bun/gradient.d.ts.map +1 -1
- package/dist/bun/index.d.ts +9 -6
- package/dist/bun/index.d.ts.map +1 -1
- package/dist/bun/index.js +13029 -10885
- package/dist/bun/index.js.map +4 -4
- package/dist/bun/lat-reader.d.ts +1 -1
- package/dist/bun/lat-reader.d.ts.map +1 -1
- package/dist/bun/ltm.d.ts.map +1 -1
- package/dist/bun/markdown.d.ts +11 -0
- package/dist/bun/markdown.d.ts.map +1 -1
- package/dist/bun/prompt.d.ts +1 -1
- package/dist/bun/prompt.d.ts.map +1 -1
- package/dist/bun/recall.d.ts +53 -0
- package/dist/bun/recall.d.ts.map +1 -1
- package/dist/bun/search.d.ts +29 -0
- package/dist/bun/search.d.ts.map +1 -1
- package/dist/bun/temporal.d.ts +2 -0
- package/dist/bun/temporal.d.ts.map +1 -1
- package/dist/bun/types.d.ts +15 -0
- package/dist/bun/types.d.ts.map +1 -1
- package/dist/bun/worker-model.d.ts +12 -9
- package/dist/bun/worker-model.d.ts.map +1 -1
- package/dist/node/agents-file.d.ts +13 -1
- package/dist/node/agents-file.d.ts.map +1 -1
- package/dist/node/config.d.ts +20 -1
- package/dist/node/config.d.ts.map +1 -1
- package/dist/node/data.d.ts +174 -0
- package/dist/node/data.d.ts.map +1 -0
- package/dist/node/db.d.ts +65 -0
- package/dist/node/db.d.ts.map +1 -1
- package/dist/node/distillation.d.ts +49 -6
- package/dist/node/distillation.d.ts.map +1 -1
- package/dist/node/embedding-vendor.d.ts +66 -0
- package/dist/node/embedding-vendor.d.ts.map +1 -0
- package/dist/node/embedding-worker-types.d.ts +66 -0
- package/dist/node/embedding-worker-types.d.ts.map +1 -0
- package/dist/node/embedding-worker.d.ts +16 -0
- package/dist/node/embedding-worker.d.ts.map +1 -0
- package/dist/node/embedding-worker.js +100 -0
- package/dist/node/embedding-worker.js.map +7 -0
- package/dist/node/embedding.d.ts +91 -8
- package/dist/node/embedding.d.ts.map +1 -1
- package/dist/node/git.d.ts +47 -0
- package/dist/node/git.d.ts.map +1 -0
- package/dist/node/gradient.d.ts +19 -1
- package/dist/node/gradient.d.ts.map +1 -1
- package/dist/node/index.d.ts +9 -6
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +13029 -10885
- package/dist/node/index.js.map +4 -4
- package/dist/node/lat-reader.d.ts +1 -1
- package/dist/node/lat-reader.d.ts.map +1 -1
- package/dist/node/ltm.d.ts.map +1 -1
- package/dist/node/markdown.d.ts +11 -0
- package/dist/node/markdown.d.ts.map +1 -1
- package/dist/node/prompt.d.ts +1 -1
- package/dist/node/prompt.d.ts.map +1 -1
- package/dist/node/recall.d.ts +53 -0
- package/dist/node/recall.d.ts.map +1 -1
- package/dist/node/search.d.ts +29 -0
- package/dist/node/search.d.ts.map +1 -1
- package/dist/node/temporal.d.ts +2 -0
- package/dist/node/temporal.d.ts.map +1 -1
- package/dist/node/types.d.ts +15 -0
- package/dist/node/types.d.ts.map +1 -1
- package/dist/node/worker-model.d.ts +12 -9
- package/dist/node/worker-model.d.ts.map +1 -1
- package/dist/types/agents-file.d.ts +13 -1
- package/dist/types/agents-file.d.ts.map +1 -1
- package/dist/types/config.d.ts +20 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/data.d.ts +174 -0
- package/dist/types/data.d.ts.map +1 -0
- package/dist/types/db.d.ts +65 -0
- package/dist/types/db.d.ts.map +1 -1
- package/dist/types/distillation.d.ts +49 -6
- package/dist/types/distillation.d.ts.map +1 -1
- package/dist/types/embedding-vendor.d.ts +66 -0
- package/dist/types/embedding-vendor.d.ts.map +1 -0
- package/dist/types/embedding-worker-types.d.ts +66 -0
- package/dist/types/embedding-worker-types.d.ts.map +1 -0
- package/dist/types/embedding-worker.d.ts +16 -0
- package/dist/types/embedding-worker.d.ts.map +1 -0
- package/dist/types/embedding.d.ts +91 -8
- package/dist/types/embedding.d.ts.map +1 -1
- package/dist/types/git.d.ts +47 -0
- package/dist/types/git.d.ts.map +1 -0
- package/dist/types/gradient.d.ts +19 -1
- package/dist/types/gradient.d.ts.map +1 -1
- package/dist/types/index.d.ts +9 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lat-reader.d.ts +1 -1
- package/dist/types/lat-reader.d.ts.map +1 -1
- package/dist/types/ltm.d.ts.map +1 -1
- package/dist/types/markdown.d.ts +11 -0
- package/dist/types/markdown.d.ts.map +1 -1
- package/dist/types/prompt.d.ts +1 -1
- package/dist/types/prompt.d.ts.map +1 -1
- package/dist/types/recall.d.ts +53 -0
- package/dist/types/recall.d.ts.map +1 -1
- package/dist/types/search.d.ts +29 -0
- package/dist/types/search.d.ts.map +1 -1
- package/dist/types/temporal.d.ts +2 -0
- package/dist/types/temporal.d.ts.map +1 -1
- package/dist/types/types.d.ts +15 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/worker-model.d.ts +12 -9
- package/dist/types/worker-model.d.ts.map +1 -1
- package/package.json +5 -2
- package/src/agents-file.ts +87 -4
- package/src/config.ts +68 -5
- package/src/curator.ts +2 -2
- package/src/data.ts +768 -0
- package/src/db.ts +386 -7
- package/src/distillation.ts +178 -35
- package/src/embedding-vendor.ts +102 -0
- package/src/embedding-worker-types.ts +82 -0
- package/src/embedding-worker.ts +185 -0
- package/src/embedding.ts +607 -61
- package/src/git.ts +144 -0
- package/src/gradient.ts +174 -17
- package/src/index.ts +20 -0
- package/src/lat-reader.ts +5 -11
- package/src/ltm.ts +17 -44
- package/src/markdown.ts +15 -0
- package/src/prompt.ts +1 -2
- package/src/recall.ts +401 -70
- package/src/search.ts +71 -1
- package/src/temporal.ts +42 -35
- package/src/types.ts +15 -0
- package/src/worker-model.ts +14 -9
package/dist/bun/lat-reader.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export declare function hasLatDir(projectPath: string): boolean;
|
|
|
49
49
|
export declare function refresh(projectPath: string): number;
|
|
50
50
|
/**
|
|
51
51
|
* Search lat sections by FTS5 with BM25 scoring.
|
|
52
|
-
* Uses AND
|
|
52
|
+
* Uses progressive AND relaxation before falling back to OR.
|
|
53
53
|
*/
|
|
54
54
|
export declare function searchScored(input: {
|
|
55
55
|
query: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lat-reader.d.ts","sourceRoot":"","sources":["../../src/lat-reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkBH,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAA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;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAwBhD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAqBtE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAsCtC;AAMD,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,EAAE,CA8E3D"}
|
package/dist/bun/markdown.d.ts
CHANGED
|
@@ -34,4 +34,15 @@ export declare function liph(...children: PhrasingContent[]): ListItem;
|
|
|
34
34
|
export declare function t(value: string): Text;
|
|
35
35
|
export declare function strong(value: string): Strong;
|
|
36
36
|
export declare function root(...children: Root["children"]): Root;
|
|
37
|
+
/**
|
|
38
|
+
* Render a markdown string to sanitized HTML.
|
|
39
|
+
*
|
|
40
|
+
* Uses micromark with default options:
|
|
41
|
+
* - Raw HTML in input is escaped (no allowDangerousHtml)
|
|
42
|
+
* - Only safe URL protocols are permitted (no allowDangerousProtocol)
|
|
43
|
+
*
|
|
44
|
+
* The output is safe to embed directly in an HTML page without
|
|
45
|
+
* additional escaping.
|
|
46
|
+
*/
|
|
47
|
+
export declare function renderMarkdown(md: string): string;
|
|
37
48
|
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/markdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/markdown.ts"],"names":[],"mappings":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GASG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
package/dist/bun/prompt.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare function formatDistillations(distillations: Array<{
|
|
|
38
38
|
observations: string;
|
|
39
39
|
generation: number;
|
|
40
40
|
}>): string;
|
|
41
|
-
export declare const COMPACT_SUMMARY_TEMPLATE = "Output exactly this Markdown structure. Keep every section in this order, even when empty (use \"(none)\").\n\n---\n## Goal\n- [single-sentence task summary]\n\n## Constraints & Preferences\n- [user constraints, preferences, specs, or \"(none)\"]\n\n## Progress\n### Done\n- [completed work or \"(none)\"]\n\n### In Progress\n- [current work or \"(none)\"]\n\n### Blocked\n- [blockers or \"(none)\"]\n\n## Key Decisions\n- [decision and why, or \"(none)\"]\n\n## Next Steps\n- [ordered next actions or \"(none)\"]\n\n## Critical Context\n- [important technical facts, errors, open questions, or \"(none)\"]\n\n## Relevant Files\n- [file or directory path: why it matters, or \"(none)\"]\n---\n\nRules:\n- Keep every section, even when empty.\n- Use terse bullets, not prose paragraphs.\n- Preserve exact file paths, commands, error strings, and identifiers when known.\n- Do not mention the summary process or that context was compacted
|
|
41
|
+
export declare const COMPACT_SUMMARY_TEMPLATE = "Output exactly this Markdown structure. Keep every section in this order, even when empty (use \"(none)\").\n\n---\n## Goal\n- [single-sentence task summary]\n\n## Constraints & Preferences\n- [user constraints, preferences, specs, or \"(none)\"]\n\n## Progress\n### Done\n- [completed work or \"(none)\"]\n\n### In Progress\n- [current work or \"(none)\"]\n\n### Blocked\n- [blockers or \"(none)\"]\n\n## Key Decisions\n- [decision and why, or \"(none)\"]\n\n## Next Steps\n- [ordered next actions or \"(none)\"]\n\n## Critical Context\n- [important technical facts, errors, open questions, or \"(none)\"]\n\n## Relevant Files\n- [file or directory path: why it matters, or \"(none)\"]\n---\n\nRules:\n- Keep every section, even when empty.\n- Use terse bullets, not prose paragraphs.\n- Preserve exact file paths, commands, error strings, and identifiers when known.\n- Do not mention the summary process or that context was compacted.";
|
|
42
42
|
export declare function buildCompactPrompt(input: {
|
|
43
43
|
hasDistillations: boolean;
|
|
44
44
|
knowledge?: string;
|
package/dist/bun/prompt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,s1OAmHhB,CAAC;AAEjB,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAaT;AAUD,eAAO,MAAM,gBAAgB,mkGAsC2C,CAAC;AAEzE,wBAAgB,aAAa,CAC3B,aAAa,EAAE,KAAK,CAAC;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,EAC9C,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAoBR;AAED,eAAO,MAAM,cAAc,i5HA0E8C,CAAC;AAE1E,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;CACJ,GAAG,MAAM,CAoBT;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,uoDA0BwC,CAAC;AAE1E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,OAAO,EAAE,KAAK,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,SAAS,EAAE,MAAM,CAAC;CACnB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C;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,MAAM,CAUT;AAID,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,KAAK,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,GACD,MAAM,CAsBR;AAQD,eAAO,MAAM,wBAAwB,86BAoC+B,CAAC;AAqBrE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,MAAM,CAeT;AAOD,wBAAgB,eAAe,CAC7B,OAAO,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,EACpE,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAwCR;AAMD,eAAO,MAAM,sBAAsB,ggBASwE,CAAC"}
|
package/dist/bun/recall.d.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recall — unified search across Lore's memory sources.
|
|
3
|
+
*
|
|
4
|
+
* Pure search + result-formatting logic shared by every host's recall tool.
|
|
5
|
+
* Hosts (OpenCode plugin, Pi extension, future ACP server) wrap `runRecall()`
|
|
6
|
+
* in their tool-registration mechanism:
|
|
7
|
+
* - OpenCode: `tool()` from `@opencode-ai/plugin/tool`
|
|
8
|
+
* - Pi: `pi.registerTool()` with TypeBox schema
|
|
9
|
+
*
|
|
10
|
+
* Behavior is identical across hosts so curated knowledge travels with the user.
|
|
11
|
+
*/
|
|
12
|
+
import * as latReader from "./lat-reader";
|
|
13
|
+
import * as ltm from "./ltm";
|
|
14
|
+
import * as temporal from "./temporal";
|
|
1
15
|
import type { LoreConfig } from "./config";
|
|
2
16
|
import type { LLMClient } from "./types";
|
|
3
17
|
type Distillation = {
|
|
@@ -16,6 +30,8 @@ export type RecallInput = {
|
|
|
16
30
|
query: string;
|
|
17
31
|
/** Narrow the search surface. Defaults to `"all"`. */
|
|
18
32
|
scope?: RecallScope;
|
|
33
|
+
/** Fetch full content of a specific result by its source-prefixed ID (e.g. "k:xxx", "d:xxx"). */
|
|
34
|
+
id?: string;
|
|
19
35
|
/** Project root — used by all scoring paths. */
|
|
20
36
|
projectPath: string;
|
|
21
37
|
/** Current session ID — required when `scope === "session"`. */
|
|
@@ -29,6 +45,42 @@ export type RecallInput = {
|
|
|
29
45
|
};
|
|
30
46
|
/** Result of a full recall run — markdown-formatted string for the LLM. */
|
|
31
47
|
export type RecallResult = string;
|
|
48
|
+
export type TaggedResult = {
|
|
49
|
+
source: "knowledge";
|
|
50
|
+
item: ltm.ScoredKnowledgeEntry;
|
|
51
|
+
} | {
|
|
52
|
+
source: "cross-knowledge";
|
|
53
|
+
item: ltm.ScoredKnowledgeEntry;
|
|
54
|
+
projectLabel: string;
|
|
55
|
+
} | {
|
|
56
|
+
source: "distillation";
|
|
57
|
+
item: ScoredDistillation;
|
|
58
|
+
} | {
|
|
59
|
+
source: "temporal";
|
|
60
|
+
item: temporal.ScoredTemporalMessage;
|
|
61
|
+
} | {
|
|
62
|
+
source: "lat-section";
|
|
63
|
+
item: latReader.ScoredLatSection;
|
|
64
|
+
};
|
|
65
|
+
export type ScoredTaggedResult = {
|
|
66
|
+
item: TaggedResult;
|
|
67
|
+
score: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Search every relevant source, fuse with RRF, and return raw scored results.
|
|
71
|
+
*
|
|
72
|
+
* This is the search+fusion core shared by `runRecall()` (LLM-formatted) and
|
|
73
|
+
* direct consumers like the web UI that need access to the raw result items.
|
|
74
|
+
*/
|
|
75
|
+
export declare function searchRecall(input: RecallInput): Promise<ScoredTaggedResult[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Fetch the full content of a single result by its source-prefixed ID.
|
|
78
|
+
*
|
|
79
|
+
* IDs use the format `prefix:uuid` where prefix is one of:
|
|
80
|
+
* k: (knowledge), xk: (cross-knowledge), d: (distillation),
|
|
81
|
+
* t: (temporal), lat: (lat-section).
|
|
82
|
+
*/
|
|
83
|
+
export declare function recallById(id: string): string;
|
|
32
84
|
/** Full recall run: search every relevant source, fuse with RRF, format as markdown. */
|
|
33
85
|
export declare function runRecall(input: RecallInput): Promise<RecallResult>;
|
|
34
86
|
/** Standard tool description reused verbatim by each host adapter. */
|
|
@@ -37,6 +89,7 @@ export declare const RECALL_TOOL_DESCRIPTION = "Search your persistent memory fo
|
|
|
37
89
|
export declare const RECALL_PARAM_DESCRIPTIONS: {
|
|
38
90
|
query: string;
|
|
39
91
|
scope: string;
|
|
92
|
+
id: string;
|
|
40
93
|
};
|
|
41
94
|
export {};
|
|
42
95
|
//# sourceMappingURL=recall.d.ts.map
|
package/dist/bun/recall.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recall.d.ts","sourceRoot":"","sources":["../../src/recall.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"recall.d.ts","sourceRoot":"","sources":["../../src/recall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAIvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAgBzC,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;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AC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA0WvE;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA4V/B;AAMD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAoE7C;AAED,wFAAwF;AACxF,wBAAsB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAmBzE;AAED,sEAAsE;AACtE,eAAO,MAAM,uBAAuB,wiBAC8f,CAAC;AAEniB,mEAAmE;AACnE,eAAO,MAAM,yBAAyB;;;;CAKrC,CAAC"}
|
package/dist/bun/search.d.ts
CHANGED
|
@@ -51,6 +51,35 @@ export declare function ftsQuery(raw: string): string;
|
|
|
51
51
|
* Used as fallback when AND returns zero results.
|
|
52
52
|
*/
|
|
53
53
|
export declare function ftsQueryOr(raw: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Build a cascade of progressively relaxed FTS5 queries.
|
|
56
|
+
*
|
|
57
|
+
* For N terms, produces up to (N - minTerms) queries, each dropping one more
|
|
58
|
+
* term (least significant first — shortest terms dropped first as a rough
|
|
59
|
+
* proxy for specificity). The final entry is always the full OR query.
|
|
60
|
+
*
|
|
61
|
+
* Example for 6 terms with minTerms=3:
|
|
62
|
+
* [0] 5-of-6 AND (drop shortest term)
|
|
63
|
+
* [1] 4-of-6 AND
|
|
64
|
+
* [2] 3-of-6 AND
|
|
65
|
+
* [3] full OR (all 6 terms)
|
|
66
|
+
*
|
|
67
|
+
* For ≤ minTerms terms, returns just the OR query (no intermediate steps).
|
|
68
|
+
* Callers should try each query in order, stopping at the first that returns
|
|
69
|
+
* results. This avoids the AND→OR cliff that produces massive low-quality
|
|
70
|
+
* result sets.
|
|
71
|
+
*/
|
|
72
|
+
export declare function ftsQueryRelaxed(raw: string, minTerms?: number): string[];
|
|
73
|
+
/**
|
|
74
|
+
* Run a search function through the relaxed cascade, stopping at the first
|
|
75
|
+
* query that produces results. Falls back through progressively looser AND
|
|
76
|
+
* queries before trying full OR.
|
|
77
|
+
*
|
|
78
|
+
* @param raw The original query string
|
|
79
|
+
* @param runner A function that takes an FTS5 MATCH expression and returns results
|
|
80
|
+
* @returns The results from the first cascade step that produced matches
|
|
81
|
+
*/
|
|
82
|
+
export declare function runRelaxedSearch<T>(raw: string, runner: (matchExpr: string) => T[]): T[];
|
|
54
83
|
/**
|
|
55
84
|
* Extract the top meaningful terms from text, sorted by frequency.
|
|
56
85
|
*
|
package/dist/bun/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/search.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,MAAM,CAmGxC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAO,CAAC;AAEhC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CASjD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI5C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI9C;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,MAAM,EAAE,CAelE;AAMD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,MAAM,CAMR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,KAAK,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,CAAC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M,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAqCnB"}
|
package/dist/bun/temporal.d.ts
CHANGED
|
@@ -85,6 +85,8 @@ export declare function searchScored(input: {
|
|
|
85
85
|
export declare function temporalCnorm(timestamps: number[], now?: number): number;
|
|
86
86
|
export declare function count(projectPath: string, sessionID?: string): number;
|
|
87
87
|
export declare function undistilledCount(projectPath: string, sessionID?: string): number;
|
|
88
|
+
/** Sum of estimated tokens across undistilled messages for a project/session. */
|
|
89
|
+
export declare function undistilledTokens(projectPath: string, sessionID?: string): number;
|
|
88
90
|
export type PruneResult = {
|
|
89
91
|
/** Rows deleted by the TTL pass (distilled=1 AND older than retention period). */
|
|
90
92
|
ttlDeleted: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temporal.d.ts","sourceRoot":"","sources":["../../src/temporal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"temporal.d.ts","sourceRoot":"","sources":["../../src/temporal.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQrD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,WAAS,CAAC;AAEvC;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,CAarD;AAiBD,wBAAgB,KAAK,CAAC,KAAK,EAAE;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,QA8CA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,M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AE,MAAM,GACjB,MAAM,CAWR;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,WAAW,CA0Ed"}
|
package/dist/bun/types.d.ts
CHANGED
|
@@ -226,6 +226,21 @@ export interface LLMClient {
|
|
|
226
226
|
* auth through their own mechanisms.
|
|
227
227
|
*/
|
|
228
228
|
sessionID?: string;
|
|
229
|
+
/**
|
|
230
|
+
* Maximum output tokens for this call. When absent, the adapter
|
|
231
|
+
* uses its built-in default (typically 8192).
|
|
232
|
+
*
|
|
233
|
+
* Worker call sites should set this explicitly based on expected
|
|
234
|
+
* output size to avoid wasting tokens on unnecessarily large
|
|
235
|
+
* output budgets.
|
|
236
|
+
*
|
|
237
|
+
* Adapter behavior:
|
|
238
|
+
* - Gateway: uses as `max_tokens` in the API request body
|
|
239
|
+
* - Pi: passes as `maxTokens` to `complete()`
|
|
240
|
+
* - OpenCode: cannot honor — SDK has no maxTokens on session.prompt();
|
|
241
|
+
* the field is silently ignored
|
|
242
|
+
*/
|
|
243
|
+
maxTokens?: number;
|
|
229
244
|
}): Promise<string | null>;
|
|
230
245
|
}
|
|
231
246
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/bun/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MA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C;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC;AAMF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;OAOG;IACH,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE;QACL,oCAAoC;QACpC,KAAK,CAAC,EAAE;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;QAChD;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;;;;;;;;;;WAYG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB;;;;;;;;;;;;;WAaG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB;;;;;;;;;WASG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB;;;;;;;;;;;;;WAaG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GACA,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC3B"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Worker model resolution.
|
|
3
3
|
*
|
|
4
|
-
* Background workers (distillation, curation, query expansion)
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Background workers (distillation, curation, query expansion) default to
|
|
5
|
+
* sonnet-4-6 when the session model is more expensive ($1.50+/M input).
|
|
6
|
+
* Sonnet-4-6 produces equivalent-quality distillations at lower cost.
|
|
7
|
+
* An explicit `workerModel` config override takes priority over this default.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* gap on complex conversations wasn't worth the infrastructure cost.
|
|
9
|
+
* Resolution order:
|
|
10
|
+
* 1. Explicit config override (`workerModel`)
|
|
11
|
+
* 2. Cost-aware default (sonnet-4 for expensive session models)
|
|
12
|
+
* 3. Session model fallback (same model as the conversation)
|
|
13
13
|
*/
|
|
14
14
|
/** Minimal model info — kept for downstream consumers. */
|
|
15
15
|
export type ModelInfo = {
|
|
@@ -29,7 +29,7 @@ export type ModelInfo = {
|
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* Resolve the effective worker model for a given provider.
|
|
32
|
-
* Priority: explicit config override > session model
|
|
32
|
+
* Priority: explicit config override > cost-aware default > session model.
|
|
33
33
|
*/
|
|
34
34
|
export declare function resolveWorkerModel(_providerID: string, configWorkerModel?: {
|
|
35
35
|
providerID: string;
|
|
@@ -37,6 +37,9 @@ export declare function resolveWorkerModel(_providerID: string, configWorkerMode
|
|
|
37
37
|
}, configModel?: {
|
|
38
38
|
providerID: string;
|
|
39
39
|
modelID: string;
|
|
40
|
+
}, costAwareDefault?: {
|
|
41
|
+
providerID: string;
|
|
42
|
+
modelID: string;
|
|
40
43
|
}): {
|
|
41
44
|
providerID: string;
|
|
42
45
|
modelID: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-model.d.ts","sourceRoot":"","sources":["../../src/worker-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,0DAA0D;AAC1D,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE;QACZ,KAAK,EAAE;YAAE,IAAI,EAAE,OAAO,CAAA;SAAE,CAAC;QACzB,+DAA+D;QAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;CACH,CAAC;AAMF;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,iBAAiB,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAC3D,WAAW,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"worker-model.d.ts","sourceRoot":"","sources":["../../src/worker-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,0DAA0D;AAC1D,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE;QACZ,KAAK,EAAE;YAAE,IAAI,EAAE,OAAO,CAAA;SAAE,CAAC;QACzB,+DAA+D;QAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;CACH,CAAC;AAMF;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,iBAAiB,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAC3D,WAAW,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EACrD,gBAAgB,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAUrD"}
|
|
@@ -15,6 +15,11 @@ export declare const LORE_SECTION_END = "<!-- End lore-managed section -->";
|
|
|
15
15
|
* by lore — no section markers needed, no non-lore content to preserve.
|
|
16
16
|
*/
|
|
17
17
|
export declare const LORE_FILE = ".lore.md";
|
|
18
|
+
/**
|
|
19
|
+
* Clear the cached mtime/hash for a project's `.lore.md`.
|
|
20
|
+
* Useful in tests or after data wipes to force a full re-check.
|
|
21
|
+
*/
|
|
22
|
+
export declare function clearLoreFileCache(projectPath: string): void;
|
|
18
23
|
export type ParsedFileEntry = {
|
|
19
24
|
/** UUID from `<!-- lore:UUID -->` marker, or null for hand-written entries. */
|
|
20
25
|
id: string | null;
|
|
@@ -65,11 +70,18 @@ export declare function loreFileExists(projectPath: string): boolean;
|
|
|
65
70
|
/**
|
|
66
71
|
* Export current knowledge entries to `.lore.md` in the project root.
|
|
67
72
|
* The entire file is lore-owned — no section markers, no content to preserve.
|
|
73
|
+
*
|
|
74
|
+
* Skips the write if the content hash matches the cached hash (DB state
|
|
75
|
+
* unchanged since last export), avoiding unnecessary filesystem writes
|
|
76
|
+
* and mtime bumps.
|
|
68
77
|
*/
|
|
69
78
|
export declare function exportLoreFile(projectPath: string): void;
|
|
70
79
|
/**
|
|
71
80
|
* Returns true if `.lore.md` needs to be imported:
|
|
72
|
-
* - File exists and its content differs from what lore would currently produce
|
|
81
|
+
* - File exists and its content differs from what lore would currently produce.
|
|
82
|
+
*
|
|
83
|
+
* Uses an mtime + content-hash cache to skip the expensive buildSection()
|
|
84
|
+
* call when the file hasn't been touched since we last processed it.
|
|
73
85
|
*/
|
|
74
86
|
export declare function shouldImportLoreFile(projectPath: string): boolean;
|
|
75
87
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-file.d.ts","sourceRoot":"","sources":["../../src/agents-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"agents-file.d.ts","sourceRoot":"","sources":["../../src/agents-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH,eAAO,MAAM,kBAAkB,qGACqE,CAAC;AACrG,eAAO,MAAM,gBAAgB,sCAAsC,CAAC;AAepE;;;;GAIG;AACH,eAAO,MAAM,SAAS,aAAa,CAAC;AA8CpC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAI5D;AAMD,MAAM,MAAM,eAAe,GAAG;IAC5B,+EAA+E;IAC/E,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA+EF;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,EAAE,CAgD1E;AAmFD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CA8BP;AAMD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAcV;AAsED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAeP;AAMD;;GAEG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAiBxD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAwBjE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CASxD"}
|
package/dist/node/config.d.ts
CHANGED
|
@@ -15,11 +15,14 @@ export declare const LoreConfig: z.ZodObject<{
|
|
|
15
15
|
ltm: z.ZodDefault<z.ZodNumber>;
|
|
16
16
|
targetCacheReadCostPerTurn: z.ZodDefault<z.ZodNumber>;
|
|
17
17
|
maxLayer0Tokens: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
targetBustCost: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
maxContextTokens: z.ZodOptional<z.ZodNumber>;
|
|
18
20
|
}, z.core.$strip>>;
|
|
19
21
|
idleResumeMinutes: z.ZodDefault<z.ZodNumber>;
|
|
20
22
|
distillation: z.ZodDefault<z.ZodObject<{
|
|
21
23
|
minMessages: z.ZodDefault<z.ZodNumber>;
|
|
22
|
-
|
|
24
|
+
minSegmentTokens: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
maxSegmentTokens: z.ZodDefault<z.ZodNumber>;
|
|
23
26
|
metaThreshold: z.ZodDefault<z.ZodNumber>;
|
|
24
27
|
toolOutputMaxChars: z.ZodDefault<z.ZodNumber>;
|
|
25
28
|
}, z.core.$strip>>;
|
|
@@ -54,6 +57,22 @@ export declare const LoreConfig: z.ZodObject<{
|
|
|
54
57
|
model: z.ZodDefault<z.ZodString>;
|
|
55
58
|
dimensions: z.ZodDefault<z.ZodNumber>;
|
|
56
59
|
}, z.core.$strip>>;
|
|
60
|
+
recall: z.ZodDefault<z.ZodObject<{
|
|
61
|
+
charBudget: z.ZodDefault<z.ZodNumber>;
|
|
62
|
+
relevanceFloor: z.ZodDefault<z.ZodNumber>;
|
|
63
|
+
maxResults: z.ZodDefault<z.ZodNumber>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
67
|
+
conversationTTL: z.ZodDefault<z.ZodEnum<{
|
|
68
|
+
"5m": "5m";
|
|
69
|
+
"1h": "1h";
|
|
70
|
+
auto: "auto";
|
|
71
|
+
}>>;
|
|
72
|
+
warming: z.ZodDefault<z.ZodObject<{
|
|
73
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
74
|
+
minReturnProbability: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
57
76
|
}, z.core.$strip>>;
|
|
58
77
|
crossProject: z.ZodDefault<z.ZodBoolean>;
|
|
59
78
|
agentsFile: z.ZodDefault<z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiOrB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAIpD,wBAAgB,MAAM,IAAI,UAAU,CAEnC;AAED,wBAAsB,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CASjE"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* data.ts — Data listing, inspection, and deletion for Lore.
|
|
3
|
+
*
|
|
4
|
+
* Provides a unified API for both the CLI (`lore data`) and the web UI
|
|
5
|
+
* (`/ui/`) to browse, search, and delete stored data across all tables.
|
|
6
|
+
*
|
|
7
|
+
* Cross-cutting concerns (e.g. `clearProject` touches knowledge, temporal,
|
|
8
|
+
* distillations, and session_state in one transaction) live here instead of
|
|
9
|
+
* being spread across ltm/temporal/distillation modules.
|
|
10
|
+
*/
|
|
11
|
+
export type ProjectSummary = {
|
|
12
|
+
id: string;
|
|
13
|
+
path: string;
|
|
14
|
+
name: string | null;
|
|
15
|
+
git_remote: string | null;
|
|
16
|
+
created_at: number;
|
|
17
|
+
knowledge_count: number;
|
|
18
|
+
session_count: number;
|
|
19
|
+
message_count: number;
|
|
20
|
+
distillation_count: number;
|
|
21
|
+
};
|
|
22
|
+
export type SessionSummary = {
|
|
23
|
+
session_id: string;
|
|
24
|
+
message_count: number;
|
|
25
|
+
first_message_at: number;
|
|
26
|
+
last_message_at: number;
|
|
27
|
+
distilled_count: number;
|
|
28
|
+
undistilled_count: number;
|
|
29
|
+
distillation_count: number;
|
|
30
|
+
};
|
|
31
|
+
export type DistillationSummary = {
|
|
32
|
+
id: string;
|
|
33
|
+
session_id: string;
|
|
34
|
+
generation: number;
|
|
35
|
+
token_count: number;
|
|
36
|
+
r_compression: number | null;
|
|
37
|
+
c_norm: number | null;
|
|
38
|
+
archived: number;
|
|
39
|
+
created_at: number;
|
|
40
|
+
call_type: string | null;
|
|
41
|
+
};
|
|
42
|
+
export type DistillationDetail = DistillationSummary & {
|
|
43
|
+
project_id: string;
|
|
44
|
+
observations: string;
|
|
45
|
+
source_ids: string;
|
|
46
|
+
};
|
|
47
|
+
export type ClearResult = {
|
|
48
|
+
knowledge_deleted: number;
|
|
49
|
+
temporal_deleted: number;
|
|
50
|
+
distillations_deleted: number;
|
|
51
|
+
sessions_cleared: number;
|
|
52
|
+
};
|
|
53
|
+
export type GlobalStats = {
|
|
54
|
+
project_count: number;
|
|
55
|
+
knowledge_count: number;
|
|
56
|
+
session_count: number;
|
|
57
|
+
message_count: number;
|
|
58
|
+
distillation_count: number;
|
|
59
|
+
db_size_bytes: number;
|
|
60
|
+
};
|
|
61
|
+
/** List all projects with summary counts. */
|
|
62
|
+
export declare function listProjects(): ProjectSummary[];
|
|
63
|
+
/** List distinct sessions for a project, with message/distillation counts. */
|
|
64
|
+
export declare function listSessions(projectPath: string, limit?: number): SessionSummary[];
|
|
65
|
+
/** List distillations for a project (optionally filtered by session). */
|
|
66
|
+
export declare function listDistillations(projectPath: string, opts?: {
|
|
67
|
+
sessionId?: string;
|
|
68
|
+
limit?: number;
|
|
69
|
+
}): DistillationSummary[];
|
|
70
|
+
/** Get a single distillation by ID (or resolved prefix). */
|
|
71
|
+
export declare function getDistillation(id: string): DistillationDetail | null;
|
|
72
|
+
/**
|
|
73
|
+
* Resolve a partial ID prefix to a full ID for a given table.
|
|
74
|
+
* Returns null if 0 or 2+ matches (ambiguous prefix).
|
|
75
|
+
*/
|
|
76
|
+
export declare function resolveId(table: "knowledge" | "distillations", prefix: string): string | null;
|
|
77
|
+
/** Global stats for the dashboard. */
|
|
78
|
+
export declare function globalStats(): GlobalStats;
|
|
79
|
+
/**
|
|
80
|
+
* Count rows that will be affected, for confirmation prompts.
|
|
81
|
+
*/
|
|
82
|
+
export declare function countForProject(projectPath: string): {
|
|
83
|
+
knowledge: number;
|
|
84
|
+
messages: number;
|
|
85
|
+
distillations: number;
|
|
86
|
+
sessions: number;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Clear all data for a project.
|
|
90
|
+
* Deletes: knowledge, temporal_messages, distillations, session_state.
|
|
91
|
+
* Does NOT delete the project row itself (preserves path->id mapping).
|
|
92
|
+
* Regenerates `.lore.md` if the project path exists on disk.
|
|
93
|
+
*/
|
|
94
|
+
export declare function clearProject(projectPath: string): ClearResult;
|
|
95
|
+
/**
|
|
96
|
+
* Fully delete a project: all associated data AND the project row itself.
|
|
97
|
+
* Also removes path aliases pointing to this project.
|
|
98
|
+
*
|
|
99
|
+
* Unlike clearProject(), this does NOT call ensureProject() (avoids
|
|
100
|
+
* re-creating the project) and does NOT regenerate .lore.md.
|
|
101
|
+
*
|
|
102
|
+
* Returns deletion counts, or null if the project ID doesn't exist.
|
|
103
|
+
*/
|
|
104
|
+
export declare function deleteProject(projectId: string): ClearResult | null;
|
|
105
|
+
/** Rename a project. Returns true if the project exists and was renamed. */
|
|
106
|
+
export declare function renameProject(projectId: string, newName: string): boolean;
|
|
107
|
+
/** Clear only knowledge entries for a project. Regenerates .lore.md. */
|
|
108
|
+
export declare function clearKnowledge(projectPath: string): number;
|
|
109
|
+
/** Clear only temporal messages for a project. */
|
|
110
|
+
export declare function clearTemporal(projectPath: string): number;
|
|
111
|
+
/** Clear only distillations for a project. */
|
|
112
|
+
export declare function clearDistillations(projectPath: string): number;
|
|
113
|
+
/** Delete a single knowledge entry. Returns true if found and deleted. */
|
|
114
|
+
export declare function deleteKnowledge(id: string): boolean;
|
|
115
|
+
/** Delete a single distillation. Returns true if found and deleted. */
|
|
116
|
+
export declare function deleteDistillation(id: string): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Delete all data for a specific session (messages + distillations + session_state).
|
|
119
|
+
*/
|
|
120
|
+
export declare function deleteSession(projectPath: string, sessionId: string): {
|
|
121
|
+
messages_deleted: number;
|
|
122
|
+
distillations_deleted: number;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Nuclear option: close the DB, delete the file, re-initialize.
|
|
126
|
+
* Returns the path of the deleted DB file.
|
|
127
|
+
*/
|
|
128
|
+
export declare function wipeDatabase(): string;
|
|
129
|
+
export type MergeResult = {
|
|
130
|
+
knowledge_moved: number;
|
|
131
|
+
messages_moved: number;
|
|
132
|
+
distillations_moved: number;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Merge a source project into a target project.
|
|
136
|
+
*
|
|
137
|
+
* Moves all data (knowledge, messages, distillations, LAT sections, path
|
|
138
|
+
* aliases) from source to target, then deletes the source project row.
|
|
139
|
+
* The source project's path is registered as an alias of the target.
|
|
140
|
+
*
|
|
141
|
+
* Returns counts of moved rows for reporting.
|
|
142
|
+
*/
|
|
143
|
+
export declare function mergeProjects(sourceId: string, targetId: string): MergeResult;
|
|
144
|
+
/**
|
|
145
|
+
* Backfill git_remote for existing projects, merge duplicates, and
|
|
146
|
+
* update project names from git remote repo names where still using
|
|
147
|
+
* the directory-basename default.
|
|
148
|
+
*
|
|
149
|
+
* Iterates all projects that lack a git_remote value, runs `git remote -v`
|
|
150
|
+
* on their stored path, and:
|
|
151
|
+
* - If no other project shares that remote: sets git_remote on the row.
|
|
152
|
+
* - If another project already has that remote: merges this project into
|
|
153
|
+
* the existing one (consolidating fragmented data).
|
|
154
|
+
*
|
|
155
|
+
* Also backfills project names: if a project's name matches the directory
|
|
156
|
+
* basename (the old default) or is null, and a git remote is available,
|
|
157
|
+
* the name is updated to the repo name from the remote URL.
|
|
158
|
+
*
|
|
159
|
+
* Skips projects whose path no longer exists on disk or is not a git repo.
|
|
160
|
+
*
|
|
161
|
+
* Returns counts for reporting.
|
|
162
|
+
*/
|
|
163
|
+
export declare function backfillGitRemotes(): {
|
|
164
|
+
updated: number;
|
|
165
|
+
merged: number;
|
|
166
|
+
namesBackfilled: number;
|
|
167
|
+
mergeDetails: Array<{
|
|
168
|
+
sourcePath: string;
|
|
169
|
+
targetPath: string;
|
|
170
|
+
gitRemote: string;
|
|
171
|
+
result: MergeResult;
|
|
172
|
+
}>;
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoBH,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM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