agent-inspect 4.3.0 → 4.4.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/CHANGELOG.md +6 -0
- package/docs/API.md +3 -0
- package/docs/CLI.md +3 -0
- package/docs/SCHEMA.md +27 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-BS5LSKZ3.mjs → chunk-ORHDQUT6.mjs} +198 -7
- package/packages/cli/dist/chunk-ORHDQUT6.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +409 -17
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +176 -10
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-YFMPWEIS.mjs → src-FJOHPC4X.mjs} +3 -3
- package/packages/cli/dist/{src-YFMPWEIS.mjs.map → src-FJOHPC4X.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +201 -9
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +12 -8
- package/packages/core/dist/advanced.d.ts +12 -8
- package/packages/core/dist/advanced.mjs +30 -13
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +117 -18
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +11 -3
- package/packages/core/dist/checks.d.ts +11 -3
- package/packages/core/dist/checks.mjs +42 -1
- package/packages/core/dist/checks.mjs.map +1 -1
- package/packages/core/dist/{chunk-2ZXEMWGK.mjs → chunk-3USJVBLA.mjs} +3 -3
- package/packages/core/dist/{chunk-2ZXEMWGK.mjs.map → chunk-3USJVBLA.mjs.map} +1 -1
- package/packages/core/dist/{chunk-HY7H3CQM.mjs → chunk-CAWPF22J.mjs} +4 -3
- package/packages/core/dist/chunk-CAWPF22J.mjs.map +1 -0
- package/packages/core/dist/{chunk-XUNJMAPD.mjs → chunk-KNYL56KZ.mjs} +38 -3
- package/packages/core/dist/chunk-KNYL56KZ.mjs.map +1 -0
- package/packages/core/dist/{chunk-IZBJAZGF.mjs → chunk-P366CCL2.mjs} +34 -3
- package/packages/core/dist/chunk-P366CCL2.mjs.map +1 -0
- package/packages/core/dist/{chunk-4JVGFNQH.mjs → chunk-ULCGIRTC.mjs} +95 -8
- package/packages/core/dist/chunk-ULCGIRTC.mjs.map +1 -0
- package/packages/core/dist/chunk-VFO76UH3.mjs +228 -0
- package/packages/core/dist/chunk-VFO76UH3.mjs.map +1 -0
- package/packages/core/dist/{chunk-NQZPZ2FN.mjs → chunk-WRE4CNPF.mjs} +6 -3
- package/packages/core/dist/chunk-WRE4CNPF.mjs.map +1 -0
- package/packages/core/dist/{chunk-A4V2H3YU.mjs → chunk-ZWA5RWMV.mjs} +40 -4
- package/packages/core/dist/chunk-ZWA5RWMV.mjs.map +1 -0
- package/packages/core/dist/{context-DjY-jvQk.d.cts → context-BbfkMYjz.d.cts} +5 -3
- package/packages/core/dist/{context-BDZmi53V.d.ts → context-Cp8NRbBX.d.ts} +5 -3
- package/packages/core/dist/diff.cjs.map +1 -1
- package/packages/core/dist/diff.d.cts +3 -3
- package/packages/core/dist/diff.d.ts +3 -3
- package/packages/core/dist/diff.mjs +1 -1
- package/packages/core/dist/exporters.cjs +137 -1
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.d.cts +6 -3
- package/packages/core/dist/exporters.d.ts +6 -3
- package/packages/core/dist/exporters.mjs +71 -6
- package/packages/core/dist/exporters.mjs.map +1 -1
- package/packages/core/dist/index.cjs +181 -6
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.d.cts +14 -7
- package/packages/core/dist/index.d.ts +14 -7
- package/packages/core/dist/index.mjs +51 -7
- package/packages/core/dist/index.mjs.map +1 -1
- package/packages/core/dist/{inspect-event-CYAV7Hxm.d.cts → inspect-event-IqwOHbGo.d.cts} +1 -1
- package/packages/core/dist/{inspect-event-CYAV7Hxm.d.ts → inspect-event-IqwOHbGo.d.ts} +1 -1
- package/packages/core/dist/{log-config-BNQ9UTmP.d.cts → log-config-CW8w5YQ9.d.cts} +1 -1
- package/packages/core/dist/{log-config-D3Yp1SZN.d.ts → log-config-SRA4xTp8.d.ts} +1 -1
- package/packages/core/dist/logs.d.cts +3 -3
- package/packages/core/dist/logs.d.ts +3 -3
- package/packages/core/dist/{persisted-inspect-event-BLvb0jSX.d.ts → persisted-inspect-event-DruwqARZ.d.ts} +1 -1
- package/packages/core/dist/{persisted-inspect-event-D5SjBz9b.d.cts → persisted-inspect-event-Gd-W8vB7.d.cts} +1 -1
- package/packages/core/dist/persisted.cjs +67 -1
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.d.cts +5 -5
- package/packages/core/dist/persisted.d.ts +5 -5
- package/packages/core/dist/persisted.mjs +3 -3
- package/packages/core/dist/readers.cjs +72 -3
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.d.cts +2 -2
- package/packages/core/dist/readers.d.ts +2 -2
- package/packages/core/dist/readers.mjs +5 -5
- package/packages/core/dist/readers.mjs.map +1 -1
- package/packages/core/dist/{types-CQun9LW6.d.ts → types-B1X87dUW.d.cts} +16 -2
- package/packages/core/dist/{types-C-llnPH0.d.cts → types-BVkjSd0q.d.ts} +16 -2
- package/packages/core/dist/types-CvsKGweN.d.cts +12 -0
- package/packages/core/dist/types-CvsKGweN.d.ts +12 -0
- package/packages/core/dist/writers.cjs +2 -1
- package/packages/core/dist/writers.cjs.map +1 -1
- package/packages/core/dist/writers.d.cts +2 -2
- package/packages/core/dist/writers.d.ts +2 -2
- package/packages/core/dist/writers.mjs +3 -4
- package/packages/core/dist/writers.mjs.map +1 -1
- package/packages/cli/dist/chunk-BS5LSKZ3.mjs.map +0 -1
- package/packages/core/dist/chunk-4JVGFNQH.mjs.map +0 -1
- package/packages/core/dist/chunk-A4V2H3YU.mjs.map +0 -1
- package/packages/core/dist/chunk-EDTQHZPM.mjs +0 -88
- package/packages/core/dist/chunk-EDTQHZPM.mjs.map +0 -1
- package/packages/core/dist/chunk-HY7H3CQM.mjs.map +0 -1
- package/packages/core/dist/chunk-IZBJAZGF.mjs.map +0 -1
- package/packages/core/dist/chunk-NQZPZ2FN.mjs.map +0 -1
- package/packages/core/dist/chunk-XUNJMAPD.mjs.map +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export { C as CreateInspectorOptions, D as DEFAULT_MAX_EVENT_BYTES, f as DEFAULT_MAX_METADATA_VALUE_LENGTH, h as DEFAULT_MAX_PREVIEW_LENGTH, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, i as InspectorRuntime, j as InspectorRuntimeContext, k as InspectorRuntimeDiagnostics, l as InspectorRuntimeOptions, d as InspectorStepOptions, T as TraceSafetyOptions, e as createInspector, n as createInspectorRuntime, o as getCurrentContext, g as getCurrentCorrelationMetadata, p as getCurrentDepth, q as getCurrentRunId, r as getCurrentRunName, s as getCurrentStepId, t as getParentStepId, u as getTraceDirFromContext, v as getTraceSafetyFromContext, w as hasActiveContext, x as isAgentInspectEnabled, y as isSilentContext, m as maybeInspectRun, z as prepareMetadataForDisk, A as prepareTraceEventForDisk, B as resolveTraceSafetyOptions, E as runWithContext, F as runWithStepContext } from './context-
|
|
2
|
-
import { R as RedactionProfile, E as ErrorInfo, b as RunStatus, e as StepStatus, h as TraceEvent, j as RunSummary, k as TraceMetadata, l as TraceMetadataStatus, f as StepType, g as TraceCorrelationMetadata } from './types-
|
|
3
|
-
export { A as ActiveStepContext, i as ExecutionContext, I as InspectRunOptions, O as ObserveOptions, a as Run, m as RunCompletedEvent, n as RunStartedEvent, c as Step, o as StepCompletedEvent, d as StepMetadata, S as StepOptions, p as StepStartedEvent, T as TokenMetadata, q as TraceEventBase, r as TraceSchemaVersion, s as isStepStatus, t as isStepType, u as isTraceEvent } from './types-
|
|
4
|
-
import { b as InspectRunTree } from './inspect-event-
|
|
5
|
-
export { A as AttributionConfidence, E as EventSource, a as InspectEvent, I as InspectKind, c as InspectNode } from './inspect-event-
|
|
6
|
-
import { P as PersistedInspectEvent } from './persisted-inspect-event-
|
|
1
|
+
export { C as CreateInspectorOptions, D as DEFAULT_MAX_EVENT_BYTES, f as DEFAULT_MAX_METADATA_VALUE_LENGTH, h as DEFAULT_MAX_PREVIEW_LENGTH, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, i as InspectorRuntime, j as InspectorRuntimeContext, k as InspectorRuntimeDiagnostics, l as InspectorRuntimeOptions, d as InspectorStepOptions, T as TraceSafetyOptions, e as createInspector, n as createInspectorRuntime, o as getCurrentContext, g as getCurrentCorrelationMetadata, p as getCurrentDepth, q as getCurrentRunId, r as getCurrentRunName, s as getCurrentStepId, t as getParentStepId, u as getTraceDirFromContext, v as getTraceSafetyFromContext, w as hasActiveContext, x as isAgentInspectEnabled, y as isSilentContext, m as maybeInspectRun, z as prepareMetadataForDisk, A as prepareTraceEventForDisk, B as resolveTraceSafetyOptions, E as runWithContext, F as runWithStepContext } from './context-BbfkMYjz.cjs';
|
|
2
|
+
import { R as RedactionProfile, E as ErrorInfo, b as RunStatus, e as StepStatus, h as TraceEvent, j as RunSummary, k as TraceMetadata, l as TraceMetadataStatus, f as StepType, g as TraceCorrelationMetadata } from './types-B1X87dUW.cjs';
|
|
3
|
+
export { A as ActiveStepContext, i as ExecutionContext, I as InspectRunOptions, O as ObserveOptions, a as Run, m as RunCompletedEvent, n as RunStartedEvent, c as Step, o as StepCompletedEvent, d as StepMetadata, S as StepOptions, p as StepStartedEvent, T as TokenMetadata, q as TraceEventBase, r as TraceSchemaVersion, s as isStepStatus, t as isStepType, u as isTraceEvent } from './types-B1X87dUW.cjs';
|
|
4
|
+
import { b as InspectRunTree } from './inspect-event-IqwOHbGo.cjs';
|
|
5
|
+
export { A as AttributionConfidence, E as EventSource, a as InspectEvent, I as InspectKind, c as InspectNode } from './inspect-event-IqwOHbGo.cjs';
|
|
6
|
+
import { P as PersistedInspectEvent } from './persisted-inspect-event-Gd-W8vB7.cjs';
|
|
7
7
|
import { Stats } from 'node:fs';
|
|
8
8
|
import { TraceCheckResult, TraceCheckStatus } from './checks.cjs';
|
|
9
9
|
import './writers.cjs';
|
|
10
|
-
import './
|
|
10
|
+
import './types-CvsKGweN.cjs';
|
|
11
|
+
import './log-config-CW8w5YQ9.cjs';
|
|
11
12
|
import './readers.cjs';
|
|
12
13
|
|
|
13
14
|
interface ResolvedRedactionProfile {
|
|
@@ -369,6 +370,7 @@ interface TraceSearchOptions {
|
|
|
369
370
|
limit?: number;
|
|
370
371
|
session?: string;
|
|
371
372
|
correlateGroup?: boolean;
|
|
373
|
+
observation?: string;
|
|
372
374
|
}
|
|
373
375
|
interface TraceSearchResult {
|
|
374
376
|
runId: string;
|
|
@@ -563,7 +565,9 @@ declare function enrichSessionSummary(summary: Omit<SessionSummary, "status" | "
|
|
|
563
565
|
*/
|
|
564
566
|
declare function buildActivitySummary(index: SessionIndex, options?: BuildActivitySummaryOptions): ActivitySummary;
|
|
565
567
|
/** Renders a human activity summary for terminal output. */
|
|
566
|
-
declare function renderActivitySummaryHuman(summary: ActivitySummary
|
|
568
|
+
declare function renderActivitySummaryHuman(summary: ActivitySummary, options?: {
|
|
569
|
+
nowMs?: number;
|
|
570
|
+
}): string;
|
|
567
571
|
|
|
568
572
|
/** Enriches trace metadata with run_started metadata for session indexing. */
|
|
569
573
|
declare function enrichSessionRunRecord(meta: TraceMetadata): Promise<SessionRunRecord>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export { C as CreateInspectorOptions, D as DEFAULT_MAX_EVENT_BYTES, f as DEFAULT_MAX_METADATA_VALUE_LENGTH, h as DEFAULT_MAX_PREVIEW_LENGTH, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, i as InspectorRuntime, j as InspectorRuntimeContext, k as InspectorRuntimeDiagnostics, l as InspectorRuntimeOptions, d as InspectorStepOptions, T as TraceSafetyOptions, e as createInspector, n as createInspectorRuntime, o as getCurrentContext, g as getCurrentCorrelationMetadata, p as getCurrentDepth, q as getCurrentRunId, r as getCurrentRunName, s as getCurrentStepId, t as getParentStepId, u as getTraceDirFromContext, v as getTraceSafetyFromContext, w as hasActiveContext, x as isAgentInspectEnabled, y as isSilentContext, m as maybeInspectRun, z as prepareMetadataForDisk, A as prepareTraceEventForDisk, B as resolveTraceSafetyOptions, E as runWithContext, F as runWithStepContext } from './context-
|
|
2
|
-
import { R as RedactionProfile, E as ErrorInfo, b as RunStatus, e as StepStatus, h as TraceEvent, j as RunSummary, k as TraceMetadata, l as TraceMetadataStatus, f as StepType, g as TraceCorrelationMetadata } from './types-
|
|
3
|
-
export { A as ActiveStepContext, i as ExecutionContext, I as InspectRunOptions, O as ObserveOptions, a as Run, m as RunCompletedEvent, n as RunStartedEvent, c as Step, o as StepCompletedEvent, d as StepMetadata, S as StepOptions, p as StepStartedEvent, T as TokenMetadata, q as TraceEventBase, r as TraceSchemaVersion, s as isStepStatus, t as isStepType, u as isTraceEvent } from './types-
|
|
4
|
-
import { b as InspectRunTree } from './inspect-event-
|
|
5
|
-
export { A as AttributionConfidence, E as EventSource, a as InspectEvent, I as InspectKind, c as InspectNode } from './inspect-event-
|
|
6
|
-
import { P as PersistedInspectEvent } from './persisted-inspect-event-
|
|
1
|
+
export { C as CreateInspectorOptions, D as DEFAULT_MAX_EVENT_BYTES, f as DEFAULT_MAX_METADATA_VALUE_LENGTH, h as DEFAULT_MAX_PREVIEW_LENGTH, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, i as InspectorRuntime, j as InspectorRuntimeContext, k as InspectorRuntimeDiagnostics, l as InspectorRuntimeOptions, d as InspectorStepOptions, T as TraceSafetyOptions, e as createInspector, n as createInspectorRuntime, o as getCurrentContext, g as getCurrentCorrelationMetadata, p as getCurrentDepth, q as getCurrentRunId, r as getCurrentRunName, s as getCurrentStepId, t as getParentStepId, u as getTraceDirFromContext, v as getTraceSafetyFromContext, w as hasActiveContext, x as isAgentInspectEnabled, y as isSilentContext, m as maybeInspectRun, z as prepareMetadataForDisk, A as prepareTraceEventForDisk, B as resolveTraceSafetyOptions, E as runWithContext, F as runWithStepContext } from './context-Cp8NRbBX.js';
|
|
2
|
+
import { R as RedactionProfile, E as ErrorInfo, b as RunStatus, e as StepStatus, h as TraceEvent, j as RunSummary, k as TraceMetadata, l as TraceMetadataStatus, f as StepType, g as TraceCorrelationMetadata } from './types-BVkjSd0q.js';
|
|
3
|
+
export { A as ActiveStepContext, i as ExecutionContext, I as InspectRunOptions, O as ObserveOptions, a as Run, m as RunCompletedEvent, n as RunStartedEvent, c as Step, o as StepCompletedEvent, d as StepMetadata, S as StepOptions, p as StepStartedEvent, T as TokenMetadata, q as TraceEventBase, r as TraceSchemaVersion, s as isStepStatus, t as isStepType, u as isTraceEvent } from './types-BVkjSd0q.js';
|
|
4
|
+
import { b as InspectRunTree } from './inspect-event-IqwOHbGo.js';
|
|
5
|
+
export { A as AttributionConfidence, E as EventSource, a as InspectEvent, I as InspectKind, c as InspectNode } from './inspect-event-IqwOHbGo.js';
|
|
6
|
+
import { P as PersistedInspectEvent } from './persisted-inspect-event-DruwqARZ.js';
|
|
7
7
|
import { Stats } from 'node:fs';
|
|
8
8
|
import { TraceCheckResult, TraceCheckStatus } from './checks.js';
|
|
9
9
|
import './writers.js';
|
|
10
|
-
import './
|
|
10
|
+
import './types-CvsKGweN.js';
|
|
11
|
+
import './log-config-SRA4xTp8.js';
|
|
11
12
|
import './readers.js';
|
|
12
13
|
|
|
13
14
|
interface ResolvedRedactionProfile {
|
|
@@ -369,6 +370,7 @@ interface TraceSearchOptions {
|
|
|
369
370
|
limit?: number;
|
|
370
371
|
session?: string;
|
|
371
372
|
correlateGroup?: boolean;
|
|
373
|
+
observation?: string;
|
|
372
374
|
}
|
|
373
375
|
interface TraceSearchResult {
|
|
374
376
|
runId: string;
|
|
@@ -563,7 +565,9 @@ declare function enrichSessionSummary(summary: Omit<SessionSummary, "status" | "
|
|
|
563
565
|
*/
|
|
564
566
|
declare function buildActivitySummary(index: SessionIndex, options?: BuildActivitySummaryOptions): ActivitySummary;
|
|
565
567
|
/** Renders a human activity summary for terminal output. */
|
|
566
|
-
declare function renderActivitySummaryHuman(summary: ActivitySummary
|
|
568
|
+
declare function renderActivitySummaryHuman(summary: ActivitySummary, options?: {
|
|
569
|
+
nowMs?: number;
|
|
570
|
+
}): string;
|
|
567
571
|
|
|
568
572
|
/** Enriches trace metadata with run_started metadata for session indexing. */
|
|
569
573
|
declare function enrichSessionRunRecord(meta: TraceMetadata): Promise<SessionRunRecord>;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
export { MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, TERMINAL_INDENT, TraceDirectory, createInspector, createInspectorRuntime, formatTerminalName, getCurrentContext, getCurrentCorrelationMetadata, getCurrentDepth, getCurrentRunId, getCurrentRunName, getCurrentStepId, getIndent, getParentStepId, getTraceDirFromContext, getTraceSafetyFromContext, hasActiveContext, isAgentInspectEnabled, isSilentContext, maybeInspectRun, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, renderErrorLine, renderRunSummary, renderStepLine, resolveTraceDir, runWithContext, runWithStepContext } from './chunk-
|
|
2
|
-
import { buildRunSummary, extractMetadata } from './chunk-
|
|
3
|
-
export { buildRunSummary, buildRunTimeline, buildRunWhatSummary, extractMetadata, renderRunWhat, renderTimeline } from './chunk-
|
|
1
|
+
export { MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, TERMINAL_INDENT, TraceDirectory, createInspector, createInspectorRuntime, formatTerminalName, getCurrentContext, getCurrentCorrelationMetadata, getCurrentDepth, getCurrentRunId, getCurrentRunName, getCurrentStepId, getIndent, getParentStepId, getTraceDirFromContext, getTraceSafetyFromContext, hasActiveContext, isAgentInspectEnabled, isSilentContext, maybeInspectRun, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, renderErrorLine, renderRunSummary, renderStepLine, resolveTraceDir, runWithContext, runWithStepContext } from './chunk-ZWA5RWMV.mjs';
|
|
2
|
+
import { buildRunSummary, extractMetadata } from './chunk-3USJVBLA.mjs';
|
|
3
|
+
export { buildRunSummary, buildRunTimeline, buildRunWhatSummary, extractMetadata, renderRunWhat, renderTimeline } from './chunk-3USJVBLA.mjs';
|
|
4
|
+
import { parseObservationFilter, extractOutcomesFromTraceEvents } from './chunk-VFO76UH3.mjs';
|
|
4
5
|
import './chunk-BT7CATSD.mjs';
|
|
5
|
-
import { readTraceEventsFromFile } from './chunk-
|
|
6
|
-
export { DEFAULT_MAX_EVENT_BYTES, DEFAULT_MAX_METADATA_VALUE_LENGTH, DEFAULT_MAX_PREVIEW_LENGTH, getRunIdFromTraceFileName, initializeTraceFile, listTraceFiles, prepareMetadataForDisk, prepareTraceEventForDisk, readTraceEvents, readTraceFile, resolveTraceSafetyOptions, serializeEvent, validateEvent, writeTraceEvent } from './chunk-
|
|
7
|
-
import { resolveRedactionProfile } from './chunk-EDTQHZPM.mjs';
|
|
8
|
-
export { resolveRedactionProfile } from './chunk-EDTQHZPM.mjs';
|
|
6
|
+
import { resolveRedactionProfile, readTraceEventsFromFile } from './chunk-ULCGIRTC.mjs';
|
|
7
|
+
export { DEFAULT_MAX_EVENT_BYTES, DEFAULT_MAX_METADATA_VALUE_LENGTH, DEFAULT_MAX_PREVIEW_LENGTH, getRunIdFromTraceFileName, initializeTraceFile, listTraceFiles, prepareMetadataForDisk, prepareTraceEventForDisk, readTraceEvents, readTraceFile, resolveRedactionProfile, resolveTraceSafetyOptions, serializeEvent, validateEvent, writeTraceEvent } from './chunk-ULCGIRTC.mjs';
|
|
9
8
|
import { Redactor } from './chunk-VU6O5QAH.mjs';
|
|
10
9
|
import './chunk-S4YWKV4G.mjs';
|
|
11
|
-
import { parseDuration, formatDuration, isTraceEvent } from './chunk-
|
|
12
|
-
export { DEFAULT_TRACE_DIR_NAME, FALLBACK_TRACE_DIR, MAX_NAME_LENGTH, RUNS_DIR_NAME, createRunId, createStepId, ensureTraceDir, formatDuration, formatError, formatTimestamp, getDefaultTraceDir, getTraceFilePath, isStepStatus, isStepType, isTraceEvent, parseDuration, parseTraceJsonl, truncateName, unknownTraceFormatMessage, warn } from './chunk-
|
|
13
|
-
import './chunk-
|
|
10
|
+
import { parseDuration, formatDuration, isTraceEvent } from './chunk-WRE4CNPF.mjs';
|
|
11
|
+
export { DEFAULT_TRACE_DIR_NAME, FALLBACK_TRACE_DIR, MAX_NAME_LENGTH, RUNS_DIR_NAME, createRunId, createStepId, ensureTraceDir, formatDuration, formatError, formatTimestamp, getDefaultTraceDir, getTraceFilePath, isStepStatus, isStepType, isTraceEvent, parseDuration, parseTraceJsonl, truncateName, unknownTraceFormatMessage, warn } from './chunk-WRE4CNPF.mjs';
|
|
12
|
+
import './chunk-P366CCL2.mjs';
|
|
14
13
|
import './chunk-7TGZLWEE.mjs';
|
|
15
14
|
import { createReadStream } from 'fs';
|
|
16
15
|
import { createInterface } from 'readline';
|
|
@@ -434,8 +433,9 @@ async function searchTraces(metas, options) {
|
|
|
434
433
|
}
|
|
435
434
|
const limit = options.limit ?? 50;
|
|
436
435
|
const sessionId = options.session?.trim();
|
|
436
|
+
const observationStatus = parseObservationFilter(options.observation);
|
|
437
437
|
const hasContentFilter = Boolean(
|
|
438
|
-
options.status || stepTypeFilter || nameQuery || toolQuery || durationFilter
|
|
438
|
+
options.status || stepTypeFilter || nameQuery || toolQuery || durationFilter || observationStatus
|
|
439
439
|
);
|
|
440
440
|
const results = [];
|
|
441
441
|
const sessionLabel = sessionId && sessionId !== "" ? sessionId : void 0;
|
|
@@ -480,6 +480,22 @@ async function searchTraces(metas, options) {
|
|
|
480
480
|
statusFilter: options.status
|
|
481
481
|
});
|
|
482
482
|
results.push(...stepMatches);
|
|
483
|
+
if (observationStatus) {
|
|
484
|
+
const outcomes = extractOutcomesFromTraceEvents(events);
|
|
485
|
+
const matched = outcomes.filter((outcome) => outcome.status === observationStatus);
|
|
486
|
+
for (const outcome of matched) {
|
|
487
|
+
results.push({
|
|
488
|
+
runId: m.runId,
|
|
489
|
+
runName: m.name,
|
|
490
|
+
runStatus: m.status,
|
|
491
|
+
stepName: outcome.name,
|
|
492
|
+
timestamp: outcome.observedAt,
|
|
493
|
+
matchReason: `observation status=${outcome.status}`,
|
|
494
|
+
matchedFields: ["outcome.status", "outcome.name"],
|
|
495
|
+
filePath: m.filePath
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
}
|
|
483
499
|
}
|
|
484
500
|
results.sort((a, b) => {
|
|
485
501
|
const ta = a.timestamp ?? 0;
|
|
@@ -868,9 +884,10 @@ function buildActivitySummary(index, options = {}) {
|
|
|
868
884
|
entries
|
|
869
885
|
};
|
|
870
886
|
}
|
|
871
|
-
function renderActivitySummaryHuman(summary) {
|
|
887
|
+
function renderActivitySummaryHuman(summary, options) {
|
|
872
888
|
const lines = [];
|
|
873
|
-
const
|
|
889
|
+
const nowMs = options?.nowMs ?? Date.now();
|
|
890
|
+
const todayStart = new Date(nowMs);
|
|
874
891
|
todayStart.setHours(0, 0, 0, 0);
|
|
875
892
|
const todayMs = todayStart.getTime();
|
|
876
893
|
const today = summary.entries.filter(
|