@axiom-lattice/react-sdk 2.1.77 → 2.1.79

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/dist/index.d.mts CHANGED
@@ -769,10 +769,24 @@ interface ChatingProps {
769
769
  * When provided, overrides the shell config's enableModelSelector
770
770
  */
771
771
  showModelSelector?: boolean;
772
+ /** Show database picker in sender footer. Overrides shell config enableDatabaseSlot */
773
+ showDatabaseSlot?: boolean;
774
+ /** Show skill picker in sender footer. Overrides shell config enableSkillSlot */
775
+ showSkillSlot?: boolean;
776
+ /** Show agent picker in sender footer. Overrides shell config enableAgentSlot */
777
+ showAgentSlot?: boolean;
778
+ /** Show metrics data source picker in sender footer. Overrides shell config enableMetricsDataSourceSlot */
779
+ showMetricsDataSourceSlot?: boolean;
772
780
  showEmptyState?: boolean;
773
781
  emptyStateGreeting?: React__default.ReactNode;
774
782
  emptyStateQuestion?: string;
775
783
  welcomePrefix?: string;
784
+ /** Context string injected before the first user message (e.g. workflow context) */
785
+ systemContext?: string;
786
+ /** Auto-send this message when agent becomes idle (thread ready, not loading) */
787
+ initialMessage?: string | null;
788
+ /** Called after initialMessage has been sent */
789
+ onInitialMessageSent?: () => void;
776
790
  }
777
791
  declare const Chating: React__default.FC<ChatingProps>;
778
792
 
package/dist/index.d.ts CHANGED
@@ -769,10 +769,24 @@ interface ChatingProps {
769
769
  * When provided, overrides the shell config's enableModelSelector
770
770
  */
771
771
  showModelSelector?: boolean;
772
+ /** Show database picker in sender footer. Overrides shell config enableDatabaseSlot */
773
+ showDatabaseSlot?: boolean;
774
+ /** Show skill picker in sender footer. Overrides shell config enableSkillSlot */
775
+ showSkillSlot?: boolean;
776
+ /** Show agent picker in sender footer. Overrides shell config enableAgentSlot */
777
+ showAgentSlot?: boolean;
778
+ /** Show metrics data source picker in sender footer. Overrides shell config enableMetricsDataSourceSlot */
779
+ showMetricsDataSourceSlot?: boolean;
772
780
  showEmptyState?: boolean;
773
781
  emptyStateGreeting?: React__default.ReactNode;
774
782
  emptyStateQuestion?: string;
775
783
  welcomePrefix?: string;
784
+ /** Context string injected before the first user message (e.g. workflow context) */
785
+ systemContext?: string;
786
+ /** Auto-send this message when agent becomes idle (thread ready, not loading) */
787
+ initialMessage?: string | null;
788
+ /** Called after initialMessage has been sent */
789
+ onInitialMessageSent?: () => void;
776
790
  }
777
791
  declare const Chating: React__default.FC<ChatingProps>;
778
792
 
package/dist/index.js CHANGED
@@ -8804,7 +8804,7 @@ var import_antd72 = require("antd");
8804
8804
 
8805
8805
  // src/components/Chat/Chating.tsx
8806
8806
  var import_icons37 = require("@ant-design/icons");
8807
- var import_x7 = require("@ant-design/x");
8807
+ var import_x6 = require("@ant-design/x");
8808
8808
 
8809
8809
  // src/components/Chat/MessageList.tsx
8810
8810
  var import_x3 = require("@ant-design/x");
@@ -18090,142 +18090,10 @@ var TopologyNode_default = TopologyNode;
18090
18090
 
18091
18091
  // src/components/Chat/CopilotPanel.tsx
18092
18092
  var import_react61 = require("react");
18093
- var import_x4 = require("@ant-design/x");
18094
18093
  var import_antd54 = require("antd");
18095
18094
  var import_icons31 = require("@ant-design/icons");
18096
18095
  var import_jsx_runtime73 = require("react/jsx-runtime");
18097
18096
  var { Text: Text25 } = import_antd54.Typography;
18098
- var CopilotPanelChatBody = ({ workflowContext, initialMessage, onInitialMessageSent }) => {
18099
- const {
18100
- messages,
18101
- isLoading,
18102
- error: chatError,
18103
- sendMessage,
18104
- stopStreaming,
18105
- threadId
18106
- } = useAgentChat();
18107
- const [inputValue, setInputValue] = (0, import_react61.useState)("");
18108
- const contextSentRef = (0, import_react61.useRef)(false);
18109
- const initialMessageSentRef = (0, import_react61.useRef)(false);
18110
- const prevLoadingRef = (0, import_react61.useRef)(false);
18111
- const workflowId = workflowContext?.id;
18112
- const workflowName = workflowContext?.name;
18113
- (0, import_react61.useEffect)(() => {
18114
- contextSentRef.current = false;
18115
- }, [threadId]);
18116
- (0, import_react61.useEffect)(() => {
18117
- initialMessageSentRef.current = false;
18118
- }, [threadId]);
18119
- (0, import_react61.useEffect)(() => {
18120
- const wasLoading = prevLoadingRef.current;
18121
- prevLoadingRef.current = isLoading;
18122
- if (wasLoading && !isLoading && initialMessage && threadId && !initialMessageSentRef.current) {
18123
- initialMessageSentRef.current = true;
18124
- const message23 = initialMessage.trim();
18125
- if (message23) {
18126
- const formattedMessage = [
18127
- `Purpose: ${message23}`,
18128
- "",
18129
- `Configure the topology for workflow "${workflowId}" based on this purpose. Create sub-agents, set up the processing pipeline, and wire them together with topology edges.`,
18130
- `The current name is a placeholder \u2014 feel free to update it via update_processing_agent if you have a better one.`
18131
- ].join("\n");
18132
- sendMessage({
18133
- input: { message: formattedMessage },
18134
- streaming: true
18135
- });
18136
- onInitialMessageSent?.();
18137
- }
18138
- }
18139
- }, [isLoading, initialMessage, threadId, sendMessage, onInitialMessageSent, workflowId, workflowName]);
18140
- const handleSubmit = (0, import_react61.useCallback)(
18141
- (nextContent) => {
18142
- if (!nextContent.trim()) return;
18143
- let finalContent = nextContent;
18144
- if (workflowId && workflowName && !contextSentRef.current) {
18145
- finalContent = `[Context: You're viewing workflow "${workflowName}" (agent: ${workflowId})]
18146
- User: ${nextContent}`;
18147
- contextSentRef.current = true;
18148
- }
18149
- sendMessage({
18150
- input: { message: finalContent },
18151
- streaming: true
18152
- });
18153
- setInputValue("");
18154
- },
18155
- [workflowId, workflowName, sendMessage]
18156
- );
18157
- const isEmpty = messages.length === 0 && !isLoading;
18158
- const showContentLoading = isLoading && messages.length === 0;
18159
- const hasContent = !isEmpty;
18160
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
18161
- "div",
18162
- {
18163
- style: {
18164
- flex: 1,
18165
- minHeight: 0,
18166
- display: "flex",
18167
- flexDirection: "column",
18168
- padding: 0
18169
- },
18170
- children: [
18171
- isEmpty && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
18172
- "div",
18173
- {
18174
- style: {
18175
- display: "flex",
18176
- flexDirection: "column",
18177
- justifyContent: "center",
18178
- alignItems: "center",
18179
- height: "100%",
18180
- textAlign: "center",
18181
- gap: 4
18182
- },
18183
- children: [
18184
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text25, { strong: true, children: "Workflow Builder" }),
18185
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text25, { type: "secondary", children: "Ask me to design, review, or modify your workflows" })
18186
- ]
18187
- }
18188
- ),
18189
- showContentLoading && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18190
- "div",
18191
- {
18192
- style: {
18193
- display: "flex",
18194
- justifyContent: "center",
18195
- alignItems: "center",
18196
- height: "100%"
18197
- },
18198
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_antd54.Spin, {})
18199
- }
18200
- ),
18201
- hasContent && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { style: { flex: 1, minHeight: 0, display: "flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(MessageList, { messages }) }),
18202
- chatError && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { style: { padding: "8px 8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text25, { type: "danger", children: chatError.message }) }),
18203
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18204
- "div",
18205
- {
18206
- style: {
18207
- padding: "12px 8px",
18208
- borderTop: "1px solid #f0f0f0",
18209
- flexShrink: 0
18210
- },
18211
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18212
- import_x4.Sender,
18213
- {
18214
- value: inputValue,
18215
- placeholder: "Ask about workflows...",
18216
- onChange: setInputValue,
18217
- onSubmit: handleSubmit,
18218
- loading: isLoading,
18219
- onCancel: () => stopStreaming(),
18220
- allowSpeech: false
18221
- }
18222
- )
18223
- }
18224
- )
18225
- ]
18226
- }
18227
- );
18228
- };
18229
18097
  var CopilotPanel = ({
18230
18098
  workflowContext,
18231
18099
  onClose,
@@ -18235,6 +18103,21 @@ var CopilotPanel = ({
18235
18103
  }) => {
18236
18104
  const client = useClient("agent-architect");
18237
18105
  const threadId = workflowContext?.id ? `${client.tenantId}:${workflowContext.id}` : null;
18106
+ const systemContext = (0, import_react61.useMemo)(() => {
18107
+ if (workflowContext?.id && workflowContext?.name) {
18108
+ return `[Context: You're viewing workflow "${workflowContext.name}" (agent: ${workflowContext.id})]`;
18109
+ }
18110
+ return void 0;
18111
+ }, [workflowContext]);
18112
+ const initialMessageContent = (0, import_react61.useMemo)(() => {
18113
+ if (!initialMessage || !workflowContext?.id) return void 0;
18114
+ return [
18115
+ `Purpose: ${initialMessage.trim()}`,
18116
+ "",
18117
+ `Configure the topology for workflow "${workflowContext.id}" based on this purpose. Create sub-agents, set up the processing pipeline, and wire them together with topology edges.`,
18118
+ `The current name is a placeholder \u2014 feel free to update it via update_processing_agent if you have a better one.`
18119
+ ].join("\n");
18120
+ }, [initialMessage, workflowContext?.id]);
18238
18121
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
18239
18122
  "div",
18240
18123
  {
@@ -18286,10 +18169,16 @@ var CopilotPanel = ({
18286
18169
  options: { streaming: true },
18287
18170
  onToolCompleted,
18288
18171
  children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18289
- CopilotPanelChatBody,
18172
+ Chating,
18290
18173
  {
18291
- workflowContext,
18292
- initialMessage,
18174
+ showHeader: false,
18175
+ showEmptyState: false,
18176
+ showDatabaseSlot: false,
18177
+ showSkillSlot: false,
18178
+ showAgentSlot: false,
18179
+ showMetricsDataSourceSlot: false,
18180
+ systemContext,
18181
+ initialMessage: initialMessageContent,
18293
18182
  onInitialMessageSent
18294
18183
  }
18295
18184
  )
@@ -18530,6 +18419,7 @@ function TopologyFlowInner({
18530
18419
  selectedWorkflowId,
18531
18420
  onSelectWorkflow,
18532
18421
  onCreateWorkflow,
18422
+ onDeleteWorkflow,
18533
18423
  nodes: initialNodes,
18534
18424
  edges: initialEdges
18535
18425
  }) {
@@ -18661,7 +18551,8 @@ function TopologyFlowInner({
18661
18551
  display: "flex",
18662
18552
  alignItems: "center",
18663
18553
  gap: 6,
18664
- padding: "6px 14px",
18554
+ height: 32,
18555
+ padding: "0 14px",
18665
18556
  background: "rgba(255,255,255,0.95)",
18666
18557
  borderRadius: 10,
18667
18558
  boxShadow: "0 2px 12px rgba(0,0,0,0.08)",
@@ -18679,6 +18570,42 @@ function TopologyFlowInner({
18679
18570
  ]
18680
18571
  }
18681
18572
  ),
18573
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
18574
+ "div",
18575
+ {
18576
+ style: {
18577
+ position: "absolute",
18578
+ top: 12,
18579
+ right: 12,
18580
+ zIndex: 10,
18581
+ display: "flex",
18582
+ alignItems: "center",
18583
+ height: 32,
18584
+ padding: "0 14px",
18585
+ background: "rgba(255,255,255,0.95)",
18586
+ borderRadius: 10,
18587
+ boxShadow: "0 2px 12px rgba(0,0,0,0.08)",
18588
+ border: "1px solid #f0f0f0"
18589
+ },
18590
+ children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
18591
+ import_antd56.Popconfirm,
18592
+ {
18593
+ title: "Delete workflow",
18594
+ description: "This will delete the workflow and all associated topology. This action cannot be undone.",
18595
+ onConfirm: () => onDeleteWorkflow(selectedAgent.id),
18596
+ okText: "Delete",
18597
+ cancelText: "Cancel",
18598
+ okButtonProps: { danger: true },
18599
+ children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
18600
+ import_icons32.DeleteOutlined,
18601
+ {
18602
+ style: { color: "#ff4d4f", cursor: "pointer", fontSize: 15 }
18603
+ }
18604
+ )
18605
+ }
18606
+ )
18607
+ }
18608
+ ),
18682
18609
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
18683
18610
  import_antd56.Modal,
18684
18611
  {
@@ -18707,7 +18634,7 @@ function TopologyFlowInner({
18707
18634
  ] });
18708
18635
  }
18709
18636
  var TopologyAutomationView = () => {
18710
- const { get } = useApi();
18637
+ const { get, del } = useApi();
18711
18638
  const [agents, setAgents] = (0, import_react63.useState)([]);
18712
18639
  const [agentNameMap, setAgentNameMap] = (0, import_react63.useState)(/* @__PURE__ */ new Map());
18713
18640
  const [selectedWorkflowId, setSelectedWorkflowId] = (0, import_react63.useState)(null);
@@ -18781,6 +18708,16 @@ var TopologyAutomationView = () => {
18781
18708
  const handleSelectWorkflow = (0, import_react63.useCallback)((id) => {
18782
18709
  setSelectedWorkflowId(id);
18783
18710
  }, []);
18711
+ const handleDeleteWorkflow = (0, import_react63.useCallback)(async (id) => {
18712
+ try {
18713
+ await del(`/api/assistants/${id}`);
18714
+ setSelectedWorkflowId(null);
18715
+ await fetchData();
18716
+ } catch (err) {
18717
+ const message23 = err instanceof Error ? err.message : "Failed to delete workflow";
18718
+ setError(message23);
18719
+ }
18720
+ }, [del, fetchData]);
18784
18721
  const selectedAgent = (0, import_react63.useMemo)(
18785
18722
  () => agents.find((a) => a.id === selectedWorkflowId) || null,
18786
18723
  [agents, selectedWorkflowId]
@@ -18851,6 +18788,7 @@ var TopologyAutomationView = () => {
18851
18788
  selectedWorkflowId,
18852
18789
  onSelectWorkflow: handleSelectWorkflow,
18853
18790
  onCreateWorkflow: () => setIsCreateModalOpen(true),
18791
+ onDeleteWorkflow: handleDeleteWorkflow,
18854
18792
  nodes,
18855
18793
  edges
18856
18794
  }
@@ -19391,7 +19329,7 @@ function RunSummaryBanner({ run, agentName }) {
19391
19329
  }
19392
19330
  );
19393
19331
  }
19394
- var RunDetail = ({ run, agentName, open, onClose, onRunUpdate, autoRefresh }) => {
19332
+ var RunDetail = ({ run, agentName, open, onClose, onRunUpdate, autoRefresh, onAutoRefreshChange }) => {
19395
19333
  const { get } = useApi();
19396
19334
  const [steps, setSteps] = (0, import_react65.useState)([]);
19397
19335
  const [loading, setLoading] = (0, import_react65.useState)(false);
@@ -19449,7 +19387,11 @@ var RunDetail = ({ run, agentName, open, onClose, onRunUpdate, autoRefresh }) =>
19449
19387
  {
19450
19388
  title: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_antd57.Space, { children: [
19451
19389
  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text27, { strong: true, children: "Pipeline Execution" }),
19452
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_antd57.Tag, { color: "purple", style: { fontSize: 11 }, children: "Flow View" })
19390
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_antd57.Tag, { color: "purple", style: { fontSize: 11 }, children: "Flow View" }),
19391
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_antd57.Space, { size: 4, style: { marginLeft: 12 }, children: [
19392
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text27, { type: "secondary", style: { fontSize: 11 }, children: "Auto-refresh" }),
19393
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_antd57.Switch, { size: "small", checked: autoRefresh, onChange: onAutoRefreshChange })
19394
+ ] })
19453
19395
  ] }),
19454
19396
  placement: "right",
19455
19397
  width: "90%",
@@ -19477,7 +19419,7 @@ var RunDetail = ({ run, agentName, open, onClose, onRunUpdate, autoRefresh }) =>
19477
19419
  };
19478
19420
  var POLLING_INTERVAL = 3e3;
19479
19421
  var TopologyRuntimeView = () => {
19480
- const { get } = useApi();
19422
+ const { get, del } = useApi();
19481
19423
  const [runs, setRuns] = (0, import_react65.useState)([]);
19482
19424
  const [agentNames, setAgentNames] = (0, import_react65.useState)({});
19483
19425
  const [loading, setLoading] = (0, import_react65.useState)(true);
@@ -19491,6 +19433,16 @@ var TopologyRuntimeView = () => {
19491
19433
  );
19492
19434
  setSelectedRun((prev) => prev?.id === updated.id ? updated : prev);
19493
19435
  }, []);
19436
+ const handleDeleteRun = (0, import_react65.useCallback)(async (runId) => {
19437
+ try {
19438
+ await del(`/api/workflows/runs/${runId}`);
19439
+ setRuns((prev) => prev.filter((r) => r.id !== runId));
19440
+ setSelectedRun((prev) => prev?.id === runId ? null : prev);
19441
+ } catch (err) {
19442
+ const message23 = err instanceof Error ? err.message : "Failed to delete run";
19443
+ setError(message23);
19444
+ }
19445
+ }, [del]);
19494
19446
  const refreshRuns = (0, import_react65.useCallback)(async () => {
19495
19447
  setLoading(true);
19496
19448
  try {
@@ -19573,24 +19525,13 @@ var TopologyRuntimeView = () => {
19573
19525
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { style: { padding: 16, overflow: "auto", height: "100%" }, children: [
19574
19526
  /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 16 }, children: [
19575
19527
  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Title5, { level: 5, style: { marginBottom: 0 }, children: "Workflow Runs" }),
19576
- /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_antd57.Space, { size: 8, children: [
19577
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text27, { type: "secondary", style: { fontSize: 11 }, children: "Auto-refresh" }),
19578
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
19579
- import_antd57.Switch,
19580
- {
19581
- size: "small",
19582
- checked: autoRefresh,
19583
- onChange: setAutoRefresh
19584
- }
19585
- ),
19586
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_antd57.Tooltip, { title: "Refresh now", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
19587
- import_icons33.ReloadOutlined,
19588
- {
19589
- style: { cursor: "pointer", color: "#999" },
19590
- onClick: () => refreshRuns()
19591
- }
19592
- ) })
19593
- ] })
19528
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_antd57.Tooltip, { title: "Refresh now", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
19529
+ import_icons33.ReloadOutlined,
19530
+ {
19531
+ style: { cursor: "pointer", color: "#999" },
19532
+ onClick: () => refreshRuns()
19533
+ }
19534
+ ) })
19594
19535
  ] }),
19595
19536
  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
19596
19537
  import_antd57.List,
@@ -19632,7 +19573,25 @@ var TopologyRuntimeView = () => {
19632
19573
  run.totalEdges
19633
19574
  ] }),
19634
19575
  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_antd57.Tag, { color: sc.color, icon: sc.icon, children: sc.label }),
19635
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text27, { type: "secondary", style: { fontSize: 11 }, children: formatTime(run.startedAt) })
19576
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text27, { type: "secondary", style: { fontSize: 11 }, children: formatTime(run.startedAt) }),
19577
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
19578
+ import_antd57.Popconfirm,
19579
+ {
19580
+ title: "Delete run",
19581
+ description: "Delete this workflow run and all its step records?",
19582
+ onConfirm: () => handleDeleteRun(run.id),
19583
+ okText: "Delete",
19584
+ cancelText: "Cancel",
19585
+ okButtonProps: { danger: true },
19586
+ children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
19587
+ import_icons33.DeleteOutlined,
19588
+ {
19589
+ style: { color: "#ff4d4f", cursor: "pointer", fontSize: 13 },
19590
+ onClick: (e) => e.stopPropagation()
19591
+ }
19592
+ )
19593
+ }
19594
+ )
19636
19595
  ] })
19637
19596
  ] })
19638
19597
  },
@@ -19649,7 +19608,8 @@ var TopologyRuntimeView = () => {
19649
19608
  open: !!selectedRun,
19650
19609
  onClose: () => setSelectedRun(null),
19651
19610
  onRunUpdate: handleRunUpdate,
19652
- autoRefresh
19611
+ autoRefresh,
19612
+ onAutoRefreshChange: setAutoRefresh
19653
19613
  }
19654
19614
  )
19655
19615
  ] });
@@ -22408,7 +22368,7 @@ var ModelSelector = ({
22408
22368
 
22409
22369
  // src/components/Chat/SkillCategoryPrompts.tsx
22410
22370
  var import_icons35 = require("@ant-design/icons");
22411
- var import_x5 = require("@ant-design/x");
22371
+ var import_x4 = require("@ant-design/x");
22412
22372
  var import_antd69 = require("antd");
22413
22373
  var import_react78 = require("react");
22414
22374
  var import_lucide_react19 = require("lucide-react");
@@ -22603,7 +22563,7 @@ var SkillCategoryPrompts = ({
22603
22563
  overflowX: "hidden"
22604
22564
  },
22605
22565
  children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
22606
- import_x5.Prompts,
22566
+ import_x4.Prompts,
22607
22567
  {
22608
22568
  title: "\u2728 Quick actions",
22609
22569
  items: getSimpleItems(),
@@ -22641,7 +22601,7 @@ var SkillCategoryPrompts = ({
22641
22601
  children: Object.entries(groupedSkills).map(([category, categorySkills]) => {
22642
22602
  const config = getCategoryConfig(category);
22643
22603
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
22644
- import_x5.Prompts,
22604
+ import_x4.Prompts,
22645
22605
  {
22646
22606
  title: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_antd69.Space, { children: [
22647
22607
  /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { style: { color: config.color }, children: config.icon }),
@@ -22671,7 +22631,7 @@ var SkillCategoryPrompts_default = SkillCategoryPrompts;
22671
22631
 
22672
22632
  // src/components/Chat/BusinessAnalysisPrompts.tsx
22673
22633
  var import_icons36 = require("@ant-design/icons");
22674
- var import_x6 = require("@ant-design/x");
22634
+ var import_x5 = require("@ant-design/x");
22675
22635
  var import_antd70 = require("antd");
22676
22636
  var import_react79 = require("react");
22677
22637
  var import_jsx_runtime90 = require("react/jsx-runtime");
@@ -22963,7 +22923,7 @@ var BusinessAnalysisPrompts = ({
22963
22923
  margin: "0 auto"
22964
22924
  },
22965
22925
  children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
22966
- import_x6.Prompts,
22926
+ import_x5.Prompts,
22967
22927
  {
22968
22928
  title: simpleModeTitle,
22969
22929
  items: getSimpleItems(),
@@ -23009,7 +22969,7 @@ var BusinessAnalysisPrompts = ({
23009
22969
  /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { children: category.title })
23010
22970
  ] }),
23011
22971
  children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
23012
- import_x6.Prompts,
22972
+ import_x5.Prompts,
23013
22973
  {
23014
22974
  items: getGroupedItems(category.items),
23015
22975
  onItemClick: (info) => {
@@ -23053,10 +23013,17 @@ var Chating = ({
23053
23013
  showHITL = true,
23054
23014
  showRefreshButton = false,
23055
23015
  showModelSelector,
23016
+ showDatabaseSlot,
23017
+ showSkillSlot,
23018
+ showAgentSlot,
23019
+ showMetricsDataSourceSlot,
23056
23020
  showEmptyState = true,
23057
23021
  emptyStateGreeting,
23058
23022
  emptyStateQuestion = "Ready to turn data into insightful charts in seconds?",
23059
- welcomePrefix = "Hey"
23023
+ welcomePrefix = "Hey",
23024
+ systemContext,
23025
+ initialMessage,
23026
+ onInitialMessageSent
23060
23027
  }) => {
23061
23028
  const [content, setContent] = (0, import_react80.useState)("");
23062
23029
  const [attachedFiles, setAttachedFiles] = (0, import_react80.useState)([]);
@@ -23095,6 +23062,27 @@ var Chating = ({
23095
23062
  return () => clearInterval(interval);
23096
23063
  }, [isStreaming]);
23097
23064
  const conversationContext = useConversationContext();
23065
+ const systemContextSentRef = (0, import_react80.useRef)(false);
23066
+ const initialMessageSentRef = (0, import_react80.useRef)(false);
23067
+ const prevLoadingRef = (0, import_react80.useRef)(false);
23068
+ (0, import_react80.useEffect)(() => {
23069
+ systemContextSentRef.current = false;
23070
+ }, [threadId]);
23071
+ (0, import_react80.useEffect)(() => {
23072
+ initialMessageSentRef.current = false;
23073
+ }, [threadId]);
23074
+ (0, import_react80.useEffect)(() => {
23075
+ const wasLoading = prevLoadingRef.current;
23076
+ prevLoadingRef.current = isLoading;
23077
+ if (wasLoading && !isLoading && initialMessage && threadId && !initialMessageSentRef.current) {
23078
+ initialMessageSentRef.current = true;
23079
+ sendMessage({
23080
+ input: { message: initialMessage },
23081
+ streaming: true
23082
+ });
23083
+ onInitialMessageSent?.();
23084
+ }
23085
+ }, [isLoading, initialMessage, threadId, sendMessage, onInitialMessageSent]);
23098
23086
  const [modelConfig, setModelConfig] = (0, import_react80.useState)(null);
23099
23087
  const handleModelChange = (0, import_react80.useCallback)((config2) => {
23100
23088
  setModelConfig(config2);
@@ -23219,6 +23207,11 @@ var Chating = ({
23219
23207
  if (!nextContent && attachedFiles.length > 0) {
23220
23208
  nextContent = default_submit_message || "";
23221
23209
  }
23210
+ if (systemContext && !systemContextSentRef.current) {
23211
+ systemContextSentRef.current = true;
23212
+ nextContent = `${systemContext}
23213
+ ${nextContent}`;
23214
+ }
23222
23215
  const files = attachedFiles.map(
23223
23216
  (file) => isArchiveFile(file) ? {
23224
23217
  name: file.response.zipFileName || file.response.rarFileName,
@@ -23287,7 +23280,7 @@ var Chating = ({
23287
23280
  return true;
23288
23281
  };
23289
23282
  const senderHeader = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
23290
- import_x7.Sender.Header,
23283
+ import_x6.Sender.Header,
23291
23284
  {
23292
23285
  title: "Attachments",
23293
23286
  open: headerOpen,
@@ -23299,7 +23292,7 @@ var Chating = ({
23299
23292
  },
23300
23293
  forceRender: true,
23301
23294
  children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
23302
- import_x7.Attachments,
23295
+ import_x6.Attachments,
23303
23296
  {
23304
23297
  ref: attachmentsRef,
23305
23298
  items: attachedFiles,
@@ -23330,13 +23323,13 @@ var Chating = ({
23330
23323
  )
23331
23324
  }
23332
23325
  );
23333
- const showDatabaseSlot = config.enableDatabaseSlot;
23334
- const showSkillSlot = config.enableSkillSlot;
23335
- const showAgentSlot = config.enableAgentSlot;
23336
- const showMetricsDataSourceSlot = config.enableMetricsDataSourceSlot;
23326
+ const effectiveShowDatabaseSlot = showDatabaseSlot !== void 0 ? showDatabaseSlot : config.enableDatabaseSlot;
23327
+ const effectiveShowSkillSlot = showSkillSlot !== void 0 ? showSkillSlot : config.enableSkillSlot;
23328
+ const effectiveShowAgentSlot = showAgentSlot !== void 0 ? showAgentSlot : config.enableAgentSlot;
23329
+ const effectiveShowMetricsDataSourceSlot = showMetricsDataSourceSlot !== void 0 ? showMetricsDataSourceSlot : config.enableMetricsDataSourceSlot;
23337
23330
  const shouldShowModelSelector = showModelSelector !== void 0 ? showModelSelector : config.enableModelSelector;
23338
23331
  const senderFooter = (actionNode) => {
23339
- const hasSlotButtons = showAgentSlot || showDatabaseSlot || showSkillSlot || showMetricsDataSourceSlot;
23332
+ const hasSlotButtons = effectiveShowAgentSlot || effectiveShowDatabaseSlot || effectiveShowSkillSlot || effectiveShowMetricsDataSourceSlot;
23340
23333
  return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_antd71.Flex, { justify: "space-between", align: "center", style: { padding: "8px 0" }, children: [
23341
23334
  /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_antd71.Flex, { align: "center", gap: 8, children: [
23342
23335
  /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_antd71.Badge, { dot: attachedFiles.length > 0 && !headerOpen, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
@@ -23349,10 +23342,10 @@ var Chating = ({
23349
23342
  ) }),
23350
23343
  /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_antd71.Divider, { type: "vertical", style: { margin: 0 } }),
23351
23344
  hasSlotButtons && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_antd71.Flex, { align: "center", gap: 8, children: [
23352
- showAgentSlot && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(AgentPicker, { senderRef, iconOnly: true }),
23353
- showDatabaseSlot && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DatabasePicker, { senderRef, iconOnly: true }),
23354
- showSkillSlot && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(SkillPicker, { senderRef, iconOnly: true }),
23355
- showMetricsDataSourceSlot && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MetricsDataSourcePicker, { senderRef, iconOnly: true })
23345
+ effectiveShowAgentSlot && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(AgentPicker, { senderRef, iconOnly: true }),
23346
+ effectiveShowDatabaseSlot && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DatabasePicker, { senderRef, iconOnly: true }),
23347
+ effectiveShowSkillSlot && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(SkillPicker, { senderRef, iconOnly: true }),
23348
+ effectiveShowMetricsDataSourceSlot && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MetricsDataSourcePicker, { senderRef, iconOnly: true })
23356
23349
  ] })
23357
23350
  ] }),
23358
23351
  /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_antd71.Flex, { align: "center", gap: 8, children: [
@@ -23421,7 +23414,7 @@ var Chating = ({
23421
23414
  label: file.path
23422
23415
  }));
23423
23416
  return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
23424
- import_x7.Suggestion,
23417
+ import_x6.Suggestion,
23425
23418
  {
23426
23419
  items: suggestionItems,
23427
23420
  onSelect: (itemVal) => {
@@ -23453,7 +23446,7 @@ var Chating = ({
23453
23446
  }
23454
23447
  },
23455
23448
  children: ({ onTrigger, onKeyDown }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
23456
- import_x7.Sender,
23449
+ import_x6.Sender,
23457
23450
  {
23458
23451
  slotConfig,
23459
23452
  disabled: isInputDisabled,
@@ -23574,7 +23567,7 @@ var Chating = ({
23574
23567
  className: `${styles.messages} ${isTransitioning ? styles.entering : ""}`
23575
23568
  }
23576
23569
  ),
23577
- !isLoading && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_x7.Prompts, { items: senderPromptsItems, onItemClick: onPromptsItemClick }),
23570
+ !isLoading && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_x6.Prompts, { items: senderPromptsItems, onItemClick: onPromptsItemClick }),
23578
23571
  error && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { style: { padding: "0 16px 8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
23579
23572
  import_antd71.Alert,
23580
23573
  {
@@ -30736,7 +30729,7 @@ var LatticeChat = (props) => {
30736
30729
  };
30737
30730
 
30738
30731
  // src/components/Chat/AgentConversations.tsx
30739
- var import_x8 = require("@ant-design/x");
30732
+ var import_x7 = require("@ant-design/x");
30740
30733
  var import_antd93 = require("antd");
30741
30734
  var import_react99 = require("react");
30742
30735
  var import_jsx_runtime119 = require("react/jsx-runtime");
@@ -30779,7 +30772,7 @@ var AgentConversations = ({
30779
30772
  onClick: newChatClick
30780
30773
  } : void 0;
30781
30774
  return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
30782
- import_x8.Conversations,
30775
+ import_x7.Conversations,
30783
30776
  {
30784
30777
  creation,
30785
30778
  items,