@voce-engine/core 0.1.0-rc.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/dist/m4.d.ts ADDED
@@ -0,0 +1,157 @@
1
+ import type { Budget, Cleanup, CompilationContext, Compensation, Constraint, ConstraintCompilationInput, ConstraintConflict, ConstraintDependency, ConstraintIR, ConstraintWaiver, DataTransfer, Degradation, DispatchPreflightResult, DispatchSnapshot, ExecutionAuthorization, ExplainResult, Goal, OutputContract, PipelinePlan, PipelinePlanningInput, PipelinePlanningResult, PipelineStep, ProviderCapabilityProfile, ReferenceCandidate, ReferenceDependency, ReferenceOmission, ReferencePlan, ReferencePlanningInput, RemoteCallAuthorization, ResourceClaim, ReviewRequirement, RuleTrace, SemanticDiff } from '@voce-engine/contracts';
2
+ export declare const CONSTRAINT_COMPILER_VERSION = "voce.constraint-compiler/v1alpha1";
3
+ export declare const REFERENCE_OPTIMIZER_VERSION = "voce.reference-budget-optimizer/v1alpha1";
4
+ export declare const PIPELINE_PLANNER_VERSION = "voce.pipeline-planner/v1alpha1";
5
+ export declare const REMOTE_AUTHORIZATION_VERSION = "voce.authorization-preflight/v1alpha1";
6
+ export declare const FIXED_M4_TIME = "2026-01-01T00:00:00.000Z";
7
+ export declare function computeOntologyInstanceHash(instance: ConstraintCompilationInput['ontologyInstance']): string;
8
+ export declare function computeCompilationContextHash(context: CompilationContext): string;
9
+ export declare function computeOutputContractHash(contract: OutputContract): string;
10
+ export declare function computeConstraintHash(constraint: Constraint): string;
11
+ export declare function computeGoalHash(goal: Goal): string;
12
+ export declare function computeConstraintDependencyHash(dependency: ConstraintDependency): string;
13
+ export declare function computeResourceClaimHash(claim: ResourceClaim): string;
14
+ export declare function computeConstraintConflictHash(conflict: ConstraintConflict): string;
15
+ export declare function computeDegradationHash(degradation: Degradation): string;
16
+ export declare function computeRuleTraceHash(trace: RuleTrace): string;
17
+ export declare function computeReviewRequirementHash(requirement: ReviewRequirement): string;
18
+ export declare function computeConstraintIRSignature(ir: ConstraintIR): string;
19
+ export declare function computeReferenceCandidateHash(candidate: ReferenceCandidate): string;
20
+ export declare function computeReferenceDependencyHash(dependency: ReferenceDependency): string;
21
+ export declare function computeReferenceOmissionHash(omission: ReferenceOmission): string;
22
+ export declare function createReferenceCandidate(input: Omit<ReferenceCandidate, 'candidateHash'>): ReferenceCandidate;
23
+ export declare function createReferenceDependency(input: Omit<ReferenceDependency, 'dependencyHash'>): ReferenceDependency;
24
+ type ProviderCapabilityProfileForHash = Omit<ProviderCapabilityProfile, 'profileHash'>;
25
+ export declare function computeProviderCapabilityProfileHash(profile: ProviderCapabilityProfileForHash): string;
26
+ export declare function computeBudgetHash(budget: Budget): string;
27
+ export declare function computeDataTransferHash(transfer: DataTransfer): string;
28
+ export declare function computeCleanupHash(cleanup: Cleanup): string;
29
+ export declare function computeCompensationHash(compensation: Compensation): string;
30
+ export declare function computePipelineStepHash(step: PipelineStep): string;
31
+ export declare function computePipelinePlanHash(plan: PipelinePlan): string;
32
+ export declare function computeRemoteCallAuthorizationHash(authorization: RemoteCallAuthorization): string;
33
+ export declare function computeExecutionAuthorizationHash(authorization: ExecutionAuthorization): string;
34
+ export declare function computeConstraintWaiverHash(waiver: ConstraintWaiver): string;
35
+ export declare function createConstraint(input: Omit<Constraint, 'constraintHash'>): Constraint;
36
+ export declare function createGoal(input: Omit<Goal, 'goalHash'>): Goal;
37
+ export declare function createConstraintDependency(input: Omit<ConstraintDependency, 'dependencyHash'>): ConstraintDependency;
38
+ export declare function createResourceClaim(input: Omit<ResourceClaim, 'resourceHash'>): ResourceClaim;
39
+ export declare function createConstraintConflict(input: Omit<ConstraintConflict, 'conflictHash'>): ConstraintConflict;
40
+ export declare function createDegradation(input: Omit<Degradation, 'degradationHash'>): Degradation;
41
+ export declare function createRuleTrace(input: Omit<RuleTrace, 'traceHash'>): RuleTrace;
42
+ export declare function createReviewRequirement(input: Omit<ReviewRequirement, 'reviewHash'>): ReviewRequirement;
43
+ export declare function createBudget(input: Omit<Budget, 'budgetHash'>): Budget;
44
+ export declare function createDataTransfer(input: Omit<DataTransfer, 'transferHash'>): DataTransfer;
45
+ export declare function createRemoteCallAuthorization(input: Omit<RemoteCallAuthorization, 'authorizationHash'>): RemoteCallAuthorization;
46
+ export declare function createExecutionAuthorization(input: Omit<ExecutionAuthorization, 'authorizationHash'>): ExecutionAuthorization;
47
+ export declare function createConstraintWaiver(input: Omit<ConstraintWaiver, 'waiverHash'>): ConstraintWaiver;
48
+ /**
49
+ * These are plain declarative records. They are deliberately not keyed to a
50
+ * scenario name; a ScenarioPack may copy, extend, or replace them through its
51
+ * `rulePacks` contribution.
52
+ */
53
+ export declare const M4_RULE_FIXTURES: {
54
+ readonly maskIdentity: {
55
+ readonly id: "rule.mask-identity-visibility";
56
+ readonly ruleType: "occlusion";
57
+ readonly leftPaths: readonly ["person.identity", "person.face"];
58
+ readonly rightPaths: readonly ["accessories.mask", "mask", "person.faceMask"];
59
+ readonly rightTokens: readonly ["full_face", "full-face", "fullface", "opaque_face"];
60
+ readonly importance: "preferred";
61
+ readonly code: "MASK_IDENTITY_VISIBILITY_CONFLICT";
62
+ readonly reasonCode: "MASK_OCCLUDES_REQUIRED_IDENTITY";
63
+ readonly message: "A full-face mask occludes a required identity-visibility constraint.";
64
+ };
65
+ readonly sleeveBracelet: {
66
+ readonly id: "rule.sleeve-bracelet-occlusion";
67
+ readonly ruleType: "occlusion";
68
+ readonly leftPaths: readonly ["accessories.bracelet", "jewelry.bracelet", "wrist.accessory"];
69
+ readonly rightPaths: readonly ["wardrobe.sleeve", "wardrobe.sleeves", "garment.sleeve"];
70
+ readonly rightTokens: readonly ["wrist_cover", "full_length", "long", "long_sleeve", "covers_wrist"];
71
+ readonly importance: "required";
72
+ readonly code: "SLEEVE_BRACELET_OCCLUSION";
73
+ readonly reasonCode: "SLEEVE_COVERS_REQUIRED_BRACELET";
74
+ readonly message: "A sleeve coverage requirement occludes a required bracelet detail.";
75
+ };
76
+ readonly handProp: {
77
+ readonly id: "rule.hand-prop-resource";
78
+ readonly ruleType: "resource";
79
+ readonly leftPaths: readonly ["accessories.bracelet", "jewelry", "accessories.hand"];
80
+ readonly rightPaths: readonly ["prop", "props", "pose.hand", "hand"];
81
+ readonly rightTokens: readonly ["held", "left", "right", "two_hands", "both_hands"];
82
+ readonly importance: "required";
83
+ readonly code: "HAND_PROP_RESOURCE_CONFLICT";
84
+ readonly reasonCode: "HAND_RESOURCE_OVERLAP";
85
+ readonly message: "A hand-worn or hand-held requirement claims the same exclusive hand resource as a prop.";
86
+ readonly resourceId: "hand";
87
+ };
88
+ };
89
+ export declare const M4_DECLARATIVE_RULE_FIXTURES: ({
90
+ readonly id: "rule.mask-identity-visibility";
91
+ readonly ruleType: "occlusion";
92
+ readonly leftPaths: readonly ["person.identity", "person.face"];
93
+ readonly rightPaths: readonly ["accessories.mask", "mask", "person.faceMask"];
94
+ readonly rightTokens: readonly ["full_face", "full-face", "fullface", "opaque_face"];
95
+ readonly importance: "preferred";
96
+ readonly code: "MASK_IDENTITY_VISIBILITY_CONFLICT";
97
+ readonly reasonCode: "MASK_OCCLUDES_REQUIRED_IDENTITY";
98
+ readonly message: "A full-face mask occludes a required identity-visibility constraint.";
99
+ } | {
100
+ readonly id: "rule.sleeve-bracelet-occlusion";
101
+ readonly ruleType: "occlusion";
102
+ readonly leftPaths: readonly ["accessories.bracelet", "jewelry.bracelet", "wrist.accessory"];
103
+ readonly rightPaths: readonly ["wardrobe.sleeve", "wardrobe.sleeves", "garment.sleeve"];
104
+ readonly rightTokens: readonly ["wrist_cover", "full_length", "long", "long_sleeve", "covers_wrist"];
105
+ readonly importance: "required";
106
+ readonly code: "SLEEVE_BRACELET_OCCLUSION";
107
+ readonly reasonCode: "SLEEVE_COVERS_REQUIRED_BRACELET";
108
+ readonly message: "A sleeve coverage requirement occludes a required bracelet detail.";
109
+ } | {
110
+ readonly id: "rule.hand-prop-resource";
111
+ readonly ruleType: "resource";
112
+ readonly leftPaths: readonly ["accessories.bracelet", "jewelry", "accessories.hand"];
113
+ readonly rightPaths: readonly ["prop", "props", "pose.hand", "hand"];
114
+ readonly rightTokens: readonly ["held", "left", "right", "two_hands", "both_hands"];
115
+ readonly importance: "required";
116
+ readonly code: "HAND_PROP_RESOURCE_CONFLICT";
117
+ readonly reasonCode: "HAND_RESOURCE_OVERLAP";
118
+ readonly message: "A hand-worn or hand-held requirement claims the same exclusive hand resource as a prop.";
119
+ readonly resourceId: "hand";
120
+ })[];
121
+ export declare class ConstraintGraphCompiler {
122
+ compile(input: ConstraintCompilationInput): ConstraintIR;
123
+ private compileSafe;
124
+ }
125
+ export declare const DeterministicConstraintGraphCompiler: typeof ConstraintGraphCompiler;
126
+ export declare function compileConstraints(input: ConstraintCompilationInput): ConstraintIR;
127
+ export declare function compileConstraintIR(input: ConstraintCompilationInput): ConstraintIR;
128
+ export declare function computeReferencePlanHash(plan: ReferencePlan): string;
129
+ export declare class ReferenceBudgetOptimizer {
130
+ plan(input: ReferencePlanningInput): ReferencePlan;
131
+ private planSafe;
132
+ }
133
+ export declare const DeterministicReferenceBudgetOptimizer: typeof ReferenceBudgetOptimizer;
134
+ export declare function planReferences(input: ReferencePlanningInput): ReferencePlan;
135
+ export declare function optimizeReferenceBudget(input: ReferencePlanningInput): ReferencePlan;
136
+ export declare const MOCK_IMAGE_PROFILE: ProviderCapabilityProfile;
137
+ export declare const MOCK_JPEG_PROFILE: ProviderCapabilityProfile;
138
+ export declare const MOCK_LIMITED_REFERENCE_PROFILE: ProviderCapabilityProfile;
139
+ export declare const MOCK_PROVIDER_CAPABILITY_PROFILES: ProviderCapabilityProfile[];
140
+ export declare class CapabilityAwarePipelinePlanner {
141
+ plan(input: PipelinePlanningInput): PipelinePlanningResult;
142
+ private planSafe;
143
+ }
144
+ export declare const DeterministicCapabilityAwarePipelinePlanner: typeof CapabilityAwarePipelinePlanner;
145
+ export declare function planPipeline(input: PipelinePlanningInput): PipelinePlanningResult;
146
+ export declare function planCapabilityAwarePipeline(input: PipelinePlanningInput): PipelinePlanningResult;
147
+ export declare function dispatchPreflight(authorization: RemoteCallAuthorization | ExecutionAuthorization, snapshot: DispatchSnapshot, now?: string): DispatchPreflightResult;
148
+ export declare const preflightDispatch: typeof dispatchPreflight;
149
+ export declare const dispatchPreflightPure: typeof dispatchPreflight;
150
+ export declare function explainConstraintIR(ir: ConstraintIR): ExplainResult;
151
+ export declare function explainReferencePlan(plan: ReferencePlan): ExplainResult;
152
+ export declare function explainPipelinePlan(plan: PipelinePlan): ExplainResult;
153
+ export declare function semanticDiff(kind: SemanticDiff['artifactKind'], before: ConstraintIR | ReferencePlan | PipelinePlan, after: ConstraintIR | ReferencePlan | PipelinePlan): SemanticDiff;
154
+ export declare function diffConstraintIR(before: ConstraintIR, after: ConstraintIR): SemanticDiff;
155
+ export declare function diffReferencePlan(before: ReferencePlan, after: ReferencePlan): SemanticDiff;
156
+ export declare function diffPipelinePlan(before: PipelinePlan, after: PipelinePlan): SemanticDiff;
157
+ export {};