@aiquants/governance-core 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AI Quants
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # `@aiquants/governance-core`
2
+
3
+ Enterprise Knowledge Governance Core: Canonical Schemas, Merkle Proof Verification, Dry-Run Simulation, and API Client SDK.
4
+
5
+ ## 概要
6
+
7
+ 本パッケージは、エンタープライズ・ナレッジガバナンス基盤における TypeScript 正準スキーマ、暗号学的マークル引用完全証明 (`CitationProof`) のクライアント検証エンジン、および Python FastAPI バックエンドへの API クライアント SDK (`GovernanceClient`, `GovernanceAdminClient`) を提供する共有ライブラリです。
8
+
9
+ ## 主な機能
10
+
11
+ - **正準 Zod スキーマ & 型定義**: ガバナンス検索、規程調停回答、意思決定系譜、プロンプト・オントロジー変更ドライランシミュレーション、ナレッジグラフ探索。
12
+ - **暗号学的マークル引用完全証明 (Client-Side Verification)**: SHA-256 プレフィックス付き二分木に基づく Merkle Root の決定論的再計算・照合検証。
13
+ - **型安全な API クライアント SDK**:
14
+ - `GovernanceClient`: ガバナンス検索 (`/ai/governance/search`)、規程回答 (`/ai/governance/answer`)。
15
+ - `GovernanceAdminClient`: ドライラン評価 (`/ai/governance/simulate`)、システムパラメータ・機能フラグ・プロンプトテンプレート管理、ナレッジグラフ探索。
16
+ - **厳格な No-Fallback & SSOT 方針**: 暗黙のフォールバック値や曖昧な型キャストを完全排除。
17
+
18
+ ## インストール
19
+
20
+ ```bash
21
+ pnpm add @aiquants/governance-core
22
+ ```
23
+
24
+ ## クイックスタート (Quick Start)
25
+
26
+ ### 1. ガバナンス検索と規程回答
27
+
28
+ ```typescript
29
+ import { GovernanceClient } from "@aiquants/governance-core"
30
+
31
+ const client = new GovernanceClient({
32
+ baseUrl: "https://api.example.com",
33
+ apiKey: process.env.QUANTS_API_KEY,
34
+ })
35
+
36
+ // 規程統合検索
37
+ const searchResult = await client.search({ query: "就業規則 育児休業" }, "sanwa")
38
+ console.log(searchResult.hits)
39
+
40
+ // 権威性連動規程回答
41
+ const answerResult = await client.answer({ question: "育児休業の申請期限は何日前ですか?" }, "sanwa")
42
+ console.log(answerResult.answer)
43
+
44
+ // マークル引用完全証明のクライアント側独立検証
45
+ if (answerResult.citationProof) {
46
+ const isValid = client.verifyCitationProof(answerResult.citationProof, {
47
+ expectedTenantId: "sanwa",
48
+ expectedCitations: answerResult.verifiedCitations,
49
+ })
50
+ console.log(`Citation proof verified: ${isValid}`)
51
+ }
52
+ ```
53
+
54
+ ### 2. 管理コンソール・ドライラン事前シミュレーション
55
+
56
+ ```typescript
57
+ import { GovernanceAdminClient } from "@aiquants/governance-core"
58
+
59
+ const adminClient = new GovernanceAdminClient({
60
+ baseUrl: "https://api.example.com",
61
+ apiKey: process.env.QUANTS_API_KEY,
62
+ })
63
+
64
+ // プロンプト変更ドライラン評価
65
+ const simResult = await adminClient.simulate(
66
+ {
67
+ promptOverrides: {
68
+ DEFAULT_POLICY_QA: "改訂プロンプトテンプレート...",
69
+ },
70
+ intentTypes: ["SET", "DIFF"],
71
+ },
72
+ "sanwa",
73
+ )
74
+ console.log(`Delta groundedness: ${simResult.delta.groundedness}`)
75
+ ```
76
+
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";var B=Object.defineProperty;var Ce=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Te=Object.prototype.hasOwnProperty;var Ue=(r,t)=>{for(var a in t)B(r,a,{get:t[a],enumerable:!0})},Ge=(r,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ee(t))!Te.call(r,o)&&o!==a&&B(r,o,{get:()=>t[o],enumerable:!(i=Ce(t,o))||i.enumerable});return r};var we=r=>Ge(B({},"__esModule",{value:!0}),r);var Fe={};Ue(Fe,{AuthoritativeSourceSchema:()=>V,AuthorityTierSchema:()=>L,BaseGovernanceClient:()=>C,CLOUD_CAPABLE_CAPABILITIES:()=>qe,CitationProofLeafSchema:()=>ue,CitationProofSchema:()=>fe,ConfidentialityCapabilityPolicyDtoSchema:()=>Oe,ConfidentialityLevelSchema:()=>D.ConfidentialityLevelSchema,FeatureFlagKeySchema:()=>oe,FileUriSchema:()=>f.FileUriSchema,GovernanceAdminClient:()=>re,GovernanceAnswerRequestSchema:()=>X,GovernanceAnswerResponseSchema:()=>W,GovernanceClient:()=>ne,GovernanceClientError:()=>b,GovernanceSearchHitSchema:()=>le,GovernanceSearchMetadataSchema:()=>_,GovernanceSearchRequestSchema:()=>$,GovernanceSearchResponseSchema:()=>J,GovernanceSearchSnippetSchema:()=>se,GovernanceSimulateCaseDiffSchema:()=>K,GovernanceSimulateCaseScoresSchema:()=>N,GovernanceSimulateRequestSchema:()=>Y,GovernanceSimulateResponseSchema:()=>Q,GovernanceSimulateScoresSchema:()=>q,GovernedCapabilitySchema:()=>ge,JsonPrimitiveSchema:()=>be,JsonValueSchema:()=>ae,NormalizedScoreSchema:()=>P,PolicyConflictRefSchema:()=>pe,PromptTemplateDtoSchema:()=>Le,RelatedDecisionSchema:()=>ce,Sha256HexSchema:()=>O,SystemFeatureFlagDtoSchema:()=>Pe,SystemParameterDtoSchema:()=>Ne,TenantIdSchema:()=>f.TenantIdSchema,UpdateFeatureFlagRequestSchema:()=>_e,UpdateParameterRequestSchema:()=>De,UpdatePromptTemplateRequestSchema:()=>ze,VerifiedCitationSchema:()=>me,bytesToHex:()=>de,computeCitationLeafHash:()=>ye,computeCitationMerkleRoot:()=>xe,constantTimeCompare:()=>he,sha256:()=>ee,verifyCitationProof:()=>te});module.exports=we(Fe);var b=class extends Error{statusCode;responseBody;parsedBody;constructor(t,a,i,o){super(t),this.name="GovernanceClientError",this.statusCode=a,this.responseBody=i,this.parsedBody=o}},C=class{baseUrl;apiKey;fetchFn;timeoutMs;constructor(t){if(!t||typeof t.baseUrl!="string"||t.baseUrl.trim().length===0)throw new Error("baseUrl is required and must be a non-empty string for GovernanceClient.");let a=t.baseUrl.trim().replace(/\/$/,"");if(t.apiKey){let i;try{i=new URL(a)}catch{throw new Error(`Invalid baseUrl format: ${t.baseUrl}`)}if(i.protocol==="http:"){let o=i.hostname.toLowerCase();if(!(o==="localhost"||o==="127.0.0.1"||o==="[::1]"||o==="::1"))throw new Error("Security Violation: Transmitting Bearer tokens over unencrypted HTTP to non-localhost hosts is strictly prohibited.")}}this.baseUrl=a,this.apiKey=t.apiKey,this.fetchFn=t.fetchFn??fetch,this.timeoutMs=t.timeoutMs&&t.timeoutMs>0?t.timeoutMs:3e4}async request(t,a,i,o,s){let u=new URL(t.startsWith("/")?t.slice(1):t,`${this.baseUrl}/`);if(o)for(let[l,p]of Object.entries(o))p!=null&&p.trim().length>0&&u.searchParams.append(l,p);let h=u.toString(),y={Accept:"application/json"};this.apiKey&&(y.Authorization=`Bearer ${this.apiKey}`),i!==void 0&&(y["Content-Type"]="application/json");let A=new AbortController,G=setTimeout(()=>A.abort(),this.timeoutMs),R=A.signal;s&&(R=AbortSignal.any([A.signal,s]));try{let l=await this.fetchFn(h,{method:a,headers:y,body:i!==void 0?JSON.stringify(i):void 0,signal:R}),p=await l.text();if(!l.ok){let m;try{m=JSON.parse(p)}catch{}throw new b(`API request failed with status ${l.status}: ${p}`,l.status,p,m)}if(p.trim().length===0)return;try{return JSON.parse(p)}catch(m){let E=m.message;throw new b(`Failed to parse response JSON from ${h}: ${E}`,l.status,p)}}catch(l){if(l instanceof b)throw l;let p=l instanceof Error?l.message:String(l);throw new b(`Network request failed for ${a} ${h}: ${p}`,0,"")}finally{clearTimeout(G)}}};var f=require("@aiquants/enrichment-core"),e=require("zod"),D=require("@aiquants/enrichment-core");var $=e.z.object({query:e.z.string().min(1,"Search query must not be empty"),policyCategory:e.z.string().optional(),includeHistoricalRevisions:e.z.boolean().optional(),maxAuthorityTier:e.z.union([e.z.literal(1),e.z.literal(2),e.z.literal(3),e.z.literal(4),e.z.literal(5)]).optional(),limit:e.z.number().int().positive().optional()}),se=e.z.object({text:e.z.string(),citationText:e.z.string(),chunkHash:e.z.string(),chunkIndex:e.z.number().int().nonnegative(),parentChunkUid:e.z.string().optional(),clauseIdentifier:e.z.string().optional(),breadcrumbPath:e.z.array(e.z.string()).optional(),page:e.z.number().int().optional(),sheetName:e.z.string().optional(),slideIndex:e.z.number().int().optional(),timestampSec:e.z.number().optional(),score:e.z.number()}),ce=e.z.object({decisionId:e.z.string(),title:e.z.string(),approvedBy:e.z.string()}),L=e.z.union([e.z.literal(1),e.z.literal(2),e.z.literal(3),e.z.literal(4),e.z.literal(5)]),le=e.z.object({metadataId:e.z.number().int(),fileUri:f.FileUriSchema,fileName:e.z.string(),documentTitle:e.z.string(),authorityTier:L.nullable(),validFrom:e.z.string().nullable(),validUntil:e.z.string().nullable(),isCurrentlyAuthoritative:e.z.boolean(),confidentialityLevel:f.ConfidentialityLevelSchema,snippets:e.z.array(se),relatedDecisions:e.z.array(ce).optional(),policyWarning:e.z.string().optional()}),_=e.z.object({searchMode:e.z.enum(["tri_store","sql_vector","sql_keyword_degraded"]),qualityTier:e.z.enum(["HIGH_TRI_STORE","STANDARD_SEMANTIC","DEGRADED_KEYWORD_ONLY"]),isDegraded:e.z.boolean(),degradationReason:e.z.string().nullable(),circuitBreakerStatus:e.z.record(e.z.enum(["CLOSED","OPEN","HALF_OPEN","HEALTHY"])),executionTimeMs:e.z.number().nonnegative()}),J=e.z.object({hits:e.z.array(le),tiers:e.z.object({sql:e.z.boolean(),vector:e.z.boolean(),graph:e.z.boolean()}),masked:e.z.boolean(),searchMetadata:_}),X=e.z.object({question:e.z.string().min(1,"Question must not be empty"),asOf:e.z.string().optional(),asOfTx:e.z.string().optional()}),V=e.z.object({metadataId:e.z.number().int(),documentTitle:e.z.string(),authorityTier:L,approvalStatus:e.z.enum(["DRAFT","APPROVED","DEPRECATED"]),validFrom:e.z.string(),validUntil:e.z.string().nullable(),isCurrentlyAuthoritative:e.z.boolean()}),pe=e.z.object({conflictId:e.z.number().int(),sourceMetadataId:e.z.number().int(),targetMetadataId:e.z.number().int(),conflictSummary:e.z.string(),severity:e.z.enum(["LOW","MEDIUM","HIGH","CRITICAL"]),resolutionStatus:e.z.enum(["OPEN","IN_REVIEW","RESOLVED"])}),me=e.z.object({chunkUid:e.z.string().uuid("chunkUid must be a valid UUID"),metadataId:e.z.number().int(),documentTitle:e.z.string(),clauseIdentifier:e.z.string(),breadcrumbPath:e.z.array(e.z.string()),exactQuotedText:e.z.string(),chunkHash:e.z.string().regex(/^[0-9a-f]{64}$/,"Must be a 64-character lowercase hexadecimal SHA-256 digest"),authorityTier:L,isVerified:e.z.boolean()}),O=e.z.string().regex(/^[0-9a-f]{64}$/,"Must be a 64-character lowercase hexadecimal SHA-256 digest"),ue=e.z.object({chunkUid:e.z.string().uuid("chunkUid must be a valid UUID"),chunkHash:O}),fe=e.z.object({algorithm:e.z.literal("SHA-256"),merkleRoot:O,leafCount:e.z.number().int().positive(),leaves:e.z.array(ue).min(1),tenantId:f.TenantIdSchema,scopeDigest:O,asOf:e.z.string().datetime(),asOfTx:e.z.string().datetime(),generatedAt:e.z.string().datetime(),signature:e.z.string().min(1,"Signature must not be empty")}),W=e.z.object({answer:e.z.string(),authoritative:e.z.array(V),superseded:e.z.array(V),conflicts:e.z.array(pe),verifiedCitations:e.z.array(me),citationProof:fe.nullable(),isFullyGrounded:e.z.boolean(),requiresHumanArbitration:e.z.boolean(),tiers:e.z.object({sql:e.z.boolean(),vector:e.z.boolean(),graph:e.z.boolean()}),searchMetadata:_}),Y=e.z.object({promptOverrides:e.z.record(e.z.string()).optional(),parameterOverrides:e.z.record(e.z.union([e.z.string(),e.z.number(),e.z.boolean()])).optional(),strategyOverrides:e.z.record(e.z.record(e.z.union([e.z.string(),e.z.number(),e.z.boolean()]))).optional(),intentTypes:e.z.array(e.z.enum(["SET","DIFF","PATH","NEGATION","COUNT"])).optional()}),P=e.z.number().min(0).max(1),N=e.z.object({contextRelevance:P,groundedness:P,answerRelevance:P}),q=N.extend({meanAnswerChars:e.z.number().nonnegative(),meanLatencyMs:e.z.number().nonnegative()}),K=e.z.object({caseId:e.z.string(),intentType:e.z.enum(["SET","DIFF","PATH","NEGATION","COUNT"]),beforeScores:N,afterScores:N}),Q=e.z.object({simulationId:e.z.string(),evaluatedCount:e.z.number().int().nonnegative(),before:q,after:q,delta:q,regressions:e.z.array(K),improvements:e.z.array(K),searchMetadata:_});var Z=new Uint8Array([0]),z=new Uint8Array([1]),Ie=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function d(r,t){return r>>>t|r<<32-t}function ee(r){let t=1779033703,a=3144134277,i=1013904242,o=2773480762,s=1359893119,u=2600822924,h=528734635,y=1541459225,A=r.length,G=A*8,R=(A+8>>6)+1<<6,l=new Uint8Array(R);l.set(r),l[A]=128;let p=new DataView(l.buffer,l.byteOffset,l.byteLength);p.setUint32(R-4,G>>>0,!1),p.setUint32(R-8,Math.floor(G/4294967296),!1);let m=new Uint32Array(64);for(let F=0;F<R;F+=64){for(let c=0;c<16;c++)m[c]=p.getUint32(F+c*4,!1);for(let c=16;c<64;c++){let M=d(m[c-15],7)^d(m[c-15],18)^m[c-15]>>>3,j=d(m[c-2],17)^d(m[c-2],19)^m[c-2]>>>10;m[c]=m[c-16]+M+m[c-7]+j>>>0}let S=t,T=a,U=i,k=o,g=s,w=u,I=h,H=y;for(let c=0;c<64;c++){let M=d(g,6)^d(g,11)^d(g,25),j=g&w^~g&I,ie=H+M+j+Ie[c]+m[c]>>>0,ve=d(S,2)^d(S,13)^d(S,22),Ae=S&T^S&U^T&U,Re=ve+Ae>>>0;H=I,I=w,w=g,g=k+ie>>>0,k=U,U=T,T=S,S=ie+Re>>>0}t=t+S>>>0,a=a+T>>>0,i=i+U>>>0,o=o+k>>>0,s=s+g>>>0,u=u+w>>>0,h=h+I>>>0,y=y+H>>>0}let E=new Uint8Array(32),x=new DataView(E.buffer,E.byteOffset,E.byteLength);return x.setUint32(0,t,!1),x.setUint32(4,a,!1),x.setUint32(8,i,!1),x.setUint32(12,o,!1),x.setUint32(16,s,!1),x.setUint32(20,u,!1),x.setUint32(24,h,!1),x.setUint32(28,y,!1),E}function de(r){let t="";for(let a=0;a<r.length;a++)t+=r[a].toString(16).padStart(2,"0");return t}function he(r,t){if(r.length!==t.length)return!1;let a=0;for(let i=0;i<r.length;i++)a|=r.charCodeAt(i)^t.charCodeAt(i);return a===0}function ye(r,t,a){if(!(r?.trim()&&t?.trim()&&a?.trim()))throw new Error("tenantId, chunkUid, and chunkHash must be non-empty strings.");if(r.includes("")||t.includes("")||a.includes(""))throw new Error("Parameters must not contain delimiter control characters.");let o=new TextEncoder().encode(`${r}${t}${a}`),s=new Uint8Array(Z.length+o.length);return s.set(Z,0),s.set(o,Z.length),ee(s)}function xe(r){if(!r||r.length===0)return null;for(let a=0;a<r.length;a++)if(!(r[a]instanceof Uint8Array)||r[a].length!==32)throw new Error(`Leaf at index ${a} must be a 32-byte Uint8Array.`);let t=[...r];for(;t.length>1;){let a=[];for(let i=0;i<t.length-1;i+=2){let o=t[i],s=t[i+1],u=new Uint8Array(z.length+o.length+s.length);u.set(z,0),u.set(o,z.length),u.set(s,z.length+o.length),a.push(ee(u))}t.length%2===1&&a.push(t[t.length-1]),t=a}return de(t[0])}function te(r,t){try{if(!r||typeof r!="object"||r.algorithm!=="SHA-256"||t?.expectedTenantId&&r.tenantId!==t.expectedTenantId||!Array.isArray(r.leaves)||r.leafCount!==r.leaves.length||r.leafCount===0)return!1;if(t?.expectedCitations){if(t.expectedCitations.length!==r.leaves.length)return!1;for(let o=0;o<r.leaves.length;o++)if(t.expectedCitations[o].chunkUid!==r.leaves[o].chunkUid||t.expectedCitations[o].chunkHash!==r.leaves[o].chunkHash)return!1}for(let o=0;o<r.leaves.length;o++){let s=r.leaves[o];if(!s||typeof s!="object"||!s.chunkUid||!s.chunkHash||o>0&&r.leaves[o].chunkUid<=r.leaves[o-1].chunkUid)return!1}let a=[];for(let o of r.leaves)a.push(ye(r.tenantId,o.chunkUid,o.chunkHash));let i=xe(a);return!i||typeof r.merkleRoot!="string"?!1:he(i,r.merkleRoot)}catch{return!1}}var ne=class extends C{async search(t,a){let i=$.parse(t),o=a?{tenant_id:f.TenantIdSchema.parse(a)}:void 0,s=await this.request("/ai/governance/search","POST",i,o);return J.parse(s)}async answer(t,a){let i=X.parse(t),o=a?{tenant_id:f.TenantIdSchema.parse(a)}:void 0,s=await this.request("/ai/governance/answer","POST",i,o);return W.parse(s)}verifyCitationProof(t,a){return te(t,a)}};var Se=require("@aiquants/enrichment-core");var re=class extends C{async simulate(t,a){let i=Y.parse(t),o=a?{tenant_id:Se.TenantIdSchema.parse(a)}:void 0,s=await this.request("/ai/governance/simulate","POST",i,o);return Q.parse(s)}};var v=require("@aiquants/enrichment-core"),n=require("zod");var oe=n.z.enum(["ENABLE_VECTOR_SEARCH","ENABLE_VECTOR_INDEXING","ENABLE_GRAPH_SEARCH","ENABLE_GRAPH_INDEXING","ENABLE_ASSET_EXTRACTION","ENABLE_MEDIA_ANALYSIS","ENABLE_DYNAMIC_CLASSIFIER_RULES","ENABLE_SEMANTIC_CACHE","ENABLE_CONTEXT_COMPRESSION","ENABLE_MULTI_AGENT_SWARM","ENABLE_AUTONOMOUS_ONTOLOGY","ENABLE_MERKLE_CITATION_PROOF","ENABLE_REALTIME_CDC_INGESTION","ENABLE_COLPALI_IMAGE_INDEXING"]),Pe=n.z.object({tenantId:v.TenantIdSchema,flagKey:oe,isEnabled:n.z.boolean(),description:n.z.string(),updatedBy:n.z.string(),updatedAt:n.z.string()}),ge=n.z.enum(["ocr","enrichment","transcription","asset_extraction","vector_indexing","graph_indexing","governance_answer"]),qe=["ocr","enrichment","transcription","governance_answer"],Oe=n.z.object({tenantId:v.TenantIdSchema,confidentialityLevel:D.ConfidentialityLevelSchema,capability:ge,isEnabled:n.z.boolean(),allowCloudProvider:n.z.boolean(),promptKey:n.z.string().min(1).nullable(),description:n.z.string().nullable(),updatedBy:n.z.string(),updatedAt:n.z.string()}),Ne=n.z.object({tenantId:v.TenantIdSchema,parameterKey:n.z.string().min(1),parameterValue:n.z.string(),dataType:n.z.enum(["string","int","float","bool","json"]),description:n.z.string(),isSecret:n.z.boolean(),updatedBy:n.z.string(),updatedAt:n.z.string()}),Le=n.z.object({tenantId:v.TenantIdSchema,promptKey:n.z.string().min(1),promptVersion:n.z.number().int(),promptTemplate:n.z.string(),provider:n.z.string(),modelName:n.z.string(),temperature:n.z.number(),maxTokens:n.z.number().int(),isSystemPrompt:n.z.boolean(),description:n.z.string(),updatedBy:n.z.string(),updatedAt:n.z.string()}),_e=n.z.object({tenantId:v.TenantIdSchema,flagKey:oe,isEnabled:n.z.boolean(),updatedBy:n.z.string().min(1)}),De=n.z.object({tenantId:v.TenantIdSchema,parameterKey:n.z.string().min(1),parameterValue:n.z.string(),updatedBy:n.z.string().min(1)}),ze=n.z.object({tenantId:v.TenantIdSchema,promptKey:n.z.string().min(1),promptTemplate:n.z.string().min(1,"promptTemplate must not be empty"),provider:n.z.string().min(1),modelName:n.z.string().min(1),temperature:n.z.number().min(0).max(2).optional(),maxTokens:n.z.number().int().positive().optional(),updatedBy:n.z.string().min(1)}),be=n.z.union([n.z.string(),n.z.number(),n.z.boolean(),n.z.null()]),ae=n.z.lazy(()=>n.z.union([be,n.z.array(ae),n.z.record(ae)]));0&&(module.exports={AuthoritativeSourceSchema,AuthorityTierSchema,BaseGovernanceClient,CLOUD_CAPABLE_CAPABILITIES,CitationProofLeafSchema,CitationProofSchema,ConfidentialityCapabilityPolicyDtoSchema,ConfidentialityLevelSchema,FeatureFlagKeySchema,FileUriSchema,GovernanceAdminClient,GovernanceAnswerRequestSchema,GovernanceAnswerResponseSchema,GovernanceClient,GovernanceClientError,GovernanceSearchHitSchema,GovernanceSearchMetadataSchema,GovernanceSearchRequestSchema,GovernanceSearchResponseSchema,GovernanceSearchSnippetSchema,GovernanceSimulateCaseDiffSchema,GovernanceSimulateCaseScoresSchema,GovernanceSimulateRequestSchema,GovernanceSimulateResponseSchema,GovernanceSimulateScoresSchema,GovernedCapabilitySchema,JsonPrimitiveSchema,JsonValueSchema,NormalizedScoreSchema,PolicyConflictRefSchema,PromptTemplateDtoSchema,RelatedDecisionSchema,Sha256HexSchema,SystemFeatureFlagDtoSchema,SystemParameterDtoSchema,TenantIdSchema,UpdateFeatureFlagRequestSchema,UpdateParameterRequestSchema,UpdatePromptTemplateRequestSchema,VerifiedCitationSchema,bytesToHex,computeCitationLeafHash,computeCitationMerkleRoot,constantTimeCompare,sha256,verifyCitationProof});