brass-runtime 1.16.0 → 1.16.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.
Files changed (210) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +283 -18
  3. package/dist/agent/cli/main.cjs +38 -38
  4. package/dist/agent/cli/main.js +6 -6
  5. package/dist/agent/cli/main.mjs +6 -6
  6. package/dist/agent/index.cjs +7 -7
  7. package/dist/agent/index.d.ts +1 -1
  8. package/dist/agent/index.js +6 -6
  9. package/dist/agent/index.mjs +6 -6
  10. package/dist/chunk-2HQTDLHF.mjs +683 -0
  11. package/dist/chunk-36I3M4UC.mjs +370 -0
  12. package/dist/{chunk-QY5FKYEQ.js → chunk-3AYM6WPJ.js} +570 -51
  13. package/dist/chunk-3LOYJFRR.cjs +300 -0
  14. package/dist/chunk-3Y2RIUMM.js +300 -0
  15. package/dist/{chunk-N6VHMOWB.cjs → chunk-4ROBZFL6.cjs} +128 -128
  16. package/dist/{chunk-NC5SDRYE.js → chunk-52OB2ROS.js} +4 -4
  17. package/dist/{chunk-JX3LZQJH.cjs → chunk-52PPNNI4.cjs} +82 -20
  18. package/dist/{chunk-5YOQOXEQ.cjs → chunk-5EC274J5.cjs} +676 -293
  19. package/dist/chunk-5QC7LRZ3.js +229 -0
  20. package/dist/{chunk-7TL2LHQJ.js → chunk-5VRJNBLZ.mjs} +524 -141
  21. package/dist/chunk-62AZW6UT.cjs +313 -0
  22. package/dist/chunk-6IXXWIUM.js +683 -0
  23. package/dist/chunk-74ZTY6CP.js +2871 -0
  24. package/dist/chunk-76YMRMH2.cjs +777 -0
  25. package/dist/chunk-7CMJS3QE.mjs +2871 -0
  26. package/dist/{chunk-2WC63LJK.mjs → chunk-7JIJOVCT.js} +20 -10
  27. package/dist/{chunk-FM4W4QPL.js → chunk-A2OM6NEH.mjs} +5 -4
  28. package/dist/chunk-AGR5B2BC.cjs +683 -0
  29. package/dist/chunk-AVNQLJ5V.js +777 -0
  30. package/dist/chunk-B33ICAKP.js +313 -0
  31. package/dist/{chunk-J3H54ZRV.mjs → chunk-B5JD23U7.mjs} +1 -1
  32. package/dist/chunk-BABBZK4Y.js +2024 -0
  33. package/dist/{chunk-U5KWK3PX.mjs → chunk-C3MDXTRZ.js} +11 -0
  34. package/dist/{chunk-F5EUMJL7.mjs → chunk-CIZFIMK5.js} +55 -5
  35. package/dist/{chunk-SPUEME2B.cjs → chunk-CZIVE6NT.cjs} +12 -1
  36. package/dist/{chunk-TDVMADDN.js → chunk-DNFJLJMW.mjs} +11 -0
  37. package/dist/chunk-DNFO2EIZ.mjs +777 -0
  38. package/dist/{chunk-XDZOO4L5.js → chunk-EJ6BPYVR.mjs} +79 -17
  39. package/dist/{chunk-JNFRRJYH.cjs → chunk-ENKODRU3.cjs} +242 -192
  40. package/dist/chunk-EOC4UHBS.mjs +229 -0
  41. package/dist/{chunk-7LVI2GIN.js → chunk-FH2X7BVP.js} +507 -72
  42. package/dist/{chunk-OOGJ73B6.js → chunk-FHQGHPMO.mjs} +20 -10
  43. package/dist/{chunk-WQ5QNU5R.cjs → chunk-GLE2WY7Z.cjs} +652 -217
  44. package/dist/{chunk-G6IQOE4P.mjs → chunk-GYM3LLGS.mjs} +507 -72
  45. package/dist/chunk-HLWLMW2F.mjs +2024 -0
  46. package/dist/{chunk-TVN5I4U6.cjs → chunk-JF5WGYJJ.cjs} +25 -24
  47. package/dist/{chunk-CY33PGEX.mjs → chunk-KH4SYAOS.mjs} +570 -51
  48. package/dist/chunk-KN32XNTH.mjs +313 -0
  49. package/dist/chunk-KQLYONSE.cjs +2871 -0
  50. package/dist/{chunk-7HUOJA4W.cjs → chunk-KZJQ723N.cjs} +90 -80
  51. package/dist/{chunk-CCKHV5BT.mjs → chunk-L2SYFEBS.js} +5 -4
  52. package/dist/{chunk-IJT6RRQ5.cjs → chunk-L6VB5N7Q.cjs} +20 -9
  53. package/dist/{chunk-ZGLD4TVZ.mjs → chunk-MBEJI5HF.mjs} +4 -4
  54. package/dist/{chunk-PRWCB3QL.mjs → chunk-MIIYDLGM.js} +524 -141
  55. package/dist/{chunk-H55LI6WY.js → chunk-MOO4L7F4.mjs} +15 -4
  56. package/dist/{chunk-7XOPAB5Q.js → chunk-MT3OWDPC.mjs} +55 -5
  57. package/dist/chunk-MVGUEJ5Z.cjs +370 -0
  58. package/dist/chunk-PD4EJTQC.cjs +229 -0
  59. package/dist/chunk-PWC3RBQE.mjs +300 -0
  60. package/dist/{chunk-MWXMNYJS.cjs → chunk-Q2I37RP3.cjs} +643 -124
  61. package/dist/{chunk-VFIUZG7J.mjs → chunk-RKGKFN2A.js} +79 -17
  62. package/dist/{chunk-NYL4D7SK.cjs → chunk-SA6HUJVI.cjs} +5 -5
  63. package/dist/{chunk-K2T3DV26.mjs → chunk-TRM4JUZQ.js} +15 -4
  64. package/dist/chunk-UB4B6OFY.js +370 -0
  65. package/dist/{chunk-G3XGCZDQ.js → chunk-UCUBNWM2.js} +1 -1
  66. package/dist/chunk-VN44DYYT.cjs +2024 -0
  67. package/dist/{client-CtFmoDvM.d.ts → client-CZHU674n.d.ts} +211 -36
  68. package/dist/core/index.cjs +135 -9
  69. package/dist/core/index.d.ts +238 -33
  70. package/dist/core/index.js +155 -29
  71. package/dist/core/index.mjs +155 -29
  72. package/dist/{effect-CGNl5Rqp.d.ts → effect-DIUHZ9IN.d.ts} +89 -1
  73. package/dist/effectRunner-CFLC32IK.cjs +8 -0
  74. package/dist/{effectRunner-A4CHJXJI.js → effectRunner-L4S7IPT3.js} +2 -2
  75. package/dist/{effectRunner-OPUF6QRN.mjs → effectRunner-NNGG75QA.mjs} +2 -2
  76. package/dist/http/index.cjs +324 -2986
  77. package/dist/http/index.d.ts +54 -68
  78. package/dist/http/index.js +238 -2900
  79. package/dist/http/index.mjs +238 -2900
  80. package/dist/http/testing.cjs +14 -12
  81. package/dist/http/testing.d.ts +5 -4
  82. package/dist/http/testing.js +10 -8
  83. package/dist/http/testing.mjs +10 -8
  84. package/dist/index.cjs +423 -255
  85. package/dist/index.d.ts +87 -69
  86. package/dist/index.js +301 -133
  87. package/dist/index.mjs +301 -133
  88. package/dist/observability/index.cjs +16 -531
  89. package/dist/observability/index.d.ts +81 -8
  90. package/dist/observability/index.js +23 -538
  91. package/dist/observability/index.mjs +23 -538
  92. package/dist/perf/cli.cjs +401 -0
  93. package/dist/perf/cli.d.ts +1 -0
  94. package/dist/perf/cli.js +401 -0
  95. package/dist/perf/cli.mjs +401 -0
  96. package/dist/perf/index.cjs +141 -0
  97. package/dist/perf/index.d.ts +483 -0
  98. package/dist/perf/index.js +141 -0
  99. package/dist/perf/index.mjs +141 -0
  100. package/dist/schedule-CK3Ml_7p.d.ts +259 -0
  101. package/dist/schema/index.cjs +6 -2
  102. package/dist/schema/index.d.ts +3 -1
  103. package/dist/schema/index.js +5 -1
  104. package/dist/schema/index.mjs +5 -1
  105. package/dist/{server-C8hDXA74.d.ts → server-GJPg8ZSG.d.ts} +4 -3
  106. package/dist/{stream-dvSs0QS5.d.ts → stream-B4oK9JFP.d.ts} +1 -1
  107. package/dist/{tracer-B5tRH9H7.d.ts → tracer-Hwt1cl7h.d.ts} +13 -54
  108. package/dist/{tracing-Dt9S_6V8.d.ts → tracing-DqbTKGcf.d.ts} +1 -1
  109. package/docs/ARCHITECTURE.md +292 -0
  110. package/docs/README.md +63 -0
  111. package/docs/adr/0001-ai-context-pack.md +32 -0
  112. package/docs/agent-apply-mode.md +104 -0
  113. package/docs/agent-approvals.md +110 -0
  114. package/docs/agent-batch.md +185 -0
  115. package/docs/agent-boundaries.md +112 -0
  116. package/docs/agent-chat-sessions.md +160 -0
  117. package/docs/agent-ci.md +17 -0
  118. package/docs/agent-cli.md +405 -0
  119. package/docs/agent-config.md +480 -0
  120. package/docs/agent-context-discovery.md +159 -0
  121. package/docs/agent-copilot-like-dx.md +126 -0
  122. package/docs/agent-declarative-optimized-planning.md +138 -0
  123. package/docs/agent-dx.md +224 -0
  124. package/docs/agent-env-files.md +126 -0
  125. package/docs/agent-follow-up-context.md +43 -0
  126. package/docs/agent-global-usage.md +180 -0
  127. package/docs/agent-init.md +109 -0
  128. package/docs/agent-install-and-configure.md +516 -0
  129. package/docs/agent-language-workspace-ux.md +99 -0
  130. package/docs/agent-llm-adapters.md +123 -0
  131. package/docs/agent-local-install.md +190 -0
  132. package/docs/agent-local-tests.md +51 -0
  133. package/docs/agent-observability.md +155 -0
  134. package/docs/agent-patch-quality-loop.md +162 -0
  135. package/docs/agent-presets.md +22 -0
  136. package/docs/agent-project-commands.md +237 -0
  137. package/docs/agent-project-intelligence.md +156 -0
  138. package/docs/agent-redaction.md +18 -0
  139. package/docs/agent-release-readiness.md +76 -0
  140. package/docs/agent-rollback-safety.md +162 -0
  141. package/docs/agent-rollback.md +23 -0
  142. package/docs/agent-run-artifacts.md +16 -0
  143. package/docs/agent-vscode-auto-discovery.md +137 -0
  144. package/docs/agent-vscode-batch-runner.md +100 -0
  145. package/docs/agent-vscode-chat-layout.md +90 -0
  146. package/docs/agent-vscode-clean-install.md +147 -0
  147. package/docs/agent-vscode-code-actions.md +70 -0
  148. package/docs/agent-vscode-diff-preview.md +45 -0
  149. package/docs/agent-vscode-inline-assist.md +56 -0
  150. package/docs/agent-vscode-install.md +186 -0
  151. package/docs/agent-vscode-model-setup.md +97 -0
  152. package/docs/agent-vscode-patch-preview.md +92 -0
  153. package/docs/agent-vscode-problems.md +79 -0
  154. package/docs/agent-vscode-project-dashboard.md +106 -0
  155. package/docs/agent-vscode-run-history.md +92 -0
  156. package/docs/agent-vscode-ux.md +73 -0
  157. package/docs/ai/INVARIANTS.md +84 -0
  158. package/docs/ai/PROJECT_MAP.md +338 -0
  159. package/docs/ai/PUBLIC_API.md +336 -0
  160. package/docs/ai/VALIDATION_MATRIX.md +67 -0
  161. package/docs/api-polish.md +37 -0
  162. package/docs/cancellation.md +162 -0
  163. package/docs/coverage.md +46 -0
  164. package/docs/getting-started.md +159 -0
  165. package/docs/guides/README.md +40 -0
  166. package/docs/guides/circuit-breaker.md +89 -0
  167. package/docs/guides/error-handling.md +91 -0
  168. package/docs/guides/getting-started.md +107 -0
  169. package/docs/guides/layers.md +189 -0
  170. package/docs/guides/metrics.md +101 -0
  171. package/docs/guides/resource-management.md +141 -0
  172. package/docs/guides/retry.md +215 -0
  173. package/docs/guides/semaphore.md +66 -0
  174. package/docs/guides/streams.md +117 -0
  175. package/docs/guides/supervisors.md +98 -0
  176. package/docs/guides/testing.md +162 -0
  177. package/docs/guides/tracing.md +71 -0
  178. package/docs/http-recipes.md +399 -0
  179. package/docs/http.md +749 -0
  180. package/docs/modules.md +285 -0
  181. package/docs/observability-collector-smoke.md +31 -0
  182. package/docs/observability-framework-examples.md +98 -0
  183. package/docs/observability.md +542 -0
  184. package/docs/otel-collector-smoke.yaml +27 -0
  185. package/docs/performance-profiler.md +199 -0
  186. package/docs/production-readiness.md +73 -0
  187. package/docs/recipes/README.md +12 -0
  188. package/docs/recipes/http-server.md +45 -0
  189. package/docs/recipes/layers.md +44 -0
  190. package/docs/recipes/performance.md +47 -0
  191. package/docs/recipes/runtime.md +41 -0
  192. package/docs/recipes/testing.md +41 -0
  193. package/docs/release.md +53 -0
  194. package/docs/wasm-bounded-queues.md +44 -0
  195. package/docs/wasm-engine-observability-benchmarks.md +85 -0
  196. package/docs/wasm-fiber-engine.md +117 -0
  197. package/docs/wasm-scheduler-state-machine.md +122 -0
  198. package/docs/wasm-stream-chunks.md +54 -0
  199. package/package.json +22 -2
  200. package/dist/chunk-45F7OKGT.cjs +0 -104
  201. package/dist/chunk-7V4KY4RL.mjs +0 -104
  202. package/dist/chunk-DJQ7OMMB.cjs +0 -144
  203. package/dist/chunk-GOV47PPB.mjs +0 -552
  204. package/dist/chunk-JF4XXPZ5.cjs +0 -552
  205. package/dist/chunk-KCPT2D6G.js +0 -552
  206. package/dist/chunk-NOYZIMUJ.mjs +0 -144
  207. package/dist/chunk-PNVFW245.js +0 -144
  208. package/dist/chunk-ROJC3NBJ.js +0 -104
  209. package/dist/effectRunner-3ZHAD3LE.cjs +0 -8
  210. package/dist/schedule-Fque9Abz.d.ts +0 -70
@@ -1,15 +1,15 @@
1
- import { e as HttpClientFn, c as HttpError, b as HttpWireResponse, a as HttpRequest, d as HttpMiddleware, R as RetryPolicy, H as HttpClient, M as MakeHttpConfig, f as HttpWireResponseStream, g as HttpClientStream, h as HttpClientStats, i as AdaptiveLimiter, j as AdaptiveLimiterConfig, k as HttpMethod, l as AdaptiveLimiterPreset, m as HttpPoolConfig } from '../client-CtFmoDvM.js';
2
- export { n as AdaptiveAcquireOptions, o as AdaptiveBaselineStrategy, p as AdaptiveHeadroomContext, q as AdaptiveHeadroomMode, r as AdaptiveHeadroomStrategy, s as AdaptiveLease, t as AdaptiveLimiterDiagnostics, u as AdaptiveLimiterKeySnapshot, A as AdaptiveLimiterStats, v as AdaptiveQueueLoadShedding, w as AdaptiveQueueStrategy, x as AdaptiveReleaseInfo, y as HttpBody, z as HttpClientStreamFn, B as HttpConcurrencyPool, C as HttpInit, D as HttpPoolKeyResolver, E as HttpPoolKeyStats, F as HttpPoolLease, G as HttpPoolStats, L as LimitChangeEvent, P as PerRequestRetryOverride, I as ResolvedConfig, J as RetryEvent, K as RetryScheduleInput, N as adaptiveLimiterPresets, O as backoffDelayMs, Q as decorate, S as defaultRetryOnError, T as defaultRetryOnStatus, U as defaultRetryableMethods, V as makeAdaptiveLimiterConfig, W as makeHttp, X as makeHttpStream, Y as normalizeHeadersInit, Z as normalizeRetryBudget, _ as resolveConfig, $ as resolveHttpPoolKey, a0 as retryAfterMs, a1 as validateConfig, a2 as withMiddleware, a3 as withRetry, a4 as withRetryStream } from '../client-CtFmoDvM.js';
3
- import { A as Async, C as AsyncWithPromise, f as Runtime, h as RuntimeOptions } from '../effect-CGNl5Rqp.js';
4
- import { SchemaIssue, JsonSchemaLike, AnyJsonSchemaLike, InferJsonSchema } from '../schema/index.js';
5
- export { AnySchema, ConfigValidationError, InferObject, InferSchema, JsonValidator, JsonValidatorResult, NumberSchemaOptions, ObjectSchemaOptions, Schema, SchemaPathPart, SchemaResult, SchemaShape, SchemaValidationException, StringSchemaOptions, formatIssues, isSchema, makeSchemaIssue, parseConfig, s, schema, validateValue } from '../schema/index.js';
6
- import { g as CircuitBreakerConfig, h as CircuitBreakerError } from '../tracer-B5tRH9H7.js';
7
- import { T as Tracer, R as Resource } from '../tracing-Dt9S_6V8.js';
1
+ import { e as HttpRequestPolicyRef, f as HttpRequestRetryOverride, a as HttpRequest, c as HttpError, b as HttpWireResponse, V as ValidationError, d as HttpMiddleware, R as RetryPolicy, H as HttpClient, M as MakeHttpConfig, g as HttpWireResponseStream, h as HttpClientStream, i as HttpClientStats, j as AdaptiveLimiter, k as HttpClientFn, l as AdaptiveLimiterConfig, m as HttpMethod, n as HttpPolicyPresets, o as HttpTransport, p as AdaptiveLimiterPreset, q as HttpPoolConfig } from '../client-CZHU674n.js';
2
+ export { r as AdaptiveAcquireOptions, s as AdaptiveBaselineStrategy, t as AdaptiveHeadroomContext, u as AdaptiveHeadroomMode, v as AdaptiveHeadroomStrategy, w as AdaptiveLease, x as AdaptiveLimiterDiagnostics, y as AdaptiveLimiterKeySnapshot, A as AdaptiveLimiterStats, z as AdaptiveQueueLoadShedding, B as AdaptiveQueueStrategy, C as AdaptiveReleaseInfo, D as HttpBody, E as HttpClientStreamFn, F as HttpConcurrencyPool, G as HttpErrorHandlers, I as HttpInit, J as HttpPolicyPreset, K as HttpPoolKeyResolver, L as HttpPoolKeyStats, N as HttpPoolLease, O as HttpPoolStats, P as HttpRequestPolicy, Q as HttpRetryScheduleInput, S as HttpStreamTransport, T as HttpTransportContext, U as HttpTransportTiming, W as JsonDecodeResult, X as KnownHttpError, Y as KnownHttpErrorTag, Z as LimitChangeEvent, _ as PerRequestRetryOverride, $ as PromiseHttpTransportBodyBuilder, a0 as PromiseHttpTransportBodySelector, a1 as PromiseHttpTransportConfig, a2 as PromiseHttpTransportConfigWithSignal, a3 as PromiseHttpTransportFluentResponseBuilder, a4 as PromiseHttpTransportRequestConfigBuilder, a5 as PromiseHttpTransportRequestConfigContext, a6 as PromiseHttpTransportRequestConfigMapper, a7 as PromiseHttpTransportResponse, a8 as PromiseHttpTransportResponseInfo, a9 as PromiseHttpTransportResponseInfoMapper, aa as PromiseHttpTransportStartBuilder, ab as ResolveHttpRequestPolicyOptions, ac as ResolvedConfig, ad as RetryEvent, ae as RetryScheduleInput, af as RetryableHttpErrorOptions, ag as ToHttpErrorOptions, ah as abortErrorForSignal, ai as adaptiveLimiterPresets, aj as backoffDelayMs, ak as decodeJsonBody, al as decodeJsonBodyEffect, am as decorate, an as defaultRetryOnError, ao as defaultRetryOnStatus, ap as defaultRetryableMethods, aq as defineHttpPolicyPresets, ar as encodeJsonBodyEffect, as as formatHttpError, at as getHttpRequestPolicy, au as headersOf, av as httpErrorStatus, aw as httpPolicy, ax as isAbortError, ay as isAbortHttpError, az as isCircuitBreakerOpen, aA as isExternalAbortError, aB as isExternalTimeoutError, aC as isFetchHttpError, aD as isHttpError, aE as isKnownHttpError, aF as isRetryableHttpError, aG as isRetryableHttpStatus, aH as isTaggedHttpError, aI as isTimeoutHttpError, aJ as isValidationError, aK as linkAbortSignals, aL as makeAdaptiveLimiterConfig, aM as makeFetchStreamTransport, aN as makeFetchTransport, aO as makeHttp, aP as makeHttpStream, aQ as makePromiseHttpTransport, aR as matchHttpError, aS as normalizeHeadersInit, aT as normalizeHttpError, aU as normalizeHttpHeaders, aV as normalizeRetryBudget, aW as promiseHttpTransport, aX as resolveConfig, aY as resolveHttpPoolKey, aZ as resolveHttpRequestPolicyPresets, a_ as retryAfterMs, a$ as toHttpError, b0 as validateConfig, b1 as validatedJson, b2 as validatedJsonResponse, b3 as withHttpPolicyPresets, b4 as withHttpRequestPolicy, b5 as withMiddleware, b6 as withRetry, b7 as withRetryStream } from '../client-CZHU674n.js';
3
+ import { C as AsyncWithPromise, A as Async, f as Runtime, h as RuntimeOptions } from '../effect-DIUHZ9IN.js';
4
+ import { AnyJsonSchemaLike, InferJsonSchema } from '../schema/index.js';
5
+ export { AnySchema, ConfigValidationError, InferObject, InferSchema, JsonSchemaLike, JsonValidator, JsonValidatorResult, NumberSchemaOptions, ObjectSchemaOptions, Schema, SchemaIssue, SchemaPathPart, SchemaResult, SchemaShape, SchemaValidationException, StringSchemaOptions, formatConfigError, formatIssues, isConfigValidationError, isSchema, makeSchemaIssue, parseConfig, s, schema, validateValue } from '../schema/index.js';
6
+ import { d as CircuitBreakerConfig, S as Schedule } from '../schedule-CK3Ml_7p.js';
7
+ import { T as Tracer, R as Resource } from '../tracing-DqbTKGcf.js';
8
8
  import { Server } from 'node:http';
9
9
  import { AddressInfo } from 'node:net';
10
- import { S as Schedule } from '../schedule-Fque9Abz.js';
11
- import { O as Observability, p as HttpServerObservabilityOptions, Z as RuntimeHealthOptions } from '../server-C8hDXA74.js';
12
- import '../stream-dvSs0QS5.js';
10
+ import { O as Observability, p as HttpServerObservabilityOptions, Z as RuntimeHealthOptions } from '../server-GJPg8ZSG.js';
11
+ import '../stream-B4oK9JFP.js';
12
+ import '../tracer-Hwt1cl7h.js';
13
13
 
14
14
  /**
15
15
  * A fixed-size circular buffer that stores latency samples and supports
@@ -104,36 +104,15 @@ declare function computeNewLimit(currentLimit: number, gradient: number, headroo
104
104
  readonly maxDecreaseRatio?: number;
105
105
  }): number;
106
106
 
107
- type ValidationError = {
108
- readonly _tag: "ValidationError";
109
- readonly message: string;
110
- readonly body: string;
111
- readonly issues: readonly SchemaIssue[];
112
- readonly phase?: "request" | "response";
113
- readonly schema?: string;
114
- };
115
- type JsonDecodeResult<A> = {
116
- readonly success: true;
117
- readonly data: A;
118
- } | {
119
- readonly success: false;
120
- readonly error: ValidationError;
107
+ type HttpRequestPolicyInit = {
108
+ readonly policy?: HttpRequestPolicyRef;
109
+ readonly lane?: string;
110
+ readonly dedupKey?: string;
111
+ readonly priority?: number;
112
+ readonly retry?: HttpRequestRetryOverride;
121
113
  };
122
- declare function decodeJsonBody<A = unknown>(bodyText: string, validator?: JsonSchemaLike<A>, options?: {
123
- readonly schemaName?: string;
124
- }): JsonDecodeResult<A>;
125
- declare function encodeJsonBodyEffect(bodyObj: unknown, validator?: JsonSchemaLike<any>, options?: {
126
- readonly schemaName?: string;
127
- }): Async<unknown, ValidationError, string>;
128
- declare function decodeJsonBodyEffect<A = unknown>(bodyText: string, validator?: JsonSchemaLike<A>, options?: {
129
- readonly schemaName?: string;
130
- }): Async<unknown, ValidationError, A>;
131
- declare function validatedJson<A>(client: HttpClientFn, validator: JsonSchemaLike<A>): (req: Parameters<HttpClientFn>[0]) => Async<unknown, HttpError | ValidationError, A>;
132
- declare function validatedJsonResponse<A>(client: HttpClientFn, validator: JsonSchemaLike<A>): (req: Parameters<HttpClientFn>[0]) => Async<unknown, HttpError | ValidationError, HttpWireResponse & {
133
- readonly body: A;
134
- }>;
135
114
 
136
- type InitNoMethodBody$1 = Omit<RequestInit, "method" | "body"> & {
115
+ type InitNoMethodBody$1 = Omit<RequestInit, "method" | "body"> & HttpRequestPolicyInit & {
137
116
  timeoutMs?: number;
138
117
  poolKey?: string;
139
118
  headers?: any;
@@ -195,7 +174,7 @@ type HttpResponseWithMeta<A> = {
195
174
  response: HttpResponse<A>;
196
175
  meta: HttpMeta;
197
176
  };
198
- type AnyInitWithHeaders = {
177
+ type AnyInitWithHeaders = HttpRequestPolicyInit & {
199
178
  headers?: any;
200
179
  timeoutMs?: number;
201
180
  poolKey?: string;
@@ -223,15 +202,15 @@ type Dx = {
223
202
  declare function httpClient(cfg?: MakeHttpConfig): Dx;
224
203
  declare function httpClientWithMeta(cfg?: MakeHttpConfig): {
225
204
  request: (req: HttpRequest) => AsyncWithPromise<unknown, HttpError, {
226
- wire: HttpWireResponse;
205
+ wire: HttpWireResponse<unknown>;
227
206
  meta: HttpMeta;
228
207
  }>;
229
208
  get: (url: string, init?: InitNoMethodBody$1) => AsyncWithPromise<unknown, HttpError, {
230
- wire: HttpWireResponse;
209
+ wire: HttpWireResponse<unknown>;
231
210
  meta: HttpMeta;
232
211
  }>;
233
212
  getText: (url: string, init?: InitNoMethodBody$1) => AsyncWithPromise<unknown, HttpError, {
234
- wire: HttpWireResponse;
213
+ wire: HttpWireResponse<unknown>;
235
214
  response: {
236
215
  status: number;
237
216
  statusText: string;
@@ -241,12 +220,12 @@ declare function httpClientWithMeta(cfg?: MakeHttpConfig): {
241
220
  meta: HttpMeta;
242
221
  }>;
243
222
  getJson: <A>(url: string, init?: AnyJsonInit) => AsyncWithPromise<unknown, HttpError | ValidationError, {
244
- wire: HttpWireResponse;
223
+ wire: HttpWireResponse<unknown>;
245
224
  response: HttpResponse<A>;
246
225
  meta: HttpMeta;
247
226
  }>;
248
227
  post: (url: string, body?: string, init?: InitNoMethodBody$1) => AsyncWithPromise<unknown, HttpError, {
249
- wire: HttpWireResponse;
228
+ wire: HttpWireResponse<unknown>;
250
229
  meta: HttpMeta;
251
230
  }>;
252
231
  postJson: <A>(url: string, bodyObj: unknown, init?: AnyInitWithHeaders & {
@@ -255,15 +234,15 @@ declare function httpClientWithMeta(cfg?: MakeHttpConfig): {
255
234
  bodySchema?: AnyJsonSchemaLike;
256
235
  bodySchemaName?: string;
257
236
  }) => AsyncWithPromise<unknown, HttpError | ValidationError, {
258
- wire: HttpWireResponse;
237
+ wire: HttpWireResponse<unknown>;
259
238
  response: HttpResponse<A>;
260
239
  meta: HttpMeta;
261
240
  }>;
262
241
  };
263
242
  declare function httpClientStream(cfg?: MakeHttpConfig): {
264
- request: (req: HttpRequest) => AsyncWithPromise<unknown, HttpError, HttpWireResponseStream>;
265
- getStream: (url: string, init?: InitNoMethodBody$1) => AsyncWithPromise<unknown, HttpError, HttpWireResponseStream>;
266
- get: (url: string, init?: InitNoMethodBody$1) => AsyncWithPromise<unknown, HttpError, HttpWireResponseStream>;
243
+ request: (req: HttpRequest) => AsyncWithPromise<unknown, HttpError, HttpWireResponseStream<unknown>>;
244
+ getStream: (url: string, init?: InitNoMethodBody$1) => AsyncWithPromise<unknown, HttpError, HttpWireResponseStream<unknown>>;
245
+ get: (url: string, init?: InitNoMethodBody$1) => AsyncWithPromise<unknown, HttpError, HttpWireResponseStream<unknown>>;
267
246
  with: (mw: (n: HttpClientStream) => HttpClientStream) => /*elided*/ any;
268
247
  withRetry: (p: RetryPolicy) => /*elided*/ any;
269
248
  wire: HttpClientStream;
@@ -289,22 +268,6 @@ declare function withCircuitBreaker(config?: HttpCircuitBreakerConfig): HttpMidd
289
268
  */
290
269
  declare function withTracing(tracer: Tracer): HttpMiddleware;
291
270
 
292
- type KnownHttpError = HttpError | ValidationError | CircuitBreakerError;
293
- type KnownHttpErrorTag = KnownHttpError["_tag"];
294
- type HttpErrorHandlers<R> = {
295
- readonly [K in KnownHttpErrorTag]?: (error: Extract<KnownHttpError, {
296
- readonly _tag: K;
297
- }>) => R;
298
- } & {
299
- readonly default?: (error: unknown) => R;
300
- };
301
- declare function isHttpError(error: unknown): error is HttpError;
302
- declare function isValidationError(error: unknown): error is ValidationError;
303
- declare function isCircuitBreakerOpen(error: unknown): error is CircuitBreakerError;
304
- declare function isKnownHttpError(error: unknown): error is KnownHttpError;
305
- declare function matchHttpError<R>(error: unknown, handlers: HttpErrorHandlers<R>): R | undefined;
306
- declare function formatHttpError(error: unknown): string;
307
-
308
271
  /**
309
272
  * Developer-provided function that defines how to combine multiple requests
310
273
  * into one and split the response back.
@@ -2118,12 +2081,12 @@ type InitNoMethodBody = Omit<RequestInit, "method" | "body"> & {
2118
2081
  timeoutMs?: number;
2119
2082
  poolKey?: string;
2120
2083
  headers?: unknown;
2121
- };
2084
+ } & HttpRequestPolicyInit;
2122
2085
  type InitWithHeaders = {
2123
2086
  headers?: unknown;
2124
2087
  timeoutMs?: number;
2125
2088
  poolKey?: string;
2126
- } & Record<string, unknown>;
2089
+ } & HttpRequestPolicyInit & Record<string, unknown>;
2127
2090
  type HttpJsonInit<Validator extends AnyJsonSchemaLike> = InitNoMethodBody & {
2128
2091
  readonly schema: Validator;
2129
2092
  readonly schemaName?: string;
@@ -2166,7 +2129,7 @@ type DefaultPostJson = {
2166
2129
  <Validator extends AnyJsonSchemaLike>(url: string, bodyObj: unknown, init: HttpPostJsonInit<Validator>): AsyncWithPromise<unknown, HttpError | ValidationError, HttpResponse<InferJsonSchema<Validator>>>;
2167
2130
  <A = unknown>(url: string, bodyObj: unknown, init?: PostJsonInitNoSchema): AsyncWithPromise<unknown, HttpError | ValidationError, HttpResponse<A>>;
2168
2131
  };
2169
- type DefaultHttpClientPreset = "minimal" | "balanced" | "default";
2132
+ type DefaultHttpClientPreset = "minimal" | "balanced" | "default" | "production";
2170
2133
  type DefaultHttpClientFeatures = {
2171
2134
  readonly dedup: boolean;
2172
2135
  readonly batch: boolean;
@@ -2184,12 +2147,18 @@ type DefaultHttpClientConfig = LifecycleClientConfig & {
2184
2147
  * - minimal: wire client + timeout only.
2185
2148
  * - balanced: retry, priority, dedup, adaptive limiter, response compression.
2186
2149
  * - default: balanced + short safe-method response cache.
2150
+ * - production: stable alias for the full production-ready default preset.
2187
2151
  */
2188
2152
  readonly preset?: DefaultHttpClientPreset;
2189
2153
  /** Response decompression. Enabled by balanced/default presets; set false to disable. */
2190
2154
  readonly compression?: CompressionConfig | false;
2191
2155
  /** Extra middleware applied outermost after the preset stack, e.g. withHttpObservability(obs). */
2192
2156
  readonly middleware?: readonly HttpMiddleware[];
2157
+ /**
2158
+ * Named per-request policy presets. Requests can use `policy: "readModel"` or
2159
+ * `policy: { preset: "readModel", ...overrides }`.
2160
+ */
2161
+ readonly policyPresets?: HttpPolicyPresets;
2193
2162
  };
2194
2163
  type DefaultHttpClient = {
2195
2164
  readonly request: (req: HttpRequest) => AsyncWithPromise<unknown, HttpError, HttpWireResponse>;
@@ -2227,10 +2196,12 @@ type HttpClientBuilder = {
2227
2196
  readonly headers: (headers: Record<string, string>) => HttpClientBuilder;
2228
2197
  readonly timeoutMs: (timeoutMs: number) => HttpClientBuilder;
2229
2198
  readonly timeout: (timeoutMs: number) => HttpClientBuilder;
2199
+ readonly transport: (transport: HttpTransport) => HttpClientBuilder;
2230
2200
  readonly preset: (preset: DefaultHttpClientPreset) => HttpClientBuilder;
2231
2201
  readonly minimal: () => HttpClientBuilder;
2232
2202
  readonly balanced: () => HttpClientBuilder;
2233
2203
  readonly defaultPreset: () => HttpClientBuilder;
2204
+ readonly production: () => HttpClientBuilder;
2234
2205
  readonly dedup: (config?: DedupConfig$1 | false) => HttpClientBuilder;
2235
2206
  readonly noDedup: () => HttpClientBuilder;
2236
2207
  readonly batch: (config: BatchConfig | false) => HttpClientBuilder;
@@ -2393,5 +2364,20 @@ declare function makeNodeHttpServer<R extends object = {}>(options: NodeHttpServ
2393
2364
  declare function nodeHttpServerResource<R extends object = {}>(options: NodeHttpServerOptions<R>): Resource<unknown, NodeHttpServerError, NodeHttpServerHandle>;
2394
2365
  declare const makeNodeHttpServerResource: typeof nodeHttpServerResource;
2395
2366
  declare const makeHttpServerResource: typeof nodeHttpServerResource;
2367
+ declare const HttpServer: Readonly<{
2368
+ route: typeof route;
2369
+ httpRoute: typeof route;
2370
+ router: typeof makeHttpRouter;
2371
+ listen: typeof makeNodeHttpServer;
2372
+ resource: typeof nodeHttpServerResource;
2373
+ json: typeof json;
2374
+ text: typeof text;
2375
+ empty: typeof empty;
2376
+ healthRoute: typeof makeRuntimeHealthRoute;
2377
+ readinessRoute: typeof makeRuntimeReadinessRoute;
2378
+ middleware: Readonly<{
2379
+ header: typeof withResponseHeader;
2380
+ }>;
2381
+ }>;
2396
2382
 
2397
- export { AdaptiveLimiter, AdaptiveLimiterConfig, AdaptiveLimiterPreset, AnyJsonSchemaLike, type BatchConfig, type BatchFunction, type BudgetSemaphore, type CacheConfig$1 as CacheConfig, type CacheKeyComponents, type CachePolicyResult$1 as CachePolicyResult, type CompressionConfig, type CompressionMiddlewareResult, type CompressionStats, type ConnectionPrewarmAttempt, type ConnectionPrewarmConfig, type ConnectionPrewarmEvent, type ConnectionPrewarmResult, type ConnectionPrewarmingMiddlewareConfig, type ConnectionStateMap, DEFAULT_CACHE_RELEVANT_HEADERS, type DecompressResult, type Decompressor, type DedupConfig$1 as DedupConfig, type DefaultGetJson, type DefaultHttpClient, type DefaultHttpClientConfig, type DefaultHttpClientFeatures, type DefaultHttpClientPreset, type DefaultPostJson, type Dx, EmaComputer, type HttpCircuitBreakerConfig, HttpClient, type HttpClientBuilder, HttpClientFn, HttpClientStats, HttpClientStream, HttpError, type HttpErrorHandlers, type HttpJsonInit, type HttpMeta, HttpMethod, HttpMiddleware, HttpPoolConfig, type HttpPostJsonBodyInit, type HttpPostJsonInit, type HttpPostJsonSchemaBodyInit, HttpRequest, type HttpResponse, type HttpResponseWithMeta, type HttpRouteMatch, type HttpRouteOptions, type HttpRouteSchemas, type HttpRouter, type HttpRouterOptions, type HttpRuntimeHealthRouteOptions, type HttpServerBody, type HttpServerContext, type HttpServerHandler, type HttpServerHeaders, type HttpServerMethod, type HttpServerMiddleware, type HttpServerParams, type HttpServerQuery, type HttpServerRequest, type HttpServerResponse, type HttpServerRoute, HttpWireResponse, HttpWireResponseStream, type HttpWireWithMeta, InferJsonSchema, type InferServerPart, type JsonDecodeResult, JsonSchemaLike, type KnownHttpError, type KnownHttpErrorTag, LRUCache, type LRUCacheConfig, LatencyWindow, type LifecycleClient, type LifecycleClientConfig, type LifecycleEvent, type LifecycleEventType, type LifecycleRequestOptions, type LifecycleStats, LifecycleStatsTracker, type LogEvent, MakeHttpConfig, type NodeHttpServerError, type NodeHttpServerHandle, type NodeHttpServerOptions, type NodeHttpServerShutdownState, type PrewarmConfig, type PrewarmEvent, type PrewarmEventType, type PrewarmLifecycleConfig, type PrewarmManager, type PrewarmOriginState, type PrewarmOriginStatus, type PrewarmResult, type PrewarmResultStatus, type PrewarmStatusSnapshot, type PriorityConfig$1 as PriorityConfig, PriorityQueue, type PriorityQueueEntry, type ProbeOutcome, type RequestBatchingConfig, type RequestBatchingEvent, type RequestCompressionConfig, type RequestCompressionMiddlewareResult, type RequestCompressionStats, RetryPolicy, type RoutePathParamNames, type RoutePathParams, SEPARATOR, SUPPORTED_ENCODINGS, SchemaIssue, type SupportedEncoding, type ValidationError, clampPriority, computeCacheKey, computeGradient, computeNewLimit, decodeJsonBody, decodeJsonBodyEffect, defaultHttpClientPreset, detectPlatform, empty, encodeJsonBodyEffect, executeProbe, formatHttpError, httpBuilder, httpClient, httpClientBuilder, httpClientStream, httpClientWithMeta, httpRoute, isCircuitBreakerOpen, isHttpError, isKnownHttpError, isValidationError, json, makeBudgetSemaphore, makeCompressionMiddleware, makeConnectionStateMap, makeDefaultHttpClient, makeHttpClient, makeHttpClientBuilder, makeHttpRouter, makeHttpServerResource, makeLifecycleClient, makeNodeHttpServer, makeNodeHttpServerResource, makePrewarmManager, makeRequestCompressionMiddleware, makeResponseCompressionMiddleware, makeRuntimeHealthRoute, makeRuntimeReadinessRoute, matchHttpError, nodeHttpServerResource, parseCacheKey, prewarmConnections, prewarmHttpConnections, route, runtimeHealthRoute, runtimeReadinessRoute, text, validateFetchAvailable, validateOrigin, validatedJson, validatedJsonResponse, withAuth, withBatch, withCache, withCircuitBreaker, withConnectionPrewarming, withDedup, withLogging, withPriority, withRequestBatching, withResponseHeader, withResponseTransform, withTracing };
2383
+ export { AdaptiveLimiter, AdaptiveLimiterConfig, AdaptiveLimiterPreset, AnyJsonSchemaLike, type BatchConfig, type BatchFunction, type BudgetSemaphore, type CacheConfig$1 as CacheConfig, type CacheKeyComponents, type CachePolicyResult$1 as CachePolicyResult, type CompressionConfig, type CompressionMiddlewareResult, type CompressionStats, type ConnectionPrewarmAttempt, type ConnectionPrewarmConfig, type ConnectionPrewarmEvent, type ConnectionPrewarmResult, type ConnectionPrewarmingMiddlewareConfig, type ConnectionStateMap, DEFAULT_CACHE_RELEVANT_HEADERS, type DecompressResult, type Decompressor, type DedupConfig$1 as DedupConfig, type DefaultGetJson, type DefaultHttpClient, type DefaultHttpClientConfig, type DefaultHttpClientFeatures, type DefaultHttpClientPreset, type DefaultPostJson, type Dx, EmaComputer, type HttpCircuitBreakerConfig, HttpClient, type HttpClientBuilder, HttpClientFn, HttpClientStats, HttpClientStream, HttpError, type HttpJsonInit, type HttpMeta, HttpMethod, HttpMiddleware, HttpPolicyPresets, HttpPoolConfig, type HttpPostJsonBodyInit, type HttpPostJsonInit, type HttpPostJsonSchemaBodyInit, HttpRequest, HttpRequestPolicyRef, HttpRequestRetryOverride, type HttpResponse, type HttpResponseWithMeta, type HttpRouteMatch, type HttpRouteOptions, type HttpRouteSchemas, type HttpRouter, type HttpRouterOptions, type HttpRuntimeHealthRouteOptions, HttpServer, type HttpServerBody, type HttpServerContext, type HttpServerHandler, type HttpServerHeaders, type HttpServerMethod, type HttpServerMiddleware, type HttpServerParams, type HttpServerQuery, type HttpServerRequest, type HttpServerResponse, type HttpServerRoute, HttpTransport, HttpWireResponse, HttpWireResponseStream, type HttpWireWithMeta, InferJsonSchema, type InferServerPart, LRUCache, type LRUCacheConfig, LatencyWindow, type LifecycleClient, type LifecycleClientConfig, type LifecycleEvent, type LifecycleEventType, type LifecycleRequestOptions, type LifecycleStats, LifecycleStatsTracker, type LogEvent, MakeHttpConfig, type NodeHttpServerError, type NodeHttpServerHandle, type NodeHttpServerOptions, type NodeHttpServerShutdownState, type PrewarmConfig, type PrewarmEvent, type PrewarmEventType, type PrewarmLifecycleConfig, type PrewarmManager, type PrewarmOriginState, type PrewarmOriginStatus, type PrewarmResult, type PrewarmResultStatus, type PrewarmStatusSnapshot, type PriorityConfig$1 as PriorityConfig, PriorityQueue, type PriorityQueueEntry, type ProbeOutcome, type RequestBatchingConfig, type RequestBatchingEvent, type RequestCompressionConfig, type RequestCompressionMiddlewareResult, type RequestCompressionStats, RetryPolicy, type RoutePathParamNames, type RoutePathParams, SEPARATOR, SUPPORTED_ENCODINGS, type SupportedEncoding, ValidationError, clampPriority, computeCacheKey, computeGradient, computeNewLimit, defaultHttpClientPreset, detectPlatform, empty, executeProbe, httpBuilder, httpClient, httpClientBuilder, httpClientStream, httpClientWithMeta, httpRoute, json, makeBudgetSemaphore, makeCompressionMiddleware, makeConnectionStateMap, makeDefaultHttpClient, makeHttpClient, makeHttpClientBuilder, makeHttpRouter, makeHttpServerResource, makeLifecycleClient, makeNodeHttpServer, makeNodeHttpServerResource, makePrewarmManager, makeRequestCompressionMiddleware, makeResponseCompressionMiddleware, makeRuntimeHealthRoute, makeRuntimeReadinessRoute, nodeHttpServerResource, parseCacheKey, prewarmConnections, prewarmHttpConnections, route, runtimeHealthRoute, runtimeReadinessRoute, text, validateFetchAvailable, validateOrigin, withAuth, withBatch, withCache, withCircuitBreaker, withConnectionPrewarming, withDedup, withLogging, withPriority, withRequestBatching, withResponseHeader, withResponseTransform, withTracing };