@dhaneshpurohit/mockstar 0.1.3

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.
Files changed (156) hide show
  1. package/CHANGELOG.md +180 -0
  2. package/LICENSE +21 -0
  3. package/README.md +260 -0
  4. package/dist/cli/commands/init.d.ts +13 -0
  5. package/dist/cli/commands/init.d.ts.map +1 -0
  6. package/dist/cli/commands/migrate.d.ts +13 -0
  7. package/dist/cli/commands/migrate.d.ts.map +1 -0
  8. package/dist/cli.d.ts +3 -0
  9. package/dist/cli.d.ts.map +1 -0
  10. package/dist/cli.js +15076 -0
  11. package/dist/core/config/index.d.ts +5 -0
  12. package/dist/core/config/index.d.ts.map +1 -0
  13. package/dist/core/config/loader.d.ts +14 -0
  14. package/dist/core/config/loader.d.ts.map +1 -0
  15. package/dist/core/config/schema.d.ts +5706 -0
  16. package/dist/core/config/schema.d.ts.map +1 -0
  17. package/dist/core/config/snapshot.d.ts +52 -0
  18. package/dist/core/config/snapshot.d.ts.map +1 -0
  19. package/dist/core/config/watcher.d.ts +13 -0
  20. package/dist/core/config/watcher.d.ts.map +1 -0
  21. package/dist/core/errors/boundary.d.ts +22 -0
  22. package/dist/core/errors/boundary.d.ts.map +1 -0
  23. package/dist/core/errors/index.d.ts +3 -0
  24. package/dist/core/errors/index.d.ts.map +1 -0
  25. package/dist/core/errors/process.d.ts +17 -0
  26. package/dist/core/errors/process.d.ts.map +1 -0
  27. package/dist/core/handlers/index.d.ts +4 -0
  28. package/dist/core/handlers/index.d.ts.map +1 -0
  29. package/dist/core/handlers/registry.d.ts +22 -0
  30. package/dist/core/handlers/registry.d.ts.map +1 -0
  31. package/dist/core/handlers/types.d.ts +42 -0
  32. package/dist/core/handlers/types.d.ts.map +1 -0
  33. package/dist/core/journal/index.d.ts +2 -0
  34. package/dist/core/journal/index.d.ts.map +1 -0
  35. package/dist/core/journal/ring-buffer.d.ts +46 -0
  36. package/dist/core/journal/ring-buffer.d.ts.map +1 -0
  37. package/dist/core/matching/discriminators.d.ts +29 -0
  38. package/dist/core/matching/discriminators.d.ts.map +1 -0
  39. package/dist/core/matching/index.d.ts +24 -0
  40. package/dist/core/matching/index.d.ts.map +1 -0
  41. package/dist/core/matching/path-trie.d.ts +21 -0
  42. package/dist/core/matching/path-trie.d.ts.map +1 -0
  43. package/dist/core/observability/index.d.ts +3 -0
  44. package/dist/core/observability/index.d.ts.map +1 -0
  45. package/dist/core/observability/logger.d.ts +18 -0
  46. package/dist/core/observability/logger.d.ts.map +1 -0
  47. package/dist/core/observability/metrics.d.ts +23 -0
  48. package/dist/core/observability/metrics.d.ts.map +1 -0
  49. package/dist/core/preflight.d.ts +18 -0
  50. package/dist/core/preflight.d.ts.map +1 -0
  51. package/dist/core/scenarios/evaluator.d.ts +52 -0
  52. package/dist/core/scenarios/evaluator.d.ts.map +1 -0
  53. package/dist/core/scenarios/index.d.ts +5 -0
  54. package/dist/core/scenarios/index.d.ts.map +1 -0
  55. package/dist/core/scenarios/merger.d.ts +45 -0
  56. package/dist/core/scenarios/merger.d.ts.map +1 -0
  57. package/dist/core/templating/compiler.d.ts +118 -0
  58. package/dist/core/templating/compiler.d.ts.map +1 -0
  59. package/dist/core/templating/faker.d.ts +14 -0
  60. package/dist/core/templating/faker.d.ts.map +1 -0
  61. package/dist/core/templating/index.d.ts +4 -0
  62. package/dist/core/templating/index.d.ts.map +1 -0
  63. package/dist/core/templating/tier2/id.d.ts +27 -0
  64. package/dist/core/templating/tier2/id.d.ts.map +1 -0
  65. package/dist/core/templating/tier2/index.d.ts +4 -0
  66. package/dist/core/templating/tier2/index.d.ts.map +1 -0
  67. package/dist/core/templating/tier2/now.d.ts +15 -0
  68. package/dist/core/templating/tier2/now.d.ts.map +1 -0
  69. package/dist/core/templating/tier2/walker.d.ts +43 -0
  70. package/dist/core/templating/tier2/walker.d.ts.map +1 -0
  71. package/dist/core/tenancy/extractor.d.ts +20 -0
  72. package/dist/core/tenancy/extractor.d.ts.map +1 -0
  73. package/dist/core/tenancy/index.d.ts +2 -0
  74. package/dist/core/tenancy/index.d.ts.map +1 -0
  75. package/dist/features/admin/auth.d.ts +19 -0
  76. package/dist/features/admin/auth.d.ts.map +1 -0
  77. package/dist/features/admin/endpoints.d.ts +21 -0
  78. package/dist/features/admin/endpoints.d.ts.map +1 -0
  79. package/dist/features/admin/index.d.ts +3 -0
  80. package/dist/features/admin/index.d.ts.map +1 -0
  81. package/dist/features/dynamic-mock.d.ts +16 -0
  82. package/dist/features/dynamic-mock.d.ts.map +1 -0
  83. package/dist/features/enhance/boundary.d.ts +26 -0
  84. package/dist/features/enhance/boundary.d.ts.map +1 -0
  85. package/dist/features/enhance/field-mapping.d.ts +23 -0
  86. package/dist/features/enhance/field-mapping.d.ts.map +1 -0
  87. package/dist/features/enhance/index.d.ts +21 -0
  88. package/dist/features/enhance/index.d.ts.map +1 -0
  89. package/dist/features/openapi/converter.d.ts +55 -0
  90. package/dist/features/openapi/converter.d.ts.map +1 -0
  91. package/dist/features/openapi/importer.d.ts +11 -0
  92. package/dist/features/openapi/importer.d.ts.map +1 -0
  93. package/dist/features/openapi/index.d.ts +3 -0
  94. package/dist/features/openapi/index.d.ts.map +1 -0
  95. package/dist/features/pass-through.d.ts +9 -0
  96. package/dist/features/pass-through.d.ts.map +1 -0
  97. package/dist/features/proxy/ca.d.ts +49 -0
  98. package/dist/features/proxy/ca.d.ts.map +1 -0
  99. package/dist/features/proxy/cert-cache.d.ts +34 -0
  100. package/dist/features/proxy/cert-cache.d.ts.map +1 -0
  101. package/dist/features/proxy/cli.d.ts +2 -0
  102. package/dist/features/proxy/cli.d.ts.map +1 -0
  103. package/dist/features/proxy/config.d.ts +71 -0
  104. package/dist/features/proxy/config.d.ts.map +1 -0
  105. package/dist/features/proxy/dns.d.ts +18 -0
  106. package/dist/features/proxy/dns.d.ts.map +1 -0
  107. package/dist/features/proxy/env-detector.d.ts +7 -0
  108. package/dist/features/proxy/env-detector.d.ts.map +1 -0
  109. package/dist/features/proxy/index.d.ts +15 -0
  110. package/dist/features/proxy/index.d.ts.map +1 -0
  111. package/dist/features/proxy/install-journal.d.ts +51 -0
  112. package/dist/features/proxy/install-journal.d.ts.map +1 -0
  113. package/dist/features/proxy/port-bind.d.ts +33 -0
  114. package/dist/features/proxy/port-bind.d.ts.map +1 -0
  115. package/dist/features/proxy/server.d.ts +19 -0
  116. package/dist/features/proxy/server.d.ts.map +1 -0
  117. package/dist/features/proxy/sni-gate.d.ts +17 -0
  118. package/dist/features/proxy/sni-gate.d.ts.map +1 -0
  119. package/dist/features/proxy/tls-adapter.d.ts +52 -0
  120. package/dist/features/proxy/tls-adapter.d.ts.map +1 -0
  121. package/dist/features/proxy/types.d.ts +103 -0
  122. package/dist/features/proxy/types.d.ts.map +1 -0
  123. package/dist/features/proxy/upstream.d.ts +23 -0
  124. package/dist/features/proxy/upstream.d.ts.map +1 -0
  125. package/dist/features/spec/index.d.ts +17 -0
  126. package/dist/features/spec/index.d.ts.map +1 -0
  127. package/dist/features/static-mock.d.ts +23 -0
  128. package/dist/features/static-mock.d.ts.map +1 -0
  129. package/dist/features/url-validator.d.ts +53 -0
  130. package/dist/features/url-validator.d.ts.map +1 -0
  131. package/dist/features/webhooks/circuit-breaker.d.ts +49 -0
  132. package/dist/features/webhooks/circuit-breaker.d.ts.map +1 -0
  133. package/dist/features/webhooks/compile.d.ts +16 -0
  134. package/dist/features/webhooks/compile.d.ts.map +1 -0
  135. package/dist/features/webhooks/dispatcher.d.ts +45 -0
  136. package/dist/features/webhooks/dispatcher.d.ts.map +1 -0
  137. package/dist/features/webhooks/event-registry.d.ts +36 -0
  138. package/dist/features/webhooks/event-registry.d.ts.map +1 -0
  139. package/dist/features/webhooks/index.d.ts +13 -0
  140. package/dist/features/webhooks/index.d.ts.map +1 -0
  141. package/dist/features/webhooks/journal.d.ts +32 -0
  142. package/dist/features/webhooks/journal.d.ts.map +1 -0
  143. package/dist/features/webhooks/queue.d.ts +93 -0
  144. package/dist/features/webhooks/queue.d.ts.map +1 -0
  145. package/dist/features/webhooks/signing.d.ts +35 -0
  146. package/dist/features/webhooks/signing.d.ts.map +1 -0
  147. package/dist/features/webhooks/types.d.ts +96 -0
  148. package/dist/features/webhooks/types.d.ts.map +1 -0
  149. package/dist/index.d.ts +30 -0
  150. package/dist/index.d.ts.map +1 -0
  151. package/dist/index.js +12813 -0
  152. package/dist/server.d.ts +62 -0
  153. package/dist/server.d.ts.map +1 -0
  154. package/dist/version.d.ts +2 -0
  155. package/dist/version.d.ts.map +1 -0
  156. package/package.json +62 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/config/schema.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,WAAW,8EAA4E,CAAC;AAyCrG,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAShB,CAAC;AASZ,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAShB,CAAC;AAEZ,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMjB,CAAC;AAEZ,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAOrB,CAAC;AAEZ,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIvB,CAAC;AAMH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACjE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACvD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACzD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import type { CompiledWebhookSpec } from "../../features/webhooks/types.ts";
2
+ import type { HandlerRegistry } from "../handlers/index.ts";
3
+ import type { MatchIndex } from "../matching/index.ts";
4
+ import type { CompiledScenario } from "../scenarios/evaluator.ts";
5
+ import type { CompiledResponse } from "../templating/compiler.ts";
6
+ import type { Entry, Server, Tenant } from "./schema.ts";
7
+ export interface TenantSnapshot {
8
+ readonly name: string;
9
+ readonly entries: readonly Entry[];
10
+ /** Precomputed match index (RT-6.1). */
11
+ readonly matchIndex: MatchIndex;
12
+ /** Response bodies compiled from templates at load time (RT-6.2). */
13
+ readonly compiledResponses: ReadonlyMap<string, CompiledResponse>;
14
+ /** Pre-compiled scenario rules keyed by mock entry ID (RT-4). Regex objects scoped here (O3). */
15
+ readonly compiledScenarios: ReadonlyMap<string, readonly CompiledScenario[]>;
16
+ /** Pre-compiled webhook specs keyed by mock entry ID (RT-8, T7). */
17
+ readonly compiledWebhooks: ReadonlyMap<string, readonly CompiledWebhookSpec[]>;
18
+ readonly limits: Tenant["limits"];
19
+ readonly adminToken?: string;
20
+ readonly allowPrivateUpstreams: boolean;
21
+ }
22
+ export interface ConfigSnapshot {
23
+ readonly version: number;
24
+ readonly server: Server;
25
+ readonly tenants: ReadonlyMap<string, TenantSnapshot>;
26
+ readonly handlers: HandlerRegistry;
27
+ }
28
+ /**
29
+ * Atomic snapshot holder. Readers call `get()` exactly once per request and
30
+ * retain that reference for the request lifetime (RT-5.3).
31
+ *
32
+ * Replacing the snapshot is a single assignment — in-flight readers keep
33
+ * the old reference. Old snapshots are garbage-collected when the last
34
+ * reader completes.
35
+ */
36
+ export declare class SnapshotHolder {
37
+ #private;
38
+ constructor(initial: ConfigSnapshot);
39
+ get(): ConfigSnapshot;
40
+ /**
41
+ * Replace the active snapshot. Atomic from a reader's perspective: a
42
+ * request that has already captured the previous snapshot continues to
43
+ * see it; subsequent requests see the new one. (RT-5.2)
44
+ */
45
+ swap(next: ConfigSnapshot): ConfigSnapshot;
46
+ /**
47
+ * Partial swap: replace a single tenant's snapshot, leaving others
48
+ * untouched. Preserves per-tenant reload isolation (T8, RT-5.4).
49
+ */
50
+ swapTenant(tenantName: string, nextTenant: TenantSnapshot): void;
51
+ }
52
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../src/core/config/snapshot.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,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older } from "./snapshot.ts";
3
+ export interface WatcherOptions {
4
+ configRoot: string;
5
+ holder: SnapshotHolder;
6
+ handlers: HandlerRegistry;
7
+ onReload?: (tenant: string, result: "ok" | "rejected", details?: string) => void;
8
+ debounceMs?: number;
9
+ }
10
+ export declare function startWatcher(opts: WatcherOptions): {
11
+ stop: () => void;
12
+ };
13
+ //# sourceMappingURL=watcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../../src/core/config/watcher.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,GAAG,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,CA2BvE"}
@@ -0,0 +1,22 @@
1
+ import type { Context } from "hono";
2
+ import type { StructuredLogger } from "../observability/logger.ts";
3
+ export interface BoundaryOptions {
4
+ timeoutMs: number;
5
+ logger: StructuredLogger;
6
+ }
7
+ export interface HandlerInvocationResult {
8
+ response: Response;
9
+ faulted: boolean;
10
+ faultKind?: "throw" | "rejection" | "timeout";
11
+ }
12
+ /**
13
+ * Wrap a handler invocation: await it with try/catch + timeout, produce a
14
+ * safe 500 on fault. Caught faults become a 500 response with a safe
15
+ * diagnostic body. The server keeps serving. (RT-2.1, RT-2.2)
16
+ */
17
+ export declare function invokeWithBoundary(ctx: Context, handlerName: string, invoke: () => Response | Promise<Response>, opts: BoundaryOptions): Promise<HandlerInvocationResult>;
18
+ export declare class HandlerTimeoutError extends Error {
19
+ readonly ms: number;
20
+ constructor(ms: number);
21
+ }
22
+ //# sourceMappingURL=boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../../src/core/errors/boundary.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;CAC/C;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,EAC1C,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,uBAAuB,CAAC,CAiClC;AAED,qBAAa,mBAAoB,SAAQ,KAAK;aAChB,EAAE,EAAE,MAAM;gBAAV,EAAE,EAAE,MAAM;CAIvC"}
@@ -0,0 +1,3 @@
1
+ export { invokeWithBoundary, HandlerTimeoutError, type BoundaryOptions, type HandlerInvocationResult, } from "./boundary.ts";
2
+ export { installProcessHandlers, type ProcessBoundaryOptions } from "./process.ts";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { StructuredLogger } from "../observability/logger.ts";
2
+ export interface ProcessBoundaryOptions {
3
+ logger: StructuredLogger;
4
+ /** Callback to flip /ready to 503. */
5
+ setReady: (ready: boolean) => void;
6
+ /** Graceful-exit delay so the log flushes and /ready drains. */
7
+ drainMs?: number;
8
+ /** Called instead of process.exit for testability. */
9
+ exit?: (code: number) => void;
10
+ }
11
+ /**
12
+ * Install process-level crash handlers. Fire-and-forget promise rejections
13
+ * and truly uncatchable errors log + flip /ready + exit. The orchestrator
14
+ * restarts (documented prod requirement — RT-3.3).
15
+ */
16
+ export declare function installProcessHandlers(opts: ProcessBoundaryOptions): () => void;
17
+ //# sourceMappingURL=process.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../src/core/errors/process.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,gBAAgB,CAAC;IACzB,sCAAsC;IACtC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,sBAAsB,GAAG,MAAM,IAAI,CA6B/E"}
@@ -0,0 +1,4 @@
1
+ export { buildHandlerRegistry, verifyHandlerReferences } from "./registry.ts";
2
+ export type { HandlerRegistry, MockHandler, HandlerHelpers, FakerBundle } from "./types.ts";
3
+ export { HandlerLoadError, MissingHandlerError } from "./types.ts";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/handlers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type HandlerRegistry } from "./types.ts";
2
+ /**
3
+ * Discover handler modules in the configured directory and build a frozen
4
+ * registry. Path traversal attempts (absolute paths, '..') are rejected at
5
+ * the caller boundary — this function will throw if asked to load a file
6
+ * outside `handlersDir`.
7
+ *
8
+ * Satisfies RT-1.1, RT-1.2.
9
+ */
10
+ export declare function buildHandlerRegistry(handlersDir: string): Promise<HandlerRegistry>;
11
+ /**
12
+ * Cross-check: every handler reference in `references` must resolve to a
13
+ * loaded handler, otherwise throw MissingHandlerError with every missing
14
+ * name and its source location. Fails boot early.
15
+ *
16
+ * Satisfies RT-1.3, RT-1.4.
17
+ */
18
+ export declare function verifyHandlerReferences(registry: HandlerRegistry, references: readonly {
19
+ name: string;
20
+ configPath: string;
21
+ }[]): void;
22
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/core/handlers/registry.ts"],"names":[],"mappings":"AAQA,OAAO,EAAoB,KAAK,eAAe,EAAyC,MAAM,YAAY,CAAC;AAI3G;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAqCxF;AAgDD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EAAE,GAC1D,IAAI,CAKN"}
@@ -0,0 +1,42 @@
1
+ import type { Context } from "hono";
2
+ /**
3
+ * A named dynamic-mock handler. Receives the Hono context plus a
4
+ * per-request helper bundle. Must await any async work it spawns —
5
+ * fire-and-forget rejections escape to the process-level hook (RT-3).
6
+ */
7
+ export type MockHandler = (ctx: Context, helpers: HandlerHelpers) => Response | Promise<Response>;
8
+ export interface HandlerHelpers {
9
+ readonly tenant: string;
10
+ readonly requestId: string;
11
+ readonly faker: FakerBundle;
12
+ }
13
+ export interface FakerBundle {
14
+ uuid(): string;
15
+ email(): string;
16
+ name(): string;
17
+ integer(min: number, max: number): number;
18
+ pick<T>(items: readonly T[]): T;
19
+ }
20
+ export interface HandlerRegistry {
21
+ readonly size: number;
22
+ has(name: string): boolean;
23
+ get(name: string): MockHandler | undefined;
24
+ /** All handler names, sorted — used by diagnostics on missing-reference boot failures. */
25
+ names(): readonly string[];
26
+ }
27
+ export declare class HandlerLoadError extends Error {
28
+ readonly file: string;
29
+ readonly cause: unknown;
30
+ constructor(file: string, cause: unknown);
31
+ }
32
+ export declare class MissingHandlerError extends Error {
33
+ readonly missing: readonly {
34
+ name: string;
35
+ configPath: string;
36
+ }[];
37
+ constructor(missing: readonly {
38
+ name: string;
39
+ configPath: string;
40
+ }[], available: readonly string[]);
41
+ }
42
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/handlers/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAElG,MAAM,WAAW,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sourceRoot":"","sources":["../../../src/core/journal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,46 @@
1
+ export interface JournalEntry {
2
+ timestamp: number;
3
+ tenant: string;
4
+ requestId: string;
5
+ method: string;
6
+ path: string;
7
+ status: number;
8
+ matchedMockId: string | null;
9
+ durationUs: number;
10
+ /** ID of the scenario rule that matched, if any (O1). Absent when no scenario was evaluated. */
11
+ scenarioId?: string;
12
+ /** Attribute key that was absent from the request when a scenario predicate miss-fired (O1). */
13
+ scenarioMissReason?: string;
14
+ }
15
+ /**
16
+ * Fixed-capacity ring buffer. Writes are a single indexed assignment.
17
+ * Snapshot reads (for journal endpoint) allocate a fresh array so the
18
+ * write path is never blocked by a reader. (RT-6.3, O3)
19
+ */
20
+ export declare class RingBuffer<T> {
21
+ #private;
22
+ readonly capacity: number;
23
+ constructor(capacity: number);
24
+ /** O(1). Overwrites oldest when full. */
25
+ push(item: T): void;
26
+ get size(): number;
27
+ /**
28
+ * Return a chronologically-ordered snapshot (oldest first). Allocates a
29
+ * new array — callers should not mutate the returned list.
30
+ */
31
+ snapshot(): T[];
32
+ }
33
+ /**
34
+ * Per-tenant journal registry. The server holds one of these; per-tenant
35
+ * buffers are created lazily on first write (and bounded by the tenant's
36
+ * configured journal size — see S5 / O3).
37
+ */
38
+ export declare class JournalRegistry {
39
+ #private;
40
+ private readonly capacityFor;
41
+ constructor(capacityFor: (tenant: string) => number);
42
+ record(entry: JournalEntry): void;
43
+ snapshot(tenant: string): JournalEntry[];
44
+ tenants(): readonly string[];
45
+ }
46
+ //# sourceMappingURL=ring-buffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ring-buffer.d.ts","sourceRoot":"","sources":["../../../src/core/journal/ring-buffer.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,qBAAa,UAAU,CAAC,CAAC;;aAKK,QAAQ,EAAE,MAAM;gBAAhB,QAAQ,EAAE,MAAM;IAK5C,yCAAyC;IACzC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAMnB,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;OAGG;IACH,QAAQ,IAAI,CAAC,EAAE;CAgBhB;AAED;;;;GAIG;AACH,qBAAa,eAAe;;IAGd,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM;IAEpE,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IASjC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE;IAIxC,OAAO,IAAI,SAAS,MAAM,EAAE;CAG7B"}
@@ -0,0 +1,29 @@
1
+ import type { Predicate } from "../config/schema.ts";
2
+ export type StringMatch = string | {
3
+ equals: string;
4
+ } | {
5
+ regex: string;
6
+ } | {
7
+ startsWith: string;
8
+ } | {
9
+ contains: string;
10
+ };
11
+ export interface RequestView {
12
+ query: ReadonlyMap<string, string>;
13
+ headers: ReadonlyMap<string, string>;
14
+ body: unknown;
15
+ }
16
+ export interface PredicateFailure {
17
+ kind: "query" | "headers" | "body";
18
+ field: string;
19
+ expected: string;
20
+ got: string | undefined;
21
+ }
22
+ /**
23
+ * Evaluate discriminator predicates (query, headers, body) for a request.
24
+ * Returns null on match, otherwise the first failing predicate — enough
25
+ * context for diagnostic 404 (RT-9).
26
+ */
27
+ export declare function evaluateDiscriminators(pred: Predicate, req: RequestView): PredicateFailure | null;
28
+ export declare function stringMatchOk(spec: StringMatch, got: string | undefined): boolean;
29
+ //# sourceMappingURL=discriminators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discriminators.d.ts","sourceRoot":"","sources":["../../../src/core/matching/discriminators.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,MAAM,WAAW,GACnB,MAAM,GACN;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GACtB;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzB,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,gBAAgB,GAAG,IAAI,CAqCjG;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAQjF"}
@@ -0,0 +1,24 @@
1
+ import type { Entry } from "../config/schema.ts";
2
+ import { type PredicateFailure, type RequestView } from "./discriminators.ts";
3
+ export interface IndexedEntry {
4
+ entry: Entry;
5
+ /** Position in the source list — used as a tiebreaker after priority. */
6
+ order: number;
7
+ }
8
+ export interface MatchResult {
9
+ entry: Entry;
10
+ params: Record<string, string>;
11
+ }
12
+ export interface NearestMatch {
13
+ entry: Entry;
14
+ params: Record<string, string>;
15
+ failure: PredicateFailure;
16
+ }
17
+ export interface MatchIndex {
18
+ readonly size: number;
19
+ match(method: string, path: string, req: RequestView): MatchResult | null;
20
+ /** Candidates whose method+path matched but whose discriminators did not. Up to `limit`. */
21
+ nearestMatch(method: string, path: string, req: RequestView, limit?: number): NearestMatch[];
22
+ }
23
+ export declare function buildMatchIndex(entries: readonly Entry[]): MatchIndex;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/matching/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAA0B,MAAM,qBAAqB,CAAC;AAGtG,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAAC;IAC1E,4FAA4F;IAC5F,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,EAAE,CAAC;CAC9F;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,UAAU,CA4DrE"}
@@ -0,0 +1,21 @@
1
+ export interface PathPatternNode<T> {
2
+ /** Literal child segments. Map<segment, node>. */
3
+ readonly literal: Map<string, PathPatternNode<T>>;
4
+ /** Single parameter child (`:id`) — at most one per node. */
5
+ param: {
6
+ name: string;
7
+ node: PathPatternNode<T>;
8
+ } | null;
9
+ /** Wildcard rest of path (`*`). */
10
+ wildcard: PathPatternNode<T> | null;
11
+ /** Candidate values registered at this node (terminal). */
12
+ readonly values: T[];
13
+ }
14
+ export declare function createNode<T>(): PathPatternNode<T>;
15
+ export declare function insertPattern<T>(root: PathPatternNode<T>, pattern: string, value: T): void;
16
+ export interface PathMatchHit<T> {
17
+ value: T;
18
+ params: Record<string, string>;
19
+ }
20
+ export declare function findPath<T>(root: PathPatternNode<T>, path: string): PathMatchHit<T>[];
21
+ //# sourceMappingURL=path-trie.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-trie.d.ts","sourceRoot":"","sources":["../../../src/core/matching/path-trie.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,6DAA6D;IAC7D,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC;IACzD,mCAAmC;IACnC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,CAAC,KAAK,eAAe,CAAC,CAAC,CAAC,CAElD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CA2B1F;AAED,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC;IACT,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,CAKrF"}
@@ -0,0 +1,3 @@
1
+ export { createLogger, type StructuredLogger, type LoggerOptions, type LogLevel, type LogFields, } from "./logger.ts";
2
+ export { Metrics, type MetricsSnapshot } from "./metrics.ts";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/observability/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,SAAS,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,18 @@
1
+ export type LogLevel = "info" | "warn" | "error";
2
+ export interface LogFields {
3
+ event: string;
4
+ [k: string]: unknown;
5
+ }
6
+ export interface StructuredLogger {
7
+ info(fields: LogFields): void;
8
+ warn(fields: LogFields): void;
9
+ error(fields: LogFields): void;
10
+ }
11
+ export interface LoggerOptions {
12
+ /** When true (RT-12), timestamps become a monotonic counter and request-IDs are normalised. */
13
+ deterministic?: boolean;
14
+ stdout?: (line: string) => void;
15
+ stderr?: (line: string) => void;
16
+ }
17
+ export declare function createLogger(opts?: LoggerOptions): StructuredLogger;
18
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/core/observability/logger.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IAC9B,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,+FAA+F;IAC/F,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,wBAAgB,YAAY,CAAC,IAAI,GAAE,aAAkB,GAAG,gBAAgB,CA+BvE"}
@@ -0,0 +1,23 @@
1
+ export interface MetricsSnapshot {
2
+ /** Exposition format (Prometheus text). */
3
+ format(): string;
4
+ }
5
+ /**
6
+ * Atomic counters keyed by (metric, label-set). Increment is O(1) and
7
+ * allocates only on label-set first-use (config-load time, effectively).
8
+ * Latency histogram buckets are fixed at construction for allocation-free
9
+ * increment on the hot path.
10
+ */
11
+ export declare class Metrics implements MetricsSnapshot {
12
+ #private;
13
+ constructor(bucketsMicros?: readonly number[]);
14
+ incCounter(metric: string, labels: Record<string, string>): void;
15
+ /**
16
+ * Set a gauge value (RT-12). Idempotent — last write wins.
17
+ * Used for webhook_queue_depth (per-tenant) and webhook_circuit_state (per-tenant,webhook).
18
+ */
19
+ setGauge(metric: string, labels: Record<string, string>, value: number): void;
20
+ observeLatencyUs(metric: string, labels: Record<string, string>, value: number): void;
21
+ format(): string;
22
+ }
23
+ //# sourceMappingURL=metrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/core/observability/metrics.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,MAAM,IAAI,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,qBAAa,OAAQ,YAAW,eAAe;;gBAQjC,aAAa,GAAE,SAAS,MAAM,EAA0D;IAIpG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAKhE;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAK7E,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAyBrF,MAAM,IAAI,MAAM;CA4BjB"}
@@ -0,0 +1,18 @@
1
+ export declare const MIN_BUN_VERSION = "1.1.8";
2
+ export interface PreflightResult {
3
+ ok: boolean;
4
+ detected: string | null;
5
+ min: string;
6
+ warning?: string;
7
+ }
8
+ /** Compare two SemVer-ish strings (major.minor.patch, ignoring pre-release). */
9
+ export declare function compareVersion(a: string, b: string): number;
10
+ /**
11
+ * Check at startup that the Bun runtime meets the minimum supported version.
12
+ * Returns a result (does NOT exit) so callers control the response — library
13
+ * users may want to warn-and-continue; CLI users probably want to fail-hard.
14
+ *
15
+ * Pass `null` to simulate "not running on Bun" (used by tests + library embed).
16
+ */
17
+ export declare function preflight(bunVersion?: string | null | undefined): PreflightResult;
18
+ //# sourceMappingURL=preflight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/core/preflight.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,UAAU,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAO3D;AAMD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,UAAU,GAAE,MAAM,GAAG,IAAI,GAAG,SAA8B,GAAG,eAAe,CAmBrG"}
@@ -0,0 +1,52 @@
1
+ import type { ScenarioRuleT } from "../config/schema.ts";
2
+ import type { CompiledJsonValue, CompiledTemplate } from "../templating/compiler.ts";
3
+ type CompiledMatcher = {
4
+ kind: "exact";
5
+ value: string;
6
+ } | {
7
+ kind: "regex";
8
+ re: RegExp;
9
+ } | {
10
+ kind: "startsWith";
11
+ value: string;
12
+ } | {
13
+ kind: "contains";
14
+ value: string;
15
+ };
16
+ export interface CompiledScenarioPredicate {
17
+ params?: ReadonlyMap<string, CompiledMatcher>;
18
+ query?: ReadonlyMap<string, CompiledMatcher>;
19
+ headers?: ReadonlyMap<string, CompiledMatcher>;
20
+ body?: ReadonlyMap<string, CompiledMatcher>;
21
+ }
22
+ export interface CompiledScenarioResponse {
23
+ status?: number;
24
+ headers?: ReadonlyMap<string, CompiledTemplate>;
25
+ bodyTemplate?: CompiledTemplate | null;
26
+ bodyJson?: CompiledJsonValue | null;
27
+ delay?: ScenarioRuleT["response"]["delay"];
28
+ }
29
+ export interface CompiledScenario {
30
+ readonly id: string;
31
+ readonly predicate: CompiledScenarioPredicate;
32
+ readonly response: CompiledScenarioResponse;
33
+ }
34
+ export interface ScenarioAttrs {
35
+ readonly params: Record<string, string>;
36
+ readonly query: ReadonlyMap<string, string>;
37
+ readonly headers: ReadonlyMap<string, string>;
38
+ readonly body: unknown;
39
+ }
40
+ /** Compile all scenario rules for one mock entry. Called once per snapshot build. */
41
+ export declare function compileScenarioRules(rules: readonly ScenarioRuleT[]): readonly CompiledScenario[];
42
+ /**
43
+ * Evaluate scenario rules in declaration order (T2 first-match-wins).
44
+ * Returns the first matching scenario and the miss reason for the last
45
+ * attribute-absent miss (for O1 journal diagnostics).
46
+ */
47
+ export declare function evaluateScenarios(scenarios: readonly CompiledScenario[], attrs: ScenarioAttrs): {
48
+ match: CompiledScenario | null;
49
+ scenarioMissReason?: string;
50
+ };
51
+ export {};
52
+ //# sourceMappingURL=evaluator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../src/core/scenarios/evaluator.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAKrF,KAAK,eAAe,GAChB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,eAA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AE,gBAAgB,GAAG,IAAI,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAE,CAoBjE"}
@@ -0,0 +1,5 @@
1
+ export type { CompiledScenario, CompiledScenarioPredicate, CompiledScenarioResponse, ScenarioAttrs, } from "./evaluator.ts";
2
+ export { compileScenarioRules, evaluateScenarios } from "./evaluator.ts";
3
+ export type { ScenarioRenderInput, ScenarioRenderOpts } from "./merger.ts";
4
+ export { mergeStaticResponse, scenarioResponseForNonStatic, renderScenario } from "./merger.ts";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/scenarios/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,gBAAgB,EAChB,yBAAyB,EACzB,wBAAwB,EACxB,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACzE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,45 @@
1
+ import type { Context } from "hono";
2
+ import type { Entry } from "../config/schema.ts";
3
+ import type { CompiledResponse } from "../templating/compiler.ts";
4
+ import type { FakerInstance } from "../templating/faker.ts";
5
+ import type { Clock } from "../templating/tier2/now.ts";
6
+ import type { CompiledScenario } from "./evaluator.ts";
7
+ export interface ScenarioRenderInput {
8
+ status: number;
9
+ headers: ReadonlyMap<string, import("../templating/compiler.ts").CompiledTemplate>;
10
+ bodyTemplate: import("../templating/compiler.ts").CompiledTemplate | null;
11
+ bodyJson: import("../templating/compiler.ts").CompiledJsonValue | null;
12
+ delay?: number | {
13
+ min: number;
14
+ max: number;
15
+ };
16
+ }
17
+ export declare function mergeStaticResponse(defaultEntry: Entry & {
18
+ response: {
19
+ kind: "static";
20
+ status: number;
21
+ delay?: number | {
22
+ min: number;
23
+ max: number;
24
+ };
25
+ };
26
+ }, defaultCompiled: CompiledResponse, scenario: CompiledScenario): ScenarioRenderInput;
27
+ export declare function scenarioResponseForNonStatic(scenario: CompiledScenario): ScenarioRenderInput;
28
+ export interface ScenarioRenderOpts {
29
+ faker: FakerInstance;
30
+ clock: Clock;
31
+ deterministic: boolean;
32
+ tenant: string;
33
+ requestId: string;
34
+ entryId: string;
35
+ ctx: Context;
36
+ params: Record<string, string>;
37
+ body: unknown;
38
+ maxResponseBytes?: number;
39
+ }
40
+ /**
41
+ * Render a merged scenario response through the Tier 2 walker exactly once (T1).
42
+ * Type-preservation and token expansion behave identically to renderStatic.
43
+ */
44
+ export declare function renderScenario(merged: ScenarioRenderInput, opts: ScenarioRenderOpts): Promise<Response>;
45
+ //# sourceMappingURL=merger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merger.d.ts","sourceRoot":"","sources":["../../../src/core/scenarios/merger.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,2BAA2B,CAAC;AAEnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAA4B,MAAM,gBAAgB,CAAC;AAEjF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,2BAA2B,EAAE,gBAAgB,CAAC,CAAC;IACnF,YAAY,EAAE,OAAO,2BAA2B,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1E,QAAQ,EAAE,OAAO,2BAA2B,EAAE,iB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