@iloveagents/foundry-web-ui 0.8.0 → 0.9.0
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.
|
@@ -3,12 +3,13 @@ import { useStore } from "zustand";
|
|
|
3
3
|
import { Check, ChevronDown } from "lucide-react";
|
|
4
4
|
import { reasoningEffortStore, REASONING_EFFORT_LABELS, } from "@iloveagents/foundry-agent";
|
|
5
5
|
import { cn } from "@iloveagents/foundry-web-primitives";
|
|
6
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "../ui/dropdown-menu.js";
|
|
6
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, } from "../ui/dropdown-menu.js";
|
|
7
7
|
const OPTIONS = [
|
|
8
|
-
{ value: "default", hint: "
|
|
8
|
+
{ value: "default", hint: "Use the app's configured level" },
|
|
9
9
|
{ value: "low", hint: "Answers sooner, thinks less" },
|
|
10
10
|
{ value: "medium", hint: "Good default for most questions" },
|
|
11
|
-
{ value: "high", hint: "Slower,
|
|
11
|
+
{ value: "high", hint: "Slower, better on hard problems" },
|
|
12
|
+
{ value: "xhigh", hint: "Slowest, for the hardest questions" },
|
|
12
13
|
];
|
|
13
14
|
/**
|
|
14
15
|
* Lets the user choose how hard the model thinks, per conversation.
|
|
@@ -21,5 +22,5 @@ const OPTIONS = [
|
|
|
21
22
|
export function ReasoningEffortPicker({ className }) {
|
|
22
23
|
const effort = useStore(reasoningEffortStore, (s) => s.effort);
|
|
23
24
|
const setEffort = useStore(reasoningEffortStore, (s) => s.setEffort);
|
|
24
|
-
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: cn("flex items-center gap-1 rounded-md px-2 py-1", "text-xs text-muted-foreground hover:text-foreground hover:bg-muted", "transition-colors", className), "aria-label": `
|
|
25
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: cn("flex items-center gap-1 rounded-md px-2 py-1", "text-xs text-muted-foreground hover:text-foreground hover:bg-muted", "transition-colors", className), "aria-label": `Intelligence: ${REASONING_EFFORT_LABELS[effort]}`, children: [_jsx("span", { children: REASONING_EFFORT_LABELS[effort] }), _jsx(ChevronDown, { className: "size-3.5" })] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-56", children: [_jsx(DropdownMenuLabel, { className: "text-xs font-normal text-muted-foreground", children: "Intelligence" }), OPTIONS.map((opt) => (_jsxs(DropdownMenuItem, { onSelect: () => setEffort(opt.value), className: "flex items-start gap-2", children: [_jsx(Check, { className: cn("size-4 mt-0.5 shrink-0", effort === opt.value ? "opacity-100" : "opacity-0") }), _jsxs("span", { className: "flex flex-col", children: [_jsx("span", { className: "text-sm", children: REASONING_EFFORT_LABELS[opt.value] }), _jsx("span", { className: "text-xs text-muted-foreground", children: opt.hint })] })] }, opt.value)))] })] }));
|
|
25
26
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @see https://docs.ag-ui.com/sdk/js/client/http-agent
|
|
17
17
|
* @see https://www.assistant-ui.com/docs/runtimes/custom/local
|
|
18
18
|
*/
|
|
19
|
-
import { AGUIRunner, clientToolRegistry, streamingStatusStore } from "@iloveagents/foundry-agent";
|
|
19
|
+
import { AGUIRunner, agentStateStore, clientToolRegistry, streamingStatusStore, } from "@iloveagents/foundry-agent";
|
|
20
20
|
import { tokenFetch } from "@iloveagents/foundry-agent/msal";
|
|
21
21
|
import { useAppStore } from "./app-store.js";
|
|
22
22
|
import { useDevStore } from "./dev-store.js";
|
|
@@ -159,6 +159,20 @@ export class AGUIAdapterSDK {
|
|
|
159
159
|
case "reasoning-end":
|
|
160
160
|
shouldYield = true;
|
|
161
161
|
break;
|
|
162
|
+
case "agent-state":
|
|
163
|
+
// Publish server state so pages can react to it. Not a chat
|
|
164
|
+
// message, so no yield.
|
|
165
|
+
agentStateStore.getState().setAgentState(event.state, event.patch);
|
|
166
|
+
break;
|
|
167
|
+
case "messages-snapshot":
|
|
168
|
+
case "activity":
|
|
169
|
+
case "raw":
|
|
170
|
+
// Protocol surfaces this adapter deliberately does not render:
|
|
171
|
+
// history reconciliation, generative-UI activities and provider
|
|
172
|
+
// passthrough belong to the host app, which can consume the
|
|
173
|
+
// RunnerEvent stream directly. Handled here so the switch stays
|
|
174
|
+
// exhaustive and they can never silently become "unknown".
|
|
175
|
+
break;
|
|
162
176
|
case "step-started":
|
|
163
177
|
case "step-finished":
|
|
164
178
|
// Progress only — the status store already carries the step name
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iloveagents/foundry-web-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React agent UI core for Foundry UI — chat, composer, AG-UI adapter for assistant-ui, tool cards, panels, sidebar, theme runtime, and UI stores.",
|
|
6
6
|
"keywords": [
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"tailwind-merge": "^3.5.0",
|
|
71
71
|
"react-markdown": "^10.0.0",
|
|
72
72
|
"remark-gfm": "^4.0.0",
|
|
73
|
-
"@iloveagents/foundry-agent": "^0.
|
|
74
|
-
"@iloveagents/foundry-web-primitives": "^0.
|
|
73
|
+
"@iloveagents/foundry-agent": "^0.9.0",
|
|
74
|
+
"@iloveagents/foundry-web-primitives": "^0.9.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@ag-ui/client": "^0.0.52",
|