@ottocode/web-sdk 0.1.236 → 0.1.237

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.
@@ -384,6 +384,8 @@ import { Shield, Check, X as X2, Terminal, FileEdit, GitCommit } from "lucide-re
384
384
  import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
385
385
  var TOOL_ICONS = {
386
386
  bash: Terminal,
387
+ edit: FileEdit,
388
+ multiedit: FileEdit,
387
389
  write: FileEdit,
388
390
  apply_patch: FileEdit,
389
391
  terminal: Terminal,
@@ -6456,6 +6458,8 @@ function normalizeToolTarget(toolName, args) {
6456
6458
  return null;
6457
6459
  const keyMap = {
6458
6460
  read: ["path"],
6461
+ edit: ["path"],
6462
+ multiedit: ["path"],
6459
6463
  write: ["path"],
6460
6464
  apply_patch: ["path"],
6461
6465
  glob: ["pattern"],
@@ -6563,6 +6567,12 @@ var ToolApprovalCard = memo6(function ToolApprovalCard2({
6563
6567
  })
6564
6568
  });
6565
6569
  }
6570
+ if ((toolName === "edit" || toolName === "multiedit") && (primary?.value || filePath)) {
6571
+ return /* @__PURE__ */ jsx23("div", {
6572
+ className: "ml-6 text-xs text-muted-foreground",
6573
+ children: toolName === "multiedit" ? "Multiple exact replacements will be applied atomically." : "An exact text replacement will be applied to this file."
6574
+ });
6575
+ }
6566
6576
  if (toolName === "bash" && args?.cmd) {
6567
6577
  const cmd = String(args.cmd);
6568
6578
  return /* @__PURE__ */ jsx23("div", {
@@ -7757,7 +7767,8 @@ function ApplyPatchRenderer({
7757
7767
  contentJson,
7758
7768
  toolDurationMs,
7759
7769
  isExpanded,
7760
- onToggle
7770
+ onToggle,
7771
+ toolName
7761
7772
  }) {
7762
7773
  const artifact = contentJson.artifact;
7763
7774
  const timeStr = formatDuration(toolDurationMs);
@@ -7783,7 +7794,9 @@ function ApplyPatchRenderer({
7783
7794
  const deletions = Number(summary.deletions || 0);
7784
7795
  const patch = artifact?.patch ? String(artifact.patch) : "";
7785
7796
  const changes = Array.isArray(contentJson.result?.changes) ? contentJson.result?.changes : [];
7786
- const singleFilePath = files === 1 && changes.length > 0 ? changes[0].filePath : null;
7797
+ const rendererToolName = toolName || contentJson.name || "apply_patch";
7798
+ const titleLabel = rendererToolName.replace(/_/g, " ");
7799
+ const singleFilePath = files === 1 ? changes[0]?.filePath || (typeof contentJson.result?.path === "string" ? contentJson.result.path : typeof contentJson.args?.path === "string" ? contentJson.args.path : null) : null;
7787
7800
  const hasError = contentJson.error || contentJson.result && "ok" in contentJson.result && contentJson.result.ok === false;
7788
7801
  const errorMessage = typeof contentJson.error === "string" ? contentJson.error : contentJson.result && ("error" in contentJson.result) && typeof contentJson.result.error === "string" ? contentJson.result.error : null;
7789
7802
  const errorStack = contentJson.result && typeof contentJson.result === "object" && "stack" in contentJson.result && typeof contentJson.result.stack === "string" ? contentJson.result.stack : undefined;
@@ -7801,7 +7814,7 @@ function ApplyPatchRenderer({
7801
7814
  /* @__PURE__ */ jsxs28("span", {
7802
7815
  className: "font-medium flex-shrink-0",
7803
7816
  children: [
7804
- "apply patch",
7817
+ titleLabel,
7805
7818
  hasError ? " error" : ""
7806
7819
  ]
7807
7820
  }),
@@ -10562,6 +10575,8 @@ function ReasoningRenderer({ part }) {
10562
10575
  import { jsx as jsx52 } from "react/jsx-runtime";
10563
10576
  var TOOL_NAME_ALIASES = {
10564
10577
  Read: "read",
10578
+ Edit: "edit",
10579
+ MultiEdit: "multiedit",
10565
10580
  Write: "write",
10566
10581
  Ls: "ls",
10567
10582
  Tree: "tree",
@@ -10588,6 +10603,8 @@ function normalizeToolName(name) {
10588
10603
  }
10589
10604
  var COMPACT_DETAIL_TOOL_NAMES = new Set([
10590
10605
  "bash",
10606
+ "edit",
10607
+ "multiedit",
10591
10608
  "write",
10592
10609
  "apply_patch",
10593
10610
  "terminal"
@@ -10625,6 +10642,12 @@ function ToolResultRenderer({
10625
10642
  return /* @__PURE__ */ jsx52(ReadRenderer, {
10626
10643
  ...props
10627
10644
  });
10645
+ case "edit":
10646
+ case "multiedit":
10647
+ return /* @__PURE__ */ jsx52(ApplyPatchRenderer, {
10648
+ ...props,
10649
+ toolName: normalizedName
10650
+ });
10628
10651
  case "write":
10629
10652
  return /* @__PURE__ */ jsx52(WriteRenderer, {
10630
10653
  ...props
@@ -12501,7 +12524,14 @@ var AssistantMessageGroup = memo8(function AssistantMessageGroup2({
12501
12524
  const hasFinish = parts.some((part) => part.toolName === "finish");
12502
12525
  const latestProgressUpdateIndex = parts.reduce((lastIndex, part, index) => part.type === "tool_result" && part.toolName === "progress_update" ? index : lastIndex, -1);
12503
12526
  const latestProgressUpdatePart = latestProgressUpdateIndex >= 0 ? parts[latestProgressUpdateIndex] : null;
12504
- const liveActionToolCallIds = new Set(parts.filter((part) => part.ephemeral && ["bash", "write", "apply_patch", "terminal"].includes(part.toolName || "")).map((part) => part.toolCallId).filter((callId) => Boolean(callId)));
12527
+ const liveActionToolCallIds = new Set(parts.filter((part) => part.ephemeral && [
12528
+ "bash",
12529
+ "edit",
12530
+ "multiedit",
12531
+ "write",
12532
+ "apply_patch",
12533
+ "terminal"
12534
+ ].includes(part.toolName || "")).map((part) => part.toolCallId).filter((callId) => Boolean(callId)));
12505
12535
  const renderItems = useMemo10(() => {
12506
12536
  const items = [];
12507
12537
  let compactBuffer = [];
@@ -12694,7 +12724,14 @@ var AssistantMessageGroup = memo8(function AssistantMessageGroup2({
12694
12724
  }
12695
12725
  const { part, index } = item;
12696
12726
  const isLastPart = index === parts.length - 1;
12697
- const isActionTool = part.ephemeral && (part.type === "tool_call" || part.type === "tool_result") && ["bash", "write", "apply_patch", "terminal"].includes(part.toolName || "");
12727
+ const isActionTool = part.ephemeral && (part.type === "tool_call" || part.type === "tool_result") && [
12728
+ "bash",
12729
+ "edit",
12730
+ "multiedit",
12731
+ "write",
12732
+ "apply_patch",
12733
+ "terminal"
12734
+ ].includes(part.toolName || "");
12698
12735
  if (isActionTool) {
12699
12736
  return /* @__PURE__ */ jsx57(ActionToolBox, {
12700
12737
  part,
@@ -26029,4 +26066,4 @@ export {
26029
26066
  AssistantMessageGroup
26030
26067
  };
26031
26068
 
26032
- //# debugId=879A40F29DA5272A64756E2164756E21
26069
+ //# debugId=CFF56E418DA6B78F64756E2164756E21