@seanhogg/builderforce-memory 2026.10.31 → 2026.10.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/SSMAgent.d.ts.map +1 -1
- package/dist/agent/SSMAgent.js.map +1 -1
- package/dist/bridges/AnthropicBridge.d.ts.map +1 -1
- package/dist/bridges/AnthropicBridge.js.map +1 -1
- package/dist/bridges/CachingBridge.d.ts.map +1 -1
- package/dist/bridges/CachingBridge.js.map +1 -1
- package/dist/bridges/FetchBridge.d.ts.map +1 -1
- package/dist/bridges/OpenAIBridge.d.ts.map +1 -1
- package/dist/bridges/OpenAIBridge.js.map +1 -1
- package/dist/bridges/ResponseCache.d.ts.map +1 -1
- package/dist/bridges/ResponseCache.js.map +1 -1
- package/dist/bridges/SemanticCachingBridge.d.ts.map +1 -1
- package/dist/bridges/SemanticCachingBridge.js.map +1 -1
- package/dist/bridges/VertexAIBridge.d.ts.map +1 -1
- package/dist/bridges/VertexAIBridge.js.map +1 -1
- package/dist/cache/FetchSemanticCacheBackend.d.ts.map +1 -1
- package/dist/cache/SemanticCache.d.ts.map +1 -1
- package/dist/cognition/EvermindCognition.d.ts.map +1 -1
- package/dist/cognition/EvermindCognition.js.map +1 -1
- package/dist/diagnostics/stack-diagnostic.js.map +1 -1
- package/dist/distillation/DistillationEngine.d.ts.map +1 -1
- package/dist/distillation/DistillationEngine.js.map +1 -1
- package/dist/errors/SSMError.d.ts +2 -2
- package/dist/errors/SSMError.d.ts.map +1 -1
- package/dist/errors/SSMError.js.map +1 -1
- package/dist/eval/EvalHarness.d.ts.map +1 -1
- package/dist/eval/EvalHarness.js.map +1 -1
- package/dist/evermind/runtime.js.map +1 -1
- package/dist/evermind/textCoherence.js.map +1 -1
- package/dist/evermind/toolCall.js.map +1 -1
- package/dist/handoff/pack.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/ingest/IngestionPipeline.d.ts.map +1 -1
- package/dist/ingest/docsExtract.d.ts +9 -3
- package/dist/ingest/docsExtract.d.ts.map +1 -1
- package/dist/ingest/docsExtract.js +73 -20
- package/dist/ingest/docsExtract.js.map +1 -1
- package/dist/ingest/index.d.ts +1 -1
- package/dist/ingest/index.d.ts.map +1 -1
- package/dist/ingest/index.js +1 -1
- package/dist/ingest/index.js.map +1 -1
- package/dist/ingest/parserSupport.d.ts +16 -0
- package/dist/ingest/parserSupport.d.ts.map +1 -0
- package/dist/ingest/parserSupport.js +18 -0
- package/dist/ingest/parserSupport.js.map +1 -0
- package/dist/ingest/parsers.d.ts +3 -3
- package/dist/ingest/parsers.d.ts.map +1 -1
- package/dist/ingest/parsers.js +3 -92
- package/dist/ingest/parsers.js.map +1 -1
- package/dist/ingest/textParsers.d.ts +9 -0
- package/dist/ingest/textParsers.d.ts.map +1 -0
- package/dist/ingest/textParsers.js +99 -0
- package/dist/ingest/textParsers.js.map +1 -0
- package/dist/knowledge/build.d.ts +2 -0
- package/dist/knowledge/build.d.ts.map +1 -1
- package/dist/knowledge/build.js +46 -12
- package/dist/knowledge/build.js.map +1 -1
- package/dist/knowledge/cards.js.map +1 -1
- package/dist/knowledge/extractFile.d.ts +51 -0
- package/dist/knowledge/extractFile.d.ts.map +1 -0
- package/dist/knowledge/extractFile.js +59 -0
- package/dist/knowledge/extractFile.js.map +1 -0
- package/dist/knowledge/findings.d.ts +6 -0
- package/dist/knowledge/findings.d.ts.map +1 -1
- package/dist/knowledge/findings.js +9 -7
- package/dist/knowledge/findings.js.map +1 -1
- package/dist/knowledge/importance.js.map +1 -1
- package/dist/knowledge/index.d.ts +10 -7
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/index.js +8 -7
- package/dist/knowledge/index.js.map +1 -1
- package/dist/knowledge/judge.d.ts +34 -2
- package/dist/knowledge/judge.d.ts.map +1 -1
- package/dist/knowledge/judge.js +86 -16
- package/dist/knowledge/judge.js.map +1 -1
- package/dist/knowledge/model.d.ts +13 -62
- package/dist/knowledge/model.d.ts.map +1 -1
- package/dist/knowledge/owedFiles.d.ts +68 -0
- package/dist/knowledge/owedFiles.d.ts.map +1 -0
- package/dist/knowledge/owedFiles.js +86 -0
- package/dist/knowledge/owedFiles.js.map +1 -0
- package/dist/knowledge/packs/docs.d.ts +5 -2
- package/dist/knowledge/packs/docs.d.ts.map +1 -1
- package/dist/knowledge/packs/docs.js +33 -5
- package/dist/knowledge/packs/docs.js.map +1 -1
- package/dist/knowledge/plan.d.ts +37 -3
- package/dist/knowledge/plan.d.ts.map +1 -1
- package/dist/knowledge/plan.js +66 -19
- package/dist/knowledge/plan.js.map +1 -1
- package/dist/knowledge/refs.d.ts +22 -1
- package/dist/knowledge/refs.d.ts.map +1 -1
- package/dist/knowledge/refs.js +52 -0
- package/dist/knowledge/refs.js.map +1 -1
- package/dist/knowledge/review.d.ts +10 -4
- package/dist/knowledge/review.d.ts.map +1 -1
- package/dist/knowledge/review.js +125 -109
- package/dist/knowledge/review.js.map +1 -1
- package/dist/knowledge/reviewCompare.d.ts +39 -0
- package/dist/knowledge/reviewCompare.d.ts.map +1 -0
- package/dist/knowledge/reviewCompare.js +70 -0
- package/dist/knowledge/reviewCompare.js.map +1 -0
- package/dist/knowledge/reviewModel.d.ts +86 -0
- package/dist/knowledge/reviewModel.d.ts.map +1 -0
- package/dist/knowledge/reviewModel.js +6 -0
- package/dist/knowledge/reviewModel.js.map +1 -0
- package/dist/knowledge/reviewStored.d.ts +23 -0
- package/dist/knowledge/reviewStored.d.ts.map +1 -0
- package/dist/knowledge/reviewStored.js +62 -0
- package/dist/knowledge/reviewStored.js.map +1 -0
- package/dist/knowledge/sources.d.ts +34 -4
- package/dist/knowledge/sources.d.ts.map +1 -1
- package/dist/knowledge/sources.js +92 -26
- package/dist/knowledge/sources.js.map +1 -1
- package/dist/knowledge/stores/localSnapshotStore.d.ts.map +1 -1
- package/dist/knowledge/stores/localSnapshotStore.js.map +1 -1
- package/dist/knowledge/trace.js.map +1 -1
- package/dist/knowledge/truncate.d.ts +4 -4
- package/dist/knowledge/truncate.d.ts.map +1 -1
- package/dist/knowledge/truncate.js +9 -13
- package/dist/knowledge/truncate.js.map +1 -1
- package/dist/limbic/LimbicSession.d.ts.map +1 -1
- package/dist/limbic/LimbicSession.js.map +1 -1
- package/dist/memory/MemoryStore.d.ts.map +1 -1
- package/dist/memory/MemoryStore.js.map +1 -1
- package/dist/memory/SemanticRecall.d.ts.map +1 -1
- package/dist/memory/SemanticRecall.js.map +1 -1
- package/dist/memory/ttlSweeper.d.ts.map +1 -1
- package/dist/orchestration/AgentGraph.d.ts.map +1 -1
- package/dist/orchestration/AgentGraph.js.map +1 -1
- package/dist/orchestration/checkpoint.d.ts.map +1 -1
- package/dist/orchestration/checkpoint.js.map +1 -1
- package/dist/publish/huggingface.js.map +1 -1
- package/dist/rag/EnterpriseRetriever.d.ts.map +1 -1
- package/dist/rag/EnterpriseRetriever.js.map +1 -1
- package/dist/retrieval/HybridRetriever.js.map +1 -1
- package/dist/retrieval/bm25.js.map +1 -1
- package/dist/retrieval/chunk.js.map +1 -1
- package/dist/retrieval/fusion.js.map +1 -1
- package/dist/retrieval/hnsw.d.ts.map +1 -1
- package/dist/retrieval/hnsw.js.map +1 -1
- package/dist/retrieval/knowledge-index/bytes.d.ts.map +1 -1
- package/dist/retrieval/knowledge-index/bytes.js.map +1 -1
- package/dist/retrieval/knowledge-index/cascade.js.map +1 -1
- package/dist/retrieval/knowledge-index/embeddings.d.ts.map +1 -1
- package/dist/retrieval/knowledge-index/embeddings.js.map +1 -1
- package/dist/retrieval/knowledge-index/expand.js.map +1 -1
- package/dist/retrieval/knowledge-index/index.js.map +1 -1
- package/dist/retrieval/knowledge-index/lexical.d.ts.map +1 -1
- package/dist/retrieval/knowledge-index/sha256.d.ts.map +1 -1
- package/dist/retrieval/order.js.map +1 -1
- package/dist/router/InferenceRouter.d.ts.map +1 -1
- package/dist/router/InferenceRouter.js.map +1 -1
- package/dist/runtime/SSMRuntime.d.ts.map +1 -1
- package/dist/runtime/SSMRuntime.js.map +1 -1
- package/dist/session/errors.d.ts +2 -2
- package/dist/session/errors.d.ts.map +1 -1
- package/dist/session/errors.js.map +1 -1
- package/dist/session/session.d.ts.map +1 -1
- package/dist/session/session.js.map +1 -1
- package/dist/session/streaming.js.map +1 -1
- package/dist/storage/ScopedFactRepository.d.ts.map +1 -1
- package/dist/storage/ScopedFactRepository.js.map +1 -1
- package/dist/storage/fileLock.d.ts.map +1 -1
- package/dist/storage/fileLock.js.map +1 -1
- package/dist/storage/fileTransaction.d.ts.map +1 -1
- package/dist/storage/fileTransaction.js.map +1 -1
- package/dist/storage/idbAdapter.d.ts +1 -1
- package/dist/storage/idbAdapter.d.ts.map +1 -1
- package/dist/storage/idbAdapter.js.map +1 -1
- package/dist/storage/nodeFileAdapter.d.ts +1 -1
- package/dist/storage/nodeFileAdapter.d.ts.map +1 -1
- package/dist/storage/nodeFileAdapter.js.map +1 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/telemetry/InstrumentedBridge.d.ts.map +1 -1
- package/dist/telemetry/InstrumentedBridge.js.map +1 -1
- package/dist/telemetry/MetricsRegistry.d.ts.map +1 -1
- package/dist/telemetry/MetricsRegistry.js.map +1 -1
- package/dist/telemetry/Tracer.d.ts.map +1 -1
- package/dist/telemetry/Tracer.js.map +1 -1
- package/dist/telemetry/exporters.d.ts.map +1 -1
- package/dist/telemetry/exporters.js.map +1 -1
- package/dist/telemetry/pricing.js.map +1 -1
- package/dist/vectorstore/MemoryVectorStore.d.ts.map +1 -1
- package/dist/vectorstore/MemoryVectorStore.js.map +1 -1
- package/dist/vectorstore/RestVectorStore.d.ts.map +1 -1
- package/dist/vectorstore/dialects.js.map +1 -1
- package/dist/vectorstore/filter.js.map +1 -1
- package/dist/wire/chatClient.d.ts +5 -0
- package/dist/wire/chatClient.d.ts.map +1 -1
- package/dist/wire/chatClient.js +6 -0
- package/dist/wire/chatClient.js.map +1 -1
- package/dist/wire/usage.d.ts.map +1 -1
- package/dist/workflow/registry.d.ts.map +1 -1
- package/dist/workflow/run.js.map +1 -1
- package/dist/workflow/templates.js.map +1 -1
- package/dist/working/codemapAreas.js.map +1 -1
- package/dist/working/consolidate.js.map +1 -1
- package/dist/working/workingMemory.d.ts.map +1 -1
- package/dist/working/workingMemory.js.map +1 -1
- package/package.json +8 -9
- package/src/ingest/docsExtract.ts +68 -18
- package/src/ingest/index.ts +1 -0
- package/src/ingest/parserSupport.ts +24 -0
- package/src/ingest/parsers.ts +4 -102
- package/src/ingest/textParsers.ts +107 -0
- package/src/knowledge/build.ts +43 -11
- package/src/knowledge/extractFile.ts +86 -0
- package/src/knowledge/findings.ts +12 -5
- package/src/knowledge/index.ts +15 -8
- package/src/knowledge/judge.clamp.test.ts +61 -0
- package/src/knowledge/judge.ts +88 -19
- package/src/knowledge/model.ts +15 -57
- package/src/knowledge/owedFiles.ts +108 -0
- package/src/knowledge/packs/docs.ts +34 -5
- package/src/knowledge/plan.ts +93 -19
- package/src/knowledge/refs.ts +49 -1
- package/src/knowledge/review.details.test.ts +93 -0
- package/src/knowledge/review.estimate.test.ts +112 -0
- package/src/knowledge/review.fixes.test.ts +235 -0
- package/src/knowledge/review.gaps.test.ts +167 -0
- package/src/knowledge/review.owed.test.ts +379 -0
- package/src/knowledge/review.test.ts +2 -15
- package/src/knowledge/review.ts +114 -117
- package/src/knowledge/review.upgrade.test.ts +257 -0
- package/src/knowledge/reviewCompare.ts +80 -0
- package/src/knowledge/reviewModel.ts +81 -0
- package/src/knowledge/reviewStored.ts +62 -0
- package/src/knowledge/sources.ts +97 -20
- package/src/knowledge/testkit.test-util.ts +39 -1
- package/src/knowledge/truncate.ts +8 -11
- package/src/wire/chatClient.ts +13 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consolidate.js","sourceRoot":"","sources":["../../src/working/consolidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,mBAA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C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,YAAY,CAAK;IAEzB,6FAA6F;IAC7F,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"workingMemory.d.ts","sourceRoot":"","sources":["../../src/working/workingMemory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAUrE,qBAAa,aAAa;IACxB,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,YAAY,CAAK;IAEzB,6FAA6F;IAC7F,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAG1B;IAED,OAAO,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI,CAS5B;IAED,qEAAqE;IACrE,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,QAAQ,IAAI,qBAAqB,CASpC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,MAAM,GAAG,IAAI,CAsBzD;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workingMemory.js","sourceRoot":"","sources":["../../src/working/workingMemory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC;;;GAGG;AACH,MAAM,sBA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MAAM,GAAG,eAAe,OAAO,CAAC,CAAC;QAC/F,CAAC;QACD,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC5H,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seanhogg/builderforce-memory",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.33",
|
|
4
4
|
"description": "BuilderForce Agent Memory — runtime layer. SSM execution, Transformer orchestration, online distillation, enterprise RAG (ingestion pipelines, vector-store adapters, tenant/ACL-scoped hybrid retrieval), multi-agent graph orchestration, LLM telemetry and cost accounting, persistent agent memory, and token-saving agent-run memory (code maps, a prompt-cache-safe working memory, chunked transcript windowing) for BuilderForce.ai agents.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -113,21 +113,21 @@
|
|
|
113
113
|
},
|
|
114
114
|
"homepage": "https://github.com/SeanHogg/builderforce-memory/tree/main/packages/memory#readme",
|
|
115
115
|
"peerDependencies": {
|
|
116
|
-
"@seanhogg/builderforce-memory-engine": "^2026.10.
|
|
116
|
+
"@seanhogg/builderforce-memory-engine": "^2026.10.33"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@jest/globals": "^29.7.0",
|
|
120
120
|
"@types/jest": "^29.5.0",
|
|
121
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
122
|
-
"@typescript-eslint/parser": "^
|
|
121
|
+
"@typescript-eslint/eslint-plugin": "^8.72.1",
|
|
122
|
+
"@typescript-eslint/parser": "^8.72.1",
|
|
123
123
|
"@webgpu/types": "^0.1.49",
|
|
124
124
|
"eslint": "^8.57.0",
|
|
125
125
|
"fake-indexeddb": "^6.0.0",
|
|
126
126
|
"jest": "^29.7.0",
|
|
127
127
|
"ts-jest": "^29.2.0",
|
|
128
|
-
"typescript": "
|
|
129
|
-
"
|
|
130
|
-
"@seanhogg/builderforce-memory-engine": "2026.10.
|
|
128
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
129
|
+
"typescript-7": "npm:typescript@^7.0.2",
|
|
130
|
+
"@seanhogg/builderforce-memory-engine": "2026.10.33"
|
|
131
131
|
},
|
|
132
132
|
"jest": {
|
|
133
133
|
"preset": "ts-jest/presets/default-esm",
|
|
@@ -186,7 +186,6 @@
|
|
|
186
186
|
"build": "tsc",
|
|
187
187
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
188
188
|
"test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
|
|
189
|
-
"lint": "eslint src/ tests/"
|
|
190
|
-
"typecheck:native": "tsgo --noEmit"
|
|
189
|
+
"lint": "eslint src/ tests/"
|
|
191
190
|
}
|
|
192
191
|
}
|
|
@@ -6,9 +6,15 @@
|
|
|
6
6
|
* sections and the extract context. Emits, all with `origin: 'extracted'`:
|
|
7
7
|
*
|
|
8
8
|
* • a `file` node, and a `section` node per heading breadcrumb, joined by `contains`;
|
|
9
|
-
* • `links` edges for relative markdown links, `[[wiki]]`
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* • `links` edges for relative markdown links (inline and reference-style), `[[wiki]]`
|
|
10
|
+
* links (beside the linking file, marked `byName` so `buildGraph` can re-point them to
|
|
11
|
+
* the one file of that name anywhere in the root) and HTML hrefs, resolved through
|
|
12
|
+
* `ctx.resolvePath`. A missing target stays an edge, so the graph can report it broken —
|
|
13
|
+
* as does one outside the root, under a normalized `../…` path; a target written as
|
|
14
|
+
* directory navigation (`.`, `./`, `..`, `/`, anything ending in `/`) is no file link;
|
|
15
|
+
* • text before the first markdown heading (or a file with none) is a `section` too, under
|
|
16
|
+
* the reserved ref `#~preamble` (no heading slug can equal it), so it is judged and
|
|
17
|
+
* carded like any other;
|
|
12
18
|
* • `mentions` edges where a section's normalized text contains a known entity key;
|
|
13
19
|
* • keys: path, basename, heading slugs and front-matter values.
|
|
14
20
|
*
|
|
@@ -17,13 +23,15 @@
|
|
|
17
23
|
*/
|
|
18
24
|
|
|
19
25
|
import type { ExtractContext, Extracted, KEdge, KNode, NodeRef } from '../knowledge/model.js';
|
|
20
|
-
import { basenameOf, compareStr, normalizeKey, slugOf, srcRef } from '../knowledge/refs.js';
|
|
26
|
+
import { basenameOf, compareStr, normalizeKey, slugOf, srcRef, walkRelative } from '../knowledge/refs.js';
|
|
21
27
|
import { hashText } from './hash.js';
|
|
22
28
|
import { CONTENT_HASH_FIELD, type ParsedSection, type SourceDocument } from './types.js';
|
|
23
29
|
|
|
24
30
|
export const DOCS_PACK_ID = 'docs';
|
|
25
31
|
/** Badge: index of the section in the parser's output. */
|
|
26
32
|
export const SECTION_INDEX_BADGE = 'section';
|
|
33
|
+
/** The ref slug of text before a markdown file's first heading. */
|
|
34
|
+
const PREAMBLE_SLUG = '~preamble';
|
|
27
35
|
const EXCERPT_CHARS = 400;
|
|
28
36
|
const BREADCRUMB_SEPARATOR = ' › ';
|
|
29
37
|
|
|
@@ -60,32 +68,43 @@ class ExtractBuilder {
|
|
|
60
68
|
return node;
|
|
61
69
|
}
|
|
62
70
|
|
|
63
|
-
|
|
71
|
+
/** `byName` keeps a by-name link apart from a written one to the same target (only it is re-pointed). */
|
|
72
|
+
edge(from: NodeRef, to: NodeRef, kind: string, byName?: string): void {
|
|
64
73
|
if (from === to) return;
|
|
65
|
-
const id = `${from}\u0000${to}\u0000${kind}`;
|
|
74
|
+
const id = `${from}\u0000${to}\u0000${kind}${byName === undefined ? '' : `\u0000${byName}`}`;
|
|
66
75
|
const prior = this.edges.get(id);
|
|
67
76
|
if (prior) prior.weight += 1;
|
|
68
|
-
else this.edges.set(id, { from, to, kind, weight: 1, origin: 'extracted' });
|
|
77
|
+
else this.edges.set(id, { from, to, kind, weight: 1, origin: 'extracted', ...(byName !== undefined ? { byName } : {}) });
|
|
69
78
|
}
|
|
70
79
|
|
|
71
80
|
key(ref: NodeRef, key: string): void {
|
|
72
81
|
if (key) this.keys.set(`${ref}\u0000${key}`, { ref, key });
|
|
73
82
|
}
|
|
74
83
|
|
|
75
|
-
/** `links`
|
|
76
|
-
link(from: NodeRef, target: string): void {
|
|
84
|
+
/** A `links` edge to the target, unless it is the root itself (or a folder above it). */
|
|
85
|
+
link(from: NodeRef, target: string, byName?: string): void {
|
|
77
86
|
const clean = target.split('#')[0]!.split('?')[0]!.trim();
|
|
78
87
|
if (!clean || /^[a-z][a-z0-9+.-]*:/i.test(clean)) return;
|
|
79
88
|
let decoded = clean;
|
|
80
89
|
try { decoded = decodeURI(clean); } catch { /* keep the raw target */ }
|
|
81
|
-
|
|
82
|
-
if (
|
|
90
|
+
// Written as directory navigation (`.`, `./`, `..`, `/`, `docs/`): a folder, not a file link.
|
|
91
|
+
if (/^[./\\]*$/.test(decoded) || /[/\\]$/.test(decoded)) return;
|
|
92
|
+
const { ups, segments } = walkRelative(this.path, decoded);
|
|
93
|
+
if (segments.length === 0) return;
|
|
94
|
+
// Outside the root: kept as a broken link under its normalized root-relative path, so
|
|
95
|
+
// folders that reach different real files never share a ref.
|
|
96
|
+
const dest = ups > 0
|
|
97
|
+
? `${'../'.repeat(ups)}${segments.join('/')}`
|
|
98
|
+
: this.ctx.resolvePath(this.path, decoded) ?? segments.join('/');
|
|
99
|
+
if (dest !== this.path) this.edge(from, srcRef(this.ctx.rootId, dest), 'links', byName);
|
|
83
100
|
}
|
|
84
101
|
|
|
102
|
+
/** `[[Name]]`: beside the linking file here; `buildGraph` re-points a bare name to the unique file of that name. */
|
|
85
103
|
wikiLinks(from: NodeRef, text: string): void {
|
|
86
104
|
for (const m of text.matchAll(/\[\[([^\]|#]+)(?:#[^\]|]*)?(?:\|[^\]]*)?\]\]/g)) {
|
|
87
105
|
const name = m[1]!.trim();
|
|
88
|
-
if (name)
|
|
106
|
+
if (!name) continue;
|
|
107
|
+
this.link(from, /\.[A-Za-z][A-Za-z0-9]{0,7}$/.test(name) ? name : `${name}.md`, name.includes('/') ? undefined : name);
|
|
89
108
|
}
|
|
90
109
|
}
|
|
91
110
|
|
|
@@ -99,9 +118,13 @@ class ExtractBuilder {
|
|
|
99
118
|
}
|
|
100
119
|
}
|
|
101
120
|
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
|
|
121
|
+
/**
|
|
122
|
+
* A whole-body `section` (HTML, plain text): judged like a markdown section. `reserved`
|
|
123
|
+
* (a markdown preamble) uses a ref no heading slug can equal — `slugOf` never yields `~` —
|
|
124
|
+
* so a top-level `# Body` heading keeps `#body`.
|
|
125
|
+
*/
|
|
126
|
+
bodySection(index: number, text: string, reserved = false): NodeRef {
|
|
127
|
+
const ref: NodeRef = `${this.fileRef}#${reserved ? PREAMBLE_SLUG : index === 0 ? 'body' : `body-${index + 1}`}`;
|
|
105
128
|
this.node(ref, 'section', basenameOf(this.path), { [SECTION_INDEX_BADGE]: index, excerpt: excerpt(text) });
|
|
106
129
|
this.edge(this.fileRef, ref, 'contains');
|
|
107
130
|
return ref;
|
|
@@ -114,16 +137,20 @@ class ExtractBuilder {
|
|
|
114
137
|
sourceHash: this.hash,
|
|
115
138
|
nodes: [...this.nodes.values()].sort(byRef),
|
|
116
139
|
edges: [...this.edges.values()].sort((a, b) =>
|
|
117
|
-
compareStr(a.from, b.from) || compareStr(a.to, b.to) || compareStr(a.kind, b.kind)
|
|
140
|
+
compareStr(a.from, b.from) || compareStr(a.to, b.to) || compareStr(a.kind, b.kind)
|
|
141
|
+
|| compareStr(a.byName ?? '', b.byName ?? '')),
|
|
118
142
|
keys: [...this.keys.values()].sort((a, b) => byRef(a, b) || compareStr(a.key, b.key)),
|
|
119
143
|
};
|
|
120
144
|
}
|
|
121
145
|
}
|
|
122
146
|
|
|
147
|
+
/** Leading `---` fenced front matter; group 1 is its body. */
|
|
148
|
+
const FRONT_MATTER = /^---\r?\n([\s\S]*?)\r?\n---\s*(?:\r?\n|$)/;
|
|
149
|
+
|
|
123
150
|
/** `key: value` and `- item` front matter between leading `---` fences. */
|
|
124
151
|
export function frontMatterOf(text: string): Record<string, string[]> {
|
|
125
152
|
const out: Record<string, string[]> = {};
|
|
126
|
-
const m =
|
|
153
|
+
const m = FRONT_MATTER.exec(text);
|
|
127
154
|
if (!m) return out;
|
|
128
155
|
let current: string | undefined;
|
|
129
156
|
for (const line of m[1]!.split(/\r?\n/)) {
|
|
@@ -148,6 +175,19 @@ function excerpt(text: string): string {
|
|
|
148
175
|
}
|
|
149
176
|
|
|
150
177
|
const MD_LINK = /(?<!!)\[[^\]]*\]\(\s*<?([^)\s>]+)>?(?:\s+"[^"]*")?\s*\)/g;
|
|
178
|
+
/** `[id]: target` definitions (reference-style links); the use is `[text][id]` or `[id][]`. */
|
|
179
|
+
const MD_REF_DEF = /^ {0,3}\[([^\]]+)\]:\s*<?(\S+?)>?(?:\s+["'(].*)?[ \t\r]*$/gm;
|
|
180
|
+
const MD_REF_USE = /(?<!!)\[([^\]]*)\]\[([^\]]*)\]/g;
|
|
181
|
+
|
|
182
|
+
/** Reference-link definitions of a whole markdown text, by lower-cased label. */
|
|
183
|
+
function refDefinitions(text: string): Map<string, string> {
|
|
184
|
+
const out = new Map<string, string>();
|
|
185
|
+
for (const m of text.matchAll(MD_REF_DEF)) {
|
|
186
|
+
const label = m[1]!.trim().toLowerCase();
|
|
187
|
+
if (!out.has(label)) out.set(label, m[2]!);
|
|
188
|
+
}
|
|
189
|
+
return out;
|
|
190
|
+
}
|
|
151
191
|
|
|
152
192
|
export function extractMarkdown(source: SourceDocument, sections: ParsedSection[], ctx: Ctx): Extracted {
|
|
153
193
|
const b = new ExtractBuilder(source, ctx);
|
|
@@ -177,9 +217,10 @@ export function extractMarkdown(source: SourceDocument, sections: ParsedSection[
|
|
|
177
217
|
return ref;
|
|
178
218
|
};
|
|
179
219
|
|
|
220
|
+
const refs = refDefinitions(textOf(source));
|
|
180
221
|
sections.forEach((section, index) => {
|
|
181
222
|
const headingPath = section.metadata?.['headingPath'];
|
|
182
|
-
let from
|
|
223
|
+
let from: NodeRef;
|
|
183
224
|
if (typeof headingPath === 'string' && headingPath) {
|
|
184
225
|
const crumbs = headingPath.split(BREADCRUMB_SEPARATOR);
|
|
185
226
|
// Headings with no body of their own are not emitted by the parser; recover them.
|
|
@@ -187,10 +228,19 @@ export function extractMarkdown(source: SourceDocument, sections: ParsedSection[
|
|
|
187
228
|
if (!refByCrumb.has(crumbs.slice(0, k).join('\u0000'))) sectionNode(crumbs.slice(0, k));
|
|
188
229
|
}
|
|
189
230
|
from = sectionNode(crumbs, index, section.text);
|
|
231
|
+
} else {
|
|
232
|
+
// Text before the first heading (or a file with none) is judged like a section;
|
|
233
|
+
// a preamble that is only front matter is the file's, not a section.
|
|
234
|
+
const body = section.text.replace(FRONT_MATTER, '').trim();
|
|
235
|
+
from = body ? b.bodySection(index, body, true) : b.fileRef;
|
|
190
236
|
}
|
|
191
237
|
for (const m of section.text.matchAll(MD_LINK)) {
|
|
192
238
|
if (!m[1]!.startsWith('#')) b.link(from, m[1]!);
|
|
193
239
|
}
|
|
240
|
+
for (const m of section.text.matchAll(MD_REF_USE)) {
|
|
241
|
+
const target = refs.get((m[2] || m[1] || '').trim().toLowerCase());
|
|
242
|
+
if (target && !target.startsWith('#')) b.link(from, target);
|
|
243
|
+
}
|
|
194
244
|
b.wikiLinks(from, section.text);
|
|
195
245
|
b.mentions(from, section.text);
|
|
196
246
|
});
|
package/src/ingest/index.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ingest/parserSupport.ts — what every builtin parser shares: reading a source's text and
|
|
3
|
+
* media type, and telling a binary document from text.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { SourceDocument } from './types.js';
|
|
7
|
+
|
|
8
|
+
export const textOf = (source: SourceDocument): string =>
|
|
9
|
+
source.content.kind === 'text' ? source.content.text : '';
|
|
10
|
+
|
|
11
|
+
export const mediaTypeOf = (source: SourceDocument): string =>
|
|
12
|
+
source.content.kind === 'text' ? (source.content.mediaType ?? 'text/plain').toLowerCase() : '';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Binary documents — pdf, legacy and OOXML/OpenDocument office files. Their bytes are not
|
|
16
|
+
* text. The ingest pipeline's builtin parsers are unchanged (the html/xml and plain-text
|
|
17
|
+
* matchers still accept these types); the knowledge composition (`composePacks`) is what
|
|
18
|
+
* makes the builtin docs parsers refuse them, so only a host extractor that turns them into
|
|
19
|
+
* text claims them there, in any pack order.
|
|
20
|
+
*/
|
|
21
|
+
export function isBinaryDocumentType(mediaType: string): boolean {
|
|
22
|
+
return /^application\/(?:pdf|msword|vnd\.(?:openxmlformats-officedocument\.|ms-|oasis\.opendocument\.))/
|
|
23
|
+
.test(mediaType.trim().toLowerCase());
|
|
24
|
+
}
|
package/src/ingest/parsers.ts
CHANGED
|
@@ -17,14 +17,11 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import type { MetadataRecord, MetadataValue } from '../vectorstore/types.js';
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
20
|
+
import { isBinaryDocumentType, mediaTypeOf, textOf } from './parserSupport.js';
|
|
21
|
+
import { htmlParser, markdownParser, plainTextParser } from './textParsers.js';
|
|
22
|
+
import type { DocumentParser, SourceDocument, StructuredRow } from './types.js';
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
source.content.kind === 'text' ? source.content.text : '';
|
|
25
|
-
|
|
26
|
-
const mediaTypeOf = (source: SourceDocument): string =>
|
|
27
|
-
source.content.kind === 'text' ? (source.content.mediaType ?? 'text/plain').toLowerCase() : '';
|
|
24
|
+
export { isBinaryDocumentType, htmlParser, markdownParser, plainTextParser };
|
|
28
25
|
|
|
29
26
|
// ── structured rows ───────────────────────────────────────────────────────────
|
|
30
27
|
|
|
@@ -192,101 +189,6 @@ function flatten(value: unknown, path: string, out: Array<[string, string]> = []
|
|
|
192
189
|
return out;
|
|
193
190
|
}
|
|
194
191
|
|
|
195
|
-
// ── Markdown ──────────────────────────────────────────────────────────────────
|
|
196
|
-
|
|
197
|
-
export const markdownParser: DocumentParser = {
|
|
198
|
-
id: 'markdown',
|
|
199
|
-
accepts: (source) => {
|
|
200
|
-
const type = mediaTypeOf(source);
|
|
201
|
-
return type.includes('markdown') || type.includes('/md');
|
|
202
|
-
},
|
|
203
|
-
parse: (source) => {
|
|
204
|
-
const lines = textOf(source).split('\n');
|
|
205
|
-
const sections: ParsedSection[] = [];
|
|
206
|
-
// Heading level -> text, so a chunk carries its full breadcrumb rather than
|
|
207
|
-
// only its nearest heading.
|
|
208
|
-
const path: string[] = [];
|
|
209
|
-
let buffer: string[] = [];
|
|
210
|
-
|
|
211
|
-
const flush = () => {
|
|
212
|
-
const text = buffer.join('\n').trim();
|
|
213
|
-
buffer = [];
|
|
214
|
-
if (!text) return;
|
|
215
|
-
const metadata: MetadataRecord = {};
|
|
216
|
-
if (path.length) {
|
|
217
|
-
metadata['headingPath'] = path.join(' › ');
|
|
218
|
-
metadata['heading'] = path[path.length - 1] as string;
|
|
219
|
-
metadata['headingDepth'] = path.length;
|
|
220
|
-
}
|
|
221
|
-
sections.push({ text, metadata });
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
let inFence = false;
|
|
225
|
-
for (const line of lines) {
|
|
226
|
-
if (/^\s*```/.test(line)) inFence = !inFence;
|
|
227
|
-
const heading = inFence ? null : /^(#{1,6})\s+(.*)$/.exec(line);
|
|
228
|
-
if (heading) {
|
|
229
|
-
flush();
|
|
230
|
-
const depth = (heading[1] as string).length;
|
|
231
|
-
path.length = Math.min(path.length, depth - 1);
|
|
232
|
-
path[depth - 1] = (heading[2] as string).trim();
|
|
233
|
-
path.length = depth;
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
buffer.push(line);
|
|
237
|
-
}
|
|
238
|
-
flush();
|
|
239
|
-
return sections;
|
|
240
|
-
},
|
|
241
|
-
extract: extractMarkdown,
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
// ── HTML ──────────────────────────────────────────────────────────────────────
|
|
245
|
-
|
|
246
|
-
export const htmlParser: DocumentParser = {
|
|
247
|
-
id: 'html',
|
|
248
|
-
accepts: (source) => mediaTypeOf(source).includes('html') || mediaTypeOf(source).includes('xml'),
|
|
249
|
-
parse: (source) => {
|
|
250
|
-
const raw = textOf(source);
|
|
251
|
-
const titleMatch = /<title[^>]*>([\s\S]*?)<\/title>/i.exec(raw);
|
|
252
|
-
|
|
253
|
-
const text = raw
|
|
254
|
-
// script/style content is code, not prose — indexing it poisons recall.
|
|
255
|
-
.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/gi, ' ')
|
|
256
|
-
.replace(/<!--[\s\S]*?-->/g, ' ')
|
|
257
|
-
.replace(/<\/(p|div|section|article|li|tr|h[1-6])>/gi, '\n')
|
|
258
|
-
.replace(/<br\s*\/?>/gi, '\n')
|
|
259
|
-
.replace(/<[^>]+>/g, ' ')
|
|
260
|
-
.replace(/ /g, ' ')
|
|
261
|
-
.replace(/&/g, '&')
|
|
262
|
-
.replace(/</g, '<')
|
|
263
|
-
.replace(/>/g, '>')
|
|
264
|
-
.replace(/"/g, '"')
|
|
265
|
-
.replace(/'/g, "'")
|
|
266
|
-
.replace(/[ \t]+/g, ' ')
|
|
267
|
-
.replace(/\n{3,}/g, '\n\n')
|
|
268
|
-
.trim();
|
|
269
|
-
|
|
270
|
-
if (!text) return [];
|
|
271
|
-
const metadata: MetadataRecord = {};
|
|
272
|
-
if (titleMatch?.[1]) metadata['htmlTitle'] = titleMatch[1].trim();
|
|
273
|
-
return [{ text, metadata }];
|
|
274
|
-
},
|
|
275
|
-
extract: extractHtml,
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
// ── plain text ────────────────────────────────────────────────────────────────
|
|
279
|
-
|
|
280
|
-
export const plainTextParser: DocumentParser = {
|
|
281
|
-
id: 'text',
|
|
282
|
-
accepts: (source) => source.content.kind === 'text',
|
|
283
|
-
parse: (source) => {
|
|
284
|
-
const text = textOf(source).trim();
|
|
285
|
-
return text ? [{ text }] : [];
|
|
286
|
-
},
|
|
287
|
-
extract: extractPlainText,
|
|
288
|
-
};
|
|
289
|
-
|
|
290
192
|
// ── registry ──────────────────────────────────────────────────────────────────
|
|
291
193
|
|
|
292
194
|
/** Order matters: the first parser that accepts a source handles it. */
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ingest/textParsers.ts — the builtin text parsers: markdown, HTML and plain text. Each
|
|
3
|
+
* also carries the knowledge-graph `extract` of the docs pack (`docsExtract.ts`).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { MetadataRecord } from '../vectorstore/types.js';
|
|
7
|
+
import { extractHtml, extractMarkdown, extractPlainText } from './docsExtract.js';
|
|
8
|
+
import { mediaTypeOf, textOf } from './parserSupport.js';
|
|
9
|
+
import type { DocumentParser, ParsedSection } from './types.js';
|
|
10
|
+
|
|
11
|
+
// ── Markdown ──────────────────────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
export const markdownParser: DocumentParser = {
|
|
14
|
+
id: 'markdown',
|
|
15
|
+
accepts: (source) => {
|
|
16
|
+
const type = mediaTypeOf(source);
|
|
17
|
+
return type.includes('markdown') || type.includes('/md');
|
|
18
|
+
},
|
|
19
|
+
parse: (source) => {
|
|
20
|
+
const lines = textOf(source).split('\n');
|
|
21
|
+
const sections: ParsedSection[] = [];
|
|
22
|
+
// Heading level -> text, so a chunk carries its full breadcrumb rather than
|
|
23
|
+
// only its nearest heading.
|
|
24
|
+
const path: string[] = [];
|
|
25
|
+
let buffer: string[] = [];
|
|
26
|
+
|
|
27
|
+
const flush = () => {
|
|
28
|
+
const text = buffer.join('\n').trim();
|
|
29
|
+
buffer = [];
|
|
30
|
+
if (!text) return;
|
|
31
|
+
const metadata: MetadataRecord = {};
|
|
32
|
+
if (path.length) {
|
|
33
|
+
metadata['headingPath'] = path.join(' › ');
|
|
34
|
+
metadata['heading'] = path[path.length - 1] as string;
|
|
35
|
+
metadata['headingDepth'] = path.length;
|
|
36
|
+
}
|
|
37
|
+
sections.push({ text, metadata });
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
let inFence = false;
|
|
41
|
+
for (const line of lines) {
|
|
42
|
+
if (/^\s*```/.test(line)) inFence = !inFence;
|
|
43
|
+
const heading = inFence ? null : /^(#{1,6})\s+(.*)$/.exec(line);
|
|
44
|
+
if (heading) {
|
|
45
|
+
flush();
|
|
46
|
+
const depth = (heading[1] as string).length;
|
|
47
|
+
path.length = Math.min(path.length, depth - 1);
|
|
48
|
+
path[depth - 1] = (heading[2] as string).trim();
|
|
49
|
+
path.length = depth;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
buffer.push(line);
|
|
53
|
+
}
|
|
54
|
+
flush();
|
|
55
|
+
return sections;
|
|
56
|
+
},
|
|
57
|
+
extract: extractMarkdown,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// ── HTML ──────────────────────────────────────────────────────────────────────
|
|
61
|
+
|
|
62
|
+
export const htmlParser: DocumentParser = {
|
|
63
|
+
id: 'html',
|
|
64
|
+
accepts: (source) => {
|
|
65
|
+
const type = mediaTypeOf(source);
|
|
66
|
+
return type.includes('html') || type.includes('xml');
|
|
67
|
+
},
|
|
68
|
+
parse: (source) => {
|
|
69
|
+
const raw = textOf(source);
|
|
70
|
+
const titleMatch = /<title[^>]*>([\s\S]*?)<\/title>/i.exec(raw);
|
|
71
|
+
|
|
72
|
+
const text = raw
|
|
73
|
+
// script/style content is code, not prose — indexing it poisons recall.
|
|
74
|
+
.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/gi, ' ')
|
|
75
|
+
.replace(/<!--[\s\S]*?-->/g, ' ')
|
|
76
|
+
.replace(/<\/(p|div|section|article|li|tr|h[1-6])>/gi, '\n')
|
|
77
|
+
.replace(/<br\s*\/?>/gi, '\n')
|
|
78
|
+
.replace(/<[^>]+>/g, ' ')
|
|
79
|
+
.replace(/ /g, ' ')
|
|
80
|
+
.replace(/&/g, '&')
|
|
81
|
+
.replace(/</g, '<')
|
|
82
|
+
.replace(/>/g, '>')
|
|
83
|
+
.replace(/"/g, '"')
|
|
84
|
+
.replace(/'/g, "'")
|
|
85
|
+
.replace(/[ \t]+/g, ' ')
|
|
86
|
+
.replace(/\n{3,}/g, '\n\n')
|
|
87
|
+
.trim();
|
|
88
|
+
|
|
89
|
+
if (!text) return [];
|
|
90
|
+
const metadata: MetadataRecord = {};
|
|
91
|
+
if (titleMatch?.[1]) metadata['htmlTitle'] = titleMatch[1].trim();
|
|
92
|
+
return [{ text, metadata }];
|
|
93
|
+
},
|
|
94
|
+
extract: extractHtml,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// ── plain text ────────────────────────────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
export const plainTextParser: DocumentParser = {
|
|
100
|
+
id: 'text',
|
|
101
|
+
accepts: (source) => source.content.kind === 'text',
|
|
102
|
+
parse: (source) => {
|
|
103
|
+
const text = textOf(source).trim();
|
|
104
|
+
return text ? [{ text }] : [];
|
|
105
|
+
},
|
|
106
|
+
extract: extractPlainText,
|
|
107
|
+
};
|