@tangle-network/traces 0.23.0 → 1.0.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 +61 -1078
- package/dist/analyst-model-call-JVUOYZ5V.js +20 -0
- package/dist/ask-XLS3VANY.js +39 -0
- package/dist/check-YF6ZHPGG.js +322 -0
- package/dist/chunk-3I4PJ5Q7.js +25 -0
- package/dist/chunk-3T62R7ON.js +5695 -0
- package/dist/chunk-4VKPN432.js +138 -0
- package/dist/chunk-6CLC7DKP.js +492 -0
- package/dist/chunk-7CBV5RJ2.js +535 -0
- package/dist/chunk-B62DOFGI.js +273 -0
- package/dist/chunk-CL3OQOWX.js +407 -0
- package/dist/chunk-DLGAKCQJ.js +782 -0
- package/dist/chunk-DU534HAX.js +263 -0
- package/dist/chunk-GLUDGUGJ.js +232 -0
- package/dist/chunk-J2PM5SVN.js +503 -0
- package/dist/chunk-M3W6TZHQ.js +381 -0
- package/dist/chunk-NH7HCDLB.js +759 -0
- package/dist/chunk-NZ5Y7UEL.js +1217 -0
- package/dist/chunk-O52XK7OB.js +19 -0
- package/dist/chunk-PYH3PL3N.js +62 -0
- package/dist/chunk-RZL5GAWH.js +60 -0
- package/dist/chunk-TR6O4S4T.js +208 -0
- package/dist/chunk-TW43MR5D.js +259 -0
- package/dist/chunk-TYLFUX42.js +228 -0
- package/dist/chunk-UOLRCQHC.js +120 -0
- package/dist/chunk-UVE5ANVV.js +3921 -0
- package/dist/chunk-V2OCGX57.js +53 -0
- package/dist/cli.js +2086 -2050
- package/dist/diff-ZZ6KYBPP.js +16 -0
- package/dist/improvement-OJQ6365E.js +25 -0
- package/dist/index.d.ts +1235 -4357
- package/dist/index.js +53 -1204
- package/dist/live-Y64AJ6MA.js +14 -0
- package/dist/mcp-ZPGTJQYQ.js +85 -0
- package/dist/report-JAMXRTCW.js +338 -0
- package/dist/run-watch-PLWTIRSV.js +649 -0
- package/dist/supervisor-report-RMPLLBGZ.js +29 -0
- package/dist/supervisor-run-context-WO6VOTGV.js +30 -0
- package/dist/upload-R6NMKSGQ.js +20 -0
- package/dist/verify-safe-C5ZXZOZ2.js +8 -0
- package/docs/analyze.md +76 -0
- package/docs/ask.md +88 -0
- package/docs/bundle.md +40 -0
- package/docs/check.md +77 -0
- package/docs/convert.md +44 -0
- package/docs/develop.md +32 -0
- package/docs/diff.md +38 -0
- package/docs/facts.md +114 -0
- package/docs/mcp.md +36 -0
- package/docs/migrate-1.0.md +33 -0
- package/docs/parsers.md +66 -0
- package/docs/release-1.0.0.md +147 -0
- package/docs/sdk.md +77 -0
- package/docs/select.md +70 -0
- package/docs/skills.md +46 -0
- package/docs/upload.md +47 -0
- package/docs/watch-jsonl.v1.example.jsonl +5 -0
- package/docs/watch.md +66 -0
- package/examples/README.md +9 -0
- package/examples/custom-analyst.ts +65 -74
- package/install.sh +22 -2
- package/package.json +8 -7
- package/skills/inspect-agent-traces/SKILL.md +47 -110
- package/dist/chunk-COSWFESO.js +0 -20979
- package/docs/replay-verify.md +0 -123
- package/docs/stream-findings.svg +0 -39
- package/docs/trace-analysts.md +0 -643
- package/examples/custom-backend.ts +0 -21
- package/examples/external-engines.ts +0 -62
- package/examples/improvement-config.mjs +0 -63
- package/examples/observe-and-alert.ts +0 -19
- package/examples/register-harness.ts +0 -26
- package/skills/build-trace-analyst/SKILL.md +0 -76
- package/skills/build-trace-analyst/agents/openai.yaml +0 -4
package/dist/index.js
CHANGED
|
@@ -1,1238 +1,87 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ACTOR_ATTR,
|
|
3
|
-
ANSWERED_TEXT_CAP,
|
|
4
|
-
ATTR,
|
|
5
|
-
AmpAdapter,
|
|
6
|
-
BLOBS_DIR,
|
|
7
|
-
CHANGED_FILE_LIST_CAP,
|
|
8
|
-
CITATION_NORMALIZATION_VERSION,
|
|
9
|
-
CONTENT_CAP,
|
|
10
|
-
COORDINATION_LOG_FILE,
|
|
11
|
-
CORRECTIVE_REACTIONS,
|
|
12
|
-
ClaudeAdapter,
|
|
13
|
-
CodexAdapter,
|
|
14
|
-
CodexExecAdapter,
|
|
15
|
-
CodexExecStreamError,
|
|
16
|
-
CodexTaskScopeError,
|
|
17
|
-
CopilotAdapter,
|
|
18
|
-
DEFAULT_ANALYST_MODEL,
|
|
19
|
-
DEFAULT_ASK_CONCURRENCY,
|
|
20
|
-
DEFAULT_HARNESS,
|
|
21
|
-
DEFAULT_SANDBOX_BASE_URL,
|
|
22
|
-
DEFAULT_SWEEP_THRESHOLD,
|
|
23
|
-
EMPTY_SPAN_RUN_SNAPSHOT,
|
|
24
|
-
EXPORT_RULE,
|
|
25
|
-
EmptySessionError,
|
|
26
|
-
FACT_LIST_CAP,
|
|
27
|
-
FACT_TEXT_CAP,
|
|
28
|
-
GeminiAdapter,
|
|
29
|
-
HarnessSessionsAdapter,
|
|
30
|
-
INGEST_SOURCE_CLI,
|
|
31
|
-
INHERITED_SOURCE_ATTR,
|
|
32
|
-
INHERITED_SPANS_OMITTED_ATTR,
|
|
33
|
-
INHERITED_SPAN_ATTR,
|
|
34
|
-
INHERITED_SPAN_COUNT_ATTR,
|
|
35
|
-
JsonSourceError,
|
|
36
|
-
JsonlParseError,
|
|
37
|
-
MAX_SHELL_DEPTH,
|
|
38
|
-
MAX_TRACE_QUESTION_CHARS,
|
|
39
|
-
OpencodeAdapter,
|
|
40
|
-
POLICY_EVIDENCE_NOTE,
|
|
41
|
-
PREPARED_CONTEXT_BYTE_CEILING,
|
|
42
|
-
PartialUploadError,
|
|
43
|
-
QwenAdapter,
|
|
44
|
-
REACTIONS,
|
|
45
|
-
RESULT_FILE,
|
|
46
|
-
RULE,
|
|
47
|
-
SESSION_CWD_ATTR,
|
|
48
|
-
SESSION_FACTS_MEASUREMENT_VERSION,
|
|
49
|
-
SESSION_FACTS_VERSION_SUFFIX,
|
|
50
|
-
SESSION_TOKEN_TOTAL_ATTR,
|
|
51
|
-
SOURCE_ATTRIBUTE_PREFIX,
|
|
52
|
-
SPAN_SYNTHESIZED_ATTR,
|
|
53
|
-
SPAWN_JOURNAL_FILE,
|
|
54
|
-
STATUS_MARK,
|
|
55
|
-
SYNTHESIZED_SOURCE_ATTR,
|
|
56
|
-
SYNTHESIZED_SPAN_ATTR,
|
|
57
|
-
SessionWorkflowError,
|
|
58
|
-
SkillUsageStore,
|
|
59
|
-
TRACE_QUESTION_PREVIEW_HEAD_CHARS,
|
|
60
|
-
ZERO_ROLL,
|
|
61
|
-
addSpend,
|
|
62
|
-
alreadyUploaded,
|
|
63
|
-
analysisEngineFromEnv,
|
|
64
|
-
analyzeAdoption,
|
|
65
|
-
analyzeLiveBatch,
|
|
66
|
-
analyzeLoopConvergence,
|
|
67
|
-
analyzeReactions,
|
|
68
2
|
analyzeSpans,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
3
|
+
buildTraceFindingPacket,
|
|
4
|
+
runTraceInvestigation
|
|
5
|
+
} from "./chunk-J2PM5SVN.js";
|
|
6
|
+
import {
|
|
7
|
+
analysisEngineFromEnv
|
|
8
|
+
} from "./chunk-GLUDGUGJ.js";
|
|
9
|
+
import {
|
|
10
|
+
runTraceQuestions
|
|
11
|
+
} from "./chunk-NH7HCDLB.js";
|
|
12
|
+
import {
|
|
13
|
+
streamSessions
|
|
14
|
+
} from "./chunk-UOLRCQHC.js";
|
|
15
|
+
import "./chunk-7CBV5RJ2.js";
|
|
16
|
+
import {
|
|
17
|
+
executeUpload,
|
|
18
|
+
planUpload
|
|
19
|
+
} from "./chunk-B62DOFGI.js";
|
|
20
|
+
import {
|
|
72
21
|
assembleSessionBundle,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
22
|
+
verifySessionBundle
|
|
23
|
+
} from "./chunk-DLGAKCQJ.js";
|
|
24
|
+
import {
|
|
25
|
+
conformanceOfSpans
|
|
26
|
+
} from "./chunk-TW43MR5D.js";
|
|
27
|
+
import "./chunk-PYH3PL3N.js";
|
|
28
|
+
import "./chunk-O52XK7OB.js";
|
|
29
|
+
import "./chunk-V2OCGX57.js";
|
|
30
|
+
import {
|
|
31
|
+
verifySafe
|
|
32
|
+
} from "./chunk-4VKPN432.js";
|
|
33
|
+
import "./chunk-3I4PJ5Q7.js";
|
|
34
|
+
import {
|
|
35
|
+
diffRuns,
|
|
36
|
+
renderRunDiff
|
|
37
|
+
} from "./chunk-TYLFUX42.js";
|
|
38
|
+
import "./chunk-CL3OQOWX.js";
|
|
39
|
+
import "./chunk-6CLC7DKP.js";
|
|
40
|
+
import {
|
|
77
41
|
buildSessionFactsReport,
|
|
78
|
-
buildSessionIndex,
|
|
79
|
-
buildSessionIndexFromRows,
|
|
80
|
-
buildSkillUsageReport,
|
|
81
|
-
buildSpanRunTree,
|
|
82
|
-
buildTraceFindingPacket,
|
|
83
|
-
capText,
|
|
84
|
-
chatTrajectoryToSpans,
|
|
85
|
-
classifyEvidenceOnlyPath,
|
|
86
|
-
classifyFailureFollowUps,
|
|
87
|
-
classifyLiveActions,
|
|
88
|
-
classifyReaction,
|
|
89
|
-
claudeActor,
|
|
90
|
-
codexActor,
|
|
91
|
-
collectPolicyEvidence,
|
|
92
|
-
collectSessionIndex,
|
|
93
|
-
collectSessionSelection,
|
|
94
|
-
collectSessionWorkflow,
|
|
95
|
-
commandAnalyzer,
|
|
96
|
-
commandRedactor,
|
|
97
|
-
commandTextFromInput,
|
|
98
|
-
computeAdoption,
|
|
99
42
|
computeSessionFacts,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
createBundleSourceReader,
|
|
104
|
-
createFindingRejectionTally,
|
|
105
|
-
createSessionFactsReportBuilder,
|
|
106
|
-
cwdMatchesSelection,
|
|
107
|
-
cwdMatchesSelectionResolved,
|
|
108
|
-
defaultSkillCatalogRoots,
|
|
109
|
-
defaultSkillUsageSources,
|
|
110
|
-
defaultSkillUsageStorePath,
|
|
111
|
-
defaultTraceLiveAnalysts,
|
|
112
|
-
describeSessionRelationship,
|
|
113
|
-
diffRuns,
|
|
114
|
-
engineCallReservationFloorUsd,
|
|
115
|
-
environmentAttributes,
|
|
116
|
-
environmentFromSpanAttributes,
|
|
117
|
-
equivalentGitCwds,
|
|
118
|
-
executeUpload,
|
|
119
|
-
exportTraceEvidenceFile,
|
|
120
|
-
exportTraceEvidenceRows,
|
|
121
|
-
exportTraceEvidenceText,
|
|
122
|
-
externalFailureMessage,
|
|
123
|
-
fileRunContextSupervisorRunReader,
|
|
124
|
-
fileSha256,
|
|
125
|
-
findContextRoot,
|
|
126
|
-
findSessionTextLeaks,
|
|
127
|
-
findSpanSourceFiles,
|
|
128
|
-
findingRejection,
|
|
129
|
-
findingRejectionDetail,
|
|
130
|
-
forEachTreeNode,
|
|
131
|
-
formatFindingRejections,
|
|
132
|
-
formatVerdict,
|
|
133
|
-
haloAnalyzer,
|
|
134
|
-
hashSessionBundleFiles,
|
|
135
|
-
hodoscopeAnalyzer,
|
|
136
|
-
httpJsonTransport,
|
|
137
|
-
importCodeTraceBench,
|
|
138
|
-
incompleteInputsNote,
|
|
139
|
-
indexSessionIdsByTrace,
|
|
140
|
-
inferRole,
|
|
141
|
-
inferSpanKind,
|
|
142
|
-
inspectSessionIndex,
|
|
143
|
-
int,
|
|
144
|
-
isBridgeMismatchError,
|
|
145
|
-
isChatTrajectory,
|
|
146
|
-
isChatTrajectoryMessage,
|
|
147
|
-
isFileRunContextDir,
|
|
148
|
-
isInheritedSpan,
|
|
149
|
-
isMissingJsonSource,
|
|
150
|
-
isMissingPathError,
|
|
151
|
-
isSynthesizedSpan,
|
|
152
|
-
iterSerializedSpans,
|
|
43
|
+
renderSessionFacts
|
|
44
|
+
} from "./chunk-UVE5ANVV.js";
|
|
45
|
+
import {
|
|
153
46
|
knownHarnesses,
|
|
154
|
-
listAdapters,
|
|
155
|
-
listSessionBundleFiles,
|
|
156
|
-
loadState,
|
|
157
|
-
loadTraceQuestionsFile,
|
|
158
|
-
loadTracesConfig,
|
|
159
|
-
locateSessions,
|
|
160
|
-
looksLikeAgentPrompt,
|
|
161
|
-
mergeRolls,
|
|
162
|
-
mergeTracesConfig,
|
|
163
|
-
ms,
|
|
164
|
-
normalizeAnalystCitations,
|
|
165
|
-
normalizeRemote,
|
|
166
|
-
normalizeTraceQuestions,
|
|
167
|
-
otlpRowToSpan,
|
|
168
|
-
outboundHash,
|
|
169
|
-
parseIsoToEpochMs,
|
|
170
|
-
parseJsonAnswer,
|
|
171
47
|
parseSession,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
planUpload,
|
|
176
|
-
primeAnalyzer,
|
|
177
|
-
projectSessionBundle,
|
|
178
|
-
readCoordinationLog,
|
|
179
|
-
readFileRunContext,
|
|
180
|
-
readInstalledSkills,
|
|
181
|
-
readJsonFile,
|
|
182
|
-
readJsonl,
|
|
183
|
-
readOtlpInput,
|
|
184
|
-
readPullRequests,
|
|
185
|
-
readRunContextJournal,
|
|
186
|
-
readRunContextSnapshot,
|
|
187
|
-
readRunSide,
|
|
188
|
-
readRunWatchSnapshot,
|
|
189
|
-
readSessionBundleManifest,
|
|
190
|
-
readSessionIndexFile,
|
|
191
|
-
readSpanRunSnapshot,
|
|
192
|
-
recordSessionCorruption,
|
|
193
|
-
recordToolOutput,
|
|
194
|
-
redactSpans,
|
|
195
|
-
renderConformance,
|
|
196
|
-
renderInspectionReport,
|
|
197
|
-
renderRunContextSnapshot,
|
|
198
|
-
renderRunDiff,
|
|
199
|
-
renderRunWatchSnapshot,
|
|
200
|
-
renderSessionFacts,
|
|
201
|
-
renderSessionFactsContext,
|
|
202
|
-
renderSkillUsage,
|
|
203
|
-
renderSpanRunSnapshot,
|
|
204
|
-
renderTraceQuestionInstructions,
|
|
205
|
-
renderTraceQuestionPrompt,
|
|
206
|
-
renderTraceQuestionsReport,
|
|
207
|
-
renderValidation,
|
|
208
|
-
resolveAdapter,
|
|
209
|
-
resolveOtlpInputFiles,
|
|
210
|
-
resolveRepoAttrs,
|
|
211
|
-
resolveRunContextDir,
|
|
212
|
-
resolveRunWatchTarget,
|
|
213
|
-
resolveSessionRepoAttrs,
|
|
214
|
-
runCommand,
|
|
215
|
-
runExternalAnalyzers,
|
|
216
|
-
runPipelines,
|
|
217
|
-
runTotals,
|
|
218
|
-
runTraceImprovement,
|
|
219
|
-
runTraceInvestigation,
|
|
220
|
-
runTraceQuestions,
|
|
221
|
-
runTraceStoreInvestigation,
|
|
222
|
-
sandboxReplayBackend,
|
|
223
|
-
saveReport,
|
|
224
|
-
saveState,
|
|
225
|
-
scanSessions,
|
|
226
|
-
selectAdapters,
|
|
227
|
-
serializeInspectionReport,
|
|
228
|
-
serializePolicyEvidence,
|
|
229
|
-
serializeSessionIndex,
|
|
230
|
-
serializeSpans,
|
|
231
|
-
serializeTraceStreamEvent,
|
|
232
|
-
sessionFactsContext,
|
|
233
|
-
sessionHash,
|
|
234
|
-
sessionIdFromAttributes,
|
|
235
|
-
sessionIntegrityAttributes,
|
|
236
|
-
sessionJsonlOptions,
|
|
237
|
-
sessionTextSignatures,
|
|
238
|
-
shellCommands,
|
|
239
|
-
skippedAnalyses,
|
|
240
|
-
sourceOf,
|
|
241
|
-
span,
|
|
242
|
-
spanRunTotals,
|
|
243
|
-
stampEnvironmentAttrs,
|
|
244
|
-
stampRepoAttrs,
|
|
245
|
-
stampSessionIdentity,
|
|
246
|
-
stampSessionIntegrity,
|
|
247
|
-
stampSpanWorkdirRepoAttrs,
|
|
248
|
-
streamSessions,
|
|
249
|
-
summarizeOtlpExecution,
|
|
250
|
-
summarizeSpanExecution,
|
|
251
|
-
summarizeSpanStructure,
|
|
252
|
-
takeJsonl,
|
|
253
|
-
textIsSynthetic,
|
|
254
|
-
textSources,
|
|
255
|
-
toOpenInferenceSpan,
|
|
256
|
-
toRuntimeStore,
|
|
257
|
-
toTraceSpanEvents,
|
|
258
|
-
tokens,
|
|
259
|
-
toolIoAttributes,
|
|
260
|
-
totalAgenticFailureMessage,
|
|
261
|
-
totalFindingRejections,
|
|
262
|
-
traceAgenticKinds,
|
|
263
|
-
traceCitationsInText,
|
|
264
|
-
traceStreamEventsFromSpans,
|
|
265
|
-
unavailableCapabilities,
|
|
266
|
-
uploadKey,
|
|
267
|
-
usd,
|
|
268
|
-
userPromptSpan,
|
|
269
|
-
validateOtlpSpans,
|
|
270
|
-
validationExitCode,
|
|
271
|
-
verdictExitCode,
|
|
272
|
-
verifyFindingsInSandbox,
|
|
273
|
-
verifySafe,
|
|
274
|
-
verifySessionBundle,
|
|
275
|
-
watchRunTarget,
|
|
276
|
-
watchSessions,
|
|
277
|
-
withSessionFactsContext,
|
|
278
|
-
wrap,
|
|
279
|
-
writeHodoscopeInput,
|
|
280
|
-
writeInspectionReportFile,
|
|
281
|
-
writeOtlpFile,
|
|
282
|
-
writePolicyEvidenceFile,
|
|
283
|
-
writeSessionBundleManifest,
|
|
284
|
-
writeSessionIndexFile,
|
|
285
|
-
writeTraceEvidenceExportFile,
|
|
286
|
-
writeTraceImprovementArtifacts,
|
|
287
|
-
writeTraceQuestionsArtifacts,
|
|
288
|
-
zaiChatCaller,
|
|
289
|
-
zeroPricedCost
|
|
290
|
-
} from "./chunk-COSWFESO.js";
|
|
291
|
-
|
|
292
|
-
// src/adapters/factory.ts
|
|
293
|
-
import { readdir, stat } from "fs/promises";
|
|
294
|
-
import { homedir } from "os";
|
|
295
|
-
import { basename, join } from "path";
|
|
296
|
-
var SERVICE = "factory";
|
|
297
|
-
function textOf(content) {
|
|
298
|
-
return capText(
|
|
299
|
-
(content ?? []).filter((b) => b.type === "text" && typeof b.text === "string").map((b) => b.text).join("")
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
var FactoryAdapter = class {
|
|
303
|
-
harness = "factory";
|
|
304
|
-
aliases = ["factory-droids", "droid"];
|
|
305
|
-
root() {
|
|
306
|
-
return join(homedir(), ".factory", "sessions");
|
|
307
|
-
}
|
|
308
|
-
async locate(opts = {}) {
|
|
309
|
-
const root = this.root();
|
|
310
|
-
let dirs;
|
|
311
|
-
try {
|
|
312
|
-
dirs = await readdir(root);
|
|
313
|
-
} catch (error) {
|
|
314
|
-
if (isMissingPathError(error)) return [];
|
|
315
|
-
throw error;
|
|
316
|
-
}
|
|
317
|
-
const refs = [];
|
|
318
|
-
for (const dir of dirs) {
|
|
319
|
-
const dp = join(root, dir);
|
|
320
|
-
let files;
|
|
321
|
-
try {
|
|
322
|
-
files = await readdir(dp);
|
|
323
|
-
} catch (error) {
|
|
324
|
-
if (isMissingPathError(error)) continue;
|
|
325
|
-
throw error;
|
|
326
|
-
}
|
|
327
|
-
const cwd = dir.replace(/-/g, "/");
|
|
328
|
-
if (opts.cwd && !cwd.startsWith(opts.cwd)) continue;
|
|
329
|
-
for (const f of files) {
|
|
330
|
-
if (!f.endsWith(".jsonl")) continue;
|
|
331
|
-
const path = join(dp, f);
|
|
332
|
-
let st;
|
|
333
|
-
try {
|
|
334
|
-
st = await stat(path);
|
|
335
|
-
} catch (error) {
|
|
336
|
-
if (isMissingPathError(error)) continue;
|
|
337
|
-
throw error;
|
|
338
|
-
}
|
|
339
|
-
if (opts.sinceMs && st.mtimeMs < opts.sinceMs) continue;
|
|
340
|
-
refs.push({ harness: this.harness, sessionId: basename(f, ".jsonl"), path, cwd, mtimeMs: st.mtimeMs });
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
return refs.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
344
|
-
}
|
|
345
|
-
async sourcePaths(ref) {
|
|
346
|
-
const sidecar = ref.path.replace(/\.jsonl$/, ".settings.json");
|
|
347
|
-
try {
|
|
348
|
-
await stat(sidecar);
|
|
349
|
-
return [ref.path, sidecar];
|
|
350
|
-
} catch (error) {
|
|
351
|
-
if (isMissingPathError(error)) return [ref.path];
|
|
352
|
-
throw error;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
async parse(ref, options = {}) {
|
|
356
|
-
let settings = {};
|
|
357
|
-
try {
|
|
358
|
-
settings = await readJsonFile(ref.path.replace(/\.jsonl$/, ".settings.json"));
|
|
359
|
-
} catch (error) {
|
|
360
|
-
if (!isMissingJsonSource(error)) throw error;
|
|
361
|
-
}
|
|
362
|
-
const sourceTraceId = ref.sessionId;
|
|
363
|
-
const sourceRootId = `root:${sourceTraceId}`;
|
|
364
|
-
const spans = [];
|
|
365
|
-
const toolByUseId = /* @__PURE__ */ new Map();
|
|
366
|
-
let firstTimestamp;
|
|
367
|
-
let lastTimestamp;
|
|
368
|
-
let sessionLine;
|
|
369
|
-
let sawLine = false;
|
|
370
|
-
let step = 0;
|
|
371
|
-
let lastLlm = sourceRootId;
|
|
372
|
-
for await (const l of readJsonl(ref.path, sessionJsonlOptions(ref, options))) {
|
|
373
|
-
if (!sawLine) {
|
|
374
|
-
firstTimestamp = l.timestamp;
|
|
375
|
-
sawLine = true;
|
|
376
|
-
}
|
|
377
|
-
lastTimestamp = l.timestamp;
|
|
378
|
-
if (!sessionLine && l.type === "session_start") {
|
|
379
|
-
sessionLine = { id: l.id, timestamp: l.timestamp };
|
|
380
|
-
}
|
|
381
|
-
if (l.type !== "message" || !l.message) continue;
|
|
382
|
-
const ts = l.timestamp ?? (/* @__PURE__ */ new Date(0)).toISOString();
|
|
383
|
-
const role = l.message.role;
|
|
384
|
-
const text = textOf(l.message.content);
|
|
385
|
-
if (role === "user") {
|
|
386
|
-
if (text) {
|
|
387
|
-
spans.push(
|
|
388
|
-
userPromptSpan({
|
|
389
|
-
traceId: sourceTraceId,
|
|
390
|
-
spanId: `user:${l.id ?? step}`,
|
|
391
|
-
parentSpanId: sourceRootId,
|
|
392
|
-
startTime: ts,
|
|
393
|
-
content: text,
|
|
394
|
-
contentSource: textSources(l.message, "content"),
|
|
395
|
-
service: SERVICE,
|
|
396
|
-
agent: SERVICE,
|
|
397
|
-
step
|
|
398
|
-
})
|
|
399
|
-
);
|
|
400
|
-
step += 1;
|
|
401
|
-
}
|
|
402
|
-
} else {
|
|
403
|
-
const llmId = `llm:${l.id ?? step}`;
|
|
404
|
-
spans.push(
|
|
405
|
-
span({
|
|
406
|
-
traceId: sourceTraceId,
|
|
407
|
-
spanId: llmId,
|
|
408
|
-
parentSpanId: sourceRootId,
|
|
409
|
-
name: `message.${role ?? "unknown"}`,
|
|
410
|
-
kind: "LLM",
|
|
411
|
-
startTime: ts,
|
|
412
|
-
service: SERVICE,
|
|
413
|
-
agent: SERVICE,
|
|
414
|
-
model: settings.model ?? null,
|
|
415
|
-
step,
|
|
416
|
-
content: text || null,
|
|
417
|
-
contentSource: textSources(l.message, "content")
|
|
418
|
-
})
|
|
419
|
-
);
|
|
420
|
-
lastLlm = llmId;
|
|
421
|
-
step += 1;
|
|
422
|
-
}
|
|
423
|
-
for (const b of l.message.content ?? []) {
|
|
424
|
-
if (b.type === "tool_use" && b.name) {
|
|
425
|
-
const t = span({
|
|
426
|
-
traceId: sourceTraceId,
|
|
427
|
-
spanId: `tool:${b.id ?? `${l.id}:${step}`}`,
|
|
428
|
-
parentSpanId: lastLlm,
|
|
429
|
-
name: `tool.${b.name}`,
|
|
430
|
-
kind: "TOOL",
|
|
431
|
-
startTime: ts,
|
|
432
|
-
service: SERVICE,
|
|
433
|
-
agent: SERVICE,
|
|
434
|
-
tool: b.name,
|
|
435
|
-
step,
|
|
436
|
-
extra: toolIoAttributes({ input: b.input, inputSource: sourceOf(b, "input") })
|
|
437
|
-
});
|
|
438
|
-
spans.push(t);
|
|
439
|
-
if (b.id) toolByUseId.set(b.id, t);
|
|
440
|
-
step += 1;
|
|
441
|
-
} else if (b.type === "tool_result" && b.tool_use_id) {
|
|
442
|
-
const t = toolByUseId.get(b.tool_use_id);
|
|
443
|
-
if (t) {
|
|
444
|
-
t.status = b.is_error === true ? { code: "ERROR", message: "tool reported error" } : { code: "OK" };
|
|
445
|
-
recordToolOutput(t, b.content, sourceOf(b, "content"));
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
const traceId = sessionLine?.id ?? sourceTraceId;
|
|
451
|
-
const rootId = `root:${traceId}`;
|
|
452
|
-
for (const item of spans) {
|
|
453
|
-
item.trace_id = traceId;
|
|
454
|
-
if (item.parent_span_id === sourceRootId) item.parent_span_id = rootId;
|
|
455
|
-
}
|
|
456
|
-
const root = span({
|
|
457
|
-
traceId,
|
|
458
|
-
spanId: rootId,
|
|
459
|
-
parentSpanId: null,
|
|
460
|
-
name: "session",
|
|
461
|
-
kind: "AGENT",
|
|
462
|
-
startTime: sessionLine?.timestamp ?? firstTimestamp ?? (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
463
|
-
endTime: lastTimestamp,
|
|
464
|
-
service: SERVICE,
|
|
465
|
-
agent: SERVICE,
|
|
466
|
-
model: settings.model ?? null,
|
|
467
|
-
extra: settings.tokenUsage ? {
|
|
468
|
-
"session.input_tokens": settings.tokenUsage.inputTokens ?? 0,
|
|
469
|
-
"session.output_tokens": settings.tokenUsage.outputTokens ?? 0
|
|
470
|
-
} : void 0
|
|
471
|
-
});
|
|
472
|
-
if (sessionLine?.id) root.attributes["tangle.sessionId"] = sessionLine.id;
|
|
473
|
-
return [root, ...spans];
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
|
|
477
|
-
// src/adapters/pi.ts
|
|
478
|
-
import { readdir as readdir2, stat as stat2 } from "fs/promises";
|
|
479
|
-
import { homedir as homedir2 } from "os";
|
|
480
|
-
import { basename as basename2, join as join2, resolve } from "path";
|
|
481
|
-
var SERVICE2 = "pi";
|
|
482
|
-
function terminalStatus(message) {
|
|
483
|
-
const stopReason = message?.stopReason ?? "missing";
|
|
484
|
-
if (message?.role === "assistant" && stopReason === "stop") {
|
|
485
|
-
return { status: "OK", stopReason };
|
|
486
|
-
}
|
|
487
|
-
if (message?.role === "assistant" && (stopReason === "error" || message.errorMessage)) {
|
|
488
|
-
return {
|
|
489
|
-
status: "ERROR",
|
|
490
|
-
statusMessage: message.errorMessage?.slice(0, 500) ?? "Pi assistant stopped with an error",
|
|
491
|
-
stopReason
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
return {
|
|
495
|
-
status: "UNSET",
|
|
496
|
-
statusMessage: message === void 0 ? "Pi session contained no messages" : `Pi session ended after ${message.role} with stopReason "${stopReason}"`,
|
|
497
|
-
stopReason
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
function isToolBlock(b) {
|
|
501
|
-
return typeof b.type === "string" && /tool[_-]?call|tool[_-]?use|^tool$/i.test(b.type);
|
|
502
|
-
}
|
|
503
|
-
function isToolResultBlock(b) {
|
|
504
|
-
return typeof b.type === "string" && /tool[_-]?result|tool[_-]?output/i.test(b.type);
|
|
505
|
-
}
|
|
506
|
-
function textOf2(content) {
|
|
507
|
-
if (!content) return "";
|
|
508
|
-
return capText(
|
|
509
|
-
content.filter((b) => b.type === "text" && typeof b.text === "string").map((b) => b.text).join("")
|
|
510
|
-
);
|
|
511
|
-
}
|
|
512
|
-
function toolResultOutput(content) {
|
|
513
|
-
if (content?.length === 1 && content[0]?.type === "text" && typeof content[0].text === "string") {
|
|
514
|
-
return content[0].text;
|
|
515
|
-
}
|
|
516
|
-
return content;
|
|
517
|
-
}
|
|
518
|
-
function completeToolSpan(toolSpan, result) {
|
|
519
|
-
toolSpan.end_time = result.timestamp;
|
|
520
|
-
toolSpan.status = result.isError ? { code: "ERROR", message: result.errorMessage } : { code: "OK" };
|
|
521
|
-
recordToolOutput(toolSpan, result.output, result.source);
|
|
522
|
-
}
|
|
523
|
-
var PiAdapter = class {
|
|
524
|
-
harness = "pi";
|
|
525
|
-
sessionsRoot;
|
|
526
|
-
constructor(options = {}) {
|
|
527
|
-
this.sessionsRoot = resolve(options.sessionsRoot ?? join2(homedir2(), ".pi", "agent", "sessions"));
|
|
528
|
-
}
|
|
529
|
-
root() {
|
|
530
|
-
return this.sessionsRoot;
|
|
531
|
-
}
|
|
532
|
-
async locate(opts = {}) {
|
|
533
|
-
const root = this.root();
|
|
534
|
-
let entries;
|
|
535
|
-
try {
|
|
536
|
-
entries = await readdir2(root, { withFileTypes: true });
|
|
537
|
-
} catch (error) {
|
|
538
|
-
if (isMissingPathError(error)) return [];
|
|
539
|
-
throw error;
|
|
540
|
-
}
|
|
541
|
-
const paths = [];
|
|
542
|
-
for (const entry of entries) {
|
|
543
|
-
if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
544
|
-
paths.push(join2(root, entry.name));
|
|
545
|
-
continue;
|
|
546
|
-
}
|
|
547
|
-
if (!entry.isDirectory()) continue;
|
|
548
|
-
const dir = join2(root, entry.name);
|
|
549
|
-
let files;
|
|
550
|
-
try {
|
|
551
|
-
files = await readdir2(dir);
|
|
552
|
-
} catch (error) {
|
|
553
|
-
if (isMissingPathError(error)) continue;
|
|
554
|
-
throw error;
|
|
555
|
-
}
|
|
556
|
-
for (const file of files) {
|
|
557
|
-
if (file.endsWith(".jsonl")) paths.push(join2(dir, file));
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
const refs = [];
|
|
561
|
-
for (const path of paths) {
|
|
562
|
-
const f = basename2(path);
|
|
563
|
-
let st;
|
|
564
|
-
try {
|
|
565
|
-
st = await stat2(path);
|
|
566
|
-
} catch (error) {
|
|
567
|
-
if (isMissingPathError(error)) continue;
|
|
568
|
-
throw error;
|
|
569
|
-
}
|
|
570
|
-
if (opts.sinceMs && st.mtimeMs < opts.sinceMs) continue;
|
|
571
|
-
let id = basename2(f, ".jsonl").replace(/^[\dTZ.-]+_/, "");
|
|
572
|
-
let cwd = null;
|
|
573
|
-
const ref = {
|
|
574
|
-
harness: this.harness,
|
|
575
|
-
sessionId: id,
|
|
576
|
-
path,
|
|
577
|
-
cwd,
|
|
578
|
-
mtimeMs: st.mtimeMs
|
|
579
|
-
};
|
|
580
|
-
const [session] = await takeJsonl(path, 1, sessionJsonlOptions(ref));
|
|
581
|
-
if (session?.type === "session") {
|
|
582
|
-
if (session.id) id = session.id;
|
|
583
|
-
if (session.cwd) cwd = session.cwd;
|
|
584
|
-
}
|
|
585
|
-
ref.sessionId = id;
|
|
586
|
-
ref.cwd = cwd;
|
|
587
|
-
if (ref.integrity) {
|
|
588
|
-
ref.integrity.corruptions = ref.integrity.corruptions.map((receipt) => ({
|
|
589
|
-
...receipt,
|
|
590
|
-
sessionId: id
|
|
591
|
-
}));
|
|
592
|
-
}
|
|
593
|
-
if (opts.cwd && (!cwd || !cwd.startsWith(opts.cwd))) continue;
|
|
594
|
-
refs.push(ref);
|
|
595
|
-
}
|
|
596
|
-
return refs.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
597
|
-
}
|
|
598
|
-
async parse(ref, options = {}) {
|
|
599
|
-
const sourceTraceId = ref.sessionId;
|
|
600
|
-
const sourceRootId = `root:${sourceTraceId}`;
|
|
601
|
-
const spans = [];
|
|
602
|
-
const toolByCallId = /* @__PURE__ */ new Map();
|
|
603
|
-
const pendingResults = /* @__PURE__ */ new Map();
|
|
604
|
-
let firstTimestamp;
|
|
605
|
-
let lastTimestamp;
|
|
606
|
-
let sessionLine;
|
|
607
|
-
let terminalMessage;
|
|
608
|
-
let sawLine = false;
|
|
609
|
-
let step = 0;
|
|
610
|
-
for await (const l of readJsonl(ref.path, sessionJsonlOptions(ref, options))) {
|
|
611
|
-
if (!sawLine) {
|
|
612
|
-
firstTimestamp = l.timestamp;
|
|
613
|
-
sawLine = true;
|
|
614
|
-
}
|
|
615
|
-
lastTimestamp = l.timestamp;
|
|
616
|
-
if (!sessionLine && l.type === "session") {
|
|
617
|
-
sessionLine = { id: l.id, timestamp: l.timestamp };
|
|
618
|
-
}
|
|
619
|
-
if (l.type === "compaction") {
|
|
620
|
-
spans.push(span({
|
|
621
|
-
traceId: sourceTraceId,
|
|
622
|
-
spanId: "compacted:" + (l.id ?? step),
|
|
623
|
-
parentSpanId: sourceRootId,
|
|
624
|
-
name: "session.compacted",
|
|
625
|
-
kind: "CHAIN",
|
|
626
|
-
service: SERVICE2,
|
|
627
|
-
agent: SERVICE2,
|
|
628
|
-
startTime: l.timestamp ?? "",
|
|
629
|
-
step: step++,
|
|
630
|
-
content: typeof l.summary === "string" ? capText(l.summary) : void 0,
|
|
631
|
-
contentSource: sourceOf(l, "summary"),
|
|
632
|
-
extra: {
|
|
633
|
-
...typeof l.tokensBefore === "number" && Number.isFinite(l.tokensBefore) && l.tokensBefore >= 0 ? { "traces.compaction.tokens_before": l.tokensBefore } : {},
|
|
634
|
-
...typeof l.firstKeptEntryId === "string" ? { "traces.pi.first_kept_entry_id": l.firstKeptEntryId } : {},
|
|
635
|
-
...l.systemMessage !== void 0 ? { "gen_ai.system_instructions": JSON.stringify(l.systemMessage) } : {}
|
|
636
|
-
}
|
|
637
|
-
}));
|
|
638
|
-
continue;
|
|
639
|
-
}
|
|
640
|
-
if (l.type !== "message" || !l.message) continue;
|
|
641
|
-
const ts = l.timestamp ?? (/* @__PURE__ */ new Date(0)).toISOString();
|
|
642
|
-
const mid = l.id ?? `m${step}`;
|
|
643
|
-
const msg = l.message;
|
|
644
|
-
terminalMessage = {
|
|
645
|
-
role: msg.role ?? "unknown",
|
|
646
|
-
stopReason: msg.stopReason,
|
|
647
|
-
errorMessage: msg.errorMessage
|
|
648
|
-
};
|
|
649
|
-
const llmId = `llm:${mid}`;
|
|
650
|
-
if (msg.role === "toolResult") {
|
|
651
|
-
const callId = msg.toolCallId ?? `${mid}:result`;
|
|
652
|
-
const errorMessage = textOf2(msg.content).slice(0, 500) || "tool result reported error";
|
|
653
|
-
const result = {
|
|
654
|
-
callId,
|
|
655
|
-
toolName: msg.toolName ?? "tool",
|
|
656
|
-
timestamp: ts,
|
|
657
|
-
isError: msg.isError === true,
|
|
658
|
-
output: toolResultOutput(msg.content),
|
|
659
|
-
source: msg.content?.length === 1 && msg.content[0]?.type === "text" && typeof msg.content[0].text === "string" ? sourceOf(msg.content[0], "text") : sourceOf(msg, "content"),
|
|
660
|
-
errorMessage,
|
|
661
|
-
step
|
|
662
|
-
};
|
|
663
|
-
const toolSpan = toolByCallId.get(callId);
|
|
664
|
-
if (toolSpan) completeToolSpan(toolSpan, result);
|
|
665
|
-
else {
|
|
666
|
-
pendingResults.set(callId, result);
|
|
667
|
-
step += 1;
|
|
668
|
-
}
|
|
669
|
-
continue;
|
|
670
|
-
} else if (msg.role === "user") {
|
|
671
|
-
const prompt = textOf2(msg.content);
|
|
672
|
-
if (prompt) {
|
|
673
|
-
spans.push(
|
|
674
|
-
userPromptSpan({
|
|
675
|
-
traceId: sourceTraceId,
|
|
676
|
-
spanId: `${mid}:user`,
|
|
677
|
-
parentSpanId: sourceRootId,
|
|
678
|
-
startTime: ts,
|
|
679
|
-
service: SERVICE2,
|
|
680
|
-
agent: SERVICE2,
|
|
681
|
-
step,
|
|
682
|
-
content: prompt,
|
|
683
|
-
contentSource: textSources(msg, "content")
|
|
684
|
-
})
|
|
685
|
-
);
|
|
686
|
-
step += 1;
|
|
687
|
-
}
|
|
688
|
-
} else {
|
|
689
|
-
const errored = !!msg.errorMessage;
|
|
690
|
-
spans.push(
|
|
691
|
-
span({
|
|
692
|
-
traceId: sourceTraceId,
|
|
693
|
-
spanId: llmId,
|
|
694
|
-
parentSpanId: sourceRootId,
|
|
695
|
-
name: `message.${msg.role ?? "unknown"}`,
|
|
696
|
-
kind: "LLM",
|
|
697
|
-
startTime: ts,
|
|
698
|
-
status: errored ? "ERROR" : "OK",
|
|
699
|
-
statusMessage: errored ? msg.errorMessage.slice(0, 500) : void 0,
|
|
700
|
-
service: SERVICE2,
|
|
701
|
-
agent: SERVICE2,
|
|
702
|
-
model: msg.model ?? null,
|
|
703
|
-
inputTokens: msg.usage?.input ?? null,
|
|
704
|
-
outputTokens: msg.usage?.output ?? null,
|
|
705
|
-
reasoningTokens: msg.usage?.reasoning ?? null,
|
|
706
|
-
cachedInputTokens: msg.usage?.cacheRead ?? null,
|
|
707
|
-
cacheWriteInputTokens: msg.usage?.cacheWrite ?? null,
|
|
708
|
-
step,
|
|
709
|
-
content: textOf2(msg.content) || null,
|
|
710
|
-
contentSource: textSources(msg, "content")
|
|
711
|
-
})
|
|
712
|
-
);
|
|
713
|
-
step += 1;
|
|
714
|
-
}
|
|
715
|
-
for (const b of msg.content ?? []) {
|
|
716
|
-
if (isToolBlock(b)) {
|
|
717
|
-
const name = b.toolName ?? b.name ?? "tool";
|
|
718
|
-
const callId = b.id ?? b.callId ?? b.toolCallId ?? `${mid}:${step}`;
|
|
719
|
-
const toolSpan = span({
|
|
720
|
-
traceId: sourceTraceId,
|
|
721
|
-
spanId: `tool:${callId}`,
|
|
722
|
-
parentSpanId: llmId,
|
|
723
|
-
name: `tool.${name}`,
|
|
724
|
-
kind: "TOOL",
|
|
725
|
-
startTime: ts,
|
|
726
|
-
service: SERVICE2,
|
|
727
|
-
agent: SERVICE2,
|
|
728
|
-
tool: name,
|
|
729
|
-
status: "UNSET",
|
|
730
|
-
step,
|
|
731
|
-
extra: toolIoAttributes({ input: b.input ?? b.args ?? b.arguments, inputSource: sourceOf(b, b.input != null ? "input" : b.args != null ? "args" : "arguments") })
|
|
732
|
-
});
|
|
733
|
-
spans.push(toolSpan);
|
|
734
|
-
toolByCallId.set(callId, toolSpan);
|
|
735
|
-
const pending = pendingResults.get(callId);
|
|
736
|
-
if (pending) {
|
|
737
|
-
completeToolSpan(toolSpan, pending);
|
|
738
|
-
pendingResults.delete(callId);
|
|
739
|
-
}
|
|
740
|
-
step += 1;
|
|
741
|
-
} else if (isToolResultBlock(b)) {
|
|
742
|
-
const callId = b.toolCallId ?? b.callId ?? b.id ?? "";
|
|
743
|
-
const t = toolByCallId.get(callId);
|
|
744
|
-
if (t) {
|
|
745
|
-
const err = b.isError === true || b.is_error === true;
|
|
746
|
-
t.end_time = ts;
|
|
747
|
-
t.status = err ? { code: "ERROR", message: "tool result reported error" } : { code: "OK" };
|
|
748
|
-
recordToolOutput(t, b.output ?? b.result ?? b.content ?? b.text, sourceOf(b, b.output != null ? "output" : b.result != null ? "result" : b.content != null ? "content" : "text"));
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
for (const result of pendingResults.values()) {
|
|
754
|
-
spans.push(
|
|
755
|
-
span({
|
|
756
|
-
traceId: sourceTraceId,
|
|
757
|
-
spanId: `tool:${result.callId}`,
|
|
758
|
-
parentSpanId: sourceRootId,
|
|
759
|
-
name: `tool.${result.toolName}`,
|
|
760
|
-
kind: "TOOL",
|
|
761
|
-
startTime: result.timestamp,
|
|
762
|
-
endTime: result.timestamp,
|
|
763
|
-
status: result.isError ? "ERROR" : "OK",
|
|
764
|
-
statusMessage: result.isError ? result.errorMessage : void 0,
|
|
765
|
-
service: SERVICE2,
|
|
766
|
-
agent: SERVICE2,
|
|
767
|
-
tool: result.toolName,
|
|
768
|
-
step: result.step,
|
|
769
|
-
extra: {
|
|
770
|
-
...toolIoAttributes({ output: result.output, outputSource: result.source }),
|
|
771
|
-
"traces.pi.tool_result_without_call": true
|
|
772
|
-
}
|
|
773
|
-
})
|
|
774
|
-
);
|
|
775
|
-
}
|
|
776
|
-
const traceId = sessionLine?.id ?? sourceTraceId;
|
|
777
|
-
const rootId = `root:${traceId}`;
|
|
778
|
-
const terminal = terminalStatus(terminalMessage);
|
|
779
|
-
for (const item of spans) {
|
|
780
|
-
item.trace_id = traceId;
|
|
781
|
-
if (item.parent_span_id === sourceRootId) item.parent_span_id = rootId;
|
|
782
|
-
}
|
|
783
|
-
const root = span({
|
|
784
|
-
traceId,
|
|
785
|
-
spanId: rootId,
|
|
786
|
-
parentSpanId: null,
|
|
787
|
-
name: "session",
|
|
788
|
-
kind: "AGENT",
|
|
789
|
-
startTime: sessionLine?.timestamp ?? firstTimestamp ?? (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
790
|
-
endTime: lastTimestamp,
|
|
791
|
-
status: terminal.status,
|
|
792
|
-
statusMessage: terminal.statusMessage,
|
|
793
|
-
service: SERVICE2,
|
|
794
|
-
agent: SERVICE2,
|
|
795
|
-
extra: { "traces.pi.stop_reason": terminal.stopReason }
|
|
796
|
-
});
|
|
797
|
-
if (sessionLine?.id) root.attributes["tangle.sessionId"] = sessionLine.id;
|
|
798
|
-
return [root, ...spans];
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
|
|
802
|
-
// src/collect.ts
|
|
803
|
-
async function collectSessions(opts = {}) {
|
|
804
|
-
const out = [];
|
|
805
|
-
for await (const { ref, spans } of scanSessions(opts)) {
|
|
806
|
-
if (opts.redact === false) {
|
|
807
|
-
out.push({ ref, spans });
|
|
808
|
-
} else {
|
|
809
|
-
const r = redactSpans(spans);
|
|
810
|
-
out.push({ ref, spans: r.spans, redaction: r.report });
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
return out;
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
// src/index.ts
|
|
817
|
-
export * from "@tangle-network/agent-eval/trajectory-replay";
|
|
48
|
+
scanSessions
|
|
49
|
+
} from "./chunk-3T62R7ON.js";
|
|
50
|
+
import "./chunk-TR6O4S4T.js";
|
|
818
51
|
import {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
} from "
|
|
823
|
-
import { createHostedClient, hostedClientFromEnv } from "@tangle-network/agent-eval/hosted";
|
|
52
|
+
readOtlpInput,
|
|
53
|
+
tracesVersion,
|
|
54
|
+
writeOtlpFile
|
|
55
|
+
} from "./chunk-NZ5Y7UEL.js";
|
|
824
56
|
import {
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
shareAllowed
|
|
830
|
-
} from "@tangle-network/agent-eval/traces";
|
|
831
|
-
|
|
832
|
-
// src/retained-session.ts
|
|
833
|
-
import { createHash } from "crypto";
|
|
834
|
-
import { mkdir, mkdtemp, rm, writeFile } from "fs/promises";
|
|
835
|
-
import { tmpdir } from "os";
|
|
836
|
-
import { dirname, isAbsolute, join as join3, relative, resolve as resolve2 } from "path";
|
|
837
|
-
var RETAINED_SESSION_READER_VERSION = "2";
|
|
838
|
-
async function parseRetainedSession(input) {
|
|
839
|
-
input.signal?.throwIfAborted();
|
|
840
|
-
const unselectedFiles = [];
|
|
841
|
-
const unavailable = (reason) => ({
|
|
842
|
-
status: "unavailable",
|
|
843
|
-
reason,
|
|
844
|
-
sessionId: input.nativeSessionId,
|
|
845
|
-
sourceFiles: [],
|
|
846
|
-
duplicateFiles: [],
|
|
847
|
-
unselectedFiles,
|
|
848
|
-
spans: []
|
|
849
|
-
});
|
|
850
|
-
if (!input.nativeSessionId) return unavailable("Capture has no recorded native session identity.");
|
|
851
|
-
const adapter = resolveAdapter(input.harness);
|
|
852
|
-
if (!adapter) return unavailable(`No native trace adapter for ${input.harness}.`);
|
|
853
|
-
if (input.files.length > 1024) return unavailable("Retained capture exceeds 1024 text files.");
|
|
854
|
-
let totalBytes = 0;
|
|
855
|
-
for (const file of input.files) {
|
|
856
|
-
const bytes = Buffer.byteLength(file.content);
|
|
857
|
-
totalBytes += bytes;
|
|
858
|
-
if (bytes > 16 * 1024 ** 2 || totalBytes > 64 * 1024 ** 2) {
|
|
859
|
-
return unavailable("Retained capture exceeds the 16 MiB per-file or 64 MiB total text limit.");
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
const root = await mkdtemp(join3(tmpdir(), "traces-retained-"));
|
|
863
|
-
try {
|
|
864
|
-
const files = /* @__PURE__ */ new Map();
|
|
865
|
-
for (const file of input.files) {
|
|
866
|
-
input.signal?.throwIfAborted();
|
|
867
|
-
const path = resolve2(root, file.path);
|
|
868
|
-
const rel = relative(root, path);
|
|
869
|
-
if (!file.path || isAbsolute(file.path) || file.path.includes("\\") || file.path.includes("\0") || rel === "" || rel === ".." || rel.startsWith("../") || files.has(path)) {
|
|
870
|
-
throw new Error("Retained source paths must be unique relative files inside the capture.");
|
|
871
|
-
}
|
|
872
|
-
files.set(path, file);
|
|
873
|
-
}
|
|
874
|
-
for (const [path, file] of files) {
|
|
875
|
-
await mkdir(dirname(path), { recursive: true, mode: 448 });
|
|
876
|
-
await writeFile(path, file.content, { mode: 384, flag: "wx" });
|
|
877
|
-
}
|
|
878
|
-
const selected = [];
|
|
879
|
-
for (const [path, file] of files) {
|
|
880
|
-
input.signal?.throwIfAborted();
|
|
881
|
-
const fallback = `unattributed:${root}:${file.path}`;
|
|
882
|
-
const ref = { harness: adapter.harness, sessionId: fallback, path, cwd: null, mtimeMs: 0 };
|
|
883
|
-
try {
|
|
884
|
-
const sources = adapter.sourcePaths ? await adapter.sourcePaths(ref, { signal: input.signal }) : [path];
|
|
885
|
-
if (sources.some((source) => !files.has(resolve2(source)))) {
|
|
886
|
-
throw new Error("Parser requires files outside the supplied retained capture.");
|
|
887
|
-
}
|
|
888
|
-
const spans = validateOtlpSpans(await adapter.parse(ref, {
|
|
889
|
-
corruptionMode: "recover",
|
|
890
|
-
taskScope: "all",
|
|
891
|
-
captureSources: false,
|
|
892
|
-
signal: input.signal
|
|
893
|
-
}), `${adapter.harness} retained adapter output`);
|
|
894
|
-
const roots = spans.filter((span2) => span2.parent_span_id === null);
|
|
895
|
-
const identities = new Set(roots.map((span2) => sessionIdFromAttributes(span2.attributes)));
|
|
896
|
-
if (identities.size !== 1 || !identities.has(input.nativeSessionId)) {
|
|
897
|
-
unselectedFiles.push({ path: file.path, reason: "No unambiguous matching native identity in parser output." });
|
|
898
|
-
continue;
|
|
899
|
-
}
|
|
900
|
-
if (computeSessionFacts(spans, { includeContent: false }).every((facts) => facts.recordSpans === 0)) {
|
|
901
|
-
unselectedFiles.push({ path: file.path, reason: "Native identity was recorded without any session records." });
|
|
902
|
-
continue;
|
|
903
|
-
}
|
|
904
|
-
stampSessionIntegrity(ref, spans);
|
|
905
|
-
stampSessionIdentity(spans, input.nativeSessionId);
|
|
906
|
-
for (const span2 of spans) {
|
|
907
|
-
for (const [key, value] of Object.entries(span2.attributes)) {
|
|
908
|
-
if (typeof value === "string" && value.includes(root)) {
|
|
909
|
-
span2.attributes[key] = value.split(root + "/").join("retained://");
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
selected.push({ file, paths: sources, spans });
|
|
914
|
-
} catch (error) {
|
|
915
|
-
input.signal?.throwIfAborted();
|
|
916
|
-
unselectedFiles.push({ path: file.path, reason: `Native parser could not read this file (${error instanceof Error ? error.name : "Error"}).` });
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
if (!selected.length) return unavailable("No retained parser entrypoint established the recorded native session identity.");
|
|
920
|
-
selected.sort((a, b) => b.file.content.length - a.file.content.length || a.file.path.localeCompare(b.file.path));
|
|
921
|
-
const chosen = selected[0];
|
|
922
|
-
if (selected.some((candidate) => !chosen.file.content.startsWith(candidate.file.content))) {
|
|
923
|
-
return unavailable("Retained files contain divergent histories for the same native session.");
|
|
924
|
-
}
|
|
925
|
-
return {
|
|
926
|
-
status: "selected",
|
|
927
|
-
reason: null,
|
|
928
|
-
sessionId: input.nativeSessionId,
|
|
929
|
-
sourceFiles: chosen.paths.map((path) => {
|
|
930
|
-
const file = files.get(resolve2(path));
|
|
931
|
-
return { path: file.path, sha256: `sha256:${createHash("sha256").update(file.content).digest("hex")}` };
|
|
932
|
-
}).sort((a, b) => a.path.localeCompare(b.path)),
|
|
933
|
-
duplicateFiles: selected.slice(1).map((candidate) => candidate.file.path),
|
|
934
|
-
unselectedFiles,
|
|
935
|
-
spans: chosen.spans
|
|
936
|
-
};
|
|
937
|
-
} finally {
|
|
938
|
-
await rm(root, { recursive: true, force: true });
|
|
939
|
-
}
|
|
940
|
-
}
|
|
57
|
+
assessSpans,
|
|
58
|
+
redactSpans
|
|
59
|
+
} from "./chunk-RZL5GAWH.js";
|
|
60
|
+
import "./chunk-DU534HAX.js";
|
|
941
61
|
export {
|
|
942
|
-
ACTOR_ATTR,
|
|
943
|
-
ANSWERED_TEXT_CAP,
|
|
944
|
-
ATTR,
|
|
945
|
-
AmpAdapter,
|
|
946
|
-
AnalystRegistry,
|
|
947
|
-
BLOBS_DIR,
|
|
948
|
-
CHANGED_FILE_LIST_CAP,
|
|
949
|
-
CITATION_NORMALIZATION_VERSION,
|
|
950
|
-
CONTENT_CAP,
|
|
951
|
-
COORDINATION_LOG_FILE,
|
|
952
|
-
CORRECTIVE_REACTIONS,
|
|
953
|
-
ClaudeAdapter,
|
|
954
|
-
CodexAdapter,
|
|
955
|
-
CodexExecAdapter,
|
|
956
|
-
CodexExecStreamError,
|
|
957
|
-
CodexTaskScopeError,
|
|
958
|
-
CopilotAdapter,
|
|
959
|
-
DEFAULT_ANALYST_MODEL,
|
|
960
|
-
DEFAULT_ASK_CONCURRENCY,
|
|
961
|
-
DEFAULT_HARNESS,
|
|
962
|
-
DEFAULT_SANDBOX_BASE_URL,
|
|
963
|
-
DEFAULT_SWEEP_THRESHOLD,
|
|
964
|
-
EMPTY_SPAN_RUN_SNAPSHOT,
|
|
965
|
-
EXPORT_RULE,
|
|
966
|
-
EmptySessionError,
|
|
967
|
-
FACT_LIST_CAP,
|
|
968
|
-
FACT_TEXT_CAP,
|
|
969
|
-
FactoryAdapter,
|
|
970
|
-
GeminiAdapter,
|
|
971
|
-
HarnessSessionsAdapter,
|
|
972
|
-
INGEST_SOURCE_CLI,
|
|
973
|
-
INHERITED_SOURCE_ATTR,
|
|
974
|
-
INHERITED_SPANS_OMITTED_ATTR,
|
|
975
|
-
INHERITED_SPAN_ATTR,
|
|
976
|
-
INHERITED_SPAN_COUNT_ATTR,
|
|
977
|
-
JsonSourceError,
|
|
978
|
-
JsonlParseError,
|
|
979
|
-
MAX_SHELL_DEPTH,
|
|
980
|
-
MAX_TRACE_QUESTION_CHARS,
|
|
981
|
-
OpencodeAdapter,
|
|
982
|
-
POLICY_EVIDENCE_NOTE,
|
|
983
|
-
PREPARED_CONTEXT_BYTE_CEILING,
|
|
984
|
-
PartialUploadError,
|
|
985
|
-
PiAdapter,
|
|
986
|
-
QwenAdapter,
|
|
987
|
-
REACTIONS,
|
|
988
|
-
RESULT_FILE,
|
|
989
|
-
RETAINED_SESSION_READER_VERSION,
|
|
990
|
-
RULE,
|
|
991
|
-
SESSION_CWD_ATTR,
|
|
992
|
-
SESSION_FACTS_MEASUREMENT_VERSION,
|
|
993
|
-
SESSION_FACTS_VERSION_SUFFIX,
|
|
994
|
-
SESSION_TOKEN_TOTAL_ATTR,
|
|
995
|
-
SOURCE_ATTRIBUTE_PREFIX,
|
|
996
|
-
SPAN_SYNTHESIZED_ATTR,
|
|
997
|
-
SPAWN_JOURNAL_FILE,
|
|
998
|
-
STATUS_MARK,
|
|
999
|
-
SYNTHESIZED_SOURCE_ATTR,
|
|
1000
|
-
SYNTHESIZED_SPAN_ATTR,
|
|
1001
|
-
SessionWorkflowError,
|
|
1002
|
-
SkillUsageStore,
|
|
1003
|
-
TRACE_QUESTION_PREVIEW_HEAD_CHARS,
|
|
1004
|
-
ZERO_ROLL,
|
|
1005
|
-
addSpend,
|
|
1006
|
-
alreadyUploaded,
|
|
1007
62
|
analysisEngineFromEnv,
|
|
1008
|
-
analyzeAdoption,
|
|
1009
|
-
analyzeLiveBatch,
|
|
1010
|
-
analyzeLoopConvergence,
|
|
1011
|
-
analyzeReactions,
|
|
1012
63
|
analyzeSpans,
|
|
1013
|
-
analyzeSteeringChain,
|
|
1014
|
-
answerSchemaErrors,
|
|
1015
|
-
applyRedactor,
|
|
1016
64
|
assembleSessionBundle,
|
|
1017
|
-
assertAnswerSchema,
|
|
1018
|
-
assertSandboxReachable,
|
|
1019
|
-
assessShareSafety,
|
|
1020
65
|
assessSpans,
|
|
1021
|
-
buildDefaultAnalystRegistry,
|
|
1022
|
-
buildPolicyEvidenceRecord,
|
|
1023
66
|
buildSessionFactsReport,
|
|
1024
|
-
buildSessionIndex,
|
|
1025
|
-
buildSessionIndexFromRows,
|
|
1026
|
-
buildSkillUsageReport,
|
|
1027
|
-
buildSpanRunTree,
|
|
1028
67
|
buildTraceFindingPacket,
|
|
1029
|
-
capText,
|
|
1030
|
-
chatTrajectoryToSpans,
|
|
1031
|
-
classifyEvidenceOnlyPath,
|
|
1032
|
-
classifyFailureFollowUps,
|
|
1033
|
-
classifyLiveActions,
|
|
1034
|
-
classifyReaction,
|
|
1035
|
-
claudeActor,
|
|
1036
|
-
codexActor,
|
|
1037
|
-
collectPolicyEvidence,
|
|
1038
|
-
collectSessionIndex,
|
|
1039
|
-
collectSessionSelection,
|
|
1040
|
-
collectSessionWorkflow,
|
|
1041
|
-
collectSessions,
|
|
1042
|
-
commandAnalyzer,
|
|
1043
|
-
commandRedactor,
|
|
1044
|
-
commandTextFromInput,
|
|
1045
|
-
computeAdoption,
|
|
1046
68
|
computeSessionFacts,
|
|
1047
69
|
conformanceOfSpans,
|
|
1048
|
-
connectors,
|
|
1049
|
-
countSkillRunsJsonl,
|
|
1050
|
-
createBundleSourceReader,
|
|
1051
|
-
createFindingRejectionTally,
|
|
1052
|
-
createHostedClient,
|
|
1053
|
-
createSessionFactsReportBuilder,
|
|
1054
|
-
cwdMatchesSelection,
|
|
1055
|
-
cwdMatchesSelectionResolved,
|
|
1056
|
-
defaultSkillCatalogRoots,
|
|
1057
|
-
defaultSkillUsageSources,
|
|
1058
|
-
defaultSkillUsageStorePath,
|
|
1059
|
-
defaultTraceLiveAnalysts,
|
|
1060
|
-
describeSessionRelationship,
|
|
1061
70
|
diffRuns,
|
|
1062
|
-
engineCallReservationFloorUsd,
|
|
1063
|
-
environmentAttributes,
|
|
1064
|
-
environmentFromSpanAttributes,
|
|
1065
|
-
equivalentGitCwds,
|
|
1066
71
|
executeUpload,
|
|
1067
|
-
exportTraceEvidenceFile,
|
|
1068
|
-
exportTraceEvidenceRows,
|
|
1069
|
-
exportTraceEvidenceText,
|
|
1070
|
-
externalFailureMessage,
|
|
1071
|
-
fileRunContextSupervisorRunReader,
|
|
1072
|
-
fileSha256,
|
|
1073
|
-
findContextRoot,
|
|
1074
|
-
findSessionTextLeaks,
|
|
1075
|
-
findSpanSourceFiles,
|
|
1076
|
-
findingRejection,
|
|
1077
|
-
findingRejectionDetail,
|
|
1078
|
-
forEachTreeNode,
|
|
1079
|
-
formatFindingRejections,
|
|
1080
|
-
formatVerdict,
|
|
1081
|
-
haloAnalyzer,
|
|
1082
|
-
hashSessionBundleFiles,
|
|
1083
|
-
hodoscopeAnalyzer,
|
|
1084
|
-
hostedClientFromEnv,
|
|
1085
|
-
httpJsonTransport,
|
|
1086
|
-
importCodeTraceBench,
|
|
1087
|
-
incompleteInputsNote,
|
|
1088
|
-
indexSessionIdsByTrace,
|
|
1089
|
-
inferRole,
|
|
1090
|
-
inferSpanKind,
|
|
1091
|
-
inspectSessionIndex,
|
|
1092
|
-
int,
|
|
1093
|
-
isBridgeMismatchError,
|
|
1094
|
-
isChatTrajectory,
|
|
1095
|
-
isChatTrajectoryMessage,
|
|
1096
|
-
isFileRunContextDir,
|
|
1097
|
-
isInheritedSpan,
|
|
1098
|
-
isSynthesizedSpan,
|
|
1099
|
-
iterSerializedSpans,
|
|
1100
72
|
knownHarnesses,
|
|
1101
|
-
listAdapters,
|
|
1102
|
-
listSessionBundleFiles,
|
|
1103
|
-
loadState,
|
|
1104
|
-
loadTraceQuestionsFile,
|
|
1105
|
-
loadTracesConfig,
|
|
1106
|
-
locateSessions,
|
|
1107
|
-
looksLikeAgentPrompt,
|
|
1108
|
-
makeFinding,
|
|
1109
|
-
mergeRolls,
|
|
1110
|
-
mergeTracesConfig,
|
|
1111
|
-
ms,
|
|
1112
|
-
normalizeAnalystCitations,
|
|
1113
|
-
normalizeRemote,
|
|
1114
|
-
normalizeTraceQuestions,
|
|
1115
|
-
otlpRowToSpan,
|
|
1116
|
-
outboundHash,
|
|
1117
|
-
parseIsoToEpochMs,
|
|
1118
|
-
parseJsonAnswer,
|
|
1119
|
-
parseRetainedSession,
|
|
1120
73
|
parseSession,
|
|
1121
|
-
parseSince,
|
|
1122
|
-
parseTimeBound,
|
|
1123
|
-
planTraceAgenticRoute,
|
|
1124
74
|
planUpload,
|
|
1125
|
-
primeAnalyzer,
|
|
1126
|
-
projectSessionBundle,
|
|
1127
|
-
readCoordinationLog,
|
|
1128
|
-
readFileRunContext,
|
|
1129
|
-
readInstalledSkills,
|
|
1130
|
-
readJsonFile,
|
|
1131
|
-
readJsonl,
|
|
1132
75
|
readOtlpInput,
|
|
1133
|
-
readPullRequests,
|
|
1134
|
-
readRunContextJournal,
|
|
1135
|
-
readRunContextSnapshot,
|
|
1136
|
-
readRunSide,
|
|
1137
|
-
readRunWatchSnapshot,
|
|
1138
|
-
readSessionBundleManifest,
|
|
1139
|
-
readSessionIndexFile,
|
|
1140
|
-
readSpanRunSnapshot,
|
|
1141
|
-
recordSessionCorruption,
|
|
1142
|
-
redact,
|
|
1143
|
-
redactForShare,
|
|
1144
76
|
redactSpans,
|
|
1145
|
-
redactText,
|
|
1146
|
-
renderConformance,
|
|
1147
|
-
renderInspectionReport,
|
|
1148
|
-
renderRunContextSnapshot,
|
|
1149
77
|
renderRunDiff,
|
|
1150
|
-
renderRunWatchSnapshot,
|
|
1151
78
|
renderSessionFacts,
|
|
1152
|
-
renderSessionFactsContext,
|
|
1153
|
-
renderSkillUsage,
|
|
1154
|
-
renderSpanRunSnapshot,
|
|
1155
|
-
renderTraceQuestionInstructions,
|
|
1156
|
-
renderTraceQuestionPrompt,
|
|
1157
|
-
renderTraceQuestionsReport,
|
|
1158
|
-
renderValidation,
|
|
1159
|
-
resolveAdapter,
|
|
1160
|
-
resolveOtlpInputFiles,
|
|
1161
|
-
resolveRepoAttrs,
|
|
1162
|
-
resolveRunContextDir,
|
|
1163
|
-
resolveRunWatchTarget,
|
|
1164
|
-
resolveSessionRepoAttrs,
|
|
1165
|
-
runCommand,
|
|
1166
|
-
runExternalAnalyzers,
|
|
1167
|
-
runPipelines,
|
|
1168
|
-
runTotals,
|
|
1169
|
-
runTraceImprovement,
|
|
1170
79
|
runTraceInvestigation,
|
|
1171
80
|
runTraceQuestions,
|
|
1172
|
-
runTraceStoreInvestigation,
|
|
1173
|
-
sandboxReplayBackend,
|
|
1174
|
-
saveReport,
|
|
1175
|
-
saveState,
|
|
1176
81
|
scanSessions,
|
|
1177
|
-
selectAdapters,
|
|
1178
|
-
serializeInspectionReport,
|
|
1179
|
-
serializePolicyEvidence,
|
|
1180
|
-
serializeSessionIndex,
|
|
1181
|
-
serializeSpans,
|
|
1182
|
-
serializeTraceStreamEvent,
|
|
1183
|
-
sessionFactsContext,
|
|
1184
|
-
sessionHash,
|
|
1185
|
-
sessionIdFromAttributes,
|
|
1186
|
-
sessionIntegrityAttributes,
|
|
1187
|
-
sessionTextSignatures,
|
|
1188
|
-
shareAllowed,
|
|
1189
|
-
shellCommands,
|
|
1190
|
-
skippedAnalyses,
|
|
1191
|
-
span,
|
|
1192
|
-
spanRunTotals,
|
|
1193
|
-
stampEnvironmentAttrs,
|
|
1194
|
-
stampRepoAttrs,
|
|
1195
|
-
stampSessionIdentity,
|
|
1196
|
-
stampSessionIntegrity,
|
|
1197
|
-
stampSpanWorkdirRepoAttrs,
|
|
1198
82
|
streamSessions,
|
|
1199
|
-
|
|
1200
|
-
summarizeSpanExecution,
|
|
1201
|
-
summarizeSpanStructure,
|
|
1202
|
-
takeJsonl,
|
|
1203
|
-
textIsSynthetic,
|
|
1204
|
-
toOpenInferenceSpan,
|
|
1205
|
-
toRuntimeStore,
|
|
1206
|
-
toTraceSpanEvents,
|
|
1207
|
-
tokens,
|
|
1208
|
-
totalAgenticFailureMessage,
|
|
1209
|
-
totalFindingRejections,
|
|
1210
|
-
traceAgenticKinds,
|
|
1211
|
-
traceCitationsInText,
|
|
1212
|
-
traceStreamEventsFromSpans,
|
|
1213
|
-
unavailableCapabilities,
|
|
1214
|
-
uploadKey,
|
|
1215
|
-
usd,
|
|
1216
|
-
userPromptSpan,
|
|
1217
|
-
validateOtlpSpans,
|
|
1218
|
-
validationExitCode,
|
|
1219
|
-
verdictExitCode,
|
|
1220
|
-
verifyFindingsInSandbox,
|
|
83
|
+
tracesVersion,
|
|
1221
84
|
verifySafe,
|
|
1222
85
|
verifySessionBundle,
|
|
1223
|
-
|
|
1224
|
-
watchSessions,
|
|
1225
|
-
withSessionFactsContext,
|
|
1226
|
-
wrap,
|
|
1227
|
-
writeHodoscopeInput,
|
|
1228
|
-
writeInspectionReportFile,
|
|
1229
|
-
writeOtlpFile,
|
|
1230
|
-
writePolicyEvidenceFile,
|
|
1231
|
-
writeSessionBundleManifest,
|
|
1232
|
-
writeSessionIndexFile,
|
|
1233
|
-
writeTraceEvidenceExportFile,
|
|
1234
|
-
writeTraceImprovementArtifacts,
|
|
1235
|
-
writeTraceQuestionsArtifacts,
|
|
1236
|
-
zaiChatCaller,
|
|
1237
|
-
zeroPricedCost
|
|
86
|
+
writeOtlpFile
|
|
1238
87
|
};
|