@lukeashford/aurelius 3.6.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4645,11 +4645,12 @@ var ChatInput = React59.forwardRef(
4645
4645
  acceptedFileTypes,
4646
4646
  notice,
4647
4647
  onInputChange,
4648
+ initialInputValue = "",
4648
4649
  autoFocus = false,
4649
4650
  className,
4650
4651
  ...rest
4651
4652
  }, ref) => {
4652
- const [value, setValue] = useState13("");
4653
+ const [value, setValue] = useState13(initialInputValue);
4653
4654
  const [localAttachments, setLocalAttachments] = useState13([]);
4654
4655
  const [isDragOver, setIsDragOver] = useState13(false);
4655
4656
  const textareaRef = useRef8(null);
@@ -6305,15 +6306,13 @@ function sortTasks(tasks) {
6305
6306
  function TaskItem({ task, depth = 0 }) {
6306
6307
  const isTerminal = task.status === "done" || task.status === "cancelled" || task.status === "failed";
6307
6308
  const isSubtle = task.status === "cancelled" || task.status === "failed";
6308
- const showSubtasks = (task.status === "in_progress" || task.status === "done") && task.subtasks && task.subtasks.length > 0;
6309
+ const showSubtasks = task.subtasks && task.subtasks.length > 0;
6309
6310
  const sortedSubtasks = showSubtasks ? sortTasks(task.subtasks) : [];
6310
6311
  return /* @__PURE__ */ React71.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React71.createElement(
6311
6312
  "div",
6312
6313
  {
6313
- className: cx(
6314
- "flex items-center gap-2 py-1",
6315
- depth > 0 && "pl-6"
6316
- )
6314
+ className: "flex items-center gap-2 py-1",
6315
+ style: { paddingLeft: `${depth * 1.5}rem` }
6317
6316
  },
6318
6317
  /* @__PURE__ */ React71.createElement(TaskIcon, { status: task.status }),
6319
6318
  /* @__PURE__ */ React71.createElement(
@@ -6335,8 +6334,12 @@ function TaskItem({ task, depth = 0 }) {
6335
6334
  }
6336
6335
  function hasInProgressTask(tasks) {
6337
6336
  return tasks.some((t) => {
6338
- if (t.status === "in_progress") return true;
6339
- if (t.subtasks && t.subtasks.length > 0) return hasInProgressTask(t.subtasks);
6337
+ if (t.status === "in_progress") {
6338
+ return true;
6339
+ }
6340
+ if (t.subtasks && t.subtasks.length > 0) {
6341
+ return hasInProgressTask(t.subtasks);
6342
+ }
6340
6343
  return false;
6341
6344
  });
6342
6345
  }
@@ -6345,7 +6348,9 @@ var TodosList = React71.forwardRef(
6345
6348
  const sortedTasks = useMemo4(() => sortTasks(tasks), [tasks]);
6346
6349
  const [isStopping, setIsStopping] = useState18(false);
6347
6350
  const handleStopClick = useCallback17(async () => {
6348
- if (!onStopAllTasks || isStopping) return;
6351
+ if (!onStopAllTasks || isStopping) {
6352
+ return;
6353
+ }
6349
6354
  try {
6350
6355
  setIsStopping(true);
6351
6356
  await onStopAllTasks();
@@ -6354,25 +6359,10 @@ var TodosList = React71.forwardRef(
6354
6359
  }
6355
6360
  }, [onStopAllTasks, isStopping]);
6356
6361
  const countCompleted = (taskList) => {
6357
- let count = 0;
6358
- for (const task of taskList) {
6359
- if (task.status === "done") {
6360
- count++;
6361
- }
6362
- if (task.subtasks) {
6363
- count += countCompleted(task.subtasks);
6364
- }
6365
- }
6366
- return count;
6362
+ return taskList.filter((task) => task.status === "done").length;
6367
6363
  };
6368
6364
  const countTotal = (taskList) => {
6369
- let count = taskList.length;
6370
- for (const task of taskList) {
6371
- if (task.subtasks) {
6372
- count += countTotal(task.subtasks);
6373
- }
6374
- }
6375
- return count;
6365
+ return taskList.length;
6376
6366
  };
6377
6367
  const showStopButton = !!onStopAllTasks && (hasInProgressTask(tasks) || isStopping);
6378
6368
  if (tasks.length === 0) {
@@ -6424,8 +6414,12 @@ TodosList.displayName = "TodosList";
6424
6414
  function areAllTasksSettled(tasks) {
6425
6415
  return tasks.every((t) => {
6426
6416
  const settled = t.status === "done" || t.status === "cancelled" || t.status === "failed";
6427
- if (!settled) return false;
6428
- if (t.subtasks && t.subtasks.length > 0) return areAllTasksSettled(t.subtasks);
6417
+ if (!settled) {
6418
+ return false;
6419
+ }
6420
+ if (t.subtasks && t.subtasks.length > 0) {
6421
+ return areAllTasksSettled(t.subtasks);
6422
+ }
6429
6423
  return true;
6430
6424
  });
6431
6425
  }
@@ -6695,6 +6689,7 @@ var ChatInterface = React74.forwardRef(
6695
6689
  onStopAllTasks,
6696
6690
  inputNotice,
6697
6691
  onInputChange,
6692
+ initialInputValue = "",
6698
6693
  tools: externalTools = [],
6699
6694
  autoFocus = true,
6700
6695
  className,
@@ -6990,6 +6985,7 @@ var ChatInterface = React74.forwardRef(
6990
6985
  onAttachmentsChange,
6991
6986
  notice: inputNotice,
6992
6987
  onInputChange,
6988
+ initialInputValue,
6993
6989
  autoFocus
6994
6990
  }
6995
6991
  )), /* @__PURE__ */ React74.createElement("div", { className: cx(