@contractspec/example.locale-jurisdiction-gate 3.7.17 → 3.7.18
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.log +66 -66
- package/CHANGELOG.md +10 -0
- package/dist/browser/docs/index.js +3 -27
- package/dist/browser/docs/locale-jurisdiction-gate.docblock.js +3 -27
- package/dist/browser/entities/index.js +1 -110
- package/dist/browser/entities/models.js +1 -110
- package/dist/browser/events.js +1 -73
- package/dist/browser/example.js +1 -35
- package/dist/browser/forms/assistant-context.form.js +1 -213
- package/dist/browser/forms/index.js +1 -213
- package/dist/browser/handlers/demo.handlers.js +2 -152
- package/dist/browser/handlers/index.js +2 -152
- package/dist/browser/index.js +4 -844
- package/dist/browser/locale-jurisdiction-gate.feature.js +1 -105
- package/dist/browser/operations/assistant.js +1 -192
- package/dist/browser/operations/index.js +1 -192
- package/dist/browser/policy/assistant-gate.policy.js +1 -62
- package/dist/browser/policy/guard.js +2 -73
- package/dist/browser/policy/index.js +2 -134
- package/dist/browser/translations/assistant-gate.en-GB.translation.js +1 -48
- package/dist/browser/translations/assistant-gate.en-US.translation.js +1 -50
- package/dist/browser/translations/assistant-gate.fr-FR.translation.js +1 -52
- package/dist/browser/translations/index.js +1 -148
- package/dist/docs/index.js +3 -27
- package/dist/docs/locale-jurisdiction-gate.docblock.js +3 -27
- package/dist/entities/index.js +1 -110
- package/dist/entities/models.js +1 -110
- package/dist/events.js +1 -73
- package/dist/example.js +1 -35
- package/dist/forms/assistant-context.form.js +1 -213
- package/dist/forms/index.js +1 -213
- package/dist/handlers/demo.handlers.js +2 -152
- package/dist/handlers/index.js +2 -152
- package/dist/index.js +4 -844
- package/dist/locale-jurisdiction-gate.feature.js +1 -105
- package/dist/node/docs/index.js +3 -27
- package/dist/node/docs/locale-jurisdiction-gate.docblock.js +3 -27
- package/dist/node/entities/index.js +1 -110
- package/dist/node/entities/models.js +1 -110
- package/dist/node/events.js +1 -73
- package/dist/node/example.js +1 -35
- package/dist/node/forms/assistant-context.form.js +1 -213
- package/dist/node/forms/index.js +1 -213
- package/dist/node/handlers/demo.handlers.js +2 -152
- package/dist/node/handlers/index.js +2 -152
- package/dist/node/index.js +4 -844
- package/dist/node/locale-jurisdiction-gate.feature.js +1 -105
- package/dist/node/operations/assistant.js +1 -192
- package/dist/node/operations/index.js +1 -192
- package/dist/node/policy/assistant-gate.policy.js +1 -62
- package/dist/node/policy/guard.js +2 -73
- package/dist/node/policy/index.js +2 -134
- package/dist/node/translations/assistant-gate.en-GB.translation.js +1 -48
- package/dist/node/translations/assistant-gate.en-US.translation.js +1 -50
- package/dist/node/translations/assistant-gate.fr-FR.translation.js +1 -52
- package/dist/node/translations/index.js +1 -148
- package/dist/operations/assistant.js +1 -192
- package/dist/operations/index.js +1 -192
- package/dist/policy/assistant-gate.policy.js +1 -62
- package/dist/policy/guard.js +2 -73
- package/dist/policy/index.js +2 -134
- package/dist/translations/assistant-gate.en-GB.translation.js +1 -48
- package/dist/translations/assistant-gate.en-US.translation.js +1 -50
- package/dist/translations/assistant-gate.fr-FR.translation.js +1 -52
- package/dist/translations/index.js +1 -148
- package/package.json +5 -5
package/dist/operations/index.js
CHANGED
|
@@ -1,193 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
defineEnum,
|
|
5
|
-
defineSchemaModel,
|
|
6
|
-
ScalarTypeEnum
|
|
7
|
-
} from "@contractspec/lib.schema";
|
|
8
|
-
var AllowedScopeEnum = defineEnum("AllowedScope", [
|
|
9
|
-
"education_only",
|
|
10
|
-
"generic_info",
|
|
11
|
-
"escalation_required"
|
|
12
|
-
]);
|
|
13
|
-
var UserProfileModel = defineSchemaModel({
|
|
14
|
-
name: "UserProfile",
|
|
15
|
-
description: "User profile inputs used to derive regulatory context.",
|
|
16
|
-
fields: {
|
|
17
|
-
preferredLocale: {
|
|
18
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
19
|
-
isOptional: true
|
|
20
|
-
},
|
|
21
|
-
residencyCountry: {
|
|
22
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
23
|
-
isOptional: true
|
|
24
|
-
},
|
|
25
|
-
taxResidenceCountry: {
|
|
26
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
27
|
-
isOptional: true
|
|
28
|
-
},
|
|
29
|
-
clientType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
var RegulatoryContextModel = defineSchemaModel({
|
|
33
|
-
name: "RegulatoryContext",
|
|
34
|
-
description: "Explicit regulatory context (no guessing).",
|
|
35
|
-
fields: {
|
|
36
|
-
jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
37
|
-
region: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
38
|
-
clientType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
39
|
-
allowedScope: { type: AllowedScopeEnum, isOptional: false }
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
var LLMCallEnvelopeModel = defineSchemaModel({
|
|
43
|
-
name: "LLMCallEnvelope",
|
|
44
|
-
description: "Mandatory envelope for assistant calls. All fields are explicit and required for policy gating.",
|
|
45
|
-
fields: {
|
|
46
|
-
traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
47
|
-
locale: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
48
|
-
regulatoryContext: { type: RegulatoryContextModel, isOptional: false },
|
|
49
|
-
kbSnapshotId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
50
|
-
allowedScope: { type: AllowedScopeEnum, isOptional: false }
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
var AssistantCitationModel = defineSchemaModel({
|
|
54
|
-
name: "AssistantCitation",
|
|
55
|
-
description: "Citation referencing a KB snapshot + a specific item within it.",
|
|
56
|
-
fields: {
|
|
57
|
-
kbSnapshotId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
58
|
-
sourceType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
59
|
-
sourceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
60
|
-
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
61
|
-
excerpt: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
var AssistantAnswerSectionModel = defineSchemaModel({
|
|
65
|
-
name: "AssistantAnswerSection",
|
|
66
|
-
description: "Structured answer section.",
|
|
67
|
-
fields: {
|
|
68
|
-
heading: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
69
|
-
body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
var AssistantAnswerIRModel = defineSchemaModel({
|
|
73
|
-
name: "AssistantAnswerIR",
|
|
74
|
-
description: "Structured assistant answer with mandatory citations and explicit locale/jurisdiction.",
|
|
75
|
-
fields: {
|
|
76
|
-
locale: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
77
|
-
jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
78
|
-
allowedScope: { type: AllowedScopeEnum, isOptional: false },
|
|
79
|
-
sections: {
|
|
80
|
-
type: AssistantAnswerSectionModel,
|
|
81
|
-
isArray: true,
|
|
82
|
-
isOptional: false
|
|
83
|
-
},
|
|
84
|
-
citations: {
|
|
85
|
-
type: AssistantCitationModel,
|
|
86
|
-
isArray: true,
|
|
87
|
-
isOptional: false
|
|
88
|
-
},
|
|
89
|
-
disclaimers: {
|
|
90
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
91
|
-
isArray: true,
|
|
92
|
-
isOptional: true
|
|
93
|
-
},
|
|
94
|
-
riskFlags: {
|
|
95
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
96
|
-
isArray: true,
|
|
97
|
-
isOptional: true
|
|
98
|
-
},
|
|
99
|
-
refused: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
100
|
-
refusalReason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// src/operations/assistant.ts
|
|
105
|
-
import { defineCommand } from "@contractspec/lib.contracts-spec";
|
|
106
|
-
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
107
|
-
var AssistantQuestionInput = defineSchemaModel2({
|
|
108
|
-
name: "AssistantQuestionInput",
|
|
109
|
-
description: "Input for assistant calls with mandatory envelope.",
|
|
110
|
-
fields: {
|
|
111
|
-
envelope: { type: LLMCallEnvelopeModel, isOptional: false },
|
|
112
|
-
question: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
var AssistantConceptInput = defineSchemaModel2({
|
|
116
|
-
name: "AssistantConceptInput",
|
|
117
|
-
description: "Input for explaining a concept with mandatory envelope.",
|
|
118
|
-
fields: {
|
|
119
|
-
envelope: { type: LLMCallEnvelopeModel, isOptional: false },
|
|
120
|
-
conceptKey: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
var AssistantAnswerContract = defineCommand({
|
|
124
|
-
meta: {
|
|
125
|
-
key: "assistant.answer",
|
|
126
|
-
version: "1.0.0",
|
|
127
|
-
stability: "experimental",
|
|
128
|
-
owners: ["@examples"],
|
|
129
|
-
tags: ["assistant", "policy", "locale", "jurisdiction", "knowledge"],
|
|
130
|
-
description: "Answer a user question using a KB snapshot with strict locale/jurisdiction gating.",
|
|
131
|
-
goal: "Provide policy-safe answers that cite a KB snapshot or refuse.",
|
|
132
|
-
context: "Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing."
|
|
133
|
-
},
|
|
134
|
-
io: {
|
|
135
|
-
input: AssistantQuestionInput,
|
|
136
|
-
output: AssistantAnswerIRModel,
|
|
137
|
-
errors: {
|
|
138
|
-
LOCALE_REQUIRED: {
|
|
139
|
-
description: "Locale is required and must be supported",
|
|
140
|
-
http: 400,
|
|
141
|
-
gqlCode: "LOCALE_REQUIRED",
|
|
142
|
-
when: "locale is missing or unsupported"
|
|
143
|
-
},
|
|
144
|
-
JURISDICTION_REQUIRED: {
|
|
145
|
-
description: "Jurisdiction is required",
|
|
146
|
-
http: 400,
|
|
147
|
-
gqlCode: "JURISDICTION_REQUIRED",
|
|
148
|
-
when: "jurisdiction is missing"
|
|
149
|
-
},
|
|
150
|
-
KB_SNAPSHOT_REQUIRED: {
|
|
151
|
-
description: "KB snapshot id is required",
|
|
152
|
-
http: 400,
|
|
153
|
-
gqlCode: "KB_SNAPSHOT_REQUIRED",
|
|
154
|
-
when: "kbSnapshotId is missing"
|
|
155
|
-
},
|
|
156
|
-
CITATIONS_REQUIRED: {
|
|
157
|
-
description: "Answers must include citations to a KB snapshot",
|
|
158
|
-
http: 422,
|
|
159
|
-
gqlCode: "CITATIONS_REQUIRED",
|
|
160
|
-
when: "answer has no citations"
|
|
161
|
-
},
|
|
162
|
-
SCOPE_VIOLATION: {
|
|
163
|
-
description: "Answer violates allowed scope and must be refused/escalated",
|
|
164
|
-
http: 403,
|
|
165
|
-
gqlCode: "SCOPE_VIOLATION",
|
|
166
|
-
when: "output includes forbidden content under the given allowedScope"
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
policy: { auth: "user" }
|
|
171
|
-
});
|
|
172
|
-
var AssistantExplainConceptContract = defineCommand({
|
|
173
|
-
meta: {
|
|
174
|
-
key: "assistant.explainConcept",
|
|
175
|
-
version: "1.0.0",
|
|
176
|
-
stability: "experimental",
|
|
177
|
-
owners: ["@examples"],
|
|
178
|
-
tags: ["assistant", "policy", "knowledge", "concepts"],
|
|
179
|
-
description: "Explain a concept using a KB snapshot with strict locale/jurisdiction gating.",
|
|
180
|
-
goal: "Explain concepts with citations or refuse.",
|
|
181
|
-
context: "Same constraints as assistant.answer."
|
|
182
|
-
},
|
|
183
|
-
io: {
|
|
184
|
-
input: AssistantConceptInput,
|
|
185
|
-
output: AssistantAnswerIRModel,
|
|
186
|
-
errors: AssistantAnswerContract.io.errors
|
|
187
|
-
},
|
|
188
|
-
policy: { auth: "user" }
|
|
189
|
-
});
|
|
190
|
-
export {
|
|
191
|
-
AssistantExplainConceptContract,
|
|
192
|
-
AssistantAnswerContract
|
|
193
|
-
};
|
|
2
|
+
import{defineEnum as l,defineSchemaModel as t,ScalarTypeEnum as e}from"@contractspec/lib.schema";var i=l("AllowedScope",["education_only","generic_info","escalation_required"]),S=t({name:"UserProfile",description:"User profile inputs used to derive regulatory context.",fields:{preferredLocale:{type:e.String_unsecure(),isOptional:!0},residencyCountry:{type:e.String_unsecure(),isOptional:!0},taxResidenceCountry:{type:e.String_unsecure(),isOptional:!0},clientType:{type:e.String_unsecure(),isOptional:!0}}}),p=t({name:"RegulatoryContext",description:"Explicit regulatory context (no guessing).",fields:{jurisdiction:{type:e.String_unsecure(),isOptional:!1},region:{type:e.String_unsecure(),isOptional:!0},clientType:{type:e.String_unsecure(),isOptional:!0},allowedScope:{type:i,isOptional:!1}}}),n=t({name:"LLMCallEnvelope",description:"Mandatory envelope for assistant calls. All fields are explicit and required for policy gating.",fields:{traceId:{type:e.String_unsecure(),isOptional:!1},locale:{type:e.String_unsecure(),isOptional:!1},regulatoryContext:{type:p,isOptional:!1},kbSnapshotId:{type:e.String_unsecure(),isOptional:!1},allowedScope:{type:i,isOptional:!1}}}),u=t({name:"AssistantCitation",description:"Citation referencing a KB snapshot + a specific item within it.",fields:{kbSnapshotId:{type:e.String_unsecure(),isOptional:!1},sourceType:{type:e.String_unsecure(),isOptional:!1},sourceId:{type:e.String_unsecure(),isOptional:!1},title:{type:e.String_unsecure(),isOptional:!0},excerpt:{type:e.String_unsecure(),isOptional:!0}}}),c=t({name:"AssistantAnswerSection",description:"Structured answer section.",fields:{heading:{type:e.String_unsecure(),isOptional:!1},body:{type:e.String_unsecure(),isOptional:!1}}}),r=t({name:"AssistantAnswerIR",description:"Structured assistant answer with mandatory citations and explicit locale/jurisdiction.",fields:{locale:{type:e.String_unsecure(),isOptional:!1},jurisdiction:{type:e.String_unsecure(),isOptional:!1},allowedScope:{type:i,isOptional:!1},sections:{type:c,isArray:!0,isOptional:!1},citations:{type:u,isArray:!0,isOptional:!1},disclaimers:{type:e.String_unsecure(),isArray:!0,isOptional:!0},riskFlags:{type:e.String_unsecure(),isArray:!0,isOptional:!0},refused:{type:e.Boolean(),isOptional:!0},refusalReason:{type:e.String_unsecure(),isOptional:!0}}});import{defineCommand as s}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as o,ScalarTypeEnum as a}from"@contractspec/lib.schema";var y=o({name:"AssistantQuestionInput",description:"Input for assistant calls with mandatory envelope.",fields:{envelope:{type:n,isOptional:!1},question:{type:a.String_unsecure(),isOptional:!1}}}),d=o({name:"AssistantConceptInput",description:"Input for explaining a concept with mandatory envelope.",fields:{envelope:{type:n,isOptional:!1},conceptKey:{type:a.String_unsecure(),isOptional:!1}}}),g=s({meta:{key:"assistant.answer",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],description:"Answer a user question using a KB snapshot with strict locale/jurisdiction gating.",goal:"Provide policy-safe answers that cite a KB snapshot or refuse.",context:"Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing."},io:{input:y,output:r,errors:{LOCALE_REQUIRED:{description:"Locale is required and must be supported",http:400,gqlCode:"LOCALE_REQUIRED",when:"locale is missing or unsupported"},JURISDICTION_REQUIRED:{description:"Jurisdiction is required",http:400,gqlCode:"JURISDICTION_REQUIRED",when:"jurisdiction is missing"},KB_SNAPSHOT_REQUIRED:{description:"KB snapshot id is required",http:400,gqlCode:"KB_SNAPSHOT_REQUIRED",when:"kbSnapshotId is missing"},CITATIONS_REQUIRED:{description:"Answers must include citations to a KB snapshot",http:422,gqlCode:"CITATIONS_REQUIRED",when:"answer has no citations"},SCOPE_VIOLATION:{description:"Answer violates allowed scope and must be refused/escalated",http:403,gqlCode:"SCOPE_VIOLATION",when:"output includes forbidden content under the given allowedScope"}}},policy:{auth:"user"}}),A=s({meta:{key:"assistant.explainConcept",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","knowledge","concepts"],description:"Explain a concept using a KB snapshot with strict locale/jurisdiction gating.",goal:"Explain concepts with citations or refuse.",context:"Same constraints as assistant.answer."},io:{input:d,output:r,errors:g.io.errors},policy:{auth:"user"}});export{A as AssistantExplainConceptContract,g as AssistantAnswerContract};
|
|
@@ -1,63 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
OwnersEnum,
|
|
5
|
-
StabilityEnum,
|
|
6
|
-
TagsEnum
|
|
7
|
-
} from "@contractspec/lib.contracts-spec/ownership";
|
|
8
|
-
import { definePolicy } from "@contractspec/lib.contracts-spec/policy";
|
|
9
|
-
var AssistantGatePolicy = definePolicy({
|
|
10
|
-
meta: {
|
|
11
|
-
key: "locale-jurisdiction-gate.policy.gate",
|
|
12
|
-
version: "1.0.0",
|
|
13
|
-
title: "Assistant Locale and Jurisdiction Gate",
|
|
14
|
-
description: "Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",
|
|
15
|
-
domain: "assistant",
|
|
16
|
-
scope: "operation",
|
|
17
|
-
owners: [OwnersEnum.PlatformFinance],
|
|
18
|
-
tags: [TagsEnum.I18n, "assistant", "policy", "jurisdiction"],
|
|
19
|
-
stability: StabilityEnum.Experimental
|
|
20
|
-
},
|
|
21
|
-
rules: [
|
|
22
|
-
{
|
|
23
|
-
effect: "deny",
|
|
24
|
-
actions: ["assistant.answer", "assistant.explainConcept"],
|
|
25
|
-
resource: { type: "assistant-call" },
|
|
26
|
-
conditions: [
|
|
27
|
-
{
|
|
28
|
-
expression: "!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
reason: "Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
effect: "deny",
|
|
35
|
-
actions: ["assistant.answer", "assistant.explainConcept"],
|
|
36
|
-
resource: { type: "assistant-call" },
|
|
37
|
-
conditions: [
|
|
38
|
-
{
|
|
39
|
-
expression: "!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
reason: "Only the explicitly reviewed assistant locales are permitted."
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
effect: "allow",
|
|
46
|
-
actions: ["assistant.answer", "assistant.explainConcept"],
|
|
47
|
-
resource: { type: "assistant-call" },
|
|
48
|
-
conditions: [
|
|
49
|
-
{
|
|
50
|
-
expression: "['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
reason: "Explicit context is present, so the request may continue to citation and scope validation."
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
pii: {
|
|
57
|
-
fields: ["kbSnapshotId"],
|
|
58
|
-
retentionDays: 30
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
export {
|
|
62
|
-
AssistantGatePolicy
|
|
63
|
-
};
|
|
2
|
+
import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{definePolicy as q}from"@contractspec/lib.contracts-spec/policy";var z=q({meta:{key:"locale-jurisdiction-gate.policy.gate",version:"1.0.0",title:"Assistant Locale and Jurisdiction Gate",description:"Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",domain:"assistant",scope:"operation",owners:[h.PlatformFinance],tags:[k.I18n,"assistant","policy","jurisdiction"],stability:j.Experimental},rules:[{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"}],reason:"Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."},{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"}],reason:"Only the explicitly reviewed assistant locales are permitted."},{effect:"allow",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"}],reason:"Explicit context is present, so the request may continue to citation and scope validation."}],pii:{fields:["kbSnapshotId"],retentionDays:30}});export{z as AssistantGatePolicy};
|
package/dist/policy/guard.js
CHANGED
|
@@ -1,74 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function err(code, message) {
|
|
5
|
-
return { code, message };
|
|
6
|
-
}
|
|
7
|
-
function validateEnvelope(envelope) {
|
|
8
|
-
if (!envelope.locale || !SUPPORTED_LOCALES.has(envelope.locale)) {
|
|
9
|
-
return {
|
|
10
|
-
ok: false,
|
|
11
|
-
error: err("LOCALE_REQUIRED", "locale is required and must be supported")
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
if (!envelope.regulatoryContext?.jurisdiction) {
|
|
15
|
-
return {
|
|
16
|
-
ok: false,
|
|
17
|
-
error: err("JURISDICTION_REQUIRED", "jurisdiction is required")
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
if (!envelope.kbSnapshotId) {
|
|
21
|
-
return {
|
|
22
|
-
ok: false,
|
|
23
|
-
error: err("KB_SNAPSHOT_REQUIRED", "kbSnapshotId is required")
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
if (!envelope.allowedScope) {
|
|
27
|
-
return {
|
|
28
|
-
ok: false,
|
|
29
|
-
error: err("SCOPE_VIOLATION", "allowedScope is required")
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return { ok: true, value: envelope };
|
|
33
|
-
}
|
|
34
|
-
function enforceCitations(answer) {
|
|
35
|
-
const citations = answer.citations ?? [];
|
|
36
|
-
if (!Array.isArray(citations) || citations.length === 0) {
|
|
37
|
-
return {
|
|
38
|
-
ok: false,
|
|
39
|
-
error: err("CITATIONS_REQUIRED", "answers must include at least one citation")
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
return { ok: true, value: answer };
|
|
43
|
-
}
|
|
44
|
-
var EDUCATION_ONLY_FORBIDDEN_PATTERNS = [
|
|
45
|
-
/\b(buy|sell)\b/i,
|
|
46
|
-
/\b(should\s+buy|should\s+sell)\b/i,
|
|
47
|
-
/\b(guarantee(d)?|promise(d)?)\b/i
|
|
48
|
-
];
|
|
49
|
-
function enforceAllowedScope(allowedScope, answer) {
|
|
50
|
-
if (!allowedScope) {
|
|
51
|
-
return {
|
|
52
|
-
ok: false,
|
|
53
|
-
error: err("SCOPE_VIOLATION", "allowedScope is required")
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
if (allowedScope !== "education_only") {
|
|
57
|
-
return { ok: true, value: answer };
|
|
58
|
-
}
|
|
59
|
-
const bodies = (answer.sections ?? []).map((s) => s.body).join(`
|
|
60
|
-
`);
|
|
61
|
-
const violations = EDUCATION_ONLY_FORBIDDEN_PATTERNS.some((re) => re.test(bodies));
|
|
62
|
-
if (violations) {
|
|
63
|
-
return {
|
|
64
|
-
ok: false,
|
|
65
|
-
error: err("SCOPE_VIOLATION", "answer violates education_only scope (contains actionable or promotional language)")
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
return { ok: true, value: answer };
|
|
69
|
-
}
|
|
70
|
-
export {
|
|
71
|
-
validateEnvelope,
|
|
72
|
-
enforceCitations,
|
|
73
|
-
enforceAllowedScope
|
|
74
|
-
};
|
|
2
|
+
var u=new Set(["en-US","en-GB","fr-FR"]);function j(f,h){return{code:f,message:h}}function z(f){if(!f.locale||!u.has(f.locale))return{ok:!1,error:j("LOCALE_REQUIRED","locale is required and must be supported")};if(!f.regulatoryContext?.jurisdiction)return{ok:!1,error:j("JURISDICTION_REQUIRED","jurisdiction is required")};if(!f.kbSnapshotId)return{ok:!1,error:j("KB_SNAPSHOT_REQUIRED","kbSnapshotId is required")};if(!f.allowedScope)return{ok:!1,error:j("SCOPE_VIOLATION","allowedScope is required")};return{ok:!0,value:f}}function G(f){let h=f.citations??[];if(!Array.isArray(h)||h.length===0)return{ok:!1,error:j("CITATIONS_REQUIRED","answers must include at least one citation")};return{ok:!0,value:f}}var x=[/\b(buy|sell)\b/i,/\b(should\s+buy|should\s+sell)\b/i,/\b(guarantee(d)?|promise(d)?)\b/i];function H(f,h){if(!f)return{ok:!1,error:j("SCOPE_VIOLATION","allowedScope is required")};if(f!=="education_only")return{ok:!0,value:h};let q=(h.sections??[]).map((k)=>k.body).join(`
|
|
3
|
+
`);if(x.some((k)=>k.test(q)))return{ok:!1,error:j("SCOPE_VIOLATION","answer violates education_only scope (contains actionable or promotional language)")};return{ok:!0,value:h}}export{z as validateEnvelope,G as enforceCitations,H as enforceAllowedScope};
|
package/dist/policy/index.js
CHANGED
|
@@ -1,135 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
function err(code, message) {
|
|
5
|
-
return { code, message };
|
|
6
|
-
}
|
|
7
|
-
function validateEnvelope(envelope) {
|
|
8
|
-
if (!envelope.locale || !SUPPORTED_LOCALES.has(envelope.locale)) {
|
|
9
|
-
return {
|
|
10
|
-
ok: false,
|
|
11
|
-
error: err("LOCALE_REQUIRED", "locale is required and must be supported")
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
if (!envelope.regulatoryContext?.jurisdiction) {
|
|
15
|
-
return {
|
|
16
|
-
ok: false,
|
|
17
|
-
error: err("JURISDICTION_REQUIRED", "jurisdiction is required")
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
if (!envelope.kbSnapshotId) {
|
|
21
|
-
return {
|
|
22
|
-
ok: false,
|
|
23
|
-
error: err("KB_SNAPSHOT_REQUIRED", "kbSnapshotId is required")
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
if (!envelope.allowedScope) {
|
|
27
|
-
return {
|
|
28
|
-
ok: false,
|
|
29
|
-
error: err("SCOPE_VIOLATION", "allowedScope is required")
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return { ok: true, value: envelope };
|
|
33
|
-
}
|
|
34
|
-
function enforceCitations(answer) {
|
|
35
|
-
const citations = answer.citations ?? [];
|
|
36
|
-
if (!Array.isArray(citations) || citations.length === 0) {
|
|
37
|
-
return {
|
|
38
|
-
ok: false,
|
|
39
|
-
error: err("CITATIONS_REQUIRED", "answers must include at least one citation")
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
return { ok: true, value: answer };
|
|
43
|
-
}
|
|
44
|
-
var EDUCATION_ONLY_FORBIDDEN_PATTERNS = [
|
|
45
|
-
/\b(buy|sell)\b/i,
|
|
46
|
-
/\b(should\s+buy|should\s+sell)\b/i,
|
|
47
|
-
/\b(guarantee(d)?|promise(d)?)\b/i
|
|
48
|
-
];
|
|
49
|
-
function enforceAllowedScope(allowedScope, answer) {
|
|
50
|
-
if (!allowedScope) {
|
|
51
|
-
return {
|
|
52
|
-
ok: false,
|
|
53
|
-
error: err("SCOPE_VIOLATION", "allowedScope is required")
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
if (allowedScope !== "education_only") {
|
|
57
|
-
return { ok: true, value: answer };
|
|
58
|
-
}
|
|
59
|
-
const bodies = (answer.sections ?? []).map((s) => s.body).join(`
|
|
60
|
-
`);
|
|
61
|
-
const violations = EDUCATION_ONLY_FORBIDDEN_PATTERNS.some((re) => re.test(bodies));
|
|
62
|
-
if (violations) {
|
|
63
|
-
return {
|
|
64
|
-
ok: false,
|
|
65
|
-
error: err("SCOPE_VIOLATION", "answer violates education_only scope (contains actionable or promotional language)")
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
return { ok: true, value: answer };
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// src/policy/assistant-gate.policy.ts
|
|
72
|
-
import {
|
|
73
|
-
OwnersEnum,
|
|
74
|
-
StabilityEnum,
|
|
75
|
-
TagsEnum
|
|
76
|
-
} from "@contractspec/lib.contracts-spec/ownership";
|
|
77
|
-
import { definePolicy } from "@contractspec/lib.contracts-spec/policy";
|
|
78
|
-
var AssistantGatePolicy = definePolicy({
|
|
79
|
-
meta: {
|
|
80
|
-
key: "locale-jurisdiction-gate.policy.gate",
|
|
81
|
-
version: "1.0.0",
|
|
82
|
-
title: "Assistant Locale and Jurisdiction Gate",
|
|
83
|
-
description: "Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",
|
|
84
|
-
domain: "assistant",
|
|
85
|
-
scope: "operation",
|
|
86
|
-
owners: [OwnersEnum.PlatformFinance],
|
|
87
|
-
tags: [TagsEnum.I18n, "assistant", "policy", "jurisdiction"],
|
|
88
|
-
stability: StabilityEnum.Experimental
|
|
89
|
-
},
|
|
90
|
-
rules: [
|
|
91
|
-
{
|
|
92
|
-
effect: "deny",
|
|
93
|
-
actions: ["assistant.answer", "assistant.explainConcept"],
|
|
94
|
-
resource: { type: "assistant-call" },
|
|
95
|
-
conditions: [
|
|
96
|
-
{
|
|
97
|
-
expression: "!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
reason: "Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
effect: "deny",
|
|
104
|
-
actions: ["assistant.answer", "assistant.explainConcept"],
|
|
105
|
-
resource: { type: "assistant-call" },
|
|
106
|
-
conditions: [
|
|
107
|
-
{
|
|
108
|
-
expression: "!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"
|
|
109
|
-
}
|
|
110
|
-
],
|
|
111
|
-
reason: "Only the explicitly reviewed assistant locales are permitted."
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
effect: "allow",
|
|
115
|
-
actions: ["assistant.answer", "assistant.explainConcept"],
|
|
116
|
-
resource: { type: "assistant-call" },
|
|
117
|
-
conditions: [
|
|
118
|
-
{
|
|
119
|
-
expression: "['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"
|
|
120
|
-
}
|
|
121
|
-
],
|
|
122
|
-
reason: "Explicit context is present, so the request may continue to citation and scope validation."
|
|
123
|
-
}
|
|
124
|
-
],
|
|
125
|
-
pii: {
|
|
126
|
-
fields: ["kbSnapshotId"],
|
|
127
|
-
retentionDays: 30
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
export {
|
|
131
|
-
validateEnvelope,
|
|
132
|
-
enforceCitations,
|
|
133
|
-
enforceAllowedScope,
|
|
134
|
-
AssistantGatePolicy
|
|
135
|
-
};
|
|
2
|
+
var f=new Set(["en-US","en-GB","fr-FR"]);function t(r,I){return{code:r,message:I}}function u(r){if(!r.locale||!f.has(r.locale))return{ok:!1,error:t("LOCALE_REQUIRED","locale is required and must be supported")};if(!r.regulatoryContext?.jurisdiction)return{ok:!1,error:t("JURISDICTION_REQUIRED","jurisdiction is required")};if(!r.kbSnapshotId)return{ok:!1,error:t("KB_SNAPSHOT_REQUIRED","kbSnapshotId is required")};if(!r.allowedScope)return{ok:!1,error:t("SCOPE_VIOLATION","allowedScope is required")};return{ok:!0,value:r}}function A(r){let I=r.citations??[];if(!Array.isArray(I)||I.length===0)return{ok:!1,error:t("CITATIONS_REQUIRED","answers must include at least one citation")};return{ok:!0,value:r}}var _=[/\b(buy|sell)\b/i,/\b(should\s+buy|should\s+sell)\b/i,/\b(guarantee(d)?|promise(d)?)\b/i];function C(r,I){if(!r)return{ok:!1,error:t("SCOPE_VIOLATION","allowedScope is required")};if(r!=="education_only")return{ok:!0,value:I};let x=(I.sections??[]).map((R)=>R.body).join(`
|
|
3
|
+
`);if(_.some((R)=>R.test(x)))return{ok:!1,error:t("SCOPE_VIOLATION","answer violates education_only scope (contains actionable or promotional language)")};return{ok:!0,value:I}}import{OwnersEnum as E,StabilityEnum as Q,TagsEnum as G}from"@contractspec/lib.contracts-spec/ownership";import{definePolicy as U}from"@contractspec/lib.contracts-spec/policy";var H=U({meta:{key:"locale-jurisdiction-gate.policy.gate",version:"1.0.0",title:"Assistant Locale and Jurisdiction Gate",description:"Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",domain:"assistant",scope:"operation",owners:[E.PlatformFinance],tags:[G.I18n,"assistant","policy","jurisdiction"],stability:Q.Experimental},rules:[{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"}],reason:"Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."},{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"}],reason:"Only the explicitly reviewed assistant locales are permitted."},{effect:"allow",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"}],reason:"Explicit context is present, so the request may continue to citation and scope validation."}],pii:{fields:["kbSnapshotId"],retentionDays:30}});export{u as validateEnvelope,A as enforceCitations,C as enforceAllowedScope,H as AssistantGatePolicy};
|
|
@@ -1,49 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
OwnersEnum,
|
|
5
|
-
StabilityEnum,
|
|
6
|
-
TagsEnum
|
|
7
|
-
} from "@contractspec/lib.contracts-spec/ownership";
|
|
8
|
-
import { defineTranslation } from "@contractspec/lib.contracts-spec/translations/spec";
|
|
9
|
-
var AssistantGateMessagesEnGb = defineTranslation({
|
|
10
|
-
meta: {
|
|
11
|
-
key: "locale-jurisdiction-gate.translation.assistant-gate.en-GB",
|
|
12
|
-
version: "1.0.0",
|
|
13
|
-
domain: "assistant",
|
|
14
|
-
description: "British English messages for the assistant locale and jurisdiction gate.",
|
|
15
|
-
owners: [OwnersEnum.PlatformFinance],
|
|
16
|
-
stability: StabilityEnum.Experimental,
|
|
17
|
-
tags: [TagsEnum.I18n, "assistant", "policy"]
|
|
18
|
-
},
|
|
19
|
-
locale: "en-GB",
|
|
20
|
-
fallback: "en-US",
|
|
21
|
-
messages: {
|
|
22
|
-
"assistantGate.locale.label": { value: "Locale" },
|
|
23
|
-
"assistantGate.locale.description": {
|
|
24
|
-
value: "Select the reviewed locale for the assistant response."
|
|
25
|
-
},
|
|
26
|
-
"assistantGate.jurisdiction.label": { value: "Jurisdiction" },
|
|
27
|
-
"assistantGate.jurisdiction.placeholder": { value: "UK-FCA" },
|
|
28
|
-
"assistantGate.kbSnapshotId.label": { value: "Knowledge snapshot ID" },
|
|
29
|
-
"assistantGate.kbSnapshotId.placeholder": {
|
|
30
|
-
value: "kb_2026_03_20_policy_reviewed"
|
|
31
|
-
},
|
|
32
|
-
"assistantGate.allowedScope.label": { value: "Permitted scope" },
|
|
33
|
-
"assistantGate.allowedScope.educationOnly": {
|
|
34
|
-
value: "Educational content only"
|
|
35
|
-
},
|
|
36
|
-
"assistantGate.allowedScope.genericInfo": { value: "General information" },
|
|
37
|
-
"assistantGate.allowedScope.escalationRequired": {
|
|
38
|
-
value: "Escalation required"
|
|
39
|
-
},
|
|
40
|
-
"assistantGate.question.label": { value: "Question" },
|
|
41
|
-
"assistantGate.question.placeholder": {
|
|
42
|
-
value: "What may I say about this product in the selected jurisdiction?"
|
|
43
|
-
},
|
|
44
|
-
"assistantGate.submit.label": { value: "Generate response" }
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
export {
|
|
48
|
-
AssistantGateMessagesEnGb
|
|
49
|
-
};
|
|
2
|
+
import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-GB",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});export{z as AssistantGateMessagesEnGb};
|
|
@@ -1,51 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
OwnersEnum,
|
|
5
|
-
StabilityEnum,
|
|
6
|
-
TagsEnum
|
|
7
|
-
} from "@contractspec/lib.contracts-spec/ownership";
|
|
8
|
-
import { defineTranslation } from "@contractspec/lib.contracts-spec/translations/spec";
|
|
9
|
-
var AssistantGateMessagesEnUs = defineTranslation({
|
|
10
|
-
meta: {
|
|
11
|
-
key: "locale-jurisdiction-gate.translation.assistant-gate.en-US",
|
|
12
|
-
version: "1.0.0",
|
|
13
|
-
domain: "assistant",
|
|
14
|
-
description: "US English messages for the assistant locale and jurisdiction gate.",
|
|
15
|
-
owners: [OwnersEnum.PlatformFinance],
|
|
16
|
-
stability: StabilityEnum.Experimental,
|
|
17
|
-
tags: [TagsEnum.I18n, "assistant", "policy"]
|
|
18
|
-
},
|
|
19
|
-
locale: "en-US",
|
|
20
|
-
messages: {
|
|
21
|
-
"assistantGate.locale.label": { value: "Locale" },
|
|
22
|
-
"assistantGate.locale.description": {
|
|
23
|
-
value: "Choose the reviewed locale for the assistant answer."
|
|
24
|
-
},
|
|
25
|
-
"assistantGate.locale.enUs": { value: "English (United States)" },
|
|
26
|
-
"assistantGate.locale.enGb": { value: "English (United Kingdom)" },
|
|
27
|
-
"assistantGate.locale.frFr": { value: "French (France)" },
|
|
28
|
-
"assistantGate.jurisdiction.label": { value: "Jurisdiction" },
|
|
29
|
-
"assistantGate.jurisdiction.placeholder": { value: "US-SEC" },
|
|
30
|
-
"assistantGate.kbSnapshotId.label": { value: "Knowledge snapshot ID" },
|
|
31
|
-
"assistantGate.kbSnapshotId.placeholder": {
|
|
32
|
-
value: "kb_2026_03_20_policy_reviewed"
|
|
33
|
-
},
|
|
34
|
-
"assistantGate.allowedScope.label": { value: "Allowed scope" },
|
|
35
|
-
"assistantGate.allowedScope.educationOnly": {
|
|
36
|
-
value: "Educational content only"
|
|
37
|
-
},
|
|
38
|
-
"assistantGate.allowedScope.genericInfo": { value: "Generic information" },
|
|
39
|
-
"assistantGate.allowedScope.escalationRequired": {
|
|
40
|
-
value: "Escalation required"
|
|
41
|
-
},
|
|
42
|
-
"assistantGate.question.label": { value: "Question" },
|
|
43
|
-
"assistantGate.question.placeholder": {
|
|
44
|
-
value: "What can I say about this product in the selected jurisdiction?"
|
|
45
|
-
},
|
|
46
|
-
"assistantGate.submit.label": { value: "Generate answer" }
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
export {
|
|
50
|
-
AssistantGateMessagesEnUs
|
|
51
|
-
};
|
|
2
|
+
import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-US",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});export{z as AssistantGateMessagesEnUs};
|
|
@@ -1,53 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
OwnersEnum,
|
|
5
|
-
StabilityEnum,
|
|
6
|
-
TagsEnum
|
|
7
|
-
} from "@contractspec/lib.contracts-spec/ownership";
|
|
8
|
-
import { defineTranslation } from "@contractspec/lib.contracts-spec/translations/spec";
|
|
9
|
-
var AssistantGateMessagesFrFr = defineTranslation({
|
|
10
|
-
meta: {
|
|
11
|
-
key: "locale-jurisdiction-gate.translation.assistant-gate.fr-FR",
|
|
12
|
-
version: "1.0.0",
|
|
13
|
-
domain: "assistant",
|
|
14
|
-
description: "French messages for the assistant locale and jurisdiction gate.",
|
|
15
|
-
owners: [OwnersEnum.PlatformFinance],
|
|
16
|
-
stability: StabilityEnum.Experimental,
|
|
17
|
-
tags: [TagsEnum.I18n, "assistant", "policy"]
|
|
18
|
-
},
|
|
19
|
-
locale: "fr-FR",
|
|
20
|
-
fallback: "en-US",
|
|
21
|
-
messages: {
|
|
22
|
-
"assistantGate.locale.label": { value: "Langue" },
|
|
23
|
-
"assistantGate.locale.description": {
|
|
24
|
-
value: "S\xE9lectionnez la langue valid\xE9e pour la r\xE9ponse de l'assistant."
|
|
25
|
-
},
|
|
26
|
-
"assistantGate.jurisdiction.label": { value: "Juridiction" },
|
|
27
|
-
"assistantGate.jurisdiction.placeholder": { value: "FR-AMF" },
|
|
28
|
-
"assistantGate.kbSnapshotId.label": {
|
|
29
|
-
value: "Identifiant du snapshot documentaire"
|
|
30
|
-
},
|
|
31
|
-
"assistantGate.kbSnapshotId.placeholder": {
|
|
32
|
-
value: "kb_2026_03_20_policy_reviewed"
|
|
33
|
-
},
|
|
34
|
-
"assistantGate.allowedScope.label": { value: "P\xE9rim\xE8tre autoris\xE9" },
|
|
35
|
-
"assistantGate.allowedScope.educationOnly": {
|
|
36
|
-
value: "Contenu \xE9ducatif uniquement"
|
|
37
|
-
},
|
|
38
|
-
"assistantGate.allowedScope.genericInfo": {
|
|
39
|
-
value: "Information g\xE9n\xE9rale"
|
|
40
|
-
},
|
|
41
|
-
"assistantGate.allowedScope.escalationRequired": {
|
|
42
|
-
value: "Escalade obligatoire"
|
|
43
|
-
},
|
|
44
|
-
"assistantGate.question.label": { value: "Question" },
|
|
45
|
-
"assistantGate.question.placeholder": {
|
|
46
|
-
value: "Que puis-je dire sur ce produit dans la juridiction s\xE9lectionn\xE9e ?"
|
|
47
|
-
},
|
|
48
|
-
"assistantGate.submit.label": { value: "G\xE9n\xE9rer la r\xE9ponse" }
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
export {
|
|
52
|
-
AssistantGateMessagesFrFr
|
|
53
|
-
};
|
|
2
|
+
import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.fr-FR",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"S\xE9lectionnez la langue valid\xE9e pour la r\xE9ponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"P\xE9rim\xE8tre autoris\xE9"},"assistantGate.allowedScope.educationOnly":{value:"Contenu \xE9ducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information g\xE9n\xE9rale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction s\xE9lectionn\xE9e ?"},"assistantGate.submit.label":{value:"G\xE9n\xE9rer la r\xE9ponse"}}});export{z as AssistantGateMessagesFrFr};
|