@myvillage/cli 1.9.0 → 1.10.0

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/src/index.js CHANGED
@@ -53,16 +53,20 @@ import {
53
53
  bizreqsStatusCommand,
54
54
  bizreqsImportCommand,
55
55
  } from './commands/bizreqs.js';
56
+ import {
57
+ gameUpdateCommand,
58
+ gameUploadThumbnailCommand,
59
+ gameSubmitCommand,
60
+ gameMissionsInitCommand,
61
+ gameMissionsSyncCommand,
62
+ gameMissionsListCommand,
63
+ gameBundlesUploadCommand,
64
+ gameBundlesUploadDirCommand,
65
+ } from './commands/game.js';
56
66
  import { checkinCommand } from './commands/checkin.js';
57
67
  import { discoverCommand } from './commands/discover.js';
58
68
  import { logCommand } from './commands/log.js';
59
69
  import { storyCommand } from './commands/story.js';
60
- import {
61
- mediaDraftCreateCommand,
62
- mediaDraftEditCommand,
63
- mediaDraftListCommand,
64
- mediaDraftStatusCommand,
65
- } from './commands/media.js';
66
70
  import {
67
71
  soulprintInitCommand,
68
72
  soulprintIngestCommand,
@@ -116,13 +120,74 @@ export function run() {
116
120
  program
117
121
  .command('deploy')
118
122
  .description('Build and deploy your game to MyVillageOS')
119
- .action(deployCommand);
123
+ .option('-p, --platform <platform>', 'Target platform (ios, android, webgl) — required for Unity games')
124
+ .action((options) => deployCommand(options));
120
125
 
121
126
  program
122
127
  .command('status')
123
128
  .description('Check deployment status of your games')
124
129
  .action(statusCommand);
125
130
 
131
+ // ── Game Management ────────────────────────────────
132
+
133
+ const gameCmd = program
134
+ .command('game')
135
+ .description('Manage your deployed games');
136
+
137
+ gameCmd
138
+ .command('update')
139
+ .description('Update game metadata (title, description, category, tags)')
140
+ .action(gameUpdateCommand);
141
+
142
+ gameCmd
143
+ .command('upload-thumbnail <file>')
144
+ .description('Upload or replace game thumbnail image')
145
+ .action(gameUploadThumbnailCommand);
146
+
147
+ gameCmd
148
+ .command('submit')
149
+ .description('Submit a DRAFT game for admin review')
150
+ .action(gameSubmitCommand);
151
+
152
+ // Game missions subcommands
153
+ const gameMissionsCmd = gameCmd
154
+ .command('missions')
155
+ .description('Manage game mission manifests');
156
+
157
+ gameMissionsCmd
158
+ .command('init')
159
+ .description('Create a manifest.json template')
160
+ .action(gameMissionsInitCommand);
161
+
162
+ gameMissionsCmd
163
+ .command('sync')
164
+ .description('Upload manifest.json to ed-platform')
165
+ .action(gameMissionsSyncCommand);
166
+
167
+ gameMissionsCmd
168
+ .command('list')
169
+ .description('List missions from the uploaded manifest')
170
+ .option('--json', 'Output raw JSON')
171
+ .action(gameMissionsListCommand);
172
+
173
+ // Game bundles subcommands
174
+ const gameBundlesCmd = gameCmd
175
+ .command('bundles')
176
+ .description('Manage game asset bundles');
177
+
178
+ gameBundlesCmd
179
+ .command('upload <file>')
180
+ .description('Upload a single bundle file')
181
+ .requiredOption('-p, --platform <platform>', 'Target platform (ios, android, webgl)')
182
+ .option('--bundle-name <name>', 'Bundle name (defaults to filename without extension)')
183
+ .action(gameBundlesUploadCommand);
184
+
185
+ gameBundlesCmd
186
+ .command('upload-dir <dir>')
187
+ .description('Upload all files in a directory as bundles')
188
+ .requiredOption('-p, --platform <platform>', 'Target platform (ios, android, webgl)')
189
+ .action(gameBundlesUploadDirCommand);
190
+
126
191
  // ── Network: Feed ───────────────────────────────────
127
192
 
128
193
  program
@@ -404,46 +469,6 @@ export function run() {
404
469
  .option('--contact <name>', 'Contact name')
405
470
  .action(bizreqsImportCommand);
406
471
 
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
472
  // ── SoulPrint Studio: Model Training Pipeline ───────────
448
473
 
449
474
  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
+ }