summer-engine 1.5.0 → 2.2.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/{marketplace.json → .claude-plugin/marketplace.json} +3 -3
- package/.claude-plugin/plugin.json +52 -11
- package/.codex-plugin/plugin.json +69 -8
- package/.cursor-plugin/plugin.json +53 -12
- package/.factory-plugin/plugin.json +20 -0
- package/.opencode/INSTALL.md +75 -0
- package/.opencode/plugins/summer.js +9 -6
- package/AGENTS.md +51 -0
- package/CHANGELOG.md +31 -1
- package/CLAUDE.md +5 -0
- package/GEMINI.md +56 -0
- package/README.md +409 -80
- package/_persona/summer/SKILL.md +113 -0
- package/dist/bin/summer.js +0 -0
- package/dist/commands/assets.d.ts +2 -0
- package/dist/commands/assets.js +189 -0
- package/dist/commands/create.js +55 -17
- package/dist/commands/debug.d.ts +2 -0
- package/dist/commands/debug.js +127 -0
- package/dist/commands/install.js +2 -2
- package/dist/commands/list.js +24 -5
- package/dist/commands/project.d.ts +2 -0
- package/dist/commands/project.js +170 -0
- package/dist/commands/scene.d.ts +2 -0
- package/dist/commands/scene.js +290 -0
- package/dist/lib/banner.js +2 -2
- package/dist/lib/log-filters.d.ts +53 -0
- package/dist/lib/log-filters.js +130 -0
- package/dist/lib/plugin-manifests.test.d.ts +1 -0
- package/dist/lib/plugin-manifests.test.js +134 -0
- package/dist/lib/remote-templates.d.ts +25 -0
- package/dist/lib/remote-templates.js +86 -0
- package/dist/lib/skills-registry.d.ts +283 -3
- package/dist/lib/skills-registry.js +522 -2
- package/dist/lib/telemetry.d.ts +13 -0
- package/dist/lib/telemetry.js +63 -0
- package/dist/lib/with-engine.d.ts +14 -0
- package/dist/lib/with-engine.js +109 -0
- package/dist/mcp/tools/asset-tools.js +12 -13
- package/dist/mcp/tools/debug-tools.js +32 -9
- package/dist/mcp/tools/generate-tools.js +101 -0
- package/dist/mcp/tools/with-engine.js +4 -0
- package/gemini-extension.json +2 -2
- package/hooks/pre-commit-doctor.sh +0 -0
- package/hooks/run-hook.cmd +0 -0
- package/hooks/session-start.sh +0 -0
- package/package.json +11 -5
- package/skills/2d-assets/character-portrait/SKILL.md +196 -0
- package/skills/2d-assets/concept-art/SKILL.md +152 -0
- package/skills/2d-assets/pixel-art/SKILL.md +180 -0
- package/skills/2d-assets/skybox-panorama/SKILL.md +207 -0
- package/skills/2d-assets/sprite-sheet/SKILL.md +239 -0
- package/skills/2d-assets/tileable-texture/SKILL.md +205 -0
- package/skills/2d-assets/ui-graphics/SKILL.md +210 -0
- package/skills/3d-assets/character-model/SKILL.md +225 -0
- package/skills/3d-assets/environment-kit/SKILL.md +164 -0
- package/skills/3d-assets/organic-model/SKILL.md +192 -0
- package/skills/3d-assets/prop-model/SKILL.md +133 -0
- package/skills/3d-assets/vehicle-model/SKILL.md +202 -0
- package/skills/README.md +1 -1
- package/skills/_meta/skill-create/SKILL.md +1 -1
- package/skills/_meta/skill-improve/SKILL.md +1 -1
- package/skills/_meta/skill-test/SKILL.md +1 -1
- package/skills/_meta/using-summer/SKILL.md +130 -0
- package/skills/ai-and-npcs/design-npc/SKILL.md +3 -1
- package/skills/animation/animation-tree/SKILL.md +260 -0
- package/skills/animation/facial-and-lipsync/SKILL.md +282 -0
- package/skills/animation/generate-motion/SKILL.md +129 -0
- package/skills/animation/procedural-animation/SKILL.md +234 -0
- package/skills/animation/retarget/SKILL.md +172 -0
- package/skills/asset-pipeline/asset-strategy/SKILL.md +102 -212
- package/skills/audio/adaptive-music/SKILL.md +326 -0
- package/skills/audio/ambient-bed/SKILL.md +278 -0
- package/skills/audio/music-track/SKILL.md +268 -0
- package/skills/audio/sound-effect/SKILL.md +237 -0
- package/skills/audio/voice-line/SKILL.md +253 -0
- package/skills/catalog.yaml +266 -5
- package/skills/character-controllers/fps-controller/SKILL.md +1 -1
- package/skills/debugging/debug/SKILL.md +102 -82
- package/skills/rendering-and-lighting/3d-lighting/SKILL.md +1 -1
- package/skills/scene-and-project/browse-templates/SKILL.md +105 -0
- package/skills/scene-and-project/make-game/SKILL.md +159 -346
- package/skills/scene-and-project/new-project/SKILL.md +106 -0
- package/skills/scene-and-project/scene-composition/SKILL.md +1 -1
- package/skills/scripting-patterns/gdscript-patterns/SKILL.md +1 -1
- package/skills/ui-and-ux/ui-basics/SKILL.md +1 -1
- package/skills/video/animated-loop/SKILL.md +200 -0
- package/skills/video/cinematic-cutscene/SKILL.md +204 -0
- package/skills/video/trailer-shot/SKILL.md +203 -0
- package/skills/visual-effects/_building-blocks/additive-billboard-particles.md +28 -0
- package/skills/visual-effects/_building-blocks/noise-3d-fbm.gdshaderinc +45 -0
- package/skills/visual-effects/_building-blocks/trauma-shake-snippet.md +51 -0
- package/skills/visual-effects/{vfx → game-feel}/SKILL.md +1 -1
- package/skills/visual-effects/recipes/dissolve/SKILL.md +349 -0
- package/skills/visual-effects/recipes/fire/SKILL.md +387 -0
- package/skills/visual-effects/recipes/hit-spark/SKILL.md +330 -0
- package/skills/visual-effects/recipes/lightning/SKILL.md +372 -0
- package/skills/visual-effects/recipes/magic-glow/SKILL.md +377 -0
- package/skills/visual-effects/recipes/muzzle-flash/SKILL.md +326 -0
- package/skills/visual-effects/recipes/smoke/SKILL.md +381 -0
- package/skills/visual-effects/recipes/water-ripple/SKILL.md +340 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { EngineApiClient } from "./api-client.js";
|
|
2
|
+
import { getAuthToken } from "./auth.js";
|
|
3
|
+
const GATEWAY_URL = process.env.SUMMER_GATEWAY_URL || "https://www.summerengine.com";
|
|
4
|
+
export function extractOpError(result) {
|
|
5
|
+
if (!result || typeof result !== "object")
|
|
6
|
+
return null;
|
|
7
|
+
const op = result;
|
|
8
|
+
if (op.status === "error" && op.error)
|
|
9
|
+
return op.error;
|
|
10
|
+
const firstFailed = op.results?.find((r) => r.ok === false && r.error);
|
|
11
|
+
return firstFailed?.error ?? null;
|
|
12
|
+
}
|
|
13
|
+
export function buildActionHint(message) {
|
|
14
|
+
const normalized = message.toLowerCase();
|
|
15
|
+
if (normalized.includes("no scene open") || normalized.includes("no edited scene")) {
|
|
16
|
+
return "No scene is currently open. Run `summer project context` first, then `summer project open-main` (or `summer scene open` with a known .tscn path).";
|
|
17
|
+
}
|
|
18
|
+
if (normalized.includes("failed to open scene")) {
|
|
19
|
+
return "Scene path could not be opened. Run `summer project context` to get mainScene, then open that exact path. Avoid guessing scene filenames.";
|
|
20
|
+
}
|
|
21
|
+
if (normalized.includes("writefile cannot edit .tscn/.scn")) {
|
|
22
|
+
return "Cannot write .tscn/.scn directly. Use summer scene commands for scene-tree operations, and file-edit tools for .gd scripts.";
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
export async function checkQuota() {
|
|
27
|
+
const token = await getAuthToken();
|
|
28
|
+
if (!token) {
|
|
29
|
+
return {
|
|
30
|
+
allowed: false,
|
|
31
|
+
message: "Not signed in. Run: summer login\nOr open: https://www.summerengine.com/login\nEngine tools require a Summer Engine account (free to create).",
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const res = await fetch(`${GATEWAY_URL}/api/mcp/log-local-call`, {
|
|
36
|
+
method: "POST",
|
|
37
|
+
headers: {
|
|
38
|
+
Authorization: `Bearer ${token}`,
|
|
39
|
+
"Content-Type": "application/json",
|
|
40
|
+
},
|
|
41
|
+
body: JSON.stringify({}),
|
|
42
|
+
signal: AbortSignal.timeout(10000),
|
|
43
|
+
});
|
|
44
|
+
const data = (await res.json().catch(() => ({})));
|
|
45
|
+
if ([401, 402, 403, 429].includes(res.status)) {
|
|
46
|
+
return {
|
|
47
|
+
allowed: false,
|
|
48
|
+
message: data.message || "Quota check failed. Try again.",
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
// Soft-fail on service/gateway issues so local tools keep working.
|
|
52
|
+
if (!res.ok) {
|
|
53
|
+
return { allowed: true };
|
|
54
|
+
}
|
|
55
|
+
if (data.allowed === false) {
|
|
56
|
+
return {
|
|
57
|
+
allowed: false,
|
|
58
|
+
message: data.message || "Call limit reached. Upgrade at https://summerengine.com/pricing",
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return { allowed: true };
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// Network/transient errors should not brick local usage.
|
|
65
|
+
return { allowed: true };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
let cachedClient = null;
|
|
69
|
+
export function getClient() {
|
|
70
|
+
if (cachedClient)
|
|
71
|
+
return Promise.resolve(cachedClient);
|
|
72
|
+
return EngineApiClient.connect().then((c) => {
|
|
73
|
+
cachedClient = c;
|
|
74
|
+
return c;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export function resetClient() {
|
|
78
|
+
cachedClient = null;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Connect to the engine, check quota, and run the given function.
|
|
82
|
+
* Throws on errors (quota, connection, op errors).
|
|
83
|
+
*/
|
|
84
|
+
export async function withEngineClient(fn) {
|
|
85
|
+
const quota = await checkQuota();
|
|
86
|
+
if (!quota.allowed) {
|
|
87
|
+
throw new Error(quota.message || "Quota exceeded");
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
const client = await getClient();
|
|
91
|
+
const result = await fn(client);
|
|
92
|
+
const opError = extractOpError(result);
|
|
93
|
+
if (opError) {
|
|
94
|
+
const hint = buildActionHint(opError);
|
|
95
|
+
throw new Error(hint ? `${opError}\n\nHint: ${hint}` : opError);
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
// Reset client on connection errors so next call retries
|
|
101
|
+
if (err instanceof Error &&
|
|
102
|
+
(err.message.includes("not running") ||
|
|
103
|
+
err.message.includes("not responding") ||
|
|
104
|
+
err.message.includes("ECONNREFUSED"))) {
|
|
105
|
+
resetClient();
|
|
106
|
+
}
|
|
107
|
+
throw err;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -65,14 +65,6 @@ async function searchAssetsApi(params) {
|
|
|
65
65
|
});
|
|
66
66
|
const data = (await res.json());
|
|
67
67
|
if (!res.ok) {
|
|
68
|
-
if (res.status === 402) {
|
|
69
|
-
return {
|
|
70
|
-
error: "upgrade_required",
|
|
71
|
-
message: (data.message || "Asset search requires a Pro subscription.") +
|
|
72
|
-
"\nUpgrade at: https://www.summerengine.com/pricing\nFree tier includes all other MCP tools (scene editing, debugging, etc).",
|
|
73
|
-
plan: data.plan,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
68
|
if (res.status === 401) {
|
|
77
69
|
return {
|
|
78
70
|
error: "unauthorized",
|
|
@@ -80,6 +72,13 @@ async function searchAssetsApi(params) {
|
|
|
80
72
|
" The user needs to re-authenticate:\n npx summer-engine login --force",
|
|
81
73
|
};
|
|
82
74
|
}
|
|
75
|
+
if (res.status === 429) {
|
|
76
|
+
return {
|
|
77
|
+
error: "rate_limited",
|
|
78
|
+
message: (data.message || "Asset search rate limit hit. Wait a moment and try again.") +
|
|
79
|
+
" The public library is free, but rate-limited per user to prevent bulk scraping.",
|
|
80
|
+
};
|
|
81
|
+
}
|
|
83
82
|
return {
|
|
84
83
|
error: data.error || "Search failed",
|
|
85
84
|
message: data.message || "Asset search failed",
|
|
@@ -88,17 +87,17 @@ async function searchAssetsApi(params) {
|
|
|
88
87
|
return data;
|
|
89
88
|
}
|
|
90
89
|
export function registerAssetTools(server) {
|
|
91
|
-
server.tool("summer_search_assets", `Search for game assets in the Summer Engine ecosystem.
|
|
90
|
+
server.tool("summer_search_assets", `Search for game assets in the Summer Engine ecosystem. **Free for all users** with rate limits.
|
|
92
91
|
|
|
93
92
|
Sources:
|
|
94
|
-
- "library" (default) — Public asset library (25k+ community assets).
|
|
95
|
-
- "my_assets" — Your own generated/uploaded assets. Free
|
|
93
|
+
- "library" (default) — Public asset library (25k+ community assets). Free.
|
|
94
|
+
- "my_assets" — Your own generated/uploaded assets. Free. Query is optional.
|
|
96
95
|
- "all" — Search both library and your assets.
|
|
97
96
|
|
|
98
97
|
Uses hybrid search: keywords + semantic similarity. Finds assets by name AND by meaning.
|
|
99
98
|
Returns asset names, types, preview URLs, and import-ready file URLs.
|
|
100
99
|
|
|
101
|
-
Requires authentication: run 'npx summer-engine login' first.`, {
|
|
100
|
+
Requires authentication (so we can attribute usage and apply per-user rate limits): run 'npx summer-engine login' first.`, {
|
|
102
101
|
query: z.string().describe("Natural language search, e.g. 'low-poly tree', 'sci-fi weapon'. For my_assets, can be empty to list recent."),
|
|
103
102
|
assetType: z.enum(["2d_image", "animation", "3d_model", "audio", "music", "all"]).default("all").describe("Filter by asset type"),
|
|
104
103
|
limit: z.number().default(10).describe("Max results (1-20)"),
|
|
@@ -110,7 +109,7 @@ Requires authentication: run 'npx summer-engine login' first.`, {
|
|
|
110
109
|
content: [
|
|
111
110
|
{
|
|
112
111
|
type: "text",
|
|
113
|
-
text: JSON.stringify({ error: result.error, message: result.message
|
|
112
|
+
text: JSON.stringify({ error: result.error, message: result.message }, null, 2),
|
|
114
113
|
},
|
|
115
114
|
],
|
|
116
115
|
isError: true,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { withEngine } from "./with-engine.js";
|
|
3
|
+
import { shapeEngineLogResponse } from "../../lib/log-filters.js";
|
|
3
4
|
export function registerDebugTools(server) {
|
|
4
5
|
server.tool("summer_get_diagnostics", `Quick overview of all errors and warnings from both the editor console and the runtime debugger. Returns error counts and a guidance message.
|
|
5
6
|
|
|
@@ -10,27 +11,49 @@ Typical workflow after making changes:
|
|
|
10
11
|
2. If errors: summer_get_console or summer_get_debugger_errors for details
|
|
11
12
|
3. Fix the issues
|
|
12
13
|
4. summer_get_diagnostics again to verify`, {}, async () => withEngine(async (client) => client.getDiagnostics()));
|
|
13
|
-
server.tool("summer_get_console",
|
|
14
|
-
|
|
14
|
+
server.tool("summer_get_console", `Read recent messages from the editor's Output panel.
|
|
15
|
+
|
|
16
|
+
Output is post-processed for token economy: consecutive identical messages collapse into one entry with a "(×N)" count suffix, and the response carries a "_filter" summary so you can see what was hidden. Use errors_only=true (default) to drop info/std noise; use raw=true to bypass all shaping.
|
|
17
|
+
|
|
18
|
+
Use after summer_get_diagnostics indicates console issues.`, {
|
|
19
|
+
max_lines: z.number().optional().default(100).describe("Max lines to return after dedupe (default 100)"),
|
|
15
20
|
filter: z.string().optional().describe("Only return lines containing this string"),
|
|
16
|
-
type: z.enum(["error", "warning", "std", "editor"]).optional().describe("Filter by message type"),
|
|
17
|
-
|
|
21
|
+
type: z.enum(["error", "warning", "std", "editor"]).optional().describe("Filter by message type at the engine level"),
|
|
22
|
+
errors_only: z.boolean().optional().default(true).describe("Drop info/std noise, keep errors and warnings (default true)"),
|
|
23
|
+
strict_errors: z.boolean().optional().default(false).describe("Drop warnings too — return errors only"),
|
|
24
|
+
raw: z.boolean().optional().default(false).describe("Bypass dedupe and level filtering — return engine output verbatim"),
|
|
25
|
+
}, async ({ max_lines, filter, type, errors_only, strict_errors, raw }) => withEngine(async (client) => {
|
|
18
26
|
const op = { op: "GetConsoleOutput", max_lines };
|
|
19
27
|
if (filter)
|
|
20
28
|
op.filter = filter;
|
|
21
29
|
if (type)
|
|
22
30
|
op.type = type;
|
|
23
|
-
|
|
31
|
+
const engineResult = await client.executeOps([op]);
|
|
32
|
+
if (raw)
|
|
33
|
+
return engineResult;
|
|
34
|
+
const { result } = shapeEngineLogResponse(engineResult, {
|
|
35
|
+
errorsOnly: errors_only,
|
|
36
|
+
errorsOnlyStrict: strict_errors,
|
|
37
|
+
maxEntries: max_lines,
|
|
38
|
+
});
|
|
39
|
+
return result;
|
|
24
40
|
}));
|
|
25
41
|
server.tool("summer_clear_console", "Clear the editor's Output panel. Useful before running the game to get a clean slate for error checking.", {}, async () => withEngine(async (client) => client.executeOps([{ op: "ClearConsoleOutput" }])));
|
|
26
|
-
server.tool("summer_get_debugger_errors",
|
|
27
|
-
|
|
42
|
+
server.tool("summer_get_debugger_errors", `Read runtime errors and warnings from the debugger. These are errors that occur while the game is running (null references, missing nodes, physics errors). Different from console output — these come from the debugger, not print statements.
|
|
43
|
+
|
|
44
|
+
Output is deduped: identical errors firing every frame collapse into one entry with a "(×N)" count suffix. A "_filter" summary tells you exactly what was collapsed or truncated. Use raw=true to bypass shaping when you really need every entry.`, {
|
|
45
|
+
max_errors: z.number().optional().default(50).describe("Max errors to return after dedupe"),
|
|
28
46
|
include_stack: z.boolean().optional().describe("Include stack traces for each error"),
|
|
29
|
-
|
|
47
|
+
raw: z.boolean().optional().default(false).describe("Bypass dedupe — return engine output verbatim"),
|
|
48
|
+
}, async ({ max_errors, include_stack, raw }) => withEngine(async (client) => {
|
|
30
49
|
const op = { op: "GetDebuggerErrors", max_errors };
|
|
31
50
|
if (include_stack !== undefined)
|
|
32
51
|
op.include_stack = include_stack;
|
|
33
|
-
|
|
52
|
+
const engineResult = await client.executeOps([op]);
|
|
53
|
+
if (raw)
|
|
54
|
+
return engineResult;
|
|
55
|
+
const { result } = shapeEngineLogResponse(engineResult, { maxEntries: max_errors });
|
|
56
|
+
return result;
|
|
34
57
|
}));
|
|
35
58
|
server.tool("summer_play", `Start running the game in the engine. The game runs inside Summer Engine's viewport.
|
|
36
59
|
|
|
@@ -273,6 +273,20 @@ Available kinds:
|
|
|
273
273
|
- "image-to-3d" — From your own image. Requires 'imageUrl'.
|
|
274
274
|
- "texture" — Generate textures for a model. Requires 'imageUrl'.
|
|
275
275
|
|
|
276
|
+
Optional rig pass (image-to-3d only):
|
|
277
|
+
Set options.rig = true to add an auto-rig pass via Meshy v6. The result
|
|
278
|
+
job (poll via summer_check_job) will include rigAssetId — the asset ID
|
|
279
|
+
of the rigged glb. Use that rigAssetId with summer_generate_motion to
|
|
280
|
+
add animation clips. Adds ~$0.30 and ~60s to the job.
|
|
281
|
+
|
|
282
|
+
Example:
|
|
283
|
+
summer_generate_3d({
|
|
284
|
+
kind: "image-to-3d",
|
|
285
|
+
imageUrl: "https://...",
|
|
286
|
+
options: { rig: true }
|
|
287
|
+
})
|
|
288
|
+
// Returns jobId; poll until result includes { assetId, rigAssetId }.
|
|
289
|
+
|
|
276
290
|
By default, waits for completion (up to 5 min) and returns the result directly.
|
|
277
291
|
Set wait=false to get the jobId immediately and poll manually with summer_check_job.
|
|
278
292
|
|
|
@@ -419,4 +433,91 @@ Requires authentication: run 'npx summer-engine login' first.`, {
|
|
|
419
433
|
return errorResult(`Job status check failed: ${msg}`);
|
|
420
434
|
}
|
|
421
435
|
});
|
|
436
|
+
// ========================================================================
|
|
437
|
+
// summer_generate_motion
|
|
438
|
+
//
|
|
439
|
+
// NOTE (2026-05-10): only the "meshy-library" backend is exposed today.
|
|
440
|
+
// The "hunyuan-custom" path exists in the Studio route but has not been
|
|
441
|
+
// tested end-to-end on a user's rig (Hunyuan returns a generic skeleton
|
|
442
|
+
// FBX that isn't retargeted onto the caller's character). The schema and
|
|
443
|
+
// call are kept commented-out below — re-enable by restoring the wider
|
|
444
|
+
// zod enum, the prompt/durationSeconds params, the validation branch, and
|
|
445
|
+
// the relevant description lines once the path is verified.
|
|
446
|
+
// ========================================================================
|
|
447
|
+
server.tool("summer_generate_motion", `Generate an animation clip for a Meshy-rigged humanoid character via Summer Engine Studio.
|
|
448
|
+
|
|
449
|
+
Backend:
|
|
450
|
+
- "meshy-library" — picks a clip from a curated mocap set by name (idle, walk,
|
|
451
|
+
run, attack_sword, jump, ~70 standard names). Fast (~30s), cheap (~$0.10),
|
|
452
|
+
real mocap quality.
|
|
453
|
+
|
|
454
|
+
Requires a Meshy-rigged humanoid as the target. The 'rigAssetId' must come from
|
|
455
|
+
a prior summer_generate_3d call with options.rig=true.
|
|
456
|
+
|
|
457
|
+
By default, waits for completion (up to 5 min) and returns the result directly.
|
|
458
|
+
Set wait=false to get the jobId immediately and poll manually with summer_check_job.
|
|
459
|
+
|
|
460
|
+
Common motion names:
|
|
461
|
+
Locomotion: idle, idle_alert, idle_combat, walk, walk_back, run, sprint,
|
|
462
|
+
crouch_idle, crouch_walk, jump, jump_loop, jump_land
|
|
463
|
+
Combat: attack_sword, attack_punch, attack_kick, attack_bow, attack_cast,
|
|
464
|
+
block, dodge_left, dodge_right, hit_react, death
|
|
465
|
+
Social: wave, dance, sit_idle
|
|
466
|
+
|
|
467
|
+
Cost: ~$0.10 per clip. Confirm with user before spending.
|
|
468
|
+
|
|
469
|
+
Custom prompt-driven motion is on the roadmap; not yet shipped. For one-off
|
|
470
|
+
signature moves not on the curated list, fall back to hand-authoring in the
|
|
471
|
+
Godot editor or importing from Mixamo.
|
|
472
|
+
|
|
473
|
+
Requires authentication: run 'npx summer-engine login' first.`, {
|
|
474
|
+
rigAssetId: z
|
|
475
|
+
.string()
|
|
476
|
+
.describe("Asset ID of a rigged character (from summer_generate_3d with options.rig=true)"),
|
|
477
|
+
backend: z
|
|
478
|
+
.enum(["meshy-library"])
|
|
479
|
+
.default("meshy-library")
|
|
480
|
+
.describe("Backend: meshy-library (only option today)"),
|
|
481
|
+
motionName: z
|
|
482
|
+
.string()
|
|
483
|
+
.describe("Curated motion name: walk, run, attack_sword, idle, jump, etc."),
|
|
484
|
+
// prompt + durationSeconds reserved for the hunyuan-custom backend (not
|
|
485
|
+
// shipped yet — see header comment).
|
|
486
|
+
wait: z
|
|
487
|
+
.boolean()
|
|
488
|
+
.default(true)
|
|
489
|
+
.describe("Wait for completion (default true, up to 5 min). Set false to get jobId immediately."),
|
|
490
|
+
options: z
|
|
491
|
+
.record(z.any())
|
|
492
|
+
.optional()
|
|
493
|
+
.describe("Backend-specific passthrough"),
|
|
494
|
+
}, async ({ rigAssetId, backend, motionName, wait, options }) => {
|
|
495
|
+
// Client-side validation
|
|
496
|
+
if (!motionName) {
|
|
497
|
+
return errorResult("motionName is required (e.g. 'walk', 'run', 'attack_sword'). See the tool description for the curated list.");
|
|
498
|
+
}
|
|
499
|
+
const body = {
|
|
500
|
+
rigAssetId,
|
|
501
|
+
backend,
|
|
502
|
+
motionName,
|
|
503
|
+
options,
|
|
504
|
+
};
|
|
505
|
+
const result = await mcpGenerate("/api/mcp/generate/motion", body);
|
|
506
|
+
if (result.error) {
|
|
507
|
+
return errorResult(result.error, result.data);
|
|
508
|
+
}
|
|
509
|
+
const jobId = result.data?.jobId;
|
|
510
|
+
if (!wait || !jobId) {
|
|
511
|
+
return successResult(result.data);
|
|
512
|
+
}
|
|
513
|
+
const pollResult = await pollJob(jobId);
|
|
514
|
+
if (pollResult.error) {
|
|
515
|
+
return errorResult(pollResult.error, { ...pollResult.data, jobId });
|
|
516
|
+
}
|
|
517
|
+
return successResult({
|
|
518
|
+
...pollResult.data,
|
|
519
|
+
jobId,
|
|
520
|
+
message: "Motion generation complete. animationAssetId is in result.",
|
|
521
|
+
});
|
|
522
|
+
});
|
|
422
523
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getClient, resetClient } from "../server.js";
|
|
2
|
+
import { recordMcpSession } from "../../lib/telemetry.js";
|
|
2
3
|
function extractOpError(result) {
|
|
3
4
|
if (!result || typeof result !== "object")
|
|
4
5
|
return null;
|
|
@@ -24,6 +25,9 @@ function buildActionHint(message) {
|
|
|
24
25
|
return null;
|
|
25
26
|
}
|
|
26
27
|
export async function withEngine(fn) {
|
|
28
|
+
// Best-effort, fire-and-forget: count this MCP session as DAU for attribution.
|
|
29
|
+
// No await, no throw, no quota gating.
|
|
30
|
+
recordMcpSession();
|
|
27
31
|
try {
|
|
28
32
|
const client = await getClient();
|
|
29
33
|
const result = await fn(client);
|
package/gemini-extension.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "summer",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "AI game
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "Superpowers for AI game dev. MCP bridge to the local Summer Engine plus a context primer that teaches Gemini the 24 Summer skills. Use with the npm CLI for skill files on disk.",
|
|
5
5
|
"contextFileName": "GEMINI.md",
|
|
6
6
|
"mcpServers": {
|
|
7
7
|
"summer-engine": {
|
|
File without changes
|
package/hooks/run-hook.cmd
CHANGED
|
File without changes
|
package/hooks/session-start.sh
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "summer-engine",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "CLI and MCP tools for Summer Engine
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"description": "Summer — superpowers for AI game dev. CLI, skills, and MCP tools for Summer Engine.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"game-engine",
|
|
7
7
|
"godot",
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
"homepage": "https://summerengine.com",
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/SummerEngine/summer
|
|
17
|
+
"url": "https://github.com/SummerEngine/summer"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"author": "Summer Engine <founders@summerengine.com>",
|
|
21
21
|
"type": "module",
|
|
22
|
+
"main": ".opencode/plugins/summer.js",
|
|
22
23
|
"bin": {
|
|
23
24
|
"summer": "./dist/bin/summer.js"
|
|
24
25
|
},
|
|
@@ -26,16 +27,21 @@
|
|
|
26
27
|
"dist/",
|
|
27
28
|
"skills/",
|
|
28
29
|
"hooks/",
|
|
30
|
+
"assets/",
|
|
31
|
+
"_persona/",
|
|
29
32
|
".claude-plugin/",
|
|
30
33
|
".cursor-plugin/",
|
|
31
34
|
".codex-plugin/",
|
|
35
|
+
".factory-plugin/",
|
|
32
36
|
".opencode/",
|
|
33
37
|
"gemini-extension.json",
|
|
34
|
-
"marketplace.json",
|
|
35
38
|
".mcp.json",
|
|
36
39
|
"README.md",
|
|
37
40
|
"LICENSE",
|
|
38
|
-
"CHANGELOG.md"
|
|
41
|
+
"CHANGELOG.md",
|
|
42
|
+
"AGENTS.md",
|
|
43
|
+
"GEMINI.md",
|
|
44
|
+
"CLAUDE.md"
|
|
39
45
|
],
|
|
40
46
|
"scripts": {
|
|
41
47
|
"build": "tsc",
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: character-portrait
|
|
3
|
+
description: Use when generating a single, polished bust/portrait of a character for dialogue UI, character-select screens, lore cards, or codex entries. One character, locked composition, VN-style. Trigger on "character portrait", "dialogue portrait", "VN portrait", "character bust", "headshot", "character select image", "lore card art".
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: [Cursor, Claude Code, Windsurf, Codex]
|
|
6
|
+
category: 2d-assets
|
|
7
|
+
user-invocable: true
|
|
8
|
+
allowed-tools: Read Grep Glob Write Edit summer_generate_image summer_search_assets summer_import_from_url summer_set_resource_property
|
|
9
|
+
paths: ["assets/**", "art/portraits/**", "ui/portraits/**"]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# character-portrait — Locked Bust for Dialogue UI
|
|
13
|
+
|
|
14
|
+
This skill produces ONE polished character portrait — bust or shoulders-up framing, neutral or stylized background, designed to drop into a dialogue UI, character-select screen, or lore card. It is the **opposite** of `summer:2d-assets/concept-art`: concept art explores; this skill commits.
|
|
15
|
+
|
|
16
|
+
The single biggest failure mode is **inconsistency across a cast**. Generating five party members one at a time without a locked anchor produces five images that look like they're from five different games — different lighting, different angle, different palette, different rendering style. This skill makes you write a **locked anchor suffix** the first time and re-use it verbatim for every subsequent portrait.
|
|
17
|
+
|
|
18
|
+
If the user is still exploring the look, this is the wrong skill — route to `summer:2d-assets/concept-art` first, lock a direction, then come back here. The `summer:asset-pipeline/asset-strategy` meta-router asks **"Quick check — exploring the look (3-4 variants for art direction) or generating a final character portrait for dialogue UI?"** to disambiguate.
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- "Generate a portrait for the merchant NPC."
|
|
23
|
+
- "I need a character-select image for the four playable heroes."
|
|
24
|
+
- "Make a lore-card image of the king."
|
|
25
|
+
- "Add a VN-style dialogue portrait for Aria."
|
|
26
|
+
- The cast is locked and the visual direction is locked; you're producing finals.
|
|
27
|
+
|
|
28
|
+
## When NOT to use
|
|
29
|
+
|
|
30
|
+
- The user is still exploring → `summer:2d-assets/concept-art`.
|
|
31
|
+
- The user wants pixel art → `summer:2d-assets/pixel-art`.
|
|
32
|
+
- The user wants a full-body 3D model → `summer:asset-pipeline/asset-strategy`.
|
|
33
|
+
- The user wants 4+ animated expressions of the same character — generate one base portrait here, then use img2img with the base as `referenceImageUrl` for each expression.
|
|
34
|
+
|
|
35
|
+
## Steps
|
|
36
|
+
|
|
37
|
+
### 1. Read or establish the locked anchor
|
|
38
|
+
|
|
39
|
+
Check `.summer/portrait-anchor.md` first.
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Read .summer/portrait-anchor.md
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If it doesn't exist, this is the first portrait in the cast — you must define the anchor now. Ask the user (or infer from `.summer/GameSoul.md`):
|
|
46
|
+
|
|
47
|
+
- **Framing:** bust (chest up) or shoulders-up?
|
|
48
|
+
- **Angle:** straight-on, three-quarter left, three-quarter right?
|
|
49
|
+
- **Lighting:** soft front, dramatic side, rim-lit, golden-hour?
|
|
50
|
+
- **Background:** flat color, soft gradient, painterly blur, in-world environment?
|
|
51
|
+
- **Rendering style:** painterly, anime, semi-realistic, line-art-with-flat-color?
|
|
52
|
+
|
|
53
|
+
Write the anchor to `.summer/portrait-anchor.md`:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
## Portrait anchor (re-use verbatim for every cast member)
|
|
57
|
+
|
|
58
|
+
framing: bust, shoulders to crown of head visible
|
|
59
|
+
angle: three-quarter view, slight turn to character's left
|
|
60
|
+
lighting: soft warm key from upper right, cool fill from left, gentle rim
|
|
61
|
+
background: muted painterly gradient, dark teal to deep brown, no scene detail
|
|
62
|
+
style: semi-realistic painterly, soft edges, oil-painting feel
|
|
63
|
+
aspect: portrait_4_3
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Every subsequent portrait in this cast appends the anchor to the prompt verbatim. **Do not edit the anchor mid-cast** unless the user explicitly says "I want the new ones to look different."
|
|
67
|
+
|
|
68
|
+
### 2. Search for an existing portrait
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
summer_search_assets(query="<character name> portrait", filter={ kind: "image" })
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Reuse beats regenerate. If the user wants to iterate on an existing one, pull its URL and pass it as `referenceImageUrl` for img2img.
|
|
75
|
+
|
|
76
|
+
### 3. Build the prompt — character + anchor
|
|
77
|
+
|
|
78
|
+
Pattern:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
<character description>. <anchor framing/angle/lighting/background/style>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The character description should include: identity (age, build, hair, distinctive features), expression, costume/equipment, any signature prop. Keep it under 60 words including the anchor.
|
|
85
|
+
|
|
86
|
+
### 4. Confirm and call
|
|
87
|
+
|
|
88
|
+
> Generating Aria the witch portrait — 1 image, ~$0.02, model nano-banana-2, anchor locked from `.summer/portrait-anchor.md`. OK?
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
summer_generate_image(
|
|
92
|
+
prompt="Aria, young witch, mid-twenties, pale skin, long black hair with silver streak, sharp green eyes, half-smile, wearing dark indigo robes with silver embroidery, raven on shoulder. <anchor verbatim>",
|
|
93
|
+
model="nano-banana-2",
|
|
94
|
+
style="none",
|
|
95
|
+
options={ image_size: "portrait_4_3" }
|
|
96
|
+
)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`style: "none"` because the anchor's "semi-realistic painterly" already specifies style; the preset would fight it.
|
|
100
|
+
|
|
101
|
+
### 5. Import and wire into UI
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
summer_import_from_url(
|
|
105
|
+
url="<fileUrl from generation>",
|
|
106
|
+
path="res://ui/portraits/aria.png"
|
|
107
|
+
)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
For dialogue UI nodes, wire the texture into a `TextureRect`:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
summer_set_resource_property(
|
|
114
|
+
nodePath="/root/UI/DialogueBox/PortraitRect",
|
|
115
|
+
resourceProperty="texture",
|
|
116
|
+
value="res://ui/portraits/aria.png"
|
|
117
|
+
)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
For character-select with multiple portraits, name files consistently: `aria.png`, `borin.png`, `cael.png`, `dara.png`. Index-able from code via `"res://ui/portraits/%s.png" % character_id`.
|
|
121
|
+
|
|
122
|
+
### 6. Iterate (img2img) instead of regenerating from scratch
|
|
123
|
+
|
|
124
|
+
If the user wants the portrait tweaked ("smaller smile", "darker robes"), use img2img with the existing image as `referenceImageUrl`. Preserves identity and lighting.
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
summer_generate_image(
|
|
128
|
+
prompt="<original prompt> with a smaller, more subtle smile",
|
|
129
|
+
referenceImageUrl="<previous fileUrl>",
|
|
130
|
+
model="nano-banana-2",
|
|
131
|
+
style="none"
|
|
132
|
+
)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Prompt patterns
|
|
136
|
+
|
|
137
|
+
| Goal | Prompt skeleton (subject part only — append anchor verbatim) | Why |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| Generic NPC | `<name>, <age> <build>, <hair>, <eyes>, <expression>, wearing <costume>` | Identity-first; no scene context |
|
|
140
|
+
| Hero / protagonist | `<name>, <age> <build>, <hair>, <distinctive feature>, confident <expression>, wearing <signature outfit>, holding <signature prop>` | Adds prop for memorability |
|
|
141
|
+
| Antagonist | `<name>, <imposing detail>, <unsettling expression>, wearing <costume with menacing detail>, <signature scar/mark>` | Antagonists need visual asymmetry |
|
|
142
|
+
| Lore card / king | `<name>, <age>, regal <expression>, wearing <ornate detail>, <crown/insignia>, formal portrait pose` | Formal pose overrides anchor's three-quarter |
|
|
143
|
+
| Expression variant | `<previous prompt> with <new expression: angry / surprised / sad / laughing>` + `referenceImageUrl: <base portrait>` | img2img preserves identity |
|
|
144
|
+
| Younger / older variant | `<character> as a <child / elder>` + `referenceImageUrl: <base>` | For flashback / time-skip portraits |
|
|
145
|
+
|
|
146
|
+
### Bad prompts (and why)
|
|
147
|
+
|
|
148
|
+
| Bad | Failure mode |
|
|
149
|
+
|---|---|
|
|
150
|
+
| `cool warrior portrait` | No identity, no anchor. Returns generic stock art. |
|
|
151
|
+
| `the witch but make her sad` (no img2img ref) | Without `referenceImageUrl`, you get a *different* witch who is sad. Identity drift. |
|
|
152
|
+
| Anchor inconsistent across cast | Each portrait looks like a different game. The cast doesn't read as a cast. |
|
|
153
|
+
| `full body portrait` | "Portrait" implies bust. If you want full body, say so explicitly AND switch to `image_size: "portrait_4_3"` framed full-body — but that's a different asset class; consider `concept-art` or 3D pipeline. |
|
|
154
|
+
| `transparent background` for a painterly portrait | Painterly + transparent fails on most models. Use a flat or gradient background, then alpha-cut in an editor if you must. |
|
|
155
|
+
|
|
156
|
+
## Anti-patterns
|
|
157
|
+
|
|
158
|
+
- **No anchor file.** Every cast member generated ad-hoc looks unrelated. Define the anchor on portrait #1, re-use for the rest of the cast.
|
|
159
|
+
- **Editing the anchor mid-cast.** If you change lighting from "warm key" to "dramatic side" halfway through, the cast splits visually. Either commit to the change and regenerate everyone, or stick with the anchor.
|
|
160
|
+
- **Regenerating from scratch when img2img would do.** Identity drifts every regen. Iterate via `referenceImageUrl`.
|
|
161
|
+
- **Using the portrait as a 3D reference.** Portraits have dramatic lighting, painterly backgrounds, and cropped framing — all of which corrupt 3D generation. For 3D, generate a separate clean white-bg full-body T-pose via `summer:asset-pipeline/asset-strategy`.
|
|
162
|
+
- **Using `style: "realistic"` or `"cartoon"`** when the anchor already names a style. The preset overrides the anchor.
|
|
163
|
+
|
|
164
|
+
## Edge cases
|
|
165
|
+
|
|
166
|
+
- **Character has a non-human silhouette (lizardfolk, demon, robot).** The anchor still applies — framing, lighting, background, rendering style. Only the subject description changes. Verify the model can hold the silhouette under "bust framing" — some models default to humanoid.
|
|
167
|
+
- **Player wants to swap costumes mid-game.** Generate one base portrait per costume (`aria_traveler.png`, `aria_robes.png`, `aria_armored.png`) and switch by index. Use img2img from the base for consistency.
|
|
168
|
+
- **Cast of 12+ characters.** Anchor discipline gets harder as fatigue sets in. Print the anchor as a header in your generation script and don't write any prompt without it.
|
|
169
|
+
- **User wants the portrait to "read at small size" (32×32 in a portrait list).** That's pixel-art territory; route to `summer:2d-assets/pixel-art`.
|
|
170
|
+
|
|
171
|
+
## Fallback (no MCP)
|
|
172
|
+
|
|
173
|
+
Print the prompt and the call:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
summer_generate_image(prompt="<character + anchor>", model="nano-banana-2", style="none", options={ image_size: "portrait_4_3" })
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Tell the user to run via the Summer dashboard, then `summer_import_from_url` the result to `res://ui/portraits/<name>.png`.
|
|
180
|
+
|
|
181
|
+
## Handoff
|
|
182
|
+
|
|
183
|
+
After the portrait is wired:
|
|
184
|
+
|
|
185
|
+
- **More cast members** → re-invoke this skill with the same anchor. Don't redefine.
|
|
186
|
+
- **Expression variants** → re-invoke with `referenceImageUrl` set to the base portrait.
|
|
187
|
+
- **Pixel-art version of the same character** → `summer:2d-assets/pixel-art`.
|
|
188
|
+
- **3D model of the same character** → `summer:asset-pipeline/asset-strategy` (the portrait is NOT a usable 3D reference; generate a separate T-pose).
|
|
189
|
+
- **Dialogue system wiring** → `summer:scene-composition` for the UI hierarchy.
|
|
190
|
+
|
|
191
|
+
## See also
|
|
192
|
+
|
|
193
|
+
- `summer:2d-assets/concept-art` — explore the look first if not yet locked.
|
|
194
|
+
- `summer:asset-pipeline/asset-strategy` — meta-router and the 3D pipeline.
|
|
195
|
+
- `summer:scene-composition` — wiring the portrait into a dialogue UI scene.
|
|
196
|
+
- `_shared/mcp-tools-reference.md` — `summer_generate_image` parameter schema.
|