@mpgd/cli 0.14.0 → 0.15.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/index.js +137 -8
- package/dist/microsoft-store-starter.d.ts +28 -0
- package/dist/microsoft-store-starter.js +655 -0
- package/dist/production-target-readiness.js +3 -1
- package/package.json +8 -8
- package/templates/phaser-game/.agents/skills/release-microsoft-store/SKILL.md +60 -0
- package/templates/phaser-game/.agents/skills/release-microsoft-store/agents/openai.yaml +4 -0
- package/templates/phaser-game/.agents/skills/use-mpgd-kit/SKILL.md +45 -0
- package/templates/phaser-game/.agents/skills/use-mpgd-kit/agents/openai.yaml +4 -0
- package/templates/phaser-game/AGENTS.md +34 -0
- package/templates/phaser-game/README.md +50 -25
- package/templates/phaser-game/agent/acceptance.md +8 -0
- package/templates/phaser-game/agent/brief.md +13 -1
- package/templates/phaser-game/agent/game-manifest.json +7 -0
- package/templates/phaser-game/apps/target-ait/granite.config.ts +35 -0
- package/templates/phaser-game/apps/target-ait/index.html +15 -0
- package/templates/phaser-game/apps/target-ait/package.json +33 -0
- package/templates/phaser-game/apps/target-ait/src/main.ts +34 -0
- package/templates/phaser-game/apps/target-ait/src/styles.css +33 -0
- package/templates/phaser-game/apps/target-ait/tsconfig.json +8 -0
- package/templates/phaser-game/apps/target-ait/vite.config.ts +53 -0
- package/templates/phaser-game/docs/MPGD_KIT_WORKFLOWS.md +128 -0
- package/templates/phaser-game/gitignore +6 -0
- package/templates/phaser-game/mpgd.targets.json +9 -2
- package/templates/phaser-game/package.json +10 -10
- package/templates/phaser-game/vite.shared.ts +13 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# mpgd-kit workflows
|
|
2
|
+
|
|
3
|
+
This guide is the capability map for this generated game. Start with
|
|
4
|
+
`agent/game-manifest.json`: configured targets are available now; `futureTargets`
|
|
5
|
+
are design directions, not implemented release paths.
|
|
6
|
+
|
|
7
|
+
## Core boundaries
|
|
8
|
+
|
|
9
|
+
| Concern | Owner |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Deterministic rules and state | `src/game` and simulation modules |
|
|
12
|
+
| Rendering and input | `src/scenes` |
|
|
13
|
+
| Platform selection and services | `src/platform` through `PlatformGateway` |
|
|
14
|
+
| Target build ownership | `mpgd.targets.json` |
|
|
15
|
+
| Runtime/effective configuration | `@mpgd/target-config` and target config files |
|
|
16
|
+
| Agent capability and acceptance contract | `agent/` |
|
|
17
|
+
|
|
18
|
+
Do not import platform SDKs into scenes or pure game logic. Add a capability to
|
|
19
|
+
`PlatformGateway`, implement it behind an adapter or wrapper, and provide a
|
|
20
|
+
capability-disabled fallback where the target cannot support it.
|
|
21
|
+
|
|
22
|
+
## Shared game capabilities
|
|
23
|
+
|
|
24
|
+
### Assets and icons
|
|
25
|
+
|
|
26
|
+
- Keep Phaser-loadable assets in the game-owned asset manifest.
|
|
27
|
+
- Replace starter icons, then run `pnpm icons:generate`, `pnpm icons:verify`,
|
|
28
|
+
and optionally `pnpm icons:inspect`.
|
|
29
|
+
- Use target icon profiles from `mpgd.targets.json`; do not maintain unrelated
|
|
30
|
+
hand-copied icon sets.
|
|
31
|
+
|
|
32
|
+
### Localization and orientation
|
|
33
|
+
|
|
34
|
+
- Add game text through the generated i18n messages and resolve locale from the
|
|
35
|
+
effective target configuration.
|
|
36
|
+
- Choose a responsive, preferred, or soft-lock orientation policy before
|
|
37
|
+
building resize and rotate-prompt behavior. Keep the installed web manifest
|
|
38
|
+
orientation aligned with the runtime policy.
|
|
39
|
+
|
|
40
|
+
### Analytics, saves, commerce, ads, and leaderboards
|
|
41
|
+
|
|
42
|
+
- Emit best-effort analytics through `@mpgd/analytics`; never depend on a debug
|
|
43
|
+
or analytics side effect for game correctness.
|
|
44
|
+
- Route identity, saves, lifecycle, host presentation, commerce, ads, and
|
|
45
|
+
leaderboards through `PlatformGateway`.
|
|
46
|
+
- Use `@mpgd/game-services` and a game-owned backend for purchase ledgers,
|
|
47
|
+
rewarded-ad grants, entitlements, and verified leaderboard records. Client
|
|
48
|
+
success callbacks are requests or pending evidence, never grant authority.
|
|
49
|
+
|
|
50
|
+
## Build and acceptance loop
|
|
51
|
+
|
|
52
|
+
Use `MPGD_KIT_PATH` or pass `--kit-path` to a nearby kit checkout.
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
pnpm check
|
|
56
|
+
pnpm build
|
|
57
|
+
pnpm icons:verify
|
|
58
|
+
pnpm exec mpgd target doctor --targets-file ./mpgd.targets.json --kit-path ../mpgd-kit --targets default
|
|
59
|
+
pnpm exec mpgd target build-all --targets-file ./mpgd.targets.json --kit-path ../mpgd-kit --targets default --profile staging --ait-variant wrapper
|
|
60
|
+
pnpm exec mpgd target smoke-all --targets-file ./mpgd.targets.json --kit-path ../mpgd-kit --targets default
|
|
61
|
+
pnpm accept
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`pnpm accept` records checks, build, graph preflight, optional browser playtest,
|
|
65
|
+
target build/smoke, and optional gameplay E2E results under
|
|
66
|
+
`artifacts/acceptance`. Add a game-owned `playtest` or `gameplay:e2e` driver
|
|
67
|
+
when the release needs stronger browser or state-path evidence.
|
|
68
|
+
|
|
69
|
+
## Target routing
|
|
70
|
+
|
|
71
|
+
### Browser preview
|
|
72
|
+
|
|
73
|
+
Use the browser adapter for local and hosted web behavior. Verify installed-PWA
|
|
74
|
+
updates without forcing service-worker activation while old windows remain
|
|
75
|
+
open.
|
|
76
|
+
|
|
77
|
+
### Microsoft Store
|
|
78
|
+
|
|
79
|
+
This target is optional. Enable it in an existing generated game with:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
pnpm exec mpgd target init microsoft-store --game . --kit-path ../mpgd-kit
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The initializer adds the target, scripts, PWA runtime hook, Store config, and
|
|
86
|
+
`.agents/skills/release-microsoft-store/SKILL.md` without overwriting conflicts.
|
|
87
|
+
Use that skill for the complete release and evidence sequence.
|
|
88
|
+
|
|
89
|
+
### Verse8
|
|
90
|
+
|
|
91
|
+
Build through the Verse8 adapter. Keep host credentials and authenticated cloud
|
|
92
|
+
state behind target services. Treat client commerce as pending; authoritative
|
|
93
|
+
grants belong in a game-owned Agent8 server purchase event with consume-once
|
|
94
|
+
catalog handling and verified completion logic for leaderboards.
|
|
95
|
+
|
|
96
|
+
### Apps in Toss
|
|
97
|
+
|
|
98
|
+
Use official Apps in Toss documentation/MCP before SDK or review-flow changes.
|
|
99
|
+
Keep SDK imports in the wrapper/adapter, declare permission-gated Web APIs in
|
|
100
|
+
the game-owned config, and create a game-owned production wrapper instead of
|
|
101
|
+
shipping the kit reference wrapper.
|
|
102
|
+
|
|
103
|
+
### Reddit Devvit
|
|
104
|
+
|
|
105
|
+
Keep the app in `apps/target-devvit`, use official Devvit documentation/MCP,
|
|
106
|
+
and keep SDK calls behind the adapter or wrapper. Preserve separate lightweight
|
|
107
|
+
inline and expanded game modes, avoid trapping feed scroll, and validate login,
|
|
108
|
+
init, upload, and playtest with the generated scripts.
|
|
109
|
+
|
|
110
|
+
### Android and iOS
|
|
111
|
+
|
|
112
|
+
Use a game-owned Capacitor shell for production. Keep native plugin imports in
|
|
113
|
+
the shell, adapters, or native plugins; configure signing outside source
|
|
114
|
+
control. Validate the web game and effective target config before native store
|
|
115
|
+
packaging.
|
|
116
|
+
|
|
117
|
+
### Future targets
|
|
118
|
+
|
|
119
|
+
For Telegram, Tauri, or another platform, first add a target-config entry and
|
|
120
|
+
adapter behind `PlatformGateway`, then add build, smoke, agent manifest, and
|
|
121
|
+
acceptance coverage. Do not let a new SDK leak into existing game logic.
|
|
122
|
+
|
|
123
|
+
## Handoff evidence
|
|
124
|
+
|
|
125
|
+
Keep source revision, config, build/smoke results, gameplay evidence, target
|
|
126
|
+
preflight, artifact hashes, and target acceptance reports together. A generic
|
|
127
|
+
kit smoke test proves the reusable contract only; it does not replace
|
|
128
|
+
game-owned production credentials, deployment, signing, or store evidence.
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
node_modules/
|
|
2
2
|
dist/
|
|
3
3
|
apps/*/dist/
|
|
4
|
+
apps/target-ait/.ait_relay
|
|
5
|
+
apps/target-ait/.ait_urls
|
|
6
|
+
apps/target-ait/.granite/
|
|
7
|
+
apps/target-ait/generated/
|
|
8
|
+
apps/target-ait/public/assets/
|
|
9
|
+
apps/target-ait/public/game/
|
|
4
10
|
apps/target-devvit/generated/
|
|
5
11
|
artifacts/
|
|
6
12
|
release-input/
|
|
@@ -42,10 +42,17 @@
|
|
|
42
42
|
"ait": {
|
|
43
43
|
"kind": "apps-in-toss",
|
|
44
44
|
"gameApp": ".",
|
|
45
|
-
"wrapperApp": "
|
|
45
|
+
"wrapperApp": "apps/target-ait",
|
|
46
46
|
"adapter": "ait",
|
|
47
|
+
"authoritativeGameServices": false,
|
|
48
|
+
"metadata": {
|
|
49
|
+
"appName": "__GAME_NAME__",
|
|
50
|
+
"displayName": "__GAME_TITLE__",
|
|
51
|
+
"primaryColor": "#101820",
|
|
52
|
+
"sdkMajor": 2
|
|
53
|
+
},
|
|
47
54
|
"icon": { "profile": "ait" },
|
|
48
|
-
"webDir": "
|
|
55
|
+
"webDir": "apps/target-ait/public/game",
|
|
49
56
|
"artifact": ".ait"
|
|
50
57
|
},
|
|
51
58
|
"reddit": {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "__WORKSPACE_I18N_BUILD_PREFIX__vite --host 0.0.0.0",
|
|
9
|
-
"dev:ait": "APP_TARGET=ait APP_VERSION=0.0.0-dev BUILD_ID=ait-sandbox sh -c '__WORKSPACE_I18N_BUILD_PREFIX__vite --host 0.0.0.0'",
|
|
9
|
+
"dev:ait": "APP_TARGET=ait MPGD_CONFIG_TARGET=ait MPGD_PLATFORM_TARGETS_FILE=./mpgd.targets.json APP_VERSION=0.0.0-dev BUILD_ID=ait-sandbox sh -c '__WORKSPACE_I18N_BUILD_PREFIX__vite --host 0.0.0.0'",
|
|
10
10
|
"build": "__WORKSPACE_I18N_BUILD_PREFIX__vite build",
|
|
11
11
|
"accept": "node ./tools/run-game-acceptance.mjs",
|
|
12
12
|
"icons:generate": "pnpm exec mpgd game icons generate . --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
|
|
@@ -17,20 +17,20 @@
|
|
|
17
17
|
"build:ait": "pnpm exec mpgd target build ait staging --variant wrapper --targets-file ./mpgd.targets.json --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
|
|
18
18
|
"build:ait:package": "pnpm exec mpgd target build ait production --targets-file ./mpgd.targets.json --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
|
|
19
19
|
"smoke:ait": "pnpm exec mpgd target smoke ait --targets-file ./mpgd.targets.json --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
|
|
20
|
-
"ait:wrapper:dev": "pnpm --dir
|
|
21
|
-
"ait:wrapper:dev:plain": "pnpm --dir
|
|
22
|
-
"ait:wrapper:dev:phone": "pnpm --dir
|
|
23
|
-
"ait:devtools:mcp": "pnpm --dir
|
|
24
|
-
"ait:devtools:mcp:mobile": "pnpm --dir
|
|
20
|
+
"ait:wrapper:dev": "pnpm --dir apps/target-ait run dev",
|
|
21
|
+
"ait:wrapper:dev:plain": "pnpm --dir apps/target-ait run dev:plain",
|
|
22
|
+
"ait:wrapper:dev:phone": "pnpm --dir apps/target-ait run dev:phone",
|
|
23
|
+
"ait:devtools:mcp": "pnpm --dir apps/target-ait run devtools:mcp",
|
|
24
|
+
"ait:devtools:mcp:mobile": "pnpm --dir apps/target-ait run devtools:mcp:mobile",
|
|
25
25
|
"ait:console:login": "aitcc login",
|
|
26
26
|
"ait:console:whoami": "aitcc whoami",
|
|
27
27
|
"ait:console:init": "aitcc app init",
|
|
28
28
|
"ait:console:register": "aitcc app register",
|
|
29
29
|
"ait:console:status": "aitcc app status",
|
|
30
30
|
"ait:console:deploy": "aitcc app deploy",
|
|
31
|
-
"build:microsoft-store": "pnpm exec mpgd target build microsoft-store production --targets-file ./mpgd.targets.json --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
|
|
32
|
-
"smoke:microsoft-store": "pnpm exec mpgd target smoke microsoft-store --targets-file ./mpgd.targets.json --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
|
|
33
|
-
"preflight:microsoft-store": "pnpm exec mpgd target preflight microsoft-store --targets-file ./mpgd.targets.json --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
|
|
31
|
+
"build:microsoft-store": "pnpm exec mpgd target build microsoft-store production --targets-file ./mpgd.targets.json --kit-path \"${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}\"",
|
|
32
|
+
"smoke:microsoft-store": "pnpm exec mpgd target smoke microsoft-store --targets-file ./mpgd.targets.json --kit-path \"${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}\"",
|
|
33
|
+
"preflight:microsoft-store": "pnpm exec mpgd target preflight microsoft-store --targets-file ./mpgd.targets.json --kit-path \"${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}\"",
|
|
34
34
|
"package:microsoft-store": "pnpm exec mpgd target generate-package microsoft-store --targets-file ./mpgd.targets.json",
|
|
35
35
|
"build:verse8": "pnpm exec mpgd target build verse8 production --targets-file ./mpgd.targets.json --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
|
|
36
36
|
"smoke:verse8": "pnpm exec mpgd target smoke verse8 --targets-file ./mpgd.targets.json --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@ait-co/polyfill": "^0.1.17",
|
|
61
|
-
"@apps-in-toss/web-framework": "^2.10.
|
|
61
|
+
"@apps-in-toss/web-framework": "^2.10.6",
|
|
62
62
|
"@mpgd/adapter-ait": "__MPGD_DEPENDENCY_VERSION_ADAPTER_AIT__",
|
|
63
63
|
"@mpgd/adapter-browser": "__MPGD_DEPENDENCY_VERSION_ADAPTER_BROWSER__",
|
|
64
64
|
"@mpgd/adapter-capacitor": "__MPGD_DEPENDENCY_VERSION_ADAPTER_CAPACITOR__",
|
|
@@ -7,6 +7,7 @@ import type { UserConfig } from 'vite';
|
|
|
7
7
|
interface RuntimePlatformTargetMetadata {
|
|
8
8
|
readonly kind: string;
|
|
9
9
|
readonly adapter: string;
|
|
10
|
+
readonly authoritativeGameServices?: boolean;
|
|
10
11
|
readonly integrations?: Record<string, unknown>;
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -174,9 +175,21 @@ function readRuntimePlatformTarget(
|
|
|
174
175
|
throw new Error(`Platform target ${configTarget} integrations must be an object.`);
|
|
175
176
|
}
|
|
176
177
|
|
|
178
|
+
if (
|
|
179
|
+
target.authoritativeGameServices !== undefined
|
|
180
|
+
&& typeof target.authoritativeGameServices !== 'boolean'
|
|
181
|
+
) {
|
|
182
|
+
throw new Error(
|
|
183
|
+
`Platform target ${configTarget} authoritativeGameServices must be a boolean.`,
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
177
187
|
return {
|
|
178
188
|
kind: target.kind,
|
|
179
189
|
adapter: target.adapter,
|
|
190
|
+
...(target.authoritativeGameServices === undefined
|
|
191
|
+
? {}
|
|
192
|
+
: { authoritativeGameServices: target.authoritativeGameServices }),
|
|
180
193
|
...(target.integrations === undefined ? {} : { integrations: target.integrations }),
|
|
181
194
|
};
|
|
182
195
|
}
|