@todoforai/cli 0.1.45 → 0.1.46

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.
@@ -44449,7 +44449,7 @@ import { parseArgs } from "util";
44449
44449
  // package.json
44450
44450
  var package_default = {
44451
44451
  name: "@todoforai/cli",
44452
- version: "0.1.45",
44452
+ version: "0.1.46",
44453
44453
  type: "module",
44454
44454
  bin: {
44455
44455
  "todoforai-cli": "bin/todoforai-cli.js",
@@ -52929,13 +52929,18 @@ var log2 = (...a) => process.stderr.write(`[acp] ${a.join(" ")}
52929
52929
  var ACP_KIND = { create: "edit", edit: "edit", read: "read", search: "search", shell: "execute" };
52930
52930
  var toolTitle = (info) => {
52931
52931
  const target = info.path || info.filePath || info.cmd || info.name || info.url || info.query || "";
52932
- return target ? `${info.block_type || "tool"}: ${String(target).slice(0, 120)}` : info.block_type || "tool";
52932
+ if (target)
52933
+ return `${info.block_type || "tool"}: ${String(target).split(`
52934
+ `)[0].slice(0, 120)}`;
52935
+ return info.title || info.block_type || "tool";
52933
52936
  };
52934
52937
 
52935
52938
  class BlockView {
52936
52939
  info = {};
52937
52940
  announced = false;
52938
52941
  permissionAsked = false;
52942
+ title = "";
52943
+ kind = "other";
52939
52944
  output = "";
52940
52945
  content() {
52941
52946
  const c3 = [];
@@ -53080,11 +53085,18 @@ ${b.resource.text}
53080
53085
  const blocks4 = new Map;
53081
53086
  const view = (id) => blocks4.get(id) ?? blocks4.set(id, new BlockView).get(id);
53082
53087
  const announce = (id, b) => {
53083
- if (b.announced)
53088
+ if (b.info.block_type === "text")
53084
53089
  return;
53085
- b.announced = true;
53090
+ const title = toolTitle(b.info), kind = ACP_KIND[classifyBlock2(b.info)] ?? "other";
53086
53091
  const path4 = b.info.path || b.info.filePath;
53087
- update({ sessionUpdate: "tool_call", toolCallId: id, title: toolTitle(b.info), kind: ACP_KIND[classifyBlock2(b.info)] ?? "other", status: "pending", locations: path4 ? [{ path: path4 }] : [], rawInput: { block_type: b.info.block_type, cmd: b.info.cmd, path: path4, changes: b.info.changes } });
53092
+ if (!b.announced) {
53093
+ b.announced = true;
53094
+ update({ sessionUpdate: "tool_call", toolCallId: id, title, kind, status: "pending", locations: path4 ? [{ path: path4 }] : [], rawInput: { block_type: b.info.block_type, cmd: b.info.cmd, path: path4, changes: b.info.changes } });
53095
+ } else if (title !== b.title || kind !== b.kind) {
53096
+ update({ sessionUpdate: "tool_call_update", toolCallId: id, title, kind, ...path4 && { locations: [{ path: path4 }] } });
53097
+ }
53098
+ b.title = title;
53099
+ b.kind = kind;
53088
53100
  };
53089
53101
  const askPermission = async (id, b, messageId) => {
53090
53102
  if (b.permissionAsked || turn.done)
@@ -53120,6 +53132,7 @@ ${b.resource.text}
53120
53132
  const b = view(id);
53121
53133
  if (type.startsWith("block:start_")) {
53122
53134
  b.info = { ...b.info, ...payload };
53135
+ announce(id, b);
53123
53136
  return;
53124
53137
  }
53125
53138
  if (type === "block:sh_msg_result") {
@@ -53137,8 +53150,10 @@ ${b.resource.text}
53137
53150
  return;
53138
53151
  const u = payload.updates || {};
53139
53152
  b.info = { ...b.info, ...u };
53140
- announce(id, b);
53141
53153
  const st = u.status;
53154
+ if (!b.info.block_type && !st)
53155
+ return;
53156
+ announce(id, b);
53142
53157
  const status = st === "RUNNING" ? "in_progress" : st === "COMPLETED" ? "completed" : ["DENIED", "FAILED", "ERROR"].includes(st) ? "failed" : undefined;
53143
53158
  const contentChanged = u.originalContent !== undefined || u.modifiedContent !== undefined;
53144
53159
  if (status || contentChanged || u.result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todoforai/cli",
3
- "version": "0.1.45",
3
+ "version": "0.1.46",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "todoforai-cli": "bin/todoforai-cli.js",