@osfactory/otel-hook 0.4.1 → 0.6.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 (43) hide show
  1. package/dist/{adapter-BgqtlADe.d.ts → adapter-BJiz6lqM.d.ts} +2 -3
  2. package/dist/cli.js +100 -35
  3. package/dist/cli.js.map +1 -1
  4. package/dist/{events-C3h3GvHj.d.ts → events-B3MHoJTD.d.ts} +190 -1
  5. package/dist/{filesystem-store-BAq3VGVv.d.ts → filesystem-store-r-nNA3BA.d.ts} +1 -1
  6. package/dist/{hook-CQiNa88Q.d.ts → hook-Dh8OO4Wa.d.ts} +4 -4
  7. package/dist/index.d.ts +12 -13
  8. package/dist/index.js +105 -35
  9. package/dist/index.js.map +1 -1
  10. package/dist/install.d.ts +4 -5
  11. package/dist/install.js +13 -3
  12. package/dist/install.js.map +1 -1
  13. package/dist/integration.d.ts +8 -9
  14. package/dist/integration.js +2299 -2246
  15. package/dist/integration.js.map +1 -1
  16. package/dist/lifecycle.d.ts +3 -3
  17. package/dist/lifecycle.js +762 -213
  18. package/dist/lifecycle.js.map +1 -1
  19. package/dist/{memory-kflYgZbg.d.ts → memory-Bl9ANVff.d.ts} +2 -2
  20. package/dist/model.d.ts +1 -2
  21. package/dist/model.js +20 -4
  22. package/dist/model.js.map +1 -1
  23. package/dist/{otlp-log-sink-BZIgYPKN.d.ts → otlp-log-sink-eUEjaLhk.d.ts} +3 -3
  24. package/dist/{payload-DpyU8F-z.d.ts → payload-Ci8_ERm6.d.ts} +1 -1
  25. package/dist/{ports-B_iwJQPQ.d.ts → ports-n7KFOpKo.d.ts} +9 -1
  26. package/dist/providers.d.ts +10 -11
  27. package/dist/providers.js +37 -14
  28. package/dist/providers.js.map +1 -1
  29. package/dist/{registry-BSBS8t7S.d.ts → registry-CIVvRlVK.d.ts} +1 -1
  30. package/dist/runtime.d.ts +32 -16
  31. package/dist/runtime.js +57 -15
  32. package/dist/runtime.js.map +1 -1
  33. package/dist/{semconv-BeUPQ7_q.d.ts → semconv-fPRb-dpU.d.ts} +1 -1
  34. package/dist/state.d.ts +4 -4
  35. package/dist/state.js.map +1 -1
  36. package/dist/telemetry.d.ts +6 -6
  37. package/dist/telemetry.js +953 -414
  38. package/dist/telemetry.js.map +1 -1
  39. package/dist/testing.d.ts +14 -9
  40. package/dist/testing.js +45 -20
  41. package/dist/testing.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/target-8RfaVxp8.d.ts +0 -83
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osfactory/otel-hook",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "Provider-neutral coding-agent hooks to OpenTelemetry",
5
5
  "scripts": {
6
6
  "test": "vitest run",
@@ -1,83 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- /**
4
- * Per-event workspace targeting (ADR 0008).
5
- *
6
- * A session's `workspace` is where the agent was *started*. An agent routinely
7
- * works somewhere else — in a linked git worktree beside the checkout it was
8
- * launched from — and the session-level identity cannot show that. A tool event
9
- * can: the file it edited, or the directory its shell command ran in, names the
10
- * worktree it actually touched.
11
- *
12
- * Two values model that, and the split between them is the privacy boundary:
13
- *
14
- * - {@link TargetHint} is what an adapter observed — local paths. It is an
15
- * in-process value only: it is never part of a {@link CanonicalEvent}, never
16
- * persisted, never exported. The core resolves it and drops it.
17
- * - {@link WorkspaceTarget} is what the core resolved — a salted worktree handle,
18
- * the checked-out branch, and what the evidence was. It travels on the event.
19
- */
20
- /**
21
- * What a target was derived from, strongest evidence first.
22
- *
23
- * - `tool-path` — a path the tool call itself named (an edited or read file, a
24
- * patch header).
25
- * - `shell-cwd` — the working directory the provider reports a shell command ran in.
26
- * - `session-cwd` — only the session's own directory was known; the event may
27
- * have reached elsewhere (e.g. a shell `cd`) without the provider saying so.
28
- */
29
- declare const targetSourceSchema: z.ZodEnum<{
30
- "tool-path": "tool-path";
31
- "shell-cwd": "shell-cwd";
32
- "session-cwd": "session-cwd";
33
- }>;
34
- type TargetSource = z.infer<typeof targetSourceSchema>;
35
- /** Most paths one hint may name; a bound, not a sampling rule (all must agree). */
36
- declare const MAX_TARGET_HINT_PATHS = 8;
37
- /** Longest local path a hint may carry. Longer input is dropped, never truncated. */
38
- declare const MAX_TARGET_PATH_LENGTH = 4096;
39
- /**
40
- * An adapter's observation of where a tool event pointed. **Carries local paths**
41
- * — in-process only, see the module note.
42
- *
43
- * Every path in one hint must resolve to the same worktree, or the event gets no
44
- * target at all: a patch touching two worktrees did not target either of them.
45
- */
46
- declare const targetHintSchema: z.ZodReadonly<z.ZodObject<{
47
- source: z.ZodEnum<{
48
- "tool-path": "tool-path";
49
- "shell-cwd": "shell-cwd";
50
- "session-cwd": "session-cwd";
51
- }>;
52
- paths: z.ZodReadonly<z.ZodArray<z.ZodString>>;
53
- baseDirectory: z.ZodOptional<z.ZodString>;
54
- }, z.core.$strict>>;
55
- type TargetHint = z.infer<typeof targetHintSchema>;
56
- /**
57
- * The git worktree a tool event targeted. Exported; carries no path.
58
- *
59
- * `workspaceId` is derived exactly like a `git-root` workspace identity, so a
60
- * consumer holding the same salt can match it against one it derived itself.
61
- */
62
- declare const workspaceTargetSchema: z.ZodReadonly<z.ZodObject<{
63
- workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
64
- vcsBranchName: z.ZodOptional<z.ZodString>;
65
- source: z.ZodEnum<{
66
- "tool-path": "tool-path";
67
- "shell-cwd": "shell-cwd";
68
- "session-cwd": "session-cwd";
69
- }>;
70
- }, z.core.$strict>>;
71
- type WorkspaceTarget = z.infer<typeof workspaceTargetSchema>;
72
- /**
73
- * Shape a provider's own subagent identifier must have to be exported.
74
- *
75
- * Identifier-shaped on purpose — no whitespace, no path separators — so a
76
- * malformed payload field cannot carry prose or a path onto the wire under an id
77
- * attribute. A value that does not fit is dropped, not repaired.
78
- */
79
- declare const SUBAGENT_ID_PATTERN: RegExp;
80
- declare const subagentIdSchema: z.ZodString;
81
- type SubagentId = z.infer<typeof subagentIdSchema>;
82
-
83
- export { MAX_TARGET_HINT_PATHS as M, SUBAGENT_ID_PATTERN as S, type TargetHint as T, type WorkspaceTarget as W, MAX_TARGET_PATH_LENGTH as a, type SubagentId as b, type TargetSource as c, targetSourceSchema as d, subagentIdSchema as s, targetHintSchema as t, workspaceTargetSchema as w };