agent-trace 0.2.11 → 0.2.12

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.
Files changed (2) hide show
  1. package/agent-trace.cjs +18 -4
  2. package/package.json +1 -1
package/agent-trace.cjs CHANGED
@@ -29525,9 +29525,23 @@ function parseCommitMessage2(command) {
29525
29525
  }
29526
29526
  return message;
29527
29527
  }
29528
- function extractPrUrl(payload) {
29528
+ function pickToolOutput(payload) {
29529
29529
  const record = payload;
29530
- const output = readString5(record, "tool_response") ?? readString5(record, "toolResponse") ?? readString5(record, "stdout") ?? readString5(record, "output");
29530
+ const toolResponse = record["tool_response"] ?? record["toolResponse"];
29531
+ if (typeof toolResponse === "string" && toolResponse.length > 0) {
29532
+ return toolResponse;
29533
+ }
29534
+ if (typeof toolResponse === "object" && toolResponse !== null && !Array.isArray(toolResponse)) {
29535
+ const nested = toolResponse;
29536
+ const stdout = nested["stdout"];
29537
+ if (typeof stdout === "string" && stdout.length > 0) {
29538
+ return stdout;
29539
+ }
29540
+ }
29541
+ return readString5(record, "stdout") ?? readString5(record, "output");
29542
+ }
29543
+ function extractPrUrl(payload) {
29544
+ const output = pickToolOutput(payload);
29531
29545
  const command = pickCommand2(payload);
29532
29546
  const combined = [command, output].filter((s) => s !== void 0).join("\n");
29533
29547
  if (combined.length === 0) return void 0;
@@ -29539,7 +29553,7 @@ function extractPrState(payload) {
29539
29553
  const record = payload;
29540
29554
  const explicit = readString5(record, "pr_state") ?? readString5(record, "prState");
29541
29555
  if (explicit !== void 0) return explicit;
29542
- const output = readString5(record, "tool_response") ?? readString5(record, "toolResponse") ?? readString5(record, "stdout") ?? readString5(record, "output");
29556
+ const output = pickToolOutput(payload);
29543
29557
  const command = pickCommand2(payload);
29544
29558
  const combined = [command, output].filter((s) => s !== void 0).join("\n");
29545
29559
  if (combined.length === 0) return void 0;
@@ -29564,7 +29578,7 @@ function extractPrMergedAt(payload) {
29564
29578
  const record = payload;
29565
29579
  const explicit = readString5(record, "pr_merged_at") ?? readString5(record, "prMergedAt");
29566
29580
  if (explicit !== void 0) return explicit;
29567
- const output = readString5(record, "tool_response") ?? readString5(record, "toolResponse") ?? readString5(record, "stdout") ?? readString5(record, "output");
29581
+ const output = pickToolOutput(payload);
29568
29582
  if (output === void 0) return void 0;
29569
29583
  const match = output.match(/"mergedAt"\s*:\s*"([^"]+)"/);
29570
29584
  return match?.[1] ?? void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-trace",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Self-hosted observability for AI coding agents. One command, zero config.",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {