@playdrop/playdrop-cli 0.9.5 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/config/client-meta.json +1 -2
  2. package/dist/apiClient.d.ts +2 -0
  3. package/dist/apiClient.js +27 -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 +1 -0
  16. package/dist/captureRuntime.js +308 -0
  17. package/dist/catalogue.d.ts +4 -2
  18. package/dist/catalogue.js +50 -7
  19. package/dist/commandContext.js +42 -3
  20. package/dist/commands/capture.d.ts +1 -0
  21. package/dist/commands/capture.js +30 -13
  22. package/dist/commands/create.d.ts +0 -1
  23. package/dist/commands/create.js +2 -151
  24. package/dist/commands/creations.d.ts +0 -13
  25. package/dist/commands/creations.js +0 -141
  26. package/dist/commands/dev.d.ts +2 -1
  27. package/dist/commands/dev.js +23 -6
  28. package/dist/commands/devServer.js +3 -1
  29. package/dist/commands/generation.d.ts +1 -0
  30. package/dist/commands/generation.js +274 -0
  31. package/dist/commands/upload.d.ts +27 -1
  32. package/dist/commands/upload.js +962 -21
  33. package/dist/commands/validate.js +5 -0
  34. package/dist/commands/worker/runtime.d.ts +69 -0
  35. package/dist/commands/worker/runtime.js +414 -0
  36. package/dist/commands/worker.d.ts +144 -0
  37. package/dist/commands/worker.js +2219 -0
  38. package/dist/config.d.ts +2 -0
  39. package/dist/config.js +23 -0
  40. package/dist/index.js +71 -30
  41. package/dist/shellProbe.d.ts +1 -1
  42. package/dist/shellProbe.js +3 -3
  43. package/dist/workspaceAuth.d.ts +1 -0
  44. package/dist/workspaceAuth.js +8 -0
  45. package/node_modules/@playdrop/api-client/dist/client.d.ts +31 -14
  46. package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
  47. package/node_modules/@playdrop/api-client/dist/client.js +2 -2
  48. package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +3 -1
  49. package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
  50. package/node_modules/@playdrop/api-client/dist/domains/admin.js +45 -0
  51. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +72 -0
  52. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -0
  53. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +442 -0
  54. package/node_modules/@playdrop/api-client/dist/index.d.ts +31 -14
  55. package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
  56. package/node_modules/@playdrop/api-client/dist/index.js +134 -38
  57. package/node_modules/@playdrop/config/client-meta.json +1 -2
  58. package/node_modules/@playdrop/types/dist/api.d.ts +501 -74
  59. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  60. package/node_modules/@playdrop/types/dist/api.js +90 -9
  61. package/node_modules/@playdrop/types/dist/app.d.ts +2 -0
  62. package/node_modules/@playdrop/types/dist/app.d.ts.map +1 -1
  63. package/node_modules/@playdrop/types/dist/app.js +3 -0
  64. package/node_modules/@playdrop/types/dist/version.d.ts +1 -0
  65. package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
  66. package/package.json +2 -1
  67. package/node_modules/@playdrop/api-client/dist/domains/game-ideas.d.ts +0 -46
  68. package/node_modules/@playdrop/api-client/dist/domains/game-ideas.d.ts.map +0 -1
  69. 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, 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,452 @@ 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"];
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 AGENT_TASK_PROMPT_MIN_LENGTH = 4;
119
+ export declare const AGENT_TASK_PROMPT_MAX_LENGTH = 100000;
120
+ export declare const AGENT_RUNTIME_VALUES: readonly ["CODEX", "CLAUDE_CODE"];
121
+ export type AgentRuntime = typeof AGENT_RUNTIME_VALUES[number];
122
+ 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"];
123
+ export type AgentTaskCodexModel = typeof AGENT_TASK_CODEX_MODEL_VALUES[number];
124
+ export declare const AGENT_TASK_CLAUDE_CODE_MODEL_VALUES: readonly ["claude-haiku-4-5", "claude-sonnet-4-6", "claude-opus-4-8"];
125
+ export type AgentTaskClaudeCodeModel = typeof AGENT_TASK_CLAUDE_CODE_MODEL_VALUES[number];
126
+ export declare const AGENT_TASK_MODEL_VALUES_BY_AGENT: Record<AgentRuntime, readonly string[]>;
127
+ export declare function normalizeAgentTaskModel(agent: AgentRuntime, model: string): string | null;
128
+ export declare const AGENT_TASK_EFFORT_VALUES: readonly ["simple", "standard", "complex"];
129
+ export type AgentTaskEffort = typeof AGENT_TASK_EFFORT_VALUES[number];
130
+ export declare const AGENT_TASK_EFFORT_KIND_VALUES: readonly ["BUILD_COMPLEXITY", "CHANGE_MAGNITUDE"];
131
+ export type AgentTaskEffortKind = typeof AGENT_TASK_EFFORT_KIND_VALUES[number];
132
+ export declare const AGENT_TASK_EVENT_KIND_VALUES: readonly ["progress", "agent_message", "system", "catalogue_preview"];
133
+ export type AgentTaskEventKind = typeof AGENT_TASK_EVENT_KIND_VALUES[number];
134
+ export declare const AGENT_TASK_TRANSCRIPT_STREAM_VALUES: readonly ["stdout", "stderr", "combined"];
135
+ export type AgentTaskTranscriptStream = typeof AGENT_TASK_TRANSCRIPT_STREAM_VALUES[number];
136
+ export interface AgentWorkerCapabilities {
137
+ supportedKinds: AgentTaskKind[];
138
+ maxParallelTasks: number;
139
+ runningTaskCount: number;
140
+ cliVersion?: string;
141
+ codexVersion?: string;
142
+ nodeVersion?: string;
143
+ npmVersion?: string;
144
+ playwright?: {
145
+ version?: string;
146
+ chromiumInstalled?: boolean;
147
+ };
148
+ agents: Array<{
149
+ agent: AgentRuntime;
150
+ cliVersion?: string;
151
+ authenticated?: boolean;
152
+ pluginVersion?: string;
153
+ models?: string[];
154
+ ready?: boolean;
155
+ }>;
156
+ ready?: boolean;
157
+ degradedReasons?: string[];
158
+ os?: string;
159
+ arch?: string;
160
+ [key: string]: unknown;
161
+ }
162
+ export interface AgentWorkerResponse {
116
163
  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;
164
+ workerKey: string;
165
+ name: string;
166
+ environment: string;
167
+ capabilities: AgentWorkerCapabilities | null;
168
+ lastSeenAt: string;
169
+ online: boolean;
131
170
  createdAt: string;
132
171
  updatedAt: string;
133
172
  }
134
- export interface GameIdeaStatusSummary {
173
+ export interface AgentTaskEnrichmentResponse {
174
+ title: string | null;
175
+ summary: string | null;
176
+ safetyFlags: string[];
177
+ }
178
+ export interface AgentTaskAgentModelSelection {
179
+ agent: AgentRuntime;
180
+ model: string;
181
+ }
182
+ export interface AgentTaskAgentModelOption extends AgentTaskAgentModelSelection {
183
+ label: string;
184
+ onlineWorkers: number;
185
+ }
186
+ export interface AgentTaskRefundResponse {
187
+ state: 'refunded' | 'withheld';
188
+ credits: number;
189
+ note: string;
190
+ }
191
+ export interface AgentTaskResponse {
135
192
  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;
193
+ kind: AgentTaskKind;
194
+ status: AgentTaskStatus;
195
+ executionTarget: AgentExecutionTarget;
196
+ agent: AgentRuntime;
197
+ model: string;
198
+ effort: AgentTaskEffort;
199
+ effortKind: AgentTaskEffortKind;
200
+ appOrigin: AppOrigin | null;
201
+ outputVersion: string | null;
202
+ userInput: string | null;
203
+ enrichment: AgentTaskEnrichmentResponse | null;
204
+ creatorId?: number;
205
+ creatorUsername?: string | null;
206
+ baseAppId: number | null;
207
+ baseAppVersionId: number | null;
208
+ appId: number | null;
209
+ appVersionId: number | null;
210
+ costCredits: number;
211
+ refund: AgentTaskRefundResponse | null;
212
+ payload?: {
213
+ safety?: Record<string, unknown>;
214
+ model?: string;
215
+ [key: string]: unknown;
216
+ };
217
+ result: Record<string, unknown> | null;
218
+ error: string | null;
219
+ workerId?: number | null;
220
+ workerName?: string | null;
221
+ lastHeartbeatAt: string | null;
222
+ cancelRequestedAt: string | null;
223
+ attempts: number;
224
+ queuePosition: number | null;
225
+ tokensUsed: number | null;
226
+ latestCataloguePreviewEvent?: AgentTaskEventResponse | null;
227
+ createdAt: string;
143
228
  startedAt: string | null;
144
- shippedAt: string | null;
229
+ completedAt: string | null;
145
230
  updatedAt: string;
146
231
  }
147
- export interface GameIdeaStatusResponse {
148
- gameIdea: GameIdeaStatusSummary;
149
- app: AppResponse | null;
232
+ export interface AgentTaskEventResponse {
233
+ id: number;
234
+ taskId: number;
235
+ attempt: number;
236
+ kind: AgentTaskEventKind;
237
+ phase: string | null;
238
+ message: string;
239
+ pct: number | null;
240
+ payload?: Record<string, unknown> | null;
241
+ createdAt: string;
242
+ }
243
+ export interface AgentTaskTranscriptChunkResponse {
244
+ id: number;
245
+ taskId: number;
246
+ attempt: number;
247
+ sequence: number;
248
+ stream: AgentTaskTranscriptStream;
249
+ content: string;
250
+ workerId: number | null;
251
+ createdAt: string;
150
252
  }
151
- export interface CreateGameIdeaRequest {
152
- inputMode: GameIdeaInputMode;
153
- inputData: Record<string, unknown>;
154
- tagRefs?: string[];
253
+ export interface AgentTaskAttachmentInput {
254
+ id: string;
255
+ fileName: string;
256
+ contentType: string;
257
+ storageKey?: string;
258
+ sizeBytes: number;
259
+ description?: string | null;
155
260
  }
156
- export interface CreateGameIdeaResponse {
157
- gameIdea: GameIdeaResponse;
158
- usage: {
159
- dailyLimit: number;
160
- count: number;
161
- remaining: number;
261
+ export interface AgentTaskAttachmentUploadResponse {
262
+ attachment: AgentTaskAttachmentInput;
263
+ }
264
+ export type AgentTaskInputKind = 'prompt' | 'MEDIA' | 'GAME_PLAN' | 'REFERENCE_GAME' | 'REFERENCE_ASSET' | 'REFERENCE_PACK';
265
+ export type GamePlanQuestionId = 'graphics' | 'surface_targets' | 'genre' | 'theme' | 'controls' | 'player_goal' | 'challenge' | 'first_version_scope' | 'notes';
266
+ export type GamePlanQuestionKind = 'SINGLE_CHOICE' | 'MULTI_CHOICE' | 'TEXT';
267
+ export interface GamePlanSelectedOption {
268
+ optionId: string;
269
+ optionLabel: string;
270
+ answer: string;
271
+ }
272
+ export interface GamePlanAnswerInput {
273
+ questionId: GamePlanQuestionId;
274
+ label: string;
275
+ kind: GamePlanQuestionKind;
276
+ selectedOptions?: GamePlanSelectedOption[];
277
+ answer?: string;
278
+ }
279
+ export interface AgentTaskInputBase {
280
+ id?: string;
281
+ kind: AgentTaskInputKind;
282
+ note?: string | null;
283
+ }
284
+ export interface AgentTaskPromptInput extends AgentTaskInputBase {
285
+ kind: 'prompt';
286
+ text?: string | null;
287
+ }
288
+ export interface AgentTaskMediaInput extends AgentTaskInputBase {
289
+ kind: 'MEDIA';
290
+ media: AgentTaskAttachmentInput;
291
+ }
292
+ export interface AgentTaskGamePlanInput extends AgentTaskInputBase {
293
+ kind: 'GAME_PLAN';
294
+ gamePlan: {
295
+ answers: GamePlanAnswerInput[];
162
296
  };
163
297
  }
164
- export interface UpdateGameIdeaRequest {
165
- displayName?: string;
166
- tagRefs?: string[];
167
- inputData?: Record<string, unknown>;
168
- generatedData?: Record<string, unknown> | null;
298
+ export interface AgentTaskReferenceInput extends AgentTaskInputBase {
299
+ kind: 'REFERENCE_GAME' | 'REFERENCE_ASSET' | 'REFERENCE_PACK';
300
+ reference: {
301
+ ref: string;
302
+ creatorUsername?: string | null;
303
+ name?: string | null;
304
+ version?: string | null;
305
+ displayName?: string | null;
306
+ };
169
307
  }
170
- export interface UpdateGameIdeaResponse {
171
- gameIdea: GameIdeaResponse;
308
+ export type AgentTaskInput = AgentTaskPromptInput | AgentTaskMediaInput | AgentTaskGamePlanInput | AgentTaskReferenceInput;
309
+ export interface CreateNewGameAgentTaskRequest {
310
+ target: AgentExecutionTarget;
311
+ agent: AgentRuntime;
312
+ model: string;
313
+ prompt: string;
314
+ inputs?: AgentTaskInput[];
172
315
  }
173
- export interface GameIdeasListRequest {
174
- state?: GameIdeaState | 'ALL';
175
- limit?: number;
176
- offset?: number;
316
+ export interface CreateNewGameAgentTaskResponse {
317
+ task: AgentTaskResponse;
318
+ events: AgentTaskEventResponse[];
319
+ }
320
+ export interface AgentTaskDetailResponse {
321
+ task: AgentTaskResponse;
177
322
  }
178
- export interface GameIdeasListResponse {
179
- gameIdeas: GameIdeaResponse[];
323
+ export interface AgentTaskEventsResponse {
324
+ events: AgentTaskEventResponse[];
325
+ }
326
+ export interface AgentTasksResponse {
327
+ tasks: AgentTaskResponse[];
180
328
  pagination: PaginationMeta;
181
329
  }
182
- export interface GameIdeaDetailResponse {
183
- gameIdea: GameIdeaResponse;
330
+ export interface CancelAgentTaskResponse {
331
+ task: AgentTaskResponse;
184
332
  }
185
- export interface StartGameIdeaResponse {
186
- gameIdea: GameIdeaResponse;
333
+ export interface ClearAgentTaskResponse {
334
+ taskId: number;
335
+ cleared: true;
187
336
  }
188
- export interface StartGameIdeaRequest {
189
- app?: string;
337
+ export interface RetryAgentTaskResponse {
338
+ task: AgentTaskResponse;
339
+ events: AgentTaskEventResponse[];
190
340
  }
191
- export interface ShipGameIdeaRequest {
192
- app: string;
341
+ export interface MeAgentWorkersResponse {
342
+ workers: AgentWorkerResponse[];
193
343
  }
194
- export interface ShipGameIdeaResponse {
195
- gameIdea: GameIdeaResponse;
344
+ export interface WorkerPresenceRequest {
345
+ workerKey: string;
346
+ name?: string;
347
+ environment?: string;
348
+ capabilities?: AgentWorkerCapabilities;
196
349
  }
197
- export interface RemixCandidateGameIdeaResponse {
198
- app: AppResponse;
199
- remixRef: string | null;
350
+ export interface WorkerPresenceResponse {
351
+ worker: AgentWorkerResponse;
352
+ }
353
+ export interface WorkerClaimAgentTaskRequest {
354
+ workerKey: string;
355
+ capabilities: AgentWorkerCapabilities;
356
+ }
357
+ export interface WorkerAgentTaskBaseSourceResponse {
358
+ creatorUsername: string;
359
+ appName: string;
360
+ version: string;
361
+ appId: number;
362
+ appVersionId: number;
363
+ }
364
+ export interface WorkerAgentTaskWorkspaceFileResponse {
365
+ relativePath: string;
366
+ contentBase64: string;
367
+ contentType?: string;
368
+ }
369
+ export interface WorkerAgentTaskAttachmentResponse {
370
+ id: string;
371
+ fileName: string;
372
+ contentType: string;
373
+ sizeBytes: number;
374
+ relativePath: string;
375
+ description?: string | null;
376
+ }
377
+ export interface WorkerAgentTaskAssignmentResponse {
378
+ taskId: number;
379
+ taskToken: string;
380
+ kind: AgentTaskKind;
381
+ target: AgentExecutionTarget;
382
+ agent: AgentRuntime;
383
+ model: string;
384
+ workspace: {
385
+ folderName: string;
386
+ files: WorkerAgentTaskWorkspaceFileResponse[];
387
+ };
388
+ inputs: {
389
+ request: {
390
+ prompt: string;
391
+ };
392
+ taskInputs?: AgentTaskInput[];
393
+ attachments: WorkerAgentTaskAttachmentResponse[];
394
+ baseSource: WorkerAgentTaskBaseSourceResponse | null;
395
+ };
396
+ output: {
397
+ appId: number | null;
398
+ appName: string | null;
399
+ version: string;
400
+ releaseNoteRequired: boolean;
401
+ };
402
+ prompt: string;
403
+ }
404
+ export interface WorkerClaimAgentTaskResponse {
405
+ task: AgentTaskResponse | null;
406
+ taskAssignment?: WorkerAgentTaskAssignmentResponse;
407
+ leaseToken?: string;
408
+ leaseExpiresAt?: string;
409
+ }
410
+ export interface WorkerHeartbeatAgentTaskRequest {
411
+ workerKey: string;
412
+ leaseToken: string;
413
+ }
414
+ export interface WorkerHeartbeatAgentTaskResponse {
415
+ leaseExpiresAt: string;
416
+ action: 'continue' | 'abort';
417
+ }
418
+ export interface WorkerCreateAgentTaskEventRequest {
419
+ kind?: AgentTaskEventKind;
420
+ phase?: string | null;
421
+ message: string;
422
+ pct?: number | null;
423
+ taskToken?: string;
424
+ workerKey?: string;
425
+ leaseToken?: string;
426
+ payload?: Record<string, unknown>;
427
+ }
428
+ export interface WorkerCreateAgentTaskEventResponse {
429
+ event: AgentTaskEventResponse;
430
+ }
431
+ export interface WorkerCreateAgentTaskTranscriptChunkRequest {
432
+ workerKey?: string;
433
+ leaseToken?: string;
434
+ chunks: Array<{
435
+ stream: AgentTaskTranscriptStream;
436
+ content: string;
437
+ }>;
438
+ }
439
+ export interface WorkerCreateAgentTaskTranscriptChunkResponse {
440
+ chunks: AgentTaskTranscriptChunkResponse[];
441
+ }
442
+ export interface WorkerCompleteAgentTaskRequest {
443
+ taskToken?: string;
444
+ workerKey?: string;
445
+ leaseToken?: string;
446
+ appId: number;
447
+ appVersionId: number;
448
+ result?: Record<string, unknown>;
449
+ tokensUsed?: number | null;
450
+ }
451
+ export interface WorkerFailAgentTaskRequest {
452
+ taskToken?: string;
453
+ workerKey?: string;
454
+ leaseToken?: string;
455
+ error: string;
456
+ result?: Record<string, unknown>;
457
+ }
458
+ export interface AdminAgentTasksResponse {
459
+ tasks: AgentTaskResponse[];
460
+ pagination: PaginationMeta;
461
+ }
462
+ export interface AdminAgentTaskDetailResponse {
463
+ task: AgentTaskResponse;
464
+ events: AgentTaskEventResponse[];
465
+ }
466
+ export interface AdminAgentTaskTranscriptResponse {
467
+ chunks: AgentTaskTranscriptChunkResponse[];
468
+ }
469
+ export interface AdminAgentWorkersStatusResponse {
470
+ checkedAt: string;
471
+ onlineWorkerCount: number;
472
+ onlineWorkers: AgentWorkerResponse[];
473
+ queuedTaskCount: number;
474
+ runningTaskCount: number;
475
+ oldestQueuedTaskId: number | null;
476
+ oldestQueuedAgeMs: number | null;
477
+ }
478
+ 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"];
479
+ export type AgentTaskUnavailableReason = typeof AGENT_TASK_UNAVAILABLE_REASON_VALUES[number];
480
+ export interface AgentTaskTargetAvailability {
481
+ target: AgentExecutionTarget;
482
+ available: boolean;
483
+ reason: AgentTaskUnavailableReason | null;
484
+ priceCredits: number;
485
+ onlineWorkers: AgentWorkerResponse[];
486
+ agentModels: AgentTaskAgentModelOption[];
487
+ }
488
+ export interface AgentTaskAvailabilityResponse {
489
+ kind: AgentTaskKind;
490
+ creditBalance: number;
491
+ targets: AgentTaskTargetAvailability[];
492
+ appOrigin?: AppOrigin | null;
493
+ pendingOutputVersion?: string | null;
494
+ latestCataloguePreviewEvent?: AgentTaskEventResponse | null;
495
+ }
496
+ export interface AgentTaskNewGameSuggestion {
497
+ id: string;
498
+ prompt: string;
499
+ }
500
+ export interface AgentTaskNewGameSuggestionsResponse {
501
+ suggestions: AgentTaskNewGameSuggestion[];
502
+ }
503
+ export interface CreateAppAgentTaskRequest {
504
+ target: AgentExecutionTarget;
505
+ agent: AgentRuntime;
506
+ model: string;
507
+ prompt: string;
508
+ inputs?: AgentTaskInput[];
200
509
  }
201
- export interface RemixCandidatesResponse {
202
- candidates: RemixCandidateGameIdeaResponse[];
510
+ export interface CreateAppAgentTaskResponse {
511
+ task: AgentTaskResponse;
512
+ events: AgentTaskEventResponse[];
513
+ }
514
+ export interface AppAgentTaskResponse {
515
+ task: AgentTaskResponse | null;
516
+ events: AgentTaskEventResponse[];
517
+ }
518
+ export type CreatorGameState = 'CREATING' | 'FAILED_CREATE' | 'DRAFT' | 'LIVE' | 'LIVE_WITH_DRAFT' | 'UPDATING' | 'FAILED_UPDATE';
519
+ export type CreatorGameActionKind = 'notify' | 'publish' | 'share' | 'play' | 'edit' | 'retry' | 'cancel' | 'delete' | 'history';
520
+ export interface CreatorGameAction {
521
+ kind: CreatorGameActionKind;
522
+ enabled: boolean;
523
+ label: string;
524
+ }
525
+ export interface CreatorGameListItem {
526
+ id: string;
527
+ state: CreatorGameState;
528
+ app: AppResponse | null;
529
+ latestVersion: AppVersionSummary | null;
530
+ latestTask: AgentTaskResponse | null;
531
+ preview: AgentTaskEventResponse | null;
532
+ title: string;
533
+ description?: string | null;
534
+ heroImageUrl?: string | null;
535
+ emoji?: string | null;
536
+ color?: string | null;
537
+ primaryAction: 'open' | 'retry' | 'cancel' | 'play' | 'publish' | 'share';
538
+ actions: CreatorGameAction[];
539
+ }
540
+ export interface CreatorGamesListResponse {
541
+ items: CreatorGameListItem[];
203
542
  pagination: PaginationMeta;
204
543
  }
544
+ export interface CreatorGameStatusResponse {
545
+ item: CreatorGameListItem;
546
+ currentVersion: AppVersionSummary | null;
547
+ draftVersion: AppVersionSummary | null;
548
+ activeOrLatestTask: AgentTaskResponse | null;
549
+ events: AgentTaskEventResponse[];
550
+ updateBaseVersion: AppVersionSummary | null;
551
+ availability: AgentTaskAvailabilityResponse | null;
552
+ }
553
+ export interface CreatorGameVersionsResponse {
554
+ item: CreatorGameListItem;
555
+ versions: AppVersionSummary[];
556
+ tasks: AgentTaskResponse[];
557
+ }
205
558
  export interface TagGroupSummary {
206
559
  slug: string;
207
560
  displayName: string;
@@ -225,6 +578,7 @@ export interface AppResponse {
225
578
  creatorUsername: string;
226
579
  createdAt: string;
227
580
  updatedAt: string;
581
+ origin?: AppOrigin;
228
582
  type: AppType;
229
583
  emoji?: string | null;
230
584
  color?: string | null;
@@ -287,6 +641,79 @@ export type AdminAppResponse = AppResponse;
287
641
  export interface AdminAppsListResponse {
288
642
  apps: AdminAppResponse[];
289
643
  }
644
+ export declare const PLATFORM_ANALYTICS_CLIENT_SURFACE_VALUES: readonly ["web_desktop", "web_mobile", "native_ios", "native_macos", "native_android", "cli", "admin"];
645
+ export type PlatformAnalyticsClientSurface = typeof PLATFORM_ANALYTICS_CLIENT_SURFACE_VALUES[number];
646
+ export interface AdminPlatformAnalyticsDailyBucket {
647
+ dateUtc: string;
648
+ newAccounts: number;
649
+ dau: number;
650
+ cliPaired: number;
651
+ gamesRegistered: number;
652
+ gamesUploaded: number;
653
+ aiGenerations: number;
654
+ gamesPlayed: number;
655
+ adsDisplayed: number;
656
+ }
657
+ export interface AdminPlatformAnalyticsTotals {
658
+ newAccounts: number;
659
+ activeUsers: number;
660
+ cliPaired: number;
661
+ gamesRegistered: number;
662
+ gamesUploaded: number;
663
+ aiGenerations: number;
664
+ gamesPlayed: number;
665
+ adsDisplayed: number;
666
+ }
667
+ export interface AdminPlatformAnalyticsDailySeriesPoint {
668
+ dateUtc: string;
669
+ count: number;
670
+ }
671
+ export interface AdminPlatformAnalyticsAiModalityDailyPoint extends AdminPlatformAnalyticsDailySeriesPoint {
672
+ modality: string;
673
+ }
674
+ export interface AdminPlatformAnalyticsAdFormatDailyPoint extends AdminPlatformAnalyticsDailySeriesPoint {
675
+ format: string;
676
+ }
677
+ export interface AdminPlatformAnalyticsClientSurfaceDailyPoint {
678
+ dateUtc: string;
679
+ clientSurface: PlatformAnalyticsClientSurface;
680
+ activeUsers: number;
681
+ eventCount: number;
682
+ }
683
+ export type AdminPlatformAnalyticsRequest = {
684
+ days?: 7 | 30 | 90;
685
+ fromDateUtc?: never;
686
+ toDateUtc?: never;
687
+ } | {
688
+ days?: never;
689
+ fromDateUtc: string;
690
+ toDateUtc: string;
691
+ };
692
+ export interface AdminPlatformAnalyticsResponse {
693
+ days: number;
694
+ fromDateUtc: string;
695
+ toDateUtc: string;
696
+ currentDau: number;
697
+ averageDau: number;
698
+ totals: AdminPlatformAnalyticsTotals;
699
+ daily: AdminPlatformAnalyticsDailyBucket[];
700
+ aiGenerationsByModality: Array<{
701
+ modality: string;
702
+ count: number;
703
+ }>;
704
+ aiGenerationsByModalityDaily: AdminPlatformAnalyticsAiModalityDailyPoint[];
705
+ adsByFormat: Array<{
706
+ format: string;
707
+ count: number;
708
+ }>;
709
+ adsByFormatDaily: AdminPlatformAnalyticsAdFormatDailyPoint[];
710
+ clientSurfaces: Array<{
711
+ clientSurface: PlatformAnalyticsClientSurface;
712
+ activeUsers: number;
713
+ eventCount: number;
714
+ }>;
715
+ clientSurfacesDaily: AdminPlatformAnalyticsClientSurfaceDailyPoint[];
716
+ }
290
717
  export interface AdminGameCollectionSummary {
291
718
  id: number;
292
719
  slug: string;