@osfactory/otel-hook 0.1.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{adapter-DIgRACtL.d.ts → adapter-DXpNtnaf.d.ts} +2 -2
  2. package/dist/cli.js +442 -134
  3. package/dist/cli.js.map +1 -1
  4. package/dist/config.d.ts +2 -2
  5. package/dist/config.js +5 -1
  6. package/dist/config.js.map +1 -1
  7. package/dist/{content-CoB7aNP1.d.ts → content-M9xIKG7h.d.ts} +8 -1
  8. package/dist/{hook-CGpo-vks.d.ts → hook-_mlO3akA.d.ts} +3 -3
  9. package/dist/index.d.ts +10 -10
  10. package/dist/index.js +443 -134
  11. package/dist/index.js.map +1 -1
  12. package/dist/install.d.ts +5 -5
  13. package/dist/install.js +33 -0
  14. package/dist/install.js.map +1 -1
  15. package/dist/integration.d.ts +8 -8
  16. package/dist/integration.js +115 -39
  17. package/dist/integration.js.map +1 -1
  18. package/dist/lifecycle.d.ts +1 -1
  19. package/dist/lifecycle.js +5 -3
  20. package/dist/lifecycle.js.map +1 -1
  21. package/dist/model.d.ts +1 -1
  22. package/dist/model.js +2 -0
  23. package/dist/model.js.map +1 -1
  24. package/dist/{otlp-log-sink-CeIFDDpn.d.ts → otlp-log-sink-DTSa0KRF.d.ts} +2 -2
  25. package/dist/{payload-CHr53E_v.d.ts → payload-BWV5-4n3.d.ts} +1 -1
  26. package/dist/{policy-D1CrlYn3.d.ts → policy-CimmCfRp.d.ts} +1 -1
  27. package/dist/privacy.d.ts +4 -4
  28. package/dist/privacy.js +11 -0
  29. package/dist/privacy.js.map +1 -1
  30. package/dist/providers.d.ts +8 -8
  31. package/dist/providers.js +322 -94
  32. package/dist/providers.js.map +1 -1
  33. package/dist/{registry-BzYmC9OC.d.ts → registry-Dqr3VNmT.d.ts} +1 -1
  34. package/dist/runtime.d.ts +6 -6
  35. package/dist/runtime.js +13 -1
  36. package/dist/runtime.js.map +1 -1
  37. package/dist/{semconv-Baoz-0OI.d.ts → semconv-CIU-2kGO.d.ts} +1 -0
  38. package/dist/{service-j4jEO6cZ.d.ts → service-CbI9CObT.d.ts} +8 -2
  39. package/dist/telemetry.d.ts +5 -5
  40. package/dist/telemetry.js +102 -38
  41. package/dist/telemetry.js.map +1 -1
  42. package/dist/testing.d.ts +6 -6
  43. package/dist/testing.js +338 -95
  44. package/dist/testing.js.map +1 -1
  45. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { e as DetectionPolicy } from './schema-Cn0-xz8L.js';
2
2
  import { OtelHookErrorInfo } from './errors.js';
3
- import { P as ProviderAdapter, h as ProviderDetection, i as ProviderDetectionInput, e as ProviderContext } from './adapter-DIgRACtL.js';
3
+ import { P as ProviderAdapter, h as ProviderDetection, i as ProviderDetectionInput, e as ProviderContext } from './adapter-DXpNtnaf.js';
4
4
 
5
5
  type DetectionCandidate = {
6
6
  readonly adapter: ProviderAdapter;
package/dist/runtime.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { b as LogLevel, c as Logger } from './ports-Q8x0ODhs.js';
2
2
  export { A as AppliedDelivery, C as Clock, E as EventIdSeed, I as IdGenerator, a as InvocationIdSeed, L as LOG_LEVEL_RANK, 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';
3
3
  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';
4
- 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';
4
+ 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-_mlO3akA.js';
5
5
  import 'zod';
6
6
  import './errors.js';
7
7
  import './primitives-CJ8-rn-f.js';
@@ -9,11 +9,11 @@ import './taxonomy-DwhTtuWd.js';
9
9
  import './events-VxBnDFaO.js';
10
10
  import './schema-Cn0-xz8L.js';
11
11
  import './identity-BrVBs901.js';
12
- import './service-j4jEO6cZ.js';
13
- import './content-CoB7aNP1.js';
14
- import './policy-D1CrlYn3.js';
15
- import './adapter-DIgRACtL.js';
16
- import './registry-BzYmC9OC.js';
12
+ import './service-CbI9CObT.js';
13
+ import './content-M9xIKG7h.js';
14
+ import './policy-CimmCfRp.js';
15
+ import './adapter-DXpNtnaf.js';
16
+ import './registry-Dqr3VNmT.js';
17
17
 
18
18
  declare const createNullLogger: () => Logger;
19
19
  type StderrLoggerOptions = {
package/dist/runtime.js CHANGED
@@ -1142,6 +1142,7 @@ var contentFactSchema = z9.strictObject({
1142
1142
  });
1143
1143
  var contentFactsSchema = z9.array(contentFactSchema).max(64);
1144
1144
  var isContentFactConsistent = (fact) => fact.disclosure === "omitted" ? fact.text === void 0 : fact.text !== void 0;
1145
+ var isUnavailableContentFact = (fact) => fact.disclosure === "omitted" && fact.text === void 0 && fact.characterLength === 0 && fact.byteLength === 0;
1145
1146
 
1146
1147
  // src/model/identity.ts
1147
1148
  import { z as z10 } from "zod";
@@ -1674,6 +1675,17 @@ var createPrivacyService = (policyInput) => {
1674
1675
  hash,
1675
1676
  deriveOpaqueId: (namespace, value) => hash(`${namespace}\0${value}`),
1676
1677
  describeContent: describeText,
1678
+ describeUnavailableContent: (input) => ({
1679
+ kind: input.kind,
1680
+ ...input.role === void 0 ? {} : { role: input.role },
1681
+ characterLength: 0,
1682
+ byteLength: 0,
1683
+ contentHash: hash(""),
1684
+ disclosure: "omitted",
1685
+ truncated: false,
1686
+ secretsRedacted: 0,
1687
+ ...input.label === void 0 ? {} : { label: input.label }
1688
+ }),
1677
1689
  describeStructured: (input) => {
1678
1690
  const serialized = stableStringify(input.value);
1679
1691
  const sanitized = sanitizeStructured(input.value);
@@ -2396,7 +2408,7 @@ var createOtelHook = (deps) => {
2396
2408
  }
2397
2409
  const facts = collectContentFacts(event2);
2398
2410
  const offending = facts.find(
2399
- (fact) => fact.disclosure !== expectedDisclosure || !isContentFactConsistent(fact)
2411
+ (fact) => !isUnavailableContentFact(fact) && (fact.disclosure !== expectedDisclosure || !isContentFactConsistent(fact))
2400
2412
  );
2401
2413
  if (offending !== void 0) {
2402
2414
  reject(