@ai-matrx/chat 0.3.11 → 0.3.19
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 +83 -0
- package/dist/agent-copy/export.d.ts +10 -2
- package/dist/agent-copy/export.js +3 -2
- package/dist/agents/components/agent-widgets/chat-assistant/CompactAssistantInput.js +1 -1
- package/dist/agents/components/debug/SandboxFileViewer.js +1 -3
- package/dist/agents/components/inputs/AgentVariablesInline.js +1 -1
- package/dist/agents/components/inputs/smart-input/AgentTextarea.js +1 -1
- package/dist/agents/components/inputs/smart-input/InputActionButtons.js +1 -1
- package/dist/agents/components/inputs/smart-input/composer/ComposerAgentPeek.js +6 -6
- package/dist/agents/components/messages-display/TranscriptIntegrityCopyButton.js +4 -4
- package/dist/agents/components/messages-display/user/UserActionBar.js +3 -18
- package/dist/agents/components/run/AgentRunHeader.js +1 -2
- package/dist/agents/components/shared/AgentConversationColumn.js +1 -1
- package/dist/agents/components/shared/AgentHeader.js +1 -2
- package/dist/agents/components/shared/AgentHeaderMobile.js +1 -2
- package/dist/agents/components/working-document/DocumentLinkPicker.d.ts +1 -1
- package/dist/agents/components/working-document/WorkingDocumentPanel.js +1 -1
- package/dist/agents/components/working-document/documents-workspace/DocumentsListRail.js +2 -2
- package/dist/agents/components/working-document/documents-workspace/DocumentsWorkspace.js +2 -2
- package/dist/agents/hooks/useInstanceInputUndoRedo.d.ts +1 -1
- package/dist/agents/hooks/useInstanceInputUndoRedo.js +1 -1
- package/dist/agents/hooks/useWorkingDocument.js +7 -6
- package/dist/agents/model-registry/model-classes.d.ts +1 -43
- package/dist/agents/model-registry/model-classes.js +1 -40
- package/dist/agents/model-registry/parse.d.ts +1 -88
- package/dist/agents/model-registry/parse.js +1 -246
- package/dist/agents/prompt-preview/PromptPreviewContent.js +1 -3
- package/dist/agents/redux/agent-definition/selectors.d.ts +8 -8
- package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.d.ts +14 -0
- package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.js +30 -0
- package/dist/agents/redux/execution-system/client-capabilities/desktop-native.provider.js +10 -1
- package/dist/agents/redux/execution-system/instance-working-document/cx-working-document.service.d.ts +18 -16
- package/dist/agents/redux/execution-system/instance-working-document/cx-working-document.service.js +101 -52
- package/dist/agents/redux/execution-system/instance-working-document/instance-working-document.slice.d.ts +2 -2
- package/dist/agents/redux/execution-system/instance-working-document/instance-working-document.thunks.d.ts +1 -1
- package/dist/agents/redux/execution-system/instance-working-document/scratchpad.thunks.d.ts +1 -1
- package/dist/agents/redux/execution-system/message-crud/refetch-single-message.thunk.js +5 -0
- package/dist/agents/redux/execution-system/thunks/process-stream.js +2 -2
- package/dist/agents/redux/execution-system/utils/stream-block-accumulator.d.ts +14 -0
- package/dist/agents/redux/execution-system/utils/stream-block-accumulator.js +28 -0
- package/dist/agents/utils/platform-keys.d.ts +15 -0
- package/dist/agents/utils/platform-keys.js +69 -0
- package/dist/context/sources/scopes.d.ts +1 -1
- package/dist/cx-chat/components/user-input/ConversationInput.js +1 -1
- package/dist/cx-conversation/ConversationInput.js +1 -1
- package/dist/host/db-types.d.ts +23242 -23071
- package/dist/host/ui-slots.d.ts +50 -64
- package/dist/host/ui-slots.js +12 -52
- package/dist/public-chat/components/GuidedVariableInputs.js +1 -1
- package/dist/public-chat/components/PublicVariableInputs.js +1 -1
- package/dist/react.cjs +11 -23
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +11 -23
- package/dist/react.js.map +1 -1
- package/dist/surfaces/manifests/_conversation-document.manifest.js +1 -1
- package/dist/tool-call-visualization/registry/registry.js +13 -0
- package/dist/ui/composer/useTouchOnlyDevice.js +1 -1
- package/dist/ui/skills-types.d.ts +1 -275
- package/dist/ui/skills-types.js +1 -0
- package/dist/voice-agent/components/VoiceDebugPanel.js +1 -3
- package/package.json +60 -34
- package/dist/agents/components/run/run-sidebar/AgentRunsSidebar.d.ts +0 -15
- package/dist/agents/components/run/run-sidebar/AgentRunsSidebar.js +0 -201
- package/dist/agents/components/run-controls/AgentExecutionTestModal.d.ts +0 -36
- package/dist/agents/components/run-controls/AgentExecutionTestModal.js +0 -440
- package/dist/agents/components/run-controls/AgentLauncherSidebarTester.d.ts +0 -6
- package/dist/agents/components/run-controls/AgentLauncherSidebarTester.js +0 -127
- package/dist/agents/components/run-controls/AgentWidgetInvokerTester.d.ts +0 -6
- package/dist/agents/components/run-controls/AgentWidgetInvokerTester.js +0 -84
- package/dist/agents/components/run-controls/CreatorRunPanel.d.ts +0 -22
- package/dist/agents/components/run-controls/CreatorRunPanel.js +0 -108
- package/dist/agents/components/run-controls/CreatorRunTabContent.d.ts +0 -30
- package/dist/agents/components/run-controls/CreatorRunTabContent.js +0 -319
- package/dist/agents/components/run-controls/PayloadTab.d.ts +0 -5
- package/dist/agents/components/run-controls/PayloadTab.js +0 -388
- package/dist/agents/components/run-controls/TesterSettingsPanel.d.ts +0 -71
- package/dist/agents/components/run-controls/TesterSettingsPanel.js +0 -470
- package/dist/agents/components/shared/AgentOptionsMenu.d.ts +0 -8
- package/dist/agents/components/shared/AgentOptionsMenu.js +0 -776
- package/dist/agents/components/shared/AgentPeekDuplicateButton.d.ts +0 -8
- package/dist/agents/components/shared/AgentPeekDuplicateButton.js +0 -66
- package/dist/agents/components/shared/AgentSaveStatus.d.ts +0 -7
- package/dist/agents/components/shared/AgentSaveStatus.js +0 -128
- package/dist/agents/components/shared/AgentSaveTapButton.d.ts +0 -18
- package/dist/agents/components/shared/AgentSaveTapButton.js +0 -105
- package/dist/agents/components/shared/useAgentSaveAction.d.ts +0 -33
- package/dist/agents/components/shared/useAgentSaveAction.js +0 -179
- package/dist/agents/components/shell/AgentsListHeader.d.ts +0 -1
- package/dist/agents/components/shell/AgentsListHeader.js +0 -69
- package/dist/agents/components/undo-history/AgentEditHistory.d.ts +0 -9
- package/dist/agents/components/undo-history/AgentEditHistory.js +0 -244
- package/dist/agents/components/unused/AgentSharedHeader.d.ts +0 -3
- package/dist/agents/components/unused/AgentSharedHeader.js +0 -134
- package/dist/agents/components/widgets/AgentWidgetsPage.d.ts +0 -11
- package/dist/agents/components/widgets/AgentWidgetsPage.js +0 -571
- package/dist/agents/components/widgets/WidgetVariableInputs.d.ts +0 -8
- package/dist/agents/components/widgets/WidgetVariableInputs.js +0 -80
- package/dist/agents/components/widgets/build-widget-launch.d.ts +0 -70
- package/dist/agents/components/widgets/build-widget-launch.js +0 -90
- package/dist/agents/hooks/useAgentAutoSave.d.ts +0 -1
- package/dist/agents/hooks/useAgentAutoSave.js +0 -127
- package/dist/agents/hooks/useAgentBuilderWriteHandlers.d.ts +0 -9
- package/dist/agents/hooks/useAgentBuilderWriteHandlers.js +0 -102
- package/dist/agents/hooks/useAgentDuplicateFlow.d.ts +0 -25
- package/dist/agents/hooks/useAgentDuplicateFlow.js +0 -133
- package/dist/agents/hooks/useAgentUndoRedo.d.ts +0 -31
- package/dist/agents/hooks/useAgentUndoRedo.js +0 -134
- package/dist/agents/hooks/useAgentUsages.d.ts +0 -17
- package/dist/agents/hooks/useAgentUsages.js +0 -36
- package/dist/agents/hooks/useDriftAlerts.d.ts +0 -11
- package/dist/agents/hooks/useDriftAlerts.js +0 -36
- package/dist/agents/hooks/useDriftReport.d.ts +0 -20
- package/dist/agents/hooks/useDriftReport.js +0 -34
- package/dist/agents/lifecycle/useAgentLifecycleActions.d.ts +0 -17
- package/dist/agents/lifecycle/useAgentLifecycleActions.js +0 -63
- package/dist/agents/message-flags/useMessageFlags.d.ts +0 -8
- package/dist/agents/message-flags/useMessageFlags.js +0 -68
- package/dist/agents/services/agent-definition-snapshot.service.d.ts +0 -15
- package/dist/agents/services/agent-definition-snapshot.service.js +0 -20
- package/dist/agents/surface-catalog-profile.d.ts +0 -96
- package/dist/agents/surface-catalog-profile.js +0 -79
- package/dist/cx-chat/hooks/useAgentBootstrap.d.ts +0 -1
- package/dist/cx-chat/hooks/useAgentBootstrap.js +0 -110
- package/dist/host/builder-door.d.ts +0 -61
- package/dist/host/builder-door.js +0 -25
- package/dist/next/lazy/CreatorRunPanel.d.ts +0 -1
- package/dist/next/lazy/CreatorRunPanel.js +0 -11
- package/dist/ui/composer/composerSubmit.d.ts +0 -50
- package/dist/ui/composer/composerSubmit.js +0 -32
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useClipboard } from "@ai-matrx/kit/clipboard";
|
|
4
|
-
import { toast } from "../../../host/notify.js";
|
|
5
|
-
import { Badge, Button } from "@ai-matrx/design-system/controls";
|
|
6
|
-
import { useCallback, useMemo, useState } from "react";
|
|
7
|
-
import { Copy, Check } from "lucide-react";
|
|
8
|
-
import { useAppSelector } from "../../../store/hooks.js";
|
|
9
|
-
import { makeSelectAssembledRequest } from "../../redux/execution-system/selectors/aggregate.selectors.js";
|
|
10
|
-
import {
|
|
11
|
-
selectAgentContextPolicies,
|
|
12
|
-
selectAgentMessages
|
|
13
|
-
} from "../../redux/agent-definition/selectors.js";
|
|
14
|
-
import {
|
|
15
|
-
IMAGE_ROLE_META,
|
|
16
|
-
isReferenceRole,
|
|
17
|
-
variableNameOfImageUrl
|
|
18
|
-
} from "@ai-matrx/agents";
|
|
19
|
-
import { EmptyStats, StatRow, StatSection } from "./panels/shared.js";
|
|
20
|
-
import { TYPE_COLORS } from "./ContextPoliciesTab.js";
|
|
21
|
-
import { cn } from "@ai-matrx/design-system";
|
|
22
|
-
import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
|
|
23
|
-
const EMPTY_SLOTS = [];
|
|
24
|
-
const EMPTY_MAP = {};
|
|
25
|
-
function selectAgentIdForConversation(state, conversationId) {
|
|
26
|
-
return state.conversations.byConversationId[conversationId]?.agentId ?? null;
|
|
27
|
-
}
|
|
28
|
-
function selectInstanceContextMap(state, conversationId) {
|
|
29
|
-
return state.instanceContext.byConversationId[conversationId] ?? EMPTY_MAP;
|
|
30
|
-
}
|
|
31
|
-
function TypeBadge({ type }) {
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
-
"span",
|
|
34
|
-
{
|
|
35
|
-
className: cn(
|
|
36
|
-
"inline-flex items-center px-1.5 py-px rounded border text-[9px] font-mono uppercase tracking-wide",
|
|
37
|
-
TYPE_COLORS[type]
|
|
38
|
-
),
|
|
39
|
-
children: type
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
function valuePreview(value) {
|
|
44
|
-
if (value === void 0) return "undefined";
|
|
45
|
-
if (value === null) return "null";
|
|
46
|
-
if (typeof value === "string") return value;
|
|
47
|
-
try {
|
|
48
|
-
return JSON.stringify(value, null, 2);
|
|
49
|
-
} catch {
|
|
50
|
-
return String(value);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function ValueBlock({
|
|
54
|
-
value,
|
|
55
|
-
type
|
|
56
|
-
}) {
|
|
57
|
-
const text = valuePreview(value);
|
|
58
|
-
const isMultiline = type === "json" || text.length > 80 || text.includes("\n");
|
|
59
|
-
if (!isMultiline) {
|
|
60
|
-
return /* @__PURE__ */ jsx("span", { className: "font-mono text-[11px] text-foreground/90 break-all", children: text });
|
|
61
|
-
}
|
|
62
|
-
return /* @__PURE__ */ jsx("pre", { className: "font-mono text-[11px] text-foreground/90 bg-muted/30 border border-border/40 rounded px-2 py-1.5 overflow-x-auto whitespace-pre-wrap break-all", children: text });
|
|
63
|
-
}
|
|
64
|
-
function ContextEntryRow({
|
|
65
|
-
entryKey,
|
|
66
|
-
type,
|
|
67
|
-
label,
|
|
68
|
-
description,
|
|
69
|
-
value,
|
|
70
|
-
hasValue
|
|
71
|
-
}) {
|
|
72
|
-
return /* @__PURE__ */ jsxs("div", { className: "py-1.5 border-b border-border/30 last:border-b-0", children: [
|
|
73
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
74
|
-
/* @__PURE__ */ jsx("span", { className: "font-mono text-[11px] text-foreground font-semibold", children: entryKey }),
|
|
75
|
-
/* @__PURE__ */ jsx(TypeBadge, { type }),
|
|
76
|
-
label && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: label })
|
|
77
|
-
] }),
|
|
78
|
-
description && /* @__PURE__ */ jsx("div", { className: "text-[10px] text-muted-foreground/70 mt-0.5", children: description }),
|
|
79
|
-
/* @__PURE__ */ jsx("div", { className: "mt-1", children: hasValue ? /* @__PURE__ */ jsx(ValueBlock, { value, type }) : /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground/60 italic", children: "\u2014 not provided \u2014" }) })
|
|
80
|
-
] });
|
|
81
|
-
}
|
|
82
|
-
function MessagePartsView({ parts }) {
|
|
83
|
-
if (parts.length === 0) {
|
|
84
|
-
return /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground/60 italic", children: "\u2014 empty \u2014" });
|
|
85
|
-
}
|
|
86
|
-
return /* @__PURE__ */ jsx("div", { className: "space-y-1", children: parts.map((part, idx) => {
|
|
87
|
-
const partType = part.type;
|
|
88
|
-
const text = part.type === "text" ? part.text : void 0;
|
|
89
|
-
const partRole = part.role;
|
|
90
|
-
return /* @__PURE__ */ jsxs(
|
|
91
|
-
"div",
|
|
92
|
-
{
|
|
93
|
-
className: "flex items-start gap-2 py-1 border-b border-border/30 last:border-b-0",
|
|
94
|
-
children: [
|
|
95
|
-
/* @__PURE__ */ jsx("span", { className: "inline-flex items-center px-1.5 py-px rounded border text-[9px] font-mono uppercase tracking-wide bg-muted/40 border-border/40 text-muted-foreground shrink-0", children: partType }),
|
|
96
|
-
isReferenceRole(partRole) && /* @__PURE__ */ jsx(Badge, { className: "shrink-0", tone: "primary", children: IMAGE_ROLE_META[partRole].ask }),
|
|
97
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: text ? /* @__PURE__ */ jsx("span", { className: "font-mono text-[11px] text-foreground/90 break-all", children: text.length > 200 ? `${text.slice(0, 200)}\u2026` : text }) : /* @__PURE__ */ jsx("pre", { className: "font-mono text-[10px] text-foreground/70 bg-muted/20 border border-border/30 rounded px-1.5 py-1 overflow-x-auto whitespace-pre-wrap break-all max-h-32", children: valuePreview(part) }) })
|
|
98
|
-
]
|
|
99
|
-
},
|
|
100
|
-
idx
|
|
101
|
-
);
|
|
102
|
-
}) });
|
|
103
|
-
}
|
|
104
|
-
function roledImagesOf(messages) {
|
|
105
|
-
if (!Array.isArray(messages)) return [];
|
|
106
|
-
const rows = [];
|
|
107
|
-
for (const message of messages) {
|
|
108
|
-
if (!message || typeof message !== "object") continue;
|
|
109
|
-
const { role, content } = message;
|
|
110
|
-
if (role !== "user" || !Array.isArray(content)) continue;
|
|
111
|
-
for (const block of content) {
|
|
112
|
-
if (!block || typeof block !== "object") continue;
|
|
113
|
-
const b = block;
|
|
114
|
-
if (b.type !== "image" && b.type !== "video" && b.type !== "audio" || !isReferenceRole(b.role)) {
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
const source = typeof b.url === "string" ? b.url : String(b.file_id ?? "");
|
|
118
|
-
rows.push({
|
|
119
|
-
role: b.role,
|
|
120
|
-
variable: variableNameOfImageUrl(source),
|
|
121
|
-
source
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return rows;
|
|
126
|
-
}
|
|
127
|
-
function PayloadTab({ conversationId }) {
|
|
128
|
-
const { copyText } = useClipboard({
|
|
129
|
-
notify: (message, kind) => kind === "error" ? toast.error(message) : toast.success(message)
|
|
130
|
-
});
|
|
131
|
-
const assembledRequestSelector = useMemo(
|
|
132
|
-
() => makeSelectAssembledRequest(conversationId),
|
|
133
|
-
[conversationId]
|
|
134
|
-
);
|
|
135
|
-
const request = useAppSelector(assembledRequestSelector);
|
|
136
|
-
const agentId = useAppSelector(
|
|
137
|
-
(state) => selectAgentIdForConversation(state, conversationId)
|
|
138
|
-
);
|
|
139
|
-
const declaredSlots = useAppSelector(
|
|
140
|
-
(state) => agentId ? selectAgentContextPolicies(state, agentId) : void 0
|
|
141
|
-
) ?? EMPTY_SLOTS;
|
|
142
|
-
const contextMap = useAppSelector(
|
|
143
|
-
(state) => selectInstanceContextMap(state, conversationId)
|
|
144
|
-
);
|
|
145
|
-
const agentMessages = useAppSelector(
|
|
146
|
-
(state) => agentId ? selectAgentMessages(state, agentId) : void 0
|
|
147
|
-
);
|
|
148
|
-
const roledImages = roledImagesOf(agentMessages);
|
|
149
|
-
const slotsByKey = useMemo(() => {
|
|
150
|
-
const map = /* @__PURE__ */ new Map();
|
|
151
|
-
for (const slot of declaredSlots) map.set(slot.key, slot);
|
|
152
|
-
return map;
|
|
153
|
-
}, [declaredSlots]);
|
|
154
|
-
const declaredKeys = useMemo(
|
|
155
|
-
() => new Set(declaredSlots.map((s) => s.key)),
|
|
156
|
-
[declaredSlots]
|
|
157
|
-
);
|
|
158
|
-
const { slotMatched, adHoc, declaredUnset } = useMemo(() => {
|
|
159
|
-
const entries = Object.values(contextMap);
|
|
160
|
-
const matched = [];
|
|
161
|
-
const ad = [];
|
|
162
|
-
for (const e of entries) {
|
|
163
|
-
if (declaredKeys.has(e.key)) matched.push(e);
|
|
164
|
-
else ad.push(e);
|
|
165
|
-
}
|
|
166
|
-
const setKeys = new Set(matched.map((e) => e.key));
|
|
167
|
-
const unset = declaredSlots.filter((s) => !setKeys.has(s.key));
|
|
168
|
-
return { slotMatched: matched, adHoc: ad, declaredUnset: unset };
|
|
169
|
-
}, [contextMap, declaredKeys, declaredSlots]);
|
|
170
|
-
const [copied, setCopied] = useState(false);
|
|
171
|
-
const handleCopy = useCallback(() => {
|
|
172
|
-
if (!request) return;
|
|
173
|
-
try {
|
|
174
|
-
const text = JSON.stringify(request, null, 2);
|
|
175
|
-
void copyText(text).then((copied2) => {
|
|
176
|
-
if (!copied2) return;
|
|
177
|
-
setCopied(true);
|
|
178
|
-
window.setTimeout(() => setCopied(false), 1500);
|
|
179
|
-
});
|
|
180
|
-
} catch (err) {
|
|
181
|
-
console.error("Failed to copy payload:", err);
|
|
182
|
-
}
|
|
183
|
-
}, [request]);
|
|
184
|
-
if (!request) {
|
|
185
|
-
return /* @__PURE__ */ jsx(EmptyStats, { text: "Nothing to send yet \u2014 type a message or set context." });
|
|
186
|
-
}
|
|
187
|
-
const userInput = request.user_input;
|
|
188
|
-
const variables = request.variables;
|
|
189
|
-
const configOverrides = request.config_overrides;
|
|
190
|
-
const tools = request.tools;
|
|
191
|
-
const toolsReplace = request.tools_replace;
|
|
192
|
-
const clientEnvelope = request.client;
|
|
193
|
-
const clientCapabilities = clientEnvelope?.capabilities;
|
|
194
|
-
const hasContextSection = slotMatched.length > 0 || adHoc.length > 0 || declaredUnset.length > 0;
|
|
195
|
-
return /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 space-y-3", children: [
|
|
196
|
-
hasContextSection && /* @__PURE__ */ jsxs(StatSection, { title: "Request context", children: [
|
|
197
|
-
slotMatched.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-1", children: [
|
|
198
|
-
/* @__PURE__ */ jsxs("div", { className: "text-[10px] font-semibold text-muted-foreground/80 mb-0.5", children: [
|
|
199
|
-
"Slot-matched (",
|
|
200
|
-
slotMatched.length,
|
|
201
|
-
")"
|
|
202
|
-
] }),
|
|
203
|
-
/* @__PURE__ */ jsx("div", { children: slotMatched.map((entry) => {
|
|
204
|
-
const slot = slotsByKey.get(entry.key);
|
|
205
|
-
return /* @__PURE__ */ jsx(
|
|
206
|
-
ContextEntryRow,
|
|
207
|
-
{
|
|
208
|
-
entryKey: entry.key,
|
|
209
|
-
type: slot?.type ?? entry.type,
|
|
210
|
-
label: slot?.label ?? entry.label,
|
|
211
|
-
description: slot?.description,
|
|
212
|
-
value: entry.value,
|
|
213
|
-
hasValue: true
|
|
214
|
-
},
|
|
215
|
-
entry.key
|
|
216
|
-
);
|
|
217
|
-
}) })
|
|
218
|
-
] }),
|
|
219
|
-
adHoc.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2", children: [
|
|
220
|
-
/* @__PURE__ */ jsxs("div", { className: "text-[10px] font-semibold text-muted-foreground/80 mb-0.5", children: [
|
|
221
|
-
"Ad-hoc \u2014 no matching slot (",
|
|
222
|
-
adHoc.length,
|
|
223
|
-
")"
|
|
224
|
-
] }),
|
|
225
|
-
/* @__PURE__ */ jsx("div", { children: adHoc.map((entry) => /* @__PURE__ */ jsx(
|
|
226
|
-
ContextEntryRow,
|
|
227
|
-
{
|
|
228
|
-
entryKey: entry.key,
|
|
229
|
-
type: entry.type,
|
|
230
|
-
label: entry.label,
|
|
231
|
-
description: "(no slot defined on agent)",
|
|
232
|
-
value: entry.value,
|
|
233
|
-
hasValue: true
|
|
234
|
-
},
|
|
235
|
-
entry.key
|
|
236
|
-
)) })
|
|
237
|
-
] }),
|
|
238
|
-
declaredUnset.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2", children: [
|
|
239
|
-
/* @__PURE__ */ jsxs("div", { className: "text-[10px] font-semibold text-muted-foreground/80 mb-0.5", children: [
|
|
240
|
-
"Declared but unset (",
|
|
241
|
-
declaredUnset.length,
|
|
242
|
-
") \u2014 NOT sent"
|
|
243
|
-
] }),
|
|
244
|
-
/* @__PURE__ */ jsx("div", { children: declaredUnset.map((slot) => /* @__PURE__ */ jsx(
|
|
245
|
-
ContextEntryRow,
|
|
246
|
-
{
|
|
247
|
-
entryKey: slot.key,
|
|
248
|
-
type: slot.type,
|
|
249
|
-
label: slot.label,
|
|
250
|
-
description: slot.description,
|
|
251
|
-
value: void 0,
|
|
252
|
-
hasValue: false
|
|
253
|
-
},
|
|
254
|
-
slot.key
|
|
255
|
-
)) })
|
|
256
|
-
] }),
|
|
257
|
-
request.context && /* @__PURE__ */ jsxs("details", { className: "mt-2", children: [
|
|
258
|
-
/* @__PURE__ */ jsx("summary", { className: "text-[10px] font-semibold text-muted-foreground/80 cursor-pointer hover:text-foreground select-none", children: "Wire payload (raw JSON)" }),
|
|
259
|
-
/* @__PURE__ */ jsx("pre", { className: "mt-1 font-mono text-[11px] text-foreground/90 bg-muted/30 border border-border/40 rounded px-2 py-1.5 overflow-x-auto whitespace-pre-wrap break-all", children: JSON.stringify(request.context, null, 2) })
|
|
260
|
-
] })
|
|
261
|
-
] }),
|
|
262
|
-
!hasContextSection && /* @__PURE__ */ jsx(StatSection, { title: "Request context", children: /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground/60 italic py-1", children: "\u2014 no context entries and no declared slots \u2014" }) }),
|
|
263
|
-
/* @__PURE__ */ jsx(StatSection, { title: "User input", children: userInput == null ? /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground/60 italic py-1", children: "\u2014 empty (will not be sent) \u2014" }) : typeof userInput === "string" ? /* @__PURE__ */ jsx(ValueBlock, { value: userInput, type: "text" }) : /* @__PURE__ */ jsx(MessagePartsView, { parts: userInput }) }),
|
|
264
|
-
/* @__PURE__ */ jsx(StatSection, { title: "Variables", children: variables && Object.keys(variables).length > 0 ? /* @__PURE__ */ jsx("div", { children: Object.entries(variables).map(([k, v]) => /* @__PURE__ */ jsxs(
|
|
265
|
-
"div",
|
|
266
|
-
{
|
|
267
|
-
className: "py-1 border-b border-border/30 last:border-b-0",
|
|
268
|
-
children: [
|
|
269
|
-
/* @__PURE__ */ jsx("div", { className: "font-mono text-[11px] text-foreground font-semibold", children: k }),
|
|
270
|
-
/* @__PURE__ */ jsx("div", { className: "mt-0.5", children: /* @__PURE__ */ jsx(ValueBlock, { value: v }) })
|
|
271
|
-
]
|
|
272
|
-
},
|
|
273
|
-
k
|
|
274
|
-
)) }) : /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground/60 italic py-1", children: "\u2014 none \u2014" }) }),
|
|
275
|
-
roledImages.length > 0 && /* @__PURE__ */ jsx(StatSection, { title: "Reference images (sent with their roles)", children: /* @__PURE__ */ jsx("div", { children: roledImages.map((row, idx) => {
|
|
276
|
-
const value = row.variable ? variables?.[row.variable] : row.source;
|
|
277
|
-
return /* @__PURE__ */ jsxs(
|
|
278
|
-
"div",
|
|
279
|
-
{
|
|
280
|
-
className: "py-1 border-b border-border/30 last:border-b-0",
|
|
281
|
-
"data-testid": "payload-roled-image",
|
|
282
|
-
children: [
|
|
283
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-[11px]", children: [
|
|
284
|
-
/* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground", children: IMAGE_ROLE_META[row.role].ask }),
|
|
285
|
-
/* @__PURE__ */ jsxs("span", { className: "font-mono text-muted-foreground", children: [
|
|
286
|
-
"role: ",
|
|
287
|
-
row.role
|
|
288
|
-
] })
|
|
289
|
-
] }),
|
|
290
|
-
/* @__PURE__ */ jsx("div", { className: "mt-0.5 font-mono text-[10px] text-foreground/80 break-all", children: row.variable ? value ? `{{${row.variable}}} = ${valuePreview(value)}` : `{{${row.variable}}} \u2014 not set yet` : row.source })
|
|
291
|
-
]
|
|
292
|
-
},
|
|
293
|
-
`${row.role}-${idx}`
|
|
294
|
-
);
|
|
295
|
-
}) }) }),
|
|
296
|
-
/* @__PURE__ */ jsx(StatSection, { title: "Config overrides", children: configOverrides && Object.keys(configOverrides).length > 0 ? /* @__PURE__ */ jsx("pre", { className: "font-mono text-[11px] text-foreground/90 bg-muted/30 border border-border/40 rounded px-2 py-1.5 overflow-x-auto whitespace-pre-wrap break-all", children: JSON.stringify(configOverrides, null, 2) }) : /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground/60 italic py-1", children: "\u2014 defaults (no overrides) \u2014" }) }),
|
|
297
|
-
/* @__PURE__ */ jsxs(StatSection, { title: "Scope", children: [
|
|
298
|
-
/* @__PURE__ */ jsx(
|
|
299
|
-
StatRow,
|
|
300
|
-
{
|
|
301
|
-
label: "Organization ID",
|
|
302
|
-
value: request.organization_id ?? "\u2014"
|
|
303
|
-
}
|
|
304
|
-
),
|
|
305
|
-
/* @__PURE__ */ jsx(StatRow, { label: "Project ID", value: request.project_id ?? "\u2014" }),
|
|
306
|
-
/* @__PURE__ */ jsx(StatRow, { label: "Task ID", value: request.task_id ?? "\u2014" })
|
|
307
|
-
] }),
|
|
308
|
-
/* @__PURE__ */ jsxs(StatSection, { title: "Source", children: [
|
|
309
|
-
/* @__PURE__ */ jsx(StatRow, { label: "Source app", value: request.source_app ?? "\u2014" }),
|
|
310
|
-
/* @__PURE__ */ jsx(StatRow, { label: "Source feature", value: request.source_feature ?? "\u2014" })
|
|
311
|
-
] }),
|
|
312
|
-
/* @__PURE__ */ jsx(StatSection, { title: "Tools (added to agent's set)", children: tools && tools.length > 0 || toolsReplace && toolsReplace.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
313
|
-
tools && tools.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: tools.map((spec, i) => /* @__PURE__ */ jsxs(
|
|
314
|
-
"span",
|
|
315
|
-
{
|
|
316
|
-
className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded border border-border/40 bg-muted/30 font-mono text-[10px] text-foreground/90",
|
|
317
|
-
title: JSON.stringify(spec),
|
|
318
|
-
children: [
|
|
319
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70", children: humanizeIdentifier(spec.kind) }),
|
|
320
|
-
/* @__PURE__ */ jsx("span", { children: "name" in spec ? spec.name : spec.agent_id }),
|
|
321
|
-
"delegate" in spec && spec.delegate ? /* @__PURE__ */ jsx("span", { className: "text-amber-600 dark:text-amber-400", children: "\u21B3client" }) : null
|
|
322
|
-
]
|
|
323
|
-
},
|
|
324
|
-
`${spec.kind}-${"name" in spec ? spec.name : spec.agent_id}-${i}`
|
|
325
|
-
)) }),
|
|
326
|
-
toolsReplace && toolsReplace.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2", children: [
|
|
327
|
-
/* @__PURE__ */ jsxs("div", { className: "text-[10px] font-semibold text-amber-600 dark:text-amber-400 mb-0.5", children: [
|
|
328
|
-
"tools_replace \u2014 overrides agent's saved set (",
|
|
329
|
-
toolsReplace.length,
|
|
330
|
-
")"
|
|
331
|
-
] }),
|
|
332
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: toolsReplace.map((spec, i) => /* @__PURE__ */ jsxs(
|
|
333
|
-
"span",
|
|
334
|
-
{
|
|
335
|
-
className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded border border-amber-500/40 bg-amber-500/10 font-mono text-[10px] text-foreground/90",
|
|
336
|
-
title: JSON.stringify(spec),
|
|
337
|
-
children: [
|
|
338
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70", children: humanizeIdentifier(spec.kind) }),
|
|
339
|
-
/* @__PURE__ */ jsx("span", { children: "name" in spec ? spec.name : spec.agent_id })
|
|
340
|
-
]
|
|
341
|
-
},
|
|
342
|
-
`r-${spec.kind}-${"name" in spec ? spec.name : spec.agent_id}-${i}`
|
|
343
|
-
)) })
|
|
344
|
-
] })
|
|
345
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground/60 italic py-1", children: "\u2014 none \u2014" }) }),
|
|
346
|
-
/* @__PURE__ */ jsx(StatSection, { title: "Client capabilities", children: clientCapabilities && clientCapabilities.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
347
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-1", children: clientCapabilities.map((cap) => /* @__PURE__ */ jsx(
|
|
348
|
-
"span",
|
|
349
|
-
{
|
|
350
|
-
className: "inline-flex items-center px-1.5 py-0.5 rounded border border-emerald-500/40 bg-emerald-500/10 font-mono text-[10px] text-foreground/90",
|
|
351
|
-
children: cap
|
|
352
|
-
},
|
|
353
|
-
cap
|
|
354
|
-
)) }),
|
|
355
|
-
/* @__PURE__ */ jsxs("details", { children: [
|
|
356
|
-
/* @__PURE__ */ jsx("summary", { className: "text-[10px] font-semibold text-muted-foreground/80 cursor-pointer hover:text-foreground select-none", children: "Capability state (raw JSON)" }),
|
|
357
|
-
/* @__PURE__ */ jsx("pre", { className: "mt-1 font-mono text-[11px] text-foreground/90 bg-muted/30 border border-border/40 rounded px-2 py-1.5 overflow-x-auto whitespace-pre-wrap break-all", children: JSON.stringify(clientEnvelope?.state, null, 2) })
|
|
358
|
-
] })
|
|
359
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground/60 italic py-1", children: "\u2014 no surfaces declared \u2014" }) }),
|
|
360
|
-
(request.block_mode || request.snapshot || request.memory !== void 0 || request.memory_model || request.memory_scope) && /* @__PURE__ */ jsxs(StatSection, { title: "Admin flags", children: [
|
|
361
|
-
request.block_mode && /* @__PURE__ */ jsx(StatRow, { label: "Block mode", value: "true" }),
|
|
362
|
-
request.snapshot && /* @__PURE__ */ jsx(StatRow, { label: "snapshot", value: "true" }),
|
|
363
|
-
request.memory !== void 0 && /* @__PURE__ */ jsx(StatRow, { label: "memory", value: String(request.memory) }),
|
|
364
|
-
request.memory_model && /* @__PURE__ */ jsx(StatRow, { label: "Memory model", value: request.memory_model }),
|
|
365
|
-
request.memory_scope && /* @__PURE__ */ jsx(StatRow, { label: "Memory scope", value: request.memory_scope })
|
|
366
|
-
] }),
|
|
367
|
-
/* @__PURE__ */ jsxs("div", { className: "pt-2 border-t border-border/40 flex items-center justify-between gap-2", children: [
|
|
368
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground/70", children: "+ turn-1 fields added on first send" }),
|
|
369
|
-
/* @__PURE__ */ jsx(
|
|
370
|
-
Button,
|
|
371
|
-
{
|
|
372
|
-
variant: "outline",
|
|
373
|
-
onClick: handleCopy,
|
|
374
|
-
icon: copied ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {}),
|
|
375
|
-
glyphTone: copied ? "success" : void 0,
|
|
376
|
-
children: copied ? "Copied" : "Copy as JSON"
|
|
377
|
-
}
|
|
378
|
-
)
|
|
379
|
-
] }),
|
|
380
|
-
/* @__PURE__ */ jsxs("details", { children: [
|
|
381
|
-
/* @__PURE__ */ jsx("summary", { className: "text-[10px] font-semibold text-muted-foreground/80 cursor-pointer hover:text-foreground select-none", children: "Full wire payload (raw JSON)" }),
|
|
382
|
-
/* @__PURE__ */ jsx("pre", { className: "mt-1 font-mono text-[11px] text-foreground/90 bg-muted/30 border border-border/40 rounded px-2 py-1.5 overflow-x-auto whitespace-pre-wrap break-all", children: JSON.stringify(request, null, 2) })
|
|
383
|
-
] })
|
|
384
|
-
] });
|
|
385
|
-
}
|
|
386
|
-
export {
|
|
387
|
-
PayloadTab
|
|
388
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { type VariablesPanelStyle } from "../inputs/variable-input-variations/variable-input-options.js";
|
|
2
|
-
import type { ApiEndpointMode } from "../../types/instance.types.js";
|
|
3
|
-
export interface TesterSettingsController {
|
|
4
|
-
autoRun: boolean;
|
|
5
|
-
setAutoRun: (v: boolean) => void;
|
|
6
|
-
showVariablePanel: boolean;
|
|
7
|
-
setShowVariablePanel: (v: boolean) => void;
|
|
8
|
-
variablesPanelStyle: VariablesPanelStyle;
|
|
9
|
-
setVariablesPanelStyle: (v: VariablesPanelStyle) => void;
|
|
10
|
-
showPreExecutionGate: boolean;
|
|
11
|
-
setShowPreExecutionGate: (v: boolean) => void;
|
|
12
|
-
preExecutionMessage: string;
|
|
13
|
-
setPreExecutionMessage: (v: string) => void;
|
|
14
|
-
showDefinitionMessages: boolean;
|
|
15
|
-
setShowDefinitionMessages: (v: boolean) => void;
|
|
16
|
-
showDefinitionMessageContent: boolean;
|
|
17
|
-
setShowDefinitionMessageContent: (v: boolean) => void;
|
|
18
|
-
allowChat: boolean;
|
|
19
|
-
setAllowChat: (v: boolean) => void;
|
|
20
|
-
hideReasoning: boolean;
|
|
21
|
-
setHideReasoning: (v: boolean) => void;
|
|
22
|
-
hideToolResults: boolean;
|
|
23
|
-
setHideToolResults: (v: boolean) => void;
|
|
24
|
-
/** Gate — when false, the editor fields below are ignored on launch. */
|
|
25
|
-
includeEditorContext: boolean;
|
|
26
|
-
setIncludeEditorContext: (v: boolean) => void;
|
|
27
|
-
editorSelection: string;
|
|
28
|
-
setEditorSelection: (v: string) => void;
|
|
29
|
-
editorTextBefore: string;
|
|
30
|
-
setEditorTextBefore: (v: string) => void;
|
|
31
|
-
editorTextAfter: string;
|
|
32
|
-
setEditorTextAfter: (v: string) => void;
|
|
33
|
-
editorContent: string;
|
|
34
|
-
setEditorContent: (v: string) => void;
|
|
35
|
-
editorContext: string;
|
|
36
|
-
setEditorContext: (v: string) => void;
|
|
37
|
-
apiEndpointMode: ApiEndpointMode;
|
|
38
|
-
setApiEndpointMode: (v: ApiEndpointMode) => void;
|
|
39
|
-
showAutoClearToggle: boolean;
|
|
40
|
-
setShowAutoClearToggle: (v: boolean) => void;
|
|
41
|
-
autoClearConversation: boolean;
|
|
42
|
-
setAutoClearConversation: (v: boolean) => void;
|
|
43
|
-
jsonExtractionEnabled: boolean;
|
|
44
|
-
setJsonExtractionEnabled: (v: boolean) => void;
|
|
45
|
-
jsonExtractionFuzzy: boolean;
|
|
46
|
-
setJsonExtractionFuzzy: (v: boolean) => void;
|
|
47
|
-
jsonExtractionMaxResults: string;
|
|
48
|
-
setJsonExtractionMaxResults: (v: string) => void;
|
|
49
|
-
overridesJson: string;
|
|
50
|
-
setOverridesJson: (v: string) => void;
|
|
51
|
-
applicationScopeJson: string;
|
|
52
|
-
setApplicationScopeJson: (v: string) => void;
|
|
53
|
-
jsonError: string | null;
|
|
54
|
-
}
|
|
55
|
-
export interface QuickTestFeaturesController {
|
|
56
|
-
applyVariables: boolean;
|
|
57
|
-
setApplyVariables: (v: boolean) => void;
|
|
58
|
-
applyUserInput: boolean;
|
|
59
|
-
setApplyUserInput: (v: boolean) => void;
|
|
60
|
-
applyAppContext: boolean;
|
|
61
|
-
setApplyAppContext: (v: boolean) => void;
|
|
62
|
-
}
|
|
63
|
-
interface TesterSettingsPanelProps {
|
|
64
|
-
controller: TesterSettingsController;
|
|
65
|
-
/** Optional — when provided, renders the "Quick Test Features" block. */
|
|
66
|
-
quickTest?: QuickTestFeaturesController;
|
|
67
|
-
/** Prefix for DOM ids so multiple panels can coexist. */
|
|
68
|
-
idPrefix?: string;
|
|
69
|
-
}
|
|
70
|
-
export declare function TesterSettingsPanel({ controller: c, quickTest, idPrefix, }: TesterSettingsPanelProps): import("react").JSX.Element;
|
|
71
|
-
export {};
|