@contractspec/example.locale-jurisdiction-gate 1.44.0

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 (73) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +56 -0
  2. package/.turbo/turbo-build.log +57 -0
  3. package/CHANGELOG.md +161 -0
  4. package/LICENSE +21 -0
  5. package/README.md +42 -0
  6. package/dist/docs/index.d.ts +1 -0
  7. package/dist/docs/index.js +1 -0
  8. package/dist/docs/locale-jurisdiction-gate.docblock.d.ts +1 -0
  9. package/dist/docs/locale-jurisdiction-gate.docblock.js +53 -0
  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 -0
  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 -0
  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 -0
  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 -0
  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 -0
  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 -0
  31. package/dist/index.d.ts +11 -0
  32. package/dist/index.js +12 -0
  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 -0
  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 -0
  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 -0
  49. package/dist/policy/types.d.ts +16 -0
  50. package/dist/policy/types.d.ts.map +1 -0
  51. package/dist/policy/types.js +0 -0
  52. package/example.ts +1 -0
  53. package/package.json +80 -0
  54. package/src/docs/index.ts +1 -0
  55. package/src/docs/locale-jurisdiction-gate.docblock.ts +46 -0
  56. package/src/entities/index.ts +1 -0
  57. package/src/entities/models.ts +110 -0
  58. package/src/events.ts +74 -0
  59. package/src/example.ts +27 -0
  60. package/src/handlers/demo.handlers.test.ts +54 -0
  61. package/src/handlers/demo.handlers.ts +160 -0
  62. package/src/handlers/index.ts +1 -0
  63. package/src/index.ts +15 -0
  64. package/src/locale-jurisdiction-gate.feature.ts +30 -0
  65. package/src/operations/assistant.ts +98 -0
  66. package/src/operations/index.ts +1 -0
  67. package/src/policy/guard.test.ts +25 -0
  68. package/src/policy/guard.ts +102 -0
  69. package/src/policy/index.ts +2 -0
  70. package/src/policy/types.ts +18 -0
  71. package/tsconfig.json +17 -0
  72. package/tsconfig.tsbuildinfo +1 -0
  73. package/tsdown.config.js +17 -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.95 kB │ gzip: 0.83 kB
10
+ ℹ dist/operations/assistant.js 3.24 kB │ gzip: 1.07 kB
11
+ ℹ dist/events.js 3.06 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.64 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.94 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.85 kB │ gzip: 1.20 kB
26
+ ℹ dist/operations/assistant.js.map 4.58 kB │ gzip: 1.40 kB
27
+ ℹ dist/events.js.map 4.39 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.16 kB │ gzip: 0.93 kB
30
+ ℹ dist/locale-jurisdiction-gate.feature.js.map 1.68 kB │ gzip: 0.73 kB
31
+ ℹ dist/example.js.map 1.34 kB │ gzip: 0.68 kB
32
+ ℹ dist/entities/models.d.ts.map 0.91 kB │ gzip: 0.39 kB
33
+ ℹ dist/policy/guard.d.ts.map 0.76 kB │ gzip: 0.39 kB
34
+ ℹ dist/operations/assistant.d.ts.map 0.65 kB │ gzip: 0.28 kB
35
+ ℹ dist/events.d.ts.map 0.57 kB │ gzip: 0.26 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 7.28 kB │ gzip: 0.64 kB
41
+ ℹ dist/entities/models.d.ts 5.48 kB │ gzip: 0.68 kB
42
+ ℹ dist/events.d.ts 2.20 kB │ gzip: 0.38 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.20 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.30 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: 76.00 kB
56
+ ✔ Build complete in 26703ms
@@ -0,0 +1,57 @@
1
+ $ bun build:types && bun build:bundle
2
+ $ tsc --noEmit
3
+ $ tsdown
4
+ ℹ tsdown v0.18.3 powered by rolldown v1.0.0-beta.57
5
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/locale-jurisdiction-gate/tsdown.config.js
6
+ ℹ 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
7
+ ℹ target: esnext
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ dist/entities/models.js 3.95 kB │ gzip: 0.83 kB
11
+ ℹ dist/operations/assistant.js 3.24 kB │ gzip: 1.07 kB
12
+ ℹ dist/events.js 3.06 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.64 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.94 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.85 kB │ gzip: 1.20 kB
27
+ ℹ dist/operations/assistant.js.map 4.58 kB │ gzip: 1.40 kB
28
+ ℹ dist/events.js.map 4.39 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.16 kB │ gzip: 0.93 kB
31
+ ℹ dist/locale-jurisdiction-gate.feature.js.map 1.68 kB │ gzip: 0.73 kB
32
+ ℹ dist/example.js.map 1.34 kB │ gzip: 0.68 kB
33
+ ℹ dist/entities/models.d.ts.map 0.91 kB │ gzip: 0.39 kB
34
+ ℹ dist/policy/guard.d.ts.map 0.76 kB │ gzip: 0.39 kB
35
+ ℹ dist/operations/assistant.d.ts.map 0.65 kB │ gzip: 0.28 kB
36
+ ℹ dist/events.d.ts.map 0.57 kB │ gzip: 0.26 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 7.28 kB │ gzip: 0.64 kB
42
+ ℹ dist/entities/models.d.ts 5.48 kB │ gzip: 0.68 kB
43
+ ℹ dist/events.d.ts 2.20 kB │ gzip: 0.38 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.20 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.30 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: 76.00 kB
57
+ ✔ Build complete in 20990ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,161 @@
1
+ # @contractspec/example.locale-jurisdiction-gate
2
+
3
+ ## 1.44.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5f3a868: chore: isolate branding to contractspec.io
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [5f3a868]
12
+ - @contractspec/lib.contracts@1.44.0
13
+ - @contractspec/lib.schema@1.44.0
14
+
15
+ ## 1.43.4
16
+
17
+ ### Patch Changes
18
+
19
+ - 9216062: fix: cross-platform compatibility
20
+ - Updated dependencies [9216062]
21
+ - @contractspec/lib.contracts@1.43.4
22
+ - @contractspec/lib.schema@1.43.3
23
+
24
+ ## 1.43.3
25
+
26
+ ### Patch Changes
27
+
28
+ - 24d9759: improve documentation
29
+ - Updated dependencies [24d9759]
30
+ - @contractspec/lib.contracts@1.43.3
31
+ - @contractspec/lib.schema@1.43.2
32
+
33
+ ## 1.43.2
34
+
35
+ ### Patch Changes
36
+
37
+ - e147271: fix: improve stability
38
+ - Updated dependencies [e147271]
39
+ - @contractspec/lib.contracts@1.43.2
40
+ - @contractspec/lib.schema@1.43.1
41
+
42
+ ## 1.43.1
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies [f28fdad]
47
+ - @contractspec/lib.contracts@1.43.1
48
+
49
+ ## 1.43.0
50
+
51
+ ### Minor Changes
52
+
53
+ - 042d072: feat: schema declaration using json schema, including zod
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [042d072]
58
+ - @contractspec/lib.contracts@1.43.0
59
+ - @contractspec/lib.schema@1.43.0
60
+
61
+ ## 1.42.10
62
+
63
+ ### Patch Changes
64
+
65
+ - 1e6a0f1: fix: mcp server
66
+ - Updated dependencies [1e6a0f1]
67
+ - @contractspec/lib.contracts@1.42.10
68
+ - @contractspec/lib.schema@1.42.10
69
+
70
+ ## 1.42.9
71
+
72
+ ### Patch Changes
73
+
74
+ - 9281db7: fix ModelRegistry
75
+ - Updated dependencies [9281db7]
76
+ - @contractspec/lib.contracts@1.42.9
77
+ - @contractspec/lib.schema@1.42.9
78
+
79
+ ## 1.42.8
80
+
81
+ ### Patch Changes
82
+
83
+ - e07b5ac: fix
84
+ - Updated dependencies [e07b5ac]
85
+ - @contractspec/lib.contracts@1.42.8
86
+ - @contractspec/lib.schema@1.42.8
87
+
88
+ ## 1.42.7
89
+
90
+ ### Patch Changes
91
+
92
+ - e9b575d: fix release
93
+ - Updated dependencies [e9b575d]
94
+ - @contractspec/lib.contracts@1.42.7
95
+ - @contractspec/lib.schema@1.42.7
96
+
97
+ ## 1.42.6
98
+
99
+ ### Patch Changes
100
+
101
+ - 1500242: fix tooling
102
+ - Updated dependencies [1500242]
103
+ - @contractspec/lib.contracts@1.42.6
104
+ - @contractspec/lib.schema@1.42.6
105
+
106
+ ## 1.42.5
107
+
108
+ ### Patch Changes
109
+
110
+ - 1299719: fix vscode
111
+ - Updated dependencies [1299719]
112
+ - @contractspec/lib.contracts@1.42.5
113
+ - @contractspec/lib.schema@1.42.5
114
+
115
+ ## 1.42.4
116
+
117
+ ### Patch Changes
118
+
119
+ - ac28b99: fix: generate from openapi
120
+ - Updated dependencies [ac28b99]
121
+ - @contractspec/lib.contracts@1.42.4
122
+ - @contractspec/lib.schema@1.42.4
123
+
124
+ ## 1.42.3
125
+
126
+ ### Patch Changes
127
+
128
+ - 3f5d015: fix(tooling): cicd
129
+ - Updated dependencies [3f5d015]
130
+ - @contractspec/lib.contracts@1.42.3
131
+ - @contractspec/lib.schema@1.42.3
132
+
133
+ ## 1.42.2
134
+
135
+ ### Patch Changes
136
+
137
+ - 1f9ac4c: fix
138
+ - Updated dependencies [1f9ac4c]
139
+ - @contractspec/lib.contracts@1.42.2
140
+ - @contractspec/lib.schema@1.42.2
141
+
142
+ ## 1.42.1
143
+
144
+ ### Patch Changes
145
+
146
+ - f043995: Fix release
147
+ - Updated dependencies [f043995]
148
+ - @contractspec/lib.contracts@1.42.1
149
+ - @contractspec/lib.schema@1.42.1
150
+
151
+ ## 1.42.0
152
+
153
+ ### Minor Changes
154
+
155
+ - 8eefd9c: initial release
156
+
157
+ ### Patch Changes
158
+
159
+ - Updated dependencies [8eefd9c]
160
+ - @contractspec/lib.contracts@1.42.0
161
+ - @contractspec/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 ADDED
@@ -0,0 +1,42 @@
1
+ # `@contractspec/example.locale-jurisdiction-gate`
2
+
3
+ Website: https://contractspec.io/
4
+
5
+
6
+ Spec-first example showing how to **fail-closed** on every assistant call unless:
7
+
8
+ - `locale` is provided and supported
9
+ - `jurisdiction` is provided
10
+ - `kbSnapshotId` is provided
11
+ - `allowedScope` is provided and respected
12
+ - answers include **at least one citation** (or the call is refused)
13
+
14
+ ## What this example demonstrates
15
+
16
+ - **Locale + jurisdiction as explicit inputs** (no guessing)
17
+ - **Structured Answer IR** with citations, disclaimers, and risk flags
18
+ - **Scope enforcement**: blocks scope-violating content under restricted scopes
19
+ - **Traceability**: emits events for requested / blocked / delivered
20
+
21
+ ## Key exports
22
+
23
+ - `contracts`: `assistant.answer`, `assistant.explainConcept`
24
+ - `entities/models`: `LLMCallEnvelope`, `AssistantAnswerIR`, `RegulatoryContext`
25
+ - `policy/guard`: pure gate functions used by handlers and tests
26
+ - `handlers/demo.handlers`: deterministic demo handlers (no LLM)
27
+
28
+ ## Running tests
29
+
30
+ ```bash
31
+ bun test
32
+ ```
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ import "./locale-jurisdiction-gate.docblock.js";
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,53 @@
1
+ import { registerDocBlocks } from "@contractspec/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
19
+ - Forces all assistant behavior to be bound to explicit inputs (no guessing).
20
+ - Requires KB snapshot citations to make answers traceable and regenerable.
21
+
22
+ ## Guardrails
23
+ - Missing locale/jurisdiction/snapshot/scope => refuse (structured).
24
+ - Missing citations => refuse.
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
39
+ - assistant.answer (v1)
40
+ - assistant.explainConcept (v1)
41
+
42
+ ## Models
43
+ - LLMCallEnvelope (locale, regulatoryContext, kbSnapshotId, allowedScope, traceId)
44
+ - AssistantAnswerIR (sections, citations, disclaimers, riskFlags)
45
+
46
+ ## Events
47
+ - assistant.answer.requested
48
+ - assistant.answer.blocked
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 '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/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 };
@@ -0,0 +1,3 @@
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 _contractspec_lib_schema16 from "@contractspec/lib.schema";
2
+
3
+ //#region src/entities/models.d.ts
4
+ declare const AllowedScopeEnum: _contractspec_lib_schema16.EnumType<[string, string, string]>;
5
+ declare const UserProfileModel: _contractspec_lib_schema16.SchemaModel<{
6
+ preferredLocale: {
7
+ type: _contractspec_lib_schema16.FieldType<string, string>;
8
+ isOptional: true;
9
+ };
10
+ residencyCountry: {
11
+ type: _contractspec_lib_schema16.FieldType<string, string>;
12
+ isOptional: true;
13
+ };
14
+ taxResidenceCountry: {
15
+ type: _contractspec_lib_schema16.FieldType<string, string>;
16
+ isOptional: true;
17
+ };
18
+ clientType: {
19
+ type: _contractspec_lib_schema16.FieldType<string, string>;
20
+ isOptional: true;
21
+ };
22
+ }>;
23
+ declare const RegulatoryContextModel: _contractspec_lib_schema16.SchemaModel<{
24
+ jurisdiction: {
25
+ type: _contractspec_lib_schema16.FieldType<string, string>;
26
+ isOptional: false;
27
+ };
28
+ region: {
29
+ type: _contractspec_lib_schema16.FieldType<string, string>;
30
+ isOptional: true;
31
+ };
32
+ clientType: {
33
+ type: _contractspec_lib_schema16.FieldType<string, string>;
34
+ isOptional: true;
35
+ };
36
+ allowedScope: {
37
+ type: _contractspec_lib_schema16.EnumType<[string, string, string]>;
38
+ isOptional: false;
39
+ };
40
+ }>;
41
+ declare const LLMCallEnvelopeModel: _contractspec_lib_schema16.SchemaModel<{
42
+ traceId: {
43
+ type: _contractspec_lib_schema16.FieldType<string, string>;
44
+ isOptional: false;
45
+ };
46
+ locale: {
47
+ type: _contractspec_lib_schema16.FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ regulatoryContext: {
51
+ type: _contractspec_lib_schema16.SchemaModel<{
52
+ jurisdiction: {
53
+ type: _contractspec_lib_schema16.FieldType<string, string>;
54
+ isOptional: false;
55
+ };
56
+ region: {
57
+ type: _contractspec_lib_schema16.FieldType<string, string>;
58
+ isOptional: true;
59
+ };
60
+ clientType: {
61
+ type: _contractspec_lib_schema16.FieldType<string, string>;
62
+ isOptional: true;
63
+ };
64
+ allowedScope: {
65
+ type: _contractspec_lib_schema16.EnumType<[string, string, string]>;
66
+ isOptional: false;
67
+ };
68
+ }>;
69
+ isOptional: false;
70
+ };
71
+ kbSnapshotId: {
72
+ type: _contractspec_lib_schema16.FieldType<string, string>;
73
+ isOptional: false;
74
+ };
75
+ allowedScope: {
76
+ type: _contractspec_lib_schema16.EnumType<[string, string, string]>;
77
+ isOptional: false;
78
+ };
79
+ }>;
80
+ declare const AssistantCitationModel: _contractspec_lib_schema16.SchemaModel<{
81
+ kbSnapshotId: {
82
+ type: _contractspec_lib_schema16.FieldType<string, string>;
83
+ isOptional: false;
84
+ };
85
+ sourceType: {
86
+ type: _contractspec_lib_schema16.FieldType<string, string>;
87
+ isOptional: false;
88
+ };
89
+ sourceId: {
90
+ type: _contractspec_lib_schema16.FieldType<string, string>;
91
+ isOptional: false;
92
+ };
93
+ title: {
94
+ type: _contractspec_lib_schema16.FieldType<string, string>;
95
+ isOptional: true;
96
+ };
97
+ excerpt: {
98
+ type: _contractspec_lib_schema16.FieldType<string, string>;
99
+ isOptional: true;
100
+ };
101
+ }>;
102
+ declare const AssistantAnswerSectionModel: _contractspec_lib_schema16.SchemaModel<{
103
+ heading: {
104
+ type: _contractspec_lib_schema16.FieldType<string, string>;
105
+ isOptional: false;
106
+ };
107
+ body: {
108
+ type: _contractspec_lib_schema16.FieldType<string, string>;
109
+ isOptional: false;
110
+ };
111
+ }>;
112
+ declare const AssistantAnswerIRModel: _contractspec_lib_schema16.SchemaModel<{
113
+ locale: {
114
+ type: _contractspec_lib_schema16.FieldType<string, string>;
115
+ isOptional: false;
116
+ };
117
+ jurisdiction: {
118
+ type: _contractspec_lib_schema16.FieldType<string, string>;
119
+ isOptional: false;
120
+ };
121
+ allowedScope: {
122
+ type: _contractspec_lib_schema16.EnumType<[string, string, string]>;
123
+ isOptional: false;
124
+ };
125
+ sections: {
126
+ type: _contractspec_lib_schema16.SchemaModel<{
127
+ heading: {
128
+ type: _contractspec_lib_schema16.FieldType<string, string>;
129
+ isOptional: false;
130
+ };
131
+ body: {
132
+ type: _contractspec_lib_schema16.FieldType<string, string>;
133
+ isOptional: false;
134
+ };
135
+ }>;
136
+ isArray: true;
137
+ isOptional: false;
138
+ };
139
+ citations: {
140
+ type: _contractspec_lib_schema16.SchemaModel<{
141
+ kbSnapshotId: {
142
+ type: _contractspec_lib_schema16.FieldType<string, string>;
143
+ isOptional: false;
144
+ };
145
+ sourceType: {
146
+ type: _contractspec_lib_schema16.FieldType<string, string>;
147
+ isOptional: false;
148
+ };
149
+ sourceId: {
150
+ type: _contractspec_lib_schema16.FieldType<string, string>;
151
+ isOptional: false;
152
+ };
153
+ title: {
154
+ type: _contractspec_lib_schema16.FieldType<string, string>;
155
+ isOptional: true;
156
+ };
157
+ excerpt: {
158
+ type: _contractspec_lib_schema16.FieldType<string, string>;
159
+ isOptional: true;
160
+ };
161
+ }>;
162
+ isArray: true;
163
+ isOptional: false;
164
+ };
165
+ disclaimers: {
166
+ type: _contractspec_lib_schema16.FieldType<string, string>;
167
+ isArray: true;
168
+ isOptional: true;
169
+ };
170
+ riskFlags: {
171
+ type: _contractspec_lib_schema16.FieldType<string, string>;
172
+ isArray: true;
173
+ isOptional: true;
174
+ };
175
+ refused: {
176
+ type: _contractspec_lib_schema16.FieldType<boolean, boolean>;
177
+ isOptional: true;
178
+ };
179
+ refusalReason: {
180
+ type: _contractspec_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,0BAAA,CAJ2B;cAMhB,6CAAgB;;IANhB,IAAA,EAwBX,0BAAA,CAAA,SApBA,CAAA,MAJ2B,EAAA,MAAA,CAAA;IAMhB,UAAA,EAAA,IAkBX;EAAA,CAAA;;;;;EAlB2B,mBAAA,EAAA;IAoBhB,IAAA,sCASX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;EATiC,CAAA;AAWnC,CAAA,CAAA;AAWE,cAtBW,sBAsBX,6BAtBiC,WAsBjC,CAAA;;UAbA,0BAAA,CAAA;;;;;;;;IAE+B,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAapB,UAAA,EAAA,IAAA;EAWX,CAAA;;;;;;AAXiC,cAbtB,oBAasB,6BAbF,WAaE,CAAA;EAatB,OAAA,EAAA;IAOX,IAAA,EAtBA,0BAAA,CAAA,SAsBA,CAAA,MAAA,EAAA,MAAA,CAAA;;;EAPsC,MAAA,EAAA;IAS3B,IAAA,sCA+BX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;QA/BiC,IAAA,qCAAA,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;;;;;;;;;;;;;;;cAtBtB,mDAAsB;;UAWjC,0BAAA,CAAA;;;;;;;;;;;;;;;;;;;;cAEW,wDAA2B;;UAOtC,0BAAA,CAAA;;;;;;;;cAEW,mDAAsB;;UA+BjC,0BAAA,CAAA"}