@tryvira/mcp 0.1.1 → 0.1.2
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/dist/cli.js +0 -1
- package/dist/index.js +0 -1
- package/package.json +2 -6
- package/dist/cli.js.map +0 -7
- package/dist/domain/src/scope-composer.d.ts +0 -138
- package/dist/domain/src/vnext.d.ts +0 -53
- package/dist/index.js.map +0 -7
- package/dist/mcp/src/index.d.ts +0 -1
- package/dist/migrations/001_vnext_foundation.sql +0 -628
- package/dist/runtime/src/mcp-gateway.d.ts +0 -104
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
export declare function scopeDigest(scope: unknown): string;
|
|
2
|
-
export type ScopeLevel = 'platform' | 'organization' | 'project' | 'application' | 'workspace' | 'user' | 'session';
|
|
3
|
-
export interface HierarchicalScope {
|
|
4
|
-
level: ScopeLevel;
|
|
5
|
-
id: string;
|
|
6
|
-
parentId?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ScopeDelegation {
|
|
9
|
-
id: string;
|
|
10
|
-
issuerId: string;
|
|
11
|
-
subjectId: string;
|
|
12
|
-
fromLevel: ScopeLevel;
|
|
13
|
-
toLevel: ScopeLevel;
|
|
14
|
-
permissions: readonly string[];
|
|
15
|
-
expiresAt: string;
|
|
16
|
-
}
|
|
17
|
-
export interface CanonicalOrganizationScopeInput {
|
|
18
|
-
applicationId?: string | null;
|
|
19
|
-
workspaceId?: string | null;
|
|
20
|
-
userId?: string | null;
|
|
21
|
-
sessionId?: string | null;
|
|
22
|
-
}
|
|
23
|
-
/** Canonical serializer shared by organization intelligence and Teach boundaries. */
|
|
24
|
-
export declare function canonicalOrganizationScopeKeys(input: CanonicalOrganizationScopeInput): string[];
|
|
25
|
-
export interface ReferenceScopeDelegation extends ScopeDelegation {
|
|
26
|
-
stableKey: string;
|
|
27
|
-
parentAuthorityLevel: ScopeLevel;
|
|
28
|
-
childScopeKind: ScopeLevel;
|
|
29
|
-
childScopeDigest: string;
|
|
30
|
-
parentRevisionDigest: string;
|
|
31
|
-
/** Reference programs may narrow an exception to explicit effect kinds. */
|
|
32
|
-
exceptionEffectTypes?: readonly string[];
|
|
33
|
-
when: {
|
|
34
|
-
kind: 'all';
|
|
35
|
-
expressions: readonly [];
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export interface ScopeCompositionConflict {
|
|
39
|
-
code: 'SCOPE_CHAIN_INVALID' | 'SCOPE_DELEGATION_CONFLICT' | 'SCOPE_REVISION_LEVEL_CONFLICT' | 'TEMPORAL_INVARIANT_CONFLICT' | 'TEMPORAL_TRANSITION_CONFLICT' | 'RECOVERY_CONFLICT' | 'ACTOR_OWNERSHIP_CONFLICT' | 'DEADLINE_CONFLICT';
|
|
40
|
-
delegationIds: readonly string[];
|
|
41
|
-
hard: true;
|
|
42
|
-
}
|
|
43
|
-
export interface EffectiveRevisionBinding {
|
|
44
|
-
id: string;
|
|
45
|
-
digest: string;
|
|
46
|
-
sourceRevisionSetDigest?: string;
|
|
47
|
-
ancestorHardAuthorityDigest?: string;
|
|
48
|
-
}
|
|
49
|
-
export interface ScopeBehaviorRevision {
|
|
50
|
-
id: string;
|
|
51
|
-
digest: string;
|
|
52
|
-
level: ScopeLevel;
|
|
53
|
-
hard: boolean;
|
|
54
|
-
source: string;
|
|
55
|
-
temporalInvariantDigest?: string;
|
|
56
|
-
temporalTransitionDigest?: string;
|
|
57
|
-
recoveryDigest?: string;
|
|
58
|
-
temporalInvariantKeys?: Readonly<Record<string, string>>;
|
|
59
|
-
temporalTransitionKeys?: Readonly<Record<string, string>>;
|
|
60
|
-
recoveryKeys?: Readonly<Record<string, string>>;
|
|
61
|
-
actorOwnershipDigest?: string;
|
|
62
|
-
deadlineDigest?: string;
|
|
63
|
-
}
|
|
64
|
-
export interface ScopeCompositionExplanation {
|
|
65
|
-
revisionId: string;
|
|
66
|
-
level: ScopeLevel;
|
|
67
|
-
disposition: 'inherited' | 'overridden' | 'rejected';
|
|
68
|
-
reason: string;
|
|
69
|
-
}
|
|
70
|
-
export interface ComposedScope {
|
|
71
|
-
chain: readonly HierarchicalScope[];
|
|
72
|
-
permissions: readonly string[];
|
|
73
|
-
delegationIds?: readonly string[];
|
|
74
|
-
compositionDigest: string;
|
|
75
|
-
conflictSetDigest: string;
|
|
76
|
-
conflictSummary: {
|
|
77
|
-
total: number;
|
|
78
|
-
hard: number;
|
|
79
|
-
soft: number;
|
|
80
|
-
byCategory: Record<string, number>;
|
|
81
|
-
};
|
|
82
|
-
conflicts: readonly ScopeCompositionConflict[];
|
|
83
|
-
serveable: boolean;
|
|
84
|
-
effectiveRevision?: EffectiveRevisionBinding;
|
|
85
|
-
sourceRevisions?: readonly ScopeBehaviorRevision[];
|
|
86
|
-
sourceRevisionSetDigest?: string;
|
|
87
|
-
ancestorHardAuthorityDigest?: string;
|
|
88
|
-
effectiveProgramDigest?: string;
|
|
89
|
-
explanations?: readonly ScopeCompositionExplanation[];
|
|
90
|
-
}
|
|
91
|
-
export declare function projectComposedScope(composed: ComposedScope): import('./vnext.ts').Scope;
|
|
92
|
-
export declare function assertComposedScopeIntegrity(composed: ComposedScope): true;
|
|
93
|
-
/** Re-seals the existing canonical scope authority with effective-program lineage. */
|
|
94
|
-
export declare function bindEffectiveProgramAuthority(composed: ComposedScope, input: {
|
|
95
|
-
effectiveProgramDigest: string;
|
|
96
|
-
sourceRevisionSetDigest: string;
|
|
97
|
-
ancestorHardAuthorityDigest: string;
|
|
98
|
-
}): ComposedScope;
|
|
99
|
-
export interface ScopeCompositionRevalidation {
|
|
100
|
-
stale: boolean;
|
|
101
|
-
sourceRevisionSetChanged: boolean;
|
|
102
|
-
ancestorHardAuthorityChanged: boolean;
|
|
103
|
-
effectiveProgramChanged: boolean;
|
|
104
|
-
effectiveRevisionChanged: boolean;
|
|
105
|
-
conflictSetChanged: boolean;
|
|
106
|
-
compatible: boolean;
|
|
107
|
-
taintRequired: boolean;
|
|
108
|
-
}
|
|
109
|
-
/** Reference-equivalent dependency check for an already materialized scope. */
|
|
110
|
-
export declare function compositionDependencyStale(previous: ComposedScope, next: ComposedScope): boolean;
|
|
111
|
-
/** Revalidation must be explicit before a changed composition can be served. */
|
|
112
|
-
export declare function revalidateScopeComposition(previous: ComposedScope, next: ComposedScope): ScopeCompositionRevalidation;
|
|
113
|
-
export declare function composeScope(input: {
|
|
114
|
-
chain: readonly HierarchicalScope[];
|
|
115
|
-
delegation?: ScopeDelegation | null;
|
|
116
|
-
now?: string;
|
|
117
|
-
availablePermissions?: readonly string[];
|
|
118
|
-
effectiveRevision?: EffectiveRevisionBinding;
|
|
119
|
-
sourceRevisions?: readonly ScopeBehaviorRevision[];
|
|
120
|
-
}): ComposedScope;
|
|
121
|
-
/** Compose all supplied delegations, rejecting duplicate ids and preserving one digest for runtime checks. */
|
|
122
|
-
export declare function composeDelegatedScope(input: {
|
|
123
|
-
chain: readonly HierarchicalScope[];
|
|
124
|
-
delegations: readonly ScopeDelegation[];
|
|
125
|
-
now?: string;
|
|
126
|
-
availablePermissions?: readonly string[];
|
|
127
|
-
effectiveRevision?: EffectiveRevisionBinding;
|
|
128
|
-
sourceRevisions?: readonly ScopeBehaviorRevision[];
|
|
129
|
-
}): ComposedScope;
|
|
130
|
-
/** Reference-shaped exception delegation: parent-authored, exact-child and digest-bound. */
|
|
131
|
-
export declare function composeReferenceDelegatedScope(input: {
|
|
132
|
-
chain: readonly HierarchicalScope[];
|
|
133
|
-
delegation: ReferenceScopeDelegation;
|
|
134
|
-
now?: string;
|
|
135
|
-
availablePermissions?: readonly string[];
|
|
136
|
-
effectiveRevision?: EffectiveRevisionBinding;
|
|
137
|
-
sourceRevisions?: readonly ScopeBehaviorRevision[];
|
|
138
|
-
}): ComposedScope;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export interface Scope {
|
|
2
|
-
organizationId: string;
|
|
3
|
-
projectId: string;
|
|
4
|
-
environmentId: string;
|
|
5
|
-
/** Optional hierarchy identities carried when a composed authority is in scope. */
|
|
6
|
-
applicationId?: string | null;
|
|
7
|
-
workspaceId?: string | null;
|
|
8
|
-
userId?: string | null;
|
|
9
|
-
sessionId?: string | null;
|
|
10
|
-
/** Optional composed-authority binding carried by persistence boundaries. */
|
|
11
|
-
authorityDigest?: string | null;
|
|
12
|
-
}
|
|
13
|
-
export interface ScopedEntity extends Scope {
|
|
14
|
-
id: string;
|
|
15
|
-
}
|
|
16
|
-
export interface Policy extends ScopedEntity {
|
|
17
|
-
effect: 'allow' | 'deny';
|
|
18
|
-
revision: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The governed behavior boundary exposed by Vira's product model.
|
|
22
|
-
*
|
|
23
|
-
* `ControlPoint` was the pre-product name. Keep the type alias for persisted
|
|
24
|
-
* legacy adapters, but new domain code must use BehaviorPoint.
|
|
25
|
-
*/
|
|
26
|
-
export interface BehaviorPoint extends ScopedEntity {
|
|
27
|
-
}
|
|
28
|
-
/** @deprecated Use BehaviorPoint. This alias exists only at compatibility boundaries. */
|
|
29
|
-
export type ControlPoint = BehaviorPoint;
|
|
30
|
-
export interface BehaviorVariant extends ScopedEntity {
|
|
31
|
-
}
|
|
32
|
-
export interface Revision extends Scope {
|
|
33
|
-
id: string;
|
|
34
|
-
controlPointId: string;
|
|
35
|
-
variantId: string;
|
|
36
|
-
policyRevision: string;
|
|
37
|
-
immutable: true;
|
|
38
|
-
}
|
|
39
|
-
export interface ExecutionReceipt extends Scope {
|
|
40
|
-
id: string;
|
|
41
|
-
revisionId: string;
|
|
42
|
-
actorId: string;
|
|
43
|
-
idempotencyKey: string;
|
|
44
|
-
decision: string;
|
|
45
|
-
reason: string;
|
|
46
|
-
createdAt: string;
|
|
47
|
-
semanticTaskRef?: string;
|
|
48
|
-
semanticTaskVersion?: number;
|
|
49
|
-
semanticTaskDigest?: string;
|
|
50
|
-
}
|
|
51
|
-
export declare function assertSameScope(...items: readonly Scope[]): void;
|
|
52
|
-
export declare function issueRevision(scope: Scope, behaviorPoint: BehaviorPoint, policy: Policy, variant: BehaviorVariant, id: string): Revision;
|
|
53
|
-
export declare function makeReceipt(scope: Scope, revision: Revision, actorId: string, idempotencyKey: string, decision: string, reason: string): ExecutionReceipt;
|
package/dist/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../runtime/src/mcp-gateway.ts", "../../domain/src/scope-composer.ts"],
|
|
4
|
-
"sourcesContent": ["import {createHash} from 'node:crypto';\r\nexport const MCP_PROTOCOL_VERSIONS = ['2026-07-28','2025-11-25','2025-03-26'] as const;\r\nexport function negotiateMcpProtocolVersion(offered: unknown): string { const value=String(offered??''); return (MCP_PROTOCOL_VERSIONS as readonly string[]).includes(value) ? value : '2025-03-26'; }\r\nimport {isIP} from 'node:net';\r\nimport {assertComposedScopeIntegrity, type ComposedScope} from '../../domain/src/scope-composer.ts';\r\nimport type {Scope} from '../../domain/src/vnext.ts';\r\nexport interface McpInvocation extends Scope {id:string;server:string;tool:string;arguments:Record<string,unknown>;receiptId:string;idempotencyKey:string;authorityDigest?:string;composedScope?:ComposedScope}\r\nexport interface McpResult extends Scope {invocationId:string;ok:boolean;result?:unknown;error?:string;provenanceDigest:string;server:string;tool:string;receiptId:string;idempotencyKey:string;argumentsDigest:string;authorityDecisionDigest:string;authorityDigest?:string|null}\r\nexport interface McpTransport {call(input:{server:string;tool:string;arguments:Record<string,unknown>;signal?:AbortSignal}):Promise<{result?:unknown;error?:string}>}\r\nexport interface McpToolDefinition {name:string;description?:string;inputSchema:Record<string,unknown>;effectful?:boolean}\r\nexport interface McpResourceDefinition {uri:string;name:string;description?:string;mimeType?:string}\r\nexport interface McpPromptDefinition {name:string;description?:string;arguments?:readonly Record<string,unknown>[]}\r\nfunction assertPublicMcpHost(hostname:string):void { const host=hostname.toLowerCase().replace(/^\\[|\\]$/g,''); if(host==='localhost'||host.endsWith('.localhost')||host.endsWith('.local')) throw new Error('MCP_UPSTREAM_PRIVATE_HOST'); const version=isIP(host); if(version===4){const octets=host.split('.').map(Number);if(octets[0]===10||octets[0]===127||octets[0]===0||(octets[0]===172&&octets[1]>=16&&octets[1]<=31)||(octets[0]===192&&octets[1]===168)|| (octets[0]===169&&octets[1]===254)) throw new Error('MCP_UPSTREAM_PRIVATE_HOST');} if(version===6&&(['::1','::','fc','fd','fe8','fe9','fea','feb'].some(prefix=>host===prefix||host.startsWith(`${prefix}:`)))) throw new Error('MCP_UPSTREAM_PRIVATE_HOST'); }\r\nexport interface McpAuthorityDecision {allowed:boolean;decisionDigest:string;reason?:string}\r\nexport interface McpCancellationRegistry {register(requestId:string):AbortSignal;cancel(requestId:string):boolean;unregister(requestId:string,signal?:AbortSignal):void;}\r\nexport function canonicalMcpJson(value: unknown): string { if (value === null || typeof value !== 'object') return JSON.stringify(value); if (Array.isArray(value)) return `[${value.map(canonicalMcpJson).join(',')}]`; return `{${Object.keys(value as Record<string, unknown>).sort().map(key=>`${JSON.stringify(key)}:${canonicalMcpJson((value as Record<string, unknown>)[key])}`).join(',')}}`; }\r\nexport function verifyMcpResult(result:McpResult):true { const {provenanceDigest,...body}=result; const expected=createHash('sha256').update(canonicalMcpJson(body)).digest('hex'); if(provenanceDigest!==expected) throw new Error('MCP_PROVENANCE_DIGEST_INVALID'); return true; }\r\nexport function createMcpCancellationRegistry():McpCancellationRegistry {const controllers=new Map<string,AbortController>();return {register(requestId){if(!requestId.trim())throw new Error('MCP_REQUEST_ID_REQUIRED');const previous=controllers.get(requestId);previous?.abort();const controller=new AbortController();controllers.set(requestId,controller);return controller.signal;},cancel(requestId){const controller=controllers.get(requestId);if(!controller)return false;controller.abort();return true;},unregister(requestId,signal){const controller=controllers.get(requestId);if(controller&&(!signal||controller.signal===signal))controllers.delete(requestId);}};}\r\nfunction combineMcpAbortSignals(...signals:(AbortSignal|undefined)[]):AbortSignal|undefined { const active=signals.filter((signal):signal is AbortSignal=>Boolean(signal)); if(active.length===0)return undefined; if(active.length===1)return active[0]; const controller=new AbortController(); const abort=()=>controller.abort(); for(const signal of active){if(signal.aborted){controller.abort();break;} signal.addEventListener('abort',abort,{once:true});} return controller.signal; }\r\nexport function parseMcpEventStream(body:string,expectedId?:string):readonly string[] { const payloads:string[]=[]; for(const event of body.split(/\\r?\\n\\r?\\n/)){const data:string[]=[];for(const line of event.split(/\\r?\\n/)){if(!line||line.startsWith(':'))continue;const separator=line.indexOf(':');const field=separator<0?line:line.slice(0,separator);if(field!=='data')continue;const value=line.slice(separator+1).startsWith(' ')?line.slice(separator+2):line.slice(separator+1);data.push(value);}if(data.length)payloads.push(data.join('\\n'));}return payloads; }\r\nasync function readMcpResponseBody(response:Response):Promise<string>{if(!response.body)return response.text();const reader=response.body.getReader();const decoder=new TextDecoder();let body='';try{for(;;){const chunk=await reader.read();body+=decoder.decode(chunk.value??new Uint8Array(),{stream:!chunk.done});if(chunk.done)return body;}}finally{reader.releaseLock();}}\r\nfunction parseMcpResponseBody(body:string,contentType:string,expectedId?:string):{result?:unknown;error?:string} { const payloads=contentType.toLowerCase().includes('text/event-stream') ? parseMcpEventStream(body,expectedId) : [body]; let last:{id?:string|number;error?:{message?:string};result?:unknown}|undefined; for(const payload of payloads){try{const parsed=JSON.parse(payload) as {id?:string|number;error?:{message?:string};result?:unknown}; last=parsed;}catch{continue;}} if(!last)return {error:'MCP_UPSTREAM_RESPONSE_INVALID'}; if(last.id!==undefined&&String(last.id)!==expectedId)return {error:'MCP_UPSTREAM_RESPONSE_ID_MISMATCH'}; return last.error?{error:last.error.message??'MCP_UPSTREAM_ERROR'}:{result:last.result}; }\r\nexport function createRegisteredMcpTransport(input:{endpoint:string;allowedHosts:readonly string[];fetcher?:typeof fetch;timeoutMs?:number;protocolVersion?:string;headers?:Readonly<Record<string,string>>}):McpTransport {const url=new URL(input.endpoint);if(url.protocol!=='https:')throw new Error('MCP_UPSTREAM_HTTPS_REQUIRED');assertPublicMcpHost(url.hostname);if(!input.allowedHosts.includes(url.host))throw new Error('MCP_UPSTREAM_HOST_NOT_ALLOWED');const fetcher=input.fetcher??fetch;const timeoutMs=input.timeoutMs??10000;if(!Number.isInteger(timeoutMs)||timeoutMs<1||timeoutMs>60000)throw new Error('MCP_UPSTREAM_TIMEOUT_INVALID');const protocolVersion=input.protocolVersion??'2025-03-26';return {call:async({server,tool,arguments:args,signal})=>{const controller=new AbortController();const timer=setTimeout(()=>controller.abort(),timeoutMs);const abort=()=>controller.abort();if(signal?.aborted)controller.abort();else signal?.addEventListener('abort',abort,{once:true});try{const response=await fetcher(url,{method:'POST',headers:{'content-type':'application/json',accept:'application/json, text/event-stream','mcp-protocol-version':protocolVersion,...input.headers},signal:controller.signal,body:JSON.stringify({jsonrpc:'2.0',id:`${server}:${tool}`,method:'tools/call',params:{name:tool,arguments:args}})});if(!response.ok)return {error:`MCP_UPSTREAM_HTTP_${response.status}`};return parseMcpResponseBody(await readMcpResponseBody(response),response.headers.get('content-type')??'application/json',`${server}:${tool}`);}catch(error){return {error:error instanceof Error&&error.name==='AbortError'?(signal?.aborted?'MCP_REQUEST_CANCELLED':'MCP_UPSTREAM_TIMEOUT'):'MCP_UPSTREAM_TRANSPORT_ERROR'}}finally{clearTimeout(timer);signal?.removeEventListener('abort',abort)}}}}\r\nexport async function handleMcpJsonRpc(input:{request:{jsonrpc:'2.0';id?:string|number;method:string;params?:Record<string,unknown>};server:string;tools:readonly McpToolDefinition[];resources?:readonly McpResourceDefinition[];prompts?:readonly McpPromptDefinition[];readResource?:(uri:string)=>Promise<Record<string,unknown>|null>|Record<string,unknown>|null;getPrompt?:(name:string,args:Record<string,unknown>)=>Promise<Record<string,unknown>|null>|Record<string,unknown>|null;invocation:Omit<McpInvocation,'server'|'tool'|'arguments'>;transport:McpTransport;signal?:AbortSignal;cancellationRegistry?:McpCancellationRegistry;authorize?:(input:{invocation:McpInvocation;definition:McpToolDefinition})=>Promise<McpAuthorityDecision>|McpAuthorityDecision}):Promise<Record<string,unknown>|null>{const {request,server,tools,transport}=input;if(request.jsonrpc!=='2.0'||!request.method)throw new Error('MCP_JSONRPC_INVALID');if(request.method==='initialize')return request.id===undefined?null:{jsonrpc:'2.0',id:request.id,result:{protocolVersion:'2025-03-26',serverInfo:{name:server,version:'1'},capabilities:{tools:{},resources:input.resources?{}:undefined,prompts:input.prompts?{}:undefined}}};if(request.method==='notifications/initialized')return null;if(request.method==='notifications/cancelled'){const requestId=String(request.params?.requestId??'');input.cancellationRegistry?.cancel(requestId);return null;}if(request.method==='tools/list')return request.id===undefined?null:{jsonrpc:'2.0',id:request.id,result:{tools}};if(request.method==='resources/list')return request.id===undefined?null:{jsonrpc:'2.0',id:request.id,result:{resources:input.resources??[]}};if(request.method==='prompts/list')return request.id===undefined?null:{jsonrpc:'2.0',id:request.id,result:{prompts:input.prompts??[]}};if(request.method==='resources/read'){const value=input.readResource?await input.readResource(String(request.params?.uri??'')):null;return request.id===undefined?null:value?{jsonrpc:'2.0',id:request.id,result:value}:{jsonrpc:'2.0',id:request.id,error:{code:-32602,message:'RESOURCE_NOT_FOUND'}}}if(request.method==='prompts/get'){const value=input.getPrompt?await input.getPrompt(String(request.params?.name??''),(request.params?.arguments??{}) as Record<string,unknown>):null;return request.id===undefined?null:value?{jsonrpc:'2.0',id:request.id,result:value}:{jsonrpc:'2.0',id:request.id,error:{code:-32602,message:'PROMPT_NOT_FOUND'}}}if(request.method!=='tools/call')return request.id===undefined?null:{jsonrpc:'2.0',id:request.id,error:{code:-32601,message:'METHOD_NOT_FOUND'}};const tool=String(request.params?.name??'');const definition=tools.find(item=>item.name===tool);if(!definition)return request.id===undefined?null:{jsonrpc:'2.0',id:request.id,error:{code:-32602,message:'TOOL_NOT_FOUND'}};const invocation={...input.invocation,server,tool,arguments:(request.params?.arguments??{}) as Record<string,unknown>};const authority=definition.effectful?(input.authorize?await input.authorize({invocation,definition}):{allowed:false,decisionDigest:'',reason:'MCP_AUTHORITY_REQUIRED'}):{allowed:true,decisionDigest:'read-only'};if(!authority.allowed)return request.id===undefined?null:{jsonrpc:'2.0',id:request.id,error:{code:-32003,message:authority.reason??'MCP_AUTHORITY_DENIED',data:{decisionDigest:authority.decisionDigest}}};const requestId=String(request.id??'');const requestSignal=input.cancellationRegistry&&requestId?input.cancellationRegistry.register(requestId):undefined;try{const result=await invokeMcpTool({invocation,transport,authority,signal:combineMcpAbortSignals(input.signal,requestSignal)});return request.id===undefined?null:{jsonrpc:'2.0',id:request.id,result:{content:[{type:'text',text:JSON.stringify(result.result??result.error??null)}],isError:!result.ok,provenanceDigest:result.provenanceDigest}}}finally{if(requestSignal)input.cancellationRegistry?.unregister(requestId,requestSignal);}}\r\nexport async function invokeMcpTool(input:{invocation:McpInvocation;transport:McpTransport;authority?:McpAuthorityDecision;signal?:AbortSignal}):Promise<McpResult>{const {invocation,transport}=input;if(!invocation.id||!invocation.server||!invocation.tool||!invocation.receiptId||!invocation.idempotencyKey)throw new Error('MCP_INVOCATION_FIELDS_REQUIRED');if(invocation.authorityDigest!==undefined&&!/^[a-f0-9]{64}$/.test(invocation.authorityDigest))throw new Error('MCP_AUTHORITY_DIGEST_INVALID');if(invocation.composedScope){assertComposedScopeIntegrity(invocation.composedScope);if(invocation.authorityDigest!==undefined&&invocation.authorityDigest!==invocation.composedScope.compositionDigest)throw new Error('MCP_AUTHORITY_MISMATCH');if(!invocation.composedScope.serveable)throw new Error('MCP_SCOPE_COMPOSITION_CONFLICT');}if(input.authority&&!input.authority.allowed)throw new Error('MCP_AUTHORITY_DENIED');if(!transport||typeof transport.call!=='function')throw new Error('MCP_TRANSPORT_REQUIRED');let response:{result?:unknown;error?:string};try{response=await transport.call({server:invocation.server,tool:invocation.tool,arguments:structuredClone(invocation.arguments),signal:input.signal})}catch{if(input.signal?.aborted)throw new Error('MCP_INVOCATION_CANCELLED');response={error:'MCP_TRANSPORT_ERROR'}}const argumentsDigest=createHash('sha256').update(canonicalMcpJson(invocation.arguments)).digest('hex');const body={invocationId:invocation.id,organizationId:invocation.organizationId,projectId:invocation.projectId,environmentId:invocation.environmentId,server:invocation.server,tool:invocation.tool,receiptId:invocation.receiptId,idempotencyKey:invocation.idempotencyKey,argumentsDigest,authorityDecisionDigest:input.authority?.decisionDigest??'not-required',authorityDigest:invocation.authorityDigest??null,ok:!response.error,result:response.result,error:response.error};return Object.freeze({...body,provenanceDigest:createHash('sha256').update(canonicalMcpJson(body)).digest('hex')})}\r\n", "import {createHash} from 'node:crypto';\r\nfunction canonical(value: unknown): string { if (value === null || typeof value !== 'object') return JSON.stringify(value); if (Array.isArray(value)) return `[${value.map(canonical).join(',')}]`; return `{${Object.keys(value as Record<string, unknown>).sort().map(key => `${JSON.stringify(key)}:${canonical((value as Record<string, unknown>)[key])}`).join(',')}}`; }\r\nconst digest=(value: unknown): string => createHash('sha256').update(canonical(value)).digest('hex');\r\nexport function scopeDigest(scope: unknown): string {\r\n // Match the reference scope-composer contract: identity is the canonical\r\n // scope kind/key/project tuple, never caller object insertion order.\r\n if (scope && typeof scope === 'object' && 'level' in scope && 'id' in scope) {\r\n const value = scope as {level: ScopeLevel; id: string; projectId?: string};\r\n return digest({kind: value.level, key: value.id, projectId: value.projectId ?? null});\r\n }\r\n return digest(scope);\r\n}\r\n\r\nexport type ScopeLevel = 'platform' | 'organization' | 'project' | 'application' | 'workspace' | 'user' | 'session';\r\nexport interface HierarchicalScope { level: ScopeLevel; id: string; parentId?: string; }\r\nexport interface ScopeDelegation { id: string; issuerId: string; subjectId: string; fromLevel: ScopeLevel; toLevel: ScopeLevel; permissions: readonly string[]; expiresAt: string; }\r\nexport interface CanonicalOrganizationScopeInput { applicationId?: string | null; workspaceId?: string | null; userId?: string | null; sessionId?: string | null; }\r\n/** Canonical serializer shared by organization intelligence and Teach boundaries. */\r\nexport function canonicalOrganizationScopeKeys(input: CanonicalOrganizationScopeInput): string[] {\r\n return ['project', ...(input.applicationId ? [`application_scope:${input.applicationId}`] : []), ...(input.workspaceId ? [`workspace:${input.workspaceId}`] : []), ...(input.userId ? [`user:${input.userId}`] : []), ...(input.sessionId ? [`session:${input.sessionId}`] : [])];\r\n}\r\nexport interface ReferenceScopeDelegation extends ScopeDelegation {\r\n stableKey: string;\r\n parentAuthorityLevel: ScopeLevel;\r\n childScopeKind: ScopeLevel;\r\n childScopeDigest: string;\r\n parentRevisionDigest: string;\r\n /** Reference programs may narrow an exception to explicit effect kinds. */\r\n exceptionEffectTypes?: readonly string[];\r\n when: {kind: 'all'; expressions: readonly []};\r\n}\r\nexport interface ScopeCompositionConflict { code: 'SCOPE_CHAIN_INVALID' | 'SCOPE_DELEGATION_CONFLICT' | 'SCOPE_REVISION_LEVEL_CONFLICT' | 'TEMPORAL_INVARIANT_CONFLICT' | 'TEMPORAL_TRANSITION_CONFLICT' | 'RECOVERY_CONFLICT' | 'ACTOR_OWNERSHIP_CONFLICT' | 'DEADLINE_CONFLICT'; delegationIds: readonly string[]; hard: true; }\r\nexport interface EffectiveRevisionBinding { id: string; digest: string; sourceRevisionSetDigest?: string; ancestorHardAuthorityDigest?: string; }\r\nexport interface ScopeBehaviorRevision { id: string; digest: string; level: ScopeLevel; hard: boolean; source: string; temporalInvariantDigest?: string; temporalTransitionDigest?: string; recoveryDigest?: string; temporalInvariantKeys?: Readonly<Record<string,string>>; temporalTransitionKeys?: Readonly<Record<string,string>>; recoveryKeys?: Readonly<Record<string,string>>; actorOwnershipDigest?: string; deadlineDigest?: string; }\r\nexport interface ScopeCompositionExplanation { revisionId: string; level: ScopeLevel; disposition: 'inherited'|'overridden'|'rejected'; reason: string; }\r\nexport interface ComposedScope { chain: readonly HierarchicalScope[]; permissions: readonly string[]; delegationIds?: readonly string[]; compositionDigest: string; conflictSetDigest: string; conflictSummary: {total:number; hard:number; soft:number; byCategory: Record<string,number>}; conflicts: readonly ScopeCompositionConflict[]; serveable: boolean; effectiveRevision?: EffectiveRevisionBinding; sourceRevisions?: readonly ScopeBehaviorRevision[]; sourceRevisionSetDigest?: string; ancestorHardAuthorityDigest?: string; effectiveProgramDigest?: string; explanations?: readonly ScopeCompositionExplanation[]; }\r\nexport function projectComposedScope(composed: ComposedScope): import('./vnext.ts').Scope {\r\n assertComposedScopeIntegrity(composed);\r\n const value = (level: ScopeLevel) => composed.chain.find(item => item.level === level)?.id ?? null;\r\n const organizationId = value('organization');\r\n const projectId = value('project');\r\n const environmentId = value('application') ?? value('session') ?? projectId;\r\n if (!organizationId || !projectId || !environmentId) throw new Error('SCOPE_RUNTIME_PROJECTION_INVALID');\r\n return Object.freeze({organizationId,projectId,environmentId,applicationId:value('application'),workspaceId:value('workspace'),userId:value('user'),sessionId:value('session'),authorityDigest:composed.compositionDigest});\r\n}\r\nconst order: ScopeLevel[] = ['platform','organization','project','application','workspace','user','session'];\r\nfunction canonicalChain(input: readonly HierarchicalScope[]): readonly HierarchicalScope[] {\r\n if (!input.length) throw new Error('SCOPE_CHAIN_REQUIRED');\r\n const chain = [...input].sort((left, right) => order.indexOf(left.level) - order.indexOf(right.level) || left.id.localeCompare(right.id));\r\n if (new Set(chain.map(item => item.level)).size !== chain.length) throw new Error('SCOPE_CHAIN_INVALID');\r\n if (new Set(chain.map(item => item.id)).size !== chain.length) throw new Error('SCOPE_CHAIN_INVALID');\r\n chain.forEach((item, index) => { if (!item.id?.trim() || (index > 0 && item.parentId !== chain[index - 1].id)) throw new Error('SCOPE_CHAIN_INVALID'); });\r\n return Object.freeze(chain);\r\n}\r\nfunction normalizeConflicts(conflicts: readonly ScopeCompositionConflict[]): readonly ScopeCompositionConflict[] {\r\n const unique = new Map<string, ScopeCompositionConflict>();\r\n for (const conflict of conflicts) {\r\n const delegationIds = [...new Set(conflict.delegationIds)].sort();\r\n const key = `${conflict.code}|${delegationIds.join(',')}`;\r\n unique.set(key, Object.freeze({...conflict, delegationIds: Object.freeze(delegationIds)}));\r\n }\r\n return Object.freeze([...unique.values()].sort((left, right) => `${left.code}|${left.delegationIds.join(',')}`.localeCompare(`${right.code}|${right.delegationIds.join(',')}`)));\r\n}\r\nfunction conflictSummary(conflicts: readonly ScopeCompositionConflict[]) { const byCategory:Record<string,number>={}; for(const conflict of conflicts) { const category=conflict.code.toLowerCase().replace(/_conflict$/,''); byCategory[category]=(byCategory[category]??0)+1; } return {total:conflicts.length,hard:conflicts.filter(item=>item.hard).length,soft:conflicts.filter(item=>!item.hard).length,byCategory:Object.freeze(byCategory)}; }\r\nexport function assertComposedScopeIntegrity(composed: ComposedScope): true {\r\n const conflictSetDigest = digest(composed.conflicts);\r\n if (conflictSetDigest !== composed.conflictSetDigest) throw new Error('SCOPE_CONFLICT_DIGEST_MISMATCH');\r\n const compositionDigest = digest({chain: composed.chain, permissions: composed.permissions, delegationIds: [...(composed.delegationIds ?? [])].sort(), conflictSetDigest, effectiveRevision: composed.effectiveRevision ?? null, sourceRevisionSetDigest: composed.sourceRevisionSetDigest ?? null, ancestorHardAuthorityDigest: composed.ancestorHardAuthorityDigest ?? null, effectiveProgramDigest: composed.effectiveProgramDigest ?? null});\r\n if (compositionDigest !== composed.compositionDigest) throw new Error('SCOPE_COMPOSITION_DIGEST_MISMATCH');\r\n return true;\r\n}\r\n\r\n/** Re-seals the existing canonical scope authority with effective-program lineage. */\r\nexport function bindEffectiveProgramAuthority(composed: ComposedScope, input: {effectiveProgramDigest: string; sourceRevisionSetDigest: string; ancestorHardAuthorityDigest: string}): ComposedScope {\r\n assertComposedScopeIntegrity(composed);\r\n for (const [name, value] of Object.entries(input)) if (!/^[a-f0-9]{64}$/.test(value)) throw new Error(`SCOPE_${name.toUpperCase()}_INVALID`);\r\n const bound = Object.freeze({...composed, effectiveProgramDigest: input.effectiveProgramDigest, sourceRevisionSetDigest: input.sourceRevisionSetDigest, ancestorHardAuthorityDigest: input.ancestorHardAuthorityDigest});\r\n const compositionDigest = digest({chain: bound.chain, permissions: bound.permissions, delegationIds: [...(bound.delegationIds ?? [])].sort(), conflictSetDigest: bound.conflictSetDigest, effectiveRevision: bound.effectiveRevision ?? null, sourceRevisionSetDigest: bound.sourceRevisionSetDigest, ancestorHardAuthorityDigest: bound.ancestorHardAuthorityDigest, effectiveProgramDigest: bound.effectiveProgramDigest});\r\n const resealed = Object.freeze({...bound, compositionDigest});\r\n assertComposedScopeIntegrity(resealed);\r\n return resealed;\r\n}\r\n\r\nexport interface ScopeCompositionRevalidation {\r\n stale: boolean;\r\n sourceRevisionSetChanged: boolean;\r\n ancestorHardAuthorityChanged: boolean;\r\n effectiveProgramChanged: boolean;\r\n effectiveRevisionChanged: boolean;\r\n conflictSetChanged: boolean;\r\n compatible: boolean;\r\n taintRequired: boolean;\r\n}\r\n\r\n/** Reference-equivalent dependency check for an already materialized scope. */\r\nexport function compositionDependencyStale(previous: ComposedScope, next: ComposedScope): boolean {\r\n assertComposedScopeIntegrity(previous);\r\n assertComposedScopeIntegrity(next);\r\n return previous.sourceRevisionSetDigest !== next.sourceRevisionSetDigest ||\r\n previous.ancestorHardAuthorityDigest !== next.ancestorHardAuthorityDigest ||\r\n previous.effectiveProgramDigest !== next.effectiveProgramDigest ||\r\n previous.effectiveRevision?.digest !== next.effectiveRevision?.digest ||\r\n previous.conflictSetDigest !== next.conflictSetDigest;\r\n}\r\n\r\n/** Revalidation must be explicit before a changed composition can be served. */\r\nexport function revalidateScopeComposition(previous: ComposedScope, next: ComposedScope): ScopeCompositionRevalidation {\r\n const sourceRevisionSetChanged = previous.sourceRevisionSetDigest !== next.sourceRevisionSetDigest;\r\n const ancestorHardAuthorityChanged = previous.ancestorHardAuthorityDigest !== next.ancestorHardAuthorityDigest;\r\n const effectiveProgramChanged = previous.effectiveProgramDigest !== next.effectiveProgramDigest;\r\n const effectiveRevisionChanged = previous.effectiveRevision?.digest !== next.effectiveRevision?.digest;\r\n const conflictSetChanged = previous.conflictSetDigest !== next.conflictSetDigest;\r\n const stale = sourceRevisionSetChanged || ancestorHardAuthorityChanged || effectiveProgramChanged || effectiveRevisionChanged || conflictSetChanged;\r\n const compatible = next.serveable;\r\n return {stale, sourceRevisionSetChanged, ancestorHardAuthorityChanged, effectiveProgramChanged, effectiveRevisionChanged, conflictSetChanged, compatible, taintRequired: stale && !compatible};\r\n}\r\nexport function composeScope(input: {chain: readonly HierarchicalScope[]; delegation?: ScopeDelegation | null; now?: string; availablePermissions?: readonly string[]; effectiveRevision?: EffectiveRevisionBinding; sourceRevisions?: readonly ScopeBehaviorRevision[]}): ComposedScope {\r\n const chain = canonicalChain(input.chain);\r\n const delegations = input.delegation ? [input.delegation] : [];\r\n let permissions: readonly string[] = [];\r\n for (const delegation of delegations) { const now = input.now ?? new Date().toISOString(); const expiresAt = Date.parse(delegation.expiresAt); const issuedAt = Date.parse(now); if (!delegation.id?.trim() || !delegation.issuerId?.trim() || !delegation.subjectId?.trim() || !Array.isArray(delegation.permissions) || !delegation.permissions.length || !Number.isFinite(expiresAt) || !Number.isFinite(issuedAt)) throw new Error('SCOPE_DELEGATION_INVALID'); if (order.indexOf(delegation.fromLevel) >= order.indexOf(delegation.toLevel)) throw new Error('SCOPE_DELEGATION_DIRECTION_INVALID'); if (chain.find(item => item.level === delegation.toLevel)?.id !== delegation.subjectId) throw new Error('SCOPE_DELEGATION_SUBJECT_MISMATCH'); if (expiresAt <= issuedAt) throw new Error('SCOPE_DELEGATION_EXPIRED'); if (!chain.some(item => item.id === delegation.issuerId && item.level === delegation.fromLevel)) throw new Error('SCOPE_DELEGATION_ISSUER_OUTSIDE_CHAIN'); const requested=[...new Set(delegation.permissions.map(value => value.trim()).filter(Boolean))]; if (!requested.length) throw new Error('SCOPE_DELEGATION_INVALID'); const available=input.availablePermissions; if (available && requested.some(permission=>!available.includes(permission))) throw new Error('SCOPE_DELEGATION_PERMISSION_WIDENING'); permissions = Object.freeze([...new Set([...permissions, ...requested])]); }\r\n const conflictNames = permissions.filter(value => value.startsWith('allow:')).map(value => value.slice('allow:'.length)).filter(name => permissions.includes(`deny:${name}`));\r\n const delegationConflicts: readonly ScopeCompositionConflict[] = conflictNames.length ? Object.freeze([{code:'SCOPE_DELEGATION_CONFLICT', delegationIds: delegations.map(item => item.id), hard:true}]) : Object.freeze([]);\r\n if (input.effectiveRevision && (!input.effectiveRevision.id || !/^[a-f0-9]{64}$/.test(input.effectiveRevision.digest))) throw new Error('EFFECTIVE_REVISION_BINDING_INVALID');\r\n const lineage = composeRevisionLineage(chain,input.sourceRevisions ?? [], delegations);\r\n const conflicts = normalizeConflicts([...delegationConflicts, ...(lineage.conflicts ?? [])]);\r\n const conflictSetDigest = digest(conflicts);\r\n const compositionDigest = digest({chain, permissions, delegationIds: delegations.map(item => item.id).sort(), conflictSetDigest, effectiveRevision: input.effectiveRevision ?? null, sourceRevisionSetDigest: lineage.sourceRevisionSetDigest ?? null, ancestorHardAuthorityDigest: lineage.ancestorHardAuthorityDigest ?? null, effectiveProgramDigest: lineage.effectiveProgramDigest ?? null});\r\n const {serveable: lineageServeable, conflicts: _lineageConflicts, ...lineageData}=lineage;\r\n return Object.freeze({chain: Object.freeze(chain), permissions, delegationIds: Object.freeze(delegations.map(item=>item.id).sort()), compositionDigest, conflictSetDigest, conflictSummary:conflictSummary(conflicts), conflicts, serveable: conflicts.length === 0 && lineageServeable, ...(input.effectiveRevision ? {effectiveRevision: Object.freeze({...input.effectiveRevision})} : {}), ...lineageData});\r\n}\r\n\r\nfunction composeRevisionLineage(chain: readonly HierarchicalScope[], revisions: readonly ScopeBehaviorRevision[], delegations: readonly ScopeDelegation[] = []): {serveable:boolean; sourceRevisions?:readonly ScopeBehaviorRevision[]; sourceRevisionSetDigest?:string; ancestorHardAuthorityDigest?:string; effectiveProgramDigest?:string; explanations?:readonly ScopeCompositionExplanation[]; conflicts?:readonly ScopeCompositionConflict[]} {\r\n if (!revisions.length) return {serveable:true};\r\n const delegatedChildIds=new Set(delegations.flatMap(item=>{const value=item as Partial<ReferenceScopeDelegation>;if(value.permissions?.includes('exception')&&value.parentAuthorityLevel===value.fromLevel&&value.childScopeKind===value.toLevel&&value.when?.kind==='all'&&value.when.expressions.length===0&&typeof value.parentRevisionDigest==='string'){const parent=revisions.find(revision=>revision.level===value.parentAuthorityLevel);const child=revisions.find(revision=>revision.level===value.childScopeKind);if(parent?.digest===value.parentRevisionDigest&&child?.id)return [child.id];}return []}));\r\n const effectiveRevisions=revisions.map(revision=>delegatedChildIds.has(revision.id)?{...revision,hard:false}:revision); const ids=new Set<string>(); const seenLevels=new Set<ScopeLevel>(); const explanations: ScopeCompositionExplanation[]=[]; const conflicts: ScopeCompositionConflict[]=[];\r\n for (const revision of effectiveRevisions) {\r\n if (!revision.id.trim() || !/^[a-f0-9]{64}$/.test(revision.digest) || !revision.source.trim() || ids.has(revision.id)) throw new Error('SCOPE_REVISION_LINEAGE_INVALID');\r\n const scope=chain.find(item=>item.level===revision.level); if (!scope) throw new Error('SCOPE_REVISION_OUTSIDE_CHAIN');\r\n if (seenLevels.has(revision.level)) { explanations.push({revisionId:revision.id,level:revision.level,disposition:'rejected',reason:'Multiple revisions at one scope level are not deterministically composable'}); conflicts.push({code:'SCOPE_REVISION_LEVEL_CONFLICT',delegationIds:[revision.id],hard:true}); continue; }\r\n ids.add(revision.id); seenLevels.add(revision.level); explanations.push({revisionId:revision.id,level:revision.level,disposition:revision.hard?'inherited':'overridden',reason:revision.hard?'Hard authority inherited into the effective scope':'Non-hard revision contributes an override candidate'});\r\n }\r\n const ordered=[...effectiveRevisions].filter(item=>ids.has(item.id)).sort((left,right)=>order.indexOf(left.level)-order.indexOf(right.level));\r\n const hard=ordered.filter(item=>item.hard);\r\n const compare=(field:keyof ScopeBehaviorRevision,code:ScopeCompositionConflict['code'])=>{const values=[...new Set(hard.map(item=>item[field]).filter(value=>typeof value==='string'))];if(values.length>1) conflicts.push({code,delegationIds:hard.filter(item=>typeof item[field]==='string').map(item=>item.id),hard:true});};\r\n const compareKeyed=(field:keyof ScopeBehaviorRevision,code:ScopeCompositionConflict['code'])=>{const byKey=new Map<string,{digest:string;ids:string[]}>();for(const item of hard){const value=item[field];if(!value||typeof value!=='object'||Array.isArray(value))continue;for(const [key,digestValue] of Object.entries(value as Record<string,string>)){const prior=byKey.get(key);if(prior){if(prior.digest!==digestValue) conflicts.push({code,delegationIds:[...new Set([...prior.ids,item.id])],hard:true});prior.ids.push(item.id);}else byKey.set(key,{digest:digestValue,ids:[item.id]});}}};\r\n compareKeyed('temporalInvariantKeys','TEMPORAL_INVARIANT_CONFLICT'); compareKeyed('temporalTransitionKeys','TEMPORAL_TRANSITION_CONFLICT'); compareKeyed('recoveryKeys','RECOVERY_CONFLICT');\r\n if (!hard.some(item=>item.temporalInvariantKeys)) compare('temporalInvariantDigest','TEMPORAL_INVARIANT_CONFLICT'); if (!hard.some(item=>item.temporalTransitionKeys)) compare('temporalTransitionDigest','TEMPORAL_TRANSITION_CONFLICT'); if (!hard.some(item=>item.recoveryKeys)) compare('recoveryDigest','RECOVERY_CONFLICT'); compare('actorOwnershipDigest','ACTOR_OWNERSHIP_CONFLICT'); compare('deadlineDigest','DEADLINE_CONFLICT');\r\n const sourceRevisionSetDigest=digest(ordered.map(item=>({id:item.id,digest:item.digest,level:item.level,hard:item.hard,source:item.source,temporalInvariantDigest:item.temporalInvariantDigest,temporalTransitionDigest:item.temporalTransitionDigest,recoveryDigest:item.recoveryDigest,actorOwnershipDigest:item.actorOwnershipDigest,deadlineDigest:item.deadlineDigest})));\r\n const ancestorHardAuthorityDigest=digest(ordered.filter(item=>item.hard).map(item=>item.digest));\r\n const effectiveProgramDigest=digest(ordered);\r\n return {serveable:conflicts.length===0&&!explanations.some(item=>item.disposition==='rejected'),sourceRevisions:Object.freeze(ordered),sourceRevisionSetDigest,ancestorHardAuthorityDigest,effectiveProgramDigest,explanations:Object.freeze(explanations),conflicts:Object.freeze(conflicts)};\r\n}\r\n\r\n/** Compose all supplied delegations, rejecting duplicate ids and preserving one digest for runtime checks. */\r\nexport function composeDelegatedScope(input: {chain: readonly HierarchicalScope[]; delegations: readonly ScopeDelegation[]; now?: string; availablePermissions?: readonly string[]; effectiveRevision?: EffectiveRevisionBinding; sourceRevisions?: readonly ScopeBehaviorRevision[]}): ComposedScope {\r\n const chain = canonicalChain(input.chain);\r\n const ids = input.delegations.map(item => item.id);\r\n if (new Set(ids).size !== ids.length) throw new Error('SCOPE_DELEGATION_CONFLICT');\r\n const results = input.delegations.map(delegation => {\r\n const candidate = delegation as Partial<ReferenceScopeDelegation>;\r\n const strictEnvelope = candidate.stableKey !== undefined || candidate.parentAuthorityLevel !== undefined || candidate.childScopeKind !== undefined || candidate.childScopeDigest !== undefined || candidate.parentRevisionDigest !== undefined || candidate.when !== undefined;\r\n return strictEnvelope\r\n ? composeReferenceDelegatedScope({chain, delegation: delegation as ReferenceScopeDelegation, now: input.now, availablePermissions: input.availablePermissions, sourceRevisions: input.sourceRevisions})\r\n : composeScope({chain, delegation, now: input.now, availablePermissions: input.availablePermissions});\r\n });\r\n const permissions = Object.freeze([...new Set(results.flatMap(result => result.permissions))].sort());\r\n const conflicts: ScopeCompositionConflict[] = [...results.flatMap(result => result.conflicts)];\r\n for (const permission of permissions.filter(value => value.startsWith('allow:')).map(value => value.slice('allow:'.length))) {\r\n if (permissions.includes(`allow:${permission}`) && permissions.includes(`deny:${permission}`)) conflicts.push({code:'SCOPE_DELEGATION_CONFLICT',delegationIds:ids.filter(id => input.delegations.some(item => item.id===id && item.permissions.some(value => value===`allow:${permission}` || value===`deny:${permission}`))),hard:true});\r\n }\r\n const normalizedConflicts = normalizeConflicts(conflicts);\r\n const conflictSetDigest = digest(normalizedConflicts);\r\n if (input.effectiveRevision && (!input.effectiveRevision.id || !/^[a-f0-9]{64}$/.test(input.effectiveRevision.digest))) throw new Error('EFFECTIVE_REVISION_BINDING_INVALID');\r\n const lineage=composeRevisionLineage(chain,input.sourceRevisions ?? [], input.delegations);\r\n const allConflicts = normalizeConflicts([...normalizedConflicts, ...(lineage.conflicts ?? [])]);\r\n const allConflictSetDigest = digest(allConflicts);\r\n const compositionDigest = digest({chain, permissions, delegationIds: [...ids].sort(), conflictSetDigest: allConflictSetDigest, effectiveRevision: input.effectiveRevision ?? null, sourceRevisionSetDigest: lineage.sourceRevisionSetDigest ?? null, ancestorHardAuthorityDigest: lineage.ancestorHardAuthorityDigest ?? null, effectiveProgramDigest: lineage.effectiveProgramDigest ?? null});\r\n const {serveable: lineageServeable, conflicts: _lineageConflicts, ...lineageData}=lineage;\r\n return Object.freeze({chain, permissions, delegationIds: Object.freeze([...ids].sort()), compositionDigest, conflictSetDigest: allConflictSetDigest, conflictSummary:conflictSummary(allConflicts), conflicts: allConflicts, serveable: allConflicts.length===0 && lineageServeable, ...(input.effectiveRevision ? {effectiveRevision: Object.freeze({...input.effectiveRevision})} : {}), ...lineageData});\r\n}\r\n\r\n/** Reference-shaped exception delegation: parent-authored, exact-child and digest-bound. */\r\nexport function composeReferenceDelegatedScope(input: {chain: readonly HierarchicalScope[]; delegation: ReferenceScopeDelegation; now?: string; availablePermissions?: readonly string[]; effectiveRevision?: EffectiveRevisionBinding; sourceRevisions?: readonly ScopeBehaviorRevision[]}): ComposedScope {\r\n const delegation = input.delegation;\r\n const allowedEffects = new Set(['allow','deny','require_approval','numeric_limit','redact','transform','escalate']);\r\n if (delegation.exceptionEffectTypes !== undefined &&\r\n (!Array.isArray(delegation.exceptionEffectTypes) ||\r\n delegation.exceptionEffectTypes.length > 7 ||\r\n new Set(delegation.exceptionEffectTypes).size !== delegation.exceptionEffectTypes.length ||\r\n delegation.exceptionEffectTypes.some(effect => !allowedEffects.has(effect)))) {\r\n throw new Error('SCOPE_DELEGATION_EXCEPTION_EFFECT_TYPES_INVALID');\r\n }\r\n if (delegation.parentAuthorityLevel !== delegation.fromLevel || delegation.childScopeKind !== delegation.toLevel) throw new Error('SCOPE_DELEGATION_AUTHORITY_LEVEL_MISMATCH');\r\n const child = input.chain.find(item => item.level === delegation.childScopeKind && item.id === delegation.subjectId);\r\n if (!child || !/^[a-f0-9]{64}$/.test(delegation.childScopeDigest)) throw new Error('SCOPE_DELEGATION_CHILD_DIGEST_REQUIRED');\r\n const childDigest = scopeDigest(child);\r\n if (childDigest !== delegation.childScopeDigest) throw new Error('SCOPE_DELEGATION_CHILD_DIGEST_MISMATCH');\r\n if (!/^[a-f0-9]{64}$/.test(delegation.parentRevisionDigest) || delegation.when.kind !== 'all' || delegation.when.expressions.length !== 0 || !delegation.permissions.includes('exception')) throw new Error('SCOPE_DELEGATION_ENVELOPE_INVALID');\r\n const parentRevision = input.sourceRevisions?.find(revision => revision.level === delegation.parentAuthorityLevel);\r\n if (parentRevision && parentRevision.digest !== delegation.parentRevisionDigest) throw new Error('SCOPE_DELEGATION_PARENT_REVISION_DIGEST_MISMATCH');\r\n return composeScope({chain: input.chain, delegation, now: input.now, availablePermissions: input.availablePermissions, effectiveRevision: input.effectiveRevision, sourceRevisions: input.sourceRevisions});\r\n}\r\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAQ,cAAAA,mBAAiB;AAGzB,SAAQ,YAAW;;;ACHnB,SAAQ,kBAAiB;AACzB,SAAS,UAAU,OAAwB;AAAE,MAAI,UAAU,QAAQ,OAAO,UAAU,SAAU,QAAO,KAAK,UAAU,KAAK;AAAG,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,IAAI,MAAM,IAAI,SAAS,EAAE,KAAK,GAAG,CAAC;AAAK,SAAO,IAAI,OAAO,KAAK,KAAgC,EAAE,KAAK,EAAE,IAAI,SAAO,GAAG,KAAK,UAAU,GAAG,CAAC,IAAI,UAAW,MAAkC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,GAAG,CAAC;AAAK;AAC7W,IAAM,SAAO,CAAC,UAA2B,WAAW,QAAQ,EAAE,OAAO,UAAU,KAAK,CAAC,EAAE,OAAO,KAAK;AA8D5F,SAAS,6BAA6B,UAA+B;AAC1E,QAAM,oBAAoB,OAAO,SAAS,SAAS;AACnD,MAAI,sBAAsB,SAAS,kBAAmB,OAAM,IAAI,MAAM,gCAAgC;AACtG,QAAM,oBAAoB,OAAO,EAAC,OAAO,SAAS,OAAO,aAAa,SAAS,aAAa,eAAe,CAAC,GAAI,SAAS,iBAAiB,CAAC,CAAE,EAAE,KAAK,GAAG,mBAAmB,mBAAmB,SAAS,qBAAqB,MAAM,yBAAyB,SAAS,2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