@synergenius/flow-weaver-pack-weaver 0.9.86 → 0.9.87

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.
@@ -1613,6 +1613,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
1613
1613
  const [newDep, setNewDep] = useState5("");
1614
1614
  const [taskData, setTaskData] = useState5(null);
1615
1615
  const [profiles, setProfiles] = useState5([]);
1616
+ const [availableTasks, setAvailableTasks] = useState5([]);
1616
1617
  const [loading, setLoading] = useState5(mode === "edit");
1617
1618
  useEffect3(() => {
1618
1619
  (async () => {
@@ -1627,6 +1628,17 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
1627
1628
  }
1628
1629
  } catch {
1629
1630
  }
1631
+ try {
1632
+ const taskRaw = await callTool("fw_weaver_task_list", {});
1633
+ const taskData2 = typeof taskRaw === "string" ? JSON.parse(taskRaw) : taskRaw;
1634
+ if (Array.isArray(taskData2)) {
1635
+ setAvailableTasks(taskData2.map((t) => ({
1636
+ id: t.id,
1637
+ title: t.title || t.id
1638
+ })));
1639
+ }
1640
+ } catch {
1641
+ }
1630
1642
  })();
1631
1643
  }, [callTool]);
1632
1644
  useEffect3(() => {
@@ -1928,9 +1940,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
1928
1940
  size: "small",
1929
1941
  placeholder: "3",
1930
1942
  value: maxAttempts,
1931
- onChange: (v) => setMaxAttempts(v),
1932
- defaultBoxStyle: { flex: 1, minWidth: 0 },
1933
- inputBoxStyle: { maxWidth: "none" }
1943
+ onChange: (v) => setMaxAttempts(v)
1934
1944
  })
1935
1945
  ),
1936
1946
  // -- Budget Tokens --
@@ -1942,9 +1952,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
1942
1952
  size: "small",
1943
1953
  placeholder: "Optional token limit",
1944
1954
  value: budgetTokens,
1945
- onChange: (v) => setBudgetTokens(v),
1946
- defaultBoxStyle: { flex: 1, minWidth: 0 },
1947
- inputBoxStyle: { maxWidth: "none" }
1955
+ onChange: (v) => setBudgetTokens(v)
1948
1956
  })
1949
1957
  ),
1950
1958
  // -- Budget Cost --
@@ -1956,18 +1964,17 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
1956
1964
  size: "small",
1957
1965
  placeholder: "Optional cost limit (USD)",
1958
1966
  value: budgetCost,
1959
- onChange: (v) => setBudgetCost(v),
1960
- defaultBoxStyle: { flex: 1, minWidth: 0 },
1961
- inputBoxStyle: { maxWidth: "none" }
1967
+ onChange: (v) => setBudgetCost(v)
1962
1968
  })
1963
1969
  ),
1964
1970
  // -- Notes --
1965
1971
  React7.createElement(
1966
1972
  Field,
1967
- { label: "Notes" },
1973
+ { label: "Notes", align: "start" },
1968
1974
  React7.createElement(Input, {
1969
1975
  type: "text",
1970
1976
  size: "small",
1977
+ multiline: true,
1971
1978
  placeholder: "Optional notes for context",
1972
1979
  value: notes,
1973
1980
  onChange: (v) => setNotes(v),
@@ -1985,11 +1992,26 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
1985
1992
  // Add file row
1986
1993
  React7.createElement(
1987
1994
  Flex6,
1988
- { variant: "row-center-start-nowrap-4", style: { overflow: "hidden" } },
1995
+ { variant: "row-center-start-nowrap-4" },
1996
+ React7.createElement(Button3, {
1997
+ size: "xs",
1998
+ variant: "outlined",
1999
+ color: "primary",
2000
+ leftIcon: "filePresent",
2001
+ onClick: async () => {
2002
+ const selected = await ctx.browseFiles({ title: "Select Files", multiple: true });
2003
+ if (selected.length > 0) {
2004
+ setFiles((prev) => {
2005
+ const unique = selected.filter((f) => !prev.includes(f));
2006
+ return [...prev, ...unique];
2007
+ });
2008
+ }
2009
+ }
2010
+ }, "Browse"),
1989
2011
  React7.createElement(Input, {
1990
2012
  type: "text",
1991
2013
  size: "small",
1992
- placeholder: "File path",
2014
+ placeholder: "Or type a path and press Enter",
1993
2015
  value: newFile,
1994
2016
  onChange: (v) => setNewFile(v),
1995
2017
  onEnter: handleAddFile,
@@ -2039,16 +2061,15 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
2039
2061
  // Add dependency row (create mode only)
2040
2062
  mode === "create" && React7.createElement(
2041
2063
  Flex6,
2042
- { variant: "row-center-start-nowrap-4", style: { overflow: "hidden" } },
2064
+ { variant: "row-center-start-nowrap-4" },
2043
2065
  React7.createElement(Input, {
2044
- type: "text",
2066
+ type: "select",
2045
2067
  size: "small",
2046
- placeholder: "Task ID",
2047
- value: newDep,
2068
+ placeholder: "Select a task",
2069
+ options: availableTasks.filter((t) => !deps.includes(t.id) && t.id !== taskId).map((t) => ({ id: t.id, label: t.title })),
2070
+ optionId: newDep,
2048
2071
  onChange: (v) => setNewDep(v),
2049
- onEnter: handleAddDep,
2050
- defaultBoxStyle: { flex: 1, minWidth: 0 },
2051
- inputBoxStyle: { maxWidth: "none" }
2072
+ defaultBoxStyle: { flex: 1, minWidth: 0 }
2052
2073
  }),
2053
2074
  React7.createElement(IconButton4, {
2054
2075
  icon: "add",
@@ -2074,8 +2095,11 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
2074
2095
  React7.createElement(Typography6, {
2075
2096
  variant: "smallCaption-regular",
2076
2097
  color: "color-text-high",
2077
- style: { flex: 1, minWidth: 0, fontFamily: "var(--font-mono, monospace)" }
2078
- }, dep),
2098
+ style: { flex: 1, minWidth: 0 }
2099
+ }, (() => {
2100
+ const t = availableTasks.find((t2) => t2.id === dep);
2101
+ return t ? t.title : dep;
2102
+ })()),
2079
2103
  mode === "create" && React7.createElement(IconButton4, {
2080
2104
  icon: "close",
2081
2105
  size: "xs",
@@ -76,6 +76,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
76
76
  const [newDep, setNewDep] = useState("");
77
77
  const [taskData, setTaskData] = useState(null);
78
78
  const [profiles, setProfiles] = useState([]);
79
+ const [availableTasks, setAvailableTasks] = useState([]);
79
80
  const [loading, setLoading] = useState(mode === "edit");
80
81
  useEffect(() => {
81
82
  (async () => {
@@ -90,6 +91,17 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
90
91
  }
91
92
  } catch {
92
93
  }
94
+ try {
95
+ const taskRaw = await callTool("fw_weaver_task_list", {});
96
+ const taskData2 = typeof taskRaw === "string" ? JSON.parse(taskRaw) : taskRaw;
97
+ if (Array.isArray(taskData2)) {
98
+ setAvailableTasks(taskData2.map((t) => ({
99
+ id: t.id,
100
+ title: t.title || t.id
101
+ })));
102
+ }
103
+ } catch {
104
+ }
93
105
  })();
94
106
  }, [callTool]);
95
107
  useEffect(() => {
@@ -391,9 +403,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
391
403
  size: "small",
392
404
  placeholder: "3",
393
405
  value: maxAttempts,
394
- onChange: (v) => setMaxAttempts(v),
395
- defaultBoxStyle: { flex: 1, minWidth: 0 },
396
- inputBoxStyle: { maxWidth: "none" }
406
+ onChange: (v) => setMaxAttempts(v)
397
407
  })
398
408
  ),
399
409
  // -- Budget Tokens --
@@ -405,9 +415,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
405
415
  size: "small",
406
416
  placeholder: "Optional token limit",
407
417
  value: budgetTokens,
408
- onChange: (v) => setBudgetTokens(v),
409
- defaultBoxStyle: { flex: 1, minWidth: 0 },
410
- inputBoxStyle: { maxWidth: "none" }
418
+ onChange: (v) => setBudgetTokens(v)
411
419
  })
412
420
  ),
413
421
  // -- Budget Cost --
@@ -419,18 +427,17 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
419
427
  size: "small",
420
428
  placeholder: "Optional cost limit (USD)",
421
429
  value: budgetCost,
422
- onChange: (v) => setBudgetCost(v),
423
- defaultBoxStyle: { flex: 1, minWidth: 0 },
424
- inputBoxStyle: { maxWidth: "none" }
430
+ onChange: (v) => setBudgetCost(v)
425
431
  })
426
432
  ),
427
433
  // -- Notes --
428
434
  React.createElement(
429
435
  Field,
430
- { label: "Notes" },
436
+ { label: "Notes", align: "start" },
431
437
  React.createElement(Input, {
432
438
  type: "text",
433
439
  size: "small",
440
+ multiline: true,
434
441
  placeholder: "Optional notes for context",
435
442
  value: notes,
436
443
  onChange: (v) => setNotes(v),
@@ -448,11 +455,26 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
448
455
  // Add file row
449
456
  React.createElement(
450
457
  Flex,
451
- { variant: "row-center-start-nowrap-4", style: { overflow: "hidden" } },
458
+ { variant: "row-center-start-nowrap-4" },
459
+ React.createElement(Button, {
460
+ size: "xs",
461
+ variant: "outlined",
462
+ color: "primary",
463
+ leftIcon: "filePresent",
464
+ onClick: async () => {
465
+ const selected = await ctx.browseFiles({ title: "Select Files", multiple: true });
466
+ if (selected.length > 0) {
467
+ setFiles((prev) => {
468
+ const unique = selected.filter((f) => !prev.includes(f));
469
+ return [...prev, ...unique];
470
+ });
471
+ }
472
+ }
473
+ }, "Browse"),
452
474
  React.createElement(Input, {
453
475
  type: "text",
454
476
  size: "small",
455
- placeholder: "File path",
477
+ placeholder: "Or type a path and press Enter",
456
478
  value: newFile,
457
479
  onChange: (v) => setNewFile(v),
458
480
  onEnter: handleAddFile,
@@ -502,16 +524,15 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
502
524
  // Add dependency row (create mode only)
503
525
  mode === "create" && React.createElement(
504
526
  Flex,
505
- { variant: "row-center-start-nowrap-4", style: { overflow: "hidden" } },
527
+ { variant: "row-center-start-nowrap-4" },
506
528
  React.createElement(Input, {
507
- type: "text",
529
+ type: "select",
508
530
  size: "small",
509
- placeholder: "Task ID",
510
- value: newDep,
531
+ placeholder: "Select a task",
532
+ options: availableTasks.filter((t) => !deps.includes(t.id) && t.id !== taskId).map((t) => ({ id: t.id, label: t.title })),
533
+ optionId: newDep,
511
534
  onChange: (v) => setNewDep(v),
512
- onEnter: handleAddDep,
513
- defaultBoxStyle: { flex: 1, minWidth: 0 },
514
- inputBoxStyle: { maxWidth: "none" }
535
+ defaultBoxStyle: { flex: 1, minWidth: 0 }
515
536
  }),
516
537
  React.createElement(IconButton, {
517
538
  icon: "add",
@@ -537,8 +558,11 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }) {
537
558
  React.createElement(Typography, {
538
559
  variant: "smallCaption-regular",
539
560
  color: "color-text-high",
540
- style: { flex: 1, minWidth: 0, fontFamily: "var(--font-mono, monospace)" }
541
- }, dep),
561
+ style: { flex: 1, minWidth: 0 }
562
+ }, (() => {
563
+ const t = availableTasks.find((t2) => t2.id === dep);
564
+ return t ? t.title : dep;
565
+ })()),
542
566
  mode === "create" && React.createElement(IconButton, {
543
567
  icon: "close",
544
568
  size: "xs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver-pack-weaver",
3
- "version": "0.9.86",
3
+ "version": "0.9.87",
4
4
  "description": "AI bot for Flow Weaver. Execute tasks, run workflows, evolve autonomously.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -113,6 +113,8 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
113
113
 
114
114
  // --- Profiles for select ---
115
115
  const [profiles, setProfiles] = useState<Array<{ id: string; name: string }>>([]);
116
+ // --- Tasks for dependency select ---
117
+ const [availableTasks, setAvailableTasks] = useState<Array<{ id: string; title: string }>>([]);
116
118
 
117
119
  const [loading, setLoading] = useState(mode === 'edit');
118
120
 
@@ -129,6 +131,17 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
129
131
  })));
130
132
  }
131
133
  } catch { /* non-fatal */ }
134
+ // Also fetch task list for dependency picker
135
+ try {
136
+ const taskRaw = await callTool('fw_weaver_task_list', {});
137
+ const taskData = typeof taskRaw === 'string' ? JSON.parse(taskRaw) : taskRaw;
138
+ if (Array.isArray(taskData)) {
139
+ setAvailableTasks(taskData.map((t: Record<string, unknown>) => ({
140
+ id: t.id as string,
141
+ title: (t.title as string) || (t.id as string),
142
+ })));
143
+ }
144
+ } catch { /* non-fatal */ }
132
145
  })();
133
146
  }, [callTool]);
134
147
 
@@ -443,8 +456,6 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
443
456
  placeholder: '3',
444
457
  value: maxAttempts,
445
458
  onChange: (v: string) => setMaxAttempts(v),
446
- defaultBoxStyle: { flex: 1, minWidth: 0 },
447
- inputBoxStyle: { maxWidth: 'none' },
448
459
  }),
449
460
  ),
450
461
 
@@ -455,8 +466,6 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
455
466
  placeholder: 'Optional token limit',
456
467
  value: budgetTokens,
457
468
  onChange: (v: string) => setBudgetTokens(v),
458
- defaultBoxStyle: { flex: 1, minWidth: 0 },
459
- inputBoxStyle: { maxWidth: 'none' },
460
469
  }),
461
470
  ),
462
471
 
@@ -467,15 +476,14 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
467
476
  placeholder: 'Optional cost limit (USD)',
468
477
  value: budgetCost,
469
478
  onChange: (v: string) => setBudgetCost(v),
470
- defaultBoxStyle: { flex: 1, minWidth: 0 },
471
- inputBoxStyle: { maxWidth: 'none' },
472
479
  }),
473
480
  ),
474
481
 
475
482
  // -- Notes --
476
- React.createElement(Field, { label: 'Notes' },
483
+ React.createElement(Field, { label: 'Notes', align: 'start' },
477
484
  React.createElement(Input, {
478
485
  type: 'text', size: 'small',
486
+ multiline: true,
479
487
  placeholder: 'Optional notes for context',
480
488
  value: notes,
481
489
  onChange: (v: string) => setNotes(v),
@@ -488,10 +496,23 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
488
496
  React.createElement(Field, { label: 'Files', align: 'start' },
489
497
  React.createElement(Flex, { variant: 'column-stretch-start-nowrap-6' },
490
498
  // Add file row
491
- React.createElement(Flex, { variant: 'row-center-start-nowrap-4', style: { overflow: 'hidden' } },
499
+ React.createElement(Flex, { variant: 'row-center-start-nowrap-4' },
500
+ React.createElement(Button, {
501
+ size: 'xs', variant: 'outlined', color: 'primary',
502
+ leftIcon: 'filePresent',
503
+ onClick: async () => {
504
+ const selected = await ctx.browseFiles({ title: 'Select Files', multiple: true });
505
+ if (selected.length > 0) {
506
+ setFiles((prev: string[]) => {
507
+ const unique = selected.filter((f: string) => !prev.includes(f));
508
+ return [...prev, ...unique];
509
+ });
510
+ }
511
+ },
512
+ }, 'Browse'),
492
513
  React.createElement(Input, {
493
514
  type: 'text', size: 'small',
494
- placeholder: 'File path',
515
+ placeholder: 'Or type a path and press Enter',
495
516
  value: newFile,
496
517
  onChange: (v: string) => setNewFile(v),
497
518
  onEnter: handleAddFile,
@@ -528,15 +549,16 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
528
549
  React.createElement(Field, { label: 'Dependencies', align: 'start' },
529
550
  React.createElement(Flex, { variant: 'column-stretch-start-nowrap-6' },
530
551
  // Add dependency row (create mode only)
531
- mode === 'create' && React.createElement(Flex, { variant: 'row-center-start-nowrap-4', style: { overflow: 'hidden' } },
552
+ mode === 'create' && React.createElement(Flex, { variant: 'row-center-start-nowrap-4' },
532
553
  React.createElement(Input, {
533
- type: 'text', size: 'small',
534
- placeholder: 'Task ID',
535
- value: newDep,
554
+ type: 'select', size: 'small',
555
+ placeholder: 'Select a task',
556
+ options: availableTasks
557
+ .filter((t: { id: string }) => !deps.includes(t.id) && t.id !== taskId)
558
+ .map((t: { id: string; title: string }) => ({ id: t.id, label: t.title })),
559
+ optionId: newDep,
536
560
  onChange: (v: string) => setNewDep(v),
537
- onEnter: handleAddDep,
538
561
  defaultBoxStyle: { flex: 1, minWidth: 0 },
539
- inputBoxStyle: { maxWidth: 'none' },
540
562
  }),
541
563
  React.createElement(IconButton, {
542
564
  icon: 'add', size: 'sm', variant: 'outlined', color: 'primary',
@@ -555,8 +577,8 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
555
577
  },
556
578
  React.createElement(Typography, {
557
579
  variant: 'smallCaption-regular', color: 'color-text-high',
558
- style: { flex: 1, minWidth: 0, fontFamily: 'var(--font-mono, monospace)' },
559
- }, dep),
580
+ style: { flex: 1, minWidth: 0 },
581
+ }, (() => { const t = availableTasks.find((t: { id: string }) => t.id === dep); return t ? t.title : dep; })()),
560
582
  mode === 'create' && React.createElement(IconButton, {
561
583
  icon: 'close', size: 'xs', variant: 'clear', color: 'danger',
562
584
  onClick: () => handleRemoveDep(idx),