@axiom-lattice/react-sdk 5.0.0 → 6.0.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.
Files changed (54) hide show
  1. package/dist/{AgentDetailSideApp-TIU7UQZH.mjs → AgentDetailSideApp-QZPV7MNB.mjs} +6 -6
  2. package/dist/{AgentGovernanceWorkbench-CWFRVPS5.mjs → AgentGovernanceWorkbench-25C3AKQI.mjs} +7 -7
  3. package/dist/{MessageGraph-XRSLD6VY.mjs → MessageGraph-JX6Y3VFH.mjs} +2 -2
  4. package/dist/{ReactChart-IW27RELF.mjs → ReactChart-LYUXL5M6.mjs} +2 -2
  5. package/dist/{TasksSideApp-5UTBVBIW.mjs → TasksSideApp-TWDLVB4D.mjs} +3 -3
  6. package/dist/{TeamWorkspace-WZ7EHM3X.mjs → TeamWorkspace-FGFAUD5Z.mjs} +2 -2
  7. package/dist/{TopologyRuntimeView-77JCSNTK.mjs → TopologyRuntimeView-O3VL4A7R.mjs} +3 -3
  8. package/dist/{WorkflowAutomationView-AVGN2L6Y.mjs → WorkflowAutomationView-D4YMZLRJ.mjs} +5 -5
  9. package/dist/{chunk-NE5RWDYD.mjs → chunk-3ZEMSWAC.mjs} +2 -2
  10. package/dist/{chunk-MFFUZVR5.mjs → chunk-466FV4VM.mjs} +2 -2
  11. package/dist/{chunk-CLCJX35D.mjs → chunk-6BWBE7MR.mjs} +6 -6
  12. package/dist/{chunk-QLFWQ4HR.mjs → chunk-7JDWJZ5M.mjs} +11 -11
  13. package/dist/{chunk-VQT22AKU.mjs → chunk-JJIGSAPR.mjs} +127 -220
  14. package/dist/chunk-JJIGSAPR.mjs.map +1 -0
  15. package/dist/{chunk-GJTDVFBS.mjs → chunk-QABSNIMF.mjs} +2 -2
  16. package/dist/{chunk-VLQM75ZM.mjs → chunk-UZWBRDTU.mjs} +4 -4
  17. package/dist/{embed-page-AgentDetailSideApp-XCP4LY7Y.js → embed-page-AgentDetailSideApp-JYVZKSUU.js} +1 -1
  18. package/dist/embed-page-AgentGovernanceWorkbench-SD2EHW2B.js +1 -0
  19. package/dist/{embed-page-MessageGraph-D77CYFAG.js → embed-page-MessageGraph-GLQXKAVC.js} +1 -1
  20. package/dist/{embed-page-ReactChart-TBDJOTZ5.js → embed-page-ReactChart-74MHCE2K.js} +1 -1
  21. package/dist/{embed-page-TasksSideApp-BVCIAE24.js → embed-page-TasksSideApp-DA4LUTMD.js} +1 -1
  22. package/dist/{embed-page-TeamWorkspace-JFEKNVFP.js → embed-page-TeamWorkspace-DUB3L6V6.js} +1 -1
  23. package/dist/{embed-page-TopologyRuntimeView-42TN76MK.js → embed-page-TopologyRuntimeView-NFBHAICN.js} +1 -1
  24. package/dist/{embed-page-WorkflowAutomationView-JLP4UHPP.js → embed-page-WorkflowAutomationView-43YGTXGF.js} +1 -1
  25. package/dist/{embed-page-chunk-K2U3JD67.js → embed-page-chunk-BVSC3MSO.js} +1 -1
  26. package/dist/{embed-page-chunk-5NJ3O2GK.js → embed-page-chunk-C4ZV4IXK.js} +2 -2
  27. package/dist/{embed-page-chunk-I3OONX3N.js → embed-page-chunk-DWIBLGBW.js} +1 -1
  28. package/dist/{embed-page-chunk-H64UEFHS.js → embed-page-chunk-GKHIPXZ2.js} +1 -1
  29. package/dist/{embed-page-chunk-YYDZ6ZBV.js → embed-page-chunk-P477ZTUO.js} +5 -5
  30. package/dist/{embed-page-chunk-GUSAII2D.js → embed-page-chunk-UHH575CK.js} +1 -1
  31. package/dist/embed-page.js +1 -1
  32. package/dist/index.d.mts +17 -20
  33. package/dist/index.d.ts +17 -20
  34. package/dist/index.js +467 -694
  35. package/dist/index.js.map +1 -1
  36. package/dist/index.mjs +89 -219
  37. package/dist/index.mjs.map +1 -1
  38. package/package.json +1 -1
  39. package/dist/chunk-VQT22AKU.mjs.map +0 -1
  40. package/dist/embed-page-AgentGovernanceWorkbench-BBDKEIBI.js +0 -5
  41. /package/dist/{AgentDetailSideApp-TIU7UQZH.mjs.map → AgentDetailSideApp-QZPV7MNB.mjs.map} +0 -0
  42. /package/dist/{AgentGovernanceWorkbench-CWFRVPS5.mjs.map → AgentGovernanceWorkbench-25C3AKQI.mjs.map} +0 -0
  43. /package/dist/{MessageGraph-XRSLD6VY.mjs.map → MessageGraph-JX6Y3VFH.mjs.map} +0 -0
  44. /package/dist/{ReactChart-IW27RELF.mjs.map → ReactChart-LYUXL5M6.mjs.map} +0 -0
  45. /package/dist/{TasksSideApp-5UTBVBIW.mjs.map → TasksSideApp-TWDLVB4D.mjs.map} +0 -0
  46. /package/dist/{TeamWorkspace-WZ7EHM3X.mjs.map → TeamWorkspace-FGFAUD5Z.mjs.map} +0 -0
  47. /package/dist/{TopologyRuntimeView-77JCSNTK.mjs.map → TopologyRuntimeView-O3VL4A7R.mjs.map} +0 -0
  48. /package/dist/{WorkflowAutomationView-AVGN2L6Y.mjs.map → WorkflowAutomationView-D4YMZLRJ.mjs.map} +0 -0
  49. /package/dist/{chunk-NE5RWDYD.mjs.map → chunk-3ZEMSWAC.mjs.map} +0 -0
  50. /package/dist/{chunk-MFFUZVR5.mjs.map → chunk-466FV4VM.mjs.map} +0 -0
  51. /package/dist/{chunk-CLCJX35D.mjs.map → chunk-6BWBE7MR.mjs.map} +0 -0
  52. /package/dist/{chunk-QLFWQ4HR.mjs.map → chunk-7JDWJZ5M.mjs.map} +0 -0
  53. /package/dist/{chunk-GJTDVFBS.mjs.map → chunk-QABSNIMF.mjs.map} +0 -0
  54. /package/dist/{chunk-VLQM75ZM.mjs.map → chunk-UZWBRDTU.mjs.map} +0 -0
package/dist/index.js CHANGED
@@ -136107,145 +136107,6 @@ var init_AgentGraphView = __esm({
136107
136107
  }
136108
136108
  });
136109
136109
 
136110
- // src/components/Governance/MiniChart.tsx
136111
-
136112
- var MiniBarChart, MiniLineChart;
136113
- var init_MiniChart = __esm({
136114
- "src/components/Governance/MiniChart.tsx"() {
136115
- "use strict";
136116
- MiniBarChart = ({
136117
- values,
136118
- width = 120,
136119
- height = 32,
136120
- color: color3 = "#6366f1",
136121
- placeholderColor = "#e5e5e5"
136122
- }) => {
136123
- if (values.length === 0) return null;
136124
- const max5 = Math.max(...values, 1);
136125
- const barW = width / values.length;
136126
- const pad4 = barW > 4 ? 1 : 0;
136127
- const MIN_BAR_H = 2;
136128
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width, height, style: { display: "block" }, children: values.map((v3, i4) => {
136129
- const barH = Math.max(v3 / max5 * height, MIN_BAR_H);
136130
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
136131
- "rect",
136132
- {
136133
- x: i4 * barW,
136134
- y: height - barH,
136135
- width: Math.max(barW - pad4, 1),
136136
- height: barH,
136137
- fill: v3 === 0 ? placeholderColor : color3,
136138
- rx: 1
136139
- },
136140
- i4
136141
- );
136142
- }) });
136143
- };
136144
- MiniLineChart = ({
136145
- values,
136146
- width = 200,
136147
- height = 40,
136148
- color: color3 = "#6366f1"
136149
- }) => {
136150
- if (values.length === 0) return null;
136151
- const min4 = Math.min(...values);
136152
- const max5 = Math.max(...values);
136153
- const range4 = max5 - min4 || 1;
136154
- const pad4 = 2;
136155
- const usableW = width - pad4 * 2;
136156
- const xAt = (i4) => values.length === 1 ? width / 2 : pad4 + i4 / (values.length - 1) * usableW;
136157
- const yAt = (v3) => height - 2 - (v3 - min4) / range4 * (height - 4);
136158
- const points = values.map((v3, i4) => `${xAt(i4)},${yAt(v3)}`).join(" ");
136159
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width, height, style: { display: "block" }, children: [
136160
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "polyline", { points, fill: "none", stroke: color3, strokeWidth: "1.5", strokeLinecap: "round" }),
136161
- values.map((v3, i4) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: xAt(i4), cy: yAt(v3), r: "2.5", fill: color3 }, i4))
136162
- ] });
136163
- };
136164
- }
136165
- });
136166
-
136167
- // src/components/Governance/AgentCardStats.tsx
136168
-
136169
-
136170
-
136171
- var fmtActive, scoreColor, useStyles73, valueStyle, labelStyle2, metricColumn, AgentCardStats;
136172
- var init_AgentCardStats = __esm({
136173
- "src/components/Governance/AgentCardStats.tsx"() {
136174
- "use strict";
136175
- init_MiniChart();
136176
- init_i18n();
136177
- fmtActive = (iso, t4) => {
136178
- if (!iso) return "\u2014";
136179
- const diff2 = Date.now() - new Date(iso).getTime();
136180
- const minutes = Math.floor(diff2 / 6e4);
136181
- if (minutes < 1) return t4 ? t4("common.time.justNow") : "just now";
136182
- if (minutes < 60) return t4 ? t4("common.time.minutesAgo", { count: minutes }) : `${minutes}m ago`;
136183
- const hours = Math.floor(minutes / 60);
136184
- if (hours < 24) return t4 ? t4("common.time.hoursAgo", { count: hours }) : `${hours}h ago`;
136185
- const days = Math.floor(hours / 24);
136186
- return t4 ? t4("common.time.daysAgo", { count: days }) : `${days}d ago`;
136187
- };
136188
- scoreColor = (score2) => {
136189
- if (score2 === null) return "#d9d9d9";
136190
- return score2 >= 80 ? "#22c55e" : score2 >= 50 ? "#f59e0b" : "#ef4444";
136191
- };
136192
- useStyles73 = _antdstyle.createStyles.call(void 0, ({ css }) => ({
136193
- row: css`
136194
- display: flex;
136195
- justify-content: space-between;
136196
- align-items: flex-end;
136197
- `
136198
- }));
136199
- valueStyle = {
136200
- fontSize: 16,
136201
- fontWeight: 700,
136202
- lineHeight: 1.2,
136203
- cursor: "help"
136204
- };
136205
- labelStyle2 = {
136206
- fontSize: 10,
136207
- color: "rgba(0, 0, 0, 0.45)",
136208
- whiteSpace: "nowrap",
136209
- marginTop: 1
136210
- };
136211
- metricColumn = {
136212
- display: "flex",
136213
- flexDirection: "column",
136214
- alignItems: "center"
136215
- };
136216
- AgentCardStats = exports.AgentCardStats = ({ stats }) => {
136217
- const { styles } = useStyles73();
136218
- const t4 = useT();
136219
- if (!stats) {
136220
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", fontSize: 11, color: "#d9d9d9" }, children: [
136221
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { flex: 1 }, children: t4("governance.cardStats.scoreEmpty") }),
136222
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { flex: 1 }, children: t4("governance.cardStats.threadsEmpty") })
136223
- ] });
136224
- }
136225
- const score2 = stats.evalScore !== null ? Number(stats.evalScore).toFixed(1) : "\u2014";
136226
- const threads = stats.threadCount > 0 ? stats.threadCount : "\u2014";
136227
- const scoreTextColor = scoreColor(stats.evalScore);
136228
- const passRate = stats.evalPassRate !== null ? `${stats.evalPassRate}%` : "\u2014";
136229
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: styles.row, children: [
136230
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", gap: 16, alignItems: "flex-end" }, children: [
136231
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.cardStats.evalTooltip", { score: score2, passRate, runs: stats.evalRuns }), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: metricColumn, children: [
136232
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { ...valueStyle, color: scoreTextColor }, children: score2 }),
136233
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "lattice-stat-label", style: labelStyle2, children: t4("governance.cardStats.evalScore") })
136234
- ] }) }),
136235
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: stats.lastActive ? t4("governance.cardStats.conversationsTooltipActive", { total: stats.threadCount, last7d: stats.last7d, last30d: stats.last30d, lastActive: fmtActive(stats.lastActive, t4) }) : t4("governance.cardStats.conversationsTooltip", { total: stats.threadCount, last7d: stats.last7d, last30d: stats.last30d }), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: metricColumn, children: [
136236
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { ...valueStyle, color: threads === "\u2014" ? "#d9d9d9" : "#595959" }, children: threads }),
136237
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "lattice-stat-label", style: labelStyle2, children: t4("governance.cardStats.threads") })
136238
- ] }) })
136239
- ] }),
136240
- stats.daily7d.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: metricColumn, children: [
136241
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MiniBarChart, { values: stats.daily7d, width: 40, height: 24, color: "#8c8c8c" }),
136242
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "lattice-stat-label", style: labelStyle2, children: t4("governance.cardStats.threads7d") })
136243
- ] })
136244
- ] });
136245
- };
136246
- }
136247
- });
136248
-
136249
136110
  // src/components/Governance/AgentList.tsx
136250
136111
 
136251
136112
 
@@ -136258,7 +136119,6 @@ var init_AgentList = __esm({
136258
136119
  init_EntityListView();
136259
136120
  init_FilterSelect();
136260
136121
  init_AgentGraphView();
136261
- init_AgentCardStats();
136262
136122
  init_agentMeta();
136263
136123
  init_i18n();
136264
136124
  TYPE_TABS = [
@@ -136271,7 +136131,6 @@ var init_AgentList = __esm({
136271
136131
  AgentList = exports.AgentList = ({
136272
136132
  items: items3,
136273
136133
  assistants = [],
136274
- stats,
136275
136134
  loading,
136276
136135
  onItemClick,
136277
136136
  onOpenPlayground,
@@ -136420,7 +136279,6 @@ var init_AgentList = __esm({
136420
136279
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontSize: 12, color: "#8c8c8c" }, children: item.version })
136421
136280
  ] })
136422
136281
  ] }),
136423
- renderFooter: (item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { borderTop: "1px dashed #f0f0f0", paddingTop: 10 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AgentCardStats, { stats: _optionalChain([stats, 'optionalAccess', _2217 => _2217[item.id]]) }) }),
136424
136282
  itemActions,
136425
136283
  actionsStyle: "icon",
136426
136284
  actionsPosition: "hover",
@@ -136472,7 +136330,7 @@ var init_AgentList = __esm({
136472
136330
 
136473
136331
 
136474
136332
 
136475
- var TextArea9, Text74, CATEGORY_ORDER, CATEGORY_LABEL_KEYS, AGENT_TYPE_DESC_KEYS, normalizeValue, normalizeGraphDefinition, serializeDraft, useStyles74, getMiddlewareTypeDefinition, AgentConfigPanel, AgentConfigPanel_default;
136333
+ var TextArea9, Text74, CATEGORY_ORDER, CATEGORY_LABEL_KEYS, AGENT_TYPE_DESC_KEYS, normalizeValue, normalizeGraphDefinition, serializeDraft, useStyles73, getMiddlewareTypeDefinition, AgentConfigPanel, AgentConfigPanel_default;
136476
136334
  var init_AgentConfigPanel = __esm({
136477
136335
  "src/components/Chat/AgentConfigPanel.tsx"() {
136478
136336
  "use strict";
@@ -136526,7 +136384,7 @@ var init_AgentConfigPanel = __esm({
136526
136384
  tools: [...draft.tools].sort(),
136527
136385
  subAgents: [...draft.subAgents].sort()
136528
136386
  }));
136529
- useStyles74 = _antdstyle.createStyles.call(void 0, ({ token, css }) => ({
136387
+ useStyles73 = _antdstyle.createStyles.call(void 0, ({ token, css }) => ({
136530
136388
  modalBody: css`
136531
136389
  padding: 0;
136532
136390
  height: 92vh;
@@ -136726,7 +136584,7 @@ var init_AgentConfigPanel = __esm({
136726
136584
  `
136727
136585
  }));
136728
136586
  getMiddlewareTypeDefinition = (middlewareType, availableTypes) => {
136729
- return _optionalChain([availableTypes, 'optionalAccess', _2218 => _2218.find, 'call', _2219 => _2219((t4) => t4.type === middlewareType)]);
136587
+ return _optionalChain([availableTypes, 'optionalAccess', _2217 => _2217.find, 'call', _2218 => _2218((t4) => t4.type === middlewareType)]);
136730
136588
  };
136731
136589
  AgentConfigPanel = ({
136732
136590
  assistant,
@@ -136742,7 +136600,7 @@ var init_AgentConfigPanel = __esm({
136742
136600
  }) => {
136743
136601
  const [form] = _antd.Form.useForm();
136744
136602
  const { token } = _antd.theme.useToken();
136745
- const { styles } = useStyles74();
136603
+ const { styles } = useStyles73();
136746
136604
  const { styles: navStyles } = useWorkbenchNavStyles();
136747
136605
  const t4 = useT();
136748
136606
  const { config } = useLatticeChatShellContext();
@@ -136778,13 +136636,13 @@ var init_AgentConfigPanel = __esm({
136778
136636
  onDirtyChangeRef.current = onDirtyChange;
136779
136637
  }, [onDirtyChange]);
136780
136638
  _react.useEffect.call(void 0, () => () => {
136781
- _optionalChain([onDirtyChangeRef, 'access', _2220 => _2220.current, 'optionalCall', _2221 => _2221(false)]);
136639
+ _optionalChain([onDirtyChangeRef, 'access', _2219 => _2219.current, 'optionalCall', _2220 => _2220(false)]);
136782
136640
  }, []);
136783
136641
  _react.useEffect.call(void 0, () => {
136784
136642
  onOverlayOpenChangeRef.current = onOverlayOpenChange;
136785
136643
  }, [onOverlayOpenChange]);
136786
136644
  _react.useEffect.call(void 0, () => () => {
136787
- _optionalChain([onOverlayOpenChangeRef, 'access', _2222 => _2222.current, 'optionalCall', _2223 => _2223(false)]);
136645
+ _optionalChain([onOverlayOpenChangeRef, 'access', _2221 => _2221.current, 'optionalCall', _2222 => _2222(false)]);
136788
136646
  }, []);
136789
136647
  const currentDraft = _react.useMemo.call(void 0, () => serializeDraft({
136790
136648
  form: formValues,
@@ -136793,13 +136651,13 @@ var init_AgentConfigPanel = __esm({
136793
136651
  subAgents: selectedSubAgents,
136794
136652
  prompt: agentPrompt,
136795
136653
  middleware,
136796
- graphDefinition: normalizeGraphDefinition(_optionalChain([workingAssistant, 'optionalAccess', _2224 => _2224.graphDefinition]))
136797
- }), [formValues, agentType, selectedTools, selectedSubAgents, agentPrompt, middleware, _optionalChain([workingAssistant, 'optionalAccess', _2225 => _2225.graphDefinition])]);
136654
+ graphDefinition: normalizeGraphDefinition(_optionalChain([workingAssistant, 'optionalAccess', _2223 => _2223.graphDefinition]))
136655
+ }), [formValues, agentType, selectedTools, selectedSubAgents, agentPrompt, middleware, _optionalChain([workingAssistant, 'optionalAccess', _2224 => _2224.graphDefinition])]);
136798
136656
  const dirty = initialized && currentDraft !== baseline;
136799
136657
  const configurationReady = initialized;
136800
136658
  latestDirtyRef.current = dirty;
136801
136659
  const parsedConfig = _react.useMemo.call(void 0, () => {
136802
- if (!_optionalChain([assistant, 'optionalAccess', _2226 => _2226.graphDefinition])) {
136660
+ if (!_optionalChain([assistant, 'optionalAccess', _2225 => _2225.graphDefinition])) {
136803
136661
  return null;
136804
136662
  }
136805
136663
  try {
@@ -136818,7 +136676,7 @@ var init_AgentConfigPanel = __esm({
136818
136676
  const initializeMiddleware = _react.useCallback.call(void 0, (types) => {
136819
136677
  const middlewareTypes2 = types || [];
136820
136678
  return middlewareTypes2.filter(
136821
- (type2) => _optionalChain([type2, 'access', _2227 => _2227.schema, 'optionalAccess', _2228 => _2228.properties]) && Object.keys(type2.schema.properties).length > 0 || type2.tools && type2.tools.length > 0
136679
+ (type2) => _optionalChain([type2, 'access', _2226 => _2226.schema, 'optionalAccess', _2227 => _2227.properties]) && Object.keys(type2.schema.properties).length > 0 || type2.tools && type2.tools.length > 0
136822
136680
  ).map((type2, index3) => ({
136823
136681
  id: `${type2.type}-${index3 + 1}`,
136824
136682
  type: type2.type,
@@ -136830,9 +136688,9 @@ var init_AgentConfigPanel = __esm({
136830
136688
  }, []);
136831
136689
  const mergeMiddlewareConfig = _react.useCallback.call(void 0, (savedConfigs, availableTypes) => {
136832
136690
  const types = (availableTypes || []).filter(
136833
- (type2) => _optionalChain([type2, 'access', _2229 => _2229.schema, 'optionalAccess', _2230 => _2230.properties]) && Object.keys(type2.schema.properties).length > 0 || type2.tools && type2.tools.length > 0
136691
+ (type2) => _optionalChain([type2, 'access', _2228 => _2228.schema, 'optionalAccess', _2229 => _2229.properties]) && Object.keys(type2.schema.properties).length > 0 || type2.tools && type2.tools.length > 0
136834
136692
  );
136835
- const savedMap = new Map(_optionalChain([savedConfigs, 'optionalAccess', _2231 => _2231.map, 'call', _2232 => _2232((cfg) => [cfg.type, cfg])]) || []);
136693
+ const savedMap = new Map(_optionalChain([savedConfigs, 'optionalAccess', _2230 => _2230.map, 'call', _2231 => _2231((cfg) => [cfg.type, cfg])]) || []);
136836
136694
  const merged = types.map((type2, index3) => {
136837
136695
  const saved = savedMap.get(type2.type);
136838
136696
  if (saved) {
@@ -136862,7 +136720,7 @@ var init_AgentConfigPanel = __esm({
136862
136720
  setToolsLoading(true);
136863
136721
  try {
136864
136722
  const response = await get4("/api/tools");
136865
- if (response.success && _optionalChain([response, 'access', _2233 => _2233.data, 'optionalAccess', _2234 => _2234.records])) {
136723
+ if (response.success && _optionalChain([response, 'access', _2232 => _2232.data, 'optionalAccess', _2233 => _2233.records])) {
136866
136724
  setTools(response.data.records);
136867
136725
  }
136868
136726
  } catch (error) {
@@ -136881,7 +136739,7 @@ var init_AgentConfigPanel = __esm({
136881
136739
  return;
136882
136740
  }
136883
136741
  if (initializedAssistantRef.current === assistant) return;
136884
- if (_optionalChain([initializedAssistantRef, 'access', _2235 => _2235.current, 'optionalAccess', _2236 => _2236.id]) === assistant.id && latestDirtyRef.current) return;
136742
+ if (_optionalChain([initializedAssistantRef, 'access', _2234 => _2234.current, 'optionalAccess', _2235 => _2235.id]) === assistant.id && latestDirtyRef.current) return;
136885
136743
  const configuredMiddlewareTypes = config.availableMiddlewareTypes;
136886
136744
  if (!configuredMiddlewareTypes && middlewareTypesLoading) return;
136887
136745
  initializedAssistantRef.current = assistant;
@@ -136892,10 +136750,10 @@ var init_AgentConfigPanel = __esm({
136892
136750
  name: _nullishCoalesce(assistant.name, () => ( "")),
136893
136751
  description: _nullishCoalesce(assistant.description, () => ( ""))
136894
136752
  };
136895
- const nextTools = _nullishCoalesce(_optionalChain([parsedConfig, 'optionalAccess', _2237 => _2237.tools]), () => ( []));
136896
- const nextSubAgents = _nullishCoalesce(_optionalChain([parsedConfig, 'optionalAccess', _2238 => _2238.subAgents]), () => ( []));
136897
- const nextPrompt = _nullishCoalesce(_optionalChain([parsedConfig, 'optionalAccess', _2239 => _2239.prompt]), () => ( ""));
136898
- const nextAgentType = _nullishCoalesce(_optionalChain([parsedConfig, 'optionalAccess', _2240 => _2240.type]), () => ( "react"));
136753
+ const nextTools = _nullishCoalesce(_optionalChain([parsedConfig, 'optionalAccess', _2236 => _2236.tools]), () => ( []));
136754
+ const nextSubAgents = _nullishCoalesce(_optionalChain([parsedConfig, 'optionalAccess', _2237 => _2237.subAgents]), () => ( []));
136755
+ const nextPrompt = _nullishCoalesce(_optionalChain([parsedConfig, 'optionalAccess', _2238 => _2238.prompt]), () => ( ""));
136756
+ const nextAgentType = _nullishCoalesce(_optionalChain([parsedConfig, 'optionalAccess', _2239 => _2239.type]), () => ( "react"));
136899
136757
  const nextMiddleware = parsedConfig ? mergeMiddlewareConfig(parsedConfig.middleware, configuredMiddlewareTypes || middlewareTypes) : initializeMiddleware(configuredMiddlewareTypes || middlewareTypes);
136900
136758
  setInitialized(false);
136901
136759
  setWorkingAssistant(assistant);
@@ -136928,10 +136786,10 @@ var init_AgentConfigPanel = __esm({
136928
136786
  }
136929
136787
  }, [currentDraft, pendingBaseline]);
136930
136788
  _react.useEffect.call(void 0, () => {
136931
- _optionalChain([onDirtyChange, 'optionalCall', _2241 => _2241(dirty)]);
136789
+ _optionalChain([onDirtyChange, 'optionalCall', _2240 => _2240(dirty)]);
136932
136790
  }, [dirty, onDirtyChange]);
136933
136791
  _react.useEffect.call(void 0, () => {
136934
- _optionalChain([onOverlayOpenChangeRef, 'access', _2242 => _2242.current, 'optionalCall', _2243 => _2243(isPromptModalOpen || isDeleteModalOpen)]);
136792
+ _optionalChain([onOverlayOpenChangeRef, 'access', _2241 => _2241.current, 'optionalCall', _2242 => _2242(isPromptModalOpen || isDeleteModalOpen)]);
136935
136793
  }, [isPromptModalOpen, isDeleteModalOpen]);
136936
136794
  const handleSave = async () => {
136937
136795
  if (!workingAssistant || !configurationReady) return;
@@ -136948,7 +136806,7 @@ var init_AgentConfigPanel = __esm({
136948
136806
  prompt: agentPrompt,
136949
136807
  middleware
136950
136808
  };
136951
- await _optionalChain([onSave, 'optionalCall', _2244 => _2244(workingAssistant, configToSave)]);
136809
+ await _optionalChain([onSave, 'optionalCall', _2243 => _2243(workingAssistant, configToSave)]);
136952
136810
  if (initializationGenerationRef.current === saveGeneration) {
136953
136811
  setBaseline(saveSnapshot);
136954
136812
  }
@@ -136964,7 +136822,7 @@ var init_AgentConfigPanel = __esm({
136964
136822
  if (!assistant) return;
136965
136823
  setDeleting(true);
136966
136824
  try {
136967
- await _optionalChain([onDelete, 'optionalCall', _2245 => _2245(assistant)]);
136825
+ await _optionalChain([onDelete, 'optionalCall', _2244 => _2244(assistant)]);
136968
136826
  setIsDeleteModalOpen(false);
136969
136827
  onClose();
136970
136828
  } catch (error) {
@@ -136981,11 +136839,11 @@ var init_AgentConfigPanel = __esm({
136981
136839
  if (m3.enabled) {
136982
136840
  return { ...m3, enabled: false };
136983
136841
  } else {
136984
- const typeDef = _optionalChain([(config.availableMiddlewareTypes || middlewareTypes), 'optionalAccess', _2246 => _2246.find, 'call', _2247 => _2247((t5) => t5.type === m3.type)]);
136842
+ const typeDef = _optionalChain([(config.availableMiddlewareTypes || middlewareTypes), 'optionalAccess', _2245 => _2245.find, 'call', _2246 => _2246((t5) => t5.type === m3.type)]);
136985
136843
  return {
136986
136844
  ...m3,
136987
136845
  enabled: true,
136988
- config: _optionalChain([typeDef, 'optionalAccess', _2248 => _2248.defaultConfig]) || {}
136846
+ config: _optionalChain([typeDef, 'optionalAccess', _2247 => _2247.defaultConfig]) || {}
136989
136847
  };
136990
136848
  }
136991
136849
  })
@@ -137053,7 +136911,7 @@ var init_AgentConfigPanel = __esm({
137053
136911
  backgroundColor: isSelected ? token.colorPrimary : token.colorSuccess,
137054
136912
  fontSize: 15
137055
136913
  },
137056
- children: _optionalChain([subAssistant, 'access', _2249 => _2249.name, 'optionalAccess', _2250 => _2250.charAt, 'call', _2251 => _2251(0), 'access', _2252 => _2252.toUpperCase, 'call', _2253 => _2253()]) || "A"
136914
+ children: _optionalChain([subAssistant, 'access', _2248 => _2248.name, 'optionalAccess', _2249 => _2249.charAt, 'call', _2250 => _2250(0), 'access', _2251 => _2251.toUpperCase, 'call', _2252 => _2252()]) || "A"
137057
136915
  }
137058
136916
  ),
137059
136917
  renderPrimary: () => subAssistant.name,
@@ -137075,7 +136933,7 @@ var init_AgentConfigPanel = __esm({
137075
136933
  const categoryOf = _react.useCallback.call(void 0,
137076
136934
  (m3) => {
137077
136935
  const def = getMiddlewareTypeDefinition(m3.type, config.availableMiddlewareTypes || middlewareTypes);
137078
- return _optionalChain([def, 'optionalAccess', _2254 => _2254.category]) || "other";
136936
+ return _optionalChain([def, 'optionalAccess', _2253 => _2253.category]) || "other";
137079
136937
  },
137080
136938
  [config.availableMiddlewareTypes, middlewareTypes]
137081
136939
  );
@@ -137321,7 +137179,7 @@ var init_AgentConfigPanel = __esm({
137321
137179
  fontSize: 18,
137322
137180
  flexShrink: 0
137323
137181
  },
137324
- children: _optionalChain([assistant, 'access', _2255 => _2255.name, 'optionalAccess', _2256 => _2256.charAt, 'call', _2257 => _2257(0), 'access', _2258 => _2258.toUpperCase, 'call', _2259 => _2259()]) || "A"
137182
+ children: _optionalChain([assistant, 'access', _2254 => _2254.name, 'optionalAccess', _2255 => _2255.charAt, 'call', _2256 => _2256(0), 'access', _2257 => _2257.toUpperCase, 'call', _2258 => _2258()]) || "A"
137325
137183
  }
137326
137184
  ),
137327
137185
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { minWidth: 0 }, children: [
@@ -137398,7 +137256,7 @@ var init_AgentConfigPanel = __esm({
137398
137256
  ),
137399
137257
  capabilitiesExpanded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: navStyles.navSub, children: capabilityGroupOrder.map((cat3) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
137400
137258
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: navStyles.navGroupLabel, children: CATEGORY_LABEL_KEYS[cat3] ? t4(CATEGORY_LABEL_KEYS[cat3]) : cat3 }),
137401
- _optionalChain([capabilityGroups, 'access', _2260 => _2260.get, 'call', _2261 => _2261(cat3), 'optionalAccess', _2262 => _2262.map, 'call', _2263 => _2263((m3) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
137259
+ _optionalChain([capabilityGroups, 'access', _2259 => _2259.get, 'call', _2260 => _2260(cat3), 'optionalAccess', _2261 => _2261.map, 'call', _2262 => _2262((m3) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
137402
137260
  "button",
137403
137261
  {
137404
137262
  type: "button",
@@ -137561,7 +137419,7 @@ var init_AgentConfigPanel = __esm({
137561
137419
 
137562
137420
  // src/components/Governance/evalProjectRef.ts
137563
137421
  function findAgentEvalProject(projects, assistantId) {
137564
- return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(projects.find((p7) => _optionalChain([p7, 'access', _2264 => _2264.targetServerConfig, 'optionalAccess', _2265 => _2265.targetAgentId]) === assistantId), () => ( projects.find((p7) => p7.name === `eval-${assistantId}`))), () => ( projects.find((p7) => typeof p7.description === "string" && p7.description.includes(assistantId)))), () => ( null));
137422
+ return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(projects.find((p7) => _optionalChain([p7, 'access', _2263 => _2263.targetServerConfig, 'optionalAccess', _2264 => _2264.targetAgentId]) === assistantId), () => ( projects.find((p7) => p7.name === `eval-${assistantId}`))), () => ( projects.find((p7) => typeof p7.description === "string" && p7.description.includes(assistantId)))), () => ( null));
137565
137423
  }
137566
137424
  var init_evalProjectRef = __esm({
137567
137425
  "src/components/Governance/evalProjectRef.ts"() {
@@ -137592,10 +137450,10 @@ var init_AgentEvalPanel = __esm({
137592
137450
  init_i18n();
137593
137451
  ({ Text: Text75 } = _antd.Typography);
137594
137452
  normalizeInitial = (initial) => {
137595
- if (_optionalChain([initial, 'optionalAccess', _2266 => _2266.page]) === "suite" && _optionalChain([initial, 'access', _2267 => _2267.suiteId, 'optionalAccess', _2268 => _2268.trim, 'call', _2269 => _2269()])) {
137453
+ if (_optionalChain([initial, 'optionalAccess', _2265 => _2265.page]) === "suite" && _optionalChain([initial, 'access', _2266 => _2266.suiteId, 'optionalAccess', _2267 => _2267.trim, 'call', _2268 => _2268()])) {
137596
137454
  return { page: "suite", suiteId: initial.suiteId, runId: "" };
137597
137455
  }
137598
- if (_optionalChain([initial, 'optionalAccess', _2270 => _2270.page]) === "run" && _optionalChain([initial, 'access', _2271 => _2271.runId, 'optionalAccess', _2272 => _2272.trim, 'call', _2273 => _2273()])) {
137456
+ if (_optionalChain([initial, 'optionalAccess', _2269 => _2269.page]) === "run" && _optionalChain([initial, 'access', _2270 => _2270.runId, 'optionalAccess', _2271 => _2271.trim, 'call', _2272 => _2272()])) {
137599
137457
  return { page: "run", suiteId: "", runId: initial.runId };
137600
137458
  }
137601
137459
  return { page: "suites", suiteId: "", runId: "" };
@@ -137604,8 +137462,8 @@ var init_AgentEvalPanel = __esm({
137604
137462
  const t4 = useT();
137605
137463
  const { projects, loading, create: createProject } = useEvalProjects();
137606
137464
  const project = findAgentEvalProject(projects, assistantId);
137607
- const projectId = _nullishCoalesce(_optionalChain([project, 'optionalAccess', _2274 => _2274.id]), () => ( ""));
137608
- const projectName = _optionalChain([project, 'optionalAccess', _2275 => _2275.name]) || `eval-${assistantId}`;
137465
+ const projectId = _nullishCoalesce(_optionalChain([project, 'optionalAccess', _2273 => _2273.id]), () => ( ""));
137466
+ const projectName = _optionalChain([project, 'optionalAccess', _2274 => _2274.name]) || `eval-${assistantId}`;
137609
137467
  const normalizedInitial = normalizeInitial(initial);
137610
137468
  const initialKey = `${normalizedInitial.page}\0${normalizedInitial.suiteId}\0${normalizedInitial.runId}`;
137611
137469
  const [target, setTarget] = _react.useState.call(void 0, normalizedInitial);
@@ -137646,7 +137504,7 @@ var init_AgentEvalPanel = __esm({
137646
137504
  judgeModelConfig: { modelKey: values.modelKey || "" },
137647
137505
  targetServerConfig: { base_url: "", api_key: "", targetAgentId: assistantId }
137648
137506
  });
137649
- await Promise.resolve(_optionalChain([onEvalInvalidatedRef, 'access', _2276 => _2276.current, 'optionalCall', _2277 => _2277()])).catch(() => void 0);
137507
+ await Promise.resolve(_optionalChain([onEvalInvalidatedRef, 'access', _2275 => _2275.current, 'optionalCall', _2276 => _2276()])).catch(() => void 0);
137650
137508
  form.resetFields();
137651
137509
  setModalOpen(false);
137652
137510
  } catch (err) {
@@ -137666,14 +137524,14 @@ var init_AgentEvalPanel = __esm({
137666
137524
  if (!suiteName.trim()) return;
137667
137525
  await createSuite(projectId, { name: suiteName.trim() });
137668
137526
  setSuiteRefreshKey((value) => value + 1);
137669
- await _optionalChain([onEvalInvalidated, 'optionalCall', _2278 => _2278()]);
137527
+ await _optionalChain([onEvalInvalidated, 'optionalCall', _2277 => _2277()]);
137670
137528
  setSuiteName("");
137671
137529
  setShowAdd(false);
137672
137530
  };
137673
137531
  const handleRunAll = async (rc) => {
137674
137532
  const r6 = await start2(projectId, buildRunConfig(rc.projectId));
137675
- if (_optionalChain([r6, 'optionalAccess', _2279 => _2279.run_id])) {
137676
- await Promise.resolve(_optionalChain([onEvalInvalidated, 'optionalCall', _2280 => _2280()])).catch(() => void 0);
137533
+ if (_optionalChain([r6, 'optionalAccess', _2278 => _2278.run_id])) {
137534
+ await Promise.resolve(_optionalChain([onEvalInvalidated, 'optionalCall', _2279 => _2279()])).catch(() => void 0);
137677
137535
  navTo("run", void 0, r6.run_id);
137678
137536
  }
137679
137537
  };
@@ -137761,7 +137619,7 @@ var init_AgentEvalPanel = __esm({
137761
137619
  suiteId,
137762
137620
  onBack: () => navTo("suites"),
137763
137621
  onRun: (rid) => {
137764
- void Promise.resolve(_optionalChain([onEvalInvalidated, 'optionalCall', _2281 => _2281()])).catch(() => void 0);
137622
+ void Promise.resolve(_optionalChain([onEvalInvalidated, 'optionalCall', _2280 => _2280()])).catch(() => void 0);
137765
137623
  navTo("run", void 0, rid);
137766
137624
  },
137767
137625
  onEvalInvalidated
@@ -138077,15 +137935,15 @@ var init_client = __esm({
138077
137935
  } catch (error) {
138078
137936
  if (isAbortError4(error)) throw error;
138079
137937
  if (error instanceof AgentWebAppRuntimeClientError) throw error;
138080
- throw new AgentWebAppRuntimeClientError("STREAM_FAILED", _nullishCoalesce(_optionalChain([this, 'access', _2282 => _2282.translate, 'optionalCall', _2283 => _2283("integration.error.streamFailed")]), () => ( "Stream failed")), true);
137938
+ throw new AgentWebAppRuntimeClientError("STREAM_FAILED", _nullishCoalesce(_optionalChain([this, 'access', _2281 => _2281.translate, 'optionalCall', _2282 => _2282("integration.error.streamFailed")]), () => ( "Stream failed")), true);
138081
137939
  }
138082
137940
  if (!response.ok) await this.throwResponseError(response);
138083
- if (!response.body || !_optionalChain([response, 'access', _2284 => _2284.headers, 'access', _2285 => _2285.get, 'call', _2286 => _2286("content-type"), 'optionalAccess', _2287 => _2287.toLowerCase, 'call', _2288 => _2288(), 'access', _2289 => _2289.includes, 'call', _2290 => _2290("text/event-stream")])) {
137941
+ if (!response.body || !_optionalChain([response, 'access', _2283 => _2283.headers, 'access', _2284 => _2284.get, 'call', _2285 => _2285("content-type"), 'optionalAccess', _2286 => _2286.toLowerCase, 'call', _2287 => _2287(), 'access', _2288 => _2288.includes, 'call', _2289 => _2289("text/event-stream")])) {
138084
137942
  if (response.body) try {
138085
137943
  await response.body.cancel();
138086
137944
  } catch (e98) {
138087
137945
  }
138088
- throw new AgentWebAppRuntimeClientError("STREAM_FAILED", _nullishCoalesce(_optionalChain([this, 'access', _2291 => _2291.translate, 'optionalCall', _2292 => _2292("integration.error.streamFailed")]), () => ( "Stream failed")), true, response.status);
137946
+ throw new AgentWebAppRuntimeClientError("STREAM_FAILED", _nullishCoalesce(_optionalChain([this, 'access', _2290 => _2290.translate, 'optionalCall', _2291 => _2291("integration.error.streamFailed")]), () => ( "Stream failed")), true, response.status);
138089
137947
  }
138090
137948
  await parseAgentWebAppEventStream(response.body, onEvent);
138091
137949
  }
@@ -138105,7 +137963,7 @@ var init_client = __esm({
138105
137963
  } catch (error) {
138106
137964
  if (isAbortError4(error)) throw error;
138107
137965
  if (error instanceof AgentWebAppRuntimeClientError) throw error;
138108
- throw new AgentWebAppRuntimeClientError("INTERNAL_ERROR", _nullishCoalesce(_optionalChain([this, 'access', _2293 => _2293.translate, 'optionalCall', _2294 => _2294("integration.error.requestFailed")]), () => ( "Request failed")), true);
137966
+ throw new AgentWebAppRuntimeClientError("INTERNAL_ERROR", _nullishCoalesce(_optionalChain([this, 'access', _2292 => _2292.translate, 'optionalCall', _2293 => _2293("integration.error.requestFailed")]), () => ( "Request failed")), true);
138109
137967
  }
138110
137968
  let value;
138111
137969
  try {
@@ -138150,7 +138008,7 @@ var init_client = __esm({
138150
138008
  throw this.internalError(response.status);
138151
138009
  }
138152
138010
  internalError(status) {
138153
- return new AgentWebAppRuntimeClientError("INTERNAL_ERROR", _nullishCoalesce(_optionalChain([this, 'access', _2295 => _2295.translate, 'optionalCall', _2296 => _2296("integration.error.invalidServerResponse")]), () => ( "Invalid server response")), false, status);
138011
+ return new AgentWebAppRuntimeClientError("INTERNAL_ERROR", _nullishCoalesce(_optionalChain([this, 'access', _2294 => _2294.translate, 'optionalCall', _2295 => _2295("integration.error.invalidServerResponse")]), () => ( "Invalid server response")), false, status);
138154
138012
  }
138155
138013
  };
138156
138014
  }
@@ -138435,7 +138293,7 @@ function ScopedAgentChatApp({ gatewayUrl, webAppId, identity: identity9, onError
138435
138293
  if (cancelled) return;
138436
138294
  const normalized = runtimeError(error, t4);
138437
138295
  setState({ status: "error", error: normalized });
138438
- _optionalChain([onErrorRef, 'access', _2297 => _2297.current, 'optionalCall', _2298 => _2298(normalized)]);
138296
+ _optionalChain([onErrorRef, 'access', _2296 => _2296.current, 'optionalCall', _2297 => _2297(normalized)]);
138439
138297
  }
138440
138298
  })();
138441
138299
  return () => {
@@ -138652,23 +138510,23 @@ var init_AgentWebAppFormModal = __esm({
138652
138510
  const [multiModel, setMultiModel] = _react.useState.call(void 0, false);
138653
138511
  _react.useEffect.call(void 0, () => {
138654
138512
  if (!open) return;
138655
- const features = _nullishCoalesce(_optionalChain([value, 'optionalAccess', _2299 => _2299.features]), () => ( initialFeatures));
138513
+ const features = _nullishCoalesce(_optionalChain([value, 'optionalAccess', _2298 => _2298.features]), () => ( initialFeatures));
138656
138514
  setMultiProject(features.projectSelector);
138657
138515
  setMultiModel(features.modelSelector);
138658
138516
  form.setFieldsValue({
138659
- name: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _2300 => _2300.name]), () => ( "")),
138660
- description: _optionalChain([value, 'optionalAccess', _2301 => _2301.description]),
138661
- defaultProjectId: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _2302 => _2302.scope, 'access', _2303 => _2303.defaultProjectId]), () => ( _optionalChain([projects, 'access', _2304 => _2304[0], 'optionalAccess', _2305 => _2305.id]))),
138662
- allowedProjectIds: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _2306 => _2306.scope, 'access', _2307 => _2307.allowedProjectIds]), () => ( (projects[0] ? [projects[0].id] : []))),
138663
- defaultModelKey: _optionalChain([value, 'optionalAccess', _2308 => _2308.scope, 'access', _2309 => _2309.defaultModelKey]),
138664
- allowedModelKeys: _optionalChain([value, 'optionalAccess', _2310 => _2310.scope, 'access', _2311 => _2311.allowedModelKeys]),
138517
+ name: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _2299 => _2299.name]), () => ( "")),
138518
+ description: _optionalChain([value, 'optionalAccess', _2300 => _2300.description]),
138519
+ defaultProjectId: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _2301 => _2301.scope, 'access', _2302 => _2302.defaultProjectId]), () => ( _optionalChain([projects, 'access', _2303 => _2303[0], 'optionalAccess', _2304 => _2304.id]))),
138520
+ allowedProjectIds: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _2305 => _2305.scope, 'access', _2306 => _2306.allowedProjectIds]), () => ( (projects[0] ? [projects[0].id] : []))),
138521
+ defaultModelKey: _optionalChain([value, 'optionalAccess', _2307 => _2307.scope, 'access', _2308 => _2308.defaultModelKey]),
138522
+ allowedModelKeys: _optionalChain([value, 'optionalAccess', _2309 => _2309.scope, 'access', _2310 => _2310.allowedModelKeys]),
138665
138523
  ...features,
138666
- title: _optionalChain([value, 'optionalAccess', _2312 => _2312.appearance, 'access', _2313 => _2313.title]),
138667
- welcomeMessage: _optionalChain([value, 'optionalAccess', _2314 => _2314.appearance, 'access', _2315 => _2315.welcomeMessage]),
138668
- primaryColor: _optionalChain([value, 'optionalAccess', _2316 => _2316.appearance, 'access', _2317 => _2317.primaryColor]),
138669
- quickPrompts: _optionalChain([value, 'optionalAccess', _2318 => _2318.appearance, 'access', _2319 => _2319.quickPrompts]),
138670
- identityPolicy: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _2320 => _2320.identity, 'optionalAccess', _2321 => _2321.policy]), () => ( "unverified")),
138671
- identityIssuers: _optionalChain([value, 'optionalAccess', _2322 => _2322.identity]) ? JSON.stringify(value.identity.issuers, null, 2) : void 0
138524
+ title: _optionalChain([value, 'optionalAccess', _2311 => _2311.appearance, 'access', _2312 => _2312.title]),
138525
+ welcomeMessage: _optionalChain([value, 'optionalAccess', _2313 => _2313.appearance, 'access', _2314 => _2314.welcomeMessage]),
138526
+ primaryColor: _optionalChain([value, 'optionalAccess', _2315 => _2315.appearance, 'access', _2316 => _2316.primaryColor]),
138527
+ quickPrompts: _optionalChain([value, 'optionalAccess', _2317 => _2317.appearance, 'access', _2318 => _2318.quickPrompts]),
138528
+ identityPolicy: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _2319 => _2319.identity, 'optionalAccess', _2320 => _2320.policy]), () => ( "unverified")),
138529
+ identityIssuers: _optionalChain([value, 'optionalAccess', _2321 => _2321.identity]) ? JSON.stringify(value.identity.issuers, null, 2) : void 0
138672
138530
  });
138673
138531
  }, [form, open, projects, value]);
138674
138532
  const submit = async () => {
@@ -138690,12 +138548,12 @@ var init_AgentWebAppFormModal = __esm({
138690
138548
  identity9 = { policy, issuers };
138691
138549
  }
138692
138550
  const quickPrompts = (_nullishCoalesce(fields.quickPrompts, () => ( []))).map((prompt) => ({
138693
- label: (_nullishCoalesce(_optionalChain([prompt, 'optionalAccess', _2323 => _2323.label]), () => ( ""))).trim(),
138694
- text: (_nullishCoalesce(_optionalChain([prompt, 'optionalAccess', _2324 => _2324.text]), () => ( ""))).trim()
138551
+ label: (_nullishCoalesce(_optionalChain([prompt, 'optionalAccess', _2322 => _2322.label]), () => ( ""))).trim(),
138552
+ text: (_nullishCoalesce(_optionalChain([prompt, 'optionalAccess', _2323 => _2323.text]), () => ( ""))).trim()
138695
138553
  })).filter((prompt) => prompt.label.length > 0 && prompt.text.length > 0);
138696
138554
  const shared = {
138697
138555
  name: fields.name.trim(),
138698
- description: _optionalChain([fields, 'access', _2325 => _2325.description, 'optionalAccess', _2326 => _2326.trim, 'call', _2327 => _2327()]) || void 0,
138556
+ description: _optionalChain([fields, 'access', _2324 => _2324.description, 'optionalAccess', _2325 => _2325.trim, 'call', _2326 => _2326()]) || void 0,
138699
138557
  scope: {
138700
138558
  defaultProjectId: fields.defaultProjectId,
138701
138559
  allowedProjectIds,
@@ -138712,9 +138570,9 @@ var init_AgentWebAppFormModal = __esm({
138712
138570
  files: _nullishCoalesce(fields.files, () => ( false))
138713
138571
  },
138714
138572
  appearance: {
138715
- title: _optionalChain([fields, 'access', _2328 => _2328.title, 'optionalAccess', _2329 => _2329.trim, 'call', _2330 => _2330()]) || void 0,
138716
- welcomeMessage: _optionalChain([fields, 'access', _2331 => _2331.welcomeMessage, 'optionalAccess', _2332 => _2332.trim, 'call', _2333 => _2333()]) || void 0,
138717
- primaryColor: _optionalChain([fields, 'access', _2334 => _2334.primaryColor, 'optionalAccess', _2335 => _2335.trim, 'call', _2336 => _2336()]) || void 0,
138573
+ title: _optionalChain([fields, 'access', _2327 => _2327.title, 'optionalAccess', _2328 => _2328.trim, 'call', _2329 => _2329()]) || void 0,
138574
+ welcomeMessage: _optionalChain([fields, 'access', _2330 => _2330.welcomeMessage, 'optionalAccess', _2331 => _2331.trim, 'call', _2332 => _2332()]) || void 0,
138575
+ primaryColor: _optionalChain([fields, 'access', _2333 => _2333.primaryColor, 'optionalAccess', _2334 => _2334.trim, 'call', _2335 => _2335()]) || void 0,
138718
138576
  ...quickPrompts.length > 0 ? { quickPrompts } : {}
138719
138577
  },
138720
138578
  identity: identity9
@@ -138742,7 +138600,7 @@ var init_AgentWebAppFormModal = __esm({
138742
138600
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text76, { strong: true, children: t4("governance.webApp.modelScope") }),
138743
138601
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Form.Item, { name: "modelSelector", valuePropName: "checked", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Checkbox, { "aria-label": t4("governance.webApp.modelSelector"), onChange: (event) => setMultiModel(event.target.checked), children: t4("governance.webApp.modelSelector") }) }),
138744
138602
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Form.Item, { name: "allowedModelKeys", label: t4("governance.webApp.allowedModels"), dependencies: ["defaultModelKey", "modelSelector"], rules: multiModel ? [
138745
- { validator: (_2, keys2) => _optionalChain([keys2, 'optionalAccess', _2337 => _2337.length]) || form.getFieldValue("defaultModelKey") ? Promise.resolve() : Promise.reject(new Error(t4("governance.webApp.selectModel"))) },
138603
+ { validator: (_2, keys2) => _optionalChain([keys2, 'optionalAccess', _2336 => _2336.length]) || form.getFieldValue("defaultModelKey") ? Promise.resolve() : Promise.reject(new Error(t4("governance.webApp.selectModel"))) },
138746
138604
  { validator: (_2, keys2) => (_nullishCoalesce(keys2, () => ( []))).every((key) => modelOptions.some((option) => option.value === key)) ? Promise.resolve() : Promise.reject(new Error(t4("governance.webApp.selectValidModels"))) }
138747
138605
  ] : void 0, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Select, { "aria-label": t4("governance.webApp.allowedModels"), mode: "multiple", allowClear: true, disabled: !multiModel, options: modelOptions }) }),
138748
138606
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Form.Item, { name: "defaultModelKey", label: t4("governance.webApp.defaultModel"), rules: [
@@ -138822,7 +138680,7 @@ var init_AgentWebAppFormModal = __esm({
138822
138680
 
138823
138681
  function consolePreviewFetch(input, init3) {
138824
138682
  const token = readAuthItem("lattice_token");
138825
- const headers = new Headers(_optionalChain([init3, 'optionalAccess', _2338 => _2338.headers]));
138683
+ const headers = new Headers(_optionalChain([init3, 'optionalAccess', _2337 => _2337.headers]));
138826
138684
  if (token) headers.set("Authorization", `Bearer ${token}`);
138827
138685
  headers.set("X-Axiom-Web-App-Preview", "true");
138828
138686
  return globalThis.fetch(input, { ...init3, headers });
@@ -138969,7 +138827,7 @@ export function HooksExample({ currentUser }: ExampleProps) {
138969
138827
  } finally {
138970
138828
  if (generation === requestGeneration.current) setLoading(false);
138971
138829
  }
138972
- }, [assistant.id, client, _optionalChain([currentTenant, 'optionalAccess', _2339 => _2339.id]), t4]);
138830
+ }, [assistant.id, client, _optionalChain([currentTenant, 'optionalAccess', _2338 => _2338.id]), t4]);
138973
138831
  _react.useEffect.call(void 0, () => {
138974
138832
  setApps([]);
138975
138833
  setFormTarget(null);
@@ -139111,10 +138969,10 @@ export function HooksExample({ currentUser }: ExampleProps) {
139111
138969
  }
139112
138970
  ),
139113
138971
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AgentWebAppFormModal, { open: formTarget !== null, assistantId: assistant.id, value: formTarget === "create" ? null : formTarget, projects, models, submitting, error: formError, onCancel: () => setFormTarget(null), onSubmit: submit }),
139114
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Modal, { title: t4("governance.webApps.deleteTitle"), open: deleteTarget !== null, onCancel: () => setDeleteTarget(null), onOk: () => void confirmDelete(), okText: t4("common.delete"), okButtonProps: { danger: true, loading: deleting }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: t4("governance.webApps.deleteBody", { name: _nullishCoalesce(_optionalChain([deleteTarget, 'optionalAccess', _2340 => _2340.name]), () => ( "")) }) }) }),
138972
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Modal, { title: t4("governance.webApps.deleteTitle"), open: deleteTarget !== null, onCancel: () => setDeleteTarget(null), onOk: () => void confirmDelete(), okText: t4("common.delete"), okButtonProps: { danger: true, loading: deleting }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: t4("governance.webApps.deleteBody", { name: _nullishCoalesce(_optionalChain([deleteTarget, 'optionalAccess', _2339 => _2339.name]), () => ( "")) }) }) }),
139115
138973
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Modal, { title: t4("governance.webApps.previewTitle"), open: previewTarget !== null, onCancel: () => setPreviewTarget(null), footer: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { onClick: () => setPreviewTarget(null), children: t4("common.close") }), width: 900, children: !baseURL ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Alert, { type: "warning", message: t4("governance.webApps.gatewayUnavailable") }) : previewTarget && previewTarget.status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "iframe", { src: `${baseURL}/api/web-apps/${previewTarget.id}/chat?mode=embed`, title: t4("governance.webApps.previewFrameTitle"), style: { width: "100%", height: 640, border: "1px solid #d9d9d9", borderRadius: 8 } }) : previewTarget ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
139116
138974
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Alert, { type: "info", showIcon: true, message: t4("governance.webApps.draftPreviewTitle"), description: t4("governance.webApps.draftPreviewDescription"), style: { marginBottom: 16 } }),
139117
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AgentChatApp, { gatewayUrl: baseURL, webAppId: previewTarget.id, identity: { mode: "unverified", userId: `console-preview:${_nullishCoalesce(_optionalChain([user, 'optionalAccess', _2341 => _2341.id]), () => ( "unknown"))}:${previewTarget.id}`, displayName: _optionalChain([user, 'optionalAccess', _2342 => _2342.name]) }, fetch: consolePreviewFetch })
138975
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AgentChatApp, { gatewayUrl: baseURL, webAppId: previewTarget.id, identity: { mode: "unverified", userId: `console-preview:${_nullishCoalesce(_optionalChain([user, 'optionalAccess', _2340 => _2340.id]), () => ( "unknown"))}:${previewTarget.id}`, displayName: _optionalChain([user, 'optionalAccess', _2341 => _2341.name]) }, fetch: consolePreviewFetch })
139118
138976
  ] }) : null }),
139119
138977
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Modal, { title: t4("governance.webApps.guideTitle"), open: guideTarget !== null, onCancel: () => setGuideTarget(null), footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _antd.Space, { children: [
139120
138978
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { onClick: () => guideTarget && void copy3(Object.values(buildAgentWebAppIntegrationExamples(guideTarget, baseURL)).join("\n\n")), children: t4("governance.webApps.copyExamples") }),
@@ -139268,7 +139126,7 @@ function collectConfiguredSkills(g3) {
139268
139126
  return { ids, readAll };
139269
139127
  }
139270
139128
  function buildAgentConfigGraphData(def, options) {
139271
- const tr = _optionalChain([options, 'optionalAccess', _2343 => _2343.t]);
139129
+ const tr = _optionalChain([options, 'optionalAccess', _2342 => _2342.t]);
139272
139130
  const g3 = getGraphDefinition2(def);
139273
139131
  const agentKey = typeof g3.key === "string" ? g3.key : "agent";
139274
139132
  const agentType = _nullishCoalesce(g3.type, () => ( "capability"));
@@ -139283,7 +139141,7 @@ function buildAgentConfigGraphData(def, options) {
139283
139141
  description: g3.description || "",
139284
139142
  modelKey: g3.modelKey || "",
139285
139143
  prompt: g3.prompt || "",
139286
- version: _optionalChain([g3, 'access', _2344 => _2344.metadata, 'optionalAccess', _2345 => _2345.version]) || ""
139144
+ version: _optionalChain([g3, 'access', _2343 => _2343.metadata, 'optionalAccess', _2344 => _2344.version]) || ""
139287
139145
  }
139288
139146
  };
139289
139147
  const make = (type2, id2, label, description, config) => ({ id: id2, type: type2, label, description, config });
@@ -139310,7 +139168,7 @@ function buildAgentConfigGraphData(def, options) {
139310
139168
  { id: "group:subagents", type: "subagent", label: groupLabel("subagent"), items: subagents },
139311
139169
  { id: "group:skills", type: "skill", label: groupLabel("skill"), items: skills }
139312
139170
  ];
139313
- const groups2 = _optionalChain([options, 'optionalAccess', _2346 => _2346.includeEmptyGroups]) ? allGroups : allGroups.filter((grp) => grp.items.length > 0);
139171
+ const groups2 = _optionalChain([options, 'optionalAccess', _2345 => _2345.includeEmptyGroups]) ? allGroups : allGroups.filter((grp) => grp.items.length > 0);
139314
139172
  return { agent, groups: groups2 };
139315
139173
  }
139316
139174
  var GROUP_LABEL_FALLBACK, NODE_TYPE_META, asStrings, ALL_SKILLS_NODE_ID;
@@ -139382,7 +139240,7 @@ var init_ConfigGraphNodes = __esm({
139382
139240
  ] });
139383
139241
  AgentCardNode = ({ data }) => {
139384
139242
  const { node, onClick } = data;
139385
- const color3 = colorHex(getTypeBadgeInfo(String(_nullishCoalesce(_optionalChain([node, 'access', _2347 => _2347.config, 'optionalAccess', _2348 => _2348.type]), () => ( "react")))).color);
139243
+ const color3 = colorHex(getTypeBadgeInfo(String(_nullishCoalesce(_optionalChain([node, 'access', _2346 => _2346.config, 'optionalAccess', _2347 => _2347.type]), () => ( "react")))).color);
139386
139244
  const cfg = _nullishCoalesce(node.config, () => ( {}));
139387
139245
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
139388
139246
  "div",
@@ -139448,7 +139306,7 @@ var init_ConfigGraphNodes = __esm({
139448
139306
  {
139449
139307
  onClick: (e8) => {
139450
139308
  e8.stopPropagation();
139451
- _optionalChain([onClick, 'optionalCall', _2349 => _2349(item)]);
139309
+ _optionalChain([onClick, 'optionalCall', _2348 => _2348(item)]);
139452
139310
  },
139453
139311
  style: {
139454
139312
  display: "flex",
@@ -139537,7 +139395,7 @@ function buildImprovementQuality(runs, neutralThreshold = 1) {
139537
139395
  const sorted = runs.filter((run) => Number.isFinite(run.avgScore) && Number.isFinite(new Date(run.createdAt).getTime())).sort(compareEvalRunsChronologically);
139538
139396
  const developmentRuns = sorted.filter((run) => run.status === "completed" && !run.holdout);
139539
139397
  const latestRun = developmentRuns[developmentRuns.length - 1];
139540
- const hasExplicitEnvironment = _optionalChain([latestRun, 'optionalAccess', _2350 => _2350.envProjectId]) !== void 0;
139398
+ const hasExplicitEnvironment = _optionalChain([latestRun, 'optionalAccess', _2349 => _2349.envProjectId]) !== void 0;
139541
139399
  const comparableRuns = hasExplicitEnvironment ? developmentRuns.filter((run) => run.envProjectId === latestRun.envProjectId) : developmentRuns;
139542
139400
  const trend = comparableRuns.map(toQualityPoint);
139543
139401
  const validationTrend = sorted.filter((run) => run.status === "completed" && run.holdout).map(toQualityPoint);
@@ -139553,7 +139411,7 @@ function buildImprovementQuality(runs, neutralThreshold = 1) {
139553
139411
  latest,
139554
139412
  previous,
139555
139413
  delta,
139556
- passRate: _nullishCoalesce(_optionalChain([latest, 'optionalAccess', _2351 => _2351.passRate]), () => ( null)),
139414
+ passRate: _nullishCoalesce(_optionalChain([latest, 'optionalAccess', _2350 => _2350.passRate]), () => ( null)),
139557
139415
  comparisonLabel: hasExplicitEnvironment ? "Latest comparable result" : "Latest recorded result",
139558
139416
  trend,
139559
139417
  validationTrend,
@@ -139583,7 +139441,7 @@ var init_EChart = __esm({
139583
139441
  const latestOnEvents = _react.useRef.call(void 0, onEvents);
139584
139442
  _react.useEffect.call(void 0, () => {
139585
139443
  latestOption.current = option;
139586
- _optionalChain([instance, 'access', _2352 => _2352.current, 'optionalAccess', _2353 => _2353.setOption, 'call', _2354 => _2354(option, true)]);
139444
+ _optionalChain([instance, 'access', _2351 => _2351.current, 'optionalAccess', _2352 => _2352.setOption, 'call', _2353 => _2353(option, true)]);
139587
139445
  }, [option]);
139588
139446
  _react.useEffect.call(void 0, () => {
139589
139447
  latestOnEvents.current = onEvents;
@@ -139608,15 +139466,15 @@ var init_EChart = __esm({
139608
139466
  if (events) {
139609
139467
  for (const [event, handler] of Object.entries(events)) chart.on(event, handler);
139610
139468
  }
139611
- observer = new ResizeObserver(() => _optionalChain([instance, 'access', _2355 => _2355.current, 'optionalAccess', _2356 => _2356.resize, 'call', _2357 => _2357()]));
139469
+ observer = new ResizeObserver(() => _optionalChain([instance, 'access', _2354 => _2354.current, 'optionalAccess', _2355 => _2355.resize, 'call', _2356 => _2356()]));
139612
139470
  observer.observe(ref.current);
139613
139471
  })().catch((error) => {
139614
139472
  console.error("[EChart] async init failed:", error);
139615
139473
  });
139616
139474
  return () => {
139617
139475
  cancelled = true;
139618
- _optionalChain([observer, 'optionalAccess', _2358 => _2358.disconnect, 'call', _2359 => _2359()]);
139619
- _optionalChain([instance, 'access', _2360 => _2360.current, 'optionalAccess', _2361 => _2361.dispose, 'call', _2362 => _2362()]);
139476
+ _optionalChain([observer, 'optionalAccess', _2357 => _2357.disconnect, 'call', _2358 => _2358()]);
139477
+ _optionalChain([instance, 'access', _2359 => _2359.current, 'optionalAccess', _2360 => _2360.dispose, 'call', _2361 => _2361()]);
139620
139478
  instance.current = null;
139621
139479
  };
139622
139480
  }, []);
@@ -139719,7 +139577,7 @@ function useEvalQuality(assistantId) {
139719
139577
  const t4 = useT();
139720
139578
  const { projects, loading: projectsLoading, error: projectsError, refresh: refreshProjects } = useEvalProjects();
139721
139579
  const evalProject = findAgentEvalProject(projects, assistantId);
139722
- const projectId = _nullishCoalesce(_optionalChain([evalProject, 'optionalAccess', _2363 => _2363.id]), () => ( ""));
139580
+ const projectId = _nullishCoalesce(_optionalChain([evalProject, 'optionalAccess', _2362 => _2362.id]), () => ( ""));
139723
139581
  const { suites, loading: suitesLoading, error: suitesError, refresh: refreshSuites } = useEvalSuites(projectId);
139724
139582
  const { runs, inventoryProjectId, loading: runsLoading, error: runsError, refresh: refreshRuns } = useEvalRuns(projectId);
139725
139583
  const refresh = _react.useCallback.call(void 0, async () => {
@@ -139730,9 +139588,9 @@ function useEvalQuality(assistantId) {
139730
139588
  const projectRuns = inventoryProjectId === projectId ? runs.filter((run) => run.projectId === projectId) : [];
139731
139589
  const sorted = [...projectRuns].sort(compareEvalRunsChronologically);
139732
139590
  const quality = buildImprovementQuality(projectRuns);
139733
- const latest = quality.latest ? projectRuns.find((run) => run.id === _optionalChain([quality, 'access', _2364 => _2364.latest, 'optionalAccess', _2365 => _2365.runId])) : void 0;
139591
+ const latest = quality.latest ? projectRuns.find((run) => run.id === _optionalChain([quality, 'access', _2363 => _2363.latest, 'optionalAccess', _2364 => _2364.runId])) : void 0;
139734
139592
  return {
139735
- evalProjectId: _optionalChain([evalProject, 'optionalAccess', _2366 => _2366.id]),
139593
+ evalProjectId: _optionalChain([evalProject, 'optionalAccess', _2365 => _2365.id]),
139736
139594
  inventoryProjectId,
139737
139595
  suiteCount: suites.length,
139738
139596
  caseCount,
@@ -139741,7 +139599,7 @@ function useEvalQuality(assistantId) {
139741
139599
  runs: sorted,
139742
139600
  runCount: projectRuns.length,
139743
139601
  passRate: quality.passRate,
139744
- score: _nullishCoalesce(_optionalChain([quality, 'access', _2367 => _2367.latest, 'optionalAccess', _2368 => _2368.score]), () => ( null)),
139602
+ score: _nullishCoalesce(_optionalChain([quality, 'access', _2366 => _2366.latest, 'optionalAccess', _2367 => _2367.score]), () => ( null)),
139745
139603
  hasEvalProject: !!evalProject,
139746
139604
  suiteNames: suites.map((s4) => _nullishCoalesce(s4.name, () => ( t4("governance.overview.unnamed")))).filter(Boolean),
139747
139605
  error: _nullishCoalesce(_nullishCoalesce(projectsError, () => ( suitesError)), () => ( runsError)),
@@ -139976,6 +139834,63 @@ var init_AgentOverview = __esm({
139976
139834
  }
139977
139835
  });
139978
139836
 
139837
+ // src/components/Governance/MiniChart.tsx
139838
+
139839
+ var MiniBarChart, MiniLineChart;
139840
+ var init_MiniChart = __esm({
139841
+ "src/components/Governance/MiniChart.tsx"() {
139842
+ "use strict";
139843
+ MiniBarChart = ({
139844
+ values,
139845
+ width = 120,
139846
+ height = 32,
139847
+ color: color3 = "#6366f1",
139848
+ placeholderColor = "#e5e5e5"
139849
+ }) => {
139850
+ if (values.length === 0) return null;
139851
+ const max5 = Math.max(...values, 1);
139852
+ const barW = width / values.length;
139853
+ const pad4 = barW > 4 ? 1 : 0;
139854
+ const MIN_BAR_H = 2;
139855
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width, height, style: { display: "block" }, children: values.map((v3, i4) => {
139856
+ const barH = Math.max(v3 / max5 * height, MIN_BAR_H);
139857
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
139858
+ "rect",
139859
+ {
139860
+ x: i4 * barW,
139861
+ y: height - barH,
139862
+ width: Math.max(barW - pad4, 1),
139863
+ height: barH,
139864
+ fill: v3 === 0 ? placeholderColor : color3,
139865
+ rx: 1
139866
+ },
139867
+ i4
139868
+ );
139869
+ }) });
139870
+ };
139871
+ MiniLineChart = ({
139872
+ values,
139873
+ width = 200,
139874
+ height = 40,
139875
+ color: color3 = "#6366f1"
139876
+ }) => {
139877
+ if (values.length === 0) return null;
139878
+ const min4 = Math.min(...values);
139879
+ const max5 = Math.max(...values);
139880
+ const range4 = max5 - min4 || 1;
139881
+ const pad4 = 2;
139882
+ const usableW = width - pad4 * 2;
139883
+ const xAt = (i4) => values.length === 1 ? width / 2 : pad4 + i4 / (values.length - 1) * usableW;
139884
+ const yAt = (v3) => height - 2 - (v3 - min4) / range4 * (height - 4);
139885
+ const points = values.map((v3, i4) => `${xAt(i4)},${yAt(v3)}`).join(" ");
139886
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width, height, style: { display: "block" }, children: [
139887
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "polyline", { points, fill: "none", stroke: color3, strokeWidth: "1.5", strokeLinecap: "round" }),
139888
+ values.map((v3, i4) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: xAt(i4), cy: yAt(v3), r: "2.5", fill: color3 }, i4))
139889
+ ] });
139890
+ };
139891
+ }
139892
+ });
139893
+
139979
139894
  // src/components/Governance/Learning/ReferenceFilesUpload.tsx
139980
139895
 
139981
139896
 
@@ -140003,14 +139918,14 @@ var init_ReferenceFilesUpload = __esm({
140003
139918
  const file = options.file;
140004
139919
  try {
140005
139920
  const item = await uploadFileToProject(projectId, "/project/uploads", file);
140006
- _optionalChain([options, 'access', _2369 => _2369.onSuccess, 'optionalCall', _2370 => _2370({ uri: item.path, name: file.name, projectId })]);
139921
+ _optionalChain([options, 'access', _2368 => _2368.onSuccess, 'optionalCall', _2369 => _2369({ uri: item.path, name: file.name, projectId })]);
140007
139922
  } catch (err) {
140008
- _optionalChain([options, 'access', _2371 => _2371.onError, 'optionalCall', _2372 => _2372(err instanceof Error ? err : new Error("Upload failed"))]);
139923
+ _optionalChain([options, 'access', _2370 => _2370.onError, 'optionalCall', _2371 => _2371(err instanceof Error ? err : new Error("Upload failed"))]);
140009
139924
  }
140010
139925
  };
140011
139926
  const handleChange = (info) => {
140012
139927
  const { file } = info;
140013
- if (file.status === "done" && _optionalChain([file, 'access', _2373 => _2373.response, 'optionalAccess', _2374 => _2374.uri])) {
139928
+ if (file.status === "done" && _optionalChain([file, 'access', _2372 => _2372.response, 'optionalAccess', _2373 => _2373.uri])) {
140014
139929
  if (file.response.projectId && file.response.projectId !== projectIdRef.current) {
140015
139930
  setPending(info.fileList.filter((f5) => f5.status === "uploading" || f5.status === "error"));
140016
139931
  return;
@@ -140027,7 +139942,7 @@ var init_ReferenceFilesUpload = __esm({
140027
139942
  };
140028
139943
  const handleRemove = (file) => {
140029
139944
  if (file.status === "done") {
140030
- const uri = _optionalChain([file, 'access', _2375 => _2375.response, 'optionalAccess', _2376 => _2376.uri]);
139945
+ const uri = _optionalChain([file, 'access', _2374 => _2374.response, 'optionalAccess', _2375 => _2375.uri]);
140031
139946
  onChange(value.filter((f5) => f5.uri !== uri && f5.name !== file.name));
140032
139947
  } else {
140033
139948
  setPending((prev) => prev.filter((f5) => f5.uid !== file.uid));
@@ -140092,7 +140007,7 @@ var init_TrainingContextCard = __esm({
140092
140007
  kind: "training",
140093
140008
  value: _nullishCoalesce(value, () => ( project.id)),
140094
140009
  onChange: (id2) => {
140095
- if (id2) _optionalChain([onChange, 'optionalCall', _2377 => _2377(id2)]);
140010
+ if (id2) _optionalChain([onChange, 'optionalCall', _2376 => _2376(id2)]);
140096
140011
  },
140097
140012
  style: { minWidth: 0 }
140098
140013
  }
@@ -140173,7 +140088,7 @@ async function startLearningRound(params) {
140173
140088
  const threadRes = await params.post("/api/assistants/agent-architect/threads", {
140174
140089
  metadata: { training: true, targetAgentId: params.targetAgentId }
140175
140090
  });
140176
- threadId = _nullishCoalesce(_optionalChain([threadRes, 'access', _2378 => _2378.data, 'optionalAccess', _2379 => _2379.id]), () => ( null));
140091
+ threadId = _nullishCoalesce(_optionalChain([threadRes, 'access', _2377 => _2377.data, 'optionalAccess', _2378 => _2378.id]), () => ( null));
140177
140092
  if (!threadId) throw new Error(params.t ? params.t("governance.learning.threadCreateFailed") : "Failed to create training thread");
140178
140093
  }
140179
140094
  await params.put(`/api/tasks/${roundTask.id}`, {
@@ -140211,11 +140126,11 @@ function buildLearningKickoff(input) {
140211
140126
  `That exact Task is your bound tracking task: your main task and Belief root for this round.`,
140212
140127
  `Reconcile it; create every child under it; never create a new main or round task.`,
140213
140128
  targetForm,
140214
- ..._optionalChain([input, 'access', _2380 => _2380.files, 'optionalAccess', _2381 => _2381.length]) ? [`Reference files: ${input.files.map((file) => `${file.name || file.uri} (${file.uri})`).join(", ")}. Read them before designing; in your first reply state which files you actually read and what you took from each.`] : []
140129
+ ..._optionalChain([input, 'access', _2379 => _2379.files, 'optionalAccess', _2380 => _2380.length]) ? [`Reference files: ${input.files.map((file) => `${file.name || file.uri} (${file.uri})`).join(", ")}. Read them before designing; in your first reply state which files you actually read and what you took from each.`] : []
140215
140130
  ].join("\n");
140216
140131
  }
140217
140132
  async function fetchTaskSubtree(get4, rootId, scope) {
140218
- const projectId = _optionalChain([scope, 'optionalAccess', _2382 => _2382.projectId]);
140133
+ const projectId = _optionalChain([scope, 'optionalAccess', _2381 => _2381.projectId]);
140219
140134
  const requestInit = projectId ? { headers: { "x-project-id": projectId } } : void 0;
140220
140135
  const withProject = (id2) => buildSubTasksQuery(id2, _nullishCoalesce(projectId, () => ( void 0)));
140221
140136
  const collected = [];
@@ -140297,7 +140212,7 @@ var init_StartLearningModal = __esm({
140297
140212
  void (async () => {
140298
140213
  try {
140299
140214
  const res = await get4(
140300
- buildTrainingRoundsQuery(agentId, _nullishCoalesce(_optionalChain([trainingProject, 'optionalAccess', _2383 => _2383.id]), () => ( void 0))),
140215
+ buildTrainingRoundsQuery(agentId, _nullishCoalesce(_optionalChain([trainingProject, 'optionalAccess', _2382 => _2382.id]), () => ( void 0))),
140301
140216
  trainingProject ? { headers: { "x-project-id": trainingProject.id } } : void 0
140302
140217
  );
140303
140218
  if (cancelled) return;
@@ -140521,7 +140436,7 @@ var init_LearningTaskDetailModal = __esm({
140521
140436
  const entry = { promise: request, source, detailSession };
140522
140437
  workItemRequestsRef.current.set(taskId, entry);
140523
140438
  void request.finally(() => {
140524
- if (_optionalChain([workItemRequestsRef, 'access', _2384 => _2384.current, 'access', _2385 => _2385.get, 'call', _2386 => _2386(taskId), 'optionalAccess', _2387 => _2387.promise]) === request) {
140439
+ if (_optionalChain([workItemRequestsRef, 'access', _2383 => _2383.current, 'access', _2384 => _2384.get, 'call', _2385 => _2385(taskId), 'optionalAccess', _2386 => _2386.promise]) === request) {
140525
140440
  workItemRequestsRef.current.delete(taskId);
140526
140441
  }
140527
140442
  }).catch(() => void 0);
@@ -140652,7 +140567,7 @@ var init_LearningTaskDetailModal = __esm({
140652
140567
  void loadWorkItems(selectedId, false);
140653
140568
  }, [task, relatedTasks]);
140654
140569
  _react.useEffect.call(void 0, () => {
140655
- if (!_optionalChain([displayedTask, 'optionalAccess', _2388 => _2388.id])) return;
140570
+ if (!_optionalChain([displayedTask, 'optionalAccess', _2387 => _2387.id])) return;
140656
140571
  const taskId = displayedTask.id;
140657
140572
  let cancelled = false;
140658
140573
  const load2 = async () => {
@@ -140669,7 +140584,7 @@ var init_LearningTaskDetailModal = __esm({
140669
140584
  cancelled = true;
140670
140585
  document.removeEventListener("visibilitychange", onVisibilityChange);
140671
140586
  };
140672
- }, [_optionalChain([displayedTask, 'optionalAccess', _2389 => _2389.id])]);
140587
+ }, [_optionalChain([displayedTask, 'optionalAccess', _2388 => _2388.id])]);
140673
140588
  const handleViewChat = useOpenTaskChat(displayedTask);
140674
140589
  const reportDisplayedTask = React58.default.useContext(LearningTaskDetailDisplayedTaskContext);
140675
140590
  _react.useEffect.call(void 0, () => {
@@ -140776,7 +140691,7 @@ function firstHeadingLine(markdown) {
140776
140691
  return void 0;
140777
140692
  }
140778
140693
  function liveStatusText(item) {
140779
- const markdown = typeof _optionalChain([item, 'access', _2390 => _2390.detail, 'optionalAccess', _2391 => _2391.markdown]) === "string" && item.detail.markdown.length > 0 ? item.detail.markdown : void 0;
140694
+ const markdown = typeof _optionalChain([item, 'access', _2389 => _2389.detail, 'optionalAccess', _2390 => _2390.markdown]) === "string" && item.detail.markdown.length > 0 ? item.detail.markdown : void 0;
140780
140695
  if (markdown) {
140781
140696
  const heading = firstHeadingLine(markdown);
140782
140697
  if (heading) return heading;
@@ -140784,7 +140699,7 @@ function liveStatusText(item) {
140784
140699
  return item.summary || item.action || "";
140785
140700
  }
140786
140701
  function isWaitingForApproval(task) {
140787
- const interruption = _optionalChain([task, 'access', _2392 => _2392.context, 'optionalAccess', _2393 => _2393.interruption]);
140702
+ const interruption = _optionalChain([task, 'access', _2391 => _2391.context, 'optionalAccess', _2392 => _2392.interruption]);
140788
140703
  return task.status === "interrupted" && typeof interruption === "object" && interruption !== null && interruption.type === "review_required";
140789
140704
  }
140790
140705
  function withUiTimeout2(promise, timeoutMs) {
@@ -140859,9 +140774,9 @@ var init_LearningProgressCard = __esm({
140859
140774
  const selectedRound = _nullishCoalesce(_nullishCoalesce(allRounds.find((r6) => r6.id === selectedRoundId), () => ( allRounds[0])), () => ( null));
140860
140775
  const selectRound = (roundId) => {
140861
140776
  if (!isSelectionControlled) setInternalSelectedRoundId(roundId);
140862
- _optionalChain([onSelectedRoundChange, 'optionalCall', _2394 => _2394(roundId)]);
140777
+ _optionalChain([onSelectedRoundChange, 'optionalCall', _2393 => _2393(roundId)]);
140863
140778
  };
140864
- const selectedSubTasks = subTasksByRound && selectedRound ? _nullishCoalesce(subTasksByRound[selectedRound.id], () => ( [])) : selectedRound && selectedRound.id === _optionalChain([round3, 'optionalAccess', _2395 => _2395.id]) ? subTasks : [];
140779
+ const selectedSubTasks = subTasksByRound && selectedRound ? _nullishCoalesce(subTasksByRound[selectedRound.id], () => ( [])) : selectedRound && selectedRound.id === _optionalChain([round3, 'optionalAccess', _2394 => _2394.id]) ? subTasks : [];
140865
140780
  const tree = _react.useMemo.call(void 0,
140866
140781
  () => [selectedRound, ...selectedSubTasks].filter((t5) => t5 !== null),
140867
140782
  // Deps mirror the derived inputs; keeps `relatedTasks` identity stable for the modal.
@@ -140869,7 +140784,7 @@ var init_LearningProgressCard = __esm({
140869
140784
  );
140870
140785
  const activeTasks = selectedSubTasks.filter((t5) => t5.status === "in_progress");
140871
140786
  const activeTask = _nullishCoalesce(activeTasks[0], () => ( null));
140872
- const isRoundLive = _optionalChain([selectedRound, 'optionalAccess', _2396 => _2396.status]) === "in_progress";
140787
+ const isRoundLive = _optionalChain([selectedRound, 'optionalAccess', _2395 => _2395.status]) === "in_progress";
140873
140788
  const liveTargetIds = (activeTasks.length > 0 ? activeTasks.map((task) => task.id) : isRoundLive && selectedRound ? [selectedRound.id] : []).sort();
140874
140789
  const liveTargetKey = liveTargetIds.join(",");
140875
140790
  const clientRef = _react.useRef.call(void 0, client);
@@ -140910,7 +140825,7 @@ var init_LearningProgressCard = __esm({
140910
140825
  const entry = { promise: request, source, detailSession };
140911
140826
  workItemRequestsRef.current.set(taskId, entry);
140912
140827
  void request.finally(() => {
140913
- if (_optionalChain([workItemRequestsRef, 'access', _2397 => _2397.current, 'access', _2398 => _2398.get, 'call', _2399 => _2399(taskId), 'optionalAccess', _2400 => _2400.promise]) === request) {
140828
+ if (_optionalChain([workItemRequestsRef, 'access', _2396 => _2396.current, 'access', _2397 => _2397.get, 'call', _2398 => _2398(taskId), 'optionalAccess', _2399 => _2399.promise]) === request) {
140914
140829
  workItemRequestsRef.current.delete(taskId);
140915
140830
  }
140916
140831
  }).catch(() => void 0);
@@ -140973,7 +140888,7 @@ var init_LearningProgressCard = __esm({
140973
140888
  void refreshPromise.catch(() => {
140974
140889
  if (mountedRef.current) messageApi.error(t4("governance.learning.createdRefreshFailed"));
140975
140890
  });
140976
- _optionalChain([onLearningStarted, 'optionalCall', _2401 => _2401(goal, roundTaskId, files)]);
140891
+ _optionalChain([onLearningStarted, 'optionalCall', _2400 => _2400(goal, roundTaskId, files)]);
140977
140892
  };
140978
140893
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { background: "rgba(255, 255, 255, 0.6)", border: "1px solid rgba(240, 240, 240, 0.7)", borderRadius: 10, padding: "8px 10px", boxShadow: "0 2px 10px rgba(0,0,0,0.06)", backdropFilter: "blur(8px)", pointerEvents: "auto", width: 300 }, children: [
140979
140894
  loading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { fontSize: 12, color: "#bbb", padding: "4px 2px" }, children: t4("common.loading") }) : selectedRound ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
@@ -141231,7 +141146,7 @@ var init_LearningWorkflowGraph = __esm({
141231
141146
  clientRef.current = client;
141232
141147
  const roundListKey = rounds.map((r6) => r6.id).join(",");
141233
141148
  _react.useEffect.call(void 0, () => {
141234
- setSelectedRoundId((prev) => prev && roundListKey.split(",").includes(prev) ? prev : _nullishCoalesce(_optionalChain([rounds, 'access', _2402 => _2402[0], 'optionalAccess', _2403 => _2403.id]), () => ( null)));
141149
+ setSelectedRoundId((prev) => prev && roundListKey.split(",").includes(prev) ? prev : _nullishCoalesce(_optionalChain([rounds, 'access', _2401 => _2401[0], 'optionalAccess', _2402 => _2402.id]), () => ( null)));
141235
141150
  }, [roundListKey]);
141236
141151
  const selectedRound = _nullishCoalesce(_nullishCoalesce(rounds.find((r6) => r6.id === selectedRoundId), () => ( rounds[0])), () => ( null));
141237
141152
  const tree = _react.useMemo.call(void 0,
@@ -141257,8 +141172,8 @@ var init_LearningWorkflowGraph = __esm({
141257
141172
  const initialEdges = _react.useMemo.call(void 0,
141258
141173
  () => displayEdges.map((e8) => {
141259
141174
  const flow = classifyEdge(
141260
- _nullishCoalesce(_optionalChain([taskById, 'access', _2404 => _2404.get, 'call', _2405 => _2405(e8.from), 'optionalAccess', _2406 => _2406.status]), () => ( "pending")),
141261
- _nullishCoalesce(_optionalChain([taskById, 'access', _2407 => _2407.get, 'call', _2408 => _2408(e8.to), 'optionalAccess', _2409 => _2409.status]), () => ( "pending"))
141175
+ _nullishCoalesce(_optionalChain([taskById, 'access', _2403 => _2403.get, 'call', _2404 => _2404(e8.from), 'optionalAccess', _2405 => _2405.status]), () => ( "pending")),
141176
+ _nullishCoalesce(_optionalChain([taskById, 'access', _2406 => _2406.get, 'call', _2407 => _2407(e8.to), 'optionalAccess', _2408 => _2408.status]), () => ( "pending"))
141262
141177
  );
141263
141178
  return {
141264
141179
  id: `${e8.from}->${e8.to}:${e8.kind}`,
@@ -141309,7 +141224,7 @@ var init_LearningWorkflowGraph = __esm({
141309
141224
  }, [t4]);
141310
141225
  const handleNodeClick2 = _react.useCallback.call(void 0,
141311
141226
  (_event, node) => {
141312
- const task = _optionalChain([node, 'access', _2410 => _2410.data, 'optionalAccess', _2411 => _2411.task]);
141227
+ const task = _optionalChain([node, 'access', _2409 => _2409.data, 'optionalAccess', _2410 => _2410.task]);
141313
141228
  if (!task) return;
141314
141229
  setWorkItems([]);
141315
141230
  setSelectedTask(task);
@@ -141479,18 +141394,18 @@ var init_CanvasDock = __esm({
141479
141394
  }, [escapeEnabled, open, onClose]);
141480
141395
  _react.useEffect.call(void 0, () => {
141481
141396
  if (!focusControlRef) return;
141482
- focusControlRef.current = () => _optionalChain([closeButtonRef, 'access', _2412 => _2412.current, 'optionalAccess', _2413 => _2413.focus, 'call', _2414 => _2414()]);
141397
+ focusControlRef.current = () => _optionalChain([closeButtonRef, 'access', _2411 => _2411.current, 'optionalAccess', _2412 => _2412.focus, 'call', _2413 => _2413()]);
141483
141398
  return () => {
141484
141399
  focusControlRef.current = null;
141485
141400
  };
141486
141401
  }, [focusControlRef]);
141487
141402
  _react.useEffect.call(void 0, () => {
141488
141403
  if (!open) return;
141489
- const focusTarget = _nullishCoalesce(_optionalChain([restoreFocusRef, 'optionalAccess', _2415 => _2415.current]), () => ( document.activeElement));
141404
+ const focusTarget = _nullishCoalesce(_optionalChain([restoreFocusRef, 'optionalAccess', _2414 => _2414.current]), () => ( document.activeElement));
141490
141405
  if (focusTarget instanceof HTMLElement) restoreFocusTargetRef.current = focusTarget;
141491
- _optionalChain([closeButtonRef, 'access', _2416 => _2416.current, 'optionalAccess', _2417 => _2417.focus, 'call', _2418 => _2418()]);
141406
+ _optionalChain([closeButtonRef, 'access', _2415 => _2415.current, 'optionalAccess', _2416 => _2416.focus, 'call', _2417 => _2417()]);
141492
141407
  return () => {
141493
- _optionalChain([restoreFocusTargetRef, 'access', _2419 => _2419.current, 'optionalAccess', _2420 => _2420.focus, 'call', _2421 => _2421()]);
141408
+ _optionalChain([restoreFocusTargetRef, 'access', _2418 => _2418.current, 'optionalAccess', _2419 => _2419.focus, 'call', _2420 => _2420()]);
141494
141409
  restoreFocusTargetRef.current = null;
141495
141410
  };
141496
141411
  }, [open]);
@@ -141589,7 +141504,7 @@ var init_CanvasDock = __esm({
141589
141504
  });
141590
141505
 
141591
141506
  // src/components/Governance/evalQuality.ts
141592
- function scoreColor2(score2) {
141507
+ function scoreColor(score2) {
141593
141508
  return score2 >= 80 ? "#22c55e" : score2 >= 50 ? "#f59e0b" : "#ef4444";
141594
141509
  }
141595
141510
  function visibleRuns(runs) {
@@ -141672,7 +141587,7 @@ function buildRoundTrendOption({ rounds, runs, selectedRoundId, targetLabel }) {
141672
141587
  return {
141673
141588
  value: [i4 + 1, score2],
141674
141589
  itemStyle: {
141675
- color: scoreColor2(score2),
141590
+ color: scoreColor(score2),
141676
141591
  borderRadius: [4, 4, 0, 0],
141677
141592
  ...selected2 ? { borderColor: "#6366f1", borderWidth: 2 } : {}
141678
141593
  }
@@ -141776,7 +141691,7 @@ var init_EvalQualitySummary = __esm({
141776
141691
  if (summary.latestScore === null) return null;
141777
141692
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-testid": "eval-summary", style: { display: "flex", gap: 28 }, children: [
141778
141693
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
141779
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { ...VALUE, color: scoreColor2(summary.latestScore) }, children: [
141694
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { ...VALUE, color: scoreColor(summary.latestScore) }, children: [
141780
141695
  summary.latestScore.toFixed(1),
141781
141696
  summary.delta !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { "data-testid": "summary-delta", style: { fontSize: 11, fontWeight: 600, color: summary.delta >= 0 ? "#22c55e" : "#ef4444", marginLeft: 6 }, children: [
141782
141697
  summary.delta >= 0 ? "\u25B2" : "\u25BC",
@@ -141856,7 +141771,7 @@ var init_RoundTrendChart = __esm({
141856
141771
  const round3 = rounds[p7.dataIndex];
141857
141772
  if (round3) {
141858
141773
  setInternalSelectedRoundId(round3.id);
141859
- _optionalChain([onSelectRound, 'optionalCall', _2422 => _2422(round3.id)]);
141774
+ _optionalChain([onSelectRound, 'optionalCall', _2421 => _2421(round3.id)]);
141860
141775
  }
141861
141776
  }
141862
141777
  }),
@@ -141890,8 +141805,8 @@ var init_DimensionPanorama = __esm({
141890
141805
  const pct = Math.min(Math.max(d3.avgScore, 0), 100);
141891
141806
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-testid": `dimension-row-${d3.name}`, style: { display: "flex", alignItems: "center", gap: 8, fontSize: 11 }, children: [
141892
141807
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": `dimension-label-${d3.name}`, style: { flexShrink: 0, maxWidth: "60%", color: "#595959", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: d3.name, children: d3.name }),
141893
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { flex: 1, height: 8, background: "#f5f5f5", borderRadius: 4, overflow: "hidden" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-testid": `dimension-fill-${d3.name}`, style: { width: `${pct}%`, height: "100%", background: scoreColor2(d3.avgScore), borderRadius: 4 } }) }),
141894
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { width: 28, textAlign: "right", flexShrink: 0, fontWeight: 600, color: scoreColor2(d3.avgScore) }, children: Math.round(d3.avgScore) })
141808
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { flex: 1, height: 8, background: "#f5f5f5", borderRadius: 4, overflow: "hidden" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-testid": `dimension-fill-${d3.name}`, style: { width: `${pct}%`, height: "100%", background: scoreColor(d3.avgScore), borderRadius: 4 } }) }),
141809
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { width: 28, textAlign: "right", flexShrink: 0, fontWeight: 600, color: scoreColor(d3.avgScore) }, children: Math.round(d3.avgScore) })
141895
141810
  ] }, d3.name);
141896
141811
  }) });
141897
141812
  };
@@ -141962,7 +141877,7 @@ var init_EvalQualityPanel = __esm({
141962
141877
  return;
141963
141878
  }
141964
141879
  let cancelled = false;
141965
- getRef.current(`/api/eval/runs/${runId}`).then((res) => !cancelled && setResults(_nullishCoalesce(_optionalChain([res, 'access', _2423 => _2423.data, 'optionalAccess', _2424 => _2424.results]), () => ( [])))).catch(() => !cancelled && setResults([]));
141880
+ getRef.current(`/api/eval/runs/${runId}`).then((res) => !cancelled && setResults(_nullishCoalesce(_optionalChain([res, 'access', _2422 => _2422.data, 'optionalAccess', _2423 => _2423.results]), () => ( [])))).catch(() => !cancelled && setResults([]));
141966
141881
  return () => {
141967
141882
  cancelled = true;
141968
141883
  };
@@ -142328,7 +142243,7 @@ function selectLearningTree(learningTasks, selectedRoundId) {
142328
142243
  return selectedRound ? [selectedRound, ..._nullishCoalesce(learningTasks.subTasksByRound[selectedRound.id], () => ( []))] : [];
142329
142244
  }
142330
142245
  function isWaitingForApproval2(task) {
142331
- const interruption = _optionalChain([task, 'access', _2425 => _2425.context, 'optionalAccess', _2426 => _2426.interruption]);
142246
+ const interruption = _optionalChain([task, 'access', _2424 => _2424.context, 'optionalAccess', _2425 => _2425.interruption]);
142332
142247
  return task.status === "interrupted" && typeof interruption === "object" && interruption !== null && interruption.type === "review_required";
142333
142248
  }
142334
142249
  function relativeActivity(time2, t4) {
@@ -142353,7 +142268,7 @@ function buildRoundTree(tree) {
142353
142268
  const childrenOf = /* @__PURE__ */ new Map();
142354
142269
  for (const t4 of tree) {
142355
142270
  if (round3 && t4.id === round3.id) continue;
142356
- const parent = t4.parentId && t4.parentId !== t4.id && byId.has(t4.parentId) ? t4.parentId : _optionalChain([round3, 'optionalAccess', _2427 => _2427.id]);
142271
+ const parent = t4.parentId && t4.parentId !== t4.id && byId.has(t4.parentId) ? t4.parentId : _optionalChain([round3, 'optionalAccess', _2426 => _2426.id]);
142357
142272
  if (!parent) continue;
142358
142273
  const siblings = _nullishCoalesce(childrenOf.get(parent), () => ( []));
142359
142274
  siblings.push(t4);
@@ -142406,7 +142321,7 @@ function dependencyOrder(members) {
142406
142321
  for (const m3 of members) {
142407
142322
  for (const depId of _nullishCoalesce(m3.dependencies, () => ( []))) {
142408
142323
  if (memberIds.has(depId) && depId !== m3.id) {
142409
- _optionalChain([dependents, 'access', _2428 => _2428.get, 'call', _2429 => _2429(depId), 'optionalAccess', _2430 => _2430.push, 'call', _2431 => _2431(m3.id)]);
142324
+ _optionalChain([dependents, 'access', _2427 => _2427.get, 'call', _2428 => _2428(depId), 'optionalAccess', _2429 => _2429.push, 'call', _2430 => _2430(m3.id)]);
142410
142325
  indegree.set(m3.id, (_nullishCoalesce(indegree.get(m3.id), () => ( 0))) + 1);
142411
142326
  }
142412
142327
  }
@@ -142584,7 +142499,7 @@ function buildLearningRoundViewModel(learningTasks, selectedRoundId, focusTaskId
142584
142499
  doneCount,
142585
142500
  roundNumber,
142586
142501
  roundOptions,
142587
- roundLatestActivity: relativeActivity(_optionalChain([latest, 'optionalAccess', _2432 => _2432.updatedAt]), t4),
142502
+ roundLatestActivity: relativeActivity(_optionalChain([latest, 'optionalAccess', _2431 => _2431.updatedAt]), t4),
142588
142503
  breadcrumb
142589
142504
  };
142590
142505
  }
@@ -142604,7 +142519,7 @@ function learningDagEdges(model, options) {
142604
142519
  ...edge.kind === "dependency" ? { markerEnd: DEPENDENCY_EDGE_MARKER } : {}
142605
142520
  };
142606
142521
  }
142607
- const flow = classifyDownstreamEdge(_nullishCoalesce(_optionalChain([byId, 'access', _2433 => _2433.get, 'call', _2434 => _2434(edge.to), 'optionalAccess', _2435 => _2435.status]), () => ( "pending")));
142522
+ const flow = classifyDownstreamEdge(_nullishCoalesce(_optionalChain([byId, 'access', _2432 => _2432.get, 'call', _2433 => _2433(edge.to), 'optionalAccess', _2434 => _2434.status]), () => ( "pending")));
142608
142523
  return {
142609
142524
  id: `${prefix}${edge.from}->${edge.to}:structure`,
142610
142525
  source: nodeId(edge.from),
@@ -142654,11 +142569,11 @@ function useLearningZoneNodes(options) {
142654
142569
  // Raw parent state (null = follow) — clearing the selector returns to
142655
142570
  // it; the selector displays the effective (followed) round meanwhile.
142656
142571
  selectedRoundId,
142657
- selectedRoundValue: _nullishCoalesce(_optionalChain([selectedRound, 'optionalAccess', _2436 => _2436.id]), () => ( null)),
142572
+ selectedRoundValue: _nullishCoalesce(_optionalChain([selectedRound, 'optionalAccess', _2435 => _2435.id]), () => ( null)),
142658
142573
  onSelectRound,
142659
142574
  roundNumber,
142660
- roundTitle: _nullishCoalesce(_optionalChain([selectedRound, 'optionalAccess', _2437 => _2437.title]), () => ( null)),
142661
- roundStatus: _nullishCoalesce(_optionalChain([selectedRound, 'optionalAccess', _2438 => _2438.status]), () => ( null)),
142575
+ roundTitle: _nullishCoalesce(_optionalChain([selectedRound, 'optionalAccess', _2436 => _2436.title]), () => ( null)),
142576
+ roundStatus: _nullishCoalesce(_optionalChain([selectedRound, 'optionalAccess', _2437 => _2437.status]), () => ( null)),
142662
142577
  roundDoneCount: doneCount,
142663
142578
  roundTotalCount: tree.length,
142664
142579
  roundWaitingCount: reviewTasks.length,
@@ -142850,7 +142765,7 @@ var init_LearningZone = __esm({
142850
142765
  {
142851
142766
  type: "button",
142852
142767
  "data-testid": "learning-crumb-back",
142853
- onClick: () => onFocusTask(_nullishCoalesce(_optionalChain([breadcrumb, 'access', _2439 => _2439[breadcrumb.length - 2], 'optionalAccess', _2440 => _2440.id]), () => ( null))),
142768
+ onClick: () => onFocusTask(_nullishCoalesce(_optionalChain([breadcrumb, 'access', _2438 => _2438[breadcrumb.length - 2], 'optionalAccess', _2439 => _2439.id]), () => ( null))),
142854
142769
  style: { border: "none", background: "rgba(99,102,241,0.08)", borderRadius: 9999, padding: "1px 8px", cursor: "pointer", fontSize: 11, fontWeight: 600, color: "#6366f1" },
142855
142770
  children: t4("governance.learning.back")
142856
142771
  }
@@ -142917,7 +142832,7 @@ var init_LearningZone = __esm({
142917
142832
  defaultProjectId: _nullishCoalesce(data.projectId, () => ( void 0)),
142918
142833
  onClose: () => setModalOpen(false),
142919
142834
  onCreated: (roundTaskId, _threadId, goal, files) => {
142920
- _optionalChain([data, 'access', _2441 => _2441.onLearningStarted, 'optionalCall', _2442 => _2442(goal, roundTaskId, files)]);
142835
+ _optionalChain([data, 'access', _2440 => _2440.onLearningStarted, 'optionalCall', _2441 => _2441(goal, roundTaskId, files)]);
142921
142836
  setModalOpen(false);
142922
142837
  }
142923
142838
  }
@@ -143001,7 +142916,7 @@ var init_LearningZone = __esm({
143001
142916
  "aria-label": t4("governance.learning.expandNested", { count: data.fold.count, title: data.task.title }),
143002
142917
  onClick: (e8) => {
143003
142918
  e8.stopPropagation();
143004
- _optionalChain([data, 'access', _2443 => _2443.onFocusTask, 'optionalCall', _2444 => _2444(data.task.id)]);
142919
+ _optionalChain([data, 'access', _2442 => _2442.onFocusTask, 'optionalCall', _2443 => _2443(data.task.id)]);
143005
142920
  },
143006
142921
  style: {
143007
142922
  display: "inline-flex",
@@ -143133,7 +143048,7 @@ var init_CanvasPinnedRail = __esm({
143133
143048
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: TITLE, children: t4("governance.overlay.evalQuality") }),
143134
143049
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", gap: 14, fontSize: 12, alignItems: "baseline" }, children: [
143135
143050
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
143136
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { "data-testid": "eval-mini-score", style: { fontSize: 18, color: score2 === null ? "#d9d9d9" : scoreColor2(score2) }, children: score2 !== null ? score2.toFixed(1) : "\u2014" }),
143051
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { "data-testid": "eval-mini-score", style: { fontSize: 18, color: score2 === null ? "#d9d9d9" : scoreColor(score2) }, children: score2 !== null ? score2.toFixed(1) : "\u2014" }),
143137
143052
  " ",
143138
143053
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { color: "#bbb" }, children: t4("governance.overlay.stat.score") })
143139
143054
  ] }),
@@ -143181,8 +143096,8 @@ var init_CanvasPinnedRail = __esm({
143181
143096
  const handleCreated = (roundTaskId, _threadId, goal, files) => {
143182
143097
  onSelectRound(roundTaskId);
143183
143098
  setModalOpen(false);
143184
- void Promise.resolve(_optionalChain([onLearningRefresh, 'optionalCall', _2445 => _2445()])).catch(() => void 0);
143185
- _optionalChain([onLearningStarted, 'optionalCall', _2446 => _2446(goal, roundTaskId, files)]);
143099
+ void Promise.resolve(_optionalChain([onLearningRefresh, 'optionalCall', _2444 => _2444()])).catch(() => void 0);
143100
+ _optionalChain([onLearningStarted, 'optionalCall', _2445 => _2445(goal, roundTaskId, files)]);
143186
143101
  };
143187
143102
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-testid": "learning-mini", style: MINI_CARD, children: [
143188
143103
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 6, marginBottom: 6 }, children: [
@@ -143209,7 +143124,7 @@ var init_CanvasPinnedRail = __esm({
143209
143124
  size: "small",
143210
143125
  "data-testid": "learning-mini-round",
143211
143126
  style: { width: "100%", marginBottom: 6 },
143212
- value: _nullishCoalesce(_optionalChain([view, 'access', _2447 => _2447.selectedRound, 'optionalAccess', _2448 => _2448.id]), () => ( void 0)),
143127
+ value: _nullishCoalesce(_optionalChain([view, 'access', _2446 => _2446.selectedRound, 'optionalAccess', _2447 => _2447.id]), () => ( void 0)),
143213
143128
  allowClear: true,
143214
143129
  placeholder: t4("governance.learning.selectRound"),
143215
143130
  onChange: (value) => onSelectRound(_nullishCoalesce(value, () => ( null))),
@@ -143326,7 +143241,7 @@ var init_CanvasZone = __esm({
143326
143241
  onMouseDown: (e8) => e8.stopPropagation(),
143327
143242
  onClick: (e8) => {
143328
143243
  e8.stopPropagation();
143329
- _optionalChain([data, 'access', _2449 => _2449.onPinToggle, 'optionalCall', _2450 => _2450()]);
143244
+ _optionalChain([data, 'access', _2448 => _2448.onPinToggle, 'optionalCall', _2449 => _2449()]);
143330
143245
  },
143331
143246
  onMouseEnter: () => setPinHover(true),
143332
143247
  onMouseLeave: () => setPinHover(false),
@@ -143383,9 +143298,9 @@ var init_CopilotPanel = __esm({
143383
143298
  }) => {
143384
143299
  const t4 = useT();
143385
143300
  const client = useClient("agent-architect");
143386
- const threadId = _optionalChain([workflowContext, 'optionalAccess', _2451 => _2451.id]) ? `${client.tenantId}:${workflowContext.id}` : null;
143301
+ const threadId = _optionalChain([workflowContext, 'optionalAccess', _2450 => _2450.id]) ? `${client.tenantId}:${workflowContext.id}` : null;
143387
143302
  const systemContext = _react.useMemo.call(void 0, () => {
143388
- if (_optionalChain([workflowContext, 'optionalAccess', _2452 => _2452.id]) && _optionalChain([workflowContext, 'optionalAccess', _2453 => _2453.name])) {
143303
+ if (_optionalChain([workflowContext, 'optionalAccess', _2451 => _2451.id]) && _optionalChain([workflowContext, 'optionalAccess', _2452 => _2452.name])) {
143389
143304
  if (workflowContext.type === "agent") {
143390
143305
  return `[Context: You're viewing agent "${workflowContext.name}" (assistant: ${workflowContext.id})]`;
143391
143306
  }
@@ -143395,7 +143310,7 @@ var init_CopilotPanel = __esm({
143395
143310
  return void 0;
143396
143311
  }, [workflowContext]);
143397
143312
  const preparedInitialMessageRequest = _react.useMemo.call(void 0, () => {
143398
- if (!initialMessageRequest || !_optionalChain([workflowContext, 'optionalAccess', _2454 => _2454.id])) return null;
143313
+ if (!initialMessageRequest || !_optionalChain([workflowContext, 'optionalAccess', _2453 => _2453.id])) return null;
143399
143314
  if (rawInitialMessage) return initialMessageRequest;
143400
143315
  let content;
143401
143316
  if (workflowContext.type === "workflow") {
@@ -143414,10 +143329,10 @@ var init_CopilotPanel = __esm({
143414
143329
  }
143415
143330
  return { ...initialMessageRequest, content };
143416
143331
  }, [
143417
- _optionalChain([initialMessageRequest, 'optionalAccess', _2455 => _2455.requestId]),
143418
- _optionalChain([initialMessageRequest, 'optionalAccess', _2456 => _2456.content]),
143419
- _optionalChain([workflowContext, 'optionalAccess', _2457 => _2457.id]),
143420
- _optionalChain([workflowContext, 'optionalAccess', _2458 => _2458.type]),
143332
+ _optionalChain([initialMessageRequest, 'optionalAccess', _2454 => _2454.requestId]),
143333
+ _optionalChain([initialMessageRequest, 'optionalAccess', _2455 => _2455.content]),
143334
+ _optionalChain([workflowContext, 'optionalAccess', _2456 => _2456.id]),
143335
+ _optionalChain([workflowContext, 'optionalAccess', _2457 => _2457.type]),
143421
143336
  rawInitialMessage
143422
143337
  ]);
143423
143338
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -143573,21 +143488,21 @@ function useCopilotKickoffRequest({
143573
143488
  const next = { assistantId, observedRequest: incomingRequest, request: incomingRequest };
143574
143489
  committedPendingRecordRef.current = next;
143575
143490
  setPendingRecord(next);
143576
- }, [assistantId, _optionalChain([incomingRequest, 'optionalAccess', _2459 => _2459.requestId]), _optionalChain([incomingRequest, 'optionalAccess', _2460 => _2460.content])]);
143491
+ }, [assistantId, _optionalChain([incomingRequest, 'optionalAccess', _2458 => _2458.requestId]), _optionalChain([incomingRequest, 'optionalAccess', _2459 => _2459.content])]);
143577
143492
  const effectivePendingRequest = pendingRecord.assistantId === assistantId && kickoffRequestsMatch(pendingRecord.observedRequest, incomingRequest) ? pendingRecord.request : null;
143578
143493
  const handleInitialMessageSubmitted = (requestId) => {
143579
143494
  const current = committedPendingRecordRef.current;
143580
143495
  if (current.assistantId !== assistantId) {
143581
143496
  return;
143582
143497
  }
143583
- if (_optionalChain([current, 'access', _2461 => _2461.request, 'optionalAccess', _2462 => _2462.requestId]) === requestId) {
143498
+ if (_optionalChain([current, 'access', _2460 => _2460.request, 'optionalAccess', _2461 => _2461.requestId]) === requestId) {
143584
143499
  const next = { ...current, request: null };
143585
143500
  committedPendingRecordRef.current = next;
143586
143501
  setPendingRecord(
143587
- (record3) => record3.assistantId === assistantId && _optionalChain([record3, 'access', _2463 => _2463.request, 'optionalAccess', _2464 => _2464.requestId]) === requestId ? { ...record3, request: null } : record3
143502
+ (record3) => record3.assistantId === assistantId && _optionalChain([record3, 'access', _2462 => _2462.request, 'optionalAccess', _2463 => _2463.requestId]) === requestId ? { ...record3, request: null } : record3
143588
143503
  );
143589
143504
  }
143590
- _optionalChain([onInitialMessageSubmitted, 'optionalCall', _2465 => _2465(requestId)]);
143505
+ _optionalChain([onInitialMessageSubmitted, 'optionalCall', _2464 => _2464(requestId)]);
143591
143506
  };
143592
143507
  return { attemptedRequestIdsRef, effectivePendingRequest, handleInitialMessageSubmitted };
143593
143508
  }
@@ -143595,7 +143510,7 @@ var kickoffRequestsMatch;
143595
143510
  var init_useCopilotKickoffRequest = __esm({
143596
143511
  "src/components/Governance/useCopilotKickoffRequest.ts"() {
143597
143512
  "use strict";
143598
- kickoffRequestsMatch = (left2, right2) => _optionalChain([left2, 'optionalAccess', _2466 => _2466.requestId]) === _optionalChain([right2, 'optionalAccess', _2467 => _2467.requestId]) && _optionalChain([left2, 'optionalAccess', _2468 => _2468.content]) === _optionalChain([right2, 'optionalAccess', _2469 => _2469.content]);
143513
+ kickoffRequestsMatch = (left2, right2) => _optionalChain([left2, 'optionalAccess', _2465 => _2465.requestId]) === _optionalChain([right2, 'optionalAccess', _2466 => _2466.requestId]) && _optionalChain([left2, 'optionalAccess', _2467 => _2467.content]) === _optionalChain([right2, 'optionalAccess', _2468 => _2468.content]);
143599
143514
  }
143600
143515
  });
143601
143516
 
@@ -143668,7 +143583,7 @@ var init_ArchitectCopilotDock = __esm({
143668
143583
  if (incomingRequest && !isMobile) {
143669
143584
  setUserOpen(true);
143670
143585
  }
143671
- }, [assistantId, _optionalChain([incomingRequest, 'optionalAccess', _2470 => _2470.requestId]), _optionalChain([incomingRequest, 'optionalAccess', _2471 => _2471.content]), isMobile]);
143586
+ }, [assistantId, _optionalChain([incomingRequest, 'optionalAccess', _2469 => _2469.requestId]), _optionalChain([incomingRequest, 'optionalAccess', _2470 => _2470.content]), isMobile]);
143672
143587
  const handleResizeStart = _react.useCallback.call(void 0, (e8) => {
143673
143588
  e8.preventDefault();
143674
143589
  resizingRef.current = { startX: e8.clientX, startWidth: copilotWidth };
@@ -143806,7 +143721,7 @@ var init_ArchitectCopilotDock = __esm({
143806
143721
  styles: { body: { padding: 0, overflow: "hidden", height: "100%" } },
143807
143722
  afterOpenChange: (open) => {
143808
143723
  if (!open && !userOpen) {
143809
- _optionalChain([(_nullishCoalesce(_optionalChain([restoreFocusRef, 'optionalAccess', _2472 => _2472.current]), () => ( openerRef.current))), 'optionalAccess', _2473 => _2473.focus, 'call', _2474 => _2474()]);
143724
+ _optionalChain([(_nullishCoalesce(_optionalChain([restoreFocusRef, 'optionalAccess', _2471 => _2471.current]), () => ( openerRef.current))), 'optionalAccess', _2472 => _2472.focus, 'call', _2473 => _2473()]);
143810
143725
  }
143811
143726
  },
143812
143727
  children: panel
@@ -144017,7 +143932,7 @@ var init_TestingZone = __esm({
144017
143932
  gap: 6
144018
143933
  },
144019
143934
  children: [
144020
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { width: 10, height: 10, borderRadius: 9999, background: data.score === null ? "#d1d5db" : scoreColor2(data.score), flexShrink: 0 } }),
143935
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { width: 10, height: 10, borderRadius: 9999, background: data.score === null ? "#d1d5db" : scoreColor(data.score), flexShrink: 0 } }),
144021
143936
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontSize: 12, fontWeight: 600, color: "#6b7280" }, children: data.suiteCount })
144022
143937
  ]
144023
143938
  }
@@ -144102,7 +144017,7 @@ var init_LearningTaskGraphView = __esm({
144102
144017
  }, [dagNodes, dagEdges, setFlowNodes, setFlowEdges]);
144103
144018
  const handleNodeClick2 = _react.useCallback.call(void 0, (_event, node) => {
144104
144019
  const data = node.data;
144105
- _optionalChain([data, 'access', _2475 => _2475.onTaskClick, 'optionalCall', _2476 => _2476()]);
144020
+ _optionalChain([data, 'access', _2474 => _2474.onTaskClick, 'optionalCall', _2475 => _2475()]);
144106
144021
  }, []);
144107
144022
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { width: "100%", height, display: "flex", flexDirection: "column", minHeight: 0 }, children: [
144108
144023
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "nodrag nowheel nopan", style: { flexShrink: 0, padding: "12px 16px 4px" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -144114,11 +144029,11 @@ var init_LearningTaskGraphView = __esm({
144114
144029
  if (view.reviewTasks[0]) onTaskClick(view.reviewTasks[0], view.tree);
144115
144030
  },
144116
144031
  roundOptions: view.roundOptions,
144117
- selectedRoundValue: _nullishCoalesce(_optionalChain([view, 'access', _2477 => _2477.selectedRound, 'optionalAccess', _2478 => _2478.id]), () => ( null)),
144032
+ selectedRoundValue: _nullishCoalesce(_optionalChain([view, 'access', _2476 => _2476.selectedRound, 'optionalAccess', _2477 => _2477.id]), () => ( null)),
144118
144033
  onSelectRound,
144119
144034
  roundNumber: view.roundNumber,
144120
- roundTitle: _nullishCoalesce(_optionalChain([view, 'access', _2479 => _2479.selectedRound, 'optionalAccess', _2480 => _2480.title]), () => ( null)),
144121
- roundStatus: _nullishCoalesce(_optionalChain([view, 'access', _2481 => _2481.selectedRound, 'optionalAccess', _2482 => _2482.status]), () => ( null)),
144035
+ roundTitle: _nullishCoalesce(_optionalChain([view, 'access', _2478 => _2478.selectedRound, 'optionalAccess', _2479 => _2479.title]), () => ( null)),
144036
+ roundStatus: _nullishCoalesce(_optionalChain([view, 'access', _2480 => _2480.selectedRound, 'optionalAccess', _2481 => _2481.status]), () => ( null)),
144122
144037
  roundDoneCount: view.doneCount,
144123
144038
  roundTotalCount: view.tree.length,
144124
144039
  roundWaitingCount: view.reviewTasks.length,
@@ -144221,14 +144136,14 @@ var init_AgentConfigGraph = __esm({
144221
144136
  GUIDE_DISMISSED_KEY = "axiom.trainingCanvas.guideDismissed";
144222
144137
  readGuideDismissed = () => {
144223
144138
  try {
144224
- return typeof window !== "undefined" && _optionalChain([window, 'access', _2483 => _2483.localStorage, 'optionalAccess', _2484 => _2484.getItem, 'call', _2485 => _2485(GUIDE_DISMISSED_KEY)]) === "1";
144139
+ return typeof window !== "undefined" && _optionalChain([window, 'access', _2482 => _2482.localStorage, 'optionalAccess', _2483 => _2483.getItem, 'call', _2484 => _2484(GUIDE_DISMISSED_KEY)]) === "1";
144225
144140
  } catch (e108) {
144226
144141
  return false;
144227
144142
  }
144228
144143
  };
144229
144144
  writeGuideDismissed = (dismissed) => {
144230
144145
  try {
144231
- _optionalChain([window, 'access', _2486 => _2486.localStorage, 'optionalAccess', _2487 => _2487.setItem, 'call', _2488 => _2488(GUIDE_DISMISSED_KEY, dismissed ? "1" : "0")]);
144146
+ _optionalChain([window, 'access', _2485 => _2485.localStorage, 'optionalAccess', _2486 => _2486.setItem, 'call', _2487 => _2487(GUIDE_DISMISSED_KEY, dismissed ? "1" : "0")]);
144232
144147
  } catch (e109) {
144233
144148
  }
144234
144149
  };
@@ -144244,7 +144159,7 @@ var init_AgentConfigGraph = __esm({
144244
144159
  readCanvasLayout = () => {
144245
144160
  try {
144246
144161
  if (typeof window === "undefined") return null;
144247
- const raw = _optionalChain([window, 'access', _2489 => _2489.localStorage, 'optionalAccess', _2490 => _2490.getItem, 'call', _2491 => _2491(CANVAS_LAYOUT_KEY)]);
144162
+ const raw = _optionalChain([window, 'access', _2488 => _2488.localStorage, 'optionalAccess', _2489 => _2489.getItem, 'call', _2490 => _2490(CANVAS_LAYOUT_KEY)]);
144248
144163
  if (!raw) return null;
144249
144164
  const parsed = JSON.parse(raw);
144250
144165
  if (typeof parsed !== "object" || parsed === null) return null;
@@ -144268,13 +144183,13 @@ var init_AgentConfigGraph = __esm({
144268
144183
  writeCanvasLayout = (pinned, origins) => {
144269
144184
  try {
144270
144185
  const record3 = { version: 1, pinned: [...pinned], origins };
144271
- _optionalChain([window, 'access', _2492 => _2492.localStorage, 'optionalAccess', _2493 => _2493.setItem, 'call', _2494 => _2494(CANVAS_LAYOUT_KEY, JSON.stringify(record3))]);
144186
+ _optionalChain([window, 'access', _2491 => _2491.localStorage, 'optionalAccess', _2492 => _2492.setItem, 'call', _2493 => _2493(CANVAS_LAYOUT_KEY, JSON.stringify(record3))]);
144272
144187
  } catch (e111) {
144273
144188
  }
144274
144189
  };
144275
144190
  clearCanvasLayout = () => {
144276
144191
  try {
144277
- _optionalChain([window, 'access', _2495 => _2495.localStorage, 'optionalAccess', _2496 => _2496.removeItem, 'call', _2497 => _2497(CANVAS_LAYOUT_KEY)]);
144192
+ _optionalChain([window, 'access', _2494 => _2494.localStorage, 'optionalAccess', _2495 => _2495.removeItem, 'call', _2496 => _2496(CANVAS_LAYOUT_KEY)]);
144278
144193
  } catch (e112) {
144279
144194
  }
144280
144195
  };
@@ -144302,7 +144217,7 @@ var init_AgentConfigGraph = __esm({
144302
144217
  });
144303
144218
  const [manualOrigins, setManualOrigins] = _react.useState.call(void 0, () => {
144304
144219
  const restored = {};
144305
- for (const [id2, origin] of Object.entries(_nullishCoalesce(_optionalChain([readCanvasLayout, 'call', _2498 => _2498(), 'optionalAccess', _2499 => _2499.origins]), () => ( {})))) {
144220
+ for (const [id2, origin] of Object.entries(_nullishCoalesce(_optionalChain([readCanvasLayout, 'call', _2497 => _2497(), 'optionalAccess', _2498 => _2498.origins]), () => ( {})))) {
144306
144221
  if (ZONE_ORIGIN_IDS.has(id2)) restored[id2] = origin;
144307
144222
  }
144308
144223
  return restored;
@@ -144348,7 +144263,7 @@ var init_AgentConfigGraph = __esm({
144348
144263
  const copilotKickoff = useCopilotKickoffRequest({
144349
144264
  assistantId: _nullishCoalesce(assistantId, () => ( "")),
144350
144265
  initialMessageRequest,
144351
- onInitialMessageSubmitted: (requestId) => _optionalChain([handlersRef, 'access', _2500 => _2500.current, 'access', _2501 => _2501.onInitialMessageSubmitted, 'optionalCall', _2502 => _2502(requestId)])
144266
+ onInitialMessageSubmitted: (requestId) => _optionalChain([handlersRef, 'access', _2499 => _2499.current, 'access', _2500 => _2500.onInitialMessageSubmitted, 'optionalCall', _2501 => _2501(requestId)])
144352
144267
  });
144353
144268
  const activateDot = _react.useCallback.call(void 0, (key) => {
144354
144269
  setActiveDot(key);
@@ -144365,7 +144280,7 @@ var init_AgentConfigGraph = __esm({
144365
144280
  const handleLearningDetailClose = _react.useCallback.call(void 0, () => setLearningModalTaskId(null), []);
144366
144281
  const handleLearningFocus = _react.useCallback.call(void 0, (id2) => setLearningFocusId(id2), []);
144367
144282
  const handleLearningStarted = _react.useCallback.call(void 0,
144368
- (goal, roundTaskId, files) => _optionalChain([handlersRef, 'access', _2503 => _2503.current, 'access', _2504 => _2504.onLearningStarted, 'optionalCall', _2505 => _2505(goal, roundTaskId, files)]),
144283
+ (goal, roundTaskId, files) => _optionalChain([handlersRef, 'access', _2502 => _2502.current, 'access', _2503 => _2503.onLearningStarted, 'optionalCall', _2504 => _2504(goal, roundTaskId, files)]),
144369
144284
  []
144370
144285
  );
144371
144286
  const { suites: evalSuites } = useEvalSuites(_nullishCoalesce(evalData.evalProjectId, () => ( "")));
@@ -144563,7 +144478,7 @@ var init_AgentConfigGraph = __esm({
144563
144478
  draggable: false,
144564
144479
  data: {
144565
144480
  node: graph2.agent,
144566
- onClick: () => _optionalChain([onSelectNode, 'optionalCall', _2506 => _2506(graph2.agent)])
144481
+ onClick: () => _optionalChain([onSelectNode, 'optionalCall', _2505 => _2505(graph2.agent)])
144567
144482
  },
144568
144483
  position: configAgentPosition(configLive)
144569
144484
  });
@@ -144578,7 +144493,7 @@ var init_AgentConfigGraph = __esm({
144578
144493
  draggable: false,
144579
144494
  data: {
144580
144495
  group: group2,
144581
- onClick: (item) => _optionalChain([onSelectNode, 'optionalCall', _2507 => _2507(item)]),
144496
+ onClick: (item) => _optionalChain([onSelectNode, 'optionalCall', _2506 => _2506(item)]),
144582
144497
  onRemove: onRemoveNode
144583
144498
  },
144584
144499
  position: configGroupPosition(configLive, g3.id, h4)
@@ -144611,7 +144526,7 @@ var init_AgentConfigGraph = __esm({
144611
144526
  width: testingLive.width - ZONE_MARGIN * 2,
144612
144527
  height: testingLive.height - ZONE_MARGIN * 2,
144613
144528
  suites: suiteItems,
144614
- onSuiteClick: (item) => _optionalChain([onSelectNode, 'optionalCall', _2508 => _2508(item)])
144529
+ onSuiteClick: (item) => _optionalChain([onSelectNode, 'optionalCall', _2507 => _2507(item)])
144615
144530
  },
144616
144531
  position: {
144617
144532
  x: testingLive.x + TESTING_CONTENT_OFFSET.x,
@@ -144632,8 +144547,8 @@ var init_AgentConfigGraph = __esm({
144632
144547
  workspaceId,
144633
144548
  projectId,
144634
144549
  initialMessageRequest: _nullishCoalesce(initialMessageRequest, () => ( null)),
144635
- onInitialMessageSubmitted: (requestId) => _optionalChain([handlersRef, 'access', _2509 => _2509.current, 'access', _2510 => _2510.onInitialMessageSubmitted, 'optionalCall', _2511 => _2511(requestId)]),
144636
- onToolCompleted: (toolName) => _optionalChain([handlersRef, 'access', _2512 => _2512.current, 'access', _2513 => _2513.onToolActivity, 'optionalCall', _2514 => _2514(toolName)]),
144550
+ onInitialMessageSubmitted: (requestId) => _optionalChain([handlersRef, 'access', _2508 => _2508.current, 'access', _2509 => _2509.onInitialMessageSubmitted, 'optionalCall', _2510 => _2510(requestId)]),
144551
+ onToolCompleted: (toolName) => _optionalChain([handlersRef, 'access', _2511 => _2511.current, 'access', _2512 => _2512.onToolActivity, 'optionalCall', _2513 => _2513(toolName)]),
144637
144552
  temporarilyHidden: _nullishCoalesce(copilotTemporarilyHidden, () => ( false)),
144638
144553
  openSignal: architectOpenSignal,
144639
144554
  width: layout.copilot.width,
@@ -144666,7 +144581,7 @@ var init_AgentConfigGraph = __esm({
144666
144581
  type: "bezier"
144667
144582
  };
144668
144583
  }));
144669
- }, [graph2, setNodes, setEdges, onRemoveNode, assistantId, isMobile, workspaceId, projectId, assistantName, copilotTemporarilyHidden, architectOpenSignal, _optionalChain([initialMessageRequest, 'optionalAccess', _2515 => _2515.requestId]), _optionalChain([initialMessageRequest, 'optionalAccess', _2516 => _2516.content]), testingTier, suiteItems, evalData.score, evalData.suiteNames, evalData.runs.map((r6) => r6.id).join(","), layout, groupHeights, pinnedZones, togglePinned]);
144584
+ }, [graph2, setNodes, setEdges, onRemoveNode, assistantId, isMobile, workspaceId, projectId, assistantName, copilotTemporarilyHidden, architectOpenSignal, _optionalChain([initialMessageRequest, 'optionalAccess', _2514 => _2514.requestId]), _optionalChain([initialMessageRequest, 'optionalAccess', _2515 => _2515.content]), testingTier, suiteItems, evalData.score, evalData.suiteNames, evalData.runs.map((r6) => r6.id).join(","), layout, groupHeights, pinnedZones, togglePinned]);
144670
144585
  const nodesInitialized = useNodesInitialized();
144671
144586
  _react.useEffect.call(void 0, () => {
144672
144587
  if (!nodesInitialized || fittedRef.current) return;
@@ -144731,15 +144646,15 @@ var init_AgentConfigGraph = __esm({
144731
144646
  onNodeDrag: (_e, node) => handleZoneDrag(node.id, node.position),
144732
144647
  onNodeDragStop: (_e, node) => handleZoneDragStop(node.id, node.position),
144733
144648
  onNodeMouseEnter: (_e, node) => {
144734
- if (node.id === COPILOT_NODE_ID || node.id.startsWith("zone:") || node.id.startsWith("testing:") || _optionalChain([node, 'access', _2517 => _2517.type, 'optionalAccess', _2518 => _2518.startsWith, 'call', _2519 => _2519("learning")])) return;
144649
+ if (node.id === COPILOT_NODE_ID || node.id.startsWith("zone:") || node.id.startsWith("testing:") || _optionalChain([node, 'access', _2516 => _2516.type, 'optionalAccess', _2517 => _2517.startsWith, 'call', _2518 => _2518("learning")])) return;
144735
144650
  setHoveredId(node.id);
144736
144651
  },
144737
144652
  onNodeMouseLeave: () => setHoveredId(null),
144738
- onPaneClick: () => _optionalChain([onSelectNode, 'optionalCall', _2520 => _2520(null)]),
144653
+ onPaneClick: () => _optionalChain([onSelectNode, 'optionalCall', _2519 => _2519(null)]),
144739
144654
  onNodeClick: (_e, node) => {
144740
144655
  if (node.type !== "learningTask" && node.type !== "learningRoundRoot") return;
144741
144656
  const data = node.data;
144742
- _optionalChain([data, 'access', _2521 => _2521.onTaskClick, 'optionalCall', _2522 => _2522()]);
144657
+ _optionalChain([data, 'access', _2520 => _2520.onTaskClick, 'optionalCall', _2521 => _2521()]);
144743
144658
  },
144744
144659
  nodeTypes: nodeTypes5,
144745
144660
  children: [
@@ -144753,7 +144668,7 @@ var init_AgentConfigGraph = __esm({
144753
144668
  {
144754
144669
  open: learningModalTarget !== null,
144755
144670
  width: 860,
144756
- title: _nullishCoalesce(_optionalChain([learningModalTarget, 'optionalAccess', _2523 => _2523.task, 'access', _2524 => _2524.title]), () => ( "")),
144671
+ title: _nullishCoalesce(_optionalChain([learningModalTarget, 'optionalAccess', _2522 => _2522.task, 'access', _2523 => _2523.title]), () => ( "")),
144757
144672
  onClose: handleLearningDetailClose,
144758
144673
  bodyStyle: { padding: 0, overflow: "hidden" },
144759
144674
  children: learningModalTarget && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -144794,7 +144709,7 @@ var init_AgentConfigGraph = __esm({
144794
144709
  CopilotPanel,
144795
144710
  {
144796
144711
  workflowContext: { id: assistantId, name: _nullishCoalesce(assistantName, () => ( "")), type: "agent" },
144797
- onToolCompleted: (toolName) => _optionalChain([handlersRef, 'access', _2525 => _2525.current, 'access', _2526 => _2526.onToolActivity, 'optionalCall', _2527 => _2527(toolName)]),
144712
+ onToolCompleted: (toolName) => _optionalChain([handlersRef, 'access', _2524 => _2524.current, 'access', _2525 => _2525.onToolActivity, 'optionalCall', _2526 => _2526(toolName)]),
144798
144713
  initialMessageRequest: copilotKickoff.effectivePendingRequest,
144799
144714
  attemptedInitialMessageRequestIdsRef: copilotKickoff.attemptedRequestIdsRef,
144800
144715
  rawInitialMessage: true,
@@ -144905,7 +144820,7 @@ var init_AgentConfigGraph = __esm({
144905
144820
  contextType: "agent",
144906
144821
  initialMessageRequest,
144907
144822
  onInitialMessageSubmitted,
144908
- onToolCompleted: (toolName) => _optionalChain([onToolActivity, 'optionalCall', _2528 => _2528(toolName)]),
144823
+ onToolCompleted: (toolName) => _optionalChain([onToolActivity, 'optionalCall', _2527 => _2527(toolName)]),
144909
144824
  temporarilyHidden: copilotTemporarilyHidden,
144910
144825
  openSignal: architectOpenSignal,
144911
144826
  restoreFocusRef: architectRestoreFocusRef,
@@ -145192,17 +145107,17 @@ var init_WorkflowNode = __esm({
145192
145107
  const meta = TYPE_META[nodeType] || TYPE_META.agent;
145193
145108
  const termMeta = TERMINAL_STATUS_META[termStatus || ""] || TERMINAL_STATUS_META.__default;
145194
145109
  const ssc = runState ? STEP_STATUS_CONFIG[runState.status] || STEP_STATUS_CONFIG.running : null;
145195
- const statusColor3 = _optionalChain([ssc, 'optionalAccess', _2529 => _2529.color]);
145196
- const statusIcon = _optionalChain([ssc, 'optionalAccess', _2530 => _2530.icon]);
145110
+ const statusColor3 = _optionalChain([ssc, 'optionalAccess', _2528 => _2528.color]);
145111
+ const statusIcon = _optionalChain([ssc, 'optionalAccess', _2529 => _2529.icon]);
145197
145112
  const terminalIcon = termStatus === "success" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CheckCircle, { size: 14, color: "#22c55e" }) : termStatus === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.XCircle, { size: 14, color: "#ef4444" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Circle, { size: 14, color: "#94a3b8" });
145198
145113
  const terminalLargeIcon = termStatus === "success" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CheckCircle, { size: 32, color: termMeta.color }) : termStatus === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.XCircle, { size: 32, color: termMeta.color }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.StopCircle, { size: 32, color: termMeta.color });
145199
- const title = _optionalChain([config, 'optionalAccess', _2531 => _2531.title]);
145200
- const maxRetries = _optionalChain([config, 'optionalAccess', _2532 => _2532.maxRetries]);
145201
- const timeout2 = _optionalChain([config, 'optionalAccess', _2533 => _2533.timeout]);
145202
- const batchSize = _optionalChain([config, 'optionalAccess', _2534 => _2534.batchSize]);
145203
- const maxConcurrency = _optionalChain([config, 'optionalAccess', _2535 => _2535.maxConcurrency]);
145204
- const innerConcurrency = _optionalChain([config, 'optionalAccess', _2536 => _2536.innerConcurrency]);
145205
- const isSelected = _optionalChain([runState, 'optionalAccess', _2537 => _2537.selected]);
145114
+ const title = _optionalChain([config, 'optionalAccess', _2530 => _2530.title]);
145115
+ const maxRetries = _optionalChain([config, 'optionalAccess', _2531 => _2531.maxRetries]);
145116
+ const timeout2 = _optionalChain([config, 'optionalAccess', _2532 => _2532.timeout]);
145117
+ const batchSize = _optionalChain([config, 'optionalAccess', _2533 => _2533.batchSize]);
145118
+ const maxConcurrency = _optionalChain([config, 'optionalAccess', _2534 => _2534.maxConcurrency]);
145119
+ const innerConcurrency = _optionalChain([config, 'optionalAccess', _2535 => _2535.innerConcurrency]);
145120
+ const isSelected = _optionalChain([runState, 'optionalAccess', _2536 => _2536.selected]);
145206
145121
  const hasRuntime = !!runState || pending;
145207
145122
  function formatDuration2(ms) {
145208
145123
  if (ms == null) return "-";
@@ -145523,7 +145438,7 @@ function StepDetailPopover({ step }) {
145523
145438
  maxHeight: 200,
145524
145439
  overflow: "auto"
145525
145440
  },
145526
- children: _optionalChain([step, 'access', _2538 => _2538.input, 'optionalAccess', _2539 => _2539.description]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MDResponse, { content: inputText }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { style: { margin: 0, fontSize: 11, whiteSpace: "pre-wrap", wordBreak: "break-word", fontFamily: "monospace" }, children: inputText })
145441
+ children: _optionalChain([step, 'access', _2537 => _2537.input, 'optionalAccess', _2538 => _2538.description]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MDResponse, { content: inputText }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { style: { margin: 0, fontSize: 11, whiteSpace: "pre-wrap", wordBreak: "break-word", fontFamily: "monospace" }, children: inputText })
145527
145442
  }
145528
145443
  )
145529
145444
  ] }),
@@ -145540,7 +145455,7 @@ function StepDetailPopover({ step }) {
145540
145455
  maxHeight: 200,
145541
145456
  overflow: "auto"
145542
145457
  },
145543
- children: _optionalChain([step, 'access', _2540 => _2540.output, 'optionalAccess', _2541 => _2541.result]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MDResponse, { content: outputText }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { style: { margin: 0, fontSize: 11, whiteSpace: "pre-wrap", wordBreak: "break-word", fontFamily: "monospace" }, children: outputText })
145458
+ children: _optionalChain([step, 'access', _2539 => _2539.output, 'optionalAccess', _2540 => _2540.result]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MDResponse, { content: outputText }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { style: { margin: 0, fontSize: 11, whiteSpace: "pre-wrap", wordBreak: "break-word", fontFamily: "monospace" }, children: outputText })
145544
145459
  }
145545
145460
  )
145546
145461
  ] }),
@@ -145606,16 +145521,16 @@ function dslNodeToData(n4, runState, pending, agentNameMap) {
145606
145521
  name: n4.name,
145607
145522
  description: n4.description,
145608
145523
  ref: n4.ref,
145609
- refAgentName: _optionalChain([refAgent, 'optionalAccess', _2542 => _2542.name]),
145610
- refAgentType: _optionalChain([refAgent, 'optionalAccess', _2543 => _2543.type]),
145524
+ refAgentName: _optionalChain([refAgent, 'optionalAccess', _2541 => _2541.name]),
145525
+ refAgentType: _optionalChain([refAgent, 'optionalAccess', _2542 => _2542.type]),
145611
145526
  refDeleted: n4.ref && agentNameMap ? !refAgent : void 0,
145612
- outputKey: _optionalChain([n4, 'access', _2544 => _2544.output, 'optionalAccess', _2545 => _2545.key]),
145613
- nodeSchema: _optionalChain([n4, 'access', _2546 => _2546.output, 'optionalAccess', _2547 => _2547.schema]),
145527
+ outputKey: _optionalChain([n4, 'access', _2543 => _2543.output, 'optionalAccess', _2544 => _2544.key]),
145528
+ nodeSchema: _optionalChain([n4, 'access', _2545 => _2545.output, 'optionalAccess', _2546 => _2546.schema]),
145614
145529
  config: n4.config,
145615
145530
  status: n4.status,
145616
145531
  source: n4.source,
145617
- innerRef: _optionalChain([n4, 'access', _2548 => _2548.node, 'optionalAccess', _2549 => _2549.ref]),
145618
- inputTemplate: _optionalChain([n4, 'access', _2550 => _2550.input, 'optionalAccess', _2551 => _2551.template]),
145532
+ innerRef: _optionalChain([n4, 'access', _2547 => _2547.node, 'optionalAccess', _2548 => _2548.ref]),
145533
+ inputTemplate: _optionalChain([n4, 'access', _2549 => _2549.input, 'optionalAccess', _2550 => _2550.template]),
145619
145534
  ask: n4.ask,
145620
145535
  condition: n4.condition,
145621
145536
  runState,
@@ -145741,10 +145656,10 @@ function buildGraph(dsl, agentNameMap) {
145741
145656
  const targets = getEdgeTargets(e8);
145742
145657
  for (const t4 of targets) {
145743
145658
  const targetNode = canvasNodes.find((n4) => n4.id === t4);
145744
- if (_optionalChain([targetNode, 'optionalAccess', _2552 => _2552.type]) === "terminal" && targetNode.name === "__end") continue;
145659
+ if (_optionalChain([targetNode, 'optionalAccess', _2551 => _2551.type]) === "terminal" && targetNode.name === "__end") continue;
145745
145660
  if (groupNodeIds.has(e8.from)) {
145746
145661
  const child = canvasNodes.find((n4) => n4.id === t4);
145747
- if (_optionalChain([child, 'optionalAccess', _2553 => _2553.parentGroup]) === e8.from) continue;
145662
+ if (_optionalChain([child, 'optionalAccess', _2552 => _2552.parentGroup]) === e8.from) continue;
145748
145663
  }
145749
145664
  const source = groupNodeIds.has(e8.from) ? `group_${e8.from}` : e8.from;
145750
145665
  const target = groupNodeIds.has(t4) ? `group_${t4}` : t4;
@@ -145844,7 +145759,7 @@ function buildRuntimeGraph(dsl, steps, _unused, agentNameMap) {
145844
145759
  for (const t4 of targets) {
145845
145760
  if (groupNodeIds.has(e8.from)) {
145846
145761
  const child = canvasNodes.find((n4) => n4.id === t4);
145847
- if (_optionalChain([child, 'optionalAccess', _2554 => _2554.parentGroup]) === e8.from) continue;
145762
+ if (_optionalChain([child, 'optionalAccess', _2553 => _2553.parentGroup]) === e8.from) continue;
145848
145763
  }
145849
145764
  const source = groupNodeIds.has(e8.from) ? `group_${e8.from}` : e8.from;
145850
145765
  const target = groupNodeIds.has(t4) ? `group_${t4}` : t4;
@@ -145939,7 +145854,7 @@ var init_WorkflowCanvas = __esm({
145939
145854
  if (isRuntime) {
145940
145855
  setSelectedNodeId(node.id);
145941
145856
  } else {
145942
- _optionalChain([onNodeClick, 'optionalCall', _2555 => _2555(node.id)]);
145857
+ _optionalChain([onNodeClick, 'optionalCall', _2554 => _2554(node.id)]);
145943
145858
  }
145944
145859
  }, [isRuntime, onNodeClick]);
145945
145860
  const handlePaneClick = _react.useCallback.call(void 0, () => {
@@ -146102,7 +146017,7 @@ function normalize4(name, steps) {
146102
146017
  const entries = Object.entries(raw);
146103
146018
  if (entries.length === 1) {
146104
146019
  const [label, config] = entries[0];
146105
- if (_optionalChain([config, 'optionalAccess', _2556 => _2556.map]) && typeof config.map === "object") {
146020
+ if (_optionalChain([config, 'optionalAccess', _2555 => _2555.map]) && typeof config.map === "object") {
146106
146021
  const key = label;
146107
146022
  const nodeId = nid(key);
146108
146023
  nodes.push({
@@ -146111,12 +146026,12 @@ function normalize4(name, steps) {
146111
146026
  name: key,
146112
146027
  source: `state.${config.map.source}`,
146113
146028
  itemKey: "item",
146114
- input: { template: String(_nullishCoalesce(_optionalChain([config, 'access', _2557 => _2557.map, 'access', _2558 => _2558.each, 'optionalAccess', _2559 => _2559.prompt]), () => ( ""))) },
146115
- output: { key, schema: toSchema(_optionalChain([config, 'access', _2560 => _2560.map, 'access', _2561 => _2561.each, 'optionalAccess', _2562 => _2562.output])) },
146029
+ input: { template: String(_nullishCoalesce(_optionalChain([config, 'access', _2556 => _2556.map, 'access', _2557 => _2557.each, 'optionalAccess', _2558 => _2558.prompt]), () => ( ""))) },
146030
+ output: { key, schema: toSchema(_optionalChain([config, 'access', _2559 => _2559.map, 'access', _2560 => _2560.each, 'optionalAccess', _2561 => _2561.output])) },
146116
146031
  node: {
146117
146032
  type: "agent",
146118
- ref: typeof _optionalChain([config, 'access', _2563 => _2563.map, 'access', _2564 => _2564.each, 'optionalAccess', _2565 => _2565.ref]) === "string" ? config.map.each.ref : "",
146119
- input: { template: String(_nullishCoalesce(_optionalChain([config, 'access', _2566 => _2566.map, 'access', _2567 => _2567.each, 'optionalAccess', _2568 => _2568.prompt]), () => ( ""))) }
146033
+ ref: typeof _optionalChain([config, 'access', _2562 => _2562.map, 'access', _2563 => _2563.each, 'optionalAccess', _2564 => _2564.ref]) === "string" ? config.map.each.ref : "",
146034
+ input: { template: String(_nullishCoalesce(_optionalChain([config, 'access', _2565 => _2565.map, 'access', _2566 => _2566.each, 'optionalAccess', _2567 => _2567.prompt]), () => ( ""))) }
146120
146035
  },
146121
146036
  config: {
146122
146037
  batchSize: Number(config.map.batch) || void 0,
@@ -146279,7 +146194,7 @@ var init_WorkflowAgentCanvas = __esm({
146279
146194
  label: t4("governance.workflow.builderLabel"),
146280
146195
  initialMessageRequest,
146281
146196
  onInitialMessageSubmitted,
146282
- onToolCompleted: (toolName) => _optionalChain([onToolActivity, 'optionalCall', _2569 => _2569(toolName)]),
146197
+ onToolCompleted: (toolName) => _optionalChain([onToolActivity, 'optionalCall', _2568 => _2568(toolName)]),
146283
146198
  temporarilyHidden: copilotTemporarilyHidden,
146284
146199
  openSignal: architectOpenSignal,
146285
146200
  restoreFocusRef: architectRestoreFocusRef,
@@ -146356,7 +146271,7 @@ var init_NodeDock = __esm({
146356
146271
  setLoading(true);
146357
146272
  get4("/api/tools").then((res) => {
146358
146273
  if (cancelled) return;
146359
- const found = _nullishCoalesce(_optionalChain([res, 'access', _2570 => _2570.data, 'optionalAccess', _2571 => _2571.records, 'optionalAccess', _2572 => _2572.find, 'call', _2573 => _2573((t5) => t5.name === node.label)]), () => ( null));
146274
+ const found = _nullishCoalesce(_optionalChain([res, 'access', _2569 => _2569.data, 'optionalAccess', _2570 => _2570.records, 'optionalAccess', _2571 => _2571.find, 'call', _2572 => _2572((t5) => t5.name === node.label)]), () => ( null));
146360
146275
  setTool(found);
146361
146276
  }).catch(() => !cancelled && setTool(null)).finally(() => !cancelled && setLoading(false));
146362
146277
  return () => {
@@ -146365,8 +146280,8 @@ var init_NodeDock = __esm({
146365
146280
  }, [get4, node.label]);
146366
146281
  if (loading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Spin, { size: "small" });
146367
146282
  if (!tool) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text82, { type: "secondary", style: { fontSize: 13 }, children: t4("governance.nodeDock.toolUnavailable") });
146368
- const properties = _nullishCoalesce(_optionalChain([tool, 'access', _2574 => _2574.schema, 'optionalAccess', _2575 => _2575.properties]), () => ( {}));
146369
- const required2 = new Set(_nullishCoalesce(_optionalChain([tool, 'access', _2576 => _2576.schema, 'optionalAccess', _2577 => _2577.required]), () => ( [])));
146283
+ const properties = _nullishCoalesce(_optionalChain([tool, 'access', _2573 => _2573.schema, 'optionalAccess', _2574 => _2574.properties]), () => ( {}));
146284
+ const required2 = new Set(_nullishCoalesce(_optionalChain([tool, 'access', _2575 => _2575.schema, 'optionalAccess', _2576 => _2576.required]), () => ( [])));
146370
146285
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
146371
146286
  tool.description && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DockSection, { title: t4("governance.nodeDock.description"), children: tool.description }),
146372
146287
  Object.keys(properties).length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DockSection, { title: t4("governance.nodeDock.parameters"), children: Object.entries(properties).map(([name, p7]) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", gap: 8, fontSize: 12, padding: "4px 0", alignItems: "baseline" }, children: [
@@ -146396,7 +146311,7 @@ var init_NodeDock = __esm({
146396
146311
  if (!agent) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text82, { type: "secondary", style: { fontSize: 13 }, children: t4("governance.nodeDock.subagentUnavailable") });
146397
146312
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
146398
146313
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DockSection, { title: t4("governance.nodeDock.description"), children: agent.description || t4("governance.nodeDock.noDescription") }),
146399
- _optionalChain([agent, 'access', _2578 => _2578.graphDefinition, 'optionalAccess', _2579 => _2579.modelKey]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DockSection, { title: t4("governance.nodeDock.model"), children: agent.graphDefinition.modelKey })
146314
+ _optionalChain([agent, 'access', _2577 => _2577.graphDefinition, 'optionalAccess', _2578 => _2578.modelKey]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DockSection, { title: t4("governance.nodeDock.model"), children: agent.graphDefinition.modelKey })
146400
146315
  ] });
146401
146316
  };
146402
146317
  SkillDetail = ({ node }) => {
@@ -146434,7 +146349,7 @@ var init_NodeDock = __esm({
146434
146349
  allowedTools: raw.allowedTools
146435
146350
  });
146436
146351
  const [saving, setSaving] = _react.useState.call(void 0, false);
146437
- const middlewareType = _optionalChain([(config.availableMiddlewareTypes || middlewareTypes), 'optionalAccess', _2580 => _2580.find, 'call', _2581 => _2581((t5) => t5.type === draft.type)]);
146352
+ const middlewareType = _optionalChain([(config.availableMiddlewareTypes || middlewareTypes), 'optionalAccess', _2579 => _2579.find, 'call', _2580 => _2580((t5) => t5.type === draft.type)]);
146438
146353
  const save = async () => {
146439
146354
  if (!onSaveGraph) return;
146440
146355
  setSaving(true);
@@ -146577,7 +146492,7 @@ function mergePartialSubtree(previous, fetched, incompleteParentIds) {
146577
146492
  while (parentId && !seen.has(parentId)) {
146578
146493
  if (incomplete.has(parentId)) return true;
146579
146494
  seen.add(parentId);
146580
- parentId = _optionalChain([previousById, 'access', _2582 => _2582.get, 'call', _2583 => _2583(parentId), 'optionalAccess', _2584 => _2584.parentId]);
146495
+ parentId = _optionalChain([previousById, 'access', _2581 => _2581.get, 'call', _2582 => _2582(parentId), 'optionalAccess', _2583 => _2583.parentId]);
146581
146496
  }
146582
146497
  return false;
146583
146498
  };
@@ -146632,7 +146547,7 @@ function useEntityRefresher(params) {
146632
146547
  if (seq !== configSeqRef.current || requestScope !== scopeRef.current) return;
146633
146548
  if (res.success && res.data) {
146634
146549
  listInvalidatedRef.current = false;
146635
- _optionalChain([cbRef, 'access', _2585 => _2585.current, 'access', _2586 => _2586.onAssistantUpdated, 'optionalCall', _2587 => _2587(res.data)]);
146550
+ _optionalChain([cbRef, 'access', _2584 => _2584.current, 'access', _2585 => _2585.onAssistantUpdated, 'optionalCall', _2586 => _2586(res.data)]);
146636
146551
  setFreshness((prev) => ({ ...prev, config: { error: null, updatedAt: /* @__PURE__ */ new Date() } }));
146637
146552
  } else {
146638
146553
  listInvalidatedRef.current = false;
@@ -146641,7 +146556,7 @@ function useEntityRefresher(params) {
146641
146556
  } catch (err) {
146642
146557
  if (seq !== configSeqRef.current || requestScope !== scopeRef.current) return;
146643
146558
  if (err instanceof _clientsdk.ApiError && err.statusCode === 404) {
146644
- if (!listInvalidatedRef.current) _optionalChain([cbRef, 'access', _2588 => _2588.current, 'access', _2589 => _2589.onAgentListInvalidated, 'optionalCall', _2590 => _2590()]);
146559
+ if (!listInvalidatedRef.current) _optionalChain([cbRef, 'access', _2587 => _2587.current, 'access', _2588 => _2588.onAgentListInvalidated, 'optionalCall', _2589 => _2589()]);
146645
146560
  listInvalidatedRef.current = false;
146646
146561
  setFreshness((prev) => ({ ...prev, config: { ...prev.config, error: err } }));
146647
146562
  return;
@@ -146654,7 +146569,7 @@ function useEntityRefresher(params) {
146654
146569
  }, [get4, agentId, scope]);
146655
146570
  const refreshLearningTasks = _react.useCallback.call(void 0, () => {
146656
146571
  const existing = taskRefreshRef.current;
146657
- if (_optionalChain([existing, 'optionalAccess', _2591 => _2591.scope]) === scope) return existing.promise;
146572
+ if (_optionalChain([existing, 'optionalAccess', _2590 => _2590.scope]) === scope) return existing.promise;
146658
146573
  const seq = ++taskSeqRef.current;
146659
146574
  const requestScope = scope;
146660
146575
  const promise = (async () => {
@@ -146695,7 +146610,7 @@ function useEntityRefresher(params) {
146695
146610
  setFreshness((prev) => ({ ...prev, tasks: { ...prev.tasks, error } }));
146696
146611
  }
146697
146612
  })().finally(() => {
146698
- if (_optionalChain([taskRefreshRef, 'access', _2592 => _2592.current, 'optionalAccess', _2593 => _2593.promise]) !== promise) return;
146613
+ if (_optionalChain([taskRefreshRef, 'access', _2591 => _2591.current, 'optionalAccess', _2592 => _2592.promise]) !== promise) return;
146699
146614
  taskRefreshRef.current = null;
146700
146615
  if (taskTrailingRef.current === requestScope && scopeRef.current === requestScope) {
146701
146616
  taskTrailingRef.current = null;
@@ -146720,13 +146635,13 @@ function useEntityRefresher(params) {
146720
146635
  if (group2 === "config") schedule(group2, () => {
146721
146636
  if (isAgentListChangeTool(toolName)) {
146722
146637
  listInvalidatedRef.current = true;
146723
- _optionalChain([cbRef, 'access', _2594 => _2594.current, 'access', _2595 => _2595.onAgentListInvalidated, 'optionalCall', _2596 => _2596()]);
146638
+ _optionalChain([cbRef, 'access', _2593 => _2593.current, 'access', _2594 => _2594.onAgentListInvalidated, 'optionalCall', _2595 => _2595()]);
146724
146639
  }
146725
146640
  void fnsRef.current.refreshAgent();
146726
146641
  });
146727
146642
  if (group2 === "tasks") schedule(group2, () => {
146728
146643
  const currentScope = scopeRef.current;
146729
- if (_optionalChain([taskRefreshRef, 'access', _2597 => _2597.current, 'optionalAccess', _2598 => _2598.scope]) === currentScope) taskTrailingRef.current = currentScope;
146644
+ if (_optionalChain([taskRefreshRef, 'access', _2596 => _2596.current, 'optionalAccess', _2597 => _2597.scope]) === currentScope) taskTrailingRef.current = currentScope;
146730
146645
  else void fnsRef.current.refreshLearningTasks();
146731
146646
  });
146732
146647
  if (group2 === "eval") schedule(group2, () => {
@@ -146861,7 +146776,7 @@ var init_AgentDetailView = __esm({
146861
146776
  const { workspaceId, trainingProjects } = useWorkspaceContext();
146862
146777
  const trainingProjectId = getTrainingProjectId(assistant.graphDefinition);
146863
146778
  const [learningProjectId, setLearningProjectId] = _react.useState.call(void 0,
146864
- _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(initialProjectId, () => ( trainingProjectId)), () => ( _optionalChain([trainingProjects, 'access', _2599 => _2599[0], 'optionalAccess', _2600 => _2600.id]))), () => ( null))
146779
+ _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(initialProjectId, () => ( trainingProjectId)), () => ( _optionalChain([trainingProjects, 'access', _2598 => _2598[0], 'optionalAccess', _2599 => _2599.id]))), () => ( null))
146865
146780
  );
146866
146781
  const handleProjectChange = (id2) => {
146867
146782
  setLearningProjectId(id2);
@@ -146877,13 +146792,13 @@ var init_AgentDetailView = __esm({
146877
146792
  targetMode: getLearningTargetMode(assistant),
146878
146793
  files,
146879
146794
  projectId: _nullishCoalesce(learningProjectId, () => ( void 0)),
146880
- workspaceId: _nullishCoalesce(_nullishCoalesce(_optionalChain([learningProject, 'optionalAccess', _2601 => _2601.workspaceId]), () => ( workspaceId)), () => ( void 0))
146795
+ workspaceId: _nullishCoalesce(_nullishCoalesce(_optionalChain([learningProject, 'optionalAccess', _2600 => _2600.workspaceId]), () => ( workspaceId)), () => ( void 0))
146881
146796
  }),
146882
146797
  customRunConfig: { execution: { taskId: roundTaskId } }
146883
146798
  });
146884
146799
  };
146885
146800
  const handleInitialMessageSubmitted = (requestId) => {
146886
- setInitialMessageRequest((current) => _optionalChain([current, 'optionalAccess', _2602 => _2602.requestId]) === requestId ? null : current);
146801
+ setInitialMessageRequest((current) => _optionalChain([current, 'optionalAccess', _2601 => _2601.requestId]) === requestId ? null : current);
146887
146802
  };
146888
146803
  _react.useEffect.call(void 0, () => {
146889
146804
  if (!learningProjectId && trainingProjects.length > 0) {
@@ -146924,8 +146839,8 @@ var init_AgentDetailView = __esm({
146924
146839
  };
146925
146840
  const requestTransition = (transition2) => {
146926
146841
  if (pendingTransitionRef.current) return;
146927
- if (transition2.kind === "dock" && transition2.view.kind !== "node" && _optionalChain([dockView, 'optionalAccess', _2603 => _2603.kind]) === transition2.view.kind && transition2.view.kind !== "eval") return;
146928
- if (_optionalChain([dockView, 'optionalAccess', _2604 => _2604.kind]) === "configuration" && configurationDirty) {
146842
+ if (transition2.kind === "dock" && transition2.view.kind !== "node" && _optionalChain([dockView, 'optionalAccess', _2602 => _2602.kind]) === transition2.view.kind && transition2.view.kind !== "eval") return;
146843
+ if (_optionalChain([dockView, 'optionalAccess', _2603 => _2603.kind]) === "configuration" && configurationDirty) {
146929
146844
  pendingTransitionRef.current = transition2;
146930
146845
  setPendingTransition(transition2);
146931
146846
  return;
@@ -146947,7 +146862,7 @@ var init_AgentDetailView = __esm({
146947
146862
  const cancelPendingTransition = () => {
146948
146863
  pendingTransitionRef.current = null;
146949
146864
  setPendingTransition(null);
146950
- requestAnimationFrame(() => _optionalChain([configurationDockFocusRef, 'access', _2605 => _2605.current, 'optionalCall', _2606 => _2606()]));
146865
+ requestAnimationFrame(() => _optionalChain([configurationDockFocusRef, 'access', _2604 => _2604.current, 'optionalCall', _2605 => _2605()]));
146951
146866
  };
146952
146867
  const discardAndContinue = () => {
146953
146868
  const transition2 = pendingTransitionRef.current;
@@ -146971,7 +146886,7 @@ var init_AgentDetailView = __esm({
146971
146886
  };
146972
146887
  const handleSaveGraph = (next) => {
146973
146888
  setGraphDef(next);
146974
- return _optionalChain([onSave, 'optionalCall', _2607 => _2607(assistant, next)]);
146889
+ return _optionalChain([onSave, 'optionalCall', _2606 => _2606(assistant, next)]);
146975
146890
  };
146976
146891
  const handleConfigurationSave = onSave ? async (assistantArg, config) => {
146977
146892
  await onSave(assistantArg, config);
@@ -147006,7 +146921,7 @@ var init_AgentDetailView = __esm({
147006
146921
  return;
147007
146922
  }
147008
146923
  setGraphDef(next);
147009
- _optionalChain([onSave, 'optionalCall', _2608 => _2608(assistant, next), 'access', _2609 => _2609.catch, 'call', _2610 => _2610(() => _antd.message.error(t4("governance.detail.removeNodeSaveFailed")))]);
146924
+ _optionalChain([onSave, 'optionalCall', _2607 => _2607(assistant, next), 'access', _2608 => _2608.catch, 'call', _2609 => _2609(() => _antd.message.error(t4("governance.detail.removeNodeSaveFailed")))]);
147010
146925
  };
147011
146926
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { height: "100%", display: "flex", flexDirection: "column", background: "#fff" }, children: [
147012
146927
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { "data-agent-detail-responsive": true, children: RESPONSIVE_HEADER_CSS }),
@@ -147080,10 +146995,10 @@ var init_AgentDetailView = __esm({
147080
146995
  border: "1px solid #f0f0f0"
147081
146996
  },
147082
146997
  children: [
147083
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.detail.testInPlayground"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { ref: playgroundButtonRef, type: "text", size: "small", icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Play, { size: 14 }), onClick: () => requestTransition({ kind: "dock", view: { kind: "playground" } }), "aria-label": t4("governance.detail.testInPlayground"), "aria-pressed": _optionalChain([dockView, 'optionalAccess', _2611 => _2611.kind]) === "playground", style: _optionalChain([dockView, 'optionalAccess', _2612 => _2612.kind]) === "playground" ? activeActionStyle : void 0 }) }),
147084
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.detail.evalSuite"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { ref: evalButtonRef, type: "text", size: "small", icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.FlaskConical, { size: 14 }), onClick: () => openEval(_nullishCoalesce(evalButtonRef.current, () => ( void 0))), "aria-label": t4("governance.detail.evalSuite"), "aria-pressed": _optionalChain([dockView, 'optionalAccess', _2613 => _2613.kind]) === "eval", style: _optionalChain([dockView, 'optionalAccess', _2614 => _2614.kind]) === "eval" ? activeActionStyle : void 0 }) }),
147085
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.detail.webApps"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { ref: webAppsButtonRef, type: "text", size: "small", icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PanelsTopLeft, { size: 14 }), onClick: () => requestTransition({ kind: "dock", view: { kind: "web-apps" } }), "aria-label": t4("governance.detail.webApps"), "aria-pressed": _optionalChain([dockView, 'optionalAccess', _2615 => _2615.kind]) === "web-apps", style: _optionalChain([dockView, 'optionalAccess', _2616 => _2616.kind]) === "web-apps" ? activeActionStyle : void 0 }) }),
147086
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.detail.configuration"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { ref: configurationButtonRef, type: "text", size: "small", icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Settings2, { size: 14 }), onClick: () => requestTransition({ kind: "dock", view: { kind: "configuration" } }), "aria-label": t4("governance.detail.configuration"), "aria-pressed": _optionalChain([dockView, 'optionalAccess', _2617 => _2617.kind]) === "configuration", style: _optionalChain([dockView, 'optionalAccess', _2618 => _2618.kind]) === "configuration" ? activeActionStyle : void 0 }) }),
146998
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.detail.testInPlayground"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { ref: playgroundButtonRef, type: "text", size: "small", icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Play, { size: 14 }), onClick: () => requestTransition({ kind: "dock", view: { kind: "playground" } }), "aria-label": t4("governance.detail.testInPlayground"), "aria-pressed": _optionalChain([dockView, 'optionalAccess', _2610 => _2610.kind]) === "playground", style: _optionalChain([dockView, 'optionalAccess', _2611 => _2611.kind]) === "playground" ? activeActionStyle : void 0 }) }),
146999
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.detail.evalSuite"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { ref: evalButtonRef, type: "text", size: "small", icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.FlaskConical, { size: 14 }), onClick: () => openEval(_nullishCoalesce(evalButtonRef.current, () => ( void 0))), "aria-label": t4("governance.detail.evalSuite"), "aria-pressed": _optionalChain([dockView, 'optionalAccess', _2612 => _2612.kind]) === "eval", style: _optionalChain([dockView, 'optionalAccess', _2613 => _2613.kind]) === "eval" ? activeActionStyle : void 0 }) }),
147000
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.detail.webApps"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { ref: webAppsButtonRef, type: "text", size: "small", icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PanelsTopLeft, { size: 14 }), onClick: () => requestTransition({ kind: "dock", view: { kind: "web-apps" } }), "aria-label": t4("governance.detail.webApps"), "aria-pressed": _optionalChain([dockView, 'optionalAccess', _2614 => _2614.kind]) === "web-apps", style: _optionalChain([dockView, 'optionalAccess', _2615 => _2615.kind]) === "web-apps" ? activeActionStyle : void 0 }) }),
147001
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.detail.configuration"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { ref: configurationButtonRef, type: "text", size: "small", icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Settings2, { size: 14 }), onClick: () => requestTransition({ kind: "dock", view: { kind: "configuration" } }), "aria-label": t4("governance.detail.configuration"), "aria-pressed": _optionalChain([dockView, 'optionalAccess', _2616 => _2616.kind]) === "configuration", style: _optionalChain([dockView, 'optionalAccess', _2617 => _2617.kind]) === "configuration" ? activeActionStyle : void 0 }) }),
147087
147002
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.deleteAgent"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
147088
147003
  _antd.Button,
147089
147004
  {
@@ -147132,7 +147047,7 @@ var init_AgentDetailView = __esm({
147132
147047
  hudTopOffset: 56,
147133
147048
  onSelectNode: (node) => {
147134
147049
  if (node) requestTransition({ kind: "dock", view: { kind: "node", node } });
147135
- else if (_optionalChain([dockView, 'optionalAccess', _2619 => _2619.kind]) === "node") requestTransition({ kind: "close" });
147050
+ else if (_optionalChain([dockView, 'optionalAccess', _2618 => _2618.kind]) === "node") requestTransition({ kind: "close" });
147136
147051
  },
147137
147052
  onRemoveNode: handleRemoveNode,
147138
147053
  initialMessageRequest,
@@ -147149,7 +147064,7 @@ var init_AgentDetailView = __esm({
147149
147064
  copilotTemporarilyHidden: dockView !== null
147150
147065
  }
147151
147066
  ),
147152
- _optionalChain([dockView, 'optionalAccess', _2620 => _2620.kind]) === "node" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
147067
+ _optionalChain([dockView, 'optionalAccess', _2619 => _2619.kind]) === "node" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
147153
147068
  CanvasDock,
147154
147069
  {
147155
147070
  open: true,
@@ -147171,10 +147086,10 @@ var init_AgentDetailView = __esm({
147171
147086
  )
147172
147087
  }
147173
147088
  ),
147174
- _optionalChain([dockView, 'optionalAccess', _2621 => _2621.kind]) === "playground" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CanvasDock, { open: true, width: 720, title: t4("governance.detail.playground"), onClose: () => requestTransition({ kind: "close" }), restoreFocusRef: playgroundButtonRef, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProjectScopedChating, { assistant_id: assistant.id }) }),
147175
- _optionalChain([dockView, 'optionalAccess', _2622 => _2622.kind]) === "eval" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CanvasDock, { open: true, width: 860, title: _optionalChain([dockView, 'access', _2623 => _2623.initial, 'optionalAccess', _2624 => _2624.page]) === "run" ? t4("governance.detail.runResults") : t4("governance.detail.evalSuite"), onClose: () => requestTransition({ kind: "close" }), restoreFocusRef: _nullishCoalesce(dockView.restoreFocusRef, () => ( evalButtonRef)), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AgentEvalPanel, { assistantId: assistant.id, initial: dockView.initial, navigationKey: dockView.navigationKey }) }, dockView.navigationKey),
147176
- _optionalChain([dockView, 'optionalAccess', _2625 => _2625.kind]) === "web-apps" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CanvasDock, { open: true, width: 960, title: t4("governance.detail.webApps"), onClose: () => requestTransition({ kind: "close" }), restoreFocusRef: webAppsButtonRef, bodyStyle: { padding: 0, overflow: "hidden" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AgentWebAppsPanel, { assistant }) }),
147177
- _optionalChain([dockView, 'optionalAccess', _2626 => _2626.kind]) === "configuration" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
147089
+ _optionalChain([dockView, 'optionalAccess', _2620 => _2620.kind]) === "playground" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CanvasDock, { open: true, width: 720, title: t4("governance.detail.playground"), onClose: () => requestTransition({ kind: "close" }), restoreFocusRef: playgroundButtonRef, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProjectScopedChating, { assistant_id: assistant.id }) }),
147090
+ _optionalChain([dockView, 'optionalAccess', _2621 => _2621.kind]) === "eval" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CanvasDock, { open: true, width: 860, title: _optionalChain([dockView, 'access', _2622 => _2622.initial, 'optionalAccess', _2623 => _2623.page]) === "run" ? t4("governance.detail.runResults") : t4("governance.detail.evalSuite"), onClose: () => requestTransition({ kind: "close" }), restoreFocusRef: _nullishCoalesce(dockView.restoreFocusRef, () => ( evalButtonRef)), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AgentEvalPanel, { assistantId: assistant.id, initial: dockView.initial, navigationKey: dockView.navigationKey }) }, dockView.navigationKey),
147091
+ _optionalChain([dockView, 'optionalAccess', _2624 => _2624.kind]) === "web-apps" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CanvasDock, { open: true, width: 960, title: t4("governance.detail.webApps"), onClose: () => requestTransition({ kind: "close" }), restoreFocusRef: webAppsButtonRef, bodyStyle: { padding: 0, overflow: "hidden" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AgentWebAppsPanel, { assistant }) }),
147092
+ _optionalChain([dockView, 'optionalAccess', _2625 => _2625.kind]) === "configuration" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
147178
147093
  CanvasDock,
147179
147094
  {
147180
147095
  open: true,
@@ -147279,7 +147194,7 @@ var init_ParentAgentSelector = __esm({
147279
147194
  try {
147280
147195
  const data = await get4("/api/assistants");
147281
147196
  if (data.success) {
147282
- setAssistants(_optionalChain([data, 'access', _2627 => _2627.data, 'optionalAccess', _2628 => _2628.records]) || []);
147197
+ setAssistants(_optionalChain([data, 'access', _2626 => _2626.data, 'optionalAccess', _2627 => _2627.records]) || []);
147283
147198
  }
147284
147199
  } catch (error) {
147285
147200
  console.error("Failed to fetch assistants:", error);
@@ -147566,7 +147481,7 @@ var init_CreateAssistantModal = __esm({
147566
147481
  if (open) {
147567
147482
  resetModalState();
147568
147483
  setCreationMode(_nullishCoalesce(initialMode, () => ( "learn")));
147569
- const initialA2aMode = _optionalChain([initialValues, 'optionalAccess', _2629 => _2629.a2aMode]);
147484
+ const initialA2aMode = _optionalChain([initialValues, 'optionalAccess', _2628 => _2628.a2aMode]);
147570
147485
  if (initialA2aMode === "remote" || initialA2aMode === "local") {
147571
147486
  setA2aMode(initialA2aMode);
147572
147487
  }
@@ -147587,7 +147502,7 @@ var init_CreateAssistantModal = __esm({
147587
147502
  if (a2aMode === "local") {
147588
147503
  setTemplatesLoading(true);
147589
147504
  get4("/api/local-a2a/templates").then((data) => {
147590
- if (active && requestId === templateRequestId.current && _optionalChain([data, 'optionalAccess', _2630 => _2630.data, 'optionalAccess', _2631 => _2631.records])) {
147505
+ if (active && requestId === templateRequestId.current && _optionalChain([data, 'optionalAccess', _2629 => _2629.data, 'optionalAccess', _2630 => _2630.records])) {
147591
147506
  setTemplates(data.data.records);
147592
147507
  }
147593
147508
  }).catch(() => {
@@ -147669,11 +147584,11 @@ var init_CreateAssistantModal = __esm({
147669
147584
  "/api/a2a/test-connection",
147670
147585
  body
147671
147586
  );
147672
- if (_optionalChain([data, 'access', _2632 => _2632.data, 'optionalAccess', _2633 => _2633.reachable])) {
147587
+ if (_optionalChain([data, 'access', _2631 => _2631.data, 'optionalAccess', _2632 => _2632.reachable])) {
147673
147588
  const agentCard = data.data.agentCard;
147674
147589
  _antd.message.success(t4("chatConfig.createAssistant.connectedTo", { name: data.data.agentName || url }));
147675
147590
  } else {
147676
- _antd.message.error(_optionalChain([data, 'access', _2634 => _2634.data, 'optionalAccess', _2635 => _2635.error]) || t4("chatConfig.createAssistant.connectionFailed"));
147591
+ _antd.message.error(_optionalChain([data, 'access', _2633 => _2633.data, 'optionalAccess', _2634 => _2634.error]) || t4("chatConfig.createAssistant.connectionFailed"));
147677
147592
  }
147678
147593
  } catch (e120) {
147679
147594
  _antd.message.error(t4("chatConfig.createAssistant.connectionTestFailed"));
@@ -147765,7 +147680,7 @@ var init_CreateAssistantModal = __esm({
147765
147680
  } else {
147766
147681
  const argsStr = values.commandArgs || "";
147767
147682
  const args = argsStr ? argsStr.split(/\s+/).filter(Boolean) : [];
147768
- const commandCwd = String(_optionalChain([values, 'access', _2636 => _2636.command, 'optionalAccess', _2637 => _2637.cwd]) || "").trim();
147683
+ const commandCwd = String(_optionalChain([values, 'access', _2635 => _2635.command, 'optionalAccess', _2636 => _2636.cwd]) || "").trim();
147769
147684
  body.graphDefinition.localRuntime = {
147770
147685
  label: values.name || void 0,
147771
147686
  agentCardUrl: body.graphDefinition.agentCardUrl,
@@ -147873,7 +147788,7 @@ var init_CreateAssistantModal = __esm({
147873
147788
  setLearnGoal("");
147874
147789
  setLearnRefFiles([]);
147875
147790
  setCreationMode("learn");
147876
- _optionalChain([onSuccess, 'optionalCall', _2638 => _2638(agentRes.data, {
147791
+ _optionalChain([onSuccess, 'optionalCall', _2637 => _2637(agentRes.data, {
147877
147792
  initialMessage: buildLearningKickoff({
147878
147793
  goal,
147879
147794
  roundTaskId,
@@ -147905,19 +147820,19 @@ var init_CreateAssistantModal = __esm({
147905
147820
  const data = await post("/api/assistants", requestBody);
147906
147821
  if (data.success) {
147907
147822
  _antd.message.success(
147908
- creationMode === "extend" ? t4("chatConfig.createAssistant.createdByExtending", { name: _nullishCoalesce(_optionalChain([parentAssistant, 'optionalAccess', _2639 => _2639.name]), () => ( "")) }) : t4("chatConfig.createAssistant.created")
147823
+ creationMode === "extend" ? t4("chatConfig.createAssistant.createdByExtending", { name: _nullishCoalesce(_optionalChain([parentAssistant, 'optionalAccess', _2638 => _2638.name]), () => ( "")) }) : t4("chatConfig.createAssistant.created")
147909
147824
  );
147910
147825
  resetModalState();
147911
147826
  for (const clonedAssistant of createdAssistants) {
147912
- _optionalChain([onSuccess, 'optionalCall', _2640 => _2640(clonedAssistant)]);
147827
+ _optionalChain([onSuccess, 'optionalCall', _2639 => _2639(clonedAssistant)]);
147913
147828
  }
147914
- _optionalChain([onSuccess, 'optionalCall', _2641 => _2641(data.data)]);
147829
+ _optionalChain([onSuccess, 'optionalCall', _2640 => _2640(data.data)]);
147915
147830
  onCancel();
147916
147831
  } else {
147917
147832
  _antd.message.error(data.message || t4("chatConfig.createAssistant.createFailed"));
147918
147833
  }
147919
147834
  } catch (error) {
147920
- if (_optionalChain([error, 'optionalAccess', _2642 => _2642.errorFields])) {
147835
+ if (_optionalChain([error, 'optionalAccess', _2641 => _2641.errorFields])) {
147921
147836
  const fieldLabels = {
147922
147837
  key: t4("chatConfig.createAssistant.field.key"),
147923
147838
  name: t4("chatConfig.createAssistant.field.name"),
@@ -147937,7 +147852,7 @@ var init_CreateAssistantModal = __esm({
147937
147852
  setLoading(false);
147938
147853
  }
147939
147854
  };
147940
- const parentSubAgents = _optionalChain([parentAssistant, 'optionalAccess', _2643 => _2643.graphDefinition, 'optionalAccess', _2644 => _2644.subAgents]) || [];
147855
+ const parentSubAgents = _optionalChain([parentAssistant, 'optionalAccess', _2642 => _2642.graphDefinition, 'optionalAccess', _2643 => _2643.subAgents]) || [];
147941
147856
  const showSubAgentList = creationMode === "extend" && parentAssistant && parentSubAgents.length > 0;
147942
147857
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
147943
147858
  _antd.Modal,
@@ -147987,7 +147902,7 @@ var init_CreateAssistantModal = __esm({
147987
147902
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
147988
147903
  ParentAgentSelector,
147989
147904
  {
147990
- value: _optionalChain([parentAssistant, 'optionalAccess', _2645 => _2645.id]),
147905
+ value: _optionalChain([parentAssistant, 'optionalAccess', _2644 => _2644.id]),
147991
147906
  onSelect: handleParentSelect
147992
147907
  }
147993
147908
  ),
@@ -148020,7 +147935,7 @@ var init_CreateAssistantModal = __esm({
148020
147935
  {
148021
147936
  project: trainingProject,
148022
147937
  projects: trainingProjects,
148023
- value: _nullishCoalesce(_optionalChain([trainingProject, 'optionalAccess', _2646 => _2646.id]), () => ( null)),
147938
+ value: _nullishCoalesce(_optionalChain([trainingProject, 'optionalAccess', _2645 => _2645.id]), () => ( null)),
148024
147939
  onChange: setSelectedTrainingId,
148025
147940
  loading: workspaceLoading
148026
147941
  }
@@ -148482,8 +148397,6 @@ var init_AgentGovernanceWorkbench = __esm({
148482
148397
  const { get: get4, del, put } = useApi();
148483
148398
  const t4 = useT();
148484
148399
  const [assistants, setAssistants] = _react.useState.call(void 0, []);
148485
- const [stats, setStats] = _react.useState.call(void 0, {});
148486
- const [statsExpiresAt, setStatsExpiresAt] = _react.useState.call(void 0, null);
148487
148400
  const [loading, setLoading] = _react.useState.call(void 0, false);
148488
148401
  const [selectedId, setSelectedId] = _react.useState.call(void 0, null);
148489
148402
  const [initialTab, setInitialTab] = _react.useState.call(void 0, "graph");
@@ -148500,21 +148413,10 @@ var init_AgentGovernanceWorkbench = __esm({
148500
148413
  const loadAgents = _react.useCallback.call(void 0, async () => {
148501
148414
  setLoading(true);
148502
148415
  try {
148503
- const [listRes, statsRes] = await Promise.all([
148504
- get4("/api/assistants"),
148505
- get4("/api/assistants/stats").catch(() => null)
148506
- ]);
148507
- if (listRes.success && _optionalChain([listRes, 'access', _2647 => _2647.data, 'optionalAccess', _2648 => _2648.records])) {
148416
+ const listRes = await get4("/api/assistants");
148417
+ if (listRes.success && _optionalChain([listRes, 'access', _2646 => _2646.data, 'optionalAccess', _2647 => _2647.records])) {
148508
148418
  setAssistants(listRes.data.records);
148509
148419
  }
148510
- if (_optionalChain([statsRes, 'optionalAccess', _2649 => _2649.success]) && _optionalChain([statsRes, 'access', _2650 => _2650.data, 'optionalAccess', _2651 => _2651.records])) {
148511
- const byId = {};
148512
- for (const rec of statsRes.data.records) {
148513
- byId[rec.id] = rec;
148514
- }
148515
- setStats(byId);
148516
- setStatsExpiresAt(_nullishCoalesce(_optionalChain([statsRes, 'access', _2652 => _2652.cache, 'optionalAccess', _2653 => _2653.expiresAt]), () => ( null)));
148517
- }
148518
148420
  } catch (e122) {
148519
148421
  _antd.message.error(t4("governance.workbench.loadFailed"));
148520
148422
  } finally {
@@ -148535,7 +148437,7 @@ var init_AgentGovernanceWorkbench = __esm({
148535
148437
  const openSideAppCard = useSideAppOpener();
148536
148438
  const openAgentDetailTab = _react.useCallback.call(void 0,
148537
148439
  (id2, tab) => {
148538
- const name = _nullishCoalesce(_optionalChain([assistants, 'access', _2654 => _2654.find, 'call', _2655 => _2655((a4) => a4.id === id2), 'optionalAccess', _2656 => _2656.name]), () => ( t4("governance.workbench.agentFallback")));
148440
+ const name = _nullishCoalesce(_optionalChain([assistants, 'access', _2648 => _2648.find, 'call', _2649 => _2649((a4) => a4.id === id2), 'optionalAccess', _2650 => _2650.name]), () => ( t4("governance.workbench.agentFallback")));
148539
148441
  openSideAppCard({
148540
148442
  component_key: "agent_detail_side_app",
148541
148443
  data: { assistantId: id2, initialTab: tab },
@@ -148651,8 +148553,6 @@ var init_AgentGovernanceWorkbench = __esm({
148651
148553
  {
148652
148554
  items: items3,
148653
148555
  assistants,
148654
- stats,
148655
- statsExpiresAt,
148656
148556
  loading,
148657
148557
  onItemClick: (id2) => openAgentDetailTab(id2, "graph"),
148658
148558
  onOpenPlayground: (id2) => openAgentDetailTab(id2, "playground"),
@@ -148687,9 +148587,9 @@ var init_AgentGovernanceWorkbench = __esm({
148687
148587
  return exists ? prev : [created, ...prev];
148688
148588
  });
148689
148589
  openDetail(created.id, "graph");
148690
- setDetailInitialMessage(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _2657 => _2657.initialMessage]), () => ( null)));
148691
- setDetailInitialMessageCustomRunConfig(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _2658 => _2658.initialMessageCustomRunConfig]), () => ( null)));
148692
- setDetailProjectId(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _2659 => _2659.projectId]), () => ( null)));
148590
+ setDetailInitialMessage(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _2651 => _2651.initialMessage]), () => ( null)));
148591
+ setDetailInitialMessageCustomRunConfig(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _2652 => _2652.initialMessageCustomRunConfig]), () => ( null)));
148592
+ setDetailProjectId(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _2653 => _2653.projectId]), () => ( null)));
148693
148593
  loadAgents();
148694
148594
  }
148695
148595
  }
@@ -148948,7 +148848,7 @@ function StepDetailPopover2({ step }) {
148948
148848
  maxHeight: 200,
148949
148849
  overflow: "auto"
148950
148850
  },
148951
- children: _optionalChain([step, 'access', _2660 => _2660.input, 'optionalAccess', _2661 => _2661.description]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MDResponse, { content: inputText }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { style: { margin: 0, fontSize: 11, whiteSpace: "pre-wrap", wordBreak: "break-word", fontFamily: "monospace" }, children: inputText })
148851
+ children: _optionalChain([step, 'access', _2654 => _2654.input, 'optionalAccess', _2655 => _2655.description]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MDResponse, { content: inputText }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { style: { margin: 0, fontSize: 11, whiteSpace: "pre-wrap", wordBreak: "break-word", fontFamily: "monospace" }, children: inputText })
148952
148852
  }
148953
148853
  )
148954
148854
  ] }),
@@ -148965,7 +148865,7 @@ function StepDetailPopover2({ step }) {
148965
148865
  maxHeight: 200,
148966
148866
  overflow: "auto"
148967
148867
  },
148968
- children: _optionalChain([step, 'access', _2662 => _2662.output, 'optionalAccess', _2663 => _2663.result]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MDResponse, { content: outputText }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { style: { margin: 0, fontSize: 11, whiteSpace: "pre-wrap", wordBreak: "break-word", fontFamily: "monospace" }, children: outputText })
148868
+ children: _optionalChain([step, 'access', _2656 => _2656.output, 'optionalAccess', _2657 => _2657.result]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MDResponse, { content: outputText }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { style: { margin: 0, fontSize: 11, whiteSpace: "pre-wrap", wordBreak: "break-word", fontFamily: "monospace" }, children: outputText })
148969
148869
  }
148970
148870
  )
148971
148871
  ] }),
@@ -149254,8 +149154,8 @@ var init_TopologyRuntimeView = __esm({
149254
149154
  "/api/workflows/runs"
149255
149155
  )
149256
149156
  ]);
149257
- if (stepsRes.success) setSteps(_optionalChain([stepsRes, 'access', _2664 => _2664.data, 'optionalAccess', _2665 => _2665.records]) || []);
149258
- if (runsRes.success && _optionalChain([runsRes, 'access', _2666 => _2666.data, 'optionalAccess', _2667 => _2667.records])) {
149157
+ if (stepsRes.success) setSteps(_optionalChain([stepsRes, 'access', _2658 => _2658.data, 'optionalAccess', _2659 => _2659.records]) || []);
149158
+ if (runsRes.success && _optionalChain([runsRes, 'access', _2660 => _2660.data, 'optionalAccess', _2661 => _2661.records])) {
149259
149159
  const matched = runsRes.data.records.find((r6) => r6.id === run.id);
149260
149160
  if (matched) onRunUpdate(matched);
149261
149161
  }
@@ -149266,9 +149166,9 @@ var init_TopologyRuntimeView = __esm({
149266
149166
  try {
149267
149167
  setGraphLoading(true);
149268
149168
  const res = await get4(`/api/assistants/${run.assistantId}`);
149269
- if (res.success && _optionalChain([res, 'access', _2668 => _2668.data, 'optionalAccess', _2669 => _2669.graphDefinition])) {
149169
+ if (res.success && _optionalChain([res, 'access', _2662 => _2662.data, 'optionalAccess', _2663 => _2663.graphDefinition])) {
149270
149170
  const gd = res.data.graphDefinition;
149271
- if (_optionalChain([gd, 'optionalAccess', _2670 => _2670.type]) === "workflow" && typeof _optionalChain([gd, 'optionalAccess', _2671 => _2671.workflowYaml]) === "string") {
149171
+ if (_optionalChain([gd, 'optionalAccess', _2664 => _2664.type]) === "workflow" && typeof _optionalChain([gd, 'optionalAccess', _2665 => _2665.workflowYaml]) === "string") {
149272
149172
  setGraphDefinition(gd.workflowYaml);
149273
149173
  } else {
149274
149174
  setGraphDefinition(null);
@@ -149362,13 +149262,13 @@ var init_TopologyRuntimeView = __esm({
149362
149262
  setRuns(
149363
149263
  (prev) => prev.map((r6) => r6.id === updated.id ? updated : r6)
149364
149264
  );
149365
- setSelectedRun((prev) => _optionalChain([prev, 'optionalAccess', _2672 => _2672.id]) === updated.id ? updated : prev);
149265
+ setSelectedRun((prev) => _optionalChain([prev, 'optionalAccess', _2666 => _2666.id]) === updated.id ? updated : prev);
149366
149266
  }, []);
149367
149267
  const handleDeleteRun = _react.useCallback.call(void 0, async (runId) => {
149368
149268
  try {
149369
149269
  await del(`/api/workflows/runs/${runId}`);
149370
149270
  setRuns((prev) => prev.filter((r6) => r6.id !== runId));
149371
- setSelectedRun((prev) => _optionalChain([prev, 'optionalAccess', _2673 => _2673.id]) === runId ? null : prev);
149271
+ setSelectedRun((prev) => _optionalChain([prev, 'optionalAccess', _2667 => _2667.id]) === runId ? null : prev);
149372
149272
  } catch (err) {
149373
149273
  const message49 = err instanceof Error ? err.message : t4("chatWorkspace.topologyRuntime.deleteRunFailed");
149374
149274
  setError(message49);
@@ -149379,14 +149279,14 @@ var init_TopologyRuntimeView = __esm({
149379
149279
  try {
149380
149280
  const defsRes = await get4("/api/workflows/definitions");
149381
149281
  const nameMap = {};
149382
- if (defsRes.success && _optionalChain([defsRes, 'access', _2674 => _2674.data, 'optionalAccess', _2675 => _2675.records])) {
149282
+ if (defsRes.success && _optionalChain([defsRes, 'access', _2668 => _2668.data, 'optionalAccess', _2669 => _2669.records])) {
149383
149283
  defsRes.data.records.forEach((d3) => {
149384
149284
  nameMap[d3.assistantId] = d3.assistantName;
149385
149285
  });
149386
149286
  }
149387
149287
  setAgentNames(nameMap);
149388
149288
  const runsRes = await get4("/api/workflows/runs");
149389
- if (runsRes.success && _optionalChain([runsRes, 'access', _2676 => _2676.data, 'optionalAccess', _2677 => _2677.records])) {
149289
+ if (runsRes.success && _optionalChain([runsRes, 'access', _2670 => _2670.data, 'optionalAccess', _2671 => _2671.records])) {
149390
149290
  runsRes.data.records.sort(
149391
149291
  (a4, b10) => new Date(b10.startedAt).getTime() - new Date(a4.startedAt).getTime()
149392
149292
  );
@@ -149411,7 +149311,7 @@ var init_TopologyRuntimeView = __esm({
149411
149311
  const defsRes = await get4("/api/workflows/definitions");
149412
149312
  if (cancelled) return;
149413
149313
  const nameMap = {};
149414
- if (defsRes.success && _optionalChain([defsRes, 'access', _2678 => _2678.data, 'optionalAccess', _2679 => _2679.records])) {
149314
+ if (defsRes.success && _optionalChain([defsRes, 'access', _2672 => _2672.data, 'optionalAccess', _2673 => _2673.records])) {
149415
149315
  defsRes.data.records.forEach((d3) => {
149416
149316
  nameMap[d3.assistantId] = d3.assistantName;
149417
149317
  });
@@ -149419,7 +149319,7 @@ var init_TopologyRuntimeView = __esm({
149419
149319
  setAgentNames(nameMap);
149420
149320
  const runsRes = await get4("/api/workflows/runs");
149421
149321
  if (cancelled) return;
149422
- if (runsRes.success && _optionalChain([runsRes, 'access', _2680 => _2680.data, 'optionalAccess', _2681 => _2681.records])) {
149322
+ if (runsRes.success && _optionalChain([runsRes, 'access', _2674 => _2674.data, 'optionalAccess', _2675 => _2675.records])) {
149423
149323
  runsRes.data.records.sort(
149424
149324
  (a4, b10) => new Date(b10.startedAt).getTime() - new Date(a4.startedAt).getTime()
149425
149325
  );
@@ -149519,7 +149419,7 @@ var init_TopologyRuntimeView = __esm({
149519
149419
 
149520
149420
  function extractName(purpose) {
149521
149421
  const segments = purpose.split(/[\n\r.。;;!!??]+/).filter(Boolean);
149522
- let name = _optionalChain([segments, 'access', _2682 => _2682[0], 'optionalAccess', _2683 => _2683.trim, 'call', _2684 => _2684()]) || "";
149422
+ let name = _optionalChain([segments, 'access', _2676 => _2676[0], 'optionalAccess', _2677 => _2677.trim, 'call', _2678 => _2678()]) || "";
149523
149423
  name = name.replace(/[,,]+$/, "").trim();
149524
149424
  if (name.length > 50) name = name.slice(0, 50);
149525
149425
  if (!name) name = purpose.slice(0, 50).trim();
@@ -149570,7 +149470,7 @@ var init_CreateWorkflowModal = __esm({
149570
149470
  description: purpose,
149571
149471
  type: "workflow",
149572
149472
  prompt: "Complete the assigned task accurately and concisely.",
149573
- metadata: { trainingProjectId: _optionalChain([trainingProject, 'optionalAccess', _2685 => _2685.id]) },
149473
+ metadata: { trainingProjectId: _optionalChain([trainingProject, 'optionalAccess', _2679 => _2679.id]) },
149574
149474
  workflowYaml: `name: ${id2}
149575
149475
  steps: []
149576
149476
  `
@@ -149597,7 +149497,7 @@ steps: []
149597
149497
  const body = { id: id2, name, description: purpose, graphDefinition };
149598
149498
  await post("/api/assistants", body);
149599
149499
  form.resetFields();
149600
- onCreated(id2, purpose, type2 === "workflow" ? _optionalChain([trainingProject, 'optionalAccess', _2686 => _2686.id]) : void 0);
149500
+ onCreated(id2, purpose, type2 === "workflow" ? _optionalChain([trainingProject, 'optionalAccess', _2680 => _2680.id]) : void 0);
149601
149501
  };
149602
149502
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
149603
149503
  _antd.Modal,
@@ -149636,7 +149536,7 @@ steps: []
149636
149536
  {
149637
149537
  project: trainingProject,
149638
149538
  projects: trainingProjects,
149639
- value: _nullishCoalesce(_optionalChain([trainingProject, 'optionalAccess', _2687 => _2687.id]), () => ( null)),
149539
+ value: _nullishCoalesce(_optionalChain([trainingProject, 'optionalAccess', _2681 => _2681.id]), () => ( null)),
149640
149540
  onChange: setSelectedTrainingId,
149641
149541
  loading: workspaceLoading
149642
149542
  }
@@ -150009,7 +149909,7 @@ var init_EnvironmentCard = __esm({
150009
149909
  ]
150010
149910
  }
150011
149911
  ),
150012
- Boolean(_optionalChain([config, 'access', _2688 => _2688.runConfig, 'optionalAccess', _2689 => _2689.databaseKey])) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
149912
+ Boolean(_optionalChain([config, 'access', _2682 => _2682.runConfig, 'optionalAccess', _2683 => _2683.databaseKey])) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
150013
149913
  "div",
150014
149914
  {
150015
149915
  style: {
@@ -150029,7 +149929,7 @@ var init_EnvironmentCard = __esm({
150029
149929
  },
150030
149930
  children: [
150031
149931
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Database, { size: 10 }),
150032
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t4("chat.environment.db", { db: String(_optionalChain([config, 'access', _2690 => _2690.runConfig, 'optionalAccess', _2691 => _2691.databaseKey])) }) })
149932
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t4("chat.environment.db", { db: String(_optionalChain([config, 'access', _2684 => _2684.runConfig, 'optionalAccess', _2685 => _2685.databaseKey])) }) })
150033
149933
  ]
150034
149934
  }
150035
149935
  ),
@@ -150449,13 +150349,13 @@ var init_WorkflowAutomationView = __esm({
150449
150349
  const fetchAllAssistants = _react.useCallback.call(void 0, async () => {
150450
150350
  try {
150451
150351
  const res = await get4("/api/assistants");
150452
- if (res.success && _optionalChain([res, 'access', _2692 => _2692.data, 'optionalAccess', _2693 => _2693.records])) {
150352
+ if (res.success && _optionalChain([res, 'access', _2686 => _2686.data, 'optionalAccess', _2687 => _2687.records])) {
150453
150353
  const cfgs = [];
150454
150354
  const nameMap = /* @__PURE__ */ new Map();
150455
150355
  for (const a4 of res.data.records) {
150456
150356
  if (a4.id && a4.name) {
150457
150357
  const def = typeof a4.graphDefinition === "object" && a4.graphDefinition !== null ? a4.graphDefinition : void 0;
150458
- nameMap.set(a4.id, { name: a4.name, type: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _2694 => _2694.type]), () => ( "unknown")) });
150358
+ nameMap.set(a4.id, { name: a4.name, type: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _2688 => _2688.type]), () => ( "unknown")) });
150459
150359
  }
150460
150360
  if (!a4.graphDefinition) continue;
150461
150361
  if (typeof a4.graphDefinition === "string") {
@@ -150487,14 +150387,14 @@ var init_WorkflowAutomationView = __esm({
150487
150387
  );
150488
150388
  const fetchWorkflows = _react.useCallback.call(void 0, async () => {
150489
150389
  const res = await get4("/api/assistants");
150490
- if (res.success && _optionalChain([res, 'access', _2695 => _2695.data, 'optionalAccess', _2696 => _2696.records])) {
150390
+ if (res.success && _optionalChain([res, 'access', _2689 => _2689.data, 'optionalAccess', _2690 => _2690.records])) {
150491
150391
  const items3 = res.data.records.filter((a4) => {
150492
150392
  const def = _nullishCoalesce(parseGraphDefinition3(a4.graphDefinition), () => ( void 0));
150493
- return _optionalChain([def, 'optionalAccess', _2697 => _2697.type]) === "workflow";
150393
+ return _optionalChain([def, 'optionalAccess', _2691 => _2691.type]) === "workflow";
150494
150394
  }).map((a4) => {
150495
150395
  const def = _nullishCoalesce(parseGraphDefinition3(a4.graphDefinition), () => ( void 0));
150496
- const yamlStr = typeof _optionalChain([def, 'optionalAccess', _2698 => _2698.workflowYaml]) === "string" ? def.workflowYaml : "";
150497
- const metadata = _optionalChain([def, 'optionalAccess', _2699 => _2699.metadata]);
150396
+ const yamlStr = typeof _optionalChain([def, 'optionalAccess', _2692 => _2692.workflowYaml]) === "string" ? def.workflowYaml : "";
150397
+ const metadata = _optionalChain([def, 'optionalAccess', _2693 => _2693.metadata]);
150498
150398
  let stepCount = 0;
150499
150399
  try {
150500
150400
  const dsl2 = expandWorkflow(yamlStr);
@@ -150507,7 +150407,7 @@ var init_WorkflowAutomationView = __esm({
150507
150407
  description: a4.description || "",
150508
150408
  type: "workflow",
150509
150409
  stepCount,
150510
- trainingProjectId: typeof _optionalChain([metadata, 'optionalAccess', _2700 => _2700.trainingProjectId]) === "string" ? metadata.trainingProjectId : void 0
150410
+ trainingProjectId: typeof _optionalChain([metadata, 'optionalAccess', _2694 => _2694.trainingProjectId]) === "string" ? metadata.trainingProjectId : void 0
150511
150411
  };
150512
150412
  });
150513
150413
  setWorkflows(items3);
@@ -150640,13 +150540,13 @@ var init_WorkflowAutomationView = __esm({
150640
150540
  () => workflows.find((w3) => w3.id === selectedId) || null,
150641
150541
  [workflows, selectedId]
150642
150542
  );
150643
- const copilotProjectId = _nullishCoalesce(_nullishCoalesce(_optionalChain([selectedWorkflow, 'optionalAccess', _2701 => _2701.trainingProjectId]), () => ( _optionalChain([trainingProjects, 'access', _2702 => _2702[0], 'optionalAccess', _2703 => _2703.id]))), () => ( null));
150543
+ const copilotProjectId = _nullishCoalesce(_nullishCoalesce(_optionalChain([selectedWorkflow, 'optionalAccess', _2695 => _2695.trainingProjectId]), () => ( _optionalChain([trainingProjects, 'access', _2696 => _2696[0], 'optionalAccess', _2697 => _2697.id]))), () => ( null));
150644
150544
  const workflowContext = _react.useMemo.call(void 0,
150645
150545
  () => selectedId && selectedWorkflow ? { id: selectedId, name: selectedWorkflow.name, type: "workflow" } : null,
150646
150546
  [selectedId, selectedWorkflow]
150647
150547
  );
150648
150548
  const environmentConfig = _react.useMemo.call(void 0, () => {
150649
- const refs = _nullishCoalesce(_optionalChain([dsl, 'optionalAccess', _2704 => _2704.nodes, 'access', _2705 => _2705.filter, 'call', _2706 => _2706((n4) => n4.type !== "terminal" && n4.ref), 'access', _2707 => _2707.map, 'call', _2708 => _2708((n4) => n4.ref), 'access', _2709 => _2709.filter, 'call', _2710 => _2710((v3, i4, a4) => a4.indexOf(v3) === i4)]), () => ( []));
150549
+ const refs = _nullishCoalesce(_optionalChain([dsl, 'optionalAccess', _2698 => _2698.nodes, 'access', _2699 => _2699.filter, 'call', _2700 => _2700((n4) => n4.type !== "terminal" && n4.ref), 'access', _2701 => _2701.map, 'call', _2702 => _2702((n4) => n4.ref), 'access', _2703 => _2703.filter, 'call', _2704 => _2704((v3, i4, a4) => a4.indexOf(v3) === i4)]), () => ( []));
150650
150550
  if (refs.length === 0) return graphDef;
150651
150551
  const matching = agentConfigs.filter((cfg) => {
150652
150552
  const key = cfg.key;
@@ -150720,14 +150620,14 @@ var init_WorkflowAutomationView = __esm({
150720
150620
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
150721
150621
  _antd.Modal,
150722
150622
  {
150723
- title: _optionalChain([selectedWorkflow, 'optionalAccess', _2711 => _2711.name]),
150623
+ title: _optionalChain([selectedWorkflow, 'optionalAccess', _2705 => _2705.name]),
150724
150624
  open: specModalOpen,
150725
150625
  onCancel: () => setSpecModalOpen(false),
150726
150626
  footer: null,
150727
150627
  width: "85vw",
150728
150628
  centered: true,
150729
150629
  styles: { body: { maxHeight: "calc(85vh - 120px)", overflow: "auto", padding: "12px 24px 24px" } },
150730
- children: _optionalChain([selectedWorkflow, 'optionalAccess', _2712 => _2712.description]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MDResponse, { content: selectedWorkflow.description }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text90, { type: "secondary", children: t4("chatWorkspace.workflowAutomation.noDescription") })
150630
+ children: _optionalChain([selectedWorkflow, 'optionalAccess', _2706 => _2706.description]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MDResponse, { content: selectedWorkflow.description }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text90, { type: "secondary", children: t4("chatWorkspace.workflowAutomation.noDescription") })
150731
150631
  }
150732
150632
  ),
150733
150633
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ReactFlowProvider, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { height: "100%", width: "100%", position: "relative", overflow: "hidden" }, children: [
@@ -150807,7 +150707,7 @@ var init_WorkflowAutomationView = __esm({
150807
150707
  },
150808
150708
  initialMessageRequest,
150809
150709
  onInitialMessageSubmitted: (requestId) => setInitialMessageRequest(
150810
- (current) => _optionalChain([current, 'optionalAccess', _2713 => _2713.requestId]) === requestId ? null : current
150710
+ (current) => _optionalChain([current, 'optionalAccess', _2707 => _2707.requestId]) === requestId ? null : current
150811
150711
  )
150812
150712
  }
150813
150713
  )
@@ -150871,7 +150771,7 @@ var init_AgentDetailSideApp = __esm({
150871
150771
  setError(null);
150872
150772
  try {
150873
150773
  const res = await get4("/api/assistants");
150874
- const records = _nullishCoalesce(_optionalChain([res, 'access', _2714 => _2714.data, 'optionalAccess', _2715 => _2715.records]), () => ( []));
150774
+ const records = _nullishCoalesce(_optionalChain([res, 'access', _2708 => _2708.data, 'optionalAccess', _2709 => _2709.records]), () => ( []));
150875
150775
  setAllAssistants(records);
150876
150776
  setAssistant(_nullishCoalesce(records.find((a4) => a4.id === assistantId), () => ( null)));
150877
150777
  } catch (e134) {
@@ -151364,7 +151264,7 @@ var init_WorkspaceResourceManager = __esm({
151364
151264
  });
151365
151265
  regsiterElement("collection_entry_table", {
151366
151266
  card_view: () => null,
151367
- side_app_view: ({ data }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CollectionEntryTable, { collectionName: _optionalChain([data, 'optionalAccess', _2716 => _2716.collectionName]) })
151267
+ side_app_view: ({ data }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CollectionEntryTable, { collectionName: _optionalChain([data, 'optionalAccess', _2710 => _2710.collectionName]) })
151368
151268
  });
151369
151269
  }
151370
151270
  }, []);
@@ -151380,7 +151280,7 @@ var init_WorkspaceResourceManager = __esm({
151380
151280
  const fetchCustomMenu = _react.useCallback.call(void 0, async () => {
151381
151281
  try {
151382
151282
  const json2 = await get4("/api/menu-items?menuTarget=workspace");
151383
- if (json2.success && _optionalChain([json2, 'access', _2717 => _2717.data, 'optionalAccess', _2718 => _2718.records])) {
151283
+ if (json2.success && _optionalChain([json2, 'access', _2711 => _2711.data, 'optionalAccess', _2712 => _2712.records])) {
151384
151284
  const items3 = json2.data.records.map(menuItemToSideMenuItemConfig);
151385
151285
  setFetchedCustomMenuItems(items3);
151386
151286
  }
@@ -151406,7 +151306,7 @@ var init_WorkspaceResourceManager = __esm({
151406
151306
  }
151407
151307
  }, [fetchedCustomMenuItems]);
151408
151308
  const menuItems = _react.useMemo.call(void 0, () => {
151409
- const base = _optionalChain([config, 'access', _2719 => _2719.workspaceMenuItems, 'optionalAccess', _2720 => _2720.length]) ? config.workspaceMenuItems : DEFAULT_WORKSPACE_MENU_ITEMS;
151309
+ const base = _optionalChain([config, 'access', _2713 => _2713.workspaceMenuItems, 'optionalAccess', _2714 => _2714.length]) ? config.workspaceMenuItems : DEFAULT_WORKSPACE_MENU_ITEMS;
151410
151310
  const merged = fetchedCustomMenuItems.length > 0 ? mergeMenuItems([...base], fetchedCustomMenuItems) : [...base];
151411
151311
  return merged;
151412
151312
  }, [config.workspaceMenuItems, fetchedCustomMenuItems]);
@@ -151552,7 +151452,7 @@ var init_WorkspaceResourceManager = __esm({
151552
151452
  color: "white",
151553
151453
  flexShrink: 0
151554
151454
  },
151555
- children: (_optionalChain([user, 'access', _2721 => _2721.name, 'optionalAccess', _2722 => _2722.charAt, 'call', _2723 => _2723(0)]) || user.email.charAt(0)).toUpperCase()
151455
+ children: (_optionalChain([user, 'access', _2715 => _2715.name, 'optionalAccess', _2716 => _2716.charAt, 'call', _2717 => _2717(0)]) || user.email.charAt(0)).toUpperCase()
151556
151456
  }
151557
151457
  ),
151558
151458
  !isIconMode && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { flex: 1, minWidth: 0 }, children: [
@@ -151616,7 +151516,7 @@ var init_WorkspaceResourceManager = __esm({
151616
151516
  TenantSelector,
151617
151517
  {
151618
151518
  tenants: tenants.map((t5) => t5.tenant).filter((t5) => t5 != null),
151619
- currentTenantId: _optionalChain([currentTenant, 'optionalAccess', _2724 => _2724.id]),
151519
+ currentTenantId: _optionalChain([currentTenant, 'optionalAccess', _2718 => _2718.id]),
151620
151520
  onSelect: async (tenant) => {
151621
151521
  await selectTenant(tenant.id);
151622
151522
  setTenantModalOpen(false);
@@ -151715,7 +151615,7 @@ async function checkPinStatus(get4, params, enableCustomMenu) {
151715
151615
  return { isPinned: false, pinnedId: null };
151716
151616
  }
151717
151617
  const json2 = await get4("/api/menu-items?menuTarget=workspace");
151718
- if (json2.success && _optionalChain([json2, 'access', _2725 => _2725.data, 'optionalAccess', _2726 => _2726.records])) {
151618
+ if (json2.success && _optionalChain([json2, 'access', _2719 => _2719.data, 'optionalAccess', _2720 => _2720.records])) {
151719
151619
  const matchFn = _nullishCoalesce(isMatch, () => ( ((cfg) => contentType === "agent" && cfg.agentId === assistantId)));
151720
151620
  const pinned = json2.data.records.find((item) => {
151721
151621
  const cfg = _nullishCoalesce(item.contentConfig, () => ( {}));
@@ -151734,7 +151634,7 @@ async function pinItem(post, params, t4) {
151734
151634
  menuTarget: "workspace",
151735
151635
  contentType,
151736
151636
  contentConfig,
151737
- group: _optionalChain([group2, 'optionalAccess', _2727 => _2727.trim, 'call', _2728 => _2728()]) || void 0,
151637
+ group: _optionalChain([group2, 'optionalAccess', _2721 => _2721.trim, 'call', _2722 => _2722()]) || void 0,
151738
151638
  name: name.trim(),
151739
151639
  sortOrder: 0
151740
151640
  };
@@ -151759,8 +151659,8 @@ function usePinMenuActions() {
151759
151659
  const { post, get: get4, del } = useApi();
151760
151660
  const t4 = useT();
151761
151661
  const enableCustomMenu = _nullishCoalesce(config.enableCustomMenu, () => ( false));
151762
- const workspaceId = _optionalChain([workspaceCtx, 'optionalAccess', _2729 => _2729.workspaceId]);
151763
- const projectId = _optionalChain([workspaceCtx, 'optionalAccess', _2730 => _2730.projectId]);
151662
+ const workspaceId = _optionalChain([workspaceCtx, 'optionalAccess', _2723 => _2723.workspaceId]);
151663
+ const projectId = _optionalChain([workspaceCtx, 'optionalAccess', _2724 => _2724.projectId]);
151764
151664
  const check = _react.useCallback.call(void 0,
151765
151665
  async (params) => checkPinStatus(get4, { ...params, workspaceId, projectId }, enableCustomMenu),
151766
151666
  [get4, enableCustomMenu, workspaceId, projectId]
@@ -151778,7 +151678,7 @@ function usePinMenuActions() {
151778
151678
  function extractGroups(items3) {
151779
151679
  const groups2 = /* @__PURE__ */ new Set();
151780
151680
  for (const item of items3) {
151781
- if (_optionalChain([item, 'access', _2731 => _2731.group, 'optionalAccess', _2732 => _2732.trim, 'call', _2733 => _2733()])) {
151681
+ if (_optionalChain([item, 'access', _2725 => _2725.group, 'optionalAccess', _2726 => _2726.trim, 'call', _2727 => _2727()])) {
151782
151682
  groups2.add(item.group.trim());
151783
151683
  }
151784
151684
  }
@@ -151798,10 +151698,10 @@ function useMenuGroups() {
151798
151698
  }
151799
151699
  async function fetchExistingGroups(get4) {
151800
151700
  const json2 = await get4("/api/menu-items?menuTarget=workspace");
151801
- if (json2.success && _optionalChain([json2, 'access', _2734 => _2734.data, 'optionalAccess', _2735 => _2735.records])) {
151701
+ if (json2.success && _optionalChain([json2, 'access', _2728 => _2728.data, 'optionalAccess', _2729 => _2729.records])) {
151802
151702
  const groups2 = /* @__PURE__ */ new Set();
151803
151703
  for (const item of json2.data.records) {
151804
- if (_optionalChain([item, 'access', _2736 => _2736.group, 'optionalAccess', _2737 => _2737.trim, 'call', _2738 => _2738()])) {
151704
+ if (_optionalChain([item, 'access', _2730 => _2730.group, 'optionalAccess', _2731 => _2731.trim, 'call', _2732 => _2732()])) {
151805
151705
  groups2.add(item.group.trim());
151806
151706
  }
151807
151707
  }
@@ -151971,7 +151871,7 @@ var init_PinToMenuButton = __esm({
151971
151871
  value: group2,
151972
151872
  options: existingGroups.map((g3) => ({ value: g3 })),
151973
151873
  onChange: (val) => setGroup(val),
151974
- filterOption: (inputValue, option) => _nullishCoalesce(_optionalChain([option, 'optionalAccess', _2739 => _2739.value, 'optionalAccess', _2740 => _2740.toUpperCase, 'call', _2741 => _2741(), 'access', _2742 => _2742.includes, 'call', _2743 => _2743(inputValue.toUpperCase())]), () => ( false))
151874
+ filterOption: (inputValue, option) => _nullishCoalesce(_optionalChain([option, 'optionalAccess', _2733 => _2733.value, 'optionalAccess', _2734 => _2734.toUpperCase, 'call', _2735 => _2735(), 'access', _2736 => _2736.includes, 'call', _2737 => _2737(inputValue.toUpperCase())]), () => ( false))
151975
151875
  }
151976
151876
  )
151977
151877
  ] })
@@ -152027,7 +151927,7 @@ var init_ToolPanelFiles = __esm({
152027
151927
  }
152028
151928
  setFolderLoading((prev) => ({ ...prev, [folder.name]: true }));
152029
151929
  try {
152030
- const items3 = await listPathByFolder(folder.name, _optionalChain([currentAssistant, 'optionalAccess', _2744 => _2744.id]));
151930
+ const items3 = await listPathByFolder(folder.name, _optionalChain([currentAssistant, 'optionalAccess', _2738 => _2738.id]));
152031
151931
  setFolderEntries((prev) => ({ ...prev, [folder.name]: items3 }));
152032
151932
  if (clearSubdirectoryCache) {
152033
151933
  const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
@@ -152057,7 +151957,7 @@ var init_ToolPanelFiles = __esm({
152057
151957
  setFolderLoading((prev) => ({ ...prev, [folder.name]: false }));
152058
151958
  }
152059
151959
  },
152060
- [workspaceId, projectId, listPathByFolder, _optionalChain([currentAssistant, 'optionalAccess', _2745 => _2745.id])]
151960
+ [workspaceId, projectId, listPathByFolder, _optionalChain([currentAssistant, 'optionalAccess', _2739 => _2739.id])]
152061
151961
  );
152062
151962
  const handleToggleDirectory = _react.useCallback.call(void 0, async (path2) => {
152063
151963
  const isExpanded = directoryExpanded[path2] || false;
@@ -152068,7 +151968,7 @@ var init_ToolPanelFiles = __esm({
152068
151968
  setDirectoryExpanded((prev) => ({ ...prev, [path2]: true }));
152069
151969
  setDirectoryLoading((prev) => ({ ...prev, [path2]: true }));
152070
151970
  try {
152071
- const items3 = await listPath(path2, _optionalChain([currentAssistant, 'optionalAccess', _2746 => _2746.id]));
151971
+ const items3 = await listPath(path2, _optionalChain([currentAssistant, 'optionalAccess', _2740 => _2740.id]));
152072
151972
  setDirectoryChildren((prev) => ({ ...prev, [path2]: items3 }));
152073
151973
  } catch (error) {
152074
151974
  console.error(`Failed to load directory ${path2}:`, error);
@@ -152076,15 +151976,15 @@ var init_ToolPanelFiles = __esm({
152076
151976
  } finally {
152077
151977
  setDirectoryLoading((prev) => ({ ...prev, [path2]: false }));
152078
151978
  }
152079
- }, [directoryExpanded, listPath, _optionalChain([currentAssistant, 'optionalAccess', _2747 => _2747.id])]);
151979
+ }, [directoryExpanded, listPath, _optionalChain([currentAssistant, 'optionalAccess', _2741 => _2741.id])]);
152080
151980
  _react.useEffect.call(void 0, () => {
152081
151981
  resourceFolders.forEach((folder) => {
152082
151982
  void loadAssetsForFolder(folder, false);
152083
151983
  });
152084
151984
  }, [resourceFolders, loadAssetsForFolder]);
152085
151985
  const handleAssetClick = _react.useCallback.call(void 0, (asset) => {
152086
- const fileUrl = getFileViewUrl(asset.path, _optionalChain([currentAssistant, 'optionalAccess', _2748 => _2748.id]));
152087
- const downloadUrl = getFileDownloadUrl(asset.path, _optionalChain([currentAssistant, 'optionalAccess', _2749 => _2749.id]));
151986
+ const fileUrl = getFileViewUrl(asset.path, _optionalChain([currentAssistant, 'optionalAccess', _2742 => _2742.id]));
151987
+ const downloadUrl = getFileDownloadUrl(asset.path, _optionalChain([currentAssistant, 'optionalAccess', _2743 => _2743.id]));
152088
151988
  if (!fileUrl || !downloadUrl) {
152089
151989
  _antd.message.warning(t4("chatWorkspace.workspace.selectFirst"));
152090
151990
  return;
@@ -152099,7 +151999,7 @@ var init_ToolPanelFiles = __esm({
152099
151999
  },
152100
152000
  message: t4("chatWorkspace.workspace.preview", { name: asset.name || asset.path })
152101
152001
  });
152102
- }, [getFileViewUrl, getFileDownloadUrl, openSideApp, _optionalChain([currentAssistant, 'optionalAccess', _2750 => _2750.id]), t4]);
152002
+ }, [getFileViewUrl, getFileDownloadUrl, openSideApp, _optionalChain([currentAssistant, 'optionalAccess', _2744 => _2744.id]), t4]);
152103
152003
  const handleUploadFolder = _react.useCallback.call(void 0, async (folderName) => {
152104
152004
  if (!workspaceId || !projectId) {
152105
152005
  _antd.message.warning(t4("chatWorkspace.workspace.selectBeforeUploadProject"));
@@ -152109,13 +152009,13 @@ var init_ToolPanelFiles = __esm({
152109
152009
  input.type = "file";
152110
152010
  input.onchange = async (event) => {
152111
152011
  const target = event.target;
152112
- const file = _optionalChain([target, 'optionalAccess', _2751 => _2751.files, 'optionalAccess', _2752 => _2752[0]]);
152012
+ const file = _optionalChain([target, 'optionalAccess', _2745 => _2745.files, 'optionalAccess', _2746 => _2746[0]]);
152113
152013
  if (!file) {
152114
152014
  return;
152115
152015
  }
152116
152016
  setUploadingFolder(folderName);
152117
152017
  try {
152118
- await uploadFileToFolder(folderName, file, _optionalChain([currentAssistant, 'optionalAccess', _2753 => _2753.id]));
152018
+ await uploadFileToFolder(folderName, file, _optionalChain([currentAssistant, 'optionalAccess', _2747 => _2747.id]));
152119
152019
  _antd.message.success(t4("chatWorkspace.workspace.uploaded", { name: file.name }));
152120
152020
  const folder = resourceFolders.find((item) => item.name === folderName);
152121
152021
  if (folder) {
@@ -152130,7 +152030,7 @@ var init_ToolPanelFiles = __esm({
152130
152030
  }
152131
152031
  };
152132
152032
  input.click();
152133
- }, [workspaceId, projectId, uploadFileToFolder, resourceFolders, loadAssetsForFolder, _optionalChain([currentAssistant, 'optionalAccess', _2754 => _2754.id]), t4]);
152033
+ }, [workspaceId, projectId, uploadFileToFolder, resourceFolders, loadAssetsForFolder, _optionalChain([currentAssistant, 'optionalAccess', _2748 => _2748.id]), t4]);
152134
152034
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
152135
152035
  FileDirectoryPanel,
152136
152036
  {
@@ -152156,7 +152056,7 @@ var init_ToolPanelFiles = __esm({
152156
152056
  // src/components/Chat/LatticeChat.tsx
152157
152057
 
152158
152058
 
152159
- var useStyles75, LatticeChatContent, LatticeChat;
152059
+ var useStyles74, LatticeChatContent, LatticeChat;
152160
152060
  var init_LatticeChat = __esm({
152161
152061
  "src/components/Chat/LatticeChat.tsx"() {
152162
152062
  "use strict";
@@ -152174,7 +152074,7 @@ var init_LatticeChat = __esm({
152174
152074
  init_ToolPanelFiles();
152175
152075
  init_ChatErrorBoundary();
152176
152076
  init_i18n();
152177
- useStyles75 = _antdstyle.createStyles.call(void 0, ({ css }) => ({
152077
+ useStyles74 = _antdstyle.createStyles.call(void 0, ({ css }) => ({
152178
152078
  wrapper: css`
152179
152079
  display: flex;
152180
152080
  flex-direction: column;
@@ -152205,7 +152105,7 @@ var init_LatticeChat = __esm({
152205
152105
  const t4 = useT();
152206
152106
  const { assistant_id: assistantId, thread_id = "", menu, header, headerRight, showProjectSelector, headerSelector, emptyPlaceholder, ...chatingProps } = props;
152207
152107
  const { config } = useLatticeChatShellContext();
152208
- const { styles } = useStyles75();
152108
+ const { styles } = useStyles74();
152209
152109
  const showWorkspaceSelector = _nullishCoalesce(showProjectSelector, () => ( config.enableWorkspace));
152210
152110
  const headerLeftContent = _nullishCoalesce(headerSelector, () => ( (showWorkspaceSelector ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProjectSelector2, {}) : null)));
152211
152111
  const headerRightContent = headerRight !== void 0 ? headerRight : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
@@ -152423,7 +152323,7 @@ var AgentConversations = ({
152423
152323
  {
152424
152324
  creation,
152425
152325
  items: items3,
152426
- activeKey: _optionalChain([thread, 'optionalAccess', _2755 => _2755.id]),
152326
+ activeKey: _optionalChain([thread, 'optionalAccess', _2749 => _2749.id]),
152427
152327
  style: style2,
152428
152328
  groupable: true,
152429
152329
  onActiveChange: (key) => {
@@ -152469,10 +152369,10 @@ var LatticeChatView = (props) => {
152469
152369
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
152470
152370
  LatticeChat,
152471
152371
  {
152472
- thread_id: _optionalChain([thread, 'optionalAccess', _2756 => _2756.id]),
152372
+ thread_id: _optionalChain([thread, 'optionalAccess', _2750 => _2750.id]),
152473
152373
  assistant_id: assistantId,
152474
- name: _optionalChain([currentAssistant, 'optionalAccess', _2757 => _2757.name]),
152475
- description: _optionalChain([currentAssistant, 'optionalAccess', _2758 => _2758.description]),
152374
+ name: _optionalChain([currentAssistant, 'optionalAccess', _2751 => _2751.name]),
152375
+ description: _optionalChain([currentAssistant, 'optionalAccess', _2752 => _2752.description]),
152476
152376
  menu: showSideMenu ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
152477
152377
  }
152478
152378
  )
@@ -152505,18 +152405,13 @@ init_i18n();
152505
152405
 
152506
152406
 
152507
152407
 
152508
-
152509
-
152510
-
152511
-
152512
152408
 
152513
152409
 
152514
152410
 
152515
152411
 
152516
152412
 
152517
152413
  var { Text: Text91, Title: Title20 } = _antd.Typography;
152518
- var { TextArea: TextArea11 } = _antd.Input;
152519
- var useStyles76 = _antdstyle.createStyles.call(void 0, ({ token, css }) => ({
152414
+ var useStyles75 = _antdstyle.createStyles.call(void 0, ({ token, css }) => ({
152520
152415
  // settingsModal: css`
152521
152416
  // .ant-modal {
152522
152417
  // max-width: 100vw !important;
@@ -152858,11 +152753,6 @@ var useStyles76 = _antdstyle.createStyles.call(void 0, ({ token, css }) => ({
152858
152753
  `
152859
152754
  }));
152860
152755
  var SETTINGS_MENU_ITEMS = [
152861
- {
152862
- key: "environment",
152863
- labelKey: "chatConfig.settings.menu.environment",
152864
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.EnvironmentOutlined, {})
152865
- },
152866
152756
  {
152867
152757
  key: "models",
152868
152758
  labelKey: "chatConfig.settings.menu.models",
@@ -152873,7 +152763,7 @@ var SettingsModal = ({
152873
152763
  open,
152874
152764
  onClose
152875
152765
  }) => {
152876
- const { styles } = useStyles76();
152766
+ const { styles } = useStyles75();
152877
152767
  const t4 = useT();
152878
152768
  const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
152879
152769
  const [connections, setConnections] = _react.useState.call(void 0, () => {
@@ -152907,7 +152797,7 @@ var SettingsModal = ({
152907
152797
  const [activeTabKey, setActiveTabKey] = _react.useState.call(void 0,
152908
152798
  connections.length > 0 ? connections[0].id : ""
152909
152799
  );
152910
- const [activeMenu, setActiveMenu] = _react.useState.call(void 0, "environment");
152800
+ const [activeMenu, setActiveMenu] = _react.useState.call(void 0, "models");
152911
152801
  const [loading, setLoading] = _react.useState.call(void 0, false);
152912
152802
  const [showAddServerModal, setShowAddServerModal] = _react.useState.call(void 0, false);
152913
152803
  const [newServerUrl, setNewServerUrl] = _react.useState.call(void 0, "");
@@ -152932,7 +152822,6 @@ var SettingsModal = ({
152932
152822
  setServerConfigs((prev) => ({
152933
152823
  ...prev,
152934
152824
  [serverId]: {
152935
- envText: "",
152936
152825
  models: [
152937
152826
  {
152938
152827
  key: "",
@@ -152963,7 +152852,7 @@ var SettingsModal = ({
152963
152852
  if (connection.apiKey) {
152964
152853
  headers["Authorization"] = `Bearer ${connection.apiKey}`;
152965
152854
  }
152966
- const response = await fetch(`${url}/api/config`, {
152855
+ const response = await fetch(`${url}/health`, {
152967
152856
  method: "GET",
152968
152857
  signal: controller.signal,
152969
152858
  headers
@@ -153008,53 +152897,6 @@ var SettingsModal = ({
153008
152897
  )
153009
152898
  );
153010
152899
  };
153011
- const loadCurrentConfig = async (serverId) => {
153012
- const connection = connectionsRef.current.find((c7) => c7.id === serverId);
153013
- if (!connection || !connection.connected) return;
153014
- const url = connection.url;
153015
- if (!url) return;
153016
- try {
153017
- const headers = {};
153018
- if (connection.apiKey) {
153019
- headers["Authorization"] = `Bearer ${connection.apiKey}`;
153020
- }
153021
- const response = await fetch(`${url}/api/config`, {
153022
- headers
153023
- });
153024
- if (response.ok) {
153025
- const data = await response.json();
153026
- if (data.success && data.data) {
153027
- const lines = [];
153028
- const configData = data.data;
153029
- if (configData.port !== void 0) {
153030
- lines.push(`PORT=${configData.port}`);
153031
- }
153032
- if (configData.queueServiceType) {
153033
- lines.push(`QUEUE_SERVICE_TYPE=${configData.queueServiceType}`);
153034
- }
153035
- if (configData.redisUrl) {
153036
- lines.push(`REDIS_URL=${configData.redisUrl}`);
153037
- }
153038
- if (configData.redisPassword) {
153039
- lines.push(`REDIS_PASSWORD=`);
153040
- }
153041
- if (configData.queueName) {
153042
- lines.push(`QUEUE_NAME=${configData.queueName}`);
153043
- }
153044
- setServerConfigs((prev) => ({
153045
- ...prev,
153046
- [serverId]: {
153047
- ...prev[serverId],
153048
- envText: lines.join("\n")
153049
- }
153050
- }));
153051
- }
153052
- }
153053
- } catch (error) {
153054
- console.error("Failed to load configuration:", error);
153055
- _antd.message.error(t4("chatConfig.settings.loadConfigFailed"));
153056
- }
153057
- };
153058
152900
  const loadModelsConfig = async (serverId) => {
153059
152901
  const connection = connectionsRef.current.find((c7) => c7.id === serverId);
153060
152902
  if (!connection || !connection.connected) return;
@@ -153125,12 +152967,8 @@ var SettingsModal = ({
153125
152967
  _react.useEffect.call(void 0, () => {
153126
152968
  if (open && activeTabKey) {
153127
152969
  const connection = connections.find((c7) => c7.id === activeTabKey);
153128
- if (_optionalChain([connection, 'optionalAccess', _2759 => _2759.connected])) {
153129
- if (activeMenu === "environment") {
153130
- loadCurrentConfig(activeTabKey);
153131
- } else if (activeMenu === "models") {
153132
- loadModelsConfig(activeTabKey);
153133
- }
152970
+ if (_optionalChain([connection, 'optionalAccess', _2753 => _2753.connected])) {
152971
+ loadModelsConfig(activeTabKey);
153134
152972
  }
153135
152973
  }
153136
152974
  }, [open, activeTabKey, activeMenu]);
@@ -153204,81 +153042,7 @@ var SettingsModal = ({
153204
153042
  try {
153205
153043
  setLoading(true);
153206
153044
  const config = serverConfigs[activeTabKey];
153207
- if (activeMenu === "environment") {
153208
- const configObj = {};
153209
- const lines = config.envText.split("\n");
153210
- for (const line2 of lines) {
153211
- const trimmedLine = line2.trim();
153212
- if (!trimmedLine || trimmedLine.startsWith("#")) {
153213
- continue;
153214
- }
153215
- const equalIndex = trimmedLine.indexOf("=");
153216
- if (equalIndex === -1) {
153217
- continue;
153218
- }
153219
- const key = trimmedLine.substring(0, equalIndex).trim();
153220
- const value = trimmedLine.substring(equalIndex + 1).trim();
153221
- if (!key) {
153222
- continue;
153223
- }
153224
- const upperKey = key.toUpperCase();
153225
- if (upperKey === "PORT") {
153226
- if (value) {
153227
- configObj.port = Number(value);
153228
- }
153229
- } else if (upperKey === "QUEUE_SERVICE_TYPE") {
153230
- if (value) {
153231
- configObj.queueServiceType = value;
153232
- }
153233
- } else if (upperKey === "REDIS_URL") {
153234
- if (value) {
153235
- configObj.redisUrl = value;
153236
- }
153237
- } else if (upperKey === "REDIS_PASSWORD") {
153238
- if (value) {
153239
- configObj.redisPassword = value;
153240
- }
153241
- } else if (upperKey === "QUEUE_NAME") {
153242
- if (value) {
153243
- configObj.queueName = value;
153244
- }
153245
- } else {
153246
- if (value) {
153247
- configObj[key] = value;
153248
- }
153249
- }
153250
- }
153251
- const headers = {
153252
- "Content-Type": "application/json"
153253
- };
153254
- if (connection.apiKey) {
153255
- headers["Authorization"] = `Bearer ${connection.apiKey}`;
153256
- }
153257
- const response = await fetch(`${url}/api/config`, {
153258
- method: "PUT",
153259
- headers,
153260
- body: JSON.stringify({ config: configObj })
153261
- });
153262
- const data = await response.json();
153263
- if (response.ok && data.success) {
153264
- if (data.requiresRestart && data.requiresRestart.length > 0) {
153265
- _antd.message.warning(
153266
- t4("chatConfig.settings.restartWarning", { services: data.requiresRestart.join(", ") }),
153267
- 5
153268
- );
153269
- } else {
153270
- _antd.message.success(t4("chatConfig.settings.savedApplied"));
153271
- }
153272
- if (data.warnings && data.warnings.length > 0) {
153273
- data.warnings.forEach((warning) => {
153274
- _antd.message.warning(warning, 5);
153275
- });
153276
- }
153277
- onClose();
153278
- } else {
153279
- _antd.message.error(data.error || t4("chatConfig.settings.saveFailed"));
153280
- }
153281
- } else if (activeMenu === "models") {
153045
+ if (activeMenu === "models") {
153282
153046
  const validModels = config.models.filter((m3) => m3.key && m3.model && m3.provider).map((m3) => {
153283
153047
  if (m3.apiKey) return m3;
153284
153048
  const { apiKey: _omitted, ...rest } = m3;
@@ -153310,71 +153074,8 @@ var SettingsModal = ({
153310
153074
  setLoading(false);
153311
153075
  }
153312
153076
  };
153313
- const renderEnvironmentSettings = (serverId) => {
153314
- const config = serverConfigs[serverId] || { envText: "", models: [] };
153315
- const setEnvText = (text) => {
153316
- setServerConfigs((prev) => ({
153317
- ...prev,
153318
- [serverId]: {
153319
- ...prev[serverId],
153320
- envText: text
153321
- }
153322
- }));
153323
- };
153324
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: styles.formContainer, children: [
153325
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
153326
- _antd.Alert,
153327
- {
153328
- message: t4("chatConfig.settings.alert.title"),
153329
- description: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
153330
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { marginBottom: 8 }, children: [
153331
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
153332
- _icons.CheckCircleOutlined,
153333
- {
153334
- style: { color: "#52c41a", marginRight: 8 }
153335
- }
153336
- ),
153337
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: t4("chatConfig.settings.alert.immediate") }),
153338
- " QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
153339
- ] }),
153340
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
153341
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.ReloadOutlined, { style: { color: "#faad14", marginRight: 8 } }),
153342
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: t4("chatConfig.settings.alert.restart") }),
153343
- " ",
153344
- t4("chatConfig.settings.alert.restartDetail")
153345
- ] })
153346
- ] }),
153347
- type: "info",
153348
- showIcon: true,
153349
- className: styles.alertCard
153350
- }
153351
- ),
153352
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text91, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: t4("chatConfig.settings.envHint") }) }),
153353
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
153354
- TextArea11,
153355
- {
153356
- value: config.envText,
153357
- onChange: (e8) => setEnvText(e8.target.value),
153358
- placeholder: `PORT=4001
153359
- QUEUE_SERVICE_TYPE=redis
153360
- REDIS_URL=redis://localhost:6379
153361
- REDIS_PASSWORD=
153362
- QUEUE_NAME=tasks`,
153363
- rows: 18,
153364
- className: styles.textArea,
153365
- style: {
153366
- fontFamily: "SF Mono, Monaco, Inconsolata, Roboto Mono, monospace",
153367
- fontSize: 13,
153368
- padding: "16px",
153369
- lineHeight: 1.6
153370
- }
153371
- }
153372
- )
153373
- ] });
153374
- };
153375
153077
  const renderModelSettings = (serverId) => {
153376
153078
  const config = serverConfigs[serverId] || {
153377
- envText: "",
153378
153079
  models: [
153379
153080
  {
153380
153081
  key: "",
@@ -153608,8 +153309,6 @@ QUEUE_NAME=tasks`,
153608
153309
  };
153609
153310
  const renderContent = (serverId) => {
153610
153311
  switch (activeMenu) {
153611
- case "environment":
153612
- return renderEnvironmentSettings(serverId);
153613
153312
  case "models":
153614
153313
  return renderModelSettings(serverId);
153615
153314
  default:
@@ -153666,10 +153365,7 @@ QUEUE_NAME=tasks`,
153666
153365
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: styles.contentHeader, children: [
153667
153366
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: styles.contentHeaderLeft, children: [
153668
153367
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Title20, { level: 3, className: styles.contentTitle, children: activeMenuItem ? t4(activeMenuItem.labelKey) : void 0 }),
153669
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Text91, { className: styles.contentDescription, children: [
153670
- activeMenu === "environment" && t4("chatConfig.settings.menu.environment.desc"),
153671
- activeMenu === "models" && t4("chatConfig.settings.menu.models.desc")
153672
- ] })
153368
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text91, { className: styles.contentDescription, children: activeMenu === "models" && t4("chatConfig.settings.menu.models.desc") })
153673
153369
  ] }),
153674
153370
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: styles.contentHeaderRight, children: [
153675
153371
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { onClick: onClose, children: t4("common.cancel") }),
@@ -153880,13 +153576,13 @@ var LatticeChatShell = (props) => {
153880
153576
  const { enableAssistantCreation, enableAssistantEditing, enableWorkspace: enableWorkspaceProp, ...restProps } = props;
153881
153577
  console.log(
153882
153578
  "[LatticeChatShell] props.initialConfig?.assistantId:",
153883
- _optionalChain([props, 'access', _2760 => _2760.initialConfig, 'optionalAccess', _2761 => _2761.assistantId]),
153579
+ _optionalChain([props, 'access', _2754 => _2754.initialConfig, 'optionalAccess', _2755 => _2755.assistantId]),
153884
153580
  "restProps.initialConfig?.assistantId:",
153885
- _optionalChain([restProps, 'access', _2762 => _2762.initialConfig, 'optionalAccess', _2763 => _2763.assistantId]),
153581
+ _optionalChain([restProps, 'access', _2756 => _2756.initialConfig, 'optionalAccess', _2757 => _2757.assistantId]),
153886
153582
  "restProps keys:",
153887
153583
  Object.keys(restProps)
153888
153584
  );
153889
- const enableWorkspace = _nullishCoalesce(_nullishCoalesce(enableWorkspaceProp, () => ( _optionalChain([restProps, 'access', _2764 => _2764.initialConfig, 'optionalAccess', _2765 => _2765.enableWorkspace]))), () => ( false));
153585
+ const enableWorkspace = _nullishCoalesce(_nullishCoalesce(enableWorkspaceProp, () => ( _optionalChain([restProps, 'access', _2758 => _2758.initialConfig, 'optionalAccess', _2759 => _2759.enableWorkspace]))), () => ( false));
153890
153586
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
153891
153587
  LatticeChatShellContextProvider,
153892
153588
  {
@@ -153899,7 +153595,7 @@ var LatticeChatShell = (props) => {
153899
153595
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatErrorBoundary, { name: t4("chat.error.boundary.chatShell"), t: t4, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
153900
153596
  ShellContent,
153901
153597
  {
153902
- initialAssistantId: _optionalChain([restProps, 'access', _2766 => _2766.initialConfig, 'optionalAccess', _2767 => _2767.assistantId]),
153598
+ initialAssistantId: _optionalChain([restProps, 'access', _2760 => _2760.initialConfig, 'optionalAccess', _2761 => _2761.assistantId]),
153903
153599
  enableWorkspace
153904
153600
  }
153905
153601
  ) })
@@ -153943,7 +153639,7 @@ var ChannelInstallationsDrawerContent = () => {
153943
153639
  "/api/channel-installations"
153944
153640
  );
153945
153641
  if (result.success) {
153946
- setInstallations(_nullishCoalesce(_optionalChain([result, 'access', _2768 => _2768.data, 'optionalAccess', _2769 => _2769.records]), () => ( [])));
153642
+ setInstallations(_nullishCoalesce(_optionalChain([result, 'access', _2762 => _2762.data, 'optionalAccess', _2763 => _2763.records]), () => ( [])));
153947
153643
  } else {
153948
153644
  setInstallations([]);
153949
153645
  _antd.message.error(result.message || t4("chatConfig.channelInstall.loadFailed"));
@@ -154277,9 +153973,9 @@ var AssistantNode = ({
154277
153973
  return null;
154278
153974
  }
154279
153975
  const badgeColor = getBadgeColor(assistant.id);
154280
- const localStatus = _optionalChain([localA2A, 'optionalAccess', _2770 => _2770.status]);
153976
+ const localStatus = _optionalChain([localA2A, 'optionalAccess', _2764 => _2764.status]);
154281
153977
  const statusDotColor = localStatus ? LOCAL_STATUS_DOTS[localStatus] : "#52c41a";
154282
- const initials = _optionalChain([assistant, 'access', _2771 => _2771.name, 'optionalAccess', _2772 => _2772.split, 'call', _2773 => _2773(" "), 'access', _2774 => _2774.map, 'call', _2775 => _2775((n4) => n4.charAt(0)), 'access', _2776 => _2776.join, 'call', _2777 => _2777(""), 'access', _2778 => _2778.toUpperCase, 'call', _2779 => _2779(), 'access', _2780 => _2780.slice, 'call', _2781 => _2781(0, 2)]) || "A";
153978
+ const initials = _optionalChain([assistant, 'access', _2765 => _2765.name, 'optionalAccess', _2766 => _2766.split, 'call', _2767 => _2767(" "), 'access', _2768 => _2768.map, 'call', _2769 => _2769((n4) => n4.charAt(0)), 'access', _2770 => _2770.join, 'call', _2771 => _2771(""), 'access', _2772 => _2772.toUpperCase, 'call', _2773 => _2773(), 'access', _2774 => _2774.slice, 'call', _2775 => _2775(0, 2)]) || "A";
154283
153979
  const { modelKey, tools, agentType, prompt, subAgents } = _react.useMemo.call(void 0, () => {
154284
153980
  if (!assistant.graphDefinition) {
154285
153981
  return {
@@ -155052,7 +154748,7 @@ init_AssistantContext();
155052
154748
 
155053
154749
 
155054
154750
 
155055
- var useStyles77 = _antdstyle.createStyles.call(void 0, ({ token, css }) => ({
154751
+ var useStyles76 = _antdstyle.createStyles.call(void 0, ({ token, css }) => ({
155056
154752
  root: css`
155057
154753
  width: 100%;
155058
154754
  height: 100%;
@@ -155085,7 +154781,7 @@ var useStyles77 = _antdstyle.createStyles.call(void 0, ({ token, css }) => ({
155085
154781
  }));
155086
154782
  var AssistantFlowInner = ({ onChat }) => {
155087
154783
  const t4 = useT();
155088
- const { styles } = useStyles77();
154784
+ const { styles } = useStyles76();
155089
154785
  const { setCenter } = useReactFlow();
155090
154786
  const [nodes, setNodes, onNodesChange] = useNodesState([]);
155091
154787
  const [edges, setEdges, onEdgesChange] = useEdgesState([]);
@@ -155130,7 +154826,7 @@ var AssistantFlowInner = ({ onChat }) => {
155130
154826
  ({ nodes: selectedNodes }) => {
155131
154827
  if (selectedNodes.length === 1) {
155132
154828
  const nodeData = selectedNodes[0].data;
155133
- if (_optionalChain([nodeData, 'optionalAccess', _2782 => _2782.assistant]) && enableAssistantEditing) {
154829
+ if (_optionalChain([nodeData, 'optionalAccess', _2776 => _2776.assistant]) && enableAssistantEditing) {
155134
154830
  setSelectedAssistant(nodeData.assistant);
155135
154831
  setConfigPanelVisible(true);
155136
154832
  return;
@@ -155365,7 +155061,7 @@ var AssistantFlowInner = ({ onChat }) => {
155365
155061
  data: {
155366
155062
  assistant,
155367
155063
  localA2A,
155368
- isLocalA2ABusy: activeRuntimeId === _optionalChain([localA2A, 'optionalAccess', _2783 => _2783.runtimeId]),
155064
+ isLocalA2ABusy: activeRuntimeId === _optionalChain([localA2A, 'optionalAccess', _2777 => _2777.runtimeId]),
155369
155065
  onConfigure: localA2A ? void 0 : enableAssistantEditing ? () => handleConfigure(assistant) : void 0,
155370
155066
  onChat,
155371
155067
  onLocalA2AAction: localA2A ? runLocalA2AAction : void 0
@@ -155399,7 +155095,7 @@ var AssistantFlowInner = ({ onChat }) => {
155399
155095
  data: {
155400
155096
  assistant,
155401
155097
  localA2A,
155402
- isLocalA2ABusy: activeRuntimeId === _optionalChain([localA2A, 'optionalAccess', _2784 => _2784.runtimeId]),
155098
+ isLocalA2ABusy: activeRuntimeId === _optionalChain([localA2A, 'optionalAccess', _2778 => _2778.runtimeId]),
155403
155099
  onConfigure: localA2A ? void 0 : enableAssistantEditing ? () => handleConfigure(assistant) : void 0,
155404
155100
  onChat,
155405
155101
  onLocalA2AAction: localA2A ? runLocalA2AAction : void 0
@@ -155463,7 +155159,7 @@ var AssistantFlowInner = ({ onChat }) => {
155463
155159
  const data = await del(`/api/assistants/${assistant.id}`);
155464
155160
  if (data.success) {
155465
155161
  setAssistants((prev) => prev.filter((a4) => a4.id !== assistant.id));
155466
- if (_optionalChain([selectedAssistant, 'optionalAccess', _2785 => _2785.id]) === assistant.id) {
155162
+ if (_optionalChain([selectedAssistant, 'optionalAccess', _2779 => _2779.id]) === assistant.id) {
155467
155163
  setSelectedAssistant(null);
155468
155164
  setConfigPanelVisible(false);
155469
155165
  }
@@ -155511,7 +155207,7 @@ var AssistantFlowInner = ({ onChat }) => {
155511
155207
  }, [assistants, selectedAssistant, configPanelVisible]);
155512
155208
  const lastCreatedAssistantRef = _react.useRef.call(void 0, null);
155513
155209
  _react.useEffect.call(void 0, () => {
155514
- if (lastCreatedAssistantRef.current && !assistants.find((a4) => a4.id === _optionalChain([lastCreatedAssistantRef, 'access', _2786 => _2786.current, 'optionalAccess', _2787 => _2787.id]))) {
155210
+ if (lastCreatedAssistantRef.current && !assistants.find((a4) => a4.id === _optionalChain([lastCreatedAssistantRef, 'access', _2780 => _2780.current, 'optionalAccess', _2781 => _2781.id]))) {
155515
155211
  lastCreatedAssistantRef.current = null;
155516
155212
  }
155517
155213
  if (lastCreatedAssistantRef.current) {
@@ -155625,7 +155321,84 @@ init_AgentDetailView();
155625
155321
  init_AgentEvalPanel();
155626
155322
  init_trainingUtils();
155627
155323
  init_AgentOverview();
155628
- init_AgentCardStats();
155324
+
155325
+ // src/components/Governance/AgentCardStats.tsx
155326
+ init_MiniChart();
155327
+ init_i18n();
155328
+
155329
+
155330
+
155331
+ var fmtActive = (iso, t4) => {
155332
+ if (!iso) return "\u2014";
155333
+ const diff2 = Date.now() - new Date(iso).getTime();
155334
+ const minutes = Math.floor(diff2 / 6e4);
155335
+ if (minutes < 1) return t4 ? t4("common.time.justNow") : "just now";
155336
+ if (minutes < 60) return t4 ? t4("common.time.minutesAgo", { count: minutes }) : `${minutes}m ago`;
155337
+ const hours = Math.floor(minutes / 60);
155338
+ if (hours < 24) return t4 ? t4("common.time.hoursAgo", { count: hours }) : `${hours}h ago`;
155339
+ const days = Math.floor(hours / 24);
155340
+ return t4 ? t4("common.time.daysAgo", { count: days }) : `${days}d ago`;
155341
+ };
155342
+ var scoreColor2 = (score2) => {
155343
+ if (score2 === null) return "#d9d9d9";
155344
+ return score2 >= 80 ? "#22c55e" : score2 >= 50 ? "#f59e0b" : "#ef4444";
155345
+ };
155346
+ var useStyles77 = _antdstyle.createStyles.call(void 0, ({ css }) => ({
155347
+ row: css`
155348
+ display: flex;
155349
+ justify-content: space-between;
155350
+ align-items: flex-end;
155351
+ `
155352
+ }));
155353
+ var valueStyle = {
155354
+ fontSize: 16,
155355
+ fontWeight: 700,
155356
+ lineHeight: 1.2,
155357
+ cursor: "help"
155358
+ };
155359
+ var labelStyle2 = {
155360
+ fontSize: 10,
155361
+ color: "rgba(0, 0, 0, 0.45)",
155362
+ whiteSpace: "nowrap",
155363
+ marginTop: 1
155364
+ };
155365
+ var metricColumn = {
155366
+ display: "flex",
155367
+ flexDirection: "column",
155368
+ alignItems: "center"
155369
+ };
155370
+ var AgentCardStats = ({ stats }) => {
155371
+ const { styles } = useStyles77();
155372
+ const t4 = useT();
155373
+ if (!stats) {
155374
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", fontSize: 11, color: "#d9d9d9" }, children: [
155375
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { flex: 1 }, children: t4("governance.cardStats.scoreEmpty") }),
155376
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { flex: 1 }, children: t4("governance.cardStats.threadsEmpty") })
155377
+ ] });
155378
+ }
155379
+ const score2 = stats.evalScore !== null ? Number(stats.evalScore).toFixed(1) : "\u2014";
155380
+ const threads = stats.threadCount > 0 ? stats.threadCount : "\u2014";
155381
+ const scoreTextColor = scoreColor2(stats.evalScore);
155382
+ const passRate = stats.evalPassRate !== null ? `${stats.evalPassRate}%` : "\u2014";
155383
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: styles.row, children: [
155384
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", gap: 16, alignItems: "flex-end" }, children: [
155385
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: t4("governance.cardStats.evalTooltip", { score: score2, passRate, runs: stats.evalRuns }), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: metricColumn, children: [
155386
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { ...valueStyle, color: scoreTextColor }, children: score2 }),
155387
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "lattice-stat-label", style: labelStyle2, children: t4("governance.cardStats.evalScore") })
155388
+ ] }) }),
155389
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Tooltip, { title: stats.lastActive ? t4("governance.cardStats.conversationsTooltipActive", { total: stats.threadCount, last7d: stats.last7d, last30d: stats.last30d, lastActive: fmtActive(stats.lastActive, t4) }) : t4("governance.cardStats.conversationsTooltip", { total: stats.threadCount, last7d: stats.last7d, last30d: stats.last30d }), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: metricColumn, children: [
155390
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { ...valueStyle, color: threads === "\u2014" ? "#d9d9d9" : "#595959" }, children: threads }),
155391
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "lattice-stat-label", style: labelStyle2, children: t4("governance.cardStats.threads") })
155392
+ ] }) })
155393
+ ] }),
155394
+ stats.daily7d.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: metricColumn, children: [
155395
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MiniBarChart, { values: stats.daily7d, width: 40, height: 24, color: "#8c8c8c" }),
155396
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "lattice-stat-label", style: labelStyle2, children: t4("governance.cardStats.threads7d") })
155397
+ ] })
155398
+ ] });
155399
+ };
155400
+
155401
+ // src/index.ts
155629
155402
  init_AgentConfigGraph();
155630
155403
  init_AgentGraphView();
155631
155404
  init_configGraph();