@osfactory/otel-hook 0.8.0 → 0.10.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.
Files changed (52) hide show
  1. package/README.md +159 -2
  2. package/dist/{adapter-BJiz6lqM.d.ts → adapter-B9RwW6TO.d.ts} +14 -2
  3. package/dist/cli.js +2514 -1238
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config.d.ts +5 -2
  6. package/dist/config.js +479 -169
  7. package/dist/config.js.map +1 -1
  8. package/dist/destinations-DWOkVxV1.d.ts +169 -0
  9. package/dist/diagnostics.d.ts +8 -0
  10. package/dist/diagnostics.js +2 -1
  11. package/dist/diagnostics.js.map +1 -1
  12. package/dist/{events-B3MHoJTD.d.ts → events-CSD_YiJ2.d.ts} +2 -0
  13. package/dist/{otlp-log-sink-zuHojHSP.d.ts → export-destinations-lORbe25J.d.ts} +241 -9
  14. package/dist/{filesystem-store-r-nNA3BA.d.ts → filesystem-store-DX3dGIgu.d.ts} +1 -1
  15. package/dist/{hook-Dh8OO4Wa.d.ts → hook-BAxXoKsp.d.ts} +10 -5
  16. package/dist/index.d.ts +15 -14
  17. package/dist/index.js +1936 -730
  18. package/dist/index.js.map +1 -1
  19. package/dist/install.d.ts +4 -4
  20. package/dist/install.js +31 -2
  21. package/dist/install.js.map +1 -1
  22. package/dist/integration.d.ts +37 -12
  23. package/dist/integration.js +1942 -617
  24. package/dist/integration.js.map +1 -1
  25. package/dist/lifecycle.d.ts +3 -3
  26. package/dist/lifecycle.js +8 -1
  27. package/dist/lifecycle.js.map +1 -1
  28. package/dist/{memory-Bl9ANVff.d.ts → memory-aJilVG4R.d.ts} +2 -2
  29. package/dist/model.d.ts +1 -1
  30. package/dist/model.js +7 -0
  31. package/dist/model.js.map +1 -1
  32. package/dist/{payload-Ci8_ERm6.d.ts → payload-D7gc0-WQ.d.ts} +41 -2
  33. package/dist/{ports-n7KFOpKo.d.ts → ports-plO5MKrY.d.ts} +63 -2
  34. package/dist/providers.d.ts +146 -10
  35. package/dist/providers.js +397 -13
  36. package/dist/providers.js.map +1 -1
  37. package/dist/{registry-CIVvRlVK.d.ts → registry-C7XO4DzD.d.ts} +2 -2
  38. package/dist/runtime.d.ts +8 -8
  39. package/dist/runtime.js +1426 -1163
  40. package/dist/runtime.js.map +1 -1
  41. package/dist/{schema-Cn0-xz8L.d.ts → schema-CHb3GU1r.d.ts} +98 -3
  42. package/dist/{semconv-fPRb-dpU.d.ts → semconv-Dw7gcQcg.d.ts} +1 -1
  43. package/dist/state.d.ts +4 -4
  44. package/dist/state.js +607 -39
  45. package/dist/state.js.map +1 -1
  46. package/dist/telemetry.d.ts +23 -66
  47. package/dist/telemetry.js +637 -34
  48. package/dist/telemetry.js.map +1 -1
  49. package/dist/testing.d.ts +10 -8
  50. package/dist/testing.js +868 -560
  51. package/dist/testing.js.map +1 -1
  52. package/package.json +1 -1
@@ -0,0 +1,169 @@
1
+ import { z } from 'zod';
2
+ import { E as ExporterPolicy } from './schema-CHb3GU1r.js';
3
+
4
+ /**
5
+ * Export destinations: one batch, several OTLP endpoints.
6
+ *
7
+ * otel-hook is not a long-running process, so it cannot sit behind a proxy that
8
+ * fans out for it. Instead every enabled destination is sent the same batch by the
9
+ * same short-lived process, and what a destination could not take is kept in that
10
+ * destination's own spool for the next invocation.
11
+ *
12
+ * ## The `default` destination
13
+ *
14
+ * The single-endpoint settings that predate this list — `exporter.endpoint`,
15
+ * `exporter.logs.endpoint`, `exporter.protocol`, `--header`, and the standard
16
+ * `OTEL_EXPORTER_OTLP_*` variables that feed them — describe one destination
17
+ * named `default`. The name is therefore reserved: a `destinations[]` entry may
18
+ * not take it, so there is exactly one place that destination is configured.
19
+ *
20
+ * A configuration with no `destinations` resolves to that one destination and
21
+ * nothing else, exactly as before the list existed.
22
+ */
23
+ declare const DEFAULT_DESTINATION_NAME = "default";
24
+ /**
25
+ * Destination names become directory names (each destination spools on its own),
26
+ * so they are held to a lowercase, filesystem-safe vocabulary rather than being
27
+ * sanitized into something an operator would not recognize.
28
+ */
29
+ declare const DESTINATION_NAME_PATTERN: RegExp;
30
+ declare const MAX_EXPORT_DESTINATIONS = 16;
31
+ /** The same bound `OTEL_EXPORTER_OTLP_*HEADERS` and `exporter.headerNames` have. */
32
+ declare const MAX_DESTINATION_HEADERS = 32;
33
+ /** Prefix of a header value that names an environment variable instead of holding a value. */
34
+ declare const HEADER_ENV_REFERENCE_PREFIX = "env:";
35
+ declare const exportSignalSchema: z.ZodEnum<{
36
+ traces: "traces";
37
+ logs: "logs";
38
+ }>;
39
+ type ExportSignal = z.infer<typeof exportSignalSchema>;
40
+ declare const exportDestinationSchema: z.ZodObject<{
41
+ name: z.ZodString;
42
+ enabled: z.ZodOptional<z.ZodBoolean>;
43
+ endpoint: z.ZodOptional<z.ZodString>;
44
+ tracesEndpoint: z.ZodOptional<z.ZodString>;
45
+ logsEndpoint: z.ZodOptional<z.ZodString>;
46
+ protocol: z.ZodOptional<z.ZodEnum<{
47
+ none: "none";
48
+ "http/protobuf": "http/protobuf";
49
+ "http/json": "http/json";
50
+ }>>;
51
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
52
+ signals: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
53
+ traces: "traces";
54
+ logs: "logs";
55
+ }>>>>;
56
+ }, z.core.$strict>;
57
+ type ExportDestinationConfig = z.infer<typeof exportDestinationSchema>;
58
+ declare const exportDestinationsSchema: z.ZodReadonly<z.ZodArray<z.ZodObject<{
59
+ name: z.ZodString;
60
+ enabled: z.ZodOptional<z.ZodBoolean>;
61
+ endpoint: z.ZodOptional<z.ZodString>;
62
+ tracesEndpoint: z.ZodOptional<z.ZodString>;
63
+ logsEndpoint: z.ZodOptional<z.ZodString>;
64
+ protocol: z.ZodOptional<z.ZodEnum<{
65
+ none: "none";
66
+ "http/protobuf": "http/protobuf";
67
+ "http/json": "http/json";
68
+ }>>;
69
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
70
+ signals: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
71
+ traces: "traces";
72
+ logs: "logs";
73
+ }>>>>;
74
+ }, z.core.$strict>>>;
75
+ /**
76
+ * Bounds on each destination's retry spool, per signal.
77
+ *
78
+ * Every destination spools independently, so one long outage can only ever cost
79
+ * its own budget. When a bound is reached the *oldest* batches are dropped first —
80
+ * a recent batch is the one a reader is still likely to look for — and every drop
81
+ * is counted on disk so `doctor` can report it.
82
+ */
83
+ declare const spoolPolicySchema: z.ZodObject<{
84
+ maxBytes: z.ZodNumber;
85
+ maxAgeMillis: z.ZodNumber;
86
+ maxBatches: z.ZodNumber;
87
+ }, z.core.$strict>;
88
+ type SpoolPolicy = z.infer<typeof spoolPolicySchema>;
89
+ declare const DEFAULT_SPOOL_POLICY: SpoolPolicy;
90
+ /** The spool policy in force, with defaults filled in for any bound left unset. */
91
+ declare const effectiveSpoolPolicy: (exporter: ExporterPolicy) => SpoolPolicy;
92
+ /**
93
+ * One destination as the runtime sends to it.
94
+ *
95
+ * `headers` holds what the configuration holds — literal values and `env:`
96
+ * references, unresolved. Resolution against an environment happens only at the
97
+ * point of sending ({@link resolveDestinationHeaders}), and the `default`
98
+ * destination's header values never pass through configuration at all: they are
99
+ * handed to the runtime separately, as they always have been.
100
+ */
101
+ type ExportDestination = {
102
+ readonly name: string;
103
+ /** `exporter` for the `default` destination, `destinations` for a list entry. */
104
+ readonly source: "exporter" | "destinations";
105
+ readonly protocol: ExporterPolicy["protocol"];
106
+ /** Traces URL as configured; for `default` this is `exporter.endpoint`. */
107
+ readonly endpoint?: string;
108
+ readonly tracesEndpoint?: string;
109
+ readonly logsEndpoint?: string;
110
+ readonly signals: {
111
+ readonly traces: boolean;
112
+ readonly logs: boolean;
113
+ };
114
+ readonly headers: Readonly<Record<string, string>>;
115
+ };
116
+ /** Whether a configuration uses the destination list at all. */
117
+ declare const hasConfiguredDestinations: (exporter: ExporterPolicy) => boolean;
118
+ /**
119
+ * The destinations an exporter policy sends to, in a stable order: `default`
120
+ * first when present, then the list in file order.
121
+ *
122
+ * - No `destinations`: exactly one `default` destination, even when it has no
123
+ * endpoint — the sink then reports itself unconfigured, as it always has.
124
+ * - With `destinations`: `default` is included only when a single-endpoint setting
125
+ * actually names an endpoint, and disabled entries are left out.
126
+ */
127
+ declare const resolveExportDestinations: (exporter: ExporterPolicy) => readonly ExportDestination[];
128
+ /** A header value's meaning, without its content. */
129
+ type HeaderValueReference = {
130
+ readonly kind: "literal";
131
+ } | {
132
+ readonly kind: "env";
133
+ readonly variable: string;
134
+ };
135
+ declare const parseHeaderValueReference: (value: string) => HeaderValueReference;
136
+ type ResolvedDestinationHeaders = {
137
+ /** Header values ready to send. Never logged, never reported. */
138
+ readonly values: Readonly<Record<string, string>>;
139
+ /** Names of referenced environment variables that are unset or empty. */
140
+ readonly missingVariables: readonly string[];
141
+ };
142
+ /**
143
+ * Resolve `env:` references against an explicitly supplied environment.
144
+ *
145
+ * Pure: the process environment is never read implicitly. An unset or empty
146
+ * variable is reported by *name* — the only part of a reference that is safe to
147
+ * say out loud — and its header is left out of `values`.
148
+ */
149
+ declare const resolveDestinationHeaders: (headers: Readonly<Record<string, string>>, environment: Readonly<Record<string, string | undefined>> | undefined) => ResolvedDestinationHeaders;
150
+ /**
151
+ * Attribute-safe description of one destination: names, origins, and variable
152
+ * names. Never a header value, and never an endpoint beyond its origin.
153
+ */
154
+ type DestinationDescription = {
155
+ readonly name: string;
156
+ readonly enabled: boolean;
157
+ readonly protocol: ExporterPolicy["protocol"];
158
+ readonly signals: readonly ExportSignal[];
159
+ readonly tracesEndpointOrigin?: string;
160
+ readonly logsEndpointOrigin?: string;
161
+ readonly headerNames: readonly string[];
162
+ /** Environment variables this destination's headers reference. */
163
+ readonly headerVariables: readonly string[];
164
+ };
165
+ declare const endpointOrigin: (endpoint: string | undefined) => string | undefined;
166
+ /** Every configured destination, disabled ones included, for `doctor` and snapshots. */
167
+ declare const describeExportDestinations: (exporter: ExporterPolicy) => readonly DestinationDescription[];
168
+
169
+ export { DEFAULT_DESTINATION_NAME as D, type ExportDestination as E, HEADER_ENV_REFERENCE_PREFIX as H, MAX_DESTINATION_HEADERS as M, type ResolvedDestinationHeaders as R, type SpoolPolicy as S, DEFAULT_SPOOL_POLICY as a, DESTINATION_NAME_PATTERN as b, type DestinationDescription as c, type ExportDestinationConfig as d, type ExportSignal as e, type HeaderValueReference as f, MAX_EXPORT_DESTINATIONS as g, describeExportDestinations as h, effectiveSpoolPolicy as i, endpointOrigin as j, exportDestinationSchema as k, exportDestinationsSchema as l, exportSignalSchema as m, hasConfiguredDestinations as n, resolveExportDestinations as o, parseHeaderValueReference as p, resolveDestinationHeaders as r, spoolPolicySchema as s };
@@ -29,10 +29,18 @@ type DeliveryHealthSnapshot = {
29
29
  readonly lastSuccessAt?: EpochMillis;
30
30
  readonly lastFailureAt?: EpochMillis;
31
31
  readonly lastErrorCode?: OtelHookErrorCode;
32
+ /**
33
+ * Export destination this snapshot describes. Present only when
34
+ * `exporter.destinations` is in use, so a single-destination snapshot is
35
+ * unchanged.
36
+ */
37
+ readonly destination?: string;
32
38
  };
33
39
  type HealthTrackerOptions = {
34
40
  /** Consecutive failures at or beyond this count flip `healthy` to false. Default 3. */
35
41
  readonly unhealthyAfterConsecutiveFailures?: number;
42
+ /** Labels every snapshot with an export destination name. */
43
+ readonly destination?: string;
36
44
  };
37
45
  /**
38
46
  * Accumulates success/failure counts for one subsystem instance.
@@ -31,7 +31,8 @@ var createHealthTracker = (subsystem, options = {}) => {
31
31
  consecutiveFailures,
32
32
  ...lastSuccessAt === void 0 ? {} : { lastSuccessAt },
33
33
  ...lastFailureAt === void 0 ? {} : { lastFailureAt },
34
- ...lastErrorCode === void 0 ? {} : { lastErrorCode }
34
+ ...lastErrorCode === void 0 ? {} : { lastErrorCode },
35
+ ...options.destination === void 0 ? {} : { destination: options.destination }
35
36
  })
36
37
  };
37
38
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/diagnostics/health.ts"],"sourcesContent":["import type { OtelHookErrorCode } from \"../errors/index.js\";\nimport type { EpochMillis } from \"../model/primitives.js\";\n\n/**\n * One tracked delivery path.\n *\n * The two telemetry signals are separate subsystems because they fail\n * independently — a collector with no logs receiver leaves traces perfectly\n * healthy — and a single combined verdict would make an operator bisect which one\n * is broken. `telemetry-sink` remains the traces signal, unrenamed, so an existing\n * `doctor --json` consumer keeps reading the same field.\n */\nexport type DeliverySubsystem =\n | \"state-store\"\n | \"telemetry-sink\"\n | \"telemetry-log-sink\"\n | \"lifecycle\";\n\n/**\n * Sanitized delivery health.\n *\n * Every field is a count, a timestamp, a boolean, or a closed-vocabulary error\n * code — the same restriction the privacy service applies to everything else\n * that might reach a sink, so a health snapshot is itself safe to export or log\n * without a second review.\n */\nexport type DeliveryHealthSnapshot = {\n readonly subsystem: DeliverySubsystem;\n readonly healthy: boolean;\n readonly totalAccepted: number;\n readonly totalRejected: number;\n readonly consecutiveFailures: number;\n readonly lastSuccessAt?: EpochMillis;\n readonly lastFailureAt?: EpochMillis;\n readonly lastErrorCode?: OtelHookErrorCode;\n};\n\nexport type HealthTrackerOptions = {\n /** Consecutive failures at or beyond this count flip `healthy` to false. Default 3. */\n readonly unhealthyAfterConsecutiveFailures?: number;\n};\n\n/**\n * Accumulates success/failure counts for one subsystem instance.\n *\n * Deliberately per-instance rather than a module-level registry: a store or\n * sink constructs its own tracker and exposes a `health()` accessor, so two\n * instances in one process never share counters (see ADR 0001 on module-level\n * identity).\n */\nexport interface HealthTracker {\n recordSuccess(count?: number, at?: number): void;\n recordFailure(code: OtelHookErrorCode, count?: number, at?: number): void;\n snapshot(): DeliveryHealthSnapshot;\n}\n\nexport const createHealthTracker = (\n subsystem: DeliverySubsystem,\n options: HealthTrackerOptions = {},\n): HealthTracker => {\n const unhealthyThreshold = options.unhealthyAfterConsecutiveFailures ?? 3;\n let totalAccepted = 0;\n let totalRejected = 0;\n let consecutiveFailures = 0;\n let lastSuccessAt: number | undefined;\n let lastFailureAt: number | undefined;\n let lastErrorCode: OtelHookErrorCode | undefined;\n\n return {\n recordSuccess: (count = 1, at?: number): void => {\n totalAccepted += count;\n consecutiveFailures = 0;\n if (at !== undefined) {\n lastSuccessAt = at;\n }\n },\n recordFailure: (code: OtelHookErrorCode, count = 1, at?: number): void => {\n totalRejected += count;\n consecutiveFailures += 1;\n lastErrorCode = code;\n if (at !== undefined) {\n lastFailureAt = at;\n }\n },\n snapshot: (): DeliveryHealthSnapshot => ({\n subsystem,\n healthy: consecutiveFailures < unhealthyThreshold,\n totalAccepted,\n totalRejected,\n consecutiveFailures,\n ...(lastSuccessAt === undefined ? {} : { lastSuccessAt }),\n ...(lastFailureAt === undefined ? {} : { lastFailureAt }),\n ...(lastErrorCode === undefined ? {} : { lastErrorCode }),\n }),\n };\n};\n\nexport type OverallHealth = {\n readonly healthy: boolean;\n readonly subsystems: readonly DeliveryHealthSnapshot[];\n};\n\n/** Combines snapshots from every configured subsystem into one overall verdict. */\nexport const summarizeHealth = (snapshots: readonly DeliveryHealthSnapshot[]): OverallHealth => ({\n healthy: snapshots.every((snapshot) => snapshot.healthy),\n subsystems: [...snapshots],\n});\n"],"mappings":";AAwDO,IAAM,sBAAsB,CACjC,WACA,UAAgC,CAAC,MACf;AAClB,QAAM,qBAAqB,QAAQ,qCAAqC;AACxE,MAAI,gBAAgB;AACpB,MAAI,gBAAgB;AACpB,MAAI,sBAAsB;AAC1B,MAAI;AACJ,MAAI;AACJ,MAAI;AAEJ,SAAO;AAAA,IACL,eAAe,CAAC,QAAQ,GAAG,OAAsB;AAC/C,uBAAiB;AACjB,4BAAsB;AACtB,UAAI,OAAO,QAAW;AACpB,wBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,IACA,eAAe,CAAC,MAAyB,QAAQ,GAAG,OAAsB;AACxE,uBAAiB;AACjB,6BAAuB;AACvB,sBAAgB;AAChB,UAAI,OAAO,QAAW;AACpB,wBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,IACA,UAAU,OAA+B;AAAA,MACvC;AAAA,MACA,SAAS,sBAAsB;AAAA,MAC/B;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAI,kBAAkB,SAAY,CAAC,IAAI,EAAE,cAAc;AAAA,MACvD,GAAI,kBAAkB,SAAY,CAAC,IAAI,EAAE,cAAc;AAAA,MACvD,GAAI,kBAAkB,SAAY,CAAC,IAAI,EAAE,cAAc;AAAA,IACzD;AAAA,EACF;AACF;AAQO,IAAM,kBAAkB,CAAC,eAAiE;AAAA,EAC/F,SAAS,UAAU,MAAM,CAAC,aAAa,SAAS,OAAO;AAAA,EACvD,YAAY,CAAC,GAAG,SAAS;AAC3B;","names":[]}
1
+ {"version":3,"sources":["../src/diagnostics/health.ts"],"sourcesContent":["import type { OtelHookErrorCode } from \"../errors/index.js\";\nimport type { EpochMillis } from \"../model/primitives.js\";\n\n/**\n * One tracked delivery path.\n *\n * The two telemetry signals are separate subsystems because they fail\n * independently — a collector with no logs receiver leaves traces perfectly\n * healthy — and a single combined verdict would make an operator bisect which one\n * is broken. `telemetry-sink` remains the traces signal, unrenamed, so an existing\n * `doctor --json` consumer keeps reading the same field.\n */\nexport type DeliverySubsystem =\n | \"state-store\"\n | \"telemetry-sink\"\n | \"telemetry-log-sink\"\n | \"lifecycle\";\n\n/**\n * Sanitized delivery health.\n *\n * Every field is a count, a timestamp, a boolean, or a closed-vocabulary error\n * code — the same restriction the privacy service applies to everything else\n * that might reach a sink, so a health snapshot is itself safe to export or log\n * without a second review.\n */\nexport type DeliveryHealthSnapshot = {\n readonly subsystem: DeliverySubsystem;\n readonly healthy: boolean;\n readonly totalAccepted: number;\n readonly totalRejected: number;\n readonly consecutiveFailures: number;\n readonly lastSuccessAt?: EpochMillis;\n readonly lastFailureAt?: EpochMillis;\n readonly lastErrorCode?: OtelHookErrorCode;\n /**\n * Export destination this snapshot describes. Present only when\n * `exporter.destinations` is in use, so a single-destination snapshot is\n * unchanged.\n */\n readonly destination?: string;\n};\n\nexport type HealthTrackerOptions = {\n /** Consecutive failures at or beyond this count flip `healthy` to false. Default 3. */\n readonly unhealthyAfterConsecutiveFailures?: number;\n /** Labels every snapshot with an export destination name. */\n readonly destination?: string;\n};\n\n/**\n * Accumulates success/failure counts for one subsystem instance.\n *\n * Deliberately per-instance rather than a module-level registry: a store or\n * sink constructs its own tracker and exposes a `health()` accessor, so two\n * instances in one process never share counters (see ADR 0001 on module-level\n * identity).\n */\nexport interface HealthTracker {\n recordSuccess(count?: number, at?: number): void;\n recordFailure(code: OtelHookErrorCode, count?: number, at?: number): void;\n snapshot(): DeliveryHealthSnapshot;\n}\n\nexport const createHealthTracker = (\n subsystem: DeliverySubsystem,\n options: HealthTrackerOptions = {},\n): HealthTracker => {\n const unhealthyThreshold = options.unhealthyAfterConsecutiveFailures ?? 3;\n let totalAccepted = 0;\n let totalRejected = 0;\n let consecutiveFailures = 0;\n let lastSuccessAt: number | undefined;\n let lastFailureAt: number | undefined;\n let lastErrorCode: OtelHookErrorCode | undefined;\n\n return {\n recordSuccess: (count = 1, at?: number): void => {\n totalAccepted += count;\n consecutiveFailures = 0;\n if (at !== undefined) {\n lastSuccessAt = at;\n }\n },\n recordFailure: (code: OtelHookErrorCode, count = 1, at?: number): void => {\n totalRejected += count;\n consecutiveFailures += 1;\n lastErrorCode = code;\n if (at !== undefined) {\n lastFailureAt = at;\n }\n },\n snapshot: (): DeliveryHealthSnapshot => ({\n subsystem,\n healthy: consecutiveFailures < unhealthyThreshold,\n totalAccepted,\n totalRejected,\n consecutiveFailures,\n ...(lastSuccessAt === undefined ? {} : { lastSuccessAt }),\n ...(lastFailureAt === undefined ? {} : { lastFailureAt }),\n ...(lastErrorCode === undefined ? {} : { lastErrorCode }),\n ...(options.destination === undefined ? {} : { destination: options.destination }),\n }),\n };\n};\n\nexport type OverallHealth = {\n readonly healthy: boolean;\n readonly subsystems: readonly DeliveryHealthSnapshot[];\n};\n\n/** Combines snapshots from every configured subsystem into one overall verdict. */\nexport const summarizeHealth = (snapshots: readonly DeliveryHealthSnapshot[]): OverallHealth => ({\n healthy: snapshots.every((snapshot) => snapshot.healthy),\n subsystems: [...snapshots],\n});\n"],"mappings":";AAgEO,IAAM,sBAAsB,CACjC,WACA,UAAgC,CAAC,MACf;AAClB,QAAM,qBAAqB,QAAQ,qCAAqC;AACxE,MAAI,gBAAgB;AACpB,MAAI,gBAAgB;AACpB,MAAI,sBAAsB;AAC1B,MAAI;AACJ,MAAI;AACJ,MAAI;AAEJ,SAAO;AAAA,IACL,eAAe,CAAC,QAAQ,GAAG,OAAsB;AAC/C,uBAAiB;AACjB,4BAAsB;AACtB,UAAI,OAAO,QAAW;AACpB,wBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,IACA,eAAe,CAAC,MAAyB,QAAQ,GAAG,OAAsB;AACxE,uBAAiB;AACjB,6BAAuB;AACvB,sBAAgB;AAChB,UAAI,OAAO,QAAW;AACpB,wBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,IACA,UAAU,OAA+B;AAAA,MACvC;AAAA,MACA,SAAS,sBAAsB;AAAA,MAC/B;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAI,kBAAkB,SAAY,CAAC,IAAI,EAAE,cAAc;AAAA,MACvD,GAAI,kBAAkB,SAAY,CAAC,IAAI,EAAE,cAAc;AAAA,MACvD,GAAI,kBAAkB,SAAY,CAAC,IAAI,EAAE,cAAc;AAAA,MACvD,GAAI,QAAQ,gBAAgB,SAAY,CAAC,IAAI,EAAE,aAAa,QAAQ,YAAY;AAAA,IAClF;AAAA,EACF;AACF;AAQO,IAAM,kBAAkB,CAAC,eAAiE;AAAA,EAC/F,SAAS,UAAU,MAAM,CAAC,aAAa,SAAS,OAAO;AAAA,EACvD,YAAY,CAAC,GAAG,SAAS;AAC3B;","names":[]}
@@ -710,6 +710,7 @@ declare const generationEndEventSchema: z.ZodObject<{
710
710
  disagrees: "disagrees";
711
711
  }>;
712
712
  }, z.core.$strict>>;
713
+ usagePartial: z.ZodOptional<z.ZodBoolean>;
713
714
  cost: z.ZodOptional<z.ZodObject<{
714
715
  currency: z.ZodString;
715
716
  amount: z.ZodNumber;
@@ -1691,6 +1692,7 @@ declare const canonicalEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1691
1692
  disagrees: "disagrees";
1692
1693
  }>;
1693
1694
  }, z.core.$strict>>;
1695
+ usagePartial: z.ZodOptional<z.ZodBoolean>;
1694
1696
  cost: z.ZodOptional<z.ZodObject<{
1695
1697
  currency: z.ZodString;
1696
1698
  amount: z.ZodNumber;
@@ -1,14 +1,15 @@
1
- import { InstrumentationScope } from '@opentelemetry/core';
2
- import { E as ExporterPolicy } from './schema-Cn0-xz8L.js';
3
- import { DeliveryHealthSnapshot } from './diagnostics.js';
4
- import { C as Clock, d as Logger, g as TelemetrySink } from './ports-n7KFOpKo.js';
1
+ import { E as ExportDestination } from './destinations-DWOkVxV1.js';
2
+ import { E as ExporterPolicy } from './schema-CHb3GU1r.js';
3
+ import { C as Clock, d as Logger, i as TelemetrySink } from './ports-plO5MKrY.js';
5
4
  import { Attributes } from '@opentelemetry/api';
6
5
  import { S as StoreNamespace } from './keys-Dej5bN3L.js';
7
- import { b as SpanCorrelationResolver, a as SpanCorrelation } from './semconv-fPRb-dpU.js';
6
+ import { InstrumentationScope } from '@opentelemetry/core';
8
7
  import { Resource } from '@opentelemetry/resources';
9
8
  import { ReadableLogRecord } from '@opentelemetry/sdk-logs';
10
9
  import { b as ContentFact } from './content-M9xIKG7h.js';
11
- import { b as CanonicalEvent, e as CanonicalEventType } from './events-B3MHoJTD.js';
10
+ import { b as CanonicalEvent, e as CanonicalEventType } from './events-CSD_YiJ2.js';
11
+ import { b as SpanCorrelationResolver, a as SpanCorrelation } from './semconv-Dw7gcQcg.js';
12
+ import { DeliveryHealthSnapshot } from './diagnostics.js';
12
13
 
13
14
  type SpoolEnqueueResult = {
14
15
  readonly spooled: true;
@@ -30,6 +31,48 @@ type SpoolDrainResult = {
30
31
  */
31
32
  readonly quarantined: number;
32
33
  };
34
+ /**
35
+ * Why a queued batch was dropped rather than delivered.
36
+ *
37
+ * - `age` — older than the queue's `maxAgeMillis`.
38
+ * - `size` — evicted (or refused) to stay within `maxBytes`.
39
+ * - `count` — evicted (or refused) to stay within the batch-count bound.
40
+ * - `rejected` — the destination answered with a non-retryable status on replay,
41
+ * so sending it again could never succeed.
42
+ */
43
+ type SpoolDropReason = "age" | "size" | "count" | "rejected";
44
+ /** Drop counts, persisted beside the queue so they outlive the process that dropped. */
45
+ type SpoolDropCounts = {
46
+ readonly total: number;
47
+ readonly age: number;
48
+ readonly size: number;
49
+ readonly count: number;
50
+ readonly rejected: number;
51
+ readonly lastDroppedAt?: number;
52
+ };
53
+ type SpoolStats = {
54
+ readonly batches: number;
55
+ readonly bytes: number;
56
+ /** Enqueue time of the oldest queued batch. Absent when the queue is empty. */
57
+ readonly oldestEnqueuedAt?: number;
58
+ readonly dropped: SpoolDropCounts;
59
+ };
60
+ /**
61
+ * What a queue does when a new batch would exceed a bound.
62
+ *
63
+ * `refuse-new` keeps what is queued and reports the new batch as lost — the
64
+ * original behavior, still the default for a queue built directly. `drop-oldest`
65
+ * evicts from the head until the new batch fits, which is what the runtime's
66
+ * per-destination spools use.
67
+ */
68
+ type SpoolOverflowPolicy = "refuse-new" | "drop-oldest";
69
+ /**
70
+ * What a drain's sender reports for one batch: delivered (`true`), still
71
+ * undeliverable and worth retrying (`false`), or permanently undeliverable
72
+ * (`"discard"`), which removes it and counts it as a `rejected` drop instead of
73
+ * stopping the drain behind it.
74
+ */
75
+ type SpoolSendOutcome = boolean | "discard";
33
76
 
34
77
  type SerializedSpan = {
35
78
  readonly name: string;
@@ -61,6 +104,17 @@ type DurableSpoolOptions = StoreNamespace & {
61
104
  readonly logger?: Logger;
62
105
  /** Refuses new entries once this many are queued, rather than growing without bound. Default 500. */
63
106
  readonly maxSpoolFiles?: number;
107
+ /**
108
+ * Queue directory below the identity namespace. Default `spool`; each
109
+ * export destination other than `default` gets its own.
110
+ */
111
+ readonly queueName?: string;
112
+ /** Bound on total queued bytes. Unbounded when absent. */
113
+ readonly maxBytes?: number;
114
+ /** Batches older than this are dropped rather than sent. No age bound when absent. */
115
+ readonly maxAgeMillis?: number;
116
+ /** Default `refuse-new`, the original behavior. */
117
+ readonly overflow?: SpoolOverflowPolicy;
64
118
  };
65
119
  /**
66
120
  * Durable filesystem queue for export batches a collector could not accept.
@@ -77,10 +131,15 @@ type DurableSpoolOptions = StoreNamespace & {
77
131
  interface DurableSpool {
78
132
  enqueue(batch: SpoolBatch): Promise<SpoolEnqueueResult>;
79
133
  /** Sequential, bounded drain: stops after the first failed send, or after `maxBatches`. */
80
- drain(send: (batch: SpoolBatch) => Promise<boolean>, options?: {
134
+ drain(send: (batch: SpoolBatch) => Promise<SpoolSendOutcome>, options?: {
81
135
  readonly maxBatches?: number;
82
136
  }): Promise<SpoolDrainResult>;
83
137
  size(): Promise<number>;
138
+ /**
139
+ * Depth, bytes, and persisted drop counts. Optional so a host's own
140
+ * implementation of this interface keeps compiling; the file-backed one has it.
141
+ */
142
+ stats?(): Promise<SpoolStats>;
84
143
  }
85
144
  declare const createFileDurableSpool: (options: DurableSpoolOptions) => DurableSpool;
86
145
 
@@ -103,6 +162,12 @@ type OtlpTraceSinkOptions = {
103
162
  * layer keeps no dependency on lifecycle or on the state store (ADR 0006).
104
163
  */
105
164
  readonly correlate?: SpanCorrelationResolver;
165
+ /**
166
+ * Export destination this sink delivers to, when `exporter.destinations` is in
167
+ * use. Labels health snapshots, diagnostics, and log lines; absent, all three are
168
+ * exactly what a single-destination installation has always produced.
169
+ */
170
+ readonly destination?: string;
106
171
  };
107
172
  interface OtlpTelemetrySink extends TelemetrySink {
108
173
  health(): DeliveryHealthSnapshot;
@@ -347,6 +412,17 @@ type DurableLogSpoolOptions = StoreNamespace & {
347
412
  readonly logger?: Logger;
348
413
  /** Refuses new entries once this many are queued. Default 500. */
349
414
  readonly maxSpoolFiles?: number;
415
+ /**
416
+ * Queue directory below the identity namespace. Default `spool-logs`; each
417
+ * export destination other than `default` gets its own.
418
+ */
419
+ readonly queueName?: string;
420
+ /** Bound on total queued bytes. Unbounded when absent. */
421
+ readonly maxBytes?: number;
422
+ /** Batches older than this are dropped rather than sent. No age bound when absent. */
423
+ readonly maxAgeMillis?: number;
424
+ /** Default `refuse-new`, the original behavior. */
425
+ readonly overflow?: SpoolOverflowPolicy;
350
426
  };
351
427
  /**
352
428
  * Durable filesystem queue for log batches a collector could not accept.
@@ -361,10 +437,15 @@ type DurableLogSpoolOptions = StoreNamespace & {
361
437
  interface DurableLogSpool {
362
438
  enqueue(batch: LogSpoolBatch): Promise<SpoolEnqueueResult>;
363
439
  /** Sequential, bounded drain: stops after the first failed send, or after `maxBatches`. */
364
- drain(send: (batch: LogSpoolBatch) => Promise<boolean>, options?: {
440
+ drain(send: (batch: LogSpoolBatch) => Promise<SpoolSendOutcome>, options?: {
365
441
  readonly maxBatches?: number;
366
442
  }): Promise<SpoolDrainResult>;
367
443
  size(): Promise<number>;
444
+ /**
445
+ * Depth, bytes, and persisted drop counts. Optional so a host's own
446
+ * implementation of this interface keeps compiling; the file-backed one has it.
447
+ */
448
+ stats?(): Promise<SpoolStats>;
368
449
  }
369
450
  declare const createFileDurableLogSpool: (options: DurableLogSpoolOptions) => DurableLogSpool;
370
451
 
@@ -435,6 +516,8 @@ type OtlpLogSinkOptions = {
435
516
  * would record a start edge twice.
436
517
  */
437
518
  readonly correlate?: SpanCorrelationResolver;
519
+ /** Export destination this sink delivers to; see `OtlpTraceSinkOptions.destination`. */
520
+ readonly destination?: string;
438
521
  };
439
522
  interface OtlpLogTelemetrySink extends TelemetrySink {
440
523
  health(): DeliveryHealthSnapshot;
@@ -470,4 +553,153 @@ declare const describeLogsDeliverability: (exporter: ExporterPolicy) => LogsDeli
470
553
  */
471
554
  declare const createOtlpLogSink: (options: OtlpLogSinkOptions) => OtlpLogTelemetrySink;
472
555
 
473
- export { logSignalOf as A, logSignalsForLifecycleEvents as B, type ContentWithholdingReason as C, type DurableLogSpool as D, resolveLogsEndpoint as E, LOG_MAPPING_VERSION as L, MAX_LOG_BODY_CHARACTERS as M, NO_LOG_CONTENT as N, type OtlpLogSinkOptions as O, type SerializedLogRecord as S, type DurableLogSpoolOptions as a, type DurableSpool as b, type DurableSpoolOptions as c, LOG_SIGNALS as d, type LogContentPolicy as e, type LogMappingOptions as f, type LogMappingResult as g, type LogSignal as h, type LogSpoolBatch as i, type LogsDeliverability as j, MAX_LOG_RECORDS_PER_BATCH as k, MAX_LOG_RECORDS_PER_EVENT as l, MCP_TOOL_NAME_PATTERN as m, type OtlpLogTelemetrySink as n, type OtlpTelemetrySink as o, type OtlpTraceSinkOptions as p, type SerializedSpan as q, type SpoolBatch as r, type SpoolDrainResult as s, type SpoolEnqueueResult as t, canonicalEventsToLogRecords as u, createFileDurableLogSpool as v, createFileDurableSpool as w, createOtlpLogSink as x, createOtlpTraceSink as y, describeLogsDeliverability as z };
556
+ /**
557
+ * One canonical batch, two OTLP signals.
558
+ *
559
+ * A hook has a single {@link TelemetrySink} seam, and both signals map the *same*
560
+ * canonical events — so this fans one batch out rather than making the orchestrator
561
+ * aware that there is more than one destination.
562
+ *
563
+ * ## Durability adds up across signals
564
+ *
565
+ * The counts are summed rather than taken from the primary signal, because the
566
+ * caller's question is "may I commit this callback?" and the answer turns on whether
567
+ * *anything* reached a collector or a spool. Summing gives `classifyDurability`
568
+ * exactly the right inputs:
569
+ *
570
+ * - both signals delivered → `delivered`
571
+ * - neither delivered → `lost`, and the callback is safe to retry precisely because
572
+ * there is nothing to duplicate
573
+ * - one delivered and one did not → `partial`, which is terminal: retrying would
574
+ * re-export what the healthy signal already delivered, and a duplicate silently
575
+ * corrupts a total whereas a reported loss is a number somebody can act on
576
+ *
577
+ * A disabled sink accepts everything, so an installation with logs off behaves
578
+ * exactly as it did before logs existed.
579
+ *
580
+ * ## Correlation must be resolved once per batch
581
+ *
582
+ * Both sinks want the same pairing facts, and `SpanCorrelator.correlateBatch` is not
583
+ * a read — it records a start edge, marks a scope published, and takes the session
584
+ * lock to do it. Wrap the correlator in {@link shareCorrelationPerBatch} and give
585
+ * *the same wrapped function* to both sinks; `emit` here is sequential so the first
586
+ * sink resolves it and the second is served the memoized answer.
587
+ */
588
+ type SignalFanoutOptions = {
589
+ readonly traces: OtlpTelemetrySink;
590
+ readonly logs: OtlpLogTelemetrySink;
591
+ };
592
+ interface SignalFanoutSink extends TelemetrySink {
593
+ /** One snapshot per wired signal, in a stable order: traces, then logs. */
594
+ health(): readonly DeliveryHealthSnapshot[];
595
+ }
596
+ declare const createSignalFanout: (options: SignalFanoutOptions) => SignalFanoutSink;
597
+ /**
598
+ * Wrap a correlation resolver so one batch resolves at most once.
599
+ *
600
+ * Memoized on the identity of the `events` array, which is what makes it correct
601
+ * without a reset: every batch is a distinct array, so a new batch cannot be served
602
+ * a previous one's answer, and a retry of the *same* array deliberately is. The
603
+ * promise is cached rather than its value, so two callers arriving before the first
604
+ * resolution completes still share it.
605
+ *
606
+ * Exported because the one-call-per-batch property is a requirement of the
607
+ * correlator, not a convenience of the fanout: a host wiring its own pair of sinks
608
+ * needs to be able to express it too.
609
+ */
610
+ declare const shareCorrelationPerBatch: (correlate: SpanCorrelationResolver) => SpanCorrelationResolver;
611
+
612
+ /**
613
+ * Spool queue directories for one destination, below the identity namespace.
614
+ *
615
+ * `default` keeps the directories it has always had, so batches an earlier
616
+ * version queued are still drained after an upgrade. Every other destination
617
+ * queues under `destinations/<name>/`, so one destination's outage can never
618
+ * consume another's budget or be drained by another's sender.
619
+ */
620
+ declare const spoolQueueNamesFor: (destination: string) => {
621
+ readonly traces: string;
622
+ readonly logs: string;
623
+ };
624
+ /**
625
+ * The exporter policy one destination's sinks are built from.
626
+ *
627
+ * Everything but where and how to send — timeout, batch sizes, service identity,
628
+ * resource attributes, log content policy — is shared, so every destination
629
+ * receives the same spans. The `default` destination gets the policy unchanged.
630
+ */
631
+ declare const exporterPolicyForDestination: (exporter: ExporterPolicy, destination: ExportDestination) => ExporterPolicy;
632
+ /** The pair of sinks, and their spools, serving one destination. */
633
+ type ExportDestinationSinks = {
634
+ readonly name: string;
635
+ readonly traces: OtlpTelemetrySink;
636
+ readonly logs: OtlpLogTelemetrySink;
637
+ readonly spool?: DurableSpool;
638
+ readonly logSpool?: DurableLogSpool;
639
+ };
640
+ /** A destination left out of this invocation, and why — by name only. */
641
+ type SkippedExportDestination = {
642
+ readonly name: string;
643
+ readonly reason: "header-variable-missing";
644
+ /** Environment variable *names*; never a value. */
645
+ readonly missingVariables: readonly string[];
646
+ };
647
+ type ExportDestinationsOptions = {
648
+ readonly exporter: ExporterPolicy;
649
+ /**
650
+ * Header values for the `default` destination's traces: `--header` over
651
+ * `OTEL_EXPORTER_OTLP_TRACES_HEADERS` over `OTEL_EXPORTER_OTLP_HEADERS`, as
652
+ * resolved by `resolveOtlpHeaders`.
653
+ */
654
+ readonly defaultHeaders?: Readonly<Record<string, string>>;
655
+ /**
656
+ * Header values for the `default` destination's logs, when they differ from
657
+ * its traces' (`OTEL_EXPORTER_OTLP_LOGS_HEADERS`). Defaults to {@link defaultHeaders}.
658
+ */
659
+ readonly defaultLogHeaders?: Readonly<Record<string, string>>;
660
+ /**
661
+ * The environment `env:` header references resolve against. Never read
662
+ * implicitly; without it, a destination whose headers reference a variable is
663
+ * skipped and reported.
664
+ */
665
+ readonly headerEnvironment?: Readonly<Record<string, string | undefined>>;
666
+ readonly providerId: string;
667
+ readonly installationId: string;
668
+ readonly clock: Clock;
669
+ readonly logger?: Logger;
670
+ /** Root of the spool trees. Absent, nothing is spooled. */
671
+ readonly spoolRootDir?: string;
672
+ /** Whether the logs signal gets a spool at all; it is only built when logs are on. */
673
+ readonly logContent: LogContentPolicy;
674
+ readonly correlate?: SpanCorrelationResolver;
675
+ };
676
+ /**
677
+ * Build one sink pair per enabled destination.
678
+ *
679
+ * With no `exporter.destinations`, this is exactly the single `default`
680
+ * destination the runtime has always built: the same policy, the same header
681
+ * values, the same spool directories.
682
+ */
683
+ declare const createExportDestinationSinks: (options: ExportDestinationsOptions) => {
684
+ readonly destinations: readonly ExportDestinationSinks[];
685
+ readonly skipped: readonly SkippedExportDestination[];
686
+ };
687
+ /**
688
+ * One canonical batch, every destination, in parallel.
689
+ *
690
+ * Each destination is its own {@link createSignalFanout} (traces then logs, which
691
+ * must stay sequential so they share one correlation resolution); destinations run
692
+ * concurrently, each bounded by the exporter's own timeout, so a slow or dead
693
+ * destination costs at most that timeout and never another destination's delivery.
694
+ * A destination that throws is contained to a rejection of its own share.
695
+ *
696
+ * Counts are summed across destinations, which gives the durability decision the
697
+ * right inputs: everything delivered or spooled → `delivered`; nothing → `lost`
698
+ * and safe to retry; some → `partial`, terminal, because retrying would re-export
699
+ * to the destinations that already accepted.
700
+ *
701
+ * With one destination this returns that destination's fanout unchanged.
702
+ */
703
+ declare const createDestinationFanout: (destinations: readonly ExportDestinationSinks[]) => SignalFanoutSink;
704
+
705
+ export { type SpoolOverflowPolicy as A, type SpoolSendOutcome as B, type ContentWithholdingReason as C, type DurableLogSpool as D, type ExportDestinationSinks as E, type SpoolStats as F, canonicalEventsToLogRecords as G, createDestinationFanout as H, createExportDestinationSinks as I, createFileDurableLogSpool as J, createFileDurableSpool as K, LOG_MAPPING_VERSION as L, MAX_LOG_BODY_CHARACTERS as M, NO_LOG_CONTENT as N, type OtlpLogSinkOptions as O, createOtlpLogSink as P, createOtlpTraceSink as Q, createSignalFanout as R, type SerializedLogRecord as S, describeLogsDeliverability as T, exporterPolicyForDestination as U, logSignalOf as V, logSignalsForLifecycleEvents as W, resolveLogsEndpoint as X, shareCorrelationPerBatch as Y, spoolQueueNamesFor as Z, type DurableLogSpoolOptions as a, type DurableSpool as b, type DurableSpoolOptions as c, type ExportDestinationsOptions as d, LOG_SIGNALS as e, type LogContentPolicy as f, type LogMappingOptions as g, type LogMappingResult as h, type LogSignal as i, type LogSpoolBatch as j, type LogsDeliverability as k, MAX_LOG_RECORDS_PER_BATCH as l, MAX_LOG_RECORDS_PER_EVENT as m, MCP_TOOL_NAME_PATTERN as n, type OtlpLogTelemetrySink as o, type OtlpTelemetrySink as p, type OtlpTraceSinkOptions as q, type SerializedSpan as r, type SignalFanoutOptions as s, type SignalFanoutSink as t, type SkippedExportDestination as u, type SpoolBatch as v, type SpoolDrainResult as w, type SpoolDropCounts as x, type SpoolDropReason as y, type SpoolEnqueueResult as z };
@@ -1,4 +1,4 @@
1
- import { e as StateStore, C as Clock, d as Logger } from './ports-n7KFOpKo.js';
1
+ import { g as StateStore, C as Clock, d as Logger } from './ports-plO5MKrY.js';
2
2
  import { S as StoreNamespace } from './keys-Dej5bN3L.js';
3
3
 
4
4
  /**
@@ -1,13 +1,13 @@
1
1
  import { z } from 'zod';
2
- import { O as OtelHookConfig } from './schema-Cn0-xz8L.js';
2
+ import { O as OtelHookConfig } from './schema-CHb3GU1r.js';
3
3
  import { OtelHookErrorInfo } from './errors.js';
4
- import { b as CanonicalEvent, I as UsageTemporality, f as CanonicalUsage } from './events-B3MHoJTD.js';
4
+ import { b as CanonicalEvent, I as UsageTemporality, f as CanonicalUsage } from './events-CSD_YiJ2.js';
5
5
  import { I as IdentityClaim, W as WorkspaceIdentity, d as InvocationIdentity } from './identity-BrVBs901.js';
6
6
  import { h as SourceTransport, R as ResolvedProviderId, c as DetectionConfidence, d as EventId } from './primitives-CJ8-rn-f.js';
7
7
  import { P as PrivacyService } from './service-CbI9CObT.js';
8
- import { b as DeliveryIdentifierSupport, f as ProviderDeliveryClaim, j as ProviderHookResponse } from './adapter-BJiz6lqM.js';
9
- import { P as ProviderRegistry } from './registry-CIVvRlVK.js';
10
- import { I as IdGenerator, g as TelemetrySink, e as StateStore, C as Clock, d as Logger, W as WorktreeLocator } from './ports-n7KFOpKo.js';
8
+ import { b as DeliveryIdentifierSupport, f as ProviderDeliveryClaim, j as ProviderHookResponse } from './adapter-B9RwW6TO.js';
9
+ import { P as ProviderRegistry } from './registry-C7XO4DzD.js';
10
+ import { I as IdGenerator, i as TelemetrySink, g as StateStore, C as Clock, d as Logger, W as WorktreeLocator, P as PayloadEnricher } from './ports-plO5MKrY.js';
11
11
  import { A as AttributionOutcome, a as AttributionReason } from './taxonomy-DwhTtuWd.js';
12
12
 
13
13
  /**
@@ -287,6 +287,11 @@ type OtelHookDependencies = {
287
287
  readonly worktreeLocator?: WorktreeLocator;
288
288
  /** Ceiling on target resolution per callback. Default 50ms. */
289
289
  readonly targetResolutionBudgetMillis?: number;
290
+ /**
291
+ * Host-configured payload enrichers (see {@link PayloadEnricher}). Empty by
292
+ * default: nothing reads beyond the payload unless a host asks for it.
293
+ */
294
+ readonly payloadEnrichers?: readonly PayloadEnricher[];
290
295
  };
291
296
  /**
292
297
  * Minimal orchestrator wiring detection, identity, parsing, privacy checks,