import { type ArtStyle } from '@bitmagic/asset-core/art-style'; import { type AgentId } from './agent-targets.js'; import type { EnvironmentName } from '../config/environments.js'; /** * The legal notice stamped into every game this project publishes. * * **A licence obligation, not decoration.** A published game is one file with the engine inlined * (and, from a `--single-file` build, its third-party dependencies too), so distributing a game * distributes part of the engine. * PolyForm Shield's Notices section requires that anyone receiving any part of the software also * receives the terms and every `Required Notice:` line; MIT and ISC require their copyright and * permission notices to travel with copies; Apache-2.0 section 4 requires the licence to accompany * derivative distributions. One banner satisfies all of them. See `engine/LICENSE.md`. * * This is a second copy of `game/publish-notice.js` — deliberately, because a scaffolded project * on a creator's machine cannot import from the Bitmagic monorepo. `__tests__/publish-notice.test.ts` * holds it to the content that actually has to be there. * * Kept small on purpose: `ENGINE_BUILD_MARKERS` in `@bitmagic/asset-core/publish-source` are * matched only in a published bundle's first 64KB, and everything here pushes the import map down. */ export declare const PUBLISHED_BUNDLE_BANNER = "/*!\n * Made with Bitmagic \u2014 https://bitmagic.ai\n *\n * This bundle includes the Bitmagic engine.\n * Required Notice: Copyright Bitmagic Oy (https://bitmagic.ai)\n * Licensed under the PolyForm Shield License 1.0.0\n * , with an additional permission\n * granting the right to build, modify, sell and distribute games. Full terms:\n * https://bitmagic.ai/terms-of-service\n *\n * Third-party software included in this bundle:\n * three.js \u2014 MIT \u2014 Copyright (c) 2010-2026 three.js authors\n * @dimforge/rapier2d-compat, @dimforge/rapier3d-compat \u2014 Apache License 2.0\n * @msgpack/msgpack \u2014 ISC \u2014 Copyright 2019 The MessagePack Community\n * fflate \u2014 MIT \u2014 Copyright (c) 2023 Arjun Barrett\n * i18next, i18next-browser-languagedetector \u2014 MIT \u2014 Copyright (c) 2025 i18next\n * JSZip \u2014 MIT (elected) \u2014 Copyright (c) 2009-2016 Stuart Knightley and contributors\n * Full licence texts: THIRD-PARTY-NOTICES.md in the Bitmagic engine distribution.\n */"; /** * Mirrors game/package.json so the pro lane resolves exactly what CI builds against. * * Exported so `bitmagic upgrade` can diff a project's actual package.json against what the * vendored engine currently needs — package.json itself is never rewritten (see * PLATFORM_GENERATED_FILES in project.ts), so this is the only source of truth upgrade has for * telling a creator what to add by hand. */ export declare const DEPENDENCIES: { '@dimforge/rapier2d-compat': string; '@dimforge/rapier3d-compat': string; '@msgpack/msgpack': string; fflate: string; i18next: string; 'i18next-browser-languagedetector': string; jszip: string; three: string; }; export declare const DEV_DEPENDENCIES: Record; /** * Resolved in the browser from a CDN, not from node_modules — see the design's import-map note. * * Exported so the dev view's asset-preview page builds its map from this one definition rather * than a sixth hand-typed copy. See `editor/asset-preview-page.ts`. */ export declare const CDN_IMPORTS: Record; export declare function renderPackageJson(name: string): string; export declare function renderTsconfig(): string; export declare function renderIndexHtml(): string; export declare function renderViteConfig(): string; /** * `CDN_IMPORTS` entries a published bundle keeps INLINED rather than fetching at runtime. * * `fflate` is the whole list, and it is a decision rather than an oversight. `engine/gzip.ts` * falls back to fflate's synchronous codec when `CompressionStream` is missing — that is * iOS/WebKit below 16.4 and a long tail of embedded WebViews, i.e. exactly the browsers with the * least reliable module-CDN story, and the file says so in as many words ("fflate is bundled (not * externalized) so it works offline and without an import map"). Moving it out would break * every compressed VXL/VWLD load precisely where the fallback is the only thing that works, and * buys back about 30KB. `game/vite.bundle-publish.config.js` leaves it bundled for the same * reason, and the two lanes have to agree. * * It stays in `CDN_IMPORTS` regardless: `bitmagic dev` serves raw /dist, where the browser still * has to resolve the bare `fflate` specifier through the import map. */ export declare const INLINED_CDN_IMPORTS: ReadonlySet; /** * The exact/prefix table a published bundle leaves OUT of itself: every `CDN_IMPORTS` entry whose * value resolves on its own (an absolute https URL, or the self-contained `data:` shim `three` * maps to) and that is not deliberately inlined above. * * The local alias prefixes `renderIndexHtml` merges in alongside these (`engine/` -> `/dist/...`) * are excluded by the URL filter, which is load-bearing rather than incidental: a published bundle * is one HTML file sitting in a bucket with no same-origin siblings to fetch, so everything those * name has to be bundled. * * Returned as ordered pairs, not an object, because the order is part of the contract — `cdnUrl` * in the generated config takes the FIRST matching prefix where a browser's import map takes the * LONGEST. The two agree only because `three/addons/` is declared above `three/`; flip them and * every addon resolves through the bare `three/` entry, which is a second copy of three.js: an * unlit scene, and `instanceof THREE.Mesh` scans that find nothing. */ export declare function publishExternalEntries(): Array<[string, string]>; /** * The default config: three.js, Rapier and the rest of the import map's packages are left to the * CDN, exactly as `game/vite.bundle-publish.config.js` does for every production web publish. */ export declare function renderVitePublishConfig(): string; /** * The `--single-file` config: nothing external, so the published HTML plays with no network at all * once it has loaded. Bigger by roughly the size of three.js and Rapier, and the reason it exists * is offline and packaged distribution (`file://`, Poki, a desktop shell), not everyday publishing. */ export declare function renderVitePublishStandaloneConfig(): string; export declare function renderGitignore(): string; /** * What a shipped skill's renderer is handed. * * Only `renderSkillsReadme` reads it today — every other body is agent-independent, and * assigning a `() => string` to this type is legal TypeScript, so they need no parameter at all. * The type exists so a renderer that DOES need to name its own directory can, without the * `SHIPPED_SKILLS` table growing two shapes. */ export interface SkillRenderContext { /** The directory this copy is being written into, relative to the project root. */ skillsDir: string; /** Every skills directory this project holds, so a renderer can name the sibling copies. */ skillDirs: readonly string[]; } export type SkillRenderer = (context: SkillRenderContext) => string; export interface ProjectMetadata { gameId: string; engineVersion: string; genre: string; template: string; /** * Which agent tools this project is set up for, deciding which skills directories `init` writes * and `upgrade` refreshes. See `agent-targets.ts`: the entry that matters is Kiro, since the * shared and Claude Code directories are written unconditionally. * * Optional: every project scaffolded before this existed has none, which reads as the * always-present set — exactly what those projects have on disk. */ agents?: AgentId[]; /** * sha256 of the AGENTS.md the CLI last wrote, so `bitmagic upgrade` can tell an untouched file * (safe to refresh) from one the creator edited (never overwritten — see scaffold/agents-md.ts). * * Optional: every project scaffolded before this existed has none, and those are treated as * edited, which is the safe direction. */ agentsMdHash?: string; /** * Which api-server this project belongs to — the environment that minted its gameId and served * the engine pinned above. Read back by config/environments.ts, which resolves it ahead of the * machine-global default so a checkout is self-describing rather than depending on whatever the * creator last logged into. * * Typed as EnvironmentName here, unlike the reader's copy in project/context.ts: this side * always writes a value the CLI just resolved, while that side parses a hand-editable file. * * Optional so projects scaffolded before it keep working; `bitmagic upgrade` backfills them. */ environment?: EnvironmentName; } export declare function renderBitmagicJson(metadata: ProjectMetadata): string; /** * `skillDirs` is every skills directory this project holds, in `skillDirsFor` order. It is a * parameter for the same reason `environment` is (see `agents-md.ts`): this file has to describe * the project it is written into, and a Kiro project holds a directory a default one does not. * * Cross-references name `PRIMARY_SKILLS_DIR` rather than the reader's own directory, because this * is ONE file read by every agent in the project and it has to pick a path that exists in all of * them. The Layout section names the rest, so a Claude Code reader still learns where its own * loader looks. */ export declare function renderAgentsMd(environment: EnvironmentName | undefined, skillDirs?: readonly string[]): string; /** * `/planning-a-game/SKILL.md` — the slice contract and the mechanic-recipe routing. * * These are one skill rather than two on purpose: you route to a recipe *in order to* scope slice * 1, and slice 1 is the first section of the plan file the recipe tells you to write. Split, the * first instruction of each half would be "now invoke the other half" — and the hosted lane already * paid for that hop (see game-play-agent's mechanic-recipe-router.ts: the batch's slowest game read * the right recipe twice and still shipped with no plan file, because the plan step sat above the * table rather than inside it). * * They are also deliberately NOT in AGENTS.md, which carries only the trigger and a compressed * version. `bitmagic upgrade` refreshes AGENTS.md only while it is byte-identical to what the CLI * wrote, but overwrites shipped skills unconditionally — so a creator who has customised their * AGENTS.md still receives every word of this. */ export declare function renderPlanningSkill(): string; /** * `/finding-engine-apis/SKILL.md` — the discovery protocol in full. * * The problem this exists to solve is measured, not hypothetical. game-play-agent's * engine-api-digest.ts opens with it: session analysis showed the hosted coding agent spending most * of its wall-clock reconstructing the engine's public API through dozens of sequential searches, * and one digest lookup replaced several code searches. A scaffolded project had the same 240k * lines and none of the digest until the corpus started shipping — so an external agent had no * option but the expensive one. */ export declare function renderEngineApiSkill(): string; export declare function renderGenerateSkill(): string; /** * `/checking-usage/SKILL.md` — what the creator's sparks bought. * * Exists because the agent is what spends the money and the human is what pays * for it. Before this, the only way to learn a balance was to be REFUSED one: * generation failures carried a balance, nothing else did. An agent that can * check first can say "this will take most of what is left" before it burns it. */ export declare function renderUsageSkill(): string; /** * `/judging-quality/SKILL.md` — when and how to run `bitmagic judge`. * * The point the skill has to land is the discipline, not the mechanics: judge after milestones, * fix the findings, confirm once, stop. An agent that loops on the judge is spending the * creator's sparks on reassurance. */ export declare function renderJudgeSkill(): string; /** * `GAME-DESIGN.md` — the project's design document, and the input `bitmagic cover` builds its * image prompt from. The web lane's Planning Mode writes a file of the same name for the same * purpose, so a creator moving between lanes finds the same thing where they expect it. * * Written once by `scaffoldProject` and creator-owned from then on: it is deliberately NOT in * PLATFORM_GENERATED_FILES, so `bitmagic upgrade` never overwrites the creator's design with this * skeleton. `bitmagic init --idea` seeds the Pitch; without it the headings stand empty and the * line under the title says who fills them in. * * The headings are the ones a cover prompt can actually use — what the world looks like matters * more to an image model than how the input mapping works — but nothing enforces them: the whole * file is read as prose. */ export declare function renderGameDesignMd(idea?: string, artStyle?: ArtStyle): string; export declare function renderClaudeMd(): string; export declare function renderThemingSkill(): string;