agent-afk 5.327.4 → 5.327.5
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/dist/agent/trace/otlp-export.builders.d.ts +47 -0
- package/dist/agent/trace/otlp-export.d.ts +4 -3
- package/dist/cli.mjs +402 -402
- package/dist/index.mjs +201 -201
- package/dist/telegram.mjs +215 -215
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { TraceEvent, ToolCallStartedPayload, ToolCallCompletedPayload } from './types.js';
|
|
2
|
+
import type { OtlpSpan, KeyValue, SpanEvent } from './otlp-export.js';
|
|
3
|
+
export declare function strAttr(key: string, value: string): KeyValue;
|
|
4
|
+
export declare function intAttr(key: string, value: number): KeyValue;
|
|
5
|
+
export declare function boolAttr(key: string, value: boolean): KeyValue;
|
|
6
|
+
export declare function doubleAttr(key: string, value: number): KeyValue;
|
|
7
|
+
export declare const SCOPE_NAME = "agent-afk.witness";
|
|
8
|
+
export declare const SCOPE_VERSION = "0.1.0";
|
|
9
|
+
export declare const GEN_AI_SYSTEM = "agent-afk";
|
|
10
|
+
export declare function isoToNano(iso: string): string;
|
|
11
|
+
export declare function addDurationNano(startIso: string, durationMs: number): string;
|
|
12
|
+
export declare function sessionToTraceId(sessionId: string): string;
|
|
13
|
+
export declare function seedSpanId(seed: string): string;
|
|
14
|
+
export interface SubagentInfo {
|
|
15
|
+
parentId: string;
|
|
16
|
+
model?: string;
|
|
17
|
+
agentType?: string;
|
|
18
|
+
startTs: string;
|
|
19
|
+
endTs?: string;
|
|
20
|
+
succeeded: boolean;
|
|
21
|
+
failed: boolean;
|
|
22
|
+
durationMs?: number;
|
|
23
|
+
turnCount?: number;
|
|
24
|
+
costUsd?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ToolCallPair {
|
|
27
|
+
started?: {
|
|
28
|
+
payload: ToolCallStartedPayload;
|
|
29
|
+
ts: string;
|
|
30
|
+
};
|
|
31
|
+
completed?: {
|
|
32
|
+
payload: ToolCallCompletedPayload;
|
|
33
|
+
ts: string;
|
|
34
|
+
};
|
|
35
|
+
bestEffortName?: string;
|
|
36
|
+
toolUseId: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function indexSubagents(events: readonly TraceEvent[]): Map<string, SubagentInfo>;
|
|
39
|
+
export declare function indexToolPairs(events: readonly TraceEvent[]): Map<string, ToolCallPair>;
|
|
40
|
+
export declare function buildSubagentSpans(subagentMap: Map<string, SubagentInfo>, traceId: string, rootSpanId: string, lastTs: string): {
|
|
41
|
+
spans: OtlpSpan[];
|
|
42
|
+
spanIds: Map<string, string>;
|
|
43
|
+
};
|
|
44
|
+
export declare function buildToolSpans(toolPairs: Map<string, ToolCallPair>, traceId: string, rootSpanId: string, subagentSpanIds: Map<string, string>, opts?: {
|
|
45
|
+
includeErrorDetails?: boolean;
|
|
46
|
+
}): OtlpSpan[];
|
|
47
|
+
export declare function buildRootSpanEvents(events: readonly TraceEvent[]): SpanEvent[];
|
|
@@ -8,16 +8,16 @@ type AnyValue = {
|
|
|
8
8
|
} | {
|
|
9
9
|
doubleValue: number;
|
|
10
10
|
};
|
|
11
|
-
interface KeyValue {
|
|
11
|
+
export interface KeyValue {
|
|
12
12
|
key: string;
|
|
13
13
|
value: AnyValue;
|
|
14
14
|
}
|
|
15
|
-
interface SpanEvent {
|
|
15
|
+
export interface SpanEvent {
|
|
16
16
|
timeUnixNano: string;
|
|
17
17
|
name: string;
|
|
18
18
|
attributes?: KeyValue[];
|
|
19
19
|
}
|
|
20
|
-
interface SpanStatus {
|
|
20
|
+
export interface SpanStatus {
|
|
21
21
|
code: 0 | 1 | 2;
|
|
22
22
|
message?: string;
|
|
23
23
|
}
|
|
@@ -51,6 +51,7 @@ export interface OtlpExportRequest {
|
|
|
51
51
|
export interface TraceToOtlpOptions {
|
|
52
52
|
sessionId: string;
|
|
53
53
|
malformed?: number;
|
|
54
|
+
includeErrorDetails?: boolean;
|
|
54
55
|
}
|
|
55
56
|
export declare function traceToOtlp(events: readonly TraceEvent[], opts: TraceToOtlpOptions): OtlpExportRequest;
|
|
56
57
|
export {};
|