@contractspec/example.locale-jurisdiction-gate 3.7.17 → 3.7.19

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 (66) hide show
  1. package/.turbo/turbo-build.log +66 -66
  2. package/CHANGELOG.md +17 -0
  3. package/dist/browser/docs/index.js +3 -27
  4. package/dist/browser/docs/locale-jurisdiction-gate.docblock.js +3 -27
  5. package/dist/browser/entities/index.js +1 -110
  6. package/dist/browser/entities/models.js +1 -110
  7. package/dist/browser/events.js +1 -73
  8. package/dist/browser/example.js +1 -35
  9. package/dist/browser/forms/assistant-context.form.js +1 -213
  10. package/dist/browser/forms/index.js +1 -213
  11. package/dist/browser/handlers/demo.handlers.js +2 -152
  12. package/dist/browser/handlers/index.js +2 -152
  13. package/dist/browser/index.js +4 -844
  14. package/dist/browser/locale-jurisdiction-gate.feature.js +1 -105
  15. package/dist/browser/operations/assistant.js +1 -192
  16. package/dist/browser/operations/index.js +1 -192
  17. package/dist/browser/policy/assistant-gate.policy.js +1 -62
  18. package/dist/browser/policy/guard.js +2 -73
  19. package/dist/browser/policy/index.js +2 -134
  20. package/dist/browser/translations/assistant-gate.en-GB.translation.js +1 -48
  21. package/dist/browser/translations/assistant-gate.en-US.translation.js +1 -50
  22. package/dist/browser/translations/assistant-gate.fr-FR.translation.js +1 -52
  23. package/dist/browser/translations/index.js +1 -148
  24. package/dist/docs/index.js +3 -27
  25. package/dist/docs/locale-jurisdiction-gate.docblock.js +3 -27
  26. package/dist/entities/index.js +1 -110
  27. package/dist/entities/models.js +1 -110
  28. package/dist/events.js +1 -73
  29. package/dist/example.js +1 -35
  30. package/dist/forms/assistant-context.form.js +1 -213
  31. package/dist/forms/index.js +1 -213
  32. package/dist/handlers/demo.handlers.js +2 -152
  33. package/dist/handlers/index.js +2 -152
  34. package/dist/index.js +4 -844
  35. package/dist/locale-jurisdiction-gate.feature.js +1 -105
  36. package/dist/node/docs/index.js +3 -27
  37. package/dist/node/docs/locale-jurisdiction-gate.docblock.js +3 -27
  38. package/dist/node/entities/index.js +1 -110
  39. package/dist/node/entities/models.js +1 -110
  40. package/dist/node/events.js +1 -73
  41. package/dist/node/example.js +1 -35
  42. package/dist/node/forms/assistant-context.form.js +1 -213
  43. package/dist/node/forms/index.js +1 -213
  44. package/dist/node/handlers/demo.handlers.js +2 -152
  45. package/dist/node/handlers/index.js +2 -152
  46. package/dist/node/index.js +4 -844
  47. package/dist/node/locale-jurisdiction-gate.feature.js +1 -105
  48. package/dist/node/operations/assistant.js +1 -192
  49. package/dist/node/operations/index.js +1 -192
  50. package/dist/node/policy/assistant-gate.policy.js +1 -62
  51. package/dist/node/policy/guard.js +2 -73
  52. package/dist/node/policy/index.js +2 -134
  53. package/dist/node/translations/assistant-gate.en-GB.translation.js +1 -48
  54. package/dist/node/translations/assistant-gate.en-US.translation.js +1 -50
  55. package/dist/node/translations/assistant-gate.fr-FR.translation.js +1 -52
  56. package/dist/node/translations/index.js +1 -148
  57. package/dist/operations/assistant.js +1 -192
  58. package/dist/operations/index.js +1 -192
  59. package/dist/policy/assistant-gate.policy.js +1 -62
  60. package/dist/policy/guard.js +2 -73
  61. package/dist/policy/index.js +2 -134
  62. package/dist/translations/assistant-gate.en-GB.translation.js +1 -48
  63. package/dist/translations/assistant-gate.en-US.translation.js +1 -50
  64. package/dist/translations/assistant-gate.fr-FR.translation.js +1 -52
  65. package/dist/translations/index.js +1 -148
  66. package/package.json +5 -5
@@ -1,134 +1,2 @@
1
- // src/policy/guard.ts
2
- var SUPPORTED_LOCALES = new Set(["en-US", "en-GB", "fr-FR"]);
3
- function err(code, message) {
4
- return { code, message };
5
- }
6
- function validateEnvelope(envelope) {
7
- if (!envelope.locale || !SUPPORTED_LOCALES.has(envelope.locale)) {
8
- return {
9
- ok: false,
10
- error: err("LOCALE_REQUIRED", "locale is required and must be supported")
11
- };
12
- }
13
- if (!envelope.regulatoryContext?.jurisdiction) {
14
- return {
15
- ok: false,
16
- error: err("JURISDICTION_REQUIRED", "jurisdiction is required")
17
- };
18
- }
19
- if (!envelope.kbSnapshotId) {
20
- return {
21
- ok: false,
22
- error: err("KB_SNAPSHOT_REQUIRED", "kbSnapshotId is required")
23
- };
24
- }
25
- if (!envelope.allowedScope) {
26
- return {
27
- ok: false,
28
- error: err("SCOPE_VIOLATION", "allowedScope is required")
29
- };
30
- }
31
- return { ok: true, value: envelope };
32
- }
33
- function enforceCitations(answer) {
34
- const citations = answer.citations ?? [];
35
- if (!Array.isArray(citations) || citations.length === 0) {
36
- return {
37
- ok: false,
38
- error: err("CITATIONS_REQUIRED", "answers must include at least one citation")
39
- };
40
- }
41
- return { ok: true, value: answer };
42
- }
43
- var EDUCATION_ONLY_FORBIDDEN_PATTERNS = [
44
- /\b(buy|sell)\b/i,
45
- /\b(should\s+buy|should\s+sell)\b/i,
46
- /\b(guarantee(d)?|promise(d)?)\b/i
47
- ];
48
- function enforceAllowedScope(allowedScope, answer) {
49
- if (!allowedScope) {
50
- return {
51
- ok: false,
52
- error: err("SCOPE_VIOLATION", "allowedScope is required")
53
- };
54
- }
55
- if (allowedScope !== "education_only") {
56
- return { ok: true, value: answer };
57
- }
58
- const bodies = (answer.sections ?? []).map((s) => s.body).join(`
59
- `);
60
- const violations = EDUCATION_ONLY_FORBIDDEN_PATTERNS.some((re) => re.test(bodies));
61
- if (violations) {
62
- return {
63
- ok: false,
64
- error: err("SCOPE_VIOLATION", "answer violates education_only scope (contains actionable or promotional language)")
65
- };
66
- }
67
- return { ok: true, value: answer };
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
- });
129
- export {
130
- validateEnvelope,
131
- enforceCitations,
132
- enforceAllowedScope,
133
- AssistantGatePolicy
134
- };
1
+ 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(`
2
+ `);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,48 +1 @@
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
- };
1
+ 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,50 +1 @@
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
- };
1
+ 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,52 +1 @@
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
- };
1
+ 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électionnez la langue validée pour la réponse 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érimètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"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électionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{z as AssistantGateMessagesFrFr};
@@ -1,148 +1 @@
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
- };
1
+ 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 J=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"}}});import{OwnersEnum as v,StabilityEnum as x,TagsEnum as z}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as A}from"@contractspec/lib.contracts-spec/translations/spec";var N=A({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:[v.PlatformFinance],stability:x.Experimental,tags:[z.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"}}});import{OwnersEnum as B,StabilityEnum as C,TagsEnum as D}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as G}from"@contractspec/lib.contracts-spec/translations/spec";var V=G({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:[B.PlatformFinance],stability:C.Experimental,tags:[D.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse 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érimètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"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électionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{V as AssistantGateMessagesFrFr,N as AssistantGateMessagesEnUs,J as AssistantGateMessagesEnGb};
@@ -1,193 +1,2 @@
1
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/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};