@playdrop/playdrop-cli 0.11.8 → 0.11.9
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/config/client-meta.json +1 -1
- package/dist/apps/build.d.ts +1 -1
- package/dist/apps/build.js +2 -3
- package/dist/apps/upload.js +2 -3
- package/dist/assetSpecs.js +2 -5
- package/dist/catalogue.d.ts +1 -1
- package/dist/catalogue.js +2 -3
- package/dist/commands/browse.js +2 -2
- package/dist/commands/capture.js +10 -12
- package/dist/commands/captureListing.js +3 -5
- package/dist/commands/create.js +17 -15
- package/dist/commands/createRemixContent.js +2 -2
- package/dist/commands/detail.js +2 -2
- package/dist/commands/dev.js +9 -12
- package/dist/commands/devServer.d.ts +2 -2
- package/dist/commands/devServer.js +3 -4
- package/dist/commands/marketing.js +10 -11
- package/dist/commands/play.js +2 -2
- package/dist/commands/upload-content.js +1 -1
- package/dist/commands/validate.js +5 -7
- package/dist/commands/worker/runtime.js +5 -2
- package/dist/commands/worker.d.ts +4 -5
- package/dist/commands/worker.js +20 -48
- package/dist/config.js +1 -2
- package/node_modules/@playdrop/api-client/dist/client.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +10 -17
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +0 -7
- 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 +2 -46
- 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 +2 -22
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +0 -11
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js +0 -20
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +2 -12
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +1 -125
- package/node_modules/@playdrop/config/client-meta.json +1 -1
- package/node_modules/@playdrop/config/dist/src/index.d.ts +2 -2
- package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/index.js +1 -1
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts +2 -2
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/fastify.js +0 -1
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +6 -10
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/package.json +1 -1
package/config/client-meta.json
CHANGED
package/dist/apps/build.d.ts
CHANGED
package/dist/apps/build.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runNpmScript = runNpmScript;
|
|
4
4
|
exports.buildApp = buildApp;
|
|
5
|
+
const node_child_process_1 = require("node:child_process");
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
7
|
const node_fs_1 = require("node:fs");
|
|
6
8
|
const promises_1 = require("node:fs/promises");
|
|
7
|
-
const node_crypto_1 = require("node:crypto");
|
|
8
9
|
const node_path_1 = require("node:path");
|
|
9
|
-
const node_child_process_1 = require("node:child_process");
|
|
10
10
|
const node_zlib_1 = require("node:zlib");
|
|
11
11
|
const BASE_SOURCE_IGNORE_PATTERNS = [
|
|
12
12
|
'node_modules/',
|
|
@@ -227,7 +227,6 @@ function appendIncludedProjectFile(rootDir, includePath, excludedRelativeFiles,
|
|
|
227
227
|
results.push(record);
|
|
228
228
|
fileByRelativePath.set(record.relativePath, record);
|
|
229
229
|
}
|
|
230
|
-
// eslint-disable-next-line complexity -- Source archive collection needs one pass to enforce ignore/include/exclude rules deterministically.
|
|
231
230
|
function collectProjectFiles(rootDir, rules, options) {
|
|
232
231
|
const includeRelativeFiles = options?.includeRelativeFiles ?? [];
|
|
233
232
|
const excludeRelativeFiles = new Set(Array.from(options?.excludeRelativeFiles ?? [])
|
package/dist/apps/upload.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uploadApp = uploadApp;
|
|
4
|
-
const node_crypto_1 = require("node:crypto");
|
|
5
|
-
const types_1 = require("@playdrop/types");
|
|
6
4
|
const config_1 = require("@playdrop/config");
|
|
5
|
+
const types_1 = require("@playdrop/types");
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
7
7
|
const node_fs_1 = require("node:fs");
|
|
8
8
|
const node_path_1 = require("node:path");
|
|
9
9
|
const http_1 = require("../http");
|
|
@@ -159,7 +159,6 @@ async function uploadApp(client, task, artifacts, options) {
|
|
|
159
159
|
/**
|
|
160
160
|
* Upload an app version using the versioned API.
|
|
161
161
|
*/
|
|
162
|
-
// eslint-disable-next-line complexity -- Upload assembly mirrors the versioned multipart contract in one place.
|
|
163
162
|
async function uploadAppVersion(client, task, artifacts, options) {
|
|
164
163
|
const creatorUsername = typeof options?.creatorUsername === 'string' ? options.creatorUsername.trim() : '';
|
|
165
164
|
if (!creatorUsername) {
|
package/dist/assetSpecs.js
CHANGED
|
@@ -9,11 +9,11 @@ exports.loadAndValidateAssetSpecContract = loadAndValidateAssetSpecContract;
|
|
|
9
9
|
exports.validateCustomAssetFilesAgainstContract = validateCustomAssetFilesAgainstContract;
|
|
10
10
|
exports.normalizeAssetSpecVersionRef = normalizeAssetSpecVersionRef;
|
|
11
11
|
exports.validateAssetSpecName = validateAssetSpecName;
|
|
12
|
+
const types_1 = require("@playdrop/types");
|
|
13
|
+
const ajv_1 = __importDefault(require("ajv"));
|
|
12
14
|
const node_fs_1 = require("node:fs");
|
|
13
15
|
const node_path_1 = require("node:path");
|
|
14
|
-
const ajv_1 = __importDefault(require("ajv"));
|
|
15
16
|
const semver_1 = require("semver");
|
|
16
|
-
const types_1 = require("@playdrop/types");
|
|
17
17
|
const LOCAL_EXTENSION_TO_MIME = {
|
|
18
18
|
'.png': 'image/png',
|
|
19
19
|
'.jpg': 'image/jpeg',
|
|
@@ -75,7 +75,6 @@ function resolveCustomAssetRoleContentType(filePath, roleContract) {
|
|
|
75
75
|
}
|
|
76
76
|
return resolvedContentType;
|
|
77
77
|
}
|
|
78
|
-
// eslint-disable-next-line complexity
|
|
79
78
|
function normalizeAssetSpecSupportEntries(raw, errors, context) {
|
|
80
79
|
if (raw === undefined || raw === null) {
|
|
81
80
|
return [];
|
|
@@ -130,7 +129,6 @@ function normalizeAssetSpecSupportEntries(raw, errors, context) {
|
|
|
130
129
|
}
|
|
131
130
|
return rows;
|
|
132
131
|
}
|
|
133
|
-
// eslint-disable-next-line complexity
|
|
134
132
|
function loadAndValidateAssetSpecContract(catalogueDir, relativeContractPath, errors, context) {
|
|
135
133
|
const contractPath = (0, node_path_1.resolve)(catalogueDir, relativeContractPath);
|
|
136
134
|
let rawText;
|
|
@@ -213,7 +211,6 @@ function loadAndValidateAssetSpecContract(catalogueDir, relativeContractPath, er
|
|
|
213
211
|
contractPath,
|
|
214
212
|
};
|
|
215
213
|
}
|
|
216
|
-
// eslint-disable-next-line complexity
|
|
217
214
|
function validateCustomAssetFilesAgainstContract(contract, filePaths, errors, context) {
|
|
218
215
|
const contractRoles = new Map(contract.roles.map((role) => [role.name.trim().toLowerCase(), role]));
|
|
219
216
|
const providedRoles = new Set();
|
package/dist/catalogue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AppAchievementCatalogueDefinition, type AppAuthMode, type AppControllerMode, type AppHostingMode, type AppLeaderboardCatalogueDefinition, type AppMetadataAssetSpecSupport, type AppSurface, type AppType, type AppVersionDesign, type AppVersionVisibility, type AssetSpecContract, type AssetSpecStatus, type AssetSpecValidationKind, type CatalogueTagGroupDefinition, type ContentLicense, type PlayerMetaDefinitionStatus } from '@playdrop/types';
|
|
2
2
|
import { type AssetSpecSupportDeclaration } from './assetSpecs';
|
|
3
3
|
export type CatalogueJson = {
|
|
4
4
|
apps?: Array<Record<string, unknown>>;
|
package/dist/catalogue.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable complexity, max-lines, max-lines-per-function */
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.validateAppMetadata = validateAppMetadata;
|
|
5
4
|
exports.resolveCatalogueTagGroups = resolveCatalogueTagGroups;
|
|
@@ -8,11 +7,11 @@ exports.resolveWorkspaceApp = resolveWorkspaceApp;
|
|
|
8
7
|
exports.formatMetadataWarnings = formatMetadataWarnings;
|
|
9
8
|
exports.formatMissingMetadataWarnings = formatMissingMetadataWarnings;
|
|
10
9
|
exports.findAppTaskByFile = findAppTaskByFile;
|
|
10
|
+
const types_1 = require("@playdrop/types");
|
|
11
11
|
const node_fs_1 = require("node:fs");
|
|
12
12
|
const node_path_1 = require("node:path");
|
|
13
|
-
const types_1 = require("@playdrop/types");
|
|
14
|
-
const catalogue_utils_1 = require("./catalogue-utils");
|
|
15
13
|
const assetSpecs_1 = require("./assetSpecs");
|
|
14
|
+
const catalogue_utils_1 = require("./catalogue-utils");
|
|
16
15
|
const HEX_COLOR_REGEX = /^#?(?:[0-9a-fA-F]{6})$/;
|
|
17
16
|
const SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
|
|
18
17
|
const LEGACY_CATALOGUE_VERSION_KEY = ['schema', 'Version'].join('');
|
package/dist/commands/browse.js
CHANGED
|
@@ -380,7 +380,7 @@ function parseBrowseCommandOptions(options) {
|
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
382
|
async function loadMergedBrowseResults(input) {
|
|
383
|
-
const { client,
|
|
383
|
+
const { client, creatorUsername, appType, assetCategory, assetSubcategory, assetSpec, assetSpecOwner, assetSpecName, limit, offset, tags, } = input;
|
|
384
384
|
const appResultsPromise = creatorUsername
|
|
385
385
|
? collectPaginatedItems((pageLimit, pageOffset) => client.fetchAppsByCreator(creatorUsername, {
|
|
386
386
|
limit: pageLimit,
|
|
@@ -546,7 +546,7 @@ async function runAssetPackBrowseCommand(input) {
|
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
548
|
async function runBrowseCommand(input) {
|
|
549
|
-
const { client, kind,
|
|
549
|
+
const { client, kind, creatorUsername, appType, auth, controller, surface, sort, limit, offset, tags, } = input;
|
|
550
550
|
if (kind === 'app') {
|
|
551
551
|
if (creatorUsername) {
|
|
552
552
|
const response = await client.fetchAppsByCreator(creatorUsername, {
|
package/dist/commands/capture.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.capture = capture;
|
|
4
|
+
const types_1 = require("@playdrop/types");
|
|
4
5
|
const node_fs_1 = require("node:fs");
|
|
5
6
|
const node_path_1 = require("node:path");
|
|
6
|
-
const types_1 = require("@playdrop/types");
|
|
7
|
-
const http_1 = require("../http");
|
|
8
|
-
const messages_1 = require("../messages");
|
|
9
|
-
const catalogue_utils_1 = require("../catalogue-utils");
|
|
10
|
-
const catalogue_1 = require("../catalogue");
|
|
11
|
-
const devShared_1 = require("./devShared");
|
|
12
|
-
const devServer_1 = require("./devServer");
|
|
13
|
-
const commandContext_1 = require("../commandContext");
|
|
14
7
|
const appUrls_1 = require("../appUrls");
|
|
15
8
|
const captureRuntime_1 = require("../captureRuntime");
|
|
9
|
+
const catalogue_1 = require("../catalogue");
|
|
10
|
+
const catalogue_utils_1 = require("../catalogue-utils");
|
|
11
|
+
const commandContext_1 = require("../commandContext");
|
|
16
12
|
const devAuth_1 = require("../devAuth");
|
|
17
|
-
const
|
|
13
|
+
const http_1 = require("../http");
|
|
14
|
+
const messages_1 = require("../messages");
|
|
18
15
|
const dev_1 = require("./dev");
|
|
19
|
-
const
|
|
16
|
+
const devRuntimeAssets_1 = require("./devRuntimeAssets");
|
|
17
|
+
const devServer_1 = require("./devServer");
|
|
18
|
+
const devShared_1 = require("./devShared");
|
|
20
19
|
const MOBILE_USER_AGENT = 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1';
|
|
21
20
|
const SURFACE_PRESETS = {
|
|
22
21
|
desktop: {
|
|
@@ -117,11 +116,10 @@ function resolveCaptureDevOptions(options) {
|
|
|
117
116
|
resetMode,
|
|
118
117
|
};
|
|
119
118
|
}
|
|
120
|
-
// eslint-disable-next-line max-lines-per-function
|
|
121
119
|
async function capture(targetArg, options = {}) {
|
|
122
120
|
const timeoutSeconds = (0, captureRuntime_1.validateCaptureTimeout)(options.timeoutSeconds);
|
|
123
121
|
const timeoutMs = Math.round(timeoutSeconds * 1000);
|
|
124
|
-
const devRouterPort = (0,
|
|
122
|
+
const devRouterPort = (0, dev_1.resolveCliDevRouterPort)();
|
|
125
123
|
let minimumLogLevel;
|
|
126
124
|
let loginOverride;
|
|
127
125
|
let devOptions;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable max-lines */
|
|
3
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
3
|
if (k2 === undefined) k2 = k;
|
|
5
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -41,18 +40,18 @@ exports.assertSupportedListingEnvironment = assertSupportedListingEnvironment;
|
|
|
41
40
|
exports.resolveListingRecorderPath = resolveListingRecorderPath;
|
|
42
41
|
exports.computeRecordedCrop = computeRecordedCrop;
|
|
43
42
|
exports.captureListing = captureListing;
|
|
43
|
+
const types_1 = require("@playdrop/types");
|
|
44
44
|
const node_child_process_1 = require("node:child_process");
|
|
45
45
|
const promises_1 = require("node:fs/promises");
|
|
46
46
|
const node_path_1 = require("node:path");
|
|
47
|
-
const
|
|
47
|
+
const appUrls_1 = require("../appUrls");
|
|
48
48
|
const catalogue_utils_1 = require("../catalogue-utils");
|
|
49
49
|
const commandContext_1 = require("../commandContext");
|
|
50
50
|
const http_1 = require("../http");
|
|
51
51
|
const messages_1 = require("../messages");
|
|
52
52
|
const playwright_1 = require("../playwright");
|
|
53
|
-
const devShared_1 = require("./devShared");
|
|
54
53
|
const devServer_1 = require("./devServer");
|
|
55
|
-
const
|
|
54
|
+
const devShared_1 = require("./devShared");
|
|
56
55
|
const CAPTURE_FRAME_SELECTOR = 'iframe[title="Game"]';
|
|
57
56
|
const DEFAULT_DURATION_SECONDS = 8;
|
|
58
57
|
const DEFAULT_WIDTH = 1280;
|
|
@@ -698,7 +697,6 @@ async function captureListing(targetArg, options = {}) {
|
|
|
698
697
|
const outputPaths = await ensureOutputPaths(appName, parsedOptions.outputDir);
|
|
699
698
|
const projectInfo = (0, devShared_1.findProjectInfo)(resolvedTarget.htmlPath);
|
|
700
699
|
const devScriptAvailable = Boolean(projectInfo.projectDir && projectInfo.packageJson && typeof projectInfo.packageJson.scripts?.dev === 'string');
|
|
701
|
-
// eslint-disable-next-line complexity
|
|
702
700
|
await (0, commandContext_1.withEnvironment)('project capture listing', 'Capturing listing media', async ({ client, env, envConfig }) => {
|
|
703
701
|
let currentUsername = '';
|
|
704
702
|
let registeredApp = null;
|
package/dist/commands/create.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable complexity, max-lines, max-lines-per-function */
|
|
3
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
4
|
};
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
6
|
exports.createAssetSpecProject = createAssetSpecProject;
|
|
8
7
|
exports.create = create;
|
|
9
|
-
const
|
|
10
|
-
const
|
|
8
|
+
const types_1 = require("@playdrop/types");
|
|
9
|
+
const app_1 = require("@playdrop/types/app");
|
|
10
|
+
const fflate_1 = require("fflate");
|
|
11
|
+
const node_child_process_1 = require("node:child_process");
|
|
11
12
|
const node_fs_1 = require("node:fs");
|
|
12
13
|
const node_path_1 = require("node:path");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const node_process_1 = require("node:process");
|
|
15
|
+
const promises_1 = __importDefault(require("node:readline/promises"));
|
|
16
|
+
const catalogue_1 = require("../catalogue");
|
|
17
|
+
const catalogue_utils_1 = require("../catalogue-utils");
|
|
18
|
+
const clientInfo_1 = require("../clientInfo");
|
|
16
19
|
const commandContext_1 = require("../commandContext");
|
|
17
20
|
const http_1 = require("../http");
|
|
18
21
|
const messages_1 = require("../messages");
|
|
19
22
|
const init_1 = require("./init");
|
|
20
|
-
const app_1 = require("@playdrop/types/app");
|
|
21
|
-
const catalogue_utils_1 = require("../catalogue-utils");
|
|
22
|
-
const catalogue_1 = require("../catalogue");
|
|
23
|
-
const clientInfo_1 = require("../clientInfo");
|
|
24
23
|
const CATALOGUE_FILENAME = 'catalogue.json';
|
|
25
24
|
const LEGACY_CATALOGUE_VERSION_KEY = ['schema', 'Version'].join('');
|
|
26
25
|
const ALLOWED_CATALOGUE_TOP_LEVEL_KEYS = new Set(['apps', 'assetSpecs', 'assets', 'assetPacks']);
|
|
@@ -306,7 +305,10 @@ function buildCatalogueEntry(name, metadata, sourceInfo, relativeFilePath) {
|
|
|
306
305
|
entry.surfaceTargets = { ...parsed.map };
|
|
307
306
|
}
|
|
308
307
|
catch (error) {
|
|
309
|
-
|
|
308
|
+
const message = error instanceof Error && error.message.trim()
|
|
309
|
+
? error.message.trim()
|
|
310
|
+
: String(error);
|
|
311
|
+
throw new Error(`Invalid surfaceTargets for ${name}: ${message}`);
|
|
310
312
|
}
|
|
311
313
|
}
|
|
312
314
|
if (Object.prototype.hasOwnProperty.call(metadata, 'templateSource')) {
|
|
@@ -1048,8 +1050,8 @@ function describeInitSummary(summary) {
|
|
|
1048
1050
|
async function create(name, options = {}) {
|
|
1049
1051
|
const file = (0, node_path_1.resolve)(`${name}.html`);
|
|
1050
1052
|
const projectDirCandidate = (0, node_path_1.resolve)(name);
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
+
const templateOptionRaw = options.template?.trim();
|
|
1054
|
+
const remixOptionRaw = options.remix?.trim();
|
|
1053
1055
|
let parsedTemplate = null;
|
|
1054
1056
|
let parsedRemix = null;
|
|
1055
1057
|
const existingLookup = (0, catalogue_1.resolveCatalogueEntries)(process.cwd(), { filterName: name });
|
|
@@ -1149,7 +1151,7 @@ async function create(name, options = {}) {
|
|
|
1149
1151
|
process.exitCode = 1;
|
|
1150
1152
|
return;
|
|
1151
1153
|
}
|
|
1152
|
-
const detailMessage =
|
|
1154
|
+
const detailMessage = error instanceof Error && error.message.trim()
|
|
1153
1155
|
? error.message.trim()
|
|
1154
1156
|
: '';
|
|
1155
1157
|
const problem = detailMessage
|
|
@@ -1222,7 +1224,7 @@ async function create(name, options = {}) {
|
|
|
1222
1224
|
try {
|
|
1223
1225
|
(0, node_fs_1.mkdirSync)(projectDir);
|
|
1224
1226
|
}
|
|
1225
|
-
catch
|
|
1227
|
+
catch {
|
|
1226
1228
|
(0, messages_1.printErrorWithHelp)(`Cannot create ${projectDir} because it already exists.`, [
|
|
1227
1229
|
'Remove or rename the existing directory before running "playdrop project create app" again.'
|
|
1228
1230
|
], { command: 'project create app' });
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createAssetRemix = createAssetRemix;
|
|
4
4
|
exports.createPackRemix = createPackRemix;
|
|
5
5
|
exports.createRemixContent = createRemixContent;
|
|
6
|
+
const types_1 = require("@playdrop/types");
|
|
6
7
|
const node_fs_1 = require("node:fs");
|
|
7
8
|
const node_path_1 = require("node:path");
|
|
8
|
-
const types_1 = require("@playdrop/types");
|
|
9
9
|
const commandContext_1 = require("../commandContext");
|
|
10
10
|
const http_1 = require("../http");
|
|
11
11
|
const messages_1 = require("../messages");
|
|
@@ -232,7 +232,7 @@ async function createPackRemix(name, remixRef) {
|
|
|
232
232
|
const catalogue = readWorkspaceCatalogue(cataloguePath);
|
|
233
233
|
assertWorkspaceRootCanOwnEntries(cataloguePath);
|
|
234
234
|
ensureUniqueEntryName(catalogue, 'pack', name);
|
|
235
|
-
|
|
235
|
+
await client.fetchAssetPackBySlug(parsedRef.creatorUsername, parsedRef.name);
|
|
236
236
|
const versions = await client.listAssetPackVersions(parsedRef.creatorUsername, parsedRef.name, { limit: 200, offset: 0 });
|
|
237
237
|
const version = versions.versions.find((entry) => entry.version === parsedRef.version);
|
|
238
238
|
if (!version) {
|
package/dist/commands/detail.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.detail = detail;
|
|
4
|
+
const appUrls_1 = require("../appUrls");
|
|
4
5
|
const commandContext_1 = require("../commandContext");
|
|
5
6
|
const errors_1 = require("../errors");
|
|
6
7
|
const messages_1 = require("../messages");
|
|
7
8
|
const output_1 = require("../output");
|
|
8
9
|
const refs_1 = require("../refs");
|
|
9
|
-
|
|
10
|
-
function printRefValidationError(raw) {
|
|
10
|
+
function printRefValidationError(_raw) {
|
|
11
11
|
(0, messages_1.printErrorWithHelp)('A canonical ref is required.', [
|
|
12
12
|
'Use the format <creator>/<kind>/<name>.',
|
|
13
13
|
'Kinds must be exactly app, asset, asset-spec, or asset-pack.',
|
package/dist/commands/dev.js
CHANGED
|
@@ -4,19 +4,19 @@ exports.formatDevRuntimeAssetManifestFailure = formatDevRuntimeAssetManifestFail
|
|
|
4
4
|
exports.dev = dev;
|
|
5
5
|
exports.resolveDevRouterPort = resolveDevRouterPort;
|
|
6
6
|
exports.resolveCliDevRouterPort = resolveCliDevRouterPort;
|
|
7
|
+
const types_1 = require("@playdrop/types");
|
|
7
8
|
const node_fs_1 = require("node:fs");
|
|
8
9
|
const node_path_1 = require("node:path");
|
|
9
|
-
const
|
|
10
|
+
const appUrls_1 = require("../appUrls");
|
|
11
|
+
const catalogue_1 = require("../catalogue");
|
|
12
|
+
const catalogue_utils_1 = require("../catalogue-utils");
|
|
10
13
|
const commandContext_1 = require("../commandContext");
|
|
14
|
+
const devAuth_1 = require("../devAuth");
|
|
11
15
|
const http_1 = require("../http");
|
|
12
16
|
const messages_1 = require("../messages");
|
|
13
|
-
const catalogue_1 = require("../catalogue");
|
|
14
|
-
const catalogue_utils_1 = require("../catalogue-utils");
|
|
15
|
-
const devShared_1 = require("./devShared");
|
|
16
|
-
const appUrls_1 = require("../appUrls");
|
|
17
|
-
const devServer_1 = require("./devServer");
|
|
18
17
|
const devRuntimeAssets_1 = require("./devRuntimeAssets");
|
|
19
|
-
const
|
|
18
|
+
const devServer_1 = require("./devServer");
|
|
19
|
+
const devShared_1 = require("./devShared");
|
|
20
20
|
function formatDevRuntimeAssetManifestFailure(error) {
|
|
21
21
|
const rawMessage = error instanceof Error ? error.message : String(error ?? 'unknown_error');
|
|
22
22
|
if (rawMessage.startsWith('dev_runtime_asset_ref_invalid:')) {
|
|
@@ -217,9 +217,7 @@ async function dev(targetArg, appOption, devOptions = {}) {
|
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
219
|
const workspacePath = resolvedTarget.cataloguePath ?? (0, node_path_1.dirname)(filePath);
|
|
220
|
-
await (0, commandContext_1.withEnvironment)('project dev', 'Starting the dev server',
|
|
221
|
-
// eslint-disable-next-line complexity
|
|
222
|
-
async ({ client, env, envConfig, account }) => {
|
|
220
|
+
await (0, commandContext_1.withEnvironment)('project dev', 'Starting the dev server', async ({ client, env, envConfig, account }) => {
|
|
223
221
|
let currentUsername = account?.username?.trim() ?? '';
|
|
224
222
|
if (!currentUsername) {
|
|
225
223
|
try {
|
|
@@ -250,10 +248,9 @@ async function dev(targetArg, appOption, devOptions = {}) {
|
|
|
250
248
|
throw error;
|
|
251
249
|
}
|
|
252
250
|
}
|
|
253
|
-
let appResponse = null;
|
|
254
251
|
if (resolvedTarget.cataloguePath) {
|
|
255
252
|
try {
|
|
256
|
-
|
|
253
|
+
await (0, devShared_1.assertAppRegistered)(client, currentUsername, appName);
|
|
257
254
|
}
|
|
258
255
|
catch (error) {
|
|
259
256
|
if (error instanceof http_1.CLIUnsupportedClientError) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import http from 'node:http';
|
|
2
1
|
import { type ChildProcess } from 'node:child_process';
|
|
3
|
-
import
|
|
2
|
+
import http from 'node:http';
|
|
4
3
|
import type { DevRuntimeAssetManifestRegistration } from './devRuntimeAssets';
|
|
4
|
+
import type { ProjectInfo } from './devShared';
|
|
5
5
|
export interface StartDevServerOptions {
|
|
6
6
|
appName: string;
|
|
7
7
|
appType: string;
|
|
@@ -14,11 +14,11 @@ exports.isDevServerAvailable = isDevServerAvailable;
|
|
|
14
14
|
exports.createDevRouterServer = createDevRouterServer;
|
|
15
15
|
exports.listenDevRouterServer = listenDevRouterServer;
|
|
16
16
|
exports.runDevRouterServer = runDevRouterServer;
|
|
17
|
-
const node_http_1 = __importDefault(require("node:http"));
|
|
18
|
-
const node_fs_1 = require("node:fs");
|
|
19
|
-
const node_path_1 = require("node:path");
|
|
20
17
|
const node_child_process_1 = require("node:child_process");
|
|
21
18
|
const node_crypto_1 = require("node:crypto");
|
|
19
|
+
const node_fs_1 = require("node:fs");
|
|
20
|
+
const node_http_1 = __importDefault(require("node:http"));
|
|
21
|
+
const node_path_1 = require("node:path");
|
|
22
22
|
exports.DEV_ROUTER_PORT = 8888;
|
|
23
23
|
const DEV_ROUTER_HOST = '127.0.0.1';
|
|
24
24
|
const CONTROL_PREFIX = '/_playdrop';
|
|
@@ -581,7 +581,6 @@ async function isDevServerAvailable(input, timeoutMs = 1000) {
|
|
|
581
581
|
}
|
|
582
582
|
function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
|
|
583
583
|
let activePort = initialPort;
|
|
584
|
-
// eslint-disable-next-line complexity
|
|
585
584
|
const handleRequest = async (req, res) => {
|
|
586
585
|
const method = req.method || 'GET';
|
|
587
586
|
const allowedOrigin = resolveApprovedDevRouterOrigin(typeof req.headers.origin === 'string' ? req.headers.origin : undefined);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable max-lines */
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.MARKETING_AUDIO_POLICIES = exports.MARKETING_SURFACES = void 0;
|
|
5
4
|
exports.parseMarketingCaptureOptions = parseMarketingCaptureOptions;
|
|
@@ -11,22 +10,22 @@ exports.buildMarketingCaptureManifest = buildMarketingCaptureManifest;
|
|
|
11
10
|
exports.createMarketingReport = createMarketingReport;
|
|
12
11
|
exports.marketingDoctor = marketingDoctor;
|
|
13
12
|
exports.marketingCapture = marketingCapture;
|
|
13
|
+
const types_1 = require("@playdrop/types");
|
|
14
14
|
const node_child_process_1 = require("node:child_process");
|
|
15
|
-
const promises_1 = require("node:fs/promises");
|
|
16
15
|
const node_fs_1 = require("node:fs");
|
|
17
|
-
const
|
|
16
|
+
const promises_1 = require("node:fs/promises");
|
|
18
17
|
const node_os_1 = require("node:os");
|
|
19
|
-
const
|
|
20
|
-
const
|
|
18
|
+
const node_path_1 = require("node:path");
|
|
19
|
+
const appUrls_1 = require("../appUrls");
|
|
21
20
|
const catalogue_1 = require("../catalogue");
|
|
21
|
+
const catalogue_utils_1 = require("../catalogue-utils");
|
|
22
22
|
const commandContext_1 = require("../commandContext");
|
|
23
23
|
const http_1 = require("../http");
|
|
24
|
-
const appUrls_1 = require("../appUrls");
|
|
25
24
|
const messages_1 = require("../messages");
|
|
26
25
|
const playwright_1 = require("../playwright");
|
|
27
|
-
const devServer_1 = require("./devServer");
|
|
28
|
-
const devRuntimeAssets_1 = require("./devRuntimeAssets");
|
|
29
26
|
const dev_1 = require("./dev");
|
|
27
|
+
const devRuntimeAssets_1 = require("./devRuntimeAssets");
|
|
28
|
+
const devServer_1 = require("./devServer");
|
|
30
29
|
const devShared_1 = require("./devShared");
|
|
31
30
|
exports.MARKETING_SURFACES = ['desktop', 'mobile-landscape', 'mobile-portrait'];
|
|
32
31
|
exports.MARKETING_AUDIO_POLICIES = ['music-and-sfx', 'sfx-only', 'silent'];
|
|
@@ -329,7 +328,7 @@ function loadCatalogueApp(cataloguePath, appName) {
|
|
|
329
328
|
if (!cataloguePath || !(0, node_fs_1.existsSync)(cataloguePath)) {
|
|
330
329
|
return null;
|
|
331
330
|
}
|
|
332
|
-
const raw = JSON.parse(
|
|
331
|
+
const raw = JSON.parse((0, node_fs_1.readFileSync)(cataloguePath, 'utf8'));
|
|
333
332
|
const apps = raw && typeof raw === 'object' && Array.isArray(raw.apps)
|
|
334
333
|
? raw.apps
|
|
335
334
|
: Array.isArray(raw)
|
|
@@ -661,7 +660,7 @@ function muxMarketingAudio(videoPath, audioPath) {
|
|
|
661
660
|
'-shortest',
|
|
662
661
|
muxedPath,
|
|
663
662
|
], 'ffmpeg_failed');
|
|
664
|
-
|
|
663
|
+
(0, node_fs_1.renameSync)(muxedPath, videoPath);
|
|
665
664
|
}
|
|
666
665
|
function extractPoster(videoPath, posterPath) {
|
|
667
666
|
runTool('ffmpeg', [
|
|
@@ -861,7 +860,7 @@ async function marketingCapture(targetArg, options = {}) {
|
|
|
861
860
|
const outputPaths = resolveMarketingOutputPaths(projectRoot, appName, parsedOptions.outputDir);
|
|
862
861
|
const projectInfo = (0, devShared_1.findProjectInfo)(resolvedTarget.htmlPath);
|
|
863
862
|
const devScriptAvailable = Boolean(projectInfo.projectDir && projectInfo.packageJson && typeof projectInfo.packageJson.scripts?.dev === 'string');
|
|
864
|
-
await (0, commandContext_1.withEnvironment)('project marketing capture', 'Capturing marketing media', async ({ client, env, envConfig }) => {
|
|
863
|
+
await (0, commandContext_1.withEnvironment)('project marketing capture', 'Capturing marketing media', async ({ client, env: _env, envConfig }) => {
|
|
865
864
|
let currentUsername = '';
|
|
866
865
|
try {
|
|
867
866
|
const currentUser = await (0, devShared_1.fetchDevUser)(client);
|
package/dist/commands/play.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.play = play;
|
|
4
4
|
const types_1 = require("@playdrop/types");
|
|
5
|
-
const commandContext_1 = require("../commandContext");
|
|
6
5
|
const appUrls_1 = require("../appUrls");
|
|
7
6
|
const browser_1 = require("../browser");
|
|
7
|
+
const commandContext_1 = require("../commandContext");
|
|
8
8
|
const http_1 = require("../http");
|
|
9
9
|
const messages_1 = require("../messages");
|
|
10
10
|
const output_1 = require("../output");
|
|
11
11
|
const refs_1 = require("../refs");
|
|
12
12
|
const devShared_1 = require("./devShared");
|
|
13
|
-
function printPlayRefValidationError(
|
|
13
|
+
function printPlayRefValidationError(_rawRef) {
|
|
14
14
|
(0, messages_1.printErrorWithHelp)('A canonical app ref is required.', [
|
|
15
15
|
'Use the format <creator>/app/<name>.',
|
|
16
16
|
'Example: playdrop play playdrop/app/hangingout',
|
|
@@ -8,10 +8,10 @@ exports.buildAssetPackUploadPlans = buildAssetPackUploadPlans;
|
|
|
8
8
|
exports.uploadAssetTask = uploadAssetTask;
|
|
9
9
|
exports.uploadAssetSpecTask = uploadAssetSpecTask;
|
|
10
10
|
exports.uploadAssetPackTask = uploadAssetPackTask;
|
|
11
|
+
const types_1 = require("@playdrop/types");
|
|
11
12
|
const node_crypto_1 = require("node:crypto");
|
|
12
13
|
const node_fs_1 = require("node:fs");
|
|
13
14
|
const node_path_1 = require("node:path");
|
|
14
|
-
const types_1 = require("@playdrop/types");
|
|
15
15
|
const model_artifacts_1 = require("../assets/model-artifacts");
|
|
16
16
|
const assetSpecs_1 = require("../assetSpecs");
|
|
17
17
|
const EXTENSION_TO_FORMAT = {
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validate = validate;
|
|
4
|
+
const types_1 = require("@playdrop/types");
|
|
4
5
|
const node_fs_1 = require("node:fs");
|
|
5
6
|
const node_path_1 = require("node:path");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
7
|
+
const apps_1 = require("../apps");
|
|
8
|
+
const assetSpecs_1 = require("../assetSpecs");
|
|
8
9
|
const commandContext_1 = require("../commandContext");
|
|
10
|
+
const externalAssetPackValidation_1 = require("../externalAssetPackValidation");
|
|
9
11
|
const taskSelection_1 = require("../taskSelection");
|
|
10
12
|
const taskUtils_1 = require("../taskUtils");
|
|
11
13
|
const uploadLog_1 = require("../uploadLog");
|
|
12
|
-
const apps_1 = require("../apps");
|
|
13
|
-
const assetSpecs_1 = require("../assetSpecs");
|
|
14
|
-
const externalAssetPackValidation_1 = require("../externalAssetPackValidation");
|
|
15
14
|
const dev_1 = require("./dev");
|
|
16
15
|
const upload_content_1 = require("./upload-content");
|
|
17
16
|
function normalizePositivePort(value) {
|
|
@@ -127,7 +126,7 @@ function resolveLocalAssetSpecTask(task, lookups) {
|
|
|
127
126
|
if (direct) {
|
|
128
127
|
return direct;
|
|
129
128
|
}
|
|
130
|
-
const parsed = (0,
|
|
129
|
+
const parsed = (0, types_1.parseAssetSpecVersionRef)(task.assetSpec);
|
|
131
130
|
if (!parsed) {
|
|
132
131
|
return null;
|
|
133
132
|
}
|
|
@@ -222,7 +221,6 @@ function formatLiveTagClearWarning(input) {
|
|
|
222
221
|
const countLabel = input.liveTagCount === 1 ? '1 existing live tag' : `${input.liveTagCount} existing live tags`;
|
|
223
222
|
return `${input.entityLabel} "${input.displayName}" would remove ${countLabel} on publish. Add a tags field or pass --clear-tags to confirm.`;
|
|
224
223
|
}
|
|
225
|
-
// eslint-disable-next-line complexity
|
|
226
224
|
async function collectLiveTagClearWarnings(tasks, workspacePath, envOverride) {
|
|
227
225
|
const context = await loadAuthenticatedValidationContext(workspacePath, envOverride);
|
|
228
226
|
if (!context) {
|
|
@@ -34,6 +34,9 @@ function tailText(value, maxChars) {
|
|
|
34
34
|
}
|
|
35
35
|
return value.slice(value.length - maxChars);
|
|
36
36
|
}
|
|
37
|
+
function throwLoggedProcessError(error) {
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
37
40
|
function readPositiveEnvInt(name, fallback) {
|
|
38
41
|
const raw = process.env[name]?.trim();
|
|
39
42
|
if (!raw) {
|
|
@@ -351,7 +354,7 @@ async function runLoggedProcess(input) {
|
|
|
351
354
|
return transcriptFlushPromise;
|
|
352
355
|
};
|
|
353
356
|
const handleTranscriptFlushError = (error) => {
|
|
354
|
-
transcriptFlushError = transcriptFlushError ?? error;
|
|
357
|
+
transcriptFlushError = transcriptFlushError ?? (error instanceof Error ? error : new Error(String(error)));
|
|
355
358
|
if (!closed) {
|
|
356
359
|
child.kill('SIGTERM');
|
|
357
360
|
}
|
|
@@ -403,7 +406,7 @@ async function runLoggedProcess(input) {
|
|
|
403
406
|
void (async () => {
|
|
404
407
|
await queueTranscriptFlush();
|
|
405
408
|
if (transcriptFlushError) {
|
|
406
|
-
|
|
409
|
+
throwLoggedProcessError(transcriptFlushError);
|
|
407
410
|
}
|
|
408
411
|
const outputTail = tailText(combined, input.maxOutputChars);
|
|
409
412
|
const tokenUsage = extractAgentTokenUsage(`${stdout}\n${stderr}\n${outputTail}`);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ApiClient } from '@playdrop/api-client';
|
|
2
|
-
import { type
|
|
2
|
+
import { type AgentExecutionTarget, type AgentRuntime, type AgentTaskKind, type AgentTaskNextStepSuggestion, type AgentTaskResponse, type AgentWorkerCapabilities, type AgentWorkerResponse, type WorkerAgentTaskAssignmentResponse, type WorkerAgentTaskBaseSourceResponse, type WorkerAgentTaskWorkspaceFileResponse, type WorkerClaimAgentTaskResponse } from '@playdrop/types';
|
|
3
3
|
import { type WorkerPlaydropAssetRequirement } from './upload';
|
|
4
4
|
import { type LoggedProcessResult, type LoggedProcessTranscriptChunk } from './worker/runtime';
|
|
5
|
-
export {
|
|
6
|
-
export type { AgentTokenUsage, LoggedProcessResult, LoggedProcessTranscriptChunk
|
|
5
|
+
export { assertWorkerTokenUsageWithinCap, buildClaudeExecArgs, buildClaudePermissionSettings, buildCodexExecArgs, buildWorkerChildEnv, DEFAULT_CODEX_TIMEOUT_MS, DEFAULT_WORKER_TOKEN_CAP, extractAgentTokenUsage, extractCodexRolloutTokenUsage, extractCodexThreadId, extractCodexTokensUsed, readCodexRolloutTokenUsageForThread, readCodexSandboxMode, readEnvBoolean, runLoggedProcess } from './worker/runtime';
|
|
6
|
+
export type { AgentTokenUsage, LoggedProcessResult, LoggedProcessTranscriptChunk } from './worker/runtime';
|
|
7
7
|
export declare const WORKER_SESSION_EXPIRED_MESSAGE = "worker session expired: run \"playdrop auth login\" and start the worker again";
|
|
8
8
|
export declare const WORKER_CONTEXT_COMMAND_NOT_ALLOWED_MESSAGE = "worker_context_command_not_allowed: inside a PlayDrop worker task only task progress, task claim-slug, task upload/done/fail, assigned app scaffolding, project validation/build/dev/capture, read-only help/catalogue/documentation lookup, and PlayDrop AI generation are permitted.";
|
|
9
9
|
type WorkerStartOptions = {
|
|
@@ -56,7 +56,7 @@ type WorkerStatusPayload = {
|
|
|
56
56
|
server: {
|
|
57
57
|
reachable: boolean;
|
|
58
58
|
authenticated: boolean;
|
|
59
|
-
worker:
|
|
59
|
+
worker: AgentWorkerResponse | null;
|
|
60
60
|
error?: string;
|
|
61
61
|
};
|
|
62
62
|
};
|
|
@@ -190,7 +190,6 @@ export declare function buildWorkerCapabilities(input: string | {
|
|
|
190
190
|
} | null;
|
|
191
191
|
maxParallelTasks?: number | null;
|
|
192
192
|
runningTaskCount?: number | null;
|
|
193
|
-
providerAccountLabel?: string | null;
|
|
194
193
|
}): AgentWorkerCapabilities;
|
|
195
194
|
export declare function buildWorkerClaimBody(input: {
|
|
196
195
|
workerKey: string;
|