playcademy 0.14.33 → 0.14.34

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/dist/cli.js CHANGED
@@ -2958,7 +2958,7 @@ import { join as join13 } from "path";
2958
2958
  // package.json with { type: 'json' }
2959
2959
  var package_default2 = {
2960
2960
  name: "playcademy",
2961
- version: "0.14.32",
2961
+ version: "0.14.33",
2962
2962
  type: "module",
2963
2963
  exports: {
2964
2964
  ".": {
@@ -3021,7 +3021,8 @@ var package_default2 = {
3021
3021
  "json-colorizer": "^3.0.1",
3022
3022
  jszip: "^3.10.1",
3023
3023
  miniflare: "^4.20251008.0",
3024
- open: "^10.2.0"
3024
+ open: "^10.2.0",
3025
+ ws: "^8.18.3"
3025
3026
  },
3026
3027
  devDependencies: {
3027
3028
  "@cloudflare/workers-types": "^4.20251011.0",
@@ -3031,6 +3032,7 @@ var package_default2 = {
3031
3032
  "@playcademy/timeback": "workspace:*",
3032
3033
  "@playcademy/utils": "workspace:*",
3033
3034
  "@types/bun": "latest",
3035
+ "@types/ws": "^8.18.1",
3034
3036
  bumpp: "^10.2.3",
3035
3037
  rollup: "^4.50.2",
3036
3038
  "rollup-plugin-dts": "^6.2.3"
@@ -37,6 +37,13 @@ export const GAME_WORKER_DOMAINS = {
37
37
  staging: 'staging.playcademy.gg',
38
38
  } as const
39
39
 
40
+ /**
41
+ * Log collector worker URL
42
+ * Used by CLI to stream real-time logs from deployed games
43
+ * Works for both production and staging (game slugs include environment suffix)
44
+ */
45
+ export const LOG_COLLECTOR_URL = 'https://logs.playcademy.gg'
46
+
40
47
  /**
41
48
  * Type exports
42
49
  */
package/dist/index.d.ts CHANGED
@@ -1186,6 +1186,92 @@ interface DevServerOptions {
1186
1186
  customLogger?: PluginLogger;
1187
1187
  }
1188
1188
 
1189
+ /**
1190
+ * Configuration differences between existing and new game state
1191
+ */
1192
+ interface ConfigDiff {
1193
+ displayName?: {
1194
+ old: string;
1195
+ new: string;
1196
+ };
1197
+ emoji?: {
1198
+ old: string | undefined;
1199
+ new: string | undefined;
1200
+ };
1201
+ description?: {
1202
+ old: string | undefined;
1203
+ new: string | undefined;
1204
+ };
1205
+ gameType?: {
1206
+ old: string;
1207
+ new: string;
1208
+ };
1209
+ }
1210
+ /**
1211
+ * Build deployment changes
1212
+ */
1213
+ interface BuildDiff {
1214
+ changed?: boolean;
1215
+ previousSize?: number;
1216
+ currentSize?: number;
1217
+ }
1218
+ /**
1219
+ * Backend deployment changes
1220
+ */
1221
+ interface BackendDiff {
1222
+ changed?: boolean;
1223
+ /** Routes that were added (e.g., ['/api/bucket']) */
1224
+ addedRoutes?: string[];
1225
+ /** Routes that were removed (e.g., ['/api/kv']) */
1226
+ removedRoutes?: string[];
1227
+ /** Resources that were added (e.g., ['database']) */
1228
+ addedResources?: string[];
1229
+ /** Resources that were removed (e.g., ['keyValue']) */
1230
+ removedResources?: string[];
1231
+ previousServerSize?: number;
1232
+ currentServerSize?: number;
1233
+ previousDbSize?: number;
1234
+ currentDbSize?: number;
1235
+ previousBundleSize?: number;
1236
+ currentBundleSize?: number;
1237
+ forced?: boolean;
1238
+ schemaStatementCount?: number;
1239
+ }
1240
+ /**
1241
+ * Integration changes
1242
+ */
1243
+ interface IntegrationsDiff {
1244
+ previousKeys?: string[];
1245
+ currentKeys?: string[];
1246
+ metadata?: Array<{
1247
+ name: string;
1248
+ changes: Array<{
1249
+ label: string;
1250
+ current: string;
1251
+ next: string;
1252
+ field: string;
1253
+ }>;
1254
+ }>;
1255
+ }
1256
+ /**
1257
+ * Secret changes
1258
+ */
1259
+ interface SecretsDiff {
1260
+ previousKeys?: string[];
1261
+ currentKeys?: string[];
1262
+ }
1263
+ /**
1264
+ * Options for displaying deployment diff
1265
+ */
1266
+ interface DeploymentDiffOptions {
1267
+ diff: ConfigDiff;
1268
+ noChanges?: boolean;
1269
+ build?: BuildDiff;
1270
+ backend?: BackendDiff;
1271
+ integrations?: IntegrationsDiff;
1272
+ secrets?: SecretsDiff;
1273
+ }
1274
+
1189
1275
  /**
1190
1276
  * Engine Template System Types
1191
1277
  */
@@ -1278,6 +1364,41 @@ interface CallbackServerResult {
1278
1364
  error?: string;
1279
1365
  }
1280
1366
 
1367
+ /**
1368
+ * KV command types
1369
+ */
1370
+ /**
1371
+ * Statistics about KV storage
1372
+ */
1373
+ interface KeyStats {
1374
+ /** Total number of keys */
1375
+ totalKeys: number;
1376
+ /** Total size in bytes */
1377
+ totalSize: number;
1378
+ /** Information about the largest key */
1379
+ largestKey?: {
1380
+ name: string;
1381
+ size: number;
1382
+ };
1383
+ /** Keys grouped by prefix pattern */
1384
+ prefixes: Record<string, number>;
1385
+ }
1386
+ /**
1387
+ * Metadata about a specific key
1388
+ */
1389
+ interface KeyMetadata {
1390
+ /** The key name */
1391
+ key: string;
1392
+ /** Whether the key exists */
1393
+ exists: boolean;
1394
+ /** Size in bytes (if key exists) */
1395
+ size?: number;
1396
+ /** Parsed value */
1397
+ value?: unknown;
1398
+ /** Type of value stored */
1399
+ valueType?: 'json' | 'string';
1400
+ }
1401
+
1281
1402
  /**
1282
1403
  * @fileoverview Config Loader Types
1283
1404
  *
@@ -1293,6 +1414,46 @@ interface LoadConfigResult {
1293
1414
  configDir: string;
1294
1415
  }
1295
1416
 
1417
+ /**
1418
+ * Log Streaming Types
1419
+ */
1420
+ interface LogEntry {
1421
+ timestamp: number;
1422
+ scriptName: string;
1423
+ outcome: string;
1424
+ logs: Array<{
1425
+ level: string;
1426
+ message: unknown[];
1427
+ }>;
1428
+ exceptions: Array<{
1429
+ name: string;
1430
+ message: string;
1431
+ }>;
1432
+ request?: {
1433
+ url: string;
1434
+ method: string;
1435
+ };
1436
+ response?: {
1437
+ status: number;
1438
+ };
1439
+ }
1440
+ interface LogStreamUrlOptions {
1441
+ /** Worker ID to stream logs from */
1442
+ workerId: string;
1443
+ /** Authentication token */
1444
+ token: string;
1445
+ /** Include recent log history */
1446
+ history?: boolean;
1447
+ }
1448
+ interface LogStreamConfig {
1449
+ /** WebSocket URL to connect to */
1450
+ url: string;
1451
+ /** Game slug (for display purposes) */
1452
+ slug: string;
1453
+ /** Environment (for display purposes) */
1454
+ environment: 'staging' | 'production';
1455
+ }
1456
+
1296
1457
  /**
1297
1458
  * Preview options
1298
1459
  */
@@ -1320,127 +1481,6 @@ interface PreviewResponse {
1320
1481
  qrCode?: string;
1321
1482
  }
1322
1483
 
1323
- /**
1324
- * Configuration differences between existing and new game state
1325
- */
1326
- interface ConfigDiff {
1327
- displayName?: {
1328
- old: string;
1329
- new: string;
1330
- };
1331
- emoji?: {
1332
- old: string | undefined;
1333
- new: string | undefined;
1334
- };
1335
- description?: {
1336
- old: string | undefined;
1337
- new: string | undefined;
1338
- };
1339
- gameType?: {
1340
- old: string;
1341
- new: string;
1342
- };
1343
- }
1344
- /**
1345
- * Build deployment changes
1346
- */
1347
- interface BuildDiff {
1348
- changed?: boolean;
1349
- previousSize?: number;
1350
- currentSize?: number;
1351
- }
1352
- /**
1353
- * Backend deployment changes
1354
- */
1355
- interface BackendDiff {
1356
- changed?: boolean;
1357
- /** Routes that were added (e.g., ['/api/bucket']) */
1358
- addedRoutes?: string[];
1359
- /** Routes that were removed (e.g., ['/api/kv']) */
1360
- removedRoutes?: string[];
1361
- /** Resources that were added (e.g., ['database']) */
1362
- addedResources?: string[];
1363
- /** Resources that were removed (e.g., ['keyValue']) */
1364
- removedResources?: string[];
1365
- previousServerSize?: number;
1366
- currentServerSize?: number;
1367
- previousDbSize?: number;
1368
- currentDbSize?: number;
1369
- previousBundleSize?: number;
1370
- currentBundleSize?: number;
1371
- forced?: boolean;
1372
- schemaStatementCount?: number;
1373
- }
1374
- /**
1375
- * Integration changes
1376
- */
1377
- interface IntegrationsDiff {
1378
- previousKeys?: string[];
1379
- currentKeys?: string[];
1380
- metadata?: Array<{
1381
- name: string;
1382
- changes: Array<{
1383
- label: string;
1384
- current: string;
1385
- next: string;
1386
- field: string;
1387
- }>;
1388
- }>;
1389
- }
1390
- /**
1391
- * Secret changes
1392
- */
1393
- interface SecretsDiff {
1394
- previousKeys?: string[];
1395
- currentKeys?: string[];
1396
- }
1397
- /**
1398
- * Options for displaying deployment diff
1399
- */
1400
- interface DeploymentDiffOptions {
1401
- diff: ConfigDiff;
1402
- noChanges?: boolean;
1403
- build?: BuildDiff;
1404
- backend?: BackendDiff;
1405
- integrations?: IntegrationsDiff;
1406
- secrets?: SecretsDiff;
1407
- }
1408
-
1409
- /**
1410
- * KV command types
1411
- */
1412
- /**
1413
- * Statistics about KV storage
1414
- */
1415
- interface KeyStats {
1416
- /** Total number of keys */
1417
- totalKeys: number;
1418
- /** Total size in bytes */
1419
- totalSize: number;
1420
- /** Information about the largest key */
1421
- largestKey?: {
1422
- name: string;
1423
- size: number;
1424
- };
1425
- /** Keys grouped by prefix pattern */
1426
- prefixes: Record<string, number>;
1427
- }
1428
- /**
1429
- * Metadata about a specific key
1430
- */
1431
- interface KeyMetadata {
1432
- /** The key name */
1433
- key: string;
1434
- /** Whether the key exists */
1435
- exists: boolean;
1436
- /** Size in bytes (if key exists) */
1437
- size?: number;
1438
- /** Parsed value */
1439
- value?: unknown;
1440
- /** Type of value stored */
1441
- valueType?: 'json' | 'string';
1442
- }
1443
-
1444
1484
  /**
1445
1485
  * Project directory info collected during init prompts.
1446
1486
  * Directory is NOT created until scaffolding step.
@@ -1454,4 +1494,4 @@ interface ProjectDirectoryInfo {
1454
1494
  cancelled: boolean;
1455
1495
  }
1456
1496
 
1457
- export type { ApiConfig, ApiErrorResponse, ApiKeyListItem, ApiKeyWithSecret, ApiRequestOptions, AuthProfile, AuthStore, AuthStrategy, BackendBundle, BackendDeploymentMetadata, BackendDiff, BackendFeatures, BucketBulkOptions, BucketDeleteOptions, BucketGetOptions, BucketListOptions, BucketPutOptions, BuildDiff, BulkCollectionResult, BundleOptions, CallbackServerResult, CollectedFile, ComponentConfig, ComponentResourceConfig, ConfigDiff, CreateApiKeyResponse, CustomRoutesIntegrationOptions, DatabaseIntegrationOptions, DeployConfig, DeployNewGameOptions, DeployedGameInfo, DeploymentChanges, DeploymentContext, DeploymentDiffOptions, DeploymentPlan, DeploymentResult, DevServerOptions, EmbeddedSourcePaths, EngineConfig, EngineType, EnvironmentAuthProfiles, GameStore, IntegrationChangeDetector, IntegrationChangeDetectors, IntegrationConfigChange, IntegrationsConfig, IntegrationsDiff, KeyMetadata, KeyStats, LoadConfigResult, LoginCredentials, LoginResponse, OrganizationConfig, PlaycademyConfig, PluginLogger, PreviewOptions, PreviewResponse, ProjectDirectoryInfo, ResourceConfig, ScaffoldResult, SecretsDiff, SignInResponse, SsoCallbackData, Template, TemplateFramework, TemplateHook, TemplateHookOptions, TemplateSource, TimebackBaseConfig, TimebackCourseConfig, TimebackCourseConfigWithOverrides, TimebackGrade, TimebackIntegrationConfig, TimebackSourcedIds, TimebackSubject, TokenType, UpdateExistingGameOptions };
1497
+ export type { ApiConfig, ApiErrorResponse, ApiKeyListItem, ApiKeyWithSecret, ApiRequestOptions, AuthProfile, AuthStore, AuthStrategy, BackendBundle, BackendDeploymentMetadata, BackendDiff, BackendFeatures, BucketBulkOptions, BucketDeleteOptions, BucketGetOptions, BucketListOptions, BucketPutOptions, BuildDiff, BulkCollectionResult, BundleOptions, CallbackServerResult, CollectedFile, ComponentConfig, ComponentResourceConfig, ConfigDiff, CreateApiKeyResponse, CustomRoutesIntegrationOptions, DatabaseIntegrationOptions, DeployConfig, DeployNewGameOptions, DeployedGameInfo, DeploymentChanges, DeploymentContext, DeploymentDiffOptions, DeploymentPlan, DeploymentResult, DevServerOptions, EmbeddedSourcePaths, EngineConfig, EngineType, EnvironmentAuthProfiles, GameStore, IntegrationChangeDetector, IntegrationChangeDetectors, IntegrationConfigChange, IntegrationsConfig, IntegrationsDiff, KeyMetadata, KeyStats, LoadConfigResult, LogEntry, LogStreamConfig, LogStreamUrlOptions, LoginCredentials, LoginResponse, OrganizationConfig, PlaycademyConfig, PluginLogger, PreviewOptions, PreviewResponse, ProjectDirectoryInfo, ResourceConfig, ScaffoldResult, SecretsDiff, SignInResponse, SsoCallbackData, Template, TemplateFramework, TemplateHook, TemplateHookOptions, TemplateSource, TimebackBaseConfig, TimebackCourseConfig, TimebackCourseConfigWithOverrides, TimebackGrade, TimebackIntegrationConfig, TimebackSourcedIds, TimebackSubject, TokenType, UpdateExistingGameOptions };