@rozenite/network-activity-plugin 1.7.0 → 1.8.1
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/CHANGELOG.md +32 -0
- package/README.md +24 -0
- package/dist/devtools/App.html +2 -2
- package/dist/devtools/assets/{App-pokLiGYV.js → App-B3xlUjs6.js} +163 -115
- package/dist/devtools/assets/{App-BrSkOkws.css → App-m6xge0az.css} +13 -0
- package/dist/react-native/chunks/boot-recording.cjs +307 -28
- package/dist/react-native/chunks/boot-recording.js +310 -31
- package/dist/react-native/chunks/useNetworkActivityDevTools.require.cjs +192 -141
- package/dist/react-native/chunks/useNetworkActivityDevTools.require.js +193 -142
- package/dist/react-native/index.d.ts +24 -7
- package/dist/rozenite.json +1 -1
- package/dist/sdk/index.cjs +127 -0
- package/dist/sdk/index.d.ts +1243 -0
- package/dist/sdk/index.js +127 -0
- package/package.json +17 -6
- package/sdk.ts +59 -0
- package/src/react-native/__tests__/events-listener.test.ts +35 -0
- package/src/react-native/agent/__tests__/network-activity-agent-state.test.ts +21 -9
- package/src/react-native/agent/state.ts +13 -13
- package/src/react-native/agent/tools.ts +20 -146
- package/src/react-native/agent/use-network-activity-agent-tools.ts +73 -64
- package/src/react-native/events-listener.ts +12 -3
- package/src/react-native/http/http-inspector.ts +19 -5
- package/src/react-native/network-inspector.ts +46 -8
- package/src/react-native/nitro-fetch/__tests__/nitro-network-inspector.test.ts +198 -0
- package/src/react-native/nitro-fetch/nitro-network-inspector.ts +403 -0
- package/src/react-native/useHttpInspector.ts +9 -19
- package/src/react-native/useNetworkActivityDevTools.ts +13 -1
- package/src/react-native/websocket/__tests__/websocket-inspector.test.ts +69 -0
- package/src/react-native/websocket/websocket-inspector.ts +32 -17
- package/src/shared/agent-tools.ts +230 -0
- package/src/shared/client.ts +3 -0
- package/src/shared/http-events.ts +6 -0
- package/src/shared/websocket-events.ts +16 -7
- package/src/ui/components/RequestList.tsx +21 -0
- package/src/ui/components/SidePanel.tsx +12 -9
- package/src/ui/state/derived.ts +4 -0
- package/src/ui/state/model.ts +6 -1
- package/src/ui/state/store.ts +52 -36
- package/src/ui/tabs/HeadersTab.tsx +18 -4
- package/src/ui/tabs/ResponseTab.tsx +5 -3
- package/tsconfig.json +4 -1
- package/vite.config.ts +7 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const agentShared = require("@rozenite/agent-shared");
|
|
4
|
+
const NETWORK_ACTIVITY_AGENT_PLUGIN_ID = "@rozenite/network-activity-plugin";
|
|
5
|
+
const networkActivityToolDefinitions = {
|
|
6
|
+
startRecording: agentShared.defineAgentToolContract({
|
|
7
|
+
name: "startRecording",
|
|
8
|
+
description: "Start recording network activity in the fallback network activity plugin.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {}
|
|
12
|
+
}
|
|
13
|
+
}),
|
|
14
|
+
stopRecording: agentShared.defineAgentToolContract({
|
|
15
|
+
name: "stopRecording",
|
|
16
|
+
description: "Stop recording network activity without clearing the captured plugin buffer.",
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {}
|
|
20
|
+
}
|
|
21
|
+
}),
|
|
22
|
+
getRecordingStatus: agentShared.defineAgentToolContract({
|
|
23
|
+
name: "getRecordingStatus",
|
|
24
|
+
description: "Return network activity plugin recording state and buffer metadata.",
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: "object",
|
|
27
|
+
properties: {}
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
listRequests: agentShared.defineAgentToolContract({
|
|
31
|
+
name: "listRequests",
|
|
32
|
+
description: "List captured HTTP request summaries with cursor pagination from the fallback plugin.",
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: "object",
|
|
35
|
+
properties: {
|
|
36
|
+
limit: {
|
|
37
|
+
type: "number",
|
|
38
|
+
description: "Maximum number of requests to return. Defaults to 20."
|
|
39
|
+
},
|
|
40
|
+
cursor: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Opaque pagination cursor from a previous listRequests call."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
getRequestDetails: agentShared.defineAgentToolContract({
|
|
48
|
+
name: "getRequestDetails",
|
|
49
|
+
description: "Return detailed metadata for a captured HTTP request without fetching response body.",
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
requestId: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Captured plugin request ID to inspect."
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
required: ["requestId"]
|
|
59
|
+
}
|
|
60
|
+
}),
|
|
61
|
+
getRequestBody: agentShared.defineAgentToolContract({
|
|
62
|
+
name: "getRequestBody",
|
|
63
|
+
description: "Return the captured request body for a plugin-recorded HTTP request when available.",
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: "object",
|
|
66
|
+
properties: {
|
|
67
|
+
requestId: {
|
|
68
|
+
type: "string",
|
|
69
|
+
description: "Captured plugin request ID to inspect."
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
required: ["requestId"]
|
|
73
|
+
}
|
|
74
|
+
}),
|
|
75
|
+
getResponseBody: agentShared.defineAgentToolContract({
|
|
76
|
+
name: "getResponseBody",
|
|
77
|
+
description: "Return the captured response body for a plugin-recorded HTTP request when available.",
|
|
78
|
+
inputSchema: {
|
|
79
|
+
type: "object",
|
|
80
|
+
properties: {
|
|
81
|
+
requestId: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "Captured plugin request ID to inspect."
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
required: ["requestId"]
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
listRealtimeConnections: agentShared.defineAgentToolContract({
|
|
90
|
+
name: "listRealtimeConnections",
|
|
91
|
+
description: "List captured WebSocket and SSE connections with cursor pagination.",
|
|
92
|
+
inputSchema: {
|
|
93
|
+
type: "object",
|
|
94
|
+
properties: {
|
|
95
|
+
limit: {
|
|
96
|
+
type: "number",
|
|
97
|
+
description: "Maximum number of realtime connections to return. Defaults to 20."
|
|
98
|
+
},
|
|
99
|
+
cursor: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Opaque pagination cursor from a previous listRealtimeConnections call."
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}),
|
|
106
|
+
getRealtimeConnectionDetails: agentShared.defineAgentToolContract({
|
|
107
|
+
name: "getRealtimeConnectionDetails",
|
|
108
|
+
description: "Return details for a captured WebSocket or SSE connection, including recent messages.",
|
|
109
|
+
inputSchema: {
|
|
110
|
+
type: "object",
|
|
111
|
+
properties: {
|
|
112
|
+
requestId: {
|
|
113
|
+
type: "string",
|
|
114
|
+
description: "Captured realtime request ID to inspect."
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
required: ["requestId"]
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
};
|
|
121
|
+
const networkActivityTools = agentShared.defineAgentToolDescriptors(
|
|
122
|
+
NETWORK_ACTIVITY_AGENT_PLUGIN_ID,
|
|
123
|
+
networkActivityToolDefinitions
|
|
124
|
+
);
|
|
125
|
+
exports.NETWORK_ACTIVITY_AGENT_PLUGIN_ID = NETWORK_ACTIVITY_AGENT_PLUGIN_ID;
|
|
126
|
+
exports.networkActivityToolDefinitions = networkActivityToolDefinitions;
|
|
127
|
+
exports.networkActivityTools = networkActivityTools;
|