@mutagent/cli 0.2.5 → 0.2.6

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/README.md CHANGED
@@ -23,7 +23,7 @@ sandboxes and Helix sessions, and the standalone Helix binary installer.
23
23
  **Status:** all commands and flags below were verified against `mutagent --help`
24
24
  (and each subcommand's `--help`) on this branch. `sandbox` is internal (everyday
25
25
  use goes through `mutagent helix`); `trace` is not implemented in this binary —
26
- it prints where to find it (`helix-cli trace`) and exits with an error.
26
+ it prints where to find it (in Helix) and exits with an error.
27
27
 
28
28
  [Context](#context) · [Concepts](#concepts) · [Components](#components) · [Configuration](#configuration) · [Reference](#reference)
29
29
 
@@ -111,7 +111,7 @@ flowchart TD
111
111
  ENVIRONMENT["mutagent env"]
112
112
  HELIX["mutagent helix"]
113
113
  AGENT["mutagent agent"]
114
- TRACE["mutagent trace<br/>(→ helix-cli)"]
114
+ TRACE["mutagent trace<br/>(→ Helix)"]
115
115
  end
116
116
 
117
117
  subgraph LIFECYCLE ["Helix & Feedback"]
package/dist/bin/cli.js CHANGED
@@ -34168,7 +34168,8 @@ var PUBLISH_MARKER_VALUES = ["redacted", "assume-sanitized"];
34168
34168
  var MAX_REPORT_HTML_CHARS = 10 * 1024 * 1024;
34169
34169
  var MAX_RENDER_INPUT_BYTES = 2 * 1024 * 1024;
34170
34170
  var RENDER_INPUT_FILE = "render-input.json";
34171
- var PUBLISH_FIX = "Run: helix-cli report publish <report.html> <report.client.html>, then push the .client.html file";
34171
+ var NOT_BY_HELIX = "This report was not published by Helix; rerun the stage in Helix.";
34172
+ var PUBLISH_FIX = "Rerun the stage in Helix, which publishes the report, then push its run directory: mutagent reports push <run dir>";
34172
34173
  var INTERNAL_SURFACES = [
34173
34174
  { name: "calibration panel (section#t5)", pattern: /<section\b[^>]*\bid\s*=\s*["']t5["']/i },
34174
34175
  { name: "internal navigation tab", pattern: /<button\b[^>]*\bclass\s*=\s*["']tab-btn internal["']/i },
@@ -34188,7 +34189,7 @@ function parseReportKind(value2) {
34188
34189
  return value2;
34189
34190
  const mapped3 = HELIX_RENDER_KIND_MAP[value2];
34190
34191
  if (mapped3 !== undefined) {
34191
- throw invalid2(`'${value2}' is the helix-cli render kind; push it as --kind ${mapped3}.`);
34192
+ throw invalid2(`'${value2}' is the Helix render kind; push it as --kind ${mapped3}.`);
34192
34193
  }
34193
34194
  throw invalid2(`Unknown report kind '${value2}'. Allowed: ${REPORT_KINDS.join(", ")}.`);
34194
34195
  }
@@ -34206,17 +34207,17 @@ function assertPublished(html, path) {
34206
34207
  const markers = publishMarkersOf(html);
34207
34208
  const marker = markers[0];
34208
34209
  if (markers.length > 1) {
34209
- throw notPublished(`${path} carries ${String(markers.length)} ${PUBLISH_MARKER_NAME} markers; a published report has exactly one. ` + "Publish the raw render again with `helix-cli report publish`.");
34210
+ throw notPublished(`${path} carries ${String(markers.length)} ${PUBLISH_MARKER_NAME} markers; a published report has exactly one. ` + NOT_BY_HELIX);
34210
34211
  }
34211
34212
  if (marker === undefined) {
34212
- throw notPublished(`${path} has no ${PUBLISH_MARKER_NAME} marker, so it was not written by \`helix-cli report publish\` ` + "(the PII gate). A report published by an older helix-cli has no marker either: publish it again.");
34213
+ throw notPublished(`${path} has no ${PUBLISH_MARKER_NAME} marker (publishing is the PII gate). ${NOT_BY_HELIX}`);
34213
34214
  }
34214
34215
  if (!PUBLISH_MARKER_VALUES.includes(marker)) {
34215
- throw notPublished(`${path} has an unknown ${PUBLISH_MARKER_NAME} value '${marker}' (expected ${PUBLISH_MARKER_VALUES.join(" or ")}). ` + "Publish it again with `helix-cli report publish`.");
34216
+ throw notPublished(`${path} has an unknown ${PUBLISH_MARKER_NAME} value '${marker}' (expected ${PUBLISH_MARKER_VALUES.join(" or ")}). ` + NOT_BY_HELIX);
34216
34217
  }
34217
34218
  const leftovers = internalSurfacesOf(html);
34218
34219
  if (leftovers.length > 0) {
34219
- throw notPublished(`${path} still carries internal report surfaces (${leftovers.join(", ")}), so it was not produced by ` + "`helix-cli report publish`.");
34220
+ throw notPublished(`${path} still carries internal report surfaces (${leftovers.join(", ")}). ${NOT_BY_HELIX}`);
34220
34221
  }
34221
34222
  return marker;
34222
34223
  }
@@ -34229,7 +34230,7 @@ function resolveReportFiles(target, renderInputFlag) {
34229
34230
  const published = htmlFiles.filter((f) => /\.client\.html?$/i.test(f));
34230
34231
  if (published.length === 0) {
34231
34232
  if (htmlFiles.length > 0) {
34232
- throw notPublished(`${target} has no published report (*.client.html), only ${htmlFiles.join(", ")}. ` + `Publish it first: helix-cli report publish ${join24(target, htmlFiles[0] ?? "report.html")}`);
34233
+ throw notPublished(`${target} has no published report (*.client.html), only ${htmlFiles.join(", ")}. ${NOT_BY_HELIX}`);
34233
34234
  }
34234
34235
  throw invalid2(`${target} holds no report HTML. Pass the published file itself, or the run directory that holds it.`);
34235
34236
  }
@@ -34304,27 +34305,29 @@ function refuseForHitl(options) {
34304
34305
  throw new MutagentError("VALIDATION_ERROR", `${refused.join(" and ")} cannot be used with --kind hitl: a hitl report carries no run id, so every push stores a new report and there is nothing to replace.`, "Run: mutagent reports push --help");
34305
34306
  }
34306
34307
  function registerReportsPush(reports) {
34307
- reports.command("push").description("Upload a published run report: its render input and the HTML `helix-cli report publish` wrote").argument("<run-dir|report-file>", "A run directory (render-input.json + one *.client.html), or the published HTML file").option("--kind <kind>", "diagnostics|discovery|evaluator|hitl").option("--run-id <id>", "The producing run (default: the render input's runId). Not with --kind hitl").option("--subject <id>", "The agent, skill or workflow the report is about").option("--session-ref <ref>", "The Helix session reference").option("--title <text>", "Report title (default: the HTML <title>)").option("--render-input <file>", "The render-input JSON (default: render-input.json beside the HTML)").option("--replace", "Swap the content of the report already stored for this run and kind. Not with --kind hitl").addHelpText("after", `
34308
+ reports.command("push").description("Upload a run report Helix published: its render input and its client-safe HTML").argument("<run-dir|report-file>", "A run directory (render-input.json + one *.client.html), or the published HTML file").option("--kind <kind>", "diagnostics|discovery|evaluator|hitl").option("--run-id <id>", "The producing run (default: the render input's runId). Not with --kind hitl").option("--subject <id>", "The agent, skill or workflow the report is about").option("--session-ref <ref>", "The Helix session reference").option("--title <text>", "Report title (default: the HTML <title>)").option("--render-input <file>", "The render-input JSON (default: render-input.json beside the HTML)").option("--replace", "Swap the content of the report already stored for this run and kind. Not with --kind hitl").addHelpText("after", `
34308
34309
  Usage:
34309
34310
  ${PUSH_USAGE}
34310
34311
 
34312
+ Helix publishes a run's report and, in a cloud sandbox, pushes it. To push a report
34313
+ Helix already published from a local run: \`mutagent reports push <run dir>\`.
34314
+
34311
34315
  Examples:
34312
- ${chalk54.dim("$")} helix-cli report publish runs/42/report.html runs/42/report.client.html
34313
34316
  ${chalk54.dim("$")} mutagent reports push runs/42 --kind evaluator
34314
34317
  ${chalk54.dim("$")} mutagent reports push runs/42/report.client.html --kind diagnostics --run-id run-42 --json
34315
34318
  ${chalk54.dim("$")} mutagent reports push runs/42 --kind evaluator --replace
34316
34319
  ${chalk54.dim("$")} mutagent reports push review/ --kind hitl
34317
34320
 
34318
- Kinds, and the helix-cli render kind each one comes from:
34321
+ Kinds, and the Helix render kind each one comes from:
34319
34322
  diagnosis → diagnostics · discover → discovery · eval → evaluator · review → hitl
34320
34323
  Any other kind (roster, dogfood, ship, the skill-builder kinds) is refused.
34321
34324
 
34322
34325
  Only published reports are accepted:
34323
- The HTML must be the file \`helix-cli report publish\` wrote (the PII gate). Publish
34324
- stamps <meta name="mutagent-report-published" content="redacted|assume-sanitized">
34326
+ The HTML must be the client-safe file Helix published (publishing is the PII gate).
34327
+ Publishing stamps <meta name="mutagent-report-published" content="redacted|assume-sanitized">
34325
34328
  into every report; a file without exactly one such tag with one of those values is
34326
34329
  refused (exit 1, REPORT_NOT_PUBLISHED) and nothing is sent. So is a file that still carries the evaluator's internal panels.
34327
- A report published by an older helix-cli has no marker: publish it again.
34330
+ Such a report was not published by Helix: rerun the stage in Helix.
34328
34331
 
34329
34332
  Idempotent per run and kind:
34330
34333
  A repeat push of the same run id and kind stores nothing new: it prints
@@ -34344,13 +34347,13 @@ Exit 0: stored, or already stored.
34344
34347
  ${EXIT_CODES_LINE}
34345
34348
 
34346
34349
  AI Agent Directive:
34347
- 1. Publish first: \`helix-cli report publish <report.html> <report.client.html>\`, then
34348
- push the run directory or the .client.html file. Never push the raw render.
34350
+ 1. Push only a report Helix published: the run directory or its .client.html file.
34351
+ Never push the raw render.
34349
34352
  2. --json returns { success, created, replaced, report, _links, _directive }.
34350
34353
  created:false with replaced:false means it was already stored; that is success.
34351
34354
  3. Pass --replace only when the user asked to overwrite the stored report.
34352
- 4. On REPORT_NOT_PUBLISHED, run the publish command in suggestedAction; do not edit
34353
- the HTML to add the marker.
34355
+ 4. On REPORT_NOT_PUBLISHED, the report was not published by Helix: rerun the stage in
34356
+ Helix (suggestedAction). Do not edit the HTML to add the marker.
34354
34357
  5. Show _directive.renderedCard to the user verbatim.
34355
34358
  `).action(async (target, options, command) => {
34356
34359
  await runReportsAction(command, async (isJson) => {
@@ -34422,7 +34425,7 @@ The workspace is the usual one: --workspace, MUTAGENT_WORKSPACE_ID or 'mutagent
34422
34425
 
34423
34426
  AI Agent Directive:
34424
34427
  1. Read first: 'mutagent reports list --json'. Reads need no confirmation.
34425
- 2. push only files 'helix-cli report publish' wrote; see 'mutagent reports push --help'.
34428
+ 2. push only reports Helix published; see 'mutagent reports push --help'.
34426
34429
  3. review and retract are writes: confirm with the user, then run them (retract with --force).
34427
34430
  4. On an error, run the command in suggestedAction once; never retry blind.
34428
34431
  `);
@@ -37225,4 +37228,4 @@ if (process.env.CLI_VERSION) {
37225
37228
  }
37226
37229
  runCli(process.argv.slice(2), cliVersion);
37227
37230
 
37228
- //# debugId=07925BBF4EE6948C64756E2164756E21
37231
+ //# debugId=E319FD98480B5A9D64756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutagent/cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Bun-native CLI for the MutagenT AI platform - auth, provider config, and lifecycle-tool installer for AI-native workflows",
5
5
  "type": "module",
6
6
  "bin": {