@vibemancer/core 0.2.2 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -597,16 +597,17 @@ declare function resetRuleset(): void;
597
597
  declare function currentRuleset(): Record<string, number>;
598
598
 
599
599
  /**
600
- * Engine version — milliseconds since the Unix epoch.
600
+ * Engine version — a stable content hash of packages/core/src.
601
601
  *
602
- * Bumped automatically by `scripts/update-engine-version.mjs` on every build.
602
+ * Derived by `scripts/update-engine-version.mjs` from the engine sources, so it changes
603
+ * only when the engine changes — NOT on every build.
603
604
  * The same value is propagated to `packages/functions/src/engine-version.generated.ts`
604
- * so cloud functions and the core engine always agree on a single version per deploy.
605
+ * so cloud functions and the core engine always agree on one version.
605
606
  *
606
607
  * Used to gate spectator replays: a recorded match can only be re-simulated when
607
608
  * the runtime engine version matches the version that produced the match.
608
609
  */
609
- declare const ENGINE_VERSION = 1786501467111;
610
+ declare const ENGINE_VERSION = 1203306608058186;
610
611
 
611
612
  interface InternalWizardState extends WizardState {
612
613
  missileConfig?: MissileConfig;
@@ -2417,9 +2418,6 @@ type WorkerFactory = (code: string) => {
2417
2418
  worker: WorkerLike;
2418
2419
  cleanup?: () => void;
2419
2420
  };
2420
- /**
2421
- * Options for browser sandbox creation.
2422
- */
2423
2421
  interface BrowserSandboxOptions {
2424
2422
  /** Timeout in ms for fight/simulate calls (default: 30000). */
2425
2423
  timeoutMs?: number;
@@ -222,7 +222,7 @@ import {
222
222
  withMissileContext,
223
223
  withWizardContext,
224
224
  wrapWithParams
225
- } from "./chunk-X3ZCKBVC.js";
225
+ } from "./chunk-XYEK7THS.js";
226
226
  export {
227
227
  ALL_BOTS,
228
228
  ARENA_MAX,
package/dist/index.js CHANGED
@@ -222,7 +222,7 @@ import {
222
222
  withMissileContext,
223
223
  withWizardContext,
224
224
  wrapWithParams
225
- } from "./chunk-X3ZCKBVC.js";
225
+ } from "./chunk-XYEK7THS.js";
226
226
 
227
227
  // src/engine/sandbox.ts
228
228
  import ivm from "isolated-vm";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibemancer/core",
3
- "version": "0.2.2",
3
+ "version": "1.0.1",
4
4
  "description": "Vibemancer game engine - competitive programming wizard battle arena",
5
5
  "type": "module",
6
6
  "author": "Low Entry",
@@ -51,6 +51,18 @@ export type WorkerFactory = (code: string) => {worker: WorkerLike; cleanup?: ()
51
51
  /**
52
52
  * Options for browser sandbox creation.
53
53
  */
54
+ /**
55
+ * Floor for worker STARTUP, independent of the fight budget.
56
+ *
57
+ * `timeoutMs` answers "how long may a fight run" — the crasher tests set it to 2-3s on
58
+ * purpose so an infinite loop is caught quickly. Booting a worker is not a fight, and on a
59
+ * busy machine it can exceed a deliberately tiny budget, which surfaced as "Worker
60
+ * initialization timed out" from tests asserting something else entirely.
61
+ *
62
+ * A floor rather than a replacement: a caller asking for a LONGER budget still gets it.
63
+ */
64
+ const WORKER_INIT_MIN_MS = 30_000;
65
+
54
66
  export interface BrowserSandboxOptions
55
67
  {
56
68
  /** Timeout in ms for fight/simulate calls (default: 30000). */
@@ -214,7 +226,7 @@ export class BrowserMatchSandbox
214
226
 
215
227
  try
216
228
  {
217
- await sandbox.waitForReady(timeout);
229
+ await sandbox.waitForReady(Math.max(timeout, WORKER_INIT_MIN_MS));
218
230
  }
219
231
  catch(error)
220
232
  {
@@ -1,11 +1,12 @@
1
1
  /**
2
- * Engine version — milliseconds since the Unix epoch.
2
+ * Engine version — a stable content hash of packages/core/src.
3
3
  *
4
- * Bumped automatically by `scripts/update-engine-version.mjs` on every build.
4
+ * Derived by `scripts/update-engine-version.mjs` from the engine sources, so it changes
5
+ * only when the engine changes — NOT on every build.
5
6
  * The same value is propagated to `packages/functions/src/engine-version.generated.ts`
6
- * so cloud functions and the core engine always agree on a single version per deploy.
7
+ * so cloud functions and the core engine always agree on one version.
7
8
  *
8
9
  * Used to gate spectator replays: a recorded match can only be re-simulated when
9
10
  * the runtime engine version matches the version that produced the match.
10
11
  */
11
- export const ENGINE_VERSION = 1786501467111;
12
+ export const ENGINE_VERSION = 1203306608058186;