@lssm/example.policy-safe-knowledge-assistant 0.0.0-canary-20251217054315 → 0.0.0-canary-20251217060433
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 +27 -0
- package/CHANGELOG.md +14 -60
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/policy-safe-knowledge-assistant.docblock.d.ts +1 -0
- package/dist/example.d.ts +34 -0
- package/dist/feature.d.ts +6 -0
- package/dist/index.d.ts +5 -0
- package/dist/orchestrator/buildAnswer.d.ts +52 -0
- package/dist/seed/fixtures.d.ts +34 -0
- package/dist/seed/index.d.ts +2 -0
- package/package.json +16 -16
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
[0m[2m[35m$[0m [2m[1mtsdown[0m
|
|
3
|
+
[34mℹ[39m tsdown [2mv0.17.4[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
4
|
+
[34mℹ[39m config file: [4m/Users/tboutron/Documents/clients/lssm/monorepo-lssm/packages/contractspec/packages/examples/policy-safe-knowledge-assistant/tsdown.config.js[24m (unrun)
|
|
5
|
+
[34mℹ[39m entry: [34msrc/example.ts, src/feature.ts, src/index.ts, src/docs/index.ts, src/docs/policy-safe-knowledge-assistant.docblock.ts, src/seed/fixtures.ts, src/seed/index.ts, src/orchestrator/buildAnswer.ts[39m
|
|
6
|
+
[34mℹ[39m target: [34mesnext[39m
|
|
7
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
8
|
+
[34mℹ[39m Build start
|
|
9
|
+
[34mℹ[39m Cleaning 19 files
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1morchestrator/buildAnswer.js[22m [2m1.65 kB[22m [2m│ gzip: 0.71 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/policy-safe-knowledge-assistant.docblock.js[22m [2m1.62 kB[22m [2m│ gzip: 0.83 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mfeature.js[22m [2m1.57 kB[22m [2m│ gzip: 0.57 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m0.72 kB[22m [2m│ gzip: 0.41 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mseed/fixtures.js[22m [2m0.56 kB[22m [2m│ gzip: 0.31 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.35 kB[22m [2m│ gzip: 0.20 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22m[1mseed/index.js[22m [2m0.07 kB[22m [2m│ gzip: 0.08 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.05 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22m[32m[1morchestrator/buildAnswer.d.ts[22m[39m [2m1.27 kB[22m [2m│ gzip: 0.55 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m1.20 kB[22m [2m│ gzip: 0.48 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22m[32m[1mseed/fixtures.d.ts[22m[39m [2m0.99 kB[22m [2m│ gzip: 0.35 kB[22m
|
|
21
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.40 kB[22m [2m│ gzip: 0.20 kB[22m
|
|
22
|
+
[34mℹ[39m [2mdist/[22m[32m[1mfeature.d.ts[22m[39m [2m0.21 kB[22m [2m│ gzip: 0.15 kB[22m
|
|
23
|
+
[34mℹ[39m [2mdist/[22m[32m[1mseed/index.d.ts[22m[39m [2m0.07 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
24
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
25
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/policy-safe-knowledge-assistant.docblock.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
26
|
+
[34mℹ[39m 16 files, total: 10.77 kB
|
|
27
|
+
[32m✔[39m Build complete in [32m4821ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lssm/example.policy-safe-knowledge-assistant
|
|
2
2
|
|
|
3
|
-
## 0.0.0-canary-
|
|
3
|
+
## 0.0.0-canary-20251217060433
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -9,62 +9,16 @@
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
11
|
- Updated dependencies [66a5dfd]
|
|
12
|
-
- @lssm/example.kb-update-pipeline@0.0.0-canary-
|
|
13
|
-
- @lssm/example.learning-patterns@0.0.0-canary-
|
|
14
|
-
- @lssm/example.locale-jurisdiction-gate@0.0.0-canary-
|
|
15
|
-
- @lssm/example.versioned-knowledge-base@0.0.0-canary-
|
|
16
|
-
- @lssm/lib.contracts@0.0.0-canary-
|
|
17
|
-
- @lssm/lib.feature-flags@0.0.0-canary-
|
|
18
|
-
- @lssm/lib.files@0.0.0-canary-
|
|
19
|
-
- @lssm/lib.identity-rbac@0.0.0-canary-
|
|
20
|
-
- @lssm/lib.jobs@0.0.0-canary-
|
|
21
|
-
- @lssm/lib.metering@0.0.0-canary-
|
|
22
|
-
- @lssm/module.audit-trail@0.0.0-canary-
|
|
23
|
-
- @lssm/module.learning-journey@0.0.0-canary-
|
|
24
|
-
- @lssm/module.notifications@0.0.0-canary-
|
|
25
|
-
|
|
26
|
-
## 1.42.0
|
|
27
|
-
|
|
28
|
-
### Minor Changes
|
|
29
|
-
|
|
30
|
-
- 66a5dfd: initial release
|
|
31
|
-
|
|
32
|
-
### Patch Changes
|
|
33
|
-
|
|
34
|
-
- Updated dependencies [66a5dfd]
|
|
35
|
-
- @lssm/example.kb-update-pipeline@1.42.0
|
|
36
|
-
- @lssm/example.learning-patterns@1.42.0
|
|
37
|
-
- @lssm/example.locale-jurisdiction-gate@1.42.0
|
|
38
|
-
- @lssm/example.versioned-knowledge-base@1.42.0
|
|
39
|
-
- @lssm/lib.contracts@1.42.0
|
|
40
|
-
- @lssm/lib.feature-flags@1.42.0
|
|
41
|
-
- @lssm/lib.files@1.42.0
|
|
42
|
-
- @lssm/lib.identity-rbac@1.42.0
|
|
43
|
-
- @lssm/lib.jobs@1.42.0
|
|
44
|
-
- @lssm/lib.metering@1.42.0
|
|
45
|
-
- @lssm/module.audit-trail@1.42.0
|
|
46
|
-
- @lssm/module.learning-journey@1.42.0
|
|
47
|
-
- @lssm/module.notifications@1.42.0
|
|
48
|
-
|
|
49
|
-
## 0.0.0-canary-20251217053014
|
|
50
|
-
|
|
51
|
-
### Minor Changes
|
|
52
|
-
|
|
53
|
-
- 66a5dfd: initial release
|
|
54
|
-
|
|
55
|
-
### Patch Changes
|
|
56
|
-
|
|
57
|
-
- Updated dependencies [66a5dfd]
|
|
58
|
-
- @lssm/example.kb-update-pipeline@0.0.0-canary-20251217053014
|
|
59
|
-
- @lssm/example.learning-patterns@0.0.0-canary-20251217053014
|
|
60
|
-
- @lssm/example.locale-jurisdiction-gate@0.0.0-canary-20251217053014
|
|
61
|
-
- @lssm/example.versioned-knowledge-base@0.0.0-canary-20251217053014
|
|
62
|
-
- @lssm/lib.contracts@0.0.0-canary-20251217053014
|
|
63
|
-
- @lssm/lib.feature-flags@0.0.0-canary-20251217053014
|
|
64
|
-
- @lssm/lib.files@0.0.0-canary-20251217053014
|
|
65
|
-
- @lssm/lib.identity-rbac@0.0.0-canary-20251217053014
|
|
66
|
-
- @lssm/lib.jobs@0.0.0-canary-20251217053014
|
|
67
|
-
- @lssm/lib.metering@0.0.0-canary-20251217053014
|
|
68
|
-
- @lssm/module.audit-trail@0.0.0-canary-20251217053014
|
|
69
|
-
- @lssm/module.learning-journey@0.0.0-canary-20251217053014
|
|
70
|
-
- @lssm/module.notifications@0.0.0-canary-20251217053014
|
|
12
|
+
- @lssm/example.kb-update-pipeline@0.0.0-canary-20251217060433
|
|
13
|
+
- @lssm/example.learning-patterns@0.0.0-canary-20251217060433
|
|
14
|
+
- @lssm/example.locale-jurisdiction-gate@0.0.0-canary-20251217060433
|
|
15
|
+
- @lssm/example.versioned-knowledge-base@0.0.0-canary-20251217060433
|
|
16
|
+
- @lssm/lib.contracts@0.0.0-canary-20251217060433
|
|
17
|
+
- @lssm/lib.feature-flags@0.0.0-canary-20251217060433
|
|
18
|
+
- @lssm/lib.files@0.0.0-canary-20251217060433
|
|
19
|
+
- @lssm/lib.identity-rbac@0.0.0-canary-20251217060433
|
|
20
|
+
- @lssm/lib.jobs@0.0.0-canary-20251217060433
|
|
21
|
+
- @lssm/lib.metering@0.0.0-canary-20251217060433
|
|
22
|
+
- @lssm/module.audit-trail@0.0.0-canary-20251217060433
|
|
23
|
+
- @lssm/module.learning-journey@0.0.0-canary-20251217060433
|
|
24
|
+
- @lssm/module.notifications@0.0.0-canary-20251217060433
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/example.d.ts
|
|
2
|
+
declare const example: {
|
|
3
|
+
readonly id: "policy-safe-knowledge-assistant";
|
|
4
|
+
readonly title: "Policy-safe Knowledge Assistant";
|
|
5
|
+
readonly summary: "All-in-one template: locale/jurisdiction gating + versioned KB snapshots + HITL update pipeline + learning hub.";
|
|
6
|
+
readonly tags: readonly ["assistant", "knowledge", "policy", "hitl", "learning"];
|
|
7
|
+
readonly kind: "template";
|
|
8
|
+
readonly visibility: "public";
|
|
9
|
+
readonly docs: {
|
|
10
|
+
readonly goalDocId: "docs.examples.policy-safe-knowledge-assistant.goal";
|
|
11
|
+
readonly usageDocId: "docs.examples.policy-safe-knowledge-assistant.usage";
|
|
12
|
+
};
|
|
13
|
+
readonly entrypoints: {
|
|
14
|
+
readonly packageName: "@lssm/example.policy-safe-knowledge-assistant";
|
|
15
|
+
readonly feature: "./feature";
|
|
16
|
+
readonly docs: "./docs";
|
|
17
|
+
};
|
|
18
|
+
readonly surfaces: {
|
|
19
|
+
readonly templates: true;
|
|
20
|
+
readonly sandbox: {
|
|
21
|
+
readonly enabled: true;
|
|
22
|
+
readonly modes: readonly ["playground", "specs", "builder", "markdown", "evolution"];
|
|
23
|
+
};
|
|
24
|
+
readonly studio: {
|
|
25
|
+
readonly enabled: true;
|
|
26
|
+
readonly installable: true;
|
|
27
|
+
};
|
|
28
|
+
readonly mcp: {
|
|
29
|
+
readonly enabled: true;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { example as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import example from "./example.js";
|
|
2
|
+
import { PolicySafeKnowledgeAssistantFeature } from "./feature.js";
|
|
3
|
+
import { DEMO_FIXTURES } from "./seed/fixtures.js";
|
|
4
|
+
import { AssistantAnswerIR, BuildAnswerInput, buildPolicySafeAnswer } from "./orchestrator/buildAnswer.js";
|
|
5
|
+
export { AssistantAnswerIR, BuildAnswerInput, DEMO_FIXTURES, PolicySafeKnowledgeAssistantFeature, buildPolicySafeAnswer, example };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//#region src/orchestrator/buildAnswer.d.ts
|
|
2
|
+
type AllowedScope = 'education_only' | 'generic_info' | 'escalation_required';
|
|
3
|
+
interface AssistantAnswerIR {
|
|
4
|
+
locale: string;
|
|
5
|
+
jurisdiction: string;
|
|
6
|
+
allowedScope: AllowedScope;
|
|
7
|
+
sections: {
|
|
8
|
+
heading: string;
|
|
9
|
+
body: string;
|
|
10
|
+
}[];
|
|
11
|
+
citations: {
|
|
12
|
+
kbSnapshotId: string;
|
|
13
|
+
sourceType: string;
|
|
14
|
+
sourceId: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
excerpt?: string;
|
|
17
|
+
}[];
|
|
18
|
+
disclaimers?: string[];
|
|
19
|
+
riskFlags?: string[];
|
|
20
|
+
refused?: boolean;
|
|
21
|
+
refusalReason?: string;
|
|
22
|
+
}
|
|
23
|
+
interface BuildAnswerInput {
|
|
24
|
+
envelope: {
|
|
25
|
+
traceId: string;
|
|
26
|
+
locale: string;
|
|
27
|
+
kbSnapshotId: string;
|
|
28
|
+
allowedScope: AllowedScope;
|
|
29
|
+
regulatoryContext: {
|
|
30
|
+
jurisdiction: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
question: string;
|
|
34
|
+
kbSearch: (input: {
|
|
35
|
+
snapshotId: string;
|
|
36
|
+
jurisdiction: string;
|
|
37
|
+
query: string;
|
|
38
|
+
}) => Promise<{
|
|
39
|
+
items: {
|
|
40
|
+
ruleVersionId: string;
|
|
41
|
+
excerpt?: string;
|
|
42
|
+
}[];
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Build a policy-safe assistant answer derived from KB search results.
|
|
47
|
+
*
|
|
48
|
+
* Deterministic: no LLM calls; if search yields no results, it refuses.
|
|
49
|
+
*/
|
|
50
|
+
declare function buildPolicySafeAnswer(input: BuildAnswerInput): Promise<AssistantAnswerIR>;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { AssistantAnswerIR, BuildAnswerInput, buildPolicySafeAnswer };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/seed/fixtures.d.ts
|
|
2
|
+
declare const DEMO_FIXTURES: {
|
|
3
|
+
readonly jurisdictions: readonly ["EU", "FR"];
|
|
4
|
+
readonly locales: readonly ["en-GB", "fr-FR"];
|
|
5
|
+
readonly demoOrgId: "org_demo";
|
|
6
|
+
readonly demoUserId: "user_demo";
|
|
7
|
+
readonly sources: {
|
|
8
|
+
readonly EU_SOURCE_1: {
|
|
9
|
+
readonly jurisdiction: "EU";
|
|
10
|
+
readonly authority: "DemoAuthority";
|
|
11
|
+
readonly title: "EU Demo Source v1";
|
|
12
|
+
readonly fetchedAt: Date;
|
|
13
|
+
readonly hash: "hash_eu_v1";
|
|
14
|
+
readonly fileId: "file_eu_v1";
|
|
15
|
+
};
|
|
16
|
+
readonly EU_SOURCE_2: {
|
|
17
|
+
readonly jurisdiction: "EU";
|
|
18
|
+
readonly authority: "DemoAuthority";
|
|
19
|
+
readonly title: "EU Demo Source v2";
|
|
20
|
+
readonly fetchedAt: Date;
|
|
21
|
+
readonly hash: "hash_eu_v2";
|
|
22
|
+
readonly fileId: "file_eu_v2";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
readonly rules: {
|
|
26
|
+
readonly EU_RULE_TAX: {
|
|
27
|
+
readonly id: "rule_eu_tax";
|
|
28
|
+
readonly jurisdiction: "EU";
|
|
29
|
+
readonly topicKey: "tax_reporting";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { DEMO_FIXTURES };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/example.policy-safe-knowledge-assistant",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251217060433",
|
|
4
4
|
"description": "All-in-one template example: policy-safe knowledge assistant with locale/jurisdiction gating, versioned KB snapshots, HITL update pipeline, and learning hub.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
"test": "bun test"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@lssm/example.locale-jurisdiction-gate": "0.0.0-canary-
|
|
35
|
-
"@lssm/example.versioned-knowledge-base": "0.0.0-canary-
|
|
36
|
-
"@lssm/example.kb-update-pipeline": "0.0.0-canary-
|
|
37
|
-
"@lssm/example.learning-patterns": "0.0.0-canary-
|
|
38
|
-
"@lssm/lib.contracts": "0.0.0-canary-
|
|
39
|
-
"@lssm/lib.identity-rbac": "0.0.0-canary-
|
|
40
|
-
"@lssm/lib.jobs": "0.0.0-canary-
|
|
41
|
-
"@lssm/lib.feature-flags": "0.0.0-canary-
|
|
42
|
-
"@lssm/lib.files": "0.0.0-canary-
|
|
43
|
-
"@lssm/lib.metering": "0.0.0-canary-
|
|
44
|
-
"@lssm/module.audit-trail": "0.0.0-canary-
|
|
45
|
-
"@lssm/module.notifications": "0.0.0-canary-
|
|
46
|
-
"@lssm/module.learning-journey": "0.0.0-canary-
|
|
34
|
+
"@lssm/example.locale-jurisdiction-gate": "0.0.0-canary-20251217060433",
|
|
35
|
+
"@lssm/example.versioned-knowledge-base": "0.0.0-canary-20251217060433",
|
|
36
|
+
"@lssm/example.kb-update-pipeline": "0.0.0-canary-20251217060433",
|
|
37
|
+
"@lssm/example.learning-patterns": "0.0.0-canary-20251217060433",
|
|
38
|
+
"@lssm/lib.contracts": "0.0.0-canary-20251217060433",
|
|
39
|
+
"@lssm/lib.identity-rbac": "0.0.0-canary-20251217060433",
|
|
40
|
+
"@lssm/lib.jobs": "0.0.0-canary-20251217060433",
|
|
41
|
+
"@lssm/lib.feature-flags": "0.0.0-canary-20251217060433",
|
|
42
|
+
"@lssm/lib.files": "0.0.0-canary-20251217060433",
|
|
43
|
+
"@lssm/lib.metering": "0.0.0-canary-20251217060433",
|
|
44
|
+
"@lssm/module.audit-trail": "0.0.0-canary-20251217060433",
|
|
45
|
+
"@lssm/module.notifications": "0.0.0-canary-20251217060433",
|
|
46
|
+
"@lssm/module.learning-journey": "0.0.0-canary-20251217060433"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
50
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
49
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251217060433",
|
|
50
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251217060433",
|
|
51
51
|
"tsdown": "^0.17.4",
|
|
52
52
|
"typescript": "^5.9.3"
|
|
53
53
|
},
|