@nextclaw/ncp-react 0.3.2 → 0.3.3
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 +0 -11
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -55,13 +55,6 @@ function normalizeSendEnvelope(input, sessionId) {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
function toHydrationPayload(sessionId, snapshot) {
|
|
59
|
-
return {
|
|
60
|
-
sessionId,
|
|
61
|
-
messages: snapshot.messages,
|
|
62
|
-
activeRun: snapshot.activeRun
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
58
|
function useScopedAgentManager(sessionId) {
|
|
66
59
|
const managerRef = useRef();
|
|
67
60
|
if (!managerRef.current || managerRef.current.sessionId !== sessionId) {
|
|
@@ -110,7 +103,6 @@ function useNcpAgentRuntime({
|
|
|
110
103
|
return;
|
|
111
104
|
}
|
|
112
105
|
setIsSending(true);
|
|
113
|
-
const previousSnapshot = manager.getSnapshot();
|
|
114
106
|
await manager.dispatch({
|
|
115
107
|
type: NcpEventType.MessageSent,
|
|
116
108
|
payload: {
|
|
@@ -121,9 +113,6 @@ function useNcpAgentRuntime({
|
|
|
121
113
|
});
|
|
122
114
|
try {
|
|
123
115
|
await client.send(envelope);
|
|
124
|
-
} catch (error) {
|
|
125
|
-
manager.hydrate(toHydrationPayload(sessionId, previousSnapshot));
|
|
126
|
-
throw error;
|
|
127
116
|
} finally {
|
|
128
117
|
setIsSending(false);
|
|
129
118
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/ncp-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "React bindings for building NCP-based agent applications.",
|
|
6
6
|
"type": "module",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@nextclaw/ncp": "0.3.
|
|
19
|
-
"@nextclaw/ncp-toolkit": "0.4.
|
|
18
|
+
"@nextclaw/ncp": "0.3.2",
|
|
19
|
+
"@nextclaw/ncp-toolkit": "0.4.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"react": "^18.0.0 || ^19.0.0"
|