@contractspec/example.locale-jurisdiction-gate 3.7.7 → 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.
- package/.turbo/turbo-build.log +72 -51
- package/CHANGELOG.md +21 -0
- package/README.md +13 -1
- package/dist/browser/forms/assistant-context.form.js +213 -0
- package/dist/browser/forms/index.js +213 -0
- package/dist/browser/index.js +327 -6
- package/dist/browser/locale-jurisdiction-gate.feature.js +66 -1
- package/dist/browser/policy/assistant-gate.policy.js +62 -0
- package/dist/browser/policy/index.js +62 -1
- package/dist/browser/translations/assistant-gate.en-GB.translation.js +48 -0
- package/dist/browser/translations/assistant-gate.en-US.translation.js +50 -0
- package/dist/browser/translations/assistant-gate.fr-FR.translation.js +52 -0
- package/dist/browser/translations/index.js +148 -0
- package/dist/contracts.test.d.ts +1 -0
- package/dist/forms/assistant-context.form.d.ts +22 -0
- package/dist/forms/assistant-context.form.js +214 -0
- package/dist/forms/index.d.ts +1 -0
- package/dist/forms/index.js +214 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +327 -6
- package/dist/locale-jurisdiction-gate.feature.js +66 -1
- package/dist/node/forms/assistant-context.form.js +213 -0
- package/dist/node/forms/index.js +213 -0
- package/dist/node/index.js +327 -6
- package/dist/node/locale-jurisdiction-gate.feature.js +66 -1
- package/dist/node/policy/assistant-gate.policy.js +62 -0
- package/dist/node/policy/index.js +62 -1
- package/dist/node/translations/assistant-gate.en-GB.translation.js +48 -0
- package/dist/node/translations/assistant-gate.en-US.translation.js +50 -0
- package/dist/node/translations/assistant-gate.fr-FR.translation.js +52 -0
- package/dist/node/translations/index.js +148 -0
- package/dist/policy/assistant-gate.policy.d.ts +1 -0
- package/dist/policy/assistant-gate.policy.js +63 -0
- package/dist/policy/index.d.ts +1 -0
- package/dist/policy/index.js +62 -1
- package/dist/translations/assistant-gate.en-GB.translation.d.ts +1 -0
- package/dist/translations/assistant-gate.en-GB.translation.js +49 -0
- package/dist/translations/assistant-gate.en-US.translation.d.ts +1 -0
- package/dist/translations/assistant-gate.en-US.translation.js +51 -0
- package/dist/translations/assistant-gate.fr-FR.translation.d.ts +1 -0
- package/dist/translations/assistant-gate.fr-FR.translation.js +53 -0
- package/dist/translations/index.d.ts +3 -0
- package/dist/translations/index.js +149 -0
- package/package.json +103 -5
- package/src/contracts.test.ts +32 -0
- package/src/forms/assistant-context.form.ts +112 -0
- package/src/forms/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/locale-jurisdiction-gate.feature.ts +7 -1
- package/src/policy/assistant-gate.policy.ts +65 -0
- package/src/policy/index.ts +1 -0
- package/src/translations/assistant-gate.en-GB.translation.ts +46 -0
- package/src/translations/assistant-gate.en-US.translation.ts +48 -0
- package/src/translations/assistant-gate.fr-FR.translation.ts +51 -0
- package/src/translations/index.ts +3 -0
|
@@ -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 {};
|
|
@@ -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
|
+
}>>;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/entities/models.ts
|
|
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/forms/assistant-context.form.ts
|
|
105
|
+
import { defineFormSpec } from "@contractspec/lib.contracts-spec/forms";
|
|
106
|
+
import {
|
|
107
|
+
OwnersEnum,
|
|
108
|
+
StabilityEnum,
|
|
109
|
+
TagsEnum
|
|
110
|
+
} from "@contractspec/lib.contracts-spec/ownership";
|
|
111
|
+
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
112
|
+
var AssistantContextFormModel = defineSchemaModel2({
|
|
113
|
+
name: "AssistantContextFormModel",
|
|
114
|
+
description: "Form values required before a policy-gated assistant request can be executed.",
|
|
115
|
+
fields: {
|
|
116
|
+
locale: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
117
|
+
jurisdiction: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
118
|
+
kbSnapshotId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
119
|
+
allowedScope: { type: AllowedScopeEnum, isOptional: false },
|
|
120
|
+
question: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
var AssistantContextForm = defineFormSpec({
|
|
124
|
+
meta: {
|
|
125
|
+
key: "locale-jurisdiction-gate.form.assistant-context",
|
|
126
|
+
version: "1.0.0",
|
|
127
|
+
title: "Assistant Context Gate",
|
|
128
|
+
description: "Collects the explicit locale, jurisdiction, scope, and knowledge snapshot required by the assistant gate.",
|
|
129
|
+
domain: "assistant",
|
|
130
|
+
owners: [OwnersEnum.PlatformFinance],
|
|
131
|
+
tags: [TagsEnum.I18n, "assistant", "form", "policy"],
|
|
132
|
+
stability: StabilityEnum.Experimental
|
|
133
|
+
},
|
|
134
|
+
model: AssistantContextFormModel,
|
|
135
|
+
fields: [
|
|
136
|
+
{
|
|
137
|
+
kind: "select",
|
|
138
|
+
name: "locale",
|
|
139
|
+
labelI18n: "assistantGate.locale.label",
|
|
140
|
+
descriptionI18n: "assistantGate.locale.description",
|
|
141
|
+
options: {
|
|
142
|
+
kind: "static",
|
|
143
|
+
options: [
|
|
144
|
+
{ labelI18n: "assistantGate.locale.enUs", value: "en-US" },
|
|
145
|
+
{ labelI18n: "assistantGate.locale.enGb", value: "en-GB" },
|
|
146
|
+
{ labelI18n: "assistantGate.locale.frFr", value: "fr-FR" }
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
required: true
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
kind: "text",
|
|
153
|
+
name: "jurisdiction",
|
|
154
|
+
labelI18n: "assistantGate.jurisdiction.label",
|
|
155
|
+
placeholderI18n: "assistantGate.jurisdiction.placeholder",
|
|
156
|
+
required: true
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
kind: "text",
|
|
160
|
+
name: "kbSnapshotId",
|
|
161
|
+
labelI18n: "assistantGate.kbSnapshotId.label",
|
|
162
|
+
placeholderI18n: "assistantGate.kbSnapshotId.placeholder",
|
|
163
|
+
required: true
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
kind: "radio",
|
|
167
|
+
name: "allowedScope",
|
|
168
|
+
labelI18n: "assistantGate.allowedScope.label",
|
|
169
|
+
options: {
|
|
170
|
+
kind: "static",
|
|
171
|
+
options: [
|
|
172
|
+
{
|
|
173
|
+
labelI18n: "assistantGate.allowedScope.educationOnly",
|
|
174
|
+
value: "education_only"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
labelI18n: "assistantGate.allowedScope.genericInfo",
|
|
178
|
+
value: "generic_info"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
labelI18n: "assistantGate.allowedScope.escalationRequired",
|
|
182
|
+
value: "escalation_required"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
required: true
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
kind: "textarea",
|
|
190
|
+
name: "question",
|
|
191
|
+
labelI18n: "assistantGate.question.label",
|
|
192
|
+
placeholderI18n: "assistantGate.question.placeholder",
|
|
193
|
+
required: true
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
actions: [
|
|
197
|
+
{
|
|
198
|
+
key: "submit",
|
|
199
|
+
labelI18n: "assistantGate.submit.label",
|
|
200
|
+
op: { name: "assistant.answer", version: "1.0.0" }
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
policy: {
|
|
204
|
+
flags: [],
|
|
205
|
+
pii: ["kbSnapshotId", "question"]
|
|
206
|
+
},
|
|
207
|
+
renderHints: {
|
|
208
|
+
ui: "custom",
|
|
209
|
+
form: "react-hook-form"
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
export {
|
|
213
|
+
AssistantContextForm
|
|
214
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './assistant-context.form';
|