@synergenius/flow-weaver-pack-weaver 0.9.81 → 0.9.83

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.
@@ -530,75 +530,11 @@ function TaskPoolList({ tasks, onTaskClick }) {
530
530
  var task_pool_list_default = TaskPoolList;
531
531
  module.exports = TaskPoolList;
532
532
 
533
- // src/ui/task-create-form.tsx
534
- var import_react2 = __toESM(require("react"), 1);
535
- var import_plugin_ui_kit2 = require("@fw/plugin-ui-kit");
536
- var { useState: useState3, useCallback: useCallback2 } = import_react2.default;
537
- function parseToolResult(raw) {
538
- if (typeof raw === "string") {
539
- try {
540
- return JSON.parse(raw);
541
- } catch {
542
- return raw;
543
- }
544
- }
545
- return raw;
546
- }
547
- function TaskCreateForm({ onTaskCreated }) {
548
- const ctx = (0, import_plugin_ui_kit2.usePackWorkspace)();
549
- const { callTool } = ctx;
550
- const [title, setTitle] = useState3("");
551
- const [creating, setCreating] = useState3(false);
552
- const handleCreate = useCallback2(async () => {
553
- const trimmed = title.trim();
554
- if (!trimmed) return;
555
- setCreating(true);
556
- try {
557
- const raw = await callTool("fw_weaver_task_create", { title: trimmed });
558
- const result = parseToolResult(raw);
559
- (0, import_plugin_ui_kit2.toast)(`Task created: ${result?.task?.title ?? trimmed}`, { type: "success" });
560
- setTitle("");
561
- onTaskCreated?.();
562
- } catch (err) {
563
- (0, import_plugin_ui_kit2.toast)(err instanceof Error ? err.message : "Failed to create task", { type: "error" });
564
- } finally {
565
- setCreating(false);
566
- }
567
- }, [title, callTool, onTaskCreated]);
568
- return import_react2.default.createElement(
569
- import_plugin_ui_kit2.Flex,
570
- {
571
- variant: "row-center-start-nowrap-6"
572
- },
573
- import_react2.default.createElement(import_plugin_ui_kit2.Input, {
574
- type: "text",
575
- size: "small",
576
- placeholder: "What needs to be done?",
577
- value: title,
578
- onChange: (v) => setTitle(v),
579
- onEnter: handleCreate,
580
- disabled: creating,
581
- defaultBoxStyle: { flex: 1, minWidth: 0 },
582
- inputBoxStyle: { maxWidth: "none" }
583
- }),
584
- import_react2.default.createElement(import_plugin_ui_kit2.IconButton, {
585
- icon: "add",
586
- size: "sm",
587
- variant: "fill",
588
- color: "primary",
589
- onClick: handleCreate,
590
- disabled: creating || !title.trim(),
591
- loading: creating
592
- })
593
- );
594
- }
595
- var task_create_form_default = TaskCreateForm;
596
-
597
533
  // src/ui/use-stream-timeline.ts
598
- var React6 = require("react");
599
- var { useMemo, useState: useState4, useEffect, useRef } = React6;
534
+ var React5 = require("react");
535
+ var { useMemo, useState: useState3, useEffect, useRef } = React5;
600
536
  function useStreamTimeline(events, isDone) {
601
- const [elapsed, setElapsed] = useState4(0);
537
+ const [elapsed, setElapsed] = useState3(0);
602
538
  const startTimeRef = useRef(null);
603
539
  useEffect(() => {
604
540
  if (events.length === 0) {
@@ -855,17 +791,17 @@ function traceToTimeline(run) {
855
791
  }
856
792
 
857
793
  // src/ui/task-detail-view.tsx
858
- var React7 = require("react");
859
- var { useState: useState5, useEffect: useEffect2, useCallback: useCallback3, useRef: useRef2, useMemo: useMemo2 } = React7;
794
+ var React6 = require("react");
795
+ var { useState: useState4, useEffect: useEffect2, useCallback: useCallback2, useRef: useRef2, useMemo: useMemo2 } = React6;
860
796
  var {
861
- Flex: Flex6,
797
+ Flex: Flex5,
862
798
  Typography: Typography5,
863
799
  ScrollArea: ScrollArea2,
864
800
  StatusIcon: StatusIcon3,
865
801
  Tag: Tag2,
866
802
  Badge: Badge2,
867
803
  Icon: Icon3,
868
- IconButton: IconButton4,
804
+ IconButton: IconButton3,
869
805
  TaskBlock,
870
806
  Button: Button2,
871
807
  Card,
@@ -874,8 +810,8 @@ var {
874
810
  Table,
875
811
  Tabs,
876
812
  EmptyState: EmptyState2,
877
- toast: toast3,
878
- usePackWorkspace: usePackWorkspace3,
813
+ toast: toast2,
814
+ usePackWorkspace: usePackWorkspace2,
879
815
  useEventStream
880
816
  } = require("@fw/plugin-ui-kit");
881
817
  var statusToIcon2 = {
@@ -920,9 +856,9 @@ var subtaskRowHoverStyle = {
920
856
  backgroundColor: "var(--color-surface-elevated)"
921
857
  };
922
858
  function SubtaskRowItem({ sub, onBack }) {
923
- const [hovered, setHovered] = useState5(false);
924
- return React7.createElement(
925
- Flex6,
859
+ const [hovered, setHovered] = useState4(false);
860
+ return React6.createElement(
861
+ Flex5,
926
862
  {
927
863
  variant: "row-center-start-nowrap-8",
928
864
  style: hovered ? subtaskRowHoverStyle : subtaskRowStyle,
@@ -930,37 +866,37 @@ function SubtaskRowItem({ sub, onBack }) {
930
866
  onMouseEnter: () => setHovered(true),
931
867
  onMouseLeave: () => setHovered(false)
932
868
  },
933
- React7.createElement(StatusIcon3, {
869
+ React6.createElement(StatusIcon3, {
934
870
  status: statusToIcon2[sub.status] || "pending",
935
871
  size: "sm"
936
872
  }),
937
- React7.createElement(
938
- Flex6,
873
+ React6.createElement(
874
+ Flex5,
939
875
  {
940
876
  variant: "row-center-start-nowrap-0",
941
877
  style: { flex: 1, minWidth: 0 }
942
878
  },
943
- React7.createElement(Typography5, { variant: "caption-regular", truncate: true }, sub.title)
879
+ React6.createElement(Typography5, { variant: "caption-regular", truncate: true }, sub.title)
944
880
  ),
945
- sub.assignedProfile && React7.createElement(Tag2, {
881
+ sub.assignedProfile && React6.createElement(Tag2, {
946
882
  size: "small",
947
883
  color: "info"
948
884
  }, sub.assignedProfile),
949
- React7.createElement(Typography5, {
885
+ React6.createElement(Typography5, {
950
886
  variant: "caption-regular",
951
887
  color: "color-text-subtle"
952
888
  }, `#${sub.attempt}`)
953
889
  );
954
890
  }
955
- function TaskDetailView({ taskId, onBack }) {
956
- const ctx = usePackWorkspace3();
891
+ function TaskDetailView({ taskId, onBack, onEdit }) {
892
+ const ctx = usePackWorkspace2();
957
893
  const { callTool } = ctx;
958
894
  const packId = ctx.packId;
959
- const [task, setTask] = useState5(null);
960
- const [subtasks, setSubtasks] = useState5([]);
961
- const [history, setHistory] = useState5([]);
962
- const [loading, setLoading] = useState5(true);
963
- const fetchTask = useCallback3(async () => {
895
+ const [task, setTask] = useState4(null);
896
+ const [subtasks, setSubtasks] = useState4([]);
897
+ const [history, setHistory] = useState4([]);
898
+ const [loading, setLoading] = useState4(true);
899
+ const fetchTask = useCallback2(async () => {
964
900
  try {
965
901
  const raw = await callTool("fw_weaver_task_get", { id: taskId });
966
902
  const data = typeof raw === "string" ? JSON.parse(raw) : raw;
@@ -979,7 +915,7 @@ function TaskDetailView({ taskId, onBack }) {
979
915
  } catch (err) {
980
916
  }
981
917
  }, [callTool, taskId]);
982
- const fetchHistory = useCallback3(async () => {
918
+ const fetchHistory = useCallback2(async () => {
983
919
  try {
984
920
  const raw = await callTool("fw_weaver_history", { taskId });
985
921
  const data = typeof raw === "string" ? JSON.parse(raw) : raw;
@@ -1023,9 +959,9 @@ function TaskDetailView({ taskId, onBack }) {
1023
959
  stream.start(packId, "fw_weaver_events", currentRunId);
1024
960
  return () => stream.stop();
1025
961
  }, [isLive, currentRunId, packId]);
1026
- const [detailTab, setDetailTab] = useState5("runs");
1027
- const [actionLoading, setActionLoading] = useState5(null);
1028
- const [availableProfiles, setAvailableProfiles] = useState5([]);
962
+ const [detailTab, setDetailTab] = useState4("runs");
963
+ const [actionLoading, setActionLoading] = useState4(null);
964
+ const [availableProfiles, setAvailableProfiles] = useState4([]);
1029
965
  useEffect2(() => {
1030
966
  callTool("fw_weaver_profile_list", {}).then((raw) => {
1031
967
  const data = typeof raw === "string" ? JSON.parse(raw) : raw;
@@ -1033,47 +969,47 @@ function TaskDetailView({ taskId, onBack }) {
1033
969
  }).catch(() => {
1034
970
  });
1035
971
  }, [callTool]);
1036
- const handleRetry = useCallback3(async () => {
972
+ const handleRetry = useCallback2(async () => {
1037
973
  setActionLoading("retry");
1038
974
  try {
1039
975
  await callTool("fw_weaver_task_retry", { id: taskId });
1040
- toast3("Task retried, back in pool", { type: "success" });
976
+ toast2("Task retried, back in pool", { type: "success" });
1041
977
  fetchTask();
1042
978
  } catch (err) {
1043
- toast3(err instanceof Error ? err.message : "Failed to retry", { type: "error" });
979
+ toast2(err instanceof Error ? err.message : "Failed to retry", { type: "error" });
1044
980
  }
1045
981
  setActionLoading(null);
1046
982
  }, [callTool, taskId, fetchTask]);
1047
- const handleCancel = useCallback3(async () => {
983
+ const handleCancel = useCallback2(async () => {
1048
984
  const ok = await ctx.confirm("Cancel this task? It cannot be undone.", {
1049
985
  title: "Cancel Task",
1050
986
  confirmLabel: "Cancel Task",
1051
- state: "warning"
987
+ state: "danger"
1052
988
  });
1053
989
  if (!ok) return;
1054
990
  setActionLoading("cancel");
1055
991
  try {
1056
992
  await callTool("fw_weaver_task_cancel", { id: taskId });
1057
- toast3("Task cancelled", { type: "info" });
993
+ toast2("Task cancelled", { type: "info" });
1058
994
  fetchTask();
1059
995
  } catch (err) {
1060
- toast3(err instanceof Error ? err.message : "Failed to cancel", { type: "error" });
996
+ toast2(err instanceof Error ? err.message : "Failed to cancel", { type: "error" });
1061
997
  }
1062
998
  setActionLoading(null);
1063
999
  }, [callTool, taskId, fetchTask, ctx]);
1064
- const handleAssignProfile = useCallback3(async (profileId) => {
1000
+ const handleAssignProfile = useCallback2(async (profileId) => {
1065
1001
  setActionLoading("assign-profile");
1066
1002
  try {
1067
1003
  const newProfile = task?.assignedProfile === profileId ? void 0 : profileId;
1068
1004
  await callTool("fw_weaver_task_update", { id: taskId, assignedProfile: newProfile ?? null });
1069
- toast3(newProfile ? `Assigned profile ${profileId}` : `Unassigned profile`, { type: "success" });
1005
+ toast2(newProfile ? `Assigned profile ${profileId}` : `Unassigned profile`, { type: "success" });
1070
1006
  fetchTask();
1071
1007
  } catch (err) {
1072
- toast3(err instanceof Error ? err.message : "Failed to assign profile", { type: "error" });
1008
+ toast2(err instanceof Error ? err.message : "Failed to assign profile", { type: "error" });
1073
1009
  }
1074
1010
  setActionLoading(null);
1075
1011
  }, [callTool, taskId, task, fetchTask]);
1076
- const handlePriorityChange = useCallback3(async (delta) => {
1012
+ const handlePriorityChange = useCallback2(async (delta) => {
1077
1013
  const newPriority = Math.max(0, (task?.priority ?? 0) + delta);
1078
1014
  try {
1079
1015
  await callTool("fw_weaver_task_update", { id: taskId, priority: newPriority });
@@ -1081,9 +1017,9 @@ function TaskDetailView({ taskId, onBack }) {
1081
1017
  } catch {
1082
1018
  }
1083
1019
  }, [callTool, taskId, task, fetchTask]);
1084
- const [expandedRunId, setExpandedRunId] = useState5(null);
1085
- const [liveExpanded, setLiveExpanded] = useState5(true);
1086
- const toggleExpand = useCallback3((id) => {
1020
+ const [expandedRunId, setExpandedRunId] = useState4(null);
1021
+ const [liveExpanded, setLiveExpanded] = useState4(true);
1022
+ const toggleExpand = useCallback2((id) => {
1087
1023
  setExpandedRunId((prev) => prev === id ? null : id);
1088
1024
  }, []);
1089
1025
  const scrollRef = useRef2(null);
@@ -1091,33 +1027,33 @@ function TaskDetailView({ taskId, onBack }) {
1091
1027
  const el = scrollRef.current;
1092
1028
  if (el) el.scrollTop = el.scrollHeight;
1093
1029
  }, [liveTimeline.length, stream.events.length]);
1094
- const [approvalStatus, setApprovalStatus] = useState5(null);
1095
- const [approvalLoading, setApprovalLoading] = useState5(false);
1030
+ const [approvalStatus, setApprovalStatus] = useState4(null);
1031
+ const [approvalLoading, setApprovalLoading] = useState4(false);
1096
1032
  useEffect2(() => {
1097
1033
  if (awaitingApproval) setApprovalStatus("pending");
1098
1034
  }, [awaitingApproval]);
1099
1035
  useEffect2(() => {
1100
1036
  if (stream.events.length === 0) setApprovalStatus(null);
1101
1037
  }, [stream.events.length]);
1102
- const handleApprove = useCallback3(async () => {
1038
+ const handleApprove = useCallback2(async () => {
1103
1039
  setApprovalLoading(true);
1104
1040
  try {
1105
1041
  await callTool("fw_weaver_approve", { approved: true });
1106
1042
  setApprovalStatus("approved");
1107
- toast3("Plan approved", { type: "success" });
1043
+ toast2("Plan approved", { type: "success" });
1108
1044
  } catch (err) {
1109
- toast3(err instanceof Error ? err.message : "Failed to approve", { type: "error" });
1045
+ toast2(err instanceof Error ? err.message : "Failed to approve", { type: "error" });
1110
1046
  }
1111
1047
  setApprovalLoading(false);
1112
1048
  }, [callTool]);
1113
- const handleReject = useCallback3(async () => {
1049
+ const handleReject = useCallback2(async () => {
1114
1050
  setApprovalLoading(true);
1115
1051
  try {
1116
1052
  await callTool("fw_weaver_approve", { approved: false });
1117
1053
  setApprovalStatus("rejected");
1118
- toast3("Plan rejected", { type: "info" });
1054
+ toast2("Plan rejected", { type: "info" });
1119
1055
  } catch (err) {
1120
- toast3(err instanceof Error ? err.message : "Failed to reject", { type: "error" });
1056
+ toast2(err instanceof Error ? err.message : "Failed to reject", { type: "error" });
1121
1057
  }
1122
1058
  setApprovalLoading(false);
1123
1059
  }, [callTool]);
@@ -1146,32 +1082,32 @@ function TaskDetailView({ taskId, onBack }) {
1146
1082
  return "Bot run";
1147
1083
  }
1148
1084
  if (loading && !task) {
1149
- return React7.createElement(
1150
- Flex6,
1085
+ return React6.createElement(
1086
+ Flex5,
1151
1087
  {
1152
1088
  variant: "column-stretch-start-nowrap-0",
1153
1089
  style: { width: "100%", height: "100%", overflow: "hidden" }
1154
1090
  },
1155
- React7.createElement(
1156
- Flex6,
1091
+ React6.createElement(
1092
+ Flex5,
1157
1093
  {
1158
1094
  variant: "column-stretch-start-nowrap-8",
1159
1095
  style: headerStyle
1160
1096
  },
1161
- React7.createElement(
1097
+ React6.createElement(
1162
1098
  Button2,
1163
1099
  { variant: "ghost", size: "sm", onClick: onBack },
1164
- React7.createElement(Icon3, { name: "arrowBack", size: 16 }),
1100
+ React6.createElement(Icon3, { name: "arrowBack", size: 16 }),
1165
1101
  " Back"
1166
1102
  )
1167
1103
  ),
1168
- React7.createElement(
1169
- Flex6,
1104
+ React6.createElement(
1105
+ Flex5,
1170
1106
  {
1171
1107
  variant: "column-center-center-nowrap-0",
1172
1108
  style: { flex: 1 }
1173
1109
  },
1174
- React7.createElement(
1110
+ React6.createElement(
1175
1111
  Typography5,
1176
1112
  { variant: "caption-regular", color: "color-text-subtle" },
1177
1113
  "Loading task..."
@@ -1180,32 +1116,32 @@ function TaskDetailView({ taskId, onBack }) {
1180
1116
  );
1181
1117
  }
1182
1118
  if (!task) {
1183
- return React7.createElement(
1184
- Flex6,
1119
+ return React6.createElement(
1120
+ Flex5,
1185
1121
  {
1186
1122
  variant: "column-stretch-start-nowrap-0",
1187
1123
  style: { width: "100%", height: "100%", overflow: "hidden" }
1188
1124
  },
1189
- React7.createElement(
1190
- Flex6,
1125
+ React6.createElement(
1126
+ Flex5,
1191
1127
  {
1192
1128
  variant: "column-stretch-start-nowrap-8",
1193
1129
  style: headerStyle
1194
1130
  },
1195
- React7.createElement(
1131
+ React6.createElement(
1196
1132
  Button2,
1197
1133
  { variant: "ghost", size: "sm", onClick: onBack },
1198
- React7.createElement(Icon3, { name: "arrowBack", size: 16 }),
1134
+ React6.createElement(Icon3, { name: "arrowBack", size: 16 }),
1199
1135
  " Back"
1200
1136
  )
1201
1137
  ),
1202
- React7.createElement(
1203
- Flex6,
1138
+ React6.createElement(
1139
+ Flex5,
1204
1140
  {
1205
1141
  variant: "column-center-center-nowrap-0",
1206
1142
  style: { flex: 1 }
1207
1143
  },
1208
- React7.createElement(
1144
+ React6.createElement(
1209
1145
  Typography5,
1210
1146
  { variant: "caption-regular", color: "color-text-subtle" },
1211
1147
  "Task not found."
@@ -1216,71 +1152,82 @@ function TaskDetailView({ taskId, onBack }) {
1216
1152
  const hasContext = task.context?.files?.length > 0 || task.context?.notes;
1217
1153
  const hasSubtasks = task.isParent && subtasks.length > 0;
1218
1154
  const hasRuns = runItems.length > 0 || isLive;
1219
- return React7.createElement(
1220
- Flex6,
1155
+ return React6.createElement(
1156
+ Flex5,
1221
1157
  {
1222
1158
  variant: "column-stretch-start-nowrap-0",
1223
1159
  style: { width: "100%", height: "100%", overflow: "hidden" }
1224
1160
  },
1225
1161
  // ── Header ──
1226
- React7.createElement(
1227
- Flex6,
1162
+ React6.createElement(
1163
+ Flex5,
1228
1164
  {
1229
1165
  variant: "column-stretch-start-nowrap-6",
1230
1166
  style: { ...headerStyle, padding: "12px 16px", borderBottom: "1px solid var(--color-border-default)" }
1231
1167
  },
1232
- // Top row: back + title + status
1233
- React7.createElement(
1234
- Flex6,
1235
- { variant: "row-center-start-nowrap-8" },
1236
- React7.createElement(IconButton4, {
1237
- icon: "back",
1168
+ // Top row: back + title + status + edit
1169
+ React6.createElement(
1170
+ Flex5,
1171
+ { variant: "row-center-space-between-nowrap-8" },
1172
+ React6.createElement(
1173
+ Flex5,
1174
+ { variant: "row-center-start-nowrap-8", style: { flex: 1, minWidth: 0 } },
1175
+ React6.createElement(IconButton3, {
1176
+ icon: "back",
1177
+ size: "xs",
1178
+ variant: "clear",
1179
+ onClick: onBack
1180
+ }),
1181
+ React6.createElement(StatusIcon3, {
1182
+ status: statusToIcon2[task.status] || "pending",
1183
+ size: "sm"
1184
+ }),
1185
+ React6.createElement(Typography5, {
1186
+ variant: "caption-thick",
1187
+ color: "color-text-high",
1188
+ style: { flex: 1, minWidth: 0, wordBreak: "break-word" }
1189
+ }, task.title || "Untitled Task")
1190
+ ),
1191
+ onEdit && React6.createElement(IconButton3, {
1192
+ icon: "edit",
1238
1193
  size: "xs",
1239
1194
  variant: "clear",
1240
- onClick: onBack
1241
- }),
1242
- React7.createElement(StatusIcon3, {
1243
- status: statusToIcon2[task.status] || "pending",
1244
- size: "sm"
1245
- }),
1246
- React7.createElement(Typography5, {
1247
- variant: "caption-thick",
1248
- color: "color-text-high",
1249
- style: { flex: 1, minWidth: 0, wordBreak: "break-word" }
1250
- }, task.title || "Untitled Task")
1195
+ onClick: () => onEdit(taskId),
1196
+ title: "Edit task"
1197
+ })
1251
1198
  ),
1252
1199
  // Meta row: status tag, assigned profile, priority, attempts
1253
- React7.createElement(
1254
- Flex6,
1200
+ React6.createElement(
1201
+ Flex5,
1255
1202
  { variant: "row-center-start-wrap-6" },
1256
- React7.createElement(Tag2, {
1203
+ React6.createElement(Tag2, {
1257
1204
  size: "small",
1258
1205
  color: task.status === "done" ? "positive" : task.status === "failed" ? "negative" : task.status === "in-progress" ? "info" : task.status === "blocked" ? "caution" : "secondary"
1259
1206
  }, statusToLabel2[task.status] || task.status || "pending"),
1260
- task.assignedProfile && React7.createElement(Tag2, { key: `profile-${task.assignedProfile}`, size: "small", color: "info" }, task.assignedProfile),
1261
- task.priority > 0 && React7.createElement(Tag2, {
1207
+ task.assignedProfile && React6.createElement(Tag2, { key: `profile-${task.assignedProfile}`, size: "small", color: "info" }, task.assignedProfile),
1208
+ task.priority > 0 && React6.createElement(Tag2, {
1262
1209
  size: "small",
1263
1210
  color: task.priority >= 3 ? "caution" : "info"
1264
1211
  }, `P${task.priority}`),
1265
- task.attempt != null && task.maxAttempts != null && React7.createElement(Typography5, {
1212
+ task.attempt != null && task.maxAttempts != null && React6.createElement(Typography5, {
1266
1213
  variant: "smallCaption-regular",
1267
1214
  color: "color-text-subtle"
1268
1215
  }, `Attempt ${task.attempt}/${task.maxAttempts}`)
1269
1216
  ),
1270
1217
  // Description
1271
- task.description && React7.createElement(Typography5, {
1218
+ task.description && React6.createElement(Typography5, {
1272
1219
  variant: "smallCaption-regular",
1273
1220
  color: "color-text-medium"
1274
1221
  }, task.description),
1275
1222
  // Profile routing info
1276
- task.assignedProfile && React7.createElement(
1277
- Flex6,
1223
+ task.assignedProfile && React6.createElement(
1224
+ Flex5,
1278
1225
  { variant: "column-stretch-start-nowrap-2" },
1279
- React7.createElement(Typography5, {
1226
+ React6.createElement(Typography5, {
1280
1227
  variant: "smallCaption-regular",
1281
1228
  color: "color-text-medium"
1282
1229
  }, `Profile: ${task.assignedProfile}`),
1283
- task.routingReason && React7.createElement(Typography5, {
1230
+ task.routingReason && React6.createElement(Typography5, {
1284
1231
  variant: "smallCaption-regular",
1285
1232
  color: "color-text-subtle"
1286
1233
  }, task.routingReason)
@@ -1288,7 +1235,7 @@ function TaskDetailView({ taskId, onBack }) {
1288
1235
  // (Actions moved to tab)
1289
1236
  ),
1290
1237
  // ── Tabs ──
1291
- React7.createElement(Tabs, {
1238
+ React6.createElement(Tabs, {
1292
1239
  tabs: [
1293
1240
  { id: "runs", title: `Runs (${runItems.length}${isLive ? "+1" : ""})` },
1294
1241
  ...hasSubtasks ? [{ id: "subtasks", title: `Subtasks (${subtasks.filter((s) => s.status === "done").length}/${subtasks.length})` }] : [],
@@ -1300,21 +1247,21 @@ function TaskDetailView({ taskId, onBack }) {
1300
1247
  size: "sm"
1301
1248
  }),
1302
1249
  // ── Tab content ──
1303
- React7.createElement(
1250
+ React6.createElement(
1304
1251
  ScrollArea2,
1305
1252
  { ref: scrollRef, style: { flex: 1 } },
1306
- React7.createElement(
1307
- Flex6,
1253
+ React6.createElement(
1254
+ Flex5,
1308
1255
  { variant: "column-stretch-start-nowrap-8", style: { padding: "12px 16px" } },
1309
1256
  // ── Runs tab ──
1310
- detailTab === "runs" && (hasRuns || (task.runs?.length ?? 0) > 0) ? React7.createElement(
1311
- Flex6,
1257
+ detailTab === "runs" && (hasRuns || (task.runs?.length ?? 0) > 0) ? React6.createElement(
1258
+ Flex5,
1312
1259
  { variant: "column-stretch-start-nowrap-8" },
1313
1260
  ...runItems.map(({ run, runTimeline }) => {
1314
1261
  const runId = run.id;
1315
1262
  const isExpanded = expandedRunId === runId;
1316
1263
  const isSuccess = run.outcome === "completed" || run.success === true;
1317
- return React7.createElement(TaskBlock, {
1264
+ return React6.createElement(TaskBlock, {
1318
1265
  key: `run-${runId}`,
1319
1266
  state: isSuccess ? "completed" : "failed",
1320
1267
  instruction: extractInstruction(run),
@@ -1328,7 +1275,7 @@ function TaskDetailView({ taskId, onBack }) {
1328
1275
  });
1329
1276
  }),
1330
1277
  // Live run
1331
- isLive && React7.createElement(TaskBlock, {
1278
+ isLive && React6.createElement(TaskBlock, {
1332
1279
  key: "live-run",
1333
1280
  state: "running",
1334
1281
  instruction: liveInstruction ?? task.title,
@@ -1345,19 +1292,19 @@ function TaskDetailView({ taskId, onBack }) {
1345
1292
  expanded: liveExpanded,
1346
1293
  onToggleExpand: () => setLiveExpanded((v) => !v)
1347
1294
  })
1348
- ) : detailTab === "runs" && React7.createElement(EmptyState2, {
1295
+ ) : detailTab === "runs" && React6.createElement(EmptyState2, {
1349
1296
  icon: "smartToy",
1350
1297
  message: "No runs yet",
1351
1298
  description: "This task has not been executed yet."
1352
1299
  }),
1353
1300
  // ── Subtasks tab ──
1354
- detailTab === "subtasks" && hasSubtasks && React7.createElement(
1355
- Flex6,
1301
+ detailTab === "subtasks" && hasSubtasks && React6.createElement(
1302
+ Flex5,
1356
1303
  {
1357
1304
  variant: "column-stretch-start-nowrap-0"
1358
1305
  },
1359
1306
  ...(subtasks ?? []).map(
1360
- (sub) => React7.createElement(SubtaskRowItem, {
1307
+ (sub) => React6.createElement(SubtaskRowItem, {
1361
1308
  key: sub.id,
1362
1309
  sub,
1363
1310
  onBack
@@ -1365,20 +1312,20 @@ function TaskDetailView({ taskId, onBack }) {
1365
1312
  )
1366
1313
  ),
1367
1314
  // ── Actions tab ──
1368
- detailTab === "actions" && React7.createElement(
1369
- Flex6,
1315
+ detailTab === "actions" && React6.createElement(
1316
+ Flex5,
1370
1317
  {
1371
1318
  variant: "column-stretch-start-nowrap-16"
1372
1319
  },
1373
1320
  // Status actions
1374
- React7.createElement(
1375
- Flex6,
1321
+ React6.createElement(
1322
+ Flex5,
1376
1323
  { variant: "column-stretch-start-nowrap-8" },
1377
- React7.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Status"),
1378
- React7.createElement(
1379
- Flex6,
1324
+ React6.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Status"),
1325
+ React6.createElement(
1326
+ Flex5,
1380
1327
  { variant: "row-center-start-nowrap-6" },
1381
- task.status === "failed" && React7.createElement(Button2, {
1328
+ task.status === "failed" && React6.createElement(Button2, {
1382
1329
  size: "xs",
1383
1330
  variant: "fill",
1384
1331
  color: "primary",
@@ -1386,7 +1333,7 @@ function TaskDetailView({ taskId, onBack }) {
1386
1333
  loading: actionLoading === "retry",
1387
1334
  disabled: !!actionLoading
1388
1335
  }, "Retry Task"),
1389
- (task.status === "pending" || task.status === "in-progress" || task.status === "blocked") && React7.createElement(Button2, {
1336
+ (task.status === "pending" || task.status === "in-progress" || task.status === "blocked") && React6.createElement(Button2, {
1390
1337
  size: "xs",
1391
1338
  variant: "outlined",
1392
1339
  color: "danger",
@@ -1397,26 +1344,26 @@ function TaskDetailView({ taskId, onBack }) {
1397
1344
  )
1398
1345
  ),
1399
1346
  // Priority
1400
- React7.createElement(
1401
- Flex6,
1347
+ React6.createElement(
1348
+ Flex5,
1402
1349
  { variant: "column-stretch-start-nowrap-8" },
1403
- React7.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Priority"),
1404
- React7.createElement(
1405
- Flex6,
1350
+ React6.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Priority"),
1351
+ React6.createElement(
1352
+ Flex5,
1406
1353
  { variant: "row-center-start-nowrap-8" },
1407
- React7.createElement(IconButton4, {
1354
+ React6.createElement(IconButton3, {
1408
1355
  icon: "expandLess",
1409
1356
  size: "xs",
1410
1357
  variant: "outlined",
1411
1358
  onClick: () => handlePriorityChange(1),
1412
1359
  title: "Increase priority"
1413
1360
  }),
1414
- React7.createElement(
1361
+ React6.createElement(
1415
1362
  Typography5,
1416
1363
  { variant: "smallCaption-regular", color: "color-text-high" },
1417
1364
  `P${task.priority ?? 0}`
1418
1365
  ),
1419
- React7.createElement(IconButton4, {
1366
+ React6.createElement(IconButton3, {
1420
1367
  icon: "expandMore",
1421
1368
  size: "xs",
1422
1369
  variant: "outlined",
@@ -1426,11 +1373,11 @@ function TaskDetailView({ taskId, onBack }) {
1426
1373
  )
1427
1374
  ),
1428
1375
  // Assign Profile
1429
- availableProfiles.length > 0 && React7.createElement(
1430
- Flex6,
1376
+ availableProfiles.length > 0 && React6.createElement(
1377
+ Flex5,
1431
1378
  { variant: "column-stretch-start-nowrap-8" },
1432
- React7.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Assign Profile"),
1433
- React7.createElement(Table, {
1379
+ React6.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Assign Profile"),
1380
+ React6.createElement(Table, {
1434
1381
  size: "compact",
1435
1382
  getRowKey: (row) => row.id,
1436
1383
  columns: [
@@ -1438,7 +1385,7 @@ function TaskDetailView({ taskId, onBack }) {
1438
1385
  key: "icon",
1439
1386
  header: "",
1440
1387
  width: "30px",
1441
- render: (_, row) => React7.createElement(Icon3, {
1388
+ render: (_, row) => React6.createElement(Icon3, {
1442
1389
  name: row.icon || "smartToy",
1443
1390
  size: 14,
1444
1391
  color: row.color || "color-text-medium"
@@ -1454,17 +1401,17 @@ function TaskDetailView({ taskId, onBack }) {
1454
1401
  render: (_, row) => {
1455
1402
  const caps = row.capabilities || [];
1456
1403
  if (caps.length === 0) return null;
1457
- return React7.createElement(
1458
- Flex6,
1404
+ return React6.createElement(
1405
+ Flex5,
1459
1406
  { variant: "row-center-start-wrap-4" },
1460
1407
  ...caps.slice(0, 4).map(
1461
- (cap) => React7.createElement(
1408
+ (cap) => React6.createElement(
1462
1409
  "span",
1463
1410
  { key: cap.name, title: cap.description },
1464
- React7.createElement(Chip, { label: cap.name, size: "small", color: "color-brand-main" })
1411
+ React6.createElement(Chip, { label: cap.name, size: "small", color: "color-brand-main" })
1465
1412
  )
1466
1413
  ),
1467
- caps.length > 4 && React7.createElement(Typography5, {
1414
+ caps.length > 4 && React6.createElement(Typography5, {
1468
1415
  variant: "smallCaption-regular",
1469
1416
  color: "color-text-subtle"
1470
1417
  }, `+${caps.length - 4}`)
@@ -1478,7 +1425,7 @@ function TaskDetailView({ taskId, onBack }) {
1478
1425
  align: "right",
1479
1426
  render: (_, row) => {
1480
1427
  const isAssigned = task.assignedProfile === row.id;
1481
- return React7.createElement(Checkbox, {
1428
+ return React6.createElement(Checkbox, {
1482
1429
  checked: isAssigned,
1483
1430
  onChange: () => handleAssignProfile(row.id),
1484
1431
  size: "sm"
@@ -1491,20 +1438,20 @@ function TaskDetailView({ taskId, onBack }) {
1491
1438
  )
1492
1439
  ),
1493
1440
  // ── Context tab ──
1494
- detailTab === "context" && hasContext && React7.createElement(
1495
- Flex6,
1441
+ detailTab === "context" && hasContext && React6.createElement(
1442
+ Flex5,
1496
1443
  {
1497
1444
  variant: "column-stretch-start-nowrap-12"
1498
1445
  },
1499
1446
  // Files
1500
- (task.context?.files?.length ?? 0) > 0 && React7.createElement(
1501
- Flex6,
1447
+ (task.context?.files?.length ?? 0) > 0 && React6.createElement(
1448
+ Flex5,
1502
1449
  {
1503
1450
  variant: "column-stretch-start-nowrap-4"
1504
1451
  },
1505
- React7.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Files"),
1452
+ React6.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Files"),
1506
1453
  ...(task.context?.files ?? []).map(
1507
- (file) => React7.createElement(Typography5, {
1454
+ (file) => React6.createElement(Typography5, {
1508
1455
  key: file,
1509
1456
  variant: "smallCaption-regular",
1510
1457
  color: "color-text-high",
@@ -1513,40 +1460,40 @@ function TaskDetailView({ taskId, onBack }) {
1513
1460
  )
1514
1461
  ),
1515
1462
  // Notes
1516
- task.context?.notes && React7.createElement(
1517
- Flex6,
1463
+ task.context?.notes && React6.createElement(
1464
+ Flex5,
1518
1465
  {
1519
1466
  variant: "column-stretch-start-nowrap-4"
1520
1467
  },
1521
- React7.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Notes"),
1522
- React7.createElement(Typography5, {
1468
+ React6.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Notes"),
1469
+ React6.createElement(Typography5, {
1523
1470
  variant: "smallCaption-regular",
1524
1471
  color: "color-text-high",
1525
1472
  style: { whiteSpace: "pre-wrap" }
1526
1473
  }, task.context.notes)
1527
1474
  ),
1528
1475
  // Last error
1529
- task.context?.lastError && React7.createElement(
1530
- Flex6,
1476
+ task.context?.lastError && React6.createElement(
1477
+ Flex5,
1531
1478
  {
1532
1479
  variant: "column-stretch-start-nowrap-4"
1533
1480
  },
1534
- React7.createElement(Typography5, { variant: "caption-thick", color: "color-status-negative" }, "Last Error"),
1535
- React7.createElement(Typography5, {
1481
+ React6.createElement(Typography5, { variant: "caption-thick", color: "color-status-negative" }, "Last Error"),
1482
+ React6.createElement(Typography5, {
1536
1483
  variant: "smallCaption-regular",
1537
1484
  color: "color-text-high",
1538
1485
  style: { fontFamily: "var(--font-mono, monospace)", whiteSpace: "pre-wrap" }
1539
1486
  }, task.context.lastError)
1540
1487
  ),
1541
1488
  // Run summaries (accumulated context)
1542
- (task.context?.runSummaries?.length ?? 0) > 0 && React7.createElement(
1543
- Flex6,
1489
+ (task.context?.runSummaries?.length ?? 0) > 0 && React6.createElement(
1490
+ Flex5,
1544
1491
  {
1545
1492
  variant: "column-stretch-start-nowrap-6"
1546
1493
  },
1547
- React7.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Run Summaries"),
1494
+ React6.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Run Summaries"),
1548
1495
  ...(task.context?.runSummaries ?? []).map(
1549
- (rs, i) => React7.createElement(
1496
+ (rs, i) => React6.createElement(
1550
1497
  Card,
1551
1498
  {
1552
1499
  key: `rs-${i}`,
@@ -1554,28 +1501,28 @@ function TaskDetailView({ taskId, onBack }) {
1554
1501
  padding: "compact",
1555
1502
  style: { gap: "4px" }
1556
1503
  },
1557
- React7.createElement(
1558
- Flex6,
1504
+ React6.createElement(
1505
+ Flex5,
1559
1506
  { variant: "row-center-space-between-nowrap-8" },
1560
- React7.createElement(Typography5, {
1507
+ React6.createElement(Typography5, {
1561
1508
  variant: "smallCaption-thick",
1562
1509
  color: rs.outcome === "success" ? "color-status-positive" : "color-status-negative"
1563
1510
  }, `${rs.outcome === "success" ? "Success" : "Failed"} (${rs.botId ?? "unknown bot"})`),
1564
- React7.createElement(Typography5, {
1511
+ React6.createElement(Typography5, {
1565
1512
  variant: "smallCaption-regular",
1566
1513
  color: "color-text-subtle"
1567
1514
  }, `${Math.round((rs.durationMs ?? 0) / 1e3)}s \xB7 ${rs.tokensUsed ?? 0} tok \xB7 $${(rs.cost ?? 0).toFixed(3)}`)
1568
1515
  ),
1569
- React7.createElement(Typography5, {
1516
+ React6.createElement(Typography5, {
1570
1517
  variant: "smallCaption-regular",
1571
1518
  color: "color-text-medium"
1572
1519
  }, rs.summary ?? ""),
1573
- (rs.filesModified ?? []).length > 0 && React7.createElement(Typography5, {
1520
+ (rs.filesModified ?? []).length > 0 && React6.createElement(Typography5, {
1574
1521
  variant: "smallCaption-regular",
1575
1522
  color: "color-text-subtle",
1576
1523
  style: { fontFamily: "var(--font-mono, monospace)" }
1577
1524
  }, `Files: ${rs.filesModified.join(", ")}`),
1578
- rs.error && React7.createElement(Typography5, {
1525
+ rs.error && React6.createElement(Typography5, {
1579
1526
  variant: "smallCaption-regular",
1580
1527
  color: "color-status-negative"
1581
1528
  }, `Error: ${rs.error}`)
@@ -1583,21 +1530,21 @@ function TaskDetailView({ taskId, onBack }) {
1583
1530
  )
1584
1531
  ),
1585
1532
  // Budget
1586
- (task.tokensUsed > 0 || task.costUsed > 0) && React7.createElement(
1587
- Flex6,
1533
+ (task.tokensUsed > 0 || task.costUsed > 0) && React6.createElement(
1534
+ Flex5,
1588
1535
  {
1589
1536
  variant: "column-stretch-start-nowrap-4"
1590
1537
  },
1591
- React7.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Budget"),
1592
- React7.createElement(
1593
- Flex6,
1538
+ React6.createElement(Typography5, { variant: "caption-thick", color: "color-text-medium" }, "Budget"),
1539
+ React6.createElement(
1540
+ Flex5,
1594
1541
  { variant: "row-center-start-nowrap-16" },
1595
- React7.createElement(
1542
+ React6.createElement(
1596
1543
  Typography5,
1597
1544
  { variant: "smallCaption-regular", color: "color-text-high" },
1598
1545
  `Tokens: ${task.tokensUsed?.toLocaleString() ?? 0}${task.budgetTokens ? ` / ${task.budgetTokens.toLocaleString()}` : ""}`
1599
1546
  ),
1600
- React7.createElement(
1547
+ React6.createElement(
1601
1548
  Typography5,
1602
1549
  { variant: "smallCaption-regular", color: "color-text-high" },
1603
1550
  `Cost: $${(task.costUsed ?? 0).toFixed(3)}${task.budgetCost ? ` / $${task.budgetCost.toFixed(2)}` : ""}`
@@ -1612,15 +1559,636 @@ function TaskDetailView({ taskId, onBack }) {
1612
1559
  var task_detail_view_default = TaskDetailView;
1613
1560
  module.exports = TaskDetailView;
1614
1561
 
1562
+ // src/ui/task-editor.tsx
1563
+ var React7 = require("react");
1564
+ var { useState: useState5, useEffect: useEffect3, useCallback: useCallback3 } = React7;
1565
+ var {
1566
+ Flex: Flex6,
1567
+ Typography: Typography6,
1568
+ Input,
1569
+ Button: Button3,
1570
+ IconButton: IconButton4,
1571
+ Tag: Tag3,
1572
+ Field,
1573
+ toast: toast3,
1574
+ usePackWorkspace: usePackWorkspace3
1575
+ } = require("@fw/plugin-ui-kit");
1576
+ var PRIORITY_OPTIONS = [
1577
+ { id: "0", label: "0 - None" },
1578
+ { id: "1", label: "1 - Low" },
1579
+ { id: "2", label: "2 - Medium" },
1580
+ { id: "3", label: "3 - High" },
1581
+ { id: "4", label: "4 - Critical" }
1582
+ ];
1583
+ var COMPLEXITY_OPTIONS = [
1584
+ { id: "", label: "Not set" },
1585
+ { id: "trivial", label: "Trivial" },
1586
+ { id: "simple", label: "Simple" },
1587
+ { id: "moderate", label: "Moderate" },
1588
+ { id: "complex", label: "Complex" }
1589
+ ];
1590
+ var STATUS_COLOR = {
1591
+ "pending": "secondary",
1592
+ "in-progress": "info",
1593
+ "blocked": "caution",
1594
+ "done": "positive",
1595
+ "failed": "negative",
1596
+ "cancelled": "negative"
1597
+ };
1598
+ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
1599
+ const ctx = usePackWorkspace3();
1600
+ const { callTool } = ctx;
1601
+ const [title, setTitle] = useState5("");
1602
+ const [description, setDescription] = useState5("");
1603
+ const [priority, setPriority] = useState5("0");
1604
+ const [complexity, setComplexity] = useState5("");
1605
+ const [assignedProfile, setAssignedProfile] = useState5("");
1606
+ const [maxAttempts, setMaxAttempts] = useState5("3");
1607
+ const [budgetTokens, setBudgetTokens] = useState5("");
1608
+ const [budgetCost, setBudgetCost] = useState5("");
1609
+ const [notes, setNotes] = useState5("");
1610
+ const [files, setFiles] = useState5([]);
1611
+ const [newFile, setNewFile] = useState5("");
1612
+ const [dependsOn, setDependsOn] = useState5([]);
1613
+ const [newDep, setNewDep] = useState5("");
1614
+ const [taskData, setTaskData] = useState5(null);
1615
+ const [profiles, setProfiles] = useState5([]);
1616
+ const [loading, setLoading] = useState5(mode === "edit");
1617
+ useEffect3(() => {
1618
+ (async () => {
1619
+ try {
1620
+ const raw = await callTool("fw_weaver_profile_list", {});
1621
+ const data = typeof raw === "string" ? JSON.parse(raw) : raw;
1622
+ if (Array.isArray(data)) {
1623
+ setProfiles(data.map((p) => ({
1624
+ id: p.id,
1625
+ name: p.name || p.id
1626
+ })));
1627
+ }
1628
+ } catch {
1629
+ }
1630
+ })();
1631
+ }, [callTool]);
1632
+ useEffect3(() => {
1633
+ if (mode !== "edit" || !taskId) return;
1634
+ let cancelled = false;
1635
+ (async () => {
1636
+ try {
1637
+ const raw = await callTool("fw_weaver_task_get", { id: taskId });
1638
+ if (cancelled) return;
1639
+ const data = typeof raw === "string" ? JSON.parse(raw) : raw;
1640
+ const t = data?.task ?? data;
1641
+ if (!t || !t.id) {
1642
+ toast3("Task not found", { type: "error" });
1643
+ onCancel();
1644
+ return;
1645
+ }
1646
+ setTaskData(t);
1647
+ setTitle(t.title || "");
1648
+ setDescription(t.description || "");
1649
+ setPriority(String(t.priority ?? 0));
1650
+ setComplexity(t.complexity || "");
1651
+ setAssignedProfile(t.assignedProfile || "");
1652
+ setMaxAttempts(String(t.maxAttempts ?? 3));
1653
+ setBudgetTokens(t.budgetTokens != null ? String(t.budgetTokens) : "");
1654
+ setBudgetCost(t.budgetCost != null ? String(t.budgetCost) : "");
1655
+ setNotes(t.context?.notes || "");
1656
+ setFiles(t.context?.files || []);
1657
+ setDependsOn(t.dependsOn || []);
1658
+ } catch {
1659
+ toast3("Failed to load task", { type: "error" });
1660
+ onCancel();
1661
+ } finally {
1662
+ if (!cancelled) setLoading(false);
1663
+ }
1664
+ })();
1665
+ return () => {
1666
+ cancelled = true;
1667
+ };
1668
+ }, [mode, taskId, callTool]);
1669
+ const isDirty = useCallback3(() => {
1670
+ if (mode === "create") {
1671
+ return !!(title.trim() || description.trim() || notes.trim() || files.length > 0 || dependsOn.length > 0 || priority !== "0" || complexity || assignedProfile || maxAttempts !== "3" || budgetTokens || budgetCost);
1672
+ }
1673
+ if (!taskData) return false;
1674
+ return title.trim() !== (taskData.title || "") || description.trim() !== (taskData.description || "") || notes.trim() !== (taskData.context?.notes || "") || JSON.stringify(files) !== JSON.stringify(taskData.context?.files || []) || priority !== String(taskData.priority ?? 0) || complexity !== (taskData.complexity || "") || assignedProfile !== (taskData.assignedProfile || "") || maxAttempts !== String(taskData.maxAttempts ?? 3) || budgetTokens !== (taskData.budgetTokens != null ? String(taskData.budgetTokens) : "") || budgetCost !== (taskData.budgetCost != null ? String(taskData.budgetCost) : "");
1675
+ }, [mode, title, description, notes, files, dependsOn, priority, complexity, assignedProfile, maxAttempts, budgetTokens, budgetCost, taskData]);
1676
+ const handleBack = useCallback3(async () => {
1677
+ if (isDirty()) {
1678
+ const ok = await ctx.confirm("Discard unsaved changes?", {
1679
+ title: "Unsaved Changes",
1680
+ state: "warning"
1681
+ });
1682
+ if (!ok) return;
1683
+ }
1684
+ onCancel();
1685
+ }, [isDirty, ctx, onCancel]);
1686
+ const handleAddFile = useCallback3(() => {
1687
+ const trimmed = newFile.trim();
1688
+ if (!trimmed) return;
1689
+ setFiles((prev) => [...prev, trimmed]);
1690
+ setNewFile("");
1691
+ }, [newFile]);
1692
+ const handleRemoveFile = useCallback3((index) => {
1693
+ setFiles((prev) => prev.filter((_, i) => i !== index));
1694
+ }, []);
1695
+ const handleAddDep = useCallback3(() => {
1696
+ const trimmed = newDep.trim();
1697
+ if (!trimmed) return;
1698
+ setDependsOn((prev) => [...prev, trimmed]);
1699
+ setNewDep("");
1700
+ }, [newDep]);
1701
+ const handleRemoveDep = useCallback3((index) => {
1702
+ setDependsOn((prev) => prev.filter((_, i) => i !== index));
1703
+ }, []);
1704
+ const handleSave = useCallback3(async () => {
1705
+ if (!title.trim()) {
1706
+ toast3("Title is required", { type: "error" });
1707
+ return;
1708
+ }
1709
+ try {
1710
+ if (mode === "create") {
1711
+ const args = {
1712
+ title: title.trim(),
1713
+ description: description.trim(),
1714
+ priority: parseInt(priority, 10) || 0,
1715
+ maxAttempts: parseInt(maxAttempts, 10) || 3
1716
+ };
1717
+ if (complexity) args.complexity = complexity;
1718
+ if (assignedProfile) args.assignedProfile = assignedProfile;
1719
+ if (budgetTokens) args.budgetTokens = parseInt(budgetTokens, 10);
1720
+ if (budgetCost) args.budgetCost = parseFloat(budgetCost);
1721
+ if (dependsOn.length > 0) args.dependsOn = dependsOn;
1722
+ const result = await callTool("fw_weaver_task_create", args);
1723
+ const createData = typeof result === "string" ? JSON.parse(result) : result;
1724
+ const createdId = createData?.task?.id;
1725
+ if (createdId && (notes.trim() || files.length > 0)) {
1726
+ await callTool("fw_weaver_task_update", {
1727
+ id: createdId,
1728
+ context: {
1729
+ notes: notes.trim(),
1730
+ files,
1731
+ runSummaries: []
1732
+ }
1733
+ });
1734
+ }
1735
+ toast3("Task created", { type: "success" });
1736
+ } else {
1737
+ const patch = {
1738
+ id: taskId,
1739
+ title: title.trim(),
1740
+ description: description.trim(),
1741
+ priority: parseInt(priority, 10) || 0,
1742
+ maxAttempts: parseInt(maxAttempts, 10) || 3,
1743
+ complexity: complexity || void 0,
1744
+ assignedProfile: assignedProfile || null
1745
+ };
1746
+ if (budgetTokens) {
1747
+ patch.budgetTokens = parseInt(budgetTokens, 10);
1748
+ } else {
1749
+ patch.budgetTokens = void 0;
1750
+ }
1751
+ if (budgetCost) {
1752
+ patch.budgetCost = parseFloat(budgetCost);
1753
+ } else {
1754
+ patch.budgetCost = void 0;
1755
+ }
1756
+ patch.context = {
1757
+ files,
1758
+ notes: notes.trim(),
1759
+ runSummaries: taskData?.context?.runSummaries || [],
1760
+ lastError: taskData?.context?.lastError
1761
+ };
1762
+ await callTool("fw_weaver_task_update", patch);
1763
+ toast3("Task updated", { type: "success" });
1764
+ }
1765
+ onSave();
1766
+ } catch (err) {
1767
+ toast3(err instanceof Error ? err.message : `Failed to ${mode} task`, { type: "error" });
1768
+ }
1769
+ }, [mode, taskId, title, description, priority, complexity, assignedProfile, maxAttempts, budgetTokens, budgetCost, notes, files, dependsOn, taskData, callTool, onSave]);
1770
+ const handleDelete = useCallback3(async () => {
1771
+ if (!taskId) return;
1772
+ const ok = await ctx.confirm("Are you sure you want to cancel this task?", {
1773
+ title: "Cancel Task",
1774
+ confirmLabel: "Cancel Task",
1775
+ state: "danger"
1776
+ });
1777
+ if (!ok) return;
1778
+ try {
1779
+ await callTool("fw_weaver_task_cancel", { id: taskId });
1780
+ toast3("Task cancelled", { type: "success" });
1781
+ if (onDelete) onDelete();
1782
+ } catch (err) {
1783
+ toast3(err instanceof Error ? err.message : "Failed to cancel task", { type: "error" });
1784
+ }
1785
+ }, [taskId, callTool, onDelete, ctx]);
1786
+ if (loading) {
1787
+ return React7.createElement(
1788
+ Flex6,
1789
+ {
1790
+ variant: "column-center-center-nowrap-12",
1791
+ style: { padding: "24px 16px" }
1792
+ },
1793
+ React7.createElement(Typography6, { variant: "caption-regular", color: "color-text-subtle" }, "Loading task...")
1794
+ );
1795
+ }
1796
+ const profileOptions = [
1797
+ { id: "", label: "Not assigned" },
1798
+ ...profiles.map((p) => ({ id: p.id, label: p.name }))
1799
+ ];
1800
+ return React7.createElement(
1801
+ Flex6,
1802
+ {
1803
+ variant: "column-stretch-start-nowrap-0",
1804
+ style: { width: "100%", height: "100%", overflow: "hidden" }
1805
+ },
1806
+ // -- Header bar --
1807
+ React7.createElement(
1808
+ Flex6,
1809
+ {
1810
+ variant: "row-center-space-between-nowrap-8",
1811
+ style: { padding: "8px 16px", flexShrink: 0, borderBottom: "1px solid var(--color-border-default)" }
1812
+ },
1813
+ React7.createElement(
1814
+ Flex6,
1815
+ { variant: "row-center-start-nowrap-8" },
1816
+ React7.createElement(IconButton4, {
1817
+ icon: "back",
1818
+ size: "xs",
1819
+ variant: "clear",
1820
+ onClick: handleBack,
1821
+ title: "Back"
1822
+ }),
1823
+ React7.createElement(
1824
+ Typography6,
1825
+ { variant: "caption-thick", color: "color-text-high" },
1826
+ mode === "create" ? "Create Task" : "Edit Task"
1827
+ )
1828
+ ),
1829
+ mode === "edit" && onDelete && React7.createElement(IconButton4, {
1830
+ icon: "outlinedDelete",
1831
+ size: "sm",
1832
+ variant: "clear",
1833
+ color: "danger",
1834
+ onClick: handleDelete,
1835
+ title: "Cancel task"
1836
+ })
1837
+ ),
1838
+ // -- Scrollable form body --
1839
+ React7.createElement(
1840
+ Flex6,
1841
+ {
1842
+ variant: "column-stretch-start-nowrap-10",
1843
+ style: { flex: 1, minHeight: 0, overflow: "auto", padding: "12px 16px" }
1844
+ },
1845
+ // -- Edit-only: Status tag --
1846
+ mode === "edit" && taskData && React7.createElement(
1847
+ Field,
1848
+ { label: "Status" },
1849
+ React7.createElement(Tag3, {
1850
+ size: "small",
1851
+ color: STATUS_COLOR[taskData.status] || "secondary"
1852
+ }, taskData.status)
1853
+ ),
1854
+ // -- Title --
1855
+ React7.createElement(
1856
+ Field,
1857
+ { label: "Title" },
1858
+ React7.createElement(Input, {
1859
+ type: "text",
1860
+ size: "small",
1861
+ placeholder: "Task title (required)",
1862
+ value: title,
1863
+ onChange: (v) => setTitle(v),
1864
+ defaultBoxStyle: { flex: 1, minWidth: 0 },
1865
+ inputBoxStyle: { maxWidth: "none" }
1866
+ })
1867
+ ),
1868
+ // -- Description --
1869
+ React7.createElement(
1870
+ Field,
1871
+ { label: "Description" },
1872
+ React7.createElement(Input, {
1873
+ type: "text",
1874
+ size: "small",
1875
+ placeholder: "Detailed task description",
1876
+ value: description,
1877
+ onChange: (v) => setDescription(v),
1878
+ defaultBoxStyle: { flex: 1, minWidth: 0 },
1879
+ inputBoxStyle: { maxWidth: "none" }
1880
+ })
1881
+ ),
1882
+ // -- Priority --
1883
+ React7.createElement(
1884
+ Field,
1885
+ { label: "Priority" },
1886
+ React7.createElement(Input, {
1887
+ type: "select",
1888
+ size: "small",
1889
+ options: PRIORITY_OPTIONS,
1890
+ optionId: priority,
1891
+ onChange: (id) => setPriority(id),
1892
+ defaultBoxStyle: { flex: 1, minWidth: 0 }
1893
+ })
1894
+ ),
1895
+ // -- Complexity --
1896
+ React7.createElement(
1897
+ Field,
1898
+ { label: "Complexity" },
1899
+ React7.createElement(Input, {
1900
+ type: "select",
1901
+ size: "small",
1902
+ options: COMPLEXITY_OPTIONS,
1903
+ optionId: complexity,
1904
+ onChange: (id) => setComplexity(id),
1905
+ defaultBoxStyle: { flex: 1, minWidth: 0 }
1906
+ })
1907
+ ),
1908
+ // -- Assigned Profile --
1909
+ React7.createElement(
1910
+ Field,
1911
+ { label: "Profile" },
1912
+ React7.createElement(Input, {
1913
+ type: "select",
1914
+ size: "small",
1915
+ options: profileOptions,
1916
+ optionId: assignedProfile,
1917
+ onChange: (id) => setAssignedProfile(id),
1918
+ placeholder: "Select profile",
1919
+ defaultBoxStyle: { flex: 1, minWidth: 0 }
1920
+ })
1921
+ ),
1922
+ // -- Max Attempts --
1923
+ React7.createElement(
1924
+ Field,
1925
+ { label: "Max Attempts" },
1926
+ React7.createElement(Input, {
1927
+ type: "number",
1928
+ size: "small",
1929
+ placeholder: "3",
1930
+ value: maxAttempts,
1931
+ onChange: (v) => setMaxAttempts(v),
1932
+ defaultBoxStyle: { flex: 1, minWidth: 0 },
1933
+ inputBoxStyle: { maxWidth: "none" }
1934
+ })
1935
+ ),
1936
+ // -- Budget Tokens --
1937
+ React7.createElement(
1938
+ Field,
1939
+ { label: "Budget Tokens" },
1940
+ React7.createElement(Input, {
1941
+ type: "number",
1942
+ size: "small",
1943
+ placeholder: "Optional token limit",
1944
+ value: budgetTokens,
1945
+ onChange: (v) => setBudgetTokens(v),
1946
+ defaultBoxStyle: { flex: 1, minWidth: 0 },
1947
+ inputBoxStyle: { maxWidth: "none" }
1948
+ })
1949
+ ),
1950
+ // -- Budget Cost --
1951
+ React7.createElement(
1952
+ Field,
1953
+ { label: "Budget Cost" },
1954
+ React7.createElement(Input, {
1955
+ type: "number",
1956
+ size: "small",
1957
+ placeholder: "Optional cost limit (USD)",
1958
+ value: budgetCost,
1959
+ onChange: (v) => setBudgetCost(v),
1960
+ defaultBoxStyle: { flex: 1, minWidth: 0 },
1961
+ inputBoxStyle: { maxWidth: "none" }
1962
+ })
1963
+ ),
1964
+ // -- Notes --
1965
+ React7.createElement(
1966
+ Field,
1967
+ { label: "Notes" },
1968
+ React7.createElement(Input, {
1969
+ type: "text",
1970
+ size: "small",
1971
+ placeholder: "Optional notes for context",
1972
+ value: notes,
1973
+ onChange: (v) => setNotes(v),
1974
+ defaultBoxStyle: { flex: 1, minWidth: 0 },
1975
+ inputBoxStyle: { maxWidth: "none" }
1976
+ })
1977
+ ),
1978
+ // -- Files --
1979
+ React7.createElement(
1980
+ Field,
1981
+ { label: "Files", align: "start" },
1982
+ React7.createElement(
1983
+ Flex6,
1984
+ { variant: "column-stretch-start-nowrap-6" },
1985
+ // Add file row
1986
+ React7.createElement(
1987
+ Flex6,
1988
+ { variant: "row-center-start-nowrap-4", style: { overflow: "hidden" } },
1989
+ React7.createElement(Input, {
1990
+ type: "text",
1991
+ size: "small",
1992
+ placeholder: "File path",
1993
+ value: newFile,
1994
+ onChange: (v) => setNewFile(v),
1995
+ onEnter: handleAddFile,
1996
+ defaultBoxStyle: { flex: 1, minWidth: 0 },
1997
+ inputBoxStyle: { maxWidth: "none" }
1998
+ }),
1999
+ React7.createElement(IconButton4, {
2000
+ icon: "add",
2001
+ size: "sm",
2002
+ variant: "outlined",
2003
+ color: "primary",
2004
+ onClick: handleAddFile,
2005
+ disabled: !newFile.trim()
2006
+ })
2007
+ ),
2008
+ ...files.map(
2009
+ (file, idx) => React7.createElement(
2010
+ Flex6,
2011
+ {
2012
+ key: `file-${idx}`,
2013
+ variant: "row-center-start-nowrap-6",
2014
+ style: { paddingLeft: "4px" }
2015
+ },
2016
+ React7.createElement(Typography6, {
2017
+ variant: "smallCaption-regular",
2018
+ color: "color-text-high",
2019
+ style: { flex: 1, minWidth: 0, fontFamily: "var(--font-mono, monospace)" }
2020
+ }, file),
2021
+ React7.createElement(IconButton4, {
2022
+ icon: "close",
2023
+ size: "xs",
2024
+ variant: "clear",
2025
+ color: "danger",
2026
+ onClick: () => handleRemoveFile(idx)
2027
+ })
2028
+ )
2029
+ )
2030
+ )
2031
+ ),
2032
+ // -- Dependencies --
2033
+ React7.createElement(
2034
+ Field,
2035
+ { label: "Dependencies", align: "start" },
2036
+ React7.createElement(
2037
+ Flex6,
2038
+ { variant: "column-stretch-start-nowrap-6" },
2039
+ // Add dependency row (create mode only)
2040
+ mode === "create" && React7.createElement(
2041
+ Flex6,
2042
+ { variant: "row-center-start-nowrap-4", style: { overflow: "hidden" } },
2043
+ React7.createElement(Input, {
2044
+ type: "text",
2045
+ size: "small",
2046
+ placeholder: "Task ID",
2047
+ value: newDep,
2048
+ onChange: (v) => setNewDep(v),
2049
+ onEnter: handleAddDep,
2050
+ defaultBoxStyle: { flex: 1, minWidth: 0 },
2051
+ inputBoxStyle: { maxWidth: "none" }
2052
+ }),
2053
+ React7.createElement(IconButton4, {
2054
+ icon: "add",
2055
+ size: "sm",
2056
+ variant: "outlined",
2057
+ color: "primary",
2058
+ onClick: handleAddDep,
2059
+ disabled: !newDep.trim()
2060
+ })
2061
+ ),
2062
+ // Dependency list
2063
+ dependsOn.length > 0 ? React7.createElement(
2064
+ Flex6,
2065
+ { variant: "column-stretch-start-nowrap-4" },
2066
+ ...dependsOn.map(
2067
+ (dep, idx) => React7.createElement(
2068
+ Flex6,
2069
+ {
2070
+ key: `dep-${idx}`,
2071
+ variant: "row-center-start-nowrap-6",
2072
+ style: { paddingLeft: "4px" }
2073
+ },
2074
+ React7.createElement(Typography6, {
2075
+ variant: "smallCaption-regular",
2076
+ color: "color-text-high",
2077
+ style: { flex: 1, minWidth: 0, fontFamily: "var(--font-mono, monospace)" }
2078
+ }, dep),
2079
+ mode === "create" && React7.createElement(IconButton4, {
2080
+ icon: "close",
2081
+ size: "xs",
2082
+ variant: "clear",
2083
+ color: "danger",
2084
+ onClick: () => handleRemoveDep(idx)
2085
+ })
2086
+ )
2087
+ )
2088
+ ) : React7.createElement(Typography6, {
2089
+ variant: "smallCaption-regular",
2090
+ color: "color-text-subtle",
2091
+ style: { paddingLeft: "4px" }
2092
+ }, "None"),
2093
+ mode === "edit" && React7.createElement(Typography6, {
2094
+ variant: "smallCaption-regular",
2095
+ color: "color-text-subtle",
2096
+ style: { paddingLeft: "4px", fontStyle: "italic" }
2097
+ }, "Dependencies cannot be changed after creation")
2098
+ )
2099
+ ),
2100
+ // -- Edit-only: read-only metadata --
2101
+ mode === "edit" && taskData && React7.createElement(
2102
+ Flex6,
2103
+ {
2104
+ variant: "column-stretch-start-nowrap-10",
2105
+ style: { marginTop: 8, paddingTop: 12, borderTop: "1px solid var(--color-border-default)" }
2106
+ },
2107
+ React7.createElement(
2108
+ Field,
2109
+ { label: "Created by" },
2110
+ React7.createElement(
2111
+ Typography6,
2112
+ { variant: "smallCaption-regular", color: "color-text-medium" },
2113
+ taskData.createdBy || "unknown"
2114
+ )
2115
+ ),
2116
+ React7.createElement(
2117
+ Field,
2118
+ { label: "Created at" },
2119
+ React7.createElement(
2120
+ Typography6,
2121
+ { variant: "smallCaption-regular", color: "color-text-medium" },
2122
+ taskData.createdAt ? new Date(taskData.createdAt).toLocaleString() : "-"
2123
+ )
2124
+ ),
2125
+ React7.createElement(
2126
+ Field,
2127
+ { label: "Updated at" },
2128
+ React7.createElement(
2129
+ Typography6,
2130
+ { variant: "smallCaption-regular", color: "color-text-medium" },
2131
+ taskData.updatedAt ? new Date(taskData.updatedAt).toLocaleString() : "-"
2132
+ )
2133
+ ),
2134
+ React7.createElement(
2135
+ Field,
2136
+ { label: "Tokens used" },
2137
+ React7.createElement(
2138
+ Typography6,
2139
+ { variant: "smallCaption-regular", color: "color-text-medium" },
2140
+ (taskData.tokensUsed ?? 0).toLocaleString()
2141
+ )
2142
+ ),
2143
+ React7.createElement(
2144
+ Field,
2145
+ { label: "Cost used" },
2146
+ React7.createElement(
2147
+ Typography6,
2148
+ { variant: "smallCaption-regular", color: "color-text-medium" },
2149
+ `$${(taskData.costUsed ?? 0).toFixed(3)}`
2150
+ )
2151
+ ),
2152
+ taskData.context?.lastError && React7.createElement(
2153
+ Field,
2154
+ { label: "Last error", align: "start" },
2155
+ React7.createElement(Typography6, {
2156
+ variant: "smallCaption-regular",
2157
+ color: "color-status-negative",
2158
+ style: { fontFamily: "var(--font-mono, monospace)", whiteSpace: "pre-wrap" }
2159
+ }, taskData.context.lastError)
2160
+ )
2161
+ )
2162
+ ),
2163
+ // -- Footer bar with save button --
2164
+ React7.createElement(
2165
+ Flex6,
2166
+ {
2167
+ variant: "row-center-end-nowrap-8",
2168
+ style: { padding: "8px 16px", flexShrink: 0, borderTop: "1px solid var(--color-border-default)" }
2169
+ },
2170
+ React7.createElement(Button3, {
2171
+ size: "xs",
2172
+ variant: "fill",
2173
+ color: "primary",
2174
+ onClick: handleSave,
2175
+ disabled: !title.trim()
2176
+ }, mode === "create" ? "Create" : "Save")
2177
+ )
2178
+ );
2179
+ }
2180
+ var task_editor_default = TaskEditor;
2181
+ module.exports = TaskEditor;
2182
+
1615
2183
  // src/ui/profile-card.tsx
1616
2184
  var React8 = require("react");
1617
2185
  var {
1618
2186
  Flex: Flex7,
1619
- Typography: Typography6,
2187
+ Typography: Typography7,
1620
2188
  Icon: Icon4,
1621
2189
  Chip: Chip2,
1622
2190
  IconButton: IconButton5,
1623
- Tag: Tag3
2191
+ Tag: Tag4
1624
2192
  } = require("@fw/plugin-ui-kit");
1625
2193
  function ProfileCard({ profile, activeInstances, onEdit, onDelete }) {
1626
2194
  const {
@@ -1660,7 +2228,7 @@ function ProfileCard({ profile, activeInstances, onEdit, onDelete }) {
1660
2228
  },
1661
2229
  React8.createElement(Icon4, { name: icon || "smartToy", size: 18 })
1662
2230
  ),
1663
- React8.createElement(Typography6, {
2231
+ React8.createElement(Typography7, {
1664
2232
  variant: "caption-thick",
1665
2233
  color: "color-text-high",
1666
2234
  style: { flex: 1, minWidth: 0 }
@@ -1682,7 +2250,7 @@ function ProfileCard({ profile, activeInstances, onEdit, onDelete }) {
1682
2250
  })
1683
2251
  ),
1684
2252
  // Description
1685
- description && React8.createElement(Typography6, {
2253
+ description && React8.createElement(Typography7, {
1686
2254
  variant: "smallCaption-regular",
1687
2255
  color: "color-text-medium"
1688
2256
  }, description),
@@ -1695,7 +2263,7 @@ function ProfileCard({ profile, activeInstances, onEdit, onDelete }) {
1695
2263
  capabilities.length > 0 && React8.createElement(
1696
2264
  Flex7,
1697
2265
  { variant: "row-center-start-wrap-4" },
1698
- React8.createElement(Typography6, {
2266
+ React8.createElement(Typography7, {
1699
2267
  variant: "smallCaption-regular",
1700
2268
  color: "color-text-subtle",
1701
2269
  style: { flexShrink: 0 }
@@ -1712,7 +2280,7 @@ function ProfileCard({ profile, activeInstances, onEdit, onDelete }) {
1712
2280
  React8.createElement(
1713
2281
  Flex7,
1714
2282
  { variant: "row-center-start-wrap-12" },
1715
- React8.createElement(Typography6, {
2283
+ React8.createElement(Typography7, {
1716
2284
  variant: "smallCaption-regular",
1717
2285
  color: "color-text-subtle"
1718
2286
  }, `Cost strategy: ${preferences.costStrategy}`)
@@ -1721,22 +2289,22 @@ function ProfileCard({ profile, activeInstances, onEdit, onDelete }) {
1721
2289
  React8.createElement(
1722
2290
  Flex7,
1723
2291
  { variant: "row-center-start-wrap-12" },
1724
- React8.createElement(Typography6, {
2292
+ React8.createElement(Typography7, {
1725
2293
  variant: "smallCaption-regular",
1726
2294
  color: "color-text-subtle"
1727
2295
  }, `Instances: ${activeInstances}/${maxInstances} active`),
1728
- React8.createElement(Tag3, {
2296
+ React8.createElement(Tag4, {
1729
2297
  size: "small",
1730
2298
  color: preferences.requireApproval ? "caution" : "positive"
1731
2299
  }, preferences.requireApproval ? "Approval required" : "Auto-approve")
1732
2300
  ),
1733
2301
  // Budget line
1734
- budgetText && React8.createElement(Typography6, {
2302
+ budgetText && React8.createElement(Typography7, {
1735
2303
  variant: "smallCaption-regular",
1736
2304
  color: "color-text-subtle"
1737
2305
  }, `Budget: ${budgetText}`),
1738
2306
  // Instructions
1739
- preferences.instructions && React8.createElement(Typography6, {
2307
+ preferences.instructions && React8.createElement(Typography7, {
1740
2308
  variant: "smallCaption-regular",
1741
2309
  color: "color-text-subtle",
1742
2310
  style: { fontStyle: "italic" }
@@ -1930,17 +2498,17 @@ var BOT_COLORS = [
1930
2498
 
1931
2499
  // src/ui/profile-editor.tsx
1932
2500
  var React9 = require("react");
1933
- var { useState: useState6, useEffect: useEffect3, useCallback: useCallback4 } = React9;
2501
+ var { useState: useState6, useEffect: useEffect4, useCallback: useCallback4 } = React9;
1934
2502
  var {
1935
2503
  Flex: Flex8,
1936
- Typography: Typography7,
2504
+ Typography: Typography8,
1937
2505
  Input: Input2,
1938
- Button: Button3,
2506
+ Button: Button4,
1939
2507
  IconButton: IconButton6,
1940
2508
  Icon: Icon5,
1941
2509
  SectionTitle,
1942
2510
  Checkbox: Checkbox2,
1943
- Field,
2511
+ Field: Field2,
1944
2512
  IconPicker,
1945
2513
  ColorPicker,
1946
2514
  toast: toast4,
@@ -1961,7 +2529,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
1961
2529
  const [instructions, setInstructions] = useState6("");
1962
2530
  const [requireApproval, setRequireApproval] = useState6(false);
1963
2531
  const [loading, setLoading] = useState6(mode === "edit");
1964
- useEffect3(() => {
2532
+ useEffect4(() => {
1965
2533
  if (mode !== "edit" || !profileId) return;
1966
2534
  let cancelled = false;
1967
2535
  (async () => {
@@ -2079,7 +2647,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2079
2647
  variant: "column-center-center-nowrap-12",
2080
2648
  style: { padding: "24px 16px" }
2081
2649
  },
2082
- React9.createElement(Typography7, { variant: "caption-regular", color: "color-text-subtle" }, "Loading profile...")
2650
+ React9.createElement(Typography8, { variant: "caption-regular", color: "color-text-subtle" }, "Loading profile...")
2083
2651
  );
2084
2652
  }
2085
2653
  return React9.createElement(
@@ -2105,7 +2673,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2105
2673
  onClick: onCancel,
2106
2674
  title: "Back"
2107
2675
  }),
2108
- React9.createElement(Typography7, { variant: "caption-thick", color: "color-text-high" }, mode === "create" ? "Create Profile" : "Edit Profile")
2676
+ React9.createElement(Typography8, { variant: "caption-thick", color: "color-text-high" }, mode === "create" ? "Create Profile" : "Edit Profile")
2109
2677
  ),
2110
2678
  mode === "edit" && onDelete && React9.createElement(IconButton6, {
2111
2679
  icon: "outlinedDelete",
@@ -2125,7 +2693,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2125
2693
  },
2126
2694
  // ── Name ──
2127
2695
  React9.createElement(
2128
- Field,
2696
+ Field2,
2129
2697
  { label: "Name" },
2130
2698
  React9.createElement(Input2, {
2131
2699
  type: "text",
@@ -2139,7 +2707,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2139
2707
  ),
2140
2708
  // ── Description ──
2141
2709
  React9.createElement(
2142
- Field,
2710
+ Field2,
2143
2711
  { label: "Description" },
2144
2712
  React9.createElement(Input2, {
2145
2713
  type: "text",
@@ -2153,7 +2721,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2153
2721
  ),
2154
2722
  // ── Bot ──
2155
2723
  React9.createElement(
2156
- Field,
2724
+ Field2,
2157
2725
  { label: "Bot" },
2158
2726
  React9.createElement(Input2, {
2159
2727
  type: "select",
@@ -2168,7 +2736,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2168
2736
  ),
2169
2737
  // ── Icon ──
2170
2738
  React9.createElement(
2171
- Field,
2739
+ Field2,
2172
2740
  { label: "Icon", align: "start" },
2173
2741
  React9.createElement(IconPicker, {
2174
2742
  catalog: ICON_CATALOG,
@@ -2180,7 +2748,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2180
2748
  ),
2181
2749
  // ── Color ──
2182
2750
  React9.createElement(
2183
- Field,
2751
+ Field2,
2184
2752
  { label: "Color", align: "start" },
2185
2753
  React9.createElement(ColorPicker, {
2186
2754
  colors: BOT_COLORS,
@@ -2191,7 +2759,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2191
2759
  ),
2192
2760
  // ── Cost Strategy ──
2193
2761
  React9.createElement(
2194
- Field,
2762
+ Field2,
2195
2763
  { label: "Cost Strategy" },
2196
2764
  React9.createElement(Input2, {
2197
2765
  type: "select",
@@ -2208,7 +2776,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2208
2776
  ),
2209
2777
  // ── Capabilities ──
2210
2778
  React9.createElement(
2211
- Field,
2779
+ Field2,
2212
2780
  { label: "Capabilities", align: "start" },
2213
2781
  React9.createElement(
2214
2782
  Flex8,
@@ -2253,12 +2821,12 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2253
2821
  variant: "row-center-start-nowrap-6",
2254
2822
  style: { paddingLeft: "4px" }
2255
2823
  },
2256
- React9.createElement(Typography7, {
2824
+ React9.createElement(Typography8, {
2257
2825
  variant: "smallCaption-regular",
2258
2826
  color: "color-text-high",
2259
2827
  style: { flexShrink: 0 }
2260
2828
  }, `\u2022 ${cap.name}:`),
2261
- React9.createElement(Typography7, {
2829
+ React9.createElement(Typography8, {
2262
2830
  variant: "smallCaption-regular",
2263
2831
  color: "color-text-medium",
2264
2832
  style: { flex: 1, minWidth: 0 }
@@ -2276,7 +2844,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2276
2844
  ),
2277
2845
  // ── Instructions ──
2278
2846
  React9.createElement(
2279
- Field,
2847
+ Field2,
2280
2848
  { label: "Instructions" },
2281
2849
  React9.createElement(Input2, {
2282
2850
  type: "text",
@@ -2290,7 +2858,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2290
2858
  ),
2291
2859
  // ── Require Approval ──
2292
2860
  React9.createElement(
2293
- Field,
2861
+ Field2,
2294
2862
  { label: "" },
2295
2863
  React9.createElement(Checkbox2, {
2296
2864
  checked: requireApproval,
@@ -2303,7 +2871,7 @@ function ProfileEditor({ mode, profileId, bots, onSave, onCancel, onDelete }) {
2303
2871
  React9.createElement(
2304
2872
  Flex8,
2305
2873
  { variant: "row-center-end-nowrap-8" },
2306
- React9.createElement(Button3, {
2874
+ React9.createElement(Button4, {
2307
2875
  size: "xs",
2308
2876
  variant: "fill",
2309
2877
  color: "primary",
@@ -2321,9 +2889,9 @@ module.exports = ProfileEditor;
2321
2889
  var React10 = require("react");
2322
2890
  var {
2323
2891
  Flex: Flex9,
2324
- Typography: Typography8,
2892
+ Typography: Typography9,
2325
2893
  ScrollArea: ScrollArea3,
2326
- Tag: Tag4,
2894
+ Tag: Tag5,
2327
2895
  SectionTitle: SectionTitle2
2328
2896
  } = require("@fw/plugin-ui-kit");
2329
2897
  var methodColors = {
@@ -2355,7 +2923,7 @@ function DecisionLog({ decisions }) {
2355
2923
  variant: "column-stretch-start-nowrap-4"
2356
2924
  },
2357
2925
  React10.createElement(SectionTitle2, null, "Decision Log"),
2358
- React10.createElement(Typography8, {
2926
+ React10.createElement(Typography9, {
2359
2927
  variant: "smallCaption-regular",
2360
2928
  color: "color-text-subtle"
2361
2929
  }, "No routing decisions yet.")
@@ -2394,28 +2962,28 @@ function DecisionLog({ decisions }) {
2394
2962
  React10.createElement(
2395
2963
  Flex9,
2396
2964
  { variant: "row-center-start-nowrap-8" },
2397
- React10.createElement(Typography8, {
2965
+ React10.createElement(Typography9, {
2398
2966
  variant: "smallCaption-regular",
2399
2967
  color: "color-text-subtle",
2400
2968
  style: { flexShrink: 0, fontFamily: "var(--font-mono, monospace)", fontSize: "11px" }
2401
2969
  }, formatTime(d.timestamp)),
2402
- React10.createElement(Typography8, {
2970
+ React10.createElement(Typography9, {
2403
2971
  variant: "smallCaption-regular",
2404
2972
  color: "color-text-high",
2405
2973
  style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
2406
2974
  }, `"${truncate(d.taskTitle, 40)}"`),
2407
- React10.createElement(Typography8, {
2975
+ React10.createElement(Typography9, {
2408
2976
  variant: "smallCaption-regular",
2409
2977
  color: "color-text-medium",
2410
2978
  style: { flexShrink: 0 }
2411
2979
  }, `\u2192 ${d.assignedInstanceId}`),
2412
- React10.createElement(Tag4, {
2980
+ React10.createElement(Tag5, {
2413
2981
  size: "small",
2414
2982
  color: methodColors[d.method] || "secondary"
2415
2983
  }, methodLabel)
2416
2984
  ),
2417
2985
  // Reason line
2418
- React10.createElement(Typography8, {
2986
+ React10.createElement(Typography9, {
2419
2987
  variant: "smallCaption-regular",
2420
2988
  color: "color-text-subtle",
2421
2989
  style: { paddingLeft: "70px" }
@@ -2431,19 +2999,19 @@ module.exports = DecisionLog;
2431
2999
 
2432
3000
  // src/ui/swarm-dashboard.tsx
2433
3001
  var React11 = require("react");
2434
- var { useState: useState7, useEffect: useEffect4, useCallback: useCallback5, useRef: useRef3 } = React11;
3002
+ var { useState: useState7, useEffect: useEffect5, useCallback: useCallback5, useRef: useRef3 } = React11;
2435
3003
  var {
2436
3004
  Flex: Flex10,
2437
3005
  ScrollArea: ScrollArea4,
2438
3006
  EmptyState: EmptyState3,
2439
- Typography: Typography9,
3007
+ Typography: Typography10,
2440
3008
  StatusIcon: StatusIcon4,
2441
3009
  Icon: Icon6,
2442
- Tag: Tag5,
3010
+ Tag: Tag6,
2443
3011
  Card: Card2,
2444
3012
  Tabs: Tabs2,
2445
3013
  SectionTitle: SectionTitle3,
2446
- Button: Button4,
3014
+ Button: Button5,
2447
3015
  Input: Input3,
2448
3016
  IconButton: IconButton7,
2449
3017
  IconPicker: IconPicker2,
@@ -2451,7 +3019,7 @@ var {
2451
3019
  toast: toast5,
2452
3020
  usePackWorkspace: usePackWorkspace5
2453
3021
  } = require("@fw/plugin-ui-kit");
2454
- function parseToolResult2(raw) {
3022
+ function parseToolResult(raw) {
2455
3023
  if (typeof raw === "string") {
2456
3024
  try {
2457
3025
  return JSON.parse(raw);
@@ -2474,6 +3042,8 @@ function SwarmDashboard() {
2474
3042
  const [editingBotId, setEditingBotId] = useState7(null);
2475
3043
  const [profileEditorMode, setProfileEditorMode] = useState7(null);
2476
3044
  const [editingProfileId, setEditingProfileId] = useState7(null);
3045
+ const [taskEditorMode, setTaskEditorMode] = useState7(null);
3046
+ const [editingTaskId, setEditingTaskId] = useState7(null);
2477
3047
  const [swarmStatus, setSwarmStatus] = useState7(null);
2478
3048
  const [tasks, setTasks] = useState7([]);
2479
3049
  const [registeredBots, setRegisteredBots] = useState7([]);
@@ -2483,7 +3053,7 @@ function SwarmDashboard() {
2483
3053
  const [orchestratorDecisions, setOrchestratorDecisions] = useState7([]);
2484
3054
  const [loading, setLoading] = useState7(true);
2485
3055
  const mountedRef = useRef3(true);
2486
- useEffect4(() => {
3056
+ useEffect5(() => {
2487
3057
  mountedRef.current = true;
2488
3058
  return () => {
2489
3059
  mountedRef.current = false;
@@ -2493,7 +3063,7 @@ function SwarmDashboard() {
2493
3063
  try {
2494
3064
  const raw = await callTool("fw_weaver_swarm_status", {});
2495
3065
  if (!mountedRef.current) return;
2496
- const data = parseToolResult2(raw);
3066
+ const data = parseToolResult(raw);
2497
3067
  if (data) setSwarmStatus(data);
2498
3068
  } catch {
2499
3069
  }
@@ -2502,7 +3072,7 @@ function SwarmDashboard() {
2502
3072
  try {
2503
3073
  const raw = await callTool("fw_weaver_task_list", {});
2504
3074
  if (!mountedRef.current) return;
2505
- const data = parseToolResult2(raw);
3075
+ const data = parseToolResult(raw);
2506
3076
  if (Array.isArray(data)) {
2507
3077
  setTasks(data);
2508
3078
  } else if (data && typeof data === "object" && Array.isArray(data.tasks)) {
@@ -2559,25 +3129,25 @@ function SwarmDashboard() {
2559
3129
  await Promise.all([fetchSwarmStatus(), fetchTaskList(), fetchBots(), fetchConfig(), fetchProfiles(), fetchOrchestratorStatus()]);
2560
3130
  if (mountedRef.current) setLoading(false);
2561
3131
  }, [fetchSwarmStatus, fetchTaskList, fetchBots, fetchConfig, fetchProfiles, fetchOrchestratorStatus]);
2562
- useEffect4(() => {
3132
+ useEffect5(() => {
2563
3133
  refreshAll();
2564
3134
  }, [refreshAll]);
2565
- useEffect4(() => {
3135
+ useEffect5(() => {
2566
3136
  const interval = setInterval(fetchSwarmStatus, 3e3);
2567
3137
  return () => clearInterval(interval);
2568
3138
  }, [fetchSwarmStatus]);
2569
- useEffect4(() => {
3139
+ useEffect5(() => {
2570
3140
  const interval = setInterval(fetchTaskList, 5e3);
2571
3141
  return () => clearInterval(interval);
2572
3142
  }, [fetchTaskList]);
2573
- useEffect4(() => {
3143
+ useEffect5(() => {
2574
3144
  const interval = setInterval(() => {
2575
3145
  fetchProfiles();
2576
3146
  fetchOrchestratorStatus();
2577
3147
  }, 1e4);
2578
3148
  return () => clearInterval(interval);
2579
3149
  }, [fetchProfiles, fetchOrchestratorStatus]);
2580
- useEffect4(() => {
3150
+ useEffect5(() => {
2581
3151
  return onRefresh(() => refreshAll());
2582
3152
  }, [refreshAll, onRefresh]);
2583
3153
  const handleUpdateBot = useCallback5(async (botId, patch) => {
@@ -2605,13 +3175,35 @@ function SwarmDashboard() {
2605
3175
  setSelectedTaskId(null);
2606
3176
  refreshAll();
2607
3177
  }, [refreshAll]);
2608
- const handleTaskCreated = useCallback5(() => {
2609
- fetchTaskList();
2610
- }, [fetchTaskList]);
3178
+ const handleEditFromDetail = useCallback5((tid) => {
3179
+ setEditingTaskId(tid);
3180
+ setTaskEditorMode("edit");
3181
+ }, []);
3182
+ if (selectedTaskId && taskEditorMode === "edit" && editingTaskId) {
3183
+ return React11.createElement(task_editor_default, {
3184
+ mode: "edit",
3185
+ taskId: editingTaskId,
3186
+ onSave: () => {
3187
+ setTaskEditorMode(null);
3188
+ setEditingTaskId(null);
3189
+ },
3190
+ onCancel: () => {
3191
+ setTaskEditorMode(null);
3192
+ setEditingTaskId(null);
3193
+ },
3194
+ onDelete: () => {
3195
+ setTaskEditorMode(null);
3196
+ setEditingTaskId(null);
3197
+ setSelectedTaskId(null);
3198
+ fetchTaskList();
3199
+ }
3200
+ });
3201
+ }
2611
3202
  if (selectedTaskId) {
2612
3203
  return React11.createElement(task_detail_view_default, {
2613
3204
  taskId: selectedTaskId,
2614
- onBack: handleBack
3205
+ onBack: handleBack,
3206
+ onEdit: handleEditFromDetail
2615
3207
  });
2616
3208
  }
2617
3209
  const swarmInstances = swarmStatus?.instances ?? {};
@@ -2672,8 +3264,27 @@ function SwarmDashboard() {
2672
3264
  variant: "column-stretch-start-nowrap-0",
2673
3265
  style: { flex: 1, minHeight: 0, overflow: "auto" }
2674
3266
  },
2675
- // Tasks tab
2676
- activeTab === "tasks" && React11.createElement(
3267
+ // Tasks tab — when TaskEditor is open, render it INSTEAD of the list
3268
+ activeTab === "tasks" && taskEditorMode != null && React11.createElement(task_editor_default, {
3269
+ mode: taskEditorMode,
3270
+ taskId: editingTaskId ?? void 0,
3271
+ onSave: () => {
3272
+ setTaskEditorMode(null);
3273
+ setEditingTaskId(null);
3274
+ fetchTaskList();
3275
+ },
3276
+ onCancel: () => {
3277
+ setTaskEditorMode(null);
3278
+ setEditingTaskId(null);
3279
+ },
3280
+ onDelete: taskEditorMode === "edit" ? () => {
3281
+ setTaskEditorMode(null);
3282
+ setEditingTaskId(null);
3283
+ fetchTaskList();
3284
+ } : void 0
3285
+ }),
3286
+ // Tasks tab — default list view
3287
+ activeTab === "tasks" && taskEditorMode == null && React11.createElement(
2677
3288
  Flex10,
2678
3289
  {
2679
3290
  variant: "column-stretch-start-nowrap-0",
@@ -2695,7 +3306,7 @@ function SwarmDashboard() {
2695
3306
  variant: "row-center-start-nowrap-8",
2696
3307
  style: { padding: "4px 16px", flexShrink: 0 }
2697
3308
  },
2698
- React11.createElement(Button4, {
3309
+ React11.createElement(Button5, {
2699
3310
  size: "xs",
2700
3311
  variant: "outlined",
2701
3312
  color: "secondary",
@@ -2709,7 +3320,7 @@ function SwarmDashboard() {
2709
3320
  if (!ok) return;
2710
3321
  try {
2711
3322
  const raw = await callTool("fw_weaver_tasks_clear", { filter: "completed" });
2712
- const data = parseToolResult2(raw);
3323
+ const data = parseToolResult(raw);
2713
3324
  toast5(`Cleared ${data?.cleared ?? 0} tasks`, { type: "success" });
2714
3325
  fetchTaskList();
2715
3326
  } catch (err) {
@@ -2717,7 +3328,7 @@ function SwarmDashboard() {
2717
3328
  }
2718
3329
  }
2719
3330
  }, "Clear Completed"),
2720
- React11.createElement(Button4, {
3331
+ React11.createElement(Button5, {
2721
3332
  size: "xs",
2722
3333
  variant: "outlined",
2723
3334
  color: "danger",
@@ -2731,7 +3342,7 @@ function SwarmDashboard() {
2731
3342
  if (!ok) return;
2732
3343
  try {
2733
3344
  const raw = await callTool("fw_weaver_tasks_clear", { filter: "all" });
2734
- const data = parseToolResult2(raw);
3345
+ const data = parseToolResult(raw);
2735
3346
  toast5(`Cleared ${data?.cleared ?? 0} tasks`, { type: "success" });
2736
3347
  refreshAll();
2737
3348
  } catch (err) {
@@ -2740,16 +3351,20 @@ function SwarmDashboard() {
2740
3351
  }
2741
3352
  }, "Clear All")
2742
3353
  ),
2743
- // Task create form (inside Tasks tab)
3354
+ // New Task button (bottom bar)
2744
3355
  React11.createElement(
2745
3356
  Flex10,
2746
3357
  {
2747
3358
  variant: "column-stretch-start-nowrap-0",
2748
- style: { padding: "8px 16px", flexShrink: 0, borderTop: "1px solid var(--color-border-default)" }
3359
+ style: { flexShrink: 0, borderTop: "1px solid var(--color-border-default)", padding: "8px 16px" }
2749
3360
  },
2750
- React11.createElement(task_create_form_default, {
2751
- onTaskCreated: handleTaskCreated
2752
- })
3361
+ React11.createElement(Button5, {
3362
+ size: "xs",
3363
+ variant: "clear",
3364
+ color: "primary",
3365
+ leftIcon: "add",
3366
+ onClick: () => setTaskEditorMode("create")
3367
+ }, "New Task")
2753
3368
  )
2754
3369
  ),
2755
3370
  // Bots tab
@@ -2771,37 +3386,37 @@ function SwarmDashboard() {
2771
3386
  variant: "row-center-start-nowrap-8",
2772
3387
  style: { padding: "8px 16px", borderBottom: "1px solid var(--color-border-default)" }
2773
3388
  },
2774
- React11.createElement(Typography9, {
3389
+ React11.createElement(Typography10, {
2775
3390
  variant: "smallCaption-regular",
2776
3391
  color: "color-text-subtle",
2777
3392
  style: { width: "120px", flexShrink: 0 }
2778
3393
  }, "Instance"),
2779
- React11.createElement(Typography9, {
3394
+ React11.createElement(Typography10, {
2780
3395
  variant: "smallCaption-regular",
2781
3396
  color: "color-text-subtle",
2782
3397
  style: { width: "110px", flexShrink: 0 }
2783
3398
  }, "Bot"),
2784
- React11.createElement(Typography9, {
3399
+ React11.createElement(Typography10, {
2785
3400
  variant: "smallCaption-regular",
2786
3401
  color: "color-text-subtle",
2787
3402
  style: { width: "70px", flexShrink: 0 }
2788
3403
  }, "Status"),
2789
- React11.createElement(Typography9, {
3404
+ React11.createElement(Typography10, {
2790
3405
  variant: "smallCaption-regular",
2791
3406
  color: "color-text-subtle",
2792
3407
  style: { flex: 1, minWidth: 0 }
2793
3408
  }, "Task"),
2794
- React11.createElement(Typography9, {
3409
+ React11.createElement(Typography10, {
2795
3410
  variant: "smallCaption-regular",
2796
3411
  color: "color-text-subtle",
2797
3412
  style: { width: "50px", flexShrink: 0, textAlign: "right" }
2798
3413
  }, "Tokens"),
2799
- React11.createElement(Typography9, {
3414
+ React11.createElement(Typography10, {
2800
3415
  variant: "smallCaption-regular",
2801
3416
  color: "color-text-subtle",
2802
3417
  style: { width: "50px", flexShrink: 0, textAlign: "right" }
2803
3418
  }, "Cost"),
2804
- React11.createElement(Typography9, {
3419
+ React11.createElement(Typography10, {
2805
3420
  variant: "smallCaption-regular",
2806
3421
  color: "color-text-subtle",
2807
3422
  style: { width: "50px", flexShrink: 0 }
@@ -2866,8 +3481,8 @@ function SwarmDashboard() {
2866
3481
  React11.createElement(
2867
3482
  Flex10,
2868
3483
  { variant: "column-start-start-nowrap-1", style: { flex: 1, minWidth: 0 } },
2869
- React11.createElement(Typography9, { variant: "smallCaption-regular", color: "color-text-high" }, bot.name),
2870
- bot.description && React11.createElement(Typography9, { variant: "smallCaption-regular", color: "color-text-subtle" }, bot.description)
3484
+ React11.createElement(Typography10, { variant: "smallCaption-regular", color: "color-text-high" }, bot.name),
3485
+ bot.description && React11.createElement(Typography10, { variant: "smallCaption-regular", color: "color-text-subtle" }, bot.description)
2871
3486
  ),
2872
3487
  React11.createElement(Icon6, { name: isEditing ? "expandLess" : "expandMore", size: 14, color: "color-text-subtle" })
2873
3488
  ),
@@ -2985,7 +3600,7 @@ function SwarmDashboard() {
2985
3600
  variant: "column-stretch-start-nowrap-0",
2986
3601
  style: { flexShrink: 0, borderTop: "1px solid var(--color-border-default)", padding: "8px 16px" }
2987
3602
  },
2988
- React11.createElement(Button4, {
3603
+ React11.createElement(Button5, {
2989
3604
  size: "xs",
2990
3605
  variant: "clear",
2991
3606
  color: "primary",
@@ -3005,25 +3620,25 @@ function SwarmDashboard() {
3005
3620
  React11.createElement(
3006
3621
  Flex10,
3007
3622
  { variant: "row-center-space-between-nowrap-8" },
3008
- React11.createElement(Typography9, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Provider"),
3623
+ React11.createElement(Typography10, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Provider"),
3009
3624
  React11.createElement(
3010
3625
  Flex10,
3011
3626
  { variant: "row-center-start-nowrap-4" },
3012
3627
  React11.createElement(
3013
- Typography9,
3628
+ Typography10,
3014
3629
  { variant: "smallCaption-regular", color: "color-text-high" },
3015
3630
  providers.find((p) => p.envVarsSet)?.name ?? "None detected"
3016
3631
  ),
3017
- providers.find((p) => p.envVarsSet) && React11.createElement(Tag5, { size: "small", color: "info" }, "active")
3632
+ providers.find((p) => p.envVarsSet) && React11.createElement(Tag6, { size: "small", color: "info" }, "active")
3018
3633
  )
3019
3634
  ),
3020
3635
  // Trust
3021
3636
  insights?.trust && React11.createElement(
3022
3637
  Flex10,
3023
3638
  { variant: "row-center-space-between-nowrap-8" },
3024
- React11.createElement(Typography9, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Trust"),
3639
+ React11.createElement(Typography10, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Trust"),
3025
3640
  React11.createElement(
3026
- Typography9,
3641
+ Typography10,
3027
3642
  { variant: "smallCaption-regular", color: "color-text-high" },
3028
3643
  `Phase ${insights.trust.phase} \xB7 ${insights.trust.score}/100`
3029
3644
  )
@@ -3032,9 +3647,9 @@ function SwarmDashboard() {
3032
3647
  insights?.health && React11.createElement(
3033
3648
  Flex10,
3034
3649
  { variant: "row-center-space-between-nowrap-8" },
3035
- React11.createElement(Typography9, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Health"),
3650
+ React11.createElement(Typography10, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Health"),
3036
3651
  React11.createElement(
3037
- Typography9,
3652
+ Typography10,
3038
3653
  { variant: "smallCaption-regular", color: "color-text-high" },
3039
3654
  `${insights.health.overall}/100`
3040
3655
  )
@@ -3043,12 +3658,12 @@ function SwarmDashboard() {
3043
3658
  providers.length > 0 && React11.createElement(
3044
3659
  Flex10,
3045
3660
  { variant: "column-stretch-start-nowrap-4" },
3046
- React11.createElement(Typography9, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Available Providers"),
3661
+ React11.createElement(Typography10, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Available Providers"),
3047
3662
  React11.createElement(
3048
3663
  Flex10,
3049
3664
  { variant: "row-center-start-wrap-4" },
3050
3665
  ...providers.map(
3051
- (p) => React11.createElement(Tag5, {
3666
+ (p) => React11.createElement(Tag6, {
3052
3667
  key: p.name,
3053
3668
  size: "small",
3054
3669
  color: p.envVarsSet ? "positive" : "secondary"
@@ -3064,7 +3679,7 @@ function SwarmDashboard() {
3064
3679
  React11.createElement(
3065
3680
  Flex10,
3066
3681
  { variant: "row-center-start-nowrap-8" },
3067
- React11.createElement(Button4, {
3682
+ React11.createElement(Button5, {
3068
3683
  size: "xs",
3069
3684
  variant: "outlined",
3070
3685
  color: "secondary",
@@ -3085,7 +3700,7 @@ function SwarmDashboard() {
3085
3700
  }
3086
3701
  }
3087
3702
  }, "Reset Config"),
3088
- React11.createElement(Button4, {
3703
+ React11.createElement(Button5, {
3089
3704
  size: "xs",
3090
3705
  variant: "outlined",
3091
3706
  color: "danger",
@@ -3102,7 +3717,7 @@ function SwarmDashboard() {
3102
3717
  if (!ok) return;
3103
3718
  try {
3104
3719
  const raw = await callTool("fw_weaver_reset_all", {});
3105
- const data = parseToolResult2(raw);
3720
+ const data = parseToolResult(raw);
3106
3721
  toast5(`Full reset complete \u2014 ${data?.tasksCleared ?? 0} tasks, ${data?.profilesCleared ?? 0} profiles cleared`, { type: "success" });
3107
3722
  refreshAll();
3108
3723
  } catch (err) {