@myvillage/cli 1.9.0 → 1.10.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/package.json +1 -1
- package/src/commands/create-game.js +119 -6
- package/src/commands/deploy.js +267 -19
- package/src/commands/game.js +712 -0
- package/src/index.js +78 -47
- package/src/utils/api.js +44 -0
- package/src/utils/templates.js +608 -2
package/src/index.js
CHANGED
|
@@ -53,16 +53,21 @@ import {
|
|
|
53
53
|
bizreqsStatusCommand,
|
|
54
54
|
bizreqsImportCommand,
|
|
55
55
|
} from './commands/bizreqs.js';
|
|
56
|
+
import {
|
|
57
|
+
gameUpdateCommand,
|
|
58
|
+
gameUploadThumbnailCommand,
|
|
59
|
+
gameUploadBannerCommand,
|
|
60
|
+
gameSubmitCommand,
|
|
61
|
+
gameMissionsInitCommand,
|
|
62
|
+
gameMissionsSyncCommand,
|
|
63
|
+
gameMissionsListCommand,
|
|
64
|
+
gameBundlesUploadCommand,
|
|
65
|
+
gameBundlesUploadDirCommand,
|
|
66
|
+
} from './commands/game.js';
|
|
56
67
|
import { checkinCommand } from './commands/checkin.js';
|
|
57
68
|
import { discoverCommand } from './commands/discover.js';
|
|
58
69
|
import { logCommand } from './commands/log.js';
|
|
59
70
|
import { storyCommand } from './commands/story.js';
|
|
60
|
-
import {
|
|
61
|
-
mediaDraftCreateCommand,
|
|
62
|
-
mediaDraftEditCommand,
|
|
63
|
-
mediaDraftListCommand,
|
|
64
|
-
mediaDraftStatusCommand,
|
|
65
|
-
} from './commands/media.js';
|
|
66
71
|
import {
|
|
67
72
|
soulprintInitCommand,
|
|
68
73
|
soulprintIngestCommand,
|
|
@@ -116,13 +121,79 @@ export function run() {
|
|
|
116
121
|
program
|
|
117
122
|
.command('deploy')
|
|
118
123
|
.description('Build and deploy your game to MyVillageOS')
|
|
119
|
-
.
|
|
124
|
+
.option('-p, --platform <platform>', 'Target platform (ios, android, webgl) — required for Unity games')
|
|
125
|
+
.action((options) => deployCommand(options));
|
|
120
126
|
|
|
121
127
|
program
|
|
122
128
|
.command('status')
|
|
123
129
|
.description('Check deployment status of your games')
|
|
124
130
|
.action(statusCommand);
|
|
125
131
|
|
|
132
|
+
// ── Game Management ────────────────────────────────
|
|
133
|
+
|
|
134
|
+
const gameCmd = program
|
|
135
|
+
.command('game')
|
|
136
|
+
.description('Manage your deployed games');
|
|
137
|
+
|
|
138
|
+
gameCmd
|
|
139
|
+
.command('update')
|
|
140
|
+
.description('Update game metadata (title, description, category, tags)')
|
|
141
|
+
.action(gameUpdateCommand);
|
|
142
|
+
|
|
143
|
+
gameCmd
|
|
144
|
+
.command('upload-thumbnail <file>')
|
|
145
|
+
.description('Upload or replace game thumbnail image')
|
|
146
|
+
.action(gameUploadThumbnailCommand);
|
|
147
|
+
|
|
148
|
+
gameCmd
|
|
149
|
+
.command('upload-banner <file>')
|
|
150
|
+
.description('Upload or replace game banner image')
|
|
151
|
+
.action(gameUploadBannerCommand);
|
|
152
|
+
|
|
153
|
+
gameCmd
|
|
154
|
+
.command('submit')
|
|
155
|
+
.description('Submit a DRAFT game for admin review')
|
|
156
|
+
.action(gameSubmitCommand);
|
|
157
|
+
|
|
158
|
+
// Game missions subcommands
|
|
159
|
+
const gameMissionsCmd = gameCmd
|
|
160
|
+
.command('missions')
|
|
161
|
+
.description('Manage game mission manifests');
|
|
162
|
+
|
|
163
|
+
gameMissionsCmd
|
|
164
|
+
.command('init')
|
|
165
|
+
.description('Create a manifest.json template')
|
|
166
|
+
.action(gameMissionsInitCommand);
|
|
167
|
+
|
|
168
|
+
gameMissionsCmd
|
|
169
|
+
.command('sync')
|
|
170
|
+
.description('Upload manifest.json to ed-platform')
|
|
171
|
+
.action(gameMissionsSyncCommand);
|
|
172
|
+
|
|
173
|
+
gameMissionsCmd
|
|
174
|
+
.command('list')
|
|
175
|
+
.description('List missions from the uploaded manifest')
|
|
176
|
+
.option('--json', 'Output raw JSON')
|
|
177
|
+
.action(gameMissionsListCommand);
|
|
178
|
+
|
|
179
|
+
// Game bundles subcommands
|
|
180
|
+
const gameBundlesCmd = gameCmd
|
|
181
|
+
.command('bundles')
|
|
182
|
+
.description('Manage game asset bundles');
|
|
183
|
+
|
|
184
|
+
gameBundlesCmd
|
|
185
|
+
.command('upload <file>')
|
|
186
|
+
.description('Upload a single bundle file')
|
|
187
|
+
.requiredOption('-p, --platform <platform>', 'Target platform (ios, android, webgl)')
|
|
188
|
+
.option('--bundle-name <name>', 'Bundle name (defaults to filename without extension)')
|
|
189
|
+
.action(gameBundlesUploadCommand);
|
|
190
|
+
|
|
191
|
+
gameBundlesCmd
|
|
192
|
+
.command('upload-dir <dir>')
|
|
193
|
+
.description('Upload all files in a directory as bundles')
|
|
194
|
+
.requiredOption('-p, --platform <platform>', 'Target platform (ios, android, webgl)')
|
|
195
|
+
.action(gameBundlesUploadDirCommand);
|
|
196
|
+
|
|
126
197
|
// ── Network: Feed ───────────────────────────────────
|
|
127
198
|
|
|
128
199
|
program
|
|
@@ -404,46 +475,6 @@ export function run() {
|
|
|
404
475
|
.option('--contact <name>', 'Contact name')
|
|
405
476
|
.action(bizreqsImportCommand);
|
|
406
477
|
|
|
407
|
-
// ── Media: Draft Submission Pipeline ──────────────────────
|
|
408
|
-
|
|
409
|
-
const mediaCmd = program
|
|
410
|
-
.command('media')
|
|
411
|
-
.description('Media draft submission and approval pipeline');
|
|
412
|
-
|
|
413
|
-
const mediaDraftCmd = mediaCmd
|
|
414
|
-
.command('draft')
|
|
415
|
-
.description('Create and manage social media drafts');
|
|
416
|
-
|
|
417
|
-
mediaDraftCmd
|
|
418
|
-
.command('create')
|
|
419
|
-
.description('Create a new media draft (interactive)')
|
|
420
|
-
.option('--submit', 'Auto-submit for review after creation')
|
|
421
|
-
.option('--file <path...>', 'Attach media files (repeatable)')
|
|
422
|
-
.option('--asset-type <type>', 'Asset type for --file: IMAGE, VIDEO, THUMBNAIL, DOCUMENT (auto-detected if omitted)')
|
|
423
|
-
.action(mediaDraftCreateCommand);
|
|
424
|
-
|
|
425
|
-
mediaDraftCmd
|
|
426
|
-
.command('edit <id>')
|
|
427
|
-
.description('Edit a draft (DRAFT or REJECTED status only)')
|
|
428
|
-
.action(mediaDraftEditCommand);
|
|
429
|
-
|
|
430
|
-
mediaDraftCmd
|
|
431
|
-
.command('list')
|
|
432
|
-
.description('List your media drafts')
|
|
433
|
-
.option('--status <status>', 'Filter: DRAFT, SUBMITTED, IN_REVIEW, APPROVED, REJECTED, SCHEDULED, PUBLISHED')
|
|
434
|
-
.option('--platform <platform>', 'Filter: LINKEDIN, YOUTUBE, TIKTOK, INSTAGRAM')
|
|
435
|
-
.option('--search <query>', 'Search by caption, title, or draft ID')
|
|
436
|
-
.option('--sort <sort>', 'Sort: newest, oldest, publish_date', 'newest')
|
|
437
|
-
.option('-n, --limit <number>', 'Number of results', '20')
|
|
438
|
-
.option('--offset <number>', 'Pagination offset', '0')
|
|
439
|
-
.option('--json', 'Output raw JSON')
|
|
440
|
-
.action(mediaDraftListCommand);
|
|
441
|
-
|
|
442
|
-
mediaDraftCmd
|
|
443
|
-
.command('status <id>')
|
|
444
|
-
.description('Check draft status (e.g., MED-2026-0001)')
|
|
445
|
-
.action(mediaDraftStatusCommand);
|
|
446
|
-
|
|
447
478
|
// ── SoulPrint Studio: Model Training Pipeline ───────────
|
|
448
479
|
|
|
449
480
|
const soulprintCmd = program
|
package/src/utils/api.js
CHANGED
|
@@ -520,3 +520,47 @@ export async function confirmMediaDraftUpload(id, data) {
|
|
|
520
520
|
const response = await client.post(`/media/drafts/${encodeURIComponent(id)}/confirm-upload`, data);
|
|
521
521
|
return response.data;
|
|
522
522
|
}
|
|
523
|
+
|
|
524
|
+
// ── Game Missions & Bundles API (/api/v1/games) ────────
|
|
525
|
+
|
|
526
|
+
export async function getGameMissions(gameId) {
|
|
527
|
+
const client = getApiClient();
|
|
528
|
+
const response = await client.get(`/games/${encodeURIComponent(gameId)}/missions`);
|
|
529
|
+
return response.data;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
export async function updateGameMissions(gameId, manifest) {
|
|
533
|
+
const client = getApiClient();
|
|
534
|
+
const response = await client.put(`/games/${encodeURIComponent(gameId)}/missions`, manifest);
|
|
535
|
+
return response.data;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export async function getGameUploadUrl(gameId, data) {
|
|
539
|
+
const client = getApiClient();
|
|
540
|
+
const response = await client.post(`/games/${encodeURIComponent(gameId)}/upload-url`, data);
|
|
541
|
+
return response.data;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export async function confirmGameUpload(gameId, data) {
|
|
545
|
+
const client = getApiClient();
|
|
546
|
+
const response = await client.post(`/games/${encodeURIComponent(gameId)}/confirm-upload`, data);
|
|
547
|
+
return response.data;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export async function getGameDetail(gameId) {
|
|
551
|
+
const client = getApiClient();
|
|
552
|
+
const response = await client.get(`/games/${encodeURIComponent(gameId)}`);
|
|
553
|
+
return response.data;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
export async function updateGameMetadata(gameId, data) {
|
|
557
|
+
const client = getApiClient();
|
|
558
|
+
const response = await client.put(`/games/${encodeURIComponent(gameId)}`, data);
|
|
559
|
+
return response.data;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export async function submitGameForReview(gameId) {
|
|
563
|
+
const client = getApiClient();
|
|
564
|
+
const response = await client.put(`/games/${encodeURIComponent(gameId)}`, { status: 'SUBMITTED' });
|
|
565
|
+
return response.data;
|
|
566
|
+
}
|