agent-inspect 6.0.0 → 6.1.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.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- v6.1.0 client-hosted ingestion for @agent-inspect/studio: file-drop, GitHub artifact import, optional HTTP ingest with token validation, and manual bundle upload. All ingest channels disabled by default; self-hosted only.
|
|
8
|
+
|
|
3
9
|
## 6.0.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -10729,7 +10729,7 @@ var init_src = __esm({
|
|
|
10729
10729
|
});
|
|
10730
10730
|
|
|
10731
10731
|
// package.json
|
|
10732
|
-
var version = "6.
|
|
10732
|
+
var version = "6.1.0";
|
|
10733
10733
|
|
|
10734
10734
|
// packages/cli/src/list.ts
|
|
10735
10735
|
init_advanced();
|
|
@@ -17929,9 +17929,103 @@ function parsePort2(value) {
|
|
|
17929
17929
|
}
|
|
17930
17930
|
return parsed;
|
|
17931
17931
|
}
|
|
17932
|
+
function summarizeFileDropResult(result) {
|
|
17933
|
+
if (result.skipped) {
|
|
17934
|
+
console.log(`[AgentInspect studio] file-drop skipped: ${result.reason ?? "disabled"}`);
|
|
17935
|
+
return;
|
|
17936
|
+
}
|
|
17937
|
+
console.log(
|
|
17938
|
+
`[AgentInspect studio] file-drop scanned=${result.scanned} imported=${result.imported} skipped=${result.skippedFiles}`
|
|
17939
|
+
);
|
|
17940
|
+
for (const warning of result.warnings) {
|
|
17941
|
+
console.warn(`[AgentInspect studio] ${warning}`);
|
|
17942
|
+
}
|
|
17943
|
+
for (const error of result.errors) {
|
|
17944
|
+
console.error(`[AgentInspect studio] ${error}`);
|
|
17945
|
+
}
|
|
17946
|
+
}
|
|
17947
|
+
function summarizeGitHubResult(result) {
|
|
17948
|
+
if (result.skipped) {
|
|
17949
|
+
console.log(`[AgentInspect studio] github import skipped: ${result.reason ?? "disabled"}`);
|
|
17950
|
+
return;
|
|
17951
|
+
}
|
|
17952
|
+
if (result.imported) {
|
|
17953
|
+
console.log(
|
|
17954
|
+
`[AgentInspect studio] github artifact imported to ${result.destPath ?? "(unknown)"}`
|
|
17955
|
+
);
|
|
17956
|
+
} else if (result.destPath) {
|
|
17957
|
+
console.log(`[AgentInspect studio] github artifact unchanged: ${result.destPath}`);
|
|
17958
|
+
}
|
|
17959
|
+
for (const warning of result.registryImportWarnings) {
|
|
17960
|
+
console.warn(`[AgentInspect studio] ${warning}`);
|
|
17961
|
+
}
|
|
17962
|
+
for (const error of result.errors) {
|
|
17963
|
+
console.error(`[AgentInspect studio] ${error}`);
|
|
17964
|
+
}
|
|
17965
|
+
}
|
|
17966
|
+
async function studioImportBundleCommand(options) {
|
|
17967
|
+
const mod = await loadStudio();
|
|
17968
|
+
if (!mod) return;
|
|
17969
|
+
const result = await mod.runStudioBundleUploadImport({
|
|
17970
|
+
...options.workspace !== void 0 ? { workspacePath: options.workspace } : {},
|
|
17971
|
+
...options.db !== void 0 ? { dbPath: options.db } : {},
|
|
17972
|
+
bundlePath: options.path,
|
|
17973
|
+
...options.cwd !== void 0 ? { cwd: options.cwd } : {}
|
|
17974
|
+
});
|
|
17975
|
+
if (result.skipped) {
|
|
17976
|
+
console.log(`[AgentInspect studio] bundle import skipped: ${result.reason ?? "disabled"}`);
|
|
17977
|
+
} else if (result.imported) {
|
|
17978
|
+
console.log(`[AgentInspect studio] bundle imported to ${result.destPath ?? "(unknown)"}`);
|
|
17979
|
+
} else if (result.destPath) {
|
|
17980
|
+
console.log(`[AgentInspect studio] bundle unchanged: ${result.destPath}`);
|
|
17981
|
+
}
|
|
17982
|
+
for (const warning of result.registryImportWarnings) {
|
|
17983
|
+
console.warn(`[AgentInspect studio] ${warning}`);
|
|
17984
|
+
}
|
|
17985
|
+
for (const error of result.errors) {
|
|
17986
|
+
console.error(`[AgentInspect studio] ${error}`);
|
|
17987
|
+
}
|
|
17988
|
+
if (result.errors.length > 0) process.exitCode = 1;
|
|
17989
|
+
}
|
|
17990
|
+
async function studioImportGitHubCommand(options) {
|
|
17991
|
+
const mod = await loadStudio();
|
|
17992
|
+
if (!mod) return;
|
|
17993
|
+
const result = await mod.runStudioGitHubArtifactImport({
|
|
17994
|
+
...options.workspace !== void 0 ? { workspacePath: options.workspace } : {},
|
|
17995
|
+
...options.db !== void 0 ? { dbPath: options.db } : {},
|
|
17996
|
+
repo: options.repo,
|
|
17997
|
+
runId: options.runId,
|
|
17998
|
+
artifact: options.artifact,
|
|
17999
|
+
...options.tokenEnv !== void 0 ? { tokenEnv: options.tokenEnv } : {},
|
|
18000
|
+
...options.cwd !== void 0 ? { cwd: options.cwd } : {}
|
|
18001
|
+
});
|
|
18002
|
+
summarizeGitHubResult(result);
|
|
18003
|
+
if (result.errors.length > 0) {
|
|
18004
|
+
process.exitCode = 1;
|
|
18005
|
+
}
|
|
18006
|
+
}
|
|
18007
|
+
async function studioImportDropCommand(options = {}) {
|
|
18008
|
+
const mod = await loadStudio();
|
|
18009
|
+
if (!mod) return;
|
|
18010
|
+
const result = await mod.runStudioFileDropImport({
|
|
18011
|
+
...options.workspace !== void 0 ? { workspacePath: options.workspace } : {},
|
|
18012
|
+
...options.db !== void 0 ? { dbPath: options.db } : {},
|
|
18013
|
+
...options.dir !== void 0 ? { dropDir: options.dir } : {},
|
|
18014
|
+
...options.archive === true ? { archiveAfterImport: true } : {},
|
|
18015
|
+
...options.cwd !== void 0 ? { cwd: options.cwd } : {}
|
|
18016
|
+
});
|
|
18017
|
+
summarizeFileDropResult(result);
|
|
18018
|
+
if (result.errors.length > 0) {
|
|
18019
|
+
process.exitCode = 1;
|
|
18020
|
+
}
|
|
18021
|
+
}
|
|
17932
18022
|
async function studioCommand(options = {}) {
|
|
17933
18023
|
const mod = await loadStudio();
|
|
17934
18024
|
if (!mod) return;
|
|
18025
|
+
const ingest = options.ingest?.trim();
|
|
18026
|
+
if (ingest && ingest !== "file-drop" && ingest !== "http") {
|
|
18027
|
+
throw new Error(`Unsupported --ingest channel: ${ingest}. Supported: file-drop, http`);
|
|
18028
|
+
}
|
|
17935
18029
|
const port = parsePort2(options.port);
|
|
17936
18030
|
const host = options.host?.trim();
|
|
17937
18031
|
const info = await mod.startStudioServer({
|
|
@@ -17942,8 +18036,18 @@ async function studioCommand(options = {}) {
|
|
|
17942
18036
|
...options.server === true ? { server: true } : {},
|
|
17943
18037
|
...options.cwd !== void 0 ? { cwd: options.cwd } : {},
|
|
17944
18038
|
...options.auth === "basic" ? { auth: "basic" } : {},
|
|
17945
|
-
...options.passwordEnv !== void 0 ? { passwordEnv: options.passwordEnv } : {}
|
|
18039
|
+
...options.passwordEnv !== void 0 ? { passwordEnv: options.passwordEnv } : {},
|
|
18040
|
+
...ingest === "file-drop" ? { ingestFileDrop: true } : {},
|
|
18041
|
+
...ingest === "http" ? { ingestHttp: true } : {},
|
|
18042
|
+
...options.ingestTokenEnv !== void 0 ? { ingestTokenEnv: options.ingestTokenEnv } : {},
|
|
18043
|
+
...options.archiveFileDrop === true ? { archiveFileDrop: true } : {}
|
|
17946
18044
|
});
|
|
18045
|
+
if (ingest === "file-drop") {
|
|
18046
|
+
console.log(`[AgentInspect studio] file-drop ingest enabled for startup scan`);
|
|
18047
|
+
}
|
|
18048
|
+
if (ingest === "http") {
|
|
18049
|
+
console.log(`[AgentInspect studio] HTTP ingest enabled (token required on POST routes)`);
|
|
18050
|
+
}
|
|
17947
18051
|
console.log(`AgentInspect studio (read-only): ${info.url}`);
|
|
17948
18052
|
if (options.open === true && info.host !== "127.0.0.1" && info.host !== "localhost") {
|
|
17949
18053
|
console.warn("Skipping browser open for non-local host binding.");
|
|
@@ -21622,11 +21726,21 @@ function createCliProgram() {
|
|
|
21622
21726
|
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) => {
|
|
21623
21727
|
runCommand(() => serveCommand(opts));
|
|
21624
21728
|
});
|
|
21625
|
-
program.command("studio").description(
|
|
21729
|
+
const studioCmd = program.command("studio").description(
|
|
21626
21730
|
"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) => {
|
|
21731
|
+
).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("--ingest <channel>", "enable ingest channel on startup (file-drop, http)").option("--ingest-token-env <name>", "env var for HTTP ingest token (default STUDIO_INGEST_TOKEN)").option("--archive-file-drop", "archive file-drop sources after successful import").option("--open", "open browser locally when host is localhost").action((opts) => {
|
|
21628
21732
|
runCommand(() => studioCommand(opts));
|
|
21629
21733
|
});
|
|
21734
|
+
const studioImportCmd = studioCmd.command("import").description("Import external evidence into Studio (v6.1+)");
|
|
21735
|
+
studioImportCmd.command("drop").description("Import allowlisted files from a file-drop directory").option("--workspace <path>", "studio registry manifest path").option("--db <path>", "studio database path (sqlite file or postgres URL)").option("--dir <path>", "file-drop directory (defaults to registry import.fileDropDir)").option("--archive", "move imported files into .imported/ under the drop dir").action((opts) => {
|
|
21736
|
+
runCommand(() => studioImportDropCommand(opts));
|
|
21737
|
+
});
|
|
21738
|
+
studioImportCmd.command("github").description("Download a GitHub Actions artifact into the studio import dirs").requiredOption("--repo <owner/name>", "GitHub repository").requiredOption("--run-id <id>", "workflow run id").requiredOption("--artifact <name>", "artifact name").option("--workspace <path>", "studio registry manifest path").option("--db <path>", "studio database path (sqlite file or postgres URL)").option("--token-env <name>", "env var for GitHub token (default GITHUB_TOKEN)").action((opts) => {
|
|
21739
|
+
runCommand(() => studioImportGitHubCommand(opts));
|
|
21740
|
+
});
|
|
21741
|
+
studioImportCmd.command("bundle").description("Import a local share-safe bundle directory into Studio").requiredOption("--path <dir>", "bundle directory path").option("--workspace <path>", "studio registry manifest path").option("--db <path>", "studio database path (sqlite file or postgres URL)").action((opts) => {
|
|
21742
|
+
runCommand(() => studioImportBundleCommand(opts));
|
|
21743
|
+
});
|
|
21630
21744
|
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(
|
|
21631
21745
|
new commander.Option("--format <format>", "trace input format").choices([
|
|
21632
21746
|
"agent-inspect-jsonl",
|