@vifu/vf 0.1.0-alpha.14-darwin-arm64

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.
Files changed (3) hide show
  1. package/README.md +173 -0
  2. package/bin/vf +0 -0
  3. package/package.json +23 -0
package/README.md ADDED
@@ -0,0 +1,173 @@
1
+ # VifuHub CLI
2
+
3
+ `vf` is the command-line tool for building, checking, and publishing playable
4
+ AI-native game releases to VifuHub.
5
+
6
+ ```bash
7
+ vf manifest check
8
+ vf build
9
+ vf deploy
10
+ ```
11
+
12
+ When run from a game directory, `vf deploy` resolves the local project,
13
+ validates `manifest.json`, builds the game, checks the Agent Runtime artifact,
14
+ uploads only when the artifact is valid, and prints the playable URL.
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ curl -fsSL https://vifu.ai/cli | bash
20
+ vf --help
21
+ ```
22
+
23
+ For repeated use inside one project:
24
+
25
+ ```bash
26
+ npm install --save-dev @vifu/vf
27
+ npx vf --help
28
+ ```
29
+
30
+ ## Agent Workflows
31
+
32
+ Install the VifuHub CLI skill separately from
33
+ [github.com/vifudotdev/skills](https://github.com/vifudotdev/skills):
34
+
35
+ ```bash
36
+ npx skills add vifudotdev/skills --skill "vifuhub-cli"
37
+ ```
38
+
39
+ Then a coding agent can start from the current directory:
40
+
41
+ ```text
42
+ Use the VifuHub CLI skill. Deploy this game directory and report the Playable URL.
43
+ ```
44
+
45
+ The skill tells agents to check `vf --help`, then use the one-step deploy path:
46
+
47
+ ```bash
48
+ vf deploy --yes
49
+ ```
50
+
51
+ `vf deploy --yes` creates missing setup from detected defaults, builds, checks
52
+ the output, uploads the valid artifact, and prints `Playable URL:` when sharing
53
+ succeeds. If authentication is missing, run:
54
+
55
+ ```bash
56
+ vf login
57
+ ```
58
+
59
+ Create a new project:
60
+
61
+ ```bash
62
+ npm create @vifu/vifu my-game -- --template vanilla --no-interactive
63
+ cd my-game
64
+ vf deploy --yes
65
+ ```
66
+
67
+ Deploy an existing project:
68
+
69
+ ```bash
70
+ cd path/to/game
71
+ vf deploy --yes
72
+ ```
73
+
74
+ You can also pass the project path explicitly:
75
+
76
+ ```bash
77
+ vf deploy ./path/to/game
78
+ ```
79
+
80
+ ## Manifest
81
+
82
+ Every deployable game has a public V1 `manifest.json`:
83
+
84
+ ```json
85
+ {
86
+ "name": "my-ai-game"
87
+ }
88
+ ```
89
+
90
+ VifuHub fills deployable defaults and infers common build settings from the
91
+ project. Add fields only when you need to override detection or disable an
92
+ Agent Runtime feature. Do not put internal runtime keys such as `runtime`,
93
+ `services`, `devices`, `resources`, `permissions`, `capabilities`, `browser`,
94
+ or `security` in public game manifests.
95
+
96
+ Useful commands:
97
+
98
+ ```bash
99
+ vf manifest check
100
+ vf manifest check --dir ./path/to/game
101
+ vf manifest explain
102
+ vf manifest explain --dir ./path/to/game --debug
103
+ ```
104
+
105
+ `manifest explain --debug` is for Agent Runtime development. It shows the
106
+ compiled internal policy that the runtime will enforce.
107
+
108
+ ## Release Policy
109
+
110
+ `vf deploy` and `vf publish` treat the built output as the reviewed Agent
111
+ Runtime artifact. The CLI does not rewrite the game, download CDN scripts, or
112
+ create a deploy lockfile.
113
+
114
+ Allowed:
115
+
116
+ - bundled game JavaScript
117
+ - local build output from Vite, Angular, Phaser, Three.js, Pixi, plain HTML, or
118
+ another web build tool
119
+ - approved external static CSS, fonts, images, and media
120
+ - AI/backend access through `@vifu/hub` or `window.Vifu`
121
+
122
+ Blocked:
123
+
124
+ - remote `<script src="https://...">`
125
+ - remote JavaScript `import("https://...")`
126
+ - remote workers or `importScripts(...)`
127
+ - remote `.js`, `.mjs`, or `.wasm` URLs inside built files
128
+ - direct calls to external AI/backend APIs from game JavaScript
129
+
130
+ If deploy fails, read the file, line, rule, URL, and fix shown by the CLI. The
131
+ most common cause is an optional local or third-party provider being statically
132
+ imported into a production browser bundle.
133
+
134
+ The canonical policy is [.spec/runtime-artifact-policy.md](../../.spec/runtime-artifact-policy.md).
135
+
136
+ ## SDK Integration
137
+
138
+ Games should call Agent Runtime capabilities through the VifuHub SDK:
139
+
140
+ ```js
141
+ const result = await Vifu.ai.generateText({
142
+ model: "quality",
143
+ messages: [{ role: "user", content: "Describe the next room." }]
144
+ });
145
+
146
+ await Vifu.gameState.save({ reason: "checkpoint" });
147
+ ```
148
+
149
+ The SDK keeps runtime transport, host authentication, model routing, quota,
150
+ and backend URLs out of game code. See
151
+ [packages/sdk/README.md](../../packages/sdk/README.md).
152
+
153
+ ## Existing Games
154
+
155
+ To adapt an existing browser game:
156
+
157
+ 1. Add `manifest.json`.
158
+ 2. Start with only `name`; let VifuHub infer common entry and build settings.
159
+ 3. Build a static directory with `index.html`.
160
+ 4. Replace direct AI/backend calls with the VifuHub SDK.
161
+ 5. Remove unused remote/local AI providers from the published build.
162
+ 6. Run `vf deploy`.
163
+
164
+ Extra source workflows live under explicit commands:
165
+
166
+ ```bash
167
+ vf remix my-remix --from ./existing-game
168
+ vf import anki jlpt-review --apkg ./deck.apkg
169
+ vf import podcast listening-game --feed-url https://example.com/feed.xml
170
+ ```
171
+
172
+ `vf create` and `vf new` are intentionally not exposed. Use
173
+ `npm create @vifu/vifu` for new template projects.
package/bin/vf ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@vifu/vf",
3
+ "version": "0.1.0-alpha.14-darwin-arm64",
4
+ "description": "Native VifuHub CLI binary for darwin-arm64.",
5
+ "files": [
6
+ "bin",
7
+ "README.md"
8
+ ],
9
+ "os": [
10
+ "darwin"
11
+ ],
12
+ "cpu": [
13
+ "arm64"
14
+ ],
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/chenyanming/nekodoku.git",
18
+ "directory": "Consenger/apps/cli"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ }
23
+ }