@synergenius/flow-weaver-pack-weaver 0.9.199 → 0.9.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-chat-provider.js +5 -5
- package/dist/ai-chat-provider.js.map +1 -1
- package/dist/bot/acceptance-merge.d.ts +21 -0
- package/dist/bot/acceptance-merge.d.ts.map +1 -0
- package/dist/bot/acceptance-merge.js +46 -0
- package/dist/bot/acceptance-merge.js.map +1 -0
- package/dist/bot/ai-client.d.ts +14 -2
- package/dist/bot/ai-client.d.ts.map +1 -1
- package/dist/bot/ai-client.js +71 -24
- package/dist/bot/ai-client.js.map +1 -1
- package/dist/bot/assistant-tools.js +3 -3
- package/dist/bot/assistant-tools.js.map +1 -1
- package/dist/bot/audit-logger.d.ts.map +1 -1
- package/dist/bot/audit-logger.js +34 -14
- package/dist/bot/audit-logger.js.map +1 -1
- package/dist/bot/audit-trail.d.ts +67 -0
- package/dist/bot/audit-trail.d.ts.map +1 -0
- package/dist/bot/audit-trail.js +153 -0
- package/dist/bot/audit-trail.js.map +1 -0
- package/dist/bot/behavior-defaults.d.ts +1 -1
- package/dist/bot/behavior-defaults.d.ts.map +1 -1
- package/dist/bot/behavior-defaults.js +7 -3
- package/dist/bot/behavior-defaults.js.map +1 -1
- package/dist/bot/capability-registry.d.ts +9 -0
- package/dist/bot/capability-registry.d.ts.map +1 -1
- package/dist/bot/capability-registry.js +81 -27
- package/dist/bot/capability-registry.js.map +1 -1
- package/dist/bot/capability-types.d.ts +10 -0
- package/dist/bot/capability-types.d.ts.map +1 -1
- package/dist/bot/cli-provider.d.ts.map +1 -1
- package/dist/bot/cli-provider.js +8 -7
- package/dist/bot/cli-provider.js.map +1 -1
- package/dist/bot/preflight.d.ts +48 -0
- package/dist/bot/preflight.d.ts.map +1 -0
- package/dist/bot/preflight.js +247 -0
- package/dist/bot/preflight.js.map +1 -0
- package/dist/bot/provider-shim.d.ts +74 -0
- package/dist/bot/provider-shim.d.ts.map +1 -0
- package/dist/bot/provider-shim.js +176 -0
- package/dist/bot/provider-shim.js.map +1 -0
- package/dist/bot/runner.d.ts +2 -0
- package/dist/bot/runner.d.ts.map +1 -1
- package/dist/bot/runner.js +60 -17
- package/dist/bot/runner.js.map +1 -1
- package/dist/bot/step-executor.d.ts.map +1 -1
- package/dist/bot/step-executor.js +72 -115
- package/dist/bot/step-executor.js.map +1 -1
- package/dist/bot/swarm-controller.d.ts +2 -0
- package/dist/bot/swarm-controller.d.ts.map +1 -1
- package/dist/bot/swarm-controller.js +92 -20
- package/dist/bot/swarm-controller.js.map +1 -1
- package/dist/bot/task-create-handler.d.ts +37 -0
- package/dist/bot/task-create-handler.d.ts.map +1 -0
- package/dist/bot/task-create-handler.js +124 -0
- package/dist/bot/task-create-handler.js.map +1 -0
- package/dist/bot/task-store.d.ts +1 -0
- package/dist/bot/task-store.d.ts.map +1 -1
- package/dist/bot/task-store.js +67 -0
- package/dist/bot/task-store.js.map +1 -1
- package/dist/bot/types.d.ts +1 -1
- package/dist/bot/types.d.ts.map +1 -1
- package/dist/bot/weaver-tools.d.ts.map +1 -1
- package/dist/bot/weaver-tools.js +7 -39
- package/dist/bot/weaver-tools.js.map +1 -1
- package/dist/node-types/agent-execute.d.ts +25 -8
- package/dist/node-types/agent-execute.d.ts.map +1 -1
- package/dist/node-types/agent-execute.js +89 -23
- package/dist/node-types/agent-execute.js.map +1 -1
- package/dist/node-types/bot-report.d.ts.map +1 -1
- package/dist/node-types/bot-report.js +24 -3
- package/dist/node-types/bot-report.js.map +1 -1
- package/dist/node-types/plan-task.d.ts +8 -17
- package/dist/node-types/plan-task.d.ts.map +1 -1
- package/dist/node-types/plan-task.js +217 -256
- package/dist/node-types/plan-task.js.map +1 -1
- package/dist/node-types/review-result.js +8 -6
- package/dist/node-types/review-result.js.map +1 -1
- package/dist/palindrome.d.ts +9 -0
- package/dist/palindrome.d.ts.map +1 -0
- package/dist/palindrome.js +14 -0
- package/dist/palindrome.js.map +1 -0
- package/dist/ui/approval-card.js +91 -82
- package/dist/ui/bot-activity.js +73 -56
- package/dist/ui/bot-config.js +48 -31
- package/dist/ui/bot-dashboard.js +52 -36
- package/dist/ui/bot-panel.js +230 -228
- package/dist/ui/bot-slot-card.js +100 -90
- package/dist/ui/bot-status.js +37 -15
- package/dist/ui/budget-bar.js +57 -31
- package/dist/ui/capability-editor.js +447 -378
- package/dist/ui/chat-task-result.js +78 -71
- package/dist/ui/decision-log.js +68 -81
- package/dist/ui/genesis-block.js +86 -95
- package/dist/ui/instance-stream-view.js +722 -0
- package/dist/ui/profile-card.js +96 -221
- package/dist/ui/profile-editor.js +532 -575
- package/dist/ui/settings-section.js +41 -45
- package/dist/ui/swarm-controls.js +212 -135
- package/dist/ui/swarm-dashboard.js +3992 -2715
- package/dist/ui/task-detail-view.js +415 -521
- package/dist/ui/task-editor.js +339 -390
- package/dist/ui/task-pool-list.js +60 -55
- package/dist/workflows/src/palindrome.d.ts +11 -0
- package/dist/workflows/src/palindrome.d.ts.map +1 -0
- package/dist/workflows/src/palindrome.js +16 -0
- package/dist/workflows/src/palindrome.js.map +1 -0
- package/dist/workflows/tests/palindrome.test.d.ts +2 -0
- package/dist/workflows/tests/palindrome.test.d.ts.map +1 -0
- package/dist/workflows/tests/palindrome.test.js +41 -0
- package/dist/workflows/tests/palindrome.test.js.map +1 -0
- package/dist/workflows/weaver-bot-batch.js +1 -1
- package/dist/workflows/weaver-bot-batch.js.map +1 -1
- package/dist/workflows/weaver-bot.js +1 -1
- package/dist/workflows/weaver-bot.js.map +1 -1
- package/flowweaver.manifest.json +1 -1
- package/package.json +8 -2
- package/src/ai-chat-provider.ts +5 -5
- package/src/bot/acceptance-merge.ts +62 -0
- package/src/bot/ai-client.ts +77 -21
- package/src/bot/assistant-tools.ts +3 -3
- package/src/bot/audit-logger.ts +42 -14
- package/src/bot/audit-trail.ts +211 -0
- package/src/bot/behavior-defaults.ts +7 -2
- package/src/bot/capability-registry.ts +84 -28
- package/src/bot/capability-types.ts +11 -0
- package/src/bot/cli-provider.ts +8 -7
- package/src/bot/preflight.ts +285 -0
- package/src/bot/provider-shim.ts +218 -0
- package/src/bot/runner.ts +68 -20
- package/src/bot/step-executor.ts +69 -127
- package/src/bot/swarm-controller.ts +94 -20
- package/src/bot/task-create-handler.ts +164 -0
- package/src/bot/task-store.ts +83 -0
- package/src/bot/types.ts +4 -1
- package/src/bot/weaver-tools.ts +7 -45
- package/src/node-types/agent-execute.ts +102 -16
- package/src/node-types/bot-report.ts +24 -3
- package/src/node-types/plan-task.ts +238 -280
- package/src/node-types/review-result.ts +8 -6
- package/src/palindrome.ts +14 -0
- package/src/ui/approval-card.tsx +78 -62
- package/src/ui/bot-activity.tsx +12 -10
- package/src/ui/bot-config.tsx +12 -10
- package/src/ui/bot-dashboard.tsx +13 -11
- package/src/ui/bot-panel.tsx +189 -171
- package/src/ui/bot-slot-card.tsx +125 -70
- package/src/ui/bot-status.tsx +4 -4
- package/src/ui/budget-bar.tsx +86 -25
- package/src/ui/capability-editor.tsx +392 -257
- package/src/ui/chat-task-result.tsx +81 -78
- package/src/ui/decision-log.tsx +76 -73
- package/src/ui/genesis-block.tsx +91 -61
- package/src/ui/instance-stream-view.tsx +861 -0
- package/src/ui/profile-card.tsx +195 -168
- package/src/ui/profile-editor.tsx +453 -370
- package/src/ui/settings-section.tsx +46 -39
- package/src/ui/swarm-controls.tsx +252 -123
- package/src/ui/swarm-dashboard.tsx +999 -466
- package/src/ui/task-detail-view.tsx +485 -428
- package/src/ui/task-editor.tsx +329 -271
- package/src/ui/task-pool-list.tsx +68 -62
- package/src/workflows/src/palindrome.ts +16 -0
- package/src/workflows/tests/palindrome.test.ts +49 -0
- package/src/workflows/weaver-bot-batch.ts +1 -1
- package/src/workflows/weaver-bot.ts +1 -1
- package/dist/ui/bot-constants.d.ts +0 -14
- package/dist/ui/bot-constants.d.ts.map +0 -1
- package/dist/ui/bot-constants.js +0 -189
- package/dist/ui/bot-constants.js.map +0 -1
- package/dist/ui/steer-api.d.ts +0 -7
- package/dist/ui/steer-api.d.ts.map +0 -1
- package/dist/ui/steer-api.js +0 -11
- package/dist/ui/steer-api.js.map +0 -1
- package/dist/ui/trace-to-timeline.d.ts +0 -91
- package/dist/ui/trace-to-timeline.d.ts.map +0 -1
- package/dist/ui/trace-to-timeline.js +0 -116
- package/dist/ui/trace-to-timeline.js.map +0 -1
- package/dist/ui/use-stream-timeline.d.ts +0 -50
- package/dist/ui/use-stream-timeline.d.ts.map +0 -1
- package/dist/ui/use-stream-timeline.js +0 -245
- package/dist/ui/use-stream-timeline.js.map +0 -1
package/dist/ui/task-editor.js
CHANGED
|
@@ -23,19 +23,9 @@ __export(task_editor_exports, {
|
|
|
23
23
|
default: () => task_editor_default
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(task_editor_exports);
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
Flex,
|
|
30
|
-
Typography,
|
|
31
|
-
Input,
|
|
32
|
-
Button,
|
|
33
|
-
IconButton,
|
|
34
|
-
Chip,
|
|
35
|
-
Field,
|
|
36
|
-
toast,
|
|
37
|
-
usePackWorkspace
|
|
38
|
-
} = require("@fw/plugin-ui-kit");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_plugin_ui_kit = require("@fw/plugin-ui-kit");
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
29
|
var PRIORITY_OPTIONS = [
|
|
40
30
|
{ id: "0", label: "0 - None" },
|
|
41
31
|
{ id: "1", label: "1 - Low" },
|
|
@@ -57,24 +47,24 @@ var STATUS_COLOR = {
|
|
|
57
47
|
"cancelled": "color-status-negative"
|
|
58
48
|
};
|
|
59
49
|
function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
|
|
60
|
-
const ctx = usePackWorkspace();
|
|
50
|
+
const ctx = (0, import_plugin_ui_kit.usePackWorkspace)();
|
|
61
51
|
const { callTool } = ctx;
|
|
62
|
-
const [title, setTitle] = useState("");
|
|
63
|
-
const [description, setDescription] = useState("");
|
|
64
|
-
const [priority, setPriority] = useState("0");
|
|
65
|
-
const [complexity, setComplexity] = useState("");
|
|
66
|
-
const [assignedProfile, setAssignedProfile] = useState("");
|
|
67
|
-
const [budgetCost, setBudgetCost] = useState("");
|
|
68
|
-
const [notes, setNotes] = useState("");
|
|
69
|
-
const [files, setFiles] = useState([]);
|
|
70
|
-
const [newFile, setNewFile] = useState("");
|
|
71
|
-
const [dependsOn, setDependsOn] = useState([]);
|
|
72
|
-
const [newDep, setNewDep] = useState("");
|
|
73
|
-
const [taskData, setTaskData] = useState(null);
|
|
74
|
-
const [profiles, setProfiles] = useState([]);
|
|
75
|
-
const [availableTasks, setAvailableTasks] = useState([]);
|
|
76
|
-
const [loading, setLoading] = useState(mode === "edit");
|
|
77
|
-
useEffect(() => {
|
|
52
|
+
const [title, setTitle] = (0, import_react.useState)("");
|
|
53
|
+
const [description, setDescription] = (0, import_react.useState)("");
|
|
54
|
+
const [priority, setPriority] = (0, import_react.useState)("0");
|
|
55
|
+
const [complexity, setComplexity] = (0, import_react.useState)("");
|
|
56
|
+
const [assignedProfile, setAssignedProfile] = (0, import_react.useState)("");
|
|
57
|
+
const [budgetCost, setBudgetCost] = (0, import_react.useState)("");
|
|
58
|
+
const [notes, setNotes] = (0, import_react.useState)("");
|
|
59
|
+
const [files, setFiles] = (0, import_react.useState)([]);
|
|
60
|
+
const [newFile, setNewFile] = (0, import_react.useState)("");
|
|
61
|
+
const [dependsOn, setDependsOn] = (0, import_react.useState)([]);
|
|
62
|
+
const [newDep, setNewDep] = (0, import_react.useState)("");
|
|
63
|
+
const [taskData, setTaskData] = (0, import_react.useState)(null);
|
|
64
|
+
const [profiles, setProfiles] = (0, import_react.useState)([]);
|
|
65
|
+
const [availableTasks, setAvailableTasks] = (0, import_react.useState)([]);
|
|
66
|
+
const [loading, setLoading] = (0, import_react.useState)(mode === "edit");
|
|
67
|
+
(0, import_react.useEffect)(() => {
|
|
78
68
|
(async () => {
|
|
79
69
|
try {
|
|
80
70
|
const raw = await callTool("fw_weaver_profile_list", {});
|
|
@@ -100,7 +90,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
|
|
|
100
90
|
}
|
|
101
91
|
})();
|
|
102
92
|
}, [callTool]);
|
|
103
|
-
useEffect(() => {
|
|
93
|
+
(0, import_react.useEffect)(() => {
|
|
104
94
|
if (mode !== "edit" || !taskId) return;
|
|
105
95
|
let cancelled = false;
|
|
106
96
|
(async () => {
|
|
@@ -110,7 +100,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
|
|
|
110
100
|
const data = typeof raw === "string" ? JSON.parse(raw) : raw;
|
|
111
101
|
const t = data?.task ?? data;
|
|
112
102
|
if (!t || !t.id) {
|
|
113
|
-
toast("Task not found", { type: "error" });
|
|
103
|
+
(0, import_plugin_ui_kit.toast)("Task not found", { type: "error" });
|
|
114
104
|
onCancel();
|
|
115
105
|
return;
|
|
116
106
|
}
|
|
@@ -125,7 +115,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
|
|
|
125
115
|
setFiles(t.context?.files || []);
|
|
126
116
|
setDependsOn(t.dependsOn || []);
|
|
127
117
|
} catch {
|
|
128
|
-
toast("Failed to load task", { type: "error" });
|
|
118
|
+
(0, import_plugin_ui_kit.toast)("Failed to load task", { type: "error" });
|
|
129
119
|
onCancel();
|
|
130
120
|
} finally {
|
|
131
121
|
if (!cancelled) setLoading(false);
|
|
@@ -135,14 +125,14 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
|
|
|
135
125
|
cancelled = true;
|
|
136
126
|
};
|
|
137
127
|
}, [mode, taskId, callTool]);
|
|
138
|
-
const isDirty = useCallback(() => {
|
|
128
|
+
const isDirty = (0, import_react.useCallback)(() => {
|
|
139
129
|
if (mode === "create") {
|
|
140
130
|
return !!(title.trim() || description.trim() || notes.trim() || files.length > 0 || dependsOn.length > 0 || priority !== "0" || complexity || assignedProfile || budgetCost);
|
|
141
131
|
}
|
|
142
132
|
if (!taskData) return false;
|
|
143
133
|
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 || "") || budgetCost !== (taskData.budgetCost != null ? String(taskData.budgetCost) : "");
|
|
144
134
|
}, [mode, title, description, notes, files, dependsOn, priority, complexity, assignedProfile, budgetCost, taskData]);
|
|
145
|
-
const handleBack = useCallback(async () => {
|
|
135
|
+
const handleBack = (0, import_react.useCallback)(async () => {
|
|
146
136
|
if (isDirty()) {
|
|
147
137
|
const ok = await ctx.confirm("Discard unsaved changes?", {
|
|
148
138
|
title: "Unsaved Changes",
|
|
@@ -152,27 +142,27 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
|
|
|
152
142
|
}
|
|
153
143
|
onCancel();
|
|
154
144
|
}, [isDirty, ctx, onCancel]);
|
|
155
|
-
const handleAddFile = useCallback(() => {
|
|
145
|
+
const handleAddFile = (0, import_react.useCallback)(() => {
|
|
156
146
|
const trimmed = newFile.trim();
|
|
157
147
|
if (!trimmed) return;
|
|
158
148
|
setFiles((prev) => [...prev, trimmed]);
|
|
159
149
|
setNewFile("");
|
|
160
150
|
}, [newFile]);
|
|
161
|
-
const handleRemoveFile = useCallback((index) => {
|
|
151
|
+
const handleRemoveFile = (0, import_react.useCallback)((index) => {
|
|
162
152
|
setFiles((prev) => prev.filter((_, i) => i !== index));
|
|
163
153
|
}, []);
|
|
164
|
-
const handleAddDep = useCallback(() => {
|
|
154
|
+
const handleAddDep = (0, import_react.useCallback)(() => {
|
|
165
155
|
const trimmed = newDep.trim();
|
|
166
156
|
if (!trimmed) return;
|
|
167
157
|
setDependsOn((prev) => [...prev, trimmed]);
|
|
168
158
|
setNewDep("");
|
|
169
159
|
}, [newDep]);
|
|
170
|
-
const handleRemoveDep = useCallback((index) => {
|
|
160
|
+
const handleRemoveDep = (0, import_react.useCallback)((index) => {
|
|
171
161
|
setDependsOn((prev) => prev.filter((_, i) => i !== index));
|
|
172
162
|
}, []);
|
|
173
|
-
const handleSave = useCallback(async () => {
|
|
163
|
+
const handleSave = (0, import_react.useCallback)(async () => {
|
|
174
164
|
if (!title.trim()) {
|
|
175
|
-
toast("Title is required", { type: "error" });
|
|
165
|
+
(0, import_plugin_ui_kit.toast)("Title is required", { type: "error" });
|
|
176
166
|
return;
|
|
177
167
|
}
|
|
178
168
|
try {
|
|
@@ -200,7 +190,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
|
|
|
200
190
|
}
|
|
201
191
|
});
|
|
202
192
|
}
|
|
203
|
-
toast("Task created", { type: "success" });
|
|
193
|
+
(0, import_plugin_ui_kit.toast)("Task created", { type: "success" });
|
|
204
194
|
} else {
|
|
205
195
|
const patch = {
|
|
206
196
|
id: taskId,
|
|
@@ -222,14 +212,14 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
|
|
|
222
212
|
stagnationCount: taskData?.context?.stagnationCount ?? 0
|
|
223
213
|
};
|
|
224
214
|
await callTool("fw_weaver_task_update", patch);
|
|
225
|
-
toast("Task updated", { type: "success" });
|
|
215
|
+
(0, import_plugin_ui_kit.toast)("Task updated", { type: "success" });
|
|
226
216
|
}
|
|
227
217
|
onSave();
|
|
228
218
|
} catch (err) {
|
|
229
|
-
toast(err instanceof Error ? err.message : `Failed to ${mode} task`, { type: "error" });
|
|
219
|
+
(0, import_plugin_ui_kit.toast)(err instanceof Error ? err.message : `Failed to ${mode} task`, { type: "error" });
|
|
230
220
|
}
|
|
231
221
|
}, [mode, taskId, title, description, priority, complexity, assignedProfile, budgetCost, notes, files, dependsOn, taskData, callTool, onSave]);
|
|
232
|
-
const handleDelete = useCallback(async () => {
|
|
222
|
+
const handleDelete = (0, import_react.useCallback)(async () => {
|
|
233
223
|
if (!taskId) return;
|
|
234
224
|
const ok = await ctx.confirm("Are you sure you want to cancel this task?", {
|
|
235
225
|
title: "Cancel Task",
|
|
@@ -239,373 +229,332 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
|
|
|
239
229
|
if (!ok) return;
|
|
240
230
|
try {
|
|
241
231
|
await callTool("fw_weaver_task_cancel", { id: taskId });
|
|
242
|
-
toast("Task cancelled", { type: "success" });
|
|
232
|
+
(0, import_plugin_ui_kit.toast)("Task cancelled", { type: "success" });
|
|
243
233
|
if (onDelete) onDelete();
|
|
244
234
|
} catch (err) {
|
|
245
|
-
toast(err instanceof Error ? err.message : "Failed to cancel task", { type: "error" });
|
|
235
|
+
(0, import_plugin_ui_kit.toast)(err instanceof Error ? err.message : "Failed to cancel task", { type: "error" });
|
|
246
236
|
}
|
|
247
237
|
}, [taskId, callTool, onDelete, ctx]);
|
|
248
238
|
if (loading) {
|
|
249
|
-
return
|
|
250
|
-
Flex,
|
|
239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
240
|
+
import_plugin_ui_kit.Flex,
|
|
251
241
|
{
|
|
252
242
|
variant: "column-center-center-nowrap-12",
|
|
253
|
-
style: { padding: "24px 16px" }
|
|
254
|
-
|
|
255
|
-
|
|
243
|
+
style: { padding: "24px 16px" },
|
|
244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-regular", color: "color-text-subtle", children: "Loading task..." })
|
|
245
|
+
}
|
|
256
246
|
);
|
|
257
247
|
}
|
|
258
248
|
const profileOptions = [
|
|
259
249
|
{ id: "", label: "Not assigned" },
|
|
260
250
|
...profiles.map((p) => ({ id: p.id, label: p.name }))
|
|
261
251
|
];
|
|
262
|
-
return
|
|
263
|
-
Flex,
|
|
252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
253
|
+
import_plugin_ui_kit.Flex,
|
|
264
254
|
{
|
|
265
255
|
variant: "column-stretch-start-nowrap-0",
|
|
266
|
-
style: { width: "100%", height: "100%", overflow: "hidden" }
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
)
|
|
290
|
-
),
|
|
291
|
-
mode === "edit" && onDelete && React.createElement(IconButton, {
|
|
292
|
-
icon: "outlinedDelete",
|
|
293
|
-
size: "sm",
|
|
294
|
-
variant: "clear",
|
|
295
|
-
color: "danger",
|
|
296
|
-
onClick: handleDelete,
|
|
297
|
-
title: "Cancel task"
|
|
298
|
-
})
|
|
299
|
-
),
|
|
300
|
-
// -- Scrollable form body --
|
|
301
|
-
React.createElement(
|
|
302
|
-
Flex,
|
|
303
|
-
{
|
|
304
|
-
variant: "column-stretch-start-nowrap-10",
|
|
305
|
-
style: { flex: 1, minHeight: 0, overflow: "auto", padding: "12px 16px" }
|
|
306
|
-
},
|
|
307
|
-
// -- Edit-only: Status tag --
|
|
308
|
-
mode === "edit" && taskData && React.createElement(
|
|
309
|
-
Field,
|
|
310
|
-
{ label: "Status" },
|
|
311
|
-
React.createElement(Chip, {
|
|
312
|
-
label: taskData.status,
|
|
313
|
-
size: "small",
|
|
314
|
-
color: STATUS_COLOR[taskData.status] || "color-brand-alt"
|
|
315
|
-
})
|
|
316
|
-
),
|
|
317
|
-
// -- Title --
|
|
318
|
-
React.createElement(
|
|
319
|
-
Field,
|
|
320
|
-
{ label: "Title" },
|
|
321
|
-
React.createElement(Input, {
|
|
322
|
-
type: "text",
|
|
323
|
-
size: "small",
|
|
324
|
-
placeholder: "Task title (required)",
|
|
325
|
-
value: title,
|
|
326
|
-
onChange: (v) => setTitle(v),
|
|
327
|
-
defaultBoxStyle: { flex: 1, minWidth: 0 },
|
|
328
|
-
inputBoxStyle: { maxWidth: "none" }
|
|
329
|
-
})
|
|
330
|
-
),
|
|
331
|
-
// -- Description --
|
|
332
|
-
React.createElement(
|
|
333
|
-
Field,
|
|
334
|
-
{ label: "Description" },
|
|
335
|
-
React.createElement(Input, {
|
|
336
|
-
type: "text",
|
|
337
|
-
size: "small",
|
|
338
|
-
placeholder: "Detailed task description",
|
|
339
|
-
value: description,
|
|
340
|
-
onChange: (v) => setDescription(v),
|
|
341
|
-
defaultBoxStyle: { flex: 1, minWidth: 0 },
|
|
342
|
-
inputBoxStyle: { maxWidth: "none" }
|
|
343
|
-
})
|
|
344
|
-
),
|
|
345
|
-
// -- Priority --
|
|
346
|
-
React.createElement(
|
|
347
|
-
Field,
|
|
348
|
-
{ label: "Priority" },
|
|
349
|
-
React.createElement(Input, {
|
|
350
|
-
type: "select",
|
|
351
|
-
size: "small",
|
|
352
|
-
options: PRIORITY_OPTIONS,
|
|
353
|
-
optionId: priority,
|
|
354
|
-
onChange: (id) => setPriority(id),
|
|
355
|
-
defaultBoxStyle: { flex: 1, minWidth: 0 }
|
|
356
|
-
})
|
|
357
|
-
),
|
|
358
|
-
// -- Complexity --
|
|
359
|
-
React.createElement(
|
|
360
|
-
Field,
|
|
361
|
-
{ label: "Complexity" },
|
|
362
|
-
React.createElement(Input, {
|
|
363
|
-
type: "select",
|
|
364
|
-
size: "small",
|
|
365
|
-
options: COMPLEXITY_OPTIONS,
|
|
366
|
-
optionId: complexity,
|
|
367
|
-
onChange: (id) => setComplexity(id),
|
|
368
|
-
defaultBoxStyle: { flex: 1, minWidth: 0 }
|
|
369
|
-
})
|
|
370
|
-
),
|
|
371
|
-
// -- Assigned Profile --
|
|
372
|
-
React.createElement(
|
|
373
|
-
Field,
|
|
374
|
-
{ label: "Profile" },
|
|
375
|
-
React.createElement(Input, {
|
|
376
|
-
type: "select",
|
|
377
|
-
size: "small",
|
|
378
|
-
options: profileOptions,
|
|
379
|
-
optionId: assignedProfile,
|
|
380
|
-
onChange: (id) => setAssignedProfile(id),
|
|
381
|
-
placeholder: "Select profile",
|
|
382
|
-
defaultBoxStyle: { flex: 1, minWidth: 0 }
|
|
383
|
-
})
|
|
384
|
-
),
|
|
385
|
-
// -- Budget Cost --
|
|
386
|
-
React.createElement(
|
|
387
|
-
Field,
|
|
388
|
-
{ label: "Budget Cost" },
|
|
389
|
-
React.createElement(Input, {
|
|
390
|
-
type: "number",
|
|
391
|
-
size: "small",
|
|
392
|
-
placeholder: "Optional cost limit (USD)",
|
|
393
|
-
value: budgetCost,
|
|
394
|
-
onChange: (v) => setBudgetCost(v)
|
|
395
|
-
})
|
|
396
|
-
),
|
|
397
|
-
// -- Notes --
|
|
398
|
-
React.createElement(
|
|
399
|
-
Field,
|
|
400
|
-
{ label: "Notes", align: "start" },
|
|
401
|
-
React.createElement(Input, {
|
|
402
|
-
type: "text",
|
|
403
|
-
size: "small",
|
|
404
|
-
multiline: true,
|
|
405
|
-
placeholder: "Optional notes for context",
|
|
406
|
-
value: notes,
|
|
407
|
-
onChange: (v) => setNotes(v),
|
|
408
|
-
defaultBoxStyle: { flex: 1, minWidth: 0 },
|
|
409
|
-
inputBoxStyle: { maxWidth: "none" }
|
|
410
|
-
})
|
|
411
|
-
),
|
|
412
|
-
// -- Files --
|
|
413
|
-
React.createElement(
|
|
414
|
-
Field,
|
|
415
|
-
{ label: "Files", align: "start" },
|
|
416
|
-
React.createElement(
|
|
417
|
-
Flex,
|
|
418
|
-
{ variant: "column-stretch-start-nowrap-6" },
|
|
419
|
-
// File picker
|
|
420
|
-
React.createElement(Input, {
|
|
421
|
-
type: "path",
|
|
422
|
-
size: "small",
|
|
423
|
-
placeholder: "Click to browse files",
|
|
424
|
-
value: "",
|
|
425
|
-
onClick: async () => {
|
|
426
|
-
const selected = await ctx.browseFiles({ title: "Select Files", multiple: true });
|
|
427
|
-
if (selected.length > 0) {
|
|
428
|
-
setFiles((prev) => {
|
|
429
|
-
const unique = selected.filter((f) => !prev.includes(f));
|
|
430
|
-
return [...prev, ...unique];
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
},
|
|
434
|
-
defaultBoxStyle: { flex: 1, minWidth: 0 }
|
|
435
|
-
}),
|
|
436
|
-
...files.map(
|
|
437
|
-
(file, idx) => React.createElement(
|
|
438
|
-
Flex,
|
|
439
|
-
{
|
|
440
|
-
key: `file-${idx}`,
|
|
441
|
-
variant: "row-center-start-nowrap-6",
|
|
442
|
-
style: { paddingLeft: "4px" }
|
|
443
|
-
},
|
|
444
|
-
React.createElement(Typography, {
|
|
445
|
-
variant: "smallCaption-regular",
|
|
446
|
-
color: "color-text-high",
|
|
447
|
-
style: { flex: 1, minWidth: 0, fontFamily: "var(--font-mono, monospace)" }
|
|
448
|
-
}, file),
|
|
449
|
-
React.createElement(IconButton, {
|
|
450
|
-
icon: "close",
|
|
451
|
-
size: "xs",
|
|
452
|
-
variant: "clear",
|
|
453
|
-
color: "danger",
|
|
454
|
-
onClick: () => handleRemoveFile(idx)
|
|
455
|
-
})
|
|
456
|
-
)
|
|
457
|
-
)
|
|
458
|
-
)
|
|
459
|
-
),
|
|
460
|
-
// -- Dependencies --
|
|
461
|
-
React.createElement(
|
|
462
|
-
Field,
|
|
463
|
-
{ label: "Dependencies", align: "start" },
|
|
464
|
-
React.createElement(
|
|
465
|
-
Flex,
|
|
466
|
-
{ variant: "column-stretch-start-nowrap-6" },
|
|
467
|
-
// Add dependency row (create mode only)
|
|
468
|
-
mode === "create" && React.createElement(
|
|
469
|
-
Flex,
|
|
470
|
-
{ variant: "row-center-start-nowrap-4" },
|
|
471
|
-
React.createElement(Input, {
|
|
472
|
-
type: "select",
|
|
473
|
-
size: "small",
|
|
474
|
-
placeholder: "Select a task",
|
|
475
|
-
options: availableTasks.filter((t) => !dependsOn.includes(t.id) && t.id !== taskId).map((t) => ({ id: t.id, label: t.title })),
|
|
476
|
-
optionId: newDep,
|
|
477
|
-
onChange: (v) => setNewDep(v),
|
|
478
|
-
defaultBoxStyle: { flex: 1, minWidth: 0 }
|
|
479
|
-
}),
|
|
480
|
-
React.createElement(IconButton, {
|
|
481
|
-
icon: "add",
|
|
482
|
-
size: "sm",
|
|
483
|
-
variant: "outlined",
|
|
484
|
-
color: "primary",
|
|
485
|
-
onClick: handleAddDep,
|
|
486
|
-
disabled: !newDep.trim()
|
|
487
|
-
})
|
|
488
|
-
),
|
|
489
|
-
// Dependency list
|
|
490
|
-
dependsOn.length > 0 ? React.createElement(
|
|
491
|
-
Flex,
|
|
492
|
-
{ variant: "column-stretch-start-nowrap-4" },
|
|
493
|
-
...dependsOn.map(
|
|
494
|
-
(dep, idx) => React.createElement(
|
|
495
|
-
Flex,
|
|
256
|
+
style: { width: "100%", height: "100%", overflow: "hidden" },
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
259
|
+
import_plugin_ui_kit.Flex,
|
|
260
|
+
{
|
|
261
|
+
variant: "row-center-space-between-nowrap-8",
|
|
262
|
+
style: { padding: "8px 16px", flexShrink: 0, borderBottom: "1px solid var(--color-border-default)" },
|
|
263
|
+
children: [
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "row-center-start-nowrap-8", children: [
|
|
265
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
266
|
+
import_plugin_ui_kit.IconButton,
|
|
267
|
+
{
|
|
268
|
+
icon: "back",
|
|
269
|
+
size: "xs",
|
|
270
|
+
variant: "clear",
|
|
271
|
+
onClick: handleBack,
|
|
272
|
+
title: "Back"
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-thick", color: "color-text-high", children: mode === "create" ? "Create Task" : "Edit Task" })
|
|
276
|
+
] }),
|
|
277
|
+
mode === "edit" && onDelete && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
278
|
+
import_plugin_ui_kit.IconButton,
|
|
496
279
|
{
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
style: { paddingLeft: "4px" }
|
|
500
|
-
},
|
|
501
|
-
React.createElement(Typography, {
|
|
502
|
-
variant: "smallCaption-regular",
|
|
503
|
-
color: "color-text-high",
|
|
504
|
-
style: { flex: 1, minWidth: 0 }
|
|
505
|
-
}, (() => {
|
|
506
|
-
const t = availableTasks.find((t2) => t2.id === dep);
|
|
507
|
-
return t ? t.title : dep;
|
|
508
|
-
})()),
|
|
509
|
-
mode === "create" && React.createElement(IconButton, {
|
|
510
|
-
icon: "close",
|
|
511
|
-
size: "xs",
|
|
280
|
+
icon: "outlinedDelete",
|
|
281
|
+
size: "sm",
|
|
512
282
|
variant: "clear",
|
|
513
283
|
color: "danger",
|
|
514
|
-
onClick:
|
|
515
|
-
|
|
284
|
+
onClick: handleDelete,
|
|
285
|
+
title: "Cancel task"
|
|
286
|
+
}
|
|
516
287
|
)
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
variant: "smallCaption-regular",
|
|
520
|
-
color: "color-text-subtle",
|
|
521
|
-
style: { paddingLeft: "4px" }
|
|
522
|
-
}, "None"),
|
|
523
|
-
mode === "edit" && React.createElement(Typography, {
|
|
524
|
-
variant: "smallCaption-regular",
|
|
525
|
-
color: "color-text-subtle",
|
|
526
|
-
style: { paddingLeft: "4px", fontStyle: "italic" }
|
|
527
|
-
}, "Dependencies cannot be changed after creation")
|
|
528
|
-
)
|
|
529
|
-
),
|
|
530
|
-
// -- Edit-only: read-only metadata --
|
|
531
|
-
mode === "edit" && taskData && React.createElement(
|
|
532
|
-
Flex,
|
|
533
|
-
{
|
|
534
|
-
variant: "column-stretch-start-nowrap-10",
|
|
535
|
-
style: { marginTop: 8, paddingTop: 12, borderTop: "1px solid var(--color-border-default)" }
|
|
536
|
-
},
|
|
537
|
-
React.createElement(
|
|
538
|
-
Field,
|
|
539
|
-
{ label: "Created by" },
|
|
540
|
-
React.createElement(
|
|
541
|
-
Typography,
|
|
542
|
-
{ variant: "smallCaption-regular", color: "color-text-medium" },
|
|
543
|
-
taskData.createdBy || "unknown"
|
|
544
|
-
)
|
|
545
|
-
),
|
|
546
|
-
React.createElement(
|
|
547
|
-
Field,
|
|
548
|
-
{ label: "Created at" },
|
|
549
|
-
React.createElement(
|
|
550
|
-
Typography,
|
|
551
|
-
{ variant: "smallCaption-regular", color: "color-text-medium" },
|
|
552
|
-
taskData.createdAt ? new Date(taskData.createdAt).toLocaleString() : "-"
|
|
553
|
-
)
|
|
288
|
+
]
|
|
289
|
+
}
|
|
554
290
|
),
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
{
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
291
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
292
|
+
import_plugin_ui_kit.Flex,
|
|
293
|
+
{
|
|
294
|
+
variant: "column-stretch-start-nowrap-10",
|
|
295
|
+
style: { flex: 1, minHeight: 0, overflow: "auto", padding: "12px 16px" },
|
|
296
|
+
children: [
|
|
297
|
+
mode === "edit" && taskData && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Status", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
298
|
+
import_plugin_ui_kit.Chip,
|
|
299
|
+
{
|
|
300
|
+
label: taskData.status,
|
|
301
|
+
size: "small",
|
|
302
|
+
color: STATUS_COLOR[taskData.status] || "color-brand-alt"
|
|
303
|
+
}
|
|
304
|
+
) }),
|
|
305
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Title", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
306
|
+
import_plugin_ui_kit.Input,
|
|
307
|
+
{
|
|
308
|
+
type: "text",
|
|
309
|
+
size: "small",
|
|
310
|
+
placeholder: "Task title (required)",
|
|
311
|
+
value: title,
|
|
312
|
+
onChange: (v) => setTitle(v),
|
|
313
|
+
defaultBoxStyle: { flex: 1, minWidth: 0 },
|
|
314
|
+
inputBoxStyle: { maxWidth: "none" }
|
|
315
|
+
}
|
|
316
|
+
) }),
|
|
317
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Description", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
318
|
+
import_plugin_ui_kit.Input,
|
|
319
|
+
{
|
|
320
|
+
type: "text",
|
|
321
|
+
size: "small",
|
|
322
|
+
placeholder: "Detailed task description",
|
|
323
|
+
value: description,
|
|
324
|
+
onChange: (v) => setDescription(v),
|
|
325
|
+
defaultBoxStyle: { flex: 1, minWidth: 0 },
|
|
326
|
+
inputBoxStyle: { maxWidth: "none" }
|
|
327
|
+
}
|
|
328
|
+
) }),
|
|
329
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Priority", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
330
|
+
import_plugin_ui_kit.Input,
|
|
331
|
+
{
|
|
332
|
+
type: "select",
|
|
333
|
+
size: "small",
|
|
334
|
+
options: PRIORITY_OPTIONS,
|
|
335
|
+
optionId: priority,
|
|
336
|
+
onChange: (id) => setPriority(id),
|
|
337
|
+
defaultBoxStyle: { flex: 1, minWidth: 0 }
|
|
338
|
+
}
|
|
339
|
+
) }),
|
|
340
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Complexity", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
341
|
+
import_plugin_ui_kit.Input,
|
|
342
|
+
{
|
|
343
|
+
type: "select",
|
|
344
|
+
size: "small",
|
|
345
|
+
options: COMPLEXITY_OPTIONS,
|
|
346
|
+
optionId: complexity,
|
|
347
|
+
onChange: (id) => setComplexity(id),
|
|
348
|
+
defaultBoxStyle: { flex: 1, minWidth: 0 }
|
|
349
|
+
}
|
|
350
|
+
) }),
|
|
351
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Profile", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
352
|
+
import_plugin_ui_kit.Input,
|
|
353
|
+
{
|
|
354
|
+
type: "select",
|
|
355
|
+
size: "small",
|
|
356
|
+
options: profileOptions,
|
|
357
|
+
optionId: assignedProfile,
|
|
358
|
+
onChange: (id) => setAssignedProfile(id),
|
|
359
|
+
placeholder: "Select profile",
|
|
360
|
+
defaultBoxStyle: { flex: 1, minWidth: 0 }
|
|
361
|
+
}
|
|
362
|
+
) }),
|
|
363
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Budget Cost", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
364
|
+
import_plugin_ui_kit.Input,
|
|
365
|
+
{
|
|
366
|
+
type: "number",
|
|
367
|
+
size: "small",
|
|
368
|
+
placeholder: "Optional cost limit (USD)",
|
|
369
|
+
value: budgetCost,
|
|
370
|
+
onChange: (v) => setBudgetCost(v)
|
|
371
|
+
}
|
|
372
|
+
) }),
|
|
373
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Notes", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
374
|
+
import_plugin_ui_kit.Input,
|
|
375
|
+
{
|
|
376
|
+
type: "text",
|
|
377
|
+
size: "small",
|
|
378
|
+
multiline: true,
|
|
379
|
+
placeholder: "Optional notes for context",
|
|
380
|
+
value: notes,
|
|
381
|
+
onChange: (v) => setNotes(v),
|
|
382
|
+
defaultBoxStyle: { flex: 1, minWidth: 0 },
|
|
383
|
+
inputBoxStyle: { maxWidth: "none" }
|
|
384
|
+
}
|
|
385
|
+
) }),
|
|
386
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Files", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "column-stretch-start-nowrap-6", children: [
|
|
387
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
388
|
+
import_plugin_ui_kit.Input,
|
|
389
|
+
{
|
|
390
|
+
type: "path",
|
|
391
|
+
size: "small",
|
|
392
|
+
placeholder: "Click to browse files",
|
|
393
|
+
value: "",
|
|
394
|
+
onClick: async () => {
|
|
395
|
+
const selected = await ctx.browseFiles({ title: "Select Files", multiple: true });
|
|
396
|
+
if (selected.length > 0) {
|
|
397
|
+
setFiles((prev) => {
|
|
398
|
+
const unique = selected.filter((f) => !prev.includes(f));
|
|
399
|
+
return [...prev, ...unique];
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
defaultBoxStyle: { flex: 1, minWidth: 0 }
|
|
404
|
+
}
|
|
405
|
+
),
|
|
406
|
+
files.map((file, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
407
|
+
import_plugin_ui_kit.Flex,
|
|
408
|
+
{
|
|
409
|
+
variant: "row-center-start-nowrap-6",
|
|
410
|
+
style: { paddingLeft: "4px" },
|
|
411
|
+
children: [
|
|
412
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
413
|
+
import_plugin_ui_kit.Typography,
|
|
414
|
+
{
|
|
415
|
+
variant: "smallCaption-regular",
|
|
416
|
+
color: "color-text-high",
|
|
417
|
+
style: { flex: 1, minWidth: 0, fontFamily: "var(--font-mono, monospace)" },
|
|
418
|
+
children: file
|
|
419
|
+
}
|
|
420
|
+
),
|
|
421
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
422
|
+
import_plugin_ui_kit.IconButton,
|
|
423
|
+
{
|
|
424
|
+
icon: "close",
|
|
425
|
+
size: "xs",
|
|
426
|
+
variant: "clear",
|
|
427
|
+
color: "danger",
|
|
428
|
+
onClick: () => handleRemoveFile(idx)
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
`file-${idx}`
|
|
434
|
+
))
|
|
435
|
+
] }) }),
|
|
436
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Dependencies", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "column-stretch-start-nowrap-6", children: [
|
|
437
|
+
mode === "create" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "row-center-start-nowrap-4", children: [
|
|
438
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
439
|
+
import_plugin_ui_kit.Input,
|
|
440
|
+
{
|
|
441
|
+
type: "select",
|
|
442
|
+
size: "small",
|
|
443
|
+
placeholder: "Select a task",
|
|
444
|
+
options: availableTasks.filter((t) => !dependsOn.includes(t.id) && t.id !== taskId).map((t) => ({ id: t.id, label: t.title })),
|
|
445
|
+
optionId: newDep,
|
|
446
|
+
onChange: (v) => setNewDep(v),
|
|
447
|
+
defaultBoxStyle: { flex: 1, minWidth: 0 }
|
|
448
|
+
}
|
|
449
|
+
),
|
|
450
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
451
|
+
import_plugin_ui_kit.IconButton,
|
|
452
|
+
{
|
|
453
|
+
icon: "add",
|
|
454
|
+
size: "sm",
|
|
455
|
+
variant: "outlined",
|
|
456
|
+
color: "primary",
|
|
457
|
+
onClick: handleAddDep,
|
|
458
|
+
disabled: !newDep.trim()
|
|
459
|
+
}
|
|
460
|
+
)
|
|
461
|
+
] }),
|
|
462
|
+
dependsOn.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Flex, { variant: "column-stretch-start-nowrap-4", children: dependsOn.map((dep, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
463
|
+
import_plugin_ui_kit.Flex,
|
|
464
|
+
{
|
|
465
|
+
variant: "row-center-start-nowrap-6",
|
|
466
|
+
style: { paddingLeft: "4px" },
|
|
467
|
+
children: [
|
|
468
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
469
|
+
import_plugin_ui_kit.Typography,
|
|
470
|
+
{
|
|
471
|
+
variant: "smallCaption-regular",
|
|
472
|
+
color: "color-text-high",
|
|
473
|
+
style: { flex: 1, minWidth: 0 },
|
|
474
|
+
children: (() => {
|
|
475
|
+
const t = availableTasks.find((t2) => t2.id === dep);
|
|
476
|
+
return t ? t.title : dep;
|
|
477
|
+
})()
|
|
478
|
+
}
|
|
479
|
+
),
|
|
480
|
+
mode === "create" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
481
|
+
import_plugin_ui_kit.IconButton,
|
|
482
|
+
{
|
|
483
|
+
icon: "close",
|
|
484
|
+
size: "xs",
|
|
485
|
+
variant: "clear",
|
|
486
|
+
color: "danger",
|
|
487
|
+
onClick: () => handleRemoveDep(idx)
|
|
488
|
+
}
|
|
489
|
+
)
|
|
490
|
+
]
|
|
491
|
+
},
|
|
492
|
+
`dep-${idx}`
|
|
493
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
494
|
+
import_plugin_ui_kit.Typography,
|
|
495
|
+
{
|
|
496
|
+
variant: "smallCaption-regular",
|
|
497
|
+
color: "color-text-subtle",
|
|
498
|
+
style: { paddingLeft: "4px" },
|
|
499
|
+
children: "None"
|
|
500
|
+
}
|
|
501
|
+
),
|
|
502
|
+
mode === "edit" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
503
|
+
import_plugin_ui_kit.Typography,
|
|
504
|
+
{
|
|
505
|
+
variant: "smallCaption-regular",
|
|
506
|
+
color: "color-text-subtle",
|
|
507
|
+
style: { paddingLeft: "4px", fontStyle: "italic" },
|
|
508
|
+
children: "Dependencies cannot be changed after creation"
|
|
509
|
+
}
|
|
510
|
+
)
|
|
511
|
+
] }) }),
|
|
512
|
+
mode === "edit" && taskData && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
513
|
+
import_plugin_ui_kit.Flex,
|
|
514
|
+
{
|
|
515
|
+
variant: "column-stretch-start-nowrap-10",
|
|
516
|
+
style: { marginTop: 8, paddingTop: 12, borderTop: "1px solid var(--color-border-default)" },
|
|
517
|
+
children: [
|
|
518
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Created by", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-medium", children: taskData.createdBy || "unknown" }) }),
|
|
519
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Created at", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-medium", children: taskData.createdAt ? new Date(taskData.createdAt).toLocaleString() : "-" }) }),
|
|
520
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Updated at", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-medium", children: taskData.updatedAt ? new Date(taskData.updatedAt).toLocaleString() : "-" }) }),
|
|
521
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Tokens used", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-medium", children: (taskData.tokensUsed ?? 0).toLocaleString() }) }),
|
|
522
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Cost used", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-medium", children: `$${(taskData.costUsed ?? 0).toFixed(3)}` }) }),
|
|
523
|
+
taskData.context?.runHistory?.slice(-1)?.[0]?.remainingWork && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Field, { label: "Remaining work", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
524
|
+
import_plugin_ui_kit.Typography,
|
|
525
|
+
{
|
|
526
|
+
variant: "smallCaption-regular",
|
|
527
|
+
color: "color-status-caution",
|
|
528
|
+
style: { fontFamily: "var(--font-mono, monospace)", whiteSpace: "pre-wrap" },
|
|
529
|
+
children: taskData.context.runHistory.slice(-1)[0]?.remainingWork
|
|
530
|
+
}
|
|
531
|
+
) })
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
)
|
|
535
|
+
]
|
|
536
|
+
}
|
|
581
537
|
),
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
{
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
539
|
+
import_plugin_ui_kit.Flex,
|
|
540
|
+
{
|
|
541
|
+
variant: "row-center-end-nowrap-8",
|
|
542
|
+
style: { padding: "8px 16px", flexShrink: 0, borderTop: "1px solid var(--color-border-default)" },
|
|
543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
544
|
+
import_plugin_ui_kit.Button,
|
|
545
|
+
{
|
|
546
|
+
size: "xs",
|
|
547
|
+
variant: "fill",
|
|
548
|
+
color: "primary",
|
|
549
|
+
onClick: handleSave,
|
|
550
|
+
disabled: !title.trim(),
|
|
551
|
+
children: mode === "create" ? "Create" : "Save"
|
|
552
|
+
}
|
|
553
|
+
)
|
|
554
|
+
}
|
|
590
555
|
)
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
// -- Footer bar with save button --
|
|
594
|
-
React.createElement(
|
|
595
|
-
Flex,
|
|
596
|
-
{
|
|
597
|
-
variant: "row-center-end-nowrap-8",
|
|
598
|
-
style: { padding: "8px 16px", flexShrink: 0, borderTop: "1px solid var(--color-border-default)" }
|
|
599
|
-
},
|
|
600
|
-
React.createElement(Button, {
|
|
601
|
-
size: "xs",
|
|
602
|
-
variant: "fill",
|
|
603
|
-
color: "primary",
|
|
604
|
-
onClick: handleSave,
|
|
605
|
-
disabled: !title.trim()
|
|
606
|
-
}, mode === "create" ? "Create" : "Save")
|
|
607
|
-
)
|
|
556
|
+
]
|
|
557
|
+
}
|
|
608
558
|
);
|
|
609
559
|
}
|
|
610
560
|
var task_editor_default = TaskEditor;
|
|
611
|
-
module.exports = TaskEditor;
|