@playdrop/playdrop-cli 0.9.6 → 0.10.1

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 (73) hide show
  1. package/config/client-meta.json +2 -2
  2. package/dist/apiClient.d.ts +10 -0
  3. package/dist/apiClient.js +55 -2
  4. package/dist/appUrls.d.ts +1 -0
  5. package/dist/appUrls.js +9 -0
  6. package/dist/apps/build.js +39 -28
  7. package/dist/apps/index.d.ts +1 -0
  8. package/dist/apps/index.js +2 -0
  9. package/dist/apps/launchCheck.d.ts +2 -0
  10. package/dist/apps/launchCheck.js +31 -6
  11. package/dist/apps/registration.d.ts +1 -0
  12. package/dist/apps/registration.js +1 -0
  13. package/dist/apps/upload.d.ts +1 -0
  14. package/dist/apps/upload.js +4 -17
  15. package/dist/captureRuntime.d.ts +14 -0
  16. package/dist/captureRuntime.js +329 -0
  17. package/dist/catalogue.d.ts +4 -2
  18. package/dist/catalogue.js +50 -7
  19. package/dist/commandContext.js +61 -4
  20. package/dist/commands/capture.d.ts +1 -0
  21. package/dist/commands/capture.js +30 -13
  22. package/dist/commands/captureRemote.d.ts +2 -0
  23. package/dist/commands/captureRemote.js +90 -0
  24. package/dist/commands/create.d.ts +0 -1
  25. package/dist/commands/create.js +2 -151
  26. package/dist/commands/creations.d.ts +0 -13
  27. package/dist/commands/creations.js +0 -141
  28. package/dist/commands/dev.d.ts +2 -1
  29. package/dist/commands/dev.js +23 -6
  30. package/dist/commands/devServer.js +3 -1
  31. package/dist/commands/generation.d.ts +1 -0
  32. package/dist/commands/generation.js +274 -0
  33. package/dist/commands/review.d.ts +46 -0
  34. package/dist/commands/review.js +353 -0
  35. package/dist/commands/upload.d.ts +27 -1
  36. package/dist/commands/upload.js +962 -21
  37. package/dist/commands/validate.js +5 -0
  38. package/dist/commands/worker/runtime.d.ts +81 -0
  39. package/dist/commands/worker/runtime.js +458 -0
  40. package/dist/commands/worker.d.ts +158 -0
  41. package/dist/commands/worker.js +2626 -0
  42. package/dist/config.d.ts +2 -0
  43. package/dist/config.js +23 -0
  44. package/dist/index.js +116 -30
  45. package/dist/shellProbe.d.ts +1 -1
  46. package/dist/shellProbe.js +3 -3
  47. package/dist/workspaceAuth.d.ts +3 -0
  48. package/dist/workspaceAuth.js +14 -0
  49. package/node_modules/@playdrop/api-client/dist/client.d.ts +36 -15
  50. package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
  51. package/node_modules/@playdrop/api-client/dist/client.js +2 -2
  52. package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +5 -2
  53. package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
  54. package/node_modules/@playdrop/api-client/dist/domains/admin.js +51 -3
  55. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +75 -0
  56. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -0
  57. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +478 -0
  58. package/node_modules/@playdrop/api-client/dist/index.d.ts +36 -15
  59. package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
  60. package/node_modules/@playdrop/api-client/dist/index.js +153 -42
  61. package/node_modules/@playdrop/config/client-meta.json +2 -2
  62. package/node_modules/@playdrop/types/dist/api.d.ts +662 -75
  63. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  64. package/node_modules/@playdrop/types/dist/api.js +100 -9
  65. package/node_modules/@playdrop/types/dist/app.d.ts +2 -0
  66. package/node_modules/@playdrop/types/dist/app.d.ts.map +1 -1
  67. package/node_modules/@playdrop/types/dist/app.js +3 -0
  68. package/node_modules/@playdrop/types/dist/version.d.ts +1 -0
  69. package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
  70. package/package.json +2 -1
  71. package/node_modules/@playdrop/api-client/dist/domains/game-ideas.d.ts +0 -46
  72. package/node_modules/@playdrop/api-client/dist/domains/game-ideas.d.ts.map +0 -1
  73. package/node_modules/@playdrop/api-client/dist/domains/game-ideas.js +0 -177
@@ -1,13 +1,14 @@
1
- import type { AppType, AppSurface } from './app.js';
1
+ import type { AppOrigin, AppType, AppSurface } from './app.js';
2
2
  import type { AppAuthFilter, AppControllerFilter, AppSurfaceFilter } from './app-capability-filters.js';
3
3
  import type { ContentLicense, ContentPermissions } from './content-license.js';
4
- import type { AppAuthMode, AppControllerMode, AppHostingMode, ReviewState, AppVersionVisibility } from './version.js';
4
+ import type { AppAuthMode, AppControllerMode, AppHostingMode, ReviewState, AppVersionResponse, AppVersionSummary, AppVersionVisibility } from './version.js';
5
5
  import type { AssetCategory, AssetResponse } from './asset.js';
6
6
  import type { AppMetadataAssetSpecSupport, AssetSpecListResponse, AssetSpecResponse, AssetSpecSearchResult, AssetSpecVersionResponse, AssetSpecVersionsListResponse } from './asset-spec.js';
7
7
  import type { AssetPackResponse } from './asset-pack.js';
8
8
  export interface CreateAppRequest {
9
9
  name: string;
10
10
  displayName?: string;
11
+ agentTaskId?: number;
11
12
  }
12
13
  export interface UpdateAppRequest {
13
14
  displayName?: string;
@@ -88,11 +89,11 @@ export interface SetProfileAssetRequest {
88
89
  export interface SetProfileAssetResponse {
89
90
  selectedProfileAssetRef: string;
90
91
  }
91
- export declare const CREATOR_FUNNEL_EVENT_NAMES: readonly ["creator_landed", "sign_up", "creator_signup_provider_selected", "creator_agent_selected", "creator_install_prompt_copied", "creator_install_prompt_sent", "creator_cli_connected", "creator_create_unlocked", "creator_create_option_selected", "creator_agent_prompt_copied", "creator_agent_deep_link_retried", "game_idea_created", "creator_game_registered", "creator_game_uploaded"];
92
+ export declare const CREATOR_FUNNEL_EVENT_NAMES: readonly ["creator_landed", "sign_up", "creator_signup_provider_selected", "creator_agent_selected", "creator_install_prompt_copied", "creator_install_prompt_sent", "creator_cli_connected", "creator_create_unlocked", "creator_create_option_selected", "creator_agent_prompt_copied", "creator_agent_deep_link_retried", "creator_game_registered", "creator_game_uploaded"];
92
93
  export type CreatorFunnelEventName = typeof CREATOR_FUNNEL_EVENT_NAMES[number];
93
- export declare const CREATOR_FUNNEL_SOURCE_SURFACES: readonly ["home", "dream_team", "create", "getting_started", "signup", "game_idea", "cli", "api"];
94
+ export declare const CREATOR_FUNNEL_SOURCE_SURFACES: readonly ["home", "dream_team", "create", "getting_started", "signup", "cli", "api"];
94
95
  export type CreatorFunnelSourceSurface = typeof CREATOR_FUNNEL_SOURCE_SURFACES[number];
95
- export declare const CREATOR_CREATE_MODES: readonly ["agent", "guided", "remix"];
96
+ export declare const CREATOR_CREATE_MODES: readonly ["agent", "scratch", "guided", "remix"];
96
97
  export type CreatorCreateMode = typeof CREATOR_CREATE_MODES[number];
97
98
  export declare const CREATOR_FUNNEL_AI_AGENTS: readonly ["CODEX", "CLAUDE_CODE", "OTHER"];
98
99
  export type CreatorFunnelAiAgent = typeof CREATOR_FUNNEL_AI_AGENTS[number];
@@ -108,100 +109,566 @@ export interface ContentTagSummary {
108
109
  slug: string;
109
110
  displayName: string;
110
111
  }
111
- export declare const GAME_IDEA_STATE_VALUES: readonly ["IDEA", "STARTED", "SHIPPED"];
112
- export type GameIdeaState = typeof GAME_IDEA_STATE_VALUES[number];
113
- export declare const GAME_IDEA_INPUT_MODE_VALUES: readonly ["SCRATCH", "WIZARD", "REMIX"];
114
- export type GameIdeaInputMode = typeof GAME_IDEA_INPUT_MODE_VALUES[number];
115
- export interface GameIdeaResponse {
112
+ export declare const AGENT_TASK_STATUS_VALUES: readonly ["QUEUED", "RUNNING", "DONE", "FAILED", "CANCELLED"];
113
+ export type AgentTaskStatus = typeof AGENT_TASK_STATUS_VALUES[number];
114
+ export declare const AGENT_TASK_KIND_VALUES: readonly ["NEW_GAME", "GAME_UPDATE", "GAME_REVIEW"];
115
+ export type AgentTaskKind = typeof AGENT_TASK_KIND_VALUES[number];
116
+ export declare const AGENT_EXECUTION_TARGET_VALUES: readonly ["FIRST_PARTY", "PERSONAL"];
117
+ export type AgentExecutionTarget = typeof AGENT_EXECUTION_TARGET_VALUES[number];
118
+ export declare const GAME_CREATION_SOURCE_VALUES: readonly ["playdrop_cloud", "my_agent", "direct_upload"];
119
+ export type GameCreationSource = typeof GAME_CREATION_SOURCE_VALUES[number];
120
+ export declare const GAME_CREATION_SOURCE_LABELS: Record<GameCreationSource, string>;
121
+ export declare const AGENT_TASK_PROMPT_MIN_LENGTH = 4;
122
+ export declare const AGENT_TASK_PROMPT_MAX_LENGTH = 100000;
123
+ export declare const AGENT_RUNTIME_VALUES: readonly ["CODEX", "CLAUDE_CODE"];
124
+ export type AgentRuntime = typeof AGENT_RUNTIME_VALUES[number];
125
+ export declare const AGENT_TASK_CODEX_MODEL_VALUES: readonly ["gpt-5.5-low", "gpt-5.5-medium", "gpt-5.5-high", "gpt-5.5-extra-high"];
126
+ export type AgentTaskCodexModel = typeof AGENT_TASK_CODEX_MODEL_VALUES[number];
127
+ export declare const AGENT_TASK_CLAUDE_CODE_MODEL_VALUES: readonly ["claude-haiku-4-5", "claude-sonnet-4-6", "claude-opus-4-8"];
128
+ export type AgentTaskClaudeCodeModel = typeof AGENT_TASK_CLAUDE_CODE_MODEL_VALUES[number];
129
+ export declare const AGENT_TASK_MODEL_VALUES_BY_AGENT: Record<AgentRuntime, readonly string[]>;
130
+ export declare function normalizeAgentTaskModel(agent: AgentRuntime, model: string): string | null;
131
+ export declare const AGENT_TASK_EFFORT_VALUES: readonly ["simple", "standard", "complex"];
132
+ export type AgentTaskEffort = typeof AGENT_TASK_EFFORT_VALUES[number];
133
+ export declare const AGENT_TASK_EFFORT_KIND_VALUES: readonly ["BUILD_COMPLEXITY", "CHANGE_MAGNITUDE"];
134
+ export type AgentTaskEffortKind = typeof AGENT_TASK_EFFORT_KIND_VALUES[number];
135
+ export declare const AGENT_TASK_EVENT_KIND_VALUES: readonly ["progress", "agent_message", "system", "catalogue_preview"];
136
+ export type AgentTaskEventKind = typeof AGENT_TASK_EVENT_KIND_VALUES[number];
137
+ export declare const AGENT_TASK_TRANSCRIPT_STREAM_VALUES: readonly ["stdout", "stderr", "combined"];
138
+ export type AgentTaskTranscriptStream = typeof AGENT_TASK_TRANSCRIPT_STREAM_VALUES[number];
139
+ export interface AgentWorkerCapabilities {
140
+ supportedKinds: AgentTaskKind[];
141
+ maxParallelTasks: number;
142
+ runningTaskCount: number;
143
+ cliVersion?: string;
144
+ codexVersion?: string;
145
+ nodeVersion?: string;
146
+ npmVersion?: string;
147
+ playwright?: {
148
+ version?: string;
149
+ chromiumInstalled?: boolean;
150
+ };
151
+ agents: Array<{
152
+ agent: AgentRuntime;
153
+ cliVersion?: string;
154
+ authenticated?: boolean;
155
+ pluginVersion?: string;
156
+ models?: string[];
157
+ ready?: boolean;
158
+ }>;
159
+ ready?: boolean;
160
+ degradedReasons?: string[];
161
+ os?: string;
162
+ arch?: string;
163
+ [key: string]: unknown;
164
+ }
165
+ export interface AgentWorkerResponse {
116
166
  id: number;
117
- state: GameIdeaState;
118
- inputMode: GameIdeaInputMode;
119
- slug: string;
120
- displayName: string;
121
- tagRefs: string[];
122
- tags: ContentTagSummary[];
123
- imageStorageKey: string | null;
124
- imageUrl: string | null;
125
- inputData: Record<string, unknown>;
126
- generatedData: Record<string, unknown> | null;
127
- generatedWithPlatformVersion: string;
128
- createdAppRef: string | null;
129
- startedAt: string | null;
130
- shippedAt: string | null;
167
+ workerKey: string;
168
+ name: string;
169
+ environment: string;
170
+ capabilities: AgentWorkerCapabilities | null;
171
+ lastSeenAt: string;
172
+ online: boolean;
131
173
  createdAt: string;
132
174
  updatedAt: string;
133
175
  }
134
- export interface GameIdeaStatusSummary {
176
+ export interface AgentTaskEnrichmentResponse {
177
+ title: string | null;
178
+ summary: string | null;
179
+ safetyFlags: string[];
180
+ }
181
+ export interface AgentTaskAgentModelSelection {
182
+ agent: AgentRuntime;
183
+ model: string;
184
+ }
185
+ export interface AgentTaskAgentModelOption extends AgentTaskAgentModelSelection {
186
+ label: string;
187
+ onlineWorkers: number;
188
+ }
189
+ export interface AgentTaskRefundResponse {
190
+ state: 'refunded' | 'withheld';
191
+ credits: number;
192
+ note: string;
193
+ }
194
+ export interface AgentTaskResponse {
135
195
  id: number;
136
- state: GameIdeaState;
137
- inputMode: GameIdeaInputMode;
138
- slug: string;
139
- displayName: string;
140
- inputData: Record<string, unknown>;
141
- generatedData: Record<string, unknown> | null;
142
- createdAppRef: string | null;
196
+ kind: AgentTaskKind;
197
+ status: AgentTaskStatus;
198
+ executionTarget: AgentExecutionTarget;
199
+ agent: AgentRuntime;
200
+ model: string;
201
+ effort: AgentTaskEffort;
202
+ effortKind: AgentTaskEffortKind;
203
+ appOrigin: AppOrigin | null;
204
+ outputVersion: string | null;
205
+ userInput: string | null;
206
+ enrichment: AgentTaskEnrichmentResponse | null;
207
+ creatorId?: number;
208
+ creatorUsername?: string | null;
209
+ baseAppId: number | null;
210
+ baseAppVersionId: number | null;
211
+ appId: number | null;
212
+ appVersionId: number | null;
213
+ costCredits: number;
214
+ refund: AgentTaskRefundResponse | null;
215
+ payload?: {
216
+ safety?: Record<string, unknown>;
217
+ model?: string;
218
+ [key: string]: unknown;
219
+ };
220
+ result: Record<string, unknown> | null;
221
+ error: string | null;
222
+ workerId?: number | null;
223
+ workerName?: string | null;
224
+ lastHeartbeatAt: string | null;
225
+ cancelRequestedAt: string | null;
226
+ attempts: number;
227
+ queuePosition: number | null;
228
+ tokensUsed: number | null;
229
+ latestCataloguePreviewEvent?: AgentTaskEventResponse | null;
230
+ createdAt: string;
143
231
  startedAt: string | null;
144
- shippedAt: string | null;
232
+ completedAt: string | null;
145
233
  updatedAt: string;
146
234
  }
147
- export interface GameIdeaStatusResponse {
148
- gameIdea: GameIdeaStatusSummary;
149
- app: AppResponse | null;
235
+ export interface AgentTaskEventResponse {
236
+ id: number;
237
+ taskId: number;
238
+ attempt: number;
239
+ kind: AgentTaskEventKind;
240
+ phase: string | null;
241
+ message: string;
242
+ pct: number | null;
243
+ payload?: Record<string, unknown> | null;
244
+ createdAt: string;
150
245
  }
151
- export interface CreateGameIdeaRequest {
152
- inputMode: GameIdeaInputMode;
153
- inputData: Record<string, unknown>;
154
- tagRefs?: string[];
246
+ export interface AgentTaskTranscriptChunkResponse {
247
+ id: number;
248
+ taskId: number;
249
+ attempt: number;
250
+ sequence: number;
251
+ stream: AgentTaskTranscriptStream;
252
+ content: string;
253
+ workerId: number | null;
254
+ createdAt: string;
155
255
  }
156
- export interface CreateGameIdeaResponse {
157
- gameIdea: GameIdeaResponse;
158
- usage: {
159
- dailyLimit: number;
160
- count: number;
161
- remaining: number;
256
+ export interface AgentTaskAttachmentInput {
257
+ id: string;
258
+ fileName: string;
259
+ contentType: string;
260
+ storageKey?: string;
261
+ sizeBytes: number;
262
+ description?: string | null;
263
+ }
264
+ export interface AgentTaskAttachmentUploadResponse {
265
+ attachment: AgentTaskAttachmentInput;
266
+ }
267
+ export type AgentTaskInputKind = 'prompt' | 'MEDIA' | 'GAME_PLAN' | 'REFERENCE_GAME' | 'REFERENCE_ASSET' | 'REFERENCE_PACK';
268
+ export type GamePlanQuestionId = 'graphics' | 'surface_targets' | 'genre' | 'theme' | 'controls' | 'player_goal' | 'challenge' | 'first_version_scope' | 'notes';
269
+ export type GamePlanQuestionKind = 'SINGLE_CHOICE' | 'MULTI_CHOICE' | 'TEXT';
270
+ export interface GamePlanSelectedOption {
271
+ optionId: string;
272
+ optionLabel: string;
273
+ answer: string;
274
+ }
275
+ export interface GamePlanAnswerInput {
276
+ questionId: GamePlanQuestionId;
277
+ label: string;
278
+ kind: GamePlanQuestionKind;
279
+ selectedOptions?: GamePlanSelectedOption[];
280
+ answer?: string;
281
+ }
282
+ export interface AgentTaskInputBase {
283
+ id?: string;
284
+ kind: AgentTaskInputKind;
285
+ note?: string | null;
286
+ }
287
+ export interface AgentTaskPromptInput extends AgentTaskInputBase {
288
+ kind: 'prompt';
289
+ text?: string | null;
290
+ }
291
+ export interface AgentTaskMediaInput extends AgentTaskInputBase {
292
+ kind: 'MEDIA';
293
+ media: AgentTaskAttachmentInput;
294
+ }
295
+ export interface AgentTaskGamePlanInput extends AgentTaskInputBase {
296
+ kind: 'GAME_PLAN';
297
+ gamePlan: {
298
+ answers: GamePlanAnswerInput[];
162
299
  };
163
300
  }
164
- export interface UpdateGameIdeaRequest {
165
- displayName?: string;
166
- tagRefs?: string[];
167
- inputData?: Record<string, unknown>;
168
- generatedData?: Record<string, unknown> | null;
301
+ export interface AgentTaskReferenceInput extends AgentTaskInputBase {
302
+ kind: 'REFERENCE_GAME' | 'REFERENCE_ASSET' | 'REFERENCE_PACK';
303
+ reference: {
304
+ ref: string;
305
+ creatorUsername?: string | null;
306
+ name?: string | null;
307
+ version?: string | null;
308
+ displayName?: string | null;
309
+ };
169
310
  }
170
- export interface UpdateGameIdeaResponse {
171
- gameIdea: GameIdeaResponse;
311
+ export type AgentTaskInput = AgentTaskPromptInput | AgentTaskMediaInput | AgentTaskGamePlanInput | AgentTaskReferenceInput;
312
+ export interface CreateNewGameAgentTaskRequest {
313
+ target: AgentExecutionTarget;
314
+ agent: AgentRuntime;
315
+ model: string;
316
+ prompt: string;
317
+ inputs?: AgentTaskInput[];
318
+ notifyOnReady?: boolean;
172
319
  }
173
- export interface GameIdeasListRequest {
174
- state?: GameIdeaState | 'ALL';
175
- limit?: number;
176
- offset?: number;
320
+ export interface CreateNewGameAgentTaskResponse {
321
+ task: AgentTaskResponse;
322
+ events: AgentTaskEventResponse[];
323
+ }
324
+ export interface AgentTaskDetailResponse {
325
+ task: AgentTaskResponse;
177
326
  }
178
- export interface GameIdeasListResponse {
179
- gameIdeas: GameIdeaResponse[];
327
+ export type EnableAgentTaskReadyNotificationResponse = AgentTaskDetailResponse;
328
+ export interface AgentTaskEventsResponse {
329
+ events: AgentTaskEventResponse[];
330
+ }
331
+ export interface AgentTasksResponse {
332
+ tasks: AgentTaskResponse[];
180
333
  pagination: PaginationMeta;
181
334
  }
182
- export interface GameIdeaDetailResponse {
183
- gameIdea: GameIdeaResponse;
335
+ export interface CancelAgentTaskResponse {
336
+ task: AgentTaskResponse;
184
337
  }
185
- export interface StartGameIdeaResponse {
186
- gameIdea: GameIdeaResponse;
338
+ export interface ClearAgentTaskResponse {
339
+ taskId: number;
340
+ cleared: true;
187
341
  }
188
- export interface StartGameIdeaRequest {
189
- app?: string;
342
+ export interface RetryAgentTaskResponse {
343
+ task: AgentTaskResponse;
344
+ events: AgentTaskEventResponse[];
190
345
  }
191
- export interface ShipGameIdeaRequest {
192
- app: string;
346
+ export interface MeAgentWorkersResponse {
347
+ workers: AgentWorkerResponse[];
193
348
  }
194
- export interface ShipGameIdeaResponse {
195
- gameIdea: GameIdeaResponse;
349
+ export interface WorkerPresenceRequest {
350
+ workerKey: string;
351
+ name?: string;
352
+ environment?: string;
353
+ capabilities?: AgentWorkerCapabilities;
196
354
  }
197
- export interface RemixCandidateGameIdeaResponse {
198
- app: AppResponse;
199
- remixRef: string | null;
355
+ export interface WorkerPresenceResponse {
356
+ worker: AgentWorkerResponse;
357
+ }
358
+ export interface WorkerClaimAgentTaskRequest {
359
+ workerKey: string;
360
+ capabilities: AgentWorkerCapabilities;
361
+ }
362
+ export interface WorkerAgentTaskBaseSourceResponse {
363
+ creatorUsername: string;
364
+ appName: string;
365
+ version: string;
366
+ appId: number;
367
+ appVersionId: number;
368
+ }
369
+ export interface WorkerAgentTaskReviewTargetResponse {
370
+ creatorUsername: string;
371
+ appName: string;
372
+ appDisplayName: string | null;
373
+ version: string;
374
+ appId: number;
375
+ appVersionId: number;
376
+ reviewState: ReviewState;
377
+ launchUrl: string;
378
+ }
379
+ export interface WorkerAgentTaskWorkspaceFileResponse {
380
+ relativePath: string;
381
+ contentBase64: string;
382
+ contentType?: string;
383
+ }
384
+ export interface WorkerAgentTaskAttachmentResponse {
385
+ id: string;
386
+ fileName: string;
387
+ contentType: string;
388
+ sizeBytes: number;
389
+ relativePath: string;
390
+ description?: string | null;
391
+ }
392
+ export interface WorkerAgentTaskAssignmentResponse {
393
+ taskId: number;
394
+ taskToken: string;
395
+ kind: AgentTaskKind;
396
+ target: AgentExecutionTarget;
397
+ agent: AgentRuntime;
398
+ model: string;
399
+ workspace: {
400
+ folderName: string;
401
+ files: WorkerAgentTaskWorkspaceFileResponse[];
402
+ };
403
+ inputs: {
404
+ request: {
405
+ prompt: string;
406
+ };
407
+ taskInputs?: AgentTaskInput[];
408
+ attachments: WorkerAgentTaskAttachmentResponse[];
409
+ baseSource: WorkerAgentTaskBaseSourceResponse | null;
410
+ reviewTarget?: WorkerAgentTaskReviewTargetResponse | null;
411
+ };
412
+ output: {
413
+ appId: number | null;
414
+ appName: string | null;
415
+ version: string;
416
+ releaseNoteRequired: boolean;
417
+ };
418
+ prompt: string;
419
+ }
420
+ export interface WorkerClaimAgentTaskResponse {
421
+ task: AgentTaskResponse | null;
422
+ taskAssignment?: WorkerAgentTaskAssignmentResponse;
423
+ leaseToken?: string;
424
+ leaseExpiresAt?: string;
425
+ }
426
+ export interface WorkerHeartbeatAgentTaskRequest {
427
+ workerKey: string;
428
+ leaseToken: string;
200
429
  }
201
- export interface RemixCandidatesResponse {
202
- candidates: RemixCandidateGameIdeaResponse[];
430
+ export interface WorkerHeartbeatAgentTaskResponse {
431
+ leaseExpiresAt: string;
432
+ action: 'continue' | 'abort';
433
+ }
434
+ export interface WorkerCreateAgentTaskEventRequest {
435
+ kind?: AgentTaskEventKind;
436
+ phase?: string | null;
437
+ message: string;
438
+ pct?: number | null;
439
+ taskToken?: string;
440
+ workerKey?: string;
441
+ leaseToken?: string;
442
+ payload?: Record<string, unknown>;
443
+ }
444
+ export interface WorkerCreateAgentTaskEventResponse {
445
+ event: AgentTaskEventResponse;
446
+ }
447
+ export interface WorkerCreateAgentTaskTranscriptChunkRequest {
448
+ workerKey?: string;
449
+ leaseToken?: string;
450
+ chunks: Array<{
451
+ stream: AgentTaskTranscriptStream;
452
+ content: string;
453
+ }>;
454
+ }
455
+ export interface WorkerCreateAgentTaskTranscriptChunkResponse {
456
+ chunks: AgentTaskTranscriptChunkResponse[];
457
+ }
458
+ export interface AgentTaskRunTokenUsageResponse {
459
+ inputTokens: number | null;
460
+ outputTokens: number | null;
461
+ cacheCreationInputTokens: number | null;
462
+ cacheReadInputTokens: number | null;
463
+ totalTokens: number | null;
464
+ rawProviderUsage?: Record<string, unknown> | null;
465
+ usageParseError?: string | null;
466
+ }
467
+ export interface AgentTaskRunResponse {
468
+ id: number;
469
+ taskId: number;
470
+ attempt: number;
471
+ workerId: number | null;
472
+ creatorId: number;
473
+ workerOwnerId: number;
474
+ agent: AgentRuntime | null;
475
+ requestedModel: string | null;
476
+ resolvedRuntimeModel: string | null;
477
+ reasoningEffort: string | null;
478
+ providerAccountLabel: string | null;
479
+ status: AgentTaskStatus;
480
+ exitCode: number | null;
481
+ signal: string | null;
482
+ timedOut: boolean;
483
+ tokenUsage: AgentTaskRunTokenUsageResponse;
484
+ availableSkillPaths: string[];
485
+ observedSkillPaths: string[];
486
+ startedAt: string | null;
487
+ completedAt: string | null;
488
+ createdAt: string;
489
+ updatedAt: string;
490
+ }
491
+ export interface AgentTaskAiGenerationSummaryResponse {
492
+ generationId: string | null;
493
+ jobId: string | null;
494
+ status: string;
495
+ modality: string;
496
+ model: string | null;
497
+ costCredits: number | null;
498
+ paidBy: string | null;
499
+ paidByUserId: number | null;
500
+ createdAt: string;
501
+ completedAt: string | null;
502
+ }
503
+ export interface WorkerRecordAgentTaskRunTelemetryRequest {
504
+ workerKey: string;
505
+ leaseToken?: string;
506
+ taskToken?: string;
507
+ attempt: number;
508
+ agent?: AgentRuntime | null;
509
+ requestedModel?: string | null;
510
+ resolvedRuntimeModel?: string | null;
511
+ reasoningEffort?: string | null;
512
+ providerAccountLabel?: string | null;
513
+ status: AgentTaskStatus;
514
+ exitCode?: number | null;
515
+ signal?: string | null;
516
+ timedOut?: boolean;
517
+ tokenUsage?: {
518
+ inputTokens?: number | null;
519
+ outputTokens?: number | null;
520
+ cacheCreationInputTokens?: number | null;
521
+ cacheReadInputTokens?: number | null;
522
+ totalTokens?: number | null;
523
+ rawProviderUsage?: Record<string, unknown> | null;
524
+ usageParseError?: string | null;
525
+ };
526
+ availableSkillPaths?: string[];
527
+ observedSkillPaths?: string[];
528
+ startedAt?: string | null;
529
+ completedAt?: string | null;
530
+ }
531
+ export interface WorkerRecordAgentTaskRunTelemetryResponse {
532
+ run: AgentTaskRunResponse;
533
+ task: AgentTaskResponse;
534
+ }
535
+ export interface WorkerSubmitAgentTaskReviewRequest {
536
+ taskToken?: string;
537
+ workerKey?: string;
538
+ leaseToken?: string;
539
+ appVersionId: number;
540
+ reviewState: ReviewState;
541
+ reviewMessage: string;
542
+ creatorFeedback: string | null;
543
+ evidenceFiles?: Array<{
544
+ name: string;
545
+ contentType: string;
546
+ contentBase64: string;
547
+ }>;
548
+ }
549
+ export interface WorkerSubmitAgentTaskReviewResponse {
550
+ task: AgentTaskResponse;
551
+ version: AppVersionResponse;
552
+ }
553
+ export interface WorkerCompleteAgentTaskRequest {
554
+ taskToken?: string;
555
+ workerKey?: string;
556
+ leaseToken?: string;
557
+ appId: number;
558
+ appVersionId: number;
559
+ result?: Record<string, unknown>;
560
+ tokensUsed?: number | null;
561
+ }
562
+ export interface WorkerFailAgentTaskRequest {
563
+ taskToken?: string;
564
+ workerKey?: string;
565
+ leaseToken?: string;
566
+ error: string;
567
+ result?: Record<string, unknown>;
568
+ }
569
+ export interface AdminAgentTasksResponse {
570
+ tasks: AgentTaskResponse[];
571
+ pagination: PaginationMeta;
572
+ }
573
+ export interface AdminAgentTaskDetailResponse {
574
+ task: AgentTaskResponse;
575
+ events: AgentTaskEventResponse[];
576
+ runs: AgentTaskRunResponse[];
577
+ aiGenerations: AgentTaskAiGenerationSummaryResponse[];
578
+ }
579
+ export interface AdminAgentTaskTranscriptResponse {
580
+ chunks: AgentTaskTranscriptChunkResponse[];
581
+ }
582
+ export interface AdminAgentWorkersStatusResponse {
583
+ checkedAt: string;
584
+ onlineWorkerCount: number;
585
+ onlineWorkers: AgentWorkerResponse[];
586
+ queuedTaskCount: number;
587
+ runningTaskCount: number;
588
+ oldestQueuedTaskId: number | null;
589
+ oldestQueuedAgeMs: number | null;
590
+ }
591
+ export declare const AGENT_TASK_UNAVAILABLE_REASON_VALUES: readonly ["insufficient_credits", "active_task_exists", "active_task_cap_reached", "daily_cap_reached", "no_online_worker", "app_not_eligible_for_update", "first_party_requires_playdrop_cloud_origin"];
592
+ export type AgentTaskUnavailableReason = typeof AGENT_TASK_UNAVAILABLE_REASON_VALUES[number];
593
+ export interface AgentTaskTargetAvailability {
594
+ target: AgentExecutionTarget;
595
+ available: boolean;
596
+ reason: AgentTaskUnavailableReason | null;
597
+ priceCredits: number;
598
+ onlineWorkers: AgentWorkerResponse[];
599
+ agentModels: AgentTaskAgentModelOption[];
600
+ }
601
+ export interface AgentTaskAvailabilityResponse {
602
+ kind: AgentTaskKind;
603
+ creditBalance: number;
604
+ targets: AgentTaskTargetAvailability[];
605
+ appOrigin?: AppOrigin | null;
606
+ pendingOutputVersion?: string | null;
607
+ latestCataloguePreviewEvent?: AgentTaskEventResponse | null;
608
+ }
609
+ export interface AgentTaskNewGameSuggestion {
610
+ id: string;
611
+ prompt: string;
612
+ }
613
+ export interface AgentTaskNewGameSuggestionsResponse {
614
+ suggestions: AgentTaskNewGameSuggestion[];
615
+ }
616
+ export interface CreateAppAgentTaskRequest {
617
+ target: AgentExecutionTarget;
618
+ agent: AgentRuntime;
619
+ model: string;
620
+ prompt: string;
621
+ inputs?: AgentTaskInput[];
622
+ notifyOnReady?: boolean;
623
+ }
624
+ export interface CreateAppAgentTaskResponse {
625
+ task: AgentTaskResponse;
626
+ events: AgentTaskEventResponse[];
627
+ }
628
+ export interface AppAgentTaskResponse {
629
+ task: AgentTaskResponse | null;
630
+ events: AgentTaskEventResponse[];
631
+ }
632
+ export type CreatorGameState = 'CREATING' | 'FAILED_CREATE' | 'DRAFT' | 'LIVE' | 'LIVE_WITH_DRAFT' | 'UPDATING' | 'FAILED_UPDATE';
633
+ export type CreatorGameActionKind = 'notify' | 'publish' | 'share' | 'play' | 'edit' | 'retry' | 'cancel' | 'delete' | 'history';
634
+ export interface CreatorGameAction {
635
+ kind: CreatorGameActionKind;
636
+ enabled: boolean;
637
+ label: string;
638
+ }
639
+ export interface CreatorGameListItem {
640
+ id: string;
641
+ state: CreatorGameState;
642
+ app: AppResponse | null;
643
+ latestVersion: AppVersionSummary | null;
644
+ latestTask: AgentTaskResponse | null;
645
+ preview: AgentTaskEventResponse | null;
646
+ title: string;
647
+ description?: string | null;
648
+ heroImageUrl?: string | null;
649
+ emoji?: string | null;
650
+ color?: string | null;
651
+ primaryAction: 'open' | 'retry' | 'cancel' | 'play' | 'publish' | 'share';
652
+ actions: CreatorGameAction[];
653
+ }
654
+ export interface CreatorGamesListResponse {
655
+ items: CreatorGameListItem[];
203
656
  pagination: PaginationMeta;
204
657
  }
658
+ export interface CreatorGameStatusResponse {
659
+ item: CreatorGameListItem;
660
+ currentVersion: AppVersionSummary | null;
661
+ draftVersion: AppVersionSummary | null;
662
+ activeOrLatestTask: AgentTaskResponse | null;
663
+ events: AgentTaskEventResponse[];
664
+ updateBaseVersion: AppVersionSummary | null;
665
+ availability: AgentTaskAvailabilityResponse | null;
666
+ }
667
+ export interface CreatorGameVersionsResponse {
668
+ item: CreatorGameListItem;
669
+ versions: AppVersionSummary[];
670
+ tasks: AgentTaskResponse[];
671
+ }
205
672
  export interface TagGroupSummary {
206
673
  slug: string;
207
674
  displayName: string;
@@ -225,6 +692,7 @@ export interface AppResponse {
225
692
  creatorUsername: string;
226
693
  createdAt: string;
227
694
  updatedAt: string;
695
+ origin?: AppOrigin;
228
696
  type: AppType;
229
697
  emoji?: string | null;
230
698
  color?: string | null;
@@ -287,6 +755,113 @@ export type AdminAppResponse = AppResponse;
287
755
  export interface AdminAppsListResponse {
288
756
  apps: AdminAppResponse[];
289
757
  }
758
+ export declare const PLATFORM_ANALYTICS_CLIENT_SURFACE_VALUES: readonly ["web_desktop", "web_mobile", "native_ios", "native_macos", "native_android", "cli", "admin"];
759
+ export type PlatformAnalyticsClientSurface = typeof PLATFORM_ANALYTICS_CLIENT_SURFACE_VALUES[number];
760
+ export interface AdminPlatformAnalyticsDailyBucket {
761
+ dateUtc: string;
762
+ newAccounts: number;
763
+ dau: number;
764
+ cliPaired: number;
765
+ gamesRegistered: number;
766
+ gamesUploaded: number;
767
+ aiGenerations: number;
768
+ gamesPlayed: number;
769
+ adsDisplayed: number;
770
+ }
771
+ export interface AdminPlatformAnalyticsTotals {
772
+ newAccounts: number;
773
+ activeUsers: number;
774
+ cliPaired: number;
775
+ gamesRegistered: number;
776
+ gamesUploaded: number;
777
+ aiGenerations: number;
778
+ gamesPlayed: number;
779
+ adsDisplayed: number;
780
+ }
781
+ export interface AdminPlatformAnalyticsDailySeriesPoint {
782
+ dateUtc: string;
783
+ count: number;
784
+ }
785
+ export interface AdminPlatformAnalyticsAiModalityDailyPoint extends AdminPlatformAnalyticsDailySeriesPoint {
786
+ modality: string;
787
+ }
788
+ export interface AdminPlatformAnalyticsAdFormatDailyPoint extends AdminPlatformAnalyticsDailySeriesPoint {
789
+ format: string;
790
+ }
791
+ export interface AdminPlatformAnalyticsCreationSourceSummary {
792
+ source: GameCreationSource;
793
+ label: string;
794
+ gamesRegistered: number;
795
+ gamesUploaded: number;
796
+ tasksCreated: number;
797
+ tasksDone: number;
798
+ tasksFailed: number;
799
+ creditsSpent: number;
800
+ tokensUsed: number;
801
+ averageQueueSeconds: number | null;
802
+ averageRunSeconds: number | null;
803
+ }
804
+ export interface AdminPlatformAnalyticsCreationSourceDailyPoint {
805
+ dateUtc: string;
806
+ source: GameCreationSource;
807
+ label: string;
808
+ gamesRegistered: number;
809
+ gamesUploaded: number;
810
+ tasksCreated: number;
811
+ tasksDone: number;
812
+ tasksFailed: number;
813
+ }
814
+ export interface AdminPlatformAnalyticsReviewQualitySourceSummary {
815
+ source: GameCreationSource;
816
+ label: string;
817
+ reviewedVersions: number;
818
+ reviewStateCounts: Partial<Record<ReviewState, number>>;
819
+ averageParsedQualityScore: number | null;
820
+ scoreParseErrorCount: number;
821
+ }
822
+ export interface AdminPlatformAnalyticsClientSurfaceDailyPoint {
823
+ dateUtc: string;
824
+ clientSurface: PlatformAnalyticsClientSurface;
825
+ activeUsers: number;
826
+ eventCount: number;
827
+ }
828
+ export type AdminPlatformAnalyticsRequest = {
829
+ days?: 7 | 30 | 90;
830
+ fromDateUtc?: never;
831
+ toDateUtc?: never;
832
+ } | {
833
+ days?: never;
834
+ fromDateUtc: string;
835
+ toDateUtc: string;
836
+ };
837
+ export interface AdminPlatformAnalyticsResponse {
838
+ days: number;
839
+ fromDateUtc: string;
840
+ toDateUtc: string;
841
+ currentDau: number;
842
+ averageDau: number;
843
+ totals: AdminPlatformAnalyticsTotals;
844
+ daily: AdminPlatformAnalyticsDailyBucket[];
845
+ aiGenerationsByModality: Array<{
846
+ modality: string;
847
+ count: number;
848
+ }>;
849
+ aiGenerationsByModalityDaily: AdminPlatformAnalyticsAiModalityDailyPoint[];
850
+ adsByFormat: Array<{
851
+ format: string;
852
+ count: number;
853
+ }>;
854
+ adsByFormatDaily: AdminPlatformAnalyticsAdFormatDailyPoint[];
855
+ creationSources: AdminPlatformAnalyticsCreationSourceSummary[];
856
+ creationSourcesDaily: AdminPlatformAnalyticsCreationSourceDailyPoint[];
857
+ reviewQualitySources: AdminPlatformAnalyticsReviewQualitySourceSummary[];
858
+ clientSurfaces: Array<{
859
+ clientSurface: PlatformAnalyticsClientSurface;
860
+ activeUsers: number;
861
+ eventCount: number;
862
+ }>;
863
+ clientSurfacesDaily: AdminPlatformAnalyticsClientSurfaceDailyPoint[];
864
+ }
290
865
  export interface AdminGameCollectionSummary {
291
866
  id: number;
292
867
  slug: string;
@@ -868,9 +1443,21 @@ export interface AdminAppVersionReviewSummary {
868
1443
  creatorUsername: string;
869
1444
  isCurrent: boolean;
870
1445
  visibility: AppVersionVisibility;
1446
+ source: GameCreationSource;
1447
+ sourceLabel: string;
1448
+ agentTaskId: number | null;
1449
+ reviewTaskId: number | null;
1450
+ reviewTaskStatus: AgentTaskStatus | null;
871
1451
  reviewState: ReviewState;
872
1452
  reviewMessage?: string | null;
873
1453
  creatorFeedback?: string | null;
1454
+ parsedOutcome: string | null;
1455
+ parsedGate: string | null;
1456
+ parsedPrimarySurface: string | null;
1457
+ parsedAverageScore: number | null;
1458
+ parsedCriteriaScores: Record<string, number>;
1459
+ parsedPunchline: string | null;
1460
+ reviewParseErrors: string[];
874
1461
  reviewStartedAt?: string | null;
875
1462
  reviewCompletedAt?: string | null;
876
1463
  createdAt: string;
@@ -889,7 +1476,7 @@ export interface AdminUpdateAppVersionReviewRequest {
889
1476
  export interface AdminUpdateAppVersionReviewResponse {
890
1477
  version: AdminAppVersionReviewSummary;
891
1478
  }
892
- export interface AdminClaimNextAppVersionReviewResponse {
1479
+ export interface AdminEnqueueNextAppVersionReviewTaskResponse {
893
1480
  version: AdminAppVersionReviewSummary | null;
894
1481
  }
895
1482
  export interface ProfileAssetSummary {