humanish 0.83.2 → 0.84.1

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/dist/program.js CHANGED
@@ -943,20 +943,24 @@ function registerReviewCommand(parent, io) {
943
943
  function registerExportCommand(parent, io) {
944
944
  parent
945
945
  .command("export")
946
- .description("Write one self-contained .html of a run's Observer with screenshots inlined (#471). Verify and the share_ready gate run inside; a local_only bundle exports only with --local-only, watermarked.")
947
- .summary("Export one run as a single shareable .html file.")
946
+ .description("Export a run as self-contained Observer HTML, or a separately verified redacted bundle workspace. HTML requires share_ready unless --local-only; bundle format requires --redact-screenshots and preserves the original.")
947
+ .summary("Export Observer HTML or a redacted bundle workspace.")
948
948
  .option("--run <id>", "Run id or 'latest'.", "latest")
949
- .option("--out <path>", "Where to write the file. Defaults to .humanish/exports/<runId>.html.")
949
+ .addOption(new Option("--format <format>", "Output format; bundle creates a new standalone workspace.").choices(["html", "bundle"]).default("html"))
950
+ .option("--redact-screenshots", "Bundle only: blur PNG screenshots in a verified copy; keep original evidence unchanged.")
951
+ .option("--out <path>", "HTML file or new bundle workspace. Default: .humanish/exports/<runId>.html or <runId>-redacted/.")
950
952
  .option("--local-only", "Export a bundle that is not share_ready, with a LOCAL ONLY banner in the file.")
951
953
  .option("--max-bytes <n>", "Refuse an export larger than this.", String(DEFAULT_EXPORT_MAX_BYTES))
952
954
  .option("--cwd <path>", "Target project directory.", ".")
953
955
  .option("--json", JSON_OPTION_DESCRIPTION)
954
956
  .action(async (options, command) => {
955
- const maxBytes = Number.parseInt(options.maxBytes, 10);
957
+ const maxBytes = options.format === "bundle" ? Number(options.maxBytes) : Number.parseInt(options.maxBytes, 10);
956
958
  const result = await exportRun(options.cwd, options.run, {
959
+ format: options.format,
960
+ ...(options.redactScreenshots === undefined ? {} : { redactScreenshots: options.redactScreenshots }),
957
961
  ...(options.out === undefined ? {} : { out: options.out }),
958
962
  ...(options.localOnly === undefined ? {} : { localOnly: options.localOnly }),
959
- ...(Number.isFinite(maxBytes) && maxBytes > 0 ? { maxBytes } : {})
963
+ ...(options.format === "bundle" || (Number.isFinite(maxBytes) && maxBytes > 0) ? { maxBytes } : {})
960
964
  });
961
965
  writeResult(command, io, result, formatExportHuman);
962
966
  io.setExitCode(result.ok ? 0 : 2);