@loreai/core 0.15.0 → 0.17.0
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 +13205 -11259
- 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 +15 -80
- 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 +13205 -11259
- 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 +15 -80
- 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 +15 -80
- 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 +17 -363
|
@@ -11,19 +11,83 @@ export interface EmbeddingProvider {
|
|
|
11
11
|
embed(texts: string[], inputType: "document" | "query"): Promise<Float32Array[]>;
|
|
12
12
|
readonly maxBatchSize: number;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Thrown when `LocalProvider` is requested but `fastembed` cannot be loaded.
|
|
16
|
+
* `fastembed` is an optionalDependency of `@loreai/core`: if its postinstall
|
|
17
|
+
* fails (e.g. CUDA 13 hits the upstream `onnxruntime-node` bug — see #185),
|
|
18
|
+
* the package install still succeeds but local embeddings are disabled.
|
|
19
|
+
* Callers in `recall.ts` / `ltm.ts` / `distillation.ts` already gate on
|
|
20
|
+
* `isAvailable()`, which flips to `false` after this error fires once.
|
|
21
|
+
*/
|
|
22
|
+
export declare class LocalProviderUnavailableError extends Error {
|
|
23
|
+
constructor(cause?: unknown);
|
|
24
|
+
}
|
|
25
|
+
/** For tests: reset the fastembed probe cache. */
|
|
26
|
+
export declare function _resetFastembedProbe(): void;
|
|
27
|
+
/** For tests: simulate fastembed being unresolvable, without mocking the
|
|
28
|
+
* dynamic import. After this call, `tryLoadFastembed()` short-circuits to
|
|
29
|
+
* `null` and `isAvailable()` returns false for the local provider. */
|
|
30
|
+
export declare function _markFastembedUnavailable(): void;
|
|
31
|
+
/** Reset cached provider — called when config changes.
|
|
32
|
+
* Shuts down the worker thread if the current provider is a LocalProvider.
|
|
33
|
+
* Returns a promise that resolves once any worker has fully exited.
|
|
34
|
+
* Callers that need clean teardown (tests) should await the result. */
|
|
35
|
+
export declare function resetProvider(): Promise<void>;
|
|
36
|
+
/** Shut down the current provider and prevent any new provider from being
|
|
37
|
+
* created. After this call, `embed()` throws and `isAvailable()` returns
|
|
38
|
+
* false. Test-only: prevents fire-and-forget embeds (queued by other test
|
|
39
|
+
* files) from spawning a new worker after cleanup. */
|
|
40
|
+
export declare function _shutdownAndDisable(): Promise<void>;
|
|
41
|
+
/** Save the current cached provider reference (including the live worker)
|
|
42
|
+
* and clear the cache so the next `getProvider()` call creates a fresh one.
|
|
43
|
+
* Returns an opaque token that must be passed to `_restoreProvider()` to
|
|
44
|
+
* put the original provider back — without this, the worker is orphaned and
|
|
45
|
+
* a second ONNX load in the same Bun process will crash.
|
|
46
|
+
*
|
|
47
|
+
* Test-only helper: lets suites temporarily swap in a mock/unavailable
|
|
48
|
+
* provider without killing the real worker. */
|
|
49
|
+
export declare function _saveAndClearProvider(): unknown;
|
|
50
|
+
/** Restore a provider previously saved by `_saveAndClearProvider()`. Any
|
|
51
|
+
* provider created between save and restore is discarded (callers must
|
|
52
|
+
* ensure it's not a LocalProvider with a live worker — those suites only
|
|
53
|
+
* use `_markFastembedUnavailable()` so no worker is spawned). */
|
|
54
|
+
export declare function _restoreProvider(token: unknown): void;
|
|
55
|
+
/**
|
|
56
|
+
* Build a remote `EmbeddingProvider` from whichever API key is in env.
|
|
57
|
+
* Returns `null` when neither `VOYAGE_API_KEY` nor `OPENAI_API_KEY` is set,
|
|
58
|
+
* which is the signal for callers to fall through to FTS-only behaviour.
|
|
59
|
+
*
|
|
60
|
+
* Voyage wins ties because it's the higher-quality option for code search;
|
|
61
|
+
* users who want OpenAI specifically can pin `search.embeddings.provider`
|
|
62
|
+
* in `.lore.json` and skip the fallback path entirely.
|
|
63
|
+
*/
|
|
64
|
+
export declare function pickRemoteFallback(): {
|
|
65
|
+
name: "voyage" | "openai";
|
|
66
|
+
provider: EmbeddingProvider;
|
|
67
|
+
} | null;
|
|
16
68
|
/** Returns true if embedding is available.
|
|
17
69
|
* Active when the configured provider's API key is set, unless explicitly
|
|
18
|
-
* disabled via `search.embeddings.enabled: false` in .lore.json.
|
|
70
|
+
* disabled via `search.embeddings.enabled: false` in .lore.json.
|
|
71
|
+
*
|
|
72
|
+
* For the `local` provider, also returns false once we've discovered the
|
|
73
|
+
* optional `fastembed` peer is missing — callers (recall, ltm, distillation)
|
|
74
|
+
* use this gate to skip embedding work and fall back to FTS-only search. */
|
|
19
75
|
export declare function isAvailable(): boolean;
|
|
20
76
|
/**
|
|
21
77
|
* Generate embeddings for the given texts using the configured provider.
|
|
22
78
|
*
|
|
79
|
+
* If the configured provider is `local` and `fastembed` turns out to be
|
|
80
|
+
* unavailable at runtime (failed install, vendor extraction blocked, etc.),
|
|
81
|
+
* automatically swap to a remote provider when `VOYAGE_API_KEY` or
|
|
82
|
+
* `OPENAI_API_KEY` is set in env. The swap is permanent for the rest of
|
|
83
|
+
* the process — `cachedProvider` is replaced so subsequent calls skip the
|
|
84
|
+
* local-then-fail path.
|
|
85
|
+
*
|
|
23
86
|
* @param texts Array of texts to embed
|
|
24
87
|
* @param inputType "document" for storage, "query" for search
|
|
25
88
|
* @returns Float32Array per input text
|
|
26
|
-
* @throws On API errors or
|
|
89
|
+
* @throws On API errors or when no provider (local or remote) is
|
|
90
|
+
* available
|
|
27
91
|
*/
|
|
28
92
|
export declare function embed(texts: string[], inputType: "document" | "query"): Promise<Float32Array[]>;
|
|
29
93
|
/**
|
|
@@ -64,6 +128,24 @@ export declare function embedKnowledgeEntry(id: string, title: string, content:
|
|
|
64
128
|
* The distillation remains searchable via FTS even if embedding fails.
|
|
65
129
|
*/
|
|
66
130
|
export declare function embedDistillation(id: string, observations: string): void;
|
|
131
|
+
/**
|
|
132
|
+
* Embed a temporal message and store the result in the DB.
|
|
133
|
+
* Fire-and-forget — errors are logged, never thrown.
|
|
134
|
+
* Only called for undistilled messages; once distilled, the embedding
|
|
135
|
+
* is NULLed (semantic content captured by distillation embedding).
|
|
136
|
+
*/
|
|
137
|
+
export declare function embedTemporalMessage(id: string, content: string): void;
|
|
138
|
+
/**
|
|
139
|
+
* Search undistilled temporal messages with embeddings by cosine similarity.
|
|
140
|
+
* Returns top-k entries sorted by similarity descending.
|
|
141
|
+
*
|
|
142
|
+
* Only scans undistilled messages (distilled=0) — once a message is
|
|
143
|
+
* distilled, its semantic content is captured by the distillation
|
|
144
|
+
* embedding and the temporal embedding is cleared.
|
|
145
|
+
*
|
|
146
|
+
* Scoped to a single project. Optionally scoped to a single session.
|
|
147
|
+
*/
|
|
148
|
+
export declare function vectorSearchTemporal(queryEmbedding: Float32Array, projectId: string, limit?: number, sessionId?: string): VectorHit[];
|
|
67
149
|
/**
|
|
68
150
|
* Check if embedding config has changed since the last backfill.
|
|
69
151
|
* If so, clear all existing embeddings (they're incompatible) and
|
|
@@ -77,10 +159,11 @@ export declare function checkConfigChange(): boolean;
|
|
|
77
159
|
*
|
|
78
160
|
* This is the canonical entry point that every host adapter (OpenCode, Pi,
|
|
79
161
|
* future ACP) should call once during init. It:
|
|
80
|
-
* 1.
|
|
81
|
-
* 2.
|
|
82
|
-
* 3. Backfills
|
|
83
|
-
* 4.
|
|
162
|
+
* 1. Waits a short grace period so first-connect HTTP requests can finish
|
|
163
|
+
* 2. Detects config changes (provider swap) and clears stale embeddings
|
|
164
|
+
* 3. Backfills knowledge entries missing embeddings
|
|
165
|
+
* 4. Backfills non-archived distillations missing embeddings
|
|
166
|
+
* 5. Logs a one-line coverage summary to stderr (always visible, not gated)
|
|
84
167
|
*
|
|
85
168
|
* Fire-and-forget: callers should `.catch()` — embedding failures must not
|
|
86
169
|
* block plugin initialization.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/embedding.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/embedding.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAqBH,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IACjF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAgHD;;;;;;;GAOG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;gBAC1C,KAAK,CAAC,EAAE,OAAO;CAS5B;AASD,kDAAkD;AAClD,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C;AAED;;uEAEuE;AACvE,wBAAgB,yBAAyB,IAAI,IAAI,CAKhD;AAoYD;;;wEAGwE;AACxE,wBAAgB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAQ7C;AAED;;;uDAGuD;AACvD,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQnD;AAED;;;;;;;gDAOgD;AAChD,wBAAgB,qBAAqB,IAAI,OAAO,CAK/C;AAED;;;kEAGkE;AAClE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAIrD;AAOD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI;IACpC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,GAAG,IAAI,CAgBP;AAMD;;;;;;6EAM6E;AAC7E,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAMD;;;;;;;;;;;;;;;GAeG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iBAAiB,IAAI,OAAO,CAwC3C;AAgBD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAsExD;AAgBD;;;;;;GAMG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,CAuC1D;AAMD;;;;GAIG;AACH,wBAAsB,8BAA8B,IAAI,OAAO,CAAC,MAAM,CAAC,CAiDtE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git.ts — Git repository identification utilities.
|
|
3
|
+
*
|
|
4
|
+
* Extracts and normalizes git remote URLs to identify projects by their
|
|
5
|
+
* repository identity rather than filesystem path. This enables:
|
|
6
|
+
* - Worktree awareness: main checkout and worktrees share one project
|
|
7
|
+
* - Clone deduplication: same repo cloned to different paths is one project
|
|
8
|
+
* - Fork awareness: prefers `upstream` remote to unify forks with their source
|
|
9
|
+
*
|
|
10
|
+
* Remote URL normalization strips protocol, auth, and `.git` suffix to produce
|
|
11
|
+
* a stable canonical identifier (e.g. "github.com/user/repo") regardless of
|
|
12
|
+
* how the remote was configured (SSH, HTTPS, git://).
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Normalize a git remote URL to a canonical form for comparison.
|
|
16
|
+
*
|
|
17
|
+
* Strips protocol, auth, `.git` suffix, and normalizes SSH ↔ HTTPS
|
|
18
|
+
* to produce a stable identifier regardless of how the remote was
|
|
19
|
+
* configured.
|
|
20
|
+
*
|
|
21
|
+
* Examples:
|
|
22
|
+
* git@github.com:user/repo.git → github.com/user/repo
|
|
23
|
+
* https://github.com/user/repo.git → github.com/user/repo
|
|
24
|
+
* ssh://git@github.com/user/repo → github.com/user/repo
|
|
25
|
+
* git://github.com/user/repo.git → github.com/user/repo
|
|
26
|
+
* https://user:token@github.com/user/repo → github.com/user/repo
|
|
27
|
+
*/
|
|
28
|
+
export declare function normalizeRemoteUrl(url: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Clear the in-memory git remote cache.
|
|
31
|
+
*
|
|
32
|
+
* Intended for test harnesses that need deterministic behavior across
|
|
33
|
+
* test cases without leaking cached results.
|
|
34
|
+
*/
|
|
35
|
+
export declare function clearGitRemoteCache(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Get the canonical git remote URL for a repository at the given path.
|
|
38
|
+
*
|
|
39
|
+
* Prefers `upstream` remote (for forks) over `origin`, then falls back
|
|
40
|
+
* to any other remote. Returns null if the path is not in a git repo
|
|
41
|
+
* or has no remotes configured.
|
|
42
|
+
*
|
|
43
|
+
* Results are cached in-memory for the process lifetime to avoid repeated
|
|
44
|
+
* subprocess calls — `git remote -v` only runs once per unique path.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getGitRemote(path: string): string | null;
|
|
47
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA6BtD;AAaD;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA+CxD"}
|
package/dist/types/gradient.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { LoreMessageWithParts } from "./types";
|
|
2
2
|
type MessageWithParts = LoreMessageWithParts;
|
|
3
|
+
/** Compute the context ceiling from a per-bust cost target and cache-write price per token. */
|
|
4
|
+
export declare function computeContextCap(targetBustCost: number, cacheWriteCostPerToken: number): number;
|
|
5
|
+
/** Set the static context ceiling. Called by the host adapter after computing
|
|
6
|
+
* from model pricing. The effective per-session cap may be lower due to
|
|
7
|
+
* dynamic adaptation (bust rate EMA). */
|
|
8
|
+
export declare function setMaxContextTokens(tokens: number): void;
|
|
9
|
+
/** Returns the current static ceiling (for external callers / tests). */
|
|
10
|
+
export declare function getMaxContextTokens(): number;
|
|
11
|
+
/**
|
|
12
|
+
* Feed cache usage data after each API response. Updates the per-session
|
|
13
|
+
* bust rate EMA and inter-bust interval, which adjust the effective context
|
|
14
|
+
* cap dynamically.
|
|
15
|
+
*
|
|
16
|
+
* @param cacheWrite - cache_creation_input_tokens from the API response
|
|
17
|
+
* @param cacheRead - cache_read_input_tokens from the API response
|
|
18
|
+
* @param sessionID - session that produced this response
|
|
19
|
+
*/
|
|
20
|
+
export declare function updateBustRate(cacheWrite: number, cacheRead: number, sessionID?: string): void;
|
|
3
21
|
type DistillationSnapshot = {
|
|
4
22
|
/** Cached distillation rows from the most recent DB read */
|
|
5
23
|
rows: Distillation[];
|
|
@@ -182,7 +200,7 @@ export type TransformResult = {
|
|
|
182
200
|
distilledBudget: number;
|
|
183
201
|
rawBudget: number;
|
|
184
202
|
};
|
|
185
|
-
export declare function needsUrgentDistillation(): boolean;
|
|
203
|
+
export declare function needsUrgentDistillation(sessionID: string): boolean;
|
|
186
204
|
export declare function transform(input: {
|
|
187
205
|
messages: MessageWithParts[];
|
|
188
206
|
projectPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradient.d.ts","sourceRoot":"","sources":["../../src/gradient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,oBAAoB,EAAqE,MAAM,SAAS,CAAC;AAQ9I,KAAK,gBAAgB,GAAG,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"gradient.d.ts","sourceRoot":"","sources":["../../src/gradient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,oBAAoB,EAAqE,MAAM,SAAS,CAAC;AAQ9I,KAAK,gBAAgB,GAAG,oBAAoB,CAAC;AA0D7C,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,MAAM,E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AC;AAMF,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAIlE;AAmVD,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAC/B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,eAAe,CAwClB;AAGD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAErE"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
export * as temporal from "./temporal";
|
|
2
2
|
export * as ltm from "./ltm";
|
|
3
|
+
export * as data from "./data";
|
|
3
4
|
export * as distillation from "./distillation";
|
|
4
5
|
export * as curator from "./curator";
|
|
5
6
|
export * as embedding from "./embedding";
|
|
7
|
+
export * as embeddingVendor from "./embedding-vendor";
|
|
6
8
|
export * as latReader from "./lat-reader";
|
|
7
9
|
export * as patternExtract from "./pattern-extract";
|
|
8
10
|
export * as log from "./log";
|
|
9
|
-
export { runRecall, RECALL_TOOL_DESCRIPTION, RECALL_PARAM_DESCRIPTIONS, type RecallInput, type RecallResult, type RecallScope, type ScoredDistillation, } from "./recall";
|
|
11
|
+
export { runRecall, searchRecall, recallById, RECALL_TOOL_DESCRIPTION, RECALL_PARAM_DESCRIPTIONS, type RecallInput, type RecallResult, type RecallScope, type ScoredDistillation, type TaggedResult, type ScoredTaggedResult, } from "./recall";
|
|
10
12
|
export type { LoreMessage, LoreUserMessage, LoreAssistantMessage, LorePart, LoreTextPart, LoreReasoningPart, LoreToolPart, LoreGenericPart, LoreToolState, LoreToolStatePending, LoreToolStateRunning, LoreToolStateCompleted, LoreToolStateError, LoreMessageWithParts, LLMClient, } from "./types";
|
|
11
13
|
export { isTextPart, isReasoningPart, isToolPart } from "./types";
|
|
12
14
|
export { load, config, type LoreConfig } from "./config";
|
|
13
|
-
export { db, ensureProject, isFirstRun, projectId, projectName, loadForceMinLayer, saveForceMinLayer, getMeta, setMeta, getInstanceId, close, } from "./db";
|
|
14
|
-
export {
|
|
15
|
+
export { db, dbPath, ensureProject, isFirstRun, projectId, projectName, mergeProjectInternal, loadForceMinLayer, saveForceMinLayer, saveSessionCosts, loadSessionCosts, loadAllSessionCosts, type SessionCostSnapshot, getMeta, setMeta, getInstanceId, close, } from "./db";
|
|
16
|
+
export { normalizeRemoteUrl, getGitRemote, clearGitRemoteCache } from "./git";
|
|
17
|
+
export { transform, setModelLimits, setMaxLayer0Tokens, computeLayer0Cap, setMaxContextTokens, computeContextCap, getMaxContextTokens, updateBustRate, needsUrgentDistillation, calibrate, setLtmTokens, getLtmTokens, getLtmBudget, setForceMinLayer, getLastTransformedCount, getLastTransformEstimate, toolStripAnnotation, onIdleResume, getLastTurnAt, consumeCameOutOfIdle, setLastTurnAtForTest, inspectSessionState, } from "./gradient";
|
|
15
18
|
export { formatKnowledge, formatDistillations, DISTILLATION_SYSTEM, distillationUser, RECURSIVE_SYSTEM, recursiveUser, CURATOR_SYSTEM, curatorUser, CONSOLIDATION_SYSTEM, consolidationUser, QUERY_EXPANSION_SYSTEM, COMPACT_SUMMARY_TEMPLATE, buildCompactPrompt, } from "./prompt";
|
|
16
|
-
export { shouldImport, importFromFile, exportToFile, exportLoreFile, importLoreFile, shouldImportLoreFile, loreFileExists, LORE_FILE, } from "./agents-file";
|
|
19
|
+
export { shouldImport, importFromFile, exportToFile, exportLoreFile, importLoreFile, shouldImportLoreFile, loreFileExists, clearLoreFileCache, LORE_FILE, } from "./agents-file";
|
|
17
20
|
export { workerSessionIDs, isWorkerSession } from "./worker";
|
|
18
21
|
export * as workerModel from "./worker-model";
|
|
19
|
-
export { ftsQuery, ftsQueryOr, EMPTY_QUERY, reciprocalRankFusion, expandQuery, extractTopTerms, exactTermMatchRank, } from "./search";
|
|
20
|
-
export { serialize, inline, h, p, ul, lip, liph, t, root, strong, normalize, sanitizeSurrogates, unescapeMarkdown, } from "./markdown";
|
|
22
|
+
export { ftsQuery, ftsQueryOr, ftsQueryRelaxed, EMPTY_QUERY, reciprocalRankFusion, expandQuery, extractTopTerms, exactTermMatchRank, } from "./search";
|
|
23
|
+
export { serialize, inline, h, p, ul, lip, liph, t, root, strong, normalize, sanitizeSurrogates, unescapeMarkdown, renderMarkdown, } from "./markdown";
|
|
21
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAE7B,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,UAAU,CAAC;AAElB,YAAY,EACV,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAElE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACL,EAAE,EACF,aAAa,EACb,UAAU,EACV,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,aAAa,EACb,KAAK,GACN,MAAM,MAAM,CAAC;AACd,OAAO,EACL,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,oBAAoB,EAGpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,QAAQ,EACR,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,SAAS,EACT,MAAM,EACN,CAAC,EACD,CAAC,EACD,EAAE,EACF,GAAG,EACH,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,K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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,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAI7D,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAyBF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,aAAa,EAAE,CAqErG;AA8BD,kDAAkD;AAClD,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAGtD;AAED;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]): 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":"AAEA,OAAO,KAAK,EACV,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,eAAe,EAChB,MAAM,OAAO,CAAC;AASf,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMxD;AAOD,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5C;AAOD,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAgBnD;AAID,wBAAgB,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED,wBAAgB,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAE1C;AAED,wBAAgB,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAE1C;AAED,wBAAgB,EAAE,CAAC,GAAG,QAAQ,EAAE,YAAY,EAAE,GAAG,QAAQ,CAExD;AAGD,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAE3C;AAGD,wBAAgB,IAAI,CAAC,GAAG,QAAQ,EAAE,eAAe,EAAE,GAAG,QAAQ,CAE7D;AAED,wBAAgB,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAErC;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,IAAI,CAAC,GAAG,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAExD;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
package/dist/types/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;
|
|
@@ -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,e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,sBAAsB,ggBASwE,CAAC"}
|
package/dist/types/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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recall.d.ts","sourceRoot":"","sources":["../../src/recall.ts"],"names":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G,MAAM,CAAC;AAElC,MAAM,MAAM,YAAY,GACpB;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC,oBAAoB,CAAA;CAAE,GACvD;IACE,MAAM,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,GAAG,CAAC,oBAAoB,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;CACtB,GACD;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GACpD;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC,qBAAqB,CAAA;CAAE,GAC5D;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC,gBAAgB,CAAA;CAAE,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,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/types/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
|
*
|
|
@@ -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,EAA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AAC;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBnC;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAC5B,KAAK,EAAE,MAAM,GACZ,CAAC,EAAE,CAcL;AAQD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAC/C,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAqCnB"}
|
package/dist/types/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;AAQ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AAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,qBAAqB,EAAE,CAwB1B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAAE,EACpB,GAAG,GAAE,MAAmB,GACvB,MAAM,CAoBR;AAED,wBAAgB,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAWrE;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAWR;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,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/types/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
|
|
@@ -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,MAAM,CAAC;IACb,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE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