@eigenpal/cli 0.6.3 → 0.6.4

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
  # @eigenpal/cli
2
2
 
3
+ ## 0.6.4
4
+
5
+ ### Patch Changes
6
+
7
+ - c3486a5: Fix agent git cutover QA findings: dashboard runs now navigate to the created run, inbound email aliases preserve mixed-case organization qualifiers, sandbox source materializes under `/workspace/agent`, run artifact downloads use direct paths like `/files/eigenpal.lock`, wait-for-completion responses include source provenance, and CLI wait/watch commands exit nonzero for failed or cancelled runs.
8
+
3
9
  ## 0.6.2
4
10
 
5
11
  ### Patch Changes
package/dist/cli.js CHANGED
@@ -186320,7 +186320,7 @@ import { fileURLToPath as fileURLToPath6 } from "url";
186320
186320
  // package.json
186321
186321
  var package_default = {
186322
186322
  name: "@eigenpal/cli",
186323
- version: "0.6.3",
186323
+ version: "0.6.4",
186324
186324
  description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
186325
186325
  keywords: [
186326
186326
  "eigenpal",
@@ -188821,7 +188821,7 @@ function registerRunCommands(agent) {
188821
188821
  listRunsCmd.action(action(listRunsTarget));
188822
188822
  addJsonFlag(withBaseUrl(runs.command("get <run-id>"))).description("Get one agent run.").option("--include <parts>", "Comma-separated extra parts: feedback,expected,files,trace,issues", "feedback").action(action(getRun));
188823
188823
  addJsonFlag(withBaseUrl(runs.command("rerun <run-id>"))).description("Create a new run from a previous run's stored input snapshot.").option("--wait", "Poll until the rerun reaches a terminal status").option("--interval <seconds>", "Polling interval in seconds", intArg, 2).option("--max-wait <seconds>", "Maximum wait before exiting 2", intArg, 1800).action(action(rerunRun));
188824
- withBaseUrl(runs.command("pull <run-id>")).description("Download run feedback, expected artifacts, files, and metadata.").option("--out <dir>", "Output directory").option("--include <parts>", "Comma-separated parts: feedback,expected,files,output,input,metadata,issues,trace,all", "feedback,expected").option("--json", "Output a JSON summary of written artifacts").action(action(pullRun));
188824
+ withBaseUrl(runs.command("pull <run-id>")).description("Download run feedback, expected artifacts, files, and metadata.").option("--out <dir>", "Output directory").option("--include <parts>", "Comma-separated parts: feedback,expected,files,output,input,metadata,issues,trace,lockfile,all", "feedback,expected").option("--json", "Output a JSON summary of written artifacts").action(action(pullRun));
188825
188825
  addJsonFlag(withBaseUrl(runs.command("compare <reference-run-id> <run-id>"))).description("Compare one run against another run. PDF/DOCX text comparison uses pdftotext/python3 and reports byte fallbacks.").option("--baseline", "Compare actual outputs from both runs instead of expected artifacts").option("--out <dir>", "Write comparison artifacts to this directory").option("--normalize-dates", "Normalize YYYYMMDD and YYYY-MM-DD tokens in filenames/text").option("--fail-on-diff", "Exit 1 when comparison status is fail").action(action(compareRun));
188826
188826
  const artifacts = runs.command("artifacts").description("Inspect run artifact inventory.").action(() => {
188827
188827
  process.stderr.write("`eigenpal agents runs artifacts` requires a subcommand. Run `eigenpal agents runs artifacts --help`.\n");
@@ -189145,10 +189145,14 @@ async function runExecution(agentId, opts) {
189145
189145
  });
189146
189146
  }
189147
189147
  const runId = String(payload.runId ?? "");
189148
+ let waitedForTerminalRun = false;
189148
189149
  if (opts.wait && runId) {
189149
189150
  payload = await pollRun(client, runId, opts.interval ?? 2, opts.maxWait ?? 1800);
189151
+ waitedForTerminalRun = true;
189150
189152
  }
189151
189153
  renderRunPayload(payload, opts);
189154
+ if (waitedForTerminalRun)
189155
+ setExitCodeForFailedTerminalRun(payload);
189152
189156
  }
189153
189157
  async function runExample(agentId, opts) {
189154
189158
  const client = buildClient(opts);
@@ -189159,7 +189163,9 @@ async function runExample(agentId, opts) {
189159
189163
  const runId = started.runs?.[0]?.runId;
189160
189164
  if (opts.wait && runId) {
189161
189165
  const payload2 = await pollRun(client, runId, opts.interval, opts.maxWait);
189162
- return renderRunPayload(payload2, opts);
189166
+ renderRunPayload(payload2, opts);
189167
+ setExitCodeForFailedTerminalRun(payload2);
189168
+ return;
189163
189169
  }
189164
189170
  const payload = {
189165
189171
  runId,
@@ -189184,7 +189190,9 @@ async function rerunRun(executionId, opts) {
189184
189190
  const rerunId = String(payload.runId ?? "");
189185
189191
  if (opts.wait && rerunId) {
189186
189192
  payload = await pollRun(client, rerunId, opts.interval, opts.maxWait);
189187
- return renderRunPayload(payload, opts);
189193
+ renderRunPayload(payload, opts);
189194
+ setExitCodeForFailedTerminalRun(payload);
189195
+ return;
189188
189196
  }
189189
189197
  if (opts.json)
189190
189198
  return printJson(payload);
@@ -189260,6 +189268,13 @@ async function pullRun(executionId, opts) {
189260
189268
  else
189261
189269
  skipped.push("trace.jsonl");
189262
189270
  }
189271
+ if (include.has("files") || include.has("lockfile")) {
189272
+ const file2 = await writeDiagnosticFile(client, executionId, out, "lockfile", "eigenpal.lock", run.lockfileFiles);
189273
+ if (file2)
189274
+ written.push(file2);
189275
+ else
189276
+ skipped.push("eigenpal.lock");
189277
+ }
189263
189278
  const summary = {
189264
189279
  runId: executionId,
189265
189280
  out,
@@ -189278,7 +189293,7 @@ async function pullRun(executionId, opts) {
189278
189293
  async function listRunArtifacts(executionId, opts) {
189279
189294
  const client = buildClient(opts);
189280
189295
  const payload = await client.get(`/api/v1/agents/runs/${encodeURIComponent(executionId)}`, {
189281
- include: "expected,files,input,output,issues,trace,metadata"
189296
+ include: "expected,files,input,output,issues,trace,lockfile,metadata"
189282
189297
  });
189283
189298
  const run = payload.run;
189284
189299
  if (!run)
@@ -189289,6 +189304,7 @@ async function listRunArtifacts(executionId, opts) {
189289
189304
  console.log(table(artifacts, [
189290
189305
  { key: "kind", header: "KIND" },
189291
189306
  { key: "name", header: "NAME" },
189307
+ { key: "path", header: "PATH" },
189292
189308
  { key: "present", header: "PRESENT" }
189293
189309
  ]));
189294
189310
  }
@@ -189482,6 +189498,7 @@ async function watchRunCommand(executionId, opts) {
189482
189498
  const client = buildClient(opts);
189483
189499
  const payload = await pollRun(client, executionId, opts.interval, opts.maxWait);
189484
189500
  renderRunPayload(payload, opts);
189501
+ setExitCodeForFailedTerminalRun(payload);
189485
189502
  }
189486
189503
  async function cancelRun(executionId, opts) {
189487
189504
  if (!(opts.yes || process.stdin.isTTY))
@@ -189913,12 +189930,12 @@ async function writeDiagnosticFile(client, executionId, out, kind, filename, fil
189913
189930
  const exists = rows.some((file2) => String(file2.name ?? "") === filename);
189914
189931
  if (!exists)
189915
189932
  return null;
189916
- const response = await client.getStream(`/api/v1/agents/runs/${encodeURIComponent(executionId)}/files/${kind}/${filename}`);
189933
+ const response = await client.getStream(`/api/v1/agents/runs/${encodeURIComponent(executionId)}/files/${encodeRunArtifactPath(kind === "issues" || kind === "trace" || kind === "lockfile" ? filename : `${kind}/${filename}`)}`);
189917
189934
  await fs.writeFile(path2.join(out, filename), Buffer.from(await response.arrayBuffer()));
189918
189935
  return filename;
189919
189936
  }
189920
189937
  async function downloadTraceText(client, executionId) {
189921
- const response = await client.getStream(`/api/v1/agents/runs/${encodeURIComponent(executionId)}/files/trace/trace.jsonl`);
189938
+ const response = await client.getStream(`/api/v1/agents/runs/${encodeURIComponent(executionId)}/files/trace.jsonl`);
189922
189939
  return Buffer.from(await response.arrayBuffer()).toString("utf-8");
189923
189940
  }
189924
189941
  function diffJson(expected, actual, basePath = "$") {
@@ -189965,27 +189982,36 @@ function fileNames(files) {
189965
189982
  }
189966
189983
  function runArtifactInventory(run) {
189967
189984
  const rows = [
189968
- { kind: "metadata", name: "run.json", present: "yes" }
189985
+ { kind: "metadata", name: "run.json", path: "run.json", present: "yes" }
189969
189986
  ];
189970
- if (run.inputJson != null)
189971
- rows.push({ kind: "input", name: "input.json", present: "yes" });
189972
- if (run.metadata != null)
189973
- rows.push({ kind: "metadata", name: "metadata.json", present: "yes" });
189974
- if (run.expected != null)
189975
- rows.push({ kind: "expected", name: "expected.json", present: "yes" });
189976
- for (const name of fileNames(run.inputFiles))
189977
- rows.push({ kind: "input", name, present: "yes" });
189987
+ if (run.inputJson != null) {
189988
+ rows.push({ kind: "input", name: "input.json", path: "input.json", present: "yes" });
189989
+ }
189990
+ if (run.metadata != null) {
189991
+ rows.push({ kind: "metadata", name: "metadata.json", path: "metadata.json", present: "yes" });
189992
+ }
189993
+ if (run.expected != null) {
189994
+ rows.push({ kind: "expected", name: "expected.json", path: "expected.json", present: "yes" });
189995
+ }
189996
+ for (const name of fileNames(run.inputFiles)) {
189997
+ rows.push({ kind: "input", name, path: `input/${name}`, present: "yes" });
189998
+ }
189978
189999
  for (const name of fileNames(run.resultFiles).filter((name2) => name2 !== "issues.md" && name2 !== "trace.jsonl")) {
189979
- rows.push({ kind: "output", name, present: "yes" });
190000
+ rows.push({ kind: "output", name, path: `output/${name}`, present: "yes" });
189980
190001
  }
189981
190002
  for (const name of fileNames(run.expectedFiles)) {
189982
- rows.push({ kind: "expected", name, present: "yes" });
190003
+ rows.push({ kind: "expected", name, path: `expected/${name}`, present: "yes" });
190004
+ }
190005
+ for (const name of fileNames(run.issueFiles)) {
190006
+ rows.push({ kind: "issues", name, path: name, present: "yes" });
190007
+ }
190008
+ for (const name of fileNames(run.traceFiles)) {
190009
+ rows.push({ kind: "trace", name, path: name, present: "yes" });
189983
190010
  }
189984
- for (const name of fileNames(run.issueFiles))
189985
- rows.push({ kind: "issues", name, present: "yes" });
189986
- for (const name of fileNames(run.traceFiles))
189987
- rows.push({ kind: "trace", name, present: "yes" });
189988
- return rows.sort((a, b2) => `${a.kind}/${a.name}`.localeCompare(`${b2.kind}/${b2.name}`));
190011
+ for (const name of fileNames(run.lockfileFiles)) {
190012
+ rows.push({ kind: "lockfile", name, path: name, present: "yes" });
190013
+ }
190014
+ return rows.sort((a, b2) => a.path.localeCompare(b2.path));
189989
190015
  }
189990
190016
  async function buildAgentFileDiff(agentId, remotePath, localPath, opts) {
189991
190017
  const client = buildClient(opts);
@@ -190120,6 +190146,9 @@ function runFileUrl(side, name) {
190120
190146
  const filename = encodeURIComponent(name);
190121
190147
  return side.kind === "expected" ? `/api/v1/agents/runs/${runId}/expected/${filename}` : `/api/v1/agents/runs/${runId}/files/output/${filename}`;
190122
190148
  }
190149
+ function encodeRunArtifactPath(artifactPath) {
190150
+ return artifactPath.split("/").map(encodeURIComponent).join("/");
190151
+ }
190123
190152
  async function downloadStreamToFile(client, url2, target) {
190124
190153
  await fs.mkdir(path2.dirname(target), { recursive: true });
190125
190154
  const response = await client.getStream(url2);
@@ -190240,6 +190269,12 @@ function renderRunPayload(payload, opts) {
190240
190269
  return printJson(payload);
190241
190270
  success2(`Run ${run.id} is ${run.status}`);
190242
190271
  }
190272
+ function setExitCodeForFailedTerminalRun(payload) {
190273
+ const status = payload.run?.status;
190274
+ if (status === "failed" || status === "cancelled") {
190275
+ process.exitCode = 1;
190276
+ }
190277
+ }
190243
190278
  function renderGeneric(payload, opts, message) {
190244
190279
  if (opts.json)
190245
190280
  return printJson(payload);
@@ -809,12 +809,12 @@ Download run feedback, expected artifacts, files, and metadata.
809
809
 
810
810
  ### Options
811
811
 
812
- | Flag | Required | Default | Description |
813
- | ------------------- | -------- | --------------------- | ------------------------------------------------------------------------------------- |
814
- | `--base-url <url>` | no | | Server base URL |
815
- | `--out <dir>` | no | | Output directory |
816
- | `--include <parts>` | no | `"feedback,expected"` | Comma-separated parts: feedback,expected,files,output,input,metadata,issues,trace,all |
817
- | `--json` | no | | Output a JSON summary of written artifacts |
812
+ | Flag | Required | Default | Description |
813
+ | ------------------- | -------- | --------------------- | ---------------------------------------------------------------------------------------------- |
814
+ | `--base-url <url>` | no | | Server base URL |
815
+ | `--out <dir>` | no | | Output directory |
816
+ | `--include <parts>` | no | `"feedback,expected"` | Comma-separated parts: feedback,expected,files,output,input,metadata,issues,trace,lockfile,all |
817
+ | `--json` | no | | Output a JSON summary of written artifacts |
818
818
 
819
819
  ### `eigenpal agents|agent runs compare|diff [options] <reference-run-id> <run-id>`
820
820
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eigenpal/cli",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
5
5
  "keywords": [
6
6
  "eigenpal",