omp-fabric 1.27.0 → 1.27.2

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.
@@ -1,3 +1,4 @@
1
1
  import type { FabricExecutionTraceV1 } from "./audit/trace.js";
2
- export declare const formatFailureProgress: (trace: FabricExecutionTraceV1) => string | undefined;
2
+ import type { CompletedOutput } from "./completed-outputs.js";
3
+ export declare const formatFailureProgress: (trace: FabricExecutionTraceV1, outputs?: readonly CompletedOutput[]) => string | undefined;
3
4
  //# sourceMappingURL=failure-progress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"failure-progress.d.ts","sourceRoot":"","sources":["../src/failure-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAW/D,eAAO,MAAM,qBAAqB,GAChC,OAAO,sBAAsB,KAC5B,MAAM,GAAG,SAmBX,CAAC"}
1
+ {"version":3,"file":"failure-progress.d.ts","sourceRoot":"","sources":["../src/failure-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAsB9D,eAAO,MAAM,qBAAqB,GAChC,OAAO,sBAAsB,EAC7B,UAAS,SAAS,eAAe,EAAO,KACvC,MAAM,GAAG,SAqBX,CAAC"}
package/dist/index.js CHANGED
@@ -2648,7 +2648,18 @@ var compactPath = (value) => {
2648
2648
  if (singleLine.length <= MAX_PATH_CHARS) return singleLine;
2649
2649
  return `\u2026${singleLine.slice(-(MAX_PATH_CHARS - 1))}`;
2650
2650
  };
2651
- var formatFailureProgress = (trace) => {
2651
+ var formatOutputs = (outputs) => {
2652
+ const blocks = outputs.map((output, index) => {
2653
+ const target = output.target === void 0 ? "" : ` ${output.target}`;
2654
+ return `[${index + 1}] ${output.ref}${target} (${output.chars} chars)
2655
+ ${output.preview}`;
2656
+ });
2657
+ return [
2658
+ `Output of the last ${outputs.length} completed ${outputs.length === 1 ? "call" : "calls"}, cut to fit; call again only for what was cut:`,
2659
+ ...blocks
2660
+ ].join("\n");
2661
+ };
2662
+ var formatFailureProgress = (trace, outputs = []) => {
2652
2663
  if (trace.outcome === "succeeded") return void 0;
2653
2664
  const completed = trace.operations.filter(
2654
2665
  (operation) => operation.outcome === "succeeded"
@@ -2659,9 +2670,11 @@ var formatFailureProgress = (trace) => {
2659
2670
  return typeof path10 === "string" ? `${operation.ref}(${compactPath(path10)})` : operation.ref;
2660
2671
  });
2661
2672
  const omitted = completed.length - summaries.length;
2673
+ const returned = outputs.length > 0 ? "outputs of the last calls follow" : "outputs not returned";
2662
2674
  return [
2663
- `Completed before the outer failure (outputs not returned): ${summaries.join("; ")}${omitted > 0 ? `; +${omitted} more` : ""}.`,
2664
- "Successful calls may already have changed the workspace; inspect before repeating mutations."
2675
+ `Completed before the outer failure (${returned}): ${summaries.join("; ")}${omitted > 0 ? `; +${omitted} more` : ""}.`,
2676
+ "Successful calls may already have changed the workspace; inspect before repeating mutations.",
2677
+ ...outputs.length > 0 ? [formatOutputs(outputs)] : []
2665
2678
  ].join("\n");
2666
2679
  };
2667
2680
 
@@ -3730,7 +3743,7 @@ ${preview}` : ""}${hiddenHint}`,
3730
3743
  );
3731
3744
  }
3732
3745
  const fullFormattedValue = formatFabricValue(result.value, selectedResultFormat);
3733
- const failureProgress = formatFailureProgress(result.trace);
3746
+ const failureProgress = formatFailureProgress(result.trace, result.completedOutputs);
3734
3747
  const fullSections = [...result.logs];
3735
3748
  if (fullFormattedValue.text) fullSections.push(fullFormattedValue.text);
3736
3749
  if (result.error) fullSections.push(`Runtime error: ${result.error}`);