@arbidocs/blocks 0.4.89 → 0.4.91

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 (72) hide show
  1. package/dist/agents/index.cjs +283 -282
  2. package/dist/agents/index.js +7 -6
  3. package/dist/agents/workflows/types.d.ts +6 -0
  4. package/dist/{chunk-2CFW2ELM.cjs → chunk-2EI7NCUA.cjs} +2 -8
  5. package/dist/chunk-2EI7NCUA.cjs.map +1 -0
  6. package/dist/chunk-32HW2Q33.cjs +59 -0
  7. package/dist/chunk-32HW2Q33.cjs.map +1 -0
  8. package/dist/{chunk-MOJ5JQDN.cjs → chunk-3US5OIDQ.cjs} +69 -34
  9. package/dist/chunk-3US5OIDQ.cjs.map +1 -0
  10. package/dist/{chunk-DPLRHEJZ.js → chunk-5LXQPP2K.js} +4 -33
  11. package/dist/chunk-5LXQPP2K.js.map +1 -0
  12. package/dist/{chunk-QLHW7JGN.js → chunk-5NQIBJPP.js} +7 -7
  13. package/dist/{chunk-QLHW7JGN.js.map → chunk-5NQIBJPP.js.map} +1 -1
  14. package/dist/{chunk-3D5MDCQ7.js → chunk-5RQOVALO.js} +3 -3
  15. package/dist/{chunk-3D5MDCQ7.js.map → chunk-5RQOVALO.js.map} +1 -1
  16. package/dist/chunk-AUS3KBHJ.js +52 -0
  17. package/dist/chunk-AUS3KBHJ.js.map +1 -0
  18. package/dist/{chunk-CNI5QJ5B.cjs → chunk-DDYXFALG.cjs} +50 -50
  19. package/dist/{chunk-CNI5QJ5B.cjs.map → chunk-DDYXFALG.cjs.map} +1 -1
  20. package/dist/chunk-DVUZTGVL.cjs +52 -0
  21. package/dist/chunk-DVUZTGVL.cjs.map +1 -0
  22. package/dist/{chunk-TF6YMDZL.cjs → chunk-EHF63UYP.cjs} +5 -5
  23. package/dist/{chunk-TF6YMDZL.cjs.map → chunk-EHF63UYP.cjs.map} +1 -1
  24. package/dist/{chunk-I44NX2ZB.js → chunk-PGDL26TQ.js} +69 -34
  25. package/dist/chunk-PGDL26TQ.js.map +1 -0
  26. package/dist/{chunk-ZX2VPMBJ.js → chunk-YU2KUMGE.js} +2 -8
  27. package/dist/chunk-YU2KUMGE.js.map +1 -0
  28. package/dist/components/tones.d.ts +5 -0
  29. package/dist/connect/index.cjs +26 -25
  30. package/dist/connect/index.cjs.map +1 -1
  31. package/dist/connect/index.js +5 -4
  32. package/dist/connect/index.js.map +1 -1
  33. package/dist/facts/FactSourceGroup.d.ts +2 -1
  34. package/dist/facts/index.cjs +6 -6
  35. package/dist/facts/index.cjs.map +1 -1
  36. package/dist/facts/index.js +3 -3
  37. package/dist/facts/index.js.map +1 -1
  38. package/dist/files/cells/LabelMultiSelect.d.ts +11 -3
  39. package/dist/files/index.cjs +23 -16
  40. package/dist/files/index.cjs.map +1 -1
  41. package/dist/files/index.js +20 -13
  42. package/dist/files/index.js.map +1 -1
  43. package/dist/index.cjs +371 -358
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.d.ts +1 -0
  46. package/dist/index.js +54 -49
  47. package/dist/index.js.map +1 -1
  48. package/dist/settings/index.cjs +6 -5
  49. package/dist/settings/index.cjs.map +1 -1
  50. package/dist/settings/index.js +2 -1
  51. package/dist/settings/index.js.map +1 -1
  52. package/dist/shell/FilterInput.d.ts +1 -3
  53. package/dist/shell/index.cjs +4 -4
  54. package/dist/shell/index.js +1 -1
  55. package/dist/site/index.cjs +4 -3
  56. package/dist/site/index.js +2 -1
  57. package/dist/tags/TagDetail.d.ts +10 -1
  58. package/dist/workflow-canvas/FieldOptionsEditor.d.ts +25 -0
  59. package/dist/workflow-canvas/StepInspector.d.ts +6 -2
  60. package/dist/workflow-canvas/index.cjs +179 -50
  61. package/dist/workflow-canvas/index.cjs.map +1 -1
  62. package/dist/workflow-canvas/index.d.ts +1 -0
  63. package/dist/workflow-canvas/index.js +136 -9
  64. package/dist/workflow-canvas/index.js.map +1 -1
  65. package/package.json +4 -4
  66. package/dist/chunk-2CFW2ELM.cjs.map +0 -1
  67. package/dist/chunk-DPLRHEJZ.js.map +0 -1
  68. package/dist/chunk-I44NX2ZB.js.map +0 -1
  69. package/dist/chunk-MOJ5JQDN.cjs.map +0 -1
  70. package/dist/chunk-VFUWWH52.cjs +0 -83
  71. package/dist/chunk-VFUWWH52.cjs.map +0 -1
  72. package/dist/chunk-ZX2VPMBJ.js.map +0 -1
@@ -2,19 +2,20 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
5
- var chunkCNI5QJ5B_cjs = require('../chunk-CNI5QJ5B.cjs');
5
+ var chunkDDYXFALG_cjs = require('../chunk-DDYXFALG.cjs');
6
6
  require('../chunk-S5HZBXZA.cjs');
7
7
  require('../chunk-ZW6FPIFC.cjs');
8
- var chunkMOJ5JQDN_cjs = require('../chunk-MOJ5JQDN.cjs');
8
+ var chunk3US5OIDQ_cjs = require('../chunk-3US5OIDQ.cjs');
9
9
  require('../chunk-N26CXGXC.cjs');
10
10
  require('../chunk-7RGLTF76.cjs');
11
- require('../chunk-Z5VUZ6YD.cjs');
12
- require('../chunk-7D737FLE.cjs');
13
11
  require('../chunk-3AFWGEDJ.cjs');
14
- require('../chunk-VFUWWH52.cjs');
12
+ require('../chunk-DVUZTGVL.cjs');
15
13
  require('../chunk-DETZZBG2.cjs');
14
+ var chunk32HW2Q33_cjs = require('../chunk-32HW2Q33.cjs');
16
15
  require('../chunk-V4ISCZJ7.cjs');
17
- require('../chunk-2CFW2ELM.cjs');
16
+ require('../chunk-2EI7NCUA.cjs');
17
+ require('../chunk-Z5VUZ6YD.cjs');
18
+ require('../chunk-7D737FLE.cjs');
18
19
  require('../chunk-OB5F4577.cjs');
19
20
  require('../chunk-B4SRYJLM.cjs');
20
21
  require('../chunk-7UTB4PHM.cjs');
@@ -59,11 +60,11 @@ function withSteps(workflow, steps, layout) {
59
60
  const run = workflow.run.kind === "steps" ? workflow.run : { kind: "steps", steps: [] };
60
61
  return {
61
62
  ...workflow,
62
- run: { ...run, steps: chunkMOJ5JQDN_cjs.orderSteps(steps), layout: layout ?? run.layout }
63
+ run: { ...run, steps: chunk3US5OIDQ_cjs.orderSteps(steps), layout: layout ?? run.layout }
63
64
  };
64
65
  }
65
66
  var layoutOf = (workflow) => workflow.run.kind === "steps" && workflow.run.layout || {};
66
- var explicit = (steps) => steps.map((s) => ({ ...s, after: chunkMOJ5JQDN_cjs.stepDependencies(steps, s.id) }));
67
+ var explicit = (steps) => steps.map((s) => ({ ...s, after: chunk3US5OIDQ_cjs.stepDependencies(steps, s.id) }));
67
68
  function stepIdFor(steps, title) {
68
69
  const base = title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "") || "step";
69
70
  const taken = new Set(steps.map((s) => s.id));
@@ -110,7 +111,7 @@ function blankStep(kind, id, title) {
110
111
  }
111
112
  }
112
113
  function addStep(workflow, kind, options = {}) {
113
- const steps = explicit(chunkMOJ5JQDN_cjs.workflowSteps(workflow));
114
+ const steps = explicit(chunk3US5OIDQ_cjs.workflowSteps(workflow));
114
115
  const title = options.title ?? DEFAULT_TITLES[kind];
115
116
  const id = stepIdFor(steps, title);
116
117
  const step = { ...blankStep(kind, id, title), after: options.after ? [options.after] : [] };
@@ -119,7 +120,7 @@ function addStep(workflow, kind, options = {}) {
119
120
  return { workflow: withSteps(workflow, [...steps, step], layout), id };
120
121
  }
121
122
  function removeStep(workflow, id) {
122
- const steps = explicit(chunkMOJ5JQDN_cjs.workflowSteps(workflow));
123
+ const steps = explicit(chunk3US5OIDQ_cjs.workflowSteps(workflow));
123
124
  const removed = steps.find((s) => s.id === id);
124
125
  if (!removed) return workflow;
125
126
  const bridged = steps.filter((s) => s.id !== id).map(
@@ -132,8 +133,8 @@ function removeStep(workflow, id) {
132
133
  return withSteps(workflow, bridged, layout);
133
134
  }
134
135
  function connectSteps(workflow, from, to) {
135
- const steps = explicit(chunkMOJ5JQDN_cjs.workflowSteps(workflow));
136
- if (from === to || !steps.some((s) => s.id === from) || chunkMOJ5JQDN_cjs.dependsOn(steps, from, to)) {
136
+ const steps = explicit(chunk3US5OIDQ_cjs.workflowSteps(workflow));
137
+ if (from === to || !steps.some((s) => s.id === from) || chunk3US5OIDQ_cjs.dependsOn(steps, from, to)) {
137
138
  return workflow;
138
139
  }
139
140
  return withSteps(
@@ -143,16 +144,16 @@ function connectSteps(workflow, from, to) {
143
144
  )
144
145
  );
145
146
  }
146
- var wouldCycle = (workflow, from, to) => from === to || chunkMOJ5JQDN_cjs.dependsOn(chunkMOJ5JQDN_cjs.workflowSteps(workflow), from, to);
147
+ var wouldCycle = (workflow, from, to) => from === to || chunk3US5OIDQ_cjs.dependsOn(chunk3US5OIDQ_cjs.workflowSteps(workflow), from, to);
147
148
  function disconnectSteps(workflow, from, to) {
148
- const steps = explicit(chunkMOJ5JQDN_cjs.workflowSteps(workflow));
149
+ const steps = explicit(chunk3US5OIDQ_cjs.workflowSteps(workflow));
149
150
  return withSteps(
150
151
  workflow,
151
152
  steps.map((s) => s.id === to ? { ...s, after: (s.after ?? []).filter((d) => d !== from) } : s)
152
153
  );
153
154
  }
154
155
  function updateStep(workflow, id, patch) {
155
- const steps = explicit(chunkMOJ5JQDN_cjs.workflowSteps(workflow));
156
+ const steps = explicit(chunk3US5OIDQ_cjs.workflowSteps(workflow));
156
157
  return withSteps(
157
158
  workflow,
158
159
  steps.map(
@@ -166,7 +167,7 @@ var renameIn = (text, from, to) => text.replace(
166
167
  );
167
168
  function renameInput(workflow, from, to) {
168
169
  if (from === to) return workflow;
169
- const steps = chunkMOJ5JQDN_cjs.workflowSteps(workflow).map((s) => {
170
+ const steps = chunk3US5OIDQ_cjs.workflowSteps(workflow).map((s) => {
170
171
  if (s.kind === "agent")
171
172
  return {
172
173
  ...s,
@@ -215,13 +216,13 @@ function renameInput(workflow, from, to) {
215
216
  var renamePerson = (a, from, to) => "input" in a && a.input === from ? { input: to } : a;
216
217
  var renameRef = (r, from, to) => "input" in r && r.input === from ? { input: to } : r;
217
218
  function moveStep(workflow, id, position) {
218
- return withSteps(workflow, chunkMOJ5JQDN_cjs.workflowSteps(workflow), { ...layoutOf(workflow), [id]: position });
219
+ return withSteps(workflow, chunk3US5OIDQ_cjs.workflowSteps(workflow), { ...layoutOf(workflow), [id]: position });
219
220
  }
220
221
  var COLUMN = 300;
221
222
  var ROW = 140;
222
223
  function autoLayout(steps) {
223
224
  const layout = {};
224
- chunkMOJ5JQDN_cjs.stepLevels(steps).forEach(
225
+ chunk3US5OIDQ_cjs.stepLevels(steps).forEach(
225
226
  (level, x) => level.forEach((s, y) => {
226
227
  layout[s.id] = { x: x * COLUMN, y: (y - (level.length - 1) / 2) * ROW };
227
228
  })
@@ -229,7 +230,7 @@ function autoLayout(steps) {
229
230
  return layout;
230
231
  }
231
232
  function layoutWithDefaults(workflow) {
232
- const auto = autoLayout(chunkMOJ5JQDN_cjs.workflowSteps(workflow));
233
+ const auto = autoLayout(chunk3US5OIDQ_cjs.workflowSteps(workflow));
233
234
  return { ...auto, ...layoutOf(workflow) };
234
235
  }
235
236
  var DEFAULT_SIGNALS_EDITOR_LABELS = {
@@ -326,9 +327,9 @@ function SignalsEditor({
326
327
  {
327
328
  className: ui.cn(
328
329
  "space-y-1.5 rounded-md border p-2",
329
- chunkMOJ5JQDN_cjs.isIncompleteSignal(signal) ? "border-destructive/50" : "border-border"
330
+ chunk3US5OIDQ_cjs.isIncompleteSignal(signal) ? "border-destructive/50" : "border-border"
330
331
  ),
331
- "data-incomplete": chunkMOJ5JQDN_cjs.isIncompleteSignal(signal) || void 0,
332
+ "data-incomplete": chunk3US5OIDQ_cjs.isIncompleteSignal(signal) || void 0,
332
333
  "data-testid": `${testId}-${i}`,
333
334
  children: [
334
335
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
@@ -979,6 +980,117 @@ function EditDocumentSettings({
979
980
  )
980
981
  ] });
981
982
  }
983
+ var DEFAULT_FIELD_OPTIONS_EDITOR_LABELS = {
984
+ options: "Choices",
985
+ addOption: "Add choice",
986
+ optionLabel: "Choice",
987
+ optionTone: "Colour",
988
+ noTone: "No colour",
989
+ tones: {
990
+ neutral: "Grey",
991
+ info: "Blue",
992
+ success: "Green",
993
+ warning: "Amber",
994
+ danger: "Red",
995
+ accent: "Purple",
996
+ ai: "AI"
997
+ }
998
+ };
999
+ var optionValue = (label, taken) => {
1000
+ const base = label.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "option";
1001
+ let value = base;
1002
+ let n = 2;
1003
+ while (taken.includes(value)) value = `${base}_${n++}`;
1004
+ return value;
1005
+ };
1006
+ function FieldOptionsEditor({
1007
+ options,
1008
+ onChange,
1009
+ l,
1010
+ testId
1011
+ }) {
1012
+ const [fresh, setFresh] = react.useState(() => /* @__PURE__ */ new Set());
1013
+ const others = (i) => options.filter((_, j) => j !== i).map((o) => o.value);
1014
+ const set = (i, p) => {
1015
+ const before = options[i]?.value;
1016
+ if (before !== void 0 && p.value !== void 0 && p.value !== before && fresh.has(before))
1017
+ setFresh((s) => new Set([...s].filter((v) => v !== before)).add(p.value));
1018
+ onChange(options.map((o, j) => j === i ? { ...o, ...p } : o));
1019
+ };
1020
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", "data-testid": `${testId}-options`, children: [
1021
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: l.options }),
1022
+ options.map((o, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", "data-testid": `${testId}-option-${i}`, children: [
1023
+ /* @__PURE__ */ jsxRuntime.jsx(
1024
+ "span",
1025
+ {
1026
+ "aria-hidden": true,
1027
+ className: ui.cn(
1028
+ "size-2 shrink-0 rounded-full",
1029
+ o.tone ? chunk32HW2Q33_cjs.TONE_DOT[o.tone] : "border border-border"
1030
+ )
1031
+ }
1032
+ ),
1033
+ /* @__PURE__ */ jsxRuntime.jsx(
1034
+ ui.Input,
1035
+ {
1036
+ value: o.label,
1037
+ "aria-label": l.optionLabel,
1038
+ onChange: (e) => set(i, {
1039
+ label: e.target.value,
1040
+ // A saved option keeps its value: a signal (`equals: high`) may test it.
1041
+ value: fresh.has(o.value) ? optionValue(e.target.value, others(i)) : o.value
1042
+ }),
1043
+ className: "h-8 min-w-0 flex-1"
1044
+ }
1045
+ ),
1046
+ /* @__PURE__ */ jsxRuntime.jsxs(
1047
+ "select",
1048
+ {
1049
+ "aria-label": l.optionTone,
1050
+ className: ui.cn(selectClass2, "h-8 w-28 shrink-0"),
1051
+ value: o.tone ?? "",
1052
+ onChange: (e) => set(i, { tone: chunk32HW2Q33_cjs.isTone(e.target.value) ? e.target.value : void 0 }),
1053
+ "data-testid": `${testId}-option-${i}-tone`,
1054
+ children: [
1055
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: l.noTone }),
1056
+ chunk32HW2Q33_cjs.TONES.map((t) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: t, children: l.tones[t] }, t))
1057
+ ]
1058
+ }
1059
+ ),
1060
+ /* @__PURE__ */ jsxRuntime.jsx(
1061
+ "button",
1062
+ {
1063
+ type: "button",
1064
+ "aria-label": `${o.label} \xD7`,
1065
+ onClick: () => onChange(options.filter((_, j) => j !== i)),
1066
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4 text-muted-foreground" })
1067
+ }
1068
+ )
1069
+ ] }, i)),
1070
+ /* @__PURE__ */ jsxRuntime.jsxs(
1071
+ ui.Button,
1072
+ {
1073
+ variant: "ghost",
1074
+ size: "sm",
1075
+ onClick: () => {
1076
+ const label = `${l.optionLabel} ${options.length + 1}`;
1077
+ const value = optionValue(
1078
+ label,
1079
+ options.map((o) => o.value)
1080
+ );
1081
+ setFresh((s) => new Set(s).add(value));
1082
+ onChange([...options, { value, label }]);
1083
+ },
1084
+ "data-testid": `${testId}-add-option`,
1085
+ children: [
1086
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-4" }),
1087
+ " ",
1088
+ l.addOption
1089
+ ]
1090
+ }
1091
+ )
1092
+ ] });
1093
+ }
982
1094
  var DEFAULT_STEP_INSPECTOR_LABELS = {
983
1095
  workflow: "Workflow",
984
1096
  title: "Title",
@@ -1016,6 +1128,7 @@ var FIELD_TYPES = [
1016
1128
  "text",
1017
1129
  "longtext",
1018
1130
  "boolean",
1131
+ "select",
1019
1132
  "number",
1020
1133
  "date",
1021
1134
  "scope",
@@ -1040,10 +1153,12 @@ function StepInspector({
1040
1153
  labels,
1041
1154
  actionLabels,
1042
1155
  signalLabels,
1156
+ optionLabels,
1043
1157
  testId = "step-inspector"
1044
1158
  }) {
1045
1159
  const l = { ...DEFAULT_STEP_INSPECTOR_LABELS, ...labels };
1046
- const steps = chunkMOJ5JQDN_cjs.workflowSteps(workflow);
1160
+ const ol = { ...DEFAULT_FIELD_OPTIONS_EDITOR_LABELS, ...optionLabels };
1161
+ const steps = chunk3US5OIDQ_cjs.workflowSteps(workflow);
1047
1162
  const step = steps.find((s) => s.id === stepId);
1048
1163
  const run = workflow.run.kind === "steps" ? workflow.run : void 0;
1049
1164
  if (!step || !run) {
@@ -1070,8 +1185,8 @@ function StepInspector({
1070
1185
  const patch = (p) => onChange(updateStep(workflow, step.id, p));
1071
1186
  const al = { ...DEFAULT_STEP_ACTION_SETTINGS_LABELS, ...actionLabels };
1072
1187
  const ctx = {
1073
- earlier: chunkMOJ5JQDN_cjs.upstreamSteps(steps, step.id),
1074
- fields: chunkMOJ5JQDN_cjs.runFields(workflow),
1188
+ earlier: chunk3US5OIDQ_cjs.upstreamSteps(steps, step.id),
1189
+ fields: chunk3US5OIDQ_cjs.runFields(workflow),
1075
1190
  people,
1076
1191
  tags,
1077
1192
  documents
@@ -1092,7 +1207,7 @@ function StepInspector({
1092
1207
  )
1093
1208
  );
1094
1209
  };
1095
- const deps = chunkMOJ5JQDN_cjs.stepDependencies(steps, step.id);
1210
+ const deps = chunk3US5OIDQ_cjs.stepDependencies(steps, step.id);
1096
1211
  const titleOf = (id) => steps.find((s) => s.id === id)?.title ?? id;
1097
1212
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", "data-testid": `${testId}-step`, children: [
1098
1213
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
@@ -1144,6 +1259,7 @@ function StepInspector({
1144
1259
  taken: takenBy(step.id),
1145
1260
  onChange: (inputs) => setFields(step.inputs, inputs, "inputs"),
1146
1261
  l,
1262
+ optionLabels: ol,
1147
1263
  testId
1148
1264
  }
1149
1265
  ),
@@ -1172,7 +1288,7 @@ function StepInspector({
1172
1288
  {
1173
1289
  step,
1174
1290
  workflows,
1175
- fields: chunkMOJ5JQDN_cjs.runFields(workflow).map((f) => f.name),
1291
+ fields: chunk3US5OIDQ_cjs.runFields(workflow).map((f) => f.name),
1176
1292
  patch,
1177
1293
  l,
1178
1294
  testId
@@ -1197,6 +1313,7 @@ function StepInspector({
1197
1313
  taken: takenBy(step.id),
1198
1314
  onChange: (fields) => setFields(step.fields ?? [], fields, "fields"),
1199
1315
  l: { ...l, fields: l.reviewFields },
1316
+ optionLabels: ol,
1200
1317
  hint: l.reviewFieldsHint,
1201
1318
  testId: `${testId}-review`
1202
1319
  }
@@ -1232,7 +1349,7 @@ function StepInspector({
1232
1349
  testId: `${testId}-review-grid`
1233
1350
  }
1234
1351
  ),
1235
- chunkMOJ5JQDN_cjs.canAssign(step) && /* @__PURE__ */ jsxRuntime.jsx(AssigneeSettings, { step, patch, ctx, l: al, testId }),
1352
+ chunk3US5OIDQ_cjs.canAssign(step) && /* @__PURE__ */ jsxRuntime.jsx(AssigneeSettings, { step, patch, ctx, l: al, testId }),
1236
1353
  /* @__PURE__ */ jsxRuntime.jsx(
1237
1354
  SignalsEditor,
1238
1355
  {
@@ -1267,6 +1384,7 @@ function FormFields({
1267
1384
  taken,
1268
1385
  onChange,
1269
1386
  l,
1387
+ optionLabels = DEFAULT_FIELD_OPTIONS_EDITOR_LABELS,
1270
1388
  hint,
1271
1389
  testId
1272
1390
  }) {
@@ -1323,7 +1441,16 @@ function FormFields({
1323
1441
  l.required
1324
1442
  ] }),
1325
1443
  /* @__PURE__ */ jsxRuntime.jsx("code", { className: "shrink-0 text-[11px] text-muted-foreground", children: `{{${f.name}}}` })
1326
- ] })
1444
+ ] }),
1445
+ f.type === "select" && /* @__PURE__ */ jsxRuntime.jsx(
1446
+ FieldOptionsEditor,
1447
+ {
1448
+ options: f.options ?? [],
1449
+ onChange: (options) => set(i, { options }),
1450
+ l: optionLabels,
1451
+ testId: `${testId}-field-${i}`
1452
+ }
1453
+ )
1327
1454
  ] }, i)),
1328
1455
  /* @__PURE__ */ jsxRuntime.jsxs(
1329
1456
  ui.Button,
@@ -1488,7 +1615,7 @@ function triggerFields(trigger, clearOthers) {
1488
1615
  return {
1489
1616
  timezone: trigger.timezone,
1490
1617
  rrule: trigger.start === "repeat" ? trigger.rrule.trim() : none,
1491
- run_at: trigger.start === "once" ? chunkCNI5QJ5B_cjs.localInputToIso(trigger.runAt) : none,
1618
+ run_at: trigger.start === "once" ? chunkDDYXFALG_cjs.localInputToIso(trigger.runAt) : none,
1492
1619
  event_kind: trigger.start === "event" ? trigger.eventKind.trim() : none,
1493
1620
  // A step signal is `workflow_signal` narrowed to one signal name.
1494
1621
  event_filter: filter ?? none,
@@ -1504,7 +1631,7 @@ function plan(value, options) {
1504
1631
  criteria: [],
1505
1632
  max_passes: 3,
1506
1633
  documents: [],
1507
- steps: chunkMOJ5JQDN_cjs.toPlanSteps(value.workflow, options)
1634
+ steps: chunk3US5OIDQ_cjs.toPlanSteps(value.workflow, options)
1508
1635
  };
1509
1636
  }
1510
1637
  function builderToWorkflowRequest(value, workspaceId, options = {}) {
@@ -1539,7 +1666,7 @@ function builderToWorkflowUpdate(value, options = {}) {
1539
1666
  }
1540
1667
  function workflowRecordToBuilder(record) {
1541
1668
  const planned = record.plan?.steps ?? [];
1542
- const steps = planned.length ? chunkMOJ5JQDN_cjs.fromPlanSteps(planned) : record.prompt || record.skill_ref ? [
1669
+ const steps = planned.length ? chunk3US5OIDQ_cjs.fromPlanSteps(planned) : record.prompt || record.skill_ref ? [
1543
1670
  {
1544
1671
  id: "work",
1545
1672
  kind: "agent",
@@ -1547,7 +1674,7 @@ function workflowRecordToBuilder(record) {
1547
1674
  ...record.skill_ref ? { workflow: record.skill_ref } : { run: { kind: "prompt", promptTemplate: record.prompt } }
1548
1675
  }
1549
1676
  ] : [];
1550
- const when = chunkCNI5QJ5B_cjs.workflowWhen(record);
1677
+ const when = chunkDDYXFALG_cjs.workflowWhen(record);
1551
1678
  return {
1552
1679
  workflow: {
1553
1680
  id: record.external_id,
@@ -1556,12 +1683,12 @@ function workflowRecordToBuilder(record) {
1556
1683
  inputs: [],
1557
1684
  landing: "chat",
1558
1685
  schedulable: false,
1559
- run: { kind: "steps", steps, layout: chunkMOJ5JQDN_cjs.layoutFromPlanSteps(planned ?? []) }
1686
+ run: { kind: "steps", steps, layout: chunk3US5OIDQ_cjs.layoutFromPlanSteps(planned ?? []) }
1560
1687
  },
1561
1688
  trigger: {
1562
1689
  ...DEFAULT_WORKFLOW_TRIGGER,
1563
1690
  start: when === "now" ? "manual" : when,
1564
- runAt: chunkCNI5QJ5B_cjs.isoToLocalInput(record.run_at),
1691
+ runAt: chunkDDYXFALG_cjs.isoToLocalInput(record.run_at),
1565
1692
  rrule: record.rrule ?? "",
1566
1693
  timezone: record.timezone || DEFAULT_WORKFLOW_TRIGGER.timezone,
1567
1694
  eventKind: record.event_kind ?? "",
@@ -1617,7 +1744,7 @@ function triggerSummary(trigger, options = {}) {
1617
1744
  case "once":
1618
1745
  return trigger.runAt ? new Date(trigger.runAt).toLocaleString() : l.starts.once;
1619
1746
  case "repeat":
1620
- return trigger.rrule ? chunkCNI5QJ5B_cjs.describeRRule(trigger.rrule) : l.starts.repeat;
1747
+ return trigger.rrule ? chunkDDYXFALG_cjs.describeRRule(trigger.rrule) : l.starts.repeat;
1621
1748
  case "event":
1622
1749
  if (isSignalTrigger(trigger))
1623
1750
  return trigger.signal ? l.signalSummary.replace("{signal}", trigger.signal) : l.stepSignals;
@@ -1676,7 +1803,7 @@ function TriggerInspector({
1676
1803
  }
1677
1804
  )
1678
1805
  ] }),
1679
- trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkCNI5QJ5B_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
1806
+ trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkDDYXFALG_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
1680
1807
  trigger.start === "event" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
1681
1808
  /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.event }),
1682
1809
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1728,7 +1855,7 @@ function TriggerInspector({
1728
1855
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
1729
1856
  /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.agent }),
1730
1857
  /* @__PURE__ */ jsxRuntime.jsx(
1731
- chunkCNI5QJ5B_cjs.AgentSelect,
1858
+ chunkDDYXFALG_cjs.AgentSelect,
1732
1859
  {
1733
1860
  agents,
1734
1861
  value: trigger.agentId,
@@ -2038,12 +2165,12 @@ function WorkflowCanvas({
2038
2165
  testId = "workflow-canvas"
2039
2166
  }) {
2040
2167
  const l = react.useMemo(() => ({ ...DEFAULT_WORKFLOW_CANVAS_LABELS, ...labels }), [labels]);
2041
- const steps = chunkMOJ5JQDN_cjs.workflowSteps(workflow);
2168
+ const steps = chunk3US5OIDQ_cjs.workflowSteps(workflow);
2042
2169
  const editable = !!onChange;
2043
2170
  const built = react.useMemo(() => {
2044
2171
  const layout = layoutWithDefaults(workflow);
2045
- const all = chunkMOJ5JQDN_cjs.workflowSteps(workflow);
2046
- const roots = all.filter((s) => chunkMOJ5JQDN_cjs.stepDependencies(all, s.id).length === 0);
2172
+ const all = chunk3US5OIDQ_cjs.workflowSteps(workflow);
2173
+ const roots = all.filter((s) => chunk3US5OIDQ_cjs.stepDependencies(all, s.id).length === 0);
2047
2174
  const triggerNode = trigger ? [
2048
2175
  {
2049
2176
  id: TRIGGER_NODE,
@@ -2092,7 +2219,7 @@ function WorkflowCanvas({
2092
2219
  react.useEffect(() => setNodes(built), [built]);
2093
2220
  const edges = react.useMemo(
2094
2221
  () => steps.flatMap((s) => {
2095
- const deps = chunkMOJ5JQDN_cjs.stepDependencies(steps, s.id);
2222
+ const deps = chunk3US5OIDQ_cjs.stepDependencies(steps, s.id);
2096
2223
  const from = deps.length ? deps : trigger ? [TRIGGER_NODE] : [];
2097
2224
  return from.map((d) => ({
2098
2225
  id: `${d}->${s.id}`,
@@ -2343,12 +2470,12 @@ function WorkflowBuilder({
2343
2470
  const [mode, setMode] = react.useState("design");
2344
2471
  const [adding, setAdding] = react.useState(false);
2345
2472
  const { workflow, trigger } = value;
2346
- const steps = chunkMOJ5JQDN_cjs.workflowSteps(workflow);
2347
- const problems = chunkMOJ5JQDN_cjs.validateWorkflowGraph(steps);
2348
- const missing = chunkMOJ5JQDN_cjs.stepConfigProblems(steps);
2473
+ const steps = chunk3US5OIDQ_cjs.workflowSteps(workflow);
2474
+ const problems = chunk3US5OIDQ_cjs.validateWorkflowGraph(steps);
2475
+ const missing = chunk3US5OIDQ_cjs.stepConfigProblems(steps);
2349
2476
  const nameOf = (id) => people.find((p) => p.value === id)?.label;
2350
- const fields = chunkMOJ5JQDN_cjs.runFields(workflow);
2351
- const assigneeOf = (step) => chunkMOJ5JQDN_cjs.canAssign(step) ? chunkMOJ5JQDN_cjs.assigneeName(step.assignee, { nameOf, fields }) : void 0;
2477
+ const fields = chunk3US5OIDQ_cjs.runFields(workflow);
2478
+ const assigneeOf = (step) => chunk3US5OIDQ_cjs.canAssign(step) ? chunk3US5OIDQ_cjs.assigneeName(step.assignee, { nameOf, fields }) : void 0;
2352
2479
  const titles = react.useMemo(() => new Map(workflows.map((w) => [w.id, w.title])), [workflows]);
2353
2480
  const setWorkflow = (next) => onChange({ ...value, workflow: next });
2354
2481
  const addAfter = (from, kind) => {
@@ -2579,13 +2706,13 @@ function WorkflowPreview({
2579
2706
  renderIcon,
2580
2707
  testId
2581
2708
  }) {
2582
- const run = chunkCNI5QJ5B_cjs.useWorkflowPreview(workflow, {
2709
+ const run = chunkDDYXFALG_cjs.useWorkflowPreview(workflow, {
2583
2710
  resolveWorkflow: (id) => workflows.find((w) => w.id === id),
2584
2711
  compose,
2585
2712
  answer
2586
2713
  });
2587
2714
  return /* @__PURE__ */ jsxRuntime.jsx(
2588
- chunkMOJ5JQDN_cjs.WorkflowRunner,
2715
+ chunk3US5OIDQ_cjs.WorkflowRunner,
2589
2716
  {
2590
2717
  workflow,
2591
2718
  run,
@@ -2673,7 +2800,7 @@ function ConnectedWorkflowBuilder({
2673
2800
  () => [
2674
2801
  ...hostWorkflows,
2675
2802
  ...(skills.data ?? []).map(
2676
- (s) => chunkMOJ5JQDN_cjs.skillToWorkflow({
2803
+ (s) => chunk3US5OIDQ_cjs.skillToWorkflow({
2677
2804
  name: s.name,
2678
2805
  slug: s.slug,
2679
2806
  description: s.description,
@@ -2689,7 +2816,7 @@ function ConnectedWorkflowBuilder({
2689
2816
  }));
2690
2817
  const tasks = (conversations.data ?? []).filter((c) => c.status && c.status !== "done").map((c) => ({ value: c.external_id, label: c.title || c.external_id }));
2691
2818
  const options = { resolveWorkflow: (wid) => workflows.find((w) => w.id === wid), compose };
2692
- const problem = triggerProblem(value.trigger) ?? (chunkMOJ5JQDN_cjs.validateWorkflowGraph(chunkMOJ5JQDN_cjs.workflowSteps(value.workflow)).length || chunkMOJ5JQDN_cjs.stepConfigProblems(chunkMOJ5JQDN_cjs.workflowSteps(value.workflow)).length ? "graph" : null);
2819
+ const problem = triggerProblem(value.trigger) ?? (chunk3US5OIDQ_cjs.validateWorkflowGraph(chunk3US5OIDQ_cjs.workflowSteps(value.workflow)).length || chunk3US5OIDQ_cjs.stepConfigProblems(chunk3US5OIDQ_cjs.workflowSteps(value.workflow)).length ? "graph" : null);
2693
2820
  const busy = !!pending || create.isPending || update.isPending || run.isPending;
2694
2821
  const save = async () => {
2695
2822
  if (!workspaceId) return void 0;
@@ -2775,6 +2902,7 @@ function ConnectedWorkflowBuilder({
2775
2902
 
2776
2903
  exports.ConnectedWorkflowBuilder = ConnectedWorkflowBuilder;
2777
2904
  exports.DEFAULT_CONNECTED_WORKFLOW_BUILDER_LABELS = DEFAULT_CONNECTED_WORKFLOW_BUILDER_LABELS;
2905
+ exports.DEFAULT_FIELD_OPTIONS_EDITOR_LABELS = DEFAULT_FIELD_OPTIONS_EDITOR_LABELS;
2778
2906
  exports.DEFAULT_SIGNALS_EDITOR_LABELS = DEFAULT_SIGNALS_EDITOR_LABELS;
2779
2907
  exports.DEFAULT_STEP_INSPECTOR_LABELS = DEFAULT_STEP_INSPECTOR_LABELS;
2780
2908
  exports.DEFAULT_TRIGGER_INSPECTOR_LABELS = DEFAULT_TRIGGER_INSPECTOR_LABELS;
@@ -2782,6 +2910,7 @@ exports.DEFAULT_WORKFLOW_BUILDER_LABELS = DEFAULT_WORKFLOW_BUILDER_LABELS;
2782
2910
  exports.DEFAULT_WORKFLOW_CANVAS_LABELS = DEFAULT_WORKFLOW_CANVAS_LABELS;
2783
2911
  exports.DEFAULT_WORKFLOW_EVENT_KINDS = DEFAULT_WORKFLOW_EVENT_KINDS;
2784
2912
  exports.DEFAULT_WORKFLOW_TRIGGER = DEFAULT_WORKFLOW_TRIGGER;
2913
+ exports.FieldOptionsEditor = FieldOptionsEditor;
2785
2914
  exports.SignalsEditor = SignalsEditor;
2786
2915
  exports.StepInspector = StepInspector;
2787
2916
  exports.TRIGGER_NODE = TRIGGER_NODE;