@contractspec/example.locale-jurisdiction-gate 3.7.6 → 3.7.10

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 (83) hide show
  1. package/.turbo/turbo-build.log +72 -51
  2. package/AGENTS.md +50 -27
  3. package/CHANGELOG.md +21 -0
  4. package/README.md +87 -42
  5. package/dist/browser/entities/index.js +2 -2
  6. package/dist/browser/entities/models.js +2 -2
  7. package/dist/browser/events.js +1 -1
  8. package/dist/browser/forms/assistant-context.form.js +213 -0
  9. package/dist/browser/forms/index.js +213 -0
  10. package/dist/browser/index.js +362 -40
  11. package/dist/browser/locale-jurisdiction-gate.feature.js +66 -1
  12. package/dist/browser/operations/assistant.js +3 -3
  13. package/dist/browser/operations/index.js +3 -3
  14. package/dist/browser/policy/assistant-gate.policy.js +62 -0
  15. package/dist/browser/policy/index.js +62 -1
  16. package/dist/browser/translations/assistant-gate.en-GB.translation.js +48 -0
  17. package/dist/browser/translations/assistant-gate.en-US.translation.js +50 -0
  18. package/dist/browser/translations/assistant-gate.fr-FR.translation.js +52 -0
  19. package/dist/browser/translations/index.js +148 -0
  20. package/dist/contracts.test.d.ts +1 -0
  21. package/dist/entities/index.js +2 -2
  22. package/dist/entities/models.js +2 -2
  23. package/dist/events.js +1 -1
  24. package/dist/forms/assistant-context.form.d.ts +22 -0
  25. package/dist/forms/assistant-context.form.js +214 -0
  26. package/dist/forms/index.d.ts +1 -0
  27. package/dist/forms/index.js +214 -0
  28. package/dist/index.d.ts +5 -3
  29. package/dist/index.js +362 -40
  30. package/dist/locale-jurisdiction-gate.feature.js +66 -1
  31. package/dist/node/entities/index.js +2 -2
  32. package/dist/node/entities/models.js +2 -2
  33. package/dist/node/events.js +1 -1
  34. package/dist/node/forms/assistant-context.form.js +213 -0
  35. package/dist/node/forms/index.js +213 -0
  36. package/dist/node/index.js +362 -40
  37. package/dist/node/locale-jurisdiction-gate.feature.js +66 -1
  38. package/dist/node/operations/assistant.js +3 -3
  39. package/dist/node/operations/index.js +3 -3
  40. package/dist/node/policy/assistant-gate.policy.js +62 -0
  41. package/dist/node/policy/index.js +62 -1
  42. package/dist/node/translations/assistant-gate.en-GB.translation.js +48 -0
  43. package/dist/node/translations/assistant-gate.en-US.translation.js +50 -0
  44. package/dist/node/translations/assistant-gate.fr-FR.translation.js +52 -0
  45. package/dist/node/translations/index.js +148 -0
  46. package/dist/operations/assistant.js +3 -3
  47. package/dist/operations/index.js +3 -3
  48. package/dist/policy/assistant-gate.policy.d.ts +1 -0
  49. package/dist/policy/assistant-gate.policy.js +63 -0
  50. package/dist/policy/index.d.ts +2 -1
  51. package/dist/policy/index.js +62 -1
  52. package/dist/translations/assistant-gate.en-GB.translation.d.ts +1 -0
  53. package/dist/translations/assistant-gate.en-GB.translation.js +49 -0
  54. package/dist/translations/assistant-gate.en-US.translation.d.ts +1 -0
  55. package/dist/translations/assistant-gate.en-US.translation.js +51 -0
  56. package/dist/translations/assistant-gate.fr-FR.translation.d.ts +1 -0
  57. package/dist/translations/assistant-gate.fr-FR.translation.js +53 -0
  58. package/dist/translations/index.d.ts +3 -0
  59. package/dist/translations/index.js +149 -0
  60. package/package.json +105 -7
  61. package/src/contracts.test.ts +32 -0
  62. package/src/docs/locale-jurisdiction-gate.docblock.ts +21 -21
  63. package/src/entities/models.ts +87 -87
  64. package/src/events.ts +55 -55
  65. package/src/example.ts +28 -28
  66. package/src/forms/assistant-context.form.ts +112 -0
  67. package/src/forms/index.ts +1 -0
  68. package/src/handlers/demo.handlers.test.ts +46 -46
  69. package/src/handlers/demo.handlers.ts +133 -133
  70. package/src/index.ts +5 -3
  71. package/src/locale-jurisdiction-gate.feature.ts +40 -34
  72. package/src/operations/assistant.ts +82 -82
  73. package/src/policy/assistant-gate.policy.ts +65 -0
  74. package/src/policy/guard.test.ts +18 -18
  75. package/src/policy/guard.ts +75 -75
  76. package/src/policy/index.ts +2 -1
  77. package/src/policy/types.ts +12 -12
  78. package/src/translations/assistant-gate.en-GB.translation.ts +46 -0
  79. package/src/translations/assistant-gate.en-US.translation.ts +48 -0
  80. package/src/translations/assistant-gate.fr-FR.translation.ts +51 -0
  81. package/src/translations/index.ts +3 -0
  82. package/tsconfig.json +7 -15
  83. package/tsdown.config.js +7 -13
@@ -1,3 +1,63 @@
1
+ // src/policy/assistant-gate.policy.ts
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum,
5
+ TagsEnum
6
+ } from "@contractspec/lib.contracts-spec/ownership";
7
+ import { definePolicy } from "@contractspec/lib.contracts-spec/policy";
8
+ var AssistantGatePolicy = definePolicy({
9
+ meta: {
10
+ key: "locale-jurisdiction-gate.policy.gate",
11
+ version: "1.0.0",
12
+ title: "Assistant Locale and Jurisdiction Gate",
13
+ description: "Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",
14
+ domain: "assistant",
15
+ scope: "operation",
16
+ owners: [OwnersEnum.PlatformFinance],
17
+ tags: [TagsEnum.I18n, "assistant", "policy", "jurisdiction"],
18
+ stability: StabilityEnum.Experimental
19
+ },
20
+ rules: [
21
+ {
22
+ effect: "deny",
23
+ actions: ["assistant.answer", "assistant.explainConcept"],
24
+ resource: { type: "assistant-call" },
25
+ conditions: [
26
+ {
27
+ expression: "!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"
28
+ }
29
+ ],
30
+ reason: "Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."
31
+ },
32
+ {
33
+ effect: "deny",
34
+ actions: ["assistant.answer", "assistant.explainConcept"],
35
+ resource: { type: "assistant-call" },
36
+ conditions: [
37
+ {
38
+ expression: "!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"
39
+ }
40
+ ],
41
+ reason: "Only the explicitly reviewed assistant locales are permitted."
42
+ },
43
+ {
44
+ effect: "allow",
45
+ actions: ["assistant.answer", "assistant.explainConcept"],
46
+ resource: { type: "assistant-call" },
47
+ conditions: [
48
+ {
49
+ expression: "['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"
50
+ }
51
+ ],
52
+ reason: "Explicit context is present, so the request may continue to citation and scope validation."
53
+ }
54
+ ],
55
+ pii: {
56
+ fields: ["kbSnapshotId"],
57
+ retentionDays: 30
58
+ }
59
+ });
60
+
1
61
  // src/locale-jurisdiction-gate.feature.ts
2
62
  import { defineFeature } from "@contractspec/lib.contracts-spec";
3
63
  var LocaleJurisdictionGateFeature = defineFeature({
@@ -26,7 +86,12 @@ var LocaleJurisdictionGateFeature = defineFeature({
26
86
  capabilities: {
27
87
  requires: [{ key: "knowledge", version: "1.0.0" }]
28
88
  },
29
- policies: [{ key: "locale-jurisdiction-gate.policy.gate", version: "1.0.0" }],
89
+ policies: [
90
+ {
91
+ key: AssistantGatePolicy.meta.key,
92
+ version: AssistantGatePolicy.meta.version
93
+ }
94
+ ],
30
95
  knowledge: [
31
96
  { key: "locale-jurisdiction-gate.knowledge.rules", version: "1.0.0" }
32
97
  ],
@@ -1,8 +1,8 @@
1
1
  // src/entities/models.ts
2
2
  import {
3
- ScalarTypeEnum,
4
3
  defineEnum,
5
- defineSchemaModel
4
+ defineSchemaModel,
5
+ ScalarTypeEnum
6
6
  } from "@contractspec/lib.schema";
7
7
  var AllowedScopeEnum = defineEnum("AllowedScope", [
8
8
  "education_only",
@@ -102,7 +102,7 @@ var AssistantAnswerIRModel = defineSchemaModel({
102
102
 
103
103
  // src/operations/assistant.ts
104
104
  import { defineCommand } from "@contractspec/lib.contracts-spec";
105
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
105
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
106
106
  var AssistantQuestionInput = defineSchemaModel2({
107
107
  name: "AssistantQuestionInput",
108
108
  description: "Input for assistant calls with mandatory envelope.",
@@ -1,8 +1,8 @@
1
1
  // src/entities/models.ts
2
2
  import {
3
- ScalarTypeEnum,
4
3
  defineEnum,
5
- defineSchemaModel
4
+ defineSchemaModel,
5
+ ScalarTypeEnum
6
6
  } from "@contractspec/lib.schema";
7
7
  var AllowedScopeEnum = defineEnum("AllowedScope", [
8
8
  "education_only",
@@ -102,7 +102,7 @@ var AssistantAnswerIRModel = defineSchemaModel({
102
102
 
103
103
  // src/operations/assistant.ts
104
104
  import { defineCommand } from "@contractspec/lib.contracts-spec";
105
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
105
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
106
106
  var AssistantQuestionInput = defineSchemaModel2({
107
107
  name: "AssistantQuestionInput",
108
108
  description: "Input for assistant calls with mandatory envelope.",
@@ -0,0 +1,62 @@
1
+ // src/policy/assistant-gate.policy.ts
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum,
5
+ TagsEnum
6
+ } from "@contractspec/lib.contracts-spec/ownership";
7
+ import { definePolicy } from "@contractspec/lib.contracts-spec/policy";
8
+ var AssistantGatePolicy = definePolicy({
9
+ meta: {
10
+ key: "locale-jurisdiction-gate.policy.gate",
11
+ version: "1.0.0",
12
+ title: "Assistant Locale and Jurisdiction Gate",
13
+ description: "Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",
14
+ domain: "assistant",
15
+ scope: "operation",
16
+ owners: [OwnersEnum.PlatformFinance],
17
+ tags: [TagsEnum.I18n, "assistant", "policy", "jurisdiction"],
18
+ stability: StabilityEnum.Experimental
19
+ },
20
+ rules: [
21
+ {
22
+ effect: "deny",
23
+ actions: ["assistant.answer", "assistant.explainConcept"],
24
+ resource: { type: "assistant-call" },
25
+ conditions: [
26
+ {
27
+ expression: "!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"
28
+ }
29
+ ],
30
+ reason: "Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."
31
+ },
32
+ {
33
+ effect: "deny",
34
+ actions: ["assistant.answer", "assistant.explainConcept"],
35
+ resource: { type: "assistant-call" },
36
+ conditions: [
37
+ {
38
+ expression: "!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"
39
+ }
40
+ ],
41
+ reason: "Only the explicitly reviewed assistant locales are permitted."
42
+ },
43
+ {
44
+ effect: "allow",
45
+ actions: ["assistant.answer", "assistant.explainConcept"],
46
+ resource: { type: "assistant-call" },
47
+ conditions: [
48
+ {
49
+ expression: "['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"
50
+ }
51
+ ],
52
+ reason: "Explicit context is present, so the request may continue to citation and scope validation."
53
+ }
54
+ ],
55
+ pii: {
56
+ fields: ["kbSnapshotId"],
57
+ retentionDays: 30
58
+ }
59
+ });
60
+ export {
61
+ AssistantGatePolicy
62
+ };
@@ -66,8 +66,69 @@ function enforceAllowedScope(allowedScope, answer) {
66
66
  }
67
67
  return { ok: true, value: answer };
68
68
  }
69
+
70
+ // src/policy/assistant-gate.policy.ts
71
+ import {
72
+ OwnersEnum,
73
+ StabilityEnum,
74
+ TagsEnum
75
+ } from "@contractspec/lib.contracts-spec/ownership";
76
+ import { definePolicy } from "@contractspec/lib.contracts-spec/policy";
77
+ var AssistantGatePolicy = definePolicy({
78
+ meta: {
79
+ key: "locale-jurisdiction-gate.policy.gate",
80
+ version: "1.0.0",
81
+ title: "Assistant Locale and Jurisdiction Gate",
82
+ description: "Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",
83
+ domain: "assistant",
84
+ scope: "operation",
85
+ owners: [OwnersEnum.PlatformFinance],
86
+ tags: [TagsEnum.I18n, "assistant", "policy", "jurisdiction"],
87
+ stability: StabilityEnum.Experimental
88
+ },
89
+ rules: [
90
+ {
91
+ effect: "deny",
92
+ actions: ["assistant.answer", "assistant.explainConcept"],
93
+ resource: { type: "assistant-call" },
94
+ conditions: [
95
+ {
96
+ expression: "!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"
97
+ }
98
+ ],
99
+ reason: "Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."
100
+ },
101
+ {
102
+ effect: "deny",
103
+ actions: ["assistant.answer", "assistant.explainConcept"],
104
+ resource: { type: "assistant-call" },
105
+ conditions: [
106
+ {
107
+ expression: "!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"
108
+ }
109
+ ],
110
+ reason: "Only the explicitly reviewed assistant locales are permitted."
111
+ },
112
+ {
113
+ effect: "allow",
114
+ actions: ["assistant.answer", "assistant.explainConcept"],
115
+ resource: { type: "assistant-call" },
116
+ conditions: [
117
+ {
118
+ expression: "['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"
119
+ }
120
+ ],
121
+ reason: "Explicit context is present, so the request may continue to citation and scope validation."
122
+ }
123
+ ],
124
+ pii: {
125
+ fields: ["kbSnapshotId"],
126
+ retentionDays: 30
127
+ }
128
+ });
69
129
  export {
70
130
  validateEnvelope,
71
131
  enforceCitations,
72
- enforceAllowedScope
132
+ enforceAllowedScope,
133
+ AssistantGatePolicy
73
134
  };
@@ -0,0 +1,48 @@
1
+ // src/translations/assistant-gate.en-GB.translation.ts
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum,
5
+ TagsEnum
6
+ } from "@contractspec/lib.contracts-spec/ownership";
7
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations/spec";
8
+ var AssistantGateMessagesEnGb = defineTranslation({
9
+ meta: {
10
+ key: "locale-jurisdiction-gate.translation.assistant-gate.en-GB",
11
+ version: "1.0.0",
12
+ domain: "assistant",
13
+ description: "British English messages for the assistant locale and jurisdiction gate.",
14
+ owners: [OwnersEnum.PlatformFinance],
15
+ stability: StabilityEnum.Experimental,
16
+ tags: [TagsEnum.I18n, "assistant", "policy"]
17
+ },
18
+ locale: "en-GB",
19
+ fallback: "en-US",
20
+ messages: {
21
+ "assistantGate.locale.label": { value: "Locale" },
22
+ "assistantGate.locale.description": {
23
+ value: "Select the reviewed locale for the assistant response."
24
+ },
25
+ "assistantGate.jurisdiction.label": { value: "Jurisdiction" },
26
+ "assistantGate.jurisdiction.placeholder": { value: "UK-FCA" },
27
+ "assistantGate.kbSnapshotId.label": { value: "Knowledge snapshot ID" },
28
+ "assistantGate.kbSnapshotId.placeholder": {
29
+ value: "kb_2026_03_20_policy_reviewed"
30
+ },
31
+ "assistantGate.allowedScope.label": { value: "Permitted scope" },
32
+ "assistantGate.allowedScope.educationOnly": {
33
+ value: "Educational content only"
34
+ },
35
+ "assistantGate.allowedScope.genericInfo": { value: "General information" },
36
+ "assistantGate.allowedScope.escalationRequired": {
37
+ value: "Escalation required"
38
+ },
39
+ "assistantGate.question.label": { value: "Question" },
40
+ "assistantGate.question.placeholder": {
41
+ value: "What may I say about this product in the selected jurisdiction?"
42
+ },
43
+ "assistantGate.submit.label": { value: "Generate response" }
44
+ }
45
+ });
46
+ export {
47
+ AssistantGateMessagesEnGb
48
+ };
@@ -0,0 +1,50 @@
1
+ // src/translations/assistant-gate.en-US.translation.ts
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum,
5
+ TagsEnum
6
+ } from "@contractspec/lib.contracts-spec/ownership";
7
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations/spec";
8
+ var AssistantGateMessagesEnUs = defineTranslation({
9
+ meta: {
10
+ key: "locale-jurisdiction-gate.translation.assistant-gate.en-US",
11
+ version: "1.0.0",
12
+ domain: "assistant",
13
+ description: "US English messages for the assistant locale and jurisdiction gate.",
14
+ owners: [OwnersEnum.PlatformFinance],
15
+ stability: StabilityEnum.Experimental,
16
+ tags: [TagsEnum.I18n, "assistant", "policy"]
17
+ },
18
+ locale: "en-US",
19
+ messages: {
20
+ "assistantGate.locale.label": { value: "Locale" },
21
+ "assistantGate.locale.description": {
22
+ value: "Choose the reviewed locale for the assistant answer."
23
+ },
24
+ "assistantGate.locale.enUs": { value: "English (United States)" },
25
+ "assistantGate.locale.enGb": { value: "English (United Kingdom)" },
26
+ "assistantGate.locale.frFr": { value: "French (France)" },
27
+ "assistantGate.jurisdiction.label": { value: "Jurisdiction" },
28
+ "assistantGate.jurisdiction.placeholder": { value: "US-SEC" },
29
+ "assistantGate.kbSnapshotId.label": { value: "Knowledge snapshot ID" },
30
+ "assistantGate.kbSnapshotId.placeholder": {
31
+ value: "kb_2026_03_20_policy_reviewed"
32
+ },
33
+ "assistantGate.allowedScope.label": { value: "Allowed scope" },
34
+ "assistantGate.allowedScope.educationOnly": {
35
+ value: "Educational content only"
36
+ },
37
+ "assistantGate.allowedScope.genericInfo": { value: "Generic information" },
38
+ "assistantGate.allowedScope.escalationRequired": {
39
+ value: "Escalation required"
40
+ },
41
+ "assistantGate.question.label": { value: "Question" },
42
+ "assistantGate.question.placeholder": {
43
+ value: "What can I say about this product in the selected jurisdiction?"
44
+ },
45
+ "assistantGate.submit.label": { value: "Generate answer" }
46
+ }
47
+ });
48
+ export {
49
+ AssistantGateMessagesEnUs
50
+ };
@@ -0,0 +1,52 @@
1
+ // src/translations/assistant-gate.fr-FR.translation.ts
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum,
5
+ TagsEnum
6
+ } from "@contractspec/lib.contracts-spec/ownership";
7
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations/spec";
8
+ var AssistantGateMessagesFrFr = defineTranslation({
9
+ meta: {
10
+ key: "locale-jurisdiction-gate.translation.assistant-gate.fr-FR",
11
+ version: "1.0.0",
12
+ domain: "assistant",
13
+ description: "French messages for the assistant locale and jurisdiction gate.",
14
+ owners: [OwnersEnum.PlatformFinance],
15
+ stability: StabilityEnum.Experimental,
16
+ tags: [TagsEnum.I18n, "assistant", "policy"]
17
+ },
18
+ locale: "fr-FR",
19
+ fallback: "en-US",
20
+ messages: {
21
+ "assistantGate.locale.label": { value: "Langue" },
22
+ "assistantGate.locale.description": {
23
+ value: "Sélectionnez la langue validée pour la réponse de l'assistant."
24
+ },
25
+ "assistantGate.jurisdiction.label": { value: "Juridiction" },
26
+ "assistantGate.jurisdiction.placeholder": { value: "FR-AMF" },
27
+ "assistantGate.kbSnapshotId.label": {
28
+ value: "Identifiant du snapshot documentaire"
29
+ },
30
+ "assistantGate.kbSnapshotId.placeholder": {
31
+ value: "kb_2026_03_20_policy_reviewed"
32
+ },
33
+ "assistantGate.allowedScope.label": { value: "Périmètre autorisé" },
34
+ "assistantGate.allowedScope.educationOnly": {
35
+ value: "Contenu éducatif uniquement"
36
+ },
37
+ "assistantGate.allowedScope.genericInfo": {
38
+ value: "Information générale"
39
+ },
40
+ "assistantGate.allowedScope.escalationRequired": {
41
+ value: "Escalade obligatoire"
42
+ },
43
+ "assistantGate.question.label": { value: "Question" },
44
+ "assistantGate.question.placeholder": {
45
+ value: "Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"
46
+ },
47
+ "assistantGate.submit.label": { value: "Générer la réponse" }
48
+ }
49
+ });
50
+ export {
51
+ AssistantGateMessagesFrFr
52
+ };
@@ -0,0 +1,148 @@
1
+ // src/translations/assistant-gate.en-GB.translation.ts
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum,
5
+ TagsEnum
6
+ } from "@contractspec/lib.contracts-spec/ownership";
7
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations/spec";
8
+ var AssistantGateMessagesEnGb = defineTranslation({
9
+ meta: {
10
+ key: "locale-jurisdiction-gate.translation.assistant-gate.en-GB",
11
+ version: "1.0.0",
12
+ domain: "assistant",
13
+ description: "British English messages for the assistant locale and jurisdiction gate.",
14
+ owners: [OwnersEnum.PlatformFinance],
15
+ stability: StabilityEnum.Experimental,
16
+ tags: [TagsEnum.I18n, "assistant", "policy"]
17
+ },
18
+ locale: "en-GB",
19
+ fallback: "en-US",
20
+ messages: {
21
+ "assistantGate.locale.label": { value: "Locale" },
22
+ "assistantGate.locale.description": {
23
+ value: "Select the reviewed locale for the assistant response."
24
+ },
25
+ "assistantGate.jurisdiction.label": { value: "Jurisdiction" },
26
+ "assistantGate.jurisdiction.placeholder": { value: "UK-FCA" },
27
+ "assistantGate.kbSnapshotId.label": { value: "Knowledge snapshot ID" },
28
+ "assistantGate.kbSnapshotId.placeholder": {
29
+ value: "kb_2026_03_20_policy_reviewed"
30
+ },
31
+ "assistantGate.allowedScope.label": { value: "Permitted scope" },
32
+ "assistantGate.allowedScope.educationOnly": {
33
+ value: "Educational content only"
34
+ },
35
+ "assistantGate.allowedScope.genericInfo": { value: "General information" },
36
+ "assistantGate.allowedScope.escalationRequired": {
37
+ value: "Escalation required"
38
+ },
39
+ "assistantGate.question.label": { value: "Question" },
40
+ "assistantGate.question.placeholder": {
41
+ value: "What may I say about this product in the selected jurisdiction?"
42
+ },
43
+ "assistantGate.submit.label": { value: "Generate response" }
44
+ }
45
+ });
46
+
47
+ // src/translations/assistant-gate.en-US.translation.ts
48
+ import {
49
+ OwnersEnum as OwnersEnum2,
50
+ StabilityEnum as StabilityEnum2,
51
+ TagsEnum as TagsEnum2
52
+ } from "@contractspec/lib.contracts-spec/ownership";
53
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations/spec";
54
+ var AssistantGateMessagesEnUs = defineTranslation2({
55
+ meta: {
56
+ key: "locale-jurisdiction-gate.translation.assistant-gate.en-US",
57
+ version: "1.0.0",
58
+ domain: "assistant",
59
+ description: "US English messages for the assistant locale and jurisdiction gate.",
60
+ owners: [OwnersEnum2.PlatformFinance],
61
+ stability: StabilityEnum2.Experimental,
62
+ tags: [TagsEnum2.I18n, "assistant", "policy"]
63
+ },
64
+ locale: "en-US",
65
+ messages: {
66
+ "assistantGate.locale.label": { value: "Locale" },
67
+ "assistantGate.locale.description": {
68
+ value: "Choose the reviewed locale for the assistant answer."
69
+ },
70
+ "assistantGate.locale.enUs": { value: "English (United States)" },
71
+ "assistantGate.locale.enGb": { value: "English (United Kingdom)" },
72
+ "assistantGate.locale.frFr": { value: "French (France)" },
73
+ "assistantGate.jurisdiction.label": { value: "Jurisdiction" },
74
+ "assistantGate.jurisdiction.placeholder": { value: "US-SEC" },
75
+ "assistantGate.kbSnapshotId.label": { value: "Knowledge snapshot ID" },
76
+ "assistantGate.kbSnapshotId.placeholder": {
77
+ value: "kb_2026_03_20_policy_reviewed"
78
+ },
79
+ "assistantGate.allowedScope.label": { value: "Allowed scope" },
80
+ "assistantGate.allowedScope.educationOnly": {
81
+ value: "Educational content only"
82
+ },
83
+ "assistantGate.allowedScope.genericInfo": { value: "Generic information" },
84
+ "assistantGate.allowedScope.escalationRequired": {
85
+ value: "Escalation required"
86
+ },
87
+ "assistantGate.question.label": { value: "Question" },
88
+ "assistantGate.question.placeholder": {
89
+ value: "What can I say about this product in the selected jurisdiction?"
90
+ },
91
+ "assistantGate.submit.label": { value: "Generate answer" }
92
+ }
93
+ });
94
+
95
+ // src/translations/assistant-gate.fr-FR.translation.ts
96
+ import {
97
+ OwnersEnum as OwnersEnum3,
98
+ StabilityEnum as StabilityEnum3,
99
+ TagsEnum as TagsEnum3
100
+ } from "@contractspec/lib.contracts-spec/ownership";
101
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations/spec";
102
+ var AssistantGateMessagesFrFr = defineTranslation3({
103
+ meta: {
104
+ key: "locale-jurisdiction-gate.translation.assistant-gate.fr-FR",
105
+ version: "1.0.0",
106
+ domain: "assistant",
107
+ description: "French messages for the assistant locale and jurisdiction gate.",
108
+ owners: [OwnersEnum3.PlatformFinance],
109
+ stability: StabilityEnum3.Experimental,
110
+ tags: [TagsEnum3.I18n, "assistant", "policy"]
111
+ },
112
+ locale: "fr-FR",
113
+ fallback: "en-US",
114
+ messages: {
115
+ "assistantGate.locale.label": { value: "Langue" },
116
+ "assistantGate.locale.description": {
117
+ value: "Sélectionnez la langue validée pour la réponse de l'assistant."
118
+ },
119
+ "assistantGate.jurisdiction.label": { value: "Juridiction" },
120
+ "assistantGate.jurisdiction.placeholder": { value: "FR-AMF" },
121
+ "assistantGate.kbSnapshotId.label": {
122
+ value: "Identifiant du snapshot documentaire"
123
+ },
124
+ "assistantGate.kbSnapshotId.placeholder": {
125
+ value: "kb_2026_03_20_policy_reviewed"
126
+ },
127
+ "assistantGate.allowedScope.label": { value: "Périmètre autorisé" },
128
+ "assistantGate.allowedScope.educationOnly": {
129
+ value: "Contenu éducatif uniquement"
130
+ },
131
+ "assistantGate.allowedScope.genericInfo": {
132
+ value: "Information générale"
133
+ },
134
+ "assistantGate.allowedScope.escalationRequired": {
135
+ value: "Escalade obligatoire"
136
+ },
137
+ "assistantGate.question.label": { value: "Question" },
138
+ "assistantGate.question.placeholder": {
139
+ value: "Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"
140
+ },
141
+ "assistantGate.submit.label": { value: "Générer la réponse" }
142
+ }
143
+ });
144
+ export {
145
+ AssistantGateMessagesFrFr,
146
+ AssistantGateMessagesEnUs,
147
+ AssistantGateMessagesEnGb
148
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  // src/entities/models.ts
3
3
  import {
4
- ScalarTypeEnum,
5
4
  defineEnum,
6
- defineSchemaModel
5
+ defineSchemaModel,
6
+ ScalarTypeEnum
7
7
  } from "@contractspec/lib.schema";
8
8
  var AllowedScopeEnum = defineEnum("AllowedScope", [
9
9
  "education_only",
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  // src/entities/models.ts
3
3
  import {
4
- ScalarTypeEnum,
5
4
  defineEnum,
6
- defineSchemaModel
5
+ defineSchemaModel,
6
+ ScalarTypeEnum
7
7
  } from "@contractspec/lib.schema";
8
8
  var AllowedScopeEnum = defineEnum("AllowedScope", [
9
9
  "education_only",
package/dist/events.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/events.ts
3
3
  import { defineEvent } from "@contractspec/lib.contracts-spec";
4
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
5
5
  var AssistantAnswerRequestedPayload = defineSchemaModel({
6
6
  name: "AssistantAnswerRequestedPayload",
7
7
  description: "Emitted when an assistant answer is requested (pre-gate).",
@@ -0,0 +1,22 @@
1
+ export declare const AssistantContextForm: import("@contractspec/lib.contracts-spec").FormSpec<import("@contractspec/lib.schema").SchemaModel<{
2
+ locale: {
3
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
4
+ isOptional: false;
5
+ };
6
+ jurisdiction: {
7
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
8
+ isOptional: false;
9
+ };
10
+ kbSnapshotId: {
11
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
12
+ isOptional: false;
13
+ };
14
+ allowedScope: {
15
+ type: import("@contractspec/lib.schema").EnumType<[string, string, string]>;
16
+ isOptional: false;
17
+ };
18
+ question: {
19
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
20
+ isOptional: false;
21
+ };
22
+ }>>;