deepcode-ai 1.1.16 → 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
@@ -27591,6 +27591,25 @@ var helpCommand = {
27591
27591
  supportedModes: ["interactive"],
27592
27592
  action: () => helpAction()
27593
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
+ };
27594
27613
  function sessionNotReady() {
27595
27614
  return {
27596
27615
  type: "message",
@@ -28909,6 +28928,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
28909
28928
  () => [
28910
28929
  helpCommand,
28911
28930
  clearCommand,
28931
+ undoCommand,
28912
28932
  diffCommand,
28913
28933
  providerCommand,
28914
28934
  modelCommand,
@@ -29001,6 +29021,12 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29001
29021
  setSessionProvider
29002
29022
  ]
29003
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
+ }, []);
29004
29030
  const commandContext = useMemo15(
29005
29031
  () => ({
29006
29032
  executionMode: "interactive",
@@ -29019,13 +29045,14 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29019
29045
  loadHistory: historyManager.loadHistory,
29020
29046
  toggleVimEnabled: async () => false,
29021
29047
  reloadCommands: () => {
29022
- }
29048
+ },
29049
+ undo: handleUndo
29023
29050
  },
29024
29051
  session: {
29025
29052
  sessionShellAllowlist: sessionShellAllowlistRef.current
29026
29053
  }
29027
29054
  }),
29028
- [configAdapter, historyManager, pendingItem, sessionCommandServices]
29055
+ [configAdapter, handleUndo, historyManager, pendingItem, sessionCommandServices]
29029
29056
  );
29030
29057
  useEffect25(() => {
29031
29058
  messageQueueRef.current = messageQueue;