@iskra-bun/core 0.1.1 → 0.3.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/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Emitter } from 'mitt';
2
2
  import pino, { Logger as Logger$1 } from 'pino';
3
+ import { Attributes, Tracer } from '@opentelemetry/api';
3
4
  import { z } from 'zod';
4
5
 
5
6
  declare const createLogger: (name: string, level?: string) => pino.Logger<never, boolean>;
@@ -15,16 +16,39 @@ interface Plugin {
15
16
  name: string;
16
17
  install(app: App): Promise<void> | void;
17
18
  }
18
- interface Context<T = any> {
19
+ /** What an `app.on()` handler receives; `payload` is the emitted value. */
20
+ interface Context<T = unknown> {
19
21
  app: App;
20
22
  logger: Logger$1;
21
23
  payload: T;
22
- reply(data: any): void;
24
+ /** Emits `<event>:reply` with `data`. */
25
+ reply(data: unknown): void;
26
+ }
27
+ /**
28
+ * What each kit shares through `app.context`, by key, so `app.context.get('db')`
29
+ * is typed. Kits add their keys with declaration merging, and so can an app:
30
+ *
31
+ * ```ts
32
+ * declare module '@iskra-bun/core' {
33
+ * interface AppContextRegistry {
34
+ * bridge: DesktopBridge;
35
+ * }
36
+ * }
37
+ * ```
38
+ */
39
+ interface AppContextRegistry {
40
+ }
41
+ /**
42
+ * The payload of each app event, by name, so `app.on('process:exit', ...)`
43
+ * and `app.emit(...)` are typed. Kits add their events with declaration
44
+ * merging, and so can an app (as with AppContextRegistry).
45
+ */
46
+ interface AppEvents {
23
47
  }
24
48
  interface OtelConfig {
25
49
  /** Defaults to true when otel config is present */
26
50
  enabled?: boolean;
27
- /** OTLP endpoint URL. Defaults to http://localhost:4318 */
51
+ /** OTLP endpoint URL. Defaults to http://localhost:4318; use https:// for a collector on another host. */
28
52
  endpoint?: string;
29
53
  /** Overrides app name for the service.name resource attribute */
30
54
  serviceName?: string;
@@ -36,9 +60,16 @@ interface OtelConfig {
36
60
  metricIntervalMs?: number;
37
61
  /** Additional resource attributes */
38
62
  resourceAttributes?: Record<string, string>;
39
- /** Auto-instrumentation overrides (passed to getNodeAutoInstrumentations) */
63
+ /**
64
+ * Options of each auto-instrumentation, by package name, passed to
65
+ * getNodeAutoInstrumentations(): `{ enabled: false }`, or its own options
66
+ * (`'@opentelemetry/instrumentation-http': { ignoreIncomingRequestHook,
67
+ * redactedQueryParams }`). The HTTP one redacts SECRET_QUERY_PARAMS in
68
+ * exported URLs unless `redactedQueryParams` says otherwise.
69
+ */
40
70
  instrumentations?: Record<string, {
41
71
  enabled?: boolean;
72
+ [option: string]: unknown;
42
73
  }>;
43
74
  }
44
75
  interface AppConfig {
@@ -48,6 +79,13 @@ interface AppConfig {
48
79
  level?: string;
49
80
  };
50
81
  otel?: OtelConfig;
82
+ /**
83
+ * Signals that trigger a graceful `stop()` and exit. Default
84
+ * `['SIGTERM', 'SIGINT']` (none under NODE_ENV=test); `false` disables.
85
+ */
86
+ shutdownSignals?: string[] | false;
87
+ /** Max time for a signal-triggered stop before forcing exit(1). Default 10000. */
88
+ shutdownTimeoutMs?: number;
51
89
  processes?: Record<string, ProcessConfig>;
52
90
  socket?: {
53
91
  enabled: boolean;
@@ -55,15 +93,17 @@ interface AppConfig {
55
93
  adapter?: 'bun' | 'socket.io';
56
94
  };
57
95
  kv?: {
58
- driver: 'memory' | 'redis' | 'libsql';
59
- connection?: any;
96
+ driver: 'memory' | 'redis';
97
+ /** Redis: a URL string, ioredis options, or ioredis options with `url`. */
98
+ connection?: string | Record<string, unknown>;
60
99
  };
61
100
  db?: {
62
101
  driver: 'postgres' | 'mysql' | 'sqlite' | 'libsql';
63
102
  url: string;
64
103
  authToken?: string;
65
104
  };
66
- [key: string]: any;
105
+ /** Sections of other kits or of the app; read them with their own type. */
106
+ [key: string]: unknown;
67
107
  }
68
108
  interface RestartBackoffConfig {
69
109
  /** Initial delay in ms before the first restart. Default: 1000 */
@@ -80,25 +120,95 @@ interface ProcessConfig {
80
120
  restartOnCrash?: boolean;
81
121
  maxRestarts?: number;
82
122
  restartCooldown?: number;
123
+ /** Variables set for the child, over the ones it inherits (see `inheritEnv`). */
83
124
  env?: Record<string, string>;
125
+ /**
126
+ * Which of the app's environment variables the child inherits. Default
127
+ * `false`: a minimal set without secrets (PATH, HOME, locale, TZ, temp
128
+ * dir, NODE_ENV…). A list adds those names to it; `true` passes them all
129
+ * (DATABASE_URL, AUTH_SECRET, cloud keys…).
130
+ */
131
+ inheritEnv?: boolean | string[];
132
+ /**
133
+ * `stdio` mode: bytes `send()` lets wait for a child that is not reading
134
+ * its stdin; past this it refuses messages (returns false). Default 8 MiB.
135
+ */
136
+ maxPendingStdinBytes?: number;
84
137
  /** Exponential backoff settings for restarts. Defaults to 1000 ms flat (no backoff). */
85
138
  restartBackoff?: RestartBackoffConfig;
86
139
  }
87
140
 
141
+ /**
142
+ * `app.context`: a Map whose keys in AppContextRegistry (`'db'`, `'kv'`, …)
143
+ * are typed; any other key holds `unknown`, or the type given as `T`.
144
+ */
145
+ declare class AppContext extends Map<string, unknown> {
146
+ get<K extends keyof AppContextRegistry>(key: K): AppContextRegistry[K] | undefined;
147
+ get<T = unknown>(key: string): T | undefined;
148
+ set<K extends keyof AppContextRegistry>(key: K, value: AppContextRegistry[K]): this;
149
+ set(key: string, value: unknown): this;
150
+ }
88
151
  declare class App {
89
152
  config: AppConfig;
90
153
  logger: Logger;
91
- events: Emitter<any>;
154
+ events: Emitter<Record<string, unknown>>;
92
155
  private drivers;
93
- context: Map<string, any>;
156
+ /** Drivers whose start() succeeded, in start order; null until start() runs. */
157
+ private startedDrivers;
158
+ private pendingInstalls;
159
+ /** The shutdown in progress, shared by concurrent stop() calls. */
160
+ private stopping;
161
+ private signalHandler?;
162
+ private signals;
163
+ context: AppContext;
94
164
  constructor(config?: AppConfig);
95
165
  init(): Promise<void>;
96
166
  register(driver: Driver): this;
97
167
  use(plugin: Plugin): this;
98
- on(event: string, handler: (ctx: Context) => Promise<void> | void): this;
99
- emit(event: string, payload: any): void;
168
+ /**
169
+ * Runs `handler` for every `event`. Events in AppEvents give the handler a
170
+ * typed payload; for others it is `unknown`, or the type given as `T`.
171
+ */
172
+ on<K extends keyof AppEvents>(event: K, handler: (ctx: Context<AppEvents[K]>) => Promise<void> | void): this;
173
+ on<T = unknown>(event: string, handler: (ctx: Context<T>) => Promise<void> | void): this;
174
+ /** Emits `event`; for events in AppEvents the payload must match their type. */
175
+ emit<K extends keyof AppEvents>(event: K, payload: AppEvents[K]): void;
176
+ emit(event: string, payload?: unknown): void;
177
+ /**
178
+ * Starts drivers one at a time, in registration order, so a driver can rely
179
+ * on the ones registered before it (e.g. the DB before the web server). If
180
+ * one fails, every driver is stopped in reverse order (all were initialized
181
+ * and may hold connections, including the failing one), OpenTelemetry is
182
+ * shut down and the error is rethrown, instead of leaving ports bound and
183
+ * children running.
184
+ */
100
185
  start(): Promise<void>;
186
+ /**
187
+ * Stops drivers in reverse start order (the web server before the DB it
188
+ * uses), continuing past failures, and always flushes OpenTelemetry.
189
+ *
190
+ * A call made while a stop is in progress (e.g. an app's own signal
191
+ * handler next to the App's) gets that same stop: it resolves only once
192
+ * every driver has stopped, instead of right away with nothing left to do.
193
+ */
101
194
  stop(): Promise<void>;
195
+ private stopOnce;
196
+ /**
197
+ * Stops `drivers` after a failed init() or start() and shuts down
198
+ * OpenTelemetry. Failures to stop are logged, not thrown: the caller
199
+ * rethrows the original error. A later stop() stops nothing more.
200
+ */
201
+ private rollback;
202
+ private stopDrivers;
203
+ /**
204
+ * Stops the app gracefully on SIGTERM/SIGINT (configurable with
205
+ * `shutdownSignals`, off by default under NODE_ENV=test). Once a listener
206
+ * exists the runtime no longer exits on its own, so the handler exits with
207
+ * 0 after a clean stop, or 1 on failure / after `shutdownTimeoutMs`. A
208
+ * second signal forces exit.
209
+ */
210
+ private installSignalHandlers;
211
+ private removeSignalHandlers;
102
212
  }
103
213
 
104
214
  declare const ErrorCodes: {
@@ -118,8 +228,14 @@ declare const ErrorCodes: {
118
228
  readonly UNAUTHORIZED: "UNAUTHORIZED";
119
229
  readonly FORBIDDEN: "FORBIDDEN";
120
230
  readonly NOT_FOUND: "NOT_FOUND";
231
+ readonly METHOD_NOT_ALLOWED: "METHOD_NOT_ALLOWED";
121
232
  readonly CONFLICT: "CONFLICT";
233
+ readonly PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
234
+ readonly UNSUPPORTED_MEDIA_TYPE: "UNSUPPORTED_MEDIA_TYPE";
122
235
  readonly VALIDATION_ERROR: "VALIDATION_ERROR";
236
+ readonly RATE_LIMITED: "RATE_LIMITED";
237
+ readonly SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE";
238
+ readonly TIMEOUT: "TIMEOUT";
123
239
  readonly DATABASE_ERROR: "DATABASE_ERROR";
124
240
  readonly CONNECTION_ERROR: "CONNECTION_ERROR";
125
241
  readonly QUERY_ERROR: "QUERY_ERROR";
@@ -133,7 +249,22 @@ declare const ErrorCodes: {
133
249
  readonly SOCKET_CONNECTION_ERROR: "SOCKET_CONNECTION_ERROR";
134
250
  readonly SOCKET_MESSAGE_ERROR: "SOCKET_MESSAGE_ERROR";
135
251
  };
136
- type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
252
+ /**
253
+ * Every error code, as keys: Iskra's own (`ErrorCodes`) and the ones an app
254
+ * adds by merging into this interface, which `ErrorCode` then accepts:
255
+ *
256
+ * ```ts
257
+ * declare module '@iskra-bun/core' {
258
+ * interface ErrorCodeRegistry {
259
+ * ORDER_LOCKED: true;
260
+ * }
261
+ * }
262
+ * throw new HttpError(423, 'The order is being edited', { code: 'ORDER_LOCKED' });
263
+ * ```
264
+ */
265
+ interface ErrorCodeRegistry extends Record<(typeof ErrorCodes)[keyof typeof ErrorCodes], true> {
266
+ }
267
+ type ErrorCode = keyof ErrorCodeRegistry & string;
137
268
  interface IskraErrorOptions {
138
269
  code: ErrorCode;
139
270
  cause?: Error;
@@ -197,6 +328,47 @@ declare class LifecycleError extends IskraError {
197
328
  * actionable error instead of an unhandled module-resolution failure.
198
329
  */
199
330
 
331
+ /** `@opentelemetry/resources`: 2.x exports resourceFromAttributes(), 1.x the Resource class. */
332
+ interface OtelResourcesModule {
333
+ resourceFromAttributes?: (attributes: Record<string, string>) => unknown;
334
+ Resource?: new (attributes: Record<string, string>) => unknown;
335
+ }
336
+ /**
337
+ * Query parameters whose values are exported as REDACTED in span URLs (see
338
+ * redactUrl). Names are compared without case, `-` or `_`.
339
+ */
340
+ declare const SECRET_QUERY_PARAMS: readonly string[];
341
+ /**
342
+ * `url` (absolute, or a path) with the value of each query parameter named in
343
+ * `params` replaced by REDACTED, the rest kept as it was. Telemetry exported
344
+ * URLs as they were requested: `?api_key=`, `?access_token=`, a presigned
345
+ * URL's signature.
346
+ */
347
+ declare function redactUrl(url: string, params?: readonly string[]): string;
348
+ /**
349
+ * The options initOtel() passes to getNodeAutoInstrumentations(): the app's
350
+ * `instrumentations` over Iskra's defaults. The HTTP instrumentation redacts
351
+ * SECRET_QUERY_PARAMS unless `redactedQueryParams` / `redactedQueryParamsServer`
352
+ * are set (instrumentation-http 0.204 / 0.222 and later apply them itself;
353
+ * for older releases a requestHook rewrites the span's URL attributes, before
354
+ * the app's own requestHook runs).
355
+ */
356
+ declare function autoInstrumentationOptions(config: OtelConfig): Record<string, unknown>;
357
+ /**
358
+ * The OTLP endpoint as it is safe to log, its origin (the path, query or
359
+ * userinfo can carry an API key), and whether spans travel to it in clear
360
+ * text beyond this machine and its private network.
361
+ */
362
+ declare function describeOtelEndpoint(config: OtelConfig): {
363
+ origin: string;
364
+ plaintext: boolean;
365
+ };
366
+ /**
367
+ * Builds a Resource with whichever API the installed `@opentelemetry/resources`
368
+ * provides: 2.x only exports `resourceFromAttributes()` (`Resource` is a type
369
+ * there, so `new Resource()` throws), 1.x exports the `Resource` class.
370
+ */
371
+ declare function createResource(resources: OtelResourcesModule, attributes: Record<string, string>): unknown;
200
372
  /**
201
373
  * Initialize the OpenTelemetry NodeSDK with OTLP exporters.
202
374
  * Must be called before any drivers start so auto-instrumentation can patch libraries.
@@ -207,6 +379,41 @@ declare function initOtel(config: OtelConfig, appName: string): Promise<void>;
207
379
  */
208
380
  declare function shutdownOtel(): Promise<void>;
209
381
 
382
+ interface TracedOptions {
383
+ /** Attributes of every span. */
384
+ attributes?: Attributes;
385
+ /** The tracer; default the global provider's `iskra` tracer (no spans without an OpenTelemetry SDK). */
386
+ tracer?: Tracer;
387
+ }
388
+ /**
389
+ * Wraps `fn` in a span named `name`, by convention `layer.domain.method`
390
+ * (`repo.usuarios.buscar`): the span is the active one while `fn` runs, so
391
+ * the spans started inside (a query, a call to another service) are its
392
+ * children; a throw or a rejection marks it as an error. Without an
393
+ * OpenTelemetry SDK it costs a no-op span.
394
+ *
395
+ * ```ts
396
+ * const buscar = traced('repo.usuarios.buscar', async (id: number) => oracle.one(SQL, { id }));
397
+ * ```
398
+ */
399
+ declare function traced<A extends unknown[], R>(name: string, fn: (...args: A) => R, options?: TracedOptions): (...args: A) => R;
400
+
401
+ /** `NODE_ENV` as the process runs with it, or undefined when unset or empty. */
402
+ declare function nodeEnv(): string | undefined;
403
+ /**
404
+ * Whether development conveniences apply (pretty logs, http auth URLs, sample
405
+ * secrets, `disableCSRFCheck`): only with `NODE_ENV` set to `development` or
406
+ * `test`.
407
+ */
408
+ declare function isDevelopmentEnv(env?: string | undefined): boolean;
409
+ /**
410
+ * Whether production safeguards apply: in every environment but `development`
411
+ * and `test`, including an unset NODE_ENV and names like `staging`. They used
412
+ * to apply only to NODE_ENV=production exactly, so a deploy that forgot it
413
+ * sent non-Secure cookies and accepted placeholder secrets.
414
+ */
415
+ declare function isProductionEnv(env?: string | undefined): boolean;
416
+
210
417
  declare function loadAppConfig(cwd?: string): Promise<AppConfig>;
211
418
 
212
419
  declare const AppConfigSchema: z.ZodObject<{
@@ -214,11 +421,11 @@ declare const AppConfigSchema: z.ZodObject<{
214
421
  debug: z.ZodDefault<z.ZodBoolean>;
215
422
  logger: z.ZodDefault<z.ZodObject<{
216
423
  level: z.ZodDefault<z.ZodString>;
217
- }, "strip", z.ZodTypeAny, {
218
- level: string;
219
- }, {
220
- level?: string | undefined;
221
- }>>;
424
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
425
+ level: z.ZodDefault<z.ZodString>;
426
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
427
+ level: z.ZodDefault<z.ZodString>;
428
+ }, z.ZodTypeAny, "passthrough">>>;
222
429
  otel: z.ZodOptional<z.ZodObject<{
223
430
  enabled: z.ZodDefault<z.ZodBoolean>;
224
431
  endpoint: z.ZodDefault<z.ZodString>;
@@ -229,105 +436,480 @@ declare const AppConfigSchema: z.ZodObject<{
229
436
  resourceAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
230
437
  instrumentations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
231
438
  enabled: z.ZodOptional<z.ZodBoolean>;
439
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
440
+ enabled: z.ZodOptional<z.ZodBoolean>;
441
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
442
+ enabled: z.ZodOptional<z.ZodBoolean>;
443
+ }, z.ZodTypeAny, "passthrough">>>>;
444
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
445
+ enabled: z.ZodDefault<z.ZodBoolean>;
446
+ endpoint: z.ZodDefault<z.ZodString>;
447
+ serviceName: z.ZodOptional<z.ZodString>;
448
+ serviceVersion: z.ZodDefault<z.ZodString>;
449
+ environment: z.ZodOptional<z.ZodString>;
450
+ metricIntervalMs: z.ZodDefault<z.ZodNumber>;
451
+ resourceAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
452
+ instrumentations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
453
+ enabled: z.ZodOptional<z.ZodBoolean>;
454
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
455
+ enabled: z.ZodOptional<z.ZodBoolean>;
456
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
457
+ enabled: z.ZodOptional<z.ZodBoolean>;
458
+ }, z.ZodTypeAny, "passthrough">>>>;
459
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
460
+ enabled: z.ZodDefault<z.ZodBoolean>;
461
+ endpoint: z.ZodDefault<z.ZodString>;
462
+ serviceName: z.ZodOptional<z.ZodString>;
463
+ serviceVersion: z.ZodDefault<z.ZodString>;
464
+ environment: z.ZodOptional<z.ZodString>;
465
+ metricIntervalMs: z.ZodDefault<z.ZodNumber>;
466
+ resourceAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
467
+ instrumentations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
468
+ enabled: z.ZodOptional<z.ZodBoolean>;
469
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
470
+ enabled: z.ZodOptional<z.ZodBoolean>;
471
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
472
+ enabled: z.ZodOptional<z.ZodBoolean>;
473
+ }, z.ZodTypeAny, "passthrough">>>>;
474
+ }, z.ZodTypeAny, "passthrough">>>;
475
+ shutdownSignals: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodLiteral<false>]>>;
476
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
477
+ processes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
478
+ command: z.ZodString;
479
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
480
+ mode: z.ZodDefault<z.ZodEnum<["daemon", "oneshot", "stdio"]>>;
481
+ restartOnCrash: z.ZodDefault<z.ZodBoolean>;
482
+ maxRestarts: z.ZodOptional<z.ZodNumber>;
483
+ restartCooldown: z.ZodOptional<z.ZodNumber>;
484
+ restartBackoff: z.ZodOptional<z.ZodObject<{
485
+ initialMs: z.ZodOptional<z.ZodNumber>;
486
+ maxMs: z.ZodOptional<z.ZodNumber>;
487
+ factor: z.ZodOptional<z.ZodNumber>;
232
488
  }, "strip", z.ZodTypeAny, {
233
- enabled?: boolean | undefined;
489
+ initialMs?: number | undefined;
490
+ maxMs?: number | undefined;
491
+ factor?: number | undefined;
234
492
  }, {
235
- enabled?: boolean | undefined;
236
- }>>>;
237
- }, "strip", z.ZodTypeAny, {
238
- enabled: boolean;
239
- endpoint: string;
240
- serviceVersion: string;
241
- metricIntervalMs: number;
242
- serviceName?: string | undefined;
243
- environment?: string | undefined;
244
- resourceAttributes?: Record<string, string> | undefined;
245
- instrumentations?: Record<string, {
246
- enabled?: boolean | undefined;
247
- }> | undefined;
248
- }, {
249
- enabled?: boolean | undefined;
250
- endpoint?: string | undefined;
251
- serviceName?: string | undefined;
252
- serviceVersion?: string | undefined;
253
- environment?: string | undefined;
254
- metricIntervalMs?: number | undefined;
255
- resourceAttributes?: Record<string, string> | undefined;
256
- instrumentations?: Record<string, {
257
- enabled?: boolean | undefined;
258
- }> | undefined;
259
- }>>;
493
+ initialMs?: number | undefined;
494
+ maxMs?: number | undefined;
495
+ factor?: number | undefined;
496
+ }>>;
497
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
498
+ inheritEnv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
499
+ maxPendingStdinBytes: z.ZodOptional<z.ZodNumber>;
500
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
501
+ command: z.ZodString;
502
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
503
+ mode: z.ZodDefault<z.ZodEnum<["daemon", "oneshot", "stdio"]>>;
504
+ restartOnCrash: z.ZodDefault<z.ZodBoolean>;
505
+ maxRestarts: z.ZodOptional<z.ZodNumber>;
506
+ restartCooldown: z.ZodOptional<z.ZodNumber>;
507
+ restartBackoff: z.ZodOptional<z.ZodObject<{
508
+ initialMs: z.ZodOptional<z.ZodNumber>;
509
+ maxMs: z.ZodOptional<z.ZodNumber>;
510
+ factor: z.ZodOptional<z.ZodNumber>;
511
+ }, "strip", z.ZodTypeAny, {
512
+ initialMs?: number | undefined;
513
+ maxMs?: number | undefined;
514
+ factor?: number | undefined;
515
+ }, {
516
+ initialMs?: number | undefined;
517
+ maxMs?: number | undefined;
518
+ factor?: number | undefined;
519
+ }>>;
520
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
521
+ inheritEnv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
522
+ maxPendingStdinBytes: z.ZodOptional<z.ZodNumber>;
523
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
524
+ command: z.ZodString;
525
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
526
+ mode: z.ZodDefault<z.ZodEnum<["daemon", "oneshot", "stdio"]>>;
527
+ restartOnCrash: z.ZodDefault<z.ZodBoolean>;
528
+ maxRestarts: z.ZodOptional<z.ZodNumber>;
529
+ restartCooldown: z.ZodOptional<z.ZodNumber>;
530
+ restartBackoff: z.ZodOptional<z.ZodObject<{
531
+ initialMs: z.ZodOptional<z.ZodNumber>;
532
+ maxMs: z.ZodOptional<z.ZodNumber>;
533
+ factor: z.ZodOptional<z.ZodNumber>;
534
+ }, "strip", z.ZodTypeAny, {
535
+ initialMs?: number | undefined;
536
+ maxMs?: number | undefined;
537
+ factor?: number | undefined;
538
+ }, {
539
+ initialMs?: number | undefined;
540
+ maxMs?: number | undefined;
541
+ factor?: number | undefined;
542
+ }>>;
543
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
544
+ inheritEnv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
545
+ maxPendingStdinBytes: z.ZodOptional<z.ZodNumber>;
546
+ }, z.ZodTypeAny, "passthrough">>>>;
547
+ socket: z.ZodOptional<z.ZodObject<{
548
+ enabled: z.ZodBoolean;
549
+ port: z.ZodOptional<z.ZodNumber>;
550
+ adapter: z.ZodOptional<z.ZodEnum<["bun", "socket.io"]>>;
551
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
552
+ enabled: z.ZodBoolean;
553
+ port: z.ZodOptional<z.ZodNumber>;
554
+ adapter: z.ZodOptional<z.ZodEnum<["bun", "socket.io"]>>;
555
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
556
+ enabled: z.ZodBoolean;
557
+ port: z.ZodOptional<z.ZodNumber>;
558
+ adapter: z.ZodOptional<z.ZodEnum<["bun", "socket.io"]>>;
559
+ }, z.ZodTypeAny, "passthrough">>>;
560
+ kv: z.ZodOptional<z.ZodObject<{
561
+ driver: z.ZodEnum<["memory", "redis"]>;
562
+ connection: z.ZodOptional<z.ZodAny>;
563
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
564
+ driver: z.ZodEnum<["memory", "redis"]>;
565
+ connection: z.ZodOptional<z.ZodAny>;
566
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
567
+ driver: z.ZodEnum<["memory", "redis"]>;
568
+ connection: z.ZodOptional<z.ZodAny>;
569
+ }, z.ZodTypeAny, "passthrough">>>;
570
+ db: z.ZodOptional<z.ZodObject<{
571
+ driver: z.ZodEnum<["postgres", "mysql", "sqlite", "libsql"]>;
572
+ url: z.ZodString;
573
+ authToken: z.ZodOptional<z.ZodString>;
574
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
575
+ driver: z.ZodEnum<["postgres", "mysql", "sqlite", "libsql"]>;
576
+ url: z.ZodString;
577
+ authToken: z.ZodOptional<z.ZodString>;
578
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
579
+ driver: z.ZodEnum<["postgres", "mysql", "sqlite", "libsql"]>;
580
+ url: z.ZodString;
581
+ authToken: z.ZodOptional<z.ZodString>;
582
+ }, z.ZodTypeAny, "passthrough">>>;
583
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
584
+ name: z.ZodDefault<z.ZodString>;
585
+ debug: z.ZodDefault<z.ZodBoolean>;
586
+ logger: z.ZodDefault<z.ZodObject<{
587
+ level: z.ZodDefault<z.ZodString>;
588
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
589
+ level: z.ZodDefault<z.ZodString>;
590
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
591
+ level: z.ZodDefault<z.ZodString>;
592
+ }, z.ZodTypeAny, "passthrough">>>;
593
+ otel: z.ZodOptional<z.ZodObject<{
594
+ enabled: z.ZodDefault<z.ZodBoolean>;
595
+ endpoint: z.ZodDefault<z.ZodString>;
596
+ serviceName: z.ZodOptional<z.ZodString>;
597
+ serviceVersion: z.ZodDefault<z.ZodString>;
598
+ environment: z.ZodOptional<z.ZodString>;
599
+ metricIntervalMs: z.ZodDefault<z.ZodNumber>;
600
+ resourceAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
601
+ instrumentations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
602
+ enabled: z.ZodOptional<z.ZodBoolean>;
603
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
604
+ enabled: z.ZodOptional<z.ZodBoolean>;
605
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
606
+ enabled: z.ZodOptional<z.ZodBoolean>;
607
+ }, z.ZodTypeAny, "passthrough">>>>;
608
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
609
+ enabled: z.ZodDefault<z.ZodBoolean>;
610
+ endpoint: z.ZodDefault<z.ZodString>;
611
+ serviceName: z.ZodOptional<z.ZodString>;
612
+ serviceVersion: z.ZodDefault<z.ZodString>;
613
+ environment: z.ZodOptional<z.ZodString>;
614
+ metricIntervalMs: z.ZodDefault<z.ZodNumber>;
615
+ resourceAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
616
+ instrumentations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
617
+ enabled: z.ZodOptional<z.ZodBoolean>;
618
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
619
+ enabled: z.ZodOptional<z.ZodBoolean>;
620
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
621
+ enabled: z.ZodOptional<z.ZodBoolean>;
622
+ }, z.ZodTypeAny, "passthrough">>>>;
623
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
624
+ enabled: z.ZodDefault<z.ZodBoolean>;
625
+ endpoint: z.ZodDefault<z.ZodString>;
626
+ serviceName: z.ZodOptional<z.ZodString>;
627
+ serviceVersion: z.ZodDefault<z.ZodString>;
628
+ environment: z.ZodOptional<z.ZodString>;
629
+ metricIntervalMs: z.ZodDefault<z.ZodNumber>;
630
+ resourceAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
631
+ instrumentations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
632
+ enabled: z.ZodOptional<z.ZodBoolean>;
633
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
634
+ enabled: z.ZodOptional<z.ZodBoolean>;
635
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
636
+ enabled: z.ZodOptional<z.ZodBoolean>;
637
+ }, z.ZodTypeAny, "passthrough">>>>;
638
+ }, z.ZodTypeAny, "passthrough">>>;
639
+ shutdownSignals: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodLiteral<false>]>>;
640
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
260
641
  processes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
261
642
  command: z.ZodString;
262
643
  args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
263
644
  mode: z.ZodDefault<z.ZodEnum<["daemon", "oneshot", "stdio"]>>;
264
645
  restartOnCrash: z.ZodDefault<z.ZodBoolean>;
646
+ maxRestarts: z.ZodOptional<z.ZodNumber>;
647
+ restartCooldown: z.ZodOptional<z.ZodNumber>;
648
+ restartBackoff: z.ZodOptional<z.ZodObject<{
649
+ initialMs: z.ZodOptional<z.ZodNumber>;
650
+ maxMs: z.ZodOptional<z.ZodNumber>;
651
+ factor: z.ZodOptional<z.ZodNumber>;
652
+ }, "strip", z.ZodTypeAny, {
653
+ initialMs?: number | undefined;
654
+ maxMs?: number | undefined;
655
+ factor?: number | undefined;
656
+ }, {
657
+ initialMs?: number | undefined;
658
+ maxMs?: number | undefined;
659
+ factor?: number | undefined;
660
+ }>>;
265
661
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
266
- }, "strip", z.ZodTypeAny, {
267
- command: string;
268
- mode: "daemon" | "oneshot" | "stdio";
269
- restartOnCrash: boolean;
270
- args?: string[] | undefined;
271
- env?: Record<string, string> | undefined;
272
- }, {
273
- command: string;
274
- args?: string[] | undefined;
275
- mode?: "daemon" | "oneshot" | "stdio" | undefined;
276
- restartOnCrash?: boolean | undefined;
277
- env?: Record<string, string> | undefined;
278
- }>>>;
279
- }, "strip", z.ZodTypeAny, {
280
- debug: boolean;
281
- name: string;
282
- logger: {
283
- level: string;
284
- };
285
- otel?: {
286
- enabled: boolean;
287
- endpoint: string;
288
- serviceVersion: string;
289
- metricIntervalMs: number;
290
- serviceName?: string | undefined;
291
- environment?: string | undefined;
292
- resourceAttributes?: Record<string, string> | undefined;
293
- instrumentations?: Record<string, {
294
- enabled?: boolean | undefined;
295
- }> | undefined;
296
- } | undefined;
297
- processes?: Record<string, {
298
- command: string;
299
- mode: "daemon" | "oneshot" | "stdio";
300
- restartOnCrash: boolean;
301
- args?: string[] | undefined;
302
- env?: Record<string, string> | undefined;
303
- }> | undefined;
304
- }, {
305
- debug?: boolean | undefined;
306
- name?: string | undefined;
307
- logger?: {
308
- level?: string | undefined;
309
- } | undefined;
310
- otel?: {
311
- enabled?: boolean | undefined;
312
- endpoint?: string | undefined;
313
- serviceName?: string | undefined;
314
- serviceVersion?: string | undefined;
315
- environment?: string | undefined;
316
- metricIntervalMs?: number | undefined;
317
- resourceAttributes?: Record<string, string> | undefined;
318
- instrumentations?: Record<string, {
319
- enabled?: boolean | undefined;
320
- }> | undefined;
321
- } | undefined;
322
- processes?: Record<string, {
323
- command: string;
324
- args?: string[] | undefined;
325
- mode?: "daemon" | "oneshot" | "stdio" | undefined;
326
- restartOnCrash?: boolean | undefined;
327
- env?: Record<string, string> | undefined;
328
- }> | undefined;
329
- }>;
662
+ inheritEnv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
663
+ maxPendingStdinBytes: z.ZodOptional<z.ZodNumber>;
664
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
665
+ command: z.ZodString;
666
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
667
+ mode: z.ZodDefault<z.ZodEnum<["daemon", "oneshot", "stdio"]>>;
668
+ restartOnCrash: z.ZodDefault<z.ZodBoolean>;
669
+ maxRestarts: z.ZodOptional<z.ZodNumber>;
670
+ restartCooldown: z.ZodOptional<z.ZodNumber>;
671
+ restartBackoff: z.ZodOptional<z.ZodObject<{
672
+ initialMs: z.ZodOptional<z.ZodNumber>;
673
+ maxMs: z.ZodOptional<z.ZodNumber>;
674
+ factor: z.ZodOptional<z.ZodNumber>;
675
+ }, "strip", z.ZodTypeAny, {
676
+ initialMs?: number | undefined;
677
+ maxMs?: number | undefined;
678
+ factor?: number | undefined;
679
+ }, {
680
+ initialMs?: number | undefined;
681
+ maxMs?: number | undefined;
682
+ factor?: number | undefined;
683
+ }>>;
684
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
685
+ inheritEnv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
686
+ maxPendingStdinBytes: z.ZodOptional<z.ZodNumber>;
687
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
688
+ command: z.ZodString;
689
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
690
+ mode: z.ZodDefault<z.ZodEnum<["daemon", "oneshot", "stdio"]>>;
691
+ restartOnCrash: z.ZodDefault<z.ZodBoolean>;
692
+ maxRestarts: z.ZodOptional<z.ZodNumber>;
693
+ restartCooldown: z.ZodOptional<z.ZodNumber>;
694
+ restartBackoff: z.ZodOptional<z.ZodObject<{
695
+ initialMs: z.ZodOptional<z.ZodNumber>;
696
+ maxMs: z.ZodOptional<z.ZodNumber>;
697
+ factor: z.ZodOptional<z.ZodNumber>;
698
+ }, "strip", z.ZodTypeAny, {
699
+ initialMs?: number | undefined;
700
+ maxMs?: number | undefined;
701
+ factor?: number | undefined;
702
+ }, {
703
+ initialMs?: number | undefined;
704
+ maxMs?: number | undefined;
705
+ factor?: number | undefined;
706
+ }>>;
707
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
708
+ inheritEnv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
709
+ maxPendingStdinBytes: z.ZodOptional<z.ZodNumber>;
710
+ }, z.ZodTypeAny, "passthrough">>>>;
711
+ socket: z.ZodOptional<z.ZodObject<{
712
+ enabled: z.ZodBoolean;
713
+ port: z.ZodOptional<z.ZodNumber>;
714
+ adapter: z.ZodOptional<z.ZodEnum<["bun", "socket.io"]>>;
715
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
716
+ enabled: z.ZodBoolean;
717
+ port: z.ZodOptional<z.ZodNumber>;
718
+ adapter: z.ZodOptional<z.ZodEnum<["bun", "socket.io"]>>;
719
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
720
+ enabled: z.ZodBoolean;
721
+ port: z.ZodOptional<z.ZodNumber>;
722
+ adapter: z.ZodOptional<z.ZodEnum<["bun", "socket.io"]>>;
723
+ }, z.ZodTypeAny, "passthrough">>>;
724
+ kv: z.ZodOptional<z.ZodObject<{
725
+ driver: z.ZodEnum<["memory", "redis"]>;
726
+ connection: z.ZodOptional<z.ZodAny>;
727
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
728
+ driver: z.ZodEnum<["memory", "redis"]>;
729
+ connection: z.ZodOptional<z.ZodAny>;
730
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
731
+ driver: z.ZodEnum<["memory", "redis"]>;
732
+ connection: z.ZodOptional<z.ZodAny>;
733
+ }, z.ZodTypeAny, "passthrough">>>;
734
+ db: z.ZodOptional<z.ZodObject<{
735
+ driver: z.ZodEnum<["postgres", "mysql", "sqlite", "libsql"]>;
736
+ url: z.ZodString;
737
+ authToken: z.ZodOptional<z.ZodString>;
738
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
739
+ driver: z.ZodEnum<["postgres", "mysql", "sqlite", "libsql"]>;
740
+ url: z.ZodString;
741
+ authToken: z.ZodOptional<z.ZodString>;
742
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
743
+ driver: z.ZodEnum<["postgres", "mysql", "sqlite", "libsql"]>;
744
+ url: z.ZodString;
745
+ authToken: z.ZodOptional<z.ZodString>;
746
+ }, z.ZodTypeAny, "passthrough">>>;
747
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
748
+ name: z.ZodDefault<z.ZodString>;
749
+ debug: z.ZodDefault<z.ZodBoolean>;
750
+ logger: z.ZodDefault<z.ZodObject<{
751
+ level: z.ZodDefault<z.ZodString>;
752
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
753
+ level: z.ZodDefault<z.ZodString>;
754
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
755
+ level: z.ZodDefault<z.ZodString>;
756
+ }, z.ZodTypeAny, "passthrough">>>;
757
+ otel: z.ZodOptional<z.ZodObject<{
758
+ enabled: z.ZodDefault<z.ZodBoolean>;
759
+ endpoint: z.ZodDefault<z.ZodString>;
760
+ serviceName: z.ZodOptional<z.ZodString>;
761
+ serviceVersion: z.ZodDefault<z.ZodString>;
762
+ environment: z.ZodOptional<z.ZodString>;
763
+ metricIntervalMs: z.ZodDefault<z.ZodNumber>;
764
+ resourceAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
765
+ instrumentations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
766
+ enabled: z.ZodOptional<z.ZodBoolean>;
767
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
768
+ enabled: z.ZodOptional<z.ZodBoolean>;
769
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
770
+ enabled: z.ZodOptional<z.ZodBoolean>;
771
+ }, z.ZodTypeAny, "passthrough">>>>;
772
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
773
+ enabled: z.ZodDefault<z.ZodBoolean>;
774
+ endpoint: z.ZodDefault<z.ZodString>;
775
+ serviceName: z.ZodOptional<z.ZodString>;
776
+ serviceVersion: z.ZodDefault<z.ZodString>;
777
+ environment: z.ZodOptional<z.ZodString>;
778
+ metricIntervalMs: z.ZodDefault<z.ZodNumber>;
779
+ resourceAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
780
+ instrumentations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
781
+ enabled: z.ZodOptional<z.ZodBoolean>;
782
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
783
+ enabled: z.ZodOptional<z.ZodBoolean>;
784
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
785
+ enabled: z.ZodOptional<z.ZodBoolean>;
786
+ }, z.ZodTypeAny, "passthrough">>>>;
787
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
788
+ enabled: z.ZodDefault<z.ZodBoolean>;
789
+ endpoint: z.ZodDefault<z.ZodString>;
790
+ serviceName: z.ZodOptional<z.ZodString>;
791
+ serviceVersion: z.ZodDefault<z.ZodString>;
792
+ environment: z.ZodOptional<z.ZodString>;
793
+ metricIntervalMs: z.ZodDefault<z.ZodNumber>;
794
+ resourceAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
795
+ instrumentations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
796
+ enabled: z.ZodOptional<z.ZodBoolean>;
797
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
798
+ enabled: z.ZodOptional<z.ZodBoolean>;
799
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
800
+ enabled: z.ZodOptional<z.ZodBoolean>;
801
+ }, z.ZodTypeAny, "passthrough">>>>;
802
+ }, z.ZodTypeAny, "passthrough">>>;
803
+ shutdownSignals: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodLiteral<false>]>>;
804
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
805
+ processes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
806
+ command: z.ZodString;
807
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
808
+ mode: z.ZodDefault<z.ZodEnum<["daemon", "oneshot", "stdio"]>>;
809
+ restartOnCrash: z.ZodDefault<z.ZodBoolean>;
810
+ maxRestarts: z.ZodOptional<z.ZodNumber>;
811
+ restartCooldown: z.ZodOptional<z.ZodNumber>;
812
+ restartBackoff: z.ZodOptional<z.ZodObject<{
813
+ initialMs: z.ZodOptional<z.ZodNumber>;
814
+ maxMs: z.ZodOptional<z.ZodNumber>;
815
+ factor: z.ZodOptional<z.ZodNumber>;
816
+ }, "strip", z.ZodTypeAny, {
817
+ initialMs?: number | undefined;
818
+ maxMs?: number | undefined;
819
+ factor?: number | undefined;
820
+ }, {
821
+ initialMs?: number | undefined;
822
+ maxMs?: number | undefined;
823
+ factor?: number | undefined;
824
+ }>>;
825
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
826
+ inheritEnv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
827
+ maxPendingStdinBytes: z.ZodOptional<z.ZodNumber>;
828
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
829
+ command: z.ZodString;
830
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
831
+ mode: z.ZodDefault<z.ZodEnum<["daemon", "oneshot", "stdio"]>>;
832
+ restartOnCrash: z.ZodDefault<z.ZodBoolean>;
833
+ maxRestarts: z.ZodOptional<z.ZodNumber>;
834
+ restartCooldown: z.ZodOptional<z.ZodNumber>;
835
+ restartBackoff: z.ZodOptional<z.ZodObject<{
836
+ initialMs: z.ZodOptional<z.ZodNumber>;
837
+ maxMs: z.ZodOptional<z.ZodNumber>;
838
+ factor: z.ZodOptional<z.ZodNumber>;
839
+ }, "strip", z.ZodTypeAny, {
840
+ initialMs?: number | undefined;
841
+ maxMs?: number | undefined;
842
+ factor?: number | undefined;
843
+ }, {
844
+ initialMs?: number | undefined;
845
+ maxMs?: number | undefined;
846
+ factor?: number | undefined;
847
+ }>>;
848
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
849
+ inheritEnv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
850
+ maxPendingStdinBytes: z.ZodOptional<z.ZodNumber>;
851
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
852
+ command: z.ZodString;
853
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
854
+ mode: z.ZodDefault<z.ZodEnum<["daemon", "oneshot", "stdio"]>>;
855
+ restartOnCrash: z.ZodDefault<z.ZodBoolean>;
856
+ maxRestarts: z.ZodOptional<z.ZodNumber>;
857
+ restartCooldown: z.ZodOptional<z.ZodNumber>;
858
+ restartBackoff: z.ZodOptional<z.ZodObject<{
859
+ initialMs: z.ZodOptional<z.ZodNumber>;
860
+ maxMs: z.ZodOptional<z.ZodNumber>;
861
+ factor: z.ZodOptional<z.ZodNumber>;
862
+ }, "strip", z.ZodTypeAny, {
863
+ initialMs?: number | undefined;
864
+ maxMs?: number | undefined;
865
+ factor?: number | undefined;
866
+ }, {
867
+ initialMs?: number | undefined;
868
+ maxMs?: number | undefined;
869
+ factor?: number | undefined;
870
+ }>>;
871
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
872
+ inheritEnv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
873
+ maxPendingStdinBytes: z.ZodOptional<z.ZodNumber>;
874
+ }, z.ZodTypeAny, "passthrough">>>>;
875
+ socket: z.ZodOptional<z.ZodObject<{
876
+ enabled: z.ZodBoolean;
877
+ port: z.ZodOptional<z.ZodNumber>;
878
+ adapter: z.ZodOptional<z.ZodEnum<["bun", "socket.io"]>>;
879
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
880
+ enabled: z.ZodBoolean;
881
+ port: z.ZodOptional<z.ZodNumber>;
882
+ adapter: z.ZodOptional<z.ZodEnum<["bun", "socket.io"]>>;
883
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
884
+ enabled: z.ZodBoolean;
885
+ port: z.ZodOptional<z.ZodNumber>;
886
+ adapter: z.ZodOptional<z.ZodEnum<["bun", "socket.io"]>>;
887
+ }, z.ZodTypeAny, "passthrough">>>;
888
+ kv: z.ZodOptional<z.ZodObject<{
889
+ driver: z.ZodEnum<["memory", "redis"]>;
890
+ connection: z.ZodOptional<z.ZodAny>;
891
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
892
+ driver: z.ZodEnum<["memory", "redis"]>;
893
+ connection: z.ZodOptional<z.ZodAny>;
894
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
895
+ driver: z.ZodEnum<["memory", "redis"]>;
896
+ connection: z.ZodOptional<z.ZodAny>;
897
+ }, z.ZodTypeAny, "passthrough">>>;
898
+ db: z.ZodOptional<z.ZodObject<{
899
+ driver: z.ZodEnum<["postgres", "mysql", "sqlite", "libsql"]>;
900
+ url: z.ZodString;
901
+ authToken: z.ZodOptional<z.ZodString>;
902
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
903
+ driver: z.ZodEnum<["postgres", "mysql", "sqlite", "libsql"]>;
904
+ url: z.ZodString;
905
+ authToken: z.ZodOptional<z.ZodString>;
906
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
907
+ driver: z.ZodEnum<["postgres", "mysql", "sqlite", "libsql"]>;
908
+ url: z.ZodString;
909
+ authToken: z.ZodOptional<z.ZodString>;
910
+ }, z.ZodTypeAny, "passthrough">>>;
911
+ }, z.ZodTypeAny, "passthrough">>;
330
912
  type AppConfigInput = z.input<typeof AppConfigSchema>;
331
913
  type AppConfigOutput = z.output<typeof AppConfigSchema>;
332
914
 
333
- export { App, type AppConfig, type AppConfigInput, type AppConfigOutput, AppConfigSchema, ConfigError, type Context, type Driver, DriverError, type ErrorCode, ErrorCodes, IskraError, type IskraErrorOptions, LifecycleError, type Logger, type OtelConfig, type Plugin, PluginError, type ProcessConfig, type RestartBackoffConfig, createLogger, initOtel, loadAppConfig, shutdownOtel };
915
+ export { App, type AppConfig, type AppConfigInput, type AppConfigOutput, AppConfigSchema, AppContext, type AppContextRegistry, type AppEvents, ConfigError, type Context, type Driver, DriverError, type ErrorCode, type ErrorCodeRegistry, ErrorCodes, IskraError, type IskraErrorOptions, LifecycleError, type Logger, type OtelConfig, type OtelResourcesModule, type Plugin, PluginError, type ProcessConfig, type RestartBackoffConfig, SECRET_QUERY_PARAMS, type TracedOptions, autoInstrumentationOptions, createLogger, createResource, describeOtelEndpoint, initOtel, isDevelopmentEnv, isProductionEnv, loadAppConfig, nodeEnv, redactUrl, shutdownOtel, traced };