pi-fabric 0.58.0 → 0.58.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.
@@ -946,6 +946,15 @@ function pushArcItem(lines, item) {
946
946
  import { readFileSync as readFileSync2, statSync as statSync2 } from "node:fs";
947
947
  import { homedir } from "node:os";
948
948
  import { basename as basename2, extname as extname2, isAbsolute, relative, resolve } from "node:path";
949
+
950
+ // src/ui/tool-call-timing.ts
951
+ var formatToolCallDuration = (startedAt, endedAt) => {
952
+ if (startedAt === void 0 || endedAt === void 0) return void 0;
953
+ const durationMs = Math.max(0, endedAt - startedAt);
954
+ return durationMs < 1e3 ? `${durationMs}ms` : `${(durationMs / 1e3).toFixed(1)}s`;
955
+ };
956
+
957
+ // src/ui/core-tool-render.ts
949
958
  import { diffLines } from "diff";
950
959
  import { bundledLanguages as bundledLanguages2 } from "shiki/langs";
951
960
 
@@ -3881,8 +3890,7 @@ var coreToolTitle = (audit, theme, options) => {
3881
3890
  observePiTheme(theme);
3882
3891
  if (!coreToolRendererEnabled(audit, options.settings) || !audit.tool) return null;
3883
3892
  const title = theme.fg("toolTitle", theme.bold(audit.tool));
3884
- const durationMs = options.settings.toolCallTiming && audit.startedAt !== void 0 && audit.endedAt !== void 0 ? Math.max(0, audit.endedAt - audit.startedAt) : void 0;
3885
- const timing = durationMs !== void 0 ? durationMs < 1e3 ? `${durationMs}ms` : `${(durationMs / 1e3).toFixed(1)}s` : void 0;
3893
+ const timing = options.settings.toolCallTiming ? formatToolCallDuration(audit.startedAt, audit.endedAt) : void 0;
3886
3894
  const filePath = argString(audit, "path") ?? "";
3887
3895
  if (audit.tool === "bash") {
3888
3896
  const command = bashCommand(audit);
@@ -4404,6 +4412,8 @@ function nestedCallTitle(audit, theme, invalidate, core) {
4404
4412
  var nestedCallTitleText = (audit, theme, invalidate, core) => {
4405
4413
  const coreTitle = core ? coreToolTitle(audit, theme, { ...core, ...invalidate ? { invalidate } : {} }) : null;
4406
4414
  if (coreTitle) return coreTitle;
4415
+ const timing = core?.settings.toolCallTiming ? formatToolCallDuration(audit.startedAt, audit.endedAt) : void 0;
4416
+ const withTiming = (value) => timing ? `${value}${theme.fg("dim", ` \xB7 ${timing}`)}` : value;
4407
4417
  const ref = audit.ref;
4408
4418
  const provider = audit.provider ?? ref.split(".")[0] ?? ref;
4409
4419
  const tool = audit.tool ?? ref.split(".")[1] ?? ref;
@@ -4417,13 +4427,13 @@ var nestedCallTitleText = (audit, theme, invalidate, core) => {
4417
4427
  audit.preview,
4418
4428
  audit.previewHeadline
4419
4429
  );
4420
- if (providerDetail) return `${title} ${theme.fg("accent", providerDetail)}`;
4430
+ if (providerDetail) return withTiming(`${title} ${theme.fg("accent", providerDetail)}`);
4421
4431
  const command = argString2(args, "command");
4422
4432
  if (command) {
4423
4433
  const firstLine = command.split("\n")[0] ?? "";
4424
4434
  const highlighted = firstLine.length > 0 ? highlightCode(firstLine, "bash", invalidate) : null;
4425
4435
  const cmd = highlighted && highlighted[0] ? highlighted[0] : theme.fg("accent", firstLine);
4426
- return `${title} ${theme.fg("dim", "$")} ${cmd}`;
4436
+ return withTiming(`${title} ${theme.fg("dim", "$")} ${cmd}`);
4427
4437
  }
4428
4438
  const path = argString2(args, "path");
4429
4439
  const pattern = argString2(args, "pattern");
@@ -4435,7 +4445,7 @@ var nestedCallTitleText = (audit, theme, invalidate, core) => {
4435
4445
  else {
4436
4446
  detail = headlineArg(args) || structuralCallDetail(provider, tool, args, audit.result) || audit.previewHeadline || "";
4437
4447
  }
4438
- return detail ? `${title} ${theme.fg("accent", detail)}` : title;
4448
+ return withTiming(detail ? `${title} ${theme.fg("accent", detail)}` : title);
4439
4449
  };
4440
4450
  var transcriptToolAudit = (entry) => {
4441
4451
  const rawName = entry.toolName ?? entry.label;
@@ -4950,4 +4960,4 @@ export {
4950
4960
  isActiveStatus,
4951
4961
  orderAgentsByCreation
4952
4962
  };
4953
- //# sourceMappingURL=chunk-IPOARFXT.js.map
4963
+ //# sourceMappingURL=chunk-UIQ5EWRL.js.map