@arbidocs/blocks 0.4.26 → 0.4.28

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 (109) 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 +180 -180
  13. package/dist/chat/index.js +5 -5
  14. package/dist/{chunk-CPJBU5XQ.js → chunk-3NZR6PAG.js} +8 -120
  15. package/dist/chunk-3NZR6PAG.js.map +1 -0
  16. package/dist/chunk-4XJZ6AAY.js +407 -0
  17. package/dist/chunk-4XJZ6AAY.js.map +1 -0
  18. package/dist/{chunk-UOLMFC5K.js → chunk-6YVI74BC.js} +498 -108
  19. package/dist/chunk-6YVI74BC.js.map +1 -0
  20. package/dist/{chunk-5LUI4G5R.js → chunk-BV7FEMSI.js} +3 -3
  21. package/dist/{chunk-5LUI4G5R.js.map → chunk-BV7FEMSI.js.map} +1 -1
  22. package/dist/{chunk-ZEIOREJY.js → chunk-EHXSBH6U.js} +37 -6
  23. package/dist/chunk-EHXSBH6U.js.map +1 -0
  24. package/dist/chunk-EYPPB5CY.cjs +85 -0
  25. package/dist/chunk-EYPPB5CY.cjs.map +1 -0
  26. package/dist/{chunk-LZ4O2JPP.cjs → chunk-FRRDPYBR.cjs} +8 -123
  27. package/dist/chunk-FRRDPYBR.cjs.map +1 -0
  28. package/dist/chunk-KF4EC5XU.js +68 -0
  29. package/dist/chunk-KF4EC5XU.js.map +1 -0
  30. package/dist/{chunk-DHMAJ5LC.cjs → chunk-NSZAHL23.cjs} +158 -39
  31. package/dist/chunk-NSZAHL23.cjs.map +1 -0
  32. package/dist/{chunk-MLI6MCIE.js → chunk-QMUI2MGT.js} +155 -39
  33. package/dist/chunk-QMUI2MGT.js.map +1 -0
  34. package/dist/chunk-S5HZBXZA.cjs +430 -0
  35. package/dist/chunk-S5HZBXZA.cjs.map +1 -0
  36. package/dist/{chunk-JCVZKCXC.cjs → chunk-TLQQV7WW.cjs} +37 -6
  37. package/dist/chunk-TLQQV7WW.cjs.map +1 -0
  38. package/dist/{chunk-NNH7N62N.cjs → chunk-VMCOH3AY.cjs} +497 -105
  39. package/dist/chunk-VMCOH3AY.cjs.map +1 -0
  40. package/dist/{chunk-JLPYOPCX.js → chunk-WSJVHSGN.js} +225 -36
  41. package/dist/chunk-WSJVHSGN.js.map +1 -0
  42. package/dist/{chunk-TO4FAMQP.cjs → chunk-XKSFJYOD.cjs} +3 -3
  43. package/dist/{chunk-TO4FAMQP.cjs.map → chunk-XKSFJYOD.cjs.map} +1 -1
  44. package/dist/{chunk-J22DXUJY.cjs → chunk-ZHLMDJCO.cjs} +226 -34
  45. package/dist/chunk-ZHLMDJCO.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 +281 -39
  52. package/dist/connect/index.cjs.map +1 -1
  53. package/dist/connect/index.d.ts +4 -0
  54. package/dist/connect/index.js +261 -23
  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 +2 -2
  71. package/dist/facts/index.js +2 -2
  72. package/dist/files/index.cjs +5 -5
  73. package/dist/files/index.js +5 -5
  74. package/dist/home/index.cjs +1 -1
  75. package/dist/home/index.js +1 -1
  76. package/dist/index.cjs +953 -941
  77. package/dist/index.js +20 -20
  78. package/dist/settings/index.cjs +44 -234
  79. package/dist/settings/index.cjs.map +1 -1
  80. package/dist/settings/index.js +8 -204
  81. package/dist/settings/index.js.map +1 -1
  82. package/dist/shell/index.cjs +26 -26
  83. package/dist/shell/index.js +4 -4
  84. package/dist/studio/index.cjs +7 -6
  85. package/dist/studio/index.cjs.map +1 -1
  86. package/dist/studio/index.js +5 -4
  87. package/dist/studio/index.js.map +1 -1
  88. package/dist/workspaces/index.cjs +1 -1
  89. package/dist/workspaces/index.js +1 -1
  90. package/package.json +3 -3
  91. package/src/docx/styles.css +13 -0
  92. package/dist/chunk-5TRALRWN.js +0 -42
  93. package/dist/chunk-5TRALRWN.js.map +0 -1
  94. package/dist/chunk-CPJBU5XQ.js.map +0 -1
  95. package/dist/chunk-CQCC7LE7.js +0 -210
  96. package/dist/chunk-CQCC7LE7.js.map +0 -1
  97. package/dist/chunk-DHMAJ5LC.cjs.map +0 -1
  98. package/dist/chunk-EUOGPUMJ.cjs +0 -59
  99. package/dist/chunk-EUOGPUMJ.cjs.map +0 -1
  100. package/dist/chunk-J22DXUJY.cjs.map +0 -1
  101. package/dist/chunk-JCVZKCXC.cjs.map +0 -1
  102. package/dist/chunk-JLPYOPCX.js.map +0 -1
  103. package/dist/chunk-LZ4O2JPP.cjs.map +0 -1
  104. package/dist/chunk-MLI6MCIE.js.map +0 -1
  105. package/dist/chunk-NNH7N62N.cjs.map +0 -1
  106. package/dist/chunk-RFIBUWLF.cjs +0 -232
  107. package/dist/chunk-RFIBUWLF.cjs.map +0 -1
  108. package/dist/chunk-UOLMFC5K.js.map +0 -1
  109. package/dist/chunk-ZEIOREJY.js.map +0 -1
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkRFIBUWLF_cjs = require('./chunk-RFIBUWLF.cjs');
5
4
  var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
6
5
  var chunkJGZTRLKL_cjs = require('./chunk-JGZTRLKL.cjs');
7
6
  var chunkZVPTFTGV_cjs = require('./chunk-ZVPTFTGV.cjs');
8
- var chunk5B4PXAKI_cjs = require('./chunk-5B4PXAKI.cjs');
7
+ var chunkS5HZBXZA_cjs = require('./chunk-S5HZBXZA.cjs');
8
+ var chunkVFUWWH52_cjs = require('./chunk-VFUWWH52.cjs');
9
9
  var chunkOB5F4577_cjs = require('./chunk-OB5F4577.cjs');
10
+ var chunk5B4PXAKI_cjs = require('./chunk-5B4PXAKI.cjs');
10
11
  var chunkC54XEN5T_cjs = require('./chunk-C54XEN5T.cjs');
11
- var chunkVFUWWH52_cjs = require('./chunk-VFUWWH52.cjs');
12
- var chunk2ZTONLT5_cjs = require('./chunk-2ZTONLT5.cjs');
13
12
  var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
13
+ var chunk2ZTONLT5_cjs = require('./chunk-2ZTONLT5.cjs');
14
14
  var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
15
15
  var react = require('react');
16
16
  var ui = require('@arbidocs/react/ui');
@@ -614,10 +614,8 @@ function WorkflowConfigDialog({
614
614
  }) {
615
615
  const l = { ...DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, ...labels };
616
616
  const initialKey = JSON.stringify(initialInputs ?? {});
617
- const seed = react.useMemo(
618
- () => ({ ...defaultInputs(workflow), ...JSON.parse(initialKey) }),
619
- [workflow, initialKey]
620
- );
617
+ const seedKey = JSON.stringify({ ...defaultInputs(workflow), ...JSON.parse(initialKey) });
618
+ const seed = react.useMemo(() => JSON.parse(seedKey), [seedKey]);
621
619
  const [inputs, setInputs] = useControllableState(inputsProp, seed, onInputsChange);
622
620
  const [agentId, setAgentId] = useControllableState(
623
621
  agentIdProp,
@@ -887,6 +885,93 @@ function WorkflowLauncher({
887
885
  )
888
886
  ] });
889
887
  }
888
+
889
+ // src/agents/workflows/workspaceScope.ts
890
+ var canonical = (path) => (path ?? "").split("/").map((part) => part.trim()).filter(Boolean).join("/");
891
+ function matchWorkflowScope(docs, scope) {
892
+ if (scope.documents?.length) {
893
+ const ids = new Set(scope.documents);
894
+ return docs.filter((doc) => ids.has(doc.external_id));
895
+ }
896
+ if (!scope.folders.length && !scope.labels.length) return docs;
897
+ const folders = scope.folders.map(canonical);
898
+ const labels = new Set(scope.labels);
899
+ return docs.filter((doc) => {
900
+ const folder = canonical(doc.folder);
901
+ return folders.some(
902
+ (path) => path === "" ? folder === "" : folder === path || folder.startsWith(`${path}/`)
903
+ ) || doc.doctags?.some((tag) => labels.has(tag.tag_ext_id));
904
+ });
905
+ }
906
+ function buildWorkflowScopeSource(docs, labels = []) {
907
+ const counts = /* @__PURE__ */ new Map();
908
+ for (const doc of docs) {
909
+ const parts = canonical(doc.folder).split("/").filter(Boolean);
910
+ for (let i = 1; i <= parts.length; i++) {
911
+ const path = parts.slice(0, i).join("/");
912
+ counts.set(path, (counts.get(path) ?? 0) + 1);
913
+ }
914
+ }
915
+ return {
916
+ folders: [...counts].sort(([a], [b]) => a.localeCompare(b)).map(([path, count]) => ({
917
+ path,
918
+ count,
919
+ label: path.split("/").at(-1),
920
+ depth: path.split("/").length - 1
921
+ })),
922
+ unfiledCount: docs.filter((doc) => !canonical(doc.folder)).length,
923
+ labels: labels.map((label) => ({
924
+ id: label.external_id,
925
+ name: label.name,
926
+ color: label.color ?? "currentColor",
927
+ count: docs.filter((doc) => doc.doctags?.some((tag) => tag.tag_ext_id === label.external_id)).length
928
+ })),
929
+ totalCount: docs.length,
930
+ countMatching: (scope) => matchWorkflowScope(docs, scope).length,
931
+ resolveDocuments: (scope) => matchWorkflowScope(docs, scope).map((doc) => doc.external_id)
932
+ };
933
+ }
934
+ function WorkflowDocumentsField({
935
+ field,
936
+ value,
937
+ onChange,
938
+ documents,
939
+ addFilesAction
940
+ }) {
941
+ const ids = value.documents ?? [];
942
+ const max = field.max ?? 1;
943
+ const set = (documents2) => onChange({ ...value, documents: documents2 });
944
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-testid": `workflow-documents-${field.name}`, className: "space-y-2", children: [
945
+ /* @__PURE__ */ jsxRuntime.jsx(
946
+ chunkS5HZBXZA_cjs.DocumentPicker,
947
+ {
948
+ groups: [{ id: "workspace", docs: documents }],
949
+ value: ids[0] ?? "",
950
+ selected: documents.find((doc) => doc.id === ids[0]),
951
+ selectedIds: max > 1 ? ids : void 0,
952
+ onValueChange: (id) => set(
953
+ ids.includes(id) ? ids.filter((selected) => selected !== id) : [...ids, id].slice(-max)
954
+ )
955
+ }
956
+ ),
957
+ ids.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: ids.map((id) => /* @__PURE__ */ jsxRuntime.jsxs(
958
+ ui.Button,
959
+ {
960
+ type: "button",
961
+ variant: "outline",
962
+ size: "sm",
963
+ onClick: () => set(ids.filter((selected) => selected !== id)),
964
+ "aria-label": `Remove ${documents.find((doc) => doc.id === id)?.title ?? id}`,
965
+ children: [
966
+ documents.find((doc) => doc.id === id)?.title ?? id,
967
+ " \xD7"
968
+ ]
969
+ },
970
+ id
971
+ )) }),
972
+ addFilesAction
973
+ ] });
974
+ }
890
975
  var DEFAULT_AGENT_CARD_LABELS = {
891
976
  running: "Running",
892
977
  runningIndicator: "Running",
@@ -3332,7 +3417,7 @@ function TaskReviewActions({
3332
3417
  // src/agents/tasks/taskRows.ts
3333
3418
  var MAX_TASK_DEPTH = 5;
3334
3419
  var ownerExtId = (task) => task.signoff_ext_id || task.owner_ext_id || task.created_by_ext_id || null;
3335
- var isPlainTodo = (task) => !task.agent_ext_id && !task.skill_ref;
3420
+ var isPlainTodo = (task) => !task.agent_ext_id && !task.has_agent_action && !task.skill_ref;
3336
3421
  function indexTasks(tasks) {
3337
3422
  const byId = new Map(tasks.map((t) => [t.external_id, t]));
3338
3423
  const kids = /* @__PURE__ */ new Map();
@@ -3482,12 +3567,14 @@ function TaskRowMenu({
3482
3567
  onMoveTo,
3483
3568
  onChangeOwner,
3484
3569
  onOpenActivity,
3485
- onGrantAccess
3570
+ onGrantAccess,
3571
+ reviewActions
3486
3572
  }) {
3573
+ const [open, setOpen] = react.useState(false);
3487
3574
  const id = task.external_id;
3488
3575
  const isChat = status === "chat";
3489
3576
  const done = status === "done";
3490
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
3577
+ return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { open, onOpenChange: setOpen, children: [
3491
3578
  /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
3492
3579
  ui.Button,
3493
3580
  {
@@ -3500,6 +3587,7 @@ function TaskRowMenu({
3500
3587
  }
3501
3588
  ) }),
3502
3589
  /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuContent, { align: "end", children: [
3590
+ reviewActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1.5", children: typeof reviewActions === "function" ? reviewActions(() => setOpen(false)) : reviewActions }),
3503
3591
  isOwner && onGrantAccess && task.pending_auth_request_id && /* @__PURE__ */ jsxRuntime.jsxs(
3504
3592
  ui.DropdownMenuItem,
3505
3593
  {
@@ -4189,23 +4277,33 @@ function TaskTable(props) {
4189
4277
  const isOwner = task.is_owner !== false;
4190
4278
  const canEdit = isOwner || Boolean(p.canEditShared);
4191
4279
  const canAdmin = isOwner || Boolean(p.isWorkspaceOwner);
4280
+ const reviewActions = (closeMenu) => status === "ready_for_review" ? /* @__PURE__ */ jsxRuntime.jsx(
4281
+ TaskReviewActions,
4282
+ {
4283
+ id,
4284
+ busy,
4285
+ quiet: true,
4286
+ canApprove: task.signoff_ext_id ? Boolean(task.can_signoff) : isOwner,
4287
+ canRequestChanges: Boolean(task.agent_ext_id || task.has_agent_action || task.skill_ref) && canEdit,
4288
+ onApprove: () => {
4289
+ p.onApprove(task);
4290
+ closeMenu?.();
4291
+ },
4292
+ onRequestChanges: (feedback) => {
4293
+ p.onRequestChanges(task, feedback);
4294
+ closeMenu?.();
4295
+ },
4296
+ onRequestApproval: p.onRequestApproval ? (userId, note) => {
4297
+ p.onRequestApproval?.(task, userId, note);
4298
+ closeMenu?.();
4299
+ } : void 0,
4300
+ people: p.people,
4301
+ compact: true,
4302
+ labels: p.reviewLabels
4303
+ }
4304
+ ) : null;
4192
4305
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
4193
- !latest.current.narrow && status === "ready_for_review" && /* @__PURE__ */ jsxRuntime.jsx(
4194
- TaskReviewActions,
4195
- {
4196
- id,
4197
- busy,
4198
- quiet: true,
4199
- canApprove: task.signoff_ext_id ? Boolean(task.can_signoff) : isOwner,
4200
- canRequestChanges: Boolean(task.agent_ext_id) && canEdit,
4201
- onApprove: () => p.onApprove(task),
4202
- onRequestChanges: (feedback) => p.onRequestChanges(task, feedback),
4203
- onRequestApproval: p.onRequestApproval ? (userId, note) => p.onRequestApproval?.(task, userId, note) : void 0,
4204
- people: p.people,
4205
- compact: true,
4206
- labels: p.reviewLabels
4207
- }
4208
- ),
4306
+ !latest.current.narrow && reviewActions(),
4209
4307
  !latest.current.narrow && isOwner && task.pending_auth_request_id && p.onGrantAccess && /* @__PURE__ */ jsxRuntime.jsxs(
4210
4308
  ui.Button,
4211
4309
  {
@@ -4222,6 +4320,7 @@ function TaskTable(props) {
4222
4320
  /* @__PURE__ */ jsxRuntime.jsx(
4223
4321
  TaskRowMenu,
4224
4322
  {
4323
+ reviewActions: latest.current.narrow && status === "ready_for_review" ? reviewActions : void 0,
4225
4324
  task,
4226
4325
  status,
4227
4326
  busy,
@@ -4683,6 +4782,15 @@ var hasDocumentInputs = (inputs) => Object.values(inputs).some(
4683
4782
  (v) => v !== null && typeof v === "object" && Array.isArray(v.documents) && (v.documents.length ?? 0) > 0
4684
4783
  );
4685
4784
  function workflowTaskFields(workflow, inputs, name, context) {
4785
+ for (const value of Object.values(inputs)) {
4786
+ if (!value || typeof value !== "object") continue;
4787
+ const scope = value;
4788
+ if (Array.isArray(scope.documents) && !scope.documents.length && ((scope.folders?.length ?? 0) > 0 || (scope.labels?.length ?? 0) > 0)) {
4789
+ throw new Error(
4790
+ "The selected file scope has no documents. Choose a scope containing files before running."
4791
+ );
4792
+ }
4793
+ }
4686
4794
  const typed = name?.trim();
4687
4795
  if (workflow.options?.agent === false) {
4688
4796
  const message = composeWorkflowPrompt(workflow, inputs, context);
@@ -4771,8 +4879,8 @@ function workflowTrigger(values, clearOthers) {
4771
4879
  event_kind: values.when === "event" ? values.eventKind.trim() : none,
4772
4880
  event_filter: values.when === "event" ? values.eventFilter ?? none : none,
4773
4881
  after_conversation_ext_id: values.when === "task" ? values.afterTaskId : none,
4774
- // A saved trigger is never "on demand"; an edit that picks one clears the flag.
4775
- on_demand: false
4882
+ // Saving a run-now template creates an on-demand workflow; other triggers clear it.
4883
+ on_demand: values.when === "now" || values.when === "manual"
4776
4884
  };
4777
4885
  }
4778
4886
  var withoutUndefined = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== void 0));
@@ -4814,7 +4922,7 @@ function taskComposerToUpdateRequest({
4814
4922
  shared: values.shared,
4815
4923
  ...values.signoffUserId ? { signoff_user_ext_id: values.signoffUserId } : {},
4816
4924
  parent_conversation_ext_id: values.parentTaskId || null,
4817
- ...plan ? { plan } : {}
4925
+ ...plan !== void 0 ? { plan } : {}
4818
4926
  };
4819
4927
  }
4820
4928
  function composerToWorkflowUpdate({
@@ -4836,13 +4944,13 @@ function composerToWorkflowUpdate({
4836
4944
  agent_ext_id: values.agentId || null,
4837
4945
  auth_mode: authModeFor(values),
4838
4946
  signoff_user_ext_id: values.signoffUserId || null,
4839
- // The plan to keep or change (the dialog starts from the stored one); it is not cleared from here.
4840
- ...fields.skill_ref === null && fields.prompt && plan ? { plan } : {}
4947
+ // Omission preserves the plan; explicit null removes a stored free-instruction plan.
4948
+ ...fields.skill_ref === null && fields.prompt && plan !== void 0 ? { plan } : {}
4841
4949
  };
4842
4950
  }
4843
4951
  var taskNeedsAccess = (task) => !!task.pending_auth_request_id;
4844
4952
  function taskToComposerValues(task, workflows) {
4845
- const forMe = !task.agent_ext_id && !task.skill_ref;
4953
+ const forMe = !task.agent_ext_id && !task.skill_ref && !task.has_agent_action;
4846
4954
  return {
4847
4955
  assignee: forMe ? "me" : "agent",
4848
4956
  workflowId: forMe ? workflows.reminderWorkflowId : workflows.customWorkflowId,
@@ -4896,7 +5004,10 @@ function workflowToComposerValues(workflow, workflows) {
4896
5004
  // A name made from the instruction follows it when the instruction is edited.
4897
5005
  name: workflow.name === firstWords(workflow.prompt ?? "") ? "" : workflow.name,
4898
5006
  workflowId: workflows.customWorkflowId,
4899
- inputs: { instruction: workflow.prompt }
5007
+ inputs: {
5008
+ ...workflow.skill_inputs ?? {},
5009
+ instruction: workflow.prompt
5010
+ }
4900
5011
  };
4901
5012
  }
4902
5013
  var EMPTY_NEW_THREAD = {
@@ -6103,6 +6214,7 @@ function TaskRunsDialog({
6103
6214
  open,
6104
6215
  onOpenChange,
6105
6216
  taskName,
6217
+ error,
6106
6218
  runs,
6107
6219
  isLoading,
6108
6220
  onOpenRun,
@@ -6126,6 +6238,7 @@ function TaskRunsDialog({
6126
6238
  ] }),
6127
6239
  /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: l.description })
6128
6240
  ] }),
6241
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "rounded-md bg-red-bg p-3 text-sm text-red-text", children: error }),
6129
6242
  isLoading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-8 text-muted-foreground", children: [
6130
6243
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }),
6131
6244
  " ",
@@ -6530,11 +6643,14 @@ function WorkflowComposer({
6530
6643
  label: t.name,
6531
6644
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CornerDownRight, { className: GLYPH2, "aria-hidden": true })
6532
6645
  }));
6533
- const whenOptions = WHEN_ORDER.slice(1).map((mode) => ({
6646
+ const whenOptions = (isEdit ? ["manual", ...WHEN_ORDER.slice(1)] : WHEN_ORDER.slice(1)).map((mode) => ({
6534
6647
  id: mode,
6535
6648
  label: l.whenOptions[mode]
6536
6649
  }));
6537
6650
  const assistantOptions = agents.map((a) => ({ id: a.id, label: a.label }));
6651
+ if (values.agentId && !assistantOptions.some((a) => a.id === values.agentId)) {
6652
+ assistantOptions.push({ id: values.agentId, label: "Assigned agent" });
6653
+ }
6538
6654
  const goalNode = typeof goal === "function" ? goal(values) : goal;
6539
6655
  const pickedTemplate = workflows.find((w) => w.id === values.workflowId && !w.generic);
6540
6656
  const hint = (key) => l[key];
@@ -6639,7 +6755,7 @@ function WorkflowComposer({
6639
6755
  goalNode
6640
6756
  ] })
6641
6757
  ] }),
6642
- scheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6758
+ (scheduled || isEdit) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6643
6759
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-2", "data-testid": `${id}-when-section`, children: [
6644
6760
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium", children: l.whenHeading }),
6645
6761
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -9029,7 +9145,7 @@ function AgentCreateView({
9029
9145
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-normal text-muted-foreground", children: l.optional })
9030
9146
  ] }),
9031
9147
  /* @__PURE__ */ jsxRuntime.jsx(
9032
- chunkRFIBUWLF_cjs.MultiSelect,
9148
+ chunkS5HZBXZA_cjs.MultiSelect,
9033
9149
  {
9034
9150
  data: workspaces.map((ws) => ({ label: ws.name, value: ws.id })),
9035
9151
  value: selectedWorkspaces,
@@ -9196,6 +9312,7 @@ exports.UploadTaskList = UploadTaskList;
9196
9312
  exports.WEEKDAYS = WEEKDAYS;
9197
9313
  exports.WORKFLOW_COLUMN_ORDER = WORKFLOW_COLUMN_ORDER;
9198
9314
  exports.WorkflowConfigDialog = WorkflowConfigDialog;
9315
+ exports.WorkflowDocumentsField = WorkflowDocumentsField;
9199
9316
  exports.WorkflowLauncher = WorkflowLauncher;
9200
9317
  exports.WorkflowsTable = WorkflowsTable;
9201
9318
  exports.WorkflowsToolbar = WorkflowsToolbar;
@@ -9206,6 +9323,7 @@ exports.authModeFor = authModeFor;
9206
9323
  exports.buildLaunch = buildLaunch;
9207
9324
  exports.buildRRule = buildRRule;
9208
9325
  exports.buildTaskRows = buildTaskRows;
9326
+ exports.buildWorkflowScopeSource = buildWorkflowScopeSource;
9209
9327
  exports.composePersona = composePersona;
9210
9328
  exports.composeWorkflowPrompt = composeWorkflowPrompt;
9211
9329
  exports.composerToTaskQuery = composerToTaskQuery;
@@ -9241,6 +9359,7 @@ exports.isValidAgentName = isValidAgentName;
9241
9359
  exports.isWorkflowScope = isWorkflowScope;
9242
9360
  exports.isoToLocalInput = isoToLocalInput;
9243
9361
  exports.localInputToIso = localInputToIso;
9362
+ exports.matchWorkflowScope = matchWorkflowScope;
9244
9363
  exports.moveTargets = moveTargets;
9245
9364
  exports.newThreadToRequest = newThreadToRequest;
9246
9365
  exports.nextCriterionId = nextCriterionId;
@@ -9267,5 +9386,5 @@ exports.workflowTriggerType = workflowTriggerType;
9267
9386
  exports.workflowWhen = workflowWhen;
9268
9387
  exports.workflowsAccepting = workflowsAccepting;
9269
9388
  exports.workflowsForHost = workflowsForHost;
9270
- //# sourceMappingURL=chunk-DHMAJ5LC.cjs.map
9271
- //# sourceMappingURL=chunk-DHMAJ5LC.cjs.map
9389
+ //# sourceMappingURL=chunk-NSZAHL23.cjs.map
9390
+ //# sourceMappingURL=chunk-NSZAHL23.cjs.map