deepcode-ai 1.1.15 → 1.1.17

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.
package/dist/index.js CHANGED
@@ -4584,6 +4584,7 @@ var SubagentManager = class {
4584
4584
  systemPrompt: task.systemPrompt,
4585
4585
  allowedTools: task.allowedTools,
4586
4586
  disallowedTools: task.disallowedTools,
4587
+ onChunk: this.events ? (text) => this.events.emit("subagent:chunk", { taskId: task.id, text }) : void 0,
4587
4588
  onToolActivity: this.events ? (toolName, active) => this.events.emit("subagent:tool", { taskId: task.id, toolName, active }) : void 0
4588
4589
  });
4589
4590
  this.events?.emit("subagent:complete", { taskId: task.id });
@@ -27590,6 +27591,25 @@ var helpCommand = {
27590
27591
  supportedModes: ["interactive"],
27591
27592
  action: () => helpAction()
27592
27593
  };
27594
+ var undoCommand = {
27595
+ name: "undo",
27596
+ get description() {
27597
+ return t("Undo the last file write or edit made by the agent");
27598
+ },
27599
+ kind: "built-in",
27600
+ supportedModes: ["interactive"],
27601
+ action: async (context) => {
27602
+ const result = await context.ui.undo();
27603
+ if (!result) {
27604
+ return { type: "message", messageType: "info", content: t("Nothing to undo.") };
27605
+ }
27606
+ return {
27607
+ type: "message",
27608
+ messageType: "info",
27609
+ content: `\u21A9 ${t("Restored")}: ${result.path}`
27610
+ };
27611
+ }
27612
+ };
27593
27613
  function sessionNotReady() {
27594
27614
  return {
27595
27615
  type: "message",
@@ -28590,14 +28610,14 @@ var ModelDialog = ({
28590
28610
  }
28591
28611
  );
28592
28612
  };
28593
- function statusIcon(entry) {
28594
- if (entry.status === "done") return "\u2713";
28595
- if (entry.status === "failed") return "\u2717";
28613
+ function statusIcon(e) {
28614
+ if (e.status === "done") return "\u2713";
28615
+ if (e.status === "failed") return "\u2717";
28596
28616
  return "\u2026";
28597
28617
  }
28598
- function statusColor2(entry) {
28599
- if (entry.status === "done") return theme.status.success;
28600
- if (entry.status === "failed") return theme.status.error;
28618
+ function statusColor2(e) {
28619
+ if (e.status === "done") return theme.status.success;
28620
+ if (e.status === "failed") return theme.status.error;
28601
28621
  return theme.text.accent;
28602
28622
  }
28603
28623
  var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
@@ -28616,22 +28636,26 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
28616
28636
  width: Math.min(mainAreaWidth, 80),
28617
28637
  children: [
28618
28638
  /* @__PURE__ */ jsx47(Box38, { paddingX: 1, children: /* @__PURE__ */ jsx47(Text46, { bold: true, color: theme.text.accent, children: title }) }),
28619
- subagents.map((entry) => /* @__PURE__ */ jsxs43(Box38, { flexDirection: "row", paddingX: 1, gap: 1, children: [
28620
- /* @__PURE__ */ jsx47(Text46, { color: statusColor2(entry), children: statusIcon(entry) }),
28621
- /* @__PURE__ */ jsxs43(Box38, { flexDirection: "column", flexShrink: 1, children: [
28639
+ subagents.map((entry) => /* @__PURE__ */ jsxs43(Box38, { flexDirection: "column", paddingX: 1, children: [
28640
+ /* @__PURE__ */ jsxs43(Box38, { flexDirection: "row", gap: 1, children: [
28641
+ /* @__PURE__ */ jsx47(Text46, { color: statusColor2(entry), children: statusIcon(entry) }),
28622
28642
  /* @__PURE__ */ jsxs43(Text46, { wrap: "truncate", color: theme.text.primary, children: [
28623
28643
  entry.prompt,
28624
28644
  entry.prompt.length >= 50 ? "\u2026" : ""
28625
- ] }),
28626
- entry.status === "running" && entry.currentTool && /* @__PURE__ */ jsxs43(Text46, { color: theme.text.secondary, dimColor: true, children: [
28627
- " ",
28628
- "using ",
28629
- entry.currentTool
28630
- ] }),
28631
- entry.status === "failed" && entry.error && /* @__PURE__ */ jsxs43(Text46, { color: theme.status.error, dimColor: true, children: [
28632
- " ",
28633
- entry.error.slice(0, 60)
28634
28645
  ] })
28646
+ ] }),
28647
+ entry.status === "running" && entry.currentTool && /* @__PURE__ */ jsxs43(Text46, { color: theme.text.secondary, dimColor: true, children: [
28648
+ " ",
28649
+ "using ",
28650
+ entry.currentTool
28651
+ ] }),
28652
+ entry.status === "running" && !entry.currentTool && entry.currentOutput && /* @__PURE__ */ jsxs43(Text46, { color: theme.text.secondary, dimColor: true, wrap: "truncate", children: [
28653
+ " ",
28654
+ entry.currentOutput.trimStart()
28655
+ ] }),
28656
+ entry.status === "failed" && entry.error && /* @__PURE__ */ jsxs43(Text46, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
28657
+ " ",
28658
+ entry.error.slice(0, 60)
28635
28659
  ] })
28636
28660
  ] }, entry.taskId))
28637
28661
  ]
@@ -28770,7 +28794,7 @@ async function generateFollowupSuggestion(runtime, session, lastOutput, signal)
28770
28794
  if (!lastOutput.trim()) return null;
28771
28795
  try {
28772
28796
  const provider = runtime.providers.get(session.provider);
28773
- const model = session.model;
28797
+ const model = session.model ?? resolveConfiguredModelForProvider(runtime.config, session.provider);
28774
28798
  if (!model) return null;
28775
28799
  const snippet = lastOutput.trim().slice(-300);
28776
28800
  const prompt = `[Task: suggest ONE concise follow-up question or action the user might ask next, in under 10 words. Return ONLY the suggestion text, no explanation, no quotes, no punctuation at the end.]
@@ -28904,6 +28928,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
28904
28928
  () => [
28905
28929
  helpCommand,
28906
28930
  clearCommand,
28931
+ undoCommand,
28907
28932
  diffCommand,
28908
28933
  providerCommand,
28909
28934
  modelCommand,
@@ -28996,6 +29021,12 @@ var AppContainer = ({ cwd, config, provider, model }) => {
28996
29021
  setSessionProvider
28997
29022
  ]
28998
29023
  );
29024
+ const handleUndo = useCallback23(async () => {
29025
+ const runtime = runtimeRef.current;
29026
+ const session = sessionRef.current;
29027
+ if (!runtime || !session) return null;
29028
+ return runtime.agent.undo(session.id);
29029
+ }, []);
28999
29030
  const commandContext = useMemo15(
29000
29031
  () => ({
29001
29032
  executionMode: "interactive",
@@ -29014,13 +29045,14 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29014
29045
  loadHistory: historyManager.loadHistory,
29015
29046
  toggleVimEnabled: async () => false,
29016
29047
  reloadCommands: () => {
29017
- }
29048
+ },
29049
+ undo: handleUndo
29018
29050
  },
29019
29051
  session: {
29020
29052
  sessionShellAllowlist: sessionShellAllowlistRef.current
29021
29053
  }
29022
29054
  }),
29023
- [configAdapter, historyManager, pendingItem, sessionCommandServices]
29055
+ [configAdapter, handleUndo, historyManager, pendingItem, sessionCommandServices]
29024
29056
  );
29025
29057
  useEffect25(() => {
29026
29058
  messageQueueRef.current = messageQueue;
@@ -29157,6 +29189,18 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29157
29189
  });
29158
29190
  })
29159
29191
  );
29192
+ unsubscribers.push(
29193
+ runtime.events.on("subagent:chunk", ({ taskId, text }) => {
29194
+ setSubagentMap((prev) => {
29195
+ const entry = prev.get(taskId);
29196
+ if (!entry) return prev;
29197
+ const next = new Map(prev);
29198
+ const combined = ((entry.currentOutput ?? "") + text).slice(-80);
29199
+ next.set(taskId, { ...entry, currentOutput: combined });
29200
+ return next;
29201
+ });
29202
+ })
29203
+ );
29160
29204
  unsubscribers.push(
29161
29205
  runtime.events.on("subagent:tool", ({ taskId, toolName, active }) => {
29162
29206
  setSubagentMap((prev) => {