@playdrop/playdrop-cli 0.3.8-build.3 → 0.3.10
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/README.md +43 -1
- package/config/client-meta.json +5 -6
- package/dist/apps/build.js +43 -38
- package/dist/catalogue-utils.js +30 -18
- package/dist/catalogue.d.ts +0 -3
- package/dist/catalogue.js +80 -49
- package/dist/clientInfo.js +16 -2
- package/dist/commands/browse.js +10 -1
- package/dist/commands/capture.js +3 -2
- package/dist/commands/create.js +153 -54
- package/dist/commands/createRemixContent.js +61 -46
- package/dist/commands/creations.js +10 -1
- package/dist/commands/devServer.d.ts +1 -1
- package/dist/commands/devShared.js +1 -1
- package/dist/commands/generation.js +91 -74
- package/dist/commands/gettingStarted.js +1 -1
- package/dist/commands/init.js +30 -2
- package/dist/commands/search.js +10 -1
- package/dist/commands/upload-content.d.ts +70 -0
- package/dist/commands/upload-content.js +627 -0
- package/dist/commands/upload-graph.d.ts +23 -0
- package/dist/commands/upload-graph.js +108 -0
- package/dist/commands/upload.js +264 -543
- package/dist/http.d.ts +1 -1
- package/dist/playwright.d.ts +12 -4
- package/dist/proxyFetch.js +3 -2
- package/dist/taskSelection.js +2 -2
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/ai-client/dist/index.js +74 -54
- package/node_modules/@playdrop/api-client/dist/client.d.ts +20 -12
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +6 -8
- package/node_modules/@playdrop/api-client/dist/core/errors.js +11 -11
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts +2 -0
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/request.js +10 -3
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +12 -10
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.js +33 -30
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.js +127 -128
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts +9 -5
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.js +151 -88
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.js +150 -115
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +3 -1
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/auth.js +21 -0
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/payments.js +10 -0
- package/node_modules/@playdrop/api-client/dist/index.d.ts +34 -31
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +19 -9
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +2 -0
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +95 -75
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +2 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +5 -5
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +25 -25
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js +2 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +5 -0
- package/node_modules/@playdrop/config/client-meta.json +5 -6
- package/node_modules/@playdrop/config/dist/src/index.js +6 -6
- package/node_modules/@playdrop/config/dist/test/validateClientEnvironment.test.js +15 -2
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +54 -9
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +15 -8
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +105 -11
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset-pack.js +2 -0
- package/node_modules/@playdrop/types/dist/asset.d.ts +18 -50
- package/node_modules/@playdrop/types/dist/asset.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/ecs.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/ecs.js +10 -6
- package/node_modules/@playdrop/types/dist/entity.d.ts +5 -10
- package/node_modules/@playdrop/types/dist/entity.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/entity.js +40 -23
- package/node_modules/@playdrop/types/dist/graph.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/graph.js +13 -5
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/version.js +7 -3
- package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +1 -0
- package/node_modules/@playdrop/vox-three/dist/src/vox.js +15 -6
- package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +16 -0
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
- package/package.json +23 -2
package/dist/commands/init.js
CHANGED
|
@@ -16,7 +16,9 @@ const http_1 = require("../http");
|
|
|
16
16
|
const environment_1 = require("../environment");
|
|
17
17
|
const messages_1 = require("../messages");
|
|
18
18
|
const clientInfo_1 = require("../clientInfo");
|
|
19
|
-
const DEFAULT_CATALOGUE =
|
|
19
|
+
const DEFAULT_CATALOGUE = '{}\n';
|
|
20
|
+
const LEGACY_CATALOGUE_VERSION_KEY = ['schema', 'Version'].join('');
|
|
21
|
+
const ALLOWED_CATALOGUE_TOP_LEVEL_KEYS = new Set(['apps', 'assets', 'assetPacks']);
|
|
20
22
|
function ensureTrailingNewline(content) {
|
|
21
23
|
return content.endsWith('\n') ? content : `${content}\n`;
|
|
22
24
|
}
|
|
@@ -100,7 +102,33 @@ function normalizeBootstrapPayload(payload) {
|
|
|
100
102
|
const catalogueRaw = typeof payload.catalogue === 'string' && payload.catalogue.trim().length > 0
|
|
101
103
|
? payload.catalogue
|
|
102
104
|
: DEFAULT_CATALOGUE;
|
|
103
|
-
const
|
|
105
|
+
const catalogueCandidate = ensureTrailingNewline(catalogueRaw.trim() ? catalogueRaw : DEFAULT_CATALOGUE);
|
|
106
|
+
let parsedCatalogue;
|
|
107
|
+
try {
|
|
108
|
+
parsedCatalogue = JSON.parse(catalogueCandidate);
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
(0, messages_1.printErrorWithHelp)('Bootstrap payload returned an invalid catalogue.json.', ['Contact the platform team or try again shortly.'], { command: 'project init' });
|
|
112
|
+
process.exitCode = 1;
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
if (!parsedCatalogue || typeof parsedCatalogue !== 'object' || Array.isArray(parsedCatalogue)) {
|
|
116
|
+
(0, messages_1.printErrorWithHelp)('Bootstrap payload returned an invalid catalogue.json.', ['Contact the platform team or try again shortly.'], { command: 'project init' });
|
|
117
|
+
process.exitCode = 1;
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
if (Object.prototype.hasOwnProperty.call(parsedCatalogue, LEGACY_CATALOGUE_VERSION_KEY)) {
|
|
121
|
+
(0, messages_1.printErrorWithHelp)('Bootstrap payload returned a legacy catalogue.json with a top-level version field.', ['Contact the platform team or try again shortly.'], { command: 'project init' });
|
|
122
|
+
process.exitCode = 1;
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const unsupportedKey = Object.keys(parsedCatalogue).find((key) => !ALLOWED_CATALOGUE_TOP_LEVEL_KEYS.has(key));
|
|
126
|
+
if (unsupportedKey) {
|
|
127
|
+
(0, messages_1.printErrorWithHelp)(`Bootstrap payload returned catalogue.json with unsupported top-level key "${unsupportedKey}".`, ['Contact the platform team or try again shortly.'], { command: 'project init' });
|
|
128
|
+
process.exitCode = 1;
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
const catalogue = catalogueCandidate;
|
|
104
132
|
return { readmeUri, agentsUri, catalogue };
|
|
105
133
|
}
|
|
106
134
|
async function downloadBootstrapAsset(webBase, uri, label) {
|
package/dist/commands/search.js
CHANGED
|
@@ -92,7 +92,16 @@ function formatCountValue(value) {
|
|
|
92
92
|
}
|
|
93
93
|
function buildCountsSuffix(item) {
|
|
94
94
|
const parts = [];
|
|
95
|
-
if (
|
|
95
|
+
if (item.kind === 'app' && typeof item.item.playCount === 'number') {
|
|
96
|
+
if (typeof item.item.viewCount === 'number') {
|
|
97
|
+
parts.push(`view ${formatCountValue(item.item.viewCount)}`);
|
|
98
|
+
}
|
|
99
|
+
parts.push(`launch ${formatCountValue(item.item.playCount)}`);
|
|
100
|
+
}
|
|
101
|
+
if (item.kind === 'asset' && typeof item.item.playCount === 'number') {
|
|
102
|
+
if (typeof item.item.viewCount === 'number') {
|
|
103
|
+
parts.push(`view ${formatCountValue(item.item.viewCount)}`);
|
|
104
|
+
}
|
|
96
105
|
parts.push(`play ${formatCountValue(item.item.playCount)}`);
|
|
97
106
|
}
|
|
98
107
|
if (typeof item.item.likeCount === 'number') {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ApiClient } from '@playdrop/api-client';
|
|
2
|
+
import { type AssetPackUploadedLocalAsset } from '@playdrop/types';
|
|
3
|
+
import type { AssetPackTask, AssetTask, EmbeddedAssetTask } from '../catalogue';
|
|
4
|
+
import type { CliTask } from '../taskUtils';
|
|
5
|
+
export type CurrentUserRole = 'USER' | 'CREATOR' | 'ADMIN' | null;
|
|
6
|
+
export type UploadedAssetInfo = {
|
|
7
|
+
creatorUsername: string;
|
|
8
|
+
name: string;
|
|
9
|
+
revision: number;
|
|
10
|
+
ref: string;
|
|
11
|
+
versionNodeId: string;
|
|
12
|
+
};
|
|
13
|
+
export type UploadedAppInfo = {
|
|
14
|
+
creatorUsername: string;
|
|
15
|
+
name: string;
|
|
16
|
+
version: string;
|
|
17
|
+
versionId: number;
|
|
18
|
+
versionNodeId: string;
|
|
19
|
+
ref: string;
|
|
20
|
+
};
|
|
21
|
+
export type UploadedPackInfo = {
|
|
22
|
+
creatorUsername: string;
|
|
23
|
+
name: string;
|
|
24
|
+
version: string;
|
|
25
|
+
versionNodeId: string;
|
|
26
|
+
ref: string;
|
|
27
|
+
assetRefs: string[];
|
|
28
|
+
uploadedLocalAssets: AssetPackUploadedLocalAsset[];
|
|
29
|
+
};
|
|
30
|
+
export type PreparedUploadFile = {
|
|
31
|
+
fieldName: string;
|
|
32
|
+
filename: string;
|
|
33
|
+
filePath: string;
|
|
34
|
+
file: File;
|
|
35
|
+
contentType: string;
|
|
36
|
+
sizeBytes: number;
|
|
37
|
+
sha256: string;
|
|
38
|
+
};
|
|
39
|
+
export type PackUploadPlan = {
|
|
40
|
+
packKey: string;
|
|
41
|
+
packTask: AssetPackTask;
|
|
42
|
+
packCreator: string;
|
|
43
|
+
ownedAssetKeys: string[];
|
|
44
|
+
uploadKeyByAssetKey: Map<string, string>;
|
|
45
|
+
};
|
|
46
|
+
export type PackUploadPlanningResult = {
|
|
47
|
+
ok: true;
|
|
48
|
+
packPlansByKey: Map<string, PackUploadPlan>;
|
|
49
|
+
ownedPackByAssetKey: Map<string, PackUploadPlan>;
|
|
50
|
+
} | {
|
|
51
|
+
ok: false;
|
|
52
|
+
task: CliTask;
|
|
53
|
+
message: string;
|
|
54
|
+
};
|
|
55
|
+
type TaskCreatorResult = {
|
|
56
|
+
requestedTaskOwner: string;
|
|
57
|
+
taskCreator: string;
|
|
58
|
+
creatorTargetError: string | null;
|
|
59
|
+
};
|
|
60
|
+
export declare function buildAssetKey(creatorUsername: string, name: string): string;
|
|
61
|
+
export declare function buildPackKey(creatorUsername: string, name: string, version: string): string;
|
|
62
|
+
export declare function getTaskCreatorResult(task: CliTask, defaultCreator: string, currentUserRole: CurrentUserRole): TaskCreatorResult;
|
|
63
|
+
export declare function parseUnversionedAssetTaskRef(rawRef: string, fallbackCreator: string): {
|
|
64
|
+
creatorUsername: string;
|
|
65
|
+
name: string;
|
|
66
|
+
} | null;
|
|
67
|
+
export declare function buildAssetPackUploadPlans(tasks: CliTask[], defaultCreator: string, currentUserRole: CurrentUserRole): PackUploadPlanningResult;
|
|
68
|
+
export declare function uploadAssetTask(client: ApiClient, task: AssetTask | EmbeddedAssetTask, sourceAppVersionId?: number, creatorUsername?: string): Promise<UploadedAssetInfo>;
|
|
69
|
+
export declare function uploadAssetPackTask(client: ApiClient, task: AssetPackTask, creatorUsername: string, uploadedAssets: Map<string, UploadedAssetInfo>, localAssetTasks: AssetTask[], uploadKeyByAssetKey: Map<string, string>, targetCreatorUsername?: string): Promise<UploadedPackInfo>;
|
|
70
|
+
export {};
|