agent-inspect 5.3.0 → 5.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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createSafetyOversizedAttributeRule, resolveTraceDir, parseDuration, buildSessionIndex, enrichSessionRunRecord, TraceDirectory, loadTraceMetadataList, loadSessionRunRecords, extractMetadata, filterTraces, truncateName, getTraceFilePath, buildRunSummary, formatDuration, formatTimestamp, isAgentInspectTrace, openTrace, TraceReadError, filterMetasBySessionScope, runTraceChecks, aggregateSessionCheckResults, createBaselineRegressionRule, resolveBundleRunIds, aggregateBundleSafeStatus, bundleFailsOnSafety, buildPlaceholderArtifact, buildBundleMetadata, buildBundleSummaryMarkdown, buildRunTimeline, renderTimeline, buildTraceStats, renderTraceStats, parseDurationFilter, searchTraces, buildActivitySummary, renderActivitySummaryHuman, buildRunWhatSummary, renderRunWhat, buildLocalExplanation, defaultSuiteConfigTemplate, loadSuiteConfig, validateSuiteConfig, runSuite, renderSuiteReport, analyzeCohort, renderCohortReport, gateHasThresholds, runGate, renderGateReport, persistedInspectEventsToTraceEvents, renderStepLine, renderErrorLine, getIndent, Redactor, TreeBuilder, zeroKinds, validateEvent, traceEventToPersistedInspectEvent, isPersistedInspectEvent, createRunStatusRule, createStructureOrphanRule, createStructureCycleRule, createRunDurationRule, createMaxStepDurationRule, createRequireCompletedRule, createStallDetectionRule, createObservedOutcomeRule, createRunDepthRule, createToolUsageRule, createLlmUsageRule, createStructureRelationshipRule, createStructureParallelWidthRule, normalizeBundleOutputPath, defaultBundleOutputPath, summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml, escapeMarkdown, escapeHtml, DEFAULT_SUITE_ARTIFACTS_DIR, parseCohortMetricList, COHORT_METRIC_IDS, parseGateList, nanoid, resolveRedactionProfile, applyProfileMetadataCaps, flattenTree, safeString, compactAttributes, stableJson, truncateStringForProfile } from './chunk-4LKKB4Z5.mjs';
2
+ import { createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createSafetyOversizedAttributeRule, resolveTraceDir, parseDuration, buildSessionIndex, enrichSessionRunRecord, TraceDirectory, loadTraceMetadataList, loadSessionRunRecords, extractMetadata, filterTraces, truncateName, getTraceFilePath, buildRunSummary, formatDuration, formatTimestamp, isAgentInspectTrace, openTrace, TraceReadError, filterMetasBySessionScope, runTraceChecks, aggregateSessionCheckResults, createBaselineRegressionRule, resolveBundleRunIds, aggregateBundleSafeStatus, bundleFailsOnSafety, buildPlaceholderArtifact, buildBundleMetadata, buildBundleSummaryMarkdown, buildRunTimeline, renderTimeline, buildTraceStats, renderTraceStats, parseDurationFilter, searchTraces, buildActivitySummary, renderActivitySummaryHuman, buildRunWhatSummary, renderRunWhat, buildLocalExplanation, resolveSuiteTemplate, defaultSuiteConfigTemplate, loadSuiteConfig, validateSuiteConfig, runSuite, renderSuiteReport, analyzeCohort, renderCohortReport, gateHasThresholds, runGate, renderGateReport, persistedInspectEventsToTraceEvents, renderStepLine, renderErrorLine, getIndent, Redactor, TreeBuilder, zeroKinds, validateEvent, traceEventToPersistedInspectEvent, isPersistedInspectEvent, createRunStatusRule, createStructureOrphanRule, createStructureCycleRule, createRunDurationRule, createMaxStepDurationRule, createRequireCompletedRule, createStallDetectionRule, createObservedOutcomeRule, createRunDepthRule, createToolUsageRule, createLlmUsageRule, createStructureRelationshipRule, createStructureParallelWidthRule, normalizeBundleOutputPath, defaultBundleOutputPath, summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml, escapeMarkdown, escapeHtml, DEFAULT_SUITE_ARTIFACTS_DIR, parseCohortMetricList, COHORT_METRIC_IDS, parseGateList, nanoid, resolveRedactionProfile, applyProfileMetadataCaps, flattenTree, safeString, compactAttributes, stableJson, truncateStringForProfile } from './chunk-YS2I722C.mjs';
3
3
  import { realpathSync, constants as constants$1 } from 'fs';
4
4
  import path14 from 'path';
5
5
  import { fileURLToPath, pathToFileURL } from 'url';
@@ -11,7 +11,7 @@ import { createServer } from 'http';
11
11
  import { createRequire } from 'module';
12
12
 
13
13
  // package.json
14
- var version = "5.3.0";
14
+ var version = "5.4.0";
15
15
 
16
16
  // packages/cli/src/trace-dir-scale.ts
17
17
  var TRACE_COUNT_WARN = 1e3;
@@ -3782,7 +3782,7 @@ async function newestTraceMtimeMs(traceDir) {
3782
3782
  }
3783
3783
  async function loadSessionRuns(traceDir) {
3784
3784
  try {
3785
- const mod = await import('./src-4SGS3Q2D.mjs');
3785
+ const mod = await import('./src-FVNE44UA.mjs');
3786
3786
  const dbPath = mod.resolveIndexDbPath(traceDir);
3787
3787
  const status = mod.indexStatus(dbPath);
3788
3788
  if (!status.healthy) {
@@ -9875,7 +9875,7 @@ function isModuleNotFound3(e) {
9875
9875
  }
9876
9876
  async function loadIndexSqlite() {
9877
9877
  try {
9878
- return await import('./src-4SGS3Q2D.mjs');
9878
+ return await import('./src-FVNE44UA.mjs');
9879
9879
  } catch (e) {
9880
9880
  if (isModuleNotFound3(e)) {
9881
9881
  console.error(
@@ -10162,30 +10162,39 @@ function resolveCwd(options) {
10162
10162
  async function suiteInitCommand(options = {}) {
10163
10163
  const cwd = resolveCwd(options);
10164
10164
  const configPath = path14.join(cwd, DEFAULT_CONFIG_FILENAME);
10165
- const template = defaultSuiteConfigTemplate();
10165
+ const template = options.template?.trim();
10166
+ const suiteConfig = template !== void 0 && template !== "" ? resolveSuiteTemplate(template) : defaultSuiteConfigTemplate();
10166
10167
  if (options.dryRun) {
10167
10168
  if (options.json) {
10168
10169
  printJson5({
10169
10170
  ok: true,
10170
10171
  dryRun: true,
10171
10172
  wouldWrite: [DEFAULT_CONFIG_FILENAME],
10172
- config: template
10173
+ config: suiteConfig,
10174
+ ...template ? { template } : {}
10173
10175
  });
10174
10176
  return;
10175
10177
  }
10176
10178
  console.log("Dry run \u2014 would create:");
10177
10179
  console.log(`- ${DEFAULT_CONFIG_FILENAME}`);
10180
+ if (template) console.log(` template: ${template}`);
10178
10181
  return;
10179
10182
  }
10180
10183
  try {
10181
- await writeFile(configPath, `${JSON.stringify(template, null, 2)}
10184
+ await writeFile(configPath, `${JSON.stringify(suiteConfig, null, 2)}
10182
10185
  `, "utf-8");
10183
10186
  if (options.json) {
10184
- printJson5({ ok: true, created: [DEFAULT_CONFIG_FILENAME], configPath });
10187
+ printJson5({
10188
+ ok: true,
10189
+ created: [DEFAULT_CONFIG_FILENAME],
10190
+ configPath,
10191
+ ...template ? { template } : {}
10192
+ });
10185
10193
  return;
10186
10194
  }
10187
10195
  console.log("Created suite config:");
10188
10196
  console.log(`- ${DEFAULT_CONFIG_FILENAME}`);
10197
+ if (template) console.log(` template: ${template}`);
10189
10198
  console.log("\nNext:");
10190
10199
  console.log(" npx agent-inspect suite validate");
10191
10200
  console.log(" npx agent-inspect suite run --json");
@@ -10986,7 +10995,7 @@ function createCliProgram() {
10986
10995
  runCommand(() => workspacePathCommand(opts));
10987
10996
  });
10988
10997
  const suiteCmd = program.command("suite").description("Define and run local trace suites for CI (v5.0+)");
10989
- suiteCmd.command("init").description("Create a starter agent-inspect.suite.json").option("--dry-run", "show planned files without writing").option("--json", "print deterministic JSON result").action((opts) => {
10998
+ suiteCmd.command("init").description("Create a starter agent-inspect.suite.json").option("--template <name>", "PM/QA template id (v5.4+)").option("--dry-run", "show planned files without writing").option("--json", "print deterministic JSON result").action((opts) => {
10990
10999
  runCommand(() => suiteInitCommand(opts));
10991
11000
  });
10992
11001
  suiteCmd.command("validate").description("Validate suite config shape and trace paths").option("--config <path>", "suite config path").option("--json", "print deterministic JSON result").action((opts) => {