@bitmagic/asset-core 0.1.0 → 0.1.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/cover-prompt.d.ts +32 -0
- package/dist/cover-prompt.d.ts.map +1 -0
- package/dist/cover-prompt.js +41 -0
- package/dist/cover-prompt.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +11 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cover-art prompt composition, shared by every lane that generates a game's
|
|
3
|
+
* cover image: Creator's Planning Mode and the per-game cover endpoint in
|
|
4
|
+
* game-play-agent, the offline template-cover script, and `bitmagic cover` in
|
|
5
|
+
* the CLI lane. It lives here rather than in any one of them because the style
|
|
6
|
+
* direction is what makes covers from all of them read as the same product —
|
|
7
|
+
* a copy that drifts produces art that visibly does not match.
|
|
8
|
+
*
|
|
9
|
+
* No network, no credentials: this module composes strings. Each lane calls its
|
|
10
|
+
* own image generator with the result.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Shared style direction for every Bitmagic cover image: the polished voxel
|
|
14
|
+
* craft of "if Pixar made a voxel game," kept mood-neutral so the per-scene
|
|
15
|
+
* description sets the tone (cheerful adventure vs. dark horror). Do NOT bake
|
|
16
|
+
* mood/lighting words (golden-hour, cheerful, scary) in here — those belong in
|
|
17
|
+
* the scene description.
|
|
18
|
+
*/
|
|
19
|
+
export declare const PIXAR_VOXEL_STYLE: string;
|
|
20
|
+
/** How much of the design text reaches the image model; the rest is dropped. */
|
|
21
|
+
export declare const MAX_COVER_DESIGN_CHARS = 1500;
|
|
22
|
+
/**
|
|
23
|
+
* Compose the image prompt for a cover image from a game's design text
|
|
24
|
+
* (GAME-DESIGN.md content or, during planning, the pitch/plan doc). Falls back
|
|
25
|
+
* to a generic voxel scene when none is present.
|
|
26
|
+
*
|
|
27
|
+
* The game name is deliberately NEVER injected — naming the game makes image
|
|
28
|
+
* models render the title as on-image text. We describe a wordless scene and
|
|
29
|
+
* append a strong no-text directive.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildCoverArtPrompt(gameDesign: string): string;
|
|
32
|
+
//# sourceMappingURL=cover-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cover-prompt.d.ts","sourceRoot":"","sources":["../src/cover-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,QAIsD,CAAC;AAErF,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAQ9D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cover-art prompt composition, shared by every lane that generates a game's
|
|
3
|
+
* cover image: Creator's Planning Mode and the per-game cover endpoint in
|
|
4
|
+
* game-play-agent, the offline template-cover script, and `bitmagic cover` in
|
|
5
|
+
* the CLI lane. It lives here rather than in any one of them because the style
|
|
6
|
+
* direction is what makes covers from all of them read as the same product —
|
|
7
|
+
* a copy that drifts produces art that visibly does not match.
|
|
8
|
+
*
|
|
9
|
+
* No network, no credentials: this module composes strings. Each lane calls its
|
|
10
|
+
* own image generator with the result.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Shared style direction for every Bitmagic cover image: the polished voxel
|
|
14
|
+
* craft of "if Pixar made a voxel game," kept mood-neutral so the per-scene
|
|
15
|
+
* description sets the tone (cheerful adventure vs. dark horror). Do NOT bake
|
|
16
|
+
* mood/lighting words (golden-hour, cheerful, scary) in here — those belong in
|
|
17
|
+
* the scene description.
|
|
18
|
+
*/
|
|
19
|
+
export const PIXAR_VOXEL_STYLE = 'highly polished 3D render in the voxel craft of a Pixar-quality animated film, ' +
|
|
20
|
+
'cinematic lighting that fits the scene, soft ambient occlusion, subtle subsurface scattering, ' +
|
|
21
|
+
'rich detail and expressive composition. ' +
|
|
22
|
+
'Wordless illustration, no text, no title, no words, no letters, no logos, no UI.';
|
|
23
|
+
/** How much of the design text reaches the image model; the rest is dropped. */
|
|
24
|
+
export const MAX_COVER_DESIGN_CHARS = 1500;
|
|
25
|
+
/**
|
|
26
|
+
* Compose the image prompt for a cover image from a game's design text
|
|
27
|
+
* (GAME-DESIGN.md content or, during planning, the pitch/plan doc). Falls back
|
|
28
|
+
* to a generic voxel scene when none is present.
|
|
29
|
+
*
|
|
30
|
+
* The game name is deliberately NEVER injected — naming the game makes image
|
|
31
|
+
* models render the title as on-image text. We describe a wordless scene and
|
|
32
|
+
* append a strong no-text directive.
|
|
33
|
+
*/
|
|
34
|
+
export function buildCoverArtPrompt(gameDesign) {
|
|
35
|
+
const excerpt = gameDesign.trim().slice(0, MAX_COVER_DESIGN_CHARS);
|
|
36
|
+
if (!excerpt) {
|
|
37
|
+
return `A charming, inviting voxel adventure game scene, colorful and full of character. ${PIXAR_VOXEL_STYLE}`;
|
|
38
|
+
}
|
|
39
|
+
return `A voxel game scene based on this game design:\n${excerpt}\n\nDepict the world and atmosphere as a single illustrated scene. ${PIXAR_VOXEL_STYLE}`;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=cover-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cover-prompt.js","sourceRoot":"","sources":["../src/cover-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAC5B,iFAAiF;IACjF,gGAAgG;IAChG,0CAA0C;IAC1C,kFAAkF,CAAC;AAErF,gFAAgF;AAChF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,sBAAsB,CAAC,CAAC;IAEnE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,oFAAoF,iBAAiB,EAAE,CAAC;IACjH,CAAC;IAED,OAAO,kDAAkD,OAAO,sEAAsE,iBAAiB,EAAE,CAAC;AAC5J,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export type { CharacterParams, CharacterResult } from './generators/character.js
|
|
|
14
14
|
export { generateAnimationAsset, animationParamsSchema, getConfiguredAnimationModel, ANIMATION_MODEL_TEXT_TO_MOTION_3, ANIMATION_MODEL_TEXT_TO_MOTION_2, ANIMATION_MODEL_OLDER, } from './generators/animation.js';
|
|
15
15
|
export type { AnimationParams, AnimationResult } from './generators/animation.js';
|
|
16
16
|
export { fetchContentLength } from './http.js';
|
|
17
|
+
export { PIXAR_VOXEL_STYLE, MAX_COVER_DESIGN_CHARS, buildCoverArtPrompt } from './cover-prompt.js';
|
|
17
18
|
export { TERMINAL_FAILURE_CODES, TERMINAL_FAILURE_VERSION, buildTerminalFailure, isTerminalFailureCode, legacyErrorTypeFor, parseTerminalFailure, } from './terminal-failure.js';
|
|
18
19
|
export type { BuildTerminalFailureInput, LegacyErrorType, TerminalFailure, TerminalFailureCode, TerminalFailureDetail, } from './terminal-failure.js';
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,UAAU,EACV,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,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
|
@@ -7,6 +7,7 @@ export { generateImageAsset, imageAssetParamsSchema } from './generators/image.j
|
|
|
7
7
|
export { generateCharacter, characterParamsSchema } from './generators/character.js';
|
|
8
8
|
export { generateAnimationAsset, animationParamsSchema, getConfiguredAnimationModel, ANIMATION_MODEL_TEXT_TO_MOTION_3, ANIMATION_MODEL_TEXT_TO_MOTION_2, ANIMATION_MODEL_OLDER, } from './generators/animation.js';
|
|
9
9
|
export { fetchContentLength } from './http.js';
|
|
10
|
+
export { PIXAR_VOXEL_STYLE, MAX_COVER_DESIGN_CHARS, buildCoverArtPrompt } from './cover-prompt.js';
|
|
10
11
|
// The agent↔client terminal-failure contract. Also published as the
|
|
11
12
|
// `@bitmagic/asset-core/terminal-failure` subpath: this barrel eagerly pulls in
|
|
12
13
|
// the generators (and therefore zod, the forger client, and node http helpers),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5F,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAErF,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,gCAAgC,EAChC,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5F,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAErF,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,gCAAgC,EAChC,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEnG,oEAAoE;AACpE,gFAAgF;AAChF,gFAAgF;AAChF,oEAAoE;AACpE,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitmagic/asset-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
"./terminal-failure": {
|
|
13
13
|
"types": "./dist/terminal-failure.d.ts",
|
|
14
14
|
"default": "./dist/terminal-failure.js"
|
|
15
|
+
},
|
|
16
|
+
"./animation/*": {
|
|
17
|
+
"default": "./src/animation/*"
|
|
18
|
+
},
|
|
19
|
+
"./animation/authored.mjs": {
|
|
20
|
+
"types": "./src/animation/authored.d.mts",
|
|
21
|
+
"default": "./src/animation/authored.mjs"
|
|
15
22
|
}
|
|
16
23
|
},
|
|
17
24
|
"files": [
|
|
@@ -21,7 +28,8 @@
|
|
|
21
28
|
"access": "public"
|
|
22
29
|
},
|
|
23
30
|
"dependencies": {
|
|
24
|
-
"zod": "^3.25.76"
|
|
31
|
+
"zod": "^3.25.76",
|
|
32
|
+
"three": "^0.185.1"
|
|
25
33
|
},
|
|
26
34
|
"devDependencies": {
|
|
27
35
|
"@eslint/js": "^9.38.0",
|
|
@@ -65,7 +73,7 @@
|
|
|
65
73
|
"scripts": {
|
|
66
74
|
"build": "tsc",
|
|
67
75
|
"check": "pnpm run lint && pnpm run build",
|
|
68
|
-
"lint": "eslint src",
|
|
76
|
+
"lint": "eslint src --cache",
|
|
69
77
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
|
|
70
78
|
}
|
|
71
79
|
}
|