@theokit/sdk-memory 0.2.2 → 0.3.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/CHANGELOG.md +51 -0
- package/dist/index.cjs +248 -308
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +232 -301
- package/dist/index.js.map +1 -1
- package/dist/internal/active-memory/active-memory-cache.d.ts +1 -1
- package/dist/internal/active-memory/active-memory.d.ts +2 -2
- package/dist/internal/active-memory/composite-scorer.d.ts +1 -1
- package/dist/internal/active-memory/query-analyzer.d.ts +1 -1
- package/dist/internal/adapter-catalog.d.ts +21 -52
- package/dist/internal/adapter-catalog.d.ts.map +1 -1
- package/dist/internal/circuit-breaker.d.ts +1 -1
- package/dist/internal/dreaming/dreaming-run.d.ts +1 -1
- package/dist/internal/embedding/azure-openai-embedding.d.ts +21 -0
- package/dist/internal/embedding/azure-openai-embedding.d.ts.map +1 -0
- package/dist/internal/embedding/batch-encoder.d.ts +1 -1
- package/dist/internal/embedding/cohere-embedding.d.ts +14 -0
- package/dist/internal/embedding/cohere-embedding.d.ts.map +1 -0
- package/dist/internal/embedding/deepinfra-embedding.d.ts +2 -9
- package/dist/internal/embedding/deepinfra-embedding.d.ts.map +1 -1
- package/dist/internal/embedding/embedding-adapter.d.ts +5 -5
- package/dist/internal/embedding/embedding-adapter.d.ts.map +1 -1
- package/dist/internal/embedding/gemini-embedding.d.ts +18 -0
- package/dist/internal/embedding/gemini-embedding.d.ts.map +1 -0
- package/dist/internal/embedding/jina-embedding.d.ts +13 -0
- package/dist/internal/embedding/jina-embedding.d.ts.map +1 -0
- package/dist/internal/embedding/mistral-embedding.d.ts +3 -10
- package/dist/internal/embedding/mistral-embedding.d.ts.map +1 -1
- package/dist/internal/embedding/ollama-embedding.d.ts +3 -10
- package/dist/internal/embedding/ollama-embedding.d.ts.map +1 -1
- package/dist/internal/embedding/openai-compatible.d.ts +24 -23
- package/dist/internal/embedding/openai-compatible.d.ts.map +1 -1
- package/dist/internal/embedding/openai-embedding.d.ts +2 -9
- package/dist/internal/embedding/openai-embedding.d.ts.map +1 -1
- package/dist/internal/embedding/openrouter-embedding.d.ts +2 -9
- package/dist/internal/embedding/openrouter-embedding.d.ts.map +1 -1
- package/dist/internal/embedding/voyage-embedding.d.ts +2 -9
- package/dist/internal/embedding/voyage-embedding.d.ts.map +1 -1
- package/dist/internal/index/index-schema.d.ts +0 -5
- package/dist/internal/index/index-schema.d.ts.map +1 -1
- package/dist/internal/index/vec-index.d.ts +1 -1
- package/dist/internal/memory-scope.d.ts +1 -1
- package/dist/internal/memory-types.d.ts +4 -4
- package/dist/internal/store/chunk-markdown.d.ts +2 -2
- package/dist/internal/store/reader.d.ts +1 -1
- package/dist/internal/store/wiki-loader.d.ts +1 -1
- package/dist/internal/tools.d.ts +2 -2
- package/package.json +5 -5
- package/dist/internal/embedding/embedding-cache.d.ts +0 -16
- package/dist/internal/embedding/embedding-cache.d.ts.map +0 -1
|
@@ -2,7 +2,7 @@ import type { ActiveMemoryResult } from "./active-memory-types.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* TTL-bounded cache for `runActiveMemory` results. Keyed by
|
|
4
4
|
* `sha256(userText + queryMode)` so two identical sends within `cacheTtlMs`
|
|
5
|
-
* (default 15s, matching
|
|
5
|
+
* (default 15s, matching peer-project's `DEFAULT_CACHE_TTL_MS`) share a single
|
|
6
6
|
* search.
|
|
7
7
|
*
|
|
8
8
|
* Bounded size; oldest entries evicted first when capacity is exceeded.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Active Memory blocking recall (ADR D6 of memory-system-
|
|
2
|
+
* Active Memory blocking recall (ADR D6 of memory-system-peer-project-parity).
|
|
3
3
|
*
|
|
4
4
|
* Runs BEFORE `agent.send()` assembles the system prompt. Issues a direct
|
|
5
5
|
* call to `IndexManager.search` with the user message (and optional recent
|
|
6
6
|
* turns per `queryMode`).
|
|
7
7
|
*
|
|
8
8
|
* Returns a `summary` string capped at `maxSummaryChars` (default 220 to
|
|
9
|
-
* match
|
|
9
|
+
* match peer-project's `DEFAULT_MAX_SUMMARY_CHARS`) which the system-prompt
|
|
10
10
|
* pipeline prepends as a `<active-memory>` block (priority 5).
|
|
11
11
|
*
|
|
12
12
|
* Iter 75 (Stage 3 source-move #38, FINAL move): hybrid copy from
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Composite scoring — blends semantic, text, recency, and importance signals.
|
|
3
3
|
*
|
|
4
|
-
* Inspired by
|
|
4
|
+
* Inspired by a peer project's `unified_memory.py` composite scoring (lines 345-381).
|
|
5
5
|
* Default weights: semantic 0.5, text 0.2, recency 0.2, importance 0.1.
|
|
6
6
|
* Backward-compatible: old behavior reproduced with {recencyWeight:0, importanceWeight:0}.
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Query analyzer — LLM-driven sub-query distillation for complex queries.
|
|
3
3
|
*
|
|
4
|
-
* Inspired by
|
|
4
|
+
* Inspired by a peer project's `recall_flow.py`. Opt-in: short queries (≤250 chars)
|
|
5
5
|
* pass through unchanged. Per ADR D3.
|
|
6
6
|
*
|
|
7
7
|
* @internal
|
|
@@ -16,67 +16,36 @@
|
|
|
16
16
|
* `adapter-catalog.ts` in sdk-memory to disambiguate from the broader
|
|
17
17
|
* "catalog" notion at the package barrel level.
|
|
18
18
|
*
|
|
19
|
-
* **
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* **This catalog must serve every provider sdk-core ADVERTISES** (theokit#128). When the peer is
|
|
20
|
+
* installed it REPLACES core's catalog in the routing path (`sdk/src/memory.ts`), while the public
|
|
21
|
+
* `Theokit.inspect.embeddingAdapters()` keeps listing core's — so any id core has and this one
|
|
22
|
+
* lacks is a provider the SDK promises and then rejects. That is what happened to `azure-openai`,
|
|
23
|
+
* `cohere`, `jina` and `gemini` for the two months between core's T4.10 and the parity fix.
|
|
24
|
+
* The invariant is enforced by `@theokit/sdk-peer-integration-tests` (`peer-parity.test.ts`).
|
|
25
|
+
*
|
|
26
|
+
* **CLOSES the embedding-adapter cluster in sdk-memory.** The provider adapters + the shared
|
|
27
|
+
* OpenAI-compatible runtime + the inlined HTTP error mapper are canonical here:
|
|
22
28
|
* - iter 45: embedding-adapter (types)
|
|
23
|
-
* - iter 46: embedding-cache (LRU)
|
|
29
|
+
* - iter 46: embedding-cache (LRU) — REMOVED by theokit#160: the shared runtime owns caching now
|
|
24
30
|
* - iter 73: openai-compatible (shared factory) + adapter-http-error
|
|
25
31
|
* (inlined mapper)
|
|
26
32
|
* - iter 74: openai-embedding + mistral-embedding + deepinfra-embedding
|
|
27
33
|
* + voyage-embedding + openrouter-embedding + ollama-embedding +
|
|
28
34
|
* adapter-catalog (THIS)
|
|
35
|
+
* - theokit#128: azure-openai + cohere + jina + gemini (parity with core's T4.10)
|
|
29
36
|
*
|
|
30
37
|
* @internal
|
|
31
38
|
*/
|
|
32
39
|
export declare const MEMORY_EMBEDDING_ADAPTERS: {
|
|
33
|
-
openai:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
defaultModel: string;
|
|
44
|
-
transport: "remote";
|
|
45
|
-
authProviderId: string;
|
|
46
|
-
autoSelectPriority: number;
|
|
47
|
-
create: (options: Parameters<typeof import("./embedding/openai-compatible.js").createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding/embedding-adapter.js").EmbeddingRuntime>;
|
|
48
|
-
};
|
|
49
|
-
openrouter: {
|
|
50
|
-
id: string;
|
|
51
|
-
defaultModel: string;
|
|
52
|
-
transport: "remote";
|
|
53
|
-
authProviderId: string;
|
|
54
|
-
autoSelectPriority: number;
|
|
55
|
-
create: (options: Parameters<typeof import("./embedding/openai-compatible.js").createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding/embedding-adapter.js").EmbeddingRuntime>;
|
|
56
|
-
};
|
|
57
|
-
voyage: {
|
|
58
|
-
id: string;
|
|
59
|
-
defaultModel: string;
|
|
60
|
-
transport: "remote";
|
|
61
|
-
authProviderId: string;
|
|
62
|
-
autoSelectPriority: number;
|
|
63
|
-
create: (options: Parameters<typeof import("./embedding/openai-compatible.js").createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding/embedding-adapter.js").EmbeddingRuntime>;
|
|
64
|
-
};
|
|
65
|
-
deepinfra: {
|
|
66
|
-
id: string;
|
|
67
|
-
defaultModel: string;
|
|
68
|
-
transport: "remote";
|
|
69
|
-
authProviderId: string;
|
|
70
|
-
autoSelectPriority: number;
|
|
71
|
-
create: (options: Parameters<typeof import("./embedding/openai-compatible.js").createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding/embedding-adapter.js").EmbeddingRuntime>;
|
|
72
|
-
};
|
|
73
|
-
ollama: {
|
|
74
|
-
id: string;
|
|
75
|
-
defaultModel: string;
|
|
76
|
-
transport: "local";
|
|
77
|
-
authProviderId: string;
|
|
78
|
-
autoSelectPriority: number;
|
|
79
|
-
create: (options: Parameters<typeof import("./embedding/openai-compatible.js").createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding/embedding-adapter.js").EmbeddingRuntime>;
|
|
80
|
-
};
|
|
40
|
+
openai: import("./embedding/embedding-adapter.js").MemoryEmbeddingProviderAdapter;
|
|
41
|
+
mistral: import("./embedding/embedding-adapter.js").MemoryEmbeddingProviderAdapter;
|
|
42
|
+
openrouter: import("./embedding/embedding-adapter.js").MemoryEmbeddingProviderAdapter;
|
|
43
|
+
voyage: import("./embedding/embedding-adapter.js").MemoryEmbeddingProviderAdapter;
|
|
44
|
+
deepinfra: import("./embedding/embedding-adapter.js").MemoryEmbeddingProviderAdapter;
|
|
45
|
+
ollama: import("./embedding/embedding-adapter.js").MemoryEmbeddingProviderAdapter;
|
|
46
|
+
"azure-openai": import("./embedding/embedding-adapter.js").MemoryEmbeddingProviderAdapter;
|
|
47
|
+
cohere: import("./embedding/embedding-adapter.js").MemoryEmbeddingProviderAdapter;
|
|
48
|
+
jina: import("./embedding/embedding-adapter.js").MemoryEmbeddingProviderAdapter;
|
|
49
|
+
gemini: import("./embedding/embedding-adapter.js").MemoryEmbeddingProviderAdapter;
|
|
81
50
|
};
|
|
82
51
|
//# sourceMappingURL=adapter-catalog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-catalog.d.ts","sourceRoot":"","sources":["../../src/internal/adapter-catalog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"adapter-catalog.d.ts","sourceRoot":"","sources":["../../src/internal/adapter-catalog.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAYrC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Consecutive-timeout circuit breaker for Active Memory recall.
|
|
3
3
|
*
|
|
4
|
-
* Mirrors
|
|
4
|
+
* Mirrors peer-project's `circuitBreakerMaxTimeouts` + `circuitBreakerCooldownMs`
|
|
5
5
|
* config: after N consecutive timeouts the breaker trips and `shouldSkip`
|
|
6
6
|
* returns `true` until `cooldownMs` has elapsed. A successful recall resets
|
|
7
7
|
* the counter immediately.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EmbeddingRuntime } from "../embedding/embedding-adapter.js";
|
|
2
2
|
/**
|
|
3
|
-
* Dreaming sweep orchestrator (ADR D7 of memory-system-
|
|
3
|
+
* Dreaming sweep orchestrator (ADR D7 of memory-system-peer-project-parity).
|
|
4
4
|
*
|
|
5
5
|
* Phases:
|
|
6
6
|
* 1. **light** — drop near-duplicate facts via cosine similarity.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MemoryEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
2
|
+
/**
|
|
3
|
+
* Azure OpenAI embedding adapter.
|
|
4
|
+
*
|
|
5
|
+
* Azure addresses the DEPLOYMENT in the path rather than the model in the body:
|
|
6
|
+
* `https://{resource}.openai.azure.com/openai/deployments/{deployment}/embeddings?api-version=...`.
|
|
7
|
+
* `{model}` in `embeddingsPath` is substituted by `createOpenAiCompatibleRuntime`, so `model` here
|
|
8
|
+
* names the Azure deployment.
|
|
9
|
+
*
|
|
10
|
+
* `AZURE_OPENAI_ENDPOINT` supplies the resource URL (without the `/openai/...` suffix);
|
|
11
|
+
* `AZURE_OPENAI_API_KEY` the credential.
|
|
12
|
+
*
|
|
13
|
+
* theokit#128 (catalog parity): sdk-core gained this adapter in T4.10 and the peer never mirrored
|
|
14
|
+
* it, so a `sdk-memory` user asking for `azure-openai` was rejected by a provider the SDK's own
|
|
15
|
+
* `Theokit.inspect.embeddingAdapters()` advertised.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_AZURE_OPENAI_EMBEDDING_MODEL = "text-embedding-3-small";
|
|
20
|
+
export declare const azureOpenAiMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
21
|
+
//# sourceMappingURL=azure-openai-embedding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure-openai-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/azure-openai-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAK7E;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,oCAAoC,2BAA2B,CAAC;AAQ7E,eAAO,MAAM,yCAAyC,EAAE,8BA2BvD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Batch encoding pipeline — embeds N texts in 1 API call with intra-batch dedup.
|
|
3
3
|
*
|
|
4
|
-
* Inspired by
|
|
4
|
+
* Inspired by a peer project's `encoding_flow.py` Stage 1-2: batch embed + cosine dedup.
|
|
5
5
|
* Per ADR D1: new module alongside sync(), not a replacement.
|
|
6
6
|
*
|
|
7
7
|
* @internal
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MemoryEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
2
|
+
/**
|
|
3
|
+
* Cohere embedding adapter — `POST /v2/embed` at `https://api.cohere.com`, which carries the
|
|
4
|
+
* OpenAI-compatible `{ model, input }` request shape.
|
|
5
|
+
*
|
|
6
|
+
* Honors `COHERE_API_KEY`.
|
|
7
|
+
*
|
|
8
|
+
* theokit#128 (catalog parity): mirrors sdk-core's T4.10 adapter, which the peer never picked up.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_COHERE_EMBEDDING_MODEL = "embed-english-v3.0";
|
|
13
|
+
export declare const cohereMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
14
|
+
//# sourceMappingURL=cohere-embedding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohere-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/cohere-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAK7E;;;;;;;;;GASG;AAEH,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AASnE,eAAO,MAAM,oCAAoC,EAAE,8BAgClD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MemoryEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
2
2
|
/**
|
|
3
3
|
* DeepInfra embedding adapter — hosts open-source embedding models
|
|
4
4
|
* (BGE, E5, Jina, etc.) at pay-per-token. OpenAI-compatible REST at
|
|
@@ -14,12 +14,5 @@ import { createOpenAiCompatibleRuntime } from "./openai-compatible.js";
|
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
16
|
export declare const DEFAULT_DEEPINFRA_EMBEDDING_MODEL = "BAAI/bge-large-en-v1.5";
|
|
17
|
-
export declare const deepinfraMemoryEmbeddingProviderAdapter:
|
|
18
|
-
id: string;
|
|
19
|
-
defaultModel: string;
|
|
20
|
-
transport: "remote";
|
|
21
|
-
authProviderId: string;
|
|
22
|
-
autoSelectPriority: number;
|
|
23
|
-
create: (options: Parameters<typeof createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding-adapter.js").EmbeddingRuntime>;
|
|
24
|
-
};
|
|
17
|
+
export declare const deepinfraMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
25
18
|
//# sourceMappingURL=deepinfra-embedding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepinfra-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/deepinfra-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"deepinfra-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/deepinfra-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAK7E;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,iCAAiC,2BAA2B,CAAC;AAe1E,eAAO,MAAM,uCAAuC,EAAE,8BAmBrD,CAAC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Memory embedding provider adapter contract (ADR D3 of memory-system-
|
|
2
|
+
* Memory embedding provider adapter contract (ADR D3 of memory-system-peer-project-parity).
|
|
3
3
|
*
|
|
4
|
-
* Mirrors
|
|
5
|
-
* `referencia/
|
|
4
|
+
* Mirrors peer-project's `MemoryEmbeddingProviderAdapter` from
|
|
5
|
+
* `referencia/peer-project/extensions/openai/memory-embedding-adapter.ts` so
|
|
6
6
|
* adding a new provider becomes one new file under `adapters/`.
|
|
7
7
|
*
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export interface MemoryEmbeddingProviderAdapter {
|
|
11
|
-
/** Stable provider id (matches
|
|
11
|
+
/** Stable provider id (matches peer-project's id catalog: "openai", "mistral", …). */
|
|
12
12
|
readonly id: string;
|
|
13
13
|
/** Default model the adapter uses unless the caller overrides via `options.model`. */
|
|
14
14
|
readonly defaultModel: string;
|
|
15
15
|
/** Transport kind. Remote = network HTTP; local = in-process / on-device. */
|
|
16
16
|
readonly transport: "local" | "remote";
|
|
17
|
-
/** Auth provider id used to resolve API keys (mirrors
|
|
17
|
+
/** Auth provider id used to resolve API keys (mirrors peer-project). */
|
|
18
18
|
readonly authProviderId?: string;
|
|
19
19
|
/** Higher priority = auto-select this provider first when multiple are available. */
|
|
20
20
|
readonly autoSelectPriority?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embedding-adapter.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/embedding-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,8BAA8B;IAC7C,
|
|
1
|
+
{"version":3,"file":"embedding-adapter.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/embedding-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,8BAA8B;IAC7C,sFAAsF;IACtF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,sFAAsF;IACtF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,QAAQ,CAAC;IACvC,wEAAwE;IACxE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,qFAAqF;IACrF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,iDAAiD;IACjD,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAClE;AAED,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oFAAoF;IACpF,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzD,oDAAoD;IACpD,KAAK,IAAI,qBAAqB,CAAC;CAChC;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IACvC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxC,oCAAoC;IACpC,IAAI,IAAI,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { MemoryEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
2
|
+
/**
|
|
3
|
+
* Google Gemini embedding adapter — the OpenAI-compatible surface at
|
|
4
|
+
* `https://generativelanguage.googleapis.com/v1/embeddings`.
|
|
5
|
+
*
|
|
6
|
+
* Gemini's NATIVE embedding endpoint has a different shape
|
|
7
|
+
* (`POST /v1beta/models/{model}:embedContent`); this adapter deliberately targets the
|
|
8
|
+
* OpenAI-compatible one so it composes with the shared runtime.
|
|
9
|
+
*
|
|
10
|
+
* Honors `GEMINI_API_KEY`.
|
|
11
|
+
*
|
|
12
|
+
* theokit#128 (catalog parity): mirrors sdk-core's T4.10 adapter, which the peer never picked up.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare const DEFAULT_GEMINI_EMBEDDING_MODEL = "text-embedding-004";
|
|
17
|
+
export declare const geminiMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
18
|
+
//# sourceMappingURL=gemini-embedding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/gemini-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAK7E;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AAOnE,eAAO,MAAM,oCAAoC,EAAE,8BAoBlD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MemoryEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
2
|
+
/**
|
|
3
|
+
* Jina AI embedding adapter — OpenAI-compatible at `https://api.jina.ai/v1/embeddings`.
|
|
4
|
+
*
|
|
5
|
+
* Honors `JINA_API_KEY`.
|
|
6
|
+
*
|
|
7
|
+
* theokit#128 (catalog parity): mirrors sdk-core's T4.10 adapter, which the peer never picked up.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_JINA_EMBEDDING_MODEL = "jina-embeddings-v3";
|
|
12
|
+
export declare const jinaMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
13
|
+
//# sourceMappingURL=jina-embedding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jina-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/jina-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAK7E;;;;;;;;GAQG;AAEH,eAAO,MAAM,4BAA4B,uBAAuB,CAAC;AAQjE,eAAO,MAAM,kCAAkC,EAAE,8BAiBhD,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MemoryEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
2
2
|
/**
|
|
3
3
|
* Mistral embedding adapter — OpenAI-compatible REST surface
|
|
4
4
|
* (`POST /v1/embeddings` against `https://api.mistral.ai`). Default model
|
|
5
5
|
* `mistral-embed` (1024 dims).
|
|
6
6
|
*
|
|
7
|
-
* Mirrors `referencia/
|
|
7
|
+
* Mirrors `referencia/peer-project/extensions/mistral/memory-embedding-adapter.ts`.
|
|
8
8
|
*
|
|
9
9
|
* Iter 74 (Stage 3 source-move #32): hybrid copy from sdk-core's
|
|
10
10
|
* `internal/memory/adapters/mistral-embedding.ts`.
|
|
@@ -12,12 +12,5 @@ import { createOpenAiCompatibleRuntime } from "./openai-compatible.js";
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
export declare const DEFAULT_MISTRAL_EMBEDDING_MODEL = "mistral-embed";
|
|
15
|
-
export declare const mistralMemoryEmbeddingProviderAdapter:
|
|
16
|
-
id: string;
|
|
17
|
-
defaultModel: string;
|
|
18
|
-
transport: "remote";
|
|
19
|
-
authProviderId: string;
|
|
20
|
-
autoSelectPriority: number;
|
|
21
|
-
create: (options: Parameters<typeof createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding-adapter.js").EmbeddingRuntime>;
|
|
22
|
-
};
|
|
15
|
+
export declare const mistralMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
23
16
|
//# sourceMappingURL=mistral-embedding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mistral-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/mistral-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"mistral-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/mistral-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAK7E;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,+BAA+B,kBAAkB,CAAC;AAM/D,eAAO,MAAM,qCAAqC,EAAE,8BAkBnD,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* - `authType: "none"` — Ollama local ignores `Authorization`. Sentinel
|
|
9
9
|
* `"ollama-local"` is passed as apiKey to satisfy the factory contract
|
|
10
|
-
* (mirrors
|
|
10
|
+
* (mirrors peer-project `OLLAMA_DEFAULT_API_KEY = "ollama-local"`).
|
|
11
11
|
* - `OLLAMA_HOST` overrides the default `http://localhost:11434`.
|
|
12
12
|
* - `OLLAMA_API_KEY` (optional) overrides the sentinel for Ollama Cloud
|
|
13
13
|
* or reverse-proxy auth setups.
|
|
@@ -35,14 +35,7 @@
|
|
|
35
35
|
*
|
|
36
36
|
* @internal
|
|
37
37
|
*/
|
|
38
|
-
import {
|
|
38
|
+
import type { MemoryEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
39
39
|
export declare const DEFAULT_OLLAMA_EMBEDDING_MODEL = "nomic-embed-text";
|
|
40
|
-
export declare const ollamaMemoryEmbeddingProviderAdapter:
|
|
41
|
-
id: string;
|
|
42
|
-
defaultModel: string;
|
|
43
|
-
transport: "local";
|
|
44
|
-
authProviderId: string;
|
|
45
|
-
autoSelectPriority: number;
|
|
46
|
-
create: (options: Parameters<typeof createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding-adapter.js").EmbeddingRuntime>;
|
|
47
|
-
};
|
|
40
|
+
export declare const ollamaMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
48
41
|
//# sourceMappingURL=ollama-embedding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ollama-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/ollama-embedding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ollama-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/ollama-embedding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAK7E,eAAO,MAAM,8BAA8B,qBAAqB,CAAC;AAsBjE,eAAO,MAAM,oCAAoC,EAAE,8BAyBlD,CAAC"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
/**
|
|
2
|
+
* theokit#160 — the shared OpenAI-compatible embedding runtime, re-exported.
|
|
3
|
+
*
|
|
4
|
+
* This file used to be a full COPY of `@theokit/sdk`'s runtime (iter 73, "hybrid copy"). The two
|
|
5
|
+
* copies drifted, and the drift was not cosmetic: core gained bounded-parallel batching (T4.3) and a
|
|
6
|
+
* process-wide cache (T4.4) that the peer never received, while the peer's catalog REPLACES core's
|
|
7
|
+
* at runtime when installed — so consumers WITH the satellite silently ran the slower path.
|
|
8
|
+
*
|
|
9
|
+
* The duplication also produced theokit#128 (four adapters in one copy, missing from the other, for
|
|
10
|
+
* two months), and every fix since had to be applied twice by hand: the `{model}` path substitution,
|
|
11
|
+
* then all three provider dialects.
|
|
12
|
+
*
|
|
13
|
+
* Now there is one implementation, imported from `@theokit/sdk/internal/memory-adapters` — a
|
|
14
|
+
* semver-exempt sub-path in the same family as `internal/persistence` and `internal/security`, which
|
|
15
|
+
* exist for exactly this reason. The peer already depends on `@theokit/sdk/errors`, so no new
|
|
16
|
+
* dependency direction is introduced.
|
|
17
|
+
*
|
|
18
|
+
* Behaviour change for consumers of `@theokit/sdk-memory`: embedding batches now run with bounded
|
|
19
|
+
* parallelism instead of serially, and the cache is process-wide instead of per-adapter. Both are
|
|
20
|
+
* what core already did.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export { createOpenAiCompatibleRuntime, type EmbeddingDialect, type OpenAiCompatibleConfig, } from "@theokit/sdk/internal/memory-adapters";
|
|
24
25
|
//# sourceMappingURL=openai-compatible.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-compatible.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/openai-compatible.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openai-compatible.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/openai-compatible.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EACL,6BAA6B,EAC7B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,uCAAuC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MemoryEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
2
2
|
/**
|
|
3
3
|
* **Iter 74 rollup-plugin-dts workaround:** importing
|
|
4
4
|
* `MemoryEmbeddingProviderAdapter` from sibling `./embedding-adapter.js`
|
|
@@ -23,12 +23,5 @@ import { createOpenAiCompatibleRuntime } from "./openai-compatible.js";
|
|
|
23
23
|
* @internal
|
|
24
24
|
*/
|
|
25
25
|
export declare const DEFAULT_OPENAI_EMBEDDING_MODEL = "text-embedding-3-small";
|
|
26
|
-
export declare const openAiMemoryEmbeddingProviderAdapter:
|
|
27
|
-
id: string;
|
|
28
|
-
defaultModel: string;
|
|
29
|
-
transport: "remote";
|
|
30
|
-
authProviderId: string;
|
|
31
|
-
autoSelectPriority: number;
|
|
32
|
-
create: (options: Parameters<typeof createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding-adapter.js").EmbeddingRuntime>;
|
|
33
|
-
};
|
|
26
|
+
export declare const openAiMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
34
27
|
//# sourceMappingURL=openai-embedding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/openai-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"openai-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/openai-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAG7E;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,8BAA8B,2BAA2B,CAAC;AAQvE,eAAO,MAAM,oCAAoC,EAAE,8BAkBlD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MemoryEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
2
2
|
/**
|
|
3
3
|
* OpenRouter embedding adapter — routes through OpenRouter's
|
|
4
4
|
* `POST /api/v1/embeddings` endpoint (OpenAI-compatible request/response
|
|
@@ -14,12 +14,5 @@ import { createOpenAiCompatibleRuntime } from "./openai-compatible.js";
|
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
16
|
export declare const DEFAULT_OPENROUTER_EMBEDDING_MODEL = "openai/text-embedding-3-small";
|
|
17
|
-
export declare const openRouterMemoryEmbeddingProviderAdapter:
|
|
18
|
-
id: string;
|
|
19
|
-
defaultModel: string;
|
|
20
|
-
transport: "remote";
|
|
21
|
-
authProviderId: string;
|
|
22
|
-
autoSelectPriority: number;
|
|
23
|
-
create: (options: Parameters<typeof createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding-adapter.js").EmbeddingRuntime>;
|
|
24
|
-
};
|
|
17
|
+
export declare const openRouterMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
25
18
|
//# sourceMappingURL=openrouter-embedding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openrouter-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/openrouter-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"openrouter-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/openrouter-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAK7E;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,kCAAkC,kCAAkC,CAAC;AASlF,eAAO,MAAM,wCAAwC,EAAE,8BAkBtD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MemoryEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
2
2
|
/**
|
|
3
3
|
* Voyage AI embedding adapter — `POST /v1/embeddings` at
|
|
4
4
|
* `https://api.voyageai.com` with the OpenAI-compatible `{ model, input }`
|
|
@@ -12,12 +12,5 @@ import { createOpenAiCompatibleRuntime } from "./openai-compatible.js";
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
export declare const DEFAULT_VOYAGE_EMBEDDING_MODEL = "voyage-3-lite";
|
|
15
|
-
export declare const voyageMemoryEmbeddingProviderAdapter:
|
|
16
|
-
id: string;
|
|
17
|
-
defaultModel: string;
|
|
18
|
-
transport: "remote";
|
|
19
|
-
authProviderId: string;
|
|
20
|
-
autoSelectPriority: number;
|
|
21
|
-
create: (options: Parameters<typeof createOpenAiCompatibleRuntime>[1]) => Promise<import("./embedding-adapter.js").EmbeddingRuntime>;
|
|
22
|
-
};
|
|
15
|
+
export declare const voyageMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
23
16
|
//# sourceMappingURL=voyage-embedding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voyage-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/voyage-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"voyage-embedding.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/voyage-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAK7E;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,8BAA8B,kBAAkB,CAAC;AAU9D,eAAO,MAAM,oCAAoC,EAAE,8BAkBlD,CAAC"}
|
|
@@ -26,10 +26,5 @@ export declare const SCHEMA_STATEMENTS: ReadonlyArray<string>;
|
|
|
26
26
|
* `applyWalWithFallback` (T4.2, ADR D63) so NFS/SMB users get a graceful
|
|
27
27
|
* DELETE fallback instead of crashing.
|
|
28
28
|
*/
|
|
29
|
-
/**
|
|
30
|
-
* v2 migration: adds created_at, importance, scope columns to chunks.
|
|
31
|
-
* All nullable for backward-compat with existing data (EC-2).
|
|
32
|
-
*/
|
|
33
|
-
export declare const MIGRATION_V2_STATEMENTS: ReadonlyArray<string>;
|
|
34
29
|
export declare const PRAGMA_STATEMENTS: ReadonlyArray<string>;
|
|
35
30
|
//# sourceMappingURL=index-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-schema.d.ts","sourceRoot":"","sources":["../../../src/internal/index/index-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAkCnD,CAAC;AAEF;;;;GAIG;AACH
|
|
1
|
+
{"version":3,"file":"index-schema.d.ts","sourceRoot":"","sources":["../../../src/internal/index/index-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAkCnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAGnD,CAAC"}
|
|
@@ -33,7 +33,7 @@ interface MemoryDb {
|
|
|
33
33
|
loadExtension(path: string): void;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* Vector index helpers (ADR D2 + D4 of memory-system-
|
|
36
|
+
* Vector index helpers (ADR D2 + D4 of memory-system-peer-project-parity).
|
|
37
37
|
*
|
|
38
38
|
* Embeddings live in `embeddings(chunk_id, vec)` — a `vec0` virtual table
|
|
39
39
|
* provided by the sqlite-vec extension. Embedding identity (providerId +
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hierarchical memory scopes — path-based isolation for multi-agent setups.
|
|
3
3
|
*
|
|
4
|
-
* Inspired by
|
|
4
|
+
* Inspired by a peer project's `MemoryScope` with path hierarchy.
|
|
5
5
|
* Per ADR D4: scope stored as TEXT column, prefix-matched via LIKE.
|
|
6
6
|
*
|
|
7
7
|
* @internal
|
|
@@ -40,8 +40,8 @@ export declare function legacyMemoryJsonPath(cwd: string, config: MemoryConfig):
|
|
|
40
40
|
* `chunkMarkdown`. Each chunk carries stable line numbers + a content hash
|
|
41
41
|
* used downstream by the embedding cache.
|
|
42
42
|
*
|
|
43
|
-
* Mirrors
|
|
44
|
-
* (`referencia/
|
|
43
|
+
* Mirrors peer-project's `MemoryChunk` shape
|
|
44
|
+
* (`referencia/peer-project/packages/memory-host-sdk/src/host/engine-storage.ts`).
|
|
45
45
|
*
|
|
46
46
|
* @internal
|
|
47
47
|
*/
|
|
@@ -61,7 +61,7 @@ export interface MemoryChunk {
|
|
|
61
61
|
* Result of `reader.readFile`. Contains the bounded slice plus truncation
|
|
62
62
|
* + provenance info.
|
|
63
63
|
*
|
|
64
|
-
* Mirrors
|
|
64
|
+
* Mirrors peer-project's `MemoryReadResult` shape.
|
|
65
65
|
*
|
|
66
66
|
* @internal
|
|
67
67
|
*/
|
|
@@ -83,7 +83,7 @@ export interface MemoryReadResult {
|
|
|
83
83
|
/**
|
|
84
84
|
* Lightweight reference to a markdown file in the memory corpus.
|
|
85
85
|
*
|
|
86
|
-
* Mirrors
|
|
86
|
+
* Mirrors peer-project's `MemoryFileEntry`.
|
|
87
87
|
*
|
|
88
88
|
* @internal
|
|
89
89
|
*/
|
|
@@ -33,7 +33,7 @@ interface MemoryChunk {
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Split a markdown document into semantically meaningful chunks (ADR D1 of
|
|
36
|
-
* memory-system-
|
|
36
|
+
* memory-system-peer-project-parity).
|
|
37
37
|
*
|
|
38
38
|
* Algorithm:
|
|
39
39
|
* 1. Walk lines tracking the current heading (latest `^#+ ` line).
|
|
@@ -43,7 +43,7 @@ interface MemoryChunk {
|
|
|
43
43
|
* whitespace ≤ maxChars (word-aligned per edge-case review EC-6) —
|
|
44
44
|
* never mid-word.
|
|
45
45
|
*
|
|
46
|
-
* Mirrors
|
|
46
|
+
* Mirrors peer-project's `chunkMarkdown` from
|
|
47
47
|
* `packages/memory-host-sdk/src/host/chunk-markdown.ts`.
|
|
48
48
|
*
|
|
49
49
|
* Iter 53 (Stage 3 source-move #10): hybrid copy from sdk-core's
|