@lssm/example.locale-jurisdiction-gate 1.41.0 → 1.42.2

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.
Files changed (60) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +56 -0
  2. package/.turbo/turbo-build.log +52 -21
  3. package/CHANGELOG.md +31 -0
  4. package/LICENSE +21 -0
  5. package/README.md +3 -0
  6. package/dist/docs/index.d.ts +1 -0
  7. package/dist/docs/index.js +1 -1
  8. package/dist/docs/locale-jurisdiction-gate.docblock.d.ts +1 -0
  9. package/dist/docs/locale-jurisdiction-gate.docblock.js +37 -3
  10. package/dist/docs/locale-jurisdiction-gate.docblock.js.map +1 -0
  11. package/dist/entities/index.d.ts +2 -0
  12. package/dist/entities/index.js +3 -1
  13. package/dist/entities/models.d.ts +186 -0
  14. package/dist/entities/models.d.ts.map +1 -0
  15. package/dist/entities/models.js +168 -1
  16. package/dist/entities/models.js.map +1 -0
  17. package/dist/events.d.ts +69 -0
  18. package/dist/events.d.ts.map +1 -0
  19. package/dist/events.js +123 -1
  20. package/dist/events.js.map +1 -0
  21. package/dist/example.d.ts +36 -0
  22. package/dist/example.d.ts.map +1 -0
  23. package/dist/example.js +40 -1
  24. package/dist/example.js.map +1 -0
  25. package/dist/handlers/demo.handlers.d.ts +59 -0
  26. package/dist/handlers/demo.handlers.d.ts.map +1 -0
  27. package/dist/handlers/demo.handlers.js +86 -1
  28. package/dist/handlers/demo.handlers.js.map +1 -0
  29. package/dist/handlers/index.d.ts +2 -0
  30. package/dist/handlers/index.js +3 -1
  31. package/dist/index.d.ts +11 -0
  32. package/dist/index.js +12 -1
  33. package/dist/locale-jurisdiction-gate.feature.d.ts +7 -0
  34. package/dist/locale-jurisdiction-gate.feature.d.ts.map +1 -0
  35. package/dist/locale-jurisdiction-gate.feature.js +51 -1
  36. package/dist/locale-jurisdiction-gate.feature.js.map +1 -0
  37. package/dist/operations/assistant.d.ts +245 -0
  38. package/dist/operations/assistant.d.ts.map +1 -0
  39. package/dist/operations/assistant.js +115 -0
  40. package/dist/operations/assistant.js.map +1 -0
  41. package/dist/operations/index.d.ts +2 -0
  42. package/dist/operations/index.js +3 -0
  43. package/dist/policy/guard.d.ts +27 -0
  44. package/dist/policy/guard.d.ts.map +1 -0
  45. package/dist/policy/guard.js +73 -2
  46. package/dist/policy/guard.js.map +1 -0
  47. package/dist/policy/index.d.ts +3 -0
  48. package/dist/policy/index.js +3 -1
  49. package/dist/policy/types.d.ts +16 -0
  50. package/dist/policy/types.d.ts.map +1 -0
  51. package/package.json +32 -23
  52. package/src/events.ts +25 -10
  53. package/src/handlers/demo.handlers.ts +5 -4
  54. package/src/index.ts +1 -1
  55. package/src/locale-jurisdiction-gate.feature.ts +6 -5
  56. package/src/{contracts → operations}/assistant.ts +4 -4
  57. package/tsconfig.tsbuildinfo +1 -1
  58. package/dist/contracts/assistant.js +0 -1
  59. package/dist/contracts/index.js +0 -1
  60. /package/src/{contracts → operations}/index.ts +0 -0
@@ -0,0 +1,56 @@
1
+ $ tsdown
2
+ ℹ tsdown v0.18.3 powered by rolldown v1.0.0-beta.57
3
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/locale-jurisdiction-gate/tsdown.config.js
4
+ ℹ entry: src/events.ts, src/example.ts, src/index.ts, src/locale-jurisdiction-gate.feature.ts, src/docs/index.ts, src/docs/locale-jurisdiction-gate.docblock.ts, src/entities/index.ts, src/entities/models.ts, src/handlers/demo.handlers.ts, src/handlers/index.ts, src/operations/assistant.ts, src/operations/index.ts, src/policy/guard.ts, src/policy/index.ts, src/policy/types.ts
5
+ ℹ target: esnext
6
+ ℹ tsconfig: tsconfig.json
7
+ ℹ Build start
8
+ ℹ Cleaning 51 files
9
+ ℹ dist/entities/models.js 3.94 kB │ gzip: 0.83 kB
10
+ ℹ dist/operations/assistant.js 3.23 kB │ gzip: 1.06 kB
11
+ ℹ dist/events.js 3.04 kB │ gzip: 0.67 kB
12
+ ℹ dist/handlers/demo.handlers.js 2.46 kB │ gzip: 0.90 kB
13
+ ℹ dist/policy/guard.js 1.90 kB │ gzip: 0.76 kB
14
+ ℹ dist/docs/locale-jurisdiction-gate.docblock.js 1.63 kB │ gzip: 0.74 kB
15
+ ℹ dist/index.js 1.27 kB │ gzip: 0.40 kB
16
+ ℹ dist/locale-jurisdiction-gate.feature.js 1.04 kB │ gzip: 0.46 kB
17
+ ℹ dist/example.js 0.93 kB │ gzip: 0.50 kB
18
+ ℹ dist/entities/index.js 0.36 kB │ gzip: 0.16 kB
19
+ ℹ dist/operations/index.js 0.16 kB │ gzip: 0.10 kB
20
+ ℹ dist/policy/index.js 0.15 kB │ gzip: 0.11 kB
21
+ ℹ dist/handlers/index.js 0.11 kB │ gzip: 0.09 kB
22
+ ℹ dist/docs/index.js 0.05 kB │ gzip: 0.07 kB
23
+ ℹ dist/policy/types.js 0.00 kB │ gzip: 0.02 kB
24
+ ℹ dist/handlers/demo.handlers.js.map 5.97 kB │ gzip: 1.81 kB
25
+ ℹ dist/entities/models.js.map 5.84 kB │ gzip: 1.19 kB
26
+ ℹ dist/operations/assistant.js.map 4.57 kB │ gzip: 1.40 kB
27
+ ℹ dist/events.js.map 4.37 kB │ gzip: 0.92 kB
28
+ ℹ dist/policy/guard.js.map 4.12 kB │ gzip: 1.44 kB
29
+ ℹ dist/docs/locale-jurisdiction-gate.docblock.js.map 2.14 kB │ gzip: 0.93 kB
30
+ ℹ dist/locale-jurisdiction-gate.feature.js.map 1.68 kB │ gzip: 0.72 kB
31
+ ℹ dist/example.js.map 1.33 kB │ gzip: 0.68 kB
32
+ ℹ dist/entities/models.d.ts.map 0.93 kB │ gzip: 0.40 kB
33
+ ℹ dist/policy/guard.d.ts.map 0.76 kB │ gzip: 0.39 kB
34
+ ℹ dist/operations/assistant.d.ts.map 0.67 kB │ gzip: 0.28 kB
35
+ ℹ dist/events.d.ts.map 0.57 kB │ gzip: 0.25 kB
36
+ ℹ dist/handlers/demo.handlers.d.ts.map 0.45 kB │ gzip: 0.26 kB
37
+ ℹ dist/policy/types.d.ts.map 0.25 kB │ gzip: 0.19 kB
38
+ ℹ dist/locale-jurisdiction-gate.feature.d.ts.map 0.18 kB │ gzip: 0.14 kB
39
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
40
+ ℹ dist/operations/assistant.d.ts 6.77 kB │ gzip: 0.63 kB
41
+ ℹ dist/entities/models.d.ts 5.09 kB │ gzip: 0.67 kB
42
+ ℹ dist/events.d.ts 2.01 kB │ gzip: 0.37 kB
43
+ ℹ dist/handlers/demo.handlers.d.ts 1.48 kB │ gzip: 0.55 kB
44
+ ℹ dist/index.d.ts 1.37 kB │ gzip: 0.42 kB
45
+ ℹ dist/example.d.ts 1.19 kB │ gzip: 0.49 kB
46
+ ℹ dist/policy/guard.d.ts 0.93 kB │ gzip: 0.42 kB
47
+ ℹ dist/policy/types.d.ts 0.46 kB │ gzip: 0.31 kB
48
+ ℹ dist/entities/index.d.ts 0.36 kB │ gzip: 0.16 kB
49
+ ℹ dist/locale-jurisdiction-gate.feature.d.ts 0.29 kB │ gzip: 0.18 kB
50
+ ℹ dist/policy/index.d.ts 0.26 kB │ gzip: 0.14 kB
51
+ ℹ dist/operations/index.d.ts 0.16 kB │ gzip: 0.10 kB
52
+ ℹ dist/handlers/index.d.ts 0.15 kB │ gzip: 0.09 kB
53
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
54
+ ℹ dist/docs/locale-jurisdiction-gate.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
55
+ ℹ 46 files, total: 74.80 kB
56
+ ✔ Build complete in 23527ms
@@ -1,26 +1,57 @@
1
- $ bun build:bundle && bun build:types
1
+ $ bun build:types && bun build:bundle
2
+ $ tsc --noEmit
2
3
  $ tsdown
3
- ℹ tsdown v0.17.4 powered by rolldown v1.0.0-beta.53
4
+ ℹ tsdown v0.18.3 powered by rolldown v1.0.0-beta.57
4
5
  ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/locale-jurisdiction-gate/tsdown.config.js
5
- ℹ entry: src/events.ts, src/example.ts, src/index.ts, src/locale-jurisdiction-gate.feature.ts, src/contracts/assistant.ts, src/contracts/index.ts, src/docs/index.ts, src/docs/locale-jurisdiction-gate.docblock.ts, src/entities/index.ts, src/entities/models.ts, src/handlers/demo.handlers.ts, src/handlers/index.ts, src/policy/guard.ts, src/policy/index.ts, src/policy/types.ts
6
+ ℹ entry: src/events.ts, src/example.ts, src/index.ts, src/locale-jurisdiction-gate.feature.ts, src/entities/index.ts, src/entities/models.ts, src/docs/index.ts, src/docs/locale-jurisdiction-gate.docblock.ts, src/handlers/demo.handlers.ts, src/handlers/index.ts, src/operations/assistant.ts, src/operations/index.ts, src/policy/guard.ts, src/policy/index.ts, src/policy/types.ts
6
7
  ℹ target: esnext
7
8
  ℹ tsconfig: tsconfig.json
8
9
  ℹ Build start
9
- ℹ dist/entities/models.js 2.50 kB │ gzip: 0.74 kB
10
- ℹ dist/contracts/assistant.js 2.34 kB │ gzip: 0.93 kB
11
- ℹ dist/events.js 1.69 kB │ gzip: 0.48 kB
12
- ℹ dist/handlers/demo.handlers.js 1.55 kB │ gzip: 0.69 kB
13
- ℹ dist/docs/locale-jurisdiction-gate.docblock.js 1.40 kB │ gzip: 0.67 kB
14
- ℹ dist/index.js 1.34 kB │ gzip: 0.47 kB
15
- ℹ dist/policy/guard.js 1.18 kB │ gzip: 0.61 kB
16
- ℹ dist/locale-jurisdiction-gate.feature.js 0.72 kB │ gzip: 0.36 kB
17
- ℹ dist/example.js 0.67 kB │ gzip: 0.40 kB
18
- ℹ dist/entities/index.js 0.41 kB │ gzip: 0.19 kB
19
- ℹ dist/policy/index.js 0.17 kB │ gzip: 0.12 kB
20
- ℹ dist/contracts/index.js 0.17 kB │ gzip: 0.11 kB
21
- ℹ dist/handlers/index.js 0.11 kB │ gzip: 0.09 kB
22
- ℹ dist/docs/index.js 0.05 kB │ gzip: 0.07 kB
23
- ℹ dist/policy/types.js 0.00 kB │ gzip: 0.02 kB
24
- ℹ 15 files, total: 14.30 kB
25
- ✔ Build complete in 81ms
26
- $ tsc --noEmit
10
+ ℹ dist/entities/models.js 3.94 kB │ gzip: 0.83 kB
11
+ ℹ dist/operations/assistant.js 3.23 kB │ gzip: 1.06 kB
12
+ ℹ dist/events.js 3.04 kB │ gzip: 0.67 kB
13
+ ℹ dist/handlers/demo.handlers.js 2.46 kB │ gzip: 0.90 kB
14
+ ℹ dist/policy/guard.js 1.90 kB │ gzip: 0.76 kB
15
+ ℹ dist/docs/locale-jurisdiction-gate.docblock.js 1.63 kB │ gzip: 0.74 kB
16
+ ℹ dist/index.js 1.27 kB │ gzip: 0.40 kB
17
+ ℹ dist/locale-jurisdiction-gate.feature.js 1.04 kB │ gzip: 0.46 kB
18
+ ℹ dist/example.js 0.93 kB │ gzip: 0.50 kB
19
+ ℹ dist/entities/index.js 0.36 kB │ gzip: 0.16 kB
20
+ ℹ dist/operations/index.js 0.16 kB │ gzip: 0.10 kB
21
+ ℹ dist/policy/index.js 0.15 kB │ gzip: 0.11 kB
22
+ ℹ dist/handlers/index.js 0.11 kB │ gzip: 0.09 kB
23
+ ℹ dist/docs/index.js 0.05 kB │ gzip: 0.07 kB
24
+ ℹ dist/policy/types.js 0.00 kB │ gzip: 0.02 kB
25
+ ℹ dist/handlers/demo.handlers.js.map 5.97 kB │ gzip: 1.81 kB
26
+ ℹ dist/entities/models.js.map 5.84 kB │ gzip: 1.19 kB
27
+ ℹ dist/operations/assistant.js.map 4.57 kB │ gzip: 1.40 kB
28
+ ℹ dist/events.js.map 4.37 kB │ gzip: 0.92 kB
29
+ ℹ dist/policy/guard.js.map 4.12 kB │ gzip: 1.44 kB
30
+ ℹ dist/docs/locale-jurisdiction-gate.docblock.js.map 2.14 kB │ gzip: 0.93 kB
31
+ ℹ dist/locale-jurisdiction-gate.feature.js.map 1.68 kB │ gzip: 0.72 kB
32
+ ℹ dist/example.js.map 1.33 kB │ gzip: 0.68 kB
33
+ ℹ dist/entities/models.d.ts.map 0.93 kB │ gzip: 0.40 kB
34
+ ℹ dist/policy/guard.d.ts.map 0.76 kB │ gzip: 0.39 kB
35
+ ℹ dist/operations/assistant.d.ts.map 0.67 kB │ gzip: 0.28 kB
36
+ ℹ dist/events.d.ts.map 0.57 kB │ gzip: 0.25 kB
37
+ ℹ dist/handlers/demo.handlers.d.ts.map 0.45 kB │ gzip: 0.26 kB
38
+ ℹ dist/policy/types.d.ts.map 0.25 kB │ gzip: 0.19 kB
39
+ ℹ dist/locale-jurisdiction-gate.feature.d.ts.map 0.18 kB │ gzip: 0.14 kB
40
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
41
+ ℹ dist/operations/assistant.d.ts 6.77 kB │ gzip: 0.63 kB
42
+ ℹ dist/entities/models.d.ts 5.09 kB │ gzip: 0.67 kB
43
+ ℹ dist/events.d.ts 2.01 kB │ gzip: 0.37 kB
44
+ ℹ dist/handlers/demo.handlers.d.ts 1.48 kB │ gzip: 0.55 kB
45
+ ℹ dist/index.d.ts 1.37 kB │ gzip: 0.42 kB
46
+ ℹ dist/example.d.ts 1.19 kB │ gzip: 0.49 kB
47
+ ℹ dist/policy/guard.d.ts 0.93 kB │ gzip: 0.42 kB
48
+ ℹ dist/policy/types.d.ts 0.46 kB │ gzip: 0.31 kB
49
+ ℹ dist/entities/index.d.ts 0.36 kB │ gzip: 0.16 kB
50
+ ℹ dist/locale-jurisdiction-gate.feature.d.ts 0.29 kB │ gzip: 0.18 kB
51
+ ℹ dist/policy/index.d.ts 0.26 kB │ gzip: 0.14 kB
52
+ ℹ dist/operations/index.d.ts 0.16 kB │ gzip: 0.10 kB
53
+ ℹ dist/handlers/index.d.ts 0.15 kB │ gzip: 0.09 kB
54
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
55
+ ℹ dist/docs/locale-jurisdiction-gate.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
56
+ ℹ 46 files, total: 74.80 kB
57
+ ✔ Build complete in 23934ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,31 @@
1
+ # @lssm/example.locale-jurisdiction-gate
2
+
3
+ ## 1.42.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 1f9ac4c: fix
8
+ - Updated dependencies [1f9ac4c]
9
+ - @lssm/lib.contracts@1.42.2
10
+ - @lssm/lib.schema@1.42.2
11
+
12
+ ## 1.42.1
13
+
14
+ ### Patch Changes
15
+
16
+ - f043995: Fix release
17
+ - Updated dependencies [f043995]
18
+ - @lssm/lib.contracts@1.42.1
19
+ - @lssm/lib.schema@1.42.1
20
+
21
+ ## 1.42.0
22
+
23
+ ### Minor Changes
24
+
25
+ - 8eefd9c: initial release
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [8eefd9c]
30
+ - @lssm/lib.contracts@1.42.0
31
+ - @lssm/lib.schema@1.42.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chaman Ventures, SASU
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # `@lssm/example.locale-jurisdiction-gate`
2
2
 
3
+ Website: https://contractspec.lssm.tech/
4
+
5
+
3
6
  Spec-first example showing how to **fail-closed** on every assistant call unless:
4
7
 
5
8
  - `locale` is provided and supported
@@ -0,0 +1 @@
1
+ export { };
@@ -1 +1 @@
1
- import"./locale-jurisdiction-gate.docblock.js";
1
+ import "./locale-jurisdiction-gate.docblock.js";
@@ -0,0 +1 @@
1
+ export { };
@@ -1,11 +1,41 @@
1
- import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.examples.locale-jurisdiction-gate.goal`,title:`Locale/Jurisdiction Gate — Goal`,summary:`Fail-closed gate that forces locale + jurisdiction + kbSnapshotId + allowedScope for assistant calls.`,kind:`goal`,visibility:`public`,route:`/docs/examples/locale-jurisdiction-gate/goal`,tags:[`assistant`,`policy`,`locale`,`jurisdiction`,`knowledge`],body:`## Why it matters
1
+ import { registerDocBlocks } from "@lssm/lib.contracts/docs";
2
+
3
+ //#region src/docs/locale-jurisdiction-gate.docblock.ts
4
+ registerDocBlocks([{
5
+ id: "docs.examples.locale-jurisdiction-gate.goal",
6
+ title: "Locale/Jurisdiction Gate — Goal",
7
+ summary: "Fail-closed gate that forces locale + jurisdiction + kbSnapshotId + allowedScope for assistant calls.",
8
+ kind: "goal",
9
+ visibility: "public",
10
+ route: "/docs/examples/locale-jurisdiction-gate/goal",
11
+ tags: [
12
+ "assistant",
13
+ "policy",
14
+ "locale",
15
+ "jurisdiction",
16
+ "knowledge"
17
+ ],
18
+ body: `## Why it matters
2
19
  - Forces all assistant behavior to be bound to explicit inputs (no guessing).
3
20
  - Requires KB snapshot citations to make answers traceable and regenerable.
4
21
 
5
22
  ## Guardrails
6
23
  - Missing locale/jurisdiction/snapshot/scope => refuse (structured).
7
24
  - Missing citations => refuse.
8
- - Scope violations under education_only => refuse/escalate.`},{id:`docs.examples.locale-jurisdiction-gate.reference`,title:`Locale/Jurisdiction Gate — Reference`,summary:`Contracts, models, and events exposed by the gate example.`,kind:`reference`,visibility:`public`,route:`/docs/examples/locale-jurisdiction-gate`,tags:[`assistant`,`policy`,`reference`],body:`## Contracts
25
+ - Scope violations under education_only => refuse/escalate.`
26
+ }, {
27
+ id: "docs.examples.locale-jurisdiction-gate.reference",
28
+ title: "Locale/Jurisdiction Gate — Reference",
29
+ summary: "Contracts, models, and events exposed by the gate example.",
30
+ kind: "reference",
31
+ visibility: "public",
32
+ route: "/docs/examples/locale-jurisdiction-gate",
33
+ tags: [
34
+ "assistant",
35
+ "policy",
36
+ "reference"
37
+ ],
38
+ body: `## Contracts
9
39
  - assistant.answer (v1)
10
40
  - assistant.explainConcept (v1)
11
41
 
@@ -16,4 +46,8 @@ import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.exampl
16
46
  ## Events
17
47
  - assistant.answer.requested
18
48
  - assistant.answer.blocked
19
- - assistant.answer.delivered`}]);
49
+ - assistant.answer.delivered`
50
+ }]);
51
+
52
+ //#endregion
53
+ //# sourceMappingURL=locale-jurisdiction-gate.docblock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-jurisdiction-gate.docblock.js","names":[],"sources":["../../src/docs/locale-jurisdiction-gate.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@lssm/lib.contracts/docs';\nimport { registerDocBlocks } from '@lssm/lib.contracts/docs';\n\nconst docBlocks: DocBlock[] = [\n {\n id: 'docs.examples.locale-jurisdiction-gate.goal',\n title: 'Locale/Jurisdiction Gate — Goal',\n summary:\n 'Fail-closed gate that forces locale + jurisdiction + kbSnapshotId + allowedScope for assistant calls.',\n kind: 'goal',\n visibility: 'public',\n route: '/docs/examples/locale-jurisdiction-gate/goal',\n tags: ['assistant', 'policy', 'locale', 'jurisdiction', 'knowledge'],\n body: `## Why it matters\n- Forces all assistant behavior to be bound to explicit inputs (no guessing).\n- Requires KB snapshot citations to make answers traceable and regenerable.\n\n## Guardrails\n- Missing locale/jurisdiction/snapshot/scope => refuse (structured).\n- Missing citations => refuse.\n- Scope violations under education_only => refuse/escalate.`,\n },\n {\n id: 'docs.examples.locale-jurisdiction-gate.reference',\n title: 'Locale/Jurisdiction Gate — Reference',\n summary: 'Contracts, models, and events exposed by the gate example.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/locale-jurisdiction-gate',\n tags: ['assistant', 'policy', 'reference'],\n body: `## Contracts\n- assistant.answer (v1)\n- assistant.explainConcept (v1)\n\n## Models\n- LLMCallEnvelope (locale, regulatoryContext, kbSnapshotId, allowedScope, traceId)\n- AssistantAnswerIR (sections, citations, disclaimers, riskFlags)\n\n## Events\n- assistant.answer.requested\n- assistant.answer.blocked\n- assistant.answer.delivered`,\n },\n];\n\nregisterDocBlocks(docBlocks);\n"],"mappings":";;;AA6CA,kBA1C8B,CAC5B;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAa;EAAU;EAAU;EAAgB;EAAY;CACpE,MAAM;;;;;;;;CAQP,EACD;CACE,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAa;EAAU;EAAY;CAC1C,MAAM;;;;;;;;;;;;CAYP,CACF,CAE2B"}
@@ -0,0 +1,2 @@
1
+ import { AllowedScopeEnum, AssistantAnswerIRModel, AssistantAnswerSectionModel, AssistantCitationModel, LLMCallEnvelopeModel, RegulatoryContextModel, UserProfileModel } from "./models.js";
2
+ export { AllowedScopeEnum, AssistantAnswerIRModel, AssistantAnswerSectionModel, AssistantCitationModel, LLMCallEnvelopeModel, RegulatoryContextModel, UserProfileModel };
@@ -1 +1,3 @@
1
- import{AllowedScopeEnum as e,AssistantAnswerIRModel as t,AssistantAnswerSectionModel as n,AssistantCitationModel as r,LLMCallEnvelopeModel as i,RegulatoryContextModel as a,UserProfileModel as o}from"./models.js";export{e as AllowedScopeEnum,t as AssistantAnswerIRModel,n as AssistantAnswerSectionModel,r as AssistantCitationModel,i as LLMCallEnvelopeModel,a as RegulatoryContextModel,o as UserProfileModel};
1
+ import { AllowedScopeEnum, AssistantAnswerIRModel, AssistantAnswerSectionModel, AssistantCitationModel, LLMCallEnvelopeModel, RegulatoryContextModel, UserProfileModel } from "./models.js";
2
+
3
+ export { AllowedScopeEnum, AssistantAnswerIRModel, AssistantAnswerSectionModel, AssistantCitationModel, LLMCallEnvelopeModel, RegulatoryContextModel, UserProfileModel };
@@ -0,0 +1,186 @@
1
+ import * as _lssm_lib_schema16 from "@lssm/lib.schema";
2
+
3
+ //#region src/entities/models.d.ts
4
+ declare const AllowedScopeEnum: _lssm_lib_schema16.EnumType<[string, string, string]>;
5
+ declare const UserProfileModel: _lssm_lib_schema16.SchemaModel<{
6
+ preferredLocale: {
7
+ type: _lssm_lib_schema16.FieldType<string, string>;
8
+ isOptional: true;
9
+ };
10
+ residencyCountry: {
11
+ type: _lssm_lib_schema16.FieldType<string, string>;
12
+ isOptional: true;
13
+ };
14
+ taxResidenceCountry: {
15
+ type: _lssm_lib_schema16.FieldType<string, string>;
16
+ isOptional: true;
17
+ };
18
+ clientType: {
19
+ type: _lssm_lib_schema16.FieldType<string, string>;
20
+ isOptional: true;
21
+ };
22
+ }>;
23
+ declare const RegulatoryContextModel: _lssm_lib_schema16.SchemaModel<{
24
+ jurisdiction: {
25
+ type: _lssm_lib_schema16.FieldType<string, string>;
26
+ isOptional: false;
27
+ };
28
+ region: {
29
+ type: _lssm_lib_schema16.FieldType<string, string>;
30
+ isOptional: true;
31
+ };
32
+ clientType: {
33
+ type: _lssm_lib_schema16.FieldType<string, string>;
34
+ isOptional: true;
35
+ };
36
+ allowedScope: {
37
+ type: _lssm_lib_schema16.EnumType<[string, string, string]>;
38
+ isOptional: false;
39
+ };
40
+ }>;
41
+ declare const LLMCallEnvelopeModel: _lssm_lib_schema16.SchemaModel<{
42
+ traceId: {
43
+ type: _lssm_lib_schema16.FieldType<string, string>;
44
+ isOptional: false;
45
+ };
46
+ locale: {
47
+ type: _lssm_lib_schema16.FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ regulatoryContext: {
51
+ type: _lssm_lib_schema16.SchemaModel<{
52
+ jurisdiction: {
53
+ type: _lssm_lib_schema16.FieldType<string, string>;
54
+ isOptional: false;
55
+ };
56
+ region: {
57
+ type: _lssm_lib_schema16.FieldType<string, string>;
58
+ isOptional: true;
59
+ };
60
+ clientType: {
61
+ type: _lssm_lib_schema16.FieldType<string, string>;
62
+ isOptional: true;
63
+ };
64
+ allowedScope: {
65
+ type: _lssm_lib_schema16.EnumType<[string, string, string]>;
66
+ isOptional: false;
67
+ };
68
+ }>;
69
+ isOptional: false;
70
+ };
71
+ kbSnapshotId: {
72
+ type: _lssm_lib_schema16.FieldType<string, string>;
73
+ isOptional: false;
74
+ };
75
+ allowedScope: {
76
+ type: _lssm_lib_schema16.EnumType<[string, string, string]>;
77
+ isOptional: false;
78
+ };
79
+ }>;
80
+ declare const AssistantCitationModel: _lssm_lib_schema16.SchemaModel<{
81
+ kbSnapshotId: {
82
+ type: _lssm_lib_schema16.FieldType<string, string>;
83
+ isOptional: false;
84
+ };
85
+ sourceType: {
86
+ type: _lssm_lib_schema16.FieldType<string, string>;
87
+ isOptional: false;
88
+ };
89
+ sourceId: {
90
+ type: _lssm_lib_schema16.FieldType<string, string>;
91
+ isOptional: false;
92
+ };
93
+ title: {
94
+ type: _lssm_lib_schema16.FieldType<string, string>;
95
+ isOptional: true;
96
+ };
97
+ excerpt: {
98
+ type: _lssm_lib_schema16.FieldType<string, string>;
99
+ isOptional: true;
100
+ };
101
+ }>;
102
+ declare const AssistantAnswerSectionModel: _lssm_lib_schema16.SchemaModel<{
103
+ heading: {
104
+ type: _lssm_lib_schema16.FieldType<string, string>;
105
+ isOptional: false;
106
+ };
107
+ body: {
108
+ type: _lssm_lib_schema16.FieldType<string, string>;
109
+ isOptional: false;
110
+ };
111
+ }>;
112
+ declare const AssistantAnswerIRModel: _lssm_lib_schema16.SchemaModel<{
113
+ locale: {
114
+ type: _lssm_lib_schema16.FieldType<string, string>;
115
+ isOptional: false;
116
+ };
117
+ jurisdiction: {
118
+ type: _lssm_lib_schema16.FieldType<string, string>;
119
+ isOptional: false;
120
+ };
121
+ allowedScope: {
122
+ type: _lssm_lib_schema16.EnumType<[string, string, string]>;
123
+ isOptional: false;
124
+ };
125
+ sections: {
126
+ type: _lssm_lib_schema16.SchemaModel<{
127
+ heading: {
128
+ type: _lssm_lib_schema16.FieldType<string, string>;
129
+ isOptional: false;
130
+ };
131
+ body: {
132
+ type: _lssm_lib_schema16.FieldType<string, string>;
133
+ isOptional: false;
134
+ };
135
+ }>;
136
+ isArray: true;
137
+ isOptional: false;
138
+ };
139
+ citations: {
140
+ type: _lssm_lib_schema16.SchemaModel<{
141
+ kbSnapshotId: {
142
+ type: _lssm_lib_schema16.FieldType<string, string>;
143
+ isOptional: false;
144
+ };
145
+ sourceType: {
146
+ type: _lssm_lib_schema16.FieldType<string, string>;
147
+ isOptional: false;
148
+ };
149
+ sourceId: {
150
+ type: _lssm_lib_schema16.FieldType<string, string>;
151
+ isOptional: false;
152
+ };
153
+ title: {
154
+ type: _lssm_lib_schema16.FieldType<string, string>;
155
+ isOptional: true;
156
+ };
157
+ excerpt: {
158
+ type: _lssm_lib_schema16.FieldType<string, string>;
159
+ isOptional: true;
160
+ };
161
+ }>;
162
+ isArray: true;
163
+ isOptional: false;
164
+ };
165
+ disclaimers: {
166
+ type: _lssm_lib_schema16.FieldType<string, string>;
167
+ isArray: true;
168
+ isOptional: true;
169
+ };
170
+ riskFlags: {
171
+ type: _lssm_lib_schema16.FieldType<string, string>;
172
+ isArray: true;
173
+ isOptional: true;
174
+ };
175
+ refused: {
176
+ type: _lssm_lib_schema16.FieldType<boolean, boolean>;
177
+ isOptional: true;
178
+ };
179
+ refusalReason: {
180
+ type: _lssm_lib_schema16.FieldType<string, string>;
181
+ isOptional: true;
182
+ };
183
+ }>;
184
+ //#endregion
185
+ export { AllowedScopeEnum, AssistantAnswerIRModel, AssistantAnswerSectionModel, AssistantCitationModel, LLMCallEnvelopeModel, RegulatoryContextModel, UserProfileModel };
186
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","names":[],"sources":["../../src/entities/models.ts"],"sourcesContent":[],"mappings":";;;cAMa,kBAIX,kBAAA,CAJ2B;cAMhB,qCAAgB;;IANhB,IAAA,EAwBX,kBAAA,CAAA,SApBA,CAAA,MAJ2B,EAAA,MAAA,CAAA;IAMhB,UAAA,EAAA,IAkBX;EAAA,CAAA;;;;;EAlB2B,mBAAA,EAAA;IAoBhB,IAAA,8BASX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;gBATiC,IAAA;EAAA,CAAA;AAWnC,CAAA,CAAA;AAWE,cAtBW,sBAsBX,qBAtBiC,WAsBjC,CAAA;;UAbA,kBAAA,CAAA;;;;;;;;IAE+B,IAAA,8BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAapB,UAAA,EAAA,IAAA;EAWX,CAAA;;;;;;AAXiC,cAbtB,oBAasB,qBAbF,WAaE,CAAA;EAatB,OAAA,EAAA;IAOX,IAAA,EAtBA,kBAAA,CAAA,SAsBA,CAAA,MAAA,EAAA,MAAA,CAAA;;;EAPsC,MAAA,EAAA;IAS3B,IAAA,8BA+BX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;kBA/BiC,EAAA;QAAA,IAAA,6BAAA,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;;;;;;;;;;;;;;;cAtBtB,2CAAsB;;UAWjC,kBAAA,CAAA;;;;;;;;;;;;;;;;;;;;cAEW,gDAA2B;;UAOtC,kBAAA,CAAA;;;;;;;;cAEW,2CAAsB;;UA+BjC,kBAAA,CAAA"}
@@ -1 +1,168 @@
1
- import{ScalarTypeEnum as e,defineEnum as t,defineSchemaModel as n}from"@lssm/lib.schema";const r=t(`AllowedScope`,[`education_only`,`generic_info`,`escalation_required`]),i=n({name:`UserProfile`,description:`User profile inputs used to derive regulatory context.`,fields:{preferredLocale:{type:e.String_unsecure(),isOptional:!0},residencyCountry:{type:e.String_unsecure(),isOptional:!0},taxResidenceCountry:{type:e.String_unsecure(),isOptional:!0},clientType:{type:e.String_unsecure(),isOptional:!0}}}),a=n({name:`RegulatoryContext`,description:`Explicit regulatory context (no guessing).`,fields:{jurisdiction:{type:e.String_unsecure(),isOptional:!1},region:{type:e.String_unsecure(),isOptional:!0},clientType:{type:e.String_unsecure(),isOptional:!0},allowedScope:{type:r,isOptional:!1}}}),o=n({name:`LLMCallEnvelope`,description:`Mandatory envelope for assistant calls. All fields are explicit and required for policy gating.`,fields:{traceId:{type:e.String_unsecure(),isOptional:!1},locale:{type:e.String_unsecure(),isOptional:!1},regulatoryContext:{type:a,isOptional:!1},kbSnapshotId:{type:e.String_unsecure(),isOptional:!1},allowedScope:{type:r,isOptional:!1}}}),s=n({name:`AssistantCitation`,description:`Citation referencing a KB snapshot + a specific item within it.`,fields:{kbSnapshotId:{type:e.String_unsecure(),isOptional:!1},sourceType:{type:e.String_unsecure(),isOptional:!1},sourceId:{type:e.String_unsecure(),isOptional:!1},title:{type:e.String_unsecure(),isOptional:!0},excerpt:{type:e.String_unsecure(),isOptional:!0}}}),c=n({name:`AssistantAnswerSection`,description:`Structured answer section.`,fields:{heading:{type:e.String_unsecure(),isOptional:!1},body:{type:e.String_unsecure(),isOptional:!1}}}),l=n({name:`AssistantAnswerIR`,description:`Structured assistant answer with mandatory citations and explicit locale/jurisdiction.`,fields:{locale:{type:e.String_unsecure(),isOptional:!1},jurisdiction:{type:e.String_unsecure(),isOptional:!1},allowedScope:{type:r,isOptional:!1},sections:{type:c,isArray:!0,isOptional:!1},citations:{type:s,isArray:!0,isOptional:!1},disclaimers:{type:e.String_unsecure(),isArray:!0,isOptional:!0},riskFlags:{type:e.String_unsecure(),isArray:!0,isOptional:!0},refused:{type:e.Boolean(),isOptional:!0},refusalReason:{type:e.String_unsecure(),isOptional:!0}}});export{r as AllowedScopeEnum,l as AssistantAnswerIRModel,c as AssistantAnswerSectionModel,s as AssistantCitationModel,o as LLMCallEnvelopeModel,a as RegulatoryContextModel,i as UserProfileModel};
1
+ import { ScalarTypeEnum, defineEnum, defineSchemaModel } from "@lssm/lib.schema";
2
+
3
+ //#region src/entities/models.ts
4
+ const AllowedScopeEnum = defineEnum("AllowedScope", [
5
+ "education_only",
6
+ "generic_info",
7
+ "escalation_required"
8
+ ]);
9
+ const UserProfileModel = defineSchemaModel({
10
+ name: "UserProfile",
11
+ description: "User profile inputs used to derive regulatory context.",
12
+ fields: {
13
+ preferredLocale: {
14
+ type: ScalarTypeEnum.String_unsecure(),
15
+ isOptional: true
16
+ },
17
+ residencyCountry: {
18
+ type: ScalarTypeEnum.String_unsecure(),
19
+ isOptional: true
20
+ },
21
+ taxResidenceCountry: {
22
+ type: ScalarTypeEnum.String_unsecure(),
23
+ isOptional: true
24
+ },
25
+ clientType: {
26
+ type: ScalarTypeEnum.String_unsecure(),
27
+ isOptional: true
28
+ }
29
+ }
30
+ });
31
+ const RegulatoryContextModel = defineSchemaModel({
32
+ name: "RegulatoryContext",
33
+ description: "Explicit regulatory context (no guessing).",
34
+ fields: {
35
+ jurisdiction: {
36
+ type: ScalarTypeEnum.String_unsecure(),
37
+ isOptional: false
38
+ },
39
+ region: {
40
+ type: ScalarTypeEnum.String_unsecure(),
41
+ isOptional: true
42
+ },
43
+ clientType: {
44
+ type: ScalarTypeEnum.String_unsecure(),
45
+ isOptional: true
46
+ },
47
+ allowedScope: {
48
+ type: AllowedScopeEnum,
49
+ isOptional: false
50
+ }
51
+ }
52
+ });
53
+ const LLMCallEnvelopeModel = defineSchemaModel({
54
+ name: "LLMCallEnvelope",
55
+ description: "Mandatory envelope for assistant calls. All fields are explicit and required for policy gating.",
56
+ fields: {
57
+ traceId: {
58
+ type: ScalarTypeEnum.String_unsecure(),
59
+ isOptional: false
60
+ },
61
+ locale: {
62
+ type: ScalarTypeEnum.String_unsecure(),
63
+ isOptional: false
64
+ },
65
+ regulatoryContext: {
66
+ type: RegulatoryContextModel,
67
+ isOptional: false
68
+ },
69
+ kbSnapshotId: {
70
+ type: ScalarTypeEnum.String_unsecure(),
71
+ isOptional: false
72
+ },
73
+ allowedScope: {
74
+ type: AllowedScopeEnum,
75
+ isOptional: false
76
+ }
77
+ }
78
+ });
79
+ const AssistantCitationModel = defineSchemaModel({
80
+ name: "AssistantCitation",
81
+ description: "Citation referencing a KB snapshot + a specific item within it.",
82
+ fields: {
83
+ kbSnapshotId: {
84
+ type: ScalarTypeEnum.String_unsecure(),
85
+ isOptional: false
86
+ },
87
+ sourceType: {
88
+ type: ScalarTypeEnum.String_unsecure(),
89
+ isOptional: false
90
+ },
91
+ sourceId: {
92
+ type: ScalarTypeEnum.String_unsecure(),
93
+ isOptional: false
94
+ },
95
+ title: {
96
+ type: ScalarTypeEnum.String_unsecure(),
97
+ isOptional: true
98
+ },
99
+ excerpt: {
100
+ type: ScalarTypeEnum.String_unsecure(),
101
+ isOptional: true
102
+ }
103
+ }
104
+ });
105
+ const AssistantAnswerSectionModel = defineSchemaModel({
106
+ name: "AssistantAnswerSection",
107
+ description: "Structured answer section.",
108
+ fields: {
109
+ heading: {
110
+ type: ScalarTypeEnum.String_unsecure(),
111
+ isOptional: false
112
+ },
113
+ body: {
114
+ type: ScalarTypeEnum.String_unsecure(),
115
+ isOptional: false
116
+ }
117
+ }
118
+ });
119
+ const AssistantAnswerIRModel = defineSchemaModel({
120
+ name: "AssistantAnswerIR",
121
+ description: "Structured assistant answer with mandatory citations and explicit locale/jurisdiction.",
122
+ fields: {
123
+ locale: {
124
+ type: ScalarTypeEnum.String_unsecure(),
125
+ isOptional: false
126
+ },
127
+ jurisdiction: {
128
+ type: ScalarTypeEnum.String_unsecure(),
129
+ isOptional: false
130
+ },
131
+ allowedScope: {
132
+ type: AllowedScopeEnum,
133
+ isOptional: false
134
+ },
135
+ sections: {
136
+ type: AssistantAnswerSectionModel,
137
+ isArray: true,
138
+ isOptional: false
139
+ },
140
+ citations: {
141
+ type: AssistantCitationModel,
142
+ isArray: true,
143
+ isOptional: false
144
+ },
145
+ disclaimers: {
146
+ type: ScalarTypeEnum.String_unsecure(),
147
+ isArray: true,
148
+ isOptional: true
149
+ },
150
+ riskFlags: {
151
+ type: ScalarTypeEnum.String_unsecure(),
152
+ isArray: true,
153
+ isOptional: true
154
+ },
155
+ refused: {
156
+ type: ScalarTypeEnum.Boolean(),
157
+ isOptional: true
158
+ },
159
+ refusalReason: {
160
+ type: ScalarTypeEnum.String_unsecure(),
161
+ isOptional: true
162
+ }
163
+ }
164
+ });
165
+
166
+ //#endregion
167
+ export { AllowedScopeEnum, AssistantAnswerIRModel, AssistantAnswerSectionModel, AssistantCitationModel, LLMCallEnvelopeModel, RegulatoryContextModel, UserProfileModel };
168
+ //# sourceMappingURL=models.js.map