@playdrop/playdrop-cli 0.17.4 → 0.17.14

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.
Files changed (81) hide show
  1. package/README.md +12 -0
  2. package/config/client-meta.json +4 -4
  3. package/dist/apps/build.d.ts +2 -1
  4. package/dist/apps/build.js +6 -2
  5. package/dist/apps/index.d.ts +2 -3
  6. package/dist/apps/index.js +17 -49
  7. package/dist/apps/loadCheck.d.ts +3 -1
  8. package/dist/apps/loadCheck.js +123 -64
  9. package/dist/apps/publishingRuntime.d.ts +18 -0
  10. package/dist/apps/publishingRuntime.js +111 -0
  11. package/dist/apps/runtimeSyntax.d.ts +7 -0
  12. package/dist/apps/runtimeSyntax.js +154 -0
  13. package/dist/apps/serverBuild.d.ts +3 -3
  14. package/dist/apps/serverBuild.js +8 -43
  15. package/dist/apps/serverSdk.d.ts +23 -0
  16. package/dist/apps/serverSdk.js +157 -0
  17. package/dist/apps/upload.d.ts +9 -3
  18. package/dist/apps/upload.js +71 -25
  19. package/dist/apps/validate.d.ts +2 -1
  20. package/dist/apps/validate.js +3 -1
  21. package/dist/assetSpecs.js +2 -0
  22. package/dist/commandContext.js +34 -10
  23. package/dist/commands/build.js +3 -1
  24. package/dist/commands/create.js +35 -16
  25. package/dist/commands/dev.js +11 -0
  26. package/dist/commands/devGameServer.d.ts +8 -0
  27. package/dist/commands/devGameServer.js +12 -9
  28. package/dist/commands/devServer.d.ts +1 -0
  29. package/dist/commands/devServer.js +21 -3
  30. package/dist/commands/source.d.ts +11 -3
  31. package/dist/commands/source.js +82 -14
  32. package/dist/commands/taskCaptureSession.d.ts +1 -1
  33. package/dist/commands/taskCaptureSession.js +1 -1
  34. package/dist/commands/upload-content.js +15 -12
  35. package/dist/commands/upload.d.ts +2 -9
  36. package/dist/commands/upload.js +5 -21
  37. package/dist/commands/validate.js +1 -1
  38. package/dist/commands/worker/classification.d.ts +1 -0
  39. package/dist/commands/worker/classification.js +57 -0
  40. package/dist/commands/worker/game-server-infra.d.ts +6 -0
  41. package/dist/commands/worker/game-server-infra.js +10 -0
  42. package/dist/commands/worker/game-source-git.d.ts +9 -1
  43. package/dist/commands/worker/game-source-git.js +65 -19
  44. package/dist/commands/worker/generation.d.ts +4 -0
  45. package/dist/commands/worker/generation.js +70 -7
  46. package/dist/commands/worker.d.ts +1 -1
  47. package/dist/commands/worker.js +57 -17
  48. package/dist/environment.d.ts +1 -0
  49. package/dist/environment.js +7 -0
  50. package/dist/index.js +10 -2
  51. package/dist/playwright.d.ts +6 -4
  52. package/dist/playwright.js +24 -9
  53. package/dist/proceduralValidation.d.ts +16 -0
  54. package/dist/proceduralValidation.js +227 -0
  55. package/dist/proceduralValidationBrowser.d.mts +3 -0
  56. package/dist/proceduralValidationBrowser.mjs +67 -0
  57. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
  58. package/node_modules/@playdrop/api-client/dist/domains/apps.js +11 -1
  59. package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +6 -1
  60. package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
  61. package/node_modules/@playdrop/api-client/dist/domains/chat.js +13 -1
  62. package/node_modules/@playdrop/config/client-meta.json +4 -4
  63. package/node_modules/@playdrop/procedural/dist/index.d.ts +201 -0
  64. package/node_modules/@playdrop/procedural/dist/index.d.ts.map +1 -0
  65. package/node_modules/@playdrop/procedural/dist/index.js +763 -0
  66. package/node_modules/@playdrop/procedural/package.json +36 -0
  67. package/node_modules/@playdrop/types/dist/agent-task-classification.d.ts +68 -0
  68. package/node_modules/@playdrop/types/dist/agent-task-classification.d.ts.map +1 -0
  69. package/node_modules/@playdrop/types/dist/agent-task-classification.js +96 -0
  70. package/node_modules/@playdrop/types/dist/api.d.ts +39 -4
  71. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  72. package/node_modules/@playdrop/types/dist/chat.d.ts +7 -1
  73. package/node_modules/@playdrop/types/dist/chat.d.ts.map +1 -1
  74. package/node_modules/@playdrop/types/dist/index.d.ts +1 -0
  75. package/node_modules/@playdrop/types/dist/index.d.ts.map +1 -1
  76. package/node_modules/@playdrop/types/dist/index.js +2 -0
  77. package/node_modules/@playdrop/types/dist/social.d.ts +20 -0
  78. package/node_modules/@playdrop/types/dist/social.d.ts.map +1 -1
  79. package/node_modules/@playdrop/types/dist/version.d.ts +2 -0
  80. package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
  81. package/package.json +7 -4
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@playdrop/procedural",
3
+ "version": "0.1.3",
4
+ "description": "PlayDrop procedural Three.js asset contract and validators",
5
+ "type": "commonjs",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "development": "./src/index.ts",
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "src"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc -p tsconfig.json",
22
+ "dev": "tsc -p tsconfig.json --watch",
23
+ "test": "node --test --import tsx test/*.test.ts",
24
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
25
+ },
26
+ "peerDependencies": {
27
+ "three": "0.183.2"
28
+ },
29
+ "devDependencies": {
30
+ "@types/node": "^20.10.0",
31
+ "@types/three": "^0.183.0",
32
+ "three": "0.183.2",
33
+ "tsx": "^4.21.0",
34
+ "typescript": "^5.3.3"
35
+ }
36
+ }
@@ -0,0 +1,68 @@
1
+ /** Descriptive screening metadata. Never use this to route, bill or version a task. */
2
+ export declare const AGENT_TASK_CLASSIFICATION_CATEGORIES: {
3
+ readonly question: readonly ["game_explanation", "capabilities"];
4
+ readonly game_work: readonly ["validation", "technical_fix", "visual_fix", "visual_polish", "gameplay_polish", "new_game", "feature", "refactor", "listing_marketing"];
5
+ readonly reject: readonly ["private_information", "content_policy", "exact_copy", "asset_theft", "unrelated", "unclear"];
6
+ };
7
+ export declare const AGENT_TASK_CLASSIFICATION_EFFORTS: readonly ["simple", "standard", "complex", "extra_ambitious"];
8
+ export declare const AGENT_TASK_CLASSIFICATION_MIN_CLI = "0.17.5";
9
+ export declare const AGENT_TASK_CLASSIFICATION_PROMPT_VERSION = 1;
10
+ export interface AgentTaskClassification {
11
+ type: keyof typeof AGENT_TASK_CLASSIFICATION_CATEGORIES;
12
+ category: (typeof AGENT_TASK_CLASSIFICATION_CATEGORIES)[keyof typeof AGENT_TASK_CLASSIFICATION_CATEGORIES][number];
13
+ effort: (typeof AGENT_TASK_CLASSIFICATION_EFFORTS)[number] | null;
14
+ flags: string[];
15
+ reason: string;
16
+ promptLanguage: string;
17
+ promptEnglishTranslation: string;
18
+ }
19
+ export declare const AGENT_TASK_CLASSIFICATION_SCHEMA: {
20
+ anyOf: {
21
+ type: string;
22
+ additionalProperties: boolean;
23
+ required: string[];
24
+ properties: {
25
+ type: {
26
+ type: string;
27
+ enum: string[];
28
+ };
29
+ category: {
30
+ type: string;
31
+ enum: ("game_explanation" | "capabilities" | "validation" | "technical_fix" | "visual_fix" | "visual_polish" | "gameplay_polish" | "new_game" | "feature" | "refactor" | "listing_marketing" | "private_information" | "content_policy" | "exact_copy" | "asset_theft" | "unrelated" | "unclear")[];
32
+ };
33
+ effort: {
34
+ type: string;
35
+ enum?: never;
36
+ } | {
37
+ type: string;
38
+ enum: ("simple" | "standard" | "complex" | "extra_ambitious")[];
39
+ };
40
+ flags: {
41
+ type: string;
42
+ maxItems: number;
43
+ items: {
44
+ type: string;
45
+ maxLength: number;
46
+ pattern: string;
47
+ };
48
+ };
49
+ reason: {
50
+ type: string;
51
+ minLength: number;
52
+ maxLength: number;
53
+ };
54
+ promptLanguage: {
55
+ type: string;
56
+ minLength: number;
57
+ maxLength: number;
58
+ };
59
+ promptEnglishTranslation: {
60
+ type: string;
61
+ minLength: number;
62
+ maxLength: number;
63
+ };
64
+ };
65
+ }[];
66
+ };
67
+ export declare function normalizeAgentTaskClassification(value: unknown): AgentTaskClassification | null;
68
+ //# sourceMappingURL=agent-task-classification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-task-classification.d.ts","sourceRoot":"","sources":["../src/agent-task-classification.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,eAAO,MAAM,oCAAoC;;;;CAIvC,CAAC;AACX,eAAO,MAAM,iCAAiC,+DAAgE,CAAC;AAC/G,eAAO,MAAM,iCAAiC,WAAW,CAAC;AAC1D,eAAO,MAAM,wCAAwC,IAAI,CAAC;AAE1D,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,OAAO,oCAAoC,CAAC;IACxD,QAAQ,EAAE,CAAC,OAAO,oCAAoC,CAAC,CAAC,MAAM,OAAO,oCAAoC,CAAC,CAAC,MAAM,CAAC,CAAC;IACnH,MAAM,EAAE,CAAC,OAAO,iCAAiC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAClE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,wBAAwB,EAAE,MAAM,CAAC;CAClC;AAED,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe5C,CAAC;AAEF,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI,CAwB/F"}
@@ -0,0 +1,96 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var agent_task_classification_exports = {};
19
+ __export(agent_task_classification_exports, {
20
+ AGENT_TASK_CLASSIFICATION_CATEGORIES: () => AGENT_TASK_CLASSIFICATION_CATEGORIES,
21
+ AGENT_TASK_CLASSIFICATION_EFFORTS: () => AGENT_TASK_CLASSIFICATION_EFFORTS,
22
+ AGENT_TASK_CLASSIFICATION_MIN_CLI: () => AGENT_TASK_CLASSIFICATION_MIN_CLI,
23
+ AGENT_TASK_CLASSIFICATION_PROMPT_VERSION: () => AGENT_TASK_CLASSIFICATION_PROMPT_VERSION,
24
+ AGENT_TASK_CLASSIFICATION_SCHEMA: () => AGENT_TASK_CLASSIFICATION_SCHEMA,
25
+ normalizeAgentTaskClassification: () => normalizeAgentTaskClassification
26
+ });
27
+ module.exports = __toCommonJS(agent_task_classification_exports);
28
+ const AGENT_TASK_CLASSIFICATION_CATEGORIES = {
29
+ question: ["game_explanation", "capabilities"],
30
+ game_work: ["validation", "technical_fix", "visual_fix", "visual_polish", "gameplay_polish", "new_game", "feature", "refactor", "listing_marketing"],
31
+ reject: ["private_information", "content_policy", "exact_copy", "asset_theft", "unrelated", "unclear"]
32
+ };
33
+ const AGENT_TASK_CLASSIFICATION_EFFORTS = ["simple", "standard", "complex", "extra_ambitious"];
34
+ const AGENT_TASK_CLASSIFICATION_MIN_CLI = "0.17.5";
35
+ const AGENT_TASK_CLASSIFICATION_PROMPT_VERSION = 1;
36
+ const AGENT_TASK_CLASSIFICATION_SCHEMA = {
37
+ anyOf: Object.entries(AGENT_TASK_CLASSIFICATION_CATEGORIES).map(([type, categories]) => ({
38
+ type: "object",
39
+ additionalProperties: false,
40
+ required: ["type", "category", "effort", "flags", "reason", "promptLanguage", "promptEnglishTranslation"],
41
+ properties: {
42
+ type: { type: "string", enum: [type] },
43
+ category: { type: "string", enum: [...categories] },
44
+ effort: type === "reject" ? { type: "null" } : { type: "string", enum: [...AGENT_TASK_CLASSIFICATION_EFFORTS] },
45
+ flags: { type: "array", maxItems: 12, items: { type: "string", maxLength: 80, pattern: "^[A-Z][A-Z0-9_]*$" } },
46
+ reason: { type: "string", minLength: 1, maxLength: 600 },
47
+ promptLanguage: { type: "string", minLength: 2, maxLength: 35 },
48
+ promptEnglishTranslation: { type: "string", minLength: 1, maxLength: 1e5 }
49
+ }
50
+ }))
51
+ };
52
+ function normalizeAgentTaskClassification(value) {
53
+ if (!value || typeof value !== "object" || Array.isArray(value))
54
+ return null;
55
+ const { type, category, effort, flags, reason, promptLanguage, promptEnglishTranslation } = value;
56
+ if (type !== "question" && type !== "game_work" && type !== "reject")
57
+ return null;
58
+ const categories = AGENT_TASK_CLASSIFICATION_CATEGORIES[type];
59
+ if (typeof category !== "string" || !categories.includes(category))
60
+ return null;
61
+ const efforts = AGENT_TASK_CLASSIFICATION_EFFORTS;
62
+ if (type === "reject" ? effort !== null : !efforts.includes(effort))
63
+ return null;
64
+ if (!Array.isArray(flags) || flags.length > 12 || flags.some((flag) => typeof flag !== "string" || flag.length > 80 || !/^[A-Z][A-Z0-9_]*$/.test(flag)))
65
+ return null;
66
+ if (typeof reason !== "string" || !reason.trim() || reason.length > 600)
67
+ return null;
68
+ if (typeof promptEnglishTranslation !== "string" || !promptEnglishTranslation.trim() || promptEnglishTranslation.length > 1e5)
69
+ return null;
70
+ if (typeof promptLanguage !== "string" || promptLanguage.length > 35)
71
+ return null;
72
+ try {
73
+ if (Intl.getCanonicalLocales(promptLanguage).length !== 1)
74
+ return null;
75
+ } catch {
76
+ return null;
77
+ }
78
+ return {
79
+ type,
80
+ category,
81
+ effort,
82
+ flags: [...flags],
83
+ reason,
84
+ promptLanguage,
85
+ promptEnglishTranslation
86
+ };
87
+ }
88
+ // Annotate the CommonJS export names for ESM import in node:
89
+ 0 && (module.exports = {
90
+ AGENT_TASK_CLASSIFICATION_CATEGORIES,
91
+ AGENT_TASK_CLASSIFICATION_EFFORTS,
92
+ AGENT_TASK_CLASSIFICATION_MIN_CLI,
93
+ AGENT_TASK_CLASSIFICATION_PROMPT_VERSION,
94
+ AGENT_TASK_CLASSIFICATION_SCHEMA,
95
+ normalizeAgentTaskClassification
96
+ });
@@ -639,6 +639,8 @@ export interface AgentTaskResponseBase {
639
639
  usesFreeCloudGeneration: boolean;
640
640
  refund: AgentTaskRefundResponse | null;
641
641
  payload?: {
642
+ classification?: import("./agent-task-classification.js").AgentTaskClassification;
643
+ classificationPromptVersion?: number;
642
644
  safety?: Record<string, unknown>;
643
645
  model?: string;
644
646
  [key: string]: unknown;
@@ -1367,15 +1369,19 @@ export interface WorkerPrepareGameSourceResponse {
1367
1369
  previousUpload: WorkerPrivateObjectUploadV1 | null;
1368
1370
  };
1369
1371
  }
1370
- export interface WorkerReadGameSourceFilesRequest {
1371
- workerKey: string;
1372
- leaseToken: string;
1372
+ export type WorkerReadGameSourceFilesRequest = {
1373
1373
  files: Array<{
1374
1374
  sha256: string;
1375
1375
  bytes: number;
1376
1376
  key: string;
1377
1377
  }>;
1378
- }
1378
+ } & ({
1379
+ workerKey: string;
1380
+ leaseToken: string;
1381
+ } | {
1382
+ workerKey?: never;
1383
+ leaseToken?: never;
1384
+ });
1379
1385
  export interface WorkerReadGameSourceFilesResponse {
1380
1386
  files: Array<{
1381
1387
  sha256: string;
@@ -1962,6 +1968,7 @@ export interface CreationGameVersionSummary {
1962
1968
  export interface CreationGameListItem {
1963
1969
  gameRef: string;
1964
1970
  appName?: string;
1971
+ publicationKind?: AppPublicationKind;
1965
1972
  displayName: string;
1966
1973
  subtitle?: string | null;
1967
1974
  primarySurface?: AppSurface | null;
@@ -2117,16 +2124,37 @@ export interface CreationConversationResponse {
2117
2124
  gameRef: string;
2118
2125
  canonicalGameRef: string;
2119
2126
  appName?: string;
2127
+ publicationKind?: AppPublicationKind;
2120
2128
  displayName?: string;
2121
2129
  gameTitle?: string;
2122
2130
  subtitle?: string | null;
2123
2131
  primarySurface?: AppSurface | null;
2124
2132
  detailAvailable: boolean;
2133
+ /** Latest unarchived private version, including drafts without a completed task response. */
2134
+ latestDraftVersionId: number | null;
2125
2135
  items: CreationConversationItem[];
2126
2136
  earlierCursor: string | null;
2127
2137
  syncCursor?: string;
2138
+ /** Creation transport cursor captured before loading this snapshot. */
2139
+ eventVersion: string;
2128
2140
  now: string;
2129
2141
  }
2142
+ export type CreationConversationMetadata = Omit<CreationConversationResponse, "items" | "earlierCursor" | "syncCursor" | "eventVersion">;
2143
+ export type CreationRealtimeUpdate = {
2144
+ kind: "task.updated";
2145
+ gameRef: string;
2146
+ taskId: number;
2147
+ attempt: number;
2148
+ item: CreationTaskItem;
2149
+ } | {
2150
+ kind: "task.changed";
2151
+ gameRef: string;
2152
+ taskId: number;
2153
+ attempt: number;
2154
+ items: CreationConversationItem[];
2155
+ game: CreationGameListItem | null;
2156
+ conversation: CreationConversationMetadata;
2157
+ };
2130
2158
  export interface WorkerAgentTaskMaterialResponse {
2131
2159
  material: CreationTaskMaterial;
2132
2160
  }
@@ -2253,6 +2281,9 @@ export interface HomeAppCardSummary {
2253
2281
  authMode?: AppAuthMode;
2254
2282
  controllerMode?: AppControllerMode;
2255
2283
  assetUrl: string | null;
2284
+ /** Preview launch fields included for native mobile clients. */
2285
+ previewable?: boolean;
2286
+ entryPoint?: string | null;
2256
2287
  surfaceTargets?: AppSurface[];
2257
2288
  heroPortraitUrl?: string | null;
2258
2289
  heroLandscapeUrl?: string | null;
@@ -3765,6 +3796,7 @@ export interface CreatorChallengeState {
3765
3796
  }
3766
3797
  export interface FreeCreditsResponse {
3767
3798
  items: FreeCreditObjectiveSummary[];
3799
+ claimedCredits: number;
3768
3800
  unclaimedCount: number;
3769
3801
  inviteCode: string | null;
3770
3802
  inviteUrlPath: string | null;
@@ -3798,6 +3830,7 @@ export interface ClaimFreeCreditRewardResponse {
3798
3830
  rewardCredits: number;
3799
3831
  transactionId: number | null;
3800
3832
  creditBalance: number;
3833
+ claimedCredits: number;
3801
3834
  unclaimedCount: number;
3802
3835
  objectiveSummary: FreeCreditObjectiveSummary;
3803
3836
  counterpartUser: InviteUserSummary | null;
@@ -3828,6 +3861,7 @@ export interface SubmitCreatorSurveyResponse {
3828
3861
  rewardCredits: number;
3829
3862
  transactionId: number;
3830
3863
  creditBalance: number;
3864
+ claimedCredits: number;
3831
3865
  unclaimedCount: number;
3832
3866
  inviteCode: string;
3833
3867
  inviteUrlPath: string;
@@ -4161,6 +4195,7 @@ export interface HomeCollectionPageResponse {
4161
4195
  section: "games";
4162
4196
  collection: HomeCollection;
4163
4197
  pagination: PaginationMeta;
4198
+ acquisitionFeed?: AcquisitionFeedAcknowledgement;
4164
4199
  }
4165
4200
  export interface CreatorsListResponse {
4166
4201
  creators: HomeCreatorResponse[];