playcademy 0.11.12 → 0.11.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,12 +2,37 @@
2
2
  * Constants for game backend workers
3
3
  */
4
4
 
5
- import { TIMEBACK_ROUTES, WORKER_ENV_VARS, WORKER_NAMING } from '@playcademy/constants'
5
+ /**
6
+ * Environment variables for game backend workers
7
+ */
8
+ export const ENV_VARS = {
9
+ /** Game-specific API key for calling platform API */
10
+ PLAYCADEMY_API_KEY: 'PLAYCADEMY_API_KEY',
11
+ /** Game ID (UUID) */
12
+ GAME_ID: 'GAME_ID',
13
+ /** Platform API base URL */
14
+ PLAYCADEMY_BASE_URL: 'PLAYCADEMY_BASE_URL',
15
+ } as const
16
+
17
+ /**
18
+ * Worker naming patterns
19
+ * - Production workers: {slug} → accessible at {slug}.playcademy.gg
20
+ * - Staging workers: staging-{slug} → accessible at {slug}-staging.playcademy.gg
21
+ */
22
+ export const WORKER_NAMING = {
23
+ /** Prefix for staging worker names (e.g., "staging-bamboo") */
24
+ STAGING_PREFIX: 'staging-',
25
+ /** Suffix for staging worker hostnames (e.g., "bamboo-staging.playcademy.gg") */
26
+ STAGING_SUFFIX: '-staging',
27
+ } as const
6
28
 
7
29
  /**
8
- * Re-export shared constants from @playcademy/constants
30
+ * TimeBack integration route paths
31
+ * These are relative to /api/ - full paths are /api/integrations/timeback/*
9
32
  */
10
- export { WORKER_ENV_VARS as ENV_VARS, WORKER_NAMING }
33
+ const TIMEBACK_ROUTES = {
34
+ END_ACTIVITY: '/integrations/timeback/end-activity',
35
+ } as const
11
36
 
12
37
  /**
13
38
  * Built-in API routes
package/dist/index.js CHANGED
@@ -1789,13 +1789,9 @@ var init_system = __esm({
1789
1789
  });
1790
1790
 
1791
1791
  // ../constants/src/timeback.ts
1792
- var TIMEBACK_ROUTES;
1793
1792
  var init_timeback2 = __esm({
1794
1793
  "../constants/src/timeback.ts"() {
1795
1794
  "use strict";
1796
- TIMEBACK_ROUTES = {
1797
- END_ACTIVITY: "/integrations/timeback/end-activity"
1798
- };
1799
1795
  }
1800
1796
  });
1801
1797
 
@@ -3595,11 +3591,13 @@ var init_integrations = __esm({
3595
3591
  });
3596
3592
 
3597
3593
  // ../edge-play/src/constants.ts
3598
- var ROUTES;
3594
+ var TIMEBACK_ROUTES, ROUTES;
3599
3595
  var init_constants4 = __esm({
3600
3596
  "../edge-play/src/constants.ts"() {
3601
3597
  "use strict";
3602
- init_src();
3598
+ TIMEBACK_ROUTES = {
3599
+ END_ACTIVITY: "/integrations/timeback/end-activity"
3600
+ };
3603
3601
  ROUTES = {
3604
3602
  /** Route index (lists available routes) */
3605
3603
  INDEX: "/api",
@@ -5139,18 +5137,13 @@ async function bundleBackend(config, options = {}) {
5139
5137
  customRoutes: customRouteData
5140
5138
  };
5141
5139
  const entryCode = generateEntryCode(customRouteData);
5142
- const currentDir2 = new URL(".", import.meta.url).pathname;
5143
- const embeddedEdgeSrc = join3(currentDir2, "edge-play", "src");
5144
- const monorepoEdgeSrc = join3(currentDir2, "../../../edge-play/src");
5140
+ const distDir = new URL(".", import.meta.url).pathname;
5141
+ const embeddedEdgeSrc = join3(distDir, "edge-play", "src");
5142
+ const monorepoEdgeSrc = join3(distDir, "../../../../edge-play/src");
5145
5143
  const isBuiltPackage = existsSync3(embeddedEdgeSrc);
5146
5144
  const edgePlaySrc = isBuiltPackage ? embeddedEdgeSrc : monorepoEdgeSrc;
5147
- const cliPackageRoot = isBuiltPackage ? join3(currentDir2, "..") : join3(currentDir2, "../../..");
5145
+ const cliPackageRoot = isBuiltPackage ? join3(distDir, "../..") : join3(distDir, "../../..");
5148
5146
  const nodeModulesRoot = isBuiltPackage ? cliPackageRoot : getMonorepoRoot();
5149
- const embeddedConstantsSrcA = join3(currentDir2, "@playcademy/constants/src");
5150
- const embeddedConstantsSrcB = join3(currentDir2, "node_modules/@playcademy/constants/src");
5151
- const embeddedConstantsSrc = existsSync3(embeddedConstantsSrcA) ? embeddedConstantsSrcA : embeddedConstantsSrcB;
5152
- const monorepoConstantsSrc = join3(currentDir2, "../../../constants/src");
5153
- const constantsSrc = isBuiltPackage ? embeddedConstantsSrc : monorepoConstantsSrc;
5154
5147
  const result = await esbuild.build({
5155
5148
  stdin: {
5156
5149
  contents: entryCode,
@@ -5182,14 +5175,6 @@ async function bundleBackend(config, options = {}) {
5182
5175
  * user's game project, enabling esbuild to bundle custom routes into the worker.
5183
5176
  */
5184
5177
  "@game-api": join3(workspace, "api"),
5185
- /**
5186
- * @playcademy/constants alias for edge-play sources
5187
- *
5188
- * Map the bare import to the package entry file, and also support
5189
- * subpath imports if they are added in the future.
5190
- */
5191
- "@playcademy/constants": join3(constantsSrc, "index.ts"),
5192
- "@playcademy/constants/*": join3(constantsSrc, "*"),
5193
5178
  /**
5194
5179
  * Node.js module polyfills for Cloudflare Workers environment
5195
5180
  *
@@ -5967,7 +5952,7 @@ function isGameDeployed(game) {
5967
5952
  return isHostedGame(game) || isExternalGame(game);
5968
5953
  }
5969
5954
 
5970
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/entity.js
5955
+ // ../../node_modules/drizzle-orm/entity.js
5971
5956
  var entityKind = Symbol.for("drizzle:entityKind");
5972
5957
  var hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
5973
5958
  function is(value, type) {
@@ -5994,7 +5979,7 @@ function is(value, type) {
5994
5979
  return false;
5995
5980
  }
5996
5981
 
5997
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/column.js
5982
+ // ../../node_modules/drizzle-orm/column.js
5998
5983
  var Column = class {
5999
5984
  constructor(table, config) {
6000
5985
  this.table = table;
@@ -6045,7 +6030,7 @@ var Column = class {
6045
6030
  }
6046
6031
  };
6047
6032
 
6048
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/column-builder.js
6033
+ // ../../node_modules/drizzle-orm/column-builder.js
6049
6034
  var ColumnBuilder = class {
6050
6035
  static [entityKind] = "ColumnBuilder";
6051
6036
  config;
@@ -6149,10 +6134,10 @@ var ColumnBuilder = class {
6149
6134
  }
6150
6135
  };
6151
6136
 
6152
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/table.utils.js
6137
+ // ../../node_modules/drizzle-orm/table.utils.js
6153
6138
  var TableName = Symbol.for("drizzle:Name");
6154
6139
 
6155
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/foreign-keys.js
6140
+ // ../../node_modules/drizzle-orm/pg-core/foreign-keys.js
6156
6141
  var ForeignKeyBuilder = class {
6157
6142
  static [entityKind] = "PgForeignKeyBuilder";
6158
6143
  /** @internal */
@@ -6209,12 +6194,12 @@ var ForeignKey = class {
6209
6194
  }
6210
6195
  };
6211
6196
 
6212
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/tracing-utils.js
6197
+ // ../../node_modules/drizzle-orm/tracing-utils.js
6213
6198
  function iife(fn, ...args) {
6214
6199
  return fn(...args);
6215
6200
  }
6216
6201
 
6217
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/unique-constraint.js
6202
+ // ../../node_modules/drizzle-orm/pg-core/unique-constraint.js
6218
6203
  function uniqueKeyName(table, columns) {
6219
6204
  return `${table[TableName]}_${columns.join("_")}_unique`;
6220
6205
  }
@@ -6264,7 +6249,7 @@ var UniqueConstraint = class {
6264
6249
  }
6265
6250
  };
6266
6251
 
6267
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/utils/array.js
6252
+ // ../../node_modules/drizzle-orm/pg-core/utils/array.js
6268
6253
  function parsePgArrayValue(arrayString, startFrom, inQuotes) {
6269
6254
  for (let i = startFrom; i < arrayString.length; i++) {
6270
6255
  const char2 = arrayString[i];
@@ -6340,7 +6325,7 @@ function makePgArray(array) {
6340
6325
  }).join(",")}}`;
6341
6326
  }
6342
6327
 
6343
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/common.js
6328
+ // ../../node_modules/drizzle-orm/pg-core/columns/common.js
6344
6329
  var PgColumnBuilder = class extends ColumnBuilder {
6345
6330
  foreignKeyConfigs = [];
6346
6331
  static [entityKind] = "PgColumnBuilder";
@@ -6525,7 +6510,7 @@ var PgArray = class _PgArray extends PgColumn {
6525
6510
  }
6526
6511
  };
6527
6512
 
6528
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/enum.js
6513
+ // ../../node_modules/drizzle-orm/pg-core/columns/enum.js
6529
6514
  var PgEnumObjectColumnBuilder = class extends PgColumnBuilder {
6530
6515
  static [entityKind] = "PgEnumObjectColumnBuilder";
6531
6516
  constructor(name, enumInstance) {
@@ -6610,7 +6595,7 @@ function pgEnumObjectWithSchema(enumName, values, schema) {
6610
6595
  return enumInstance;
6611
6596
  }
6612
6597
 
6613
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/subquery.js
6598
+ // ../../node_modules/drizzle-orm/subquery.js
6614
6599
  var Subquery = class {
6615
6600
  static [entityKind] = "Subquery";
6616
6601
  constructor(sql2, selection, alias, isWith = false) {
@@ -6630,10 +6615,10 @@ var WithSubquery = class extends Subquery {
6630
6615
  static [entityKind] = "WithSubquery";
6631
6616
  };
6632
6617
 
6633
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/version.js
6618
+ // ../../node_modules/drizzle-orm/version.js
6634
6619
  var version = "0.42.0";
6635
6620
 
6636
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/tracing.js
6621
+ // ../../node_modules/drizzle-orm/tracing.js
6637
6622
  var otel;
6638
6623
  var rawTracer;
6639
6624
  var tracer = {
@@ -6668,10 +6653,10 @@ var tracer = {
6668
6653
  }
6669
6654
  };
6670
6655
 
6671
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/view-common.js
6656
+ // ../../node_modules/drizzle-orm/view-common.js
6672
6657
  var ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
6673
6658
 
6674
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/table.js
6659
+ // ../../node_modules/drizzle-orm/table.js
6675
6660
  var Schema = Symbol.for("drizzle:Schema");
6676
6661
  var Columns = Symbol.for("drizzle:Columns");
6677
6662
  var ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
@@ -6727,7 +6712,7 @@ var Table = class {
6727
6712
  }
6728
6713
  };
6729
6714
 
6730
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/sql/sql.js
6715
+ // ../../node_modules/drizzle-orm/sql/sql.js
6731
6716
  var FakePrimitiveParam = class {
6732
6717
  static [entityKind] = "FakePrimitiveParam";
6733
6718
  };
@@ -7091,7 +7076,7 @@ Subquery.prototype.getSQL = function() {
7091
7076
  return new SQL([this]);
7092
7077
  };
7093
7078
 
7094
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/utils.js
7079
+ // ../../node_modules/drizzle-orm/utils.js
7095
7080
  function getColumnNameAndConfig(a, b) {
7096
7081
  return {
7097
7082
  name: typeof a === "string" && a.length > 0 ? a : "",
@@ -7099,7 +7084,7 @@ function getColumnNameAndConfig(a, b) {
7099
7084
  };
7100
7085
  }
7101
7086
 
7102
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/int.common.js
7087
+ // ../../node_modules/drizzle-orm/pg-core/columns/int.common.js
7103
7088
  var PgIntColumnBaseBuilder = class extends PgColumnBuilder {
7104
7089
  static [entityKind] = "PgIntColumnBaseBuilder";
7105
7090
  generatedAlwaysAsIdentity(sequence) {
@@ -7138,7 +7123,7 @@ var PgIntColumnBaseBuilder = class extends PgColumnBuilder {
7138
7123
  }
7139
7124
  };
7140
7125
 
7141
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/bigint.js
7126
+ // ../../node_modules/drizzle-orm/pg-core/columns/bigint.js
7142
7127
  var PgBigInt53Builder = class extends PgIntColumnBaseBuilder {
7143
7128
  static [entityKind] = "PgBigInt53Builder";
7144
7129
  constructor(name) {
@@ -7192,7 +7177,7 @@ function bigint(a, b) {
7192
7177
  return new PgBigInt64Builder(name);
7193
7178
  }
7194
7179
 
7195
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/bigserial.js
7180
+ // ../../node_modules/drizzle-orm/pg-core/columns/bigserial.js
7196
7181
  var PgBigSerial53Builder = class extends PgColumnBuilder {
7197
7182
  static [entityKind] = "PgBigSerial53Builder";
7198
7183
  constructor(name) {
@@ -7252,7 +7237,7 @@ function bigserial(a, b) {
7252
7237
  return new PgBigSerial64Builder(name);
7253
7238
  }
7254
7239
 
7255
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/boolean.js
7240
+ // ../../node_modules/drizzle-orm/pg-core/columns/boolean.js
7256
7241
  var PgBooleanBuilder = class extends PgColumnBuilder {
7257
7242
  static [entityKind] = "PgBooleanBuilder";
7258
7243
  constructor(name) {
@@ -7273,7 +7258,7 @@ function boolean(name) {
7273
7258
  return new PgBooleanBuilder(name ?? "");
7274
7259
  }
7275
7260
 
7276
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/char.js
7261
+ // ../../node_modules/drizzle-orm/pg-core/columns/char.js
7277
7262
  var PgCharBuilder = class extends PgColumnBuilder {
7278
7263
  static [entityKind] = "PgCharBuilder";
7279
7264
  constructor(name, config) {
@@ -7302,7 +7287,7 @@ function char(a, b = {}) {
7302
7287
  return new PgCharBuilder(name, config);
7303
7288
  }
7304
7289
 
7305
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/cidr.js
7290
+ // ../../node_modules/drizzle-orm/pg-core/columns/cidr.js
7306
7291
  var PgCidrBuilder = class extends PgColumnBuilder {
7307
7292
  static [entityKind] = "PgCidrBuilder";
7308
7293
  constructor(name) {
@@ -7323,7 +7308,7 @@ function cidr(name) {
7323
7308
  return new PgCidrBuilder(name ?? "");
7324
7309
  }
7325
7310
 
7326
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/custom.js
7311
+ // ../../node_modules/drizzle-orm/pg-core/columns/custom.js
7327
7312
  var PgCustomColumnBuilder = class extends PgColumnBuilder {
7328
7313
  static [entityKind] = "PgCustomColumnBuilder";
7329
7314
  constructor(name, fieldConfig, customTypeParams) {
@@ -7367,7 +7352,7 @@ function customType(customTypeParams) {
7367
7352
  };
7368
7353
  }
7369
7354
 
7370
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/date.common.js
7355
+ // ../../node_modules/drizzle-orm/pg-core/columns/date.common.js
7371
7356
  var PgDateColumnBaseBuilder = class extends PgColumnBuilder {
7372
7357
  static [entityKind] = "PgDateColumnBaseBuilder";
7373
7358
  defaultNow() {
@@ -7375,7 +7360,7 @@ var PgDateColumnBaseBuilder = class extends PgColumnBuilder {
7375
7360
  }
7376
7361
  };
7377
7362
 
7378
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/date.js
7363
+ // ../../node_modules/drizzle-orm/pg-core/columns/date.js
7379
7364
  var PgDateBuilder = class extends PgDateColumnBaseBuilder {
7380
7365
  static [entityKind] = "PgDateBuilder";
7381
7366
  constructor(name) {
@@ -7425,7 +7410,7 @@ function date(a, b) {
7425
7410
  return new PgDateStringBuilder(name);
7426
7411
  }
7427
7412
 
7428
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/double-precision.js
7413
+ // ../../node_modules/drizzle-orm/pg-core/columns/double-precision.js
7429
7414
  var PgDoublePrecisionBuilder = class extends PgColumnBuilder {
7430
7415
  static [entityKind] = "PgDoublePrecisionBuilder";
7431
7416
  constructor(name) {
@@ -7455,7 +7440,7 @@ function doublePrecision(name) {
7455
7440
  return new PgDoublePrecisionBuilder(name ?? "");
7456
7441
  }
7457
7442
 
7458
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/inet.js
7443
+ // ../../node_modules/drizzle-orm/pg-core/columns/inet.js
7459
7444
  var PgInetBuilder = class extends PgColumnBuilder {
7460
7445
  static [entityKind] = "PgInetBuilder";
7461
7446
  constructor(name) {
@@ -7476,7 +7461,7 @@ function inet(name) {
7476
7461
  return new PgInetBuilder(name ?? "");
7477
7462
  }
7478
7463
 
7479
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/integer.js
7464
+ // ../../node_modules/drizzle-orm/pg-core/columns/integer.js
7480
7465
  var PgIntegerBuilder = class extends PgIntColumnBaseBuilder {
7481
7466
  static [entityKind] = "PgIntegerBuilder";
7482
7467
  constructor(name) {
@@ -7503,7 +7488,7 @@ function integer(name) {
7503
7488
  return new PgIntegerBuilder(name ?? "");
7504
7489
  }
7505
7490
 
7506
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/interval.js
7491
+ // ../../node_modules/drizzle-orm/pg-core/columns/interval.js
7507
7492
  var PgIntervalBuilder = class extends PgColumnBuilder {
7508
7493
  static [entityKind] = "PgIntervalBuilder";
7509
7494
  constructor(name, intervalConfig) {
@@ -7530,7 +7515,7 @@ function interval(a, b = {}) {
7530
7515
  return new PgIntervalBuilder(name, config);
7531
7516
  }
7532
7517
 
7533
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/json.js
7518
+ // ../../node_modules/drizzle-orm/pg-core/columns/json.js
7534
7519
  var PgJsonBuilder = class extends PgColumnBuilder {
7535
7520
  static [entityKind] = "PgJsonBuilder";
7536
7521
  constructor(name) {
@@ -7567,7 +7552,7 @@ function json(name) {
7567
7552
  return new PgJsonBuilder(name ?? "");
7568
7553
  }
7569
7554
 
7570
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/jsonb.js
7555
+ // ../../node_modules/drizzle-orm/pg-core/columns/jsonb.js
7571
7556
  var PgJsonbBuilder = class extends PgColumnBuilder {
7572
7557
  static [entityKind] = "PgJsonbBuilder";
7573
7558
  constructor(name) {
@@ -7604,7 +7589,7 @@ function jsonb(name) {
7604
7589
  return new PgJsonbBuilder(name ?? "");
7605
7590
  }
7606
7591
 
7607
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/line.js
7592
+ // ../../node_modules/drizzle-orm/pg-core/columns/line.js
7608
7593
  var PgLineBuilder = class extends PgColumnBuilder {
7609
7594
  static [entityKind] = "PgLineBuilder";
7610
7595
  constructor(name) {
@@ -7665,7 +7650,7 @@ function line(a, b) {
7665
7650
  return new PgLineABCBuilder(name);
7666
7651
  }
7667
7652
 
7668
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/macaddr.js
7653
+ // ../../node_modules/drizzle-orm/pg-core/columns/macaddr.js
7669
7654
  var PgMacaddrBuilder = class extends PgColumnBuilder {
7670
7655
  static [entityKind] = "PgMacaddrBuilder";
7671
7656
  constructor(name) {
@@ -7686,7 +7671,7 @@ function macaddr(name) {
7686
7671
  return new PgMacaddrBuilder(name ?? "");
7687
7672
  }
7688
7673
 
7689
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/macaddr8.js
7674
+ // ../../node_modules/drizzle-orm/pg-core/columns/macaddr8.js
7690
7675
  var PgMacaddr8Builder = class extends PgColumnBuilder {
7691
7676
  static [entityKind] = "PgMacaddr8Builder";
7692
7677
  constructor(name) {
@@ -7707,7 +7692,7 @@ function macaddr8(name) {
7707
7692
  return new PgMacaddr8Builder(name ?? "");
7708
7693
  }
7709
7694
 
7710
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/numeric.js
7695
+ // ../../node_modules/drizzle-orm/pg-core/columns/numeric.js
7711
7696
  var PgNumericBuilder = class extends PgColumnBuilder {
7712
7697
  static [entityKind] = "PgNumericBuilder";
7713
7698
  constructor(name, precision, scale) {
@@ -7826,7 +7811,7 @@ function numeric(a, b) {
7826
7811
  return mode === "number" ? new PgNumericNumberBuilder(name, config?.precision, config?.scale) : mode === "bigint" ? new PgNumericBigIntBuilder(name, config?.precision, config?.scale) : new PgNumericBuilder(name, config?.precision, config?.scale);
7827
7812
  }
7828
7813
 
7829
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/point.js
7814
+ // ../../node_modules/drizzle-orm/pg-core/columns/point.js
7830
7815
  var PgPointTupleBuilder = class extends PgColumnBuilder {
7831
7816
  static [entityKind] = "PgPointTupleBuilder";
7832
7817
  constructor(name) {
@@ -7893,7 +7878,7 @@ function point(a, b) {
7893
7878
  return new PgPointObjectBuilder(name);
7894
7879
  }
7895
7880
 
7896
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/postgis_extension/utils.js
7881
+ // ../../node_modules/drizzle-orm/pg-core/columns/postgis_extension/utils.js
7897
7882
  function hexToBytes(hex) {
7898
7883
  const bytes = [];
7899
7884
  for (let c = 0; c < hex.length; c += 2) {
@@ -7932,7 +7917,7 @@ function parseEWKB(hex) {
7932
7917
  throw new Error("Unsupported geometry type");
7933
7918
  }
7934
7919
 
7935
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/postgis_extension/geometry.js
7920
+ // ../../node_modules/drizzle-orm/pg-core/columns/postgis_extension/geometry.js
7936
7921
  var PgGeometryBuilder = class extends PgColumnBuilder {
7937
7922
  static [entityKind] = "PgGeometryBuilder";
7938
7923
  constructor(name) {
@@ -7992,7 +7977,7 @@ function geometry(a, b) {
7992
7977
  return new PgGeometryObjectBuilder(name);
7993
7978
  }
7994
7979
 
7995
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/real.js
7980
+ // ../../node_modules/drizzle-orm/pg-core/columns/real.js
7996
7981
  var PgRealBuilder = class extends PgColumnBuilder {
7997
7982
  static [entityKind] = "PgRealBuilder";
7998
7983
  constructor(name, length) {
@@ -8023,7 +8008,7 @@ function real(name) {
8023
8008
  return new PgRealBuilder(name ?? "");
8024
8009
  }
8025
8010
 
8026
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/serial.js
8011
+ // ../../node_modules/drizzle-orm/pg-core/columns/serial.js
8027
8012
  var PgSerialBuilder = class extends PgColumnBuilder {
8028
8013
  static [entityKind] = "PgSerialBuilder";
8029
8014
  constructor(name) {
@@ -8046,7 +8031,7 @@ function serial(name) {
8046
8031
  return new PgSerialBuilder(name ?? "");
8047
8032
  }
8048
8033
 
8049
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/smallint.js
8034
+ // ../../node_modules/drizzle-orm/pg-core/columns/smallint.js
8050
8035
  var PgSmallIntBuilder = class extends PgIntColumnBaseBuilder {
8051
8036
  static [entityKind] = "PgSmallIntBuilder";
8052
8037
  constructor(name) {
@@ -8073,7 +8058,7 @@ function smallint(name) {
8073
8058
  return new PgSmallIntBuilder(name ?? "");
8074
8059
  }
8075
8060
 
8076
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/smallserial.js
8061
+ // ../../node_modules/drizzle-orm/pg-core/columns/smallserial.js
8077
8062
  var PgSmallSerialBuilder = class extends PgColumnBuilder {
8078
8063
  static [entityKind] = "PgSmallSerialBuilder";
8079
8064
  constructor(name) {
@@ -8099,7 +8084,7 @@ function smallserial(name) {
8099
8084
  return new PgSmallSerialBuilder(name ?? "");
8100
8085
  }
8101
8086
 
8102
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/text.js
8087
+ // ../../node_modules/drizzle-orm/pg-core/columns/text.js
8103
8088
  var PgTextBuilder = class extends PgColumnBuilder {
8104
8089
  static [entityKind] = "PgTextBuilder";
8105
8090
  constructor(name, config) {
@@ -8123,7 +8108,7 @@ function text(a, b = {}) {
8123
8108
  return new PgTextBuilder(name, config);
8124
8109
  }
8125
8110
 
8126
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/time.js
8111
+ // ../../node_modules/drizzle-orm/pg-core/columns/time.js
8127
8112
  var PgTimeBuilder = class extends PgDateColumnBaseBuilder {
8128
8113
  constructor(name, withTimezone, precision) {
8129
8114
  super(name, "string", "PgTime");
@@ -8157,7 +8142,7 @@ function time(a, b = {}) {
8157
8142
  return new PgTimeBuilder(name, config.withTimezone ?? false, config.precision);
8158
8143
  }
8159
8144
 
8160
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/timestamp.js
8145
+ // ../../node_modules/drizzle-orm/pg-core/columns/timestamp.js
8161
8146
  var PgTimestampBuilder = class extends PgDateColumnBaseBuilder {
8162
8147
  static [entityKind] = "PgTimestampBuilder";
8163
8148
  constructor(name, withTimezone, precision) {
@@ -8227,7 +8212,7 @@ function timestamp(a, b = {}) {
8227
8212
  return new PgTimestampBuilder(name, config?.withTimezone ?? false, config?.precision);
8228
8213
  }
8229
8214
 
8230
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/uuid.js
8215
+ // ../../node_modules/drizzle-orm/pg-core/columns/uuid.js
8231
8216
  var PgUUIDBuilder = class extends PgColumnBuilder {
8232
8217
  static [entityKind] = "PgUUIDBuilder";
8233
8218
  constructor(name) {
@@ -8254,7 +8239,7 @@ function uuid(name) {
8254
8239
  return new PgUUIDBuilder(name ?? "");
8255
8240
  }
8256
8241
 
8257
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/varchar.js
8242
+ // ../../node_modules/drizzle-orm/pg-core/columns/varchar.js
8258
8243
  var PgVarcharBuilder = class extends PgColumnBuilder {
8259
8244
  static [entityKind] = "PgVarcharBuilder";
8260
8245
  constructor(name, config) {
@@ -8283,7 +8268,7 @@ function varchar(a, b = {}) {
8283
8268
  return new PgVarcharBuilder(name, config);
8284
8269
  }
8285
8270
 
8286
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/vector_extension/bit.js
8271
+ // ../../node_modules/drizzle-orm/pg-core/columns/vector_extension/bit.js
8287
8272
  var PgBinaryVectorBuilder = class extends PgColumnBuilder {
8288
8273
  static [entityKind] = "PgBinaryVectorBuilder";
8289
8274
  constructor(name, config) {
@@ -8310,7 +8295,7 @@ function bit(a, b) {
8310
8295
  return new PgBinaryVectorBuilder(name, config);
8311
8296
  }
8312
8297
 
8313
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/vector_extension/halfvec.js
8298
+ // ../../node_modules/drizzle-orm/pg-core/columns/vector_extension/halfvec.js
8314
8299
  var PgHalfVectorBuilder = class extends PgColumnBuilder {
8315
8300
  static [entityKind] = "PgHalfVectorBuilder";
8316
8301
  constructor(name, config) {
@@ -8343,7 +8328,7 @@ function halfvec(a, b) {
8343
8328
  return new PgHalfVectorBuilder(name, config);
8344
8329
  }
8345
8330
 
8346
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/vector_extension/sparsevec.js
8331
+ // ../../node_modules/drizzle-orm/pg-core/columns/vector_extension/sparsevec.js
8347
8332
  var PgSparseVectorBuilder = class extends PgColumnBuilder {
8348
8333
  static [entityKind] = "PgSparseVectorBuilder";
8349
8334
  constructor(name, config) {
@@ -8370,7 +8355,7 @@ function sparsevec(a, b) {
8370
8355
  return new PgSparseVectorBuilder(name, config);
8371
8356
  }
8372
8357
 
8373
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/vector_extension/vector.js
8358
+ // ../../node_modules/drizzle-orm/pg-core/columns/vector_extension/vector.js
8374
8359
  var PgVectorBuilder = class extends PgColumnBuilder {
8375
8360
  static [entityKind] = "PgVectorBuilder";
8376
8361
  constructor(name, config) {
@@ -8403,7 +8388,7 @@ function vector(a, b) {
8403
8388
  return new PgVectorBuilder(name, config);
8404
8389
  }
8405
8390
 
8406
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/columns/all.js
8391
+ // ../../node_modules/drizzle-orm/pg-core/columns/all.js
8407
8392
  function getPgColumnBuilders() {
8408
8393
  return {
8409
8394
  bigint,
@@ -8441,7 +8426,7 @@ function getPgColumnBuilders() {
8441
8426
  };
8442
8427
  }
8443
8428
 
8444
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/table.js
8429
+ // ../../node_modules/drizzle-orm/pg-core/table.js
8445
8430
  var InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys");
8446
8431
  var EnableRLS = Symbol.for("drizzle:EnableRLS");
8447
8432
  var PgTable = class extends Table {
@@ -8497,7 +8482,7 @@ var pgTable = (name, columns, extraConfig) => {
8497
8482
  return pgTableWithSchema(name, columns, extraConfig, void 0);
8498
8483
  };
8499
8484
 
8500
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/relations.js
8485
+ // ../../node_modules/drizzle-orm/relations.js
8501
8486
  var Relation = class {
8502
8487
  constructor(sourceTable, referencedTable, relationName) {
8503
8488
  this.sourceTable = sourceTable;
@@ -8562,7 +8547,7 @@ function relations(table, relations2) {
8562
8547
  );
8563
8548
  }
8564
8549
 
8565
- // ../../node_modules/.bun/drizzle-orm@0.42.0+d96190bc6cc0b1f6/node_modules/drizzle-orm/pg-core/indexes.js
8550
+ // ../../node_modules/drizzle-orm/pg-core/indexes.js
8566
8551
  var IndexBuilderOn = class {
8567
8552
  constructor(unique, name) {
8568
8553
  this.unique = unique;
package/dist/utils.js CHANGED
@@ -262,113 +262,14 @@ var init_file_loader = __esm({
262
262
  }
263
263
  });
264
264
 
265
- // ../constants/src/auth.ts
266
- var init_auth = __esm({
267
- "../constants/src/auth.ts"() {
268
- "use strict";
269
- }
270
- });
271
-
272
- // ../constants/src/domains.ts
273
- var init_domains = __esm({
274
- "../constants/src/domains.ts"() {
275
- "use strict";
276
- }
277
- });
278
-
279
- // ../constants/src/env-vars.ts
280
- var init_env_vars = __esm({
281
- "../constants/src/env-vars.ts"() {
282
- "use strict";
283
- }
284
- });
285
-
286
- // ../constants/src/overworld.ts
287
- var ITEM_SLUGS, CURRENCIES, BADGES, CORE_GAME_UUIDS;
288
- var init_overworld = __esm({
289
- "../constants/src/overworld.ts"() {
290
- "use strict";
291
- ITEM_SLUGS = {
292
- /** Primary platform currency */
293
- PLAYCADEMY_CREDITS: "PLAYCADEMY_CREDITS",
294
- /** Experience points currency */
295
- PLAYCADEMY_XP: "PLAYCADEMY_XP",
296
- /** Core platform badges */
297
- FOUNDING_MEMBER_BADGE: "FOUNDING_MEMBER_BADGE",
298
- EARLY_ADOPTER_BADGE: "EARLY_ADOPTER_BADGE",
299
- FIRST_GAME_BADGE: "FIRST_GAME_BADGE",
300
- /** Example items */
301
- COMMON_SWORD: "COMMON_SWORD",
302
- SMALL_HEALTH_POTION: "SMALL_HEALTH_POTION",
303
- SMALL_BACKPACK: "SMALL_BACKPACK",
304
- /** Placeable items */
305
- LAVA_LAMP: "LAVA_LAMP",
306
- BOOMBOX: "BOOMBOX",
307
- CABIN_BED: "CABIN_BED"
308
- };
309
- CURRENCIES = {
310
- /** Primary platform currency slug */
311
- PRIMARY: ITEM_SLUGS.PLAYCADEMY_CREDITS,
312
- /** Experience points slug */
313
- XP: ITEM_SLUGS.PLAYCADEMY_XP
314
- };
315
- BADGES = {
316
- FOUNDING_MEMBER: ITEM_SLUGS.FOUNDING_MEMBER_BADGE,
317
- EARLY_ADOPTER: ITEM_SLUGS.EARLY_ADOPTER_BADGE,
318
- FIRST_GAME: ITEM_SLUGS.FIRST_GAME_BADGE
319
- };
320
- CORE_GAME_UUIDS = {
321
- /** Internal playground game for development and testing */
322
- PLAYGROUND: "00000000-0000-0000-0000-000000000001"
323
- };
324
- }
325
- });
326
-
327
- // ../constants/src/system.ts
328
- var init_system = __esm({
329
- "../constants/src/system.ts"() {
330
- "use strict";
331
- }
332
- });
333
-
334
- // ../constants/src/timeback.ts
335
- var TIMEBACK_ROUTES;
336
- var init_timeback = __esm({
337
- "../constants/src/timeback.ts"() {
338
- "use strict";
339
- TIMEBACK_ROUTES = {
340
- END_ACTIVITY: "/integrations/timeback/end-activity"
341
- };
342
- }
343
- });
344
-
345
- // ../constants/src/workers.ts
346
- var init_workers = __esm({
347
- "../constants/src/workers.ts"() {
348
- "use strict";
349
- }
350
- });
351
-
352
- // ../constants/src/index.ts
353
- var init_src = __esm({
354
- "../constants/src/index.ts"() {
355
- "use strict";
356
- init_auth();
357
- init_domains();
358
- init_env_vars();
359
- init_overworld();
360
- init_system();
361
- init_timeback();
362
- init_workers();
363
- }
364
- });
365
-
366
265
  // ../edge-play/src/constants.ts
367
- var ROUTES;
266
+ var TIMEBACK_ROUTES, ROUTES;
368
267
  var init_constants = __esm({
369
268
  "../edge-play/src/constants.ts"() {
370
269
  "use strict";
371
- init_src();
270
+ TIMEBACK_ROUTES = {
271
+ END_ACTIVITY: "/integrations/timeback/end-activity"
272
+ };
372
273
  ROUTES = {
373
274
  /** Route index (lists available routes) */
374
275
  INDEX: "/api",
@@ -725,8 +626,40 @@ var CONFIG_FILE_NAMES = [
725
626
  "playcademy.config.mjs"
726
627
  ];
727
628
 
728
- // src/constants/urls.ts
729
- init_src();
629
+ // ../constants/src/overworld.ts
630
+ var ITEM_SLUGS = {
631
+ /** Primary platform currency */
632
+ PLAYCADEMY_CREDITS: "PLAYCADEMY_CREDITS",
633
+ /** Experience points currency */
634
+ PLAYCADEMY_XP: "PLAYCADEMY_XP",
635
+ /** Core platform badges */
636
+ FOUNDING_MEMBER_BADGE: "FOUNDING_MEMBER_BADGE",
637
+ EARLY_ADOPTER_BADGE: "EARLY_ADOPTER_BADGE",
638
+ FIRST_GAME_BADGE: "FIRST_GAME_BADGE",
639
+ /** Example items */
640
+ COMMON_SWORD: "COMMON_SWORD",
641
+ SMALL_HEALTH_POTION: "SMALL_HEALTH_POTION",
642
+ SMALL_BACKPACK: "SMALL_BACKPACK",
643
+ /** Placeable items */
644
+ LAVA_LAMP: "LAVA_LAMP",
645
+ BOOMBOX: "BOOMBOX",
646
+ CABIN_BED: "CABIN_BED"
647
+ };
648
+ var CURRENCIES = {
649
+ /** Primary platform currency slug */
650
+ PRIMARY: ITEM_SLUGS.PLAYCADEMY_CREDITS,
651
+ /** Experience points slug */
652
+ XP: ITEM_SLUGS.PLAYCADEMY_XP
653
+ };
654
+ var BADGES = {
655
+ FOUNDING_MEMBER: ITEM_SLUGS.FOUNDING_MEMBER_BADGE,
656
+ EARLY_ADOPTER: ITEM_SLUGS.EARLY_ADOPTER_BADGE,
657
+ FIRST_GAME: ITEM_SLUGS.FIRST_GAME_BADGE
658
+ };
659
+ var CORE_GAME_UUIDS = {
660
+ /** Internal playground game for development and testing */
661
+ PLAYGROUND: "00000000-0000-0000-0000-000000000001"
662
+ };
730
663
 
731
664
  // src/lib/config/loader.ts
732
665
  var ConfigError = class extends Error {
@@ -946,7 +879,6 @@ function processConfigVariables(config) {
946
879
  }
947
880
 
948
881
  // src/lib/dev/server.ts
949
- init_src();
950
882
  import { join as join2 } from "path";
951
883
  import { serve } from "@hono/node-server";
952
884
  import { Hono } from "hono";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playcademy",
3
- "version": "0.11.12",
3
+ "version": "0.11.14",
4
4
  "type": "module",
5
5
  "module": "./dist/index.js",
6
6
  "exports": {
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@hono/node-server": "^1.19.5",
32
32
  "@inquirer/prompts": "^7.8.6",
33
- "@playcademy/sdk": "0.1.2",
33
+ "@playcademy/sdk": "0.1.3",
34
34
  "chokidar": "^4.0.3",
35
35
  "colorette": "^2.0.20",
36
36
  "commander": "^14.0.1",
@@ -1,23 +0,0 @@
1
- {
2
- "name": "@playcademy/constants",
3
- "main": "src/index.ts",
4
- "version": "0.0.1",
5
- "module": "src/index.ts",
6
- "type": "module",
7
- "private": true,
8
- "exports": {
9
- ".": {
10
- "types": "./src/index.ts",
11
- "import": "./src/index.ts",
12
- "default": "./src/index.ts"
13
- }
14
- },
15
- "devDependencies": {
16
- "@types/bun": "latest",
17
- "rollup": "^4.52.4",
18
- "rollup-plugin-dts": "^6.2.3"
19
- },
20
- "peerDependencies": {
21
- "typescript": "^5"
22
- }
23
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Authentication Constants
3
- *
4
- * Constants related to authentication providers.
5
- */
6
-
7
- /**
8
- * Auth Provider Constants
9
- */
10
- export const AUTH_PROVIDER_IDS = {
11
- TIMEBACK: 'timeback',
12
- TIMEBACK_LTI: 'timeback-lti',
13
- } as const
@@ -1,43 +0,0 @@
1
- /**
2
- * Domain and URL Constants
3
- *
4
- * Centralized domain names and base URLs for the Playcademy platform.
5
- * These constants are shared across multiple packages to ensure consistency.
6
- */
7
-
8
- /**
9
- * Playcademy domain names
10
- */
11
- export const PLAYCADEMY_DOMAINS = {
12
- /** Primary domain (hub, landing pages) */
13
- apex: 'playcademy.net',
14
- /** Marketing/alternative domain */
15
- apexAlt: 'playcademy.com',
16
- /** Game backend worker domain */
17
- games: 'playcademy.gg',
18
- } as const
19
-
20
- /**
21
- * Platform hub base URLs by environment
22
- * Used by CLI, SDK, and other packages to make API requests
23
- */
24
- export const PLAYCADEMY_BASE_URLS = {
25
- production: 'https://hub.playcademy.net',
26
- staging: 'https://hub.dev.playcademy.net',
27
- } as const
28
-
29
- /**
30
- * Game backend worker domains by environment
31
- * Workers are deployed to Cloudflare and accessible at:
32
- * - Production: {slug}.playcademy.gg
33
- * - Staging: {slug}-staging.playcademy.gg
34
- */
35
- export const GAME_WORKER_DOMAINS = {
36
- production: 'playcademy.gg',
37
- staging: 'staging.playcademy.gg',
38
- } as const
39
-
40
- /**
41
- * Type exports
42
- */
43
- export type PlatformEnvironment = 'production' | 'staging'
@@ -1,20 +0,0 @@
1
- /**
2
- * Environment Variable Names
3
- *
4
- * Centralized environment variable names used across the platform.
5
- * These ensure consistency between deployers and runtime environments.
6
- */
7
-
8
- /**
9
- * Environment variables for game backend workers
10
- * Used by both the deployment system (@playcademy/api-core)
11
- * and the worker runtime (@playcademy/edge-play)
12
- */
13
- export const WORKER_ENV_VARS = {
14
- /** Game-specific API key for calling platform API */
15
- PLAYCADEMY_API_KEY: 'PLAYCADEMY_API_KEY',
16
- /** Game ID (UUID) */
17
- GAME_ID: 'GAME_ID',
18
- /** Platform API base URL */
19
- PLAYCADEMY_BASE_URL: 'PLAYCADEMY_BASE_URL',
20
- } as const
@@ -1,15 +0,0 @@
1
- /**
2
- * @playcademy/constants
3
- *
4
- * Centralized constants shared across the Playcademy platform.
5
- * This package contains domain names, URLs, environment variable names,
6
- * and other constants that need to be consistent across multiple packages.
7
- */
8
-
9
- export * from './auth'
10
- export * from './domains'
11
- export * from './env-vars'
12
- export * from './overworld'
13
- export * from './system'
14
- export * from './timeback'
15
- export * from './workers'
@@ -1,327 +0,0 @@
1
- /**
2
- * Overworld & Game Constants
3
- *
4
- * All constants related to the game world, including items, rendering,
5
- * maps, physics, UI, and core platform games.
6
- */
7
-
8
- // ═══════════════════════════════════════════════════════════════════════
9
- // VIEWPORT & LEVEL SYSTEM
10
- // ═══════════════════════════════════════════════════════════════════════
11
-
12
- /**
13
- * Minimum viewport dimensions for the game
14
- */
15
- export const MIN_VIEWPORT_WIDTH = 960
16
- export const MIN_VIEWPORT_HEIGHT = 640
17
-
18
- /**
19
- * Maximum player level
20
- */
21
- export const MAX_LEVEL = 100
22
-
23
- // ═══════════════════════════════════════════════════════════════════════
24
- // ITEMS & ECONOMY
25
- // ═══════════════════════════════════════════════════════════════════════
26
-
27
- /**
28
- * Item Slugs - Canonical slugs for core platform items
29
- */
30
- export const ITEM_SLUGS = {
31
- /** Primary platform currency */
32
- PLAYCADEMY_CREDITS: 'PLAYCADEMY_CREDITS',
33
-
34
- /** Experience points currency */
35
- PLAYCADEMY_XP: 'PLAYCADEMY_XP',
36
-
37
- /** Core platform badges */
38
- FOUNDING_MEMBER_BADGE: 'FOUNDING_MEMBER_BADGE',
39
- EARLY_ADOPTER_BADGE: 'EARLY_ADOPTER_BADGE',
40
- FIRST_GAME_BADGE: 'FIRST_GAME_BADGE',
41
-
42
- /** Example items */
43
- COMMON_SWORD: 'COMMON_SWORD',
44
- SMALL_HEALTH_POTION: 'SMALL_HEALTH_POTION',
45
- SMALL_BACKPACK: 'SMALL_BACKPACK',
46
-
47
- /** Placeable items */
48
- LAVA_LAMP: 'LAVA_LAMP',
49
- BOOMBOX: 'BOOMBOX',
50
- CABIN_BED: 'CABIN_BED',
51
- } as const
52
-
53
- /**
54
- * Currency-specific constants for easier access
55
- */
56
- export const CURRENCIES = {
57
- /** Primary platform currency slug */
58
- PRIMARY: ITEM_SLUGS.PLAYCADEMY_CREDITS,
59
-
60
- /** Experience points slug */
61
- XP: ITEM_SLUGS.PLAYCADEMY_XP,
62
- } as const
63
-
64
- /**
65
- * Currency symbol constants
66
- */
67
- export const CURRENCY_SYMBOLS = {
68
- /** Primary platform currency symbol */
69
- PLAYCADEMY_CREDITS: 'PC',
70
-
71
- /** Experience points symbol */
72
- PLAYCADEMY_XP: 'XP',
73
-
74
- /** Default currency symbol */
75
- DEFAULT: '¤',
76
- } as const
77
-
78
- /**
79
- * Badge constants for easier access
80
- */
81
- export const BADGES = {
82
- FOUNDING_MEMBER: ITEM_SLUGS.FOUNDING_MEMBER_BADGE,
83
- EARLY_ADOPTER: ITEM_SLUGS.EARLY_ADOPTER_BADGE,
84
- FIRST_GAME: ITEM_SLUGS.FIRST_GAME_BADGE,
85
- } as const
86
-
87
- // ═══════════════════════════════════════════════════════════════════════
88
- // RENDERING & VISUALS
89
- // ═══════════════════════════════════════════════════════════════════════
90
-
91
- /**
92
- * Sprite System Constants
93
- */
94
- export const SPRITE_COMPONENTS = ['body', 'outfit', 'hairstyle', 'eyes', 'accessory'] as const
95
- export const SPRITE_LAYER_ORDER = ['body', 'outfit', 'hairstyle', 'eyes', 'accessory'] as const
96
-
97
- /**
98
- * Renderer Z-layer constants – centralised depth values used by the Three.js
99
- * front-end so magic numbers aren't scattered around the codebase.
100
- */
101
- export const Z_LAYERS = {
102
- /** Depth step between successive Tiled tile-layers (background → foreground). */
103
- TILE_LAYER_STEP: 0.01,
104
-
105
- /** Depth step between stacked sprite components inside a single character. */
106
- SPRITE_COMPONENT_STEP: 0.002,
107
-
108
- /** Minimum Z for Y-sorted entities (top of screen). */
109
- ENTITY_MIN: 0.011,
110
-
111
- /** Maximum Z for Y-sorted entities (bottom of screen). */
112
- ENTITY_MAX: 0.0115,
113
-
114
- /** Fallback Z when map bounds are unavailable. */
115
- ENTITY_FALLBACK: 0.01125,
116
-
117
- /** Offset applied to placeable item sprites so they sit above characters. */
118
- PLACEABLE_OFFSET: 0.012,
119
-
120
- /** Shadow offset below entity base Z (shadows appear below characters). */
121
- SHADOW_OFFSET: -0.001,
122
- } as const
123
-
124
- /**
125
- * Shadow constants
126
- */
127
- export const SHADOW_CONSTANTS = {
128
- /** Shadow radius as a fraction of tileWidth */
129
- RADIUS_MULTIPLIER: 0.4,
130
-
131
- /** Y offset in world units as a fraction of one tile width. */
132
- Y_OFFSET_TILES: -0.9,
133
-
134
- /** Shadow opacity (semi-transparent) */
135
- OPACITY: 0.4,
136
-
137
- /** Y-axis scale for elliptical perspective */
138
- Y_SCALE: 0.6,
139
-
140
- /** Minimum shadow size during jumps (30% of original) */
141
- SCALE_MIN: 0.1,
142
-
143
- /** Maximum jump height for scaling calculations */
144
- MAX_JUMP_HEIGHT: 100,
145
- } as const
146
-
147
- /**
148
- * Nameplate constants
149
- */
150
- export const NAMEPLATE_CONSTANTS = {
151
- /** Adjust nameplate position from base height */
152
- BASE_Y_ADJUST: -1,
153
- /** Extra pixels to raise when a head accessory is equipped */
154
- HEAD_ACCESSORY_EXTRA_PX: 5,
155
- /** Available background colors for nameplates */
156
- BACKGROUND_COLORS: [
157
- '#2d3748', // Default gray
158
- '#dc2626', // Red
159
- '#ea580c', // Orange
160
- '#ca8a04', // Amber
161
- '#16a34a', // Green
162
- '#0891b2', // Cyan
163
- '#2563eb', // Blue
164
- '#7c3aed', // Purple
165
- '#c026d3', // Pink
166
- '#e11d48', // Rose
167
- '#134e4a', // Dark teal
168
- '#831843', // Dark pink
169
- ],
170
- /** Default background color */
171
- DEFAULT_BACKGROUND_COLOR: '#2d3748',
172
- } as const
173
-
174
- /**
175
- * Particle system constants
176
- */
177
- export const LANDING_PARTICLES = {
178
- /** Number of particles per landing */
179
- COUNT: 6,
180
-
181
- /** Base duration in ms */
182
- DURATION: 500,
183
-
184
- /** Spread radius as fraction of tileWidth */
185
- SPREAD: 0.4,
186
-
187
- /** Dust particle color */
188
- COLOR: '#777',
189
-
190
- /** Particle size in pixels in the game world */
191
- SIZE: 3,
192
-
193
- /** Vertical offset as a fraction of tile width (world units). */
194
- Y_OFFSET_TILES: -0.9,
195
- } as const
196
-
197
- // ═══════════════════════════════════════════════════════════════════════
198
- // MAPS
199
- // ═══════════════════════════════════════════════════════════════════════
200
-
201
- /**
202
- * Map System Constants
203
- */
204
- export const MAP_CONSTANTS = {
205
- /** Name of the Tiled layer containing map entry points */
206
- ENTRY_POINT_LAYER_NAME: 'EntryPoints',
207
-
208
- /** Name of the Tiled layer containing collision objects */
209
- COLLISION_LAYER_NAME: 'Object Layer 1',
210
-
211
- /** Name of the Tiled layer containing placeable objects */
212
- PLACEABLE_AREA_LAYER_NAME: 'PlaceableArea',
213
-
214
- /** Base path for tilesets */
215
- TILESET_BASE_PATH: '/public/tilesets',
216
- } as const
217
-
218
- // ═══════════════════════════════════════════════════════════════════════
219
- // PHYSICS & MOVEMENT
220
- // ═══════════════════════════════════════════════════════════════════════
221
-
222
- /**
223
- * Player movement and physics constants
224
- */
225
- export const PLAYER_PHYSICS = {
226
- /** Initial upward velocity when jumping (pixels per second) */
227
- JUMP_FORCE: 150,
228
-
229
- /** Downward acceleration due to gravity (pixels per second^2) */
230
- GRAVITY: -450,
231
- } as const
232
-
233
- /**
234
- * Bunny hop (jump queuing) constants – Counter-Strike style mechanics.
235
- */
236
- export const BUNNY_HOP = {
237
- /** Base time window (ms) within which a queued jump is valid. */
238
- QUEUE_WINDOW_MS: 100,
239
-
240
- /** Downward velocity threshold (px/s) to allow jump queuing. */
241
- FALL_SPEED_THRESHOLD: -50,
242
-
243
- /** Vertical offset threshold (px) to allow queuing close to ground. */
244
- CLOSE_TO_GROUND_THRESHOLD: 30,
245
-
246
- /** Speed increase per successful hop. */
247
- SPEED_INCREMENT: 0.15,
248
-
249
- /** Maximum total speed multiplier. */
250
- MAX_SPEED_MULTIPLIER: 5,
251
-
252
- /** Multiplier applied to jump force on chained hops (slightly lower). */
253
- HOP_JUMP_FORCE_MULTIPLIER: 0.95,
254
- } as const
255
-
256
- // ═══════════════════════════════════════════════════════════════════════
257
- // UI & UX
258
- // ═══════════════════════════════════════════════════════════════════════
259
-
260
- /**
261
- * Audio defaults
262
- */
263
- export const AUDIO_DEFAULTS = {
264
- /** Master output volume */
265
- MASTER_VOLUME: 0.5,
266
-
267
- /** Background music enabled by default */
268
- MUSIC_ENABLED: true,
269
- /** Background music volume */
270
- MUSIC_VOLUME: 0.5,
271
-
272
- /** Sound effects enabled by default */
273
- SFX_ENABLED: true,
274
- /** Sound effects volume */
275
- SFX_VOLUME: 0.5,
276
- } as const
277
-
278
- /**
279
- * Toast Duration Constants
280
- * Centralized toast notification display durations in milliseconds.
281
- */
282
- export const TOAST_DURATION = {
283
- /** Short duration for simple confirmations */
284
- SHORT: 3000,
285
-
286
- /** Standard duration for most notifications */
287
- STANDARD: 5000,
288
-
289
- /** Long duration for important notifications */
290
- LONG: 8000,
291
-
292
- /** Error message duration */
293
- ERROR: 4000,
294
- } as const
295
-
296
- /**
297
- * Cache Control Headers
298
- * Centralized cache control strategies for different asset types and API responses.
299
- */
300
- export const CACHE_CONTROL = {
301
- /** Immutable assets with content-based versioning (sprites, audio, etc.) */
302
- IMMUTABLE: 'public, max-age=31536000, immutable',
303
-
304
- /** JSON data - cached for 1 day in browser, 1 year in CDN */
305
- JSON_DATA: 'public, max-age=86400, s-maxage=31536000, must-revalidate',
306
-
307
- /** Character components API - cached for 1 hour in browser, 3 hours in CDN */
308
- API_CHARACTER_COMPONENTS: 'public, max-age=21600, s-maxage=21600, stale-while-revalidate=3600',
309
-
310
- /** Level configs API - cached for 1 hour in browser, 12 hours in CDN */
311
- API_LEVEL_CONFIGS: 'public, max-age=3600, s-maxage=86400, stale-while-revalidate=120',
312
-
313
- /** Sprite templates API - cached for 1 day in browser, 1 week in CDN */
314
- API_SPRITE_TEMPLATES: 'public, max-age=86400, s-maxage=86400, stale-while-revalidate=3600',
315
- } as const
316
-
317
- // ═══════════════════════════════════════════════════════════════════════
318
- // CORE PLATFORM GAMES
319
- // ═══════════════════════════════════════════════════════════════════════
320
-
321
- /**
322
- * Core Game UUIDs - Canonical UUIDs for core platform games
323
- */
324
- export const CORE_GAME_UUIDS = {
325
- /** Internal playground game for development and testing */
326
- PLAYGROUND: '00000000-0000-0000-0000-000000000001',
327
- } as const
@@ -1,10 +0,0 @@
1
- /**
2
- * System-Level Platform Constants
3
- *
4
- * Core platform settings that affect the entire system.
5
- */
6
-
7
- /**
8
- * Timezone for platform-wide operations
9
- */
10
- export const PLATFORM_TIMEZONE = 'America/New_York' as const
@@ -1,32 +0,0 @@
1
- /**
2
- * TimeBack Integration Constants
3
- *
4
- * Constants related to TimeBack Caliper integration.
5
- */
6
-
7
- /**
8
- * TimeBack Caliper sensor URLs
9
- * Allowed sensor URLs for Caliper event validation
10
- */
11
- export const TIMEBACK_CALIPER_SENSORS = [
12
- 'https://samuraimath.com',
13
- 'https://app.alphamath.school',
14
- 'https://mathraiders.com',
15
- ] as const
16
-
17
- /**
18
- * TimeBack integration route paths (on game backend)
19
- * These routes are available on game backends when TimeBack is enabled
20
- *
21
- * NOTE:
22
- * These paths are relative to /api/ - the full paths are /api/integrations/timeback/*
23
- */
24
- export const TIMEBACK_ROUTES = {
25
- END_ACTIVITY: '/integrations/timeback/end-activity',
26
- } as const
27
-
28
- /**
29
- * TimeBack OneRoster organization identifier
30
- * This is the default organization sourcedId for Playcademy games
31
- */
32
- export const TIMEBACK_ORG_SOURCED_ID = 'PLAYCADEMY' as const
@@ -1,21 +0,0 @@
1
- /**
2
- * Worker Naming Constants
3
- *
4
- * Conventions for naming Cloudflare workers to avoid collisions
5
- * between staging and production deployments.
6
- */
7
-
8
- /**
9
- * Worker naming patterns
10
- * - Production workers: {slug} → accessible at {slug}.playcademy.gg
11
- * - Staging workers: staging-{slug} → accessible at {slug}-staging.playcademy.gg
12
- *
13
- * Note: Worker names use a PREFIX (staging-) while hostnames use a SUFFIX (-staging)
14
- * to follow subdomain naming conventions.
15
- */
16
- export const WORKER_NAMING = {
17
- /** Prefix for staging worker names (e.g., "staging-bamboo") */
18
- STAGING_PREFIX: 'staging-',
19
- /** Suffix for staging worker hostnames (e.g., "bamboo-staging.playcademy.gg") */
20
- STAGING_SUFFIX: '-staging',
21
- } as const