playcademy 0.14.14-alpha.1 → 0.14.14-alpha.2

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.
@@ -6,32 +6,15 @@
6
6
  */
7
7
 
8
8
  /**
9
- * Core Playcademy domains
10
- */
11
- export const APEX_DOMAIN = 'playcademy.net'
12
- export const DEV_DOMAIN = 'playcademy.dev'
13
- export const GAMES_DOMAIN = 'playcademy.gg'
14
-
15
- /**
16
- * Playcademy domain names grouped
9
+ * Playcademy domain names
17
10
  */
18
11
  export const PLAYCADEMY_DOMAINS = {
19
12
  /** Primary domain (hub, landing pages) */
20
- apex: APEX_DOMAIN,
21
- /** Development/utility domain */
22
- dev: DEV_DOMAIN,
13
+ apex: 'playcademy.net',
14
+ /** Marketing/alternative domain */
15
+ apexAlt: 'playcademy.com',
23
16
  /** Game backend worker domain */
24
- games: GAMES_DOMAIN,
25
- } as const
26
-
27
- /**
28
- * CDN domains by environment
29
- */
30
- export const CDN_DOMAINS = {
31
- /** Production CDN: https://cdn.playcademy.net */
32
- production: `https://cdn.${APEX_DOMAIN}`,
33
- /** Development CDN: https://cdn.dev.playcademy.net */
34
- staging: `https://cdn.dev.${APEX_DOMAIN}`,
17
+ games: 'playcademy.gg',
35
18
  } as const
36
19
 
37
20
  /**
@@ -6,7 +6,6 @@
6
6
  * and other constants that need to be consistent across multiple packages.
7
7
  */
8
8
 
9
- export * from './academics'
10
9
  export * from './auth'
11
10
  export * from './domains'
12
11
  export * from './env-vars'
@@ -8,6 +8,14 @@ export { GAME_WORKER_DOMAINS, PLAYCADEMY_BASE_URLS, PLAYCADEMY_DOMAINS } from '@
8
8
  * Used when integrations.customRoutes.directory is not specified in config
9
9
  */
10
10
  declare const DEFAULT_API_ROUTES_DIRECTORY: string;
11
+ /**
12
+ * Server root directory (fixed location)
13
+ */
14
+ declare const SERVER_ROOT_DIRECTORY = "server";
15
+ /**
16
+ * Server library/utilities directory (fixed location)
17
+ */
18
+ declare const SERVER_LIB_DIRECTORY: string;
11
19
  /**
12
20
  * Auth routes subdirectory name within API directory (fixed structure)
13
21
  */
@@ -84,8 +92,6 @@ declare const CLOUDFLARE_COMPATIBILITY_DATE = "2024-01-01";
84
92
  declare const CLOUDFLARE_BINDINGS: {
85
93
  /** R2 bucket binding name */
86
94
  readonly BUCKET: "BUCKET";
87
- /** Problem sets bucket binding name */
88
- readonly BUCKET_PROBLEM_SETS: "PROBLEM_SETS";
89
95
  /** KV namespace binding name */
90
96
  readonly KV: "KV";
91
97
  /** D1 database binding name */
@@ -276,38 +282,9 @@ declare const DEFAULT_PORTS: {
276
282
  readonly BACKEND: 8788;
277
283
  };
278
284
 
279
- /**
280
- * Server directory structure constants
281
- */
282
- /**
283
- * Server root directory (fixed location)
284
- */
285
- declare const SERVER_ROOT_DIRECTORY = "server";
286
- /**
287
- * Server library/utilities directory (fixed location)
288
- */
289
- declare const SERVER_LIB_DIRECTORY: string;
290
- /**
291
- * Public assets directory (fixed location)
292
- */
293
- declare const PUBLIC_DIRECTORY = "public";
294
- /**
295
- * Academic content subdirectory within public/
296
- */
297
- declare const ACADEMICS_PUBLIC_DIRECTORY: string;
298
- /**
299
- * Problem sets directory (frontend static assets)
300
- * Used by TimeBack integration for educational content
301
- */
302
- declare const PROBLEM_SETS_DIRECTORY: string;
303
- /**
304
- * Problem sets URL path (for serving via worker/middleware)
305
- */
306
- declare const PROBLEM_SETS_URL_PATH = "academics/problem-sets";
307
-
308
285
  /**
309
286
  * Config file names to search for
310
287
  */
311
288
  declare const CONFIG_FILE_NAMES: string[];
312
289
 
313
- export { ACADEMICS_PUBLIC_DIRECTORY, AUTH_API_SUBDIRECTORY, AUTH_CONFIG_FILE, AUTH_PROVIDER_NAMES, BETTER_AUTH_VERSION, BUCKET_ALWAYS_SKIP, CALLBACK_PATH, CALLBACK_PORT, CLI_DEFAULT_OUTPUTS, CLI_DIRECTORIES, CLI_FILES, CLI_USER_DIRECTORIES, CLOUDFLARE_BINDINGS, CLOUDFLARE_COMPATIBILITY_DATE, CONFIG_FILE_NAMES, DB_FILES, DEFAULT_API_ROUTES_DIRECTORY, DEFAULT_DATABASE_DIRECTORY, DEFAULT_PORTS, DRIZZLE_CONFIG_FILES, ENV_EXAMPLE_FILE, ENV_FILES, GODOT_BUILD_DIRECTORIES, GODOT_BUILD_OUTPUTS, GODOT_EXECUTABLE_PATTERNS, GODOT_EXPORT_PRESETS_FILE, GODOT_PROJECT_FILE, GODOT_WEB_PLATFORM, MINIFLARE_D1_DIRECTORY, OAUTH_CALLBACK_URL_PATTERN, PLACEHOLDER_GAME_URL, PLAYCADEMY_AUTH_VERSION, PROBLEM_SETS_DIRECTORY, PROBLEM_SETS_URL_PATH, PUBLIC_DIRECTORY, SAMPLE_API_SUBDIRECTORY, SAMPLE_BUCKET_FILENAME, SAMPLE_CUSTOM_FILENAME, SAMPLE_DATABASE_FILENAME, SAMPLE_KV_FILENAME, SCHEMA_SUBDIRECTORY, SERVER_LIB_DIRECTORY, SERVER_ROOT_DIRECTORY, SSO_AUTH_TIMEOUT_MS, TSCONFIG_FILES, WORKSPACE_NAME };
290
+ export { AUTH_API_SUBDIRECTORY, AUTH_CONFIG_FILE, AUTH_PROVIDER_NAMES, BETTER_AUTH_VERSION, BUCKET_ALWAYS_SKIP, CALLBACK_PATH, CALLBACK_PORT, CLI_DEFAULT_OUTPUTS, CLI_DIRECTORIES, CLI_FILES, CLI_USER_DIRECTORIES, CLOUDFLARE_BINDINGS, CLOUDFLARE_COMPATIBILITY_DATE, CONFIG_FILE_NAMES, DB_FILES, DEFAULT_API_ROUTES_DIRECTORY, DEFAULT_DATABASE_DIRECTORY, DEFAULT_PORTS, DRIZZLE_CONFIG_FILES, ENV_EXAMPLE_FILE, ENV_FILES, GODOT_BUILD_DIRECTORIES, GODOT_BUILD_OUTPUTS, GODOT_EXECUTABLE_PATTERNS, GODOT_EXPORT_PRESETS_FILE, GODOT_PROJECT_FILE, GODOT_WEB_PLATFORM, MINIFLARE_D1_DIRECTORY, OAUTH_CALLBACK_URL_PATTERN, PLACEHOLDER_GAME_URL, PLAYCADEMY_AUTH_VERSION, SAMPLE_API_SUBDIRECTORY, SAMPLE_BUCKET_FILENAME, SAMPLE_CUSTOM_FILENAME, SAMPLE_DATABASE_FILENAME, SAMPLE_KV_FILENAME, SCHEMA_SUBDIRECTORY, SERVER_LIB_DIRECTORY, SERVER_ROOT_DIRECTORY, SSO_AUTH_TIMEOUT_MS, TSCONFIG_FILES, WORKSPACE_NAME };
package/dist/constants.js CHANGED
@@ -1,17 +1,8 @@
1
1
  // src/constants/api.ts
2
- import { join as join2 } from "node:path";
3
-
4
- // src/constants/server.ts
5
2
  import { join } from "node:path";
3
+ var DEFAULT_API_ROUTES_DIRECTORY = join("server", "api");
6
4
  var SERVER_ROOT_DIRECTORY = "server";
7
- var SERVER_LIB_DIRECTORY = join(SERVER_ROOT_DIRECTORY, "lib");
8
- var PUBLIC_DIRECTORY = "public";
9
- var ACADEMICS_PUBLIC_DIRECTORY = join(PUBLIC_DIRECTORY, "academics");
10
- var PROBLEM_SETS_DIRECTORY = join(ACADEMICS_PUBLIC_DIRECTORY, "problem-sets");
11
- var PROBLEM_SETS_URL_PATH = "academics/problem-sets";
12
-
13
- // src/constants/api.ts
14
- var DEFAULT_API_ROUTES_DIRECTORY = join2(SERVER_ROOT_DIRECTORY, "api");
5
+ var SERVER_LIB_DIRECTORY = join("server", "lib");
15
6
  var AUTH_API_SUBDIRECTORY = "auth";
16
7
  var SAMPLE_API_SUBDIRECTORY = "sample";
17
8
  var SAMPLE_CUSTOM_FILENAME = "custom.ts";
@@ -66,11 +57,9 @@ var package_default = {
66
57
  "sync-engine-assets": "bun scripts/sync-engine-assets.ts",
67
58
  "sync-vite-templates": "bun scripts/sync-vite-templates.ts",
68
59
  "sync-godot-template": "bun scripts/sync-godot-template.ts",
69
- "sync-problem-sets": "sst shell -- bun scripts/sync-problem-sets.ts",
70
60
  "sync:all": "bun scripts/sync-all.ts",
71
61
  cf: "sst shell -- bun scripts/setup-cloudflare-dispatch.ts",
72
62
  "list-s3-bucket": "sst shell -- bun scripts/list-s3-bucket.ts",
73
- "invalidate-cdn": "sst shell -- bun scripts/invalidate-cdn.ts",
74
63
  doctor: "bunx sst shell -- bun scripts/doctor.ts",
75
64
  format: "bun run --filter '*' format",
76
65
  lint: "bun run --filter '*' lint",
@@ -170,8 +159,6 @@ var CLOUDFLARE_COMPATIBILITY_DATE = "2024-01-01";
170
159
  var CLOUDFLARE_BINDINGS = {
171
160
  /** R2 bucket binding name */
172
161
  BUCKET: "BUCKET",
173
- /** Problem sets bucket binding name */
174
- BUCKET_PROBLEM_SETS: "PROBLEM_SETS",
175
162
  /** KV namespace binding name */
176
163
  KV: "KV",
177
164
  /** D1 database binding name */
@@ -180,8 +167,8 @@ var CLOUDFLARE_BINDINGS = {
180
167
  var MINIFLARE_D1_DIRECTORY = "miniflare-D1DatabaseObject";
181
168
 
182
169
  // src/constants/database.ts
183
- import { join as join3 } from "path";
184
- var DEFAULT_DATABASE_DIRECTORY = join3("server", "db");
170
+ import { join as join2 } from "path";
171
+ var DEFAULT_DATABASE_DIRECTORY = join2("server", "db");
185
172
  var SCHEMA_SUBDIRECTORY = "schema";
186
173
  var DB_FILES = {
187
174
  /** Index file name */
@@ -198,7 +185,7 @@ var DB_FILES = {
198
185
  var DRIZZLE_CONFIG_FILES = ["drizzle.config.ts", "drizzle.config.js"];
199
186
 
200
187
  // src/constants/godot.ts
201
- import { join as join4 } from "node:path";
188
+ import { join as join3 } from "node:path";
202
189
  var GODOT_PROJECT_FILE = "project.godot";
203
190
  var GODOT_EXPORT_PRESETS_FILE = "export_presets.cfg";
204
191
  var GODOT_WEB_PLATFORM = 'platform="Web"';
@@ -206,13 +193,13 @@ var GODOT_BUILD_DIRECTORIES = {
206
193
  /** Root build directory (cleared before each export) */
207
194
  ROOT: "build",
208
195
  /** Web export subdirectory */
209
- WEB: join4("build", "web")
196
+ WEB: join3("build", "web")
210
197
  };
211
198
  var GODOT_BUILD_OUTPUTS = {
212
199
  /** Exported web build entry point */
213
- INDEX_HTML: join4("build", "web", "index.html"),
200
+ INDEX_HTML: join3("build", "web", "index.html"),
214
201
  /** Packaged zip file (created by Godot export) */
215
- ZIP: join4("build", "web_playcademy.zip")
202
+ ZIP: join3("build", "web_playcademy.zip")
216
203
  };
217
204
  var GODOT_EXECUTABLE_PATTERNS = {
218
205
  /** macOS app bundle suffix */
@@ -235,17 +222,17 @@ var CALLBACK_PATH = "/callback";
235
222
  var SSO_AUTH_TIMEOUT_MS = 3e4;
236
223
 
237
224
  // src/constants/paths.ts
238
- import { join as join5 } from "path";
225
+ import { join as join4 } from "path";
239
226
  var WORKSPACE_NAME = ".playcademy";
240
227
  var CLI_DIRECTORIES = {
241
228
  /** Root directory for CLI artifacts in workspace */
242
229
  WORKSPACE: WORKSPACE_NAME,
243
230
  /** Database directory within workspace */
244
- DATABASE: join5(WORKSPACE_NAME, "db"),
231
+ DATABASE: join4(WORKSPACE_NAME, "db"),
245
232
  /** KV storage directory within workspace */
246
- KV: join5(WORKSPACE_NAME, "kv"),
233
+ KV: join4(WORKSPACE_NAME, "kv"),
247
234
  /** Bucket storage directory within workspace */
248
- BUCKET: join5(WORKSPACE_NAME, "bucket")
235
+ BUCKET: join4(WORKSPACE_NAME, "bucket")
249
236
  };
250
237
  var CLI_USER_DIRECTORIES = {
251
238
  /** User config directory for auth, games store, etc. */
@@ -253,7 +240,7 @@ var CLI_USER_DIRECTORIES = {
253
240
  };
254
241
  var CLI_DEFAULT_OUTPUTS = {
255
242
  /** Default worker bundle output for debug command */
256
- WORKER_BUNDLE: join5(WORKSPACE_NAME, "worker-bundle.js")
243
+ WORKER_BUNDLE: join4(WORKSPACE_NAME, "worker-bundle.js")
257
244
  };
258
245
  var CLI_FILES = {
259
246
  /** Auth store file in user config directory */
@@ -280,22 +267,13 @@ var CONFIG_FILE_NAMES = [
280
267
  ];
281
268
 
282
269
  // ../constants/src/domains.ts
283
- var APEX_DOMAIN = "playcademy.net";
284
- var DEV_DOMAIN = "playcademy.dev";
285
- var GAMES_DOMAIN = "playcademy.gg";
286
270
  var PLAYCADEMY_DOMAINS = {
287
271
  /** Primary domain (hub, landing pages) */
288
- apex: APEX_DOMAIN,
289
- /** Development/utility domain */
290
- dev: DEV_DOMAIN,
272
+ apex: "playcademy.net",
273
+ /** Marketing/alternative domain */
274
+ apexAlt: "playcademy.com",
291
275
  /** Game backend worker domain */
292
- games: GAMES_DOMAIN
293
- };
294
- var CDN_DOMAINS = {
295
- /** Production CDN: https://cdn.playcademy.net */
296
- production: `https://cdn.${APEX_DOMAIN}`,
297
- /** Development CDN: https://cdn.dev.playcademy.net */
298
- staging: `https://cdn.dev.${APEX_DOMAIN}`
276
+ games: "playcademy.gg"
299
277
  };
300
278
  var PLAYCADEMY_BASE_URLS = {
301
279
  production: "https://hub.playcademy.net",
@@ -337,7 +315,6 @@ var BADGES = {
337
315
  FIRST_GAME: ITEM_SLUGS.FIRST_GAME_BADGE
338
316
  };
339
317
  export {
340
- ACADEMICS_PUBLIC_DIRECTORY,
341
318
  AUTH_API_SUBDIRECTORY,
342
319
  AUTH_CONFIG_FILE,
343
320
  AUTH_PROVIDER_NAMES,
@@ -372,9 +349,6 @@ export {
372
349
  PLAYCADEMY_AUTH_VERSION,
373
350
  PLAYCADEMY_BASE_URLS,
374
351
  PLAYCADEMY_DOMAINS,
375
- PROBLEM_SETS_DIRECTORY,
376
- PROBLEM_SETS_URL_PATH,
377
- PUBLIC_DIRECTORY,
378
352
  SAMPLE_API_SUBDIRECTORY,
379
353
  SAMPLE_BUCKET_FILENAME,
380
354
  SAMPLE_CUSTOM_FILENAME,
package/dist/db.js CHANGED
@@ -1430,21 +1430,12 @@ var init_file_loader = __esm({
1430
1430
 
1431
1431
  // src/lib/db/path.ts
1432
1432
  import { copyFileSync, existsSync, mkdirSync, readdirSync, unlinkSync } from "fs";
1433
- import { join as join6 } from "path";
1433
+ import { join as join5 } from "path";
1434
1434
 
1435
1435
  // src/constants/api.ts
1436
- import { join as join2 } from "node:path";
1437
-
1438
- // src/constants/server.ts
1439
1436
  import { join } from "node:path";
1440
- var SERVER_ROOT_DIRECTORY = "server";
1441
- var SERVER_LIB_DIRECTORY = join(SERVER_ROOT_DIRECTORY, "lib");
1442
- var PUBLIC_DIRECTORY = "public";
1443
- var ACADEMICS_PUBLIC_DIRECTORY = join(PUBLIC_DIRECTORY, "academics");
1444
- var PROBLEM_SETS_DIRECTORY = join(ACADEMICS_PUBLIC_DIRECTORY, "problem-sets");
1445
-
1446
- // src/constants/api.ts
1447
- var DEFAULT_API_ROUTES_DIRECTORY = join2(SERVER_ROOT_DIRECTORY, "api");
1437
+ var DEFAULT_API_ROUTES_DIRECTORY = join("server", "api");
1438
+ var SERVER_LIB_DIRECTORY = join("server", "lib");
1448
1439
 
1449
1440
  // ../../package.json
1450
1441
  var package_default = {
@@ -1493,11 +1484,9 @@ var package_default = {
1493
1484
  "sync-engine-assets": "bun scripts/sync-engine-assets.ts",
1494
1485
  "sync-vite-templates": "bun scripts/sync-vite-templates.ts",
1495
1486
  "sync-godot-template": "bun scripts/sync-godot-template.ts",
1496
- "sync-problem-sets": "sst shell -- bun scripts/sync-problem-sets.ts",
1497
1487
  "sync:all": "bun scripts/sync-all.ts",
1498
1488
  cf: "sst shell -- bun scripts/setup-cloudflare-dispatch.ts",
1499
1489
  "list-s3-bucket": "sst shell -- bun scripts/list-s3-bucket.ts",
1500
- "invalidate-cdn": "sst shell -- bun scripts/invalidate-cdn.ts",
1501
1490
  doctor: "bunx sst shell -- bun scripts/doctor.ts",
1502
1491
  format: "bun run --filter '*' format",
1503
1492
  lint: "bun run --filter '*' lint",
@@ -1580,8 +1569,6 @@ var BUCKET_ALWAYS_SKIP = [".git", ".DS_Store", ".gitignore", ...ENV_FILES];
1580
1569
  var CLOUDFLARE_BINDINGS = {
1581
1570
  /** R2 bucket binding name */
1582
1571
  BUCKET: "BUCKET",
1583
- /** Problem sets bucket binding name */
1584
- BUCKET_PROBLEM_SETS: "PROBLEM_SETS",
1585
1572
  /** KV namespace binding name */
1586
1573
  KV: "KV",
1587
1574
  /** D1 database binding name */
@@ -1590,40 +1577,40 @@ var CLOUDFLARE_BINDINGS = {
1590
1577
  var MINIFLARE_D1_DIRECTORY = "miniflare-D1DatabaseObject";
1591
1578
 
1592
1579
  // src/constants/database.ts
1593
- import { join as join3 } from "path";
1594
- var DEFAULT_DATABASE_DIRECTORY = join3("server", "db");
1580
+ import { join as join2 } from "path";
1581
+ var DEFAULT_DATABASE_DIRECTORY = join2("server", "db");
1595
1582
 
1596
1583
  // src/constants/godot.ts
1597
- import { join as join4 } from "node:path";
1584
+ import { join as join3 } from "node:path";
1598
1585
  var GODOT_BUILD_DIRECTORIES = {
1599
1586
  /** Root build directory (cleared before each export) */
1600
1587
  ROOT: "build",
1601
1588
  /** Web export subdirectory */
1602
- WEB: join4("build", "web")
1589
+ WEB: join3("build", "web")
1603
1590
  };
1604
1591
  var GODOT_BUILD_OUTPUTS = {
1605
1592
  /** Exported web build entry point */
1606
- INDEX_HTML: join4("build", "web", "index.html"),
1593
+ INDEX_HTML: join3("build", "web", "index.html"),
1607
1594
  /** Packaged zip file (created by Godot export) */
1608
- ZIP: join4("build", "web_playcademy.zip")
1595
+ ZIP: join3("build", "web_playcademy.zip")
1609
1596
  };
1610
1597
 
1611
1598
  // src/constants/paths.ts
1612
- import { join as join5 } from "path";
1599
+ import { join as join4 } from "path";
1613
1600
  var WORKSPACE_NAME = ".playcademy";
1614
1601
  var CLI_DIRECTORIES = {
1615
1602
  /** Root directory for CLI artifacts in workspace */
1616
1603
  WORKSPACE: WORKSPACE_NAME,
1617
1604
  /** Database directory within workspace */
1618
- DATABASE: join5(WORKSPACE_NAME, "db"),
1605
+ DATABASE: join4(WORKSPACE_NAME, "db"),
1619
1606
  /** KV storage directory within workspace */
1620
- KV: join5(WORKSPACE_NAME, "kv"),
1607
+ KV: join4(WORKSPACE_NAME, "kv"),
1621
1608
  /** Bucket storage directory within workspace */
1622
- BUCKET: join5(WORKSPACE_NAME, "bucket")
1609
+ BUCKET: join4(WORKSPACE_NAME, "bucket")
1623
1610
  };
1624
1611
  var CLI_DEFAULT_OUTPUTS = {
1625
1612
  /** Default worker bundle output for debug command */
1626
- WORKER_BUNDLE: join5(WORKSPACE_NAME, "worker-bundle.js")
1613
+ WORKER_BUNDLE: join4(WORKSPACE_NAME, "worker-bundle.js")
1627
1614
  };
1628
1615
  var CLI_FILES = {
1629
1616
  /** Auth store file in user config directory */
@@ -1634,15 +1621,6 @@ var CLI_FILES = {
1634
1621
  INITIAL_DATABASE: "initial.sqlite"
1635
1622
  };
1636
1623
 
1637
- // ../constants/src/domains.ts
1638
- var APEX_DOMAIN = "playcademy.net";
1639
- var CDN_DOMAINS = {
1640
- /** Production CDN: https://cdn.playcademy.net */
1641
- production: `https://cdn.${APEX_DOMAIN}`,
1642
- /** Development CDN: https://cdn.dev.playcademy.net */
1643
- staging: `https://cdn.dev.${APEX_DOMAIN}`
1644
- };
1645
-
1646
1624
  // ../constants/src/overworld.ts
1647
1625
  var ITEM_SLUGS = {
1648
1626
  /** Primary platform currency */
@@ -1683,11 +1661,11 @@ var ensureDirectoryExists = (dir) => {
1683
1661
  }
1684
1662
  };
1685
1663
  var findMiniflareDatabase = (dbDir) => {
1686
- const miniflareDir = join6(dbDir, MINIFLARE_D1_DIRECTORY);
1664
+ const miniflareDir = join5(dbDir, MINIFLARE_D1_DIRECTORY);
1687
1665
  if (!existsSync(miniflareDir)) return null;
1688
1666
  const sqliteFiles = readdirSync(miniflareDir).filter((file) => file.endsWith(".sqlite"));
1689
1667
  if (sqliteFiles.length === 0) return null;
1690
- return join6(miniflareDir, sqliteFiles[0]);
1668
+ return join5(miniflareDir, sqliteFiles[0]);
1691
1669
  };
1692
1670
  var migrateInitialDbToTarget = (initialPath, targetPath) => {
1693
1671
  if (!existsSync(initialPath)) return;
@@ -1695,7 +1673,7 @@ var migrateInitialDbToTarget = (initialPath, targetPath) => {
1695
1673
  unlinkSync(initialPath);
1696
1674
  };
1697
1675
  function getDevDbPath() {
1698
- const initialDbPath = join6(DB_DIRECTORY, INITIAL_DB_NAME);
1676
+ const initialDbPath = join5(DB_DIRECTORY, INITIAL_DB_NAME);
1699
1677
  ensureDirectoryExists(DB_DIRECTORY);
1700
1678
  const miniflareDbPath = findMiniflareDatabase(DB_DIRECTORY);
1701
1679
  if (miniflareDbPath) {
@@ -1759,7 +1737,7 @@ async function bundleSeedWorker(seedFilePath, projectPath) {
1759
1737
  // src/lib/db/reset.ts
1760
1738
  import { execSync as execSync2 } from "child_process";
1761
1739
  import { rmSync as rmSync2 } from "fs";
1762
- import { join as join9 } from "path";
1740
+ import { join as join8 } from "path";
1763
1741
 
1764
1742
  // ../utils/src/ansi.ts
1765
1743
  var colors = {
@@ -1988,7 +1966,7 @@ init_package_json();
1988
1966
  // ../utils/src/package-manager.ts
1989
1967
  import { execSync } from "child_process";
1990
1968
  import { existsSync as existsSync2 } from "fs";
1991
- import { join as join7 } from "path";
1969
+ import { join as join6 } from "path";
1992
1970
  function isCommandAvailable(command) {
1993
1971
  try {
1994
1972
  execSync(`command -v ${command}`, { stdio: "ignore" });
@@ -1998,16 +1976,16 @@ function isCommandAvailable(command) {
1998
1976
  }
1999
1977
  }
2000
1978
  function detectPackageManager(cwd = process.cwd()) {
2001
- if (existsSync2(join7(cwd, "bun.lock")) || existsSync2(join7(cwd, "bun.lockb"))) {
1979
+ if (existsSync2(join6(cwd, "bun.lock")) || existsSync2(join6(cwd, "bun.lockb"))) {
2002
1980
  return "bun";
2003
1981
  }
2004
- if (existsSync2(join7(cwd, "pnpm-lock.yaml"))) {
1982
+ if (existsSync2(join6(cwd, "pnpm-lock.yaml"))) {
2005
1983
  return "pnpm";
2006
1984
  }
2007
- if (existsSync2(join7(cwd, "yarn.lock"))) {
1985
+ if (existsSync2(join6(cwd, "yarn.lock"))) {
2008
1986
  return "yarn";
2009
1987
  }
2010
- if (existsSync2(join7(cwd, "package-lock.json"))) {
1988
+ if (existsSync2(join6(cwd, "package-lock.json"))) {
2011
1989
  return "npm";
2012
1990
  }
2013
1991
  return detectByCommandAvailability();
@@ -2932,12 +2910,12 @@ var currentDir = dirname(fileURLToPath(import.meta.url));
2932
2910
  // src/lib/core/import.ts
2933
2911
  import { mkdtempSync, rmSync } from "fs";
2934
2912
  import { tmpdir } from "os";
2935
- import { join as join8 } from "path";
2913
+ import { join as join7 } from "path";
2936
2914
  import { pathToFileURL } from "url";
2937
2915
  import * as esbuild from "esbuild";
2938
2916
  async function importTypescriptFile(filePath, bundleOptions) {
2939
- const tempDir = mkdtempSync(join8(tmpdir(), "playcademy-import-"));
2940
- const outFile = join8(tempDir, "bundle.mjs");
2917
+ const tempDir = mkdtempSync(join7(tmpdir(), "playcademy-import-"));
2918
+ const outFile = join7(tempDir, "bundle.mjs");
2941
2919
  try {
2942
2920
  await esbuild.build({
2943
2921
  entryPoints: [filePath],
@@ -2960,7 +2938,7 @@ async function importTypescriptFile(filePath, bundleOptions) {
2960
2938
  // src/lib/db/reset.ts
2961
2939
  async function resetDatabase(workspace, mf, options = { debug: false }) {
2962
2940
  const { debug } = options;
2963
- const dbDir = join9(workspace, CLI_DIRECTORIES.DATABASE);
2941
+ const dbDir = join8(workspace, CLI_DIRECTORIES.DATABASE);
2964
2942
  await runStep(
2965
2943
  "Resetting database...",
2966
2944
  async () => {
@@ -205,66 +205,6 @@ async function serveFromR2(c: Context<HonoEnv>, bucket: R2Bucket): Promise<Respo
205
205
  return c.json({ error: 'Not Found', message: 'Asset not found', path }, 404)
206
206
  }
207
207
 
208
- /**
209
- * Register problem sets middleware (dev and prod)
210
- *
211
- * Serves TimeBack problem sets from public/timeback/problems/ directory.
212
- *
213
- * In local development:
214
- * - Problem sets are loaded from public/timeback/problems/ at dev server startup
215
- * - Stored in PROBLEM_SETS R2 bucket binding
216
- * - Served at /timeback/problems/*.qti.json
217
- *
218
- * In production:
219
- * - Problem sets uploaded with public/ assets during deploy
220
- * - Served from Workers Assets or R2 (depending on asset strategy)
221
- * - Falls through to asset fallback handler if PROBLEM_SETS binding not present
222
- *
223
- * Problem sets are customized by developers in their repo after running:
224
- * - `playcademy init` (downloads initial problem sets)
225
- * - `playcademy timeback problem-sets download` (downloads additional sets)
226
- */
227
- export function registerLocalProblemSets(app: Hono<HonoEnv>): void {
228
- app.use('/academics/problem-sets/*', async (c, next) => {
229
- // Only handle if PROBLEM_SETS binding exists (standalone dev mode)
230
- // In production or Vite mode, pass through to asset fallback
231
- const problemSets = c.env.PROBLEM_SETS as R2Bucket | undefined
232
-
233
- if (!problemSets) {
234
- return next()
235
- }
236
-
237
- const path = new URL(c.req.url).pathname
238
-
239
- /**
240
- * Security: Prevent directory traversal attacks
241
- *
242
- * Only allow paths under /academics/problem-sets/ with flat filenames
243
- * Reject paths with ".." (parent directory traversal)
244
- */
245
- if (path.includes('..')) {
246
- return c.json({ error: 'Invalid path' }, 400)
247
- }
248
-
249
- try {
250
- // Remove leading slash from path for R2 key
251
- const key = path.slice(1)
252
- const object = await problemSets.get(key)
253
-
254
- if (object) {
255
- return c.json(JSON.parse(await object.text()), 200, {
256
- 'Cache-Control': 'no-cache',
257
- 'Content-Type': 'application/json',
258
- })
259
- }
260
- } catch {
261
- // Error accessing R2 - fall through
262
- }
263
-
264
- return next()
265
- })
266
- }
267
-
268
208
  /**
269
209
  * Register asset fallback handler
270
210
  *
@@ -32,40 +32,6 @@ export function createSessionMiddleware(
32
32
  },
33
33
  ) {
34
34
  return async (c: Context<HonoEnv>, next: () => Promise<void>) => {
35
- // ========================================
36
- // DEV MODE: Sandbox Token Auto-Auth
37
- // ========================================
38
- // In local development with Godot, auto-authenticate requests with
39
- // the sandbox token as the first user in the database.
40
- // This enables Godot games to call authenticated endpoints without
41
- // implementing cookie-based auth (which Godot can't handle).
42
- //
43
- // Security: Only works when PLAYCADEMY_API_KEY is 'dev-api-key',
44
- // which only happens in local Miniflare dev servers.
45
- const authHeader = c.req.header('authorization')
46
- const isDev = c.env.PLAYCADEMY_API_KEY === 'dev-api-key'
47
-
48
- if (isDev && authHeader === 'Bearer sandbox-demo-token') {
49
- // Get first user from database as test user
50
- const db = c.env.DB
51
- if (db) {
52
- try {
53
- const result = await db.prepare('SELECT * FROM user LIMIT 1').first()
54
- if (result) {
55
- c.set('user', result)
56
- await next()
57
- return
58
- }
59
- } catch {
60
- // Database query failed - fall through to normal auth
61
- }
62
- }
63
- }
64
-
65
- // ========================================
66
- // PRODUCTION: Better Auth Session
67
- // ========================================
68
- // Check for valid Better Auth session cookie
69
35
  const auth = getAuth(c)
70
36
  const session = await auth.api.getSession({ headers: c.req.raw.headers })
71
37
 
@@ -17,7 +17,6 @@ import {
17
17
  registerAssetFallback,
18
18
  registerCors,
19
19
  registerEnvSetup,
20
- registerLocalProblemSets,
21
20
  registerPlaycademyUser,
22
21
  registerSdkInit,
23
22
  } from './entry/middleware'
@@ -74,11 +73,6 @@ await registerBuiltinRoutes(app, PLAYCADEMY_CONFIG.integrations)
74
73
  // DO NOT REMOVE THE BELOW COMMENT
75
74
  // ⚠️ BUILD_MARKER: CUSTOM_ROUTES ⚠️
76
75
 
77
- // Register local problem sets (dev only)
78
- // Serves .playcademy/problems/* from environment bindings in local development
79
- // No-op in production (bindings not injected)
80
- registerLocalProblemSets(app)
81
-
82
76
  // Register API 404 handler
83
77
  // Returns JSON error for unmatched /api/* routes
84
78
  // Must be registered after all API routes