@elizaos/app-core 2.0.0-alpha.203 → 2.0.0-alpha.204
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/package.json +5 -5
- package/packages/app-core/src/components/pages/TrajectoriesView.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/TrajectoriesView.js +12 -1
- package/packages/app-core/src/components/pages/TrajectoryDetailView.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/TrajectoryDetailView.js +29 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/app-core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.204",
|
|
4
4
|
"description": "Shared application core for elizaOS white-label agent apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -477,7 +477,7 @@
|
|
|
477
477
|
"@capacitor/keyboard": "8.0.3",
|
|
478
478
|
"@capacitor/preferences": "^8.0.1",
|
|
479
479
|
"@clack/prompts": "^1.0.0",
|
|
480
|
-
"@elizaos/agent": "^2.0.0-alpha.
|
|
480
|
+
"@elizaos/agent": "^2.0.0-alpha.204",
|
|
481
481
|
"@elizaos/app-companion": "^0.0.0",
|
|
482
482
|
"@elizaos/app-elizamaker": "^0.0.0",
|
|
483
483
|
"@elizaos/app-lifeops": "^0.0.0",
|
|
@@ -486,9 +486,9 @@
|
|
|
486
486
|
"@elizaos/app-task-coordinator": "^0.0.0",
|
|
487
487
|
"@elizaos/app-training": "^0.0.1",
|
|
488
488
|
"@elizaos/app-vincent": "^0.0.0",
|
|
489
|
-
"@elizaos/core": "^2.0.0-alpha.
|
|
490
|
-
"@elizaos/shared": "^2.0.0-alpha.
|
|
491
|
-
"@elizaos/ui": "^2.0.0-alpha.
|
|
489
|
+
"@elizaos/core": "^2.0.0-alpha.204",
|
|
490
|
+
"@elizaos/shared": "^2.0.0-alpha.204",
|
|
491
|
+
"@elizaos/ui": "^2.0.0-alpha.204",
|
|
492
492
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
493
493
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
494
494
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrajectoriesView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/pages/TrajectoriesView.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACL,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"TrajectoriesView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/pages/TrajectoriesView.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAqCf,UAAU,qBAAqB;IAC7B,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,aAAa,EACb,oBAAoB,EAAE,YAAY,EAClC,kBAAkB,EAAE,kBAAkB,GACvC,EAAE,qBAAqB,2CAkevB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, PageLayout, PagePanel, Sidebar, SidebarContent, SidebarHeader, SidebarPanel, SidebarScrollRegion, TrajectorySidebarItem, } from "@elizaos/ui";
|
|
3
3
|
import { Download, RefreshCw, Trash2, XCircle } from "lucide-react";
|
|
4
|
-
import { useCallback, useEffect, useLayoutEffect, useMemo, useState, } from "react";
|
|
4
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from "react";
|
|
5
5
|
import { client } from "../../api/client";
|
|
6
6
|
import { useApp } from "../../state/useApp";
|
|
7
7
|
import { formatTrajectoryDuration, formatTrajectoryTimestamp, formatTrajectoryTokenCount, } from "../../utils/trajectory-format";
|
|
@@ -42,6 +42,7 @@ export function TrajectoriesView({ contentHeader, selectedTrajectoryId: controll
|
|
|
42
42
|
const [searchQuery, setSearchQuery] = useState("");
|
|
43
43
|
const [page, setPage] = useState(0);
|
|
44
44
|
const pageSize = 50;
|
|
45
|
+
const previousSearchQueryRef = useRef(searchQuery);
|
|
45
46
|
const [exporting, setExporting] = useState(false);
|
|
46
47
|
const [deletingTrajectoryId, setDeletingTrajectoryId] = useState(null);
|
|
47
48
|
const [clearingAll, setClearingAll] = useState(false);
|
|
@@ -76,6 +77,16 @@ export function TrajectoriesView({ contentHeader, selectedTrajectoryId: controll
|
|
|
76
77
|
useEffect(() => {
|
|
77
78
|
void loadTrajectories();
|
|
78
79
|
}, [loadTrajectories]);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
const previousSearchQuery = previousSearchQueryRef.current;
|
|
82
|
+
if (previousSearchQuery === searchQuery) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
previousSearchQueryRef.current = searchQuery;
|
|
86
|
+
if (selectedTrajectoryId != null) {
|
|
87
|
+
onSelectTrajectory?.(null);
|
|
88
|
+
}
|
|
89
|
+
}, [searchQuery, selectedTrajectoryId, onSelectTrajectory]);
|
|
79
90
|
const handleExport = async (format, includePrompts) => {
|
|
80
91
|
setExporting(true);
|
|
81
92
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrajectoryDetailView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/pages/TrajectoryDetailView.tsx"],"names":[],"mappings":"AAqFA,UAAU,yBAAyB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"TrajectoryDetailView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/pages/TrajectoryDetailView.tsx"],"names":[],"mappings":"AAqFA,UAAU,yBAAyB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAiCD,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,MAAM,GACP,EAAE,yBAAyB,2CA4U3B"}
|
|
@@ -58,6 +58,20 @@ function formatTrajectoryStepLabel(value, fallback) {
|
|
|
58
58
|
function estimateCost(promptTokens, completionTokens, model) {
|
|
59
59
|
return estimateTokenCost(promptTokens, completionTokens, model);
|
|
60
60
|
}
|
|
61
|
+
function formatProviderPayload(value) {
|
|
62
|
+
if (value == null) {
|
|
63
|
+
return "null";
|
|
64
|
+
}
|
|
65
|
+
if (typeof value === "string") {
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
return JSON.stringify(value, null, 2);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return String(value);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
61
75
|
export function TrajectoryDetailView({ trajectoryId, onBack, }) {
|
|
62
76
|
const { t, copyToClipboard } = useApp();
|
|
63
77
|
const [loading, setLoading] = useState(true);
|
|
@@ -82,6 +96,7 @@ export function TrajectoryDetailView({ trajectoryId, onBack, }) {
|
|
|
82
96
|
void loadDetail();
|
|
83
97
|
}, [loadDetail]);
|
|
84
98
|
const llmCalls = detail?.llmCalls ?? [];
|
|
99
|
+
const providerAccesses = detail?.providerAccesses ?? [];
|
|
85
100
|
const trajectory = detail?.trajectory;
|
|
86
101
|
const pipelineNodes = useMemo(() => buildPipelineNodes(llmCalls, trajectory?.status ?? "active"), [llmCalls, trajectory?.status]);
|
|
87
102
|
const filteredCalls = useMemo(() => {
|
|
@@ -128,13 +143,25 @@ export function TrajectoryDetailView({ trajectoryId, onBack, }) {
|
|
|
128
143
|
value: formatTrajectoryTokenCount(totalPromptTokens + totalCompletionTokens, { emptyLabel: "—" }),
|
|
129
144
|
},
|
|
130
145
|
];
|
|
131
|
-
return (_jsxs("div", { className: "flex h-full min-h-0 flex-col gap-4", children: [orchestratorData ? (_jsxs(PagePanel, { variant: "section", className: "p-5", children: [_jsx("div", { className: "text-xs-tight font-semibold uppercase tracking-[0.16em] text-muted/70", children: t("trajectorydetailview.Orchestrator") }), _jsxs("div", { className: "mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-3", children: [_jsxs(PagePanel.SummaryCard, { compact: true, className: "px-4 py-3", children: [_jsx("div", { className: "text-xs-tight uppercase tracking-[0.14em] text-muted/70", children: t("trajectorydetailview.DecisionType") }), _jsx("div", { className: "mt-2 text-sm font-semibold text-txt", children: String(orchestratorData.decisionType ?? "—") })] }), _jsxs(PagePanel.SummaryCard, { compact: true, className: "px-4 py-3", children: [_jsx("div", { className: "text-xs-tight uppercase tracking-[0.14em] text-muted/70", children: t("trajectorydetailview.Task") }), _jsx("div", { className: "mt-2 text-sm font-semibold text-txt", children: String(orchestratorData.taskLabel ?? "—") })] }), _jsxs(PagePanel.SummaryCard, { compact: true, className: "px-4 py-3", children: [_jsx("div", { className: "text-xs-tight uppercase tracking-[0.14em] text-muted/70", children: t("trajectorydetailview.Session1") }), _jsx("div", { className: "mt-2 break-all font-mono text-xs-tight text-txt", children: String(orchestratorData.sessionId ?? "—") })] })] })] })) : null,
|
|
146
|
+
return (_jsxs("div", { className: "flex h-full min-h-0 flex-col gap-4", children: [orchestratorData ? (_jsxs(PagePanel, { variant: "section", className: "p-5", children: [_jsx("div", { className: "text-xs-tight font-semibold uppercase tracking-[0.16em] text-muted/70", children: t("trajectorydetailview.Orchestrator") }), _jsxs("div", { className: "mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-3", children: [_jsxs(PagePanel.SummaryCard, { compact: true, className: "px-4 py-3", children: [_jsx("div", { className: "text-xs-tight uppercase tracking-[0.14em] text-muted/70", children: t("trajectorydetailview.DecisionType") }), _jsx("div", { className: "mt-2 text-sm font-semibold text-txt", children: String(orchestratorData.decisionType ?? "—") })] }), _jsxs(PagePanel.SummaryCard, { compact: true, className: "px-4 py-3", children: [_jsx("div", { className: "text-xs-tight uppercase tracking-[0.14em] text-muted/70", children: t("trajectorydetailview.Task") }), _jsx("div", { className: "mt-2 text-sm font-semibold text-txt", children: String(orchestratorData.taskLabel ?? "—") })] }), _jsxs(PagePanel.SummaryCard, { compact: true, className: "px-4 py-3", children: [_jsx("div", { className: "text-xs-tight uppercase tracking-[0.14em] text-muted/70", children: t("trajectorydetailview.Session1") }), _jsx("div", { className: "mt-2 break-all font-mono text-xs-tight text-txt", children: String(orchestratorData.sessionId ?? "—") })] })] })] })) : null, trajectory.metadata &&
|
|
147
|
+
Object.keys(trajectory.metadata).length > 0 &&
|
|
148
|
+
formatProviderPayload(trajectory.metadata).trim().length > 0 ? (_jsxs(PagePanel, { variant: "section", className: "p-5", children: [_jsx("div", { className: "text-xs-tight font-semibold uppercase tracking-[0.16em] text-muted/70", children: t("trajectorydetailview.Metadata", {
|
|
149
|
+
defaultValue: "Metadata",
|
|
150
|
+
}) }), _jsx("pre", { className: "mt-4 max-h-[20rem] overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded-2xl border border-border/50 bg-bg/60 px-4 py-4 text-xs leading-6 text-txt", children: formatProviderPayload(trajectory.metadata) })] })) : null, llmCalls.length > 0 ? (_jsxs(PagePanel, { variant: "section", className: "px-5 py-4", children: [_jsx("div", { className: "mb-3 text-xs-tight font-semibold uppercase tracking-[0.16em] text-muted/70", children: t("trajectorydetailview.Pipeline", {
|
|
132
151
|
defaultValue: "Pipeline",
|
|
133
152
|
}) }), _jsx(TrajectoryPipelineGraph, { nodes: pipelineNodes, activeStageId: activeStage, onStageClick: handleStageClick }), activeStage && activeStage !== "input" ? (_jsxs("div", { className: "mt-3 flex items-center gap-2 text-xs text-muted", children: [_jsx("span", { children: t("trajectorydetailview.ShowingCalls", {
|
|
134
153
|
defaultValue: "Showing {{count}} {{stage}} calls",
|
|
135
154
|
count: filteredCalls.length,
|
|
136
155
|
stage: activeStage.replace(/_/g, " "),
|
|
137
|
-
}) }), _jsx("button", { type: "button", onClick: () => setActiveStage(null), className: "rounded p-0.5 hover:bg-muted/10", children: _jsx(X, { className: "h-3 w-3" }) })] })) : null] })) : null,
|
|
156
|
+
}) }), _jsx("button", { type: "button", onClick: () => setActiveStage(null), className: "rounded p-0.5 hover:bg-muted/10", children: _jsx(X, { className: "h-3 w-3" }) })] })) : null] })) : null, providerAccesses.length > 0 ? (_jsxs(PagePanel, { variant: "section", className: "px-5 py-4", children: [_jsx("div", { className: "mb-3 text-xs-tight font-semibold uppercase tracking-[0.16em] text-muted/70", children: t("trajectorydetailview.ProviderAccesses", {
|
|
157
|
+
defaultValue: "Provider Accesses",
|
|
158
|
+
}) }), _jsx("div", { className: "space-y-4", children: providerAccesses.map((access, index) => (_jsxs(PagePanel, { variant: "inset", className: "p-4", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("div", { className: "text-[11px] font-semibold uppercase tracking-[0.16em] text-muted", children: [t("trajectorydetailview.ProviderAccess", {
|
|
159
|
+
defaultValue: "Provider Access",
|
|
160
|
+
}), " ", "#", index + 1] }), _jsx("div", { className: "text-sm font-semibold text-txt", children: access.providerName || "unknown" }), _jsx("div", { className: "text-xs-tight text-muted", children: access.purpose || "—" })] }), access.query ? (_jsxs("div", { className: "mt-4", children: [_jsx("div", { className: "text-xs-tight font-semibold uppercase tracking-[0.14em] text-muted/70", children: t("trajectorydetailview.Query", {
|
|
161
|
+
defaultValue: "Query",
|
|
162
|
+
}) }), _jsx("pre", { className: "mt-2 max-h-[18rem] overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded-2xl border border-border/50 bg-bg/60 px-4 py-4 text-xs leading-6 text-txt", children: formatProviderPayload(access.query) })] })) : null, _jsxs("div", { className: "mt-4", children: [_jsx("div", { className: "text-xs-tight font-semibold uppercase tracking-[0.14em] text-muted/70", children: t("trajectorydetailview.Data", {
|
|
163
|
+
defaultValue: "Data",
|
|
164
|
+
}) }), _jsx("pre", { className: "mt-2 max-h-[18rem] overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded-2xl border border-border/50 bg-bg/60 px-4 py-4 text-xs leading-6 text-txt", children: formatProviderPayload(access.data) })] })] }, access.id))) })] })) : null, _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto pr-1", children: _jsx("div", { className: "space-y-4 pb-1", children: llmCalls.length === 0 ? (_jsx(PagePanel.Empty, { variant: "surface", className: "min-h-[18rem]", title: t("trajectorydetailview.NoCapturedCalls"), description: t("trajectorydetailview.NoLLMCallsRecorde") })) : (filteredCalls.map((call) => (_jsx(TrajectoryLlmCallCard, { callLabel: `#${(callIndexMap.get(call.id) ?? 0) + 1}`, model: call.model, purposeLabel: formatTrajectoryStepLabel(call.stepType || call.purpose || call.actionType, t("trajectorydetailview.Response")), latencyLabel: formatTrajectoryDuration(call.latencyMs), tokensLabel: t("trajectorydetailview.Tokens"), totalTokensValue: formatTrajectoryTokenCount((call.promptTokens ?? 0) + (call.completionTokens ?? 0), { emptyLabel: "—" }), tokenBreakdownMeta: `${formatTrajectoryTokenCount(call.promptTokens ?? 0, { emptyLabel: "—" })}↑ • ${formatTrajectoryTokenCount(call.completionTokens ?? 0, {
|
|
138
165
|
emptyLabel: "—",
|
|
139
166
|
})} ↓`, costLabel: t("trajectorydetailview.Cost"), costValue: estimateCost(call.promptTokens ?? 0, call.completionTokens ?? 0, call.model), temperatureLabel: t("trajectorydetailview.Temp"), temperatureValue: call.temperature, maxLabel: t("trajectorydetailview.Max"), maxValue: call.maxTokens > 0 ? call.maxTokens : "—", systemPrompt: call.systemPrompt, systemPromptButtonLabel: t("trajectorydetailview.SystemPrompt"), systemLabel: t("trajectorydetailview.System"), systemLinesLabel: `${call.systemPrompt?.split("\n").length ?? 0} ${t("trajectorydetailview.lines")}`, systemCollapseLabel: t("trajectorydetailview.Collapse", {
|
|
140
167
|
defaultValue: "Collapse",
|