@osfactory/otel-hook 0.9.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 (49) hide show
  1. package/README.md +42 -1
  2. package/dist/{adapter-BJiz6lqM.d.ts → adapter-B9RwW6TO.d.ts} +14 -2
  3. package/dist/cli.js +1272 -784
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config.d.ts +5 -3
  6. package/dist/config.js +28 -5
  7. package/dist/config.js.map +1 -1
  8. package/dist/{destinations-C6Bm89W6.d.ts → destinations-DWOkVxV1.d.ts} +1 -1
  9. package/dist/{events-B3MHoJTD.d.ts → events-CSD_YiJ2.d.ts} +2 -0
  10. package/dist/{export-destinations-d8tZV0G4.d.ts → export-destinations-lORbe25J.d.ts} +5 -5
  11. package/dist/{filesystem-store-r-nNA3BA.d.ts → filesystem-store-DX3dGIgu.d.ts} +1 -1
  12. package/dist/{hook-zA1b4cWd.d.ts → hook-BAxXoKsp.d.ts} +10 -5
  13. package/dist/index.d.ts +14 -14
  14. package/dist/index.js +643 -110
  15. package/dist/index.js.map +1 -1
  16. package/dist/install.d.ts +4 -4
  17. package/dist/install.js +31 -2
  18. package/dist/install.js.map +1 -1
  19. package/dist/integration.d.ts +17 -10
  20. package/dist/integration.js +3864 -3107
  21. package/dist/integration.js.map +1 -1
  22. package/dist/lifecycle.d.ts +3 -3
  23. package/dist/lifecycle.js +8 -1
  24. package/dist/lifecycle.js.map +1 -1
  25. package/dist/{memory-Bl9ANVff.d.ts → memory-aJilVG4R.d.ts} +2 -2
  26. package/dist/model.d.ts +1 -1
  27. package/dist/model.js +7 -0
  28. package/dist/model.js.map +1 -1
  29. package/dist/{payload-Ci8_ERm6.d.ts → payload-D7gc0-WQ.d.ts} +41 -2
  30. package/dist/{ports-n7KFOpKo.d.ts → ports-plO5MKrY.d.ts} +63 -2
  31. package/dist/providers.d.ts +146 -10
  32. package/dist/providers.js +397 -13
  33. package/dist/providers.js.map +1 -1
  34. package/dist/{registry-B8ZHc2bc.d.ts → registry-C7XO4DzD.d.ts} +2 -2
  35. package/dist/runtime.d.ts +8 -8
  36. package/dist/runtime.js +1356 -1217
  37. package/dist/runtime.js.map +1 -1
  38. package/dist/{schema-BxiVsU-d.d.ts → schema-CHb3GU1r.d.ts} +30 -1
  39. package/dist/{semconv-fPRb-dpU.d.ts → semconv-Dw7gcQcg.d.ts} +1 -1
  40. package/dist/state.d.ts +4 -4
  41. package/dist/state.js +607 -39
  42. package/dist/state.js.map +1 -1
  43. package/dist/telemetry.d.ts +6 -6
  44. package/dist/telemetry.js +13 -3
  45. package/dist/telemetry.js.map +1 -1
  46. package/dist/testing.d.ts +10 -8
  47. package/dist/testing.js +209 -25
  48. package/dist/testing.js.map +1 -1
  49. package/package.json +1 -1
package/dist/install.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { d as AntigravityHookEventName, m as ClaudeHookEventName, n as CodexHookEventName, o as CursorHookEventName, s as GeminiHookEventName, q as GEMINI_PROVIDER_ID, b as ANTIGRAVITY_PROVIDER_ID, C as CLAUDE_CODE_PROVIDER_ID, h as CODEX_PROVIDER_ID, k as CURSOR_PROVIDER_ID } from './payload-Ci8_ERm6.js';
2
- import { C as Clock } from './ports-n7KFOpKo.js';
1
+ import { d as AntigravityHookEventName, m as ClaudeHookEventName, n as CodexHookEventName, o as CursorHookEventName, s as GeminiHookEventName, q as GEMINI_PROVIDER_ID, b as ANTIGRAVITY_PROVIDER_ID, C as CLAUDE_CODE_PROVIDER_ID, h as CODEX_PROVIDER_ID, k as CURSOR_PROVIDER_ID } from './payload-D7gc0-WQ.js';
2
+ import { C as Clock } from './ports-plO5MKrY.js';
3
3
  import 'zod';
4
4
  import './primitives-CJ8-rn-f.js';
5
- import './adapter-BJiz6lqM.js';
5
+ import './adapter-B9RwW6TO.js';
6
6
  import './errors.js';
7
7
  import './taxonomy-DwhTtuWd.js';
8
- import './events-B3MHoJTD.js';
8
+ import './events-CSD_YiJ2.js';
9
9
  import './identity-BrVBs901.js';
10
10
  import './policy-CimmCfRp.js';
11
11
  import './content-M9xIKG7h.js';
package/dist/install.js CHANGED
@@ -514,7 +514,25 @@ var stopPayloadSchema2 = z2.object({
514
514
  * the former without suppressing the latter.
515
515
  */
516
516
  stop_hook_active: z2.boolean().optional(),
517
- usage: claudeUsageSchema.optional()
517
+ usage: claudeUsageSchema.optional(),
518
+ /**
519
+ * The model that answered this turn — harness-supplied, never upstream.
520
+ *
521
+ * Claude Code's `Stop` carries no model id; the per-turn model sits only at
522
+ * `message.model` in the transcript, beside `message.usage`. A wrapping harness
523
+ * that read it (for instance with `readClaudeTranscriptTurn`) attaches it here
524
+ * with `usage`, and it becomes the generation's response model. An unusable
525
+ * value (empty, over 256 characters, not a string) is dropped rather than
526
+ * failing the whole payload: the turn is still worth reporting without it.
527
+ */
528
+ model: z2.string().min(1).max(256).optional().catch(void 0),
529
+ /**
530
+ * Harness-supplied, never upstream: whether `usage` covers only part of the
531
+ * turn. `true` when it is the last model request alone (the tail fallback),
532
+ * `false` when it sums every request since the previous stop. Exported as
533
+ * `otelhook.usage.partial`; absent means the attacher did not say.
534
+ */
535
+ usage_partial: z2.boolean().optional().catch(void 0)
518
536
  });
519
537
  var stopFailurePayloadSchema = z2.object({
520
538
  ...commonFields2,
@@ -526,7 +544,11 @@ var stopFailurePayloadSchema = z2.object({
526
544
  */
527
545
  error_type: z2.string().min(1),
528
546
  error_message: z2.string().optional(),
529
- usage: claudeUsageSchema.optional()
547
+ usage: claudeUsageSchema.optional(),
548
+ /** Harness-supplied, never upstream: see `stopPayloadSchema.model`. */
549
+ model: z2.string().min(1).max(256).optional().catch(void 0),
550
+ /** Harness-supplied, never upstream: see `stopPayloadSchema.usage_partial`. */
551
+ usage_partial: z2.boolean().optional().catch(void 0)
530
552
  });
531
553
  var claudeHookPayloadSchema = z2.discriminatedUnion("hook_event_name", [
532
554
  sessionStartPayloadSchema,
@@ -2016,6 +2038,13 @@ var generationEndEventSchema = event2({
2016
2038
  stopReason: nonEmptyStringSchema.optional(),
2017
2039
  durationMillis: durationMillisSchema.optional(),
2018
2040
  usage: canonicalUsageSchema.optional(),
2041
+ /**
2042
+ * True when `usage` is known to cover only part of the generation (for
2043
+ * example the last model request of a multi-request turn); false when the
2044
+ * provider or harness said it is the whole. Absent: not stated. Meaningless
2045
+ * without `usage`.
2046
+ */
2047
+ usagePartial: z15.boolean().optional(),
2019
2048
  cost: costFactsSchema.optional(),
2020
2049
  outputContent: contentFactsSchema.optional()
2021
2050
  });