@lssm/example.locale-jurisdiction-gate 0.0.0-canary-20251220041653 → 0.0.0-canary-20251221132705
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$bundle.log +65 -53
- package/.turbo/turbo-build.log +69 -57
- package/CHANGELOG.md +3 -3
- package/dist/entities/models.d.ts +48 -48
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/libs/contracts/dist/_virtual/rolldown_runtime.js +6 -0
- package/dist/libs/contracts/dist/_virtual/rolldown_runtime.js.map +1 -0
- package/dist/libs/contracts/dist/client/react/form-render.js +1 -0
- package/dist/libs/contracts/dist/data-views.js +1 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +6 -6
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -1
- package/dist/libs/contracts/dist/features.js +1 -0
- package/dist/libs/contracts/dist/forms.js +1 -0
- package/dist/libs/contracts/dist/index.js +14 -1
- package/dist/libs/contracts/dist/index.js.map +1 -0
- package/dist/libs/contracts/dist/integrations/contracts.js +1 -1
- package/dist/libs/contracts/dist/integrations/contracts.js.map +1 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +1 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +1 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +1 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js +1 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js.map +1 -1
- package/dist/libs/contracts/dist/llm/exporters.js.map +1 -1
- package/dist/libs/contracts/dist/onboarding-base.js +1 -1
- package/dist/libs/contracts/dist/onboarding-base.js.map +1 -1
- package/dist/libs/contracts/dist/{spec.js → operation.js} +2 -2
- package/dist/libs/contracts/dist/operation.js.map +1 -0
- package/dist/libs/contracts/dist/presentations.js +1 -0
- package/dist/libs/contracts/dist/registry-utils.js +24 -0
- package/dist/libs/contracts/dist/registry-utils.js.map +1 -0
- package/dist/libs/contracts/dist/registry.js +1 -0
- package/dist/libs/contracts/dist/workflow/index.js +1 -0
- package/dist/libs/contracts/dist/workflow/spec.js +1 -0
- package/dist/libs/contracts/dist/workspace-config/contractsrc-schema.js +122 -0
- package/dist/libs/contracts/dist/workspace-config/contractsrc-schema.js.map +1 -0
- package/dist/libs/contracts/dist/workspace-config/index.js +1 -0
- package/dist/operations/assistant.d.ts +245 -0
- package/dist/operations/assistant.d.ts.map +1 -0
- package/dist/{contracts → operations}/assistant.js +2 -2
- package/dist/operations/assistant.js.map +1 -0
- package/package.json +7 -7
- package/src/index.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/contracts/assistant.d.ts +0 -245
- package/dist/contracts/assistant.d.ts.map +0 -1
- package/dist/contracts/assistant.js.map +0 -1
- package/dist/libs/contracts/dist/spec.js.map +0 -1
- /package/dist/{contracts → operations}/index.d.ts +0 -0
- /package/dist/{contracts → operations}/index.js +0 -0
- /package/src/{contracts → operations}/assistant.ts +0 -0
- /package/src/{contracts → operations}/index.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding-base.js","names":[],"sources":["../../../../../../libs/contracts/dist/onboarding-base.js"],"sourcesContent":["import { E5, x8 } from \"./schema/dist/index.js\";\nimport { defineCommand, defineQuery } from \"./
|
|
1
|
+
{"version":3,"file":"onboarding-base.js","names":[],"sources":["../../../../../../libs/contracts/dist/onboarding-base.js"],"sourcesContent":["import { E5, x8 } from \"./schema/dist/index.js\";\nimport { defineCommand, defineQuery } from \"./operation.js\";\nimport { OwnersEnum, StabilityEnum } from \"./ownership.js\";\n\n//#region src/onboarding-base.ts\n/**\n* Shared base contracts for onboarding flows across verticals.\n* These operations are reusable for any app that needs multi-step onboarding with draft persistence.\n*/\n/** Save/update onboarding draft (auto-save during flow) */\nconst SaveOnboardingDraftInput = new x8({\n\tname: \"SaveOnboardingDraftInput\",\n\tdescription: \"Input for saving onboarding draft\",\n\tfields: { data: {\n\t\ttype: E5.JSON(),\n\t\tisOptional: false\n\t} }\n});\nconst SaveOnboardingDraftOutput = new x8({\n\tname: \"SaveOnboardingDraftOutput\",\n\tdescription: \"Output for saving onboarding draft\",\n\tfields: {\n\t\tid: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\torganizationId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t}\n\t}\n});\nconst SaveOnboardingDraftBaseSpec = defineCommand({\n\tmeta: {\n\t\tname: \"base.onboarding.saveDraft\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\", \"draft\"],\n\t\tdescription: \"Save or update onboarding draft for active organization\",\n\t\tgoal: \"Persist onboarding progress incrementally for resumption and safety\",\n\t\tcontext: \"Auto-saves every few seconds during onboarding; enables users to leave and resume\"\n\t},\n\tio: {\n\t\tinput: SaveOnboardingDraftInput,\n\t\toutput: SaveOnboardingDraftOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"saveOnboardingDraft\" },\n\t\trest: { method: \"POST\" }\n\t}\n});\n/** Get current onboarding draft (on mount/restore) */\nconst GetOnboardingDraftOutput = new x8({\n\tname: \"GetOnboardingDraftOutput\",\n\tdescription: \"Onboarding draft payload\",\n\tfields: {\n\t\tid: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\torganizationId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\tdata: {\n\t\t\ttype: E5.JSON(),\n\t\t\tisOptional: true\n\t\t},\n\t\tcreatedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t},\n\t\tupdatedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst GetOnboardingDraftBaseSpec = defineQuery({\n\tmeta: {\n\t\tname: \"base.onboarding.getDraft\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\", \"draft\"],\n\t\tdescription: \"Get onboarding draft for active organization\",\n\t\tgoal: \"Retrieve saved onboarding progress\",\n\t\tcontext: \"Called on mount to restore in-progress onboarding\"\n\t},\n\tio: {\n\t\tinput: null,\n\t\toutput: GetOnboardingDraftOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"getOnboardingDraft\" },\n\t\trest: { method: \"GET\" }\n\t}\n});\n/** Delete onboarding draft (cleanup after completion or cancel) */\nconst DeleteOnboardingDraftOutput = new x8({\n\tname: \"DeleteOnboardingDraftOutput\",\n\tdescription: \"Result of delete operation\",\n\tfields: { ok: {\n\t\ttype: E5.Boolean(),\n\t\tisOptional: false\n\t} }\n});\nconst DeleteOnboardingDraftBaseSpec = defineCommand({\n\tmeta: {\n\t\tname: \"base.onboarding.deleteDraft\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\", \"draft\"],\n\t\tdescription: \"Delete onboarding draft for active organization\",\n\t\tgoal: \"Clear draft after completion or if user wants to restart\",\n\t\tcontext: \"Called after successful onboarding or explicit user reset\"\n\t},\n\tio: {\n\t\tinput: null,\n\t\toutput: DeleteOnboardingDraftOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"deleteOnboardingDraft\" },\n\t\trest: { method: \"POST\" }\n\t}\n});\n/** Complete onboarding (final submit, creates entities) */\nconst CompleteOnboardingBaseInput = new x8({\n\tname: \"CompleteOnboardingBaseInput\",\n\tdescription: \"Input for completing onboarding\",\n\tfields: { data: {\n\t\ttype: E5.JSON(),\n\t\tisOptional: false\n\t} }\n});\nconst CompleteOnboardingBaseOutput = new x8({\n\tname: \"CompleteOnboardingBaseOutput\",\n\tdescription: \"Result of onboarding completion\",\n\tfields: {\n\t\tsuccess: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: false\n\t\t},\n\t\tuserId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\torganizationId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst CompleteOnboardingBaseSpec = defineCommand({\n\tmeta: {\n\t\tname: \"base.onboarding.complete\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\"],\n\t\tdescription: \"Complete onboarding and finalize user/organization setup\",\n\t\tgoal: \"Transition from draft to active profile\",\n\t\tcontext: \"Validates all required fields, creates/updates entities, marks onboarding complete\"\n\t},\n\tio: {\n\t\tinput: CompleteOnboardingBaseInput,\n\t\toutput: CompleteOnboardingBaseOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"completeOnboarding\" },\n\t\trest: { method: \"POST\" }\n\t}\n});\n\n//#endregion\nexport { CompleteOnboardingBaseInput, CompleteOnboardingBaseOutput, CompleteOnboardingBaseSpec, DeleteOnboardingDraftBaseSpec, DeleteOnboardingDraftOutput, GetOnboardingDraftBaseSpec, GetOnboardingDraftOutput, SaveOnboardingDraftBaseSpec, SaveOnboardingDraftInput, SaveOnboardingDraftOutput };"],"mappings":";;;;;;;;;;AAUA,MAAM,2BAA2B,IAAI,GAAG;CACvC,MAAM;CACN,aAAa;CACb,Q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,QAAQ,QAAQ;EACxB;CACD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/contracts/dist/
|
|
1
|
+
//#region ../../libs/contracts/dist/operation.js
|
|
2
2
|
/**
|
|
3
3
|
* Helper to define a Command (write operation).
|
|
4
4
|
* Sets `kind: 'command'` and defaults `idempotent: false`.
|
|
@@ -32,4 +32,4 @@ const defineQuery = (spec) => ({
|
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
34
|
export { defineCommand, defineQuery };
|
|
35
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.js","names":[],"sources":["../../../../../../libs/contracts/dist/operation.js"],"sourcesContent":["//#region src/operation.ts\nconst isEmitDeclRef = (e) => \"ref\" in e;\n/**\n* Helper to define a Command (write operation).\n* Sets `kind: 'command'` and defaults `idempotent: false`.\n*/\nconst defineCommand = (spec) => ({\n\t...spec,\n\tmeta: {\n\t\t...spec.meta,\n\t\tkind: \"command\"\n\t},\n\tpolicy: {\n\t\t...spec.policy,\n\t\tidempotent: spec.policy?.[\"policy\"]?.idempotent ?? false\n\t}\n});\n/**\n* Helper to define a Query (read-only operation).\n* Sets `kind: 'query'` and forces `idempotent: true`.\n*/\nconst defineQuery = (spec) => ({\n\t...spec,\n\tmeta: {\n\t\t...spec.meta,\n\t\tkind: \"query\"\n\t},\n\tpolicy: {\n\t\t...spec.policy,\n\t\tidempotent: true\n\t}\n});\n\n//#endregion\nexport { defineCommand, defineQuery, isEmitDeclRef };"],"mappings":";;;;;AAMA,MAAM,iBAAiB,UAAU;CAChC,GAAG;CACH,MAAM;EACL,GAAG,KAAK;EACR,MAAM;EACN;CACD,QAAQ;EACP,GAAG,KAAK;EACR,YAAY,KAAK,SAAS,WAAW,cAAc;EACnD;CACD;;;;;AAKD,MAAM,eAAe,UAAU;CAC9B,GAAG;CACH,MAAM;EACL,GAAG,KAAK;EACR,MAAM;EACN;CACD,QAAQ;EACP,GAAG,KAAK;EACR,YAAY;EACZ;CACD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __esmMin } from "./_virtual/rolldown_runtime.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/dist/registry-utils.js
|
|
4
|
+
var GroupingStrategies;
|
|
5
|
+
var init_registry_utils = __esmMin(() => {
|
|
6
|
+
GroupingStrategies = {
|
|
7
|
+
byTag: (item) => item.meta.tags?.[0] ?? "untagged",
|
|
8
|
+
byAllTags: (item) => item.meta.tags?.length ? item.meta.tags : ["untagged"],
|
|
9
|
+
byOwner: (item) => item.meta.owners?.[0] ?? "unowned",
|
|
10
|
+
byDomain: (item) => {
|
|
11
|
+
return (item.meta.name ?? item.meta.key ?? "").split(".")[0] ?? "default";
|
|
12
|
+
},
|
|
13
|
+
byStability: (item) => item.meta.stability ?? "stable",
|
|
14
|
+
byUrlPath: (level) => (item) => {
|
|
15
|
+
if (!item.path) return "root";
|
|
16
|
+
return item.path.split("/").filter(Boolean).slice(0, level).join("/") || "root";
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
init_registry_utils();
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { GroupingStrategies, init_registry_utils };
|
|
24
|
+
//# sourceMappingURL=registry-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-utils.js","names":[],"sources":["../../../../../../libs/contracts/dist/registry-utils.js"],"sourcesContent":["import { __esmMin, __export } from \"./_virtual/rolldown_runtime.js\";\n\n//#region src/registry-utils.ts\nvar registry_utils_exports = /* @__PURE__ */ __export({\n\tGroupingStrategies: () => GroupingStrategies,\n\tfilterBy: () => filterBy,\n\tgetUniqueDomains: () => getUniqueDomains,\n\tgetUniqueOwners: () => getUniqueOwners,\n\tgetUniqueTags: () => getUniqueTags,\n\tgroupBy: () => groupBy,\n\tgroupByMultiple: () => groupByMultiple,\n\tgroupByToArray: () => groupByToArray\n});\n/**\n* Filter items by criteria.\n* All criteria are combined with AND logic.\n*/\nfunction filterBy(items, filter) {\n\treturn items.filter((item) => {\n\t\tif (filter.tags?.length) {\n\t\t\tif (!filter.tags.some((tag) => item.meta.tags?.includes(tag))) return false;\n\t\t}\n\t\tif (filter.owners?.length) {\n\t\t\tif (!filter.owners.some((owner) => item.meta.owners?.includes(owner))) return false;\n\t\t}\n\t\tif (filter.stability?.length) {\n\t\t\tif (!filter.stability.includes(item.meta.stability ?? \"stable\")) return false;\n\t\t}\n\t\tif (filter.domain) {\n\t\t\tif (GroupingStrategies.byDomain(item) !== filter.domain) return false;\n\t\t}\n\t\tif (filter.namePattern) {\n\t\t\tconst name = item.meta.name ?? item.meta.key ?? \"\";\n\t\t\tconst pattern = filter.namePattern.replace(/\\*/g, \".*\").replace(/\\?/g, \".\");\n\t\t\tif (!new RegExp(`^${pattern}$`, \"i\").test(name)) return false;\n\t\t}\n\t\treturn true;\n\t});\n}\n/**\n* Group items by key function.\n*/\nfunction groupBy(items, keyFn) {\n\tconst groups = /* @__PURE__ */ new Map();\n\tfor (const item of items) {\n\t\tconst key = keyFn(item);\n\t\tconst existing = groups.get(key);\n\t\tif (existing) existing.push(item);\n\t\telse groups.set(key, [item]);\n\t}\n\treturn groups;\n}\n/**\n* Group items by key function, returning array format.\n*/\nfunction groupByToArray(items, keyFn) {\n\tconst map = groupBy(items, keyFn);\n\treturn Array.from(map.entries()).map(([key, items$1]) => ({\n\t\tkey,\n\t\titems: items$1\n\t}));\n}\n/**\n* Group items where one item can belong to multiple groups.\n* Useful for byAllTags grouping.\n*/\nfunction groupByMultiple(items, keysFn) {\n\tconst groups = /* @__PURE__ */ new Map();\n\tfor (const item of items) {\n\t\tconst keys = keysFn(item);\n\t\tfor (const key of keys) {\n\t\t\tconst existing = groups.get(key);\n\t\t\tif (existing) existing.push(item);\n\t\t\telse groups.set(key, [item]);\n\t\t}\n\t}\n\treturn groups;\n}\n/**\n* Get unique tags from a collection of items.\n*/\nfunction getUniqueTags(items) {\n\tconst tags = /* @__PURE__ */ new Set();\n\tfor (const item of items) for (const tag of item.meta.tags ?? []) tags.add(tag);\n\treturn Array.from(tags).sort();\n}\n/**\n* Get unique owners from a collection of items.\n*/\nfunction getUniqueOwners(items) {\n\tconst owners = /* @__PURE__ */ new Set();\n\tfor (const item of items) for (const owner of item.meta.owners ?? []) owners.add(owner);\n\treturn Array.from(owners).sort();\n}\n/**\n* Get unique domains from a collection of items.\n*/\nfunction getUniqueDomains(items) {\n\tconst domains = /* @__PURE__ */ new Set();\n\tfor (const item of items) domains.add(GroupingStrategies.byDomain(item));\n\treturn Array.from(domains).sort();\n}\nvar GroupingStrategies;\nvar init_registry_utils = __esmMin(() => {\n\tGroupingStrategies = {\n\t\tbyTag: (item) => item.meta.tags?.[0] ?? \"untagged\",\n\t\tbyAllTags: (item) => item.meta.tags?.length ? item.meta.tags : [\"untagged\"],\n\t\tbyOwner: (item) => item.meta.owners?.[0] ?? \"unowned\",\n\t\tbyDomain: (item) => {\n\t\t\treturn (item.meta.name ?? item.meta.key ?? \"\").split(\".\")[0] ?? \"default\";\n\t\t},\n\t\tbyStability: (item) => item.meta.stability ?? \"stable\",\n\t\tbyUrlPath: (level) => (item) => {\n\t\t\tif (!item.path) return \"root\";\n\t\t\treturn item.path.split(\"/\").filter(Boolean).slice(0, level).join(\"/\") || \"root\";\n\t\t}\n\t};\n});\n\n//#endregion\ninit_registry_utils();\nexport { GroupingStrategies, filterBy, getUniqueDomains, getUniqueOwners, getUniqueTags, groupBy, groupByMultiple, groupByToArray, init_registry_utils, registry_utils_exports };"],"mappings":";;;AAsGA,IAAI;AACJ,IAAI,sBAAsB,eAAe;AACxC,sBAAqB;EACpB,QAAQ,SAAS,KAAK,KAAK,OAAO,MAAM;EACxC,YAAY,SAAS,KAAK,KAAK,MAAM,SAAS,KAAK,KAAK,OAAO,CAAC,WAAW;EAC3E,UAAU,SAAS,KAAK,KAAK,SAAS,MAAM;EAC5C,WAAW,SAAS;AACnB,WAAQ,KAAK,KAAK,QAAQ,KAAK,KAAK,OAAO,IAAI,MAAM,IAAI,CAAC,MAAM;;EAEjE,cAAc,SAAS,KAAK,KAAK,aAAa;EAC9C,YAAY,WAAW,SAAS;AAC/B,OAAI,CAAC,KAAK,KAAM,QAAO;AACvB,UAAO,KAAK,KAAK,MAAM,IAAI,CAAC,OAAO,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,IAAI,IAAI;;EAE1E;EACA;AAGF,qBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../registry-utils.js";
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import * as z$1 from "zod";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/dist/workspace-config/contractsrc-schema.js
|
|
4
|
+
/**
|
|
5
|
+
* ContractSpec configuration schema definitions.
|
|
6
|
+
*
|
|
7
|
+
* These schemas define the structure of .contractsrc.json files
|
|
8
|
+
* and are shared across CLI tools and libraries.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* OpenAPI source configuration for import/sync/validate operations.
|
|
12
|
+
*/
|
|
13
|
+
const OpenApiSourceConfigSchema = z$1.object({
|
|
14
|
+
name: z$1.string(),
|
|
15
|
+
url: z$1.url().optional(),
|
|
16
|
+
file: z$1.string().optional(),
|
|
17
|
+
syncMode: z$1.enum([
|
|
18
|
+
"import",
|
|
19
|
+
"sync",
|
|
20
|
+
"validate"
|
|
21
|
+
]).default("validate"),
|
|
22
|
+
tags: z$1.array(z$1.string()).optional(),
|
|
23
|
+
exclude: z$1.array(z$1.string()).optional(),
|
|
24
|
+
include: z$1.array(z$1.string()).optional(),
|
|
25
|
+
prefix: z$1.string().optional(),
|
|
26
|
+
defaultStability: z$1.enum([
|
|
27
|
+
"experimental",
|
|
28
|
+
"beta",
|
|
29
|
+
"stable",
|
|
30
|
+
"deprecated"
|
|
31
|
+
]).optional(),
|
|
32
|
+
defaultAuth: z$1.enum([
|
|
33
|
+
"anonymous",
|
|
34
|
+
"user",
|
|
35
|
+
"admin"
|
|
36
|
+
]).optional(),
|
|
37
|
+
defaultOwners: z$1.array(z$1.string()).optional()
|
|
38
|
+
});
|
|
39
|
+
const OpenApiExportConfigSchema = z$1.object({
|
|
40
|
+
outputPath: z$1.string().default("./openapi.json"),
|
|
41
|
+
format: z$1.enum(["json", "yaml"]).default("json"),
|
|
42
|
+
title: z$1.string().optional(),
|
|
43
|
+
version: z$1.string().optional(),
|
|
44
|
+
description: z$1.string().optional(),
|
|
45
|
+
servers: z$1.array(z$1.object({
|
|
46
|
+
url: z$1.string(),
|
|
47
|
+
description: z$1.string().optional()
|
|
48
|
+
})).optional()
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* OpenAPI configuration section.
|
|
52
|
+
*/
|
|
53
|
+
const OpenApiConfigSchema = z$1.object({
|
|
54
|
+
sources: z$1.array(OpenApiSourceConfigSchema).optional(),
|
|
55
|
+
export: OpenApiExportConfigSchema.optional()
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Grouping strategy for organizing specs.
|
|
59
|
+
*/
|
|
60
|
+
const GroupingStrategySchema = z$1.enum([
|
|
61
|
+
"by-tag",
|
|
62
|
+
"by-owner",
|
|
63
|
+
"by-domain",
|
|
64
|
+
"by-url-path-single",
|
|
65
|
+
"by-url-path-multi",
|
|
66
|
+
"by-feature",
|
|
67
|
+
"none"
|
|
68
|
+
]);
|
|
69
|
+
/**
|
|
70
|
+
* Grouping rule configuration.
|
|
71
|
+
*/
|
|
72
|
+
const GroupingRuleSchema = z$1.object({
|
|
73
|
+
strategy: GroupingStrategySchema,
|
|
74
|
+
urlPathLevel: z$1.number().optional(),
|
|
75
|
+
pattern: z$1.string().optional()
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* Output directory conventions for generated specs.
|
|
79
|
+
*/
|
|
80
|
+
const FolderConventionsSchema = z$1.object({
|
|
81
|
+
models: z$1.string().default("models"),
|
|
82
|
+
operations: z$1.string().default("operations/commands|queries"),
|
|
83
|
+
events: z$1.string().default("events"),
|
|
84
|
+
presentations: z$1.string().default("presentations"),
|
|
85
|
+
forms: z$1.string().default("forms"),
|
|
86
|
+
groupByFeature: z$1.boolean().default(true),
|
|
87
|
+
operationsGrouping: GroupingRuleSchema.optional(),
|
|
88
|
+
modelsGrouping: GroupingRuleSchema.optional(),
|
|
89
|
+
eventsGrouping: GroupingRuleSchema.optional()
|
|
90
|
+
});
|
|
91
|
+
/**
|
|
92
|
+
* Full ContractSpec configuration schema (.contractsrc.json).
|
|
93
|
+
*/
|
|
94
|
+
const ContractsrcSchema = z$1.object({
|
|
95
|
+
aiProvider: z$1.enum([
|
|
96
|
+
"claude",
|
|
97
|
+
"openai",
|
|
98
|
+
"ollama",
|
|
99
|
+
"custom"
|
|
100
|
+
]).default("claude"),
|
|
101
|
+
aiModel: z$1.string().optional(),
|
|
102
|
+
agentMode: z$1.enum([
|
|
103
|
+
"simple",
|
|
104
|
+
"cursor",
|
|
105
|
+
"claude-code",
|
|
106
|
+
"openai-codex"
|
|
107
|
+
]).default("simple"),
|
|
108
|
+
customEndpoint: z$1.url().nullable().optional(),
|
|
109
|
+
customApiKey: z$1.string().nullable().optional(),
|
|
110
|
+
outputDir: z$1.string().default("./src"),
|
|
111
|
+
conventions: FolderConventionsSchema,
|
|
112
|
+
defaultOwners: z$1.array(z$1.string()).default([]),
|
|
113
|
+
defaultTags: z$1.array(z$1.string()).default([]),
|
|
114
|
+
packages: z$1.array(z$1.string()).optional(),
|
|
115
|
+
excludePackages: z$1.array(z$1.string()).optional(),
|
|
116
|
+
recursive: z$1.boolean().optional(),
|
|
117
|
+
openapi: OpenApiConfigSchema.optional()
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
export { FolderConventionsSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema };
|
|
122
|
+
//# sourceMappingURL=contractsrc-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractsrc-schema.js","names":[],"sources":["../../../../../../../libs/contracts/dist/workspace-config/contractsrc-schema.js"],"sourcesContent":["import * as z$1 from \"zod\";\n\n//#region src/workspace-config/contractsrc-schema.ts\n/**\n* ContractSpec configuration schema definitions.\n*\n* These schemas define the structure of .contractsrc.json files\n* and are shared across CLI tools and libraries.\n*/\n/**\n* OpenAPI source configuration for import/sync/validate operations.\n*/\nconst OpenApiSourceConfigSchema = z$1.object({\n\tname: z$1.string(),\n\turl: z$1.url().optional(),\n\tfile: z$1.string().optional(),\n\tsyncMode: z$1.enum([\n\t\t\"import\",\n\t\t\"sync\",\n\t\t\"validate\"\n\t]).default(\"validate\"),\n\ttags: z$1.array(z$1.string()).optional(),\n\texclude: z$1.array(z$1.string()).optional(),\n\tinclude: z$1.array(z$1.string()).optional(),\n\tprefix: z$1.string().optional(),\n\tdefaultStability: z$1.enum([\n\t\t\"experimental\",\n\t\t\"beta\",\n\t\t\"stable\",\n\t\t\"deprecated\"\n\t]).optional(),\n\tdefaultAuth: z$1.enum([\n\t\t\"anonymous\",\n\t\t\"user\",\n\t\t\"admin\"\n\t]).optional(),\n\tdefaultOwners: z$1.array(z$1.string()).optional()\n});\nconst OpenApiExportConfigSchema = z$1.object({\n\toutputPath: z$1.string().default(\"./openapi.json\"),\n\tformat: z$1.enum([\"json\", \"yaml\"]).default(\"json\"),\n\ttitle: z$1.string().optional(),\n\tversion: z$1.string().optional(),\n\tdescription: z$1.string().optional(),\n\tservers: z$1.array(z$1.object({\n\t\turl: z$1.string(),\n\t\tdescription: z$1.string().optional()\n\t})).optional()\n});\n/**\n* OpenAPI configuration section.\n*/\nconst OpenApiConfigSchema = z$1.object({\n\tsources: z$1.array(OpenApiSourceConfigSchema).optional(),\n\texport: OpenApiExportConfigSchema.optional()\n});\n/**\n* Grouping strategy for organizing specs.\n*/\nconst GroupingStrategySchema = z$1.enum([\n\t\"by-tag\",\n\t\"by-owner\",\n\t\"by-domain\",\n\t\"by-url-path-single\",\n\t\"by-url-path-multi\",\n\t\"by-feature\",\n\t\"none\"\n]);\n/**\n* Grouping rule configuration.\n*/\nconst GroupingRuleSchema = z$1.object({\n\tstrategy: GroupingStrategySchema,\n\turlPathLevel: z$1.number().optional(),\n\tpattern: z$1.string().optional()\n});\n/**\n* Output directory conventions for generated specs.\n*/\nconst FolderConventionsSchema = z$1.object({\n\tmodels: z$1.string().default(\"models\"),\n\toperations: z$1.string().default(\"operations/commands|queries\"),\n\tevents: z$1.string().default(\"events\"),\n\tpresentations: z$1.string().default(\"presentations\"),\n\tforms: z$1.string().default(\"forms\"),\n\tgroupByFeature: z$1.boolean().default(true),\n\toperationsGrouping: GroupingRuleSchema.optional(),\n\tmodelsGrouping: GroupingRuleSchema.optional(),\n\teventsGrouping: GroupingRuleSchema.optional()\n});\n/**\n* Full ContractSpec configuration schema (.contractsrc.json).\n*/\nconst ContractsrcSchema = z$1.object({\n\taiProvider: z$1.enum([\n\t\t\"claude\",\n\t\t\"openai\",\n\t\t\"ollama\",\n\t\t\"custom\"\n\t]).default(\"claude\"),\n\taiModel: z$1.string().optional(),\n\tagentMode: z$1.enum([\n\t\t\"simple\",\n\t\t\"cursor\",\n\t\t\"claude-code\",\n\t\t\"openai-codex\"\n\t]).default(\"simple\"),\n\tcustomEndpoint: z$1.url().nullable().optional(),\n\tcustomApiKey: z$1.string().nullable().optional(),\n\toutputDir: z$1.string().default(\"./src\"),\n\tconventions: FolderConventionsSchema,\n\tdefaultOwners: z$1.array(z$1.string()).default([]),\n\tdefaultTags: z$1.array(z$1.string()).default([]),\n\tpackages: z$1.array(z$1.string()).optional(),\n\texcludePackages: z$1.array(z$1.string()).optional(),\n\trecursive: z$1.boolean().optional(),\n\topenapi: OpenApiConfigSchema.optional()\n});\n/**\n* Default configuration values.\n*/\nconst DEFAULT_CONTRACTSRC = {\n\taiProvider: \"claude\",\n\tagentMode: \"simple\",\n\toutputDir: \"./src\",\n\tconventions: {\n\t\tmodels: \"models\",\n\t\toperations: \"interactions/commands|queries\",\n\t\tevents: \"events\",\n\t\tpresentations: \"presentations\",\n\t\tforms: \"forms\",\n\t\tgroupByFeature: true\n\t},\n\tdefaultOwners: [],\n\tdefaultTags: []\n};\n\n//#endregion\nexport { ContractsrcSchema, DEFAULT_CONTRACTSRC, FolderConventionsSchema, GroupingRuleSchema, GroupingStrategySchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema };"],"mappings":";;;;;;;;;;;;AAYA,MAAM,4BAA4B,IAAI,OAAO;CAC5C,MAAM,IAAI,QAAQ;CAClB,KAAK,IAAI,KAAK,CAAC,UAAU;CACzB,MAAM,IAAI,QAAQ,CAAC,UAAU;CAC7B,UAAU,IAAI,KAAK;EAClB;EACA;EACA;EACA,CAAC,CAAC,QAAQ,WAAW;CACtB,MAAM,IAAI,MAAM,IAAI,QAAQ,CAAC,CAAC,UAAU;CACxC,SAAS,IAAI,MAAM,IAAI,QAAQ,CAAC,CAAC,UAAU;CAC3C,SAAS,IAAI,MAAM,IAAI,QAAQ,CAAC,CAAC,UAAU;CAC3C,QAAQ,IAAI,QAAQ,CAAC,UAAU;CAC/B,kBAAkB,IAAI,KAAK;EAC1B;EACA;EACA;EACA;EACA,CAAC,CAAC,UAAU;CACb,aAAa,IAAI,KAAK;EACrB;EACA;EACA;EACA,CAAC,CAAC,UAAU;CACb,eAAe,IAAI,MAAM,IAAI,QAAQ,CAAC,CAAC,UAAU;CACjD,CAAC;AACF,MAAM,4BAA4B,IAAI,OAAO;CAC5C,YAAY,IAAI,QAAQ,CAAC,QAAQ,iBAAiB;CAClD,QAAQ,IAAI,KAAK,CAAC,QAAQ,OAAO,CAAC,CAAC,QAAQ,OAAO;CAClD,OAAO,IAAI,QAAQ,CAAC,UAAU;CAC9B,SAAS,IAAI,QAAQ,CAAC,UAAU;CAChC,aAAa,IAAI,QAAQ,CAAC,UAAU;CACpC,SAAS,IAAI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,QAAQ,QAAQ;CACxC,aAAa;CACb,eAAe,IAAI,MAAM,IAAI,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;CAClD,aAAa,IAAI,MAAM,IAAI,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;CAChD,UAAU,IAAI,MAAM,IAAI,QAAQ,CAAC,CAAC,UAAU;CAC5C,iBAAiB,IAAI,MAAM,IAAI,QAAQ,CAAC,CAAC,UAAU;CACnD,WAAW,IAAI,SAAS,CAAC,UAAU;CACnC,SAAS,oBAAoB,UAAU;CACvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { FolderConventionsSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema } from "./contractsrc-schema.js";
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import * as _lssm_lib_schema63 from "@lssm/lib.schema";
|
|
2
|
+
import * as _lssm_lib_contracts2 from "@lssm/lib.contracts";
|
|
3
|
+
|
|
4
|
+
//#region src/operations/assistant.d.ts
|
|
5
|
+
declare const AssistantAnswerContract: _lssm_lib_contracts2.OperationSpec<_lssm_lib_schema63.SchemaModel<{
|
|
6
|
+
envelope: {
|
|
7
|
+
type: _lssm_lib_schema63.SchemaModel<{
|
|
8
|
+
traceId: {
|
|
9
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
10
|
+
isOptional: false;
|
|
11
|
+
};
|
|
12
|
+
locale: {
|
|
13
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
14
|
+
isOptional: false;
|
|
15
|
+
};
|
|
16
|
+
regulatoryContext: {
|
|
17
|
+
type: _lssm_lib_schema63.SchemaModel<{
|
|
18
|
+
jurisdiction: {
|
|
19
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
20
|
+
isOptional: false;
|
|
21
|
+
};
|
|
22
|
+
region: {
|
|
23
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
24
|
+
isOptional: true;
|
|
25
|
+
};
|
|
26
|
+
clientType: {
|
|
27
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
28
|
+
isOptional: true;
|
|
29
|
+
};
|
|
30
|
+
allowedScope: {
|
|
31
|
+
type: _lssm_lib_schema63.EnumType<[string, string, string]>;
|
|
32
|
+
isOptional: false;
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
isOptional: false;
|
|
36
|
+
};
|
|
37
|
+
kbSnapshotId: {
|
|
38
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
39
|
+
isOptional: false;
|
|
40
|
+
};
|
|
41
|
+
allowedScope: {
|
|
42
|
+
type: _lssm_lib_schema63.EnumType<[string, string, string]>;
|
|
43
|
+
isOptional: false;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
isOptional: false;
|
|
47
|
+
};
|
|
48
|
+
question: {
|
|
49
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
50
|
+
isOptional: false;
|
|
51
|
+
};
|
|
52
|
+
}>, _lssm_lib_schema63.SchemaModel<{
|
|
53
|
+
locale: {
|
|
54
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
55
|
+
isOptional: false;
|
|
56
|
+
};
|
|
57
|
+
jurisdiction: {
|
|
58
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
59
|
+
isOptional: false;
|
|
60
|
+
};
|
|
61
|
+
allowedScope: {
|
|
62
|
+
type: _lssm_lib_schema63.EnumType<[string, string, string]>;
|
|
63
|
+
isOptional: false;
|
|
64
|
+
};
|
|
65
|
+
sections: {
|
|
66
|
+
type: _lssm_lib_schema63.SchemaModel<{
|
|
67
|
+
heading: {
|
|
68
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
69
|
+
isOptional: false;
|
|
70
|
+
};
|
|
71
|
+
body: {
|
|
72
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
73
|
+
isOptional: false;
|
|
74
|
+
};
|
|
75
|
+
}>;
|
|
76
|
+
isArray: true;
|
|
77
|
+
isOptional: false;
|
|
78
|
+
};
|
|
79
|
+
citations: {
|
|
80
|
+
type: _lssm_lib_schema63.SchemaModel<{
|
|
81
|
+
kbSnapshotId: {
|
|
82
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
83
|
+
isOptional: false;
|
|
84
|
+
};
|
|
85
|
+
sourceType: {
|
|
86
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
87
|
+
isOptional: false;
|
|
88
|
+
};
|
|
89
|
+
sourceId: {
|
|
90
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
91
|
+
isOptional: false;
|
|
92
|
+
};
|
|
93
|
+
title: {
|
|
94
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
95
|
+
isOptional: true;
|
|
96
|
+
};
|
|
97
|
+
excerpt: {
|
|
98
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
99
|
+
isOptional: true;
|
|
100
|
+
};
|
|
101
|
+
}>;
|
|
102
|
+
isArray: true;
|
|
103
|
+
isOptional: false;
|
|
104
|
+
};
|
|
105
|
+
disclaimers: {
|
|
106
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
107
|
+
isArray: true;
|
|
108
|
+
isOptional: true;
|
|
109
|
+
};
|
|
110
|
+
riskFlags: {
|
|
111
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
112
|
+
isArray: true;
|
|
113
|
+
isOptional: true;
|
|
114
|
+
};
|
|
115
|
+
refused: {
|
|
116
|
+
type: _lssm_lib_schema63.FieldType<boolean, boolean>;
|
|
117
|
+
isOptional: true;
|
|
118
|
+
};
|
|
119
|
+
refusalReason: {
|
|
120
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
121
|
+
isOptional: true;
|
|
122
|
+
};
|
|
123
|
+
}>, undefined>;
|
|
124
|
+
declare const AssistantExplainConceptContract: _lssm_lib_contracts2.OperationSpec<_lssm_lib_schema63.SchemaModel<{
|
|
125
|
+
envelope: {
|
|
126
|
+
type: _lssm_lib_schema63.SchemaModel<{
|
|
127
|
+
traceId: {
|
|
128
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
129
|
+
isOptional: false;
|
|
130
|
+
};
|
|
131
|
+
locale: {
|
|
132
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
133
|
+
isOptional: false;
|
|
134
|
+
};
|
|
135
|
+
regulatoryContext: {
|
|
136
|
+
type: _lssm_lib_schema63.SchemaModel<{
|
|
137
|
+
jurisdiction: {
|
|
138
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
139
|
+
isOptional: false;
|
|
140
|
+
};
|
|
141
|
+
region: {
|
|
142
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
143
|
+
isOptional: true;
|
|
144
|
+
};
|
|
145
|
+
clientType: {
|
|
146
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
147
|
+
isOptional: true;
|
|
148
|
+
};
|
|
149
|
+
allowedScope: {
|
|
150
|
+
type: _lssm_lib_schema63.EnumType<[string, string, string]>;
|
|
151
|
+
isOptional: false;
|
|
152
|
+
};
|
|
153
|
+
}>;
|
|
154
|
+
isOptional: false;
|
|
155
|
+
};
|
|
156
|
+
kbSnapshotId: {
|
|
157
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
158
|
+
isOptional: false;
|
|
159
|
+
};
|
|
160
|
+
allowedScope: {
|
|
161
|
+
type: _lssm_lib_schema63.EnumType<[string, string, string]>;
|
|
162
|
+
isOptional: false;
|
|
163
|
+
};
|
|
164
|
+
}>;
|
|
165
|
+
isOptional: false;
|
|
166
|
+
};
|
|
167
|
+
conceptKey: {
|
|
168
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
169
|
+
isOptional: false;
|
|
170
|
+
};
|
|
171
|
+
}>, _lssm_lib_schema63.SchemaModel<{
|
|
172
|
+
locale: {
|
|
173
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
174
|
+
isOptional: false;
|
|
175
|
+
};
|
|
176
|
+
jurisdiction: {
|
|
177
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
178
|
+
isOptional: false;
|
|
179
|
+
};
|
|
180
|
+
allowedScope: {
|
|
181
|
+
type: _lssm_lib_schema63.EnumType<[string, string, string]>;
|
|
182
|
+
isOptional: false;
|
|
183
|
+
};
|
|
184
|
+
sections: {
|
|
185
|
+
type: _lssm_lib_schema63.SchemaModel<{
|
|
186
|
+
heading: {
|
|
187
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
188
|
+
isOptional: false;
|
|
189
|
+
};
|
|
190
|
+
body: {
|
|
191
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
192
|
+
isOptional: false;
|
|
193
|
+
};
|
|
194
|
+
}>;
|
|
195
|
+
isArray: true;
|
|
196
|
+
isOptional: false;
|
|
197
|
+
};
|
|
198
|
+
citations: {
|
|
199
|
+
type: _lssm_lib_schema63.SchemaModel<{
|
|
200
|
+
kbSnapshotId: {
|
|
201
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
202
|
+
isOptional: false;
|
|
203
|
+
};
|
|
204
|
+
sourceType: {
|
|
205
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
206
|
+
isOptional: false;
|
|
207
|
+
};
|
|
208
|
+
sourceId: {
|
|
209
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
210
|
+
isOptional: false;
|
|
211
|
+
};
|
|
212
|
+
title: {
|
|
213
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
214
|
+
isOptional: true;
|
|
215
|
+
};
|
|
216
|
+
excerpt: {
|
|
217
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
218
|
+
isOptional: true;
|
|
219
|
+
};
|
|
220
|
+
}>;
|
|
221
|
+
isArray: true;
|
|
222
|
+
isOptional: false;
|
|
223
|
+
};
|
|
224
|
+
disclaimers: {
|
|
225
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
226
|
+
isArray: true;
|
|
227
|
+
isOptional: true;
|
|
228
|
+
};
|
|
229
|
+
riskFlags: {
|
|
230
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
231
|
+
isArray: true;
|
|
232
|
+
isOptional: true;
|
|
233
|
+
};
|
|
234
|
+
refused: {
|
|
235
|
+
type: _lssm_lib_schema63.FieldType<boolean, boolean>;
|
|
236
|
+
isOptional: true;
|
|
237
|
+
};
|
|
238
|
+
refusalReason: {
|
|
239
|
+
type: _lssm_lib_schema63.FieldType<string, string>;
|
|
240
|
+
isOptional: true;
|
|
241
|
+
};
|
|
242
|
+
}>, undefined>;
|
|
243
|
+
//#endregion
|
|
244
|
+
export { AssistantAnswerContract, AssistantExplainConceptContract };
|
|
245
|
+
//# sourceMappingURL=assistant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant.d.ts","names":[],"sources":["../../src/operations/assistant.ts"],"sourcesContent":[],"mappings":";;;;cA0Ba,8CAAuB,iCAAA;;;;QAAvB,IAAA,EAmDX,kBAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,KAAA;;;;;;;;;;;UAnDkC,CAAA;UAAA,MAAA,EAAA;;;;;;;;;;;;;;;;;kBAAA,EAAA,KAAA;MAAA,CAAA;MAqDvB,YAAA,EAAA;QAkBX,IAAA,6BAAA,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;;;;;;;;;;;;IAlB0C,IAAA,EArDR,kBAAA,CAAA,SAqDQ,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;QAAA,IAAA,8BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA/B,sDAA+B,iCAAA;;;;cAkB1C,kBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAlB0C,kBAAA,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineCommand } from "../libs/contracts/dist/
|
|
1
|
+
import { defineCommand } from "../libs/contracts/dist/operation.js";
|
|
2
2
|
import "../libs/contracts/dist/index.js";
|
|
3
3
|
import { E5, K5 } from "../libs/schema/dist/index.js";
|
|
4
4
|
import { AssistantAnswerIRModel, LLMCallEnvelopeModel } from "../entities/models.js";
|
|
5
5
|
|
|
6
|
-
//#region src/
|
|
6
|
+
//#region src/operations/assistant.ts
|
|
7
7
|
const AssistantQuestionInput = K5({
|
|
8
8
|
name: "AssistantQuestionInput",
|
|
9
9
|
description: "Input for assistant calls with mandatory envelope.",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant.js","names":["defineSchemaModel","ScalarTypeEnum"],"sources":["../../src/operations/assistant.ts"],"sourcesContent":["import { defineCommand } from '@lssm/lib.contracts';\nimport { ScalarTypeEnum, defineSchemaModel } from '@lssm/lib.schema';\n\nimport {\n AssistantAnswerIRModel,\n LLMCallEnvelopeModel,\n} from '../entities/models';\n\nconst AssistantQuestionInput = defineSchemaModel({\n name: 'AssistantQuestionInput',\n description: 'Input for assistant calls with mandatory envelope.',\n fields: {\n envelope: { type: LLMCallEnvelopeModel, isOptional: false },\n question: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst AssistantConceptInput = defineSchemaModel({\n name: 'AssistantConceptInput',\n description: 'Input for explaining a concept with mandatory envelope.',\n fields: {\n envelope: { type: LLMCallEnvelopeModel, isOptional: false },\n conceptKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const AssistantAnswerContract = defineCommand({\n meta: {\n name: 'assistant.answer',\n version: 1,\n stability: 'experimental',\n owners: ['examples'],\n tags: ['assistant', 'policy', 'locale', 'jurisdiction', 'knowledge'],\n description:\n 'Answer a user question using a KB snapshot with strict locale/jurisdiction gating.',\n goal: 'Provide policy-safe answers that cite a KB snapshot or refuse.',\n context:\n 'Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing.',\n },\n io: {\n input: AssistantQuestionInput,\n output: AssistantAnswerIRModel,\n errors: {\n LOCALE_REQUIRED: {\n description: 'Locale is required and must be supported',\n http: 400,\n gqlCode: 'LOCALE_REQUIRED',\n when: 'locale is missing or unsupported',\n },\n JURISDICTION_REQUIRED: {\n description: 'Jurisdiction is required',\n http: 400,\n gqlCode: 'JURISDICTION_REQUIRED',\n when: 'jurisdiction is missing',\n },\n KB_SNAPSHOT_REQUIRED: {\n description: 'KB snapshot id is required',\n http: 400,\n gqlCode: 'KB_SNAPSHOT_REQUIRED',\n when: 'kbSnapshotId is missing',\n },\n CITATIONS_REQUIRED: {\n description: 'Answers must include citations to a KB snapshot',\n http: 422,\n gqlCode: 'CITATIONS_REQUIRED',\n when: 'answer has no citations',\n },\n SCOPE_VIOLATION: {\n description:\n 'Answer violates allowed scope and must be refused/escalated',\n http: 403,\n gqlCode: 'SCOPE_VIOLATION',\n when: 'output includes forbidden content under the given allowedScope',\n },\n },\n },\n policy: { auth: 'user' },\n});\n\nexport const AssistantExplainConceptContract = defineCommand({\n meta: {\n name: 'assistant.explainConcept',\n version: 1,\n stability: 'experimental',\n owners: ['examples'],\n tags: ['assistant', 'policy', 'knowledge', 'concepts'],\n description:\n 'Explain a concept using a KB snapshot with strict locale/jurisdiction gating.',\n goal: 'Explain concepts with citations or refuse.',\n context: 'Same constraints as assistant.answer.',\n },\n io: {\n input: AssistantConceptInput,\n output: AssistantAnswerIRModel,\n errors: AssistantAnswerContract.io.errors,\n },\n policy: { auth: 'user' },\n});\n"],"mappings":";;;;;;AAQA,MAAM,yBAAyBA,GAAkB;CAC/C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM;GAAsB,YAAY;GAAO;EAC3D,UAAU;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE;CACF,CAAC;AAEF,MAAM,wBAAwBD,GAAkB;CAC9C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM;GAAsB,YAAY;GAAO;EAC3D,YAAY;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E;CACF,CAAC;AAEF,MAAa,0BAA0B,cAAc;CACnD,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,WAAW;EACpB,MAAM;GAAC;GAAa;GAAU;GAAU;GAAgB;GAAY;EACpE,aACE;EACF,MAAM;EACN,SACE;EACH;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACR,QAAQ;GACN,iBAAiB;IACf,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,uBAAuB;IACrB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,sBAAsB;IACpB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,oBAAoB;IAClB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,iBAAiB;IACf,aACE;IACF,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACF;EACF;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC;AAEF,MAAa,kCAAkC,cAAc;CAC3D,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,WAAW;EACpB,MAAM;GAAC;GAAa;GAAU;GAAa;GAAW;EACtD,aACE;EACF,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACR,QAAQ,wBAAwB,GAAG;EACpC;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/example.locale-jurisdiction-gate",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251221132705",
|
|
4
4
|
"description": "Example: enforce locale + jurisdiction + kbSnapshotId + allowed scope for assistant calls (fail-closed).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": "./dist/index.js",
|
|
11
|
-
"./contracts": "./dist/contracts/index.js",
|
|
12
|
-
"./contracts/assistant": "./dist/contracts/assistant.js",
|
|
13
11
|
"./docs": "./dist/docs/index.js",
|
|
14
12
|
"./docs/locale-jurisdiction-gate.docblock": "./dist/docs/locale-jurisdiction-gate.docblock.js",
|
|
15
13
|
"./entities": "./dist/entities/index.js",
|
|
@@ -19,6 +17,8 @@
|
|
|
19
17
|
"./handlers": "./dist/handlers/index.js",
|
|
20
18
|
"./handlers/demo.handlers": "./dist/handlers/demo.handlers.js",
|
|
21
19
|
"./locale-jurisdiction-gate.feature": "./dist/locale-jurisdiction-gate.feature.js",
|
|
20
|
+
"./operations": "./dist/operations/index.js",
|
|
21
|
+
"./operations/assistant": "./dist/operations/assistant.js",
|
|
22
22
|
"./policy": "./dist/policy/index.js",
|
|
23
23
|
"./policy/guard": "./dist/policy/guard.js",
|
|
24
24
|
"./policy/types": "./dist/policy/types.js",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"test": "bun test"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@lssm/lib.contracts": "0.0.0-canary-
|
|
42
|
-
"@lssm/lib.schema": "0.0.0-canary-
|
|
41
|
+
"@lssm/lib.contracts": "0.0.0-canary-20251221132705",
|
|
42
|
+
"@lssm/lib.schema": "0.0.0-canary-20251221132705",
|
|
43
43
|
"zod": "^4.1.13"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
47
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
46
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251221132705",
|
|
47
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251221132705",
|
|
48
48
|
"tsdown": "^0.18.1",
|
|
49
49
|
"typescript": "^5.9.3"
|
|
50
50
|
},
|
package/src/index.ts
CHANGED