agent-inspect 5.4.0 → 6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add self-hosted Studio (`@agent-inspect/studio`): optional read-only multi-project analyzer with `agent-inspect studio`, SQLite metadata cache, registry import, search/diff/reports views, optional basic auth, and self-hosting docs. Localhost by default; no maintainer cloud; no default upload.
8
+
3
9
  ## 5.4.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "5.4.0",
3
+ "version": "6.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Trace, check, and safely share TypeScript AI-agent runs locally — no account, no upload, metadata-only by default",
@@ -206,7 +206,7 @@
206
206
  },
207
207
  "scripts": {
208
208
  "clean": "pnpm -r exec -- rm -rf dist",
209
- "build": "pnpm exec tsup --config tsup.core.config.ts && pnpm exec tsup --config tsup.cli.config.ts && pnpm exec tsup --config tsup.langchain.config.ts && pnpm exec tsup --config tsup.tui.config.ts && pnpm exec tsup --config tsup.ai-sdk.config.ts && pnpm exec tsup --config tsup.vitest.config.ts && pnpm exec tsup --config tsup.jest.config.ts && pnpm exec tsup --config tsup.openai-agents.config.ts && pnpm exec tsup --config tsup.harness.config.ts && pnpm exec tsup --config tsup.redact.config.ts && pnpm exec tsup --config tsup.eval.config.ts && pnpm exec tsup --config tsup.mcp.config.ts && pnpm exec tsup --config tsup.guardrails.config.ts && pnpm exec tsup --config tsup.circuit.config.ts && pnpm exec tsup --config tsup.viewer.config.ts && pnpm exec tsup --config tsup.mcp-server.config.ts && pnpm exec tsup --config tsup.adapter-sdk.config.ts && pnpm exec tsup --config tsup.vscode.config.ts && pnpm exec tsup --config tsup.index-sqlite.config.ts",
209
+ "build": "pnpm exec tsup --config tsup.core.config.ts && pnpm exec tsup --config tsup.cli.config.ts && pnpm exec tsup --config tsup.langchain.config.ts && pnpm exec tsup --config tsup.tui.config.ts && pnpm exec tsup --config tsup.ai-sdk.config.ts && pnpm exec tsup --config tsup.vitest.config.ts && pnpm exec tsup --config tsup.jest.config.ts && pnpm exec tsup --config tsup.openai-agents.config.ts && pnpm exec tsup --config tsup.harness.config.ts && pnpm exec tsup --config tsup.redact.config.ts && pnpm exec tsup --config tsup.eval.config.ts && pnpm exec tsup --config tsup.mcp.config.ts && pnpm exec tsup --config tsup.guardrails.config.ts && pnpm exec tsup --config tsup.circuit.config.ts && pnpm exec tsup --config tsup.viewer.config.ts && pnpm exec tsup --config tsup.mcp-server.config.ts && pnpm exec tsup --config tsup.adapter-sdk.config.ts && pnpm exec tsup --config tsup.vscode.config.ts && pnpm exec tsup --config tsup.index-sqlite.config.ts && pnpm exec tsup --config tsup.studio.config.ts",
210
210
  "typecheck": "tsc --noEmit",
211
211
  "test": "vitest run",
212
212
  "test:watch": "vitest",
@@ -10729,7 +10729,7 @@ var init_src = __esm({
10729
10729
  });
10730
10730
 
10731
10731
  // package.json
10732
- var version = "5.4.0";
10732
+ var version = "6.0.0";
10733
10733
 
10734
10734
  // packages/cli/src/list.ts
10735
10735
  init_advanced();
@@ -17899,6 +17899,63 @@ async function serveCommand(options = {}) {
17899
17899
  });
17900
17900
  }
17901
17901
 
17902
+ // packages/cli/src/studio-cmd.ts
17903
+ var PACKAGE = "@agent-inspect/studio";
17904
+ function isModuleNotFound3(e) {
17905
+ return e !== null && typeof e === "object" && "code" in e && (e.code === "ERR_MODULE_NOT_FOUND" || e.code === "MODULE_NOT_FOUND");
17906
+ }
17907
+ async function loadStudio() {
17908
+ try {
17909
+ return await import('@agent-inspect/studio');
17910
+ } catch (e) {
17911
+ if (isModuleNotFound3(e)) {
17912
+ console.error(
17913
+ `The optional Studio analyzer is not installed. Run: npm install ${PACKAGE}`
17914
+ );
17915
+ process.exitCode = 1;
17916
+ return null;
17917
+ }
17918
+ const msg = e instanceof Error ? e.message : String(e);
17919
+ console.error(`[AgentInspect] failed to load ${PACKAGE}: ${msg}`);
17920
+ process.exitCode = 1;
17921
+ return null;
17922
+ }
17923
+ }
17924
+ function parsePort2(value) {
17925
+ if (value === void 0) return void 0;
17926
+ const parsed = Number(value);
17927
+ if (!Number.isInteger(parsed) || parsed <= 0 || parsed > 65535) {
17928
+ throw new Error("--port must be an integer between 1 and 65535.");
17929
+ }
17930
+ return parsed;
17931
+ }
17932
+ async function studioCommand(options = {}) {
17933
+ const mod = await loadStudio();
17934
+ if (!mod) return;
17935
+ const port = parsePort2(options.port);
17936
+ const host = options.host?.trim();
17937
+ const info = await mod.startStudioServer({
17938
+ ...host !== void 0 && host.length > 0 ? { host } : {},
17939
+ ...port !== void 0 ? { port } : {},
17940
+ ...options.workspace !== void 0 ? { workspacePath: options.workspace } : {},
17941
+ ...options.db !== void 0 ? { dbPath: options.db } : {},
17942
+ ...options.server === true ? { server: true } : {},
17943
+ ...options.cwd !== void 0 ? { cwd: options.cwd } : {},
17944
+ ...options.auth === "basic" ? { auth: "basic" } : {},
17945
+ ...options.passwordEnv !== void 0 ? { passwordEnv: options.passwordEnv } : {}
17946
+ });
17947
+ console.log(`AgentInspect studio (read-only): ${info.url}`);
17948
+ if (options.open === true && info.host !== "127.0.0.1" && info.host !== "localhost") {
17949
+ console.warn("Skipping browser open for non-local host binding.");
17950
+ } else if (options.open === true) {
17951
+ const openMod = await import('child_process');
17952
+ openMod.exec(`open ${info.url}`, () => {
17953
+ });
17954
+ }
17955
+ await new Promise(() => {
17956
+ });
17957
+ }
17958
+
17902
17959
  // packages/eval/src/index.ts
17903
17960
  function isTraceReadResult(value) {
17904
17961
  return value !== null && typeof value === "object" && "runs" in value && "events" in value && "format" in value;
@@ -20701,23 +20758,23 @@ async function indexCleanCommand(options = {}) {
20701
20758
 
20702
20759
  // packages/cli/src/index-sqlite-cmd.ts
20703
20760
  init_advanced();
20704
- var PACKAGE = "@agent-inspect/index-sqlite";
20705
- function isModuleNotFound3(e) {
20761
+ var PACKAGE2 = "@agent-inspect/index-sqlite";
20762
+ function isModuleNotFound4(e) {
20706
20763
  return e !== null && typeof e === "object" && "code" in e && (e.code === "ERR_MODULE_NOT_FOUND" || e.code === "MODULE_NOT_FOUND");
20707
20764
  }
20708
20765
  async function loadIndexSqlite() {
20709
20766
  try {
20710
20767
  return await Promise.resolve().then(() => (init_src(), src_exports));
20711
20768
  } catch (e) {
20712
- if (isModuleNotFound3(e)) {
20769
+ if (isModuleNotFound4(e)) {
20713
20770
  console.error(
20714
- `The optional SQLite index is not installed. Run: npm install ${PACKAGE}`
20771
+ `The optional SQLite index is not installed. Run: npm install ${PACKAGE2}`
20715
20772
  );
20716
20773
  process.exitCode = 1;
20717
20774
  return null;
20718
20775
  }
20719
20776
  const msg = e instanceof Error ? e.message : String(e);
20720
- console.error(`[AgentInspect] failed to load ${PACKAGE}: ${msg}`);
20777
+ console.error(`[AgentInspect] failed to load ${PACKAGE2}: ${msg}`);
20721
20778
  process.exitCode = 1;
20722
20779
  return null;
20723
20780
  }
@@ -21565,6 +21622,11 @@ function createCliProgram() {
21565
21622
  program.command("viewer").description("Start localhost read-only viewer (traces, suite, or workspace) (v5.3+)").option("--dir <path>", "trace directory (trace mode)").option("--suite", "suite evidence mode").option("--workspace", "workspace mode").option("--config <path>", "suite config path (suite mode)").option("--host <host>", "bind host (default 127.0.0.1)", "127.0.0.1").option("--port <number>", "bind port (default 7337)", "7337").option("--open", "open browser locally when host is localhost").action((opts) => {
21566
21623
  runCommand(() => serveCommand(opts));
21567
21624
  });
21625
+ program.command("studio").description(
21626
+ "Start self-hosted read-only Studio analyzer (requires @agent-inspect/studio) (v6.0+)"
21627
+ ).option("--workspace <path>", "studio registry manifest path").option("--db <path>", "studio database path (sqlite file or postgres URL)").option("--host <host>", "bind host (default 127.0.0.1)", "127.0.0.1").option("--port <number>", "bind port (default 7340)", "7340").option("--server", "bind for network access (0.0.0.0; requires explicit opt-in)").option("--auth <mode>", "auth mode: none or basic", "none").option("--password-env <name>", "env var for basic-auth password").option("--open", "open browser locally when host is localhost").action((opts) => {
21628
+ runCommand(() => studioCommand(opts));
21629
+ });
21568
21630
  program.command("eval").description("Run deterministic local evals against a trace").argument("<trace-path-or-run-id>", "trace file, directory, stdin -, or run id").option("--dir <path>", "trace directory for run-id lookup").addOption(
21569
21631
  new commander.Option("--format <format>", "trace input format").choices([
21570
21632
  "agent-inspect-jsonl",