@osfactory/otel-hook 0.5.0 → 0.7.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/README.md +72 -7
- package/dist/{adapter-BS7xHKGQ.d.ts → adapter-BJiz6lqM.d.ts} +2 -2
- package/dist/cli.js +207 -34
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +85 -1
- package/dist/config.js +135 -1
- package/dist/config.js.map +1 -1
- package/dist/{events-CzZ5kukS.d.ts → events-B3MHoJTD.d.ts} +72 -1
- package/dist/{filesystem-store-BcOveJYY.d.ts → filesystem-store-r-nNA3BA.d.ts} +1 -1
- package/dist/{hook-DxTakjAD.d.ts → hook-Dh8OO4Wa.d.ts} +4 -4
- package/dist/index.d.ts +12 -12
- package/dist/index.js +197 -31
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +4 -4
- package/dist/install.js +8 -2
- package/dist/install.js.map +1 -1
- package/dist/integration.d.ts +13 -8
- package/dist/integration.js +2273 -2256
- package/dist/integration.js.map +1 -1
- package/dist/lifecycle.d.ts +3 -3
- package/dist/lifecycle.js +761 -212
- package/dist/lifecycle.js.map +1 -1
- package/dist/{memory-DkTohdIa.d.ts → memory-Bl9ANVff.d.ts} +2 -2
- package/dist/model.d.ts +1 -1
- package/dist/model.js +13 -2
- package/dist/model.js.map +1 -1
- package/dist/{otlp-log-sink-DaZDPKnR.d.ts → otlp-log-sink-eUEjaLhk.d.ts} +3 -3
- package/dist/{payload-2lnpKodw.d.ts → payload-Ci8_ERm6.d.ts} +1 -1
- package/dist/{ports-B0rC49b3.d.ts → ports-n7KFOpKo.d.ts} +1 -1
- package/dist/providers.d.ts +10 -10
- package/dist/providers.js +32 -13
- package/dist/providers.js.map +1 -1
- package/dist/{registry-DVnPA_b6.d.ts → registry-CIVvRlVK.d.ts} +1 -1
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +11 -6
- package/dist/runtime.js.map +1 -1
- package/dist/{semconv-CtnDdsPk.d.ts → semconv-fPRb-dpU.d.ts} +1 -1
- package/dist/state.d.ts +4 -4
- package/dist/telemetry.d.ts +6 -6
- package/dist/telemetry.js +956 -418
- package/dist/telemetry.js.map +1 -1
- package/dist/testing.d.ts +14 -8
- package/dist/testing.js +36 -18
- package/dist/testing.js.map +1 -1
- 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-
|
|
3
|
+
import { P as ProviderAdapter, h as ProviderDetection, i as ProviderDetectionInput, e as ProviderContext } from './adapter-BJiz6lqM.js';
|
|
4
4
|
|
|
5
5
|
type DetectionCandidate = {
|
|
6
6
|
readonly adapter: ProviderAdapter;
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as LogLevel, d as Logger, W as WorktreeLocator } from './ports-
|
|
2
|
-
export { A as AppliedDelivery, C as Clock, E as EventIdSeed, I as IdGenerator, a as InvocationIdSeed, L as LOG_LEVEL_RANK, b as LocatedWorktree, S as StateRecord, e as StateStore, f as StateValue, T as TelemetryEmitResult, g as TelemetrySink, h as appliedDeliverySchema, l as logLevelSchema, s as stateRecordSchema, i as stateValueSchema } from './ports-
|
|
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-
|
|
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-
|
|
5
|
-
import { b as CanonicalEvent,
|
|
1
|
+
import { c as LogLevel, d as Logger, W as WorktreeLocator } from './ports-n7KFOpKo.js';
|
|
2
|
+
export { A as AppliedDelivery, C as Clock, E as EventIdSeed, I as IdGenerator, a as InvocationIdSeed, L as LOG_LEVEL_RANK, b as LocatedWorktree, S as StateRecord, e as StateStore, f as StateValue, T as TelemetryEmitResult, g as TelemetrySink, h as appliedDeliverySchema, l as logLevelSchema, s as stateRecordSchema, i as stateValueSchema } from './ports-n7KFOpKo.js';
|
|
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-Bl9ANVff.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-Dh8OO4Wa.js';
|
|
5
|
+
import { b as CanonicalEvent, u as TargetHint } from './events-B3MHoJTD.js';
|
|
6
6
|
import { d as EventId } from './primitives-CJ8-rn-f.js';
|
|
7
7
|
import { P as PrivacyService } from './service-CbI9CObT.js';
|
|
8
8
|
import 'zod';
|
|
@@ -10,10 +10,10 @@ import './errors.js';
|
|
|
10
10
|
import './taxonomy-DwhTtuWd.js';
|
|
11
11
|
import './schema-Cn0-xz8L.js';
|
|
12
12
|
import './identity-BrVBs901.js';
|
|
13
|
-
import './adapter-
|
|
13
|
+
import './adapter-BJiz6lqM.js';
|
|
14
14
|
import './policy-CimmCfRp.js';
|
|
15
15
|
import './content-M9xIKG7h.js';
|
|
16
|
-
import './registry-
|
|
16
|
+
import './registry-CIVvRlVK.js';
|
|
17
17
|
|
|
18
18
|
declare const createNullLogger: () => Logger;
|
|
19
19
|
type StderrLoggerOptions = {
|
|
@@ -115,7 +115,7 @@ type ResolveEventTargetsResult = {
|
|
|
115
115
|
readonly timedOut: boolean;
|
|
116
116
|
};
|
|
117
117
|
/**
|
|
118
|
-
* Attach a `target` to each
|
|
118
|
+
* Attach a `target` to each targeted event (`TARGETED_EVENT_TYPES`) that has a resolvable hint. Never
|
|
119
119
|
* throws or rejects; events without a hint, or whose hint does not resolve,
|
|
120
120
|
* are returned unchanged.
|
|
121
121
|
*/
|
package/dist/runtime.js
CHANGED
|
@@ -1798,7 +1798,9 @@ var sessionStartEventSchema = event({
|
|
|
1798
1798
|
sessionKind: z14.enum(["interactive", "non-interactive", "unknown"]),
|
|
1799
1799
|
agentName: nonEmptyStringSchema.optional(),
|
|
1800
1800
|
agentVersion: nonEmptyStringSchema.optional(),
|
|
1801
|
-
model: modelDescriptorSchema.optional()
|
|
1801
|
+
model: modelDescriptorSchema.optional(),
|
|
1802
|
+
/** The git worktree the session runs in, resolved by the core (ADR 0008). */
|
|
1803
|
+
target: workspaceTargetSchema.optional()
|
|
1802
1804
|
});
|
|
1803
1805
|
var sessionEndEventSchema = event({
|
|
1804
1806
|
type: z14.literal("session.end"),
|
|
@@ -1812,7 +1814,9 @@ var promptSubmittedEventSchema = event({
|
|
|
1812
1814
|
type: z14.literal("prompt.submitted"),
|
|
1813
1815
|
promptSource: z14.enum(["user", "automation", "resumed", "unknown"]),
|
|
1814
1816
|
content: contentFactSchema.optional(),
|
|
1815
|
-
turnIndex: z14.number().int().min(0).optional()
|
|
1817
|
+
turnIndex: z14.number().int().min(0).optional(),
|
|
1818
|
+
/** The git worktree the session runs in, resolved by the core (ADR 0008). */
|
|
1819
|
+
target: workspaceTargetSchema.optional()
|
|
1816
1820
|
});
|
|
1817
1821
|
var generationStartEventSchema = event({
|
|
1818
1822
|
type: z14.literal("generation.start"),
|
|
@@ -1912,6 +1916,9 @@ var canonicalEventSchema = z14.discriminatedUnion("type", [
|
|
|
1912
1916
|
compactionPerformedEventSchema,
|
|
1913
1917
|
errorRaisedEventSchema
|
|
1914
1918
|
]);
|
|
1919
|
+
var TARGETED_EVENT_TYPES = ["session.start", "prompt.submitted", "tool.start", "tool.end"];
|
|
1920
|
+
var TARGETED = new Set(TARGETED_EVENT_TYPES);
|
|
1921
|
+
var isTargetedEvent = (event2) => TARGETED.has(event2.type);
|
|
1915
1922
|
|
|
1916
1923
|
// src/providers/adapter.ts
|
|
1917
1924
|
var providerDetectionSchema = z15.strictObject({
|
|
@@ -2271,9 +2278,7 @@ var resolveHint = async (hint, locator, privacy) => {
|
|
|
2271
2278
|
return parsed.success ? parsed.data : void 0;
|
|
2272
2279
|
};
|
|
2273
2280
|
var resolveEventTargets = async (input) => {
|
|
2274
|
-
const pending = input.events.filter(
|
|
2275
|
-
(event2) => (event2.type === "tool.start" || event2.type === "tool.end") && input.hints.has(event2.eventId)
|
|
2276
|
-
);
|
|
2281
|
+
const pending = input.events.filter((event2) => isTargetedEvent(event2) && input.hints.has(event2.eventId));
|
|
2277
2282
|
if (pending.length === 0) {
|
|
2278
2283
|
return { events: input.events, resolved: 0, timedOut: false };
|
|
2279
2284
|
}
|
|
@@ -2305,7 +2310,7 @@ var resolveEventTargets = async (input) => {
|
|
|
2305
2310
|
const settled = new Map(targets);
|
|
2306
2311
|
const events = input.events.map((event2) => {
|
|
2307
2312
|
const target = settled.get(event2.eventId);
|
|
2308
|
-
if (target === void 0 || event2
|
|
2313
|
+
if (target === void 0 || !isTargetedEvent(event2)) {
|
|
2309
2314
|
return event2;
|
|
2310
2315
|
}
|
|
2311
2316
|
return { ...event2, target };
|