@bitmagic/animation-forger 0.1.0
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/authored-spec.d.ts +1409 -0
- package/dist/authored-spec.d.ts.map +1 -0
- package/dist/authored-spec.js +219 -0
- package/dist/authored-spec.js.map +1 -0
- package/dist/deps.d.ts +56 -0
- package/dist/deps.d.ts.map +1 -0
- package/dist/deps.js +14 -0
- package/dist/deps.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/params.d.ts +920 -0
- package/dist/params.d.ts.map +1 -0
- package/dist/params.js +25 -0
- package/dist/params.js.map +1 -0
- package/dist/result-types.d.ts +37 -0
- package/dist/result-types.d.ts.map +1 -0
- package/dist/result-types.js +9 -0
- package/dist/result-types.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../src/params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU/B,CAAC;AAEZ,6EAA6E;AAC7E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEzF,kDAAkD;AAClD,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
package/dist/params.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wire body for a CLI-lane animation generation.
|
|
3
|
+
*
|
|
4
|
+
* `gameId` is deliberately absent: the route strips it and checks ownership
|
|
5
|
+
* before a generator ever sees the params, exactly as every other
|
|
6
|
+
* `POST /api/cli/v1/assets/:type/stream` generator is shaped.
|
|
7
|
+
*
|
|
8
|
+
* Named `authoredAnimationParamsSchema`, not `animationParamsSchema`, because
|
|
9
|
+
* `@bitmagic/asset-core` already exports the latter for the dormant
|
|
10
|
+
* text-to-motion client and both are importable in the same file.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { authoredClipSpecSchema } from './authored-spec.js';
|
|
14
|
+
export const authoredAnimationParamsSchema = z.object({
|
|
15
|
+
description: z.string().min(1)
|
|
16
|
+
.describe('What the animation is, for the asset record (e.g. "zombie shuffle with arms extended forward").'),
|
|
17
|
+
assetId: z.string().optional()
|
|
18
|
+
.describe('Pre-generated `asset_…` id from a manifest. When provided the animation is stored under this '
|
|
19
|
+
+ 'exact id and THAT is what playCustomAnimation resolves. Distinct from `spec.motionId`, which is the '
|
|
20
|
+
+ "clip's own internal id. If omitted, the spec motionId is used."),
|
|
21
|
+
spec: authoredClipSpecSchema
|
|
22
|
+
.describe('Authored-clip parameter spec. `gait` (walk/run variations incl. limps and held arm poses), '
|
|
23
|
+
+ '`melee` (weapon strikes as key poses), `oneShot` (waves, salutes, crouches, celebrations).'),
|
|
24
|
+
}).strict();
|
|
25
|
+
//# sourceMappingURL=params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params.js","sourceRoot":"","sources":["../src/params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;SAC3B,QAAQ,CAAC,iGAAiG,CAAC;IAC9G,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC3B,QAAQ,CAAC,+FAA+F;UACrG,sGAAsG;UACtG,gEAAgE,CAAC;IACvE,IAAI,EAAE,sBAAsB;SACzB,QAAQ,CAAC,6FAA6F;UACnG,4FAA4F,CAAC;CACpG,CAAC,CAAC,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a built clip is, and what a host that stored one reports back.
|
|
3
|
+
*
|
|
4
|
+
* Bytes are a `Uint8Array` rather than a `Buffer` for the reason
|
|
5
|
+
* `world-forger`'s storage seam gives: a published `.d.ts` must not force
|
|
6
|
+
* `@types/node` on a consumer that only wants the types.
|
|
7
|
+
*/
|
|
8
|
+
/** The clip identity the compiler bakes into the GLB. */
|
|
9
|
+
export interface AuthoredClipMeta {
|
|
10
|
+
name: string;
|
|
11
|
+
motionId: string;
|
|
12
|
+
duration: number;
|
|
13
|
+
loop: boolean;
|
|
14
|
+
/** Gait clips only: m/s the stride was built for — drives engine stride sync. */
|
|
15
|
+
designSpeed?: number;
|
|
16
|
+
}
|
|
17
|
+
/** What the builder returns. */
|
|
18
|
+
export interface AuthoredClipResult {
|
|
19
|
+
/** The compiled animation-only GLB. */
|
|
20
|
+
bytes: Uint8Array;
|
|
21
|
+
meta: AuthoredClipMeta;
|
|
22
|
+
/**
|
|
23
|
+
* Non-fatal build findings (loop seam, grounding, size budget).
|
|
24
|
+
*
|
|
25
|
+
* A warning is publishable; a hard gate failure THROWS instead of landing
|
|
26
|
+
* here, because a clip that fails one is not worth shipping.
|
|
27
|
+
*/
|
|
28
|
+
warnings: string[];
|
|
29
|
+
}
|
|
30
|
+
/** What a host reports after building AND storing a clip. */
|
|
31
|
+
export interface AuthoredAnimationOutcome extends AuthoredClipMeta {
|
|
32
|
+
/** Public URL the game loads the clip from. */
|
|
33
|
+
url: string;
|
|
34
|
+
warnings: string[];
|
|
35
|
+
sizeBytes: number;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=result-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-types.d.ts","sourceRoot":"","sources":["../src/result-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,gCAAgC;AAChC,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,6DAA6D;AAC7D,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAChE,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a built clip is, and what a host that stored one reports back.
|
|
3
|
+
*
|
|
4
|
+
* Bytes are a `Uint8Array` rather than a `Buffer` for the reason
|
|
5
|
+
* `world-forger`'s storage seam gives: a published `.d.ts` must not force
|
|
6
|
+
* `@types/node` on a consumer that only wants the types.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=result-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-types.js","sourceRoot":"","sources":["../src/result-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bitmagic/animation-forger",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Client half of the Bitmagic animation forger: the authored-clip parameter spec, the wire body, the result types and the host seams.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./*.js": {
|
|
15
|
+
"types": "./dist/*.d.ts",
|
|
16
|
+
"default": "./dist/*.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@eslint/js": "^9.38.0",
|
|
27
|
+
"@types/jest": "^29.5.0",
|
|
28
|
+
"@types/node": "^24.9.1",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
30
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
31
|
+
"eslint": "^9.38.0",
|
|
32
|
+
"jest": "^29.7.0",
|
|
33
|
+
"ts-jest": "^29.4.5",
|
|
34
|
+
"typescript": "^5.9.3"
|
|
35
|
+
},
|
|
36
|
+
"jest": {
|
|
37
|
+
"preset": "ts-jest/presets/default-esm",
|
|
38
|
+
"extensionsToTreatAsEsm": [
|
|
39
|
+
".ts"
|
|
40
|
+
],
|
|
41
|
+
"transform": {
|
|
42
|
+
"^.+\\.ts$": [
|
|
43
|
+
"ts-jest",
|
|
44
|
+
{
|
|
45
|
+
"useESM": true,
|
|
46
|
+
"tsconfig": {
|
|
47
|
+
"target": "ES2020",
|
|
48
|
+
"module": "ES2020",
|
|
49
|
+
"moduleResolution": "node",
|
|
50
|
+
"verbatimModuleSyntax": false,
|
|
51
|
+
"esModuleInterop": true
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"moduleNameMapper": {
|
|
57
|
+
"^(\\.{1,2}/.*)\\.js$": "$1"
|
|
58
|
+
},
|
|
59
|
+
"testEnvironment": "node",
|
|
60
|
+
"testMatch": [
|
|
61
|
+
"**/__tests__/**/*.test.ts"
|
|
62
|
+
],
|
|
63
|
+
"maxWorkers": "50%"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"zod": "^3.25.76"
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
70
|
+
"build": "pnpm run clean && tsc",
|
|
71
|
+
"check": "pnpm run lint && pnpm run build",
|
|
72
|
+
"lint": "eslint src --cache",
|
|
73
|
+
"test": "jest"
|
|
74
|
+
}
|
|
75
|
+
}
|