@crvouga/mockingbird-service-workos 1.16.0 → 1.17.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog — @crvouga/mockingbird-service-workos
2
2
 
3
+ ## 1.17.0 (2026-11-25)
4
+
5
+ ### Features
6
+
7
+ - let a long-running mock forget idle namespaces and cap what each holds ([60847a9](https://github.com/crvouga/mockingbird/commit/60847a9bcb8f12200f45ce81e554d9eb23245ccf))
8
+
9
+ ### Fixes and improvements
10
+
11
+ - keep same-tick writes through idle expiry and expire controls-only namespaces ([e153e21](https://github.com/crvouga/mockingbird/commit/e153e21c4fcbe1a54e7b6dc0321f3a50c6ede1ac))
12
+ - make namespace clean-up safe under failure, sharing and concurrency ([0ec2009](https://github.com/crvouga/mockingbird/commit/0ec20094d0031d628d467d3c81625ef23cdbcd8d))
13
+
14
+ ### Dependencies
15
+
16
+ - `@crvouga/mockingbird-runtime`
17
+
3
18
  ## 1.16.0 (2026-11-22)
4
19
 
5
20
  ### Features
@@ -9,11 +24,6 @@
9
24
  - standardize React components on HeroUI ([b19008e](https://github.com/crvouga/mockingbird/commit/b19008eb86e78b0553e7b0cef7d38b79576013b1))
10
25
  - add reusable browser preview packages and emulator integration features ([c87e9b4](https://github.com/crvouga/mockingbird/commit/c87e9b466d2d728c69a6ad35b73fa387726a1a61))
11
26
 
12
- ### Dependencies
13
-
14
- - `@crvouga/mockingbird-runtime`
15
- - `@crvouga/mockingbird-service-sqlite`
16
-
17
27
  ## 1.15.1 (2026-11-18)
18
28
 
19
29
  ### Fixes and improvements
@@ -28,7 +28,7 @@ __export(service_exports, {
28
28
  __reExport(service_exports, service_star);
29
29
  import * as service_star from "@crvouga/mockingbird-runtime/service";
30
30
  import { PACKAGE_VERSION as SHARED_VERSION, createRuntime as sharedRuntime } from "@crvouga/mockingbird-runtime/service";
31
- var PACKAGE_VERSION = true ? "1.16.0" : SHARED_VERSION;
31
+ var PACKAGE_VERSION = true ? "1.17.0" : SHARED_VERSION;
32
32
  var ADMIN_BRAND = typeof define_MOCKINGBIRD_ADMIN_BRAND_default === "object" ? define_MOCKINGBIRD_ADMIN_BRAND_default : void 0;
33
33
  var createRuntime = (options) => sharedRuntime({
34
34
  ...options,
package/dist/index.d.ts CHANGED
@@ -664,6 +664,29 @@ type MetricsReport = {
664
664
  faults: number;
665
665
  totalDurationMs: number;
666
666
  };
667
+ /** What a runtime holds across every namespace: the gauges a long-running mock is watched by. */
668
+ type ResourceReport = {
669
+ /** Namespaces that hold state now (`GET /__admin/namespaces`). */
670
+ namespaces: number;
671
+ /** Stored records, every collection and branch included. */
672
+ records: number;
673
+ /** Journal entries held (`GET /__admin/requests`). */
674
+ journalEntries: number;
675
+ /** Named snapshots held. */
676
+ snapshots: number;
677
+ /** Webhook deliveries waiting for an attempt or a retry. */
678
+ webhooksPending: number;
679
+ /** Heap in use, or `null` where the host cannot say. */
680
+ heapUsedBytes: number | null;
681
+ /** Namespaces forgotten for being idle since the runtime started. */
682
+ namespacesExpired: number;
683
+ /** Idle namespaces whose drop failed; each is retried on a later request. */
684
+ idleExpiryFailures: number;
685
+ /** Requests answered `507` for the record cap, their writes rolled back. */
686
+ recordLimitRefusals: number;
687
+ /** Snapshots refused for the snapshot cap. */
688
+ snapshotLimitRefusals: number;
689
+ };
667
690
  type Metrics = {
668
691
  record(entry: RequestLog): void;
669
692
  report(namespace?: string): MetricsReport;
@@ -694,6 +717,8 @@ type Journal = {
694
717
  readonly size: number;
695
718
  record(entry: JournalEntry): void;
696
719
  list(query?: JournalQuery): JournalEntry[];
720
+ /** Entries held for one namespace, or for every namespace. */
721
+ count(namespace?: string): number;
697
722
  /** Forget one namespace's entries, or every namespace's. */
698
723
  clear(namespace?: string): void;
699
724
  };
@@ -810,6 +835,7 @@ declare class Collection<T> {
810
835
  nextSequence(): number;
811
836
  get(id: string): T | undefined;
812
837
  has(id: string): boolean;
838
+ private assertRoom;
813
839
  /** Insert a new record, assigning it the next sequence number. */
814
840
  insert(id: string, value: T): Stored<T>;
815
841
  /** Replace an existing record's value, keeping its position. */
@@ -931,7 +957,8 @@ type WebhookHub = {
931
957
  deliveryId: string;
932
958
  }) => void): () => void;
933
959
  setTransportPolicy(policy: OwnedTransport): void;
934
- pending(namespace: string): number;
960
+ /** Deliveries waiting in one namespace, or in every namespace. */
961
+ pending(namespace?: string): number;
935
962
  snapshot(namespace: string): unknown;
936
963
  exportSnapshot(handle: unknown): unknown;
937
964
  importSnapshot(namespace: string, document: unknown): unknown;
@@ -1009,6 +1036,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1009
1036
  reset(namespace?: string): Promise<void>;
1010
1037
  /** Reset a namespace and forget it, releasing everything it held. */
1011
1038
  dropNamespace(namespace: string): Promise<void>;
1039
+ /** What the runtime holds across every namespace, as `GET /__admin/metrics` reports it. */
1040
+ resources(): ResourceReport;
1012
1041
  /** A namespace's controls: seed, clock, virtual time, latency, faults and snapshots. */
1013
1042
  controls(namespace?: string): ControlState & {
1014
1043
  snapshots: SnapshotInfo[];
package/dist/server.d.ts CHANGED
@@ -607,6 +607,29 @@ type MetricsReport = {
607
607
  faults: number;
608
608
  totalDurationMs: number;
609
609
  };
610
+ /** What a runtime holds across every namespace: the gauges a long-running mock is watched by. */
611
+ type ResourceReport = {
612
+ /** Namespaces that hold state now (`GET /__admin/namespaces`). */
613
+ namespaces: number;
614
+ /** Stored records, every collection and branch included. */
615
+ records: number;
616
+ /** Journal entries held (`GET /__admin/requests`). */
617
+ journalEntries: number;
618
+ /** Named snapshots held. */
619
+ snapshots: number;
620
+ /** Webhook deliveries waiting for an attempt or a retry. */
621
+ webhooksPending: number;
622
+ /** Heap in use, or `null` where the host cannot say. */
623
+ heapUsedBytes: number | null;
624
+ /** Namespaces forgotten for being idle since the runtime started. */
625
+ namespacesExpired: number;
626
+ /** Idle namespaces whose drop failed; each is retried on a later request. */
627
+ idleExpiryFailures: number;
628
+ /** Requests answered `507` for the record cap, their writes rolled back. */
629
+ recordLimitRefusals: number;
630
+ /** Snapshots refused for the snapshot cap. */
631
+ snapshotLimitRefusals: number;
632
+ };
610
633
  type Metrics = {
611
634
  record(entry: RequestLog): void;
612
635
  report(namespace?: string): MetricsReport;
@@ -637,6 +660,8 @@ type Journal = {
637
660
  readonly size: number;
638
661
  record(entry: JournalEntry): void;
639
662
  list(query?: JournalQuery): JournalEntry[];
663
+ /** Entries held for one namespace, or for every namespace. */
664
+ count(namespace?: string): number;
640
665
  /** Forget one namespace's entries, or every namespace's. */
641
666
  clear(namespace?: string): void;
642
667
  };
@@ -828,7 +853,8 @@ type WebhookHub = {
828
853
  deliveryId: string;
829
854
  }) => void): () => void;
830
855
  setTransportPolicy(policy: OwnedTransport): void;
831
- pending(namespace: string): number;
856
+ /** Deliveries waiting in one namespace, or in every namespace. */
857
+ pending(namespace?: string): number;
832
858
  snapshot(namespace: string): unknown;
833
859
  exportSnapshot(handle: unknown): unknown;
834
860
  importSnapshot(namespace: string, document: unknown): unknown;
@@ -906,6 +932,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
906
932
  reset(namespace?: string): Promise<void>;
907
933
  /** Reset a namespace and forget it, releasing everything it held. */
908
934
  dropNamespace(namespace: string): Promise<void>;
935
+ /** What the runtime holds across every namespace, as `GET /__admin/metrics` reports it. */
936
+ resources(): ResourceReport;
909
937
  /** A namespace's controls: seed, clock, virtual time, latency, faults and snapshots. */
910
938
  controls(namespace?: string): ControlState & {
911
939
  snapshots: SnapshotInfo[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-workos",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "Stateful WorkOS AuthKit emulator with signed sessions, rotating refresh tokens and user pagination.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -103,7 +103,7 @@
103
103
  "pack:check": "bun ../../../scripts/pack-check.ts"
104
104
  },
105
105
  "dependencies": {
106
- "@crvouga/mockingbird-runtime": "0.4.0",
106
+ "@crvouga/mockingbird-runtime": "0.5.0",
107
107
  "@crvouga/mockingbird-service-sqlite": "3.7.0",
108
108
  "hono": "4.13.11"
109
109
  },