@plasius/gpu-model-core 0.3.0 → 0.4.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/README.md +148 -0
- package/dist/index.cjs +579 -217
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +192 -1
- package/dist/index.d.ts +192 -1
- package/dist/index.js +575 -217
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -733,6 +733,197 @@ declare function isGpuModelResourceGraph(value: unknown): value is GpuModelResou
|
|
|
733
733
|
*/
|
|
734
734
|
declare function createGpuModelResourceGraph(document: unknown, input: unknown): GpuModelResourceGraph;
|
|
735
735
|
|
|
736
|
+
/** Inert provenance hints. Never put credentials or signed URLs in this metadata. */
|
|
737
|
+
interface ModelProvenance {
|
|
738
|
+
readonly sourceId?: string;
|
|
739
|
+
readonly sourceSystem?: string;
|
|
740
|
+
readonly acquiredAt?: string;
|
|
741
|
+
readonly licenseHint?: string;
|
|
742
|
+
}
|
|
743
|
+
interface SourceHints {
|
|
744
|
+
readonly mimeTypeHint?: string;
|
|
745
|
+
readonly fileNameHint?: string;
|
|
746
|
+
readonly provenance?: ModelProvenance;
|
|
747
|
+
}
|
|
748
|
+
/** Node Readable streams implement AsyncIterable; no Node types enter browser declarations. */
|
|
749
|
+
type ModelReadableStream = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
|
|
750
|
+
/** Portable subset also implemented by Node Writable streams. */
|
|
751
|
+
type ModelWritableStream = WritableStream<Uint8Array> | {
|
|
752
|
+
write(chunk: Uint8Array): boolean;
|
|
753
|
+
end(): unknown;
|
|
754
|
+
};
|
|
755
|
+
/** Declarative IO; the injected adapter/runtime owns resolution and authorization. */
|
|
756
|
+
type ModelSource = SourceHints & ({
|
|
757
|
+
readonly kind: "file-path";
|
|
758
|
+
readonly path: string;
|
|
759
|
+
} | {
|
|
760
|
+
readonly kind: "url";
|
|
761
|
+
readonly url: string;
|
|
762
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
763
|
+
} | {
|
|
764
|
+
readonly kind: "blob-storage-url";
|
|
765
|
+
readonly url: string;
|
|
766
|
+
readonly credentialMode?: "anonymous" | "signed" | "runtime-resolved";
|
|
767
|
+
} | {
|
|
768
|
+
readonly kind: "blob";
|
|
769
|
+
readonly blob: Blob;
|
|
770
|
+
} | {
|
|
771
|
+
readonly kind: "array-buffer";
|
|
772
|
+
readonly bytes: ArrayBuffer;
|
|
773
|
+
} | {
|
|
774
|
+
readonly kind: "uint8-array";
|
|
775
|
+
readonly bytes: Uint8Array;
|
|
776
|
+
} | {
|
|
777
|
+
readonly kind: "stream";
|
|
778
|
+
readonly stream: ModelReadableStream;
|
|
779
|
+
readonly byteLengthHint?: number;
|
|
780
|
+
});
|
|
781
|
+
/** Each call selects exactly one output destination. */
|
|
782
|
+
type ModelTarget = {
|
|
783
|
+
readonly kind: "file-path";
|
|
784
|
+
readonly path: string;
|
|
785
|
+
readonly overwrite?: boolean;
|
|
786
|
+
} | {
|
|
787
|
+
readonly kind: "blob-storage-url";
|
|
788
|
+
readonly url: string;
|
|
789
|
+
readonly overwrite?: boolean;
|
|
790
|
+
readonly contentType?: string;
|
|
791
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
792
|
+
} | {
|
|
793
|
+
readonly kind: "blob";
|
|
794
|
+
readonly mimeType?: string;
|
|
795
|
+
readonly fileName?: string;
|
|
796
|
+
} | {
|
|
797
|
+
readonly kind: "array-buffer";
|
|
798
|
+
} | {
|
|
799
|
+
readonly kind: "uint8-array";
|
|
800
|
+
} | {
|
|
801
|
+
readonly kind: "stream";
|
|
802
|
+
readonly stream: ModelWritableStream;
|
|
803
|
+
readonly contentType?: string;
|
|
804
|
+
} | {
|
|
805
|
+
readonly kind: "package";
|
|
806
|
+
readonly packageFormat: "zip" | "tar" | "directory-manifest";
|
|
807
|
+
readonly destinationHint?: string;
|
|
808
|
+
readonly includeSourcePayload?: boolean;
|
|
809
|
+
};
|
|
810
|
+
type RepairMode = GpuModelDiagnosticMode;
|
|
811
|
+
/** Caller policy is authoritative; cancellation/deadline apply to the whole conversion. */
|
|
812
|
+
interface ModelOperationOptions {
|
|
813
|
+
readonly mode?: RepairMode;
|
|
814
|
+
readonly allowLoss?: boolean;
|
|
815
|
+
readonly signal?: AbortSignal;
|
|
816
|
+
readonly timeoutMs?: number;
|
|
817
|
+
}
|
|
818
|
+
type InspectOptions = ModelOperationOptions;
|
|
819
|
+
type LoadOptions = ModelOperationOptions;
|
|
820
|
+
type ExportOptions = ModelOperationOptions;
|
|
821
|
+
type ValidateOptions = ModelOperationOptions;
|
|
822
|
+
interface AdapterCapabilityMetadata {
|
|
823
|
+
readonly formatId: string;
|
|
824
|
+
readonly displayName: string;
|
|
825
|
+
readonly supportedSourceKinds: readonly ModelSource["kind"][];
|
|
826
|
+
readonly supportedTargetKinds: readonly ModelTarget["kind"][];
|
|
827
|
+
readonly supportsAnimations: boolean;
|
|
828
|
+
readonly supportsSkins: boolean;
|
|
829
|
+
readonly supportsAnalyticGeometry: boolean;
|
|
830
|
+
}
|
|
831
|
+
/** Packaging descriptors are not proof of exported bytes or asset promotion. */
|
|
832
|
+
interface ResourcePackageManifest {
|
|
833
|
+
readonly format: "zip" | "tar" | "directory-manifest" | "inline";
|
|
834
|
+
readonly entries: readonly {
|
|
835
|
+
readonly id: string;
|
|
836
|
+
readonly role: "mesh" | "material" | "texture" | "animation" | "auxiliary";
|
|
837
|
+
readonly path: string;
|
|
838
|
+
readonly contentType?: string;
|
|
839
|
+
}[];
|
|
840
|
+
}
|
|
841
|
+
/** Construct through createModelResultBase; derived fields cannot disagree with the report. */
|
|
842
|
+
interface ModelResultBase {
|
|
843
|
+
readonly report: GpuModelDiagnosticReport;
|
|
844
|
+
readonly diagnostics: readonly GpuModelConversionDiagnostic[];
|
|
845
|
+
readonly warnings: readonly GpuModelConversionDiagnostic[];
|
|
846
|
+
readonly repairs: readonly GpuModelRepairRecord[];
|
|
847
|
+
readonly lossReports: GpuModelDiagnosticReport["losses"];
|
|
848
|
+
}
|
|
849
|
+
interface ModelInspectResult extends ModelResultBase {
|
|
850
|
+
readonly detectedFormat?: string;
|
|
851
|
+
readonly capabilities: AdapterCapabilityMetadata;
|
|
852
|
+
}
|
|
853
|
+
interface ModelLoadResult extends ModelResultBase {
|
|
854
|
+
readonly document?: GpuModelDocument;
|
|
855
|
+
readonly resourcePackage?: ResourcePackageManifest;
|
|
856
|
+
}
|
|
857
|
+
interface ModelExportResult extends ModelResultBase {
|
|
858
|
+
readonly target: ModelTarget["kind"];
|
|
859
|
+
readonly resourcePackage?: ResourcePackageManifest;
|
|
860
|
+
readonly output?: Blob | ArrayBuffer | Uint8Array;
|
|
861
|
+
}
|
|
862
|
+
interface ModelValidateResult extends ModelResultBase {
|
|
863
|
+
readonly valid: boolean;
|
|
864
|
+
}
|
|
865
|
+
/** Trusted injected adapter: stage writes and enforce policy before committing output. */
|
|
866
|
+
interface ModelAdapter {
|
|
867
|
+
readonly metadata: AdapterCapabilityMetadata;
|
|
868
|
+
inspect(source: ModelSource, options?: InspectOptions): Promise<ModelInspectResult>;
|
|
869
|
+
load(source: ModelSource, options?: LoadOptions): Promise<ModelLoadResult>;
|
|
870
|
+
export(document: GpuModelDocument, target: ModelTarget, options?: ExportOptions): Promise<ModelExportResult>;
|
|
871
|
+
validate(input: ModelSource | GpuModelDocument, options?: ValidateOptions): Promise<ModelValidateResult>;
|
|
872
|
+
}
|
|
873
|
+
interface ModelConversionStage {
|
|
874
|
+
readonly formatId: string;
|
|
875
|
+
readonly operation: "inspect" | "load" | "capabilities" | "validate" | "export";
|
|
876
|
+
readonly report: GpuModelDiagnosticReport;
|
|
877
|
+
}
|
|
878
|
+
/** No source/target descriptors or exception causes are retained in a ledger. */
|
|
879
|
+
interface ModelRegistryResult {
|
|
880
|
+
readonly accepted: boolean;
|
|
881
|
+
readonly stages: readonly ModelConversionStage[];
|
|
882
|
+
readonly diagnostics: readonly GpuModelConversionDiagnostic[];
|
|
883
|
+
readonly warnings: readonly GpuModelConversionDiagnostic[];
|
|
884
|
+
readonly repairs: readonly GpuModelRepairRecord[];
|
|
885
|
+
readonly lossReports: GpuModelDiagnosticReport["losses"];
|
|
886
|
+
readonly document?: GpuModelDocument;
|
|
887
|
+
readonly inspection?: ModelInspectResult;
|
|
888
|
+
readonly resourcePackage?: ResourcePackageManifest;
|
|
889
|
+
readonly exported?: ModelExportResult;
|
|
890
|
+
}
|
|
891
|
+
interface ModelConversionRequest {
|
|
892
|
+
readonly sourceFormat: string;
|
|
893
|
+
readonly targetFormat: string;
|
|
894
|
+
readonly source: ModelSource;
|
|
895
|
+
readonly target: ModelTarget;
|
|
896
|
+
}
|
|
897
|
+
interface ModelConversionRegistry {
|
|
898
|
+
readonly capabilities: readonly AdapterCapabilityMetadata[];
|
|
899
|
+
inspect(format: string, source: ModelSource, options?: InspectOptions): Promise<ModelRegistryResult>;
|
|
900
|
+
load(format: string, source: ModelSource, options?: LoadOptions): Promise<ModelRegistryResult>;
|
|
901
|
+
validate(format: string, input: ModelSource | GpuModelDocument, options?: ValidateOptions): Promise<ModelRegistryResult>;
|
|
902
|
+
export(format: string, document: GpuModelDocument, target: ModelTarget, options?: ExportOptions): Promise<ModelRegistryResult>;
|
|
903
|
+
convert(request: ModelConversionRequest, options?: ModelOperationOptions): Promise<ModelRegistryResult>;
|
|
904
|
+
}
|
|
905
|
+
declare const MODEL_REGISTRY_LIMITS: Readonly<{
|
|
906
|
+
adapters: 128;
|
|
907
|
+
concurrent: 8;
|
|
908
|
+
timeoutMs: 30000;
|
|
909
|
+
maxTimeoutMs: 300000;
|
|
910
|
+
string: 4096;
|
|
911
|
+
mapEntries: 64;
|
|
912
|
+
manifestEntries: 4096;
|
|
913
|
+
memoryBytes: number;
|
|
914
|
+
}>;
|
|
915
|
+
type ModelRegistryErrorCode = "invalid-input" | "invalid-adapter" | "duplicate-format" | "unsupported-format" | "unsupported-source" | "unsupported-target" | "invalid-result" | "adapter-failed" | "aborted" | "deadline-exceeded" | "capacity-exceeded";
|
|
916
|
+
declare class ModelRegistryError extends TypeError {
|
|
917
|
+
readonly code: ModelRegistryErrorCode;
|
|
918
|
+
constructor(code: ModelRegistryErrorCode);
|
|
919
|
+
}
|
|
920
|
+
/** Evaluates, copies and freezes bounded adapter evidence using the core repair policy. */
|
|
921
|
+
declare function createModelResultBase(input: GpuModelDiagnosticInput): ModelResultBase;
|
|
922
|
+
/** Creates an immutable fixed registry. No global discovery, format sniffing or IO. */
|
|
923
|
+
declare function createModelConversionRegistry(adapters: readonly ModelAdapter[], limits?: {
|
|
924
|
+
readonly maxConcurrent?: number;
|
|
925
|
+
}): ModelConversionRegistry;
|
|
926
|
+
|
|
736
927
|
/** Package identity and rollout metadata for the initial repository baseline. */
|
|
737
928
|
declare const packageName: "@plasius/gpu-model-core";
|
|
738
929
|
declare const packageBootstrap: Readonly<{
|
|
@@ -741,4 +932,4 @@ declare const packageBootstrap: Readonly<{
|
|
|
741
932
|
readonly status: "bootstrap";
|
|
742
933
|
}>;
|
|
743
934
|
|
|
744
|
-
export { CANONICAL_GPU_MODEL_COORDINATE_SYSTEM, GPU_MODEL_DIAGNOSTIC_LIMITS, GPU_MODEL_DOCUMENT_LIMITS, GPU_MODEL_DOCUMENT_SCHEMA_VERSION, GPU_MODEL_REPAIR_RULES, GPU_MODEL_RESOURCE_GRAPH_LIMITS, GPU_MODEL_RESOURCE_GRAPH_SCHEMA_VERSION, GPU_MODEL_RESOURCE_VERIFICATION_LIMITS, GPU_MODEL_STATIC_DEMO_FEATURE_FLAG, GPU_MODEL_STATIC_DEMO_LIMITS, GPU_MODEL_STATIC_DEMO_MAX_ABSOLUTE_COORDINATE_METRES, GPU_MODEL_STATIC_DEMO_MAX_DIAGONAL_METRES, GPU_MODEL_STATIC_DEMO_MAX_EXTENT_METRES, GPU_MODEL_STATIC_DEMO_NORMALIZATION_CONTRACT, GPU_MODEL_STATIC_DEMO_PROFILE_VERSION, type GpuModelAccessor, type GpuModelAccessorComponentType, type GpuModelAccessorElementType, type GpuModelAlphaMode, type GpuModelAnalyticGeometry, type GpuModelAnimation, type GpuModelAnimationChannel, type GpuModelAnimationInterpolation, type GpuModelAnimationSampler, type GpuModelAnimationTargetType, type GpuModelBlendShape, type GpuModelBlendShapeDelta, type GpuModelBounds, type GpuModelConversionDiagnostic, type GpuModelConversionIssue, type GpuModelConversionIssueBase, type GpuModelConversionLoss, type GpuModelConversionResourcePackage, type GpuModelConversionViolation, type GpuModelConversionWarning, type GpuModelDiagnostic, type GpuModelDiagnosticInput, type GpuModelDiagnosticMode, type GpuModelDiagnosticReport, type GpuModelDiagnosticSeverity, type GpuModelDiagnosticStandard, GpuModelDiagnosticsError, type GpuModelDocument, GpuModelDocumentError, type GpuModelDocumentErrorCode, type GpuModelJoint, type GpuModelMaterial, type GpuModelMaterialTextures, type GpuModelMaterialWorkflow, type GpuModelMatrix4, type GpuModelMesh, type GpuModelMetadata, type GpuModelMetadataValue, type GpuModelNode, type GpuModelPrimitive, type GpuModelPrimitiveAttribute, type GpuModelPrimitiveTopology, type GpuModelProvenance, type GpuModelRepairRecord, type GpuModelResource, type GpuModelResourceBinding, type GpuModelResourceGraph, GpuModelResourceGraphError, type GpuModelResourceGraphInput, type GpuModelResourceGraphKind, type GpuModelResourceGraphNode, type GpuModelResourceInspection, type GpuModelResourceKind, type GpuModelResourceLocation, type GpuModelResourceReference, type GpuModelResourceVerificationContext, type GpuModelResourceVerificationLimits, type GpuModelResourceVerificationOptions, type GpuModelResourceVerificationPort, type GpuModelSkeleton, type GpuModelSkin, type GpuModelSourceMetadata, type GpuModelSourceUnit, type GpuModelStaticDemoCompilerInput, type GpuModelStaticDemoCompilerOptions, type GpuModelStaticDemoLimits, type GpuModelStaticDemoMaterial, type GpuModelStaticDemoSourceEvidence, type GpuModelStaticDemoWorldTriangle, type GpuModelTexture, type GpuModelTextureBinding, type GpuModelTextureColorSpace, type GpuModelTextureEmbeddingPolicy, type GpuModelTextureSampler, type GpuModelTextureTransform, type GpuModelTextureUsage, type GpuModelTextureWrap, type GpuModelTransformTrs, type GpuModelTriangleVec3, type GpuModelUnsupportedData, type GpuModelVec2, type GpuModelVec3, type GpuModelVec4, type GpuModelVertexWeightSet, assertGpuModelStaticDemoNormalization, canCreateGpuModelDocument, createAndVerifyGpuModelDocument, createGpuModelDocument, createGpuModelResourceGraph, createGpuModelStaticDemoCompilerInput, encodeGpuModelDocumentCanonical, evaluateGpuModelDiagnostics, gpuModelResourceKey, hashGpuModelDocumentCanonical, isGpuModelDocument, isGpuModelResourceGraph, packageBootstrap, packageName, verifyGpuModelResource };
|
|
935
|
+
export { type AdapterCapabilityMetadata, CANONICAL_GPU_MODEL_COORDINATE_SYSTEM, type ExportOptions, GPU_MODEL_DIAGNOSTIC_LIMITS, GPU_MODEL_DOCUMENT_LIMITS, GPU_MODEL_DOCUMENT_SCHEMA_VERSION, GPU_MODEL_REPAIR_RULES, GPU_MODEL_RESOURCE_GRAPH_LIMITS, GPU_MODEL_RESOURCE_GRAPH_SCHEMA_VERSION, GPU_MODEL_RESOURCE_VERIFICATION_LIMITS, GPU_MODEL_STATIC_DEMO_FEATURE_FLAG, GPU_MODEL_STATIC_DEMO_LIMITS, GPU_MODEL_STATIC_DEMO_MAX_ABSOLUTE_COORDINATE_METRES, GPU_MODEL_STATIC_DEMO_MAX_DIAGONAL_METRES, GPU_MODEL_STATIC_DEMO_MAX_EXTENT_METRES, GPU_MODEL_STATIC_DEMO_NORMALIZATION_CONTRACT, GPU_MODEL_STATIC_DEMO_PROFILE_VERSION, type GpuModelAccessor, type GpuModelAccessorComponentType, type GpuModelAccessorElementType, type GpuModelAlphaMode, type GpuModelAnalyticGeometry, type GpuModelAnimation, type GpuModelAnimationChannel, type GpuModelAnimationInterpolation, type GpuModelAnimationSampler, type GpuModelAnimationTargetType, type GpuModelBlendShape, type GpuModelBlendShapeDelta, type GpuModelBounds, type GpuModelConversionDiagnostic, type GpuModelConversionIssue, type GpuModelConversionIssueBase, type GpuModelConversionLoss, type GpuModelConversionResourcePackage, type GpuModelConversionViolation, type GpuModelConversionWarning, type GpuModelDiagnostic, type GpuModelDiagnosticInput, type GpuModelDiagnosticMode, type GpuModelDiagnosticReport, type GpuModelDiagnosticSeverity, type GpuModelDiagnosticStandard, GpuModelDiagnosticsError, type GpuModelDocument, GpuModelDocumentError, type GpuModelDocumentErrorCode, type GpuModelJoint, type GpuModelMaterial, type GpuModelMaterialTextures, type GpuModelMaterialWorkflow, type GpuModelMatrix4, type GpuModelMesh, type GpuModelMetadata, type GpuModelMetadataValue, type GpuModelNode, type GpuModelPrimitive, type GpuModelPrimitiveAttribute, type GpuModelPrimitiveTopology, type GpuModelProvenance, type GpuModelRepairRecord, type GpuModelResource, type GpuModelResourceBinding, type GpuModelResourceGraph, GpuModelResourceGraphError, type GpuModelResourceGraphInput, type GpuModelResourceGraphKind, type GpuModelResourceGraphNode, type GpuModelResourceInspection, type GpuModelResourceKind, type GpuModelResourceLocation, type GpuModelResourceReference, type GpuModelResourceVerificationContext, type GpuModelResourceVerificationLimits, type GpuModelResourceVerificationOptions, type GpuModelResourceVerificationPort, type GpuModelSkeleton, type GpuModelSkin, type GpuModelSourceMetadata, type GpuModelSourceUnit, type GpuModelStaticDemoCompilerInput, type GpuModelStaticDemoCompilerOptions, type GpuModelStaticDemoLimits, type GpuModelStaticDemoMaterial, type GpuModelStaticDemoSourceEvidence, type GpuModelStaticDemoWorldTriangle, type GpuModelTexture, type GpuModelTextureBinding, type GpuModelTextureColorSpace, type GpuModelTextureEmbeddingPolicy, type GpuModelTextureSampler, type GpuModelTextureTransform, type GpuModelTextureUsage, type GpuModelTextureWrap, type GpuModelTransformTrs, type GpuModelTriangleVec3, type GpuModelUnsupportedData, type GpuModelVec2, type GpuModelVec3, type GpuModelVec4, type GpuModelVertexWeightSet, type InspectOptions, type LoadOptions, MODEL_REGISTRY_LIMITS, type ModelAdapter, type ModelConversionRegistry, type ModelConversionRequest, type ModelConversionStage, type ModelExportResult, type ModelInspectResult, type ModelLoadResult, type ModelOperationOptions, type ModelProvenance, type ModelReadableStream, ModelRegistryError, type ModelRegistryErrorCode, type ModelRegistryResult, type ModelResultBase, type ModelSource, type ModelTarget, type ModelValidateResult, type ModelWritableStream, type RepairMode, type ResourcePackageManifest, type ValidateOptions, assertGpuModelStaticDemoNormalization, canCreateGpuModelDocument, createAndVerifyGpuModelDocument, createGpuModelDocument, createGpuModelResourceGraph, createGpuModelStaticDemoCompilerInput, createModelConversionRegistry, createModelResultBase, encodeGpuModelDocumentCanonical, evaluateGpuModelDiagnostics, gpuModelResourceKey, hashGpuModelDocumentCanonical, isGpuModelDocument, isGpuModelResourceGraph, packageBootstrap, packageName, verifyGpuModelResource };
|
package/dist/index.d.ts
CHANGED
|
@@ -733,6 +733,197 @@ declare function isGpuModelResourceGraph(value: unknown): value is GpuModelResou
|
|
|
733
733
|
*/
|
|
734
734
|
declare function createGpuModelResourceGraph(document: unknown, input: unknown): GpuModelResourceGraph;
|
|
735
735
|
|
|
736
|
+
/** Inert provenance hints. Never put credentials or signed URLs in this metadata. */
|
|
737
|
+
interface ModelProvenance {
|
|
738
|
+
readonly sourceId?: string;
|
|
739
|
+
readonly sourceSystem?: string;
|
|
740
|
+
readonly acquiredAt?: string;
|
|
741
|
+
readonly licenseHint?: string;
|
|
742
|
+
}
|
|
743
|
+
interface SourceHints {
|
|
744
|
+
readonly mimeTypeHint?: string;
|
|
745
|
+
readonly fileNameHint?: string;
|
|
746
|
+
readonly provenance?: ModelProvenance;
|
|
747
|
+
}
|
|
748
|
+
/** Node Readable streams implement AsyncIterable; no Node types enter browser declarations. */
|
|
749
|
+
type ModelReadableStream = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
|
|
750
|
+
/** Portable subset also implemented by Node Writable streams. */
|
|
751
|
+
type ModelWritableStream = WritableStream<Uint8Array> | {
|
|
752
|
+
write(chunk: Uint8Array): boolean;
|
|
753
|
+
end(): unknown;
|
|
754
|
+
};
|
|
755
|
+
/** Declarative IO; the injected adapter/runtime owns resolution and authorization. */
|
|
756
|
+
type ModelSource = SourceHints & ({
|
|
757
|
+
readonly kind: "file-path";
|
|
758
|
+
readonly path: string;
|
|
759
|
+
} | {
|
|
760
|
+
readonly kind: "url";
|
|
761
|
+
readonly url: string;
|
|
762
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
763
|
+
} | {
|
|
764
|
+
readonly kind: "blob-storage-url";
|
|
765
|
+
readonly url: string;
|
|
766
|
+
readonly credentialMode?: "anonymous" | "signed" | "runtime-resolved";
|
|
767
|
+
} | {
|
|
768
|
+
readonly kind: "blob";
|
|
769
|
+
readonly blob: Blob;
|
|
770
|
+
} | {
|
|
771
|
+
readonly kind: "array-buffer";
|
|
772
|
+
readonly bytes: ArrayBuffer;
|
|
773
|
+
} | {
|
|
774
|
+
readonly kind: "uint8-array";
|
|
775
|
+
readonly bytes: Uint8Array;
|
|
776
|
+
} | {
|
|
777
|
+
readonly kind: "stream";
|
|
778
|
+
readonly stream: ModelReadableStream;
|
|
779
|
+
readonly byteLengthHint?: number;
|
|
780
|
+
});
|
|
781
|
+
/** Each call selects exactly one output destination. */
|
|
782
|
+
type ModelTarget = {
|
|
783
|
+
readonly kind: "file-path";
|
|
784
|
+
readonly path: string;
|
|
785
|
+
readonly overwrite?: boolean;
|
|
786
|
+
} | {
|
|
787
|
+
readonly kind: "blob-storage-url";
|
|
788
|
+
readonly url: string;
|
|
789
|
+
readonly overwrite?: boolean;
|
|
790
|
+
readonly contentType?: string;
|
|
791
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
792
|
+
} | {
|
|
793
|
+
readonly kind: "blob";
|
|
794
|
+
readonly mimeType?: string;
|
|
795
|
+
readonly fileName?: string;
|
|
796
|
+
} | {
|
|
797
|
+
readonly kind: "array-buffer";
|
|
798
|
+
} | {
|
|
799
|
+
readonly kind: "uint8-array";
|
|
800
|
+
} | {
|
|
801
|
+
readonly kind: "stream";
|
|
802
|
+
readonly stream: ModelWritableStream;
|
|
803
|
+
readonly contentType?: string;
|
|
804
|
+
} | {
|
|
805
|
+
readonly kind: "package";
|
|
806
|
+
readonly packageFormat: "zip" | "tar" | "directory-manifest";
|
|
807
|
+
readonly destinationHint?: string;
|
|
808
|
+
readonly includeSourcePayload?: boolean;
|
|
809
|
+
};
|
|
810
|
+
type RepairMode = GpuModelDiagnosticMode;
|
|
811
|
+
/** Caller policy is authoritative; cancellation/deadline apply to the whole conversion. */
|
|
812
|
+
interface ModelOperationOptions {
|
|
813
|
+
readonly mode?: RepairMode;
|
|
814
|
+
readonly allowLoss?: boolean;
|
|
815
|
+
readonly signal?: AbortSignal;
|
|
816
|
+
readonly timeoutMs?: number;
|
|
817
|
+
}
|
|
818
|
+
type InspectOptions = ModelOperationOptions;
|
|
819
|
+
type LoadOptions = ModelOperationOptions;
|
|
820
|
+
type ExportOptions = ModelOperationOptions;
|
|
821
|
+
type ValidateOptions = ModelOperationOptions;
|
|
822
|
+
interface AdapterCapabilityMetadata {
|
|
823
|
+
readonly formatId: string;
|
|
824
|
+
readonly displayName: string;
|
|
825
|
+
readonly supportedSourceKinds: readonly ModelSource["kind"][];
|
|
826
|
+
readonly supportedTargetKinds: readonly ModelTarget["kind"][];
|
|
827
|
+
readonly supportsAnimations: boolean;
|
|
828
|
+
readonly supportsSkins: boolean;
|
|
829
|
+
readonly supportsAnalyticGeometry: boolean;
|
|
830
|
+
}
|
|
831
|
+
/** Packaging descriptors are not proof of exported bytes or asset promotion. */
|
|
832
|
+
interface ResourcePackageManifest {
|
|
833
|
+
readonly format: "zip" | "tar" | "directory-manifest" | "inline";
|
|
834
|
+
readonly entries: readonly {
|
|
835
|
+
readonly id: string;
|
|
836
|
+
readonly role: "mesh" | "material" | "texture" | "animation" | "auxiliary";
|
|
837
|
+
readonly path: string;
|
|
838
|
+
readonly contentType?: string;
|
|
839
|
+
}[];
|
|
840
|
+
}
|
|
841
|
+
/** Construct through createModelResultBase; derived fields cannot disagree with the report. */
|
|
842
|
+
interface ModelResultBase {
|
|
843
|
+
readonly report: GpuModelDiagnosticReport;
|
|
844
|
+
readonly diagnostics: readonly GpuModelConversionDiagnostic[];
|
|
845
|
+
readonly warnings: readonly GpuModelConversionDiagnostic[];
|
|
846
|
+
readonly repairs: readonly GpuModelRepairRecord[];
|
|
847
|
+
readonly lossReports: GpuModelDiagnosticReport["losses"];
|
|
848
|
+
}
|
|
849
|
+
interface ModelInspectResult extends ModelResultBase {
|
|
850
|
+
readonly detectedFormat?: string;
|
|
851
|
+
readonly capabilities: AdapterCapabilityMetadata;
|
|
852
|
+
}
|
|
853
|
+
interface ModelLoadResult extends ModelResultBase {
|
|
854
|
+
readonly document?: GpuModelDocument;
|
|
855
|
+
readonly resourcePackage?: ResourcePackageManifest;
|
|
856
|
+
}
|
|
857
|
+
interface ModelExportResult extends ModelResultBase {
|
|
858
|
+
readonly target: ModelTarget["kind"];
|
|
859
|
+
readonly resourcePackage?: ResourcePackageManifest;
|
|
860
|
+
readonly output?: Blob | ArrayBuffer | Uint8Array;
|
|
861
|
+
}
|
|
862
|
+
interface ModelValidateResult extends ModelResultBase {
|
|
863
|
+
readonly valid: boolean;
|
|
864
|
+
}
|
|
865
|
+
/** Trusted injected adapter: stage writes and enforce policy before committing output. */
|
|
866
|
+
interface ModelAdapter {
|
|
867
|
+
readonly metadata: AdapterCapabilityMetadata;
|
|
868
|
+
inspect(source: ModelSource, options?: InspectOptions): Promise<ModelInspectResult>;
|
|
869
|
+
load(source: ModelSource, options?: LoadOptions): Promise<ModelLoadResult>;
|
|
870
|
+
export(document: GpuModelDocument, target: ModelTarget, options?: ExportOptions): Promise<ModelExportResult>;
|
|
871
|
+
validate(input: ModelSource | GpuModelDocument, options?: ValidateOptions): Promise<ModelValidateResult>;
|
|
872
|
+
}
|
|
873
|
+
interface ModelConversionStage {
|
|
874
|
+
readonly formatId: string;
|
|
875
|
+
readonly operation: "inspect" | "load" | "capabilities" | "validate" | "export";
|
|
876
|
+
readonly report: GpuModelDiagnosticReport;
|
|
877
|
+
}
|
|
878
|
+
/** No source/target descriptors or exception causes are retained in a ledger. */
|
|
879
|
+
interface ModelRegistryResult {
|
|
880
|
+
readonly accepted: boolean;
|
|
881
|
+
readonly stages: readonly ModelConversionStage[];
|
|
882
|
+
readonly diagnostics: readonly GpuModelConversionDiagnostic[];
|
|
883
|
+
readonly warnings: readonly GpuModelConversionDiagnostic[];
|
|
884
|
+
readonly repairs: readonly GpuModelRepairRecord[];
|
|
885
|
+
readonly lossReports: GpuModelDiagnosticReport["losses"];
|
|
886
|
+
readonly document?: GpuModelDocument;
|
|
887
|
+
readonly inspection?: ModelInspectResult;
|
|
888
|
+
readonly resourcePackage?: ResourcePackageManifest;
|
|
889
|
+
readonly exported?: ModelExportResult;
|
|
890
|
+
}
|
|
891
|
+
interface ModelConversionRequest {
|
|
892
|
+
readonly sourceFormat: string;
|
|
893
|
+
readonly targetFormat: string;
|
|
894
|
+
readonly source: ModelSource;
|
|
895
|
+
readonly target: ModelTarget;
|
|
896
|
+
}
|
|
897
|
+
interface ModelConversionRegistry {
|
|
898
|
+
readonly capabilities: readonly AdapterCapabilityMetadata[];
|
|
899
|
+
inspect(format: string, source: ModelSource, options?: InspectOptions): Promise<ModelRegistryResult>;
|
|
900
|
+
load(format: string, source: ModelSource, options?: LoadOptions): Promise<ModelRegistryResult>;
|
|
901
|
+
validate(format: string, input: ModelSource | GpuModelDocument, options?: ValidateOptions): Promise<ModelRegistryResult>;
|
|
902
|
+
export(format: string, document: GpuModelDocument, target: ModelTarget, options?: ExportOptions): Promise<ModelRegistryResult>;
|
|
903
|
+
convert(request: ModelConversionRequest, options?: ModelOperationOptions): Promise<ModelRegistryResult>;
|
|
904
|
+
}
|
|
905
|
+
declare const MODEL_REGISTRY_LIMITS: Readonly<{
|
|
906
|
+
adapters: 128;
|
|
907
|
+
concurrent: 8;
|
|
908
|
+
timeoutMs: 30000;
|
|
909
|
+
maxTimeoutMs: 300000;
|
|
910
|
+
string: 4096;
|
|
911
|
+
mapEntries: 64;
|
|
912
|
+
manifestEntries: 4096;
|
|
913
|
+
memoryBytes: number;
|
|
914
|
+
}>;
|
|
915
|
+
type ModelRegistryErrorCode = "invalid-input" | "invalid-adapter" | "duplicate-format" | "unsupported-format" | "unsupported-source" | "unsupported-target" | "invalid-result" | "adapter-failed" | "aborted" | "deadline-exceeded" | "capacity-exceeded";
|
|
916
|
+
declare class ModelRegistryError extends TypeError {
|
|
917
|
+
readonly code: ModelRegistryErrorCode;
|
|
918
|
+
constructor(code: ModelRegistryErrorCode);
|
|
919
|
+
}
|
|
920
|
+
/** Evaluates, copies and freezes bounded adapter evidence using the core repair policy. */
|
|
921
|
+
declare function createModelResultBase(input: GpuModelDiagnosticInput): ModelResultBase;
|
|
922
|
+
/** Creates an immutable fixed registry. No global discovery, format sniffing or IO. */
|
|
923
|
+
declare function createModelConversionRegistry(adapters: readonly ModelAdapter[], limits?: {
|
|
924
|
+
readonly maxConcurrent?: number;
|
|
925
|
+
}): ModelConversionRegistry;
|
|
926
|
+
|
|
736
927
|
/** Package identity and rollout metadata for the initial repository baseline. */
|
|
737
928
|
declare const packageName: "@plasius/gpu-model-core";
|
|
738
929
|
declare const packageBootstrap: Readonly<{
|
|
@@ -741,4 +932,4 @@ declare const packageBootstrap: Readonly<{
|
|
|
741
932
|
readonly status: "bootstrap";
|
|
742
933
|
}>;
|
|
743
934
|
|
|
744
|
-
export { CANONICAL_GPU_MODEL_COORDINATE_SYSTEM, GPU_MODEL_DIAGNOSTIC_LIMITS, GPU_MODEL_DOCUMENT_LIMITS, GPU_MODEL_DOCUMENT_SCHEMA_VERSION, GPU_MODEL_REPAIR_RULES, GPU_MODEL_RESOURCE_GRAPH_LIMITS, GPU_MODEL_RESOURCE_GRAPH_SCHEMA_VERSION, GPU_MODEL_RESOURCE_VERIFICATION_LIMITS, GPU_MODEL_STATIC_DEMO_FEATURE_FLAG, GPU_MODEL_STATIC_DEMO_LIMITS, GPU_MODEL_STATIC_DEMO_MAX_ABSOLUTE_COORDINATE_METRES, GPU_MODEL_STATIC_DEMO_MAX_DIAGONAL_METRES, GPU_MODEL_STATIC_DEMO_MAX_EXTENT_METRES, GPU_MODEL_STATIC_DEMO_NORMALIZATION_CONTRACT, GPU_MODEL_STATIC_DEMO_PROFILE_VERSION, type GpuModelAccessor, type GpuModelAccessorComponentType, type GpuModelAccessorElementType, type GpuModelAlphaMode, type GpuModelAnalyticGeometry, type GpuModelAnimation, type GpuModelAnimationChannel, type GpuModelAnimationInterpolation, type GpuModelAnimationSampler, type GpuModelAnimationTargetType, type GpuModelBlendShape, type GpuModelBlendShapeDelta, type GpuModelBounds, type GpuModelConversionDiagnostic, type GpuModelConversionIssue, type GpuModelConversionIssueBase, type GpuModelConversionLoss, type GpuModelConversionResourcePackage, type GpuModelConversionViolation, type GpuModelConversionWarning, type GpuModelDiagnostic, type GpuModelDiagnosticInput, type GpuModelDiagnosticMode, type GpuModelDiagnosticReport, type GpuModelDiagnosticSeverity, type GpuModelDiagnosticStandard, GpuModelDiagnosticsError, type GpuModelDocument, GpuModelDocumentError, type GpuModelDocumentErrorCode, type GpuModelJoint, type GpuModelMaterial, type GpuModelMaterialTextures, type GpuModelMaterialWorkflow, type GpuModelMatrix4, type GpuModelMesh, type GpuModelMetadata, type GpuModelMetadataValue, type GpuModelNode, type GpuModelPrimitive, type GpuModelPrimitiveAttribute, type GpuModelPrimitiveTopology, type GpuModelProvenance, type GpuModelRepairRecord, type GpuModelResource, type GpuModelResourceBinding, type GpuModelResourceGraph, GpuModelResourceGraphError, type GpuModelResourceGraphInput, type GpuModelResourceGraphKind, type GpuModelResourceGraphNode, type GpuModelResourceInspection, type GpuModelResourceKind, type GpuModelResourceLocation, type GpuModelResourceReference, type GpuModelResourceVerificationContext, type GpuModelResourceVerificationLimits, type GpuModelResourceVerificationOptions, type GpuModelResourceVerificationPort, type GpuModelSkeleton, type GpuModelSkin, type GpuModelSourceMetadata, type GpuModelSourceUnit, type GpuModelStaticDemoCompilerInput, type GpuModelStaticDemoCompilerOptions, type GpuModelStaticDemoLimits, type GpuModelStaticDemoMaterial, type GpuModelStaticDemoSourceEvidence, type GpuModelStaticDemoWorldTriangle, type GpuModelTexture, type GpuModelTextureBinding, type GpuModelTextureColorSpace, type GpuModelTextureEmbeddingPolicy, type GpuModelTextureSampler, type GpuModelTextureTransform, type GpuModelTextureUsage, type GpuModelTextureWrap, type GpuModelTransformTrs, type GpuModelTriangleVec3, type GpuModelUnsupportedData, type GpuModelVec2, type GpuModelVec3, type GpuModelVec4, type GpuModelVertexWeightSet, assertGpuModelStaticDemoNormalization, canCreateGpuModelDocument, createAndVerifyGpuModelDocument, createGpuModelDocument, createGpuModelResourceGraph, createGpuModelStaticDemoCompilerInput, encodeGpuModelDocumentCanonical, evaluateGpuModelDiagnostics, gpuModelResourceKey, hashGpuModelDocumentCanonical, isGpuModelDocument, isGpuModelResourceGraph, packageBootstrap, packageName, verifyGpuModelResource };
|
|
935
|
+
export { type AdapterCapabilityMetadata, CANONICAL_GPU_MODEL_COORDINATE_SYSTEM, type ExportOptions, GPU_MODEL_DIAGNOSTIC_LIMITS, GPU_MODEL_DOCUMENT_LIMITS, GPU_MODEL_DOCUMENT_SCHEMA_VERSION, GPU_MODEL_REPAIR_RULES, GPU_MODEL_RESOURCE_GRAPH_LIMITS, GPU_MODEL_RESOURCE_GRAPH_SCHEMA_VERSION, GPU_MODEL_RESOURCE_VERIFICATION_LIMITS, GPU_MODEL_STATIC_DEMO_FEATURE_FLAG, GPU_MODEL_STATIC_DEMO_LIMITS, GPU_MODEL_STATIC_DEMO_MAX_ABSOLUTE_COORDINATE_METRES, GPU_MODEL_STATIC_DEMO_MAX_DIAGONAL_METRES, GPU_MODEL_STATIC_DEMO_MAX_EXTENT_METRES, GPU_MODEL_STATIC_DEMO_NORMALIZATION_CONTRACT, GPU_MODEL_STATIC_DEMO_PROFILE_VERSION, type GpuModelAccessor, type GpuModelAccessorComponentType, type GpuModelAccessorElementType, type GpuModelAlphaMode, type GpuModelAnalyticGeometry, type GpuModelAnimation, type GpuModelAnimationChannel, type GpuModelAnimationInterpolation, type GpuModelAnimationSampler, type GpuModelAnimationTargetType, type GpuModelBlendShape, type GpuModelBlendShapeDelta, type GpuModelBounds, type GpuModelConversionDiagnostic, type GpuModelConversionIssue, type GpuModelConversionIssueBase, type GpuModelConversionLoss, type GpuModelConversionResourcePackage, type GpuModelConversionViolation, type GpuModelConversionWarning, type GpuModelDiagnostic, type GpuModelDiagnosticInput, type GpuModelDiagnosticMode, type GpuModelDiagnosticReport, type GpuModelDiagnosticSeverity, type GpuModelDiagnosticStandard, GpuModelDiagnosticsError, type GpuModelDocument, GpuModelDocumentError, type GpuModelDocumentErrorCode, type GpuModelJoint, type GpuModelMaterial, type GpuModelMaterialTextures, type GpuModelMaterialWorkflow, type GpuModelMatrix4, type GpuModelMesh, type GpuModelMetadata, type GpuModelMetadataValue, type GpuModelNode, type GpuModelPrimitive, type GpuModelPrimitiveAttribute, type GpuModelPrimitiveTopology, type GpuModelProvenance, type GpuModelRepairRecord, type GpuModelResource, type GpuModelResourceBinding, type GpuModelResourceGraph, GpuModelResourceGraphError, type GpuModelResourceGraphInput, type GpuModelResourceGraphKind, type GpuModelResourceGraphNode, type GpuModelResourceInspection, type GpuModelResourceKind, type GpuModelResourceLocation, type GpuModelResourceReference, type GpuModelResourceVerificationContext, type GpuModelResourceVerificationLimits, type GpuModelResourceVerificationOptions, type GpuModelResourceVerificationPort, type GpuModelSkeleton, type GpuModelSkin, type GpuModelSourceMetadata, type GpuModelSourceUnit, type GpuModelStaticDemoCompilerInput, type GpuModelStaticDemoCompilerOptions, type GpuModelStaticDemoLimits, type GpuModelStaticDemoMaterial, type GpuModelStaticDemoSourceEvidence, type GpuModelStaticDemoWorldTriangle, type GpuModelTexture, type GpuModelTextureBinding, type GpuModelTextureColorSpace, type GpuModelTextureEmbeddingPolicy, type GpuModelTextureSampler, type GpuModelTextureTransform, type GpuModelTextureUsage, type GpuModelTextureWrap, type GpuModelTransformTrs, type GpuModelTriangleVec3, type GpuModelUnsupportedData, type GpuModelVec2, type GpuModelVec3, type GpuModelVec4, type GpuModelVertexWeightSet, type InspectOptions, type LoadOptions, MODEL_REGISTRY_LIMITS, type ModelAdapter, type ModelConversionRegistry, type ModelConversionRequest, type ModelConversionStage, type ModelExportResult, type ModelInspectResult, type ModelLoadResult, type ModelOperationOptions, type ModelProvenance, type ModelReadableStream, ModelRegistryError, type ModelRegistryErrorCode, type ModelRegistryResult, type ModelResultBase, type ModelSource, type ModelTarget, type ModelValidateResult, type ModelWritableStream, type RepairMode, type ResourcePackageManifest, type ValidateOptions, assertGpuModelStaticDemoNormalization, canCreateGpuModelDocument, createAndVerifyGpuModelDocument, createGpuModelDocument, createGpuModelResourceGraph, createGpuModelStaticDemoCompilerInput, createModelConversionRegistry, createModelResultBase, encodeGpuModelDocumentCanonical, evaluateGpuModelDiagnostics, gpuModelResourceKey, hashGpuModelDocumentCanonical, isGpuModelDocument, isGpuModelResourceGraph, packageBootstrap, packageName, verifyGpuModelResource };
|