@air-jam/cli 0.0.0-stage → 0.9.3
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/LICENSE +21 -0
- package/README.md +145 -2
- package/bin/airjam.mjs +66 -0
- package/dist/ai-pack.d.ts +44 -0
- package/dist/ai-pack.js +15 -0
- package/dist/ai-pack.js.map +1 -0
- package/dist/chunk-A4V2N4LX.js +938 -0
- package/dist/chunk-A4V2N4LX.js.map +1 -0
- package/dist/chunk-J5MAU4QZ.js +102 -0
- package/dist/chunk-J5MAU4QZ.js.map +1 -0
- package/dist/chunk-N7AI7HZK.js +529 -0
- package/dist/chunk-N7AI7HZK.js.map +1 -0
- package/dist/development.d.ts +98 -0
- package/dist/development.js +33 -0
- package/dist/development.js.map +1 -0
- package/dist/documentation.d.ts +27 -0
- package/dist/documentation.js +7 -0
- package/dist/documentation.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2184 -0
- package/dist/index.js.map +1 -0
- package/dist/scaffold.d.ts +6 -0
- package/dist/scaffold.js +20 -0
- package/dist/scaffold.js.map +1 -0
- package/package.json +78 -3
- package/runtime/local-network.d.mts +8 -0
- package/runtime/local-network.mjs +9 -0
- package/runtime/vite-config.d.mts +42 -0
- package/runtime/vite-config.mjs +130 -0
- package/runtime/vite-https.d.mts +11 -0
- package/runtime/vite-https.mjs +41 -0
- package/template-assets/bootstrap/.claude/launch.json +12 -0
- package/template-assets/bootstrap/AGENTS.md +248 -0
- package/template-assets/bootstrap/CLAUDE.md +63 -0
- package/template-assets/bootstrap/_gitignore +6 -0
- package/template-assets/bootstrap/skills/airjam-docs-workflow/SKILL.md +49 -0
- package/template-assets/bootstrap/skills/airjam-mcp/SKILL.md +56 -0
- package/template-assets/bootstrap/skills/canvas-2d-gameplay/SKILL.md +47 -0
- package/template-assets/bootstrap/skills/controller-ui/SKILL.md +69 -0
- package/template-assets/bootstrap/skills/debug-and-test/SKILL.md +72 -0
- package/template-assets/bootstrap/skills/game-architecture/SKILL.md +58 -0
- package/template-assets/bootstrap/skills/game-state-and-rendering/SKILL.md +44 -0
- package/template-assets/bootstrap/skills/host-surface/SKILL.md +52 -0
- package/template-assets/bootstrap/skills/index.md +36 -0
- package/template-assets/bootstrap/skills/prefab-authoring/SKILL.md +48 -0
- package/template-assets/bootstrap/skills/r3f-3d-scene/SKILL.md +51 -0
- package/template-assets/documentation/for-agents/controller-ui/page.mdx +60 -0
- package/template-assets/documentation/for-agents/page.mdx +98 -0
- package/template-assets/documentation/for-agents/project-structure/page.mdx +172 -0
- package/template-assets/documentation/for-agents/state-and-rendering/page.mdx +79 -0
- package/template-assets/documentation/getting-started/debugging/page.mdx +165 -0
- package/template-assets/documentation/getting-started/dev-logs/page.mdx +171 -0
- package/template-assets/documentation/getting-started/game-ideas/page.mdx +116 -0
- package/template-assets/documentation/getting-started/introduction/page.mdx +183 -0
- package/template-assets/documentation/getting-started/migrating-legacy-games/page.mdx +427 -0
- package/template-assets/documentation/getting-started/quick-start/page.mdx +333 -0
- package/template-assets/documentation/how-it-works/architecture/page.mdx +189 -0
- package/template-assets/documentation/how-it-works/host-system/page.mdx +267 -0
- package/template-assets/documentation/manifest.json +430 -0
- package/template-assets/documentation/sdk/hooks/page.mdx +500 -0
- package/template-assets/documentation/sdk/input-system/page.mdx +270 -0
- package/template-assets/documentation/sdk/networked-state/page.mdx +213 -0
- package/template-assets/documentation/sdk/ui-components/page.mdx +227 -0
- package/template-assets/managed/.airjam/ai-pack.json +191 -0
- package/template-assets/managed/docs/airjam/agent-gold-path.md +67 -0
- package/template-assets/managed/docs/airjam/agent-mcp.md +135 -0
- package/template-assets/managed/docs/airjam/canvas-2d-gameplay.md +82 -0
- package/template-assets/managed/docs/airjam/composition-shell-contract.md +87 -0
- package/template-assets/managed/docs/airjam/debug-and-testing.md +86 -0
- package/template-assets/managed/docs/airjam/development-loop.md +51 -0
- package/template-assets/managed/docs/airjam/docs-index.md +58 -0
- package/template-assets/managed/docs/airjam/generated/architecture.md +178 -0
- package/template-assets/managed/docs/airjam/generated/controller-ui.md +61 -0
- package/template-assets/managed/docs/airjam/generated/debugging-and-logs.md +164 -0
- package/template-assets/managed/docs/airjam/generated/for-agents.md +99 -0
- package/template-assets/managed/docs/airjam/generated/game-ideas.md +107 -0
- package/template-assets/managed/docs/airjam/generated/host-system.md +251 -0
- package/template-assets/managed/docs/airjam/generated/input-system.md +260 -0
- package/template-assets/managed/docs/airjam/generated/introduction.md +175 -0
- package/template-assets/managed/docs/airjam/generated/migrating-legacy-games.md +426 -0
- package/template-assets/managed/docs/airjam/generated/networked-state.md +214 -0
- package/template-assets/managed/docs/airjam/generated/project-structure.md +171 -0
- package/template-assets/managed/docs/airjam/generated/quick-start.md +334 -0
- package/template-assets/managed/docs/airjam/generated/sdk-hooks.md +490 -0
- package/template-assets/managed/docs/airjam/generated/state-and-rendering.md +80 -0
- package/template-assets/managed/docs/airjam/generated/ui-components.md +222 -0
- package/template-assets/managed/docs/airjam/generated/unified-dev-logs.md +170 -0
- package/template-assets/managed/docs/airjam/iconography.md +55 -0
- package/template-assets/managed/docs/airjam/prefab-authoring.md +112 -0
- package/template-assets/managed/docs/airjam/preview-controllers.md +126 -0
- package/template-assets/managed/docs/airjam/r3f-3d-scene.md +97 -0
- package/template-assets/managed/docs/airjam/state-lanes-cookbook.md +106 -0
- package/template-assets/managed/docs/airjam/visual-system.md +103 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Air Jam contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,146 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@air-jam/cli`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The canonical project and operator CLI for Air Jam.
|
|
4
|
+
|
|
5
|
+
`create-airjam` only creates a project. The generated project then depends on
|
|
6
|
+
this package for its complete ongoing lifecycle: development, inspection,
|
|
7
|
+
semantic game control, AI-pack maintenance, MCP setup, hosted game records,
|
|
8
|
+
and releases.
|
|
9
|
+
|
|
10
|
+
## Discover the contract
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm exec airjam --help
|
|
14
|
+
pnpm exec airjam session --help
|
|
15
|
+
pnpm exec airjam mcp --help
|
|
16
|
+
pnpm exec airjam release --help
|
|
17
|
+
pnpm exec airjam docs --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Machine-first local lifecycle
|
|
21
|
+
|
|
22
|
+
These commands return stable JSON documents and are safe for terminal agents
|
|
23
|
+
to compose:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pnpm exec airjam status --dir .
|
|
27
|
+
pnpm exec airjam evaluate --dir .
|
|
28
|
+
pnpm exec airjam dev start --dir .
|
|
29
|
+
pnpm exec airjam session open --dir .
|
|
30
|
+
pnpm exec airjam session read <session-id> --dir .
|
|
31
|
+
pnpm exec airjam session invoke <session-id> <action-id> --payload '{}'
|
|
32
|
+
pnpm exec airjam session capture <session-id> --dir .
|
|
33
|
+
pnpm exec airjam session close <session-id> --dir .
|
|
34
|
+
pnpm exec airjam dev stop --dir .
|
|
35
|
+
pnpm exec airjam reset local --dir .
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`airjam evaluate` is the canonical complete evaluation contract. It runs
|
|
39
|
+
typecheck, lint, tests, and the production build, then returns every gate in one
|
|
40
|
+
stable `air-jam-complete-evaluation/v1` JSON document. The MCP equivalent is
|
|
41
|
+
`airjam.evaluate`; use individual quality gates only to narrow a failure.
|
|
42
|
+
|
|
43
|
+
A semantic session starts or reuses the canonical Air Jam dev process, opens a
|
|
44
|
+
real controller/runtime connection, exposes the game's published semantic
|
|
45
|
+
actions and authoritative snapshot, and releases processes it created when the
|
|
46
|
+
last session closes. The project-local broker is authenticated, loopback-only,
|
|
47
|
+
and can capture canonical desktop-host and phone-controller screenshots into
|
|
48
|
+
the owning project's `.airjam/artifacts/session-visuals` directory. It can be
|
|
49
|
+
inspected or stopped explicitly:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pnpm exec airjam session broker status --dir .
|
|
53
|
+
pnpm exec airjam session broker stop --dir .
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Agent clients
|
|
57
|
+
|
|
58
|
+
The Air Jam MCP exposes the same underlying project, development, semantic
|
|
59
|
+
session, quality, and release services to Codex, Claude, and other MCP clients.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pnpm exec airjam mcp doctor --dir . --json
|
|
63
|
+
pnpm exec airjam mcp init --dir .
|
|
64
|
+
pnpm exec airjam mcp config --profile portable --dir .
|
|
65
|
+
pnpm exec airjam mcp config --profile codex --dir .
|
|
66
|
+
pnpm exec airjam mcp config --profile claude-desktop --dir .
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The portable declaration is `.mcp.json`. Codex and Claude Desktop use their
|
|
70
|
+
own client registration formats; `mcp doctor` reports declarations and actual
|
|
71
|
+
client registrations separately.
|
|
72
|
+
|
|
73
|
+
The Claude Desktop profile targets the selected game's absolute directory.
|
|
74
|
+
Merge its `airjam` entry into Desktop's configuration through **Settings >
|
|
75
|
+
Developer > Edit config**, preserving other connectors, then restart Desktop
|
|
76
|
+
and check its connection status. Rendering a profile does not register it;
|
|
77
|
+
`claude mcp add` is a Claude Code command, not a Desktop installer. See the
|
|
78
|
+
[`@air-jam/mcp-server` setup guide](https://github.com/vucinatim/air-jam/tree/main/packages/mcp-server#discover-and-connect) for details.
|
|
79
|
+
|
|
80
|
+
## Platform machine authentication
|
|
81
|
+
|
|
82
|
+
CLI and MCP platform operations share one authentication transport. A saved
|
|
83
|
+
login is bound to the platform origin that issued it: changing the platform URL
|
|
84
|
+
cannot silently send that saved token to another server. Log in to the other
|
|
85
|
+
platform, or deliberately supply its own explicit token and target instead.
|
|
86
|
+
Equivalent host casing, default ports, and trailing slashes do not change the
|
|
87
|
+
origin. Self-hosted HTTPS targets are supported; HTTP is limited to loopback
|
|
88
|
+
development addresses.
|
|
89
|
+
|
|
90
|
+
Invalid target URLs fail rather than falling back to localhost. API paths stay
|
|
91
|
+
on the selected origin, and redirects are rejected rather than replaying
|
|
92
|
+
tokens or device codes elsewhere. Device login stores the requested platform
|
|
93
|
+
only after the response confirms the same origin. This destination boundary
|
|
94
|
+
does not change token scopes, expiry, or server-side ownership checks.
|
|
95
|
+
|
|
96
|
+
## Framework guidance ownership
|
|
97
|
+
|
|
98
|
+
The CLI owns the canonical managed framework pack under `docs/airjam/`.
|
|
99
|
+
Project instructions (`AGENTS.md`, `CLAUDE.md`, and `skills/`) are copied only
|
|
100
|
+
during bootstrap and belong to the project afterward.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pnpm exec airjam ai-pack status --dir . --json
|
|
104
|
+
pnpm exec airjam ai-pack diff --dir . --json
|
|
105
|
+
pnpm exec airjam ai-pack update --dir . --json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
AI-pack updates replace managed framework guidance only. They never overwrite
|
|
109
|
+
project-owned agent instructions or skills.
|
|
110
|
+
|
|
111
|
+
## Programmatic assets
|
|
112
|
+
|
|
113
|
+
The installed package includes all public creator pages and their portable
|
|
114
|
+
metadata. Read them without an account, network request or source checkout:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pnpm exec airjam docs list --json
|
|
118
|
+
pnpm exec airjam docs read sdk/ui-components --json
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`readDocumentationSnapshot()` from `@air-jam/cli/documentation` returns the
|
|
122
|
+
package version and verified MDX content, page identities and navigation
|
|
123
|
+
metadata. Content and metadata originate in the public repository's
|
|
124
|
+
`content/docs/` catalog. The private website supplies rendering components and
|
|
125
|
+
generates its build inputs from this snapshot; it does not maintain a second
|
|
126
|
+
authored copy. MDX component names are presentation slots, not imports of private
|
|
127
|
+
application code. Only trusted package documentation is compiled this way,
|
|
128
|
+
never creator-uploaded MDX. The API reads do not write project files.
|
|
129
|
+
|
|
130
|
+
Scaffolding code can resolve the two explicit asset roots and portable MCP
|
|
131
|
+
declaration through `@air-jam/cli/scaffold`. Vite projects use
|
|
132
|
+
`@air-jam/cli/vite-config`.
|
|
133
|
+
|
|
134
|
+
Repository-owned development orchestration can use the typed
|
|
135
|
+
`@air-jam/cli/development` entrypoint for local network discovery, environment
|
|
136
|
+
loading, runtime topology construction and secure-development state. It shares
|
|
137
|
+
the CLI implementation; consumers do not import files inside its source tree.
|
|
138
|
+
Reading state or constructing a topology does not initialize certificates or
|
|
139
|
+
change tunnel configuration. `runSecureInitCli()` is the explicit setup action,
|
|
140
|
+
with the same arguments and effects as `airjam secure:init`.
|
|
141
|
+
|
|
142
|
+
`readAiPackSnapshot()` from `@air-jam/cli/ai-pack` returns the verified
|
|
143
|
+
packaged manifest and a `Map<string, Buffer>` of managed file contents. Consumers
|
|
144
|
+
can serve that exact snapshot without a CLI source checkout, network request or
|
|
145
|
+
second pack generator. Invalid manifests, paths or content hashes fail the read;
|
|
146
|
+
it does not modify the package or a creator's project.
|
package/bin/airjam.mjs
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
|
+
|
|
8
|
+
const packageRoot = path.resolve(
|
|
9
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
10
|
+
"..",
|
|
11
|
+
);
|
|
12
|
+
const distEntry = path.join(packageRoot, "dist", "index.js");
|
|
13
|
+
const repoRoot = path.resolve(packageRoot, "../..");
|
|
14
|
+
const workspaceBuildScript = path.join(
|
|
15
|
+
repoRoot,
|
|
16
|
+
"scripts",
|
|
17
|
+
"ensure-workspace-package-build.mjs",
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const buildWorkspacePackage = async () => {
|
|
21
|
+
if (!existsSync(workspaceBuildScript)) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
"The installed @air-jam/cli package is missing its built CLI entrypoint.",
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
await new Promise((resolve, reject) => {
|
|
28
|
+
const child = spawn(
|
|
29
|
+
process.execPath,
|
|
30
|
+
[workspaceBuildScript, "@air-jam/cli"],
|
|
31
|
+
{
|
|
32
|
+
cwd: repoRoot,
|
|
33
|
+
stdio: "inherit",
|
|
34
|
+
env: process.env,
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
child.on("exit", (code, signal) => {
|
|
39
|
+
if (code === 0) {
|
|
40
|
+
resolve(undefined);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
reject(
|
|
45
|
+
new Error(
|
|
46
|
+
signal
|
|
47
|
+
? `Workspace CLI build terminated by signal ${signal}.`
|
|
48
|
+
: `Workspace CLI build exited with code ${code}.`,
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
child.on("error", reject);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
if (!existsSync(distEntry)) {
|
|
57
|
+
await buildWorkspacePackage();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!existsSync(distEntry)) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
"The @air-jam/cli build completed without producing dist/index.js.",
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
await import(pathToFileURL(distEntry).href);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
type AiPackFile = {
|
|
2
|
+
path: string;
|
|
3
|
+
kind: "docs-local" | "docs-generated";
|
|
4
|
+
size: number;
|
|
5
|
+
sha256: string;
|
|
6
|
+
};
|
|
7
|
+
type AiPackManifest = {
|
|
8
|
+
schemaVersion: 2;
|
|
9
|
+
packVersion: string;
|
|
10
|
+
channel: "stable" | "canary";
|
|
11
|
+
releaseDate: string;
|
|
12
|
+
source: {
|
|
13
|
+
mode: "packaged-snapshot";
|
|
14
|
+
package: "@air-jam/cli";
|
|
15
|
+
};
|
|
16
|
+
scaffold: {
|
|
17
|
+
template: string | null;
|
|
18
|
+
createAirjamVersion: string | null;
|
|
19
|
+
};
|
|
20
|
+
managedFiles: AiPackFile[];
|
|
21
|
+
contentDigest: string;
|
|
22
|
+
};
|
|
23
|
+
declare const readAiPackSnapshot: () => Promise<{
|
|
24
|
+
manifest: AiPackManifest;
|
|
25
|
+
contents: Map<string, Buffer<ArrayBufferLike>>;
|
|
26
|
+
}>;
|
|
27
|
+
declare function runAiPackStatus({ dir, json, }: {
|
|
28
|
+
dir?: string;
|
|
29
|
+
json?: boolean;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
declare function runAiPackDiff({ dir, json, }: {
|
|
32
|
+
dir?: string;
|
|
33
|
+
json?: boolean;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
declare function runAiPackUpdate({ dir, json, }: {
|
|
36
|
+
dir?: string;
|
|
37
|
+
json?: boolean;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
declare function runAiPackRepair({ dir, json, }: {
|
|
40
|
+
dir?: string;
|
|
41
|
+
json?: boolean;
|
|
42
|
+
}): Promise<void>;
|
|
43
|
+
|
|
44
|
+
export { readAiPackSnapshot, runAiPackDiff, runAiPackRepair, runAiPackStatus, runAiPackUpdate };
|
package/dist/ai-pack.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readAiPackSnapshot,
|
|
3
|
+
runAiPackDiff,
|
|
4
|
+
runAiPackRepair,
|
|
5
|
+
runAiPackStatus,
|
|
6
|
+
runAiPackUpdate
|
|
7
|
+
} from "./chunk-N7AI7HZK.js";
|
|
8
|
+
export {
|
|
9
|
+
readAiPackSnapshot,
|
|
10
|
+
runAiPackDiff,
|
|
11
|
+
runAiPackRepair,
|
|
12
|
+
runAiPackStatus,
|
|
13
|
+
runAiPackUpdate
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=ai-pack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|