@forgeax/engine-pack 0.1.28 → 0.1.30
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 +33 -5
- package/dist/build.mjs +99 -60
- package/dist/build.mjs.map +1 -1
- package/dist/catalog-projection.d.ts +3 -3
- package/dist/cli-asset.mjs +22 -13
- package/dist/cli-asset.mjs.map +1 -1
- package/dist/evidence/material-cook.d.ts +7 -1
- package/dist/evidence/material-cook.d.ts.map +1 -1
- package/dist/index.mjs +61 -5
- package/dist/index.mjs.map +1 -1
- package/dist/inventory/declaration.d.ts +1 -1
- package/dist/inventory/declaration.d.ts.map +1 -1
- package/dist/inventory/sync.d.ts.map +1 -1
- package/dist/material-cook.mjs +61 -5
- package/dist/material-cook.mjs.map +1 -1
- package/dist/native-cooker-registry.d.ts +1 -0
- package/dist/native-cooker-registry.d.ts.map +1 -1
- package/dist/native-cooker.mjs.map +1 -1
- package/dist/pack-authoring-node.mjs +22 -13
- package/dist/pack-authoring-node.mjs.map +1 -1
- package/dist/pack-authoring.d.ts +8 -2
- package/dist/pack-authoring.d.ts.map +1 -1
- package/dist/pack-authoring.mjs.map +1 -1
- package/dist/runtime-publication.d.ts +2 -0
- package/dist/runtime-publication.d.ts.map +1 -1
- package/dist/runtime.mjs.map +1 -1
- package/dist/scanner.mjs +22 -13
- package/dist/scanner.mjs.map +1 -1
- package/dist/schema-compiled.d.ts.map +1 -1
- package/dist/schema.mjs +40 -62
- package/dist/schema.mjs.map +1 -1
- package/dist/scriptable-pack-node.d.ts.map +1 -1
- package/dist/scriptable-pack-node.mjs +12 -4
- package/dist/scriptable-pack-node.mjs.map +1 -1
- package/dist/scriptable-pack-worker.mjs +12 -5
- package/dist/scriptable-pack-worker.mjs.map +1 -1
- package/dist/scriptable-pack.d.ts +2 -1
- package/dist/scriptable-pack.d.ts.map +1 -1
- package/dist/scriptable-pack.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/inventory-schema.test.ts +10 -10
- package/src/__tests__/material-cook-schema.unit.test.ts +92 -1
- package/src/__tests__/pack-authoring.unit.test.ts +2 -4
- package/src/__tests__/pack.unit.test.ts +86 -124
- package/src/__tests__/runtime-publication.unit.test.ts +36 -0
- package/src/__tests__/scanner-instance-cycle.test.ts +92 -0
- package/src/__tests__/scanner-inventory.contract.test.ts +2 -2
- package/src/__tests__/scriptable-pack-cli.integration.test.ts +35 -1
- package/src/__tests__/scriptable-pack-diagnostic.integration.test.ts +45 -0
- package/src/evidence/material-cook.ts +79 -5
- package/src/inventory/binding.ts +3 -3
- package/src/inventory/declaration.ts +10 -48
- package/src/inventory/sync.ts +3 -2
- package/src/native-cooker-registry.ts +1 -0
- package/src/pack-authoring.ts +11 -2
- package/src/runtime-publication.ts +7 -3
- package/src/scanner.ts +28 -28
- package/src/schema/material-cook.schema.json +107 -0
- package/src/schema-compiled.ts +40 -79
- package/src/scriptable-pack-node.ts +16 -4
- package/src/scriptable-pack-worker.ts +23 -5
- package/src/scriptable-pack.ts +2 -1
- package/src/__tests__/scanner-mount-cycle.test.ts +0 -232
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { AssetAuthoringCapability, AssetPublicationEnvelope, CatalogDiagnostic, CatalogEntryV2, CatalogLifecycle, CatalogSubject, CookExecution, PackIndexEntry, ProducerContractResult, ProviderProvenance, ResourceRevision, SourceOverrideDescriptor } from '@forgeax/engine-types';
|
|
2
2
|
export declare function catalogProjectionFor(subject: 'internal-asset' | 'imported-output', execution: 'direct' | 'cooked', lifecycle: 'missing' | 'cooking' | 'current' | 'stale' | 'failed'): {
|
|
3
3
|
readonly subject: "internal-asset" | "imported-output";
|
|
4
|
-
readonly execution: "
|
|
4
|
+
readonly execution: "cooked" | "direct";
|
|
5
5
|
readonly lifecycle: "missing" | "cooking" | "current" | "stale" | "failed";
|
|
6
6
|
readonly operations: Readonly<Record<import("@forgeax/engine-types").CatalogOperationName, import("@forgeax/engine-types").CatalogOperationDescriptor>>;
|
|
7
7
|
};
|
|
8
8
|
export declare function currentProjectionFor(subject: 'internal-asset' | 'imported-output', execution: 'direct' | 'cooked'): {
|
|
9
9
|
readonly projection: {
|
|
10
10
|
readonly subject: "internal-asset" | "imported-output";
|
|
11
|
-
readonly execution: "
|
|
11
|
+
readonly execution: "cooked" | "direct";
|
|
12
12
|
readonly lifecycle: "missing" | "cooking" | "current" | "stale" | "failed";
|
|
13
13
|
readonly operations: Readonly<Record<import("@forgeax/engine-types").CatalogOperationName, import("@forgeax/engine-types").CatalogOperationDescriptor>>;
|
|
14
14
|
};
|
|
15
15
|
readonly subject: "internal-asset" | "imported-output";
|
|
16
|
-
readonly execution: "
|
|
16
|
+
readonly execution: "cooked" | "direct";
|
|
17
17
|
readonly lifecycle: "missing" | "cooking" | "current" | "stale" | "failed";
|
|
18
18
|
readonly operations: Readonly<Record<import("@forgeax/engine-types").CatalogOperationName, import("@forgeax/engine-types").CatalogOperationDescriptor>>;
|
|
19
19
|
};
|
package/dist/cli-asset.mjs
CHANGED
|
@@ -8919,9 +8919,17 @@ var WorkerScriptablePackExecutor = class {
|
|
|
8919
8919
|
}
|
|
8920
8920
|
};
|
|
8921
8921
|
worker.on("message", onMessage);
|
|
8922
|
-
|
|
8922
|
+
const fail = (error) => {
|
|
8923
|
+
rejectLoad(error);
|
|
8924
|
+
const active = this.build;
|
|
8925
|
+
this.build = void 0;
|
|
8926
|
+
active?.reject(error);
|
|
8927
|
+
void this.dispose("failure");
|
|
8928
|
+
};
|
|
8929
|
+
worker.once("error", fail);
|
|
8923
8930
|
worker.once("exit", (code) => {
|
|
8924
|
-
if (
|
|
8931
|
+
if (this.disposal !== void 0) return;
|
|
8932
|
+
fail(new Error(`ScriptablePack worker exited with code ${code}`));
|
|
8925
8933
|
});
|
|
8926
8934
|
});
|
|
8927
8935
|
}
|
|
@@ -8999,7 +9007,7 @@ function scriptablePackLoadFailure(sourcePath, reason, phase, diagnostic, timeou
|
|
|
8999
9007
|
}
|
|
9000
9008
|
async function loadScriptablePack(sourcePath, options = {}) {
|
|
9001
9009
|
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
9002
|
-
const buildTimeoutMs = options.buildTimeoutMs ??
|
|
9010
|
+
const buildTimeoutMs = options.buildTimeoutMs ?? 15e3;
|
|
9003
9011
|
const executor = options.executor ?? new WorkerScriptablePackExecutor();
|
|
9004
9012
|
let disposeReason;
|
|
9005
9013
|
let timeout;
|
|
@@ -9150,16 +9158,17 @@ function makePackError(code, detail) {
|
|
|
9150
9158
|
detail
|
|
9151
9159
|
});
|
|
9152
9160
|
}
|
|
9153
|
-
function*
|
|
9161
|
+
function* extractInstanceSourceGuids(asset) {
|
|
9154
9162
|
if (asset.kind !== "scene") return;
|
|
9155
9163
|
const payload = asset.payload;
|
|
9156
|
-
if (!payload ||
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
if (
|
|
9162
|
-
const
|
|
9164
|
+
if (!payload || payload.entities === null || typeof payload.entities !== "object" || Array.isArray(payload.entities))
|
|
9165
|
+
return;
|
|
9166
|
+
for (const rawEntity of Object.values(payload.entities)) {
|
|
9167
|
+
if (rawEntity === null || typeof rawEntity !== "object" || Array.isArray(rawEntity)) continue;
|
|
9168
|
+
const instance = rawEntity.instance;
|
|
9169
|
+
if (instance === null || typeof instance !== "object" || Array.isArray(instance)) continue;
|
|
9170
|
+
const source = instance.source;
|
|
9171
|
+
const resolved = typeof source === "number" && Number.isInteger(source) ? asset.refs[source] : typeof source === "string" ? source : void 0;
|
|
9163
9172
|
if (typeof resolved !== "string") continue;
|
|
9164
9173
|
yield resolved.toLowerCase();
|
|
9165
9174
|
}
|
|
@@ -9277,7 +9286,7 @@ async function scanValidated(roots, opts = {}, capture) {
|
|
|
9277
9286
|
guidToPath.set(normalizedGuid, packPath);
|
|
9278
9287
|
packRefs.set(normalizedGuid, [
|
|
9279
9288
|
...asset.refs.map((ref) => ref.toLowerCase()),
|
|
9280
|
-
...
|
|
9289
|
+
...extractInstanceSourceGuids(asset)
|
|
9281
9290
|
]);
|
|
9282
9291
|
}
|
|
9283
9292
|
}
|
|
@@ -9381,7 +9390,7 @@ async function scanValidated(roots, opts = {}, capture) {
|
|
|
9381
9390
|
guidToPath.set(normalizedGuid, packPath);
|
|
9382
9391
|
packRefs.set(normalizedGuid, [
|
|
9383
9392
|
...asset.refs.map((ref) => ref.toLowerCase()),
|
|
9384
|
-
...
|
|
9393
|
+
...extractInstanceSourceGuids(asset)
|
|
9385
9394
|
]);
|
|
9386
9395
|
}
|
|
9387
9396
|
capture?.declarations.set(packPath, {
|