@agent-inspect/adapter-sdk 6.31.37 → 6.31.39
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/index.cjs +562 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +226 -0
- package/dist/index.d.ts +226 -0
- package/dist/index.mjs +526 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +2 -2
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { PersistedInspectEvent } from 'agent-inspect/persisted';
|
|
2
|
+
import { TraceReadWarning } from 'agent-inspect/readers';
|
|
3
|
+
|
|
4
|
+
interface AdapterRegistration {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
framework: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
interface ConformanceCheck {
|
|
13
|
+
id: string;
|
|
14
|
+
ok: boolean;
|
|
15
|
+
detail?: string;
|
|
16
|
+
}
|
|
17
|
+
interface AdapterConformanceOptions {
|
|
18
|
+
adapterId: string;
|
|
19
|
+
events: readonly PersistedInspectEvent[];
|
|
20
|
+
/** Strings that must not appear in serialized persisted output. */
|
|
21
|
+
forbiddenRawStrings?: readonly string[];
|
|
22
|
+
/** Expected step kinds in tree order (excluding RUN root handling). */
|
|
23
|
+
expectedKinds?: readonly PersistedInspectEvent["kind"][];
|
|
24
|
+
}
|
|
25
|
+
interface AdapterConformanceResult {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
adapterId: string;
|
|
28
|
+
checks: ConformanceCheck[];
|
|
29
|
+
}
|
|
30
|
+
interface PrivacyChecklistItem {
|
|
31
|
+
id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
required: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface PrivacyChecklistInput {
|
|
36
|
+
captureMode?: "metadata-only" | "preview" | "full";
|
|
37
|
+
networkAllowed?: boolean;
|
|
38
|
+
uploadAllowed?: boolean;
|
|
39
|
+
redactionDocumented?: boolean;
|
|
40
|
+
frameworkDepsPackageScoped?: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface PrivacyChecklistResult {
|
|
43
|
+
ok: boolean;
|
|
44
|
+
items: ConformanceCheck[];
|
|
45
|
+
}
|
|
46
|
+
interface AdapterFixtureSkeleton {
|
|
47
|
+
adapterId: string;
|
|
48
|
+
captureDefault: "metadata-only";
|
|
49
|
+
network: "none";
|
|
50
|
+
suggestedCovers: string[];
|
|
51
|
+
notes: string[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare function createAdapterRegistration(input: AdapterRegistration): AdapterRegistration;
|
|
55
|
+
declare function registerAdapter(registration: AdapterRegistration): AdapterRegistration;
|
|
56
|
+
declare function getRegisteredAdapter(id: string): AdapterRegistration | undefined;
|
|
57
|
+
declare function listRegisteredAdapters(): readonly AdapterRegistration[];
|
|
58
|
+
declare function clearAdapterRegistry(): void;
|
|
59
|
+
|
|
60
|
+
interface InspectNodeLike {
|
|
61
|
+
event: {
|
|
62
|
+
kind: string;
|
|
63
|
+
};
|
|
64
|
+
children: InspectNodeLike[];
|
|
65
|
+
}
|
|
66
|
+
declare function eventsToJsonl(events: readonly unknown[]): string;
|
|
67
|
+
declare function flattenInspectNodes(nodes: readonly InspectNodeLike[]): InspectNodeLike[];
|
|
68
|
+
declare function extractPersistedKinds(events: readonly PersistedInspectEvent[]): PersistedInspectEvent["kind"][];
|
|
69
|
+
declare function stableStringify(value: unknown): string;
|
|
70
|
+
|
|
71
|
+
declare function createAdapterFixtureSkeleton(adapterId: string): AdapterFixtureSkeleton;
|
|
72
|
+
declare function createConformanceFixtureMeta(adapterId: string): {
|
|
73
|
+
adapterId: string;
|
|
74
|
+
defaults: {
|
|
75
|
+
network: string;
|
|
76
|
+
upload: string;
|
|
77
|
+
capture: string;
|
|
78
|
+
};
|
|
79
|
+
skeleton: AdapterFixtureSkeleton;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
declare const PRIVACY_CHECKLIST_ITEMS: readonly PrivacyChecklistItem[];
|
|
83
|
+
declare function runPrivacyChecklist(input?: PrivacyChecklistInput): PrivacyChecklistResult;
|
|
84
|
+
|
|
85
|
+
declare function runAdapterConformance(options: AdapterConformanceOptions): Promise<AdapterConformanceResult>;
|
|
86
|
+
declare function findPairedLifecycle(events: readonly PersistedInspectEvent[], kind: PersistedInspectEvent["kind"], terminalStatus?: "ok" | "error"): {
|
|
87
|
+
started?: PersistedInspectEvent;
|
|
88
|
+
completed?: PersistedInspectEvent;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
declare const PLUGIN_MANIFEST_FILENAME = "agent-inspect-plugin.manifest.json";
|
|
92
|
+
declare const PLUGIN_NAME_PREFIXES: readonly ["agent-inspect-plugin-", "agent-inspect-adapter-", "agent-inspect-renderer-", "agent-inspect-check-", "agent-inspect-importer-"];
|
|
93
|
+
type PluginManifestType = "plugin" | "adapter" | "renderer" | "check" | "importer";
|
|
94
|
+
interface PluginManifest {
|
|
95
|
+
schemaVersion: "1.0";
|
|
96
|
+
id: string;
|
|
97
|
+
type: PluginManifestType;
|
|
98
|
+
name: string;
|
|
99
|
+
version: string;
|
|
100
|
+
privacy?: PrivacyChecklistInput;
|
|
101
|
+
}
|
|
102
|
+
interface PluginManifestParseResult {
|
|
103
|
+
ok: boolean;
|
|
104
|
+
manifest?: PluginManifest;
|
|
105
|
+
errors: string[];
|
|
106
|
+
warnings: string[];
|
|
107
|
+
}
|
|
108
|
+
declare function isPluginPackageName(name: string): boolean;
|
|
109
|
+
declare function inferPluginTypeFromName(name: string): PluginManifestType | undefined;
|
|
110
|
+
declare function parsePluginManifest(input: unknown): PluginManifestParseResult;
|
|
111
|
+
declare function readPluginManifestFile(packageDir: string): Promise<PluginManifestParseResult & {
|
|
112
|
+
path: string;
|
|
113
|
+
}>;
|
|
114
|
+
declare function validatePluginPrivacy(manifest: PluginManifest): PrivacyChecklistResult;
|
|
115
|
+
|
|
116
|
+
interface TraceTransformResult {
|
|
117
|
+
events: PersistedInspectEvent[];
|
|
118
|
+
warnings: TraceReadWarning[];
|
|
119
|
+
}
|
|
120
|
+
interface TraceTransform {
|
|
121
|
+
readonly id: string;
|
|
122
|
+
transform(input: readonly PersistedInspectEvent[], options?: Record<string, unknown>): TraceTransformResult;
|
|
123
|
+
}
|
|
124
|
+
declare function defineTransform(transform: TraceTransform): TraceTransform;
|
|
125
|
+
declare function runTransformPipeline(input: readonly PersistedInspectEvent[], transforms: readonly TraceTransform[], options?: Record<string, unknown>): TraceTransformResult;
|
|
126
|
+
declare function createKindFilterTransform(kinds: readonly PersistedInspectEvent["kind"][]): TraceTransform;
|
|
127
|
+
|
|
128
|
+
type AttributionConfidence = "explicit" | "correlated" | "heuristic" | "unknown";
|
|
129
|
+
type InspectKind = "RUN" | "AGENT" | "LLM" | "TOOL" | "CHAIN" | "RETRIEVER" | "DECISION" | "RESULT" | "ERROR" | "LOGIC" | "LOG" | "OUTCOME";
|
|
130
|
+
interface EventSource {
|
|
131
|
+
type: "manual" | "json-log" | "log4js" | "pino" | "winston" | "adapter";
|
|
132
|
+
file?: string;
|
|
133
|
+
line?: number;
|
|
134
|
+
}
|
|
135
|
+
interface InspectEvent {
|
|
136
|
+
eventId: string;
|
|
137
|
+
runId: string;
|
|
138
|
+
parentId?: string;
|
|
139
|
+
name: string;
|
|
140
|
+
kind: InspectKind;
|
|
141
|
+
timestamp: number;
|
|
142
|
+
status?: "running" | "ok" | "error";
|
|
143
|
+
durationMs?: number;
|
|
144
|
+
attributes?: Record<string, unknown>;
|
|
145
|
+
confidence: AttributionConfidence;
|
|
146
|
+
source: EventSource;
|
|
147
|
+
}
|
|
148
|
+
interface InspectNode {
|
|
149
|
+
event: InspectEvent;
|
|
150
|
+
children: InspectNode[];
|
|
151
|
+
depth: number;
|
|
152
|
+
}
|
|
153
|
+
/** Bounded parent/cycle summary for visibility-first tree building (6.14.2+). */
|
|
154
|
+
interface RelationshipSummary {
|
|
155
|
+
rootCount: number;
|
|
156
|
+
selfParentCount: number;
|
|
157
|
+
cycleCount: number;
|
|
158
|
+
unresolvedParentCount: number;
|
|
159
|
+
normalizedEdgeCount: number;
|
|
160
|
+
}
|
|
161
|
+
interface InspectRunTree {
|
|
162
|
+
runId: string;
|
|
163
|
+
name?: string;
|
|
164
|
+
status?: "running" | "ok" | "error";
|
|
165
|
+
startedAt?: number;
|
|
166
|
+
endedAt?: number;
|
|
167
|
+
durationMs?: number;
|
|
168
|
+
children: InspectNode[];
|
|
169
|
+
metadata: {
|
|
170
|
+
totalEvents: number;
|
|
171
|
+
confidenceBreakdown: Record<AttributionConfidence, number>;
|
|
172
|
+
kinds: Record<InspectKind, number>;
|
|
173
|
+
relationshipSummary?: RelationshipSummary;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
type RenderRedactionProfile = "local" | "share" | "strict";
|
|
178
|
+
interface RenderSafetyOptions {
|
|
179
|
+
redactionProfile?: RenderRedactionProfile;
|
|
180
|
+
maxContentLength?: number;
|
|
181
|
+
forbiddenRawStrings?: readonly string[];
|
|
182
|
+
}
|
|
183
|
+
interface TraceRendererResult {
|
|
184
|
+
content: string;
|
|
185
|
+
contentType: string;
|
|
186
|
+
warnings: string[];
|
|
187
|
+
}
|
|
188
|
+
interface TraceRendererOptions extends RenderSafetyOptions {
|
|
189
|
+
[key: string]: unknown;
|
|
190
|
+
}
|
|
191
|
+
interface TraceRenderer {
|
|
192
|
+
readonly format: string;
|
|
193
|
+
render(tree: InspectRunTree, options?: TraceRendererOptions): TraceRendererResult;
|
|
194
|
+
}
|
|
195
|
+
declare function defineRenderer(renderer: TraceRenderer): TraceRenderer;
|
|
196
|
+
declare function renderWithSafety(renderer: TraceRenderer, tree: InspectRunTree, options?: TraceRendererOptions): TraceRendererResult;
|
|
197
|
+
|
|
198
|
+
interface TraceIndexEntry {
|
|
199
|
+
runId: string;
|
|
200
|
+
path: string;
|
|
201
|
+
name?: string;
|
|
202
|
+
startedAt?: number;
|
|
203
|
+
status?: string;
|
|
204
|
+
}
|
|
205
|
+
interface TraceIndexSnapshot {
|
|
206
|
+
traceDir: string;
|
|
207
|
+
builtAt: string;
|
|
208
|
+
entries: TraceIndexEntry[];
|
|
209
|
+
warnings: string[];
|
|
210
|
+
}
|
|
211
|
+
interface TraceIndexOptions {
|
|
212
|
+
maxEntries?: number;
|
|
213
|
+
/** Rebuild when snapshot `builtAt` is older than this ISO timestamp. */
|
|
214
|
+
invalidateBefore?: string;
|
|
215
|
+
[key: string]: unknown;
|
|
216
|
+
}
|
|
217
|
+
interface TraceIndexer {
|
|
218
|
+
readonly id: string;
|
|
219
|
+
rebuild(traceDir: string, options?: TraceIndexOptions): Promise<TraceIndexSnapshot>;
|
|
220
|
+
}
|
|
221
|
+
declare function defineIndexer(indexer: TraceIndexer): TraceIndexer;
|
|
222
|
+
declare function shouldInvalidateIndex(snapshot: TraceIndexSnapshot, options?: TraceIndexOptions): boolean;
|
|
223
|
+
declare function indexIsStale(snapshot: TraceIndexSnapshot, traceDir: string): Promise<boolean>;
|
|
224
|
+
declare function createTraceDirectoryIndexer(): TraceIndexer;
|
|
225
|
+
|
|
226
|
+
export { type AdapterConformanceOptions, type AdapterConformanceResult, type AdapterFixtureSkeleton, type AdapterRegistration, type ConformanceCheck, PLUGIN_MANIFEST_FILENAME, PLUGIN_NAME_PREFIXES, PRIVACY_CHECKLIST_ITEMS, type PluginManifest, type PluginManifestParseResult, type PluginManifestType, type PrivacyChecklistInput, type PrivacyChecklistItem, type PrivacyChecklistResult, type RenderRedactionProfile, type RenderSafetyOptions, type TraceIndexEntry, type TraceIndexOptions, type TraceIndexSnapshot, type TraceIndexer, type TraceRenderer, type TraceRendererOptions, type TraceRendererResult, type TraceTransform, type TraceTransformResult, clearAdapterRegistry, createAdapterFixtureSkeleton, createAdapterRegistration, createConformanceFixtureMeta, createKindFilterTransform, createTraceDirectoryIndexer, defineIndexer, defineRenderer, defineTransform, eventsToJsonl, extractPersistedKinds, findPairedLifecycle, flattenInspectNodes, getRegisteredAdapter, indexIsStale, inferPluginTypeFromName, isPluginPackageName, listRegisteredAdapters, parsePluginManifest, readPluginManifestFile, registerAdapter, renderWithSafety, runAdapterConformance, runPrivacyChecklist, runTransformPipeline, shouldInvalidateIndex, stableStringify, validatePluginPrivacy };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { PersistedInspectEvent } from 'agent-inspect/persisted';
|
|
2
|
+
import { TraceReadWarning } from 'agent-inspect/readers';
|
|
3
|
+
|
|
4
|
+
interface AdapterRegistration {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
framework: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
interface ConformanceCheck {
|
|
13
|
+
id: string;
|
|
14
|
+
ok: boolean;
|
|
15
|
+
detail?: string;
|
|
16
|
+
}
|
|
17
|
+
interface AdapterConformanceOptions {
|
|
18
|
+
adapterId: string;
|
|
19
|
+
events: readonly PersistedInspectEvent[];
|
|
20
|
+
/** Strings that must not appear in serialized persisted output. */
|
|
21
|
+
forbiddenRawStrings?: readonly string[];
|
|
22
|
+
/** Expected step kinds in tree order (excluding RUN root handling). */
|
|
23
|
+
expectedKinds?: readonly PersistedInspectEvent["kind"][];
|
|
24
|
+
}
|
|
25
|
+
interface AdapterConformanceResult {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
adapterId: string;
|
|
28
|
+
checks: ConformanceCheck[];
|
|
29
|
+
}
|
|
30
|
+
interface PrivacyChecklistItem {
|
|
31
|
+
id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
required: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface PrivacyChecklistInput {
|
|
36
|
+
captureMode?: "metadata-only" | "preview" | "full";
|
|
37
|
+
networkAllowed?: boolean;
|
|
38
|
+
uploadAllowed?: boolean;
|
|
39
|
+
redactionDocumented?: boolean;
|
|
40
|
+
frameworkDepsPackageScoped?: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface PrivacyChecklistResult {
|
|
43
|
+
ok: boolean;
|
|
44
|
+
items: ConformanceCheck[];
|
|
45
|
+
}
|
|
46
|
+
interface AdapterFixtureSkeleton {
|
|
47
|
+
adapterId: string;
|
|
48
|
+
captureDefault: "metadata-only";
|
|
49
|
+
network: "none";
|
|
50
|
+
suggestedCovers: string[];
|
|
51
|
+
notes: string[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare function createAdapterRegistration(input: AdapterRegistration): AdapterRegistration;
|
|
55
|
+
declare function registerAdapter(registration: AdapterRegistration): AdapterRegistration;
|
|
56
|
+
declare function getRegisteredAdapter(id: string): AdapterRegistration | undefined;
|
|
57
|
+
declare function listRegisteredAdapters(): readonly AdapterRegistration[];
|
|
58
|
+
declare function clearAdapterRegistry(): void;
|
|
59
|
+
|
|
60
|
+
interface InspectNodeLike {
|
|
61
|
+
event: {
|
|
62
|
+
kind: string;
|
|
63
|
+
};
|
|
64
|
+
children: InspectNodeLike[];
|
|
65
|
+
}
|
|
66
|
+
declare function eventsToJsonl(events: readonly unknown[]): string;
|
|
67
|
+
declare function flattenInspectNodes(nodes: readonly InspectNodeLike[]): InspectNodeLike[];
|
|
68
|
+
declare function extractPersistedKinds(events: readonly PersistedInspectEvent[]): PersistedInspectEvent["kind"][];
|
|
69
|
+
declare function stableStringify(value: unknown): string;
|
|
70
|
+
|
|
71
|
+
declare function createAdapterFixtureSkeleton(adapterId: string): AdapterFixtureSkeleton;
|
|
72
|
+
declare function createConformanceFixtureMeta(adapterId: string): {
|
|
73
|
+
adapterId: string;
|
|
74
|
+
defaults: {
|
|
75
|
+
network: string;
|
|
76
|
+
upload: string;
|
|
77
|
+
capture: string;
|
|
78
|
+
};
|
|
79
|
+
skeleton: AdapterFixtureSkeleton;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
declare const PRIVACY_CHECKLIST_ITEMS: readonly PrivacyChecklistItem[];
|
|
83
|
+
declare function runPrivacyChecklist(input?: PrivacyChecklistInput): PrivacyChecklistResult;
|
|
84
|
+
|
|
85
|
+
declare function runAdapterConformance(options: AdapterConformanceOptions): Promise<AdapterConformanceResult>;
|
|
86
|
+
declare function findPairedLifecycle(events: readonly PersistedInspectEvent[], kind: PersistedInspectEvent["kind"], terminalStatus?: "ok" | "error"): {
|
|
87
|
+
started?: PersistedInspectEvent;
|
|
88
|
+
completed?: PersistedInspectEvent;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
declare const PLUGIN_MANIFEST_FILENAME = "agent-inspect-plugin.manifest.json";
|
|
92
|
+
declare const PLUGIN_NAME_PREFIXES: readonly ["agent-inspect-plugin-", "agent-inspect-adapter-", "agent-inspect-renderer-", "agent-inspect-check-", "agent-inspect-importer-"];
|
|
93
|
+
type PluginManifestType = "plugin" | "adapter" | "renderer" | "check" | "importer";
|
|
94
|
+
interface PluginManifest {
|
|
95
|
+
schemaVersion: "1.0";
|
|
96
|
+
id: string;
|
|
97
|
+
type: PluginManifestType;
|
|
98
|
+
name: string;
|
|
99
|
+
version: string;
|
|
100
|
+
privacy?: PrivacyChecklistInput;
|
|
101
|
+
}
|
|
102
|
+
interface PluginManifestParseResult {
|
|
103
|
+
ok: boolean;
|
|
104
|
+
manifest?: PluginManifest;
|
|
105
|
+
errors: string[];
|
|
106
|
+
warnings: string[];
|
|
107
|
+
}
|
|
108
|
+
declare function isPluginPackageName(name: string): boolean;
|
|
109
|
+
declare function inferPluginTypeFromName(name: string): PluginManifestType | undefined;
|
|
110
|
+
declare function parsePluginManifest(input: unknown): PluginManifestParseResult;
|
|
111
|
+
declare function readPluginManifestFile(packageDir: string): Promise<PluginManifestParseResult & {
|
|
112
|
+
path: string;
|
|
113
|
+
}>;
|
|
114
|
+
declare function validatePluginPrivacy(manifest: PluginManifest): PrivacyChecklistResult;
|
|
115
|
+
|
|
116
|
+
interface TraceTransformResult {
|
|
117
|
+
events: PersistedInspectEvent[];
|
|
118
|
+
warnings: TraceReadWarning[];
|
|
119
|
+
}
|
|
120
|
+
interface TraceTransform {
|
|
121
|
+
readonly id: string;
|
|
122
|
+
transform(input: readonly PersistedInspectEvent[], options?: Record<string, unknown>): TraceTransformResult;
|
|
123
|
+
}
|
|
124
|
+
declare function defineTransform(transform: TraceTransform): TraceTransform;
|
|
125
|
+
declare function runTransformPipeline(input: readonly PersistedInspectEvent[], transforms: readonly TraceTransform[], options?: Record<string, unknown>): TraceTransformResult;
|
|
126
|
+
declare function createKindFilterTransform(kinds: readonly PersistedInspectEvent["kind"][]): TraceTransform;
|
|
127
|
+
|
|
128
|
+
type AttributionConfidence = "explicit" | "correlated" | "heuristic" | "unknown";
|
|
129
|
+
type InspectKind = "RUN" | "AGENT" | "LLM" | "TOOL" | "CHAIN" | "RETRIEVER" | "DECISION" | "RESULT" | "ERROR" | "LOGIC" | "LOG" | "OUTCOME";
|
|
130
|
+
interface EventSource {
|
|
131
|
+
type: "manual" | "json-log" | "log4js" | "pino" | "winston" | "adapter";
|
|
132
|
+
file?: string;
|
|
133
|
+
line?: number;
|
|
134
|
+
}
|
|
135
|
+
interface InspectEvent {
|
|
136
|
+
eventId: string;
|
|
137
|
+
runId: string;
|
|
138
|
+
parentId?: string;
|
|
139
|
+
name: string;
|
|
140
|
+
kind: InspectKind;
|
|
141
|
+
timestamp: number;
|
|
142
|
+
status?: "running" | "ok" | "error";
|
|
143
|
+
durationMs?: number;
|
|
144
|
+
attributes?: Record<string, unknown>;
|
|
145
|
+
confidence: AttributionConfidence;
|
|
146
|
+
source: EventSource;
|
|
147
|
+
}
|
|
148
|
+
interface InspectNode {
|
|
149
|
+
event: InspectEvent;
|
|
150
|
+
children: InspectNode[];
|
|
151
|
+
depth: number;
|
|
152
|
+
}
|
|
153
|
+
/** Bounded parent/cycle summary for visibility-first tree building (6.14.2+). */
|
|
154
|
+
interface RelationshipSummary {
|
|
155
|
+
rootCount: number;
|
|
156
|
+
selfParentCount: number;
|
|
157
|
+
cycleCount: number;
|
|
158
|
+
unresolvedParentCount: number;
|
|
159
|
+
normalizedEdgeCount: number;
|
|
160
|
+
}
|
|
161
|
+
interface InspectRunTree {
|
|
162
|
+
runId: string;
|
|
163
|
+
name?: string;
|
|
164
|
+
status?: "running" | "ok" | "error";
|
|
165
|
+
startedAt?: number;
|
|
166
|
+
endedAt?: number;
|
|
167
|
+
durationMs?: number;
|
|
168
|
+
children: InspectNode[];
|
|
169
|
+
metadata: {
|
|
170
|
+
totalEvents: number;
|
|
171
|
+
confidenceBreakdown: Record<AttributionConfidence, number>;
|
|
172
|
+
kinds: Record<InspectKind, number>;
|
|
173
|
+
relationshipSummary?: RelationshipSummary;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
type RenderRedactionProfile = "local" | "share" | "strict";
|
|
178
|
+
interface RenderSafetyOptions {
|
|
179
|
+
redactionProfile?: RenderRedactionProfile;
|
|
180
|
+
maxContentLength?: number;
|
|
181
|
+
forbiddenRawStrings?: readonly string[];
|
|
182
|
+
}
|
|
183
|
+
interface TraceRendererResult {
|
|
184
|
+
content: string;
|
|
185
|
+
contentType: string;
|
|
186
|
+
warnings: string[];
|
|
187
|
+
}
|
|
188
|
+
interface TraceRendererOptions extends RenderSafetyOptions {
|
|
189
|
+
[key: string]: unknown;
|
|
190
|
+
}
|
|
191
|
+
interface TraceRenderer {
|
|
192
|
+
readonly format: string;
|
|
193
|
+
render(tree: InspectRunTree, options?: TraceRendererOptions): TraceRendererResult;
|
|
194
|
+
}
|
|
195
|
+
declare function defineRenderer(renderer: TraceRenderer): TraceRenderer;
|
|
196
|
+
declare function renderWithSafety(renderer: TraceRenderer, tree: InspectRunTree, options?: TraceRendererOptions): TraceRendererResult;
|
|
197
|
+
|
|
198
|
+
interface TraceIndexEntry {
|
|
199
|
+
runId: string;
|
|
200
|
+
path: string;
|
|
201
|
+
name?: string;
|
|
202
|
+
startedAt?: number;
|
|
203
|
+
status?: string;
|
|
204
|
+
}
|
|
205
|
+
interface TraceIndexSnapshot {
|
|
206
|
+
traceDir: string;
|
|
207
|
+
builtAt: string;
|
|
208
|
+
entries: TraceIndexEntry[];
|
|
209
|
+
warnings: string[];
|
|
210
|
+
}
|
|
211
|
+
interface TraceIndexOptions {
|
|
212
|
+
maxEntries?: number;
|
|
213
|
+
/** Rebuild when snapshot `builtAt` is older than this ISO timestamp. */
|
|
214
|
+
invalidateBefore?: string;
|
|
215
|
+
[key: string]: unknown;
|
|
216
|
+
}
|
|
217
|
+
interface TraceIndexer {
|
|
218
|
+
readonly id: string;
|
|
219
|
+
rebuild(traceDir: string, options?: TraceIndexOptions): Promise<TraceIndexSnapshot>;
|
|
220
|
+
}
|
|
221
|
+
declare function defineIndexer(indexer: TraceIndexer): TraceIndexer;
|
|
222
|
+
declare function shouldInvalidateIndex(snapshot: TraceIndexSnapshot, options?: TraceIndexOptions): boolean;
|
|
223
|
+
declare function indexIsStale(snapshot: TraceIndexSnapshot, traceDir: string): Promise<boolean>;
|
|
224
|
+
declare function createTraceDirectoryIndexer(): TraceIndexer;
|
|
225
|
+
|
|
226
|
+
export { type AdapterConformanceOptions, type AdapterConformanceResult, type AdapterFixtureSkeleton, type AdapterRegistration, type ConformanceCheck, PLUGIN_MANIFEST_FILENAME, PLUGIN_NAME_PREFIXES, PRIVACY_CHECKLIST_ITEMS, type PluginManifest, type PluginManifestParseResult, type PluginManifestType, type PrivacyChecklistInput, type PrivacyChecklistItem, type PrivacyChecklistResult, type RenderRedactionProfile, type RenderSafetyOptions, type TraceIndexEntry, type TraceIndexOptions, type TraceIndexSnapshot, type TraceIndexer, type TraceRenderer, type TraceRendererOptions, type TraceRendererResult, type TraceTransform, type TraceTransformResult, clearAdapterRegistry, createAdapterFixtureSkeleton, createAdapterRegistration, createConformanceFixtureMeta, createKindFilterTransform, createTraceDirectoryIndexer, defineIndexer, defineRenderer, defineTransform, eventsToJsonl, extractPersistedKinds, findPairedLifecycle, flattenInspectNodes, getRegisteredAdapter, indexIsStale, inferPluginTypeFromName, isPluginPackageName, listRegisteredAdapters, parsePluginManifest, readPluginManifestFile, registerAdapter, renderWithSafety, runAdapterConformance, runPrivacyChecklist, runTransformPipeline, shouldInvalidateIndex, stableStringify, validatePluginPrivacy };
|