@crvouga/mockingbird-runtime 0.0.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,11 +18,11 @@ import {
18
18
  import {
19
19
  Collection,
20
20
  bootSqlite
21
- } from "./chunk-G62YDIIJ.js";
21
+ } from "./chunk-OISPHKE2.js";
22
22
  import {
23
23
  clearNamespace
24
24
  } from "./chunk-2KDYLZXC.js";
25
- import "./chunk-XNS34BPF.js";
25
+ import "./chunk-LL6NKAJO.js";
26
26
  import {
27
27
  requestBaseUrl
28
28
  } from "./chunk-2Y25NPCV.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  MAX_VARIABLE_BYTE_INTEGER,
3
3
  MQTT_WEBSOCKET_PATH
4
- } from "../chunk-ANCCZFF2.js";
5
- import "../chunk-G62YDIIJ.js";
4
+ } from "../chunk-5WW5N4TU.js";
5
+ import "../chunk-OISPHKE2.js";
6
6
  import "../chunk-2KDYLZXC.js";
7
- import "../chunk-XNS34BPF.js";
7
+ import "../chunk-LL6NKAJO.js";
8
8
  import "../chunk-2Y25NPCV.js";
9
9
  import "../chunk-EQLY2YOA.js";
10
10
  import "../chunk-HU6IOAFC.js";
@@ -14,16 +14,16 @@ import {
14
14
  observeClock,
15
15
  takeConnackFault,
16
16
  webSocketNamespace
17
- } from "./chunk-ANCCZFF2.js";
17
+ } from "./chunk-5WW5N4TU.js";
18
18
  import {
19
19
  Collection,
20
20
  IdSequence
21
- } from "./chunk-G62YDIIJ.js";
21
+ } from "./chunk-OISPHKE2.js";
22
22
  import "./chunk-2KDYLZXC.js";
23
23
  import {
24
24
  fromBase64,
25
25
  toBase64
26
- } from "./chunk-XNS34BPF.js";
26
+ } from "./chunk-LL6NKAJO.js";
27
27
  import "./chunk-2Y25NPCV.js";
28
28
  import "./chunk-EQLY2YOA.js";
29
29
  import "./chunk-HU6IOAFC.js";
@@ -7,7 +7,7 @@ import {
7
7
  createMetrics,
8
8
  maskCredential,
9
9
  resolveAdminPrefix
10
- } from "../chunk-XNS34BPF.js";
10
+ } from "../chunk-LL6NKAJO.js";
11
11
  import "../chunk-2Y25NPCV.js";
12
12
 
13
13
  // ../service/core/dist/engine-admin.js
package/dist/service.d.ts CHANGED
@@ -561,6 +561,11 @@ type MockControls = NamespaceControls$1 & {
561
561
  credentials?: Record<string, string>;
562
562
  /** Overrides for named namespaces. A key given here replaces the shared value. */
563
563
  namespaces?: Record<string, NamespaceControls$1>;
564
+ /**
565
+ * Record a time-travel checkpoint after every accepted write. Default true. The runtime's own
566
+ * `checkpointMutations` option wins over this.
567
+ */
568
+ checkpointMutations?: boolean;
564
569
  };
565
570
  /** A latency rule in milliseconds. */
566
571
  type LatencyRule = {
@@ -595,6 +600,7 @@ type BootPlan = {
595
600
  shared: ControlPlan;
596
601
  namespaces: Record<string, ControlPlan>;
597
602
  credentials: Record<string, string>;
603
+ checkpointMutations?: boolean;
598
604
  };
599
605
  /** Validate a boot {@link MockControls} document. */
600
606
  declare const normalizeBootControls: (value: unknown, label?: string) => BootPlan;
@@ -2395,6 +2401,14 @@ type RuntimeOptions<T extends ServiceInstance> = {
2395
2401
  webhooks?: WebhookHub;
2396
2402
  /** Retained time-travel checkpoints per namespace. Default 1,000. */
2397
2403
  maxCheckpoints?: number;
2404
+ /**
2405
+ * Record a time-travel checkpoint after every accepted mutation and stamp its id in
2406
+ * `x-mockingbird-checkpoint`. Default true. Each checkpoint reads the whole namespace, so a
2407
+ * long-running mock that never travels back can turn this off to keep a write's cost its own;
2408
+ * `checkpoint`, `snapshot`, `branch` and `checkout` still capture when called. Wins over
2409
+ * `adminControls.checkpointMutations`, which a fleet entry can set for any service.
2410
+ */
2411
+ checkpointMutations?: boolean;
2398
2412
  /** Injectable process IO used for observability and delays; logical service time uses `clock`. */
2399
2413
  io?: Partial<RuntimeIO>;
2400
2414
  /**
package/dist/service.js CHANGED
@@ -65,7 +65,7 @@ import {
65
65
  verifyOperations,
66
66
  webhookAdminRoutes,
67
67
  withNamespaceRollback
68
- } from "./chunk-G62YDIIJ.js";
68
+ } from "./chunk-OISPHKE2.js";
69
69
  import "./chunk-2KDYLZXC.js";
70
70
  import {
71
71
  ADMIN_CONTROL_PAGES,
@@ -126,7 +126,7 @@ import {
126
126
  timingSafeEqual,
127
127
  toBase64,
128
128
  toHex
129
- } from "./chunk-XNS34BPF.js";
129
+ } from "./chunk-LL6NKAJO.js";
130
130
  import {
131
131
  requestBaseUrl
132
132
  } from "./chunk-2Y25NPCV.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-runtime",
3
- "version": "0.0.2",
3
+ "version": "0.2.0",
4
4
  "description": "The shared Mockingbird runtime every emulator service depends on: router, admin API and page, snapshots, faults and clock, installed once however many emulators an application uses.",
5
5
  "license": "MIT",
6
6
  "type": "module",