{"id":"@lssm-tech/lib.knowledge","slug":"lib.knowledge","name":"@lssm-tech/lib.knowledge","version":"5.0.5","path":"packages/platform/agents/knowledge","manifestPath":"packages/platform/agents/knowledge/package.json","manifestBlobSha":"ff166ceea7929cd468c50e1bc72cc65c54aad1ba","layer":"platform","physicalArea":"agents","primaryArea":"knowledge-and-retrieval","classification":{"privateDeclared":null,"catalogFamily":"sharedLibs","catalogKind":"library","catalogStatus":"active","adoptionMode":"adoptable","stability":"stable"},"description":"RAG and knowledge base primitives","descriptionOrigin":"package.json","catalog":{"family":"sharedLibs","kind":"library","status":"active","adoptionMode":"adoptable","stability":"stable","platforms":["server"],"runtimes":["node"],"entrypoints":[".","./access","./access/guard","./companyos-readiness","./companyos-refs","./governance","./grounding","./grounding/authorization","./grounding/bounds","./grounding/citations","./grounding/drafting","./grounding/fingerprints","./grounding/fusion","./grounding/knowledge-retriever-channel","./grounding/legacy-adapter","./grounding/record-projection","./grounding/redaction","./grounding/retrieval","./grounding/service","./grounding/support-verification","./grounding/types","./i18n","./i18n/catalogs","./i18n/catalogs/en","./i18n/catalogs/es","./i18n/catalogs/fr","./i18n/keys","./i18n/locale","./i18n/messages","./ingestion","./ingestion/document-processor","./ingestion/drive-adapter","./ingestion/embedding-service","./ingestion/gmail-adapter","./ingestion/storage-adapter","./ingestion/vector-indexer","./knowledge.feature","./query","./query/service","./retriever","./retriever/i18n-plan","./retriever/interface","./retriever/static-retriever","./retriever/vector-retriever","./runtime","./runtime-config","./runtime-provider-sync","./types","./vector-payload","./contracts/binding","./contracts/source","./contracts/spec","./contracts/registry","./contracts/spaces/product-canon"],"documentation":[{"title":"Lib Knowledge documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Flib.knowledge","kind":"readme"}],"examples":[],"replacements":[],"capabilities":[{"id":"package.lssm.tech.lib.knowledge","title":"Lib Knowledge","description":"RAG and knowledge base primitives","status":"active","useCases":["Adopt rag and knowledge base primitives"],"aliases":["contractspec","rag","knowledge-base","embeddings","typescript","lib","knowledge"],"pythonEquivalents":[],"canonicalImports":[{"from":"@lssm-tech/lib.knowledge","symbols":[]},{"from":"@lssm-tech/lib.knowledge/access","symbols":[]},{"from":"@lssm-tech/lib.knowledge/access/guard","symbols":[]},{"from":"@lssm-tech/lib.knowledge/companyos-readiness","symbols":[]},{"from":"@lssm-tech/lib.knowledge/companyos-refs","symbols":[]},{"from":"@lssm-tech/lib.knowledge/governance","symbols":[]},{"from":"@lssm-tech/lib.knowledge/grounding","symbols":[]},{"from":"@lssm-tech/lib.knowledge/grounding/authorization","symbols":[]},{"from":"@lssm-tech/lib.knowledge/grounding/bounds","symbols":[]},{"from":"@lssm-tech/lib.knowledge/grounding/citations","symbols":[]},{"from":"@lssm-tech/lib.knowledge/grounding/drafting","symbols":[]},{"from":"@lssm-tech/lib.knowledge/grounding/fingerprints","symbols":[]}],"constraints":{"platforms":["server"],"runtimes":["node"],"avoidWhen":["The @lssm-tech/lib.knowledge package constraints do not match the target runtime or platform."],"requires":["TypeScript"]},"alternatives":[],"relationships":[],"resolutionPriority":50}]},"canonicalImports":[{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/access","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/access/guard","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/companyos-readiness","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/companyos-refs","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/governance","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/grounding","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/grounding/authorization","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/grounding/bounds","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/grounding/citations","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/grounding/drafting","symbols":[]},{"capabilityId":"package.lssm.tech.lib.knowledge","from":"@lssm-tech/lib.knowledge/grounding/fingerprints","symbols":[]}],"scripts":{"publish:pkg":"bun publish --tolerate-republish --ignore-scripts --verbose","publish:pkg:canary":"bun publish:pkg --tag canary","build":"contractspec-bun-build build","build:bundle":"contractspec-bun-build transpile","build:types":"contractspec-bun-build types","dev":"contractspec-bun-build dev","clean":"rimraf dist .turbo","lint":"bun lint:fix","lint:fix":"node ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .","lint:check":"node ../../../../scripts/biome.cjs check .","test":"bun test --pass-with-no-tests","test:company-intelligence:grounding":"bun test testdata/company-intelligence/grounding/grounding.test.ts","prebuild":"contractspec-bun-build prebuild","typecheck":"tsgo --noEmit"},"scriptStatus":"complete pinned manifest","dependencies":{"zod":"catalog:","@lssm-tech/lib.contracts-integrations":"workspace:^","@lssm-tech/lib.contracts-spec-core":"workspace:^","@lssm-tech/lib.contracts-runtime-core":"workspace:^","@lssm-tech/lib.contracts-runtime-kernel":"workspace:^","@lssm-tech/lib.translation-runtime":"workspace:^","@lssm-tech/lib.schema":"workspace:^"},"devDependencies":{"@lssm-tech/tool.typescript":"workspace:*","typescript":"catalog:","@lssm-tech/tool.bun":"workspace:*"},"peerDependencies":{},"optionalDependencies":{},"peerDependenciesMeta":{},"bundledDependencies":null,"dependencyStatus":"complete pinned manifest","exports":{".":"./src/index.ts","./access":"./src/access/index.ts","./access/guard":"./src/access/guard.ts","./companyos-readiness":"./src/companyos-readiness.ts","./companyos-refs":"./src/companyos-refs.ts","./contracts/binding":"./src/contracts/binding.ts","./contracts/registry":"./src/contracts/registry.ts","./contracts/source":"./src/contracts/source.ts","./contracts/spaces/product-canon":"./src/contracts/spaces/product-canon.ts","./contracts/spec":"./src/contracts/spec.ts","./contracts/evidence-events":"./src/contracts/evidence-events.ts","./evidence":"./src/evidence/index.ts","./governance":"./src/governance.ts","./grounding":"./src/grounding/index.ts","./grounding/authorization":"./src/grounding/authorization.ts","./grounding/bounds":"./src/grounding/bounds.ts","./grounding/citations":"./src/grounding/citations.ts","./grounding/context-evidence":"./src/grounding/context-evidence.ts","./grounding/drafting":"./src/grounding/drafting.ts","./grounding/fingerprints":"./src/grounding/fingerprints.ts","./grounding/fusion":"./src/grounding/fusion.ts","./grounding/knowledge-retriever-channel":"./src/grounding/knowledge-retriever-channel.ts","./grounding/legacy-adapter":"./src/grounding/legacy-adapter.ts","./grounding/record-projection":"./src/grounding/record-projection.ts","./grounding/redaction":"./src/grounding/redaction.ts","./grounding/retrieval":"./src/grounding/retrieval.ts","./grounding/service":"./src/grounding/service.ts","./grounding/support-verification":"./src/grounding/support-verification.ts","./grounding/types":"./src/grounding/types.ts","./i18n":"./src/i18n/index.ts","./i18n/catalogs":"./src/i18n/catalogs/index.ts","./i18n/catalogs/en":"./src/i18n/catalogs/en.ts","./i18n/catalogs/es":"./src/i18n/catalogs/es.ts","./i18n/catalogs/fr":"./src/i18n/catalogs/fr.ts","./i18n/keys":"./src/i18n/keys.ts","./i18n/locale":"./src/i18n/locale.ts","./i18n/messages":"./src/i18n/messages.ts","./ingestion":"./src/ingestion/index.ts","./ingestion/document-processor":"./src/ingestion/document-processor.ts","./ingestion/drive-adapter":"./src/ingestion/drive-adapter.ts","./ingestion/embedding-service":"./src/ingestion/embedding-service.ts","./ingestion/gmail-adapter":"./src/ingestion/gmail-adapter.ts","./ingestion/storage-adapter":"./src/ingestion/storage-adapter.ts","./ingestion/vector-indexer":"./src/ingestion/vector-indexer.ts","./knowledge.feature":"./src/knowledge.feature.ts","./query":"./src/query/index.ts","./query/service":"./src/query/service.ts","./retriever":"./src/retriever/index.ts","./retriever/i18n-plan":"./src/retriever/i18n-plan.ts","./retriever/interface":"./src/retriever/interface.ts","./retriever/static-retriever":"./src/retriever/static-retriever.ts","./retriever/vector-retriever":"./src/retriever/vector-retriever.ts","./runtime":"./src/runtime.ts","./runtime-config":"./src/runtime-config.ts","./runtime-provider-sync":"./src/runtime-provider-sync.ts","./types":"./src/types.ts","./vector-payload":"./src/vector-payload.ts","./contracts/knowledge.capability":"./src/contracts/knowledge.capability.ts","./contracts/knowledge.feature":"./src/contracts/knowledge.feature.ts","./contracts/operation-models":"./src/contracts/operation-models.ts","./contracts/operations":"./src/contracts/operations.ts","./contracts/spaces/email-threads":"./src/contracts/spaces/email-threads.ts","./contracts/spaces/financial-docs":"./src/contracts/spaces/financial-docs.ts","./contracts/spaces/financial-overview":"./src/contracts/spaces/financial-overview.ts","./contracts/spaces/support-faq":"./src/contracts/spaces/support-faq.ts","./contracts/spaces/uploaded-docs":"./src/contracts/spaces/uploaded-docs.ts"},"publishExports":{".":{"types":"./dist/index.d.ts","bun":"./dist/index.js","node":"./dist/node/index.js","default":"./dist/index.js"},"./access":{"types":"./dist/access/index.d.ts","bun":"./dist/access/index.js","node":"./dist/node/access/index.js","default":"./dist/access/index.js"},"./access/guard":{"types":"./dist/access/guard.d.ts","bun":"./dist/access/guard.js","node":"./dist/node/access/guard.js","default":"./dist/access/guard.js"},"./companyos-readiness":{"types":"./dist/companyos-readiness.d.ts","bun":"./dist/companyos-readiness.js","node":"./dist/node/companyos-readiness.js","default":"./dist/companyos-readiness.js"},"./companyos-refs":{"types":"./dist/companyos-refs.d.ts","bun":"./dist/companyos-refs.js","node":"./dist/node/companyos-refs.js","default":"./dist/companyos-refs.js"},"./contracts/binding":{"types":"./dist/contracts/binding.d.ts","bun":"./dist/contracts/binding.js","node":"./dist/node/contracts/binding.js","default":"./dist/contracts/binding.js"},"./contracts/registry":{"types":"./dist/contracts/registry.d.ts","bun":"./dist/contracts/registry.js","node":"./dist/node/contracts/registry.js","default":"./dist/contracts/registry.js"},"./contracts/source":{"types":"./dist/contracts/source.d.ts","bun":"./dist/contracts/source.js","node":"./dist/node/contracts/source.js","default":"./dist/contracts/source.js"},"./contracts/spaces/product-canon":{"types":"./dist/contracts/spaces/product-canon.d.ts","bun":"./dist/contracts/spaces/product-canon.js","node":"./dist/node/contracts/spaces/product-canon.js","default":"./dist/contracts/spaces/product-canon.js"},"./contracts/spec":{"types":"./dist/contracts/spec.d.ts","bun":"./dist/contracts/spec.js","node":"./dist/node/contracts/spec.js","default":"./dist/contracts/spec.js"},"./contracts/evidence-events":{"types":"./dist/contracts/evidence-events.d.ts","bun":"./dist/contracts/evidence-events.js","node":"./dist/node/contracts/evidence-events.js","default":"./dist/contracts/evidence-events.js"},"./evidence":{"types":"./dist/evidence/index.d.ts","bun":"./dist/evidence/index.js","node":"./dist/node/evidence/index.js","default":"./dist/evidence/index.js"},"./governance":{"types":"./dist/governance.d.ts","bun":"./dist/governance.js","node":"./dist/node/governance.js","default":"./dist/governance.js"},"./grounding":{"types":"./dist/grounding/index.d.ts","bun":"./dist/grounding/index.js","node":"./dist/node/grounding/index.js","default":"./dist/grounding/index.js"},"./grounding/authorization":{"types":"./dist/grounding/authorization.d.ts","bun":"./dist/grounding/authorization.js","node":"./dist/node/grounding/authorization.js","default":"./dist/grounding/authorization.js"},"./grounding/bounds":{"types":"./dist/grounding/bounds.d.ts","bun":"./dist/grounding/bounds.js","node":"./dist/node/grounding/bounds.js","default":"./dist/grounding/bounds.js"},"./grounding/citations":{"types":"./dist/grounding/citations.d.ts","bun":"./dist/grounding/citations.js","node":"./dist/node/grounding/citations.js","default":"./dist/grounding/citations.js"},"./grounding/context-evidence":{"types":"./dist/grounding/context-evidence.d.ts","bun":"./dist/grounding/context-evidence.js","node":"./dist/node/grounding/context-evidence.js","default":"./dist/grounding/context-evidence.js"},"./grounding/drafting":{"types":"./dist/grounding/drafting.d.ts","bun":"./dist/grounding/drafting.js","node":"./dist/node/grounding/drafting.js","default":"./dist/grounding/drafting.js"},"./grounding/fingerprints":{"types":"./dist/grounding/fingerprints.d.ts","bun":"./dist/grounding/fingerprints.js","node":"./dist/node/grounding/fingerprints.js","default":"./dist/grounding/fingerprints.js"},"./grounding/fusion":{"types":"./dist/grounding/fusion.d.ts","bun":"./dist/grounding/fusion.js","node":"./dist/node/grounding/fusion.js","default":"./dist/grounding/fusion.js"},"./grounding/knowledge-retriever-channel":{"types":"./dist/grounding/knowledge-retriever-channel.d.ts","bun":"./dist/grounding/knowledge-retriever-channel.js","node":"./dist/node/grounding/knowledge-retriever-channel.js","default":"./dist/grounding/knowledge-retriever-channel.js"},"./grounding/legacy-adapter":{"types":"./dist/grounding/legacy-adapter.d.ts","bun":"./dist/grounding/legacy-adapter.js","node":"./dist/node/grounding/legacy-adapter.js","default":"./dist/grounding/legacy-adapter.js"},"./grounding/record-projection":{"types":"./dist/grounding/record-projection.d.ts","bun":"./dist/grounding/record-projection.js","node":"./dist/node/grounding/record-projection.js","default":"./dist/grounding/record-projection.js"},"./grounding/redaction":{"types":"./dist/grounding/redaction.d.ts","bun":"./dist/grounding/redaction.js","node":"./dist/node/grounding/redaction.js","default":"./dist/grounding/redaction.js"},"./grounding/retrieval":{"types":"./dist/grounding/retrieval.d.ts","bun":"./dist/grounding/retrieval.js","node":"./dist/node/grounding/retrieval.js","default":"./dist/grounding/retrieval.js"},"./grounding/service":{"types":"./dist/grounding/service.d.ts","bun":"./dist/grounding/service.js","node":"./dist/node/grounding/service.js","default":"./dist/grounding/service.js"},"./grounding/support-verification":{"types":"./dist/grounding/support-verification.d.ts","bun":"./dist/grounding/support-verification.js","node":"./dist/node/grounding/support-verification.js","default":"./dist/grounding/support-verification.js"},"./grounding/types":{"types":"./dist/grounding/types.d.ts","bun":"./dist/grounding/types.js","node":"./dist/node/grounding/types.js","default":"./dist/grounding/types.js"},"./i18n":{"types":"./dist/i18n/index.d.ts","bun":"./dist/i18n/index.js","node":"./dist/node/i18n/index.js","default":"./dist/i18n/index.js"},"./i18n/catalogs":{"types":"./dist/i18n/catalogs/index.d.ts","bun":"./dist/i18n/catalogs/index.js","node":"./dist/node/i18n/catalogs/index.js","default":"./dist/i18n/catalogs/index.js"},"./i18n/catalogs/en":{"types":"./dist/i18n/catalogs/en.d.ts","bun":"./dist/i18n/catalogs/en.js","node":"./dist/node/i18n/catalogs/en.js","default":"./dist/i18n/catalogs/en.js"},"./i18n/catalogs/es":{"types":"./dist/i18n/catalogs/es.d.ts","bun":"./dist/i18n/catalogs/es.js","node":"./dist/node/i18n/catalogs/es.js","default":"./dist/i18n/catalogs/es.js"},"./i18n/catalogs/fr":{"types":"./dist/i18n/catalogs/fr.d.ts","bun":"./dist/i18n/catalogs/fr.js","node":"./dist/node/i18n/catalogs/fr.js","default":"./dist/i18n/catalogs/fr.js"},"./i18n/keys":{"types":"./dist/i18n/keys.d.ts","bun":"./dist/i18n/keys.js","node":"./dist/node/i18n/keys.js","default":"./dist/i18n/keys.js"},"./i18n/locale":{"types":"./dist/i18n/locale.d.ts","bun":"./dist/i18n/locale.js","node":"./dist/node/i18n/locale.js","default":"./dist/i18n/locale.js"},"./i18n/messages":{"types":"./dist/i18n/messages.d.ts","bun":"./dist/i18n/messages.js","node":"./dist/node/i18n/messages.js","default":"./dist/i18n/messages.js"},"./ingestion":{"types":"./dist/ingestion/index.d.ts","bun":"./dist/ingestion/index.js","node":"./dist/node/ingestion/index.js","default":"./dist/ingestion/index.js"},"./ingestion/document-processor":{"types":"./dist/ingestion/document-processor.d.ts","bun":"./dist/ingestion/document-processor.js","node":"./dist/node/ingestion/document-processor.js","default":"./dist/ingestion/document-processor.js"},"./ingestion/drive-adapter":{"types":"./dist/ingestion/drive-adapter.d.ts","bun":"./dist/ingestion/drive-adapter.js","node":"./dist/node/ingestion/drive-adapter.js","default":"./dist/ingestion/drive-adapter.js"},"./ingestion/embedding-service":{"types":"./dist/ingestion/embedding-service.d.ts","bun":"./dist/ingestion/embedding-service.js","node":"./dist/node/ingestion/embedding-service.js","default":"./dist/ingestion/embedding-service.js"},"./ingestion/gmail-adapter":{"types":"./dist/ingestion/gmail-adapter.d.ts","bun":"./dist/ingestion/gmail-adapter.js","node":"./dist/node/ingestion/gmail-adapter.js","default":"./dist/ingestion/gmail-adapter.js"},"./ingestion/storage-adapter":{"types":"./dist/ingestion/storage-adapter.d.ts","bun":"./dist/ingestion/storage-adapter.js","node":"./dist/node/ingestion/storage-adapter.js","default":"./dist/ingestion/storage-adapter.js"},"./ingestion/vector-indexer":{"types":"./dist/ingestion/vector-indexer.d.ts","bun":"./dist/ingestion/vector-indexer.js","node":"./dist/node/ingestion/vector-indexer.js","default":"./dist/ingestion/vector-indexer.js"},"./knowledge.feature":{"types":"./dist/knowledge.feature.d.ts","bun":"./dist/knowledge.feature.js","node":"./dist/node/knowledge.feature.js","default":"./dist/knowledge.feature.js"},"./query":{"types":"./dist/query/index.d.ts","bun":"./dist/query/index.js","node":"./dist/node/query/index.js","default":"./dist/query/index.js"},"./query/service":{"types":"./dist/query/service.d.ts","bun":"./dist/query/service.js","node":"./dist/node/query/service.js","default":"./dist/query/service.js"},"./retriever":{"types":"./dist/retriever/index.d.ts","bun":"./dist/retriever/index.js","node":"./dist/node/retriever/index.js","default":"./dist/retriever/index.js"},"./retriever/i18n-plan":{"types":"./dist/retriever/i18n-plan.d.ts","bun":"./dist/retriever/i18n-plan.js","node":"./dist/node/retriever/i18n-plan.js","default":"./dist/retriever/i18n-plan.js"},"./retriever/interface":{"types":"./dist/retriever/interface.d.ts","bun":"./dist/retriever/interface.js","node":"./dist/node/retriever/interface.js","default":"./dist/retriever/interface.js"},"./retriever/static-retriever":{"types":"./dist/retriever/static-retriever.d.ts","bun":"./dist/retriever/static-retriever.js","node":"./dist/node/retriever/static-retriever.js","default":"./dist/retriever/static-retriever.js"},"./retriever/vector-retriever":{"types":"./dist/retriever/vector-retriever.d.ts","bun":"./dist/retriever/vector-retriever.js","node":"./dist/node/retriever/vector-retriever.js","default":"./dist/retriever/vector-retriever.js"},"./runtime":{"types":"./dist/runtime.d.ts","bun":"./dist/runtime.js","node":"./dist/node/runtime.js","default":"./dist/runtime.js"},"./runtime-config":{"types":"./dist/runtime-config.d.ts","bun":"./dist/runtime-config.js","node":"./dist/node/runtime-config.js","default":"./dist/runtime-config.js"},"./runtime-provider-sync":{"types":"./dist/runtime-provider-sync.d.ts","bun":"./dist/runtime-provider-sync.js","node":"./dist/node/runtime-provider-sync.js","default":"./dist/runtime-provider-sync.js"},"./types":{"types":"./dist/types.d.ts","bun":"./dist/types.js","node":"./dist/node/types.js","default":"./dist/types.js"},"./vector-payload":{"types":"./dist/vector-payload.d.ts","bun":"./dist/vector-payload.js","node":"./dist/node/vector-payload.js","default":"./dist/vector-payload.js"},"./contracts/knowledge.capability":{"types":"./dist/contracts/knowledge.capability.d.ts","bun":"./dist/contracts/knowledge.capability.js","node":"./dist/node/contracts/knowledge.capability.js","default":"./dist/contracts/knowledge.capability.js"},"./contracts/knowledge.feature":{"types":"./dist/contracts/knowledge.feature.d.ts","bun":"./dist/contracts/knowledge.feature.js","node":"./dist/node/contracts/knowledge.feature.js","default":"./dist/contracts/knowledge.feature.js"},"./contracts/operation-models":{"types":"./dist/contracts/operation-models.d.ts","bun":"./dist/contracts/operation-models.js","node":"./dist/node/contracts/operation-models.js","default":"./dist/contracts/operation-models.js"},"./contracts/operations":{"types":"./dist/contracts/operations.d.ts","bun":"./dist/contracts/operations.js","node":"./dist/node/contracts/operations.js","default":"./dist/contracts/operations.js"},"./contracts/spaces/email-threads":{"types":"./dist/contracts/spaces/email-threads.d.ts","bun":"./dist/contracts/spaces/email-threads.js","node":"./dist/node/contracts/spaces/email-threads.js","default":"./dist/contracts/spaces/email-threads.js"},"./contracts/spaces/financial-docs":{"types":"./dist/contracts/spaces/financial-docs.d.ts","bun":"./dist/contracts/spaces/financial-docs.js","node":"./dist/node/contracts/spaces/financial-docs.js","default":"./dist/contracts/spaces/financial-docs.js"},"./contracts/spaces/financial-overview":{"types":"./dist/contracts/spaces/financial-overview.d.ts","bun":"./dist/contracts/spaces/financial-overview.js","node":"./dist/node/contracts/spaces/financial-overview.js","default":"./dist/contracts/spaces/financial-overview.js"},"./contracts/spaces/support-faq":{"types":"./dist/contracts/spaces/support-faq.d.ts","bun":"./dist/contracts/spaces/support-faq.js","node":"./dist/node/contracts/spaces/support-faq.js","default":"./dist/contracts/spaces/support-faq.js"},"./contracts/spaces/uploaded-docs":{"types":"./dist/contracts/spaces/uploaded-docs.d.ts","bun":"./dist/contracts/spaces/uploaded-docs.js","node":"./dist/node/contracts/spaces/uploaded-docs.js","default":"./dist/contracts/spaces/uploaded-docs.js"}},"types":"./dist/index.d.ts","files":["dist","README.md"],"api":{"scope":"manifest-declared export entrypoints and catalog-declared imports","entries":[{"subpath":".","importPath":"@lssm-tech/lib.knowledge","target":"./src/index.ts","targets":[{"conditions":[],"target":"./src/index.ts","sourcePath":"packages/platform/agents/knowledge/src/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./access","importPath":"@lssm-tech/lib.knowledge/access","target":"./src/access/index.ts","targets":[{"conditions":[],"target":"./src/access/index.ts","sourcePath":"packages/platform/agents/knowledge/src/access/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/access/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./access/guard","importPath":"@lssm-tech/lib.knowledge/access/guard","target":"./src/access/guard.ts","targets":[{"conditions":[],"target":"./src/access/guard.ts","sourcePath":"packages/platform/agents/knowledge/src/access/guard.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/access/guard.ts","sourceStatus":"verified source file"}]},{"subpath":"./companyos-readiness","importPath":"@lssm-tech/lib.knowledge/companyos-readiness","target":"./src/companyos-readiness.ts","targets":[{"conditions":[],"target":"./src/companyos-readiness.ts","sourcePath":"packages/platform/agents/knowledge/src/companyos-readiness.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/companyos-readiness.ts","sourceStatus":"verified source file"}]},{"subpath":"./companyos-refs","importPath":"@lssm-tech/lib.knowledge/companyos-refs","target":"./src/companyos-refs.ts","targets":[{"conditions":[],"target":"./src/companyos-refs.ts","sourcePath":"packages/platform/agents/knowledge/src/companyos-refs.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/companyos-refs.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/binding","importPath":"@lssm-tech/lib.knowledge/contracts/binding","target":"./src/contracts/binding.ts","targets":[{"conditions":[],"target":"./src/contracts/binding.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/binding.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/binding.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/registry","importPath":"@lssm-tech/lib.knowledge/contracts/registry","target":"./src/contracts/registry.ts","targets":[{"conditions":[],"target":"./src/contracts/registry.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/registry.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/registry.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/source","importPath":"@lssm-tech/lib.knowledge/contracts/source","target":"./src/contracts/source.ts","targets":[{"conditions":[],"target":"./src/contracts/source.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/source.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/source.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/spaces/product-canon","importPath":"@lssm-tech/lib.knowledge/contracts/spaces/product-canon","target":"./src/contracts/spaces/product-canon.ts","targets":[{"conditions":[],"target":"./src/contracts/spaces/product-canon.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/spaces/product-canon.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/spaces/product-canon.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/spec","importPath":"@lssm-tech/lib.knowledge/contracts/spec","target":"./src/contracts/spec.ts","targets":[{"conditions":[],"target":"./src/contracts/spec.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/spec.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/spec.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/evidence-events","importPath":"@lssm-tech/lib.knowledge/contracts/evidence-events","target":"./src/contracts/evidence-events.ts","targets":[{"conditions":[],"target":"./src/contracts/evidence-events.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/evidence-events.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/evidence-events.ts","sourceStatus":"verified source file"}]},{"subpath":"./evidence","importPath":"@lssm-tech/lib.knowledge/evidence","target":"./src/evidence/index.ts","targets":[{"conditions":[],"target":"./src/evidence/index.ts","sourcePath":"packages/platform/agents/knowledge/src/evidence/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/evidence/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./governance","importPath":"@lssm-tech/lib.knowledge/governance","target":"./src/governance.ts","targets":[{"conditions":[],"target":"./src/governance.ts","sourcePath":"packages/platform/agents/knowledge/src/governance.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/governance.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding","importPath":"@lssm-tech/lib.knowledge/grounding","target":"./src/grounding/index.ts","targets":[{"conditions":[],"target":"./src/grounding/index.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/authorization","importPath":"@lssm-tech/lib.knowledge/grounding/authorization","target":"./src/grounding/authorization.ts","targets":[{"conditions":[],"target":"./src/grounding/authorization.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/authorization.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/authorization.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/bounds","importPath":"@lssm-tech/lib.knowledge/grounding/bounds","target":"./src/grounding/bounds.ts","targets":[{"conditions":[],"target":"./src/grounding/bounds.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/bounds.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/bounds.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/citations","importPath":"@lssm-tech/lib.knowledge/grounding/citations","target":"./src/grounding/citations.ts","targets":[{"conditions":[],"target":"./src/grounding/citations.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/citations.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/citations.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/context-evidence","importPath":"@lssm-tech/lib.knowledge/grounding/context-evidence","target":"./src/grounding/context-evidence.ts","targets":[{"conditions":[],"target":"./src/grounding/context-evidence.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/context-evidence.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/context-evidence.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/drafting","importPath":"@lssm-tech/lib.knowledge/grounding/drafting","target":"./src/grounding/drafting.ts","targets":[{"conditions":[],"target":"./src/grounding/drafting.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/drafting.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/drafting.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/fingerprints","importPath":"@lssm-tech/lib.knowledge/grounding/fingerprints","target":"./src/grounding/fingerprints.ts","targets":[{"conditions":[],"target":"./src/grounding/fingerprints.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/fingerprints.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/fingerprints.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/fusion","importPath":"@lssm-tech/lib.knowledge/grounding/fusion","target":"./src/grounding/fusion.ts","targets":[{"conditions":[],"target":"./src/grounding/fusion.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/fusion.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/fusion.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/knowledge-retriever-channel","importPath":"@lssm-tech/lib.knowledge/grounding/knowledge-retriever-channel","target":"./src/grounding/knowledge-retriever-channel.ts","targets":[{"conditions":[],"target":"./src/grounding/knowledge-retriever-channel.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/knowledge-retriever-channel.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/knowledge-retriever-channel.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/legacy-adapter","importPath":"@lssm-tech/lib.knowledge/grounding/legacy-adapter","target":"./src/grounding/legacy-adapter.ts","targets":[{"conditions":[],"target":"./src/grounding/legacy-adapter.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/legacy-adapter.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/legacy-adapter.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/record-projection","importPath":"@lssm-tech/lib.knowledge/grounding/record-projection","target":"./src/grounding/record-projection.ts","targets":[{"conditions":[],"target":"./src/grounding/record-projection.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/record-projection.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/record-projection.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/redaction","importPath":"@lssm-tech/lib.knowledge/grounding/redaction","target":"./src/grounding/redaction.ts","targets":[{"conditions":[],"target":"./src/grounding/redaction.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/redaction.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/redaction.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/retrieval","importPath":"@lssm-tech/lib.knowledge/grounding/retrieval","target":"./src/grounding/retrieval.ts","targets":[{"conditions":[],"target":"./src/grounding/retrieval.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/retrieval.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/retrieval.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/service","importPath":"@lssm-tech/lib.knowledge/grounding/service","target":"./src/grounding/service.ts","targets":[{"conditions":[],"target":"./src/grounding/service.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/service.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/service.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/support-verification","importPath":"@lssm-tech/lib.knowledge/grounding/support-verification","target":"./src/grounding/support-verification.ts","targets":[{"conditions":[],"target":"./src/grounding/support-verification.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/support-verification.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/support-verification.ts","sourceStatus":"verified source file"}]},{"subpath":"./grounding/types","importPath":"@lssm-tech/lib.knowledge/grounding/types","target":"./src/grounding/types.ts","targets":[{"conditions":[],"target":"./src/grounding/types.ts","sourcePath":"packages/platform/agents/knowledge/src/grounding/types.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/grounding/types.ts","sourceStatus":"verified source file"}]},{"subpath":"./i18n","importPath":"@lssm-tech/lib.knowledge/i18n","target":"./src/i18n/index.ts","targets":[{"conditions":[],"target":"./src/i18n/index.ts","sourcePath":"packages/platform/agents/knowledge/src/i18n/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/i18n/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./i18n/catalogs","importPath":"@lssm-tech/lib.knowledge/i18n/catalogs","target":"./src/i18n/catalogs/index.ts","targets":[{"conditions":[],"target":"./src/i18n/catalogs/index.ts","sourcePath":"packages/platform/agents/knowledge/src/i18n/catalogs/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/i18n/catalogs/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./i18n/catalogs/en","importPath":"@lssm-tech/lib.knowledge/i18n/catalogs/en","target":"./src/i18n/catalogs/en.ts","targets":[{"conditions":[],"target":"./src/i18n/catalogs/en.ts","sourcePath":"packages/platform/agents/knowledge/src/i18n/catalogs/en.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/i18n/catalogs/en.ts","sourceStatus":"verified source file"}]},{"subpath":"./i18n/catalogs/es","importPath":"@lssm-tech/lib.knowledge/i18n/catalogs/es","target":"./src/i18n/catalogs/es.ts","targets":[{"conditions":[],"target":"./src/i18n/catalogs/es.ts","sourcePath":"packages/platform/agents/knowledge/src/i18n/catalogs/es.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/i18n/catalogs/es.ts","sourceStatus":"verified source file"}]},{"subpath":"./i18n/catalogs/fr","importPath":"@lssm-tech/lib.knowledge/i18n/catalogs/fr","target":"./src/i18n/catalogs/fr.ts","targets":[{"conditions":[],"target":"./src/i18n/catalogs/fr.ts","sourcePath":"packages/platform/agents/knowledge/src/i18n/catalogs/fr.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/i18n/catalogs/fr.ts","sourceStatus":"verified source file"}]},{"subpath":"./i18n/keys","importPath":"@lssm-tech/lib.knowledge/i18n/keys","target":"./src/i18n/keys.ts","targets":[{"conditions":[],"target":"./src/i18n/keys.ts","sourcePath":"packages/platform/agents/knowledge/src/i18n/keys.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/i18n/keys.ts","sourceStatus":"verified source file"}]},{"subpath":"./i18n/locale","importPath":"@lssm-tech/lib.knowledge/i18n/locale","target":"./src/i18n/locale.ts","targets":[{"conditions":[],"target":"./src/i18n/locale.ts","sourcePath":"packages/platform/agents/knowledge/src/i18n/locale.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/i18n/locale.ts","sourceStatus":"verified source file"}]},{"subpath":"./i18n/messages","importPath":"@lssm-tech/lib.knowledge/i18n/messages","target":"./src/i18n/messages.ts","targets":[{"conditions":[],"target":"./src/i18n/messages.ts","sourcePath":"packages/platform/agents/knowledge/src/i18n/messages.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/i18n/messages.ts","sourceStatus":"verified source file"}]},{"subpath":"./ingestion","importPath":"@lssm-tech/lib.knowledge/ingestion","target":"./src/ingestion/index.ts","targets":[{"conditions":[],"target":"./src/ingestion/index.ts","sourcePath":"packages/platform/agents/knowledge/src/ingestion/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/ingestion/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./ingestion/document-processor","importPath":"@lssm-tech/lib.knowledge/ingestion/document-processor","target":"./src/ingestion/document-processor.ts","targets":[{"conditions":[],"target":"./src/ingestion/document-processor.ts","sourcePath":"packages/platform/agents/knowledge/src/ingestion/document-processor.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/ingestion/document-processor.ts","sourceStatus":"verified source file"}]},{"subpath":"./ingestion/drive-adapter","importPath":"@lssm-tech/lib.knowledge/ingestion/drive-adapter","target":"./src/ingestion/drive-adapter.ts","targets":[{"conditions":[],"target":"./src/ingestion/drive-adapter.ts","sourcePath":"packages/platform/agents/knowledge/src/ingestion/drive-adapter.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/ingestion/drive-adapter.ts","sourceStatus":"verified source file"}]},{"subpath":"./ingestion/embedding-service","importPath":"@lssm-tech/lib.knowledge/ingestion/embedding-service","target":"./src/ingestion/embedding-service.ts","targets":[{"conditions":[],"target":"./src/ingestion/embedding-service.ts","sourcePath":"packages/platform/agents/knowledge/src/ingestion/embedding-service.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/ingestion/embedding-service.ts","sourceStatus":"verified source file"}]},{"subpath":"./ingestion/gmail-adapter","importPath":"@lssm-tech/lib.knowledge/ingestion/gmail-adapter","target":"./src/ingestion/gmail-adapter.ts","targets":[{"conditions":[],"target":"./src/ingestion/gmail-adapter.ts","sourcePath":"packages/platform/agents/knowledge/src/ingestion/gmail-adapter.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/ingestion/gmail-adapter.ts","sourceStatus":"verified source file"}]},{"subpath":"./ingestion/storage-adapter","importPath":"@lssm-tech/lib.knowledge/ingestion/storage-adapter","target":"./src/ingestion/storage-adapter.ts","targets":[{"conditions":[],"target":"./src/ingestion/storage-adapter.ts","sourcePath":"packages/platform/agents/knowledge/src/ingestion/storage-adapter.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/ingestion/storage-adapter.ts","sourceStatus":"verified source file"}]},{"subpath":"./ingestion/vector-indexer","importPath":"@lssm-tech/lib.knowledge/ingestion/vector-indexer","target":"./src/ingestion/vector-indexer.ts","targets":[{"conditions":[],"target":"./src/ingestion/vector-indexer.ts","sourcePath":"packages/platform/agents/knowledge/src/ingestion/vector-indexer.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/ingestion/vector-indexer.ts","sourceStatus":"verified source file"}]},{"subpath":"./knowledge.feature","importPath":"@lssm-tech/lib.knowledge/knowledge.feature","target":"./src/knowledge.feature.ts","targets":[{"conditions":[],"target":"./src/knowledge.feature.ts","sourcePath":"packages/platform/agents/knowledge/src/knowledge.feature.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/knowledge.feature.ts","sourceStatus":"verified source file"}]},{"subpath":"./query","importPath":"@lssm-tech/lib.knowledge/query","target":"./src/query/index.ts","targets":[{"conditions":[],"target":"./src/query/index.ts","sourcePath":"packages/platform/agents/knowledge/src/query/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/query/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./query/service","importPath":"@lssm-tech/lib.knowledge/query/service","target":"./src/query/service.ts","targets":[{"conditions":[],"target":"./src/query/service.ts","sourcePath":"packages/platform/agents/knowledge/src/query/service.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/query/service.ts","sourceStatus":"verified source file"}]},{"subpath":"./retriever","importPath":"@lssm-tech/lib.knowledge/retriever","target":"./src/retriever/index.ts","targets":[{"conditions":[],"target":"./src/retriever/index.ts","sourcePath":"packages/platform/agents/knowledge/src/retriever/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/retriever/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./retriever/i18n-plan","importPath":"@lssm-tech/lib.knowledge/retriever/i18n-plan","target":"./src/retriever/i18n-plan.ts","targets":[{"conditions":[],"target":"./src/retriever/i18n-plan.ts","sourcePath":"packages/platform/agents/knowledge/src/retriever/i18n-plan.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/retriever/i18n-plan.ts","sourceStatus":"verified source file"}]},{"subpath":"./retriever/interface","importPath":"@lssm-tech/lib.knowledge/retriever/interface","target":"./src/retriever/interface.ts","targets":[{"conditions":[],"target":"./src/retriever/interface.ts","sourcePath":"packages/platform/agents/knowledge/src/retriever/interface.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/retriever/interface.ts","sourceStatus":"verified source file"}]},{"subpath":"./retriever/static-retriever","importPath":"@lssm-tech/lib.knowledge/retriever/static-retriever","target":"./src/retriever/static-retriever.ts","targets":[{"conditions":[],"target":"./src/retriever/static-retriever.ts","sourcePath":"packages/platform/agents/knowledge/src/retriever/static-retriever.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/retriever/static-retriever.ts","sourceStatus":"verified source file"}]},{"subpath":"./retriever/vector-retriever","importPath":"@lssm-tech/lib.knowledge/retriever/vector-retriever","target":"./src/retriever/vector-retriever.ts","targets":[{"conditions":[],"target":"./src/retriever/vector-retriever.ts","sourcePath":"packages/platform/agents/knowledge/src/retriever/vector-retriever.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/retriever/vector-retriever.ts","sourceStatus":"verified source file"}]},{"subpath":"./runtime","importPath":"@lssm-tech/lib.knowledge/runtime","target":"./src/runtime.ts","targets":[{"conditions":[],"target":"./src/runtime.ts","sourcePath":"packages/platform/agents/knowledge/src/runtime.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/runtime.ts","sourceStatus":"verified source file"}]},{"subpath":"./runtime-config","importPath":"@lssm-tech/lib.knowledge/runtime-config","target":"./src/runtime-config.ts","targets":[{"conditions":[],"target":"./src/runtime-config.ts","sourcePath":"packages/platform/agents/knowledge/src/runtime-config.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/runtime-config.ts","sourceStatus":"verified source file"}]},{"subpath":"./runtime-provider-sync","importPath":"@lssm-tech/lib.knowledge/runtime-provider-sync","target":"./src/runtime-provider-sync.ts","targets":[{"conditions":[],"target":"./src/runtime-provider-sync.ts","sourcePath":"packages/platform/agents/knowledge/src/runtime-provider-sync.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/runtime-provider-sync.ts","sourceStatus":"verified source file"}]},{"subpath":"./types","importPath":"@lssm-tech/lib.knowledge/types","target":"./src/types.ts","targets":[{"conditions":[],"target":"./src/types.ts","sourcePath":"packages/platform/agents/knowledge/src/types.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/types.ts","sourceStatus":"verified source file"}]},{"subpath":"./vector-payload","importPath":"@lssm-tech/lib.knowledge/vector-payload","target":"./src/vector-payload.ts","targets":[{"conditions":[],"target":"./src/vector-payload.ts","sourcePath":"packages/platform/agents/knowledge/src/vector-payload.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/vector-payload.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/knowledge.capability","importPath":"@lssm-tech/lib.knowledge/contracts/knowledge.capability","target":"./src/contracts/knowledge.capability.ts","targets":[{"conditions":[],"target":"./src/contracts/knowledge.capability.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/knowledge.capability.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/knowledge.capability.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/knowledge.feature","importPath":"@lssm-tech/lib.knowledge/contracts/knowledge.feature","target":"./src/contracts/knowledge.feature.ts","targets":[{"conditions":[],"target":"./src/contracts/knowledge.feature.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/knowledge.feature.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/knowledge.feature.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/operation-models","importPath":"@lssm-tech/lib.knowledge/contracts/operation-models","target":"./src/contracts/operation-models.ts","targets":[{"conditions":[],"target":"./src/contracts/operation-models.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/operation-models.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/operation-models.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/operations","importPath":"@lssm-tech/lib.knowledge/contracts/operations","target":"./src/contracts/operations.ts","targets":[{"conditions":[],"target":"./src/contracts/operations.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/operations.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/operations.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/spaces/email-threads","importPath":"@lssm-tech/lib.knowledge/contracts/spaces/email-threads","target":"./src/contracts/spaces/email-threads.ts","targets":[{"conditions":[],"target":"./src/contracts/spaces/email-threads.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/spaces/email-threads.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/spaces/email-threads.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/spaces/financial-docs","importPath":"@lssm-tech/lib.knowledge/contracts/spaces/financial-docs","target":"./src/contracts/spaces/financial-docs.ts","targets":[{"conditions":[],"target":"./src/contracts/spaces/financial-docs.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/spaces/financial-docs.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/spaces/financial-docs.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/spaces/financial-overview","importPath":"@lssm-tech/lib.knowledge/contracts/spaces/financial-overview","target":"./src/contracts/spaces/financial-overview.ts","targets":[{"conditions":[],"target":"./src/contracts/spaces/financial-overview.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/spaces/financial-overview.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/spaces/financial-overview.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/spaces/support-faq","importPath":"@lssm-tech/lib.knowledge/contracts/spaces/support-faq","target":"./src/contracts/spaces/support-faq.ts","targets":[{"conditions":[],"target":"./src/contracts/spaces/support-faq.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/spaces/support-faq.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/spaces/support-faq.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/spaces/uploaded-docs","importPath":"@lssm-tech/lib.knowledge/contracts/spaces/uploaded-docs","target":"./src/contracts/spaces/uploaded-docs.ts","targets":[{"conditions":[],"target":"./src/contracts/spaces/uploaded-docs.ts","sourcePath":"packages/platform/agents/knowledge/src/contracts/spaces/uploaded-docs.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/src/contracts/spaces/uploaded-docs.ts","sourceStatus":"verified source file"}]}],"entryCount":66,"namedSymbolCoverage":"catalog declarations only; exhaustive TypeScript symbols not extracted","installationStatus":"not verified"},"docsLinks":[{"title":"Lib Knowledge documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Flib.knowledge","kind":"readme","pinnedUrl":null,"sourceStatus":"declared link; destination not verified"}],"sourceUrls":{"package":"https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge","manifest":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/package.json","readme":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/README.md","guide":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.knowledge.txt"},"readme":{"status":"available","body":"# @lssm-tech/lib.knowledge\n\n`@lssm-tech/lib.knowledge` provides the retrieval, ingestion, query, and access-control primitives used to turn documents and external content into searchable knowledge for agents and workflows.\n\nWebsite: https://contractspec.io\n\nCanonical source-management contracts are available under `./contracts/operations`,\n`./contracts/operation-models`, `./contracts/knowledge.capability`, and\n`./contracts/knowledge.feature`. The latter retains the `platform.knowledge`\nfeature identity; the existing package feature remains `libs.knowledge`.\nThe five built-in spaces (`email-threads`, `financial-docs`, `financial-overview`,\n`support-faq`, and `uploaded-docs`) live under `./contracts/spaces/` alongside\nProduct Canon. Historical ContractSpec paths forward to these exact objects and\nthe existing nominal registry. Source policies and registration behavior remain\nunchanged.\n\n## Installation\n\n`bun add @lssm-tech/lib.knowledge`\n\nor\n\n`npm install @lssm-tech/lib.knowledge`\n\n## What belongs here\n\nThis package currently owns these related concerns:\n\n- Retrieval contracts and implementations: `KnowledgeRetriever`, `StaticRetriever`, and `VectorRetriever`.\n- Ingestion and indexing pipeline pieces: `DocumentProcessor`, `EmbeddingService`, `VectorIndexer`, and ingestion adapters.\n- Retrieval-augmented query flow: `KnowledgeQueryService` and `KnowledgeQueryOptions`.\n- Runtime convenience for OSS consumers: `KnowledgeRuntime` and `createKnowledgeRuntime`.\n- First-class Gmail and Google Drive orchestration for ingestion/query flows.\n- Mutation governance helpers for dry-runs, approvals, idempotency, audit evidence, and outbound-send gates.\n- CompanyOS connector readiness manifests for deterministic support desk, CRM, warehouse, collaboration, project, docs, email, and meeting coverage without live provider calls or production writes.\n- Access guardrails and localization: `KnowledgeAccessGuard` and the `i18n` surface.\n\nUse this package when you need the knowledge-layer primitives inside ContractSpec. It is not the source of truth for knowledge-space specs, tenant bindings, provider SDKs, or background job orchestration.\n\n## Core workflows\n\n### Quickstart: one runtime for ingest + retrieve + answer\n\n```ts\nimport { createKnowledgeRuntime } from \"@lssm-tech/lib.knowledge\";\n\nconst knowledge = createKnowledgeRuntime({\n  collection: \"knowledge-support-faq\",\n  namespace: \"tenant-acme\",\n  spaceKey: \"support-faq\",\n  embeddings: embeddingProvider,\n  vectorStore: vectorStoreProvider,\n  llm: llmProvider,\n});\n\nawait knowledge.ingestDocument({\n  id: \"faq-rotate-key\",\n  mimeType: \"text/plain\",\n  data: new TextEncoder().encode(\"Rotate API keys from Settings > API.\"),\n  metadata: { locale: \"en\", category: \"canonical\" },\n});\n\nconst snippets = await knowledge.retrieve(\"How do I rotate a key?\", {\n  spaceKey: \"support-faq\",\n  tenantId: \"tenant-acme\",\n  locale: \"en\",\n  category: \"canonical\",\n});\n\nconst answer = await knowledge.query(\"How do I rotate a key?\", {\n  namespace: \"tenant-acme\",\n  filter: { locale: \"en\" },\n});\n```\n\n### Sync Gmail and Google Drive into knowledge\n\n```ts\nimport { createKnowledgeRuntime } from \"@lssm-tech/lib.knowledge\";\n\nconst knowledge = createKnowledgeRuntime({\n  collection: \"knowledge-workspace\",\n  namespace: \"tenant-acme\",\n  spaceKey: \"workspace\",\n  embeddings: embeddingProvider,\n  vectorStore: vectorStoreProvider,\n  gmail: gmailProvider,\n  drive: googleDriveProvider,\n  deltaCheckpointStore,\n});\n\nawait knowledge.syncGmail(\n  { label: \"support\" },\n  {\n    sourceId: \"src_gmail_support\",\n    evidenceRef: \"audit://sync/gmail/support\",\n  },\n);\n\nawait knowledge.syncDriveFiles(\n  { query: \"mimeType = 'text/plain' and trashed = false\" },\n  {\n    sourceId: \"src_drive_support\",\n    evidenceRef: \"audit://sync/drive/support\",\n  },\n);\n\nawait knowledge.watchDriveChanges(\n  {\n    channelId: \"drive-support-watch\",\n    webhookUrl: \"https://app.example.com/webhooks/google-drive\",\n  },\n  { sourceId: \"src_drive_support\" },\n);\n```\n\nGmail and Drive sync use provider contracts from `@lssm-tech/lib.contracts-integrations`. Delta-aware callers can pass and receive lease, cursor/watermark, webhook channel, provider-event, dedupe, idempotency, replay-checkpoint, and tombstone state through `ProviderDeltaSyncState`. When `deltaCheckpointStore` is configured, `syncGmail()`, `syncDriveFiles()`, and `watchDriveChanges()` load the last checkpoint by source ID before calling the provider, then save the returned provider delta before the caller acknowledges sync work.\n\n### Govern knowledge mutations\n\n```ts\nimport {\n  executeGovernedKnowledgeMutation,\n} from \"@lssm-tech/lib.knowledge/governance\";\n\nconst result = await executeGovernedKnowledgeMutation(\n  {\n    operation: \"gmail.message.send\",\n    requiresApproval: true,\n    outboundSend: true,\n    governance: {\n      idempotencyKey: \"tenant:gmail-send:123\",\n      auditEvidence: { evidenceRef: \"audit://gmail-send/123\" },\n      approvalRefs: [{ id: \"approval-123\" }],\n      outboundSendGate: {\n        status: \"approved\",\n        evidenceRef: \"gate://gmail-send/123\",\n      },\n    },\n  },\n  () => gmailProvider.sendMessage(message),\n  { audit: (envelope) => auditTrail.write(envelope) },\n);\n```\n\nSet `governance.dryRun` to inspect the plan without executing. Non-dry-run mutations require an idempotency key and audit evidence; approval-required and outbound-send operations require approval refs, and outbound sends require an approved send gate. Every result includes an `auditEnvelope` so app runtimes, Connect review packets, and provider replay tooling can reference the same decision evidence.\n\n### Ingest documents into a vector index\n\n```ts\nimport {\n  DocumentProcessor,\n  EmbeddingService,\n  StorageIngestionAdapter,\n  VectorIndexer,\n} from \"@lssm-tech/lib.knowledge\";\n\nconst processor = new DocumentProcessor();\nconst embeddings = new EmbeddingService(embeddingProvider);\nconst indexer = new VectorIndexer(vectorStoreProvider, {\n  collection: \"knowledge-docs\",\n  namespace: \"tenant-acme\",\n});\n\nconst adapter = new StorageIngestionAdapter(processor, embeddings, indexer);\nawait adapter.ingestObject(objectFromStorageProvider);\n```\n\n### Run retrieval or RAG queries\n\nVerified grounded answers can be projected through\n`projectGroundedResultToContextEvidenceV1`. The projection revalidates trusted\nscope, citations, redaction identity, and replay fingerprints before returning\nviewer-scoped excerpts. It never grants instruction or effect authority.\n\n```ts\nimport {\n  KnowledgeQueryService,\n  createVectorRetriever,\n} from \"@lssm-tech/lib.knowledge\";\n\nconst retriever = createVectorRetriever({\n  embeddings: embeddingProvider,\n  vectorStore: vectorStoreProvider,\n  spaceCollections: {\n    \"support-faq\": \"knowledge-support-faq\",\n  },\n});\n\nconst snippets = await retriever.retrieve(\"How do I rotate a key?\", {\n  spaceKey: \"support-faq\",\n  topK: 3,\n  locale: \"en\",\n  category: \"canonical\",\n});\n\nconst queryService = new KnowledgeQueryService(\n  embeddingProvider,\n  vectorStoreProvider,\n  llmProvider,\n  {\n    collection: \"knowledge-support-faq\",\n    namespace: \"tenant-acme\",\n    topK: 5,\n  }\n);\nconst answer = await queryService.query(\"How do I rotate a key?\", {\n  namespace: \"tenant-acme\",\n  topK: 3,\n  filter: { locale: \"en\" },\n});\n```\n\n### Use static knowledge for tests or lightweight examples\n\n```ts\nimport { createStaticRetriever } from \"@lssm-tech/lib.knowledge\";\n\nconst retriever = createStaticRetriever({\n  \"product-canon\": [\n    \"Rotate API keys from Settings > API.\",\n    \"Only cite reviewed canon content in answers.\",\n  ].join(\"\\n\"),\n});\n\nconst snippets = await retriever.retrieve(\"rotate\", {\n  spaceKey: \"product-canon\",\n  topK: 1,\n});\n```\n\n### Localize prompts and access messages\n\n```ts\nimport { createKnowledgeI18n } from \"@lssm-tech/lib.knowledge/i18n\";\n\nconst i18n = createKnowledgeI18n(\"fr\");\nconst noResults = i18n.t(\"query.noResults\");\n```\n\nTypical flow:\n\n1. Extract fragments from raw content.\n2. Embed fragments and upsert them into a vector collection.\n3. Use `GmailIngestionAdapter`, `DriveIngestionAdapter`, or runtime sync helpers when content originates from workspace providers.\n4. Retrieve snippets through a retriever or generate an answer through `KnowledgeQueryService`.\n5. Gate reads and writes with `KnowledgeAccessGuard`, and gate mutations with the governance helpers when operating against external systems.\n\n## API map\n\n### Retrieval\n\n- `KnowledgeRetriever`: shared retrieval interface for semantic and static retrieval.\n- `RetrieverConfig`: shared defaults for retriever implementations.\n- `StaticRetriever` and `createStaticRetriever`: in-memory, line-oriented retrieval for simple spaces and tests.\n- `VectorRetriever` and `createVectorRetriever`: embedding + vector-store backed retrieval.\n- `RetrievalOptions`: query filters such as `spaceKey`, `topK`, `minScore`, `tenantId`, `locale`, `category`, and provider filter metadata.\n- `RetrievalResult`: returned content, source, score, and optional metadata.\n\n### Query\n\n- `KnowledgeQueryService`: embed -> search -> prompt -> LLM chat flow for knowledge-backed answers.\n- `KnowledgeQueryConfig`: collection, namespace, prompt, filter, `topK`, and locale defaults.\n- `KnowledgeQueryOptions`: per-query overrides for namespace, `topK`, filter, locale, and prompt.\n- `KnowledgeAnswer`: answer text, references, and optional token usage.\n\n### Ingestion\n\n- `RawDocument`, `DocumentFragment`, and `DocumentProcessor`: extract raw document content into indexable fragments.\n- `EmbeddingService`: batch fragment embeddings through an `EmbeddingProvider`.\n- `VectorIndexer` and `VectorIndexConfig`: map embeddings to `VectorStoreProvider.upsert()` requests and persist canonical `payload.text` content for later retrieval/query use.\n- `GmailIngestionAdapter`: convert email threads into plaintext documents and index them.\n- `DriveIngestionAdapter`: convert Google Drive files into raw documents, skip tombstones, and index them.\n- `StorageIngestionAdapter`: fetch object content and run the same process/index pipeline.\n- `KnowledgeRuntime` and `createKnowledgeRuntime`: convenience composition for the common ingest -> sync -> retrieve -> answer path.\n- `KnowledgeProviderDeltaCheckpointStore`: optional runtime checkpoint store for loading and saving Gmail/Drive provider delta state per source.\n- `KnowledgePersistencePort`: optional database persistence port for fragments, sync checkpoints, and query evidence. It records provenance without changing retriever or `KnowledgeAnswer` shapes.\n\n### Mutation governance\n\n- `KnowledgeMutationRequest`: describes a proposed mutation, whether it needs approval, and whether it sends outbound content.\n- `KnowledgeMutationGovernance`: carries dry-run, approval refs, idempotency key, audit evidence, and outbound-send gate state.\n- `evaluateKnowledgeMutationGovernance`: returns the plan, missing evidence, and block reasons without executing.\n- `executeGovernedKnowledgeMutation`: executes only when the plan is allowed; otherwise returns `dry_run` or `blocked`.\n\n### Grounded Company Intelligence retrieval\n\n- `./grounding` exposes an additive, fail-closed grounded-answer service. Authorization preflight runs before retrieval, and an empty or denied evidence scope produces zero retrieval, draft, and verification calls.\n- Hybrid channels are bounded to three calls, postvalidated against tenant, workspace, eligible evidence, ACL, and authorization-decision scope, then deterministically fused.\n- Viewer redaction happens before citation-ledger creation, fingerprints, drafting, or verification. Draft and verifier ports see only server aliases plus redacted excerpts; they cannot mint public evidence, citation, policy, or authority refs.\n- Drafting is strict and atomic, independent verification is mandatory, and there is at most one repair. Only a schema-valid, fully supported result has status `answered`.\n- `adaptGroundedResultToKnowledgeAnswer()` adapts only a semantically validated `answered` result to the legacy `KnowledgeAnswer` shape. Every unsafe state remains discriminated and cannot be flattened into a successful legacy answer.\n- Fixture adapters are reference-test infrastructure. Production mode rejects fixture channel or provider provenance with `fixture_adapter_forbidden`.\n- Grounded knowledge is evidence, never action authority: every result fixes `knowledgeAuthorizesAction` to `false`.\n\n### Original documents and scoped evidence\n\n- `./evidence` adds original-document custody and document evidence. `OriginalDocumentCustody` verifies size and SHA-256 against the delivered bytes, stores originals content-addressed and insert-only through an `ObjectStorageProvider`, appends account-bound provenance for duplicate bytes, and quarantines media-type mismatches.\n- `DocumentExtractorRegistry` ships only a strict UTF-8 text extractor. `registerPdfTextExtractor()` and `registerOcrExtractor()` accept the Builder runtime extractor shapes (for example `DefaultBuilderPdfExtractor`). `extractWithReadability()` returns `readable`, `partial`, `unreadable` or `needs_ocr` with typed reasons and a next action; empty output is never a success and partial OCR never claims completeness.\n- `DocumentEvidencePipeline` runs custody → extraction → `FragmentEvidenceRecord`s → a partitioned vector projection. Re-ingesting identical bytes with the same extractor plan replays the run; a new version supersedes the previous evidence. Production mode refuses a non-durable `DocumentEvidenceLedger`. Ledgers receive each run's scope, source and fragment text; `readFragmentTexts()` returns text for current evidence only and withdrawal erases it. The durable implementation lives in Company Intelligence (canonical CI records plus custody/extraction tables).\n- `retrieveScopedEvidence()` searches only the context/account partitions granted to the viewer and re-validates each candidate against the ledger (current state, visibility, fragment fingerprint, original custody) before ranking. `createScopedEvidenceGroundingChannel()` plugs it into `./grounding`.\n- `resolveEvidenceCitations()` resolves citations to the original (ref, digest, media type, size) and the fragment locator, and rejects withdrawn, superseded, foreign or tampered citations.\n- `consumeKnowledgeSourceWithdrawal()` consumes the `knowledge.source.withdrawn` event (`./contracts/evidence-events`): evidence becomes `withdrawn` first, then vectors are deleted. `createGmailAttachmentCustodyPort()` and `createEvidenceGmailWithdrawal()` connect Gmail attachment hand-offs and thread withdrawals.\n- `resolveKnowledgeProcessingRoute()` binds one explicit model route per workflow capability (exact model, account, data-processing terms, budget, explicit fallbacks); missing or invalid configuration is `configuration_required`. `createRoutedChat()` pins the route model, enforces the budget and records usage; indeterminate outcomes are never retried.\n\n### Guardrails and i18n\n\n- `KnowledgeAccessGuard` and `KnowledgeAccessGuardOptions`: policy-aware checks for read/write/search operations.\n- `KnowledgeAccessContext` and `KnowledgeAccessResult`: runtime input/output contracts for access checks.\n- `createKnowledgeI18n` and `getDefaultI18n`: localization entrypoints for prompts, guard messages, and ingestion formatting.\n- `./i18n`, `./i18n/catalogs/*`, `./i18n/keys`, `./i18n/locale`, and `./i18n/messages`: public i18n subpaths.\n\n## Public entrypoints\n\nThe root barrel at `src/index.ts` re-exports public symbols from:\n\n- `./access`\n- `./ingestion`\n- `./knowledge.feature`\n- `./query`\n- `./runtime`\n- `./retriever`\n- `./types`\n- `./vector-payload`\n\nPublished subpaths from `package.json` are grouped around:\n\n- access: `./access`, `./access/guard`\n- retrieval: `./retriever`, `./retriever/interface`, `./retriever/static-retriever`, `./retriever/vector-retriever`\n- query: `./query`, `./query/service`\n- ingestion: `./ingestion`, `./ingestion/document-processor`, `./ingestion/drive-adapter`, `./ingestion/embedding-service`, `./ingestion/gmail-adapter`, `./ingestion/storage-adapter`, `./ingestion/vector-indexer`\n- governance: `./governance`\n- grounded retrieval: `./grounding`\n- document evidence: `./evidence`, `./contracts/evidence-events`\n- feature/runtime helpers: `./knowledge.feature`, root `KnowledgeRuntime` / `createKnowledgeRuntime`\n- i18n: `./i18n`, `./i18n/catalogs`, `./i18n/catalogs/en`, `./i18n/catalogs/es`, `./i18n/catalogs/fr`, `./i18n/keys`, `./i18n/locale`, `./i18n/messages`\n- shared types/helpers: `./types`, `./vector-payload`\n\nUse `package.json` as the exhaustive source of truth for subpaths; the README calls out the clusters that matter most to consumers.\n\n## Operational semantics and gotchas\n\n- `DocumentProcessor` only ships built-in extractors for `text/plain` and `application/json`.\n- If no extractor matches, `DocumentProcessor.process()` throws unless you registered a fallback such as `*/*`.\n- If an extractor returns no fragments, or only whitespace fragments, `DocumentProcessor.process()` returns `[]` so nothing unreadable is embedded; `VectorIndexer.upsert()` skips empty batches. Use `extractWithReadability()` for an explicit readability state.\n- `EmbeddingService` batches fragments; the default batch size is `16`.\n- `StaticRetriever.retrieve()` does simple line-level substring matching. It is not semantic retrieval.\n- `StaticRetriever` honors `topK` and `minScore`, but its scores are always `1.0` for matching lines.\n- `VectorRetriever.retrieve()` returns `[]` when the requested `spaceKey` is not mapped to a collection.\n- `VectorRetriever` uses `tenantId` as the vector-store namespace when provided and automatically merges typed `locale` / `category` filters into the provider filter payload.\n- `VectorIndexer.upsert()` stores fragment text under `payload.text`, together with merged fragment/config metadata and `documentId`. Fragment metadata wins over config metadata when keys collide.\n- `KnowledgeQueryService` always runs embed -> vector search -> prompt build -> `LLMProvider.chat()`, using indexed `payload.text` as the primary context source and falling back to legacy `payload.content` when needed. Per-query overrides let you change namespace, `topK`, filter, locale, and prompt without rebuilding the service.\n- `KnowledgeAccessGuard` defaults to blocking writes to `external` and `ephemeral` knowledge categories.\n- `KnowledgeAccessGuard` also blocks writes when `ResolvedKnowledge.space.access.automationWritable` is `false`.\n- `KnowledgeAccessGuard` defaults to requiring workflow binding and not requiring agent binding. If a scoped workflow or agent allow-list exists, missing names are denied rather than silently bypassed.\n- `GmailIngestionAdapter` converts threads into plaintext and strips HTML when text bodies are missing.\n- `DriveIngestionAdapter` indexes Google Drive files through the same processor -> embedding -> indexer path and skips tombstoned metadata or file records before indexing.\n- `KnowledgeRuntime.syncGmail()`, `KnowledgeRuntime.syncDriveFiles()`, and `KnowledgeRuntime.watchDriveChanges()` are convenience orchestration methods; provider scheduling, credential refresh, and long-running background sync remain outside this package.\n- Runtime sync helpers load and save `ProviderDeltaSyncState` through the optional checkpoint store when a source ID is provided.\n- `KnowledgeRuntime` can call an optional persistence port after ingestion/query to store fragments and query evidence; failures are explicit host-adapter concerns rather than hidden vector-store behavior.\n- `executeGovernedKnowledgeMutation()` never executes dry-runs or blocked mutations.\n- Grounded retrieval never performs provider discovery, credential resolution, persistence, dispatch, or action execution. Hosts own runtime adapters and must preserve the authorization/redaction boundary.\n- Non-dry-run mutations require `idempotencyKey` and `auditEvidence.evidenceRef`.\n- Mutation execution returns an audit envelope and can call an audit sink before returning.\n- Outbound sends require an approved `outboundSendGate` and at least one approval ref.\n- This package localizes access messages, query prompts, and Gmail formatting through the `i18n` surface.\n\n## When not to use this package\n\n- Do not use it as a vector store implementation.\n- Do not use it as an embedding-model implementation.\n- Do not use it as a full sync scheduler or background job system.\n- Do not use it as the source of truth for `KnowledgeSpaceSpec`, knowledge sources, or tenant bindings.\n\n## Related packages\n\n- `@lssm-tech/lib.contracts-integrations`: provider interfaces used by vector, embedding, LLM, email, and storage integrations.\n- `@lssm-tech/lib.contracts-spec`: source of knowledge-space specs, resolved bindings, and shared translation helpers.\n- `@lssm-tech/lib.ai-agent`: major consumer of retrieval and query contracts.\n- `@lssm-tech/example.knowledge-canon`: runnable package-level example of binding knowledge spaces and answering through `lib.knowledge`.\n- Context-storage modules and bundles in the repo reuse the ingestion pipeline primitives for document indexing flows.\n\n## Local commands\n\n- `bun run lint:check`\n- `bun run typecheck`\n- `bun run test`\n- `bun run test:company-intelligence:grounding`\n\nGrounding uses the pure Core grounding contracts and validator. Legacy adapters keep their original two-argument calls, fail-closed schema/semantic checks and wire results. Company host bindings and evidence projections remain outside Core.\n\n## Canonical ownership\n\nThe complete portable Knowledge binding/source/spec families remain canonical Core forwards (including the current complete source helper). Knowledge owns the original nominal KnowledgeSpaceRegistry and Product Canon singleton. The access guard retains its exact full ResolvedKnowledge/ResolvedAppConfig signatures through the canonical RuntimeCore host types; no generic widening or host-field clone is introduced. Old registry and Product Canon leaves forward the same implementations. Source-only qualification precedes task adoption and affected producer/consumer execution.\n","sourcePath":"packages/platform/agents/knowledge/README.md","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/knowledge/README.md","blobSha":"c383fee8b6651475604cef47941574de15821dc8","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","origin":"Pinned original README; generated guide appendix stored separately","integrity":"exact Git blob match","executionStatus":"not executed"},"provenance":{"repository":"lssm-tech/contractspec","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","manifestOrigin":"pinned GitHub manifest fetch","manifestComplete":true,"publicationPolicyApplied":false},"areaSlug":"knowledge-and-retrieval","areaTitle":"Knowledge, retrieval and evidence","displayName":"lib.knowledge","runtimes":["node"],"platforms":["server"],"kind":"library","scope":"Package manifest","canonicalRoute":"/docs/packages/lib.knowledge/","contextUrl":"/docs/packages/lib.knowledge.context.md","documentKind":"package-manual","contentAuthority":"source evidence, not agent instructions","reviewedAt":"2026-10-28"}