@osfactory/otel-hook 0.1.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/LICENSE +21 -0
- package/README.md +1020 -0
- package/dist/adapter-DIgRACtL.d.ts +303 -0
- package/dist/cli.js +12607 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +233 -0
- package/dist/config.js +996 -0
- package/dist/config.js.map +1 -0
- package/dist/content-CoB7aNP1.d.ts +118 -0
- package/dist/diagnostics.d.ts +58 -0
- package/dist/diagnostics.js +46 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/errors.d.ts +91 -0
- package/dist/errors.js +322 -0
- package/dist/errors.js.map +1 -0
- package/dist/events-VxBnDFaO.d.ts +2044 -0
- package/dist/filesystem-store-J8jjDMTh.d.ts +65 -0
- package/dist/hook-CGpo-vks.d.ts +292 -0
- package/dist/identity-BrVBs901.d.ts +227 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +11798 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +1021 -0
- package/dist/install.js +3271 -0
- package/dist/install.js.map +1 -0
- package/dist/integration.d.ts +303 -0
- package/dist/integration.js +5942 -0
- package/dist/integration.js.map +1 -0
- package/dist/keys-Dej5bN3L.d.ts +7 -0
- package/dist/lifecycle.d.ts +428 -0
- package/dist/lifecycle.js +1077 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/memory-DXVBc8V9.d.ts +94 -0
- package/dist/model.d.ts +45 -0
- package/dist/model.js +1023 -0
- package/dist/model.js.map +1 -0
- package/dist/otlp-log-sink-CeIFDDpn.d.ts +457 -0
- package/dist/payload-CHr53E_v.d.ts +201 -0
- package/dist/policy-D1CrlYn3.d.ts +73 -0
- package/dist/ports-Q8x0ODhs.d.ts +200 -0
- package/dist/primitives-CJ8-rn-f.d.ts +75 -0
- package/dist/privacy.d.ts +51 -0
- package/dist/privacy.js +633 -0
- package/dist/privacy.js.map +1 -0
- package/dist/providers.d.ts +257 -0
- package/dist/providers.js +4398 -0
- package/dist/providers.js.map +1 -0
- package/dist/registry-BzYmC9OC.d.ts +49 -0
- package/dist/runtime.d.ts +32 -0
- package/dist/runtime.js +2907 -0
- package/dist/runtime.js.map +1 -0
- package/dist/schema-Cn0-xz8L.d.ts +224 -0
- package/dist/semconv-Baoz-0OI.d.ts +188 -0
- package/dist/service-j4jEO6cZ.d.ts +68 -0
- package/dist/state.d.ts +36 -0
- package/dist/state.js +710 -0
- package/dist/state.js.map +1 -0
- package/dist/taxonomy-DwhTtuWd.d.ts +87 -0
- package/dist/telemetry.d.ts +77 -0
- package/dist/telemetry.js +2294 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/testing.d.ts +155 -0
- package/dist/testing.js +6513 -0
- package/dist/testing.js.map +1 -0
- package/package.json +124 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { d as StateStore, C as Clock, c as Logger } from './ports-Q8x0ODhs.js';
|
|
2
|
+
import { S as StoreNamespace } from './keys-Dej5bN3L.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Optional capability beyond the frozen {@link StateStore} contract: a
|
|
6
|
+
* session-scoped lock a caller can use to make a multi-step read-modify-write
|
|
7
|
+
* atomic across an entire session, not just a single key.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately keyed by an explicit `sessionId` the caller already knows,
|
|
10
|
+
* rather than derived by parsing the store's own keys, so a store never has
|
|
11
|
+
* to understand any particular key scheme.
|
|
12
|
+
*/
|
|
13
|
+
interface LockingStateStore extends StateStore {
|
|
14
|
+
withSessionLock<T>(sessionId: string, fn: () => Promise<T>, options?: {
|
|
15
|
+
readonly timeoutMillis?: number;
|
|
16
|
+
}): Promise<T>;
|
|
17
|
+
}
|
|
18
|
+
declare const isLockingStateStore: (store: StateStore) => store is LockingStateStore;
|
|
19
|
+
/** Runs `fn` under the store's session lock when it has one; otherwise runs it directly. */
|
|
20
|
+
declare const withOptionalSessionLock: <T>(store: StateStore, sessionId: string, fn: () => Promise<T>, options?: {
|
|
21
|
+
readonly timeoutMillis?: number;
|
|
22
|
+
}) => Promise<T>;
|
|
23
|
+
type StateStoreDependencies = {
|
|
24
|
+
readonly clock: Clock;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type FilesystemStateStoreOptions = StoreNamespace & {
|
|
28
|
+
readonly rootDir: string;
|
|
29
|
+
readonly clock: Clock;
|
|
30
|
+
readonly logger?: Logger;
|
|
31
|
+
/** Bounds how long a write, read, or session lock waits. Default 5,000ms. */
|
|
32
|
+
readonly lockTimeoutMillis?: number;
|
|
33
|
+
/** A lock file older than this is assumed to belong to a crashed process and is reclaimed. Default 30,000ms. */
|
|
34
|
+
readonly lockStaleMillis?: number;
|
|
35
|
+
/** Delay between lock acquisition attempts. Default 25ms. */
|
|
36
|
+
readonly lockPollIntervalMillis?: number;
|
|
37
|
+
};
|
|
38
|
+
interface FilesystemStateStore extends LockingStateStore {
|
|
39
|
+
readonly recordsDir: string;
|
|
40
|
+
readonly quarantineDir: string;
|
|
41
|
+
/** Bounded sweep: removes records untouched for longer than `maxAgeMillis`. */
|
|
42
|
+
pruneStale(maxAgeMillis: number, options?: {
|
|
43
|
+
readonly maxEntries?: number;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
readonly removed: number;
|
|
46
|
+
readonly scanned: number;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Crash-safe filesystem {@link StateStore}.
|
|
51
|
+
*
|
|
52
|
+
* Every write lands via a temp file plus `rename`, which POSIX guarantees is
|
|
53
|
+
* atomic within one directory: a reader never observes a half-written record,
|
|
54
|
+
* and a process killed mid-write leaves only an orphaned temp file, never a
|
|
55
|
+
* corrupt one. A record that still fails to parse (disk corruption, a manual
|
|
56
|
+
* edit, a future incompatible version) is quarantined rather than thrown from
|
|
57
|
+
* `read`, so a single bad file degrades one key instead of the whole store.
|
|
58
|
+
*
|
|
59
|
+
* Locking is layered: an in-process {@link createAsyncLock} orders same-process
|
|
60
|
+
* callers, and a lock file with a staleness timeout orders across processes
|
|
61
|
+
* and recovers automatically if the holder crashed while holding it.
|
|
62
|
+
*/
|
|
63
|
+
declare const createFilesystemStateStore: (options: FilesystemStateStoreOptions) => FilesystemStateStore;
|
|
64
|
+
|
|
65
|
+
export { type FilesystemStateStore as F, type LockingStateStore as L, type StateStoreDependencies as S, type FilesystemStateStoreOptions as a, createFilesystemStateStore as c, isLockingStateStore as i, withOptionalSessionLock as w };
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { O as OtelHookConfig } from './schema-Cn0-xz8L.js';
|
|
3
|
+
import { OtelHookErrorInfo } from './errors.js';
|
|
4
|
+
import { b as CanonicalEvent, w as UsageTemporality, f as CanonicalUsage } from './events-VxBnDFaO.js';
|
|
5
|
+
import { I as IdentityClaim, W as WorkspaceIdentity, d as InvocationIdentity } from './identity-BrVBs901.js';
|
|
6
|
+
import { h as SourceTransport, R as ResolvedProviderId, c as DetectionConfidence, d as EventId } from './primitives-CJ8-rn-f.js';
|
|
7
|
+
import { P as PrivacyService } from './service-j4jEO6cZ.js';
|
|
8
|
+
import { b as DeliveryIdentifierSupport, f as ProviderDeliveryClaim, j as ProviderHookResponse } from './adapter-DIgRACtL.js';
|
|
9
|
+
import { P as ProviderRegistry } from './registry-BzYmC9OC.js';
|
|
10
|
+
import { I as IdGenerator, f as TelemetrySink, d as StateStore, C as Clock, c as Logger } from './ports-Q8x0ODhs.js';
|
|
11
|
+
import { A as AttributionOutcome, a as AttributionReason } from './taxonomy-DwhTtuWd.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Where a delivery identity came from.
|
|
15
|
+
*
|
|
16
|
+
* `host` is an id the embedding host passed in; `provider` is one normalized
|
|
17
|
+
* from payload fields the selected adapter vouched for. The two are kept
|
|
18
|
+
* distinguishable because they carry different guarantees: a host id is unique
|
|
19
|
+
* by construction, a provider-derived one is only as good as the adapter's
|
|
20
|
+
* evidence.
|
|
21
|
+
*/
|
|
22
|
+
type DeliveryOrigin = "host" | "provider";
|
|
23
|
+
/**
|
|
24
|
+
* A delivery identity reduced to the two opaque strings deduplication needs.
|
|
25
|
+
*
|
|
26
|
+
* Both are digests, never raw payload values. That matters because the pair
|
|
27
|
+
* becomes a state-store key and a diagnostic attribute: a provider's session id,
|
|
28
|
+
* tool-call id, or turn id would otherwise be written to disk and logged as a
|
|
29
|
+
* side effect of deduplication, which is not a disclosure anybody asked for.
|
|
30
|
+
*/
|
|
31
|
+
type ResolvedDeliveryIdentity = {
|
|
32
|
+
/** Namespace the callback id is unique within. */
|
|
33
|
+
readonly scope: string;
|
|
34
|
+
/** Opaque identity of this callback within that scope. */
|
|
35
|
+
readonly callbackId: string;
|
|
36
|
+
readonly origin: DeliveryOrigin;
|
|
37
|
+
/** Non-sensitive justifications, for diagnostics. Empty for a host id. */
|
|
38
|
+
readonly evidence: readonly string[];
|
|
39
|
+
};
|
|
40
|
+
/** Why no replay-stable delivery identity could be established. */
|
|
41
|
+
type DeliveryUnavailableReason =
|
|
42
|
+
/** No adapter was selected, so nothing could vouch for an identifier. */
|
|
43
|
+
"provider-unattributed"
|
|
44
|
+
/** The adapter declares that no callback of this provider carries one. */
|
|
45
|
+
| "provider-declares-none"
|
|
46
|
+
/** The adapter supports some callbacks, but not this one. */
|
|
47
|
+
| "callback-not-identifiable"
|
|
48
|
+
/** The adapter offered an identity that failed the contract's own guards. */
|
|
49
|
+
| "claim-rejected"
|
|
50
|
+
/**
|
|
51
|
+
* An identity was established but the state store could not be read or written,
|
|
52
|
+
* so nothing could be claimed against it.
|
|
53
|
+
*/
|
|
54
|
+
| "state-unavailable";
|
|
55
|
+
type DeliveryResolution = {
|
|
56
|
+
readonly status: "resolved";
|
|
57
|
+
readonly identity: ResolvedDeliveryIdentity;
|
|
58
|
+
} | {
|
|
59
|
+
readonly status: "unavailable";
|
|
60
|
+
readonly reason: DeliveryUnavailableReason;
|
|
61
|
+
/** Present once a provider has been selected. */
|
|
62
|
+
readonly providerId?: string;
|
|
63
|
+
/** The adapter's declared coverage, when there is an adapter. */
|
|
64
|
+
readonly capability?: DeliveryIdentifierSupport;
|
|
65
|
+
/**
|
|
66
|
+
* The provider's own name for the callback that could not be identified.
|
|
67
|
+
*
|
|
68
|
+
* Taken from the detection, which already carries it into span attributes
|
|
69
|
+
* and provenance, so it discloses nothing new — and it is the difference
|
|
70
|
+
* between a diagnostic an operator can act on and one that only restates
|
|
71
|
+
* that something is missing.
|
|
72
|
+
*/
|
|
73
|
+
readonly sourceEventName?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Why, in the adapter's own words: a rejected claim's failure, or the
|
|
76
|
+
* per-callback gap the adapter documents. Never contains payload values.
|
|
77
|
+
*/
|
|
78
|
+
readonly detail?: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Namespace a host-supplied delivery id.
|
|
82
|
+
*
|
|
83
|
+
* Deliberately *not* scoped by session or installation: the host documented its
|
|
84
|
+
* id as unique between distinct callbacks, so narrowing the scope here would
|
|
85
|
+
* make a host id that repeats across two sessions stop being recognized as the
|
|
86
|
+
* redelivery the host said it was.
|
|
87
|
+
*/
|
|
88
|
+
declare const hostDeliveryIdentity: (callbackId: string, scope?: string) => ResolvedDeliveryIdentity;
|
|
89
|
+
/**
|
|
90
|
+
* Reduce an adapter's delivery claim to an opaque, replay-stable identity.
|
|
91
|
+
*
|
|
92
|
+
* Scoping runs provider id, installation, and the provider's own session id
|
|
93
|
+
* through the digest, so the same tool-call id observed by two installations, two
|
|
94
|
+
* providers, or two sessions is three different callbacks. The callback digest
|
|
95
|
+
* covers the event name and the adapter's components, so a `PreToolUse` and a
|
|
96
|
+
* `PostToolUse` sharing one `tool_use_id` stay distinct.
|
|
97
|
+
*
|
|
98
|
+
* The digest comes from the injected {@link IdGenerator}, which is
|
|
99
|
+
* content-addressed by default — that is precisely what makes the identity
|
|
100
|
+
* survive a process restart: a later process with the same namespace recomputes
|
|
101
|
+
* the identical pair without reading any state.
|
|
102
|
+
*/
|
|
103
|
+
declare const resolveDeliveryIdentity: (input: {
|
|
104
|
+
readonly ids: IdGenerator;
|
|
105
|
+
readonly providerId: string;
|
|
106
|
+
readonly installationId: string;
|
|
107
|
+
readonly claim: ProviderDeliveryClaim;
|
|
108
|
+
}) => ResolvedDeliveryIdentity;
|
|
109
|
+
|
|
110
|
+
declare const usageScopeSchema: z.ZodEnum<{
|
|
111
|
+
subagent: "subagent";
|
|
112
|
+
generation: "generation";
|
|
113
|
+
session: "session";
|
|
114
|
+
}>;
|
|
115
|
+
type UsageScope = z.infer<typeof usageScopeSchema>;
|
|
116
|
+
/**
|
|
117
|
+
* Which series a provider's cumulative counters accumulate over. Mirrors
|
|
118
|
+
* `ProviderCapabilities.cumulativeUsageSeries`, defaulting to `event-scope`
|
|
119
|
+
* for the adapters that do not declare one.
|
|
120
|
+
*/
|
|
121
|
+
type CumulativeUsageSeries = "event-scope" | "session-lifetime";
|
|
122
|
+
/**
|
|
123
|
+
* Delta usage derived for one event.
|
|
124
|
+
*
|
|
125
|
+
* Events keep whatever the provider reported. Deltas are produced alongside them
|
|
126
|
+
* rather than rewritten into them, so a cumulative report and its derived delta
|
|
127
|
+
* are both auditable.
|
|
128
|
+
*/
|
|
129
|
+
type UsageObservation = {
|
|
130
|
+
readonly eventId: EventId;
|
|
131
|
+
readonly sequence: number;
|
|
132
|
+
readonly scope: UsageScope;
|
|
133
|
+
readonly scopeKey: string;
|
|
134
|
+
readonly reportedTemporality: UsageTemporality;
|
|
135
|
+
readonly delta: CanonicalUsage;
|
|
136
|
+
/** True when the cumulative series restarted; see `cumulativeToDelta`. */
|
|
137
|
+
readonly resetDetected: boolean;
|
|
138
|
+
};
|
|
139
|
+
type HookIngestInput = {
|
|
140
|
+
/** Decoded provider payload. Only the selected adapter interprets it. */
|
|
141
|
+
readonly payload: unknown;
|
|
142
|
+
readonly transport: SourceTransport;
|
|
143
|
+
readonly environment?: Readonly<Record<string, string | undefined>>;
|
|
144
|
+
readonly providerHint?: string;
|
|
145
|
+
/** Caller-supplied identity claims, arbitrated with the adapter's claims. */
|
|
146
|
+
readonly identityClaims?: readonly IdentityClaim[];
|
|
147
|
+
/** Opaque consumer metadata; sanitized, then carried through unchanged. */
|
|
148
|
+
readonly consumerAttributes?: Readonly<Record<string, unknown>>;
|
|
149
|
+
readonly workspace?: WorkspaceIdentity;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* The terminal fate of one callback's telemetry, and the only thing a caller
|
|
153
|
+
* should base a commit-or-retry decision on.
|
|
154
|
+
*
|
|
155
|
+
* The distinction that matters is **any** versus **all**, not success versus
|
|
156
|
+
* failure. A batch is chunked before export, so it can be part accepted and part
|
|
157
|
+
* refused — and once a single span has reached a collector or the spool, retrying
|
|
158
|
+
* the callback would re-export that span. So a partial result is *terminal*: the
|
|
159
|
+
* callback is committed, the loss is reported, and nothing is retried. Only a
|
|
160
|
+
* result where nothing at all survived is safe to retry, precisely because there
|
|
161
|
+
* is nothing to duplicate.
|
|
162
|
+
*/
|
|
163
|
+
type DeliveryDurability =
|
|
164
|
+
/** Suppressed, or no events to export. There is nothing to lose or retry. */
|
|
165
|
+
"nothing-to-deliver"
|
|
166
|
+
/** Every span reached the collector or the spool. */
|
|
167
|
+
| "delivered"
|
|
168
|
+
/**
|
|
169
|
+
* Some spans survived and some did not. Terminal: committing loses the refused
|
|
170
|
+
* spans, retrying duplicates the accepted ones, and duplicating an accepted
|
|
171
|
+
* span silently corrupts a total while a reported loss can be acted on.
|
|
172
|
+
*/
|
|
173
|
+
| "partial"
|
|
174
|
+
/** Nothing survived, so a retry cannot duplicate anything. */
|
|
175
|
+
| "lost";
|
|
176
|
+
declare const classifyDurability: (input: {
|
|
177
|
+
readonly attempted: boolean;
|
|
178
|
+
readonly accepted: number;
|
|
179
|
+
readonly rejected: number;
|
|
180
|
+
}) => DeliveryDurability;
|
|
181
|
+
/** Whether this fate permits committing the callback and its accounting. */
|
|
182
|
+
declare const isCommittable: (durability: DeliveryDurability) => boolean;
|
|
183
|
+
type HookIngestOutcome = {
|
|
184
|
+
/**
|
|
185
|
+
* Always `true`. The hook cannot fail the host agent; look at `attribution`
|
|
186
|
+
* and `diagnostics` to see what actually happened (ADR 0004).
|
|
187
|
+
*/
|
|
188
|
+
readonly ok: true;
|
|
189
|
+
readonly attribution: AttributionOutcome;
|
|
190
|
+
readonly attributionReason?: AttributionReason;
|
|
191
|
+
readonly providerId: ResolvedProviderId;
|
|
192
|
+
readonly detectionConfidence: DetectionConfidence;
|
|
193
|
+
readonly identity?: InvocationIdentity;
|
|
194
|
+
readonly events: readonly CanonicalEvent[];
|
|
195
|
+
readonly usageObservations: readonly UsageObservation[];
|
|
196
|
+
/**
|
|
197
|
+
* OTLP records the sink accepted, summed over every wired signal.
|
|
198
|
+
*
|
|
199
|
+
* A count of *records*, never of canonical events: two edges of one lifecycle
|
|
200
|
+
* scope produce one span, and one event carrying three content facts produces
|
|
201
|
+
* three log records. With the logs signal enabled a batch therefore reports both
|
|
202
|
+
* signals' records here — which is what makes {@link durability} correct across
|
|
203
|
+
* them, and why nothing should read this as "how many events were observed".
|
|
204
|
+
*/
|
|
205
|
+
readonly emitted: number;
|
|
206
|
+
/**
|
|
207
|
+
* Records the sink could neither export nor durably spool.
|
|
208
|
+
*
|
|
209
|
+
* The distinction `emitted` cannot make: a successful spool enqueue counts as
|
|
210
|
+
* emitted, because the batch is safe on disk and a later invocation will retry
|
|
211
|
+
* it. A non-zero value here means those observations are **gone** unless the
|
|
212
|
+
* callback is delivered again — which is what lets a caller decide whether a
|
|
213
|
+
* delivery claim may be committed or has to be released for retry.
|
|
214
|
+
*/
|
|
215
|
+
readonly exportRejected: number;
|
|
216
|
+
/**
|
|
217
|
+
* The terminal fate of this callback's telemetry.
|
|
218
|
+
*
|
|
219
|
+
* The field a caller should branch on. `emitted` and `exportRejected` are the
|
|
220
|
+
* raw counts behind it; this is the decision they add up to, computed in one
|
|
221
|
+
* place so a caller cannot get the any-versus-all boundary wrong.
|
|
222
|
+
*/
|
|
223
|
+
readonly durability: DeliveryDurability;
|
|
224
|
+
readonly dropped: number;
|
|
225
|
+
readonly hookResponse: ProviderHookResponse;
|
|
226
|
+
readonly diagnostics: readonly OtelHookErrorInfo[];
|
|
227
|
+
};
|
|
228
|
+
type HookIngestOptions = {
|
|
229
|
+
/**
|
|
230
|
+
* Parse and answer the provider, but export nothing and mutate no canonical
|
|
231
|
+
* state.
|
|
232
|
+
*
|
|
233
|
+
* For a callback that deduplication has already identified as a redelivery.
|
|
234
|
+
* The adapter still runs, so the provider's protocol response comes from a real
|
|
235
|
+
* parse of the real payload rather than a guess — but the session sequence
|
|
236
|
+
* counter is not advanced and no cumulative usage baseline is rewritten,
|
|
237
|
+
* because both are *canonical state* and a redelivery is by definition not a
|
|
238
|
+
* new observation. Advancing the sequence would renumber every later event in
|
|
239
|
+
* the session and change its derived event id, which is exactly the
|
|
240
|
+
* replay-stability the dedup guard exists to protect.
|
|
241
|
+
*/
|
|
242
|
+
readonly suppress?: boolean;
|
|
243
|
+
};
|
|
244
|
+
/** Public runtime surface. */
|
|
245
|
+
interface OtelHook {
|
|
246
|
+
/**
|
|
247
|
+
* Report the replay-stable delivery identity of an input without ingesting it.
|
|
248
|
+
*
|
|
249
|
+
* Synchronous, side-effect free, and never throws. It exists as a separate
|
|
250
|
+
* step because deduplication has to decide *before* anything is exported or
|
|
251
|
+
* accounted, and `ingest` exports as part of its own work — a caller that
|
|
252
|
+
* learned the identity afterwards could only ever suppress a duplicate it had
|
|
253
|
+
* already sent. Only `detect` and `deliveryIdentity` run here; the payload is
|
|
254
|
+
* never parsed.
|
|
255
|
+
*/
|
|
256
|
+
resolveDelivery(input: HookIngestInput): DeliveryResolution;
|
|
257
|
+
/** Process one provider observation. Never throws, never rejects. */
|
|
258
|
+
ingest(input: HookIngestInput, options?: HookIngestOptions): Promise<HookIngestOutcome>;
|
|
259
|
+
/** Best-effort delivery of buffered telemetry. Never throws. */
|
|
260
|
+
flush(): Promise<void>;
|
|
261
|
+
/** Flush, then release resources. Never throws; idempotent. */
|
|
262
|
+
shutdown(): Promise<void>;
|
|
263
|
+
/** Resolved configuration in force. Read-only. */
|
|
264
|
+
readonly config: OtelHookConfig;
|
|
265
|
+
}
|
|
266
|
+
type OtelHookDependencies = {
|
|
267
|
+
readonly sink: TelemetrySink;
|
|
268
|
+
readonly stateStore: StateStore;
|
|
269
|
+
readonly config?: OtelHookConfig;
|
|
270
|
+
readonly registry?: ProviderRegistry;
|
|
271
|
+
readonly clock?: Clock;
|
|
272
|
+
readonly ids?: IdGenerator;
|
|
273
|
+
/** Overrides `config.privacy` when supplied; must already be configured. */
|
|
274
|
+
readonly privacy?: PrivacyService;
|
|
275
|
+
readonly logger?: Logger;
|
|
276
|
+
/**
|
|
277
|
+
* Namespace separating one deployment's derived delivery identities from
|
|
278
|
+
* another's. Not identity: it never reaches an event, and no session or
|
|
279
|
+
* workspace is derived from it. Defaults to `"default"`.
|
|
280
|
+
*/
|
|
281
|
+
readonly installationId?: string;
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Minimal orchestrator wiring detection, identity, parsing, privacy checks,
|
|
285
|
+
* usage derivation, and export.
|
|
286
|
+
*
|
|
287
|
+
* Every step is contained: a throwing adapter, an unavailable state store, or a
|
|
288
|
+
* rejecting sink degrades the telemetry, never the host agent.
|
|
289
|
+
*/
|
|
290
|
+
declare const createOtelHook: (deps: OtelHookDependencies) => OtelHook;
|
|
291
|
+
|
|
292
|
+
export { type CumulativeUsageSeries as C, type DeliveryDurability as D, type HookIngestInput as H, type OtelHook as O, type ResolvedDeliveryIdentity as R, type UsageObservation as U, type DeliveryOrigin as a, type DeliveryResolution as b, type DeliveryUnavailableReason as c, type HookIngestOptions as d, type HookIngestOutcome as e, type OtelHookDependencies as f, type UsageScope as g, classifyDurability as h, createOtelHook as i, hostDeliveryIdentity as j, isCommittable as k, resolveDeliveryIdentity as r, usageScopeSchema as u };
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { c as DetectionConfidence, j as WorkspaceId } from './primitives-CJ8-rn-f.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Where a workspace identifier came from.
|
|
6
|
+
*
|
|
7
|
+
* Ordered from most to least stable. The source is recorded so consumers can
|
|
8
|
+
* tell a repository-scoped identity from a directory-scoped one instead of
|
|
9
|
+
* assuming they are comparable.
|
|
10
|
+
*/
|
|
11
|
+
declare const workspaceKeySourceSchema: z.ZodEnum<{
|
|
12
|
+
unknown: "unknown";
|
|
13
|
+
"git-remote": "git-remote";
|
|
14
|
+
"git-root": "git-root";
|
|
15
|
+
"working-directory": "working-directory";
|
|
16
|
+
explicit: "explicit";
|
|
17
|
+
}>;
|
|
18
|
+
type WorkspaceKeySource = z.infer<typeof workspaceKeySourceSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* Privacy-safe workspace identity.
|
|
21
|
+
*
|
|
22
|
+
* Only opaque handles and explicitly allowed labels are modelled. There is no
|
|
23
|
+
* field for a filesystem path, so paths cannot be exported through this type.
|
|
24
|
+
*/
|
|
25
|
+
declare const workspaceIdentitySchema: z.ZodReadonly<z.ZodObject<{
|
|
26
|
+
workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
|
|
27
|
+
keySource: z.ZodEnum<{
|
|
28
|
+
unknown: "unknown";
|
|
29
|
+
"git-remote": "git-remote";
|
|
30
|
+
"git-root": "git-root";
|
|
31
|
+
"working-directory": "working-directory";
|
|
32
|
+
explicit: "explicit";
|
|
33
|
+
}>;
|
|
34
|
+
repositoryName: z.ZodOptional<z.ZodString>;
|
|
35
|
+
vcsBranchName: z.ZodOptional<z.ZodString>;
|
|
36
|
+
vcsRevisionId: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strict>>;
|
|
38
|
+
type WorkspaceIdentity = z.infer<typeof workspaceIdentitySchema>;
|
|
39
|
+
declare const UNKNOWN_WORKSPACE_ID: WorkspaceId;
|
|
40
|
+
declare const unknownWorkspaceIdentity: () => WorkspaceIdentity;
|
|
41
|
+
/**
|
|
42
|
+
* Provenance of an observation: which provider produced it and which adapter
|
|
43
|
+
* interpreted it, with the confidence of that attribution.
|
|
44
|
+
*/
|
|
45
|
+
declare const sourceProvenanceSchema: z.ZodReadonly<z.ZodObject<{
|
|
46
|
+
providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
|
|
47
|
+
providerVersion: z.ZodOptional<z.ZodString>;
|
|
48
|
+
adapterId: z.ZodString;
|
|
49
|
+
adapterVersion: z.ZodString;
|
|
50
|
+
detectionConfidence: z.ZodEnum<{
|
|
51
|
+
none: "none";
|
|
52
|
+
weak: "weak";
|
|
53
|
+
strong: "strong";
|
|
54
|
+
exact: "exact";
|
|
55
|
+
}>;
|
|
56
|
+
sourceEventName: z.ZodOptional<z.ZodString>;
|
|
57
|
+
transport: z.ZodEnum<{
|
|
58
|
+
"hook-stdin": "hook-stdin";
|
|
59
|
+
"cli-argument": "cli-argument";
|
|
60
|
+
"library-call": "library-call";
|
|
61
|
+
"test-fixture": "test-fixture";
|
|
62
|
+
}>;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
type SourceProvenance = z.infer<typeof sourceProvenanceSchema>;
|
|
65
|
+
/**
|
|
66
|
+
* Opaque, immutable metadata supplied by the embedding consumer.
|
|
67
|
+
*
|
|
68
|
+
* The library never interprets these values; it only carries and exports them.
|
|
69
|
+
*/
|
|
70
|
+
declare const consumerAttributesSchema: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
|
|
71
|
+
type ConsumerAttributes = z.infer<typeof consumerAttributesSchema>;
|
|
72
|
+
/**
|
|
73
|
+
* Immutable identity of a single hook invocation.
|
|
74
|
+
*
|
|
75
|
+
* Frozen on parse. There is deliberately no setter, no builder that mutates in
|
|
76
|
+
* place, and no module-level instance: identity is passed explicitly so two
|
|
77
|
+
* concurrent invocations can never observe each other's fields.
|
|
78
|
+
*/
|
|
79
|
+
declare const invocationIdentitySchema: z.ZodReadonly<z.ZodObject<{
|
|
80
|
+
invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
|
|
81
|
+
sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
|
|
82
|
+
parentInvocationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "InvocationId", "out">>;
|
|
83
|
+
rootSessionId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "SessionId", "out">>;
|
|
84
|
+
agentInstanceId: z.ZodOptional<z.ZodString>;
|
|
85
|
+
provenance: z.ZodReadonly<z.ZodObject<{
|
|
86
|
+
providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
|
|
87
|
+
providerVersion: z.ZodOptional<z.ZodString>;
|
|
88
|
+
adapterId: z.ZodString;
|
|
89
|
+
adapterVersion: z.ZodString;
|
|
90
|
+
detectionConfidence: z.ZodEnum<{
|
|
91
|
+
none: "none";
|
|
92
|
+
weak: "weak";
|
|
93
|
+
strong: "strong";
|
|
94
|
+
exact: "exact";
|
|
95
|
+
}>;
|
|
96
|
+
sourceEventName: z.ZodOptional<z.ZodString>;
|
|
97
|
+
transport: z.ZodEnum<{
|
|
98
|
+
"hook-stdin": "hook-stdin";
|
|
99
|
+
"cli-argument": "cli-argument";
|
|
100
|
+
"library-call": "library-call";
|
|
101
|
+
"test-fixture": "test-fixture";
|
|
102
|
+
}>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
workspace: z.ZodReadonly<z.ZodObject<{
|
|
105
|
+
workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
|
|
106
|
+
keySource: z.ZodEnum<{
|
|
107
|
+
unknown: "unknown";
|
|
108
|
+
"git-remote": "git-remote";
|
|
109
|
+
"git-root": "git-root";
|
|
110
|
+
"working-directory": "working-directory";
|
|
111
|
+
explicit: "explicit";
|
|
112
|
+
}>;
|
|
113
|
+
repositoryName: z.ZodOptional<z.ZodString>;
|
|
114
|
+
vcsBranchName: z.ZodOptional<z.ZodString>;
|
|
115
|
+
vcsRevisionId: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strict>>;
|
|
117
|
+
startedAt: z.ZodNumber;
|
|
118
|
+
consumerAttributes: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
|
|
119
|
+
}, z.core.$strict>>;
|
|
120
|
+
type InvocationIdentity = z.infer<typeof invocationIdentitySchema>;
|
|
121
|
+
/** Fields an identity claim may contribute. */
|
|
122
|
+
declare const identityClaimFieldsSchema: z.ZodObject<{
|
|
123
|
+
invocationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "InvocationId", "out">>;
|
|
124
|
+
sessionId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "SessionId", "out">>;
|
|
125
|
+
parentInvocationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "InvocationId", "out">>;
|
|
126
|
+
rootSessionId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "SessionId", "out">>;
|
|
127
|
+
agentInstanceId: z.ZodOptional<z.ZodString>;
|
|
128
|
+
workspace: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
129
|
+
workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
|
|
130
|
+
keySource: z.ZodEnum<{
|
|
131
|
+
unknown: "unknown";
|
|
132
|
+
"git-remote": "git-remote";
|
|
133
|
+
"git-root": "git-root";
|
|
134
|
+
"working-directory": "working-directory";
|
|
135
|
+
explicit: "explicit";
|
|
136
|
+
}>;
|
|
137
|
+
repositoryName: z.ZodOptional<z.ZodString>;
|
|
138
|
+
vcsBranchName: z.ZodOptional<z.ZodString>;
|
|
139
|
+
vcsRevisionId: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strict>>>;
|
|
141
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
142
|
+
}, z.core.$strict>;
|
|
143
|
+
type IdentityClaimFields = z.infer<typeof identityClaimFieldsSchema>;
|
|
144
|
+
/**
|
|
145
|
+
* A claim about invocation identity from one source.
|
|
146
|
+
*
|
|
147
|
+
* Claims are evidence, not truth. Resolution keeps the highest-confidence claim
|
|
148
|
+
* per field and refuses to merge disagreeing peers.
|
|
149
|
+
*/
|
|
150
|
+
declare const identityClaimSchema: z.ZodObject<{
|
|
151
|
+
source: z.ZodString;
|
|
152
|
+
confidence: z.ZodEnum<{
|
|
153
|
+
none: "none";
|
|
154
|
+
weak: "weak";
|
|
155
|
+
strong: "strong";
|
|
156
|
+
exact: "exact";
|
|
157
|
+
}>;
|
|
158
|
+
fields: z.ZodObject<{
|
|
159
|
+
invocationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "InvocationId", "out">>;
|
|
160
|
+
sessionId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "SessionId", "out">>;
|
|
161
|
+
parentInvocationId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "InvocationId", "out">>;
|
|
162
|
+
rootSessionId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "SessionId", "out">>;
|
|
163
|
+
agentInstanceId: z.ZodOptional<z.ZodString>;
|
|
164
|
+
workspace: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
165
|
+
workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
|
|
166
|
+
keySource: z.ZodEnum<{
|
|
167
|
+
unknown: "unknown";
|
|
168
|
+
"git-remote": "git-remote";
|
|
169
|
+
"git-root": "git-root";
|
|
170
|
+
"working-directory": "working-directory";
|
|
171
|
+
explicit: "explicit";
|
|
172
|
+
}>;
|
|
173
|
+
repositoryName: z.ZodOptional<z.ZodString>;
|
|
174
|
+
vcsBranchName: z.ZodOptional<z.ZodString>;
|
|
175
|
+
vcsRevisionId: z.ZodOptional<z.ZodString>;
|
|
176
|
+
}, z.core.$strict>>>;
|
|
177
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
}, z.core.$strict>;
|
|
180
|
+
type IdentityClaim = z.infer<typeof identityClaimSchema>;
|
|
181
|
+
type IdentityConflict = {
|
|
182
|
+
readonly field: keyof IdentityClaimFields;
|
|
183
|
+
readonly confidence: DetectionConfidence;
|
|
184
|
+
/** Rendered, non-sensitive representations of the disagreeing values. */
|
|
185
|
+
readonly values: readonly string[];
|
|
186
|
+
readonly sources: readonly string[];
|
|
187
|
+
};
|
|
188
|
+
type IdentityResolution = {
|
|
189
|
+
readonly status: "resolved";
|
|
190
|
+
readonly identity: InvocationIdentity;
|
|
191
|
+
} | {
|
|
192
|
+
readonly status: "conflict";
|
|
193
|
+
readonly conflicts: readonly IdentityConflict[];
|
|
194
|
+
} | {
|
|
195
|
+
readonly status: "incomplete";
|
|
196
|
+
readonly missing: readonly (keyof IdentityClaimFields)[];
|
|
197
|
+
} | {
|
|
198
|
+
readonly status: "invalid";
|
|
199
|
+
readonly issues: readonly string[];
|
|
200
|
+
};
|
|
201
|
+
type ResolveIdentityInput = {
|
|
202
|
+
readonly claims: readonly IdentityClaim[];
|
|
203
|
+
readonly provenance: SourceProvenance;
|
|
204
|
+
/** Used only for fields no claim provides and that have a safe default. */
|
|
205
|
+
readonly fallback?: {
|
|
206
|
+
readonly startedAt?: number;
|
|
207
|
+
readonly workspace?: WorkspaceIdentity;
|
|
208
|
+
};
|
|
209
|
+
readonly consumerAttributes?: Readonly<Record<string, unknown>>;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Resolve identity from claims, failing closed.
|
|
213
|
+
*
|
|
214
|
+
* Rules:
|
|
215
|
+
* 1. For each field, only claims at the highest confidence that provided it are
|
|
216
|
+
* considered. Lower-confidence claims never fill in or override.
|
|
217
|
+
* 2. Two distinct values at that highest confidence produce a `conflict`. The
|
|
218
|
+
* invocation is then not attributed at all — a mislabelled session is worse
|
|
219
|
+
* than a missing one.
|
|
220
|
+
* 3. `invocationId` and `sessionId` are mandatory. Missing either yields
|
|
221
|
+
* `incomplete`; neither is invented here.
|
|
222
|
+
* 4. `startedAt` and `workspace` may come from an explicit fallback, because a
|
|
223
|
+
* clock reading and an `unknown` workspace handle assert nothing false.
|
|
224
|
+
*/
|
|
225
|
+
declare const resolveInvocationIdentity: (input: ResolveIdentityInput) => IdentityResolution;
|
|
226
|
+
|
|
227
|
+
export { type ConsumerAttributes as C, type IdentityClaim as I, type ResolveIdentityInput as R, type SourceProvenance as S, UNKNOWN_WORKSPACE_ID as U, type WorkspaceIdentity as W, type IdentityClaimFields as a, type IdentityConflict as b, type IdentityResolution as c, type InvocationIdentity as d, type WorkspaceKeySource as e, consumerAttributesSchema as f, identityClaimSchema as g, invocationIdentitySchema as h, identityClaimFieldsSchema as i, workspaceKeySourceSchema as j, resolveInvocationIdentity as r, sourceProvenanceSchema as s, unknownWorkspaceIdentity as u, workspaceIdentitySchema as w };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export { CANONICAL_SCHEMA_VERSION, CanonicalSchemaVersion, EMPTY_EXTENSIONS, EXTENSION_KEY_PATTERN, Extensions, MAX_EXTENSION_ENTRIES, RESERVED_EXTENSION_NAMESPACES, canonicalSchemaVersionSchema, emptyExtensions, extensionKeyNamespace, extensionsSchema, isReservedExtensionNamespace, isValidExtensionKey } from './model.js';
|
|
2
|
+
export { A as AttributePrimitive, a as AttributeValue, b as Attributes, D as DETECTION_CONFIDENCE_RANK, c as DetectionConfidence, E as EpochMillis, d as EventId, I as InvocationId, M as MAX_ATTRIBUTE_ARRAY_LENGTH, e as MAX_ATTRIBUTE_STRING_LENGTH, f as MAX_IDENTIFIER_LENGTH, P as PROVIDER_ID_PATTERN, g as ProviderId, R as ResolvedProviderId, S as SessionId, h as SourceTransport, U as UNKNOWN_PROVIDER_ID, i as UnknownProviderId, W as WORKSPACE_ID_PATTERN, j as WorkspaceId, k as attributePrimitiveSchema, l as attributeValueSchema, m as attributesSchema, n as compareDetectionConfidence, o as detectionConfidenceSchema, p as durationMillisSchema, q as epochMillisSchema, r as eventIdSchema, s as invocationIdSchema, t as isUnknownProvider, u as nonEmptyStringSchema, v as providerIdSchema, w as resolvedProviderIdSchema, x as sequenceNumberSchema, y as sessionIdSchema, z as sourceTransportSchema, B as tokenCountSchema, C as workspaceIdSchema } from './primitives-CJ8-rn-f.js';
|
|
3
|
+
export { C as CONTENT_HASH_PATTERN, a as ContentDisclosure, b as ContentFact, c as ContentKind, d as ContentRole, e as contentDisclosureSchema, f as contentFactSchema, g as contentFactsSchema, h as contentKindSchema, i as contentRoleSchema, j as isContentFactConsistent } from './content-CoB7aNP1.js';
|
|
4
|
+
export { C as CANONICAL_EVENT_TYPES, a as CacheCreationAccounting, b as CanonicalEvent, c as CanonicalEventInput, d as CanonicalEventOfType, e as CanonicalEventType, f as CanonicalUsage, g as CompactionPerformedEvent, h as CostFacts, E as EMPTY_DELTA_USAGE, i as ErrorRaisedEvent, j as EventOutcome, k as EventValidationResult, G as GenerationEndEvent, l as GenerationStartEvent, M as ModelDescriptor, P as PromptSubmittedEvent, m as ProviderTotalAgreement, S as SessionEndEvent, n as SessionStartEvent, o as SubagentEndEvent, p as SubagentStartEvent, T as ToolEndEvent, q as ToolKind, r as ToolStartEvent, U as UsageDeltaResult, s as UsageNormalizationError, t as UsageNormalizationIssue, u as UsageNormalizationResult, v as UsageReport, w as UsageTemporality, x as addUsage, y as cacheCreationAccountingSchema, z as canonicalEventSchema, A as canonicalEventTypeSchema, B as canonicalUsageSchema, D as compactionPerformedEventSchema, F as compareEvents, H as costFactsSchema, I as cumulativeToDelta, J as errorRaisedEventSchema, K as eventUsage, L as generationEndEventSchema, N as generationStartEventSchema, O as modelDescriptorSchema, Q as normalizeUsage, R as normalizeUsageOrThrow, V as parseCanonicalEvent, W as promptSubmittedEventSchema, X as providerTotalAgreementSchema, Y as sessionEndEventSchema, Z as sessionStartEventSchema, _ as subagentEndEventSchema, $ as subagentStartEventSchema, a0 as toReport, a1 as toolEndEventSchema, a2 as toolKindSchema, a3 as toolStartEventSchema, a4 as usageReportSchema, a5 as usageTemporalitySchema, a6 as validateCanonicalEvent } from './events-VxBnDFaO.js';
|
|
5
|
+
export { C as ConsumerAttributes, I as IdentityClaim, a as IdentityClaimFields, b as IdentityConflict, c as IdentityResolution, d as InvocationIdentity, R as ResolveIdentityInput, S as SourceProvenance, U as UNKNOWN_WORKSPACE_ID, W as WorkspaceIdentity, e as WorkspaceKeySource, f as consumerAttributesSchema, i as identityClaimFieldsSchema, g as identityClaimSchema, h as invocationIdentitySchema, r as resolveInvocationIdentity, s as sourceProvenanceSchema, u as unknownWorkspaceIdentity, w as workspaceIdentitySchema, j as workspaceKeySourceSchema } from './identity-BrVBs901.js';
|
|
6
|
+
export { CreateErrorInfoInput, OtelHookError, OtelHookErrorInfo, createErrorInfo, describeThrown, errorInfoFromThrown, isOtelHookError, otelHookErrorInfoSchema } from './errors.js';
|
|
7
|
+
export { C as CONTENT_MODE_DISCLOSURE, a as ContentMode, D as DEFAULT_PRIVACY_LIMITS, b as DEFAULT_PRIVACY_POLICY, c as DEFAULT_SECRET_KEY_PATTERNS, d as DEFAULT_SECRET_VALUE_PATTERNS, P as PolicyResolution, e as PrivacyLimits, f as PrivacyPolicy, g as contentModeSchema, p as privacyLimitsSchema, h as privacyPolicySchema, r as resolvePrivacyPolicy } from './policy-D1CrlYn3.js';
|
|
8
|
+
export { D as DescribeContentInput, a as DescribeStructuredInput, P as PrivacyService, S as SanitizeExtensionsResult, b as SanitizeResult, c as SanitizeStats, d as SanitizedValue, e as createPrivacyService } from './service-j4jEO6cZ.js';
|
|
9
|
+
export { WorkspaceKeyInput, WorkspaceLabels, canonicalizeGitRemote, deriveWorkspaceIdentity } from './privacy.js';
|
|
10
|
+
export { CONFIG_SOURCE_PRECEDENCE, ConfigLayer, ConfigProvenance, ConfigResolution, ConfigSource, EMPTY_RESOURCE_ATTRIBUTES, ENVIRONMENT_VARIABLES, EnvironmentConfigResult, EnvironmentRecord, MAX_RESOURCE_ATTRIBUTES, MAX_RESOURCE_ATTRIBUTE_KEY_LENGTH, MAX_RESOURCE_ATTRIBUTE_VALUE_LENGTH, ParsedResourceAttributes, RESERVED_RESOURCE_ATTRIBUTE_KEYS, RESOURCE_ATTRIBUTE_KEY_PATTERN, RESOURCE_ATTRIBUTE_KEY_REJECTION_DETAIL, ResourceAttributeKeyRejection, ResourceAttributeValue, ResourceAttributes, checkResourceAttributeKey, configSourceSchema, describeResolvedConfig, describeResourceAttributeNames, isReservedResourceAttributeKey, isSecretResourceAttributeKey, parseEnvironmentConfig, parseResourceAttributesValue, resolveConfig, resourceAttributeValueSchema, resourceAttributesSchema, sanitizeResourceAttributes } from './config.js';
|
|
11
|
+
export { D as DEFAULT_CONFIG, a as DEFAULT_DETECTION_POLICY, b as DEFAULT_DIAGNOSTICS_POLICY, c as DEFAULT_EXPORTER_POLICY, d as DEFAULT_LOGS_POLICY, e as DetectionPolicy, f as DiagnosticsPolicy, E as ExporterPolicy, L as LogsPolicy, O as OtelHookConfig, g as OtelHookConfigPatch, h as detectionPolicySchema, i as diagnosticsPolicySchema, j as exporterPolicySchema, l as logsPolicySchema, o as otelHookConfigPatchSchema, k as otelHookConfigSchema } from './schema-Cn0-xz8L.js';
|
|
12
|
+
export { A as AdapterDescription, D as DELIVERY_COMPONENT_PATTERN, a as DELIVERY_GAP_REASON_PATTERN, b as DeliveryIdentifierSupport, M as MAX_DELIVERY_COMPONENTS, c as MAX_DELIVERY_GAPS, P as ProviderAdapter, d as ProviderCapabilities, e as ProviderContext, f as ProviderDeliveryClaim, g as ProviderDeliveryGaps, h as ProviderDetection, i as ProviderDetectionInput, j as ProviderHookResponse, k as ProviderHookResponseInput, l as ProviderIdentityInput, m as ProviderParseInput, n as ProviderParseResult, S as SILENT_HOOK_RESPONSE, o as adapterSupports, p as asProviderId, q as deliveryComponentSchema, r as deliveryGapReasonSchema, s as deliveryIdentifierSupportSchema, t as describeAdapter, u as providerCapabilitiesSchema, v as providerDeliveryClaimSchema, w as providerDeliveryGapsSchema, x as providerDetectionSchema, y as providerHookResponseSchema, z as readDeliveryClaim, B as readDeliveryGap, C as unknownDetection } from './adapter-DIgRACtL.js';
|
|
13
|
+
export { ANTIGRAVITY_PROMOTION_GATES, ANTIGRAVITY_PROVIDER_MATURITY, AntigravityProviderMaturity, CLAUDE_CODE_CAPABILITIES, CODEX_CAPABILITIES, CURSOR_ADAPTER_VERSION, CURSOR_CAPABILITIES, CanonicalEventDraft, ClaudeCodeAdapterOptions, CursorAdapterOptions, DELIVERY_IDENTIFIER_SUMMARY, DefaultRegistryOptions, EXPERIMENTAL_PROVIDER_IDS, EventFactory, EventFactoryInput, PROVIDER_DESCRIPTORS, ProviderCatalogEntry, ProviderDescriptor, ProviderMaturity, createClaudeCodeAdapter, createCodexAdapter, createCursorAdapter, createDefaultProviderRegistry, createEventFactory, describeProviderCatalog, findProviderDescriptor, isExperimentalProvider } from './providers.js';
|
|
14
|
+
export { B as BUILT_IN_PROVIDERS, D as DetectionCandidate, P as ProviderRegistry, R as RegistryDetectionResult, c as createProviderRegistry } from './registry-BzYmC9OC.js';
|
|
15
|
+
export { A as ANTIGRAVITY_CAPABILITIES, a as ANTIGRAVITY_HOOK_EVENT_NAMES, b as ANTIGRAVITY_PROVIDER_ID, c as AntigravityAdapterOptions, d as AntigravityHookEventName, C as CLAUDE_CODE_PROVIDER_ID, e as CLAUDE_HOOK_EVENT_NAMES, f as CODEX_ADAPTER_VERSION, g as CODEX_HOOK_EVENT_NAMES, h as CODEX_PROVIDER_ID, i as CURSOR_DECISION_EVENTS, j as CURSOR_HOOK_EVENT_NAMES, k as CURSOR_PROVIDER_ID, l as CURSOR_UNMODELLED_HOOK_EVENT_NAMES, m as ClaudeHookEventName, n as CodexHookEventName, o as CursorHookEventName, D as DEFAULT_GEMINI_CAPABILITIES, G as GEMINI_ADAPTER_VERSION, p as GEMINI_HOOK_EVENT_NAMES, q as GEMINI_PROVIDER_ID, r as GeminiAdapterOptions, s as GeminiHookEventName, t as createAntigravityAdapter, u as createGeminiCliAdapter } from './payload-CHr53E_v.js';
|
|
16
|
+
export { A as AppliedDelivery, C as Clock, E as EventIdSeed, I as IdGenerator, a as InvocationIdSeed, L as LOG_LEVEL_RANK, b as LogLevel, c as Logger, S as StateRecord, d as StateStore, e as StateValue, T as TelemetryEmitResult, f as TelemetrySink, g as appliedDeliverySchema, l as logLevelSchema, s as stateRecordSchema, h as stateValueSchema } from './ports-Q8x0ODhs.js';
|
|
17
|
+
export { D as DeterministicIdOptions, F as FixedClock, a as FixedClockOptions, I as InMemoryStateStore, b as InMemoryStateStoreOptions, L as LogRecord, R as RecordingLogger, c as RecordingTelemetrySink, d as RecordingTelemetrySinkOptions, e as createDeterministicIdGenerator, f as createFixedClock, g as createInMemoryStateStore, h as createNullTelemetrySink, i as createRandomIdGenerator, j as createRecordingLogger, k as createRecordingTelemetrySink, l as createSystemClock } from './memory-DXVBc8V9.js';
|
|
18
|
+
export { StderrLoggerOptions, createNullLogger, createStderrLogger } from './runtime.js';
|
|
19
|
+
export { C as CumulativeUsageSeries, D as DeliveryDurability, a as DeliveryOrigin, b as DeliveryResolution, c as DeliveryUnavailableReason, H as HookIngestInput, d as HookIngestOptions, e as HookIngestOutcome, O as OtelHook, f as OtelHookDependencies, R as ResolvedDeliveryIdentity, U as UsageObservation, g as UsageScope, h as classifyDurability, i as createOtelHook, j as hostDeliveryIdentity, k as isCommittable, r as resolveDeliveryIdentity, u as usageScopeSchema } from './hook-CGpo-vks.js';
|
|
20
|
+
export { CallbackDeduplicator, CallbackDeduplicatorDependencies, DedupCheckResult, DedupCleanupResult, DeliveryClaimOptions, DeliveryClaimOutcome, DeliveryClaimResult, LifecycleCleanupReport, LifecycleJanitor, LifecycleJanitorOptions, LifecycleScope, LifecycleSweepStats, RollupCleanupResult, SPAN_RECORD_VERSION, SpanCleanupResult, SpanCorrelationFacts, SpanCorrelator, SpanCorrelatorDependencies, SpanEndInput, SpanEndOrphanReason, SpanEndResult, SpanStartInput, SpanStartResult, UsageAccumulator, UsageAccumulatorDependencies, UsageAccumulatorKey, UsageAccumulatorSnapshot, createCallbackDeduplicator, createLifecycleJanitor, createSpanCorrelator, createUsageAccumulator } from './lifecycle.js';
|
|
21
|
+
export { S as StoreNamespace } from './keys-Dej5bN3L.js';
|
|
22
|
+
export { F as FilesystemStateStore, a as FilesystemStateStoreOptions, L as LockingStateStore, S as StateStoreDependencies, c as createFilesystemStateStore, i as isLockingStateStore, w as withOptionalSessionLock } from './filesystem-store-J8jjDMTh.js';
|
|
23
|
+
export { BoundedMemoryStateStore, BoundedMemoryStateStoreOptions, createBoundedMemoryStateStore } from './state.js';
|
|
24
|
+
export { D as DEFAULT_INSTRUMENTATION_SCOPE, E as EventTraceIdentity, M as MAX_RECOVERED_START_ATTRIBUTES, S as SemanticMappingOptions, a as SpanCorrelation, b as SpanCorrelationResolver, c as SpanDisposition, d as SpanFamily, e as SpanOrphanClassification, f as SpanPairing, g as SpanScopeRef, h as canonicalEventTraceIdentities, i as canonicalEventsToReadableSpans, p as parentScopeRefOf, s as spanScopeRefOf, j as startOnlySpanAttributes } from './semconv-Baoz-0OI.js';
|
|
25
|
+
export { C as ContentWithholdingReason, D as DurableLogSpool, a as DurableLogSpoolOptions, b as DurableSpool, c as DurableSpoolOptions, L as LOG_MAPPING_VERSION, d as LOG_SIGNALS, e as LogContentPolicy, f as LogMappingOptions, g as LogMappingResult, h as LogSignal, i as LogSpoolBatch, j as LogsDeliverability, M as MAX_LOG_BODY_CHARACTERS, k as MAX_LOG_RECORDS_PER_BATCH, l as MAX_LOG_RECORDS_PER_EVENT, m as MCP_TOOL_NAME_PATTERN, N as NO_LOG_CONTENT, O as OtlpLogSinkOptions, n as OtlpLogTelemetrySink, o as OtlpTelemetrySink, p as OtlpTraceSinkOptions, S as SerializedLogRecord, q as SerializedSpan, r as SpoolBatch, s as SpoolDrainResult, t as SpoolEnqueueResult, u as canonicalEventsToLogRecords, v as createFileDurableLogSpool, w as createFileDurableSpool, x as createOtlpLogSink, y as createOtlpTraceSink, z as describeLogsDeliverability, A as logSignalOf, B as logSignalsForLifecycleEvents, E as resolveLogsEndpoint } from './otlp-log-sink-CeIFDDpn.js';
|
|
26
|
+
export { SignalFanoutOptions, SignalFanoutSink, createSignalFanout, shareCorrelationPerBatch } from './telemetry.js';
|
|
27
|
+
export { DeliveryHealthSnapshot, DeliverySubsystem, HealthTracker, HealthTrackerOptions, OverallHealth, createHealthTracker, summarizeHealth } from './diagnostics.js';
|
|
28
|
+
export { DeliveryReport, HookProcessInput, HookProcessOutcome, HookRuntime, HookRuntimeDelivery, HookRuntimeOptions, HookShutdownReport, UsageRollup, createHookRuntime, minimumStaleClaimMillis } from './integration.js';
|
|
29
|
+
export { AntigravityHookCommandEntry, CLAUDE_HOOK_EVENTS_MODELLED, CLAUDE_REGISTRABLE_HOOK_EVENTS, CLAUDE_UNREGISTERED_HOOK_EVENTS, CODEX_HOOK_EVENTS_MODELLED, CODEX_REGISTRABLE_HOOK_EVENTS, CODEX_UNREGISTERED_HOOK_EVENTS, CURSOR_HOOKS_DOCUMENT_VERSION, CURSOR_HOOK_EVENTS_MODELLED, CURSOR_REGISTRABLE_HOOK_EVENTS, CURSOR_UNREGISTERED_HOOK_EVENTS, ClaudeHookRegistrationOptions, ClaudeHookRemovalOptions, CodexHookRegistrationOptions, CodexHookRemovalOptions, CodexHooksFeatureFlag, CommandHookEntry, CursorHookCommandEntry, CursorHookDocumentResult, CursorHookRemovalInput, DEFAULT_DOCUMENT_FORMAT, DEFAULT_MANAGED_COMMAND_MARKER, FileLockOptions, FileLockTimeoutError, GeminiHookCommandEntry, GeminiHookMatcherEntry, GeminiHooksSettings, HookDocumentAction, HookDocumentChange, HookDocumentConflict, HookGroupEntry, HookHandlerPredicate, InstallLocation, JsonDocumentFormat, MANAGED_HOOK_NAME, MANAGED_MARKER_REJECTION_DETAIL, MANAGED_MARKER_TOKEN, ManagedMarkerRejection, MergeAntigravityHookRegistrationInput, MergeAntigravityHookRegistrationResult, MergeCursorHookRegistrationInput, MergeGeminiHookResult, MergeNestedHookInput, NestedHookDocumentResult, PROVIDERS_WITHOUT_VERIFIED_LOCATION, PROVIDERS_WITH_VERIFIED_LOCATION, PROVIDER_INSTALL_LOCATIONS, PROVIDER_REGISTRATION_SUPPORT, PlanProviderRegistrationInput, PlanProviderRegistrationResult, ProviderRegistrationPlanner, ProviderRegistrationSupport, REGISTRATION_PLANNERS, REGISTRATION_SCOPES, ReadDocumentResult, RegisterGeminiHookOptions, RegistrationAction, RegistrationLifecycleRequest, RegistrationOutcome, RegistrationOutcomeStatus, RegistrationPlanInput, RegistrationRemovalInput, RegistrationReport, RegistrationScope, RemoveAntigravityHookRegistrationInput, RemoveGeminiHookOptions, RemoveNestedHookInput, SUPPORTED_REGISTRATION_PROVIDER_IDS, ScopeRoots, checkManagedMarker, defaultHookCommand, detectDocumentFormat, findInstallLocation, findRegistrationPlanner, findRegistrationSupport, lockPathFor, managedHookPredicate, mergeAntigravityHookRegistration, mergeClaudeHookRegistration, mergeCodexHookRegistration, mergeCursorHookRegistration, mergeGeminiHookRegistration, mergeNestedHookRegistration, planProviderRegistration, readAntigravityHookRegistrations, readClaudeHookRegistrations, readCodexHookRegistrations, readCodexHooksFeatureFlag, readCursorHookRegistrations, readGeminiHookRegistrations, readJsonDocument, readNestedHookRegistrations, removeAntigravityHookRegistration, removeClaudeHookRegistration, removeCodexHookRegistration, removeCursorHookRegistration, removeGeminiHookRegistration, removeNestedHookRegistrations, renderJsonDocument, resolveInstallPath, runRegistrationLifecycle, withFileLock, writeDocumentAtomically } from './install.js';
|
|
30
|
+
export { A as AttributionOutcome, a as AttributionReason, E as ERROR_TAXONOMY, b as ErrorCodeDescriptor, c as ErrorPhase, d as ErrorSeverity, F as FailurePosture, O as OtelHookErrorCode, e as attributionOutcomeSchema, f as attributionReasonSchema, g as describeErrorCode, h as errorPhaseSchema, i as errorSeveritySchema, j as failurePostureSchema, o as otelHookErrorCodeSchema } from './taxonomy-DwhTtuWd.js';
|
|
31
|
+
import 'zod';
|
|
32
|
+
import '@opentelemetry/api';
|
|
33
|
+
import '@opentelemetry/core';
|
|
34
|
+
import '@opentelemetry/resources';
|
|
35
|
+
import '@opentelemetry/sdk-trace';
|
|
36
|
+
import '@opentelemetry/sdk-logs';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Package version, kept in its own module so the CLI can report it without
|
|
40
|
+
* importing the whole library barrel (and every provider adapter with it).
|
|
41
|
+
*/
|
|
42
|
+
declare const VERSION = "0.1.0";
|
|
43
|
+
|
|
44
|
+
export { VERSION };
|