@arbidocs/blocks 0.4.27 → 0.4.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +17 -0
  2. package/dist/agents/index.cjs +224 -212
  3. package/dist/agents/index.js +6 -6
  4. package/dist/agents/tasks/TaskRowMenu.d.ts +4 -1
  5. package/dist/agents/tasks/TaskRunsDialog.d.ts +3 -1
  6. package/dist/agents/tasks/taskRows.d.ts +2 -0
  7. package/dist/agents/workflows/WorkflowDocumentsField.d.ts +12 -0
  8. package/dist/agents/workflows/index.d.ts +2 -0
  9. package/dist/agents/workflows/workspaceScope.d.ts +18 -0
  10. package/dist/chat/ChatPage.d.ts +1 -1
  11. package/dist/chat/chat-page-types.d.ts +12 -1
  12. package/dist/chat/index.cjs +129 -129
  13. package/dist/chat/index.js +2 -2
  14. package/dist/chunk-4XJZ6AAY.js +407 -0
  15. package/dist/chunk-4XJZ6AAY.js.map +1 -0
  16. package/dist/{chunk-UOLMFC5K.js → chunk-6YVI74BC.js} +498 -108
  17. package/dist/chunk-6YVI74BC.js.map +1 -0
  18. package/dist/{chunk-CQ6CYPV4.js → chunk-7FF473XB.js} +7 -119
  19. package/dist/chunk-7FF473XB.js.map +1 -0
  20. package/dist/{chunk-ZEIOREJY.js → chunk-EHXSBH6U.js} +37 -6
  21. package/dist/chunk-EHXSBH6U.js.map +1 -0
  22. package/dist/chunk-EYPPB5CY.cjs +85 -0
  23. package/dist/chunk-EYPPB5CY.cjs.map +1 -0
  24. package/dist/{chunk-ENY6XXKR.js → chunk-I7FJS7WG.js} +155 -39
  25. package/dist/chunk-I7FJS7WG.js.map +1 -0
  26. package/dist/{chunk-557EU3G4.js → chunk-JLOYWXRB.js} +3 -3
  27. package/dist/{chunk-557EU3G4.js.map → chunk-JLOYWXRB.js.map} +1 -1
  28. package/dist/chunk-KF4EC5XU.js +68 -0
  29. package/dist/chunk-KF4EC5XU.js.map +1 -0
  30. package/dist/{chunk-3ZXXHROK.cjs → chunk-L6YRTT5M.cjs} +158 -39
  31. package/dist/chunk-L6YRTT5M.cjs.map +1 -0
  32. package/dist/chunk-S5HZBXZA.cjs +430 -0
  33. package/dist/chunk-S5HZBXZA.cjs.map +1 -0
  34. package/dist/{chunk-JCVZKCXC.cjs → chunk-TLQQV7WW.cjs} +37 -6
  35. package/dist/chunk-TLQQV7WW.cjs.map +1 -0
  36. package/dist/{chunk-NNH7N62N.cjs → chunk-VMCOH3AY.cjs} +497 -105
  37. package/dist/chunk-VMCOH3AY.cjs.map +1 -0
  38. package/dist/{chunk-JLPYOPCX.js → chunk-WSJVHSGN.js} +225 -36
  39. package/dist/chunk-WSJVHSGN.js.map +1 -0
  40. package/dist/{chunk-DCEI37AX.cjs → chunk-YVIOCITQ.cjs} +3 -3
  41. package/dist/{chunk-DCEI37AX.cjs.map → chunk-YVIOCITQ.cjs.map} +1 -1
  42. package/dist/{chunk-J22DXUJY.cjs → chunk-ZHLMDJCO.cjs} +226 -34
  43. package/dist/chunk-ZHLMDJCO.cjs.map +1 -0
  44. package/dist/{chunk-TL2DHSC5.cjs → chunk-ZXGBUHES.cjs} +5 -120
  45. package/dist/chunk-ZXGBUHES.cjs.map +1 -0
  46. package/dist/connect/docx.cjs +26 -8
  47. package/dist/connect/docx.cjs.map +1 -1
  48. package/dist/connect/docx.d.ts +1 -0
  49. package/dist/connect/docx.js +24 -7
  50. package/dist/connect/docx.js.map +1 -1
  51. package/dist/connect/index.cjs +303 -61
  52. package/dist/connect/index.cjs.map +1 -1
  53. package/dist/connect/index.d.ts +4 -0
  54. package/dist/connect/index.js +263 -25
  55. package/dist/connect/index.js.map +1 -1
  56. package/dist/connection/ConnectedAgentChatPanel.d.ts +7 -0
  57. package/dist/connection/ConnectedNativeDocxEditor.d.ts +2 -1
  58. package/dist/connection/ConnectedSkillUpload.d.ts +2 -0
  59. package/dist/connection/ConnectedStreamedWordArtifact.d.ts +4 -0
  60. package/dist/connection/ConnectedTaskAccessRequest.d.ts +4 -0
  61. package/dist/connection/ai.d.ts +4 -1
  62. package/dist/connection/useConnectedWorkNotifications.d.ts +21 -0
  63. package/dist/docx/DocxMentions.d.ts +9 -2
  64. package/dist/docx/NativeDocxEditor.d.ts +11 -3
  65. package/dist/docx/StreamedWordArtifact.d.ts +15 -0
  66. package/dist/docx/index.cjs +16 -8
  67. package/dist/docx/index.d.ts +3 -2
  68. package/dist/docx/index.js +2 -2
  69. package/dist/docx/streamWordDocument.d.ts +12 -0
  70. package/dist/facts/index.cjs +1 -1
  71. package/dist/facts/index.js +1 -1
  72. package/dist/files/index.cjs +3 -3
  73. package/dist/files/index.js +3 -3
  74. package/dist/index.cjs +778 -766
  75. package/dist/index.js +15 -15
  76. package/dist/settings/index.cjs +42 -232
  77. package/dist/settings/index.cjs.map +1 -1
  78. package/dist/settings/index.js +7 -203
  79. package/dist/settings/index.js.map +1 -1
  80. package/dist/site/index.cjs +5 -5
  81. package/dist/site/index.js +1 -1
  82. package/dist/studio/index.cjs +7 -6
  83. package/dist/studio/index.cjs.map +1 -1
  84. package/dist/studio/index.js +5 -4
  85. package/dist/studio/index.js.map +1 -1
  86. package/dist/workspaces/index.cjs +2 -2
  87. package/dist/workspaces/index.js +2 -2
  88. package/package.json +3 -3
  89. package/src/docx/styles.css +13 -0
  90. package/dist/chunk-3ZXXHROK.cjs.map +0 -1
  91. package/dist/chunk-5TRALRWN.js +0 -42
  92. package/dist/chunk-5TRALRWN.js.map +0 -1
  93. package/dist/chunk-CQ6CYPV4.js.map +0 -1
  94. package/dist/chunk-CQCC7LE7.js +0 -210
  95. package/dist/chunk-CQCC7LE7.js.map +0 -1
  96. package/dist/chunk-ENY6XXKR.js.map +0 -1
  97. package/dist/chunk-EUOGPUMJ.cjs +0 -59
  98. package/dist/chunk-EUOGPUMJ.cjs.map +0 -1
  99. package/dist/chunk-J22DXUJY.cjs.map +0 -1
  100. package/dist/chunk-JCVZKCXC.cjs.map +0 -1
  101. package/dist/chunk-JLPYOPCX.js.map +0 -1
  102. package/dist/chunk-NNH7N62N.cjs.map +0 -1
  103. package/dist/chunk-RFIBUWLF.cjs +0 -232
  104. package/dist/chunk-RFIBUWLF.cjs.map +0 -1
  105. package/dist/chunk-TL2DHSC5.cjs.map +0 -1
  106. package/dist/chunk-UOLMFC5K.js.map +0 -1
  107. package/dist/chunk-ZEIOREJY.js.map +0 -1
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import { EmptyState } from './chunk-P6GHJSLR.js';
3
- import { GridView, SelectionBar, SelectionBarAction } from './chunk-NUPVHEJW.js';
4
3
  import { FoldSection, QuickActionDialogHeader, AddFilesFirst, ScopePicker, StartTiles } from './chunk-NJL4LIXX.js';
5
- import { MultiSelect } from './chunk-CQCC7LE7.js';
6
- import { ToneBadge } from './chunk-DPLRHEJZ.js';
7
4
  import { ActionLink } from './chunk-S7PSMMRG.js';
5
+ import { GridView, SelectionBar, SelectionBarAction } from './chunk-NUPVHEJW.js';
6
+ import { DocumentPicker, MultiSelect } from './chunk-4XJZ6AAY.js';
8
7
  import { TabHeader } from './chunk-UBNVIIBT.js';
9
- import { ModalHeader } from './chunk-CPMNAJLF.js';
8
+ import { ToneBadge } from './chunk-DPLRHEJZ.js';
10
9
  import { useBlocksEnvironment } from './chunk-76JDDMSP.js';
11
10
  import { formatCount, initials } from './chunk-OXF2IFXG.js';
11
+ import { ModalHeader } from './chunk-CPMNAJLF.js';
12
12
  import { testIdOr, prefixedTestId } from './chunk-7F6CBP3Z.js';
13
13
  import { memo, forwardRef, useState, useMemo, useId, useEffect, useRef, useCallback } from 'react';
14
14
  import { cn, Label, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Textarea, Input, Switch, Button, Collapsible, CollapsibleTrigger, CollapsibleContent, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Tooltip, TooltipTrigger, TooltipContent, Badge, Slider, UserEntity, getEntityColorStyles, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandItem, VisibilityToggle, EntityPill, DropdownMenuSeparator } from '@arbidocs/react/ui';
@@ -612,10 +612,8 @@ function WorkflowConfigDialog({
612
612
  }) {
613
613
  const l = { ...DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, ...labels };
614
614
  const initialKey = JSON.stringify(initialInputs ?? {});
615
- const seed = useMemo(
616
- () => ({ ...defaultInputs(workflow), ...JSON.parse(initialKey) }),
617
- [workflow, initialKey]
618
- );
615
+ const seedKey = JSON.stringify({ ...defaultInputs(workflow), ...JSON.parse(initialKey) });
616
+ const seed = useMemo(() => JSON.parse(seedKey), [seedKey]);
619
617
  const [inputs, setInputs] = useControllableState(inputsProp, seed, onInputsChange);
620
618
  const [agentId, setAgentId] = useControllableState(
621
619
  agentIdProp,
@@ -885,6 +883,93 @@ function WorkflowLauncher({
885
883
  )
886
884
  ] });
887
885
  }
886
+
887
+ // src/agents/workflows/workspaceScope.ts
888
+ var canonical = (path) => (path ?? "").split("/").map((part) => part.trim()).filter(Boolean).join("/");
889
+ function matchWorkflowScope(docs, scope) {
890
+ if (scope.documents?.length) {
891
+ const ids = new Set(scope.documents);
892
+ return docs.filter((doc) => ids.has(doc.external_id));
893
+ }
894
+ if (!scope.folders.length && !scope.labels.length) return docs;
895
+ const folders = scope.folders.map(canonical);
896
+ const labels = new Set(scope.labels);
897
+ return docs.filter((doc) => {
898
+ const folder = canonical(doc.folder);
899
+ return folders.some(
900
+ (path) => path === "" ? folder === "" : folder === path || folder.startsWith(`${path}/`)
901
+ ) || doc.doctags?.some((tag) => labels.has(tag.tag_ext_id));
902
+ });
903
+ }
904
+ function buildWorkflowScopeSource(docs, labels = []) {
905
+ const counts = /* @__PURE__ */ new Map();
906
+ for (const doc of docs) {
907
+ const parts = canonical(doc.folder).split("/").filter(Boolean);
908
+ for (let i = 1; i <= parts.length; i++) {
909
+ const path = parts.slice(0, i).join("/");
910
+ counts.set(path, (counts.get(path) ?? 0) + 1);
911
+ }
912
+ }
913
+ return {
914
+ folders: [...counts].sort(([a], [b]) => a.localeCompare(b)).map(([path, count]) => ({
915
+ path,
916
+ count,
917
+ label: path.split("/").at(-1),
918
+ depth: path.split("/").length - 1
919
+ })),
920
+ unfiledCount: docs.filter((doc) => !canonical(doc.folder)).length,
921
+ labels: labels.map((label) => ({
922
+ id: label.external_id,
923
+ name: label.name,
924
+ color: label.color ?? "currentColor",
925
+ count: docs.filter((doc) => doc.doctags?.some((tag) => tag.tag_ext_id === label.external_id)).length
926
+ })),
927
+ totalCount: docs.length,
928
+ countMatching: (scope) => matchWorkflowScope(docs, scope).length,
929
+ resolveDocuments: (scope) => matchWorkflowScope(docs, scope).map((doc) => doc.external_id)
930
+ };
931
+ }
932
+ function WorkflowDocumentsField({
933
+ field,
934
+ value,
935
+ onChange,
936
+ documents,
937
+ addFilesAction
938
+ }) {
939
+ const ids = value.documents ?? [];
940
+ const max = field.max ?? 1;
941
+ const set = (documents2) => onChange({ ...value, documents: documents2 });
942
+ return /* @__PURE__ */ jsxs("div", { "data-testid": `workflow-documents-${field.name}`, className: "space-y-2", children: [
943
+ /* @__PURE__ */ jsx(
944
+ DocumentPicker,
945
+ {
946
+ groups: [{ id: "workspace", docs: documents }],
947
+ value: ids[0] ?? "",
948
+ selected: documents.find((doc) => doc.id === ids[0]),
949
+ selectedIds: max > 1 ? ids : void 0,
950
+ onValueChange: (id) => set(
951
+ ids.includes(id) ? ids.filter((selected) => selected !== id) : [...ids, id].slice(-max)
952
+ )
953
+ }
954
+ ),
955
+ ids.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: ids.map((id) => /* @__PURE__ */ jsxs(
956
+ Button,
957
+ {
958
+ type: "button",
959
+ variant: "outline",
960
+ size: "sm",
961
+ onClick: () => set(ids.filter((selected) => selected !== id)),
962
+ "aria-label": `Remove ${documents.find((doc) => doc.id === id)?.title ?? id}`,
963
+ children: [
964
+ documents.find((doc) => doc.id === id)?.title ?? id,
965
+ " \xD7"
966
+ ]
967
+ },
968
+ id
969
+ )) }),
970
+ addFilesAction
971
+ ] });
972
+ }
888
973
  var DEFAULT_AGENT_CARD_LABELS = {
889
974
  running: "Running",
890
975
  runningIndicator: "Running",
@@ -3330,7 +3415,7 @@ function TaskReviewActions({
3330
3415
  // src/agents/tasks/taskRows.ts
3331
3416
  var MAX_TASK_DEPTH = 5;
3332
3417
  var ownerExtId = (task) => task.signoff_ext_id || task.owner_ext_id || task.created_by_ext_id || null;
3333
- var isPlainTodo = (task) => !task.agent_ext_id && !task.skill_ref;
3418
+ var isPlainTodo = (task) => !task.agent_ext_id && !task.has_agent_action && !task.skill_ref;
3334
3419
  function indexTasks(tasks) {
3335
3420
  const byId = new Map(tasks.map((t) => [t.external_id, t]));
3336
3421
  const kids = /* @__PURE__ */ new Map();
@@ -3480,12 +3565,14 @@ function TaskRowMenu({
3480
3565
  onMoveTo,
3481
3566
  onChangeOwner,
3482
3567
  onOpenActivity,
3483
- onGrantAccess
3568
+ onGrantAccess,
3569
+ reviewActions
3484
3570
  }) {
3571
+ const [open, setOpen] = useState(false);
3485
3572
  const id = task.external_id;
3486
3573
  const isChat = status === "chat";
3487
3574
  const done = status === "done";
3488
- return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
3575
+ return /* @__PURE__ */ jsxs(DropdownMenu, { open, onOpenChange: setOpen, children: [
3489
3576
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
3490
3577
  Button,
3491
3578
  {
@@ -3498,6 +3585,7 @@ function TaskRowMenu({
3498
3585
  }
3499
3586
  ) }),
3500
3587
  /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", children: [
3588
+ reviewActions && /* @__PURE__ */ jsx("div", { className: "px-2 py-1.5", children: typeof reviewActions === "function" ? reviewActions(() => setOpen(false)) : reviewActions }),
3501
3589
  isOwner && onGrantAccess && task.pending_auth_request_id && /* @__PURE__ */ jsxs(
3502
3590
  DropdownMenuItem,
3503
3591
  {
@@ -4187,23 +4275,33 @@ function TaskTable(props) {
4187
4275
  const isOwner = task.is_owner !== false;
4188
4276
  const canEdit = isOwner || Boolean(p.canEditShared);
4189
4277
  const canAdmin = isOwner || Boolean(p.isWorkspaceOwner);
4278
+ const reviewActions = (closeMenu) => status === "ready_for_review" ? /* @__PURE__ */ jsx(
4279
+ TaskReviewActions,
4280
+ {
4281
+ id,
4282
+ busy,
4283
+ quiet: true,
4284
+ canApprove: task.signoff_ext_id ? Boolean(task.can_signoff) : isOwner,
4285
+ canRequestChanges: Boolean(task.agent_ext_id || task.has_agent_action || task.skill_ref) && canEdit,
4286
+ onApprove: () => {
4287
+ p.onApprove(task);
4288
+ closeMenu?.();
4289
+ },
4290
+ onRequestChanges: (feedback) => {
4291
+ p.onRequestChanges(task, feedback);
4292
+ closeMenu?.();
4293
+ },
4294
+ onRequestApproval: p.onRequestApproval ? (userId, note) => {
4295
+ p.onRequestApproval?.(task, userId, note);
4296
+ closeMenu?.();
4297
+ } : void 0,
4298
+ people: p.people,
4299
+ compact: true,
4300
+ labels: p.reviewLabels
4301
+ }
4302
+ ) : null;
4190
4303
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2", children: [
4191
- !latest.current.narrow && status === "ready_for_review" && /* @__PURE__ */ jsx(
4192
- TaskReviewActions,
4193
- {
4194
- id,
4195
- busy,
4196
- quiet: true,
4197
- canApprove: task.signoff_ext_id ? Boolean(task.can_signoff) : isOwner,
4198
- canRequestChanges: Boolean(task.agent_ext_id) && canEdit,
4199
- onApprove: () => p.onApprove(task),
4200
- onRequestChanges: (feedback) => p.onRequestChanges(task, feedback),
4201
- onRequestApproval: p.onRequestApproval ? (userId, note) => p.onRequestApproval?.(task, userId, note) : void 0,
4202
- people: p.people,
4203
- compact: true,
4204
- labels: p.reviewLabels
4205
- }
4206
- ),
4304
+ !latest.current.narrow && reviewActions(),
4207
4305
  !latest.current.narrow && isOwner && task.pending_auth_request_id && p.onGrantAccess && /* @__PURE__ */ jsxs(
4208
4306
  Button,
4209
4307
  {
@@ -4220,6 +4318,7 @@ function TaskTable(props) {
4220
4318
  /* @__PURE__ */ jsx(
4221
4319
  TaskRowMenu,
4222
4320
  {
4321
+ reviewActions: latest.current.narrow && status === "ready_for_review" ? reviewActions : void 0,
4223
4322
  task,
4224
4323
  status,
4225
4324
  busy,
@@ -4681,6 +4780,15 @@ var hasDocumentInputs = (inputs) => Object.values(inputs).some(
4681
4780
  (v) => v !== null && typeof v === "object" && Array.isArray(v.documents) && (v.documents.length ?? 0) > 0
4682
4781
  );
4683
4782
  function workflowTaskFields(workflow, inputs, name, context) {
4783
+ for (const value of Object.values(inputs)) {
4784
+ if (!value || typeof value !== "object") continue;
4785
+ const scope = value;
4786
+ if (Array.isArray(scope.documents) && !scope.documents.length && ((scope.folders?.length ?? 0) > 0 || (scope.labels?.length ?? 0) > 0)) {
4787
+ throw new Error(
4788
+ "The selected file scope has no documents. Choose a scope containing files before running."
4789
+ );
4790
+ }
4791
+ }
4684
4792
  const typed = name?.trim();
4685
4793
  if (workflow.options?.agent === false) {
4686
4794
  const message = composeWorkflowPrompt(workflow, inputs, context);
@@ -4769,8 +4877,8 @@ function workflowTrigger(values, clearOthers) {
4769
4877
  event_kind: values.when === "event" ? values.eventKind.trim() : none,
4770
4878
  event_filter: values.when === "event" ? values.eventFilter ?? none : none,
4771
4879
  after_conversation_ext_id: values.when === "task" ? values.afterTaskId : none,
4772
- // A saved trigger is never "on demand"; an edit that picks one clears the flag.
4773
- on_demand: false
4880
+ // Saving a run-now template creates an on-demand workflow; other triggers clear it.
4881
+ on_demand: values.when === "now" || values.when === "manual"
4774
4882
  };
4775
4883
  }
4776
4884
  var withoutUndefined = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== void 0));
@@ -4812,7 +4920,7 @@ function taskComposerToUpdateRequest({
4812
4920
  shared: values.shared,
4813
4921
  ...values.signoffUserId ? { signoff_user_ext_id: values.signoffUserId } : {},
4814
4922
  parent_conversation_ext_id: values.parentTaskId || null,
4815
- ...plan ? { plan } : {}
4923
+ ...plan !== void 0 ? { plan } : {}
4816
4924
  };
4817
4925
  }
4818
4926
  function composerToWorkflowUpdate({
@@ -4834,13 +4942,13 @@ function composerToWorkflowUpdate({
4834
4942
  agent_ext_id: values.agentId || null,
4835
4943
  auth_mode: authModeFor(values),
4836
4944
  signoff_user_ext_id: values.signoffUserId || null,
4837
- // The plan to keep or change (the dialog starts from the stored one); it is not cleared from here.
4838
- ...fields.skill_ref === null && fields.prompt && plan ? { plan } : {}
4945
+ // Omission preserves the plan; explicit null removes a stored free-instruction plan.
4946
+ ...fields.skill_ref === null && fields.prompt && plan !== void 0 ? { plan } : {}
4839
4947
  };
4840
4948
  }
4841
4949
  var taskNeedsAccess = (task) => !!task.pending_auth_request_id;
4842
4950
  function taskToComposerValues(task, workflows) {
4843
- const forMe = !task.agent_ext_id && !task.skill_ref;
4951
+ const forMe = !task.agent_ext_id && !task.skill_ref && !task.has_agent_action;
4844
4952
  return {
4845
4953
  assignee: forMe ? "me" : "agent",
4846
4954
  workflowId: forMe ? workflows.reminderWorkflowId : workflows.customWorkflowId,
@@ -4894,7 +5002,10 @@ function workflowToComposerValues(workflow, workflows) {
4894
5002
  // A name made from the instruction follows it when the instruction is edited.
4895
5003
  name: workflow.name === firstWords(workflow.prompt ?? "") ? "" : workflow.name,
4896
5004
  workflowId: workflows.customWorkflowId,
4897
- inputs: { instruction: workflow.prompt }
5005
+ inputs: {
5006
+ ...workflow.skill_inputs ?? {},
5007
+ instruction: workflow.prompt
5008
+ }
4898
5009
  };
4899
5010
  }
4900
5011
  var EMPTY_NEW_THREAD = {
@@ -6101,6 +6212,7 @@ function TaskRunsDialog({
6101
6212
  open,
6102
6213
  onOpenChange,
6103
6214
  taskName,
6215
+ error,
6104
6216
  runs,
6105
6217
  isLoading,
6106
6218
  onOpenRun,
@@ -6124,6 +6236,7 @@ function TaskRunsDialog({
6124
6236
  ] }),
6125
6237
  /* @__PURE__ */ jsx(DialogDescription, { children: l.description })
6126
6238
  ] }),
6239
+ error && /* @__PURE__ */ jsx("p", { role: "alert", className: "rounded-md bg-red-bg p-3 text-sm text-red-text", children: error }),
6127
6240
  isLoading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-8 text-muted-foreground", children: [
6128
6241
  /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }),
6129
6242
  " ",
@@ -6528,11 +6641,14 @@ function WorkflowComposer({
6528
6641
  label: t.name,
6529
6642
  icon: /* @__PURE__ */ jsx(CornerDownRight, { className: GLYPH2, "aria-hidden": true })
6530
6643
  }));
6531
- const whenOptions = WHEN_ORDER.slice(1).map((mode) => ({
6644
+ const whenOptions = (isEdit ? ["manual", ...WHEN_ORDER.slice(1)] : WHEN_ORDER.slice(1)).map((mode) => ({
6532
6645
  id: mode,
6533
6646
  label: l.whenOptions[mode]
6534
6647
  }));
6535
6648
  const assistantOptions = agents.map((a) => ({ id: a.id, label: a.label }));
6649
+ if (values.agentId && !assistantOptions.some((a) => a.id === values.agentId)) {
6650
+ assistantOptions.push({ id: values.agentId, label: "Assigned agent" });
6651
+ }
6536
6652
  const goalNode = typeof goal === "function" ? goal(values) : goal;
6537
6653
  const pickedTemplate = workflows.find((w) => w.id === values.workflowId && !w.generic);
6538
6654
  const hint = (key) => l[key];
@@ -6637,7 +6753,7 @@ function WorkflowComposer({
6637
6753
  goalNode
6638
6754
  ] })
6639
6755
  ] }),
6640
- scheduled && /* @__PURE__ */ jsxs(Fragment, { children: [
6756
+ (scheduled || isEdit) && /* @__PURE__ */ jsxs(Fragment, { children: [
6641
6757
  /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-2", "data-testid": `${id}-when-section`, children: [
6642
6758
  /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium", children: l.whenHeading }),
6643
6759
  /* @__PURE__ */ jsx(
@@ -9059,6 +9175,6 @@ function AgentCreateView({
9059
9175
  ] });
9060
9176
  }
9061
9177
 
9062
- export { AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_NEW_THREAD_DIALOG_LABELS, DEFAULT_PILL_SELECT_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_ACTIVITY_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_LIST_LABELS, DEFAULT_TASK_OUTPUTS_CELL_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_REVIEW_ACTIONS_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TASK_STATUS_PILL_LABELS, DEFAULT_TASK_THREAD_CHIP_LABELS, DEFAULT_TASK_TRIGGER_CHIP_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOWS_CHROME_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, DEFAULT_WORKFLOW_LIST_LABELS, DERIVED_NAME_WORDS, EMPTY_NEW_THREAD, EMPTY_WORKFLOW_SCOPE, GoalCriteria, MAX_TASK_DEPTH, NewThreadDialog, PersonPill, PillSelect, RecurrenceBuilder, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, STATUS_LABELS, STATUS_ORDER, STATUS_TONE, SchemaForm, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TASK_COLUMN_ORDER, TRIGGER_LABELS, TaskActivityDialog, TaskActivityTimeline, TaskComposer, TaskMoveDialog, TaskOutputsCell, TaskPlan, TaskReviewActions, TaskRunsDialog, TaskStatusPill, TaskTable, TaskThreadChip, TaskTriggerChip, TasksToolbar, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WORKFLOW_COLUMN_ORDER, WorkflowConfigDialog, WorkflowLauncher, WorkflowsTable, WorkflowsToolbar, agentConfigSectionToValues, agentCreatorToConfigSection, asTaskStatus, authModeFor, buildLaunch, buildRRule, buildTaskRows, composePersona, composeWorkflowPrompt, composerToTaskQuery, composerToWorkRequest, composerToWorkflowRequest, composerToWorkflowUpdate, createTaskColumns, createWorkflowColumns, createsWork, defaultInputs, defaultScopeRenderer, defaultTaskComposerValues, deriveAgentName, deriveWorkflowName, descendantIds, describeRRule, firstWords, formatElapsed, goalProgress, hasTaskFields, hasTrigger, humanizeSection, indexTasks, inferType, inputDocumentIds, inputsFromContext, isAgenticWorkflow, isEmptyWorkflowScope, isOutOfBounds, isPlainTodo, isSkillRow, isValidAgentName, isWorkflowScope, isoToLocalInput, localInputToIso, moveTargets, newThreadToRequest, nextCriterionId, ownerExtId, parseRRule, prettifyKey, promptFieldName, resolveScopeInputs, skillToWorkflow, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, validateInputs, workflowAccepts, workflowFromFrontmatter, workflowStatus, workflowTaskFields, workflowToComposerValues, workflowTriggerType, workflowWhen, workflowsAccepting, workflowsForHost };
9063
- //# sourceMappingURL=chunk-ENY6XXKR.js.map
9064
- //# sourceMappingURL=chunk-ENY6XXKR.js.map
9178
+ export { AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_NEW_THREAD_DIALOG_LABELS, DEFAULT_PILL_SELECT_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_ACTIVITY_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_LIST_LABELS, DEFAULT_TASK_OUTPUTS_CELL_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_REVIEW_ACTIONS_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TASK_STATUS_PILL_LABELS, DEFAULT_TASK_THREAD_CHIP_LABELS, DEFAULT_TASK_TRIGGER_CHIP_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOWS_CHROME_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, DEFAULT_WORKFLOW_LIST_LABELS, DERIVED_NAME_WORDS, EMPTY_NEW_THREAD, EMPTY_WORKFLOW_SCOPE, GoalCriteria, MAX_TASK_DEPTH, NewThreadDialog, PersonPill, PillSelect, RecurrenceBuilder, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, STATUS_LABELS, STATUS_ORDER, STATUS_TONE, SchemaForm, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TASK_COLUMN_ORDER, TRIGGER_LABELS, TaskActivityDialog, TaskActivityTimeline, TaskComposer, TaskMoveDialog, TaskOutputsCell, TaskPlan, TaskReviewActions, TaskRunsDialog, TaskStatusPill, TaskTable, TaskThreadChip, TaskTriggerChip, TasksToolbar, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WORKFLOW_COLUMN_ORDER, WorkflowConfigDialog, WorkflowDocumentsField, WorkflowLauncher, WorkflowsTable, WorkflowsToolbar, agentConfigSectionToValues, agentCreatorToConfigSection, asTaskStatus, authModeFor, buildLaunch, buildRRule, buildTaskRows, buildWorkflowScopeSource, composePersona, composeWorkflowPrompt, composerToTaskQuery, composerToWorkRequest, composerToWorkflowRequest, composerToWorkflowUpdate, createTaskColumns, createWorkflowColumns, createsWork, defaultInputs, defaultScopeRenderer, defaultTaskComposerValues, deriveAgentName, deriveWorkflowName, descendantIds, describeRRule, firstWords, formatElapsed, goalProgress, hasTaskFields, hasTrigger, humanizeSection, indexTasks, inferType, inputDocumentIds, inputsFromContext, isAgenticWorkflow, isEmptyWorkflowScope, isOutOfBounds, isPlainTodo, isSkillRow, isValidAgentName, isWorkflowScope, isoToLocalInput, localInputToIso, matchWorkflowScope, moveTargets, newThreadToRequest, nextCriterionId, ownerExtId, parseRRule, prettifyKey, promptFieldName, resolveScopeInputs, skillToWorkflow, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, validateInputs, workflowAccepts, workflowFromFrontmatter, workflowStatus, workflowTaskFields, workflowToComposerValues, workflowTriggerType, workflowWhen, workflowsAccepting, workflowsForHost };
9179
+ //# sourceMappingURL=chunk-I7FJS7WG.js.map
9180
+ //# sourceMappingURL=chunk-I7FJS7WG.js.map