@forgeax/engine-pack 0.1.26 → 0.1.28
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 +13 -12
- package/dist/build.mjs +1 -1
- package/dist/build.mjs.map +1 -1
- package/dist/cli-asset.d.ts +1 -1
- package/dist/cli-asset.d.ts.map +1 -1
- package/dist/cli-asset.mjs +19 -21
- package/dist/cli-asset.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/pack-authoring-node.mjs +1 -1
- package/dist/pack-authoring-node.mjs.map +1 -1
- package/dist/runtime.mjs +1 -1
- package/dist/runtime.mjs.map +1 -1
- package/dist/scanner.mjs +1 -1
- package/dist/scanner.mjs.map +1 -1
- package/dist/schema.mjs +1 -1
- package/dist/schema.mjs.map +1 -1
- package/package.json +3 -6
- package/schema/meta.schema.json +1 -1
- package/src/__tests__/atlas-cli-region-mismatch.test.ts +1 -1
- package/src/__tests__/cli.unit.test.ts +1 -1
- package/src/__tests__/pack.unit.test.ts +3 -3
- package/src/atlas/run-atlas.ts +3 -3
- package/src/atlas/shelf-pack.ts +1 -1
- package/src/atlas/upng-ambient.d.ts +1 -1
- package/src/cli-asset.ts +22 -23
- package/src/scanner.ts +1 -1
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgeax/engine-pack",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"sideEffects": false,
|
|
8
|
-
"description": "Disk schema, GUID tools, scanner, and fail-fast error chain for the
|
|
9
|
-
"bin": {
|
|
10
|
-
"forgeax-engine-remote-asset": "./dist/cli-asset.mjs"
|
|
11
|
-
},
|
|
8
|
+
"description": "Disk schema, GUID tools, scanner, and fail-fast error chain for the ForgeaX asset package system. The unified ForgeaX asset command owns the public producer entry.",
|
|
12
9
|
"exports": {
|
|
13
10
|
".": {
|
|
14
11
|
"types": "./dist/index.d.ts",
|
|
@@ -131,7 +128,7 @@
|
|
|
131
128
|
}
|
|
132
129
|
},
|
|
133
130
|
"dependencies": {
|
|
134
|
-
"@forgeax/engine-types": "0.1.
|
|
131
|
+
"@forgeax/engine-types": "0.1.28",
|
|
135
132
|
"@noble/hashes": "^2.2.0",
|
|
136
133
|
"fast-glob": "^3.3.3",
|
|
137
134
|
"typescript": "^5.8.3",
|
package/schema/meta.schema.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"properties": {
|
|
11
11
|
"schemaVersion": {
|
|
12
12
|
"oneOf": [{ "type": "string" }, { "type": "integer" }],
|
|
13
|
-
"description": "Schema version. Strings (e.g. '1.0.0') for hand-authored .meta.json; integers (1, 2, ...) for importer-emitted .meta.json (forgeax
|
|
13
|
+
"description": "Schema version. Strings (e.g. '1.0.0') for hand-authored .meta.json; integers (1, 2, ...) for importer-emitted .meta.json (forgeax asset import writes schemaVersion: 1 as the wire format SSOT, GltfMetaJson literal type)."
|
|
14
14
|
},
|
|
15
15
|
"kind": {
|
|
16
16
|
"type": "string",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `forgeax
|
|
1
|
+
// `forgeax asset atlas` region-mismatch safety-net test
|
|
2
2
|
// (feat-20260521-sprite-atlas-animation M5' T-29 / requirements AC-10 (c)).
|
|
3
3
|
//
|
|
4
4
|
// The shelfPack pure function never produces regions whose summed area
|
|
@@ -266,7 +266,7 @@ async function writeSolidPng(
|
|
|
266
266
|
await rm(tempDir, { recursive: true, force: true });
|
|
267
267
|
});
|
|
268
268
|
|
|
269
|
-
describe('cli-asset (forgeax
|
|
269
|
+
describe('cli-asset (forgeax asset plugin bin)', () => {
|
|
270
270
|
describe('subcommand routing (a)', () => {
|
|
271
271
|
it('routes scan as a known subcommand and returns 0 on empty roots', async () => {
|
|
272
272
|
const io = makeIO();
|
|
@@ -1129,7 +1129,7 @@ const V1_WHITELIST = new Set([
|
|
|
1129
1129
|
const err = new PackError({
|
|
1130
1130
|
code: 'pack-meta-missing',
|
|
1131
1131
|
expected: 'every source file must have a corresponding .meta.json in strict mode',
|
|
1132
|
-
hint: 'run forgeax
|
|
1132
|
+
hint: 'run forgeax asset list --root <project> --json to list source files without .meta.json',
|
|
1133
1133
|
detail,
|
|
1134
1134
|
});
|
|
1135
1135
|
expect(err.code).toBe('pack-meta-missing' satisfies PackErrorCode);
|
|
@@ -1147,7 +1147,7 @@ const V1_WHITELIST = new Set([
|
|
|
1147
1147
|
const err = new PackError({
|
|
1148
1148
|
code: 'pack-guid-collision',
|
|
1149
1149
|
expected: 'every GUID must be unique across all .pack.json files in the scan roots',
|
|
1150
|
-
hint: 'run forgeax
|
|
1150
|
+
hint: 'run forgeax asset verify --root <project> --json to list all GUID collisions',
|
|
1151
1151
|
detail,
|
|
1152
1152
|
});
|
|
1153
1153
|
expect(err.code).toBe('pack-guid-collision' satisfies PackErrorCode);
|
|
@@ -1168,7 +1168,7 @@ const V1_WHITELIST = new Set([
|
|
|
1168
1168
|
const err = new PackError({
|
|
1169
1169
|
code: 'pack-cyclic-reference',
|
|
1170
1170
|
expected: 'asset reference graph must be acyclic',
|
|
1171
|
-
hint: 'run forgeax
|
|
1171
|
+
hint: 'run forgeax asset verify --root <project> --json to list the cycle path',
|
|
1172
1172
|
detail,
|
|
1173
1173
|
});
|
|
1174
1174
|
expect(err.code).toBe('pack-cyclic-reference' satisfies PackErrorCode);
|
package/src/atlas/run-atlas.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `forgeax
|
|
1
|
+
// `forgeax asset atlas` subcommand backend
|
|
2
2
|
// (feat-20260521-sprite-atlas-animation M5' T-32). Replaces the v1 vite-
|
|
3
3
|
// plugin idiom (PR #190 deleted `@forgeax/engine-vite-plugin-image`) with
|
|
4
4
|
// a one-shot Node CLI that reads a glob of PNGs, runs the pure shelf
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
//
|
|
8
8
|
// Why CLI not Vite plugin (PR #190 architectural pivot):
|
|
9
9
|
// - asset importing is producer-side disk work; v2 routes the producer
|
|
10
|
-
// through the
|
|
10
|
+
// through the unified `forgeax asset atlas` producer so the
|
|
11
11
|
// same surface composes with `scan` / `lookup` / `verify` (charter P5
|
|
12
12
|
// producer/consumer split).
|
|
13
13
|
// - vite plugins reach for runtime-coupled hooks (buildStart / emitFile);
|
|
@@ -327,7 +327,7 @@ export async function runAtlas(rest: string[], ctx: AssetCtx): Promise<number> {
|
|
|
327
327
|
return emitError(ctx, {
|
|
328
328
|
code: 'atlas-empty-input',
|
|
329
329
|
expected:
|
|
330
|
-
'forgeax
|
|
330
|
+
'forgeax asset atlas --input <glob> --name <prefix> [--output <dir>] [--max-atlas-size <n>]',
|
|
331
331
|
hint: argsOutcome.message,
|
|
332
332
|
detail: { receivedCount: 0 },
|
|
333
333
|
});
|
package/src/atlas/shelf-pack.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Pure-function shelf packer for the `forgeax
|
|
1
|
+
// Pure-function shelf packer for the `forgeax asset atlas`
|
|
2
2
|
// subcommand (feat-20260521-sprite-atlas-animation M5' T-31). Maps a list
|
|
3
3
|
// of decoded RGBA sprites to a non-overlapping atlas region map +
|
|
4
4
|
// atlasWidth / atlasHeight envelope.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Ambient declaration for `upng-js` (PNG decoder/encoder) used by the
|
|
2
|
-
// `forgeax
|
|
2
|
+
// `forgeax asset atlas` subcommand (run-atlas.ts) and by
|
|
3
3
|
// its hermetic CLI integration tests under `__tests__/`. The package
|
|
4
4
|
// ships without bundled `.d.ts`; consumer sites cast through local
|
|
5
5
|
// interfaces to match the subset they use.
|
package/src/cli-asset.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// @forgeax/engine-pack/src/cli-asset —
|
|
4
|
-
//
|
|
5
|
-
// section 2.9). Discovered by the base bin via the kubectl 4th-path
|
|
6
|
-
// `forgeax-engine-remote-` prefix scanner; subcommands scan / lookup /
|
|
7
|
-
// verify operate offline against the pack scanner.
|
|
3
|
+
// @forgeax/engine-pack/src/cli-asset — Pack producer implementation used by
|
|
4
|
+
// DevKit's unified `forgeax asset` command. It is not a package bin.
|
|
8
5
|
//
|
|
9
6
|
// stderr contract (plan-strategy section 2.3 weak-contract): every error
|
|
10
7
|
// path emits a single JSON Lines record carrying `code` / `expected` /
|
|
@@ -30,6 +27,10 @@ import { projectScriptablePackMeta } from './pack-authoring.js';
|
|
|
30
27
|
import { type ScanSourceDeclaration, scanInventory } from './scanner.js';
|
|
31
28
|
import { loadScriptablePack } from './scriptable-pack-node.js';
|
|
32
29
|
|
|
30
|
+
// The unified DevKit command tree reuses the producer implementation without
|
|
31
|
+
// reviving the historical standalone executable as a second public surface.
|
|
32
|
+
export { runAtlas } from './atlas/run-atlas.js';
|
|
33
|
+
|
|
33
34
|
export interface PackEntry {
|
|
34
35
|
readonly guid: string;
|
|
35
36
|
readonly kind: string;
|
|
@@ -153,16 +154,14 @@ export async function scanEntries(
|
|
|
153
154
|
|
|
154
155
|
function helpBody(): string {
|
|
155
156
|
return [
|
|
156
|
-
'forgeax
|
|
157
|
+
'forgeax asset — offline pack scanner / lookup / verifier / atlas builder',
|
|
157
158
|
'',
|
|
158
159
|
'Usage:',
|
|
159
|
-
' forgeax
|
|
160
|
-
' forgeax
|
|
161
|
-
' forgeax
|
|
162
|
-
' forgeax
|
|
163
|
-
' forgeax
|
|
164
|
-
' forgeax-engine-remote-asset verify --guid <guid> --project <dir> --catalog <path> --json',
|
|
165
|
-
' forgeax-engine-remote-asset atlas --input <glob> --name <prefix> [--output <dir>] [--max-atlas-size <n>]',
|
|
160
|
+
' forgeax asset list --root <project> --json',
|
|
161
|
+
' forgeax asset inspect --subject <guid> --root <project> --json',
|
|
162
|
+
' forgeax asset verify --root <project> --json',
|
|
163
|
+
' forgeax asset inspect --subject <source.pack.ts> --root <project> --json',
|
|
164
|
+
' forgeax asset atlas --input <glob> --name <prefix> --root <project> [--output <dir>]',
|
|
166
165
|
'',
|
|
167
166
|
'AI recovery commands (host execution remains explicit):',
|
|
168
167
|
' inspect [--guid <guid>] read subject, execution, lifecycle, authority, and sourceKey evidence',
|
|
@@ -205,7 +204,7 @@ export async function runCliAsset(rest: string[], ctx: AssetCtx): Promise<number
|
|
|
205
204
|
return emitError(ctx, {
|
|
206
205
|
code: 'unknown-subcommand',
|
|
207
206
|
expected: 'subcommand in {scan, lookup, verify, atlas, meta}',
|
|
208
|
-
hint: "run 'forgeax
|
|
207
|
+
hint: "run 'forgeax help asset' for usage",
|
|
209
208
|
detail: { subcommand: sub },
|
|
210
209
|
});
|
|
211
210
|
}
|
|
@@ -227,7 +226,7 @@ async function runMeta(rest: string[], ctx: AssetCtx): Promise<number> {
|
|
|
227
226
|
} catch (error) {
|
|
228
227
|
return emitError(ctx, {
|
|
229
228
|
code: 'cli-parse-error',
|
|
230
|
-
expected: 'forgeax
|
|
229
|
+
expected: 'forgeax asset inspect --subject <source.pack.ts> --root <project> --json',
|
|
231
230
|
hint: 'pass one trusted ScriptablePack module path',
|
|
232
231
|
detail: { message: error instanceof Error ? error.message : String(error) },
|
|
233
232
|
});
|
|
@@ -277,7 +276,7 @@ async function runRecoveryCommand(
|
|
|
277
276
|
return emitError(ctx, {
|
|
278
277
|
code: 'cli-parse-error',
|
|
279
278
|
expected: `${operation} [--guid <guid>]`,
|
|
280
|
-
hint: "run 'forgeax
|
|
279
|
+
hint: "run 'forgeax help asset' for usage",
|
|
281
280
|
detail: { message: error instanceof Error ? error.message : String(error) },
|
|
282
281
|
});
|
|
283
282
|
}
|
|
@@ -297,8 +296,8 @@ async function runScan(rest: string[], ctx: AssetCtx): Promise<number> {
|
|
|
297
296
|
const message = e instanceof Error ? e.message : String(e);
|
|
298
297
|
return emitError(ctx, {
|
|
299
298
|
code: 'cli-parse-error',
|
|
300
|
-
expected: 'forgeax
|
|
301
|
-
hint: "run 'forgeax
|
|
299
|
+
expected: 'forgeax asset list --root <project> --json',
|
|
300
|
+
hint: "run 'forgeax help asset' for usage",
|
|
302
301
|
detail: { message },
|
|
303
302
|
});
|
|
304
303
|
}
|
|
@@ -314,7 +313,7 @@ async function runLookup(rest: string[], ctx: AssetCtx): Promise<number> {
|
|
|
314
313
|
if (typeof guid !== 'string') {
|
|
315
314
|
return emitError(ctx, {
|
|
316
315
|
code: 'cli-parse-error',
|
|
317
|
-
expected: 'forgeax
|
|
316
|
+
expected: 'forgeax asset inspect --subject <guid> --root <project> --json',
|
|
318
317
|
hint: 'pass a 36-char dash-form UUID positional argument',
|
|
319
318
|
});
|
|
320
319
|
}
|
|
@@ -356,8 +355,8 @@ async function runVerify(rest: string[], ctx: AssetCtx): Promise<number> {
|
|
|
356
355
|
const message = e instanceof Error ? e.message : String(e);
|
|
357
356
|
return emitError(ctx, {
|
|
358
357
|
code: 'cli-parse-error',
|
|
359
|
-
expected: 'forgeax
|
|
360
|
-
hint: "run 'forgeax
|
|
358
|
+
expected: 'forgeax asset verify --root <project> --json',
|
|
359
|
+
hint: "run 'forgeax help asset' for usage",
|
|
361
360
|
detail: { message },
|
|
362
361
|
});
|
|
363
362
|
}
|
|
@@ -397,7 +396,7 @@ function parseEvidenceOptions(rest: string[], ctx: AssetCtx): EvidenceCliOptions
|
|
|
397
396
|
emitError(ctx, {
|
|
398
397
|
code: 'cli-parse-error',
|
|
399
398
|
expected: '--guid <guid> --project <dir> --catalog <path> --json',
|
|
400
|
-
hint: "run 'forgeax
|
|
399
|
+
hint: "run 'forgeax help asset' for usage",
|
|
401
400
|
});
|
|
402
401
|
return undefined;
|
|
403
402
|
}
|
|
@@ -407,7 +406,7 @@ function parseEvidenceOptions(rest: string[], ctx: AssetCtx): EvidenceCliOptions
|
|
|
407
406
|
emitError(ctx, {
|
|
408
407
|
code: 'cli-parse-error',
|
|
409
408
|
expected: '--guid <guid> --project <dir> --catalog <path> --json',
|
|
410
|
-
hint: "run 'forgeax
|
|
409
|
+
hint: "run 'forgeax help asset' for usage",
|
|
411
410
|
detail: { message },
|
|
412
411
|
});
|
|
413
412
|
return undefined;
|
package/src/scanner.ts
CHANGED
|
@@ -184,7 +184,7 @@ interface ScanCapture {
|
|
|
184
184
|
* Requirements §3.4 + §5 blacklist.
|
|
185
185
|
*
|
|
186
186
|
* Re-exported as `SCANNER_BLACKLIST` for cross-package reuse: the
|
|
187
|
-
* `forgeax
|
|
187
|
+
* `forgeax asset import --check` traversal (M4 / w21 +
|
|
188
188
|
* plan-strategy section 2.8 path b) walks the same set of source-orphan
|
|
189
189
|
* candidates as the scanner, so we share the single SSOT here.
|
|
190
190
|
*/
|