@agentified/react 0.0.2 → 0.0.4
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/README.md +112 -10
- package/dist/hook.d.ts +3 -0
- package/dist/hook.d.ts.map +1 -0
- package/dist/hook.js +10 -0
- package/dist/hook.js.map +1 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/inspector.d.ts +5 -0
- package/dist/inspector.d.ts.map +1 -0
- package/dist/inspector.js +706 -0
- package/dist/inspector.js.map +1 -0
- package/dist/provider.d.ts +21 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +35 -0
- package/dist/provider.js.map +1 -0
- package/dist/use-tool.d.ts +2 -0
- package/dist/use-tool.d.ts.map +1 -0
- package/dist/use-tool.js +10 -0
- package/dist/use-tool.js.map +1 -0
- package/package.json +24 -33
- package/dist/index.cjs +0 -31
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -3
package/README.md
CHANGED
|
@@ -1,23 +1,125 @@
|
|
|
1
1
|
# @agentified/react
|
|
2
2
|
|
|
3
|
-
React hooks and
|
|
3
|
+
React bindings for [Agentified](../../README.md) — Provider, hooks, and a built-in Inspector debug panel.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @agentified/react @agentified/
|
|
9
|
-
# or
|
|
10
|
-
pnpm add @agentified/react @agentified/sdk react
|
|
8
|
+
npm install @agentified/react @agentified/fe-client
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
**Peer dependencies:** `react >= 18`
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { AgentifiedProvider, useAgentified, useAgentifiedTool, Inspector } from "@agentified/react";
|
|
17
|
+
|
|
18
|
+
function App() {
|
|
19
|
+
return (
|
|
20
|
+
<AgentifiedProvider agentUrl="http://localhost:3003/api/chat">
|
|
21
|
+
<Chat />
|
|
22
|
+
<Inspector defaultOpen />
|
|
23
|
+
</AgentifiedProvider>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function Chat() {
|
|
28
|
+
const { messages, sendMessage, isLoading } = useAgentified();
|
|
29
|
+
|
|
30
|
+
useAgentifiedTool("navigate_to_page", async (args) => {
|
|
31
|
+
window.location.href = args.path;
|
|
32
|
+
return { success: true };
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div>
|
|
37
|
+
{messages.map((m, i) => <p key={i}><b>{m.role}:</b> {m.content}</p>)}
|
|
38
|
+
<button onClick={() => sendMessage("Hello!")} disabled={isLoading}>
|
|
39
|
+
Send
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## API Reference
|
|
47
|
+
|
|
48
|
+
### `<AgentifiedProvider>`
|
|
49
|
+
|
|
50
|
+
Wraps your app and provides the Agentified client context.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
interface AgentifiedProviderProps {
|
|
54
|
+
agentUrl: string; // AG-UI agent backend URL
|
|
55
|
+
headers?: Record<string, string>; // custom HTTP headers
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
<AgentifiedProvider agentUrl="http://localhost:3003/api/chat">
|
|
60
|
+
{children}
|
|
61
|
+
</AgentifiedProvider>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### `useAgentified()`
|
|
65
|
+
|
|
66
|
+
Main hook — returns messages, actions, and state.
|
|
14
67
|
|
|
15
68
|
```typescript
|
|
16
|
-
|
|
69
|
+
const {
|
|
70
|
+
state, // InspectorState — full client state
|
|
71
|
+
messages, // Message[] — conversation history
|
|
72
|
+
sendMessage, // (content: string) => Promise<void>
|
|
73
|
+
isLoading, // boolean
|
|
74
|
+
error, // string | null
|
|
75
|
+
reset, // () => void — clear all state
|
|
76
|
+
} = useAgentified();
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### `useAgentifiedTool(name, handler)`
|
|
17
80
|
|
|
18
|
-
|
|
81
|
+
Registers a frontend tool handler. Automatically unregisters on unmount.
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
useAgentifiedTool("open_modal", async (args) => {
|
|
85
|
+
setModalOpen(args.id);
|
|
86
|
+
return { opened: true };
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### `useAgentifiedClient()`
|
|
91
|
+
|
|
92
|
+
Returns the raw `AgentifiedClient` instance for advanced use cases.
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
const client = useAgentifiedClient();
|
|
96
|
+
client.setSharedContext({ page: "/dashboard", openModals: [] });
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### `<Inspector>`
|
|
100
|
+
|
|
101
|
+
Floating debug panel with three tabs: **Timeline**, **Session**, and **Log**.
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
interface InspectorProps {
|
|
105
|
+
defaultOpen?: boolean; // default: false
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
<Inspector defaultOpen />
|
|
19
109
|
```
|
|
20
110
|
|
|
21
|
-
|
|
111
|
+
**Timeline tab** — run status, interaction timeline (prefetch, discover, tool calls, messages), active tools, frontend tools, shared context.
|
|
112
|
+
|
|
113
|
+
**Session tab** — metrics grid (messages, tool calls, TTFT, duration, tokens), token breakdown, prefetch/discovery history.
|
|
114
|
+
|
|
115
|
+
**Log tab** — filterable event log (all / agentified / tool_calls / messages) with expandable event details.
|
|
116
|
+
|
|
117
|
+
The Inspector is draggable and resizable.
|
|
118
|
+
|
|
119
|
+
## Links
|
|
22
120
|
|
|
23
|
-
|
|
121
|
+
- [Root README](../../../README.md)
|
|
122
|
+
- [Frontend Client](../fe-client/README.md) — underlying client library
|
|
123
|
+
- [TypeScript SDK](../sdk/README.md)
|
|
124
|
+
- [Mastra Adapter](../mastra/README.md)
|
|
125
|
+
- [QuickHR Example](../../../examples/quickhr/) — full-stack app using all React bindings
|
package/dist/hook.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../src/hook.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE5D,wBAAgB,aAAa,IAAI,sBAAsB,CAMtD"}
|
package/dist/hook.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { AgentifiedContext } from "./provider.js";
|
|
3
|
+
export function useAgentified() {
|
|
4
|
+
const ctx = useContext(AgentifiedContext);
|
|
5
|
+
if (!ctx) {
|
|
6
|
+
throw new Error("useAgentified must be used within <AgentifiedProvider>");
|
|
7
|
+
}
|
|
8
|
+
return ctx;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=hook.js.map
|
package/dist/hook.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../src/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,MAAM,UAAU,aAAa;IAC3B,MAAM,GAAG,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC1C,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
export { AgentifiedProvider, useAgentifiedClient } from "./provider.js";
|
|
2
|
+
export { useAgentified } from "./hook.js";
|
|
3
|
+
export { useAgentifiedTool } from "./use-tool.js";
|
|
4
|
+
export { Inspector } from "./inspector.js";
|
|
5
|
+
export type { InspectorProps } from "./inspector.js";
|
|
6
|
+
export type { Message, Context } from "@agentified/fe-client";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
};
|
|
1
|
+
export { AgentifiedProvider, useAgentifiedClient } from "./provider.js";
|
|
2
|
+
export { useAgentified } from "./hook.js";
|
|
3
|
+
export { useAgentifiedTool } from "./use-tool.js";
|
|
4
|
+
export { Inspector } from "./inspector.js";
|
|
6
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../src/inspector.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAUD,wBAAgB,SAAS,CAAC,EAAE,WAAmB,EAAE,EAAE,cAAc,2CA2IhE"}
|
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useAgentified } from "./hook.js";
|
|
4
|
+
const TABS = [
|
|
5
|
+
{ key: "timeline", label: "Timeline" },
|
|
6
|
+
{ key: "session", label: "Session" },
|
|
7
|
+
{ key: "log", label: "Log" },
|
|
8
|
+
];
|
|
9
|
+
// ── Inspector ──────────────────────────────────────────────────────────
|
|
10
|
+
export function Inspector({ defaultOpen = false }) {
|
|
11
|
+
const { state } = useAgentified();
|
|
12
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
13
|
+
const [activeTab, setActiveTab] = useState("timeline");
|
|
14
|
+
const [pos, setPos] = useState({ x: typeof window !== "undefined" ? window.innerWidth - 520 : 80, y: 80 });
|
|
15
|
+
const [size, setSize] = useState({ w: 500, h: 500 });
|
|
16
|
+
const [dragging, setDragging] = useState(false);
|
|
17
|
+
const panelRef = useRef(null);
|
|
18
|
+
const triggerRef = useRef(null);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (open && panelRef.current) {
|
|
21
|
+
try {
|
|
22
|
+
panelRef.current.showPopover();
|
|
23
|
+
}
|
|
24
|
+
catch { /* popover not supported */ }
|
|
25
|
+
}
|
|
26
|
+
}, [open]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!open && triggerRef.current) {
|
|
29
|
+
try {
|
|
30
|
+
triggerRef.current.showPopover();
|
|
31
|
+
}
|
|
32
|
+
catch { /* popover not supported */ }
|
|
33
|
+
}
|
|
34
|
+
}, [open]);
|
|
35
|
+
const handleDragStart = useCallback((e) => {
|
|
36
|
+
if (e.target.closest("button"))
|
|
37
|
+
return;
|
|
38
|
+
const el = e.currentTarget;
|
|
39
|
+
el.setPointerCapture(e.pointerId);
|
|
40
|
+
setDragging(true);
|
|
41
|
+
const startX = e.clientX - pos.x;
|
|
42
|
+
const startY = e.clientY - pos.y;
|
|
43
|
+
const onMove = (ev) => {
|
|
44
|
+
setPos({ x: ev.clientX - startX, y: ev.clientY - startY });
|
|
45
|
+
};
|
|
46
|
+
const onUp = () => {
|
|
47
|
+
setDragging(false);
|
|
48
|
+
document.removeEventListener("pointermove", onMove);
|
|
49
|
+
document.removeEventListener("pointerup", onUp);
|
|
50
|
+
};
|
|
51
|
+
document.addEventListener("pointermove", onMove);
|
|
52
|
+
document.addEventListener("pointerup", onUp);
|
|
53
|
+
}, [pos.x, pos.y]);
|
|
54
|
+
const handleResizeStart = useCallback((e) => {
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
const el = e.currentTarget;
|
|
57
|
+
el.setPointerCapture(e.pointerId);
|
|
58
|
+
const startX = e.clientX;
|
|
59
|
+
const startY = e.clientY;
|
|
60
|
+
const startW = size.w;
|
|
61
|
+
const startH = size.h;
|
|
62
|
+
const onMove = (ev) => {
|
|
63
|
+
setSize({
|
|
64
|
+
w: Math.max(300, startW + ev.clientX - startX),
|
|
65
|
+
h: Math.max(200, startH + ev.clientY - startY),
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const onUp = () => {
|
|
69
|
+
document.removeEventListener("pointermove", onMove);
|
|
70
|
+
document.removeEventListener("pointerup", onUp);
|
|
71
|
+
};
|
|
72
|
+
document.addEventListener("pointermove", onMove);
|
|
73
|
+
document.addEventListener("pointerup", onUp);
|
|
74
|
+
}, [size.w, size.h]);
|
|
75
|
+
if (!open) {
|
|
76
|
+
return (_jsx("button", { ref: triggerRef,
|
|
77
|
+
// @ts-expect-error popover attribute not yet in React types
|
|
78
|
+
popover: "manual", "data-testid": "inspector-toggle", onClick: () => setOpen(true), style: S.trigger, "aria-label": "Open Agentified Inspector", children: _jsx("span", { style: S.triggerIcon, children: "\u25C8" }) }));
|
|
79
|
+
}
|
|
80
|
+
const modalStyle = {
|
|
81
|
+
...S.modal,
|
|
82
|
+
left: pos.x,
|
|
83
|
+
top: pos.y,
|
|
84
|
+
width: size.w,
|
|
85
|
+
height: size.h,
|
|
86
|
+
};
|
|
87
|
+
return (_jsxs("div", { ref: panelRef,
|
|
88
|
+
// @ts-expect-error popover attribute not yet in React types
|
|
89
|
+
popover: "manual", "data-testid": "inspector-panel", style: modalStyle, children: [_jsxs("div", { style: { ...S.header, cursor: dragging ? "grabbing" : "grab" }, onPointerDown: handleDragStart, children: [_jsxs("div", { style: S.headerLeft, children: [_jsx("span", { style: S.headerDot(state.connection) }), _jsx("span", { style: S.headerTitle, children: "Agentified" })] }), _jsx("button", { "data-testid": "inspector-close", onClick: () => setOpen(false), style: S.closeBtn, "aria-label": "Close Inspector", children: "\u2715" })] }), _jsx("div", { style: S.tabs, children: TABS.map((t) => (_jsx("button", { "data-testid": `tab-${t.key}`, onClick: () => setActiveTab(t.key), style: tabStyle(t.key === activeTab), children: t.label }, t.key))) }), _jsxs("div", { style: S.body, children: [activeTab === "timeline" && _jsx(TimelineTab, { state: state }), activeTab === "session" && _jsx(SessionTab, { state: state }), activeTab === "log" && _jsx(LogTab, { state: state })] }), _jsx("div", { "data-testid": "inspector-resize", style: S.resizeHandle, onPointerDown: handleResizeStart })] }));
|
|
90
|
+
}
|
|
91
|
+
// ── Tab: Timeline ─────────────────────────────────────────────────────
|
|
92
|
+
function TimelineTab({ state }) {
|
|
93
|
+
const { connection, run, streaming, events, toolCalls, agentified, frontendTools = [], sharedContext } = state;
|
|
94
|
+
return (_jsxs("div", { children: [_jsx(Section, { title: "Run", children: _jsxs("div", { style: S.metricsRow, children: [_jsx(MetricPill, { label: "Status", value: connectionLabel(connection) }), run.runId && _jsx(MetricPill, { label: "Run", value: run.runId, mono: true }), run.durationMs != null && _jsx(MetricPill, { label: "Duration", value: `${run.durationMs}ms` }), streaming.timeToFirstTokenMs != null && _jsx(MetricPill, { label: "TTFT", value: `${streaming.timeToFirstTokenMs}ms` })] }) }), _jsx(Section, { title: "Interaction Timeline", children: _jsx(TimelineList, { events: events, toolCalls: toolCalls }) }), agentified.currentTools.length > 0 && (_jsx(Section, { title: "Active Tools", children: _jsx("div", { style: S.toolTable, children: agentified.currentTools.map((tool, i) => (_jsx(ToolRow, { tool: tool }, `${tool.name}-${i}`))) }) })), frontendTools.length > 0 && (_jsx(Section, { title: "Frontend Tools", children: _jsx("div", { style: S.frontendToolsList, children: frontendTools.map((name) => (_jsxs("span", { style: S.frontendToolBadge, children: [_jsx("span", { style: S.frontendToolDot }), name] }, name))) }) })), sharedContext && (_jsx(Section, { title: "Shared Context", children: _jsxs("div", { style: S.sharedContext, children: [_jsx(Row, { label: "Page", value: sharedContext.page }), sharedContext.activeTab && _jsx(Row, { label: "Tab", value: sharedContext.activeTab }), sharedContext.openModals.length > 0 && (_jsx(Row, { label: "Open Modals", value: sharedContext.openModals.join(", ") }))] }) }))] }));
|
|
95
|
+
}
|
|
96
|
+
function TimelineList({ events, toolCalls }) {
|
|
97
|
+
const listRef = useRef(null);
|
|
98
|
+
const prevLen = useRef(events.length);
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (events.length > prevLen.current && listRef.current) {
|
|
101
|
+
listRef.current.scrollTop = listRef.current.scrollHeight;
|
|
102
|
+
}
|
|
103
|
+
prevLen.current = events.length;
|
|
104
|
+
}, [events.length]);
|
|
105
|
+
if (events.length === 0) {
|
|
106
|
+
return _jsx("div", { style: S.emptyState, children: "No events yet" });
|
|
107
|
+
}
|
|
108
|
+
const items = buildTimelineItems(events, toolCalls);
|
|
109
|
+
return (_jsx("div", { ref: listRef, style: S.timelineList, "data-testid": "timeline-list", children: items.map((item, i) => (_jsx(TimelineItem, { item: item }, i))) }));
|
|
110
|
+
}
|
|
111
|
+
function buildTimelineItems(events, toolCalls) {
|
|
112
|
+
const items = [];
|
|
113
|
+
const toolCallMap = new Map(toolCalls.map(tc => [tc.id, tc]));
|
|
114
|
+
const seenToolCalls = new Set();
|
|
115
|
+
for (const entry of events) {
|
|
116
|
+
const e = entry.event;
|
|
117
|
+
const type = e.type;
|
|
118
|
+
if (type === "RUN_STARTED") {
|
|
119
|
+
items.push({ type: "run_started", label: `Run started${e.runId ? ` · ${e.runId}` : ""}`, timestamp: entry.timestamp });
|
|
120
|
+
}
|
|
121
|
+
else if (type === "RUN_FINISHED") {
|
|
122
|
+
items.push({ type: "run_finished", label: "Run complete", timestamp: entry.timestamp });
|
|
123
|
+
}
|
|
124
|
+
else if (entry.isAgentified) {
|
|
125
|
+
const name = e.name;
|
|
126
|
+
const value = e.value;
|
|
127
|
+
if (name === "agentified:prefetch:complete") {
|
|
128
|
+
const tools = value?.tools ?? [];
|
|
129
|
+
const dur = value?.durationMs ?? "?";
|
|
130
|
+
items.push({ type: "agentified", label: `Prefetch · ${tools.length} tools · ${dur}ms`, timestamp: entry.timestamp, expandable: true, expanded: value });
|
|
131
|
+
}
|
|
132
|
+
else if (name === "agentified:discover:complete") {
|
|
133
|
+
const query = value?.query ?? "";
|
|
134
|
+
const tools = value?.tools ?? [];
|
|
135
|
+
const dur = value?.durationMs ?? "?";
|
|
136
|
+
items.push({ type: "agentified", label: `Discover "${query}" · ${tools.length} tools · ${dur}ms`, timestamp: entry.timestamp, expandable: true, expanded: value });
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
items.push({ type: "agentified", label: name, timestamp: entry.timestamp });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else if (type === "TOOL_CALL_START") {
|
|
143
|
+
const tcId = e.toolCallId;
|
|
144
|
+
if (!seenToolCalls.has(tcId)) {
|
|
145
|
+
seenToolCalls.add(tcId);
|
|
146
|
+
const tc = toolCallMap.get(tcId);
|
|
147
|
+
if (tc) {
|
|
148
|
+
const dur = tc.durationMs != null ? ` · ${tc.durationMs}ms` : "";
|
|
149
|
+
items.push({ type: "tool_call", label: `${tc.name}${dur}`, timestamp: entry.timestamp, expandable: true, expanded: { args: tc.args, result: tc.result } });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else if (type === "TEXT_MESSAGE_START") {
|
|
154
|
+
const role = e.role ?? "assistant";
|
|
155
|
+
items.push({ type: "message", label: `${role} message`, timestamp: entry.timestamp });
|
|
156
|
+
}
|
|
157
|
+
else if (type !== "TEXT_MESSAGE_CONTENT" && type !== "TEXT_MESSAGE_END" && type !== "TOOL_CALL_ARGS" && type !== "TOOL_CALL_END" && type !== "TOOL_CALL_RESULT") {
|
|
158
|
+
items.push({ type: "other", label: type, timestamp: entry.timestamp });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return items;
|
|
162
|
+
}
|
|
163
|
+
function TimelineItem({ item }) {
|
|
164
|
+
const [expanded, setExpanded] = useState(false);
|
|
165
|
+
const time = new Date(item.timestamp).toLocaleTimeString();
|
|
166
|
+
const color = item.type === "agentified" ? C.agentified
|
|
167
|
+
: item.type === "tool_call" ? C.accent
|
|
168
|
+
: item.type === "run_started" || item.type === "run_finished" ? C.green
|
|
169
|
+
: C.text;
|
|
170
|
+
return (_jsxs("div", { style: S.timelineItem, "data-testid": "timeline-item", children: [_jsxs("div", { style: { ...S.timelineItemHeader, cursor: item.expandable ? "pointer" : "default" }, onClick: () => item.expandable && setExpanded(!expanded), children: [_jsx("span", { style: S.timelineDot(color) }), _jsx("span", { style: S.timelineLabel(color), children: item.label }), _jsx("span", { style: S.timelineTime, children: time }), item.expandable && _jsx("span", { style: S.expandArrow, children: expanded ? "▾" : "▸" })] }), expanded && item.expanded && (_jsx("pre", { style: S.timelineDetail, "data-testid": "timeline-detail", children: JSON.stringify(item.expanded, null, 2) }))] }));
|
|
171
|
+
}
|
|
172
|
+
// ── Tab: Session ──────────────────────────────────────────────────────
|
|
173
|
+
function SessionTab({ state }) {
|
|
174
|
+
const { tokens, streaming, run, events, agentified } = state;
|
|
175
|
+
const total = tokens.input + tokens.output + tokens.cached + tokens.reasoning;
|
|
176
|
+
return (_jsxs("div", { children: [_jsx(Section, { title: "Metrics", children: _jsxs("div", { style: S.metricsRow, children: [_jsx(MetricPill, { label: "Messages", value: String(streaming.messageCount) }), _jsx(MetricPill, { label: "Tool Calls", value: String(streaming.toolCallCount) }), streaming.timeToFirstTokenMs != null && _jsx(MetricPill, { label: "TTFT", value: `${streaming.timeToFirstTokenMs}ms` }), run.durationMs != null && _jsx(MetricPill, { label: "Total", value: `${run.durationMs}ms` }), (tokens.input > 0 || tokens.output > 0) && (_jsx(MetricPill, { label: "Tokens", value: formatNumber(total) }))] }) }), _jsx(Section, { title: "Session Summary", children: _jsxs("div", { style: S.statGrid, children: [_jsx(StatCell, { label: "Events", value: String(events.length) }), _jsx(StatCell, { label: "Messages", value: String(streaming.messageCount) }), _jsx(StatCell, { label: "Tool Calls", value: String(streaming.toolCallCount) }), _jsx(StatCell, { label: "Duration", value: run.durationMs != null ? `${run.durationMs}ms` : "—" }), _jsx(StatCell, { label: "TTFT", value: streaming.timeToFirstTokenMs != null ? `${streaming.timeToFirstTokenMs}ms` : "—" }), _jsx(StatCell, { label: "Tokens", value: total > 0 ? formatNumber(total) : "—" })] }) }), total > 0 && (_jsxs(Section, { title: "Token Breakdown", children: [_jsxs("div", { style: S.tokenBreakdown, children: [_jsx(Row, { label: "Input", value: formatNumber(tokens.input) }), _jsx(Row, { label: "Output", value: formatNumber(tokens.output) }), _jsx(Row, { label: "Cached", value: formatNumber(tokens.cached) }), _jsx(Row, { label: "Reasoning", value: formatNumber(tokens.reasoning) })] }), tokens.contextWindowPercent != null && (_jsxs("div", { style: { marginTop: 8 }, children: [_jsx("div", { style: S.barOuter, children: _jsx("div", { "data-testid": "context-bar", style: barFill(tokens.contextWindowPercent) }) }), _jsxs("div", { style: S.barLabel, children: ["Context: ", tokens.contextWindowPercent.toFixed(1), "%"] })] }))] })), agentified.prefetchResults.length > 0 && (_jsx(Section, { title: "Prefetch History", children: agentified.prefetchResults.map((pr, i) => (_jsxs("div", { style: S.historyItem, children: [_jsxs("span", { style: S.historyLabel, children: [pr.tools.length, " tools"] }), _jsxs("span", { style: S.historyMeta, children: [pr.durationMs, "ms"] })] }, i))) })), agentified.discoveries.length > 0 && (_jsx(Section, { title: "Discovery History", children: agentified.discoveries.map((d, i) => (_jsxs("div", { style: S.historyItem, children: [_jsxs("span", { style: S.discoveryQuery, children: ["\"", d.query, "\""] }), _jsxs("span", { style: S.historyMeta, children: [d.tools.length, " tools \u00B7 ", d.durationMs, "ms"] })] }, i))) }))] }));
|
|
177
|
+
}
|
|
178
|
+
function ToolRow({ tool }) {
|
|
179
|
+
const pct = Math.round(tool.score * 100);
|
|
180
|
+
return (_jsxs("div", { style: S.toolRow, "data-testid": "tool-row", children: [_jsxs("div", { style: S.toolRowTop, children: [_jsx("span", { style: S.toolName, children: tool.name }), _jsx("span", { style: S.toolScore, children: tool.score.toFixed(2) })] }), _jsx("div", { style: S.scoreBarOuter, children: _jsx("div", { style: { ...S.scoreBarFill, width: `${pct}%` } }) }), tool.description && _jsx("div", { style: S.toolDesc, children: tool.description.length > 60 ? tool.description.slice(0, 60) + "…" : tool.description })] }));
|
|
181
|
+
}
|
|
182
|
+
// ── Tab: Log ──────────────────────────────────────────────────────────
|
|
183
|
+
function LogTab({ state }) {
|
|
184
|
+
const [filter, setFilter] = useState("all");
|
|
185
|
+
const filteredEvents = filterEvents(state.events, filter);
|
|
186
|
+
return (_jsx("div", { children: _jsxs(Section, { title: "Event Log", children: [_jsx("div", { style: S.filterRow, children: ["all", "agentified", "tool_calls", "messages"].map(f => (_jsx("button", { "data-testid": `filter-${f}`, onClick: () => setFilter(f), style: filterBtnStyle(f === filter), children: filterLabel(f) }, f))) }), _jsx(EventLog, { events: filteredEvents })] }) }));
|
|
187
|
+
}
|
|
188
|
+
function filterEvents(events, filter) {
|
|
189
|
+
if (filter === "all")
|
|
190
|
+
return events;
|
|
191
|
+
if (filter === "agentified")
|
|
192
|
+
return events.filter(e => e.isAgentified);
|
|
193
|
+
if (filter === "tool_calls")
|
|
194
|
+
return events.filter(e => {
|
|
195
|
+
const t = e.event.type;
|
|
196
|
+
return t === "TOOL_CALL_START" || t === "TOOL_CALL_ARGS" || t === "TOOL_CALL_END" || t === "TOOL_CALL_RESULT";
|
|
197
|
+
});
|
|
198
|
+
if (filter === "messages")
|
|
199
|
+
return events.filter(e => {
|
|
200
|
+
const t = e.event.type;
|
|
201
|
+
return t === "TEXT_MESSAGE_START" || t === "TEXT_MESSAGE_CONTENT" || t === "TEXT_MESSAGE_END";
|
|
202
|
+
});
|
|
203
|
+
return events;
|
|
204
|
+
}
|
|
205
|
+
function filterLabel(f) {
|
|
206
|
+
const map = { all: "All", agentified: "Agentified", tool_calls: "Tool Calls", messages: "Messages" };
|
|
207
|
+
return map[f];
|
|
208
|
+
}
|
|
209
|
+
function EventLog({ events }) {
|
|
210
|
+
const listRef = useRef(null);
|
|
211
|
+
const prevLen = useRef(events.length);
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
if (events.length > prevLen.current && listRef.current) {
|
|
214
|
+
listRef.current.scrollTop = listRef.current.scrollHeight;
|
|
215
|
+
}
|
|
216
|
+
prevLen.current = events.length;
|
|
217
|
+
}, [events.length]);
|
|
218
|
+
return (_jsxs("div", { ref: listRef, style: S.eventList, "data-testid": "event-list", children: [events.length === 0 && _jsx("div", { style: S.emptyState, children: "No events" }), events.map((entry, i) => (_jsx(EventRow, { entry: entry }, i)))] }));
|
|
219
|
+
}
|
|
220
|
+
function EventRow({ entry }) {
|
|
221
|
+
const [expanded, setExpanded] = useState(false);
|
|
222
|
+
const time = new Date(entry.timestamp).toLocaleTimeString();
|
|
223
|
+
const e = entry.event;
|
|
224
|
+
const eventType = entry.isAgentified ? e.name : e.type;
|
|
225
|
+
return (_jsxs("div", { style: eventRowStyle(entry.isAgentified), "data-testid": "event-row", children: [_jsxs("div", { style: S.eventRowHeader, onClick: () => setExpanded(!expanded), children: [_jsx("span", { style: S.eventTime, children: time }), _jsx("span", { style: S.eventType(entry.isAgentified), children: eventType }), _jsx("span", { style: S.expandArrow, children: expanded ? "▾" : "▸" })] }), expanded && (_jsx("pre", { style: S.eventDetail, "data-testid": "event-detail", children: JSON.stringify(entry.event, null, 2) }))] }));
|
|
226
|
+
}
|
|
227
|
+
// ── Shared Sub-components ──────────────────────────────────────────────
|
|
228
|
+
function Section({ title, children }) {
|
|
229
|
+
return (_jsxs("div", { style: S.section, children: [_jsx("div", { style: S.sectionTitle, children: title }), children] }));
|
|
230
|
+
}
|
|
231
|
+
function Row({ label, value }) {
|
|
232
|
+
return (_jsxs("div", { style: S.row, children: [_jsx("span", { style: S.rowLabel, children: label }), _jsx("span", { style: S.rowValue, children: value })] }));
|
|
233
|
+
}
|
|
234
|
+
function MetricPill({ label, value, mono }) {
|
|
235
|
+
return (_jsxs("div", { style: S.metricPill, children: [_jsx("div", { style: S.metricPillLabel, children: label }), _jsx("div", { style: mono ? S.metricPillValueMono : S.metricPillValue, children: value })] }));
|
|
236
|
+
}
|
|
237
|
+
function StatCell({ label, value }) {
|
|
238
|
+
return (_jsxs("div", { style: S.statCell, "data-testid": "stat-cell", children: [_jsx("div", { style: S.statValue, children: value }), _jsx("div", { style: S.statLabel, children: label })] }));
|
|
239
|
+
}
|
|
240
|
+
// ── Helpers ─────────────────────────────────────────────────────────────
|
|
241
|
+
function connectionLabel(status) {
|
|
242
|
+
const map = {
|
|
243
|
+
idle: "Idle",
|
|
244
|
+
connecting: "Connecting…",
|
|
245
|
+
connected: "Connected",
|
|
246
|
+
disconnected: "Disconnected",
|
|
247
|
+
error: "Error",
|
|
248
|
+
};
|
|
249
|
+
return map[status];
|
|
250
|
+
}
|
|
251
|
+
function formatNumber(n) {
|
|
252
|
+
if (n >= 1_000_000)
|
|
253
|
+
return `${(n / 1_000_000).toFixed(1)}M`;
|
|
254
|
+
if (n >= 1_000)
|
|
255
|
+
return `${(n / 1_000).toFixed(1)}k`;
|
|
256
|
+
return String(n);
|
|
257
|
+
}
|
|
258
|
+
// ── Styles ──────────────────────────────────────────────────────────────
|
|
259
|
+
const C = {
|
|
260
|
+
bg: "#0c0c0e",
|
|
261
|
+
surface: "#141418",
|
|
262
|
+
border: "#1e1e24",
|
|
263
|
+
text: "#c8c8d0",
|
|
264
|
+
textDim: "#6b6b78",
|
|
265
|
+
accent: "#58a6ff",
|
|
266
|
+
agentified: "#d2a8ff",
|
|
267
|
+
green: "#3fb950",
|
|
268
|
+
yellow: "#d29922",
|
|
269
|
+
red: "#f85149",
|
|
270
|
+
bar: "#1c1c22",
|
|
271
|
+
mono: "'SF Mono', 'Cascadia Code', 'Fira Code', Menlo, monospace",
|
|
272
|
+
sans: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif",
|
|
273
|
+
};
|
|
274
|
+
function tabStyle(active) {
|
|
275
|
+
return {
|
|
276
|
+
background: "none",
|
|
277
|
+
border: "none",
|
|
278
|
+
borderBottom: active ? `2px solid ${C.accent}` : "2px solid transparent",
|
|
279
|
+
color: active ? C.text : C.textDim,
|
|
280
|
+
fontFamily: C.sans,
|
|
281
|
+
fontSize: 11,
|
|
282
|
+
fontWeight: active ? 600 : 400,
|
|
283
|
+
padding: "6px 12px",
|
|
284
|
+
cursor: "pointer",
|
|
285
|
+
whiteSpace: "nowrap",
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
function barFill(pct) {
|
|
289
|
+
const color = pct > 90 ? C.red : pct > 70 ? C.yellow : C.accent;
|
|
290
|
+
return {
|
|
291
|
+
height: "100%",
|
|
292
|
+
width: `${Math.min(pct, 100)}%`,
|
|
293
|
+
background: color,
|
|
294
|
+
borderRadius: 3,
|
|
295
|
+
transition: "width 0.3s ease",
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function eventRowStyle(isAgentified) {
|
|
299
|
+
return {
|
|
300
|
+
padding: "2px 0",
|
|
301
|
+
borderBottom: `1px solid ${C.border}`,
|
|
302
|
+
...(isAgentified ? { background: "rgba(210,168,255,0.04)" } : {}),
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function filterBtnStyle(active) {
|
|
306
|
+
return {
|
|
307
|
+
background: active ? "rgba(88,166,255,0.12)" : "none",
|
|
308
|
+
border: `1px solid ${active ? C.accent : C.border}`,
|
|
309
|
+
borderRadius: 4,
|
|
310
|
+
color: active ? C.accent : C.textDim,
|
|
311
|
+
fontSize: 10,
|
|
312
|
+
padding: "2px 8px",
|
|
313
|
+
cursor: "pointer",
|
|
314
|
+
fontFamily: C.sans,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
const S = {
|
|
318
|
+
trigger: {
|
|
319
|
+
position: "fixed",
|
|
320
|
+
bottom: 16,
|
|
321
|
+
left: "50%",
|
|
322
|
+
transform: "translateX(-50%)",
|
|
323
|
+
zIndex: 99999,
|
|
324
|
+
width: 36,
|
|
325
|
+
height: 36,
|
|
326
|
+
borderRadius: "50%",
|
|
327
|
+
border: `1px solid ${C.border}`,
|
|
328
|
+
background: C.bg,
|
|
329
|
+
color: C.agentified,
|
|
330
|
+
cursor: "pointer",
|
|
331
|
+
display: "flex",
|
|
332
|
+
alignItems: "center",
|
|
333
|
+
justifyContent: "center",
|
|
334
|
+
fontSize: 18,
|
|
335
|
+
padding: 0,
|
|
336
|
+
boxShadow: "0 2px 12px rgba(0,0,0,0.5)",
|
|
337
|
+
},
|
|
338
|
+
triggerIcon: { lineHeight: 1 },
|
|
339
|
+
modal: {
|
|
340
|
+
position: "fixed",
|
|
341
|
+
zIndex: 99999,
|
|
342
|
+
borderRadius: 12,
|
|
343
|
+
border: `1px solid ${C.border}`,
|
|
344
|
+
background: C.bg,
|
|
345
|
+
color: C.text,
|
|
346
|
+
fontFamily: C.sans,
|
|
347
|
+
fontSize: 12,
|
|
348
|
+
lineHeight: "1.5",
|
|
349
|
+
display: "flex",
|
|
350
|
+
flexDirection: "column",
|
|
351
|
+
overflow: "hidden",
|
|
352
|
+
boxShadow: "0 8px 48px rgba(0,0,0,0.7)",
|
|
353
|
+
},
|
|
354
|
+
resizeHandle: {
|
|
355
|
+
position: "absolute",
|
|
356
|
+
right: 0,
|
|
357
|
+
bottom: 0,
|
|
358
|
+
width: 12,
|
|
359
|
+
height: 12,
|
|
360
|
+
cursor: "nwse-resize",
|
|
361
|
+
background: "linear-gradient(135deg, transparent 50%, rgba(200,200,208,0.3) 50%)",
|
|
362
|
+
borderRadius: "0 0 12px 0",
|
|
363
|
+
},
|
|
364
|
+
header: {
|
|
365
|
+
display: "flex",
|
|
366
|
+
alignItems: "center",
|
|
367
|
+
justifyContent: "space-between",
|
|
368
|
+
padding: "10px 16px",
|
|
369
|
+
borderBottom: `1px solid ${C.border}`,
|
|
370
|
+
},
|
|
371
|
+
headerLeft: {
|
|
372
|
+
display: "flex",
|
|
373
|
+
alignItems: "center",
|
|
374
|
+
gap: 8,
|
|
375
|
+
},
|
|
376
|
+
headerDot: (status) => ({
|
|
377
|
+
width: 7,
|
|
378
|
+
height: 7,
|
|
379
|
+
borderRadius: "50%",
|
|
380
|
+
background: status === "connected" ? C.green
|
|
381
|
+
: status === "connecting" ? C.yellow
|
|
382
|
+
: status === "error" ? C.red
|
|
383
|
+
: C.textDim,
|
|
384
|
+
flexShrink: 0,
|
|
385
|
+
}),
|
|
386
|
+
headerTitle: {
|
|
387
|
+
fontWeight: 700,
|
|
388
|
+
fontSize: 13,
|
|
389
|
+
letterSpacing: "0.02em",
|
|
390
|
+
},
|
|
391
|
+
closeBtn: {
|
|
392
|
+
background: "none",
|
|
393
|
+
border: "none",
|
|
394
|
+
color: C.textDim,
|
|
395
|
+
cursor: "pointer",
|
|
396
|
+
fontSize: 14,
|
|
397
|
+
padding: "2px 4px",
|
|
398
|
+
lineHeight: 1,
|
|
399
|
+
},
|
|
400
|
+
tabs: {
|
|
401
|
+
display: "flex",
|
|
402
|
+
borderBottom: `1px solid ${C.border}`,
|
|
403
|
+
padding: "0 8px",
|
|
404
|
+
},
|
|
405
|
+
body: {
|
|
406
|
+
flex: 1,
|
|
407
|
+
overflowY: "auto",
|
|
408
|
+
padding: "10px 16px",
|
|
409
|
+
},
|
|
410
|
+
section: {
|
|
411
|
+
marginBottom: 14,
|
|
412
|
+
},
|
|
413
|
+
sectionTitle: {
|
|
414
|
+
fontSize: 10,
|
|
415
|
+
fontWeight: 600,
|
|
416
|
+
textTransform: "uppercase",
|
|
417
|
+
letterSpacing: "0.08em",
|
|
418
|
+
color: C.textDim,
|
|
419
|
+
marginBottom: 6,
|
|
420
|
+
},
|
|
421
|
+
row: {
|
|
422
|
+
display: "flex",
|
|
423
|
+
justifyContent: "space-between",
|
|
424
|
+
padding: "2px 0",
|
|
425
|
+
},
|
|
426
|
+
rowLabel: {
|
|
427
|
+
color: C.textDim,
|
|
428
|
+
},
|
|
429
|
+
rowValue: {
|
|
430
|
+
color: C.text,
|
|
431
|
+
fontWeight: 500,
|
|
432
|
+
},
|
|
433
|
+
// Timeline
|
|
434
|
+
metricsRow: {
|
|
435
|
+
display: "flex",
|
|
436
|
+
flexWrap: "wrap",
|
|
437
|
+
gap: 6,
|
|
438
|
+
},
|
|
439
|
+
metricPill: {
|
|
440
|
+
background: C.surface,
|
|
441
|
+
border: `1px solid ${C.border}`,
|
|
442
|
+
borderRadius: 6,
|
|
443
|
+
padding: "4px 8px",
|
|
444
|
+
minWidth: 60,
|
|
445
|
+
},
|
|
446
|
+
metricPillLabel: {
|
|
447
|
+
fontSize: 9,
|
|
448
|
+
color: C.textDim,
|
|
449
|
+
textTransform: "uppercase",
|
|
450
|
+
letterSpacing: "0.05em",
|
|
451
|
+
},
|
|
452
|
+
metricPillValue: {
|
|
453
|
+
fontSize: 12,
|
|
454
|
+
fontWeight: 600,
|
|
455
|
+
color: C.text,
|
|
456
|
+
},
|
|
457
|
+
metricPillValueMono: {
|
|
458
|
+
fontSize: 11,
|
|
459
|
+
fontWeight: 600,
|
|
460
|
+
color: C.text,
|
|
461
|
+
fontFamily: C.mono,
|
|
462
|
+
overflow: "hidden",
|
|
463
|
+
textOverflow: "ellipsis",
|
|
464
|
+
whiteSpace: "nowrap",
|
|
465
|
+
maxWidth: 120,
|
|
466
|
+
},
|
|
467
|
+
timelineList: {
|
|
468
|
+
overflowY: "auto",
|
|
469
|
+
maxHeight: 300,
|
|
470
|
+
},
|
|
471
|
+
timelineItem: {
|
|
472
|
+
borderBottom: `1px solid ${C.border}`,
|
|
473
|
+
padding: "4px 0",
|
|
474
|
+
},
|
|
475
|
+
timelineItemHeader: {
|
|
476
|
+
display: "flex",
|
|
477
|
+
alignItems: "center",
|
|
478
|
+
gap: 6,
|
|
479
|
+
},
|
|
480
|
+
timelineDot: (color) => ({
|
|
481
|
+
width: 6,
|
|
482
|
+
height: 6,
|
|
483
|
+
borderRadius: "50%",
|
|
484
|
+
background: color,
|
|
485
|
+
flexShrink: 0,
|
|
486
|
+
}),
|
|
487
|
+
timelineLabel: (color) => ({
|
|
488
|
+
fontFamily: C.mono,
|
|
489
|
+
fontSize: 11,
|
|
490
|
+
color,
|
|
491
|
+
flex: 1,
|
|
492
|
+
overflow: "hidden",
|
|
493
|
+
textOverflow: "ellipsis",
|
|
494
|
+
whiteSpace: "nowrap",
|
|
495
|
+
}),
|
|
496
|
+
timelineTime: {
|
|
497
|
+
fontFamily: C.mono,
|
|
498
|
+
fontSize: 10,
|
|
499
|
+
color: C.textDim,
|
|
500
|
+
flexShrink: 0,
|
|
501
|
+
},
|
|
502
|
+
timelineDetail: {
|
|
503
|
+
fontFamily: C.mono,
|
|
504
|
+
fontSize: 10,
|
|
505
|
+
color: C.textDim,
|
|
506
|
+
background: C.surface,
|
|
507
|
+
border: `1px solid ${C.border}`,
|
|
508
|
+
borderRadius: 4,
|
|
509
|
+
padding: 8,
|
|
510
|
+
margin: "4px 0 0 12px",
|
|
511
|
+
overflow: "auto",
|
|
512
|
+
maxHeight: 150,
|
|
513
|
+
whiteSpace: "pre-wrap",
|
|
514
|
+
wordBreak: "break-all",
|
|
515
|
+
},
|
|
516
|
+
expandArrow: {
|
|
517
|
+
fontSize: 10,
|
|
518
|
+
color: C.textDim,
|
|
519
|
+
flexShrink: 0,
|
|
520
|
+
width: 12,
|
|
521
|
+
textAlign: "center",
|
|
522
|
+
},
|
|
523
|
+
// Learning
|
|
524
|
+
toolTable: {},
|
|
525
|
+
toolRow: {
|
|
526
|
+
padding: "4px 0",
|
|
527
|
+
borderBottom: `1px solid ${C.border}`,
|
|
528
|
+
},
|
|
529
|
+
toolRowTop: {
|
|
530
|
+
display: "flex",
|
|
531
|
+
justifyContent: "space-between",
|
|
532
|
+
alignItems: "center",
|
|
533
|
+
},
|
|
534
|
+
toolName: {
|
|
535
|
+
fontFamily: C.mono,
|
|
536
|
+
fontSize: 11,
|
|
537
|
+
color: C.text,
|
|
538
|
+
},
|
|
539
|
+
toolScore: {
|
|
540
|
+
fontFamily: C.mono,
|
|
541
|
+
fontSize: 11,
|
|
542
|
+
color: C.accent,
|
|
543
|
+
},
|
|
544
|
+
scoreBarOuter: {
|
|
545
|
+
height: 3,
|
|
546
|
+
background: C.bar,
|
|
547
|
+
borderRadius: 2,
|
|
548
|
+
overflow: "hidden",
|
|
549
|
+
marginTop: 2,
|
|
550
|
+
},
|
|
551
|
+
scoreBarFill: {
|
|
552
|
+
height: "100%",
|
|
553
|
+
background: C.accent,
|
|
554
|
+
borderRadius: 2,
|
|
555
|
+
transition: "width 0.3s ease",
|
|
556
|
+
},
|
|
557
|
+
toolDesc: {
|
|
558
|
+
fontSize: 10,
|
|
559
|
+
color: C.textDim,
|
|
560
|
+
marginTop: 2,
|
|
561
|
+
},
|
|
562
|
+
historyItem: {
|
|
563
|
+
display: "flex",
|
|
564
|
+
justifyContent: "space-between",
|
|
565
|
+
padding: "3px 0",
|
|
566
|
+
borderBottom: `1px solid ${C.border}`,
|
|
567
|
+
},
|
|
568
|
+
historyLabel: {
|
|
569
|
+
fontSize: 11,
|
|
570
|
+
color: C.text,
|
|
571
|
+
},
|
|
572
|
+
historyMeta: {
|
|
573
|
+
fontSize: 10,
|
|
574
|
+
color: C.textDim,
|
|
575
|
+
},
|
|
576
|
+
discoveryQuery: {
|
|
577
|
+
fontFamily: C.mono,
|
|
578
|
+
fontSize: 11,
|
|
579
|
+
color: C.agentified,
|
|
580
|
+
},
|
|
581
|
+
// Data
|
|
582
|
+
statGrid: {
|
|
583
|
+
display: "grid",
|
|
584
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
585
|
+
gap: 6,
|
|
586
|
+
},
|
|
587
|
+
statCell: {
|
|
588
|
+
background: C.surface,
|
|
589
|
+
border: `1px solid ${C.border}`,
|
|
590
|
+
borderRadius: 6,
|
|
591
|
+
padding: "6px 8px",
|
|
592
|
+
textAlign: "center",
|
|
593
|
+
},
|
|
594
|
+
statValue: {
|
|
595
|
+
fontSize: 14,
|
|
596
|
+
fontWeight: 700,
|
|
597
|
+
color: C.text,
|
|
598
|
+
},
|
|
599
|
+
statLabel: {
|
|
600
|
+
fontSize: 9,
|
|
601
|
+
color: C.textDim,
|
|
602
|
+
textTransform: "uppercase",
|
|
603
|
+
letterSpacing: "0.05em",
|
|
604
|
+
},
|
|
605
|
+
tokenBreakdown: {
|
|
606
|
+
marginTop: 8,
|
|
607
|
+
padding: "6px 8px",
|
|
608
|
+
background: C.surface,
|
|
609
|
+
border: `1px solid ${C.border}`,
|
|
610
|
+
borderRadius: 6,
|
|
611
|
+
},
|
|
612
|
+
barOuter: {
|
|
613
|
+
height: 6,
|
|
614
|
+
background: C.bar,
|
|
615
|
+
borderRadius: 3,
|
|
616
|
+
overflow: "hidden",
|
|
617
|
+
},
|
|
618
|
+
barLabel: {
|
|
619
|
+
textAlign: "right",
|
|
620
|
+
fontSize: 10,
|
|
621
|
+
color: C.textDim,
|
|
622
|
+
marginTop: 2,
|
|
623
|
+
},
|
|
624
|
+
filterRow: {
|
|
625
|
+
display: "flex",
|
|
626
|
+
gap: 4,
|
|
627
|
+
marginBottom: 8,
|
|
628
|
+
},
|
|
629
|
+
eventList: {
|
|
630
|
+
overflowY: "auto",
|
|
631
|
+
maxHeight: 250,
|
|
632
|
+
},
|
|
633
|
+
eventRowHeader: {
|
|
634
|
+
display: "flex",
|
|
635
|
+
alignItems: "center",
|
|
636
|
+
gap: 8,
|
|
637
|
+
cursor: "pointer",
|
|
638
|
+
padding: "2px 0",
|
|
639
|
+
},
|
|
640
|
+
eventTime: {
|
|
641
|
+
fontFamily: C.mono,
|
|
642
|
+
fontSize: 10,
|
|
643
|
+
color: C.textDim,
|
|
644
|
+
flexShrink: 0,
|
|
645
|
+
},
|
|
646
|
+
eventType: (isAgentified) => ({
|
|
647
|
+
fontFamily: C.mono,
|
|
648
|
+
fontSize: 11,
|
|
649
|
+
color: isAgentified ? C.agentified : C.text,
|
|
650
|
+
overflow: "hidden",
|
|
651
|
+
textOverflow: "ellipsis",
|
|
652
|
+
whiteSpace: "nowrap",
|
|
653
|
+
flex: 1,
|
|
654
|
+
}),
|
|
655
|
+
eventDetail: {
|
|
656
|
+
fontFamily: C.mono,
|
|
657
|
+
fontSize: 10,
|
|
658
|
+
color: C.textDim,
|
|
659
|
+
background: C.surface,
|
|
660
|
+
border: `1px solid ${C.border}`,
|
|
661
|
+
borderRadius: 4,
|
|
662
|
+
padding: 6,
|
|
663
|
+
margin: "4px 0 0",
|
|
664
|
+
overflow: "auto",
|
|
665
|
+
maxHeight: 120,
|
|
666
|
+
whiteSpace: "pre-wrap",
|
|
667
|
+
wordBreak: "break-all",
|
|
668
|
+
},
|
|
669
|
+
emptyState: {
|
|
670
|
+
textAlign: "center",
|
|
671
|
+
color: C.textDim,
|
|
672
|
+
padding: "24px 0",
|
|
673
|
+
fontSize: 11,
|
|
674
|
+
},
|
|
675
|
+
frontendToolsList: {
|
|
676
|
+
display: "flex",
|
|
677
|
+
flexWrap: "wrap",
|
|
678
|
+
gap: 4,
|
|
679
|
+
},
|
|
680
|
+
frontendToolBadge: {
|
|
681
|
+
display: "inline-flex",
|
|
682
|
+
alignItems: "center",
|
|
683
|
+
gap: 4,
|
|
684
|
+
background: "rgba(63,185,80,0.1)",
|
|
685
|
+
border: `1px solid rgba(63,185,80,0.3)`,
|
|
686
|
+
borderRadius: 4,
|
|
687
|
+
padding: "2px 8px",
|
|
688
|
+
fontFamily: C.mono,
|
|
689
|
+
fontSize: 10,
|
|
690
|
+
color: C.green,
|
|
691
|
+
},
|
|
692
|
+
frontendToolDot: {
|
|
693
|
+
width: 5,
|
|
694
|
+
height: 5,
|
|
695
|
+
borderRadius: "50%",
|
|
696
|
+
background: C.green,
|
|
697
|
+
flexShrink: 0,
|
|
698
|
+
},
|
|
699
|
+
sharedContext: {
|
|
700
|
+
padding: "4px 8px",
|
|
701
|
+
background: C.surface,
|
|
702
|
+
border: `1px solid ${C.border}`,
|
|
703
|
+
borderRadius: 6,
|
|
704
|
+
},
|
|
705
|
+
};
|
|
706
|
+
//# sourceMappingURL=inspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector.js","sourceRoot":"","sources":["../src/inspector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAA0C,MAAM,OAAO,CAAC;AASzG,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAW1C,MAAM,IAAI,GAAkC;IAC1C,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACtC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACpC,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;CAC7B,CAAC;AAEF,0EAA0E;AAE1E,MAAM,UAAU,SAAS,CAAC,EAAE,W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;QAC/B,YAAY,EAAE,CAAC;KACC;CACnB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { AgentifiedClient } from "@agentified/fe-client";
|
|
3
|
+
import type { InspectorState, Message } from "@agentified/fe-client";
|
|
4
|
+
export interface AgentifiedContextValue {
|
|
5
|
+
state: InspectorState;
|
|
6
|
+
messages: Message[];
|
|
7
|
+
sendMessage: (content: string) => Promise<void>;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const AgentifiedContext: import("react").Context<AgentifiedContextValue | null>;
|
|
13
|
+
export declare const AgentifiedClientContext: import("react").Context<AgentifiedClient | null>;
|
|
14
|
+
export declare function useAgentifiedClient(): AgentifiedClient;
|
|
15
|
+
export interface AgentifiedProviderProps {
|
|
16
|
+
agentUrl: string;
|
|
17
|
+
headers?: Record<string, string>;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare function AgentifiedProvider({ agentUrl, headers, children }: AgentifiedProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,eAAO,MAAM,iBAAiB,wDAAqD,CAAC;AACpF,eAAO,MAAM,uBAAuB,kDAA+C,CAAC;AAEpF,wBAAgB,mBAAmB,IAAI,gBAAgB,CAMtD;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,uBAAuB,2CAwC1F"}
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { AgentifiedClient } from "@agentified/fe-client";
|
|
4
|
+
export const AgentifiedContext = createContext(null);
|
|
5
|
+
export const AgentifiedClientContext = createContext(null);
|
|
6
|
+
export function useAgentifiedClient() {
|
|
7
|
+
const client = useContext(AgentifiedClientContext);
|
|
8
|
+
if (!client) {
|
|
9
|
+
throw new Error("useAgentifiedClient must be used within <AgentifiedProvider>");
|
|
10
|
+
}
|
|
11
|
+
return client;
|
|
12
|
+
}
|
|
13
|
+
export function AgentifiedProvider({ agentUrl, headers, children }) {
|
|
14
|
+
const client = useMemo(() => new AgentifiedClient({ agentUrl, headers }), [agentUrl, headers]);
|
|
15
|
+
const [state, setState] = useState(() => client.getState());
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setState(client.getState());
|
|
18
|
+
const sub = client.subscribe((next) => setState(next));
|
|
19
|
+
return () => sub.unsubscribe();
|
|
20
|
+
}, [client]);
|
|
21
|
+
const sendMessage = useCallback((content) => client.sendMessage(content), [client]);
|
|
22
|
+
const reset = useCallback(() => {
|
|
23
|
+
client.reset();
|
|
24
|
+
}, [client]);
|
|
25
|
+
const value = useMemo(() => ({
|
|
26
|
+
state,
|
|
27
|
+
messages: state.messages,
|
|
28
|
+
sendMessage,
|
|
29
|
+
isLoading: state.isLoading,
|
|
30
|
+
error: state.error,
|
|
31
|
+
reset,
|
|
32
|
+
}), [state, sendMessage, reset]);
|
|
33
|
+
return (_jsx(AgentifiedClientContext.Provider, { value: client, children: _jsx(AgentifiedContext.Provider, { value: value, children: children }) }));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAYzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAgC,IAAI,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAA0B,IAAI,CAAC,CAAC;AAEpF,MAAM,UAAU,mBAAmB;IACjC,MAAM,MAAM,GAAG,UAAU,CAAC,uBAAuB,CAAC,CAAC;IACnD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAQD,MAAM,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAA2B;IACzF,MAAM,MAAM,GAAG,OAAO,CACpB,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EACjD,CAAC,QAAQ,EAAE,OAAO,CAAC,CACpB,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":"","sources":["../src/use-tool.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,GAC3C,IAAI,CAMN"}
|
package/dist/use-tool.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useAgentifiedClient } from "./provider.js";
|
|
3
|
+
export function useAgentifiedTool(name, handler) {
|
|
4
|
+
const client = useAgentifiedClient();
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
client.registerToolHandler(name, handler);
|
|
7
|
+
return () => client.unregisterToolHandler(name);
|
|
8
|
+
}, [client, name, handler]);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=use-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tool.js","sourceRoot":"","sources":["../src/use-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,UAAU,iBAAiB,CAC/B,IAAY,EACZ,OAA4C;IAE5C,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAC;IACrC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,52 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentified/react",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "React hooks and components for Agentified",
|
|
3
|
+
"version": "0.0.4",
|
|
5
4
|
"type": "module",
|
|
6
|
-
"main": "
|
|
7
|
-
"
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
9
7
|
"exports": {
|
|
10
8
|
".": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"default": "./dist/index.js"
|
|
14
|
-
},
|
|
15
|
-
"require": {
|
|
16
|
-
"types": "./dist/index.d.cts",
|
|
17
|
-
"default": "./dist/index.cjs"
|
|
18
|
-
}
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
19
11
|
}
|
|
20
12
|
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/agentified/agentified",
|
|
16
|
+
"directory": "src/ts-packages/react"
|
|
17
|
+
},
|
|
21
18
|
"files": [
|
|
22
19
|
"dist"
|
|
23
20
|
],
|
|
24
|
-
"peerDependencies": {
|
|
25
|
-
"react": ">=18.0.0",
|
|
26
|
-
"@agentified/sdk": "0.0.2"
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@types/react": "^18.3.18",
|
|
30
|
-
"jsdom": "^26.0.0",
|
|
31
|
-
"react": "^18.3.1",
|
|
32
|
-
"@agentified/sdk": "0.0.2"
|
|
33
|
-
},
|
|
34
21
|
"publishConfig": {
|
|
35
22
|
"access": "public"
|
|
36
23
|
},
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": ">=18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@agentified/fe-client": "0.0.4"
|
|
42
29
|
},
|
|
43
|
-
"
|
|
44
|
-
"
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@testing-library/react": "^16.0.0",
|
|
32
|
+
"@types/react": "^18.3.0",
|
|
33
|
+
"jsdom": "^25.0.0",
|
|
34
|
+
"react": "^18.3.0",
|
|
35
|
+
"react-dom": "^18.3.0",
|
|
36
|
+
"typescript": "^5.9.0",
|
|
37
|
+
"vitest": "^2.1.0"
|
|
45
38
|
},
|
|
46
|
-
"homepage": "https://github.com/agentified/agentified/tree/main/packages/react#readme",
|
|
47
39
|
"scripts": {
|
|
48
|
-
"build": "
|
|
49
|
-
"typecheck": "tsc --noEmit",
|
|
40
|
+
"build": "tsc -p tsconfig.build.json",
|
|
50
41
|
"test": "vitest run"
|
|
51
42
|
}
|
|
52
43
|
}
|
package/dist/index.cjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
REACT_VERSION: () => REACT_VERSION
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(index_exports);
|
|
26
|
-
var REACT_VERSION = "0.0.0";
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
REACT_VERSION
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const REACT_VERSION = \"0.0.0\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,gBAAgB;","names":[]}
|
package/dist/index.d.cts
DELETED