@lssm/example.policy-safe-knowledge-assistant 0.0.0-canary-20251217034842 → 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.
@@ -0,0 +1,27 @@
1
+
2
+ $ tsdown
3
+ ℹ tsdown v0.17.4 powered by rolldown v1.0.0-beta.53
4
+ ℹ config file: /Users/tboutron/Documents/clients/lssm/monorepo-lssm/packages/contractspec/packages/examples/policy-safe-knowledge-assistant/tsdown.config.js (unrun)
5
+ ℹ entry: src/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
6
+ ℹ target: esnext
7
+ ℹ tsconfig: tsconfig.json
8
+ ℹ Build start
9
+ ℹ Cleaning 19 files
10
+ ℹ dist/orchestrator/buildAnswer.js 1.65 kB │ gzip: 0.71 kB
11
+ ℹ dist/docs/policy-safe-knowledge-assistant.docblock.js 1.62 kB │ gzip: 0.83 kB
12
+ ℹ dist/feature.js 1.57 kB │ gzip: 0.57 kB
13
+ ℹ dist/example.js 0.72 kB │ gzip: 0.41 kB
14
+ ℹ dist/seed/fixtures.js 0.56 kB │ gzip: 0.31 kB
15
+ ℹ dist/index.js 0.35 kB │ gzip: 0.20 kB
16
+ ℹ dist/seed/index.js 0.07 kB │ gzip: 0.08 kB
17
+ ℹ dist/docs/index.js 0.05 kB │ gzip: 0.07 kB
18
+ ℹ dist/orchestrator/buildAnswer.d.ts 1.27 kB │ gzip: 0.55 kB
19
+ ℹ dist/example.d.ts 1.20 kB │ gzip: 0.48 kB
20
+ ℹ dist/seed/fixtures.d.ts 0.99 kB │ gzip: 0.35 kB
21
+ ℹ dist/index.d.ts 0.40 kB │ gzip: 0.20 kB
22
+ ℹ dist/feature.d.ts 0.21 kB │ gzip: 0.15 kB
23
+ ℹ dist/seed/index.d.ts 0.07 kB │ gzip: 0.07 kB
24
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
25
+ ℹ dist/docs/policy-safe-knowledge-assistant.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
26
+ ℹ 16 files, total: 10.77 kB
27
+ ✔ Build complete in 4821ms
@@ -1,19 +1,21 @@
1
- $ bun build:bundle && bun build:types
2
- $ tsdown
3
- ℹ tsdown v0.17.4 powered by rolldown v1.0.0-beta.53
4
- ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/policy-safe-knowledge-assistant/tsdown.config.js
5
- ℹ entry: src/example.ts, src/feature.ts, src/index.ts, src/docs/index.ts, src/docs/policy-safe-knowledge-assistant.docblock.ts, src/orchestrator/buildAnswer.ts, src/seed/fixtures.ts, src/seed/index.ts
6
- ℹ target: esnext
7
- ℹ tsconfig: tsconfig.json
8
- ℹ Build start
9
- ℹ dist/orchestrator/buildAnswer.js 1.65 kB │ gzip: 0.71 kB
10
- ℹ dist/docs/policy-safe-knowledge-assistant.docblock.js 1.62 kB │ gzip: 0.83 kB
11
- ℹ dist/feature.js 1.57 kB │ gzip: 0.57 kB
12
- ℹ dist/example.js 0.72 kB │ gzip: 0.41 kB
13
- ℹ dist/seed/fixtures.js 0.56 kB │ gzip: 0.31 kB
14
- ℹ dist/index.js 0.35 kB │ gzip: 0.20 kB
15
- ℹ dist/seed/index.js 0.07 kB │ gzip: 0.08 kB
16
- ℹ dist/docs/index.js 0.05 kB │ gzip: 0.07 kB
17
- ℹ 8 files, total: 6.60 kB
18
- ✔ Build complete in 57ms
19
- $ tsc --noEmit
1
+
2
+ $ bun build:bundle && bun build:types
3
+ $ tsdown
4
+ ℹ tsdown v0.17.4 powered by rolldown v1.0.0-beta.53
5
+ ℹ config file: /Users/tboutron/Documents/clients/lssm/monorepo-lssm/packages/contractspec/packages/examples/policy-safe-knowledge-assistant/tsdown.config.js (unrun)
6
+ ℹ entry: src/example.ts, src/feature.ts, src/index.ts, src/orchestrator/buildAnswer.ts, src/docs/index.ts, src/docs/policy-safe-knowledge-assistant.docblock.ts, src/seed/fixtures.ts, src/seed/index.ts
7
+ ℹ target: esnext
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ Cleaning 11 files
11
+ ℹ dist/orchestrator/buildAnswer.js 1.65 kB │ gzip: 0.71 kB
12
+ ℹ dist/docs/policy-safe-knowledge-assistant.docblock.js 1.62 kB │ gzip: 0.83 kB
13
+ ℹ dist/feature.js 1.57 kB │ gzip: 0.57 kB
14
+ ℹ dist/example.js 0.72 kB │ gzip: 0.41 kB
15
+ ℹ dist/seed/fixtures.js 0.56 kB │ gzip: 0.31 kB
16
+ ℹ dist/index.js 0.35 kB │ gzip: 0.20 kB
17
+ ℹ dist/seed/index.js 0.07 kB │ gzip: 0.08 kB
18
+ ℹ dist/docs/index.js 0.05 kB │ gzip: 0.07 kB
19
+ ℹ 8 files, total: 6.60 kB
20
+ ✔ Build complete in 40ms
21
+ $ tsc --noEmit
package/CHANGELOG.md CHANGED
@@ -1,20 +1,24 @@
1
1
  # @lssm/example.policy-safe-knowledge-assistant
2
2
 
3
- ## 0.0.0-canary-20251217034842
3
+ ## 0.0.0-canary-20251217060433
4
+
5
+ ### Minor Changes
6
+
7
+ - 66a5dfd: initial release
4
8
 
5
9
  ### Patch Changes
6
10
 
7
- - Updated dependencies [3086383]
8
- - @lssm/lib.contracts@0.0.0-canary-20251217034842
9
- - @lssm/lib.jobs@0.0.0-canary-20251217034842
10
- - @lssm/example.kb-update-pipeline@0.0.0-canary-20251217034842
11
- - @lssm/example.locale-jurisdiction-gate@0.0.0-canary-20251217034842
12
- - @lssm/example.versioned-knowledge-base@0.0.0-canary-20251217034842
13
- - @lssm/lib.feature-flags@0.0.0-canary-20251217034842
14
- - @lssm/lib.files@0.0.0-canary-20251217034842
15
- - @lssm/lib.identity-rbac@0.0.0-canary-20251217034842
16
- - @lssm/lib.metering@0.0.0-canary-20251217034842
17
- - @lssm/module.audit-trail@0.0.0-canary-20251217034842
18
- - @lssm/module.learning-journey@0.0.0-canary-20251217034842
19
- - @lssm/module.notifications@0.0.0-canary-20251217034842
20
- - @lssm/example.learning-patterns@0.0.0-canary-20251217034842
11
+ - Updated dependencies [66a5dfd]
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,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 };
@@ -0,0 +1,6 @@
1
+ import { FeatureModuleSpec } from "@lssm/lib.contracts";
2
+
3
+ //#region src/feature.d.ts
4
+ declare const PolicySafeKnowledgeAssistantFeature: FeatureModuleSpec;
5
+ //#endregion
6
+ export { PolicySafeKnowledgeAssistantFeature };
@@ -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 };
@@ -0,0 +1,2 @@
1
+ import { DEMO_FIXTURES } from "./fixtures.js";
2
+ 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-20251217034842",
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",
@@ -18,6 +18,8 @@
18
18
  "./*": "./*"
19
19
  },
20
20
  "scripts": {
21
+ "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
22
+ "publish:pkg:canary": "bun publish:pkg --tag canary",
21
23
  "build": "bun build:bundle && bun build:types",
22
24
  "build:bundle": "tsdown",
23
25
  "build:types": "tsc --noEmit",
@@ -29,23 +31,23 @@
29
31
  "test": "bun test"
30
32
  },
31
33
  "dependencies": {
32
- "@lssm/example.locale-jurisdiction-gate": "workspace:*",
33
- "@lssm/example.versioned-knowledge-base": "workspace:*",
34
- "@lssm/example.kb-update-pipeline": "workspace:*",
35
- "@lssm/example.learning-patterns": "workspace:*",
36
- "@lssm/lib.contracts": "workspace:*",
37
- "@lssm/lib.identity-rbac": "workspace:*",
38
- "@lssm/lib.jobs": "workspace:*",
39
- "@lssm/lib.feature-flags": "workspace:*",
40
- "@lssm/lib.files": "workspace:*",
41
- "@lssm/lib.metering": "workspace:*",
42
- "@lssm/module.audit-trail": "workspace:*",
43
- "@lssm/module.notifications": "workspace:*",
44
- "@lssm/module.learning-journey": "workspace:*"
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"
45
47
  },
46
48
  "devDependencies": {
47
- "@lssm/tool.tsdown": "workspace:*",
48
- "@lssm/tool.typescript": "workspace:*",
49
+ "@lssm/tool.tsdown": "0.0.0-canary-20251217060433",
50
+ "@lssm/tool.typescript": "0.0.0-canary-20251217060433",
49
51
  "tsdown": "^0.17.4",
50
52
  "typescript": "^5.9.3"
51
53
  },