gamesteel 0.3.3 → 0.4.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/README.md +2 -0
- package/dist/gamesteel.js +2491 -1025
- package/dist/pkgs/studio/dist/server/playtest-worker.js +92 -15
- package/package.json +23 -23
|
@@ -67964,6 +67964,41 @@ function playtestSceneAt(session, viewport, art = {}) {
|
|
|
67964
67964
|
return sceneShown({ prev: session.state, curr: session.state, prevCam: placed, currCam: placed, alpha: 1, droppedTicks: 0 }, session.facing, viewport, { view, camera, art: { game: session.shown.art, book: art.book ?? /* @__PURE__ */ new Map() } });
|
|
67965
67965
|
}
|
|
67966
67966
|
|
|
67967
|
+
// ../core/dist/playtest/witness.js
|
|
67968
|
+
init_limits();
|
|
67969
|
+
var sixteenth = (value) => Math.round(value * 16) / 16;
|
|
67970
|
+
function checkpointOf(session, ticks) {
|
|
67971
|
+
const { state } = session;
|
|
67972
|
+
const kinds = {};
|
|
67973
|
+
for (const entity of state.entities)
|
|
67974
|
+
if (entity.alive)
|
|
67975
|
+
kinds[entity.kind] = (kinds[entity.kind] ?? 0) + 1;
|
|
67976
|
+
const first = state.entities.filter((entity) => entity.alive && (entity.props.get("player") ?? 0) >= 1).sort((a, b) => a.id - b.id)[0];
|
|
67977
|
+
const seen2 = first === void 0 ? void 0 : inspect(session, [`#${String(first.id)}`])[0];
|
|
67978
|
+
return {
|
|
67979
|
+
at: Math.round(ticks / TICKS_PER_SECOND * 10) / 10,
|
|
67980
|
+
status: state.status,
|
|
67981
|
+
player: seen2 === void 0 ? null : { x: sixteenth(seen2.x), y: sixteenth(seen2.y) },
|
|
67982
|
+
kinds
|
|
67983
|
+
};
|
|
67984
|
+
}
|
|
67985
|
+
function witnessRun(session, track) {
|
|
67986
|
+
const inputs = decodeTrack(track);
|
|
67987
|
+
const checkpoints = [];
|
|
67988
|
+
let now = session;
|
|
67989
|
+
let ticks = 0;
|
|
67990
|
+
for (let from = 0; from < inputs.length; from += TICKS_PER_SECOND) {
|
|
67991
|
+
const piece = inputs.slice(from, from + TICKS_PER_SECOND);
|
|
67992
|
+
const result = play(now, piece);
|
|
67993
|
+
now = result.session;
|
|
67994
|
+
ticks += result.ticks;
|
|
67995
|
+
checkpoints.push(checkpointOf(now, ticks));
|
|
67996
|
+
if (now.state.status !== "playing")
|
|
67997
|
+
break;
|
|
67998
|
+
}
|
|
67999
|
+
return { status: now.state.status, checkpoints };
|
|
68000
|
+
}
|
|
68001
|
+
|
|
67967
68002
|
// ../core/dist/render/pixel-font.js
|
|
67968
68003
|
var PIXEL_FONT = {
|
|
67969
68004
|
"A": [".###.", "#...#", "#...#", "#####", "#...#", "#...#", "#...#"],
|
|
@@ -76499,7 +76534,7 @@ var START = [
|
|
|
76499
76534
|
"## Read as you go",
|
|
76500
76535
|
"",
|
|
76501
76536
|
"- game: the game text. Read it before writing one.",
|
|
76502
|
-
"- scripts, then api: how scripts run, and the exact TypeScript they are checked against. Most of a good game",
|
|
76537
|
+
"- scripts, then api and api-game: how scripts run, and the exact TypeScript they are checked against. Most of a good game",
|
|
76503
76538
|
" lives in its scripts.",
|
|
76504
76539
|
"- drawing: art drawn in code: shapes, gradients, soft light, curves, panels, every option.",
|
|
76505
76540
|
"- style: craft -- palette, light, texture, depth, UI and type, and the tells that make art look generated.",
|
|
@@ -76511,7 +76546,7 @@ var START = [
|
|
|
76511
76546
|
"- edit: ids, the edit operations, and write_code against edit.",
|
|
76512
76547
|
"- art: art paint, pictures painted once against the 2D canvas.",
|
|
76513
76548
|
"- model: art model, 3D art Blender builds from a short script, when the person asks for 3D.",
|
|
76514
|
-
"- team: working beside the person's teammates and their agents on the same game.",
|
|
76549
|
+
"- team: working beside the person's teammates and their agents on the same game, and a game's move to a newer engine.",
|
|
76515
76550
|
"",
|
|
76516
76551
|
"## Others may be working on this game",
|
|
76517
76552
|
"",
|
|
@@ -76538,6 +76573,9 @@ var START = [
|
|
|
76538
76573
|
" the title, a menu, a hit, the ending. Words are cheap; pictures cost more, so look on purpose.",
|
|
76539
76574
|
"6. Polish until it is a game you would show someone.",
|
|
76540
76575
|
"",
|
|
76576
|
+
"games new and games open answer with the game's link, where the person sees and plays it in the editor: give it to",
|
|
76577
|
+
"the person whenever there is something to see, the first time above all. A look with shaders is drawn there too.",
|
|
76578
|
+
"",
|
|
76541
76579
|
"## Made for this game, never repeated",
|
|
76542
76580
|
"",
|
|
76543
76581
|
"Before a character, a creature, a vehicle, a building, or any song:",
|
|
@@ -76874,16 +76912,27 @@ var MODEL = [
|
|
|
76874
76912
|
];
|
|
76875
76913
|
var SCRIPTS = [
|
|
76876
76914
|
...SCRIPTS_PRIMER,
|
|
76877
|
-
"The exact declarations every script is checked against are the api
|
|
76915
|
+
"The exact declarations every script is checked against are the api and api-game topics."
|
|
76878
76916
|
];
|
|
76879
|
-
function agentApi() {
|
|
76917
|
+
function agentApi(part) {
|
|
76880
76918
|
const own3 = (what, name) => `/** ${what}: one of the game's own, own:<name>, made for it. */
|
|
76881
76919
|
type ${name} = \`own:\${string}\`
|
|
76882
76920
|
`;
|
|
76883
|
-
|
|
76884
|
-
|
|
76885
|
-
|
|
76886
|
-
|
|
76921
|
+
const whole = SCRIPT_API.trimEnd().replace(/(?:\/\*\*[^\n]*\*\/\n)?type SoundName = [^\n]*\n/, () => own3("A sound", "SoundName")).replace(/(?:\/\*\*[^\n]*\*\/\n)?type MusicName = [^\n]*\n/, () => own3("A song", "MusicName"));
|
|
76922
|
+
const at2 = whole.indexOf("\ninterface Game {");
|
|
76923
|
+
if (at2 < 0)
|
|
76924
|
+
throw new Error("the script API has no interface Game to split it at");
|
|
76925
|
+
return part === "objects" ? [
|
|
76926
|
+
"// The script API, part one, as the type checker holds scripts to it: the shared types, tweens and sequences, Thing,",
|
|
76927
|
+
"// sounds, songs and the Mixer, Turns, the UI, spawning, Behaviour, Bot, Check, GameScript, input, rays, the camera",
|
|
76928
|
+
"// and bursts. A sound and a song are the game's own (own:<name>); the stock names older games still use are left",
|
|
76929
|
+
"// out here. this.game, drawing, noise and console are part two, the api-game topic.",
|
|
76930
|
+
whole.slice(0, at2).trimEnd()
|
|
76931
|
+
].join("\n") : [
|
|
76932
|
+
"// The script API, part two, as the type checker holds scripts to it: this.game (interface Game), drawing (Draw,",
|
|
76933
|
+
"// its layers, paints and shaders), noise and console. The types it names, Thing, Point and Colour among them, are",
|
|
76934
|
+
"// part one, the api topic.",
|
|
76935
|
+
whole.slice(at2 + 1)
|
|
76887
76936
|
].join("\n");
|
|
76888
76937
|
}
|
|
76889
76938
|
var TEAM = [
|
|
@@ -76915,7 +76964,18 @@ var TEAM = [
|
|
|
76915
76964
|
" task. Leave it to them; if your person asked you to change it, send the same change again and it goes through.",
|
|
76916
76965
|
"- Nobody is blocked for good: a claim lapses when its holder has been quiet for 30 minutes, and their task can",
|
|
76917
76966
|
" then be taken over.",
|
|
76918
|
-
"- Your edits carry the title of the task you took as their note, so the team sees why each change was made."
|
|
76967
|
+
"- Your edits carry the title of the task you took as their note, so the team sees why each change was made.",
|
|
76968
|
+
"",
|
|
76969
|
+
"## Engine moves",
|
|
76970
|
+
"",
|
|
76971
|
+
"- When Gamesteel moves to a newer engine, the first call that names a game checked against an older one says what",
|
|
76972
|
+
' changed for it. When a change touches the game, or its recorded play differs, a task "Engine A \u2192 B: n of m changes',
|
|
76973
|
+
' touch this game" is put on its board.',
|
|
76974
|
+
"- Take it like any task. games open shows the whole report while it is open: each change with the places it touches",
|
|
76975
|
+
" and how to fix it, and where each recorded win first plays differently on the new engine.",
|
|
76976
|
+
"- Fix the game with the usual tools, playtest each level to a win, then mark the task done: the game is then checked",
|
|
76977
|
+
" against the new engine.",
|
|
76978
|
+
"- A playtest that wins is kept as its level's recorded win: the evidence the next move compares against."
|
|
76919
76979
|
];
|
|
76920
76980
|
var FILM = [
|
|
76921
76981
|
"# Films",
|
|
@@ -77126,18 +77186,19 @@ var GUIDE_TOPICS = [
|
|
|
77126
77186
|
{ name: "start", about: "how to work, and the bar for a finished game -- read it first", text: () => START.join("\n") },
|
|
77127
77187
|
{ name: "game", about: "the game text: settings, types, bodies, levels and tiles, the camera, rules, controls", text: () => [...quickWay(), ...gameText()].join("\n") },
|
|
77128
77188
|
{ name: "scripts", about: "how scripts run: hooks, state, timers, tweens, screens, sound, with ready-made UI", text: () => SCRIPTS.join("\n") },
|
|
77129
|
-
{ name: "api", about: "the script API,
|
|
77189
|
+
{ name: "api", about: "the script API, part one: Thing, scripts, sound, UI, input", text: () => agentApi("objects") },
|
|
77190
|
+
{ name: "api-game", about: "the script API, part two: this.game and drawing", text: () => agentApi("game") },
|
|
77130
77191
|
{ name: "drawing", about: "art drawn in code: layers and units, shapes, gradients, soft light, curves, panels, push and pop, screens that scale", text: () => DRAWING.join("\n") },
|
|
77131
|
-
{ name: "shaders", about: "drawing with the graphics card: boxes
|
|
77192
|
+
{ name: "shaders", about: "drawing with the graphics card: shaded boxes, shaders over the picture, passes, inputs", text: () => SHADERS.join("\n") },
|
|
77132
77193
|
{ name: "style", about: "craft: palette, light, texture, depth, UI and type, and the tells that make art look generated", text: () => STYLE.join("\n") },
|
|
77133
77194
|
{ name: "feel", about: "screens, transitions, juice, sound and music", text: () => FEEL.join("\n") },
|
|
77134
77195
|
{ name: "sound", about: "designed sound effects and composed music: layers, variants, instruments, loudness, and listening", text: () => SOUND_TOPIC.join("\n") },
|
|
77135
77196
|
{ name: "playtest", about: "playing it yourself with tracks and bots, and looking at it", text: () => playtestGuide().join("\n") },
|
|
77136
77197
|
{ name: "edit", about: "ids, the edit operations, and write_code against edit", text: () => howToEdit().join("\n") },
|
|
77137
77198
|
{ name: "art", about: "art paint: pictures, animations and tilesets painted against the 2D canvas", text: () => ART.join("\n") },
|
|
77138
|
-
{ name: "model", about: "art model: 3D art Blender builds from a short script
|
|
77139
|
-
{ name: "team", about: "working beside teammates and their agents: the board,
|
|
77140
|
-
{ name: "film", about: "films: levels that play themselves, cutscenes, chapters, endFilm, and film render
|
|
77199
|
+
{ name: "model", about: "art model: 3D art Blender builds from a short script, when the person asks for 3D", text: () => MODEL.join("\n") },
|
|
77200
|
+
{ name: "team", about: "working beside teammates and their agents: the board, parts, claims, notes", text: () => TEAM.join("\n") },
|
|
77201
|
+
{ name: "film", about: "films: levels that play themselves, cutscenes, chapters, endFilm, and film render to MP4", text: () => FILM.join("\n") }
|
|
77141
77202
|
];
|
|
77142
77203
|
|
|
77143
77204
|
// ../agent/dist/artgen-tools.js
|
|
@@ -90077,9 +90138,22 @@ ${done.text}`,
|
|
|
90077
90138
|
track: encodeTrack(done.session.inputs),
|
|
90078
90139
|
step: state.step,
|
|
90079
90140
|
status: state.status,
|
|
90080
|
-
version: entry.version
|
|
90141
|
+
version: entry.version,
|
|
90142
|
+
run: { seed: entry.seed, language: entry.language }
|
|
90081
90143
|
};
|
|
90082
90144
|
}
|
|
90145
|
+
async witness(source, run2) {
|
|
90146
|
+
if (source.scripts !== null)
|
|
90147
|
+
await initScripting();
|
|
90148
|
+
const session = createPlaytest(source.text, source.level, {
|
|
90149
|
+
...source.scripts === null ? {} : { scripts: source.scripts },
|
|
90150
|
+
seed: run2.seed,
|
|
90151
|
+
...source.audio === void 0 ? {} : { audio: source.audio },
|
|
90152
|
+
...source.fonts === void 0 ? {} : { fonts: source.fonts },
|
|
90153
|
+
...run2.language === null ? {} : { language: run2.language }
|
|
90154
|
+
});
|
|
90155
|
+
return witnessRun(session, run2.track);
|
|
90156
|
+
}
|
|
90083
90157
|
async act(entry, source, action, raw) {
|
|
90084
90158
|
const session = entry.session;
|
|
90085
90159
|
switch (action) {
|
|
@@ -90339,6 +90413,9 @@ port.on("message", (message) => {
|
|
|
90339
90413
|
case "size":
|
|
90340
90414
|
ok2 = await service.size();
|
|
90341
90415
|
break;
|
|
90416
|
+
case "witness":
|
|
90417
|
+
ok2 = await service.witness(...message.args);
|
|
90418
|
+
break;
|
|
90342
90419
|
}
|
|
90343
90420
|
port.postMessage({ id: message.id, ok: ok2 });
|
|
90344
90421
|
} catch (error2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gamesteel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "The Gamesteel program your AI agent starts, and the command that sets it up in Claude Code, Codex, Gemini CLI, Cursor, VS Code and 26 more. The work runs on your machine; the website keeps your games.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gamesteel",
|
|
@@ -26,13 +26,6 @@
|
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": ">=20"
|
|
28
28
|
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"pretest": "pnpm --filter \"gamesteel^...\" --filter \"!@gamesteel/studio\" build && pnpm --filter @gamesteel/studio exec tsc -p tsconfig.json && pnpm build",
|
|
31
|
-
"build": "tsc --noEmit -p tsconfig.json && node build.mjs",
|
|
32
|
-
"prepublishOnly": "pnpm run build",
|
|
33
|
-
"test": "vitest run",
|
|
34
|
-
"typecheck": "tsc --noEmit && tsc -p tsconfig.test.json"
|
|
35
|
-
},
|
|
36
29
|
"dependencies": {
|
|
37
30
|
"@jitl/quickjs-singlefile-mjs-release-sync": "0.32.0",
|
|
38
31
|
"@napi-rs/canvas": "^1.0.10",
|
|
@@ -42,20 +35,27 @@
|
|
|
42
35
|
"yaml": "^2.9.1"
|
|
43
36
|
},
|
|
44
37
|
"devDependencies": {
|
|
45
|
-
"@gamesteel/accounts": "workspace:*",
|
|
46
|
-
"@gamesteel/agent": "workspace:*",
|
|
47
|
-
"@gamesteel/billing": "workspace:*",
|
|
48
|
-
"@gamesteel/builder": "workspace:*",
|
|
49
|
-
"@gamesteel/cloud": "workspace:*",
|
|
50
|
-
"@gamesteel/connect": "workspace:*",
|
|
51
|
-
"@gamesteel/core": "workspace:*",
|
|
52
|
-
"@gamesteel/design": "workspace:*",
|
|
53
|
-
"@gamesteel/edit": "workspace:*",
|
|
54
|
-
"@gamesteel/model": "workspace:*",
|
|
55
|
-
"@gamesteel/service": "workspace:*",
|
|
56
|
-
"@gamesteel/store": "workspace:*",
|
|
57
|
-
"@gamesteel/studio": "workspace:*",
|
|
58
38
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
59
|
-
"esbuild": "0.28.2"
|
|
39
|
+
"esbuild": "0.28.2",
|
|
40
|
+
"@gamesteel/billing": "0.1.0",
|
|
41
|
+
"@gamesteel/agent": "0.1.0",
|
|
42
|
+
"@gamesteel/connect": "0.1.0",
|
|
43
|
+
"@gamesteel/builder": "0.1.0",
|
|
44
|
+
"@gamesteel/cloud": "0.1.0",
|
|
45
|
+
"@gamesteel/core": "0.1.0",
|
|
46
|
+
"@gamesteel/edit": "0.1.0",
|
|
47
|
+
"@gamesteel/accounts": "0.1.0",
|
|
48
|
+
"@gamesteel/service": "0.1.0",
|
|
49
|
+
"@gamesteel/i18n": "0.1.0",
|
|
50
|
+
"@gamesteel/studio": "0.1.0",
|
|
51
|
+
"@gamesteel/store": "0.1.0",
|
|
52
|
+
"@gamesteel/design": "0.1.0",
|
|
53
|
+
"@gamesteel/model": "0.1.0"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"pretest": "pnpm --filter \"gamesteel^...\" --filter \"!@gamesteel/studio\" build && pnpm --filter @gamesteel/studio exec tsc -p tsconfig.json && pnpm build",
|
|
57
|
+
"build": "tsc --noEmit -p tsconfig.json && node build.mjs",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"typecheck": "tsc --noEmit && tsc -p tsconfig.test.json"
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
}
|