@lssm/example.versioned-knowledge-base 0.0.0-canary-20251217054315 → 0.0.0-canary-20251217060804
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/.turbo/turbo-build$colon$bundle.log +35 -0
- package/.turbo/turbo-build.log +26 -14
- package/CHANGELOG.md +3 -27
- package/dist/contracts/index.d.ts +2 -0
- package/dist/contracts/kb.d.ts +266 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/versioned-knowledge-base.docblock.d.ts +1 -0
- package/dist/entities/index.d.ts +2 -0
- package/dist/entities/models.d.ts +138 -0
- package/dist/events.d.ts +62 -0
- package/dist/example.d.ts +35 -0
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/memory.handlers.d.ts +77 -0
- package/dist/index.d.ts +9 -0
- package/dist/versioned-knowledge-base.feature.d.ts +6 -0
- package/package.json +17 -17
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//#region src/handlers/memory.handlers.d.ts
|
|
2
|
+
interface SourceRef {
|
|
3
|
+
sourceDocumentId: string;
|
|
4
|
+
excerpt?: string;
|
|
5
|
+
}
|
|
6
|
+
interface SourceDocument {
|
|
7
|
+
id: string;
|
|
8
|
+
jurisdiction: string;
|
|
9
|
+
authority: string;
|
|
10
|
+
title: string;
|
|
11
|
+
fetchedAt: Date;
|
|
12
|
+
hash: string;
|
|
13
|
+
fileId: string;
|
|
14
|
+
}
|
|
15
|
+
interface Rule {
|
|
16
|
+
id: string;
|
|
17
|
+
jurisdiction: string;
|
|
18
|
+
topicKey: string;
|
|
19
|
+
}
|
|
20
|
+
interface RuleVersion {
|
|
21
|
+
id: string;
|
|
22
|
+
ruleId: string;
|
|
23
|
+
jurisdiction: string;
|
|
24
|
+
topicKey: string;
|
|
25
|
+
version: number;
|
|
26
|
+
content: string;
|
|
27
|
+
sourceRefs: SourceRef[];
|
|
28
|
+
status: 'draft' | 'approved' | 'rejected';
|
|
29
|
+
approvedBy?: string;
|
|
30
|
+
approvedAt?: Date;
|
|
31
|
+
createdAt: Date;
|
|
32
|
+
}
|
|
33
|
+
interface KBSnapshot {
|
|
34
|
+
id: string;
|
|
35
|
+
jurisdiction: string;
|
|
36
|
+
asOfDate: Date;
|
|
37
|
+
includedRuleVersionIds: string[];
|
|
38
|
+
publishedAt: Date;
|
|
39
|
+
}
|
|
40
|
+
interface MemoryKbStore {
|
|
41
|
+
sources: Map<string, SourceDocument>;
|
|
42
|
+
rules: Map<string, Rule>;
|
|
43
|
+
ruleVersions: Map<string, RuleVersion>;
|
|
44
|
+
snapshots: Map<string, KBSnapshot>;
|
|
45
|
+
nextRuleVersionNumberByRuleId: Map<string, number>;
|
|
46
|
+
}
|
|
47
|
+
declare function createMemoryKbStore(): MemoryKbStore;
|
|
48
|
+
interface MemoryKbHandlers {
|
|
49
|
+
createRule(rule: Rule): Promise<Rule>;
|
|
50
|
+
ingestSource(input: Omit<SourceDocument, 'id'>): Promise<SourceDocument>;
|
|
51
|
+
upsertRuleVersion(input: {
|
|
52
|
+
ruleId: string;
|
|
53
|
+
content: string;
|
|
54
|
+
sourceRefs: SourceRef[];
|
|
55
|
+
}): Promise<RuleVersion>;
|
|
56
|
+
approveRuleVersion(input: {
|
|
57
|
+
ruleVersionId: string;
|
|
58
|
+
approver: string;
|
|
59
|
+
}): Promise<RuleVersion>;
|
|
60
|
+
publishSnapshot(input: {
|
|
61
|
+
jurisdiction: string;
|
|
62
|
+
asOfDate: Date;
|
|
63
|
+
}): Promise<KBSnapshot>;
|
|
64
|
+
search(input: {
|
|
65
|
+
snapshotId: string;
|
|
66
|
+
jurisdiction: string;
|
|
67
|
+
query: string;
|
|
68
|
+
}): Promise<{
|
|
69
|
+
items: {
|
|
70
|
+
ruleVersionId: string;
|
|
71
|
+
excerpt?: string;
|
|
72
|
+
}[];
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
declare function createMemoryKbHandlers(store: MemoryKbStore): MemoryKbHandlers;
|
|
76
|
+
//#endregion
|
|
77
|
+
export { MemoryKbHandlers, MemoryKbStore, createMemoryKbHandlers, createMemoryKbStore };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { KbApproveRuleVersionContract, KbIngestSourceContract, KbPublishSnapshotContract, KbSearchContract, KbUpsertRuleVersionContract } from "./contracts/kb.js";
|
|
2
|
+
import "./contracts/index.js";
|
|
3
|
+
import { KBSnapshotModel, RuleModel, RuleVersionModel, SourceDocumentModel, SourceRefModel } from "./entities/models.js";
|
|
4
|
+
import "./entities/index.js";
|
|
5
|
+
import { KbRuleVersionApprovedEvent, KbRuleVersionCreatedEvent, KbSnapshotPublishedEvent, KbSourceIngestedEvent } from "./events.js";
|
|
6
|
+
import example from "./example.js";
|
|
7
|
+
import { MemoryKbHandlers, MemoryKbStore, createMemoryKbHandlers, createMemoryKbStore } from "./handlers/memory.handlers.js";
|
|
8
|
+
import { VersionedKnowledgeBaseFeature } from "./versioned-knowledge-base.feature.js";
|
|
9
|
+
export { KBSnapshotModel, KbApproveRuleVersionContract, KbIngestSourceContract, KbPublishSnapshotContract, KbRuleVersionApprovedEvent, KbRuleVersionCreatedEvent, KbSearchContract, KbSnapshotPublishedEvent, KbSourceIngestedEvent, KbUpsertRuleVersionContract, MemoryKbHandlers, MemoryKbStore, RuleModel, RuleVersionModel, SourceDocumentModel, SourceRefModel, VersionedKnowledgeBaseFeature, createMemoryKbHandlers, createMemoryKbStore, example };
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/example.versioned-knowledge-base",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251217060804",
|
|
4
4
|
"description": "Example: curated, versioned knowledge base with immutable sources, rule versions, and published snapshots.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
|
-
".": "./
|
|
11
|
-
"./contracts": "./
|
|
12
|
-
"./contracts/kb": "./
|
|
13
|
-
"./docs": "./
|
|
14
|
-
"./docs/versioned-knowledge-base.docblock": "./
|
|
15
|
-
"./entities": "./
|
|
16
|
-
"./entities/models": "./
|
|
17
|
-
"./events": "./
|
|
18
|
-
"./example": "./
|
|
19
|
-
"./handlers": "./
|
|
20
|
-
"./handlers/memory.handlers": "./
|
|
21
|
-
"./versioned-knowledge-base.feature": "./
|
|
10
|
+
".": "./dist/index.js",
|
|
11
|
+
"./contracts": "./dist/contracts/index.js",
|
|
12
|
+
"./contracts/kb": "./dist/contracts/kb.js",
|
|
13
|
+
"./docs": "./dist/docs/index.js",
|
|
14
|
+
"./docs/versioned-knowledge-base.docblock": "./dist/docs/versioned-knowledge-base.docblock.js",
|
|
15
|
+
"./entities": "./dist/entities/index.js",
|
|
16
|
+
"./entities/models": "./dist/entities/models.js",
|
|
17
|
+
"./events": "./dist/events.js",
|
|
18
|
+
"./example": "./dist/example.js",
|
|
19
|
+
"./handlers": "./dist/handlers/index.js",
|
|
20
|
+
"./handlers/memory.handlers": "./dist/handlers/memory.handlers.js",
|
|
21
|
+
"./versioned-knowledge-base.feature": "./dist/versioned-knowledge-base.feature.js",
|
|
22
22
|
"./*": "./*"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@lssm/lib.contracts": "0.0.0-canary-
|
|
39
|
-
"@lssm/lib.schema": "0.0.0-canary-
|
|
38
|
+
"@lssm/lib.contracts": "0.0.0-canary-20251217060804",
|
|
39
|
+
"@lssm/lib.schema": "0.0.0-canary-20251217060804",
|
|
40
40
|
"zod": "^4.1.13"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
44
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
43
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251217060804",
|
|
44
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251217060804",
|
|
45
45
|
"tsdown": "^0.17.4",
|
|
46
46
|
"typescript": "^5.9.3"
|
|
47
47
|
},
|