Sign In

@neeter/react

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neeter/react - npm Package Compare versions

Comparing version
0.10.11
to
0.11.0
+2
-0
dist/store.d.ts

@@ -13,2 +13,3 @@ import type { ChatMessage, McpServerStatus, PermissionRequest, SSEEvent } from "@neeter/types";

mcpServers: McpServerStatus[];
checkpoints: string[];
totalCost: number;

@@ -36,2 +37,3 @@ totalTurns: number;

setMcpServers: (servers: McpServerStatus[]) => void;
addCheckpoint: (uuid: string) => void;
addCost: (cost: number, turns: number) => void;

@@ -38,0 +40,0 @@ cancelInflightToolCalls: () => void;

@@ -30,2 +30,3 @@ import { immer } from "zustand/middleware/immer";

mcpServers: [],
checkpoints: [],
totalCost: 0,

@@ -146,2 +147,5 @@ totalTurns: 0,

}),
addCheckpoint: (uuid) => set((s) => {
s.checkpoints.push(uuid);
}),
addCost: (cost, turns) => set((s) => {

@@ -175,2 +179,3 @@ s.totalCost += cost;

s.mcpServers = [];
s.checkpoints = [];
s.totalCost = 0;

@@ -223,2 +228,5 @@ s.totalTurns = 0;

break;
case "checkpoint":
s.addCheckpoint(data.userMessageUuid);
break;
case "turn_complete":

@@ -225,0 +233,0 @@ s.flushStreamingThinking();

+4
-1

@@ -1,2 +0,2 @@

import type { CustomEvent, PermissionResponse, SessionHistoryEntry } from "@neeter/types";
import type { CustomEvent, PermissionResponse, RewindFilesResult, SessionHistoryEntry } from "@neeter/types";
import { type ChatStore } from "./store.js";

@@ -19,2 +19,5 @@ export interface UseAgentConfig {

}) => Promise<void>;
rewindSession: (checkpointId: string, options?: {
dryRun?: boolean;
}) => Promise<RewindFilesResult>;
newSession: () => Promise<void>;

@@ -21,0 +24,0 @@ refreshHistory: () => Promise<void>;

@@ -153,2 +153,6 @@ import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from "react";

});
es.addEventListener("checkpoint", (e) => {
const { userMessageUuid } = JSON.parse(e.data);
store.getState().addCheckpoint(userMessageUuid);
});
if (onCustomEvent) {

@@ -234,2 +238,12 @@ es.addEventListener("custom", (e) => {

}, [endpoint]);
const rewindSession = useCallback(async (checkpointId, options) => {
if (!sessionId)
return { canRewind: false, error: "No active session" };
const res = await fetch(`${endpoint}/sessions/${sessionId}/rewind`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ userMessageId: checkpointId, dryRun: options?.dryRun }),
});
return res.json();
}, [sessionId, endpoint]);
const newSession = useCallback(async () => {

@@ -253,2 +267,3 @@ if (eventSourceRef.current) {

resumeSession,
rewindSession,
newSession,

@@ -255,0 +270,0 @@ refreshHistory,

{
"name": "@neeter/react",
"version": "0.10.11",
"version": "0.11.0",
"description": "React components and hooks for building chat UIs on top of the Claude Agent SDK",

@@ -29,3 +29,3 @@ "license": "MIT",

"tailwind-merge": "^3.5.0",
"@neeter/types": "0.10.11"
"@neeter/types": "0.11.0"
},

@@ -32,0 +32,0 @@ "peerDependencies": {