@playdrop/playdrop-cli 0.8.8 → 0.9.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/dist/index.js CHANGED
@@ -9,6 +9,10 @@ const login_1 = require("./commands/login");
9
9
  const whoami_1 = require("./commands/whoami");
10
10
  const logout_1 = require("./commands/logout");
11
11
  const accounts_1 = require("./commands/accounts");
12
+ const doctor_1 = require("./commands/doctor");
13
+ const clients_1 = require("./commands/clients");
14
+ const agents_1 = require("./commands/agents");
15
+ const workspaces_1 = require("./commands/workspaces");
12
16
  const browse_1 = require("./commands/browse");
13
17
  const search_1 = require("./commands/search");
14
18
  const tags_1 = require("./commands/tags");
@@ -22,7 +26,6 @@ const boosts_1 = require("./commands/boosts");
22
26
  const notifications_1 = require("./commands/notifications");
23
27
  const creations_1 = require("./commands/creations");
24
28
  const generation_1 = require("./commands/generation");
25
- const init_1 = require("./commands/init");
26
29
  const create_1 = require("./commands/create");
27
30
  const createRemixContent_1 = require("./commands/createRemixContent");
28
31
  const dev_1 = require("./commands/dev");
@@ -31,6 +34,7 @@ const capture_1 = require("./commands/capture");
31
34
  const devServer_1 = require("./commands/devServer");
32
35
  const captureListing_1 = require("./commands/captureListing");
33
36
  const captureRemote_1 = require("./commands/captureRemote");
37
+ const marketing_1 = require("./commands/marketing");
34
38
  const validate_1 = require("./commands/validate");
35
39
  const build_1 = require("./commands/build");
36
40
  const format_1 = require("./commands/format");
@@ -41,18 +45,12 @@ const changelog_1 = require("./commands/changelog");
41
45
  const publicPages_1 = require("./commands/publicPages");
42
46
  const upgrade_1 = require("./commands/upgrade");
43
47
  const messages_1 = require("./messages");
44
- function resolveInitTarget(pathArg) {
45
- if (typeof pathArg === 'string' && pathArg.trim().length > 0) {
46
- return pathArg.trim();
47
- }
48
- return '.';
49
- }
50
48
  function printRemovedCommandHint(command) {
51
49
  const replacements = {
52
50
  list: 'playdrop browse',
53
51
  generate: 'playdrop ai create',
54
52
  generations: 'playdrop ai jobs browse',
55
- init: 'playdrop project init',
53
+ init: 'playdrop workspaces init',
56
54
  create: 'playdrop project create app',
57
55
  dev: 'playdrop project dev',
58
56
  capture: 'playdrop project capture',
@@ -91,7 +89,7 @@ program
91
89
  .addHelpCommand('help [command]', 'Show help for a command');
92
90
  program.showHelpAfterError();
93
91
  program.showSuggestionAfterError();
94
- program.addHelpText('afterAll', '\nStart here: run `playdrop getting-started`, `playdrop faq`, or `playdrop changelog`.\n');
92
+ program.addHelpText('afterAll', '\nStart here: run `playdrop doctor` for setup, or `playdrop getting-started`, `playdrop faq`, or `playdrop changelog`.\n');
95
93
  program.on('command:*', (unknownCommands) => {
96
94
  const [unknownCommand] = unknownCommands;
97
95
  if (unknownCommand) {
@@ -166,6 +164,101 @@ registerLogoutCommand(auth);
166
164
  registerWhoamiCommand(auth);
167
165
  registerAccountsCommand(auth);
168
166
  registerUseAccountCommand(auth);
167
+ program
168
+ .command('doctor')
169
+ .description('Check PlayDrop setup health')
170
+ .option('--section <section>', 'clients, agents, or workspaces')
171
+ .option('--json', 'Output JSON')
172
+ .action(async (opts) => {
173
+ await (0, doctor_1.showDoctor)({ section: opts.section, json: opts.json });
174
+ });
175
+ const clients = program.command('clients').description('Manage the PlayDrop native client');
176
+ clients
177
+ .action(async () => {
178
+ await (0, clients_1.showClientStatus)();
179
+ });
180
+ clients
181
+ .command('status')
182
+ .description('Show native client status')
183
+ .option('--json', 'Output JSON')
184
+ .action(async (opts) => {
185
+ await (0, clients_1.showClientStatus)({ json: opts.json });
186
+ });
187
+ clients
188
+ .command('install')
189
+ .description('Install the PlayDrop native client')
190
+ .action(async () => {
191
+ await (0, clients_1.installClient)();
192
+ });
193
+ clients
194
+ .command('launch')
195
+ .description('Launch the PlayDrop native client')
196
+ .action(async () => {
197
+ await (0, clients_1.launchClient)();
198
+ });
199
+ clients
200
+ .command('update')
201
+ .description('Update the PlayDrop native client')
202
+ .action(async () => {
203
+ await (0, clients_1.updateClient)();
204
+ });
205
+ const agents = program.command('agents').description('Manage coding agents and PlayDrop plugins');
206
+ agents
207
+ .action(async () => {
208
+ await (0, agents_1.showAgentsStatus)();
209
+ });
210
+ agents
211
+ .command('status')
212
+ .description('Show coding agent and plugin status')
213
+ .option('--json', 'Output JSON')
214
+ .action(async (opts) => {
215
+ await (0, agents_1.showAgentsStatus)({ json: opts.json });
216
+ });
217
+ agents
218
+ .command('install-plugin <agent>')
219
+ .description('Install the PlayDrop plugin for codex or claude; show manual Cursor steps')
220
+ .action(async (agent) => {
221
+ await (0, agents_1.installPlugin)(agent);
222
+ });
223
+ agents
224
+ .command('update-plugin <agent>')
225
+ .description('Update the PlayDrop plugin for codex or claude; show manual Cursor steps')
226
+ .action(async (agent) => {
227
+ await (0, agents_1.updatePlugin)(agent);
228
+ });
229
+ const workspaces = program.command('workspaces').description('Manage local PlayDrop workspaces');
230
+ workspaces
231
+ .action(async () => {
232
+ await (0, workspaces_1.listWorkspaces)();
233
+ });
234
+ workspaces
235
+ .command('list')
236
+ .description('List cached PlayDrop workspaces')
237
+ .option('--json', 'Output JSON')
238
+ .action(async (opts) => {
239
+ await (0, workspaces_1.listWorkspaces)({ json: opts.json });
240
+ });
241
+ workspaces
242
+ .command('init [path]')
243
+ .description('Initialize a PlayDrop workspace')
244
+ .option('--json', 'Output JSON')
245
+ .action(async (pathArg, opts) => {
246
+ await (0, workspaces_1.initWorkspace)(pathArg, { json: opts.json });
247
+ });
248
+ workspaces
249
+ .command('inspect [path]')
250
+ .description('Inspect one PlayDrop workspace')
251
+ .option('--json', 'Output JSON')
252
+ .action(async (pathArg, opts) => {
253
+ await (0, workspaces_1.inspectWorkspace)(pathArg, { json: opts.json });
254
+ });
255
+ workspaces
256
+ .command('refresh [roots...]')
257
+ .description('Scan explicit roots for PlayDrop workspaces')
258
+ .option('--json', 'Output JSON')
259
+ .action(async (roots, opts) => {
260
+ await (0, workspaces_1.refreshWorkspaces)(roots ?? [], { json: opts.json });
261
+ });
169
262
  const browseCommand = program.command('browse').description('Browse public content');
170
263
  browseCommand
171
264
  .option('--kind <kind>', 'app, asset, asset-pack, asset-spec, or all')
@@ -698,7 +791,8 @@ project
698
791
  .command('init [path]')
699
792
  .description('Initialize a Playdrop workspace')
700
793
  .action(async (pathArg) => {
701
- await (0, init_1.init)(resolveInitTarget(pathArg));
794
+ console.error('"playdrop project init" is now "playdrop workspaces init"; running the workspace command for compatibility.');
795
+ await (0, workspaces_1.initWorkspace)(pathArg);
702
796
  });
703
797
  const projectCreate = project.command('create').description('Create project resources');
704
798
  projectCreate
@@ -824,6 +918,55 @@ projectCapture
824
918
  ...command.opts(),
825
919
  });
826
920
  });
921
+ const projectMarketing = project.command('marketing').description('Prepare local marketing captures and assets');
922
+ projectMarketing
923
+ .command('doctor [target]')
924
+ .description('Check local marketing capture prerequisites')
925
+ .option('--app <name>', 'App name when the target is a workspace')
926
+ .option('--surfaces <list>', 'desktop, mobile-landscape, mobile-portrait')
927
+ .option('--duration <seconds>', 'Capture duration in seconds')
928
+ .option('--fps <number>', 'Capture frame rate')
929
+ .option('--audio-policy <policy>', 'music-and-sfx, sfx-only, or silent')
930
+ .option('--seed <seed>', 'Preview seed')
931
+ .option('--output-dir <path>', 'Output directory, defaults to assets/marketing')
932
+ .option('--screen-device <device>', 'macOS avfoundation screen device index')
933
+ .action(async (target, opts) => {
934
+ await (0, marketing_1.marketingDoctor)(target, {
935
+ app: opts.app,
936
+ surfaces: opts.surfaces,
937
+ duration: opts.duration,
938
+ fps: opts.fps,
939
+ audioPolicy: opts.audioPolicy,
940
+ seed: opts.seed,
941
+ outputDir: opts.outputDir,
942
+ screenDevice: opts.screenDevice,
943
+ });
944
+ });
945
+ projectMarketing
946
+ .command('capture [target]')
947
+ .description('Capture local marketing videos from the app preview')
948
+ .option('--app <name>', 'App name when the target is a workspace')
949
+ .option('--surfaces <list>', 'desktop, mobile-landscape, mobile-portrait')
950
+ .option('--duration <seconds>', 'Capture duration in seconds')
951
+ .option('--fps <number>', 'Capture frame rate')
952
+ .option('--audio-policy <policy>', 'music-and-sfx, sfx-only, or silent')
953
+ .option('--seed <seed>', 'Preview seed')
954
+ .option('--output-dir <path>', 'Output directory, defaults to assets/marketing')
955
+ .option('--screen-device <device>', 'macOS avfoundation screen device index')
956
+ .option('--keep-raw', 'Reserved for future raw capture preservation')
957
+ .action(async (target, opts) => {
958
+ await (0, marketing_1.marketingCapture)(target, {
959
+ app: opts.app,
960
+ surfaces: opts.surfaces,
961
+ duration: opts.duration,
962
+ fps: opts.fps,
963
+ audioPolicy: opts.audioPolicy,
964
+ seed: opts.seed,
965
+ outputDir: opts.outputDir,
966
+ screenDevice: opts.screenDevice,
967
+ keepRaw: opts.keepRaw,
968
+ });
969
+ });
827
970
  project
828
971
  .command('validate [target]')
829
972
  .description('Validate catalogue content')
@@ -0,0 +1,6 @@
1
+ export interface ShellProbeResult {
2
+ exitCode: number;
3
+ output: string;
4
+ }
5
+ export declare function buildCommandPathProbe(command: string, platform?: NodeJS.Platform): string;
6
+ export declare function runShell(command: string, platform?: NodeJS.Platform): ShellProbeResult;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildCommandPathProbe = buildCommandPathProbe;
4
+ exports.runShell = runShell;
5
+ const node_child_process_1 = require("node:child_process");
6
+ function buildCommandPathProbe(command, platform = process.platform) {
7
+ return platform === 'win32' ? `where ${command}` : `command -v ${command}`;
8
+ }
9
+ function runShell(command, platform = process.platform) {
10
+ const result = platform === 'win32'
11
+ ? (0, node_child_process_1.spawnSync)('cmd.exe', ['/d', '/s', '/c', command], { encoding: 'utf8', timeout: 10000 })
12
+ : (0, node_child_process_1.spawnSync)('/bin/zsh', ['-lc', command], { encoding: 'utf8', timeout: 10000 });
13
+ return {
14
+ exitCode: result.status ?? 1,
15
+ output: `${result.stdout ?? ''}${result.stderr ?? ''}`.trim(),
16
+ };
17
+ }
@@ -0,0 +1,2 @@
1
+ export declare function firstVersionIsNewer(left: string | undefined, right: string | undefined): boolean;
2
+ export declare function compareVersions(left: string, right: string): number;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.firstVersionIsNewer = firstVersionIsNewer;
4
+ exports.compareVersions = compareVersions;
5
+ function firstVersionIsNewer(left, right) {
6
+ if (!left || !right) {
7
+ return false;
8
+ }
9
+ return compareVersions(left, right) > 0;
10
+ }
11
+ function compareVersions(left, right) {
12
+ const leftParts = parseVersion(left);
13
+ const rightParts = parseVersion(right);
14
+ for (let index = 0; index < Math.max(leftParts.length, rightParts.length); index += 1) {
15
+ const leftPart = leftParts[index] ?? 0;
16
+ const rightPart = rightParts[index] ?? 0;
17
+ if (leftPart !== rightPart) {
18
+ return leftPart > rightPart ? 1 : -1;
19
+ }
20
+ }
21
+ return 0;
22
+ }
23
+ function parseVersion(value) {
24
+ return value
25
+ .trim()
26
+ .replace(/^[vV]/, '')
27
+ .split('.')
28
+ .map((part) => Number.parseInt(part.split('-')[0] ?? '0', 10))
29
+ .filter((part) => Number.isFinite(part));
30
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.8.8",
2
+ "version": "0.9.0",
3
3
  "runtimeSdkVersion": "0.7.21",
4
4
  "build": 1,
5
5
  "clients": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playdrop/playdrop-cli",
3
- "version": "0.8.8",
3
+ "version": "0.9.0",
4
4
  "description": "Official Playdrop CLI for publishing browser games, creator apps, and AI-generated game assets on playdrop.ai",
5
5
  "homepage": "https://www.playdrop.ai",
6
6
  "repository": {