@contractspec/example.locale-jurisdiction-gate 1.44.1 → 1.45.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.
- package/.turbo/turbo-build$colon$bundle.log +13 -13
- package/.turbo/turbo-build.log +14 -14
- package/CHANGELOG.md +26 -0
- package/dist/events.js +3 -3
- package/dist/events.js.map +1 -1
- package/dist/example.d.ts +3 -32
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +17 -12
- package/dist/example.js.map +1 -1
- package/dist/locale-jurisdiction-gate.feature.js +7 -7
- package/dist/locale-jurisdiction-gate.feature.js.map +1 -1
- package/dist/operations/assistant.js +2 -2
- package/dist/operations/assistant.js.map +1 -1
- package/package.json +5 -5
- package/src/events.ts +3 -3
- package/src/example.ts +16 -9
- package/src/locale-jurisdiction-gate.feature.ts +7 -7
- package/src/operations/assistant.ts +2 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
$ tsdown
|
|
2
2
|
[34mℹ[39m tsdown [2mv0.18.3[22m powered by rolldown [2mv1.0.0-beta.57[22m
|
|
3
3
|
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/locale-jurisdiction-gate/tsdown.config.js[24m
|
|
4
|
-
[34mℹ[39m entry: [34msrc/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/
|
|
4
|
+
[34mℹ[39m entry: [34msrc/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[39m
|
|
5
5
|
[34mℹ[39m target: [34mesnext[39m
|
|
6
6
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
7
7
|
[34mℹ[39m Build start
|
|
8
8
|
[34mℹ[39m Cleaning 51 files
|
|
9
9
|
[34mℹ[39m [2mdist/[22m[1mentities/models.js[22m [2m3.95 kB[22m [2m│ gzip: 0.83 kB[22m
|
|
10
|
-
[34mℹ[39m [2mdist/[22m[1moperations/assistant.js[22m [2m3.
|
|
11
|
-
[34mℹ[39m [2mdist/[22m[1mevents.js[22m [2m3.
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1moperations/assistant.js[22m [2m3.25 kB[22m [2m│ gzip: 1.07 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mevents.js[22m [2m3.07 kB[22m [2m│ gzip: 0.68 kB[22m
|
|
12
12
|
[34mℹ[39m [2mdist/[22m[1mhandlers/demo.handlers.js[22m [2m2.46 kB[22m [2m│ gzip: 0.90 kB[22m
|
|
13
13
|
[34mℹ[39m [2mdist/[22m[1mpolicy/guard.js[22m [2m1.90 kB[22m [2m│ gzip: 0.76 kB[22m
|
|
14
14
|
[34mℹ[39m [2mdist/[22m[1mdocs/locale-jurisdiction-gate.docblock.js[22m [2m1.64 kB[22m [2m│ gzip: 0.74 kB[22m
|
|
15
15
|
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m1.27 kB[22m [2m│ gzip: 0.40 kB[22m
|
|
16
|
-
[34mℹ[39m [2mdist/[22m[1mlocale-jurisdiction-gate.feature.js[22m [2m1.
|
|
17
|
-
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [
|
|
16
|
+
[34mℹ[39m [2mdist/[22m[1mlocale-jurisdiction-gate.feature.js[22m [2m1.08 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m1.05 kB[22m [2m│ gzip: 0.55 kB[22m
|
|
18
18
|
[34mℹ[39m [2mdist/[22m[1mentities/index.js[22m [2m0.36 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
19
19
|
[34mℹ[39m [2mdist/[22m[1moperations/index.js[22m [2m0.16 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
20
20
|
[34mℹ[39m [2mdist/[22m[1mpolicy/index.js[22m [2m0.15 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
@@ -23,12 +23,12 @@ $ tsdown
|
|
|
23
23
|
[34mℹ[39m [2mdist/[22m[1mpolicy/types.js[22m [2m0.00 kB[22m [2m│ gzip: 0.02 kB[22m
|
|
24
24
|
[34mℹ[39m [2mdist/[22mhandlers/demo.handlers.js.map [2m5.97 kB[22m [2m│ gzip: 1.81 kB[22m
|
|
25
25
|
[34mℹ[39m [2mdist/[22mentities/models.js.map [2m5.85 kB[22m [2m│ gzip: 1.20 kB[22m
|
|
26
|
-
[34mℹ[39m [2mdist/[22moperations/assistant.js.map [2m4.
|
|
27
|
-
[34mℹ[39m [2mdist/[22mevents.js.map [2m4.
|
|
26
|
+
[34mℹ[39m [2mdist/[22moperations/assistant.js.map [2m4.60 kB[22m [2m│ gzip: 1.41 kB[22m
|
|
27
|
+
[34mℹ[39m [2mdist/[22mevents.js.map [2m4.40 kB[22m [2m│ gzip: 0.93 kB[22m
|
|
28
28
|
[34mℹ[39m [2mdist/[22mpolicy/guard.js.map [2m4.12 kB[22m [2m│ gzip: 1.44 kB[22m
|
|
29
29
|
[34mℹ[39m [2mdist/[22mdocs/locale-jurisdiction-gate.docblock.js.map [2m2.16 kB[22m [2m│ gzip: 0.93 kB[22m
|
|
30
|
-
[34mℹ[39m [2mdist/[22mlocale-jurisdiction-gate.feature.js.map [2m1.
|
|
31
|
-
[34mℹ[39m [2mdist/[22mexample.js.map [2m1.
|
|
30
|
+
[34mℹ[39m [2mdist/[22mlocale-jurisdiction-gate.feature.js.map [2m1.73 kB[22m [2m│ gzip: 0.73 kB[22m
|
|
31
|
+
[34mℹ[39m [2mdist/[22mexample.js.map [2m1.61 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
32
32
|
[34mℹ[39m [2mdist/[22mentities/models.d.ts.map [2m0.91 kB[22m [2m│ gzip: 0.39 kB[22m
|
|
33
33
|
[34mℹ[39m [2mdist/[22mpolicy/guard.d.ts.map [2m0.76 kB[22m [2m│ gzip: 0.39 kB[22m
|
|
34
34
|
[34mℹ[39m [2mdist/[22moperations/assistant.d.ts.map [2m0.65 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
@@ -36,21 +36,21 @@ $ tsdown
|
|
|
36
36
|
[34mℹ[39m [2mdist/[22mhandlers/demo.handlers.d.ts.map [2m0.45 kB[22m [2m│ gzip: 0.26 kB[22m
|
|
37
37
|
[34mℹ[39m [2mdist/[22mpolicy/types.d.ts.map [2m0.25 kB[22m [2m│ gzip: 0.19 kB[22m
|
|
38
38
|
[34mℹ[39m [2mdist/[22mlocale-jurisdiction-gate.feature.d.ts.map [2m0.18 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
39
|
-
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.
|
|
39
|
+
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.12 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
40
40
|
[34mℹ[39m [2mdist/[22m[32m[1moperations/assistant.d.ts[22m[39m [2m7.28 kB[22m [2m│ gzip: 0.64 kB[22m
|
|
41
41
|
[34mℹ[39m [2mdist/[22m[32m[1mentities/models.d.ts[22m[39m [2m5.48 kB[22m [2m│ gzip: 0.68 kB[22m
|
|
42
42
|
[34mℹ[39m [2mdist/[22m[32m[1mevents.d.ts[22m[39m [2m2.20 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
43
43
|
[34mℹ[39m [2mdist/[22m[32m[1mhandlers/demo.handlers.d.ts[22m[39m [2m1.48 kB[22m [2m│ gzip: 0.55 kB[22m
|
|
44
44
|
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m1.37 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
45
|
-
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m1.20 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
46
45
|
[34mℹ[39m [2mdist/[22m[32m[1mpolicy/guard.d.ts[22m[39m [2m0.93 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
47
46
|
[34mℹ[39m [2mdist/[22m[32m[1mpolicy/types.d.ts[22m[39m [2m0.46 kB[22m [2m│ gzip: 0.31 kB[22m
|
|
48
47
|
[34mℹ[39m [2mdist/[22m[32m[1mentities/index.d.ts[22m[39m [2m0.36 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
49
48
|
[34mℹ[39m [2mdist/[22m[32m[1mlocale-jurisdiction-gate.feature.d.ts[22m[39m [2m0.30 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
50
49
|
[34mℹ[39m [2mdist/[22m[32m[1mpolicy/index.d.ts[22m[39m [2m0.26 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
50
|
+
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m0.20 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
51
51
|
[34mℹ[39m [2mdist/[22m[32m[1moperations/index.d.ts[22m[39m [2m0.16 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
52
52
|
[34mℹ[39m [2mdist/[22m[32m[1mhandlers/index.d.ts[22m[39m [2m0.15 kB[22m [2m│ gzip: 0.09 kB[22m
|
|
53
53
|
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
54
54
|
[34mℹ[39m [2mdist/[22m[32m[1mdocs/locale-jurisdiction-gate.docblock.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
55
|
-
[34mℹ[39m 46 files, total:
|
|
56
|
-
[32m✔[39m Build complete in [
|
|
55
|
+
[34mℹ[39m 46 files, total: 75.52 kB
|
|
56
|
+
[32m✔[39m Build complete in [32m23631ms[39m
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -8,14 +8,14 @@ $ tsdown
|
|
|
8
8
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
9
|
[34mℹ[39m Build start
|
|
10
10
|
[34mℹ[39m [2mdist/[22m[1mentities/models.js[22m [2m3.95 kB[22m [2m│ gzip: 0.83 kB[22m
|
|
11
|
-
[34mℹ[39m [2mdist/[22m[1moperations/assistant.js[22m [2m3.
|
|
12
|
-
[34mℹ[39m [2mdist/[22m[1mevents.js[22m [2m3.
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1moperations/assistant.js[22m [2m3.25 kB[22m [2m│ gzip: 1.07 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mevents.js[22m [2m3.07 kB[22m [2m│ gzip: 0.68 kB[22m
|
|
13
13
|
[34mℹ[39m [2mdist/[22m[1mhandlers/demo.handlers.js[22m [2m2.46 kB[22m [2m│ gzip: 0.90 kB[22m
|
|
14
14
|
[34mℹ[39m [2mdist/[22m[1mpolicy/guard.js[22m [2m1.90 kB[22m [2m│ gzip: 0.76 kB[22m
|
|
15
15
|
[34mℹ[39m [2mdist/[22m[1mdocs/locale-jurisdiction-gate.docblock.js[22m [2m1.64 kB[22m [2m│ gzip: 0.74 kB[22m
|
|
16
16
|
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m1.27 kB[22m [2m│ gzip: 0.40 kB[22m
|
|
17
|
-
[34mℹ[39m [2mdist/[22m[1mlocale-jurisdiction-gate.feature.js[22m [2m1.
|
|
18
|
-
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [
|
|
17
|
+
[34mℹ[39m [2mdist/[22m[1mlocale-jurisdiction-gate.feature.js[22m [2m1.08 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m1.05 kB[22m [2m│ gzip: 0.55 kB[22m
|
|
19
19
|
[34mℹ[39m [2mdist/[22m[1mentities/index.js[22m [2m0.36 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
20
20
|
[34mℹ[39m [2mdist/[22m[1moperations/index.js[22m [2m0.16 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
21
21
|
[34mℹ[39m [2mdist/[22m[1mpolicy/index.js[22m [2m0.15 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
@@ -24,12 +24,12 @@ $ tsdown
|
|
|
24
24
|
[34mℹ[39m [2mdist/[22m[1mpolicy/types.js[22m [2m0.00 kB[22m [2m│ gzip: 0.02 kB[22m
|
|
25
25
|
[34mℹ[39m [2mdist/[22mhandlers/demo.handlers.js.map [2m5.97 kB[22m [2m│ gzip: 1.81 kB[22m
|
|
26
26
|
[34mℹ[39m [2mdist/[22mentities/models.js.map [2m5.85 kB[22m [2m│ gzip: 1.20 kB[22m
|
|
27
|
-
[34mℹ[39m [2mdist/[22moperations/assistant.js.map [2m4.
|
|
28
|
-
[34mℹ[39m [2mdist/[22mevents.js.map [2m4.
|
|
27
|
+
[34mℹ[39m [2mdist/[22moperations/assistant.js.map [2m4.60 kB[22m [2m│ gzip: 1.41 kB[22m
|
|
28
|
+
[34mℹ[39m [2mdist/[22mevents.js.map [2m4.40 kB[22m [2m│ gzip: 0.93 kB[22m
|
|
29
29
|
[34mℹ[39m [2mdist/[22mpolicy/guard.js.map [2m4.12 kB[22m [2m│ gzip: 1.44 kB[22m
|
|
30
30
|
[34mℹ[39m [2mdist/[22mdocs/locale-jurisdiction-gate.docblock.js.map [2m2.16 kB[22m [2m│ gzip: 0.93 kB[22m
|
|
31
|
-
[34mℹ[39m [2mdist/[22mlocale-jurisdiction-gate.feature.js.map [2m1.
|
|
32
|
-
[34mℹ[39m [2mdist/[22mexample.js.map [2m1.
|
|
31
|
+
[34mℹ[39m [2mdist/[22mlocale-jurisdiction-gate.feature.js.map [2m1.73 kB[22m [2m│ gzip: 0.73 kB[22m
|
|
32
|
+
[34mℹ[39m [2mdist/[22mexample.js.map [2m1.61 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
33
33
|
[34mℹ[39m [2mdist/[22mentities/models.d.ts.map [2m0.91 kB[22m [2m│ gzip: 0.39 kB[22m
|
|
34
34
|
[34mℹ[39m [2mdist/[22mpolicy/guard.d.ts.map [2m0.76 kB[22m [2m│ gzip: 0.39 kB[22m
|
|
35
35
|
[34mℹ[39m [2mdist/[22moperations/assistant.d.ts.map [2m0.65 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
@@ -37,21 +37,21 @@ $ tsdown
|
|
|
37
37
|
[34mℹ[39m [2mdist/[22mhandlers/demo.handlers.d.ts.map [2m0.45 kB[22m [2m│ gzip: 0.26 kB[22m
|
|
38
38
|
[34mℹ[39m [2mdist/[22mpolicy/types.d.ts.map [2m0.25 kB[22m [2m│ gzip: 0.19 kB[22m
|
|
39
39
|
[34mℹ[39m [2mdist/[22mlocale-jurisdiction-gate.feature.d.ts.map [2m0.18 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
40
|
-
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.
|
|
40
|
+
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.12 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
41
41
|
[34mℹ[39m [2mdist/[22m[32m[1moperations/assistant.d.ts[22m[39m [2m7.28 kB[22m [2m│ gzip: 0.64 kB[22m
|
|
42
|
-
[34mℹ[39m [2mdist/[22m[32m[1mentities/models.d.ts[22m[39m [2m5.
|
|
43
|
-
[34mℹ[39m [2mdist/[22m[32m[1mevents.d.ts[22m[39m [2m2.
|
|
42
|
+
[34mℹ[39m [2mdist/[22m[32m[1mentities/models.d.ts[22m[39m [2m5.48 kB[22m [2m│ gzip: 0.68 kB[22m
|
|
43
|
+
[34mℹ[39m [2mdist/[22m[32m[1mevents.d.ts[22m[39m [2m2.20 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
44
44
|
[34mℹ[39m [2mdist/[22m[32m[1mhandlers/demo.handlers.d.ts[22m[39m [2m1.48 kB[22m [2m│ gzip: 0.55 kB[22m
|
|
45
45
|
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m1.37 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
46
|
-
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m1.20 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
47
46
|
[34mℹ[39m [2mdist/[22m[32m[1mpolicy/guard.d.ts[22m[39m [2m0.93 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
48
47
|
[34mℹ[39m [2mdist/[22m[32m[1mpolicy/types.d.ts[22m[39m [2m0.46 kB[22m [2m│ gzip: 0.31 kB[22m
|
|
49
48
|
[34mℹ[39m [2mdist/[22m[32m[1mentities/index.d.ts[22m[39m [2m0.36 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
50
49
|
[34mℹ[39m [2mdist/[22m[32m[1mlocale-jurisdiction-gate.feature.d.ts[22m[39m [2m0.30 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
51
50
|
[34mℹ[39m [2mdist/[22m[32m[1mpolicy/index.d.ts[22m[39m [2m0.26 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
51
|
+
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m0.20 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
52
52
|
[34mℹ[39m [2mdist/[22m[32m[1moperations/index.d.ts[22m[39m [2m0.16 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
53
53
|
[34mℹ[39m [2mdist/[22m[32m[1mhandlers/index.d.ts[22m[39m [2m0.15 kB[22m [2m│ gzip: 0.09 kB[22m
|
|
54
54
|
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
55
55
|
[34mℹ[39m [2mdist/[22m[32m[1mdocs/locale-jurisdiction-gate.docblock.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
56
|
-
[34mℹ[39m 46 files, total: 75.
|
|
57
|
-
[32m✔[39m Build complete in [
|
|
56
|
+
[34mℹ[39m 46 files, total: 75.52 kB
|
|
57
|
+
[32m✔[39m Build complete in [32m24950ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @contractspec/example.locale-jurisdiction-gate
|
|
2
2
|
|
|
3
|
+
## 1.45.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e73ca1d: feat: improve app config and examples contracts
|
|
8
|
+
feat: Contract layers support (features, examples, app-configs)
|
|
9
|
+
|
|
10
|
+
### New CLI Commands
|
|
11
|
+
- `contractspec list layers` - List all contract layers with filtering
|
|
12
|
+
|
|
13
|
+
### Enhanced Commands
|
|
14
|
+
- `contractspec ci` - New `layers` check category validates features/examples/config
|
|
15
|
+
- `contractspec doctor` - New `layers` health checks
|
|
16
|
+
- `contractspec integrity` - Now shows layer statistics
|
|
17
|
+
|
|
18
|
+
### New APIs
|
|
19
|
+
- `discoverLayers()` - Scan workspace for all layer files
|
|
20
|
+
- `scanExampleSource()` - Parse ExampleSpec from source code
|
|
21
|
+
- `isExampleFile()` - Check if file is an example spec
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [e73ca1d]
|
|
26
|
+
- @contractspec/lib.contracts@1.45.0
|
|
27
|
+
- @contractspec/lib.schema@1.45.0
|
|
28
|
+
|
|
3
29
|
## 1.44.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/dist/events.js
CHANGED
|
@@ -31,7 +31,7 @@ const AssistantAnswerRequestedPayload = defineSchemaModel({
|
|
|
31
31
|
const AssistantAnswerRequestedEvent = defineEvent({
|
|
32
32
|
meta: {
|
|
33
33
|
key: "assistant.answer.requested",
|
|
34
|
-
version: 1,
|
|
34
|
+
version: "1.0.0",
|
|
35
35
|
description: "Assistant answer requested (policy gate will run).",
|
|
36
36
|
stability: "experimental",
|
|
37
37
|
owners: ["@examples"],
|
|
@@ -60,7 +60,7 @@ const AssistantAnswerBlockedPayload = defineSchemaModel({
|
|
|
60
60
|
const AssistantAnswerBlockedEvent = defineEvent({
|
|
61
61
|
meta: {
|
|
62
62
|
key: "assistant.answer.blocked",
|
|
63
|
-
version: 1,
|
|
63
|
+
version: "1.0.0",
|
|
64
64
|
description: "Assistant answer blocked (fail-closed).",
|
|
65
65
|
stability: "experimental",
|
|
66
66
|
owners: ["@examples"],
|
|
@@ -105,7 +105,7 @@ const AssistantAnswerDeliveredPayload = defineSchemaModel({
|
|
|
105
105
|
const AssistantAnswerDeliveredEvent = defineEvent({
|
|
106
106
|
meta: {
|
|
107
107
|
key: "assistant.answer.delivered",
|
|
108
|
-
version: 1,
|
|
108
|
+
version: "1.0.0",
|
|
109
109
|
description: "Assistant answer delivered (must include KB snapshot citations).",
|
|
110
110
|
stability: "experimental",
|
|
111
111
|
owners: ["@examples"],
|
package/dist/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","names":[],"sources":["../src/events.ts"],"sourcesContent":["import { defineEvent, defineSchemaModel } from '@contractspec/lib.contracts';\nimport { ScalarTypeEnum } from '@contractspec/lib.schema';\n\nconst AssistantAnswerRequestedPayload = defineSchemaModel({\n name: 'AssistantAnswerRequestedPayload',\n description: 'Emitted when an assistant answer is requested (pre-gate).',\n fields: {\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n locale: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n kbSnapshotId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n allowedScope: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const AssistantAnswerRequestedEvent = defineEvent({\n meta: {\n key: 'assistant.answer.requested',\n version: 1,\n description: 'Assistant answer requested (policy gate will run).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['assistant', 'policy'],\n },\n payload: AssistantAnswerRequestedPayload,\n});\n\nconst AssistantAnswerBlockedPayload = defineSchemaModel({\n name: 'AssistantAnswerBlockedPayload',\n description: 'Emitted when a request is blocked by the gate.',\n fields: {\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n reasonCode: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const AssistantAnswerBlockedEvent = defineEvent({\n meta: {\n key: 'assistant.answer.blocked',\n version: 1,\n description: 'Assistant answer blocked (fail-closed).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['assistant', 'policy', 'blocked'],\n },\n payload: AssistantAnswerBlockedPayload,\n});\n\nconst AssistantAnswerDeliveredPayload = defineSchemaModel({\n name: 'AssistantAnswerDeliveredPayload',\n description: 'Emitted when a structured, cited answer is delivered.',\n fields: {\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n locale: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n kbSnapshotId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n allowedScope: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n citationsCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nexport const AssistantAnswerDeliveredEvent = defineEvent({\n meta: {\n key: 'assistant.answer.delivered',\n version: 1,\n description:\n 'Assistant answer delivered (must include KB snapshot citations).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['assistant', 'policy', 'delivered'],\n },\n payload: AssistantAnswerDeliveredPayload,\n});\n"],"mappings":";;;;AAGA,MAAM,kCAAkC,kBAAkB;CACxD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC5E;CACF,CAAC;AAEF,MAAa,gCAAgC,YAAY;CACvD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,aAAa,SAAS;EAC9B;CACD,SAAS;CACV,CAAC;AAEF,MAAM,gCAAgC,kBAAkB;CACtD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACzE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE;CACF,CAAC;AAEF,MAAa,8BAA8B,YAAY;CACrD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAa;GAAU;GAAU;EACzC;CACD,SAAS;CACV,CAAC;AAEF,MAAM,kCAAkC,kBAAkB;CACxD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,gBAAgB;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EAC3E;CACF,CAAC;AAEF,MAAa,gCAAgC,YAAY;CACvD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aACE;EACF,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAa;GAAU;GAAY;EAC3C;CACD,SAAS;CACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"events.js","names":[],"sources":["../src/events.ts"],"sourcesContent":["import { defineEvent, defineSchemaModel } from '@contractspec/lib.contracts';\nimport { ScalarTypeEnum } from '@contractspec/lib.schema';\n\nconst AssistantAnswerRequestedPayload = defineSchemaModel({\n name: 'AssistantAnswerRequestedPayload',\n description: 'Emitted when an assistant answer is requested (pre-gate).',\n fields: {\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n locale: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n kbSnapshotId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n allowedScope: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const AssistantAnswerRequestedEvent = defineEvent({\n meta: {\n key: 'assistant.answer.requested',\n version: '1.0.0',\n description: 'Assistant answer requested (policy gate will run).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['assistant', 'policy'],\n },\n payload: AssistantAnswerRequestedPayload,\n});\n\nconst AssistantAnswerBlockedPayload = defineSchemaModel({\n name: 'AssistantAnswerBlockedPayload',\n description: 'Emitted when a request is blocked by the gate.',\n fields: {\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n reasonCode: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const AssistantAnswerBlockedEvent = defineEvent({\n meta: {\n key: 'assistant.answer.blocked',\n version: '1.0.0',\n description: 'Assistant answer blocked (fail-closed).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['assistant', 'policy', 'blocked'],\n },\n payload: AssistantAnswerBlockedPayload,\n});\n\nconst AssistantAnswerDeliveredPayload = defineSchemaModel({\n name: 'AssistantAnswerDeliveredPayload',\n description: 'Emitted when a structured, cited answer is delivered.',\n fields: {\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n locale: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n kbSnapshotId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n allowedScope: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n citationsCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nexport const AssistantAnswerDeliveredEvent = defineEvent({\n meta: {\n key: 'assistant.answer.delivered',\n version: '1.0.0',\n description:\n 'Assistant answer delivered (must include KB snapshot citations).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['assistant', 'policy', 'delivered'],\n },\n payload: AssistantAnswerDeliveredPayload,\n});\n"],"mappings":";;;;AAGA,MAAM,kCAAkC,kBAAkB;CACxD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC5E;CACF,CAAC;AAEF,MAAa,gCAAgC,YAAY;CACvD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,aAAa,SAAS;EAC9B;CACD,SAAS;CACV,CAAC;AAEF,MAAM,gCAAgC,kBAAkB;CACtD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACzE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE;CACF,CAAC;AAEF,MAAa,8BAA8B,YAAY;CACrD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAa;GAAU;GAAU;EACzC;CACD,SAAS;CACV,CAAC;AAEF,MAAM,kCAAkC,kBAAkB;CACxD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,gBAAgB;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EAC3E;CACF,CAAC;AAEF,MAAa,gCAAgC,YAAY;CACvD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aACE;EACF,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAa;GAAU;GAAY;EAC3C;CACD,SAAS;CACV,CAAC"}
|
package/dist/example.d.ts
CHANGED
|
@@ -1,36 +1,7 @@
|
|
|
1
|
+
import { ExampleSpec } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
1
3
|
//#region src/example.d.ts
|
|
2
|
-
declare const example:
|
|
3
|
-
readonly id: "locale-jurisdiction-gate";
|
|
4
|
-
readonly title: "Locale / Jurisdiction Gate";
|
|
5
|
-
readonly summary: "Fail-closed gating for assistant calls: locale + jurisdiction + kbSnapshotId + allowedScope must be explicit, answers must cite a snapshot.";
|
|
6
|
-
readonly tags: readonly ["policy", "locale", "jurisdiction", "assistant", "gating"];
|
|
7
|
-
readonly kind: "knowledge";
|
|
8
|
-
readonly visibility: "public";
|
|
9
|
-
readonly docs: {
|
|
10
|
-
readonly rootDocId: "docs.examples.locale-jurisdiction-gate";
|
|
11
|
-
};
|
|
12
|
-
readonly entrypoints: {
|
|
13
|
-
readonly packageName: "@contractspec/example.locale-jurisdiction-gate";
|
|
14
|
-
readonly feature: "./feature";
|
|
15
|
-
readonly contracts: "./contracts";
|
|
16
|
-
readonly handlers: "./handlers";
|
|
17
|
-
readonly docs: "./docs";
|
|
18
|
-
};
|
|
19
|
-
readonly surfaces: {
|
|
20
|
-
readonly templates: true;
|
|
21
|
-
readonly sandbox: {
|
|
22
|
-
readonly enabled: true;
|
|
23
|
-
readonly modes: readonly ["markdown", "specs"];
|
|
24
|
-
};
|
|
25
|
-
readonly studio: {
|
|
26
|
-
readonly enabled: true;
|
|
27
|
-
readonly installable: true;
|
|
28
|
-
};
|
|
29
|
-
readonly mcp: {
|
|
30
|
-
readonly enabled: true;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
};
|
|
4
|
+
declare const example: ExampleSpec;
|
|
34
5
|
//#endregion
|
|
35
6
|
export { example as default };
|
|
36
7
|
//# sourceMappingURL=example.d.ts.map
|
package/dist/example.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";;;cAEM,SAAS"}
|
package/dist/example.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
//#region src/example.ts
|
|
2
2
|
const example = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
meta: {
|
|
4
|
+
key: "locale-jurisdiction-gate",
|
|
5
|
+
version: "1.0.0",
|
|
6
|
+
title: "Locale / Jurisdiction Gate",
|
|
7
|
+
description: "Fail-closed gating for assistant calls: locale + jurisdiction + kbSnapshotId + allowedScope must be explicit, answers must cite a snapshot.",
|
|
8
|
+
kind: "knowledge",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
stability: "experimental",
|
|
11
|
+
owners: ["@platform.core"],
|
|
12
|
+
tags: [
|
|
13
|
+
"policy",
|
|
14
|
+
"locale",
|
|
15
|
+
"jurisdiction",
|
|
16
|
+
"assistant",
|
|
17
|
+
"gating"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
15
20
|
docs: { rootDocId: "docs.examples.locale-jurisdiction-gate" },
|
|
16
21
|
entrypoints: {
|
|
17
22
|
packageName: "@contractspec/example.locale-jurisdiction-gate",
|
package/dist/example.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"example.js","names":["example: ExampleSpec"],"sources":["../src/example.ts"],"sourcesContent":["import type { ExampleSpec } from '@contractspec/lib.contracts';\n\nconst example: ExampleSpec = {\n meta: {\n key: 'locale-jurisdiction-gate',\n version: '1.0.0',\n title: 'Locale / Jurisdiction Gate',\n description:\n 'Fail-closed gating for assistant calls: locale + jurisdiction + kbSnapshotId + allowedScope must be explicit, answers must cite a snapshot.',\n kind: 'knowledge',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@platform.core'],\n tags: ['policy', 'locale', 'jurisdiction', 'assistant', 'gating'],\n },\n docs: {\n rootDocId: 'docs.examples.locale-jurisdiction-gate',\n },\n entrypoints: {\n packageName: '@contractspec/example.locale-jurisdiction-gate',\n feature: './feature',\n contracts: './contracts',\n handlers: './handlers',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['markdown', 'specs'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n};\n\nexport default example;\n"],"mappings":";AAEA,MAAMA,UAAuB;CAC3B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAU;GAAU;GAAgB;GAAa;GAAS;EAClE;CACD,MAAM,EACJ,WAAW,0CACZ;CACD,aAAa;EACX,aAAa;EACb,SAAS;EACT,WAAW;EACX,UAAU;EACV,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO,CAAC,YAAY,QAAQ;GAAE;EACxD,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF;AAED,sBAAe"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const LocaleJurisdictionGateFeature = {
|
|
3
3
|
meta: {
|
|
4
4
|
key: "locale-jurisdiction-gate",
|
|
5
|
-
version: 1,
|
|
5
|
+
version: "1.0.0",
|
|
6
6
|
title: "Locale + Jurisdiction Gate",
|
|
7
7
|
description: "Fail-closed gating for assistant calls requiring locale/jurisdiction/snapshot/scope and citations.",
|
|
8
8
|
domain: "knowledge",
|
|
@@ -18,23 +18,23 @@ const LocaleJurisdictionGateFeature = {
|
|
|
18
18
|
},
|
|
19
19
|
operations: [{
|
|
20
20
|
key: "assistant.answer",
|
|
21
|
-
version: 1
|
|
21
|
+
version: "1.0.0"
|
|
22
22
|
}, {
|
|
23
23
|
key: "assistant.explainConcept",
|
|
24
|
-
version: 1
|
|
24
|
+
version: "1.0.0"
|
|
25
25
|
}],
|
|
26
26
|
events: [
|
|
27
27
|
{
|
|
28
28
|
key: "assistant.answer.requested",
|
|
29
|
-
version: 1
|
|
29
|
+
version: "1.0.0"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
key: "assistant.answer.blocked",
|
|
33
|
-
version: 1
|
|
33
|
+
version: "1.0.0"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
key: "assistant.answer.delivered",
|
|
37
|
-
version: 1
|
|
37
|
+
version: "1.0.0"
|
|
38
38
|
}
|
|
39
39
|
],
|
|
40
40
|
presentations: [],
|
|
@@ -42,7 +42,7 @@ const LocaleJurisdictionGateFeature = {
|
|
|
42
42
|
presentationsTargets: [],
|
|
43
43
|
capabilities: { requires: [{
|
|
44
44
|
key: "knowledge",
|
|
45
|
-
version: 1
|
|
45
|
+
version: "1.0.0"
|
|
46
46
|
}] }
|
|
47
47
|
};
|
|
48
48
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale-jurisdiction-gate.feature.js","names":["LocaleJurisdictionGateFeature: FeatureModuleSpec"],"sources":["../src/locale-jurisdiction-gate.feature.ts"],"sourcesContent":["import type { FeatureModuleSpec } from '@contractspec/lib.contracts';\n\nexport const LocaleJurisdictionGateFeature: FeatureModuleSpec = {\n meta: {\n key: 'locale-jurisdiction-gate',\n version: 1,\n title: 'Locale + Jurisdiction Gate',\n description:\n 'Fail-closed gating for assistant calls requiring locale/jurisdiction/snapshot/scope and citations.',\n domain: 'knowledge',\n owners: ['@examples'],\n tags: ['assistant', 'policy', 'locale', 'jurisdiction', 'knowledge'],\n stability: 'experimental',\n },\n operations: [\n { key: 'assistant.answer', version: 1 },\n { key: 'assistant.explainConcept', version: 1 },\n ],\n events: [\n { key: 'assistant.answer.requested', version: 1 },\n { key: 'assistant.answer.blocked', version: 1 },\n { key: 'assistant.answer.delivered', version: 1 },\n ],\n presentations: [],\n opToPresentation: [],\n presentationsTargets: [],\n capabilities: {\n requires: [{ key: 'knowledge', version: 1 }],\n },\n};\n"],"mappings":";AAEA,MAAaA,gCAAmD;CAC9D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAa;GAAU;GAAU;GAAgB;GAAY;EACpE,WAAW;EACZ;CACD,YAAY,CACV;EAAE,KAAK;EAAoB,SAAS;
|
|
1
|
+
{"version":3,"file":"locale-jurisdiction-gate.feature.js","names":["LocaleJurisdictionGateFeature: FeatureModuleSpec"],"sources":["../src/locale-jurisdiction-gate.feature.ts"],"sourcesContent":["import type { FeatureModuleSpec } from '@contractspec/lib.contracts';\n\nexport const LocaleJurisdictionGateFeature: FeatureModuleSpec = {\n meta: {\n key: 'locale-jurisdiction-gate',\n version: '1.0.0',\n title: 'Locale + Jurisdiction Gate',\n description:\n 'Fail-closed gating for assistant calls requiring locale/jurisdiction/snapshot/scope and citations.',\n domain: 'knowledge',\n owners: ['@examples'],\n tags: ['assistant', 'policy', 'locale', 'jurisdiction', 'knowledge'],\n stability: 'experimental',\n },\n operations: [\n { key: 'assistant.answer', version: '1.0.0' },\n { key: 'assistant.explainConcept', version: '1.0.0' },\n ],\n events: [\n { key: 'assistant.answer.requested', version: '1.0.0' },\n { key: 'assistant.answer.blocked', version: '1.0.0' },\n { key: 'assistant.answer.delivered', version: '1.0.0' },\n ],\n presentations: [],\n opToPresentation: [],\n presentationsTargets: [],\n capabilities: {\n requires: [{ key: 'knowledge', version: '1.0.0' }],\n },\n};\n"],"mappings":";AAEA,MAAaA,gCAAmD;CAC9D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAa;GAAU;GAAU;GAAgB;GAAY;EACpE,WAAW;EACZ;CACD,YAAY,CACV;EAAE,KAAK;EAAoB,SAAS;EAAS,EAC7C;EAAE,KAAK;EAA4B,SAAS;EAAS,CACtD;CACD,QAAQ;EACN;GAAE,KAAK;GAA8B,SAAS;GAAS;EACvD;GAAE,KAAK;GAA4B,SAAS;GAAS;EACrD;GAAE,KAAK;GAA8B,SAAS;GAAS;EACxD;CACD,eAAe,EAAE;CACjB,kBAAkB,EAAE;CACpB,sBAAsB,EAAE;CACxB,cAAc,EACZ,UAAU,CAAC;EAAE,KAAK;EAAa,SAAS;EAAS,CAAC,EACnD;CACF"}
|
|
@@ -34,7 +34,7 @@ const AssistantConceptInput = defineSchemaModel$1({
|
|
|
34
34
|
const AssistantAnswerContract = defineCommand({
|
|
35
35
|
meta: {
|
|
36
36
|
key: "assistant.answer",
|
|
37
|
-
version: 1,
|
|
37
|
+
version: "1.0.0",
|
|
38
38
|
stability: "experimental",
|
|
39
39
|
owners: ["@examples"],
|
|
40
40
|
tags: [
|
|
@@ -89,7 +89,7 @@ const AssistantAnswerContract = defineCommand({
|
|
|
89
89
|
const AssistantExplainConceptContract = defineCommand({
|
|
90
90
|
meta: {
|
|
91
91
|
key: "assistant.explainConcept",
|
|
92
|
-
version: 1,
|
|
92
|
+
version: "1.0.0",
|
|
93
93
|
stability: "experimental",
|
|
94
94
|
owners: ["@examples"],
|
|
95
95
|
tags: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant.js","names":["defineSchemaModel"],"sources":["../../src/operations/assistant.ts"],"sourcesContent":["import { defineCommand } from '@contractspec/lib.contracts';\nimport { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\n\nimport {\n AssistantAnswerIRModel,\n LLMCallEnvelopeModel,\n} from '../entities/models';\n\nconst AssistantQuestionInput = defineSchemaModel({\n name: 'AssistantQuestionInput',\n description: 'Input for assistant calls with mandatory envelope.',\n fields: {\n envelope: { type: LLMCallEnvelopeModel, isOptional: false },\n question: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst AssistantConceptInput = defineSchemaModel({\n name: 'AssistantConceptInput',\n description: 'Input for explaining a concept with mandatory envelope.',\n fields: {\n envelope: { type: LLMCallEnvelopeModel, isOptional: false },\n conceptKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const AssistantAnswerContract = defineCommand({\n meta: {\n key: 'assistant.answer',\n version: 1,\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['assistant', 'policy', 'locale', 'jurisdiction', 'knowledge'],\n description:\n 'Answer a user question using a KB snapshot with strict locale/jurisdiction gating.',\n goal: 'Provide policy-safe answers that cite a KB snapshot or refuse.',\n context:\n 'Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing.',\n },\n io: {\n input: AssistantQuestionInput,\n output: AssistantAnswerIRModel,\n errors: {\n LOCALE_REQUIRED: {\n description: 'Locale is required and must be supported',\n http: 400,\n gqlCode: 'LOCALE_REQUIRED',\n when: 'locale is missing or unsupported',\n },\n JURISDICTION_REQUIRED: {\n description: 'Jurisdiction is required',\n http: 400,\n gqlCode: 'JURISDICTION_REQUIRED',\n when: 'jurisdiction is missing',\n },\n KB_SNAPSHOT_REQUIRED: {\n description: 'KB snapshot id is required',\n http: 400,\n gqlCode: 'KB_SNAPSHOT_REQUIRED',\n when: 'kbSnapshotId is missing',\n },\n CITATIONS_REQUIRED: {\n description: 'Answers must include citations to a KB snapshot',\n http: 422,\n gqlCode: 'CITATIONS_REQUIRED',\n when: 'answer has no citations',\n },\n SCOPE_VIOLATION: {\n description:\n 'Answer violates allowed scope and must be refused/escalated',\n http: 403,\n gqlCode: 'SCOPE_VIOLATION',\n when: 'output includes forbidden content under the given allowedScope',\n },\n },\n },\n policy: { auth: 'user' },\n});\n\nexport const AssistantExplainConceptContract = defineCommand({\n meta: {\n key: 'assistant.explainConcept',\n version: 1,\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['assistant', 'policy', 'knowledge', 'concepts'],\n description:\n 'Explain a concept using a KB snapshot with strict locale/jurisdiction gating.',\n goal: 'Explain concepts with citations or refuse.',\n context: 'Same constraints as assistant.answer.',\n },\n io: {\n input: AssistantConceptInput,\n output: AssistantAnswerIRModel,\n errors: AssistantAnswerContract.io.errors,\n },\n policy: { auth: 'user' },\n});\n"],"mappings":";;;;;AAQA,MAAM,yBAAyBA,oBAAkB;CAC/C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM;GAAsB,YAAY;GAAO;EAC3D,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE;CACF,CAAC;AAEF,MAAM,wBAAwBA,oBAAkB;CAC9C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM;GAAsB,YAAY;GAAO;EAC3D,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E;CACF,CAAC;AAEF,MAAa,0BAA0B,cAAc;CACnD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAa;GAAU;GAAU;GAAgB;GAAY;EACpE,aACE;EACF,MAAM;EACN,SACE;EACH;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACR,QAAQ;GACN,iBAAiB;IACf,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,uBAAuB;IACrB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,sBAAsB;IACpB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,oBAAoB;IAClB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,iBAAiB;IACf,aACE;IACF,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACF;EACF;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC;AAEF,MAAa,kCAAkC,cAAc;CAC3D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAa;GAAU;GAAa;GAAW;EACtD,aACE;EACF,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACR,QAAQ,wBAAwB,GAAG;EACpC;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC"}
|
|
1
|
+
{"version":3,"file":"assistant.js","names":["defineSchemaModel"],"sources":["../../src/operations/assistant.ts"],"sourcesContent":["import { defineCommand } from '@contractspec/lib.contracts';\nimport { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\n\nimport {\n AssistantAnswerIRModel,\n LLMCallEnvelopeModel,\n} from '../entities/models';\n\nconst AssistantQuestionInput = defineSchemaModel({\n name: 'AssistantQuestionInput',\n description: 'Input for assistant calls with mandatory envelope.',\n fields: {\n envelope: { type: LLMCallEnvelopeModel, isOptional: false },\n question: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst AssistantConceptInput = defineSchemaModel({\n name: 'AssistantConceptInput',\n description: 'Input for explaining a concept with mandatory envelope.',\n fields: {\n envelope: { type: LLMCallEnvelopeModel, isOptional: false },\n conceptKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const AssistantAnswerContract = defineCommand({\n meta: {\n key: 'assistant.answer',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['assistant', 'policy', 'locale', 'jurisdiction', 'knowledge'],\n description:\n 'Answer a user question using a KB snapshot with strict locale/jurisdiction gating.',\n goal: 'Provide policy-safe answers that cite a KB snapshot or refuse.',\n context:\n 'Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing.',\n },\n io: {\n input: AssistantQuestionInput,\n output: AssistantAnswerIRModel,\n errors: {\n LOCALE_REQUIRED: {\n description: 'Locale is required and must be supported',\n http: 400,\n gqlCode: 'LOCALE_REQUIRED',\n when: 'locale is missing or unsupported',\n },\n JURISDICTION_REQUIRED: {\n description: 'Jurisdiction is required',\n http: 400,\n gqlCode: 'JURISDICTION_REQUIRED',\n when: 'jurisdiction is missing',\n },\n KB_SNAPSHOT_REQUIRED: {\n description: 'KB snapshot id is required',\n http: 400,\n gqlCode: 'KB_SNAPSHOT_REQUIRED',\n when: 'kbSnapshotId is missing',\n },\n CITATIONS_REQUIRED: {\n description: 'Answers must include citations to a KB snapshot',\n http: 422,\n gqlCode: 'CITATIONS_REQUIRED',\n when: 'answer has no citations',\n },\n SCOPE_VIOLATION: {\n description:\n 'Answer violates allowed scope and must be refused/escalated',\n http: 403,\n gqlCode: 'SCOPE_VIOLATION',\n when: 'output includes forbidden content under the given allowedScope',\n },\n },\n },\n policy: { auth: 'user' },\n});\n\nexport const AssistantExplainConceptContract = defineCommand({\n meta: {\n key: 'assistant.explainConcept',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['assistant', 'policy', 'knowledge', 'concepts'],\n description:\n 'Explain a concept using a KB snapshot with strict locale/jurisdiction gating.',\n goal: 'Explain concepts with citations or refuse.',\n context: 'Same constraints as assistant.answer.',\n },\n io: {\n input: AssistantConceptInput,\n output: AssistantAnswerIRModel,\n errors: AssistantAnswerContract.io.errors,\n },\n policy: { auth: 'user' },\n});\n"],"mappings":";;;;;AAQA,MAAM,yBAAyBA,oBAAkB;CAC/C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM;GAAsB,YAAY;GAAO;EAC3D,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE;CACF,CAAC;AAEF,MAAM,wBAAwBA,oBAAkB;CAC9C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM;GAAsB,YAAY;GAAO;EAC3D,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E;CACF,CAAC;AAEF,MAAa,0BAA0B,cAAc;CACnD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAa;GAAU;GAAU;GAAgB;GAAY;EACpE,aACE;EACF,MAAM;EACN,SACE;EACH;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACR,QAAQ;GACN,iBAAiB;IACf,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,uBAAuB;IACrB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,sBAAsB;IACpB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,oBAAoB;IAClB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,iBAAiB;IACf,aACE;IACF,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACF;EACF;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC;AAEF,MAAa,kCAAkC,cAAc;CAC3D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAa;GAAU;GAAa;GAAW;EACtD,aACE;EACF,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACR,QAAQ,wBAAwB,GAAG;EACpC;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.locale-jurisdiction-gate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.0",
|
|
4
4
|
"description": "Example: enforce locale + jurisdiction + kbSnapshotId + allowed scope for assistant calls (fail-closed).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"test": "bun test"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@contractspec/lib.contracts": "1.
|
|
42
|
-
"@contractspec/lib.schema": "1.
|
|
41
|
+
"@contractspec/lib.contracts": "1.45.0",
|
|
42
|
+
"@contractspec/lib.schema": "1.45.0",
|
|
43
43
|
"zod": "^4.1.13"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@contractspec/tool.tsdown": "1.
|
|
47
|
-
"@contractspec/tool.typescript": "1.
|
|
46
|
+
"@contractspec/tool.tsdown": "1.45.0",
|
|
47
|
+
"@contractspec/tool.typescript": "1.45.0",
|
|
48
48
|
"tsdown": "^0.18.3",
|
|
49
49
|
"typescript": "^5.9.3"
|
|
50
50
|
},
|
package/src/events.ts
CHANGED
|
@@ -16,7 +16,7 @@ const AssistantAnswerRequestedPayload = defineSchemaModel({
|
|
|
16
16
|
export const AssistantAnswerRequestedEvent = defineEvent({
|
|
17
17
|
meta: {
|
|
18
18
|
key: 'assistant.answer.requested',
|
|
19
|
-
version: 1,
|
|
19
|
+
version: '1.0.0',
|
|
20
20
|
description: 'Assistant answer requested (policy gate will run).',
|
|
21
21
|
stability: 'experimental',
|
|
22
22
|
owners: ['@examples'],
|
|
@@ -38,7 +38,7 @@ const AssistantAnswerBlockedPayload = defineSchemaModel({
|
|
|
38
38
|
export const AssistantAnswerBlockedEvent = defineEvent({
|
|
39
39
|
meta: {
|
|
40
40
|
key: 'assistant.answer.blocked',
|
|
41
|
-
version: 1,
|
|
41
|
+
version: '1.0.0',
|
|
42
42
|
description: 'Assistant answer blocked (fail-closed).',
|
|
43
43
|
stability: 'experimental',
|
|
44
44
|
owners: ['@examples'],
|
|
@@ -63,7 +63,7 @@ const AssistantAnswerDeliveredPayload = defineSchemaModel({
|
|
|
63
63
|
export const AssistantAnswerDeliveredEvent = defineEvent({
|
|
64
64
|
meta: {
|
|
65
65
|
key: 'assistant.answer.delivered',
|
|
66
|
-
version: 1,
|
|
66
|
+
version: '1.0.0',
|
|
67
67
|
description:
|
|
68
68
|
'Assistant answer delivered (must include KB snapshot citations).',
|
|
69
69
|
stability: 'experimental',
|
package/src/example.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { ExampleSpec } from '@contractspec/lib.contracts';
|
|
2
|
+
|
|
3
|
+
const example: ExampleSpec = {
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'locale-jurisdiction-gate',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'Locale / Jurisdiction Gate',
|
|
8
|
+
description:
|
|
9
|
+
'Fail-closed gating for assistant calls: locale + jurisdiction + kbSnapshotId + allowedScope must be explicit, answers must cite a snapshot.',
|
|
10
|
+
kind: 'knowledge',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
stability: 'experimental',
|
|
13
|
+
owners: ['@platform.core'],
|
|
14
|
+
tags: ['policy', 'locale', 'jurisdiction', 'assistant', 'gating'],
|
|
15
|
+
},
|
|
9
16
|
docs: {
|
|
10
17
|
rootDocId: 'docs.examples.locale-jurisdiction-gate',
|
|
11
18
|
},
|
|
@@ -22,6 +29,6 @@ const example = {
|
|
|
22
29
|
studio: { enabled: true, installable: true },
|
|
23
30
|
mcp: { enabled: true },
|
|
24
31
|
},
|
|
25
|
-
}
|
|
32
|
+
};
|
|
26
33
|
|
|
27
34
|
export default example;
|
|
@@ -3,7 +3,7 @@ import type { FeatureModuleSpec } from '@contractspec/lib.contracts';
|
|
|
3
3
|
export const LocaleJurisdictionGateFeature: FeatureModuleSpec = {
|
|
4
4
|
meta: {
|
|
5
5
|
key: 'locale-jurisdiction-gate',
|
|
6
|
-
version: 1,
|
|
6
|
+
version: '1.0.0',
|
|
7
7
|
title: 'Locale + Jurisdiction Gate',
|
|
8
8
|
description:
|
|
9
9
|
'Fail-closed gating for assistant calls requiring locale/jurisdiction/snapshot/scope and citations.',
|
|
@@ -13,18 +13,18 @@ export const LocaleJurisdictionGateFeature: FeatureModuleSpec = {
|
|
|
13
13
|
stability: 'experimental',
|
|
14
14
|
},
|
|
15
15
|
operations: [
|
|
16
|
-
{ key: 'assistant.answer', version: 1 },
|
|
17
|
-
{ key: 'assistant.explainConcept', version: 1 },
|
|
16
|
+
{ key: 'assistant.answer', version: '1.0.0' },
|
|
17
|
+
{ key: 'assistant.explainConcept', version: '1.0.0' },
|
|
18
18
|
],
|
|
19
19
|
events: [
|
|
20
|
-
{ key: 'assistant.answer.requested', version: 1 },
|
|
21
|
-
{ key: 'assistant.answer.blocked', version: 1 },
|
|
22
|
-
{ key: 'assistant.answer.delivered', version: 1 },
|
|
20
|
+
{ key: 'assistant.answer.requested', version: '1.0.0' },
|
|
21
|
+
{ key: 'assistant.answer.blocked', version: '1.0.0' },
|
|
22
|
+
{ key: 'assistant.answer.delivered', version: '1.0.0' },
|
|
23
23
|
],
|
|
24
24
|
presentations: [],
|
|
25
25
|
opToPresentation: [],
|
|
26
26
|
presentationsTargets: [],
|
|
27
27
|
capabilities: {
|
|
28
|
-
requires: [{ key: 'knowledge', version: 1 }],
|
|
28
|
+
requires: [{ key: 'knowledge', version: '1.0.0' }],
|
|
29
29
|
},
|
|
30
30
|
};
|
|
@@ -27,7 +27,7 @@ const AssistantConceptInput = defineSchemaModel({
|
|
|
27
27
|
export const AssistantAnswerContract = defineCommand({
|
|
28
28
|
meta: {
|
|
29
29
|
key: 'assistant.answer',
|
|
30
|
-
version: 1,
|
|
30
|
+
version: '1.0.0',
|
|
31
31
|
stability: 'experimental',
|
|
32
32
|
owners: ['@examples'],
|
|
33
33
|
tags: ['assistant', 'policy', 'locale', 'jurisdiction', 'knowledge'],
|
|
@@ -80,7 +80,7 @@ export const AssistantAnswerContract = defineCommand({
|
|
|
80
80
|
export const AssistantExplainConceptContract = defineCommand({
|
|
81
81
|
meta: {
|
|
82
82
|
key: 'assistant.explainConcept',
|
|
83
|
-
version: 1,
|
|
83
|
+
version: '1.0.0',
|
|
84
84
|
stability: 'experimental',
|
|
85
85
|
owners: ['@examples'],
|
|
86
86
|
tags: ['assistant', 'policy', 'knowledge', 'concepts'],
|